next-issue 9.9.0 → 9.10.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' \
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": "9.10.0",
4
4
  "description": "Autonomous issue harness driven by the pi SDK",
5
5
  "keywords": [
6
6
  "github",