@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
package/lib/config/schema.mjs
CHANGED
|
@@ -23,15 +23,14 @@ export const DEPLOYMENT_MODES = ['solo', 'team', 'enterprise'];
|
|
|
23
23
|
export const MCP_BROKER_VALUES = ['auto', 'on', 'off'];
|
|
24
24
|
export const DEFAULT_SCOPE_ID = 'rnd';
|
|
25
25
|
|
|
26
|
-
export const SURFACES = ['claude', 'opencode', 'codex', 'copilot', 'vscode', 'cursor'];
|
|
27
|
-
|
|
28
26
|
export const INGEST_STRATEGIES = ['adapter', 'provider', 'docling-remote'];
|
|
29
27
|
export const INGEST_FALLBACKS = ['none', 'provider', 'adapter'];
|
|
30
28
|
export const INGEST_ORCHESTRATIONS = ['prompt-only', 'orchestrated'];
|
|
31
29
|
|
|
32
|
-
export const ORCHESTRATION_WORKER_BACKENDS = ['inline', 'provider'];
|
|
30
|
+
export const ORCHESTRATION_WORKER_BACKENDS = ['inline', 'provider', 'host'];
|
|
33
31
|
export const ORCHESTRATION_STORES = ['filesystem', 'sqlite', 'postgres'];
|
|
34
32
|
export const CHAIN_OF_THOUGHT_MODES = ['hidden', 'surface', 'telemetry_only'];
|
|
33
|
+
export const ORCHESTRATION_HOST_EXECUTION_MODES = ['auto', 'pickup', 'sampling'];
|
|
35
34
|
|
|
36
35
|
// SessionStart context routing. `auto` keeps the rich payload on stdout for
|
|
37
36
|
// interactive sessions and suppresses it (to a debug log) for non-interactive /
|
|
@@ -70,6 +69,7 @@ export const DEFAULT_PROJECT_CONFIG = Object.freeze({
|
|
|
70
69
|
workerBackend: 'inline',
|
|
71
70
|
store: 'filesystem',
|
|
72
71
|
chainOfThought: 'hidden',
|
|
72
|
+
hostExecution: 'auto',
|
|
73
73
|
}),
|
|
74
74
|
telemetry: Object.freeze({
|
|
75
75
|
enabled: true,
|
|
@@ -89,12 +89,6 @@ export const DEFAULT_PROJECT_CONFIG = Object.freeze({
|
|
|
89
89
|
maxLiveFree: 24,
|
|
90
90
|
}),
|
|
91
91
|
}),
|
|
92
|
-
roleSelection: Object.freeze({
|
|
93
|
-
primary: null,
|
|
94
|
-
secondary: null,
|
|
95
|
-
perConversationOverride: true,
|
|
96
|
-
}),
|
|
97
|
-
hosts: Object.freeze(Object.fromEntries(SURFACES.map((s) => [s, Object.freeze({ enabled: true })]))),
|
|
98
92
|
resources: Object.freeze({
|
|
99
93
|
disk: Object.freeze({
|
|
100
94
|
tracesMaxDays: 30,
|
|
@@ -109,6 +103,8 @@ export const DEFAULT_PROJECT_CONFIG = Object.freeze({
|
|
|
109
103
|
handoffsMaxDays: 30,
|
|
110
104
|
handoffsMaxItems: 50,
|
|
111
105
|
totalCxMaxMb: 2000,
|
|
106
|
+
observationsMaxDays: 90,
|
|
107
|
+
observationsMaxRows: 5000,
|
|
112
108
|
}),
|
|
113
109
|
process: Object.freeze({
|
|
114
110
|
embedDaemonMaxRssMb: 800,
|
|
@@ -156,7 +152,7 @@ export const FIELD_RULES = {
|
|
|
156
152
|
types: { type: 'object', required: false },
|
|
157
153
|
},
|
|
158
154
|
},
|
|
159
|
-
scope: { type: 'string', required: false, maxLength: 40 },
|
|
155
|
+
scope: { type: 'string', required: false, maxLength: 40, enum: ['rnd', 'operations', 'creative', 'research'] },
|
|
160
156
|
autoEmbed: { type: 'boolean', required: false },
|
|
161
157
|
ingest: {
|
|
162
158
|
type: 'object',
|
|
@@ -174,6 +170,7 @@ export const FIELD_RULES = {
|
|
|
174
170
|
workerBackend: { type: 'string', enum: ORCHESTRATION_WORKER_BACKENDS },
|
|
175
171
|
store: { type: 'string', enum: ORCHESTRATION_STORES },
|
|
176
172
|
chainOfThought: { type: 'string', enum: CHAIN_OF_THOUGHT_MODES },
|
|
173
|
+
hostExecution: { type: 'string', enum: ORCHESTRATION_HOST_EXECUTION_MODES },
|
|
177
174
|
},
|
|
178
175
|
},
|
|
179
176
|
telemetry: {
|
|
@@ -190,27 +187,7 @@ export const FIELD_RULES = {
|
|
|
190
187
|
outputMode: { type: 'string', enum: HOOK_OUTPUT_MODES },
|
|
191
188
|
},
|
|
192
189
|
},
|
|
193
|
-
roleSelection: {
|
|
194
|
-
type: 'object',
|
|
195
|
-
required: false,
|
|
196
|
-
fields: {
|
|
197
|
-
primary: { type: ['string', 'null'], maxLength: 50 },
|
|
198
|
-
secondary: { type: ['string', 'null'], maxLength: 50 },
|
|
199
|
-
perConversationOverride: { type: 'boolean' },
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
190
|
resources: { type: 'object', required: false },
|
|
203
|
-
hosts: {
|
|
204
|
-
type: 'object',
|
|
205
|
-
required: false,
|
|
206
|
-
fields: Object.fromEntries(SURFACES.map((s) => [s, {
|
|
207
|
-
type: 'object',
|
|
208
|
-
required: false,
|
|
209
|
-
fields: {
|
|
210
|
-
enabled: { type: 'boolean', required: false },
|
|
211
|
-
},
|
|
212
|
-
}])),
|
|
213
|
-
},
|
|
214
191
|
costs: {
|
|
215
192
|
type: 'object',
|
|
216
193
|
required: false,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib/config/source-target-registry.mjs — manifest-derived source-target descriptors.
|
|
3
|
+
*
|
|
4
|
+
* Loads the merged (builtin/user/project) extension manifests and collects each
|
|
5
|
+
* manifest's optional `sourceTarget` block into a descriptor keyed by the block's
|
|
6
|
+
* own `provider` field — the string used in construct.config.json's
|
|
7
|
+
* `sources.targets[].provider`, in legacy env-derived targets, and in embed
|
|
8
|
+
* source records. That key is distinct from the manifest `id` for providers
|
|
9
|
+
* whose manifest id differs from their config-facing provider name (the Jira
|
|
10
|
+
* manifest id is `atlassian-jira`; its sourceTarget.provider is `jira`).
|
|
11
|
+
*
|
|
12
|
+
* lib/config/source-targets.mjs and lib/embed/demand-fetch.mjs iterate these
|
|
13
|
+
* descriptors instead of naming providers directly, so adding a fifth
|
|
14
|
+
* source-target-eligible provider requires only a manifest with a
|
|
15
|
+
* `sourceTarget` block — no edits to either file. See each descriptor field
|
|
16
|
+
* for its consumer:
|
|
17
|
+
* selector / secondaryField — validateSourceTarget, normalizeConfigTarget
|
|
18
|
+
* signature — targetSignature
|
|
19
|
+
* legacyEnv — legacyEnvSourceTargets
|
|
20
|
+
* aliases — resolveKnownSourcesFromTargets
|
|
21
|
+
* embed — targetsToEmbedSources
|
|
22
|
+
* embedFilters — targetsToEmbedSourcesWithFilters
|
|
23
|
+
* demandFetch.target* — lib/embed/demand-fetch.mjs buildReadCallsForTarget
|
|
24
|
+
* demandFetch.query* — lib/embed/demand-fetch.mjs buildReadCalls
|
|
25
|
+
*
|
|
26
|
+
* Computed once at module load (mirrors the BUILT_INS pattern in
|
|
27
|
+
* lib/providers/registry.mjs) using the default rootDir (process.cwd()).
|
|
28
|
+
* Callers that need a project-tier-aware view for a different rootDir should
|
|
29
|
+
* call loadSourceTargetDescriptors(rootDir) directly.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { loadManifestsFromDir, mergeManifests, resolveManifestDirs } from '../extensions/loader.mjs';
|
|
33
|
+
|
|
34
|
+
export function loadSourceTargetDescriptors(rootDir = process.cwd()) {
|
|
35
|
+
const { builtin, user, project } = resolveManifestDirs({ rootDir });
|
|
36
|
+
const { manifests: builtinManifests } = loadManifestsFromDir(builtin);
|
|
37
|
+
const { manifests: userManifests } = loadManifestsFromDir(user);
|
|
38
|
+
const { manifests: projectManifests } = loadManifestsFromDir(project);
|
|
39
|
+
const merged = mergeManifests(builtinManifests, userManifests, projectManifests);
|
|
40
|
+
|
|
41
|
+
const byProvider = new Map();
|
|
42
|
+
for (const manifest of merged) {
|
|
43
|
+
const descriptor = manifest.sourceTarget;
|
|
44
|
+
if (!descriptor || typeof descriptor !== 'object' || !descriptor.provider) continue;
|
|
45
|
+
byProvider.set(descriptor.provider, descriptor);
|
|
46
|
+
}
|
|
47
|
+
return byProvider;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const DESCRIPTORS = loadSourceTargetDescriptors();
|
|
51
|
+
|
|
52
|
+
export const SOURCE_TARGET_PROVIDERS = Object.freeze([...DESCRIPTORS.keys()]);
|
|
53
|
+
|
|
54
|
+
export function getSourceTargetDescriptor(provider) {
|
|
55
|
+
return DESCRIPTORS.get(provider) ?? null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function listSourceTargetDescriptors() {
|
|
59
|
+
return [...DESCRIPTORS.values()];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Fill a descriptor string template's `{name}` placeholders from `vars`.
|
|
64
|
+
* Shared by lib/config/source-targets.mjs (signatures) and
|
|
65
|
+
* lib/embed/demand-fetch.mjs (JQL construction) so both consume the same
|
|
66
|
+
* placeholder syntax the manifests declare.
|
|
67
|
+
*/
|
|
68
|
+
export function renderTemplate(template, vars) {
|
|
69
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => (key in vars ? String(vars[key]) : ''));
|
|
70
|
+
}
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* lib/config/source-targets.mjs — typed integration source targets in construct.config.json.
|
|
3
3
|
*
|
|
4
|
-
* Validates
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Validates provider selector records, merges legacy env target lists
|
|
5
|
+
* additively, deduplicates by provider+selector signature, and converts
|
|
6
|
+
* resolved targets into embed provider source records for auto-discovery.
|
|
7
|
+
*
|
|
8
|
+
* Every function here dispatches on the manifest-derived descriptors from
|
|
9
|
+
* lib/config/source-target-registry.mjs rather than naming providers
|
|
10
|
+
* directly — adding a fifth source-target-eligible provider means adding a
|
|
11
|
+
* `sourceTarget` block to that provider's manifest, not editing this file.
|
|
12
|
+
* See source-target-registry.mjs's header for what each descriptor field
|
|
13
|
+
* drives.
|
|
7
14
|
*/
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
import {
|
|
17
|
+
SOURCE_TARGET_PROVIDERS,
|
|
18
|
+
getSourceTargetDescriptor,
|
|
19
|
+
listSourceTargetDescriptors,
|
|
20
|
+
renderTemplate,
|
|
21
|
+
} from './source-target-registry.mjs';
|
|
22
|
+
|
|
23
|
+
export const SOURCE_PROVIDERS = SOURCE_TARGET_PROVIDERS;
|
|
10
24
|
|
|
11
|
-
|
|
25
|
+
const slackDescriptor = getSourceTargetDescriptor('slack');
|
|
26
|
+
export const SLACK_INTENTS = Object.freeze(slackDescriptor?.secondaryField?.enum ?? []);
|
|
12
27
|
|
|
13
28
|
const ID_RE = /^[a-z][a-z0-9_-]{0,63}$/i;
|
|
14
|
-
|
|
15
|
-
|
|
29
|
+
|
|
30
|
+
function applyPatternTransform(value, mode) {
|
|
31
|
+
if (mode === 'trimUpper') return value.trim().toUpperCase();
|
|
32
|
+
return value.trim();
|
|
33
|
+
}
|
|
16
34
|
|
|
17
35
|
export function validateSourceTarget(target, index = 0) {
|
|
18
36
|
const errors = [];
|
|
@@ -35,34 +53,26 @@ export function validateSourceTarget(target, index = 0) {
|
|
|
35
53
|
return errors;
|
|
36
54
|
}
|
|
37
55
|
|
|
56
|
+
const descriptor = getSourceTargetDescriptor(target.provider);
|
|
57
|
+
if (!descriptor) return errors;
|
|
58
|
+
|
|
38
59
|
const sel = target.selector;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
break;
|
|
55
|
-
case 'slack': {
|
|
56
|
-
if (typeof sel.channel !== 'string' || !sel.channel.trim()) {
|
|
57
|
-
errors.push(`${at}.selector.channel: required Slack channel name or ID`);
|
|
58
|
-
}
|
|
59
|
-
if (sel.intent !== undefined && !SLACK_INTENTS.includes(sel.intent)) {
|
|
60
|
-
errors.push(`${at}.selector.intent: must be one of ${SLACK_INTENTS.join(', ')}`);
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
60
|
+
const { field, pattern, patternTransform, hint } = descriptor.selector;
|
|
61
|
+
const raw = sel[field];
|
|
62
|
+
const valid = typeof raw === 'string' && (
|
|
63
|
+
pattern
|
|
64
|
+
? new RegExp(pattern).test(applyPatternTransform(raw, patternTransform))
|
|
65
|
+
: !!raw.trim()
|
|
66
|
+
);
|
|
67
|
+
if (!valid) {
|
|
68
|
+
errors.push(`${at}.selector.${field}: ${hint}`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (descriptor.secondaryField) {
|
|
72
|
+
const { field: secField, enum: secEnum, hint: secHint } = descriptor.secondaryField;
|
|
73
|
+
if (sel[secField] !== undefined && !secEnum.includes(sel[secField])) {
|
|
74
|
+
errors.push(`${at}.selector.${secField}: ${secHint} ${secEnum.join(', ')}`);
|
|
63
75
|
}
|
|
64
|
-
default:
|
|
65
|
-
break;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
return errors;
|
|
@@ -101,73 +111,71 @@ function slugId(value) {
|
|
|
101
111
|
return String(value).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
|
102
112
|
}
|
|
103
113
|
|
|
104
|
-
function parseSlackChannelEntry(raw) {
|
|
114
|
+
function parseSlackChannelEntry(raw, descriptor) {
|
|
105
115
|
const trimmed = String(raw).trim().replace(/^#/, '');
|
|
106
116
|
const colon = trimmed.indexOf(':');
|
|
117
|
+
const fallback = descriptor.secondaryField.default;
|
|
107
118
|
if (colon === -1) {
|
|
108
|
-
return { channel: trimmed, intent:
|
|
119
|
+
return { channel: trimmed, intent: fallback };
|
|
109
120
|
}
|
|
110
|
-
|
|
121
|
+
const intent = trimmed.slice(colon + 1) || fallback;
|
|
122
|
+
return { channel: trimmed.slice(0, colon), intent };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function legacyEnvRawValue(vars, env) {
|
|
126
|
+
return vars.reduce((acc, name) => (acc !== undefined ? acc : env[name]), undefined);
|
|
111
127
|
}
|
|
112
128
|
|
|
113
129
|
export function legacyEnvSourceTargets(env = process.env) {
|
|
114
130
|
const targets = [];
|
|
115
131
|
|
|
116
|
-
for (const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
for (const team of parseCsv(env.LINEAR_TEAMS)) {
|
|
136
|
-
targets.push({
|
|
137
|
-
id: `env-linear-${slugId(team)}`,
|
|
138
|
-
provider: 'linear',
|
|
139
|
-
selector: { team },
|
|
140
|
-
provenance: 'env:LINEAR_TEAMS',
|
|
141
|
-
});
|
|
142
|
-
}
|
|
132
|
+
for (const descriptor of listSourceTargetDescriptors()) {
|
|
133
|
+
const { provider, legacyEnv, selector } = descriptor;
|
|
134
|
+
if (!legacyEnv) continue;
|
|
135
|
+
const raw = legacyEnvRawValue(legacyEnv.vars, env);
|
|
136
|
+
const provenance = `env:${legacyEnv.vars[0]}`;
|
|
137
|
+
|
|
138
|
+
if (legacyEnv.parse === 'slackChannelColon') {
|
|
139
|
+
for (const entry of parseCsv(raw)) {
|
|
140
|
+
const { channel, intent } = parseSlackChannelEntry(entry, descriptor);
|
|
141
|
+
targets.push({
|
|
142
|
+
id: `env-${provider}-${slugId(channel)}`,
|
|
143
|
+
provider,
|
|
144
|
+
selector: { [selector.field]: channel, [descriptor.secondaryField.field]: intent },
|
|
145
|
+
provenance,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
143
150
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
for (const entry of parseCsv(raw)) {
|
|
152
|
+
const value = legacyEnv.valueTransform === 'upper' ? entry.toUpperCase() : entry;
|
|
153
|
+
targets.push({
|
|
154
|
+
id: `env-${provider}-${slugId(value)}`,
|
|
155
|
+
provider,
|
|
156
|
+
selector: { [selector.field]: value },
|
|
157
|
+
provenance,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
return targets;
|
|
155
163
|
}
|
|
156
164
|
|
|
165
|
+
function signatureValue(raw, mode) {
|
|
166
|
+
if (mode === 'optionalLower') return raw?.trim().toLowerCase();
|
|
167
|
+
if (mode === 'upperOrEmpty') return String(raw ?? '').trim().toUpperCase();
|
|
168
|
+
return String(raw ?? '').trim().toLowerCase();
|
|
169
|
+
}
|
|
170
|
+
|
|
157
171
|
export function targetSignature(target) {
|
|
158
172
|
const sel = target.selector ?? {};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return `linear:team:${String(sel.team ?? '').trim().toLowerCase()}`;
|
|
166
|
-
case 'slack':
|
|
167
|
-
return `slack:channel:${String(sel.channel ?? '').trim().toLowerCase()}:intent:${sel.intent ?? 'internal'}`;
|
|
168
|
-
default:
|
|
169
|
-
return `${target.provider}:${JSON.stringify(sel)}`;
|
|
170
|
-
}
|
|
173
|
+
const descriptor = getSourceTargetDescriptor(target.provider);
|
|
174
|
+
if (!descriptor) return `${target.provider}:${JSON.stringify(sel)}`;
|
|
175
|
+
|
|
176
|
+
const value = signatureValue(sel[descriptor.selector.field], descriptor.signature.valueMode);
|
|
177
|
+
const intent = descriptor.secondaryField ? (sel[descriptor.secondaryField.field] ?? descriptor.secondaryField.default) : undefined;
|
|
178
|
+
return renderTemplate(descriptor.signature.template, { value, intent });
|
|
171
179
|
}
|
|
172
180
|
|
|
173
181
|
export function mergeSourceTargets(configTargets = [], envTargets = []) {
|
|
@@ -191,19 +199,21 @@ export function normalizeConfigTarget(raw) {
|
|
|
191
199
|
provenance: raw.provenance ?? 'config',
|
|
192
200
|
};
|
|
193
201
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
const descriptor = getSourceTargetDescriptor(out.provider);
|
|
203
|
+
if (!descriptor) return out;
|
|
204
|
+
|
|
205
|
+
const { field, normalize } = descriptor.selector;
|
|
206
|
+
if (out.selector[field]) {
|
|
207
|
+
const value = String(out.selector[field]);
|
|
208
|
+
out.selector[field] = normalize === 'trimHash'
|
|
209
|
+
? value.trim().replace(/^#/, '')
|
|
210
|
+
: applyPatternTransform(value, normalize === 'trimUpper' ? 'trimUpper' : 'trim');
|
|
202
211
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
212
|
+
|
|
213
|
+
if (descriptor.secondaryField && !out.selector[descriptor.secondaryField.field]) {
|
|
214
|
+
out.selector[descriptor.secondaryField.field] = descriptor.secondaryField.default;
|
|
206
215
|
}
|
|
216
|
+
|
|
207
217
|
return out;
|
|
208
218
|
}
|
|
209
219
|
|
|
@@ -215,55 +225,41 @@ export function resolveEffectiveSourceTargetsFromConfig(config, env = process.en
|
|
|
215
225
|
|
|
216
226
|
export function targetsToEmbedSources(targets) {
|
|
217
227
|
const sources = [];
|
|
218
|
-
const githubRepos = targets.filter((t) => t.provider === 'github').map((t) => t.selector.repo);
|
|
219
|
-
if (githubRepos.length) {
|
|
220
|
-
sources.push({
|
|
221
|
-
provider: 'github',
|
|
222
|
-
repos: githubRepos,
|
|
223
|
-
refs: ['prs', 'issues', 'commits'],
|
|
224
|
-
limit: 25,
|
|
225
|
-
});
|
|
226
|
-
sources.push({
|
|
227
|
-
provider: 'github',
|
|
228
|
-
repos: githubRepos,
|
|
229
|
-
refs: ['meta', 'readme', 'docs'],
|
|
230
|
-
limit: 25,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
for (const target of targets.filter((t) => t.provider === 'jira')) {
|
|
235
|
-
sources.push({
|
|
236
|
-
provider: 'jira',
|
|
237
|
-
project: target.selector.project,
|
|
238
|
-
refs: ['issues'],
|
|
239
|
-
limit: 50,
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
228
|
|
|
243
|
-
for (const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
229
|
+
for (const descriptor of listSourceTargetDescriptors()) {
|
|
230
|
+
const { provider, embed } = descriptor;
|
|
231
|
+
if (!embed) continue;
|
|
232
|
+
const selField = descriptor.selector.field;
|
|
233
|
+
const providerTargets = targets.filter((t) => t.provider === provider);
|
|
234
|
+
if (!providerTargets.length) continue;
|
|
235
|
+
|
|
236
|
+
if (embed.mode === 'aggregate') {
|
|
237
|
+
const values = providerTargets.map((t) => t.selector[selField]);
|
|
238
|
+
for (const group of embed.groups) {
|
|
239
|
+
sources.push({ provider, [embed.valueField]: values, refs: group.refs, limit: group.limit });
|
|
240
|
+
}
|
|
241
|
+
} else if (embed.mode === 'perTarget') {
|
|
242
|
+
for (const target of providerTargets) {
|
|
243
|
+
sources.push({ provider, [embed.valueField]: target.selector[selField], refs: embed.refs, limit: embed.limit });
|
|
244
|
+
}
|
|
245
|
+
} else if (embed.mode === 'groupBy') {
|
|
246
|
+
const byGroup = new Map();
|
|
247
|
+
for (const target of providerTargets) {
|
|
248
|
+
const key = target.selector[embed.groupField] ?? embed.groupDefault;
|
|
249
|
+
if (!byGroup.has(key)) byGroup.set(key, []);
|
|
250
|
+
byGroup.get(key).push(target.selector[selField]);
|
|
251
|
+
}
|
|
252
|
+
for (const [key, values] of byGroup) {
|
|
253
|
+
sources.push({
|
|
254
|
+
provider,
|
|
255
|
+
[embed.valueField]: values,
|
|
256
|
+
[embed.groupField]: key,
|
|
257
|
+
refs: embed.refs,
|
|
258
|
+
oldest: embed.oldest,
|
|
259
|
+
limit: embed.limit,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
267
263
|
}
|
|
268
264
|
|
|
269
265
|
return sources;
|
|
@@ -273,38 +269,33 @@ export function resolveKnownSourcesFromTargets(targets) {
|
|
|
273
269
|
const sources = [];
|
|
274
270
|
|
|
275
271
|
for (const target of targets) {
|
|
272
|
+
const descriptor = getSourceTargetDescriptor(target.provider);
|
|
273
|
+
if (!descriptor) continue;
|
|
276
274
|
const sel = target.selector ?? {};
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
275
|
+
const value = sel[descriptor.selector.field];
|
|
276
|
+
if (!value) continue;
|
|
277
|
+
|
|
278
|
+
const display = descriptor.aliases.displayPrefix ? `${descriptor.aliases.displayPrefix}/${value}` : value;
|
|
279
|
+
|
|
280
|
+
if (descriptor.aliases.strategy === 'repoWords') {
|
|
281
|
+
const short = value.split('/').pop();
|
|
282
|
+
sources.push({ id: value.toLowerCase(), provider: target.provider, ref: value, display, targetId: target.id });
|
|
283
|
+
sources.push({ id: short.toLowerCase(), provider: target.provider, ref: value, display, targetId: target.id });
|
|
284
|
+
sources.push({ id: short.replace(/-/g, '').toLowerCase(), provider: target.provider, ref: value, display, targetId: target.id });
|
|
283
285
|
const words = short.split('-');
|
|
284
286
|
if (words.length > 1) {
|
|
285
|
-
sources.push({ id: words[words.length - 1].toLowerCase(), provider:
|
|
287
|
+
sources.push({ id: words[words.length - 1].toLowerCase(), provider: target.provider, ref: value, display, targetId: target.id });
|
|
286
288
|
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
const key = sel.project;
|
|
290
|
-
sources.push({ id: key.toLowerCase(), provider: 'jira', ref: key, display: `Jira/${key}`, targetId: target.id });
|
|
291
|
-
}
|
|
292
|
-
if (target.provider === 'linear' && sel.team) {
|
|
293
|
-
const team = sel.team;
|
|
294
|
-
sources.push({ id: team.toLowerCase(), provider: 'linear', ref: team, display: `Linear/${team}`, targetId: target.id });
|
|
295
|
-
}
|
|
296
|
-
if (target.provider === 'slack' && sel.channel) {
|
|
297
|
-
const ch = sel.channel;
|
|
298
|
-
sources.push({ id: ch.toLowerCase(), provider: 'slack', ref: ch, display: `Slack/${ch}`, targetId: target.id });
|
|
289
|
+
} else {
|
|
290
|
+
sources.push({ id: value.toLowerCase(), provider: target.provider, ref: value, display, targetId: target.id });
|
|
299
291
|
}
|
|
300
292
|
}
|
|
301
293
|
|
|
302
294
|
const providers = new Set(targets.map((t) => t.provider));
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
sources.push({ id: 'linear', provider: 'linear', ref: null, display: 'Linear' });
|
|
295
|
+
for (const descriptor of listSourceTargetDescriptors()) {
|
|
296
|
+
if (descriptor.aliases.catchAll && providers.has(descriptor.provider)) {
|
|
297
|
+
sources.push({ id: descriptor.provider, provider: descriptor.provider, ref: null, display: descriptor.aliases.displayPrefix });
|
|
298
|
+
}
|
|
308
299
|
}
|
|
309
300
|
|
|
310
301
|
return sources;
|
|
@@ -343,48 +334,31 @@ export function targetsToEmbedSourcesWithFilters(targets, { teamId = null } = {}
|
|
|
343
334
|
});
|
|
344
335
|
|
|
345
336
|
for (const target of targets) {
|
|
337
|
+
const descriptor = getSourceTargetDescriptor(target.provider);
|
|
338
|
+
if (!descriptor?.embedFilters) continue;
|
|
339
|
+
const ef = descriptor.embedFilters;
|
|
346
340
|
const f = target.filters ?? {};
|
|
347
341
|
const sel = target.selector ?? {};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
provider: 'jira',
|
|
360
|
-
project: sel.project,
|
|
361
|
-
refs: ['issues'],
|
|
362
|
-
...(typeof f.jql === 'string' ? { jql: f.jql } : {}),
|
|
363
|
-
limit: Number.isInteger(f.limit) ? f.limit : 50,
|
|
364
|
-
}, target));
|
|
365
|
-
break;
|
|
366
|
-
case 'linear':
|
|
367
|
-
sources.push(tag({
|
|
368
|
-
provider: 'linear',
|
|
369
|
-
team: sel.team,
|
|
370
|
-
refs: ['issues'],
|
|
371
|
-
...(Array.isArray(f.states) ? { states: f.states } : {}),
|
|
372
|
-
limit: Number.isInteger(f.limit) ? f.limit : 50,
|
|
373
|
-
}, target));
|
|
374
|
-
break;
|
|
375
|
-
case 'slack':
|
|
376
|
-
sources.push(tag({
|
|
377
|
-
provider: 'slack',
|
|
378
|
-
channels: [sel.channel],
|
|
379
|
-
intent: sel.intent ?? 'internal',
|
|
380
|
-
refs: ['messages'],
|
|
381
|
-
oldest: Number.isInteger(f.oldest) ? f.oldest : 86400,
|
|
382
|
-
limit: Number.isInteger(f.limit) ? f.limit : 50,
|
|
383
|
-
}, target));
|
|
384
|
-
break;
|
|
385
|
-
default:
|
|
386
|
-
break;
|
|
342
|
+
const selField = descriptor.selector.field;
|
|
343
|
+
|
|
344
|
+
const rec = {
|
|
345
|
+
provider: target.provider,
|
|
346
|
+
[ef.valueField]: ef.valueKind === 'array' ? [sel[selField]] : sel[selField],
|
|
347
|
+
refs: ef.refsFilterKey && Array.isArray(f[ef.refsFilterKey]) ? f[ef.refsFilterKey] : ef.defaultRefs,
|
|
348
|
+
limit: Number.isInteger(f.limit) ? f.limit : ef.defaultLimit,
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
if (ef.includeSecondaryField && descriptor.secondaryField) {
|
|
352
|
+
rec[descriptor.secondaryField.field] = sel[descriptor.secondaryField.field] ?? descriptor.secondaryField.default;
|
|
387
353
|
}
|
|
354
|
+
|
|
355
|
+
for (const key of ef.extraFilterKeys ?? []) {
|
|
356
|
+
if (key === 'jql' && typeof f.jql === 'string') rec.jql = f.jql;
|
|
357
|
+
if (key === 'states' && Array.isArray(f.states)) rec.states = f.states;
|
|
358
|
+
if (key === 'oldest') rec.oldest = Number.isInteger(f.oldest) ? f.oldest : descriptor.embed?.oldest;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
sources.push(tag(rec, target));
|
|
388
362
|
}
|
|
389
363
|
|
|
390
364
|
return sources;
|