nolo-cli 0.159.0-alpha.2 → 0.159.0-alpha.4
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/{_executeModel-VGY53B7B.js → _executeModel-3HHZYHHB.js} +38 -37
- package/accountResolver-55EDKEIK.js +1 -1
- package/action-GPPJC5TI.js +1 -1
- package/{addContentAction-BI6RDRTQ.js → addContentAction-XJQEJ4XW.js} +6 -6
- package/{addDialogAgentAction-4RJYUSIK.js → addDialogAgentAction-5WZX5CAY.js} +5 -5
- package/{agentDeleteCommand-N7LJGVHB.js → agentDeleteCommand-VXWLHIUC.js} +55 -55
- package/{agentEmailCommands-2K3P3XDT.js → agentEmailCommands-2TQN6UIZ.js} +55 -55
- package/{agentListCommands-3CJ4GF6C.js → agentListCommands-44UDONIY.js} +30 -30
- package/{agentMachineCommands-4QQV7GGA.js → agentMachineCommands-KH7OSRWP.js} +25 -23
- package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
- package/{agentRecordCommands-U7OAV5ZX.js → agentRecordCommands-6BNH5KK2.js} +49 -49
- package/{agentRunCommand-55RMQNVI.js → agentRunCommand-7MFXU4GK.js} +52 -52
- package/{agentRunControl-PPYWJRIJ.js → agentRunControl-USFIAK7X.js} +4 -4
- package/{agentRuntimeLocal-7JDS3OAL.js → agentRuntimeLocal-BAQON6BB.js} +13 -11
- package/{agentSlice-OXGFFQ6L.js → agentSlice-YT3VCCEW.js} +6 -6
- package/{appDeleteCommands-UVWHW4TJ.js → appDeleteCommands-R73W7UJM.js} +22 -20
- package/{appDeployCommands-67JPR4JU.js → appDeployCommands-F65F6N63.js} +22 -20
- package/{appDeployStatusCommands-UTC6IR5V.js → appDeployStatusCommands-CTRCXJJX.js} +22 -20
- package/{appGetCommands-KLLIGWNC.js → appGetCommands-VTQERXLK.js} +22 -20
- package/{appListCommands-AZKNWJUR.js → appListCommands-MY3WFDYA.js} +22 -20
- package/{authCommand-MSINEFHH.js → authCommand-3Z52KJID.js} +14 -14
- package/{authCommands-AMNIAKEG.js → authCommands-QOCKVPX3.js} +5 -5
- package/{builtinSkillRegistry-H3AY27TR.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
- package/{chunk-2QCLJA24.js → chunk-2ZYCNT2O.js} +29 -29
- package/{chunk-KLOUPPO6.js → chunk-3GTVM7NJ.js} +17 -17
- package/{chunk-US6MKPE7.js → chunk-3L5MSPWX.js} +1 -1
- package/{chunk-U6TTTB6V.js → chunk-4L4K6YR7.js} +1 -1
- package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
- package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-IULXURBL.js → chunk-B5JIGIKM.js} +27 -22
- package/{chunk-J2ATF74A.js → chunk-BAWAKW7X.js} +1 -1
- package/{chunk-ZVQHBIWV.js → chunk-CDLP56BS.js} +7 -7
- package/{chunk-ZIGIN5IX.js → chunk-DD2EOI6S.js} +1 -1
- package/{chunk-OON4OBWI.js → chunk-DLV3H464.js} +7 -7
- package/{chunk-HNMY5XY6.js → chunk-DT7EWFTY.js} +5 -5
- package/{chunk-IRTOYSA2.js → chunk-ESMZW5PE.js} +1 -1
- package/{chunk-GB552UJS.js → chunk-F3SOW2EU.js} +46 -1
- package/{chunk-VKU6G2TC.js → chunk-F5WASHQA.js} +27 -29
- package/{chunk-RX2CAWIB.js → chunk-FB5WLEOD.js} +11 -11
- package/{chunk-4UCLMT27.js → chunk-FCUKCVKN.js} +4 -4
- package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
- package/{chunk-PKC7D6SX.js → chunk-FFHV45HO.js} +3 -3
- package/{chunk-CT5G7V46.js → chunk-FZYKQFBQ.js} +3 -3
- package/{chunk-MJKKEGF5.js → chunk-HBW2XA3L.js} +12 -12
- package/{chunk-MLGFCRL2.js → chunk-HW7EBEC5.js} +15 -191
- package/{chunk-5MPS5OOY.js → chunk-I7S63QUU.js} +1 -1
- package/{chunk-CON6SI7N.js → chunk-IF7V3CBU.js} +1 -1
- package/{chunk-UKD7M7MB.js → chunk-JDKSYQQN.js} +4 -4
- package/{chunk-M2P3OGXZ.js → chunk-JWEXJ573.js} +2 -2
- package/{chunk-SPKLALBU.js → chunk-MAYW6V3E.js} +1 -1
- package/{chunk-NDZOXXIM.js → chunk-NHEWV5FD.js} +1 -1
- package/{chunk-AAZ4QBFU.js → chunk-NWKPVIHL.js} +7 -7
- package/{chunk-NUE735UT.js → chunk-O2IWR23M.js} +1 -1
- package/{chunk-EJQBSOQQ.js → chunk-OLVOR45M.js} +2 -2
- package/{chunk-MGSNS22D.js → chunk-QA2C5NKI.js} +5 -739
- package/{chunk-4JOZECCA.js → chunk-QXZH5UDF.js} +2 -2
- package/{chunk-HSTLMIPE.js → chunk-QZIOZDM6.js} +9 -9
- package/{chunk-WQ2FSETX.js → chunk-R2KWTENX.js} +3 -3
- package/{chunk-C3WXTFRP.js → chunk-RIHQGFFA.js} +1 -1
- package/{chunk-AVB7CTVJ.js → chunk-SCQT4CRF.js} +40 -42
- package/{chunk-DC3SZCRR.js → chunk-SH3XD4E2.js} +2 -2
- package/{chunk-WI47DIF3.js → chunk-TK2AX7M6.js} +43 -45
- package/chunk-TT644UJD.js +188 -0
- package/{chunk-QOYJE6NX.js → chunk-U34KT53V.js} +28 -10
- package/{chunk-DFWLD7WU.js → chunk-ULQAD7ZY.js} +18 -6
- package/{chunk-RE5I35J7.js → chunk-VXS4YYJ2.js} +6 -6
- package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
- package/{chunk-XMHE5P5T.js → chunk-YNOXGQ7X.js} +13 -13
- package/{chunk-TQA3UACU.js → chunk-YR47Y7CN.js} +6 -6
- package/{chunk-CTDOZWQX.js → chunk-ZAV4YVEA.js} +1 -1
- package/{commandRegistry-J3BFLLBY.js → commandRegistry-3JCFSTBQ.js} +83 -83
- package/{contentThunks-ZDSBE7NG.js → contentThunks-QBL5NK2W.js} +14 -15
- package/{createAgentAutomationAction-TRWBF5DQ.js → createAgentAutomationAction-5UWBLR2N.js} +14 -15
- package/{createDialogAction-AMYWLRO4.js → createDialogAction-NJ2LE7KC.js} +18 -19
- package/{createPageAction-KHKRLVQO.js → createPageAction-7T3RINS2.js} +16 -17
- package/{dbSlice-DC2J53RC.js → dbSlice-6PVPY44C.js} +5 -5
- package/{deleteFile-KYWEMNFX.js → deleteFile-YM6NDPAR.js} +3 -3
- package/{dialogCommands-K4OVKDYD.js → dialogCommands-FDQPV6GO.js} +27 -25
- package/{dialogSlice-WNLY25YV.js → dialogSlice-GQMTD4HR.js} +13 -14
- package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
- package/{docCreateCommands-GI377ZFI.js → docCreateCommands-Z5KKWS2C.js} +24 -22
- package/{docDeleteCommands-NBQNTVHB.js → docDeleteCommands-YTGMEQ4I.js} +25 -23
- package/{docReadCommands-6SKEW6AO.js → docReadCommands-SK2CLD2S.js} +24 -22
- package/{docStore-UEYBUHOJ.js → docStore-PM5PYKPZ.js} +6 -6
- package/{docUpdateCommands-NJ7JD6VA.js → docUpdateCommands-SI4PL2L3.js} +24 -22
- package/{handleSendMessageAction-FKTNID5I.js → handleSendMessageAction-EQ3U6K5N.js} +31 -28
- package/index.js +7 -7
- package/{localRuntimeAdapter-ZT3P7NFH.js → localRuntimeAdapter-TVIGJ3PU.js} +46 -46
- package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
- package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
- package/{machineCommands-4I3POIF2.js → machineCommands-EYP73LBU.js} +51 -51
- package/{machineWsRunDispatch-EBTOI2EU.js → machineWsRunDispatch-6QWYWIHP.js} +47 -47
- package/{memberThunks-2DWKLE6W.js → memberThunks-AZINUM4S.js} +8 -8
- package/package.json +4 -2
- package/{read-L7QEJETH.js → read-7JPIWRBQ.js} +3 -3
- package/{readDocTool-QELXV2GW.js → readDocTool-AAQTB2Y3.js} +1 -1
- package/{readlineWorkspace-7DXZALKF.js → readlineWorkspace-QBN246OU.js} +81 -81
- package/{removeDialogAgentAction-376XSUP2.js → removeDialogAgentAction-RMVRILLK.js} +6 -6
- package/{runAgentClientLoop-MITBRXTT.js → runAgentClientLoop-EXIQDX7G.js} +36 -35
- package/{runtimeDoctorCommands-HEN5IPIH.js → runtimeDoctorCommands-MMCP4B4U.js} +11 -11
- package/{setDialogExtraReferencesAction-QBDSH63D.js → setDialogExtraReferencesAction-L3V7JTMG.js} +6 -6
- package/{setPrimaryDialogAgentAction-537QFGW3.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +6 -6
- package/{settingThunks-4Z43ZSAT.js → settingThunks-N6XFWPOU.js} +5 -5
- package/{spaceCommands-UM3ZQKJU.js → spaceCommands-5WANPZMM.js} +24 -22
- package/{streamAgentChatTurn-7ZIKATEO.js → streamAgentChatTurn-DI2334G3.js} +132 -72
- package/{switchDialogAgentAction-CSO6AKRL.js → switchDialogAgentAction-ZJ5CGU7J.js} +5 -5
- package/{tools-TSKAUQYD.js → tools-23VQGJOX.js} +27 -28
- package/{tuiSummaryLlmCaller-VSNIIH63.js → tuiSummaryLlmCaller-FESHBDTT.js} +4 -4
- package/{updateCommands-LXZLG44Y.js → updateCommands-KALLBWJE.js} +3 -3
- package/{updateDialogTitleAction-73QX44WS.js → updateDialogTitleAction-AGAYHWS7.js} +14 -15
- package/chunk-UKZX3NHN.js +0 -48
- package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
- package/{agentProviderCommands-CUBOAVPB.js → agentProviderCommands-CXBHNONN.js} +3 -3
- package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
- package/{chunk-2SGAI64X.js → chunk-43OFVLWJ.js} +4 -4
- package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
- package/{chunk-YNCJYU4X.js → chunk-G3VYRPTV.js} +4 -4
- package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
- package/{chunk-O4KVUI4W.js → chunk-KABQ74UQ.js} +3 -3
- package/{chunk-42W7LKBM.js → chunk-QV3VGSX6.js} +3 -3
- package/{chunk-4RJJDA57.js → chunk-WR37DI7R.js} +3 -3
- package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
- package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
- package/{tableCommands-LBH3QPPO.js → tableCommands-IVC5S7Y3.js} +11 -11
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shouldUseServerProxy
|
|
3
|
+
} from "./chunk-F3SOW2EU.js";
|
|
4
|
+
import {
|
|
5
|
+
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
6
|
+
isAntigravityCloudCodeBaseUrl,
|
|
7
|
+
isAntigravityOAuthAgent
|
|
8
|
+
} from "./chunk-SQX235S2.js";
|
|
9
|
+
import {
|
|
10
|
+
isOpenAiResponsesModel,
|
|
11
|
+
resolvePlatformChatCompletionsEndpoint,
|
|
12
|
+
resolvePlatformResponsesEndpoint
|
|
13
|
+
} from "./chunk-V7PCFWX3.js";
|
|
14
|
+
import {
|
|
15
|
+
findModelConfig
|
|
16
|
+
} from "./chunk-6EQD4AQL.js";
|
|
17
|
+
import {
|
|
18
|
+
asOptionalTrimmedString
|
|
19
|
+
} from "./chunk-G3SUCT4W.js";
|
|
20
|
+
import {
|
|
21
|
+
asTrimmedLowercaseString
|
|
22
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
23
|
+
|
|
24
|
+
// packages/agent-runtime/agentCallPlan.ts
|
|
25
|
+
var CODEX_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses";
|
|
26
|
+
var CURSOR_AGENT_URL = "https://api2.cursor.sh/agent.v1.AgentService/Run";
|
|
27
|
+
var DEVIN_CONNECT_URL = "https://server.codeium.com/exa.api_server_pb.ApiServerService/GetChatMessage";
|
|
28
|
+
function resolveClientWire(plan) {
|
|
29
|
+
if (plan.upstreamWire === "gemini-cca") return "chat.completions";
|
|
30
|
+
if (plan.upstreamWire === "anthropic-messages") return "chat.completions";
|
|
31
|
+
if (plan.upstreamWire === "cursor-connect") return "chat.completions";
|
|
32
|
+
if (plan.upstreamWire === "devin-connect") return "chat.completions";
|
|
33
|
+
if (plan.upstreamWire === "custom-gemini") return "chat.completions";
|
|
34
|
+
if (plan.upstreamWire === "custom-openai-responses") return "chat.completions";
|
|
35
|
+
if (plan.upstreamWire === "custom-anthropic-messages") return "chat.completions";
|
|
36
|
+
if (plan.upstreamWire === "responses" && plan.authMethod.kind === "oauth" && plan.authMethod.ref === "chatgpt") {
|
|
37
|
+
return "chat.completions";
|
|
38
|
+
}
|
|
39
|
+
return plan.upstreamWire;
|
|
40
|
+
}
|
|
41
|
+
var XAI_CHAT_COMPLETIONS_URL = "https://api.x.ai/v1/chat/completions";
|
|
42
|
+
var ANTHROPIC_MESSAGES_URL = "https://api.anthropic.com/v1/messages";
|
|
43
|
+
var CODEX_REQUIRED_HEADERS = [
|
|
44
|
+
"chatgpt-account-id",
|
|
45
|
+
"OpenAI-Beta",
|
|
46
|
+
"originator",
|
|
47
|
+
"version"
|
|
48
|
+
];
|
|
49
|
+
var ANTIGRAVITY_REQUIRED_HEADERS = [
|
|
50
|
+
"User-Agent"
|
|
51
|
+
// antigravity-specific UA (matches getAntigravityUserAgent)
|
|
52
|
+
];
|
|
53
|
+
function agentShouldUseServerProxy(agentConfig) {
|
|
54
|
+
return shouldUseServerProxy(agentConfig);
|
|
55
|
+
}
|
|
56
|
+
function resolveCustomUpstreamWire(endpoint, nativeProtocol) {
|
|
57
|
+
const responsesEndpoint = endpoint.includes("/responses");
|
|
58
|
+
if (nativeProtocol === "openai-responses" && responsesEndpoint) return "responses";
|
|
59
|
+
if (nativeProtocol === "gemini") return "custom-gemini";
|
|
60
|
+
if (nativeProtocol === "openai-responses") return "custom-openai-responses";
|
|
61
|
+
if (nativeProtocol === "anthropic-messages") return "custom-anthropic-messages";
|
|
62
|
+
return responsesEndpoint ? "responses" : "chat.completions";
|
|
63
|
+
}
|
|
64
|
+
function hasOwnCustomProviderKey(agentConfig) {
|
|
65
|
+
const endpoint = asOptionalTrimmedString(agentConfig.customProviderUrl);
|
|
66
|
+
if (!endpoint) return false;
|
|
67
|
+
if (isAntigravityCloudCodeBaseUrl(endpoint)) return false;
|
|
68
|
+
return Boolean(asOptionalTrimmedString(agentConfig.apiKey));
|
|
69
|
+
}
|
|
70
|
+
function resolveAgentCallPlan(agentConfig, _env) {
|
|
71
|
+
const apiKeyRef = asTrimmedLowercaseString(agentConfig.apiKeyRef);
|
|
72
|
+
const provider = asTrimmedLowercaseString(
|
|
73
|
+
agentConfig.provider ?? agentConfig.apiSource
|
|
74
|
+
);
|
|
75
|
+
const ownCustomKeyWins = hasOwnCustomProviderKey(agentConfig);
|
|
76
|
+
const oauthApiKeyRef = ownCustomKeyWins ? "" : apiKeyRef;
|
|
77
|
+
if (!ownCustomKeyWins && isAntigravityOAuthAgent(agentConfig)) {
|
|
78
|
+
return {
|
|
79
|
+
authMethod: { kind: "oauth", ref: "antigravity" },
|
|
80
|
+
transport: "server-proxy",
|
|
81
|
+
upstreamWire: "gemini-cca",
|
|
82
|
+
endpoint: ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
83
|
+
requiredHeaders: [...ANTIGRAVITY_REQUIRED_HEADERS],
|
|
84
|
+
vendor: provider || "google-antigravity"
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (oauthApiKeyRef === "chatgpt") {
|
|
88
|
+
return {
|
|
89
|
+
authMethod: { kind: "oauth", ref: "chatgpt" },
|
|
90
|
+
transport: "server-proxy",
|
|
91
|
+
upstreamWire: "responses",
|
|
92
|
+
endpoint: CODEX_RESPONSES_URL,
|
|
93
|
+
requiredHeaders: [...CODEX_REQUIRED_HEADERS],
|
|
94
|
+
vendor: provider || "openai"
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (oauthApiKeyRef === "claude") {
|
|
98
|
+
return {
|
|
99
|
+
authMethod: { kind: "oauth", ref: "claude" },
|
|
100
|
+
transport: "server-proxy",
|
|
101
|
+
upstreamWire: "anthropic-messages",
|
|
102
|
+
endpoint: ANTHROPIC_MESSAGES_URL,
|
|
103
|
+
requiredHeaders: ["anthropic-version", "anthropic-beta"],
|
|
104
|
+
vendor: provider || "anthropic"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (oauthApiKeyRef === "xai") {
|
|
108
|
+
return {
|
|
109
|
+
authMethod: { kind: "oauth", ref: "xai" },
|
|
110
|
+
transport: "server-proxy",
|
|
111
|
+
upstreamWire: "chat.completions",
|
|
112
|
+
endpoint: XAI_CHAT_COMPLETIONS_URL,
|
|
113
|
+
requiredHeaders: [],
|
|
114
|
+
vendor: provider || "xai"
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (oauthApiKeyRef === "cursor") {
|
|
118
|
+
return {
|
|
119
|
+
authMethod: { kind: "oauth", ref: "cursor" },
|
|
120
|
+
transport: "server-proxy",
|
|
121
|
+
upstreamWire: "cursor-connect",
|
|
122
|
+
endpoint: CURSOR_AGENT_URL,
|
|
123
|
+
requiredHeaders: [
|
|
124
|
+
"x-cursor-client-version",
|
|
125
|
+
"x-cursor-client-type",
|
|
126
|
+
"x-ghost-mode"
|
|
127
|
+
],
|
|
128
|
+
vendor: provider || "cursor"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (oauthApiKeyRef === "devin" || !ownCustomKeyWins && provider === "devin") {
|
|
132
|
+
return {
|
|
133
|
+
authMethod: { kind: "oauth", ref: "devin" },
|
|
134
|
+
transport: "server-proxy",
|
|
135
|
+
upstreamWire: "devin-connect",
|
|
136
|
+
endpoint: DEVIN_CONNECT_URL,
|
|
137
|
+
requiredHeaders: ["connect-protocol-version"],
|
|
138
|
+
vendor: provider || "devin"
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
if (agentConfig.cliProvider || agentConfig.apiSource === "cli" || provider === "cli") {
|
|
142
|
+
return {
|
|
143
|
+
authMethod: { kind: "cli", provider: agentConfig.cliProvider || provider || "codex" },
|
|
144
|
+
transport: "direct",
|
|
145
|
+
upstreamWire: "cli",
|
|
146
|
+
endpoint: "",
|
|
147
|
+
requiredHeaders: [],
|
|
148
|
+
vendor: provider || "cli"
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (agentConfig.customProviderUrl || agentConfig.apiSource === "custom") {
|
|
152
|
+
const transport2 = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
|
|
153
|
+
const endpoint2 = asOptionalTrimmedString(agentConfig.customProviderUrl) ?? "";
|
|
154
|
+
const upstreamWire2 = resolveCustomUpstreamWire(
|
|
155
|
+
endpoint2,
|
|
156
|
+
findModelConfig(provider, agentConfig.model ?? "")?.nativeProtocol
|
|
157
|
+
);
|
|
158
|
+
return {
|
|
159
|
+
authMethod: { kind: "custom-key" },
|
|
160
|
+
transport: transport2,
|
|
161
|
+
upstreamWire: upstreamWire2,
|
|
162
|
+
endpoint: endpoint2,
|
|
163
|
+
requiredHeaders: [],
|
|
164
|
+
vendor: provider || "custom"
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const transport = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
|
|
168
|
+
const useResponses = isOpenAiResponsesModel({
|
|
169
|
+
provider,
|
|
170
|
+
model: agentConfig.model,
|
|
171
|
+
endpointKey: agentConfig.endpointKey
|
|
172
|
+
});
|
|
173
|
+
const upstreamWire = useResponses ? "responses" : "chat.completions";
|
|
174
|
+
const endpoint = upstreamWire === "responses" ? resolvePlatformResponsesEndpoint(provider, agentConfig.model) ?? "" : resolvePlatformChatCompletionsEndpoint(provider, agentConfig.model) ?? "";
|
|
175
|
+
return {
|
|
176
|
+
authMethod: { kind: "platform-key" },
|
|
177
|
+
transport,
|
|
178
|
+
upstreamWire,
|
|
179
|
+
endpoint,
|
|
180
|
+
requiredHeaders: [],
|
|
181
|
+
vendor: provider || "openai"
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
resolveClientWire,
|
|
187
|
+
resolveAgentCallPlan
|
|
188
|
+
};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveAgentCallPlan
|
|
3
|
+
} from "./chunk-TT644UJD.js";
|
|
4
|
+
import {
|
|
5
|
+
SUBSCRIPTION_OAUTH_PROVIDERS
|
|
6
|
+
} from "./chunk-EWO77ZGF.js";
|
|
1
7
|
import {
|
|
2
8
|
findModelConfig,
|
|
3
9
|
getProviderByModelName
|
|
@@ -90,16 +96,18 @@ var lookupKnownModelVision = (provider, model) => {
|
|
|
90
96
|
if (provider && provider !== "custom") {
|
|
91
97
|
const direct = findModelConfig(provider, candidate);
|
|
92
98
|
if (direct && typeof direct.hasVision === "boolean") return direct.hasVision;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
} else {
|
|
100
|
+
const detected = getProviderByModelName(candidate);
|
|
101
|
+
if (detected) {
|
|
102
|
+
const found = findModelConfig(detected, candidate)?.hasVision;
|
|
103
|
+
if (found !== void 0) return found;
|
|
104
|
+
}
|
|
98
105
|
}
|
|
99
106
|
if (candidate.includes("/")) {
|
|
100
107
|
const slash = candidate.indexOf("/");
|
|
101
108
|
const modelProvider = candidate.slice(0, slash).toLowerCase();
|
|
102
109
|
const modelName = candidate.slice(slash + 1);
|
|
110
|
+
if (provider && provider !== "custom" && provider !== modelProvider) continue;
|
|
103
111
|
const nested = findModelConfig(modelProvider, modelName);
|
|
104
112
|
if (nested && typeof nested.hasVision === "boolean") return nested.hasVision;
|
|
105
113
|
}
|
|
@@ -108,12 +116,22 @@ var lookupKnownModelVision = (provider, model) => {
|
|
|
108
116
|
};
|
|
109
117
|
var resolveAgentImageInputSupport = (agent) => {
|
|
110
118
|
if (!agent) return true;
|
|
111
|
-
const provider = asTrimmedLowercaseString(agent.provider) || null;
|
|
119
|
+
const provider = asTrimmedLowercaseString(agent.provider) || asTrimmedLowercaseString(agent.apiSource) || null;
|
|
112
120
|
const model = asOptionalTrimmedString(agent.model) ?? "";
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
const { authMethod } = resolveAgentCallPlan({
|
|
122
|
+
key: "",
|
|
123
|
+
provider: agent.provider ?? void 0,
|
|
124
|
+
apiSource: agent.apiSource ?? void 0,
|
|
125
|
+
cliProvider: agent.cliProvider ?? void 0,
|
|
126
|
+
model,
|
|
127
|
+
apiKeyRef: agent.apiKeyRef ?? void 0,
|
|
128
|
+
customProviderUrl: agent.customProviderUrl ?? void 0,
|
|
129
|
+
apiKey: agent.apiKey ?? void 0,
|
|
130
|
+
useServerProxy: agent.useServerProxy ?? void 0
|
|
131
|
+
});
|
|
132
|
+
const catalogHasVision = authMethod.kind === "oauth" ? SUBSCRIPTION_OAUTH_PROVIDERS.find((entry) => entry.apiKeyRef === authMethod.ref)?.modelOptions.find(
|
|
133
|
+
(entry) => [model, stripEffortSuffix(model), stripPreviewSuffix(model)].includes(entry.id)
|
|
134
|
+
)?.hasVision : lookupKnownModelVision(provider, model);
|
|
117
135
|
if (catalogHasVision !== void 0) {
|
|
118
136
|
return catalogHasVision;
|
|
119
137
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveAgentImageInputSupport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U34KT53V.js";
|
|
4
4
|
import {
|
|
5
5
|
asOptionalFiniteNumber
|
|
6
6
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -33,9 +33,13 @@ function hasImageInRuntimeMessages(messages) {
|
|
|
33
33
|
var IMAGE_OMITTED_PLACEHOLDER = "[Image content omitted: model does not support image input]";
|
|
34
34
|
function stripImagePartsFromContent(content) {
|
|
35
35
|
if (!Array.isArray(content)) return content;
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
|
|
36
|
+
const hasImage = content.some((part) => part && typeof part === "object" && part.type === "image_url");
|
|
37
|
+
if (!hasImage) return content;
|
|
38
|
+
const hasNonImage = content.some((part) => part && typeof part === "object" && part.type !== "image_url");
|
|
39
|
+
if (!hasNonImage) return IMAGE_OMITTED_PLACEHOLDER;
|
|
40
|
+
return content.map(
|
|
41
|
+
(part) => part && typeof part === "object" && part.type === "image_url" ? { type: "text", text: IMAGE_OMITTED_PLACEHOLDER } : part
|
|
42
|
+
);
|
|
39
43
|
}
|
|
40
44
|
function stripImagePartsFromMessages(messages) {
|
|
41
45
|
return messages.map((msg) => ({
|
|
@@ -45,8 +49,15 @@ function stripImagePartsFromMessages(messages) {
|
|
|
45
49
|
}
|
|
46
50
|
async function stripImagePartsForTextOnlyAgent(messages, agentConfig) {
|
|
47
51
|
const supportsVision = resolveAgentImageInputSupport(agentConfig);
|
|
48
|
-
const
|
|
49
|
-
|
|
52
|
+
const runtimeMessages = messages;
|
|
53
|
+
const hasImages = hasImageInRuntimeMessages(runtimeMessages);
|
|
54
|
+
const shouldStrip = !supportsVision && hasImages;
|
|
55
|
+
const omittedImageCount = shouldStrip ? extractImageUrlsFromMessages(runtimeMessages).length : 0;
|
|
56
|
+
return {
|
|
57
|
+
messages: shouldStrip ? stripImagePartsFromMessages(messages) : messages,
|
|
58
|
+
downgraded: shouldStrip,
|
|
59
|
+
omittedImageCount
|
|
60
|
+
};
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
// packages/agent-runtime/agentRecordConfig.ts
|
|
@@ -414,6 +425,7 @@ function assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets(body) {
|
|
|
414
425
|
}
|
|
415
426
|
|
|
416
427
|
export {
|
|
428
|
+
extractImageUrlsFromMessages,
|
|
417
429
|
hasImageInRuntimeMessages,
|
|
418
430
|
stripImagePartsFromMessages,
|
|
419
431
|
stripImagePartsForTextOnlyAgent,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isOAuthApiKeyRef
|
|
3
|
-
} from "./chunk-UKZX3NHN.js";
|
|
4
1
|
import {
|
|
5
2
|
fnv1a32Hex
|
|
6
3
|
} from "./chunk-UEILX4EV.js";
|
|
@@ -10,11 +7,17 @@ import {
|
|
|
10
7
|
import {
|
|
11
8
|
isAgentUnavailableNow
|
|
12
9
|
} from "./chunk-3MZAGMYY.js";
|
|
10
|
+
import {
|
|
11
|
+
isOAuthApiKeyRef
|
|
12
|
+
} from "./chunk-F3SOW2EU.js";
|
|
13
13
|
import {
|
|
14
14
|
isOwnedAgentKey,
|
|
15
15
|
ownedAgentKey,
|
|
16
16
|
publicAgentKey
|
|
17
17
|
} from "./chunk-M2EJHDJP.js";
|
|
18
|
+
import {
|
|
19
|
+
getModelAbility
|
|
20
|
+
} from "./chunk-FYYSDHVQ.js";
|
|
18
21
|
import {
|
|
19
22
|
isSubscriptionEndpoint,
|
|
20
23
|
isSubscriptionOAuthCredential
|
|
@@ -22,9 +25,6 @@ import {
|
|
|
22
25
|
import {
|
|
23
26
|
isAntigravityOAuthAgent
|
|
24
27
|
} from "./chunk-SQX235S2.js";
|
|
25
|
-
import {
|
|
26
|
-
getModelAbility
|
|
27
|
-
} from "./chunk-FYYSDHVQ.js";
|
|
28
28
|
|
|
29
29
|
// packages/ai/agent/agentBilling.ts
|
|
30
30
|
function resolveBillingSource(candidate) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalRuntimeAdapter,
|
|
3
3
|
summarizeEndpoint
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SCQT4CRF.js";
|
|
5
5
|
import {
|
|
6
6
|
t
|
|
7
7
|
} from "./chunk-2AB2HA4M.js";
|
|
8
8
|
import {
|
|
9
9
|
clipMultilineText
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FCUKCVKN.js";
|
|
11
11
|
import {
|
|
12
12
|
runLocalAgentTurn
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-B5JIGIKM.js";
|
|
14
14
|
import {
|
|
15
15
|
applyToolSurfaceConstraints
|
|
16
16
|
} from "./chunk-QLQ573SU.js";
|
|
@@ -29,6 +29,16 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
asOptionalPositiveFiniteNumber
|
|
31
31
|
} from "./chunk-U6VC4MU4.js";
|
|
32
|
+
import {
|
|
33
|
+
parseUserIdFromAuthToken
|
|
34
|
+
} from "./chunk-A7GB5UGH.js";
|
|
35
|
+
import {
|
|
36
|
+
DEFAULT_NOLO_SERVER_URL
|
|
37
|
+
} from "./chunk-OLZBQWZU.js";
|
|
38
|
+
import {
|
|
39
|
+
readPipeText,
|
|
40
|
+
spawnProcess
|
|
41
|
+
} from "./chunk-Y6ROFCZO.js";
|
|
32
42
|
import {
|
|
33
43
|
isRecord
|
|
34
44
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -38,19 +48,9 @@ import {
|
|
|
38
48
|
import {
|
|
39
49
|
toErrorMessage
|
|
40
50
|
} from "./chunk-HNMXYYJR.js";
|
|
41
|
-
import {
|
|
42
|
-
parseUserIdFromAuthToken
|
|
43
|
-
} from "./chunk-A7GB5UGH.js";
|
|
44
|
-
import {
|
|
45
|
-
DEFAULT_NOLO_SERVER_URL
|
|
46
|
-
} from "./chunk-OLZBQWZU.js";
|
|
47
51
|
import {
|
|
48
52
|
asOptionalTrimmedString
|
|
49
53
|
} from "./chunk-G3SUCT4W.js";
|
|
50
|
-
import {
|
|
51
|
-
readPipeText,
|
|
52
|
-
spawnProcess
|
|
53
|
-
} from "./chunk-Y6ROFCZO.js";
|
|
54
54
|
|
|
55
55
|
// packages/ai/agent/machineRunPermissions.ts
|
|
56
56
|
var DEFAULT_POLICY = {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
deleteDialog,
|
|
3
3
|
runtime_default,
|
|
4
4
|
toast
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-F5WASHQA.js";
|
|
6
6
|
import {
|
|
7
7
|
getCurrentSpaceId,
|
|
8
8
|
getCurrentSpaceIdRaw,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
addContentAction,
|
|
20
20
|
checkSpaceMembership,
|
|
21
21
|
localSpaceAuthorityPatchStamp
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JWEXJ573.js";
|
|
23
23
|
import {
|
|
24
24
|
createSpaceKey,
|
|
25
25
|
normalizeSpaceId
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
uploadFileAction,
|
|
33
33
|
upsertSSREntity,
|
|
34
34
|
write
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CDLP56BS.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveFileCategory
|
|
38
38
|
} from "./chunk-3PVYUPXK.js";
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
resolveReplicationServers,
|
|
44
44
|
scheduleDeleteReplication,
|
|
45
45
|
scheduleWriteReplication
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-43OFVLWJ.js";
|
|
47
47
|
import {
|
|
48
48
|
createAsyncThunk
|
|
49
49
|
} from "./chunk-WRCZXJ4N.js";
|
|
@@ -1495,11 +1495,11 @@ var ENTITY_DELETE_STRATEGIES = {
|
|
|
1495
1495
|
await dispatch(deleteTable({ dbKey: key })).unwrap();
|
|
1496
1496
|
},
|
|
1497
1497
|
file: async (key, { thunkAPI }) => {
|
|
1498
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
1498
|
+
const { deleteFileAction } = await import("./deleteFile-YM6NDPAR.js");
|
|
1499
1499
|
await deleteFileAction(key, thunkAPI);
|
|
1500
1500
|
},
|
|
1501
1501
|
image: async (key, { thunkAPI }) => {
|
|
1502
|
-
const { deleteFileAction } = await import("./deleteFile-
|
|
1502
|
+
const { deleteFileAction } = await import("./deleteFile-YM6NDPAR.js");
|
|
1503
1503
|
await deleteFileAction(key, thunkAPI);
|
|
1504
1504
|
},
|
|
1505
1505
|
agent: async (key, { dispatch, userId, sourceServerOrigin }) => {
|