pi-codex-tools 0.2.3 → 0.2.4

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/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ This project follows the spirit of [Keep a Changelog](https://keepachangelog.com
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.4] - 2026-09-11
10
+
11
+ ### Fixed
12
+
13
+ - Supply owned apply_patch grammar metadata to pi-codex-compaction through Pi's public event bus.
14
+
9
15
  ## [0.2.3] - 2026-08-11
10
16
 
11
17
  ### Changed
package/README.md CHANGED
@@ -40,6 +40,11 @@ These choices are based on the Codex tool specifications in `codex-rs/core/src/t
40
40
 
41
41
  ## Compatibility notes
42
42
 
43
+ With an updated `pi-codex-compaction` installed, the package supplies its owned
44
+ grammar metadata through Pi's public event bus. This keeps raw `apply_patch`
45
+ calls and results intact in direct Codex compaction requests, including Astra.
46
+ No private Pi registry is patched.
47
+
43
48
  `apply_patch` is line-oriented rather than byte-oriented:
44
49
 
45
50
  - `*** Add File` requires at least one `+` line and writes a trailing newline. A `+`-only hunk creates a one-newline file, not a zero-byte file.
@@ -90,6 +90,20 @@ export default function piCodexTools(pi: ExtensionAPI): void {
90
90
 
91
91
  let replacedToolsWasActive: Record<ReplacedTool, boolean> | undefined;
92
92
 
93
+ pi.events?.on("pi-codex-compaction:tools:v1", (value) => {
94
+ const data = value as {
95
+ model?: ExtensionContext["model"];
96
+ tools?: Array<{ name: string; parameters: unknown; constrainedSampling?: OpenAIGrammarSampling }>;
97
+ } | undefined;
98
+ if (!data || !supportsOpenAIGrammarTools(data.model) || !Array.isArray(data.tools)) return;
99
+ for (const tool of data.tools) {
100
+ // Do not attach our grammar to another extension's apply_patch override.
101
+ if (tool.name === APPLY_PATCH && tool.parameters === APPLY_PATCH_PARAMETERS) {
102
+ tool.constrainedSampling = createOpenAILarkSampling(APPLY_PATCH_GRAMMAR);
103
+ }
104
+ }
105
+ });
106
+
93
107
  function synchronizeTools(ctx: ExtensionContext): void {
94
108
  if (typeof pi.getActiveTools !== "function" || typeof pi.setActiveTools !== "function") return;
95
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-codex-tools",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Codex-compatible apply_patch tooling for Pi's grammar-capable OpenAI models.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -60,10 +60,10 @@
60
60
  "typebox": "*"
61
61
  },
62
62
  "devDependencies": {
63
- "@earendil-works/pi-ai": "^0.84.1",
64
- "@earendil-works/pi-coding-agent": "^0.84.1",
65
- "@earendil-works/pi-tui": "^0.84.1",
66
- "@types/node": "^26.1.2",
63
+ "@earendil-works/pi-ai": "^0.85.1",
64
+ "@earendil-works/pi-coding-agent": "^0.85.1",
65
+ "@earendil-works/pi-tui": "^0.85.1",
66
+ "@types/node": "^26.2.0",
67
67
  "prebuildify": "^6.0.1",
68
68
  "tsx": "^4.23.5",
69
69
  "typebox": "^1.3.10",