@rryando/arcs 4.2.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/cli/arcs-flash.d.ts +1 -1
  2. package/dist/cli/arcs-flash.d.ts.map +1 -1
  3. package/dist/cli/arcs-flash.js +6 -4
  4. package/dist/cli/arcs-flash.js.map +1 -1
  5. package/dist/cli/arcs-orchestrate.d.ts +1 -1
  6. package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
  7. package/dist/cli/arcs-orchestrate.js +4 -2
  8. package/dist/cli/arcs-orchestrate.js.map +1 -1
  9. package/dist/cli/commands/index.d.ts +1 -0
  10. package/dist/cli/commands/index.d.ts.map +1 -1
  11. package/dist/cli/commands/index.js +1 -0
  12. package/dist/cli/commands/index.js.map +1 -1
  13. package/dist/cli/commands/proposal-doc.js +3 -2
  14. package/dist/cli/commands/proposal-doc.js.map +1 -1
  15. package/dist/cli/dag-commands.d.ts +9 -0
  16. package/dist/cli/dag-commands.d.ts.map +1 -1
  17. package/dist/cli/dag-commands.js +35 -25
  18. package/dist/cli/dag-commands.js.map +1 -1
  19. package/dist/cli/index.d.ts.map +1 -1
  20. package/dist/cli/index.js +12 -23
  21. package/dist/cli/index.js.map +1 -1
  22. package/dist/cli/orchestrator-shared-blocks.d.ts +5 -4
  23. package/dist/cli/orchestrator-shared-blocks.d.ts.map +1 -1
  24. package/dist/cli/orchestrator-shared-blocks.js +32 -19
  25. package/dist/cli/orchestrator-shared-blocks.js.map +1 -1
  26. package/dist/web-client/assets/{GraphCanvas-Dw6EcoDb.js → GraphCanvas-BYZE4sO9.js} +1 -1
  27. package/dist/web-client/assets/{MarkdownEditor-Cz5_44Ej.js → MarkdownEditor-BKx6M1cw.js} +1 -1
  28. package/dist/web-client/assets/{abnfDiagram-VRR7QNED-CFJzLuew.js → abnfDiagram-VRR7QNED-D4kt0l2y.js} +1 -1
  29. package/dist/web-client/assets/architecture-TIHT7OUA-CIdGE6VO.js +1 -0
  30. package/dist/web-client/assets/{architectureDiagram-ZJ3FMSHR-FRlSgnnW.js → architectureDiagram-ZJ3FMSHR-bu29SJFS.js} +1 -1
  31. package/dist/web-client/assets/{blockDiagram-677ZJIJ3-WUkkunPZ.js → blockDiagram-677ZJIJ3-hsu7mXKw.js} +1 -1
  32. package/dist/web-client/assets/{c4Diagram-LMCZKHZV-BKeAsL6F.js → c4Diagram-LMCZKHZV-DMllRlT_.js} +1 -1
  33. package/dist/web-client/assets/channel-CBg-s-ZD.js +1 -0
  34. package/dist/web-client/assets/{chunk-32BRIVSS-B0b9kUcF.js → chunk-32BRIVSS-BSzwj5eM.js} +1 -1
  35. package/dist/web-client/assets/{chunk-52WLFC77-i6Y-vfL3.js → chunk-52WLFC77-RDdZn6yY.js} +1 -1
  36. package/dist/web-client/assets/{chunk-C7G6YPKG-atYWm6iP.js → chunk-C7G6YPKG-DQr--txT.js} +1 -1
  37. package/dist/web-client/assets/{chunk-EX3LRPZG-CZD6y0UU.js → chunk-EX3LRPZG-Bb8nc4z4.js} +1 -1
  38. package/dist/web-client/assets/{chunk-FWX5IMBZ-CVErR-UZ.js → chunk-FWX5IMBZ-QvBpOcOg.js} +2 -2
  39. package/dist/web-client/assets/{chunk-HOUHSVGY-BlHO2iQ3.js → chunk-HOUHSVGY-B0mX_yjc.js} +1 -1
  40. package/dist/web-client/assets/{chunk-ICXQ74PX-Ar8kfXfa.js → chunk-ICXQ74PX-BmJSQqOH.js} +1 -1
  41. package/dist/web-client/assets/{chunk-MOJQB5TN-DKrK867P.js → chunk-MOJQB5TN-BrEI4GGn.js} +1 -1
  42. package/dist/web-client/assets/{chunk-OGEWGWER-BmGykUeg.js → chunk-OGEWGWER-CrqDPOWP.js} +1 -1
  43. package/dist/web-client/assets/{chunk-PUDLZKDR-Bq23pnso.js → chunk-PUDLZKDR-DfPKldpG.js} +1 -1
  44. package/dist/web-client/assets/{chunk-Q4XR5HBZ-g15qvFAN.js → chunk-Q4XR5HBZ-ekATI9aV.js} +1 -1
  45. package/dist/web-client/assets/{chunk-V7JOEXUC-uyXA7S9r.js → chunk-V7JOEXUC-C5APsP1t.js} +1 -1
  46. package/dist/web-client/assets/{chunk-VAUOI2AC-WofZ-2M0.js → chunk-VAUOI2AC-BhfSWJZI.js} +1 -1
  47. package/dist/web-client/assets/{chunk-VR4S4FIN-DtTkK86v.js → chunk-VR4S4FIN-BGa-44J7.js} +1 -1
  48. package/dist/web-client/assets/{chunk-WYO6CB5R-zVyUwJq3.js → chunk-WYO6CB5R-By1K0guW.js} +1 -1
  49. package/dist/web-client/assets/{chunk-ZGVPDNZ5-CA1Oe3TK.js → chunk-ZGVPDNZ5-Vnzpc76F.js} +1 -1
  50. package/dist/web-client/assets/classDiagram-OUVF2IWQ-ciwDjhUR.js +1 -0
  51. package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-ciwDjhUR.js +1 -0
  52. package/dist/web-client/assets/{cynefin-VYW2F7L2-ivJY1h_9.js → cynefin-VYW2F7L2-C6MOMOOz.js} +1 -1
  53. package/dist/web-client/assets/{cynefinDiagram-TSTJHNR4-D2DstShq.js → cynefinDiagram-TSTJHNR4-Cseyu79b.js} +1 -1
  54. package/dist/web-client/assets/{dagre-VKFMJZFB-CwnMRy0K.js → dagre-VKFMJZFB-CQJlIuNh.js} +1 -1
  55. package/dist/web-client/assets/{diagram-FQU43EPY-BKJv6Cvw.js → diagram-FQU43EPY-DpqDxhq4.js} +1 -1
  56. package/dist/web-client/assets/{diagram-G47NLZAW-CwCXcgU5.js → diagram-G47NLZAW-C11fYYaF.js} +1 -1
  57. package/dist/web-client/assets/{diagram-NH7WQ7WH-CkghU1-6.js → diagram-NH7WQ7WH-BiG-uRAF.js} +1 -1
  58. package/dist/web-client/assets/{diagram-OA4YK3LP-D3siQIGu.js → diagram-OA4YK3LP-CIXWWjq-.js} +1 -1
  59. package/dist/web-client/assets/{diagram-WEI45ONY-CSs9xTBn.js → diagram-WEI45ONY-C3OgIWu9.js} +1 -1
  60. package/dist/web-client/assets/{ebnfDiagram-CCIWWBDH--i52vMiv.js → ebnfDiagram-CCIWWBDH-BHF_NA3_.js} +1 -1
  61. package/dist/web-client/assets/{erDiagram-Q63AITRT-q2hgOBY1.js → erDiagram-Q63AITRT-CUOJCrLy.js} +1 -1
  62. package/dist/web-client/assets/eventmodeling-45OFAUF4-DxfboL1J.js +1 -0
  63. package/dist/web-client/assets/flowDiagram-23GEKE2U-C3NzpTtI.js +1 -0
  64. package/dist/web-client/assets/{ganttDiagram-NO4QXBWP-BZ2rBbTe.js → ganttDiagram-NO4QXBWP-D_4BMJ-g.js} +1 -1
  65. package/dist/web-client/assets/{gitGraph-TEB2WS4Q-OnJ8tHgt.js → gitGraph-TEB2WS4Q-CBuaZBId.js} +1 -1
  66. package/dist/web-client/assets/{gitGraphDiagram-IHSO6WYX-CPNExFAr.js → gitGraphDiagram-IHSO6WYX-BbztsGuO.js} +1 -1
  67. package/dist/web-client/assets/index-B1KVIr80.css +2 -0
  68. package/dist/web-client/assets/{index-DCBn-YrR.js → index-BWd2fBNL.js} +38 -38
  69. package/dist/web-client/assets/{info-DKCQHKI2-DGuJbmdY.js → info-DKCQHKI2-Bzi0Xjro.js} +1 -1
  70. package/dist/web-client/assets/{infoDiagram-FWYZ7A6U-ADIAn-P5.js → infoDiagram-FWYZ7A6U-BkeEKcr0.js} +1 -1
  71. package/dist/web-client/assets/{ishikawaDiagram-FXEZZL3T-CUx-RGfg.js → ishikawaDiagram-FXEZZL3T-CVusWu0p.js} +1 -1
  72. package/dist/web-client/assets/{journeyDiagram-5HDEW3XC-BH7-tBBy.js → journeyDiagram-5HDEW3XC-BUxu71zw.js} +1 -1
  73. package/dist/web-client/assets/{kanban-definition-HUTT4EX6-BGEXBnI2.js → kanban-definition-HUTT4EX6-BE8Hv4Kd.js} +1 -1
  74. package/dist/web-client/assets/{line-CC-5ezU8.js → line-CiAoINJS.js} +1 -1
  75. package/dist/web-client/assets/{mermaid-parser.core-Dw18Fjbq.js → mermaid-parser.core-BW47khiS.js} +3 -3
  76. package/dist/web-client/assets/{mermaid.core-CMQBgE43.js → mermaid.core-DP--Jl9R.js} +3 -3
  77. package/dist/web-client/assets/{mindmap-definition-LN4V7U3C-CGtjw8tB.js → mindmap-definition-LN4V7U3C-CvWJUqdq.js} +1 -1
  78. package/dist/web-client/assets/{packet-7NZHBO7P-w71Y4Hzd.js → packet-7NZHBO7P-XtzX9SaQ.js} +1 -1
  79. package/dist/web-client/assets/{pegDiagram-2B236MQR-DWtfEm4T.js → pegDiagram-2B236MQR-XNo0K1ct.js} +1 -1
  80. package/dist/web-client/assets/{pie-RZYD4A2V-S9ztgnWs.js → pie-RZYD4A2V-B1eUd9yt.js} +1 -1
  81. package/dist/web-client/assets/{pieDiagram-ENE6RG2P-BWZQPN4m.js → pieDiagram-ENE6RG2P-CRSb5z-4.js} +1 -1
  82. package/dist/web-client/assets/{quadrantDiagram-ABIIQ3AL-DINDwblH.js → quadrantDiagram-ABIIQ3AL-DziMaQxE.js} +1 -1
  83. package/dist/web-client/assets/{radar-I7S5WNFK-BOGl9krB.js → radar-I7S5WNFK-BpRqZH2g.js} +1 -1
  84. package/dist/web-client/assets/{railroad-3IZDKUUU-CR9kuYSZ.js → railroad-3IZDKUUU-FDIHW04k.js} +1 -1
  85. package/dist/web-client/assets/railroad-abnf-AHOZXSZD-BKj6JAhH.js +1 -0
  86. package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-ChDM1OBv.js +1 -0
  87. package/dist/web-client/assets/railroad-peg-LSFZ7HO6-DvwA2e0i.js +1 -0
  88. package/dist/web-client/assets/{railroadDiagram-RFXS5EU6-byLCs9hp.js → railroadDiagram-RFXS5EU6-Cs7EVBaz.js} +1 -1
  89. package/dist/web-client/assets/{requirementDiagram-TGXJPOKE-Dn_FtbqW.js → requirementDiagram-TGXJPOKE-B9_Lj1ga.js} +1 -1
  90. package/dist/web-client/assets/{sankeyDiagram-HTMAVEWB-DUjRrCeC.js → sankeyDiagram-HTMAVEWB-DuTJTiy0.js} +1 -1
  91. package/dist/web-client/assets/{sequenceDiagram-DBY2YBRQ-BmBz8Wpq.js → sequenceDiagram-DBY2YBRQ-vOCU5UoE.js} +1 -1
  92. package/dist/web-client/assets/{stateDiagram-2N3HPSRC-BAYHjmqB.js → stateDiagram-2N3HPSRC-rxAnfzWn.js} +1 -1
  93. package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-B3EvQPEe.js +1 -0
  94. package/dist/web-client/assets/{swimlanes-5IMT3BWC-Bm942AR-.js → swimlanes-5IMT3BWC-gdVZUnPe.js} +1 -1
  95. package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-WcOXuCPg.js +8 -0
  96. package/dist/web-client/assets/{timeline-definition-FHXFAJF6-CHAZHhQk.js → timeline-definition-FHXFAJF6-Do68JyGy.js} +1 -1
  97. package/dist/web-client/assets/{treeView-QDETBFTQ-DHHkLsSy.js → treeView-QDETBFTQ-CdZkmg80.js} +1 -1
  98. package/dist/web-client/assets/{treemap-6X3UGDF4-BUxZ8fhY.js → treemap-6X3UGDF4-ub54fmpW.js} +1 -1
  99. package/dist/web-client/assets/{vennDiagram-L72KCM5P-BL9TRcUU.js → vennDiagram-L72KCM5P-D-r8NBEp.js} +1 -1
  100. package/dist/web-client/assets/{wardley-OPB4EBWU-CfJ5mO-y.js → wardley-OPB4EBWU-CTleH1-J.js} +1 -1
  101. package/dist/web-client/assets/{wardleyDiagram-EHGQE667-BlH1TSjy.js → wardleyDiagram-EHGQE667-BU8Kw39F.js} +1 -1
  102. package/dist/web-client/assets/{xychartDiagram-FW5EYKEG-BJN6wtrV.js → xychartDiagram-FW5EYKEG-CfNnag6i.js} +1 -1
  103. package/dist/web-client/index.html +2 -2
  104. package/dist/web-server/routes/sessions.js +43 -2
  105. package/dist/web-server/routes/sessions.js.map +1 -1
  106. package/opencode/arcs/bundle-runtime.json +3 -0
  107. package/opencode/arcs/prompts/arcs-flash.txt +33 -19
  108. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +34 -20
  109. package/opencode/arcs/prompts/arcs-orchestrate.txt +34 -20
  110. package/opencode/arcs/skills/writing-proposals/SKILL.md +90 -0
  111. package/package.json +1 -1
  112. package/dist/cli/commands/hooks.d.ts +0 -76
  113. package/dist/cli/commands/hooks.d.ts.map +0 -1
  114. package/dist/cli/commands/hooks.js +0 -436
  115. package/dist/cli/commands/hooks.js.map +0 -1
  116. package/dist/utils/claude-code-hook-install.d.ts +0 -80
  117. package/dist/utils/claude-code-hook-install.d.ts.map +0 -1
  118. package/dist/utils/claude-code-hook-install.js +0 -212
  119. package/dist/utils/claude-code-hook-install.js.map +0 -1
  120. package/dist/utils/graphify-knowledge.d.ts +0 -22
  121. package/dist/utils/graphify-knowledge.d.ts.map +0 -1
  122. package/dist/utils/graphify-knowledge.js +0 -47
  123. package/dist/utils/graphify-knowledge.js.map +0 -1
  124. package/dist/utils/graphify.d.ts +0 -104
  125. package/dist/utils/graphify.d.ts.map +0 -1
  126. package/dist/utils/graphify.js +0 -439
  127. package/dist/utils/graphify.js.map +0 -1
  128. package/dist/utils/hook-contract.d.ts +0 -36
  129. package/dist/utils/hook-contract.d.ts.map +0 -1
  130. package/dist/utils/hook-contract.js +0 -35
  131. package/dist/utils/hook-contract.js.map +0 -1
  132. package/dist/utils/hook-token-store.d.ts +0 -63
  133. package/dist/utils/hook-token-store.d.ts.map +0 -1
  134. package/dist/utils/hook-token-store.js +0 -88
  135. package/dist/utils/hook-token-store.js.map +0 -1
  136. package/dist/web-client/assets/architecture-TIHT7OUA-CoHvhex9.js +0 -1
  137. package/dist/web-client/assets/channel-D8xMXC5_.js +0 -1
  138. package/dist/web-client/assets/classDiagram-OUVF2IWQ-Doj1_hvZ.js +0 -1
  139. package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-Doj1_hvZ.js +0 -1
  140. package/dist/web-client/assets/eventmodeling-45OFAUF4-ESVuFkJJ.js +0 -1
  141. package/dist/web-client/assets/flowDiagram-23GEKE2U-DN9SdR9f.js +0 -1
  142. package/dist/web-client/assets/index-wSzUPvml.css +0 -2
  143. package/dist/web-client/assets/railroad-abnf-AHOZXSZD-BvbCHrlR.js +0 -1
  144. package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-D869lbCL.js +0 -1
  145. package/dist/web-client/assets/railroad-peg-LSFZ7HO6-r4TXaJPI.js +0 -1
  146. package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-Bl-1K1zV.js +0 -1
  147. package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-DHU7bsfA.js +0 -8
  148. package/dist/web-server/hook-auth.d.ts +0 -12
  149. package/dist/web-server/hook-auth.d.ts.map +0 -1
  150. package/dist/web-server/hook-auth.js +0 -36
  151. package/dist/web-server/hook-auth.js.map +0 -1
  152. package/dist/web-server/opencode-client.d.ts +0 -123
  153. package/dist/web-server/opencode-client.d.ts.map +0 -1
  154. package/dist/web-server/opencode-client.js +0 -514
  155. package/dist/web-server/opencode-client.js.map +0 -1
  156. package/dist/web-server/routes/hook-events.d.ts +0 -43
  157. package/dist/web-server/routes/hook-events.d.ts.map +0 -1
  158. package/dist/web-server/routes/hook-events.js +0 -316
  159. package/dist/web-server/routes/hook-events.js.map +0 -1
@@ -1,212 +0,0 @@
1
- /**
2
- * Consent-gated writer for the Claude Code session-bridge hook.
3
- *
4
- * `arcs hooks install-claude-code` deliberately never edits agent configuration
5
- * — it prints a snippet. This module is the opt-in counterpart: when the user
6
- * explicitly confirms during `arcs project init`, it merges the same hook entry
7
- * into the workspace's `.claude/settings.local.json` (local-only: the token is a
8
- * secret and `settings.local.json` is the git-ignored variant).
9
- *
10
- * Two rules the merge must never break:
11
- * 1. A malformed existing file ABORTS the write. Silently coalescing an
12
- * unparseable settings file to `{}` would destroy a user's `permissions`
13
- * block over a stray comma, so parse errors are surfaced, not swallowed.
14
- * 2. Replacement is keyed on the absolute hook script path, not the project
15
- * slug. A workspace can be reassigned between ARCS projects, so matching on
16
- * the script path leaves exactly one current ARCS entry per event instead
17
- * of accumulating stale ones. Entries belonging to other tools are kept
18
- * untouched, in place.
19
- */
20
- import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
21
- import { dirname, join } from "node:path";
22
- import * as p from "@clack/prompts";
23
- import color from "picocolors";
24
- import { HOOK_EVENTS, provisionHookCommand } from "../cli/commands/hooks.js";
25
- /** The only file this module ever writes — never `~/.claude/settings.json`. */
26
- export function claudeSettingsLocalPath(workspacePath) {
27
- return join(workspacePath, ".claude", "settings.local.json");
28
- }
29
- /**
30
- * `chmod` that tolerates an absent file and nothing else.
31
- *
32
- * Used to narrow a settings file BEFORE it is rewritten, where "there is no
33
- * file yet" is the ordinary fresh-install outcome and not a failure — the
34
- * write's own `mode` covers that path. Every other errno (EPERM on a file this
35
- * user does not own, EROFS) means the mode of a token-bearing file is not ours
36
- * to set, so it propagates and fails the install closed, exactly as the
37
- * trailing chmod does.
38
- */
39
- async function chmodIfPresent(path, mode) {
40
- try {
41
- await chmod(path, mode);
42
- }
43
- catch (err) {
44
- if (err?.code !== "ENOENT")
45
- throw err;
46
- }
47
- }
48
- /**
49
- * Returns a copy of `settings` with the ARCS hook entry registered under every
50
- * hook event, replacing any prior entry that runs the same `hookScriptPath`.
51
- * Pure — no I/O, so the merge rules are directly testable.
52
- */
53
- export function mergeHookIntoSettings(settings, hook) {
54
- const hooks = { ...(settings.hooks ?? {}) };
55
- for (const event of HOOK_EVENTS) {
56
- const existing = Array.isArray(hooks[event]) ? hooks[event] : [];
57
- const preserved = [];
58
- for (const entry of existing) {
59
- if (!entry || typeof entry !== "object" || !Array.isArray(entry.hooks)) {
60
- // Not a shape we understand — leave it exactly as found.
61
- preserved.push(entry);
62
- continue;
63
- }
64
- // Strip only OUR command, at the inner level: a matcher entry may mix an
65
- // ARCS hook with another tool's, and that other tool must survive.
66
- const kept = entry.hooks.filter((h) => !(typeof h?.command === "string" && h.command.includes(hook.hookScriptPath)));
67
- if (kept.length === 0)
68
- continue;
69
- preserved.push({ ...entry, hooks: kept });
70
- }
71
- preserved.push({ hooks: [{ type: "command", command: hook.command }] });
72
- hooks[event] = preserved;
73
- }
74
- return { ...settings, hooks };
75
- }
76
- /**
77
- * Reads the workspace's `.claude/settings.local.json` (if any), merges in a
78
- * freshly provisioned hook, and writes it back owner-only.
79
- *
80
- * Throws when the existing file is present but unparseable — nothing is written
81
- * in that case, so a hand-edited settings file is never clobbered.
82
- */
83
- export async function installClaudeCodeHook(options) {
84
- const settingsPath = claudeSettingsLocalPath(options.workspacePath);
85
- let raw;
86
- try {
87
- raw = await readFile(settingsPath, "utf-8");
88
- }
89
- catch {
90
- // Absent file — start from an empty settings object.
91
- }
92
- let settings = {};
93
- if (raw !== undefined && raw.trim().length > 0) {
94
- let parsed;
95
- try {
96
- parsed = JSON.parse(raw);
97
- }
98
- catch {
99
- throw new Error(`${settingsPath} exists but is not valid JSON — fix it manually or delete it, ` +
100
- `then re-run \`arcs hooks install-claude-code ${options.slug}\`. Nothing was written.`);
101
- }
102
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
103
- throw new Error(`${settingsPath} is valid JSON but not an object — fix it manually or delete it, ` +
104
- `then re-run \`arcs hooks install-claude-code ${options.slug}\`. Nothing was written.`);
105
- }
106
- settings = parsed;
107
- }
108
- const provisioned = await provisionHookCommand({
109
- projectDir: options.projectDir,
110
- slug: options.slug,
111
- serverUrl: options.serverUrl,
112
- });
113
- const merged = mergeHookIntoSettings(settings, provisioned);
114
- await mkdir(dirname(settingsPath), { recursive: true });
115
- // The merged command embeds `ARCS_HOOK_TOKEN=<value>`, so this file is a
116
- // SECOND cleartext copy of the hook token — this one in the user's repo
117
- // rather than under ARCS's own data dir. It is narrowed in three steps
118
- // because no one of them covers both the fresh and the repair path:
119
- //
120
- // 1. chmod BEFORE the write, best-effort. `writeFile` is a direct,
121
- // non-atomic open(path, "w", mode): when the file already exists the
122
- // `mode` argument is a no-op and the open merely truncates the inode
123
- // that is there, so without this step the freshly minted token would be
124
- // written into a still-0644 inode and sit world-readable for the write
125
- // plus an await hop. ENOENT is ignored (see chmodIfPresent) because on a
126
- // fresh install there is nothing to narrow yet. This runs AFTER the
127
- // strict parse above, so a file that aborts the install keeps its mode
128
- // as well as its bytes.
129
- // 2. `mode` on the write itself. It applies only when the open CREATES the
130
- // inode — which is precisely the fresh path, where it means the inode is
131
- // 0600 before the token's first byte reaches it and step 1 had nothing
132
- // to do. (That create-only caveat is exactly the one that does NOT apply
133
- // to the token store's temp+rename writer, where every write installs a
134
- // fresh inode — it bites squarely here.)
135
- // 3. chmod after the write, unconditional. Steps 1 and 2 are each a claim
136
- // about how THIS writer behaves — one assumes the inode survives the
137
- // write, the other that the write creates it. Step 3 assumes nothing, so
138
- // "0600 when this function returns" is a postcondition rather than an
139
- // inference from the writer's syscalls.
140
- //
141
- // What this buys, stated honestly: 0o600 is a cross-user control. It does
142
- // nothing against a process running as THIS user, and it does not hide the
143
- // token from `ps` — the value is inlined in the hook command string, so every
144
- // hook fire still exposes it in the process table. Handing the hook a path
145
- // (`ARCS_HOOK_TOKEN_FILE=<path>`) instead of the value would close that; the
146
- // mode only closes the on-disk half. Nor can any mode revoke a descriptor
147
- // another account already opened on a 0644 file: the write edits that same
148
- // inode in place, so such a reader follows the file into the new token. All
149
- // three steps are a floor from this point forward, not a retraction of what
150
- // was reachable before.
151
- //
152
- // The `.claude` DIRECTORY is deliberately left exactly as found. Unlike the
153
- // hooks dir under ARCS's data dir, which holds nothing but the token, this
154
- // one holds the user's other Claude Code files, and narrowing it would be a
155
- // hostile surprise in a directory ARCS does not own.
156
- await chmodIfPresent(settingsPath, 0o600);
157
- await writeFile(settingsPath, `${JSON.stringify(merged, null, 2)}\n`, {
158
- encoding: "utf-8",
159
- mode: 0o600,
160
- });
161
- await chmod(settingsPath, 0o600);
162
- return {
163
- settingsPath,
164
- token: provisioned.token,
165
- hookScriptPath: provisioned.hookScriptPath,
166
- serverUrl: provisioned.serverUrl,
167
- events: [...HOOK_EVENTS],
168
- };
169
- }
170
- /**
171
- * Interactively offers the hook install during `arcs project init`.
172
- *
173
- * Mirrors `promptAndInstallCodegraph`: a note explaining the offer, a confirm
174
- * defaulting to "no", and a manual-fallback hint when declined. Returns the
175
- * install result only when a write actually happened; returns `null` on
176
- * decline, cancel, or failure. Never throws — `arcs project init` succeeding
177
- * matters more than this offer succeeding.
178
- */
179
- export async function promptAndInstallClaudeCodeHook(options) {
180
- const settingsPath = claudeSettingsLocalPath(options.workspacePath);
181
- p.note([
182
- "The session-bridge hook lets ARCS discover your Claude Code sessions,",
183
- "stage project context at session start, and mirror transcripts — the",
184
- "web UI drives work by forking a session into a new ARCS thread.",
185
- "",
186
- `Writes ${color.cyan(settingsPath)} only — never your global config.`,
187
- ].join("\n"), "Optional: Claude Code session bridge");
188
- const shouldInstall = await p.confirm({
189
- message: "Install the Claude Code session-bridge hook now?",
190
- initialValue: false,
191
- });
192
- if (p.isCancel(shouldInstall) || !shouldInstall) {
193
- p.log.info(color.dim(`Install later: arcs hooks install-claude-code ${options.slug}`));
194
- return null;
195
- }
196
- try {
197
- const result = await installClaudeCodeHook(options);
198
- p.log.success([
199
- `${color.green("✔")} Hook installed → ${color.cyan(result.settingsPath)}`,
200
- color.dim("Start a NEW Claude Code session to pick it up — running sessions won't."),
201
- ].join("\n"));
202
- return result;
203
- }
204
- catch (err) {
205
- p.log.warn([
206
- `${color.yellow("⚠")} Could not install the hook: ${err instanceof Error ? err.message : String(err)}`,
207
- color.dim(`Install manually later: arcs hooks install-claude-code ${options.slug}`),
208
- ].join("\n"));
209
- return null;
210
- }
211
- }
212
- //# sourceMappingURL=claude-code-hook-install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-code-hook-install.js","sourceRoot":"","sources":["../../src/utils/claude-code-hook-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,E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G,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kDAAkD,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC,CAAC,GAAG,CAAC,OAAO,CACX;YACE,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;YACzE,KAAK,CAAC,GAAG,CAAC,yEAAyE,CAAC;SACrF,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,CAAC,CAAC,GAAG,CAAC,IAAI,CACR;YACE,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,gCAAgC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YACtG,KAAK,CAAC,GAAG,CAAC,2DAA2D,OAAO,CAAC,IAAI,EAAE,CAAC;SACrF,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { KnowledgeProposal } from "./graphify.js";
2
- /**
3
- * Convert graphify ingestion output into a `proposals/graphify.json` payload
4
- * and persist it through `proposal-store.writeProposals()`.
5
- *
6
- * Replaces the legacy direct-write path that used to populate
7
- * `knowledge/index.json` and `knowledge/<id>.md` at ingest time. Graphify
8
- * proposals now sit in the proposals gate until a skill-aware host enriches
9
- * them into durable knowledge entries.
10
- *
11
- * Merge semantics: if a proposals file already exists, proposals from the
12
- * existing file with ids NOT present in the new extraction are preserved.
13
- * This protects backfilled proposals (with empty structuralFacts) and any
14
- * other pending entries from being clobbered when graphify re-runs. The new
15
- * extraction wins on collisions — a fresh extraction produces fresher facts.
16
- */
17
- export declare function writeProposalsFile(slug: string, proposals: KnowledgeProposal[], graphJsonContent: string): Promise<{
18
- written: number;
19
- fingerprint: string;
20
- preserved: number;
21
- }>;
22
- //# sourceMappingURL=graphify-knowledge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphify-knowledge.d.ts","sourceRoot":"","sources":["../../src/utils/graphify-knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUvD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,iBAAiB,EAAE,EAC9B,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAmCtE"}
@@ -1,47 +0,0 @@
1
- import { annotateDedupCandidates, computeGraphFingerprint, readProposals, writeProposals, } from "./proposal-store.js";
2
- /**
3
- * Convert graphify ingestion output into a `proposals/graphify.json` payload
4
- * and persist it through `proposal-store.writeProposals()`.
5
- *
6
- * Replaces the legacy direct-write path that used to populate
7
- * `knowledge/index.json` and `knowledge/<id>.md` at ingest time. Graphify
8
- * proposals now sit in the proposals gate until a skill-aware host enriches
9
- * them into durable knowledge entries.
10
- *
11
- * Merge semantics: if a proposals file already exists, proposals from the
12
- * existing file with ids NOT present in the new extraction are preserved.
13
- * This protects backfilled proposals (with empty structuralFacts) and any
14
- * other pending entries from being clobbered when graphify re-runs. The new
15
- * extraction wins on collisions — a fresh extraction produces fresher facts.
16
- */
17
- export async function writeProposalsFile(slug, proposals, graphJsonContent) {
18
- // Map ingestion shape → storage shape. The storage `Proposal` adds an
19
- // initially-empty `suggestedDedupCandidates`; `annotateDedupCandidates`
20
- // populates it from the existing knowledge index.
21
- const draft = proposals.map((p) => ({
22
- id: p.id,
23
- kind: p.kind,
24
- label: p.label,
25
- structuralFacts: p.structuralFacts,
26
- sourceFiles: p.sourceFiles,
27
- suggestedDedupCandidates: [],
28
- }));
29
- const annotated = await annotateDedupCandidates(slug, draft);
30
- // Preserve existing proposals not present in the new extraction. This
31
- // protects the lossy backfill payload (structuralFacts: {}) and any other
32
- // pending agent-enrichment work from being silently dropped on the next
33
- // graphify-sync. New extraction wins on id collisions.
34
- const existing = await readProposals(slug);
35
- const newIds = new Set(annotated.map((p) => p.id));
36
- const preserved = existing ? existing.proposals.filter((p) => !newIds.has(p.id)) : [];
37
- const fingerprint = computeGraphFingerprint(graphJsonContent);
38
- const payload = {
39
- version: 1,
40
- generatedAt: new Date().toISOString(),
41
- graphFingerprint: fingerprint,
42
- proposals: [...annotated, ...preserved],
43
- };
44
- await writeProposals(slug, payload);
45
- return { written: proposals.length, fingerprint, preserved: preserved.length };
46
- }
47
- //# sourceMappingURL=graphify-knowledge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphify-knowledge.js","sourceRoot":"","sources":["../../src/utils/graphify-knowledge.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAGvB,aAAa,EACb,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY,EACZ,SAA8B,EAC9B,gBAAwB;IAExB,sEAAsE;IACtE,wEAAwE;IACxE,kDAAkD;IAClD,MAAM,KAAK,GAAe,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,eAAe,EAAE,CAAC,CAAC,eAAqD;QACxE,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,wBAAwB,EAAE,EAAE;KAC7B,CAAC,CAAC,CAAC;IAEJ,MAAM,SAAS,GAAG,MAAM,uBAAuB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE7D,sEAAsE;IACtE,0EAA0E;IAC1E,wEAAwE;IACxE,uDAAuD;IACvD,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtF,MAAM,WAAW,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAkB;QAC7B,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,gBAAgB,EAAE,WAAW;QAC7B,SAAS,EAAE,CAAC,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC;KACxC,CAAC;IAEF,MAAM,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEpC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;AACjF,CAAC"}
@@ -1,104 +0,0 @@
1
- export interface GraphifyInfo {
2
- available: boolean;
3
- version?: string;
4
- path?: string;
5
- }
6
- export declare function detectGraphify(): GraphifyInfo;
7
- export interface ExtractionResult {
8
- success: true;
9
- graphJsonPath: string;
10
- }
11
- export interface ExtractionError {
12
- success: false;
13
- error: string;
14
- code?: string;
15
- }
16
- export type ExtractionOutcome = ExtractionResult | ExtractionError;
17
- /**
18
- * A graphify-derived knowledge proposal.
19
- *
20
- * Carries STRUCTURAL FACTS only — not prose. The calling agent (which has LLM
21
- * tokens) is responsible for producing the final `title`/`summary`/`keywords`
22
- * during the proposal-promote step. See plan
23
- * `2026-06-02-graphify-proposal-gate-implementation-plan` §Proposal Shape.
24
- *
25
- * `suggestedDedupCandidates` is intentionally NOT on this type — that's
26
- * computed by the proposal-store layer when proposals are written to disk,
27
- * not at ingest time.
28
- */
29
- export interface KnowledgeProposal {
30
- /** Stable id, e.g. "graphify-cluster-src-utils". */
31
- id: string;
32
- kind: "architecture" | "module" | "gotcha" | "pattern";
33
- /** Human-friendly label. Agents will write the final title. */
34
- label: string;
35
- structuralFacts: ProposalStructuralFacts;
36
- sourceFiles: Array<{
37
- path: string;
38
- anchor?: string;
39
- }>;
40
- }
41
- export interface ProposalStructuralFacts {
42
- memberCount?: number;
43
- fileCount?: number;
44
- /** e.g. { code: 260, document: 0 } */
45
- fileTypeBreakdown?: Record<string, number>;
46
- topHubs?: Array<{
47
- label: string;
48
- file: string;
49
- in: number;
50
- out: number;
51
- }>;
52
- topFilesByEntityCount?: Array<{
53
- file: string;
54
- count: number;
55
- }>;
56
- incomingFromOtherClusters?: number;
57
- outgoingToOtherClusters?: number;
58
- nodeFile?: string;
59
- nodeIn?: number;
60
- nodeOut?: number;
61
- topCallers?: Array<{
62
- label: string;
63
- file: string;
64
- }>;
65
- topCallees?: Array<{
66
- label: string;
67
- file: string;
68
- }>;
69
- couplingA?: {
70
- label: string;
71
- file: string;
72
- degree: number;
73
- };
74
- couplingB?: {
75
- label: string;
76
- file: string;
77
- degree: number;
78
- };
79
- /** Edge relation types (e.g. ["imports_from", "calls"]). */
80
- relations?: string[];
81
- }
82
- export interface IngestionResult {
83
- proposals: KnowledgeProposal[];
84
- stats: {
85
- godNodes: number;
86
- communities: number;
87
- crossModuleCouplings: number;
88
- totalProposals: number;
89
- };
90
- }
91
- export declare function ingestGraph(graphJsonPath: string, _slug: string): IngestionResult;
92
- export interface QueryResult {
93
- success: true;
94
- answer: string;
95
- }
96
- export interface QueryError {
97
- success: false;
98
- error: string;
99
- }
100
- export type QueryOutcome = QueryResult | QueryError;
101
- export declare function queryGraph(question: string, workspacePath: string): QueryOutcome;
102
- export declare function pathBetween(entityA: string, entityB: string, workspacePath: string): QueryOutcome;
103
- export declare function runExtraction(workspacePath: string): ExtractionOutcome;
104
- //# sourceMappingURL=graphify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphify.d.ts","sourceRoot":"","sources":["../../src/utils/graphify.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,IAAI,YAAY,CAyB7C;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAInE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvD,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,uBAAuB,CAAC;IACzC,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACv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