@stigmer/server 3.40.1 → 3.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authorization/authorizer.d.ts +16 -10
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +17 -9
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts +7 -3
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +62 -6
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +11 -7
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js +16 -10
- package/dist/authorization/evaluator.js.map +1 -1
- package/dist/authorization/list-read-scope.d.ts +4 -0
- package/dist/authorization/list-read-scope.d.ts.map +1 -1
- package/dist/authorization/list-read-scope.js +1 -0
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/data/authorization-model.json +830 -67
- package/dist/authorization/model/execution-viewer.d.ts.map +1 -1
- package/dist/authorization/model/execution-viewer.js +26 -24
- package/dist/authorization/model/execution-viewer.js.map +1 -1
- package/dist/authorization/model/index.d.ts +4 -1
- package/dist/authorization/model/index.d.ts.map +1 -1
- package/dist/authorization/model/index.js +4 -1
- package/dist/authorization/model/index.js.map +1 -1
- package/dist/authorization/model/rewrite.d.ts +5 -3
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/organization-directory.d.ts +44 -0
- package/dist/authorization/organization-directory.d.ts.map +1 -1
- package/dist/authorization/organization-directory.js +1 -0
- package/dist/authorization/organization-directory.js.map +1 -1
- package/dist/authorization/person.d.ts +14 -1
- package/dist/authorization/person.d.ts.map +1 -1
- package/dist/authorization/person.js +16 -0
- package/dist/authorization/person.js.map +1 -1
- package/dist/authorization/policy-check.d.ts +52 -0
- package/dist/authorization/policy-check.d.ts.map +1 -0
- package/dist/authorization/policy-check.js +35 -0
- package/dist/authorization/policy-check.js.map +1 -0
- package/dist/authorization/posture.d.ts +30 -4
- package/dist/authorization/posture.d.ts.map +1 -1
- package/dist/authorization/posture.js +58 -0
- package/dist/authorization/posture.js.map +1 -1
- package/dist/authorization/resource-creators.d.ts +4 -0
- package/dist/authorization/resource-creators.d.ts.map +1 -0
- package/dist/authorization/resource-creators.js +44 -0
- package/dist/authorization/resource-creators.js.map +1 -0
- package/dist/authorization/trusted-local-authorizer.d.ts +9 -0
- package/dist/authorization/trusted-local-authorizer.d.ts.map +1 -0
- package/dist/authorization/trusted-local-authorizer.js +70 -0
- package/dist/authorization/trusted-local-authorizer.js.map +1 -0
- package/dist/authorization/tuples.d.ts +12 -0
- package/dist/authorization/tuples.d.ts.map +1 -1
- package/dist/authorization/tuples.js +3 -0
- package/dist/authorization/tuples.js.map +1 -1
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +132 -43
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/config.d.ts +22 -7
- package/dist/boot/config.d.ts.map +1 -1
- package/dist/boot/config.js +2 -1
- package/dist/boot/config.js.map +1 -1
- package/dist/boot/inprocess.d.ts.map +1 -1
- package/dist/boot/inprocess.js +10 -4
- package/dist/boot/inprocess.js.map +1 -1
- package/dist/boot/list-indexes.d.ts.map +1 -1
- package/dist/boot/list-indexes.js +6 -1
- package/dist/boot/list-indexes.js.map +1 -1
- package/dist/boot/logger.d.ts +3 -1
- package/dist/boot/logger.d.ts.map +1 -1
- package/dist/boot/logger.js +3 -1
- package/dist/boot/logger.js.map +1 -1
- package/dist/boot/oauth-redirect-uri.d.ts +33 -12
- package/dist/boot/oauth-redirect-uri.d.ts.map +1 -1
- package/dist/boot/oauth-redirect-uri.js +43 -14
- package/dist/boot/oauth-redirect-uri.js.map +1 -1
- package/dist/boot/skill-transfer-origin.d.ts +46 -14
- package/dist/boot/skill-transfer-origin.d.ts.map +1 -1
- package/dist/boot/skill-transfer-origin.js +53 -13
- package/dist/boot/skill-transfer-origin.js.map +1 -1
- package/dist/domain/agentchannel/steps.d.ts +8 -6
- package/dist/domain/agentchannel/steps.d.ts.map +1 -1
- package/dist/domain/agentchannel/steps.js +9 -7
- package/dist/domain/agentchannel/steps.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts +7 -0
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +1 -1
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentexecution/create-steps.d.ts +26 -12
- package/dist/domain/agentexecution/create-steps.d.ts.map +1 -1
- package/dist/domain/agentexecution/create-steps.js +61 -43
- package/dist/domain/agentexecution/create-steps.js.map +1 -1
- package/dist/domain/agentexecution/submit-approval.d.ts.map +1 -1
- package/dist/domain/agentexecution/submit-approval.js +9 -6
- package/dist/domain/agentexecution/submit-approval.js.map +1 -1
- package/dist/domain/agentexecution/submit-file-decision.d.ts.map +1 -1
- package/dist/domain/agentexecution/submit-file-decision.js +5 -4
- package/dist/domain/agentexecution/submit-file-decision.js.map +1 -1
- package/dist/domain/agentshare/steps.d.ts +5 -3
- package/dist/domain/agentshare/steps.d.ts.map +1 -1
- package/dist/domain/agentshare/steps.js +6 -4
- package/dist/domain/agentshare/steps.js.map +1 -1
- package/dist/domain/apikey/verifier.d.ts +7 -0
- package/dist/domain/apikey/verifier.d.ts.map +1 -1
- package/dist/domain/apikey/verifier.js +34 -1
- package/dist/domain/apikey/verifier.js.map +1 -1
- package/dist/domain/channelapp/controller.d.ts +4 -3
- package/dist/domain/channelapp/controller.d.ts.map +1 -1
- package/dist/domain/channelapp/controller.js.map +1 -1
- package/dist/domain/executioncontext/steps.d.ts +2 -1
- package/dist/domain/executioncontext/steps.d.ts.map +1 -1
- package/dist/domain/executioncontext/steps.js +2 -1
- package/dist/domain/executioncontext/steps.js.map +1 -1
- package/dist/domain/iampolicy/access-lists.d.ts.map +1 -1
- package/dist/domain/iampolicy/access-lists.js +57 -2
- package/dist/domain/iampolicy/access-lists.js.map +1 -1
- package/dist/domain/iampolicy/change.d.ts +53 -0
- package/dist/domain/iampolicy/change.d.ts.map +1 -0
- package/dist/domain/iampolicy/change.js +44 -0
- package/dist/domain/iampolicy/change.js.map +1 -0
- package/dist/domain/iampolicy/constants.d.ts +6 -0
- package/dist/domain/iampolicy/constants.d.ts.map +1 -1
- package/dist/domain/iampolicy/constants.js +6 -0
- package/dist/domain/iampolicy/constants.js.map +1 -1
- package/dist/domain/iampolicy/controller.d.ts.map +1 -1
- package/dist/domain/iampolicy/controller.js +9 -5
- package/dist/domain/iampolicy/controller.js.map +1 -1
- package/dist/domain/iampolicy/grant-path.d.ts +31 -13
- package/dist/domain/iampolicy/grant-path.d.ts.map +1 -1
- package/dist/domain/iampolicy/grant-path.js +216 -19
- package/dist/domain/iampolicy/grant-path.js.map +1 -1
- package/dist/domain/iampolicy/membership.d.ts +11 -3
- package/dist/domain/iampolicy/membership.d.ts.map +1 -1
- package/dist/domain/iampolicy/membership.js +18 -13
- package/dist/domain/iampolicy/membership.js.map +1 -1
- package/dist/domain/iampolicy/resource-store.d.ts.map +1 -1
- package/dist/domain/iampolicy/resource-store.js +4 -0
- package/dist/domain/iampolicy/resource-store.js.map +1 -1
- package/dist/domain/iampolicy/role-lifecycle.d.ts.map +1 -1
- package/dist/domain/iampolicy/role-lifecycle.js +2 -2
- package/dist/domain/iampolicy/role-lifecycle.js.map +1 -1
- package/dist/domain/iampolicy/roles.d.ts.map +1 -1
- package/dist/domain/iampolicy/roles.js +7 -0
- package/dist/domain/iampolicy/roles.js.map +1 -1
- package/dist/domain/iampolicy/steps.d.ts +4 -3
- package/dist/domain/iampolicy/steps.d.ts.map +1 -1
- package/dist/domain/iampolicy/steps.js +7 -7
- package/dist/domain/iampolicy/steps.js.map +1 -1
- package/dist/domain/iampolicy/store-contract.d.ts.map +1 -1
- package/dist/domain/iampolicy/store-contract.js +22 -1
- package/dist/domain/iampolicy/store-contract.js.map +1 -1
- package/dist/domain/iampolicy/store.d.ts +18 -5
- package/dist/domain/iampolicy/store.d.ts.map +1 -1
- package/dist/domain/iampolicy/store.js.map +1 -1
- package/dist/domain/identityaccount/constants.d.ts +15 -0
- package/dist/domain/identityaccount/constants.d.ts.map +1 -1
- package/dist/domain/identityaccount/constants.js +17 -0
- package/dist/domain/identityaccount/constants.js.map +1 -1
- package/dist/domain/identityaccount/controller.d.ts.map +1 -1
- package/dist/domain/identityaccount/controller.js +17 -6
- package/dist/domain/identityaccount/controller.js.map +1 -1
- package/dist/domain/identityaccount/resolve.d.ts +47 -0
- package/dist/domain/identityaccount/resolve.d.ts.map +1 -1
- package/dist/domain/identityaccount/resolve.js +38 -1
- package/dist/domain/identityaccount/resolve.js.map +1 -1
- package/dist/domain/identityaccount/resource-store.d.ts.map +1 -1
- package/dist/domain/identityaccount/resource-store.js +11 -1
- package/dist/domain/identityaccount/resource-store.js.map +1 -1
- package/dist/domain/identityaccount/steps.d.ts +2 -1
- package/dist/domain/identityaccount/steps.d.ts.map +1 -1
- package/dist/domain/identityaccount/steps.js +4 -3
- package/dist/domain/identityaccount/steps.js.map +1 -1
- package/dist/domain/identityaccount/store-contract.js +2 -2
- package/dist/domain/identityaccount/store-contract.js.map +1 -1
- package/dist/domain/identityaccount/store.d.ts +6 -1
- package/dist/domain/identityaccount/store.d.ts.map +1 -1
- package/dist/domain/mcpserver/connect-sandbox.d.ts +67 -0
- package/dist/domain/mcpserver/connect-sandbox.d.ts.map +1 -0
- package/dist/domain/mcpserver/connect-sandbox.js +64 -0
- package/dist/domain/mcpserver/connect-sandbox.js.map +1 -0
- package/dist/domain/mcpserver/connect.d.ts +42 -10
- package/dist/domain/mcpserver/connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/connect.js +147 -40
- package/dist/domain/mcpserver/connect.js.map +1 -1
- package/dist/domain/mcpserver/controller.js +4 -2
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/mcpserver/engine.d.ts +26 -7
- package/dist/domain/mcpserver/engine.d.ts.map +1 -1
- package/dist/domain/mcpserver/engine.js.map +1 -1
- package/dist/domain/mcpserver/start-connect.d.ts +5 -0
- package/dist/domain/mcpserver/start-connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/start-connect.js +38 -15
- package/dist/domain/mcpserver/start-connect.js.map +1 -1
- package/dist/domain/memory/controller.js +2 -1
- package/dist/domain/memory/controller.js.map +1 -1
- package/dist/domain/memory/list-index.d.ts +2 -0
- package/dist/domain/memory/list-index.d.ts.map +1 -0
- package/dist/domain/memory/list-index.js +31 -0
- package/dist/domain/memory/list-index.js.map +1 -0
- package/dist/domain/memory/queries.d.ts +10 -0
- package/dist/domain/memory/queries.d.ts.map +1 -0
- package/dist/domain/memory/queries.js +54 -0
- package/dist/domain/memory/queries.js.map +1 -0
- package/dist/domain/memory/steps.d.ts +13 -11
- package/dist/domain/memory/steps.d.ts.map +1 -1
- package/dist/domain/memory/steps.js +26 -57
- package/dist/domain/memory/steps.js.map +1 -1
- package/dist/domain/organization/steps.d.ts.map +1 -1
- package/dist/domain/organization/steps.js +1 -1
- package/dist/domain/organization/steps.js.map +1 -1
- package/dist/domain/platformclient/mint.d.ts.map +1 -1
- package/dist/domain/platformclient/mint.js +2 -2
- package/dist/domain/platformclient/mint.js.map +1 -1
- package/dist/domain/platformclient/verifier.d.ts.map +1 -1
- package/dist/domain/platformclient/verifier.js +6 -3
- package/dist/domain/platformclient/verifier.js.map +1 -1
- package/dist/domain/plugin/push.d.ts.map +1 -1
- package/dist/domain/plugin/push.js +1 -0
- package/dist/domain/plugin/push.js.map +1 -1
- package/dist/domain/schedule/steps.d.ts +3 -1
- package/dist/domain/schedule/steps.d.ts.map +1 -1
- package/dist/domain/schedule/steps.js +3 -1
- package/dist/domain/schedule/steps.js.map +1 -1
- package/dist/domain/skill/push.d.ts.map +1 -1
- package/dist/domain/skill/push.js +1 -0
- package/dist/domain/skill/push.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +27 -1
- package/dist/domain/workflowexecution/submit-approval.d.ts +5 -2
- package/dist/domain/workflowexecution/submit-approval.d.ts.map +1 -1
- package/dist/domain/workflowexecution/submit-approval.js +1 -1
- package/dist/domain/workflowexecution/submit-approval.js.map +1 -1
- package/dist/domain/workflowexecution/submit-file-decision.d.ts +5 -2
- package/dist/domain/workflowexecution/submit-file-decision.d.ts.map +1 -1
- package/dist/domain/workflowexecution/submit-file-decision.js +1 -1
- package/dist/domain/workflowexecution/submit-file-decision.js.map +1 -1
- package/dist/domain/workflowexecution/submit-workflow-task-approval.d.ts.map +1 -1
- package/dist/domain/workflowexecution/submit-workflow-task-approval.js +12 -1
- package/dist/domain/workflowexecution/submit-workflow-task-approval.js.map +1 -1
- package/dist/domain/workflowinstance/controller.d.ts +6 -3
- package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
- package/dist/domain/workflowinstance/controller.js +12 -7
- package/dist/domain/workflowinstance/controller.js.map +1 -1
- package/dist/domain/workflowinstance/steps.d.ts +31 -0
- package/dist/domain/workflowinstance/steps.d.ts.map +1 -1
- package/dist/domain/workflowinstance/steps.js +88 -1
- package/dist/domain/workflowinstance/steps.js.map +1 -1
- package/dist/extensions/composed-services.d.ts +56 -0
- package/dist/extensions/composed-services.d.ts.map +1 -0
- package/dist/extensions/composed-services.js +2 -0
- package/dist/extensions/composed-services.js.map +1 -0
- package/dist/extensions/drivers.d.ts +32 -1
- package/dist/extensions/drivers.d.ts.map +1 -1
- package/dist/extensions/identity.d.ts +4 -1
- package/dist/extensions/identity.d.ts.map +1 -1
- package/dist/extensions/identity.js +4 -1
- package/dist/extensions/identity.js.map +1 -1
- package/dist/extensions/registry.d.ts +37 -0
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/extensions/registry.js +50 -0
- package/dist/extensions/registry.js.map +1 -1
- package/dist/extensions/resource-authorization.d.ts +78 -0
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/extensions/resource-row-reader.d.ts +43 -0
- package/dist/extensions/resource-row-reader.d.ts.map +1 -0
- package/dist/extensions/resource-row-reader.js +2 -0
- package/dist/extensions/resource-row-reader.js.map +1 -0
- package/dist/extensions/visitor-classifier.d.ts +41 -0
- package/dist/extensions/visitor-classifier.d.ts.map +1 -0
- package/dist/extensions/visitor-classifier.js +2 -0
- package/dist/extensions/visitor-classifier.js.map +1 -0
- package/dist/identity/oidc-userinfo.d.ts +6 -1
- package/dist/identity/oidc-userinfo.d.ts.map +1 -1
- package/dist/identity/oidc-userinfo.js.map +1 -1
- package/dist/identity/oidc-verifier.d.ts.map +1 -1
- package/dist/identity/oidc-verifier.js +37 -8
- package/dist/identity/oidc-verifier.js.map +1 -1
- package/dist/index.d.ts +14 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -9
- package/dist/index.js.map +1 -1
- package/dist/pipeline/errors.d.ts +8 -0
- package/dist/pipeline/errors.d.ts.map +1 -1
- package/dist/pipeline/errors.js +25 -16
- package/dist/pipeline/errors.js.map +1 -1
- package/dist/pipeline/interceptors/auth.d.ts +17 -9
- package/dist/pipeline/interceptors/auth.d.ts.map +1 -1
- package/dist/pipeline/interceptors/auth.js +17 -9
- package/dist/pipeline/interceptors/auth.js.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts +23 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +42 -0
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- package/dist/pipeline/steps/authorize.d.ts +6 -5
- package/dist/pipeline/steps/authorize.d.ts.map +1 -1
- package/dist/pipeline/steps/authorize.js +6 -5
- package/dist/pipeline/steps/authorize.js.map +1 -1
- package/dist/pipeline/steps/defaults.d.ts +12 -0
- package/dist/pipeline/steps/defaults.d.ts.map +1 -1
- package/dist/pipeline/steps/defaults.js +42 -7
- package/dist/pipeline/steps/defaults.js.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.d.ts +13 -15
- package/dist/pipeline/steps/guard-memory-capture.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.js +2 -3
- package/dist/pipeline/steps/guard-memory-capture.js.map +1 -1
- package/dist/runnerauth/built-in-runner-credential-provider.d.ts +0 -2
- package/dist/runnerauth/built-in-runner-credential-provider.d.ts.map +1 -1
- package/dist/runnerauth/built-in-runner-credential-provider.js +8 -17
- package/dist/runnerauth/built-in-runner-credential-provider.js.map +1 -1
- package/dist/runnerauth/runner-credential-provider.d.ts +17 -7
- package/dist/runnerauth/runner-credential-provider.d.ts.map +1 -1
- package/dist/runnerauth/runner-credential-provider.js.map +1 -1
- package/dist/sandbox/docker.d.ts.map +1 -1
- package/dist/sandbox/docker.js +3 -0
- package/dist/sandbox/docker.js.map +1 -1
- package/dist/sandbox/kubernetes.d.ts.map +1 -1
- package/dist/sandbox/kubernetes.js +3 -0
- package/dist/sandbox/kubernetes.js.map +1 -1
- package/dist/sandbox/local-process.d.ts.map +1 -1
- package/dist/sandbox/local-process.js +4 -0
- package/dist/sandbox/local-process.js.map +1 -1
- package/dist/sandbox/provisioner.d.ts +18 -6
- package/dist/sandbox/provisioner.d.ts.map +1 -1
- package/dist/sandbox/provisioner.js.map +1 -1
- package/dist/temporal/manager.d.ts +5 -0
- package/dist/temporal/manager.d.ts.map +1 -1
- package/dist/temporal/manager.js +9 -0
- package/dist/temporal/manager.js.map +1 -1
- package/dist/temporal/mcpserver/engine-client.d.ts +2 -2
- package/dist/temporal/mcpserver/engine-client.d.ts.map +1 -1
- package/dist/temporal/mcpserver/engine-client.js +6 -4
- package/dist/temporal/mcpserver/engine-client.js.map +1 -1
- package/dist/temporal/mcpserver/names.d.ts +13 -2
- package/dist/temporal/mcpserver/names.d.ts.map +1 -1
- package/dist/temporal/mcpserver/names.js +15 -2
- package/dist/temporal/mcpserver/names.js.map +1 -1
- package/dist/temporal/sdk-logger.d.ts +74 -0
- package/dist/temporal/sdk-logger.d.ts.map +1 -0
- package/dist/temporal/sdk-logger.js +143 -0
- package/dist/temporal/sdk-logger.js.map +1 -0
- package/package.json +6 -6
- package/src/authorization/README.md +18 -6
- package/src/authorization/__tests__/authorizer.test.ts +5 -1
- package/src/authorization/__tests__/derived-tuples.test.ts +26 -0
- package/src/authorization/__tests__/evaluator.test.ts +4 -0
- package/src/authorization/__tests__/list-read-scope.test.ts +11 -5
- package/src/authorization/__tests__/store-tests.test.ts +3 -1
- package/src/authorization/__tests__/trusted-local-authorizer.test.ts +155 -0
- package/src/authorization/__tests__/unit-owned-kinds.test.ts +420 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +31 -2
- package/src/authorization/authorizer.ts +21 -10
- package/src/authorization/derived-tuples.ts +92 -18
- package/src/authorization/evaluator.ts +30 -15
- package/src/authorization/list-read-scope.ts +4 -0
- package/src/authorization/model/__tests__/registry.test.ts +23 -0
- package/src/authorization/model/data/authorization-model.json +830 -67
- package/src/authorization/model/execution-viewer.ts +32 -27
- package/src/authorization/model/index.ts +4 -1
- package/src/authorization/model/rewrite.ts +5 -3
- package/src/authorization/organization-directory.ts +4 -0
- package/src/authorization/person.ts +32 -1
- package/src/authorization/policy-check.ts +105 -0
- package/src/authorization/posture.ts +45 -4
- package/src/authorization/resource-creators.ts +48 -0
- package/src/authorization/trusted-local-authorizer.ts +91 -0
- package/src/authorization/tuples.ts +17 -0
- package/src/boot/__tests__/compose.test.ts +120 -4
- package/src/boot/__tests__/list-indexes.test.ts +4 -0
- package/src/boot/__tests__/oauth-redirect-uri.test.ts +121 -10
- package/src/boot/__tests__/skill-transfer-origin.test.ts +96 -25
- package/src/boot/compose.ts +153 -61
- package/src/boot/config.ts +28 -12
- package/src/boot/inprocess.ts +18 -4
- package/src/boot/list-indexes.ts +6 -1
- package/src/boot/logger.ts +3 -1
- package/src/boot/oauth-redirect-uri.ts +62 -17
- package/src/boot/skill-transfer-origin.ts +71 -16
- package/src/domain/agent/__tests__/agent.test.ts +42 -1
- package/src/domain/agentchannel/__tests__/agentchannel.test.ts +9 -0
- package/src/domain/agentchannel/__tests__/channel-runtime.test.ts +2 -0
- package/src/domain/agentchannel/__tests__/create-authorization.test.ts +7 -6
- package/src/domain/agentchannel/steps.ts +9 -7
- package/src/domain/agentexecution/__tests__/agentexecution.test.ts +148 -56
- package/src/domain/agentexecution/__tests__/create-steps.test.ts +175 -12
- package/src/domain/agentexecution/__tests__/file-review-seed.ts +91 -0
- package/src/domain/agentexecution/controller.ts +8 -0
- package/src/domain/agentexecution/create-steps.ts +74 -44
- package/src/domain/agentexecution/submit-approval.ts +9 -6
- package/src/domain/agentexecution/submit-file-decision.ts +5 -4
- package/src/domain/agentinstance/__tests__/agentinstance.test.ts +2 -0
- package/src/domain/agentshare/__tests__/agentshare.test.ts +17 -0
- package/src/domain/agentshare/__tests__/create-authorization.test.ts +5 -4
- package/src/domain/agentshare/steps.ts +6 -4
- package/src/domain/apikey/__tests__/verifier.test.ts +73 -1
- package/src/domain/apikey/verifier.ts +45 -1
- package/src/domain/artifact/__tests__/artifact.test.ts +13 -24
- package/src/domain/channelapp/__tests__/channelapp.test.ts +7 -0
- package/src/domain/channelapp/controller.ts +4 -3
- package/src/domain/environment/__tests__/environment.test.ts +13 -0
- package/src/domain/executioncontext/__tests__/executioncontext.test.ts +2 -0
- package/src/domain/executioncontext/steps.ts +2 -1
- package/src/domain/iampolicy/__tests__/access-lists.test.ts +79 -0
- package/src/domain/iampolicy/__tests__/change.test.ts +63 -0
- package/src/domain/iampolicy/__tests__/controller.test.ts +39 -3
- package/src/domain/iampolicy/__tests__/grant-path.test.ts +595 -27
- package/src/domain/iampolicy/__tests__/iampolicy.test.ts +33 -2
- package/src/domain/iampolicy/__tests__/membership.test.ts +47 -5
- package/src/domain/iampolicy/__tests__/resource-store.test.ts +1 -0
- package/src/domain/iampolicy/__tests__/role-lifecycle.test.ts +41 -8
- package/src/domain/iampolicy/__tests__/roles.test.ts +3 -2
- package/src/domain/iampolicy/__tests__/steps.test.ts +75 -6
- package/src/domain/iampolicy/__tests__/support.ts +68 -4
- package/src/domain/iampolicy/access-lists.ts +70 -2
- package/src/domain/iampolicy/change.ts +109 -0
- package/src/domain/iampolicy/constants.ts +8 -0
- package/src/domain/iampolicy/controller.ts +17 -3
- package/src/domain/iampolicy/grant-path.ts +349 -31
- package/src/domain/iampolicy/membership.ts +32 -12
- package/src/domain/iampolicy/resource-store.ts +4 -0
- package/src/domain/iampolicy/role-lifecycle.ts +2 -0
- package/src/domain/iampolicy/roles.ts +8 -0
- package/src/domain/iampolicy/steps.ts +15 -5
- package/src/domain/iampolicy/store-contract.ts +37 -1
- package/src/domain/iampolicy/store.ts +19 -5
- package/src/domain/identityaccount/__tests__/resolve.test.ts +246 -2
- package/src/domain/identityaccount/__tests__/resource-store.test.ts +1 -1
- package/src/domain/identityaccount/constants.ts +20 -0
- package/src/domain/identityaccount/controller.ts +20 -5
- package/src/domain/identityaccount/resolve.ts +80 -1
- package/src/domain/identityaccount/resource-store.ts +14 -1
- package/src/domain/identityaccount/steps.ts +4 -3
- package/src/domain/identityaccount/store-contract.ts +4 -4
- package/src/domain/identityaccount/store.ts +6 -1
- package/src/domain/mcpserver/__tests__/connect-authorization.test.ts +1 -0
- package/src/domain/mcpserver/__tests__/connect.test.ts +358 -15
- package/src/domain/mcpserver/__tests__/mcpserver.test.ts +2 -0
- package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +2 -0
- package/src/domain/mcpserver/__tests__/store-faults.test.ts +2 -0
- package/src/domain/mcpserver/connect-sandbox.ts +135 -0
- package/src/domain/mcpserver/connect.ts +226 -56
- package/src/domain/mcpserver/controller.ts +8 -2
- package/src/domain/mcpserver/engine.ts +24 -6
- package/src/domain/mcpserver/start-connect.ts +49 -10
- package/src/domain/memory/__tests__/memory.test.ts +92 -22
- package/src/domain/memory/__tests__/queries.test.ts +173 -0
- package/src/domain/memory/controller.ts +2 -1
- package/src/domain/memory/list-index.ts +32 -0
- package/src/domain/memory/queries.ts +72 -0
- package/src/domain/memory/steps.ts +26 -63
- package/src/domain/oauthapp/__tests__/oauthapp.test.ts +14 -0
- package/src/domain/organization/__tests__/support.ts +41 -0
- package/src/domain/organization/steps.ts +1 -0
- package/src/domain/platformclient/mint.ts +6 -2
- package/src/domain/platformclient/verifier.ts +6 -3
- package/src/domain/plugin/__tests__/plugin.test.ts +11 -24
- package/src/domain/plugin/push.ts +1 -0
- package/src/domain/schedule/__tests__/schedule.composed.test.ts +2 -0
- package/src/domain/schedule/steps.ts +3 -1
- package/src/domain/session/__tests__/session.test.ts +2 -0
- package/src/domain/skill/__tests__/skill.test.ts +7 -25
- package/src/domain/skill/push.ts +1 -0
- package/src/domain/workflow/__tests__/workflow.test.ts +2 -0
- package/src/domain/workflow/registry/data/task-kind-registry.json +27 -1
- package/src/domain/workflowexecution/__tests__/forward-attribution-composed.test.ts +270 -0
- package/src/domain/workflowexecution/__tests__/submit-workflow-task-approval.test.ts +196 -0
- package/src/domain/workflowexecution/__tests__/workflowexecution.test.ts +3 -57
- package/src/domain/workflowexecution/submit-approval.ts +9 -2
- package/src/domain/workflowexecution/submit-file-decision.ts +6 -1
- package/src/domain/workflowexecution/submit-workflow-task-approval.ts +23 -5
- package/src/domain/workflowinstance/controller.ts +27 -9
- package/src/domain/workflowinstance/steps.ts +123 -1
- package/src/extensions/__tests__/apikey-before-sign-in-composed.test.ts +172 -0
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +80 -1
- package/src/extensions/__tests__/composed-services-composed.test.ts +236 -0
- package/src/extensions/__tests__/extension-composition.test.ts +229 -16
- package/src/extensions/__tests__/identity-account-composed.test.ts +84 -4
- package/src/extensions/__tests__/list-read-scope-composed.test.ts +2 -0
- package/src/extensions/__tests__/registry.test.ts +147 -1
- package/src/extensions/__tests__/secret-cleanup-composed.test.ts +2 -0
- package/src/extensions/__tests__/visitor-classifier-points.test.ts +42 -0
- package/src/extensions/composed-services.ts +61 -0
- package/src/extensions/drivers.ts +33 -1
- package/src/extensions/identity.ts +4 -1
- package/src/extensions/registry.ts +105 -0
- package/src/extensions/resource-authorization.ts +87 -0
- package/src/extensions/resource-row-reader.ts +43 -0
- package/src/extensions/visitor-classifier.ts +41 -0
- package/src/identity/__tests__/oidc-verifier.test.ts +38 -12
- package/src/identity/oidc-userinfo.ts +6 -1
- package/src/identity/oidc-verifier.ts +42 -8
- package/src/index.ts +61 -6
- package/src/pipeline/__tests__/steps.test.ts +31 -4
- package/src/pipeline/errors.ts +30 -16
- package/src/pipeline/interceptors/auth.ts +17 -9
- package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +20 -0
- package/src/pipeline/steps/__tests__/guard-memory-capture.test.ts +72 -15
- package/src/pipeline/steps/authorization-tuples.ts +54 -0
- package/src/pipeline/steps/authorize.ts +6 -5
- package/src/pipeline/steps/defaults.ts +52 -7
- package/src/pipeline/steps/guard-memory-capture.ts +15 -20
- package/src/runnerauth/__tests__/built-in-runner-credential-provider.test.ts +1 -1
- package/src/runnerauth/__tests__/runner-subject-composed.test.ts +13 -0
- package/src/runnerauth/bound-execution.ts +2 -2
- package/src/runnerauth/built-in-runner-credential-provider.ts +8 -21
- package/src/runnerauth/runner-credential-provider.ts +17 -7
- package/src/sandbox/__tests__/docker.integration.test.ts +4 -0
- package/src/sandbox/__tests__/kubernetes.test.ts +18 -1
- package/src/sandbox/__tests__/local-process.integration.test.ts +4 -0
- package/src/sandbox/__tests__/provisioner.test.ts +1 -0
- package/src/sandbox/docker.ts +3 -0
- package/src/sandbox/kubernetes.ts +3 -0
- package/src/sandbox/local-process.ts +4 -0
- package/src/sandbox/provisioner.ts +18 -6
- package/src/store/postgres/__tests__/support.ts +11 -2
- package/src/temporal/README.md +1 -0
- package/src/temporal/__tests__/manager.test.ts +56 -4
- package/src/temporal/__tests__/sdk-log-workflows.ts +26 -0
- package/src/temporal/__tests__/sdk-logger.e2e.test.ts +150 -0
- package/src/temporal/__tests__/sdk-logger.test.ts +238 -0
- package/src/temporal/manager.ts +9 -0
- package/src/temporal/mcpserver/engine-client.ts +8 -3
- package/src/temporal/mcpserver/names.ts +16 -2
- package/src/temporal/sdk-logger.ts +173 -0
- package/dist/authorization/lane-admission.d.ts +0 -50
- package/dist/authorization/lane-admission.d.ts.map +0 -1
- package/dist/authorization/lane-admission.js +0 -13
- package/dist/authorization/lane-admission.js.map +0 -1
- package/src/authorization/__tests__/lane-admission.test.ts +0 -115
- package/src/authorization/lane-admission.ts +0 -73
|
@@ -4,11 +4,26 @@
|
|
|
4
4
|
*
|
|
5
5
|
* BuildNewState (create-state builder, aligned with Cloud's
|
|
6
6
|
* CreateOperationBuildNewStateStepV2): clears the client-provided status
|
|
7
|
-
* (system-managed),
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* (system-managed), assigns metadata.id = {kind-prefix}_{lowercase ULID},
|
|
8
|
+
* stamps spec_audit and status_audit identically with event "created",
|
|
9
|
+
* and defaults metadata.visibility from the kind's proto VisibilityConfig
|
|
10
|
+
* (blueprints → org, everything else → private; an explicit level is
|
|
11
|
+
* never overwritten).
|
|
12
|
+
*
|
|
13
|
+
* A create's id is the server's (metadata.proto `id`: "a generated,
|
|
14
|
+
* prefixed id"), so an id the request carries never survives: it is
|
|
15
|
+
* replaced, not refused, because an exported manifest applied again
|
|
16
|
+
* carries its id and must keep working (stigmer/stigmer#1266). For most
|
|
17
|
+
* kinds a chosen id is cosmetic; for a kind whose id other grants hang
|
|
18
|
+
* off, choosing it is a grant. The one exception is an id a step EARLIER
|
|
19
|
+
* in the chain assigned through `assignServerId` (a direct
|
|
20
|
+
* IdentityAccount's derived id, a Memory's early mint): the step records
|
|
21
|
+
* the exact id it chose under SERVER_ASSIGNED_ID_KEY, and BuildNewState
|
|
22
|
+
* keeps metadata.id only while it still equals that record. A claim is a
|
|
23
|
+
* value, not a flag, so a later step that rewrote the id, or a request
|
|
24
|
+
* that happened to carry the same string before any claim, keeps nothing.
|
|
25
|
+
* A kind that derives its id AFTER this step (Organization's CopySlugToId)
|
|
26
|
+
* needs no claim.
|
|
12
27
|
*
|
|
13
28
|
* SpecAudit/StatusAudit are SLOTS, not steps (stigmer/stigmer#540): every
|
|
14
29
|
* setAuditFieldsForUpdate call site declares which slot it owns —
|
|
@@ -66,6 +81,32 @@ import {
|
|
|
66
81
|
metadataOf,
|
|
67
82
|
} from "./shapes.js";
|
|
68
83
|
|
|
84
|
+
/**
|
|
85
|
+
* The context key under which a step records the create id it assigned
|
|
86
|
+
* before BuildNewState ran (`assignServerId`); its value is that id.
|
|
87
|
+
*/
|
|
88
|
+
export const SERVER_ASSIGNED_ID_KEY = "serverAssignedId";
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Assigns a create's id from a step that runs before BuildNewState and
|
|
92
|
+
* claims it, so BuildNewState keeps it instead of replacing it (module
|
|
93
|
+
* header). Setting and claiming are one call, so the two cannot drift.
|
|
94
|
+
*/
|
|
95
|
+
export function assignServerId<Desc extends DescMessage>(
|
|
96
|
+
ctx: RequestContext<Desc>,
|
|
97
|
+
id: string,
|
|
98
|
+
): void {
|
|
99
|
+
const metadata = metadataOf(ctx.newState);
|
|
100
|
+
if (metadata === undefined) {
|
|
101
|
+
throw internalError(
|
|
102
|
+
new Error("resource metadata is nil"),
|
|
103
|
+
"assign server id",
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
metadata.id = id;
|
|
107
|
+
ctx.set(SERVER_ASSIGNED_ID_KEY, id);
|
|
108
|
+
}
|
|
109
|
+
|
|
69
110
|
export function newBuildNewStateStep<
|
|
70
111
|
Desc extends DescMessage,
|
|
71
112
|
>(): PipelineStep<Desc> {
|
|
@@ -86,8 +127,12 @@ export function newBuildNewStateStep<
|
|
|
86
127
|
clearStatusField(ctx.schema, resource);
|
|
87
128
|
}
|
|
88
129
|
|
|
89
|
-
// 2.
|
|
90
|
-
|
|
130
|
+
// 2. Assign the id, {prefix}_{lowercase ULID}, whatever the request
|
|
131
|
+
// carried; keep only an id an earlier step claimed (module header).
|
|
132
|
+
if (
|
|
133
|
+
metadata.id === "" ||
|
|
134
|
+
metadata.id !== ctx.get(SERVER_ASSIGNED_ID_KEY)
|
|
135
|
+
) {
|
|
91
136
|
metadata.id = generateId(getIdPrefix(ctx.apiResourceKind));
|
|
92
137
|
}
|
|
93
138
|
|
|
@@ -9,17 +9,16 @@
|
|
|
9
9
|
* embeds, channel senders, schedule runs — stay refused; "the label is
|
|
10
10
|
* not authorization; the server refuses."
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* (
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* one (stigmer#1312).
|
|
12
|
+
* Who counts as that operator is stated ONCE, in
|
|
13
|
+
* `isFirstPartyHumanOperator` (extensions/identity.ts), the same
|
|
14
|
+
* allow-list recall and the person's declared preferences read on
|
|
15
|
+
* execution create, so the two halves of the memory loop cannot disagree
|
|
16
|
+
* about who a person is (stigmer#1406): a wire `user` that is not
|
|
17
|
+
* server-composed and whose bearer is not a PlatformClient token. Being
|
|
18
|
+
* an allow-list, it refuses a caller class this gate has never heard of
|
|
19
|
+
* — the half that must fail closed is capture (CheckMemoryEnablement's
|
|
20
|
+
* header). The PlatformClient arm reads the VERIFIED token's own claims,
|
|
21
|
+
* and only on a platform token (stigmer#1312, the predicate's own doc).
|
|
23
22
|
*
|
|
24
23
|
* RUNNER credentials carry neither the machine class nor that claim —
|
|
25
24
|
* their eligibility is EDITION POLICY, so the gate consults the composed
|
|
@@ -34,16 +33,15 @@
|
|
|
34
33
|
* below), `no-opinion` (not a credential the implementation classifies —
|
|
35
34
|
* this gate's own logic applies). The capability throws its own
|
|
36
35
|
* byte-pinned refusal for the org-mismatch arm. With no capability
|
|
37
|
-
* composed the
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* unchanged (proven by the rosters).
|
|
36
|
+
* composed only the allow-list runs: the OSS trusted-local identity and
|
|
37
|
+
* OIDC console logins are wire `user`s with no platform token, so the
|
|
38
|
+
* single-user posture is unchanged (proven by the rosters).
|
|
41
39
|
*/
|
|
42
40
|
import type { DescMessage } from "@bufbuild/protobuf";
|
|
43
41
|
import { Code, ConnectError } from "@connectrpc/connect";
|
|
44
42
|
|
|
45
43
|
import {
|
|
46
|
-
|
|
44
|
+
isFirstPartyHumanOperator,
|
|
47
45
|
isServerComposedRequest,
|
|
48
46
|
} from "../../extensions/identity.js";
|
|
49
47
|
import type { PipelineStep } from "../pipeline.js";
|
|
@@ -108,10 +106,7 @@ export function newGuardMemoryCaptureStep<Desc extends DescMessage>(
|
|
|
108
106
|
}
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
|
-
if (
|
|
112
|
-
caller.callerClass === "machine" ||
|
|
113
|
-
carriesPlatformClientClaim(caller.rawToken)
|
|
114
|
-
) {
|
|
109
|
+
if (!isFirstPartyHumanOperator(caller)) {
|
|
115
110
|
throw new ConnectError(
|
|
116
111
|
MEMORY_CAPTURE_CALLER_MESSAGE,
|
|
117
112
|
Code.PermissionDenied,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* — an agent execution, a workflow execution (the kind read off the
|
|
12
12
|
* bound id's prefix), an MCP connect (its own predicate), or nothing
|
|
13
13
|
* (a person; a token that is not ours; a forged one). One HMAC, no
|
|
14
|
-
* store read
|
|
14
|
+
* store read. A
|
|
15
15
|
* connect binding is answered BY NAME by every capability: it vouches
|
|
16
16
|
* nothing, captures nothing, and the exchange mints nothing for it.
|
|
17
17
|
* - `vouchRunnerLineageLabels`: a WORKFLOW-bound runner vouches the two
|
|
@@ -61,6 +61,7 @@ import { WorkflowExecutionQueryController } from "@stigmer/protos/ai/stigmer/age
|
|
|
61
61
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
62
62
|
import { IdentityAccountCommandController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/command_pb";
|
|
63
63
|
import { PlatformQueryController } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
64
|
+
import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
|
|
64
65
|
|
|
65
66
|
import { loadConfig } from "../../boot/config.js";
|
|
66
67
|
import { composeServer } from "../../boot/compose.js";
|
|
@@ -222,6 +223,18 @@ describe("the built-in posture (OIDC, no unit Authorizer): the runner acts as th
|
|
|
222
223
|
);
|
|
223
224
|
carolId = (await carol.provisionMyAccount({})).metadata?.id ?? "";
|
|
224
225
|
expect(carolId).not.toBe("");
|
|
226
|
+
// Carol founds the organization her runs belong to, so she holds its
|
|
227
|
+
// owner role: the model admits a run's creator to it only while they
|
|
228
|
+
// are in the run's organization.
|
|
229
|
+
await createClient(
|
|
230
|
+
OrganizationCommandController,
|
|
231
|
+
transportFor(port, await issuer.mint("auth0|carol", "carol@example.com")),
|
|
232
|
+
).create({
|
|
233
|
+
apiVersion: "tenancy.stigmer.ai/v1",
|
|
234
|
+
kind: "Organization",
|
|
235
|
+
metadata: { name: ORG, slug: ORG, org: "" },
|
|
236
|
+
spec: { description: "the runner-subject lane's organization" },
|
|
237
|
+
});
|
|
225
238
|
});
|
|
226
239
|
|
|
227
240
|
afterAll(async () => {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
* the connect predicate for the third — with no store read. A
|
|
30
30
|
* session's or an agent's id, a foreign prefix, or garbage is
|
|
31
31
|
* `undefined`, and the caller refuses with its own sentence. The
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* lineage vouch asks only this, synchronously, so it must stay free
|
|
33
|
+
* of I/O.
|
|
34
34
|
* - `loadBoundExecution(store, id)`: the row's facts the lane needs and
|
|
35
35
|
* nothing else — the creator stamp the verifier resolves a person
|
|
36
36
|
* from, the org and session the capture capability scopes with, and
|
|
@@ -11,21 +11,19 @@
|
|
|
11
11
|
* default alone is composed and none of what follows exists.
|
|
12
12
|
*
|
|
13
13
|
* ONE reading of "what is this runner bound to" — `runnerBindingOf` —
|
|
14
|
-
* feeds everything here
|
|
15
|
-
* (authorization/lane-admission.ts). It re-verifies the caller's own
|
|
14
|
+
* feeds everything here. It re-verifies the caller's own
|
|
16
15
|
* `rawToken` (the cloud's `verifiedClaims(caller.rawToken)` pattern: one
|
|
17
16
|
* HMAC, no store read) and reads the kind off the bound id's prefix
|
|
18
17
|
* through the contract's table (bound-execution.ts). It checks the
|
|
19
|
-
* caller CLASS first: the
|
|
20
|
-
* for every caller, and only the runner-subject verifier mints `runner`,
|
|
18
|
+
* caller CLASS first: only the runner-subject verifier mints `runner`,
|
|
21
19
|
* so a person costs nothing here. It never throws: a person, a runner
|
|
22
20
|
* holding no token, a token this server did not sign, or a binding that
|
|
23
21
|
* names no kind is simply "not a runner binding", and each caller
|
|
24
22
|
* answers its own default for that. A CONNECT binding (`mcp-connect`, a
|
|
25
23
|
* runner reading one discovery's secrets as the person who asked) IS a
|
|
26
|
-
* runner binding, and every capability below answers it by name: it
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* runner binding, and every capability below answers it by name: it
|
|
25
|
+
* vouches no lineage, captures no memory, and the exchange mints nothing
|
|
26
|
+
* for it.
|
|
29
27
|
*
|
|
30
28
|
* The capabilities, and where they follow or narrow the cloud:
|
|
31
29
|
*
|
|
@@ -35,14 +33,11 @@
|
|
|
35
33
|
* this, a self-host with sign-in on cannot run any workflow that
|
|
36
34
|
* calls an agent: the child create's GuardReservedLabels asks the
|
|
37
35
|
* Authorizer for `can_write_reserved_labels` on the platform object,
|
|
38
|
-
* which the built-in Authorizer denies for everyone.
|
|
39
|
-
* cloud on purpose: the cloud vouches for every runner-class
|
|
40
|
-
* credential and binds only its workflow lane; here an agent-bound
|
|
36
|
+
* which the built-in Authorizer denies for everyone. An agent-bound
|
|
41
37
|
* runner vouches nothing, because the workflow's `agent_call` activity
|
|
42
38
|
* is the only producer of the lineage labels and it runs under the
|
|
43
|
-
* workflow's credential (runner: activities/call-agent.ts)
|
|
44
|
-
*
|
|
45
|
-
* producer that needs it.
|
|
39
|
+
* workflow's credential (runner: activities/call-agent.ts); do not
|
|
40
|
+
* widen this without a producer that needs it.
|
|
46
41
|
* - `authorizeMemoryCapture`: an AGENT-bound runner is ADMITTED with the
|
|
47
42
|
* human the verifier resolved as the memory's subject — the row's one
|
|
48
43
|
* principal under the model; without it every memory an enforcing
|
|
@@ -160,14 +155,6 @@ export function runnerBindingOf(
|
|
|
160
155
|
return kind === undefined ? undefined : { kind, executionId };
|
|
161
156
|
}
|
|
162
157
|
|
|
163
|
-
/** The lane-admission predicate: a runner acting for a WORKFLOW execution (the cloud's `workflow_sandbox`). */
|
|
164
|
-
export function isWorkflowBoundRunner(
|
|
165
|
-
service: RunnerAuthService,
|
|
166
|
-
caller: CallerIdentity,
|
|
167
|
-
): boolean {
|
|
168
|
-
return runnerBindingOf(service, caller)?.kind === "workflow-execution";
|
|
169
|
-
}
|
|
170
|
-
|
|
171
158
|
/** The kind name the not-found copy carries, by the request's arm (what a `get` on that kind would say). */
|
|
172
159
|
function requestedKindName(
|
|
173
160
|
arm: "agent-execution" | "workflow-execution",
|
|
@@ -128,14 +128,24 @@ export interface RunnerBootstrapCredentials {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* What the sandbox ensure steps
|
|
132
|
-
*
|
|
133
|
-
*
|
|
131
|
+
* What the sandbox ensure steps (steps.ts) and the MCP connect lane
|
|
132
|
+
* (domain/mcpserver/connect-sandbox.ts) know when they mint the credential
|
|
133
|
+
* baked into a provisioned sandbox. `sessionId` is empty on the workflow
|
|
134
|
+
* and connect scopes; `callerIdentityId` is empty when the invocation site
|
|
134
135
|
* has no caller (the Java ensure step's null-identity arm, which mints
|
|
135
136
|
* nothing rather than minting unattributed).
|
|
137
|
+
*
|
|
138
|
+
* The connect scope binds `executionId` to one connect's synthetic id
|
|
139
|
+
* (domain/mcpserver/connect-execution-id.ts), whose ExecutionContext row
|
|
140
|
+
* the connect lane has already created AS `callerIdentityId`: the runner
|
|
141
|
+
* in a connect sandbox reads the McpServer, and classifies its tools
|
|
142
|
+
* through the proxy, with this credential, so it must act as the person
|
|
143
|
+
* who asked for the connect (stigmer/stigmer#1474). An implementation
|
|
144
|
+
* that switches on `scope` handles every arm; a scope it does not know is
|
|
145
|
+
* a refusal, never another scope's token.
|
|
136
146
|
*/
|
|
137
147
|
export interface SandboxCredentialRequest {
|
|
138
|
-
readonly scope: "session" | "workflow";
|
|
148
|
+
readonly scope: "session" | "workflow" | "connect";
|
|
139
149
|
readonly sessionId: string;
|
|
140
150
|
readonly executionId: string;
|
|
141
151
|
readonly org: string;
|
|
@@ -222,9 +232,9 @@ export interface RunnerCredentialProvider {
|
|
|
222
232
|
|
|
223
233
|
/**
|
|
224
234
|
* The credential baked into a provisioned sandbox (SandboxEnvironment.
|
|
225
|
-
* stigmerToken). When present, the ensure steps
|
|
226
|
-
* full provisioning context; absent, they mint
|
|
227
|
-
* lane exactly as before. Returns "" to launch tokenless (the
|
|
235
|
+
* stigmerToken). When present, the ensure steps and the connect lane
|
|
236
|
+
* delegate here with the full provisioning context; absent, they mint
|
|
237
|
+
* on the execution_scoped lane exactly as before. Returns "" to launch tokenless (the
|
|
228
238
|
* redaction-fallback contract lane.ts documents); a thrown error
|
|
229
239
|
* propagates to the invoking step's own failure posture.
|
|
230
240
|
*/
|
|
@@ -46,6 +46,7 @@ describe.skipIf(!optedIn || !dockerAnswers())(
|
|
|
46
46
|
// the smoke only needs the vars INJECTED, not a live server behind
|
|
47
47
|
// them (the runner tolerates an unreachable backend at boot).
|
|
48
48
|
backendEndpoint: "http://host.docker.internal:7234",
|
|
49
|
+
mcpPublicEndpoint: "https://api.example.com",
|
|
49
50
|
temporalAddress: "host.docker.internal:7233",
|
|
50
51
|
temporalNamespace: "default",
|
|
51
52
|
temporalConnectionEnv: {},
|
|
@@ -89,6 +90,9 @@ describe.skipIf(!optedIn || !dockerAnswers())(
|
|
|
89
90
|
);
|
|
90
91
|
expect(container?.Config.Env).toContain("STIGMER_TOKEN=tok-docker-smoke");
|
|
91
92
|
expect(container?.Config.Env).toContain("MODE=local");
|
|
93
|
+
expect(container?.Config.Env).toContain(
|
|
94
|
+
`STIGMER_MCP_PUBLIC_ENDPOINT=${config.mcpPublicEndpoint}`,
|
|
95
|
+
);
|
|
92
96
|
|
|
93
97
|
// Idempotent fast path.
|
|
94
98
|
await driver.ensureSessionSandbox(sessionId, {
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* - deprovision deletes Deployment + Secret (+ PVC when persistent);
|
|
11
11
|
* - the manifests carry the Java shapes: Recreate, the runner command,
|
|
12
12
|
* MODE=local, the secretKeyRef token env only when a token exists,
|
|
13
|
-
* the empty Secret for token-less sandboxes
|
|
13
|
+
* the empty Secret for token-less sandboxes;
|
|
14
|
+
* - the server's public address rides as STIGMER_MCP_PUBLIC_ENDPOINT
|
|
15
|
+
* only when configured (stigmer/stigmer#1447).
|
|
14
16
|
*/
|
|
15
17
|
import { describe, expect, it } from "vitest";
|
|
16
18
|
|
|
@@ -33,6 +35,7 @@ const silentLogger = { info: () => {} };
|
|
|
33
35
|
|
|
34
36
|
const config: SandboxDriverConfig = {
|
|
35
37
|
backendEndpoint: "http://stigmer-server.stigmer.svc:7234",
|
|
38
|
+
mcpPublicEndpoint: "https://api.example.com",
|
|
36
39
|
temporalAddress: "temporal.stigmer.svc:7233",
|
|
37
40
|
temporalNamespace: "stigmer",
|
|
38
41
|
temporalConnectionEnv: {},
|
|
@@ -209,6 +212,9 @@ describe("the manifest shapes (the Java SandboxManifestFactory pins)", () => {
|
|
|
209
212
|
);
|
|
210
213
|
expect(envByName.get("TEMPORAL_NAMESPACE")?.value).toBe("stigmer");
|
|
211
214
|
expect(envByName.get("WORKSPACE_ROOT_DIR")?.value).toBe("/workspace");
|
|
215
|
+
expect(envByName.get("STIGMER_MCP_PUBLIC_ENDPOINT")?.value).toBe(
|
|
216
|
+
config.mcpPublicEndpoint,
|
|
217
|
+
);
|
|
212
218
|
expect(envByName.get("STIGMER_TOKEN")?.valueFrom?.secretKeyRef?.name).toBe(
|
|
213
219
|
`${sandboxBaseName("session", "ses_1")}-env`,
|
|
214
220
|
);
|
|
@@ -217,6 +223,17 @@ describe("the manifest shapes (the Java SandboxManifestFactory pins)", () => {
|
|
|
217
223
|
);
|
|
218
224
|
});
|
|
219
225
|
|
|
226
|
+
it("a server with no public address hands the runner none", () => {
|
|
227
|
+
const deployment = buildSandboxDeployment("session", "ses_1", env, {
|
|
228
|
+
...config,
|
|
229
|
+
mcpPublicEndpoint: "",
|
|
230
|
+
});
|
|
231
|
+
const names = (
|
|
232
|
+
deployment.spec?.template.spec?.containers[0]?.env ?? []
|
|
233
|
+
).map((entry) => entry.name);
|
|
234
|
+
expect(names).not.toContain("STIGMER_MCP_PUBLIC_ENDPOINT");
|
|
235
|
+
});
|
|
236
|
+
|
|
220
237
|
it("a token-less sandbox omits the token env but keeps the (empty) Secret", () => {
|
|
221
238
|
const tokenless = {
|
|
222
239
|
taskQueue: "session:ses_1",
|
|
@@ -53,6 +53,7 @@ describe.skipIf(process.platform === "win32")(
|
|
|
53
53
|
|
|
54
54
|
const config: SandboxDriverConfig = {
|
|
55
55
|
backendEndpoint: "http://127.0.0.1:7234",
|
|
56
|
+
mcpPublicEndpoint: "http://127.0.0.1:7234",
|
|
56
57
|
temporalAddress: "127.0.0.1:7233",
|
|
57
58
|
temporalNamespace: "stigmer-smoke",
|
|
58
59
|
temporalConnectionEnv: { STIGMER_TEMPORAL_TLS: "true", STIGMER_TEMPORAL_API_KEY: "k-smoke" },
|
|
@@ -115,6 +116,9 @@ describe.skipIf(process.platform === "win32")(
|
|
|
115
116
|
expect(dump).toContain(
|
|
116
117
|
`TEMPORAL_SERVICE_ADDRESS=${config.temporalAddress}`,
|
|
117
118
|
);
|
|
119
|
+
expect(dump).toContain(
|
|
120
|
+
`STIGMER_MCP_PUBLIC_ENDPOINT=${config.mcpPublicEndpoint}`,
|
|
121
|
+
);
|
|
118
122
|
expect(dump).toMatch(/WORKSPACE_ROOT_DIR=.+session-ses_smoke/);
|
|
119
123
|
expect(dump).toContain("TEMPORAL_NAMESPACE=stigmer-smoke");
|
|
120
124
|
expect(dump).toContain("STIGMER_TEMPORAL_TLS=true");
|
|
@@ -33,6 +33,7 @@ const silentLogger = createLogger({
|
|
|
33
33
|
|
|
34
34
|
const driverConfig: SandboxDriverConfig = {
|
|
35
35
|
backendEndpoint: "http://host.docker.internal:7234",
|
|
36
|
+
mcpPublicEndpoint: "",
|
|
36
37
|
temporalAddress: "host.docker.internal:7233",
|
|
37
38
|
temporalNamespace: "default",
|
|
38
39
|
temporalConnectionEnv: {},
|
package/src/sandbox/docker.ts
CHANGED
|
@@ -145,6 +145,9 @@ export const newDockerSandboxProvisioner: SandboxProvisionerFactory = ({
|
|
|
145
145
|
`TEMPORAL_NAMESPACE=${config.temporalNamespace}`,
|
|
146
146
|
"--env",
|
|
147
147
|
`WORKSPACE_ROOT_DIR=${CONTAINER_WORKSPACE_DIR}`,
|
|
148
|
+
...(config.mcpPublicEndpoint !== ""
|
|
149
|
+
? ["--env", `STIGMER_MCP_PUBLIC_ENDPOINT=${config.mcpPublicEndpoint}`]
|
|
150
|
+
: []),
|
|
148
151
|
];
|
|
149
152
|
// Value-less --env inherits from the CLI's environment (module header:
|
|
150
153
|
// the token must never appear in argv). The Temporal connection
|
|
@@ -316,6 +316,9 @@ export function buildSandboxDeployment(
|
|
|
316
316
|
{ name: "TEMPORAL_NAMESPACE", value: config.temporalNamespace },
|
|
317
317
|
{ name: "WORKSPACE_ROOT_DIR", value: WORKSPACE_MOUNT_PATH },
|
|
318
318
|
];
|
|
319
|
+
if (config.mcpPublicEndpoint !== "") {
|
|
320
|
+
containerEnv.push({ name: "STIGMER_MCP_PUBLIC_ENDPOINT", value: config.mcpPublicEndpoint });
|
|
321
|
+
}
|
|
319
322
|
if (env.stigmerToken !== "") {
|
|
320
323
|
containerEnv.push({
|
|
321
324
|
name: "STIGMER_TOKEN",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* STIGMER_TASK_QUEUE (the one queue this sandbox serves),
|
|
12
12
|
* STIGMER_BACKEND_ENDPOINT / TEMPORAL_SERVICE_ADDRESS (empty values fall
|
|
13
13
|
* back to the runner's own local defaults and Temporal self-discovery),
|
|
14
|
+
* STIGMER_MCP_PUBLIC_ENDPOINT when the server names its public address,
|
|
14
15
|
* STIGMER_TOKEN when minted ("" stays unset — optional in local mode),
|
|
15
16
|
* and a per-sandbox WORKSPACE_ROOT_DIR so concurrent sandboxes never
|
|
16
17
|
* share a workspace.
|
|
@@ -108,6 +109,9 @@ export const newLocalProcessSandboxProvisioner: SandboxProvisionerFactory = ({
|
|
|
108
109
|
if (config.temporalAddress !== "") {
|
|
109
110
|
childEnv["TEMPORAL_SERVICE_ADDRESS"] = config.temporalAddress;
|
|
110
111
|
}
|
|
112
|
+
if (config.mcpPublicEndpoint !== "") {
|
|
113
|
+
childEnv["STIGMER_MCP_PUBLIC_ENDPOINT"] = config.mcpPublicEndpoint;
|
|
114
|
+
}
|
|
111
115
|
if (env.stigmerToken !== "") {
|
|
112
116
|
childEnv["STIGMER_TOKEN"] = env.stigmerToken;
|
|
113
117
|
}
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
* queue-override lane — dispatch.ts). Ensured critically BEFORE the
|
|
20
20
|
* execution persists; deprovisioned on the terminal phase transition.
|
|
21
21
|
* - CONNECT: request-scoped, NOT idempotent; the caller must
|
|
22
|
-
* deprovision
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* deprovision when the connect settles. Every MCP connect provisions
|
|
23
|
+
* one when a provisioner is composed, and its workflow runs on the
|
|
24
|
+
* queue that sandbox serves (domain/mcpserver/connect-sandbox.ts,
|
|
25
|
+
* stigmer/stigmer#1474): with a provisioner the shared runner queue
|
|
26
|
+
* has no poller, since boot requires a per-queue routing mode beside
|
|
27
|
+
* one. Without a provisioner, connect keeps the shared queue.
|
|
26
28
|
*
|
|
27
29
|
* The probe is ensure-time LIVE-STATE inspection, never a boot-readiness
|
|
28
30
|
* wait (gate ruling Q5): the verified cloud design has NO readiness
|
|
@@ -109,8 +111,8 @@ export interface SandboxProvisioner {
|
|
|
109
111
|
deprovisionWorkflowSandbox(executionId: string): Promise<void>;
|
|
110
112
|
/**
|
|
111
113
|
* Creates a request-scoped connect sandbox and returns the provider's
|
|
112
|
-
* sandbox id. NOT idempotent — the caller owns deprovision
|
|
113
|
-
*
|
|
114
|
+
* sandbox id. NOT idempotent — the caller owns deprovision when the
|
|
115
|
+
* connect settles (domain/mcpserver/connect-sandbox.ts).
|
|
114
116
|
*/
|
|
115
117
|
createConnectSandbox(
|
|
116
118
|
connectRequestId: string,
|
|
@@ -134,6 +136,16 @@ export interface SandboxDriverConfig {
|
|
|
134
136
|
* STIGMER_BACKEND_ENDPOINT.
|
|
135
137
|
*/
|
|
136
138
|
readonly backendEndpoint: string;
|
|
139
|
+
/**
|
|
140
|
+
* The server's PUBLIC address, the one a remote MCP server can dial back
|
|
141
|
+
* (STIGMER_SANDBOX_MCP_PUBLIC_ENDPOINT). Injected as
|
|
142
|
+
* STIGMER_MCP_PUBLIC_ENDPOINT, from which the runner fills a declared,
|
|
143
|
+
* missing STIGMER_SERVER_ADDRESS (the runner's platform-server-address
|
|
144
|
+
* module, stigmer/stigmer#1447). Empty injects nothing: the runner then
|
|
145
|
+
* fills only its stdio children, and a remote server's templated address
|
|
146
|
+
* stays unresolved rather than guessed.
|
|
147
|
+
*/
|
|
148
|
+
readonly mcpPublicEndpoint: string;
|
|
137
149
|
/** Temporal address as reachable from inside a sandbox (TEMPORAL_SERVICE_ADDRESS). */
|
|
138
150
|
readonly temporalAddress: string;
|
|
139
151
|
/** The Temporal namespace the sandbox's runner polls in (TEMPORAL_NAMESPACE). */
|
|
@@ -14,10 +14,19 @@ import { randomBytes } from "node:crypto";
|
|
|
14
14
|
|
|
15
15
|
import pg from "pg";
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Admin URL; undefined disables (visible-skip) the DB-backed suites. Inside a
|
|
19
|
+
* test gate (`STIGMER_TEST_GATE=1`) the gate provides Postgres, so a missing
|
|
20
|
+
* URL is the gate's failure, not a skip: this throws, and every DB-backed
|
|
21
|
+
* file fails by name at collection.
|
|
22
|
+
*/
|
|
18
23
|
export function testDatabaseAdminUrl(): string | undefined {
|
|
19
24
|
const value = process.env.TEST_DATABASE_URL;
|
|
20
|
-
|
|
25
|
+
const url = value !== undefined && value !== "" ? value : undefined;
|
|
26
|
+
if (url === undefined && process.env.STIGMER_TEST_GATE === "1") {
|
|
27
|
+
throw new Error("STIGMER_TEST_GATE=1 but TEST_DATABASE_URL is unset: the gate must provide Postgres");
|
|
28
|
+
}
|
|
29
|
+
return url;
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
export interface TestDatabase {
|
package/src/temporal/README.md
CHANGED
|
@@ -5,6 +5,7 @@ The shared worker infrastructure and the per-domain workers. Landed with D4 #18
|
|
|
5
5
|
## Layout
|
|
6
6
|
|
|
7
7
|
- `manager.ts` — TemporalManager (ports pkg/server/temporal_manager.go): non-fatal initial connect, 15s health monitor, reconnect with worker recreation, reconnect hooks. Domain code observes the CURRENT client through providers — there is no Go-style creator re-injection.
|
|
8
|
+
- `sdk-logger.ts` — routes the Temporal SDK's own log lines (activity failures, worker lifecycle, workflow `log.*`) through the server logger by installing the SDK's Runtime logger before the first native connect; the header holds the field-redaction table (#1037).
|
|
8
9
|
- `payload-codec.ts` — the decode-only payload codec (ports pkg/encryption/payloadcodec): encode is the identity, decode delegates to @stigmer/temporal-codecs.
|
|
9
10
|
- `workflow-source.ts` — prebuilt-bundle vs bundle-on-boot resolution (runner precedent); prebuilt bundles arrive with #24.
|
|
10
11
|
- `runner-failure.ts` — worker-shutdown classification shared by the execution workflows (ports pkg/runnerfailure, #776).
|
|
@@ -19,17 +19,22 @@
|
|
|
19
19
|
* (the finding-16 seam — factories never see the NativeConnection);
|
|
20
20
|
* - a worker's run() rejection logs at ERROR with its queue identity
|
|
21
21
|
* (a permanent death re-dies on every recreate while the worker
|
|
22
|
-
* reports RUNNING — the log line is the only signal)
|
|
22
|
+
* reports RUNNING — the log line is the only signal);
|
|
23
|
+
* - the manager's logger is attached to the SDK log bridge before
|
|
24
|
+
* every native connect, first start and reconnect alike (#1037: the
|
|
25
|
+
* first native connect creates the Runtime, after which its logger
|
|
26
|
+
* cannot be installed).
|
|
23
27
|
*
|
|
24
|
-
* The manager's private dial
|
|
25
|
-
* are stubbed (module mock + private-seam
|
|
28
|
+
* The manager's private dial, the SDK's NativeConnection/Worker.create and
|
|
29
|
+
* the process SDK log bridge are stubbed (module mock + private-seam
|
|
30
|
+
* override), so no test here creates the native Runtime: the real connect
|
|
26
31
|
* path is proven end-to-end by local-execution; these tests pin the
|
|
27
32
|
* manager's OWN state machine and wiring, which only misbehave in windows
|
|
28
33
|
* no live harness can schedule deterministically.
|
|
29
34
|
*/
|
|
30
35
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
31
36
|
|
|
32
|
-
import { createLogger } from "../../boot/logger.js";
|
|
37
|
+
import { createLogger, type Logger } from "../../boot/logger.js";
|
|
33
38
|
import { TemporalManager, type WorkerFactory } from "../manager.js";
|
|
34
39
|
|
|
35
40
|
const sdkSpy = vi.hoisted(() => ({
|
|
@@ -40,6 +45,19 @@ const sdkSpy = vi.hoisted(() => ({
|
|
|
40
45
|
/** Options of every NativeConnection.connect and Connection.connect call. */
|
|
41
46
|
nativeConnectCalls: [] as Record<string, unknown>[],
|
|
42
47
|
clientConnectCalls: [] as Record<string, unknown>[],
|
|
48
|
+
/** Bridge attaches and native connects, in the order they happened. */
|
|
49
|
+
order: [] as Array<"attach" | "native-connect">,
|
|
50
|
+
/** The logger of every SDK log bridge attach, in order. */
|
|
51
|
+
attachedLoggers: [] as unknown[],
|
|
52
|
+
}));
|
|
53
|
+
|
|
54
|
+
vi.mock("../sdk-logger.js", () => ({
|
|
55
|
+
processSdkLogBridge: {
|
|
56
|
+
attach: (logger: unknown) => {
|
|
57
|
+
sdkSpy.order.push("attach");
|
|
58
|
+
sdkSpy.attachedLoggers.push(logger);
|
|
59
|
+
},
|
|
60
|
+
},
|
|
43
61
|
}));
|
|
44
62
|
|
|
45
63
|
vi.mock("@temporalio/client", async (importOriginal) => {
|
|
@@ -65,6 +83,7 @@ vi.mock("@temporalio/worker", async (importOriginal) => {
|
|
|
65
83
|
NativeConnection: {
|
|
66
84
|
connect: async (options: Record<string, unknown>) => {
|
|
67
85
|
sdkSpy.nativeConnectCalls.push(options);
|
|
86
|
+
sdkSpy.order.push("native-connect");
|
|
68
87
|
const connection = { close: async () => {} };
|
|
69
88
|
sdkSpy.lastConnection = connection;
|
|
70
89
|
return connection;
|
|
@@ -99,6 +118,8 @@ afterEach(async () => {
|
|
|
99
118
|
sdkSpy.lastConnection = undefined;
|
|
100
119
|
sdkSpy.nativeConnectCalls.length = 0;
|
|
101
120
|
sdkSpy.clientConnectCalls.length = 0;
|
|
121
|
+
sdkSpy.order.length = 0;
|
|
122
|
+
sdkSpy.attachedLoggers.length = 0;
|
|
102
123
|
for (const manager of managers.splice(0)) {
|
|
103
124
|
await manager.close();
|
|
104
125
|
}
|
|
@@ -381,3 +402,34 @@ describe("TemporalManager worker-death observability", () => {
|
|
|
381
402
|
expect(death).toContain("poller exploded");
|
|
382
403
|
});
|
|
383
404
|
});
|
|
405
|
+
|
|
406
|
+
describe("TemporalManager SDK log routing (#1037)", () => {
|
|
407
|
+
it("attaches its logger to the SDK log bridge before every native connect", async () => {
|
|
408
|
+
const logger: Logger = createLogger({
|
|
409
|
+
level: "error",
|
|
410
|
+
pretty: false,
|
|
411
|
+
write: () => {},
|
|
412
|
+
});
|
|
413
|
+
const manager = newManager([fakeWorkerFactory({ shutdowns: 0 })], {
|
|
414
|
+
logger,
|
|
415
|
+
});
|
|
416
|
+
stubDial(manager, async () => ({
|
|
417
|
+
connection: { close: async () => {} },
|
|
418
|
+
client: {},
|
|
419
|
+
}));
|
|
420
|
+
|
|
421
|
+
await manager.initialConnect();
|
|
422
|
+
await manager.startWorkers();
|
|
423
|
+
await (
|
|
424
|
+
manager as unknown as { attemptReconnection: () => Promise<void> }
|
|
425
|
+
).attemptReconnection();
|
|
426
|
+
|
|
427
|
+
expect(sdkSpy.order).toEqual([
|
|
428
|
+
"attach",
|
|
429
|
+
"native-connect",
|
|
430
|
+
"attach",
|
|
431
|
+
"native-connect",
|
|
432
|
+
]);
|
|
433
|
+
expect(sdkSpy.attachedLoggers).toEqual([logger, logger]);
|
|
434
|
+
});
|
|
435
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only workflow for sdk-logger.e2e.test.ts: one `log.warn` from the
|
|
3
|
+
* workflow body carrying a scalar and a nested field (a line our code
|
|
4
|
+
* wrote), then one activity that fails on its only attempt (the SDK's own
|
|
5
|
+
* `Activity failed` line).
|
|
6
|
+
*
|
|
7
|
+
* WORKFLOW-BUNDLE IMPORT DISCIPLINE applies (sandbox module).
|
|
8
|
+
*/
|
|
9
|
+
import { log, proxyActivities } from "@temporalio/workflow";
|
|
10
|
+
|
|
11
|
+
export const SDK_LOG_PROBE_WORKFLOW = "sdkLogProbe";
|
|
12
|
+
export const SDK_LOG_PROBE_ACTIVITY = "SdkLogProbeFailingActivity";
|
|
13
|
+
export const SDK_LOG_PROBE_WARNING = "sdk log probe: workflow warning";
|
|
14
|
+
|
|
15
|
+
const activities = proxyActivities<Record<string, () => Promise<void>>>({
|
|
16
|
+
startToCloseTimeout: "10 seconds",
|
|
17
|
+
retry: { maximumAttempts: 1 },
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export async function sdkLogProbe(): Promise<void> {
|
|
21
|
+
log.warn(SDK_LOG_PROBE_WARNING, {
|
|
22
|
+
probeCount: 3,
|
|
23
|
+
outcomes: { reaped: 2, kept: 1 },
|
|
24
|
+
});
|
|
25
|
+
await activities[SDK_LOG_PROBE_ACTIVITY]!();
|
|
26
|
+
}
|