vibe-coding-master 0.2.4 → 0.2.5
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/dist/backend/adapters/claude-adapter.js +9 -2
- package/dist/backend/api/claude-hook-routes.js +7 -0
- package/dist/backend/server.js +2 -1
- package/dist/backend/services/app-settings-service.js +49 -1
- package/dist/backend/services/claude-hook-service.js +61 -11
- package/dist/backend/services/harness-service.js +6 -5
- package/dist/backend/services/round-service.js +40 -7
- package/dist/backend/services/session-service.js +16 -2
- package/dist/shared/types/app-settings.js +17 -0
- package/dist/shared/types/session.js +37 -1
- package/dist-frontend/assets/index-BRrFbDjL.js +90 -0
- package/dist-frontend/assets/index-DQ-pEUma.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/docs/gateway-design.md +585 -0
- package/docs/product-design.md +49 -7
- package/docs/v0.2-implementation-plan.md +78 -68
- package/docs/vcm-cc-best-practices.md +18 -4
- package/package.json +1 -1
- package/scripts/install-vcm-harness.mjs +3 -2
- package/dist-frontend/assets/index-CfZ3VYXY.js +0 -90
- package/dist-frontend/assets/index-CfqduxVB.css +0 -32
package/docs/product-design.md
CHANGED
|
@@ -251,7 +251,7 @@ The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or
|
|
|
251
251
|
|
|
252
252
|
The default theme mode is `System`, which follows the OS/browser color-scheme preference. The entire application chrome, sidebar, forms, modals, status badges, and workspace panels must support both light and dark rendering. Embedded terminals keep their terminal-native dark styling.
|
|
253
253
|
|
|
254
|
-
When `Flow pause alert` is on, VCM plays a short, soft, two-note local chime after a role flow stops advancing. If the flow lasted less than
|
|
254
|
+
When `Flow pause alert` is on, VCM plays a short, soft, two-note local chime after a role flow stops advancing. If the flow lasted less than 2 minutes, the chime plays 3 times, 1.4 seconds apart, and stops. If the flow lasted 2 minutes or longer, VCM shows an in-app alert dialog and repeats the chime until the user confirms the dialog. The alert sound must reuse one browser audio context after user activation instead of creating a fresh context for each repeat, because Safari can block repeated timer-driven playback when every repeat looks like a new autoplay attempt.
|
|
255
255
|
`Try alert` must work even when no flow has just paused so the user can verify browser sound and notification behavior.
|
|
256
256
|
Safari may still require the user to manually set `Safari > Website Settings > Auto-Play > Allow All Auto-Play`; Chrome is the recommended browser for reliable repeated alert sound.
|
|
257
257
|
|
|
@@ -335,10 +335,11 @@ Task-level round state:
|
|
|
335
335
|
- `Stop` moves the round into a 10 second settling window.
|
|
336
336
|
- A new `UserPromptSubmit` inside the window continues the same round.
|
|
337
337
|
- If no new prompt is accepted before the deadline, the round becomes `paused`.
|
|
338
|
-
- The
|
|
338
|
+
- The pause transition is timer-driven from the `Stop` event. Round-state reads do not end a round.
|
|
339
|
+
- Before pausing, VCM checks `.ai/vcm/handoffs/messages`; if a pending route message exists and can be delivered, VCM retries delivery and extends the settling window instead of alerting.
|
|
339
340
|
- The same round state stores total round count, prompt-submit count, stop count, and Claude Code active runtime. Active runtime is measured only between `UserPromptSubmit` and `Stop`, not during the settling window.
|
|
340
341
|
|
|
341
|
-
The frontend polls this task-level round state and deduplicates each paused round so the same paused state does not alert on every poll. Flow duration is measured from the first `UserPromptSubmit` to `pausedAt`, falling back to the last `Stop` when needed. Pauses under
|
|
342
|
+
The frontend polls this task-level round state and deduplicates each paused round so the same paused state does not alert on every poll. Flow duration is measured from the first `UserPromptSubmit` to `pausedAt`, falling back to the last `Stop` when needed. Pauses under 2 minutes trigger the weak 3-chime reminder at 1.4 second intervals. Pauses at or above 2 minutes trigger the strong alert dialog and repeating sound until confirmation.
|
|
342
343
|
|
|
343
344
|
## 9. Session Lifecycle
|
|
344
345
|
|
|
@@ -478,7 +479,7 @@ Default route policy:
|
|
|
478
479
|
|
|
479
480
|
Stop-triggered scan:
|
|
480
481
|
|
|
481
|
-
- VCM injects Claude Code `UserPromptSubmit` and `
|
|
482
|
+
- VCM injects Claude Code `UserPromptSubmit`, `Stop`, and `PermissionRequest` hooks into `.claude/settings.json`.
|
|
482
483
|
- The hooks do not call `vcmctl`; they POST directly to the local VCM backend.
|
|
483
484
|
- When any role stops, VCM marks that role idle, then scans pending route files.
|
|
484
485
|
- VCM scans the stopped role's outgoing files and also any pending files targeting newly idle roles, so messages that were blocked by a busy target can be delivered after that target stops.
|
|
@@ -512,6 +513,7 @@ VCM Harness injects Claude Code hooks into `.claude/settings.json`:
|
|
|
512
513
|
|
|
513
514
|
- `UserPromptSubmit`: posts directly to the VCM backend, marks the role running, and confirms any matching VCM message by recording `acceptedAt`
|
|
514
515
|
- `Stop`: posts directly to the VCM backend, marks the role idle, and triggers pending route-file dispatch
|
|
516
|
+
- `PermissionRequest`: posts directly to the VCM backend and prints the backend response to stdout so Claude Code can consume an allow decision when the local VCM setting is enabled
|
|
515
517
|
|
|
516
518
|
VCM uses `UserPromptSubmit` as the Claude Code acceptance signal. A successful PTY write only proves VCM delivered text to the embedded terminal; `UserPromptSubmit` proves Claude Code accepted the prompt.
|
|
517
519
|
|
|
@@ -633,7 +635,32 @@ Translation panel `Auto-send` is separate from task `Auto orchestration`:
|
|
|
633
635
|
|
|
634
636
|
Task `Auto orchestration` is a compact selected/unselected button in the role console toolbar. `Translate` is a global task header toggle next to `Close Task`; it opens/closes the translation split for all role consoles, so switching roles keeps the same translation setting.
|
|
635
637
|
|
|
636
|
-
## 14.
|
|
638
|
+
## 14. Mobile Gateway
|
|
639
|
+
|
|
640
|
+
VCM Gateway is a mobile Weixin DM bridge to the local desktop VCM instance.
|
|
641
|
+
|
|
642
|
+
Gateway product rules:
|
|
643
|
+
|
|
644
|
+
- DM only; group chat is not supported.
|
|
645
|
+
- One mobile Weixin DM identity binds to one desktop VCM instance.
|
|
646
|
+
- Binding is not tied to one project or one task.
|
|
647
|
+
- The bound phone can select among the projects and tasks available to the
|
|
648
|
+
desktop VCM instance.
|
|
649
|
+
- Plain mobile text is sent only to the current task's `project-manager`.
|
|
650
|
+
- Gateway never sends directly to `architect`, `coder`, or `reviewer`.
|
|
651
|
+
- Gateway can push PM assistant replies to Weixin whenever gateway is enabled,
|
|
652
|
+
even if that PM turn was started from desktop VCM.
|
|
653
|
+
- When gateway translation is enabled, mobile Chinese input is translated to
|
|
654
|
+
English before PM receives it, and PM English replies are translated to
|
|
655
|
+
Chinese before Weixin receives them.
|
|
656
|
+
- The PM prompt does not include the original Chinese text.
|
|
657
|
+
- There is no multi-user allowlist. The security model is one bound DM identity.
|
|
658
|
+
|
|
659
|
+
The first channel is Tencent iLink Bot API / Weixin DM. VCM uses QR login,
|
|
660
|
+
`getupdates` long polling, and `sendmessage` text replies. Gateway details and
|
|
661
|
+
implementation plan live in `docs/gateway-design.md`.
|
|
662
|
+
|
|
663
|
+
## 15. Local State
|
|
637
664
|
|
|
638
665
|
App-level settings:
|
|
639
666
|
|
|
@@ -644,9 +671,21 @@ App-level settings:
|
|
|
644
671
|
Stored app-level settings include:
|
|
645
672
|
|
|
646
673
|
- UI theme mode: `system`, `light`, or `dark`
|
|
674
|
+
- flow pause alert preference
|
|
675
|
+
- Claude Code permission request handling preference
|
|
647
676
|
- translation provider settings and API key
|
|
648
677
|
- recent repository paths
|
|
649
678
|
|
|
679
|
+
Gateway state and audit logs:
|
|
680
|
+
|
|
681
|
+
```text
|
|
682
|
+
~/.vcm/gateway/settings.json
|
|
683
|
+
~/.vcm/gateway/audit.jsonl
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Gateway credentials, iLink tokens, DM binding identity, cursors, context tokens,
|
|
687
|
+
and audit logs must stay outside connected repositories.
|
|
688
|
+
|
|
650
689
|
Repository-level VCM state:
|
|
651
690
|
|
|
652
691
|
```text
|
|
@@ -682,7 +721,7 @@ External Claude transcripts:
|
|
|
682
721
|
~/.claude/projects/<project-hash>/<claude-session-id>.jsonl
|
|
683
722
|
```
|
|
684
723
|
|
|
685
|
-
##
|
|
724
|
+
## 16. Packaging Expectations
|
|
686
725
|
|
|
687
726
|
Published npm packages must include built output:
|
|
688
727
|
|
|
@@ -701,7 +740,7 @@ npm run build && npm run verify:package
|
|
|
701
740
|
|
|
702
741
|
This protects against publishing raw TypeScript bin files or missing frontend assets.
|
|
703
742
|
|
|
704
|
-
##
|
|
743
|
+
## 17. Success Criteria
|
|
705
744
|
|
|
706
745
|
VCM V1 is successful when:
|
|
707
746
|
|
|
@@ -712,6 +751,7 @@ VCM V1 is successful when:
|
|
|
712
751
|
- Switching roles never loses the embedded terminal.
|
|
713
752
|
- Restart creates a fresh Claude session; Resume reconnects to the persisted one.
|
|
714
753
|
- Permission modes are reflected in the Claude command.
|
|
754
|
+
- Sidebar settings include Claude Code permission request handling with `off` and `allow all`; `off` is the default.
|
|
715
755
|
- Roles can route messages by writing fixed route files under `.ai/vcm/handoffs/messages/`.
|
|
716
756
|
- Manual orchestration lets the user inspect pending route-file messages without auto-submitting Enter.
|
|
717
757
|
- Auto orchestration can deliver pending route-file messages to idle running target roles.
|
|
@@ -719,6 +759,8 @@ VCM V1 is successful when:
|
|
|
719
759
|
- Round completion detection waits for the final role in a chained conversation and can alert with prompt plus sound.
|
|
720
760
|
- Translation settings save to `~/.vcm/settings.json`.
|
|
721
761
|
- Translation reads Claude transcript JSONL reliably after start, resume, and restart.
|
|
762
|
+
- Gateway can bind one Weixin DM identity to the desktop VCM instance, send
|
|
763
|
+
translated plain text to PM, and push translated PM replies back to Weixin.
|
|
722
764
|
- Terminal and translation panel have equal, stable reading space.
|
|
723
765
|
- Harness install/update preserves user content outside VCM managed blocks.
|
|
724
766
|
- Completed tasks can cleanly remove their worktree and VCM task metadata without affecting other tasks.
|
|
@@ -12,65 +12,80 @@ This document is an implementation plan, not a target-repository harness file.
|
|
|
12
12
|
|
|
13
13
|
## 1. Mobile Gateway Goal
|
|
14
14
|
|
|
15
|
-
VCM 0.2 should let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
The gateway
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
VCM 0.2 should let one mobile Weixin DM bind to one desktop VCM instance and
|
|
16
|
+
talk to the current task's `project-manager` role.
|
|
17
|
+
|
|
18
|
+
The detailed gateway product design and implementation plan lives in
|
|
19
|
+
`docs/gateway-design.md`.
|
|
20
|
+
|
|
21
|
+
Current decisions:
|
|
22
|
+
|
|
23
|
+
- Support Weixin DM only. Group chat is not supported.
|
|
24
|
+
- Bind one mobile Weixin DM identity to one desktop VCM instance.
|
|
25
|
+
- Binding is not project-specific and not task-specific.
|
|
26
|
+
- The bound phone can select among the projects and tasks available to the
|
|
27
|
+
desktop VCM instance.
|
|
28
|
+
- Plain mobile text is sent only to the current task's `project-manager`.
|
|
29
|
+
- Gateway never sends directly to `architect`, `coder`, or `reviewer`.
|
|
30
|
+
- PM replies may be pushed to Weixin whenever gateway is enabled, even when the
|
|
31
|
+
PM turn was started from the desktop UI.
|
|
32
|
+
- When translation is enabled, mobile Chinese input is translated to English
|
|
33
|
+
before PM sees it, and PM English replies are translated to Chinese before
|
|
34
|
+
Weixin sees them.
|
|
35
|
+
- The prompt sent to PM does not include the original Chinese text.
|
|
36
|
+
- There is no multi-user allowlist. The security model is one bound DM identity.
|
|
28
37
|
|
|
29
38
|
## 2. Gateway Non-Goals
|
|
30
39
|
|
|
31
40
|
VCM 0.2 gateway should not:
|
|
32
41
|
|
|
33
|
-
- expose the
|
|
34
|
-
-
|
|
42
|
+
- expose the embedded terminal over Weixin
|
|
43
|
+
- support group chat
|
|
44
|
+
- support multiple mobile users
|
|
35
45
|
- store gateway credentials in the connected repository
|
|
36
|
-
-
|
|
46
|
+
- send directly to non-PM roles
|
|
47
|
+
- run shell commands from gateway messages
|
|
48
|
+
- provide approve/reject/start/stop workflow controls in the MVP
|
|
37
49
|
- bypass existing backend task/session/orchestration services
|
|
38
50
|
|
|
39
51
|
## 3. Gateway Shape
|
|
40
52
|
|
|
41
53
|
```text
|
|
42
54
|
Weixin mobile DM
|
|
43
|
-
-> Tencent iLink Bot API
|
|
55
|
+
-> Tencent iLink Bot API getupdates
|
|
44
56
|
-> VCM gateway channel: weixin-ilink
|
|
45
|
-
->
|
|
46
|
-
->
|
|
47
|
-
->
|
|
57
|
+
-> bound identity check
|
|
58
|
+
-> command parser or PM message bridge
|
|
59
|
+
-> existing VCM backend services
|
|
60
|
+
-> Tencent iLink sendmessage
|
|
48
61
|
```
|
|
49
62
|
|
|
50
|
-
The iLink channel
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
The iLink channel is outbound-first from the VCM process. It long-polls iLink
|
|
64
|
+
for direct messages and sends replies through the iLink send API. This avoids a
|
|
65
|
+
public callback URL for the first gateway version.
|
|
53
66
|
|
|
54
67
|
Suggested backend files:
|
|
55
68
|
|
|
56
69
|
```text
|
|
70
|
+
src/shared/types/gateway.ts
|
|
71
|
+
|
|
57
72
|
src/backend/gateway/
|
|
58
73
|
gateway-service.ts
|
|
59
74
|
gateway-settings-service.ts
|
|
60
75
|
gateway-command-parser.ts
|
|
61
|
-
gateway-
|
|
76
|
+
gateway-pm-bridge.ts
|
|
62
77
|
gateway-notifier.ts
|
|
78
|
+
gateway-audit-log.ts
|
|
63
79
|
channels/
|
|
64
80
|
weixin-ilink-channel.ts
|
|
65
81
|
|
|
66
82
|
src/backend/api/gateway-routes.ts
|
|
67
|
-
src/shared/types/gateway.ts
|
|
68
83
|
```
|
|
69
84
|
|
|
70
85
|
Gateway settings and secrets must live in app-local state:
|
|
71
86
|
|
|
72
87
|
```text
|
|
73
|
-
~/.vcm/settings.json
|
|
88
|
+
~/.vcm/gateway/settings.json
|
|
74
89
|
~/.vcm/gateway/audit.jsonl
|
|
75
90
|
```
|
|
76
91
|
|
|
@@ -79,62 +94,57 @@ log, `.ai/vcm/**`, or PR text.
|
|
|
79
94
|
|
|
80
95
|
## 4. Gateway Command Surface
|
|
81
96
|
|
|
82
|
-
|
|
97
|
+
MVP commands:
|
|
83
98
|
|
|
84
99
|
```text
|
|
100
|
+
/help
|
|
85
101
|
/status
|
|
102
|
+
/projects
|
|
103
|
+
/use-project <index-or-path>
|
|
86
104
|
/tasks
|
|
87
|
-
/task <
|
|
88
|
-
/
|
|
89
|
-
/
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Initial state-changing commands:
|
|
93
|
-
|
|
94
|
-
```text
|
|
95
|
-
/pm <text>
|
|
96
|
-
/approve <id>
|
|
97
|
-
/reject <id>
|
|
98
|
-
/pause <task>
|
|
99
|
-
/resume <task>
|
|
105
|
+
/use-task <index-or-task-slug>
|
|
106
|
+
/translate on
|
|
107
|
+
/translate off
|
|
100
108
|
```
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
Plain text that does not start with `/` is treated as a PM message for the
|
|
111
|
+
current task.
|
|
103
112
|
|
|
104
|
-
|
|
105
|
-
- command parsing into a known action
|
|
106
|
-
- confirmation when destructive or high-risk
|
|
107
|
-
- audit logging with secrets redacted
|
|
113
|
+
## 5. Gateway Feasibility
|
|
108
114
|
|
|
109
|
-
The
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
The local reference implementation
|
|
116
|
+
`/Users/sheldon/Documents/New project 3/weixin-ilink-gateway-test` proves the
|
|
117
|
+
needed Tencent iLink primitives:
|
|
112
118
|
|
|
113
|
-
|
|
119
|
+
- QR login through `ilink/bot/get_bot_qrcode`.
|
|
120
|
+
- QR status polling through `ilink/bot/get_qrcode_status`.
|
|
121
|
+
- Long-poll receive through `ilink/bot/getupdates`.
|
|
122
|
+
- Text DM send through `ilink/bot/sendmessage`.
|
|
123
|
+
- Token, cursor, and context-token persistence outside repositories.
|
|
124
|
+
- Session-expiration handling through iLink error code `-14`.
|
|
114
125
|
|
|
115
|
-
|
|
126
|
+
VCM already has the other required primitives:
|
|
116
127
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
- rate-limit command handling
|
|
123
|
-
- redact secrets in logs
|
|
124
|
-
- confirmation-gate destructive actions
|
|
125
|
-
- never expose raw terminal write APIs to gateway commands
|
|
128
|
+
- controlled terminal submission through backend PTY services
|
|
129
|
+
- Claude Code `UserPromptSubmit` / `Stop` hooks
|
|
130
|
+
- Claude transcript parsing
|
|
131
|
+
- translation provider integration
|
|
132
|
+
- project/task/session services
|
|
126
133
|
|
|
127
134
|
## 6. Gateway Acceptance
|
|
128
135
|
|
|
129
|
-
Gateway is acceptable when:
|
|
130
|
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
- `/
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
136
|
+
Gateway MVP is acceptable when:
|
|
137
|
+
|
|
138
|
+
- desktop VCM can enable/disable gateway
|
|
139
|
+
- desktop VCM can QR-bind one Weixin DM identity
|
|
140
|
+
- the bound phone can DM `/status` and receive current VCM status
|
|
141
|
+
- the bound phone can list and select current project/task context
|
|
142
|
+
- the bound phone can send Chinese plain text to current task PM
|
|
143
|
+
- PM receives only the translated English prompt, without original Chinese
|
|
144
|
+
- gateway pushes PM assistant replies to Weixin whenever enabled
|
|
145
|
+
- PM replies are translated to Chinese when gateway translation is enabled
|
|
146
|
+
- restart does not replay already handled iLink messages or PM replies
|
|
147
|
+
- credentials and audit logs stay outside connected repos
|
|
138
148
|
|
|
139
149
|
## 7. Full Harness Goal
|
|
140
150
|
|
|
@@ -412,10 +412,24 @@ gateway-submitted prompts, and command authorization.
|
|
|
412
412
|
VCM 0.2 gateway should expose a conservative mobile command surface through
|
|
413
413
|
Tencent iLink Bot API / Weixin DM.
|
|
414
414
|
|
|
415
|
+
Gateway product rules:
|
|
416
|
+
|
|
417
|
+
- support Weixin DM only, not group chat
|
|
418
|
+
- bind one mobile Weixin DM identity to one desktop VCM instance
|
|
419
|
+
- do not bind gateway to a single project or task
|
|
420
|
+
- let the bound phone select among the projects and tasks available to that VCM
|
|
421
|
+
instance
|
|
422
|
+
- send ordinary mobile text only to the current task's `project-manager`
|
|
423
|
+
- do not send gateway messages directly to architect, coder, or reviewer
|
|
424
|
+
- when translation is enabled, send only translated English to PM and translated
|
|
425
|
+
Chinese back to Weixin
|
|
426
|
+
- do not include the original Chinese text in PM prompts
|
|
427
|
+
- use one bound DM identity; do not maintain a multi-user allowlist
|
|
428
|
+
|
|
415
429
|
Gateway settings and secrets live in app-local state:
|
|
416
430
|
|
|
417
431
|
```text
|
|
418
|
-
~/.vcm/settings.json
|
|
432
|
+
~/.vcm/gateway/settings.json
|
|
419
433
|
```
|
|
420
434
|
|
|
421
435
|
Gateway audit logs live outside connected repositories:
|
|
@@ -428,9 +442,9 @@ Rules:
|
|
|
428
442
|
|
|
429
443
|
- do not expose the full embedded terminal over Weixin
|
|
430
444
|
- do not store gateway credentials in connected repositories
|
|
431
|
-
-
|
|
432
|
-
-
|
|
433
|
-
- audit state
|
|
445
|
+
- reject or ignore messages outside the bound DM identity
|
|
446
|
+
- keep the MVP PM-only and avoid approve/reject/start/stop workflow commands
|
|
447
|
+
- audit gateway state changes and message handling with secrets redacted
|
|
434
448
|
- treat gateway authorization and command parsing as high-risk code
|
|
435
449
|
|
|
436
450
|
## 16. Minimum VCM Rules
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ const MANIFEST_PATH = ".ai/vcm-harness-manifest.json";
|
|
|
11
11
|
const HTML_BLOCK_PATTERN = /<!-- VCM:BEGIN(?:\s+version=\d+)? -->[\s\S]*?<!-- VCM:END -->/m;
|
|
12
12
|
const HASH_BLOCK_PATTERN = /# VCM:BEGIN(?:\s+version=\d+)?\n[\s\S]*?# VCM:END/m;
|
|
13
13
|
const VCM_HOOK_COMMAND = `sh -c 'if [ -z "\${VCM_TASK_SLUG:-}" ] || [ -z "\${VCM_ROLE:-}" ] || [ -z "\${VCM_API_URL:-}" ]; then exit 0; fi; node -e '"'"'let s="";process.stdin.setEncoding("utf8");process.stdin.on("data",d=>s+=d);process.stdin.on("end",()=>{let event={};try{event=s.trim()?JSON.parse(s):{};}catch{event={raw:s};}process.stdout.write(JSON.stringify({taskSlug:process.env.VCM_TASK_SLUG,role:process.env.VCM_ROLE,event}));});'"'"' | curl -fsS --max-time 2 -X POST "\${VCM_API_URL}/api/hooks/claude-code" -H "content-type: application/json" --data-binary @- >/dev/null || true'`;
|
|
14
|
+
const VCM_PERMISSION_REQUEST_HOOK_COMMAND = `sh -c 'if [ -z "\${VCM_TASK_SLUG:-}" ] || [ -z "\${VCM_ROLE:-}" ] || [ -z "\${VCM_API_URL:-}" ]; then exit 0; fi; node -e '"'"'let s="";process.stdin.setEncoding("utf8");process.stdin.on("data",d=>s+=d);process.stdin.on("end",()=>{let event={};try{event=s.trim()?JSON.parse(s):{};}catch{event={raw:s};}process.stdout.write(JSON.stringify({taskSlug:process.env.VCM_TASK_SLUG,role:process.env.VCM_ROLE,event}));});'"'"' | curl -fsS --max-time 5 -X POST "\${VCM_API_URL}/api/hooks/claude-code/permission-request" -H "content-type: application/json" --data-binary @- || true'`;
|
|
14
15
|
|
|
15
16
|
const AGENT_FRONTMATTER = {
|
|
16
17
|
"project-manager": {
|
|
@@ -1480,14 +1481,14 @@ function mergeVcmHooks(settings) {
|
|
|
1480
1481
|
}
|
|
1481
1482
|
}
|
|
1482
1483
|
|
|
1483
|
-
for (const eventName of ["UserPromptSubmit", "Stop"]) {
|
|
1484
|
+
for (const eventName of ["UserPromptSubmit", "Stop", "PermissionRequest"]) {
|
|
1484
1485
|
hooks[eventName] = [
|
|
1485
1486
|
...(Array.isArray(hooks[eventName]) ? hooks[eventName] : []),
|
|
1486
1487
|
{
|
|
1487
1488
|
hooks: [
|
|
1488
1489
|
{
|
|
1489
1490
|
type: "command",
|
|
1490
|
-
command: VCM_HOOK_COMMAND,
|
|
1491
|
+
command: eventName === "PermissionRequest" ? VCM_PERMISSION_REQUEST_HOOK_COMMAND : VCM_HOOK_COMMAND,
|
|
1491
1492
|
timeout: 5
|
|
1492
1493
|
}
|
|
1493
1494
|
]
|