@e4779/pi-fabric 0.109.4-fork.24 → 0.116.0-fork.26
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/README.md +3 -1
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/agents/completion-inbox.d.ts.map +1 -1
- package/dist/agents/handoff.d.ts +1 -1
- package/dist/agents/handoff.d.ts.map +1 -1
- package/dist/agents/manager.d.ts +8 -0
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/provider-bridge.d.ts +64 -0
- package/dist/agents/provider-bridge.d.ts.map +1 -0
- package/dist/agents/provider-bridge.js +117 -0
- package/dist/agents/provider-bridge.js.map +7 -0
- package/dist/agents/runner-registry.d.ts +3 -0
- package/dist/agents/runner-registry.d.ts.map +1 -1
- package/dist/agents/trace-context-request.d.ts +4 -0
- package/dist/agents/trace-context-request.d.ts.map +1 -0
- package/dist/agents/trace-context.d.ts +31 -0
- package/dist/agents/trace-context.d.ts.map +1 -0
- package/dist/agents/types.d.ts +13 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents.js +5 -5
- package/dist/audit/details.d.ts +5 -2
- package/dist/audit/details.d.ts.map +1 -1
- package/dist/capture/interceptor.d.ts.map +1 -1
- package/dist/chunks/{chunk-WHBJDTCR.js → chunk-4GGBND7V.js} +37 -10
- package/dist/chunks/chunk-4GGBND7V.js.map +7 -0
- package/dist/chunks/{chunk-N2VKKA7O.js → chunk-4GNFBZPR.js} +2 -2
- package/dist/chunks/{chunk-J2HUD36Z.js → chunk-5X35KXBV.js} +14 -2
- package/dist/chunks/{chunk-J2HUD36Z.js.map → chunk-5X35KXBV.js.map} +2 -2
- package/dist/chunks/{chunk-K7LQIEJY.js → chunk-6EVAHJAR.js} +5 -5
- package/dist/chunks/{chunk-ST36EYHN.js → chunk-6QVQXGMR.js} +1 -1
- package/dist/chunks/chunk-6QVQXGMR.js.map +7 -0
- package/dist/chunks/chunk-7C5IEIQK.js +157 -0
- package/dist/chunks/chunk-7C5IEIQK.js.map +7 -0
- package/dist/chunks/{chunk-LQSICKDK.js → chunk-A5XF3ZPJ.js} +18 -1
- package/dist/chunks/chunk-A5XF3ZPJ.js.map +7 -0
- package/dist/chunks/{chunk-CZPQTISQ.js → chunk-BQWJ5ZR7.js} +10 -6
- package/dist/chunks/chunk-BQWJ5ZR7.js.map +7 -0
- package/dist/chunks/{chunk-JJQECUUA.js → chunk-DONS3EZH.js} +2 -2
- package/dist/chunks/{chunk-W5CHVJBR.js → chunk-EQYQICUY.js} +54 -8
- package/dist/chunks/chunk-EQYQICUY.js.map +7 -0
- package/dist/chunks/{chunk-67RXNJLG.js → chunk-HITKWKYD.js} +6 -4
- package/dist/chunks/chunk-HITKWKYD.js.map +7 -0
- package/dist/chunks/{chunk-COQPGIBO.js → chunk-HZGQ7XYM.js} +2 -2
- package/dist/chunks/chunk-IQXNJNDI.js +854 -0
- package/dist/chunks/chunk-IQXNJNDI.js.map +7 -0
- package/dist/chunks/{chunk-7OFAO4HK.js → chunk-MOJBW5X2.js} +41 -2
- package/dist/chunks/chunk-MOJBW5X2.js.map +7 -0
- package/dist/chunks/{chunk-ACGEYOXM.js → chunk-O7IREHJI.js} +102 -44
- package/dist/chunks/chunk-O7IREHJI.js.map +7 -0
- package/dist/chunks/{chunk-RG2VFKR3.js → chunk-ODYU3IJU.js} +80 -17
- package/dist/chunks/chunk-ODYU3IJU.js.map +7 -0
- package/dist/chunks/{chunk-PXAICAUT.js → chunk-PBDDXBHY.js} +2 -1
- package/dist/chunks/chunk-PBDDXBHY.js.map +7 -0
- package/dist/chunks/{chunk-B54Z662X.js → chunk-PTZ5DKAB.js} +25 -5
- package/dist/chunks/chunk-PTZ5DKAB.js.map +7 -0
- package/dist/chunks/{chunk-RUO6L7RM.js → chunk-Q2JQ3RYZ.js} +3 -1
- package/dist/chunks/chunk-Q2JQ3RYZ.js.map +7 -0
- package/dist/chunks/{chunk-YKT5VLLQ.js → chunk-QCCPR3U5.js} +3 -3
- package/dist/chunks/{chunk-GYPDGW27.js → chunk-QGP7AY2R.js} +4 -2
- package/dist/chunks/{chunk-GYPDGW27.js.map → chunk-QGP7AY2R.js.map} +2 -2
- package/dist/chunks/chunk-QRN433TI.js +19 -0
- package/dist/chunks/chunk-QRN433TI.js.map +7 -0
- package/dist/chunks/{chunk-CXTTLBUV.js → chunk-R2XQ6AHT.js} +2 -2
- package/dist/chunks/{chunk-DV2JZSCI.js → chunk-SPCJXN4K.js} +14 -4
- package/dist/chunks/{chunk-DV2JZSCI.js.map → chunk-SPCJXN4K.js.map} +2 -2
- package/dist/chunks/{chunk-I5ENWRUJ.js → chunk-TNPZBMYC.js} +31 -7
- package/dist/chunks/chunk-TNPZBMYC.js.map +7 -0
- package/dist/chunks/{chunk-5SU3YXBS.js → chunk-UGYCAG6O.js} +1 -1
- package/dist/chunks/{chunk-5SU3YXBS.js.map → chunk-UGYCAG6O.js.map} +1 -1
- package/dist/chunks/{chunk-QSXZPS7F.js → chunk-V2IV4LYW.js} +2 -2
- package/dist/chunks/chunk-WJJXODAB.js +82 -0
- package/dist/chunks/chunk-WJJXODAB.js.map +7 -0
- package/dist/chunks/{chunk-RFOQPXKN.js → chunk-WQ6LC2KK.js} +2 -2
- package/dist/chunks/{chunk-3DUKKQHN.js → chunk-ZQMBS5SH.js} +5 -5
- package/dist/commands/fabric.d.ts +1 -1
- package/dist/commands/fabric.d.ts.map +1 -1
- package/dist/compaction/hook.d.ts +1 -1
- package/dist/compaction/hook.d.ts.map +1 -1
- package/dist/compaction/hook.js +1 -1
- package/dist/compaction/owner.js +2 -2
- package/dist/components/configuration.js +4 -4
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +3 -3
- package/dist/core/action-result.d.ts +10 -0
- package/dist/core/action-result.d.ts.map +1 -1
- package/dist/core/agent-dir.d.ts +1 -0
- package/dist/core/agent-dir.d.ts.map +1 -1
- package/dist/core/fabric-state-paths.d.ts.map +1 -1
- package/dist/core/host-sdk-runtime.d.ts +8 -0
- package/dist/core/host-sdk-runtime.d.ts.map +1 -0
- package/dist/core/host-sdk.d.ts +28 -0
- package/dist/core/host-sdk.d.ts.map +1 -0
- package/dist/core/host-sdk.js +11 -0
- package/dist/core/host-sdk.js.map +7 -0
- package/dist/core/session-context.d.ts +5 -0
- package/dist/core/session-context.d.ts.map +1 -1
- package/dist/core/shell-inbox.d.ts.map +1 -1
- package/dist/core/shell-jobs.d.ts +2 -0
- package/dist/core/shell-jobs.d.ts.map +1 -1
- package/dist/core/tool-ownership.d.ts.map +1 -1
- package/dist/core/tool-result-proxy.d.ts +2 -0
- package/dist/core/tool-result-proxy.d.ts.map +1 -1
- package/dist/durable/agent.d.ts +6 -0
- package/dist/durable/agent.d.ts.map +1 -1
- package/dist/durable/worker-host.d.ts.map +1 -1
- package/dist/durable/worker-host.js +48 -10
- package/dist/durable/worker-host.js.map +2 -2
- package/dist/durable.js +2 -2
- package/dist/durable.js.map +1 -1
- package/dist/extension-bootstrap.js +11 -11
- package/dist/fabric-runtime-state.d.ts +2 -0
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +343 -83
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/fabric-state.d.ts +2 -0
- package/dist/fabric-state.d.ts.map +1 -1
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/jev/auth.d.ts +2 -0
- package/dist/jev/auth.d.ts.map +1 -1
- package/dist/jev/client.d.ts.map +1 -1
- package/dist/jev/client.js +3 -3
- package/dist/jev/config.d.ts +5 -0
- package/dist/jev/config.d.ts.map +1 -1
- package/dist/jev/decision-profiles.d.ts +8 -0
- package/dist/jev/decision-profiles.d.ts.map +1 -0
- package/dist/jev/decision-schema.d.ts +35 -0
- package/dist/jev/decision-schema.d.ts.map +1 -0
- package/dist/jev/decision-types.d.ts +139 -0
- package/dist/jev/decision-types.d.ts.map +1 -0
- package/dist/jev/decisions.d.ts +27 -0
- package/dist/jev/decisions.d.ts.map +1 -0
- package/dist/jev/guest-types.d.ts +1 -1
- package/dist/jev/guest-types.d.ts.map +1 -1
- package/dist/jev/manager.d.ts +7 -0
- package/dist/jev/manager.d.ts.map +1 -1
- package/dist/jev/model-key.d.ts +3 -2
- package/dist/jev/model-key.d.ts.map +1 -1
- package/dist/jev/observation.js +4 -4
- package/dist/jev/routes.d.ts +11 -1
- package/dist/jev/routes.d.ts.map +1 -1
- package/dist/jev/types.d.ts +3 -2
- package/dist/jev/types.d.ts.map +1 -1
- package/dist/jev/validation.d.ts +34 -0
- package/dist/jev/validation.d.ts.map +1 -1
- package/dist/jev-fabric/resolve.d.ts +4 -0
- package/dist/jev-fabric/resolve.d.ts.map +1 -1
- package/dist/jev-fabric/resolve.js +1 -0
- package/dist/jev-fabric/resolve.js.map +2 -2
- package/dist/jev-fabric/serve.d.ts +5 -15
- package/dist/jev-fabric/serve.d.ts.map +1 -1
- package/dist/jev-fabric/serve.js +87 -56
- package/dist/jev-fabric/serve.js.map +2 -2
- package/dist/jev.d.ts +6 -2
- package/dist/jev.d.ts.map +1 -1
- package/dist/jev.js +33 -11
- package/dist/memory/extractive-history.d.ts +3 -0
- package/dist/memory/extractive-history.d.ts.map +1 -1
- package/dist/memory/extractive-history.js +36 -7
- package/dist/memory/extractive-history.js.map +3 -3
- package/dist/memory/extractive-index.d.ts.map +1 -1
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +3 -1
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/captured-tools-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.d.ts +2 -0
- package/dist/providers/jev-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +8 -8
- package/dist/providers/pi-bash-cwd.d.ts +1 -1
- package/dist/providers/pi-bash-cwd.d.ts.map +1 -1
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/providers/write-preview.d.ts +1 -1
- package/dist/providers/write-preview.d.ts.map +1 -1
- package/dist/residency/host.js +10 -8
- package/dist/residency/pi-entry.js +10 -8
- package/dist/residency/pi-entry.js.map +1 -1
- package/dist/runners.js +1 -1
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/guest-types.d.ts +1 -1
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/monty-runtime.js +3 -3
- package/dist/runtime/node-process-runtime.js +3 -3
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +2 -2
- package/dist/runtime/typescript-kernel.js +5 -5
- package/dist/storage/retention.d.ts.map +1 -1
- package/dist/topology/peer-presence.d.ts +56 -0
- package/dist/topology/peer-presence.d.ts.map +1 -0
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation-chrome.js +2 -2
- package/dist/ui/conversation-host.js +1 -1
- package/dist/ui/conversation-native-reader.js +1 -1
- package/dist/ui/conversation.js +6 -6
- package/dist/ui/dashboard.js +3 -3
- package/dist/ui/settings-decision-profiles.d.ts +24 -0
- package/dist/ui/settings-decision-profiles.d.ts.map +1 -0
- package/dist/ui/settings-section-context.d.ts +1 -1
- package/dist/ui/settings-section-context.d.ts.map +1 -1
- package/dist/ui/settings-sections-agents.d.ts.map +1 -1
- package/dist/ui/settings-sections-decisions.d.ts +4 -0
- package/dist/ui/settings-sections-decisions.d.ts.map +1 -0
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
- package/dist/ui/settings-sections.d.ts +1 -1
- package/dist/ui/settings-sections.d.ts.map +1 -1
- package/dist/ui/settings-submenus.d.ts +3 -1
- package/dist/ui/settings-submenus.d.ts.map +1 -1
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.d.ts.map +1 -1
- package/dist/ui/settings.js +224 -45
- package/dist/ui/settings.js.map +4 -4
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +15 -0
- package/dist/worker/options.js.map +2 -2
- package/dist/worker.js +11 -1
- package/dist/worker.js.map +2 -2
- package/docs/agents.md +49 -0
- package/docs/architecture.md +1 -1
- package/docs/audit-trace.md +3 -1
- package/docs/background-tasks.md +4 -0
- package/docs/compaction.md +1 -1
- package/docs/configuration.md +91 -8
- package/docs/decision-profiles.schema.json +52 -0
- package/docs/decision-test-coverage.md +77 -0
- package/docs/durable-pi.md +9 -2
- package/docs/extractive-history.md +17 -2
- package/docs/jev-decisions.md +150 -0
- package/docs/jev.md +18 -5
- package/docs/prompt-cache.md +1 -1
- package/docs/providers.md +4 -1
- package/node_modules/pi-coralbricks-provider/LICENSE +21 -0
- package/node_modules/pi-coralbricks-provider/README.md +306 -0
- package/node_modules/pi-coralbricks-provider/auth.ts +30 -0
- package/node_modules/pi-coralbricks-provider/custom-models.json +1 -0
- package/node_modules/pi-coralbricks-provider/deprecated-models.json +1 -0
- package/node_modules/pi-coralbricks-provider/guard.ts +155 -0
- package/node_modules/pi-coralbricks-provider/index.ts +662 -0
- package/node_modules/pi-coralbricks-provider/models.json +88 -0
- package/node_modules/pi-coralbricks-provider/package.json +74 -0
- package/node_modules/pi-coralbricks-provider/park.ts +122 -0
- package/node_modules/pi-coralbricks-provider/patch.json +34 -0
- package/node_modules/pi-coralbricks-provider/scripts/update-models.js +658 -0
- package/node_modules/pi-coralbricks-provider/settings.ts +143 -0
- package/node_modules/pi-coralbricks-provider/sync-policy.ts +309 -0
- package/package.json +18 -13
- package/skillsets/python/fabric-exec/SKILL.md +1 -1
- package/skillsets/python/fabric-exec/references/agents.md +1 -1
- package/skillsets/python/fabric-foreman/SKILL.md +1 -1
- package/skillsets/python/fabric-jev/SKILL.md +2 -2
- package/skillsets/typescript/fabric-exec/SKILL.md +1 -1
- package/skillsets/typescript/fabric-exec/references/agents.md +1 -0
- package/skillsets/typescript/fabric-foreman/SKILL.md +1 -1
- package/skillsets/typescript/fabric-jev/SKILL.md +2 -2
- package/dist/chunks/chunk-67RXNJLG.js.map +0 -7
- package/dist/chunks/chunk-7OFAO4HK.js.map +0 -7
- package/dist/chunks/chunk-ACGEYOXM.js.map +0 -7
- package/dist/chunks/chunk-B54Z662X.js.map +0 -7
- package/dist/chunks/chunk-CZPQTISQ.js.map +0 -7
- package/dist/chunks/chunk-I5ENWRUJ.js.map +0 -7
- package/dist/chunks/chunk-IAFI4A2I.js +0 -92
- package/dist/chunks/chunk-IAFI4A2I.js.map +0 -7
- package/dist/chunks/chunk-LQSICKDK.js.map +0 -7
- package/dist/chunks/chunk-PXAICAUT.js.map +0 -7
- package/dist/chunks/chunk-QSL5UXNW.js +0 -515
- package/dist/chunks/chunk-QSL5UXNW.js.map +0 -7
- package/dist/chunks/chunk-RG2VFKR3.js.map +0 -7
- package/dist/chunks/chunk-RUO6L7RM.js.map +0 -7
- package/dist/chunks/chunk-ST36EYHN.js.map +0 -7
- package/dist/chunks/chunk-W5CHVJBR.js.map +0 -7
- package/dist/chunks/chunk-WHBJDTCR.js.map +0 -7
- /package/dist/chunks/{chunk-N2VKKA7O.js.map → chunk-4GNFBZPR.js.map} +0 -0
- /package/dist/chunks/{chunk-K7LQIEJY.js.map → chunk-6EVAHJAR.js.map} +0 -0
- /package/dist/chunks/{chunk-JJQECUUA.js.map → chunk-DONS3EZH.js.map} +0 -0
- /package/dist/chunks/{chunk-COQPGIBO.js.map → chunk-HZGQ7XYM.js.map} +0 -0
- /package/dist/chunks/{chunk-YKT5VLLQ.js.map → chunk-QCCPR3U5.js.map} +0 -0
- /package/dist/chunks/{chunk-CXTTLBUV.js.map → chunk-R2XQ6AHT.js.map} +0 -0
- /package/dist/chunks/{chunk-QSXZPS7F.js.map → chunk-V2IV4LYW.js.map} +0 -0
- /package/dist/chunks/{chunk-RFOQPXKN.js.map → chunk-WQ6LC2KK.js.map} +0 -0
- /package/dist/chunks/{chunk-3DUKKQHN.js.map → chunk-ZQMBS5SH.js.map} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "deepseek-v4.1-flash-fast",
|
|
4
|
+
"name": "DeepSeek V4.1 Flash",
|
|
5
|
+
"reasoning": false,
|
|
6
|
+
"input": [
|
|
7
|
+
"text",
|
|
8
|
+
"image"
|
|
9
|
+
],
|
|
10
|
+
"cost": {
|
|
11
|
+
"input": 0.01,
|
|
12
|
+
"output": 1.2,
|
|
13
|
+
"cacheRead": 0,
|
|
14
|
+
"cacheWrite": 0.09
|
|
15
|
+
},
|
|
16
|
+
"contextWindow": 1048576,
|
|
17
|
+
"maxTokens": 32768,
|
|
18
|
+
"compat": {
|
|
19
|
+
"supportsDeveloperRole": false,
|
|
20
|
+
"supportsStore": false,
|
|
21
|
+
"maxTokensField": "max_tokens"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "deepseek-v4.1-flash-fast-fp4",
|
|
26
|
+
"name": "Deepseek V4.1 Flash Fast Fp4",
|
|
27
|
+
"reasoning": false,
|
|
28
|
+
"input": [
|
|
29
|
+
"text",
|
|
30
|
+
"image"
|
|
31
|
+
],
|
|
32
|
+
"cost": {
|
|
33
|
+
"input": 0.01,
|
|
34
|
+
"output": 1.2,
|
|
35
|
+
"cacheRead": 0,
|
|
36
|
+
"cacheWrite": 0.09
|
|
37
|
+
},
|
|
38
|
+
"contextWindow": 1048576,
|
|
39
|
+
"maxTokens": 32768,
|
|
40
|
+
"compat": {
|
|
41
|
+
"supportsDeveloperRole": false,
|
|
42
|
+
"supportsStore": false,
|
|
43
|
+
"maxTokensField": "max_tokens"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "glm-5.3-fast",
|
|
48
|
+
"name": "GLM 5.3",
|
|
49
|
+
"reasoning": false,
|
|
50
|
+
"input": [
|
|
51
|
+
"text"
|
|
52
|
+
],
|
|
53
|
+
"cost": {
|
|
54
|
+
"input": 1.12,
|
|
55
|
+
"output": 4.4,
|
|
56
|
+
"cacheRead": 0,
|
|
57
|
+
"cacheWrite": 1.68
|
|
58
|
+
},
|
|
59
|
+
"contextWindow": 1048576,
|
|
60
|
+
"maxTokens": 32768,
|
|
61
|
+
"compat": {
|
|
62
|
+
"supportsDeveloperRole": false,
|
|
63
|
+
"supportsStore": false,
|
|
64
|
+
"maxTokensField": "max_tokens"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "glm-5.3-fp4",
|
|
69
|
+
"name": "Glm 5.3 Fp4",
|
|
70
|
+
"reasoning": false,
|
|
71
|
+
"input": [
|
|
72
|
+
"text"
|
|
73
|
+
],
|
|
74
|
+
"cost": {
|
|
75
|
+
"input": 1.12,
|
|
76
|
+
"output": 4.4,
|
|
77
|
+
"cacheRead": 0,
|
|
78
|
+
"cacheWrite": 1.68
|
|
79
|
+
},
|
|
80
|
+
"contextWindow": 1048576,
|
|
81
|
+
"maxTokens": 32768,
|
|
82
|
+
"compat": {
|
|
83
|
+
"supportsDeveloperRole": false,
|
|
84
|
+
"supportsStore": false,
|
|
85
|
+
"maxTokensField": "max_tokens"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-coralbricks-provider",
|
|
3
|
+
"version": "1.0.32",
|
|
4
|
+
"description": "CoralBricks provider extension for pi - Access GLM 5.3 and DeepSeek V4.1 Flash (FP4 variants included) through the Coral Inference API",
|
|
5
|
+
"author": "monotykamary",
|
|
6
|
+
"homepage": "https://github.com/monotykamary/pi-coralbricks-provider#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/monotykamary/pi-coralbricks-provider.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/monotykamary/pi-coralbricks-provider/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "index.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"clean": "echo 'nothing to clean'",
|
|
18
|
+
"build": "echo 'nothing to build'",
|
|
19
|
+
"check": "tsc --noEmit && vitest run",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"update-models": "node scripts/update-models.js",
|
|
22
|
+
"test:pi": "node scripts/test-pi-compat.mjs"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"pi-package",
|
|
26
|
+
"pi",
|
|
27
|
+
"extension",
|
|
28
|
+
"provider",
|
|
29
|
+
"coralbricks",
|
|
30
|
+
"coral",
|
|
31
|
+
"ai",
|
|
32
|
+
"llm",
|
|
33
|
+
"glm",
|
|
34
|
+
"deepseek",
|
|
35
|
+
"deepseek"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"files": [
|
|
39
|
+
"index.ts",
|
|
40
|
+
"settings.ts",
|
|
41
|
+
"auth.ts",
|
|
42
|
+
"park.ts",
|
|
43
|
+
"guard.ts",
|
|
44
|
+
"sync-policy.ts",
|
|
45
|
+
"models.json",
|
|
46
|
+
"deprecated-models.json",
|
|
47
|
+
"custom-models.json",
|
|
48
|
+
"patch.json",
|
|
49
|
+
"scripts/update-models.js",
|
|
50
|
+
"README.md",
|
|
51
|
+
"LICENSE"
|
|
52
|
+
],
|
|
53
|
+
"overrides": {
|
|
54
|
+
"brace-expansion": "5.0.12"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@earendil-works/pi-tui": "1.1.0",
|
|
58
|
+
"@types/node": "^22.20.0",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"vitest": "4.1.7",
|
|
61
|
+
"@earendil-works/pi-ai": "1.1.0",
|
|
62
|
+
"@earendil-works/pi-coding-agent": "1.1.0"
|
|
63
|
+
},
|
|
64
|
+
"pi": {
|
|
65
|
+
"extensions": [
|
|
66
|
+
"./index.ts"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@earendil-works/pi-tui": "*",
|
|
71
|
+
"@earendil-works/pi-ai": "*",
|
|
72
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parking: continue Coral Responses turns with `previous_response_id`.
|
|
3
|
+
*
|
|
4
|
+
* pi replays the whole transcript on every request. With parking on, each
|
|
5
|
+
* response is stored on Coral (`store: true`) and the next request sends only
|
|
6
|
+
* the items that came after it (tool results, the next user message). Coral
|
|
7
|
+
* keeps the parked state, sticky-routes the chain to the same replica and
|
|
8
|
+
* bills only the new input.
|
|
9
|
+
*
|
|
10
|
+
* A chain is used only when the full input pi would have sent starts with
|
|
11
|
+
* exactly the input of the parked request, followed by that response's own
|
|
12
|
+
* output items. Anything else (compaction, a model switch, an edited or
|
|
13
|
+
* branched history, a restart) sends the full transcript, which parks again.
|
|
14
|
+
* If Coral no longer has the parent (`previous_response_not_found`), the same
|
|
15
|
+
* request is re-sent once in full.
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from "node:crypto";
|
|
18
|
+
|
|
19
|
+
type Item = Record<string, unknown>;
|
|
20
|
+
|
|
21
|
+
interface ParkedTurn {
|
|
22
|
+
model: string;
|
|
23
|
+
/** Digests of the full input sent with the request that produced this response. */
|
|
24
|
+
input: string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ParkPlan {
|
|
28
|
+
/** Request body to send. */
|
|
29
|
+
params: Record<string, any>;
|
|
30
|
+
/** Full-transcript body to re-send if the parent is gone; undefined when not chained. */
|
|
31
|
+
fallback?: Record<string, any>;
|
|
32
|
+
/** Digests of the full input, recorded against the response id on success. */
|
|
33
|
+
input: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const MAX_PARKED = 256;
|
|
37
|
+
const parked = new Map<string, ParkedTurn>();
|
|
38
|
+
|
|
39
|
+
function digest(item: unknown): string {
|
|
40
|
+
return createHash("sha256").update(JSON.stringify(item)).digest("base64url");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isOutputItem(item: Item): boolean {
|
|
44
|
+
return item.type === "reasoning"
|
|
45
|
+
|| item.type === "function_call"
|
|
46
|
+
|| item.type === "custom_tool_call"
|
|
47
|
+
|| (item.type === "message" && item.role === "assistant");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The last assistant message, if it is a completed Coral Responses turn from this model. */
|
|
51
|
+
function parentId(messages: any[] | undefined, model: { id: string; provider: string }): string | undefined {
|
|
52
|
+
for (let i = (messages?.length ?? 0) - 1; i >= 0; i--) {
|
|
53
|
+
const msg = messages![i];
|
|
54
|
+
if (msg?.role !== "assistant") continue;
|
|
55
|
+
const ok = typeof msg.responseId === "string"
|
|
56
|
+
&& msg.provider === model.provider
|
|
57
|
+
&& msg.api === "openai-responses"
|
|
58
|
+
&& msg.model === model.id
|
|
59
|
+
&& msg.stopReason !== "error"
|
|
60
|
+
&& msg.stopReason !== "aborted";
|
|
61
|
+
return ok ? msg.responseId : undefined;
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function planPark(params: Record<string, any>, messages: any[] | undefined, model: { id: string; provider: string }): ParkPlan {
|
|
67
|
+
const full: Item[] = Array.isArray(params.input) ? params.input : [];
|
|
68
|
+
const input = full.map(digest);
|
|
69
|
+
const stored: Record<string, any> = { ...params, store: true };
|
|
70
|
+
delete stored.previous_response_id;
|
|
71
|
+
|
|
72
|
+
const id = parentId(messages, model);
|
|
73
|
+
const turn = id ? parked.get(id) : undefined;
|
|
74
|
+
if (!id || !turn || turn.model !== model.id || turn.input.length > input.length) return { params: stored, input };
|
|
75
|
+
for (let i = 0; i < turn.input.length; i++) {
|
|
76
|
+
if (turn.input[i] !== input[i]) return { params: stored, input };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Skip the parent's own output; Coral already holds it.
|
|
80
|
+
let start = turn.input.length;
|
|
81
|
+
while (start < full.length && isOutputItem(full[start])) start++;
|
|
82
|
+
const delta = full.slice(start);
|
|
83
|
+
if (delta.length === 0 || delta.some(isOutputItem)) return { params: stored, input };
|
|
84
|
+
|
|
85
|
+
return { params: { ...stored, previous_response_id: id, input: delta }, fallback: stored, input };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function park(responseId: string, model: string, input: string[]): void {
|
|
89
|
+
parked.delete(responseId);
|
|
90
|
+
parked.set(responseId, { model, input });
|
|
91
|
+
while (parked.size > MAX_PARKED) parked.delete(parked.keys().next().value!);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function forget(responseId: string): void {
|
|
95
|
+
parked.delete(responseId);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function clearParked(): void {
|
|
99
|
+
parked.clear();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function isParentMissing(status: number, body: string): boolean {
|
|
103
|
+
return (status === 404 || status === 400) && body.includes("previous_response_not_found");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Wrap fetch so a chained request whose parent Coral no longer has is re-sent
|
|
108
|
+
* once with the full transcript. Every other response passes through untouched.
|
|
109
|
+
*/
|
|
110
|
+
export function withParkFallback(base: typeof fetch, plan: () => ParkPlan | undefined): typeof fetch {
|
|
111
|
+
return async (input: any, init?: any) => {
|
|
112
|
+
const response = await base(input, init);
|
|
113
|
+
const current = plan();
|
|
114
|
+
if (response.ok || !current?.fallback) return response;
|
|
115
|
+
const body = await response.clone().text().catch(() => "");
|
|
116
|
+
if (!isParentMissing(response.status, body)) return response;
|
|
117
|
+
forget(current.params.previous_response_id);
|
|
118
|
+
const headers = new Headers(init?.headers);
|
|
119
|
+
headers.delete("content-length");
|
|
120
|
+
return base(input, { ...init, headers, body: JSON.stringify(current.fallback) });
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deepseek-v4.1-flash-fast": {
|
|
3
|
+
"reasoning": true,
|
|
4
|
+
"input": ["text", "image"],
|
|
5
|
+
"thinkingLevelMap": { "off": "none", "minimal": null, "low": "low", "medium": null, "high": "high", "xhigh": null, "max": "max" },
|
|
6
|
+
"cost": { "cacheWrite": 0.09 },
|
|
7
|
+
"compat": { "supportsReasoningEffort": true, "thinkingFormat": "openai" }
|
|
8
|
+
},
|
|
9
|
+
"deepseek-v4.1-flash-fast-fp4": {
|
|
10
|
+
"name": "DeepSeek V4.1 Flash FP4",
|
|
11
|
+
"hidden": true,
|
|
12
|
+
"reasoning": true,
|
|
13
|
+
"input": ["text", "image"],
|
|
14
|
+
"thinkingLevelMap": { "off": "none", "minimal": null, "low": "low", "medium": null, "high": "high", "xhigh": null, "max": "max" },
|
|
15
|
+
"cost": { "cacheWrite": 0.09 },
|
|
16
|
+
"compat": { "supportsReasoningEffort": true, "thinkingFormat": "openai" }
|
|
17
|
+
},
|
|
18
|
+
"glm-5.3-fast": {
|
|
19
|
+
"reasoning": true,
|
|
20
|
+
"thinkingLevelMap": { "off": "none", "minimal": null, "low": "low", "medium": null, "high": "high", "xhigh": null, "max": "max" },
|
|
21
|
+
"maxTokens": 131072,
|
|
22
|
+
"cost": { "cacheWrite": 1.68 },
|
|
23
|
+
"compat": { "supportsReasoningEffort": true, "thinkingFormat": "zai" }
|
|
24
|
+
},
|
|
25
|
+
"glm-5.3-fp4": {
|
|
26
|
+
"name": "GLM 5.3 FP4",
|
|
27
|
+
"hidden": true,
|
|
28
|
+
"reasoning": true,
|
|
29
|
+
"thinkingLevelMap": { "off": "none", "minimal": null, "low": "low", "medium": null, "high": "high", "xhigh": null, "max": "max" },
|
|
30
|
+
"maxTokens": 131072,
|
|
31
|
+
"cost": { "cacheWrite": 1.68 },
|
|
32
|
+
"compat": { "supportsReasoningEffort": true, "thinkingFormat": "zai" }
|
|
33
|
+
}
|
|
34
|
+
}
|