claude-comms 1.0.46 → 2.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 (54) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/README.md +12 -13
  3. package/package.json +6 -10
  4. package/.agents/AGENTS.md +0 -61
  5. package/.agents/repo.md +0 -18
  6. package/.agents/tools/README.md +0 -45
  7. package/.agents/tools/agent-job/README.md +0 -208
  8. package/.agents/tools/agent-job/__pycache__/agent_monitor.cpython-312.pyc +0 -0
  9. package/.agents/tools/agent-job/agent_job.py +0 -936
  10. package/.agents/tools/agent-job/agent_monitor.py +0 -575
  11. package/.agents/tools/agent-job/consultant_template.txt +0 -73
  12. package/.agents/tools/chrome-devtools/README.md +0 -101
  13. package/.agents/tools/chrome-devtools/browsertools.py +0 -839
  14. package/.agents/tools/chrome-devtools/config.json +0 -24
  15. package/.agents/tools/workflow/CONSUMER_SETUP.md +0 -114
  16. package/.agents/tools/workflow/ONBOARD.md +0 -167
  17. package/.agents/tools/workflow/README.md +0 -169
  18. package/.agents/tools/workflow/cli.ts +0 -726
  19. package/.agents/tools/workflow/config.example.json +0 -16
  20. package/.agents/tools/workflow/init.ts +0 -76
  21. package/.agents/tools/workflow/lib/file-tracker.test.ts +0 -81
  22. package/.agents/tools/workflow/lib/file-tracker.ts +0 -387
  23. package/.agents/tools/workflow/lib/harness-executor.ts +0 -649
  24. package/.agents/tools/workflow/lib/prompts.scenario.test.ts +0 -262
  25. package/.agents/tools/workflow/lib/prompts.ts +0 -548
  26. package/.agents/tools/workflow/lib/streams.test.ts +0 -140
  27. package/.agents/tools/workflow/lib/streams.ts +0 -254
  28. package/.agents/tools/workflow/runner.ts +0 -994
  29. package/.agents/tools/workflow/templates/document.md +0 -42
  30. package/.agents/tools/workflow/templates/implement.md +0 -117
  31. package/.agents/tools/workflow/templates/plan.md +0 -54
  32. package/.agents/tools/workflow/templates/pm.md +0 -84
  33. package/.agents/tools/workflow/templates/product-owner.md +0 -211
  34. package/.agents/tools/workflow/templates/review.md +0 -56
  35. package/.agents/tools/workflow/templates/uat.md +0 -71
  36. package/.claude/agents/core/engineer.md +0 -146
  37. package/.claude/commands/action-feedback-item.md +0 -27
  38. package/.claude/commands/install-feedback-widget.md +0 -599
  39. package/.claude/commands/learn.md +0 -32
  40. package/.claude/hooks/comms/__pycache__/register_subagent.cpython-312.pyc +0 -0
  41. package/.claude/hooks/comms/__pycache__/update_subagent_completion.cpython-312.pyc +0 -0
  42. package/.claude/hooks/comms/get_unread_messages.py +0 -71
  43. package/.claude/hooks/comms/register_subagent.py +0 -74
  44. package/.claude/hooks/comms/send_message.py +0 -87
  45. package/.claude/hooks/comms/update_subagent_completion.py +0 -126
  46. package/.claude/hooks/context/session_id.py +0 -35
  47. package/.claude/hooks/observability/send_event.py +0 -110
  48. package/.claude/hooks/session-data/get_session_data.py +0 -261
  49. package/.claude/hooks/session-data/intercept_session_id.py +0 -69
  50. package/.claude/hooks/utils/__pycache__/server_config.cpython-312.pyc +0 -0
  51. package/.claude/hooks/utils/server_config.py +0 -17
  52. package/.claude/settings.json +0 -108
  53. package/.claude/settings.local.json +0 -46
  54. package/CLAUDE.md +0 -240
@@ -1,254 +0,0 @@
1
- /**
2
- * Stream Handlers for different AI harnesses
3
- *
4
- * Parses JSON stream output from Claude, Codex, and Gemini CLIs.
5
- * Extracts text results, completion status, and session IDs.
6
- */
7
-
8
- // ============================================================================
9
- // Types
10
- // ============================================================================
11
-
12
- export interface StreamHandler {
13
- /** Process a JSON event from the harness output stream */
14
- onEvent(event: Record<string, unknown>): void;
15
- /** Get accumulated result text */
16
- getResult(): string;
17
- /** Check if the stream indicates successful completion */
18
- isComplete(): boolean;
19
- /** Get session ID for resume functionality (Claude only) */
20
- getSessionId(): string | null;
21
- /** Get a failure reason if a terminal error was observed */
22
- getFailureReason(): string | null;
23
- }
24
-
25
- export interface CommandOptions {
26
- /** Session ID for Claude session resume */
27
- sessionId?: string;
28
- }
29
-
30
- export interface CommandResult {
31
- cmd: string;
32
- args: string[];
33
- }
34
-
35
- // ============================================================================
36
- // Claude Stream Handler
37
- // ============================================================================
38
-
39
- export class ClaudeStreamHandler implements StreamHandler {
40
- private textChunks: string[] = [];
41
- private finalResult: string | null = null;
42
- private complete = false;
43
- private success = false;
44
- private sessionId: string | null = null;
45
- private failureReason: string | null = null;
46
-
47
- onEvent(event: Record<string, unknown>): void {
48
- const type = event.type as string;
49
-
50
- // Capture assistant text messages
51
- if (type === "assistant" && event.message) {
52
- const msg = event.message as {
53
- content?: Array<{ type?: string; text?: string }>;
54
- };
55
- if (msg.content) {
56
- for (const block of msg.content) {
57
- if (block.type === "text" && block.text) {
58
- this.textChunks.push(block.text);
59
- }
60
- }
61
- }
62
- }
63
-
64
- // Capture final result and session_id
65
- if (type === "result") {
66
- this.complete = true;
67
- const subtype = event.subtype as string | undefined;
68
- const isError = Boolean(event.is_error);
69
- this.success = subtype === "success" && !isError;
70
- if (event.result) {
71
- this.finalResult = String(event.result);
72
- }
73
- // Capture session_id for resume functionality
74
- if (event.session_id) {
75
- this.sessionId = String(event.session_id);
76
- }
77
- if (!this.success) {
78
- const reason = subtype || "error";
79
- this.failureReason = `claude_result_${reason}`;
80
- }
81
- }
82
- }
83
-
84
- getResult(): string {
85
- // Prefer the final result field, fall back to accumulated text
86
- return this.finalResult || this.textChunks.join("\n\n");
87
- }
88
-
89
- isComplete(): boolean {
90
- return this.complete && this.success;
91
- }
92
-
93
- getSessionId(): string | null {
94
- return this.sessionId;
95
- }
96
-
97
- getFailureReason(): string | null {
98
- return this.failureReason;
99
- }
100
- }
101
-
102
- // ============================================================================
103
- // Codex Stream Handler
104
- // ============================================================================
105
-
106
- export class CodexStreamHandler implements StreamHandler {
107
- private messages: string[] = [];
108
- private complete = false;
109
-
110
- onEvent(event: Record<string, unknown>): void {
111
- const type = event.type as string;
112
-
113
- if (type === "item.completed") {
114
- const item = event.item as { type?: string; text?: string } | undefined;
115
- if (item?.type === "agent_message" && item.text) {
116
- this.messages.push(item.text);
117
- }
118
- }
119
-
120
- if (type === "turn.completed") {
121
- this.complete = true;
122
- }
123
- }
124
-
125
- getResult(): string {
126
- return this.messages.join("\n\n");
127
- }
128
-
129
- isComplete(): boolean {
130
- return this.complete;
131
- }
132
-
133
- getSessionId(): string | null {
134
- return null; // Codex doesn't support session resume
135
- }
136
-
137
- getFailureReason(): string | null {
138
- return null;
139
- }
140
- }
141
-
142
- // ============================================================================
143
- // Gemini Stream Handler
144
- // ============================================================================
145
-
146
- export class GeminiStreamHandler implements StreamHandler {
147
- private buffer = "";
148
- private complete = false;
149
- private failureReason: string | null = null;
150
-
151
- onEvent(event: Record<string, unknown>): void {
152
- const type = event.type as string;
153
-
154
- if (type === "message" && event.role === "assistant") {
155
- const content = event.content as string | undefined;
156
- if (content) this.buffer += content;
157
- }
158
-
159
- if (type === "result") {
160
- this.complete = true;
161
- const status = event.status as string | undefined;
162
- if (status && status !== "success") {
163
- this.failureReason = `gemini_result_${status}`;
164
- }
165
- }
166
- }
167
-
168
- getResult(): string {
169
- return this.buffer;
170
- }
171
-
172
- isComplete(): boolean {
173
- return this.complete;
174
- }
175
-
176
- getSessionId(): string | null {
177
- return null; // Gemini doesn't support session resume
178
- }
179
-
180
- getFailureReason(): string | null {
181
- return this.failureReason;
182
- }
183
- }
184
-
185
- // ============================================================================
186
- // Factory Function
187
- // ============================================================================
188
-
189
- /**
190
- * Create appropriate stream handler for the given harness
191
- */
192
- export function createStreamHandler(harness: string): StreamHandler {
193
- switch (harness) {
194
- case "claude":
195
- return new ClaudeStreamHandler();
196
- case "codex":
197
- return new CodexStreamHandler();
198
- case "gemini":
199
- return new GeminiStreamHandler();
200
- default:
201
- return new ClaudeStreamHandler();
202
- }
203
- }
204
-
205
- // ============================================================================
206
- // Command Building
207
- // ============================================================================
208
-
209
- /**
210
- * Build command and arguments for spawning a harness process
211
- */
212
- export function buildCommand(
213
- harness: string,
214
- prompt: string,
215
- options: CommandOptions = {}
216
- ): CommandResult {
217
- switch (harness) {
218
- case "claude": {
219
- const args = [
220
- "--dangerously-skip-permissions",
221
- "--verbose",
222
- "--output-format",
223
- "stream-json",
224
- ];
225
-
226
- // Add --resume flag for session continuity
227
- if (options.sessionId) {
228
- args.push("--resume", options.sessionId);
229
- }
230
-
231
- args.push("-p", prompt);
232
- return { cmd: "claude", args };
233
- }
234
- case "codex":
235
- return {
236
- cmd: "codex",
237
- args: ["--yolo", "e", prompt, "--json"],
238
- };
239
- case "gemini":
240
- return {
241
- cmd: "gemini",
242
- args: [
243
- "--yolo",
244
- "-m",
245
- "gemini-2.5-pro",
246
- "--output-format",
247
- "stream-json",
248
- prompt,
249
- ],
250
- };
251
- default:
252
- throw new Error(`Unknown harness: ${harness}`);
253
- }
254
- }