@oh-my-pi/pi-coding-agent 14.9.2 → 14.9.3

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 (49) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/package.json +7 -7
  3. package/scripts/format-prompts.ts +3 -3
  4. package/src/config/prompt-templates.ts +0 -5
  5. package/src/config/settings-schema.ts +38 -0
  6. package/src/eval/eval.lark +10 -31
  7. package/src/eval/index.ts +1 -0
  8. package/src/eval/parse.ts +156 -255
  9. package/src/eval/sniff.ts +28 -0
  10. package/src/export/html/template.css +38 -0
  11. package/src/export/html/template.generated.ts +1 -1
  12. package/src/export/html/template.js +209 -15
  13. package/src/hashline/constants.ts +20 -0
  14. package/src/hashline/grammar.lark +16 -23
  15. package/src/hashline/hash.ts +4 -34
  16. package/src/hashline/input.ts +16 -2
  17. package/src/hashline/parser.ts +12 -1
  18. package/src/internal-urls/agent-protocol.ts +1 -0
  19. package/src/internal-urls/artifact-protocol.ts +1 -0
  20. package/src/internal-urls/docs-index.generated.ts +2 -1
  21. package/src/internal-urls/jobs-protocol.ts +1 -0
  22. package/src/internal-urls/local-protocol.ts +1 -0
  23. package/src/internal-urls/mcp-protocol.ts +1 -0
  24. package/src/internal-urls/memory-protocol.ts +1 -0
  25. package/src/internal-urls/pi-protocol.ts +1 -0
  26. package/src/internal-urls/router.ts +2 -1
  27. package/src/internal-urls/rule-protocol.ts +1 -0
  28. package/src/internal-urls/skill-protocol.ts +1 -0
  29. package/src/internal-urls/types.ts +18 -2
  30. package/src/prompts/system/custom-system-prompt.md +0 -2
  31. package/src/prompts/system/now-prompt.md +7 -0
  32. package/src/prompts/system/project-prompt.md +2 -0
  33. package/src/prompts/system/subagent-system-prompt.md +18 -9
  34. package/src/prompts/system/subagent-user-prompt.md +1 -10
  35. package/src/prompts/system/system-prompt.md +154 -233
  36. package/src/prompts/tools/bash.md +0 -24
  37. package/src/prompts/tools/eval.md +26 -13
  38. package/src/session/agent-session.ts +49 -17
  39. package/src/system-prompt.ts +8 -9
  40. package/src/task/executor.ts +9 -5
  41. package/src/task/index.ts +38 -31
  42. package/src/tools/bash.ts +15 -41
  43. package/src/tools/eval.ts +13 -36
  44. package/src/tools/path-utils.ts +21 -1
  45. package/src/tools/read.ts +69 -27
  46. package/src/tools/search.ts +13 -1
  47. package/src/utils/file-display-mode.ts +11 -5
  48. package/src/task/template.ts +0 -47
  49. package/src/tools/bash-normalize.ts +0 -107
package/CHANGELOG.md CHANGED
@@ -2,6 +2,51 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [14.9.3] - 2026-05-10
6
+ ### Breaking Changes
7
+
8
+ - Changed the `eval` tool input format to canonical `*** Begin <LANG>` ... `*** End <LANG>` cells with `*** Title`, `*** Timeout`, and `*** Reset` directives, so legacy `===== ... =====` eval inputs are no longer accepted for execution
9
+ - Removed the `sectionSeparator` re-export from `config/prompt-templates`, so existing imports from `@oh-my-pi/pi-coding-agent/config/prompt-templates` now need to resolve `sectionSeparator` from its utility package
10
+
11
+ ### Added
12
+
13
+ - Added support for the `*** Abort` recovery marker in eval and hashline parsing to terminate processing safely when stream corruption is detected
14
+ - Added support for wrapping hashline edits in `*** Begin Patch` and `*** End Patch` markers so patch input with these envelopes is parsed and applied
15
+ - Added support in the HTML export renderer for the new `*** Begin`/`*** End` eval cell format
16
+ - Added a dedicated `[now]` prompt block to `buildSystemPrompt` output containing current date, current working directory, and required end-of-turn continuation/verification guidance
17
+ - Added a new `[project]` prompt block wrapper around workstation and workspace context and ensured it is emitted as a separate system prompt segment
18
+ - Added dedicated HTML rendering for `eval` tool calls, including cell-by-cell parsing of `===== ... =====` blocks with inferred Python/JS/TypeScript highlighting
19
+ - Added dedicated rendering support for `search`, `recipe`, and `irc` tool calls in transcript exports
20
+ - Added a collapsible `Available Tools` section with a tool count and chip-style compact tool names
21
+ - Added macOS power assertion settings `power.preventIdleSleep`, `power.preventSystemSleep`, `power.declareUserActive`, and `power.preventDisplaySleep` so users can control what types of sleep are blocked during sessions
22
+
23
+ ### Changed
24
+
25
+ - Kept legacy `===== ... =====` eval transcripts renderable in HTML while adding parsing for the new `*** Begin` format for newer transcripts
26
+ - Changed the system prompt’s Bash usage guidance to explicitly forbid specific anti-patterns (`sed`/`awk` line-range reads, stderr redirects, and `| head|tail` pagination) and require using dedicated tools for those operations
27
+ - Changed delegated subagent prompts so shared task context is now rendered only in the system-level `[context]` block, while the user-facing task message now contains only the assignment prompt text
28
+ - Changed system prompt rendering to use block markers such as `[env]`, `[contract]`, `[role]`, `[coop]`, and `[closure]` for more explicit structural instructions
29
+ - Changed the working-directory value in rendered prompts to use `shortenPath` before interpolation
30
+ - Updated subagent prompt assembly to compose prompt blocks and place the `[now]` block after the subagent-specific instructions
31
+ - Changed GitHub (`gh`) tool cards to include operation, PR, branch, and truncated query/title/body details
32
+ - Changed tool-call output to display internal `_i` intent separately and hide it from rendered argument JSON
33
+ - Changed `ast_edit` and `find`/`search` rendering to show resolved path values and option flags such as `limit`, `no-hidden`, and `no-reply`
34
+ - Changed power assertion behavior to take effect only while a prompt is in flight, replacing session-level persistent assertions
35
+
36
+ ### Removed
37
+
38
+ - Removed the unused `head` and `tail` parameters from the `bash` tool schema, along with the dead `normalizeBashCommand` / `applyHeadTail` post-processing module — output truncation is already handled by the harness's streaming tail buffer and artifact spillover, so the agent should rely on `read` (or the artifact link) instead of inline truncation pipes.
39
+
40
+ ### Fixed
41
+
42
+ - Fixed eval tool outputs to append a truncation warning and ask users to re-issue remaining work when parsing is aborted by `*** Abort`
43
+ - Fixed hashline parsing and input splitting to stop at `*** Abort` and ignore trailing edits after the marker
44
+ - Fixed subagent task prompt construction so a trailing `[now]` block in the base prompts is preserved and not swallowed when rendering `subagent-system-prompt`
45
+ - Fixed edit rendering so provided `input` text is shown in the export even without a file path
46
+ - Fixed `args.paths` handling in `ast_edit` and `find` so multiple paths are shown as a comma-separated list
47
+ - Fixed power assertion state handling so subsequent prompts are no longer blocked after an aborted or canceled prompt
48
+ - Fixed IRC background exchange poll loop leaking after session disposal: `#scheduleBackgroundExchangeFlush` now stops immediately when `dispose()` is called, preventing stale `setTimeout` callbacks from firing against a torn-down agent
49
+
5
50
  ## [14.9.2] - 2026-05-10
6
51
  ### Added
7
52
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-coding-agent",
4
- "version": "14.9.2",
4
+ "version": "14.9.3",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -47,12 +47,12 @@
47
47
  "@agentclientprotocol/sdk": "0.21.0",
48
48
  "@babel/parser": "^7.29.3",
49
49
  "@mozilla/readability": "^0.6.0",
50
- "@oh-my-pi/omp-stats": "14.9.2",
51
- "@oh-my-pi/pi-agent-core": "14.9.2",
52
- "@oh-my-pi/pi-ai": "14.9.2",
53
- "@oh-my-pi/pi-natives": "14.9.2",
54
- "@oh-my-pi/pi-tui": "14.9.2",
55
- "@oh-my-pi/pi-utils": "14.9.2",
50
+ "@oh-my-pi/omp-stats": "14.9.3",
51
+ "@oh-my-pi/pi-agent-core": "14.9.3",
52
+ "@oh-my-pi/pi-ai": "14.9.3",
53
+ "@oh-my-pi/pi-natives": "14.9.3",
54
+ "@oh-my-pi/pi-tui": "14.9.3",
55
+ "@oh-my-pi/pi-utils": "14.9.3",
56
56
  "@puppeteer/browsers": "^2.13.0",
57
57
  "@sinclair/typebox": "^0.34.49",
58
58
  "@types/turndown": "5.0.6",
@@ -16,9 +16,9 @@ import { prompt } from "@oh-my-pi/pi-utils";
16
16
  */
17
17
  import { Glob } from "bun";
18
18
 
19
- const PROMPTS_DIR = new URL("../src/prompts/", import.meta.url).pathname;
20
- const COMMIT_PROMPTS_DIR = new URL("../src/commit/prompts/", import.meta.url).pathname;
21
- const AGENTIC_PROMPTS_DIR = new URL("../src/commit/agentic/prompts/", import.meta.url).pathname;
19
+ const PROMPTS_DIR = `${import.meta.dir}/../src/prompts/`;
20
+ const COMMIT_PROMPTS_DIR = `${import.meta.dir}/../src/commit/prompts/`;
21
+ const AGENTIC_PROMPTS_DIR = `${import.meta.dir}/../src/commit/agentic/prompts/`;
22
22
 
23
23
  const PROMPT_DIRS = [PROMPTS_DIR, COMMIT_PROMPTS_DIR, AGENTIC_PROMPTS_DIR];
24
24
 
@@ -30,11 +30,6 @@ prompt.registerHelper("jtdToTypeScript", (schema: unknown): string => {
30
30
  }
31
31
  });
32
32
 
33
- // `sectionSeparator` + SECTION_SEPARATOR helper live in pi-utils/prompt so every
34
- // template consumer gets them registered without a coupling back to this module.
35
- // Re-exported here for call sites that already reference the coding-agent path.
36
- export { sectionSeparator } from "@oh-my-pi/pi-utils/prompt";
37
-
38
33
  function formatHashlineRef(lineNum: unknown, content: unknown): { num: number; text: string; ref: string } {
39
34
  const num = typeof lineNum === "number" ? lineNum : Number.parseInt(String(lineNum), 10);
40
35
  const raw = typeof content === "string" ? content : String(content ?? "");
@@ -243,6 +243,44 @@ export const SETTINGS_SCHEMA = {
243
243
  description: "Automatically resume the most recent session in the current directory",
244
244
  },
245
245
  },
246
+
247
+ // macOS power assertions (caffeinate flags). No-op on other platforms.
248
+ "power.preventIdleSleep": {
249
+ type: "boolean",
250
+ default: true,
251
+ ui: {
252
+ tab: "interaction",
253
+ label: "Prevent Idle Sleep (macOS)",
254
+ description: "caffeinate -i: keep the system awake while a session is open",
255
+ },
256
+ },
257
+ "power.preventSystemSleep": {
258
+ type: "boolean",
259
+ default: false,
260
+ ui: {
261
+ tab: "interaction",
262
+ label: "Prevent System Sleep on AC (macOS)",
263
+ description: "caffeinate -s: block all system sleep while on AC power",
264
+ },
265
+ },
266
+ "power.declareUserActive": {
267
+ type: "boolean",
268
+ default: false,
269
+ ui: {
270
+ tab: "interaction",
271
+ label: "Declare User Active (macOS)",
272
+ description: "caffeinate -u: keep the display lit and treat the user as active",
273
+ },
274
+ },
275
+ "power.preventDisplaySleep": {
276
+ type: "boolean",
277
+ default: false,
278
+ ui: {
279
+ tab: "interaction",
280
+ label: "Prevent Display Sleep (macOS)",
281
+ description: "caffeinate -d: keep the display from idle-sleeping while a session is open",
282
+ },
283
+ },
246
284
  shellPath: { type: "string", default: undefined },
247
285
 
248
286
  extensions: { type: "array", default: EMPTY_STRING_ARRAY },
@@ -1,37 +1,16 @@
1
- %import common.LF
2
- %import common.WS_INLINE
3
-
4
- // Canonical Eval input. Each cell is introduced by a header line:
5
- //
6
- // ===== <info> =====
7
- //
8
- // where each side is at least 5 equal signs. The info between the bars is
9
- // a list of space-separated tokens, all optional, in any order:
10
- //
11
- // py | js | ts language for this cell
12
- // py:"..." | js:"..." | ts:"..." language plus title shorthand
13
- // id:"..." cell title (when language unchanged)
14
- // t:<digits>(ms|s|m)? per-cell timeout (default 30s)
15
- // rst reset this language's kernel before running
16
- //
17
- // Everything between one header line and the next (or end of input) is
18
- // the cell's code, verbatim. The runtime additionally accepts content
19
- // before the first header as an implicit default-language cell, but that
20
- // is lenient fallback only and MUST NOT be relied on.
21
-
22
1
  start: cell+
23
- cell: header LF code_line*
24
2
 
25
- header: BAR (WS_INLINE attr)+ WS_INLINE BAR
26
- | BAR WS_INLINE? BAR
3
+ cell: begin_cell attr* code_line* end_cell
4
+ begin_cell: "*** Begin " LANG LF
5
+ end_cell: "*** End Cell" LF?
27
6
 
28
- attr: LANG_TITLE | LANG | ID_ATTR | T_ATTR | RST_FLAG
7
+ attr: title | timeout | reset
8
+ title: "*** Title: " /(.+)/ LF
9
+ timeout: "*** Timeout: " /\d+(ms|s|m)?/ LF
10
+ reset: "*** Reset" LF
29
11
 
30
12
  code_line: /[^\r\n]*/ LF
31
13
 
32
- BAR: /={5,}/
33
- LANG: "py" | "js" | "ts"
34
- LANG_TITLE: ("py" | "js" | "ts") ":\"" /[^"\r\n]*/ "\""
35
- ID_ATTR: "id:\"" /[^"\r\n]*/ "\""
36
- T_ATTR: "t:" /\d+(ms|s|m)?/
37
- RST_FLAG: "rst"
14
+ LANG: "JS" | "TS" | "PY"
15
+
16
+ %import common.LF
package/src/eval/index.ts CHANGED
@@ -2,4 +2,5 @@ export * from "./backend";
2
2
  export { default as jsBackend } from "./js";
3
3
  export * from "./parse";
4
4
  export { default as pythonBackend } from "./py";
5
+ export * from "./sniff";
5
6
  export * from "./types";