Skip to content

feat: let dependents run add-location - #6

Draft
MattDHill wants to merge 1 commit into
masterfrom
feat/dependent-add-location
Draft

MattDHill wants to merge 1 commit into
masterfrom
feat/dependent-add-location

Conversation

@MattDHill

Copy link
Copy Markdown
Member

Summary

Add Location now has access: 'dependent'. A service that declares NextExplorer as a dependency can create a location of its own by running the action directly (sdk.action.run({ packageId: 'nextexplorer', actionId: 'add-location', input: () => ({ name }) })), with no task for the user to run.

The handler reads caller. For a service caller, a location that already exists is a success (it returns null), because a dependent runs this every time it is configured. Every other check still applies: reserved names (_users, personal, share, volumes), a leading dot, a slash. A user running the action sees no change.

The first consumer is Paperless-ngx's consume folder: Start9-Community/paperless-startos#11 (Start9-Community/paperless-startos#10).

The change is folded into the unreleased 3.1.0:1 (on alpha only, not beta), with one sentence added to its release notes.

Draft until the SDK 3.0 sweep lands here

caller and running another package's action with input both ship in @start9labs/start-sdk 3.0.0 (Start9Labs/start-technologies#4045, #4069), which needs StartOS 0.4.0.2. This repo's 3.0.0 bump belongs to the fleet sweep's PR, so against 2.0.9 the type-check fails on caller:

startos/actions/locations/add.ts(40,28): error TS2339: Property 'caller' does not exist on type '{ effects: Effects; input: { name: string; }; spec: InputSpec; }'.

Against a local 3.0.0 build, the only error is the sweep's §5 execFail signature change in importFromFileBrowser.ts:112, which the bump PR fixes.

To finish once the sweep PR is in:

  • rebase onto it
  • if 3.1.0:1 has reached beta by then, move the version past it, and set Paperless's nextexplorerVersionRange floor to match
  • get the build gate green
  • verify on a 0.4.0.2 box, together with the Paperless PR

Not exercised on a box.

🤖 Generated with Claude Code

Add Location takes `access: 'dependent'`, so a service that declares
NextExplorer as a dependency can create a location of its own with
`sdk.action.run`. For such a caller (`caller` non-null) a location that
already exists is a success, since a dependent calls it every time it is
configured. The user's path is unchanged.

Built against @start9labs/start-sdk 3.0.0 (`caller`, cross-package
`action.run` with input); held as a draft until the 3.0.0 fleet sweep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant