@oai404iao/pi-codex-minimal-tools 1.4.0 → 2.0.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.
Files changed (99) hide show
  1. package/README.md +44 -17
  2. package/THIRD_PARTY_NOTICES.md +20 -0
  3. package/config.schema.json +1 -2
  4. package/index.ts +2 -0
  5. package/package.json +14 -13
  6. package/provenance/openai-codex-ddea03ad-astra.json +54 -0
  7. package/src/activation.ts +1 -56
  8. package/src/adapter/compaction/checkpoint.ts +1 -0
  9. package/src/adapter/compaction/collect.ts +1 -0
  10. package/src/adapter/compaction/http.ts +1 -0
  11. package/src/adapter/compaction/request.ts +1 -0
  12. package/src/adapter/compaction/transport.ts +1 -0
  13. package/src/adapter/compaction/websocket.ts +1 -0
  14. package/src/background-image-generation.ts +1 -574
  15. package/src/capabilities.ts +1 -146
  16. package/src/codex-http.ts +1 -133
  17. package/src/codex-identity-extension.ts +1 -339
  18. package/src/codex-request-profile.ts +1 -45
  19. package/src/codex-reserved-tools.ts +1 -323
  20. package/src/codex-wire-identity.ts +1 -596
  21. package/src/extension/prewarm-snapshot.ts +1 -0
  22. package/src/extension/provider-presentation.ts +1 -0
  23. package/src/extension/provider-runtime.ts +1 -0
  24. package/src/extension/register.ts +36 -0
  25. package/src/extension/startup-prewarm.ts +1 -0
  26. package/src/fast-mode.ts +1 -124
  27. package/src/glyphs.ts +1 -70
  28. package/src/index.ts +8 -331
  29. package/src/model-catalog/catalog.ts +1 -636
  30. package/src/model-catalog/default-models.json +8 -0
  31. package/src/model-catalog/runtime.ts +1 -113
  32. package/src/model-catalog/types.ts +1 -95
  33. package/src/native-compaction.ts +1 -393
  34. package/src/patch/apply.ts +1 -338
  35. package/src/patch/parser.ts +1 -224
  36. package/src/patch/render.ts +1 -201
  37. package/src/provider-headers.ts +1 -54
  38. package/src/provider-native-tools.ts +1 -71
  39. package/src/provider-shim.ts +20 -4511
  40. package/src/providers/codex-apply-patch-tool.ts +1 -23
  41. package/src/providers/openai-codex/cache-key.ts +1 -0
  42. package/src/providers/openai-codex/captured-stream.ts +1 -0
  43. package/src/providers/openai-codex/constants.ts +1 -0
  44. package/src/providers/openai-codex/continuation.ts +1 -0
  45. package/src/providers/openai-codex/errors.ts +1 -0
  46. package/src/providers/openai-codex/events.ts +1 -0
  47. package/src/providers/openai-codex/headers.ts +1 -0
  48. package/src/providers/openai-codex/lite.ts +1 -0
  49. package/src/providers/openai-codex/message.ts +1 -0
  50. package/src/providers/openai-codex/prewarm.ts +1 -0
  51. package/src/providers/openai-codex/proxy.ts +1 -0
  52. package/src/providers/openai-codex/reasoning.ts +1 -0
  53. package/src/providers/openai-codex/request-body.ts +1 -0
  54. package/src/providers/openai-codex/request-context.ts +1 -0
  55. package/src/providers/openai-codex/request-metadata.ts +1 -0
  56. package/src/providers/openai-codex/retry.ts +1 -0
  57. package/src/providers/openai-codex/runtime.ts +1 -0
  58. package/src/providers/openai-codex/sse.ts +1 -0
  59. package/src/providers/openai-codex/stream-effects.ts +1 -0
  60. package/src/providers/openai-codex/stream.ts +1 -0
  61. package/src/providers/openai-codex/types.ts +1 -0
  62. package/src/providers/openai-codex/urls.ts +1 -0
  63. package/src/providers/openai-codex/usage.ts +1 -0
  64. package/src/providers/openai-codex/websocket-connection.ts +1 -0
  65. package/src/providers/openai-codex/websocket-events.ts +1 -0
  66. package/src/providers/openai-codex/websocket-session.ts +1 -0
  67. package/src/providers/openai-codex/websocket-socket.ts +1 -0
  68. package/src/providers/openai-codex/websocket-stream.ts +1 -0
  69. package/src/providers/openai-responses-shared.ts +7 -1463
  70. package/src/providers/responses/citations.ts +1 -0
  71. package/src/providers/responses/history.ts +1 -0
  72. package/src/providers/responses/items.ts +1 -0
  73. package/src/providers/responses/markdown.ts +1 -0
  74. package/src/providers/responses/messages.ts +1 -0
  75. package/src/providers/responses/signatures.ts +1 -0
  76. package/src/providers/responses/stream-state.ts +1 -0
  77. package/src/providers/responses/stream.ts +1 -0
  78. package/src/providers/responses/text-renderer.ts +1 -0
  79. package/src/providers/responses/text.ts +1 -0
  80. package/src/providers/responses/tool-identity.ts +1 -0
  81. package/src/providers/responses/tools.ts +1 -0
  82. package/src/providers/responses/types.ts +1 -0
  83. package/src/providers/responses/usage.ts +1 -0
  84. package/src/settings.ts +1 -247
  85. package/src/subagent-inline.ts +1 -8
  86. package/src/tools/apply-patch.ts +1 -84
  87. package/src/tools/image-generation/capture.ts +1 -0
  88. package/src/tools/image-generation/display.ts +1 -0
  89. package/src/tools/image-generation/preview.ts +1 -0
  90. package/src/tools/image-generation/storage.ts +1 -0
  91. package/src/tools/image-generation/types.ts +1 -0
  92. package/src/tools/image-generation.ts +1 -274
  93. package/src/tools/view-image.ts +1 -98
  94. package/src/tools/web-search/activity.ts +1 -0
  95. package/src/tools/web-search/capture.ts +1 -0
  96. package/src/tools/web-search/render.ts +1 -0
  97. package/src/tools/web-search.ts +1 -554
  98. package/src/utils/images.ts +1 -73
  99. package/src/utils/theme.ts +1 -0
package/README.md CHANGED
@@ -3,11 +3,15 @@
3
3
  Codex-specific Responses support for Pi, driven by an exact per-model JSON
4
4
  catalog instead of model-name heuristics.
5
5
 
6
- Compatibility: Pi 0.84.2 or newer; tested against 0.84.2.
6
+ Peer floor: Pi 0.85.1; tested against 0.85.1.
7
7
 
8
- > npm identity: `@oai404iao/pi-codex-minimal-tools`. Version `1.3.0` is
9
- > prepared for a one-time manually authenticated npm bootstrap from a reviewed
10
- > public `main` commit.
8
+ > npm identity stays `@oai404iao/pi-codex-minimal-tools`. This checkout composes
9
+ > core, web-search and imagegen through a shared runtime. The four new packages
10
+ > are alpha bootstrap candidates. Guarded bundle publication remains blocked
11
+ > until those dependencies are bootstrapped and separately activated.
12
+ > Previously published tarballs are unchanged. See
13
+ > [package composition](../../docs/codex-packages.md) for local installation tests
14
+ > and version/lifecycle restrictions; this is not a new npm release.
11
15
 
12
16
  > **Compatibility boundary:** Responses Lite uses an internal Codex request
13
17
  > shape. This package pins and tests a compatibility serialization for exact
@@ -52,13 +56,15 @@ sessions; it does not register providers, tools, commands, or renderers.
52
56
 
53
57
  ## Install
54
58
 
55
- After `1.3.0` is available on npm:
59
+ After the reviewed split-package alpha and its dependencies are available on npm:
56
60
 
57
61
  ```bash
58
- pi install npm:@oai404iao/pi-codex-minimal-tools@1.3.0
62
+ pi install npm:@oai404iao/pi-codex-minimal-tools@1.4.1-alpha.0
59
63
  ```
60
64
 
61
- Before the initial bootstrap, or when testing unreleased source:
65
+ Until then, test a complete repository checkout after running the root
66
+ `npm ci --ignore-scripts`; an isolated bundle source directory cannot supply
67
+ its unpublished workspace dependencies:
62
68
 
63
69
  ```bash
64
70
  pi install /absolute/path/to/pi-codex-minimal-tools
@@ -107,6 +113,7 @@ Without `PI_CODING_AGENT_DIR`, Pi normally uses `~/.config/pi/agent` or
107
113
  "glyphStyle": "unicode",
108
114
  "autoEnable": true,
109
115
  "fastMode": false,
116
+ "imageGeneration": true,
110
117
  "imageOutputDir": ".pi/openai-codex-images",
111
118
  "imageModel": "gpt-image-2",
112
119
  "directImageApiFallback": false,
@@ -121,6 +128,7 @@ Without `PI_CODING_AGENT_DIR`, Pi normally uses `~/.config/pi/agent` or
121
128
  | `glyphStyle` | Use `unicode` or `ascii` UI glyphs. |
122
129
  | `autoEnable` | Add supported package tools automatically. |
123
130
  | `fastMode` | Global user toggle; only profiles with `fast` are affected. |
131
+ | `imageGeneration` | Global master switch. Set `false` to omit image tools, `/image-gen`, presentation, hosted injection, standalone requests, and direct fallback without changing other model behavior. |
124
132
  | `imageOutputDir` | Generated-image output directory. Relative paths resolve from the workspace root. |
125
133
  | `imageModel` | Image model used by standalone/hosted image requests and direct fallback. |
126
134
  | `directImageApiFallback` | Permit the separate `OPENAI_API_KEY` Images API fallback. |
@@ -128,7 +136,8 @@ Without `PI_CODING_AGENT_DIR`, Pi normally uses `~/.config/pi/agent` or
128
136
  | `deferApplyPatchRendering` | Use Pi's fallback renderer instead of the streaming patch preview. |
129
137
 
130
138
  The older model-level keys remain readable for one migration version, but are
131
- deprecated. See [Legacy migration](#legacy-migration).
139
+ deprecated. `imageGeneration` is the exception: it remains the supported global
140
+ master switch. See [Legacy migration](#legacy-migration).
132
141
 
133
142
  ### Per-Model Catalog
134
143
 
@@ -291,10 +300,12 @@ Important constraints:
291
300
  ## Built-In Profiles
292
301
 
293
302
  The bundled catalog is based on local Codex commit
294
- `eb9dceba1a2e658142a456c5898836774835616b` from August 12, 2026.
303
+ `eb9dceba1a2e658142a456c5898836774835616b` from August 12, 2026, with the
304
+ Astra profile updated from `ddea03ad049142943bdbf13e937b1d67e8c1ba0c`.
295
305
 
296
306
  | Models | Responses | Web | Image | Patch | Compaction |
297
307
  | --- | --- | --- | --- | --- | --- |
308
+ | `openai-codex/gpt-6-astra` | Lite, auto WS/SSE | standalone text+image | standalone | custom | responses |
298
309
  | `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna` | Lite, auto WS/SSE | standalone text+image | standalone | custom | responses |
299
310
  | `gpt-5.5`, `gpt-5.4` | Standard, auto WS/SSE | hosted text+image | standalone | custom | responses |
300
311
  | `gpt-5.4-mini`, `codex-auto-review` | Standard, auto WS/SSE | hosted text+image | standalone | custom | responses |
@@ -303,8 +314,19 @@ The bundled catalog is based on local Codex commit
303
314
  | `gpt-4.1` | Standard SSE | off | hosted | off | Pi |
304
315
  | `o4-mini` | Standard SSE | off | off | off | Pi |
305
316
 
306
- Equivalent `openai/...` and `openai-codex/...` IDs are included; the latter
307
- switch only the endpoint/auth shape to `codex`.
317
+ The pre-Astra entries include equivalent `openai/...` and
318
+ `openai-codex/...` IDs; the latter switch only the endpoint/auth shape to
319
+ `codex`. Astra is bundled only for `openai-codex`, matching the analyzed
320
+ ChatGPT subscription route. A public-API or proxy Astra deployment requires an
321
+ explicit user profile for that endpoint.
322
+
323
+ Pi 0.85.1 provides the Astra model descriptor; it is now the package peer
324
+ floor. The extension composes its stream shim over that provider and does not
325
+ replace authentication, streams, or the model catalog.
326
+ The descriptor keeps the production default at 272,000 context tokens and
327
+ 128,000 output tokens. A backend-authorized larger context must be selected
328
+ explicitly through Pi's provider `modelOverrides`; the extension does not infer
329
+ that entitlement from the Astra slug.
308
330
 
309
331
  These entries are defaults, not claims that every proxy with the same model
310
332
  slug supports the protocol. Override or disable a profile for the endpoint
@@ -329,6 +351,10 @@ raw result text.
329
351
 
330
352
  ## Image Generation
331
353
 
354
+ Set global `config.json.imageGeneration` to `false` to disable the entire
355
+ generation capability. Per-model `tools.imageGeneration:false` disables only
356
+ that profile. Neither setting disables image input or historical image replay.
357
+
332
358
  `tools.imageGeneration` supports:
333
359
 
334
360
  - `hosted`: Responses `image_generation`.
@@ -401,14 +427,15 @@ model override for compatibility:
401
427
  | `requestProfile.systemPromptPlacement` | `responses.systemPromptPlacement` |
402
428
  | `requestProfile.patchTransport` | `tools.applyPatch` |
403
429
  | `apiKeyMode` | `responses.endpoint` |
404
- | `imageGeneration` | `tools.imageGeneration` |
405
430
  | `webSearchEnabled` | `tools.webSearch` |
406
431
  | `viewImage` | `tools.viewImage` |
407
432
  | `applyPatchEnabled` | `tools.applyPatch` |
408
433
  | `additionalModelIds` | one exact user catalog entry per model |
409
434
 
410
435
  Move these values to extension `models.json`; legacy projection is intended
411
- only as a transition path.
436
+ only as a transition path. `imageGeneration` is no longer a legacy projection:
437
+ it is the supported global gate, while per-model selection stays in
438
+ `tools.imageGeneration`.
412
439
 
413
440
  ## Protocol Reference
414
441
 
@@ -424,8 +451,8 @@ Third-party material retains its own terms; see
424
451
  [LICENSE](LICENSE) and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
425
452
 
426
453
  The Codex namespace-tool source attribution is recorded in
427
- `provenance/openai-codex-eb9dceba-reserved-tools.json`. The `1.3.0` source
428
- revision is intentionally staged for its one-time manual npm bootstrap and
429
- excluded from guarded GitHub Actions release artifacts until trusted publishing
430
- is configured. Responses Lite remains an internal Codex compatibility path,
454
+ `provenance/openai-codex-eb9dceba-reserved-tools.json`. The existing bundle has
455
+ configured trusted publishing, but the split-package alpha still requires
456
+ dependency-first bootstrap and activation of the four new packages before
457
+ guarded publication can proceed. Responses Lite remains an internal Codex compatibility path,
431
458
  not an OpenAI-supported public API contract.
@@ -1,5 +1,15 @@
1
1
  # Third-party notices
2
2
 
3
+ ## Split ownership
4
+
5
+ The local implementation paths described below are retained as compatibility
6
+ forwards or verified asset mirrors. Their adaptations now live in
7
+ `@oai404iao/pi-codex-core`; namespace serialization lives in
8
+ `@oai404iao/pi-codex-runtime/src/reserved-tools/`. Those packages retain the
9
+ original modification notices, Apache snapshots and provenance. Search/image
10
+ clients live in their respective capability packages. No upstream revision or
11
+ reviewed reserved-tool fingerprint changed during this move.
12
+
3
13
  ## OpenAI Codex
4
14
 
5
15
  This package includes and analyzes material from
@@ -49,6 +59,16 @@ The repository's `reference/` directory contains protocol analysis based on
49
59
  both Codex revisions above. It is development documentation and is excluded
50
60
  from the npm tarball.
51
61
 
62
+ ### GPT-6 Astra profile
63
+
64
+ The Astra profile is derived from Codex model/request metadata at revision
65
+ [`ddea03ad049142943bdbf13e937b1d67e8c1ba0c`](https://github.com/openai/codex/commit/ddea03ad049142943bdbf13e937b1d67e8c1ba0c)
66
+ and cross-checked against the MIT-licensed
67
+ `@earendil-works/pi-ai@0.85.1` generated catalog. The Codex file/blob hashes
68
+ and locked npm tarball identity are recorded in
69
+ `provenance/openai-codex-ddea03ad-astra.json`. This delta does not repin or
70
+ modify the reserved namespace-tool and apply-patch grammar fingerprints.
71
+
52
72
  ### Modified namespace-tool compatibility serialization
53
73
 
54
74
  `src/codex-reserved-tools.ts` is a modified TypeScript compatibility
@@ -109,8 +109,7 @@
109
109
  },
110
110
  "imageGeneration": {
111
111
  "type": "boolean",
112
- "description": "Deprecated compatibility override. Move per-model image-generation support to extension models.json.",
113
- "deprecated": true,
112
+ "description": "Global image-generation master switch. false disables image tools, commands, presentation, hosted injection, standalone endpoints, and direct fallback without changing other model-profile behavior.",
114
113
  "default": true
115
114
  },
116
115
  "webSearchEnabled": {
package/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from "./src/index.js";
2
+ export * from "./src/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oai404iao/pi-codex-minimal-tools",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "Model-profiled Codex Responses tools for Pi: WebSocket, Lite, web search, images, compaction, and apply_patch",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,25 +33,25 @@
33
33
  },
34
34
  "pi": {
35
35
  "extensions": [
36
- "./src/index.ts"
36
+ "./index.ts"
37
37
  ]
38
38
  },
39
39
  "peerDependencies": {
40
- "@earendil-works/pi-ai": ">=0.84.2",
41
- "@earendil-works/pi-coding-agent": ">=0.84.2",
42
- "@earendil-works/pi-tui": ">=0.84.2",
40
+ "@earendil-works/pi-ai": ">=0.85.1",
41
+ "@earendil-works/pi-coding-agent": ">=0.85.1",
42
+ "@earendil-works/pi-tui": ">=0.85.1",
43
43
  "typebox": "*"
44
44
  },
45
45
  "dependencies": {
46
- "https-proxy-agent": "^9.1.0",
47
- "socks-proxy-agent": "^10.1.0",
48
- "undici": "^8.10.0",
49
- "ws": "^8.21.1"
46
+ "@oai404iao/pi-codex-runtime": "0.1.0",
47
+ "@oai404iao/pi-codex-core": "0.1.0",
48
+ "@oai404iao/pi-codex-web-search": "0.1.0",
49
+ "@oai404iao/pi-codex-imagegen": "0.1.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@earendil-works/pi-ai": "^0.84.2",
53
- "@earendil-works/pi-coding-agent": "^0.84.2",
54
- "@earendil-works/pi-tui": "^0.84.2",
52
+ "@earendil-works/pi-ai": "0.85.1",
53
+ "@earendil-works/pi-coding-agent": "0.85.1",
54
+ "@earendil-works/pi-tui": "0.85.1",
55
55
  "@types/node": "^26.2.0",
56
56
  "tsx": "^4.20.6",
57
57
  "typebox": "^1.1.24",
@@ -63,6 +63,7 @@
63
63
  "check": "npm run typecheck && npm test"
64
64
  },
65
65
  "files": [
66
+ "index.ts",
66
67
  "src/",
67
68
  "provenance/",
68
69
  "README.md",
@@ -87,5 +88,5 @@
87
88
  "optional": true
88
89
  }
89
90
  },
90
- "gitHead": "a93559be8f8b02739310c492b36270b13607fbf9"
91
+ "gitHead": "88cb6f56447d88b71232cd764ca5b29251341d23"
91
92
  }
@@ -0,0 +1,54 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "upstream": {
4
+ "repository": "https://github.com/openai/codex",
5
+ "revision": "ddea03ad049142943bdbf13e937b1d67e8c1ba0c",
6
+ "commitUrl": "https://github.com/openai/codex/commit/ddea03ad049142943bdbf13e937b1d67e8c1ba0c",
7
+ "license": "Apache-2.0"
8
+ },
9
+ "files": {
10
+ "LICENSE": {
11
+ "role": "upstream Apache-2.0 license",
12
+ "gitBlobSha": "4606e72e042564097e8780d66c1d4dcb611869bd",
13
+ "sha256": "d17f227e4df5da1600391338865ce0f3055211760a36688f816941d58232d8dc",
14
+ "rawUrl": "https://raw.githubusercontent.com/openai/codex/ddea03ad049142943bdbf13e937b1d67e8c1ba0c/LICENSE"
15
+ },
16
+ "NOTICE": {
17
+ "role": "upstream NOTICE",
18
+ "gitBlobSha": "2805899d56d0332d175cfc613c67d45d6f006db7",
19
+ "sha256": "9d71575ecfd9a843fc1677b0efb08053c6ba9fd686a0de1a6f5382fd3c220915",
20
+ "rawUrl": "https://raw.githubusercontent.com/openai/codex/ddea03ad049142943bdbf13e937b1d67e8c1ba0c/NOTICE"
21
+ },
22
+ "codex-rs/models-manager/models.json": {
23
+ "role": "GPT-6 Astra capabilities and defaults",
24
+ "gitBlobSha": "1b5ce2c515986f84147abe5f4fb6e9b0deab0470",
25
+ "sha256": "897614e513a591b362f76c34e4b4d31af5809a2b52f8c0ab57f2990c5bf4ab3d",
26
+ "rawUrl": "https://raw.githubusercontent.com/openai/codex/ddea03ad049142943bdbf13e937b1d67e8c1ba0c/codex-rs/models-manager/models.json"
27
+ },
28
+ "codex-rs/models-manager/src/model_info.rs": {
29
+ "role": "model metadata representation and context-window limits",
30
+ "gitBlobSha": "ca1006993137d66de19137ff136f7ac8d36f9da3",
31
+ "sha256": "919883a4a15f6f3cace2ec78388aa7f9f8e042f74f553877843552ed55bf15bf",
32
+ "rawUrl": "https://raw.githubusercontent.com/openai/codex/ddea03ad049142943bdbf13e937b1d67e8c1ba0c/codex-rs/models-manager/src/model_info.rs"
33
+ },
34
+ "codex-rs/core/src/client.rs": {
35
+ "role": "Responses Lite and WebSocket request behavior",
36
+ "gitBlobSha": "8d2db30d7bb942cd030cb8d511eaafba8cbe46dd",
37
+ "sha256": "6a9b3d5d60293ca694e1642c905b574c2c12da490cff1c165e485f35a81f6edb",
38
+ "rawUrl": "https://raw.githubusercontent.com/openai/codex/ddea03ad049142943bdbf13e937b1d67e8c1ba0c/codex-rs/core/src/client.rs"
39
+ }
40
+ },
41
+ "catalogReference": {
42
+ "package": "@earendil-works/pi-ai",
43
+ "version": "0.85.1",
44
+ "license": "MIT",
45
+ "repository": "https://github.com/earendil-works/pi",
46
+ "tarballIntegrity": "sha512-+VgVIJDkDO2efYJKEEqvPTH4zmnIaXdAppGbO+vKFA9qy5PdhFiAenuFAkU+oiCSfOC4dMHDyrjdQeL4ZoC5CQ==",
47
+ "path": "dist/providers/data/openai-codex.json",
48
+ "sha256": "a10bfcfd34db6bcb98d8ee46175e154cab30530a137dbf31ac1434020ed3ffdd"
49
+ },
50
+ "localImplementations": [
51
+ "pi-codex-runtime/src/model-catalog/default-models.json",
52
+ "pi-codex-minimal-tools/src/model-catalog/default-models.json"
53
+ ]
54
+ }
package/src/activation.ts CHANGED
@@ -1,56 +1 @@
1
- import type { ModelLike } from "./capabilities.js";
2
- import { listResolvedModelProfiles, resolveModelProfile } from "./model-catalog/catalog.js";
3
- import type { CodexMinimalToolsSettings } from "./settings.js";
4
-
5
- export interface ModelRegistryLike {
6
- getAll?: () => unknown;
7
- getAvailable?: () => unknown;
8
- find?: (provider: string, id: string) => unknown;
9
- }
10
-
11
- export interface ActivationContextLike {
12
- model?: ModelLike;
13
- modelRegistry?: ModelRegistryLike;
14
- }
15
-
16
- export function registryModels(registry: ModelRegistryLike | undefined): ModelLike[] {
17
- if (!registry) return [];
18
- for (const method of [registry.getAll, registry.getAvailable]) {
19
- if (typeof method !== "function") continue;
20
- try {
21
- const value = method.call(registry);
22
- if (Array.isArray(value)) return value.filter((model): model is ModelLike => Boolean(model) && typeof model === "object");
23
- } catch {
24
- // Try the next registry shape.
25
- }
26
- }
27
- return [];
28
- }
29
-
30
- export function hasConfiguredModelsLoaded(
31
- ctx: ActivationContextLike,
32
- settings?: CodexMinimalToolsSettings,
33
- ): boolean {
34
- const current = resolveModelProfile(ctx.model, { settings });
35
- if (current?.effective.enabled) return true;
36
- const configured = new Set(
37
- listResolvedModelProfiles({ settings })
38
- .filter((profile) => profile.effective.enabled)
39
- .map((profile) => profile.id.toLowerCase()),
40
- );
41
- if (registryModels(ctx.modelRegistry).some((model) => {
42
- const provider = model.provider?.trim().toLowerCase();
43
- const id = model.id?.trim().toLowerCase();
44
- return Boolean(provider && id && configured.has(`${provider}/${id}`));
45
- })) {
46
- return true;
47
- }
48
- try {
49
- return [...configured].some((fullId) => {
50
- const slash = fullId.indexOf("/");
51
- return Boolean(ctx.modelRegistry?.find?.(fullId.slice(0, slash), fullId.slice(slash + 1)));
52
- });
53
- } catch {
54
- return false;
55
- }
56
- }
1
+ export * from "@oai404iao/pi-codex-runtime/internal/activation";
@@ -0,0 +1 @@
1
+ export * from "@oai404iao/pi-codex-core/internal/adapter/compaction/checkpoint";
@@ -0,0 +1 @@
1
+ export * from "@oai404iao/pi-codex-core/internal/adapter/compaction/collect";
@@ -0,0 +1 @@
1
+ export * from "@oai404iao/pi-codex-core/internal/adapter/compaction/http";
@@ -0,0 +1 @@
1
+ export * from "@oai404iao/pi-codex-core/internal/adapter/compaction/request";
@@ -0,0 +1 @@
1
+ export * from "@oai404iao/pi-codex-core/internal/adapter/compaction/transport";
@@ -0,0 +1 @@
1
+ export * from "@oai404iao/pi-codex-core/internal/adapter/compaction/websocket";