wicked-crew 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -18
- package/adapters/web-source.lock +1314 -0
- package/dist/api/audit.d.ts +5 -0
- package/dist/api/audit.d.ts.map +1 -1
- package/dist/api/audit.js +20 -0
- package/dist/api/audit.js.map +1 -1
- package/dist/api/auth.d.ts.map +1 -1
- package/dist/api/auth.js +3 -0
- package/dist/api/auth.js.map +1 -1
- package/dist/api/chat-context.js +1 -1
- package/dist/api/chat-history.d.ts +3 -0
- package/dist/api/chat-history.d.ts.map +1 -1
- package/dist/api/chat-history.js +6 -1
- package/dist/api/chat-history.js.map +1 -1
- package/dist/api/chat-jobs.d.ts +192 -0
- package/dist/api/chat-jobs.d.ts.map +1 -0
- package/dist/api/chat-jobs.js +929 -0
- package/dist/api/chat-jobs.js.map +1 -0
- package/dist/api/chat-proposals.d.ts +323 -7
- package/dist/api/chat-proposals.d.ts.map +1 -1
- package/dist/api/chat-proposals.js +1581 -40
- package/dist/api/chat-proposals.js.map +1 -1
- package/dist/api/chat-requirements.d.ts +54 -0
- package/dist/api/chat-requirements.d.ts.map +1 -0
- package/dist/api/chat-requirements.js +282 -0
- package/dist/api/chat-requirements.js.map +1 -0
- package/dist/api/chat-scope.d.ts +56 -0
- package/dist/api/chat-scope.d.ts.map +1 -1
- package/dist/api/chat-scope.js +175 -5
- package/dist/api/chat-scope.js.map +1 -1
- package/dist/api/chat-transcripts.d.ts +7 -0
- package/dist/api/chat-transcripts.d.ts.map +1 -1
- package/dist/api/chat-transcripts.js +17 -1
- package/dist/api/chat-transcripts.js.map +1 -1
- package/dist/api/delivery-assurance.d.ts.map +1 -1
- package/dist/api/delivery-assurance.js +5 -2
- package/dist/api/delivery-assurance.js.map +1 -1
- package/dist/api/delivery-index.d.ts +109 -5
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +199 -7
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/mcp.d.ts +7 -2
- package/dist/api/mcp.d.ts.map +1 -1
- package/dist/api/mcp.js +1 -1
- package/dist/api/mcp.js.map +1 -1
- package/dist/api/needs.d.ts.map +1 -1
- package/dist/api/needs.js +19 -1
- package/dist/api/needs.js.map +1 -1
- package/dist/api/product.d.ts +87 -3
- package/dist/api/product.d.ts.map +1 -1
- package/dist/api/product.js +155 -68
- package/dist/api/product.js.map +1 -1
- package/dist/api/proposal-theme.d.ts +23 -0
- package/dist/api/proposal-theme.d.ts.map +1 -0
- package/dist/api/proposal-theme.js +30 -0
- package/dist/api/proposal-theme.js.map +1 -0
- package/dist/api/recording.d.ts +127 -10
- package/dist/api/recording.d.ts.map +1 -1
- package/dist/api/recording.js +320 -68
- package/dist/api/recording.js.map +1 -1
- package/dist/api/repo-input.d.ts +55 -0
- package/dist/api/repo-input.d.ts.map +1 -0
- package/dist/api/repo-input.js +113 -0
- package/dist/api/repo-input.js.map +1 -0
- package/dist/api/requirements.d.ts +75 -0
- package/dist/api/requirements.d.ts.map +1 -1
- package/dist/api/requirements.js +97 -9
- package/dist/api/requirements.js.map +1 -1
- package/dist/api/review-change.d.ts +64 -0
- package/dist/api/review-change.d.ts.map +1 -0
- package/dist/api/review-change.js +214 -0
- package/dist/api/review-change.js.map +1 -0
- package/dist/api/roster-standing.d.ts +4 -0
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +43 -10
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +138 -12
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +1496 -301
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-documents.d.ts +97 -0
- package/dist/api/run-documents.d.ts.map +1 -0
- package/dist/api/run-documents.js +458 -0
- package/dist/api/run-documents.js.map +1 -0
- package/dist/api/run-sources.d.ts +51 -0
- package/dist/api/run-sources.d.ts.map +1 -0
- package/dist/api/run-sources.js +133 -0
- package/dist/api/run-sources.js.map +1 -0
- package/dist/api/run-timing-index.d.ts +12 -1
- package/dist/api/run-timing-index.d.ts.map +1 -1
- package/dist/api/run-timing-index.js +35 -0
- package/dist/api/run-timing-index.js.map +1 -1
- package/dist/api/runtime-state.d.ts +41 -0
- package/dist/api/runtime-state.d.ts.map +1 -0
- package/dist/api/runtime-state.js +75 -0
- package/dist/api/runtime-state.js.map +1 -0
- package/dist/api/seat-container-login.d.ts +51 -0
- package/dist/api/seat-container-login.d.ts.map +1 -1
- package/dist/api/seat-container-login.js +317 -1
- package/dist/api/seat-container-login.js.map +1 -1
- package/dist/api/seat-images.d.ts.map +1 -1
- package/dist/api/seat-images.js +7 -0
- package/dist/api/seat-images.js.map +1 -1
- package/dist/api/server.d.ts +7 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +207 -26
- package/dist/api/server.js.map +1 -1
- package/dist/api/skills.d.ts +8 -0
- package/dist/api/skills.d.ts.map +1 -1
- package/dist/api/skills.js +21 -0
- package/dist/api/skills.js.map +1 -1
- package/dist/api/system-snapshot.d.ts +3 -2
- package/dist/api/system-snapshot.d.ts.map +1 -1
- package/dist/api/system-snapshot.js +19 -6
- package/dist/api/system-snapshot.js.map +1 -1
- package/dist/api/testing.d.ts +3 -3
- package/dist/api/ui-text.d.ts +45 -0
- package/dist/api/ui-text.d.ts.map +1 -0
- package/dist/api/ui-text.js +188 -0
- package/dist/api/ui-text.js.map +1 -0
- package/dist/apps/actions/card.d.ts +62 -0
- package/dist/apps/actions/card.d.ts.map +1 -0
- package/dist/apps/actions/card.js +111 -0
- package/dist/apps/actions/card.js.map +1 -0
- package/dist/apps/actions/write-path.d.ts.map +1 -1
- package/dist/apps/actions/write-path.js +26 -77
- package/dist/apps/actions/write-path.js.map +1 -1
- package/dist/apps/exec/sources.d.ts.map +1 -1
- package/dist/apps/exec/sources.js +3 -0
- package/dist/apps/exec/sources.js.map +1 -1
- package/dist/apps/exec/texts.d.ts +1 -1
- package/dist/apps/publish/artifacts.d.ts +18 -0
- package/dist/apps/publish/artifacts.d.ts.map +1 -0
- package/dist/apps/publish/artifacts.js +87 -0
- package/dist/apps/publish/artifacts.js.map +1 -0
- package/dist/apps/publish/check.d.ts +103 -0
- package/dist/apps/publish/check.d.ts.map +1 -0
- package/dist/apps/publish/check.js +235 -0
- package/dist/apps/publish/check.js.map +1 -0
- package/dist/apps/publish/image.d.ts +2 -0
- package/dist/apps/publish/image.d.ts.map +1 -1
- package/dist/apps/publish/image.js +2 -1
- package/dist/apps/publish/image.js.map +1 -1
- package/dist/apps/publish/render.d.ts +71 -0
- package/dist/apps/publish/render.d.ts.map +1 -0
- package/dist/apps/publish/render.js +122 -0
- package/dist/apps/publish/render.js.map +1 -0
- package/dist/apps/publish/run.d.ts +35 -0
- package/dist/apps/publish/run.d.ts.map +1 -0
- package/dist/apps/publish/run.js +127 -0
- package/dist/apps/publish/run.js.map +1 -0
- package/dist/apps/routes.d.ts +54 -2
- package/dist/apps/routes.d.ts.map +1 -1
- package/dist/apps/routes.js +124 -7
- package/dist/apps/routes.js.map +1 -1
- package/dist/apps/spec.d.ts +8 -8
- package/dist/apps/store.d.ts +84 -5
- package/dist/apps/store.d.ts.map +1 -1
- package/dist/apps/store.js +191 -4
- package/dist/apps/store.js.map +1 -1
- package/dist/apps/turns.d.ts +19 -1
- package/dist/apps/turns.d.ts.map +1 -1
- package/dist/apps/turns.js +60 -2
- package/dist/apps/turns.js.map +1 -1
- package/dist/apps/views.d.ts +5 -1
- package/dist/apps/views.d.ts.map +1 -1
- package/dist/apps/views.js +18 -7
- package/dist/apps/views.js.map +1 -1
- package/dist/apps-server/Dockerfile +25 -0
- package/dist/apps-server/runners/sqlite-runner.mjs +110 -0
- package/dist/apps-server/server/lib/bundle/server.mjs +92523 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/LICENSE +22 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/README.md +106 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/enums.d.ts +76 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/enums.js +2 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/esm/enums.js +1 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/esm/index.js +2 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/esm/types.js +1 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/index.d.ts +2 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/index.js +18 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/package.json +36 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/types.d.ts +2488 -0
- package/dist/apps-server/server/node_modules/@pgsql/types/types.js +2 -0
- package/dist/apps-server/server/node_modules/libpg-query/LICENSE +22 -0
- package/dist/apps-server/server/node_modules/libpg-query/README.md +275 -0
- package/dist/apps-server/server/node_modules/libpg-query/package.json +58 -0
- package/dist/apps-server/server/node_modules/libpg-query/wasm/index.cjs +369 -0
- package/dist/apps-server/server/node_modules/libpg-query/wasm/index.d.ts +48 -0
- package/dist/apps-server/server/node_modules/libpg-query/wasm/index.js +344 -0
- package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.js +2 -0
- package/dist/apps-server/server/node_modules/libpg-query/wasm/libpg-query.wasm +0 -0
- package/dist/apps-server/server/shim/host.css +22 -0
- package/dist/apps-server/server/shim/host.js +1 -0
- package/dist/cli/apps-check.d.ts +18 -0
- package/dist/cli/apps-check.d.ts.map +1 -1
- package/dist/cli/apps-check.js +179 -5
- package/dist/cli/apps-check.js.map +1 -1
- package/dist/cli/apps-produce.d.ts +9 -0
- package/dist/cli/apps-produce.d.ts.map +1 -0
- package/dist/cli/apps-produce.js +27 -0
- package/dist/cli/apps-produce.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +15 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/insights-facts.d.ts +17 -0
- package/dist/cli/insights-facts.d.ts.map +1 -0
- package/dist/cli/insights-facts.js +56 -0
- package/dist/cli/insights-facts.js.map +1 -0
- package/dist/core/adapter.d.ts +85 -16
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +274 -54
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/builtin-catalog.d.ts.map +1 -1
- package/dist/core/builtin-catalog.js +2 -0
- package/dist/core/builtin-catalog.js.map +1 -1
- package/dist/core/deliver-text.d.ts +42 -6
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +204 -27
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +28 -7
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/engine-roster.d.ts.map +1 -1
- package/dist/core/engine-roster.js +1 -0
- package/dist/core/engine-roster.js.map +1 -1
- package/dist/core/estate-mcp-client.d.ts +3 -2
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +3 -2
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/qe-acceptance-setting.d.ts.map +1 -1
- package/dist/core/qe-acceptance-setting.js +6 -0
- package/dist/core/qe-acceptance-setting.js.map +1 -1
- package/dist/core/run-identity.d.ts.map +1 -1
- package/dist/core/run-identity.js +3 -0
- package/dist/core/run-identity.js.map +1 -1
- package/dist/core/types.d.ts +5 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/editors/conformance-runtime.d.ts +107 -0
- package/dist/editors/conformance-runtime.d.ts.map +1 -1
- package/dist/editors/conformance-runtime.js +268 -13
- package/dist/editors/conformance-runtime.js.map +1 -1
- package/dist/editors/csp.d.ts +2 -2
- package/dist/editors/csp.d.ts.map +1 -1
- package/dist/editors/csp.js +4 -2
- package/dist/editors/csp.js.map +1 -1
- package/dist/editors/pack-install.d.ts +28 -13
- package/dist/editors/pack-install.d.ts.map +1 -1
- package/dist/editors/pack-install.js +96 -48
- package/dist/editors/pack-install.js.map +1 -1
- package/dist/editors/registry.d.ts +111 -8
- package/dist/editors/registry.d.ts.map +1 -1
- package/dist/editors/registry.js +183 -7
- package/dist/editors/registry.js.map +1 -1
- package/dist/editors/routes.d.ts +66 -13
- package/dist/editors/routes.d.ts.map +1 -1
- package/dist/editors/routes.js +277 -44
- package/dist/editors/routes.js.map +1 -1
- package/dist/evals/replay.d.ts +6 -0
- package/dist/evals/replay.d.ts.map +1 -1
- package/dist/evals/replay.js +24 -1
- package/dist/evals/replay.js.map +1 -1
- package/dist/evals/routes.d.ts.map +1 -1
- package/dist/evals/routes.js +17 -2
- package/dist/evals/routes.js.map +1 -1
- package/dist/evals/runner.d.ts.map +1 -1
- package/dist/evals/runner.js +5 -0
- package/dist/evals/runner.js.map +1 -1
- package/dist/evals/shape-corrections.d.ts +146 -0
- package/dist/evals/shape-corrections.d.ts.map +1 -0
- package/dist/evals/shape-corrections.js +394 -0
- package/dist/evals/shape-corrections.js.map +1 -0
- package/dist/evals/shape.d.ts +145 -0
- package/dist/evals/shape.d.ts.map +1 -0
- package/dist/evals/shape.js +376 -0
- package/dist/evals/shape.js.map +1 -0
- package/dist/evals/types.d.ts +2 -2
- package/dist/evals/types.d.ts.map +1 -1
- package/dist/evals/types.js +2 -1
- package/dist/evals/types.js.map +1 -1
- package/dist/insights/analyze.d.ts +14 -1
- package/dist/insights/analyze.d.ts.map +1 -1
- package/dist/insights/analyze.js +35 -8
- package/dist/insights/analyze.js.map +1 -1
- package/dist/insights/cost.d.ts +123 -0
- package/dist/insights/cost.d.ts.map +1 -0
- package/dist/insights/cost.js +221 -0
- package/dist/insights/cost.js.map +1 -0
- package/dist/insights/review-service.d.ts +20 -1
- package/dist/insights/review-service.d.ts.map +1 -1
- package/dist/insights/review-service.js +50 -25
- package/dist/insights/review-service.js.map +1 -1
- package/dist/insights/routes.d.ts +29 -0
- package/dist/insights/routes.d.ts.map +1 -1
- package/dist/insights/routes.js +62 -0
- package/dist/insights/routes.js.map +1 -1
- package/dist/insights/run-facts.d.ts +16 -0
- package/dist/insights/run-facts.d.ts.map +1 -1
- package/dist/insights/run-facts.js +26 -3
- package/dist/insights/run-facts.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +11 -2
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +10 -1
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +74 -1
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +338 -6
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/doc-binding.d.ts +15 -0
- package/dist/interactive/doc-binding.d.ts.map +1 -1
- package/dist/interactive/doc-binding.js +4 -0
- package/dist/interactive/doc-binding.js.map +1 -1
- package/dist/interactive/doc-checks-routes.d.ts +34 -1
- package/dist/interactive/doc-checks-routes.d.ts.map +1 -1
- package/dist/interactive/doc-checks-routes.js +84 -0
- package/dist/interactive/doc-checks-routes.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +7 -0
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +38 -6
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +76 -6
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +219 -17
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +4 -2
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/interactive/landing-guard.d.ts +47 -0
- package/dist/interactive/landing-guard.d.ts.map +1 -0
- package/dist/interactive/landing-guard.js +43 -0
- package/dist/interactive/landing-guard.js.map +1 -0
- package/dist/interactive/landing-record.d.ts +68 -0
- package/dist/interactive/landing-record.d.ts.map +1 -0
- package/dist/interactive/landing-record.js +154 -0
- package/dist/interactive/landing-record.js.map +1 -0
- package/dist/interactive/proposal-create.d.ts +3 -1
- package/dist/interactive/proposal-create.d.ts.map +1 -1
- package/dist/interactive/proposal-create.js +14 -2
- package/dist/interactive/proposal-create.js.map +1 -1
- package/dist/interactive/proposal-refine.d.ts +48 -0
- package/dist/interactive/proposal-refine.d.ts.map +1 -0
- package/dist/interactive/proposal-refine.js +99 -0
- package/dist/interactive/proposal-refine.js.map +1 -0
- package/dist/interactive/protected-edits.d.ts +67 -0
- package/dist/interactive/protected-edits.d.ts.map +1 -0
- package/dist/interactive/protected-edits.js +160 -0
- package/dist/interactive/protected-edits.js.map +1 -0
- package/dist/interactive/proxy-routes.js +2 -2
- package/dist/interactive/review-events.js +1 -1
- package/dist/interactive/run-units.d.ts +1 -1
- package/dist/interactive/run-units.d.ts.map +1 -1
- package/dist/interactive/run-units.js +8 -2
- package/dist/interactive/run-units.js.map +1 -1
- package/dist/interactive/source-packet.d.ts +66 -1
- package/dist/interactive/source-packet.d.ts.map +1 -1
- package/dist/interactive/source-packet.js +309 -60
- package/dist/interactive/source-packet.js.map +1 -1
- package/dist/interactive/theme-events.js +1 -1
- package/dist/knowledge/adapters/web/egress.d.ts +99 -0
- package/dist/knowledge/adapters/web/egress.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/egress.js +330 -0
- package/dist/knowledge/adapters/web/egress.js.map +1 -0
- package/dist/knowledge/adapters/web/engine.d.ts +54 -0
- package/dist/knowledge/adapters/web/engine.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/engine.js +101 -0
- package/dist/knowledge/adapters/web/engine.js.map +1 -0
- package/dist/knowledge/adapters/web/fetch.d.ts +131 -0
- package/dist/knowledge/adapters/web/fetch.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/fetch.js +325 -0
- package/dist/knowledge/adapters/web/fetch.js.map +1 -0
- package/dist/knowledge/adapters/web/gate-web.d.ts +182 -0
- package/dist/knowledge/adapters/web/gate-web.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/gate-web.js +496 -0
- package/dist/knowledge/adapters/web/gate-web.js.map +1 -0
- package/dist/knowledge/adapters/web/routes.d.ts +36 -0
- package/dist/knowledge/adapters/web/routes.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/routes.js +99 -0
- package/dist/knowledge/adapters/web/routes.js.map +1 -0
- package/dist/knowledge/adapters/web/searxng.d.ts +89 -0
- package/dist/knowledge/adapters/web/searxng.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/searxng.js +274 -0
- package/dist/knowledge/adapters/web/searxng.js.map +1 -0
- package/dist/knowledge/adapters/web/source.d.ts +65 -0
- package/dist/knowledge/adapters/web/source.d.ts.map +1 -0
- package/dist/knowledge/adapters/web/source.js +192 -0
- package/dist/knowledge/adapters/web/source.js.map +1 -0
- package/dist/knowledge/gate/gate.d.ts +22 -0
- package/dist/knowledge/gate/gate.d.ts.map +1 -1
- package/dist/knowledge/gate/gate.js +62 -1
- package/dist/knowledge/gate/gate.js.map +1 -1
- package/dist/knowledge/gate/sources.d.ts +2 -0
- package/dist/knowledge/gate/sources.d.ts.map +1 -1
- package/dist/knowledge/gate/sources.js +5 -2
- package/dist/knowledge/gate/sources.js.map +1 -1
- package/dist/knowledge/package.d.ts +7 -0
- package/dist/knowledge/package.d.ts.map +1 -1
- package/dist/knowledge/package.js +15 -1
- package/dist/knowledge/package.js.map +1 -1
- package/dist/knowledge/trackers/actions.js +1 -1
- package/dist/knowledge/trackers/actions.js.map +1 -1
- package/dist/knowledge/trackers/bindings.d.ts +3 -3
- package/dist/knowledge/trackers/bindings.d.ts.map +1 -1
- package/dist/knowledge/trackers/bindings.js +36 -23
- package/dist/knowledge/trackers/bindings.js.map +1 -1
- package/dist/knowledge/trackers/routes.js +1 -1
- package/dist/knowledge/trackers/routes.js.map +1 -1
- package/dist/learnings/service.d.ts.map +1 -1
- package/dist/learnings/service.js +2 -0
- package/dist/learnings/service.js.map +1 -1
- package/dist/mcp/broker.d.ts +8 -0
- package/dist/mcp/broker.d.ts.map +1 -1
- package/dist/mcp/broker.js +48 -3
- package/dist/mcp/broker.js.map +1 -1
- package/dist/mcp/estate-relay.d.ts +43 -1
- package/dist/mcp/estate-relay.d.ts.map +1 -1
- package/dist/mcp/estate-relay.js +38 -2
- package/dist/mcp/estate-relay.js.map +1 -1
- package/dist/mcp/registry.d.ts +6 -0
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +42 -3
- package/dist/mcp/registry.js.map +1 -1
- package/dist/mcp/run-fence.d.ts +57 -0
- package/dist/mcp/run-fence.d.ts.map +1 -0
- package/dist/mcp/run-fence.js +86 -0
- package/dist/mcp/run-fence.js.map +1 -0
- package/dist/mcp/tool-list.d.ts +5 -0
- package/dist/mcp/tool-list.d.ts.map +1 -1
- package/dist/mcp/tool-list.js +7 -3
- package/dist/mcp/tool-list.js.map +1 -1
- package/dist/presets/routes.d.ts.map +1 -1
- package/dist/presets/routes.js +6 -0
- package/dist/presets/routes.js.map +1 -1
- package/dist/projects/routes.d.ts +1 -1
- package/dist/projects/state-home-preflight.d.ts.map +1 -1
- package/dist/projects/state-home-preflight.js +2 -0
- package/dist/projects/state-home-preflight.js.map +1 -1
- package/dist/setup/tool-path.d.ts +16 -0
- package/dist/setup/tool-path.d.ts.map +1 -0
- package/dist/setup/tool-path.js +66 -0
- package/dist/setup/tool-path.js.map +1 -0
- package/dist/skills/plugin-source.d.ts +42 -88
- package/dist/skills/plugin-source.d.ts.map +1 -1
- package/dist/skills/plugin-source.js +140 -100
- package/dist/skills/plugin-source.js.map +1 -1
- package/dist/skills/runtime.d.ts.map +1 -1
- package/dist/skills/runtime.js +15 -7
- package/dist/skills/runtime.js.map +1 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/store.js +25 -14
- package/dist/skills/store.js.map +1 -1
- package/dist/skills/usage.d.ts +238 -0
- package/dist/skills/usage.d.ts.map +1 -0
- package/dist/skills/usage.js +789 -0
- package/dist/skills/usage.js.map +1 -0
- package/dist/skills/venv.d.ts +18 -2
- package/dist/skills/venv.d.ts.map +1 -1
- package/dist/skills/venv.js +2 -2
- package/dist/skills/venv.js.map +1 -1
- package/dist/sources/routes.d.ts +3 -1
- package/dist/sources/routes.d.ts.map +1 -1
- package/dist/sources/routes.js +11 -0
- package/dist/sources/routes.js.map +1 -1
- package/dist/standing-orders/parse.d.ts +19 -0
- package/dist/standing-orders/parse.d.ts.map +1 -1
- package/dist/standing-orders/parse.js +61 -18
- package/dist/standing-orders/parse.js.map +1 -1
- package/dist/studio/apps-standalone/fixture.html +12 -0
- package/dist/studio/apps-standalone/fixture.js +10 -0
- package/dist/studio/apps-standalone/runtime.css +139 -0
- package/dist/studio/apps-standalone/runtime.js +1 -0
- package/dist/studio/assets/{KnowledgeGraph-Cpm46tEp.js → KnowledgeGraph-AtkRlS3c.js} +1 -1
- package/dist/studio/assets/index-CdbCAs7s.css +32 -0
- package/dist/studio/assets/index-DU_8o4uq.js +1104 -0
- package/dist/studio/editors/wicked-apps/editor.json +1 -1
- package/dist/studio/editors/wicked-apps/index.html +2 -2
- package/dist/studio/editors/wicked-deck/editor.json +1 -1
- package/dist/studio/editors/wicked-deck/index.html +14 -1
- package/dist/studio/editors/wicked-doc/editor.json +1 -1
- package/dist/studio/editors/wicked-doc/index.html +1 -1
- package/dist/studio/editors/wicked-insights/editor.json +1 -1
- package/dist/studio/editors/wicked-insights/index.html +1 -1
- package/dist/studio/editors/wicked-page/editor.json +10 -1
- package/dist/studio/editors/wicked-page/index.html +2 -2
- package/dist/studio/editors/wicked-video/editor.json +7 -2
- package/dist/studio/editors/wicked-video/index.html +14 -11
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +2069 -242
- package/dist/team/routes.d.ts +11 -1
- package/dist/team/routes.d.ts.map +1 -1
- package/dist/team/routes.js +27 -0
- package/dist/team/routes.js.map +1 -1
- package/dist/workflow-catalog/build-v2.d.ts +94 -0
- package/dist/workflow-catalog/build-v2.d.ts.map +1 -0
- package/dist/workflow-catalog/build-v2.js +551 -0
- package/dist/workflow-catalog/build-v2.js.map +1 -0
- package/dist/workflow-catalog/catalog-data-v2.d.ts +12 -0
- package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -0
- package/dist/workflow-catalog/catalog-data-v2.js +2787 -0
- package/dist/workflow-catalog/catalog-data-v2.js.map +1 -0
- package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
- package/dist/workflow-catalog/catalog-data.js +2 -20
- package/dist/workflow-catalog/catalog-data.js.map +1 -1
- package/dist/workflow-catalog/detect-service.d.ts +95 -0
- package/dist/workflow-catalog/detect-service.d.ts.map +1 -0
- package/dist/workflow-catalog/detect-service.js +239 -0
- package/dist/workflow-catalog/detect-service.js.map +1 -0
- package/dist/workflow-catalog/detect.d.ts +213 -0
- package/dist/workflow-catalog/detect.d.ts.map +1 -0
- package/dist/workflow-catalog/detect.js +653 -0
- package/dist/workflow-catalog/detect.js.map +1 -0
- package/dist/workflow-catalog/seeds-v2.d.ts +91 -0
- package/dist/workflow-catalog/seeds-v2.d.ts.map +1 -0
- package/dist/workflow-catalog/seeds-v2.js +2 -0
- package/dist/workflow-catalog/seeds-v2.js.map +1 -0
- package/dist/workflow-catalog/shape.d.ts +99 -0
- package/dist/workflow-catalog/shape.d.ts.map +1 -0
- package/dist/workflow-catalog/shape.js +103 -0
- package/dist/workflow-catalog/shape.js.map +1 -0
- package/dist/working-doc/bridge-backend.js +2 -2
- package/dist/working-doc/event-lines.d.ts +67 -2
- package/dist/working-doc/event-lines.d.ts.map +1 -1
- package/dist/working-doc/event-lines.js +155 -8
- package/dist/working-doc/event-lines.js.map +1 -1
- package/dist/working-doc/notes-index.d.ts +35 -0
- package/dist/working-doc/notes-index.d.ts.map +1 -0
- package/dist/working-doc/notes-index.js +82 -0
- package/dist/working-doc/notes-index.js.map +1 -0
- package/dist/working-doc/routes.js +4 -4
- package/dist/working-doc/sections.js +2 -2
- package/dist/working-doc/service.d.ts +260 -21
- package/dist/working-doc/service.d.ts.map +1 -1
- package/dist/working-doc/service.js +791 -90
- package/dist/working-doc/service.js.map +1 -1
- package/dist/working-doc/store.d.ts +50 -1
- package/dist/working-doc/store.d.ts.map +1 -1
- package/dist/working-doc/store.js +4 -1
- package/dist/working-doc/store.js.map +1 -1
- package/endpoint-manifest.json +219 -5
- package/evals/corpora/shape-corrections-v1.json +594 -0
- package/evals/corpora/shape-corrections-v1.seat-fixture.json +186 -0
- package/evals/corpora/shape-v1.json +2113 -0
- package/evals/corpora/shape-v1.seat-fixture.json +1800 -0
- package/package.json +31 -8
- package/scripts/apps-render.py +226 -0
- package/workflows/detect-shape.json +29 -0
- package/dist/studio/assets/index-BRBwWQMH.css +0 -32
- package/dist/studio/assets/index-CVrWDGRP.js +0 -1097
package/dist/apps/spec.d.ts
CHANGED
|
@@ -394,7 +394,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
394
394
|
value: string | number | boolean | null;
|
|
395
395
|
} | {
|
|
396
396
|
kind: "viewer";
|
|
397
|
-
claim: "email" | "
|
|
397
|
+
claim: "email" | "name" | "id";
|
|
398
398
|
} | {
|
|
399
399
|
kind: "crew";
|
|
400
400
|
value: "uuid" | "now";
|
|
@@ -406,7 +406,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
406
406
|
value: string | number | boolean | null;
|
|
407
407
|
} | {
|
|
408
408
|
kind: "viewer";
|
|
409
|
-
claim: "email" | "
|
|
409
|
+
claim: "email" | "name" | "id";
|
|
410
410
|
} | {
|
|
411
411
|
kind: "crew";
|
|
412
412
|
value: "uuid" | "now";
|
|
@@ -418,7 +418,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
418
418
|
value: string | number | boolean | null;
|
|
419
419
|
} | {
|
|
420
420
|
kind: "viewer";
|
|
421
|
-
claim: "email" | "
|
|
421
|
+
claim: "email" | "name" | "id";
|
|
422
422
|
} | {
|
|
423
423
|
kind: "crew";
|
|
424
424
|
value: "uuid" | "now";
|
|
@@ -430,7 +430,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
430
430
|
value: string | number | boolean | null;
|
|
431
431
|
} | {
|
|
432
432
|
kind: "viewer";
|
|
433
|
-
claim: "email" | "
|
|
433
|
+
claim: "email" | "name" | "id";
|
|
434
434
|
} | {
|
|
435
435
|
kind: "crew";
|
|
436
436
|
value: "uuid" | "now";
|
|
@@ -515,7 +515,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
515
515
|
value: string | number | boolean | null;
|
|
516
516
|
} | {
|
|
517
517
|
kind: "viewer";
|
|
518
|
-
claim: "email" | "
|
|
518
|
+
claim: "email" | "name" | "id";
|
|
519
519
|
} | {
|
|
520
520
|
kind: "crew";
|
|
521
521
|
value: "uuid" | "now";
|
|
@@ -527,7 +527,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
527
527
|
value: string | number | boolean | null;
|
|
528
528
|
} | {
|
|
529
529
|
kind: "viewer";
|
|
530
|
-
claim: "email" | "
|
|
530
|
+
claim: "email" | "name" | "id";
|
|
531
531
|
} | {
|
|
532
532
|
kind: "crew";
|
|
533
533
|
value: "uuid" | "now";
|
|
@@ -539,7 +539,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
539
539
|
value: string | number | boolean | null;
|
|
540
540
|
} | {
|
|
541
541
|
kind: "viewer";
|
|
542
|
-
claim: "email" | "
|
|
542
|
+
claim: "email" | "name" | "id";
|
|
543
543
|
} | {
|
|
544
544
|
kind: "crew";
|
|
545
545
|
value: "uuid" | "now";
|
|
@@ -551,7 +551,7 @@ export declare const AppSpecSchema: z.ZodObject<{
|
|
|
551
551
|
value: string | number | boolean | null;
|
|
552
552
|
} | {
|
|
553
553
|
kind: "viewer";
|
|
554
|
-
claim: "email" | "
|
|
554
|
+
claim: "email" | "name" | "id";
|
|
555
555
|
} | {
|
|
556
556
|
kind: "crew";
|
|
557
557
|
value: "uuid" | "now";
|
package/dist/apps/store.d.ts
CHANGED
|
@@ -16,8 +16,12 @@
|
|
|
16
16
|
* which commit is the app's head; the repo's `main` mirrors it and is re-pointed when it has moved (an
|
|
17
17
|
* agent seat could move it; nothing crew serves reads `main`).
|
|
18
18
|
*/
|
|
19
|
-
import type { Actor, AppCheckFinding, AppDetail, AppEditOp, AppReceipt, AppSpec, AppSummary, AppTurnRecord, AppTurnState, AppVersion, AppsCheckResponse, RepoEntry } from '../core/types.js';
|
|
19
|
+
import type { Actor, AppCheckFinding, AppDetail, AppEditOp, AppLock, AppReceipt, AppSpec, AppSummary, AppTurnRecord, AppTurnState, AppVersion, AppPublishBody, AppPublishManifest, AppPublished, AppsCheckResponse, RepoEntry } from '../core/types.js';
|
|
20
20
|
import { type AppFiles, type AppSourceStage } from './check.js';
|
|
21
|
+
import { AppGit } from './git.js';
|
|
22
|
+
import type { ImageSources } from './publish/layout.js';
|
|
23
|
+
import type { PublishCheckDeps } from './publish/check.js';
|
|
24
|
+
import type { ManifestInput, ManifestOutcome, PublishFinding } from './publish/manifest.js';
|
|
21
25
|
/** The state-home file name (the registered `daemon-` file prefix). */
|
|
22
26
|
export declare const APPS_STATE_FILENAME = "daemon-apps.json";
|
|
23
27
|
/**
|
|
@@ -34,16 +38,42 @@ export declare class AppStoreError extends Error {
|
|
|
34
38
|
readonly extra: {
|
|
35
39
|
head?: number;
|
|
36
40
|
turn?: AppTurnState;
|
|
37
|
-
findings?: AppCheckFinding[];
|
|
41
|
+
findings?: AppCheckFinding[] | PublishFinding[];
|
|
38
42
|
suggestion?: string;
|
|
39
43
|
};
|
|
40
44
|
constructor(status: number, code: string, message: string, extra?: {
|
|
41
45
|
head?: number;
|
|
42
46
|
turn?: AppTurnState;
|
|
43
|
-
findings?: AppCheckFinding[];
|
|
47
|
+
findings?: AppCheckFinding[] | PublishFinding[];
|
|
44
48
|
suggestion?: string;
|
|
45
49
|
});
|
|
46
50
|
}
|
|
51
|
+
/** The manifest and source descriptors the run checks, consents to and produces, kept outside the app repo. */
|
|
52
|
+
export interface StoredPublish {
|
|
53
|
+
runId: string;
|
|
54
|
+
base: number;
|
|
55
|
+
tree: string;
|
|
56
|
+
commit: string;
|
|
57
|
+
body: AppPublishBody;
|
|
58
|
+
manifest: AppPublishManifest;
|
|
59
|
+
digest: string;
|
|
60
|
+
sources: ImageSources;
|
|
61
|
+
launchedBy: Actor;
|
|
62
|
+
at: number;
|
|
63
|
+
state: 'running' | 'published' | 'failed' | 'cancelled';
|
|
64
|
+
published?: AppPublished;
|
|
65
|
+
}
|
|
66
|
+
export interface AppPublisher {
|
|
67
|
+
manifestFor(input: Pick<ManifestInput, 'app' | 'files' | 'body'>): Promise<ManifestOutcome>;
|
|
68
|
+
launch(publish: StoredPublish, input: {
|
|
69
|
+
repoId: string;
|
|
70
|
+
projectId: string;
|
|
71
|
+
excludeSeats: string[];
|
|
72
|
+
}): Promise<void>;
|
|
73
|
+
status(runId: string): Promise<'running' | 'failed' | 'cancelled'>;
|
|
74
|
+
}
|
|
75
|
+
/** Which apps a list holds: the active ones (the default), the archived ones, or all of them. */
|
|
76
|
+
export type AppListScope = 'active' | 'archived' | 'all';
|
|
47
77
|
/** How many turns an app's record keeps, and how many its detail answers. */
|
|
48
78
|
export declare const TURN_LOG_MAX = 50;
|
|
49
79
|
export declare const TURN_LOG_SHOWN = 20;
|
|
@@ -133,6 +163,7 @@ export declare class AppStore {
|
|
|
133
163
|
private readonly treeCache;
|
|
134
164
|
sourceStage: AppSourceStage | null;
|
|
135
165
|
turns: AppTurnLauncher | null;
|
|
166
|
+
publisher: AppPublisher | null;
|
|
136
167
|
private readonly registry;
|
|
137
168
|
constructor(opts: AppStoreOptions);
|
|
138
169
|
private read;
|
|
@@ -163,13 +194,31 @@ export declare class AppStore {
|
|
|
163
194
|
private summary;
|
|
164
195
|
/** The project an app belongs to, or `null` when there is no such app (a knowledge query reads only its project's). */
|
|
165
196
|
projectOf(slug: string): string | null;
|
|
166
|
-
|
|
197
|
+
/** The apps of one project (or every project), the active ones unless `scope` says otherwise. */
|
|
198
|
+
list(projectId?: string, scope?: AppListScope): AppSummary[];
|
|
167
199
|
private historyOf;
|
|
168
200
|
/** A tree crew landed, read from the repo's objects (cached: trees are immutable). */
|
|
169
201
|
private files;
|
|
170
202
|
detail(slug: string): Promise<AppDetail>;
|
|
171
203
|
/** (K5) The app whose turn in flight is `runId`, or `null`. */
|
|
172
204
|
turnApp(runId: string): string | null;
|
|
205
|
+
publishRunApp(runId: string): string | null;
|
|
206
|
+
publishOf(runId: string): StoredPublish | null;
|
|
207
|
+
/**
|
|
208
|
+
* (CS2 §P2) What the publish check of `slug`'s publish runs reads: the persisted publish, the files of a tree
|
|
209
|
+
* (verified objects), the staged check of every query and action on that tree (`full`: no lock is written and
|
|
210
|
+
* nothing lands), the manifest rebuilt from the persisted body against today's sources and grants, and the
|
|
211
|
+
* standalone runtime.
|
|
212
|
+
*/
|
|
213
|
+
publishCheckDeps(slug: string): PublishCheckDeps;
|
|
214
|
+
private refreshPublishes;
|
|
215
|
+
private publishBusy;
|
|
216
|
+
beginPublish(slug: string, input: {
|
|
217
|
+
body: AppPublishBody;
|
|
218
|
+
actor: Actor;
|
|
219
|
+
}): Promise<StoredPublish>;
|
|
220
|
+
/** Serialize production and persist its artifacts and receipt together. Concurrent retries build once. */
|
|
221
|
+
producePublish(runId: string, build: (p: StoredPublish, files: AppFiles, git: AppGit) => Promise<AppPublished>): Promise<AppPublished>;
|
|
173
222
|
/** (K5) The turns of `slug`, oldest first (at most {@link TURN_LOG_SHOWN}). */
|
|
174
223
|
turnLog(slug: string): AppTurnRecord[];
|
|
175
224
|
/** (K5) Write `patch` onto `runId`'s turn record (inside a transaction). */
|
|
@@ -207,6 +256,21 @@ export declare class AppStore {
|
|
|
207
256
|
version: number | null;
|
|
208
257
|
receipt: AppReceipt;
|
|
209
258
|
}>;
|
|
259
|
+
/**
|
|
260
|
+
* (G3, G16b) An earlier accepted version as it was: its record (when it is a version of this app) and its files, read
|
|
261
|
+
* through {@link acceptedFiles} (the same verified objects the executor reads). A version with no accepted receipt
|
|
262
|
+
* is `409 not_accepted`; one the app does not have is `404 unknown_version`.
|
|
263
|
+
*/
|
|
264
|
+
versionRead(slug: string, version: number | string): Promise<{
|
|
265
|
+
slug: string;
|
|
266
|
+
version: AppVersion | null;
|
|
267
|
+
commit: string;
|
|
268
|
+
tree: string;
|
|
269
|
+
receipt: AppReceipt;
|
|
270
|
+
spec: AppSpec;
|
|
271
|
+
lock: AppLock;
|
|
272
|
+
queryText: Record<string, string>;
|
|
273
|
+
}>;
|
|
210
274
|
/**
|
|
211
275
|
* A turn whose run has ended no longer holds the app (a lost end event, a restart). The engine is asked
|
|
212
276
|
* outside any lock; the turn is cleared only under the app's lock (`locked`: the caller holds it), only if
|
|
@@ -222,7 +286,11 @@ export declare class AppStore {
|
|
|
222
286
|
/** (K5) Settle `runId`'s turn now (its run ended): the event path's entry. A turn still running is left alone. */
|
|
223
287
|
settleTurn(slug: string, runId: string): Promise<void>;
|
|
224
288
|
private turnInFlight;
|
|
225
|
-
|
|
289
|
+
private archivedError;
|
|
290
|
+
/**
|
|
291
|
+
* The guard every change runs first: no turn in flight, not archived (checked before the base, so an archived app
|
|
292
|
+
* answers `app_archived` even to a stale base), the base is the head, `main` mirrors the head.
|
|
293
|
+
*/
|
|
226
294
|
private guard;
|
|
227
295
|
beginTurn(slug: string, input: {
|
|
228
296
|
base: number;
|
|
@@ -335,6 +403,17 @@ export declare class AppStore {
|
|
|
335
403
|
version: number | string;
|
|
336
404
|
actor: Actor;
|
|
337
405
|
}): Promise<AppVersion>;
|
|
406
|
+
/**
|
|
407
|
+
* `POST /apps/:app/archive`: hide the app from the lists and close it to every change, under the app's lock (so it
|
|
408
|
+
* waits for an edit, a move or a restore in flight, and none starts meanwhile). A turn in flight refuses it
|
|
409
|
+
* (`409 turn_in_flight`): a turn must never land into an app nobody sees. Archiving an archived app changes nothing.
|
|
410
|
+
* Answers whether it changed.
|
|
411
|
+
*/
|
|
412
|
+
archive(slug: string, input: {
|
|
413
|
+
actor: Actor;
|
|
414
|
+
}): Promise<boolean>;
|
|
415
|
+
/** `POST /apps/:app/unarchive`: the app is listed and open to changes again, exactly as it was. Answers whether it changed. */
|
|
416
|
+
unarchive(slug: string): Promise<boolean>;
|
|
338
417
|
}
|
|
339
418
|
/** The apps root: `WICKED_CREW_APPS_ROOT`, else `~/.wicked/apps`. */
|
|
340
419
|
export declare function defaultAppsRoot(env?: NodeJS.ProcessEnv): string;
|
package/dist/apps/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/apps/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EAEf,SAAS,EACT,SAAS,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/apps/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EAEf,SAAS,EACT,SAAS,EAET,OAAO,EACP,UAAU,EAEV,OAAO,EAEP,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAqH,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AACnL,OAAO,EAAE,MAAM,EAAsB,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5F,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAAoD,CAAC;AAC7E,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAA4C,CAAC;AAKhG,qBAAa,aAAc,SAAQ,KAAK;IAEpC,QAAQ,C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OAKG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAetE,+HAA+H;IACzH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAUhD;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAK5E"}
|
package/dist/apps/store.js
CHANGED
|
@@ -22,6 +22,7 @@ import { rm } from 'node:fs/promises';
|
|
|
22
22
|
import { dirname, join } from 'node:path';
|
|
23
23
|
import { EMPTY_LOCK, LOCK_PATH, QUERIES_DIR, QUERY_EXT, SPEC_PATH, lockBytes, ownText, readAppTree, specBytes, stagedCheck } from './check.js';
|
|
24
24
|
import { AppGit, gitProblem, SHA_RE } from './git.js';
|
|
25
|
+
import { appsRuntime } from './publish/artifacts.js';
|
|
25
26
|
/** The state-home file name (the registered `daemon-` file prefix). */
|
|
26
27
|
export const APPS_STATE_FILENAME = 'daemon-apps.json';
|
|
27
28
|
/**
|
|
@@ -31,7 +32,7 @@ export const APPS_STATE_FILENAME = 'daemon-apps.json';
|
|
|
31
32
|
* routes, not apps.
|
|
32
33
|
*/
|
|
33
34
|
export const APP_SLUG_RE = /^(?=.{1,48}$)[a-z][a-z0-9]*(?:-[a-z0-9]+){0,3}$/;
|
|
34
|
-
export const RESERVED_APP_SLUGS = new Set(['check', 'uploads']);
|
|
35
|
+
export const RESERVED_APP_SLUGS = new Set(['check', 'produce', 'uploads']);
|
|
35
36
|
/** The receipts that make a tree part of an app's accepted history (DES §6.4). */
|
|
36
37
|
const ACCEPTED = new Set(['you', 'reviewed', 'restored']);
|
|
37
38
|
export class AppStoreError extends Error {
|
|
@@ -67,6 +68,7 @@ export class AppStore {
|
|
|
67
68
|
treeCache = new Map();
|
|
68
69
|
sourceStage;
|
|
69
70
|
turns;
|
|
71
|
+
publisher = null;
|
|
70
72
|
registry;
|
|
71
73
|
constructor(opts) {
|
|
72
74
|
this.stateFile = opts.stateFile;
|
|
@@ -160,16 +162,20 @@ export class AppStore {
|
|
|
160
162
|
summary(a) {
|
|
161
163
|
const h = this.head(a);
|
|
162
164
|
const turn = a.turn === null ? null : { runId: a.turn.runId, startedAt: a.turn.startedAt, base: a.turn.base, actor: a.turn.actor };
|
|
163
|
-
|
|
165
|
+
const archived = a.archived == null ? null : { at: a.archived.at, by: a.archived.by };
|
|
166
|
+
const published = Object.values(a.publishes ?? {}).flatMap((p) => p.published === undefined ? [] : [p.published]).sort((x, y) => y.at - x.at)[0] ?? null;
|
|
167
|
+
return { slug: a.slug, name: a.name, projectId: a.projectId, repoId: a.repoId, createdAt: a.createdAt, head: { version: h.version, tree: h.tree, receipt: h.receipt?.kind ?? null }, turn, archived, published };
|
|
164
168
|
}
|
|
165
169
|
/** The project an app belongs to, or `null` when there is no such app (a knowledge query reads only its project's). */
|
|
166
170
|
projectOf(slug) {
|
|
167
171
|
const a = Object.hasOwn(this.state.apps, slug) ? this.state.apps[slug] : undefined;
|
|
168
172
|
return a === undefined || typeof a.projectId !== 'string' || a.projectId === '' ? null : a.projectId;
|
|
169
173
|
}
|
|
170
|
-
|
|
174
|
+
/** The apps of one project (or every project), the active ones unless `scope` says otherwise. */
|
|
175
|
+
list(projectId, scope = 'active') {
|
|
171
176
|
return Object.values(this.state.apps)
|
|
172
177
|
.filter((a) => projectId === undefined || a.projectId === projectId)
|
|
178
|
+
.filter((a) => scope === 'all' || (scope === 'archived') === (a.archived != null))
|
|
173
179
|
.sort((x, y) => x.createdAt - y.createdAt || x.slug.localeCompare(y.slug))
|
|
174
180
|
.map((a) => this.summary(a));
|
|
175
181
|
}
|
|
@@ -212,6 +218,130 @@ export class AppStore {
|
|
|
212
218
|
return a.slug;
|
|
213
219
|
return null;
|
|
214
220
|
}
|
|
221
|
+
publishRunApp(runId) {
|
|
222
|
+
for (const a of Object.values(this.state.apps))
|
|
223
|
+
if (Object.hasOwn(a.publishes ?? {}, runId))
|
|
224
|
+
return a.slug;
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
publishOf(runId) {
|
|
228
|
+
const slug = this.publishRunApp(runId);
|
|
229
|
+
return slug === null ? null : structuredClone(this.app(slug).publishes[runId]);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* (CS2 §P2) What the publish check of `slug`'s publish runs reads: the persisted publish, the files of a tree
|
|
233
|
+
* (verified objects), the staged check of every query and action on that tree (`full`: no lock is written and
|
|
234
|
+
* nothing lands), the manifest rebuilt from the persisted body against today's sources and grants, and the
|
|
235
|
+
* standalone runtime.
|
|
236
|
+
*/
|
|
237
|
+
publishCheckDeps(slug) {
|
|
238
|
+
return {
|
|
239
|
+
publishOf: (runId) => {
|
|
240
|
+
const p = this.publishRunApp(runId) === slug ? this.publishOf(runId) : null;
|
|
241
|
+
return p === null ? null : { runId: p.runId, slug, base: p.base, tree: p.tree, commit: p.commit, manifest: p.manifest, digest: p.digest, sources: p.sources };
|
|
242
|
+
},
|
|
243
|
+
filesOf: async (tree) => this.files(this.app(slug), tree),
|
|
244
|
+
recheck: async (tree) => {
|
|
245
|
+
const files = await this.files(this.app(slug), tree);
|
|
246
|
+
return stagedCheck({ app: slug, spec: files.spec, queryText: files.queryText, base: null, level: 'full', sourceStage: this.sourceStage });
|
|
247
|
+
},
|
|
248
|
+
rebuildManifest: async (rec, lock) => {
|
|
249
|
+
const publisher = this.publisher;
|
|
250
|
+
if (publisher === null)
|
|
251
|
+
throw new AppStoreError(503, 'apps_unavailable', 'this daemon cannot check apps-publish runs yet');
|
|
252
|
+
const a = this.app(slug);
|
|
253
|
+
const stored = a.publishes?.[rec.runId];
|
|
254
|
+
if (stored === undefined)
|
|
255
|
+
throw new AppStoreError(404, 'no_publish', `run ${rec.runId} is not a publish of ${slug}`);
|
|
256
|
+
return publisher.manifestFor({ app: { slug, name: a.name, version: stored.base, tree: stored.tree, commit: stored.commit }, files: { ...await this.files(a, stored.tree), lock }, body: structuredClone(stored.body) });
|
|
257
|
+
},
|
|
258
|
+
runtime: () => appsRuntime(),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
async refreshPublishes(a) {
|
|
262
|
+
if (this.publisher === null)
|
|
263
|
+
return;
|
|
264
|
+
for (const p of Object.values(a.publishes ?? {})) {
|
|
265
|
+
if (p.state !== 'running' || this.launching.has(p.runId))
|
|
266
|
+
continue;
|
|
267
|
+
// An unavailable engine keeps the app held; it is never evidence that a run ended.
|
|
268
|
+
const state = await this.publisher.status(p.runId).catch(() => 'running');
|
|
269
|
+
if (state !== 'running')
|
|
270
|
+
this.transact(a.slug, () => { p.state = state; });
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
publishBusy(a) {
|
|
274
|
+
return Object.values(a.publishes ?? {}).some((p) => p.state === 'running');
|
|
275
|
+
}
|
|
276
|
+
async beginPublish(slug, input) {
|
|
277
|
+
return this.withApp(slug, async () => {
|
|
278
|
+
const publisher = this.publisher;
|
|
279
|
+
if (publisher === null)
|
|
280
|
+
throw new AppStoreError(503, 'apps_unavailable', 'this daemon cannot launch apps-publish runs yet');
|
|
281
|
+
let a = this.app(slug);
|
|
282
|
+
const h = this.head(a);
|
|
283
|
+
if (h.version !== input.body.base)
|
|
284
|
+
throw new AppStoreError(409, 'stale_base', `publish was made on v${input.body.base}, but ${slug} is at v${h.version}`, { head: h.version });
|
|
285
|
+
if (this.acceptedReceipt(slug, h.tree) === null)
|
|
286
|
+
throw new AppStoreError(409, 'not_accepted', `v${h.version} holds no accepted receipt`);
|
|
287
|
+
await this.refreshTurn(a, { locked: true });
|
|
288
|
+
a = this.app(slug);
|
|
289
|
+
await this.refreshPublishes(a);
|
|
290
|
+
if (a.turn !== null || this.publishBusy(a))
|
|
291
|
+
throw new AppStoreError(409, 'busy', `a turn or publish is already running for ${slug}`);
|
|
292
|
+
if (a.archived != null)
|
|
293
|
+
throw this.archivedError(a, 'publishing it');
|
|
294
|
+
if (a.repoId === '')
|
|
295
|
+
throw new AppStoreError(409, 'not_registered', `${slug}'s repository is not registered yet`);
|
|
296
|
+
// A turn settlement may have landed while refreshing; recheck the caller's base under this same lock.
|
|
297
|
+
if (this.head(a).version !== h.version)
|
|
298
|
+
throw new AppStoreError(409, 'stale_base', `${slug}'s head changed while its turn ended`, { head: this.head(a).version });
|
|
299
|
+
const outcome = await publisher.manifestFor({ app: { slug, name: a.name, version: h.version, tree: h.tree, commit: h.commit }, files: await this.files(a, h.tree), body: input.body });
|
|
300
|
+
if (!outcome.ok)
|
|
301
|
+
throw new AppStoreError(422, 'publish_refused', outcome.findings.map((f) => f.message).join('; '), { findings: outcome.findings });
|
|
302
|
+
const runId = `apps-publish-${slug}-${randomBytes(6).toString('hex')}`;
|
|
303
|
+
const p = { runId, base: h.version, tree: h.tree, commit: h.commit, body: structuredClone(input.body), manifest: outcome.manifest, digest: outcome.digest, sources: outcome.sources, launchedBy: input.actor, at: this.now(), state: 'running' };
|
|
304
|
+
const receipts = Object.values(a.receipts).flat();
|
|
305
|
+
const last = Math.max(0, ...receipts.filter((r) => r.kind === 'published').map((r) => r.version));
|
|
306
|
+
const excludeSeats = [...new Set(receipts.filter((r) => r.kind === 'reviewed' && r.version > last).flatMap((r) => r.review === undefined ? [] : [r.review.builder]))];
|
|
307
|
+
this.launching.add(runId);
|
|
308
|
+
try {
|
|
309
|
+
this.transact(slug, () => { (a.publishes ??= {})[runId] = p; });
|
|
310
|
+
await publisher.launch(structuredClone(p), { repoId: a.repoId, projectId: a.projectId, excludeSeats });
|
|
311
|
+
}
|
|
312
|
+
catch (err) {
|
|
313
|
+
if (a.publishes?.[runId] !== undefined)
|
|
314
|
+
this.transact(slug, () => { a.publishes[runId].state = 'failed'; });
|
|
315
|
+
throw new AppStoreError(409, 'launch_refused', err instanceof Error ? err.message : String(err));
|
|
316
|
+
}
|
|
317
|
+
finally {
|
|
318
|
+
this.launching.delete(runId);
|
|
319
|
+
}
|
|
320
|
+
return structuredClone(p);
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
/** Serialize production and persist its artifacts and receipt together. Concurrent retries build once. */
|
|
324
|
+
async producePublish(runId, build) {
|
|
325
|
+
const slug = this.publishRunApp(runId);
|
|
326
|
+
if (slug === null)
|
|
327
|
+
throw new AppStoreError(403, 'not_the_produce', 'only a publish run can produce an app');
|
|
328
|
+
return this.withApp(slug, async () => {
|
|
329
|
+
const a = this.app(slug);
|
|
330
|
+
const p = a.publishes[runId];
|
|
331
|
+
if (p.state === 'published' && p.published?.manifestDigest === p.digest)
|
|
332
|
+
return structuredClone(p.published);
|
|
333
|
+
if (p.state !== 'running')
|
|
334
|
+
throw new AppStoreError(403, 'not_the_produce', 'this publish run is no longer running');
|
|
335
|
+
const published = await build(structuredClone(p), await this.files(a, p.tree), this.git(a));
|
|
336
|
+
const receipt = { kind: 'published', version: p.base, tree: p.tree, at: published.at, actor: p.launchedBy, publish: { runId, manifestDigest: p.digest, artifacts: { image: published.image.id } } };
|
|
337
|
+
this.transact(slug, () => {
|
|
338
|
+
p.state = 'published';
|
|
339
|
+
p.published = published;
|
|
340
|
+
(a.receipts[p.tree] ??= []).push(receipt);
|
|
341
|
+
});
|
|
342
|
+
return structuredClone(published);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
215
345
|
/** (K5) The turns of `slug`, oldest first (at most {@link TURN_LOG_SHOWN}). */
|
|
216
346
|
turnLog(slug) {
|
|
217
347
|
return structuredClone((this.app(slug).turnLog ?? []).slice(-TURN_LOG_SHOWN));
|
|
@@ -285,6 +415,17 @@ export class AppStore {
|
|
|
285
415
|
throw new AppStoreError(409, 'not_accepted', `tree ${r.tree} holds no accepted receipt for app ${slug}: it never runs against a source`);
|
|
286
416
|
return { files: await this.files(a, r.tree), tree: r.tree, commit: r.commit, version: r.version, receipt };
|
|
287
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* (G3, G16b) An earlier accepted version as it was: its record (when it is a version of this app) and its files, read
|
|
420
|
+
* through {@link acceptedFiles} (the same verified objects the executor reads). A version with no accepted receipt
|
|
421
|
+
* is `409 not_accepted`; one the app does not have is `404 unknown_version`.
|
|
422
|
+
*/
|
|
423
|
+
async versionRead(slug, version) {
|
|
424
|
+
const read = await this.acceptedFiles(slug, version);
|
|
425
|
+
const a = this.app(slug);
|
|
426
|
+
const record = read.version === null ? null : structuredClone(a.versions[read.version - 1] ?? null);
|
|
427
|
+
return { slug, version: record, commit: read.commit, tree: read.tree, receipt: structuredClone(read.receipt), spec: read.files.spec, lock: read.files.lock, queryText: { ...read.files.queryText } };
|
|
428
|
+
}
|
|
288
429
|
// ── The turn lock ───────────────────────────────────────────────────────────────────────────────
|
|
289
430
|
/**
|
|
290
431
|
* A turn whose run has ended no longer holds the app (a lost end event, a restart). The engine is asked
|
|
@@ -396,13 +537,24 @@ export class AppStore {
|
|
|
396
537
|
turn: { runId: t.runId, startedAt: t.startedAt, base: t.base, actor: t.actor },
|
|
397
538
|
});
|
|
398
539
|
}
|
|
399
|
-
|
|
540
|
+
archivedError(a, what) {
|
|
541
|
+
return new AppStoreError(409, 'app_archived', `${a.slug} is archived; ${what} waits until it is restored`);
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* The guard every change runs first: no turn in flight, not archived (checked before the base, so an archived app
|
|
545
|
+
* answers `app_archived` even to a stale base), the base is the head, `main` mirrors the head.
|
|
546
|
+
*/
|
|
400
547
|
async guard(a, base, what, opts = {}) {
|
|
401
548
|
// Landing a turn is that turn settling: asking the engine about it again would settle it twice.
|
|
402
549
|
if (opts.turnRun === undefined)
|
|
403
550
|
await this.refreshTurn(a, { locked: true });
|
|
551
|
+
await this.refreshPublishes(a);
|
|
552
|
+
if (this.publishBusy(a))
|
|
553
|
+
throw new AppStoreError(409, 'busy', `a publish is running for ${a.slug}; ${what} waits until it ends`);
|
|
404
554
|
if (a.turn !== null && a.turn.runId !== opts.turnRun)
|
|
405
555
|
throw this.turnInFlight(a, what);
|
|
556
|
+
if (a.archived != null)
|
|
557
|
+
throw this.archivedError(a, what);
|
|
406
558
|
const h = this.head(a);
|
|
407
559
|
if (base !== h.version) {
|
|
408
560
|
throw new AppStoreError(409, 'stale_base', `${what} was made on v${base}, but ${a.slug} is at v${h.version}; reload and try again`, { head: h.version });
|
|
@@ -893,6 +1045,41 @@ export class AppStore {
|
|
|
893
1045
|
});
|
|
894
1046
|
});
|
|
895
1047
|
}
|
|
1048
|
+
// ── Archive (G16, operator ruling D5: archive with Restore, never a hard delete) ────────────────────
|
|
1049
|
+
/**
|
|
1050
|
+
* `POST /apps/:app/archive`: hide the app from the lists and close it to every change, under the app's lock (so it
|
|
1051
|
+
* waits for an edit, a move or a restore in flight, and none starts meanwhile). A turn in flight refuses it
|
|
1052
|
+
* (`409 turn_in_flight`): a turn must never land into an app nobody sees. Archiving an archived app changes nothing.
|
|
1053
|
+
* Answers whether it changed.
|
|
1054
|
+
*/
|
|
1055
|
+
async archive(slug, input) {
|
|
1056
|
+
return this.withApp(slug, async () => {
|
|
1057
|
+
const a = this.app(slug);
|
|
1058
|
+
if (a.archived != null)
|
|
1059
|
+
return false;
|
|
1060
|
+
await this.refreshTurn(a, { locked: true });
|
|
1061
|
+
// A settlement may have swapped the record for a clone: read it again.
|
|
1062
|
+
const cur = this.app(slug);
|
|
1063
|
+
if (cur.turn !== null)
|
|
1064
|
+
throw this.turnInFlight(cur, 'archiving it');
|
|
1065
|
+
this.transact(slug, () => {
|
|
1066
|
+
cur.archived = { at: this.now(), by: input.actor.id };
|
|
1067
|
+
});
|
|
1068
|
+
return true;
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
/** `POST /apps/:app/unarchive`: the app is listed and open to changes again, exactly as it was. Answers whether it changed. */
|
|
1072
|
+
async unarchive(slug) {
|
|
1073
|
+
return this.withApp(slug, async () => {
|
|
1074
|
+
const a = this.app(slug);
|
|
1075
|
+
if (a.archived == null)
|
|
1076
|
+
return false;
|
|
1077
|
+
this.transact(slug, () => {
|
|
1078
|
+
a.archived = null;
|
|
1079
|
+
});
|
|
1080
|
+
return true;
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
896
1083
|
}
|
|
897
1084
|
/** The apps root: `WICKED_CREW_APPS_ROOT`, else `~/.wicked/apps`. */
|
|
898
1085
|
export function defaultAppsRoot(env = process.env) {
|