@stigmer/server 3.15.3-dev.20260914121148 → 3.16.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/README.md +3 -3
- package/dist/archive/content-store.d.ts +35 -0
- package/dist/archive/content-store.d.ts.map +1 -0
- package/dist/archive/content-store.js +98 -0
- package/dist/archive/content-store.js.map +1 -0
- package/dist/archive/inflate.d.ts +22 -0
- package/dist/archive/inflate.d.ts.map +1 -0
- package/dist/archive/inflate.js +75 -0
- package/dist/archive/inflate.js.map +1 -0
- package/dist/archive/limits.d.ts +33 -0
- package/dist/archive/limits.d.ts.map +1 -0
- package/dist/archive/limits.js +31 -0
- package/dist/archive/limits.js.map +1 -0
- package/dist/archive/open.d.ts +24 -0
- package/dist/archive/open.d.ts.map +1 -0
- package/dist/archive/open.js +93 -0
- package/dist/archive/open.js.map +1 -0
- package/dist/{domain/skill/storage → archive}/prefilter.d.ts +5 -0
- package/dist/archive/prefilter.d.ts.map +1 -0
- package/dist/archive/prefilter.js.map +1 -0
- package/dist/archive/write.d.ts +8 -0
- package/dist/archive/write.d.ts.map +1 -0
- package/dist/archive/write.js +44 -0
- package/dist/archive/write.js.map +1 -0
- package/dist/authorization/authorizer.d.ts +98 -0
- package/dist/authorization/authorizer.d.ts.map +1 -0
- package/dist/authorization/authorizer.js +156 -0
- package/dist/authorization/authorizer.js.map +1 -0
- package/dist/authorization/derived-tuples.d.ts +42 -0
- package/dist/authorization/derived-tuples.d.ts.map +1 -0
- package/dist/authorization/derived-tuples.js +240 -0
- package/dist/authorization/derived-tuples.js.map +1 -0
- package/dist/authorization/evaluator.d.ts +66 -0
- package/dist/authorization/evaluator.d.ts.map +1 -0
- package/dist/authorization/evaluator.js +153 -0
- package/dist/authorization/evaluator.js.map +1 -0
- package/dist/authorization/facts.d.ts +29 -0
- package/dist/authorization/facts.d.ts.map +1 -0
- package/dist/authorization/facts.js +17 -0
- package/dist/authorization/facts.js.map +1 -0
- package/dist/authorization/lane-admission.d.ts +50 -0
- package/dist/authorization/lane-admission.d.ts.map +1 -0
- package/dist/authorization/lane-admission.js +13 -0
- package/dist/authorization/lane-admission.js.map +1 -0
- package/dist/authorization/list-read-scope.d.ts +18 -0
- package/dist/authorization/list-read-scope.d.ts.map +1 -0
- package/dist/authorization/list-read-scope.js +155 -0
- package/dist/authorization/list-read-scope.js.map +1 -0
- package/dist/authorization/model/agent.d.ts +2 -0
- package/dist/authorization/model/agent.d.ts.map +1 -0
- package/dist/authorization/model/agent.js +42 -0
- package/dist/authorization/model/agent.js.map +1 -0
- package/dist/authorization/model/agent_channel.d.ts +2 -0
- package/dist/authorization/model/agent_channel.d.ts.map +1 -0
- package/dist/authorization/model/agent_channel.js +38 -0
- package/dist/authorization/model/agent_channel.js.map +1 -0
- package/dist/authorization/model/agent_execution.d.ts +2 -0
- package/dist/authorization/model/agent_execution.d.ts.map +1 -0
- package/dist/authorization/model/agent_execution.js +25 -0
- package/dist/authorization/model/agent_execution.js.map +1 -0
- package/dist/authorization/model/agent_instance.d.ts +2 -0
- package/dist/authorization/model/agent_instance.d.ts.map +1 -0
- package/dist/authorization/model/agent_instance.js +47 -0
- package/dist/authorization/model/agent_instance.js.map +1 -0
- package/dist/authorization/model/agent_share.d.ts +2 -0
- package/dist/authorization/model/agent_share.d.ts.map +1 -0
- package/dist/authorization/model/agent_share.js +29 -0
- package/dist/authorization/model/agent_share.js.map +1 -0
- package/dist/authorization/model/api_key.d.ts +2 -0
- package/dist/authorization/model/api_key.d.ts.map +1 -0
- package/dist/authorization/model/api_key.js +27 -0
- package/dist/authorization/model/api_key.js.map +1 -0
- package/dist/authorization/model/artifact.d.ts +2 -0
- package/dist/authorization/model/artifact.d.ts.map +1 -0
- package/dist/authorization/model/artifact.js +27 -0
- package/dist/authorization/model/artifact.js.map +1 -0
- package/dist/authorization/model/channel_app.d.ts +2 -0
- package/dist/authorization/model/channel_app.d.ts.map +1 -0
- package/dist/authorization/model/channel_app.js +28 -0
- package/dist/authorization/model/channel_app.js.map +1 -0
- package/dist/authorization/model/default-of.d.ts +38 -0
- package/dist/authorization/model/default-of.d.ts.map +1 -0
- package/dist/authorization/model/default-of.js +39 -0
- package/dist/authorization/model/default-of.js.map +1 -0
- package/dist/authorization/model/environment.d.ts +2 -0
- package/dist/authorization/model/environment.d.ts.map +1 -0
- package/dist/authorization/model/environment.js +33 -0
- package/dist/authorization/model/environment.js.map +1 -0
- package/dist/authorization/model/execution_context.d.ts +2 -0
- package/dist/authorization/model/execution_context.d.ts.map +1 -0
- package/dist/authorization/model/execution_context.js +19 -0
- package/dist/authorization/model/execution_context.js.map +1 -0
- package/dist/authorization/model/iam_policy.d.ts +2 -0
- package/dist/authorization/model/iam_policy.d.ts.map +1 -0
- package/dist/authorization/model/iam_policy.js +31 -0
- package/dist/authorization/model/iam_policy.js.map +1 -0
- package/dist/authorization/model/identity_account.d.ts +2 -0
- package/dist/authorization/model/identity_account.d.ts.map +1 -0
- package/dist/authorization/model/identity_account.js +25 -0
- package/dist/authorization/model/identity_account.js.map +1 -0
- package/dist/authorization/model/index.d.ts +36 -0
- package/dist/authorization/model/index.d.ts.map +1 -0
- package/dist/authorization/model/index.js +72 -0
- package/dist/authorization/model/index.js.map +1 -0
- package/dist/authorization/model/mcp_server.d.ts +2 -0
- package/dist/authorization/model/mcp_server.d.ts.map +1 -0
- package/dist/authorization/model/mcp_server.js +37 -0
- package/dist/authorization/model/mcp_server.js.map +1 -0
- package/dist/authorization/model/memory.d.ts +2 -0
- package/dist/authorization/model/memory.d.ts.map +1 -0
- package/dist/authorization/model/memory.js +26 -0
- package/dist/authorization/model/memory.js.map +1 -0
- package/dist/authorization/model/oauth_app.d.ts +2 -0
- package/dist/authorization/model/oauth_app.d.ts.map +1 -0
- package/dist/authorization/model/oauth_app.js +30 -0
- package/dist/authorization/model/oauth_app.js.map +1 -0
- package/dist/authorization/model/organization.d.ts +2 -0
- package/dist/authorization/model/organization.d.ts.map +1 -0
- package/dist/authorization/model/organization.js +54 -0
- package/dist/authorization/model/organization.js.map +1 -0
- package/dist/authorization/model/plugin.d.ts +2 -0
- package/dist/authorization/model/plugin.d.ts.map +1 -0
- package/dist/authorization/model/plugin.js +44 -0
- package/dist/authorization/model/plugin.js.map +1 -0
- package/dist/authorization/model/project.d.ts +2 -0
- package/dist/authorization/model/project.d.ts.map +1 -0
- package/dist/authorization/model/project.js +32 -0
- package/dist/authorization/model/project.js.map +1 -0
- package/dist/authorization/model/rewrite.d.ts +127 -0
- package/dist/authorization/model/rewrite.d.ts.map +1 -0
- package/dist/authorization/model/rewrite.js +82 -0
- package/dist/authorization/model/rewrite.js.map +1 -0
- package/dist/authorization/model/schedule.d.ts +2 -0
- package/dist/authorization/model/schedule.d.ts.map +1 -0
- package/dist/authorization/model/schedule.js +29 -0
- package/dist/authorization/model/schedule.js.map +1 -0
- package/dist/authorization/model/session.d.ts +2 -0
- package/dist/authorization/model/session.d.ts.map +1 -0
- package/dist/authorization/model/session.js +38 -0
- package/dist/authorization/model/session.js.map +1 -0
- package/dist/authorization/model/skill.d.ts +2 -0
- package/dist/authorization/model/skill.d.ts.map +1 -0
- package/dist/authorization/model/skill.js +38 -0
- package/dist/authorization/model/skill.js.map +1 -0
- package/dist/authorization/model/workflow.d.ts +2 -0
- package/dist/authorization/model/workflow.d.ts.map +1 -0
- package/dist/authorization/model/workflow.js +38 -0
- package/dist/authorization/model/workflow.js.map +1 -0
- package/dist/authorization/model/workflow_execution.d.ts +2 -0
- package/dist/authorization/model/workflow_execution.d.ts.map +1 -0
- package/dist/authorization/model/workflow_execution.js +32 -0
- package/dist/authorization/model/workflow_execution.js.map +1 -0
- package/dist/authorization/model/workflow_instance.d.ts +2 -0
- package/dist/authorization/model/workflow_instance.d.ts.map +1 -0
- package/dist/authorization/model/workflow_instance.js +92 -0
- package/dist/authorization/model/workflow_instance.js.map +1 -0
- package/dist/authorization/organization-directory.d.ts +13 -0
- package/dist/authorization/organization-directory.d.ts.map +1 -0
- package/dist/authorization/organization-directory.js +83 -0
- package/dist/authorization/organization-directory.js.map +1 -0
- package/dist/authorization/person.d.ts +42 -0
- package/dist/authorization/person.d.ts.map +1 -0
- package/dist/authorization/person.js +19 -0
- package/dist/authorization/person.js.map +1 -0
- package/dist/authorization/posture.d.ts +38 -0
- package/dist/authorization/posture.d.ts.map +1 -0
- package/dist/authorization/posture.js +7 -0
- package/dist/authorization/posture.js.map +1 -0
- package/dist/authorization/schedule-fire-caller.d.ts +12 -0
- package/dist/authorization/schedule-fire-caller.d.ts.map +1 -0
- package/dist/authorization/schedule-fire-caller.js +67 -0
- package/dist/authorization/schedule-fire-caller.js.map +1 -0
- package/dist/authorization/store-test-kit.d.ts +68 -0
- package/dist/authorization/store-test-kit.d.ts.map +1 -0
- package/dist/authorization/store-test-kit.js +311 -0
- package/dist/authorization/store-test-kit.js.map +1 -0
- package/dist/authorization/tuples.d.ts +115 -0
- package/dist/authorization/tuples.d.ts.map +1 -0
- package/dist/authorization/tuples.js +83 -0
- package/dist/authorization/tuples.js.map +1 -0
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +220 -43
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/inprocess.d.ts +12 -0
- package/dist/boot/inprocess.d.ts.map +1 -1
- package/dist/boot/inprocess.js +68 -21
- package/dist/boot/inprocess.js.map +1 -1
- package/dist/domain/agent/controller.d.ts.map +1 -1
- package/dist/domain/agent/controller.js +9 -0
- package/dist/domain/agent/controller.js.map +1 -1
- package/dist/domain/executioncontext/resolve-values-for-caller.d.ts +33 -14
- package/dist/domain/executioncontext/resolve-values-for-caller.d.ts.map +1 -1
- package/dist/domain/executioncontext/resolve-values-for-caller.js +32 -8
- package/dist/domain/executioncontext/resolve-values-for-caller.js.map +1 -1
- package/dist/domain/iampolicy/constants.d.ts +11 -0
- package/dist/domain/iampolicy/constants.d.ts.map +1 -1
- package/dist/domain/iampolicy/constants.js +11 -0
- package/dist/domain/iampolicy/constants.js.map +1 -1
- package/dist/domain/iampolicy/membership.d.ts +72 -1
- package/dist/domain/iampolicy/membership.d.ts.map +1 -1
- package/dist/domain/iampolicy/membership.js +141 -56
- package/dist/domain/iampolicy/membership.js.map +1 -1
- package/dist/domain/identityaccount/actor.d.ts +41 -0
- package/dist/domain/identityaccount/actor.d.ts.map +1 -0
- package/dist/domain/identityaccount/actor.js +34 -0
- package/dist/domain/identityaccount/actor.js.map +1 -0
- package/dist/domain/identityaccount/resolve.d.ts +19 -0
- package/dist/domain/identityaccount/resolve.d.ts.map +1 -1
- package/dist/domain/identityaccount/resolve.js +12 -0
- package/dist/domain/identityaccount/resolve.js.map +1 -1
- package/dist/domain/mcpserver/connect-execution-id.d.ts +5 -0
- package/dist/domain/mcpserver/connect-execution-id.d.ts.map +1 -0
- package/dist/domain/mcpserver/connect-execution-id.js +32 -0
- package/dist/domain/mcpserver/connect-execution-id.js.map +1 -0
- package/dist/domain/mcpserver/connect.d.ts +28 -2
- package/dist/domain/mcpserver/connect.d.ts.map +1 -1
- package/dist/domain/mcpserver/connect.js +27 -7
- package/dist/domain/mcpserver/connect.js.map +1 -1
- package/dist/domain/mcpserver/controller.d.ts.map +1 -1
- package/dist/domain/mcpserver/controller.js +9 -0
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/mcpserver/engine.d.ts +9 -3
- 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.js +1 -1
- package/dist/domain/mcpserver/start-connect.js.map +1 -1
- package/dist/domain/platform/controller.d.ts +24 -11
- package/dist/domain/platform/controller.d.ts.map +1 -1
- package/dist/domain/platform/controller.js.map +1 -1
- package/dist/domain/plugin/archive.d.ts +37 -0
- package/dist/domain/plugin/archive.d.ts.map +1 -0
- package/dist/domain/plugin/archive.js +50 -0
- package/dist/domain/plugin/archive.js.map +1 -0
- package/dist/domain/plugin/constants.d.ts +38 -0
- package/dist/domain/plugin/constants.d.ts.map +1 -0
- package/dist/domain/plugin/constants.js +46 -0
- package/dist/domain/plugin/constants.js.map +1 -0
- package/dist/domain/plugin/controller.d.ts +25 -0
- package/dist/domain/plugin/controller.d.ts.map +1 -0
- package/dist/domain/plugin/controller.js +493 -0
- package/dist/domain/plugin/controller.js.map +1 -0
- package/dist/domain/plugin/materialize/agent.d.ts +13 -0
- package/dist/domain/plugin/materialize/agent.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/agent.js +128 -0
- package/dist/domain/plugin/materialize/agent.js.map +1 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.d.ts +22 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.js +31 -0
- package/dist/domain/plugin/materialize/default-agent-instructions.js.map +1 -0
- package/dist/domain/plugin/materialize/identity.d.ts +28 -0
- package/dist/domain/plugin/materialize/identity.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/identity.js +40 -0
- package/dist/domain/plugin/materialize/identity.js.map +1 -0
- package/dist/domain/plugin/materialize/mcp-servers.d.ts +15 -0
- package/dist/domain/plugin/materialize/mcp-servers.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/mcp-servers.js +131 -0
- package/dist/domain/plugin/materialize/mcp-servers.js.map +1 -0
- package/dist/domain/plugin/materialize/plan.d.ts +24 -0
- package/dist/domain/plugin/materialize/plan.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/plan.js +77 -0
- package/dist/domain/plugin/materialize/plan.js.map +1 -0
- package/dist/domain/plugin/materialize/ports.d.ts +42 -0
- package/dist/domain/plugin/materialize/ports.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/ports.js +2 -0
- package/dist/domain/plugin/materialize/ports.js.map +1 -0
- package/dist/domain/plugin/materialize/skills.d.ts +12 -0
- package/dist/domain/plugin/materialize/skills.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/skills.js +44 -0
- package/dist/domain/plugin/materialize/skills.js.map +1 -0
- package/dist/domain/plugin/materialize/workflows.d.ts +15 -0
- package/dist/domain/plugin/materialize/workflows.d.ts.map +1 -0
- package/dist/domain/plugin/materialize/workflows.js +31 -0
- package/dist/domain/plugin/materialize/workflows.js.map +1 -0
- package/dist/domain/plugin/members.d.ts +42 -0
- package/dist/domain/plugin/members.d.ts.map +1 -0
- package/dist/domain/plugin/members.js +97 -0
- package/dist/domain/plugin/members.js.map +1 -0
- package/dist/domain/plugin/overlay/documents.d.ts +31 -0
- package/dist/domain/plugin/overlay/documents.d.ts.map +1 -0
- package/dist/domain/plugin/overlay/documents.js +38 -0
- package/dist/domain/plugin/overlay/documents.js.map +1 -0
- package/dist/domain/plugin/overlay/parse.d.ts +16 -0
- package/dist/domain/plugin/overlay/parse.d.ts.map +1 -0
- package/dist/domain/plugin/overlay/parse.js +79 -0
- package/dist/domain/plugin/overlay/parse.js.map +1 -0
- package/dist/domain/plugin/overlay/sanitize.d.ts +10 -0
- package/dist/domain/plugin/overlay/sanitize.d.ts.map +1 -0
- package/dist/domain/plugin/overlay/sanitize.js +103 -0
- package/dist/domain/plugin/overlay/sanitize.js.map +1 -0
- package/dist/domain/plugin/push.d.ts +133 -0
- package/dist/domain/plugin/push.d.ts.map +1 -0
- package/dist/domain/plugin/push.js +800 -0
- package/dist/domain/plugin/push.js.map +1 -0
- package/dist/domain/plugin/search-extractor.d.ts +3 -0
- package/dist/domain/plugin/search-extractor.d.ts.map +1 -0
- package/dist/domain/plugin/search-extractor.js +41 -0
- package/dist/domain/plugin/search-extractor.js.map +1 -0
- package/dist/domain/skill/constants.d.ts +6 -11
- package/dist/domain/skill/constants.d.ts.map +1 -1
- package/dist/domain/skill/constants.js +6 -11
- package/dist/domain/skill/constants.js.map +1 -1
- package/dist/domain/skill/controller.d.ts.map +1 -1
- package/dist/domain/skill/controller.js +33 -30
- package/dist/domain/skill/controller.js.map +1 -1
- package/dist/domain/skill/push.d.ts +9 -10
- package/dist/domain/skill/push.d.ts.map +1 -1
- package/dist/domain/skill/push.js +53 -122
- package/dist/domain/skill/push.js.map +1 -1
- package/dist/domain/skill/search-extractor.d.ts.map +1 -1
- package/dist/domain/skill/search-extractor.js.map +1 -1
- package/dist/domain/skill/storage/artifact-storage.d.ts +26 -29
- package/dist/domain/skill/storage/artifact-storage.d.ts.map +1 -1
- package/dist/domain/skill/storage/artifact-storage.js +6 -103
- package/dist/domain/skill/storage/artifact-storage.js.map +1 -1
- package/dist/domain/skill/storage/zip-gate.d.ts +1 -2
- package/dist/domain/skill/storage/zip-gate.d.ts.map +1 -1
- package/dist/domain/skill/storage/zip-gate.js +56 -126
- package/dist/domain/skill/storage/zip-gate.js.map +1 -1
- package/dist/domain/skill/version-resolution.d.ts +5 -5
- package/dist/domain/skill/version-resolution.d.ts.map +1 -1
- package/dist/domain/skill/version-resolution.js +34 -216
- package/dist/domain/skill/version-resolution.js.map +1 -1
- package/dist/domain/workflow/controller.d.ts.map +1 -1
- package/dist/domain/workflow/controller.js +30 -3
- package/dist/domain/workflow/controller.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +1 -0
- package/dist/domain/workflowexecution/phases.d.ts +21 -0
- package/dist/domain/workflowexecution/phases.d.ts.map +1 -0
- package/dist/domain/workflowexecution/phases.js +31 -0
- package/dist/domain/workflowexecution/phases.js.map +1 -0
- package/dist/extensions/authorizer.d.ts +10 -5
- package/dist/extensions/authorizer.d.ts.map +1 -1
- package/dist/extensions/drivers.d.ts +4 -1
- package/dist/extensions/drivers.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.d.ts +47 -20
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +20 -24
- package/dist/extensions/list-read-scope.js.map +1 -1
- package/dist/extensions/organization-directory.d.ts +13 -9
- package/dist/extensions/organization-directory.d.ts.map +1 -1
- package/dist/extensions/organization-directory.js.map +1 -1
- package/dist/extensions/resource-authorization.d.ts +33 -0
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/extensions/schedule-fire-caller.d.ts +45 -18
- package/dist/extensions/schedule-fire-caller.d.ts.map +1 -1
- package/dist/extensions/schedule-fire-caller.js +12 -1
- package/dist/extensions/schedule-fire-caller.js.map +1 -1
- package/dist/identity/oidc-verifier.js +8 -1
- package/dist/identity/oidc-verifier.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/apiresource-labels.d.ts +23 -3
- package/dist/pipeline/apiresource-labels.d.ts.map +1 -1
- package/dist/pipeline/apiresource-labels.js +20 -0
- package/dist/pipeline/apiresource-labels.js.map +1 -1
- package/dist/pipeline/apiresource-meta.d.ts +15 -0
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +34 -0
- package/dist/pipeline/apiresource-meta.js.map +1 -1
- package/dist/pipeline/errors.d.ts.map +1 -1
- package/dist/pipeline/errors.js.map +1 -1
- package/dist/pipeline/steps/authorization-facts.d.ts +12 -0
- package/dist/pipeline/steps/authorization-facts.d.ts.map +1 -0
- package/dist/pipeline/steps/authorization-facts.js +100 -0
- package/dist/pipeline/steps/authorization-facts.js.map +1 -0
- package/dist/pipeline/steps/delete.d.ts.map +1 -1
- package/dist/pipeline/steps/delete.js +1 -1
- package/dist/pipeline/steps/delete.js.map +1 -1
- package/dist/pipeline/steps/duplicate.d.ts.map +1 -1
- package/dist/pipeline/steps/duplicate.js.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.js +5 -3
- package/dist/pipeline/steps/guard-memory-capture.js.map +1 -1
- package/dist/pipeline/steps/guard-plugin-managed.d.ts +12 -0
- package/dist/pipeline/steps/guard-plugin-managed.d.ts.map +1 -0
- package/dist/pipeline/steps/guard-plugin-managed.js +96 -0
- package/dist/pipeline/steps/guard-plugin-managed.js.map +1 -0
- package/dist/pipeline/steps/guard-reserved-labels.d.ts +16 -2
- package/dist/pipeline/steps/guard-reserved-labels.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-reserved-labels.js +11 -7
- package/dist/pipeline/steps/guard-reserved-labels.js.map +1 -1
- package/dist/pipeline/steps/helpers.d.ts.map +1 -1
- package/dist/pipeline/steps/helpers.js.map +1 -1
- package/dist/pipeline/steps/index-search.d.ts.map +1 -1
- package/dist/pipeline/steps/index-search.js.map +1 -1
- package/dist/pipeline/steps/load-existing.d.ts.map +1 -1
- package/dist/pipeline/steps/load-existing.js +1 -1
- package/dist/pipeline/steps/load-existing.js.map +1 -1
- package/dist/pipeline/steps/references.d.ts +16 -0
- package/dist/pipeline/steps/references.d.ts.map +1 -1
- package/dist/pipeline/steps/references.js +18 -0
- package/dist/pipeline/steps/references.js.map +1 -1
- package/dist/pipeline/steps/resolve-artifact-source.d.ts +35 -0
- package/dist/pipeline/steps/resolve-artifact-source.d.ts.map +1 -0
- package/dist/pipeline/steps/resolve-artifact-source.js +27 -0
- package/dist/pipeline/steps/resolve-artifact-source.js.map +1 -0
- package/dist/pipeline/steps/server-stamped-reserved-labels.d.ts.map +1 -1
- package/dist/pipeline/steps/server-stamped-reserved-labels.js.map +1 -1
- package/dist/pipeline/steps/slug.d.ts.map +1 -1
- package/dist/pipeline/steps/slug.js.map +1 -1
- package/dist/pipeline/steps/validate-visibility.d.ts +9 -0
- package/dist/pipeline/steps/validate-visibility.d.ts.map +1 -1
- package/dist/pipeline/steps/validate-visibility.js +6 -1
- package/dist/pipeline/steps/validate-visibility.js.map +1 -1
- package/dist/pipeline/steps/validation.d.ts.map +1 -1
- package/dist/pipeline/steps/validation.js.map +1 -1
- package/dist/pipeline/steps/version-archive.d.ts +63 -0
- package/dist/pipeline/steps/version-archive.d.ts.map +1 -0
- package/dist/pipeline/steps/version-archive.js +129 -0
- package/dist/pipeline/steps/version-archive.js.map +1 -0
- package/dist/pipeline/steps/version-history.d.ts +49 -0
- package/dist/pipeline/steps/version-history.d.ts.map +1 -0
- package/dist/pipeline/steps/version-history.js +229 -0
- package/dist/pipeline/steps/version-history.js.map +1 -0
- package/dist/pipeline/steps/visibility-gates.d.ts +8 -0
- package/dist/pipeline/steps/visibility-gates.d.ts.map +1 -1
- package/dist/pipeline/steps/visibility-gates.js +7 -2
- package/dist/pipeline/steps/visibility-gates.js.map +1 -1
- package/dist/query/search/registry.d.ts.map +1 -1
- package/dist/query/search/registry.js +2 -0
- package/dist/query/search/registry.js.map +1 -1
- package/dist/runnerauth/bound-execution.d.ts +27 -0
- package/dist/runnerauth/bound-execution.d.ts.map +1 -0
- package/dist/runnerauth/bound-execution.js +137 -0
- package/dist/runnerauth/bound-execution.js.map +1 -0
- package/dist/runnerauth/built-in-runner-credential-provider.d.ts +28 -0
- package/dist/runnerauth/built-in-runner-credential-provider.d.ts.map +1 -0
- package/dist/runnerauth/built-in-runner-credential-provider.js +217 -0
- package/dist/runnerauth/built-in-runner-credential-provider.js.map +1 -0
- package/dist/runnerauth/constants.d.ts +63 -0
- package/dist/runnerauth/constants.d.ts.map +1 -0
- package/dist/runnerauth/constants.js +63 -0
- package/dist/runnerauth/constants.js.map +1 -0
- package/dist/runnerauth/dispatch-credential.d.ts +38 -0
- package/dist/runnerauth/dispatch-credential.d.ts.map +1 -0
- package/dist/runnerauth/dispatch-credential.js +17 -0
- package/dist/runnerauth/dispatch-credential.js.map +1 -0
- package/dist/runnerauth/runner-credential-provider.d.ts +49 -11
- package/dist/runnerauth/runner-credential-provider.d.ts.map +1 -1
- package/dist/runnerauth/runner-credential-provider.js +16 -4
- package/dist/runnerauth/runner-credential-provider.js.map +1 -1
- package/dist/runnerauth/runner-subject-verifier.d.ts +14 -0
- package/dist/runnerauth/runner-subject-verifier.d.ts.map +1 -0
- package/dist/runnerauth/runner-subject-verifier.js +115 -0
- package/dist/runnerauth/runner-subject-verifier.js.map +1 -0
- package/dist/runnerauth/runnerauth.d.ts +33 -4
- package/dist/runnerauth/runnerauth.d.ts.map +1 -1
- package/dist/runnerauth/runnerauth.js +131 -35
- package/dist/runnerauth/runnerauth.js.map +1 -1
- package/dist/temporal/agentexecution/engine-client.d.ts +13 -0
- package/dist/temporal/agentexecution/engine-client.d.ts.map +1 -1
- package/dist/temporal/agentexecution/engine-client.js +10 -2
- package/dist/temporal/agentexecution/engine-client.js.map +1 -1
- package/dist/temporal/agentexecution/workflow-input.d.ts +13 -0
- package/dist/temporal/agentexecution/workflow-input.d.ts.map +1 -1
- package/dist/temporal/agentexecution/workflows/invoke-agent-execution.d.ts.map +1 -1
- package/dist/temporal/agentexecution/workflows/invoke-agent-execution.js +35 -31
- package/dist/temporal/agentexecution/workflows/invoke-agent-execution.js.map +1 -1
- package/dist/temporal/schedule/run-starter.d.ts +1 -1
- package/dist/temporal/schedule/run-starter.d.ts.map +1 -1
- package/dist/temporal/schedule/run-starter.js +14 -1
- package/dist/temporal/schedule/run-starter.js.map +1 -1
- package/dist/temporal/workflowexecution/engine-client.d.ts +24 -0
- package/dist/temporal/workflowexecution/engine-client.d.ts.map +1 -1
- package/dist/temporal/workflowexecution/engine-client.js +26 -19
- package/dist/temporal/workflowexecution/engine-client.js.map +1 -1
- package/dist/temporal/workflowexecution/workflow-input.d.ts +14 -0
- package/dist/temporal/workflowexecution/workflow-input.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/archive/__tests__/archive.test.ts +233 -0
- package/src/{domain/skill → archive}/__tests__/prefilter.test.ts +1 -1
- package/src/archive/content-store.ts +132 -0
- package/src/archive/inflate.ts +107 -0
- package/src/archive/limits.ts +42 -0
- package/src/archive/open.ts +131 -0
- package/src/{domain/skill/storage → archive}/prefilter.ts +5 -0
- package/src/archive/write.ts +54 -0
- package/src/authorization/README.md +124 -0
- package/src/authorization/__tests__/authorizer.test.ts +719 -0
- package/src/authorization/__tests__/derived-tuples.test.ts +802 -0
- package/src/authorization/__tests__/drivers.ts +70 -0
- package/src/authorization/__tests__/evaluator.test.ts +359 -0
- package/src/authorization/__tests__/facts.test.ts +155 -0
- package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +112 -0
- package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +109 -0
- package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +128 -0
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +410 -0
- package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +125 -0
- package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +201 -0
- package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +187 -0
- package/src/authorization/__tests__/fixtures/fga/cross-org-share-creation.fga.yaml +98 -0
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +271 -0
- package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +72 -0
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +328 -0
- package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +144 -0
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +223 -0
- package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +40 -0
- package/src/authorization/__tests__/fixtures/fga/public-visibility-setter.fga.yaml +52 -0
- package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +41 -0
- package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +113 -0
- package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +214 -0
- package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +117 -0
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +192 -0
- package/src/authorization/__tests__/lane-admission.test.ts +115 -0
- package/src/authorization/__tests__/list-read-scope.measure.test.ts +317 -0
- package/src/authorization/__tests__/list-read-scope.test.ts +796 -0
- package/src/authorization/__tests__/organization-directory.test.ts +236 -0
- package/src/authorization/__tests__/person.test.ts +114 -0
- package/src/authorization/__tests__/posture.test.ts +25 -0
- package/src/authorization/__tests__/schedule-fire-caller.test.ts +134 -0
- package/src/authorization/__tests__/store-tests.test.ts +306 -0
- package/src/authorization/__tests__/support.ts +101 -0
- package/src/authorization/__tests__/tuples.test.ts +62 -0
- package/src/authorization/__tests__/wire-permissions.test.ts +154 -0
- package/src/authorization/authorizer.ts +208 -0
- package/src/authorization/derived-tuples.ts +384 -0
- package/src/authorization/evaluator.ts +283 -0
- package/src/authorization/facts.ts +47 -0
- package/src/authorization/lane-admission.ts +73 -0
- package/src/authorization/list-read-scope.ts +216 -0
- package/src/authorization/model/__tests__/registry.test.ts +317 -0
- package/src/authorization/model/agent.ts +64 -0
- package/src/authorization/model/agent_channel.ts +49 -0
- package/src/authorization/model/agent_execution.ts +33 -0
- package/src/authorization/model/agent_instance.ts +66 -0
- package/src/authorization/model/agent_share.ts +40 -0
- package/src/authorization/model/api_key.ts +28 -0
- package/src/authorization/model/artifact.ts +38 -0
- package/src/authorization/model/channel_app.ts +39 -0
- package/src/authorization/model/default-of.ts +99 -0
- package/src/authorization/model/environment.ts +48 -0
- package/src/authorization/model/execution_context.ts +20 -0
- package/src/authorization/model/iam_policy.ts +42 -0
- package/src/authorization/model/identity_account.ts +26 -0
- package/src/authorization/model/index.ts +108 -0
- package/src/authorization/model/mcp_server.ts +59 -0
- package/src/authorization/model/memory.ts +27 -0
- package/src/authorization/model/oauth_app.ts +42 -0
- package/src/authorization/model/organization.ts +55 -0
- package/src/authorization/model/plugin.ts +66 -0
- package/src/authorization/model/project.ts +47 -0
- package/src/authorization/model/rewrite.ts +213 -0
- package/src/authorization/model/schedule.ts +40 -0
- package/src/authorization/model/session.ts +50 -0
- package/src/authorization/model/skill.ts +60 -0
- package/src/authorization/model/workflow.ts +60 -0
- package/src/authorization/model/workflow_execution.ts +44 -0
- package/src/authorization/model/workflow_instance.ts +122 -0
- package/src/authorization/organization-directory.ts +114 -0
- package/src/authorization/person.ts +68 -0
- package/src/authorization/posture.ts +49 -0
- package/src/authorization/schedule-fire-caller.ts +87 -0
- package/src/authorization/store-test-kit.ts +454 -0
- package/src/authorization/tuples.ts +190 -0
- package/src/boot/compose.ts +246 -52
- package/src/boot/inprocess.ts +115 -31
- package/src/domain/agent/controller.ts +11 -0
- package/src/domain/executioncontext/__tests__/executioncontext.test.ts +104 -0
- package/src/domain/executioncontext/__tests__/resolve-values-capability.test.ts +33 -4
- package/src/domain/executioncontext/resolve-values-for-caller.ts +79 -22
- package/src/domain/iampolicy/__tests__/membership.test.ts +357 -3
- package/src/domain/iampolicy/constants.ts +12 -0
- package/src/domain/iampolicy/membership.ts +221 -66
- package/src/domain/identityaccount/__tests__/account-for-stamp.test.ts +111 -0
- package/src/domain/identityaccount/actor.ts +84 -0
- package/src/domain/identityaccount/resolve.ts +31 -0
- package/src/domain/mcpserver/__tests__/connect.test.ts +17 -2
- package/src/domain/mcpserver/connect-execution-id.ts +34 -0
- package/src/domain/mcpserver/connect.ts +38 -3
- package/src/domain/mcpserver/controller.ts +11 -0
- package/src/domain/mcpserver/engine.ts +9 -3
- package/src/domain/mcpserver/start-connect.ts +1 -1
- package/src/domain/platform/controller.ts +24 -11
- package/src/domain/plugin/__tests__/materialize.test.ts +303 -0
- package/src/domain/plugin/__tests__/overlay-parse.test.ts +85 -0
- package/src/domain/plugin/__tests__/plugin.test.ts +796 -0
- package/src/domain/plugin/__tests__/sanitize.test.ts +174 -0
- package/src/domain/plugin/archive.ts +89 -0
- package/src/domain/plugin/constants.ts +53 -0
- package/src/domain/plugin/controller.ts +913 -0
- package/src/domain/plugin/materialize/agent.ts +186 -0
- package/src/domain/plugin/materialize/default-agent-instructions.ts +59 -0
- package/src/domain/plugin/materialize/identity.ts +67 -0
- package/src/domain/plugin/materialize/mcp-servers.ts +175 -0
- package/src/domain/plugin/materialize/plan.ts +124 -0
- package/src/domain/plugin/materialize/ports.ts +53 -0
- package/src/domain/plugin/materialize/skills.ts +68 -0
- package/src/domain/plugin/materialize/workflows.ts +51 -0
- package/src/domain/plugin/members.ts +180 -0
- package/src/domain/plugin/overlay/documents.ts +78 -0
- package/src/domain/plugin/overlay/parse.ts +115 -0
- package/src/domain/plugin/overlay/sanitize.ts +151 -0
- package/src/domain/plugin/push.ts +1062 -0
- package/src/domain/plugin/search-extractor.ts +60 -0
- package/src/domain/skill/constants.ts +11 -14
- package/src/domain/skill/controller.ts +44 -36
- package/src/domain/skill/push.ts +61 -156
- package/src/domain/skill/search-extractor.ts +3 -1
- package/src/domain/skill/storage/artifact-storage.ts +23 -124
- package/src/domain/skill/storage/zip-gate.ts +58 -154
- package/src/domain/skill/version-resolution.ts +67 -269
- package/src/domain/workflow/controller.ts +38 -4
- package/src/domain/workflow/registry/data/task-kind-registry.json +1 -0
- package/src/domain/workflowexecution/__tests__/phases.test.ts +58 -0
- package/src/domain/workflowexecution/phases.ts +33 -0
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +835 -0
- package/src/extensions/__tests__/composed-support.ts +32 -1
- package/src/extensions/__tests__/extension-composition.test.ts +42 -1
- package/src/extensions/__tests__/list-read-scope.test.ts +137 -33
- package/src/extensions/__tests__/role-reconciliation-composed.test.ts +209 -0
- package/src/extensions/__tests__/tier-truthfulness.test.ts +6 -14
- package/src/extensions/authorizer.ts +10 -5
- package/src/extensions/drivers.ts +4 -1
- package/src/extensions/list-read-scope.ts +67 -45
- package/src/extensions/organization-directory.ts +13 -9
- package/src/extensions/resource-authorization.ts +34 -0
- package/src/extensions/schedule-fire-caller.ts +49 -18
- package/src/identity/__tests__/oidc-verifier.test.ts +22 -0
- package/src/identity/oidc-verifier.ts +8 -1
- package/src/index.ts +51 -1
- package/src/pipeline/__tests__/kind-by-id-prefix.test.ts +75 -0
- package/src/pipeline/__tests__/router-transport.test.ts +1 -3
- package/src/pipeline/apiresource-labels.ts +31 -3
- package/src/pipeline/apiresource-meta.ts +41 -0
- package/src/pipeline/errors.ts +5 -5
- package/src/pipeline/steps/__tests__/authorize-annotation-completeness.test.ts +1 -20
- package/src/pipeline/steps/__tests__/guard-memory-capture.test.ts +58 -44
- package/src/pipeline/steps/__tests__/guard-plugin-managed.test.ts +151 -0
- package/src/pipeline/steps/__tests__/guard-reserved-labels.test.ts +83 -8
- package/src/pipeline/steps/authorization-facts.ts +131 -0
- package/src/pipeline/steps/delete.ts +11 -3
- package/src/pipeline/steps/duplicate.ts +8 -2
- package/src/pipeline/steps/guard-memory-capture.ts +5 -3
- package/src/pipeline/steps/guard-plugin-managed.ts +133 -0
- package/src/pipeline/steps/guard-reserved-labels.ts +29 -8
- package/src/pipeline/steps/helpers.ts +4 -1
- package/src/pipeline/steps/index-search.ts +28 -15
- package/src/pipeline/steps/load-existing.ts +12 -3
- package/src/pipeline/steps/references.ts +36 -2
- package/src/pipeline/steps/resolve-artifact-source.ts +66 -0
- package/src/pipeline/steps/server-stamped-reserved-labels.ts +2 -1
- package/src/pipeline/steps/slug.ts +7 -2
- package/src/pipeline/steps/validate-visibility.ts +9 -2
- package/src/pipeline/steps/validation.ts +3 -1
- package/src/pipeline/steps/version-archive.ts +225 -0
- package/src/pipeline/steps/version-history.ts +362 -0
- package/src/pipeline/steps/visibility-gates.ts +12 -9
- package/src/query/README.md +1 -1
- package/src/query/search/__tests__/criteria.test.ts +6 -7
- package/src/query/search/__tests__/query-store.test.ts +9 -2
- package/src/query/search/__tests__/registry.test.ts +6 -4
- package/src/query/search/registry.ts +6 -1
- package/src/runnerauth/__tests__/bound-execution.test.ts +334 -0
- package/src/runnerauth/__tests__/built-in-runner-credential-provider.test.ts +516 -0
- package/src/runnerauth/__tests__/dispatch-credential.test.ts +94 -0
- package/src/runnerauth/__tests__/runner-credential-provider.test.ts +27 -0
- package/src/runnerauth/__tests__/runner-subject-composed.test.ts +497 -0
- package/src/runnerauth/__tests__/runner-subject-verifier.test.ts +541 -0
- package/src/runnerauth/bound-execution.ts +270 -0
- package/src/runnerauth/built-in-runner-credential-provider.ts +300 -0
- package/src/runnerauth/constants.ts +74 -0
- package/src/runnerauth/dispatch-credential.ts +63 -0
- package/src/runnerauth/runner-credential-provider.ts +60 -11
- package/src/runnerauth/runner-subject-verifier.ts +152 -0
- package/src/runnerauth/runnerauth.ts +148 -38
- package/src/temporal/agentexecution/__tests__/engine-client.test.ts +107 -38
- package/src/temporal/agentexecution/__tests__/invoke-workflow.test.ts +105 -2
- package/src/temporal/agentexecution/engine-client.ts +27 -2
- package/src/temporal/agentexecution/workflow-input.ts +13 -0
- package/src/temporal/agentexecution/workflows/invoke-agent-execution.ts +90 -44
- package/src/temporal/schedule/__tests__/run-starter.test.ts +86 -24
- package/src/temporal/schedule/run-starter.ts +31 -8
- package/src/temporal/workflowexecution/__tests__/engine-client.test.ts +139 -33
- package/src/temporal/workflowexecution/engine-client.ts +48 -21
- package/src/temporal/workflowexecution/workflow-input.ts +14 -0
- package/dist/domain/skill/storage/prefilter.d.ts.map +0 -1
- package/dist/domain/skill/storage/prefilter.js.map +0 -1
- /package/dist/{domain/skill/storage → archive}/prefilter.js +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent from a plugin — materialised only when the plugin carries
|
|
3
|
+
* something agent-like: a skill, a sub-agent file, or an
|
|
4
|
+
* `ai.stigmer/agent.yaml`. An MCP-only plugin becomes its servers and no
|
|
5
|
+
* agent (the "a plugin is a toolbox, an agent is the worker" rule): most
|
|
6
|
+
* plugins in the wild are one server and one token, and five thin agents
|
|
7
|
+
* nobody runs would be the plugin-versus-agent confusion this kind exists
|
|
8
|
+
* to remove.
|
|
9
|
+
*
|
|
10
|
+
* Two sources, never mixed: the author's `agent.yaml` wholesale when
|
|
11
|
+
* present (its references still resolve in the agent chain's
|
|
12
|
+
* ValidateReferences), otherwise the composed default — instructions from
|
|
13
|
+
* the versioned template, every skill as a `skill_ref`, every server as an
|
|
14
|
+
* `mcp_server_usage`, every `agents/*.md` as a `sub_agent` with access to
|
|
15
|
+
* all the plugin's servers and the skills it asked for.
|
|
16
|
+
*
|
|
17
|
+
* Model hints are recorded, never applied: a dialect's `model` becomes a
|
|
18
|
+
* status warning and the sub-agent runs on the session's model. The
|
|
19
|
+
* catalog seam exposes neither family nor cost tier, the runner drops a
|
|
20
|
+
* sub-agent whose override it cannot resolve, and pinning a model the user
|
|
21
|
+
* did not choose has cost consequences; a later catalog seam can change
|
|
22
|
+
* this in one place. A sub-agent named like a runner built-in is recorded
|
|
23
|
+
* the same way: the runner warns and continues, so the install does too.
|
|
24
|
+
*/
|
|
25
|
+
import { create } from "@bufbuild/protobuf";
|
|
26
|
+
|
|
27
|
+
import type { PluginPackage, PluginSubAgent } from "@stigmer/plugin-package";
|
|
28
|
+
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
29
|
+
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
30
|
+
import {
|
|
31
|
+
AgentSpecSchema,
|
|
32
|
+
McpAccessSchema,
|
|
33
|
+
McpServerUsageSchema,
|
|
34
|
+
SubAgentSchema,
|
|
35
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
36
|
+
import type { SubAgent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
37
|
+
import { PluginWarningSchema } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/status_pb";
|
|
38
|
+
import type { PluginWarning } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/status_pb";
|
|
39
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
40
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
41
|
+
|
|
42
|
+
import {
|
|
43
|
+
BUILT_IN_SUB_AGENT_NAMES,
|
|
44
|
+
SERVER_WARNING_KINDS,
|
|
45
|
+
} from "../constants.js";
|
|
46
|
+
import { renderDefaultAgentInstructions } from "./default-agent-instructions.js";
|
|
47
|
+
import { memberMetadata } from "./identity.js";
|
|
48
|
+
import type { PluginIdentity } from "./identity.js";
|
|
49
|
+
import { mcpServerSlugOf } from "./mcp-servers.js";
|
|
50
|
+
import { skillSlugOf } from "./skills.js";
|
|
51
|
+
|
|
52
|
+
export interface PlannedAgent {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly slug: string;
|
|
55
|
+
readonly resource: Agent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Whether the plugin materialises an agent at all. */
|
|
59
|
+
export function carriesAgent(plugin: PluginPackage): boolean {
|
|
60
|
+
return (
|
|
61
|
+
plugin.skills.length > 0 ||
|
|
62
|
+
plugin.subAgents.length > 0 ||
|
|
63
|
+
plugin.overlay.agent !== undefined
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function planAgent(
|
|
68
|
+
plugin: PluginPackage,
|
|
69
|
+
overlayAgent: Agent | undefined,
|
|
70
|
+
identity: PluginIdentity,
|
|
71
|
+
warnings: PluginWarning[],
|
|
72
|
+
): PlannedAgent | undefined {
|
|
73
|
+
if (!carriesAgent(plugin)) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const member = { name: identity.name, slug: identity.slug };
|
|
77
|
+
|
|
78
|
+
if (overlayAgent !== undefined) {
|
|
79
|
+
return {
|
|
80
|
+
...member,
|
|
81
|
+
resource: create(AgentSchema, {
|
|
82
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
83
|
+
kind: "Agent",
|
|
84
|
+
metadata: memberMetadata(identity, member, overlayAgent.metadata),
|
|
85
|
+
spec: overlayAgent.spec,
|
|
86
|
+
}),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const serverSlugs = plugin.mcpServers.map(mcpServerSlugOf);
|
|
91
|
+
const skillSlugByName = new Map(
|
|
92
|
+
plugin.skills.map((skill) => [skill.name, skillSlugOf(skill)]),
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const spec = create(AgentSpecSchema, {
|
|
96
|
+
description: plugin.description ?? "",
|
|
97
|
+
instructions: renderDefaultAgentInstructions(plugin),
|
|
98
|
+
skillRefs: [...skillSlugByName.values()].map((slug) =>
|
|
99
|
+
create(ApiResourceReferenceSchema, {
|
|
100
|
+
org: identity.org,
|
|
101
|
+
kind: ApiResourceKind.skill,
|
|
102
|
+
slug,
|
|
103
|
+
}),
|
|
104
|
+
),
|
|
105
|
+
mcpServerUsages: serverSlugs.map((slug) =>
|
|
106
|
+
create(McpServerUsageSchema, {
|
|
107
|
+
mcpServerRef: create(ApiResourceReferenceSchema, {
|
|
108
|
+
org: identity.org,
|
|
109
|
+
kind: ApiResourceKind.mcp_server,
|
|
110
|
+
slug,
|
|
111
|
+
}),
|
|
112
|
+
}),
|
|
113
|
+
),
|
|
114
|
+
subAgents: plugin.subAgents.map((subAgent) =>
|
|
115
|
+
planSubAgent(subAgent, identity, serverSlugs, skillSlugByName, warnings),
|
|
116
|
+
),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
...member,
|
|
121
|
+
resource: create(AgentSchema, {
|
|
122
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
123
|
+
kind: "Agent",
|
|
124
|
+
metadata: memberMetadata(identity, member),
|
|
125
|
+
spec,
|
|
126
|
+
}),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function planSubAgent(
|
|
131
|
+
subAgent: PluginSubAgent,
|
|
132
|
+
identity: PluginIdentity,
|
|
133
|
+
serverSlugs: readonly string[],
|
|
134
|
+
skillSlugByName: ReadonlyMap<string, string>,
|
|
135
|
+
warnings: PluginWarning[],
|
|
136
|
+
): SubAgent {
|
|
137
|
+
if (BUILT_IN_SUB_AGENT_NAMES.has(subAgent.name)) {
|
|
138
|
+
warnings.push(
|
|
139
|
+
create(PluginWarningSchema, {
|
|
140
|
+
kind: SERVER_WARNING_KINDS.subAgentNameBuiltin,
|
|
141
|
+
path: subAgent.path,
|
|
142
|
+
message:
|
|
143
|
+
`sub-agent '${subAgent.name}' shares its name with a built-in sub-agent; ` +
|
|
144
|
+
"the runner warns and runs the plugin's",
|
|
145
|
+
}),
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
const hint = subAgent.modelHint;
|
|
149
|
+
if (
|
|
150
|
+
hint !== undefined &&
|
|
151
|
+
hint.alias !== "inherit" &&
|
|
152
|
+
hint.alias !== "unknown"
|
|
153
|
+
) {
|
|
154
|
+
// An unknown alias already carries the library's own sentence.
|
|
155
|
+
warnings.push(
|
|
156
|
+
create(PluginWarningSchema, {
|
|
157
|
+
kind: SERVER_WARNING_KINDS.modelHintUnresolved,
|
|
158
|
+
path: subAgent.path,
|
|
159
|
+
message:
|
|
160
|
+
`sub-agent '${subAgent.name}' names model '${hint.raw}'; Stigmer does not pin a model ` +
|
|
161
|
+
"from a plugin, so it runs on the session's model",
|
|
162
|
+
}),
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return create(SubAgentSchema, {
|
|
166
|
+
name: subAgent.name,
|
|
167
|
+
description: subAgent.description ?? "",
|
|
168
|
+
instructions: subAgent.instructions,
|
|
169
|
+
mcpAccess: serverSlugs.map((slug) =>
|
|
170
|
+
create(McpAccessSchema, { mcpServer: slug }),
|
|
171
|
+
),
|
|
172
|
+
skillRefs: subAgent.skillNames.flatMap((name) => {
|
|
173
|
+
const slug = skillSlugByName.get(name);
|
|
174
|
+
// An unknown skill name already carries the library's own warning.
|
|
175
|
+
return slug === undefined
|
|
176
|
+
? []
|
|
177
|
+
: [
|
|
178
|
+
create(ApiResourceReferenceSchema, {
|
|
179
|
+
org: identity.org,
|
|
180
|
+
kind: ApiResourceKind.skill,
|
|
181
|
+
slug,
|
|
182
|
+
}),
|
|
183
|
+
];
|
|
184
|
+
}),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system prompt of a plugin's composed agent — the agent Stigmer
|
|
3
|
+
* materialises when a plugin carries skills or sub-agents but no
|
|
4
|
+
* `ai.stigmer/agent.yaml` of its own. A prompt is code: this module is its
|
|
5
|
+
* one home, it is versioned so a later change to the wording is a visible
|
|
6
|
+
* behaviour change with a number, and its rendering is pinned by a snapshot
|
|
7
|
+
* test. Nothing here reaches the runner; the text becomes
|
|
8
|
+
* `AgentSpec.instructions` and the runner composes it with the mounted
|
|
9
|
+
* skills like any other agent's.
|
|
10
|
+
*
|
|
11
|
+
* Design: the template names the plugin, lists what it carries, and gives
|
|
12
|
+
* three standing instructions (read the skill before acting, use the tools
|
|
13
|
+
* it names, report what was and was not done). Deliberately short: skills
|
|
14
|
+
* carry the real knowledge, and a long composed prompt would compete with
|
|
15
|
+
* them for the model's attention.
|
|
16
|
+
*/
|
|
17
|
+
import type { PluginPackage } from "@stigmer/plugin-package";
|
|
18
|
+
|
|
19
|
+
/** Bumped whenever the rendered text changes; the snapshot test pins the pair. */
|
|
20
|
+
export const DEFAULT_AGENT_INSTRUCTIONS_VERSION = 1;
|
|
21
|
+
|
|
22
|
+
/** Renders the composed agent's instructions for a plugin. */
|
|
23
|
+
export function renderDefaultAgentInstructions(plugin: PluginPackage): string {
|
|
24
|
+
const lines: string[] = [];
|
|
25
|
+
const description = plugin.description?.trim() ?? "";
|
|
26
|
+
lines.push(
|
|
27
|
+
description === ""
|
|
28
|
+
? `You are ${plugin.name}, an agent installed from the ${plugin.name} plugin.`
|
|
29
|
+
: `You are ${plugin.name}: ${description}`,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
if (plugin.skills.length > 0) {
|
|
33
|
+
lines.push("");
|
|
34
|
+
lines.push("Your skills:");
|
|
35
|
+
for (const skill of plugin.skills) {
|
|
36
|
+
const summary = skill.description?.trim() ?? "";
|
|
37
|
+
lines.push(
|
|
38
|
+
summary === "" ? `- ${skill.name}` : `- ${skill.name}: ${summary}`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (plugin.mcpServers.length > 0) {
|
|
44
|
+
lines.push("");
|
|
45
|
+
lines.push("Your tools come from these MCP servers:");
|
|
46
|
+
for (const server of plugin.mcpServers) {
|
|
47
|
+
lines.push(`- ${server.name}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
lines.push("");
|
|
52
|
+
lines.push(
|
|
53
|
+
"Before acting on a task a skill covers, read that skill and follow it. " +
|
|
54
|
+
"Use the tools your servers provide rather than guessing at their results. " +
|
|
55
|
+
"When you finish, state what you did and what you could not do.",
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return lines.join("\n");
|
|
59
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What every member of a plugin inherits from the plugin: the
|
|
3
|
+
* organization, the two reserved labels (the plugin's id for membership,
|
|
4
|
+
* the archive digest for convergence) and the visibility. One function
|
|
5
|
+
* stamps a child's metadata so the four materialisers cannot disagree on
|
|
6
|
+
* how a member is marked, and one type carries the plugin's identity into
|
|
7
|
+
* them so none reaches back into the head.
|
|
8
|
+
*/
|
|
9
|
+
import { create } from "@bufbuild/protobuf";
|
|
10
|
+
|
|
11
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
12
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
13
|
+
import type { ApiResourceMetadata } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
PLUGIN_LABEL,
|
|
17
|
+
PLUGIN_VERSION_LABEL,
|
|
18
|
+
} from "../../../pipeline/apiresource-labels.js";
|
|
19
|
+
|
|
20
|
+
/** The plugin, as its members see it. */
|
|
21
|
+
export interface PluginIdentity {
|
|
22
|
+
readonly org: string;
|
|
23
|
+
/** The plugin's resource id — the membership label's value. */
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly slug: string;
|
|
26
|
+
readonly name: string;
|
|
27
|
+
/** The archive digest — the convergence label's value. */
|
|
28
|
+
readonly digest: string;
|
|
29
|
+
/** The level every member takes; unspecified means the child kind's default. */
|
|
30
|
+
readonly visibility: ApiResourceVisibility;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The two labels a member carries, and nothing else the plugin owns. */
|
|
34
|
+
export function memberLabels(identity: PluginIdentity): Record<string, string> {
|
|
35
|
+
return {
|
|
36
|
+
[PLUGIN_LABEL]: identity.id,
|
|
37
|
+
[PLUGIN_VERSION_LABEL]: identity.digest,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A member's metadata: the plugin's org and visibility, the member's own
|
|
43
|
+
* name and slug, the plugin's labels merged OVER any the overlay author
|
|
44
|
+
* wrote (an author may label their agent; they may not claim membership of
|
|
45
|
+
* another plugin, and the sanitiser has already refused every reserved key
|
|
46
|
+
* an author tried).
|
|
47
|
+
*/
|
|
48
|
+
export function memberMetadata(
|
|
49
|
+
identity: PluginIdentity,
|
|
50
|
+
member: { readonly name: string; readonly slug: string },
|
|
51
|
+
authored?: ApiResourceMetadata,
|
|
52
|
+
): ApiResourceMetadata {
|
|
53
|
+
const metadata =
|
|
54
|
+
authored === undefined ? create(ApiResourceMetadataSchema, {}) : authored;
|
|
55
|
+
metadata.org = identity.org;
|
|
56
|
+
metadata.name = member.name;
|
|
57
|
+
metadata.slug = member.slug;
|
|
58
|
+
metadata.id = "";
|
|
59
|
+
if (
|
|
60
|
+
identity.visibility !==
|
|
61
|
+
ApiResourceVisibility.api_resource_visibility_unspecified
|
|
62
|
+
) {
|
|
63
|
+
metadata.visibility = identity.visibility;
|
|
64
|
+
}
|
|
65
|
+
metadata.labels = { ...metadata.labels, ...memberLabels(identity) };
|
|
66
|
+
return metadata;
|
|
67
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP servers from a plugin: one `McpServer` per `mcpServers` entry of the
|
|
3
|
+
* portable `mcp.json`, layered with the plugin's Stigmer overlay for that
|
|
4
|
+
* server when the author wrote one (`ai.stigmer/mcp-servers/<name>.yaml`).
|
|
5
|
+
*
|
|
6
|
+
* The portable file owns what every client reads: the transport (`http`
|
|
7
|
+
* url and headers, or `stdio` command and args) and the variables the
|
|
8
|
+
* server references, which become `EnvVarDeclaration`s the runner resolves
|
|
9
|
+
* from the user's Environment. The overlay owns what only Stigmer reads:
|
|
10
|
+
* OAuth (`auth`), scope hints, default and pinned tools, the icon, tags,
|
|
11
|
+
* the repository link, and a richer description. An overlay that sets the
|
|
12
|
+
* transport or declares env is refused: the portable file is the one home
|
|
13
|
+
* of both, so a Cursor or Claude user installing the same plugin sees the
|
|
14
|
+
* same server.
|
|
15
|
+
*
|
|
16
|
+
* The server's name is the `mcpServers` key and its slug `generateSlug`
|
|
17
|
+
* of it (the platform's one slug rule: lowercase, dots and spaces to
|
|
18
|
+
* hyphens, every other symbol dropped, so `my_server` becomes `myserver`);
|
|
19
|
+
* sub-agents and the agent's usages reference the slug.
|
|
20
|
+
*/
|
|
21
|
+
import { create } from "@bufbuild/protobuf";
|
|
22
|
+
|
|
23
|
+
import type { PluginMcpServer, PluginPackage } from "@stigmer/plugin-package";
|
|
24
|
+
import { EnvVarDeclarationSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
25
|
+
import type { EnvVarDeclaration } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
26
|
+
import { McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
27
|
+
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
28
|
+
import {
|
|
29
|
+
HttpServerConfigSchema,
|
|
30
|
+
McpServerSpecSchema,
|
|
31
|
+
StdioServerConfigSchema,
|
|
32
|
+
} from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/spec_pb";
|
|
33
|
+
import type { McpServerSpec } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/spec_pb";
|
|
34
|
+
|
|
35
|
+
import { generateSlug } from "../../../pipeline/steps/slug.js";
|
|
36
|
+
import { memberMetadata } from "./identity.js";
|
|
37
|
+
import type { PluginIdentity } from "./identity.js";
|
|
38
|
+
|
|
39
|
+
export interface PlannedMcpServer {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly slug: string;
|
|
42
|
+
readonly resource: McpServer;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** A refused overlay, phrased for the author. */
|
|
46
|
+
export class McpServerOverlayError extends Error {
|
|
47
|
+
constructor(server: string, reason: string) {
|
|
48
|
+
super(`overlay for MCP server '${server}': ${reason}`);
|
|
49
|
+
this.name = "McpServerOverlayError";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function mcpServerSlugOf(server: PluginMcpServer): string {
|
|
54
|
+
return generateSlug(server.name);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function planMcpServers(
|
|
58
|
+
plugin: PluginPackage,
|
|
59
|
+
overlays: ReadonlyMap<string, McpServer>,
|
|
60
|
+
identity: PluginIdentity,
|
|
61
|
+
): PlannedMcpServer[] {
|
|
62
|
+
const env = declaredVariables(plugin);
|
|
63
|
+
return plugin.mcpServers.map((server) => {
|
|
64
|
+
const overlay = overlays.get(server.name);
|
|
65
|
+
const spec = create(McpServerSpecSchema, {
|
|
66
|
+
description: plugin.description ?? "",
|
|
67
|
+
env: Object.fromEntries(
|
|
68
|
+
server.env.map((name) => [name, env.get(name) ?? inferredSecret()]),
|
|
69
|
+
),
|
|
70
|
+
});
|
|
71
|
+
switch (server.transport) {
|
|
72
|
+
case "http":
|
|
73
|
+
spec.serverType = {
|
|
74
|
+
case: "http",
|
|
75
|
+
value: create(HttpServerConfigSchema, {
|
|
76
|
+
url: server.url,
|
|
77
|
+
headers: { ...server.headers },
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
break;
|
|
81
|
+
case "stdio":
|
|
82
|
+
spec.serverType = {
|
|
83
|
+
case: "stdio",
|
|
84
|
+
value: create(StdioServerConfigSchema, {
|
|
85
|
+
command: server.command,
|
|
86
|
+
args: [...server.args],
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
break;
|
|
90
|
+
default: {
|
|
91
|
+
const exhaustive: never = server;
|
|
92
|
+
throw new Error(`unknown transport ${JSON.stringify(exhaustive)}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (overlay !== undefined) {
|
|
97
|
+
layerOverlay(server.name, spec, overlay);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const slug = mcpServerSlugOf(server);
|
|
101
|
+
return {
|
|
102
|
+
name: server.name,
|
|
103
|
+
slug,
|
|
104
|
+
resource: create(McpServerSchema, {
|
|
105
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
106
|
+
kind: "McpServer",
|
|
107
|
+
metadata: memberMetadata(
|
|
108
|
+
identity,
|
|
109
|
+
{ name: server.name, slug },
|
|
110
|
+
overlay?.metadata,
|
|
111
|
+
),
|
|
112
|
+
spec,
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Every declared variable, by name, as the runner's declaration shape. */
|
|
119
|
+
function declaredVariables(
|
|
120
|
+
plugin: PluginPackage,
|
|
121
|
+
): Map<string, EnvVarDeclaration> {
|
|
122
|
+
return new Map(
|
|
123
|
+
plugin.variables.map((variable) => [
|
|
124
|
+
variable.name,
|
|
125
|
+
create(EnvVarDeclarationSchema, {
|
|
126
|
+
isSecret: variable.isSecret,
|
|
127
|
+
description: variable.description ?? "",
|
|
128
|
+
optional: variable.optional,
|
|
129
|
+
}),
|
|
130
|
+
]),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A reference the library did not declare cannot happen — it infers every
|
|
136
|
+
* undeclared `${VAR}` as a required secret — so this arm is the honest
|
|
137
|
+
* default for a name the declaration list somehow lacks.
|
|
138
|
+
*/
|
|
139
|
+
function inferredSecret(): EnvVarDeclaration {
|
|
140
|
+
return create(EnvVarDeclarationSchema, { isSecret: true, optional: false });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** The overlay's Stigmer-only fields over the portable spec; the portable owner's fields stay. */
|
|
144
|
+
function layerOverlay(
|
|
145
|
+
serverName: string,
|
|
146
|
+
spec: McpServerSpec,
|
|
147
|
+
overlay: McpServer,
|
|
148
|
+
): void {
|
|
149
|
+
const authored = overlay.spec;
|
|
150
|
+
if (authored === undefined) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (authored.serverType.case !== undefined) {
|
|
154
|
+
throw new McpServerOverlayError(
|
|
155
|
+
serverName,
|
|
156
|
+
"the transport (http or stdio) lives in mcp.json, where every client reads it; the overlay may not redefine it",
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
if (Object.keys(authored.env).length > 0) {
|
|
160
|
+
throw new McpServerOverlayError(
|
|
161
|
+
serverName,
|
|
162
|
+
"variables are declared where mcp.json references them (the plugin's variables or userConfig); the overlay may not declare env",
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
if (authored.description !== "") spec.description = authored.description;
|
|
166
|
+
if (authored.iconUrl !== "") spec.iconUrl = authored.iconUrl;
|
|
167
|
+
if (authored.tags.length > 0) spec.tags = [...authored.tags];
|
|
168
|
+
if (authored.defaultEnabledTools.length > 0)
|
|
169
|
+
spec.defaultEnabledTools = [...authored.defaultEnabledTools];
|
|
170
|
+
if (authored.pinnedToolApprovals.length > 0)
|
|
171
|
+
spec.pinnedToolApprovals = [...authored.pinnedToolApprovals];
|
|
172
|
+
if (authored.repositoryUrl !== "")
|
|
173
|
+
spec.repositoryUrl = authored.repositoryUrl;
|
|
174
|
+
if (authored.auth !== undefined) spec.auth = authored.auth;
|
|
175
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The materialisation plan: everything a push will write, computed before
|
|
3
|
+
* anything is written. One pure function turns the library's description
|
|
4
|
+
* of the package, the parsed overlay and the plugin's identity into the
|
|
5
|
+
* four planned member sets plus the warnings the plan itself raised, so
|
|
6
|
+
* the push step can check every slug against the organization, pre-
|
|
7
|
+
* authorise the caller for every child kind, and decide whether the
|
|
8
|
+
* members already converge — all before the first in-process call.
|
|
9
|
+
*
|
|
10
|
+
* Warnings collected here join the library's in `PluginStatus.warnings`:
|
|
11
|
+
* every ignored component (recorded once per component, as the library
|
|
12
|
+
* records it), each unapplied model hint, each built-in name shadowed, and
|
|
13
|
+
* a manifest version the tag pattern rejects.
|
|
14
|
+
*/
|
|
15
|
+
import { create } from "@bufbuild/protobuf";
|
|
16
|
+
|
|
17
|
+
import type { PluginFiles, PluginPackage } from "@stigmer/plugin-package";
|
|
18
|
+
import { PluginWarningSchema } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/status_pb";
|
|
19
|
+
import type { PluginWarning } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/status_pb";
|
|
20
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
21
|
+
|
|
22
|
+
import { SERVER_WARNING_KINDS, VERSION_TAG_PATTERN } from "../constants.js";
|
|
23
|
+
import type { PlannedMember } from "../members.js";
|
|
24
|
+
import type { ParsedOverlays } from "../overlay/documents.js";
|
|
25
|
+
import { planAgent } from "./agent.js";
|
|
26
|
+
import type { PlannedAgent } from "./agent.js";
|
|
27
|
+
import type { PluginIdentity } from "./identity.js";
|
|
28
|
+
import { planMcpServers } from "./mcp-servers.js";
|
|
29
|
+
import type { PlannedMcpServer } from "./mcp-servers.js";
|
|
30
|
+
import { planSkills } from "./skills.js";
|
|
31
|
+
import type { PlannedSkill } from "./skills.js";
|
|
32
|
+
import { planWorkflows } from "./workflows.js";
|
|
33
|
+
import type { PlannedWorkflow } from "./workflows.js";
|
|
34
|
+
|
|
35
|
+
export interface MaterializationPlan {
|
|
36
|
+
readonly skills: readonly PlannedSkill[];
|
|
37
|
+
readonly mcpServers: readonly PlannedMcpServer[];
|
|
38
|
+
readonly agent: PlannedAgent | undefined;
|
|
39
|
+
readonly workflows: readonly PlannedWorkflow[];
|
|
40
|
+
/** Every member the push intends, in materialisation order. */
|
|
41
|
+
readonly members: readonly PlannedMember[];
|
|
42
|
+
/** The audit tag this push assigns; empty when the version does not fit. */
|
|
43
|
+
readonly tag: string;
|
|
44
|
+
readonly warnings: readonly PluginWarning[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The manifest version as a tag, or empty with a warning when it cannot be one. */
|
|
48
|
+
export function versionTag(
|
|
49
|
+
version: string | undefined,
|
|
50
|
+
warnings: PluginWarning[],
|
|
51
|
+
): string {
|
|
52
|
+
if (version === undefined || version === "") {
|
|
53
|
+
return "";
|
|
54
|
+
}
|
|
55
|
+
if (VERSION_TAG_PATTERN.test(version)) {
|
|
56
|
+
return version;
|
|
57
|
+
}
|
|
58
|
+
warnings.push(
|
|
59
|
+
create(PluginWarningSchema, {
|
|
60
|
+
kind: SERVER_WARNING_KINDS.versionNotTaggable,
|
|
61
|
+
message:
|
|
62
|
+
`version '${version}' cannot be a tag (letters, digits, '.', '_' and '-' only); ` +
|
|
63
|
+
"this version is reachable by its digest but not by name",
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function planMaterialization(
|
|
70
|
+
plugin: PluginPackage,
|
|
71
|
+
files: PluginFiles,
|
|
72
|
+
overlays: ParsedOverlays,
|
|
73
|
+
identity: PluginIdentity,
|
|
74
|
+
message: string,
|
|
75
|
+
): MaterializationPlan {
|
|
76
|
+
const warnings: PluginWarning[] = [];
|
|
77
|
+
for (const ignored of plugin.ignored) {
|
|
78
|
+
warnings.push(
|
|
79
|
+
create(PluginWarningSchema, {
|
|
80
|
+
kind: SERVER_WARNING_KINDS.componentIgnored,
|
|
81
|
+
path: ignored.path,
|
|
82
|
+
message: `${ignored.kind} at '${ignored.path}' is not installed; Stigmer reads skills, MCP servers, sub-agents and the ai.stigmer/ overlay`,
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
const tag = versionTag(plugin.version, warnings);
|
|
87
|
+
|
|
88
|
+
const skills = planSkills(plugin, files, identity, tag, message);
|
|
89
|
+
const mcpServers = planMcpServers(
|
|
90
|
+
plugin,
|
|
91
|
+
new Map(
|
|
92
|
+
overlays.mcpServers.map((document) => [
|
|
93
|
+
document.server,
|
|
94
|
+
document.resource,
|
|
95
|
+
]),
|
|
96
|
+
),
|
|
97
|
+
identity,
|
|
98
|
+
);
|
|
99
|
+
const agent = planAgent(plugin, overlays.agent?.resource, identity, warnings);
|
|
100
|
+
const workflows = planWorkflows(overlays.workflows, identity);
|
|
101
|
+
|
|
102
|
+
const members: PlannedMember[] = [
|
|
103
|
+
...skills.map((skill) => ({
|
|
104
|
+
kind: ApiResourceKind.skill,
|
|
105
|
+
slug: skill.slug,
|
|
106
|
+
name: skill.name,
|
|
107
|
+
})),
|
|
108
|
+
...mcpServers.map((server) => ({
|
|
109
|
+
kind: ApiResourceKind.mcp_server,
|
|
110
|
+
slug: server.slug,
|
|
111
|
+
name: server.name,
|
|
112
|
+
})),
|
|
113
|
+
...(agent === undefined
|
|
114
|
+
? []
|
|
115
|
+
: [{ kind: ApiResourceKind.agent, slug: agent.slug, name: agent.name }]),
|
|
116
|
+
...workflows.map((workflow) => ({
|
|
117
|
+
kind: ApiResourceKind.workflow,
|
|
118
|
+
slug: workflow.slug,
|
|
119
|
+
name: workflow.name,
|
|
120
|
+
})),
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
return { skills, mcpServers, agent, workflows, members, tag, warnings };
|
|
124
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one edge the plugin domain has onto the four child domains — a
|
|
3
|
+
* consumer-defined, method-segregated surface the composition root
|
|
4
|
+
* satisfies with in-process clients (boot/inprocess.ts), the
|
|
5
|
+
* `AgentInstanceApplier` shape. Every call rides the in-process router
|
|
6
|
+
* transport AS THE INSTALLING CALLER (the `asCaller` call options): each
|
|
7
|
+
* child's full chain runs — validation, the caller's own permission for
|
|
8
|
+
* that kind, references, the reserved-label and managed guards (both pass
|
|
9
|
+
* by origin), persist, tuples, index — so a materialised skill is a skill
|
|
10
|
+
* the CLI could have pushed, attributed to the user who installed it.
|
|
11
|
+
*
|
|
12
|
+
* Why an interface and not the clients: the domain reads at its boundary
|
|
13
|
+
* what it needs and nothing more (no update, no create, no reads), the
|
|
14
|
+
* agent↔agentinstance-style cycle between routes and clients is broken at
|
|
15
|
+
* the consumer with a lazy provider, and a test supplies a recording fake.
|
|
16
|
+
*/
|
|
17
|
+
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
18
|
+
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
19
|
+
import type { Skill } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
20
|
+
import type { PushSkillRequest } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
|
|
21
|
+
import type { Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
22
|
+
import type { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
23
|
+
import type { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
24
|
+
|
|
25
|
+
import type { CallerIdentity } from "../../../extensions/identity.js";
|
|
26
|
+
|
|
27
|
+
export interface PluginMaterializer {
|
|
28
|
+
/** Skill push is upsert-by-slug from the frontmatter; the request carries the plugin's labels. */
|
|
29
|
+
pushSkill(request: PushSkillRequest, caller: CallerIdentity): Promise<Skill>;
|
|
30
|
+
/** Apply is upsert-by-slug for the three YAML kinds. */
|
|
31
|
+
applyMcpServer(server: McpServer, caller: CallerIdentity): Promise<McpServer>;
|
|
32
|
+
applyAgent(agent: Agent, caller: CallerIdentity): Promise<Agent>;
|
|
33
|
+
applyWorkflow(workflow: Workflow, caller: CallerIdentity): Promise<Workflow>;
|
|
34
|
+
/**
|
|
35
|
+
* The one door for a level change (metadata.proto): an existing member
|
|
36
|
+
* whose level differs from the plugin's is moved here after apply.
|
|
37
|
+
*/
|
|
38
|
+
updateVisibility(
|
|
39
|
+
kind: ApiResourceKind,
|
|
40
|
+
resourceId: string,
|
|
41
|
+
visibility: ApiResourceVisibility,
|
|
42
|
+
caller: CallerIdentity,
|
|
43
|
+
): Promise<void>;
|
|
44
|
+
/** A member the new archive dropped, or the whole set on uninstall. */
|
|
45
|
+
deleteByKind(
|
|
46
|
+
kind: ApiResourceKind,
|
|
47
|
+
resourceId: string,
|
|
48
|
+
caller: CallerIdentity,
|
|
49
|
+
): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Lazy provider: the clients exist only after the routes they ride are registered. */
|
|
53
|
+
export type PluginMaterializerProvider = () => PluginMaterializer;
|