feat(commands): add hosted external-app onboarding - #269
Conversation
Greptile SummaryAdds hosted external-app command onboarding.
Confidence Score: 5/5The PR appears safe to merge based on the eligible follow-up findings. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/commands/src/bootstrap.ts | Adds hosted bootstrap, connection validation, credential refresh, and one-time retry behavior. |
| packages/commands/src/client.ts | Adds the hosted deployment client factory and routes manager requests through refreshable connections. |
| packages/commands/src/receiver-config.ts | Centralizes injected and hosted receiver configuration, token loading, and connection providers. |
| packages/commands/src/receiver.ts | Integrates refreshable receiver connections while preserving lease processing and shutdown behavior. |
| crates/alien-manager/src/auth/command_capability.rs | Defines shared deployment- and target-scoped authorization decisions for command capabilities. |
| crates/alien-manager/src/routes/commands.rs | Applies command-capability authorization across dispatch, status, lease, release, and response routes. |
| crates/alien-manager/src/auth/subject.rs | Adds the serialized commands scope, sender/receiver capability variants, and command-capability role. |
| crates/alien-manager/src/stores/sqlite/command_registry.rs | Extends canonical command ownership context with target information for receiver authorization. |
Sequence Diagram
sequenceDiagram
participant App as External app
participant Platform as Hosted Platform API
participant Manager as Deployment manager
participant Target as Command target
App->>Platform: Bootstrap with deployment ID and API key
Platform-->>App: Manager URL and short-lived capability
alt Sender
App->>Manager: Create command
Manager->>Target: Dispatch or queue command
App->>Manager: Poll command status
else Receiver
App->>Manager: Acquire target-scoped lease
Manager-->>App: Command envelope
App->>Manager: Submit response or release lease
end
opt Capability expires or manager returns 401
App->>Platform: Refresh bootstrap
Platform-->>App: Updated manager URL and capability
end
Reviews (8): Last reviewed commit: "chore(sdk): sync commands bootstrap API ..." | Re-trigger Greptile
…standalone-commands # Conflicts: # packages/commands/src/index.ts
…standalone-commands
AWS CloudFormation E2E verificationTested this PR end to end at Alien head Run details:
The local cross-target release build required a Linux arm64 native bindings addon. Building that addon from this exact commit resolved the prerequisite; it was not a runtime or CloudFormation failure. The run exposed a pre-existing project/artifact lifecycle gap: project deletion does not remove its per-project ECR repository. The exact test repository and image were manually deleted after the run; this is not introduced by this PR and did not affect the functional result. Fresh simplicity/security review found no material issues. CI is green and the PR is mergeable. |
Final hosted Commands E2E resultRetested the external hosted Commands API end to end against this exact PR head ( Exact package under test
Verification completed
Result: pass. This covered the actual hosted bootstrap endpoint, both new convenience APIs, short-lived sender/receiver capabilities, manager polling and leasing, response submission, and sender result polling—not the older direct Final cleanup passed: the CloudFormation stack and per-run cloud resources were deleted, local test services and volumes were stopped, and temporary credentials were removed. A final cloud re-list found no resources for the run. Manual fixture: https://github.com/lilienblum/alien-test/tree/dan/ALIEN-422-standalone-commands-fixture/standalone-commands |
Summary
await CommandsClient.forDeployment({ deploymentId, apiKey })for hosted senderscreateCommandReceiver({ deploymentId, apiKey, target })for external Container/Daemon receivers401The Alien API key is sent only to the hosted bootstrap endpoint; managers receive only a short-lived command capability.
Validation
Rust crates: passedTypeScript packages and CLIs: passedcargo check -p alien-managergit diff --checkDraft follow-up