@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ControlClient.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * RPC client layer projected back into the control service interface.\n *\n * @since 0.1.0\n */\n\nimport { Cause, Effect, Layer, Result, Schema, Stream } from \"effect\"\nimport { HttpClient, HttpClientRequest } from \"effect/unstable/http\"\nimport { RpcClient, RpcClientError } from \"effect/unstable/rpc\"\nimport { Control, make } from \"./Control.ts\"\nimport { type ControlError, ControlErrorSchema, TransportError, Unauthorized } from \"./ControlError.ts\"\nimport { ControlRpcs } from \"./ControlRpcs.ts\"\nimport {\n ApprovalInputSchema,\n CancelInputSchema,\n ListRequest,\n PlanInputSchema,\n ResumeInputSchema,\n RunInputSchema,\n SignalInputSchema,\n SteerInputSchema,\n WatchFilter\n} from \"./ControlSchema.ts\"\n\n/**\n * Whether a value is one of the control plane's declared failures, as opposed\n * to a defect that escaped some other layer.\n *\n * Derived from `ControlError.ControlErrorSchema` rather than restated, so a new\n * error class cannot be a member of the union and a stranger to the client.\n *\n * @category refinements\n * @since 0.1.0\n */\nexport const isControlError = Schema.is(ControlErrorSchema)\n\ninterface TransportClassification {\n readonly message: string\n readonly retryable: boolean\n}\n\nconst requestEncoding: TransportClassification = {\n message: \"The control request could not be encoded.\",\n retryable: false\n}\n\nconst responseDecoding: TransportClassification = {\n message: \"The control response could not be decoded.\",\n retryable: false\n}\n\nconst connectionFailure: TransportClassification = {\n message: \"The control server could not be reached.\",\n retryable: true\n}\n\nconst clientHttpFailure: TransportClassification = {\n message: \"The control server rejected the HTTP request.\",\n retryable: false\n}\n\nconst serverHttpFailure: TransportClassification = {\n message: \"The control server failed while handling the HTTP request.\",\n retryable: true\n}\n\nconst invalidClientUrl: TransportClassification = {\n message: \"The control server URL is invalid.\",\n retryable: false\n}\n\nconst unknownClientFailure: TransportClassification = {\n message: \"The control RPC client failed.\",\n retryable: false\n}\n\nconst transportError = (cause: unknown, classification: TransportClassification): TransportError =>\n new TransportError({\n ...classification,\n cause\n })\n\n// A `StatusCodeError` reported by the RPC client always carries the concrete\n// error, and that error always carries its response. The three refusals below\n// are what keeps a hand-built wrapper without one from being read as a 5xx and\n// retried forever; none of them is reachable from the client's own transports.\nconst statusFrom = (cause: unknown): number | undefined => {\n /* v8 ignore next -- a StatusCodeError cause always carries its response */\n if (typeof cause !== \"object\" || cause === null || !(\"response\" in cause)) return undefined\n const response = cause.response\n /* v8 ignore next -- as above: the response is an object carrying a status */\n if (typeof response !== \"object\" || response === null || !(\"status\" in response)) return undefined\n /* v8 ignore next -- as above: the status is a number */\n return typeof response.status === \"number\" ? response.status : undefined\n}\n\ntype HttpFailureKind = Extract<RpcClientError.RpcClientError[\"reason\"], { readonly _tag: \"HttpError\" }>[\"kind\"]\ntype TransportReason = RpcClientError.RpcClientError[\"reason\"][\"_tag\"]\n\n/**\n * What each HTTP failure means for a retry.\n *\n * `StatusCodeError` is absent on purpose: it is the one kind whose answer\n * depends on the response, not on the kind.\n */\nconst httpClassification: Record<Exclude<HttpFailureKind, \"StatusCodeError\">, TransportClassification> = {\n TransportError: connectionFailure,\n EncodeError: requestEncoding,\n InvalidUrlError: invalidClientUrl,\n DecodeError: responseDecoding,\n EmptyBodyError: responseDecoding\n}\n\n/**\n * What each non-HTTP transport failure means for a retry.\n *\n * A table rather than a switch, because the mapping is data: the compiler\n * still requires every reason the RPC client can report to have an answer, and\n * a reader can check the whole policy at a glance.\n */\nconst reasonClassification: Record<Exclude<TransportReason, \"HttpError\">, TransportClassification> = {\n RpcClientDefect: responseDecoding,\n SocketReadError: connectionFailure,\n SocketWriteError: connectionFailure,\n SocketOpenError: connectionFailure,\n // The socket cannot perform a requested protocol upgrade; retries of the\n // same unsupported operation cannot change that host capability.\n SocketUpgradeError: unknownClientFailure,\n SocketCloseError: connectionFailure,\n // A worker transport is not composable with this client, which speaks HTTP\n // and WebSocket. The entries exist so the table stays exhaustive.\n WorkerSpawnError: unknownClientFailure,\n WorkerSendError: unknownClientFailure,\n WorkerReceiveError: unknownClientFailure,\n WorkerUnknownError: unknownClientFailure\n}\n\nconst classifyRpcClientError = (error: RpcClientError.RpcClientError): TransportClassification => {\n const reason = error.reason\n if (reason._tag !== \"HttpError\") return reasonClassification[reason._tag]\n if (reason.kind !== \"StatusCodeError\") return httpClassification[reason.kind]\n // Effect's serializable HttpError keeps the concrete StatusCodeError in\n // `cause`. The wrapper has no separate status field, so a hand-built wrapper\n // without that cause cannot safely be classified as retryable and falls back\n // to the client class.\n const status = statusFrom(reason.cause)\n return status !== undefined && status >= 500 && status <= 599\n ? serverHttpFailure\n : clientHttpFailure\n}\n\nconst isRpcClientError = Schema.is(RpcClientError.RpcClientError)\n\nconst classify = (error: unknown): TransportClassification => {\n if (Schema.isSchemaError(error)) return responseDecoding\n if (isRpcClientError(error)) return classifyRpcClientError(error)\n return unknownClientFailure\n}\n\n// Preserve the operation-specific control failures from the RPC schema while\n// replacing transport and decoding failures with the public TransportError.\nconst normalizedFailure = <E>(cause: Cause.Cause<E>): Effect.Effect<never, (E & ControlError) | TransportError> => {\n const failure = Cause.findError(cause)\n if (Result.isSuccess(failure)) {\n return Effect.fail(\n isControlError(failure.success)\n ? failure.success\n : transportError(failure.success, classify(failure.success))\n )\n }\n const defect = Cause.findDefect(cause)\n // A cause with neither a failure nor a defect is an interruption, and an\n // operator's own cancellation is not the server failing. It is re-raised\n // exactly as it arrived rather than described as a transport failure.\n /* v8 ignore next 2 -- the fiber propagates an interrupt-only cause without reaching this operator */\n return Result.isSuccess(defect)\n ? Effect.fail(transportError(defect.success, classify(defect.success)))\n : Effect.failCause(cause as Cause.Cause<(E & ControlError) | TransportError>)\n}\n\nconst normalize = <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, (E & ControlError) | TransportError, R> =>\n Effect.catchCause(effect, normalizedFailure)\n\ntype RequestEncoder = (input: unknown) => Effect.Effect<unknown, Schema.SchemaError>\n\nconst encoder = (schema: Schema.Top): RequestEncoder =>\n // Every request schema in this module is service-free. `Schema.Top` erases\n // that fact to `unknown`, so restore it at this one construction boundary.\n Schema.encodeUnknownEffect(Schema.toCodecJson(schema)) as RequestEncoder\n\nconst planEncoder = encoder(PlanInputSchema)\nconst runEncoder = encoder(RunInputSchema)\nconst approvalEncoder = encoder(ApprovalInputSchema)\nconst steerEncoder = encoder(SteerInputSchema)\nconst signalEncoder = encoder(SignalInputSchema)\nconst cancelEncoder = encoder(CancelInputSchema)\nconst resumeEncoder = encoder(ResumeInputSchema)\nconst listEncoder = encoder(ListRequest)\nconst watchEncoder = encoder(WatchFilter)\n\nconst normalizeRequest = <A, E, R>(\n encode: RequestEncoder,\n input: unknown,\n request: () => Effect.Effect<A, E, R>\n): Effect.Effect<A, (E & ControlError) | TransportError, R> =>\n encode(input).pipe(\n Effect.mapError((cause) => transportError(cause, requestEncoding)),\n Effect.andThen(Effect.suspend(() => normalize(request())))\n )\n\nconst normalizeStream = <A, E, R>(\n stream: Stream.Stream<A, E, R>\n): Stream.Stream<A, (E & ControlError) | TransportError, R> =>\n Stream.catchCause(stream, (cause) => Stream.fromEffect(normalizedFailure(cause)))\n\nconst normalizeStreamRequest = <A, E, R>(\n encode: RequestEncoder,\n input: unknown,\n request: () => Stream.Stream<A, E, R>\n): Stream.Stream<A, (E & ControlError) | TransportError, R> =>\n Stream.unwrap(\n encode(input).pipe(\n Effect.mapError((cause) => transportError(cause, requestEncoding)),\n Effect.map(() => normalizeStream(request()))\n )\n )\n\n/**\n * Client transport configuration. Unary procedures use HTTP at this URL;\n * `watch` uses the abstract WebSocket supplied by the platform layer.\n *\n * `credential` reaches the HTTP protocol only. It is attached as a bearer\n * token on each HTTP RPC request; the `watch` stream rides a WebSocket whose\n * upgrade request a browser cannot add headers to, so the socket carries no\n * credential at all in a browser deployment. A deployment that authenticates\n * control traffic must therefore front the socket (terminate auth at a proxy\n * that injects the credential on the upgrade) or serve `watch` over the HTTP\n * protocol instead.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface ClientConfig {\n readonly url: string\n /**\n * Bearer token attached to every HTTP RPC request when present.\n *\n * Not sent on the `watch` WebSocket: see {@link ClientConfig}.\n */\n readonly credential?: string | undefined\n}\n\n/**\n * Provides `Control` through an RPC client while preserving the local vtable.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layer = (config: ClientConfig) => {\n const http = RpcClient.layerProtocolHttp({\n url: config.url,\n transformClient: (client) => {\n // The RPC protocol already admits HttpClientError, but transformClient's\n // generic signature cannot express that filtering adds the same error\n // its input client already carries.\n const checked = HttpClient.filterStatusOk(client) as typeof client\n return config.credential === undefined\n ? checked\n : HttpClient.mapRequest(checked, HttpClientRequest.bearerToken(config.credential))\n }\n })\n const websocket = RpcClient.layerProtocolSocket()\n return Layer.effect(\n Control,\n Effect.gen(function*() {\n // Built into the layer's own scope: `Effect.provide(layer)` would close\n // each protocol as soon as the client was constructed.\n const httpServices = yield* Layer.build(http)\n const websocketServices = yield* Layer.build(websocket)\n const unary = yield* RpcClient.make(ControlRpcs).pipe(Effect.provide(httpServices))\n const streaming = yield* RpcClient.make(ControlRpcs).pipe(Effect.provide(websocketServices))\n return make({\n plan: Effect.fn(\"Control.plan\")((input) => normalizeRequest(planEncoder, input, () => unary.Plan(input))),\n run: Effect.fn(\"Control.run\")((input) => normalizeRequest(runEncoder, input, () => unary.Run(input))),\n // RPC authenticates with this client's credential and does not carry\n // local attribution. Refuse here before an agent becomes that operator.\n approve: Effect.fn(\"Control.approve\")((input) =>\n normalizeRequest(approvalEncoder, input, () =>\n input.principal?.kind === \"agent\"\n ? Effect.fail(new Unauthorized({ message: \"Approval decisions are operator-only\" }))\n : unary.Approve(input))\n ),\n deny: Effect.fn(\"Control.deny\")((input) =>\n normalizeRequest(approvalEncoder, input, () =>\n input.principal?.kind === \"agent\"\n ? Effect.fail(new Unauthorized({ message: \"Approval decisions are operator-only\" }))\n : unary.Deny(input))\n ),\n steer: Effect.fn(\"Control.steer\")((input) => normalizeRequest(steerEncoder, input, () => unary.Steer(input))),\n signal: Effect.fn(\"Control.signal\")((input) =>\n normalizeRequest(signalEncoder, input, () => unary.Signal(input))\n ),\n cancel: Effect.fn(\"Control.cancel\")((input) =>\n normalizeRequest(cancelEncoder, input, () => unary.Cancel(input))\n ),\n resume: Effect.fn(\"Control.resume\")((input) =>\n normalizeRequest(resumeEncoder, input, () => unary.Resume(input))\n ),\n list: Effect.fn(\"Control.list\")((input) => normalizeRequest(listEncoder, input, () => unary.List(input))),\n // `watch` is the only procedure on the socket protocol, and the\n // socket is why `credential` cannot protect it: a browser's WebSocket\n // upgrade takes no headers, so the bearer token that authenticates\n // every unary call above never reaches this stream. Credentialed\n // deployments front the socket or use the HTTP protocol for watch.\n watch: (input) => normalizeStreamRequest(watchEncoder, input, () => streaming.Wat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AM,MAAM,OAAO,KAAK,CAAC;AAAA,QAClE;AAAA,QACA,QAAQ,qBAAO,GAAG,gBAAgB;AAAA,UAAE,CAAC,UACnC,iBAAiB,eAAe,OAAO,MAAM,MAAM,OAAO,KAAK,CAAC;AAAA,QAClE;AAAA,QACA,MAAM,qBAAO,GAAG,cAAc,EAAE,CAAC,UAAU,iBAAiB,aAAa,OAAO,MAAM,MAAM,KAAK,KAAK,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMxG,OAAO,CAAC,UAAU,uBAAuB,cAAc,OAAO,MAAM,UAAU,MAAM,KAAK,CAAC;AAAA,MAC5F,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable, schema-backed control-plane failures.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.1.0
|
|
5
|
+
*/
|
|
6
|
+
import { NotificationError } from "@smthrs/notifications/NotificationQueue";
|
|
7
|
+
import { Schema } from "effect";
|
|
8
|
+
declare const RunNotFound_base: Schema.Class<RunNotFound, Schema.TaggedStruct<"/control/RunNotFound", {
|
|
9
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"run_not_found">>;
|
|
10
|
+
readonly runId: Schema.String;
|
|
11
|
+
}>, import("effect/Cause").YieldableError>;
|
|
12
|
+
/**
|
|
13
|
+
* No run with this id exists.
|
|
14
|
+
*
|
|
15
|
+
* @category errors
|
|
16
|
+
* @since 0.1.0
|
|
17
|
+
*/
|
|
18
|
+
export declare class RunNotFound extends RunNotFound_base {
|
|
19
|
+
/**
|
|
20
|
+
* The sentence an operator reads. Without one the CLI printed the bare
|
|
21
|
+
* fields, `run_not_found runId=nope`, which names no next action.
|
|
22
|
+
*/
|
|
23
|
+
get message(): string;
|
|
24
|
+
}
|
|
25
|
+
declare const PlanNotFound_base: Schema.Class<PlanNotFound, Schema.TaggedStruct<"/control/PlanNotFound", {
|
|
26
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"plan_not_found">>;
|
|
27
|
+
readonly planId: Schema.String;
|
|
28
|
+
}>, import("effect/Cause").YieldableError>;
|
|
29
|
+
/**
|
|
30
|
+
* No plan with this id exists.
|
|
31
|
+
*
|
|
32
|
+
* @category errors
|
|
33
|
+
* @since 0.1.0
|
|
34
|
+
*/
|
|
35
|
+
export declare class PlanNotFound extends PlanNotFound_base {
|
|
36
|
+
/**
|
|
37
|
+
* The sentence an operator reads. Every renderer in the tree prints
|
|
38
|
+
* `message`, so a refusal without one does not explain the next action.
|
|
39
|
+
*/
|
|
40
|
+
get message(): string;
|
|
41
|
+
}
|
|
42
|
+
declare const PlanDenied_base: Schema.Class<PlanDenied, Schema.TaggedStruct<"/control/PlanDenied", {
|
|
43
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"plan_denied">>;
|
|
44
|
+
readonly planId: Schema.String;
|
|
45
|
+
}>, import("effect/Cause").YieldableError>;
|
|
46
|
+
/**
|
|
47
|
+
* The plan was denied and cannot be launched.
|
|
48
|
+
*
|
|
49
|
+
* @category errors
|
|
50
|
+
* @since 0.1.0
|
|
51
|
+
*/
|
|
52
|
+
export declare class PlanDenied extends PlanDenied_base {
|
|
53
|
+
/**
|
|
54
|
+
* The sentence an operator reads. Every renderer in the tree prints
|
|
55
|
+
* `message`, so a denial must state how to make a later launch possible.
|
|
56
|
+
*/
|
|
57
|
+
get message(): string;
|
|
58
|
+
}
|
|
59
|
+
declare const FlowNotFound_base: Schema.Class<FlowNotFound, Schema.TaggedStruct<"/control/FlowNotFound", {
|
|
60
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"flow_not_found">>;
|
|
61
|
+
readonly flowId: Schema.String;
|
|
62
|
+
}>, import("effect/Cause").YieldableError>;
|
|
63
|
+
/**
|
|
64
|
+
* No flow with this id is registered.
|
|
65
|
+
*
|
|
66
|
+
* @category errors
|
|
67
|
+
* @since 0.1.0
|
|
68
|
+
*/
|
|
69
|
+
export declare class FlowNotFound extends FlowNotFound_base {
|
|
70
|
+
/**
|
|
71
|
+
* The sentence an operator reads, which names the command that lists the
|
|
72
|
+
* flows a caller can start.
|
|
73
|
+
*/
|
|
74
|
+
get message(): string;
|
|
75
|
+
}
|
|
76
|
+
declare const PlanDigestMismatch_base: Schema.Class<PlanDigestMismatch, Schema.TaggedStruct<"/control/PlanDigestMismatch", {
|
|
77
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"plan_digest_mismatch">>;
|
|
78
|
+
readonly planId: Schema.String;
|
|
79
|
+
readonly expected: Schema.String;
|
|
80
|
+
readonly actual: Schema.String;
|
|
81
|
+
}>, import("effect/Cause").YieldableError>;
|
|
82
|
+
/**
|
|
83
|
+
* The submitted plan does not hash to the digest the caller declared, so
|
|
84
|
+
* the control plane refuses to store it.
|
|
85
|
+
*
|
|
86
|
+
* @category errors
|
|
87
|
+
* @since 0.1.0
|
|
88
|
+
*/
|
|
89
|
+
export declare class PlanDigestMismatch extends PlanDigestMismatch_base {
|
|
90
|
+
}
|
|
91
|
+
declare const EnvelopeMismatch_base: Schema.Class<EnvelopeMismatch, Schema.TaggedStruct<"/control/EnvelopeMismatch", {
|
|
92
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"envelope_mismatch">>;
|
|
93
|
+
readonly planId: Schema.String;
|
|
94
|
+
readonly expected: Schema.String;
|
|
95
|
+
readonly actual: Schema.String;
|
|
96
|
+
}>, import("effect/Cause").YieldableError>;
|
|
97
|
+
/**
|
|
98
|
+
* The plan's effect envelope differs from the one the caller declared.
|
|
99
|
+
*
|
|
100
|
+
* @category errors
|
|
101
|
+
* @since 0.1.0
|
|
102
|
+
*/
|
|
103
|
+
export declare class EnvelopeMismatch extends EnvelopeMismatch_base {
|
|
104
|
+
}
|
|
105
|
+
declare const ClaimLost_base: Schema.Class<ClaimLost, Schema.TaggedStruct<"/control/ClaimLost", {
|
|
106
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"claim_lost">>;
|
|
107
|
+
readonly runId: Schema.String;
|
|
108
|
+
readonly reason: Schema.optional<Schema.String>;
|
|
109
|
+
readonly parkedBy: Schema.optional<Schema.Struct<{
|
|
110
|
+
readonly hostId: Schema.String;
|
|
111
|
+
readonly pid: Schema.Number;
|
|
112
|
+
}>>;
|
|
113
|
+
}>, import("effect/Cause").YieldableError>;
|
|
114
|
+
/**
|
|
115
|
+
* The caller's claim on this run lapsed or was fenced by a newer owner.
|
|
116
|
+
*
|
|
117
|
+
* `parkedBy` names the live process that parked the run: it, not the caller,
|
|
118
|
+
* drives the run, so `Control.resume` hands the resume to it.
|
|
119
|
+
*
|
|
120
|
+
* @category errors
|
|
121
|
+
* @since 0.1.0
|
|
122
|
+
*/
|
|
123
|
+
export declare class ClaimLost extends ClaimLost_base {
|
|
124
|
+
}
|
|
125
|
+
declare const CodeDrift_base: Schema.Class<CodeDrift, Schema.TaggedStruct<"/control/CodeDrift", {
|
|
126
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"code_drift">>;
|
|
127
|
+
readonly runId: Schema.String;
|
|
128
|
+
readonly flowId: Schema.String;
|
|
129
|
+
/** The execution digest the run started with; absent when only the engine changed. */
|
|
130
|
+
readonly recorded: Schema.optional<Schema.String>;
|
|
131
|
+
/** The flow's execution digest now; absent when the flow is gone or declares none. */
|
|
132
|
+
readonly current: Schema.optional<Schema.String>;
|
|
133
|
+
/** The engine version the run started on, when the engine changed. */
|
|
134
|
+
readonly recordedEngine: Schema.optional<Schema.String>;
|
|
135
|
+
/** The engine version resuming it, when the engine changed. */
|
|
136
|
+
readonly currentEngine: Schema.optional<Schema.String>;
|
|
137
|
+
}>, import("effect/Cause").YieldableError>;
|
|
138
|
+
/**
|
|
139
|
+
* The run's flow or engine changed since the run started, so resuming it would
|
|
140
|
+
* run code the run did not start with. Pass `allowCodeDrift` to resume it
|
|
141
|
+
* anyway; the run then records the code it resumed on.
|
|
142
|
+
*
|
|
143
|
+
* @category errors
|
|
144
|
+
* @since 1.0.0
|
|
145
|
+
*/
|
|
146
|
+
export declare class CodeDrift extends CodeDrift_base {
|
|
147
|
+
get message(): string;
|
|
148
|
+
}
|
|
149
|
+
declare const AlreadyResolved_base: Schema.Class<AlreadyResolved, Schema.TaggedStruct<"/control/AlreadyResolved", {
|
|
150
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"already_resolved">>;
|
|
151
|
+
readonly requestId: Schema.String;
|
|
152
|
+
}>, import("effect/Cause").YieldableError>;
|
|
153
|
+
/**
|
|
154
|
+
* This request was already answered; a second answer is refused rather
|
|
155
|
+
* than overwriting the first.
|
|
156
|
+
*
|
|
157
|
+
* @category errors
|
|
158
|
+
* @since 0.1.0
|
|
159
|
+
*/
|
|
160
|
+
export declare class AlreadyResolved extends AlreadyResolved_base {
|
|
161
|
+
}
|
|
162
|
+
declare const InvalidInput_base: Schema.Class<InvalidInput, Schema.TaggedStruct<"/control/InvalidInput", {
|
|
163
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"invalid_input">>;
|
|
164
|
+
readonly issue: Schema.String;
|
|
165
|
+
}>, import("effect/Cause").YieldableError>;
|
|
166
|
+
/**
|
|
167
|
+
* The request did not satisfy its schema or a stated precondition.
|
|
168
|
+
*
|
|
169
|
+
* @category errors
|
|
170
|
+
* @since 0.1.0
|
|
171
|
+
*/
|
|
172
|
+
export declare class InvalidInput extends InvalidInput_base {
|
|
173
|
+
}
|
|
174
|
+
declare const Unauthorized_base: Schema.Class<Unauthorized, Schema.TaggedStruct<"/control/Unauthorized", {
|
|
175
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"unauthorized">>;
|
|
176
|
+
readonly message: Schema.String;
|
|
177
|
+
}>, import("effect/Cause").YieldableError>;
|
|
178
|
+
/**
|
|
179
|
+
* The caller lacks a usable credential or authority for this operation.
|
|
180
|
+
*
|
|
181
|
+
* @category errors
|
|
182
|
+
* @since 0.1.0
|
|
183
|
+
*/
|
|
184
|
+
export declare class Unauthorized extends Unauthorized_base {
|
|
185
|
+
}
|
|
186
|
+
declare const Unavailable_base: Schema.Class<Unavailable, Schema.TaggedStruct<"/control/Unavailable", {
|
|
187
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"unavailable">>;
|
|
188
|
+
readonly feature: Schema.String;
|
|
189
|
+
readonly ticket: Schema.String;
|
|
190
|
+
}>, import("effect/Cause").YieldableError>;
|
|
191
|
+
/**
|
|
192
|
+
* The operation is not implemented in this deployment. `ticket` names the
|
|
193
|
+
* issue that tracks it, per `Concepts/Tickets Not Exceptions.md`.
|
|
194
|
+
*
|
|
195
|
+
* @category errors
|
|
196
|
+
* @since 0.1.0
|
|
197
|
+
*/
|
|
198
|
+
export declare class Unavailable extends Unavailable_base {
|
|
199
|
+
}
|
|
200
|
+
declare const TransportError_base: Schema.Class<TransportError, Schema.TaggedStruct<"/control/TransportError", {
|
|
201
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"transport_error">>;
|
|
202
|
+
readonly message: Schema.String;
|
|
203
|
+
readonly retryable: Schema.Boolean;
|
|
204
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
205
|
+
}>, import("effect/Cause").YieldableError>;
|
|
206
|
+
/**
|
|
207
|
+
* The request failed before a declared control response reached the caller.
|
|
208
|
+
*
|
|
209
|
+
* `retryable` classifies only the transport phase. Connection failures and
|
|
210
|
+
* HTTP 5xx responses are retryable; local encode failures, response decode
|
|
211
|
+
* failures, and HTTP 4xx responses are not. A caller may resend a retryable
|
|
212
|
+
* mutation only when its idempotency key makes replay safe. A keyless request
|
|
213
|
+
* can have reached the server even when its response was lost.
|
|
214
|
+
*
|
|
215
|
+
* `message` is a fixed operator-facing sentence. `cause` retains the original
|
|
216
|
+
* client failure for diagnostics without copying its raw text into output.
|
|
217
|
+
*
|
|
218
|
+
* @category errors
|
|
219
|
+
* @since 0.1.0
|
|
220
|
+
*/
|
|
221
|
+
export declare class TransportError extends TransportError_base {
|
|
222
|
+
}
|
|
223
|
+
declare const PersistenceError_base: Schema.Class<PersistenceError, Schema.TaggedStruct<"/control/PersistenceError", {
|
|
224
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"persistence_failed">>;
|
|
225
|
+
readonly operation: Schema.String;
|
|
226
|
+
readonly message: Schema.String;
|
|
227
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
228
|
+
}>, import("effect/Cause").YieldableError>;
|
|
229
|
+
/**
|
|
230
|
+
* A control-plane store operation failed.
|
|
231
|
+
*
|
|
232
|
+
* @category errors
|
|
233
|
+
* @since 0.1.0
|
|
234
|
+
*/
|
|
235
|
+
export declare class PersistenceError extends PersistenceError_base {
|
|
236
|
+
}
|
|
237
|
+
declare const LaunchFailed_base: Schema.Class<LaunchFailed, Schema.TaggedStruct<"/control/LaunchFailed", {
|
|
238
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"launch_failed">>;
|
|
239
|
+
readonly runId: Schema.String;
|
|
240
|
+
readonly message: Schema.String;
|
|
241
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
242
|
+
}>, import("effect/Cause").YieldableError>;
|
|
243
|
+
/**
|
|
244
|
+
* The executor refused or could not start the run.
|
|
245
|
+
*
|
|
246
|
+
* @category errors
|
|
247
|
+
* @since 0.1.0
|
|
248
|
+
*/
|
|
249
|
+
export declare class LaunchFailed extends LaunchFailed_base {
|
|
250
|
+
}
|
|
251
|
+
declare const NoMatchingWait_base: Schema.Class<NoMatchingWait, Schema.TaggedStruct<"/control/NoMatchingWait", {
|
|
252
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"no_matching_wait">>;
|
|
253
|
+
readonly runId: Schema.String;
|
|
254
|
+
readonly waitName: Schema.String;
|
|
255
|
+
}>, import("effect/Cause").YieldableError>;
|
|
256
|
+
/**
|
|
257
|
+
* A signal named a wait point the run does not have open.
|
|
258
|
+
*
|
|
259
|
+
* `Control.signal` completes the `WaitFor` deferred a run is parked on. A
|
|
260
|
+
* signal whose name matches no open wait point completes nothing, and recording
|
|
261
|
+
* it anyway would leave an operator watching a delivery that never lands, so it
|
|
262
|
+
* is refused where it arrives.
|
|
263
|
+
*
|
|
264
|
+
* The signal's name is `waitName`, not `name`. A field spelled `name` on an
|
|
265
|
+
* `Error` subclass shadows `Error.prototype.name`, which every renderer in the
|
|
266
|
+
* tree reads: `smithers signal run-3 '{"name":"go"}'` against a timer-parked
|
|
267
|
+
* run printed `go: ` to stderr and exited 1, because `bin.ts` reports
|
|
268
|
+
* `${error.name}: ${error.message}` and this class had overwritten one and
|
|
269
|
+
* defined neither (release validation, defect D3).
|
|
270
|
+
*
|
|
271
|
+
* @category errors
|
|
272
|
+
* @since 0.1.0
|
|
273
|
+
*/
|
|
274
|
+
export declare class NoMatchingWait extends NoMatchingWait_base {
|
|
275
|
+
/**
|
|
276
|
+
* The sentence an operator reads. Every other renderer in the tree prints
|
|
277
|
+
* `message`, so a refusal with none is a refusal with no reason.
|
|
278
|
+
*/
|
|
279
|
+
get message(): string;
|
|
280
|
+
}
|
|
281
|
+
declare const CredentialConflict_base: Schema.Class<CredentialConflict, Schema.TaggedStruct<"/control/CredentialConflict", {
|
|
282
|
+
readonly code: Schema.withConstructorDefault<Schema.Literal<"credential_conflict">>;
|
|
283
|
+
readonly id: Schema.String;
|
|
284
|
+
readonly expectedVersion: Schema.Number;
|
|
285
|
+
readonly actualVersion: Schema.Number;
|
|
286
|
+
}>, import("effect/Cause").YieldableError>;
|
|
287
|
+
/**
|
|
288
|
+
* A credential write lost a race: the record moved on before this writer
|
|
289
|
+
* committed, so the update is refused rather than silently overwriting the
|
|
290
|
+
* winner.
|
|
291
|
+
*
|
|
292
|
+
* @since 0.1.0
|
|
293
|
+
* @category errors
|
|
294
|
+
*/
|
|
295
|
+
export declare class CredentialConflict extends CredentialConflict_base {
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Every stable failure emitted by the control plane, as one schema.
|
|
299
|
+
*
|
|
300
|
+
* This is the single membership list. The exported union type is derived from
|
|
301
|
+
* it and `ControlClient.isControlError` is `Schema.is` of it, so an error class
|
|
302
|
+
* added here reaches both. Two hand-maintained lists drifted: `ControlError`
|
|
303
|
+
* omitted `CredentialConflict` while the README documented it as a member, and
|
|
304
|
+
* `isControlError` repeated the same thirteen names a second time.
|
|
305
|
+
*
|
|
306
|
+
* @since 0.1.0
|
|
307
|
+
* @category errors
|
|
308
|
+
*/
|
|
309
|
+
export declare const ControlErrorSchema: Schema.Union<readonly [typeof RunNotFound, typeof PlanNotFound, typeof PlanDenied, typeof FlowNotFound, typeof PlanDigestMismatch, typeof EnvelopeMismatch, typeof ClaimLost, typeof CodeDrift, typeof AlreadyResolved, typeof InvalidInput, typeof Unauthorized, typeof Unavailable, typeof TransportError, typeof PersistenceError, typeof LaunchFailed, typeof NoMatchingWait, typeof CredentialConflict, typeof NotificationError]>;
|
|
310
|
+
/**
|
|
311
|
+
* Every stable failure emitted by the control plane.
|
|
312
|
+
*
|
|
313
|
+
* @since 0.1.0
|
|
314
|
+
* @category errors
|
|
315
|
+
*/
|
|
316
|
+
export type ControlError = typeof ControlErrorSchema.Type;
|
|
317
|
+
export {};
|
|
318
|
+
//# sourceMappingURL=ControlError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ControlError.d.ts","sourceRoot":"","sources":["../../src/ControlError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;;;;;AAMvC;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,gBAG/B;IACA;;;OAGG;IACH,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,iBAGhC;IACA;;;OAGG;IACH,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;;AAED;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,eAG9B;IACA;;;OA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A;AAEF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ControlError_exports = {};
|
|
30
|
+
__export(ControlError_exports, {
|
|
31
|
+
AlreadyResolved: () => AlreadyResolved,
|
|
32
|
+
ClaimLost: () => ClaimLost,
|
|
33
|
+
CodeDrift: () => CodeDrift,
|
|
34
|
+
ControlErrorSchema: () => ControlErrorSchema,
|
|
35
|
+
CredentialConflict: () => CredentialConflict,
|
|
36
|
+
EnvelopeMismatch: () => EnvelopeMismatch,
|
|
37
|
+
FlowNotFound: () => FlowNotFound,
|
|
38
|
+
InvalidInput: () => InvalidInput,
|
|
39
|
+
LaunchFailed: () => LaunchFailed,
|
|
40
|
+
NoMatchingWait: () => NoMatchingWait,
|
|
41
|
+
PersistenceError: () => PersistenceError,
|
|
42
|
+
PlanDenied: () => PlanDenied,
|
|
43
|
+
PlanDigestMismatch: () => PlanDigestMismatch,
|
|
44
|
+
PlanNotFound: () => PlanNotFound,
|
|
45
|
+
RunNotFound: () => RunNotFound,
|
|
46
|
+
TransportError: () => TransportError,
|
|
47
|
+
Unauthorized: () => Unauthorized,
|
|
48
|
+
Unavailable: () => Unavailable
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(ControlError_exports);
|
|
51
|
+
var Fault = __toESM(require("@smthrs/flow/Fault"), 1);
|
|
52
|
+
var import_NotificationQueue = require("@smthrs/notifications/NotificationQueue");
|
|
53
|
+
var import_effect = require("effect");
|
|
54
|
+
var import_ControlSchema = require("./ControlSchema.js");
|
|
55
|
+
const constantCode = (code) => import_effect.Schema.Literal(code).pipe(import_effect.Schema.withConstructorDefault(import_effect.Effect.succeed(code)));
|
|
56
|
+
class RunNotFound extends import_effect.Schema.TaggedError()("/control/RunNotFound", {
|
|
57
|
+
code: constantCode("run_not_found"),
|
|
58
|
+
runId: import_ControlSchema.RunId
|
|
59
|
+
}) {
|
|
60
|
+
/**
|
|
61
|
+
* The sentence an operator reads. Without one the CLI printed the bare
|
|
62
|
+
* fields, `run_not_found runId=nope`, which names no next action.
|
|
63
|
+
*/
|
|
64
|
+
get message() {
|
|
65
|
+
return `Run ${this.runId} was not found. Run \`smthrs runs list\` to see the runs you can read.`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
class PlanNotFound extends import_effect.Schema.TaggedError()("/control/PlanNotFound", {
|
|
69
|
+
code: constantCode("plan_not_found"),
|
|
70
|
+
planId: import_effect.Schema.String
|
|
71
|
+
}) {
|
|
72
|
+
/**
|
|
73
|
+
* The sentence an operator reads. Every renderer in the tree prints
|
|
74
|
+
* `message`, so a refusal without one does not explain the next action.
|
|
75
|
+
*/
|
|
76
|
+
get message() {
|
|
77
|
+
return `Plan ${this.planId} was not found. Create the plan again before approving or launching it.`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
class PlanDenied extends import_effect.Schema.TaggedError()("/control/PlanDenied", {
|
|
81
|
+
code: constantCode("plan_denied"),
|
|
82
|
+
planId: import_effect.Schema.String
|
|
83
|
+
}) {
|
|
84
|
+
/**
|
|
85
|
+
* The sentence an operator reads. Every renderer in the tree prints
|
|
86
|
+
* `message`, so a denial must state how to make a later launch possible.
|
|
87
|
+
*/
|
|
88
|
+
get message() {
|
|
89
|
+
return `Plan ${this.planId} was denied and cannot be launched. Create and approve a new plan before running it.`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class FlowNotFound extends import_effect.Schema.TaggedError()("/control/FlowNotFound", {
|
|
93
|
+
code: constantCode("flow_not_found"),
|
|
94
|
+
flowId: import_ControlSchema.FlowId
|
|
95
|
+
}) {
|
|
96
|
+
/**
|
|
97
|
+
* The sentence an operator reads, which names the command that lists the
|
|
98
|
+
* flows a caller can start.
|
|
99
|
+
*/
|
|
100
|
+
get message() {
|
|
101
|
+
return `Flow ${this.flowId} is not registered. Run \`smthrs flow list\` to see the flows you can start.`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
class PlanDigestMismatch extends import_effect.Schema.TaggedError()("/control/PlanDigestMismatch", {
|
|
105
|
+
code: constantCode("plan_digest_mismatch"),
|
|
106
|
+
planId: import_effect.Schema.String,
|
|
107
|
+
expected: import_effect.Schema.String,
|
|
108
|
+
actual: import_effect.Schema.String
|
|
109
|
+
}) {
|
|
110
|
+
}
|
|
111
|
+
class EnvelopeMismatch extends import_effect.Schema.TaggedError()("/control/EnvelopeMismatch", {
|
|
112
|
+
code: constantCode("envelope_mismatch"),
|
|
113
|
+
planId: import_effect.Schema.String,
|
|
114
|
+
expected: import_effect.Schema.String,
|
|
115
|
+
actual: import_effect.Schema.String
|
|
116
|
+
}) {
|
|
117
|
+
}
|
|
118
|
+
class ClaimLost extends import_effect.Schema.TaggedError()("/control/ClaimLost", {
|
|
119
|
+
code: constantCode("claim_lost"),
|
|
120
|
+
runId: import_ControlSchema.RunId,
|
|
121
|
+
reason: import_effect.Schema.optional(import_effect.Schema.String),
|
|
122
|
+
parkedBy: import_effect.Schema.optional(import_ControlSchema.RunHost)
|
|
123
|
+
}) {
|
|
124
|
+
}
|
|
125
|
+
class CodeDrift extends import_effect.Schema.TaggedError()("/control/CodeDrift", {
|
|
126
|
+
code: constantCode("code_drift"),
|
|
127
|
+
runId: import_ControlSchema.RunId,
|
|
128
|
+
flowId: import_ControlSchema.FlowId,
|
|
129
|
+
/** The execution digest the run started with; absent when only the engine changed. */
|
|
130
|
+
recorded: import_effect.Schema.optional(import_effect.Schema.String),
|
|
131
|
+
/** The flow's execution digest now; absent when the flow is gone or declares none. */
|
|
132
|
+
current: import_effect.Schema.optional(import_effect.Schema.String),
|
|
133
|
+
/** The engine version the run started on, when the engine changed. */
|
|
134
|
+
recordedEngine: import_effect.Schema.optional(import_effect.Schema.String),
|
|
135
|
+
/** The engine version resuming it, when the engine changed. */
|
|
136
|
+
currentEngine: import_effect.Schema.optional(import_effect.Schema.String)
|
|
137
|
+
}) {
|
|
138
|
+
get message() {
|
|
139
|
+
const changes = [
|
|
140
|
+
...this.recorded === void 0 ? [] : [`${this.flowId} ${this.recorded}, which is now ${this.current ?? "gone"}`],
|
|
141
|
+
...this.recordedEngine === void 0 ? [] : [`engine ${this.recordedEngine}, which is now ${this.currentEngine ?? "unknown"}`]
|
|
142
|
+
];
|
|
143
|
+
const next = this.recorded !== void 0 && this.current === void 0 ? "Restore the flow to resume it." : "Resume with --allow-code-drift to run the changed code.";
|
|
144
|
+
return `Run ${this.runId} started on ${changes.join(" and ")}. ${next}`;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
class AlreadyResolved extends import_effect.Schema.TaggedError()("/control/AlreadyResolved", {
|
|
148
|
+
code: constantCode("already_resolved"),
|
|
149
|
+
requestId: import_effect.Schema.String
|
|
150
|
+
}) {
|
|
151
|
+
}
|
|
152
|
+
class InvalidInput extends import_effect.Schema.TaggedError()("/control/InvalidInput", {
|
|
153
|
+
code: constantCode("invalid_input"),
|
|
154
|
+
issue: import_effect.Schema.String
|
|
155
|
+
}) {
|
|
156
|
+
}
|
|
157
|
+
class Unauthorized extends import_effect.Schema.TaggedError()("/control/Unauthorized", {
|
|
158
|
+
code: constantCode("unauthorized"),
|
|
159
|
+
message: import_effect.Schema.String
|
|
160
|
+
}) {
|
|
161
|
+
}
|
|
162
|
+
class Unavailable extends import_effect.Schema.TaggedError()("/control/Unavailable", {
|
|
163
|
+
code: constantCode("unavailable"),
|
|
164
|
+
feature: import_effect.Schema.String,
|
|
165
|
+
ticket: import_effect.Schema.String
|
|
166
|
+
}) {
|
|
167
|
+
}
|
|
168
|
+
class TransportError extends import_effect.Schema.TaggedError()("/control/TransportError", {
|
|
169
|
+
code: constantCode("transport_error"),
|
|
170
|
+
message: import_effect.Schema.String,
|
|
171
|
+
retryable: import_effect.Schema.Boolean,
|
|
172
|
+
cause: import_effect.Schema.optional(import_effect.Schema.Defect())
|
|
173
|
+
}) {
|
|
174
|
+
}
|
|
175
|
+
class PersistenceError extends import_effect.Schema.TaggedError()("/control/PersistenceError", {
|
|
176
|
+
code: constantCode("persistence_failed"),
|
|
177
|
+
operation: import_effect.Schema.String,
|
|
178
|
+
message: import_effect.Schema.String,
|
|
179
|
+
cause: import_effect.Schema.optional(import_effect.Schema.Defect())
|
|
180
|
+
}) {
|
|
181
|
+
}
|
|
182
|
+
class LaunchFailed extends import_effect.Schema.TaggedError()("/control/LaunchFailed", {
|
|
183
|
+
code: constantCode("launch_failed"),
|
|
184
|
+
runId: import_ControlSchema.RunId,
|
|
185
|
+
message: import_effect.Schema.String,
|
|
186
|
+
cause: import_effect.Schema.optional(import_effect.Schema.Defect())
|
|
187
|
+
}) {
|
|
188
|
+
}
|
|
189
|
+
class NoMatchingWait extends import_effect.Schema.TaggedError()("/control/NoMatchingWait", {
|
|
190
|
+
code: constantCode("no_matching_wait"),
|
|
191
|
+
runId: import_ControlSchema.RunId,
|
|
192
|
+
waitName: import_effect.Schema.String
|
|
193
|
+
}) {
|
|
194
|
+
/**
|
|
195
|
+
* The sentence an operator reads. Every other renderer in the tree prints
|
|
196
|
+
* `message`, so a refusal with none is a refusal with no reason.
|
|
197
|
+
*/
|
|
198
|
+
get message() {
|
|
199
|
+
return `no wait point named "${this.waitName}" is open on run ${this.runId}. Read \`smthrs runs show ${this.runId}\` to see what that run is waiting for.`;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
class CredentialConflict extends import_effect.Schema.TaggedError()("/control/CredentialConflict", {
|
|
203
|
+
code: constantCode("credential_conflict"),
|
|
204
|
+
id: import_effect.Schema.String,
|
|
205
|
+
expectedVersion: import_effect.Schema.Number,
|
|
206
|
+
actualVersion: import_effect.Schema.Number
|
|
207
|
+
}) {
|
|
208
|
+
}
|
|
209
|
+
const ControlErrorSchema = import_effect.Schema.Union([
|
|
210
|
+
RunNotFound,
|
|
211
|
+
PlanNotFound,
|
|
212
|
+
PlanDenied,
|
|
213
|
+
FlowNotFound,
|
|
214
|
+
PlanDigestMismatch,
|
|
215
|
+
EnvelopeMismatch,
|
|
216
|
+
ClaimLost,
|
|
217
|
+
CodeDrift,
|
|
218
|
+
AlreadyResolved,
|
|
219
|
+
InvalidInput,
|
|
220
|
+
Unauthorized,
|
|
221
|
+
Unavailable,
|
|
222
|
+
TransportError,
|
|
223
|
+
PersistenceError,
|
|
224
|
+
LaunchFailed,
|
|
225
|
+
NoMatchingWait,
|
|
226
|
+
CredentialConflict,
|
|
227
|
+
import_NotificationQueue.NotificationError
|
|
228
|
+
]);
|
|
229
|
+
for (const [tag, kind] of [
|
|
230
|
+
["RunNotFound", "user"],
|
|
231
|
+
["PlanNotFound", "user"],
|
|
232
|
+
["PlanDenied", "user"],
|
|
233
|
+
["FlowNotFound", "user"],
|
|
234
|
+
["PlanDigestMismatch", "user"],
|
|
235
|
+
["EnvelopeMismatch", "user"],
|
|
236
|
+
["AlreadyResolved", "user"],
|
|
237
|
+
["InvalidInput", "user"],
|
|
238
|
+
["Unauthorized", "user"],
|
|
239
|
+
["NoMatchingWait", "user"],
|
|
240
|
+
["CredentialConflict", "user"],
|
|
241
|
+
// A flow without a model or an approved executable identity: the person's to fix.
|
|
242
|
+
["LaunchFailed", "user"],
|
|
243
|
+
["ClaimLost", "infra"],
|
|
244
|
+
["CodeDrift", "infra"],
|
|
245
|
+
["Unavailable", "infra"],
|
|
246
|
+
["TransportError", "infra"],
|
|
247
|
+
["PersistenceError", "infra"]
|
|
248
|
+
]) Fault.register(`/control/${tag}`, kind);
|
|
249
|
+
//# sourceMappingURL=ControlError.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ControlError.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Stable, schema-backed control-plane failures.\n *\n * @since 0.1.0\n */\n\nimport * as Fault from \"@smthrs/flow/Fault\"\nimport { NotificationError } from \"@smthrs/notifications/NotificationQueue\"\nimport { Effect, Schema } from \"effect\"\nimport { FlowId, RunHost, RunId } from \"./ControlSchema.ts\"\n\nconst constantCode = <const Code extends string>(code: Code) =>\n Schema.Literal(code).pipe(Schema.withConstructorDefault(Effect.succeed(code)))\n\n/**\n * No run with this id exists.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class RunNotFound extends Schema.TaggedError<RunNotFound>()(\"/control/RunNotFound\", {\n code: constantCode(\"run_not_found\"),\n runId: RunId\n}) {\n /**\n * The sentence an operator reads. Without one the CLI printed the bare\n * fields, `run_not_found runId=nope`, which names no next action.\n */\n override get message(): string {\n return `Run ${this.runId} was not found. Run \\`smthrs runs list\\` to see the runs you can read.`\n }\n}\n\n/**\n * No plan with this id exists.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class PlanNotFound extends Schema.TaggedError<PlanNotFound>()(\"/control/PlanNotFound\", {\n code: constantCode(\"plan_not_found\"),\n planId: Schema.String\n}) {\n /**\n * The sentence an operator reads. Every renderer in the tree prints\n * `message`, so a refusal without one does not explain the next action.\n */\n override get message(): string {\n return `Plan ${this.planId} was not found. Create the plan again before approving or launching it.`\n }\n}\n\n/**\n * The plan was denied and cannot be launched.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class PlanDenied extends Schema.TaggedError<PlanDenied>()(\"/control/PlanDenied\", {\n code: constantCode(\"plan_denied\"),\n planId: Schema.String\n}) {\n /**\n * The sentence an operator reads. Every renderer in the tree prints\n * `message`, so a denial must state how to make a later launch possible.\n */\n override get message(): string {\n return `Plan ${this.planId} was denied and cannot be launched. Create and approve a new plan before running it.`\n }\n}\n\n/**\n * No flow with this id is registered.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class FlowNotFound extends Schema.TaggedError<FlowNotFound>()(\"/control/FlowNotFound\", {\n code: constantCode(\"flow_not_found\"),\n flowId: FlowId\n}) {\n /**\n * The sentence an operator reads, which names the command that lists the\n * flows a caller can start.\n */\n override get message(): string {\n return `Flow ${this.flowId} is not registered. Run \\`smthrs flow list\\` to see the flows you can start.`\n }\n}\n\n/**\n * The submitted plan does not hash to the digest the caller declared, so\n * the control plane refuses to store it.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class PlanDigestMismatch extends Schema.TaggedError<PlanDigestMismatch>()(\"/control/PlanDigestMismatch\", {\n code: constantCode(\"plan_digest_mismatch\"),\n planId: Schema.String,\n expected: Schema.String,\n actual: Schema.String\n}) {}\n\n/**\n * The plan's effect envelope differs from the one the caller declared.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class EnvelopeMismatch extends Schema.TaggedError<EnvelopeMismatch>()(\"/control/EnvelopeMismatch\", {\n code: constantCode(\"envelope_mismatch\"),\n planId: Schema.String,\n expected: Schema.String,\n actual: Schema.String\n}) {}\n\n/**\n * The caller's claim on this run lapsed or was fenced by a newer owner.\n *\n * `parkedBy` names the live process that parked the run: it, not the caller,\n * drives the run, so `Control.resume` hands the resume to it.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class ClaimLost extends Schema.TaggedError<ClaimLost>()(\"/control/ClaimLost\", {\n code: constantCode(\"claim_lost\"),\n runId: RunId,\n reason: Schema.optional(Schema.String),\n parkedBy: Schema.optional(RunHost)\n}) {}\n\n/**\n * The run's flow or engine changed since the run started, so resuming it would\n * run code the run did not start with. Pass `allowCodeDrift` to resume it\n * anyway; the run then records the code it resumed on.\n *\n * @category errors\n * @since 1.0.0\n */\nexport class CodeDrift extends Schema.TaggedError<CodeDrift>()(\"/control/CodeDrift\", {\n code: constantCode(\"code_drift\"),\n runId: RunId,\n flowId: FlowId,\n /** The execution digest the run started with; absent when only the engine changed. */\n recorded: Schema.optional(Schema.String),\n /** The flow's execution digest now; absent when the flow is gone or declares none. */\n current: Schema.optional(Schema.String),\n /** The engine version the run started on, when the engine changed. */\n recordedEngine: Schema.optional(Schema.String),\n /** The engine version resuming it, when the engine changed. */\n currentEngine: Schema.optional(Schema.String)\n}) {\n override get message(): string {\n const changes = [\n ...(this.recorded === undefined\n ? []\n : [`${this.flowId} ${this.recorded}, which is now ${this.current ?? \"gone\"}`]),\n ...(this.recordedEngine === undefined\n ? []\n : [`engine ${this.recordedEngine}, which is now ${this.currentEngine ?? \"unknown\"}`])\n ]\n // A flow that is gone has no code to adopt, so the flag would not help.\n const next = this.recorded !== undefined && this.current === undefined\n ? \"Restore the flow to resume it.\"\n : \"Resume with --allow-code-drift to run the changed code.\"\n return `Run ${this.runId} started on ${changes.join(\" and \")}. ${next}`\n }\n}\n\n/**\n * This request was already answered; a second answer is refused rather\n * than overwriting the first.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class AlreadyResolved extends Schema.TaggedError<AlreadyResolved>()(\"/control/AlreadyResolved\", {\n code: constantCode(\"already_resolved\"),\n requestId: Schema.String\n}) {}\n\n/**\n * The request did not satisfy its schema or a stated precondition.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class InvalidInput extends Schema.TaggedError<InvalidInput>()(\"/control/InvalidInput\", {\n code: constantCode(\"invalid_input\"),\n issue: Schema.String\n}) {}\n\n/**\n * The caller lacks a usable credential or authority for this operation.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class Unauthorized extends Schema.TaggedError<Unauthorized>()(\"/control/Unauthorized\", {\n code: constantCode(\"unauthorized\"),\n message: Schema.String\n}) {}\n\n/**\n * The operation is not implemented in this deployment. `ticket` names the\n * issue that tracks it, per `Concepts/Tickets Not Exceptions.md`.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class Unavailable extends Schema.TaggedError<Unavailable>()(\"/control/Unavailable\", {\n code: constantCode(\"unavailable\"),\n feature: Schema.String,\n ticket: Schema.String\n}) {}\n\n/**\n * The request failed before a declared control response reached the caller.\n *\n * `retryable` classifies only the transport phase. Connection failures and\n * HTTP 5xx responses are retryable; local encode failures, response decode\n * failures, and HTTP 4xx responses are not. A caller may resend a retryable\n * mutation only when its idempotency key makes replay safe. A keyless request\n * can have reached the server even when its response was lost.\n *\n * `message` is a fixed operator-facing sentence. `cause` retains the original\n * client failure for diagnostics without copying its raw text into output.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class TransportError extends Schema.TaggedError<TransportError>()(\"/control/TransportError\", {\n code: constantCode(\"transport_error\"),\n message: Schema.String,\n retryable: Schema.Boolean,\n cause: Schema.optional(Schema.Defect())\n}) {}\n\n/**\n * A control-plane store operation failed.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class PersistenceError extends Schema.TaggedError<PersistenceError>()(\"/control/PersistenceError\", {\n code: constantCode(\"persistence_failed\"),\n operation: Schema.String,\n message: Schema.String,\n cause: Schema.optional(Schema.Defect())\n}) {}\n\n/**\n * The executor refused or could not start the run.\n *\n * @category errors\n * @since 0.1.0\n */\nexport class LaunchFailed extends Schema.TaggedError<LaunchFailed>()(\"/control/LaunchFailed\", {\n code: constantCode(\"launch_failed\"),\n runId: RunId,\n message: Schema.String,\n cause: Schema.optional(Schema.Defect())\n}) {}\n\n/**\n * A signal named a wait point the run does not have open.\n *\n * `Control.signal` completes the `WaitFor` deferred a run is parked on. A\n * signal whose name matches no open wait point completes nothing, and recording\n * it anyway would leave an operator watching a delivery that never lands, so it\n * is refused where it arrives.\n *\n * The signal's name is `waitName`, not `name`. A field spelled `name` on an\n * `Error` subclass shadows `Error.prototype.name`, which every renderer in the\n * tree reads: `smithers signal run-3 '{\"name\":\"go\"}'` against a timer-parked\n * run printed `go: ` to stderr and exited 1, because `bin.ts` reports\n * `${error.name}: ${error.message}` and this class had overwritten one and\n * defined neither (release validation, defect D3).\n *\n * @category errors\n * @since 0.1.0\n */\nexport class NoMatchingWait extends Schema.TaggedError<NoMatchingWait>()(\"/control/NoMatchingWait\", {\n code: constantCode(\"no_matching_wait\"),\n runId: RunId,\n waitName: Schema.String\n}) {\n /**\n * The sentence an operator reads. Every other renderer in the tree prints\n * `message`, so a refusal with none is a refusal with no reason.\n */\n override get message(): string {\n return `no wait point named \"${this.waitName}\" is open on run ${this.runId}. ` +\n `Read \\`smthrs runs show ${this.runId}\\` to see what that run is waiting for.`\n }\n}\n\n/**\n * A credential write lost a race: the record moved on before this writer\n * committed, so the update is refused rather than silently overwriting the\n * winner.\n *\n * @since 0.1.0\n * @category errors\n */\nexport class CredentialConflict extends Schema.TaggedError<CredentialConflict>()(\"/control/CredentialConflict\", {\n code: constantCode(\"credential_conflict\"),\n id: Schema.String,\n expectedVersion: Schema.Number,\n actualVersion: Schema.Number\n}) {}\n\n/**\n * Every stable failure emitted by the control plane, as one schema.\n *\n * This is the single membership list. The exported union type is derived from\n * it and `ControlClient.isControlError` is `Schema.is` of it, so an error class\n * added here reaches both. Two hand-maintained lists drifted: `ControlError`\n * omitted `CredentialConflict` while the README documented it as a member, and\n * `isControlError` repeated the same thirteen names a second time.\n *\n * @since 0.1.0\n * @category errors\n */\nexport const ControlErrorSchema = Schema.Union([\n RunNotFound,\n PlanNotFound,\n PlanDenied,\n FlowNotFound,\n PlanDigestMismatch,\n EnvelopeMismatch,\n ClaimLost,\n CodeDrift,\n AlreadyResolved,\n InvalidInput,\n Unauthorized,\n Unavailable,\n TransportError,\n PersistenceError,\n LaunchFailed,\n NoMatchingWait,\n CredentialConflict,\n NotificationError\n])\n\n/**\n * Every stable failure emitted by the control plane.\n *\n * @since 0.1.0\n * @category errors\n */\nexport type ControlError = typeof ControlErrorSchema.Type\n\n// Whose problem each control refusal is when it ends a run.\nfor (\n const [tag, kind] of [\n [\"RunNotFound\", \"user\"],\n [\"PlanNotFound\", \"user\"],\n [\"PlanDenied\", \"user\"],\n [\"FlowNotFound\", \"user\"],\n [\"PlanDigestMismatch\", \"user\"],\n [\"EnvelopeMismatch\", \"user\"],\n [\"AlreadyResolved\", \"user\"],\n [\"InvalidInput\", \"user\"],\n [\"Unauthorized\", \"user\"],\n [\"NoMatchingWait\", \"user\"],\n [\"CredentialConflict\", \"user\"],\n // A flow without a model or an approved executable identity: the person's to fix.\n [\"LaunchFailed\", \"user\"],\n [\"ClaimLost\", \"infra\"],\n [\"CodeDrift\", \"infra\"],\n [\"Unavailable\", \"infra\"],\n [\"TransportError\", \"infra\"],\n [\"PersistenceError\", \"infra\"]\n ] as const\n) Fault.register(`/control/${tag}`, kind)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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