nolo-cli 0.172.0-alpha.3 → 0.173.0-alpha.2
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-P7OE5QLM.js → _executeModel-557MGBNC.js} +20 -19
- package/{agentDeleteCommand-3CCYENZM.js → agentDeleteCommand-HG5EDCO6.js} +25 -24
- package/{agentEmailCommands-VH6GRZ4S.js → agentEmailCommands-7YX27N6M.js} +27 -26
- package/{agentListCommands-FCSA7YV3.js → agentListCommands-AT5IGY5W.js} +16 -15
- package/{agentMachineCommands-VEBNXOLD.js → agentMachineCommands-WR3IFBB6.js} +14 -13
- package/{agentProviderCommands-TWVILNAN.js → agentProviderCommands-FXEMNSZ2.js} +2 -2
- package/{agentRecordCommands-MGCNHOJ3.js → agentRecordCommands-T6PXLK4B.js} +25 -24
- package/{agentRunCommand-UMVA6KSF.js → agentRunCommand-RB3TFF6O.js} +26 -25
- package/{agentRuntimeLocal-2JOFHEXA.js → agentRuntimeLocal-72TUBESS.js} +12 -11
- package/{agentSlice-AXI53QZB.js → agentSlice-YQHUKPIF.js} +1 -1
- package/{appDeleteCommands-BNQKVEIA.js → appDeleteCommands-THIHX7BV.js} +15 -14
- package/{appDeployCommands-V5WQ2ZBR.js → appDeployCommands-5JA5DDMR.js} +15 -14
- package/{appDeployStatusCommands-QA5GFIUU.js → appDeployStatusCommands-EHFPCQHM.js} +15 -14
- package/{appGetCommands-U3SDB4TE.js → appGetCommands-4HSRXSYD.js} +15 -14
- package/{appListCommands-DMHPABYC.js → appListCommands-TD7BQFWQ.js} +15 -14
- package/{authCommand-BSOLJFPV.js → authCommand-CVKPVPHN.js} +8 -4
- package/{chunk-6KS4TTCI.js → chunk-24VDDKCB.js} +10 -10
- package/{chunk-4TTEZGP3.js → chunk-2OWYKHKI.js} +65 -30
- package/{chunk-3RF4DIQW.js → chunk-4NYYWHM7.js} +7 -7
- package/{chunk-I33CJERI.js → chunk-7QQOOHDG.js} +2 -2
- package/{chunk-BKCR2JHG.js → chunk-7ZGMQZ5D.js} +0 -45
- package/chunk-A6B3LSDB.js +151 -0
- package/{chunk-XWEAIAO2.js → chunk-BAXCQF6H.js} +1 -1
- package/{chunk-AJ52EA72.js → chunk-D2J22QSE.js} +1 -1
- package/{chunk-XWX5ZGWR.js → chunk-DWFRZ3UI.js} +89 -24
- package/{chunk-CDDFEVZ5.js → chunk-EGT6ORP5.js} +10 -10
- package/{chunk-2FOT26E6.js → chunk-ENIQIEAF.js} +1 -1
- package/{chunk-55HS2GQD.js → chunk-EVW2U6RH.js} +3 -3
- package/{chunk-CRQGEMKZ.js → chunk-EY3QEZZR.js} +13 -13
- package/{chunk-U4C2R3PV.js → chunk-FDPODXE3.js} +3 -3
- package/{chunk-EW6GOYKQ.js → chunk-HHEM4TV3.js} +2 -2
- package/{chunk-QPUKYKMH.js → chunk-ISIFZP3N.js} +4 -101
- package/{chunk-7YN3HYWC.js → chunk-IVPXG433.js} +30 -15
- package/{chunk-RU4KURIK.js → chunk-J63HVOSX.js} +2 -2
- package/{chunk-OQ3DOBYB.js → chunk-JOUFPRE4.js} +178 -2
- package/{chunk-CK4GWPSD.js → chunk-KPSNHLFI.js} +3 -5
- package/{chunk-SIZPFDPU.js → chunk-KXIJYPVC.js} +2 -2
- package/{chunk-3SF6NB4R.js → chunk-L7ZCLG72.js} +2 -2
- package/{chunk-KSCX7GME.js → chunk-LCCULKPJ.js} +3 -3
- package/{chunk-XKL2RXV6.js → chunk-LTWBOZE6.js} +13 -11
- package/{chunk-ZQ545VNM.js → chunk-ONQ2APOE.js} +4 -4
- package/{chunk-UVP7VL6F.js → chunk-P34IX26T.js} +1 -1
- package/{chunk-U5UZ7IPM.js → chunk-QFAISMV5.js} +3 -3
- package/{chunk-TZ6CCFRL.js → chunk-QWNMFO5E.js} +3 -3
- package/{chunk-TOLFIE2I.js → chunk-RABMW33C.js} +3 -3
- package/{chunk-TY7GIRX6.js → chunk-RUKAOMXD.js} +1 -1
- package/{chunk-S4SA4INB.js → chunk-RYBZM4A2.js} +2 -2
- package/{chunk-7TBARDLF.js → chunk-T7HBI3WZ.js} +1 -1
- package/{chunk-ZCXK773F.js → chunk-TMAQFKHS.js} +2 -2
- package/chunk-UKZX3NHN.js +48 -0
- package/{chunk-EEFX46WP.js → chunk-VJ52BYBK.js} +1 -1
- package/{chunk-XBJIESNS.js → chunk-XAFCJN32.js} +2 -2
- package/{chunk-VVMACDVS.js → chunk-Y3BUTWUJ.js} +1 -1
- package/{chunk-KNDA4K34.js → chunk-YBTP3PUM.js} +1 -1
- package/{chunk-BIF4B4ON.js → chunk-Z4HDFBYK.js} +1 -1
- package/{commandRegistry-FDWLTWIQ.js → commandRegistry-PJ3EQ6U7.js} +49 -49
- package/{contentThunks-AAGKCQCZ.js → contentThunks-NVX3NBHZ.js} +6 -5
- package/{createAgentAutomationAction-2K7M6ACJ.js → createAgentAutomationAction-EONFRZYA.js} +6 -5
- package/{createDialogAction-RFQJMLEO.js → createDialogAction-ZVY45CNY.js} +7 -6
- package/{createPageAction-MBDADKFQ.js → createPageAction-N5XSWPN2.js} +6 -5
- package/{dialogCommands-E5I4ORXJ.js → dialogCommands-CPK6MUIJ.js} +15 -14
- package/{dialogSlice-MHZCAC4E.js → dialogSlice-ST2FXOF3.js} +5 -4
- package/{docCreateCommands-SMX7DXUS.js → docCreateCommands-GLR2HLYH.js} +14 -13
- package/{docDeleteCommands-MFPBAHFH.js → docDeleteCommands-MPE53Z5W.js} +15 -14
- package/{docReadCommands-ZOWLKFAF.js → docReadCommands-MFKWAFDI.js} +14 -13
- package/{docStore-IUFAMRVZ.js → docStore-PPUT7MQV.js} +1 -1
- package/{docUpdateCommands-4THL5VLI.js → docUpdateCommands-3QBT2XTK.js} +14 -13
- package/{handleSendMessageAction-OS6NNC3U.js → handleSendMessageAction-74EKQW4M.js} +13 -13
- package/index.js +4 -4
- package/{localRuntimeAdapter-XQ4PAAIT.js → localRuntimeAdapter-KQHAGAXR.js} +23 -22
- package/{machineCommands-UHGFVPD2.js → machineCommands-DMPHPCQS.js} +24 -23
- package/{machineWsRunDispatch-BAFZOC6Z.js → machineWsRunDispatch-736CCGUF.js} +24 -23
- package/package.json +1 -1
- package/{providerPresetApply-5K4PBX4J.js → providerPresetApply-MBMGCNKZ.js} +1 -2
- package/{providerRegistry-K5MSZ3Y5.js → providerRegistry-P4KYS6SE.js} +1 -2
- package/{readlineWorkspace-ISBZZPR2.js → readlineWorkspace-K4WNNW2D.js} +29 -28
- package/{runAgentClientLoop-H4KCCJOV.js → runAgentClientLoop-Z6STKR3Z.js} +18 -17
- package/{spaceCommands-PVEPGFHX.js → spaceCommands-U4UYF6IB.js} +14 -13
- package/{streamAgentChatTurn-4PX74Z36.js → streamAgentChatTurn-2ON7E6LT.js} +24 -22
- package/{tools-546KDFWP.js → tools-ZB2YBHSS.js} +12 -12
- package/{tuiSummaryLlmCaller-LA7NUKUJ.js → tuiSummaryLlmCaller-I2MRY6T5.js} +8 -7
- package/{updateDialogTitleAction-LIS3EPHP.js → updateDialogTitleAction-YMQAOVJ2.js} +6 -5
- package/chunk-TSCI6X6C.js +0 -185
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
asOptionalFiniteNumber
|
|
3
|
+
} from "./chunk-WWC7I6TA.js";
|
|
4
|
+
import {
|
|
5
|
+
trimTrailingSlash
|
|
6
|
+
} from "./chunk-I2QHI2XM.js";
|
|
4
7
|
import {
|
|
5
8
|
commandCodeModels,
|
|
6
9
|
kimiCodeModels,
|
|
@@ -12,6 +15,12 @@ import {
|
|
|
12
15
|
stepfunModels,
|
|
13
16
|
stepfunStepPlanModels
|
|
14
17
|
} from "./chunk-GC64WGMD.js";
|
|
18
|
+
import {
|
|
19
|
+
toErrorMessage
|
|
20
|
+
} from "./chunk-HNMXYYJR.js";
|
|
21
|
+
import {
|
|
22
|
+
asOptionalTrimmedString
|
|
23
|
+
} from "./chunk-G3SUCT4W.js";
|
|
15
24
|
import {
|
|
16
25
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_OFF_PEAK_PRICE,
|
|
17
26
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
|
|
@@ -22,6 +31,157 @@ import {
|
|
|
22
31
|
asTrimmedLowercaseString
|
|
23
32
|
} from "./chunk-QSJ3HFEF.js";
|
|
24
33
|
|
|
34
|
+
// packages/agent-runtime/antigravityOAuth.ts
|
|
35
|
+
var decodeBase64 = (s) => typeof Buffer !== "undefined" ? Buffer.from(s, "base64").toString("utf8") : typeof atob === "function" ? atob(s) : s;
|
|
36
|
+
var ANTIGRAVITY_CLIENT_ID = decodeBase64(
|
|
37
|
+
"MTA3MTAwNjA2MDU5MS10bWhzc2luMmgyMWxjcmUyMzV2dG9sb2poNGc0MDNlcC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbQ=="
|
|
38
|
+
);
|
|
39
|
+
var ANTIGRAVITY_CLIENT_SECRET = decodeBase64(
|
|
40
|
+
"R09DU1BYLUs1OEZXUjQ4NkxkTEoxbUxCOHNYQzR6NnFEQWY="
|
|
41
|
+
);
|
|
42
|
+
var ANTIGRAVITY_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
43
|
+
var ANTIGRAVITY_TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
44
|
+
var ANTIGRAVITY_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
|
|
45
|
+
var ANTIGRAVITY_CALLBACK_PORT = 51121;
|
|
46
|
+
var ANTIGRAVITY_CALLBACK_PATH = "/oauth-callback";
|
|
47
|
+
var ANTIGRAVITY_CALLBACK_URL = `http://127.0.0.1:${ANTIGRAVITY_CALLBACK_PORT}${ANTIGRAVITY_CALLBACK_PATH}`;
|
|
48
|
+
var ANTIGRAVITY_SCOPES = [
|
|
49
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
50
|
+
"https://www.googleapis.com/auth/userinfo.email",
|
|
51
|
+
"https://www.googleapis.com/auth/userinfo.profile",
|
|
52
|
+
"https://www.googleapis.com/auth/cclog",
|
|
53
|
+
"https://www.googleapis.com/auth/experimentsandconfigs"
|
|
54
|
+
];
|
|
55
|
+
var ANTIGRAVITY_ACCESS_TOKEN_CLIENT_SKEW_MS = 5 * 60 * 1e3;
|
|
56
|
+
var ANTIGRAVITY_TOKEN_REQUEST_TIMEOUT_MS = 3e4;
|
|
57
|
+
var ANTIGRAVITY_CLOUD_CODE_BASE_URL = "https://daily-cloudcode-pa.googleapis.com";
|
|
58
|
+
var ANTIGRAVITY_CLOUD_CODE_HOST = "cloudcode-pa.googleapis.com";
|
|
59
|
+
var ANTIGRAVITY_CLOUD_CODE_HOSTS = [
|
|
60
|
+
ANTIGRAVITY_CLOUD_CODE_HOST,
|
|
61
|
+
"daily-cloudcode-pa.googleapis.com"
|
|
62
|
+
];
|
|
63
|
+
function isAntigravityCloudCodeHostname(rawHost) {
|
|
64
|
+
const hostname = asTrimmedLowercaseString(rawHost ?? "").replace(/\.+$/, "");
|
|
65
|
+
if (!hostname) return false;
|
|
66
|
+
return ANTIGRAVITY_CLOUD_CODE_HOSTS.includes(hostname);
|
|
67
|
+
}
|
|
68
|
+
function isAntigravityCloudCodeBaseUrl(raw) {
|
|
69
|
+
const value = typeof raw === "string" ? raw.trim() : "";
|
|
70
|
+
if (!value) return false;
|
|
71
|
+
try {
|
|
72
|
+
return isAntigravityCloudCodeHostname(new URL(value).hostname);
|
|
73
|
+
} catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
var ANTIGRAVITY_LEGACY_GENERIC_BASE_RE = /^https?:\/\/cloudcode-pa\.googleapis\.com$/i;
|
|
78
|
+
function getAntigravityUserAgent() {
|
|
79
|
+
const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.23.1";
|
|
80
|
+
const os = process.platform === "win32" ? "windows" : process.platform;
|
|
81
|
+
const arch = process.arch === "x64" ? "amd64" : process.arch === "ia32" ? "386" : process.arch;
|
|
82
|
+
return `antigravity/hub/${version} ${os}/${arch}`;
|
|
83
|
+
}
|
|
84
|
+
function resolveAntigravityCloudCodeBaseUrl(customProviderUrl) {
|
|
85
|
+
const raw = (customProviderUrl ?? "").trim();
|
|
86
|
+
if (!raw) return ANTIGRAVITY_CLOUD_CODE_BASE_URL;
|
|
87
|
+
const trimmed = trimTrailingSlash(raw);
|
|
88
|
+
if (isAntigravityCloudCodeBaseUrl(trimmed)) {
|
|
89
|
+
const base = trimmed.replace(/\/v1internal:.*$/i, "").replace(/\/$/, "");
|
|
90
|
+
if (ANTIGRAVITY_LEGACY_GENERIC_BASE_RE.test(base)) {
|
|
91
|
+
return ANTIGRAVITY_CLOUD_CODE_BASE_URL;
|
|
92
|
+
}
|
|
93
|
+
return base;
|
|
94
|
+
}
|
|
95
|
+
return ANTIGRAVITY_CLOUD_CODE_BASE_URL;
|
|
96
|
+
}
|
|
97
|
+
function isAntigravityOAuthAgent(agentConfig) {
|
|
98
|
+
if (!agentConfig) return false;
|
|
99
|
+
const apiKeyRef = asTrimmedLowercaseString(agentConfig.apiKeyRef);
|
|
100
|
+
const provider = asTrimmedLowercaseString(agentConfig.provider);
|
|
101
|
+
const url = asTrimmedLowercaseString(agentConfig.customProviderUrl);
|
|
102
|
+
return apiKeyRef === "antigravity" || provider === "google-antigravity" || // 只看解析后的 hostname(同 resolver):后缀 host / userinfo / path 里的官方串
|
|
103
|
+
// 都不构成 antigravity 身份。
|
|
104
|
+
isAntigravityCloudCodeBaseUrl(url);
|
|
105
|
+
}
|
|
106
|
+
function readAntigravityProjectId(metadata) {
|
|
107
|
+
return asOptionalTrimmedString(metadata?.projectId);
|
|
108
|
+
}
|
|
109
|
+
function normalizeAntigravityTokenPayload(args) {
|
|
110
|
+
const {
|
|
111
|
+
payload,
|
|
112
|
+
baseCredential,
|
|
113
|
+
now = Date.now(),
|
|
114
|
+
clientSkewMs = ANTIGRAVITY_ACCESS_TOKEN_CLIENT_SKEW_MS
|
|
115
|
+
} = args;
|
|
116
|
+
if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
|
|
117
|
+
throw new Error("Antigravity token response missing access_token");
|
|
118
|
+
}
|
|
119
|
+
const accessToken = payload.access_token.trim();
|
|
120
|
+
const expiresIn = asOptionalFiniteNumber(payload.expires_in);
|
|
121
|
+
const expiresAt = expiresIn !== void 0 ? now + expiresIn * 1e3 - clientSkewMs : baseCredential?.expiresAt;
|
|
122
|
+
const refreshToken = typeof payload.refresh_token === "string" && payload.refresh_token.trim() ? payload.refresh_token.trim() : baseCredential?.refreshToken;
|
|
123
|
+
const scope = typeof payload.scope === "string" && payload.scope.trim() ? payload.scope.trim() : baseCredential?.scope;
|
|
124
|
+
return {
|
|
125
|
+
...baseCredential ?? {},
|
|
126
|
+
provider: baseCredential?.provider ?? "antigravity",
|
|
127
|
+
accessToken,
|
|
128
|
+
...refreshToken ? { refreshToken } : {},
|
|
129
|
+
...expiresAt !== void 0 ? { expiresAt } : {},
|
|
130
|
+
...scope ? { scope } : {},
|
|
131
|
+
obtainedAt: now
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async function refreshAntigravityToken(credential, deps = {}) {
|
|
135
|
+
if (!credential.refreshToken || !credential.refreshToken.trim()) {
|
|
136
|
+
throw new Error("Antigravity credential has no refresh_token");
|
|
137
|
+
}
|
|
138
|
+
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
139
|
+
let response;
|
|
140
|
+
try {
|
|
141
|
+
response = await fetchImpl(ANTIGRAVITY_TOKEN_URL, {
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers: {
|
|
144
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
145
|
+
Accept: "application/json"
|
|
146
|
+
},
|
|
147
|
+
body: new URLSearchParams({
|
|
148
|
+
client_id: ANTIGRAVITY_CLIENT_ID,
|
|
149
|
+
client_secret: ANTIGRAVITY_CLIENT_SECRET,
|
|
150
|
+
refresh_token: credential.refreshToken.trim(),
|
|
151
|
+
grant_type: "refresh_token"
|
|
152
|
+
}),
|
|
153
|
+
signal: AbortSignal.timeout(ANTIGRAVITY_TOKEN_REQUEST_TIMEOUT_MS)
|
|
154
|
+
});
|
|
155
|
+
} catch (error) {
|
|
156
|
+
throw new Error(
|
|
157
|
+
`Antigravity token refresh failed: ${toErrorMessage(error)}`
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
let rawBodyText = "";
|
|
161
|
+
let payload;
|
|
162
|
+
try {
|
|
163
|
+
rawBodyText = await response.text();
|
|
164
|
+
payload = rawBodyText ? JSON.parse(rawBodyText) : {};
|
|
165
|
+
} catch {
|
|
166
|
+
payload = {};
|
|
167
|
+
}
|
|
168
|
+
if (!response.ok) {
|
|
169
|
+
const errorCode = typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : void 0;
|
|
170
|
+
const errorDescription = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : void 0;
|
|
171
|
+
const detail = (errorCode && errorDescription && errorDescription !== errorCode ? `${errorCode}: ${errorDescription}` : errorCode ?? errorDescription ?? rawBodyText.trim()) || `HTTP ${response.status}`;
|
|
172
|
+
throw new Error(`Antigravity token refresh failed: ${detail}`);
|
|
173
|
+
}
|
|
174
|
+
if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
|
|
175
|
+
throw new Error("Antigravity token refresh response missing access_token");
|
|
176
|
+
}
|
|
177
|
+
const now = deps.now?.() ?? Date.now();
|
|
178
|
+
return normalizeAntigravityTokenPayload({
|
|
179
|
+
payload,
|
|
180
|
+
baseCredential: credential,
|
|
181
|
+
now
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
25
185
|
// packages/integrations/deepseek/models.ts
|
|
26
186
|
var deepseekModels = [
|
|
27
187
|
// ── 旗舰 ──
|
|
@@ -723,6 +883,22 @@ function isSubscriptionOAuthCredential(apiKeyRef) {
|
|
|
723
883
|
}
|
|
724
884
|
|
|
725
885
|
export {
|
|
886
|
+
ANTIGRAVITY_CLIENT_ID,
|
|
887
|
+
ANTIGRAVITY_CLIENT_SECRET,
|
|
888
|
+
ANTIGRAVITY_AUTH_URL,
|
|
889
|
+
ANTIGRAVITY_TOKEN_URL,
|
|
890
|
+
ANTIGRAVITY_USERINFO_URL,
|
|
891
|
+
ANTIGRAVITY_CALLBACK_PORT,
|
|
892
|
+
ANTIGRAVITY_CALLBACK_PATH,
|
|
893
|
+
ANTIGRAVITY_SCOPES,
|
|
894
|
+
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
895
|
+
isAntigravityCloudCodeBaseUrl,
|
|
896
|
+
getAntigravityUserAgent,
|
|
897
|
+
resolveAntigravityCloudCodeBaseUrl,
|
|
898
|
+
isAntigravityOAuthAgent,
|
|
899
|
+
readAntigravityProjectId,
|
|
900
|
+
normalizeAntigravityTokenPayload,
|
|
901
|
+
refreshAntigravityToken,
|
|
726
902
|
SUBSCRIPTION_OAUTH_PROVIDERS,
|
|
727
903
|
CUSTOM_API_KEY_TEMPLATES,
|
|
728
904
|
ALL_PROVIDER_REGISTRY,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-JLR5NWP2.js";
|
|
12
12
|
import {
|
|
13
13
|
isOAuthApiKeyRef
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UKZX3NHN.js";
|
|
15
15
|
import {
|
|
16
16
|
isOwnedAgentKey,
|
|
17
17
|
ownedAgentKey,
|
|
@@ -21,12 +21,10 @@ import {
|
|
|
21
21
|
getModelAbility
|
|
22
22
|
} from "./chunk-HLAL63BZ.js";
|
|
23
23
|
import {
|
|
24
|
+
isAntigravityOAuthAgent,
|
|
24
25
|
isSubscriptionEndpoint,
|
|
25
26
|
isSubscriptionOAuthCredential
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import {
|
|
28
|
-
isAntigravityOAuthAgent
|
|
29
|
-
} from "./chunk-TSCI6X6C.js";
|
|
27
|
+
} from "./chunk-JOUFPRE4.js";
|
|
30
28
|
|
|
31
29
|
// packages/ai/agent/agentBilling.ts
|
|
32
30
|
function resolveBillingSource(candidate) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-VYNMQ6HW.js";
|
|
9
9
|
import {
|
|
10
10
|
fetchAndCacheTableRows
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Z4HDFBYK.js";
|
|
12
12
|
import {
|
|
13
13
|
require_react
|
|
14
14
|
} from "./chunk-YDH3FDFQ.js";
|
|
@@ -521,7 +521,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
521
521
|
if (!executionInput) {
|
|
522
522
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
523
523
|
}
|
|
524
|
-
const { findToolExecutor } = await import("./tools-
|
|
524
|
+
const { findToolExecutor } = await import("./tools-ZB2YBHSS.js");
|
|
525
525
|
const { executor } = findToolExecutor(run.toolName);
|
|
526
526
|
toolRunStarted({
|
|
527
527
|
id: run.id,
|
|
@@ -333,7 +333,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
333
333
|
).unwrap();
|
|
334
334
|
if (dbSpaceId) {
|
|
335
335
|
try {
|
|
336
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
336
|
+
const { updateContentTitle } = await import("./contentThunks-NVX3NBHZ.js");
|
|
337
337
|
await dispatch(
|
|
338
338
|
updateContentTitle({
|
|
339
339
|
spaceId: dbSpaceId,
|
|
@@ -372,7 +372,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
async function createDocState(args, thunkApi) {
|
|
375
|
-
const { createPageAction } = await import("./createPageAction-
|
|
375
|
+
const { createPageAction } = await import("./createPageAction-N5XSWPN2.js");
|
|
376
376
|
return createPageAction(args, thunkApi);
|
|
377
377
|
}
|
|
378
378
|
function subscribe(listener) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-HNUWUO75.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveAgentImageInputSupport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7QQOOHDG.js";
|
|
7
7
|
import {
|
|
8
8
|
accumulateToolCallDelta,
|
|
9
9
|
createThinkParserState,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
stablePromptCacheKey,
|
|
31
31
|
toOpenAiCompatibleMessages,
|
|
32
32
|
toResponsesTools
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ISIFZP3N.js";
|
|
34
34
|
import {
|
|
35
35
|
isMeaningfulChatCompletionOutput,
|
|
36
36
|
isMeaningfulResponsesOutput
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7ZGMQZ5D.js";
|
|
38
38
|
import {
|
|
39
39
|
clipCompactText
|
|
40
40
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-QYPE3TS3.js";
|
|
12
12
|
import {
|
|
13
13
|
runLlm
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RABMW33C.js";
|
|
15
15
|
import {
|
|
16
16
|
getApproxPricePerImage
|
|
17
17
|
} from "./chunk-4JH2UMJR.js";
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
extractReferenceKeysFromMessage,
|
|
104
104
|
normalizeUsage,
|
|
105
105
|
resolveAutoExecutionProfile
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-T7HBI3WZ.js";
|
|
107
107
|
import {
|
|
108
108
|
isDevinOAuthAgent
|
|
109
109
|
} from "./chunk-5ZUL4CUO.js";
|
|
@@ -118,10 +118,12 @@ import {
|
|
|
118
118
|
formatFileOperationsFromMessages,
|
|
119
119
|
formatMessagesForSummaryWithTruncation,
|
|
120
120
|
getModelInfo,
|
|
121
|
-
isOAuthApiKeyRef,
|
|
122
121
|
planCompression,
|
|
123
122
|
serializeMessageContent
|
|
124
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-7ZGMQZ5D.js";
|
|
124
|
+
import {
|
|
125
|
+
isOAuthApiKeyRef
|
|
126
|
+
} from "./chunk-UKZX3NHN.js";
|
|
125
127
|
import {
|
|
126
128
|
asRecordOrEmpty
|
|
127
129
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -11062,7 +11064,7 @@ var messageSlice = createSliceWithThunks({
|
|
|
11062
11064
|
runtimeOptions: args.runtimeOptions
|
|
11063
11065
|
});
|
|
11064
11066
|
if (agentKeyToUse) {
|
|
11065
|
-
const { streamAgentChatTurn } = await import("./agentSlice-
|
|
11067
|
+
const { streamAgentChatTurn } = await import("./agentSlice-YQHUKPIF.js");
|
|
11066
11068
|
await dispatch(
|
|
11067
11069
|
streamAgentChatTurn({
|
|
11068
11070
|
agentKey: agentKeyToUse,
|
|
@@ -13879,7 +13881,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13879
13881
|
}
|
|
13880
13882
|
if (isCurrentDialog) {
|
|
13881
13883
|
await thunkApi.dispatch(resetMsgs());
|
|
13882
|
-
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-
|
|
13884
|
+
const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-ST2FXOF3.js");
|
|
13883
13885
|
dispatch(clearPendingAttachments2());
|
|
13884
13886
|
}
|
|
13885
13887
|
return { dialogKey, isCurrentDialog, attachmentPlan };
|
|
@@ -13887,15 +13889,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
|
|
|
13887
13889
|
|
|
13888
13890
|
// packages/chat/dialog/dialogSlice.ts
|
|
13889
13891
|
var runCreateDialogAction = async (args, thunkApi) => {
|
|
13890
|
-
const { createDialogAction } = await import("./createDialogAction-
|
|
13892
|
+
const { createDialogAction } = await import("./createDialogAction-ZVY45CNY.js");
|
|
13891
13893
|
return createDialogAction(args, thunkApi);
|
|
13892
13894
|
};
|
|
13893
13895
|
var runCreateAgentAutomationAction = async (args, thunkApi) => {
|
|
13894
|
-
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-
|
|
13896
|
+
const { createAgentAutomationAction } = await import("./createAgentAutomationAction-EONFRZYA.js");
|
|
13895
13897
|
return createAgentAutomationAction(args, thunkApi);
|
|
13896
13898
|
};
|
|
13897
13899
|
var runUpdateDialogTitleAction = async (args, thunkApi) => {
|
|
13898
|
-
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-
|
|
13900
|
+
const { updateDialogTitleAction } = await import("./updateDialogTitleAction-YMQAOVJ2.js");
|
|
13899
13901
|
return updateDialogTitleAction(args, thunkApi);
|
|
13900
13902
|
};
|
|
13901
13903
|
var runAddDialogAgentAction = async (args, thunkApi) => {
|
|
@@ -13919,7 +13921,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
|
|
|
13919
13921
|
return setDialogExtraReferencesAction(args, thunkApi);
|
|
13920
13922
|
};
|
|
13921
13923
|
var runHandleSendMessageAction = async (args, thunkApi) => {
|
|
13922
|
-
const { handleSendMessageAction } = await import("./handleSendMessageAction-
|
|
13924
|
+
const { handleSendMessageAction } = await import("./handleSendMessageAction-74EKQW4M.js");
|
|
13923
13925
|
return handleSendMessageAction(args, thunkApi);
|
|
13924
13926
|
};
|
|
13925
13927
|
function clearDialogState() {
|
|
@@ -13932,7 +13934,7 @@ var createPageAndAddReference = createAsyncThunk(
|
|
|
13932
13934
|
async (payload, { dispatch, getState, rejectWithValue }) => {
|
|
13933
13935
|
const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
|
|
13934
13936
|
try {
|
|
13935
|
-
const { createDocState } = await import("./docStore-
|
|
13937
|
+
const { createDocState } = await import("./docStore-PPUT7MQV.js");
|
|
13936
13938
|
const pageKey = await createDocState(
|
|
13937
13939
|
{ slateData, title },
|
|
13938
13940
|
{ dispatch, getState }
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-HS7MLR74.js";
|
|
4
4
|
import {
|
|
5
5
|
performServerProxyFetchWithRetry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J63HVOSX.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchServerSyncedCredential
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RABMW33C.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillGuidancePromptBlock
|
|
12
12
|
} from "./chunk-3LNVSFTH.js";
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
resolveReasoningReplayOptions,
|
|
33
33
|
shouldStripReasoningContentForOutbound,
|
|
34
34
|
stablePromptCacheKey
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ISIFZP3N.js";
|
|
36
36
|
import {
|
|
37
37
|
resolveAgentCallPlan,
|
|
38
38
|
resolveClientWire
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XAFCJN32.js";
|
|
40
40
|
import {
|
|
41
41
|
createFileCredentialBroker
|
|
42
42
|
} from "./chunk-76YUTLOT.js";
|
|
@@ -556,7 +556,7 @@ async function buildCreatedAgentRecord(args) {
|
|
|
556
556
|
const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
|
|
557
557
|
const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
|
|
558
558
|
if (args.parsed.presetId) {
|
|
559
|
-
const { resolveProviderPresetFields } = await import("./providerPresetApply-
|
|
559
|
+
const { resolveProviderPresetFields } = await import("./providerPresetApply-MBMGCNKZ.js");
|
|
560
560
|
const fields = resolveProviderPresetFields(args.parsed.presetId);
|
|
561
561
|
if (fields.kind === "manual") {
|
|
562
562
|
throw new Error(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchReferenceContents,
|
|
3
3
|
resolveReferenceAssets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-J63HVOSX.js";
|
|
5
5
|
import {
|
|
6
6
|
updateTokensAction
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LTWBOZE6.js";
|
|
8
8
|
import {
|
|
9
9
|
applyUpdateTokensFulfilled
|
|
10
10
|
} from "./chunk-OWYYDMGJ.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
extractReasoningFromResponseOutput,
|
|
13
13
|
extractTextFromResponseOutput,
|
|
14
14
|
extractToolCallsFromResponseOutput
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ISIFZP3N.js";
|
|
16
16
|
import {
|
|
17
17
|
isRecord
|
|
18
18
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listUserRecordsFromServers,
|
|
3
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RUKAOMXD.js";
|
|
5
5
|
import {
|
|
6
6
|
agentRecordHasConfiguredCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P34IX26T.js";
|
|
8
8
|
import {
|
|
9
9
|
deriveCredentialGroup
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KPSNHLFI.js";
|
|
11
11
|
import {
|
|
12
12
|
isTombstoneRecord
|
|
13
13
|
} from "./chunk-D2MDMY2M.js";
|
|
@@ -347,7 +347,7 @@ var slice = createSliceWithThunks({
|
|
|
347
347
|
const overrides = {};
|
|
348
348
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
349
349
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
350
|
-
const { _executeModel } = await import("./_executeModel-
|
|
350
|
+
const { _executeModel } = await import("./_executeModel-557MGBNC.js");
|
|
351
351
|
return _executeModel(
|
|
352
352
|
{
|
|
353
353
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -368,7 +368,7 @@ var slice = createSliceWithThunks({
|
|
|
368
368
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
369
369
|
*/
|
|
370
370
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
371
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
371
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-Z6STKR3Z.js");
|
|
372
372
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
373
373
|
{
|
|
374
374
|
agentKey: args.agentKey,
|
|
@@ -384,7 +384,7 @@ var slice = createSliceWithThunks({
|
|
|
384
384
|
* 聊天轮次流式 Agent 调用
|
|
385
385
|
*/
|
|
386
386
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
387
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
387
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-2ON7E6LT.js");
|
|
388
388
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
389
389
|
}),
|
|
390
390
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z4HDFBYK.js";
|
|
4
4
|
import {
|
|
5
5
|
format,
|
|
6
6
|
prepareAndPersistMessage,
|
|
7
7
|
uiAskChoiceFunc,
|
|
8
8
|
uiAskChoiceFunctionSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LTWBOZE6.js";
|
|
10
10
|
import {
|
|
11
11
|
formatISO
|
|
12
12
|
} from "./chunk-ZRAU6T47.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asTrimmedLowercaseString
|
|
3
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
4
|
+
|
|
5
|
+
// packages/agent-runtime/serverProxyPolicy.ts
|
|
6
|
+
var OAUTH_APIKEY_REFS = /* @__PURE__ */ new Set([
|
|
7
|
+
"antigravity",
|
|
8
|
+
"xai",
|
|
9
|
+
"chatgpt",
|
|
10
|
+
"claude",
|
|
11
|
+
"cursor"
|
|
12
|
+
]);
|
|
13
|
+
function isGoogleFamilyProvider(provider) {
|
|
14
|
+
const normalized = asTrimmedLowercaseString(provider);
|
|
15
|
+
return normalized === "google" || normalized.startsWith("google-");
|
|
16
|
+
}
|
|
17
|
+
function isOAuthApiKeyRef(value) {
|
|
18
|
+
const ref = asTrimmedLowercaseString(value);
|
|
19
|
+
return ref.length > 0 && OAUTH_APIKEY_REFS.has(ref);
|
|
20
|
+
}
|
|
21
|
+
function shouldUseServerProxy(agentConfig, requestProvider) {
|
|
22
|
+
const effectiveProvider = (requestProvider || agentConfig.provider || "").toLowerCase();
|
|
23
|
+
if (isGoogleFamilyProvider(effectiveProvider)) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (isOAuthApiKeyRef(agentConfig.apiKeyRef)) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (agentConfig.apiSource === "custom" && isRemoteCustomEndpoint(agentConfig.customProviderUrl)) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return !!agentConfig.useServerProxy;
|
|
33
|
+
}
|
|
34
|
+
var LOCAL_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "::1", "0.0.0.0"]);
|
|
35
|
+
function isRemoteCustomEndpoint(url) {
|
|
36
|
+
if (typeof url !== "string") return false;
|
|
37
|
+
try {
|
|
38
|
+
const host = new URL(url).hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
39
|
+
return !LOCAL_HOSTS.has(host);
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
isOAuthApiKeyRef,
|
|
47
|
+
shouldUseServerProxy
|
|
48
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
shouldUseServerProxy
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UKZX3NHN.js";
|
|
4
4
|
import {
|
|
5
5
|
ANTIGRAVITY_CLOUD_CODE_BASE_URL,
|
|
6
6
|
isAntigravityCloudCodeBaseUrl,
|
|
7
7
|
isAntigravityOAuthAgent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JOUFPRE4.js";
|
|
9
9
|
import {
|
|
10
10
|
isOpenAiResponsesModel,
|
|
11
11
|
resolvePlatformChatCompletionsEndpoint,
|