@oh-my-pi/pi-agent-core 16.0.7 → 16.0.9

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.0.8] - 2026-06-18
6
+
7
+ ### Fixed
8
+
9
+ - Stopped the compaction `<files>` summary from tracking `scheme://` URLs — internal URIs (`conflict://`, `artifact://`, `local://`, `history://`, …) and web URLs are no longer recorded as files, and legacy entries rehydrated from older compaction summaries are dropped.
10
+
5
11
  ## [16.0.6] - 2026-06-18
6
12
 
7
13
  ### Added
@@ -26,6 +26,11 @@ export declare function splitReadSelector(path: string): {
26
26
  * and matches its write/edit path when computing Read/Write/RW markers.
27
27
  */
28
28
  export declare function stripReadSelector(path: string): string;
29
+ /**
30
+ * Whether `path` references a `scheme://` URL (internal URI or web URL) rather
31
+ * than a filesystem path that belongs in the compaction `<files>` summary.
32
+ */
33
+ export declare function isUrlSchemePath(path: string): boolean;
29
34
  /**
30
35
  * Extract file operations from tool calls in an assistant message.
31
36
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-agent-core",
4
- "version": "16.0.7",
4
+ "version": "16.0.9",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -35,11 +35,11 @@
35
35
  "fmt": "biome format --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@oh-my-pi/pi-ai": "16.0.7",
39
- "@oh-my-pi/pi-catalog": "16.0.7",
40
- "@oh-my-pi/pi-natives": "16.0.7",
41
- "@oh-my-pi/pi-utils": "16.0.7",
42
- "@oh-my-pi/snapcompact": "16.0.7",
38
+ "@oh-my-pi/pi-ai": "16.0.9",
39
+ "@oh-my-pi/pi-catalog": "16.0.9",
40
+ "@oh-my-pi/pi-natives": "16.0.9",
41
+ "@oh-my-pi/pi-utils": "16.0.9",
42
+ "@oh-my-pi/snapcompact": "16.0.9",
43
43
  "@opentelemetry/api": "^1.9.1"
44
44
  },
45
45
  "devDependencies": {
@@ -76,6 +76,23 @@ export function stripReadSelector(path: string): string {
76
76
  return splitReadSelector(path).path;
77
77
  }
78
78
 
79
+ /**
80
+ * A real filesystem path never contains a `scheme://` URL. Tool-call paths that
81
+ * do — `conflict://1`, `artifact://3`, `local://ctx.md`, `history://…`,
82
+ * `issue://12`, `https://…`, and the tolerated `file.ts:conflict://1` prefix
83
+ * form — are session-scoped or remote resources, not files the post-compaction
84
+ * agent can re-ground on. Keep them out of the `<files>` summary.
85
+ */
86
+ const URL_SCHEME_RE = /[a-z][a-z0-9+.-]*:\/\//i;
87
+
88
+ /**
89
+ * Whether `path` references a `scheme://` URL (internal URI or web URL) rather
90
+ * than a filesystem path that belongs in the compaction `<files>` summary.
91
+ */
92
+ export function isUrlSchemePath(path: string): boolean {
93
+ return URL_SCHEME_RE.test(path);
94
+ }
95
+
79
96
  /**
80
97
  * Extract file operations from tool calls in an assistant message.
81
98
  */
@@ -94,6 +111,10 @@ export function extractFileOpsFromMessage(message: AgentMessage, fileOps: FileOp
94
111
  const path = typeof args.path === "string" ? args.path : undefined;
95
112
  if (!path) continue;
96
113
 
114
+ // Internal URIs (conflict://, artifact://, local://, history://, …) and
115
+ // web URLs are not re-groundable files — keep them out of `<files>`.
116
+ if (isUrlSchemePath(path)) continue;
117
+
97
118
  switch (block.name) {
98
119
  case "read":
99
120
  fileOps.read.add(stripReadSelector(path));
@@ -113,8 +134,11 @@ export function extractFileOpsFromMessage(message: AgentMessage, fileOps: FileOp
113
134
  * Returns readFiles (files only read, not modified) and modifiedFiles.
114
135
  */
115
136
  export function computeFileLists(fileOps: FileOperations): { readFiles: string[]; modifiedFiles: string[] } {
116
- const modified = new Set([...fileOps.edited, ...fileOps.written]);
117
- const readOnly = [...fileOps.read].filter(f => !modified.has(f)).sort();
137
+ // Drop any `scheme://` URLs (e.g. legacy `conflict://`/`artifact://` entries
138
+ // rehydrated straight into `fileOps` from a pre-fix compaction summary) — only
139
+ // real files belong in `<files>`. New tool-call scans are already filtered.
140
+ const modified = new Set([...fileOps.edited, ...fileOps.written].filter(f => !isUrlSchemePath(f)));
141
+ const readOnly = [...fileOps.read].filter(f => !isUrlSchemePath(f) && !modified.has(f)).sort();
118
142
  const modifiedFiles = [...modified].sort();
119
143
  return { readFiles: readOnly, modifiedFiles };
120
144
  }