@geraldmaron/construct 1.4.1 → 1.5.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/.env.example +36 -0
- package/README.md +41 -7
- package/bin/construct +1029 -65
- package/bin/construct-postinstall.mjs +27 -2
- package/config/tag-vocabulary.json +264 -0
- package/examples/distribution/sources/deck-one-pager.md +1 -1
- package/lib/acp/server.mjs +21 -7
- package/lib/adapters-sync.mjs +2 -1
- package/lib/audit-trail.mjs +185 -2
- package/lib/beads/auto-close.mjs +2 -1
- package/lib/beads/drift.mjs +2 -1
- package/lib/bridges/copilot-proxy.mjs +20 -5
- package/lib/certification/skill-inventory.mjs +10 -1
- package/lib/cli/approvals.mjs +147 -0
- package/lib/cli-commands.mjs +105 -14
- package/lib/comment-lint.mjs +127 -8
- package/lib/config/schema.mjs +7 -30
- package/lib/config/source-target-registry.mjs +70 -0
- package/lib/config/source-targets.mjs +179 -205
- package/lib/contracts/coverage.mjs +77 -0
- package/lib/contracts/validate.mjs +102 -13
- package/lib/contracts/violation-log.mjs +50 -4
- package/lib/db/migrate.mjs +69 -0
- package/lib/db/migrations/001_orchestration_runs.sql +9 -0
- package/lib/db/migrations/002_queue_provider.sql +50 -0
- package/lib/db/migrations/003_worker_registry.sql +17 -0
- package/lib/db/migrations/004_trace_events.sql +16 -0
- package/lib/db/migrations/005_shared_memory.sql +15 -0
- package/lib/db/migrations/006_orchestration_runs_tenant.sql +5 -0
- package/lib/decisions/enforced-baseline.json +0 -2
- package/lib/decisions/registry.mjs +3 -2
- package/lib/deployment/parity-contract.mjs +1 -1
- package/lib/deployment-mode.mjs +78 -2
- package/lib/diagram-export.mjs +10 -1
- package/lib/distill.mjs +5 -2
- package/lib/docs-verify.mjs +2 -1
- package/lib/doctor/cli.mjs +1 -0
- package/lib/doctor/command-on-path.mjs +24 -0
- package/lib/doctor/diagnosis.mjs +109 -0
- package/lib/doctor/embedding-health.mjs +50 -0
- package/lib/doctor/engine-health.mjs +93 -0
- package/lib/doctor/graph-validate.mjs +47 -0
- package/lib/doctor/index.mjs +23 -4
- package/lib/doctor/sidecar-providers.mjs +56 -0
- package/lib/doctor/watchers/consistency.mjs +93 -1
- package/lib/doctor/watchers/cx-budget.mjs +1 -1
- package/lib/doctor/watchers/graph-staleness.mjs +1 -1
- package/lib/doctor/watchers/mcp-protocol.mjs +17 -0
- package/lib/doctor/watchers/oracle-liveness.mjs +92 -0
- package/lib/doctor/watchers/orchestration-runs.mjs +108 -0
- package/lib/doctor/watchers/provider-breaker.mjs +78 -0
- package/lib/document-export.mjs +52 -27
- package/lib/document-extract/docling-client.mjs +9 -5
- package/lib/document-extract/docling-sidecar.py +30 -0
- package/lib/document-extract.mjs +1 -1
- package/lib/document-ingest.mjs +9 -0
- package/lib/embed/approval-queue.mjs +184 -88
- package/lib/embed/authority-guard.mjs +65 -2
- package/lib/embed/capability-jobs.mjs +365 -0
- package/lib/embed/capability-lifecycle.mjs +219 -0
- package/lib/embed/capability-loader.mjs +303 -0
- package/lib/embed/capability-runtime.mjs +58 -0
- package/lib/embed/cli.mjs +185 -8
- package/lib/embed/config.mjs +4 -0
- package/lib/embed/daemon.mjs +125 -6
- package/lib/embed/demand-fetch.mjs +190 -54
- package/lib/embed/inbox.mjs +12 -10
- package/lib/embed/presets/ops-triage.mjs +236 -0
- package/lib/embed/presets/pm-feedback.mjs +341 -0
- package/lib/embed/presets/tpm.mjs +401 -0
- package/lib/embed/providers/jira.mjs +72 -1
- package/lib/embed/providers/registry.mjs +140 -33
- package/lib/embed/worker.mjs +5 -0
- package/lib/embedded-contract/capability.mjs +4 -0
- package/lib/embedded-contract/execution.mjs +1 -1
- package/lib/embedded-contract/model-resolve.mjs +53 -3
- package/lib/embedded-contract/workflow-defs.mjs +48 -73
- package/lib/embedded-contract/workflow-invoke.mjs +144 -4
- package/lib/embedded-contract/workflows/architecture-review.manifest.json +15 -0
- package/lib/embedded-contract/workflows/data-structure.manifest.json +14 -0
- package/lib/embedded-contract/workflows/evidence-ingest.manifest.json +14 -0
- package/lib/embedded-contract/workflows/memo-draft.manifest.json +14 -0
- package/lib/embedded-contract/workflows/operations-triage.manifest.json +18 -0
- package/lib/embedded-contract/workflows/operations.manifest.json +18 -0
- package/lib/embedded-contract/workflows/pm-feedback.manifest.json +18 -0
- package/lib/embedded-contract/workflows/prd-draft.manifest.json +15 -0
- package/lib/embedded-contract/workflows/proposal-review.manifest.json +15 -0
- package/lib/embedded-contract/workflows/research-synthesis.manifest.json +14 -0
- package/lib/embedded-contract/workflows/risk-review.manifest.json +15 -0
- package/lib/embedded-contract/workflows/structure-notes.manifest.json +14 -0
- package/lib/embedded-contract/workflows/transcript-process.manifest.json +14 -0
- package/lib/embedded-contract/workflows/triage.manifest.json +14 -0
- package/lib/env-config.mjs +60 -11
- package/lib/export-validate.mjs +34 -2
- package/lib/extensions/index.mjs +27 -0
- package/lib/extensions/loader.mjs +120 -0
- package/lib/extensions/manifest-schema.mjs +141 -0
- package/lib/extensions/manifests/anthropic.manifest.json +12 -0
- package/lib/extensions/manifests/atlassian-confluence.manifest.json +12 -0
- package/lib/extensions/manifests/atlassian-jira.manifest.json +53 -0
- package/lib/extensions/manifests/directory.manifest.json +12 -0
- package/lib/extensions/manifests/docling.manifest.json +37 -0
- package/lib/extensions/manifests/echo.manifest.json +8 -0
- package/lib/extensions/manifests/feedback.manifest.json +12 -0
- package/lib/extensions/manifests/github-copilot.manifest.json +12 -0
- package/lib/extensions/manifests/github.manifest.json +52 -0
- package/lib/extensions/manifests/linear.manifest.json +50 -0
- package/lib/extensions/manifests/local.manifest.json +12 -0
- package/lib/extensions/manifests/ollama.manifest.json +12 -0
- package/lib/extensions/manifests/openai.manifest.json +12 -0
- package/lib/extensions/manifests/openrouter-anthropic.manifest.json +12 -0
- package/lib/extensions/manifests/openrouter-deepseek.manifest.json +12 -0
- package/lib/extensions/manifests/openrouter-google.manifest.json +12 -0
- package/lib/extensions/manifests/openrouter-llama.manifest.json +12 -0
- package/lib/extensions/manifests/openrouter-qwen.manifest.json +12 -0
- package/lib/extensions/manifests/openrouter.manifest.json +12 -0
- package/lib/extensions/manifests/postgres.manifest.json +12 -0
- package/lib/extensions/manifests/salesforce.manifest.json +12 -0
- package/lib/extensions/manifests/slack.manifest.json +58 -0
- package/lib/extensions/manifests/whisper.manifest.json +36 -0
- package/lib/extensions/validate.mjs +175 -0
- package/lib/features.mjs +13 -9
- package/lib/flows/checkpoint.mjs +184 -0
- package/lib/flows/constants.mjs +27 -0
- package/lib/flows/define.mjs +146 -0
- package/lib/flows/engine.mjs +249 -0
- package/lib/flows/errors.mjs +19 -0
- package/lib/flows/index.mjs +27 -0
- package/lib/flows/joins.mjs +18 -0
- package/lib/flows/schema.mjs +90 -0
- package/lib/flows/state.mjs +31 -0
- package/lib/frameworks/loader.mjs +99 -0
- package/lib/frameworks/schema.mjs +157 -0
- package/lib/graph/build-from-corpus.mjs +67 -0
- package/lib/graph/build-from-embed.mjs +82 -0
- package/lib/graph/build-from-registry.mjs +164 -3
- package/lib/graph/cli.mjs +456 -12
- package/lib/graph/gap-queries.mjs +156 -0
- package/lib/graph/gaps.mjs +41 -0
- package/lib/graph/impacted.mjs +129 -0
- package/lib/graph/runtime-evidence.mjs +177 -0
- package/lib/graph/security-coverage.mjs +113 -0
- package/lib/graph/staleness.mjs +241 -10
- package/lib/graph/store.mjs +24 -7
- package/lib/graph/validate.mjs +161 -0
- package/lib/headhunt.mjs +9 -8
- package/lib/health-check.mjs +15 -7
- package/lib/hook-health.mjs +1 -1
- package/lib/hooks/agent-tracker.mjs +10 -4
- package/lib/hooks/edit-guard.mjs +3 -3
- package/lib/hooks/graph-impact-advisory.mjs +2 -2
- package/lib/hooks/guard-bash.mjs +41 -15
- package/lib/hooks/mcp-health-check.mjs +11 -4
- package/lib/hooks/model-fallback.mjs +50 -6
- package/lib/hooks/orchestration-dispatch-guard.mjs +14 -3
- package/lib/hooks/pre-compact.mjs +181 -173
- package/lib/hooks/rule-verifier.mjs +2 -1
- package/lib/hooks/session-reflect.mjs +2 -1
- package/lib/hooks/session-start.mjs +3 -3
- package/lib/host/readiness.mjs +109 -0
- package/lib/host-capabilities.mjs +13 -2
- package/lib/host-disposition.mjs +29 -8
- package/lib/identity.mjs +92 -0
- package/lib/ingest/degraded-extract.mjs +96 -0
- package/lib/ingest/docling-remote.mjs +2 -1
- package/lib/ingest/provider-extract.mjs +7 -19
- package/lib/ingest/sidecar-providers.mjs +196 -0
- package/lib/ingest-tooling.mjs +11 -5
- package/lib/init-unified.mjs +55 -38
- package/lib/init-update.mjs +2 -1
- package/lib/install/legacy-global-cleanup.mjs +25 -0
- package/lib/install/stage-project.mjs +41 -4
- package/lib/intake/daemon.mjs +99 -8
- package/lib/intake/git-queue.mjs +110 -38
- package/lib/intake/prepare.mjs +2 -0
- package/lib/intake/queue-registry.mjs +50 -0
- package/lib/intake/queue.mjs +133 -17
- package/lib/intake/session-prelude.mjs +57 -8
- package/lib/integrations/intake-integrations.mjs +61 -111
- package/lib/intent-classifier.mjs +43 -5
- package/lib/libreoffice-export.mjs +8 -8
- package/lib/logging/rotate.mjs +5 -4
- package/lib/mcp/broker.mjs +332 -17
- package/lib/mcp/denied-store.mjs +95 -0
- package/lib/mcp/destructive-approval.mjs +57 -0
- package/lib/mcp/destructive-gate.mjs +30 -0
- package/lib/mcp/dispatch-envelope.mjs +199 -0
- package/lib/mcp/memory-bridge.mjs +2 -1
- package/lib/mcp/server.mjs +185 -1268
- package/lib/mcp/tool-definitions-memory.mjs +376 -0
- package/lib/mcp/tool-definitions-project.mjs +271 -0
- package/lib/mcp/tool-definitions-skills.mjs +311 -0
- package/lib/mcp/tool-definitions-workflow.mjs +398 -0
- package/lib/mcp/tool-definitions.mjs +25 -0
- package/lib/mcp/tool-rate-limit.mjs +47 -0
- package/lib/mcp/tool-registry.mjs +107 -0
- package/lib/mcp/tool-safety.mjs +95 -0
- package/lib/mcp/tool-surface-parity.mjs +60 -0
- package/lib/mcp/tools/orchestration-delegation-next.tool.mjs +68 -0
- package/lib/mcp/tools/orchestration-run.mjs +197 -19
- package/lib/mcp/tools/orchestration-task-result.tool.mjs +77 -0
- package/lib/mcp/tools/project.mjs +25 -8
- package/lib/mcp/tools/provider-write.mjs +187 -0
- package/lib/mcp/tools/scope.mjs +0 -3
- package/lib/mcp/tools/skills.mjs +1 -1
- package/lib/mcp/tools/storage.mjs +2 -2
- package/lib/mcp/tools/web-search-governance.mjs +96 -0
- package/lib/mcp/tools/web-search.mjs +5 -76
- package/lib/mcp/transport/auth.mjs +238 -0
- package/lib/mcp/transport/http.mjs +136 -0
- package/lib/mcp/transport/mode.mjs +31 -0
- package/lib/mcp/transport/stdio.mjs +22 -0
- package/lib/mcp-catalog.json +4 -4
- package/lib/mcp-manager.mjs +34 -23
- package/lib/mcp-platform-config.mjs +53 -20
- package/lib/mode-capabilities.mjs +109 -0
- package/lib/model-router.mjs +42 -9
- package/lib/models/catalog.mjs +40 -1
- package/lib/net-guard.mjs +247 -0
- package/lib/observation-store.mjs +6 -2
- package/lib/ollama/provision-context.mjs +2 -1
- package/lib/opencode-config.mjs +22 -3
- package/lib/opencode-runtime-plugin.mjs +120 -2
- package/lib/oracle/actions.mjs +204 -10
- package/lib/oracle/cli.mjs +24 -3
- package/lib/oracle/daemon-entry.mjs +6 -0
- package/lib/oracle/dispatch.mjs +2 -1
- package/lib/oracle/execute.mjs +2 -2
- package/lib/oracle/gaps.mjs +3 -3
- package/lib/oracle/heartbeat.mjs +53 -0
- package/lib/oracle/read-model.mjs +69 -13
- package/lib/oracle/reconcile.mjs +3 -46
- package/lib/oracle/routing.mjs +37 -31
- package/lib/oracle/synthesize.mjs +1 -1
- package/lib/orchestration/classification.mjs +434 -0
- package/lib/orchestration/delegation-flow.mjs +132 -0
- package/lib/orchestration/flow-selection.mjs +418 -0
- package/lib/orchestration/gates.mjs +244 -0
- package/lib/orchestration/host-sampling.mjs +121 -0
- package/lib/orchestration/policy-constants.mjs +48 -0
- package/lib/orchestration/provider-outcome.mjs +197 -0
- package/lib/orchestration/readiness.mjs +114 -13
- package/lib/orchestration/run-store-postgres.mjs +32 -26
- package/lib/orchestration/run-store-sqlite.mjs +8 -14
- package/lib/orchestration/run-store.mjs +25 -12
- package/lib/orchestration/runtime.mjs +508 -62
- package/lib/orchestration/store.mjs +87 -12
- package/lib/orchestration/trace-store.mjs +125 -0
- package/lib/orchestration/web-capability.mjs +60 -0
- package/lib/orchestration/worker-runtime.mjs +162 -0
- package/lib/orchestration/worker.mjs +763 -80
- package/lib/orchestration-policy.mjs +67 -1111
- package/lib/output-quality.mjs +61 -2
- package/lib/packs/cli.mjs +144 -0
- package/lib/packs/core-pack.mjs +112 -0
- package/lib/packs/enablement.mjs +187 -0
- package/lib/packs/index.mjs +23 -0
- package/lib/packs/loader.mjs +176 -0
- package/lib/packs/manifest-schema.mjs +58 -0
- package/lib/packs/prompts.mjs +120 -0
- package/lib/packs/validate.mjs +208 -0
- package/lib/path-policy.mjs +56 -0
- package/lib/plugin-registry.mjs +4 -5
- package/lib/policy/audit-gate.mjs +42 -0
- package/lib/policy/consumption-budget.mjs +149 -0
- package/lib/policy/engine.mjs +81 -6
- package/lib/policy/role-authority.mjs +89 -0
- package/lib/prompt-composer.js +19 -3
- package/lib/providers/contract/adapters/confluence/governed-write.mjs +215 -0
- package/lib/providers/contract/adapters/confluence/manifest.json +17 -0
- package/lib/providers/contract/adapters/confluence/transport.mjs +135 -0
- package/lib/providers/contract/adapters/github/governed-write.mjs +121 -0
- package/lib/providers/contract/adapters/github/index.mjs +38 -3
- package/lib/providers/contract/adapters/jira/adf.mjs +151 -0
- package/lib/providers/contract/adapters/jira/createmeta.mjs +143 -0
- package/lib/providers/contract/adapters/jira/governed-write.mjs +182 -0
- package/lib/providers/contract/adapters/jira/manifest.json +17 -0
- package/lib/providers/contract/adapters/jira/transport.mjs +119 -0
- package/lib/providers/contract.mjs +207 -0
- package/lib/providers/credential-bootstrap.mjs +7 -4
- package/lib/providers/credential-sources.mjs +14 -2
- package/lib/providers/directory/index.mjs +261 -0
- package/lib/providers/feedback/index.mjs +392 -0
- package/lib/providers/filter-audit.mjs +68 -0
- package/lib/providers/filter-schema.mjs +54 -0
- package/lib/providers/github/index.mjs +31 -0
- package/lib/providers/instance-config.mjs +215 -0
- package/lib/providers/op-locate.mjs +96 -0
- package/lib/providers/op-run.mjs +64 -9
- package/lib/providers/registry.mjs +26 -3
- package/lib/providers/secret-audit-wiring.mjs +41 -18
- package/lib/providers/secret-resolver.mjs +263 -31
- package/lib/publish-template.mjs +6 -3
- package/lib/publish-tooling.mjs +4 -0
- package/lib/publish.mjs +32 -4
- package/lib/queue/pg-queue.mjs +395 -0
- package/lib/reflect.mjs +2 -1
- package/lib/registry/assemble.mjs +28 -2
- package/lib/registry/catalog.mjs +6 -0
- package/lib/registry/consolidation.mjs +8 -1
- package/lib/registry/custom-scaffold.mjs +200 -0
- package/lib/registry/custom-schema.mjs +137 -0
- package/lib/registry/loader.mjs +15 -4
- package/lib/registry/manifests/format-engines.default.json +15 -0
- package/lib/registry/manifests/surface-map.default.json +46 -0
- package/lib/registry/retired-paths.mjs +1 -0
- package/lib/registry/surface-map.mjs +100 -50
- package/lib/registry/validate.mjs +3 -3
- package/lib/render-visual-check.mjs +240 -0
- package/lib/resources/budget.mjs +40 -17
- package/lib/roles/flavor-bindings.mjs +36 -14
- package/lib/roles/gateway.mjs +15 -8
- package/lib/roots.mjs +107 -0
- package/lib/runtime/uv-bootstrap.mjs +32 -6
- package/lib/runtime/whisper-bootstrap.mjs +11 -3
- package/lib/runtime-env.mjs +5 -2
- package/lib/sandbox.mjs +1 -1
- package/lib/scheduler/index.mjs +8 -20
- package/lib/schema-infer.mjs +31 -2
- package/lib/scopes/lifecycle.mjs +29 -25
- package/lib/scopes/loader.mjs +49 -12
- package/lib/scopes/teams.mjs +1 -1
- package/lib/security/ingest-boundary.mjs +80 -0
- package/lib/security/recall-wrapper.mjs +99 -0
- package/lib/security/trust.mjs +132 -0
- package/lib/service-manager.mjs +93 -24
- package/lib/setup.mjs +41 -23
- package/lib/skills-apply.mjs +4 -2
- package/lib/specialists/postconditions.mjs +2 -2
- package/lib/state-root.mjs +147 -0
- package/lib/status.mjs +597 -6
- package/lib/storage/admin.mjs +84 -7
- package/lib/storage/backend-registry.mjs +73 -0
- package/lib/storage/backend.mjs +63 -9
- package/lib/storage/embeddings-openai.mjs +12 -2
- package/lib/storage/hybrid-query.mjs +11 -3
- package/lib/storage/retrieval-hardening.mjs +384 -0
- package/lib/storage/shared-memory.mjs +158 -0
- package/lib/storage/vector-client.mjs +69 -2
- package/lib/team/health.mjs +72 -0
- package/lib/telemetry/backends/local.mjs +9 -3
- package/lib/telemetry/client.mjs +3 -7
- package/lib/template-registry.mjs +10 -12
- package/lib/tenant/context.mjs +82 -0
- package/lib/tenant/isolation.mjs +129 -0
- package/lib/test-corpus-inventory.mjs +103 -2
- package/lib/uninstall/uninstall.mjs +78 -12
- package/lib/validator.mjs +4 -6
- package/lib/worker/entrypoint.mjs +2 -1
- package/lib/worker/run.mjs +2 -2
- package/lib/worker/trace.mjs +5 -11
- package/lib/workflow-state.mjs +52 -8
- package/lib/workflows/liveness.mjs +203 -0
- package/lib/workflows/loader.mjs +177 -0
- package/lib/workflows/manifest-schema.mjs +71 -0
- package/lib/workflows/surface-parity.mjs +118 -0
- package/lib/workflows/validate.mjs +127 -0
- package/lib/writes/control-plane.mjs +140 -0
- package/lib/writes/envelope.mjs +206 -0
- package/lib/writes/sent-log.mjs +86 -0
- package/lib/writes/write-intent.mjs +109 -0
- package/package.json +20 -7
- package/personas/construct.md +12 -3
- package/registry/agent-manifest.json +117 -0
- package/registry/capabilities.json +1987 -0
- package/rules/common/comments.md +1 -0
- package/schemas/brand-voice.schema.json +24 -0
- package/schemas/capability-registry.schema.json +72 -0
- package/schemas/certification-run.schema.json +130 -0
- package/schemas/demo-recording.schema.json +46 -0
- package/schemas/eval-dataset.schema.json +79 -0
- package/schemas/execution-capability-profile.schema.json +46 -0
- package/schemas/execution-policy.schema.json +114 -0
- package/schemas/improvement-proposal.schema.json +65 -0
- package/schemas/mcp-tool-output.schema.json +61 -0
- package/schemas/platform-capabilities.schema.json +83 -0
- package/schemas/project-config.schema.json +215 -0
- package/schemas/project-demo.schema.json +60 -0
- package/schemas/provider-behavior-matrix.schema.json +91 -0
- package/schemas/scope.schema.json +197 -0
- package/schemas/specialist-trace.schema.json +107 -0
- package/schemas/team.schema.json +99 -0
- package/schemas/unified-registry.schema.json +546 -0
- package/scripts/sync-specialists.mjs +336 -106
- package/skills/docs/adr-workflow.md +1 -1
- package/skills/docs/codebase-research-workflow.md +3 -3
- package/skills/docs/prd-workflow.md +5 -6
- package/skills/docs/runbook-workflow.md +2 -2
- package/skills/docs/user-research-workflow.md +3 -3
- package/skills/operating/fleet-health-routing.md +77 -0
- package/skills/roles/ai-engineer.md +1 -1
- package/skills/roles/architect.md +0 -1
- package/skills/roles/business-strategist.md +1 -1
- package/skills/roles/data-analyst.telemetry.md +1 -1
- package/skills/roles/data-engineer.md +1 -1
- package/skills/roles/data-engineer.pipeline.md +1 -1
- package/skills/roles/data-engineer.vector-retrieval.md +1 -2
- package/skills/roles/data-engineer.warehouse.md +1 -1
- package/skills/roles/designer.accessibility.md +1 -1
- package/skills/roles/designer.md +0 -1
- package/skills/roles/devil-advocate.md +1 -1
- package/skills/roles/docs-keeper.md +1 -1
- package/skills/roles/evaluator.md +1 -1
- package/skills/roles/explorer.md +1 -1
- package/skills/roles/platform-engineer.md +1 -1
- package/skills/roles/qa.ai-eval.md +1 -2
- package/skills/roles/qa.api-contract.md +0 -1
- package/skills/roles/qa.data-pipeline.md +0 -1
- package/skills/roles/qa.md +0 -1
- package/skills/roles/qa.web-ui.md +0 -1
- package/skills/roles/release-manager.md +1 -1
- package/skills/roles/researcher.md +0 -2
- package/skills/roles/reviewer.md +0 -3
- package/skills/roles/security.ai.md +1 -1
- package/skills/roles/security.legal-compliance.md +1 -1
- package/skills/roles/security.md +0 -1
- package/skills/roles/security.privacy.md +0 -1
- package/skills/roles/security.supply-chain.md +1 -1
- package/skills/roles/sre.md +1 -1
- package/skills/roles/test-automation.md +1 -1
- package/skills/roles/trace-reviewer.md +1 -1
- package/skills/roles/ux-researcher.md +1 -1
- package/specialists/artifact-manifest.json +36 -36
- package/specialists/org/contracts/accessibility-to-qa.json +11 -3
- package/specialists/org/contracts/any-to-business-strategist.json +19 -7
- package/specialists/org/contracts/any-to-debugger.json +7 -1
- package/specialists/org/contracts/any-to-designer.json +7 -1
- package/specialists/org/contracts/any-to-docs-keeper.json +18 -4
- package/specialists/org/contracts/any-to-explorer.json +13 -4
- package/specialists/org/contracts/any-to-sre-incident.json +6 -2
- package/specialists/org/contracts/any-to-trace-reviewer.json +16 -4
- package/specialists/org/contracts/architect-to-ai-engineer.json +6 -2
- package/specialists/org/contracts/architect-to-data-engineer.json +17 -5
- package/specialists/org/contracts/architect-to-devil-advocate.json +11 -3
- package/specialists/org/contracts/architect-to-engineer.json +20 -4
- package/specialists/org/contracts/architect-to-evaluator.json +15 -5
- package/specialists/org/contracts/architect-to-legal-compliance.json +15 -5
- package/specialists/org/contracts/architect-to-operations.json +17 -4
- package/specialists/org/contracts/architect-to-platform-engineer.json +20 -4
- package/specialists/org/contracts/construct-to-orchestrator.json +10 -2
- package/specialists/org/contracts/data-analyst-to-product-manager.json +11 -2
- package/specialists/org/contracts/engineer-to-qa.json +20 -4
- package/specialists/org/contracts/engineer-to-reviewer.json +29 -5
- package/specialists/org/contracts/explorer-to-engineer.json +11 -3
- package/specialists/org/contracts/legal-compliance-to-release-manager.json +12 -4
- package/specialists/org/contracts/operations-to-user.json +53 -0
- package/specialists/org/contracts/operations-triage-output.json +53 -0
- package/specialists/org/contracts/pm-requirements-candidates.json +53 -0
- package/specialists/org/contracts/product-manager-to-architect.json +30 -10
- package/specialists/org/contracts/product-manager-to-data-analyst.json +13 -3
- package/specialists/org/contracts/product-manager-to-ux-researcher.json +15 -5
- package/specialists/org/contracts/qa-to-release-manager.json +11 -3
- package/specialists/org/contracts/researcher-to-architect.json +10 -2
- package/specialists/org/contracts/researcher-to-product-manager.json +16 -5
- package/specialists/org/contracts/reviewer-to-security.json +17 -3
- package/specialists/org/contracts/test-automation-to-engineer.json +11 -3
- package/specialists/org/contracts/trace-reviewer-to-sre.json +12 -4
- package/specialists/org/contracts/user-to-construct.json +11 -4
- package/specialists/org/frameworks/cx-architect-constraint-option-failure.md +66 -0
- package/specialists/org/frameworks/cx-engineer-feasibility-blast-radius.md +66 -0
- package/specialists/org/frameworks/cx-ops-dependency-sequencing.md +74 -0
- package/specialists/org/frameworks/cx-pm-value-tradeoff.md +66 -0
- package/specialists/org/frameworks/cx-qa-risk-based-coverage.md +69 -0
- package/specialists/org/groups/engineering-group.json +2 -6
- package/specialists/org/groups/governance-group.json +2 -3
- package/specialists/org/groups/operations-group.json +5 -8
- package/specialists/org/groups/product-group.json +4 -8
- package/specialists/org/groups/quality-group.json +3 -7
- package/specialists/org/groups/strategy-group.json +6 -9
- package/specialists/org/models.json.example +8 -0
- package/specialists/org/scopes/creative.json +6 -1
- package/specialists/org/scopes/operations.json +7 -1
- package/specialists/org/scopes/research.json +6 -1
- package/specialists/org/scopes/rnd.json +7 -1
- package/specialists/org/specialists/cx-architect.json +27 -8
- package/specialists/org/specialists/cx-designer.json +22 -8
- package/specialists/org/specialists/cx-engineer.json +71 -7
- package/specialists/org/specialists/cx-operations.json +89 -15
- package/specialists/org/specialists/cx-orchestrator.json +16 -4
- package/specialists/org/specialists/cx-product-manager.json +28 -9
- package/specialists/org/specialists/cx-qa.json +16 -6
- package/specialists/org/specialists/cx-researcher.json +41 -7
- package/specialists/org/specialists/cx-reviewer.json +61 -11
- package/specialists/org/specialists/cx-security.json +30 -10
- package/specialists/org/teams/design-team.json +3 -4
- package/specialists/org/teams/engineering-team.json +3 -10
- package/specialists/org/teams/governance-team.json +3 -5
- package/specialists/org/teams/operations-team.json +6 -12
- package/specialists/org/teams/product-management-team.json +2 -3
- package/specialists/org/teams/quality-team.json +4 -12
- package/specialists/org/teams/research-team.json +3 -3
- package/specialists/org/teams/strategy-team.json +7 -14
- package/specialists/prompts/cx-architect.md +20 -1
- package/specialists/prompts/cx-data-analyst.md +1 -1
- package/specialists/prompts/cx-designer.md +12 -4
- package/specialists/prompts/cx-engineer.md +15 -1
- package/specialists/prompts/cx-operations.md +14 -2
- package/specialists/prompts/cx-orchestrator.md +9 -5
- package/specialists/prompts/cx-product-manager.md +5 -1
- package/specialists/prompts/cx-qa.md +6 -2
- package/specialists/prompts/cx-researcher.md +27 -31
- package/specialists/prompts/cx-reviewer.md +19 -1
- package/specialists/prompts/cx-security.md +5 -1
- package/templates/distribution/construct-brand.typ +123 -59
- package/templates/distribution/construct-decision.typ +6 -3
- package/templates/distribution/construct-pdf.typ +11 -4
- package/templates/distribution/construct-prd.typ +6 -3
- package/templates/distribution/construct-research.typ +7 -4
- package/vendor/pandoc-ext/README.md +3 -0
- package/vendor/pandoc-ext/diagram.lua +687 -0
- package/lib/providers/contract/adapters/git/index.mjs +0 -115
- package/lib/providers/contract/adapters/slack/index.mjs +0 -175
- package/specialists/org/contracts/business-strategist-to-product-manager.json +0 -39
- package/specialists/org/contracts/construct-to-rd-lead.json +0 -53
- package/specialists/org/contracts/data-engineer-to-platform-engineer.json +0 -36
- package/specialists/org/contracts/designer-to-accessibility.json +0 -36
- package/specialists/org/contracts/platform-engineer-to-engineer.json +0 -31
- package/specialists/org/contracts/qa-to-test-automation.json +0 -42
- package/specialists/org/contracts/rd-lead-to-architect.json +0 -38
- package/specialists/org/contracts/sre-to-release-manager.json +0 -36
- package/specialists/org/specialists/cx-accessibility.json +0 -69
- package/specialists/org/specialists/cx-ai-engineer.json +0 -75
- package/specialists/org/specialists/cx-business-strategist.json +0 -72
- package/specialists/org/specialists/cx-data-engineer.json +0 -71
- package/specialists/org/specialists/cx-devil-advocate.json +0 -71
- package/specialists/org/specialists/cx-docs-keeper.json +0 -82
- package/specialists/org/specialists/cx-evaluator.json +0 -69
- package/specialists/org/specialists/cx-explorer.json +0 -69
- package/specialists/org/specialists/cx-legal-compliance.json +0 -74
- package/specialists/org/specialists/cx-oracle.json +0 -46
- package/specialists/org/specialists/cx-platform-engineer.json +0 -80
- package/specialists/org/specialists/cx-rd-lead.json +0 -73
- package/specialists/org/specialists/cx-release-manager.json +0 -77
- package/specialists/org/specialists/cx-sre.json +0 -94
- package/specialists/org/specialists/cx-test-automation.json +0 -69
- package/specialists/org/specialists/cx-trace-reviewer.json +0 -69
- package/specialists/org/specialists/cx-ux-researcher.json +0 -68
- package/specialists/org/teams/accessibility-team.json +0 -39
- package/specialists/org/teams/ux-research-team.json +0 -39
- package/specialists/prompts/cx-accessibility.md +0 -55
- package/specialists/prompts/cx-ai-engineer.md +0 -124
- package/specialists/prompts/cx-business-strategist.md +0 -58
- package/specialists/prompts/cx-data-engineer.md +0 -55
- package/specialists/prompts/cx-devil-advocate.md +0 -59
- package/specialists/prompts/cx-docs-keeper.md +0 -164
- package/specialists/prompts/cx-evaluator.md +0 -49
- package/specialists/prompts/cx-explorer.md +0 -71
- package/specialists/prompts/cx-legal-compliance.md +0 -58
- package/specialists/prompts/cx-oracle.md +0 -98
- package/specialists/prompts/cx-platform-engineer.md +0 -97
- package/specialists/prompts/cx-rd-lead.md +0 -59
- package/specialists/prompts/cx-release-manager.md +0 -54
- package/specialists/prompts/cx-sre.md +0 -111
- package/specialists/prompts/cx-test-automation.md +0 -55
- package/specialists/prompts/cx-trace-reviewer.md +0 -101
- package/specialists/prompts/cx-ux-researcher.md +0 -53
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/mcp/tool-definitions-memory.mjs — raw tool schemas: memory, scope/outcomes/knowledge, provider fetch/write, document export.
|
|
3
|
+
*
|
|
4
|
+
* Pure data: name/description/inputSchema/outputSchema for a slice of the
|
|
5
|
+
* hardcoded (non-self-registered) MCP tool catalog. Split out of
|
|
6
|
+
* lib/mcp/tool-definitions.mjs (which itself was split out of
|
|
7
|
+
* lib/mcp/server.mjs) purely to keep each file under the ~600-line
|
|
8
|
+
* house limit — no behavior differs from one combined array.
|
|
9
|
+
* lib/mcp/server.mjs concatenates every slice and applies
|
|
10
|
+
* withSafetyEnvelope (lib/mcp/tool-safety.mjs) at load time.
|
|
11
|
+
*/
|
|
12
|
+
export const TOOL_DEFS_MEMORY = [
|
|
13
|
+
{
|
|
14
|
+
name: 'memory_search',
|
|
15
|
+
outputSchema: { type: 'object' },
|
|
16
|
+
category: 'retrieval',
|
|
17
|
+
description: 'Search the observation store for patterns, decisions, and insights learned by specialists across sessions. Returns semantically matched observations scoped by role, category, or project.',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
query: { type: 'string', description: 'Semantic search query (e.g., project name, pattern, component).' },
|
|
22
|
+
role: { type: 'string', description: 'Filter by specialist role (e.g., cx-engineer, cx-architect).' },
|
|
23
|
+
category: { type: 'string', description: 'Filter by category: pattern, anti-pattern, dependency, decision, insight, session-summary.' },
|
|
24
|
+
project: { type: 'string', description: 'Filter by project name.' },
|
|
25
|
+
limit: { type: 'number', description: 'Max results (default: 10).' },
|
|
26
|
+
},
|
|
27
|
+
required: ['query'],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'memory_add_observations',
|
|
32
|
+
outputSchema: { type: 'object' },
|
|
33
|
+
description: 'Record observations (patterns, insights, decisions, anti-patterns) that specialists discover during work. These are indexed for semantic search and surface in future sessions.',
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
properties: {
|
|
37
|
+
observations: {
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
role: { type: 'string', description: 'Specialist role (e.g., cx-engineer).' },
|
|
43
|
+
category: { type: 'string', description: 'Category: pattern, anti-pattern, dependency, decision, insight.' },
|
|
44
|
+
summary: { type: 'string', description: 'Brief summary (max 500 chars).' },
|
|
45
|
+
content: { type: 'string', description: 'Detailed observation (max 2000 chars).' },
|
|
46
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Tags for filtering.' },
|
|
47
|
+
confidence: { type: 'number', description: 'Confidence 0.0-1.0 (default: 0.8).' },
|
|
48
|
+
},
|
|
49
|
+
required: ['summary'],
|
|
50
|
+
},
|
|
51
|
+
description: 'Observations to record (max 10 per call).',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: ['observations'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'memory_create_entities',
|
|
59
|
+
outputSchema: { type: 'object' },
|
|
60
|
+
description: 'Track recurring entities (components, services, APIs, dependencies) that specialists encounter. Enables "what do we know about X?" queries.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
entities: {
|
|
65
|
+
type: 'array',
|
|
66
|
+
items: {
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
name: { type: 'string', description: 'Entity name (normalized to lowercase).' },
|
|
70
|
+
type: { type: 'string', description: 'Type: component, service, dependency, api, concept, file-group.' },
|
|
71
|
+
summary: { type: 'string', description: 'Brief description (max 500 chars).' },
|
|
72
|
+
observation_ids: { type: 'array', items: { type: 'string' }, description: 'Link to observation IDs.' },
|
|
73
|
+
},
|
|
74
|
+
required: ['name'],
|
|
75
|
+
},
|
|
76
|
+
description: 'Entities to create or update (max 10 per call).',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['entities'],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'memory_recent',
|
|
84
|
+
outputSchema: { type: 'object' },
|
|
85
|
+
description: 'Returns the most recent observations for the current project, deduplicated by (role, summary). Use this when the session-start hint indicates prior observations are available — fetch them on demand instead of paying for them every session.',
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
cwd: { type: 'string', description: 'Project directory (default: process.cwd()).' },
|
|
90
|
+
project: { type: 'string', description: 'Filter by project name (default: inferred from cwd).' },
|
|
91
|
+
limit: { type: 'number', description: 'Max distinct observations (default: 10, max: 50).' },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'rovo_search',
|
|
97
|
+
outputSchema: { type: 'object' },
|
|
98
|
+
category: 'retrieval',
|
|
99
|
+
description: 'Cross-system semantic search via Atlassian Rovo. Searches Jira, Confluence, and other accessible sources. Returns excerpts with source attribution. Does NOT store results in the observation store. Use for broad queries across all sources, not just focal projects.',
|
|
100
|
+
inputSchema: {
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: {
|
|
103
|
+
query: { type: 'string', description: 'Search query (e.g., "Iverson reliability", "DR failover").' },
|
|
104
|
+
top_k: { type: 'number', description: 'Max results (default: 10, max: 50).' },
|
|
105
|
+
sources: { type: 'string', description: 'Comma-separated source filter (e.g., "jira,confluence").' },
|
|
106
|
+
},
|
|
107
|
+
required: ['query'],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'efficiency_snapshot',
|
|
112
|
+
outputSchema: { type: 'object' },
|
|
113
|
+
description: 'Returns the read-efficiency snapshot for the current session — repeated reads, large reads, hot-spot files, and recommendations. Use this when investigating why a session feels slow or to surface optimization opportunities.',
|
|
114
|
+
inputSchema: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {
|
|
117
|
+
home_dir: { type: 'string', description: 'Home directory override (default: os.homedir()).' },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'session_usage',
|
|
123
|
+
outputSchema: { type: 'object' },
|
|
124
|
+
description: 'Returns locally recorded interaction token and cost usage for the current Construct session.',
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: 'object',
|
|
127
|
+
properties: {
|
|
128
|
+
cwd: { type: 'string', description: 'Project directory (default: process.cwd()).' },
|
|
129
|
+
home_dir: { type: 'string', description: 'Home directory override for reading ~/.cx session logs.' },
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'provider_fetch',
|
|
135
|
+
outputSchema: { type: 'object' },
|
|
136
|
+
category: 'retrieval',
|
|
137
|
+
description: 'Look up current data for a configured repo, project, or team. This is an internal lookup against sources the operator has already authorized (set in config.env). Call this immediately — no user approval needed — whenever the user asks about a specific repo, project, or team name (e.g. "what is project iverson", "cloud-reliability status", "PLAT issues"). Pass the user\'s query and the tool resolves the right source automatically. Returns repo metadata, README, docs, open PRs, issues, and recent commits, then stores them as observations.',
|
|
138
|
+
inputSchema: {
|
|
139
|
+
type: 'object',
|
|
140
|
+
required: ['query'],
|
|
141
|
+
properties: {
|
|
142
|
+
query: { type: 'string', description: 'The user\'s question or the project/repo name (e.g. "project iverson", "hashicorp/project-iverson", "PLAT"). The tool matches this against configured GITHUB_REPOS, JIRA_PROJECTS, LINEAR_TEAMS.' },
|
|
143
|
+
root_dir: { type: 'string', description: 'Data root dir override (default: homedir()). Use CX_DATA_DIR value if set.' },
|
|
144
|
+
team_id: { type: 'string', description: 'Optional team id (from the unified registry). Scopes the fetch to that team\'s declared sources; observations are tagged team:<id>.' },
|
|
145
|
+
target_ids: { type: 'array', items: { type: 'string' }, description: 'Optional source-target ids to restrict to (must belong to team_id). A target outside the team returns a typed OUT_OF_SCOPE error rather than a silent wrong-source fetch.' },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'scope_show',
|
|
151
|
+
outputSchema: { type: 'object' },
|
|
152
|
+
description: 'Return the active Construct scope (id, displayName, roles, departments, intake taxonomy, doc templates). Use when a specialist needs to know which role set, classification taxonomy, or doc templates apply before drafting work.',
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: 'object',
|
|
155
|
+
properties: {
|
|
156
|
+
cwd: { type: 'string', description: 'Project root (default: server cwd).' },
|
|
157
|
+
id: { type: 'string', description: 'Force a specific scope id instead of resolving from config.' },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'scope_list',
|
|
163
|
+
outputSchema: { type: 'object' },
|
|
164
|
+
description: 'List the curated org scope catalog (rnd, operations, creative, research) with role/department counts. Use to discover which scopes are available before suggesting `construct scope set`.',
|
|
165
|
+
inputSchema: { type: 'object', properties: {} },
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'scope_drafts',
|
|
169
|
+
outputSchema: { type: 'object' },
|
|
170
|
+
description: 'List in-progress draft scopes under `.cx/scopes/draft-*` and any user-defined custom scope at `.cx/scope.json`. Use to see what scope work is pending before scaffolding another draft.',
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: { cwd: { type: 'string', description: 'Project root (default: server cwd).' } },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'scope_health',
|
|
178
|
+
outputSchema: { type: 'object' },
|
|
179
|
+
description: 'Per-scope health rollup over a window: observation count, per-role outcome runs and success rates. Use to check whether a scope is producing data before recommending changes or archive.',
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: 'object',
|
|
182
|
+
properties: {
|
|
183
|
+
cwd: { type: 'string', description: 'Project root (default: server cwd).' },
|
|
184
|
+
id: { type: 'string', description: 'Scope id (default: active scope).' },
|
|
185
|
+
window_days: { type: 'number', description: 'Window in days (default 30).' },
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'outcomes_summary',
|
|
191
|
+
outputSchema: { type: 'object' },
|
|
192
|
+
description: 'Read `.cx/outcomes/_summary.json` (per-role success rate, 30-day trend). Pass `aggregate=true` to rebuild the summary from JSONL outcome files first. Use to ground tiebreakers and improvement suggestions in real specialist performance.',
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: 'object',
|
|
195
|
+
properties: {
|
|
196
|
+
cwd: { type: 'string', description: 'Project root (default: server cwd).' },
|
|
197
|
+
aggregate: { type: 'boolean', description: 'Rebuild `_summary.json` before reading (default false).' },
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'outcomes_record',
|
|
203
|
+
outputSchema: { type: 'object' },
|
|
204
|
+
description: 'Append a specialist outcome line to `.cx/outcomes/<role>.jsonl` (writes durable state — requires `confirm=true`). Use when a specialist wants to self-report success/failure outside the automatic agent-tracker path.',
|
|
205
|
+
inputSchema: {
|
|
206
|
+
type: 'object',
|
|
207
|
+
required: ['confirm', 'role', 'success'],
|
|
208
|
+
properties: {
|
|
209
|
+
confirm: { type: 'boolean', description: 'Must be true.' },
|
|
210
|
+
cwd: { type: 'string' },
|
|
211
|
+
role: { type: 'string', description: 'Specialist id (e.g. cx-engineer, product-manager).' },
|
|
212
|
+
success: { type: 'boolean' },
|
|
213
|
+
intake_id: { type: 'string' },
|
|
214
|
+
profile: { type: 'string', description: 'Override active scope id stamp.' },
|
|
215
|
+
escalated: { type: 'boolean' },
|
|
216
|
+
duration_ms: { type: 'number' },
|
|
217
|
+
notes: { type: 'string', description: 'Trimmed to 500 chars.' },
|
|
218
|
+
source: { type: 'string', description: 'Origin tag (default: "mcp").' },
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: 'knowledge_add',
|
|
224
|
+
outputSchema: { type: 'object' },
|
|
225
|
+
description: 'Persist a research finding as `.cx/knowledge/external/research/<slug>.md` with research-specific frontmatter (topic, confidence, sources, expiresAt, scope). Writes durable state — requires `confirm=true`. `confidence=confirmed` requires at least one source.',
|
|
226
|
+
inputSchema: {
|
|
227
|
+
type: 'object',
|
|
228
|
+
required: ['confirm', 'slug', 'topic', 'body'],
|
|
229
|
+
properties: {
|
|
230
|
+
confirm: { type: 'boolean', description: 'Must be true.' },
|
|
231
|
+
cwd: { type: 'string' },
|
|
232
|
+
slug: { type: 'string', description: 'Lowercase hyphenated, max 60 chars.' },
|
|
233
|
+
topic: { type: 'string' },
|
|
234
|
+
body: { type: 'string', description: 'Findings / inferences / gaps / recommendation block. Capped at 50KB total file.' },
|
|
235
|
+
confidence: { type: 'string', enum: ['confirmed', 'inferred', 'weak'], description: 'Default: inferred.' },
|
|
236
|
+
sources: {
|
|
237
|
+
type: 'array',
|
|
238
|
+
description: 'Required when confidence=confirmed.',
|
|
239
|
+
items: {
|
|
240
|
+
type: 'object',
|
|
241
|
+
required: ['url'],
|
|
242
|
+
properties: {
|
|
243
|
+
url: { type: 'string' },
|
|
244
|
+
accessedAt: { type: 'string', description: 'ISO timestamp; default now.' },
|
|
245
|
+
span: { type: 'string', description: 'Citation locator; trimmed to 200 chars.' },
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
ttl_days: { type: 'number', description: 'Default 90.' },
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: 'scope_create',
|
|
255
|
+
outputSchema: { type: 'object' },
|
|
256
|
+
description: 'Scaffold a draft org scope under `.cx/scopes/draft-<id>/` (requirements.md + scope.json + persona stubs + department charters). Writes durable state — requires `confirm=true`. For curated catalog work, follow `docs/guides/concepts/profile-lifecycle.md` after creation.',
|
|
257
|
+
inputSchema: {
|
|
258
|
+
type: 'object',
|
|
259
|
+
required: ['confirm', 'id'],
|
|
260
|
+
properties: {
|
|
261
|
+
confirm: { type: 'boolean', description: 'Must be true.' },
|
|
262
|
+
cwd: { type: 'string' },
|
|
263
|
+
id: { type: 'string', description: 'Scope id (^[a-z][a-z0-9-]{1,30}$).' },
|
|
264
|
+
display_name: { type: 'string' },
|
|
265
|
+
seed_roles: {
|
|
266
|
+
type: 'array',
|
|
267
|
+
items: { type: 'string' },
|
|
268
|
+
description: 'Role ids to scaffold persona files for (cap 80).',
|
|
269
|
+
},
|
|
270
|
+
seed_departments: {
|
|
271
|
+
type: 'array',
|
|
272
|
+
items: {
|
|
273
|
+
type: 'object',
|
|
274
|
+
required: ['id'],
|
|
275
|
+
properties: {
|
|
276
|
+
id: { type: 'string' },
|
|
277
|
+
displayName: { type: 'string' },
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
description: 'Departments to scaffold charters for (cap 12).',
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: 'scope_archive',
|
|
287
|
+
outputSchema: { type: 'object' },
|
|
288
|
+
description: 'Archive a curated scope: moves `specialists/org/scopes/<id>.json` and its intake table into `archive/scopes/<id>/` with an archive note. Destructive — requires `confirm=true` and a substantive `reason` (>=8 chars). Observations and outcomes are preserved.',
|
|
289
|
+
inputSchema: {
|
|
290
|
+
type: 'object',
|
|
291
|
+
required: ['confirm', 'id', 'reason'],
|
|
292
|
+
properties: {
|
|
293
|
+
confirm: { type: 'boolean', description: 'Must be true.' },
|
|
294
|
+
id: { type: 'string' },
|
|
295
|
+
reason: { type: 'string', description: 'Substantive reason (>= 8 chars).' },
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'sandbox_list',
|
|
301
|
+
outputSchema: { type: 'object' },
|
|
302
|
+
description: 'List Construct sandboxes under `~/.cx/sandboxes/` (id, path, createdAt). Use to find an isolated environment for QA or dry-runs without polluting the active project.',
|
|
303
|
+
inputSchema: { type: 'object', properties: {} },
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'provider_write',
|
|
307
|
+
outputSchema: {
|
|
308
|
+
type: 'object',
|
|
309
|
+
properties: {
|
|
310
|
+
status: { type: 'string' },
|
|
311
|
+
provider: { type: 'string' },
|
|
312
|
+
dryRun: { type: 'boolean' },
|
|
313
|
+
diff: { type: 'object' },
|
|
314
|
+
envelope: { type: 'object' },
|
|
315
|
+
reason: { type: 'string' },
|
|
316
|
+
error: { type: 'string' },
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
description: 'Governed external write to a contract-adapter provider (jira, confluence, github). Destructive — dry_run defaults to true and only renders the would-write diff from adapter validation (no network, no side effect). Executing (dry_run=false) requires the out-of-band destructive-gate approval_token; the actual write then routes through the J2 envelope (idempotency, dedup, retry, audit) to the governed-write adapter — never called directly. Pass specialist_id when calling on behalf of an embedded specialist so the LMCP-E4 embedBindings grant is enforced.',
|
|
320
|
+
inputSchema: {
|
|
321
|
+
type: 'object',
|
|
322
|
+
required: ['provider', 'item'],
|
|
323
|
+
properties: {
|
|
324
|
+
provider: { type: 'string', enum: ['jira', 'confluence', 'github'], description: 'Target contract-adapter provider.' },
|
|
325
|
+
item: { type: 'object', additionalProperties: true, description: 'Write payload; shape depends on provider (e.g. { type: "issue", project, summary } for jira).' },
|
|
326
|
+
dry_run: { type: 'boolean', description: 'Default true. When true, returns the validated would-write diff only — never reaches the adapter write path.' },
|
|
327
|
+
specialist_id: { type: 'string', description: 'Embedded-specialist caller id (e.g. "cx-writer"); enforces that specialist\'s LMCP-E4 embedBindings grant before dispatch.' },
|
|
328
|
+
idempotency_key: { type: 'string', description: 'Explicit idempotency key forwarded to the J2 envelope (auto-derived from payload when omitted).' },
|
|
329
|
+
approval_token: { type: 'string', description: 'Out-of-band destructive-gate token, required to execute (dry_run=false). Issue with `construct tokens issue provider_write`.' },
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: 'knowledge_graph_ask',
|
|
335
|
+
outputSchema: { type: 'object' },
|
|
336
|
+
category: 'retrieval',
|
|
337
|
+
description: 'GraphRAG-style global query over the entity graph in `.cx/observations/`. Detects communities via label propagation, ranks them by BM25 against the query, and returns each top community with its central members and extractive summary. Use for "tell me about how X relates across the project" questions that pure semantic retrieval handles poorly.',
|
|
338
|
+
inputSchema: {
|
|
339
|
+
type: 'object',
|
|
340
|
+
required: ['query'],
|
|
341
|
+
properties: {
|
|
342
|
+
query: { type: 'string', description: 'Natural-language question.' },
|
|
343
|
+
cwd: { type: 'string', description: 'Project root (default: server cwd).' },
|
|
344
|
+
top_k: { type: 'number', description: 'Max communities to return (default 5).' },
|
|
345
|
+
min_size: { type: 'number', description: 'Skip communities smaller than this (default 2).' },
|
|
346
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Restrict entity extraction to observations carrying these tags.' },
|
|
347
|
+
tag_match: { type: 'string', enum: ['any', 'all'], description: 'Tag match mode: any (default) or all.' },
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: 'learning_status',
|
|
353
|
+
outputSchema: { type: 'object' },
|
|
354
|
+
description: 'One-shot mirror of `npm run learning:status`: active scope, observation counts (last 24h + total), research finding count, per-role outcome rollup. Use to answer "is Construct learning?" without spawning a shell.',
|
|
355
|
+
inputSchema: {
|
|
356
|
+
type: 'object',
|
|
357
|
+
properties: { cwd: { type: 'string', description: 'Project root (default: server cwd).' } },
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'document_export',
|
|
362
|
+
outputSchema: { type: 'object' },
|
|
363
|
+
description: 'Convert a markdown file into a distributable document — PDF, DOCX, legacy DOC (LibreOffice), deck HTML, PPTX, HTML, RTF, ODT, EPUB, LaTeX, plain text, or Markdown — via Pandoc and Typst (PDF engine) plus optional pptxgenjs/LibreOffice, per ADR-0024. Engines are optional dependencies discovered at runtime — the tool returns a structured "install <binary>" error when tooling is absent, never crashes. Use `detect_only=true` to check availability without running an export.',
|
|
364
|
+
inputSchema: {
|
|
365
|
+
type: 'object',
|
|
366
|
+
required: ['format'],
|
|
367
|
+
properties: {
|
|
368
|
+
input_path: { type: 'string', description: 'Absolute path to the markdown source file (required unless detect_only=true).' },
|
|
369
|
+
output_path: { type: 'string', description: 'Optional absolute output path; defaults to <input>.<format> next to the source.' },
|
|
370
|
+
format: { type: 'string', enum: ['pdf', 'docx', 'doc', 'deck', 'pptx', 'html', 'rtf', 'odt', 'epub', 'tex', 'txt', 'md', 'mdx'], description: 'Target format.' },
|
|
371
|
+
detect_only: { type: 'boolean', description: 'When true, report binary availability without exporting. Default false.' },
|
|
372
|
+
figures: { type: 'boolean', description: 'When true, render d2/mermaid via pandoc-ext/diagram filter. Default false.' },
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
];
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/mcp/tool-definitions-project.mjs — raw tool schemas: project context, diffs, document extraction/ingestion, storage.
|
|
3
|
+
*
|
|
4
|
+
* Pure data: name/description/inputSchema/outputSchema for a slice of the
|
|
5
|
+
* hardcoded (non-self-registered) MCP tool catalog. Split out of
|
|
6
|
+
* lib/mcp/tool-definitions.mjs (which itself was split out of
|
|
7
|
+
* lib/mcp/server.mjs) purely to keep each file under the ~600-line
|
|
8
|
+
* house limit — no behavior differs from one combined array.
|
|
9
|
+
* lib/mcp/server.mjs concatenates every slice and applies
|
|
10
|
+
* withSafetyEnvelope (lib/mcp/tool-safety.mjs) at load time.
|
|
11
|
+
*/
|
|
12
|
+
export const TOOL_DEFS_PROJECT = [
|
|
13
|
+
{
|
|
14
|
+
name: 'agent_health',
|
|
15
|
+
outputSchema: { type: 'object' },
|
|
16
|
+
description: 'Returns agent health summaries from the most recent performance review.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
agent_name: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: 'Specific agent name to filter, or omit for all agents.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'summarize_diff',
|
|
29
|
+
outputSchema: { type: 'object' },
|
|
30
|
+
description: 'Summarizes the git diff between the current state and a base ref.',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
base_ref: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Git ref to diff against (default: HEAD~1).',
|
|
37
|
+
},
|
|
38
|
+
cwd: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Working directory for the git command.',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'scan_file',
|
|
47
|
+
outputSchema: { type: 'object' },
|
|
48
|
+
description: 'Scans a file for secrets and code quality issues.',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
file_path: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Absolute path to the file to scan.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ['file_path'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'extract_document_text',
|
|
62
|
+
outputSchema: { type: 'object' },
|
|
63
|
+
description: 'Extracts readable text from a local document path. Uses node-native extractors (unpdf/mammoth) first; escalates to the docling Python sidecar or whisper.cpp when needed (same pipeline as `construct ingest`). Supports PDF, DOCX, XLSX, PPTX, HTML, plain text, email, and transcripts.',
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
file_path: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Absolute or relative path to the document file.',
|
|
70
|
+
},
|
|
71
|
+
max_chars: {
|
|
72
|
+
type: 'number',
|
|
73
|
+
description: 'Maximum characters to return (default 20000, hard cap 200000).',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ['file_path'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'ingest_document',
|
|
81
|
+
outputSchema: { type: 'object' },
|
|
82
|
+
description: 'Converts a local document into a normalized markdown file, placing it into an indexed project path by default.',
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
file_path: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
description: 'Absolute or relative path to the source document.',
|
|
89
|
+
},
|
|
90
|
+
out_path: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'Optional explicit markdown output path.',
|
|
93
|
+
},
|
|
94
|
+
out_dir: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'Optional directory for generated markdown output files.',
|
|
97
|
+
},
|
|
98
|
+
target: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: 'Output mode: knowledge/internal, knowledge/external, knowledge/decisions, knowledge/how-tos, knowledge/reference, or sibling. Defaults to knowledge/internal.',
|
|
101
|
+
},
|
|
102
|
+
cwd: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
description: 'Project root used to resolve default output paths and storage sync.',
|
|
105
|
+
},
|
|
106
|
+
sync: {
|
|
107
|
+
type: 'boolean',
|
|
108
|
+
description: 'When true, sync file-state into configured SQL/vector storage after writing output.',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
required: ['file_path'],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'infer_document_schema',
|
|
116
|
+
outputSchema: { type: 'object' },
|
|
117
|
+
description: 'Infers a structured field schema from a local document using AI. Returns field names, types, formats, examples, and confidence. Supports all document types handled by extract_document_text. Pass multiple file_paths to get a reconciled unified schema across documents.',
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: 'object',
|
|
120
|
+
properties: {
|
|
121
|
+
file_path: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
description: 'Absolute or relative path to the document file. For unified inference across multiple documents, use file_paths instead.',
|
|
124
|
+
},
|
|
125
|
+
file_paths: {
|
|
126
|
+
type: 'array',
|
|
127
|
+
items: { type: 'string' },
|
|
128
|
+
description: 'Multiple document paths for unified schema inference. Reconciles fields across all documents.',
|
|
129
|
+
},
|
|
130
|
+
max_chars: {
|
|
131
|
+
type: 'number',
|
|
132
|
+
description: 'Maximum characters of document text to send to the model (default 40000, hard cap 200000).',
|
|
133
|
+
},
|
|
134
|
+
save: {
|
|
135
|
+
type: 'boolean',
|
|
136
|
+
description: 'When true, write the schema result as a .schema.json artifact under .cx/knowledge/reference/schemas/.',
|
|
137
|
+
},
|
|
138
|
+
cwd: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
description: 'Project root used to resolve output paths when save is true.',
|
|
141
|
+
},
|
|
142
|
+
sample_size: {
|
|
143
|
+
type: 'number',
|
|
144
|
+
description: 'For unified inference: max number of documents to sample (default 10).',
|
|
145
|
+
},
|
|
146
|
+
threshold: {
|
|
147
|
+
type: 'number',
|
|
148
|
+
description: 'For unified inference: minimum fraction of documents a field must appear in to be included (default 0.5).',
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'list_schema_artifacts',
|
|
155
|
+
outputSchema: { type: 'object' },
|
|
156
|
+
description: 'Lists all inferred schema artifacts (.schema.json files) in the project.',
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: 'object',
|
|
159
|
+
properties: {
|
|
160
|
+
cwd: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
description: 'Project directory to search (default: process.cwd()).',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'storage_status',
|
|
169
|
+
outputSchema: { type: 'object' },
|
|
170
|
+
description: 'Returns SQL, local vector index, and ingested-artifact status for the current project.',
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: 'object',
|
|
173
|
+
properties: {
|
|
174
|
+
cwd: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
description: 'Project directory to inspect.',
|
|
177
|
+
},
|
|
178
|
+
project: {
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: 'Optional explicit project key for SQL document counts.',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'storage_sync',
|
|
187
|
+
description: 'Syncs file-state documents into the local vector index and configured SQL storage.',
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: {
|
|
191
|
+
cwd: {
|
|
192
|
+
type: 'string',
|
|
193
|
+
description: 'Project directory to sync.',
|
|
194
|
+
},
|
|
195
|
+
project: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
description: 'Optional explicit project key.',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'storage_reset',
|
|
204
|
+
description: 'Resets SQL/vector storage state for a project. Requires explicit confirm=true.',
|
|
205
|
+
inputSchema: {
|
|
206
|
+
type: 'object',
|
|
207
|
+
properties: {
|
|
208
|
+
cwd: {
|
|
209
|
+
type: 'string',
|
|
210
|
+
description: 'Project directory whose storage should be reset.',
|
|
211
|
+
},
|
|
212
|
+
project: {
|
|
213
|
+
type: 'string',
|
|
214
|
+
description: 'Optional explicit project key.',
|
|
215
|
+
},
|
|
216
|
+
reset_sql: {
|
|
217
|
+
type: 'boolean',
|
|
218
|
+
description: 'Set false to keep SQL state intact.',
|
|
219
|
+
},
|
|
220
|
+
reset_vector: {
|
|
221
|
+
type: 'boolean',
|
|
222
|
+
description: 'Set false to keep the local vector index intact.',
|
|
223
|
+
},
|
|
224
|
+
reset_ingested: {
|
|
225
|
+
type: 'boolean',
|
|
226
|
+
description: 'Set true to also delete ingested markdown artifacts under .cx/knowledge/.',
|
|
227
|
+
},
|
|
228
|
+
confirm: {
|
|
229
|
+
type: 'boolean',
|
|
230
|
+
description: 'Must be true or the reset is rejected.',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'delete_ingested_artifacts',
|
|
237
|
+
description: 'Deletes ingested markdown artifacts. Requires explicit confirm=true and only allows files under the ingested artifact directory.',
|
|
238
|
+
inputSchema: {
|
|
239
|
+
type: 'object',
|
|
240
|
+
properties: {
|
|
241
|
+
cwd: {
|
|
242
|
+
type: 'string',
|
|
243
|
+
description: 'Project directory whose ingested artifacts should be deleted.',
|
|
244
|
+
},
|
|
245
|
+
files: {
|
|
246
|
+
type: 'array',
|
|
247
|
+
description: 'Optional relative file paths under .cx/knowledge/. Omit to delete all ingested markdown artifacts.',
|
|
248
|
+
items: { type: 'string' },
|
|
249
|
+
},
|
|
250
|
+
confirm: {
|
|
251
|
+
type: 'boolean',
|
|
252
|
+
description: 'Must be true or deletion is rejected.',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'project_context',
|
|
259
|
+
outputSchema: { type: 'object' },
|
|
260
|
+
description: 'Returns project context: .cx/context.md content, recent commits, and working tree status.',
|
|
261
|
+
inputSchema: {
|
|
262
|
+
type: 'object',
|
|
263
|
+
properties: {
|
|
264
|
+
cwd: {
|
|
265
|
+
type: 'string',
|
|
266
|
+
description: 'Project directory (default: process.cwd()).',
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
];
|