@stigmer/server 3.40.0 → 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 +133 -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 +9 -4
- package/dist/domain/channelapp/controller.d.ts.map +1 -1
- package/dist/domain/channelapp/controller.js +19 -9
- 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 +154 -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 +35 -12
- 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 +41 -1
- 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
|
@@ -7,32 +7,55 @@
|
|
|
7
7
|
* console's callback page. A local install (`stigmer up`, the desktop app,
|
|
8
8
|
* the all-in-one image) never set it, and `initiateOAuthConnect` refuses
|
|
9
9
|
* without it, so every Sign in surface the console offers was dead on a
|
|
10
|
-
* local install.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* local install. A server that serves the console on its unified port knows
|
|
11
|
+
* where that console is: the callback is the console's callback page on the
|
|
12
|
+
* origin browsers reach the unified port on.
|
|
13
|
+
*
|
|
14
|
+
* That origin is `SKILL_TRANSFER_BASE_URL` when the operator named one. The
|
|
15
|
+
* team shapes fill it from the address they were told clients reach the
|
|
16
|
+
* server on (Compose's `STIGMER_PUBLIC_URL`, the chart's `server.publicUrl`
|
|
17
|
+
* or its Ingress API host), and the console is served on that same origin,
|
|
18
|
+
* so its callback page is there too. Unnamed, the server is reached by a
|
|
19
|
+
* browser on the machine it runs on (`stigmer up`, the desktop app, the
|
|
20
|
+
* all-in-one image), and the origin is `http://localhost:<port>`, the host
|
|
21
|
+
* the skill transfer lane derives on (boot/skill-transfer-origin.ts). Before
|
|
22
|
+
* the public origin was read here, a Compose or Helm console reached over
|
|
23
|
+
* the network sent its operator's browser to their own localhost
|
|
24
|
+
* (stigmer#1200).
|
|
16
25
|
*
|
|
17
26
|
* The rules, in order: a configured value always wins; a server that
|
|
18
27
|
* serves no console derives nothing (the CLI and the SDKs need no
|
|
19
|
-
* callback, and today's warn and refusal stand); a
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
28
|
+
* callback, and today's warn and refusal stand); a named public origin
|
|
29
|
+
* derives the callback on it, whatever the port; a known port derives it on
|
|
30
|
+
* localhost; a server whose port is not yet known (an ephemeral `0`, the
|
|
31
|
+
* test harness's shape) derives nothing. The console's callback route is
|
|
32
|
+
* the web app's `client-apps/web/src/app/auth/oauth/callback/page.tsx`; its
|
|
33
|
+
* path is a constant here because this is the one place the server names
|
|
34
|
+
* it.
|
|
24
35
|
*
|
|
25
|
-
* Proven by __tests__/oauth-redirect-uri.test.ts
|
|
36
|
+
* Proven by __tests__/oauth-redirect-uri.test.ts and the MCP OAuth callback
|
|
37
|
+
* case of __tests__/compose.test.ts.
|
|
26
38
|
*/
|
|
27
39
|
|
|
28
40
|
/** The console's OAuth callback page, relative to the served console's origin. */
|
|
29
41
|
export const CONSOLE_OAUTH_CALLBACK_PATH = "/auth/oauth/callback";
|
|
30
42
|
|
|
43
|
+
/** Which origin a derived callback was rendered on. */
|
|
44
|
+
export type DerivedOAuthRedirectOrigin =
|
|
45
|
+
/** The operator's `SKILL_TRANSFER_BASE_URL`: the unified port's public origin. */
|
|
46
|
+
| "public-origin"
|
|
47
|
+
/** The unified port on localhost: a browser on the server's own machine. */
|
|
48
|
+
| "loopback";
|
|
49
|
+
|
|
31
50
|
export type OAuthRedirectUriResolution =
|
|
32
51
|
/** The operator's value, as configured. */
|
|
33
52
|
| { readonly kind: "configured"; readonly uri: string }
|
|
34
53
|
/** Derived from the served console's own origin. */
|
|
35
|
-
| {
|
|
54
|
+
| {
|
|
55
|
+
readonly kind: "derived";
|
|
56
|
+
readonly uri: string;
|
|
57
|
+
readonly from: DerivedOAuthRedirectOrigin;
|
|
58
|
+
}
|
|
36
59
|
/** Nothing to hand the login server; initiate refuses with the pinned copy. */
|
|
37
60
|
| { readonly kind: "absent" };
|
|
38
61
|
|
|
@@ -41,13 +64,35 @@ export interface OAuthRedirectUriInputs {
|
|
|
41
64
|
readonly configured: string;
|
|
42
65
|
/** Whether this server serves the web console on its unified port. */
|
|
43
66
|
readonly servesConsole: boolean;
|
|
67
|
+
/** `SKILL_TRANSFER_BASE_URL` as loaded: the unified port's public origin; empty when unset. */
|
|
68
|
+
readonly publicOrigin: string;
|
|
44
69
|
/** The port the unified listener binds; 0 means "not known until listen". */
|
|
45
70
|
readonly port: number;
|
|
46
71
|
}
|
|
47
72
|
|
|
48
73
|
/** The callback URL the McpServer OAuth flows use, and where it came from. */
|
|
49
|
-
export function resolveOAuthRedirectUri(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
74
|
+
export function resolveOAuthRedirectUri(
|
|
75
|
+
inputs: OAuthRedirectUriInputs,
|
|
76
|
+
): OAuthRedirectUriResolution {
|
|
77
|
+
if (inputs.configured !== "")
|
|
78
|
+
return { kind: "configured", uri: inputs.configured };
|
|
79
|
+
if (!inputs.servesConsole) return { kind: "absent" };
|
|
80
|
+
if (inputs.publicOrigin !== "") {
|
|
81
|
+
return {
|
|
82
|
+
kind: "derived",
|
|
83
|
+
uri: `${trimTrailingSlash(inputs.publicOrigin)}${CONSOLE_OAUTH_CALLBACK_PATH}`,
|
|
84
|
+
from: "public-origin",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (inputs.port === 0) return { kind: "absent" };
|
|
88
|
+
return {
|
|
89
|
+
kind: "derived",
|
|
90
|
+
uri: `http://localhost:${inputs.port}${CONSOLE_OAUTH_CALLBACK_PATH}`,
|
|
91
|
+
from: "loopback",
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** An origin written `https://host/` names the same origin as `https://host` (the skill lane's join). */
|
|
96
|
+
function trimTrailingSlash(origin: string): string {
|
|
97
|
+
return origin.endsWith("/") ? origin.slice(0, -1) : origin;
|
|
53
98
|
}
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* The skill transfer lane's origin: where its capability URLs point, and
|
|
3
|
+
* whether the callers they are minted for can reach it.
|
|
4
4
|
*
|
|
5
5
|
* On the local blob driver the server itself carries artifact bytes over
|
|
6
6
|
* HTTP, and every upload and download capability URL it mints is rendered
|
|
7
|
-
* from `SKILL_TRANSFER_BASE_URL
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
7
|
+
* from one base. `SKILL_TRANSFER_BASE_URL` sets it; unset, it is the
|
|
8
|
+
* server's own port on localhost, and this module is the one place that
|
|
9
|
+
* says how. The rules, in order: a configured value always wins; a unified
|
|
10
|
+
* port the composition knows renders `http://localhost:<port>` once; a
|
|
11
|
+
* unified port of 0 (`GRPC_PORT=0`, and the `portOverride: 0` test seam)
|
|
12
|
+
* is not known until listen, so the base reads the port the listener
|
|
13
|
+
* actually bound. Deriving from the configured port instead minted URLs
|
|
14
|
+
* for `localhost:0`, or for the config default under a port override,
|
|
15
|
+
* where nothing listens (stigmer#1386). The unified port binds last in
|
|
16
|
+
* start(), and every minting RPC arrives through it, so a read before the
|
|
17
|
+
* bind is a construction-order fault and throws rather than minting a URL
|
|
18
|
+
* for a port nothing listens on: the artifact lane's rule
|
|
19
|
+
* (boot/artifact-lane.ts).
|
|
20
|
+
*
|
|
21
|
+
* The loopback default is right for a single-operator install reached on
|
|
22
|
+
* the machine it runs on, and silently wrong for a hosted one: the server
|
|
23
|
+
* boots, serves, and passes every in-process check while handing the CLI,
|
|
24
|
+
* the SDKs and the sandbox runner a host none of them can reach — every
|
|
25
|
+
* push above the gRPC cap fails on the PUT and every sandbox mount of a
|
|
26
|
+
* skill with supporting files loses them (stigmer#1219). No test inside
|
|
27
|
+
* the process can see it, so the process says it at boot. The verdict
|
|
28
|
+
* judges the configuration, not a rendered URL: an unset base is loopback
|
|
29
|
+
* by construction, whatever port it later reads.
|
|
15
30
|
*
|
|
16
31
|
* The hosted signal is the require-authentication posture (boot/compose.ts
|
|
17
32
|
* combines its two sources): a server that requires credentials serves
|
|
@@ -20,8 +35,44 @@
|
|
|
20
35
|
* is moot there and says so rather than warning about a knob nothing
|
|
21
36
|
* reads.
|
|
22
37
|
*
|
|
23
|
-
* Proven by __tests__/skill-transfer-origin.test.ts
|
|
38
|
+
* Proven by __tests__/skill-transfer-origin.test.ts and the transfer lane
|
|
39
|
+
* case of __tests__/compose.test.ts.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export interface SkillTransferBaseUrlInputs {
|
|
43
|
+
/** `SKILL_TRANSFER_BASE_URL` as loaded; empty when unset. */
|
|
44
|
+
readonly configured: string;
|
|
45
|
+
/** The port the unified listener binds; 0 means "not known until listen". */
|
|
46
|
+
readonly unifiedPort: number;
|
|
47
|
+
/** The port the unified listener actually bound; undefined before listen. */
|
|
48
|
+
readonly boundPort: () => number | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The base the lane's capability URLs are rendered from: the configured
|
|
53
|
+
* value as given, the known unified port's loopback origin, or a resolver
|
|
54
|
+
* over the port the unified listener bound.
|
|
24
55
|
*/
|
|
56
|
+
export function resolveSkillTransferBaseUrl(
|
|
57
|
+
inputs: SkillTransferBaseUrlInputs,
|
|
58
|
+
): string | (() => string) {
|
|
59
|
+
if (inputs.configured !== "") return inputs.configured;
|
|
60
|
+
if (inputs.unifiedPort !== 0) return `http://localhost:${inputs.unifiedPort}`;
|
|
61
|
+
const { boundPort } = inputs;
|
|
62
|
+
return () => {
|
|
63
|
+
const port = boundPort();
|
|
64
|
+
if (port === undefined) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"skill transfer URL requested before the unified port bound",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return `http://localhost:${port}`;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** What the boot warning names when the operator set no base. */
|
|
74
|
+
export const UNSET_BASE_URL_NOTE =
|
|
75
|
+
"(unset: derived from the server's own port on localhost)";
|
|
25
76
|
|
|
26
77
|
/** Hosts that name the process's own machine and nothing beyond it. */
|
|
27
78
|
const LOOPBACK_HOSTS = new Set([
|
|
@@ -33,7 +84,7 @@ const LOOPBACK_HOSTS = new Set([
|
|
|
33
84
|
]);
|
|
34
85
|
|
|
35
86
|
export type SkillTransferOriginVerdict =
|
|
36
|
-
/** The base
|
|
87
|
+
/** The configured base names a host other than the server's own loopback. */
|
|
37
88
|
| { readonly kind: "reachable" }
|
|
38
89
|
/** Loopback on a single-operator install: the default, and correct. */
|
|
39
90
|
| { readonly kind: "loopback-local" }
|
|
@@ -43,8 +94,8 @@ export type SkillTransferOriginVerdict =
|
|
|
43
94
|
| { readonly kind: "unused" };
|
|
44
95
|
|
|
45
96
|
export interface SkillTransferOriginInputs {
|
|
46
|
-
/**
|
|
47
|
-
readonly
|
|
97
|
+
/** `SKILL_TRANSFER_BASE_URL` as loaded; empty (the loopback default) when unset. */
|
|
98
|
+
readonly configured: string;
|
|
48
99
|
/** Whether the local driver relays artifact bytes through this server. */
|
|
49
100
|
readonly relaysThroughServer: boolean;
|
|
50
101
|
/** The composed require-authentication posture. */
|
|
@@ -57,11 +108,15 @@ export function assessSkillTransferOrigin(
|
|
|
57
108
|
if (!inputs.relaysThroughServer) {
|
|
58
109
|
return { kind: "unused" };
|
|
59
110
|
}
|
|
60
|
-
if (!namesLoopback(inputs.
|
|
111
|
+
if (inputs.configured !== "" && !namesLoopback(inputs.configured)) {
|
|
61
112
|
return { kind: "reachable" };
|
|
62
113
|
}
|
|
63
114
|
return inputs.requireAuthentication
|
|
64
|
-
? {
|
|
115
|
+
? {
|
|
116
|
+
kind: "loopback-hosted",
|
|
117
|
+
baseUrl:
|
|
118
|
+
inputs.configured === "" ? UNSET_BASE_URL_NOTE : inputs.configured,
|
|
119
|
+
}
|
|
65
120
|
: { kind: "loopback-local" };
|
|
66
121
|
}
|
|
67
122
|
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
* - cascade delete (oss#611): ALL instances of the agent are swept by
|
|
15
15
|
* spec.agent_id — including a cross-ORG instance — same-org shares are
|
|
16
16
|
* deleted, cross-org shares of the same agent SURVIVE, and a
|
|
17
|
-
* bystander agent's instances are untouched
|
|
17
|
+
* bystander agent's instances are untouched;
|
|
18
|
+
* - the server assigns a new agent's id (stigmer#1266): an id the
|
|
19
|
+
* request carries is replaced, on create and on an apply that
|
|
20
|
+
* creates, and the chosen id addresses nothing.
|
|
18
21
|
*/
|
|
19
22
|
import { mkdtempSync, rmSync } from "node:fs";
|
|
20
23
|
import { tmpdir } from "node:os";
|
|
@@ -41,6 +44,7 @@ import { composeServer } from "../../../boot/compose.js";
|
|
|
41
44
|
import type { ComposedServer } from "../../../boot/compose.js";
|
|
42
45
|
import { createLogger } from "../../../boot/logger.js";
|
|
43
46
|
import { ResourceNotFoundError } from "../../../store/interface.js";
|
|
47
|
+
import { seedOrganizations } from "../../organization/__tests__/support.js";
|
|
44
48
|
|
|
45
49
|
const silentLogger = createLogger({
|
|
46
50
|
level: "error",
|
|
@@ -82,6 +86,7 @@ beforeAll(async () => {
|
|
|
82
86
|
});
|
|
83
87
|
const port = await server.start();
|
|
84
88
|
transport = createGrpcTransport({ baseUrl: `http://127.0.0.1:${port}` });
|
|
89
|
+
await seedOrganizations(transport, [ORG, "globex"]);
|
|
85
90
|
command = createClient(AgentCommandController, transport);
|
|
86
91
|
query = createClient(AgentQueryController, transport);
|
|
87
92
|
instanceCommand = createClient(AgentInstanceCommandController, transport);
|
|
@@ -420,6 +425,42 @@ describe("agent cascade delete (oss#611)", () => {
|
|
|
420
425
|
});
|
|
421
426
|
});
|
|
422
427
|
|
|
428
|
+
describe("agent create — the server assigns the id (stigmer#1266)", () => {
|
|
429
|
+
const CHOSEN_ID = "agt_01hzzzzzzzzzzzzzzzzzzzzzzz";
|
|
430
|
+
|
|
431
|
+
async function expectMintedNotChosen(created: {
|
|
432
|
+
metadata?: { id: string };
|
|
433
|
+
}): Promise<void> {
|
|
434
|
+
const id = created.metadata?.id ?? "";
|
|
435
|
+
expect(id).toMatch(/^agt_[0-9a-hjkmnp-tv-z]{26}$/);
|
|
436
|
+
expect(id).not.toBe(CHOSEN_ID);
|
|
437
|
+
const fetched = await query.get({ value: id });
|
|
438
|
+
expect(fetched.metadata?.id).toBe(id);
|
|
439
|
+
const missing = await grpcError(() => query.get({ value: CHOSEN_ID }));
|
|
440
|
+
expect(missing.code).toBe(Code.NotFound);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
it("create replaces a client-supplied id with a minted one", async () => {
|
|
444
|
+
const input = agentInput();
|
|
445
|
+
const created = await command.create({
|
|
446
|
+
...input,
|
|
447
|
+
metadata: { ...input.metadata, id: CHOSEN_ID },
|
|
448
|
+
});
|
|
449
|
+
await expectMintedNotChosen(created);
|
|
450
|
+
await command.delete({ value: created.metadata?.id ?? "" });
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it("an apply that creates (an exported manifest re-applied) replaces the id too", async () => {
|
|
454
|
+
const input = agentInput();
|
|
455
|
+
const applied = await command.apply({
|
|
456
|
+
...input,
|
|
457
|
+
metadata: { ...input.metadata, id: CHOSEN_ID },
|
|
458
|
+
});
|
|
459
|
+
await expectMintedNotChosen(applied);
|
|
460
|
+
await command.delete({ value: applied.metadata?.id ?? "" });
|
|
461
|
+
});
|
|
462
|
+
});
|
|
463
|
+
|
|
423
464
|
describe("agent create — CreateDefaultInstance failure wire contract (oss#852)", () => {
|
|
424
465
|
it("answers the inner code with Go's %w-wrapped transport-formatted message", async () => {
|
|
425
466
|
// Pre-occupy the deterministic default-instance slug with an instance
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
providerImmutableMessage,
|
|
62
62
|
sameOrgInvariantMessage,
|
|
63
63
|
} from "../constants.js";
|
|
64
|
+
import { seedOrganizations } from "../../organization/__tests__/support.js";
|
|
64
65
|
|
|
65
66
|
const silentLogger = createLogger({
|
|
66
67
|
level: "error",
|
|
@@ -106,6 +107,14 @@ beforeAll(async () => {
|
|
|
106
107
|
const transport: Transport = createGrpcTransport({
|
|
107
108
|
baseUrl: `http://127.0.0.1:${port}`,
|
|
108
109
|
});
|
|
110
|
+
await seedOrganizations(transport, [
|
|
111
|
+
ORG,
|
|
112
|
+
"acme",
|
|
113
|
+
"channel-other-org",
|
|
114
|
+
"channel-bystander-org",
|
|
115
|
+
"channel-apply-org",
|
|
116
|
+
"channel-list-org",
|
|
117
|
+
]);
|
|
109
118
|
channels = createClient(AgentChannelCommandController, transport);
|
|
110
119
|
query = createClient(AgentChannelQueryController, transport);
|
|
111
120
|
agents = createClient(AgentCommandController, transport);
|
|
@@ -68,6 +68,7 @@ import { createLogger } from "../../../boot/logger.js";
|
|
|
68
68
|
import { invalidArgumentError } from "../../../pipeline/errors.js";
|
|
69
69
|
import type { CallerIdentity } from "../../../extensions/identity.js";
|
|
70
70
|
import type { ChannelRuntime } from "../channel-runtime.js";
|
|
71
|
+
import { seedOrganizations } from "../../organization/__tests__/support.js";
|
|
71
72
|
|
|
72
73
|
const silentLogger = createLogger({
|
|
73
74
|
level: "error",
|
|
@@ -273,6 +274,7 @@ beforeAll(async () => {
|
|
|
273
274
|
const transport: Transport = createGrpcTransport({
|
|
274
275
|
baseUrl: `http://127.0.0.1:${port}`,
|
|
275
276
|
});
|
|
277
|
+
await seedOrganizations(transport, [ORG]);
|
|
276
278
|
channels = createClient(AgentChannelCommandController, transport);
|
|
277
279
|
query = createClient(AgentChannelQueryController, transport);
|
|
278
280
|
agents = createClient(AgentCommandController, transport);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pins the create lane's authorization question (steps.ts,
|
|
3
|
-
* resolveChannelCreateTargets):
|
|
4
|
-
* Java handler's copy
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* resolveChannelCreateTargets): can_manage_audience on the REFERENCED AGENT
|
|
4
|
+
* with the Java handler's copy (binding a channel widens who reaches the
|
|
5
|
+
* agent, the owner's decision, so an editor's can_edit is not enough), and
|
|
6
|
+
* nothing on the organization (the same-org invariant already binds the
|
|
7
|
+
* channel to the agent's); a missing referenced agent throws.
|
|
7
8
|
*/
|
|
8
9
|
import { describe, expect, it } from "vitest";
|
|
9
10
|
import { create } from "@bufbuild/protobuf";
|
|
@@ -39,10 +40,10 @@ function ctxFor(stash = true) {
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
describe("resolveChannelCreateTargets", () => {
|
|
42
|
-
it("asks
|
|
43
|
+
it("asks can_manage_audience on the referenced agent and nothing else", () => {
|
|
43
44
|
expect(resolveChannelCreateTargets(ctxFor())).toEqual([
|
|
44
45
|
{
|
|
45
|
-
permission: IamPermission.
|
|
46
|
+
permission: IamPermission.can_manage_audience,
|
|
46
47
|
resourceKind: ApiResourceKind.agent,
|
|
47
48
|
resourceId: "agt_01target",
|
|
48
49
|
deniedMessage: CHANNEL_CREATE_DENIED_MESSAGE,
|
|
@@ -190,12 +190,14 @@ export const CHANNEL_CREATE_DENIED_MESSAGE =
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* The create lane's authorization question, for AuthorizeResolvedTarget
|
|
193
|
-
* after ResolveChannelDefaults:
|
|
194
|
-
* is is_skip_authorization because its target is that agent,
|
|
195
|
-
* a slug, not a request field. Binding an agent to a channel
|
|
196
|
-
* front of a wider audience,
|
|
197
|
-
*
|
|
198
|
-
*
|
|
193
|
+
* after ResolveChannelDefaults: can_manage_audience on the REFERENCED AGENT.
|
|
194
|
+
* The RPC is is_skip_authorization because its target is that agent,
|
|
195
|
+
* resolved from a slug, not a request field. Binding an agent to a channel
|
|
196
|
+
* puts it in front of a wider audience, so it decides who reaches the agent:
|
|
197
|
+
* the owner's act, never an editor's, who may change the definition but not
|
|
198
|
+
* its audience. The same-org invariant the resolve step enforces already
|
|
199
|
+
* binds the channel's organization to the agent's, so there is no separate
|
|
200
|
+
* organization bar (command.proto).
|
|
199
201
|
*/
|
|
200
202
|
export function resolveChannelCreateTargets(
|
|
201
203
|
ctx: RequestContext<AgentChannelDesc>,
|
|
@@ -206,7 +208,7 @@ export function resolveChannelCreateTargets(
|
|
|
206
208
|
}
|
|
207
209
|
return [
|
|
208
210
|
{
|
|
209
|
-
permission: IamPermission.
|
|
211
|
+
permission: IamPermission.can_manage_audience,
|
|
210
212
|
resourceKind: ApiResourceKind.agent,
|
|
211
213
|
resourceId: agent.metadata?.id ?? "",
|
|
212
214
|
deniedMessage: CHANNEL_CREATE_DENIED_MESSAGE,
|