@telora/daemon 0.19.47 → 0.19.74
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/build-info.json +6 -3
- package/dist/assembly-engine.d.ts +9 -0
- package/dist/assembly-engine.d.ts.map +1 -1
- package/dist/assembly-engine.js.map +1 -1
- package/dist/audit-hooks.js +1 -1
- package/dist/branch-status.js +2 -2
- package/dist/branch-status.js.map +1 -1
- package/dist/ci-sensor-loop.d.ts +47 -0
- package/dist/ci-sensor-loop.d.ts.map +1 -0
- package/dist/ci-sensor-loop.js +116 -0
- package/dist/ci-sensor-loop.js.map +1 -0
- package/dist/ci-status-git.d.ts +52 -0
- package/dist/ci-status-git.d.ts.map +1 -0
- package/dist/ci-status-git.js +86 -0
- package/dist/ci-status-git.js.map +1 -0
- package/dist/ci-status.d.ts +122 -0
- package/dist/ci-status.d.ts.map +1 -0
- package/dist/ci-status.js +114 -0
- package/dist/ci-status.js.map +1 -0
- package/dist/cli/connect/agents.d.ts +24 -0
- package/dist/cli/connect/agents.d.ts.map +1 -0
- package/dist/cli/connect/agents.js +65 -0
- package/dist/cli/connect/agents.js.map +1 -0
- package/dist/cli/connect/claude.d.ts +31 -0
- package/dist/cli/connect/claude.d.ts.map +1 -0
- package/dist/cli/connect/claude.js +104 -0
- package/dist/cli/connect/claude.js.map +1 -0
- package/dist/cli/connect/cline.d.ts +37 -0
- package/dist/cli/connect/cline.d.ts.map +1 -0
- package/dist/cli/connect/cline.js +115 -0
- package/dist/cli/connect/cline.js.map +1 -0
- package/dist/cli/connect/codex.d.ts +44 -0
- package/dist/cli/connect/codex.d.ts.map +1 -0
- package/dist/cli/connect/codex.js +111 -0
- package/dist/cli/connect/codex.js.map +1 -0
- package/dist/cli/connect/ide.d.ts +69 -0
- package/dist/cli/connect/ide.d.ts.map +1 -0
- package/dist/cli/connect/ide.js +134 -0
- package/dist/cli/connect/ide.js.map +1 -0
- package/dist/cli/connect/scaffolding.d.ts +31 -0
- package/dist/cli/connect/scaffolding.d.ts.map +1 -0
- package/dist/cli/connect/scaffolding.js +52 -0
- package/dist/cli/connect/scaffolding.js.map +1 -0
- package/dist/cli/connect/shared.d.ts +30 -0
- package/dist/cli/connect/shared.d.ts.map +1 -0
- package/dist/cli/connect/shared.js +11 -0
- package/dist/cli/connect/shared.js.map +1 -0
- package/dist/cli/connect.d.ts +9 -210
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +10 -526
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/open.js +2 -2
- package/dist/completion/event.d.ts +2 -0
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +19 -2
- package/dist/completion/event.js.map +1 -1
- package/dist/completion/merge-phase.d.ts +3 -0
- package/dist/completion/merge-phase.d.ts.map +1 -1
- package/dist/completion/merge-phase.js +35 -3
- package/dist/completion/merge-phase.js.map +1 -1
- package/dist/completion/read-only-pristine.d.ts +1 -1
- package/dist/completion/read-only-pristine.d.ts.map +1 -1
- package/dist/completion/read-only-pristine.js +1 -1
- package/dist/completion/read-only-pristine.js.map +1 -1
- package/dist/completion/review-exit-phase.d.ts +30 -3
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +203 -15
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/completion/status-advance-phase.js +1 -1
- package/dist/completion/status-advance-phase.js.map +1 -1
- package/dist/completion/team-completion.d.ts.map +1 -1
- package/dist/completion/team-completion.js +22 -2
- package/dist/completion/team-completion.js.map +1 -1
- package/dist/completion/team-lifecycle.js +1 -1
- package/dist/completion/terminated-work-reconcile.js +1 -1
- package/dist/completion/terminated-work-reconcile.js.map +1 -1
- package/dist/condition-evaluators.d.ts +41 -2
- package/dist/condition-evaluators.d.ts.map +1 -1
- package/dist/condition-evaluators.js +37 -288
- package/dist/condition-evaluators.js.map +1 -1
- package/dist/context-audit.d.ts +1 -1
- package/dist/context-audit.d.ts.map +1 -1
- package/dist/context-lock.d.ts +1 -1
- package/dist/context-lock.d.ts.map +1 -1
- package/dist/control-state.d.ts +2 -2
- package/dist/control-state.d.ts.map +1 -1
- package/dist/control-state.js +4 -3
- package/dist/control-state.js.map +1 -1
- package/dist/daemon-process.d.ts +1 -1
- package/dist/daemon-process.d.ts.map +1 -1
- package/dist/delivery-advance-block.d.ts +1 -1
- package/dist/delivery-advance-block.d.ts.map +1 -1
- package/dist/delivery-advance-block.js +1 -1
- package/dist/delivery-advance-block.js.map +1 -1
- package/dist/delivery-lifecycle.js +1 -1
- package/dist/delivery-reconciler-shadow.d.ts +1 -1
- package/dist/delivery-reconciler-shadow.d.ts.map +1 -1
- package/dist/delivery-reconciler-shadow.js +1 -1
- package/dist/delivery-reconciler-shadow.js.map +1 -1
- package/dist/directive-executor.js +1 -1
- package/dist/directive-executor.js.map +1 -1
- package/dist/drift-eval-loop.d.ts.map +1 -1
- package/dist/drift-eval-loop.js +6 -14
- package/dist/drift-eval-loop.js.map +1 -1
- package/dist/escalations.d.ts +1 -1
- package/dist/escalations.d.ts.map +1 -1
- package/dist/escalations.js +1 -1
- package/dist/escalations.js.map +1 -1
- package/dist/evaluation-context.d.ts +2 -33
- package/dist/evaluation-context.d.ts.map +1 -1
- package/dist/evaluation-context.js +2 -56
- package/dist/evaluation-context.js.map +1 -1
- package/dist/focus-engine.d.ts +14 -5
- package/dist/focus-engine.d.ts.map +1 -1
- package/dist/focus-engine.js +35 -289
- package/dist/focus-engine.js.map +1 -1
- package/dist/focus-executor.d.ts +10 -791
- package/dist/focus-executor.d.ts.map +1 -1
- package/dist/focus-executor.js +42 -1568
- package/dist/focus-executor.js.map +1 -1
- package/dist/focus-lifecycle.js +2 -2
- package/dist/focus-lifecycle.js.map +1 -1
- package/dist/focus-loop-registry.d.ts +52 -0
- package/dist/focus-loop-registry.d.ts.map +1 -0
- package/dist/focus-loop-registry.js +328 -0
- package/dist/focus-loop-registry.js.map +1 -0
- package/dist/focus-merge.d.ts +1 -1
- package/dist/focus-merge.d.ts.map +1 -1
- package/dist/focus-merge.js +3 -3
- package/dist/focus-merge.js.map +1 -1
- package/dist/focus-phase.d.ts +4 -0
- package/dist/focus-phase.d.ts.map +1 -1
- package/dist/focus-phase.js +3 -3
- package/dist/focus-phase.js.map +1 -1
- package/dist/focus-stage-lifecycle/planning-release.d.ts +197 -0
- package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/planning-release.js +312 -0
- package/dist/focus-stage-lifecycle/planning-release.js.map +1 -0
- package/dist/focus-stage-lifecycle/review-convergence.d.ts +133 -0
- package/dist/focus-stage-lifecycle/review-convergence.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/review-convergence.js +235 -0
- package/dist/focus-stage-lifecycle/review-convergence.js.map +1 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts +133 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.d.ts.map +1 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.js +365 -0
- package/dist/focus-stage-lifecycle/wedge-watchdog.js.map +1 -0
- package/dist/focus-stage-lifecycle.d.ts +22 -421
- package/dist/focus-stage-lifecycle.d.ts.map +1 -1
- package/dist/focus-stage-lifecycle.js +24 -832
- package/dist/focus-stage-lifecycle.js.map +1 -1
- package/dist/{git-activity.d.ts → git/activity.d.ts} +1 -1
- package/dist/git/activity.d.ts.map +1 -0
- package/dist/{git-activity.js → git/activity.js} +2 -2
- package/dist/git/activity.js.map +1 -0
- package/dist/{git-branch.d.ts → git/branch.d.ts} +2 -2
- package/dist/git/branch.d.ts.map +1 -0
- package/dist/{git-branch.js → git/branch.js} +2 -2
- package/dist/git/branch.js.map +1 -0
- package/dist/{git-fetch.d.ts → git/fetch.d.ts} +2 -2
- package/dist/git/fetch.d.ts.map +1 -0
- package/dist/{git-fetch.js → git/fetch.js} +1 -1
- package/dist/git/fetch.js.map +1 -0
- package/dist/{git-genesis.d.ts → git/genesis.d.ts} +3 -3
- package/dist/git/genesis.d.ts.map +1 -0
- package/dist/{git-genesis.js → git/genesis.js} +5 -5
- package/dist/git/genesis.js.map +1 -0
- package/dist/git/index.d.ts +36 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +36 -0
- package/dist/git/index.js.map +1 -0
- package/dist/{git-integration.d.ts → git/integration.d.ts} +2 -2
- package/dist/git/integration.d.ts.map +1 -0
- package/dist/{git-integration.js → git/integration.js} +4 -4
- package/dist/git/integration.js.map +1 -0
- package/dist/{git-merge-helpers.d.ts → git/merge-helpers.d.ts} +3 -3
- package/dist/git/merge-helpers.d.ts.map +1 -0
- package/dist/{git-merge-helpers.js → git/merge-helpers.js} +3 -3
- package/dist/git/merge-helpers.js.map +1 -0
- package/dist/{git-merge-lock.d.ts → git/merge-lock.d.ts} +1 -1
- package/dist/git/merge-lock.d.ts.map +1 -0
- package/dist/{git-merge-lock.js → git/merge-lock.js} +1 -1
- package/dist/git/merge-lock.js.map +1 -0
- package/dist/{git-merge-strategies.d.ts → git/merge-strategies.d.ts} +2 -2
- package/dist/git/merge-strategies.d.ts.map +1 -0
- package/dist/{git-merge-strategies.js → git/merge-strategies.js} +3 -3
- package/dist/git/merge-strategies.js.map +1 -0
- package/dist/{git-merge.d.ts → git/merge.d.ts} +4 -4
- package/dist/git/merge.d.ts.map +1 -0
- package/dist/{git-merge.js → git/merge.js} +4 -4
- package/dist/git/merge.js.map +1 -0
- package/dist/{git-state-detector.d.ts → git/state-detector.d.ts} +2 -2
- package/dist/git/state-detector.d.ts.map +1 -0
- package/dist/{git-state-detector.js → git/state-detector.js} +7 -7
- package/dist/git/state-detector.js.map +1 -0
- package/dist/{git-types.d.ts → git/types.d.ts} +2 -2
- package/dist/git/types.d.ts.map +1 -0
- package/dist/{git-types.js → git/types.js} +1 -1
- package/dist/git/types.js.map +1 -0
- package/dist/{git-utils.d.ts → git/utils.d.ts} +1 -1
- package/dist/git/utils.d.ts.map +1 -0
- package/dist/{git-utils.js → git/utils.js} +2 -2
- package/dist/git/utils.js.map +1 -0
- package/dist/git.d.ts +5 -5
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +10 -10
- package/dist/git.js.map +1 -1
- package/dist/guard-engine.d.ts +3 -2
- package/dist/guard-engine.d.ts.map +1 -1
- package/dist/guard-engine.js +2 -2
- package/dist/guard-engine.js.map +1 -1
- package/dist/install-probe-tick.d.ts +63 -0
- package/dist/install-probe-tick.d.ts.map +1 -0
- package/dist/install-probe-tick.js +137 -0
- package/dist/install-probe-tick.js.map +1 -0
- package/dist/install-probe.d.ts +115 -0
- package/dist/install-probe.d.ts.map +1 -0
- package/dist/install-probe.js +197 -0
- package/dist/install-probe.js.map +1 -0
- package/dist/listener-auto-advance.d.ts.map +1 -1
- package/dist/listener-auto-advance.js +31 -0
- package/dist/listener-auto-advance.js.map +1 -1
- package/dist/listener.js +5 -5
- package/dist/listener.js.map +1 -1
- package/dist/{loop-context-audit-pass.d.ts → loops/context-audit-pass.d.ts} +4 -4
- package/dist/loops/context-audit-pass.d.ts.map +1 -0
- package/dist/{loop-context-audit-pass.js → loops/context-audit-pass.js} +7 -7
- package/dist/loops/context-audit-pass.js.map +1 -0
- package/dist/{loop-engine-types.d.ts → loops/engine-types.d.ts} +1 -1
- package/dist/loops/engine-types.d.ts.map +1 -0
- package/dist/{loop-engine-types.js → loops/engine-types.js} +1 -1
- package/dist/loops/engine-types.js.map +1 -0
- package/dist/{loop-engine.d.ts → loops/engine.d.ts} +6 -6
- package/dist/loops/engine.d.ts.map +1 -0
- package/dist/{loop-engine.js → loops/engine.js} +13 -13
- package/dist/loops/engine.js.map +1 -0
- package/dist/{loop-event-bus.d.ts → loops/event-bus.d.ts} +1 -1
- package/dist/loops/event-bus.d.ts.map +1 -0
- package/dist/{loop-event-bus.js → loops/event-bus.js} +1 -1
- package/dist/loops/event-bus.js.map +1 -0
- package/dist/loops/index.d.ts +33 -0
- package/dist/loops/index.d.ts.map +1 -0
- package/dist/loops/index.js +32 -0
- package/dist/loops/index.js.map +1 -0
- package/dist/{loop-llm-client.d.ts → loops/llm-client.d.ts} +3 -3
- package/dist/loops/llm-client.d.ts.map +1 -0
- package/dist/{loop-llm-client.js → loops/llm-client.js} +3 -3
- package/dist/loops/llm-client.js.map +1 -0
- package/dist/{loop-llm-flag.d.ts → loops/llm-flag.d.ts} +1 -1
- package/dist/loops/llm-flag.d.ts.map +1 -0
- package/dist/{loop-llm-flag.js → loops/llm-flag.js} +1 -1
- package/dist/loops/llm-flag.js.map +1 -0
- package/dist/{loop-operational-block.d.ts → loops/operational-block.d.ts} +1 -1
- package/dist/loops/operational-block.d.ts.map +1 -0
- package/dist/{loop-operational-block.js → loops/operational-block.js} +1 -1
- package/dist/loops/operational-block.js.map +1 -0
- package/dist/{loop-prompt-builder.d.ts → loops/prompt-builder.d.ts} +2 -2
- package/dist/loops/prompt-builder.d.ts.map +1 -0
- package/dist/{loop-prompt-builder.js → loops/prompt-builder.js} +1 -1
- package/dist/loops/prompt-builder.js.map +1 -0
- package/dist/{loop-variance.d.ts → loops/variance.d.ts} +1 -1
- package/dist/loops/variance.d.ts.map +1 -0
- package/dist/{loop-variance.js → loops/variance.js} +1 -1
- package/dist/loops/variance.js.map +1 -0
- package/dist/merge-back-loop.d.ts.map +1 -1
- package/dist/merge-back-loop.js +4 -3
- package/dist/merge-back-loop.js.map +1 -1
- package/dist/merge-detector.js +2 -2
- package/dist/merge-detector.js.map +1 -1
- package/dist/{nexus-endpoint-clearance.d.ts → nexus/endpoint-clearance.d.ts} +2 -2
- package/dist/nexus/endpoint-clearance.d.ts.map +1 -0
- package/dist/{nexus-endpoint-clearance.js → nexus/endpoint-clearance.js} +2 -2
- package/dist/nexus/endpoint-clearance.js.map +1 -0
- package/dist/{nexus-escalation-bridge.d.ts → nexus/escalation-bridge.d.ts} +1 -1
- package/dist/nexus/escalation-bridge.d.ts.map +1 -0
- package/dist/{nexus-escalation-bridge.js → nexus/escalation-bridge.js} +2 -2
- package/dist/nexus/escalation-bridge.js.map +1 -0
- package/dist/{nexus-incoming.d.ts → nexus/incoming.d.ts} +2 -2
- package/dist/nexus/incoming.d.ts.map +1 -0
- package/dist/{nexus-incoming.js → nexus/incoming.js} +2 -2
- package/dist/nexus/incoming.js.map +1 -0
- package/dist/nexus/index.d.ts +20 -0
- package/dist/nexus/index.d.ts.map +1 -0
- package/dist/nexus/index.js +20 -0
- package/dist/nexus/index.js.map +1 -0
- package/dist/{nexus-intake-spawn.d.ts → nexus/intake-spawn.d.ts} +3 -3
- package/dist/nexus/intake-spawn.d.ts.map +1 -0
- package/dist/{nexus-intake-spawn.js → nexus/intake-spawn.js} +1 -1
- package/dist/nexus/intake-spawn.js.map +1 -0
- package/dist/{nexus-intake.d.ts → nexus/intake.d.ts} +2 -2
- package/dist/nexus/intake.d.ts.map +1 -0
- package/dist/{nexus-intake.js → nexus/intake.js} +4 -4
- package/dist/nexus/intake.js.map +1 -0
- package/dist/{nexus-return.d.ts → nexus/return.d.ts} +3 -3
- package/dist/nexus/return.d.ts.map +1 -0
- package/dist/{nexus-return.js → nexus/return.js} +4 -4
- package/dist/nexus/return.js.map +1 -0
- package/dist/otlp/index.d.ts +19 -0
- package/dist/otlp/index.d.ts.map +1 -0
- package/dist/otlp/index.js +19 -0
- package/dist/otlp/index.js.map +1 -0
- package/dist/{otlp-log-parser.d.ts → otlp/log-parser.d.ts} +2 -2
- package/dist/otlp/log-parser.d.ts.map +1 -0
- package/dist/{otlp-log-parser.js → otlp/log-parser.js} +5 -6
- package/dist/otlp/log-parser.js.map +1 -0
- package/dist/{otlp-metric-parser.d.ts → otlp/metric-parser.d.ts} +2 -2
- package/dist/otlp/metric-parser.d.ts.map +1 -0
- package/dist/{otlp-metric-parser.js → otlp/metric-parser.js} +4 -5
- package/dist/otlp/metric-parser.js.map +1 -0
- package/dist/{otlp-port-manager.d.ts → otlp/port-manager.d.ts} +1 -1
- package/dist/otlp/port-manager.d.ts.map +1 -0
- package/dist/{otlp-port-manager.js → otlp/port-manager.js} +1 -1
- package/dist/otlp/port-manager.js.map +1 -0
- package/dist/{otlp-receiver.d.ts → otlp/receiver.d.ts} +2 -2
- package/dist/otlp/receiver.d.ts.map +1 -0
- package/dist/{otlp-receiver.js → otlp/receiver.js} +5 -33
- package/dist/otlp/receiver.js.map +1 -0
- package/dist/{otlp-types.d.ts → otlp/types.d.ts} +1 -9
- package/dist/otlp/types.d.ts.map +1 -0
- package/dist/{otlp-types.js → otlp/types.js} +1 -27
- package/dist/otlp/types.js.map +1 -0
- package/dist/pipeline-config.d.ts +1 -1
- package/dist/{prd-controller.d.ts → prd/controller.d.ts} +7 -7
- package/dist/prd/controller.d.ts.map +1 -0
- package/dist/{prd-controller.js → prd/controller.js} +11 -11
- package/dist/prd/controller.js.map +1 -0
- package/dist/{prd-divergence.d.ts → prd/divergence.d.ts} +2 -2
- package/dist/prd/divergence.d.ts.map +1 -0
- package/dist/{prd-divergence.js → prd/divergence.js} +1 -1
- package/dist/prd/divergence.js.map +1 -0
- package/dist/{prd-focus-pushdown.d.ts → prd/focus-pushdown.d.ts} +2 -2
- package/dist/prd/focus-pushdown.d.ts.map +1 -0
- package/dist/{prd-focus-pushdown.js → prd/focus-pushdown.js} +3 -3
- package/dist/prd/focus-pushdown.js.map +1 -0
- package/dist/{prd-frontier.d.ts → prd/frontier.d.ts} +2 -2
- package/dist/prd/frontier.d.ts.map +1 -0
- package/dist/{prd-frontier.js → prd/frontier.js} +1 -1
- package/dist/prd/frontier.js.map +1 -0
- package/dist/prd/index.d.ts +26 -0
- package/dist/prd/index.d.ts.map +1 -0
- package/dist/prd/index.js +25 -0
- package/dist/prd/index.js.map +1 -0
- package/dist/{prd-steward.d.ts → prd/steward.d.ts} +4 -4
- package/dist/prd/steward.d.ts.map +1 -0
- package/dist/{prd-steward.js → prd/steward.js} +4 -4
- package/dist/prd/steward.js.map +1 -0
- package/dist/{prd-viability.d.ts → prd/viability.d.ts} +2 -2
- package/dist/prd/viability.d.ts.map +1 -0
- package/dist/{prd-viability.js → prd/viability.js} +1 -1
- package/dist/prd/viability.js.map +1 -0
- package/dist/product-scaffold.js +2 -2
- package/dist/product-scaffold.js.map +1 -1
- package/dist/prompt-sections/persona-sections.d.ts +12 -0
- package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
- package/dist/prompt-sections/persona-sections.js +29 -2
- package/dist/prompt-sections/persona-sections.js.map +1 -1
- package/dist/queries/context-lock-queries.js +1 -1
- package/dist/queries/context-lock-queries.js.map +1 -1
- package/dist/queries/deliveries.d.ts +15 -0
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +2 -0
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/focuses.d.ts +17 -0
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +27 -0
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/schemas.d.ts +4 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +8 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/reality-pole.js +1 -1
- package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
- package/dist/resolvers/git-diff-against-base.js +4 -1
- package/dist/resolvers/git-diff-against-base.js.map +1 -1
- package/dist/resolvers/prd-context.js +1 -1
- package/dist/sensor-sweep.js +1 -1
- package/dist/spawn/model-routing.d.ts +277 -0
- package/dist/spawn/model-routing.d.ts.map +1 -0
- package/dist/spawn/model-routing.js +464 -0
- package/dist/spawn/model-routing.js.map +1 -0
- package/dist/spawn/process-spawn.d.ts +128 -0
- package/dist/spawn/process-spawn.d.ts.map +1 -0
- package/dist/spawn/process-spawn.js +378 -0
- package/dist/spawn/process-spawn.js.map +1 -0
- package/dist/spawn/prompt-assembly.d.ts +143 -0
- package/dist/spawn/prompt-assembly.d.ts.map +1 -0
- package/dist/spawn/prompt-assembly.js +263 -0
- package/dist/spawn/prompt-assembly.js.map +1 -0
- package/dist/spawn/shared.d.ts +72 -0
- package/dist/spawn/shared.d.ts.map +1 -0
- package/dist/spawn/shared.js +14 -0
- package/dist/spawn/shared.js.map +1 -0
- package/dist/spawn/spawn-decision.d.ts +189 -0
- package/dist/spawn/spawn-decision.d.ts.map +1 -0
- package/dist/spawn/spawn-decision.js +361 -0
- package/dist/spawn/spawn-decision.js.map +1 -0
- package/dist/spawn/worktree-session.d.ts +105 -0
- package/dist/spawn/worktree-session.d.ts.map +1 -0
- package/dist/spawn/worktree-session.js +216 -0
- package/dist/spawn/worktree-session.js.map +1 -0
- package/dist/spawner/lifecycle.js +2 -2
- package/dist/spawner/lifecycle.js.map +1 -1
- package/dist/spawner/resolution.js +1 -1
- package/dist/stall-detector-config.d.ts +4 -0
- package/dist/stall-detector-config.d.ts.map +1 -1
- package/dist/stall-detector-config.js +6 -0
- package/dist/stall-detector-config.js.map +1 -1
- package/dist/state-cascade.js +1 -1
- package/dist/state-cascade.js.map +1 -1
- package/dist/trigger-executor.d.ts +5 -9
- package/dist/trigger-executor.d.ts.map +1 -1
- package/dist/trigger-executor.js +14 -36
- package/dist/trigger-executor.js.map +1 -1
- package/dist/types/focus.d.ts +13 -0
- package/dist/types/focus.d.ts.map +1 -1
- package/dist/types/workflow.d.ts +1 -3
- package/dist/types/workflow.d.ts.map +1 -1
- package/dist/unified-engine-lifecycle.js +1 -1
- package/dist/unified-init.d.ts +3 -3
- package/dist/unified-init.d.ts.map +1 -1
- package/dist/unified-init.js +9 -25
- package/dist/unified-init.js.map +1 -1
- package/dist/unified-shell.d.ts +3 -3
- package/dist/unified-shell.js +4 -4
- package/dist/unified-shell.js.map +1 -1
- package/dist/verification-engine.d.ts.map +1 -1
- package/dist/verification-engine.js +15 -0
- package/dist/verification-engine.js.map +1 -1
- package/dist/{worktree-focus.d.ts → worktree/focus.d.ts} +2 -2
- package/dist/worktree/focus.d.ts.map +1 -0
- package/dist/{worktree-focus.js → worktree/focus.js} +7 -7
- package/dist/worktree/focus.js.map +1 -0
- package/dist/worktree/index.d.ts +16 -0
- package/dist/worktree/index.d.ts.map +1 -0
- package/dist/worktree/index.js +16 -0
- package/dist/worktree/index.js.map +1 -0
- package/dist/{worktree-safety.d.ts → worktree/safety.d.ts} +1 -1
- package/dist/worktree/safety.d.ts.map +1 -0
- package/dist/{worktree-safety.js → worktree/safety.js} +2 -2
- package/dist/worktree/safety.js.map +1 -0
- package/dist/{worktree-state.d.ts → worktree/state.d.ts} +1 -1
- package/dist/worktree/state.d.ts.map +1 -0
- package/dist/{worktree-state.js → worktree/state.js} +6 -6
- package/dist/worktree/state.js.map +1 -0
- package/dist/worktree.d.ts +1 -1
- package/dist/worktree.js +5 -5
- package/dist/worktree.js.map +1 -1
- package/package.json +5 -4
- package/dist/git-activity.d.ts.map +0 -1
- package/dist/git-activity.js.map +0 -1
- package/dist/git-branch.d.ts.map +0 -1
- package/dist/git-branch.js.map +0 -1
- package/dist/git-fetch.d.ts.map +0 -1
- package/dist/git-fetch.js.map +0 -1
- package/dist/git-genesis.d.ts.map +0 -1
- package/dist/git-genesis.js.map +0 -1
- package/dist/git-integration.d.ts.map +0 -1
- package/dist/git-integration.js.map +0 -1
- package/dist/git-merge-helpers.d.ts.map +0 -1
- package/dist/git-merge-helpers.js.map +0 -1
- package/dist/git-merge-lock.d.ts.map +0 -1
- package/dist/git-merge-lock.js.map +0 -1
- package/dist/git-merge-strategies.d.ts.map +0 -1
- package/dist/git-merge-strategies.js.map +0 -1
- package/dist/git-merge.d.ts.map +0 -1
- package/dist/git-merge.js.map +0 -1
- package/dist/git-state-detector.d.ts.map +0 -1
- package/dist/git-state-detector.js.map +0 -1
- package/dist/git-types.d.ts.map +0 -1
- package/dist/git-types.js.map +0 -1
- package/dist/git-utils.d.ts.map +0 -1
- package/dist/git-utils.js.map +0 -1
- package/dist/loop-context-audit-pass.d.ts.map +0 -1
- package/dist/loop-context-audit-pass.js.map +0 -1
- package/dist/loop-engine-types.d.ts.map +0 -1
- package/dist/loop-engine-types.js.map +0 -1
- package/dist/loop-engine.d.ts.map +0 -1
- package/dist/loop-engine.js.map +0 -1
- package/dist/loop-event-bus.d.ts.map +0 -1
- package/dist/loop-event-bus.js.map +0 -1
- package/dist/loop-llm-client.d.ts.map +0 -1
- package/dist/loop-llm-client.js.map +0 -1
- package/dist/loop-llm-flag.d.ts.map +0 -1
- package/dist/loop-llm-flag.js.map +0 -1
- package/dist/loop-operational-block.d.ts.map +0 -1
- package/dist/loop-operational-block.js.map +0 -1
- package/dist/loop-prompt-builder.d.ts.map +0 -1
- package/dist/loop-prompt-builder.js.map +0 -1
- package/dist/loop-variance.d.ts.map +0 -1
- package/dist/loop-variance.js.map +0 -1
- package/dist/nexus-endpoint-clearance.d.ts.map +0 -1
- package/dist/nexus-endpoint-clearance.js.map +0 -1
- package/dist/nexus-escalation-bridge.d.ts.map +0 -1
- package/dist/nexus-escalation-bridge.js.map +0 -1
- package/dist/nexus-incoming.d.ts.map +0 -1
- package/dist/nexus-incoming.js.map +0 -1
- package/dist/nexus-intake-spawn.d.ts.map +0 -1
- package/dist/nexus-intake-spawn.js.map +0 -1
- package/dist/nexus-intake.d.ts.map +0 -1
- package/dist/nexus-intake.js.map +0 -1
- package/dist/nexus-return.d.ts.map +0 -1
- package/dist/nexus-return.js.map +0 -1
- package/dist/otlp-log-parser.d.ts.map +0 -1
- package/dist/otlp-log-parser.js.map +0 -1
- package/dist/otlp-metric-parser.d.ts.map +0 -1
- package/dist/otlp-metric-parser.js.map +0 -1
- package/dist/otlp-port-manager.d.ts.map +0 -1
- package/dist/otlp-port-manager.js.map +0 -1
- package/dist/otlp-receiver.d.ts.map +0 -1
- package/dist/otlp-receiver.js.map +0 -1
- package/dist/otlp-types.d.ts.map +0 -1
- package/dist/otlp-types.js.map +0 -1
- package/dist/prd-controller.d.ts.map +0 -1
- package/dist/prd-controller.js.map +0 -1
- package/dist/prd-divergence.d.ts.map +0 -1
- package/dist/prd-divergence.js.map +0 -1
- package/dist/prd-focus-pushdown.d.ts.map +0 -1
- package/dist/prd-focus-pushdown.js.map +0 -1
- package/dist/prd-frontier.d.ts.map +0 -1
- package/dist/prd-frontier.js.map +0 -1
- package/dist/prd-steward.d.ts.map +0 -1
- package/dist/prd-steward.js.map +0 -1
- package/dist/prd-viability.d.ts.map +0 -1
- package/dist/prd-viability.js.map +0 -1
- package/dist/worktree-focus.d.ts.map +0 -1
- package/dist/worktree-focus.js.map +0 -1
- package/dist/worktree-safety.d.ts.map +0 -1
- package/dist/worktree-safety.js.map +0 -1
- package/dist/worktree-state.d.ts.map +0 -1
- package/dist/worktree-state.js.map +0 -1
package/dist/cli/connect.js
CHANGED
|
@@ -18,10 +18,14 @@ import { homedir } from 'node:os';
|
|
|
18
18
|
import { isLegacyMcpConfigShape, resolveMcpServerPath, writeMcpConfigFile, } from '../mcp-resolution.js';
|
|
19
19
|
import { ensureGlobalStateDir, resolveDaemonLogPath } from '../daemon-process.js';
|
|
20
20
|
import { STARTER_PROMPT } from '../prompts/starter-prompt.js';
|
|
21
|
-
import { TELORA_CLAUDE_MD_BEGIN, TELORA_CLAUDE_MD_END, renderClaudeMd, SEED_BODY, SEED_MCP_REGISTRATION_SENTENCE, } from '../templates/claude-md.js';
|
|
22
|
-
import { TELORA_AGENTS_MD_BEGIN, TELORA_AGENTS_MD_END, renderAgentsMd, } from '../templates/agents-md.js';
|
|
23
|
-
import { buildClaudeSettings, mergeClaudeSettings, } from '../templates/claude-settings.js';
|
|
24
21
|
import { writeProductCodexHome, renderManualCodexProfile, } from './codex-provision.js';
|
|
22
|
+
import { harnessGitignoreEntries, writeHarnessScaffolding, } from './connect/scaffolding.js';
|
|
23
|
+
export { writeOrMergeClaudeMd, writeOrMergeClaudeSettings } from './connect/claude.js';
|
|
24
|
+
export { writeOrMergeAgentsMd } from './connect/agents.js';
|
|
25
|
+
export { renderCodexMcpBlock, writeOrMergeCodexMcpToml } from './connect/codex.js';
|
|
26
|
+
export { renderClineRules, writeClineProjectRules, renderClineMcpSettings, writeOrMergeClineMcpSettings, } from './connect/cline.js';
|
|
27
|
+
export { DEFAULT_IDE_HARNESS_PRELOAD, IDE_MCP_REGISTRATION_SENTENCE, IDE_MCP_CONFIG_PATH, renderIdeMcpConfig, writeIdeMcpConfig, writeIdeHarnessScaffolding, } from './connect/ide.js';
|
|
28
|
+
export { harnessGitignoreEntries, writeHarnessScaffolding } from './connect/scaffolding.js';
|
|
25
29
|
/**
|
|
26
30
|
* Production Telora API URL embedded in the published @telora/daemon package.
|
|
27
31
|
* Override with TELORA_URL for local dev.
|
|
@@ -60,17 +64,6 @@ export const OPERATOR_HARNESSES = [
|
|
|
60
64
|
export function isOperatorHarness(value) {
|
|
61
65
|
return OPERATOR_HARNESSES.includes(value);
|
|
62
66
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Default `TELORA_MCP_PRELOAD` for the IDE harnesses (cursor / vscode).
|
|
65
|
-
*
|
|
66
|
-
* Static-surface clients ignore `tools/list_changed`, so `telora_discover`
|
|
67
|
-
* lazy-loading never becomes callable mid-session -- they need the domains
|
|
68
|
-
* they will actually use registered at startup. This modest set (escalations,
|
|
69
|
-
* wiki, reality-tree planning) covers inspection + light-operator work while
|
|
70
|
-
* keeping the active tool surface under the ~40-tool ceiling those clients
|
|
71
|
-
* impose. Operators can widen it by editing the generated MCP config.
|
|
72
|
-
*/
|
|
73
|
-
export const DEFAULT_IDE_HARNESS_PRELOAD = 'agent,wiki,reality_trees';
|
|
74
67
|
/**
|
|
75
68
|
* Map a redeem error code to a one-line remediation hint.
|
|
76
69
|
*/
|
|
@@ -209,10 +202,9 @@ export function writeConnectDaemonConfig(params) {
|
|
|
209
202
|
integrationBranch: 'integration',
|
|
210
203
|
maxTotalSessions: 5,
|
|
211
204
|
},
|
|
212
|
-
factory
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
},
|
|
205
|
+
// The factory engine is retired. Newly generated configs carry only the
|
|
206
|
+
// focus engine; a legacy `engines.factory` block in an existing config is
|
|
207
|
+
// still tolerated (ignored, force-disabled) on load by unified-shell.
|
|
216
208
|
},
|
|
217
209
|
};
|
|
218
210
|
writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', { mode: 0o600 });
|
|
@@ -405,482 +397,6 @@ export function findExistingProductForRepo(repoPath) {
|
|
|
405
397
|
}
|
|
406
398
|
return null;
|
|
407
399
|
}
|
|
408
|
-
/**
|
|
409
|
-
* Write or merge a seeded `CLAUDE.md` at the repo root.
|
|
410
|
-
*
|
|
411
|
-
* - Fresh repo: writes the seeded block straight in.
|
|
412
|
-
* - Existing CLAUDE.md without the Telora delimiters: appends a delimited
|
|
413
|
-
* Telora block at the end. The user's content is untouched.
|
|
414
|
-
* - Existing CLAUDE.md WITH the delimiters: replaces only the delimited
|
|
415
|
-
* block. Re-runs are byte-identical (no churn, no duplication).
|
|
416
|
-
*
|
|
417
|
-
* Idempotent at the filesystem level: when the computed content equals what
|
|
418
|
-
* is already on disk, NO write occurs (no spurious mtime bump, no git churn).
|
|
419
|
-
* The daemon re-invokes this on every boot to self-heal the seed block, so
|
|
420
|
-
* the unchanged-common-case must not touch the file.
|
|
421
|
-
*/
|
|
422
|
-
export function writeOrMergeClaudeMd(repoPath, productName, io) {
|
|
423
|
-
const path = resolve(repoPath, 'CLAUDE.md');
|
|
424
|
-
const seedBlock = renderClaudeMd(productName);
|
|
425
|
-
if (!existsSync(path)) {
|
|
426
|
-
writeFileSync(path, seedBlock);
|
|
427
|
-
io.out(`Wrote ${path}.\n`);
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
const existing = readFileSync(path, 'utf-8');
|
|
431
|
-
const beginIdx = existing.indexOf(TELORA_CLAUDE_MD_BEGIN);
|
|
432
|
-
let newContent;
|
|
433
|
-
let message;
|
|
434
|
-
if (beginIdx === -1) {
|
|
435
|
-
// No prior Telora block -- append, preserving user content.
|
|
436
|
-
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
437
|
-
newContent = existing + sep + seedBlock;
|
|
438
|
-
message = `Appended Telora seed block to ${path}.\n`;
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
const endIdx = existing.indexOf(TELORA_CLAUDE_MD_END, beginIdx);
|
|
442
|
-
if (endIdx === -1) {
|
|
443
|
-
// Begin marker without end -- treat as malformed. Append a fresh block
|
|
444
|
-
// rather than risk corrupting whatever's there.
|
|
445
|
-
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
446
|
-
newContent = existing + sep + seedBlock;
|
|
447
|
-
message = `Appended Telora seed block to ${path} (prior block was malformed).\n`;
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
// Replace the existing Telora block in place.
|
|
451
|
-
const after = endIdx + TELORA_CLAUDE_MD_END.length;
|
|
452
|
-
// Trim a trailing newline after the end marker so we don't accumulate
|
|
453
|
-
// blank lines on each re-run.
|
|
454
|
-
const trailingNewline = existing[after] === '\n' ? 1 : 0;
|
|
455
|
-
newContent =
|
|
456
|
-
existing.slice(0, beginIdx) +
|
|
457
|
-
seedBlock.trimEnd() +
|
|
458
|
-
'\n' +
|
|
459
|
-
existing.slice(after + trailingNewline);
|
|
460
|
-
message = `Refreshed Telora seed block in ${path}.\n`;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
// Idempotency guard: skip the write entirely when nothing would change.
|
|
464
|
-
// This keeps the boot-time self-heal a no-op for already-current repos.
|
|
465
|
-
if (newContent === existing)
|
|
466
|
-
return;
|
|
467
|
-
writeFileSync(path, newContent);
|
|
468
|
-
io.out(message);
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Write or merge a seeded `AGENTS.md` at the repo root (Codex harness).
|
|
472
|
-
*
|
|
473
|
-
* The exact analog of `writeOrMergeClaudeMd` for the Codex operator surface:
|
|
474
|
-
* AGENTS.md is Codex's CLAUDE.md-equivalent. Same merge semantics --
|
|
475
|
-
* - Fresh repo: writes the seeded block straight in.
|
|
476
|
-
* - Existing AGENTS.md without the Telora delimiters: appends a delimited
|
|
477
|
-
* block at the end; user content untouched.
|
|
478
|
-
* - Existing AGENTS.md WITH the delimiters: replaces only the delimited block.
|
|
479
|
-
*
|
|
480
|
-
* Idempotent at the filesystem level: when the computed content equals what is
|
|
481
|
-
* already on disk, NO write occurs (no spurious mtime bump, no git churn). The
|
|
482
|
-
* daemon re-invokes this on boot to self-heal the seed block, so the
|
|
483
|
-
* unchanged-common-case must not touch the file.
|
|
484
|
-
*/
|
|
485
|
-
export function writeOrMergeAgentsMd(repoPath, inv, io) {
|
|
486
|
-
const path = resolve(repoPath, 'AGENTS.md');
|
|
487
|
-
const seedBlock = renderAgentsMd(inv);
|
|
488
|
-
if (!existsSync(path)) {
|
|
489
|
-
writeFileSync(path, seedBlock);
|
|
490
|
-
io.out(`Wrote ${path}.\n`);
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
const existing = readFileSync(path, 'utf-8');
|
|
494
|
-
const beginIdx = existing.indexOf(TELORA_AGENTS_MD_BEGIN);
|
|
495
|
-
let newContent;
|
|
496
|
-
let message;
|
|
497
|
-
if (beginIdx === -1) {
|
|
498
|
-
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
499
|
-
newContent = existing + sep + seedBlock;
|
|
500
|
-
message = `Appended Telora seed block to ${path}.\n`;
|
|
501
|
-
}
|
|
502
|
-
else {
|
|
503
|
-
const endIdx = existing.indexOf(TELORA_AGENTS_MD_END, beginIdx);
|
|
504
|
-
if (endIdx === -1) {
|
|
505
|
-
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
506
|
-
newContent = existing + sep + seedBlock;
|
|
507
|
-
message = `Appended Telora seed block to ${path} (prior block was malformed).\n`;
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
const after = endIdx + TELORA_AGENTS_MD_END.length;
|
|
511
|
-
const trailingNewline = existing[after] === '\n' ? 1 : 0;
|
|
512
|
-
newContent =
|
|
513
|
-
existing.slice(0, beginIdx) +
|
|
514
|
-
seedBlock.trimEnd() +
|
|
515
|
-
'\n' +
|
|
516
|
-
existing.slice(after + trailingNewline);
|
|
517
|
-
message = `Refreshed Telora seed block in ${path}.\n`;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
// Idempotency guard: skip the write entirely when nothing would change.
|
|
521
|
-
if (newContent === existing)
|
|
522
|
-
return;
|
|
523
|
-
writeFileSync(path, newContent);
|
|
524
|
-
io.out(message);
|
|
525
|
-
}
|
|
526
|
-
// Delimiter comments wrapping the Telora MCP block in the operator's
|
|
527
|
-
// ~/.codex/config.toml. TOML comments start with '#', so these are inert to
|
|
528
|
-
// the parser yet let us replace exactly our block on re-runs.
|
|
529
|
-
const TELORA_CODEX_MCP_BEGIN = '# BEGIN TELORA MCP';
|
|
530
|
-
const TELORA_CODEX_MCP_END = '# END TELORA MCP';
|
|
531
|
-
/**
|
|
532
|
-
* Render the delimited Telora MCP block for the operator's personal
|
|
533
|
-
* `~/.codex/config.toml`. Mirrors the `.mcp.json` shape (command=node + the
|
|
534
|
-
* resolved abs path to @telora/mcp-products) but as a TOML `[mcp_servers.telora]`
|
|
535
|
-
* table, the form Codex reads. Profile is `human` (operator-interactive),
|
|
536
|
-
* matching the `.mcp.json` the Claude path writes.
|
|
537
|
-
*
|
|
538
|
-
* Carries the MCP profile ONLY -- never workstation identity. Identity
|
|
539
|
-
* (`TELORA_URL` / `TELORA_TRACKER_ID`) resolves from the single source
|
|
540
|
-
* `~/.telora/daemon.json` via the MCP server's `loadCredentials()` fallback,
|
|
541
|
-
* so a persisted copy here would only be a drift hazard. Keeping it out is the
|
|
542
|
-
* single-source invariant (the `.mcp.json` builder omits it for the same
|
|
543
|
-
* reason).
|
|
544
|
-
*
|
|
545
|
-
* Values are emitted as JSON-encoded TOML string literals, which is valid TOML
|
|
546
|
-
* for the path value we control here.
|
|
547
|
-
*/
|
|
548
|
-
export function renderCodexMcpBlock(params) {
|
|
549
|
-
const lines = [
|
|
550
|
-
TELORA_CODEX_MCP_BEGIN,
|
|
551
|
-
`[mcp_servers.telora]`,
|
|
552
|
-
`command = "node"`,
|
|
553
|
-
`args = [${JSON.stringify(params.mcpServerPath)}]`,
|
|
554
|
-
`[mcp_servers.telora.env]`,
|
|
555
|
-
`TELORA_MCP_PROFILE = "human"`,
|
|
556
|
-
TELORA_CODEX_MCP_END,
|
|
557
|
-
];
|
|
558
|
-
return lines.join('\n') + '\n';
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* Register the Telora MCP server in the operator's personal
|
|
562
|
-
* `~/.codex/config.toml` (NOT the per-product execution CODEX_HOME -- that is
|
|
563
|
-
* `codex-provision.ts`, a separate concern). This is what makes the Telora
|
|
564
|
-
* tool surface reachable from the operator's interactive Codex chat.
|
|
565
|
-
*
|
|
566
|
-
* Idempotent delimited merge, mirroring `writeOrMergeClaudeMd`: replace the
|
|
567
|
-
* `# BEGIN/END TELORA MCP` block in place if present, append it if absent,
|
|
568
|
-
* never duplicate. When the computed content equals what is on disk, NO write
|
|
569
|
-
* occurs. `homeOverride` lets tests target a temp HOME.
|
|
570
|
-
*
|
|
571
|
-
* Best-effort: if the MCP package cannot be resolved, prints a warning and
|
|
572
|
-
* returns without touching the file (the connect flow must not abort).
|
|
573
|
-
*/
|
|
574
|
-
export function writeOrMergeCodexMcpToml(io, params = {}) {
|
|
575
|
-
let mcpServerPath;
|
|
576
|
-
try {
|
|
577
|
-
mcpServerPath = resolveMcpServerPath();
|
|
578
|
-
}
|
|
579
|
-
catch (err) {
|
|
580
|
-
io.err(`Warning: could not resolve @telora/mcp-products; skipping Codex MCP registration: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
const home = params.homeOverride ?? homedir();
|
|
584
|
-
const dir = resolve(home, '.codex');
|
|
585
|
-
const path = resolve(dir, 'config.toml');
|
|
586
|
-
const block = renderCodexMcpBlock({ mcpServerPath });
|
|
587
|
-
if (!existsSync(dir))
|
|
588
|
-
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
589
|
-
if (!existsSync(path)) {
|
|
590
|
-
writeFileSync(path, block, { mode: 0o600 });
|
|
591
|
-
io.out(`Wrote ${path}.\n`);
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
const existing = readFileSync(path, 'utf-8');
|
|
595
|
-
const beginIdx = existing.indexOf(TELORA_CODEX_MCP_BEGIN);
|
|
596
|
-
let newContent;
|
|
597
|
-
let message;
|
|
598
|
-
if (beginIdx === -1) {
|
|
599
|
-
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
600
|
-
newContent = existing.trimEnd().length === 0 ? block : existing + sep + block;
|
|
601
|
-
message = `Registered Telora MCP server in ${path}.\n`;
|
|
602
|
-
}
|
|
603
|
-
else {
|
|
604
|
-
const endIdx = existing.indexOf(TELORA_CODEX_MCP_END, beginIdx);
|
|
605
|
-
if (endIdx === -1) {
|
|
606
|
-
const sep = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
607
|
-
newContent = existing + sep + block;
|
|
608
|
-
message = `Registered Telora MCP server in ${path} (prior block was malformed).\n`;
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
const after = endIdx + TELORA_CODEX_MCP_END.length;
|
|
612
|
-
const trailingNewline = existing[after] === '\n' ? 1 : 0;
|
|
613
|
-
newContent =
|
|
614
|
-
existing.slice(0, beginIdx) +
|
|
615
|
-
block.trimEnd() +
|
|
616
|
-
'\n' +
|
|
617
|
-
existing.slice(after + trailingNewline);
|
|
618
|
-
message = `Refreshed Telora MCP server registration in ${path}.\n`;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
// Idempotency guard: skip the write when nothing would change.
|
|
622
|
-
if (newContent === existing)
|
|
623
|
-
return;
|
|
624
|
-
writeFileSync(path, newContent, { mode: 0o600 });
|
|
625
|
-
io.out(message);
|
|
626
|
-
}
|
|
627
|
-
const CLINE_MCP_REGISTRATION_SENTENCE = 'The Telora MCP server is registered in `~/.cline/data/settings/cline_mcp_settings.json`.';
|
|
628
|
-
/**
|
|
629
|
-
* Render a project-level Cline rules file carrying the same Telora seed
|
|
630
|
-
* discipline as CLAUDE.md / AGENTS.md. Cline CLI reads project rules from
|
|
631
|
-
* `.cline/rules/`, so this is the operator-facing context equivalent for the
|
|
632
|
-
* Cline harness.
|
|
633
|
-
*/
|
|
634
|
-
export function renderClineRules(inv) {
|
|
635
|
-
const productLabel = inv.productName ? `${inv.productName} (${inv.productId})` : inv.productId;
|
|
636
|
-
const body = SEED_BODY.replace(SEED_MCP_REGISTRATION_SENTENCE, CLINE_MCP_REGISTRATION_SENTENCE);
|
|
637
|
-
return (`# Telora Workstation\n\n` +
|
|
638
|
-
`This workstation is connected to Telora. The connection invariant is recorded here for Cline CLI sessions:\n\n` +
|
|
639
|
-
`- Telora URL: ${inv.teloraUrl}\n` +
|
|
640
|
-
`- Organization: ${inv.organizationId}\n` +
|
|
641
|
-
`- Product: ${productLabel}\n\n` +
|
|
642
|
-
body);
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Write the Telora Cline project rules file. The file is owned by the connect
|
|
646
|
-
* flow, so re-runs replace it wholesale; user-authored Cline rules live beside
|
|
647
|
-
* it under `.cline/rules/`.
|
|
648
|
-
*/
|
|
649
|
-
export function writeClineProjectRules(repoPath, inv, io) {
|
|
650
|
-
const dir = resolve(repoPath, '.cline', 'rules');
|
|
651
|
-
const path = resolve(dir, 'telora.md');
|
|
652
|
-
const content = renderClineRules(inv);
|
|
653
|
-
if (!existsSync(dir))
|
|
654
|
-
mkdirSync(dir, { recursive: true });
|
|
655
|
-
if (existsSync(path) && readFileSync(path, 'utf-8') === content)
|
|
656
|
-
return;
|
|
657
|
-
writeFileSync(path, content);
|
|
658
|
-
io.out(`Wrote ${path}.\n`);
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Render the Cline CLI MCP config object. Current Cline CLI documentation
|
|
662
|
-
* stores MCP settings under `~/.cline/data/settings/cline_mcp_settings.json`
|
|
663
|
-
* with a top-level `mcpServers` map.
|
|
664
|
-
*
|
|
665
|
-
* Carries the MCP profile ONLY -- never workstation identity. Like the
|
|
666
|
-
* `.mcp.json` and Codex builders, identity (`TELORA_URL` / `TELORA_TRACKER_ID`)
|
|
667
|
-
* resolves from the single source `~/.telora/daemon.json` via the MCP server's
|
|
668
|
-
* `loadCredentials()` fallback; a persisted copy here would only drift.
|
|
669
|
-
*/
|
|
670
|
-
export function renderClineMcpSettings(params) {
|
|
671
|
-
return {
|
|
672
|
-
mcpServers: {
|
|
673
|
-
telora: {
|
|
674
|
-
command: 'node',
|
|
675
|
-
args: [params.mcpServerPath],
|
|
676
|
-
env: {
|
|
677
|
-
TELORA_MCP_PROFILE: 'human',
|
|
678
|
-
},
|
|
679
|
-
disabled: false,
|
|
680
|
-
autoApprove: [],
|
|
681
|
-
},
|
|
682
|
-
},
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
export function writeOrMergeClineMcpSettings(io, params = {}) {
|
|
686
|
-
let mcpServerPath;
|
|
687
|
-
try {
|
|
688
|
-
mcpServerPath = resolveMcpServerPath();
|
|
689
|
-
}
|
|
690
|
-
catch (err) {
|
|
691
|
-
io.err(`Warning: could not resolve @telora/mcp-products; skipping Cline MCP registration: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
692
|
-
return;
|
|
693
|
-
}
|
|
694
|
-
const home = params.homeOverride ?? homedir();
|
|
695
|
-
const dir = resolve(home, '.cline', 'data', 'settings');
|
|
696
|
-
const path = resolve(dir, 'cline_mcp_settings.json');
|
|
697
|
-
const desired = renderClineMcpSettings({ mcpServerPath });
|
|
698
|
-
if (!existsSync(dir))
|
|
699
|
-
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
700
|
-
let parsed = {};
|
|
701
|
-
if (existsSync(path)) {
|
|
702
|
-
try {
|
|
703
|
-
const raw = readFileSync(path, 'utf-8');
|
|
704
|
-
const candidate = JSON.parse(raw);
|
|
705
|
-
if (candidate && typeof candidate === 'object' && !Array.isArray(candidate)) {
|
|
706
|
-
parsed = candidate;
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
catch (err) {
|
|
710
|
-
io.err(`Warning: ${path} is not valid JSON; leaving it alone: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
711
|
-
return;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
const existingServers = parsed.mcpServers && typeof parsed.mcpServers === 'object' && !Array.isArray(parsed.mcpServers)
|
|
715
|
-
? parsed.mcpServers
|
|
716
|
-
: {};
|
|
717
|
-
const desiredServers = desired.mcpServers;
|
|
718
|
-
const next = {
|
|
719
|
-
...parsed,
|
|
720
|
-
mcpServers: {
|
|
721
|
-
...existingServers,
|
|
722
|
-
telora: desiredServers.telora,
|
|
723
|
-
},
|
|
724
|
-
};
|
|
725
|
-
const content = JSON.stringify(next, null, 2) + '\n';
|
|
726
|
-
if (existsSync(path) && readFileSync(path, 'utf-8') === content)
|
|
727
|
-
return;
|
|
728
|
-
writeFileSync(path, content, { mode: 0o600 });
|
|
729
|
-
io.out(`Registered Telora MCP server in ${path}.\n`);
|
|
730
|
-
}
|
|
731
|
-
/**
|
|
732
|
-
* The MCP-registration sentence spliced into the AGENTS.md seed body for each
|
|
733
|
-
* IDE harness. Both Cursor and VS Code read AGENTS.md natively, but they load
|
|
734
|
-
* MCP from different project files, so the seeded discipline must name the
|
|
735
|
-
* right one. (`renderAgentsMd` defaults to the Codex `~/.codex/config.toml`
|
|
736
|
-
* location; these override it.)
|
|
737
|
-
*/
|
|
738
|
-
export const IDE_MCP_REGISTRATION_SENTENCE = {
|
|
739
|
-
cursor: 'The Telora MCP server is registered in `.cursor/mcp.json`.',
|
|
740
|
-
vscode: 'The Telora MCP server is registered in `.vscode/mcp.json`.',
|
|
741
|
-
};
|
|
742
|
-
/** Project-relative path of the MCP config file for each IDE harness. */
|
|
743
|
-
export const IDE_MCP_CONFIG_PATH = {
|
|
744
|
-
cursor: '.cursor/mcp.json',
|
|
745
|
-
vscode: '.vscode/mcp.json',
|
|
746
|
-
};
|
|
747
|
-
/**
|
|
748
|
-
* Build the project-level MCP config object for an IDE harness.
|
|
749
|
-
*
|
|
750
|
-
* Cursor reads `.cursor/mcp.json` with a top-level `mcpServers` map (the same
|
|
751
|
-
* shape as `.mcp.json`). VS Code reads `.vscode/mcp.json` with a top-level
|
|
752
|
-
* `servers` map whose entries declare `type: "stdio"`.
|
|
753
|
-
*
|
|
754
|
-
* Both carry the MCP profile + domain-preload env ONLY -- never workstation
|
|
755
|
-
* identity. Identity (`TELORA_URL` / `TELORA_TRACKER_ID`) resolves from the
|
|
756
|
-
* single source `~/.telora/daemon.json` via the MCP server's
|
|
757
|
-
* `loadCredentials()` fallback, so a persisted copy here would only drift --
|
|
758
|
-
* the same single-source invariant the `.mcp.json` / Codex / Cline builders
|
|
759
|
-
* hold. The preload env is what makes these static-surface clients usable:
|
|
760
|
-
* it registers the named domains at startup rather than via `telora_discover`.
|
|
761
|
-
*/
|
|
762
|
-
export function renderIdeMcpConfig(kind, params) {
|
|
763
|
-
const env = {
|
|
764
|
-
TELORA_MCP_PROFILE: 'human',
|
|
765
|
-
TELORA_MCP_PRELOAD: params.preload,
|
|
766
|
-
};
|
|
767
|
-
if (kind === 'cursor') {
|
|
768
|
-
return {
|
|
769
|
-
mcpServers: {
|
|
770
|
-
telora: { command: 'node', args: [params.mcpServerPath], env },
|
|
771
|
-
},
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
return {
|
|
775
|
-
servers: {
|
|
776
|
-
telora: { type: 'stdio', command: 'node', args: [params.mcpServerPath], env },
|
|
777
|
-
},
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Write the Telora project MCP config for an IDE harness (`.cursor/mcp.json`
|
|
782
|
-
* or `.vscode/mcp.json`).
|
|
783
|
-
*
|
|
784
|
-
* Idempotent JSON merge, mirroring `writeOrMergeClineMcpSettings`: preserve any
|
|
785
|
-
* user-authored server entries, replace only the `telora` key, and skip the
|
|
786
|
-
* write when nothing would change. Best-effort: if the MCP package cannot be
|
|
787
|
-
* resolved, prints a warning and returns without touching the file (the connect
|
|
788
|
-
* flow must not abort). `params.preload` defaults to `DEFAULT_IDE_HARNESS_PRELOAD`.
|
|
789
|
-
*/
|
|
790
|
-
export function writeIdeMcpConfig(repoPath, kind, io, params = {}) {
|
|
791
|
-
let mcpServerPath;
|
|
792
|
-
try {
|
|
793
|
-
mcpServerPath = resolveMcpServerPath();
|
|
794
|
-
}
|
|
795
|
-
catch (err) {
|
|
796
|
-
io.err(`Warning: could not resolve @telora/mcp-products; skipping ${kind} MCP registration: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
const dir = resolve(repoPath, kind === 'cursor' ? '.cursor' : '.vscode');
|
|
800
|
-
const path = resolve(dir, 'mcp.json');
|
|
801
|
-
const mapKey = kind === 'cursor' ? 'mcpServers' : 'servers';
|
|
802
|
-
const desired = renderIdeMcpConfig(kind, {
|
|
803
|
-
mcpServerPath,
|
|
804
|
-
preload: params.preload ?? DEFAULT_IDE_HARNESS_PRELOAD,
|
|
805
|
-
});
|
|
806
|
-
if (!existsSync(dir))
|
|
807
|
-
mkdirSync(dir, { recursive: true });
|
|
808
|
-
let parsed = {};
|
|
809
|
-
if (existsSync(path)) {
|
|
810
|
-
try {
|
|
811
|
-
const candidate = JSON.parse(readFileSync(path, 'utf-8'));
|
|
812
|
-
if (candidate && typeof candidate === 'object' && !Array.isArray(candidate)) {
|
|
813
|
-
parsed = candidate;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
catch (err) {
|
|
817
|
-
io.err(`Warning: ${path} is not valid JSON; leaving it alone: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
const existingServers = parsed[mapKey] && typeof parsed[mapKey] === 'object' && !Array.isArray(parsed[mapKey])
|
|
822
|
-
? parsed[mapKey]
|
|
823
|
-
: {};
|
|
824
|
-
const desiredServers = desired[mapKey];
|
|
825
|
-
const next = {
|
|
826
|
-
...parsed,
|
|
827
|
-
[mapKey]: { ...existingServers, telora: desiredServers.telora },
|
|
828
|
-
};
|
|
829
|
-
const content = JSON.stringify(next, null, 2) + '\n';
|
|
830
|
-
if (existsSync(path) && readFileSync(path, 'utf-8') === content)
|
|
831
|
-
return;
|
|
832
|
-
writeFileSync(path, content);
|
|
833
|
-
io.out(`Registered Telora MCP server in ${path}.\n`);
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Write the full IDE-harness scaffolding (AGENTS.md seed + project MCP config)
|
|
837
|
-
* for `cursor` or `vscode`. Extracted so both `connect --harness <ide>` and the
|
|
838
|
-
* token-free `harness add <ide>` verb write byte-identical output.
|
|
839
|
-
*/
|
|
840
|
-
export function writeIdeHarnessScaffolding(repoPath, kind, inv, io) {
|
|
841
|
-
writeOrMergeAgentsMd(repoPath, { ...inv, mcpRegistrationSentence: IDE_MCP_REGISTRATION_SENTENCE[kind] }, io);
|
|
842
|
-
writeIdeMcpConfig(repoPath, kind, io);
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* The `.gitignore` entries a harness's scaffolding requires beyond the always-
|
|
846
|
-
* added `.telora/` + `.mcp.json`. Only the IDE harnesses add a project MCP
|
|
847
|
-
* config (per-user-machine, absolute path -> not shared).
|
|
848
|
-
*/
|
|
849
|
-
export function harnessGitignoreEntries(harness) {
|
|
850
|
-
return harness === 'cursor' || harness === 'vscode' ? [IDE_MCP_CONFIG_PATH[harness]] : [];
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* Write the harness-specific agent scaffolding for the chosen operator harness.
|
|
854
|
-
* This is the ONE place the per-harness writer set is dispatched, so both
|
|
855
|
-
* `connect --harness <h>` and the token-free `harness add <h>` verb produce
|
|
856
|
-
* byte-identical output for a given identity.
|
|
857
|
-
*
|
|
858
|
-
* - claude: CLAUDE.md + .claude/settings.json
|
|
859
|
-
* - codex: AGENTS.md + Telora MCP in ~/.codex/config.toml
|
|
860
|
-
* - cline: .cline/rules/telora.md + Telora MCP in ~/.cline settings
|
|
861
|
-
* - cursor: AGENTS.md + .cursor/mcp.json (preload env)
|
|
862
|
-
* - vscode: AGENTS.md + .vscode/mcp.json (preload env)
|
|
863
|
-
*
|
|
864
|
-
* Does NOT touch `.gitignore` -- callers pair this with
|
|
865
|
-
* `ensureGitignoreEntries(repoPath, io, harnessGitignoreEntries(harness))`.
|
|
866
|
-
*/
|
|
867
|
-
export function writeHarnessScaffolding(repoPath, harness, inv, io) {
|
|
868
|
-
if (harness === 'codex') {
|
|
869
|
-
writeOrMergeAgentsMd(repoPath, inv, io);
|
|
870
|
-
writeOrMergeCodexMcpToml(io);
|
|
871
|
-
}
|
|
872
|
-
else if (harness === 'cline') {
|
|
873
|
-
writeClineProjectRules(repoPath, inv, io);
|
|
874
|
-
writeOrMergeClineMcpSettings(io);
|
|
875
|
-
}
|
|
876
|
-
else if (harness === 'cursor' || harness === 'vscode') {
|
|
877
|
-
writeIdeHarnessScaffolding(repoPath, harness, inv, io);
|
|
878
|
-
}
|
|
879
|
-
else {
|
|
880
|
-
writeOrMergeClaudeMd(repoPath, inv.productName ?? null, io);
|
|
881
|
-
writeOrMergeClaudeSettings(repoPath, io);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
400
|
/**
|
|
885
401
|
* Resolve the connected-workstation identity for `repoPath` from
|
|
886
402
|
* `~/.telora/daemon.json`: the top-level `teloraUrl` / `organizationId` plus the
|
|
@@ -914,38 +430,6 @@ export function readConnectedIdentity(repoPath) {
|
|
|
914
430
|
}
|
|
915
431
|
return null;
|
|
916
432
|
}
|
|
917
|
-
/**
|
|
918
|
-
* Write or deep-merge `<repo>/.claude/settings.json`.
|
|
919
|
-
*
|
|
920
|
-
* Fresh: writes the template directly.
|
|
921
|
-
* Existing: deep-merges our `permissions.allow` entries into the user's
|
|
922
|
-
* settings, deduplicating. All other top-level keys are untouched.
|
|
923
|
-
* Re-runs produce no diff.
|
|
924
|
-
*/
|
|
925
|
-
export function writeOrMergeClaudeSettings(repoPath, io) {
|
|
926
|
-
const dir = resolve(repoPath, '.claude');
|
|
927
|
-
const path = resolve(dir, 'settings.json');
|
|
928
|
-
const seed = buildClaudeSettings();
|
|
929
|
-
if (!existsSync(dir))
|
|
930
|
-
mkdirSync(dir, { recursive: true });
|
|
931
|
-
let existing = null;
|
|
932
|
-
if (existsSync(path)) {
|
|
933
|
-
try {
|
|
934
|
-
const parsed = JSON.parse(readFileSync(path, 'utf-8'));
|
|
935
|
-
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
936
|
-
existing = parsed;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
catch (err) {
|
|
940
|
-
io.err(`Warning: existing ${path} is not valid JSON; leaving it alone: ` +
|
|
941
|
-
`${err instanceof Error ? err.message : String(err)}\n`);
|
|
942
|
-
return;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
const merged = mergeClaudeSettings(existing, seed);
|
|
946
|
-
writeFileSync(path, JSON.stringify(merged, null, 2) + '\n');
|
|
947
|
-
io.out(existing ? `Merged Telora entries into ${path}.\n` : `Wrote ${path}.\n`);
|
|
948
|
-
}
|
|
949
433
|
// ── Workstation tracking (D4): telora-ai detection + hook merge ─────────
|
|
950
434
|
/**
|
|
951
435
|
* Locate the `telora-ai` Python CLI on PATH. Returns the absolute path if
|