@telora/daemon 0.20.78 → 0.20.95

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.
Files changed (151) hide show
  1. package/build-info.json +2 -2
  2. package/dist/ai-inspection-context.d.ts.map +1 -1
  3. package/dist/ai-inspection-context.js +4 -2
  4. package/dist/ai-inspection-context.js.map +1 -1
  5. package/dist/audit-prompt.d.ts.map +1 -1
  6. package/dist/audit-prompt.js +9 -5
  7. package/dist/audit-prompt.js.map +1 -1
  8. package/dist/ci-sensor-loop.d.ts +33 -5
  9. package/dist/ci-sensor-loop.d.ts.map +1 -1
  10. package/dist/ci-sensor-loop.js +95 -14
  11. package/dist/ci-sensor-loop.js.map +1 -1
  12. package/dist/ci-status-git.d.ts +7 -5
  13. package/dist/ci-status-git.d.ts.map +1 -1
  14. package/dist/ci-status-git.js +12 -9
  15. package/dist/ci-status-git.js.map +1 -1
  16. package/dist/ci-status.d.ts +21 -6
  17. package/dist/ci-status.d.ts.map +1 -1
  18. package/dist/ci-status.js +90 -15
  19. package/dist/ci-status.js.map +1 -1
  20. package/dist/cli/connect/agents.d.ts +64 -14
  21. package/dist/cli/connect/agents.d.ts.map +1 -1
  22. package/dist/cli/connect/agents.js +102 -19
  23. package/dist/cli/connect/agents.js.map +1 -1
  24. package/dist/cli/connect/claude.d.ts +19 -16
  25. package/dist/cli/connect/claude.d.ts.map +1 -1
  26. package/dist/cli/connect/claude.js +34 -68
  27. package/dist/cli/connect/claude.js.map +1 -1
  28. package/dist/cli/connect/scaffolding.d.ts +3 -2
  29. package/dist/cli/connect/scaffolding.d.ts.map +1 -1
  30. package/dist/cli/connect/scaffolding.js +17 -6
  31. package/dist/cli/connect/scaffolding.js.map +1 -1
  32. package/dist/cli/connect/seed-retirement.d.ts +39 -0
  33. package/dist/cli/connect/seed-retirement.d.ts.map +1 -0
  34. package/dist/cli/connect/seed-retirement.js +95 -0
  35. package/dist/cli/connect/seed-retirement.js.map +1 -0
  36. package/dist/cli/connect.d.ts +2 -2
  37. package/dist/cli/connect.d.ts.map +1 -1
  38. package/dist/cli/connect.js +8 -2
  39. package/dist/cli/connect.js.map +1 -1
  40. package/dist/cli/session-state.d.ts +0 -20
  41. package/dist/cli/session-state.d.ts.map +1 -1
  42. package/dist/cli/session-state.js +20 -49
  43. package/dist/cli/session-state.js.map +1 -1
  44. package/dist/completion/completion-decision.d.ts +3 -29
  45. package/dist/completion/completion-decision.d.ts.map +1 -1
  46. package/dist/completion/completion-decision.js +3 -15
  47. package/dist/completion/completion-decision.js.map +1 -1
  48. package/dist/completion/event-phases.d.ts +0 -8
  49. package/dist/completion/event-phases.d.ts.map +1 -1
  50. package/dist/completion/event-phases.js +4 -52
  51. package/dist/completion/event-phases.js.map +1 -1
  52. package/dist/completion/event.d.ts +1 -11
  53. package/dist/completion/event.d.ts.map +1 -1
  54. package/dist/completion/event.js +1 -3
  55. package/dist/completion/event.js.map +1 -1
  56. package/dist/completion/merge-phase.d.ts +1 -1
  57. package/dist/completion/merge-phase.d.ts.map +1 -1
  58. package/dist/completion/merge-phase.js +14 -34
  59. package/dist/completion/merge-phase.js.map +1 -1
  60. package/dist/completion/team-lifecycle.d.ts.map +1 -1
  61. package/dist/completion/team-lifecycle.js +13 -1
  62. package/dist/completion/team-lifecycle.js.map +1 -1
  63. package/dist/delivery-artifacts.d.ts.map +1 -1
  64. package/dist/delivery-artifacts.js +9 -8
  65. package/dist/delivery-artifacts.js.map +1 -1
  66. package/dist/git/merge.d.ts +16 -0
  67. package/dist/git/merge.d.ts.map +1 -1
  68. package/dist/git/merge.js +39 -1
  69. package/dist/git/merge.js.map +1 -1
  70. package/dist/product-scaffold.d.ts +8 -6
  71. package/dist/product-scaffold.d.ts.map +1 -1
  72. package/dist/product-scaffold.js +14 -10
  73. package/dist/product-scaffold.js.map +1 -1
  74. package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
  75. package/dist/prompt-sections/execution-sections.js +44 -3
  76. package/dist/prompt-sections/execution-sections.js.map +1 -1
  77. package/dist/prompt-sections/scoping-sections.d.ts.map +1 -1
  78. package/dist/prompt-sections/scoping-sections.js +8 -0
  79. package/dist/prompt-sections/scoping-sections.js.map +1 -1
  80. package/dist/queries/cause-key.d.ts +13 -3
  81. package/dist/queries/cause-key.d.ts.map +1 -1
  82. package/dist/queries/cause-key.js +14 -4
  83. package/dist/queries/cause-key.js.map +1 -1
  84. package/dist/queries/deliveries.d.ts +20 -153
  85. package/dist/queries/deliveries.d.ts.map +1 -1
  86. package/dist/queries/deliveries.js +26 -0
  87. package/dist/queries/deliveries.js.map +1 -1
  88. package/dist/queries/delivery-gate-state.d.ts +192 -0
  89. package/dist/queries/delivery-gate-state.d.ts.map +1 -0
  90. package/dist/queries/delivery-gate-state.js +23 -0
  91. package/dist/queries/delivery-gate-state.js.map +1 -0
  92. package/dist/queries/holds.d.ts +62 -60
  93. package/dist/queries/holds.d.ts.map +1 -1
  94. package/dist/queries/holds.js +70 -69
  95. package/dist/queries/holds.js.map +1 -1
  96. package/dist/queries/issues.d.ts +2 -2
  97. package/dist/queries/issues.d.ts.map +1 -1
  98. package/dist/queries/issues.js +2 -2
  99. package/dist/queries/issues.js.map +1 -1
  100. package/dist/reality-pole.d.ts +5 -3
  101. package/dist/reality-pole.d.ts.map +1 -1
  102. package/dist/reality-pole.js +13 -4
  103. package/dist/reality-pole.js.map +1 -1
  104. package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
  105. package/dist/resolvers/git-diff-against-base.js +12 -5
  106. package/dist/resolvers/git-diff-against-base.js.map +1 -1
  107. package/dist/resolvers/index.d.ts +1 -1
  108. package/dist/resolvers/index.d.ts.map +1 -1
  109. package/dist/resolvers/index.js +1 -1
  110. package/dist/resolvers/index.js.map +1 -1
  111. package/dist/resolvers/shared/git-diff.d.ts +147 -26
  112. package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
  113. package/dist/resolvers/shared/git-diff.js +275 -35
  114. package/dist/resolvers/shared/git-diff.js.map +1 -1
  115. package/dist/templates/agents-md.d.ts +16 -0
  116. package/dist/templates/agents-md.d.ts.map +1 -1
  117. package/dist/templates/agents-md.js +26 -0
  118. package/dist/templates/agents-md.js.map +1 -1
  119. package/dist/templates/claude-settings.d.ts +44 -1
  120. package/dist/templates/claude-settings.d.ts.map +1 -1
  121. package/dist/templates/claude-settings.js +73 -1
  122. package/dist/templates/claude-settings.js.map +1 -1
  123. package/dist/unified-shell-provisioning.d.ts +99 -0
  124. package/dist/unified-shell-provisioning.d.ts.map +1 -0
  125. package/dist/unified-shell-provisioning.js +222 -0
  126. package/dist/unified-shell-provisioning.js.map +1 -0
  127. package/dist/unified-shell.d.ts +0 -41
  128. package/dist/unified-shell.d.ts.map +1 -1
  129. package/dist/unified-shell.js +19 -135
  130. package/dist/unified-shell.js.map +1 -1
  131. package/dist/verification-deps.d.ts +151 -0
  132. package/dist/verification-deps.d.ts.map +1 -0
  133. package/dist/verification-deps.js +19 -0
  134. package/dist/verification-deps.js.map +1 -0
  135. package/dist/verification-engine.d.ts +10 -112
  136. package/dist/verification-engine.d.ts.map +1 -1
  137. package/dist/verification-engine.js +84 -30
  138. package/dist/verification-engine.js.map +1 -1
  139. package/dist/verification-evidence.d.ts +33 -1
  140. package/dist/verification-evidence.d.ts.map +1 -1
  141. package/dist/verification-evidence.js +55 -13
  142. package/dist/verification-evidence.js.map +1 -1
  143. package/dist/verification-feedback.d.ts +31 -27
  144. package/dist/verification-feedback.d.ts.map +1 -1
  145. package/dist/verification-feedback.js +76 -85
  146. package/dist/verification-feedback.js.map +1 -1
  147. package/dist/verify-restatement.d.ts +12 -9
  148. package/dist/verify-restatement.d.ts.map +1 -1
  149. package/dist/verify-restatement.js +11 -9
  150. package/dist/verify-restatement.js.map +1 -1
  151. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAaH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AA4BD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,2BAA2B,GAAG,MAAM,CAcvE"}
1
+ {"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAaH,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AA4BD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAWhD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,2BAA2B,GAAG,MAAM,CAcvE"}
@@ -52,6 +52,32 @@ function renderConnectionInvariant(inv) {
52
52
  `write it").\n` +
53
53
  `\n`);
54
54
  }
55
+ /**
56
+ * Render the header-LESS Codex operator seed block: the shared seed prose only,
57
+ * with NO per-product connection-invariant header.
58
+ *
59
+ * Used for the workstation-shared carriers a Codex session reads from the
60
+ * operator's own `~/.codex` -- the interactive operator AND daemon-spawned
61
+ * HOSTED Codex agents (whose ChatGPT-account auth lives in `~/.codex/auth.json`,
62
+ * so their CODEX_HOME cannot be redirected to a per-product isolated home). One
63
+ * workstation hosts many products, so a single shared file cannot bake a correct
64
+ * per-product header for more than one; the identity is resolved on demand via
65
+ * `telora-daemon status` instead. This is the accepted downgrade of Codex having
66
+ * no SessionStart hook. The per-product baked header (`renderAgentsMd`) is used
67
+ * only where the destination is genuinely per-product (the isolated CODEX_HOME
68
+ * of a local-model Codex product).
69
+ */
70
+ export function renderCodexOperatorSeed() {
71
+ const body = SEED_BODY.replace(SEED_MCP_REGISTRATION_SENTENCE, CODEX_MCP_REGISTRATION_SENTENCE);
72
+ const header = `## Telora connection\n` +
73
+ `\n` +
74
+ `This workstation is connected to Telora. This file is workstation-shared\n` +
75
+ `across every product on the host, so it carries no per-product identity;\n` +
76
+ `resolve the current connection (URL / org / product) on demand with\n` +
77
+ `\`telora-daemon status\`.\n` +
78
+ `\n`;
79
+ return `${TELORA_AGENTS_MD_BEGIN}\n${header}${body}${TELORA_AGENTS_MD_END}\n`;
80
+ }
55
81
  /**
56
82
  * Render a fresh-repo AGENTS.md seed block.
57
83
  *
@@ -1 +1 @@
1
- {"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/templates/agents-md.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,+BAA+B,GACnC,gEAAgE,CAAC;AAEnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AA0B/D;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,GAA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 @@
14
14
  * settings schema): `permissions.allow` is a list of tool patterns. MCP
15
15
  * tool patterns follow the form `mcp__<server-name>__<tool-name>`.
16
16
  */
17
+ /** A single Claude Code hook command entry. */
18
+ export interface ClaudeHookCommand {
19
+ type: 'command';
20
+ command: string;
21
+ }
22
+ /** A hook matcher group: a set of commands run for a matched event. */
23
+ export interface ClaudeHookMatcher {
24
+ hooks: ClaudeHookCommand[];
25
+ }
26
+ /**
27
+ * The subset of the Claude Code `hooks` map Telora installs. Only `SessionStart`
28
+ * is seeded (it carries the workstation seed via `telora-daemon session-state`);
29
+ * all other hook events are user-owned and left untouched by the merge.
30
+ */
31
+ export interface TeloraHooks {
32
+ SessionStart?: ClaudeHookMatcher[];
33
+ }
17
34
  export interface TeloraSettingsTemplate {
18
35
  permissions: {
19
36
  allow: string[];
@@ -26,7 +43,28 @@ export interface TeloraSettingsTemplate {
26
43
  */
27
44
  deny?: string[];
28
45
  };
46
+ /**
47
+ * Seeded hooks. Carries the SessionStart hook that runs `telora-daemon
48
+ * session-state`, which since the seed became workstation context (not a
49
+ * repo file) is the carrier that delivers the Telora workstation seed to the
50
+ * session at open. Present on every writable/read-only seed.
51
+ */
52
+ hooks?: TeloraHooks;
29
53
  }
54
+ /**
55
+ * The SessionStart hook command. Resolves the `telora-daemon` binary from the
56
+ * project's local `node_modules/.bin` first (the pinned install), falling back
57
+ * to whatever is on PATH, and no-ops cleanly (`|| true`) when neither is present
58
+ * so a repo without the daemon installed never has session start blocked.
59
+ *
60
+ * `session-state` emits the connection invariants AND the workstation seed to
61
+ * stdout, which the SessionStart hook contract feeds into the session as
62
+ * additionalContext -- so newly shipped Telora directives reach a connected
63
+ * workstation by updating the daemon binary, with no file on disk changing.
64
+ */
65
+ export declare const TELORA_SESSION_START_HOOK_COMMAND: string;
66
+ /** Build the seeded SessionStart hook group. */
67
+ export declare function buildSessionStartHooks(): TeloraHooks;
30
68
  /**
31
69
  * Write-shaped tool denials for a read-only audit focus.
32
70
  *
@@ -63,7 +101,12 @@ export declare function buildClaudeSettings({ readOnly }?: {
63
101
  * - `permissions.deny`: same union semantics. Only written when the seed (or
64
102
  * the existing file) carries deny entries -- a writable seed against a
65
103
  * deny-free existing file leaves no `deny` key.
66
- * - All other top-level keys: untouched. We only own the permissions list.
104
+ * - `hooks.SessionStart`: union of the user's matcher groups with the seed's,
105
+ * deduplicated by command string -- a re-merge never appends a second copy of
106
+ * our SessionStart command. All OTHER hook events (PreToolUse, Stop, ...) are
107
+ * left exactly as the user had them.
108
+ * - All other top-level keys: untouched. We only own the permissions list and
109
+ * the SessionStart hook.
67
110
  */
68
111
  export declare function mergeClaudeSettings(existing: Record<string, unknown> | null, seed: TeloraSettingsTemplate): Record<string, unknown>;
69
112
  //# sourceMappingURL=claude-settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-settings.d.ts","sourceRoot":"","sources":["../../src/templates/claude-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB;;;;;;WAMG;QACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;CACH;AAqCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAiBhD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,QAAQ,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,sBAAsB,CAOxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACxC,IAAI,EAAE,sBAAsB,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkCzB"}
1
+ {"version":3,"file":"claude-settings.d.ts","sourceRoot":"","sources":["../../src/templates/claude-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB;;;;;;WAMG;QACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iCAAiC,QAGG,CAAC;AAElD,gDAAgD;AAChD,wBAAgB,sBAAsB,IAAI,WAAW,CAMpD;AAqCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAiBhD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,QAAQ,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,sBAAsB,CAQxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACxC,IAAI,EAAE,sBAAsB,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqCzB"}
@@ -14,6 +14,28 @@
14
14
  * settings schema): `permissions.allow` is a list of tool patterns. MCP
15
15
  * tool patterns follow the form `mcp__<server-name>__<tool-name>`.
16
16
  */
17
+ /**
18
+ * The SessionStart hook command. Resolves the `telora-daemon` binary from the
19
+ * project's local `node_modules/.bin` first (the pinned install), falling back
20
+ * to whatever is on PATH, and no-ops cleanly (`|| true`) when neither is present
21
+ * so a repo without the daemon installed never has session start blocked.
22
+ *
23
+ * `session-state` emits the connection invariants AND the workstation seed to
24
+ * stdout, which the SessionStart hook contract feeds into the session as
25
+ * additionalContext -- so newly shipped Telora directives reach a connected
26
+ * workstation by updating the daemon binary, with no file on disk changing.
27
+ */
28
+ export const TELORA_SESSION_START_HOOK_COMMAND = 'bin="${CLAUDE_PROJECT_DIR:-.}/node_modules/.bin/telora-daemon"; ' +
29
+ '[ -x "$bin" ] || bin="$(command -v telora-daemon)"; ' +
30
+ '[ -n "$bin" ] && "$bin" session-state || true';
31
+ /** Build the seeded SessionStart hook group. */
32
+ export function buildSessionStartHooks() {
33
+ return {
34
+ SessionStart: [
35
+ { hooks: [{ type: 'command', command: TELORA_SESSION_START_HOOK_COMMAND }] },
36
+ ],
37
+ };
38
+ }
17
39
  /**
18
40
  * Routine MCP tool calls expected during a normal Telora session.
19
41
  *
@@ -93,6 +115,7 @@ export function buildClaudeSettings({ readOnly } = {}) {
93
115
  allow: [...TELORA_MCP_ALLOWLIST],
94
116
  ...(readOnly ? { deny: buildReadOnlyDenyList() } : {}),
95
117
  },
118
+ hooks: buildSessionStartHooks(),
96
119
  };
97
120
  }
98
121
  /**
@@ -106,7 +129,12 @@ export function buildClaudeSettings({ readOnly } = {}) {
106
129
  * - `permissions.deny`: same union semantics. Only written when the seed (or
107
130
  * the existing file) carries deny entries -- a writable seed against a
108
131
  * deny-free existing file leaves no `deny` key.
109
- * - All other top-level keys: untouched. We only own the permissions list.
132
+ * - `hooks.SessionStart`: union of the user's matcher groups with the seed's,
133
+ * deduplicated by command string -- a re-merge never appends a second copy of
134
+ * our SessionStart command. All OTHER hook events (PreToolUse, Stop, ...) are
135
+ * left exactly as the user had them.
136
+ * - All other top-level keys: untouched. We only own the permissions list and
137
+ * the SessionStart hook.
110
138
  */
111
139
  export function mergeClaudeSettings(existing, seed) {
112
140
  const out = existing && typeof existing === 'object' ? { ...existing } : {};
@@ -134,6 +162,50 @@ export function mergeClaudeSettings(existing, seed) {
134
162
  // against a deny-free existing file must not introduce an empty deny key.
135
163
  ...(mergedDeny.length > 0 ? { deny: mergedDeny } : {}),
136
164
  };
165
+ const mergedHooks = mergeSessionStartHooks(out.hooks, seed.hooks);
166
+ if (mergedHooks)
167
+ out.hooks = mergedHooks;
137
168
  return out;
138
169
  }
170
+ /**
171
+ * Merge the seed's SessionStart hook into an existing `hooks` map.
172
+ *
173
+ * - Every existing hook event is preserved verbatim.
174
+ * - The seed's SessionStart matcher groups are appended to any the user already
175
+ * has, skipping a group whose command already appears (so a re-merge is a
176
+ * no-op). Returns null only when there is nothing to write (no seed hooks and
177
+ * no existing hooks), so a settings file that never had hooks stays clean.
178
+ */
179
+ function mergeSessionStartHooks(existingHooks, seedHooks) {
180
+ const existing = existingHooks && typeof existingHooks === 'object' && !Array.isArray(existingHooks)
181
+ ? { ...existingHooks }
182
+ : {};
183
+ const seedGroups = seedHooks?.SessionStart ?? [];
184
+ if (seedGroups.length === 0) {
185
+ return Object.keys(existing).length > 0 ? existing : null;
186
+ }
187
+ const existingGroups = Array.isArray(existing.SessionStart)
188
+ ? [...existing.SessionStart]
189
+ : [];
190
+ const commandOf = (group) => {
191
+ if (!group || typeof group !== 'object')
192
+ return [];
193
+ const hooks = group.hooks;
194
+ if (!Array.isArray(hooks))
195
+ return [];
196
+ return hooks
197
+ .map((h) => (h && typeof h === 'object' ? h.command : undefined))
198
+ .filter((c) => typeof c === 'string');
199
+ };
200
+ const present = new Set(existingGroups.flatMap(commandOf));
201
+ for (const group of seedGroups) {
202
+ const cmds = commandOf(group);
203
+ if (cmds.some((c) => present.has(c)))
204
+ continue;
205
+ existingGroups.push(group);
206
+ cmds.forEach((c) => present.add(c));
207
+ }
208
+ existing.SessionStart = existingGroups;
209
+ return existing;
210
+ }
139
211
  //# sourceMappingURL=claude-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-sett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IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvD,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"claude-settings.js","sourceRoot":"","sources":["../../src/templates/claude-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2CH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAC5C,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C,CAAC;AAElD,gDAAgD;AAChD,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,YAAY,EAAE;YACZ,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC,EAAE;SAC7E;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG;IAC3B,WAAW;IACX,sCAAsC;IACtC,4CAA4C;IAC5C,+CAA+C;IAC/C,4CAA4C;IAC5C,qBAAqB;IACrB,0CAA0C;IAC1C,4CAA4C;IAC5C,+CAA+C;IAC/C,+CAA+C;IAC/C,8CAA8C;IAC9C,8CAA8C;IAC9C,gDAAgD;IAChD,yCAAyC;IACzC,+CAA+C;IAC/C,wBAAwB;IACxB,4CAA4C;IAC5C,4CAA4C;IAC5C,0CAA0C;IAC1C,2CAA2C;IAC3C,uCAAuC;IACvC,oCAAoC;IACpC,2CAA2C;IAC3C,uCAAuC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,OAAO;QACP,MAAM;QACN,cAAc;QACd,WAAW;QACX,YAAY;QACZ,oBAAoB;QACpB,kBAAkB;QAClB,iBAAiB;QACjB,YAAY;QACZ,YAAY;QACZ,aAAa;QACb,gBAAgB;QAChB,YAAY;QACZ,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB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,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Boot-time per-product provisioning for the unified daemon shell.
3
+ *
4
+ * Every function here answers the same question: "connect seeds this once --
5
+ * what keeps it current on the daemon's update cadence?" Each walks
6
+ * `config.base.products` directly, is idempotent (no write when already
7
+ * current, so an unchanged repo sees no git churn), and is per-product
8
+ * best-effort -- one repo's unreadable or unwritable path must never abort the
9
+ * daemon or the remaining products.
10
+ *
11
+ * `telora-daemon update` is covered by construction: update re-execs the
12
+ * daemon, so an updating workstation necessarily runs this whole pass.
13
+ *
14
+ * Called from `runUnifiedDaemon` (`unified-shell.ts`) in a load-bearing order --
15
+ * see `refreshClaudeSettingsForProducts` for the one ordering constraint that
16
+ * is a correctness requirement rather than a preference.
17
+ */
18
+ import type { UnifiedConfig } from '@telora/daemon-core';
19
+ /**
20
+ * Refresh `.mcp.json` in each configured product's repo so Claude Code's
21
+ * MCP invocation always points at the daemon's currently-installed
22
+ * `@telora/mcp-products`. Idempotent: writes the same bytes if nothing
23
+ * has changed. All failures are warnings -- a missing or unwritable repo
24
+ * path must not block the daemon.
25
+ */
26
+ export declare function refreshMcpConfigsForProducts(config: UnifiedConfig): void;
27
+ /**
28
+ * Refresh `.claude/settings.json` in each configured product's repo so the
29
+ * SessionStart seed hook (which carries the Claude workstation seed at session
30
+ * open) reaches EVERY connected repo -- not only newly-connected ones.
31
+ *
32
+ * `.claude/settings.json` is otherwise written at connect time only
33
+ * (writeOrMergeClaudeSettings, sole call site in connect scaffolding). Without
34
+ * this boot-cadence refresh, an already-connected repo would never receive the
35
+ * hook, and once the repo-root CLAUDE.md file carrier is withdrawn that repo
36
+ * would carry NO seed at all -- silently. This is the exact analog of
37
+ * `refreshMcpConfigsForProducts`: "connect seeds it once, this keeps it current
38
+ * on the daemon's update cadence." It walks `config.base.products` directly, so
39
+ * it reaches every product in the local daemon.json regardless of which
40
+ * workstation claims it; `telora-daemon update` re-execs, so an updating
41
+ * workstation necessarily runs this pass.
42
+ *
43
+ * CRITICAL ORDERING (runUnifiedDaemon): this MUST run BEFORE the CLAUDE.md
44
+ * retirement (`scaffoldProductsAtBoot`), so a workstation cannot reach the file
45
+ * withdrawal without having just installed the hook carrier in the same boot.
46
+ *
47
+ * Idempotent (writeOrMergeClaudeSettings no-writes when unchanged) and
48
+ * per-product best-effort: one repo's unwritable settings must not abort the rest.
49
+ */
50
+ export declare function refreshClaudeSettingsForProducts(config: UnifiedConfig): void;
51
+ /**
52
+ * Boot-time self-heal of every configured product's directory. Routes each
53
+ * product through the single idempotent `scaffoldProductDirectory` -- the exact
54
+ * same scaffolder the SIGHUP hot-reload handler calls for newly-added products
55
+ * -- so there is ONE scaffold implementation shared by both entry points.
56
+ *
57
+ * For each product this (idempotently):
58
+ * - Refreshes the delimited `<!-- BEGIN/END TELORA SEED -->` block in the
59
+ * repo's `CLAUDE.md` to the daemon's installed seed (the analog of
60
+ * `refreshMcpConfigsForProducts`: connect seeds it once, this keeps it
61
+ * current on the daemon's update cadence -- no write when already current,
62
+ * so an unchanged repo sees no git churn). productName is null to stay
63
+ * byte-identical with the connect-seeded block.
64
+ * - git-inits the directory when it has no repo (init, .gitignore, initial
65
+ * commit, integration branch) so the focus engine can create branches and
66
+ * worktrees. Skipped when a repo already exists (never clobbers).
67
+ *
68
+ * `telora-daemon update` is covered by construction: update re-execs the
69
+ * daemon, so this boot path runs again on the new version.
70
+ *
71
+ * All failures are per-product warnings (handled inside the scaffolder): one
72
+ * repo's unreadable/locked directory must not abort the daemon or the others.
73
+ */
74
+ export declare function scaffoldProductsAtBoot(config: UnifiedConfig): void;
75
+ /**
76
+ * Boot-time self-heal for the Codex AGENTS.md seed carriers, on the daemon's
77
+ * update cadence. There are three destinations, all off the repo root and each
78
+ * refresh-only (a destination that does not already exist is skipped, so boot
79
+ * never spawns a carrier a workstation did not opt into):
80
+ *
81
+ * 1. The workstation-shared operator seed `~/.codex/AGENTS.md` (header-less) --
82
+ * read by an interactive operator and by daemon-spawned HOSTED Codex agents.
83
+ * 2. Each product's ISOLATED CODEX_HOME `~/.telora/codex/<productId>/AGENTS.md`
84
+ * (per-product header) -- read by daemon-spawned LOCAL-MODEL Codex agents.
85
+ * Refreshed only where the isolated home already exists (i.e. was
86
+ * provisioned for a local-model product); a hosted product has none and is
87
+ * skipped.
88
+ * 3. Repo-root `<repo>/AGENTS.md` for the IDE harnesses (Cursor / VS Code) that
89
+ * read it natively -- refresh-only, and the safe writer refuses to touch a
90
+ * repo-TRACKED file. Boot does NOT retire repo-root AGENTS.md: it cannot
91
+ * tell a legacy-Codex file apart from a live IDE one, and deleting the
92
+ * latter would strip a harness still using it. Repo-root retirement is done
93
+ * at connect / `harness add codex`, where the harness is known.
94
+ *
95
+ * Per-destination warnings on failure; one repo's unreadable AGENTS.md must not
96
+ * abort the rest.
97
+ */
98
+ export declare function refreshAgentsMdForProducts(config: UnifiedConfig): void;
99
+ //# sourceMappingURL=unified-shell-provisioning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unified-shell-provisioning.d.ts","sourceRoot":"","sources":["../src/unified-shell-provisioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA6BzD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CA2BxE;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAgB5E;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAclE;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAiDtE"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Boot-time per-product provisioning for the unified daemon shell.
3
+ *
4
+ * Every function here answers the same question: "connect seeds this once --
5
+ * what keeps it current on the daemon's update cadence?" Each walks
6
+ * `config.base.products` directly, is idempotent (no write when already
7
+ * current, so an unchanged repo sees no git churn), and is per-product
8
+ * best-effort -- one repo's unreadable or unwritable path must never abort the
9
+ * daemon or the remaining products.
10
+ *
11
+ * `telora-daemon update` is covered by construction: update re-execs the
12
+ * daemon, so an updating workstation necessarily runs this whole pass.
13
+ *
14
+ * Called from `runUnifiedDaemon` (`unified-shell.ts`) in a load-bearing order --
15
+ * see `refreshClaudeSettingsForProducts` for the one ordering constraint that
16
+ * is a correctness requirement rather than a preference.
17
+ */
18
+ import { existsSync } from 'node:fs';
19
+ import { resolve } from 'node:path';
20
+ import { resolveMcpServerPath, writeMcpConfigFile } from './mcp-resolution.js';
21
+ import { writeOrMergeAgentsMd, writeOrMergeGlobalAgentsMd, writeProductCodexAgentsMd, writeOrMergeClaudeSettings, globalAgentsMdPath, } from './cli/connect.js';
22
+ import { resolveProductCodexHome } from './cli/codex-provision.js';
23
+ import { scaffoldProductDirectory } from './product-scaffold.js';
24
+ import { resolveIntegrationBranch } from './unified-shell-config.js';
25
+ import { createLogger } from './log.js';
26
+ const log = createLogger({ module: 'telemetry' });
27
+ /** Standard stdout/stderr/fetch io bundle the connect writers take. */
28
+ function bootIo() {
29
+ return {
30
+ out: (msg) => process.stdout.write(msg),
31
+ err: (msg) => process.stderr.write(msg),
32
+ fetch: globalThis.fetch,
33
+ };
34
+ }
35
+ // ---------------------------------------------------------------------------
36
+ // .mcp.json refresh
37
+ // ---------------------------------------------------------------------------
38
+ /**
39
+ * Refresh `.mcp.json` in each configured product's repo so Claude Code's
40
+ * MCP invocation always points at the daemon's currently-installed
41
+ * `@telora/mcp-products`. Idempotent: writes the same bytes if nothing
42
+ * has changed. All failures are warnings -- a missing or unwritable repo
43
+ * path must not block the daemon.
44
+ */
45
+ export function refreshMcpConfigsForProducts(config) {
46
+ const products = config.base.products ?? [];
47
+ if (products.length === 0)
48
+ return;
49
+ let mcpServerPath;
50
+ try {
51
+ mcpServerPath = resolveMcpServerPath();
52
+ }
53
+ catch (err) {
54
+ log.warn(`[mcp-refresh] Cannot resolve @telora/mcp-products: ${err instanceof Error ? err.message : String(err)}`);
55
+ return;
56
+ }
57
+ for (const product of products) {
58
+ if (!product.repoPath)
59
+ continue;
60
+ try {
61
+ writeMcpConfigFile(product.repoPath, {
62
+ mcpServerPath,
63
+ profile: 'human',
64
+ });
65
+ }
66
+ catch (err) {
67
+ log.warn(`[mcp-refresh] Failed for ${product.repoPath}: ${err instanceof Error ? err.message : String(err)}`);
68
+ }
69
+ }
70
+ }
71
+ // ---------------------------------------------------------------------------
72
+ // .claude/settings.json refresh (SessionStart seed-hook migration)
73
+ // ---------------------------------------------------------------------------
74
+ /**
75
+ * Refresh `.claude/settings.json` in each configured product's repo so the
76
+ * SessionStart seed hook (which carries the Claude workstation seed at session
77
+ * open) reaches EVERY connected repo -- not only newly-connected ones.
78
+ *
79
+ * `.claude/settings.json` is otherwise written at connect time only
80
+ * (writeOrMergeClaudeSettings, sole call site in connect scaffolding). Without
81
+ * this boot-cadence refresh, an already-connected repo would never receive the
82
+ * hook, and once the repo-root CLAUDE.md file carrier is withdrawn that repo
83
+ * would carry NO seed at all -- silently. This is the exact analog of
84
+ * `refreshMcpConfigsForProducts`: "connect seeds it once, this keeps it current
85
+ * on the daemon's update cadence." It walks `config.base.products` directly, so
86
+ * it reaches every product in the local daemon.json regardless of which
87
+ * workstation claims it; `telora-daemon update` re-execs, so an updating
88
+ * workstation necessarily runs this pass.
89
+ *
90
+ * CRITICAL ORDERING (runUnifiedDaemon): this MUST run BEFORE the CLAUDE.md
91
+ * retirement (`scaffoldProductsAtBoot`), so a workstation cannot reach the file
92
+ * withdrawal without having just installed the hook carrier in the same boot.
93
+ *
94
+ * Idempotent (writeOrMergeClaudeSettings no-writes when unchanged) and
95
+ * per-product best-effort: one repo's unwritable settings must not abort the rest.
96
+ */
97
+ export function refreshClaudeSettingsForProducts(config) {
98
+ const products = config.base.products ?? [];
99
+ if (products.length === 0)
100
+ return;
101
+ const io = bootIo();
102
+ for (const product of products) {
103
+ if (!product.repoPath)
104
+ continue;
105
+ try {
106
+ writeOrMergeClaudeSettings(product.repoPath, io);
107
+ }
108
+ catch (err) {
109
+ log.warn(`[settings-refresh] Failed for ${product.repoPath}: ${err instanceof Error ? err.message : String(err)}`);
110
+ }
111
+ }
112
+ }
113
+ // ---------------------------------------------------------------------------
114
+ // Product directory self-heal (CLAUDE.md seed + git-init)
115
+ // ---------------------------------------------------------------------------
116
+ /**
117
+ * Boot-time self-heal of every configured product's directory. Routes each
118
+ * product through the single idempotent `scaffoldProductDirectory` -- the exact
119
+ * same scaffolder the SIGHUP hot-reload handler calls for newly-added products
120
+ * -- so there is ONE scaffold implementation shared by both entry points.
121
+ *
122
+ * For each product this (idempotently):
123
+ * - Refreshes the delimited `<!-- BEGIN/END TELORA SEED -->` block in the
124
+ * repo's `CLAUDE.md` to the daemon's installed seed (the analog of
125
+ * `refreshMcpConfigsForProducts`: connect seeds it once, this keeps it
126
+ * current on the daemon's update cadence -- no write when already current,
127
+ * so an unchanged repo sees no git churn). productName is null to stay
128
+ * byte-identical with the connect-seeded block.
129
+ * - git-inits the directory when it has no repo (init, .gitignore, initial
130
+ * commit, integration branch) so the focus engine can create branches and
131
+ * worktrees. Skipped when a repo already exists (never clobbers).
132
+ *
133
+ * `telora-daemon update` is covered by construction: update re-execs the
134
+ * daemon, so this boot path runs again on the new version.
135
+ *
136
+ * All failures are per-product warnings (handled inside the scaffolder): one
137
+ * repo's unreadable/locked directory must not abort the daemon or the others.
138
+ */
139
+ export function scaffoldProductsAtBoot(config) {
140
+ const products = config.base.products ?? [];
141
+ if (products.length === 0)
142
+ return;
143
+ // Resolve the integration branch the same way buildFocusConfig does
144
+ // (env override -> focus section field -> default), without building the
145
+ // full focus config here.
146
+ const integrationBranch = resolveIntegrationBranch(config.focus.fields);
147
+ const io = bootIo();
148
+ for (const product of products) {
149
+ scaffoldProductDirectory(product, { integrationBranch }, io);
150
+ }
151
+ }
152
+ // ---------------------------------------------------------------------------
153
+ // AGENTS.md (Codex seed carriers) refresh
154
+ // ---------------------------------------------------------------------------
155
+ /**
156
+ * Boot-time self-heal for the Codex AGENTS.md seed carriers, on the daemon's
157
+ * update cadence. There are three destinations, all off the repo root and each
158
+ * refresh-only (a destination that does not already exist is skipped, so boot
159
+ * never spawns a carrier a workstation did not opt into):
160
+ *
161
+ * 1. The workstation-shared operator seed `~/.codex/AGENTS.md` (header-less) --
162
+ * read by an interactive operator and by daemon-spawned HOSTED Codex agents.
163
+ * 2. Each product's ISOLATED CODEX_HOME `~/.telora/codex/<productId>/AGENTS.md`
164
+ * (per-product header) -- read by daemon-spawned LOCAL-MODEL Codex agents.
165
+ * Refreshed only where the isolated home already exists (i.e. was
166
+ * provisioned for a local-model product); a hosted product has none and is
167
+ * skipped.
168
+ * 3. Repo-root `<repo>/AGENTS.md` for the IDE harnesses (Cursor / VS Code) that
169
+ * read it natively -- refresh-only, and the safe writer refuses to touch a
170
+ * repo-TRACKED file. Boot does NOT retire repo-root AGENTS.md: it cannot
171
+ * tell a legacy-Codex file apart from a live IDE one, and deleting the
172
+ * latter would strip a harness still using it. Repo-root retirement is done
173
+ * at connect / `harness add codex`, where the harness is known.
174
+ *
175
+ * Per-destination warnings on failure; one repo's unreadable AGENTS.md must not
176
+ * abort the rest.
177
+ */
178
+ export function refreshAgentsMdForProducts(config) {
179
+ const products = config.base.products ?? [];
180
+ if (products.length === 0)
181
+ return;
182
+ const teloraUrl = config.base.teloraUrl;
183
+ const organizationId = config.base.organizationId;
184
+ if (!teloraUrl || !organizationId)
185
+ return;
186
+ const io = bootIo();
187
+ // 1. Refresh the workstation-shared operator seed, if this workstation has one.
188
+ if (existsSync(globalAgentsMdPath())) {
189
+ try {
190
+ writeOrMergeGlobalAgentsMd(io);
191
+ }
192
+ catch (err) {
193
+ log.warn(`[agents-md-refresh] Global ~/.codex/AGENTS.md refresh failed: ${err instanceof Error ? err.message : String(err)}`);
194
+ }
195
+ }
196
+ for (const product of products) {
197
+ if (!product.id)
198
+ continue;
199
+ const inv = { productName: null, teloraUrl, organizationId, productId: product.id };
200
+ // 2. Refresh the per-product isolated-home seed, only where the isolated
201
+ // home already exists (provisioned for a local-model product).
202
+ if (existsSync(resolveProductCodexHome(product.id))) {
203
+ try {
204
+ writeProductCodexAgentsMd(inv, io);
205
+ }
206
+ catch (err) {
207
+ log.warn(`[agents-md-refresh] Isolated-home AGENTS.md refresh failed for ${product.id}: ${err instanceof Error ? err.message : String(err)}`);
208
+ }
209
+ }
210
+ // 3. Refresh (never create) repo-root AGENTS.md for IDE harnesses; the safe
211
+ // writer refuses to touch a repo-tracked file.
212
+ if (product.repoPath && existsSync(resolve(product.repoPath, 'AGENTS.md'))) {
213
+ try {
214
+ writeOrMergeAgentsMd(product.repoPath, inv, io);
215
+ }
216
+ catch (err) {
217
+ log.warn(`[agents-md-refresh] Failed for ${product.repoPath}: ${err instanceof Error ? err.message : String(err)}`);
218
+ }
219
+ }
220
+ }
221
+ }
222
+ //# sourceMappingURL=unified-shell-provisioning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unified-shell-provisioning.js","sourceRoot":"","sources":["../src/unified-shell-provisioning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EA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EAAE;YAAE,SAAS;QAC1B,MAAM,GAAG,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;QAEpF,yEAAyE;QACzE,kEAAkE;QAClE,IAAI,UAAU,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACpD,IAAI,CAAC;gBACH,yBAAyB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACrC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,GAAG,CAAC,IAAI,CACN,kEAAkE,OAAO,CAAC,EAAE,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACpI,CAAC;YACJ,CAAC;QACH,CAAC;QAED,4EAA4E;QAC5E,kDAAkD;QAClD,IAAI,OAAO,CAAC,QAAQ,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;YAC3E,IAAI,CAAC;gBACH,oBAAoB,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;YAClD,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,GAAG,CAAC,IAAI,CACN,kCAAkC,OAAO,CAAC,QAAQ,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC1G,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -25,47 +25,6 @@
25
25
  import { type UnifiedConfig } from '@telora/daemon-core';
26
26
  export type { UnifiedDaemonOptions } from './unified-shell-config.js';
27
27
  import type { UnifiedDaemonOptions } from './unified-shell-config.js';
28
- /**
29
- * Boot-time self-heal of every configured product's directory. Routes each
30
- * product through the single idempotent `scaffoldProductDirectory` -- the exact
31
- * same scaffolder the SIGHUP hot-reload handler calls for newly-added products
32
- * -- so there is ONE scaffold implementation shared by both entry points.
33
- *
34
- * For each product this (idempotently):
35
- * - Refreshes the delimited `<!-- BEGIN/END TELORA SEED -->` block in the
36
- * repo's `CLAUDE.md` to the daemon's installed seed (the analog of
37
- * `refreshMcpConfigsForProducts`: connect seeds it once, this keeps it
38
- * current on the daemon's update cadence -- no write when already current,
39
- * so an unchanged repo sees no git churn). productName is null to stay
40
- * byte-identical with the connect-seeded block.
41
- * - git-inits the directory when it has no repo (init, .gitignore, initial
42
- * commit, integration branch) so the focus engine can create branches and
43
- * worktrees. Skipped when a repo already exists (never clobbers).
44
- *
45
- * `telora-daemon update` is covered by construction: update re-execs the
46
- * daemon, so this boot path runs again on the new version.
47
- *
48
- * All failures are per-product warnings (handled inside the scaffolder): one
49
- * repo's unreadable/locked directory must not abort the daemon or the others.
50
- */
51
- export declare function scaffoldProductsAtBoot(config: UnifiedConfig): void;
52
- /**
53
- * Boot-time self-heal for the Codex operator seed: refresh the delimited
54
- * Telora block in each product repo's `AGENTS.md` -- the analog of the CLAUDE.md
55
- * seed refresh inside `scaffoldProductsAtBoot`, but for the Codex harness.
56
- *
57
- * Key difference from the CLAUDE.md refresh: this NEVER creates AGENTS.md where
58
- * it is absent. CLAUDE.md is seeded for every connected repo, so refreshing it
59
- * unconditionally is correct; AGENTS.md exists only for repos whose operator
60
- * connected with `--harness codex`. Creating one in a Claude repo would inject
61
- * an unwanted file, so we refresh only repos that already carry the block.
62
- *
63
- * The connection invariant (URL/org/product) is reconstructed from config;
64
- * productName is unknown here, so the block surfaces the product id (same
65
- * choice connect makes -- it seeds with productName null too). Per-product
66
- * warnings on failure; one repo's unreadable AGENTS.md must not abort the rest.
67
- */
68
- export declare function refreshAgentsMdForProducts(config: UnifiedConfig): void;
69
28
  /**
70
29
  * Start the OTLP telemetry capture pipeline: the buffered Postgres writer
71
30
  * (flush timer) and the OTLP HTTP receiver that spawned agent processes export
@@ -1 +1 @@
1
- {"version":3,"file":"unified-shell.d.ts","sourceRoot":"","sources":["../src/unified-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AAyC7B,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAmFtE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAkBlE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CA8BtE;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAydhF"}
1
+ {"version":3,"file":"unified-shell.d.ts","sourceRoot":"","sources":["../src/unified-shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,EACL,KAAK,aAAa,EAMnB,MAAM,qBAAqB,CAAC;AA2C7B,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AA2CtE;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkehF"}