@howaboua/pi-codex-web-run 0.0.8 → 0.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
@@ -1,5 +1,11 @@
1
1
  # @howaboua/pi-codex-web-run
2
2
 
3
+ ## 0.0.9
4
+
5
+ - - Keep provider bookkeeping out of structured search results while preserving result references and content.
6
+ - Report unreadable responses and invalid tool configuration without parser or filesystem diagnostics.
7
+ - GPT mode uses note-style search-reference guidance.
8
+
3
9
  ## 0.0.8
4
10
 
5
11
  - - Added compact tool guidance for PCC GPT prompt mode. Other modes are unchanged.
@@ -22,7 +28,6 @@
22
28
  ## 0.0.4
23
29
 
24
30
  - GPT-6 Sol and Luna now share Astra's Codex support.
25
-
26
31
  - Removed `/terra`; use `/luna` instead.
27
32
  - Added Responses Lite, non-destructive reasoning changes and terse context guidance for GPT-6 Sol and Luna.
28
33
  - Image descriptions now use GPT-6 Luna directly instead of preferring older mini models.
@@ -40,6 +45,5 @@
40
45
  ## 0.0.1
41
46
 
42
47
  - Initial release of Web Run for Codex web search and page navigation in normal Pi, Code Mode, and Notebook Mode.
43
-
44
48
  - Search the web or images, open results, follow links, and find text while retaining reusable source references.
45
49
  - Use stock, renamed, or proxied Codex providers through a small JSON route file.
package/README.md CHANGED
@@ -22,11 +22,11 @@ For a proxy that renames Codex providers or models, create `pi-codex-tools.json`
22
22
 
23
23
  ```json
24
24
  {
25
- "providers": {
26
- "company-codex": {
27
- "gpt-6-luna": "company-luna"
28
- }
29
- }
25
+ "providers": {
26
+ "company-codex": {
27
+ "gpt-6-luna": "company-luna"
28
+ }
29
+ }
30
30
  }
31
31
  ```
32
32
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
3
3
  "vcs": {
4
4
  "enabled": true,
5
5
  "clientKind": "git",
package/index.ts CHANGED
@@ -37,7 +37,7 @@ export default async function webRunExtension(pi: ExtensionAPI): Promise<void> {
37
37
  : ordinary.description;
38
38
  if (active)
39
39
  tool.promptGuidelines = [
40
- "web_run: Calls: returned turn refs. Final citations: Markdown result URLs, never refs or cite….",
40
+ "web_run: calls=returned turn refs; final citations=Markdown result URLs; never refs/cite…",
41
41
  ];
42
42
  else if (ordinary.guidelines)
43
43
  tool.promptGuidelines = ordinary.guidelines;
@@ -75,7 +75,7 @@ async function registerWebRunInCodeMode(
75
75
  return registerCodeModeExtensionTools(pi, () => [
76
76
  adaptToolForCodeMode(tool, {
77
77
  usage: gpt()
78
- ? 'await tools.web__run({search_query?:[{q:string,recency?:number,domains?:string[]}],image_query?:[{q:string}],open?:[{ref_id:string,lineno?:number}],click?:[{ref_id:string,id:number}],find?:[{ref_id:string,pattern:string}],response_length?:"short"|"medium"|"long"}) // calls: returned ref_ids; final citations: Markdown result URLs, never refs/cite markers'
78
+ ? 'await tools.web__run({search_query?:[{q:string,recency?:number,domains?:string[]}],image_query?:[{q:string}],open?:[{ref_id:string,lineno?:number}],click?:[{ref_id:string,id:number}],find?:[{ref_id:string,pattern:string}],response_length?:"short"|"medium"|"long"}) // calls=returned ref_ids; final citations=Markdown result URLs; never refs/cite markers'
79
79
  : 'await tools.web__run({search_query?:[{q:string,recency?:number,domains?:string[]}],image_query?:[{q:string}],open?:[{ref_id:string,lineno?:number}],click?:[{ref_id:string,id:number}],find?:[{ref_id:string,pattern:string}],response_length?:"short"|"medium"|"long"}) // calls use returned ref_ids; final answers use Markdown result URLs, never refs/cite markers',
80
80
  promptMetadata: false,
81
81
  toolName: { namespace: "web", name: "run" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howaboua/pi-codex-web-run",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Codex web search and navigation for Pi, Code Mode and Notebook Mode.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,23 +44,23 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "proxy-from-env": "2.1.0",
47
- "undici": "8.12.2"
47
+ "undici": "8.12.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@earendil-works/pi-coding-agent": ">=1.0.0",
51
51
  "@earendil-works/pi-tui": ">=1.0.0",
52
52
  "typebox": "*",
53
- "@howaboua/pi-codex-conversion": ">=4.0.2"
53
+ "@howaboua/pi-codex-conversion": ">=4.0.5"
54
54
  },
55
55
  "devDependencies": {
56
- "@biomejs/biome": "^2.5.15",
57
- "@earendil-works/pi-coding-agent": "1.3.0",
58
- "@earendil-works/pi-tui": "1.3.0",
56
+ "@biomejs/biome": "^2.6.3",
57
+ "@earendil-works/pi-coding-agent": "1.4.0",
58
+ "@earendil-works/pi-tui": "1.4.0",
59
59
  "@types/node": "^26.6.5",
60
60
  "tsx": "^4.23.15",
61
- "typebox": "1.3.37",
61
+ "typebox": "1.4.3",
62
62
  "typescript": "^7.0.2",
63
- "@howaboua/pi-codex-conversion": "4.0.2"
63
+ "@howaboua/pi-codex-conversion": "4.0.5"
64
64
  },
65
65
  "pi": {
66
66
  "extensions": [
@@ -70,16 +70,15 @@ export function readCodexToolRouteConfig(
70
70
  error.code === "ENOENT"
71
71
  )
72
72
  return { providers: Object.create(null) };
73
- throw error;
73
+ throw new Error(
74
+ "Tool configuration could not be read. Ask the user to check " + path,
75
+ );
74
76
  }
75
77
  try {
76
78
  return normalizeCodexToolRouteConfig(JSON.parse(source));
77
- } catch (error) {
79
+ } catch {
78
80
  throw new Error(
79
- "Invalid pi-codex-tools config at " +
80
- path +
81
- ": " +
82
- (error instanceof Error ? error.message : String(error)),
81
+ "Tool configuration is invalid. Ask the user to check " + path,
83
82
  );
84
83
  }
85
84
  }
package/src/execute.ts CHANGED
@@ -151,7 +151,7 @@ export async function executeCodexWebSearch(
151
151
  try {
152
152
  parsed = JSON.parse(response.text);
153
153
  } catch {
154
- throw new Error("failed to decode web_run search response");
154
+ throw new Error("Web search returned an unreadable response. Try again.");
155
155
  }
156
156
  const details = normalizeSearchResponse(parsed);
157
157
  const text =
package/src/request.ts CHANGED
@@ -34,7 +34,14 @@ export function normalizeSearchResponse(value: unknown): WebRunOutput {
34
34
  typeof parsed["output_text"] === "string" ||
35
35
  Array.isArray(parsed["search_results"])
36
36
  )
37
- return parsed as WebRunOutput;
37
+ return {
38
+ ...(typeof parsed["output_text"] === "string"
39
+ ? { output_text: parsed["output_text"] }
40
+ : {}),
41
+ ...(Array.isArray(parsed["search_results"])
42
+ ? { search_results: parsed["search_results"] }
43
+ : {}),
44
+ };
38
45
  if (typeof parsed["output"] !== "string")
39
46
  throw new Error("web_run search returned no output");
40
47
  return {