@smthrs/control 0.0.0-stage → 1.0.0-rc.4
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/CHANGELOG.md +194 -0
- package/LICENSE +21 -0
- package/README.md +168 -2
- package/dist/cjs/ApprovalAuthority.d.ts +73 -0
- package/dist/cjs/ApprovalAuthority.d.ts.map +1 -0
- package/dist/cjs/ApprovalAuthority.js +62 -0
- package/dist/cjs/ApprovalAuthority.js.map +7 -0
- package/dist/cjs/Cancellation.d.ts +107 -0
- package/dist/cjs/Cancellation.d.ts.map +1 -0
- package/dist/cjs/Cancellation.js +72 -0
- package/dist/cjs/Cancellation.js.map +7 -0
- package/dist/cjs/Channels.d.ts +170 -0
- package/dist/cjs/Channels.d.ts.map +1 -0
- package/dist/cjs/Channels.js +278 -0
- package/dist/cjs/Channels.js.map +7 -0
- package/dist/cjs/Control.d.ts +202 -0
- package/dist/cjs/Control.d.ts.map +1 -0
- package/dist/cjs/Control.js +47 -0
- package/dist/cjs/Control.js.map +7 -0
- package/dist/cjs/ControlClient.d.ts +52 -0
- package/dist/cjs/ControlClient.d.ts.map +1 -0
- package/dist/cjs/ControlClient.js +191 -0
- package/dist/cjs/ControlClient.js.map +7 -0
- package/dist/cjs/ControlError.d.ts +318 -0
- package/dist/cjs/ControlError.d.ts.map +1 -0
- package/dist/cjs/ControlError.js +249 -0
- package/dist/cjs/ControlError.js.map +7 -0
- package/dist/cjs/ControlExecutor.d.ts +372 -0
- package/dist/cjs/ControlExecutor.d.ts.map +1 -0
- package/dist/cjs/ControlExecutor.js +123 -0
- package/dist/cjs/ControlExecutor.js.map +7 -0
- package/dist/cjs/ControlFacts.d.ts +454 -0
- package/dist/cjs/ControlFacts.d.ts.map +1 -0
- package/dist/cjs/ControlFacts.js +261 -0
- package/dist/cjs/ControlFacts.js.map +7 -0
- package/dist/cjs/ControlLive.d.ts +23 -0
- package/dist/cjs/ControlLive.d.ts.map +1 -0
- package/dist/cjs/ControlLive.js +1293 -0
- package/dist/cjs/ControlLive.js.map +7 -0
- package/dist/cjs/ControlRpcs.d.ts +1204 -0
- package/dist/cjs/ControlRpcs.d.ts.map +1 -0
- package/dist/cjs/ControlRpcs.js +247 -0
- package/dist/cjs/ControlRpcs.js.map +7 -0
- package/dist/cjs/ControlRuntime.d.ts +635 -0
- package/dist/cjs/ControlRuntime.d.ts.map +1 -0
- package/dist/cjs/ControlRuntime.js +744 -0
- package/dist/cjs/ControlRuntime.js.map +7 -0
- package/dist/cjs/ControlSchema.d.ts +2642 -0
- package/dist/cjs/ControlSchema.d.ts.map +1 -0
- package/dist/cjs/ControlSchema.js +634 -0
- package/dist/cjs/ControlSchema.js.map +7 -0
- package/dist/cjs/ControlServer.d.ts +51 -0
- package/dist/cjs/ControlServer.d.ts.map +1 -0
- package/dist/cjs/ControlServer.js +121 -0
- package/dist/cjs/ControlServer.js.map +7 -0
- package/dist/cjs/Credential.d.ts +136 -0
- package/dist/cjs/Credential.d.ts.map +1 -0
- package/dist/cjs/Credential.js +168 -0
- package/dist/cjs/Credential.js.map +7 -0
- package/dist/cjs/CredentialCipher.d.ts +90 -0
- package/dist/cjs/CredentialCipher.d.ts.map +1 -0
- package/dist/cjs/CredentialCipher.js +45 -0
- package/dist/cjs/CredentialCipher.js.map +7 -0
- package/dist/cjs/CredentialStore.d.ts +97 -0
- package/dist/cjs/CredentialStore.d.ts.map +1 -0
- package/dist/cjs/CredentialStore.js +81 -0
- package/dist/cjs/CredentialStore.js.map +7 -0
- package/dist/cjs/DispatchReader.d.ts +112 -0
- package/dist/cjs/DispatchReader.d.ts.map +1 -0
- package/dist/cjs/DispatchReader.js +45 -0
- package/dist/cjs/DispatchReader.js.map +7 -0
- package/dist/cjs/Health.d.ts +333 -0
- package/dist/cjs/Health.d.ts.map +1 -0
- package/dist/cjs/Health.js +311 -0
- package/dist/cjs/Health.js.map +7 -0
- package/dist/cjs/JevSessionChecker.d.ts +57 -0
- package/dist/cjs/JevSessionChecker.d.ts.map +1 -0
- package/dist/cjs/JevSessionChecker.js +113 -0
- package/dist/cjs/JevSessionChecker.js.map +7 -0
- package/dist/cjs/Lineage.d.ts +131 -0
- package/dist/cjs/Lineage.d.ts.map +1 -0
- package/dist/cjs/Lineage.js +81 -0
- package/dist/cjs/Lineage.js.map +7 -0
- package/dist/cjs/Migrations.d.ts +34 -0
- package/dist/cjs/Migrations.d.ts.map +1 -0
- package/dist/cjs/Migrations.js +60 -0
- package/dist/cjs/Migrations.js.map +7 -0
- package/dist/cjs/Monitor.d.ts +282 -0
- package/dist/cjs/Monitor.d.ts.map +1 -0
- package/dist/cjs/Monitor.js +283 -0
- package/dist/cjs/Monitor.js.map +7 -0
- package/dist/cjs/ScopedToken.d.ts +193 -0
- package/dist/cjs/ScopedToken.d.ts.map +1 -0
- package/dist/cjs/ScopedToken.js +135 -0
- package/dist/cjs/ScopedToken.js.map +7 -0
- package/dist/cjs/SqlControlRuntime.d.ts +161 -0
- package/dist/cjs/SqlControlRuntime.d.ts.map +1 -0
- package/dist/cjs/SqlControlRuntime.js +1522 -0
- package/dist/cjs/SqlControlRuntime.js.map +7 -0
- package/dist/cjs/SqlCredentialStore.d.ts +43 -0
- package/dist/cjs/SqlCredentialStore.d.ts.map +1 -0
- package/dist/cjs/SqlCredentialStore.js +113 -0
- package/dist/cjs/SqlCredentialStore.js.map +7 -0
- package/dist/cjs/Steering.d.ts +69 -0
- package/dist/cjs/Steering.d.ts.map +1 -0
- package/dist/cjs/Steering.js +49 -0
- package/dist/cjs/Steering.js.map +7 -0
- package/dist/cjs/SystemFlows.d.ts +223 -0
- package/dist/cjs/SystemFlows.d.ts.map +1 -0
- package/dist/cjs/SystemFlows.js +195 -0
- package/dist/cjs/SystemFlows.js.map +7 -0
- package/dist/cjs/WebCryptoCipher.d.ts +49 -0
- package/dist/cjs/WebCryptoCipher.d.ts.map +1 -0
- package/dist/cjs/WebCryptoCipher.js +129 -0
- package/dist/cjs/WebCryptoCipher.js.map +7 -0
- package/dist/cjs/WebhookChannel.d.ts +113 -0
- package/dist/cjs/WebhookChannel.d.ts.map +1 -0
- package/dist/cjs/WebhookChannel.js +98 -0
- package/dist/cjs/WebhookChannel.js.map +7 -0
- package/dist/cjs/index.d.ts +160 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +91 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/MutationBoundary.d.ts +27 -0
- package/dist/cjs/internal/MutationBoundary.d.ts.map +1 -0
- package/dist/cjs/internal/MutationBoundary.js +50 -0
- package/dist/cjs/internal/MutationBoundary.js.map +7 -0
- package/dist/cjs/internal/activeFibers.d.ts +12 -0
- package/dist/cjs/internal/activeFibers.d.ts.map +1 -0
- package/dist/cjs/internal/activeFibers.js +30 -0
- package/dist/cjs/internal/activeFibers.js.map +7 -0
- package/dist/cjs/internal/issues.d.ts +28 -0
- package/dist/cjs/internal/issues.d.ts.map +1 -0
- package/dist/cjs/internal/issues.js +34 -0
- package/dist/cjs/internal/issues.js.map +7 -0
- package/dist/cjs/internal/planning.d.ts +347 -0
- package/dist/cjs/internal/planning.d.ts.map +1 -0
- package/dist/cjs/internal/planning.js +137 -0
- package/dist/cjs/internal/planning.js.map +7 -0
- package/dist/cjs/internal/sqlSchemaErrors.d.ts +18 -0
- package/dist/cjs/internal/sqlSchemaErrors.d.ts.map +1 -0
- package/dist/cjs/internal/sqlSchemaErrors.js +40 -0
- package/dist/cjs/internal/sqlSchemaErrors.js.map +7 -0
- package/dist/cjs/migrations/0001_control_tables.d.ts +18 -0
- package/dist/cjs/migrations/0001_control_tables.d.ts.map +1 -0
- package/dist/cjs/migrations/0001_control_tables.js +115 -0
- package/dist/cjs/migrations/0001_control_tables.js.map +7 -0
- package/dist/cjs/migrations/0002_run_keys.d.ts +15 -0
- package/dist/cjs/migrations/0002_run_keys.d.ts.map +1 -0
- package/dist/cjs/migrations/0002_run_keys.js +44 -0
- package/dist/cjs/migrations/0002_run_keys.js.map +7 -0
- package/dist/cjs/migrations/0003_signal_commands.d.ts +13 -0
- package/dist/cjs/migrations/0003_signal_commands.d.ts.map +1 -0
- package/dist/cjs/migrations/0003_signal_commands.js +50 -0
- package/dist/cjs/migrations/0003_signal_commands.js.map +7 -0
- package/dist/cjs/migrations/0004_approval_decisions.d.ts +13 -0
- package/dist/cjs/migrations/0004_approval_decisions.d.ts.map +1 -0
- package/dist/cjs/migrations/0004_approval_decisions.js +45 -0
- package/dist/cjs/migrations/0004_approval_decisions.js.map +7 -0
- package/dist/cjs/migrations/0005_signal_principals.d.ts +18 -0
- package/dist/cjs/migrations/0005_signal_principals.d.ts.map +1 -0
- package/dist/cjs/migrations/0005_signal_principals.js +45 -0
- package/dist/cjs/migrations/0005_signal_principals.js.map +7 -0
- package/dist/cjs/migrations/0006_run_principals.d.ts +18 -0
- package/dist/cjs/migrations/0006_run_principals.d.ts.map +1 -0
- package/dist/cjs/migrations/0006_run_principals.js +49 -0
- package/dist/cjs/migrations/0006_run_principals.js.map +7 -0
- package/dist/cjs/migrations/0007_resume_consent.d.ts +18 -0
- package/dist/cjs/migrations/0007_resume_consent.d.ts.map +1 -0
- package/dist/cjs/migrations/0007_resume_consent.js +46 -0
- package/dist/cjs/migrations/0007_resume_consent.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/test/TestControl.d.ts +19 -0
- package/dist/cjs/test/TestControl.d.ts.map +1 -0
- package/dist/cjs/test/TestControl.js +62 -0
- package/dist/cjs/test/TestControl.js.map +7 -0
- package/dist/esm/ApprovalAuthority.d.ts +73 -0
- package/dist/esm/ApprovalAuthority.d.ts.map +1 -0
- package/dist/esm/ApprovalAuthority.js +72 -0
- package/dist/esm/ApprovalAuthority.js.map +1 -0
- package/dist/esm/Cancellation.d.ts +107 -0
- package/dist/esm/Cancellation.d.ts.map +1 -0
- package/dist/esm/Cancellation.js +116 -0
- package/dist/esm/Cancellation.js.map +1 -0
- package/dist/esm/Channels.d.ts +170 -0
- package/dist/esm/Channels.d.ts.map +1 -0
- package/dist/esm/Channels.js +312 -0
- package/dist/esm/Channels.js.map +1 -0
- package/dist/esm/Control.d.ts +202 -0
- package/dist/esm/Control.d.ts.map +1 -0
- package/dist/esm/Control.js +42 -0
- package/dist/esm/Control.js.map +1 -0
- package/dist/esm/ControlClient.d.ts +52 -0
- package/dist/esm/ControlClient.d.ts.map +1 -0
- package/dist/esm/ControlClient.js +217 -0
- package/dist/esm/ControlClient.js.map +1 -0
- package/dist/esm/ControlError.d.ts +318 -0
- package/dist/esm/ControlError.d.ts.map +1 -0
- package/dist/esm/ControlError.js +359 -0
- package/dist/esm/ControlError.js.map +1 -0
- package/dist/esm/ControlExecutor.d.ts +372 -0
- package/dist/esm/ControlExecutor.d.ts.map +1 -0
- package/dist/esm/ControlExecutor.js +212 -0
- package/dist/esm/ControlExecutor.js.map +1 -0
- package/dist/esm/ControlFacts.d.ts +454 -0
- package/dist/esm/ControlFacts.d.ts.map +1 -0
- package/dist/esm/ControlFacts.js +324 -0
- package/dist/esm/ControlFacts.js.map +1 -0
- package/dist/esm/ControlLive.d.ts +23 -0
- package/dist/esm/ControlLive.d.ts.map +1 -0
- package/dist/esm/ControlLive.js +1589 -0
- package/dist/esm/ControlLive.js.map +1 -0
- package/dist/esm/ControlRpcs.d.ts +1204 -0
- package/dist/esm/ControlRpcs.d.ts.map +1 -0
- package/dist/esm/ControlRpcs.js +299 -0
- package/dist/esm/ControlRpcs.js.map +1 -0
- package/dist/esm/ControlRuntime.d.ts +635 -0
- package/dist/esm/ControlRuntime.d.ts.map +1 -0
- package/dist/esm/ControlRuntime.js +808 -0
- package/dist/esm/ControlRuntime.js.map +1 -0
- package/dist/esm/ControlSchema.d.ts +2642 -0
- package/dist/esm/ControlSchema.d.ts.map +1 -0
- package/dist/esm/ControlSchema.js +1030 -0
- package/dist/esm/ControlSchema.js.map +1 -0
- package/dist/esm/ControlServer.d.ts +51 -0
- package/dist/esm/ControlServer.d.ts.map +1 -0
- package/dist/esm/ControlServer.js +145 -0
- package/dist/esm/ControlServer.js.map +1 -0
- package/dist/esm/Credential.d.ts +136 -0
- package/dist/esm/Credential.d.ts.map +1 -0
- package/dist/esm/Credential.js +190 -0
- package/dist/esm/Credential.js.map +1 -0
- package/dist/esm/CredentialCipher.d.ts +90 -0
- package/dist/esm/CredentialCipher.d.ts.map +1 -0
- package/dist/esm/CredentialCipher.js +56 -0
- package/dist/esm/CredentialCipher.js.map +1 -0
- package/dist/esm/CredentialStore.d.ts +97 -0
- package/dist/esm/CredentialStore.d.ts.map +1 -0
- package/dist/esm/CredentialStore.js +101 -0
- package/dist/esm/CredentialStore.js.map +1 -0
- package/dist/esm/DispatchReader.d.ts +112 -0
- package/dist/esm/DispatchReader.d.ts.map +1 -0
- package/dist/esm/DispatchReader.js +76 -0
- package/dist/esm/DispatchReader.js.map +1 -0
- package/dist/esm/Health.d.ts +333 -0
- package/dist/esm/Health.d.ts.map +1 -0
- package/dist/esm/Health.js +400 -0
- package/dist/esm/Health.js.map +1 -0
- package/dist/esm/JevSessionChecker.d.ts +57 -0
- package/dist/esm/JevSessionChecker.d.ts.map +1 -0
- package/dist/esm/JevSessionChecker.js +108 -0
- package/dist/esm/JevSessionChecker.js.map +1 -0
- package/dist/esm/Lineage.d.ts +131 -0
- package/dist/esm/Lineage.d.ts.map +1 -0
- package/dist/esm/Lineage.js +174 -0
- package/dist/esm/Lineage.js.map +1 -0
- package/dist/esm/Migrations.d.ts +34 -0
- package/dist/esm/Migrations.d.ts.map +1 -0
- package/dist/esm/Migrations.js +53 -0
- package/dist/esm/Migrations.js.map +1 -0
- package/dist/esm/Monitor.d.ts +282 -0
- package/dist/esm/Monitor.d.ts.map +1 -0
- package/dist/esm/Monitor.js +415 -0
- package/dist/esm/Monitor.js.map +1 -0
- package/dist/esm/ScopedToken.d.ts +193 -0
- package/dist/esm/ScopedToken.d.ts.map +1 -0
- package/dist/esm/ScopedToken.js +224 -0
- package/dist/esm/ScopedToken.js.map +1 -0
- package/dist/esm/SqlControlRuntime.d.ts +161 -0
- package/dist/esm/SqlControlRuntime.d.ts.map +1 -0
- package/dist/esm/SqlControlRuntime.js +1756 -0
- package/dist/esm/SqlControlRuntime.js.map +1 -0
- package/dist/esm/SqlCredentialStore.d.ts +43 -0
- package/dist/esm/SqlCredentialStore.d.ts.map +1 -0
- package/dist/esm/SqlCredentialStore.js +97 -0
- package/dist/esm/SqlCredentialStore.js.map +1 -0
- package/dist/esm/Steering.d.ts +69 -0
- package/dist/esm/Steering.d.ts.map +1 -0
- package/dist/esm/Steering.js +89 -0
- package/dist/esm/Steering.js.map +1 -0
- package/dist/esm/SystemFlows.d.ts +223 -0
- package/dist/esm/SystemFlows.d.ts.map +1 -0
- package/dist/esm/SystemFlows.js +198 -0
- package/dist/esm/SystemFlows.js.map +1 -0
- package/dist/esm/WebCryptoCipher.d.ts +49 -0
- package/dist/esm/WebCryptoCipher.d.ts.map +1 -0
- package/dist/esm/WebCryptoCipher.js +123 -0
- package/dist/esm/WebCryptoCipher.js.map +1 -0
- package/dist/esm/WebhookChannel.d.ts +113 -0
- package/dist/esm/WebhookChannel.d.ts.map +1 -0
- package/dist/esm/WebhookChannel.js +109 -0
- package/dist/esm/WebhookChannel.js.map +1 -0
- package/dist/esm/index.d.ts +160 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +160 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/MutationBoundary.d.ts +27 -0
- package/dist/esm/internal/MutationBoundary.d.ts.map +1 -0
- package/dist/esm/internal/MutationBoundary.js +40 -0
- package/dist/esm/internal/MutationBoundary.js.map +1 -0
- package/dist/esm/internal/activeFibers.d.ts +12 -0
- package/dist/esm/internal/activeFibers.d.ts.map +1 -0
- package/dist/esm/internal/activeFibers.js +17 -0
- package/dist/esm/internal/activeFibers.js.map +1 -0
- package/dist/esm/internal/issues.d.ts +28 -0
- package/dist/esm/internal/issues.d.ts.map +1 -0
- package/dist/esm/internal/issues.js +35 -0
- package/dist/esm/internal/issues.js.map +1 -0
- package/dist/esm/internal/planning.d.ts +347 -0
- package/dist/esm/internal/planning.d.ts.map +1 -0
- package/dist/esm/internal/planning.js +199 -0
- package/dist/esm/internal/planning.js.map +1 -0
- package/dist/esm/internal/sqlSchemaErrors.d.ts +18 -0
- package/dist/esm/internal/sqlSchemaErrors.d.ts.map +1 -0
- package/dist/esm/internal/sqlSchemaErrors.js +38 -0
- package/dist/esm/internal/sqlSchemaErrors.js.map +1 -0
- package/dist/esm/migrations/0001_control_tables.d.ts +18 -0
- package/dist/esm/migrations/0001_control_tables.d.ts.map +1 -0
- package/dist/esm/migrations/0001_control_tables.js +96 -0
- package/dist/esm/migrations/0001_control_tables.js.map +1 -0
- package/dist/esm/migrations/0002_run_keys.d.ts +15 -0
- package/dist/esm/migrations/0002_run_keys.d.ts.map +1 -0
- package/dist/esm/migrations/0002_run_keys.js +22 -0
- package/dist/esm/migrations/0002_run_keys.js.map +1 -0
- package/dist/esm/migrations/0003_signal_commands.d.ts +13 -0
- package/dist/esm/migrations/0003_signal_commands.d.ts.map +1 -0
- package/dist/esm/migrations/0003_signal_commands.js +26 -0
- package/dist/esm/migrations/0003_signal_commands.js.map +1 -0
- package/dist/esm/migrations/0004_approval_decisions.d.ts +13 -0
- package/dist/esm/migrations/0004_approval_decisions.d.ts.map +1 -0
- package/dist/esm/migrations/0004_approval_decisions.js +25 -0
- package/dist/esm/migrations/0004_approval_decisions.js.map +1 -0
- package/dist/esm/migrations/0005_signal_principals.d.ts +18 -0
- package/dist/esm/migrations/0005_signal_principals.d.ts.map +1 -0
- package/dist/esm/migrations/0005_signal_principals.js +27 -0
- package/dist/esm/migrations/0005_signal_principals.js.map +1 -0
- package/dist/esm/migrations/0006_run_principals.d.ts +18 -0
- package/dist/esm/migrations/0006_run_principals.d.ts.map +1 -0
- package/dist/esm/migrations/0006_run_principals.js +30 -0
- package/dist/esm/migrations/0006_run_principals.js.map +1 -0
- package/dist/esm/migrations/0007_resume_consent.d.ts +18 -0
- package/dist/esm/migrations/0007_resume_consent.d.ts.map +1 -0
- package/dist/esm/migrations/0007_resume_consent.js +27 -0
- package/dist/esm/migrations/0007_resume_consent.js.map +1 -0
- package/dist/esm/test/TestControl.d.ts +19 -0
- package/dist/esm/test/TestControl.d.ts.map +1 -0
- package/dist/esm/test/TestControl.js +30 -0
- package/dist/esm/test/TestControl.js.map +1 -0
- package/docs/README.md +189 -0
- package/docs/api.md +982 -0
- package/docs/concepts/authority.md +109 -0
- package/docs/concepts/cancellation.md +129 -0
- package/docs/concepts/lineage.md +132 -0
- package/docs/concepts/ownership.md +139 -0
- package/docs/concepts/projections.md +203 -0
- package/docs/concepts/receipts.md +128 -0
- package/docs/guides/approvals.md +284 -0
- package/docs/guides/cancel-and-resume.md +162 -0
- package/docs/guides/durable-storage.md +147 -0
- package/docs/guides/implement-an-executor.md +173 -0
- package/docs/guides/ingest-a-webhook.md +177 -0
- package/docs/guides/list-runs.md +160 -0
- package/docs/guides/monitor-runs.md +176 -0
- package/docs/guides/observe-health.md +147 -0
- package/docs/guides/postgres-tests.md +7 -0
- package/docs/guides/serve-over-rpc.md +220 -0
- package/docs/guides/signal-a-run.md +53 -0
- package/docs/guides/steer-a-run.md +138 -0
- package/docs/guides/store-credentials.md +164 -0
- package/docs/guides/testing.md +139 -0
- package/docs/guides/watch-a-run.md +154 -0
- package/docs/installation.md +106 -0
- package/docs/quickstart.md +163 -0
- package/docs/troubleshooting.md +208 -0
- package/package.json +405 -3
- package/src/ApprovalAuthority.ts +114 -0
- package/src/Cancellation.ts +172 -0
- package/src/Channels.ts +493 -0
- package/src/Control.ts +337 -0
- package/src/ControlClient.ts +319 -0
- package/src/ControlError.ts +378 -0
- package/src/ControlExecutor.ts +490 -0
- package/src/ControlFacts.ts +383 -0
- package/src/ControlLive.ts +2127 -0
- package/src/ControlRpcs.ts +443 -0
- package/src/ControlRuntime.ts +1601 -0
- package/src/ControlSchema.ts +1380 -0
- package/src/ControlServer.ts +182 -0
- package/src/Credential.ts +310 -0
- package/src/CredentialCipher.ts +110 -0
- package/src/CredentialStore.ts +152 -0
- package/src/DispatchReader.ts +122 -0
- package/src/Health.ts +591 -0
- package/src/JevSessionChecker.ts +127 -0
- package/src/Lineage.ts +203 -0
- package/src/Migrations.ts +56 -0
- package/src/Monitor.ts +600 -0
- package/src/ScopedToken.ts +306 -0
- package/src/SqlControlRuntime.ts +2478 -0
- package/src/SqlCredentialStore.ts +148 -0
- package/src/Steering.ts +96 -0
- package/src/SystemFlows.ts +225 -0
- package/src/WebCryptoCipher.ts +169 -0
- package/src/WebhookChannel.ts +166 -0
- package/src/index.ts +188 -0
- package/src/internal/MutationBoundary.ts +46 -0
- package/src/internal/activeFibers.ts +22 -0
- package/src/internal/issues.ts +40 -0
- package/src/internal/planning.ts +262 -0
- package/src/internal/sqlSchemaErrors.ts +37 -0
- package/src/migrations/0001_control_tables.ts +99 -0
- package/src/migrations/0002_run_keys.ts +23 -0
- package/src/migrations/0003_signal_commands.ts +27 -0
- package/src/migrations/0004_approval_decisions.ts +25 -0
- package/src/migrations/0005_signal_principals.ts +27 -0
- package/src/migrations/0006_run_principals.ts +31 -0
- package/src/migrations/0007_resume_consent.ts +28 -0
- package/src/test/TestControl.ts +47 -0
package/docs/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@smthrs/control"
|
|
3
|
+
description: "The control plane for durable agent runs: plan work, approve it, start it, watch it, steer it, and stop it, from any process, with every decision recorded beside the state it changed."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`@smthrs/control` is the control plane for durable agent runs. It is one
|
|
7
|
+
TypeScript service, `Control`, with ten operations: `plan`, `run`, `approve`,
|
|
8
|
+
`deny`, `steer`, `signal`, `cancel`, `resume`, `list`, and `watch`. A command
|
|
9
|
+
line, a gateway, an MCP server, or a dashboard calls those operations when a
|
|
10
|
+
person or another agent asks for something to start, stop, or change.
|
|
11
|
+
|
|
12
|
+
## The problem it solves
|
|
13
|
+
|
|
14
|
+
Agent work that runs for hours outlives the process that started it. By the
|
|
15
|
+
time somebody wants to approve a deployment, cancel a run that is going
|
|
16
|
+
nowhere, or ask what a run is waiting on, the process that could have answered
|
|
17
|
+
from memory may be gone, and the run itself may be owned by a different machine.
|
|
18
|
+
|
|
19
|
+
`Control` answers from persisted evidence instead, and it holds three promises
|
|
20
|
+
while doing it:
|
|
21
|
+
|
|
22
|
+
- **Every mutation is idempotent under a key you choose.** A retried cancel, a
|
|
23
|
+
redelivered webhook, and a double-clicked approve are each one mutation, and
|
|
24
|
+
the second ask answers with the first one's receipt.
|
|
25
|
+
- **Every mutation is attributed and journaled.** The plane stamps the
|
|
26
|
+
principal it authenticated, not the one a caller claimed, and writes the
|
|
27
|
+
journal entry in the same commit as the state change, so "who asked for this,
|
|
28
|
+
and when did it take effect?" still has an answer a week later.
|
|
29
|
+
- **Nothing here executes a flow.** `Control` is authority, not execution. That
|
|
30
|
+
split is what lets one plane answer for runs that several processes own, on
|
|
31
|
+
machines it cannot reach, in a database it shares with an engine it never
|
|
32
|
+
imports.
|
|
33
|
+
|
|
34
|
+
Reach for this package when you are building the thing operators and agents
|
|
35
|
+
point at. Reach for the command line instead when you want to drive runs from a
|
|
36
|
+
shell.
|
|
37
|
+
|
|
38
|
+
## How it relates to the smthrs CLI
|
|
39
|
+
|
|
40
|
+
[`@smthrs/cli`](/api/cli) is the `smthrs` command line, and it is a host over
|
|
41
|
+
this package. `smthrs flow plan`, `smthrs approvals approve`, `smthrs flow execute`,
|
|
42
|
+
`smthrs runs list`, and `smthrs runs cancel` are each one call into the `Control` service defined here and
|
|
43
|
+
into nothing else, which is why the same command answers the same way against a
|
|
44
|
+
local project directory and against a remote plane: run the CLI with `--remote`
|
|
45
|
+
and it provides `ControlClient.layer` in place of the in-process
|
|
46
|
+
implementation, and no verb notices the difference.
|
|
47
|
+
|
|
48
|
+
That relationship runs in one direction. `@smthrs/cli` depends on
|
|
49
|
+
`@smthrs/control`; this package knows nothing about a terminal. Install
|
|
50
|
+
[`@smthrs/cli`](/api/cli) when a person drives runs from a shell, and it is
|
|
51
|
+
also the top-level package the rest of Smithers sits under, so start there if
|
|
52
|
+
you are new. Install `@smthrs/control` when you are writing a host of your own:
|
|
53
|
+
a gateway, an MCP server, a supervisor, a dashboard, or a CI job that needs to
|
|
54
|
+
plan a run, decide an approval, or watch a journal it did not write.
|
|
55
|
+
|
|
56
|
+
Flow authors reach this package only where a step consults a durable decision,
|
|
57
|
+
as an in-run approval does.
|
|
58
|
+
|
|
59
|
+
## Install
|
|
60
|
+
|
|
61
|
+
Not on npm yet; see [Installation](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/flow/docs/installation.md#use-the-libraries).
|
|
62
|
+
|
|
63
|
+
The package needs
|
|
64
|
+
Node.js 26.4.0 or later. For the collaborator packages a working composition
|
|
65
|
+
adds, see [Installation](./installation.md).
|
|
66
|
+
|
|
67
|
+
## The smallest real program
|
|
68
|
+
|
|
69
|
+
Plan a flow, then ask to run it. A plan starts undecided, so the launch parks
|
|
70
|
+
instead of starting anything:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { Control } from "@smthrs/control/Control"
|
|
74
|
+
import type * as ControlRuntime from "@smthrs/control/ControlRuntime"
|
|
75
|
+
import * as TestControl from "@smthrs/control/test/TestControl"
|
|
76
|
+
import * as Effect from "effect/Effect"
|
|
77
|
+
|
|
78
|
+
/** One flow this plane may be asked to plan. */
|
|
79
|
+
const Deploy: ControlRuntime.MemoryFlow = {
|
|
80
|
+
flowId: "quickstart/Deploy",
|
|
81
|
+
description: "Deploys one build",
|
|
82
|
+
deployClass: true,
|
|
83
|
+
envelope: { capabilities: ["process:spawn"], flows: [], budget: {} }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const program = Effect.gen(function*() {
|
|
87
|
+
const control = yield* Control
|
|
88
|
+
const card = yield* control.plan({ flowId: "quickstart/Deploy", input: { build: "v1.4.0" } })
|
|
89
|
+
return yield* control.run({
|
|
90
|
+
_tag: "Plan",
|
|
91
|
+
planId: card.planId,
|
|
92
|
+
digest: card.digest,
|
|
93
|
+
envelope: card.envelope,
|
|
94
|
+
idempotencyKey: "deploy:v1.4.0"
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// { _tag: "Parked", receiptId: "deploy:v1.4.0", planId: "plan-1", status: "waiting-approval" }
|
|
99
|
+
console.log(
|
|
100
|
+
await Effect.runPromise(program.pipe(Effect.provide(TestControl.layer({ flows: [Deploy] }))))
|
|
101
|
+
)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The [Quickstart](./quickstart.md) carries this through approval, launch,
|
|
105
|
+
listing, and a watch, with no database and no engine.
|
|
106
|
+
|
|
107
|
+
## The three seams
|
|
108
|
+
|
|
109
|
+
`Control` keeps its promises through four ports, and a host chooses an
|
|
110
|
+
implementation of each:
|
|
111
|
+
|
|
112
|
+
- `ControlRuntime` is the persistence port: plans, approval tokens, grants,
|
|
113
|
+
idempotency records, and the fenced run rows. `ControlRuntime.layerMemory` is
|
|
114
|
+
the deterministic in-memory one; `SqlControlRuntime.layer` is the durable one
|
|
115
|
+
over a SQL database and the fenced run store.
|
|
116
|
+
- `ControlExecutor` is the execution port: the plane hands a launch, a cancel,
|
|
117
|
+
a signal, or a resume to a real engine and learns only what the engine did
|
|
118
|
+
with it. A composition that provides none records and observes but starts
|
|
119
|
+
nothing, which is the right shape for a monitor or a read-only dashboard.
|
|
120
|
+
- `DispatchReader` is the trigger read port: `list` answers the `triggers` and
|
|
121
|
+
`fires` variants through it. A composition that provides none still lists
|
|
122
|
+
flows and runs, and refuses those two variants with a typed `InvalidInput`
|
|
123
|
+
rather than an empty page.
|
|
124
|
+
- `ControlServer` and `ControlClient` are the transport: the same `Control`
|
|
125
|
+
vtable served as RPC and projected back on the other side of a wire. A caller
|
|
126
|
+
handed either one cannot tell which it has.
|
|
127
|
+
|
|
128
|
+
## The package at a glance
|
|
129
|
+
|
|
130
|
+
The root entry point exports these namespaces, and each is also importable from
|
|
131
|
+
`@smthrs/control/<Module>`:
|
|
132
|
+
|
|
133
|
+
| Namespace | What it is |
|
|
134
|
+
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
135
|
+
| `Control` | The service: `plan`, `run`, `approve`, `deny`, `steer`, `signal`, `cancel`, `resume`, `list`, `watch`. |
|
|
136
|
+
| `ControlSchema` | The serializable values both halves of the wire decode: `PlanCard`, `RunSummary`, `Receipt`, `SteerMessage`, and the RPC request schemas. |
|
|
137
|
+
| `ControlError` | Every stable failure the plane emits, as classes and as one membership schema. |
|
|
138
|
+
| `ControlLive` | The in-process implementation over `ControlRuntime`, the journal, the notification queue, and the registry. |
|
|
139
|
+
| `ControlRuntime` | The persistence port, plus `layerMemory`, its deterministic in-memory implementation. |
|
|
140
|
+
| `SqlControlRuntime` | The durable persistence adapter over a SQL database and the fenced run store. |
|
|
141
|
+
| `ControlExecutor` | The execution port: launch, cancel, signal, resume, and the park settlement a cancel needs. |
|
|
142
|
+
| `DispatchReader` | The trigger read port: the registered triggers and the fire ledger `list` pages, plus `layerNone` for a host without a store. |
|
|
143
|
+
| `ControlRpcs` | The ten remote procedures, the authentication middleware, and a bearer authenticator. |
|
|
144
|
+
| `ScopedToken` | Scoped, expiring tokens minted under a bearer credential: named procedures, an optional run or flow, and an expiry. |
|
|
145
|
+
| `ControlServer` | The RPC handlers and the HTTP plus WebSocket mount. |
|
|
146
|
+
| `ControlClient` | The RPC client projected back into the `Control` interface. |
|
|
147
|
+
| `Lineage` | How a run came to exist: `child`, `fork`, or `continuation`, derived from run rows and journal entries. |
|
|
148
|
+
| `Cancellation` | Who cancelled a run, why, and whether it was swept up in an ancestor's cascade. |
|
|
149
|
+
| `Steering` | The steer lifecycle: the enqueue the plane records and the delivery it derives from the queue. |
|
|
150
|
+
| `Monitor` | Run health as a pure classification, and the beat loop that acts on it. |
|
|
151
|
+
| `Channels` | Verified ingress: an external request becomes a control mutation, once. |
|
|
152
|
+
| `WebhookChannel` | A schema-declared webhook channel and its bounded HTTP handler. |
|
|
153
|
+
| `Credential` | The credential boundary: only a reference crosses it, never a secret. |
|
|
154
|
+
| `CredentialStore`, `CredentialCipher` | The persistence and encryption ports behind it. |
|
|
155
|
+
| `SqlCredentialStore`, `WebCryptoCipher` | Their durable and AES-256-GCM adapters. |
|
|
156
|
+
| `Migrations` | The package's namespaced migration set and the layer that runs it. |
|
|
157
|
+
| `SystemFlows` | The reserved CLI verb to flow-id catalog, and which of those a runtime may plan. |
|
|
158
|
+
|
|
159
|
+
Every export of every namespace, with its signature, is on the
|
|
160
|
+
[API reference](./api.md).
|
|
161
|
+
|
|
162
|
+
## Where to go next
|
|
163
|
+
|
|
164
|
+
- [Installation](./installation.md): requirements, import forms, and the
|
|
165
|
+
packages a runnable composition adds.
|
|
166
|
+
- [Quickstart](./quickstart.md): plan, approve, launch, list, and watch, in one
|
|
167
|
+
in-memory program.
|
|
168
|
+
- Concepts: [authority, not execution](./concepts/authority.md),
|
|
169
|
+
[receipts and idempotency](./concepts/receipts.md),
|
|
170
|
+
[ownership, fences, and claims](./concepts/ownership.md),
|
|
171
|
+
[journal projections](./concepts/projections.md),
|
|
172
|
+
[run lineage](./concepts/lineage.md), and
|
|
173
|
+
[cancellation attribution](./concepts/cancellation.md).
|
|
174
|
+
- Guides: [gate work behind an approval](./guides/approvals.md),
|
|
175
|
+
[find runs](./guides/list-runs.md), [watch a run](./guides/watch-a-run.md),
|
|
176
|
+
[steer a run](./guides/steer-a-run.md),
|
|
177
|
+
[signal a waiting run](./guides/signal-a-run.md),
|
|
178
|
+
[cancel and restart a run](./guides/cancel-and-resume.md),
|
|
179
|
+
[store control state in a database](./guides/durable-storage.md),
|
|
180
|
+
[connect an execution engine](./guides/implement-an-executor.md),
|
|
181
|
+
[serve the plane over RPC](./guides/serve-over-rpc.md),
|
|
182
|
+
[monitor and heal a run](./guides/monitor-runs.md),
|
|
183
|
+
[accept a webhook](./guides/ingest-a-webhook.md),
|
|
184
|
+
[store a credential](./guides/store-credentials.md), and
|
|
185
|
+
[test against the plane](./guides/testing.md).
|
|
186
|
+
- [Troubleshooting](./troubleshooting.md): the refusals this package reports,
|
|
187
|
+
what causes them, and what to change.
|
|
188
|
+
- [`@smthrs/cli`](/api/cli): the `smthrs` command line built on this service,
|
|
189
|
+
and the package the rest of Smithers sits under.
|