zerg-status 2.0.0 → 2.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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * pr command - Set or clear the PR URL for the session.
3
+ *
4
+ * Usage:
5
+ * zerg-status -s <id> pr "https://github.com/org/repo/pull/123"
6
+ * zerg-status -s <id> pr clear
7
+ */
8
+ export declare function prCommand(sessionId: string, prUrl: string): void;
@@ -0,0 +1,14 @@
1
+ import { setPr } from '../state.js';
2
+ import { formatStatusOutput } from '../output.js';
3
+ /**
4
+ * pr command - Set or clear the PR URL for the session.
5
+ *
6
+ * Usage:
7
+ * zerg-status -s <id> pr "https://github.com/org/repo/pull/123"
8
+ * zerg-status -s <id> pr clear
9
+ */
10
+ export function prCommand(sessionId, prUrl) {
11
+ const url = prUrl.toLowerCase() === 'clear' ? null : prUrl;
12
+ const state = setPr(sessionId, url);
13
+ console.log(formatStatusOutput(state));
14
+ }
@@ -1 +1,11 @@
1
- export declare function summaryCommand(sessionId: string, text: string): void;
1
+ /**
2
+ * summary command - Set a prose description of current work state.
3
+ *
4
+ * Shown in expanded/focus view (not on cards - use 'now' for that).
5
+ * Update when significant progress is made, not on every tool call.
6
+ *
7
+ * Usage:
8
+ * zerg-status -s <id> summary "I've fixed the major lint errors and integrated
9
+ * all components. Now applying type fixes to ensure a clean build."
10
+ */
11
+ export declare function summaryCommand(sessionId: string, summary: string): void;
@@ -1,8 +1,16 @@
1
1
  import { setSummary } from '../state.js';
2
- import { validateSummary } from '../validate.js';
3
2
  import { formatStatusOutput } from '../output.js';
4
- export function summaryCommand(sessionId, text) {
5
- const validText = validateSummary(text);
6
- const state = setSummary(sessionId, validText);
3
+ /**
4
+ * summary command - Set a prose description of current work state.
5
+ *
6
+ * Shown in expanded/focus view (not on cards - use 'now' for that).
7
+ * Update when significant progress is made, not on every tool call.
8
+ *
9
+ * Usage:
10
+ * zerg-status -s <id> summary "I've fixed the major lint errors and integrated
11
+ * all components. Now applying type fixes to ensure a clean build."
12
+ */
13
+ export function summaryCommand(sessionId, summary) {
14
+ const state = setSummary(sessionId, summary);
7
15
  console.log(formatStatusOutput(state));
8
16
  }
package/dist/index.d.ts CHANGED
@@ -5,9 +5,12 @@
5
5
  * COMMANDS:
6
6
  * npx zerg-status init "Session Name" # Initialize session with name
7
7
  * npx zerg-status -s <id> now "Activity" # Set current activity (while working)
8
+ * npx zerg-status -s <id> summary "Prose..." # Set prose summary of current state
8
9
  * npx zerg-status -s <id> ask "Question?" # Set blocked state with question
9
10
  * npx zerg-status -s <id> ask "Q?" -- "A: desc" "B: desc" # With clickable options
10
11
  * npx zerg-status -s <id> done "Result summary" # Set done state with summary
12
+ * npx zerg-status -s <id> pr "https://..." # Report a PR URL
13
+ * npx zerg-status -s <id> pr clear # Clear the PR URL
11
14
  * npx zerg-status -s <id> tasks set "A" "B" "C" # Set task list
12
15
  * npx zerg-status -s <id> task doing "A" # Mark task in progress
13
16
  * npx zerg-status -s <id> task done "A" # Mark task complete
package/dist/index.js CHANGED
@@ -5,17 +5,22 @@
5
5
  * COMMANDS:
6
6
  * npx zerg-status init "Session Name" # Initialize session with name
7
7
  * npx zerg-status -s <id> now "Activity" # Set current activity (while working)
8
+ * npx zerg-status -s <id> summary "Prose..." # Set prose summary of current state
8
9
  * npx zerg-status -s <id> ask "Question?" # Set blocked state with question
9
10
  * npx zerg-status -s <id> ask "Q?" -- "A: desc" "B: desc" # With clickable options
10
11
  * npx zerg-status -s <id> done "Result summary" # Set done state with summary
12
+ * npx zerg-status -s <id> pr "https://..." # Report a PR URL
13
+ * npx zerg-status -s <id> pr clear # Clear the PR URL
11
14
  * npx zerg-status -s <id> tasks set "A" "B" "C" # Set task list
12
15
  * npx zerg-status -s <id> task doing "A" # Mark task in progress
13
16
  * npx zerg-status -s <id> task done "A" # Mark task complete
14
17
  */
15
18
  import { init } from './commands/init.js';
16
19
  import { nowCommand } from './commands/now.js';
20
+ import { summaryCommand } from './commands/summary.js';
17
21
  import { askCommand } from './commands/ask.js';
18
22
  import { doneCommand } from './commands/done.js';
23
+ import { prCommand } from './commands/pr.js';
19
24
  import { taskCommand } from './commands/task.js';
20
25
  import { tasksCommand } from './commands/tasks.js';
21
26
  import { validateSessionId, ValidationError } from './validate.js';
@@ -64,14 +69,28 @@ COMMANDS:
64
69
  init "Session Name" Initialize session (outputs ZERG_SESSION:<id>:<name>)
65
70
 
66
71
  -s <id> now "Activity" Set current activity (max 50 chars, while working)
72
+ -s <id> summary "Prose..." Set prose summary of current work state (max 500 chars)
67
73
  -s <id> ask "Question?" Set blocked state with question
68
74
  -s <id> ask "Q?" -- "A" "B" Set blocked with clickable options (2-5 options)
69
75
  -s <id> done "Result summary" Set done state with result summary
76
+ -s <id> pr "https://..." Report a PR URL (supersedes Devin's PR tracking)
77
+ -s <id> pr clear Clear the PR URL
70
78
 
71
79
  -s <id> tasks set "A" "B" "C" Set task list (shows progress bar)
72
80
  -s <id> task doing "Task" Mark task as in progress
73
81
  -s <id> task done "Task" Mark task as complete
74
82
 
83
+ FIELD PURPOSES:
84
+ now: What you're doing RIGHT NOW (for scanning session cards)
85
+ "Fixing type errors in actions.ts"
86
+
87
+ summary: Prose paragraph about CURRENT STATE of work (for expanded view)
88
+ "I've fixed the major lint errors and integrated all components.
89
+ Now applying type fixes to ensure a clean build."
90
+
91
+ done: Final result summary when finished
92
+ "Implemented feature X. All 12 tests pass."
93
+
75
94
  OPTIONS FORMAT:
76
95
  Options use "Name: Description" format. Description is optional.
77
96
  Example: "Redis: Faster, needs separate server"
@@ -85,12 +104,16 @@ EXAMPLES:
85
104
  npx zerg-status -s f7a3b2c1 tasks set "Investigate" "Fix" "Test"
86
105
  npx zerg-status -s f7a3b2c1 task doing "Investigate"
87
106
  npx zerg-status -s f7a3b2c1 now "Analyzing auth module"
107
+ npx zerg-status -s f7a3b2c1 summary "Found the auth bug in JWT validation. The refresh token logic has a race condition when multiple requests arrive simultaneously."
88
108
 
89
109
  # When blocked with options
90
110
  npx zerg-status -s f7a3b2c1 ask "Which database?" -- \\
91
111
  "Redis: Faster, requires separate server" \\
92
112
  "PostgreSQL: Simpler, uses existing DB"
93
113
 
114
+ # Report a PR
115
+ npx zerg-status -s f7a3b2c1 pr "https://github.com/org/repo/pull/123"
116
+
94
117
  # When finished
95
118
  npx zerg-status -s f7a3b2c1 done "Fixed auth bug. JWT refresh working, 8 tests added."
96
119
 
@@ -127,6 +150,15 @@ function main() {
127
150
  doneCommand(validSessionId, summary);
128
151
  break;
129
152
  }
153
+ case 'pr': {
154
+ const validSessionId = validateSessionId(sessionId);
155
+ const prUrl = args.join(' ');
156
+ if (!prUrl) {
157
+ throw new ValidationError('PR URL required. Example: pr "https://github.com/org/repo/pull/123" or pr clear');
158
+ }
159
+ prCommand(validSessionId, prUrl);
160
+ break;
161
+ }
130
162
  case 'now': {
131
163
  const validSessionId = validateSessionId(sessionId);
132
164
  const text = args.join(' ');
@@ -136,6 +168,15 @@ function main() {
136
168
  nowCommand(validSessionId, text);
137
169
  break;
138
170
  }
171
+ case 'summary': {
172
+ const validSessionId = validateSessionId(sessionId);
173
+ const text = args.join(' ');
174
+ if (!text) {
175
+ throw new ValidationError('Summary text required. Example: summary "I\'ve fixed the lint errors and am now adding tests."');
176
+ }
177
+ summaryCommand(validSessionId, text);
178
+ break;
179
+ }
139
180
  case 'task': {
140
181
  const validSessionId = validateSessionId(sessionId);
141
182
  const [action, ...rest] = args;
package/dist/state.d.ts CHANGED
@@ -25,3 +25,8 @@ export declare function setAsk(sessionId: string, question: string, optionString
25
25
  * This is the new unified command that sets state=done AND stores the summary.
26
26
  */
27
27
  export declare function setDone(sessionId: string, summary: string): ZergState;
28
+ /**
29
+ * Set PR URL for the session.
30
+ * This supersedes Devin's native PR tracking - agents can report PRs directly.
31
+ */
32
+ export declare function setPr(sessionId: string, prUrl: string | null): ZergState;
package/dist/state.js CHANGED
@@ -3,7 +3,7 @@ import path from 'path';
3
3
  import os from 'os';
4
4
  import crypto from 'crypto';
5
5
  import { DEFAULT_STATE } from './types.js';
6
- import { validateTaskCount, validateTask, validateAsk, validateDone, validateAskOptions } from './validate.js';
6
+ import { validateTaskCount, validateTask, validateAsk, validateDone, validateAskOptions, validatePrUrl, validateSummary } from './validate.js';
7
7
  const STATE_DIR = path.join(os.homedir(), '.zerg-status');
8
8
  function ensureStateDir() {
9
9
  if (!fs.existsSync(STATE_DIR)) {
@@ -72,6 +72,7 @@ export function setNow(sessionId, now) {
72
72
  return updateState(sessionId, { now });
73
73
  }
74
74
  export function setSummary(sessionId, summary) {
75
+ validateSummary(summary);
75
76
  return updateState(sessionId, { summary });
76
77
  }
77
78
  export function setNotify(sessionId, notify) {
@@ -158,3 +159,21 @@ export function setDone(sessionId, summary) {
158
159
  saveState(state);
159
160
  return state;
160
161
  }
162
+ /**
163
+ * Set PR URL for the session.
164
+ * This supersedes Devin's native PR tracking - agents can report PRs directly.
165
+ */
166
+ export function setPr(sessionId, prUrl) {
167
+ const state = loadState(sessionId);
168
+ if (prUrl === null) {
169
+ // Clear PR
170
+ delete state.pr;
171
+ }
172
+ else {
173
+ // Validate and set PR URL
174
+ validatePrUrl(prUrl);
175
+ state.pr = prUrl;
176
+ }
177
+ saveState(state);
178
+ return state;
179
+ }
package/dist/types.d.ts CHANGED
@@ -17,11 +17,12 @@ export interface ZergState {
17
17
  name?: string;
18
18
  state: State;
19
19
  now: string;
20
+ summary?: string;
20
21
  ask?: string;
21
22
  askOptions?: AskOption[];
22
23
  done?: string;
24
+ pr?: string;
23
25
  tasks: Task[];
24
- summary?: string;
25
26
  question?: string;
26
27
  notify?: string;
27
28
  }
@@ -14,6 +14,7 @@ export declare const MIN_OPTIONS = 2;
14
14
  export declare const MAX_OPTIONS = 5;
15
15
  export declare const MAX_OPTION_NAME_LENGTH = 30;
16
16
  export declare const MAX_OPTION_DESC_LENGTH = 50;
17
+ export declare const MAX_PR_URL_LENGTH = 500;
17
18
  export declare class ValidationError extends Error {
18
19
  constructor(message: string);
19
20
  }
@@ -42,3 +43,7 @@ export declare function parseOption(optionStr: string): AskOption;
42
43
  * Validates and parses ask options
43
44
  */
44
45
  export declare function validateAskOptions(optionStrings: string[]): AskOption[];
46
+ /**
47
+ * Validates a PR URL
48
+ */
49
+ export declare function validatePrUrl(url: string): string;
package/dist/validate.js CHANGED
@@ -14,6 +14,8 @@ export const MIN_OPTIONS = 2;
14
14
  export const MAX_OPTIONS = 5;
15
15
  export const MAX_OPTION_NAME_LENGTH = 30;
16
16
  export const MAX_OPTION_DESC_LENGTH = 50;
17
+ // PR validation
18
+ export const MAX_PR_URL_LENGTH = 500;
17
19
  export class ValidationError extends Error {
18
20
  constructor(message) {
19
21
  super(message);
@@ -133,3 +135,16 @@ export function validateAskOptions(optionStrings) {
133
135
  }
134
136
  return optionStrings.map(parseOption);
135
137
  }
138
+ /**
139
+ * Validates a PR URL
140
+ */
141
+ export function validatePrUrl(url) {
142
+ if (url.length > MAX_PR_URL_LENGTH) {
143
+ throw new ValidationError(`PR URL too long (${url.length} chars). Max ${MAX_PR_URL_LENGTH} chars.`);
144
+ }
145
+ // Basic URL validation - must look like a URL
146
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
147
+ throw new ValidationError(`Invalid PR URL. Must start with http:// or https://`);
148
+ }
149
+ return url;
150
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zerg-status",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Progress reporting CLI for Zerg dashboard",
5
5
  "type": "module",
6
6
  "bin": {