dal-code 1.0.59 → 1.0.61
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 +8 -0
- package/dist/bundle/chunks/account-REEBP4XX.js +1 -0
- package/dist/bundle/chunks/{anthropic-messages-HVFHIIGX.js → anthropic-messages-FFHN77YO.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-RMWKIGFW.js → azure-openai-responses-XMVXFFRW.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-TPOKZ2EU.js → chunk-3UVUVPDJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-IONGABQF.js → chunk-46A3CZG4.js} +1 -1
- package/dist/bundle/chunks/{chunk-BBNE2TWS.js → chunk-4PE5FX77.js} +1 -1
- package/dist/bundle/chunks/{chunk-4BOWD7PQ.js → chunk-5DM5CSLU.js} +1 -1
- package/dist/bundle/chunks/chunk-5VVKJ7N6.js +9 -0
- package/dist/bundle/chunks/chunk-7FEAO2PW.js +2 -0
- package/dist/bundle/chunks/{chunk-HF334NQU.js → chunk-B66W54NL.js} +1 -1
- package/dist/bundle/chunks/chunk-CVSK7HIR.js +1 -0
- package/dist/bundle/chunks/{chunk-VDPDHGGJ.js → chunk-DM37LCOU.js} +1 -1
- package/dist/bundle/chunks/{chunk-PMFHJN7I.js → chunk-HDE7XZW5.js} +1 -1
- package/dist/bundle/chunks/{chunk-MPLE6M5C.js → chunk-KV7HXJIS.js} +1 -1
- package/dist/bundle/chunks/{chunk-4PBY6OYS.js → chunk-LBVJMXG6.js} +1 -1
- package/dist/bundle/chunks/{chunk-F5SIUTR7.js → chunk-LGD3AMTG.js} +1 -1
- package/dist/bundle/chunks/{chunk-KT7CXVDN.js → chunk-M4QINYHM.js} +9 -9
- package/dist/bundle/chunks/{chunk-YOQ3KBG5.js → chunk-MOBJIVPU.js} +1 -1
- package/dist/bundle/chunks/{chunk-KQRRELCF.js → chunk-NBRVYUIG.js} +1 -1
- package/dist/bundle/chunks/{chunk-AL3DFAIM.js → chunk-NRQYSXAU.js} +1 -1
- package/dist/bundle/chunks/{chunk-GZJEAFRS.js → chunk-O4KJ5UE4.js} +1 -1
- package/dist/bundle/chunks/{chunk-IKSSB5ZJ.js → chunk-OLTY5TDX.js} +1 -1
- package/dist/bundle/chunks/{chunk-R47JBGS3.js → chunk-QM5JU2GS.js} +1 -1
- package/dist/bundle/chunks/{chunk-XQF5XDEM.js → chunk-RRAXQWE3.js} +2 -2
- package/dist/bundle/chunks/{chunk-J6H2LYOZ.js → chunk-TLYT7KXA.js} +1 -1
- package/dist/bundle/chunks/{chunk-QU2VEHMW.js → chunk-XIF7O6UG.js} +3 -3
- package/dist/bundle/chunks/{chunk-F52JQCLE.js → chunk-XKOYUKPQ.js} +1 -1
- package/dist/bundle/chunks/{chunk-X63WCLSX.js → chunk-ZLZHK7BO.js} +274 -274
- package/dist/bundle/chunks/{chunk-C5ELI234.js → chunk-ZVMXRMIH.js} +1 -1
- package/dist/bundle/chunks/{cli-BFWJUYZ5.js → cli-4VML7NOW.js} +1 -1
- package/dist/bundle/chunks/cli-RJETLDQ5.js +30 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-RXFI2EBV.js → cloudflare-workers-ai-system-one-63ASD4MS.js} +1 -1
- package/dist/bundle/chunks/{easter-egg-3d-W2F3ROZ6.js → easter-egg-3d-JQUBBOXE.js} +1 -1
- package/dist/bundle/chunks/{execute-NJRE4WBO.js → execute-ZIFT667Q.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-5F5544G4.js → google-generative-ai-4T6TSKGZ.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-4PSVELDG.js → google-vertex-Z2AJIOKJ.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-IPNT4VOW.js → llama-cpp-classify-UD7L3OEZ.js} +1 -1
- package/dist/bundle/chunks/{mcp-F3BQ6MQW.js → mcp-7W2PZMFF.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-RSYLYGE4.js → mistral-conversations-W4M2WAFU.js} +1 -1
- package/dist/bundle/chunks/{office-UBOUFRAU.js → office-FIY2WQ2K.js} +1 -1
- package/dist/bundle/chunks/oidc-WQ64R7RE.js +1 -0
- package/dist/bundle/chunks/{openai-codex-responses-OKPZLYIS.js → openai-codex-responses-NYZACUJQ.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-BFCQZRZ2.js → openai-completions-GOZT4TOU.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-RJ4MH5XI.js → openai-decisions-ZJSAGWHI.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-PT5MXG3Q.js → openai-responses-ZVECOLDP.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-ICCH2YHW.js → openrouter-images-BOGEFLXU.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-Z2XWHIYT.js → pi-messages-XDGHAFKO.js} +1 -1
- package/dist/bundle/chunks/{review-WTYIVWYR.js → review-ESZWG3ID.js} +1 -1
- package/dist/bundle/chunks/{router-V3EIAYOF.js → router-ZQ7UPIHA.js} +1 -1
- package/dist/bundle/chunks/{runtime-FNCZJKOC.js → runtime-KHMBKDP7.js} +1 -1
- package/dist/bundle/chunks/{sdk-32L63XRF.js → sdk-6F6YIKOL.js} +1 -1
- package/dist/bundle/chunks/src-TVUSERYE.js +3 -0
- package/dist/bundle/chunks/{sync-Z5USQ7AN.js → sync-F7N6C6RF.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-6UYWINOZ.js → typesafe-system-one-NSQNXICI.js} +1 -1
- package/dist/bundle/chunks/{usage-JODQIC2H.js → usage-5VHK66HK.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-ERCLFZEY.js → virtual-modules-ABFE2KKD.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/main.js +4 -4
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/attribution.js +1 -1
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-learn/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lsp/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-mcp/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +4 -4
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +4 -4
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/package.json +3 -2
- package/dist/node_modules/@dalcode/dal-remote/src/account.js +2 -0
- package/dist/node_modules/@dalcode/dal-remote/src/cli.js +13 -13
- package/dist/node_modules/@dalcode/dal-remote/src/install.js +2 -2
- package/dist/node_modules/@dalcode/dal-remote/src/spec.js +1 -1
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-router/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-sync/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/radius.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-schema/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/bundle/chunks/chunk-WLQ33LIH.js +0 -9
- package/dist/bundle/chunks/cli-NQ7B7BGV.js +0 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"pi-messages":{"chat:balanced":{"id":"balanced","name":"Balanced","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":3,"output":15,"cacheRead":0.15,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:cheap":{"id":"cheap","name":"Cheap","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":131072,"type":"chat","lab":"DeepSeek","cost":{"input":0.3,"output":1.2,"cacheRead":0.006,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","reasoning":true,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","reasoning":true,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":10,"output":50,"cacheRead":0.25,"cacheWrite":12.5},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","reasoning":true,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":8,"output":40,"cacheRead":0.2,"cacheWrite":10},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","reasoning":true,"input":["text","image"],"contextWindow":200000,"maxTokens":64000,"type":"chat","lab":"Anthropic","cost":{"input":1,"output":5,"cacheRead":0.1,"cacheWrite":1.25},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","reasoning":true,"thinkingLevelMap":{"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125,"tiers":[{"inputTokensAbove":100000,"input":0.5,"output":2.5,"cacheRead":0.05,"cacheWrite":0.625}]},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5","reasoning":true,"input":["text","image"],"contextWindow":200000,"maxTokens":64000,"type":"chat","lab":"Anthropic","cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","reasoning":true,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","reasoning":true,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":4,"output":20,"cacheRead":0.2,"cacheWrite":5},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5","reasoning":true,"input":["text","image"],"contextWindow":200000,"maxTokens":64000,"type":"chat","lab":"Anthropic","cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","reasoning":true,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":2.5},"enabled":true,"providers":[{"id":"anthropic","name":"Anthropic","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":131072,"type":"chat","lab":"DeepSeek","cost":{"input":0.3,"output":1.2,"cacheRead":0.006,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":0.75,"output":3.75,"cacheRead":0.075,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":32768,"type":"chat","lab":"Google","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-4-hydrogen":{"id":"gemini-4-hydrogen","name":"Gemini 4 Hydrogen","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":1.5,"output":7.5,"cacheRead":0.075,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-4-neon":{"id":"gemini-4-neon","name":"Gemini 4 Neon","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":3,"output":15,"cacheRead":0.15,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"contextWindow":1048576,"maxTokens":128000,"type":"chat","lab":"Z.ai","cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1"},"chat:glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3 Flash","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1048575,"maxTokens":131072,"type":"chat","lab":"Z.ai","cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT 5.6 Luna","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":0.2,"output":1.2,"cacheRead":0.02,"cacheWrite":0.25,"tiers":[{"inputTokensAbove":272000,"input":0.4,"output":1.8,"cacheRead":0.04,"cacheWrite":0.5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT 5.6 Sol","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5,"tiers":[{"inputTokensAbove":272000,"input":8,"output":30,"cacheRead":0.8,"cacheWrite":10}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT 5.6 Terra","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":18,"cacheRead":0.4,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6-astra":{"id":"gpt-6-astra","name":"GPT 6 Astra","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5,"tiers":[{"inputTokensAbove":272000,"input":20,"output":75,"cacheRead":2,"cacheWrite":25}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6-luna":{"id":"gpt-6-luna","name":"GPT 6 Luna","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1050000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125,"tiers":[{"inputTokensAbove":272000,"input":0.2,"output":0.75,"cacheRead":0.02,"cacheWrite":0.25}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6-sol":{"id":"gpt-6-sol","name":"GPT 6 Sol","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1050000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":15,"cacheRead":0.4,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT 6.1 Sol","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":15,"cacheRead":0.2,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT 6.1 Terra","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":1,"output":5,"cacheRead":0.05,"cacheWrite":1.25,"tiers":[{"inputTokensAbove":272000,"input":2,"output":7.5,"cacheRead":0.1,"cacheWrite":2.5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.2-astra":{"id":"gpt-6.2-astra","name":"GPT 6.2 Astra","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":8,"output":40,"cacheRead":0.4,"cacheWrite":10,"tiers":[{"inputTokensAbove":272000,"input":16,"output":60,"cacheRead":0.8,"cacheWrite":20}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.2-sol":{"id":"gpt-6.2-sol","name":"GPT 6.2 Sol","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":15,"cacheRead":0.2,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":500000,"maxTokens":450000,"type":"chat","lab":"xAI","cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:kimi-k3":{"id":"kimi-k3","name":"Kimi K3","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1048576,"maxTokens":262144,"type":"chat","lab":"Moonshot AI","cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1048576,"maxTokens":131072,"type":"chat","lab":"Moonshot AI","cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:minimax-m3":{"id":"minimax-m3","name":"MiniMax M3","reasoning":true,"input":["text","image"],"contextWindow":524288,"maxTokens":131072,"type":"chat","lab":"MiniMax","cost":{"input":0.3,"output":1.2,"cacheRead":0.06,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax M3.1 Flash","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":524288,"type":"chat","lab":"MiniMax","cost":{"input":0.15,"output":0.6,"cacheRead":0.015,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":262144,"type":"chat","lab":"Mistral AI","cost":{"input":0.7,"output":2.1,"cacheRead":0.07,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:precise":{"id":"precise","name":"Precise","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5,"tiers":[{"inputTokensAbove":272000,"input":8,"output":30,"cacheRead":0.8,"cacheWrite":10}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:recursive/flint":{"id":"recursive/flint","name":"Flint (free, trains on data)","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":null,"xhigh":null,"max":null},"input":["text"],"contextWindow":262144,"maxTokens":65536,"type":"chat","lab":"Recursive","cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"enabled":true,"providers":[{"id":"recursive","name":"Recursive","credential":"radius","source":"radius"}],"free":true,"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1"}}}
|
|
1
|
+
{"pi-messages":{"chat:balanced":{"id":"balanced","name":"Balanced","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":3,"output":15,"cacheRead":0.15,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:cheap":{"id":"cheap","name":"Cheap","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":131072,"type":"chat","lab":"DeepSeek","cost":{"input":0.3,"output":1.2,"cacheRead":0.006,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-fable-5":{"id":"claude-fable-5","name":"Claude Fable 5","reasoning":true,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-fable-5-1":{"id":"claude-fable-5-1","name":"Claude Fable 5.1","reasoning":true,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":10,"output":50,"cacheRead":0.25,"cacheWrite":12.5},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-fable-5-2":{"id":"claude-fable-5-2","name":"Claude Fable 5.2","reasoning":true,"thinkingLevelMap":{"off":null,"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":8,"output":40,"cacheRead":0.2,"cacheWrite":10},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-haiku-4-5":{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","reasoning":true,"input":["text","image"],"contextWindow":200000,"maxTokens":64000,"type":"chat","lab":"Anthropic","cost":{"input":1,"output":5,"cacheRead":0.1,"cacheWrite":1.25},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-haiku-5-5":{"id":"claude-haiku-5-5","name":"Claude Haiku 5.5","reasoning":true,"thinkingLevelMap":{"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125,"tiers":[{"inputTokensAbove":100000,"input":0.5,"output":2.5,"cacheRead":0.05,"cacheWrite":0.625}]},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-4-5":{"id":"claude-opus-4-5","name":"Claude Opus 4.5","reasoning":true,"input":["text","image"],"contextWindow":200000,"maxTokens":64000,"type":"chat","lab":"Anthropic","cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-4-8":{"id":"claude-opus-4-8","name":"Claude Opus 4.8","reasoning":true,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-5":{"id":"claude-opus-5","name":"Claude Opus 5","reasoning":true,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":5,"output":25,"cacheRead":0.5,"cacheWrite":6.25},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-opus-5-5":{"id":"claude-opus-5-5","name":"Claude Opus 5.5","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":4,"output":20,"cacheRead":0.2,"cacheWrite":5},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-sonnet-4-5":{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5","reasoning":true,"input":["text","image"],"contextWindow":200000,"maxTokens":64000,"type":"chat","lab":"Anthropic","cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":3.75},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-sonnet-5":{"id":"claude-sonnet-5","name":"Claude Sonnet 5","reasoning":true,"thinkingLevelMap":{"xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:claude-sonnet-5-5":{"id":"claude-sonnet-5-5","name":"Claude Sonnet 5.5","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":128000,"type":"chat","lab":"Anthropic","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":2.5},"enabled":true,"providers":[{"id":"vercel-ai-gateway","name":"Vercel AI Gateway","credential":"radius","source":"radius"}],"promptCache":{"short":300,"long":3600},"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:deepseek-v4.1-flash":{"id":"deepseek-v4.1-flash","name":"DeepSeek V4.1 Flash","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":131072,"type":"chat","lab":"DeepSeek","cost":{"input":0.3,"output":1.2,"cacheRead":0.006,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-3.8-flash":{"id":"gemini-3.8-flash","name":"Gemini 3.8 Flash","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":0.75,"output":3.75,"cacheRead":0.075,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-4-argon":{"id":"gemini-4-argon","name":"Gemini 4 Argon","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":32768,"type":"chat","lab":"Google","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-4-hydrogen":{"id":"gemini-4-hydrogen","name":"Gemini 4 Hydrogen","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":1.5,"output":7.5,"cacheRead":0.075,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gemini-4-neon":{"id":"gemini-4-neon","name":"Gemini 4 Neon","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":65536,"type":"chat","lab":"Google","cost":{"input":3,"output":15,"cacheRead":0.15,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:glm-5.3":{"id":"glm-5.3","name":"GLM-5.3","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text"],"contextWindow":1048576,"maxTokens":128000,"type":"chat","lab":"Z.ai","cost":{"input":1.4,"output":4.4,"cacheRead":0.26,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1"},"chat:glm-5.3-flash":{"id":"glm-5.3-flash","name":"GLM-5.3 Flash","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1048575,"maxTokens":131072,"type":"chat","lab":"Z.ai","cost":{"input":0.15,"output":0.5,"cacheRead":0.03,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-5.6-luna":{"id":"gpt-5.6-luna","name":"GPT 5.6 Luna","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":0.2,"output":1.2,"cacheRead":0.02,"cacheWrite":0.25,"tiers":[{"inputTokensAbove":272000,"input":0.4,"output":1.8,"cacheRead":0.04,"cacheWrite":0.5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-5.6-sol":{"id":"gpt-5.6-sol","name":"GPT 5.6 Sol","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5,"tiers":[{"inputTokensAbove":272000,"input":8,"output":30,"cacheRead":0.8,"cacheWrite":10}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-5.6-terra":{"id":"gpt-5.6-terra","name":"GPT 5.6 Terra","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":12,"cacheRead":0.2,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":18,"cacheRead":0.4,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6-astra":{"id":"gpt-6-astra","name":"GPT 6 Astra","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":10,"output":50,"cacheRead":1,"cacheWrite":12.5,"tiers":[{"inputTokensAbove":272000,"input":20,"output":75,"cacheRead":2,"cacheWrite":25}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6-luna":{"id":"gpt-6-luna","name":"GPT 6 Luna","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1050000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":0.1,"output":0.5,"cacheRead":0.01,"cacheWrite":0.125,"tiers":[{"inputTokensAbove":272000,"input":0.2,"output":0.75,"cacheRead":0.02,"cacheWrite":0.25}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6-sol":{"id":"gpt-6-sol","name":"GPT 6 Sol","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1050000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":15,"cacheRead":0.4,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.1-sol":{"id":"gpt-6.1-sol","name":"GPT 6.1 Sol","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":15,"cacheRead":0.2,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.1-terra":{"id":"gpt-6.1-terra","name":"GPT 6.1 Terra","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":1,"output":5,"cacheRead":0.05,"cacheWrite":1.25,"tiers":[{"inputTokensAbove":272000,"input":2,"output":7.5,"cacheRead":0.1,"cacheWrite":2.5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.2-astra":{"id":"gpt-6.2-astra","name":"GPT 6.2 Astra","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":8,"output":40,"cacheRead":0.4,"cacheWrite":10,"tiers":[{"inputTokensAbove":272000,"input":16,"output":60,"cacheRead":0.8,"cacheWrite":20}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:gpt-6.2-sol":{"id":"gpt-6.2-sol","name":"GPT 6.2 Sol","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":2,"output":10,"cacheRead":0.1,"cacheWrite":2.5,"tiers":[{"inputTokensAbove":272000,"input":4,"output":15,"cacheRead":0.2,"cacheWrite":5}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:grok-4.7":{"id":"grok-4.7","name":"Grok 4.7","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null},"input":["text","image"],"contextWindow":500000,"maxTokens":450000,"type":"chat","lab":"xAI","cost":{"input":2,"output":6,"cacheRead":0.5,"cacheWrite":0,"tiers":[{"inputTokensAbove":200000,"input":4,"output":12,"cacheRead":1,"cacheWrite":0}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:kimi-k3":{"id":"kimi-k3","name":"Kimi K3","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1048576,"maxTokens":262144,"type":"chat","lab":"Moonshot AI","cost":{"input":3,"output":15,"cacheRead":0.3,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:kimi-k3.1-pro":{"id":"kimi-k3.1-pro","name":"Kimi K3.1 Pro","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},"input":["text","image"],"contextWindow":1048576,"maxTokens":131072,"type":"chat","lab":"Moonshot AI","cost":{"input":2,"output":10,"cacheRead":0.2,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:minimax-m3":{"id":"minimax-m3","name":"MiniMax M3","reasoning":true,"input":["text","image"],"contextWindow":524288,"maxTokens":131072,"type":"chat","lab":"MiniMax","cost":{"input":0.3,"output":1.2,"cacheRead":0.06,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:minimax-m3.1-flash":{"id":"minimax-m3.1-flash","name":"MiniMax M3.1 Flash","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":1000000,"maxTokens":524288,"type":"chat","lab":"MiniMax","cost":{"input":0.15,"output":0.6,"cacheRead":0.015,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:mistral-large-4":{"id":"mistral-large-4","name":"Mistral Large 4","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null},"input":["text","image"],"contextWindow":1048576,"maxTokens":262144,"type":"chat","lab":"Mistral AI","cost":{"input":0.7,"output":2.1,"cacheRead":0.07,"cacheWrite":0},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:precise":{"id":"precise","name":"Precise","reasoning":true,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":"max"},"input":["text","image"],"contextWindow":272000,"maxTokens":128000,"type":"chat","lab":"OpenAI","cost":{"input":4,"output":20,"cacheRead":0.4,"cacheWrite":5,"tiers":[{"inputTokensAbove":272000,"input":8,"output":30,"cacheRead":0.8,"cacheWrite":10}]},"enabled":true,"providers":[{"id":"openrouter","name":"OpenRouter","credential":"radius","source":"radius"}],"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1","inputLimits":{"images":{"resize":{"maxWidth":2000,"maxHeight":2000,"maxBytes":4718592,"jpegQuality":80}}}},"chat:recursive/flint":{"id":"recursive/flint","name":"Flint (free, trains on data)","reasoning":true,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":null,"xhigh":null,"max":null},"input":["text"],"contextWindow":262144,"maxTokens":65536,"type":"chat","lab":"Recursive","cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"enabled":true,"providers":[{"id":"recursive","name":"Recursive","credential":"radius","source":"radius"}],"free":true,"api":"pi-messages","provider":"radius","baseUrl":"https://radius.pi.dev/v1"}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PI_AI_VERSION = "1.0.
|
|
1
|
+
export declare const PI_AI_VERSION = "1.0.61";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const I="1.0.
|
|
1
|
+
const I="1.0.61";export{I as PI_AI_VERSION};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-ai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@anthropic-ai/sdk": "0.129.0",
|
|
64
64
|
"@aws-sdk/client-bedrock-runtime": "3.1127.0",
|
|
65
|
-
"@earendil-works/pi-schema": "1.0.
|
|
66
|
-
"@earendil-works/pi-telemetry": "1.0.
|
|
65
|
+
"@earendil-works/pi-schema": "1.0.61",
|
|
66
|
+
"@earendil-works/pi-telemetry": "1.0.61",
|
|
67
67
|
"@google/genai": "2.21.0",
|
|
68
68
|
"@smithy/node-http-handler": "4.12.1",
|
|
69
69
|
"http-proxy-agent": "9.1.0",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.61",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.14.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.61",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dal-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "dal-code",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.61",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "1.3.0",
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var ye=Object.defineProperty;var e=(o,t)=>ye(o,"name",{value:t,configurable:!0});import{createRequire as Le}from"node:module";const Ai=Le(import.meta.url);import{ADAPTATION_FILE as Fe,AgentSession as Ie,AgentSessionRuntime as Oe,AssistantMessageComponent as Ne,BackgroundProcessManager as we,BashExecutionComponent as ve,BorderedLoader as Me,BranchSummaryMessageComponent as He,CompactionSummaryMessageComponent as xe,CustomEditor as be,CustomMessageComponent as Be,DEFAULT_COMPACTION_SETTINGS as Ue,DefaultPackageManager as je,DefaultResourceLoader as Ke,DynamicBorder as We,ENGINE_MARKET_CACHE_FILE as Ge,ExtensionEditorComponent as $e,ExtensionFatalError as Ve,ExtensionInputComponent as ze,ExtensionRunner as Je,ExtensionSelectorComponent as Xe,FooterComponent as Ye,HOST_CAPABILITIES_ENV as qe,HOST_TOKEN_ENV as Qe,HOST_TOKEN_HEADER as Ze,HOST_URL_ENV as et,HostCallError as tt,HostCapabilities as ot,InteractiveMode as rt,LoginDialogComponent as nt,MARKET_SECTIONS as it,MAX_BACKGROUND_PROCESSES as st,ModelRegistry as at,ModelSelectorComponent as lt,OAuthSelectorComponent as ut,PROTECTED_WRITE_NAMES as ct,REQUIRED_EXTENSION_FAILED as dt,RequiredExtensionError as mt,RpcClient as pt,RpcCommandError as Et,SANDBOX_ENV as St,SessionSelectorComponent as gt,SettingsManager as ht,SettingsSelectorComponent as ft,ShellSandbox as Tt,SkillInvocationMessageComponent as Ct,ThinkingSelectorComponent as kt,ToolExecutionComponent as _t,TreeSelectorComponent as Dt,UserMessageComponent as At,UserMessageSelectorComponent as Rt,adaptPackage as Pt,adaptationState as yt,agentLogPath as Lt,appendAgentLog as Ft,applyCommunityEnv as It,buildProjectMap as Ot,buildRuleSet as Nt,calculateContextTokens as wt,chromeBottom as te,chromeTop as oe,collectEntriesForBranchSummary as vt,communityEnv as Mt,compact as Ht,convertToPng as xt,copyToClipboard as bt,createAgentSession as Bt,createAgentSessionFromServices as Ut,createAgentSessionRuntime as jt,createAgentSessionServices as Kt,createBashTool as Wt,createBashToolDefinition as Gt,createCodemodeExtension as $t,createCodingTools as Vt,createEditTool as zt,createEditToolDefinition as Jt,createEventBus as Xt,createExtensionRuntime as Yt,createFindTool as qt,createFindToolDefinition as Qt,createGrepTool as Zt,createGrepToolDefinition as eo,createLocalBashOperations as to,createLocalPowerShellOperations as oo,createLsTool as ro,createLsToolDefinition as no,createMcpExtension as io,createPowerShellTool as so,createPowerShellToolDefinition as ao,createProcessToolDefinition as lo,createReadOnlyTools as uo,createReadTool as co,createReadToolDefinition as mo,createSyntheticSourceInfo as po,createToolSearchExtension as Eo,createWriteTool as So,createWriteToolDefinition as go,defineTool as ho,describeProjectFacts as fo,detectProjectFacts as To,detectSandboxAvailability as Co,detectSupportedImageMimeTypeFromFile as ko,discoverAndLoadExtensions as _o,ensurePackageAdapted as Do,estimateTokens as Ao,evaluateToolPolicy as Ro,expandTempDirVariable as Po,fetchSignedMarket as yo,findCutPoint as Lo,findTurnStartIndex as Fo,formatDimensionNote as Io,formatProjectMapPrompt as Oo,formatSkillsForPrompt as No,generateBranchSummary as wo,generateDiffString as vo,generateSummary as Mo,generateSummaryWithUsage as Ho,generateUnifiedPatch as xo,getHostCapabilities as bo,getLastAssistantUsage as Bo,getProcessShellSandbox as Uo,getToolDenial as jo,isAdaptablePackage as Ko,isBashToolResult as Wo,isEditToolResult as Go,isFatalExtensionError as $o,isFindToolResult as Vo,isGrepToolResult as zo,isHostExtensionPath as Jo,isLsToolResult as Xo,isPowerShellToolResult as Yo,isReadOnlyBashCommand as qo,isReadToolResult as Qo,isToolCallEventType as Zo,isWriteToolResult as er,loadMcpRuntime as tr,loadProjectContextFiles as or,loadSkills as rr,loadSkillsFromDir as nr,main as ir,markHostExtensionPaths as sr,marketCacheDir as ar,matchPermissionRules as lr,normalizeForFuzzyMatch as ur,parseArgs as cr,parseFrontmatter as dr,parseHostCapabilities as mr,parsePermissionRule as pr,parseSkillBlock as Er,prepareBranchEntries as Sr,projectPackageManager as gr,readAccessDenial as hr,readAdaptation as fr,readSignedSection as Tr,registerPermissionAskHandler as Cr,registerSandboxEscalationHandler as kr,registerShellExecutionGuard as _r,renderDiff as Dr,resizeImage as Ar,resolveCliModel as Rr,resolveMarketEndpoint as Pr,resolveModelScopeWithDiagnostics as yr,resolveSandboxPolicy as Lr,resolveToCwd as Fr,runPrintMode as Ir,runRpcMode as Or,scanHardcodedPiPaths as Nr,serializeConversation as wr,shellExecutionRefusal as vr,shouldCompact as Mr,simpleCommands as Hr,stripFrontmatter as xr,systemTempDirs as br,tryEnsurePackageAdapted as Br,unwrapCommand as Ur,verifyAdaptation as jr,verifySignedSection as Kr,withFileMutationQueue as Wr,wrapRegisteredTool as Gr,wrapRegisteredTools as $r}from"./chunk-X63WCLSX.js";import{CURRENT_SESSION_VERSION as Vr,SessionManager as zr,buildContextEntries as Jr,buildSessionContext as Xr,buildSessionProjection as Yr,convertToLlm as qr,getDefaultSessionDir as Qr,getDefaultSessionDirs as Zr,getLatestCompactionEntry as en,migrateSessionEntries as tn,parseSessionEntries as on,sessionEntryToContextMessages as rn}from"./chunk-J6H2LYOZ.js";import{CredentialSynchronizationError as nn,DALCODE_PROJECT_DIR_NAME as sn,DEFAULT_HOOK_TIMEOUT_SECONDS as an,ModelRuntime as ln,PROJECT_HOOKS_FILE_ENV as un,ProjectTrustStore as cn,TRUST_REQUIRING_PROJECT_HOOK_FILES as dn,VIRTUAL_MODEL_STATE_ENTRY as mn,dalHookSourceFiles as pn,deriveHookName as En,hasTrustRequiringProjectResources as Sn,loadDalHooks as re,openBrowser as gn,projectFileDeclaresHooks as hn,projectHooksFileFromEnv as ne}from"./chunk-KT7CXVDN.js";import{formatReadLineRange as fn,truncateToVisualLines as Tn}from"./chunk-XQF5XDEM.js";import{readStoredCredential as Cn}from"./chunk-C5ELI234.js";import{DEFAULT_MAX_BYTES as kn,DEFAULT_MAX_LINES as _n,DEFAULT_SHELL_ENV_EXCLUDES as Dn,applyShellEnvironmentPolicy as An,formatSize as Rn,getPowerShellConfig as Pn,getShellConfig as yn,getShellEnv as Ln,isDalCodeCredentialName as Fn,truncateHead as In,truncateLine as On,truncateTail as Nn,withoutDalCodeCredentials as ie}from"./chunk-HF334NQU.js";import{ArminComponent as wn}from"./chunk-F5SIUTR7.js";import{Container as se,SelectList as ae,Theme as vn,getAvailableThemes as Mn,getLanguageFromPath as Hn,getMarkdownTheme as xn,getSelectListTheme as N,getSettingsListTheme as bn,highlightCode as Bn,initTheme as Un,keyHint as jn,keyText as Kn,rawKeyHint as Wn}from"./chunk-AL3DFAIM.js";import{CONFIG_DIR_NAME as Gn,SHARED_SKILL_CONFIG_DIRS as $n,VERSION as Vn,getAgentDir as le,getDocsPath as zn,getExamplesPath as Jn,getPackageDir as Xn,getReadmePath as Yn}from"./chunk-R47JBGS3.js";import{t as S}from"./chunk-QU2VEHMW.js";import{__export as qn}from"./chunk-JXWJOIH4.js";var ue={};qn(ue,{ADAPTATION_FILE:e(()=>Fe,"ADAPTATION_FILE"),AgentSession:e(()=>Ie,"AgentSession"),AgentSessionRuntime:e(()=>Oe,"AgentSessionRuntime"),ArminComponent:e(()=>wn,"ArminComponent"),AssistantMessageComponent:e(()=>Ne,"AssistantMessageComponent"),BackgroundProcessManager:e(()=>we,"BackgroundProcessManager"),BashExecutionComponent:e(()=>ve,"BashExecutionComponent"),BorderedLoader:e(()=>Me,"BorderedLoader"),BranchSummaryMessageComponent:e(()=>He,"BranchSummaryMessageComponent"),CONFIG_DIR_NAME:e(()=>Gn,"CONFIG_DIR_NAME"),CURRENT_SESSION_VERSION:e(()=>Vr,"CURRENT_SESSION_VERSION"),CompactionSummaryMessageComponent:e(()=>xe,"CompactionSummaryMessageComponent"),CredentialSynchronizationError:e(()=>nn,"CredentialSynchronizationError"),CustomEditor:e(()=>be,"CustomEditor"),CustomMessageComponent:e(()=>Be,"CustomMessageComponent"),DALCODE_PROJECT_DIR_NAME:e(()=>sn,"DALCODE_PROJECT_DIR_NAME"),DAL_HOOK_ENTRY_TYPE:e(()=>B,"DAL_HOOK_ENTRY_TYPE"),DAL_HOOK_NOTIFICATION_CHANNEL:e(()=>ee,"DAL_HOOK_NOTIFICATION_CHANNEL"),DEFAULT_COMPACTION_SETTINGS:e(()=>Ue,"DEFAULT_COMPACTION_SETTINGS"),DEFAULT_HOOK_TIMEOUT_SECONDS:e(()=>an,"DEFAULT_HOOK_TIMEOUT_SECONDS"),DEFAULT_MAX_BYTES:e(()=>kn,"DEFAULT_MAX_BYTES"),DEFAULT_MAX_LINES:e(()=>_n,"DEFAULT_MAX_LINES"),DEFAULT_SHELL_ENV_EXCLUDES:e(()=>Dn,"DEFAULT_SHELL_ENV_EXCLUDES"),DefaultPackageManager:e(()=>je,"DefaultPackageManager"),DefaultResourceLoader:e(()=>Ke,"DefaultResourceLoader"),DynamicBorder:e(()=>We,"DynamicBorder"),ENGINE_MARKET_CACHE_FILE:e(()=>Ge,"ENGINE_MARKET_CACHE_FILE"),ExtensionEditorComponent:e(()=>$e,"ExtensionEditorComponent"),ExtensionFatalError:e(()=>Ve,"ExtensionFatalError"),ExtensionInputComponent:e(()=>ze,"ExtensionInputComponent"),ExtensionRunner:e(()=>Je,"ExtensionRunner"),ExtensionSelectorComponent:e(()=>Xe,"ExtensionSelectorComponent"),FooterComponent:e(()=>Ye,"FooterComponent"),HOST_CAPABILITIES_ENV:e(()=>qe,"HOST_CAPABILITIES_ENV"),HOST_TOKEN_ENV:e(()=>Qe,"HOST_TOKEN_ENV"),HOST_TOKEN_HEADER:e(()=>Ze,"HOST_TOKEN_HEADER"),HOST_URL_ENV:e(()=>et,"HOST_URL_ENV"),HostCallError:e(()=>tt,"HostCallError"),HostCapabilities:e(()=>ot,"HostCapabilities"),InteractiveMode:e(()=>rt,"InteractiveMode"),LoginDialogComponent:e(()=>nt,"LoginDialogComponent"),MARKET_SECTIONS:e(()=>it,"MARKET_SECTIONS"),MAX_BACKGROUND_PROCESSES:e(()=>st,"MAX_BACKGROUND_PROCESSES"),ModelRegistry:e(()=>at,"ModelRegistry"),ModelRuntime:e(()=>ln,"ModelRuntime"),ModelSelectorComponent:e(()=>lt,"ModelSelectorComponent"),OAuthSelectorComponent:e(()=>ut,"OAuthSelectorComponent"),PROJECT_HOOKS_FILE_ENV:e(()=>un,"PROJECT_HOOKS_FILE_ENV"),PROTECTED_WRITE_NAMES:e(()=>ct,"PROTECTED_WRITE_NAMES"),ProjectTrustStore:e(()=>cn,"ProjectTrustStore"),REQUIRED_EXTENSION_FAILED:e(()=>dt,"REQUIRED_EXTENSION_FAILED"),RequiredExtensionError:e(()=>mt,"RequiredExtensionError"),RpcClient:e(()=>pt,"RpcClient"),RpcCommandError:e(()=>Et,"RpcCommandError"),SANDBOX_ENV:e(()=>St,"SANDBOX_ENV"),SHARED_SKILL_CONFIG_DIRS:e(()=>$n,"SHARED_SKILL_CONFIG_DIRS"),STALE_AFTER_MS:e(()=>H,"STALE_AFTER_MS"),SessionManager:e(()=>zr,"SessionManager"),SessionSelectorComponent:e(()=>gt,"SessionSelectorComponent"),SettingsManager:e(()=>ht,"SettingsManager"),SettingsSelectorComponent:e(()=>ft,"SettingsSelectorComponent"),ShellSandbox:e(()=>Tt,"ShellSandbox"),ShowImagesSelectorComponent:e(()=>Re,"ShowImagesSelectorComponent"),SkillInvocationMessageComponent:e(()=>Ct,"SkillInvocationMessageComponent"),TRUST_REQUIRING_PROJECT_HOOK_FILES:e(()=>dn,"TRUST_REQUIRING_PROJECT_HOOK_FILES"),Theme:e(()=>vn,"Theme"),ThemeSelectorComponent:e(()=>Pe,"ThemeSelectorComponent"),ThinkingSelectorComponent:e(()=>kt,"ThinkingSelectorComponent"),ToolExecutionComponent:e(()=>_t,"ToolExecutionComponent"),TreeSelectorComponent:e(()=>Dt,"TreeSelectorComponent"),UserMessageComponent:e(()=>At,"UserMessageComponent"),UserMessageSelectorComponent:e(()=>Rt,"UserMessageSelectorComponent"),VERSION:e(()=>Vn,"VERSION"),VIRTUAL_MODEL_STATE_ENTRY:e(()=>mn,"VIRTUAL_MODEL_STATE_ENTRY"),WORKSPACE_LOCK_DIR_NAME:e(()=>v,"WORKSPACE_LOCK_DIR_NAME"),WORKSPACE_LOCK_FILE:e(()=>L,"WORKSPACE_LOCK_FILE"),adaptPackage:e(()=>Pt,"adaptPackage"),adaptationState:e(()=>yt,"adaptationState"),agentLogPath:e(()=>Lt,"agentLogPath"),appendAgentLog:e(()=>Ft,"appendAgentLog"),applyCommunityEnv:e(()=>It,"applyCommunityEnv"),applyShellEnvironmentPolicy:e(()=>An,"applyShellEnvironmentPolicy"),buildContextEntries:e(()=>Jr,"buildContextEntries"),buildDalHookInput:e(()=>V,"buildDalHookInput"),buildProjectMap:e(()=>Ot,"buildProjectMap"),buildRuleSet:e(()=>Nt,"buildRuleSet"),buildSessionContext:e(()=>Xr,"buildSessionContext"),buildSessionProjection:e(()=>Yr,"buildSessionProjection"),calculateContextTokens:e(()=>wt,"calculateContextTokens"),claimWorkspace:e(()=>pe,"claimWorkspace"),collectEntriesForBranchSummary:e(()=>vt,"collectEntriesForBranchSummary"),communityEnv:e(()=>Mt,"communityEnv"),compact:e(()=>Ht,"compact"),convertToLlm:e(()=>qr,"convertToLlm"),convertToPng:e(()=>xt,"convertToPng"),copyToClipboard:e(()=>bt,"copyToClipboard"),createAgentSession:e(()=>Bt,"createAgentSession"),createAgentSessionFromServices:e(()=>Ut,"createAgentSessionFromServices"),createAgentSessionRuntime:e(()=>jt,"createAgentSessionRuntime"),createAgentSessionServices:e(()=>Kt,"createAgentSessionServices"),createBashTool:e(()=>Wt,"createBashTool"),createBashToolDefinition:e(()=>Gt,"createBashToolDefinition"),createCodemodeExtension:e(()=>$t,"createCodemodeExtension"),createCodingTools:e(()=>Vt,"createCodingTools"),createEditTool:e(()=>zt,"createEditTool"),createEditToolDefinition:e(()=>Jt,"createEditToolDefinition"),createEventBus:e(()=>Xt,"createEventBus"),createExtensionRuntime:e(()=>Yt,"createExtensionRuntime"),createFindTool:e(()=>qt,"createFindTool"),createFindToolDefinition:e(()=>Qt,"createFindToolDefinition"),createGrepTool:e(()=>Zt,"createGrepTool"),createGrepToolDefinition:e(()=>eo,"createGrepToolDefinition"),createLocalBashOperations:e(()=>to,"createLocalBashOperations"),createLocalPowerShellOperations:e(()=>oo,"createLocalPowerShellOperations"),createLsTool:e(()=>ro,"createLsTool"),createLsToolDefinition:e(()=>no,"createLsToolDefinition"),createMcpExtension:e(()=>io,"createMcpExtension"),createPowerShellTool:e(()=>so,"createPowerShellTool"),createPowerShellToolDefinition:e(()=>ao,"createPowerShellToolDefinition"),createProcessToolDefinition:e(()=>lo,"createProcessToolDefinition"),createReadOnlyTools:e(()=>uo,"createReadOnlyTools"),createReadTool:e(()=>co,"createReadTool"),createReadToolDefinition:e(()=>mo,"createReadToolDefinition"),createSyntheticSourceInfo:e(()=>po,"createSyntheticSourceInfo"),createToolSearchExtension:e(()=>Eo,"createToolSearchExtension"),createWriteTool:e(()=>So,"createWriteTool"),createWriteToolDefinition:e(()=>go,"createWriteToolDefinition"),dalHookActivity:e(()=>g,"dalHookActivity"),dalHookSourceFiles:e(()=>pn,"dalHookSourceFiles"),dalHooksExtension:e(()=>Ae,"dalHooksExtension"),decideDalHooks:e(()=>$,"decideDalHooks"),defaultWorkspaceLockDir:e(()=>M,"defaultWorkspaceLockDir"),defineTool:e(()=>ho,"defineTool"),deriveHookName:e(()=>En,"deriveHookName"),describeProjectFacts:e(()=>fo,"describeProjectFacts"),detectProjectFacts:e(()=>To,"detectProjectFacts"),detectSandboxAvailability:e(()=>Co,"detectSandboxAvailability"),detectSupportedImageMimeTypeFromFile:e(()=>ko,"detectSupportedImageMimeTypeFromFile"),discoverAndLoadExtensions:e(()=>_o,"discoverAndLoadExtensions"),engineToolInput:e(()=>j,"engineToolInput"),ensurePackageAdapted:e(()=>Do,"ensurePackageAdapted"),estimateTokens:e(()=>Ao,"estimateTokens"),evaluateToolPolicy:e(()=>Ro,"evaluateToolPolicy"),expandTempDirVariable:e(()=>Po,"expandTempDirVariable"),fetchSignedMarket:e(()=>yo,"fetchSignedMarket"),findCutPoint:e(()=>Lo,"findCutPoint"),findTurnStartIndex:e(()=>Fo,"findTurnStartIndex"),formatDalHookActivity:e(()=>U,"formatDalHookActivity"),formatDimensionNote:e(()=>Io,"formatDimensionNote"),formatProjectMapPrompt:e(()=>Oo,"formatProjectMapPrompt"),formatReadLineRange:e(()=>fn,"formatReadLineRange"),formatSize:e(()=>Rn,"formatSize"),formatSkillsForPrompt:e(()=>No,"formatSkillsForPrompt"),generateBranchSummary:e(()=>wo,"generateBranchSummary"),generateDiffString:e(()=>vo,"generateDiffString"),generateSummary:e(()=>Mo,"generateSummary"),generateSummaryWithUsage:e(()=>Ho,"generateSummaryWithUsage"),generateUnifiedPatch:e(()=>xo,"generateUnifiedPatch"),getAgentDir:e(()=>le,"getAgentDir"),getDefaultSessionDir:e(()=>Qr,"getDefaultSessionDir"),getDefaultSessionDirs:e(()=>Zr,"getDefaultSessionDirs"),getDocsPath:e(()=>zn,"getDocsPath"),getExamplesPath:e(()=>Jn,"getExamplesPath"),getHostCapabilities:e(()=>bo,"getHostCapabilities"),getLanguageFromPath:e(()=>Hn,"getLanguageFromPath"),getLastAssistantUsage:e(()=>Bo,"getLastAssistantUsage"),getLatestCompactionEntry:e(()=>en,"getLatestCompactionEntry"),getMarkdownTheme:e(()=>xn,"getMarkdownTheme"),getPackageDir:e(()=>Xn,"getPackageDir"),getPowerShellConfig:e(()=>Pn,"getPowerShellConfig"),getProcessShellSandbox:e(()=>Uo,"getProcessShellSandbox"),getReadmePath:e(()=>Yn,"getReadmePath"),getSelectListTheme:e(()=>N,"getSelectListTheme"),getSettingsListTheme:e(()=>bn,"getSettingsListTheme"),getShellConfig:e(()=>yn,"getShellConfig"),getShellEnv:e(()=>Ln,"getShellEnv"),getToolDenial:e(()=>jo,"getToolDenial"),gitDirOf:e(()=>x,"gitDirOf"),hasTrustRequiringProjectResources:e(()=>Sn,"hasTrustRequiringProjectResources"),highlightCode:e(()=>Bn,"highlightCode"),hookToolInput:e(()=>I,"hookToolInput"),hookToolName:e(()=>R,"hookToolName"),initTheme:e(()=>Un,"initTheme"),isAdaptablePackage:e(()=>Ko,"isAdaptablePackage"),isBashToolResult:e(()=>Wo,"isBashToolResult"),isDalCodeCredentialName:e(()=>Fn,"isDalCodeCredentialName"),isDalHookActivity:e(()=>ge,"isDalHookActivity"),isEditToolResult:e(()=>Go,"isEditToolResult"),isFatalExtensionError:e(()=>$o,"isFatalExtensionError"),isFindToolResult:e(()=>Vo,"isFindToolResult"),isGrepToolResult:e(()=>zo,"isGrepToolResult"),isHostExtensionPath:e(()=>Jo,"isHostExtensionPath"),isLsToolResult:e(()=>Xo,"isLsToolResult"),isPowerShellToolResult:e(()=>Yo,"isPowerShellToolResult"),isReadOnlyBashCommand:e(()=>qo,"isReadOnlyBashCommand"),isReadToolResult:e(()=>Qo,"isReadToolResult"),isToolCallEventType:e(()=>Zo,"isToolCallEventType"),isWriteToolResult:e(()=>er,"isWriteToolResult"),keyHint:e(()=>jn,"keyHint"),keyText:e(()=>Kn,"keyText"),loadDalHooks:e(()=>re,"loadDalHooks"),loadMcpRuntime:e(()=>tr,"loadMcpRuntime"),loadProjectContextFiles:e(()=>or,"loadProjectContextFiles"),loadSkills:e(()=>rr,"loadSkills"),loadSkillsFromDir:e(()=>nr,"loadSkillsFromDir"),main:e(()=>ir,"main"),markHostExtensionPaths:e(()=>sr,"markHostExtensionPaths"),marketCacheDir:e(()=>ar,"marketCacheDir"),matchPermissionRules:e(()=>lr,"matchPermissionRules"),migrateSessionEntries:e(()=>tn,"migrateSessionEntries"),normalizeForFuzzyMatch:e(()=>ur,"normalizeForFuzzyMatch"),openBrowser:e(()=>gn,"openBrowser"),parseArgs:e(()=>cr,"parseArgs"),parseFrontmatter:e(()=>dr,"parseFrontmatter"),parseHostCapabilities:e(()=>mr,"parseHostCapabilities"),parsePermissionRule:e(()=>pr,"parsePermissionRule"),parseSessionEntries:e(()=>on,"parseSessionEntries"),parseSkillBlock:e(()=>Er,"parseSkillBlock"),prepareBranchEntries:e(()=>Sr,"prepareBranchEntries"),projectFileDeclaresHooks:e(()=>hn,"projectFileDeclaresHooks"),projectHooksFileFromEnv:e(()=>ne,"projectHooksFileFromEnv"),projectPackageManager:e(()=>gr,"projectPackageManager"),rawKeyHint:e(()=>Wn,"rawKeyHint"),readAccessDenial:e(()=>hr,"readAccessDenial"),readAdaptation:e(()=>fr,"readAdaptation"),readSignedSection:e(()=>Tr,"readSignedSection"),readStoredCredential:e(()=>Cn,"readStoredCredential"),readWorkspaceLock:e(()=>de,"readWorkspaceLock"),registerPermissionAskHandler:e(()=>Cr,"registerPermissionAskHandler"),registerSandboxEscalationHandler:e(()=>kr,"registerSandboxEscalationHandler"),registerShellExecutionGuard:e(()=>_r,"registerShellExecutionGuard"),releaseWorkspace:e(()=>Ee,"releaseWorkspace"),renderDiff:e(()=>Dr,"renderDiff"),reportDalHookProblems:e(()=>z,"reportDalHookProblems"),resizeImage:e(()=>Ar,"resizeImage"),resolveCliModel:e(()=>Rr,"resolveCliModel"),resolveMarketEndpoint:e(()=>Pr,"resolveMarketEndpoint"),resolveModelScopeWithDiagnostics:e(()=>yr,"resolveModelScopeWithDiagnostics"),resolveSandboxPolicy:e(()=>Lr,"resolveSandboxPolicy"),resolveToCwd:e(()=>Fr,"resolveToCwd"),runDalCommandHook:e(()=>W,"runDalCommandHook"),runDalHookEvent:e(()=>T,"runDalHookEvent"),runDalHooks:e(()=>G,"runDalHooks"),runNotificationHooks:e(()=>Z,"runNotificationHooks"),runPostToolUseHooks:e(()=>X,"runPostToolUseHooks"),runPreToolUseHooks:e(()=>J,"runPreToolUseHooks"),runPrintMode:e(()=>Ir,"runPrintMode"),runRpcMode:e(()=>Or,"runRpcMode"),runSessionStartHooks:e(()=>Y,"runSessionStartHooks"),runStopHooks:e(()=>Q,"runStopHooks"),runUserPromptSubmitHooks:e(()=>q,"runUserPromptSubmitHooks"),scanHardcodedPiPaths:e(()=>Nr,"scanHardcodedPiPaths"),selectDalHooks:e(()=>K,"selectDalHooks"),serializeConversation:e(()=>wr,"serializeConversation"),sessionEntryToContextMessages:e(()=>rn,"sessionEntryToContextMessages"),shellCommandDirectory:e(()=>Se,"shellCommandDirectory"),shellExecutionRefusal:e(()=>vr,"shellExecutionRefusal"),shouldCompact:e(()=>Mr,"shouldCompact"),simpleCommands:e(()=>Hr,"simpleCommands"),stripFrontmatter:e(()=>xr,"stripFrontmatter"),systemTempDirs:e(()=>br,"systemTempDirs"),toolMatchNames:e(()=>O,"toolMatchNames"),truncateHead:e(()=>In,"truncateHead"),truncateLine:e(()=>On,"truncateLine"),truncateTail:e(()=>Nn,"truncateTail"),truncateToVisualLines:e(()=>Tn,"truncateToVisualLines"),tryEnsurePackageAdapted:e(()=>Br,"tryEnsurePackageAdapted"),unwrapCommand:e(()=>Ur,"unwrapCommand"),verifyAdaptation:e(()=>jr,"verifyAdaptation"),verifySignedSection:e(()=>Kr,"verifySignedSection"),withFileMutationQueue:e(()=>Wr,"withFileMutationQueue"),withoutDalCodeCredentials:e(()=>ie,"withoutDalCodeCredentials"),workspaceLockIsLive:e(()=>F,"workspaceLockIsLive"),workspaceLockPath:e(()=>D,"workspaceLockPath"),workspaceOwnerSessionId:e(()=>b,"workspaceOwnerSessionId"),wrapRegisteredTool:e(()=>Gr,"wrapRegisteredTool"),wrapRegisteredTools:e(()=>$r,"wrapRegisteredTools")});import{execFileSync as Qn}from"node:child_process";import{createHash as Zn}from"node:crypto";import{mkdirSync as ei,readFileSync as ti,realpathSync as oi,renameSync as ri,rmSync as ni,writeFileSync as ii}from"node:fs";import{hostname as P}from"node:os";import{basename as w,isAbsolute as si,join as y,resolve as k}from"node:path";var v="workspace-locks",L="dal-workspace.lock";function M(){return y(le(),v)}e(M,"defaultWorkspaceLockDir");function D(o,t=M()){let r=k(o);try{r=oi.native(r)}catch{}let n=Zn("sha256").update(r).digest("hex").slice(0,16),a=w(r)===".git"?w(k(r,"..")):w(r);return y(t,`${a.replace(/[^\w.-]/g,"_").slice(0,40)||"repo"}-${n}.lock`)}e(D,"workspaceLockPath");var H=7200*1e3,ai=60*1e3,li="DALCODE_PARENT_SESSION_ID",ce=new Map;function x(o){let t=k(o),r=ce.get(t);if(r!==void 0)return r??void 0;let n=null;try{let a=Qn("git",["rev-parse","--git-dir","--show-toplevel"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:3e3}).trim().split(`
|
|
2
|
-
`),l=a[0]?.trim();l&&(n={gitDir:si(l)?l:k(t,l),worktree:a[1]?.trim()})}catch{n=null}return ce.set(t,n),n??void 0}e(x,"gitDirOf");function b(o,t=process.env){return t[li]||o}e(b,"workspaceOwnerSessionId");function A(o){try{let t=JSON.parse(ti(o,"utf8"));return typeof t.pid!="number"||typeof t.sessionId!="string"||typeof t.host!="string"?void 0:{pid:t.pid,host:t.host,sessionId:t.sessionId,startedAt:typeof t.startedAt=="string"?t.startedAt:new Date(0).toISOString(),refreshedAt:typeof t.refreshedAt=="string"?t.refreshedAt:new Date(0).toISOString(),...typeof t.worktree=="string"?{worktree:t.worktree}:{}}}catch{return}}e(A,"readLockFile");function de(o,t){return A(D(o,t))??A(y(o,L))}e(de,"readWorkspaceLock");function ui(o){try{return process.kill(o,0),!0}catch(t){return t.code==="EPERM"}}e(ui,"processAlive");function F(o,t=Date.now()){let r=Date.parse(o.refreshedAt);return!Number.isFinite(r)||t-r>H?!1:o.host===P()?ui(o.pid):!0}e(F,"workspaceLockIsLive");function me(o,t){ei(k(o,".."),{recursive:!0});let r=`${o}.${process.pid}.tmp`;ii(r,`${JSON.stringify(t,null,2)}
|
|
3
|
-
`),ri(r,o)}e(me,"writeLock");function pe(o,t,r={}){let n=x(o);if(!n)return;let a=r.now??Date.now(),l=b(t,r.env),d=D(n.gitDir,r.lockDir),c=A(d),u={gitDir:n.gitDir,...n.worktree?{worktree:n.worktree}:{}},i=A(y(n.gitDir,L));for(let s of[c,i])if(s&&s.sessionId!==l&&F(s,a)&&!r.force)return{...u,heldBy:s};if(c?.sessionId===l&&F(c,a)){if(!(c.pid===process.pid&&c.host===P())||a-Date.parse(c.refreshedAt)<ai)return u;try{me(d,{...c,refreshedAt:new Date(a).toISOString()})}catch{}return u}try{me(d,{pid:process.pid,host:P(),sessionId:l,startedAt:new Date(a).toISOString(),refreshedAt:new Date(a).toISOString(),...n.worktree?{worktree:n.worktree}:{}})}catch{return}return u}e(pe,"claimWorkspace");function Ee(o,t){let r=D(o,t),n=A(r);if(!(!n||n.pid!==process.pid||n.host!==P()))try{ni(r,{force:!0})}catch{}}e(Ee,"releaseWorkspace");function Se(o,t){let r=t;for(let a of o.split(/&&|;|\n/)){let l=/^\s*cd\s+("([^"]+)"|'([^']+)'|(\S+))\s*$/.exec(a);if(!l)break;let d=(l[2]??l[3]??l[4]??"").replace(/^~(?=\/|$)/,process.env.HOME??"~");r=k(r,d)}let n=/\bgit\s+-C\s+("([^"]+)"|'([^']+)'|(\S+))/.exec(o);return n&&(r=k(r,n[2]??n[3]??n[4]??".")),r}e(Se,"shellCommandDirectory");var B="dal-hook";function h(o,t){return o.replace(/\{(\w+)\}/g,(r,n)=>String(t[n]??""))}e(h,"fill");function ci(o,t=300){let r=(o??"").replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-1)}\u2026`:r}e(ci,"oneLine");function U(o){let t={name:o.hookName??"",tool:o.toolName??"",event:o.event,detail:ci(o.detail),path:o.path??"",seconds:o.timeoutSeconds??""};switch(o.kind){case"blocked":return o.toolName?h(S("\u94A9\u5B50 {name} \u62E6\u622A\u4E86 {tool}\uFF1A{detail}"),t):h(S("\u94A9\u5B50 {name} \u62E6\u622A\u4E86\u8FD9\u6761\u6D88\u606F\uFF1A{detail}"),t);case"modified":return h(S("\u94A9\u5B50 {name} \u4FEE\u6539\u4E86 {tool} \u7684\u8F93\u5165"),t);case"context":return h(S("\u94A9\u5B50 {name} \u4E3A {event} \u8865\u5145\u4E86\u4E0A\u4E0B\u6587"),t);case"message":return h(S("\u94A9\u5B50 {name}\uFF1A{detail}"),t);case"stop-ignored":return h(S("\u94A9\u5B50 {name} \u8981\u6C42\u7EE7\u7EED\u5DE5\u4F5C\uFF0C\u4F46 Stop \u94A9\u5B50\u4E0D\u80FD\u8BA9\u56DE\u5408\u7EED\u8DD1\uFF0C\u5DF2\u5FFD\u7565\uFF1A{detail}"),t);case"failed":return h(S("\u94A9\u5B50 {name}\uFF08{event}\uFF09\u8FD0\u884C\u5931\u8D25\uFF0C\u5DF2\u7EE7\u7EED\uFF1A{detail}"),t);case"timeout":return h(S("\u94A9\u5B50 {name}\uFF08{event}\uFF09\u8D85\u8FC7 {seconds} \u79D2\u672A\u7ED3\u675F\uFF0C\u5DF2\u7EC8\u6B62\u5E76\u7EE7\u7EED"),t);case"config":return h(S("\u94A9\u5B50\u914D\u7F6E\u6709\u8BEF\uFF08{path}\uFF09\uFF1A{detail}"),t)}}e(U,"formatDalHookActivity");var di=new Set(["stop-ignored","failed","timeout","config"]);function g(o){return{...o,text:U(o),level:di.has(o.kind)?"warning":"info"}}e(g,"dalHookActivity");function ge(o){if(typeof o!="object"||o===null)return!1;let t=o;return typeof t.kind=="string"&&typeof t.event=="string"&&typeof t.text=="string"}e(ge,"isDalHookActivity");import{spawn as he}from"node:child_process";var fe=64*1024,mi={bash:"Bash",powershell:"PowerShell",read:"Read",write:"Write",edit:"Edit",grep:"Grep",find:"Glob",ls:"LS",task:"Task"},Te=new Set(["read","write","edit"]);function R(o){return mi[o]??o}e(R,"hookToolName");function I(o,t){return Te.has(o)&&typeof t.path=="string"&&t.file_path===void 0?{...t,file_path:t.path}:{...t}}e(I,"hookToolInput");function j(o,t){if(!Te.has(o)||!("file_path"in t))return{...t};let{file_path:r,...n}=t;return typeof r=="string"?{...n,path:r}:n}e(j,"engineToolInput");function pi(o,t){if(/^[A-Za-z0-9_|-]+$/.test(o)){let n=o.split("|").filter(Boolean);return t.some(a=>n.includes(a))}let r;try{r=new RegExp(`^(?:${o})$`)}catch{return!1}return t.some(n=>r.test(n))}e(pi,"matcherAccepts");function K(o,t,r){return o.filter(n=>n.event!==t?!1:n.matcher===void 0||r===void 0?!0:pi(n.matcher,r))}e(K,"selectDalHooks");function O(o){return[o,R(o)]}e(O,"toolMatchNames");function Ce(o){if(o!==void 0)try{process.platform==="win32"?he("taskkill",["/pid",String(o),"/t","/f"],{stdio:"ignore"}):process.kill(-o,"SIGKILL")}catch{}}e(Ce,"killTree");function Ei(o){let t=o.trim();if(t.startsWith("{"))try{let r=JSON.parse(t);return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:void 0}catch{return}}e(Ei,"parseJsonObject");function W(o,t,r){let n=Date.now();return new Promise(a=>{let l="",d="",c=!1,u=!1,i=he(o.command,{cwd:r.cwd,shell:!0,detached:process.platform!=="win32",stdio:["pipe","pipe","pipe"],env:{...ie(process.env),...r.env,DAL_PROJECT_DIR:r.cwd,CLAUDE_PROJECT_DIR:r.cwd}}),s=e(m=>{c||(c=!0,clearTimeout(p),r.signal?.removeEventListener("abort",E),a({hook:o,stdout:l,stderr:d,durationMs:Date.now()-n,...m}))},"finish"),p=setTimeout(()=>{u=!0,Ce(i.pid)},o.timeoutSeconds*1e3),E=e(()=>Ce(i.pid),"onAbort");r.signal?.addEventListener("abort",E,{once:!0}),i.stdout.setEncoding("utf8"),i.stderr.setEncoding("utf8"),i.stdout.on("data",m=>{l.length<fe&&(l+=m)}),i.stderr.on("data",m=>{d.length<fe&&(d+=m)}),i.stdin.on("error",()=>{}),i.stdin.end(JSON.stringify(t)),i.on("error",m=>{s({status:"failed",exitCode:null,error:m.message})}),i.on("close",m=>{if(u){s({status:"timeout",exitCode:m,error:`timed out after ${o.timeoutSeconds}s`});return}if(r.signal?.aborted){s({status:"failed",exitCode:m,error:"cancelled"});return}if(m===2){s({status:"blocked",exitCode:m});return}if(m!==0){s({status:"failed",exitCode:m,error:`exited with code ${m}`});return}let C=Ei(l);s({status:"success",exitCode:0,...C?{output:C}:{}})})})}e(W,"runDalCommandHook");function G(o,t,r){return Promise.all(o.map(n=>W(n,t,r)))}e(G,"runDalHooks");function _(o,t){let r=o?.[t];return typeof r=="string"&&r.trim()!==""?r:void 0}e(_,"stringField");var Si=new Set(["SessionStart","UserPromptSubmit"]);function $(o,t){let r,n,a,l=[],d=[],c=[];for(let u of t){if(u.status==="failed"||u.status==="timeout"){c.push(u);continue}if(u.status==="blocked"){r??={hook:u.hook,reason:u.stderr.trim()||`hook ${u.hook.name} blocked (exit 2)`};continue}let i=u.output;if(!i){Si.has(o)&&u.stdout.trim()!==""&&l.push({hook:u.hook,text:u.stdout.trim()});continue}let s=typeof i.hookSpecificOutput=="object"&&i.hookSpecificOutput!==null?i.hookSpecificOutput:void 0,p=_(s,"permissionDecisionReason")??_(i,"reason");i.continue===!1&&(n??={hook:u.hook,reason:_(i,"stopReason")??p??u.hook.name}),(_(s,"permissionDecision")==="deny"||i.decision==="block")&&(r??={hook:u.hook,reason:p??`hook ${u.hook.name} blocked`});let E=s?.updatedInput;typeof E=="object"&&E!==null&&!Array.isArray(E)&&(a={hook:u.hook,input:E});let m=_(s,"additionalContext");m&&l.push({hook:u.hook,text:m});let C=_(i,"systemMessage");C&&d.push({hook:u.hook,text:C})}return{...r?{blocked:r}:{},...n?{stop:n}:{},...a?{updatedInput:a}:{},additionalContext:l,systemMessages:d,failures:c}}e($,"decideDalHooks");function V(o,t,r={}){return{session_id:t.sessionId,transcript_path:t.transcriptPath??"",cwd:t.cwd,...t.permissionMode?{permission_mode:t.permissionMode}:{},...t.agentId?{agent_id:t.agentId}:{},...t.agentType?{agent_type:t.agentType}:{},hook_event_name:o,...r}}e(V,"buildDalHookInput");function f(o){return{hookName:o.name,scope:o.scope}}e(f,"scopeOf");function gi(o,t,r){for(let n of t.failures)r(g({kind:n.status==="timeout"?"timeout":"failed",event:o,...f(n.hook),detail:hi(n),timeoutSeconds:n.hook.timeoutSeconds}));for(let n of t.systemMessages)r(g({kind:"message",event:o,...f(n.hook),detail:n.text}))}e(gi,"reportCommon");function hi(o){let t=o.stderr.trim();return t?`${o.error??""} ${t}`.trim():o.error??""}e(hi,"failureDetail");function z(o,t){for(let r of o.problems)t(g({kind:"config",event:r.event??"",path:r.path,detail:r.message}))}e(z,"reportDalHookProblems");async function T(o,t,r,n){let a=K(o.config.hooks,t,n);if(a.length===0)return;let l=await G(a,V(t,o.base,r),{cwd:o.base.cwd,...o.signal?{signal:o.signal}:{}}),d=$(t,l);return gi(t,d,o.report),d}e(T,"runDalHookEvent");async function J(o,t){let r=await T(o,"PreToolUse",{tool_name:R(t.toolName),tool_input:I(t.toolName,t.input),tool_use_id:t.toolCallId},O(t.toolName));if(!r)return{};let n=r.stop??r.blocked;return n?(o.report(g({kind:"blocked",event:"PreToolUse",...f(n.hook),toolName:t.toolName,detail:n.reason})),{blockReason:`[hook ${n.hook.name}] ${n.reason}`,...r.stop?{stop:!0}:{}}):r.updatedInput?(o.report(g({kind:"modified",event:"PreToolUse",...f(r.updatedInput.hook),toolName:t.toolName})),{input:j(t.toolName,r.updatedInput.input)}):{}}e(J,"runPreToolUseHooks");async function X(o,t){let r=t.isError?"PostToolUseFailure":"PostToolUse",n=await T(o,r,{tool_name:R(t.toolName),tool_input:I(t.toolName,t.input),tool_use_id:t.toolCallId,...t.isError?{error:t.output}:{tool_response:{content:t.output,...t.details!==void 0?{details:t.details}:{}}}},O(t.toolName));if(!n)return{};let a=[],l=n.stop??n.blocked;l&&(o.report(g({kind:"blocked",event:r,...f(l.hook),toolName:t.toolName,detail:l.reason})),a.push(`[hook ${l.hook.name}] ${l.reason}`));for(let d of n.additionalContext)o.report(g({kind:"context",event:r,...f(d.hook),toolName:t.toolName})),a.push(`[hook ${d.hook.name}] ${d.text}`);return a.length>0?{appendText:a.join(`
|
|
4
|
-
`)}:{}}e(X,"runPostToolUseHooks");async function Y(o,t){let r=await T(o,"SessionStart",{source:t},[t]);return ke("SessionStart",r,o.report)}e(Y,"runSessionStartHooks");function ke(o,t,r){if(!(!t||t.additionalContext.length===0)){for(let n of t.additionalContext)r(g({kind:"context",event:o,...f(n.hook)}));return t.additionalContext.map(n=>n.text).join(`
|
|
5
|
-
|
|
6
|
-
`)}}e(ke,"contextOf");async function q(o,t){let r=await T(o,"UserPromptSubmit",{prompt:t});if(!r)return{};let n=r.stop??r.blocked;if(n)return o.report(g({kind:"blocked",event:"UserPromptSubmit",...f(n.hook),detail:n.reason})),{blockReason:n.reason};let a=ke("UserPromptSubmit",r,o.report);return a?{additionalContext:a}:{}}e(q,"runUserPromptSubmitHooks");async function Q(o){let t=await T(o,"Stop",{stop_hook_active:!1}),r=t?.blocked??t?.stop;r&&o.report(g({kind:"stop-ignored",event:"Stop",...f(r.hook),detail:r.reason}))}e(Q,"runStopHooks");async function Z(o,t){await T(o,"Notification",{message:t.message,notification_type:t.type},[t.type])}e(Z,"runNotificationHooks");var _e="dal-hook-context",ee="dal:hook-notification";function De(o=process.env){return o.DALCODE_BRIDGE_URL?!1:Number.parseInt(o.DAL_SUBAGENT_DEPTH??"0",10)<=0}e(De,"runsPromptHooksHere");function fi(o){if(typeof o!="object"||o===null)return!1;let{type:t,message:r}=o;return typeof t=="string"&&typeof r=="string"}e(fi,"isNotification");function Ti(o){return o.filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(`
|
|
7
|
-
`)}e(Ti,"textOf");function Ae(o){let t,r="",n,a,l=e(i=>{n=n?`${n}
|
|
8
|
-
|
|
9
|
-
${i}`:i},"queueContext"),d=e(i=>s=>{o.appendEntry(B,s),i.hasUI&&i.ui.notify(s.text,s.level)},"report"),c=e(i=>{t=re({cwd:i.cwd,projectTrusted:i.isProjectTrusted(),projectHooksFile:ne()});let s=JSON.stringify(t.problems);return s!==r&&(r=s,z(t,d(i))),t},"refresh"),u=e((i,s)=>({config:s,base:{sessionId:i.sessionManager.getSessionId(),transcriptPath:i.sessionManager.getSessionFile()??"",cwd:i.cwd},report:d(i),...i.signal?{signal:i.signal}:{}}),"callContext");o.on("session_start",async(i,s)=>{a=s;let p=c(s),E=await Y(u(s,p),i.reason);E&&l(E)}),o.on("input",async(i,s)=>{if(i.source==="extension"||!De())return;a=s;let p=await q(u(s,c(s)),i.text);if(p.blockReason!==void 0)return{action:"handled"};p.additionalContext&&(i.streamingBehavior?o.sendMessage({customType:_e,content:p.additionalContext,display:!1},{deliverAs:i.streamingBehavior}):l(p.additionalContext))}),o.events.on(ee,async i=>{let s=a;!s||!fi(i)||!De()||await Z(u(s,t??c(s)),i)}),o.on("before_agent_start",async(i,s)=>{if(c(s),!n)return;let p=n;return n=void 0,{message:{customType:_e,content:p,display:!1}}}),o.on("tool_call",async(i,s)=>{a=s;let p=t??c(s),E=await J(u(s,p),{toolName:i.toolName,toolCallId:i.toolCallId,input:i.input});if(E.blockReason!==void 0)return{block:!0,reason:E.blockReason,...E.stop?{terminate:!0}:{}};if(E.input){let m=i.input;for(let C of Object.keys(m))delete m[C];Object.assign(m,E.input)}}),o.on("tool_result",async(i,s)=>{let p=t??c(s),{appendText:E}=await X(u(s,p),{toolName:i.toolName,toolCallId:i.toolCallId,input:i.input,output:Ti(i.content),isError:i.isError,details:i.details});if(E)return{content:[...i.content,{type:"text",text:E}]}}),o.on("agent_end",async(i,s)=>{let p=t??c(s);await Q(u(s,p))})}e(Ae,"dalHooksExtension");var Ci={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},Re=class extends se{static{e(this,"ShowImagesSelectorComponent")}selectList;constructor(o,t,r){super();let n=[{value:"yes",label:S("\u662F"),description:S("\u5728\u7EC8\u7AEF\u91CC\u76F4\u63A5\u663E\u793A\u56FE\u7247")},{value:"no",label:S("\u5426"),description:S("\u6539\u4E3A\u663E\u793A\u6587\u5B57\u5360\u4F4D")}];this.addChild(oe(S("\u56FE\u7247\u663E\u793A"))),this.selectList=new ae(n,5,N(),Ci),this.selectList.setSelectedIndex(o?0:1),this.selectList.onSelect=a=>{t(a.value==="yes")},this.selectList.onCancel=()=>{r()},this.addChild(this.selectList),this.addChild(te())}getSelectList(){return this.selectList}},ki={minPrimaryColumnWidth:12,maxPrimaryColumnWidth:32},Pe=class extends se{static{e(this,"ThemeSelectorComponent")}selectList;onPreview;constructor(o,t,r,n){super(),this.onPreview=n;let a=Mn(),l=a.map(c=>({value:c,label:c,description:c===o?S("(\u5F53\u524D)"):void 0}));this.addChild(oe(S("\u9009\u62E9\u4E3B\u9898"))),this.selectList=new ae(l,10,N(),ki);let d=a.indexOf(o);d!==-1&&this.selectList.setSelectedIndex(d),this.selectList.onSelect=c=>{t(c.value)},this.selectList.onCancel=()=>{r()},this.selectList.onSelectionChange=c=>{this.onPreview(c.value)},this.addChild(this.selectList),this.addChild(te())}getSelectList(){return this.selectList}};export{B as DAL_HOOK_ENTRY_TYPE,ee as DAL_HOOK_NOTIFICATION_CHANNEL,H as STALE_AFTER_MS,Re as ShowImagesSelectorComponent,Pe as ThemeSelectorComponent,v as WORKSPACE_LOCK_DIR_NAME,L as WORKSPACE_LOCK_FILE,V as buildDalHookInput,pe as claimWorkspace,g as dalHookActivity,Ae as dalHooksExtension,$ as decideDalHooks,M as defaultWorkspaceLockDir,ue as dist_exports,j as engineToolInput,U as formatDalHookActivity,x as gitDirOf,I as hookToolInput,R as hookToolName,ge as isDalHookActivity,de as readWorkspaceLock,Ee as releaseWorkspace,z as reportDalHookProblems,W as runDalCommandHook,T as runDalHookEvent,G as runDalHooks,Z as runNotificationHooks,X as runPostToolUseHooks,J as runPreToolUseHooks,Y as runSessionStartHooks,Q as runStopHooks,q as runUserPromptSubmitHooks,K as selectDalHooks,Se as shellCommandDirectory,O as toolMatchNames,F as workspaceLockIsLive,D as workspaceLockPath,b as workspaceOwnerSessionId};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var pe=Object.defineProperty;var i=(e,u)=>pe(e,"name",{value:u,configurable:!0});import{createRequire as ye}from"node:module";const Du=ye(import.meta.url);import{t as o}from"./chunk-QU2VEHMW.js";import"./chunk-JXWJOIH4.js";import{chmodSync as Be,existsSync as B,mkdirSync as C,readFileSync as v,rmSync as we,writeFileSync as k}from"node:fs";import{homedir as he,userInfo as Ce}from"node:os";import{dirname as ve}from"node:path";import{spawn as ke}from"node:child_process";import{createHash as be}from"node:crypto";import{existsSync as $e,mkdirSync as q,readFileSync as V,realpathSync as Se,renameSync as Ne,rmSync as b,writeFileSync as $}from"node:fs";import{join as D}from"node:path";import{join as g}from"node:path";var Y="dal-remote",E="com.deepailab.dal-remote";function w(e){let u=g(e,"remote"),t=g(u,"logs"),r=g(u,"bin");return{root:u,daemonRoot:g(u,"daemon"),home:g(u,"home"),binDir:r,dalWrapper:g(r,"dal"),logDir:t,logFile:g(t,"daemon.log"),stateFile:g(u,"state.json"),accountTokenFile:g(u,"account-token")}}i(w,"remotePaths");function z(e,u){return g(e.daemonRoot,u)}i(z,"daemonInstallDir");var Re=200*1024*1024,Q=12e4,x=".dal-remote-installed",m=class extends Error{static{i(this,"RemoteInstallError")}code;constructor(e,u){super(u),this.code=e}},_e=i((e,u,t)=>new Promise(r=>{let n="",a="",l;try{l=ke(e,[...u],{cwd:t?.cwd,env:t?.env??process.env,stdio:["ignore","pipe","pipe"]})}catch(s){r({code:127,stdout:n,stderr:s instanceof Error?s.message:String(s)});return}l.stdout?.on("data",s=>{n+=String(s)}),l.stderr?.on("data",s=>{a+=String(s)}),l.on("error",s=>r({code:127,stdout:n,stderr:a||s.message})),l.on("close",s=>r({code:s??1,stdout:n,stderr:a}))}),"runCommand");function Te(e){return`sha512-${be("sha512").update(e).digest("base64")}`}i(Te,"sha512Integrity");function Oe(e){let u=(e.PI_OFFLINE??e.DAL_OFFLINE)?.toLowerCase();return u==="1"||u==="true"||u==="yes"}i(Oe,"offline");function S(e,u){let t=z(e,u.version);try{let r=JSON.parse(V(D(t,x),"utf8"));return r.name===u.packageName&&r.integrity===u.integrity?t:void 0}catch{return}}i(S,"installedDaemonDir");function N(e,u){let t=D(e,"node_modules",".bin",u.bin);if($e(t))try{return Se(t)}catch{return}}i(N,"daemonBinPath");async function Ie(e,u){let t=[],r=0;for(let n of e.registries){let a=`${n.replace(/\/+$/,"")}/${e.packageName}/${e.version}`;try{let l=await u(a,{signal:AbortSignal.timeout(Q)});if(l.status===404){r++,await l.body?.cancel();continue}if(!l.ok){t.push(`${n}: HTTP ${l.status}`),await l.body?.cancel();continue}let s=await l.json(),F=typeof s.dist?.tarball=="string"?s.dist.tarball:void 0;if(!F){t.push(`${n}: ${o("\u6CA1\u6709\u4E0B\u8F7D\u5730\u5740")}`);continue}return{registry:n,tarball:F,integrity:typeof s.dist?.integrity=="string"?s.dist.integrity:void 0}}catch(l){t.push(`${n}: ${l instanceof Error?l.message:String(l)}`)}}throw r>0&&t.length===0?new m("not-published",o("\u624B\u673A\u7AEF\u5B88\u62A4\u8FDB\u7A0B {pkg} \u8FD8\u6CA1\u6709\u53D1\u5E03\uFF0C\u6682\u65F6\u65E0\u6CD5\u5F00\u542F\u3002\u53D1\u5E03\u540E\u5347\u7EA7 dal \u5373\u53EF\u4F7F\u7528\u3002").replace("{pkg}",`${e.packageName}@${e.version}`)):new m("network",`${o("\u65E0\u6CD5\u4ECE\u8F6F\u4EF6\u6E90\u83B7\u53D6\u624B\u673A\u7AEF\u5B88\u62A4\u8FDB\u7A0B\uFF1A")}
|
|
2
|
-
${t.map(n=>` ${n}`).join(`
|
|
3
|
-
`)}`)}i(Ie,"lookUp");async function Pe(e,u){let t=await u(e,{signal:AbortSignal.timeout(Q)});if(!t.ok)throw await t.body?.cancel(),new m("network",`${e}: HTTP ${t.status}`);let r=t.body?.getReader();if(!r)throw new m("network",`${e}: ${o("\u54CD\u5E94\u6CA1\u6709\u5185\u5BB9")}`);let n=[],a=0;for(;;){let{done:l,value:s}=await r.read();if(l)break;if(a+=s.byteLength,a>Re)throw await r.cancel(),new m("network",o("\u5B88\u62A4\u8FDB\u7A0B\u5B89\u88C5\u5305\u8D85\u8FC7 200 MB\uFF0C\u5DF2\u505C\u6B62\u4E0B\u8F7D"));n.push(s)}return Buffer.concat(n)}i(Pe,"download");async function Le(e,u,t){let r=S(e,u);if(r)return r;let n=`${u.packageName}@${u.version}`,a,l;if(u.tarball)a=V(u.tarball);else{if(Oe(t.env))throw new m("offline",o("\u79BB\u7EBF\u6A21\u5F0F\u4E0B\u65E0\u6CD5\u4E0B\u8F7D\u624B\u673A\u7AEF\u5B88\u62A4\u8FDB\u7A0B\u3002"));t.progress?.(o("\u6B63\u5728\u67E5\u627E {pkg} \u2026").replace("{pkg}",n));let c=await Ie(u,t.fetch);if(!u.integrity)throw new m("not-pinned",o("\u8FD9\u4E2A\u7248\u672C\u7684 dal \u6CA1\u6709\u8BB0\u5F55 {pkg} \u7684\u6821\u9A8C\u503C\uFF0C\u4E0D\u80FD\u5B89\u88C5\u3002\u8BF7\u5347\u7EA7 dal \u540E\u518D\u8BD5\u3002").replace("{pkg}",n));if(c.integrity&&c.integrity!==u.integrity)throw new m("integrity",o("\u8F6F\u4EF6\u6E90\u4E0A\u7684 {pkg} \u4E0E dal \u8BB0\u5F55\u7684\u6821\u9A8C\u503C\u4E0D\u4E00\u81F4\uFF0C\u5DF2\u505C\u6B62\u5B89\u88C5\u3002").replace("{pkg}",n));l=c.registry,t.progress?.(o("\u6B63\u5728\u4E0B\u8F7D {pkg} \u2026").replace("{pkg}",n)),a=await Pe(c.tarball,t.fetch)}let s=Te(a);if(s!==u.integrity)throw new m("integrity",o("\u4E0B\u8F7D\u5230\u7684 {pkg} \u6821\u9A8C\u503C\u4E0D\u7B26\uFF08{got}\uFF09\uFF0C\u5DF2\u4E22\u5F03\u3002").replace("{pkg}",n).replace("{got}",s.slice(0,20)));q(e.daemonRoot,{recursive:!0});let F=D(e.daemonRoot,`.stage-${process.pid}-${Date.now()}`);q(F,{recursive:!0});try{let c=D(F,"daemon.tgz");$(c,a),$(D(F,"package.json"),`${JSON.stringify({name:"dal-remote-host",private:!0})}
|
|
4
|
-
`),t.progress?.(o("\u6B63\u5728\u5B89\u88C5 {pkg} \u2026").replace("{pkg}",n));let d=await t.run(t.npm,["install","--prefix",F,"--no-audit","--no-fund","--ignore-scripts","--omit=dev",...l?["--registry",l]:[],c],{cwd:F,env:t.env});if(d.code!==0){let y=d.stderr.trim().split(`
|
|
5
|
-
`).slice(-8).join(`
|
|
6
|
-
`);throw new m("npm",`${o("npm \u5B89\u88C5\u624B\u673A\u7AEF\u5B88\u62A4\u8FDB\u7A0B\u5931\u8D25\uFF1A")}
|
|
7
|
-
${y}`)}if(!N(F,u))throw new m("bin",o("{pkg} \u91CC\u6CA1\u6709\u547D\u4EE4 {bin}\uFF0C\u65E0\u6CD5\u542F\u52A8\u3002").replace("{pkg}",n).replace("{bin}",u.bin));b(c,{force:!0}),$(D(F,x),`${JSON.stringify({name:u.packageName,version:u.version,integrity:u.integrity})}
|
|
8
|
-
`);let f=z(e,u.version);return b(f,{recursive:!0,force:!0}),Ne(F,f),f}finally{b(F,{recursive:!0,force:!0})}}i(Le,"installDaemon");async function R(e){let u=await e("ps",["-A","-o","pid=,ppid=,pgid=,command="]);if(u.code!==0)return[];let t=[];for(let r of u.stdout.split(`
|
|
9
|
-
`)){let n=/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/.exec(r);n&&t.push({pid:Number(n[1]),ppid:Number(n[2]),pgid:Number(n[3]),command:n[4]})}return t}i(R,"listProcesses");function _(e,u){let t=new Map;for(let s of e){let F=t.get(s.ppid)??[];F.push(s),t.set(s.ppid,F)}let r=e.find(s=>s.pid===u),n=r?[r]:[],a=[u],l=new Set(a);for(;a.length>0;){let s=a.shift();for(let F of t.get(s)??[])l.has(F.pid)||(l.add(F.pid),n.push(F),a.push(F.pid))}return n}i(_,"processTree");function X(e,u,t){let r=u.endsWith("/")?u:`${u}/`;return e.filter(n=>n.pid!==t&&n.command.includes(r))}i(X,"daemonProcesses");function Me(e,u,t,r){let n=new Set(r?_(e,r).map(a=>a.pid):[]);return X(e,u,t).filter(a=>!n.has(a.pid))}i(Me,"leftoverProcesses");function T(e,u,t){try{e(u,t)}catch{}}i(T,"signal");async function je(e,u,t){let r=i(async()=>{if(e.length===0)return[];let c=new Map((await R(u.run)).map(d=>[d.pid,d]));return e.filter(d=>c.get(d.pid)?.command===d.command)},"alive"),n=i(async c=>{let d=u.now()+c;for(;;){let f=await r();if(f.length===0||u.now()>=d)return f;await u.sleep(200)}},"waitGone"),a=await n(t.graceMs);if(a.length===0)return{killed:[],remaining:[]};for(let c of a)T(u.kill,c.pid,"SIGTERM");if(a=await n(t.termMs),a.length===0)return{killed:[],remaining:[]};let l=a,s=new Set(e.map(c=>c.pid)),F=new Set(a.map(c=>c.pgid).filter(c=>c>1&&s.has(c)));for(let c of F)T(u.kill,-c,"SIGKILL");for(let c of a)T(u.kill,c.pid,"SIGKILL");return{killed:l,remaining:await n(t.killMs??2e3)}}i(je,"reapProcesses");import{dirname as Ge,join as O}from"node:path";function I(e){if(e==="linux")return"systemd";if(e==="darwin")return"launchd"}i(I,"serviceKind");function We(e,u,t){if(e==="launchd")return O(u,"Library","LaunchAgents",`${E}.plist`);let r=t.XDG_CONFIG_HOME?.trim()||O(u,".config");return O(r,"systemd","user",`${Y}.service`)}i(We,"serviceFilePath");function P(e,u=!1){let t=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/%/g,"%%");return`"${u?t.replace(/\$/g,"$$$$"):t}"`}i(P,"systemdQuote");function Ue(e){let u=[e.program,...e.args].map(r=>P(r,!0)).join(" "),t=Object.entries(e.env).map(([r,n])=>`Environment=${P(`${r}=${n}`)}`);return["# Written by `dal remote enable`; removed by `dal remote disable`.","[Unit]","Description=DAL Code remote daemon (phone app)","After=network-online.target","Wants=network-online.target","","[Service]","Type=simple",`ExecStart=${u}`,...t,`WorkingDirectory=${P(e.workingDirectory)}`,"Restart=on-failure","RestartSec=5",`StandardOutput=append:${e.logFile}`,`StandardError=append:${e.logFile}`,"","[Install]","WantedBy=default.target",""].join(`
|
|
10
|
-
`)}i(Ue,"systemdUnit");function p(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}i(p,"xml");function Ke(e){let u=i(r=>r.map(n=>` <string>${p(n)}</string>`).join(`
|
|
11
|
-
`),"strings"),t=Object.entries(e.env).map(([r,n])=>` <key>${p(r)}</key>
|
|
12
|
-
<string>${p(n)}</string>`).join(`
|
|
13
|
-
`);return['<?xml version="1.0" encoding="UTF-8"?>','<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">',"<!-- Written by `dal remote enable`; removed by `dal remote disable`. -->",'<plist version="1.0">',"<dict>"," <key>Label</key>",` <string>${E}</string>`," <key>ProgramArguments</key>"," <array>",u([e.program,...e.args])," </array>"," <key>EnvironmentVariables</key>"," <dict>",t," </dict>"," <key>WorkingDirectory</key>",` <string>${p(e.workingDirectory)}</string>`," <key>RunAtLoad</key>"," <true/>"," <key>KeepAlive</key>"," <dict>"," <key>SuccessfulExit</key>"," <false/>"," </dict>"," <key>ThrottleInterval</key>"," <integer>5</integer>"," <key>ProcessType</key>"," <string>Interactive</string>"," <key>StandardOutPath</key>",` <string>${p(e.logFile)}</string>`," <key>StandardErrorPath</key>",` <string>${p(e.logFile)}</string>`,"</dict>","</plist>",""].join(`
|
|
14
|
-
`)}i(Ke,"launchdPlist");function He(e,u){return e==="systemd"?Ue(u):Ke(u)}i(He,"serviceFileContent");var h=`${Y}.service`;function Z(e){return(e.stderr.trim()||e.stdout.trim()).split(`
|
|
15
|
-
`).slice(-4).join(`
|
|
16
|
-
`)}i(Z,"describe");async function Je(e){let u=[];if(e.kind==="systemd"){for(let a of[["--user","daemon-reload"],["--user","enable","--now",h]]){let l=await e.run("systemctl",a);if(l.code!==0)throw new Error(`systemctl ${a.join(" ")}: ${Z(l)}`)}let n=await e.run("loginctl",["show-user",e.user,"--property=Linger"]);if(!/Linger=yes/.test(n.stdout)){let a=await e.run("loginctl",["enable-linger",e.user]);u.push(a.code===0?"linger-enabled":"linger-failed")}return u}let t=`gui/${e.uid}`;await e.run("launchctl",["bootout",`${t}/${E}`]),await ee(e);let r=await e.run("launchctl",["bootstrap",t,e.file]);if(r.code!==0)throw new Error(`launchctl bootstrap ${t}: ${Z(r)}`);return u}i(Je,"startService");var qe=1e4;async function ee(e){let u=e.sleep??(n=>new Promise(a=>setTimeout(a,n))),t=e.now??Date.now,r=t()+qe;for(;t()<r;){if((await e.run("launchctl",["print",`gui/${e.uid}/${E}`])).code!==0)return;await u(200)}}i(ee,"waitUnloaded");async function Ve(e){if(e.kind==="systemd"){await e.run("systemctl",["--user","disable","--now",h]);return}await e.run("launchctl",["bootout",`gui/${e.uid}/${E}`]),await ee(e)}i(Ve,"stopService");async function ue(e){if(e.kind==="systemd"){let r=await e.run("systemctl",["--user","show","--property=NRestarts","--value",h]),n=Number(r.stdout.trim());return r.code===0&&Number.isInteger(n)?n:0}let u=await e.run("launchctl",["print",`gui/${e.uid}/${E}`]),t=Number(/\bruns = (\d+)/.exec(u.stdout)?.[1]??0);return Math.max(0,t-1)}i(ue,"serviceRestarts");async function te(e){if(e.kind==="systemd"){let u=await e.run("systemctl",["--user","show","--property=MainPID","--value",h]),t=Number(u.stdout.trim());return u.code===0&&Number.isInteger(t)&&t>0?t:void 0}return(await L(e)).pid}i(te,"servicePid");async function Ye(e){e.kind==="systemd"&&await e.run("systemctl",["--user","daemon-reload"])}i(Ye,"forgetService");async function L(e){if(e.kind==="systemd"){let n=(await e.run("systemctl",["--user","is-active",h])).stdout.trim();return n==="active"||n==="activating"||n==="reloading"?{state:"running"}:n==="failed"?{state:"failed"}:n==="inactive"||n==="deactivating"?{state:"stopped"}:{state:"unknown"}}let u=await e.run("launchctl",["print",`gui/${e.uid}/${E}`]);if(u.code!==0)return{state:"stopped"};let t=/\bpid = (\d+)/.exec(u.stdout)?.[1];if(/\bstate = running\b/.test(u.stdout))return{state:"running",...t?{pid:Number(t)}:{}};let r=/last exit code = (\d+)/.exec(u.stdout)?.[1];return{state:r&&r!=="0"?"failed":"stopped"}}i(L,"serviceState");function ze(e){return Ge(e)}i(ze,"serviceDir");var Qe={packageName:"@deepailab/dal-remote-daemon",version:"0.1.1",integrity:"sha512-KOOHn9PMTQYr+RU5tiHrJ577pPF/gKt63Wqzb2Ku0RJFqW54jdguznFyf712GlPjYCAYU2O9wSQhKCVX/S2KFQ==",bin:"dal-remote-daemon"},xe=["https://registry.npmmirror.com","https://registry.npmjs.org"],M="DAL_REMOTE_DAEMON_PACKAGE",re="DAL_REMOTE_DAEMON_TARBALL",ne="DAL_REMOTE_DAEMON_INTEGRITY",Xe="DAL_REMOTE_DAEMON_REGISTRY",Ze="DAL_REMOTE_ACCOUNT_TOKEN_FILE";function eu(e){return["daemon","run","--home",e]}i(eu,"daemonRunArgs");function uu(e){return["daemon","pair","--home",e,"--relay","--json"]}i(uu,"daemonPairArgs");function j(e,u=Qe){let t=[e[Xe]?.trim(),...xe].filter(F=>!!F),r=e[M]?.trim(),n=e[re]?.trim(),a=e[ne]?.trim();if(!r&&!n)return{...u,registries:t};if(!a)throw new Error(`${M} / ${re} need ${ne} (the sha512 SRI they must match)`);let l=u.packageName,s=u.version;if(r){let F=r.lastIndexOf("@");if(F<=0)throw new Error(`${M} must be name@version, got ${r}`);l=r.slice(0,F),s=r.slice(F+1)}return{...u,packageName:l,version:s,integrity:a,registries:t,...n?{tarball:n}:{}}}i(j,"resolveDaemonSpec");var ie="DAL_CODING_AGENT_DIR";function G(e){try{return JSON.parse(v(e.stateFile,"utf8"))}catch{return}}i(G,"readState");function ae(e,u){C(e.root,{recursive:!0}),k(e.stateFile,`${JSON.stringify(u,null,2)}
|
|
17
|
-
`)}i(ae,"writeState");function oe(e){return`'${e.replace(/'/g,"'\\''")}'`}i(oe,"shellQuote");function le(e,u,t){let r={DAL_COMMAND:e.dalWrapper,[Ze]:e.accountTokenFile,HOME:t.home,PATH:[ve(t.nodePath),"/usr/local/bin","/usr/bin","/bin"].join(":")},n=t.env[ie]?.trim();return n&&(r[ie]=n),{program:t.nodePath,args:[u,...eu(e.home)],env:r,workingDirectory:t.home,logFile:e.logFile}}i(le,"launchSpecFor");function W(e,u){return{kind:e,file:We(e,u.home,u.env),run:u.run,uid:u.uid,user:u.user,sleep:U(u),now:K(u)}}i(W,"serviceContext");function U(e){return e.sleep??(u=>new Promise(t=>setTimeout(t,u)))}i(U,"sleeper");function K(e){return e.now??Date.now}i(K,"clock");function se(e){return e.err(o("dal remote \u76EE\u524D\u53EA\u652F\u6301 Linux\uFF08systemd\uFF09\u548C macOS\u3002")),1}i(se,"unsupported");function Fe(e){return e.out([o("\u7528\u6CD5\uFF1Adal remote <\u547D\u4EE4>"),"",o(" enable \u5B89\u88C5\u5E76\u542F\u52A8\u624B\u673A\u7AEF\u5B88\u62A4\u8FDB\u7A0B\uFF0C\u663E\u793A\u914D\u5BF9\u4FE1\u606F"),o(" disable \u505C\u6B62\u5E76\u79FB\u9664\u624B\u673A\u7AEF\u5B88\u62A4\u8FDB\u7A0B\u7684\u670D\u52A1\uFF08\u4FDD\u7559\u914D\u5BF9\u4FE1\u606F\uFF09"),o(" status \u67E5\u770B\u662F\u5426\u5F00\u542F\u3001\u662F\u5426\u5728\u8FD0\u884C\uFF08--json \u8F93\u51FA\u673A\u5668\u53EF\u8BFB\u7ED3\u679C\uFF09"),o(" pair \u518D\u6B21\u663E\u793A\u914D\u5BF9\u4FE1\u606F"),o(" logs \u67E5\u770B\u5B88\u62A4\u8FDB\u7A0B\u65E5\u5FD7\uFF08-n \u884C\u6570\uFF0C\u9ED8\u8BA4 50\uFF09"),"",o("\u9ED8\u8BA4\u4E0D\u5F00\u542F\uFF1B\u53EA\u6709\u8FD0\u884C dal remote enable \u540E\u624D\u4F1A\u5B89\u88C5\u548C\u542F\u52A8\u3002")].join(`
|
|
18
|
-
`)),0}i(Fe,"help");async function ce(e,u,t){let r=await t.run(t.nodePath,[e,...uu(u.home)],{env:t.env}),n=(r.stderr.trim()||r.stdout.trim()).split(`
|
|
19
|
-
`).slice(-3).join(`
|
|
20
|
-
`);if(r.code!==0)return{detail:n};try{let a=JSON.parse(r.stdout);return a.url?{offer:a,detail:n}:{detail:n}}catch{return{detail:n}}}i(ce,"fetchPairingResult");async function tu(e,u,t){return(await ce(e,u,t)).offer}i(tu,"fetchPairing");function ru(e,u=8){try{return v(e.logFile,"utf8").split(`
|
|
21
|
-
`).filter(t=>t.trim()!=="").slice(-u).map(t=>` ${t.length>300?`${t.slice(0,300)}\u2026`:t}`).join(`
|
|
22
|
-
`)}catch{return""}}i(ru,"logTail");var de=5e3,nu=1e4,iu=3;async function au(e,u,t,r){let n=U(r),a=K(r),l=a(),s=l+(r.pairWaitMs??12e4),F=l+de,c,d="",f=await ue(t);for(r.out(o("\u6B63\u5728\u7B49\u5F85\u5B88\u62A4\u8FDB\u7A0B\u5C31\u7EEA\u2026"));;){let y=await ce(e,u,r);if(y.offer)return me(y.offer,r),0;d=y.detail||d;let{state:J}=await L(t),A=a();if(J==="stopped"||J==="failed"?c??=A:c=void 0,await ue(t)-f>=iu||c!==void 0&&A-c>=nu){r.err(o("\u5B88\u62A4\u8FDB\u7A0B\u6CA1\u80FD\u542F\u52A8\uFF08\u5DF2\u9000\u51FA\u6216\u53CD\u590D\u5D29\u6E83\uFF09\u3002\u65E5\u5FD7\u6700\u540E\u51E0\u884C\uFF1A"));let De=ru(u);return r.err(De||` ${d||o("\uFF08\u6CA1\u6709\u65E5\u5FD7\uFF09")}`),r.err(o("\u4FEE\u597D\u540E\u518D\u8FD0\u884C dal remote enable\uFF1B\u5B8C\u6574\u65E5\u5FD7\uFF1Adal remote logs")),1}if(A>=s)break;A>=F&&(r.out(o("\u4ECD\u5728\u7B49\u5F85\u5B88\u62A4\u8FDB\u7A0B\u5C31\u7EEA\uFF08\u5DF2 {s} \u79D2\uFF09\u2026").replace("{s}",String(Math.round((A-l)/1e3)))),F=A+de),await n(500)}return r.err(o("\u5B88\u62A4\u8FDB\u7A0B {s} \u79D2\u5185\u6CA1\u6709\u5C31\u7EEA\uFF0C\u670D\u52A1\u4ECD\u5728\u8FD0\u884C\u3002\u7A0D\u540E\u8FD0\u884C dal remote pair\uFF0C\u6216\u7528 dal remote logs \u67E5\u770B\u65E5\u5FD7\u3002").replace("{s}",String(Math.round((s-l)/1e3)))),d&&r.err(` ${d}`),1}i(au,"waitForPairing");function me(e,u){u.out(o("\u5728\u624B\u673A\u4E0A\u6253\u5F00 DAL Code\uFF0C\u626B\u63CF\u4E0B\u9762\u7684\u4E8C\u7EF4\u7801\uFF0C\u6216\u6253\u5F00\u914D\u5BF9\u94FE\u63A5\uFF1A")),e.qr&&u.out(e.qr),e.url&&u.out(e.url)}i(me,"printPairing");function ou(e,u){let t=S(e,u);return t?N(t,u):void 0}i(ou,"installedBin");async function lu(e){let u=I(e.platform);if(!u)return se(e);let t=w(e.agentDir),r;try{r=j(e.env)}catch(F){return e.err(F instanceof Error?F.message:String(F)),1}let n;try{n=await Le(t,r,{fetch:e.fetch,run:e.run,env:e.env,npm:e.npm,progress:i(F=>e.out(F),"progress")})}catch(F){return e.err(F instanceof Error?F.message:String(F)),1}let a=N(n,r);if(!a)return e.err(o("{pkg} \u91CC\u6CA1\u6709\u547D\u4EE4 {bin}\uFF0C\u65E0\u6CD5\u542F\u52A8\u3002").replace("{pkg}",r.packageName).replace("{bin}",r.bin)),1;for(let F of[t.home,t.logDir,t.binDir])C(F,{recursive:!0,mode:448});k(t.dalWrapper,`#!/bin/sh
|
|
23
|
-
exec ${oe(e.nodePath)} ${oe(e.dalEntry)} "$@"
|
|
24
|
-
`),Be(t.dalWrapper,493);let l=W(u,e);C(ze(l.file),{recursive:!0}),k(l.file,He(u,le(t,a,e)));let s;try{s=await Je(l)}catch(F){return e.err(`${o("\u670D\u52A1\u6CA1\u80FD\u542F\u52A8\uFF1A")}${F instanceof Error?F.message:String(F)}`),u==="systemd"&&e.err(o("\u5982\u679C\u662F\u901A\u8FC7 ssh \u767B\u5F55\u7684\u670D\u52A1\u5668\uFF0C\u786E\u8BA4\u6709\u7528\u6237\u4F1A\u8BDD\uFF08XDG_RUNTIME_DIR\uFF09\uFF0C\u6216\u5148\u8FD0\u884C loginctl enable-linger\u3002")),1}return ae(t,{packageName:r.packageName,version:r.version,...r.integrity?{integrity:r.integrity}:{},enabled:!0,kind:u,serviceFile:l.file,enabledAt:new Date().toISOString()}),e.out(o("\u624B\u673A\u7AEF\u8FDC\u7A0B\u5DF2\u5F00\u542F\uFF08{pkg}\uFF09\u3002").replace("{pkg}",`${r.packageName}@${r.version}`)),s.includes("linger-enabled")&&e.out(o("\u5DF2\u5F00\u542F lingering\uFF1A\u6CE8\u9500\u540E\u3001\u91CD\u542F\u540E\u5B88\u62A4\u8FDB\u7A0B\u4E5F\u4F1A\u8FD0\u884C\u3002")),s.includes("linger-failed")&&e.out(o("\u6CA1\u80FD\u5F00\u542F lingering\uFF1A\u6CE8\u9500\u540E\u5B88\u62A4\u8FDB\u7A0B\u4F1A\u505C\u6B62\u3002\u53EF\u8BF7\u7BA1\u7406\u5458\u8FD0\u884C sudo loginctl enable-linger {user}\u3002").replace("{user}",e.user)),au(a,t,l,e)}i(lu,"enable");async function ge(e,u,t){let r=await R(t.run),n=await te(u),a=new Map;if(n)for(let l of _(r,n))a.set(l.pid,l);for(let l of X(r,e.daemonRoot,t.pid??process.pid))for(let s of _(r,l.pid))a.set(s.pid,s);return[...a.values()]}i(ge,"daemonProcessesNow");function fe(e,u,t=1e4){return je(e,{run:u.run,kill:u.kill??((r,n)=>process.kill(r,n)),sleep:U(u),now:K(u)},{graceMs:t,termMs:5e3})}i(fe,"reap");function Ee(e,u){return e.killed.length>0&&(u.out(o("\u6709 {n} \u4E2A\u5B88\u62A4\u8FDB\u7A0B\u7684\u8FDB\u7A0B\u6CA1\u6709\u6309\u65F6\u9000\u51FA\uFF0C\u5DF2\u5F3A\u5236\u7ED3\u675F\uFF1A").replace("{n}",String(e.killed.length))),u.out(H(e.killed))),e.remaining.length>0?(u.err(o("\u8FD9\u4E9B\u8FDB\u7A0B\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u624B\u52A8\u7ED3\u675F\uFF1A")),u.err(H(e.remaining)),!1):!0}i(Ee,"reportReaped");function H(e){return e.map(u=>` pid ${u.pid}: ${u.command.length>160?`${u.command.slice(0,160)}\u2026`:u.command}`).join(`
|
|
25
|
-
`)}i(H,"describeProcesses");async function su(e){let u=I(e.platform);if(!u)return se(e);let t=w(e.agentDir),r=W(u,e),n=G(t);if(!B(r.file)&&!n?.enabled){let l=B(t.daemonRoot)?await ge(t,r,e):[];return l.length===0?(e.out(o("\u624B\u673A\u7AEF\u8FDC\u7A0B\u672C\u6765\u5C31\u6CA1\u6709\u5F00\u542F\u3002")),0):Ee(await fe(l,e,0),e)?0:1}let a=await ge(t,r,e);return await Ve(r),we(r.file,{force:!0}),await Ye(r),n&&ae(t,{...n,enabled:!1,disabledAt:new Date().toISOString()}),Ee(await fe(a,e),e)?(e.out(o("\u624B\u673A\u7AEF\u8FDC\u7A0B\u5DF2\u5173\u95ED\u3002\u5B88\u62A4\u8FDB\u7A0B\u548C\u914D\u5BF9\u4FE1\u606F\u4ECD\u4FDD\u7559\u5728 {dir}\uFF0C\u518D\u6B21\u5F00\u542F\u65E0\u9700\u91CD\u65B0\u914D\u5BF9\u3002").replace("{dir}",t.root)),0):1}i(su,"disable");async function Ae(e){let u=w(e.agentDir),t=G(u),r;try{r=j(e.env)}catch{r=void 0}let n=I(e.platform),a=null;if(n){let s=W(n,e),F=B(s.file),c=F?await L(s):{state:"not-installed"};if(c.state==="running"&&c.pid===void 0&&n==="systemd"){let d=await te(s);d&&(c.pid=d)}a={kind:n,file:s.file,installed:F,...c}}let l=B(u.daemonRoot)?Me(await R(e.run),u.daemonRoot,e.pid??process.pid,a?.state==="running"&&a.pid?a.pid:void 0).map(({pid:s,command:F})=>({pid:s,command:F})):[];return{enabled:!!(t?.enabled&&a?.installed),installed:r?S(u,r)!==void 0:!1,packageName:t?.packageName??r?.packageName??"",version:t?.version??r?.version??"",service:a,leftovers:l,home:u.home,logFile:u.logFile}}i(Ae,"remoteStatus");function Fu(e){switch(e){case"running":return o("\u8FD0\u884C\u4E2D");case"stopped":return o("\u5DF2\u505C\u6B62");case"failed":return o("\u51FA\u9519\u505C\u6B62\uFF08\u7528 dal remote logs \u67E5\u770B\u539F\u56E0\uFF09");case"not-installed":return o("\u672A\u5B89\u88C5");default:return o("\u672A\u77E5")}}i(Fu,"stateLabel");async function cu(e,u){let t=await Ae(u);if(e.includes("--json"))return u.out(JSON.stringify(t,null,2)),0;let r=[`${o("\u624B\u673A\u7AEF\u8FDC\u7A0B\uFF1A")}${t.enabled?o("\u5DF2\u5F00\u542F"):o("\u672A\u5F00\u542F")}`,`${o("\u5B88\u62A4\u8FDB\u7A0B\uFF1A")}${t.packageName}@${t.version}\uFF08${t.installed?o("\u5DF2\u5B89\u88C5"):o("\u672A\u5B89\u88C5")}\uFF09`];return t.service?(r.push(`${o("\u670D\u52A1\uFF1A")}${t.service.kind==="systemd"?"systemd --user":"launchd"} \u2014 ${Fu(t.service.state)}${t.service.pid?` (pid ${t.service.pid})`:""}`),t.service.installed&&r.push(`${o("\u670D\u52A1\u6587\u4EF6\uFF1A")}${t.service.file}`)):r.push(o("dal remote \u76EE\u524D\u53EA\u652F\u6301 Linux\uFF08systemd\uFF09\u548C macOS\u3002")),t.leftovers.length>0&&(r.push(o("\u6B8B\u7559\u8FDB\u7A0B\uFF08\u4E0D\u5C5E\u4E8E\u6B63\u5728\u8FD0\u884C\u7684\u670D\u52A1\uFF09\uFF1A")),r.push(H(t.leftovers)),r.push(o("\u8FD0\u884C dal remote disable \u4F1A\u7ED3\u675F\u5B83\u4EEC\u3002"))),r.push(`${o("\u65E5\u5FD7\uFF1A")}${t.logFile}`),t.enabled||r.push(o("\u5F00\u542F\uFF1Adal remote enable")),u.out(r.join(`
|
|
26
|
-
`)),0}i(cu,"status");async function du(e,u){let t=w(u.agentDir),r;try{r=j(u.env)}catch(l){return u.err(l instanceof Error?l.message:String(l)),1}let n=ou(t,r);if(!n||!G(t)?.enabled)return u.err(o("\u624B\u673A\u7AEF\u8FDC\u7A0B\u6CA1\u6709\u5F00\u542F\u3002\u5148\u8FD0\u884C dal remote enable\u3002")),1;let a=await tu(n,t,u);return a?(e.includes("--json")?u.out(JSON.stringify(a,null,2)):me(a,u),0):(u.err(o("\u62FF\u4E0D\u5230\u914D\u5BF9\u4FE1\u606F\uFF1A\u5B88\u62A4\u8FDB\u7A0B\u53EF\u80FD\u6CA1\u6709\u5728\u8FD0\u884C\u3002\u7528 dal remote status \u548C dal remote logs \u67E5\u770B\u3002")),1)}i(du,"pair");function mu(e,u){let t=w(u.agentDir),r=e.indexOf("-n"),n=r>=0?Number(e[r+1]):50;if(!Number.isInteger(n)||n<=0)return u.err(o("-n \u9700\u8981\u4E00\u4E2A\u6B63\u6574\u6570\u3002")),2;if(!B(t.logFile))return u.out(o("\u8FD8\u6CA1\u6709\u65E5\u5FD7\uFF1A{file}").replace("{file}",t.logFile)),0;let a=v(t.logFile,"utf8").split(`
|
|
27
|
-
`);return a.at(-1)===""&&a.pop(),u.out(a.slice(-n).join(`
|
|
28
|
-
`)),0}i(mu,"logs");function gu(e){let u=process.env.USER??"";try{u=Ce().username}catch{}return{agentDir:e,home:he(),env:process.env,platform:process.platform,uid:typeof process.getuid=="function"?process.getuid():0,user:u,nodePath:process.execPath,dalEntry:process.argv[1]??"",fetch:i((t,r)=>fetch(t,r),"fetch"),run:_e,kill:i((t,r)=>process.kill(t,r),"kill"),pid:process.pid,npm:process.platform==="win32"?"npm.cmd":"npm",out:i(t=>process.stdout.write(`${t}
|
|
29
|
-
`),"out"),err:i(t=>process.stderr.write(`${t}
|
|
30
|
-
`),"err")}}i(gu,"defaultRemoteDeps");async function fu(e,u){let[t,...r]=e;switch(t){case"enable":return lu(u);case"disable":return su(u);case"status":return cu(r,u);case"pair":return du(r,u);case"logs":return mu(r,u);case void 0:case"help":case"-h":case"--help":return Fe(u);default:return u.err(o("\u672A\u77E5\u7684\u5B50\u547D\u4EE4\uFF1A{name}").replace("{name}",t)),Fe(u),2}}i(fu,"runRemoteCommand");export{gu as defaultRemoteDeps,le as launchSpecFor,Ae as remoteStatus,fu as runRemoteCommand};
|