@xfey/tutti 0.1.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 +50 -0
- package/dist/approvals/index.d.ts +3 -0
- package/dist/approvals/index.js +3 -0
- package/dist/approvals/manager.d.ts +47 -0
- package/dist/approvals/manager.js +180 -0
- package/dist/approvals/projections.d.ts +34 -0
- package/dist/approvals/projections.js +444 -0
- package/dist/artifacts/index.d.ts +4 -0
- package/dist/artifacts/index.js +4 -0
- package/dist/artifacts/manifest.d.ts +48 -0
- package/dist/artifacts/manifest.js +334 -0
- package/dist/artifacts/preview-runtime.d.ts +97 -0
- package/dist/artifacts/preview-runtime.js +585 -0
- package/dist/artifacts/static-preview.d.ts +17 -0
- package/dist/artifacts/static-preview.js +180 -0
- package/dist/chat-assistant/index.d.ts +66 -0
- package/dist/chat-assistant/index.js +268 -0
- package/dist/checks/index.d.ts +47 -0
- package/dist/checks/index.js +169 -0
- package/dist/collaboration-state/clarification-messages.d.ts +8 -0
- package/dist/collaboration-state/clarification-messages.js +180 -0
- package/dist/collaboration-state/clarification-records.d.ts +27 -0
- package/dist/collaboration-state/clarification-records.js +266 -0
- package/dist/collaboration-state/clarification-round-writes.d.ts +14 -0
- package/dist/collaboration-state/clarification-round-writes.js +58 -0
- package/dist/collaboration-state/clarification-rounds.d.ts +19 -0
- package/dist/collaboration-state/clarification-rounds.js +347 -0
- package/dist/collaboration-state/clarification-successors.d.ts +8 -0
- package/dist/collaboration-state/clarification-successors.js +318 -0
- package/dist/collaboration-state/execution-status.d.ts +3 -0
- package/dist/collaboration-state/execution-status.js +8 -0
- package/dist/collaboration-state/index.d.ts +17 -0
- package/dist/collaboration-state/index.js +16 -0
- package/dist/collaboration-state/messages.d.ts +25 -0
- package/dist/collaboration-state/messages.js +371 -0
- package/dist/collaboration-state/read-state.d.ts +7 -0
- package/dist/collaboration-state/read-state.js +136 -0
- package/dist/collaboration-state/recovery.d.ts +6 -0
- package/dist/collaboration-state/recovery.js +125 -0
- package/dist/collaboration-state/run-recording.d.ts +5 -0
- package/dist/collaboration-state/run-recording.js +216 -0
- package/dist/collaboration-state/run-results.d.ts +12 -0
- package/dist/collaboration-state/run-results.js +202 -0
- package/dist/collaboration-state/scratchpad-source-state.d.ts +46 -0
- package/dist/collaboration-state/scratchpad-source-state.js +207 -0
- package/dist/collaboration-state/scratchpad.d.ts +8 -0
- package/dist/collaboration-state/scratchpad.js +84 -0
- package/dist/collaboration-state/serialization.d.ts +16 -0
- package/dist/collaboration-state/serialization.js +71 -0
- package/dist/collaboration-state/storage-types.d.ts +136 -0
- package/dist/collaboration-state/storage-types.js +2 -0
- package/dist/collaboration-state/task-details.d.ts +5 -0
- package/dist/collaboration-state/task-details.js +25 -0
- package/dist/collaboration-state/types.d.ts +289 -0
- package/dist/collaboration-state/types.js +2 -0
- package/dist/collaboration-state/worklist.d.ts +11 -0
- package/dist/collaboration-state/worklist.js +286 -0
- package/dist/control-plane/clarification-commands.d.ts +34 -0
- package/dist/control-plane/clarification-commands.js +106 -0
- package/dist/control-plane/command-recovery.d.ts +3 -0
- package/dist/control-plane/command-recovery.js +79 -0
- package/dist/control-plane/context-sync.d.ts +47 -0
- package/dist/control-plane/context-sync.js +207 -0
- package/dist/control-plane/event-publishers.d.ts +24 -0
- package/dist/control-plane/event-publishers.js +192 -0
- package/dist/control-plane/execution-status.d.ts +13 -0
- package/dist/control-plane/execution-status.js +130 -0
- package/dist/control-plane/follow-up-context.d.ts +27 -0
- package/dist/control-plane/follow-up-context.js +93 -0
- package/dist/control-plane/follow-up-output.d.ts +53 -0
- package/dist/control-plane/follow-up-output.js +141 -0
- package/dist/control-plane/follow-up-run.d.ts +22 -0
- package/dist/control-plane/follow-up-run.js +90 -0
- package/dist/control-plane/follow-up-start.d.ts +26 -0
- package/dist/control-plane/follow-up-start.js +101 -0
- package/dist/control-plane/formatters.d.ts +12 -0
- package/dist/control-plane/formatters.js +47 -0
- package/dist/control-plane/index.d.ts +62 -0
- package/dist/control-plane/index.js +416 -0
- package/dist/control-plane/invalidations.d.ts +12 -0
- package/dist/control-plane/invalidations.js +67 -0
- package/dist/control-plane/procedure-logging.d.ts +11 -0
- package/dist/control-plane/procedure-logging.js +95 -0
- package/dist/control-plane/project-brief-refresh.d.ts +31 -0
- package/dist/control-plane/project-brief-refresh.js +105 -0
- package/dist/control-plane/project-context-bootstrap.d.ts +39 -0
- package/dist/control-plane/project-context-bootstrap.js +107 -0
- package/dist/control-plane/reference-summary-refresh.d.ts +22 -0
- package/dist/control-plane/reference-summary-refresh.js +344 -0
- package/dist/control-plane/run-lineage.d.ts +8 -0
- package/dist/control-plane/run-lineage.js +13 -0
- package/dist/control-plane/run-result-recording.d.ts +46 -0
- package/dist/control-plane/run-result-recording.js +81 -0
- package/dist/control-plane/run-scheduler.d.ts +35 -0
- package/dist/control-plane/run-scheduler.js +110 -0
- package/dist/control-plane/run-start.d.ts +30 -0
- package/dist/control-plane/run-start.js +167 -0
- package/dist/control-plane/scratchpad-auto-refresh.d.ts +32 -0
- package/dist/control-plane/scratchpad-auto-refresh.js +150 -0
- package/dist/control-plane/scratchpad-refresh-start.d.ts +60 -0
- package/dist/control-plane/scratchpad-refresh-start.js +240 -0
- package/dist/control-plane/scratchpad-refresh.d.ts +29 -0
- package/dist/control-plane/scratchpad-refresh.js +55 -0
- package/dist/control-plane/scratchpad-source-messages.d.ts +10 -0
- package/dist/control-plane/scratchpad-source-messages.js +131 -0
- package/dist/control-plane/startup-recovery.d.ts +19 -0
- package/dist/control-plane/startup-recovery.js +113 -0
- package/dist/control-plane/task-compile-continuation.d.ts +25 -0
- package/dist/control-plane/task-compile-continuation.js +127 -0
- package/dist/control-plane/task-compile-output.d.ts +29 -0
- package/dist/control-plane/task-compile-output.js +122 -0
- package/dist/control-plane/task-compile-start.d.ts +43 -0
- package/dist/control-plane/task-compile-start.js +280 -0
- package/dist/control-plane/task-proposal.d.ts +3 -0
- package/dist/control-plane/task-proposal.js +37 -0
- package/dist/control-plane/types.d.ts +155 -0
- package/dist/control-plane/types.js +2 -0
- package/dist/control-plane/workflows/index.d.ts +4 -0
- package/dist/control-plane/workflows/index.js +4 -0
- package/dist/control-plane/workflows/openai.d.ts +34 -0
- package/dist/control-plane/workflows/openai.js +411 -0
- package/dist/control-plane/workflows/structured-output-schemas.d.ts +9 -0
- package/dist/control-plane/workflows/structured-output-schemas.js +289 -0
- package/dist/control-plane/workflows/structured-output-validators.d.ts +15 -0
- package/dist/control-plane/workflows/structured-output-validators.js +295 -0
- package/dist/control-plane/workflows/structured-output.d.ts +3 -0
- package/dist/control-plane/workflows/structured-output.js +3 -0
- package/dist/control-plane/workflows/types.d.ts +274 -0
- package/dist/control-plane/workflows/types.js +2 -0
- package/dist/control-plane/worklist-terminal-feedback.d.ts +15 -0
- package/dist/control-plane/worklist-terminal-feedback.js +135 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +32 -0
- package/dist/procedure-engine/index.d.ts +56 -0
- package/dist/procedure-engine/index.js +163 -0
- package/dist/project-brief/index.d.ts +4 -0
- package/dist/project-brief/index.js +3 -0
- package/dist/project-brief/repository.d.ts +5 -0
- package/dist/project-brief/repository.js +97 -0
- package/dist/project-brief/source.d.ts +8 -0
- package/dist/project-brief/source.js +75 -0
- package/dist/project-brief/types.d.ts +40 -0
- package/dist/project-brief/types.js +2 -0
- package/dist/project-docs/context.d.ts +34 -0
- package/dist/project-docs/context.js +86 -0
- package/dist/project-timeline/index.d.ts +20 -0
- package/dist/project-timeline/index.js +100 -0
- package/dist/prompt-templates/index.d.ts +13 -0
- package/dist/prompt-templates/index.js +86 -0
- package/dist/provider-usage/index.d.ts +37 -0
- package/dist/provider-usage/index.js +227 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +2 -0
- package/dist/providers/openai/app-server/json-rpc.d.ts +71 -0
- package/dist/providers/openai/app-server/json-rpc.js +298 -0
- package/dist/providers/openai/app-server/permission-profile.d.ts +64 -0
- package/dist/providers/openai/app-server/permission-profile.js +67 -0
- package/dist/providers/openai/app-server/provider-config.d.ts +10 -0
- package/dist/providers/openai/app-server/provider-config.js +39 -0
- package/dist/providers/openai/app-server/read-only-procedure.d.ts +68 -0
- package/dist/providers/openai/app-server/read-only-procedure.js +293 -0
- package/dist/providers/openai/app-server/runtime-helpers.d.ts +20 -0
- package/dist/providers/openai/app-server/runtime-helpers.js +151 -0
- package/dist/providers/openai/app-server/skills.d.ts +82 -0
- package/dist/providers/openai/app-server/skills.js +222 -0
- package/dist/providers/openai/app-server/smoke-cli.d.ts +2 -0
- package/dist/providers/openai/app-server/smoke-cli.js +42 -0
- package/dist/providers/openai/app-server/smoke-helpers.d.ts +19 -0
- package/dist/providers/openai/app-server/smoke-helpers.js +125 -0
- package/dist/providers/openai/app-server/smoke-provider-input.d.ts +6 -0
- package/dist/providers/openai/app-server/smoke-provider-input.js +20 -0
- package/dist/providers/openai/app-server/smoke-types.d.ts +49 -0
- package/dist/providers/openai/app-server/smoke-types.js +20 -0
- package/dist/providers/openai/app-server/smoke.d.ts +9 -0
- package/dist/providers/openai/app-server/smoke.js +157 -0
- package/dist/providers/openai/app-server/workspace-write-run.d.ts +87 -0
- package/dist/providers/openai/app-server/workspace-write-run.js +379 -0
- package/dist/providers/openai/chat-assistant.d.ts +34 -0
- package/dist/providers/openai/chat-assistant.js +72 -0
- package/dist/providers/openai/codex-app-server.d.ts +126 -0
- package/dist/providers/openai/codex-app-server.js +147 -0
- package/dist/providers/openai/credential-store.d.ts +31 -0
- package/dist/providers/openai/credential-store.js +143 -0
- package/dist/providers/openai/credential-validation.d.ts +45 -0
- package/dist/providers/openai/credential-validation.js +190 -0
- package/dist/providers/openai/index.d.ts +13 -0
- package/dist/providers/openai/index.js +13 -0
- package/dist/providers/openai/machine-local-files.d.ts +19 -0
- package/dist/providers/openai/machine-local-files.js +55 -0
- package/dist/providers/openai/model-config.d.ts +4 -0
- package/dist/providers/openai/model-config.js +4 -0
- package/dist/providers/openai/provider-config-errors.d.ts +6 -0
- package/dist/providers/openai/provider-config-errors.js +13 -0
- package/dist/providers/openai/provider-config-shape.d.ts +3 -0
- package/dist/providers/openai/provider-config-shape.js +108 -0
- package/dist/providers/openai/provider-config-toml.d.ts +13 -0
- package/dist/providers/openai/provider-config-toml.js +113 -0
- package/dist/providers/openai/provider-config.d.ts +73 -0
- package/dist/providers/openai/provider-config.js +117 -0
- package/dist/providers/openai/provider-setup.d.ts +31 -0
- package/dist/providers/openai/provider-setup.js +88 -0
- package/dist/providers/openai/sdk-procedure-runner.d.ts +70 -0
- package/dist/providers/openai/sdk-procedure-runner.js +123 -0
- package/dist/providers/openai/token-usage.d.ts +11 -0
- package/dist/providers/openai/token-usage.js +90 -0
- package/dist/run-engine/index.d.ts +61 -0
- package/dist/run-engine/index.js +140 -0
- package/dist/run-pipeline/candidate-diff.d.ts +3 -0
- package/dist/run-pipeline/candidate-diff.js +10 -0
- package/dist/run-pipeline/openai.d.ts +41 -0
- package/dist/run-pipeline/openai.js +548 -0
- package/dist/run-pipeline/promotion-reconcile.d.ts +13 -0
- package/dist/run-pipeline/promotion-reconcile.js +138 -0
- package/dist/run-pipeline/result-projections.d.ts +39 -0
- package/dist/run-pipeline/result-projections.js +115 -0
- package/dist/run-pipeline/task-run-invocation.d.ts +6 -0
- package/dist/run-pipeline/task-run-invocation.js +130 -0
- package/dist/run-pipeline/task-run-output.d.ts +38 -0
- package/dist/run-pipeline/task-run-output.js +146 -0
- package/dist/server-shell/cli/args.d.ts +7 -0
- package/dist/server-shell/cli/args.js +30 -0
- package/dist/server-shell/cli/cli.d.ts +3 -0
- package/dist/server-shell/cli/cli.js +57 -0
- package/dist/server-shell/cli/errors.d.ts +9 -0
- package/dist/server-shell/cli/errors.js +53 -0
- package/dist/server-shell/cli/git-bootstrap.d.ts +24 -0
- package/dist/server-shell/cli/git-bootstrap.js +246 -0
- package/dist/server-shell/cli/host-lifecycle.d.ts +45 -0
- package/dist/server-shell/cli/host-lifecycle.js +298 -0
- package/dist/server-shell/cli/host-relay-status.d.ts +6 -0
- package/dist/server-shell/cli/host-relay-status.js +43 -0
- package/dist/server-shell/cli/host-runtime-endpoint.d.ts +22 -0
- package/dist/server-shell/cli/host-runtime-endpoint.js +120 -0
- package/dist/server-shell/cli/host-server-runtime.d.ts +30 -0
- package/dist/server-shell/cli/host-server-runtime.js +432 -0
- package/dist/server-shell/cli/index.d.ts +8 -0
- package/dist/server-shell/cli/index.js +8 -0
- package/dist/server-shell/cli/launch.d.ts +45 -0
- package/dist/server-shell/cli/launch.js +115 -0
- package/dist/server-shell/cli/machine-local.d.ts +69 -0
- package/dist/server-shell/cli/machine-local.js +223 -0
- package/dist/server-shell/cli/project-identity.d.ts +20 -0
- package/dist/server-shell/cli/project-identity.js +87 -0
- package/dist/server-shell/cli/relay-registration.d.ts +31 -0
- package/dist/server-shell/cli/relay-registration.js +61 -0
- package/dist/server-shell/command-idempotency/index.d.ts +44 -0
- package/dist/server-shell/command-idempotency/index.js +155 -0
- package/dist/server-shell/dev-runner/cli.d.ts +2 -0
- package/dist/server-shell/dev-runner/cli.js +10 -0
- package/dist/server-shell/dev-runner/config.d.ts +38 -0
- package/dist/server-shell/dev-runner/config.js +277 -0
- package/dist/server-shell/dev-runner/host-cli.d.ts +2 -0
- package/dist/server-shell/dev-runner/host-cli.js +22 -0
- package/dist/server-shell/dev-runner/index.d.ts +3 -0
- package/dist/server-shell/dev-runner/index.js +3 -0
- package/dist/server-shell/dev-runner/runner.d.ts +30 -0
- package/dist/server-shell/dev-runner/runner.js +236 -0
- package/dist/server-shell/http/create-server.d.ts +18 -0
- package/dist/server-shell/http/create-server.js +51 -0
- package/dist/server-shell/http/host-tunnel.d.ts +15 -0
- package/dist/server-shell/http/host-tunnel.js +154 -0
- package/dist/server-shell/http/logger.d.ts +7 -0
- package/dist/server-shell/http/logger.js +19 -0
- package/dist/server-shell/http/routes/agent-context-auth.d.ts +41 -0
- package/dist/server-shell/http/routes/agent-context-auth.js +73 -0
- package/dist/server-shell/http/routes/agent-context-errors.d.ts +6 -0
- package/dist/server-shell/http/routes/agent-context-errors.js +9 -0
- package/dist/server-shell/http/routes/agent-context-messages-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/agent-context-messages-routes.js +74 -0
- package/dist/server-shell/http/routes/agent-context-project-doc-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/agent-context-project-doc-routes.js +86 -0
- package/dist/server-shell/http/routes/agent-context-project-docs.d.ts +40 -0
- package/dist/server-shell/http/routes/agent-context-project-docs.js +98 -0
- package/dist/server-shell/http/routes/agent-context-query.d.ts +31 -0
- package/dist/server-shell/http/routes/agent-context-query.js +72 -0
- package/dist/server-shell/http/routes/agent-context-reference-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/agent-context-reference-routes.js +82 -0
- package/dist/server-shell/http/routes/agent-context-references.d.ts +21 -0
- package/dist/server-shell/http/routes/agent-context-references.js +85 -0
- package/dist/server-shell/http/routes/agent-context-shared.d.ts +34 -0
- package/dist/server-shell/http/routes/agent-context-shared.js +44 -0
- package/dist/server-shell/http/routes/agent-context-skills-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/agent-context-skills-routes.js +85 -0
- package/dist/server-shell/http/routes/agent-context-workspace-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/agent-context-workspace-routes.js +130 -0
- package/dist/server-shell/http/routes/agent-context.d.ts +8 -0
- package/dist/server-shell/http/routes/agent-context.js +16 -0
- package/dist/server-shell/http/routes/health.d.ts +7 -0
- package/dist/server-shell/http/routes/health.js +41 -0
- package/dist/server-shell/http/routes/local-control.d.ts +40 -0
- package/dist/server-shell/http/routes/local-control.js +260 -0
- package/dist/server-shell/http/routes/project-api/approval-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/project-api/approval-routes.js +64 -0
- package/dist/server-shell/http/routes/project-api/artifacts-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/artifacts-routes.js +166 -0
- package/dist/server-shell/http/routes/project-api/clarification-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/project-api/clarification-routes.js +150 -0
- package/dist/server-shell/http/routes/project-api/constants.d.ts +3 -0
- package/dist/server-shell/http/routes/project-api/constants.js +3 -0
- package/dist/server-shell/http/routes/project-api/errors.d.ts +26 -0
- package/dist/server-shell/http/routes/project-api/errors.js +41 -0
- package/dist/server-shell/http/routes/project-api/events-stream.d.ts +11 -0
- package/dist/server-shell/http/routes/project-api/events-stream.js +55 -0
- package/dist/server-shell/http/routes/project-api/execution-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/project-api/execution-routes.js +92 -0
- package/dist/server-shell/http/routes/project-api/headers.d.ts +2 -0
- package/dist/server-shell/http/routes/project-api/headers.js +7 -0
- package/dist/server-shell/http/routes/project-api/invalidations.d.ts +10 -0
- package/dist/server-shell/http/routes/project-api/invalidations.js +57 -0
- package/dist/server-shell/http/routes/project-api/messages-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/messages-routes.js +80 -0
- package/dist/server-shell/http/routes/project-api/openapi-approval-routes.d.ts +128 -0
- package/dist/server-shell/http/routes/project-api/openapi-approval-routes.js +32 -0
- package/dist/server-shell/http/routes/project-api/openapi-artifacts-routes.d.ts +51 -0
- package/dist/server-shell/http/routes/project-api/openapi-artifacts-routes.js +56 -0
- package/dist/server-shell/http/routes/project-api/openapi-collaboration-routes.d.ts +466 -0
- package/dist/server-shell/http/routes/project-api/openapi-collaboration-routes.js +165 -0
- package/dist/server-shell/http/routes/project-api/openapi-diagnostic-routes.d.ts +16 -0
- package/dist/server-shell/http/routes/project-api/openapi-diagnostic-routes.js +17 -0
- package/dist/server-shell/http/routes/project-api/openapi-execution-routes.d.ts +215 -0
- package/dist/server-shell/http/routes/project-api/openapi-execution-routes.js +75 -0
- package/dist/server-shell/http/routes/project-api/openapi-path-parameters.d.ts +9 -0
- package/dist/server-shell/http/routes/project-api/openapi-path-parameters.js +18 -0
- package/dist/server-shell/http/routes/project-api/openapi-skills-routes.d.ts +60 -0
- package/dist/server-shell/http/routes/project-api/openapi-skills-routes.js +51 -0
- package/dist/server-shell/http/routes/project-api/openapi-timeline-routes.d.ts +115 -0
- package/dist/server-shell/http/routes/project-api/openapi-timeline-routes.js +17 -0
- package/dist/server-shell/http/routes/project-api/openapi-viewer-routes.d.ts +323 -0
- package/dist/server-shell/http/routes/project-api/openapi-viewer-routes.js +120 -0
- package/dist/server-shell/http/routes/project-api/openapi-workspace-routes.d.ts +1317 -0
- package/dist/server-shell/http/routes/project-api/openapi-workspace-routes.js +95 -0
- package/dist/server-shell/http/routes/project-api/openapi.d.ts +2457 -0
- package/dist/server-shell/http/routes/project-api/openapi.js +30 -0
- package/dist/server-shell/http/routes/project-api/payload-validation.d.ts +6 -0
- package/dist/server-shell/http/routes/project-api/payload-validation.js +36 -0
- package/dist/server-shell/http/routes/project-api/project-docs-helpers.d.ts +9 -0
- package/dist/server-shell/http/routes/project-api/project-docs-helpers.js +17 -0
- package/dist/server-shell/http/routes/project-api/project-docs-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/project-docs-routes.js +151 -0
- package/dist/server-shell/http/routes/project-api/project-timeline-projection.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/project-timeline-projection.js +658 -0
- package/dist/server-shell/http/routes/project-api/project-timeline-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/project-api/project-timeline-routes.js +23 -0
- package/dist/server-shell/http/routes/project-api/read-state-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/read-state-routes.js +82 -0
- package/dist/server-shell/http/routes/project-api/reference-files-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/reference-files-routes.js +184 -0
- package/dist/server-shell/http/routes/project-api/reference-files.d.ts +17 -0
- package/dist/server-shell/http/routes/project-api/reference-files.js +212 -0
- package/dist/server-shell/http/routes/project-api/repo-projection.d.ts +3 -0
- package/dist/server-shell/http/routes/project-api/repo-projection.js +58 -0
- package/dist/server-shell/http/routes/project-api/schemas.d.ts +1351 -0
- package/dist/server-shell/http/routes/project-api/schemas.js +441 -0
- package/dist/server-shell/http/routes/project-api/session-requirements.d.ts +10 -0
- package/dist/server-shell/http/routes/project-api/session-requirements.js +60 -0
- package/dist/server-shell/http/routes/project-api/skills-helpers.d.ts +7 -0
- package/dist/server-shell/http/routes/project-api/skills-helpers.js +48 -0
- package/dist/server-shell/http/routes/project-api/skills-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/skills-routes.js +185 -0
- package/dist/server-shell/http/routes/project-api/staged-uploads.d.ts +14 -0
- package/dist/server-shell/http/routes/project-api/staged-uploads.js +149 -0
- package/dist/server-shell/http/routes/project-api/system-routes.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api/system-routes.js +141 -0
- package/dist/server-shell/http/routes/project-api/types.d.ts +137 -0
- package/dist/server-shell/http/routes/project-api/types.js +2 -0
- package/dist/server-shell/http/routes/project-api/viewer-projections.d.ts +17 -0
- package/dist/server-shell/http/routes/project-api/viewer-projections.js +102 -0
- package/dist/server-shell/http/routes/project-api/viewer-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/project-api/viewer-routes.js +100 -0
- package/dist/server-shell/http/routes/project-api/workflow-routes.d.ts +4 -0
- package/dist/server-shell/http/routes/project-api/workflow-routes.js +85 -0
- package/dist/server-shell/http/routes/project-api/workspace-projections.d.ts +5 -0
- package/dist/server-shell/http/routes/project-api/workspace-projections.js +103 -0
- package/dist/server-shell/http/routes/project-api.d.ts +8 -0
- package/dist/server-shell/http/routes/project-api.js +34 -0
- package/dist/server-shell/http/sse-replay-buffer.d.ts +54 -0
- package/dist/server-shell/http/sse-replay-buffer.js +110 -0
- package/dist/server-shell/http/sse.d.ts +12 -0
- package/dist/server-shell/http/sse.js +22 -0
- package/dist/server-shell/http/static-web.d.ts +6 -0
- package/dist/server-shell/http/static-web.js +52 -0
- package/dist/server-shell/http/validation.d.ts +13 -0
- package/dist/server-shell/http/validation.js +136 -0
- package/dist/server-shell/http/workspace-events.d.ts +38 -0
- package/dist/server-shell/http/workspace-events.js +98 -0
- package/dist/server-shell/session/relay-session-context.d.ts +25 -0
- package/dist/server-shell/session/relay-session-context.js +49 -0
- package/dist/server-shell/smoke/e2e-client.d.ts +59 -0
- package/dist/server-shell/smoke/e2e-client.js +304 -0
- package/dist/server-shell/smoke/index.d.ts +2 -0
- package/dist/server-shell/smoke/index.js +2 -0
- package/dist/skills/constants.d.ts +8 -0
- package/dist/skills/constants.js +9 -0
- package/dist/skills/errors.d.ts +6 -0
- package/dist/skills/errors.js +9 -0
- package/dist/skills/index.d.ts +41 -0
- package/dist/skills/index.js +171 -0
- package/dist/skills/metadata.d.ts +8 -0
- package/dist/skills/metadata.js +80 -0
- package/dist/skills/zip-import.d.ts +18 -0
- package/dist/skills/zip-import.js +241 -0
- package/dist/store/command-recovery.d.ts +26 -0
- package/dist/store/command-recovery.js +71 -0
- package/dist/store/index.d.ts +6 -0
- package/dist/store/index.js +6 -0
- package/dist/store/lifecycle.d.ts +23 -0
- package/dist/store/lifecycle.js +53 -0
- package/dist/store/metadata.d.ts +18 -0
- package/dist/store/metadata.js +30 -0
- package/dist/store/migrations.d.ts +20 -0
- package/dist/store/migrations.js +76 -0
- package/dist/store/sqlite.d.ts +11 -0
- package/dist/store/sqlite.js +21 -0
- package/dist/workspace-ops/constants.d.ts +15 -0
- package/dist/workspace-ops/constants.js +20 -0
- package/dist/workspace-ops/errors.d.ts +8 -0
- package/dist/workspace-ops/errors.js +33 -0
- package/dist/workspace-ops/git.d.ts +13 -0
- package/dist/workspace-ops/git.js +53 -0
- package/dist/workspace-ops/index.d.ts +11 -0
- package/dist/workspace-ops/index.js +9 -0
- package/dist/workspace-ops/mainline.d.ts +2 -0
- package/dist/workspace-ops/mainline.js +16 -0
- package/dist/workspace-ops/project-doc-templates.d.ts +12 -0
- package/dist/workspace-ops/project-doc-templates.js +180 -0
- package/dist/workspace-ops/project-docs.d.ts +7 -0
- package/dist/workspace-ops/project-docs.js +156 -0
- package/dist/workspace-ops/reference-files.d.ts +3 -0
- package/dist/workspace-ops/reference-files.js +137 -0
- package/dist/workspace-ops/reference-metadata.d.ts +13 -0
- package/dist/workspace-ops/reference-metadata.js +86 -0
- package/dist/workspace-ops/reference-summaries.d.ts +17 -0
- package/dist/workspace-ops/reference-summaries.js +298 -0
- package/dist/workspace-ops/run-workspaces.d.ts +18 -0
- package/dist/workspace-ops/run-workspaces.js +271 -0
- package/dist/workspace-ops/types.d.ts +219 -0
- package/dist/workspace-ops/types.js +2 -0
- package/dist/workspace-ops/viewer-file.d.ts +4 -0
- package/dist/workspace-ops/viewer-file.js +207 -0
- package/dist/workspace-ops/viewer-git.d.ts +20 -0
- package/dist/workspace-ops/viewer-git.js +111 -0
- package/dist/workspace-ops/viewer-paths.d.ts +3 -0
- package/dist/workspace-ops/viewer-paths.js +13 -0
- package/dist/workspace-ops/viewer-tree.d.ts +9 -0
- package/dist/workspace-ops/viewer-tree.js +144 -0
- package/dist/workspace-ops/viewer.d.ts +5 -0
- package/dist/workspace-ops/viewer.js +5 -0
- package/migrations/0001_init.sql +674 -0
- package/migrations/0002_allow_sealed_round_successor_note.sql +14 -0
- package/migrations/0003_drop_scratchpad_source_message_refs.sql +1 -0
- package/migrations/0004_read_state.sql +109 -0
- package/migrations/0005_provider_usage.sql +15 -0
- package/migrations/0006_scratchpad_source_state.sql +29 -0
- package/migrations/0007_workspace_signal_read_state_scopes.sql +74 -0
- package/migrations/0008_provider_usage_anchors.sql +32 -0
- package/migrations/0009_project_timeline_events.sql +33 -0
- package/migrations/0010_project_brief.sql +13 -0
- package/migrations/0011_message_author_avatar.sql +5 -0
- package/migrations/README.md +44 -0
- package/node_modules/@tutti/relay-client/dist/host-control.d.ts +164 -0
- package/node_modules/@tutti/relay-client/dist/host-control.js +284 -0
- package/node_modules/@tutti/relay-client/dist/index.d.ts +3 -0
- package/node_modules/@tutti/relay-client/dist/index.js +3 -0
- package/node_modules/@tutti/relay-client/dist/tunnel-frames.d.ts +8 -0
- package/node_modules/@tutti/relay-client/dist/tunnel-frames.js +124 -0
- package/node_modules/@tutti/relay-client/dist/tunnel-types.d.ts +61 -0
- package/node_modules/@tutti/relay-client/dist/tunnel-types.js +2 -0
- package/node_modules/@tutti/relay-client/dist/tunnel.d.ts +4 -0
- package/node_modules/@tutti/relay-client/dist/tunnel.js +144 -0
- package/node_modules/@tutti/relay-client/package.json +18 -0
- package/node_modules/@tutti/shared/dist/domain/index.d.ts +59 -0
- package/node_modules/@tutti/shared/dist/domain/index.js +37 -0
- package/node_modules/@tutti/shared/dist/ids/index.d.ts +85 -0
- package/node_modules/@tutti/shared/dist/ids/index.js +88 -0
- package/node_modules/@tutti/shared/dist/index.d.ts +6 -0
- package/node_modules/@tutti/shared/dist/index.js +6 -0
- package/node_modules/@tutti/shared/dist/schemas/api/approvals.d.ts +307 -0
- package/node_modules/@tutti/shared/dist/schemas/api/approvals.js +110 -0
- package/node_modules/@tutti/shared/dist/schemas/api/artifacts.d.ts +173 -0
- package/node_modules/@tutti/shared/dist/schemas/api/artifacts.js +107 -0
- package/node_modules/@tutti/shared/dist/schemas/api/clarifications.d.ts +704 -0
- package/node_modules/@tutti/shared/dist/schemas/api/clarifications.js +224 -0
- package/node_modules/@tutti/shared/dist/schemas/api/index.d.ts +18 -0
- package/node_modules/@tutti/shared/dist/schemas/api/index.js +17 -0
- package/node_modules/@tutti/shared/dist/schemas/api/messages.d.ts +370 -0
- package/node_modules/@tutti/shared/dist/schemas/api/messages.js +134 -0
- package/node_modules/@tutti/shared/dist/schemas/api/openapi.d.ts +32 -0
- package/node_modules/@tutti/shared/dist/schemas/api/openapi.js +100 -0
- package/node_modules/@tutti/shared/dist/schemas/api/primitives.d.ts +109 -0
- package/node_modules/@tutti/shared/dist/schemas/api/primitives.js +174 -0
- package/node_modules/@tutti/shared/dist/schemas/api/project-timeline.d.ts +149 -0
- package/node_modules/@tutti/shared/dist/schemas/api/project-timeline.js +44 -0
- package/node_modules/@tutti/shared/dist/schemas/api/provider-config.d.ts +21 -0
- package/node_modules/@tutti/shared/dist/schemas/api/provider-config.js +33 -0
- package/node_modules/@tutti/shared/dist/schemas/api/provider-usage.d.ts +87 -0
- package/node_modules/@tutti/shared/dist/schemas/api/provider-usage.js +48 -0
- package/node_modules/@tutti/shared/dist/schemas/api/read-state.d.ts +89 -0
- package/node_modules/@tutti/shared/dist/schemas/api/read-state.js +39 -0
- package/node_modules/@tutti/shared/dist/schemas/api/runtime-events.d.ts +484 -0
- package/node_modules/@tutti/shared/dist/schemas/api/runtime-events.js +185 -0
- package/node_modules/@tutti/shared/dist/schemas/api/skills.d.ts +88 -0
- package/node_modules/@tutti/shared/dist/schemas/api/skills.js +71 -0
- package/node_modules/@tutti/shared/dist/schemas/api/types.d.ts +253 -0
- package/node_modules/@tutti/shared/dist/schemas/api/types.js +2 -0
- package/node_modules/@tutti/shared/dist/schemas/api/uploads.d.ts +103 -0
- package/node_modules/@tutti/shared/dist/schemas/api/uploads.js +78 -0
- package/node_modules/@tutti/shared/dist/schemas/api/viewer-reference.d.ts +484 -0
- package/node_modules/@tutti/shared/dist/schemas/api/viewer-reference.js +267 -0
- package/node_modules/@tutti/shared/dist/schemas/api/work-items.d.ts +264 -0
- package/node_modules/@tutti/shared/dist/schemas/api/work-items.js +196 -0
- package/node_modules/@tutti/shared/dist/schemas/api/workspace-commands.d.ts +179 -0
- package/node_modules/@tutti/shared/dist/schemas/api/workspace-commands.js +137 -0
- package/node_modules/@tutti/shared/dist/schemas/domain/index.d.ts +31 -0
- package/node_modules/@tutti/shared/dist/schemas/domain/index.js +49 -0
- package/node_modules/@tutti/shared/dist/schemas/internal/index.d.ts +46 -0
- package/node_modules/@tutti/shared/dist/schemas/internal/index.js +46 -0
- package/node_modules/@tutti/shared/dist/utils/command-idempotency/index.d.ts +40 -0
- package/node_modules/@tutti/shared/dist/utils/command-idempotency/index.js +100 -0
- package/node_modules/@tutti/shared/dist/utils/index.d.ts +5 -0
- package/node_modules/@tutti/shared/dist/utils/index.js +5 -0
- package/node_modules/@tutti/shared/dist/utils/logging/index.d.ts +34 -0
- package/node_modules/@tutti/shared/dist/utils/logging/index.js +130 -0
- package/node_modules/@tutti/shared/dist/utils/path-policy/index.d.ts +13 -0
- package/node_modules/@tutti/shared/dist/utils/path-policy/index.js +80 -0
- package/node_modules/@tutti/shared/dist/utils/redaction/index.d.ts +19 -0
- package/node_modules/@tutti/shared/dist/utils/redaction/index.js +158 -0
- package/node_modules/@tutti/shared/package.json +63 -0
- package/package.json +47 -0
- package/prompts/README.md +36 -0
- package/prompts/chat-assistant.md +43 -0
- package/prompts/codex/README.md +13 -0
- package/prompts/codex/no-write-smoke.md +35 -0
- package/prompts/procedures/README.md +38 -0
- package/prompts/procedures/context-sync.md +66 -0
- package/prompts/procedures/follow-up-check.md +83 -0
- package/prompts/procedures/project-brief-refresh.md +79 -0
- package/prompts/procedures/project-context-bootstrap.md +58 -0
- package/prompts/procedures/reference-file-summary.md +49 -0
- package/prompts/procedures/scratchpad-refresh.md +83 -0
- package/prompts/procedures/task-compile.md +116 -0
- package/prompts/prompt-flow-experiment-plan.md +203 -0
- package/prompts/prompt-flow-map.md +478 -0
- package/prompts/runs/README.md +17 -0
- package/prompts/runs/task-continuation.md +148 -0
- package/prompts/runs/task-retry.md +153 -0
- package/prompts/runs/task-run.md +135 -0
- package/prompts/skills/README.md +25 -0
- package/prompts/skills/read-main-chat/README.md +8 -0
- package/prompts/skills/read-main-chat/SKILL.md +18 -0
- package/prompts/skills/read-project-docs/README.md +13 -0
- package/prompts/skills/read-project-docs/SKILL.md +42 -0
- package/prompts/skills/read-references/README.md +9 -0
- package/prompts/skills/read-references/SKILL.md +26 -0
- package/prompts/skills/read-scratchpad/README.md +8 -0
- package/prompts/skills/read-scratchpad/SKILL.md +16 -0
- package/prompts/skills/read-user-skills/README.md +7 -0
- package/prompts/skills/read-user-skills/SKILL.md +22 -0
- package/prompts/skills/read-worklist/README.md +9 -0
- package/prompts/skills/read-worklist/SKILL.md +20 -0
- package/web/assets/Tutti-B7gEyTp1.png +0 -0
- package/web/assets/Tutti-square-BqFU7F0D.png +0 -0
- package/web/assets/index-CWkBgHap.js +29 -0
- package/web/assets/index-D8xJY8Gr.css +1 -0
- package/web/index.html +13 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { redactText } from "@tutti/shared/utils";
|
|
2
|
+
import { AgentContextBadRequestError } from "./agent-context-errors.js";
|
|
3
|
+
export function queryString(value) {
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
return queryString(value[0]);
|
|
6
|
+
}
|
|
7
|
+
return typeof value === "string" ? value : undefined;
|
|
8
|
+
}
|
|
9
|
+
export function boundedLimit(value, defaults) {
|
|
10
|
+
const raw = queryString(value);
|
|
11
|
+
if (raw === undefined || raw.trim() === "") {
|
|
12
|
+
return defaults.default;
|
|
13
|
+
}
|
|
14
|
+
const parsed = Number(raw);
|
|
15
|
+
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
16
|
+
throw new AgentContextBadRequestError("Limit is invalid");
|
|
17
|
+
}
|
|
18
|
+
return Math.min(parsed, defaults.max);
|
|
19
|
+
}
|
|
20
|
+
export function truncateText(value, maxChars) {
|
|
21
|
+
const redacted = redactText(value ?? "");
|
|
22
|
+
if (redacted.length <= maxChars) {
|
|
23
|
+
return { text: redacted, truncated: false };
|
|
24
|
+
}
|
|
25
|
+
return { text: redacted.slice(0, maxChars), truncated: true };
|
|
26
|
+
}
|
|
27
|
+
export function truncateArray(values, maxItems, maxItemChars) {
|
|
28
|
+
const limited = values.slice(0, maxItems);
|
|
29
|
+
const itemTruncated = limited.map((value) => truncateText(value, maxItemChars));
|
|
30
|
+
return {
|
|
31
|
+
items: itemTruncated.map((item) => item.text),
|
|
32
|
+
truncated: values.length > maxItems || itemTruncated.some((item) => item.truncated),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function encodeOffsetCursor(cursor) {
|
|
36
|
+
return Buffer.from(JSON.stringify(cursor), "utf8").toString("base64url");
|
|
37
|
+
}
|
|
38
|
+
function decodeOffsetCursor(value, endpoint) {
|
|
39
|
+
if (value === undefined || value.trim() === "") {
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const parsed = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
44
|
+
if (typeof parsed === "object" &&
|
|
45
|
+
parsed !== null &&
|
|
46
|
+
!Array.isArray(parsed) &&
|
|
47
|
+
parsed.endpoint === endpoint &&
|
|
48
|
+
Number.isInteger(parsed.offset) &&
|
|
49
|
+
parsed.offset >= 0) {
|
|
50
|
+
return parsed.offset;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
throw new AgentContextBadRequestError("Cursor is invalid");
|
|
55
|
+
}
|
|
56
|
+
throw new AgentContextBadRequestError("Cursor is invalid");
|
|
57
|
+
}
|
|
58
|
+
export function pageByOffset(items, options) {
|
|
59
|
+
const offset = decodeOffsetCursor(options.cursor, options.endpoint);
|
|
60
|
+
const pageItems = items.slice(offset, offset + options.limit);
|
|
61
|
+
const nextOffset = offset + pageItems.length;
|
|
62
|
+
const hasMore = nextOffset < items.length;
|
|
63
|
+
return {
|
|
64
|
+
items: pageItems,
|
|
65
|
+
page: {
|
|
66
|
+
...(hasMore ? { next_cursor: encodeOffsetCursor({ endpoint: options.endpoint, offset: nextOffset }) } : {}),
|
|
67
|
+
limit: options.limit,
|
|
68
|
+
has_more: hasMore,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=agent-context-query.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FastifyInstance } from "fastify";
|
|
2
|
+
import { type AgentContextRouteOptions } from "./agent-context-shared.js";
|
|
3
|
+
export declare function registerAgentContextReferenceRoutes(app: FastifyInstance, options: AgentContextRouteOptions): void;
|
|
4
|
+
//# sourceMappingURL=agent-context-reference-routes.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { redactText } from "@tutti/shared/utils";
|
|
2
|
+
import { VIEWER_HARD_READ_LIMIT_BYTES, WorkspaceOpsError, readReferenceSummaryIndex, readViewerFile, referenceSummaryProjectionForEntry, } from "../../../workspace-ops/index.js";
|
|
3
|
+
import { authorizeAgentContextRequest } from "./agent-context-auth.js";
|
|
4
|
+
import { AgentContextBadRequestError } from "./agent-context-errors.js";
|
|
5
|
+
import { boundedLimit, pageByOffset, queryString } from "./agent-context-query.js";
|
|
6
|
+
import { mapReferenceUnavailableReason, referenceListItems, } from "./agent-context-references.js";
|
|
7
|
+
import { AGENT_CONTEXT_BASE_PATH, REFERENCE_FILE_DEFAULT_MAX_BYTES, REFERENCE_FILE_MAX_BYTES, REFERENCES_LIMIT_DEFAULT, REFERENCES_LIMIT_MAX, requireWorkspaceRoot, } from "./agent-context-shared.js";
|
|
8
|
+
export function registerAgentContextReferenceRoutes(app, options) {
|
|
9
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/references`, (request) => {
|
|
10
|
+
authorizeAgentContextRequest(request, options, "references:list");
|
|
11
|
+
const query = request.query;
|
|
12
|
+
const limit = boundedLimit(query.limit, {
|
|
13
|
+
default: REFERENCES_LIMIT_DEFAULT,
|
|
14
|
+
max: REFERENCES_LIMIT_MAX,
|
|
15
|
+
});
|
|
16
|
+
const items = referenceListItems(options);
|
|
17
|
+
const cursor = queryString(query.cursor);
|
|
18
|
+
const page = pageByOffset(items, {
|
|
19
|
+
endpoint: "references",
|
|
20
|
+
...(cursor === undefined ? {} : { cursor }),
|
|
21
|
+
limit,
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
items: page.items,
|
|
25
|
+
page: {
|
|
26
|
+
...(page.page.next_cursor === undefined ? {} : { next_cursor: page.page.next_cursor }),
|
|
27
|
+
limit: page.page.limit,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/references/file`, (request) => {
|
|
32
|
+
authorizeAgentContextRequest(request, options, "references:read");
|
|
33
|
+
const path = queryString(request.query.path);
|
|
34
|
+
if (path === undefined || path.trim() === "") {
|
|
35
|
+
throw new AgentContextBadRequestError("Reference path is required");
|
|
36
|
+
}
|
|
37
|
+
const maxBytes = Math.min(boundedLimit(request.query.max_bytes, {
|
|
38
|
+
default: REFERENCE_FILE_DEFAULT_MAX_BYTES,
|
|
39
|
+
max: REFERENCE_FILE_MAX_BYTES,
|
|
40
|
+
}), VIEWER_HARD_READ_LIMIT_BYTES);
|
|
41
|
+
try {
|
|
42
|
+
const file = readViewerFile({
|
|
43
|
+
workspaceRoot: requireWorkspaceRoot(options),
|
|
44
|
+
path,
|
|
45
|
+
maxBytes,
|
|
46
|
+
...(options.now === undefined ? {} : { now: options.now }),
|
|
47
|
+
});
|
|
48
|
+
const summary = referenceSummaryProjectionForEntry({
|
|
49
|
+
entry: file.file,
|
|
50
|
+
summaries: readReferenceSummaryIndex({ workspaceRoot: requireWorkspaceRoot(options) }),
|
|
51
|
+
});
|
|
52
|
+
if (file.content.kind !== "text") {
|
|
53
|
+
return {
|
|
54
|
+
kind: "unavailable",
|
|
55
|
+
path,
|
|
56
|
+
reason: file.content.reason,
|
|
57
|
+
summary,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
kind: "text",
|
|
62
|
+
path: file.file.path,
|
|
63
|
+
name: file.file.name,
|
|
64
|
+
summary,
|
|
65
|
+
text: redactText(file.content.text),
|
|
66
|
+
truncated: file.content.truncated,
|
|
67
|
+
bytes_read: file.content.bytes_returned,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (error instanceof WorkspaceOpsError) {
|
|
72
|
+
return {
|
|
73
|
+
kind: "unavailable",
|
|
74
|
+
path,
|
|
75
|
+
reason: mapReferenceUnavailableReason(error),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=agent-context-reference-routes.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WorkspaceOpsError } from "../../../workspace-ops/index.js";
|
|
2
|
+
type AgentContextWorkspaceOptions = {
|
|
3
|
+
workspaceOps?: {
|
|
4
|
+
workspaceRoot: string;
|
|
5
|
+
};
|
|
6
|
+
now?: () => Date;
|
|
7
|
+
};
|
|
8
|
+
export declare function mapReferenceUnavailableReason(error: WorkspaceOpsError): string;
|
|
9
|
+
export declare function referenceListItems(options: AgentContextWorkspaceOptions): {
|
|
10
|
+
can_read_text: boolean;
|
|
11
|
+
blocked_reason?: string;
|
|
12
|
+
summary: import("../../../workspace-ops/types.js").ReferenceSummaryProjection;
|
|
13
|
+
extension?: string;
|
|
14
|
+
media_type?: string;
|
|
15
|
+
path: string;
|
|
16
|
+
name: string;
|
|
17
|
+
category: import("../../../workspace-ops/types.js").ReferenceFileCategory;
|
|
18
|
+
size_bytes: number;
|
|
19
|
+
}[];
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=agent-context-references.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { REFERENCE_DIRECTORY_PATH, REFERENCE_INDEX_PATH, WorkspaceOpsError, readReferenceSummaryIndex, readViewerFile, readViewerTree, referenceFileCategoryForPath, referenceMediaTypeForPath, referenceSummaryProjectionForEntry, } from "../../../workspace-ops/index.js";
|
|
2
|
+
import { AgentContextBadRequestError } from "./agent-context-errors.js";
|
|
3
|
+
function requireWorkspaceRoot(options) {
|
|
4
|
+
if (options.workspaceOps === undefined) {
|
|
5
|
+
throw new AgentContextBadRequestError("Workspace viewer is unavailable");
|
|
6
|
+
}
|
|
7
|
+
return options.workspaceOps.workspaceRoot;
|
|
8
|
+
}
|
|
9
|
+
export function mapReferenceUnavailableReason(error) {
|
|
10
|
+
if (error.code === "not_found") {
|
|
11
|
+
return "not_found";
|
|
12
|
+
}
|
|
13
|
+
if (error.code === "forbidden") {
|
|
14
|
+
const reasonCode = typeof error.details?.reason_code === "string"
|
|
15
|
+
? error.details.reason_code
|
|
16
|
+
: undefined;
|
|
17
|
+
return reasonCode === "secret_like_path" ? "secret_like" : "restricted_path";
|
|
18
|
+
}
|
|
19
|
+
if (error.code === "validation_failed") {
|
|
20
|
+
return "restricted_path";
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
export function referenceListItems(options) {
|
|
25
|
+
const workspaceRoot = requireWorkspaceRoot(options);
|
|
26
|
+
const summaries = readReferenceSummaryIndex({ workspaceRoot });
|
|
27
|
+
return referenceEntries(options).map((entry) => {
|
|
28
|
+
const category = referenceFileCategoryForPath(entry.path) ?? "file";
|
|
29
|
+
const mediaType = referenceMediaTypeForPath(entry.path);
|
|
30
|
+
const read = canReadReferenceText(options, entry.path);
|
|
31
|
+
const summary = referenceSummaryProjectionForEntry({ entry, summaries });
|
|
32
|
+
return {
|
|
33
|
+
path: entry.path,
|
|
34
|
+
name: entry.name,
|
|
35
|
+
category,
|
|
36
|
+
size_bytes: entry.size_bytes ?? 0,
|
|
37
|
+
...(mediaType === undefined ? {} : { media_type: mediaType }),
|
|
38
|
+
...(entry.extension === undefined ? {} : { extension: entry.extension }),
|
|
39
|
+
summary,
|
|
40
|
+
...read,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function unavailableReasonForContent(content) {
|
|
45
|
+
return content.kind === "text" ? undefined : content.reason;
|
|
46
|
+
}
|
|
47
|
+
function referenceEntries(options) {
|
|
48
|
+
const workspaceRoot = requireWorkspaceRoot(options);
|
|
49
|
+
let tree;
|
|
50
|
+
try {
|
|
51
|
+
tree = readViewerTree({
|
|
52
|
+
workspaceRoot,
|
|
53
|
+
path: REFERENCE_DIRECTORY_PATH,
|
|
54
|
+
depth: 2,
|
|
55
|
+
...(options.now === undefined ? {} : { now: options.now }),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error instanceof WorkspaceOpsError && error.code === "not_found") {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
return tree.items
|
|
65
|
+
.filter((entry) => entry.kind === "file")
|
|
66
|
+
.filter((entry) => entry.path !== REFERENCE_INDEX_PATH)
|
|
67
|
+
.filter((entry) => referenceFileCategoryForPath(entry.path) !== undefined)
|
|
68
|
+
.sort((left, right) => left.path.localeCompare(right.path, "en", { sensitivity: "base" }));
|
|
69
|
+
}
|
|
70
|
+
function canReadReferenceText(options, path) {
|
|
71
|
+
try {
|
|
72
|
+
const file = readViewerFile({
|
|
73
|
+
workspaceRoot: requireWorkspaceRoot(options),
|
|
74
|
+
path,
|
|
75
|
+
maxBytes: 1,
|
|
76
|
+
...(options.now === undefined ? {} : { now: options.now }),
|
|
77
|
+
});
|
|
78
|
+
const reason = unavailableReasonForContent(file.content);
|
|
79
|
+
return reason === undefined ? { can_read_text: true } : { can_read_text: false, blocked_reason: reason };
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return { can_read_text: false, blocked_reason: "restricted_path" };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=agent-context-references.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { HostProjectStore } from "../../../store/index.js";
|
|
2
|
+
import type { HostProjectApiRouteOptions } from "./project-api.js";
|
|
3
|
+
import type { AgentContextTokenRegistry } from "./agent-context-auth.js";
|
|
4
|
+
export declare const AGENT_CONTEXT_BASE_PATH: "/internal/agent-context";
|
|
5
|
+
export declare const MESSAGE_LIMIT_DEFAULT = 50;
|
|
6
|
+
export declare const MESSAGE_LIMIT_MAX = 100;
|
|
7
|
+
export declare const MESSAGE_BODY_MAX_CHARS = 6000;
|
|
8
|
+
export declare const PROJECT_DOC_FILE_DEFAULT_MAX_BYTES = 131072;
|
|
9
|
+
export declare const PROJECT_DOC_FILE_MAX_BYTES = 524288;
|
|
10
|
+
export declare const SCRATCHPAD_TOPIC_MAX_CHARS = 500;
|
|
11
|
+
export declare const SCRATCHPAD_BACKGROUND_MAX_CHARS = 8000;
|
|
12
|
+
export declare const SCRATCHPAD_ARRAY_ITEM_MAX_CHARS = 2000;
|
|
13
|
+
export declare const SCRATCHPAD_ARRAY_MAX_ITEMS = 50;
|
|
14
|
+
export declare const WORKLIST_LIMIT_DEFAULT = 100;
|
|
15
|
+
export declare const WORKLIST_LIMIT_MAX = 200;
|
|
16
|
+
export declare const WORKLIST_TITLE_MAX_CHARS = 500;
|
|
17
|
+
export declare const WORKLIST_SUMMARY_MAX_CHARS = 2000;
|
|
18
|
+
export declare const TASK_CONTRACT_ITEM_MAX_CHARS = 2000;
|
|
19
|
+
export declare const TASK_RESULT_SUMMARY_MAX_CHARS = 4000;
|
|
20
|
+
export declare const REFERENCES_LIMIT_DEFAULT = 100;
|
|
21
|
+
export declare const REFERENCES_LIMIT_MAX = 500;
|
|
22
|
+
export declare const REFERENCE_FILE_DEFAULT_MAX_BYTES = 131072;
|
|
23
|
+
export declare const REFERENCE_FILE_MAX_BYTES = 524288;
|
|
24
|
+
export declare const USER_SKILLS_LIMIT_DEFAULT = 100;
|
|
25
|
+
export declare const USER_SKILLS_LIMIT_MAX = 500;
|
|
26
|
+
export declare const USER_SKILL_MD_DEFAULT_MAX_CHARS = 20000;
|
|
27
|
+
export declare const USER_SKILL_MD_MAX_CHARS = 100000;
|
|
28
|
+
export type AgentContextRouteOptions = Pick<HostProjectApiRouteOptions, "project" | "store" | "workspaceOps" | "tuttiHome" | "now"> & {
|
|
29
|
+
tokenRegistry: AgentContextTokenRegistry;
|
|
30
|
+
};
|
|
31
|
+
export declare function requireProjectStore(options: AgentContextRouteOptions): HostProjectStore;
|
|
32
|
+
export declare function requireWorkspaceRoot(options: AgentContextRouteOptions): string;
|
|
33
|
+
export declare function requireTuttiHome(options: AgentContextRouteOptions): string;
|
|
34
|
+
//# sourceMappingURL=agent-context-shared.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AgentContextBadRequestError } from "./agent-context-errors.js";
|
|
2
|
+
export const AGENT_CONTEXT_BASE_PATH = "/internal/agent-context";
|
|
3
|
+
export const MESSAGE_LIMIT_DEFAULT = 50;
|
|
4
|
+
export const MESSAGE_LIMIT_MAX = 100;
|
|
5
|
+
export const MESSAGE_BODY_MAX_CHARS = 6_000;
|
|
6
|
+
export const PROJECT_DOC_FILE_DEFAULT_MAX_BYTES = 131_072;
|
|
7
|
+
export const PROJECT_DOC_FILE_MAX_BYTES = 524_288;
|
|
8
|
+
export const SCRATCHPAD_TOPIC_MAX_CHARS = 500;
|
|
9
|
+
export const SCRATCHPAD_BACKGROUND_MAX_CHARS = 8_000;
|
|
10
|
+
export const SCRATCHPAD_ARRAY_ITEM_MAX_CHARS = 2_000;
|
|
11
|
+
export const SCRATCHPAD_ARRAY_MAX_ITEMS = 50;
|
|
12
|
+
export const WORKLIST_LIMIT_DEFAULT = 100;
|
|
13
|
+
export const WORKLIST_LIMIT_MAX = 200;
|
|
14
|
+
export const WORKLIST_TITLE_MAX_CHARS = 500;
|
|
15
|
+
export const WORKLIST_SUMMARY_MAX_CHARS = 2_000;
|
|
16
|
+
export const TASK_CONTRACT_ITEM_MAX_CHARS = 2_000;
|
|
17
|
+
export const TASK_RESULT_SUMMARY_MAX_CHARS = 4_000;
|
|
18
|
+
export const REFERENCES_LIMIT_DEFAULT = 100;
|
|
19
|
+
export const REFERENCES_LIMIT_MAX = 500;
|
|
20
|
+
export const REFERENCE_FILE_DEFAULT_MAX_BYTES = 131_072;
|
|
21
|
+
export const REFERENCE_FILE_MAX_BYTES = 524_288;
|
|
22
|
+
export const USER_SKILLS_LIMIT_DEFAULT = 100;
|
|
23
|
+
export const USER_SKILLS_LIMIT_MAX = 500;
|
|
24
|
+
export const USER_SKILL_MD_DEFAULT_MAX_CHARS = 20_000;
|
|
25
|
+
export const USER_SKILL_MD_MAX_CHARS = 100_000;
|
|
26
|
+
export function requireProjectStore(options) {
|
|
27
|
+
if (options.store === undefined) {
|
|
28
|
+
throw new AgentContextBadRequestError("Project store is unavailable");
|
|
29
|
+
}
|
|
30
|
+
return options.store;
|
|
31
|
+
}
|
|
32
|
+
export function requireWorkspaceRoot(options) {
|
|
33
|
+
if (options.workspaceOps === undefined) {
|
|
34
|
+
throw new AgentContextBadRequestError("Workspace viewer is unavailable");
|
|
35
|
+
}
|
|
36
|
+
return options.workspaceOps.workspaceRoot;
|
|
37
|
+
}
|
|
38
|
+
export function requireTuttiHome(options) {
|
|
39
|
+
if (options.tuttiHome === undefined) {
|
|
40
|
+
throw new AgentContextBadRequestError("User skills are unavailable");
|
|
41
|
+
}
|
|
42
|
+
return options.tuttiHome;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=agent-context-shared.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FastifyInstance } from "fastify";
|
|
2
|
+
import { type AgentContextRouteOptions } from "./agent-context-shared.js";
|
|
3
|
+
export declare function registerAgentContextSkillRoutes(app: FastifyInstance, options: AgentContextRouteOptions): void;
|
|
4
|
+
//# sourceMappingURL=agent-context-skills-routes.d.ts.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { redactText } from "@tutti/shared/utils";
|
|
2
|
+
import { listUserSkills, readUserSkill, SkillServiceError, } from "../../../skills/index.js";
|
|
3
|
+
import { authorizeAgentContextRequest } from "./agent-context-auth.js";
|
|
4
|
+
import { AgentContextBadRequestError } from "./agent-context-errors.js";
|
|
5
|
+
import { boundedLimit, pageByOffset, queryString, truncateText } from "./agent-context-query.js";
|
|
6
|
+
import { AGENT_CONTEXT_BASE_PATH, USER_SKILLS_LIMIT_DEFAULT, USER_SKILLS_LIMIT_MAX, USER_SKILL_MD_DEFAULT_MAX_CHARS, USER_SKILL_MD_MAX_CHARS, requireTuttiHome, } from "./agent-context-shared.js";
|
|
7
|
+
function skillUnavailable(input) {
|
|
8
|
+
return {
|
|
9
|
+
kind: "unavailable",
|
|
10
|
+
skill_name: input.skillName,
|
|
11
|
+
reason: input.reason,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function handleSkillReadError(error, skillName) {
|
|
15
|
+
if (!(error instanceof SkillServiceError)) {
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
switch (error.code) {
|
|
19
|
+
case "invalid_skill_name":
|
|
20
|
+
throw new AgentContextBadRequestError("Skill name is invalid");
|
|
21
|
+
case "skill_not_found":
|
|
22
|
+
return skillUnavailable({ skillName, reason: "not_found" });
|
|
23
|
+
case "validation_failed":
|
|
24
|
+
return skillUnavailable({ skillName, reason: "invalid" });
|
|
25
|
+
case "filesystem_error":
|
|
26
|
+
return skillUnavailable({ skillName, reason: "unavailable" });
|
|
27
|
+
case "invalid_zip":
|
|
28
|
+
return skillUnavailable({ skillName, reason: "invalid" });
|
|
29
|
+
}
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
export function registerAgentContextSkillRoutes(app, options) {
|
|
33
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/skills`, (request) => {
|
|
34
|
+
authorizeAgentContextRequest(request, options, "skills:list");
|
|
35
|
+
const limit = boundedLimit(request.query.limit, {
|
|
36
|
+
default: USER_SKILLS_LIMIT_DEFAULT,
|
|
37
|
+
max: USER_SKILLS_LIMIT_MAX,
|
|
38
|
+
});
|
|
39
|
+
const cursor = queryString(request.query.cursor);
|
|
40
|
+
const page = pageByOffset(listUserSkills(requireTuttiHome(options)), {
|
|
41
|
+
endpoint: "skills",
|
|
42
|
+
...(cursor === undefined ? {} : { cursor }),
|
|
43
|
+
limit,
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
items: page.items,
|
|
47
|
+
page: {
|
|
48
|
+
...(page.page.next_cursor === undefined ? {} : { next_cursor: page.page.next_cursor }),
|
|
49
|
+
limit: page.page.limit,
|
|
50
|
+
has_more: page.page.has_more,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/skills/:skillName`, (request) => {
|
|
55
|
+
authorizeAgentContextRequest(request, options, "skills:read");
|
|
56
|
+
const maxChars = boundedLimit(request.query.max_chars, {
|
|
57
|
+
default: USER_SKILL_MD_DEFAULT_MAX_CHARS,
|
|
58
|
+
max: USER_SKILL_MD_MAX_CHARS,
|
|
59
|
+
});
|
|
60
|
+
const skillName = request.params.skillName;
|
|
61
|
+
try {
|
|
62
|
+
const skill = readUserSkill(requireTuttiHome(options), skillName);
|
|
63
|
+
const skillMd = truncateText(redactText(skill.skill_md), maxChars);
|
|
64
|
+
return {
|
|
65
|
+
kind: "skill",
|
|
66
|
+
skill: {
|
|
67
|
+
name: skill.name,
|
|
68
|
+
description: skill.description,
|
|
69
|
+
...(skill.short_description === undefined
|
|
70
|
+
? {}
|
|
71
|
+
: { short_description: skill.short_description }),
|
|
72
|
+
enabled: skill.enabled,
|
|
73
|
+
source: skill.source,
|
|
74
|
+
...(skill.updated_at === undefined ? {} : { updated_at: skill.updated_at }),
|
|
75
|
+
},
|
|
76
|
+
skill_md: skillMd.text,
|
|
77
|
+
skill_md_truncated: skillMd.truncated,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return handleSkillReadError(error, skillName);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=agent-context-skills-routes.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FastifyInstance } from "fastify";
|
|
2
|
+
import { type AgentContextRouteOptions } from "./agent-context-shared.js";
|
|
3
|
+
export declare function registerAgentContextWorkspaceRoutes(app: FastifyInstance, options: AgentContextRouteOptions): void;
|
|
4
|
+
//# sourceMappingURL=agent-context-workspace-routes.d.ts.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { readScratchpadProjection, readTaskDetailProjection, readTaskRunResultsPage, readWorklistProjection, } from "../../../collaboration-state/index.js";
|
|
2
|
+
import { authorizeAgentContextRequest } from "./agent-context-auth.js";
|
|
3
|
+
import { AgentContextBadRequestError } from "./agent-context-errors.js";
|
|
4
|
+
import { boundedLimit, pageByOffset, queryString, truncateArray, truncateText, } from "./agent-context-query.js";
|
|
5
|
+
import { AGENT_CONTEXT_BASE_PATH, SCRATCHPAD_ARRAY_ITEM_MAX_CHARS, SCRATCHPAD_ARRAY_MAX_ITEMS, SCRATCHPAD_BACKGROUND_MAX_CHARS, SCRATCHPAD_TOPIC_MAX_CHARS, TASK_CONTRACT_ITEM_MAX_CHARS, TASK_RESULT_SUMMARY_MAX_CHARS, WORKLIST_LIMIT_DEFAULT, WORKLIST_LIMIT_MAX, WORKLIST_SUMMARY_MAX_CHARS, WORKLIST_TITLE_MAX_CHARS, requireProjectStore, } from "./agent-context-shared.js";
|
|
6
|
+
export function registerAgentContextWorkspaceRoutes(app, options) {
|
|
7
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/scratchpad`, (request) => {
|
|
8
|
+
authorizeAgentContextRequest(request, options, "scratchpad:read");
|
|
9
|
+
const scratchpad = readScratchpadProjection(requireProjectStore(options).db);
|
|
10
|
+
const topic = truncateText(scratchpad.topic, SCRATCHPAD_TOPIC_MAX_CHARS);
|
|
11
|
+
const background = truncateText(scratchpad.background_summary, SCRATCHPAD_BACKGROUND_MAX_CHARS);
|
|
12
|
+
const consensus = truncateArray(scratchpad.current_consensus, SCRATCHPAD_ARRAY_MAX_ITEMS, SCRATCHPAD_ARRAY_ITEM_MAX_CHARS);
|
|
13
|
+
const questions = truncateArray(scratchpad.open_questions, SCRATCHPAD_ARRAY_MAX_ITEMS, SCRATCHPAD_ARRAY_ITEM_MAX_CHARS);
|
|
14
|
+
const taskChanges = truncateArray(scratchpad.task_changes, SCRATCHPAD_ARRAY_MAX_ITEMS, SCRATCHPAD_ARRAY_ITEM_MAX_CHARS);
|
|
15
|
+
return {
|
|
16
|
+
state: scratchpad.state,
|
|
17
|
+
...(scratchpad.updated_at === undefined ? {} : { updated_at: scratchpad.updated_at }),
|
|
18
|
+
topic: topic.text,
|
|
19
|
+
topic_truncated: topic.truncated,
|
|
20
|
+
background_summary: background.text,
|
|
21
|
+
background_summary_truncated: background.truncated,
|
|
22
|
+
current_consensus: consensus.items,
|
|
23
|
+
current_consensus_truncated: consensus.truncated,
|
|
24
|
+
open_questions: questions.items,
|
|
25
|
+
open_questions_truncated: questions.truncated,
|
|
26
|
+
task_changes: taskChanges.items,
|
|
27
|
+
task_changes_truncated: taskChanges.truncated,
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/worklist`, (request) => {
|
|
31
|
+
authorizeAgentContextRequest(request, options, "worklist:read");
|
|
32
|
+
const query = request.query;
|
|
33
|
+
const limit = boundedLimit(query.limit, {
|
|
34
|
+
default: WORKLIST_LIMIT_DEFAULT,
|
|
35
|
+
max: WORKLIST_LIMIT_MAX,
|
|
36
|
+
});
|
|
37
|
+
const worklist = readWorklistProjection(requireProjectStore(options).db);
|
|
38
|
+
const items = worklist.modules.flatMap((moduleEntry) => moduleEntry.tasks.map((task) => {
|
|
39
|
+
const title = truncateText(task.title, WORKLIST_TITLE_MAX_CHARS);
|
|
40
|
+
const summary = truncateText(task.summary, WORKLIST_SUMMARY_MAX_CHARS);
|
|
41
|
+
const moduleSummary = truncateText(moduleEntry.module.summary, WORKLIST_SUMMARY_MAX_CHARS);
|
|
42
|
+
return {
|
|
43
|
+
module: {
|
|
44
|
+
module_id: moduleEntry.module.id,
|
|
45
|
+
name: moduleEntry.module.name,
|
|
46
|
+
...(moduleEntry.module.summary === undefined
|
|
47
|
+
? {}
|
|
48
|
+
: {
|
|
49
|
+
summary: moduleSummary.text,
|
|
50
|
+
summary_truncated: moduleSummary.truncated,
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
task: {
|
|
54
|
+
task_id: task.id,
|
|
55
|
+
title: title.text,
|
|
56
|
+
title_truncated: title.truncated,
|
|
57
|
+
status: task.status,
|
|
58
|
+
summary: summary.text,
|
|
59
|
+
summary_truncated: summary.truncated,
|
|
60
|
+
updated_at: task.updated_at,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}));
|
|
64
|
+
const cursor = queryString(query.cursor);
|
|
65
|
+
return pageByOffset(items, {
|
|
66
|
+
endpoint: "worklist",
|
|
67
|
+
...(cursor === undefined ? {} : { cursor }),
|
|
68
|
+
limit,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
app.get(`${AGENT_CONTEXT_BASE_PATH}/tasks/:taskId`, (request) => {
|
|
72
|
+
authorizeAgentContextRequest(request, options, "task:read");
|
|
73
|
+
const taskId = request.params.taskId;
|
|
74
|
+
const detail = readTaskDetailProjection(requireProjectStore(options).db, taskId);
|
|
75
|
+
if (detail === null) {
|
|
76
|
+
throw new AgentContextBadRequestError("Task was not found");
|
|
77
|
+
}
|
|
78
|
+
const worklist = readWorklistProjection(requireProjectStore(options).db);
|
|
79
|
+
const module = worklist.modules.find((entry) => entry.module.id === detail.task.module_id);
|
|
80
|
+
const title = truncateText(detail.task.title, WORKLIST_TITLE_MAX_CHARS);
|
|
81
|
+
const moduleSummary = truncateText(module?.module.summary, WORKLIST_SUMMARY_MAX_CHARS);
|
|
82
|
+
const contract = detail.detail.contract;
|
|
83
|
+
const goal = truncateText(contract.goal, TASK_CONTRACT_ITEM_MAX_CHARS);
|
|
84
|
+
const scope = truncateArray(contract.scope, 100, TASK_CONTRACT_ITEM_MAX_CHARS);
|
|
85
|
+
const latestResultSummary = truncateText(detail.detail.result.summary, TASK_RESULT_SUMMARY_MAX_CHARS);
|
|
86
|
+
const latestRunPage = readTaskRunResultsPage(requireProjectStore(options).db, taskId, {
|
|
87
|
+
limit: 1,
|
|
88
|
+
});
|
|
89
|
+
const latestRun = latestRunPage?.items[0];
|
|
90
|
+
return {
|
|
91
|
+
task_id: detail.task.id,
|
|
92
|
+
title: title.text,
|
|
93
|
+
title_truncated: title.truncated,
|
|
94
|
+
status: detail.task.status,
|
|
95
|
+
module: {
|
|
96
|
+
module_id: detail.task.module_id,
|
|
97
|
+
name: module?.module.name ?? "Unassigned",
|
|
98
|
+
...(module?.module.summary === undefined
|
|
99
|
+
? {}
|
|
100
|
+
: {
|
|
101
|
+
summary: moduleSummary.text,
|
|
102
|
+
summary_truncated: moduleSummary.truncated,
|
|
103
|
+
}),
|
|
104
|
+
},
|
|
105
|
+
contract: {
|
|
106
|
+
goal: goal.text,
|
|
107
|
+
goal_truncated: goal.truncated,
|
|
108
|
+
scope: scope.items,
|
|
109
|
+
scope_truncated: scope.truncated,
|
|
110
|
+
},
|
|
111
|
+
...(detail.detail.result.summary === undefined && latestRun === undefined
|
|
112
|
+
? {}
|
|
113
|
+
: {
|
|
114
|
+
latest_result: {
|
|
115
|
+
conclusion: detail.detail.result.result_kind ?? latestRun?.result_kind ?? "unknown",
|
|
116
|
+
summary: detail.detail.result.summary === undefined
|
|
117
|
+
? truncateText(latestRun?.summary, TASK_RESULT_SUMMARY_MAX_CHARS).text
|
|
118
|
+
: latestResultSummary.text,
|
|
119
|
+
summary_truncated: detail.detail.result.summary === undefined
|
|
120
|
+
? truncateText(latestRun?.summary, TASK_RESULT_SUMMARY_MAX_CHARS).truncated
|
|
121
|
+
: latestResultSummary.truncated,
|
|
122
|
+
...(latestRun?.created_at === undefined
|
|
123
|
+
? {}
|
|
124
|
+
: { completed_at: latestRun.created_at }),
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=agent-context-workspace-routes.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FastifyInstance } from "fastify";
|
|
2
|
+
import { AGENT_CONTEXT_BASE_PATH, type AgentContextRouteOptions } from "./agent-context-shared.js";
|
|
3
|
+
export { DEFAULT_AGENT_CONTEXT_TOKEN_TTL_MS, AgentContextTokenRegistry, } from "./agent-context-auth.js";
|
|
4
|
+
export type { AgentContextTokenRecord } from "./agent-context-auth.js";
|
|
5
|
+
export { AGENT_CONTEXT_BASE_PATH };
|
|
6
|
+
export type { AgentContextRouteOptions };
|
|
7
|
+
export declare function registerAgentContextRoutes(app: FastifyInstance, options: AgentContextRouteOptions): void;
|
|
8
|
+
//# sourceMappingURL=agent-context.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registerAgentContextMessageRoutes } from "./agent-context-messages-routes.js";
|
|
2
|
+
import { registerAgentContextProjectDocRoutes } from "./agent-context-project-doc-routes.js";
|
|
3
|
+
import { registerAgentContextReferenceRoutes } from "./agent-context-reference-routes.js";
|
|
4
|
+
import { registerAgentContextSkillRoutes } from "./agent-context-skills-routes.js";
|
|
5
|
+
import { AGENT_CONTEXT_BASE_PATH, } from "./agent-context-shared.js";
|
|
6
|
+
import { registerAgentContextWorkspaceRoutes } from "./agent-context-workspace-routes.js";
|
|
7
|
+
export { DEFAULT_AGENT_CONTEXT_TOKEN_TTL_MS, AgentContextTokenRegistry, } from "./agent-context-auth.js";
|
|
8
|
+
export { AGENT_CONTEXT_BASE_PATH };
|
|
9
|
+
export function registerAgentContextRoutes(app, options) {
|
|
10
|
+
registerAgentContextMessageRoutes(app, options);
|
|
11
|
+
registerAgentContextProjectDocRoutes(app, options);
|
|
12
|
+
registerAgentContextWorkspaceRoutes(app, options);
|
|
13
|
+
registerAgentContextReferenceRoutes(app, options);
|
|
14
|
+
registerAgentContextSkillRoutes(app, options);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=agent-context.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FastifyInstance } from "fastify";
|
|
2
|
+
export type HostHealthRouteOptions = {
|
|
3
|
+
now: () => Date;
|
|
4
|
+
serviceVersion: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function registerHostHealthRoute(app: FastifyInstance, options: HostHealthRouteOptions): void;
|
|
7
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const HostHealthResponseSchema = {
|
|
2
|
+
type: "object",
|
|
3
|
+
required: ["service", "status", "version", "time", "readiness"],
|
|
4
|
+
additionalProperties: false,
|
|
5
|
+
properties: {
|
|
6
|
+
service: { type: "string" },
|
|
7
|
+
status: { type: "string", enum: ["ok"] },
|
|
8
|
+
version: { type: "string" },
|
|
9
|
+
time: { type: "string" },
|
|
10
|
+
readiness: {
|
|
11
|
+
type: "object",
|
|
12
|
+
required: ["api", "store", "relay"],
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
properties: {
|
|
15
|
+
api: { type: "string", enum: ["ready"] },
|
|
16
|
+
store: { type: "string", enum: ["not_configured", "ready"] },
|
|
17
|
+
relay: { type: "string", enum: ["not_connected", "connected"] },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export function registerHostHealthRoute(app, options) {
|
|
23
|
+
app.get("/health", {
|
|
24
|
+
schema: {
|
|
25
|
+
response: {
|
|
26
|
+
200: HostHealthResponseSchema,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}, () => ({
|
|
30
|
+
service: "tutti-host",
|
|
31
|
+
status: "ok",
|
|
32
|
+
version: options.serviceVersion,
|
|
33
|
+
time: options.now().toISOString(),
|
|
34
|
+
readiness: {
|
|
35
|
+
api: "ready",
|
|
36
|
+
store: "not_configured",
|
|
37
|
+
relay: "not_connected",
|
|
38
|
+
},
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=health.js.map
|