@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
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Skill version resolution —
|
|
3
|
-
*
|
|
4
|
-
* version ladder and the paginated version history
|
|
5
|
-
*
|
|
6
|
-
* The ladder
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* audit-by-tag lookup.
|
|
13
|
-
*
|
|
14
|
-
* listVersions marks is_current by HEAD-HASH match, not recency: under
|
|
15
|
-
* repoint semantics (#475) re-pushing archived content re-activates its
|
|
16
|
-
* existing row, so the current version need not be the newest-archived
|
|
17
|
-
* one. Tags come from the audit COLUMN (the single-holder source of
|
|
18
|
-
* truth), never from the snapshot — snapshots archive tagless and a legacy
|
|
19
|
-
* snapshot's embedded tag may have moved since it was written.
|
|
2
|
+
* Skill version resolution — the skill binding of the shared
|
|
3
|
+
* content-addressed version steps (pipeline/steps/version-history.ts): the
|
|
4
|
+
* getByReference version ladder and the paginated version history, ported
|
|
5
|
+
* from pkg/domain/skill/controller/load_skill_by_reference.go and
|
|
6
|
+
* list_versions.go. The ladder, the is_current rule and the pagination
|
|
7
|
+
* live in the shared module since plugins needed the identical shape; what
|
|
8
|
+
* is a skill's is here: the schema, the noun in sentences, the head hash in
|
|
9
|
+
* status.version_hash, the live tag in spec.tag, and the SkillVersionEntry
|
|
10
|
+
* mapping (pushed_at/pushed_by prefer the spec-audit updated stamps and fall
|
|
11
|
+
* back to created, because first pushes only carry created).
|
|
20
12
|
*
|
|
21
13
|
* Proven by __tests__/skill.test.ts's ladder and pagination blocks and
|
|
22
14
|
* the conformance suite's getByReference/listVersions blocks.
|
|
23
15
|
*/
|
|
24
|
-
import { create
|
|
16
|
+
import { create } from "@bufbuild/protobuf";
|
|
25
17
|
|
|
26
18
|
import { SkillSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
27
19
|
import type { Skill } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
@@ -30,284 +22,90 @@ import {
|
|
|
30
22
|
ListSkillVersionsResponseSchema,
|
|
31
23
|
SkillVersionEntrySchema,
|
|
32
24
|
} from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
|
|
33
|
-
import type {
|
|
25
|
+
import type {
|
|
26
|
+
ListSkillVersionsResponse,
|
|
27
|
+
SkillVersionEntry,
|
|
28
|
+
} from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
|
|
34
29
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
35
30
|
|
|
36
|
-
import {
|
|
37
|
-
internalError,
|
|
38
|
-
invalidArgumentError,
|
|
39
|
-
notFoundError,
|
|
40
|
-
} from "../../pipeline/errors.js";
|
|
41
31
|
import type { PipelineStep } from "../../pipeline/pipeline.js";
|
|
42
|
-
import type { RequestContext } from "../../pipeline/request-context.js";
|
|
43
|
-
import { findResourceBySlug, requireOrgForReference } from "../../pipeline/steps/helpers.js";
|
|
44
|
-
import { TARGET_RESOURCE_KEY } from "../../pipeline/steps/load-target.js";
|
|
45
|
-
import { AuditNotFoundError } from "../../store/interface.js";
|
|
46
32
|
import type { Store } from "../../store/interface.js";
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
import {
|
|
34
|
+
LIST_VERSIONS_HEAD_HASH_KEY,
|
|
35
|
+
LIST_VERSIONS_RESOURCE_ID_KEY,
|
|
36
|
+
LIST_VERSIONS_RESPONSE_KEY,
|
|
37
|
+
newLoadAndMapVersionsStep as newSharedLoadAndMapVersionsStep,
|
|
38
|
+
newLoadByReferenceWithVersionStep,
|
|
39
|
+
newResolveBySlugForVersionsStep,
|
|
40
|
+
} from "../../pipeline/steps/version-history.js";
|
|
41
|
+
import type { VersionHistoryBinding } from "../../pipeline/steps/version-history.js";
|
|
42
|
+
|
|
43
|
+
/** The context keys the controller's mid-chain authorize step reads. */
|
|
44
|
+
export const LIST_VERSIONS_SKILL_ID_KEY = LIST_VERSIONS_RESOURCE_ID_KEY;
|
|
45
|
+
export { LIST_VERSIONS_HEAD_HASH_KEY, LIST_VERSIONS_RESPONSE_KEY };
|
|
54
46
|
|
|
55
47
|
type GetByReferenceDesc =
|
|
56
48
|
typeof SkillQueryController.method.getByReference.input;
|
|
49
|
+
type ListVersionsDesc = typeof SkillQueryController.method.listVersions.input;
|
|
50
|
+
|
|
51
|
+
/** Where a skill keeps its hash and its tag, and how its history renders. */
|
|
52
|
+
const skillVersionBinding: VersionHistoryBinding<
|
|
53
|
+
typeof SkillSchema,
|
|
54
|
+
ListVersionsDesc,
|
|
55
|
+
SkillVersionEntry,
|
|
56
|
+
ListSkillVersionsResponse
|
|
57
|
+
> = {
|
|
58
|
+
kind: ApiResourceKind.skill,
|
|
59
|
+
schema: SkillSchema,
|
|
60
|
+
noun: "skill",
|
|
61
|
+
headHashOf: (skill) => skill.status?.versionHash ?? "",
|
|
62
|
+
liveTagOf: (skill) => skill.spec?.tag ?? "",
|
|
63
|
+
input: (req) => req,
|
|
64
|
+
mapEntry: mapSkillToVersionEntry,
|
|
65
|
+
response: (versions, nextPageToken, totalCount) =>
|
|
66
|
+
create(ListSkillVersionsResponseSchema, {
|
|
67
|
+
versions,
|
|
68
|
+
nextPageToken,
|
|
69
|
+
totalCount,
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
57
72
|
|
|
58
73
|
/** Go LoadSkillByReferenceStep — the reference + version ladder. */
|
|
59
74
|
export function newLoadSkillByReferenceStep(
|
|
60
75
|
store: Store,
|
|
61
76
|
): PipelineStep<GetByReferenceDesc> {
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (ref.slug === "") {
|
|
68
|
-
throw invalidArgumentError("slug is required in reference");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Skill is org-scoped: its slug is unique only within an org, so an
|
|
72
|
-
// empty-org reference is under-specified.
|
|
73
|
-
requireOrgForReference(ctx.apiResourceKind, ref.org);
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
ref.kind !== ApiResourceKind.api_resource_kind_unknown &&
|
|
77
|
-
ref.kind !== ApiResourceKind.skill
|
|
78
|
-
) {
|
|
79
|
-
throw invalidArgumentError(
|
|
80
|
-
`kind mismatch: expected ${ApiResourceKind[ApiResourceKind.skill]}, got ${ApiResourceKind[ref.kind]}`,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
let mainSkill: Skill | undefined;
|
|
85
|
-
try {
|
|
86
|
-
mainSkill = await findResourceBySlug(
|
|
87
|
-
store,
|
|
88
|
-
ctx.apiResourceKind,
|
|
89
|
-
SkillSchema,
|
|
90
|
-
ref.slug,
|
|
91
|
-
ref.org,
|
|
92
|
-
);
|
|
93
|
-
} catch (error) {
|
|
94
|
-
throw internalError(error, "failed to list skills");
|
|
95
|
-
}
|
|
96
|
-
if (mainSkill === undefined) {
|
|
97
|
-
throw notFoundError("skill", ref.slug);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const version = ref.version.trim();
|
|
101
|
-
if (version === "" || version === "latest") {
|
|
102
|
-
ctx.set(TARGET_RESOURCE_KEY, mainSkill);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (skillMatchesVersion(mainSkill, version)) {
|
|
107
|
-
ctx.set(TARGET_RESOURCE_KEY, mainSkill);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const auditSkill = await findAuditSkillByVersion(
|
|
112
|
-
store,
|
|
113
|
-
ctx.apiResourceKind,
|
|
114
|
-
mainSkill.metadata!.id,
|
|
115
|
-
version,
|
|
116
|
-
);
|
|
117
|
-
if (auditSkill === undefined) {
|
|
118
|
-
throw notFoundError("skill version", `${ref.slug}:${version}`);
|
|
119
|
-
}
|
|
120
|
-
ctx.set(TARGET_RESOURCE_KEY, auditSkill);
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Whether the live head IS the requested version — by hash, or by its
|
|
127
|
-
* live spec.tag (honest under the single-holder tag model, see module doc).
|
|
128
|
-
*/
|
|
129
|
-
function skillMatchesVersion(skill: Skill, version: string): boolean {
|
|
130
|
-
if (skill.status === undefined) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
if (isHash(version)) {
|
|
134
|
-
return skill.status.versionHash === version;
|
|
135
|
-
}
|
|
136
|
-
return skill.spec !== undefined && skill.spec.tag === version;
|
|
77
|
+
return newLoadByReferenceWithVersionStep(
|
|
78
|
+
store,
|
|
79
|
+
skillVersionBinding,
|
|
80
|
+
"LoadSkillByReference",
|
|
81
|
+
);
|
|
137
82
|
}
|
|
138
83
|
|
|
139
|
-
/**
|
|
140
|
-
* Indexed audit lookup by hash or tag (Go findAuditSkillByVersion) —
|
|
141
|
-
* not-found is a normal outcome (undefined), storage failures are
|
|
142
|
-
* Internal.
|
|
143
|
-
*/
|
|
144
|
-
async function findAuditSkillByVersion(
|
|
145
|
-
store: Store,
|
|
146
|
-
kind: ApiResourceKind,
|
|
147
|
-
skillId: string,
|
|
148
|
-
version: string,
|
|
149
|
-
): Promise<Skill | undefined> {
|
|
150
|
-
if (isHash(version)) {
|
|
151
|
-
try {
|
|
152
|
-
return await store.getAuditByHash(kind, skillId, version, SkillSchema);
|
|
153
|
-
} catch (error) {
|
|
154
|
-
if (error instanceof AuditNotFoundError) {
|
|
155
|
-
return undefined;
|
|
156
|
-
}
|
|
157
|
-
throw internalError(error, "failed to query audit by hash");
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
try {
|
|
161
|
-
return await store.getAuditByTag(kind, skillId, version, SkillSchema);
|
|
162
|
-
} catch (error) {
|
|
163
|
-
if (error instanceof AuditNotFoundError) {
|
|
164
|
-
return undefined;
|
|
165
|
-
}
|
|
166
|
-
throw internalError(error, "failed to query audit by tag");
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// ─── listVersions ────────────────────────────────────────────────────────
|
|
171
|
-
|
|
172
|
-
const DEFAULT_PAGE_SIZE = 50;
|
|
173
|
-
const MAX_PAGE_SIZE = 100;
|
|
174
|
-
|
|
175
|
-
export const LIST_VERSIONS_SKILL_ID_KEY = "listVersionsSkillId";
|
|
176
|
-
export const LIST_VERSIONS_HEAD_HASH_KEY = "listVersionsHeadHash";
|
|
177
|
-
export const LIST_VERSIONS_RESPONSE_KEY = "listVersionsResponse";
|
|
178
|
-
|
|
179
|
-
type ListVersionsDesc = typeof SkillQueryController.method.listVersions.input;
|
|
180
|
-
|
|
181
84
|
/** Go ResolveSkillBySlugStep — resolves the skill and captures the head hash. */
|
|
182
85
|
export function newResolveSkillBySlugStep(
|
|
183
86
|
store: Store,
|
|
184
87
|
): PipelineStep<ListVersionsDesc> {
|
|
185
|
-
return
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
try {
|
|
191
|
-
skill = await findResourceBySlug(
|
|
192
|
-
store,
|
|
193
|
-
ctx.apiResourceKind,
|
|
194
|
-
SkillSchema,
|
|
195
|
-
req.slug,
|
|
196
|
-
req.org,
|
|
197
|
-
);
|
|
198
|
-
} catch (error) {
|
|
199
|
-
throw internalError(error, "failed to search for skill");
|
|
200
|
-
}
|
|
201
|
-
if (skill === undefined) {
|
|
202
|
-
throw notFoundError("skill", `${req.slug} (org: ${req.org})`);
|
|
203
|
-
}
|
|
204
|
-
ctx.set(LIST_VERSIONS_SKILL_ID_KEY, skill.metadata!.id);
|
|
205
|
-
// The live head's hash decides is_current downstream. Under repoint
|
|
206
|
-
// semantics the current version need not be the newest-archived row,
|
|
207
|
-
// so recency cannot stand in for currency.
|
|
208
|
-
ctx.set(LIST_VERSIONS_HEAD_HASH_KEY, skill.status?.versionHash ?? "");
|
|
209
|
-
},
|
|
210
|
-
};
|
|
88
|
+
return newResolveBySlugForVersionsStep(
|
|
89
|
+
store,
|
|
90
|
+
skillVersionBinding,
|
|
91
|
+
"ResolveSkillBySlug",
|
|
92
|
+
);
|
|
211
93
|
}
|
|
212
94
|
|
|
213
95
|
/** Go LoadAndMapVersionsStep — audit records → entries → one page. */
|
|
214
96
|
export function newLoadAndMapVersionsStep(
|
|
215
97
|
store: Store,
|
|
216
98
|
): PipelineStep<ListVersionsDesc> {
|
|
217
|
-
return
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
let records;
|
|
224
|
-
try {
|
|
225
|
-
records = await store.listAuditRecords(ctx.apiResourceKind, skillId);
|
|
226
|
-
} catch (error) {
|
|
227
|
-
throw internalError(error, "failed to load version history");
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// is_current = the entry whose hash matches the live head, not the
|
|
231
|
-
// newest row. Legacy data may hold duplicate-hash rows (predating
|
|
232
|
-
// repoint semantics); marking only the first match keeps
|
|
233
|
-
// exactly-one-current true for them too.
|
|
234
|
-
const headHash = ctx.get(LIST_VERSIONS_HEAD_HASH_KEY) as string;
|
|
235
|
-
let currentMarked = false;
|
|
236
|
-
const entries: SkillVersionEntry[] = [];
|
|
237
|
-
for (const record of records) {
|
|
238
|
-
let skill: Skill;
|
|
239
|
-
try {
|
|
240
|
-
skill = fromBinary(SkillSchema, record.data);
|
|
241
|
-
} catch {
|
|
242
|
-
continue;
|
|
243
|
-
}
|
|
244
|
-
const isCurrent: boolean =
|
|
245
|
-
!currentMarked &&
|
|
246
|
-
headHash !== "" &&
|
|
247
|
-
(skill.status?.versionHash ?? "") === headHash;
|
|
248
|
-
currentMarked = currentMarked || isCurrent;
|
|
249
|
-
// Tag comes from the audit column (source of truth), not the snapshot.
|
|
250
|
-
entries.push(mapSkillToVersionEntry(skill, isCurrent, record.tag));
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
let pageSize = req.pageSize;
|
|
254
|
-
if (pageSize <= 0) {
|
|
255
|
-
pageSize = DEFAULT_PAGE_SIZE;
|
|
256
|
-
}
|
|
257
|
-
if (pageSize > MAX_PAGE_SIZE) {
|
|
258
|
-
pageSize = MAX_PAGE_SIZE;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
let startIndex = 0;
|
|
262
|
-
if (req.pageToken !== "") {
|
|
263
|
-
startIndex = decodePageToken(req.pageToken);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
let pageEntries: SkillVersionEntry[] = [];
|
|
267
|
-
let nextPageToken = "";
|
|
268
|
-
if (startIndex < entries.length) {
|
|
269
|
-
const end = Math.min(startIndex + pageSize, entries.length);
|
|
270
|
-
pageEntries = entries.slice(startIndex, end);
|
|
271
|
-
if (end < entries.length) {
|
|
272
|
-
nextPageToken = Buffer.from(String(end)).toString("base64");
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
ctx.set(
|
|
277
|
-
LIST_VERSIONS_RESPONSE_KEY,
|
|
278
|
-
create(ListSkillVersionsResponseSchema, {
|
|
279
|
-
versions: pageEntries,
|
|
280
|
-
nextPageToken,
|
|
281
|
-
totalCount: entries.length,
|
|
282
|
-
}),
|
|
283
|
-
);
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Decodes the base64 cursor with Go's strictness: base64.StdEncoding
|
|
290
|
-
* rejects malformed input and strconv.Atoi rejects trailing garbage —
|
|
291
|
-
* Buffer.from is lenient on both, so validity is checked explicitly.
|
|
292
|
-
*/
|
|
293
|
-
function decodePageToken(token: string): number {
|
|
294
|
-
const decoded = Buffer.from(token, "base64");
|
|
295
|
-
if (decoded.toString("base64") !== token) {
|
|
296
|
-
throw invalidArgumentError("invalid page_token");
|
|
297
|
-
}
|
|
298
|
-
const text = decoded.toString("utf8");
|
|
299
|
-
const index = Number.parseInt(text, 10);
|
|
300
|
-
if (!Number.isSafeInteger(index) || String(index) !== text || index < 0) {
|
|
301
|
-
throw invalidArgumentError("invalid page_token");
|
|
302
|
-
}
|
|
303
|
-
return index;
|
|
99
|
+
return newSharedLoadAndMapVersionsStep(
|
|
100
|
+
store,
|
|
101
|
+
skillVersionBinding,
|
|
102
|
+
"LoadAndMapVersions",
|
|
103
|
+
);
|
|
304
104
|
}
|
|
305
105
|
|
|
306
106
|
/**
|
|
307
107
|
* Maps an archived Skill snapshot to a version entry (Go
|
|
308
|
-
* mapSkillToVersionEntry).
|
|
309
|
-
* updated stamps and fall back to created (first pushes only carry
|
|
310
|
-
* created).
|
|
108
|
+
* mapSkillToVersionEntry).
|
|
311
109
|
*/
|
|
312
110
|
function mapSkillToVersionEntry(
|
|
313
111
|
skill: Skill,
|
|
@@ -102,6 +102,7 @@ import {
|
|
|
102
102
|
EXISTING_RESOURCE_KEY,
|
|
103
103
|
newLoadExistingStep,
|
|
104
104
|
} from "../../pipeline/steps/load-existing.js";
|
|
105
|
+
import { newGuardPluginManagedStep } from "../../pipeline/steps/guard-plugin-managed.js";
|
|
105
106
|
import {
|
|
106
107
|
SHOULD_CREATE_KEY,
|
|
107
108
|
newLoadForApplyStep,
|
|
@@ -296,6 +297,10 @@ async function update(
|
|
|
296
297
|
.addStep(newValidateWorkflowSpecStep(deps.validator, deps.logger))
|
|
297
298
|
.addStep(newResolveSlugStep())
|
|
298
299
|
.addStep(newLoadExistingStep(deps.store))
|
|
300
|
+
// A resource a plugin materialised is the plugin's to redefine; a client
|
|
301
|
+
// write is refused naming the plugin (GuardPluginManaged, keyed on the
|
|
302
|
+
// STORED labels and the plugin row's existence).
|
|
303
|
+
.addStep(newGuardPluginManagedStep(deps.store))
|
|
299
304
|
.addStep(newBuildUpdateStateStep())
|
|
300
305
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
301
306
|
.addStep(newNormalizeReferencesStep())
|
|
@@ -381,6 +386,7 @@ async function deleteWorkflow(
|
|
|
381
386
|
.addStep(newValidateProtoStep())
|
|
382
387
|
.addStep(newExtractResourceIdStep())
|
|
383
388
|
.addStep(newLoadExistingForDeleteStep(deps.store, WorkflowSchema))
|
|
389
|
+
.addStep(newGuardPluginManagedStep(deps.store))
|
|
384
390
|
.addStep(newCascadeDeleteWorkflowInstancesStep(deps.store, deps.logger))
|
|
385
391
|
.addStep(newDeleteResourceStep(deps.store))
|
|
386
392
|
.addStep(
|
|
@@ -436,6 +442,11 @@ async function updateVisibility(
|
|
|
436
442
|
)
|
|
437
443
|
.addStep(newValidateProtoStep())
|
|
438
444
|
.addStep(newLoadWorkflowForVisibilityUpdateStep(deps.store))
|
|
445
|
+
.addStep(
|
|
446
|
+
newGuardPluginManagedStep(deps.store, {
|
|
447
|
+
existingKey: UPDATE_VISIBILITY_WORKFLOW_KEY,
|
|
448
|
+
}),
|
|
449
|
+
)
|
|
439
450
|
.addStep(
|
|
440
451
|
newRecordVisibilityBeforeUpdateStep(UPDATE_VISIBILITY_WORKFLOW_KEY),
|
|
441
452
|
)
|
|
@@ -664,6 +675,14 @@ async function tagVersion(
|
|
|
664
675
|
),
|
|
665
676
|
)
|
|
666
677
|
.addStep(newValidateProtoStep())
|
|
678
|
+
.addStep(newLoadWorkflowForTagVersionStep(deps.store))
|
|
679
|
+
// Moving a tag redefines which version a plugin-managed workflow
|
|
680
|
+
// advertises; the plugin owns that, so a client is refused naming it.
|
|
681
|
+
.addStep(
|
|
682
|
+
newGuardPluginManagedStep(deps.store, {
|
|
683
|
+
existingKey: TAG_VERSION_WORKFLOW_KEY,
|
|
684
|
+
}),
|
|
685
|
+
)
|
|
667
686
|
.addStep(newTagWorkflowVersionStep(deps.store))
|
|
668
687
|
.build()
|
|
669
688
|
.execute(reqCtx);
|
|
@@ -671,13 +690,17 @@ async function tagVersion(
|
|
|
671
690
|
return reqCtx.get(TAG_VERSION_RESULT_KEY) as Workflow;
|
|
672
691
|
}
|
|
673
692
|
|
|
674
|
-
|
|
693
|
+
/** The live workflow the tag move targets, loaded once for the guard and the move. */
|
|
694
|
+
const TAG_VERSION_WORKFLOW_KEY = "tagVersionWorkflow";
|
|
695
|
+
|
|
696
|
+
/** Loads the live workflow to confirm it exists; the tag step learns its head hash from it. */
|
|
697
|
+
function newLoadWorkflowForTagVersionStep(
|
|
698
|
+
store: Store,
|
|
699
|
+
): PipelineStep<TagVersionDesc> {
|
|
675
700
|
return {
|
|
676
|
-
name: "
|
|
701
|
+
name: "LoadWorkflowForTagVersion",
|
|
677
702
|
async execute(ctx: RequestContext<TagVersionDesc>): Promise<void> {
|
|
678
703
|
const req = ctx.input;
|
|
679
|
-
|
|
680
|
-
// Load the live workflow to confirm it exists and learn its head hash.
|
|
681
704
|
let workflow: Workflow;
|
|
682
705
|
try {
|
|
683
706
|
workflow = await store.getResource(
|
|
@@ -691,6 +714,17 @@ function newTagWorkflowVersionStep(store: Store): PipelineStep<TagVersionDesc> {
|
|
|
691
714
|
}
|
|
692
715
|
throw internalError(error, "failed to load workflow");
|
|
693
716
|
}
|
|
717
|
+
ctx.set(TAG_VERSION_WORKFLOW_KEY, workflow);
|
|
718
|
+
},
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
function newTagWorkflowVersionStep(store: Store): PipelineStep<TagVersionDesc> {
|
|
723
|
+
return {
|
|
724
|
+
name: "TagWorkflowVersion",
|
|
725
|
+
async execute(ctx: RequestContext<TagVersionDesc>): Promise<void> {
|
|
726
|
+
const req = ctx.input;
|
|
727
|
+
const workflow = ctx.get(TAG_VERSION_WORKFLOW_KEY) as Workflow;
|
|
694
728
|
|
|
695
729
|
// Move the tag in the audit store. A version_hash with no audit
|
|
696
730
|
// record yields AuditNotFoundError (the hash-exists check) and leaves
|