@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
|
@@ -24,7 +24,12 @@
|
|
|
24
24
|
* verifier + the store driver — the cloud composition's exact shape:
|
|
25
25
|
* provisionMyAccount lands the row in the driver, and an API key the
|
|
26
26
|
* subject minted resolves through the OSS API-key lane to the
|
|
27
|
-
* driver's account.
|
|
27
|
+
* driver's account. A second verifier of the unit's stands for a lane
|
|
28
|
+
* that vouches for its own accounts (an organization's identity
|
|
29
|
+
* provider): its caller is refused PERMISSION_DENIED before the
|
|
30
|
+
* subject its token names is read, whether a platform person already
|
|
31
|
+
* holds that subject's direct account or nobody does, and nothing is
|
|
32
|
+
* created. This is the lane the cloud actually runs over its
|
|
28
33
|
* driver; an OSS adapter over the cloud's generic store would miss
|
|
29
34
|
* every lookup and no other test would notice.
|
|
30
35
|
* (C) the same posture and verifier + the provision slot registered by
|
|
@@ -62,13 +67,17 @@ import { ApiKeyCommandController } from "@stigmer/protos/ai/stigmer/iam/apikey/v
|
|
|
62
67
|
import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
63
68
|
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
64
69
|
import { IdentityAccountCommandController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/command_pb";
|
|
70
|
+
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
65
71
|
import { IdentityAccountQueryController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/query_pb";
|
|
66
72
|
import { IamPermission } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
67
73
|
|
|
68
74
|
import { loadConfig } from "../../boot/config.js";
|
|
69
75
|
import { composeServer } from "../../boot/compose.js";
|
|
70
76
|
import type { ComposedServer } from "../../boot/compose.js";
|
|
71
|
-
import {
|
|
77
|
+
import {
|
|
78
|
+
accountIdFor,
|
|
79
|
+
NOT_A_DIRECT_SIGN_IN_MESSAGE,
|
|
80
|
+
} from "../../domain/identityaccount/constants.js";
|
|
72
81
|
import { newResourceIdentityAccountStore } from "../../domain/identityaccount/resource-store.js";
|
|
73
82
|
import type { IdentityAccountStore } from "../../domain/identityaccount/store.js";
|
|
74
83
|
import {
|
|
@@ -80,7 +89,7 @@ import type { Store } from "../../store/interface.js";
|
|
|
80
89
|
import { SqliteStore } from "../../store/sqlite/store.js";
|
|
81
90
|
import type { Authorizer } from "../authorizer.js";
|
|
82
91
|
import type { GateSlotName } from "../gate-slots.js";
|
|
83
|
-
import type { CallerIdentity } from "../identity.js";
|
|
92
|
+
import type { CallerIdentity, IdentityVerifier } from "../identity.js";
|
|
84
93
|
import type { IdentityFederation } from "../identity-federation.js";
|
|
85
94
|
import type { ServerExtension } from "../registry.js";
|
|
86
95
|
import {
|
|
@@ -486,6 +495,37 @@ describe("identity-account points (composed server, trusted-local: driver + fede
|
|
|
486
495
|
// (B) the cloud's shape: a declared posture, the unit's verifier, the driver
|
|
487
496
|
// ---------------------------------------------------------------------------
|
|
488
497
|
|
|
498
|
+
/**
|
|
499
|
+
* A lane that vouches for accounts of its own, the shape of an
|
|
500
|
+
* organization's identity provider: a JWT-shaped token whose third segment
|
|
501
|
+
* is `lane`, carrying `sub` (the subject the lane chose) and `acct` (the
|
|
502
|
+
* account it stamps). Nothing about it is a platform sign-in.
|
|
503
|
+
*/
|
|
504
|
+
function laneJwt(sub: string, acct: string): string {
|
|
505
|
+
const segment = (value: unknown): string =>
|
|
506
|
+
Buffer.from(JSON.stringify(value)).toString("base64url");
|
|
507
|
+
return `${segment({ alg: "none" })}.${segment({ sub, acct })}.lane`;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const laneVerifier: IdentityVerifier = {
|
|
511
|
+
name: "fake-lane-verifier",
|
|
512
|
+
verify: (token) => {
|
|
513
|
+
const segments = token.split(".");
|
|
514
|
+
if (segments.length !== 3 || segments[2] !== "lane") {
|
|
515
|
+
return Promise.resolve(null);
|
|
516
|
+
}
|
|
517
|
+
const claims = JSON.parse(
|
|
518
|
+
Buffer.from(segments[1] ?? "", "base64url").toString("utf8"),
|
|
519
|
+
) as { acct?: unknown };
|
|
520
|
+
return Promise.resolve({
|
|
521
|
+
identityId: typeof claims.acct === "string" ? claims.acct : "",
|
|
522
|
+
callerClass: "user",
|
|
523
|
+
issuer: "https://lane.invalid",
|
|
524
|
+
rawToken: token,
|
|
525
|
+
});
|
|
526
|
+
},
|
|
527
|
+
};
|
|
528
|
+
|
|
489
529
|
describe("identity-account points (composed server, declared posture: the verifiers follow the driver)", () => {
|
|
490
530
|
const SUB = "fake|provisioned-subject";
|
|
491
531
|
const EMAIL = "provisioned@example.com";
|
|
@@ -500,7 +540,7 @@ describe("identity-account points (composed server, declared posture: the verifi
|
|
|
500
540
|
const unit: ServerExtension = {
|
|
501
541
|
name: "fake-iam",
|
|
502
542
|
requireAuthentication: true,
|
|
503
|
-
identityVerifiers: [fakeVerifier],
|
|
543
|
+
identityVerifiers: [fakeVerifier, laneVerifier],
|
|
504
544
|
drivers: { identityAccountStore: driver.accounts },
|
|
505
545
|
};
|
|
506
546
|
server = await composeServer({
|
|
@@ -535,6 +575,46 @@ describe("identity-account points (composed server, declared posture: the verifi
|
|
|
535
575
|
expect(await accountIdsIn(server.store)).toEqual([]);
|
|
536
576
|
});
|
|
537
577
|
|
|
578
|
+
it.each([
|
|
579
|
+
["a platform person already holds the subject's direct account", SUB, true],
|
|
580
|
+
["nobody holds the subject", "fake|nobody-yet", false],
|
|
581
|
+
])(
|
|
582
|
+
"a lane's own account is refused provisionMyAccount before its subject is read (%s), and nothing is created",
|
|
583
|
+
async (_case, subject, personHoldsIt) => {
|
|
584
|
+
if (personHoldsIt) {
|
|
585
|
+
// The platform person signs in first (idempotent if an earlier case did).
|
|
586
|
+
await createClient(
|
|
587
|
+
IdentityAccountCommandController,
|
|
588
|
+
transportFor(port, fakeJwt(subject, EMAIL)),
|
|
589
|
+
).provisionMyAccount({});
|
|
590
|
+
}
|
|
591
|
+
const laneAccount = "ida_lane_account";
|
|
592
|
+
await driver.accounts.save(
|
|
593
|
+
create(IdentityAccountSchema, {
|
|
594
|
+
apiVersion: "iam.stigmer.ai/v1",
|
|
595
|
+
kind: "IdentityAccount",
|
|
596
|
+
metadata: { id: laneAccount, name: "lane person" },
|
|
597
|
+
spec: {
|
|
598
|
+
idpId: subject,
|
|
599
|
+
provisioningMode: IdentityAccountProvisioningMode.federated,
|
|
600
|
+
identityProviderRef: { org: "acme", slug: "acme-okta" },
|
|
601
|
+
},
|
|
602
|
+
}),
|
|
603
|
+
);
|
|
604
|
+
const before = await accountIdsIn(driver.store);
|
|
605
|
+
const refused = await connectErrorOf(
|
|
606
|
+
createClient(
|
|
607
|
+
IdentityAccountCommandController,
|
|
608
|
+
transportFor(port, laneJwt(subject, laneAccount)),
|
|
609
|
+
).provisionMyAccount({}),
|
|
610
|
+
);
|
|
611
|
+
expect(refused.code).toBe(Code.PermissionDenied);
|
|
612
|
+
expect(refused.rawMessage).toBe(NOT_A_DIRECT_SIGN_IN_MESSAGE);
|
|
613
|
+
expect(await accountIdsIn(driver.store)).toEqual(before);
|
|
614
|
+
await driver.accounts.deleteById(laneAccount);
|
|
615
|
+
},
|
|
616
|
+
);
|
|
617
|
+
|
|
538
618
|
it("an API key the subject minted resolves through the OSS API-key lane to the DRIVER's account", async () => {
|
|
539
619
|
const minted = await createClient(
|
|
540
620
|
ApiKeyCommandController,
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
} from "../../pipeline/interceptors/auth.js";
|
|
66
66
|
import type { ListReadScope } from "../list-read-scope.js";
|
|
67
67
|
import type { ServerExtension } from "../registry.js";
|
|
68
|
+
import { seedOrganizations } from "../../domain/organization/__tests__/support.js";
|
|
68
69
|
|
|
69
70
|
const silentLogger = createLogger({
|
|
70
71
|
level: "error",
|
|
@@ -130,6 +131,7 @@ describe("list read scope (composed server, fake scope)", () => {
|
|
|
130
131
|
});
|
|
131
132
|
const port = await server.start();
|
|
132
133
|
transport = createGrpcTransport({ baseUrl: `http://127.0.0.1:${port}` });
|
|
134
|
+
await seedOrganizations(transport, ["acme"]);
|
|
133
135
|
|
|
134
136
|
// Two rows per kind — one the scope will keep, one it must hide.
|
|
135
137
|
// Seeded through the store: the write path is not under test.
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
* enforcement for authorizer and edition, unique unit names, the
|
|
6
6
|
* unknown-gate-slot boot throw, and the O5 driver points (single-instance
|
|
7
7
|
* providers, name-keyed storage-driver registration with duplicate and
|
|
8
|
-
* built-in-shadow throws)
|
|
8
|
+
* built-in-shadow throws), the row readers' kind-keyed merge with its
|
|
9
|
+
* reserved kinds, and the units' hand-over and start points kept in unit
|
|
10
|
+
* order. The composed-server behavior (services on
|
|
9
11
|
* both routers, edition on the wire) is pinned by
|
|
10
12
|
* extension-composition.test.ts; empty-set wire byte-identity is pinned by
|
|
11
13
|
* the conformance rosters.
|
|
12
14
|
*/
|
|
13
15
|
import { describe, expect, it } from "vitest";
|
|
14
16
|
|
|
17
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
15
18
|
import { ServerEdition } from "@stigmer/protos/ai/stigmer/platform/v1/server_info_pb";
|
|
16
19
|
import type { DescMessage } from "@bufbuild/protobuf";
|
|
17
20
|
|
|
@@ -28,6 +31,7 @@ import type { CallerGuard } from "../caller-guards.js";
|
|
|
28
31
|
import { DECLARED_GATE_SLOTS, GATE_SLOT_NAMES } from "../gate-slots.js";
|
|
29
32
|
import type { GateSlotName } from "../gate-slots.js";
|
|
30
33
|
import type { IdentityVerifier } from "../identity.js";
|
|
34
|
+
import type { ResourceRowReader } from "../resource-row-reader.js";
|
|
31
35
|
import { resolveExtensions } from "../registry.js";
|
|
32
36
|
import type { ServerExtension } from "../registry.js";
|
|
33
37
|
|
|
@@ -146,6 +150,9 @@ describe("resolveExtensions — defaults", () => {
|
|
|
146
150
|
expect(resolved.drivers.secretCodecs.size).toBe(0);
|
|
147
151
|
expect(resolved.services).toEqual([]);
|
|
148
152
|
expect(resolved.workers).toEqual([]);
|
|
153
|
+
expect(resolved.drivers.resourceRowReaders.size).toBe(0);
|
|
154
|
+
expect(resolved.onComposed).toEqual([]);
|
|
155
|
+
expect(resolved.start).toEqual([]);
|
|
149
156
|
});
|
|
150
157
|
|
|
151
158
|
it("resolves the empty list identically to the omitted set", () => {
|
|
@@ -683,3 +690,142 @@ describe("resolveExtensions — loud-fail throws (DD-006 §2b)", () => {
|
|
|
683
690
|
);
|
|
684
691
|
});
|
|
685
692
|
});
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* The row readers (drivers.resourceRowReaders): a kind-keyed map merged
|
|
696
|
+
* across units under the keyed maps' rule — one reader per kind, and none
|
|
697
|
+
* for a kind open source keeps in its own store or reads through the
|
|
698
|
+
* account port, since a reader there would answer checks from rows the
|
|
699
|
+
* lanes never wrote.
|
|
700
|
+
*/
|
|
701
|
+
describe("resolveExtensions — resource row readers", () => {
|
|
702
|
+
const reader = (): ResourceRowReader => ({
|
|
703
|
+
findById: () => Promise.resolve(undefined),
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
it("merges readers as a kind-keyed map across units", () => {
|
|
707
|
+
const providers = reader();
|
|
708
|
+
const teams = reader();
|
|
709
|
+
const resolved = resolveExtensions([
|
|
710
|
+
{
|
|
711
|
+
name: "identity",
|
|
712
|
+
drivers: {
|
|
713
|
+
resourceRowReaders: new Map([
|
|
714
|
+
[ApiResourceKind.identity_provider, providers],
|
|
715
|
+
]),
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
name: "teams",
|
|
720
|
+
drivers: {
|
|
721
|
+
resourceRowReaders: new Map([[ApiResourceKind.team, teams]]),
|
|
722
|
+
},
|
|
723
|
+
},
|
|
724
|
+
]);
|
|
725
|
+
expect(
|
|
726
|
+
resolved.drivers.resourceRowReaders.get(
|
|
727
|
+
ApiResourceKind.identity_provider,
|
|
728
|
+
),
|
|
729
|
+
).toBe(providers);
|
|
730
|
+
expect(resolved.drivers.resourceRowReaders.get(ApiResourceKind.team)).toBe(
|
|
731
|
+
teams,
|
|
732
|
+
);
|
|
733
|
+
expect(resolved.drivers.resourceRowReaders.size).toBe(2);
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
it("throws on a second reader for one kind, naming both units", () => {
|
|
737
|
+
expect(() =>
|
|
738
|
+
resolveExtensions([
|
|
739
|
+
{
|
|
740
|
+
name: "first",
|
|
741
|
+
drivers: {
|
|
742
|
+
resourceRowReaders: new Map([
|
|
743
|
+
[ApiResourceKind.invitation, reader()],
|
|
744
|
+
]),
|
|
745
|
+
},
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
name: "second",
|
|
749
|
+
drivers: {
|
|
750
|
+
resourceRowReaders: new Map([
|
|
751
|
+
[ApiResourceKind.invitation, reader()],
|
|
752
|
+
]),
|
|
753
|
+
},
|
|
754
|
+
},
|
|
755
|
+
]),
|
|
756
|
+
).toThrowError(
|
|
757
|
+
/extension 'second' registers a row reader for 'invitation', but 'first' already did/,
|
|
758
|
+
);
|
|
759
|
+
});
|
|
760
|
+
|
|
761
|
+
it("throws on a reader for a kind open source serves from its own store", () => {
|
|
762
|
+
expect(() =>
|
|
763
|
+
resolveExtensions([
|
|
764
|
+
{
|
|
765
|
+
name: "shadowing",
|
|
766
|
+
drivers: {
|
|
767
|
+
resourceRowReaders: new Map([[ApiResourceKind.agent, reader()]]),
|
|
768
|
+
},
|
|
769
|
+
},
|
|
770
|
+
]),
|
|
771
|
+
).toThrowError(
|
|
772
|
+
"extension 'shadowing' registers a row reader for 'agent', which open source serves from its own store — readers are for kinds a unit keeps itself",
|
|
773
|
+
);
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
it("throws on a reader for the identity account, which the account port reads", () => {
|
|
777
|
+
expect(() =>
|
|
778
|
+
resolveExtensions([
|
|
779
|
+
{
|
|
780
|
+
name: "accounts",
|
|
781
|
+
drivers: {
|
|
782
|
+
resourceRowReaders: new Map([
|
|
783
|
+
[ApiResourceKind.identity_account, reader()],
|
|
784
|
+
]),
|
|
785
|
+
},
|
|
786
|
+
},
|
|
787
|
+
]),
|
|
788
|
+
).toThrowError(
|
|
789
|
+
/registers a row reader for 'identity_account', which is reserved — identity accounts are read through the account port/,
|
|
790
|
+
);
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
it("throws on a reader for the unknown kind", () => {
|
|
794
|
+
expect(() =>
|
|
795
|
+
resolveExtensions([
|
|
796
|
+
{
|
|
797
|
+
name: "unknown",
|
|
798
|
+
drivers: {
|
|
799
|
+
resourceRowReaders: new Map([
|
|
800
|
+
[ApiResourceKind.api_resource_kind_unknown, reader()],
|
|
801
|
+
]),
|
|
802
|
+
},
|
|
803
|
+
},
|
|
804
|
+
]),
|
|
805
|
+
).toThrowError(/registers a row reader for the unknown kind/);
|
|
806
|
+
});
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* The two unit points (extensions/composed-services.ts): each unit's
|
|
811
|
+
* hand-over and start hook is kept with its unit's name, in unit order,
|
|
812
|
+
* so compose.ts calls them in that order and a failing start names its
|
|
813
|
+
* unit. A unit that declares neither contributes nothing.
|
|
814
|
+
*/
|
|
815
|
+
describe("resolveExtensions — the hand-over and start points", () => {
|
|
816
|
+
it("keeps each unit's hooks with its name, in unit order", () => {
|
|
817
|
+
const composedFirst = (): void => {};
|
|
818
|
+
const composedThird = (): void => {};
|
|
819
|
+
const startFirst = (): Promise<void> => Promise.resolve();
|
|
820
|
+
const resolved = resolveExtensions([
|
|
821
|
+
{ name: "first", onComposed: composedFirst, start: startFirst },
|
|
822
|
+
{ name: "second" },
|
|
823
|
+
{ name: "third", onComposed: composedThird },
|
|
824
|
+
]);
|
|
825
|
+
expect(resolved.onComposed).toEqual([
|
|
826
|
+
{ unit: "first", hook: composedFirst },
|
|
827
|
+
{ unit: "third", hook: composedThird },
|
|
828
|
+
]);
|
|
829
|
+
expect(resolved.start).toEqual([{ unit: "first", hook: startFirst }]);
|
|
830
|
+
});
|
|
831
|
+
});
|
|
@@ -54,6 +54,7 @@ import type { SecretCodec } from "../../encryption/codec.js";
|
|
|
54
54
|
import type { EncryptionScope } from "../../encryption/encryption.js";
|
|
55
55
|
import { REDACTED_MARKER } from "../../encryption/encryption.js";
|
|
56
56
|
import { ResourceNotFoundError } from "../../store/interface.js";
|
|
57
|
+
import { seedOrganizations } from "../../domain/organization/__tests__/support.js";
|
|
57
58
|
|
|
58
59
|
const silentLogger = createLogger({
|
|
59
60
|
level: "error",
|
|
@@ -127,6 +128,7 @@ beforeAll(async () => {
|
|
|
127
128
|
const transport: Transport = createGrpcTransport({
|
|
128
129
|
baseUrl: `http://127.0.0.1:${port}`,
|
|
129
130
|
});
|
|
131
|
+
await seedOrganizations(transport, [ORG]);
|
|
130
132
|
envCommand = createClient(EnvironmentCommandController, transport);
|
|
131
133
|
oauthCommand = createClient(OAuthAppCommandController, transport);
|
|
132
134
|
channelCommand = createClient(ChannelAppCommandController, transport);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pins the visitorClassifier driver point in the single-instance shape the
|
|
3
|
+
* registry already enforces for outboundEgress and licenseStatus:
|
|
4
|
+
*
|
|
5
|
+
* - `drivers.visitorClassifier` — which callers are visitors, read by
|
|
6
|
+
* ComposeDeclaredPreferences to withhold the organization's standing
|
|
7
|
+
* context (stigmer/stigmer#1401); single instance; absent = nobody is
|
|
8
|
+
* a visitor, open source's own posture.
|
|
9
|
+
*
|
|
10
|
+
* What the step does with it is pinned beside the step
|
|
11
|
+
* (domain/agentexecution/__tests__/create-steps.test.ts).
|
|
12
|
+
*/
|
|
13
|
+
import { describe, expect, it } from "vitest";
|
|
14
|
+
|
|
15
|
+
import { resolveExtensions } from "../registry.js";
|
|
16
|
+
import type { VisitorClassifier } from "../visitor-classifier.js";
|
|
17
|
+
|
|
18
|
+
const nobody: VisitorClassifier = { isVisitor: () => false };
|
|
19
|
+
|
|
20
|
+
describe("the visitorClassifier driver point", () => {
|
|
21
|
+
it("is undefined with no extensions — nobody is a visitor", () => {
|
|
22
|
+
expect(resolveExtensions([]).drivers.visitorClassifier).toBeUndefined();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("carries the one registered instance through", () => {
|
|
26
|
+
const resolved = resolveExtensions([
|
|
27
|
+
{ name: "cloud-sharing", drivers: { visitorClassifier: nobody } },
|
|
28
|
+
]);
|
|
29
|
+
expect(resolved.drivers.visitorClassifier).toBe(nobody);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("throws on a second registration, naming both units", () => {
|
|
33
|
+
expect(() =>
|
|
34
|
+
resolveExtensions([
|
|
35
|
+
{ name: "visitors-a", drivers: { visitorClassifier: nobody } },
|
|
36
|
+
{ name: "visitors-b", drivers: { visitorClassifier: nobody } },
|
|
37
|
+
]),
|
|
38
|
+
).toThrowError(
|
|
39
|
+
/extension 'visitors-b' registers a VisitorClassifier, but 'visitors-a' already did/,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The composed services — what the composition built that a unit's own
|
|
3
|
+
* lanes must use, handed to the unit rather than rebuilt by it. A unit
|
|
4
|
+
* receives them through `ServerExtension.onComposed` (extensions/
|
|
5
|
+
* registry.ts), called once, in unit order, at the end of `composeServer`,
|
|
6
|
+
* before it returns; and it runs boot work that needs them through
|
|
7
|
+
* `ServerExtension.start`, called in unit order first in the server's
|
|
8
|
+
* `start()`, before any worker, reconciler or listener.
|
|
9
|
+
*
|
|
10
|
+
* Why the composition hands these over instead of the host passing them
|
|
11
|
+
* in: under open source's own authorization the Authorizer, the list read
|
|
12
|
+
* scope and the policy check are built inside `composeServer`, after every
|
|
13
|
+
* unit exists, so no host could pass them; and where a host could (its own
|
|
14
|
+
* Authorizer), handing the unit anything but the instance the Authorize
|
|
15
|
+
* step calls would let the unit's gates ask a different question than the
|
|
16
|
+
* chain around them. Receiving the one instance makes that impossible by
|
|
17
|
+
* construction, in every host.
|
|
18
|
+
*
|
|
19
|
+
* The contract:
|
|
20
|
+
* - `onComposed` is synchronous and only keeps what it is handed. The
|
|
21
|
+
* unit's lanes may be called by anyone once `composeServer` returns (a
|
|
22
|
+
* host's own sweep before `start`, a test that never starts), so the
|
|
23
|
+
* services must be in place by then; nothing in `composeServer` calls
|
|
24
|
+
* a unit's lanes before the hand-over.
|
|
25
|
+
* - `start` runs boot work that must finish before anything serves (a
|
|
26
|
+
* repair of the unit's own rows). A throw fails `start()`, so a server
|
|
27
|
+
* whose repair failed never listens.
|
|
28
|
+
* - Every field is the composition's one instance, whichever posture
|
|
29
|
+
* built it: a unit's registration, or open source's built-in.
|
|
30
|
+
*/
|
|
31
|
+
import type { Transport } from "@connectrpc/connect";
|
|
32
|
+
|
|
33
|
+
import type { AuthorizationQueryEngine } from "./authorization-queries.js";
|
|
34
|
+
import type { Authorizer } from "./authorizer.js";
|
|
35
|
+
import type { ListReadScope } from "./list-read-scope.js";
|
|
36
|
+
import type { ResourceAuthorizationLifecycle } from "./resource-authorization.js";
|
|
37
|
+
|
|
38
|
+
export interface ComposedServices {
|
|
39
|
+
/** The one Authorizer the Authorize step of every chain calls. */
|
|
40
|
+
readonly authorizer: Authorizer;
|
|
41
|
+
/** The one list read scope; undefined where lists are the full scan (open source signed-out). */
|
|
42
|
+
readonly listReadScope: ListReadScope | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* "Is this policy effectively held": the registered engine's `check`, or
|
|
45
|
+
* under open source's own authorization the evaluator's
|
|
46
|
+
* (authorization/policy-check.ts); undefined where neither exists (a
|
|
47
|
+
* unit Authorizer with no engine, or open source signed-out).
|
|
48
|
+
*/
|
|
49
|
+
readonly authorizationQueries:
|
|
50
|
+
| Pick<AuthorizationQueryEngine, "check">
|
|
51
|
+
| undefined;
|
|
52
|
+
/**
|
|
53
|
+
* The registered tuple lifecycle; undefined where the tuples are derived
|
|
54
|
+
* from the rows, so a unit's creation event has nothing to write.
|
|
55
|
+
*/
|
|
56
|
+
readonly resourceAuthorizationLifecycle:
|
|
57
|
+
| ResourceAuthorizationLifecycle
|
|
58
|
+
| undefined;
|
|
59
|
+
/** The in-process transport: server code calling another domain's RPCs rides it (boot/inprocess.ts). */
|
|
60
|
+
readonly inProcessTransport: Transport;
|
|
61
|
+
}
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
* `cloud.iam_platform_client` driver fills, the RS256 key ring every
|
|
44
44
|
* self-signed token rides, and the one token method only an edition
|
|
45
45
|
* that hosts shared-agent pages serves) — landed 2026-09-23
|
|
46
|
+
* - visitor classifier (which callers are visitors: admitted to the
|
|
47
|
+
* organization's agents without belonging to it, whose runs never
|
|
48
|
+
* carry its standing context) — landed with stigmer/stigmer#1401
|
|
49
|
+
* - resource row readers (where the built-in authorizer reads the rows
|
|
50
|
+
* of a kind a unit keeps in a store of its own, so an edition above
|
|
51
|
+
* open source can keep open source's authorizer) — landed 2026-09-29
|
|
46
52
|
*
|
|
47
53
|
* Merge rules (enforced by resolveExtensions, DD-006 §2b): the two
|
|
48
54
|
* provider kinds are single-instance points — a second declaring unit is
|
|
@@ -50,10 +56,14 @@
|
|
|
50
56
|
* and sandbox-provisioner drivers merge as name-keyed maps — a
|
|
51
57
|
* duplicated name, or a name shadowing a built-in, is a boot throw (the
|
|
52
58
|
* gateSteps rule: a registration the factory could never reach must fail
|
|
53
|
-
* loudly, not sit dark)
|
|
59
|
+
* loudly, not sit dark); resource row readers merge as a kind-keyed map
|
|
60
|
+
* under the same rule, with open-source kinds and the identity account
|
|
61
|
+
* reserved (extensions/resource-row-reader.ts). OSS defaults install at the boot/compose.ts
|
|
54
62
|
* consumption sites, never here (the default-lives-with-the-consumer
|
|
55
63
|
* doctrine).
|
|
56
64
|
*/
|
|
65
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
66
|
+
|
|
57
67
|
import type { ArtifactStorageDriverFactory } from "../artifactstorage/artifact-storage.js";
|
|
58
68
|
import type { ChannelRuntime } from "../domain/agentchannel/channel-runtime.js";
|
|
59
69
|
import type { IdentityAccountStore } from "../domain/identityaccount/store.js";
|
|
@@ -75,7 +85,9 @@ import type { OrganizationDirectory } from "./organization-directory.js";
|
|
|
75
85
|
import type { PolicyGrantScope } from "./policy-grant-scope.js";
|
|
76
86
|
import type { PrincipalDisplay } from "./principal-display.js";
|
|
77
87
|
import type { ResourceAuthorizationLifecycle } from "./resource-authorization.js";
|
|
88
|
+
import type { ResourceRowReader } from "./resource-row-reader.js";
|
|
78
89
|
import type { ScheduleFireCallerMint } from "./schedule-fire-caller.js";
|
|
90
|
+
import type { VisitorClassifier } from "./visitor-classifier.js";
|
|
79
91
|
|
|
80
92
|
/** The driver contributions of one extension unit. */
|
|
81
93
|
export interface ExtensionDrivers {
|
|
@@ -296,4 +308,24 @@ export interface ExtensionDrivers {
|
|
|
296
308
|
* (extensions/guest-token-minting.ts carries the contract).
|
|
297
309
|
*/
|
|
298
310
|
readonly guestTokenMinting?: GuestTokenMinting;
|
|
311
|
+
/**
|
|
312
|
+
* The visitor classifier (single-instance point): which callers are
|
|
313
|
+
* visitors, admitted to the organization's agents without belonging to
|
|
314
|
+
* it (extensions/visitor-classifier.ts carries the contract). When
|
|
315
|
+
* composed, ComposeDeclaredPreferences composes no organization
|
|
316
|
+
* standing context onto a visitor's run; when absent, nobody is a
|
|
317
|
+
* visitor — OSS behavior byte-identical.
|
|
318
|
+
*/
|
|
319
|
+
readonly visitorClassifier?: VisitorClassifier;
|
|
320
|
+
/**
|
|
321
|
+
* Row readers keyed by the kind whose rows they read
|
|
322
|
+
* (extensions/resource-row-reader.ts): the built-in authorizer's loader
|
|
323
|
+
* asks a kind's reader before the generic Store, so a unit that keeps a
|
|
324
|
+
* kind in a store of its own can still be answered by open source's
|
|
325
|
+
* authorizer. Instances, one per kind across the composed set; an
|
|
326
|
+
* open-source kind or `identity_account` is a boot throw. When absent,
|
|
327
|
+
* every row is read from the generic Store and identity accounts through
|
|
328
|
+
* the account port — OSS behavior byte-identical.
|
|
329
|
+
*/
|
|
330
|
+
readonly resourceRowReaders?: ReadonlyMap<ApiResourceKind, ResourceRowReader>;
|
|
299
331
|
}
|
|
@@ -165,7 +165,10 @@ export function isServerComposedRequest(caller: CallerIdentity): boolean {
|
|
|
165
165
|
* (not machine, not impersonated, no token_type, not a PlatformClient user
|
|
166
166
|
* token). Stated once for every consumer that must tell the person from a
|
|
167
167
|
* lane acting near them: memory recall and the person's declared
|
|
168
|
-
* preferences on execution create (domain/agentexecution/create-steps.ts)
|
|
168
|
+
* preferences on execution create (domain/agentexecution/create-steps.ts),
|
|
169
|
+
* and memory capture's fall-through for a credential the composed runner
|
|
170
|
+
* provider does not classify (pipeline/steps/guard-memory-capture.ts), so
|
|
171
|
+
* both halves of the memory loop admit the same people (stigmer#1406).
|
|
169
172
|
*
|
|
170
173
|
* An ALLOW-list, so a lane this module has never heard of is excluded by
|
|
171
174
|
* construction: the class must be `user` (every human verifier stamps it —
|