vibe-coding-master 0.0.12 → 0.0.14

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 (37) hide show
  1. package/README.md +33 -14
  2. package/dist/backend/api/claude-hook-routes.js +5 -0
  3. package/dist/backend/api/message-routes.js +4 -0
  4. package/dist/backend/api/round-routes.js +33 -0
  5. package/dist/backend/api/session-routes.js +2 -0
  6. package/dist/backend/api/task-routes.js +1 -0
  7. package/dist/backend/server.js +27 -3
  8. package/dist/backend/services/app-settings-service.js +2 -1
  9. package/dist/backend/services/claude-hook-service.js +70 -0
  10. package/dist/backend/services/harness-service.js +95 -0
  11. package/dist/backend/services/message-service.js +222 -49
  12. package/dist/backend/services/project-service.js +1 -1
  13. package/dist/backend/services/round-service.js +117 -0
  14. package/dist/backend/services/session-service.js +39 -0
  15. package/dist/backend/services/status-service.js +0 -76
  16. package/dist/backend/services/task-service.js +14 -6
  17. package/dist/backend/templates/harness/architect-agent.js +5 -0
  18. package/dist/backend/templates/harness/claude-root.js +6 -0
  19. package/dist/backend/templates/harness/coder-agent.js +5 -0
  20. package/dist/backend/templates/harness/gitignore.js +2 -1
  21. package/dist/backend/templates/harness/project-manager-agent.js +7 -0
  22. package/dist/backend/templates/harness/reviewer-agent.js +5 -0
  23. package/dist/backend/templates/message-envelope.js +3 -1
  24. package/dist/backend/ws/terminal-ws.js +15 -1
  25. package/dist/cli/vcmctl.js +30 -0
  26. package/dist/shared/types/claude-hook.js +1 -0
  27. package/dist/shared/types/round.js +1 -0
  28. package/dist-frontend/assets/index-DVhkEVnA.js +89 -0
  29. package/dist-frontend/assets/index-jEkUTnIY.css +32 -0
  30. package/dist-frontend/index.html +2 -2
  31. package/docs/cc-best-practices.md +15 -4
  32. package/docs/product-design.md +71 -38
  33. package/docs/v1-architecture-design.md +108 -49
  34. package/docs/v1-implementation-plan.md +107 -32
  35. package/package.json +1 -1
  36. package/dist-frontend/assets/index-Bi4X3GSR.css +0 -32
  37. package/dist-frontend/assets/index-DaHXq14j.js +0 -88
@@ -7,5 +7,10 @@ export function renderCoderHarnessRules() {
7
7
  - Maintain implementation-log.md and validation-log.md under the current task handoff directory.
8
8
  - Do not change module boundaries, public contracts, dependency direction, or test strategy without project-manager/architect replan.
9
9
  - Stop and reply to project-manager when blocked, unclear, or when the plan no longer matches reality.
10
+ - Reply to project-manager once per received VCM message when complete, blocked, or unclear; do not send fragmented progress updates unless project-manager explicitly requested them.
11
+ - If you need to send a VCM message, send at most one message to any single target role in the current Claude Code turn, then end the turn.
12
+ - After a successful vcmctl reply or vcmctl result, end the turn immediately. Do not run vcmctl inbox, poll, loop, or keep working while waiting for project-manager to answer.
13
+ - Do not wait in a loop for another role to answer. VCM will deliver later replies in a new turn.
14
+ - Do not use Claude Code Task/Subagent for VCM role delegation; communicate through vcmctl only.
10
15
  `;
11
16
  }
@@ -1,6 +1,7 @@
1
1
  export function renderGitignoreHarnessRules() {
2
2
  return [
3
3
  "# VCM local app state, task metadata, session records, and task worktrees.",
4
- ".ai/vcm/"
4
+ ".ai/vcm/",
5
+ ".claude/worktrees/"
5
6
  ].join("\n");
6
7
  }
@@ -5,6 +5,13 @@ export function renderProjectManagerHarnessRules() {
5
5
  - Clarify the user's request, classify task risk, and choose the role route.
6
6
  - Use vcmctl send to assign work to architect, coder, or reviewer.
7
7
  - Send role work as durable instructions with artifact refs when possible.
8
+ - Enforce per-role turn-taking: keep at most one in-flight message per target role.
9
+ - Before sending another task, question, revise, or review-request to the same role, wait for that role's vcmctl reply or vcmctl result.
10
+ - In one Claude Code turn, send at most one VCM message to any single target role.
11
+ - After a successful vcmctl send, end the turn immediately. Do not send another VCM message, run vcmctl inbox, poll for the target role's response, or keep the conversation open waiting for another agent.
12
+ - Continue orchestration only in a later turn after VCM delivers that role's vcmctl reply or vcmctl result.
13
+ - Do not use Claude Code Task/Subagent for VCM role delegation; VCM manages the four role sessions.
14
+ - Use cancel only for urgent supersession; include what is superseded.
8
15
  - Track the workflow gates: architecture plan, implementation/validation, review, docs sync, final acceptance.
9
16
  - Request architect post-review docs sync after reviewer completes.
10
17
  - Prepare final acceptance, commit, and PR only after reviewer and docs-sync gates pass or an explicit exception is approved.
@@ -9,5 +9,10 @@ export function renderReviewerHarnessRules() {
9
9
  - Escalate larger implementation issues to project-manager for coder follow-up.
10
10
  - Escalate architecture, public contract, design, or documentation drift issues to project-manager for architect follow-up.
11
11
  - Do not take over broad implementation and do not weaken tests to pass validation.
12
+ - Reply to project-manager once per received VCM message when complete, blocked, or unclear; do not send fragmented progress updates unless project-manager explicitly requested them.
13
+ - If you need to send a VCM message, send at most one message to any single target role in the current Claude Code turn, then end the turn.
14
+ - After a successful vcmctl reply or vcmctl result, end the turn immediately. Do not run vcmctl inbox, poll, loop, or keep working while waiting for project-manager to answer.
15
+ - Do not wait in a loop for another role to answer. VCM will deliver later replies in a new turn.
16
+ - Do not use Claude Code Task/Subagent for VCM role delegation; communicate through vcmctl only.
12
17
  `;
13
18
  }
@@ -17,7 +17,9 @@ ${artifactRefs}
17
17
 
18
18
  Instructions:
19
19
  - Read the message and execute only within this VCM task.
20
- - Reply to project-manager with vcmctl reply when complete, blocked, or unclear.
20
+ - Reply to project-manager with vcmctl result when complete, or vcmctl reply when blocked or unclear.
21
+ - After a successful vcmctl reply or vcmctl result, end this Claude Code turn immediately.
22
+ - Do not run vcmctl inbox, poll, loop, or wait for project-manager in this turn. VCM will deliver later replies in a new turn.
21
23
  [/VCM MESSAGE]
22
24
  `;
23
25
  }
@@ -41,7 +41,9 @@ function bindTerminalSocket(ws, sessionId, runtime) {
41
41
  runtime.write(sessionId, message.data);
42
42
  }
43
43
  else if (message.type === "resize") {
44
- runtime.resize(sessionId, message.cols, message.rows);
44
+ if (isSafeTerminalResize(message.cols, message.rows)) {
45
+ runtime.resize(sessionId, message.cols, message.rows);
46
+ }
45
47
  }
46
48
  }
47
49
  catch (error) {
@@ -53,6 +55,18 @@ function bindTerminalSocket(ws, sessionId, runtime) {
53
55
  unsubscribe();
54
56
  });
55
57
  }
58
+ export function isSafeTerminalResize(cols, rows) {
59
+ return (Number.isInteger(cols) &&
60
+ Number.isInteger(rows) &&
61
+ cols >= MIN_TERMINAL_COLS &&
62
+ rows >= MIN_TERMINAL_ROWS &&
63
+ cols <= MAX_TERMINAL_COLS &&
64
+ rows <= MAX_TERMINAL_ROWS);
65
+ }
66
+ const MIN_TERMINAL_COLS = 20;
67
+ const MIN_TERMINAL_ROWS = 5;
68
+ const MAX_TERMINAL_COLS = 1000;
69
+ const MAX_TERMINAL_ROWS = 200;
56
70
  function send(ws, message) {
57
71
  if (ws.readyState === ws.OPEN) {
58
72
  ws.send(JSON.stringify(message));
@@ -33,6 +33,10 @@ async function main(argv = process.argv.slice(2)) {
33
33
  console.log(JSON.stringify(response, null, 2));
34
34
  return;
35
35
  }
36
+ if (command === "hook-event") {
37
+ await sendHookEvent(await readStdinJson());
38
+ return;
39
+ }
36
40
  if (command === "ready") {
37
41
  console.log("ready: VCM readiness signaling is planned for a later phase.");
38
42
  return;
@@ -49,6 +53,31 @@ async function sendMessage(input) {
49
53
  });
50
54
  console.log(JSON.stringify(result, null, 2));
51
55
  }
56
+ async function sendHookEvent(event) {
57
+ const input = {
58
+ taskSlug: getTaskSlug(),
59
+ role: getEnvRole(),
60
+ event
61
+ };
62
+ await fetchJson(`${getApiUrl()}/api/hooks/claude-code`, {
63
+ method: "POST",
64
+ body: JSON.stringify(input),
65
+ headers: {
66
+ "content-type": "application/json"
67
+ }
68
+ });
69
+ }
70
+ async function readStdinJson() {
71
+ const chunks = [];
72
+ for await (const chunk of process.stdin) {
73
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
74
+ }
75
+ const raw = Buffer.concat(chunks).toString("utf8").trim();
76
+ if (!raw) {
77
+ return {};
78
+ }
79
+ return JSON.parse(raw);
80
+ }
52
81
  function parseOptions(args) {
53
82
  const options = {
54
83
  artifactRefs: []
@@ -133,6 +162,7 @@ Usage:
133
162
  vcmctl reply --type blocked --body "Need clarification."
134
163
  vcmctl result --body-file /tmp/result.md --artifact .ai/vcm/handoffs/implementation-log.md
135
164
  vcmctl inbox
165
+ vcmctl hook-event < hook-payload.json
136
166
  `);
137
167
  }
138
168
  main().catch((error) => {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};