@stigmer/server 3.15.3-dev.20260914100347 → 3.15.3-dev.20260916211208
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/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 +157 -32
- 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 +62 -20
- 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/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 +26 -0
- package/dist/domain/identityaccount/actor.d.ts.map +1 -0
- package/dist/domain/identityaccount/actor.js +17 -0
- package/dist/domain/identityaccount/actor.js.map +1 -0
- 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/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 +101 -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/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 +75 -11
- package/dist/extensions/list-read-scope.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.js +40 -7
- 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/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 +21 -0
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +28 -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/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +7 -26
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- 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-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/shapes.d.ts +18 -0
- package/dist/pipeline/steps/shapes.d.ts.map +1 -1
- package/dist/pipeline/steps/shapes.js +29 -0
- package/dist/pipeline/steps/shapes.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/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/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__/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/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 +91 -0
- package/src/authorization/store-test-kit.ts +454 -0
- package/src/authorization/tuples.ts +190 -0
- package/src/boot/compose.ts +175 -38
- package/src/boot/inprocess.ts +108 -30
- package/src/domain/agent/controller.ts +11 -0
- 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/actor.ts +44 -0
- package/src/domain/mcpserver/controller.ts +11 -0
- 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 +681 -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 +149 -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/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 +35 -0
- package/src/extensions/__tests__/list-read-scope.test.ts +245 -3
- 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 +116 -16
- 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/index.ts +51 -1
- package/src/pipeline/__tests__/inherited-authorization-parent.test.ts +51 -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 +37 -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 +3 -9
- 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/authorization-tuples.ts +7 -28
- package/src/pipeline/steps/delete.ts +11 -3
- package/src/pipeline/steps/duplicate.ts +8 -2
- 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/shapes.ts +31 -0
- 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/temporal/schedule/__tests__/run-starter.test.ts +86 -24
- package/src/temporal/schedule/run-starter.ts +31 -8
- 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,681 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composed-server round-trips for the Plugin kind: a real server over a
|
|
3
|
+
* temp SQLite store, raw Connect clients, archives written by the server's
|
|
4
|
+
* own writer from the library's fixture builders. Pins the install
|
|
5
|
+
* contract the conformance suite proves per edition: a Cursor plugin with
|
|
6
|
+
* skills, a sub-agent and an MCP server materialises exactly those
|
|
7
|
+
* members with both labels; an MCP-only plugin materialises no agent; a
|
|
8
|
+
* re-push of the same archive writes nothing; a client's edit, re-push or
|
|
9
|
+
* delete of a member is refused naming the plugin while the plugin's own
|
|
10
|
+
* upgrade drops what the archive dropped; uninstall removes every member
|
|
11
|
+
* and is refused while a user's own agent still references one; a slug an
|
|
12
|
+
* unmanaged resource holds refuses the install; a bad overlay refuses
|
|
13
|
+
* before any write.
|
|
14
|
+
*/
|
|
15
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
16
|
+
import net from "node:net";
|
|
17
|
+
import { tmpdir } from "node:os";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
|
|
20
|
+
import { Code, ConnectError, createClient } from "@connectrpc/connect";
|
|
21
|
+
import type { Client, Transport } from "@connectrpc/connect";
|
|
22
|
+
import { createGrpcTransport } from "@connectrpc/connect-node";
|
|
23
|
+
import { create as createMessage } from "@bufbuild/protobuf";
|
|
24
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
cursorPlugin,
|
|
28
|
+
openPlugin,
|
|
29
|
+
withFile,
|
|
30
|
+
} from "@stigmer/plugin-package/testing";
|
|
31
|
+
import type { PluginFixture } from "@stigmer/plugin-package/testing";
|
|
32
|
+
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
33
|
+
import { AgentCommandController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/command_pb";
|
|
34
|
+
import { AgentQueryController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/query_pb";
|
|
35
|
+
import {
|
|
36
|
+
AgentSpecSchema,
|
|
37
|
+
McpServerUsageSchema,
|
|
38
|
+
} from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
39
|
+
import { McpServerCommandController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/command_pb";
|
|
40
|
+
import { McpServerQueryController } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/query_pb";
|
|
41
|
+
import { PluginCommandController } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/command_pb";
|
|
42
|
+
import { PluginQueryController } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/query_pb";
|
|
43
|
+
import { PluginState } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/status_pb";
|
|
44
|
+
import { SkillCommandController } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/command_pb";
|
|
45
|
+
import { SkillQueryController } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/query_pb";
|
|
46
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
47
|
+
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
48
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
49
|
+
|
|
50
|
+
import { writeArchive } from "../../../archive/write.js";
|
|
51
|
+
import { loadConfig } from "../../../boot/config.js";
|
|
52
|
+
import { composeServer } from "../../../boot/compose.js";
|
|
53
|
+
import type { ComposedServer } from "../../../boot/compose.js";
|
|
54
|
+
import { createLogger } from "../../../boot/logger.js";
|
|
55
|
+
import {
|
|
56
|
+
PLUGIN_LABEL,
|
|
57
|
+
PLUGIN_VERSION_LABEL,
|
|
58
|
+
} from "../../../pipeline/apiresource-labels.js";
|
|
59
|
+
|
|
60
|
+
const silentLogger = createLogger({
|
|
61
|
+
level: "error",
|
|
62
|
+
pretty: false,
|
|
63
|
+
write: () => {},
|
|
64
|
+
});
|
|
65
|
+
const ORG = "acme";
|
|
66
|
+
|
|
67
|
+
let server: ComposedServer;
|
|
68
|
+
let plugins: Client<typeof PluginCommandController>;
|
|
69
|
+
let pluginQuery: Client<typeof PluginQueryController>;
|
|
70
|
+
let agents: Client<typeof AgentCommandController>;
|
|
71
|
+
let agentQuery: Client<typeof AgentQueryController>;
|
|
72
|
+
let skills: Client<typeof SkillCommandController>;
|
|
73
|
+
let skillQuery: Client<typeof SkillQueryController>;
|
|
74
|
+
let mcpServers: Client<typeof McpServerCommandController>;
|
|
75
|
+
let mcpServerQuery: Client<typeof McpServerQueryController>;
|
|
76
|
+
let dir: string;
|
|
77
|
+
|
|
78
|
+
async function reserveFreePort(): Promise<number> {
|
|
79
|
+
return new Promise((resolve, reject) => {
|
|
80
|
+
const probe = net.createServer();
|
|
81
|
+
probe.once("error", reject);
|
|
82
|
+
probe.listen(0, "127.0.0.1", () => {
|
|
83
|
+
const { port } = probe.address() as net.AddressInfo;
|
|
84
|
+
probe.close(() => resolve(port));
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
beforeAll(async () => {
|
|
90
|
+
dir = mkdtempSync(path.join(tmpdir(), "plugin-domain-test-"));
|
|
91
|
+
const grpcPort = await reserveFreePort();
|
|
92
|
+
server = await composeServer({
|
|
93
|
+
config: loadConfig({
|
|
94
|
+
STIGMER_MODEL_REGISTRY_REFRESH: "off",
|
|
95
|
+
TEMPORAL_HOST_PORT: "127.0.0.1:1",
|
|
96
|
+
GRPC_PORT: String(grpcPort),
|
|
97
|
+
DB_PATH: path.join(dir, "stigmer.db"),
|
|
98
|
+
ARTIFACT_LOCAL_BASE_PATH: path.join(dir, "artifacts"),
|
|
99
|
+
STORAGE_PATH: path.join(dir, "storage"),
|
|
100
|
+
}),
|
|
101
|
+
logger: silentLogger,
|
|
102
|
+
host: "127.0.0.1",
|
|
103
|
+
});
|
|
104
|
+
const port = await server.start();
|
|
105
|
+
const transport: Transport = createGrpcTransport({
|
|
106
|
+
baseUrl: `http://127.0.0.1:${port}`,
|
|
107
|
+
});
|
|
108
|
+
plugins = createClient(PluginCommandController, transport);
|
|
109
|
+
pluginQuery = createClient(PluginQueryController, transport);
|
|
110
|
+
agents = createClient(AgentCommandController, transport);
|
|
111
|
+
agentQuery = createClient(AgentQueryController, transport);
|
|
112
|
+
skills = createClient(SkillCommandController, transport);
|
|
113
|
+
skillQuery = createClient(SkillQueryController, transport);
|
|
114
|
+
mcpServers = createClient(McpServerCommandController, transport);
|
|
115
|
+
mcpServerQuery = createClient(McpServerQueryController, transport);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
afterAll(async () => {
|
|
119
|
+
await server.shutdown();
|
|
120
|
+
rmSync(dir, { recursive: true, force: true });
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const encoder = new TextEncoder();
|
|
124
|
+
|
|
125
|
+
/** A fixture map as the archive the CLI would push: the server's own deterministic writer. */
|
|
126
|
+
function archiveOf(fixture: PluginFixture): Uint8Array {
|
|
127
|
+
return writeArchive(
|
|
128
|
+
[...fixture.entries()].map(([filePath, content]) => ({
|
|
129
|
+
path: filePath,
|
|
130
|
+
bytes: typeof content === "string" ? encoder.encode(content) : content,
|
|
131
|
+
})),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
let counter = 0;
|
|
136
|
+
function uniqueName(prefix: string): string {
|
|
137
|
+
counter += 1;
|
|
138
|
+
return `${prefix}-${counter}`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** A Cursor plugin with one skill, one sub-agent and one HTTP server: the thermos shape. */
|
|
142
|
+
function thermosLike(
|
|
143
|
+
name: string,
|
|
144
|
+
options: { readonly skill?: string; readonly extraSkill?: string } = {},
|
|
145
|
+
): PluginFixture {
|
|
146
|
+
const skill = options.skill ?? `${name}-review`;
|
|
147
|
+
return cursorPlugin({
|
|
148
|
+
name,
|
|
149
|
+
version: "1.2.0",
|
|
150
|
+
description: "Code review with a thermonuclear standard",
|
|
151
|
+
skills: [
|
|
152
|
+
{
|
|
153
|
+
name: skill,
|
|
154
|
+
description: "Review code thoroughly",
|
|
155
|
+
body: "# Review\nRead everything.",
|
|
156
|
+
},
|
|
157
|
+
...(options.extraSkill === undefined
|
|
158
|
+
? []
|
|
159
|
+
: [
|
|
160
|
+
{
|
|
161
|
+
name: options.extraSkill,
|
|
162
|
+
description: "Another skill",
|
|
163
|
+
body: "# More\nAnd more.",
|
|
164
|
+
},
|
|
165
|
+
]),
|
|
166
|
+
],
|
|
167
|
+
agents: [
|
|
168
|
+
{
|
|
169
|
+
file: "reviewer",
|
|
170
|
+
frontmatter: {
|
|
171
|
+
name: `${name}-reviewer`,
|
|
172
|
+
description: "Reviews pull requests",
|
|
173
|
+
model: "sonnet",
|
|
174
|
+
},
|
|
175
|
+
body: "You review pull requests with care and name every risk you see.",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
mcpServers: {
|
|
179
|
+
[`${name}-github`]: {
|
|
180
|
+
type: "http",
|
|
181
|
+
url: "https://api.githubcopilot.com/mcp/",
|
|
182
|
+
headers: { Authorization: "Bearer ${GITHUB_TOKEN}" },
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
variables: {
|
|
186
|
+
GITHUB_TOKEN: {
|
|
187
|
+
type: "string",
|
|
188
|
+
title: "GitHub token",
|
|
189
|
+
description: "A personal access token",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
required: ["GITHUB_TOKEN"],
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function expectCode(
|
|
197
|
+
promise: Promise<unknown>,
|
|
198
|
+
code: Code,
|
|
199
|
+
contains?: string,
|
|
200
|
+
): Promise<ConnectError> {
|
|
201
|
+
try {
|
|
202
|
+
await promise;
|
|
203
|
+
} catch (error) {
|
|
204
|
+
expect(error).toBeInstanceOf(ConnectError);
|
|
205
|
+
const connectError = error as ConnectError;
|
|
206
|
+
expect(connectError.code, connectError.rawMessage).toBe(code);
|
|
207
|
+
if (contains !== undefined) {
|
|
208
|
+
expect(connectError.rawMessage).toContain(contains);
|
|
209
|
+
}
|
|
210
|
+
return connectError;
|
|
211
|
+
}
|
|
212
|
+
throw new Error(`expected ${Code[code]}, the call succeeded`);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
describe("Plugin push — materialisation", () => {
|
|
216
|
+
it("installs a Cursor plugin as one skill, one MCP server and one agent, each labelled with the plugin id and digest", async () => {
|
|
217
|
+
const name = uniqueName("thermos");
|
|
218
|
+
const installed = await plugins.push({
|
|
219
|
+
org: ORG,
|
|
220
|
+
artifact: archiveOf(thermosLike(name)),
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
expect(installed.metadata?.id).toMatch(/^plg_/);
|
|
224
|
+
expect(installed.metadata?.slug).toBe(name);
|
|
225
|
+
expect(installed.spec?.name).toBe(name);
|
|
226
|
+
expect(installed.spec?.version).toBe("1.2.0");
|
|
227
|
+
expect(installed.status?.state).toBe(PluginState.READY);
|
|
228
|
+
expect(installed.status?.digest).toMatch(/^[a-f0-9]{64}$/);
|
|
229
|
+
expect(installed.status?.materialized).toMatchObject({
|
|
230
|
+
skills: 1,
|
|
231
|
+
mcpServers: 1,
|
|
232
|
+
agents: 1,
|
|
233
|
+
workflows: 0,
|
|
234
|
+
});
|
|
235
|
+
// The sub-agent's model hint is recorded, never applied.
|
|
236
|
+
expect(installed.status?.warnings.map((w) => w.kind)).toContain(
|
|
237
|
+
"model-hint-unresolved",
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
const members = await pluginQuery.listMembers({
|
|
241
|
+
value: installed.metadata!.id,
|
|
242
|
+
});
|
|
243
|
+
expect(
|
|
244
|
+
members.members.map((m) => `${ApiResourceKind[m.kind]}:${m.slug}`),
|
|
245
|
+
).toEqual([
|
|
246
|
+
`skill:${name}-review`,
|
|
247
|
+
`mcp_server:${name}-github`,
|
|
248
|
+
`agent:${name}`,
|
|
249
|
+
]);
|
|
250
|
+
|
|
251
|
+
const digest = installed.status!.digest;
|
|
252
|
+
for (const member of members.members) {
|
|
253
|
+
const labels =
|
|
254
|
+
member.kind === ApiResourceKind.skill
|
|
255
|
+
? (await skillQuery.get({ value: member.id })).metadata!.labels
|
|
256
|
+
: member.kind === ApiResourceKind.mcp_server
|
|
257
|
+
? (await mcpServerQuery.get({ value: member.id })).metadata!.labels
|
|
258
|
+
: (await agentQuery.get({ value: member.id })).metadata!.labels;
|
|
259
|
+
expect(labels[PLUGIN_LABEL]).toBe(installed.metadata!.id);
|
|
260
|
+
expect(labels[PLUGIN_VERSION_LABEL]).toBe(digest);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const agent = await agentQuery.getByReference(
|
|
264
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
265
|
+
org: ORG,
|
|
266
|
+
kind: ApiResourceKind.agent,
|
|
267
|
+
slug: name,
|
|
268
|
+
}),
|
|
269
|
+
);
|
|
270
|
+
expect(agent.spec?.skillRefs.map((r) => r.slug)).toEqual([
|
|
271
|
+
`${name}-review`,
|
|
272
|
+
]);
|
|
273
|
+
expect(
|
|
274
|
+
agent.spec?.mcpServerUsages.map((u) => u.mcpServerRef?.slug),
|
|
275
|
+
).toEqual([`${name}-github`]);
|
|
276
|
+
expect(agent.spec?.subAgents.map((s) => s.name)).toEqual([
|
|
277
|
+
`${name}-reviewer`,
|
|
278
|
+
]);
|
|
279
|
+
expect(agent.spec?.subAgents[0]?.modelOverride).toBe("");
|
|
280
|
+
expect(agent.spec?.subAgents[0]?.mcpAccess.map((a) => a.mcpServer)).toEqual(
|
|
281
|
+
[`${name}-github`],
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
const serverResource = await mcpServerQuery.getByReference(
|
|
285
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
286
|
+
org: ORG,
|
|
287
|
+
kind: ApiResourceKind.mcp_server,
|
|
288
|
+
slug: `${name}-github`,
|
|
289
|
+
}),
|
|
290
|
+
);
|
|
291
|
+
expect(serverResource.spec?.env["GITHUB_TOKEN"]).toMatchObject({
|
|
292
|
+
isSecret: true,
|
|
293
|
+
optional: false,
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it("installs an MCP-only plugin as its servers and no agent", async () => {
|
|
298
|
+
const name = uniqueName("github");
|
|
299
|
+
const installed = await plugins.push({
|
|
300
|
+
org: ORG,
|
|
301
|
+
artifact: archiveOf(
|
|
302
|
+
openPlugin({
|
|
303
|
+
name,
|
|
304
|
+
version: "0.1.0",
|
|
305
|
+
// The open format's word for the transport is `streamable-http`.
|
|
306
|
+
mcpServers: {
|
|
307
|
+
[name]: {
|
|
308
|
+
type: "streamable-http",
|
|
309
|
+
url: "https://example.com/mcp",
|
|
310
|
+
headers: { Authorization: "Bearer ${TOKEN}" },
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
}),
|
|
314
|
+
),
|
|
315
|
+
});
|
|
316
|
+
expect(installed.status?.materialized).toMatchObject({
|
|
317
|
+
skills: 0,
|
|
318
|
+
mcpServers: 1,
|
|
319
|
+
agents: 0,
|
|
320
|
+
});
|
|
321
|
+
const members = await pluginQuery.listMembers({
|
|
322
|
+
value: installed.metadata!.id,
|
|
323
|
+
});
|
|
324
|
+
expect(members.members.map((m) => ApiResourceKind[m.kind])).toEqual([
|
|
325
|
+
"mcp_server",
|
|
326
|
+
]);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it("re-pushing the same archive writes nothing: same digest, one version, members untouched", async () => {
|
|
330
|
+
const name = uniqueName("idem");
|
|
331
|
+
const first = await plugins.push({
|
|
332
|
+
org: ORG,
|
|
333
|
+
artifact: archiveOf(thermosLike(name)),
|
|
334
|
+
});
|
|
335
|
+
const skillBefore = await skillQuery.getByReference(
|
|
336
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
337
|
+
org: ORG,
|
|
338
|
+
kind: ApiResourceKind.skill,
|
|
339
|
+
slug: `${name}-review`,
|
|
340
|
+
}),
|
|
341
|
+
);
|
|
342
|
+
const second = await plugins.push({
|
|
343
|
+
org: ORG,
|
|
344
|
+
artifact: archiveOf(thermosLike(name)),
|
|
345
|
+
});
|
|
346
|
+
expect(second.metadata?.id).toBe(first.metadata?.id);
|
|
347
|
+
expect(second.status?.digest).toBe(first.status?.digest);
|
|
348
|
+
const versions = await pluginQuery.listVersions({ org: ORG, slug: name });
|
|
349
|
+
expect(versions.totalCount).toBe(1);
|
|
350
|
+
expect(versions.versions[0]?.tag).toBe("1.2.0");
|
|
351
|
+
const skillAfter = await skillQuery.getByReference(
|
|
352
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
353
|
+
org: ORG,
|
|
354
|
+
kind: ApiResourceKind.skill,
|
|
355
|
+
slug: `${name}-review`,
|
|
356
|
+
}),
|
|
357
|
+
);
|
|
358
|
+
expect(skillAfter.status?.audit?.specAudit?.updatedAt).toEqual(
|
|
359
|
+
skillBefore.status?.audit?.specAudit?.updatedAt,
|
|
360
|
+
);
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
it("an upgrade that drops a skill removes it and keeps the agent valid; the version history grows", async () => {
|
|
364
|
+
const name = uniqueName("upgrade");
|
|
365
|
+
const first = await plugins.push({
|
|
366
|
+
org: ORG,
|
|
367
|
+
artifact: archiveOf(thermosLike(name, { extraSkill: `${name}-extra` })),
|
|
368
|
+
});
|
|
369
|
+
expect(first.status?.materialized?.skills).toBe(2);
|
|
370
|
+
|
|
371
|
+
const second = await plugins.push({
|
|
372
|
+
org: ORG,
|
|
373
|
+
artifact: archiveOf(thermosLike(name)),
|
|
374
|
+
});
|
|
375
|
+
expect(second.status?.materialized?.skills).toBe(1);
|
|
376
|
+
expect(second.status?.digest).not.toBe(first.status?.digest);
|
|
377
|
+
|
|
378
|
+
await expectCode(
|
|
379
|
+
skillQuery.getByReference(
|
|
380
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
381
|
+
org: ORG,
|
|
382
|
+
kind: ApiResourceKind.skill,
|
|
383
|
+
slug: `${name}-extra`,
|
|
384
|
+
}),
|
|
385
|
+
),
|
|
386
|
+
Code.NotFound,
|
|
387
|
+
);
|
|
388
|
+
const agent = await agentQuery.getByReference(
|
|
389
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
390
|
+
org: ORG,
|
|
391
|
+
kind: ApiResourceKind.agent,
|
|
392
|
+
slug: name,
|
|
393
|
+
}),
|
|
394
|
+
);
|
|
395
|
+
expect(agent.spec?.skillRefs.map((r) => r.slug)).toEqual([
|
|
396
|
+
`${name}-review`,
|
|
397
|
+
]);
|
|
398
|
+
const versions = await pluginQuery.listVersions({ org: ORG, slug: name });
|
|
399
|
+
expect(versions.totalCount).toBe(2);
|
|
400
|
+
expect(
|
|
401
|
+
versions.versions.filter((v) => v.isCurrent).map((v) => v.digest),
|
|
402
|
+
).toEqual([second.status?.digest]);
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
it("getByReference resolves latest, the digest and the manifest version tag", async () => {
|
|
406
|
+
const name = uniqueName("ref");
|
|
407
|
+
const installed = await plugins.push({
|
|
408
|
+
org: ORG,
|
|
409
|
+
artifact: archiveOf(thermosLike(name)),
|
|
410
|
+
});
|
|
411
|
+
for (const version of ["", "latest", installed.status!.digest, "1.2.0"]) {
|
|
412
|
+
const resolved = await pluginQuery.getByReference(
|
|
413
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
414
|
+
org: ORG,
|
|
415
|
+
kind: ApiResourceKind.plugin,
|
|
416
|
+
slug: name,
|
|
417
|
+
version,
|
|
418
|
+
}),
|
|
419
|
+
);
|
|
420
|
+
expect(resolved.status?.digest, version).toBe(installed.status?.digest);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
describe("Plugin members are the plugin's to redefine", () => {
|
|
426
|
+
it("refuses a client update, delete and visibility change of a member, naming the plugin", async () => {
|
|
427
|
+
const name = uniqueName("managed");
|
|
428
|
+
const installed = await plugins.push({
|
|
429
|
+
org: ORG,
|
|
430
|
+
artifact: archiveOf(thermosLike(name)),
|
|
431
|
+
});
|
|
432
|
+
const members = await pluginQuery.listMembers({
|
|
433
|
+
value: installed.metadata!.id,
|
|
434
|
+
});
|
|
435
|
+
const agentMember = members.members.find(
|
|
436
|
+
(m) => m.kind === ApiResourceKind.agent,
|
|
437
|
+
)!;
|
|
438
|
+
const serverMember = members.members.find(
|
|
439
|
+
(m) => m.kind === ApiResourceKind.mcp_server,
|
|
440
|
+
)!;
|
|
441
|
+
|
|
442
|
+
const agent = await agentQuery.get({ value: agentMember.id });
|
|
443
|
+
agent.spec!.description = "edited by a client";
|
|
444
|
+
await expectCode(
|
|
445
|
+
agents.update(agent),
|
|
446
|
+
Code.FailedPrecondition,
|
|
447
|
+
`agent '${name}' is managed by plugin '${name}'`,
|
|
448
|
+
);
|
|
449
|
+
await expectCode(
|
|
450
|
+
mcpServers.delete({ resourceId: serverMember.id }),
|
|
451
|
+
Code.FailedPrecondition,
|
|
452
|
+
`MCP server '${name}-github' is managed by plugin '${name}'`,
|
|
453
|
+
);
|
|
454
|
+
await expectCode(
|
|
455
|
+
agents.updateVisibility({ resourceId: agentMember.id, visibility: 3 }),
|
|
456
|
+
Code.FailedPrecondition,
|
|
457
|
+
"is managed by plugin",
|
|
458
|
+
);
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
it("refuses a client re-push of a managed skill under the same name", async () => {
|
|
462
|
+
const name = uniqueName("skillpush");
|
|
463
|
+
await plugins.push({ org: ORG, artifact: archiveOf(thermosLike(name)) });
|
|
464
|
+
const rogue = writeArchive([
|
|
465
|
+
{
|
|
466
|
+
path: "SKILL.md",
|
|
467
|
+
bytes: encoder.encode(
|
|
468
|
+
`---\nname: ${name}-review\ndescription: hijack\n---\n# Mine now`,
|
|
469
|
+
),
|
|
470
|
+
},
|
|
471
|
+
]);
|
|
472
|
+
await expectCode(
|
|
473
|
+
skills.push({ org: ORG, artifact: rogue }),
|
|
474
|
+
Code.FailedPrecondition,
|
|
475
|
+
`skill '${name}-review' is managed by plugin '${name}'`,
|
|
476
|
+
);
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
it("refuses to install over a slug an unmanaged resource holds, naming it", async () => {
|
|
480
|
+
const name = uniqueName("collide");
|
|
481
|
+
const skillName = `${name}-review`;
|
|
482
|
+
await skills.push({
|
|
483
|
+
org: ORG,
|
|
484
|
+
artifact: writeArchive([
|
|
485
|
+
{
|
|
486
|
+
path: "SKILL.md",
|
|
487
|
+
bytes: encoder.encode(
|
|
488
|
+
`---\nname: ${skillName}\ndescription: mine\n---\n# Mine`,
|
|
489
|
+
),
|
|
490
|
+
},
|
|
491
|
+
]),
|
|
492
|
+
});
|
|
493
|
+
await expectCode(
|
|
494
|
+
plugins.push({ org: ORG, artifact: archiveOf(thermosLike(name)) }),
|
|
495
|
+
Code.AlreadyExists,
|
|
496
|
+
`'${skillName}' exists in org '${ORG}' and is not managed by a plugin`,
|
|
497
|
+
);
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
it("refuses to install a slug another plugin holds, naming that plugin", async () => {
|
|
501
|
+
const first = uniqueName("holder");
|
|
502
|
+
const second = uniqueName("claimant");
|
|
503
|
+
const shared = `${first}-shared`;
|
|
504
|
+
await plugins.push({
|
|
505
|
+
org: ORG,
|
|
506
|
+
artifact: archiveOf(thermosLike(first, { skill: shared })),
|
|
507
|
+
});
|
|
508
|
+
await expectCode(
|
|
509
|
+
plugins.push({
|
|
510
|
+
org: ORG,
|
|
511
|
+
artifact: archiveOf(thermosLike(second, { skill: shared })),
|
|
512
|
+
}),
|
|
513
|
+
Code.AlreadyExists,
|
|
514
|
+
`'${shared}' is held by plugin '${first}'`,
|
|
515
|
+
);
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
describe("Plugin delete", () => {
|
|
520
|
+
it("removes every member and the head; a fresh install of the same archive works afterwards", async () => {
|
|
521
|
+
const name = uniqueName("remove");
|
|
522
|
+
const installed = await plugins.push({
|
|
523
|
+
org: ORG,
|
|
524
|
+
artifact: archiveOf(thermosLike(name)),
|
|
525
|
+
});
|
|
526
|
+
const members = await pluginQuery.listMembers({
|
|
527
|
+
value: installed.metadata!.id,
|
|
528
|
+
});
|
|
529
|
+
expect(members.members).toHaveLength(3);
|
|
530
|
+
|
|
531
|
+
await plugins.delete({ value: installed.metadata!.id });
|
|
532
|
+
|
|
533
|
+
await expectCode(
|
|
534
|
+
pluginQuery.get({ value: installed.metadata!.id }),
|
|
535
|
+
Code.NotFound,
|
|
536
|
+
);
|
|
537
|
+
for (const member of members.members) {
|
|
538
|
+
const lookup =
|
|
539
|
+
member.kind === ApiResourceKind.skill
|
|
540
|
+
? skillQuery.get({ value: member.id })
|
|
541
|
+
: member.kind === ApiResourceKind.mcp_server
|
|
542
|
+
? mcpServerQuery.get({ value: member.id })
|
|
543
|
+
: agentQuery.get({ value: member.id });
|
|
544
|
+
await expectCode(lookup, Code.NotFound);
|
|
545
|
+
}
|
|
546
|
+
const again = await plugins.push({
|
|
547
|
+
org: ORG,
|
|
548
|
+
artifact: archiveOf(thermosLike(name)),
|
|
549
|
+
});
|
|
550
|
+
expect(again.status?.state).toBe(PluginState.READY);
|
|
551
|
+
expect(again.metadata?.id).not.toBe(installed.metadata?.id);
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
it("is refused while a user's own agent references a member, and succeeds once it is detached", async () => {
|
|
555
|
+
const name = uniqueName("referenced");
|
|
556
|
+
const installed = await plugins.push({
|
|
557
|
+
org: ORG,
|
|
558
|
+
artifact: archiveOf(thermosLike(name)),
|
|
559
|
+
});
|
|
560
|
+
const mine = await agents.create(
|
|
561
|
+
createMessage(AgentSchema, {
|
|
562
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
563
|
+
kind: "Agent",
|
|
564
|
+
metadata: createMessage(ApiResourceMetadataSchema, {
|
|
565
|
+
org: ORG,
|
|
566
|
+
name: `${name}-composer`,
|
|
567
|
+
}),
|
|
568
|
+
spec: createMessage(AgentSpecSchema, {
|
|
569
|
+
instructions: "You compose over the plugin's tools.",
|
|
570
|
+
mcpServerUsages: [
|
|
571
|
+
createMessage(McpServerUsageSchema, {
|
|
572
|
+
mcpServerRef: createMessage(ApiResourceReferenceSchema, {
|
|
573
|
+
org: ORG,
|
|
574
|
+
kind: ApiResourceKind.mcp_server,
|
|
575
|
+
slug: `${name}-github`,
|
|
576
|
+
}),
|
|
577
|
+
}),
|
|
578
|
+
],
|
|
579
|
+
}),
|
|
580
|
+
}),
|
|
581
|
+
);
|
|
582
|
+
await expectCode(
|
|
583
|
+
plugins.delete({ value: installed.metadata!.id }),
|
|
584
|
+
Code.FailedPrecondition,
|
|
585
|
+
`plugin '${name}' is still used by agent '${name}-composer'`,
|
|
586
|
+
);
|
|
587
|
+
await agents.delete({ value: mine.metadata!.id });
|
|
588
|
+
await plugins.delete({ value: installed.metadata!.id });
|
|
589
|
+
await expectCode(
|
|
590
|
+
pluginQuery.get({ value: installed.metadata!.id }),
|
|
591
|
+
Code.NotFound,
|
|
592
|
+
);
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
describe("Plugin push — refusals before any write", () => {
|
|
597
|
+
it("refuses a package the library refuses, with its sentences", async () => {
|
|
598
|
+
const name = uniqueName("badurl");
|
|
599
|
+
const broken = cursorPlugin({
|
|
600
|
+
name,
|
|
601
|
+
mcpServers: { [name]: { type: "http", url: "https://${HOST}/mcp" } },
|
|
602
|
+
});
|
|
603
|
+
const error = await expectCode(
|
|
604
|
+
plugins.push({ org: ORG, artifact: archiveOf(broken) }),
|
|
605
|
+
Code.InvalidArgument,
|
|
606
|
+
"plugin cannot be installed, 1 problem found",
|
|
607
|
+
);
|
|
608
|
+
expect(error.rawMessage).toContain("has a variable in its 'url'");
|
|
609
|
+
await expectCode(
|
|
610
|
+
pluginQuery.getByReference(
|
|
611
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
612
|
+
org: ORG,
|
|
613
|
+
kind: ApiResourceKind.plugin,
|
|
614
|
+
slug: name,
|
|
615
|
+
}),
|
|
616
|
+
),
|
|
617
|
+
Code.NotFound,
|
|
618
|
+
);
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
it("refuses an agent overlay with an unknown field, naming the document", async () => {
|
|
622
|
+
const name = uniqueName("overlay");
|
|
623
|
+
const fixture = withFile(
|
|
624
|
+
thermosLike(name),
|
|
625
|
+
"ai.stigmer/agent.yaml",
|
|
626
|
+
`apiVersion: agentic.stigmer.ai/v1\nkind: Agent\nmetadata:\n name: ${name}\nspec:\n instructions: Ten characters or more of instructions.\n favourite_colour: blue\n`,
|
|
627
|
+
);
|
|
628
|
+
await expectCode(
|
|
629
|
+
plugins.push({ org: ORG, artifact: archiveOf(fixture) }),
|
|
630
|
+
Code.InvalidArgument,
|
|
631
|
+
"overlay document 'ai.stigmer/agent.yaml'",
|
|
632
|
+
);
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
it("refuses an agent overlay that names another resource", async () => {
|
|
636
|
+
const name = uniqueName("overlayname");
|
|
637
|
+
const fixture = withFile(
|
|
638
|
+
thermosLike(name),
|
|
639
|
+
"ai.stigmer/agent.yaml",
|
|
640
|
+
`apiVersion: agentic.stigmer.ai/v1\nkind: Agent\nmetadata:\n name: somebody-else\nspec:\n instructions: Ten characters or more of instructions.\n`,
|
|
641
|
+
);
|
|
642
|
+
await expectCode(
|
|
643
|
+
plugins.push({ org: ORG, artifact: archiveOf(fixture) }),
|
|
644
|
+
Code.InvalidArgument,
|
|
645
|
+
"names 'somebody-else'",
|
|
646
|
+
);
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
it("refuses bytes that are not an archive", async () => {
|
|
650
|
+
await expectCode(
|
|
651
|
+
plugins.push({ org: ORG, artifact: encoder.encode("not a zip") }),
|
|
652
|
+
Code.InvalidArgument,
|
|
653
|
+
"failed to read plugin archive",
|
|
654
|
+
);
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
it("applies an agent overlay wholesale when it names the plugin", async () => {
|
|
658
|
+
const name = uniqueName("overlayok");
|
|
659
|
+
const fixture = withFile(
|
|
660
|
+
thermosLike(name),
|
|
661
|
+
"ai.stigmer/agent.yaml",
|
|
662
|
+
`apiVersion: agentic.stigmer.ai/v1\nkind: Agent\nmetadata:\n name: ${name}\nspec:\n description: authored\n instructions: The author's own instructions for this agent.\n`,
|
|
663
|
+
);
|
|
664
|
+
const installed = await plugins.push({
|
|
665
|
+
org: ORG,
|
|
666
|
+
artifact: archiveOf(fixture),
|
|
667
|
+
});
|
|
668
|
+
expect(installed.status?.state).toBe(PluginState.READY);
|
|
669
|
+
const agent = await agentQuery.getByReference(
|
|
670
|
+
createMessage(ApiResourceReferenceSchema, {
|
|
671
|
+
org: ORG,
|
|
672
|
+
kind: ApiResourceKind.agent,
|
|
673
|
+
slug: name,
|
|
674
|
+
}),
|
|
675
|
+
);
|
|
676
|
+
expect(agent.spec?.instructions).toBe(
|
|
677
|
+
"The author's own instructions for this agent.",
|
|
678
|
+
);
|
|
679
|
+
expect(agent.metadata?.labels[PLUGIN_LABEL]).toBe(installed.metadata?.id);
|
|
680
|
+
});
|
|
681
|
+
});
|