@rryando/arcs 4.2.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/cli/arcs-flash.d.ts +1 -1
- package/dist/cli/arcs-flash.d.ts.map +1 -1
- package/dist/cli/arcs-flash.js +8 -4
- package/dist/cli/arcs-flash.js.map +1 -1
- package/dist/cli/arcs-orchestrate.d.ts +1 -1
- package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
- package/dist/cli/arcs-orchestrate.js +6 -2
- package/dist/cli/arcs-orchestrate.js.map +1 -1
- package/dist/cli/arg-parser.d.ts +1 -0
- package/dist/cli/arg-parser.d.ts.map +1 -1
- package/dist/cli/arg-parser.js +12 -2
- package/dist/cli/arg-parser.js.map +1 -1
- package/dist/cli/command-registry.d.ts +2 -0
- package/dist/cli/command-registry.d.ts.map +1 -1
- package/dist/cli/command-registry.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +2 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/proposal-doc.js +3 -2
- package/dist/cli/commands/proposal-doc.js.map +1 -1
- package/dist/cli/commands/remember.js +1 -0
- package/dist/cli/commands/remember.js.map +1 -1
- package/dist/cli/commands/worktree.d.ts +2 -0
- package/dist/cli/commands/worktree.d.ts.map +1 -0
- package/dist/cli/commands/worktree.js +608 -0
- package/dist/cli/commands/worktree.js.map +1 -0
- package/dist/cli/dag-commands.d.ts +9 -0
- package/dist/cli/dag-commands.d.ts.map +1 -1
- package/dist/cli/dag-commands.js +37 -26
- package/dist/cli/dag-commands.js.map +1 -1
- package/dist/cli/help-generator.d.ts.map +1 -1
- package/dist/cli/help-generator.js +3 -0
- package/dist/cli/help-generator.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +14 -24
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/orchestrator-shared-blocks.d.ts +7 -5
- package/dist/cli/orchestrator-shared-blocks.d.ts.map +1 -1
- package/dist/cli/orchestrator-shared-blocks.js +45 -21
- package/dist/cli/orchestrator-shared-blocks.js.map +1 -1
- package/dist/cli/write-gate.d.ts +20 -0
- package/dist/cli/write-gate.d.ts.map +1 -0
- package/dist/cli/write-gate.js +39 -0
- package/dist/cli/write-gate.js.map +1 -0
- package/dist/utils/worktree-store.d.ts +54 -0
- package/dist/utils/worktree-store.d.ts.map +1 -0
- package/dist/utils/worktree-store.js +150 -0
- package/dist/utils/worktree-store.js.map +1 -0
- package/dist/utils/worktree.d.ts +71 -0
- package/dist/utils/worktree.d.ts.map +1 -0
- package/dist/utils/worktree.js +197 -0
- package/dist/utils/worktree.js.map +1 -0
- package/dist/web-client/assets/{GraphCanvas-Dw6EcoDb.js → GraphCanvas-BYZE4sO9.js} +1 -1
- package/dist/web-client/assets/{MarkdownEditor-Cz5_44Ej.js → MarkdownEditor-BKx6M1cw.js} +1 -1
- package/dist/web-client/assets/{abnfDiagram-VRR7QNED-CFJzLuew.js → abnfDiagram-VRR7QNED-D4kt0l2y.js} +1 -1
- package/dist/web-client/assets/architecture-TIHT7OUA-CIdGE6VO.js +1 -0
- package/dist/web-client/assets/{architectureDiagram-ZJ3FMSHR-FRlSgnnW.js → architectureDiagram-ZJ3FMSHR-bu29SJFS.js} +1 -1
- package/dist/web-client/assets/{blockDiagram-677ZJIJ3-WUkkunPZ.js → blockDiagram-677ZJIJ3-hsu7mXKw.js} +1 -1
- package/dist/web-client/assets/{c4Diagram-LMCZKHZV-BKeAsL6F.js → c4Diagram-LMCZKHZV-DMllRlT_.js} +1 -1
- package/dist/web-client/assets/channel-CBg-s-ZD.js +1 -0
- package/dist/web-client/assets/{chunk-32BRIVSS-B0b9kUcF.js → chunk-32BRIVSS-BSzwj5eM.js} +1 -1
- package/dist/web-client/assets/{chunk-52WLFC77-i6Y-vfL3.js → chunk-52WLFC77-RDdZn6yY.js} +1 -1
- package/dist/web-client/assets/{chunk-C7G6YPKG-atYWm6iP.js → chunk-C7G6YPKG-DQr--txT.js} +1 -1
- package/dist/web-client/assets/{chunk-EX3LRPZG-CZD6y0UU.js → chunk-EX3LRPZG-Bb8nc4z4.js} +1 -1
- package/dist/web-client/assets/{chunk-FWX5IMBZ-CVErR-UZ.js → chunk-FWX5IMBZ-QvBpOcOg.js} +2 -2
- package/dist/web-client/assets/{chunk-HOUHSVGY-BlHO2iQ3.js → chunk-HOUHSVGY-B0mX_yjc.js} +1 -1
- package/dist/web-client/assets/{chunk-ICXQ74PX-Ar8kfXfa.js → chunk-ICXQ74PX-BmJSQqOH.js} +1 -1
- package/dist/web-client/assets/{chunk-MOJQB5TN-DKrK867P.js → chunk-MOJQB5TN-BrEI4GGn.js} +1 -1
- package/dist/web-client/assets/{chunk-OGEWGWER-BmGykUeg.js → chunk-OGEWGWER-CrqDPOWP.js} +1 -1
- package/dist/web-client/assets/{chunk-PUDLZKDR-Bq23pnso.js → chunk-PUDLZKDR-DfPKldpG.js} +1 -1
- package/dist/web-client/assets/{chunk-Q4XR5HBZ-g15qvFAN.js → chunk-Q4XR5HBZ-ekATI9aV.js} +1 -1
- package/dist/web-client/assets/{chunk-V7JOEXUC-uyXA7S9r.js → chunk-V7JOEXUC-C5APsP1t.js} +1 -1
- package/dist/web-client/assets/{chunk-VAUOI2AC-WofZ-2M0.js → chunk-VAUOI2AC-BhfSWJZI.js} +1 -1
- package/dist/web-client/assets/{chunk-VR4S4FIN-DtTkK86v.js → chunk-VR4S4FIN-BGa-44J7.js} +1 -1
- package/dist/web-client/assets/{chunk-WYO6CB5R-zVyUwJq3.js → chunk-WYO6CB5R-By1K0guW.js} +1 -1
- package/dist/web-client/assets/{chunk-ZGVPDNZ5-CA1Oe3TK.js → chunk-ZGVPDNZ5-Vnzpc76F.js} +1 -1
- package/dist/web-client/assets/classDiagram-OUVF2IWQ-ciwDjhUR.js +1 -0
- package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-ciwDjhUR.js +1 -0
- package/dist/web-client/assets/{cynefin-VYW2F7L2-ivJY1h_9.js → cynefin-VYW2F7L2-C6MOMOOz.js} +1 -1
- package/dist/web-client/assets/{cynefinDiagram-TSTJHNR4-D2DstShq.js → cynefinDiagram-TSTJHNR4-Cseyu79b.js} +1 -1
- package/dist/web-client/assets/{dagre-VKFMJZFB-CwnMRy0K.js → dagre-VKFMJZFB-CQJlIuNh.js} +1 -1
- package/dist/web-client/assets/{diagram-FQU43EPY-BKJv6Cvw.js → diagram-FQU43EPY-DpqDxhq4.js} +1 -1
- package/dist/web-client/assets/{diagram-G47NLZAW-CwCXcgU5.js → diagram-G47NLZAW-C11fYYaF.js} +1 -1
- package/dist/web-client/assets/{diagram-NH7WQ7WH-CkghU1-6.js → diagram-NH7WQ7WH-BiG-uRAF.js} +1 -1
- package/dist/web-client/assets/{diagram-OA4YK3LP-D3siQIGu.js → diagram-OA4YK3LP-CIXWWjq-.js} +1 -1
- package/dist/web-client/assets/{diagram-WEI45ONY-CSs9xTBn.js → diagram-WEI45ONY-C3OgIWu9.js} +1 -1
- package/dist/web-client/assets/{ebnfDiagram-CCIWWBDH--i52vMiv.js → ebnfDiagram-CCIWWBDH-BHF_NA3_.js} +1 -1
- package/dist/web-client/assets/{erDiagram-Q63AITRT-q2hgOBY1.js → erDiagram-Q63AITRT-CUOJCrLy.js} +1 -1
- package/dist/web-client/assets/eventmodeling-45OFAUF4-DxfboL1J.js +1 -0
- package/dist/web-client/assets/flowDiagram-23GEKE2U-C3NzpTtI.js +1 -0
- package/dist/web-client/assets/{ganttDiagram-NO4QXBWP-BZ2rBbTe.js → ganttDiagram-NO4QXBWP-D_4BMJ-g.js} +1 -1
- package/dist/web-client/assets/{gitGraph-TEB2WS4Q-OnJ8tHgt.js → gitGraph-TEB2WS4Q-CBuaZBId.js} +1 -1
- package/dist/web-client/assets/{gitGraphDiagram-IHSO6WYX-CPNExFAr.js → gitGraphDiagram-IHSO6WYX-BbztsGuO.js} +1 -1
- package/dist/web-client/assets/index-B1KVIr80.css +2 -0
- package/dist/web-client/assets/{index-DCBn-YrR.js → index-BWd2fBNL.js} +38 -38
- package/dist/web-client/assets/{info-DKCQHKI2-DGuJbmdY.js → info-DKCQHKI2-Bzi0Xjro.js} +1 -1
- package/dist/web-client/assets/{infoDiagram-FWYZ7A6U-ADIAn-P5.js → infoDiagram-FWYZ7A6U-BkeEKcr0.js} +1 -1
- package/dist/web-client/assets/{ishikawaDiagram-FXEZZL3T-CUx-RGfg.js → ishikawaDiagram-FXEZZL3T-CVusWu0p.js} +1 -1
- package/dist/web-client/assets/{journeyDiagram-5HDEW3XC-BH7-tBBy.js → journeyDiagram-5HDEW3XC-BUxu71zw.js} +1 -1
- package/dist/web-client/assets/{kanban-definition-HUTT4EX6-BGEXBnI2.js → kanban-definition-HUTT4EX6-BE8Hv4Kd.js} +1 -1
- package/dist/web-client/assets/{line-CC-5ezU8.js → line-CiAoINJS.js} +1 -1
- package/dist/web-client/assets/{mermaid-parser.core-Dw18Fjbq.js → mermaid-parser.core-BW47khiS.js} +3 -3
- package/dist/web-client/assets/{mermaid.core-CMQBgE43.js → mermaid.core-DP--Jl9R.js} +3 -3
- package/dist/web-client/assets/{mindmap-definition-LN4V7U3C-CGtjw8tB.js → mindmap-definition-LN4V7U3C-CvWJUqdq.js} +1 -1
- package/dist/web-client/assets/{packet-7NZHBO7P-w71Y4Hzd.js → packet-7NZHBO7P-XtzX9SaQ.js} +1 -1
- package/dist/web-client/assets/{pegDiagram-2B236MQR-DWtfEm4T.js → pegDiagram-2B236MQR-XNo0K1ct.js} +1 -1
- package/dist/web-client/assets/{pie-RZYD4A2V-S9ztgnWs.js → pie-RZYD4A2V-B1eUd9yt.js} +1 -1
- package/dist/web-client/assets/{pieDiagram-ENE6RG2P-BWZQPN4m.js → pieDiagram-ENE6RG2P-CRSb5z-4.js} +1 -1
- package/dist/web-client/assets/{quadrantDiagram-ABIIQ3AL-DINDwblH.js → quadrantDiagram-ABIIQ3AL-DziMaQxE.js} +1 -1
- package/dist/web-client/assets/{radar-I7S5WNFK-BOGl9krB.js → radar-I7S5WNFK-BpRqZH2g.js} +1 -1
- package/dist/web-client/assets/{railroad-3IZDKUUU-CR9kuYSZ.js → railroad-3IZDKUUU-FDIHW04k.js} +1 -1
- package/dist/web-client/assets/railroad-abnf-AHOZXSZD-BKj6JAhH.js +1 -0
- package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-ChDM1OBv.js +1 -0
- package/dist/web-client/assets/railroad-peg-LSFZ7HO6-DvwA2e0i.js +1 -0
- package/dist/web-client/assets/{railroadDiagram-RFXS5EU6-byLCs9hp.js → railroadDiagram-RFXS5EU6-Cs7EVBaz.js} +1 -1
- package/dist/web-client/assets/{requirementDiagram-TGXJPOKE-Dn_FtbqW.js → requirementDiagram-TGXJPOKE-B9_Lj1ga.js} +1 -1
- package/dist/web-client/assets/{sankeyDiagram-HTMAVEWB-DUjRrCeC.js → sankeyDiagram-HTMAVEWB-DuTJTiy0.js} +1 -1
- package/dist/web-client/assets/{sequenceDiagram-DBY2YBRQ-BmBz8Wpq.js → sequenceDiagram-DBY2YBRQ-vOCU5UoE.js} +1 -1
- package/dist/web-client/assets/{stateDiagram-2N3HPSRC-BAYHjmqB.js → stateDiagram-2N3HPSRC-rxAnfzWn.js} +1 -1
- package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-B3EvQPEe.js +1 -0
- package/dist/web-client/assets/{swimlanes-5IMT3BWC-Bm942AR-.js → swimlanes-5IMT3BWC-gdVZUnPe.js} +1 -1
- package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-WcOXuCPg.js +8 -0
- package/dist/web-client/assets/{timeline-definition-FHXFAJF6-CHAZHhQk.js → timeline-definition-FHXFAJF6-Do68JyGy.js} +1 -1
- package/dist/web-client/assets/{treeView-QDETBFTQ-DHHkLsSy.js → treeView-QDETBFTQ-CdZkmg80.js} +1 -1
- package/dist/web-client/assets/{treemap-6X3UGDF4-BUxZ8fhY.js → treemap-6X3UGDF4-ub54fmpW.js} +1 -1
- package/dist/web-client/assets/{vennDiagram-L72KCM5P-BL9TRcUU.js → vennDiagram-L72KCM5P-D-r8NBEp.js} +1 -1
- package/dist/web-client/assets/{wardley-OPB4EBWU-CfJ5mO-y.js → wardley-OPB4EBWU-CTleH1-J.js} +1 -1
- package/dist/web-client/assets/{wardleyDiagram-EHGQE667-BlH1TSjy.js → wardleyDiagram-EHGQE667-BU8Kw39F.js} +1 -1
- package/dist/web-client/assets/{xychartDiagram-FW5EYKEG-BJN6wtrV.js → xychartDiagram-FW5EYKEG-CfNnag6i.js} +1 -1
- package/dist/web-client/index.html +2 -2
- package/dist/web-server/routes/sessions.js +43 -2
- package/dist/web-server/routes/sessions.js.map +1 -1
- package/opencode/arcs/.opencode/plugins/arcs.js +5 -1
- package/opencode/arcs/bundle-runtime.json +3 -0
- package/opencode/arcs/prompts/arcs-docs.txt +1 -1
- package/opencode/arcs/prompts/arcs-flash.txt +46 -20
- package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +47 -21
- package/opencode/arcs/prompts/arcs-orchestrate.txt +47 -21
- package/opencode/arcs/prompts/software-engineer.txt +6 -0
- package/opencode/arcs/skills/writing-proposals/SKILL.md +90 -0
- package/package.json +2 -2
- package/scripts/build-opencode-bundle.mjs +7 -8
- package/dist/cli/commands/hooks.d.ts +0 -76
- package/dist/cli/commands/hooks.d.ts.map +0 -1
- package/dist/cli/commands/hooks.js +0 -436
- package/dist/cli/commands/hooks.js.map +0 -1
- package/dist/utils/claude-code-hook-install.d.ts +0 -80
- package/dist/utils/claude-code-hook-install.d.ts.map +0 -1
- package/dist/utils/claude-code-hook-install.js +0 -212
- package/dist/utils/claude-code-hook-install.js.map +0 -1
- package/dist/utils/graphify-knowledge.d.ts +0 -22
- package/dist/utils/graphify-knowledge.d.ts.map +0 -1
- package/dist/utils/graphify-knowledge.js +0 -47
- package/dist/utils/graphify-knowledge.js.map +0 -1
- package/dist/utils/graphify.d.ts +0 -104
- package/dist/utils/graphify.d.ts.map +0 -1
- package/dist/utils/graphify.js +0 -439
- package/dist/utils/graphify.js.map +0 -1
- package/dist/utils/hook-contract.d.ts +0 -36
- package/dist/utils/hook-contract.d.ts.map +0 -1
- package/dist/utils/hook-contract.js +0 -35
- package/dist/utils/hook-contract.js.map +0 -1
- package/dist/utils/hook-token-store.d.ts +0 -63
- package/dist/utils/hook-token-store.d.ts.map +0 -1
- package/dist/utils/hook-token-store.js +0 -88
- package/dist/utils/hook-token-store.js.map +0 -1
- package/dist/web-client/assets/architecture-TIHT7OUA-CoHvhex9.js +0 -1
- package/dist/web-client/assets/channel-D8xMXC5_.js +0 -1
- package/dist/web-client/assets/classDiagram-OUVF2IWQ-Doj1_hvZ.js +0 -1
- package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-Doj1_hvZ.js +0 -1
- package/dist/web-client/assets/eventmodeling-45OFAUF4-ESVuFkJJ.js +0 -1
- package/dist/web-client/assets/flowDiagram-23GEKE2U-DN9SdR9f.js +0 -1
- package/dist/web-client/assets/index-wSzUPvml.css +0 -2
- package/dist/web-client/assets/railroad-abnf-AHOZXSZD-BvbCHrlR.js +0 -1
- package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-D869lbCL.js +0 -1
- package/dist/web-client/assets/railroad-peg-LSFZ7HO6-r4TXaJPI.js +0 -1
- package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-Bl-1K1zV.js +0 -1
- package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-DHU7bsfA.js +0 -8
- package/dist/web-server/hook-auth.d.ts +0 -12
- package/dist/web-server/hook-auth.d.ts.map +0 -1
- package/dist/web-server/hook-auth.js +0 -36
- package/dist/web-server/hook-auth.js.map +0 -1
- package/dist/web-server/opencode-client.d.ts +0 -123
- package/dist/web-server/opencode-client.d.ts.map +0 -1
- package/dist/web-server/opencode-client.js +0 -514
- package/dist/web-server/opencode-client.js.map +0 -1
- package/dist/web-server/routes/hook-events.d.ts +0 -43
- package/dist/web-server/routes/hook-events.d.ts.map +0 -1
- package/dist/web-server/routes/hook-events.js +0 -316
- package/dist/web-server/routes/hook-events.js.map +0 -1
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// hooks install-claude-code / status — Claude Code session-bridge hook
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
import { randomUUID } from "node:crypto";
|
|
5
|
-
import { readFile } from "node:fs/promises";
|
|
6
|
-
import { homedir } from "node:os";
|
|
7
|
-
import { resolve } from "node:path";
|
|
8
|
-
import { claudeSettingsLocalPath, installClaudeCodeHook, } from "../../utils/claude-code-hook-install.js";
|
|
9
|
-
import { readRootMeta } from "../../utils/dag.js";
|
|
10
|
-
import { DEFAULT_SERVER_URL, HOOK_EVENTS } from "../../utils/hook-contract.js";
|
|
11
|
-
import { writeHookToken } from "../../utils/hook-token-store.js";
|
|
12
|
-
import { getDataDir, PACKAGE_ROOT } from "../../utils/paths.js";
|
|
13
|
-
import { resolveProject } from "../../utils/project-resolver.js";
|
|
14
|
-
import { defineCommand, } from "../command-registry.js";
|
|
15
|
-
import { failure, success } from "../output-envelope.js";
|
|
16
|
-
/**
|
|
17
|
-
* Re-exported from the bridge contract, which is where the event list and the
|
|
18
|
-
* default URL are defined once for the server, this installer, and the parity
|
|
19
|
-
* test that pins the standalone hook script to them. Kept exported here because
|
|
20
|
-
* `utils/claude-code-hook-install.ts` sources them from this module.
|
|
21
|
-
*/
|
|
22
|
-
export { DEFAULT_SERVER_URL, HOOK_EVENTS };
|
|
23
|
-
/**
|
|
24
|
-
* Rotates the project's hook token and builds the `command` string a
|
|
25
|
-
* settings.json hook entry must run.
|
|
26
|
-
*
|
|
27
|
-
* Shared by this command (which prints the snippet for manual pasting) and by
|
|
28
|
-
* `utils/claude-code-hook-install.ts` (which writes it into a workspace's
|
|
29
|
-
* `.claude/settings.local.json` after an explicit confirm). One source of truth
|
|
30
|
-
* for the command string: a drift between the two would produce hooks that
|
|
31
|
-
* authenticate against a token nobody stored.
|
|
32
|
-
*/
|
|
33
|
-
export async function provisionHookCommand(options) {
|
|
34
|
-
const serverUrl = (options.serverUrl ?? DEFAULT_SERVER_URL).replace(/\/+$/, "");
|
|
35
|
-
const token = randomUUID();
|
|
36
|
-
await writeHookToken(options.projectDir, token);
|
|
37
|
-
const scriptPath = hookScriptPath();
|
|
38
|
-
const command = buildHookCommand({
|
|
39
|
-
token,
|
|
40
|
-
slug: options.slug,
|
|
41
|
-
serverUrl,
|
|
42
|
-
hookScriptPath: scriptPath,
|
|
43
|
-
});
|
|
44
|
-
return { token, hookScriptPath: scriptPath, serverUrl, command };
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The literal `command` string a settings.json hook entry runs.
|
|
48
|
-
*
|
|
49
|
-
* Env assignments are prefixed to the command: a settings.json `command` is just
|
|
50
|
-
* a shell string, which is how the per-project token reaches the script without
|
|
51
|
-
* baking secrets into the script itself.
|
|
52
|
-
*
|
|
53
|
-
* Split out from `provisionHookCommand()` so the `--write` path can render the
|
|
54
|
-
* snippet for a hook `installClaudeCodeHook()` already provisioned, without
|
|
55
|
-
* provisioning a second time (which would rotate the token and leave the
|
|
56
|
-
* printed snippet authenticating against a token nobody stored).
|
|
57
|
-
*/
|
|
58
|
-
function buildHookCommand(hook) {
|
|
59
|
-
return (`ARCS_HOOK_TOKEN=${hook.token} ARCS_HOOK_SLUG=${hook.slug} ` +
|
|
60
|
-
`ARCS_HOOK_URL=${hook.serverUrl} node ${hook.hookScriptPath}`);
|
|
61
|
-
}
|
|
62
|
-
const hooksInstallParams = {
|
|
63
|
-
slug: {
|
|
64
|
-
type: "string",
|
|
65
|
-
positional: 0,
|
|
66
|
-
description: "Project slug or path",
|
|
67
|
-
},
|
|
68
|
-
url: {
|
|
69
|
-
type: "string",
|
|
70
|
-
default: DEFAULT_SERVER_URL,
|
|
71
|
-
description: `ARCS web server URL the hook posts to (default ${DEFAULT_SERVER_URL})`,
|
|
72
|
-
},
|
|
73
|
-
write: {
|
|
74
|
-
type: "boolean",
|
|
75
|
-
default: false,
|
|
76
|
-
description: "Merge the hook into the workspace's .claude/settings.local.json instead of only printing the snippet",
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
defineCommand({
|
|
80
|
-
path: "hooks install-claude-code",
|
|
81
|
-
description: "Provision the Claude Code session-bridge hook (prints the settings.json snippet; --write installs it)",
|
|
82
|
-
params: hooksInstallParams,
|
|
83
|
-
mutation: true,
|
|
84
|
-
handler: handleHooksInstallClaudeCode,
|
|
85
|
-
});
|
|
86
|
-
// ---------------------------------------------------------------------------
|
|
87
|
-
function settingsSnippet(command) {
|
|
88
|
-
return JSON.stringify({
|
|
89
|
-
hooks: Object.fromEntries(HOOK_EVENTS.map((event) => [event, [{ hooks: [{ type: "command", command }] }]])),
|
|
90
|
-
}, null, 2);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Generates a fresh hook token and prints the settings.json snippet that uses
|
|
94
|
-
* it. Without `--write` it deliberately does not touch `~/.claude/settings.json`
|
|
95
|
-
* or any `.claude/settings.local.json`: ARCS writes inside `$ARCS_DATA` only,
|
|
96
|
-
* and editing a user's agent configuration behind their back is not consent.
|
|
97
|
-
* The snippet is the deliverable; pasting it is the user's call.
|
|
98
|
-
*
|
|
99
|
-
* `--write` is that consent, given explicitly on the command line: it delegates
|
|
100
|
-
* to `installClaudeCodeHook()`, the same merge the `arcs project init` prompt
|
|
101
|
-
* uses, which aborts rather than clobber a malformed settings file.
|
|
102
|
-
*
|
|
103
|
-
* Rerunning rotates the token — the previously installed snippet stops working
|
|
104
|
-
* until it is replaced, which is the intended way to revoke a stale hook.
|
|
105
|
-
*/
|
|
106
|
-
async function handleHooksInstallClaudeCode(params, _flags) {
|
|
107
|
-
const resolved = await resolveProject(params.slug);
|
|
108
|
-
if (!resolved.ok)
|
|
109
|
-
return resolved.result;
|
|
110
|
-
const { slug, projectDir, workspacePath } = resolved;
|
|
111
|
-
try {
|
|
112
|
-
if (params.write) {
|
|
113
|
-
// No workspace path means no legitimate write target. Falling back to
|
|
114
|
-
// `process.cwd()` would drop agent config into whatever directory the CLI
|
|
115
|
-
// ran from, so refuse and leave the user with the snippet path instead.
|
|
116
|
-
if (!workspacePath) {
|
|
117
|
-
return failure("no_workspace_paths", `Project "${slug}" has no workspace path configured — rerun without --write and paste the snippet yourself.`);
|
|
118
|
-
}
|
|
119
|
-
const installed = await installClaudeCodeHook({
|
|
120
|
-
workspacePath,
|
|
121
|
-
projectDir,
|
|
122
|
-
slug,
|
|
123
|
-
serverUrl: params.url,
|
|
124
|
-
});
|
|
125
|
-
return success({
|
|
126
|
-
project: slug,
|
|
127
|
-
token: installed.token,
|
|
128
|
-
hookScriptPath: installed.hookScriptPath,
|
|
129
|
-
serverUrl: installed.serverUrl,
|
|
130
|
-
events: installed.events,
|
|
131
|
-
settingsPath: installed.settingsPath,
|
|
132
|
-
settingsSnippet: settingsSnippet(buildHookCommand({
|
|
133
|
-
token: installed.token,
|
|
134
|
-
slug,
|
|
135
|
-
serverUrl: installed.serverUrl,
|
|
136
|
-
hookScriptPath: installed.hookScriptPath,
|
|
137
|
-
})),
|
|
138
|
-
notes: [
|
|
139
|
-
`Hook merged into ${installed.settingsPath} — no other file was touched.`,
|
|
140
|
-
"Start a NEW Claude Code session to pick it up — sessions already running won't.",
|
|
141
|
-
`serverUrl must match the port \`arcs web\` actually listens on — pass --url if you run it somewhere other than ${DEFAULT_SERVER_URL}.`,
|
|
142
|
-
"The token is a secret: settings.local.json is the git-ignored variant, keep it that way.",
|
|
143
|
-
"Rerunning this command rotates the token and replaces the entry it wrote.",
|
|
144
|
-
],
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
const { token, hookScriptPath, serverUrl, command } = await provisionHookCommand({
|
|
148
|
-
projectDir,
|
|
149
|
-
slug,
|
|
150
|
-
serverUrl: params.url,
|
|
151
|
-
});
|
|
152
|
-
return success({
|
|
153
|
-
project: slug,
|
|
154
|
-
token,
|
|
155
|
-
hookScriptPath,
|
|
156
|
-
serverUrl,
|
|
157
|
-
events: [...HOOK_EVENTS],
|
|
158
|
-
settingsSnippet: settingsSnippet(command),
|
|
159
|
-
notes: [
|
|
160
|
-
"Paste settingsSnippet into ~/.claude/settings.json, .claude/settings.json, " +
|
|
161
|
-
"or .claude/settings.local.json (merge into an existing `hooks` object). " +
|
|
162
|
-
"ARCS never edits those files for you.",
|
|
163
|
-
`serverUrl must match the port \`arcs web\` actually listens on — pass --url if you run it somewhere other than ${DEFAULT_SERVER_URL}.`,
|
|
164
|
-
"The token is a secret: prefer settings.local.json if your .claude directory is committed.",
|
|
165
|
-
"Rerunning this command rotates the token and invalidates the previously installed snippet.",
|
|
166
|
-
],
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
catch (err) {
|
|
170
|
-
return failure("hook_install_error", err instanceof Error ? err.message : String(err));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
// ---------------------------------------------------------------------------
|
|
174
|
-
// hooks status
|
|
175
|
-
// ---------------------------------------------------------------------------
|
|
176
|
-
const hooksStatusParams = {
|
|
177
|
-
slug: {
|
|
178
|
-
type: "string",
|
|
179
|
-
required: true,
|
|
180
|
-
positional: 0,
|
|
181
|
-
description: "Project slug or path",
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
defineCommand({
|
|
185
|
-
path: "hooks status",
|
|
186
|
-
description: "Report whether the Claude Code session-bridge hook is installed for a workspace",
|
|
187
|
-
params: hooksStatusParams,
|
|
188
|
-
mutation: false,
|
|
189
|
-
handler: handleHooksStatus,
|
|
190
|
-
});
|
|
191
|
-
/** `ARCS_HOOK_SLUG=<slug>` as prefixed onto a settings.json hook `command`. */
|
|
192
|
-
const HOOK_SLUG_PATTERN = /ARCS_HOOK_SLUG=(\S+)/;
|
|
193
|
-
/** `ARCS_HOOK_URL=<url>` as prefixed onto a settings.json hook `command`. */
|
|
194
|
-
const HOOK_URL_PATTERN = /ARCS_HOOK_URL=(\S+)/;
|
|
195
|
-
/** Fresh (never shared) empty result — every degradation path returns this. */
|
|
196
|
-
function noHooks() {
|
|
197
|
-
return { installed: false, matchedSlugs: [], hookUrls: [] };
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Configured workspace paths for a project, in order, mirroring how
|
|
201
|
-
* `resolveProject()` sources them. Returns `[]` when the project has none (or
|
|
202
|
-
* its meta is unreadable) — a status check reports "not installed" rather than
|
|
203
|
-
* guessing at `process.cwd()`, since inspecting whatever directory the CLI
|
|
204
|
-
* happens to run from would be a lie about the project.
|
|
205
|
-
*/
|
|
206
|
-
async function workspacePathsFor(projectDir) {
|
|
207
|
-
let meta;
|
|
208
|
-
try {
|
|
209
|
-
meta = JSON.parse(await readFile(resolve(projectDir, "meta.json"), "utf-8"));
|
|
210
|
-
}
|
|
211
|
-
catch {
|
|
212
|
-
return [];
|
|
213
|
-
}
|
|
214
|
-
const configured = Array.isArray(meta.workspacePaths) ? meta.workspacePaths : [];
|
|
215
|
-
const paths = [];
|
|
216
|
-
for (const entry of configured) {
|
|
217
|
-
if (typeof entry !== "string" || entry.length === 0)
|
|
218
|
-
continue;
|
|
219
|
-
paths.push(entry.startsWith("~") ? resolve(homedir(), entry.slice(2)) : resolve(entry));
|
|
220
|
-
}
|
|
221
|
-
return paths;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Read-only inspection of a workspace's `.claude/settings.local.json`.
|
|
225
|
-
*
|
|
226
|
-
* Matches entries the same way `mergeHookIntoSettings()` replaces them — on the
|
|
227
|
-
* absolute `hookScriptPath` appearing in the `command` string — so status and
|
|
228
|
-
* install can never disagree about what "installed" means.
|
|
229
|
-
*
|
|
230
|
-
* `installed` requires every hook event to be registered: a partial
|
|
231
|
-
* registration is a broken bridge that should be repaired, so reporting it as
|
|
232
|
-
* installed would suppress the fix. `matchedSlugs`/`hookUrls` are still
|
|
233
|
-
* populated in that case, which is also how a caller sees a hook wired to a
|
|
234
|
-
* *different* project or a *different* port.
|
|
235
|
-
*/
|
|
236
|
-
function inspectSettings(settings, hookScriptPath) {
|
|
237
|
-
const hooks = settings.hooks ?? {};
|
|
238
|
-
const matchedSlugs = [];
|
|
239
|
-
const hookUrls = [];
|
|
240
|
-
let eventsWithHook = 0;
|
|
241
|
-
for (const event of HOOK_EVENTS) {
|
|
242
|
-
const entries = Array.isArray(hooks[event]) ? hooks[event] : [];
|
|
243
|
-
let found = false;
|
|
244
|
-
for (const entry of entries) {
|
|
245
|
-
if (!entry || typeof entry !== "object" || !Array.isArray(entry.hooks))
|
|
246
|
-
continue;
|
|
247
|
-
for (const h of entry.hooks) {
|
|
248
|
-
if (typeof h?.command !== "string" || !h.command.includes(hookScriptPath))
|
|
249
|
-
continue;
|
|
250
|
-
found = true;
|
|
251
|
-
const slug = HOOK_SLUG_PATTERN.exec(h.command)?.[1];
|
|
252
|
-
if (slug && !matchedSlugs.includes(slug))
|
|
253
|
-
matchedSlugs.push(slug);
|
|
254
|
-
const url = HOOK_URL_PATTERN.exec(h.command)?.[1];
|
|
255
|
-
if (url && !hookUrls.includes(url))
|
|
256
|
-
hookUrls.push(url);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
if (found)
|
|
260
|
-
eventsWithHook++;
|
|
261
|
-
}
|
|
262
|
-
return { installed: eventsWithHook === HOOK_EVENTS.length, matchedSlugs, hookUrls };
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* The one read path for an installed hook: locate the workspace's
|
|
266
|
-
* `.claude/settings.local.json`, parse it, and hand it to `inspectSettings()`.
|
|
267
|
-
*
|
|
268
|
-
* Every failure — missing file, empty file, invalid JSON, a JSON array or
|
|
269
|
-
* scalar where an object belongs — degrades to `noHooks()` instead of throwing.
|
|
270
|
-
* That is deliberately the mirror image of `installClaudeCodeHook()`, which
|
|
271
|
-
* aborts on the same malformed input: the writer must never clobber a
|
|
272
|
-
* hand-edited settings file, but a reader risks nothing, and callers here
|
|
273
|
-
* include a server startup path that must not be killable by a stray comma in
|
|
274
|
-
* someone else's config.
|
|
275
|
-
*/
|
|
276
|
-
async function inspectWorkspaceHooks(workspacePath, hookScriptPath) {
|
|
277
|
-
let raw;
|
|
278
|
-
try {
|
|
279
|
-
raw = await readFile(claudeSettingsLocalPath(workspacePath), "utf-8");
|
|
280
|
-
}
|
|
281
|
-
catch {
|
|
282
|
-
return noHooks();
|
|
283
|
-
}
|
|
284
|
-
if (raw.trim().length === 0)
|
|
285
|
-
return noHooks();
|
|
286
|
-
let parsed;
|
|
287
|
-
try {
|
|
288
|
-
parsed = JSON.parse(raw);
|
|
289
|
-
}
|
|
290
|
-
catch {
|
|
291
|
-
return noHooks();
|
|
292
|
-
}
|
|
293
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
294
|
-
return noHooks();
|
|
295
|
-
}
|
|
296
|
-
return inspectSettings(parsed, hookScriptPath);
|
|
297
|
-
}
|
|
298
|
-
/** Absolute path of the standalone hook script a settings entry must run. */
|
|
299
|
-
function hookScriptPath() {
|
|
300
|
-
return resolve(PACKAGE_ROOT, "scripts", "claude-code-session-hook.mjs");
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Reports whether the session-bridge hook is registered in the project's
|
|
304
|
-
* workspace, without any side effect.
|
|
305
|
-
*
|
|
306
|
-
* Deliberately does not call `provisionHookCommand()`: that rotates the hook
|
|
307
|
-
* token, so a status check built on it would break the very hook it was asked
|
|
308
|
-
* to inspect. Only `hookScriptPath()` is shared with the install path.
|
|
309
|
-
*
|
|
310
|
-
* A malformed or non-object settings file reports `installed: false` rather
|
|
311
|
-
* than throwing: unlike the install path (which must abort before writing so a
|
|
312
|
-
* hand-edited file is never clobbered), nothing is at risk from a read.
|
|
313
|
-
*/
|
|
314
|
-
async function handleHooksStatus(params, _flags) {
|
|
315
|
-
const resolved = await resolveProject(params.slug);
|
|
316
|
-
if (!resolved.ok)
|
|
317
|
-
return resolved.result;
|
|
318
|
-
const { slug, projectDir } = resolved;
|
|
319
|
-
const scriptPath = hookScriptPath();
|
|
320
|
-
// First workspace only, matching `resolveProject()` — status answers for the
|
|
321
|
-
// workspace a hook install would have targeted.
|
|
322
|
-
const workspacePath = (await workspacePathsFor(projectDir))[0];
|
|
323
|
-
const { installed, matchedSlugs, hookUrls } = workspacePath
|
|
324
|
-
? await inspectWorkspaceHooks(workspacePath, scriptPath)
|
|
325
|
-
: noHooks();
|
|
326
|
-
return success({
|
|
327
|
-
installed,
|
|
328
|
-
matchesCurrentSlug: matchedSlugs.includes(slug),
|
|
329
|
-
matchedSlugs,
|
|
330
|
-
hookUrls,
|
|
331
|
-
hookScriptPath: scriptPath,
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
/** `http://host:port`, bracketing an IPv6 host so the printed URL is valid. */
|
|
335
|
-
function boundUrlOf(bound) {
|
|
336
|
-
const host = bound.host.includes(":") && !bound.host.startsWith("[") ? `[${bound.host}]` : bound.host;
|
|
337
|
-
return `http://${host}:${bound.port}`;
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Port a baked `ARCS_HOOK_URL` actually posts to, or undefined when the value
|
|
341
|
-
* is not a URL we can read. Undefined means "unknown", and unknown must stay
|
|
342
|
-
* silent — a warning we cannot substantiate is worse than none.
|
|
343
|
-
*/
|
|
344
|
-
function portOfUrl(url) {
|
|
345
|
-
let parsed;
|
|
346
|
-
try {
|
|
347
|
-
parsed = new URL(url);
|
|
348
|
-
}
|
|
349
|
-
catch {
|
|
350
|
-
return undefined;
|
|
351
|
-
}
|
|
352
|
-
if (parsed.port.length > 0) {
|
|
353
|
-
const port = Number(parsed.port);
|
|
354
|
-
return Number.isInteger(port) ? port : undefined;
|
|
355
|
-
}
|
|
356
|
-
if (parsed.protocol === "https:")
|
|
357
|
-
return 443;
|
|
358
|
-
if (parsed.protocol === "http:")
|
|
359
|
-
return 80;
|
|
360
|
-
return undefined;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* The single warning block `arcs web` prints when the address it actually bound
|
|
364
|
-
* disagrees with the URL baked into an installed hook — or `null` when there is
|
|
365
|
-
* nothing to say. Plain text: the caller owns the colouring.
|
|
366
|
-
*
|
|
367
|
-
* Why this exists: `ARCS_HOOK_URL` is written into settings.json at install
|
|
368
|
-
* time, so `arcs web --port N` leaves every already-installed hook posting to
|
|
369
|
-
* the old port. The hook exits 0 on a failed POST by design (a broken bridge
|
|
370
|
-
* must be inert, never fatal to the user's Claude Code session), so the bridge
|
|
371
|
-
* dies with no output anywhere and looks exactly like an idle session. This is
|
|
372
|
-
* the only place that difference becomes visible.
|
|
373
|
-
*
|
|
374
|
-
* Compares PORTS, not full origins: `arcs web` refuses anything but loopback,
|
|
375
|
-
* and 127.0.0.1 / localhost / ::1 are the same listener often enough that
|
|
376
|
-
* warning on a host spelling difference would be noise that trains the warning
|
|
377
|
-
* away. The port is the difference that reliably breaks the bridge.
|
|
378
|
-
*
|
|
379
|
-
* Never throws and never blocks — it runs after the server is already
|
|
380
|
-
* listening, and every read inside it degrades to silence: no data dir, no
|
|
381
|
-
* root meta, no project, no workspace, no settings file, malformed settings,
|
|
382
|
-
* or an `ARCS_HOOK_URL` that is not a parsable URL all produce `null`.
|
|
383
|
-
*/
|
|
384
|
-
export async function hookUrlMismatchWarning(bound) {
|
|
385
|
-
try {
|
|
386
|
-
return await buildHookUrlMismatchWarning(bound);
|
|
387
|
-
}
|
|
388
|
-
catch {
|
|
389
|
-
return null;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
async function buildHookUrlMismatchWarning(bound) {
|
|
393
|
-
const dataDir = getDataDir();
|
|
394
|
-
let projects;
|
|
395
|
-
try {
|
|
396
|
-
projects = (await readRootMeta(dataDir)).projects;
|
|
397
|
-
}
|
|
398
|
-
catch {
|
|
399
|
-
return null;
|
|
400
|
-
}
|
|
401
|
-
const scriptPath = hookScriptPath();
|
|
402
|
-
const mismatches = [];
|
|
403
|
-
const seen = new Set();
|
|
404
|
-
// Every project is scanned: `arcs web` serves all of them from one listener,
|
|
405
|
-
// so any project's hook can be the one pointing somewhere else. Workspaces
|
|
406
|
-
// that disagree with each other are all reported rather than reconciled.
|
|
407
|
-
for (const project of projects) {
|
|
408
|
-
const projectDir = resolve(dataDir, "projects", project.id);
|
|
409
|
-
for (const workspacePath of await workspacePathsFor(projectDir)) {
|
|
410
|
-
const { hookUrls } = await inspectWorkspaceHooks(workspacePath, scriptPath);
|
|
411
|
-
for (const url of hookUrls) {
|
|
412
|
-
const port = portOfUrl(url);
|
|
413
|
-
if (port === undefined || port === bound.port)
|
|
414
|
-
continue;
|
|
415
|
-
const key = `${project.id}\x00${url}`;
|
|
416
|
-
if (seen.has(key))
|
|
417
|
-
continue;
|
|
418
|
-
seen.add(key);
|
|
419
|
-
mismatches.push({ slug: project.id, url });
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
if (mismatches.length === 0)
|
|
424
|
-
return null;
|
|
425
|
-
const boundUrl = boundUrlOf(bound);
|
|
426
|
-
return [
|
|
427
|
-
"⚠ Claude Code session bridge: the installed hook posts to a different port.",
|
|
428
|
-
` arcs web is listening on ${boundUrl}`,
|
|
429
|
-
...mismatches.map((m) => ` installed hook posts to ${m.url} (project ${m.slug})`),
|
|
430
|
-
" Every hook POST will be refused, and the hook exits 0 by design — the",
|
|
431
|
-
" session bridge will stay silent instead of failing loudly.",
|
|
432
|
-
" Fix: restart on the hook's port, or re-point the hook:",
|
|
433
|
-
` arcs hooks install-claude-code ${mismatches[0].slug} --url ${boundUrl} --write`,
|
|
434
|
-
].join("\n");
|
|
435
|
-
}
|
|
436
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/cli/commands/hooks.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uEAAuE;AACvE,8EAA8E;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAA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AM,GAAG,GAAG,GAAG,OAAO,CAAC,EAAE,OAAO,GAAG,EAAE,CAAC;gBACtC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;oBAAE,SAAS;gBAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACd,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzC,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO;QACL,6EAA6E;QAC7E,kCAAkC,QAAQ,EAAE;QAC5C,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kCAAkC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,IAAI,GAAG,CAAC;QACzF,2EAA2E;QAC3E,gEAAgE;QAChE,4DAA4D;QAC5D,wCAAwC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,QAAQ,UAAU;KACvF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1,80 +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
|
-
interface HookCommandEntry {
|
|
21
|
-
type?: string;
|
|
22
|
-
command?: string;
|
|
23
|
-
[key: string]: unknown;
|
|
24
|
-
}
|
|
25
|
-
interface HookMatcherEntry {
|
|
26
|
-
hooks?: HookCommandEntry[];
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
}
|
|
29
|
-
export interface ClaudeSettings {
|
|
30
|
-
hooks?: Record<string, HookMatcherEntry[]>;
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
}
|
|
33
|
-
export interface ClaudeCodeHookInstallResult {
|
|
34
|
-
settingsPath: string;
|
|
35
|
-
token: string;
|
|
36
|
-
hookScriptPath: string;
|
|
37
|
-
serverUrl: string;
|
|
38
|
-
events: string[];
|
|
39
|
-
}
|
|
40
|
-
/** The only file this module ever writes — never `~/.claude/settings.json`. */
|
|
41
|
-
export declare function claudeSettingsLocalPath(workspacePath: string): string;
|
|
42
|
-
/**
|
|
43
|
-
* Returns a copy of `settings` with the ARCS hook entry registered under every
|
|
44
|
-
* hook event, replacing any prior entry that runs the same `hookScriptPath`.
|
|
45
|
-
* Pure — no I/O, so the merge rules are directly testable.
|
|
46
|
-
*/
|
|
47
|
-
export declare function mergeHookIntoSettings(settings: ClaudeSettings, hook: {
|
|
48
|
-
command: string;
|
|
49
|
-
hookScriptPath: string;
|
|
50
|
-
}): ClaudeSettings;
|
|
51
|
-
/**
|
|
52
|
-
* Reads the workspace's `.claude/settings.local.json` (if any), merges in a
|
|
53
|
-
* freshly provisioned hook, and writes it back owner-only.
|
|
54
|
-
*
|
|
55
|
-
* Throws when the existing file is present but unparseable — nothing is written
|
|
56
|
-
* in that case, so a hand-edited settings file is never clobbered.
|
|
57
|
-
*/
|
|
58
|
-
export declare function installClaudeCodeHook(options: {
|
|
59
|
-
workspacePath: string;
|
|
60
|
-
projectDir: string;
|
|
61
|
-
slug: string;
|
|
62
|
-
serverUrl?: string;
|
|
63
|
-
}): Promise<ClaudeCodeHookInstallResult>;
|
|
64
|
-
/**
|
|
65
|
-
* Interactively offers the hook install during `arcs project init`.
|
|
66
|
-
*
|
|
67
|
-
* Mirrors `promptAndInstallCodegraph`: a note explaining the offer, a confirm
|
|
68
|
-
* defaulting to "no", and a manual-fallback hint when declined. Returns the
|
|
69
|
-
* install result only when a write actually happened; returns `null` on
|
|
70
|
-
* decline, cancel, or failure. Never throws — `arcs project init` succeeding
|
|
71
|
-
* matters more than this offer succeeding.
|
|
72
|
-
*/
|
|
73
|
-
export declare function promptAndInstallClaudeCodeHook(options: {
|
|
74
|
-
workspacePath: string;
|
|
75
|
-
projectDir: string;
|
|
76
|
-
slug: string;
|
|
77
|
-
serverUrl?: string;
|
|
78
|
-
}): Promise<ClaudeCodeHookInstallResult | null>;
|
|
79
|
-
export {};
|
|
80
|
-
//# sourceMappingURL=claude-code-hook-install.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code-hook-install.d.ts","sourceRoot":"","sources":["../../src/utils/claude-code-hook-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CA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