firedrill-run 2.2.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -22
- package/bin/firedrill.mjs +29 -5
- package/dist/assembly.json +13 -0
- package/dist/cli/runtime/candidate_copy.py +395 -0
- package/dist/cli/runtime/source_snapshot.py +391 -0
- package/dist/cli/src/administration.js +295 -0
- package/dist/cli/src/agent-changes.js +496 -0
- package/dist/cli/src/assessment-requests.js +67 -0
- package/dist/cli/src/auth.js +465 -0
- package/dist/cli/src/billing-commerce-contracts.js +1 -0
- package/dist/cli/src/billing-usage.js +227 -0
- package/dist/cli/src/billing-wallet-contracts.js +1 -0
- package/dist/cli/src/billing.js +170 -0
- package/dist/cli/src/bootstrap-process-lock.js +136 -0
- package/dist/cli/src/browser-links.js +14 -0
- package/dist/cli/src/campaign-controls.js +122 -0
- package/dist/cli/src/campaign-diagnoses.js +118 -0
- package/dist/cli/src/campaign-reports.js +1215 -0
- package/dist/cli/src/campaign-world.js +156 -0
- package/dist/cli/src/candidate-copy.js +376 -0
- package/dist/cli/src/catalog-contracts.js +1 -0
- package/dist/cli/src/ci-access-contracts.js +1 -0
- package/dist/cli/src/ci-configuration-contracts.js +1 -0
- package/dist/cli/src/ci-coverage.js +64 -0
- package/dist/cli/src/ci-delivery-contracts.js +1 -0
- package/dist/cli/src/ci-result-contracts.js +1 -0
- package/dist/cli/src/ci-run-contracts.js +1 -0
- package/dist/cli/src/ci-setup-proposals.js +52 -0
- package/dist/cli/src/company-policies.js +229 -0
- package/dist/cli/src/completion.js +79 -0
- package/dist/cli/src/configuration-intents.js +277 -0
- package/dist/cli/src/configuration.js +369 -0
- package/dist/cli/src/continuous-simulation.js +277 -0
- package/dist/cli/src/coordinated-checkpoints.js +133 -0
- package/dist/cli/src/credential-mode.js +139 -0
- package/dist/cli/src/credentials.js +331 -0
- package/dist/cli/src/credit-format.js +8 -0
- package/dist/cli/src/dataset-contracts.js +1 -0
- package/dist/cli/src/dataset-export.js +154 -0
- package/dist/cli/src/dataset-reads.js +37 -0
- package/dist/cli/src/dependency-preparation.js +239 -0
- package/dist/cli/src/director-tool-setup.js +104 -0
- package/dist/cli/src/driver-review.js +225 -0
- package/dist/cli/src/evaluation-authoring.js +315 -0
- package/dist/cli/src/evidence-bundles.js +367 -0
- package/dist/cli/src/execution-proposals.js +36 -0
- package/dist/cli/src/http.js +302 -0
- package/dist/cli/src/local-container-boundary.js +38 -0
- package/dist/cli/src/local-container-policy.js +201 -0
- package/dist/cli/src/local-execution-setup.js +81 -0
- package/dist/cli/src/local-source-basis.js +73 -0
- package/dist/cli/src/local-source.js +66 -0
- package/dist/cli/src/local-value-store.js +91 -0
- package/dist/cli/src/local-values.js +163 -0
- package/dist/cli/src/login-organizations.js +70 -0
- package/dist/cli/src/main.js +1622 -0
- package/dist/cli/src/mcp-connection.js +109 -0
- package/dist/cli/src/native/bindings.js +137 -0
- package/dist/cli/src/native/canonical.js +370 -0
- package/dist/cli/src/native/cloud-resources.js +942 -0
- package/dist/cli/src/native/companion-channel.js +421 -0
- package/dist/cli/src/native/companion-ipc.js +473 -0
- package/dist/cli/src/native/contracts.js +218 -0
- package/dist/cli/src/native/control-plane.js +1354 -0
- package/dist/cli/src/native/credit-approval.js +15 -0
- package/dist/cli/src/native/dependency-proxy.js +1006 -0
- package/dist/cli/src/native/drill-cleanup.js +115 -0
- package/dist/cli/src/native/drill-runner.js +1562 -0
- package/dist/cli/src/native/drivers/action-trace.js +210 -0
- package/dist/cli/src/native/drivers/function-wrapper.js +152 -0
- package/dist/cli/src/native/drivers/http.js +442 -0
- package/dist/cli/src/native/drivers/index.js +47 -0
- package/dist/cli/src/native/drivers/jsonl-process.js +538 -0
- package/dist/cli/src/native/drivers/playwright.js +600 -0
- package/dist/cli/src/native/drivers/signed-event.js +244 -0
- package/dist/cli/src/native/drivers/types.js +578 -0
- package/dist/cli/src/native/evidence-filter.js +255 -0
- package/dist/cli/src/native/isolated-access.js +241 -0
- package/dist/cli/src/native/library-sharing.js +220 -0
- package/dist/cli/src/native/local-run.js +667 -0
- package/dist/cli/src/native/local-secrets.js +19 -0
- package/dist/cli/src/native/mcp-config.js +123 -0
- package/dist/cli/src/native/metadata-requests.js +120 -0
- package/dist/cli/src/native/observations.js +1159 -0
- package/dist/cli/src/native/owned-groups.js +46 -0
- package/dist/cli/src/native/plan.js +594 -0
- package/dist/cli/src/native/png.js +159 -0
- package/dist/cli/src/native/ports.js +43 -0
- package/dist/cli/src/native/readiness.js +139 -0
- package/dist/cli/src/native/reassessments.js +206 -0
- package/dist/cli/src/native/redaction.js +235 -0
- package/dist/cli/src/native/registration.js +155 -0
- package/dist/cli/src/native/roots.js +110 -0
- package/dist/cli/src/native/run-cleanup.js +199 -0
- package/dist/cli/src/native/scratch.js +117 -0
- package/dist/cli/src/native/screenshots.js +60 -0
- package/dist/cli/src/native/session.js +556 -0
- package/dist/cli/src/native/standalone-proxy.js +580 -0
- package/dist/cli/src/native/standalone-renewals.js +183 -0
- package/dist/cli/src/native/standalone-state.js +193 -0
- package/dist/cli/src/native/standalone-tools.js +187 -0
- package/dist/cli/src/native/supervisor.js +831 -0
- package/dist/cli/src/native/target-auth.js +161 -0
- package/dist/cli/src/native/target-state.js +330 -0
- package/dist/cli/src/native/tool-reuse.js +364 -0
- package/dist/cli/src/native/tool-setups.js +336 -0
- package/dist/cli/src/native/world-reuse.js +288 -0
- package/dist/cli/src/onboarding.js +23 -0
- package/dist/cli/src/priority-requests.js +70 -0
- package/dist/cli/src/priority.js +223 -0
- package/dist/cli/src/prompts.js +184 -0
- package/dist/cli/src/real-operations.js +221 -0
- package/dist/cli/src/recipe-intents.js +58 -0
- package/dist/cli/src/recorded-context-intents.js +59 -0
- package/dist/cli/src/recorded-context.js +248 -0
- package/dist/cli/src/recordings.js +69 -0
- package/dist/cli/src/registration-guide.js +39 -0
- package/dist/cli/src/report-exports.js +213 -0
- package/dist/cli/src/request-input.js +47 -0
- package/dist/cli/src/resource-lifecycle.js +141 -0
- package/dist/cli/src/revision-requests.js +55 -0
- package/dist/cli/src/runner-abandon.js +53 -0
- package/dist/cli/src/runner-campaign-controls.js +262 -0
- package/dist/cli/src/runner-claim-reads.js +36 -0
- package/dist/cli/src/runner-completion.js +65 -0
- package/dist/cli/src/runner-configuration.js +546 -0
- package/dist/cli/src/runner-container.js +794 -0
- package/dist/cli/src/runner-evidence-erasure.js +351 -0
- package/dist/cli/src/runner-evidence-privacy.js +37 -0
- package/dist/cli/src/runner-evidence-retention.js +161 -0
- package/dist/cli/src/runner-evidence.js +326 -0
- package/dist/cli/src/runner-execute.js +92 -0
- package/dist/cli/src/runner-execution-deadline.js +25 -0
- package/dist/cli/src/runner-grants.js +307 -0
- package/dist/cli/src/runner-identity.js +615 -0
- package/dist/cli/src/runner-inputs.js +308 -0
- package/dist/cli/src/runner-jobs.js +49 -0
- package/dist/cli/src/runner-model-transport.js +392 -0
- package/dist/cli/src/runner-ownership.js +332 -0
- package/dist/cli/src/runner-process-lock.js +175 -0
- package/dist/cli/src/runner-runtime.js +396 -0
- package/dist/cli/src/runner-session-channel.js +377 -0
- package/dist/cli/src/runner-trial-completion.js +34 -0
- package/dist/cli/src/runner-trial-journal.js +358 -0
- package/dist/cli/src/runner-trial-live.js +393 -0
- package/dist/cli/src/runner-trial-protocol.js +289 -0
- package/dist/cli/src/runner-trial-sync.js +110 -0
- package/dist/cli/src/runner-trial-transfer.js +107 -0
- package/dist/cli/src/runner-voice.js +40 -0
- package/dist/cli/src/runner-world-claim.js +21 -0
- package/dist/cli/src/runner-world-collector.js +159 -0
- package/dist/cli/src/runner-world-command-evidence.js +487 -0
- package/dist/cli/src/runner-world-commands.js +268 -0
- package/dist/cli/src/runner-world-completion.js +76 -0
- package/dist/cli/src/runner-world-erasure.js +95 -0
- package/dist/cli/src/runner-world-evidence-sync.js +91 -0
- package/dist/cli/src/runner-world-journal.js +510 -0
- package/dist/cli/src/runner-world-native-filters.js +134 -0
- package/dist/cli/src/runner-world-observations.js +50 -0
- package/dist/cli/src/runner-world-session-protocol.js +134 -0
- package/dist/cli/src/saved-records.js +40 -0
- package/dist/cli/src/scenario-authoring.js +212 -0
- package/dist/cli/src/scenario-discovery.js +216 -0
- package/dist/cli/src/scenario-paths.js +68 -0
- package/dist/cli/src/scenario-requests.js +4 -0
- package/dist/cli/src/service-receipts.js +105 -0
- package/dist/cli/src/simple/authoring.js +270 -0
- package/dist/cli/src/simple/credit-approval.js +16 -0
- package/dist/cli/src/simple/help.js +98 -0
- package/dist/cli/src/simple/init.js +61 -0
- package/dist/cli/src/simple/library-sharing.js +414 -0
- package/dist/cli/src/simple/metadata-requests.js +46 -0
- package/dist/cli/src/simple/native-report.js +841 -0
- package/dist/cli/src/simple/native-tools.js +780 -0
- package/dist/cli/src/simple/plan-apply.js +506 -0
- package/dist/cli/src/simple/reassessment.js +323 -0
- package/dist/cli/src/simple/register.js +123 -0
- package/dist/cli/src/simple/run.js +122 -0
- package/dist/cli/src/simple/status.js +49 -0
- package/dist/cli/src/simple/tool-renewal.js +308 -0
- package/dist/cli/src/simple/tool-reuse.js +526 -0
- package/dist/cli/src/simple/tool-start-catalog.js +100 -0
- package/dist/cli/src/simple/tool-state.js +426 -0
- package/dist/cli/src/simple/tools-author.js +222 -0
- package/dist/cli/src/simple/watch.js +28 -0
- package/dist/cli/src/simple/world-reuse.js +586 -0
- package/dist/cli/src/simulation-intents.js +406 -0
- package/dist/cli/src/simulation-run.js +1058 -0
- package/dist/cli/src/source-batch.js +322 -0
- package/dist/cli/src/source-connection.js +451 -0
- package/dist/cli/src/source-runtime.js +346 -0
- package/dist/cli/src/source-selection-intents.js +75 -0
- package/dist/cli/src/source-sets.js +214 -0
- package/dist/cli/src/target-models.js +109 -0
- package/dist/cli/src/tool-catalog.js +224 -0
- package/dist/cli/src/tool-command-contracts.js +1 -0
- package/dist/cli/src/tool-command-export.js +245 -0
- package/dist/cli/src/tool-connection-contracts.js +1 -0
- package/dist/cli/src/tool-connection-reads.js +23 -0
- package/dist/cli/src/tool-contributions.js +58 -0
- package/dist/cli/src/tool-data.js +116 -0
- package/dist/cli/src/tool-datasets.js +176 -0
- package/dist/cli/src/tool-group-contracts.js +1 -0
- package/dist/cli/src/tool-group-reads.js +26 -0
- package/dist/cli/src/tool-group-state.js +147 -0
- package/dist/cli/src/tool-groups.js +311 -0
- package/dist/cli/src/tool-instances.js +186 -0
- package/dist/cli/src/tool-lifecycle-contracts.js +1 -0
- package/dist/cli/src/tool-lifecycle-reads.js +30 -0
- package/dist/cli/src/tool-lifecycle.js +323 -0
- package/dist/cli/src/tool-package-contracts.js +1 -0
- package/dist/cli/src/tool-package-reads.js +41 -0
- package/dist/cli/src/tool-records.js +53 -0
- package/dist/cli/src/tool-runtime.js +96 -0
- package/dist/cli/src/tool-state-contracts.js +1 -0
- package/dist/cli/src/tool-state-reads.js +31 -0
- package/dist/cli/src/tools.js +306 -0
- package/dist/cli/src/trial-actions.js +93 -0
- package/dist/cli/src/trial-checkpoints.js +133 -0
- package/dist/cli/src/trial-checks.js +70 -0
- package/dist/cli/src/trial-state.js +197 -0
- package/dist/cli/src/vault.js +266 -0
- package/dist/cli/src/workspace-registration.js +383 -0
- package/dist/cli/src/workspace-team-contracts.js +1 -0
- package/dist/cli/src/world-access.js +231 -0
- package/dist/cli/src/world-agent.js +4 -0
- package/dist/cli/src/world-checkpoint-scopes.js +15 -0
- package/dist/cli/src/world-contracts.js +6 -0
- package/dist/cli/src/world-creation.js +201 -0
- package/dist/cli/src/world-datasets.js +207 -0
- package/dist/cli/src/world-inspection.js +257 -0
- package/dist/cli/src/world-recipes.js +103 -0
- package/dist/cli/src/world-requests.js +241 -0
- package/dist/cli/src/world-session-checkpoints.js +196 -0
- package/dist/cli/src/world-session-lifecycle.js +207 -0
- package/dist/cli/src/world-session-requests.js +215 -0
- package/dist/cli/src/world-session-state.js +145 -0
- package/dist/cli/src/world-session-voice.js +66 -0
- package/dist/cli/src/world-sessions.js +288 -0
- package/dist/cli/src/world-stream.js +99 -0
- package/dist/cli/src/world-time-report.js +58 -0
- package/dist/contracts/agent-change-contracts.js +75 -0
- package/dist/contracts/agent-execution-contracts.js +38 -0
- package/dist/contracts/application-state-contracts.js +26 -0
- package/dist/contracts/assessment-aggregate-contracts.js +15 -0
- package/dist/contracts/assessment-contracts.js +74 -0
- package/dist/contracts/billing-commerce-contracts.js +107 -0
- package/dist/contracts/billing-wallet-contracts.js +43 -0
- package/dist/contracts/campaign-lifecycle.js +1 -0
- package/dist/contracts/campaign-world-contracts.js +80 -0
- package/dist/contracts/catalog-contracts.js +73 -0
- package/dist/contracts/ci-access-contracts.js +68 -0
- package/dist/contracts/ci-configuration-contracts.js +88 -0
- package/dist/contracts/ci-coverage-contracts.js +65 -0
- package/dist/contracts/ci-coverage-labels.js +25 -0
- package/dist/contracts/ci-delivery-contracts.js +61 -0
- package/dist/contracts/ci-result-contracts.js +103 -0
- package/dist/contracts/ci-run-contracts.js +51 -0
- package/dist/contracts/ci-setup-contracts.js +88 -0
- package/dist/contracts/clip-contracts.js +32 -0
- package/dist/contracts/comparison-contracts.js +53 -0
- package/dist/contracts/composite-contracts.js +34 -0
- package/dist/contracts/context-contracts.js +76 -0
- package/dist/contracts/continuation-report-contracts.js +1 -0
- package/dist/contracts/continuity-requirements.js +8 -0
- package/dist/contracts/coordinated-checkpoint-contracts.js +34 -0
- package/dist/contracts/dataset-contracts.js +88 -0
- package/dist/contracts/dependency-decision-contracts.js +36 -0
- package/dist/contracts/dependency-protocol-contracts.js +43 -0
- package/dist/contracts/director-execution.js +51 -0
- package/dist/contracts/driver-review-contracts.js +99 -0
- package/dist/contracts/evidence-contracts.js +65 -0
- package/dist/contracts/evidence-coverage-contracts.js +10 -0
- package/dist/contracts/export-contracts.js +44 -0
- package/dist/contracts/github-directory-contracts.js +96 -0
- package/dist/contracts/insight-contracts.js +11 -0
- package/dist/contracts/inspection-contracts.js +1 -0
- package/dist/contracts/local-claim-contracts.js +39 -0
- package/dist/contracts/local-configuration-contracts.js +7 -0
- package/dist/contracts/local-evidence-contracts.js +32 -0
- package/dist/contracts/local-grant-contracts.js +83 -0
- package/dist/contracts/local-input-contracts.js +19 -0
- package/dist/contracts/local-runner-contracts.js +42 -0
- package/dist/contracts/local-trial-live-contracts.js +16 -0
- package/dist/contracts/local-value-source-contracts.js +92 -0
- package/dist/contracts/local-world-native-contracts.js +8 -0
- package/dist/contracts/mcp-contracts.js +42 -0
- package/dist/contracts/media-contracts.js +28 -0
- package/dist/contracts/native-check-contracts.js +31 -0
- package/dist/contracts/native-identity-contracts.js +52 -0
- package/dist/contracts/onboarding-contracts.js +32 -0
- package/dist/contracts/performance-contracts.js +85 -0
- package/dist/contracts/planning-contracts.js +81 -0
- package/dist/contracts/real-operation-contracts.js +30 -0
- package/dist/contracts/recommendation-contracts.js +54 -0
- package/dist/contracts/report-contracts.js +1 -0
- package/dist/contracts/resource-lifecycle-contracts.js +57 -0
- package/dist/contracts/revision-contracts.js +12 -0
- package/dist/contracts/revision-request-contracts.js +39 -0
- package/dist/contracts/saved-record-contracts.js +76 -0
- package/dist/contracts/scenario-draft-comparison.js +91 -0
- package/dist/contracts/scenario-world-contracts.js +14 -0
- package/dist/contracts/service-contracts.js +1 -0
- package/dist/contracts/session-command-contracts.js +56 -0
- package/dist/contracts/session-contracts.js +65 -0
- package/dist/contracts/session-state-contracts.js +67 -0
- package/dist/contracts/session-voice-contracts.js +45 -0
- package/dist/contracts/source-set-contracts.js +26 -0
- package/dist/contracts/source-upload-contracts.js +22 -0
- package/dist/contracts/tool-command-contracts.js +57 -0
- package/dist/contracts/tool-connection-contracts.js +87 -0
- package/dist/contracts/tool-contribution-contracts.js +35 -0
- package/dist/contracts/tool-group-contracts.js +53 -0
- package/dist/contracts/tool-group-state-contracts.js +63 -0
- package/dist/contracts/tool-lifecycle-contracts.js +94 -0
- package/dist/contracts/tool-package-contracts.js +91 -0
- package/dist/contracts/tool-protocol-contracts.js +71 -0
- package/dist/contracts/tool-runtime-billing-contracts.js +28 -0
- package/dist/contracts/tool-setup-proposal.js +59 -0
- package/dist/contracts/tool-state-contracts.js +79 -0
- package/dist/contracts/trial-state-contracts.js +30 -0
- package/dist/contracts/typescript/agent-change.js +1 -0
- package/dist/contracts/typescript/assessment-aggregate.js +1 -0
- package/dist/contracts/typescript/assessment.js +1 -0
- package/dist/contracts/typescript/billing-commerce.js +1 -0
- package/dist/contracts/typescript/campaigns.js +1 -0
- package/dist/contracts/typescript/catalog.js +1 -0
- package/dist/contracts/typescript/ci-access.js +1 -0
- package/dist/contracts/typescript/ci-configuration.js +1 -0
- package/dist/contracts/typescript/ci-delivery.js +1 -0
- package/dist/contracts/typescript/ci-result.js +1 -0
- package/dist/contracts/typescript/ci-runs.js +1 -0
- package/dist/contracts/typescript/clips.js +1 -0
- package/dist/contracts/typescript/comparison.js +1 -0
- package/dist/contracts/typescript/composite.js +1 -0
- package/dist/contracts/typescript/connections.js +1 -0
- package/dist/contracts/typescript/context.js +1 -0
- package/dist/contracts/typescript/datasets.js +1 -0
- package/dist/contracts/typescript/evidence-coverage.js +1 -0
- package/dist/contracts/typescript/export.js +1 -0
- package/dist/contracts/typescript/github-directory.js +1 -0
- package/dist/contracts/typescript/insight.js +1 -0
- package/dist/contracts/typescript/inspection.js +1 -0
- package/dist/contracts/typescript/intake.js +1 -0
- package/dist/contracts/typescript/local-claim.js +1 -0
- package/dist/contracts/typescript/local-configuration.js +1 -0
- package/dist/contracts/typescript/local-evidence.js +1 -0
- package/dist/contracts/typescript/local-grant.js +1 -0
- package/dist/contracts/typescript/local-input.js +1 -0
- package/dist/contracts/typescript/local-runner.js +1 -0
- package/dist/contracts/typescript/local-trial-live.js +1 -0
- package/dist/contracts/typescript/local-value-source.js +1 -0
- package/dist/contracts/typescript/local-world-native.js +1 -0
- package/dist/contracts/typescript/mcp.js +1 -0
- package/dist/contracts/typescript/media.js +1 -0
- package/dist/contracts/typescript/native-check.js +1 -0
- package/dist/contracts/typescript/native-identity.js +1 -0
- package/dist/contracts/typescript/onboarding.js +1 -0
- package/dist/contracts/typescript/performance.js +1 -0
- package/dist/contracts/typescript/planning.js +1 -0
- package/dist/contracts/typescript/preparation.js +1 -0
- package/dist/contracts/typescript/real-operation.js +1 -0
- package/dist/contracts/typescript/recommendation.js +1 -0
- package/dist/contracts/typescript/reports.js +1 -0
- package/dist/contracts/typescript/resource-lifecycle.js +1 -0
- package/dist/contracts/typescript/saved-record.js +1 -0
- package/dist/contracts/typescript/scenarios.js +1 -0
- package/dist/contracts/typescript/services.js +1 -0
- package/dist/contracts/typescript/session-command.js +1 -0
- package/dist/contracts/typescript/session-state.js +1 -0
- package/dist/contracts/typescript/session-voice.js +1 -0
- package/dist/contracts/typescript/session.js +1 -0
- package/dist/contracts/typescript/tool-command.js +1 -0
- package/dist/contracts/typescript/tool-connection.js +1 -0
- package/dist/contracts/typescript/tool-contribution.js +1 -0
- package/dist/contracts/typescript/tool-groups.js +1 -0
- package/dist/contracts/typescript/tool-lifecycle.js +1 -0
- package/dist/contracts/typescript/tool-package.js +1 -0
- package/dist/contracts/typescript/tool-state.js +1 -0
- package/dist/contracts/typescript/trial-state.js +1 -0
- package/dist/contracts/typescript/vault.js +1 -0
- package/dist/contracts/typescript/workspace-team.js +1 -0
- package/dist/contracts/typescript/world-stream.js +1 -0
- package/dist/contracts/workspace-team-contracts.js +55 -0
- package/dist/contracts/world-command.js +65 -0
- package/dist/contracts/world-lifetime-contracts.js +74 -0
- package/dist/contracts/world-recipe-contracts.js +27 -0
- package/dist/contracts/world-stream-contracts.js +27 -0
- package/dist/package.json +1 -0
- package/package.json +16 -16
- package/LICENSE.md +0 -23
- package/PACKAGING.json +0 -50
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
// `firedrill library ...` and `firedrill world ...`: cloud authoring of
|
|
2
|
+
// personas, scenarios and evaluations, and native world declarations that bind
|
|
3
|
+
// them to a registered descriptor revision. Every change is a new immutable
|
|
4
|
+
// version guarded by an expected revision and a replayable request key.
|
|
5
|
+
// Nothing here provisions, runs or spends anything.
|
|
6
|
+
import { CliError } from '../http.js';
|
|
7
|
+
import { terminalText } from '../prompts.js';
|
|
8
|
+
import { selectedWorkspace } from '../world-access.js';
|
|
9
|
+
import { changeLibrary, getLibraryRevision, getWorldRevision, libraryHistory, listLibrary, LIBRARY_KINDS, saveNativeWorld, sharedHere, worldHistory } from '../native/cloud-resources.js';
|
|
10
|
+
import { listNativeDescriptors, registrationKey } from '../native/registration.js';
|
|
11
|
+
import { answerLost, recoverLostWrite } from '../native/metadata-requests.js';
|
|
12
|
+
import { metadataRequestCommand } from './metadata-requests.js';
|
|
13
|
+
import { readJsonObject } from './plan-apply.js';
|
|
14
|
+
import { LIBRARY_SHARING_VERBS, libraryAccess, librarySharingCommand, parameterLines } from './library-sharing.js';
|
|
15
|
+
import { WORLD_REUSE_VERBS, worldReuseCommand } from './world-reuse.js';
|
|
16
|
+
const unconfirmed = (what) => new CliError('native_response_unconfirmed', `The recovered ${what} does not match this change. Nothing else was sent.`, 2);
|
|
17
|
+
/** The flags that replay this exact change: a world save also names the descriptor revision it used, never the newest resolved again. */
|
|
18
|
+
const replayFlags = (requestKey, descriptorRevision) => `--request ${requestKey}${descriptorRevision ? ` --descriptor-revision ${descriptorRevision}` : ''}`;
|
|
19
|
+
/** The request key is printed before anything is sent, so an interrupted change can be replayed, read back or withdrawn. */
|
|
20
|
+
function announce(options, emit, requestKey, kind, descriptorRevision) {
|
|
21
|
+
if (options.json)
|
|
22
|
+
emit('request_prepared', { request_key: requestKey, ...(descriptorRevision ? { descriptor_revision_id: descriptorRevision } : {}) }, '');
|
|
23
|
+
else
|
|
24
|
+
process.stderr.write(`Request key: ${requestKey} (rerun with ${replayFlags(requestKey, descriptorRevision)} to replay this exact change; `
|
|
25
|
+
+ `firedrill ${kind} request ${requestKey} reads it back)\n`);
|
|
26
|
+
}
|
|
27
|
+
const DEFINITION_BYTES = 2 * 1024 * 1024;
|
|
28
|
+
const scopeOf = (options) => selectedWorkspace({ workspace: options.workspace, signal: options.signal,
|
|
29
|
+
interactive: !options.json && !!process.stdin.isTTY && !!process.stderr.isTTY, openBrowser: options.openBrowser && !options.json });
|
|
30
|
+
function pageNumber(value) {
|
|
31
|
+
if (value === undefined)
|
|
32
|
+
return undefined;
|
|
33
|
+
if (!/^[1-9][0-9]{0,6}$/.test(value))
|
|
34
|
+
throw new CliError('arguments_invalid', 'Use --page with a number of 1 or more.', 2);
|
|
35
|
+
return Number(value);
|
|
36
|
+
}
|
|
37
|
+
/** Root answers 404 for a page past the last one; say so instead of "not found". */
|
|
38
|
+
const pastEnd = (page) => (error) => {
|
|
39
|
+
if ((page ?? 1) > 1 && error instanceof CliError && error.httpStatus === 404) {
|
|
40
|
+
throw new CliError('page_not_found', `There is no page ${page}. Start again from --page 1.`, 2);
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
};
|
|
44
|
+
function expectedRevision(value, fallback) {
|
|
45
|
+
if (value === undefined) {
|
|
46
|
+
if (fallback === null)
|
|
47
|
+
throw new CliError('arguments_invalid', 'Provide --expected-revision with the current revision number. Nothing was submitted.', 2);
|
|
48
|
+
return fallback;
|
|
49
|
+
}
|
|
50
|
+
if (!/^(0|[1-9][0-9]{0,9})$/.test(value))
|
|
51
|
+
throw new CliError('arguments_invalid', 'Use --expected-revision with a whole number. Nothing was submitted.', 2);
|
|
52
|
+
return Number(value);
|
|
53
|
+
}
|
|
54
|
+
function libraryLine(row) {
|
|
55
|
+
return `${row.kind} ${terminalText(row.name)} v${row.revision}${row.state === 'archived' ? ' (archived)' : ''} resource ${row.resource_id} version ${row.id}`;
|
|
56
|
+
}
|
|
57
|
+
function libraryDetail(row, requestKey) {
|
|
58
|
+
return [libraryLine(row), `Digest: ${row.digest}`, `Recorded: ${terminalText(row.created_at)}`,
|
|
59
|
+
...(row.forked_from ? [`Forked from version: ${row.forked_from}`] : []),
|
|
60
|
+
...(requestKey ? [`Request key (rerun with --request to replay): ${requestKey}`] : [])].join('\n');
|
|
61
|
+
}
|
|
62
|
+
function pageText(page, line, empty) {
|
|
63
|
+
if (!page.results.length)
|
|
64
|
+
return empty;
|
|
65
|
+
return [...page.results.map(line), ...(page.next ? [`More results: rerun with --page ${(page.page ?? 1) + 1}.`] : [])].join('\n');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* library [--kind k] [--search prefix] [--archived] [--page n]
|
|
69
|
+
* library show <version-id> | library history <resource-id>
|
|
70
|
+
* library save [<resource-id>] --kind k --file <path|-> [--expected-revision n]
|
|
71
|
+
* library archive|restore <resource-id> --kind k --expected-revision n
|
|
72
|
+
* library fork <version-id> --kind k --file <path|->
|
|
73
|
+
* save and fork also take --parameters <path|-> or --remove-parameters.
|
|
74
|
+
* Sharing, dependents and binding: see library-sharing.ts.
|
|
75
|
+
*/
|
|
76
|
+
export async function libraryCommand(args, options, emit) {
|
|
77
|
+
const [action, target, ...rest] = args;
|
|
78
|
+
if (action !== undefined && LIBRARY_SHARING_VERBS.has(action))
|
|
79
|
+
return librarySharingCommand(args, options, emit);
|
|
80
|
+
const usage = () => new CliError('arguments_invalid', `Use firedrill library [--kind ${LIBRARY_KINDS.join('|')}] [--search <prefix>] [--archived], library show <version-id>, library history <resource-id>, `
|
|
81
|
+
+ 'library save [<resource-id>] --kind <kind> --file <path|-> [--expected-revision <n>], library archive|restore <resource-id> --kind <kind> --expected-revision <n>, '
|
|
82
|
+
+ 'library fork <version-id> --kind <kind> --file <path|-> (save and fork take --parameters <path|-> or --remove-parameters), '
|
|
83
|
+
+ 'library request|withdraw-request <request-key>, library bind <version-id> [--file <values.json|->], library dependents <version-id>, '
|
|
84
|
+
+ 'or sharing: library recipients, grants <version-id>, share <version-id> <workspace-id> read|use, share-request <version-id> <key>, '
|
|
85
|
+
+ 'revoke <version-id> <grant-id>.', 2);
|
|
86
|
+
if (rest.length)
|
|
87
|
+
throw usage();
|
|
88
|
+
if ((options.parameters !== undefined || options.removeParameters) && action !== 'save' && action !== 'fork')
|
|
89
|
+
throw usage();
|
|
90
|
+
if (options.approve !== undefined && action !== 'withdraw-request')
|
|
91
|
+
throw usage();
|
|
92
|
+
if (action === undefined || action === 'list') {
|
|
93
|
+
if (target !== undefined || options.file !== undefined || options.expectedRevision !== undefined || options.request !== undefined)
|
|
94
|
+
throw usage();
|
|
95
|
+
const scope = await scopeOf(options);
|
|
96
|
+
const number = pageNumber(options.page);
|
|
97
|
+
const page = await listLibrary(scope, { kind: options.kind, archived: options.archived === true, search: options.search,
|
|
98
|
+
page: number, signal: options.signal }).catch(pastEnd(number));
|
|
99
|
+
// A version shared from another workspace says so, and whether it can be used here; it is never editable here.
|
|
100
|
+
emit('library', page, pageText(page, (row) => libraryLine(row) + (sharedHere(scope, row) ? ` (${libraryAccess(scope, row)})` : ''), 'No library resources match. Save one with firedrill library save --kind <kind> --file <path>.'));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (options.search !== undefined || options.archived !== undefined)
|
|
104
|
+
throw usage();
|
|
105
|
+
if (action === 'request' || action === 'withdraw-request') {
|
|
106
|
+
if (!target || options.kind !== undefined || options.file !== undefined || options.expectedRevision !== undefined
|
|
107
|
+
|| options.request !== undefined || options.page !== undefined)
|
|
108
|
+
throw usage();
|
|
109
|
+
const scope = await scopeOf(options);
|
|
110
|
+
await metadataRequestCommand(action, { kind: 'library', requestKey: target }, scope, options, emit, (row) => libraryDetail(row), `firedrill library withdraw-request ${target.toLowerCase()}`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (action === 'show' || action === 'history') {
|
|
114
|
+
if (!target || options.kind !== undefined || options.file !== undefined || options.expectedRevision !== undefined || options.request !== undefined
|
|
115
|
+
|| (action === 'show' && options.page !== undefined))
|
|
116
|
+
throw usage();
|
|
117
|
+
const scope = await scopeOf(options);
|
|
118
|
+
if (action === 'show') {
|
|
119
|
+
const row = await getLibraryRevision(scope, { revisionId: target, signal: options.signal });
|
|
120
|
+
emit('library_version', row, [libraryDetail(row), `Access: ${libraryAccess(scope, row)}`, ...parameterLines(row),
|
|
121
|
+
terminalText(JSON.stringify(row.definition, null, 2))].join('\n'));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const number = pageNumber(options.page);
|
|
125
|
+
const page = await libraryHistory(scope, { resourceId: target, page: number, signal: options.signal }).catch(pastEnd(number));
|
|
126
|
+
// History lists only this workspace's own versions. A resource shared from
|
|
127
|
+
// another workspace has none here; only its shared versions are readable.
|
|
128
|
+
emit('library_history', page, pageText(page, libraryLine, 'This workspace owns no versions of that resource. A version shared from another '
|
|
129
|
+
+ 'workspace is read by its version id: firedrill library show <version-id>.'));
|
|
130
|
+
}
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (!['save', 'archive', 'restore', 'fork'].includes(action) || options.page !== undefined || !options.kind)
|
|
134
|
+
throw usage();
|
|
135
|
+
const change = action;
|
|
136
|
+
const replacing = change === 'save' || change === 'fork';
|
|
137
|
+
if (replacing !== (options.file !== undefined) || (change !== 'save' && !target))
|
|
138
|
+
throw usage();
|
|
139
|
+
// Conflicting flags are refused before anything is read from standard input.
|
|
140
|
+
if (options.parameters !== undefined && options.removeParameters)
|
|
141
|
+
throw usage();
|
|
142
|
+
if (options.parameters === '-' && options.file === '-') {
|
|
143
|
+
throw new CliError('arguments_invalid', 'Read at most one of --file and --parameters from standard input; give the other as a file path. Nothing was submitted.', 2);
|
|
144
|
+
}
|
|
145
|
+
const definition = replacing ? await readJsonObject(options.file, `the ${options.kind} definition`, options.signal, DEFINITION_BYTES) : undefined;
|
|
146
|
+
// Omitted: the existing (or forked) declaration is kept. Removed: null. Otherwise the declaration file, validated by the service.
|
|
147
|
+
const parameterSchema = options.removeParameters ? null : options.parameters === undefined ? undefined
|
|
148
|
+
: await readJsonObject(options.parameters, 'the parameter declaration', options.signal);
|
|
149
|
+
const scope = await scopeOf(options);
|
|
150
|
+
const creating = change === 'fork' || (change === 'save' && target === undefined);
|
|
151
|
+
if (creating && options.expectedRevision !== undefined && options.expectedRevision !== '0')
|
|
152
|
+
throw usage();
|
|
153
|
+
const expected = expectedRevision(options.expectedRevision, creating ? 0 : null);
|
|
154
|
+
const requestKey = registrationKey(options.request);
|
|
155
|
+
announce(options, emit, requestKey, 'library');
|
|
156
|
+
let row;
|
|
157
|
+
try {
|
|
158
|
+
row = await changeLibrary(scope, {
|
|
159
|
+
action: change, kind: options.kind, definition, parameterSchema, requestKey, signal: options.signal,
|
|
160
|
+
resourceId: change === 'fork' ? undefined : target, forkFrom: change === 'fork' ? target : undefined, expectedRevision: expected,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
// No answer: read the original back by its key. Never sent again here, never under a new key.
|
|
165
|
+
if (!answerLost(error) || options.signal.aborted)
|
|
166
|
+
throw error;
|
|
167
|
+
const recovered = await recoverLostWrite(scope, { kind: 'library', requestKey }, { replay: `the same command with --request ${requestKey}`, withdraw: `firedrill library withdraw-request ${requestKey}` });
|
|
168
|
+
if (recovered.kind !== options.kind || (!creating && recovered.resource_id !== target.toLowerCase())
|
|
169
|
+
|| recovered.revision !== expected + 1
|
|
170
|
+
|| (change === 'fork' && recovered.forked_from !== target.toLowerCase())
|
|
171
|
+
|| recovered.state !== (change === 'archive' ? 'archived' : 'draft'))
|
|
172
|
+
throw unconfirmed('library change');
|
|
173
|
+
// The recovery API identifies the original key, not the attempted body.
|
|
174
|
+
// A lost conflict response can return an older definition under that key.
|
|
175
|
+
// Do not describe this receipt as confirmation that the supplied edit landed.
|
|
176
|
+
emit('native_request', { kind: 'library', request_key: requestKey, state: 'committed', receipt: recovered,
|
|
177
|
+
submitted_change_confirmed: false }, `Recovered the original library change.\n${libraryDetail(recovered, requestKey)}\nThe submitted edit is not confirmed. Inspect the original definition before continuing.`);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const verb = { save: 'Saved', archive: 'Archived', restore: 'Restored', fork: 'Forked' }[change];
|
|
181
|
+
emit('library_version', row, `${verb} ${libraryDetail(row, row.request_key)}`);
|
|
182
|
+
}
|
|
183
|
+
function worldLine(row) {
|
|
184
|
+
return `World ${row.world_id} revision ${row.revision}: ${row.id} descriptor ${row.native_descriptor_id} digest ${row.definition_digest}`;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* world save --agent <id> --file <path|-> [--descriptor-revision <id>] [--world <id> --expected-revision n]
|
|
188
|
+
* world history <world-id> [--page n] | world show <world-id> <revision-id>
|
|
189
|
+
*/
|
|
190
|
+
export async function worldCommand(args, options, emit) {
|
|
191
|
+
const usage = () => new CliError('arguments_invalid', 'Use firedrill world save --agent <id> --file <path|-> [--descriptor-revision <id>] [--world <id> --expected-revision <n>], '
|
|
192
|
+
+ 'world history <world-id>, world show <world-id> <revision-id>, world request|withdraw-request <request-key>, '
|
|
193
|
+
+ 'or reuse: world versions, version <version-id>, recipients, grants <version-id>, share <version-id> <workspace-id> read|use, '
|
|
194
|
+
+ 'share-request|withdraw-share-request <version-id> <key>, revoke <version-id> <grant-id>, fork <version-id> --agent <id>, fork-request <key>, '
|
|
195
|
+
+ 'withdraw-fork <key>, dependents <version-id>.', 2);
|
|
196
|
+
const [action, ...rest] = args;
|
|
197
|
+
if (action !== undefined && WORLD_REUSE_VERBS.has(action))
|
|
198
|
+
return worldReuseCommand(args, options, emit);
|
|
199
|
+
if (options.approve !== undefined && action !== 'withdraw-request')
|
|
200
|
+
throw usage();
|
|
201
|
+
if (action === 'request' || action === 'withdraw-request') {
|
|
202
|
+
if (rest.length !== 1 || options.agent !== undefined || options.file !== undefined || options.world !== undefined || options.page !== undefined
|
|
203
|
+
|| options.descriptorRevision !== undefined || options.expectedRevision !== undefined || options.request !== undefined)
|
|
204
|
+
throw usage();
|
|
205
|
+
const scope = await scopeOf(options);
|
|
206
|
+
await metadataRequestCommand(action, { kind: 'world', requestKey: rest[0] }, scope, options, emit, worldLine, `firedrill world withdraw-request ${rest[0].toLowerCase()}`);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (action === 'history' || action === 'show') {
|
|
210
|
+
if (rest.length !== (action === 'show' ? 2 : 1) || options.agent !== undefined || options.file !== undefined || options.world !== undefined
|
|
211
|
+
|| options.descriptorRevision !== undefined || options.expectedRevision !== undefined || options.request !== undefined
|
|
212
|
+
|| (action === 'show' && options.page !== undefined))
|
|
213
|
+
throw usage();
|
|
214
|
+
const scope = await scopeOf(options);
|
|
215
|
+
if (action === 'show') {
|
|
216
|
+
const row = await getWorldRevision(scope, { worldId: rest[0], revisionId: rest[1], signal: options.signal });
|
|
217
|
+
emit('world_revision', row, worldLine(row) + '\n' + terminalText(JSON.stringify(row.definition, null, 2)));
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
const number = pageNumber(options.page);
|
|
221
|
+
const page = await worldHistory(scope, { worldId: rest[0], page: number, signal: options.signal }).catch(pastEnd(number));
|
|
222
|
+
emit('world_history', page, pageText(page, worldLine, 'This world has no saved declaration yet.'));
|
|
223
|
+
}
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (action !== 'save' || rest.length || !options.agent || !options.file || options.page !== undefined
|
|
227
|
+
|| (options.world === undefined) !== (options.expectedRevision === undefined))
|
|
228
|
+
throw usage();
|
|
229
|
+
// A replay uses the descriptor revision the original did; the newest one resolved again could be a different change.
|
|
230
|
+
if (options.request !== undefined && options.descriptorRevision === undefined) {
|
|
231
|
+
const key = registrationKey(options.request);
|
|
232
|
+
throw new CliError('arguments_invalid', `A world save replay needs the descriptor revision the original used. Rerun with --request ${key} `
|
|
233
|
+
+ `--descriptor-revision <id> as printed with the request key; if the original landed, firedrill world request ${key} shows it. Nothing was submitted.`, 2);
|
|
234
|
+
}
|
|
235
|
+
const definition = await readJsonObject(options.file, 'the world declaration', options.signal, DEFINITION_BYTES);
|
|
236
|
+
const scope = await scopeOf(options);
|
|
237
|
+
let descriptorRevision = options.descriptorRevision;
|
|
238
|
+
if (descriptorRevision === undefined) {
|
|
239
|
+
// Default to the agent's newest registered descriptor revision, and say so.
|
|
240
|
+
const newest = (await listNativeDescriptors(scope, { agentId: options.agent, page: 1, signal: options.signal })).results[0];
|
|
241
|
+
if (!newest)
|
|
242
|
+
throw new CliError('native_descriptor_required', 'Register a descriptor for this agent first with firedrill register. Nothing was submitted.', 2);
|
|
243
|
+
descriptorRevision = newest.id;
|
|
244
|
+
}
|
|
245
|
+
const expected = expectedRevision(options.expectedRevision, 0);
|
|
246
|
+
const requestKey = registrationKey(options.request);
|
|
247
|
+
announce(options, emit, requestKey, 'world', descriptorRevision.toLowerCase());
|
|
248
|
+
let row;
|
|
249
|
+
try {
|
|
250
|
+
row = await saveNativeWorld(scope, {
|
|
251
|
+
worldId: options.world, agentId: options.agent, descriptorRevisionId: descriptorRevision,
|
|
252
|
+
expectedRevision: expected, definition, requestKey, signal: options.signal,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
// No answer: read the original back by its key. Never sent again here, never under a new key.
|
|
257
|
+
if (!answerLost(error) || options.signal.aborted)
|
|
258
|
+
throw error;
|
|
259
|
+
const recovered = await recoverLostWrite(scope, { kind: 'world', requestKey }, { replay: `the same command with ${replayFlags(requestKey, descriptorRevision.toLowerCase())}`, withdraw: `firedrill world withdraw-request ${requestKey}` });
|
|
260
|
+
if ((options.world !== undefined && recovered.world_id !== options.world.toLowerCase()) || recovered.revision !== expected + 1
|
|
261
|
+
|| recovered.native_descriptor_id !== descriptorRevision.toLowerCase())
|
|
262
|
+
throw unconfirmed('world change');
|
|
263
|
+
emit('native_request', { kind: 'world', request_key: requestKey, state: 'committed', receipt: recovered,
|
|
264
|
+
submitted_change_confirmed: false }, `Recovered the original world change.\n${worldLine(recovered)}\nRequest key: ${requestKey}\nThe submitted definition is not confirmed. Inspect the original before continuing.`);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
emit('world_revision', row, [`Saved ${worldLine(row)}`, 'Nothing was provisioned or started.',
|
|
268
|
+
`Review it with: firedrill plan --world ${row.world_id}`,
|
|
269
|
+
`Request key: ${row.request_key} (replay with ${replayFlags(row.request_key, row.native_descriptor_id)})`].join('\n'));
|
|
270
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CliError } from '../http.js';
|
|
2
|
+
import { selectOne } from '../prompts.js';
|
|
3
|
+
/** Separate credit consent is never inferred from execution or destructive-operation consent. */
|
|
4
|
+
export async function approveCredits(quotes, options, interactive, recoveryCommand) {
|
|
5
|
+
if (!quotes.some(quote => quote.credit_approval_required))
|
|
6
|
+
return false;
|
|
7
|
+
let approved = options.approveCredits === true;
|
|
8
|
+
if (!approved && interactive)
|
|
9
|
+
approved = await selectOne('Approve the credit budget shown above?', [
|
|
10
|
+
{ value: false, label: 'Not now', detail: 'Nothing is admitted.' },
|
|
11
|
+
{ value: true, label: 'Approve credits', detail: 'Separately approves these exact quoted cloud-work limits.' },
|
|
12
|
+
], options.signal);
|
|
13
|
+
if (!approved)
|
|
14
|
+
throw new CliError('credit_approval_required', `This quote requires separate credit approval. Review the displayed budget, then recover this same original request with: ${recoveryCommand} --approve-credits. Nothing was admitted.`, 2);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/** Common-path commands shown first. Everything else is under `firedrill help advanced`. */
|
|
2
|
+
export const COMMON_COMMANDS = ['init', 'status', 'register', 'descriptors', 'library', 'world', 'plan', 'apply', 'runner', 'run', 'watch', 'report', 'tools', 'mcp', 'help'];
|
|
3
|
+
export const COMMON_HELP = `Firedrill
|
|
4
|
+
|
|
5
|
+
Your coding agent (or you) drives Firedrill from this terminal or over MCP.
|
|
6
|
+
Local targets run as native processes on this machine. They are not sandboxed.
|
|
7
|
+
|
|
8
|
+
firedrill init Sign in, choose a workspace and check this machine
|
|
9
|
+
--session-only Keep credentials in memory in this process (the companion);
|
|
10
|
+
keep it running while other commands use it
|
|
11
|
+
--persistent Use the OS credential store (the default when available)
|
|
12
|
+
--workspace <id> --no-browser --open (allow a browser in JSON mode) --json
|
|
13
|
+
firedrill status [--plan <path|->] Account, workspace, credential mode, companion and drivers
|
|
14
|
+
firedrill register --descriptor <path|-> --name <name> Register a local agent (metadata only)
|
|
15
|
+
firedrill register --descriptor <path|-> --agent <id> --expected-revision <n>
|
|
16
|
+
Record a new descriptor revision; --request <key> replays
|
|
17
|
+
--declared-agent-name <name> Optional: the calling coding agent's own name (recorded as self-reported)
|
|
18
|
+
firedrill descriptors --agent <id> [--page <n>] [--descriptor <id>] Read descriptor history
|
|
19
|
+
firedrill library [--kind persona|scenario|evaluation] [--search <prefix>] [--archived]
|
|
20
|
+
List cloud personas, scenarios and evaluations
|
|
21
|
+
firedrill library save [<resource-id>] --kind <kind> --file <path|-> [--expected-revision <n>]
|
|
22
|
+
firedrill library show <version-id> | history <resource-id> | fork <version-id> --kind <kind> --file <path|->
|
|
23
|
+
firedrill library archive|restore <resource-id> --kind <kind> --expected-revision <n>
|
|
24
|
+
save and fork also take --parameters <path|-> (typed parameters) or --remove-parameters
|
|
25
|
+
firedrill library bind <version-id> [--file <values.json|->]
|
|
26
|
+
Fix a parameterized version's values into a new private version a world can use
|
|
27
|
+
firedrill library dependents <version-id> [--kind world|scenario] This workspace's versions that reference it
|
|
28
|
+
firedrill library share <version-id> <workspace-id> read|use [--approve-change]
|
|
29
|
+
Share one exact version with another workspace of your organization (administrators)
|
|
30
|
+
firedrill library recipients | grants <version-id> | share-request <version-id> <key> | revoke <version-id> <grant-id>
|
|
31
|
+
firedrill world save --agent <id> --file <path|-> [--descriptor-revision <id>] [--world <id> --expected-revision <n>]
|
|
32
|
+
Declare a world for a registered agent (nothing starts); a --request replay
|
|
33
|
+
also passes the --descriptor-revision printed with its key
|
|
34
|
+
firedrill world history <world-id> | show <world-id> <revision-id>
|
|
35
|
+
firedrill world versions [--search <prefix>] | version <version-id>
|
|
36
|
+
World versions this workspace can read, its own and shared ones
|
|
37
|
+
firedrill world fork <version-id> --agent <id> [--descriptor-revision <id>] [--file <declaration.json|->] [--approve-change]
|
|
38
|
+
Copy a usable world version into a new private world (grants nothing it references)
|
|
39
|
+
firedrill world share <version-id> <workspace-id> read|use [--approve-change]
|
|
40
|
+
Share one exact world version with another workspace of your organization (administrators)
|
|
41
|
+
firedrill world recipients | grants <version-id> | share-request|withdraw-share-request <version-id> <key> | revoke <version-id> <grant-id>
|
|
42
|
+
firedrill world fork-request <key> | withdraw-fork <key> [--approve-change] | dependents <version-id> [--kind fork|campaign]
|
|
43
|
+
firedrill register|library|world request <request-key> Read an interrupted change back by its key
|
|
44
|
+
firedrill register|library|world withdraw-request <request-key> [--approve-change]
|
|
45
|
+
Withdraw a change that was never saved, so it can never land
|
|
46
|
+
firedrill descriptors request|withdraw-request <request-key> --agent <id> The same for a descriptor revision
|
|
47
|
+
firedrill plan --world <world-id> [--world-revision <id>] Review a world's effects (no effects); a --request replay
|
|
48
|
+
also passes the plan's --world-revision
|
|
49
|
+
firedrill plan show <plan-id> Read a saved review
|
|
50
|
+
firedrill apply <plan-id> --approve [--follow] Prepare a reviewed plan (preparation reserved first, drill work in bounded
|
|
51
|
+
waves as drills are admitted, within the approved maximum); when ready, create its campaign
|
|
52
|
+
firedrill apply <plan-id> --request <key> [--follow] Check an earlier apply (never applied or charged twice; asks for
|
|
53
|
+
approval again only if nothing is recorded under the key yet)
|
|
54
|
+
firedrill apply <plan-id> --request <key> --cancel Cancel an eligible unstarted queue entry or unused ready preparation
|
|
55
|
+
firedrill runner enroll Enroll this machine as a runner device for this terminal sign-in (a device identity,
|
|
56
|
+
not permission to run); enroll again after a new sign-in or once it expires
|
|
57
|
+
firedrill run --plan <path|-> --descriptor <path|-> --campaign <id> [--approve] [--runner <device-key>]
|
|
58
|
+
Approve the local plan and run that campaign's drills on this machine
|
|
59
|
+
Session-only: enrolls a runner for this session (key in memory; --enroll-device)
|
|
60
|
+
firedrill watch <campaign> [--follow] Show drill slots and execution states (--follow until the campaign settles,
|
|
61
|
+
up to 15 minutes per run)
|
|
62
|
+
firedrill report [campaign] Read the cloud report for a simulation, with each finished drill's results
|
|
63
|
+
firedrill report <campaign> quality [--page <n>]
|
|
64
|
+
Per-criterion quality across drills, one compatible cohort at a time
|
|
65
|
+
firedrill report <campaign> drill <drill> [results [criterion] | effects | conversation [turn] | events [event] | actions [action] | evidence [record]]
|
|
66
|
+
Read a drill's per-criterion results, observations, conversation, tool calls, scenario events, target tasks and evidence
|
|
67
|
+
firedrill report <campaign> drill <drill> reassess [--request-key <key>] [--usage-quote <id> --approve-assessment]
|
|
68
|
+
Approve a new, separately priced evaluation of a finished drill's retained evidence (the agent is not run again)
|
|
69
|
+
firedrill report <campaign> drill <drill> reassessments | reassessment <id> [results] | reassessment-request <key> | cancel-reassessment <id>
|
|
70
|
+
Read reassessments and their own results (kept apart from the original), recover one by key, or cancel an unapproved one
|
|
71
|
+
firedrill simulation cancel <campaign> [--approve-change] Cancel a simulation (running drills are revoked)
|
|
72
|
+
firedrill runner run-cleanup <device-key> <campaign-id> [--approve-change] Recover saved shared-service closing evidence after sign-in; never start or stop processes
|
|
73
|
+
firedrill tools init [directory] Start a custom tool package (tool.json)
|
|
74
|
+
firedrill tools validate [directory] Check tool.json and bundle/manifest.json locally
|
|
75
|
+
firedrill tools push <package.zip> Upload a tool package (--approve-tool-upload for automation)
|
|
76
|
+
firedrill tools definitions [--search <prefix>] | show <version-id>
|
|
77
|
+
Tool versions this workspace can read, its own and shared ones
|
|
78
|
+
firedrill tools definitions copy <version-id> [--approve-tool-change] | copy-status <copy-id>
|
|
79
|
+
Copy a shared version into a private one, inspected here before use (starts nothing)
|
|
80
|
+
firedrill tools definitions share <version-id> <workspace-id> read|use [--approve-tool-change]
|
|
81
|
+
Share one exact tool version with another workspace of your organization (administrators)
|
|
82
|
+
firedrill tools definitions recipients | grants <version-id> | share-request|withdraw-share-request <version-id> <key> | revoke <version-id> <grant-id>
|
|
83
|
+
firedrill tools definitions copy-request|withdraw-copy-request <key> | withdraw-copy <copy-id> | dependents <version-id> [--kind world|copy]
|
|
84
|
+
firedrill tools start Choose saved tools with Space, then Enter; runs in the cloud for a set time
|
|
85
|
+
firedrill tools access <session> Connect an agent on this machine to a running tool session
|
|
86
|
+
firedrill tools state <instance> [checkpoint | edit <operation> --file <args.json> | snapshots]
|
|
87
|
+
Save or change a shared-pool tool's data under a replayable request key
|
|
88
|
+
firedrill tools state <instance> reset --seconds <n> | fork <snapshot> --seconds <n>
|
|
89
|
+
Start a new tool session from its baseline or a snapshot, after approving the estimate
|
|
90
|
+
Recover with --request-key <key>; approve the same --usage-quote <id> --approve-tool-change
|
|
91
|
+
firedrill tools session <session> renew --seconds <n> [--request-key <key>] [--usage-quote <id> --approve-tool-change]
|
|
92
|
+
Extend a running session's shared-pool tools (same tools and data), after approving the estimate
|
|
93
|
+
firedrill mcp [--agent codex|claude|other] Show remote MCP connection guidance
|
|
94
|
+
firedrill help advanced List every other command
|
|
95
|
+
|
|
96
|
+
JSON mode (--json): no prompts, no browser opening unless --open, one JSON object per line.
|
|
97
|
+
Commands from a local plan run only after you approve that exact plan.
|
|
98
|
+
`;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { api, login } from '../auth.js';
|
|
2
|
+
import { CliError } from '../http.js';
|
|
3
|
+
import { terminalText } from '../prompts.js';
|
|
4
|
+
import { selectedWorkspace } from '../world-access.js';
|
|
5
|
+
import { machineReport, machineText } from './status.js';
|
|
6
|
+
/** The canonical path after sign-in: everything is cloud-owned except the run on this machine. */
|
|
7
|
+
const NEXT = [
|
|
8
|
+
{ command: 'firedrill register --descriptor <path|-> --name <name>', note: 'Register the target: metadata only, nothing uploaded' },
|
|
9
|
+
{ command: 'firedrill library --kind persona|scenario|evaluation [--search <prefix>]', note: 'Reuse saved resources (and firedrill tools runnable for hosted tools); author only the gaps' },
|
|
10
|
+
{ command: 'firedrill world save --agent <agent-id> --file <path|->', note: 'Declare its world; nothing starts' },
|
|
11
|
+
{ command: 'firedrill plan --world <world-id>', note: 'Effect-free review with gaps and the cloud-work estimate' },
|
|
12
|
+
{ command: 'firedrill apply <plan-id> --approve --follow', note: 'Only after the person approves that review and estimate; prints campaign_created' },
|
|
13
|
+
{ command: 'firedrill runner enroll', note: 'Done by the person, once per terminal sign-in on this machine; again after a new sign-in or once it expires' },
|
|
14
|
+
{ command: 'firedrill run --plan <path|-> --descriptor <path|-> --campaign <campaign-id>', note: 'Runs the drills here; add --approve only after the person approves the exact local plan' },
|
|
15
|
+
{ command: 'firedrill watch <campaign-id> --follow', note: 'Until watch_done shows settled: true; otherwise run its next_command' },
|
|
16
|
+
{ command: 'firedrill report <campaign-id>', note: 'Per-drill, per-criterion results with evidence' },
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Sign-in, workspace selection and local capability discovery. Uploads nothing
|
|
20
|
+
* and makes no model call. The terminal always signs in with device
|
|
21
|
+
* authorization that a person approves in the browser. Where the platform enables
|
|
22
|
+
* agent registration, its auth.md describes it (firedrill signup guide reads it),
|
|
23
|
+
* and it still ends in that person's own claim and consent; init never claims
|
|
24
|
+
* registration support the platform has not published.
|
|
25
|
+
*/
|
|
26
|
+
export async function initCommand(args, options, emit) {
|
|
27
|
+
if (args.length)
|
|
28
|
+
throw new CliError('arguments_invalid', 'Use firedrill init with optional --session-only or --persistent, --workspace <id>, --no-browser, --open and --json.', 2);
|
|
29
|
+
const interactive = !options.json && !!process.stdin.isTTY && !!process.stderr.isTTY;
|
|
30
|
+
const openBrowser = options.openBrowser && (!options.json || options.explicitOpen);
|
|
31
|
+
const mode = options.mode;
|
|
32
|
+
let session;
|
|
33
|
+
try {
|
|
34
|
+
session = await api('/api/auth/native/session', { signal: options.signal });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
// An unavailable OS store goes through login(), which reports the platform
|
|
38
|
+
// remediation (including --session-only) instead of a bare unlock message.
|
|
39
|
+
if (!(error instanceof CliError) || !['authentication_required', 'credential_store_unavailable'].includes(error.code))
|
|
40
|
+
throw error;
|
|
41
|
+
session = await login({ json: options.json, open: options.openBrowser, explicitOpen: options.explicitOpen, signal: options.signal });
|
|
42
|
+
}
|
|
43
|
+
const scope = await selectedWorkspace({ workspace: options.workspace, interactive, signal: options.signal, openBrowser });
|
|
44
|
+
const machine = await machineReport(options.signal);
|
|
45
|
+
emit('init', {
|
|
46
|
+
account: { id: session.user.id, email: session.user.email }, workspace_id: scope.workspace, credential_mode: mode, machine,
|
|
47
|
+
coding_agent_sign_in: { terminal: 'device_authorization', approved_by: 'person_in_browser',
|
|
48
|
+
registration_guide_command: 'firedrill signup guide' },
|
|
49
|
+
next: NEXT, uploaded: false, model_called: false,
|
|
50
|
+
}, [
|
|
51
|
+
`Signed in as ${terminalText(session.user.email)}.`,
|
|
52
|
+
`Workspace: ${scope.workspace}`,
|
|
53
|
+
`Credentials: ${mode === 'session' ? 'memory only, for the companion session' : 'OS credential store'}`,
|
|
54
|
+
...machineText(machine),
|
|
55
|
+
'A coding agent signs in the same way: it relays the link and code, and a person approves in the browser.',
|
|
56
|
+
'firedrill signup guide reads the platform\'s agent registration instructions, if it publishes them.',
|
|
57
|
+
'Next (cloud-owned, except the run on this machine):',
|
|
58
|
+
...NEXT.map((step, index) => ` ${index + 1}. ${step.command}\n ${step.note}`),
|
|
59
|
+
'Nothing was uploaded and no model was called.',
|
|
60
|
+
].join('\n'));
|
|
61
|
+
}
|