@humain/humain-code 0.4.9 → 0.4.10
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 +22 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +39 -45
- package/dist/bundle/chunks/{chunk-6FVNSW6B.js → chunk-2QTTNAD4.js} +3353 -3938
- package/dist/bundle/chunks/chunk-76X5KOIA.js +28 -0
- package/dist/bundle/chunks/{chunk-KRMTBTWU.js → chunk-77EWF2NW.js} +1 -1
- package/dist/bundle/chunks/{chunk-RBKDBF5G.js → chunk-AS2Y2MO6.js} +36 -36
- package/dist/bundle/chunks/{chunk-4LAKI5IL.js → chunk-AUFEF24K.js} +1 -1
- package/dist/bundle/chunks/{chunk-P4YMUUSK.js → chunk-BCF7KZ3R.js} +739 -730
- package/dist/bundle/chunks/{chunk-W2QRCQBX.js → chunk-FF26YENK.js} +3 -4
- package/dist/bundle/chunks/{chunk-UZ5FVVCP.js → chunk-HMWAH7ZY.js} +1 -1
- package/dist/bundle/chunks/{chunk-F7UMX5BV.js → chunk-HSDTSUZE.js} +13 -2
- package/dist/bundle/chunks/chunk-I2ZWZAIV.js +751 -0
- package/dist/bundle/chunks/{chunk-GUUAEK6G.js → chunk-LCOHFEZZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-Z5LYSSTY.js → chunk-QSPDLT2R.js} +2 -2
- package/dist/bundle/chunks/{chunk-UBQSONVR.js → chunk-R5VIAWGA.js} +103 -145
- package/dist/bundle/chunks/{chunk-EMYNPLY5.js → chunk-V5ZF7Q7L.js} +1 -1
- package/dist/bundle/chunks/{chunk-LQ4S7CRR.js → chunk-VYIIPF57.js} +1 -1
- package/dist/bundle/chunks/chunk-WBJN6PEI.js +43 -0
- package/dist/bundle/chunks/{chunk-SWRU4BOC.js → chunk-XGO43DKL.js} +1 -1
- package/dist/bundle/chunks/{chunk-PMISFIBM.js → chunk-XMHLSV3I.js} +1 -1
- package/dist/bundle/chunks/{chunk-3E4SMILM.js → chunk-YJBE3IGR.js} +14 -14
- package/dist/bundle/chunks/{cli-ZKT34WPW.js → cli-5ACW3WND.js} +2 -2
- package/dist/bundle/chunks/{compat-HEUVP6UJ.js → compat-TQKA4I7M.js} +1 -1
- package/dist/bundle/chunks/{dist-NU2EIVT6.js → dist-WHC67QRM.js} +676 -550
- package/dist/bundle/chunks/dist-cjs-RL2OCAP2.js +179 -0
- package/dist/bundle/chunks/{easter-egg-3d-5KKDWEIA.js → easter-egg-3d-3L3IKAT6.js} +1 -1
- package/dist/bundle/chunks/{esm-NCUV2DF7.js → esm-763X2IA7.js} +1 -1
- package/dist/bundle/chunks/event-streams-R5OECII4.js +2 -0
- package/dist/bundle/chunks/{execute-OSBDNQU5.js → execute-4X6G65NZ.js} +1 -1
- package/dist/bundle/chunks/{extract-PYRMDATF.js → extract-DLZ425VI.js} +4 -4
- package/dist/bundle/chunks/github-copilot.js +32 -31
- package/dist/bundle/chunks/{google-generative-ai-H2F5Y5H2.js → google-generative-ai-JD2FVOIX.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-LFWD2AOO.js → google-vertex-PFBMDCBW.js} +1 -1
- package/dist/bundle/chunks/{host-6ZA6LK4C.js → host-4J7H7KDS.js} +1 -1
- package/dist/bundle/chunks/{node-XGNY74WT.js → node-W47VUEGE.js} +1 -1
- package/dist/bundle/chunks/{runtime-JFLZUNYP.js → runtime-SI76JZNE.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-ID2GA4GE.js +5 -0
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/flow/package.json +1 -1
- package/dist/bundle/index.js +17 -17
- package/dist/bundle/rpc-entry.js +3 -2
- package/dist/core/account-reporting.d.ts +109 -0
- package/dist/core/account-reporting.d.ts.map +1 -0
- package/dist/core/account-reporting.js +328 -0
- package/dist/core/account-reporting.js.map +1 -0
- package/dist/core/agent-session.d.ts +22 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +131 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-account-reporting.d.ts +76 -0
- package/dist/core/anthropic-account-reporting.d.ts.map +1 -0
- package/dist/core/anthropic-account-reporting.js +380 -0
- package/dist/core/anthropic-account-reporting.js.map +1 -0
- package/dist/core/bedrock-account-reporting.d.ts +82 -0
- package/dist/core/bedrock-account-reporting.d.ts.map +1 -0
- package/dist/core/bedrock-account-reporting.js +402 -0
- package/dist/core/bedrock-account-reporting.js.map +1 -0
- package/dist/core/model-runtime.d.ts +17 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +64 -10
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/oauth-account-pool.d.ts +4 -0
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +10 -3
- package/dist/core/oauth-account-pool.js.map +1 -1
- package/dist/humain/flow-accounts-host.d.ts +120 -0
- package/dist/humain/flow-accounts-host.d.ts.map +1 -0
- package/dist/humain/flow-accounts-host.js +346 -0
- package/dist/humain/flow-accounts-host.js.map +1 -0
- package/dist/humain/flow-command.d.ts +28 -0
- package/dist/humain/flow-command.d.ts.map +1 -0
- package/dist/humain/flow-command.js +226 -0
- package/dist/humain/flow-command.js.map +1 -0
- package/dist/humain/flow-loader.d.ts +4 -2
- package/dist/humain/flow-loader.d.ts.map +1 -1
- package/dist/humain/flow-loader.js +120 -91
- package/dist/humain/flow-loader.js.map +1 -1
- package/dist/humain/node-account-failure.d.ts +18 -0
- package/dist/humain/node-account-failure.d.ts.map +1 -0
- package/dist/humain/node-account-failure.js +73 -0
- package/dist/humain/node-account-failure.js.map +1 -0
- package/dist/humain/node-account-fallback.d.ts +85 -0
- package/dist/humain/node-account-fallback.d.ts.map +1 -0
- package/dist/humain/node-account-fallback.js +175 -0
- package/dist/humain/node-account-fallback.js.map +1 -0
- package/dist/humain/node-http.d.ts.map +1 -1
- package/dist/humain/node-http.js +11 -0
- package/dist/humain/node-http.js.map +1 -1
- package/dist/humain/node-provider.d.ts +4 -0
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +11 -0
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +2 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +5 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +26 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +242 -19
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/flow-profiles.md +57 -5
- package/docs/flow.md +119 -37
- package/docs/providers.md +37 -0
- package/npm-shrinkwrap.json +48 -6
- package/package.json +3 -2
- package/dist/bundle/chunks/chunk-JOKJ3CEL.js +0 -27
- package/dist/bundle/chunks/event-streams-CGCQQL5M.js +0 -2
- package/dist/bundle/chunks/virtual-modules-NPWQ6NBS.js +0 -5
|
@@ -19,37 +19,38 @@ tChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot
|
|
|
19
19
|
pilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"\
|
|
20
20
|
chat"},"chat:gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,
|
|
21
21
|
supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:3.75,cacheRead:.075,cacheWrite:0},contextWindow:1e6,maxTokens:64e3,headers:{"User-Agent":"GitH\
|
|
22
|
-
ubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:
|
|
23
|
-
copilot.com",reasoning:!0,input:["text","image"],cost:{input
|
|
24
|
-
chat"},"chat:kimi-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
22
|
+
ubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gemini-4-argon":{id:"gemini-4-argon",name:"Gemini 4 Argon",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.github\
|
|
23
|
+
copilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.1,cacheWrite:0},contextWindow:1048576,maxTokens:65536,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"\
|
|
24
|
+
chat"},"chat:kimi-k2.7-code":{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.95,output:4,cacheRead:.19,cacheWrite:0},contextWindow:256e3,maxTokens:32e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,
|
|
25
|
+
supportsDeveloperRole:!1,supportsReasoningEffort:!1},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:kimi-k3":{id:"kimi-k3",name:"Kimi K3",api:"openai-completions",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:3,output:15,cacheRead:.3,cacheWrite:0},contextWindow:1048576,maxTokens:131072,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vsco\
|
|
26
|
+
de/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},compat:{supportsStrictMode:!0,supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:!1,supportsMidConvoSystemMessages:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"}},"openai-responses":{"chat:gpt-5-mini":{id:"gpt-5-mini",name:"GPT-5 Mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcop\
|
|
27
|
+
ilot.com",reasoning:!0,input:["text","image"],cost:{input:.25,output:2,cacheRead:.025,cacheWrite:0},contextWindow:264e3,maxTokens:64e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:null,max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,
|
|
28
|
+
jpegQuality:80}}},type:"chat"},"chat:gpt-5.3-codex":{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:1.75,output:14,cacheRead:.175,cacheWrite:0},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{
|
|
29
|
+
off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4":{id:"gpt-5.4",name:"GPT-5.4",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2.5,output:15,cacheRead:.25,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:5,
|
|
30
|
+
output:22.5,cacheRead:.5,cacheWrite:0}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,
|
|
31
|
+
maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4-mini":{id:"gpt-5.4-mini",name:"GPT-5.4 mini",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},
|
|
32
|
+
thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.4-nano":{id:"gpt-5.4-nano",name:"GPT-5.4 nano",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],
|
|
33
|
+
cost:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0},contextWindow:4e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",xhigh:"xhigh"},compat:{supportsOpenAIGrammarTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.5":{id:"gpt-5.5",name:"GPT-5.5",
|
|
34
|
+
api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:5,output:30,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:272e3,input:10,output:45,cacheRead:1,cacheWrite:0}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"\
|
|
35
|
+
low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-luna":{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.2,output:1.2,cacheRead:.02,
|
|
36
|
+
cacheWrite:.25,tiers:[{inputTokensAbove:2e5,input:.4,output:1.8,cacheRead:.04,cacheWrite:.5}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},
|
|
37
|
+
inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-sol":{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:4,output:20,cacheRead:.4,cacheWrite:5,tiers:[{inputTokensAbove:272e3,input:8,output:30,cacheRead:.8,cacheWrite:10}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotCha\
|
|
38
|
+
t/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-5.6-terra":{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",
|
|
39
|
+
api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:12,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:18,cacheRead:.4,cacheWrite:5}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:"\
|
|
40
|
+
low",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-astra":{id:"gpt-6-astra",name:"GPT-6 Astra",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:10,output:50,cacheRead:1,
|
|
41
|
+
cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},
|
|
42
|
+
inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-luna":{id:"gpt-6-luna",name:"GPT-6 Luna",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilo\
|
|
43
|
+
tChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6-sol":{id:"gpt-6-sol",name:"GPT-6 Sol",api:"op\
|
|
44
|
+
enai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},contextWindow:1e6,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:"none",minimal:null,
|
|
45
|
+
low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:gpt-6.1-sol":{id:"gpt-6.1-sol",name:"GPT-6.1 Sol",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:10,cacheRead:.1,cacheWrite:2.5,
|
|
46
|
+
tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.2,cacheWrite:5}]},contextWindow:105e4,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{supportsOpenAIGrammarTools:!0,supportsMidConvoSystemMessages:!0,supportsAdditionalTools:!0},inputLimits:{images:{
|
|
47
|
+
resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.5":{id:"grok-4.5",name:"Grok 4.5",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.\
|
|
48
|
+
107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:grok-4.6":{id:"grok-4.6",name:"Grok 4.6",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,
|
|
49
|
+
cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"\
|
|
50
|
+
chat"},"chat:grok-4.7":{id:"grok-4.7",name:"Grok 4.7",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text","image"],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0,tiers:[{inputTokensAbove:2e5,input:4,output:12,cacheRead:1,cacheWrite:0}]},contextWindow:5e5,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"\
|
|
51
|
+
vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"},"chat:mai-code-1-flash-picker":{id:"mai-code-1-flash-picker",name:"MAI-Code-1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text"],cost:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0},contextWindow:256e3,
|
|
52
|
+
maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},type:"chat"},"chat:mai-code-1.1-flash":{id:"mai-code-1.1-flash",name:"MAI-Code-1.1-Flash",api:"openai-responses",provider:"github-copilot",baseUrl:"https://api.individual.githubcopilot.com",reasoning:!0,input:["text",
|
|
53
|
+
"image"],cost:{input:.2,output:1.2,cacheRead:.02,cacheWrite:0},contextWindow:256e3,maxTokens:128e3,headers:{"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},thinkingLevelMap:{off:null,minimal:null,low:"low",medium:"medium",high:"high",xhigh:null,max:null},inputLimits:{images:{resize:{maxWidth:2e3,maxHeight:2e3,maxBytes:4718592,jpegQuality:80}}},type:"chat"}}};function flattenModelCatalog(groups,type){return Object.fromEntries(Object.values(groups).flatMap(models=>Object.values(models)).filter(model=>model.type===type).map(model=>[model.id,model]))}function flattenChatModelCatalog(_provider,groups){return flattenModelCatalog(groups,"chat")}function flattenImageModelCatalog(_provider,groups){return flattenModelCatalog(groups,"image")}function flattenClassifierModelCatalog(_provider,groups){return flattenModelCatalog(groups,"classifier")}var GITHUB_COPILOT_MODELS=flattenChatModelCatalog("github-copilot",github_copilot_default),GITHUB_COPILOT_IMAGE_MODELS=flattenImageModelCatalog("github-copilot",github_copilot_default),GITHUB_COPILOT_CLASSIFIER_MODELS=flattenClassifierModelCatalog("github-copilot",github_copilot_default);function sleep(ms,signal){return new Promise((resolve,reject)=>{signal.throwIfAborted();let onAbort=()=>{clearTimeout(timeout),reject(signal.reason)},timeout=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve()},ms);signal.addEventListener("abort",onAbort,{once:!0})})}var CANCEL_MESSAGE="Login cancelled",TIMEOUT_MESSAGE="Device flow timed out",SLOW_DOWN_TIMEOUT_MESSAGE="Device flow timed out after one or more slow_down responses. This is often caused by clock drift in WSL or VM environments. Please sync or restart the VM clock and try again.";function abortableSleep(ms,signal,cancelMessage){return new Promise((resolve,reject)=>{if(signal.aborted){reject(new Error(cancelMessage));return}let onAbort=()=>{clearTimeout(timeout),reject(new Error(cancelMessage))},timeout=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve()},ms);signal.addEventListener("abort",onAbort,{once:!0})})}async function pollOAuthDeviceCodeFlow(options){let deadline=typeof options.expiresInSeconds=="number"?Date.now()+options.expiresInSeconds*1e3:Number.
|
|
53
54
|
POSITIVE_INFINITY,intervalMs=Math.max(1e3,Math.floor((options.intervalSeconds??5)*1e3)),slowDownResponses=0;if(options.waitBeforeFirstPoll){let remainingMs=deadline-Date.now();remainingMs>0&&await abortableSleep(Math.min(intervalMs,remainingMs),options.signal,CANCEL_MESSAGE)}for(;Date.now()<deadline;){if(options.signal.aborted)throw new Error(CANCEL_MESSAGE);let result=await options.poll();if(result.status==="complete")return result.value;if(result.status==="failed")throw new Error(result.message);
|
|
54
55
|
result.status==="slow_down"&&(slowDownResponses+=1,intervalMs=typeof result.intervalSeconds=="number"&&Number.isFinite(result.intervalSeconds)&&result.intervalSeconds>0?Math.max(1e3,Math.floor(result.intervalSeconds*1e3)):Math.max(1e3,intervalMs+5e3));let remainingMs=deadline-Date.now();if(remainingMs<=0)break;await abortableSleep(Math.min(intervalMs,remainingMs),options.signal,CANCEL_MESSAGE)}throw new Error(slowDownResponses>0?SLOW_DOWN_TIMEOUT_MESSAGE:TIMEOUT_MESSAGE)}var decode=s=>atob(s),CLIENT_ID=decode("SXYxLmI1MDdhMDhjODdlY2ZlOTg="),COPILOT_HEADERS={"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},COPILOT_API_VERSION="2026-06-01";function normalizeDomain(input){let trimmed=input.trim();if(!trimmed)return null;try{return(trimmed.includes("://")?new URL(trimmed):new URL(`https://${trimmed}`)).hostname}catch{return null}}function getUrls(domain){return{
|
|
55
56
|
deviceCodeUrl:`https://${domain}/login/device/code`,accessTokenUrl:`https://${domain}/login/oauth/access_token`,copilotTokenUrl:`https://api.${domain}/copilot_internal/v2/token`}}function getBaseUrlFromToken(token){let match=token.match(/proxy-ep=([^;]+)/);return match?`https://${match[1].replace(/^proxy\./,"api.")}`:null}function getGitHubCopilotBaseUrl(token,enterpriseDomain){if(token){let urlFromToken=getBaseUrlFromToken(token);if(urlFromToken)return urlFromToken}return enterpriseDomain?`http\
|
package/dist/bundle/chunks/{google-generative-ai-H2F5Y5H2.js → google-generative-ai-JD2FVOIX.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{GoogleGenAI,convertMessages,convertTools,getDisabledGoogleThinkingConfig,isThinkingPart,mapStopReason,resolveGoogleFunctionCallingMode,resolveGoogleThinkingLevel,retainThoughtSignature,retryGoogleRequest,supportsGoogleStrictToolSampling,toGoogleSdkThinkingLevel,toGoogleThinkingLevel,usesGoogleThinkingLevel}from"./chunk-
|
|
2
|
+
import{GoogleGenAI,convertMessages,convertTools,getDisabledGoogleThinkingConfig,isThinkingPart,mapStopReason,resolveGoogleFunctionCallingMode,resolveGoogleThinkingLevel,retainThoughtSignature,retryGoogleRequest,supportsGoogleStrictToolSampling,toGoogleSdkThinkingLevel,toGoogleThinkingLevel,usesGoogleThinkingLevel}from"./chunk-AS2Y2MO6.js";import"./chunk-Z33NNMNB.js";import{formatProviderError,normalizeProviderError}from"./chunk-MVYV6MJY.js";import{buildBaseOptions,getPiUserAgent}from"./chunk-5XD3DHYL.js";
|
|
3
3
|
import{hasIncompleteUsage}from"./chunk-YTVFIA3A.js";import{sanitizeSurrogates}from"./chunk-L2ZPNLYD.js";import{createRequestObserver,observeFetch,providerHeadersToRecord}from"./chunk-5CDES42D.js";import{calculateCost,clampThinkingLevel,collapseSystemMessages,getCurrentTools,getInitialSystemMessage,getSystemMessageText}from"./chunk-DZ5C66IU.js";import{AssistantMessageEventStream}from"./chunk-RYC5BYVE.js";import"./chunk-VEYTRNQC.js";import"./chunk-JXWJOIH4.js";var toolCallCounter=0,stream=(model,context,options)=>{let stream2=new AssistantMessageEventStream,normalizedContext=collapseSystemMessages(context);return(async()=>{let output={role:"assistant",content:[],api:"google-generative-ai",provider:model.provider,model:model.id,usage:{usageIncomplete:!0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(options?.fetch&&options.fetch!==globalThis.
|
|
4
4
|
fetch)throw new Error("Custom fetch is not supported by the Google Generative AI adapter");let apiKey=options?.apiKey;if(!apiKey)throw new Error(`No API key for provider: ${model.provider}`);let observe=createRequestObserver(options,{api:model.api,provider:model.provider,model:model.id,operation:"chat"}),client=createClient(model,apiKey,options?.headers,observeFetch(void 0,observe)),params=buildParams(model,normalizedContext,options),nextParams=await options?.onPayload?.(params,model);nextParams!==
|
|
5
5
|
void 0&&(params=nextParams);let googleStream=await retryGoogleRequest(()=>client.models.generateContentStream(params),options);stream2.push({type:"start",partial:output});let currentBlock=null,blocks=output.content,blockIndex=()=>blocks.length-1;for await(let chunk of googleStream){await options?.onProviderStreamEvent?.(chunk,model),output.responseId||=chunk.responseId;let candidate=chunk.candidates?.[0];if(candidate?.content?.parts)for(let part of candidate.content.parts){if(part.text!==void 0){
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{GoogleGenAI,ResourceScope,convertMessages,convertTools,getDisabledGoogleThinkingConfig,isThinkingPart,mapStopReason,resolveGoogleFunctionCallingMode,resolveGoogleThinkingLevel,retainThoughtSignature,retryGoogleRequest,supportsGoogleStrictToolSampling,toGoogleSdkThinkingLevel,toGoogleThinkingLevel,usesGoogleThinkingLevel}from"./chunk-
|
|
2
|
+
import{GoogleGenAI,ResourceScope,convertMessages,convertTools,getDisabledGoogleThinkingConfig,isThinkingPart,mapStopReason,resolveGoogleFunctionCallingMode,resolveGoogleThinkingLevel,retainThoughtSignature,retryGoogleRequest,supportsGoogleStrictToolSampling,toGoogleSdkThinkingLevel,toGoogleThinkingLevel,usesGoogleThinkingLevel}from"./chunk-AS2Y2MO6.js";import"./chunk-Z33NNMNB.js";import{formatProviderError,normalizeProviderError}from"./chunk-MVYV6MJY.js";import{buildBaseOptions,
|
|
3
3
|
getPiUserAgent}from"./chunk-5XD3DHYL.js";import{hasIncompleteUsage}from"./chunk-YTVFIA3A.js";import{sanitizeSurrogates}from"./chunk-L2ZPNLYD.js";import{createRequestObserver,observeFetch,providerHeadersToRecord}from"./chunk-5CDES42D.js";import{getProviderEnvValue}from"./chunk-FACBDLFU.js";import{calculateCost,clampThinkingLevel,collapseSystemMessages,getCurrentTools,getInitialSystemMessage,getSystemMessageText}from"./chunk-DZ5C66IU.js";import{AssistantMessageEventStream}from"./chunk-RYC5BYVE.js";
|
|
4
4
|
import"./chunk-VEYTRNQC.js";import"./chunk-JXWJOIH4.js";var API_VERSION="v1",GCP_VERTEX_CREDENTIALS_MARKER="gcp-vertex-credentials",toolCallCounter=0,stream=(model,context,options)=>{let stream2=new AssistantMessageEventStream,normalizedContext=collapseSystemMessages(context);return(async()=>{let output={role:"assistant",content:[],api:"google-vertex",provider:model.provider,model:model.id,usage:{usageIncomplete:!0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.
|
|
5
5
|
now()};try{if(options?.fetch&&options.fetch!==globalThis.fetch)throw new Error("Custom fetch is not supported by the Google Vertex adapter");let apiKey=resolveApiKey(options),observe=createRequestObserver(options,{api:model.api,provider:model.provider,model:model.id,operation:"chat"}),observedFetch=observeFetch(void 0,observe),client=apiKey?createClientWithApiKey(model,apiKey,options?.headers,observedFetch):createClient(model,resolveProject(options),resolveLocation(options),options?.headers,options?.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{buildSessionContext,resizeImage}from"./chunk-
|
|
2
|
+
import{buildSessionContext,resizeImage}from"./chunk-V5ZF7Q7L.js";import{getAgentDir}from"./chunk-YJBE3IGR.js";import"./chunk-YKZGL4MB.js";import"./chunk-DBL35X7L.js";import"./chunk-GVVRXZHN.js";import"./chunk-DZ5C66IU.js";import"./chunk-RYC5BYVE.js";import"./chunk-VEYTRNQC.js";import"./chunk-QMUIATLD.js";import"./chunk-BHM75BJJ.js";import"./chunk-JXWJOIH4.js";export{buildSessionContext,getAgentDir,resizeImage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{require_turndown_cjs}from"./chunk-YFBDR4IW.js";import{dist_exports,init_dist,require_canvas,require_lib}from"./chunk-
|
|
2
|
+
import{require_turndown_cjs}from"./chunk-YFBDR4IW.js";import{dist_exports,init_dist,require_canvas,require_lib}from"./chunk-FF26YENK.js";import{__commonJS,__toCommonJS}from"./chunk-JXWJOIH4.js";var require_utils=__commonJS({"node_modules/defuddle/dist/utils.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.CJK_CHAR_RANGES=void 0;exports.isElement=isElement;exports.isTextNode=isTextNode;exports.isCommentNode=isCommentNode;exports.isSVGElement=isSVGElement;exports.getComputedStyle=getComputedStyle;exports.getWindow=getWindow;exports.textPreview=textPreview;exports.logDebug=logDebug;exports.normalizeText=normalizeText;exports.countWords=countWords;var NODE_TYPE={
|
|
3
3
|
ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};function isElement(node){return node.nodeType===NODE_TYPE.ELEMENT_NODE}function isTextNode(node){return node.nodeType===NODE_TYPE.TEXT_NODE}function isCommentNode(node){return node.nodeType===NODE_TYPE.COMMENT_NODE}function isSVGElement(el){return el.closest?.("svg")!==
|
|
4
4
|
null||el.namespaceURI==="http://www.w3.org/2000/svg"}function getComputedStyle(element){let win=getWindow(element.ownerDocument);return!win||typeof win.getComputedStyle!="function"?null:win.getComputedStyle(element)}function getWindow(doc){return doc.defaultView?doc.defaultView:doc.ownerWindow?doc.ownerWindow:doc.window?doc.window:null}function textPreview(el){return(el.textContent||"").trim().substring(0,200)}function logDebug(debug,message,...args){debug&&console.log("Defuddle:",message,...args)}
|
|
5
5
|
exports.CJK_CHAR_RANGES="\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4dbf\\u4e00-\\u9fff\\uf900-\\ufaff\\uac00-\\ud7af";function normalizeText(text){return text.replace(/\u00A0/g," ").replace(/[\u2018\u2019\u201A\u201B]/g,"'").replace(/[\u2012\u2013\u2014\u2015]/g,"-").replace(/[\u201C\u201D\u201E\u201F]/g,'"').replace(/\u2026/g,"...").replace(/\s+/g," ").trim().toLowerCase()}function countWords(text){if(!text)return 0;let cjkCount=0,wordCount=0,inWord=!1;for(let i=0;i<text.length;i++){let code=text.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{McpOAuthCredentialStore,McpServerConnection,McpServerLog,McpSignInCancelledError,createDefaultTransport,signInMcpServer}from"./chunk-
|
|
2
|
+
import{McpOAuthCredentialStore,McpServerConnection,McpServerLog,McpSignInCancelledError,createDefaultTransport,signInMcpServer}from"./chunk-XGO43DKL.js";import"./chunk-HSDTSUZE.js";import"./chunk-XMHLSV3I.js";import"./chunk-VYIIPF57.js";import"./chunk-SCIGZFN5.js";import"./chunk-YJBE3IGR.js";import"./chunk-JXWJOIH4.js";export{McpOAuthCredentialStore,McpServerConnection,McpServerLog,McpSignInCancelledError,createDefaultTransport,signInMcpServer};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
import{dist_exports as dist_exports3}from"./chunk-76X5KOIA.js";import{dist_exports as dist_exports2}from"./chunk-2QTTNAD4.js";import"./chunk-HMWAH7ZY.js";import"./chunk-I2ZWZAIV.js";import"./chunk-LCOHFEZZ.js";import"./chunk-77EWF2NW.js";import"./chunk-V5ZF7Q7L.js";import{all_exports,compat_exports}from"./chunk-BCF7KZ3R.js";import"./chunk-QSPDLT2R.js";import"./chunk-HSDTSUZE.js";import"./chunk-XMHLSV3I.js";import{dist_exports}from"./chunk-VYIIPF57.js";
|
|
3
|
+
import"./chunk-SCIGZFN5.js";import"./chunk-WBJN6PEI.js";import"./chunk-R5VIAWGA.js";import"./chunk-KQM7ZGL6.js";import"./chunk-CIA6V3BP.js";import"./chunk-XQZG5HPT.js";import"./chunk-FACBDLFU.js";import"./chunk-AUFEF24K.js";import"./chunk-YJBE3IGR.js";import"./chunk-BRXQUQSC.js";import"./chunk-YKZGL4MB.js";import"./chunk-DBL35X7L.js";import"./chunk-GVVRXZHN.js";import"./chunk-DZ5C66IU.js";import"./chunk-RYC5BYVE.js";
|
|
4
|
+
import"./chunk-VEYTRNQC.js";import{compile_exports,value_exports2 as value_exports}from"./chunk-QMUIATLD.js";import{build_exports}from"./chunk-BHM75BJJ.js";import"./chunk-JXWJOIH4.js";var oauth_exports={};var VIRTUAL_MODULES={typebox:build_exports,"typebox/compile":compile_exports,"typebox/value":value_exports,"@sinclair/typebox":build_exports,"@sinclair/typebox/compile":compile_exports,"@sinclair/typebox/value":value_exports,"@earendil-works/pi-agent-core":dist_exports2,"@earendil-works/pi-tui":dist_exports,"@earendil-works/pi-ai":compat_exports,"@earendil-works/pi-ai/compat":compat_exports,"@earendil-works/pi-ai/oauth":oauth_exports,"@earendil-works/pi-ai/providers/all":all_exports,"@earendil-w\
|
|
5
|
+
orks/pi-coding-agent":dist_exports3,"@mariozechner/pi-agent-core":dist_exports2,"@mariozechner/pi-tui":dist_exports,"@mariozechner/pi-ai":compat_exports,"@mariozechner/pi-ai/compat":compat_exports,"@mariozechner/pi-ai/oauth":oauth_exports,"@mariozechner/pi-ai/providers/all":all_exports,"@mariozechner/pi-coding-agent":dist_exports3};export{VIRTUAL_MODULES};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
3
|
-
import{configureHttpDispatcher,main,warnIfDeprecatedCommand}from"./chunks/chunk-
|
|
4
|
-
import"./chunks/chunk-
|
|
5
|
-
import"./chunks/chunk-JXWJOIH4.js";function setupCli(){process.title=APP_COMMAND,process.env.PI_CODING_AGENT="true",process.env[`${ENV_PREFIX}_CODING_AGENT`]="true",process.env.AI_AGENT="pi",process.emitWarning=(()=>{}),configureHttpDispatcher()}setupCli();warnIfDeprecatedCommand(process.argv.slice(2));main(process.argv.slice(2));
|
|
3
|
+
import{configureHttpDispatcher,main,warnIfDeprecatedCommand}from"./chunks/chunk-2QTTNAD4.js";import"./chunks/chunk-HMWAH7ZY.js";import"./chunks/chunk-I2ZWZAIV.js";import"./chunks/chunk-LCOHFEZZ.js";import"./chunks/chunk-77EWF2NW.js";import"./chunks/chunk-V5ZF7Q7L.js";import"./chunks/chunk-BCF7KZ3R.js";import"./chunks/chunk-QSPDLT2R.js";import"./chunks/chunk-HSDTSUZE.js";import"./chunks/chunk-XMHLSV3I.js";import"./chunks/chunk-VYIIPF57.js";import"./chunks/chunk-SCIGZFN5.js";import"./chunks/chunk-WBJN6PEI.js";
|
|
4
|
+
import"./chunks/chunk-R5VIAWGA.js";import"./chunks/chunk-KQM7ZGL6.js";import"./chunks/chunk-CIA6V3BP.js";import"./chunks/chunk-XQZG5HPT.js";import"./chunks/chunk-FACBDLFU.js";import"./chunks/chunk-AUFEF24K.js";import{APP_COMMAND,ENV_PREFIX}from"./chunks/chunk-YJBE3IGR.js";import"./chunks/chunk-BRXQUQSC.js";import"./chunks/chunk-YKZGL4MB.js";import"./chunks/chunk-DBL35X7L.js";import"./chunks/chunk-GVVRXZHN.js";import"./chunks/chunk-DZ5C66IU.js";import"./chunks/chunk-RYC5BYVE.js";import"./chunks/chunk-VEYTRNQC.js";
|
|
5
|
+
import"./chunks/chunk-QMUIATLD.js";import"./chunks/chunk-BHM75BJJ.js";import"./chunks/chunk-JXWJOIH4.js";function setupCli(){process.title=APP_COMMAND,process.env.PI_CODING_AGENT="true",process.env[`${ENV_PREFIX}_CODING_AGENT`]="true",process.env.AI_AGENT="pi",process.emitWarning=(()=>{}),configureHttpDispatcher()}setupCli();warnIfDeprecatedCommand(process.argv.slice(2));main(process.argv.slice(2));
|
package/dist/bundle/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{ShowImagesSelectorComponent,ThemeSelectorComponent}from"./chunks/chunk-
|
|
3
|
-
ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthAccountPool,OAuthSelectorComponent,RpcClient,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,SkillInvocationMessageComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,
|
|
4
|
-
compact,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,
|
|
5
|
-
createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSubagentTool,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAgents,discoverAndLoadExtensions,estimateTokens,executeHumainAgentRequest,findCutPoint,
|
|
6
|
-
getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,parseArgs,
|
|
7
|
-
serializeConversation,shouldCompact,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-
|
|
8
|
-
|
|
9
|
-
getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunks/chunk-
|
|
10
|
-
|
|
11
|
-
import"./chunks/chunk-RYC5BYVE.js";import"./chunks/chunk-VEYTRNQC.js";import"./chunks/chunk-QMUIATLD.js";import"./chunks/chunk-BHM75BJJ.js";import"./chunks/chunk-JXWJOIH4.js";export{ACCOUNT_RETURN_COOLDOWN_MS,ACCOUNT_RETURN_MAX_COOLDOWN_MS,AgentExecInputError,AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,
|
|
12
|
-
ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FooterComponent,HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,InteractiveMode,LoginDialogComponent,
|
|
13
|
-
OAuthSelectorComponent,ProjectTrustStore,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UPSTREAM_PI_VERSION,UserMessageComponent,UserMessageSelectorComponent,VERSION,VIRTUAL_MODEL_STATE_ENTRY,buildContextEntries,
|
|
14
|
-
compact,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,
|
|
15
|
-
createPiAgentExecutionHost,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSubagentTool,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAgents,discoverAndLoadExtensions,estimateTokens,executeHumainAgentRequest,findCutPoint,
|
|
16
|
-
generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,
|
|
17
|
-
isReadToolResult,isToolCallEventType,isWriteToolResult,keyHint,keyText,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFrontmatter,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse,parseSessionEntries,parseSkillBlock,prepareBranchEntries,prepareChildLaunch,
|
|
18
|
-
sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
|
|
2
|
+
import{ShowImagesSelectorComponent,ThemeSelectorComponent}from"./chunks/chunk-76X5KOIA.js";import{ACCOUNT_RETURN_COOLDOWN_MS,ACCOUNT_RETURN_MAX_COOLDOWN_MS,AgentExecInputError,AgentSession,AgentSessionRuntime,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,
|
|
3
|
+
ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FLOW_ACCOUNT_PERSISTENCE_NOTICE,FLOW_SETUP_TERMINAL_ONLY,FLOW_SUBCOMMANDS,FooterComponent,InteractiveMode,LoginDialogComponent,ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthAccountPool,OAuthSelectorComponent,RpcClient,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,SkillInvocationMessageComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent,
|
|
4
|
+
VIRTUAL_MODEL_STATE_ENTRY,assessNodeFallback,calculateContextTokens,collectEntriesForBranchSummary,compact,completeFlowArguments,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,
|
|
5
|
+
createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPiAgentExecutionHost,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSubagentTool,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAgents,discoverAndLoadExtensions,estimateTokens,executeHumainAgentRequest,findCutPoint,
|
|
6
|
+
findTurnStartIndex,flowBuildUnavailable,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getFlowAccountsHost,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,getLastAssistantUsage,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,parseArgs,parseFlowCommand,
|
|
7
|
+
parseFrontmatter,parseSkillBlock,prepareBranchEntries,prepareChildLaunch,renderDiff,renderFlowHelp,renderTaskWithContext,resolveCliModel,resolveModelScopeWithDiagnostics,runAgentExecMode,runPrintMode,runRpcMode,serializeConversation,shouldCompact,stripFrontmatter,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools}from"./chunks/chunk-2QTTNAD4.js";import"./chunks/chunk-HMWAH7ZY.js";import"./chunks/chunk-I2ZWZAIV.js";import{ArminComponent}from"./chunks/chunk-LCOHFEZZ.js";import{ProjectTrustStore,
|
|
8
|
+
hasTrustRequiringProjectResources}from"./chunks/chunk-77EWF2NW.js";import{CURRENT_SESSION_VERSION,SessionManager,buildContextEntries,buildSessionContext,buildSessionProjection,convertToLlm,formatDimensionNote,getLatestCompactionEntry,migrateSessionEntries,parseSessionEntries,resizeImage,sessionEntryToContextMessages}from"./chunks/chunk-V5ZF7Q7L.js";import"./chunks/chunk-BCF7KZ3R.js";import"./chunks/chunk-QSPDLT2R.js";import{readStoredCredential}from"./chunks/chunk-HSDTSUZE.js";import{DEFAULT_MAX_BYTES,
|
|
9
|
+
DEFAULT_MAX_LINES,formatSize,getPowerShellConfig,getShellConfig,truncateHead,truncateLine,truncateTail,truncateToVisualLines}from"./chunks/chunk-XMHLSV3I.js";import{Theme,getLanguageFromPath,getMarkdownTheme,getSelectListTheme,getSettingsListTheme,highlightCode,initTheme,keyHint,keyText,rawKeyHint}from"./chunks/chunk-VYIIPF57.js";import"./chunks/chunk-SCIGZFN5.js";import"./chunks/chunk-WBJN6PEI.js";import"./chunks/chunk-R5VIAWGA.js";import"./chunks/chunk-KQM7ZGL6.js";import"./chunks/chunk-CIA6V3BP.js";
|
|
10
|
+
import"./chunks/chunk-XQZG5HPT.js";import"./chunks/chunk-FACBDLFU.js";import{HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse}from"./chunks/chunk-AUFEF24K.js";import{
|
|
11
|
+
CONFIG_DIR_NAME,UPSTREAM_PI_VERSION,VERSION,getAgentDir,getDocsPath,getExamplesPath,getPackageDir,getReadmePath}from"./chunks/chunk-YJBE3IGR.js";import"./chunks/chunk-BRXQUQSC.js";import"./chunks/chunk-YKZGL4MB.js";import"./chunks/chunk-DBL35X7L.js";import"./chunks/chunk-GVVRXZHN.js";import"./chunks/chunk-DZ5C66IU.js";import"./chunks/chunk-RYC5BYVE.js";import"./chunks/chunk-VEYTRNQC.js";import"./chunks/chunk-QMUIATLD.js";import"./chunks/chunk-BHM75BJJ.js";import"./chunks/chunk-JXWJOIH4.js";export{ACCOUNT_RETURN_COOLDOWN_MS,ACCOUNT_RETURN_MAX_COOLDOWN_MS,AgentExecInputError,AgentSession,AgentSessionRuntime,ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CONFIG_DIR_NAME,CURRENT_SESSION_VERSION,CompactionSummaryMessageComponent,CredentialSynchronizationError,CustomEditor,CustomMessageComponent,DEFAULT_COMPACTION_SETTINGS,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,DefaultPackageManager,DefaultResourceLoader,DynamicBorder,ExtensionEditorComponent,
|
|
12
|
+
ExtensionInputComponent,ExtensionRunner,ExtensionSelectorComponent,FLOW_ACCOUNT_PERSISTENCE_NOTICE,FLOW_SETUP_TERMINAL_ONLY,FLOW_SUBCOMMANDS,FooterComponent,HUMAIN_AGENT_EXECUTION_FAILURE_CODES,HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION,HumainAgentArtifactSchema,HumainAgentExecutionClaimSchema,HumainAgentExecutionControlsSchema,HumainAgentExecutionOutcomeSchema,HumainAgentExecutionRequestSchema,HumainAgentExecutionResponseSchema,HumainAgentRouteRefSchema,HumainAgentUsageSchema,InteractiveMode,LoginDialogComponent,
|
|
13
|
+
ModelRegistry,ModelRuntime,ModelSelectorComponent,OAuthAccountPool,OAuthSelectorComponent,ProjectTrustStore,RpcClient,SessionManager,SessionSelectorComponent,SettingsManager,SettingsSelectorComponent,ShowImagesSelectorComponent,SkillInvocationMessageComponent,Theme,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UPSTREAM_PI_VERSION,UserMessageComponent,UserMessageSelectorComponent,VERSION,VIRTUAL_MODEL_STATE_ENTRY,assessNodeFallback,buildContextEntries,
|
|
14
|
+
buildSessionContext,buildSessionProjection,calculateContextTokens,collectEntriesForBranchSummary,compact,completeFlowArguments,convertToLlm,convertToPng,copyToClipboard,createAgentSession,createAgentSessionFromServices,createAgentSessionRuntime,createAgentSessionServices,createBashTool,createBashToolDefinition,createCodemodeExtension,createCodingTools,createEditTool,createEditToolDefinition,createEventBus,createExtensionRuntime,createFindTool,createFindToolDefinition,createGrepTool,createGrepToolDefinition,
|
|
15
|
+
createLocalBashOperations,createLocalPowerShellOperations,createLsTool,createLsToolDefinition,createMcpExtension,createPiAgentExecutionHost,createPowerShellTool,createPowerShellToolDefinition,createReadOnlyTools,createReadTool,createReadToolDefinition,createSubagentTool,createSyntheticSourceInfo,createToolSearchExtension,createWriteTool,createWriteToolDefinition,defineTool,detectSupportedImageMimeTypeFromFile,discoverAgents,discoverAndLoadExtensions,estimateTokens,executeHumainAgentRequest,findCutPoint,
|
|
16
|
+
findTurnStartIndex,flowBuildUnavailable,formatDimensionNote,formatSize,formatSkillsForPrompt,generateBranchSummary,generateDiffString,generateSummary,generateSummaryWithUsage,generateUnifiedPatch,getAgentDir,getDocsPath,getExamplesPath,getFlowAccountsHost,getFlowChildLaunchHost,getFlowControlHost,getFlowTraceProducer,getLanguageFromPath,getLastAssistantUsage,getLatestCompactionEntry,getMarkdownTheme,getPackageDir,getPowerShellConfig,getReadmePath,getSelectListTheme,getSettingsListTheme,getShellConfig,
|
|
17
|
+
hasTrustRequiringProjectResources,highlightCode,initTheme,isBashToolResult,isEditToolResult,isFindToolResult,isGrepToolResult,isLsToolResult,isPowerShellToolResult,isReadToolResult,isToolCallEventType,isWriteToolResult,keyHint,keyText,loadProjectContextFiles,loadSkills,loadSkillsFromDir,main,migrateSessionEntries,parseArgs,parseFlowCommand,parseFrontmatter,parseHumainAgentExecutionRequest,parseHumainAgentExecutionResponse,parseSessionEntries,parseSkillBlock,prepareBranchEntries,prepareChildLaunch,
|
|
18
|
+
rawKeyHint,readStoredCredential,renderDiff,renderFlowHelp,renderTaskWithContext,resizeImage,resolveCliModel,resolveModelScopeWithDiagnostics,runAgentExecMode,runPrintMode,runRpcMode,serializeConversation,sessionEntryToContextMessages,shouldCompact,stripFrontmatter,truncateHead,truncateLine,truncateTail,truncateToVisualLines,withFileMutationQueue,wrapRegisteredTool,wrapRegisteredTools};
|
package/dist/bundle/rpc-entry.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
3
|
-
import{configureHttpDispatcher,main}from"./chunks/chunk-
|
|
4
|
-
import"./chunks/chunk-XQZG5HPT.js";import"./chunks/chunk-FACBDLFU.js";import"./chunks/chunk-
|
|
3
|
+
import{configureHttpDispatcher,main}from"./chunks/chunk-2QTTNAD4.js";import"./chunks/chunk-HMWAH7ZY.js";import"./chunks/chunk-I2ZWZAIV.js";import"./chunks/chunk-LCOHFEZZ.js";import"./chunks/chunk-77EWF2NW.js";import"./chunks/chunk-V5ZF7Q7L.js";import"./chunks/chunk-BCF7KZ3R.js";import"./chunks/chunk-QSPDLT2R.js";import"./chunks/chunk-HSDTSUZE.js";import"./chunks/chunk-XMHLSV3I.js";import"./chunks/chunk-VYIIPF57.js";import"./chunks/chunk-SCIGZFN5.js";import"./chunks/chunk-WBJN6PEI.js";import"./chunks/chunk-R5VIAWGA.js";
|
|
4
|
+
import"./chunks/chunk-KQM7ZGL6.js";import"./chunks/chunk-CIA6V3BP.js";import"./chunks/chunk-XQZG5HPT.js";import"./chunks/chunk-FACBDLFU.js";import"./chunks/chunk-AUFEF24K.js";import{APP_COMMAND}from"./chunks/chunk-YJBE3IGR.js";import"./chunks/chunk-BRXQUQSC.js";import"./chunks/chunk-YKZGL4MB.js";import"./chunks/chunk-DBL35X7L.js";import"./chunks/chunk-GVVRXZHN.js";import"./chunks/chunk-DZ5C66IU.js";import"./chunks/chunk-RYC5BYVE.js";import"./chunks/chunk-VEYTRNQC.js";import"./chunks/chunk-QMUIATLD.js";import"./chunks/chunk-BHM75BJJ.js";
|
|
5
|
+
import"./chunks/chunk-JXWJOIH4.js";process.title=`${APP_COMMAND}-rpc`;process.env.PI_CODING_AGENT="true";process.env.AI_AGENT="pi";process.emitWarning=(()=>{});configureHttpDispatcher();main(["--mode","rpc",...process.argv.slice(2)]);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { OAuthAccount } from "./oauth-account-pool.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Host-owned, consent-bound account reporting. Nothing here runs unless the host calls `refreshAccountUsage` after an
|
|
4
|
+
* explicit "Refresh usage" action. Listing accounts or opening Advanced never reaches this module.
|
|
5
|
+
*
|
|
6
|
+
* Reports never fabricate zero: unavailable, empty, partial and stale states keep their own labels, and every report
|
|
7
|
+
* names its scope (source), target (account/source, region, UTC period) and last update time.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ACCOUNT_REPORT_DEADLINE_MS = 30000;
|
|
10
|
+
export declare const ACCOUNT_REPORT_REQUEST_TIMEOUT_MS = 10000;
|
|
11
|
+
export declare const ACCOUNT_REPORT_CACHE_TTL_MS = 60000;
|
|
12
|
+
export interface AccountReportPeriod {
|
|
13
|
+
/** UTC, RFC 3339 with a `Z` suffix. */
|
|
14
|
+
start: string;
|
|
15
|
+
/** UTC, RFC 3339 with a `Z` suffix. Exclusive. */
|
|
16
|
+
end: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AccountReportTarget {
|
|
19
|
+
providerId: string;
|
|
20
|
+
/** Opaque account identity. Never a credential. Empty only when `source` names a non-account reporting source. */
|
|
21
|
+
accountKey: string;
|
|
22
|
+
/** Explicit reporting source that is not an account (for example organization-wide reporting). */
|
|
23
|
+
source?: string;
|
|
24
|
+
/** Region for providers whose figures are regional (for example Bedrock). */
|
|
25
|
+
region?: string;
|
|
26
|
+
period: AccountReportPeriod;
|
|
27
|
+
}
|
|
28
|
+
export type AccountReportStatus = "ok" | "partial" | "empty" | "unavailable";
|
|
29
|
+
/** What a report measures. Distinct scopes are never merged or linked to each other. */
|
|
30
|
+
export type AccountReportScope = "openai-codex-oauth-usage" | "anthropic-api-rate-limits" | "anthropic-organization-usage" | "bedrock-cloudwatch" | "unsupported";
|
|
31
|
+
export interface AccountUsageMetric {
|
|
32
|
+
name: string;
|
|
33
|
+
value: number;
|
|
34
|
+
unit: string;
|
|
35
|
+
/** UTC RFC 3339 time when the window this metric belongs to resets, when the source reports one. */
|
|
36
|
+
resetsAt?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AccountUsageReport {
|
|
39
|
+
status: AccountReportStatus;
|
|
40
|
+
target: AccountReportTarget;
|
|
41
|
+
scope: AccountReportScope;
|
|
42
|
+
/** Epoch ms of the observation: when the source answered, or when the observed response arrived. */
|
|
43
|
+
updatedAt?: number;
|
|
44
|
+
/** Present metrics only. Missing data is never listed as zero. */
|
|
45
|
+
metrics: AccountUsageMetric[];
|
|
46
|
+
/** Safe, fixed text. Never raw provider or transport errors. */
|
|
47
|
+
reason?: string;
|
|
48
|
+
/** Specific next action for the user, when one exists. */
|
|
49
|
+
nextAction?: string;
|
|
50
|
+
/** True when the observation is older than the cache window or a later refresh failed. */
|
|
51
|
+
stale?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface AccountReportCollector {
|
|
54
|
+
/** Scope this collector reports for the target, used to label unavailable states too. */
|
|
55
|
+
scopeFor(target: AccountReportTarget): AccountReportScope;
|
|
56
|
+
/** Collect one report. Must honour the signal and return only safe reasons. */
|
|
57
|
+
collect(target: AccountReportTarget, signal: AbortSignal): Promise<AccountUsageReport>;
|
|
58
|
+
/** Return false for targets whose `collect` only reads local state, so every refresh sees the newest observation. */
|
|
59
|
+
cachesTarget?(target: AccountReportTarget): boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare function unavailableReport(target: AccountReportTarget, scope: AccountReportScope, reason: string, nextAction?: string): AccountUsageReport;
|
|
62
|
+
export interface AccountReporterOptions {
|
|
63
|
+
/** Collectors by provider ID. Providers without one report "unsupported". */
|
|
64
|
+
collectors: Readonly<Record<string, AccountReportCollector>>;
|
|
65
|
+
/** Injected clock (epoch ms). Defaults to Date.now. */
|
|
66
|
+
now?: () => number;
|
|
67
|
+
deadlineMs?: number;
|
|
68
|
+
cacheTtlMs?: number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Session-bound reporter. Late results of a superseded or cancelled refresh are discarded and never cached; caches are
|
|
72
|
+
* isolated by provider, account/source, region and period.
|
|
73
|
+
*/
|
|
74
|
+
export declare class AccountReporter {
|
|
75
|
+
private readonly collectors;
|
|
76
|
+
private readonly now;
|
|
77
|
+
private readonly deadlineMs;
|
|
78
|
+
private readonly ttlMs;
|
|
79
|
+
private readonly cache;
|
|
80
|
+
/** One in-flight refresh per provider and scope (and explicit source): a different target there supersedes it. */
|
|
81
|
+
private readonly inFlight;
|
|
82
|
+
constructor(options: AccountReporterOptions);
|
|
83
|
+
/** Cancel every in-flight refresh (session, account or dialog change). Their results are discarded. */
|
|
84
|
+
cancelAll(): void;
|
|
85
|
+
refreshAccountUsage(target: AccountReportTarget, signal: AbortSignal): Promise<AccountUsageReport>;
|
|
86
|
+
private start;
|
|
87
|
+
/**
|
|
88
|
+
* Each caller cancels independently: the shared collection is aborted only once every attached caller has aborted.
|
|
89
|
+
* An aborted caller gets its own cancelled report while others still receive the shared result.
|
|
90
|
+
*/
|
|
91
|
+
private attach;
|
|
92
|
+
private settle;
|
|
93
|
+
/** Mark observations older than the cache window stale; never alters the metrics or times. */
|
|
94
|
+
private label;
|
|
95
|
+
}
|
|
96
|
+
/** Render a report for Advanced. Always names source/scope, account, period, region and update time. */
|
|
97
|
+
export declare function formatAccountUsageReport(report: AccountUsageReport, now: number): string[];
|
|
98
|
+
export interface CodexUsageCollectorDeps {
|
|
99
|
+
/** Stored Codex account for a pool key. No OAuth refresh happens here: expired sign-ins are reported as expired. */
|
|
100
|
+
readAccount(accountKey: string, signal: AbortSignal): Promise<OAuthAccount | undefined>;
|
|
101
|
+
fetch?: typeof fetch;
|
|
102
|
+
now?: () => number;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Reuses the existing Codex weekly usage fetcher for one `openai-codex` OAuth account. `openai` API-key accounts are a
|
|
106
|
+
* different provider and have no collector here: their usage is never inferred from Codex sign-ins.
|
|
107
|
+
*/
|
|
108
|
+
export declare function createCodexUsageCollector(deps: CodexUsageCollectorDeps): AccountReportCollector;
|
|
109
|
+
//# sourceMappingURL=account-reporting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-reporting.d.ts","sourceRoot":"","sources":["../../src/core/account-reporting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;;;GAMG;AAEH,eAAO,MAAM,0BAA0B,QAAS,CAAC;AACjD,eAAO,MAAM,iCAAiC,QAAS,CAAC;AACxD,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAQlD,MAAM,WAAW,mBAAmB;IACnC,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kHAAkH;IAClH,UAAU,EAAE,MAAM,CAAC;IACnB,kGAAkG;IAClG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,mBAAmB,CAAC;CAC5B;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAE7E,wFAAwF;AACxF,MAAM,MAAM,kBAAkB,GAC3B,0BAA0B,GAC1B,2BAA2B,GAC3B,8BAA8B,GAC9B,oBAAoB,GACpB,aAAa,CAAC;AAEjB,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,oGAAoG;IACpG,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,oGAAoG;IACpG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACtC,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;IAC1D,+EAA+E;IAC/E,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvF,qHAAqH;IACrH,YAAY,CAAC,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC;CACpD;AAED,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,GACjB,kBAAkB,CAEpB;AAqED,MAAM,WAAW,sBAAsB;IACtC,6EAA6E;IAC7E,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAC7D,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmD;IAC9E,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,kHAAkH;IAClH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IAExD,YAAY,OAAO,EAAE,sBAAsB,EAK1C;IAED,uGAAuG;IACvG,SAAS,IAAI,IAAI,CAGhB;IAED,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4BjG;IAED,OAAO,CAAC,KAAK;IAsCb;;;OAGG;IACH,OAAO,CAAC,MAAM;IA8Bd,OAAO,CAAC,MAAM;IA2Bd,8FAA8F;IAC9F,OAAO,CAAC,KAAK;CAIb;AAgBD,wGAAwG;AACxG,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAoC1F;AAqBD,MAAM,WAAW,uBAAuB;IACvC,oHAAoH;IACpH,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IACxF,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB,GAAG,sBAAsB,CAwC/F"}
|