next-issue 9.9.0 → 10.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.
package/README.md CHANGED
@@ -143,7 +143,7 @@ At the start of a run, the harness deletes the files and folders under `.next-is
143
143
 
144
144
  A short text summary of the same data goes to standard output. Use `--json` to get the full summary object there instead, so the harness fits in a pipe. All progress goes to standard error.
145
145
 
146
- Recorded for each step: `claim`, `comments`, `reply`, `worktree`, `setup`, `editors`, `implement`, `review`, `fix`, `commit-fix`, `rebase`, `land`, `ci-checks`, `revert` and `hunt`, each with a `.start`, `.end` or `.error` event and a duration in `ms`. Every `git` and `gh` command is recorded with its exit code and duration. A `tool` event holds the tool name, and for a `bash` tool the command too. Each agent call adds a `usage` event with the tokens, the turn count, the tool-call count, the model and the session id. A call that times out, ends with a model error or is stopped after its session started adds one too, and its tokens count in the summary totals.
146
+ Recorded for each step: `claim`, `comments`, `reply`, `worktree`, `setup`, `editors`, `implement`, `review`, `fix`, `commit-fix`, `rebase`, `land`, `ci-checks`, `revert` and `hunt`, each with a `.start`, `.end` or `.error` event and a duration in `ms`. Every `git` and `gh` command is recorded with its exit code and duration. A `tool` event holds the tool name. For a `bash` tool it holds the command too, and for a `read`, `write`, `edit`, `grep`, `find` or `ls` tool the `path` it got, relative to the worktree when inside it. Each agent call adds a `usage` event with the tokens, the turn count, the tool-call count, the model and the session id. A call that times out, ends with a model error or is stopped after its session started adds one too, and its tokens count in the summary totals.
147
147
 
148
148
  ```bash
149
149
  jq -r 'select(.kind=="usage") | [.issue,.role,.turns,.total] | @tsv' \
@@ -342,7 +342,7 @@ With `next-issue start --hunt`, which turns on `--watch`, the harness runs a hun
342
342
 
343
343
  With `huntCap` at 1 and no ready issue, a hunt files at most one issue. The hunter ends its reply with one `issue:` line for each issue it filed, or one `issue: none` line; a url that is not an issue of the repository of `remote` does not count as filed. When the `remote` url holds an old owner or name that GitHub redirects after a rename or transfer, the harness asks GitHub for the new one, so an issue url with the new name counts too. The run log holds one `hunt.issue` event with the `url` for each, or one with `none`. A hunt that fails writes a `hunt.error` event and the watch goes on. The hunter then waits before the next hunt, with a `hunt.wait` event and the same back-off, so a failure, or a hunt that files nothing, that repeats waits 1, 2, 3, 5, 10, then 10 minutes, and the back-off goes back to 1 minute after a hunt that files at least one issue. The next pass claims the new issues like any other. At the first `Ctrl-C` the hunter stops after its current hunt, and the watch ends once the hunt and the running issues end. A first `Ctrl-C` during the watch wait tells you so while a hunt runs, and the third press stops the hunter at once. The hunter stops too when the watch ends for another reason.
344
344
 
345
- In a run of the `serve` worker, a client can switch hunting and watching on or off while the run goes on, with no restart, for example with `/next-issue hunt on` or `/next-issue watch on` in the pi extension, see [Worker](#worker). This works only for runs of the worker, not for a command-line run.
345
+ In a run of the `serve` worker, a client can switch hunting and watching on or off while the run goes on, with no restart, for example with Hunt on or Watch on in the `/next-issue` menu of the pi extension, see [Worker](#worker). This works only for runs of the worker, not for a command-line run.
346
346
 
347
347
  ## Worker
348
348
 
package/dist/agents.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { dirname, join } from 'node:path';
2
+ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { getAgentDir, } from '@earendil-works/pi-coding-agent';
5
5
  import { openSession } from './agent-session.mjs';
@@ -50,7 +50,7 @@ export async function runAgent(recorder, request) {
50
50
  throw timeoutError(request);
51
51
  }
52
52
  opened = session;
53
- const unsubscribe = session.subscribe((event) => observe(log, event));
53
+ const unsubscribe = session.subscribe((event) => observe(log, event, request.cwd));
54
54
  const release = onStop(end);
55
55
  try {
56
56
  refuseWhenStopped();
@@ -127,9 +127,9 @@ function sessionResult(recorder, request, session, started) {
127
127
  sessionId: stats.sessionId,
128
128
  };
129
129
  }
130
- function observe(log, event) {
130
+ function observe(log, event, cwd) {
131
131
  if (event.type === 'tool_execution_start') {
132
- log.event('tool', toolFields(event.toolName, event.args));
132
+ log.event('tool', toolFields(event.toolName, event.args, cwd));
133
133
  }
134
134
  else if (event.type === 'tool_execution_end' && event.isError) {
135
135
  log.event('tool.error', { tool: event.toolName }, 'quiet');
@@ -140,10 +140,24 @@ function observe(log, event) {
140
140
  process.stderr.write(event.assistantMessageEvent.delta);
141
141
  }
142
142
  }
143
- export function toolFields(name, input) {
144
- if (name !== 'bash' || !isRecord(input)) {
143
+ const PATH_TOOLS = new Set(['read', 'write', 'edit', 'grep', 'find', 'ls']);
144
+ export function toolFields(name, input, cwd) {
145
+ if (!isRecord(input)) {
145
146
  return { tool: name };
146
147
  }
147
- const { command } = input;
148
- return typeof command === 'string' ? { tool: name, command } : { tool: name };
148
+ const { command, path } = input;
149
+ if (name === 'bash' && typeof command === 'string') {
150
+ return { tool: name, command };
151
+ }
152
+ if (PATH_TOOLS.has(name) && typeof path === 'string') {
153
+ return { tool: name, path: shortPath(path, cwd) };
154
+ }
155
+ return { tool: name };
156
+ }
157
+ function shortPath(path, cwd) {
158
+ const inside = relative(cwd, resolve(cwd, path));
159
+ if (inside === '') {
160
+ return '.';
161
+ }
162
+ return inside === '..' || inside.startsWith(`..${sep}`) || isAbsolute(inside) ? path : inside;
149
163
  }
package/dist/progress.mjs CHANGED
@@ -7,7 +7,12 @@ export function startProgress(hunting = false) {
7
7
  function toolLine(record) {
8
8
  const tool = String(record['tool']);
9
9
  const command = record['command'];
10
- const line = typeof command === 'string' ? `${tool} ${command.split('\n')[0]}` : tool;
10
+ const path = record['path'];
11
+ const line = typeof command === 'string'
12
+ ? `${tool} ${command.split('\n')[0]}`
13
+ : typeof path === 'string'
14
+ ? `${tool} ${path}`
15
+ : tool;
11
16
  return truncate(line, TOOL_LINE_MAX, '…');
12
17
  }
13
18
  function stageName(step, record) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-issue",
3
- "version": "9.9.0",
3
+ "version": "10.0.0",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",