copilotkit 4.12.0 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/cli-build-info.json +7 -7
- package/index.js +1590 -348
- package/onboarding/index.json +20 -2
- package/onboarding/prompts/authenticate/start.md +38 -33
- package/onboarding/prompts/conversion/plan.md +3 -3
- package/onboarding/prompts/credentials/finalize-plan.md +9 -8
- package/onboarding/prompts/credentials/plan.md +26 -20
- package/onboarding/prompts/credentials/settle-credentials.md +8 -8
- package/onboarding/prompts/credentials/write-plan.md +19 -6
- package/onboarding/prompts/fallback/best-effort.md +6 -6
- package/onboarding/prompts/feature/a2ui/implement.md +6 -6
- package/onboarding/prompts/feature/a2ui/proof.md +6 -6
- package/onboarding/prompts/feature/a2ui/start.md +7 -7
- package/onboarding/prompts/feature/channels/implement.md +75 -12
- package/onboarding/prompts/feature/channels/proof.md +13 -6
- package/onboarding/prompts/feature/channels/start.md +27 -10
- package/onboarding/prompts/feature/chat-suggestions/implement.md +6 -6
- package/onboarding/prompts/feature/chat-suggestions/proof.md +6 -6
- package/onboarding/prompts/feature/chat-suggestions/start.md +7 -7
- package/onboarding/prompts/feature/complete.md +1 -1
- package/onboarding/prompts/feature/learning/implement.md +15 -15
- package/onboarding/prompts/feature/learning/proof.md +7 -7
- package/onboarding/prompts/feature/learning/start.md +8 -8
- package/onboarding/prompts/feature/open-generative-ui/implement.md +6 -6
- package/onboarding/prompts/feature/open-generative-ui/proof.md +6 -6
- package/onboarding/prompts/feature/open-generative-ui/start.md +7 -7
- package/onboarding/prompts/feature/realtime-sync/implement.md +7 -7
- package/onboarding/prompts/feature/realtime-sync/proof.md +6 -6
- package/onboarding/prompts/feature/realtime-sync/start.md +6 -6
- package/onboarding/prompts/feature/rich-threads/implement.md +8 -8
- package/onboarding/prompts/feature/rich-threads/proof.md +6 -6
- package/onboarding/prompts/feature/rich-threads/start.md +6 -6
- package/onboarding/prompts/feature/stop.md +2 -2
- package/onboarding/prompts/feature/voice/implement.md +6 -6
- package/onboarding/prompts/feature/voice/proof.md +6 -6
- package/onboarding/prompts/feature/voice/start.md +7 -7
- package/onboarding/prompts/framework/ag2.md +2 -2
- package/onboarding/prompts/framework/agno.md +2 -2
- package/onboarding/prompts/framework/built-in.md +4 -2
- package/onboarding/prompts/framework/claude-sdk-python.md +2 -2
- package/onboarding/prompts/framework/claude-sdk-typescript.md +2 -2
- package/onboarding/prompts/framework/crewai-flows.md +2 -2
- package/onboarding/prompts/framework/deep-agents.md +5 -2
- package/onboarding/prompts/framework/google-adk.md +4 -2
- package/onboarding/prompts/framework/langgraph-fastapi.md +4 -3
- package/onboarding/prompts/framework/langgraph-python.md +6 -2
- package/onboarding/prompts/framework/langgraph-typescript.md +6 -2
- package/onboarding/prompts/framework/llamaindex.md +2 -2
- package/onboarding/prompts/framework/mastra.md +4 -2
- package/onboarding/prompts/framework/ms-agent-dotnet.md +4 -2
- package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
- package/onboarding/prompts/framework/ms-agent-python.md +4 -2
- package/onboarding/prompts/framework/pydantic-ai.md +2 -2
- package/onboarding/prompts/framework/strands-python.md +4 -2
- package/onboarding/prompts/framework/strands-typescript.md +4 -2
- package/onboarding/prompts/frontend/angular.md +3 -3
- package/onboarding/prompts/frontend/nextjs.md +3 -3
- package/onboarding/prompts/frontend/plan.md +21 -10
- package/onboarding/prompts/frontend/react-native.md +2 -2
- package/onboarding/prompts/frontend/react-spa.md +2 -2
- package/onboarding/prompts/frontend/vue.md +2 -2
- package/onboarding/prompts/implementation/build-and-validate.md +33 -15
- package/onboarding/prompts/proof/complete.md +35 -16
- package/onboarding/prompts/proof/oss-baseline.md +5 -5
- package/onboarding/prompts/proof/round-trip.md +23 -12
- package/onboarding/prompts/research/gather.md +12 -102
- package/onboarding/prompts/research/merge.md +60 -0
- package/onboarding/prompts/research/preflight.md +75 -0
- package/onboarding/prompts/research/route.md +30 -6
- package/onboarding/prompts/starter/clone.md +5 -5
- package/onboarding/prompts/stopped/run-failed.md +2 -2
- package/onboarding/prompts/subagent/create-plan.md +18 -1
- package/onboarding/prompts/subagent/implement-and-validate.md +37 -0
- package/onboarding/prompts/subagent/inspect-repository.md +1 -1
- package/onboarding/prompts/subagent/prove-oss-baseline.md +1 -1
- package/onboarding/prompts/subagent/prove-round-trip.md +17 -7
- package/onboarding/prompts/unsupported/no-validated-path.md +2 -2
- package/package.json +4 -1
- package/release/release-tool.js +101 -1
package/index.js
CHANGED
|
@@ -41,12 +41,205 @@ var __toESM = (mod3, isNodeMode, target) => (target = mod3 != null ? __create(__
|
|
|
41
41
|
));
|
|
42
42
|
var __toCommonJS = (mod3) => __copyProps(__defProp({}, "__esModule", { value: true }), mod3);
|
|
43
43
|
|
|
44
|
+
// libs/feature-flags/src/registry.ts
|
|
45
|
+
function defineFlags(defs) {
|
|
46
|
+
return Object.fromEntries(
|
|
47
|
+
Object.entries(defs).map(([key, body]) => [key, { ...body, key }])
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
var FLAG_DEFINITIONS;
|
|
51
|
+
var init_registry = __esm({
|
|
52
|
+
"libs/feature-flags/src/registry.ts"() {
|
|
53
|
+
"use strict";
|
|
54
|
+
FLAG_DEFINITIONS = defineFlags({
|
|
55
|
+
// Ops can auto-deploy before App API, including in staging. Keep issuance
|
|
56
|
+
// off in every environment until all verifiers accept this signed claim.
|
|
57
|
+
"cli.organization-slug": {
|
|
58
|
+
purpose: "Include the Clerk organization slug in CLI product credentials after App API rollout.",
|
|
59
|
+
owner: "platform",
|
|
60
|
+
createdAt: "2026-09-17",
|
|
61
|
+
status: "rollout",
|
|
62
|
+
surfaces: ["ops-api"],
|
|
63
|
+
defaultByEnv: { dev: false, ci: false, prod: false },
|
|
64
|
+
envVar: "OPS_CLI_ORGANIZATION_SLUG_ENABLED"
|
|
65
|
+
},
|
|
66
|
+
// Self-hosted is a seam, not an offered choice yet (PE-94): the target moves
|
|
67
|
+
// only the app API URL, and no onboarding path offers it. Keep released
|
|
68
|
+
// binaries on managed until a self-hosted deployment can serve the product.
|
|
69
|
+
"cli.self-hosted-deployment": {
|
|
70
|
+
purpose: "Lets the CLI target a self-hosted Intelligence deployment through --deployment or COPILOTKIT_DEPLOYMENT.",
|
|
71
|
+
owner: "platform",
|
|
72
|
+
createdAt: "2026-09-22",
|
|
73
|
+
status: "rollout",
|
|
74
|
+
surfaces: ["cli"],
|
|
75
|
+
defaultByEnv: { dev: true, ci: true, prod: false }
|
|
76
|
+
},
|
|
77
|
+
"threads.bounded-replay": {
|
|
78
|
+
purpose: "Stage connect history on disk and require SDK acknowledgements for bounded delivery.",
|
|
79
|
+
owner: "realtime",
|
|
80
|
+
createdAt: "2026-09-16",
|
|
81
|
+
status: "rollout",
|
|
82
|
+
surfaces: ["realtime-gateway", "copilotkit-core"],
|
|
83
|
+
defaultByEnv: { dev: true, ci: true, prod: false },
|
|
84
|
+
envVar: "REALTIME_GATEWAY_BOUNDED_REPLAY_ENABLED"
|
|
85
|
+
},
|
|
86
|
+
// `active` (not `rollout`): a long-lived operational kill-switch, default-on
|
|
87
|
+
// in every env; `envVar` adopts the pre-existing INSPECT_ROUTES_ENABLED name.
|
|
88
|
+
"inspect.routes": {
|
|
89
|
+
purpose: "Gates the /api/_inspect/* introspection routes used by the web inspector; operational kill-switch.",
|
|
90
|
+
owner: "platform",
|
|
91
|
+
createdAt: "2026-06-23",
|
|
92
|
+
status: "active",
|
|
93
|
+
surfaces: ["app-api"],
|
|
94
|
+
defaultByEnv: { dev: true, ci: true, prod: true },
|
|
95
|
+
envVar: "INSPECT_ROUTES_ENABLED"
|
|
96
|
+
},
|
|
97
|
+
// Rollout flag for the in-progress Channels feature (OSS-373). Lets the
|
|
98
|
+
// SDK, UI, and infra land incrementally and deploy dark; production stays off
|
|
99
|
+
// until the rollout completes and the prod default is flipped in a later
|
|
100
|
+
// build. Server boundaries enforce it via the shared `resolveChannelsRollout`
|
|
101
|
+
// helper; `envVar` pins the pre-existing FF_MANAGED_BOTS toggle name so the
|
|
102
|
+
// operational override is byte-identical across the rename.
|
|
103
|
+
channels: {
|
|
104
|
+
purpose: "Gates the Channels feature (activation, listener, delivery, egress) so unfinished customer behavior stays dark until rollout completes.",
|
|
105
|
+
owner: "channels",
|
|
106
|
+
createdAt: "2026-06-25",
|
|
107
|
+
status: "rollout",
|
|
108
|
+
surfaces: ["app-api", "realtime-gateway", "app-frontend"],
|
|
109
|
+
defaultByEnv: { dev: true, ci: true, prod: false },
|
|
110
|
+
envVar: "FF_MANAGED_BOTS"
|
|
111
|
+
},
|
|
112
|
+
"managed-channels": {
|
|
113
|
+
purpose: "Canonical Managed Channels rollout gate, evaluated alongside the legacy FF_MANAGED_BOTS override while deployments migrate.",
|
|
114
|
+
owner: "channels",
|
|
115
|
+
createdAt: "2026-07-09",
|
|
116
|
+
status: "rollout",
|
|
117
|
+
surfaces: ["app-api", "realtime-gateway", "app-frontend"],
|
|
118
|
+
defaultByEnv: { dev: true, ci: true, prod: true }
|
|
119
|
+
},
|
|
120
|
+
"learning.platform-v1": {
|
|
121
|
+
purpose: "Gates the Learning V1 control API, runtime workers, product UI, and CLI download while the platform rolls out.",
|
|
122
|
+
owner: "learning",
|
|
123
|
+
createdAt: "2026-08-06",
|
|
124
|
+
status: "rollout",
|
|
125
|
+
surfaces: ["app-api", "app-frontend", "cli"],
|
|
126
|
+
defaultByEnv: { dev: false, ci: false, prod: false },
|
|
127
|
+
envVar: "LEARNING_ENABLED"
|
|
128
|
+
},
|
|
129
|
+
"analytics.pipeline": {
|
|
130
|
+
purpose: "Gates project-scoped analytics reads and realtime projection while the durable pipeline rolls out.",
|
|
131
|
+
owner: "analytics",
|
|
132
|
+
createdAt: "2026-08-16",
|
|
133
|
+
status: "rollout",
|
|
134
|
+
surfaces: ["app-api", "realtime-gateway"],
|
|
135
|
+
defaultByEnv: { dev: false, ci: false, prod: false },
|
|
136
|
+
envVar: "ANALYTICS_ENABLED"
|
|
137
|
+
},
|
|
138
|
+
"ops.stripe-billing-v1": {
|
|
139
|
+
purpose: "Gates the direct Stripe Checkout, Portal, projection, and provider-aware billing API during rollout.",
|
|
140
|
+
owner: "ops",
|
|
141
|
+
createdAt: "2026-09-08",
|
|
142
|
+
status: "rollout",
|
|
143
|
+
surfaces: ["ops-api"],
|
|
144
|
+
defaultByEnv: { dev: true, ci: true, prod: false }
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// libs/feature-flags/src/resolve.ts
|
|
151
|
+
function resolveEnvironment(env5) {
|
|
152
|
+
const explicit = env5.FF_ENV;
|
|
153
|
+
if (explicit === "dev" || explicit === "ci" || explicit === "prod") {
|
|
154
|
+
return explicit;
|
|
155
|
+
}
|
|
156
|
+
if (env5.CI === "true") {
|
|
157
|
+
return "ci";
|
|
158
|
+
}
|
|
159
|
+
if (env5.NODE_ENV === "production") {
|
|
160
|
+
return "prod";
|
|
161
|
+
}
|
|
162
|
+
return "dev";
|
|
163
|
+
}
|
|
164
|
+
function flagEnvVarName(def) {
|
|
165
|
+
return def.envVar ?? `FF_${def.key.toUpperCase().replace(/[.-]/g, "_")}`;
|
|
166
|
+
}
|
|
167
|
+
function resolveFlag(def, env5, environment = resolveEnvironment(env5)) {
|
|
168
|
+
const raw2 = env5[flagEnvVarName(def)];
|
|
169
|
+
if (raw2 === "true") {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
if (raw2 === "false") {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return def.defaultByEnv[environment];
|
|
176
|
+
}
|
|
177
|
+
function isFlagEnabled(key, env5, environment = resolveEnvironment(env5)) {
|
|
178
|
+
return resolveFlag(FLAG_DEFINITIONS[key], env5, environment);
|
|
179
|
+
}
|
|
180
|
+
var init_resolve = __esm({
|
|
181
|
+
"libs/feature-flags/src/resolve.ts"() {
|
|
182
|
+
"use strict";
|
|
183
|
+
init_registry();
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// libs/feature-flags/src/manifest.ts
|
|
188
|
+
var init_manifest = __esm({
|
|
189
|
+
"libs/feature-flags/src/manifest.ts"() {
|
|
190
|
+
"use strict";
|
|
191
|
+
init_registry();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// libs/feature-flags/src/ci.ts
|
|
196
|
+
var init_ci = __esm({
|
|
197
|
+
"libs/feature-flags/src/ci.ts"() {
|
|
198
|
+
"use strict";
|
|
199
|
+
init_registry();
|
|
200
|
+
init_resolve();
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// libs/feature-flags/src/index.ts
|
|
205
|
+
var init_src = __esm({
|
|
206
|
+
"libs/feature-flags/src/index.ts"() {
|
|
207
|
+
"use strict";
|
|
208
|
+
init_registry();
|
|
209
|
+
init_resolve();
|
|
210
|
+
init_manifest();
|
|
211
|
+
init_ci();
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// apps/cli/src/feature-flags.ts
|
|
216
|
+
function cliReleaseChannel() {
|
|
217
|
+
return true ? "release" : "local";
|
|
218
|
+
}
|
|
219
|
+
function resolveCliEnvironment(env5 = process.env, channel2 = cliReleaseChannel()) {
|
|
220
|
+
const explicit = env5.FF_ENV;
|
|
221
|
+
if (explicit === "dev" || explicit === "ci" || explicit === "prod") {
|
|
222
|
+
return explicit;
|
|
223
|
+
}
|
|
224
|
+
return channel2 === "release" ? "prod" : "dev";
|
|
225
|
+
}
|
|
226
|
+
function isCliFlagEnabled(key, env5 = process.env) {
|
|
227
|
+
return isFlagEnabled(key, env5, resolveCliEnvironment(env5));
|
|
228
|
+
}
|
|
229
|
+
var init_feature_flags = __esm({
|
|
230
|
+
"apps/cli/src/feature-flags.ts"() {
|
|
231
|
+
"use strict";
|
|
232
|
+
init_src();
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
44
236
|
// apps/cli/src/config.ts
|
|
45
237
|
var config_exports = {};
|
|
46
238
|
__export(config_exports, {
|
|
47
239
|
getAppApiUrl: () => getAppApiUrl,
|
|
48
240
|
getBuildInfo: () => getBuildInfo,
|
|
49
241
|
getC15tBackendUrl: () => getC15tBackendUrl,
|
|
242
|
+
getDeploymentTarget: () => getDeploymentTarget,
|
|
50
243
|
getHostedGatewayUrl: () => getHostedGatewayUrl,
|
|
51
244
|
getHostedRuntimeUrl: () => getHostedRuntimeUrl,
|
|
52
245
|
getHostedSlEnabled: () => getHostedSlEnabled,
|
|
@@ -59,12 +252,52 @@ __export(config_exports, {
|
|
|
59
252
|
getTeamsIngressBaseUrl: () => getTeamsIngressBaseUrl,
|
|
60
253
|
getTelemetryEndpointUrl: () => getTelemetryEndpointUrl,
|
|
61
254
|
getTemplateRef: () => getTemplateRef,
|
|
255
|
+
resetDeploymentTarget: () => resetDeploymentTarget,
|
|
62
256
|
setAppApiUrl: () => setAppApiUrl,
|
|
257
|
+
setDeploymentTarget: () => setDeploymentTarget,
|
|
63
258
|
setOpsApiUrl: () => setOpsApiUrl,
|
|
64
259
|
setOpsFrontendUrl: () => setOpsFrontendUrl,
|
|
65
260
|
setSlackIngressBaseUrl: () => setSlackIngressBaseUrl,
|
|
66
261
|
setTeamsIngressBaseUrl: () => setTeamsIngressBaseUrl
|
|
67
262
|
});
|
|
263
|
+
function setDeploymentTarget(target) {
|
|
264
|
+
if (target.name === "self-hosted" && !isCliFlagEnabled("cli.self-hosted-deployment")) {
|
|
265
|
+
throw new Error(
|
|
266
|
+
'Self-hosted deployments are not available in this CLI release. Use "managed".'
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
if (target.name === "self-hosted" && !target.appApiUrl?.trim()) {
|
|
270
|
+
throw new Error(
|
|
271
|
+
"A self-hosted deployment needs an app API URL. Pass --app-api-url, or set COPILOTKIT_APP_API_URL."
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
deploymentTarget = target;
|
|
275
|
+
}
|
|
276
|
+
function resetDeploymentTarget() {
|
|
277
|
+
deploymentTarget = null;
|
|
278
|
+
}
|
|
279
|
+
function getDeploymentTarget() {
|
|
280
|
+
if (deploymentTarget !== null) {
|
|
281
|
+
return deploymentTarget;
|
|
282
|
+
}
|
|
283
|
+
const named = process.env["COPILOTKIT_DEPLOYMENT"]?.trim();
|
|
284
|
+
if (named === void 0 || named === "") {
|
|
285
|
+
deploymentTarget = { name: "managed" };
|
|
286
|
+
return deploymentTarget;
|
|
287
|
+
}
|
|
288
|
+
if (named !== "managed" && named !== "self-hosted") {
|
|
289
|
+
throw new Error(
|
|
290
|
+
`Unknown deployment "${named}". Use "managed" or "self-hosted".`
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
const appApiUrl = process.env["COPILOTKIT_APP_API_URL"]?.trim();
|
|
294
|
+
const resolved = {
|
|
295
|
+
name: named,
|
|
296
|
+
...appApiUrl ? { appApiUrl } : {}
|
|
297
|
+
};
|
|
298
|
+
setDeploymentTarget(resolved);
|
|
299
|
+
return resolved;
|
|
300
|
+
}
|
|
68
301
|
function getOpsApiUrl() {
|
|
69
302
|
return opsApiUrlOverride ?? "https://api.operations.copilotkit.ai";
|
|
70
303
|
}
|
|
@@ -72,7 +305,7 @@ function setOpsApiUrl(url4) {
|
|
|
72
305
|
opsApiUrlOverride = url4;
|
|
73
306
|
}
|
|
74
307
|
function getAppApiUrl() {
|
|
75
|
-
return appApiUrlOverride ?? (true ? "https://api.intelligence.copilotkit.ai" : getHostedRuntimeUrl());
|
|
308
|
+
return appApiUrlOverride ?? getDeploymentTarget().appApiUrl ?? (true ? "https://api.intelligence.copilotkit.ai" : getHostedRuntimeUrl());
|
|
76
309
|
}
|
|
77
310
|
function setAppApiUrl(url4) {
|
|
78
311
|
appApiUrlOverride = url4;
|
|
@@ -109,14 +342,14 @@ function getTelemetryEndpointUrl() {
|
|
|
109
342
|
}
|
|
110
343
|
function getBuildInfo() {
|
|
111
344
|
return {
|
|
112
|
-
version: true ? "4.
|
|
113
|
-
buildNumber: true ? "
|
|
114
|
-
commitSha: true ? "
|
|
345
|
+
version: true ? "4.13.1" : "dev",
|
|
346
|
+
buildNumber: true ? "35769780196" : "dev",
|
|
347
|
+
commitSha: true ? "a629bd48ce4223ba2ea4fc1fb488973f8915807e" : "dev",
|
|
115
348
|
copilotKitCommit: getTemplateRef()
|
|
116
349
|
};
|
|
117
350
|
}
|
|
118
351
|
function getTemplateRef() {
|
|
119
|
-
return true ? "
|
|
352
|
+
return true ? "f8047217b909a3e18404034f31f47157c4312241" : "main";
|
|
120
353
|
}
|
|
121
354
|
function getC15tBackendUrl() {
|
|
122
355
|
return true ? "https://calm-hazelnut-joy-copilotkit.inth.app" : "";
|
|
@@ -136,15 +369,17 @@ function getPrivacyPolicyUrl() {
|
|
|
136
369
|
function getPrivacyPolicyVersion() {
|
|
137
370
|
return PRIVACY_POLICY_VERSION;
|
|
138
371
|
}
|
|
139
|
-
var opsApiUrlOverride, opsFrontendUrlOverride, appApiUrlOverride, teamsIngressBaseUrlOverride, slackIngressBaseUrlOverride, PRIVACY_POLICY_URL, PRIVACY_POLICY_VERSION;
|
|
372
|
+
var opsApiUrlOverride, opsFrontendUrlOverride, appApiUrlOverride, teamsIngressBaseUrlOverride, slackIngressBaseUrlOverride, deploymentTarget, PRIVACY_POLICY_URL, PRIVACY_POLICY_VERSION;
|
|
140
373
|
var init_config = __esm({
|
|
141
374
|
"apps/cli/src/config.ts"() {
|
|
142
375
|
"use strict";
|
|
376
|
+
init_feature_flags();
|
|
143
377
|
opsApiUrlOverride = null;
|
|
144
378
|
opsFrontendUrlOverride = null;
|
|
145
379
|
appApiUrlOverride = null;
|
|
146
380
|
teamsIngressBaseUrlOverride = null;
|
|
147
381
|
slackIngressBaseUrlOverride = null;
|
|
382
|
+
deploymentTarget = null;
|
|
148
383
|
PRIVACY_POLICY_URL = "https://www.copilotkit.ai/privacy-policy";
|
|
149
384
|
PRIVACY_POLICY_VERSION = "2026-06-04";
|
|
150
385
|
}
|
|
@@ -5656,24 +5891,24 @@ var require_fast_uri = __commonJS({
|
|
|
5656
5891
|
function normalize2(uri2, options) {
|
|
5657
5892
|
if (typeof uri2 === "string") {
|
|
5658
5893
|
uri2 = /** @type {T} */
|
|
5659
|
-
serialize3(
|
|
5894
|
+
serialize3(parse14(uri2, options), options);
|
|
5660
5895
|
} else if (typeof uri2 === "object") {
|
|
5661
5896
|
uri2 = /** @type {T} */
|
|
5662
|
-
|
|
5897
|
+
parse14(serialize3(uri2, options), options);
|
|
5663
5898
|
}
|
|
5664
5899
|
return uri2;
|
|
5665
5900
|
}
|
|
5666
5901
|
function resolve9(baseURI, relativeURI, options) {
|
|
5667
5902
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
5668
|
-
const resolved = resolveComponent(
|
|
5903
|
+
const resolved = resolveComponent(parse14(baseURI, schemelessOptions), parse14(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
5669
5904
|
schemelessOptions.skipEscape = true;
|
|
5670
5905
|
return serialize3(resolved, schemelessOptions);
|
|
5671
5906
|
}
|
|
5672
5907
|
function resolveComponent(base, relative7, options, skipNormalization) {
|
|
5673
5908
|
const target = {};
|
|
5674
5909
|
if (!skipNormalization) {
|
|
5675
|
-
base =
|
|
5676
|
-
relative7 =
|
|
5910
|
+
base = parse14(serialize3(base, options), options);
|
|
5911
|
+
relative7 = parse14(serialize3(relative7, options), options);
|
|
5677
5912
|
}
|
|
5678
5913
|
options = options || {};
|
|
5679
5914
|
if (!options.tolerant && relative7.scheme) {
|
|
@@ -5725,13 +5960,13 @@ var require_fast_uri = __commonJS({
|
|
|
5725
5960
|
function equal(uriA, uriB, options) {
|
|
5726
5961
|
if (typeof uriA === "string") {
|
|
5727
5962
|
uriA = unescape(uriA);
|
|
5728
|
-
uriA = serialize3(normalizeComponentEncoding(
|
|
5963
|
+
uriA = serialize3(normalizeComponentEncoding(parse14(uriA, options), true), { ...options, skipEscape: true });
|
|
5729
5964
|
} else if (typeof uriA === "object") {
|
|
5730
5965
|
uriA = serialize3(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
5731
5966
|
}
|
|
5732
5967
|
if (typeof uriB === "string") {
|
|
5733
5968
|
uriB = unescape(uriB);
|
|
5734
|
-
uriB = serialize3(normalizeComponentEncoding(
|
|
5969
|
+
uriB = serialize3(normalizeComponentEncoding(parse14(uriB, options), true), { ...options, skipEscape: true });
|
|
5735
5970
|
} else if (typeof uriB === "object") {
|
|
5736
5971
|
uriB = serialize3(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
5737
5972
|
}
|
|
@@ -5801,7 +6036,7 @@ var require_fast_uri = __commonJS({
|
|
|
5801
6036
|
return uriTokens.join("");
|
|
5802
6037
|
}
|
|
5803
6038
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
5804
|
-
function
|
|
6039
|
+
function parse14(uri2, opts) {
|
|
5805
6040
|
const options = Object.assign({}, opts);
|
|
5806
6041
|
const parsed = {
|
|
5807
6042
|
scheme: void 0,
|
|
@@ -5895,7 +6130,7 @@ var require_fast_uri = __commonJS({
|
|
|
5895
6130
|
resolveComponent,
|
|
5896
6131
|
equal,
|
|
5897
6132
|
serialize: serialize3,
|
|
5898
|
-
parse:
|
|
6133
|
+
parse: parse14
|
|
5899
6134
|
};
|
|
5900
6135
|
module2.exports = fastUri;
|
|
5901
6136
|
module2.exports.default = fastUri;
|
|
@@ -10285,7 +10520,7 @@ var require_parse = __commonJS({
|
|
|
10285
10520
|
"node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
10286
10521
|
"use strict";
|
|
10287
10522
|
var SemVer = require_semver();
|
|
10288
|
-
var
|
|
10523
|
+
var parse14 = (version6, options, throwErrors = false) => {
|
|
10289
10524
|
if (version6 instanceof SemVer) {
|
|
10290
10525
|
return version6;
|
|
10291
10526
|
}
|
|
@@ -10298,7 +10533,7 @@ var require_parse = __commonJS({
|
|
|
10298
10533
|
throw er;
|
|
10299
10534
|
}
|
|
10300
10535
|
};
|
|
10301
|
-
module2.exports =
|
|
10536
|
+
module2.exports = parse14;
|
|
10302
10537
|
}
|
|
10303
10538
|
});
|
|
10304
10539
|
|
|
@@ -10306,9 +10541,9 @@ var require_parse = __commonJS({
|
|
|
10306
10541
|
var require_valid = __commonJS({
|
|
10307
10542
|
"node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
10308
10543
|
"use strict";
|
|
10309
|
-
var
|
|
10544
|
+
var parse14 = require_parse();
|
|
10310
10545
|
var valid = (version6, options) => {
|
|
10311
|
-
const v =
|
|
10546
|
+
const v = parse14(version6, options);
|
|
10312
10547
|
return v ? v.version : null;
|
|
10313
10548
|
};
|
|
10314
10549
|
module2.exports = valid;
|
|
@@ -10319,9 +10554,9 @@ var require_valid = __commonJS({
|
|
|
10319
10554
|
var require_clean = __commonJS({
|
|
10320
10555
|
"node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
10321
10556
|
"use strict";
|
|
10322
|
-
var
|
|
10557
|
+
var parse14 = require_parse();
|
|
10323
10558
|
var clean = (version6, options) => {
|
|
10324
|
-
const s2 =
|
|
10559
|
+
const s2 = parse14(version6.trim().replace(/^[=v]+/, ""), options);
|
|
10325
10560
|
return s2 ? s2.version : null;
|
|
10326
10561
|
};
|
|
10327
10562
|
module2.exports = clean;
|
|
@@ -10356,10 +10591,10 @@ var require_inc = __commonJS({
|
|
|
10356
10591
|
var require_diff = __commonJS({
|
|
10357
10592
|
"node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
10358
10593
|
"use strict";
|
|
10359
|
-
var
|
|
10594
|
+
var parse14 = require_parse();
|
|
10360
10595
|
var diff2 = (version1, version22) => {
|
|
10361
|
-
const v13 =
|
|
10362
|
-
const v2 =
|
|
10596
|
+
const v13 = parse14(version1, null, true);
|
|
10597
|
+
const v2 = parse14(version22, null, true);
|
|
10363
10598
|
const comparison = v13.compare(v2);
|
|
10364
10599
|
if (comparison === 0) {
|
|
10365
10600
|
return null;
|
|
@@ -10430,9 +10665,9 @@ var require_patch = __commonJS({
|
|
|
10430
10665
|
var require_prerelease = __commonJS({
|
|
10431
10666
|
"node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
10432
10667
|
"use strict";
|
|
10433
|
-
var
|
|
10668
|
+
var parse14 = require_parse();
|
|
10434
10669
|
var prerelease = (version6, options) => {
|
|
10435
|
-
const parsed =
|
|
10670
|
+
const parsed = parse14(version6, options);
|
|
10436
10671
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
10437
10672
|
};
|
|
10438
10673
|
module2.exports = prerelease;
|
|
@@ -10618,7 +10853,7 @@ var require_coerce = __commonJS({
|
|
|
10618
10853
|
"node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
10619
10854
|
"use strict";
|
|
10620
10855
|
var SemVer = require_semver();
|
|
10621
|
-
var
|
|
10856
|
+
var parse14 = require_parse();
|
|
10622
10857
|
var { safeRe: re3, t: t3 } = require_re();
|
|
10623
10858
|
var coerce = (version6, options) => {
|
|
10624
10859
|
if (version6 instanceof SemVer) {
|
|
@@ -10653,7 +10888,7 @@ var require_coerce = __commonJS({
|
|
|
10653
10888
|
const patch = match2[4] || "0";
|
|
10654
10889
|
const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
|
10655
10890
|
const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
|
10656
|
-
return
|
|
10891
|
+
return parse14(`${major3}.${minor}.${patch}${prerelease}${build}`, options);
|
|
10657
10892
|
};
|
|
10658
10893
|
module2.exports = coerce;
|
|
10659
10894
|
}
|
|
@@ -11669,7 +11904,7 @@ var require_semver2 = __commonJS({
|
|
|
11669
11904
|
var constants3 = require_constants();
|
|
11670
11905
|
var SemVer = require_semver();
|
|
11671
11906
|
var identifiers = require_identifiers();
|
|
11672
|
-
var
|
|
11907
|
+
var parse14 = require_parse();
|
|
11673
11908
|
var valid = require_valid();
|
|
11674
11909
|
var clean = require_clean();
|
|
11675
11910
|
var inc = require_inc();
|
|
@@ -11707,7 +11942,7 @@ var require_semver2 = __commonJS({
|
|
|
11707
11942
|
var simplifyRange = require_simplify();
|
|
11708
11943
|
var subset = require_subset();
|
|
11709
11944
|
module2.exports = {
|
|
11710
|
-
parse:
|
|
11945
|
+
parse: parse14,
|
|
11711
11946
|
valid,
|
|
11712
11947
|
clean,
|
|
11713
11948
|
inc,
|
|
@@ -26858,6 +27093,66 @@ var init_zod = __esm({
|
|
|
26858
27093
|
}
|
|
26859
27094
|
});
|
|
26860
27095
|
|
|
27096
|
+
// libs/ops-contracts/src/billing.ts
|
|
27097
|
+
var billingProviderSchema, billingContextResponseSchema, paidSelfServicePlanCodeSchema, createCheckoutSessionRequestSchema, createCheckoutSessionResponseSchema, expireCheckoutSessionResponseSchema, checkoutReturnResponseSchema, createPortalSessionRequestSchema, createPortalSessionResponseSchema;
|
|
27098
|
+
var init_billing = __esm({
|
|
27099
|
+
"libs/ops-contracts/src/billing.ts"() {
|
|
27100
|
+
"use strict";
|
|
27101
|
+
init_zod();
|
|
27102
|
+
billingProviderSchema = external_exports.enum(["clerk", "stripe"]);
|
|
27103
|
+
billingContextResponseSchema = external_exports.object({
|
|
27104
|
+
billingProvider: billingProviderSchema
|
|
27105
|
+
}).strict();
|
|
27106
|
+
paidSelfServicePlanCodeSchema = external_exports.enum([
|
|
27107
|
+
"pro",
|
|
27108
|
+
"team",
|
|
27109
|
+
"team_self_hosted"
|
|
27110
|
+
]);
|
|
27111
|
+
createCheckoutSessionRequestSchema = external_exports.object({
|
|
27112
|
+
planCode: paidSelfServicePlanCodeSchema,
|
|
27113
|
+
// Omission preserves the prebuilt checkout for older deployed frontends.
|
|
27114
|
+
uiMode: external_exports.literal("elements").optional(),
|
|
27115
|
+
// An old request must never expire a checkout it has not observed.
|
|
27116
|
+
replacesCheckoutSessionId: external_exports.string().min(1).max(255).startsWith("cs_").optional()
|
|
27117
|
+
}).strict();
|
|
27118
|
+
createCheckoutSessionResponseSchema = external_exports.union([
|
|
27119
|
+
external_exports.object({
|
|
27120
|
+
clientSecret: external_exports.string().min(1),
|
|
27121
|
+
sessionId: external_exports.string().min(1).max(255).startsWith("cs_").optional(),
|
|
27122
|
+
// Present only when resuming an Elements checkout from an earlier attempt.
|
|
27123
|
+
checkoutAttemptId: external_exports.string().uuid().optional()
|
|
27124
|
+
}).strict(),
|
|
27125
|
+
external_exports.object({
|
|
27126
|
+
state: external_exports.literal("confirmation_required"),
|
|
27127
|
+
sessionId: external_exports.string().min(1),
|
|
27128
|
+
checkoutAttemptId: external_exports.string().uuid().optional()
|
|
27129
|
+
}).strict(),
|
|
27130
|
+
external_exports.object({
|
|
27131
|
+
state: external_exports.literal("recovery_required"),
|
|
27132
|
+
sessionId: external_exports.string().min(1).max(255).startsWith("cs_"),
|
|
27133
|
+
planCode: paidSelfServicePlanCodeSchema
|
|
27134
|
+
}).strict()
|
|
27135
|
+
]);
|
|
27136
|
+
expireCheckoutSessionResponseSchema = external_exports.object({ state: external_exports.literal("expired") }).strict();
|
|
27137
|
+
checkoutReturnResponseSchema = external_exports.discriminatedUnion("state", [
|
|
27138
|
+
external_exports.object({
|
|
27139
|
+
state: external_exports.literal("paid"),
|
|
27140
|
+
planCode: paidSelfServicePlanCodeSchema,
|
|
27141
|
+
quantity: external_exports.number().int().positive()
|
|
27142
|
+
}).strict(),
|
|
27143
|
+
external_exports.object({ state: external_exports.literal("processing") }).strict(),
|
|
27144
|
+
external_exports.object({ state: external_exports.literal("expired") }).strict()
|
|
27145
|
+
]);
|
|
27146
|
+
createPortalSessionRequestSchema = external_exports.object({}).strict();
|
|
27147
|
+
createPortalSessionResponseSchema = external_exports.object({
|
|
27148
|
+
portalUrl: external_exports.string().url().refine((value) => {
|
|
27149
|
+
const url4 = new URL(value);
|
|
27150
|
+
return url4.origin === "https://billing.stripe.com" && !url4.username && !url4.password;
|
|
27151
|
+
}, "Expected a Stripe Customer Portal URL.")
|
|
27152
|
+
}).strict();
|
|
27153
|
+
}
|
|
27154
|
+
});
|
|
27155
|
+
|
|
26861
27156
|
// libs/license-catalog/src/index.ts
|
|
26862
27157
|
function isFeatureId(feature) {
|
|
26863
27158
|
return FEATURE_IDS.includes(feature);
|
|
@@ -26866,7 +27161,7 @@ function getFeatureDefinition(feature) {
|
|
|
26866
27161
|
return isFeatureId(feature) ? LICENSED_FEATURES[feature] : null;
|
|
26867
27162
|
}
|
|
26868
27163
|
var PLAN_CODES, FEATURE_IDS, LICENSED_FEATURES, BASE_FEATURES, LICENSE_CATALOG;
|
|
26869
|
-
var
|
|
27164
|
+
var init_src2 = __esm({
|
|
26870
27165
|
"libs/license-catalog/src/index.ts"() {
|
|
26871
27166
|
"use strict";
|
|
26872
27167
|
PLAN_CODES = [
|
|
@@ -27349,7 +27644,10 @@ __export(src_exports, {
|
|
|
27349
27644
|
adminEnterpriseSubscriptionListResponseSchema: () => adminEnterpriseSubscriptionListResponseSchema,
|
|
27350
27645
|
adminEnterpriseSubscriptionResponseSchema: () => adminEnterpriseSubscriptionResponseSchema,
|
|
27351
27646
|
adminEnterpriseSubscriptionSchema: () => adminEnterpriseSubscriptionSchema,
|
|
27647
|
+
billingContextResponseSchema: () => billingContextResponseSchema,
|
|
27648
|
+
billingProviderSchema: () => billingProviderSchema,
|
|
27352
27649
|
catalogFeatureMapSchema: () => catalogFeatureMapSchema,
|
|
27650
|
+
checkoutReturnResponseSchema: () => checkoutReturnResponseSchema,
|
|
27353
27651
|
cliProductCredentialActorSchema: () => cliProductCredentialActorSchema,
|
|
27354
27652
|
cliProductCredentialCapabilitySchema: () => cliProductCredentialCapabilitySchema,
|
|
27355
27653
|
cliProductCredentialExchangeResponseSchema: () => cliProductCredentialExchangeResponseSchema,
|
|
@@ -27360,8 +27658,12 @@ __export(src_exports, {
|
|
|
27360
27658
|
cliTelemetryIdentityResponseSchema: () => cliTelemetryIdentityResponseSchema,
|
|
27361
27659
|
cliTelemetryProjectIdSchema: () => cliTelemetryProjectIdSchema,
|
|
27362
27660
|
createAdminEnterpriseSubscriptionRequestSchema: () => createAdminEnterpriseSubscriptionRequestSchema,
|
|
27661
|
+
createCheckoutSessionRequestSchema: () => createCheckoutSessionRequestSchema,
|
|
27662
|
+
createCheckoutSessionResponseSchema: () => createCheckoutSessionResponseSchema,
|
|
27363
27663
|
createHostedApiKeyRequestSchema: () => createHostedApiKeyRequestSchema,
|
|
27364
27664
|
createHostedProjectRequestSchema: () => createHostedProjectRequestSchema,
|
|
27665
|
+
createPortalSessionRequestSchema: () => createPortalSessionRequestSchema,
|
|
27666
|
+
createPortalSessionResponseSchema: () => createPortalSessionResponseSchema,
|
|
27365
27667
|
currentEntitlementResponseSchema: () => currentEntitlementResponseSchema,
|
|
27366
27668
|
currentWaitlistResponseSchema: () => currentWaitlistResponseSchema,
|
|
27367
27669
|
customerEffectiveEntitlementSchema: () => customerEffectiveEntitlementSchema,
|
|
@@ -27373,6 +27675,7 @@ __export(src_exports, {
|
|
|
27373
27675
|
entitlementGrantedEventSchema: () => entitlementGrantedEventSchema,
|
|
27374
27676
|
entitlementSourceSchema: () => entitlementSourceSchema,
|
|
27375
27677
|
entitlementStateSchema: () => entitlementStateSchema,
|
|
27678
|
+
expireCheckoutSessionResponseSchema: () => expireCheckoutSessionResponseSchema,
|
|
27376
27679
|
featureValueSchema: () => featureValueSchema,
|
|
27377
27680
|
hostedProjectApiKeyDeleteResponseSchema: () => hostedProjectApiKeyDeleteResponseSchema,
|
|
27378
27681
|
hostedProjectApiKeyListItemSchema: () => hostedProjectApiKeyListItemSchema,
|
|
@@ -27413,6 +27716,7 @@ __export(src_exports, {
|
|
|
27413
27716
|
organizationPlanSelectionGateSchema: () => organizationPlanSelectionGateSchema,
|
|
27414
27717
|
organizationPlanSelectionRequestSchema: () => organizationPlanSelectionRequestSchema,
|
|
27415
27718
|
organizationPlanSelectionResponseSchema: () => organizationPlanSelectionResponseSchema,
|
|
27719
|
+
paidSelfServicePlanCodeSchema: () => paidSelfServicePlanCodeSchema,
|
|
27416
27720
|
parseAdminEnterpriseSubscriptionDetailResponse: () => parseAdminEnterpriseSubscriptionDetailResponse,
|
|
27417
27721
|
parseAdminEnterpriseSubscriptionListResponse: () => parseAdminEnterpriseSubscriptionListResponse,
|
|
27418
27722
|
parseAdminEnterpriseSubscriptionResponse: () => parseAdminEnterpriseSubscriptionResponse,
|
|
@@ -27515,11 +27819,12 @@ function parseManagedFeatureAvailability(input) {
|
|
|
27515
27819
|
return managedFeatureAvailabilitySchema.parse(input);
|
|
27516
27820
|
}
|
|
27517
27821
|
var ENTITLEMENT_SOURCES, ENTITLEMENT_STATES, ENTERPRISE_SUBSCRIPTION_STATUSES, WAITLIST_OFFER_CODES, featureValueSchema, catalogFeatureMapSchema, enterpriseFeaturesSchema, adminClerkOrganizationSchema, enterpriseSubscriptionStatusSchema, planCodeSchema, organizationPlanSelectionGateCompletionReasonSchema, organizationPlanSelectionGateSchema, organizationPlanSelectionGateResponseSchema, organizationPlanSelectionGateRequestSchema, organizationPlanSelectionRequestSchema, organizationPlanSelectionResponseSchema, entitlementSourceSchema, entitlementStateSchema, waitlistOfferCodeSchema, joinWaitlistRequestSchema, waitlistEntrySchema, currentWaitlistResponseSchema, joinWaitlistResponseSchema, adminEnterpriseSubscriptionSchema, customerEffectiveEntitlementSchema, adminEffectiveEntitlementSchema, currentEntitlementResponseSchema, inspectorEntitlementProjectionVariants, inspectorEntitlementProjectionSchema, inspectorEntitlementProjectionTransportSchema, organizationEntitlementResponseSchema, customerEffectiveEntitlementTransportSchema, organizationEntitlementResponseTransportSchema, CLI_PRODUCT_CREDENTIAL_CAPABILITIES, APP_PROJECT_ID_MAX, CLI_TELEMETRY_BINDING_ID_MAX_LENGTH, cliTelemetryProjectIdSchema, cliTelemetryIdentityRequestSchema, cliTelemetryIdentityResponseSchema, cliProductCredentialCapabilitySchema, cliProductCredentialActorSchema, cliProductCredentialSchema, cliProductCredentialPayloadSchema, cliProductCredentialTokenPayloadSchema, cliProductCredentialExchangeResponseSchema, ACCOUNT_PROFILE_EMAIL_MAX_LENGTH, ACCOUNT_PROFILE_DISPLAY_NAME_MAX_LENGTH, ACCOUNT_PROFILE_AVATAR_URL_MAX_LENGTH, managedIntelligenceDestinationAppSchema, absoluteUrlSchema, managedHandoffTimestampSchema, emailValidationSchema, optionalAccountProfileEmailSchema, optionalAccountProfileDisplayNameSchema, optionalAccountProfileAvatarUrlSchema, nullableAccountProfileEmailSchema, nullableAccountProfileDisplayNameSchema, nullableAccountProfileAvatarUrlSchema, accountProfileSchema, managedClerkOrganizationSchema, managedHandoffActorSchema, managedIntelligenceSessionSchema, managedIntelligenceHandoffIssueRequestSchema, managedIntelligenceHandoffIssueResponseSchema, managedIntelligenceHandoffExchangeRequestSchema, managedIntelligenceHandoffExchangeResponseSchema, managedIntelligenceHandoffExchangeResponseTransportSchema, intelligenceAuthSessionResponseSchema, adminEnterpriseSubscriptionListResponseSchema, adminEnterpriseSubscriptionResponseSchema, adminEnterpriseSubscriptionDetailResponseSchema, createAdminEnterpriseSubscriptionRequestSchema, updateAdminEnterpriseSubscriptionRequestSchema, entitlementGrantedEventSchema, MANAGED_FEATURE_DISABLED_REASONS, managedFeatureDisabledReasonSchema, managedFeatureAvailabilitySchema, MANAGED_FEATURE_AVAILABLE, MANAGED_FEATURE_DISABLED_BY_FEATURE_FLAG, MANAGED_FEATURE_DISABLED_BY_ENTITLEMENT;
|
|
27518
|
-
var
|
|
27822
|
+
var init_src3 = __esm({
|
|
27519
27823
|
"libs/ops-contracts/src/index.ts"() {
|
|
27520
27824
|
"use strict";
|
|
27521
27825
|
init_zod();
|
|
27522
|
-
|
|
27826
|
+
init_billing();
|
|
27827
|
+
init_src2();
|
|
27523
27828
|
init_hosted_project();
|
|
27524
27829
|
init_managed_navigation();
|
|
27525
27830
|
ENTITLEMENT_SOURCES = [
|
|
@@ -27778,7 +28083,8 @@ var init_src2 = __esm({
|
|
|
27778
28083
|
token: true
|
|
27779
28084
|
});
|
|
27780
28085
|
cliProductCredentialTokenPayloadSchema = cliProductCredentialPayloadSchema.extend({
|
|
27781
|
-
organizationName: external_exports.string().trim().min(1).optional()
|
|
28086
|
+
organizationName: external_exports.string().trim().min(1).optional(),
|
|
28087
|
+
organizationSlug: external_exports.string().trim().min(1).optional()
|
|
27782
28088
|
}).strict();
|
|
27783
28089
|
cliProductCredentialExchangeResponseSchema = external_exports.object({
|
|
27784
28090
|
productCredential: cliProductCredentialSchema
|
|
@@ -27956,7 +28262,7 @@ var init_config_service = __esm({
|
|
|
27956
28262
|
"apps/cli/src/services/config.service.ts"() {
|
|
27957
28263
|
"use strict";
|
|
27958
28264
|
init_source();
|
|
27959
|
-
|
|
28265
|
+
init_src3();
|
|
27960
28266
|
opsContractsRuntime = src_exports;
|
|
27961
28267
|
opsContracts = opsContractsRuntime.default ?? opsContractsRuntime;
|
|
27962
28268
|
({ cliProductCredentialSchema: cliProductCredentialSchema2 } = opsContracts);
|
|
@@ -28186,7 +28492,20 @@ var init_project_config = __esm({
|
|
|
28186
28492
|
projectConfigSchema = external_exports.object({
|
|
28187
28493
|
projectId: external_exports.string().min(1),
|
|
28188
28494
|
projectSlug: external_exports.string().min(1),
|
|
28189
|
-
|
|
28495
|
+
/**
|
|
28496
|
+
* Clerk organization the selection was made under.
|
|
28497
|
+
*
|
|
28498
|
+
* Absent on a self-hosted deployment, which has no Clerk organization at
|
|
28499
|
+
* all. Demanding it made `.copilotkit/project.json` unparseable there, and
|
|
28500
|
+
* the symptom surfaced a long way from the cause: `verify` reported the
|
|
28501
|
+
* file "exists but could not be read" and failed `project_selected` on a
|
|
28502
|
+
* correctly wired project, because resolution never reached the contents
|
|
28503
|
+
* (PE-95).
|
|
28504
|
+
*
|
|
28505
|
+
* Optional, not loose. An empty string is still rejected: absent means
|
|
28506
|
+
* self-hosted, blank means something wrote a bug.
|
|
28507
|
+
*/
|
|
28508
|
+
clerkOrgId: external_exports.string().min(1).optional(),
|
|
28190
28509
|
telemetryBindingId: external_exports.string().trim().min(1).optional(),
|
|
28191
28510
|
/**
|
|
28192
28511
|
* Absolute URL of this project's CopilotKit runtime, when the project pins
|
|
@@ -28217,6 +28536,9 @@ function normalizeCodingAgent(_value) {
|
|
|
28217
28536
|
const normalized = _value?.trim().toLowerCase() ?? "";
|
|
28218
28537
|
return CODING_AGENT_PATTERN.test(normalized) ? normalized : "unknown";
|
|
28219
28538
|
}
|
|
28539
|
+
function codingAgentProperty(value) {
|
|
28540
|
+
return value === void 0 || value.trim() === "" ? {} : { coding_agent: normalizeCodingAgent(value) };
|
|
28541
|
+
}
|
|
28220
28542
|
function resolveOnboardingRepositoryRoot(cwd2) {
|
|
28221
28543
|
const canonicalCwd = canonicalizeDir(cwd2);
|
|
28222
28544
|
return findRepositoryRoot(canonicalCwd) ?? canonicalCwd;
|
|
@@ -28242,15 +28564,24 @@ function readBoundRun(store, root2) {
|
|
|
28242
28564
|
...intent === void 0 ? {} : { intent }
|
|
28243
28565
|
};
|
|
28244
28566
|
}
|
|
28245
|
-
function
|
|
28567
|
+
function continuesAnchoredRun(store, root2, bound, lookup) {
|
|
28568
|
+
if (lookup.runId !== void 0 && lookup.runId !== bound.runId)
|
|
28569
|
+
return false;
|
|
28570
|
+
const stored = readStoredRoute(store, stateKey("route", root2));
|
|
28571
|
+
return !(stored?.runId === bound.runId && stored.ended === true);
|
|
28572
|
+
}
|
|
28573
|
+
function resolveAnchoredRoot(dependencies, lookup = {}) {
|
|
28246
28574
|
const start = resolveOnboardingRepositoryRoot(dependencies.cwd);
|
|
28247
28575
|
const home = canonicalizeDir(homedir3());
|
|
28248
28576
|
const filesystemRoot = parse5(start).root;
|
|
28249
28577
|
let candidate = start;
|
|
28250
28578
|
while (true) {
|
|
28251
28579
|
const bound = readBoundRun(dependencies.store, candidate);
|
|
28252
|
-
if (bound.state === "live" && bound.anchored)
|
|
28253
|
-
|
|
28580
|
+
if (bound.state === "live" && bound.anchored) {
|
|
28581
|
+
if (candidate === start)
|
|
28582
|
+
return candidate;
|
|
28583
|
+
return continuesAnchoredRun(dependencies.store, candidate, bound, lookup) ? candidate : start;
|
|
28584
|
+
}
|
|
28254
28585
|
const parent = dirname3(candidate);
|
|
28255
28586
|
if (candidate === filesystemRoot || parent === candidate || parent === home || parent === filesystemRoot) {
|
|
28256
28587
|
return start;
|
|
@@ -28402,9 +28733,15 @@ function startOnboardingRun(dependencies, requestedRunId, requestedIntent) {
|
|
|
28402
28733
|
if (requestedIntent !== void 0 && !ONBOARDING_INTENT_PATTERN.test(requestedIntent)) {
|
|
28403
28734
|
throw new Error("Requested onboarding intent is invalid");
|
|
28404
28735
|
}
|
|
28405
|
-
const root2 = resolveAnchoredRoot(dependencies);
|
|
28406
|
-
const bound = readBoundRun(dependencies.store, root2);
|
|
28407
28736
|
const validRequestedRun = requestedRunId !== void 0 && RUN_ID_PATTERN.test(requestedRunId) ? requestedRunId : void 0;
|
|
28737
|
+
const project = resolveOnboardingRepositoryRoot(dependencies.cwd);
|
|
28738
|
+
const anchored = resolveAnchoredRoot(dependencies, {
|
|
28739
|
+
...validRequestedRun === void 0 ? {} : { runId: validRequestedRun }
|
|
28740
|
+
});
|
|
28741
|
+
const anchoredBinding = readBoundRun(dependencies.store, anchored);
|
|
28742
|
+
const continuesAnchor = anchoredBinding.state === "live" && (validRequestedRun === void 0 ? anchoredBinding.intent === requestedIntent : validRequestedRun === anchoredBinding.runId);
|
|
28743
|
+
const root2 = anchored === project || continuesAnchor ? anchored : project;
|
|
28744
|
+
const bound = root2 === anchored ? anchoredBinding : readBoundRun(dependencies.store, root2);
|
|
28408
28745
|
const continuesBoundRun = bound.state === "live" && bound.intent === requestedIntent;
|
|
28409
28746
|
const runId = validRequestedRun ?? (continuesBoundRun ? bound.runId : mintRunId(dependencies));
|
|
28410
28747
|
dependencies.store.set(stateKey("run", root2), {
|
|
@@ -34524,7 +34861,7 @@ function synthesiseLegacyState(input) {
|
|
|
34524
34861
|
};
|
|
34525
34862
|
}
|
|
34526
34863
|
var consentCategories, consentCategorySchema, consentStatusSchema, consentSourceSchema, decisionsSchema, consentStateSchema;
|
|
34527
|
-
var
|
|
34864
|
+
var init_src4 = __esm({
|
|
34528
34865
|
"libs/consent-contracts/src/index.ts"() {
|
|
34529
34866
|
"use strict";
|
|
34530
34867
|
init_zod();
|
|
@@ -34703,7 +35040,7 @@ var CATEGORY_MAP;
|
|
|
34703
35040
|
var init_c15t_consent_provider = __esm({
|
|
34704
35041
|
"apps/cli/src/services/consent/c15t-consent-provider.ts"() {
|
|
34705
35042
|
"use strict";
|
|
34706
|
-
|
|
35043
|
+
init_src4();
|
|
34707
35044
|
init_dist5();
|
|
34708
35045
|
init_cli_logs();
|
|
34709
35046
|
init_c15t_subject_id();
|
|
@@ -38583,7 +38920,7 @@ var init_wrapAssembly = __esm({
|
|
|
38583
38920
|
|
|
38584
38921
|
// node_modules/.pnpm/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/index.js
|
|
38585
38922
|
var Yoga, src_default;
|
|
38586
|
-
var
|
|
38923
|
+
var init_src5 = __esm({
|
|
38587
38924
|
async "node_modules/.pnpm/yoga-layout@3.2.1/node_modules/yoga-layout/dist/src/index.js"() {
|
|
38588
38925
|
"use strict";
|
|
38589
38926
|
init_yoga_wasm_base64_esm();
|
|
@@ -63673,7 +64010,7 @@ var createNode, appendChildNode, insertBeforeNode, removeChildNode, setAttribute
|
|
|
63673
64010
|
var init_dom = __esm({
|
|
63674
64011
|
async "node_modules/.pnpm/ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4/node_modules/ink/build/dom.js"() {
|
|
63675
64012
|
"use strict";
|
|
63676
|
-
await
|
|
64013
|
+
await init_src5();
|
|
63677
64014
|
init_measure_text();
|
|
63678
64015
|
init_wrap_text();
|
|
63679
64016
|
init_squash_text_nodes();
|
|
@@ -63799,7 +64136,7 @@ var applyPositionStyles, applyMarginStyles, applyPaddingStyles, applyFlexStyles,
|
|
|
63799
64136
|
var init_styles = __esm({
|
|
63800
64137
|
async "node_modules/.pnpm/ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4/node_modules/ink/build/styles.js"() {
|
|
63801
64138
|
"use strict";
|
|
63802
|
-
await
|
|
64139
|
+
await init_src5();
|
|
63803
64140
|
applyPositionStyles = (node, style) => {
|
|
63804
64141
|
if ("position" in style) {
|
|
63805
64142
|
node.setPositionType(style.position === "absolute" ? src_default.POSITION_TYPE_ABSOLUTE : src_default.POSITION_TYPE_RELATIVE);
|
|
@@ -66101,7 +66438,7 @@ var require_extension = __commonJS({
|
|
|
66101
66438
|
else
|
|
66102
66439
|
dest[name].push(elem);
|
|
66103
66440
|
}
|
|
66104
|
-
function
|
|
66441
|
+
function parse14(header) {
|
|
66105
66442
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
66106
66443
|
let params = /* @__PURE__ */ Object.create(null);
|
|
66107
66444
|
let mustUnescape = false;
|
|
@@ -66256,7 +66593,7 @@ var require_extension = __commonJS({
|
|
|
66256
66593
|
}).join(", ");
|
|
66257
66594
|
}).join(", ");
|
|
66258
66595
|
}
|
|
66259
|
-
module2.exports = { format: format3, parse:
|
|
66596
|
+
module2.exports = { format: format3, parse: parse14 };
|
|
66260
66597
|
}
|
|
66261
66598
|
});
|
|
66262
66599
|
|
|
@@ -66269,7 +66606,7 @@ var require_websocket = __commonJS({
|
|
|
66269
66606
|
var http4 = __require("http");
|
|
66270
66607
|
var net = __require("net");
|
|
66271
66608
|
var tls = __require("tls");
|
|
66272
|
-
var { randomBytes: randomBytes4, createHash:
|
|
66609
|
+
var { randomBytes: randomBytes4, createHash: createHash9 } = __require("crypto");
|
|
66273
66610
|
var { Duplex, Readable: Readable5 } = __require("stream");
|
|
66274
66611
|
var { URL: URL7 } = __require("url");
|
|
66275
66612
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -66290,7 +66627,7 @@ var require_websocket = __commonJS({
|
|
|
66290
66627
|
var {
|
|
66291
66628
|
EventTarget: { addEventListener, removeEventListener }
|
|
66292
66629
|
} = require_event_target();
|
|
66293
|
-
var { format: format3, parse:
|
|
66630
|
+
var { format: format3, parse: parse14 } = require_extension();
|
|
66294
66631
|
var { toBuffer } = require_buffer_util();
|
|
66295
66632
|
var kAborted = Symbol("kAborted");
|
|
66296
66633
|
var protocolVersions = [8, 13];
|
|
@@ -66949,7 +67286,7 @@ var require_websocket = __commonJS({
|
|
|
66949
67286
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
66950
67287
|
return;
|
|
66951
67288
|
}
|
|
66952
|
-
const digest =
|
|
67289
|
+
const digest = createHash9("sha1").update(key + GUID).digest("base64");
|
|
66953
67290
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
66954
67291
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
66955
67292
|
return;
|
|
@@ -66980,7 +67317,7 @@ var require_websocket = __commonJS({
|
|
|
66980
67317
|
}
|
|
66981
67318
|
let extensions;
|
|
66982
67319
|
try {
|
|
66983
|
-
extensions =
|
|
67320
|
+
extensions = parse14(secWebSocketExtensions);
|
|
66984
67321
|
} catch (err2) {
|
|
66985
67322
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
66986
67323
|
abortHandshake(websocket, socket, message);
|
|
@@ -67286,7 +67623,7 @@ var require_subprotocol = __commonJS({
|
|
|
67286
67623
|
"node_modules/.pnpm/ws@8.19.0/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
|
|
67287
67624
|
"use strict";
|
|
67288
67625
|
var { tokenChars } = require_validation3();
|
|
67289
|
-
function
|
|
67626
|
+
function parse14(header) {
|
|
67290
67627
|
const protocols = /* @__PURE__ */ new Set();
|
|
67291
67628
|
let start = -1;
|
|
67292
67629
|
let end = -1;
|
|
@@ -67325,7 +67662,7 @@ var require_subprotocol = __commonJS({
|
|
|
67325
67662
|
protocols.add(protocol);
|
|
67326
67663
|
return protocols;
|
|
67327
67664
|
}
|
|
67328
|
-
module2.exports = { parse:
|
|
67665
|
+
module2.exports = { parse: parse14 };
|
|
67329
67666
|
}
|
|
67330
67667
|
});
|
|
67331
67668
|
|
|
@@ -67336,7 +67673,7 @@ var require_websocket_server = __commonJS({
|
|
|
67336
67673
|
var EventEmitter4 = __require("events");
|
|
67337
67674
|
var http4 = __require("http");
|
|
67338
67675
|
var { Duplex } = __require("stream");
|
|
67339
|
-
var { createHash:
|
|
67676
|
+
var { createHash: createHash9 } = __require("crypto");
|
|
67340
67677
|
var extension2 = require_extension();
|
|
67341
67678
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
67342
67679
|
var subprotocol2 = require_subprotocol();
|
|
@@ -67645,7 +67982,7 @@ var require_websocket_server = __commonJS({
|
|
|
67645
67982
|
}
|
|
67646
67983
|
if (this._state > RUNNING)
|
|
67647
67984
|
return abortHandshake(socket, 503);
|
|
67648
|
-
const digest =
|
|
67985
|
+
const digest = createHash9("sha1").update(key + GUID).digest("base64");
|
|
67649
67986
|
const headers = [
|
|
67650
67987
|
"HTTP/1.1 101 Switching Protocols",
|
|
67651
67988
|
"Upgrade: websocket",
|
|
@@ -84860,7 +85197,7 @@ var init_reconciler = __esm({
|
|
|
84860
85197
|
import_react_reconciler = __toESM(require_react_reconciler(), 1);
|
|
84861
85198
|
import_constants8 = __toESM(require_constants3(), 1);
|
|
84862
85199
|
Scheduler = __toESM(require_scheduler(), 1);
|
|
84863
|
-
await
|
|
85200
|
+
await init_src5();
|
|
84864
85201
|
import_react = __toESM(require_react(), 1);
|
|
84865
85202
|
await init_dom();
|
|
84866
85203
|
await init_styles();
|
|
@@ -85164,7 +85501,7 @@ var getMaxWidth, get_max_width_default;
|
|
|
85164
85501
|
var init_get_max_width = __esm({
|
|
85165
85502
|
async "node_modules/.pnpm/ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4/node_modules/ink/build/get-max-width.js"() {
|
|
85166
85503
|
"use strict";
|
|
85167
|
-
await
|
|
85504
|
+
await init_src5();
|
|
85168
85505
|
getMaxWidth = (yogaNode) => {
|
|
85169
85506
|
return yogaNode.getComputedWidth() - yogaNode.getComputedPadding(src_default.EDGE_LEFT) - yogaNode.getComputedPadding(src_default.EDGE_RIGHT) - yogaNode.getComputedBorder(src_default.EDGE_LEFT) - yogaNode.getComputedBorder(src_default.EDGE_RIGHT);
|
|
85170
85507
|
};
|
|
@@ -85946,7 +86283,7 @@ var init_render_node_to_output = __esm({
|
|
|
85946
86283
|
"use strict";
|
|
85947
86284
|
init_widest_line();
|
|
85948
86285
|
init_indent_string();
|
|
85949
|
-
await
|
|
86286
|
+
await init_src5();
|
|
85950
86287
|
init_wrap_text();
|
|
85951
86288
|
await init_get_max_width();
|
|
85952
86289
|
init_squash_text_nodes();
|
|
@@ -88218,7 +88555,7 @@ var init_App = __esm({
|
|
|
88218
88555
|
});
|
|
88219
88556
|
|
|
88220
88557
|
// node_modules/.pnpm/ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4/node_modules/ink/build/kitty-keyboard.js
|
|
88221
|
-
function
|
|
88558
|
+
function resolveFlags2(flags) {
|
|
88222
88559
|
let result = 0;
|
|
88223
88560
|
for (const flag of flags) {
|
|
88224
88561
|
result |= kittyFlags[flag];
|
|
@@ -88263,7 +88600,7 @@ var init_ink = __esm({
|
|
|
88263
88600
|
import_signal_exit2 = __toESM(require_signal_exit(), 1);
|
|
88264
88601
|
init_dist6();
|
|
88265
88602
|
import_constants9 = __toESM(require_constants3(), 1);
|
|
88266
|
-
await
|
|
88603
|
+
await init_src5();
|
|
88267
88604
|
init_wrap_ansi();
|
|
88268
88605
|
init_terminal_size();
|
|
88269
88606
|
init_utils();
|
|
@@ -88811,7 +89148,7 @@ var init_ink = __esm({
|
|
|
88811
89148
|
stdout.write("\x1B[?u");
|
|
88812
89149
|
}
|
|
88813
89150
|
enableKittyProtocol(flags) {
|
|
88814
|
-
this.options.stdout.write(`\x1B[>${
|
|
89151
|
+
this.options.stdout.write(`\x1B[>${resolveFlags2(flags)}u`);
|
|
88815
89152
|
this.kittyProtocolEnabled = true;
|
|
88816
89153
|
}
|
|
88817
89154
|
};
|
|
@@ -88880,7 +89217,7 @@ var import_constants10;
|
|
|
88880
89217
|
var init_render_to_string = __esm({
|
|
88881
89218
|
async "node_modules/.pnpm/ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4/node_modules/ink/build/render-to-string.js"() {
|
|
88882
89219
|
"use strict";
|
|
88883
|
-
await
|
|
89220
|
+
await init_src5();
|
|
88884
89221
|
import_constants10 = __toESM(require_constants3(), 1);
|
|
88885
89222
|
await init_reconciler();
|
|
88886
89223
|
await init_renderer();
|
|
@@ -90454,7 +90791,7 @@ var CONSENT_STATE_KEY, LEGACY_OPT_OUT_KEY;
|
|
|
90454
90791
|
var init_persistence = __esm({
|
|
90455
90792
|
"apps/cli/src/services/consent/persistence.ts"() {
|
|
90456
90793
|
"use strict";
|
|
90457
|
-
|
|
90794
|
+
init_src4();
|
|
90458
90795
|
init_cli_logs();
|
|
90459
90796
|
CONSENT_STATE_KEY = "consent.state";
|
|
90460
90797
|
LEGACY_OPT_OUT_KEY = "telemetry.optOut";
|
|
@@ -90519,7 +90856,7 @@ function createCliPromptConsentProvider(deps) {
|
|
|
90519
90856
|
var init_cli_prompt_consent_provider = __esm({
|
|
90520
90857
|
async "apps/cli/src/services/consent/cli-prompt-consent-provider.ts"() {
|
|
90521
90858
|
"use strict";
|
|
90522
|
-
|
|
90859
|
+
init_src4();
|
|
90523
90860
|
await init_consent_runner();
|
|
90524
90861
|
init_persistence();
|
|
90525
90862
|
}
|
|
@@ -90558,7 +90895,7 @@ var TRUTHY;
|
|
|
90558
90895
|
var init_gate = __esm({
|
|
90559
90896
|
"apps/cli/src/services/consent/gate.ts"() {
|
|
90560
90897
|
"use strict";
|
|
90561
|
-
|
|
90898
|
+
init_src4();
|
|
90562
90899
|
TRUTHY = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
90563
90900
|
}
|
|
90564
90901
|
});
|
|
@@ -91204,6 +91541,7 @@ __export(telemetry_exports, {
|
|
|
91204
91541
|
getTelemetry: () => getTelemetry,
|
|
91205
91542
|
hasStandaloneTelemetryIdentityConsent: () => hasStandaloneTelemetryIdentityConsent,
|
|
91206
91543
|
linkConsentSubjectToUser: () => linkConsentSubjectToUser,
|
|
91544
|
+
recordAbandonedInvocation: () => recordAbandonedInvocation,
|
|
91207
91545
|
recordTelemetryEvent: () => recordTelemetryEvent,
|
|
91208
91546
|
resolveReturnedOutcome: () => resolveReturnedOutcome,
|
|
91209
91547
|
submitTelemetryEvent: () => submitTelemetryEvent,
|
|
@@ -91321,7 +91659,52 @@ function recordTelemetryEvent(event) {
|
|
|
91321
91659
|
});
|
|
91322
91660
|
if (!gate.send)
|
|
91323
91661
|
return;
|
|
91324
|
-
|
|
91662
|
+
for (const paired of pairCommandBookends(event)) {
|
|
91663
|
+
getTelemetry().recordEvent(withProjectIdentity(paired));
|
|
91664
|
+
}
|
|
91665
|
+
}
|
|
91666
|
+
function isCommandLifecycle(event) {
|
|
91667
|
+
return (event.event === void 0 || event.event === CLI_TELEMETRY_EVENT_NAME) && event.properties.outcome !== void 0;
|
|
91668
|
+
}
|
|
91669
|
+
function pairCommandBookends(event) {
|
|
91670
|
+
if (!isCommandLifecycle(event))
|
|
91671
|
+
return [event];
|
|
91672
|
+
if (event.properties.outcome === "started") {
|
|
91673
|
+
if (openInvocation !== null || invocationSettled)
|
|
91674
|
+
return [];
|
|
91675
|
+
openInvocation = { properties: event.properties, startedAt: Date.now() };
|
|
91676
|
+
return [event];
|
|
91677
|
+
}
|
|
91678
|
+
if (invocationSettled)
|
|
91679
|
+
return [];
|
|
91680
|
+
invocationSettled = true;
|
|
91681
|
+
if (openInvocation !== null) {
|
|
91682
|
+
openInvocation = null;
|
|
91683
|
+
return [event];
|
|
91684
|
+
}
|
|
91685
|
+
const opening = { ...event.properties };
|
|
91686
|
+
delete opening.outcome;
|
|
91687
|
+
delete opening.error_code;
|
|
91688
|
+
delete opening.duration_ms;
|
|
91689
|
+
return [
|
|
91690
|
+
{ ...event, properties: { ...opening, outcome: "started" } },
|
|
91691
|
+
event
|
|
91692
|
+
];
|
|
91693
|
+
}
|
|
91694
|
+
function settleOpenInvocation(outcome) {
|
|
91695
|
+
if (openInvocation === null || invocationSettled)
|
|
91696
|
+
return;
|
|
91697
|
+
const { properties, startedAt } = openInvocation;
|
|
91698
|
+
recordTelemetryEvent({
|
|
91699
|
+
properties: {
|
|
91700
|
+
...properties,
|
|
91701
|
+
outcome,
|
|
91702
|
+
duration_ms: Date.now() - startedAt
|
|
91703
|
+
}
|
|
91704
|
+
});
|
|
91705
|
+
}
|
|
91706
|
+
function recordAbandonedInvocation() {
|
|
91707
|
+
settleOpenInvocation("abandoned");
|
|
91325
91708
|
}
|
|
91326
91709
|
async function submitTelemetryEvent(event) {
|
|
91327
91710
|
const buildInfo = getBuildInfo();
|
|
@@ -91389,6 +91772,7 @@ async function flushTelemetry(timeoutMs = DEFAULT_FLUSH_TIMEOUT_MS) {
|
|
|
91389
91772
|
await instance.flush(timeoutMs);
|
|
91390
91773
|
}
|
|
91391
91774
|
async function exitWithFlush(code) {
|
|
91775
|
+
settleOpenInvocation(code === 0 ? "succeeded" : "failed");
|
|
91392
91776
|
await flushTelemetry();
|
|
91393
91777
|
process.exit(code);
|
|
91394
91778
|
}
|
|
@@ -91519,11 +91903,13 @@ function __resetTelemetryForTests() {
|
|
|
91519
91903
|
instance = null;
|
|
91520
91904
|
consentProviderInstance = null;
|
|
91521
91905
|
recordedTelemetryIdCache = void 0;
|
|
91906
|
+
openInvocation = null;
|
|
91907
|
+
invocationSettled = false;
|
|
91522
91908
|
}
|
|
91523
91909
|
function __setConsentProviderForTests(provider) {
|
|
91524
91910
|
consentProviderInstance = provider;
|
|
91525
91911
|
}
|
|
91526
|
-
var instance, consentProviderInstance, cliLogTelemetryLogger, recordedTelemetryIdCache;
|
|
91912
|
+
var instance, consentProviderInstance, cliLogTelemetryLogger, recordedTelemetryIdCache, openInvocation, invocationSettled;
|
|
91527
91913
|
var init_telemetry = __esm({
|
|
91528
91914
|
async "apps/cli/src/services/telemetry/index.ts"() {
|
|
91529
91915
|
"use strict";
|
|
@@ -91552,6 +91938,8 @@ var init_telemetry = __esm({
|
|
|
91552
91938
|
warn: (payload) => writeCliLog("info", payload),
|
|
91553
91939
|
error: (payload) => writeCliLog("error", payload)
|
|
91554
91940
|
};
|
|
91941
|
+
openInvocation = null;
|
|
91942
|
+
invocationSettled = false;
|
|
91555
91943
|
}
|
|
91556
91944
|
});
|
|
91557
91945
|
|
|
@@ -91921,6 +92309,30 @@ function createApiClient(baseUrl, token, options = {}) {
|
|
|
91921
92309
|
}
|
|
91922
92310
|
return res.json();
|
|
91923
92311
|
},
|
|
92312
|
+
/**
|
|
92313
|
+
* Redeems a short sign-in code for a CLI session.
|
|
92314
|
+
*
|
|
92315
|
+
* @param code - The code the browser displayed or the callback delivered.
|
|
92316
|
+
* @param codeVerifier - The PKCE verifier this process generated.
|
|
92317
|
+
* @param telemetryInstallationId - Anonymous installation id to bind, or
|
|
92318
|
+
* omitted when telemetry is disabled or the CLI is running in CI.
|
|
92319
|
+
* @returns The parsed {@link AuthPayload} containing the CLI session token.
|
|
92320
|
+
*/
|
|
92321
|
+
async exchangeAuthorizationCode(code, codeVerifier, telemetryInstallationId) {
|
|
92322
|
+
const res = await fetchWithTimeout(`${baseUrl}/api/cli/auth/session`, {
|
|
92323
|
+
method: "POST",
|
|
92324
|
+
headers: { "Content-Type": "application/json" },
|
|
92325
|
+
body: JSON.stringify({
|
|
92326
|
+
code,
|
|
92327
|
+
codeVerifier,
|
|
92328
|
+
...telemetryInstallationId === void 0 ? {} : { telemetryInstallationId }
|
|
92329
|
+
})
|
|
92330
|
+
});
|
|
92331
|
+
if (!res.ok) {
|
|
92332
|
+
throw await readApiError(res);
|
|
92333
|
+
}
|
|
92334
|
+
return res.json();
|
|
92335
|
+
},
|
|
91924
92336
|
async verifySession(telemetryInstallationId) {
|
|
91925
92337
|
const query = telemetryInstallationId === void 0 ? "" : `?telemetryInstallationId=${encodeURIComponent(telemetryInstallationId)}`;
|
|
91926
92338
|
const res = await retryTransient(async () => {
|
|
@@ -92100,7 +92512,7 @@ var init_api_client = __esm({
|
|
|
92100
92512
|
"apps/cli/src/services/api-client.ts"() {
|
|
92101
92513
|
"use strict";
|
|
92102
92514
|
init_zod();
|
|
92103
|
-
|
|
92515
|
+
init_src3();
|
|
92104
92516
|
opsContractsRuntime2 = src_exports;
|
|
92105
92517
|
opsContracts2 = opsContractsRuntime2.default ?? opsContractsRuntime2;
|
|
92106
92518
|
({
|
|
@@ -93017,17 +93429,29 @@ var init_open = __esm({
|
|
|
93017
93429
|
// apps/cli/src/services/auth.service.ts
|
|
93018
93430
|
var auth_service_exports = {};
|
|
93019
93431
|
__export(auth_service_exports, {
|
|
93432
|
+
MANUAL_LOGIN_ONLY_ENV_VAR: () => MANUAL_LOGIN_ONLY_ENV_VAR,
|
|
93020
93433
|
TERMINAL_SESSION_INVALID_MESSAGE: () => TERMINAL_SESSION_INVALID_MESSAGE,
|
|
93021
93434
|
clearAuthOnTerminalSessionInvalidation: () => clearAuthOnTerminalSessionInvalidation,
|
|
93435
|
+
createPkcePair: () => createPkcePair,
|
|
93436
|
+
isManualLoginOnlyEnabled: () => isManualLoginOnlyEnabled,
|
|
93022
93437
|
isTerminalSessionInvalidationError: () => isTerminalSessionInvalidationError,
|
|
93023
93438
|
login: () => login,
|
|
93024
93439
|
logout: () => logout,
|
|
93025
|
-
|
|
93440
|
+
raceForAuthCode: () => raceForAuthCode,
|
|
93026
93441
|
startCallbackServer: () => startCallbackServer,
|
|
93027
93442
|
verifyAndRefresh: () => verifyAndRefresh
|
|
93028
93443
|
});
|
|
93029
93444
|
import * as crypto3 from "crypto";
|
|
93030
93445
|
import * as http from "http";
|
|
93446
|
+
function createPkcePair() {
|
|
93447
|
+
const codeVerifier = crypto3.randomBytes(32).toString("base64url");
|
|
93448
|
+
const codeChallenge = crypto3.createHash("sha256").update(codeVerifier).digest("base64url");
|
|
93449
|
+
return { codeVerifier, codeChallenge };
|
|
93450
|
+
}
|
|
93451
|
+
function isManualLoginOnlyEnabled() {
|
|
93452
|
+
const value = process.env[MANUAL_LOGIN_ONLY_ENV_VAR]?.trim().toLowerCase();
|
|
93453
|
+
return value === "1" || value === "true";
|
|
93454
|
+
}
|
|
93031
93455
|
function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
93032
93456
|
const diagnostics = createCliAuthDiagnostics(expectedState);
|
|
93033
93457
|
diagnostics.logPhase("callback-server.starting", {
|
|
@@ -93051,6 +93475,26 @@ function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
|
93051
93475
|
<html><head><meta charset="utf-8"><title>Sign-in failed</title>
|
|
93052
93476
|
<style>body{font-family:-apple-system,system-ui,sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0;color:#111}main{text-align:center;max-width:420px;padding:2rem}h1{font-size:1.25rem;margin:0 0 .5rem;color:#c0392b}p{color:#555;font-size:.95rem;line-height:1.5;margin:0}</style>
|
|
93053
93477
|
</head><body><main><h1>Sign-in failed</h1><p>${msg}</p></main></body></html>`;
|
|
93478
|
+
const MANUAL_ONLY_HTML = (code) => `<!doctype html>
|
|
93479
|
+
<html><head><meta charset="utf-8"><title>Automatic sign-in blocked</title>
|
|
93480
|
+
<style>body{font-family:-apple-system,system-ui,sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0;color:#111}main{text-align:center;max-width:640px;padding:2rem}h1{font-size:1.25rem;margin:0 0 .5rem}p{color:#555;font-size:.95rem;line-height:1.5;margin:0 0 1rem}code{display:block;word-break:break-all;text-align:left;background:#f4f4f5;border:1px solid #e4e4e7;border-radius:6px;padding:.75rem;font-size:.8rem}button{margin-top:.75rem;font-size:.9rem;padding:.5rem 1rem;border-radius:6px;border:1px solid #d4d4d8;background:#fff;cursor:pointer}#age{margin-top:.75rem;color:#777;font-size:.85rem}</style>
|
|
93481
|
+
</head><body><main><h1>Automatic sign-in blocked</h1>
|
|
93482
|
+
<p>This CLI runs with <code style="display:inline;padding:.1rem .3rem">${MANUAL_LOGIN_ONLY_ENV_VAR}</code> set, so it ignored this redirect. Copy the code below and paste it into the CLI prompt.</p>
|
|
93483
|
+
<code id="t">${code}</code>
|
|
93484
|
+
<button id="c">Copy code</button>
|
|
93485
|
+
<p id="age"></p>
|
|
93486
|
+
<script>
|
|
93487
|
+
const minted = Date.now();
|
|
93488
|
+
document.getElementById("c").addEventListener("click", async () => {
|
|
93489
|
+
await navigator.clipboard.writeText(document.getElementById("t").textContent);
|
|
93490
|
+
document.getElementById("c").textContent = "Copied";
|
|
93491
|
+
});
|
|
93492
|
+
setInterval(() => {
|
|
93493
|
+
document.getElementById("age").textContent =
|
|
93494
|
+
"On this page for " + Math.round((Date.now() - minted) / 1000) + "s.";
|
|
93495
|
+
}, 1000);
|
|
93496
|
+
</script>
|
|
93497
|
+
</main></body></html>`;
|
|
93054
93498
|
const sendCompletion = (res, success3) => new Promise((resolve9) => {
|
|
93055
93499
|
if (res.destroyed) {
|
|
93056
93500
|
resolve9();
|
|
@@ -93113,12 +93557,14 @@ function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
|
93113
93557
|
rejectResult(reason);
|
|
93114
93558
|
};
|
|
93115
93559
|
const state = url4.searchParams.get("state");
|
|
93560
|
+
const code = url4.searchParams.get("code");
|
|
93116
93561
|
const clerkToken = url4.searchParams.get("clerkToken");
|
|
93117
93562
|
const hostedSnapshot = parseHostedCliAuthDiagnosticSnapshot(
|
|
93118
93563
|
url4.searchParams.get("cliAuthDiag")
|
|
93119
93564
|
);
|
|
93120
93565
|
diagnostics.logPhase("callback-server.callback-received", {
|
|
93121
93566
|
callback: summarizeCallbackUrl(`http://127.0.0.1${url4.pathname}`),
|
|
93567
|
+
hasCode: Boolean(code),
|
|
93122
93568
|
hasClerkToken: Boolean(clerkToken),
|
|
93123
93569
|
receivedState: summarizeState(state)
|
|
93124
93570
|
});
|
|
@@ -93142,10 +93588,10 @@ function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
|
93142
93588
|
rejectOnce(new Error("State mismatch in callback"));
|
|
93143
93589
|
return;
|
|
93144
93590
|
}
|
|
93145
|
-
if (!clerkToken) {
|
|
93591
|
+
if (!code && !clerkToken) {
|
|
93146
93592
|
diagnostics.logError(
|
|
93147
|
-
"callback-server.missing-
|
|
93148
|
-
new Error("Missing
|
|
93593
|
+
"callback-server.missing-code",
|
|
93594
|
+
new Error("Missing code in callback"),
|
|
93149
93595
|
{
|
|
93150
93596
|
receivedState: summarizeState(state)
|
|
93151
93597
|
}
|
|
@@ -93154,8 +93600,20 @@ function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
|
93154
93600
|
"Content-Type": "text/html; charset=utf-8",
|
|
93155
93601
|
Connection: "close"
|
|
93156
93602
|
});
|
|
93157
|
-
res.end(ERROR_HTML("Missing
|
|
93158
|
-
rejectOnce(new Error("Missing
|
|
93603
|
+
res.end(ERROR_HTML("Missing sign-in code. Please retry from the CLI."));
|
|
93604
|
+
rejectOnce(new Error("Missing code in callback"));
|
|
93605
|
+
return;
|
|
93606
|
+
}
|
|
93607
|
+
if (isManualLoginOnlyEnabled() && code) {
|
|
93608
|
+
res.writeHead(200, {
|
|
93609
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
93610
|
+
Connection: "close"
|
|
93611
|
+
});
|
|
93612
|
+
res.end(MANUAL_ONLY_HTML(code));
|
|
93613
|
+
diagnostics.logPhase("callback-server.callback-ignored", {
|
|
93614
|
+
reason: "manual-login-only",
|
|
93615
|
+
receivedState: summarizeState(state)
|
|
93616
|
+
});
|
|
93159
93617
|
return;
|
|
93160
93618
|
}
|
|
93161
93619
|
if (waitForLoginCompletion) {
|
|
@@ -93179,9 +93637,10 @@ function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
|
93179
93637
|
res.end(SUCCESS_HTML);
|
|
93180
93638
|
}
|
|
93181
93639
|
diagnostics.logPhase("callback-server.callback-accepted", {
|
|
93182
|
-
receivedState: summarizeState(state)
|
|
93640
|
+
receivedState: summarizeState(state),
|
|
93641
|
+
via: code ? "code" : "clerkToken"
|
|
93183
93642
|
});
|
|
93184
|
-
resolveOnce({ clerkToken });
|
|
93643
|
+
resolveOnce(code ? { code } : { clerkToken });
|
|
93185
93644
|
});
|
|
93186
93645
|
server.on("error", (error98) => {
|
|
93187
93646
|
diagnostics.logError("callback-server.error", error98);
|
|
@@ -93204,16 +93663,16 @@ function startCallbackServer(expectedState, waitForLoginCompletion = false) {
|
|
|
93204
93663
|
});
|
|
93205
93664
|
});
|
|
93206
93665
|
}
|
|
93207
|
-
async function
|
|
93666
|
+
async function raceForAuthCode(resultPromise, manualClerkToken) {
|
|
93208
93667
|
const callbackBranch = resultPromise.then((result) => ({
|
|
93209
|
-
|
|
93668
|
+
...result,
|
|
93210
93669
|
source: "callback"
|
|
93211
93670
|
}));
|
|
93212
93671
|
if (!manualClerkToken) {
|
|
93213
93672
|
return await callbackBranch;
|
|
93214
93673
|
}
|
|
93215
|
-
const manualBranch = manualClerkToken.then((
|
|
93216
|
-
|
|
93674
|
+
const manualBranch = manualClerkToken.then((code) => ({
|
|
93675
|
+
code,
|
|
93217
93676
|
source: "manual"
|
|
93218
93677
|
}));
|
|
93219
93678
|
const swallow = (promise3) => {
|
|
@@ -93223,8 +93682,21 @@ async function raceForClerkToken(resultPromise, manualClerkToken) {
|
|
|
93223
93682
|
swallow(manualBranch);
|
|
93224
93683
|
return await Promise.race([callbackBranch, manualBranch]);
|
|
93225
93684
|
}
|
|
93685
|
+
function reportAuthCodeShape(code, source, diagnostics) {
|
|
93686
|
+
diagnostics.logPhase("login.code-shape", {
|
|
93687
|
+
length: code.length,
|
|
93688
|
+
source
|
|
93689
|
+
});
|
|
93690
|
+
if (!isManualLoginOnlyEnabled()) {
|
|
93691
|
+
return;
|
|
93692
|
+
}
|
|
93693
|
+
process.stderr.write(`
|
|
93694
|
+
[manual-login-only] Code length ${code.length}.
|
|
93695
|
+
`);
|
|
93696
|
+
}
|
|
93226
93697
|
async function login(options = {}) {
|
|
93227
93698
|
const state = crypto3.randomBytes(16).toString("hex");
|
|
93699
|
+
const { codeVerifier, codeChallenge } = createPkcePair();
|
|
93228
93700
|
const diagnostics = createCliAuthDiagnostics(state);
|
|
93229
93701
|
diagnostics.logPhase("login.start", {
|
|
93230
93702
|
opsApiUrl: getOpsApiUrl(),
|
|
@@ -93242,6 +93714,8 @@ async function login(options = {}) {
|
|
|
93242
93714
|
const loginParams = new URLSearchParams({
|
|
93243
93715
|
callback: callbackUrl,
|
|
93244
93716
|
state,
|
|
93717
|
+
code_challenge: codeChallenge,
|
|
93718
|
+
code_challenge_method: "S256",
|
|
93245
93719
|
...isCliAuthDiagnosticsVerboseEnabled() ? { verbose: "1" } : {},
|
|
93246
93720
|
...posthogDistinctId !== null ? { posthog_distinct_id: posthogDistinctId } : {}
|
|
93247
93721
|
});
|
|
@@ -93273,13 +93747,14 @@ async function login(options = {}) {
|
|
|
93273
93747
|
}
|
|
93274
93748
|
}
|
|
93275
93749
|
diagnostics.logPhase("login.waiting-for-callback");
|
|
93276
|
-
const
|
|
93750
|
+
const credential = await raceForAuthCode(
|
|
93277
93751
|
resultPromise,
|
|
93278
93752
|
options.manualClerkToken
|
|
93279
93753
|
);
|
|
93754
|
+
const { source } = credential;
|
|
93280
93755
|
tokenSource = source;
|
|
93281
93756
|
diagnostics.logPhase("login.callback-complete", {
|
|
93282
|
-
|
|
93757
|
+
codeReceived: "code" in credential,
|
|
93283
93758
|
tokenSource: source
|
|
93284
93759
|
});
|
|
93285
93760
|
const apiClient = createApiClient(getOpsApiUrl());
|
|
@@ -93288,10 +93763,20 @@ async function login(options = {}) {
|
|
|
93288
93763
|
let authPayload;
|
|
93289
93764
|
try {
|
|
93290
93765
|
diagnostics.logPhase("login.exchange-start");
|
|
93291
|
-
|
|
93292
|
-
|
|
93293
|
-
|
|
93294
|
-
|
|
93766
|
+
if ("code" in credential) {
|
|
93767
|
+
reportAuthCodeShape(credential.code, source, diagnostics);
|
|
93768
|
+
authPayload = await apiClient.exchangeAuthorizationCode(
|
|
93769
|
+
credential.code,
|
|
93770
|
+
codeVerifier,
|
|
93771
|
+
bindDuringExchange
|
|
93772
|
+
);
|
|
93773
|
+
} else {
|
|
93774
|
+
diagnostics.logPhase("login.exchange-clerk-token-fallback");
|
|
93775
|
+
authPayload = await apiClient.exchangeClerkToken(
|
|
93776
|
+
credential.clerkToken,
|
|
93777
|
+
bindDuringExchange
|
|
93778
|
+
);
|
|
93779
|
+
}
|
|
93295
93780
|
diagnostics.logPhase("login.exchange-complete", {
|
|
93296
93781
|
organizationId: authPayload.organization.clerkOrgId,
|
|
93297
93782
|
userId: authPayload.user.id
|
|
@@ -93422,7 +93907,7 @@ async function logout() {
|
|
|
93422
93907
|
authStore.clear();
|
|
93423
93908
|
rotateInstallationId({ configStore });
|
|
93424
93909
|
}
|
|
93425
|
-
var MANUAL_PASTE_SERVER_LINGER_MS, TERMINAL_SESSION_INVALID_MESSAGE;
|
|
93910
|
+
var MANUAL_LOGIN_ONLY_ENV_VAR, MANUAL_PASTE_SERVER_LINGER_MS, TERMINAL_SESSION_INVALID_MESSAGE;
|
|
93426
93911
|
var init_auth_service = __esm({
|
|
93427
93912
|
async "apps/cli/src/services/auth.service.ts"() {
|
|
93428
93913
|
"use strict";
|
|
@@ -93433,6 +93918,7 @@ var init_auth_service = __esm({
|
|
|
93433
93918
|
await init_telemetry();
|
|
93434
93919
|
init_cli_auth_diagnostics();
|
|
93435
93920
|
init_config();
|
|
93921
|
+
MANUAL_LOGIN_ONLY_ENV_VAR = "COPILOTKIT_CLI_MANUAL_LOGIN_ONLY";
|
|
93436
93922
|
MANUAL_PASTE_SERVER_LINGER_MS = 6e3;
|
|
93437
93923
|
TERMINAL_SESSION_INVALID_MESSAGE = "Existing CLI sessions are invalid after the Clerk cutover. Please log in again.";
|
|
93438
93924
|
}
|
|
@@ -93536,6 +94022,37 @@ var init_build4 = __esm({
|
|
|
93536
94022
|
}
|
|
93537
94023
|
});
|
|
93538
94024
|
|
|
94025
|
+
// apps/cli/src/services/auth-code-shape.ts
|
|
94026
|
+
function normalizeAuthCode(raw2) {
|
|
94027
|
+
return raw2.trim().toUpperCase().replaceAll("-", "").replaceAll(/\s/gu, "").replaceAll(/[IL]/gu, "1").replaceAll("O", "0");
|
|
94028
|
+
}
|
|
94029
|
+
function inspectAuthCode(value) {
|
|
94030
|
+
const normalized = normalizeAuthCode(value);
|
|
94031
|
+
if (normalized.length === 0) {
|
|
94032
|
+
return { ok: false, reason: "The code is empty." };
|
|
94033
|
+
}
|
|
94034
|
+
if (normalized.includes(".")) {
|
|
94035
|
+
return {
|
|
94036
|
+
ok: false,
|
|
94037
|
+
reason: "That looks like a session token, not a sign-in code. Copy the short code shown on the page."
|
|
94038
|
+
};
|
|
94039
|
+
}
|
|
94040
|
+
if (!CODE_PATTERN.test(normalized)) {
|
|
94041
|
+
return {
|
|
94042
|
+
ok: false,
|
|
94043
|
+
reason: "A sign-in code is eight characters, like WDJB-MJHT. Check the code on the page and enter it again."
|
|
94044
|
+
};
|
|
94045
|
+
}
|
|
94046
|
+
return { ok: true };
|
|
94047
|
+
}
|
|
94048
|
+
var CODE_PATTERN;
|
|
94049
|
+
var init_auth_code_shape = __esm({
|
|
94050
|
+
"apps/cli/src/services/auth-code-shape.ts"() {
|
|
94051
|
+
"use strict";
|
|
94052
|
+
CODE_PATTERN = /^[0-9ABCDEFGHJKMNPQRSTVWXYZ]{8}$/u;
|
|
94053
|
+
}
|
|
94054
|
+
});
|
|
94055
|
+
|
|
93539
94056
|
// apps/cli/src/services/cli-tips.ts
|
|
93540
94057
|
function rankCliTips(tips = CLI_TIPS) {
|
|
93541
94058
|
return [...tips].sort((firstTip, secondTip) => {
|
|
@@ -94063,7 +94580,16 @@ function BrowserLoginProvider({
|
|
|
94063
94580
|
if (trimmed.length === 0) {
|
|
94064
94581
|
return void 0;
|
|
94065
94582
|
}
|
|
94583
|
+
const inspection = inspectAuthCode(trimmed);
|
|
94584
|
+
if (!inspection.ok) {
|
|
94585
|
+
setState((previous) => ({
|
|
94586
|
+
...previous,
|
|
94587
|
+
manualTokenError: inspection.reason
|
|
94588
|
+
}));
|
|
94589
|
+
return void 0;
|
|
94590
|
+
}
|
|
94066
94591
|
pendingManualTokenRef.current = null;
|
|
94592
|
+
setState((previous) => ({ ...previous, manualTokenError: "" }));
|
|
94067
94593
|
pendingManualToken.resolve(trimmed);
|
|
94068
94594
|
return void 0;
|
|
94069
94595
|
}, []);
|
|
@@ -94115,7 +94641,8 @@ function BrowserLoginProvider({
|
|
|
94115
94641
|
phase: "finalizing",
|
|
94116
94642
|
identity,
|
|
94117
94643
|
errorMessage: "",
|
|
94118
|
-
loginUrl: ""
|
|
94644
|
+
loginUrl: "",
|
|
94645
|
+
manualTokenError: ""
|
|
94119
94646
|
});
|
|
94120
94647
|
await new Promise((resolve9) => {
|
|
94121
94648
|
setTimeout(() => {
|
|
@@ -94127,7 +94654,8 @@ function BrowserLoginProvider({
|
|
|
94127
94654
|
phase: "success",
|
|
94128
94655
|
identity,
|
|
94129
94656
|
errorMessage: "",
|
|
94130
|
-
loginUrl: ""
|
|
94657
|
+
loginUrl: "",
|
|
94658
|
+
manualTokenError: ""
|
|
94131
94659
|
});
|
|
94132
94660
|
return result;
|
|
94133
94661
|
} catch (error98) {
|
|
@@ -94140,7 +94668,8 @@ function BrowserLoginProvider({
|
|
|
94140
94668
|
phase: "error",
|
|
94141
94669
|
identity: null,
|
|
94142
94670
|
errorMessage: concreteError.message,
|
|
94143
|
-
loginUrl: ""
|
|
94671
|
+
loginUrl: "",
|
|
94672
|
+
manualTokenError: ""
|
|
94144
94673
|
});
|
|
94145
94674
|
throw concreteError;
|
|
94146
94675
|
}
|
|
@@ -94233,6 +94762,7 @@ function BrowserLoginConfirmation({
|
|
|
94233
94762
|
)
|
|
94234
94763
|
] })
|
|
94235
94764
|
] }) : null,
|
|
94765
|
+
state.manualTokenError !== "" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "red", children: state.manualTokenError }) }) : null,
|
|
94236
94766
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CliTip, {})
|
|
94237
94767
|
] });
|
|
94238
94768
|
}
|
|
@@ -94278,6 +94808,7 @@ var init_browser_login = __esm({
|
|
|
94278
94808
|
await init_build4();
|
|
94279
94809
|
await init_auth_service();
|
|
94280
94810
|
init_cli_auth_diagnostics();
|
|
94811
|
+
init_auth_code_shape();
|
|
94281
94812
|
await init_cli_tip();
|
|
94282
94813
|
await init_spinner();
|
|
94283
94814
|
await init_success_text();
|
|
@@ -94289,10 +94820,11 @@ var init_browser_login = __esm({
|
|
|
94289
94820
|
phase: "idle",
|
|
94290
94821
|
identity: null,
|
|
94291
94822
|
errorMessage: "",
|
|
94292
|
-
loginUrl: ""
|
|
94823
|
+
loginUrl: "",
|
|
94824
|
+
manualTokenError: ""
|
|
94293
94825
|
};
|
|
94294
94826
|
BrowserLoginContext = (0, import_react35.createContext)(null);
|
|
94295
|
-
BROWSER_LOGIN_MANUAL_PASTE_LABEL = "If your browser finished sign-in but the CLI didn't notice, paste the code shown
|
|
94827
|
+
BROWSER_LOGIN_MANUAL_PASTE_LABEL = "If your browser finished sign-in but the CLI didn't notice, paste the short code shown there:";
|
|
94296
94828
|
BROWSER_LOGIN_MANUAL_URL_LABEL = "If the browser didn't open, sign in at:";
|
|
94297
94829
|
}
|
|
94298
94830
|
});
|
|
@@ -96721,7 +97253,7 @@ var init_learning_skills_api = __esm({
|
|
|
96721
97253
|
});
|
|
96722
97254
|
|
|
96723
97255
|
// apps/cli/src/services/learning-skills-download.ts
|
|
96724
|
-
import { createHash as
|
|
97256
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
96725
97257
|
import {
|
|
96726
97258
|
existsSync as existsSync10,
|
|
96727
97259
|
mkdirSync as mkdirSync5,
|
|
@@ -96932,7 +97464,7 @@ function verifyEtag(bytes, etag) {
|
|
|
96932
97464
|
if (etag === void 0) {
|
|
96933
97465
|
return;
|
|
96934
97466
|
}
|
|
96935
|
-
const expected = `"${
|
|
97467
|
+
const expected = `"${createHash3("sha256").update(bytes).digest("hex")}"`;
|
|
96936
97468
|
if (etag !== expected) {
|
|
96937
97469
|
throw learningSkillsError(
|
|
96938
97470
|
TELEMETRY_ERROR_CODES.LEARNING_SKILLS_INTEGRITY_FAILED,
|
|
@@ -97010,7 +97542,7 @@ async function runSkillsDownload(options) {
|
|
|
97010
97542
|
{ code: TELEMETRY_ERROR_CODES.PREREQUISITE_MISSING }
|
|
97011
97543
|
);
|
|
97012
97544
|
}
|
|
97013
|
-
if (project.clerkOrgId !== auth2.clerkOrgId) {
|
|
97545
|
+
if (project.clerkOrgId !== void 0 && project.clerkOrgId !== auth2.clerkOrgId) {
|
|
97014
97546
|
throw Object.assign(
|
|
97015
97547
|
new Error(
|
|
97016
97548
|
"This directory has a hosted Intelligence project selected for a different organization. Run `copilotkit project select` in this directory, then re-run `copilotkit skills download`."
|
|
@@ -97053,6 +97585,68 @@ var init_skills_download = __esm({
|
|
|
97053
97585
|
}
|
|
97054
97586
|
});
|
|
97055
97587
|
|
|
97588
|
+
// apps/cli/src/services/child-timeout.ts
|
|
97589
|
+
function signalChildTree(child, signal, ownsProcessGroup) {
|
|
97590
|
+
const { pid } = child;
|
|
97591
|
+
if (ownsProcessGroup && pid !== void 0) {
|
|
97592
|
+
try {
|
|
97593
|
+
process.kill(-pid, signal);
|
|
97594
|
+
return;
|
|
97595
|
+
} catch {
|
|
97596
|
+
}
|
|
97597
|
+
}
|
|
97598
|
+
try {
|
|
97599
|
+
child.kill(signal);
|
|
97600
|
+
} catch {
|
|
97601
|
+
}
|
|
97602
|
+
}
|
|
97603
|
+
function armChildTimeout(child, timeoutMs, onTimeout, options = {}) {
|
|
97604
|
+
if (timeoutMs <= 0)
|
|
97605
|
+
return { cancel: () => void 0 };
|
|
97606
|
+
const ownsProcessGroup = options.ownsProcessGroup === true;
|
|
97607
|
+
let closed = false;
|
|
97608
|
+
let graceTimer;
|
|
97609
|
+
const timer = setTimeout(() => {
|
|
97610
|
+
signalChildTree(child, "SIGTERM", ownsProcessGroup);
|
|
97611
|
+
onTimeout();
|
|
97612
|
+
graceTimer = setTimeout(() => {
|
|
97613
|
+
if (!closed)
|
|
97614
|
+
signalChildTree(child, "SIGKILL", ownsProcessGroup);
|
|
97615
|
+
}, TERMINATION_GRACE_MS);
|
|
97616
|
+
}, timeoutMs);
|
|
97617
|
+
const forwarders = (ownsProcessGroup ? FORWARDED_SIGNALS : []).flatMap((signal) => {
|
|
97618
|
+
if (process.listenerCount(signal) === 0)
|
|
97619
|
+
return [];
|
|
97620
|
+
const forward = () => {
|
|
97621
|
+
signalChildTree(child, signal, ownsProcessGroup);
|
|
97622
|
+
};
|
|
97623
|
+
process.once(signal, forward);
|
|
97624
|
+
return [{ signal, forward }];
|
|
97625
|
+
});
|
|
97626
|
+
const cancel = () => {
|
|
97627
|
+
clearTimeout(timer);
|
|
97628
|
+
if (graceTimer !== void 0)
|
|
97629
|
+
clearTimeout(graceTimer);
|
|
97630
|
+
for (const { signal, forward } of forwarders) {
|
|
97631
|
+
process.off(signal, forward);
|
|
97632
|
+
}
|
|
97633
|
+
};
|
|
97634
|
+
child.once("close", () => {
|
|
97635
|
+
closed = true;
|
|
97636
|
+
cancel();
|
|
97637
|
+
});
|
|
97638
|
+
return { cancel };
|
|
97639
|
+
}
|
|
97640
|
+
var TERMINATION_GRACE_MS, OWN_PROCESS_GROUP, FORWARDED_SIGNALS;
|
|
97641
|
+
var init_child_timeout = __esm({
|
|
97642
|
+
"apps/cli/src/services/child-timeout.ts"() {
|
|
97643
|
+
"use strict";
|
|
97644
|
+
TERMINATION_GRACE_MS = 5e3;
|
|
97645
|
+
OWN_PROCESS_GROUP = { detached: true };
|
|
97646
|
+
FORWARDED_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
97647
|
+
}
|
|
97648
|
+
});
|
|
97649
|
+
|
|
97056
97650
|
// apps/cli/src/services/skills-install.ts
|
|
97057
97651
|
import { spawn } from "node:child_process";
|
|
97058
97652
|
import {
|
|
@@ -97158,6 +97752,65 @@ function removePartialFailureMonitor(monitor) {
|
|
|
97158
97752
|
} catch {
|
|
97159
97753
|
}
|
|
97160
97754
|
}
|
|
97755
|
+
function createSkillsInstallRunner(timeoutMs = SKILLS_INSTALL_TIMEOUT_MS) {
|
|
97756
|
+
return (command2, args, outputMode) => new Promise((resolve9, reject) => {
|
|
97757
|
+
let capture = {
|
|
97758
|
+
output: "",
|
|
97759
|
+
reportedPartialFailure: false
|
|
97760
|
+
};
|
|
97761
|
+
const monitor = outputMode === "monitor" ? createPartialFailureMonitor() : null;
|
|
97762
|
+
const ownsProcessGroup = outputMode === "capture";
|
|
97763
|
+
const child = spawn(command2, [...args], {
|
|
97764
|
+
stdio: outputMode === "capture" ? ["ignore", "pipe", "pipe"] : "inherit",
|
|
97765
|
+
...ownsProcessGroup ? OWN_PROCESS_GROUP : {},
|
|
97766
|
+
env: monitor === null ? void 0 : {
|
|
97767
|
+
...process.env,
|
|
97768
|
+
NODE_OPTIONS: monitor.nodeOptions,
|
|
97769
|
+
[PARTIAL_FAILURE_FILE_ENV]: monitor.markerPath
|
|
97770
|
+
},
|
|
97771
|
+
// `npx` is a `.cmd` shim on Windows and is only resolvable through a shell
|
|
97772
|
+
// there; POSIX can exec it directly. Selection tokens are validated against
|
|
97773
|
+
// SELECTION_TOKEN before reaching here, so there is no injection surface.
|
|
97774
|
+
shell: process.platform === "win32"
|
|
97775
|
+
});
|
|
97776
|
+
if (outputMode === "capture") {
|
|
97777
|
+
child.stdout?.on("data", (chunk) => {
|
|
97778
|
+
capture = appendSkillsInstallOutput(capture, chunk);
|
|
97779
|
+
});
|
|
97780
|
+
child.stderr?.on("data", (chunk) => {
|
|
97781
|
+
capture = appendSkillsInstallOutput(capture, chunk);
|
|
97782
|
+
});
|
|
97783
|
+
}
|
|
97784
|
+
let timedOut = false;
|
|
97785
|
+
const timeout = armChildTimeout(
|
|
97786
|
+
child,
|
|
97787
|
+
timeoutMs,
|
|
97788
|
+
() => {
|
|
97789
|
+
timedOut = true;
|
|
97790
|
+
},
|
|
97791
|
+
{ ownsProcessGroup }
|
|
97792
|
+
);
|
|
97793
|
+
child.on("error", (error98) => {
|
|
97794
|
+
timeout.cancel();
|
|
97795
|
+
removePartialFailureMonitor(monitor);
|
|
97796
|
+
reject(error98);
|
|
97797
|
+
});
|
|
97798
|
+
child.on("close", (code) => {
|
|
97799
|
+
timeout.cancel();
|
|
97800
|
+
const reportedPartialFailure = capture.reportedPartialFailure || monitor !== null && existsSync11(monitor.markerPath);
|
|
97801
|
+
removePartialFailureMonitor(monitor);
|
|
97802
|
+
if (timedOut) {
|
|
97803
|
+
reject(
|
|
97804
|
+
new Error(
|
|
97805
|
+
`The skills installer stopped responding after ${timeoutMs} ms and was stopped. Check the network and the npm registry configuration, then run \`${command2} ${args.join(" ")}\` by hand.`
|
|
97806
|
+
)
|
|
97807
|
+
);
|
|
97808
|
+
return;
|
|
97809
|
+
}
|
|
97810
|
+
resolve9({ exitCode: code ?? 1, ...capture, reportedPartialFailure });
|
|
97811
|
+
});
|
|
97812
|
+
});
|
|
97813
|
+
}
|
|
97161
97814
|
async function installCopilotKitSkills(options = {}, deps = {}) {
|
|
97162
97815
|
const run = deps.run ?? defaultRunner;
|
|
97163
97816
|
const args = buildSkillsInstallArgs(options);
|
|
@@ -97183,10 +97836,11 @@ Retry with \`${SKILLS_INSTALL_COMMAND} ${retryArgs}\`.`
|
|
|
97183
97836
|
);
|
|
97184
97837
|
}
|
|
97185
97838
|
}
|
|
97186
|
-
var SKILLS_INSTALL_COMMAND, SKILLS_INSTALL_PACKAGE, SKILLS_SOURCE, ALL_SELECTION, DEFAULT_ONBOARD_AGENTS, SELECTION_TOKEN, MAX_CAPTURED_OUTPUT_CHARACTERS, PARTIAL_FAILURE_PATTERN, PARTIAL_FAILURE_FILE_ENV, PARTIAL_FAILURE_MONITOR_SOURCE, defaultRunner;
|
|
97839
|
+
var SKILLS_INSTALL_COMMAND, SKILLS_INSTALL_PACKAGE, SKILLS_SOURCE, ALL_SELECTION, DEFAULT_ONBOARD_AGENTS, SELECTION_TOKEN, MAX_CAPTURED_OUTPUT_CHARACTERS, SKILLS_INSTALL_TIMEOUT_MS, PARTIAL_FAILURE_PATTERN, PARTIAL_FAILURE_FILE_ENV, PARTIAL_FAILURE_MONITOR_SOURCE, defaultRunner;
|
|
97187
97840
|
var init_skills_install = __esm({
|
|
97188
97841
|
"apps/cli/src/services/skills-install.ts"() {
|
|
97189
97842
|
"use strict";
|
|
97843
|
+
init_child_timeout();
|
|
97190
97844
|
init_event_properties();
|
|
97191
97845
|
SKILLS_INSTALL_COMMAND = "npx";
|
|
97192
97846
|
SKILLS_INSTALL_PACKAGE = "skills@1.5.18";
|
|
@@ -97195,6 +97849,7 @@ var init_skills_install = __esm({
|
|
|
97195
97849
|
DEFAULT_ONBOARD_AGENTS = ["universal", "claude-code"];
|
|
97196
97850
|
SELECTION_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
97197
97851
|
MAX_CAPTURED_OUTPUT_CHARACTERS = 16384;
|
|
97852
|
+
SKILLS_INSTALL_TIMEOUT_MS = 5 * 6e4;
|
|
97198
97853
|
PARTIAL_FAILURE_PATTERN = /\bFailed to install [1-9]\d*\b/;
|
|
97199
97854
|
PARTIAL_FAILURE_FILE_ENV = "CPKI_SKILLS_PARTIAL_FAILURE_FILE";
|
|
97200
97855
|
PARTIAL_FAILURE_MONITOR_SOURCE = String.raw`"use strict";
|
|
@@ -97228,42 +97883,7 @@ function monitor(stream) {
|
|
|
97228
97883
|
monitor(process.stdout);
|
|
97229
97884
|
monitor(process.stderr);
|
|
97230
97885
|
`;
|
|
97231
|
-
defaultRunner = (
|
|
97232
|
-
let capture = {
|
|
97233
|
-
output: "",
|
|
97234
|
-
reportedPartialFailure: false
|
|
97235
|
-
};
|
|
97236
|
-
const monitor = outputMode === "monitor" ? createPartialFailureMonitor() : null;
|
|
97237
|
-
const child = spawn(command2, [...args], {
|
|
97238
|
-
stdio: outputMode === "capture" ? ["ignore", "pipe", "pipe"] : "inherit",
|
|
97239
|
-
env: monitor === null ? void 0 : {
|
|
97240
|
-
...process.env,
|
|
97241
|
-
NODE_OPTIONS: monitor.nodeOptions,
|
|
97242
|
-
[PARTIAL_FAILURE_FILE_ENV]: monitor.markerPath
|
|
97243
|
-
},
|
|
97244
|
-
// `npx` is a `.cmd` shim on Windows and is only resolvable through a shell
|
|
97245
|
-
// there; POSIX can exec it directly. Selection tokens are validated against
|
|
97246
|
-
// SELECTION_TOKEN before reaching here, so there is no injection surface.
|
|
97247
|
-
shell: process.platform === "win32"
|
|
97248
|
-
});
|
|
97249
|
-
if (outputMode === "capture") {
|
|
97250
|
-
child.stdout?.on("data", (chunk) => {
|
|
97251
|
-
capture = appendSkillsInstallOutput(capture, chunk);
|
|
97252
|
-
});
|
|
97253
|
-
child.stderr?.on("data", (chunk) => {
|
|
97254
|
-
capture = appendSkillsInstallOutput(capture, chunk);
|
|
97255
|
-
});
|
|
97256
|
-
}
|
|
97257
|
-
child.on("error", (error98) => {
|
|
97258
|
-
removePartialFailureMonitor(monitor);
|
|
97259
|
-
reject(error98);
|
|
97260
|
-
});
|
|
97261
|
-
child.on("close", (code) => {
|
|
97262
|
-
const reportedPartialFailure = capture.reportedPartialFailure || monitor !== null && existsSync11(monitor.markerPath);
|
|
97263
|
-
removePartialFailureMonitor(monitor);
|
|
97264
|
-
resolve9({ exitCode: code ?? 1, ...capture, reportedPartialFailure });
|
|
97265
|
-
});
|
|
97266
|
-
});
|
|
97886
|
+
defaultRunner = createSkillsInstallRunner();
|
|
97267
97887
|
}
|
|
97268
97888
|
});
|
|
97269
97889
|
|
|
@@ -98791,7 +99411,7 @@ var init_inspector_metadata = __esm({
|
|
|
98791
99411
|
});
|
|
98792
99412
|
|
|
98793
99413
|
// libs/app-api-contracts/src/inspector-learning.ts
|
|
98794
|
-
var text, idSchema, boundedTextSchema, urlSchema, originSchema, candidateReviewUrlSchema, inspectorLearningRequestV1Schema, inspectorLearningUpstreamRequestV1Schema, evidenceSchema, inspectorLearningInsightSchema, configurationSchema, runSchema, pageSchema, skillSchema, inspectorLearningSnapshotV1Schema;
|
|
99414
|
+
var text, idSchema, boundedTextSchema, urlSchema, originSchema, candidateReviewUrlSchema, analysisResultsUrlSchema, inspectorLearningRequestV1Schema, inspectorLearningUpstreamRequestV1Schema, evidenceSchema, inspectorLearningInsightSchema, configurationSchema, runSchema, pageSchema, skillSchema, inspectorLearningSnapshotV1Schema;
|
|
98795
99415
|
var init_inspector_learning = __esm({
|
|
98796
99416
|
"libs/app-api-contracts/src/inspector-learning.ts"() {
|
|
98797
99417
|
"use strict";
|
|
@@ -98818,6 +99438,12 @@ var init_inspector_learning = __esm({
|
|
|
98818
99438
|
const url4 = new URL(value);
|
|
98819
99439
|
return /^\/o\/[^/]+\/[^/]+\/learning\/[^/]+\/skills$/u.test(url4.pathname) && url4.search === "" && url4.hash === "";
|
|
98820
99440
|
}, "Expected a project-scoped Learning Skill-review URL.");
|
|
99441
|
+
analysisResultsUrlSchema = urlSchema.refine((value) => {
|
|
99442
|
+
const url4 = new URL(value);
|
|
99443
|
+
return /^\/o\/[^/]+\/[^/]+\/learning\/[^/]+\/analysis-results$/u.test(
|
|
99444
|
+
url4.pathname
|
|
99445
|
+
) && url4.search === "" && url4.hash === "";
|
|
99446
|
+
}, "Expected a project-scoped Learning analysis-results URL.");
|
|
98821
99447
|
inspectorLearningRequestV1Schema = external_exports.object({
|
|
98822
99448
|
agentId: idSchema.optional(),
|
|
98823
99449
|
skillsPage: external_exports.number().int().min(1).optional(),
|
|
@@ -98914,7 +99540,7 @@ var init_inspector_learning = __esm({
|
|
|
98914
99540
|
links: external_exports.object({
|
|
98915
99541
|
learning: urlSchema,
|
|
98916
99542
|
candidates: candidateReviewUrlSchema.nullable(),
|
|
98917
|
-
runs:
|
|
99543
|
+
runs: analysisResultsUrlSchema.nullable()
|
|
98918
99544
|
}).strict()
|
|
98919
99545
|
}).strict().superRefine((snapshot, context3) => {
|
|
98920
99546
|
const origin = new URL(snapshot.webAppOrigin).origin;
|
|
@@ -99243,7 +99869,7 @@ var init_usage = __esm({
|
|
|
99243
99869
|
});
|
|
99244
99870
|
|
|
99245
99871
|
// libs/app-api-contracts/src/index.ts
|
|
99246
|
-
var
|
|
99872
|
+
var init_src6 = __esm({
|
|
99247
99873
|
"libs/app-api-contracts/src/index.ts"() {
|
|
99248
99874
|
"use strict";
|
|
99249
99875
|
init_channels();
|
|
@@ -99298,7 +99924,7 @@ var projectIdSchema, candidateIdSchema;
|
|
|
99298
99924
|
var init_learning_api_validation = __esm({
|
|
99299
99925
|
"apps/cli/src/services/learning-api-validation.ts"() {
|
|
99300
99926
|
"use strict";
|
|
99301
|
-
|
|
99927
|
+
init_src6();
|
|
99302
99928
|
init_zod();
|
|
99303
99929
|
init_event_properties();
|
|
99304
99930
|
projectIdSchema = external_exports.string().regex(/^[1-9]\d*$/u);
|
|
@@ -99368,7 +99994,7 @@ var insightsResponseSchema, candidatesResponseSchema, candidateResponseSchema, r
|
|
|
99368
99994
|
var init_learning_insights_api = __esm({
|
|
99369
99995
|
"apps/cli/src/services/learning-insights-api.ts"() {
|
|
99370
99996
|
"use strict";
|
|
99371
|
-
|
|
99997
|
+
init_src6();
|
|
99372
99998
|
init_zod();
|
|
99373
99999
|
init_learning_api_validation();
|
|
99374
100000
|
init_event_properties();
|
|
@@ -99400,7 +100026,7 @@ async function loadLearningCommandContext() {
|
|
|
99400
100026
|
TELEMETRY_ERROR_CODES.PREREQUISITE_MISSING
|
|
99401
100027
|
);
|
|
99402
100028
|
}
|
|
99403
|
-
if (project.clerkOrgId !== auth2.clerkOrgId) {
|
|
100029
|
+
if (project.clerkOrgId !== void 0 && project.clerkOrgId !== auth2.clerkOrgId) {
|
|
99404
100030
|
throw tagError(
|
|
99405
100031
|
new Error(
|
|
99406
100032
|
"This directory has a hosted Intelligence project selected for a different organization. Run `copilotkit project select` here, then re-run the Learning command."
|
|
@@ -99908,7 +100534,7 @@ var containerResponseSchema;
|
|
|
99908
100534
|
var init_learning_containers_api = __esm({
|
|
99909
100535
|
"apps/cli/src/services/learning-containers-api.ts"() {
|
|
99910
100536
|
"use strict";
|
|
99911
|
-
|
|
100537
|
+
init_src6();
|
|
99912
100538
|
init_zod();
|
|
99913
100539
|
init_learning_api_validation();
|
|
99914
100540
|
init_event_properties();
|
|
@@ -100172,7 +100798,7 @@ var import_react41, import_jsx_runtime11;
|
|
|
100172
100798
|
var init_learning_container_prompts = __esm({
|
|
100173
100799
|
async "apps/cli/src/ui/learning-container-prompts.tsx"() {
|
|
100174
100800
|
"use strict";
|
|
100175
|
-
|
|
100801
|
+
init_src6();
|
|
100176
100802
|
await init_build2();
|
|
100177
100803
|
await init_build4();
|
|
100178
100804
|
import_react41 = __toESM(require_react(), 1);
|
|
@@ -100718,7 +101344,7 @@ var import_react42;
|
|
|
100718
101344
|
var init_learning_containers = __esm({
|
|
100719
101345
|
async "apps/cli/src/commands/learning-containers.ts"() {
|
|
100720
101346
|
"use strict";
|
|
100721
|
-
|
|
101347
|
+
init_src6();
|
|
100722
101348
|
init_learning_containers_api();
|
|
100723
101349
|
init_learning_command_context();
|
|
100724
101350
|
init_learning_default_container();
|
|
@@ -100778,7 +101404,7 @@ var init_import_metadata = __esm({
|
|
|
100778
101404
|
});
|
|
100779
101405
|
|
|
100780
101406
|
// libs/import-contracts/src/schemas.ts
|
|
100781
|
-
var TextContentBlockSchema, ReasoningContentBlockSchema, InlineMediaContentBlockSchema, UnresolvedMediaContentBlockSchema, MediaContentBlockSchema, ToolCallContentBlockSchema, NormalizedContentBlockSchema, NormalizedMessageRoleSchema, NormalizedRunStatusSchema, NormalizedSourceBackendSchema, EndUserPolicySchema, NormalizedMessageSchema, NormalizedRunUsageSchema, NormalizedRunSchema, NormalizedConversationSchema, ImportRequestSchema;
|
|
101407
|
+
var TextContentBlockSchema, ReasoningContentBlockSchema, InlineMediaContentBlockSchema, UnresolvedMediaContentBlockSchema, MediaContentBlockSchema, ToolCallContentBlockSchema, NormalizedContentBlockSchema, NormalizedMessageRoleSchema, NormalizedRunStatusSchema, NormalizedSourceBackendSchema, EndUserPolicySchema, NormalizedMessageSchema, NormalizedRunUsageSchema, NormalizedRunSchema, NormalizedPendingInterruptSchema, NormalizedConversationSchema, ImportRequestSchema;
|
|
100782
101408
|
var init_schemas3 = __esm({
|
|
100783
101409
|
"libs/import-contracts/src/schemas.ts"() {
|
|
100784
101410
|
"use strict";
|
|
@@ -100840,6 +101466,7 @@ var init_schemas3 = __esm({
|
|
|
100840
101466
|
role: NormalizedMessageRoleSchema,
|
|
100841
101467
|
timestamp: external_exports.string(),
|
|
100842
101468
|
toolCallId: external_exports.string().optional(),
|
|
101469
|
+
error: external_exports.string().optional(),
|
|
100843
101470
|
content: external_exports.array(NormalizedContentBlockSchema)
|
|
100844
101471
|
});
|
|
100845
101472
|
NormalizedRunUsageSchema = external_exports.object({
|
|
@@ -100854,9 +101481,14 @@ var init_schemas3 = __esm({
|
|
|
100854
101481
|
finishedAt: external_exports.string().optional(),
|
|
100855
101482
|
usage: NormalizedRunUsageSchema.optional(),
|
|
100856
101483
|
finishReason: external_exports.string().optional(),
|
|
101484
|
+
errorMessage: external_exports.string().optional(),
|
|
100857
101485
|
interruptValue: external_exports.unknown().optional(),
|
|
100858
101486
|
messages: external_exports.array(NormalizedMessageSchema)
|
|
100859
101487
|
});
|
|
101488
|
+
NormalizedPendingInterruptSchema = external_exports.object({
|
|
101489
|
+
id: external_exports.string().min(1).optional(),
|
|
101490
|
+
value: external_exports.json()
|
|
101491
|
+
}).loose();
|
|
100860
101492
|
NormalizedConversationSchema = external_exports.object({
|
|
100861
101493
|
// Non-empty: `sourceThreadId` is half of the conversation-level dedup key
|
|
100862
101494
|
// (project_id, import_metadata->>'source', ->>'source_thread_id'); a blank
|
|
@@ -100866,6 +101498,8 @@ var init_schemas3 = __esm({
|
|
|
100866
101498
|
sourceBackend: NormalizedSourceBackendSchema.optional(),
|
|
100867
101499
|
endUserId: external_exports.string().nullable(),
|
|
100868
101500
|
lastActivityAt: external_exports.string().optional(),
|
|
101501
|
+
stateSnapshot: external_exports.json().optional(),
|
|
101502
|
+
pendingInterrupts: external_exports.array(NormalizedPendingInterruptSchema).optional(),
|
|
100869
101503
|
runs: external_exports.array(NormalizedRunSchema)
|
|
100870
101504
|
});
|
|
100871
101505
|
ImportRequestSchema = external_exports.object({
|
|
@@ -100878,7 +101512,7 @@ var init_schemas3 = __esm({
|
|
|
100878
101512
|
});
|
|
100879
101513
|
|
|
100880
101514
|
// libs/import-contracts/src/index.ts
|
|
100881
|
-
var
|
|
101515
|
+
var init_src7 = __esm({
|
|
100882
101516
|
"libs/import-contracts/src/index.ts"() {
|
|
100883
101517
|
"use strict";
|
|
100884
101518
|
init_schemas3();
|
|
@@ -101097,8 +101731,9 @@ function projectSelectedCheck(resolution) {
|
|
|
101097
101731
|
title: "A hosted project is selected"
|
|
101098
101732
|
};
|
|
101099
101733
|
}
|
|
101734
|
+
const organization = resolution.config.clerkOrgId === void 0 ? "" : ` in organization ${resolution.config.clerkOrgId}`;
|
|
101100
101735
|
return {
|
|
101101
|
-
detail: `Project ${resolution.config.projectSlug} (id ${resolution.config.projectId})
|
|
101736
|
+
detail: `Project ${resolution.config.projectSlug} (id ${resolution.config.projectId})${organization}, recorded in ${resolution.dir}.`,
|
|
101102
101737
|
id: "project_selected",
|
|
101103
101738
|
status: "pass",
|
|
101104
101739
|
title: "A hosted project is selected"
|
|
@@ -101872,7 +102507,7 @@ var IMPORT_PARSE_OPTIONS, DEFAULT_MAX_BYTES, UNRECOVERABLE_VALUES;
|
|
|
101872
102507
|
var init_import_config = __esm({
|
|
101873
102508
|
"apps/cli/src/services/import-config.ts"() {
|
|
101874
102509
|
"use strict";
|
|
101875
|
-
|
|
102510
|
+
init_src7();
|
|
101876
102511
|
init_event_properties();
|
|
101877
102512
|
init_verify_checks();
|
|
101878
102513
|
IMPORT_PARSE_OPTIONS = {
|
|
@@ -102371,7 +103006,7 @@ var MAX_CONVERSATIONS_PER_CHUNK, realSleep, DEFAULT_BACKOFF_SECONDS, MAX_CHUNK_R
|
|
|
102371
103006
|
var init_import_runner = __esm({
|
|
102372
103007
|
"apps/cli/src/services/import-runner.ts"() {
|
|
102373
103008
|
"use strict";
|
|
102374
|
-
|
|
103009
|
+
init_src7();
|
|
102375
103010
|
init_import_client();
|
|
102376
103011
|
MAX_CONVERSATIONS_PER_CHUNK = 500;
|
|
102377
103012
|
realSleep = (ms) => new Promise((resolve9) => {
|
|
@@ -109160,7 +109795,7 @@ var require_ms = __commonJS({
|
|
|
109160
109795
|
options = options || {};
|
|
109161
109796
|
var type2 = typeof val;
|
|
109162
109797
|
if (type2 === "string" && val.length > 0) {
|
|
109163
|
-
return
|
|
109798
|
+
return parse14(val);
|
|
109164
109799
|
} else if (type2 === "number" && isFinite(val)) {
|
|
109165
109800
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
109166
109801
|
}
|
|
@@ -109168,7 +109803,7 @@ var require_ms = __commonJS({
|
|
|
109168
109803
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
109169
109804
|
);
|
|
109170
109805
|
};
|
|
109171
|
-
function
|
|
109806
|
+
function parse14(str2) {
|
|
109172
109807
|
str2 = String(str2);
|
|
109173
109808
|
if (str2.length > 100) {
|
|
109174
109809
|
return;
|
|
@@ -109717,7 +110352,7 @@ var require_fecha_umd = __commonJS({
|
|
|
109717
110352
|
return literals.shift();
|
|
109718
110353
|
});
|
|
109719
110354
|
};
|
|
109720
|
-
function
|
|
110355
|
+
function parse14(dateStr, format4, i18n) {
|
|
109721
110356
|
if (i18n === void 0) {
|
|
109722
110357
|
i18n = {};
|
|
109723
110358
|
}
|
|
@@ -109812,7 +110447,7 @@ var require_fecha_umd = __commonJS({
|
|
|
109812
110447
|
}
|
|
109813
110448
|
var fecha = {
|
|
109814
110449
|
format: format3,
|
|
109815
|
-
parse:
|
|
110450
|
+
parse: parse14,
|
|
109816
110451
|
defaultI18n,
|
|
109817
110452
|
setGlobalDateI18n,
|
|
109818
110453
|
setGlobalDateMasks
|
|
@@ -109820,7 +110455,7 @@ var require_fecha_umd = __commonJS({
|
|
|
109820
110455
|
exports3.assign = assign2;
|
|
109821
110456
|
exports3.default = fecha;
|
|
109822
110457
|
exports3.format = format3;
|
|
109823
|
-
exports3.parse =
|
|
110458
|
+
exports3.parse = parse14;
|
|
109824
110459
|
exports3.defaultI18n = defaultI18n;
|
|
109825
110460
|
exports3.setGlobalDateI18n = setGlobalDateI18n;
|
|
109826
110461
|
exports3.setGlobalDateMasks = setGlobalDateMasks;
|
|
@@ -128025,7 +128660,7 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
|
128025
128660
|
});
|
|
128026
128661
|
}
|
|
128027
128662
|
var supportedSchemas;
|
|
128028
|
-
var
|
|
128663
|
+
var init_src8 = __esm({
|
|
128029
128664
|
"node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/index.js"() {
|
|
128030
128665
|
"use strict";
|
|
128031
128666
|
init_dist10();
|
|
@@ -128483,7 +129118,7 @@ Content-Type: ${partContentType}\r
|
|
|
128483
129118
|
}
|
|
128484
129119
|
static async #getFetch() {
|
|
128485
129120
|
const hasWindow = typeof window !== "undefined" && !!window;
|
|
128486
|
-
this.#fetch ||= hasWindow ? window.fetch : (await Promise.resolve().then(() => (
|
|
129121
|
+
this.#fetch ||= hasWindow ? window.fetch : (await Promise.resolve().then(() => (init_src8(), src_exports2))).default;
|
|
128487
129122
|
return this.#fetch;
|
|
128488
129123
|
}
|
|
128489
129124
|
/**
|
|
@@ -140475,7 +141110,7 @@ var require_extension2 = __commonJS({
|
|
|
140475
141110
|
else
|
|
140476
141111
|
dest[name].push(elem);
|
|
140477
141112
|
}
|
|
140478
|
-
function
|
|
141113
|
+
function parse14(header) {
|
|
140479
141114
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
140480
141115
|
let params = /* @__PURE__ */ Object.create(null);
|
|
140481
141116
|
let mustUnescape = false;
|
|
@@ -140630,7 +141265,7 @@ var require_extension2 = __commonJS({
|
|
|
140630
141265
|
}).join(", ");
|
|
140631
141266
|
}).join(", ");
|
|
140632
141267
|
}
|
|
140633
|
-
module2.exports = { format: format3, parse:
|
|
141268
|
+
module2.exports = { format: format3, parse: parse14 };
|
|
140634
141269
|
}
|
|
140635
141270
|
});
|
|
140636
141271
|
|
|
@@ -140643,7 +141278,7 @@ var require_websocket2 = __commonJS({
|
|
|
140643
141278
|
var http4 = __require("http");
|
|
140644
141279
|
var net = __require("net");
|
|
140645
141280
|
var tls = __require("tls");
|
|
140646
|
-
var { randomBytes: randomBytes4, createHash:
|
|
141281
|
+
var { randomBytes: randomBytes4, createHash: createHash9 } = __require("crypto");
|
|
140647
141282
|
var { Duplex, Readable: Readable5 } = __require("stream");
|
|
140648
141283
|
var { URL: URL7 } = __require("url");
|
|
140649
141284
|
var PerMessageDeflate2 = require_permessage_deflate2();
|
|
@@ -140664,7 +141299,7 @@ var require_websocket2 = __commonJS({
|
|
|
140664
141299
|
var {
|
|
140665
141300
|
EventTarget: { addEventListener, removeEventListener }
|
|
140666
141301
|
} = require_event_target2();
|
|
140667
|
-
var { format: format3, parse:
|
|
141302
|
+
var { format: format3, parse: parse14 } = require_extension2();
|
|
140668
141303
|
var { toBuffer } = require_buffer_util2();
|
|
140669
141304
|
var kAborted = Symbol("kAborted");
|
|
140670
141305
|
var protocolVersions = [8, 13];
|
|
@@ -141331,7 +141966,7 @@ var require_websocket2 = __commonJS({
|
|
|
141331
141966
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
141332
141967
|
return;
|
|
141333
141968
|
}
|
|
141334
|
-
const digest =
|
|
141969
|
+
const digest = createHash9("sha1").update(key + GUID).digest("base64");
|
|
141335
141970
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
141336
141971
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
141337
141972
|
return;
|
|
@@ -141362,7 +141997,7 @@ var require_websocket2 = __commonJS({
|
|
|
141362
141997
|
}
|
|
141363
141998
|
let extensions;
|
|
141364
141999
|
try {
|
|
141365
|
-
extensions =
|
|
142000
|
+
extensions = parse14(secWebSocketExtensions);
|
|
141366
142001
|
} catch (err2) {
|
|
141367
142002
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
141368
142003
|
abortHandshake(websocket, socket, message);
|
|
@@ -141670,7 +142305,7 @@ var require_subprotocol2 = __commonJS({
|
|
|
141670
142305
|
"node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
|
|
141671
142306
|
"use strict";
|
|
141672
142307
|
var { tokenChars } = require_validation4();
|
|
141673
|
-
function
|
|
142308
|
+
function parse14(header) {
|
|
141674
142309
|
const protocols = /* @__PURE__ */ new Set();
|
|
141675
142310
|
let start = -1;
|
|
141676
142311
|
let end = -1;
|
|
@@ -141709,7 +142344,7 @@ var require_subprotocol2 = __commonJS({
|
|
|
141709
142344
|
protocols.add(protocol);
|
|
141710
142345
|
return protocols;
|
|
141711
142346
|
}
|
|
141712
|
-
module2.exports = { parse:
|
|
142347
|
+
module2.exports = { parse: parse14 };
|
|
141713
142348
|
}
|
|
141714
142349
|
});
|
|
141715
142350
|
|
|
@@ -141720,7 +142355,7 @@ var require_websocket_server2 = __commonJS({
|
|
|
141720
142355
|
var EventEmitter4 = __require("events");
|
|
141721
142356
|
var http4 = __require("http");
|
|
141722
142357
|
var { Duplex } = __require("stream");
|
|
141723
|
-
var { createHash:
|
|
142358
|
+
var { createHash: createHash9 } = __require("crypto");
|
|
141724
142359
|
var extension2 = require_extension2();
|
|
141725
142360
|
var PerMessageDeflate2 = require_permessage_deflate2();
|
|
141726
142361
|
var subprotocol2 = require_subprotocol2();
|
|
@@ -142035,7 +142670,7 @@ var require_websocket_server2 = __commonJS({
|
|
|
142035
142670
|
}
|
|
142036
142671
|
if (this._state > RUNNING)
|
|
142037
142672
|
return abortHandshake(socket, 503);
|
|
142038
|
-
const digest =
|
|
142673
|
+
const digest = createHash9("sha1").update(key + GUID).digest("base64");
|
|
142039
142674
|
const headers = [
|
|
142040
142675
|
"HTTP/1.1 101 Switching Protocols",
|
|
142041
142676
|
"Upgrade: websocket",
|
|
@@ -186947,7 +187582,7 @@ var init_apigee_llm = __esm({
|
|
|
186947
187582
|
// node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/models/registry.js
|
|
186948
187583
|
import { createRequire as topLevelCreateRequire40 } from "module";
|
|
186949
187584
|
var require41, LRUCache, _LLMRegistry, LLMRegistry;
|
|
186950
|
-
var
|
|
187585
|
+
var init_registry2 = __esm({
|
|
186951
187586
|
"node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/models/registry.js"() {
|
|
186952
187587
|
"use strict";
|
|
186953
187588
|
init_logger();
|
|
@@ -189372,7 +190007,7 @@ var init_llm_agent = __esm({
|
|
|
189372
190007
|
init_function_tool();
|
|
189373
190008
|
init_event();
|
|
189374
190009
|
init_base_llm();
|
|
189375
|
-
|
|
190010
|
+
init_registry2();
|
|
189376
190011
|
init_base_tool();
|
|
189377
190012
|
init_logger();
|
|
189378
190013
|
init_context3();
|
|
@@ -191409,7 +192044,7 @@ var require_bytes = __commonJS({
|
|
|
191409
192044
|
"use strict";
|
|
191410
192045
|
module2.exports = bytes;
|
|
191411
192046
|
module2.exports.format = format3;
|
|
191412
|
-
module2.exports.parse =
|
|
192047
|
+
module2.exports.parse = parse14;
|
|
191413
192048
|
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
|
191414
192049
|
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
|
191415
192050
|
var map4 = {
|
|
@@ -191423,7 +192058,7 @@ var require_bytes = __commonJS({
|
|
|
191423
192058
|
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
|
|
191424
192059
|
function bytes(value, options) {
|
|
191425
192060
|
if (typeof value === "string") {
|
|
191426
|
-
return
|
|
192061
|
+
return parse14(value);
|
|
191427
192062
|
}
|
|
191428
192063
|
if (typeof value === "number") {
|
|
191429
192064
|
return format3(value, options);
|
|
@@ -191467,7 +192102,7 @@ var require_bytes = __commonJS({
|
|
|
191467
192102
|
}
|
|
191468
192103
|
return str2 + unitSeparator + unit;
|
|
191469
192104
|
}
|
|
191470
|
-
function
|
|
192105
|
+
function parse14(val) {
|
|
191471
192106
|
if (typeof val === "number" && !isNaN(val)) {
|
|
191472
192107
|
return val;
|
|
191473
192108
|
}
|
|
@@ -191503,7 +192138,7 @@ var require_content_type = __commonJS({
|
|
|
191503
192138
|
var QUOTE_REGEXP = /([\\"])/g;
|
|
191504
192139
|
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
191505
192140
|
exports2.format = format3;
|
|
191506
|
-
exports2.parse =
|
|
192141
|
+
exports2.parse = parse14;
|
|
191507
192142
|
function format3(obj) {
|
|
191508
192143
|
if (!obj || typeof obj !== "object") {
|
|
191509
192144
|
throw new TypeError("argument obj is required");
|
|
@@ -191527,7 +192162,7 @@ var require_content_type = __commonJS({
|
|
|
191527
192162
|
}
|
|
191528
192163
|
return string7;
|
|
191529
192164
|
}
|
|
191530
|
-
function
|
|
192165
|
+
function parse14(string7) {
|
|
191531
192166
|
if (!string7) {
|
|
191532
192167
|
throw new TypeError("argument string is required");
|
|
191533
192168
|
}
|
|
@@ -191948,7 +192583,7 @@ var require_ms3 = __commonJS({
|
|
|
191948
192583
|
options = options || {};
|
|
191949
192584
|
var type2 = typeof val;
|
|
191950
192585
|
if (type2 === "string" && val.length > 0) {
|
|
191951
|
-
return
|
|
192586
|
+
return parse14(val);
|
|
191952
192587
|
} else if (type2 === "number" && isNaN(val) === false) {
|
|
191953
192588
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
191954
192589
|
}
|
|
@@ -191956,7 +192591,7 @@ var require_ms3 = __commonJS({
|
|
|
191956
192591
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
191957
192592
|
);
|
|
191958
192593
|
};
|
|
191959
|
-
function
|
|
192594
|
+
function parse14(str2) {
|
|
191960
192595
|
str2 = String(str2);
|
|
191961
192596
|
if (str2.length > 100) {
|
|
191962
192597
|
return;
|
|
@@ -196321,7 +196956,7 @@ var require_read = __commonJS({
|
|
|
196321
196956
|
var unpipe = require_unpipe();
|
|
196322
196957
|
var zlib3 = __require("zlib");
|
|
196323
196958
|
module2.exports = read;
|
|
196324
|
-
function read(req, res, next,
|
|
196959
|
+
function read(req, res, next, parse14, debug, options) {
|
|
196325
196960
|
var length;
|
|
196326
196961
|
var opts = options;
|
|
196327
196962
|
var stream;
|
|
@@ -196380,7 +197015,7 @@ var require_read = __commonJS({
|
|
|
196380
197015
|
try {
|
|
196381
197016
|
debug("parse body");
|
|
196382
197017
|
str2 = typeof body !== "string" && encoding !== null ? iconv.decode(body, encoding) : body;
|
|
196383
|
-
req.body =
|
|
197018
|
+
req.body = parse14(str2);
|
|
196384
197019
|
} catch (err2) {
|
|
196385
197020
|
next(createError(400, err2, {
|
|
196386
197021
|
body: str2,
|
|
@@ -196449,7 +197084,7 @@ var require_media_typer = __commonJS({
|
|
|
196449
197084
|
var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;
|
|
196450
197085
|
var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
|
|
196451
197086
|
exports2.format = format3;
|
|
196452
|
-
exports2.parse =
|
|
197087
|
+
exports2.parse = parse14;
|
|
196453
197088
|
function format3(obj) {
|
|
196454
197089
|
if (!obj || typeof obj !== "object") {
|
|
196455
197090
|
throw new TypeError("argument obj is required");
|
|
@@ -196484,7 +197119,7 @@ var require_media_typer = __commonJS({
|
|
|
196484
197119
|
}
|
|
196485
197120
|
return string7;
|
|
196486
197121
|
}
|
|
196487
|
-
function
|
|
197122
|
+
function parse14(string7) {
|
|
196488
197123
|
if (!string7) {
|
|
196489
197124
|
throw new TypeError("argument string is required");
|
|
196490
197125
|
}
|
|
@@ -205316,7 +205951,7 @@ var require_json2 = __commonJS({
|
|
|
205316
205951
|
throw new TypeError("option verify must be function");
|
|
205317
205952
|
}
|
|
205318
205953
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
|
205319
|
-
function
|
|
205954
|
+
function parse14(body) {
|
|
205320
205955
|
if (body.length === 0) {
|
|
205321
205956
|
return {};
|
|
205322
205957
|
}
|
|
@@ -205364,7 +205999,7 @@ var require_json2 = __commonJS({
|
|
|
205364
205999
|
}));
|
|
205365
206000
|
return;
|
|
205366
206001
|
}
|
|
205367
|
-
read(req, res, next,
|
|
206002
|
+
read(req, res, next, parse14, debug, {
|
|
205368
206003
|
encoding: charset,
|
|
205369
206004
|
inflate,
|
|
205370
206005
|
limit,
|
|
@@ -205443,7 +206078,7 @@ var require_raw = __commonJS({
|
|
|
205443
206078
|
throw new TypeError("option verify must be function");
|
|
205444
206079
|
}
|
|
205445
206080
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
|
205446
|
-
function
|
|
206081
|
+
function parse14(buf) {
|
|
205447
206082
|
return buf;
|
|
205448
206083
|
}
|
|
205449
206084
|
return function rawParser(req, res, next) {
|
|
@@ -205464,7 +206099,7 @@ var require_raw = __commonJS({
|
|
|
205464
206099
|
next();
|
|
205465
206100
|
return;
|
|
205466
206101
|
}
|
|
205467
|
-
read(req, res, next,
|
|
206102
|
+
read(req, res, next, parse14, debug, {
|
|
205468
206103
|
encoding: null,
|
|
205469
206104
|
inflate,
|
|
205470
206105
|
limit,
|
|
@@ -205501,7 +206136,7 @@ var require_text = __commonJS({
|
|
|
205501
206136
|
throw new TypeError("option verify must be function");
|
|
205502
206137
|
}
|
|
205503
206138
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
|
205504
|
-
function
|
|
206139
|
+
function parse14(buf) {
|
|
205505
206140
|
return buf;
|
|
205506
206141
|
}
|
|
205507
206142
|
return function textParser(req, res, next) {
|
|
@@ -205523,7 +206158,7 @@ var require_text = __commonJS({
|
|
|
205523
206158
|
return;
|
|
205524
206159
|
}
|
|
205525
206160
|
var charset = getCharset(req) || defaultCharset;
|
|
205526
|
-
read(req, res, next,
|
|
206161
|
+
read(req, res, next, parse14, debug, {
|
|
205527
206162
|
encoding: charset,
|
|
205528
206163
|
inflate,
|
|
205529
206164
|
limit,
|
|
@@ -208047,11 +208682,11 @@ var require_lib2 = __commonJS({
|
|
|
208047
208682
|
"node_modules/.pnpm/qs@6.14.2/node_modules/qs/lib/index.js"(exports2, module2) {
|
|
208048
208683
|
"use strict";
|
|
208049
208684
|
var stringify4 = require_stringify2();
|
|
208050
|
-
var
|
|
208685
|
+
var parse14 = require_parse3();
|
|
208051
208686
|
var formats = require_formats2();
|
|
208052
208687
|
module2.exports = {
|
|
208053
208688
|
formats,
|
|
208054
|
-
parse:
|
|
208689
|
+
parse: parse14,
|
|
208055
208690
|
stringify: stringify4
|
|
208056
208691
|
};
|
|
208057
208692
|
}
|
|
@@ -208085,7 +208720,7 @@ var require_urlencoded = __commonJS({
|
|
|
208085
208720
|
}
|
|
208086
208721
|
var queryparse = extended ? extendedparser(opts) : simpleparser(opts);
|
|
208087
208722
|
var shouldParse = typeof type2 !== "function" ? typeChecker(type2) : type2;
|
|
208088
|
-
function
|
|
208723
|
+
function parse14(body) {
|
|
208089
208724
|
return body.length ? queryparse(body) : {};
|
|
208090
208725
|
}
|
|
208091
208726
|
return function urlencodedParser(req, res, next) {
|
|
@@ -208115,7 +208750,7 @@ var require_urlencoded = __commonJS({
|
|
|
208115
208750
|
}));
|
|
208116
208751
|
return;
|
|
208117
208752
|
}
|
|
208118
|
-
read(req, res, next,
|
|
208753
|
+
read(req, res, next, parse14, debug, {
|
|
208119
208754
|
debug,
|
|
208120
208755
|
encoding: charset,
|
|
208121
208756
|
inflate,
|
|
@@ -208127,7 +208762,7 @@ var require_urlencoded = __commonJS({
|
|
|
208127
208762
|
function extendedparser(options) {
|
|
208128
208763
|
var parameterLimit = options.parameterLimit !== void 0 ? options.parameterLimit : 1e3;
|
|
208129
208764
|
var depth = options.depth !== void 0 ? options.depth : 32;
|
|
208130
|
-
var
|
|
208765
|
+
var parse14 = parser("qs");
|
|
208131
208766
|
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
|
208132
208767
|
throw new TypeError("option parameterLimit must be a positive number");
|
|
208133
208768
|
}
|
|
@@ -208148,7 +208783,7 @@ var require_urlencoded = __commonJS({
|
|
|
208148
208783
|
var arrayLimit = Math.max(100, paramCount);
|
|
208149
208784
|
debug("parse extended urlencoding");
|
|
208150
208785
|
try {
|
|
208151
|
-
return
|
|
208786
|
+
return parse14(body, {
|
|
208152
208787
|
allowPrototypes: true,
|
|
208153
208788
|
arrayLimit,
|
|
208154
208789
|
depth,
|
|
@@ -208203,7 +208838,7 @@ var require_urlencoded = __commonJS({
|
|
|
208203
208838
|
}
|
|
208204
208839
|
function simpleparser(options) {
|
|
208205
208840
|
var parameterLimit = options.parameterLimit !== void 0 ? options.parameterLimit : 1e3;
|
|
208206
|
-
var
|
|
208841
|
+
var parse14 = parser("querystring");
|
|
208207
208842
|
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
|
208208
208843
|
throw new TypeError("option parameterLimit must be a positive number");
|
|
208209
208844
|
}
|
|
@@ -208219,7 +208854,7 @@ var require_urlencoded = __commonJS({
|
|
|
208219
208854
|
});
|
|
208220
208855
|
}
|
|
208221
208856
|
debug("parse urlencoding");
|
|
208222
|
-
return
|
|
208857
|
+
return parse14(body, void 0, void 0, { maxKeys: parameterLimit });
|
|
208223
208858
|
};
|
|
208224
208859
|
}
|
|
208225
208860
|
function typeChecker(type2) {
|
|
@@ -208402,7 +209037,7 @@ var require_parseurl = __commonJS({
|
|
|
208402
209037
|
"node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js"(exports2, module2) {
|
|
208403
209038
|
"use strict";
|
|
208404
209039
|
var url4 = __require("url");
|
|
208405
|
-
var
|
|
209040
|
+
var parse14 = url4.parse;
|
|
208406
209041
|
var Url = url4.Url;
|
|
208407
209042
|
module2.exports = parseurl;
|
|
208408
209043
|
module2.exports.original = originalurl;
|
|
@@ -208434,7 +209069,7 @@ var require_parseurl = __commonJS({
|
|
|
208434
209069
|
}
|
|
208435
209070
|
function fastparse(str2) {
|
|
208436
209071
|
if (typeof str2 !== "string" || str2.charCodeAt(0) !== 47) {
|
|
208437
|
-
return
|
|
209072
|
+
return parse14(str2);
|
|
208438
209073
|
}
|
|
208439
209074
|
var pathname = str2;
|
|
208440
209075
|
var query = null;
|
|
@@ -208456,7 +209091,7 @@ var require_parseurl = __commonJS({
|
|
|
208456
209091
|
case 35:
|
|
208457
209092
|
case 160:
|
|
208458
209093
|
case 65279:
|
|
208459
|
-
return
|
|
209094
|
+
return parse14(str2);
|
|
208460
209095
|
}
|
|
208461
209096
|
}
|
|
208462
209097
|
var url5 = Url !== void 0 ? new Url() : {};
|
|
@@ -209479,7 +210114,7 @@ var require_view = __commonJS({
|
|
|
209479
210114
|
var debug = require_src6()("express:view");
|
|
209480
210115
|
var path47 = __require("path");
|
|
209481
210116
|
var fs39 = __require("fs");
|
|
209482
|
-
var
|
|
210117
|
+
var dirname17 = path47.dirname;
|
|
209483
210118
|
var basename7 = path47.basename;
|
|
209484
210119
|
var extname4 = path47.extname;
|
|
209485
210120
|
var join37 = path47.join;
|
|
@@ -209518,7 +210153,7 @@ var require_view = __commonJS({
|
|
|
209518
210153
|
for (var i2 = 0; i2 < roots.length && !path48; i2++) {
|
|
209519
210154
|
var root2 = roots[i2];
|
|
209520
210155
|
var loc = resolve9(root2, name);
|
|
209521
|
-
var dir =
|
|
210156
|
+
var dir = dirname17(loc);
|
|
209522
210157
|
var file3 = basename7(loc);
|
|
209523
210158
|
path48 = this.resolve(dir, file3);
|
|
209524
210159
|
}
|
|
@@ -209557,7 +210192,7 @@ var require_content_disposition = __commonJS({
|
|
|
209557
210192
|
"node_modules/.pnpm/content-disposition@0.5.4/node_modules/content-disposition/index.js"(exports2, module2) {
|
|
209558
210193
|
"use strict";
|
|
209559
210194
|
module2.exports = contentDisposition;
|
|
209560
|
-
module2.exports.parse =
|
|
210195
|
+
module2.exports.parse = parse14;
|
|
209561
210196
|
var basename7 = __require("path").basename;
|
|
209562
210197
|
var Buffer8 = require_safe_buffer().Buffer;
|
|
209563
210198
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
@@ -209648,7 +210283,7 @@ var require_content_disposition = __commonJS({
|
|
|
209648
210283
|
function getlatin1(val) {
|
|
209649
210284
|
return String(val).replace(NON_LATIN1_REGEXP, "?");
|
|
209650
210285
|
}
|
|
209651
|
-
function
|
|
210286
|
+
function parse14(string7) {
|
|
209652
210287
|
if (!string7 || typeof string7 !== "string") {
|
|
209653
210288
|
throw new TypeError("argument string is required");
|
|
209654
210289
|
}
|
|
@@ -210536,7 +211171,7 @@ var require_forwarded = __commonJS({
|
|
|
210536
211171
|
if (!req) {
|
|
210537
211172
|
throw new TypeError("argument req is required");
|
|
210538
211173
|
}
|
|
210539
|
-
var proxyAddrs =
|
|
211174
|
+
var proxyAddrs = parse14(req.headers["x-forwarded-for"] || "");
|
|
210540
211175
|
var socketAddr = getSocketAddr(req);
|
|
210541
211176
|
var addrs = [socketAddr].concat(proxyAddrs);
|
|
210542
211177
|
return addrs;
|
|
@@ -210544,7 +211179,7 @@ var require_forwarded = __commonJS({
|
|
|
210544
211179
|
function getSocketAddr(req) {
|
|
210545
211180
|
return req.socket ? req.socket.remoteAddress : req.connection.remoteAddress;
|
|
210546
211181
|
}
|
|
210547
|
-
function
|
|
211182
|
+
function parse14(header) {
|
|
210548
211183
|
var end = header.length;
|
|
210549
211184
|
var list = [];
|
|
210550
211185
|
var start = header.length;
|
|
@@ -212373,7 +213008,7 @@ var require_request = __commonJS({
|
|
|
212373
213008
|
var http4 = __require("http");
|
|
212374
213009
|
var fresh = require_fresh();
|
|
212375
213010
|
var parseRange = require_range_parser();
|
|
212376
|
-
var
|
|
213011
|
+
var parse14 = require_parseurl();
|
|
212377
213012
|
var proxyaddr = require_proxy_addr();
|
|
212378
213013
|
var req = Object.create(http4.IncomingMessage.prototype);
|
|
212379
213014
|
module2.exports = req;
|
|
@@ -212483,7 +213118,7 @@ var require_request = __commonJS({
|
|
|
212483
213118
|
return subdomains2.slice(offset);
|
|
212484
213119
|
});
|
|
212485
213120
|
defineGetter(req, "path", function path47() {
|
|
212486
|
-
return
|
|
213121
|
+
return parse14(this).pathname;
|
|
212487
213122
|
});
|
|
212488
213123
|
defineGetter(req, "hostname", function hostname5() {
|
|
212489
213124
|
var trust = this.app.get("trust proxy fn");
|
|
@@ -212563,7 +213198,7 @@ var require_cookie_signature = __commonJS({
|
|
|
212563
213198
|
var require_cookie = __commonJS({
|
|
212564
213199
|
"node_modules/.pnpm/cookie@0.7.2/node_modules/cookie/index.js"(exports2) {
|
|
212565
213200
|
"use strict";
|
|
212566
|
-
exports2.parse =
|
|
213201
|
+
exports2.parse = parse14;
|
|
212567
213202
|
exports2.serialize = serialize3;
|
|
212568
213203
|
var __toString = Object.prototype.toString;
|
|
212569
213204
|
var __hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -212571,7 +213206,7 @@ var require_cookie = __commonJS({
|
|
|
212571
213206
|
var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
|
|
212572
213207
|
var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
|
212573
213208
|
var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
212574
|
-
function
|
|
213209
|
+
function parse14(str2, opt) {
|
|
212575
213210
|
if (typeof str2 !== "string") {
|
|
212576
213211
|
throw new TypeError("argument str must be a string");
|
|
212577
213212
|
}
|
|
@@ -212744,7 +213379,7 @@ var require_vary = __commonJS({
|
|
|
212744
213379
|
if (!field) {
|
|
212745
213380
|
throw new TypeError("field argument is required");
|
|
212746
213381
|
}
|
|
212747
|
-
var fields = !Array.isArray(field) ?
|
|
213382
|
+
var fields = !Array.isArray(field) ? parse14(String(field)) : field;
|
|
212748
213383
|
for (var j = 0; j < fields.length; j++) {
|
|
212749
213384
|
if (!FIELD_NAME_REGEXP.test(fields[j])) {
|
|
212750
213385
|
throw new TypeError("field argument contains an invalid header name");
|
|
@@ -212754,7 +213389,7 @@ var require_vary = __commonJS({
|
|
|
212754
213389
|
return header;
|
|
212755
213390
|
}
|
|
212756
213391
|
var val = header;
|
|
212757
|
-
var vals =
|
|
213392
|
+
var vals = parse14(header.toLowerCase());
|
|
212758
213393
|
if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) {
|
|
212759
213394
|
return "*";
|
|
212760
213395
|
}
|
|
@@ -212767,7 +213402,7 @@ var require_vary = __commonJS({
|
|
|
212767
213402
|
}
|
|
212768
213403
|
return val;
|
|
212769
213404
|
}
|
|
212770
|
-
function
|
|
213405
|
+
function parse14(header) {
|
|
212771
213406
|
var end = 0;
|
|
212772
213407
|
var list = [];
|
|
212773
213408
|
var start = 0;
|
|
@@ -233269,7 +233904,7 @@ var init_crc32c = __esm({
|
|
|
233269
233904
|
});
|
|
233270
233905
|
|
|
233271
233906
|
// node_modules/.pnpm/@google-cloud+storage@7.21.0_encoding@0.1.13/node_modules/@google-cloud/storage/build/esm/src/hash-stream-validator.js
|
|
233272
|
-
import { createHash as
|
|
233907
|
+
import { createHash as createHash4 } from "crypto";
|
|
233273
233908
|
import { Transform as Transform3 } from "stream";
|
|
233274
233909
|
var __classPrivateFieldSet2, __classPrivateFieldGet2, _HashStreamValidator_crc32cHash, _HashStreamValidator_md5Hash, _HashStreamValidator_md5Digest, HashStreamValidator;
|
|
233275
233910
|
var init_hash_stream_validator = __esm({
|
|
@@ -233314,7 +233949,7 @@ var init_hash_stream_validator = __esm({
|
|
|
233314
233949
|
}
|
|
233315
233950
|
}
|
|
233316
233951
|
if (this.md5Enabled) {
|
|
233317
|
-
__classPrivateFieldSet2(this, _HashStreamValidator_md5Hash,
|
|
233952
|
+
__classPrivateFieldSet2(this, _HashStreamValidator_md5Hash, createHash4("md5"), "f");
|
|
233318
233953
|
}
|
|
233319
233954
|
}
|
|
233320
233955
|
/**
|
|
@@ -233382,7 +234017,7 @@ var init_hash_stream_validator = __esm({
|
|
|
233382
234017
|
});
|
|
233383
234018
|
|
|
233384
234019
|
// node_modules/.pnpm/@google-cloud+storage@7.21.0_encoding@0.1.13/node_modules/@google-cloud/storage/build/esm/src/resumable-upload.js
|
|
233385
|
-
import { createHash as
|
|
234020
|
+
import { createHash as createHash5 } from "crypto";
|
|
233386
234021
|
import { Readable as Readable2, Writable } from "stream";
|
|
233387
234022
|
import * as crypto10 from "crypto";
|
|
233388
234023
|
function upload(cfg) {
|
|
@@ -233514,13 +234149,13 @@ var init_resumable_upload = __esm({
|
|
|
233514
234149
|
const base64Key = Buffer.from(cfg.key).toString("base64");
|
|
233515
234150
|
this.encryption = {
|
|
233516
234151
|
key: base64Key,
|
|
233517
|
-
hash:
|
|
234152
|
+
hash: createHash5("sha256").update(cfg.key).digest("base64")
|
|
233518
234153
|
};
|
|
233519
234154
|
} else {
|
|
233520
234155
|
const base64Key = cfg.key.toString("base64");
|
|
233521
234156
|
this.encryption = {
|
|
233522
234157
|
key: base64Key,
|
|
233523
|
-
hash:
|
|
234158
|
+
hash: createHash5("sha256").update(cfg.key).digest("base64")
|
|
233524
234159
|
};
|
|
233525
234160
|
}
|
|
233526
234161
|
}
|
|
@@ -242751,7 +243386,7 @@ var init_transfer_manager = __esm({
|
|
|
242751
243386
|
});
|
|
242752
243387
|
|
|
242753
243388
|
// node_modules/.pnpm/@google-cloud+storage@7.21.0_encoding@0.1.13/node_modules/@google-cloud/storage/build/esm/src/index.js
|
|
242754
|
-
var
|
|
243389
|
+
var init_src9 = __esm({
|
|
242755
243390
|
"node_modules/.pnpm/@google-cloud+storage@7.21.0_encoding@0.1.13/node_modules/@google-cloud/storage/build/esm/src/index.js"() {
|
|
242756
243391
|
"use strict";
|
|
242757
243392
|
init_nodejs_common();
|
|
@@ -242774,7 +243409,7 @@ var require83;
|
|
|
242774
243409
|
var init_gcs_artifact_service = __esm({
|
|
242775
243410
|
"node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/artifacts/gcs_artifact_service.js"() {
|
|
242776
243411
|
"use strict";
|
|
242777
|
-
|
|
243412
|
+
init_src9();
|
|
242778
243413
|
init_node3();
|
|
242779
243414
|
init_logger();
|
|
242780
243415
|
require83 = topLevelCreateRequire82(import.meta.url);
|
|
@@ -242794,7 +243429,7 @@ var init_in_memory_artifact_service = __esm({
|
|
|
242794
243429
|
// node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/artifacts/registry.js
|
|
242795
243430
|
import { createRequire as topLevelCreateRequire84 } from "module";
|
|
242796
243431
|
var require85;
|
|
242797
|
-
var
|
|
243432
|
+
var init_registry3 = __esm({
|
|
242798
243433
|
"node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/artifacts/registry.js"() {
|
|
242799
243434
|
"use strict";
|
|
242800
243435
|
init_file_artifact_service();
|
|
@@ -265194,7 +265829,7 @@ var init_common = __esm({
|
|
|
265194
265829
|
init_apigee_llm();
|
|
265195
265830
|
init_base_llm();
|
|
265196
265831
|
init_google_llm();
|
|
265197
|
-
|
|
265832
|
+
init_registry2();
|
|
265198
265833
|
init_routed_llm();
|
|
265199
265834
|
init_base_plugin();
|
|
265200
265835
|
init_logging_plugin();
|
|
@@ -266964,7 +267599,7 @@ var require_parse4 = __commonJS({
|
|
|
266964
267599
|
CHAR_NO_BREAK_SPACE,
|
|
266965
267600
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
266966
267601
|
} = require_constants8();
|
|
266967
|
-
var
|
|
267602
|
+
var parse14 = (input, options = {}) => {
|
|
266968
267603
|
if (typeof input !== "string") {
|
|
266969
267604
|
throw new TypeError("Expected a string");
|
|
266970
267605
|
}
|
|
@@ -267168,7 +267803,7 @@ var require_parse4 = __commonJS({
|
|
|
267168
267803
|
push2({ type: "eos" });
|
|
267169
267804
|
return ast;
|
|
267170
267805
|
};
|
|
267171
|
-
module2.exports =
|
|
267806
|
+
module2.exports = parse14;
|
|
267172
267807
|
}
|
|
267173
267808
|
});
|
|
267174
267809
|
|
|
@@ -267179,7 +267814,7 @@ var require_braces = __commonJS({
|
|
|
267179
267814
|
var stringify4 = require_stringify3();
|
|
267180
267815
|
var compile = require_compile2();
|
|
267181
267816
|
var expand = require_expand();
|
|
267182
|
-
var
|
|
267817
|
+
var parse14 = require_parse4();
|
|
267183
267818
|
var braces = (input, options = {}) => {
|
|
267184
267819
|
let output = [];
|
|
267185
267820
|
if (Array.isArray(input)) {
|
|
@@ -267199,7 +267834,7 @@ var require_braces = __commonJS({
|
|
|
267199
267834
|
}
|
|
267200
267835
|
return output;
|
|
267201
267836
|
};
|
|
267202
|
-
braces.parse = (input, options = {}) =>
|
|
267837
|
+
braces.parse = (input, options = {}) => parse14(input, options);
|
|
267203
267838
|
braces.stringify = (input, options = {}) => {
|
|
267204
267839
|
if (typeof input === "string") {
|
|
267205
267840
|
return stringify4(braces.parse(input, options), options);
|
|
@@ -267857,7 +268492,7 @@ var require_parse5 = __commonJS({
|
|
|
267857
268492
|
var syntaxError = (type2, char) => {
|
|
267858
268493
|
return `Missing ${type2}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
267859
268494
|
};
|
|
267860
|
-
var
|
|
268495
|
+
var parse14 = (input, options) => {
|
|
267861
268496
|
if (typeof input !== "string") {
|
|
267862
268497
|
throw new TypeError("Expected a string");
|
|
267863
268498
|
}
|
|
@@ -268007,7 +268642,7 @@ var require_parse5 = __commonJS({
|
|
|
268007
268642
|
output = token.close = `)$))${extglobStar}`;
|
|
268008
268643
|
}
|
|
268009
268644
|
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
268010
|
-
const expression =
|
|
268645
|
+
const expression = parse14(rest, { ...options, fastpaths: false }).output;
|
|
268011
268646
|
output = token.close = `)${expression})${extglobStar})`;
|
|
268012
268647
|
}
|
|
268013
268648
|
if (token.prev.type === "bos") {
|
|
@@ -268536,7 +269171,7 @@ var require_parse5 = __commonJS({
|
|
|
268536
269171
|
}
|
|
268537
269172
|
return state;
|
|
268538
269173
|
};
|
|
268539
|
-
|
|
269174
|
+
parse14.fastpaths = (input, options) => {
|
|
268540
269175
|
const opts = { ...options };
|
|
268541
269176
|
const max2 = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
268542
269177
|
const len = input.length;
|
|
@@ -268605,7 +269240,7 @@ var require_parse5 = __commonJS({
|
|
|
268605
269240
|
}
|
|
268606
269241
|
return source;
|
|
268607
269242
|
};
|
|
268608
|
-
module2.exports =
|
|
269243
|
+
module2.exports = parse14;
|
|
268609
269244
|
}
|
|
268610
269245
|
});
|
|
268611
269246
|
|
|
@@ -268615,7 +269250,7 @@ var require_picomatch = __commonJS({
|
|
|
268615
269250
|
"use strict";
|
|
268616
269251
|
var path47 = __require("path");
|
|
268617
269252
|
var scan = require_scan();
|
|
268618
|
-
var
|
|
269253
|
+
var parse14 = require_parse5();
|
|
268619
269254
|
var utils = require_utils7();
|
|
268620
269255
|
var constants3 = require_constants9();
|
|
268621
269256
|
var isObject7 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
@@ -268705,7 +269340,7 @@ var require_picomatch = __commonJS({
|
|
|
268705
269340
|
picomatch.parse = (pattern, options) => {
|
|
268706
269341
|
if (Array.isArray(pattern))
|
|
268707
269342
|
return pattern.map((p2) => picomatch.parse(p2, options));
|
|
268708
|
-
return
|
|
269343
|
+
return parse14(pattern, { ...options, fastpaths: false });
|
|
268709
269344
|
};
|
|
268710
269345
|
picomatch.scan = (input, options) => scan(input, options);
|
|
268711
269346
|
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
@@ -268731,10 +269366,10 @@ var require_picomatch = __commonJS({
|
|
|
268731
269366
|
}
|
|
268732
269367
|
let parsed = { negated: false, fastpaths: true };
|
|
268733
269368
|
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
268734
|
-
parsed.output =
|
|
269369
|
+
parsed.output = parse14.fastpaths(input, options);
|
|
268735
269370
|
}
|
|
268736
269371
|
if (!parsed.output) {
|
|
268737
|
-
parsed =
|
|
269372
|
+
parsed = parse14(input, options);
|
|
268738
269373
|
}
|
|
268739
269374
|
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
268740
269375
|
};
|
|
@@ -274362,7 +274997,7 @@ var require_esprima = __commonJS({
|
|
|
274362
274997
|
var jsx_parser_1 = __webpack_require__(3);
|
|
274363
274998
|
var parser_1 = __webpack_require__(8);
|
|
274364
274999
|
var tokenizer_1 = __webpack_require__(15);
|
|
274365
|
-
function
|
|
275000
|
+
function parse14(code, options, delegate) {
|
|
274366
275001
|
var commentHandler = null;
|
|
274367
275002
|
var proxyDelegate = function(node, metadata) {
|
|
274368
275003
|
if (delegate) {
|
|
@@ -274407,17 +275042,17 @@ var require_esprima = __commonJS({
|
|
|
274407
275042
|
}
|
|
274408
275043
|
return ast;
|
|
274409
275044
|
}
|
|
274410
|
-
exports3.parse =
|
|
275045
|
+
exports3.parse = parse14;
|
|
274411
275046
|
function parseModule(code, options, delegate) {
|
|
274412
275047
|
var parsingOptions = options || {};
|
|
274413
275048
|
parsingOptions.sourceType = "module";
|
|
274414
|
-
return
|
|
275049
|
+
return parse14(code, parsingOptions, delegate);
|
|
274415
275050
|
}
|
|
274416
275051
|
exports3.parseModule = parseModule;
|
|
274417
275052
|
function parseScript(code, options, delegate) {
|
|
274418
275053
|
var parsingOptions = options || {};
|
|
274419
275054
|
parsingOptions.sourceType = "script";
|
|
274420
|
-
return
|
|
275055
|
+
return parse14(code, parsingOptions, delegate);
|
|
274421
275056
|
}
|
|
274422
275057
|
exports3.parseScript = parseScript;
|
|
274423
275058
|
function tokenize2(code, options, delegate) {
|
|
@@ -286258,7 +286893,7 @@ var require_main = __commonJS({
|
|
|
286258
286893
|
return supportsAnsi() ? `\x1B[2m${text2}\x1B[0m` : text2;
|
|
286259
286894
|
}
|
|
286260
286895
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
286261
|
-
function
|
|
286896
|
+
function parse14(src) {
|
|
286262
286897
|
const obj = {};
|
|
286263
286898
|
let lines = src.toString();
|
|
286264
286899
|
lines = lines.replace(/\r\n?/mg, "\n");
|
|
@@ -286530,7 +287165,7 @@ var require_main = __commonJS({
|
|
|
286530
287165
|
_parseVault,
|
|
286531
287166
|
config: config3,
|
|
286532
287167
|
decrypt,
|
|
286533
|
-
parse:
|
|
287168
|
+
parse: parse14,
|
|
286534
287169
|
populate
|
|
286535
287170
|
};
|
|
286536
287171
|
module2.exports.configDotenv = DotenvModule.configDotenv;
|
|
@@ -302405,7 +303040,7 @@ var init_vertex_ai_session_service = __esm({
|
|
|
302405
303040
|
// node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/sessions/registry.js
|
|
302406
303041
|
import { createRequire as topLevelCreateRequire150 } from "module";
|
|
302407
303042
|
var require151;
|
|
302408
|
-
var
|
|
303043
|
+
var init_registry4 = __esm({
|
|
302409
303044
|
"node_modules/.pnpm/@google+adk@1.3.0_@bufbuild+protobuf@2.12.1_@cfworker+json-schema@4.1.1_@grpc+grpc-js@1.14.4__5mkmwgy3xddtjib6vsxkdydt4e/node_modules/@google/adk/dist/esm/sessions/registry.js"() {
|
|
302410
303045
|
"use strict";
|
|
302411
303046
|
init_database_session_service();
|
|
@@ -304375,7 +305010,7 @@ var require_parse6 = __commonJS({
|
|
|
304375
305010
|
}
|
|
304376
305011
|
return parsed;
|
|
304377
305012
|
}
|
|
304378
|
-
function
|
|
305013
|
+
function parse14(command2, args, options) {
|
|
304379
305014
|
if (args && !Array.isArray(args)) {
|
|
304380
305015
|
options = args;
|
|
304381
305016
|
args = null;
|
|
@@ -304394,7 +305029,7 @@ var require_parse6 = __commonJS({
|
|
|
304394
305029
|
};
|
|
304395
305030
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
304396
305031
|
}
|
|
304397
|
-
module2.exports =
|
|
305032
|
+
module2.exports = parse14;
|
|
304398
305033
|
}
|
|
304399
305034
|
});
|
|
304400
305035
|
|
|
@@ -304453,16 +305088,16 @@ var require_cross_spawn = __commonJS({
|
|
|
304453
305088
|
"node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
304454
305089
|
"use strict";
|
|
304455
305090
|
var cp = __require("child_process");
|
|
304456
|
-
var
|
|
305091
|
+
var parse14 = require_parse6();
|
|
304457
305092
|
var enoent = require_enoent();
|
|
304458
305093
|
function spawn6(command2, args, options) {
|
|
304459
|
-
const parsed =
|
|
305094
|
+
const parsed = parse14(command2, args, options);
|
|
304460
305095
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
304461
305096
|
enoent.hookChildProcess(spawned, parsed);
|
|
304462
305097
|
return spawned;
|
|
304463
305098
|
}
|
|
304464
305099
|
function spawnSync2(command2, args, options) {
|
|
304465
|
-
const parsed =
|
|
305100
|
+
const parsed = parse14(command2, args, options);
|
|
304466
305101
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
304467
305102
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
304468
305103
|
return result;
|
|
@@ -304470,7 +305105,7 @@ var require_cross_spawn = __commonJS({
|
|
|
304470
305105
|
module2.exports = spawn6;
|
|
304471
305106
|
module2.exports.spawn = spawn6;
|
|
304472
305107
|
module2.exports.sync = spawnSync2;
|
|
304473
|
-
module2.exports._parse =
|
|
305108
|
+
module2.exports._parse = parse14;
|
|
304474
305109
|
module2.exports._enoent = enoent;
|
|
304475
305110
|
}
|
|
304476
305111
|
});
|
|
@@ -311307,11 +311942,11 @@ var require_lib8 = __commonJS({
|
|
|
311307
311942
|
"node_modules/.pnpm/qs@6.15.3/node_modules/qs/lib/index.js"(exports2, module2) {
|
|
311308
311943
|
"use strict";
|
|
311309
311944
|
var stringify4 = require_stringify4();
|
|
311310
|
-
var
|
|
311945
|
+
var parse14 = require_parse7();
|
|
311311
311946
|
var formats = require_formats3();
|
|
311312
311947
|
module2.exports = {
|
|
311313
311948
|
formats,
|
|
311314
|
-
parse:
|
|
311949
|
+
parse: parse14,
|
|
311315
311950
|
stringify: stringify4
|
|
311316
311951
|
};
|
|
311317
311952
|
}
|
|
@@ -326336,7 +326971,7 @@ var require_root = __commonJS({
|
|
|
326336
326971
|
var OneOf = require_oneof();
|
|
326337
326972
|
var util3 = require_util11();
|
|
326338
326973
|
var Type4;
|
|
326339
|
-
var
|
|
326974
|
+
var parse14;
|
|
326340
326975
|
var common3;
|
|
326341
326976
|
function Root(options) {
|
|
326342
326977
|
Namespace.call(this, "", options);
|
|
@@ -326396,8 +327031,8 @@ var require_root = __commonJS({
|
|
|
326396
327031
|
if (!util3.isString(source))
|
|
326397
327032
|
self2.setOptions(source.options).addJSON(source.nested);
|
|
326398
327033
|
else {
|
|
326399
|
-
|
|
326400
|
-
var parsed =
|
|
327034
|
+
parse14.filename = filename2;
|
|
327035
|
+
var parsed = parse14(source, self2, options), resolved2, i3 = 0;
|
|
326401
327036
|
if (parsed.imports) {
|
|
326402
327037
|
for (; i3 < parsed.imports.length; ++i3)
|
|
326403
327038
|
if (resolved2 = getBundledFileName(parsed.imports[i3]) || self2.resolvePath(filename2, parsed.imports[i3]))
|
|
@@ -326569,7 +327204,7 @@ var require_root = __commonJS({
|
|
|
326569
327204
|
};
|
|
326570
327205
|
Root._configure = function(Type_, parse_, common_) {
|
|
326571
327206
|
Type4 = Type_;
|
|
326572
|
-
|
|
327207
|
+
parse14 = parse_;
|
|
326573
327208
|
common3 = common_;
|
|
326574
327209
|
};
|
|
326575
327210
|
}
|
|
@@ -327834,9 +328469,9 @@ var require_tokenize = __commonJS({
|
|
|
327834
328469
|
var require_parse8 = __commonJS({
|
|
327835
328470
|
"node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/parse.js"(exports2, module2) {
|
|
327836
328471
|
"use strict";
|
|
327837
|
-
module2.exports =
|
|
327838
|
-
|
|
327839
|
-
|
|
328472
|
+
module2.exports = parse14;
|
|
328473
|
+
parse14.filename = null;
|
|
328474
|
+
parse14.defaults = { keepCase: false };
|
|
327840
328475
|
var tokenize2 = require_tokenize();
|
|
327841
328476
|
var Root = require_root();
|
|
327842
328477
|
var Type4 = require_type2();
|
|
@@ -327858,13 +328493,13 @@ var require_parse8 = __commonJS({
|
|
|
327858
328493
|
var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;
|
|
327859
328494
|
var nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/;
|
|
327860
328495
|
var typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
327861
|
-
function
|
|
328496
|
+
function parse14(source, root2, options) {
|
|
327862
328497
|
if (!(root2 instanceof Root)) {
|
|
327863
328498
|
options = root2;
|
|
327864
328499
|
root2 = new Root();
|
|
327865
328500
|
}
|
|
327866
328501
|
if (!options)
|
|
327867
|
-
options =
|
|
328502
|
+
options = parse14.defaults;
|
|
327868
328503
|
var preferTrailingComment = options.preferTrailingComment || false;
|
|
327869
328504
|
var tn = tokenize2(source, options.alternateCommentMode || false), next = tn.next, push2 = tn.push, peek = tn.peek, skip = tn.skip, cmnt = tn.cmnt;
|
|
327870
328505
|
var head = true, pkg, imports, weakImports, edition = "proto2";
|
|
@@ -327885,9 +328520,9 @@ var require_parse8 = __commonJS({
|
|
|
327885
328520
|
});
|
|
327886
328521
|
}
|
|
327887
328522
|
function illegal(token2, name, insideTryCatch) {
|
|
327888
|
-
var filename =
|
|
328523
|
+
var filename = parse14.filename;
|
|
327889
328524
|
if (!insideTryCatch)
|
|
327890
|
-
|
|
328525
|
+
parse14.filename = null;
|
|
327891
328526
|
return Error("illegal " + (name || "token") + " '" + token2 + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")");
|
|
327892
328527
|
}
|
|
327893
328528
|
function readString() {
|
|
@@ -328085,7 +328720,7 @@ var require_parse8 = __commonJS({
|
|
|
328085
328720
|
if (typeof obj.comment !== "string") {
|
|
328086
328721
|
obj.comment = cmnt();
|
|
328087
328722
|
}
|
|
328088
|
-
obj.filename =
|
|
328723
|
+
obj.filename = parse14.filename;
|
|
328089
328724
|
}
|
|
328090
328725
|
if (skip("{", true)) {
|
|
328091
328726
|
var token2;
|
|
@@ -328202,7 +328837,7 @@ var require_parse8 = __commonJS({
|
|
|
328202
328837
|
var type2 = new Type4(name);
|
|
328203
328838
|
type2.group = true;
|
|
328204
328839
|
var field = new Field(fieldName, id, name, rule);
|
|
328205
|
-
field.filename =
|
|
328840
|
+
field.filename = parse14.filename;
|
|
328206
328841
|
ifBlock(type2, function parseGroup_block(token2) {
|
|
328207
328842
|
switch (token2) {
|
|
328208
328843
|
case "option":
|
|
@@ -328538,7 +329173,7 @@ var require_parse8 = __commonJS({
|
|
|
328538
329173
|
}
|
|
328539
329174
|
}
|
|
328540
329175
|
resolveFileFeatures();
|
|
328541
|
-
|
|
329176
|
+
parse14.filename = null;
|
|
328542
329177
|
return {
|
|
328543
329178
|
"package": pkg,
|
|
328544
329179
|
"imports": imports,
|
|
@@ -350245,13 +350880,13 @@ var init_esm6 = __esm({
|
|
|
350245
350880
|
init_invocation_context();
|
|
350246
350881
|
init_file_artifact_service();
|
|
350247
350882
|
init_gcs_artifact_service();
|
|
350248
|
-
|
|
350883
|
+
init_registry3();
|
|
350249
350884
|
init_agent_engine_sandbox_code_executor();
|
|
350250
350885
|
init_code_execution_utils();
|
|
350251
350886
|
init_unsafe_local_code_executor();
|
|
350252
350887
|
init_common();
|
|
350253
350888
|
init_database_session_service();
|
|
350254
|
-
|
|
350889
|
+
init_registry4();
|
|
350255
350890
|
init_vertex_ai_session_service();
|
|
350256
350891
|
init_loader();
|
|
350257
350892
|
init_run_skill_inline_script_tool();
|
|
@@ -350977,7 +351612,7 @@ __export(src_exports3, {
|
|
|
350977
351612
|
normalizeAdkSession: () => normalizeAdkSession,
|
|
350978
351613
|
resolveAdkConfigFromEnv: () => resolveAdkConfigFromEnv
|
|
350979
351614
|
});
|
|
350980
|
-
var
|
|
351615
|
+
var init_src10 = __esm({
|
|
350981
351616
|
"libs/import-adk/src/index.ts"() {
|
|
350982
351617
|
"use strict";
|
|
350983
351618
|
init_extract();
|
|
@@ -359643,7 +360278,7 @@ var require_parse9 = __commonJS({
|
|
|
359643
360278
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
359644
360279
|
"use strict";
|
|
359645
360280
|
var SemVer = require_semver3();
|
|
359646
|
-
var
|
|
360281
|
+
var parse14 = (version6, options, throwErrors = false) => {
|
|
359647
360282
|
if (version6 instanceof SemVer) {
|
|
359648
360283
|
return version6;
|
|
359649
360284
|
}
|
|
@@ -359656,7 +360291,7 @@ var require_parse9 = __commonJS({
|
|
|
359656
360291
|
throw er;
|
|
359657
360292
|
}
|
|
359658
360293
|
};
|
|
359659
|
-
module2.exports =
|
|
360294
|
+
module2.exports = parse14;
|
|
359660
360295
|
}
|
|
359661
360296
|
});
|
|
359662
360297
|
|
|
@@ -359664,9 +360299,9 @@ var require_parse9 = __commonJS({
|
|
|
359664
360299
|
var require_valid3 = __commonJS({
|
|
359665
360300
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
359666
360301
|
"use strict";
|
|
359667
|
-
var
|
|
360302
|
+
var parse14 = require_parse9();
|
|
359668
360303
|
var valid = (version6, options) => {
|
|
359669
|
-
const v =
|
|
360304
|
+
const v = parse14(version6, options);
|
|
359670
360305
|
return v ? v.version : null;
|
|
359671
360306
|
};
|
|
359672
360307
|
module2.exports = valid;
|
|
@@ -359677,9 +360312,9 @@ var require_valid3 = __commonJS({
|
|
|
359677
360312
|
var require_clean2 = __commonJS({
|
|
359678
360313
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
359679
360314
|
"use strict";
|
|
359680
|
-
var
|
|
360315
|
+
var parse14 = require_parse9();
|
|
359681
360316
|
var clean = (version6, options) => {
|
|
359682
|
-
const s2 =
|
|
360317
|
+
const s2 = parse14(version6.trim().replace(/^[=v]+/, ""), options);
|
|
359683
360318
|
return s2 ? s2.version : null;
|
|
359684
360319
|
};
|
|
359685
360320
|
module2.exports = clean;
|
|
@@ -359714,10 +360349,10 @@ var require_inc2 = __commonJS({
|
|
|
359714
360349
|
var require_diff2 = __commonJS({
|
|
359715
360350
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
359716
360351
|
"use strict";
|
|
359717
|
-
var
|
|
360352
|
+
var parse14 = require_parse9();
|
|
359718
360353
|
var diff2 = (version1, version22) => {
|
|
359719
|
-
const v13 =
|
|
359720
|
-
const v2 =
|
|
360354
|
+
const v13 = parse14(version1, null, true);
|
|
360355
|
+
const v2 = parse14(version22, null, true);
|
|
359721
360356
|
const comparison = v13.compare(v2);
|
|
359722
360357
|
if (comparison === 0) {
|
|
359723
360358
|
return null;
|
|
@@ -359788,9 +360423,9 @@ var require_patch2 = __commonJS({
|
|
|
359788
360423
|
var require_prerelease2 = __commonJS({
|
|
359789
360424
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
359790
360425
|
"use strict";
|
|
359791
|
-
var
|
|
360426
|
+
var parse14 = require_parse9();
|
|
359792
360427
|
var prerelease = (version6, options) => {
|
|
359793
|
-
const parsed =
|
|
360428
|
+
const parsed = parse14(version6, options);
|
|
359794
360429
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
359795
360430
|
};
|
|
359796
360431
|
module2.exports = prerelease;
|
|
@@ -359976,7 +360611,7 @@ var require_coerce2 = __commonJS({
|
|
|
359976
360611
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
359977
360612
|
"use strict";
|
|
359978
360613
|
var SemVer = require_semver3();
|
|
359979
|
-
var
|
|
360614
|
+
var parse14 = require_parse9();
|
|
359980
360615
|
var { safeRe: re3, t: t3 } = require_re2();
|
|
359981
360616
|
var coerce = (version6, options) => {
|
|
359982
360617
|
if (version6 instanceof SemVer) {
|
|
@@ -360011,7 +360646,7 @@ var require_coerce2 = __commonJS({
|
|
|
360011
360646
|
const patch = match2[4] || "0";
|
|
360012
360647
|
const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
|
360013
360648
|
const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
|
360014
|
-
return
|
|
360649
|
+
return parse14(`${major3}.${minor}.${patch}${prerelease}${build}`, options);
|
|
360015
360650
|
};
|
|
360016
360651
|
module2.exports = coerce;
|
|
360017
360652
|
}
|
|
@@ -360021,7 +360656,7 @@ var require_coerce2 = __commonJS({
|
|
|
360021
360656
|
var require_truncate = __commonJS({
|
|
360022
360657
|
"node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
360023
360658
|
"use strict";
|
|
360024
|
-
var
|
|
360659
|
+
var parse14 = require_parse9();
|
|
360025
360660
|
var constants3 = require_constants14();
|
|
360026
360661
|
var SemVer = require_semver3();
|
|
360027
360662
|
var truncate2 = (version6, truncation, options) => {
|
|
@@ -360033,7 +360668,7 @@ var require_truncate = __commonJS({
|
|
|
360033
360668
|
};
|
|
360034
360669
|
var cloneInputVersion = (version6, options) => {
|
|
360035
360670
|
const versionStringToParse = version6 instanceof SemVer ? version6.version : version6;
|
|
360036
|
-
return
|
|
360671
|
+
return parse14(versionStringToParse, options);
|
|
360037
360672
|
};
|
|
360038
360673
|
var doTruncation = (version6, truncation) => {
|
|
360039
360674
|
if (isPrerelease(truncation)) {
|
|
@@ -361076,7 +361711,7 @@ var require_semver4 = __commonJS({
|
|
|
361076
361711
|
var constants3 = require_constants14();
|
|
361077
361712
|
var SemVer = require_semver3();
|
|
361078
361713
|
var identifiers = require_identifiers2();
|
|
361079
|
-
var
|
|
361714
|
+
var parse14 = require_parse9();
|
|
361080
361715
|
var valid = require_valid3();
|
|
361081
361716
|
var clean = require_clean2();
|
|
361082
361717
|
var inc = require_inc2();
|
|
@@ -361115,7 +361750,7 @@ var require_semver4 = __commonJS({
|
|
|
361115
361750
|
var simplifyRange = require_simplify2();
|
|
361116
361751
|
var subset = require_subset2();
|
|
361117
361752
|
module2.exports = {
|
|
361118
|
-
parse:
|
|
361753
|
+
parse: parse14,
|
|
361119
361754
|
valid,
|
|
361120
361755
|
clean,
|
|
361121
361756
|
inc,
|
|
@@ -376392,7 +377027,9 @@ var init_messages6 = __esm({
|
|
|
376392
377027
|
content.push(reasoning);
|
|
376393
377028
|
}
|
|
376394
377029
|
}
|
|
376395
|
-
content.push(
|
|
377030
|
+
content.push(
|
|
377031
|
+
...contentBlocksFrom(message.content)
|
|
377032
|
+
);
|
|
376396
377033
|
if (type2 === "ai") {
|
|
376397
377034
|
content.push(...toolCallBlocksFrom(message));
|
|
376398
377035
|
}
|
|
@@ -376405,6 +377042,8 @@ var init_messages6 = __esm({
|
|
|
376405
377042
|
content
|
|
376406
377043
|
};
|
|
376407
377044
|
if (type2 === "tool") {
|
|
377045
|
+
if ("status" in message && message.status === "error")
|
|
377046
|
+
normalized.error = "error";
|
|
376408
377047
|
const toolCallId = message.tool_call_id;
|
|
376409
377048
|
if (typeof toolCallId === "string" && toolCallId !== "") {
|
|
376410
377049
|
return { ...normalized, toolCallId };
|
|
@@ -376541,6 +377180,135 @@ var init_state2 = __esm({
|
|
|
376541
377180
|
}
|
|
376542
377181
|
});
|
|
376543
377182
|
|
|
377183
|
+
// libs/import-langgraph/src/state-snapshot.ts
|
|
377184
|
+
var defaultWarn2, assistantSchema, createAssistantSchemaCache, hasRecoverableState, readAssistantSchemas, readStateSnapshot;
|
|
377185
|
+
var init_state_snapshot = __esm({
|
|
377186
|
+
"libs/import-langgraph/src/state-snapshot.ts"() {
|
|
377187
|
+
"use strict";
|
|
377188
|
+
init_zod();
|
|
377189
|
+
defaultWarn2 = (warning) => {
|
|
377190
|
+
console.warn("[import-langgraph] schema lookup fallback", warning);
|
|
377191
|
+
};
|
|
377192
|
+
assistantSchema = external_exports.object({
|
|
377193
|
+
output_schema: external_exports.object({
|
|
377194
|
+
properties: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
377195
|
+
}).loose().nullish()
|
|
377196
|
+
}).loose();
|
|
377197
|
+
createAssistantSchemaCache = () => /* @__PURE__ */ new Map();
|
|
377198
|
+
hasRecoverableState = (values) => {
|
|
377199
|
+
if (values === void 0 || values === null)
|
|
377200
|
+
return false;
|
|
377201
|
+
if (typeof values !== "object")
|
|
377202
|
+
return true;
|
|
377203
|
+
return Object.keys(values).length > 0;
|
|
377204
|
+
};
|
|
377205
|
+
readAssistantSchemas = async (assistants, assistantId, cache3, onLookupFailure) => {
|
|
377206
|
+
if (cache3.has(assistantId))
|
|
377207
|
+
return cache3.get(assistantId);
|
|
377208
|
+
try {
|
|
377209
|
+
const schemas = await assistants.getSchemas(assistantId);
|
|
377210
|
+
cache3.set(assistantId, schemas);
|
|
377211
|
+
return schemas;
|
|
377212
|
+
} catch {
|
|
377213
|
+
onLookupFailure();
|
|
377214
|
+
return { output_schema: { properties: { messages: {}, tools: {} } } };
|
|
377215
|
+
}
|
|
377216
|
+
};
|
|
377217
|
+
readStateSnapshot = async (client2, thread, checkpoints, assistantId, cache3, onWarn = defaultWarn2) => {
|
|
377218
|
+
const values = checkpoints[0]?.values !== void 0 ? checkpoints[0].values : thread.values;
|
|
377219
|
+
if (!hasRecoverableState(values))
|
|
377220
|
+
return void 0;
|
|
377221
|
+
const assistants = client2.assistants;
|
|
377222
|
+
if (assistants === void 0)
|
|
377223
|
+
return values;
|
|
377224
|
+
const schemas = await readAssistantSchemas(
|
|
377225
|
+
assistants,
|
|
377226
|
+
assistantId,
|
|
377227
|
+
cache3,
|
|
377228
|
+
() => onWarn({
|
|
377229
|
+
reason: "schema_lookup_fallback",
|
|
377230
|
+
sourceThreadId: thread.thread_id,
|
|
377231
|
+
assistantId,
|
|
377232
|
+
detail: "State limited to messages and tools. After fixing schema access, re-import with --replace to recover graph-defined state."
|
|
377233
|
+
})
|
|
377234
|
+
);
|
|
377235
|
+
if (schemas === void 0)
|
|
377236
|
+
return values;
|
|
377237
|
+
const schema2 = assistantSchema.safeParse(schemas);
|
|
377238
|
+
const properties = schema2.success ? schema2.data.output_schema?.properties : void 0;
|
|
377239
|
+
if (properties === void 0 || Object.keys(properties).length === 0 || typeof values !== "object" || values === null || Array.isArray(values)) {
|
|
377240
|
+
return values;
|
|
377241
|
+
}
|
|
377242
|
+
const keys2 = /* @__PURE__ */ new Set(["messages", "tools", ...Object.keys(properties)]);
|
|
377243
|
+
const projected = Object.fromEntries(
|
|
377244
|
+
Object.entries(values).filter(([key]) => keys2.has(key))
|
|
377245
|
+
);
|
|
377246
|
+
return hasRecoverableState(projected) ? projected : void 0;
|
|
377247
|
+
};
|
|
377248
|
+
}
|
|
377249
|
+
});
|
|
377250
|
+
|
|
377251
|
+
// libs/import-langgraph/src/interrupts.ts
|
|
377252
|
+
var headInterruptsSchema, readHeadInterrupts, readPendingInterrupts;
|
|
377253
|
+
var init_interrupts2 = __esm({
|
|
377254
|
+
"libs/import-langgraph/src/interrupts.ts"() {
|
|
377255
|
+
"use strict";
|
|
377256
|
+
init_src7();
|
|
377257
|
+
init_zod();
|
|
377258
|
+
headInterruptsSchema = external_exports.object({ interrupts: external_exports.array(external_exports.unknown()).optional() }).loose();
|
|
377259
|
+
readHeadInterrupts = (head) => {
|
|
377260
|
+
const parsed = headInterruptsSchema.safeParse(head);
|
|
377261
|
+
return parsed.success ? parsed.data.interrupts ?? [] : [];
|
|
377262
|
+
};
|
|
377263
|
+
readPendingInterrupts = (head, thread) => {
|
|
377264
|
+
const fromTasks = (head?.tasks ?? []).flatMap(
|
|
377265
|
+
(task) => task.interrupts ?? []
|
|
377266
|
+
);
|
|
377267
|
+
const fromHead = head === void 0 ? [] : readHeadInterrupts(head);
|
|
377268
|
+
const fromThread = external_exports.record(external_exports.string(), external_exports.array(external_exports.unknown())).safeParse(thread?.interrupts);
|
|
377269
|
+
const raw2 = fromTasks.length > 0 ? fromTasks : fromHead.length > 0 ? fromHead : fromThread.success ? Object.values(fromThread.data).flat() : [];
|
|
377270
|
+
const seen = /* @__PURE__ */ new Set();
|
|
377271
|
+
const result = [];
|
|
377272
|
+
for (const candidate of raw2) {
|
|
377273
|
+
const parsed = NormalizedPendingInterruptSchema.safeParse(candidate);
|
|
377274
|
+
if (!parsed.success)
|
|
377275
|
+
continue;
|
|
377276
|
+
const interrupt = parsed.data;
|
|
377277
|
+
if (interrupt.id !== void 0) {
|
|
377278
|
+
if (seen.has(interrupt.id))
|
|
377279
|
+
continue;
|
|
377280
|
+
seen.add(interrupt.id);
|
|
377281
|
+
}
|
|
377282
|
+
result.push(interrupt);
|
|
377283
|
+
}
|
|
377284
|
+
return result;
|
|
377285
|
+
};
|
|
377286
|
+
}
|
|
377287
|
+
});
|
|
377288
|
+
|
|
377289
|
+
// libs/import-langgraph/src/errors.ts
|
|
377290
|
+
var readTaskError, readRunErrors;
|
|
377291
|
+
var init_errors10 = __esm({
|
|
377292
|
+
"libs/import-langgraph/src/errors.ts"() {
|
|
377293
|
+
"use strict";
|
|
377294
|
+
readTaskError = (checkpoint) => {
|
|
377295
|
+
const errors = (checkpoint?.tasks ?? []).flatMap(
|
|
377296
|
+
(task) => typeof task.error === "string" && task.error.trim() !== "" ? [task.error] : []
|
|
377297
|
+
);
|
|
377298
|
+
return errors.length > 0 ? [...new Set(errors)].join("\n") : void 0;
|
|
377299
|
+
};
|
|
377300
|
+
readRunErrors = (checkpoints) => {
|
|
377301
|
+
const errors = /* @__PURE__ */ new Map();
|
|
377302
|
+
for (const checkpoint of checkpoints) {
|
|
377303
|
+
const runId = checkpoint.metadata?.["run_id"];
|
|
377304
|
+
if (typeof runId === "string" && !errors.has(runId))
|
|
377305
|
+
errors.set(runId, readTaskError(checkpoint));
|
|
377306
|
+
}
|
|
377307
|
+
return errors;
|
|
377308
|
+
};
|
|
377309
|
+
}
|
|
377310
|
+
});
|
|
377311
|
+
|
|
376544
377312
|
// libs/import-langgraph/src/user-source.ts
|
|
376545
377313
|
var LANGGRAPH_AUTH_USER_ID_KEY, parseUserSource, readStringField, readValuesStringField, resolveEndUserId;
|
|
376546
377314
|
var init_user_source = __esm({
|
|
@@ -376635,9 +377403,16 @@ async function* streamLangGraph(config3) {
|
|
|
376635
377403
|
const client2 = await resolveClient(config3);
|
|
376636
377404
|
const userSource = parseUserSource(config3.userSource);
|
|
376637
377405
|
const pageSize = config3.pageSize ?? DEFAULT_THREAD_PAGE_SIZE;
|
|
377406
|
+
const schemaCache = createAssistantSchemaCache();
|
|
376638
377407
|
for await (const thread of enumerateThreads(client2, pageSize)) {
|
|
376639
377408
|
try {
|
|
376640
|
-
yield await extractThread(
|
|
377409
|
+
yield await extractThread(
|
|
377410
|
+
client2,
|
|
377411
|
+
thread,
|
|
377412
|
+
userSource,
|
|
377413
|
+
schemaCache,
|
|
377414
|
+
config3.onWarn
|
|
377415
|
+
);
|
|
376641
377416
|
} catch (error98) {
|
|
376642
377417
|
yield {
|
|
376643
377418
|
kind: "failed",
|
|
@@ -376654,16 +377429,19 @@ var DEFAULT_THREAD_PAGE_SIZE, FULL_HISTORY_LIMIT, synthesizeSingleRun, errorMess
|
|
|
376654
377429
|
var init_extract2 = __esm({
|
|
376655
377430
|
"libs/import-langgraph/src/extract.ts"() {
|
|
376656
377431
|
"use strict";
|
|
376657
|
-
|
|
377432
|
+
init_src7();
|
|
376658
377433
|
init_client7();
|
|
376659
377434
|
init_graph_id();
|
|
376660
377435
|
init_runs2();
|
|
376661
377436
|
init_state2();
|
|
377437
|
+
init_state_snapshot();
|
|
377438
|
+
init_interrupts2();
|
|
377439
|
+
init_errors10();
|
|
376662
377440
|
init_user_source();
|
|
376663
377441
|
DEFAULT_THREAD_PAGE_SIZE = 50;
|
|
376664
377442
|
FULL_HISTORY_LIMIT = 1e3;
|
|
376665
|
-
synthesizeSingleRun = (threadId, messages, activityAt) => {
|
|
376666
|
-
if (messages.length === 0) {
|
|
377443
|
+
synthesizeSingleRun = (threadId, messages, activityAt, hasState = false) => {
|
|
377444
|
+
if (messages.length === 0 && !hasState) {
|
|
376667
377445
|
return null;
|
|
376668
377446
|
}
|
|
376669
377447
|
return {
|
|
@@ -376695,7 +377473,7 @@ var init_extract2 = __esm({
|
|
|
376695
377473
|
const head = await client2.threads.getState(threadId);
|
|
376696
377474
|
return [head];
|
|
376697
377475
|
};
|
|
376698
|
-
extractThread = async (client2, thread, userSource) => {
|
|
377476
|
+
extractThread = async (client2, thread, userSource, schemaCache, onWarn) => {
|
|
376699
377477
|
const threadId = thread.thread_id;
|
|
376700
377478
|
const checkpoints = await readCheckpoints(client2, threadId);
|
|
376701
377479
|
const graphResolution = resolveGraphId(thread, checkpoints);
|
|
@@ -376713,9 +377491,27 @@ var init_extract2 = __esm({
|
|
|
376713
377491
|
}
|
|
376714
377492
|
const messages = readMessages(thread, checkpoints);
|
|
376715
377493
|
const lastActivityAt = readLastActivityAt(thread, checkpoints);
|
|
376716
|
-
const rawRuns = await client2.runs.list(threadId, {
|
|
377494
|
+
const rawRuns = await client2.runs.list(threadId, {
|
|
377495
|
+
limit: FULL_HISTORY_LIMIT
|
|
377496
|
+
});
|
|
376717
377497
|
const sortedRuns = sortRunsChronologically(rawRuns);
|
|
376718
|
-
const
|
|
377498
|
+
const runErrors = readRunErrors(checkpoints);
|
|
377499
|
+
const headError = readTaskError(checkpoints[0]);
|
|
377500
|
+
const pendingInterrupts = readPendingInterrupts(checkpoints[0], thread);
|
|
377501
|
+
const stateSnapshot = await readStateSnapshot(
|
|
377502
|
+
client2,
|
|
377503
|
+
thread,
|
|
377504
|
+
checkpoints,
|
|
377505
|
+
sortedRuns.at(-1)?.assistant_id ?? graphResolution.graphId,
|
|
377506
|
+
schemaCache,
|
|
377507
|
+
onWarn
|
|
377508
|
+
);
|
|
377509
|
+
const synthetic = synthesizeSingleRun(
|
|
377510
|
+
threadId,
|
|
377511
|
+
messages,
|
|
377512
|
+
lastActivityAt,
|
|
377513
|
+
stateSnapshot !== void 0 || pendingInterrupts.length > 0 || headError !== void 0
|
|
377514
|
+
);
|
|
376719
377515
|
const runs = sortedRuns.length === 0 && synthetic !== null ? [synthetic] : sortedRuns;
|
|
376720
377516
|
const spans = partitionMessagesByRun(messages, runs);
|
|
376721
377517
|
const normalizedRuns = [];
|
|
@@ -376723,7 +377519,13 @@ var init_extract2 = __esm({
|
|
|
376723
377519
|
for (const span of spans) {
|
|
376724
377520
|
const slice = messages.slice(cursor, cursor + span.messageCount);
|
|
376725
377521
|
cursor += span.messageCount;
|
|
376726
|
-
|
|
377522
|
+
const normalized = normalizeRun(span, slice);
|
|
377523
|
+
const recordedError = sortedRuns.length === 0 ? headError : runErrors.get(normalized.sourceRunId);
|
|
377524
|
+
if (sortedRuns.length === 0 && recordedError !== void 0)
|
|
377525
|
+
normalized.status = "error";
|
|
377526
|
+
if (normalized.status === "error" && recordedError !== void 0)
|
|
377527
|
+
normalized.errorMessage = recordedError;
|
|
377528
|
+
normalizedRuns.push(normalized);
|
|
376727
377529
|
}
|
|
376728
377530
|
const endUserId = resolveEndUserId(userSource, thread, checkpoints);
|
|
376729
377531
|
const conversation = {
|
|
@@ -376732,6 +377534,8 @@ var init_extract2 = __esm({
|
|
|
376732
377534
|
sourceBackend: "server",
|
|
376733
377535
|
endUserId,
|
|
376734
377536
|
...lastActivityAt !== void 0 ? { lastActivityAt } : {},
|
|
377537
|
+
...stateSnapshot !== void 0 ? { stateSnapshot } : {},
|
|
377538
|
+
...pendingInterrupts.length > 0 ? { pendingInterrupts } : {},
|
|
376735
377539
|
runs: normalizedRuns
|
|
376736
377540
|
};
|
|
376737
377541
|
return {
|
|
@@ -376778,7 +377582,7 @@ __export(src_exports4, {
|
|
|
376778
377582
|
sumUsage: () => sumUsage,
|
|
376779
377583
|
usageFromMessage: () => usageFromMessage
|
|
376780
377584
|
});
|
|
376781
|
-
var
|
|
377585
|
+
var init_src11 = __esm({
|
|
376782
377586
|
"libs/import-langgraph/src/index.ts"() {
|
|
376783
377587
|
"use strict";
|
|
376784
377588
|
init_extract2();
|
|
@@ -376883,7 +377687,7 @@ async function enumerateSource(config3) {
|
|
|
376883
377687
|
return fixture;
|
|
376884
377688
|
}
|
|
376885
377689
|
if (config3.source === "adk") {
|
|
376886
|
-
const { extractAdk: extractAdk2 } = await Promise.resolve().then(() => (
|
|
377690
|
+
const { extractAdk: extractAdk2 } = await Promise.resolve().then(() => (init_src10(), src_exports3));
|
|
376887
377691
|
const adkEnv = {
|
|
376888
377692
|
...process.env,
|
|
376889
377693
|
...config3.adkSourceBackend !== void 0 ? { ADK_SOURCE_BACKEND: config3.adkSourceBackend } : {},
|
|
@@ -376915,7 +377719,7 @@ async function enumerateSource(config3) {
|
|
|
376915
377719
|
TELEMETRY_ERROR_CODES.PREREQUISITE_MISSING
|
|
376916
377720
|
);
|
|
376917
377721
|
}
|
|
376918
|
-
const { streamLangGraph: streamLangGraph2 } = await Promise.resolve().then(() => (
|
|
377722
|
+
const { streamLangGraph: streamLangGraph2 } = await Promise.resolve().then(() => (init_src11(), src_exports4));
|
|
376919
377723
|
const conversations = [];
|
|
376920
377724
|
const skipped = [];
|
|
376921
377725
|
const failures = [];
|
|
@@ -377372,7 +378176,7 @@ ${formatStaleBuildNote()}`);
|
|
|
377372
378176
|
var init_telemetry2 = __esm({
|
|
377373
378177
|
"apps/cli/src/commands/telemetry.ts"() {
|
|
377374
378178
|
"use strict";
|
|
377375
|
-
|
|
378179
|
+
init_src4();
|
|
377376
378180
|
init_config();
|
|
377377
378181
|
init_unknown_input();
|
|
377378
378182
|
}
|
|
@@ -378901,6 +379705,14 @@ function declareChannel(config3, channel2) {
|
|
|
378901
379705
|
)
|
|
378902
379706
|
};
|
|
378903
379707
|
}
|
|
379708
|
+
function renameChannelDisplayName(config3, channel2) {
|
|
379709
|
+
return {
|
|
379710
|
+
...config3,
|
|
379711
|
+
channels: config3.channels.map(
|
|
379712
|
+
(declared) => declared.name === channel2.name ? { ...declared, displayName: channel2.displayName } : declared
|
|
379713
|
+
)
|
|
379714
|
+
};
|
|
379715
|
+
}
|
|
378904
379716
|
function requiredCredentialEnvNames(config3, channelName, adapter2) {
|
|
378905
379717
|
const declared = config3.channels.find(
|
|
378906
379718
|
(channel2) => channel2.name === channelName
|
|
@@ -379045,7 +379857,7 @@ function createSlackIngressUrl(input) {
|
|
|
379045
379857
|
return new URL(input.path, ingressBaseUrl).toString();
|
|
379046
379858
|
}
|
|
379047
379859
|
function createSlackAppDisplayName(channelDisplayName) {
|
|
379048
|
-
return [...channelDisplayName].slice(0,
|
|
379860
|
+
return [...channelDisplayName.trim()].slice(0, SLACK_APP_NAME_MAX_LENGTH).join("");
|
|
379049
379861
|
}
|
|
379050
379862
|
function normalizeSlackIdentity(value) {
|
|
379051
379863
|
return value.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "").slice(0, 80).replace(/-+$/gu, "");
|
|
@@ -379058,6 +379870,33 @@ function createSlackBotDisplayName(channelDisplayName, fallbackName = DEFAULT_SL
|
|
|
379058
379870
|
const safeFallback = normalizeSlackIdentity(fallbackName);
|
|
379059
379871
|
return safeFallback && !RESERVED_SLACK_IDENTITIES.has(safeFallback) ? safeFallback : DEFAULT_SLACK_IDENTITY;
|
|
379060
379872
|
}
|
|
379873
|
+
function suggestSlackDisplayName(channelName) {
|
|
379874
|
+
const words = channelName.normalize("NFKD").toLowerCase().split(/[^a-z0-9]+/u).filter((word) => word.length > 0).map((word) => `${word.slice(0, 1).toUpperCase()}${word.slice(1)}`);
|
|
379875
|
+
const suggestion = [...words.join(" ")].slice(0, SLACK_APP_NAME_MAX_LENGTH).join("").trim();
|
|
379876
|
+
return suggestion.length > 0 ? suggestion : DEFAULT_SLACK_APP_NAME;
|
|
379877
|
+
}
|
|
379878
|
+
function validateSlackDisplayName(input) {
|
|
379879
|
+
const appName = input.channelDisplayName.trim();
|
|
379880
|
+
const suggestion = suggestSlackDisplayName(input.channelName);
|
|
379881
|
+
if (appName.length === 0) {
|
|
379882
|
+
return {
|
|
379883
|
+
message: `A Slack app needs a name: Slack rejects a manifest whose display_information.name is empty. Pass --display-name, for example "${suggestion}".`,
|
|
379884
|
+
status: "invalid",
|
|
379885
|
+
suggestion,
|
|
379886
|
+
violation: "empty"
|
|
379887
|
+
};
|
|
379888
|
+
}
|
|
379889
|
+
const length = [...appName].length;
|
|
379890
|
+
if (length > SLACK_APP_NAME_MAX_LENGTH) {
|
|
379891
|
+
return {
|
|
379892
|
+
message: `A Slack app name may be at most ${SLACK_APP_NAME_MAX_LENGTH} characters, and "${appName}" is ${length}. Pass a shorter --display-name, for example "${suggestion}".`,
|
|
379893
|
+
status: "invalid",
|
|
379894
|
+
suggestion,
|
|
379895
|
+
violation: "too_long"
|
|
379896
|
+
};
|
|
379897
|
+
}
|
|
379898
|
+
return { status: "ok" };
|
|
379899
|
+
}
|
|
379061
379900
|
function createSlackInviteCommand(channelDisplayName, fallbackName) {
|
|
379062
379901
|
return `/invite @${createSlackBotDisplayName(
|
|
379063
379902
|
channelDisplayName,
|
|
@@ -379116,12 +379955,13 @@ function createSlackManifestInstallUrl(manifest) {
|
|
|
379116
379955
|
url4.searchParams.set("manifest_yaml", manifest);
|
|
379117
379956
|
return url4.toString();
|
|
379118
379957
|
}
|
|
379119
|
-
var SLACK_EVENTS_INGRESS_PATH, SLACK_INTERACTIVITY_INGRESS_PATH, DEFAULT_SLACK_IDENTITY, RESERVED_SLACK_IDENTITIES, REQUIRED_SLACK_BOT_SCOPES, REQUIRED_SLACK_BOT_SCOPE_COUNT, SLACK_PREINSTALL_GRANTED_SCOPES, SLACK_PREINSTALL_SCOPE_COUNT;
|
|
379958
|
+
var SLACK_EVENTS_INGRESS_PATH, SLACK_INTERACTIVITY_INGRESS_PATH, SLACK_APP_NAME_MAX_LENGTH, DEFAULT_SLACK_IDENTITY, RESERVED_SLACK_IDENTITIES, DEFAULT_SLACK_APP_NAME, REQUIRED_SLACK_BOT_SCOPES, REQUIRED_SLACK_BOT_SCOPE_COUNT, SLACK_PREINSTALL_GRANTED_SCOPES, SLACK_PREINSTALL_SCOPE_COUNT;
|
|
379120
379959
|
var init_slack = __esm({
|
|
379121
379960
|
"libs/channels-setup/src/slack.ts"() {
|
|
379122
379961
|
"use strict";
|
|
379123
379962
|
SLACK_EVENTS_INGRESS_PATH = "/api/channels/adapters/slack/events";
|
|
379124
379963
|
SLACK_INTERACTIVITY_INGRESS_PATH = "/api/channels/adapters/slack/interactivity";
|
|
379964
|
+
SLACK_APP_NAME_MAX_LENGTH = 35;
|
|
379125
379965
|
DEFAULT_SLACK_IDENTITY = "intelligence-agent";
|
|
379126
379966
|
RESERVED_SLACK_IDENTITIES = /* @__PURE__ */ new Set([
|
|
379127
379967
|
"channel",
|
|
@@ -379129,6 +379969,7 @@ var init_slack = __esm({
|
|
|
379129
379969
|
"here",
|
|
379130
379970
|
"slackbot"
|
|
379131
379971
|
]);
|
|
379972
|
+
DEFAULT_SLACK_APP_NAME = "Intelligence Agent";
|
|
379132
379973
|
REQUIRED_SLACK_BOT_SCOPES = Object.freeze([
|
|
379133
379974
|
"app_mentions:read",
|
|
379134
379975
|
"assistant:write",
|
|
@@ -380649,7 +381490,7 @@ var init_teams_setup_gates = __esm({
|
|
|
380649
381490
|
});
|
|
380650
381491
|
|
|
380651
381492
|
// libs/channels-setup/src/index.ts
|
|
380652
|
-
var
|
|
381493
|
+
var init_src12 = __esm({
|
|
380653
381494
|
"libs/channels-setup/src/index.ts"() {
|
|
380654
381495
|
"use strict";
|
|
380655
381496
|
init_channels_config();
|
|
@@ -380829,7 +381670,7 @@ var SOURCE_EXTENSIONS, SKIPPED_DIRECTORIES2, MAX_FILES, MAX_FILE_BYTES, RUNTIME_
|
|
|
380829
381670
|
var init_channel_code_half = __esm({
|
|
380830
381671
|
"apps/cli/src/services/channel-code-half.ts"() {
|
|
380831
381672
|
"use strict";
|
|
380832
|
-
|
|
381673
|
+
init_src12();
|
|
380833
381674
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
380834
381675
|
".cjs",
|
|
380835
381676
|
".cts",
|
|
@@ -380897,9 +381738,26 @@ function delay2(ms) {
|
|
|
380897
381738
|
setTimeout(resolve9, ms);
|
|
380898
381739
|
});
|
|
380899
381740
|
}
|
|
380900
|
-
function
|
|
381741
|
+
function formatTimeoutTail(command2, timeoutMs) {
|
|
381742
|
+
return `\`${command2}\` stopped responding after ${timeoutMs} ms and was stopped. Check the network and the npm registry configuration, then run it by hand.`;
|
|
381743
|
+
}
|
|
381744
|
+
function runInstallOnce(cwd2, command2, timeoutMs) {
|
|
380901
381745
|
return new Promise((resolve9) => {
|
|
380902
|
-
const child = spawn4(command2, {
|
|
381746
|
+
const child = spawn4(command2, {
|
|
381747
|
+
cwd: cwd2,
|
|
381748
|
+
shell: true,
|
|
381749
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
381750
|
+
...OWN_PROCESS_GROUP
|
|
381751
|
+
});
|
|
381752
|
+
let timedOut = false;
|
|
381753
|
+
const timeout = armChildTimeout(
|
|
381754
|
+
child,
|
|
381755
|
+
timeoutMs,
|
|
381756
|
+
() => {
|
|
381757
|
+
timedOut = true;
|
|
381758
|
+
},
|
|
381759
|
+
{ ownsProcessGroup: true }
|
|
381760
|
+
);
|
|
380903
381761
|
const stdoutDecoder = new StringDecoder("utf8");
|
|
380904
381762
|
const stderrDecoder = new StringDecoder("utf8");
|
|
380905
381763
|
let stdout = "";
|
|
@@ -380917,22 +381775,26 @@ function runInstallOnce(cwd2, command2) {
|
|
|
380917
381775
|
}
|
|
380918
381776
|
});
|
|
380919
381777
|
child.once("error", (error98) => {
|
|
381778
|
+
timeout.cancel();
|
|
380920
381779
|
resolve9({
|
|
380921
381780
|
ok: false,
|
|
380922
381781
|
code: null,
|
|
380923
381782
|
stdoutTail: "",
|
|
380924
381783
|
stderrTail: "",
|
|
380925
|
-
spawnError: error98.message
|
|
381784
|
+
spawnError: error98.message,
|
|
381785
|
+
timedOut
|
|
380926
381786
|
});
|
|
380927
381787
|
});
|
|
380928
381788
|
child.once("close", (code) => {
|
|
381789
|
+
timeout.cancel();
|
|
380929
381790
|
stdout += stdoutDecoder.end();
|
|
380930
381791
|
stderr += stderrDecoder.end();
|
|
380931
381792
|
resolve9({
|
|
380932
381793
|
ok: code === 0,
|
|
380933
381794
|
code,
|
|
380934
381795
|
stdoutTail: stdout.slice(-STDOUT_TAIL_LIMIT).trim(),
|
|
380935
|
-
stderrTail: stderr.slice(-STDERR_TAIL_LIMIT).trim()
|
|
381796
|
+
stderrTail: stderr.slice(-STDERR_TAIL_LIMIT).trim(),
|
|
381797
|
+
timedOut
|
|
380936
381798
|
});
|
|
380937
381799
|
});
|
|
380938
381800
|
});
|
|
@@ -380941,14 +381803,15 @@ async function installDependencies({
|
|
|
380941
381803
|
cwd: cwd2,
|
|
380942
381804
|
command: command2,
|
|
380943
381805
|
log,
|
|
380944
|
-
retryDelayMs = DEFAULT_RETRY_DELAY_MS
|
|
381806
|
+
retryDelayMs = DEFAULT_RETRY_DELAY_MS,
|
|
381807
|
+
timeoutMs = DEFAULT_INSTALL_TIMEOUT_MS
|
|
380945
381808
|
}) {
|
|
380946
381809
|
let lastAttempt;
|
|
380947
381810
|
for (let attempt = 1; attempt <= INSTALL_MAX_ATTEMPTS; attempt += 1) {
|
|
380948
381811
|
if (attempt > 1 && retryDelayMs > 0) {
|
|
380949
381812
|
await delay2(retryDelayMs);
|
|
380950
381813
|
}
|
|
380951
|
-
lastAttempt = await runInstallOnce(cwd2, command2);
|
|
381814
|
+
lastAttempt = await runInstallOnce(cwd2, command2, timeoutMs);
|
|
380952
381815
|
if (lastAttempt.ok) {
|
|
380953
381816
|
if (attempt > 1) {
|
|
380954
381817
|
log?.("info", {
|
|
@@ -380960,6 +381823,18 @@ async function installDependencies({
|
|
|
380960
381823
|
}
|
|
380961
381824
|
return { ok: true };
|
|
380962
381825
|
}
|
|
381826
|
+
if (lastAttempt.timedOut) {
|
|
381827
|
+
log?.("error", {
|
|
381828
|
+
event: "install_timed_out",
|
|
381829
|
+
command: command2,
|
|
381830
|
+
cwd: cwd2,
|
|
381831
|
+
attempt,
|
|
381832
|
+
timeoutMs,
|
|
381833
|
+
stdoutTail: lastAttempt.stdoutTail,
|
|
381834
|
+
stderrTail: lastAttempt.stderrTail
|
|
381835
|
+
});
|
|
381836
|
+
return { ok: false, stderrTail: formatTimeoutTail(command2, timeoutMs) };
|
|
381837
|
+
}
|
|
380963
381838
|
log?.("error", {
|
|
380964
381839
|
event: "install_failed",
|
|
380965
381840
|
command: command2,
|
|
@@ -380977,14 +381852,16 @@ async function installDependencies({
|
|
|
380977
381852
|
stderrTail: lastAttempt?.spawnError ?? lastAttempt?.stderrTail ?? "install failed"
|
|
380978
381853
|
};
|
|
380979
381854
|
}
|
|
380980
|
-
var STDERR_TAIL_LIMIT, STDOUT_TAIL_LIMIT, INSTALL_MAX_ATTEMPTS, DEFAULT_RETRY_DELAY_MS;
|
|
381855
|
+
var STDERR_TAIL_LIMIT, STDOUT_TAIL_LIMIT, INSTALL_MAX_ATTEMPTS, DEFAULT_RETRY_DELAY_MS, DEFAULT_INSTALL_TIMEOUT_MS;
|
|
380981
381856
|
var init_install_dependencies = __esm({
|
|
380982
381857
|
"apps/cli/src/services/install-dependencies.ts"() {
|
|
380983
381858
|
"use strict";
|
|
381859
|
+
init_child_timeout();
|
|
380984
381860
|
STDERR_TAIL_LIMIT = 2e3;
|
|
380985
381861
|
STDOUT_TAIL_LIMIT = 4e3;
|
|
380986
381862
|
INSTALL_MAX_ATTEMPTS = 2;
|
|
380987
381863
|
DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
381864
|
+
DEFAULT_INSTALL_TIMEOUT_MS = 10 * 6e4;
|
|
380988
381865
|
}
|
|
380989
381866
|
});
|
|
380990
381867
|
|
|
@@ -382102,7 +382979,7 @@ function writeChannelsConfigFile(dir, config3) {
|
|
|
382102
382979
|
var init_channels_config_file = __esm({
|
|
382103
382980
|
"apps/cli/src/services/channels-config-file.ts"() {
|
|
382104
382981
|
"use strict";
|
|
382105
|
-
|
|
382982
|
+
init_src12();
|
|
382106
382983
|
init_fs_env_util();
|
|
382107
382984
|
}
|
|
382108
382985
|
});
|
|
@@ -382182,7 +383059,35 @@ var init_channels_state = __esm({
|
|
|
382182
383059
|
});
|
|
382183
383060
|
|
|
382184
383061
|
// apps/cli/src/services/channels-flow.ts
|
|
383062
|
+
function slackDisplayNameRefusal(adapter2, channelName, displayName) {
|
|
383063
|
+
if (adapter2 !== "slack") {
|
|
383064
|
+
return void 0;
|
|
383065
|
+
}
|
|
383066
|
+
const validated = validateSlackDisplayName({
|
|
383067
|
+
channelDisplayName: displayName,
|
|
383068
|
+
channelName
|
|
383069
|
+
});
|
|
383070
|
+
if (validated.status === "ok") {
|
|
383071
|
+
return void 0;
|
|
383072
|
+
}
|
|
383073
|
+
return {
|
|
383074
|
+
code: CHANNELS_FLOW_CODES.slackDisplayNameInvalid,
|
|
383075
|
+
message: validated.message,
|
|
383076
|
+
status: "failed"
|
|
383077
|
+
};
|
|
383078
|
+
}
|
|
382185
383079
|
function resolveIdentity(input) {
|
|
383080
|
+
const resolved = resolveChannelIdentity(input);
|
|
383081
|
+
if (resolved.status === "failed") {
|
|
383082
|
+
return resolved;
|
|
383083
|
+
}
|
|
383084
|
+
return slackDisplayNameRefusal(
|
|
383085
|
+
input.adapter,
|
|
383086
|
+
resolved.name,
|
|
383087
|
+
resolved.displayName
|
|
383088
|
+
) ?? resolved;
|
|
383089
|
+
}
|
|
383090
|
+
function resolveChannelIdentity(input) {
|
|
382186
383091
|
if (input.channelName !== void 0) {
|
|
382187
383092
|
const validated = validateChannelName(input.channelName);
|
|
382188
383093
|
if (validated.status === "invalid") {
|
|
@@ -382263,6 +383168,22 @@ async function runChannelsAdd(input, deps) {
|
|
|
382263
383168
|
);
|
|
382264
383169
|
const wasDeclared = alreadyDeclared?.providers[adapter2] !== void 0;
|
|
382265
383170
|
const effectiveDisplayName = input.displayName ?? alreadyDeclared?.displayName ?? displayName;
|
|
383171
|
+
const declaredRefusal = slackDisplayNameRefusal(
|
|
383172
|
+
adapter2,
|
|
383173
|
+
name,
|
|
383174
|
+
effectiveDisplayName
|
|
383175
|
+
);
|
|
383176
|
+
if (declaredRefusal !== void 0) {
|
|
383177
|
+
return failedEnvelope({
|
|
383178
|
+
channels: [],
|
|
383179
|
+
command: command2,
|
|
383180
|
+
diagnostics,
|
|
383181
|
+
error: {
|
|
383182
|
+
code: declaredRefusal.code,
|
|
383183
|
+
message: declaredRefusal.message
|
|
383184
|
+
}
|
|
383185
|
+
});
|
|
383186
|
+
}
|
|
382266
383187
|
let config3 = configRead.config;
|
|
382267
383188
|
if (!wasDeclared) {
|
|
382268
383189
|
config3 = declareChannel(config3, {
|
|
@@ -382272,6 +383193,13 @@ async function runChannelsAdd(input, deps) {
|
|
|
382272
383193
|
});
|
|
382273
383194
|
deps.writeConfig(config3);
|
|
382274
383195
|
}
|
|
383196
|
+
if (input.displayName !== void 0 && alreadyDeclared !== void 0 && alreadyDeclared.displayName !== input.displayName) {
|
|
383197
|
+
config3 = renameChannelDisplayName(config3, {
|
|
383198
|
+
displayName: input.displayName,
|
|
383199
|
+
name
|
|
383200
|
+
});
|
|
383201
|
+
deps.writeConfig(config3);
|
|
383202
|
+
}
|
|
382275
383203
|
const declaredEnv = adapter2 === "slack" ? defaultCredentialEnvNames(name, "slack") : defaultCredentialEnvNames(name, "teams");
|
|
382276
383204
|
const declared = config3.channels.find((channel2) => channel2.name === name);
|
|
382277
383205
|
const providerEnv = declared?.providers[adapter2]?.env ?? declaredEnv;
|
|
@@ -382540,7 +383468,7 @@ var CHANNELS_FLOW_CODES, MAX_RECONCILE_STEPS;
|
|
|
382540
383468
|
var init_channels_flow = __esm({
|
|
382541
383469
|
"apps/cli/src/services/channels-flow.ts"() {
|
|
382542
383470
|
"use strict";
|
|
382543
|
-
|
|
383471
|
+
init_src12();
|
|
382544
383472
|
init_api_client();
|
|
382545
383473
|
init_channel_credentials();
|
|
382546
383474
|
init_channels_state();
|
|
@@ -382549,6 +383477,7 @@ var init_channels_flow = __esm({
|
|
|
382549
383477
|
nameMissing: "CLI_CHANNELS_NAME_MISSING",
|
|
382550
383478
|
nameUndecidable: "CLI_CHANNELS_NAME_UNDECIDABLE",
|
|
382551
383479
|
notDeclared: "CLI_CHANNELS_NOT_DECLARED",
|
|
383480
|
+
slackDisplayNameInvalid: "CLI_CHANNELS_SLACK_DISPLAY_NAME_INVALID",
|
|
382552
383481
|
stalled: "CLI_CHANNELS_RECONCILE_STALLED"
|
|
382553
383482
|
});
|
|
382554
383483
|
MAX_RECONCILE_STEPS = 8;
|
|
@@ -382740,7 +383669,7 @@ function removeEmptyPlaceholders(input) {
|
|
|
382740
383669
|
var init_init_channel_setup = __esm({
|
|
382741
383670
|
"apps/cli/src/services/init-channel-setup.ts"() {
|
|
382742
383671
|
"use strict";
|
|
382743
|
-
|
|
383672
|
+
init_src12();
|
|
382744
383673
|
init_config();
|
|
382745
383674
|
init_api_client();
|
|
382746
383675
|
init_channel_artifacts();
|
|
@@ -384468,7 +385397,7 @@ var init_init = __esm({
|
|
|
384468
385397
|
await init_channel_offer();
|
|
384469
385398
|
await init_hosted_project_select();
|
|
384470
385399
|
init_project_config();
|
|
384471
|
-
|
|
385400
|
+
init_src12();
|
|
384472
385401
|
init_intelligence_readme();
|
|
384473
385402
|
import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
384474
385403
|
PROJECT_CREATION_AUTH_HANDOFF = {
|
|
@@ -385081,6 +386010,8 @@ var init_onboarding_checkpoint = __esm({
|
|
|
385081
386010
|
"apps/cli/src/services/onboarding-checkpoint.ts"() {
|
|
385082
386011
|
"use strict";
|
|
385083
386012
|
CHECKPOINT_PHASES = [
|
|
386013
|
+
"research-dispatched",
|
|
386014
|
+
"surface-probed",
|
|
385084
386015
|
"research-returned",
|
|
385085
386016
|
"starter-cloned",
|
|
385086
386017
|
"plan-written",
|
|
@@ -385104,6 +386035,17 @@ function resolveAgentFrameworkAlias(value) {
|
|
|
385104
386035
|
return void 0;
|
|
385105
386036
|
return ONBOARDING_AGENT_FRAMEWORK_ALIASES[value] ?? value;
|
|
385106
386037
|
}
|
|
386038
|
+
function terminalReasonForRoute(route) {
|
|
386039
|
+
for (let index2 = route.length - 1; index2 >= 0; index2 -= 1) {
|
|
386040
|
+
const node = route[index2];
|
|
386041
|
+
if (node === void 0)
|
|
386042
|
+
continue;
|
|
386043
|
+
if (Object.prototype.hasOwnProperty.call(TERMINAL_NODES, node))
|
|
386044
|
+
continue;
|
|
386045
|
+
return STAGE_BY_NODE[node] ?? STAGE_BY_DIRECTORY[node.split("/")[0] ?? ""] ?? "other";
|
|
386046
|
+
}
|
|
386047
|
+
return void 0;
|
|
386048
|
+
}
|
|
385107
386049
|
function unprovenBaselineRefusal(startingState, route, proof) {
|
|
385108
386050
|
if (startingState !== "both-oss" && startingState !== "both-copilotkit-unproved") {
|
|
385109
386051
|
return void 0;
|
|
@@ -385150,7 +386092,7 @@ function requireOnboardingChoice(flag, value, choices) {
|
|
|
385150
386092
|
}
|
|
385151
386093
|
return selected;
|
|
385152
386094
|
}
|
|
385153
|
-
var ONBOARDING_STARTING_STATES, ONBOARDING_AGENT_FRAMEWORKS, ONBOARDING_AGENT_FRAMEWORK_ALIASES, ONBOARDING_FRONTENDS, ONBOARDING_PROOF_STEPS, ONBOARDING_PROOF_OUTCOMES, ABSENCE_STATES, OSS_BASELINE_NODE, TERMINAL_NODES, REPOSITORY_RESEARCH_NODE;
|
|
386095
|
+
var ONBOARDING_STARTING_STATES, ONBOARDING_AGENT_FRAMEWORKS, ONBOARDING_AGENT_FRAMEWORK_ALIASES, ONBOARDING_FRONTENDS, ONBOARDING_PROOF_STEPS, ONBOARDING_PROOF_OUTCOMES, ABSENCE_STATES, OSS_BASELINE_NODE, TERMINAL_NODES, STAGE_BY_DIRECTORY, STAGE_BY_NODE, REPOSITORY_RESEARCH_NODE;
|
|
385154
386096
|
var init_onboarding_classification = __esm({
|
|
385155
386097
|
"apps/cli/src/services/onboarding-classification.ts"() {
|
|
385156
386098
|
"use strict";
|
|
@@ -385227,6 +386169,25 @@ var init_onboarding_classification = __esm({
|
|
|
385227
386169
|
"stopped/run-failed": "run-failed",
|
|
385228
386170
|
"unsupported/no-validated-path": "unsupported"
|
|
385229
386171
|
};
|
|
386172
|
+
STAGE_BY_DIRECTORY = {
|
|
386173
|
+
authenticate: "authentication",
|
|
386174
|
+
conversion: "plan",
|
|
386175
|
+
credentials: "credentials",
|
|
386176
|
+
feature: "feature",
|
|
386177
|
+
framework: "journey",
|
|
386178
|
+
frontend: "journey",
|
|
386179
|
+
implementation: "implementation",
|
|
386180
|
+
proof: "validation",
|
|
386181
|
+
research: "research",
|
|
386182
|
+
starter: "journey"
|
|
386183
|
+
};
|
|
386184
|
+
STAGE_BY_NODE = {
|
|
386185
|
+
"subagent/create-plan": "plan",
|
|
386186
|
+
"subagent/implement-and-validate": "implementation",
|
|
386187
|
+
"subagent/inspect-repository": "research",
|
|
386188
|
+
"subagent/prove-oss-baseline": "validation",
|
|
386189
|
+
"subagent/prove-round-trip": "validation"
|
|
386190
|
+
};
|
|
385230
386191
|
REPOSITORY_RESEARCH_NODE = "subagent/inspect-repository";
|
|
385231
386192
|
}
|
|
385232
386193
|
});
|
|
@@ -385334,9 +386295,17 @@ var init_onboarding_resume = __esm({
|
|
|
385334
386295
|
|
|
385335
386296
|
// apps/cli/src/services/onboarding-protected-paths.ts
|
|
385336
386297
|
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
385337
|
-
import { createHash as
|
|
386298
|
+
import { createHash as createHash8 } from "node:crypto";
|
|
385338
386299
|
import { existsSync as existsSync21, readFileSync as readFileSync22, readdirSync as readdirSync5, statSync as statSync4 } from "node:fs";
|
|
385339
|
-
import {
|
|
386300
|
+
import {
|
|
386301
|
+
dirname as dirname13,
|
|
386302
|
+
isAbsolute,
|
|
386303
|
+
join as join28,
|
|
386304
|
+
parse as parse13,
|
|
386305
|
+
relative as relative3,
|
|
386306
|
+
resolve as resolve7,
|
|
386307
|
+
sep as sep3
|
|
386308
|
+
} from "node:path";
|
|
385340
386309
|
function deriveProjectFiles(root2) {
|
|
385341
386310
|
const found = [];
|
|
385342
386311
|
const pending = [root2];
|
|
@@ -385446,6 +386415,9 @@ function readManifest(dependencies) {
|
|
|
385446
386415
|
return "malformed";
|
|
385447
386416
|
if (typeof stored.capturedAt !== "string")
|
|
385448
386417
|
return "malformed";
|
|
386418
|
+
if (stored.capturedTree !== void 0 && typeof stored.capturedTree !== "string") {
|
|
386419
|
+
return "malformed";
|
|
386420
|
+
}
|
|
385449
386421
|
if (stored.implementationStartedAt !== void 0 && typeof stored.implementationStartedAt !== "string") {
|
|
385450
386422
|
return "malformed";
|
|
385451
386423
|
}
|
|
@@ -385456,6 +386428,9 @@ function readManifest(dependencies) {
|
|
|
385456
386428
|
);
|
|
385457
386429
|
return wellFormed ? stored : "malformed";
|
|
385458
386430
|
}
|
|
386431
|
+
function capturedTreeMark(stored) {
|
|
386432
|
+
return stored?.capturedTree === void 0 ? {} : { capturedTree: stored.capturedTree };
|
|
386433
|
+
}
|
|
385459
386434
|
function startedMark(stored) {
|
|
385460
386435
|
return stored?.implementationStartedAt === void 0 ? {} : { implementationStartedAt: stored.implementationStartedAt };
|
|
385461
386436
|
}
|
|
@@ -385465,7 +386440,7 @@ function digestOf(root2, relativePath) {
|
|
|
385465
386440
|
if (!existsSync21(absolute))
|
|
385466
386441
|
return {};
|
|
385467
386442
|
return {
|
|
385468
|
-
digest:
|
|
386443
|
+
digest: createHash8("sha256").update(readFileSync22(absolute)).digest("hex")
|
|
385469
386444
|
};
|
|
385470
386445
|
} catch {
|
|
385471
386446
|
return "unreadable";
|
|
@@ -385546,8 +386521,34 @@ function captureEntry(root2, relativePath, derived) {
|
|
|
385546
386521
|
...envKeys === void 0 ? {} : { envKeys }
|
|
385547
386522
|
};
|
|
385548
386523
|
}
|
|
386524
|
+
function isProjectBoundary(directory) {
|
|
386525
|
+
return PROJECT_BOUNDARY_MARKERS.some(
|
|
386526
|
+
(marker) => existsSync21(join28(directory, marker))
|
|
386527
|
+
);
|
|
386528
|
+
}
|
|
386529
|
+
function crossesProjectBoundary(start, root2) {
|
|
386530
|
+
let candidate = start;
|
|
386531
|
+
const filesystemRoot = parse13(candidate).root;
|
|
386532
|
+
while (candidate !== root2) {
|
|
386533
|
+
if (isProjectBoundary(candidate))
|
|
386534
|
+
return true;
|
|
386535
|
+
if (candidate === filesystemRoot)
|
|
386536
|
+
break;
|
|
386537
|
+
const parent = dirname13(candidate);
|
|
386538
|
+
if (parent === candidate)
|
|
386539
|
+
break;
|
|
386540
|
+
candidate = parent;
|
|
386541
|
+
}
|
|
386542
|
+
return false;
|
|
386543
|
+
}
|
|
385549
386544
|
function captureProtectedPaths(dependencies, input) {
|
|
385550
386545
|
const root2 = resolveAnchoredRoot(dependencies);
|
|
386546
|
+
if (crossesProjectBoundary(
|
|
386547
|
+
resolveOnboardingRepositoryRoot(dependencies.cwd),
|
|
386548
|
+
root2
|
|
386549
|
+
)) {
|
|
386550
|
+
return { status: "blocked", reason: "root-outside-project", detail: root2 };
|
|
386551
|
+
}
|
|
385551
386552
|
const stored = readManifest(dependencies);
|
|
385552
386553
|
const ownBaseline = stored !== void 0 && stored !== "malformed" && stored.runId === input.runId ? stored : void 0;
|
|
385553
386554
|
const derive = ownBaseline === void 0;
|
|
@@ -385605,6 +386606,10 @@ function captureProtectedPaths(dependencies, input) {
|
|
|
385605
386606
|
dependencies.store.set(protectedBaselineKey(dependencies), {
|
|
385606
386607
|
runId: input.runId,
|
|
385607
386608
|
capturedAt: ownBaseline?.capturedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
386609
|
+
// Read once, with the timestamp, and kept for the life of the baseline: a
|
|
386610
|
+
// capture that extends its own baseline must keep describing the tree the
|
|
386611
|
+
// run started from, not the one it has since built.
|
|
386612
|
+
...ownBaseline === void 0 ? treeMarkOf(root2) : capturedTreeMark(ownBaseline),
|
|
385608
386613
|
...startedMark(ownBaseline),
|
|
385609
386614
|
entries
|
|
385610
386615
|
});
|
|
@@ -385740,6 +386745,7 @@ function rebaselineProtectedPaths(dependencies, input) {
|
|
|
385740
386745
|
dependencies.store.set(protectedBaselineKey(dependencies), {
|
|
385741
386746
|
runId: stored.runId,
|
|
385742
386747
|
capturedAt: stored.capturedAt,
|
|
386748
|
+
...capturedTreeMark(stored),
|
|
385743
386749
|
...startedMark(stored),
|
|
385744
386750
|
entries: byPath(entries)
|
|
385745
386751
|
});
|
|
@@ -385861,6 +386867,7 @@ function acceptProtectedPathDrift(dependencies, input) {
|
|
|
385861
386867
|
dependencies.store.set(protectedBaselineKey(dependencies), {
|
|
385862
386868
|
runId: stored.runId,
|
|
385863
386869
|
capturedAt: stored.capturedAt,
|
|
386870
|
+
...capturedTreeMark(stored),
|
|
385864
386871
|
...startedMark(stored),
|
|
385865
386872
|
entries: byPath(entries)
|
|
385866
386873
|
});
|
|
@@ -385974,6 +386981,7 @@ function acceptCredentialPlacement(dependencies, input) {
|
|
|
385974
386981
|
dependencies.store.set(protectedBaselineKey(dependencies), {
|
|
385975
386982
|
runId: stored.runId,
|
|
385976
386983
|
capturedAt: stored.capturedAt,
|
|
386984
|
+
...capturedTreeMark(stored),
|
|
385977
386985
|
...startedMark(stored),
|
|
385978
386986
|
entries: byPath(entries)
|
|
385979
386987
|
});
|
|
@@ -386005,6 +387013,7 @@ function markImplementationStarted(dependencies, input) {
|
|
|
386005
387013
|
dependencies.store.set(protectedBaselineKey(dependencies), {
|
|
386006
387014
|
runId: stored.runId,
|
|
386007
387015
|
capturedAt: stored.capturedAt,
|
|
387016
|
+
...capturedTreeMark(stored),
|
|
386008
387017
|
implementationStartedAt: startedAt,
|
|
386009
387018
|
entries: stored.entries
|
|
386010
387019
|
});
|
|
@@ -386125,6 +387134,7 @@ function authorizeProtectedPathChange(dependencies, input) {
|
|
|
386125
387134
|
dependencies.store.set(protectedBaselineKey(dependencies), {
|
|
386126
387135
|
runId: stored.runId,
|
|
386127
387136
|
capturedAt: stored.capturedAt,
|
|
387137
|
+
...capturedTreeMark(stored),
|
|
386128
387138
|
...startedMark(stored),
|
|
386129
387139
|
entries: byPath(entries)
|
|
386130
387140
|
});
|
|
@@ -386134,7 +387144,105 @@ function authorizeProtectedPathChange(dependencies, input) {
|
|
|
386134
387144
|
authorized: byPath(authorized)
|
|
386135
387145
|
};
|
|
386136
387146
|
}
|
|
386137
|
-
|
|
387147
|
+
function currentRepositoryTree(root2) {
|
|
387148
|
+
try {
|
|
387149
|
+
return execFileSync5("git", ["rev-parse", "HEAD^{tree}"], {
|
|
387150
|
+
cwd: root2,
|
|
387151
|
+
encoding: "utf8",
|
|
387152
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
387153
|
+
}).trim();
|
|
387154
|
+
} catch {
|
|
387155
|
+
return void 0;
|
|
387156
|
+
}
|
|
387157
|
+
}
|
|
387158
|
+
function treeMarkOf(root2) {
|
|
387159
|
+
const tree = currentRepositoryTree(root2);
|
|
387160
|
+
return tree === void 0 ? {} : { capturedTree: tree };
|
|
387161
|
+
}
|
|
387162
|
+
function commitsAfterCapture(root2, capturedAt, capturedTree) {
|
|
387163
|
+
if (capturedTree !== void 0) {
|
|
387164
|
+
const now = currentRepositoryTree(root2);
|
|
387165
|
+
if (now !== void 0 && now === capturedTree)
|
|
387166
|
+
return "none";
|
|
387167
|
+
}
|
|
387168
|
+
const since = capturedAt.replace(/\.\d+Z$/, "Z");
|
|
387169
|
+
let output;
|
|
387170
|
+
try {
|
|
387171
|
+
output = execFileSync5(
|
|
387172
|
+
"git",
|
|
387173
|
+
["log", `--since=${since}`, "--name-only", "--format=%H"],
|
|
387174
|
+
{ cwd: root2, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
|
|
387175
|
+
);
|
|
387176
|
+
} catch {
|
|
387177
|
+
return "failed";
|
|
387178
|
+
}
|
|
387179
|
+
const lines = output.split("\n").filter((line) => line.length > 0);
|
|
387180
|
+
if (lines.length === 0)
|
|
387181
|
+
return "none";
|
|
387182
|
+
return lines.filter((line) => !/^[0-9a-f]{40}$/.test(line));
|
|
387183
|
+
}
|
|
387184
|
+
function readProjectChanges(dependencies, input) {
|
|
387185
|
+
const root2 = resolveAnchoredRoot(dependencies);
|
|
387186
|
+
const stored = readManifest(dependencies);
|
|
387187
|
+
if (stored === void 0) {
|
|
387188
|
+
return { status: "blocked", reason: "no-baseline", detail: input.runId };
|
|
387189
|
+
}
|
|
387190
|
+
if (stored === "malformed") {
|
|
387191
|
+
return {
|
|
387192
|
+
status: "blocked",
|
|
387193
|
+
reason: "unreadable-baseline",
|
|
387194
|
+
detail: input.runId
|
|
387195
|
+
};
|
|
387196
|
+
}
|
|
387197
|
+
if (stored.runId !== input.runId) {
|
|
387198
|
+
return { status: "blocked", reason: "run-mismatch", detail: stored.runId };
|
|
387199
|
+
}
|
|
387200
|
+
const derived = deriveChangedPaths(root2);
|
|
387201
|
+
if (derived === "failed") {
|
|
387202
|
+
return { status: "blocked", reason: "git-failed", detail: root2 };
|
|
387203
|
+
}
|
|
387204
|
+
const current = derived === "no-repository" ? deriveProjectFiles(root2) : derived;
|
|
387205
|
+
const baseline = new Map(
|
|
387206
|
+
stored.entries.map((entry) => [entry.path, entry.digest])
|
|
387207
|
+
);
|
|
387208
|
+
const changed = [];
|
|
387209
|
+
for (const relativePath of new Set(current)) {
|
|
387210
|
+
if (isGraphOwned(relativePath))
|
|
387211
|
+
continue;
|
|
387212
|
+
const read = digestOf(root2, relativePath);
|
|
387213
|
+
if (read === "unreadable") {
|
|
387214
|
+
changed.push(relativePath);
|
|
387215
|
+
continue;
|
|
387216
|
+
}
|
|
387217
|
+
const held = baseline.has(relativePath);
|
|
387218
|
+
if (!held || baseline.get(relativePath) !== read.digest) {
|
|
387219
|
+
changed.push(relativePath);
|
|
387220
|
+
}
|
|
387221
|
+
}
|
|
387222
|
+
const ordered = [...changed].sort(
|
|
387223
|
+
(left, right) => left < right ? -1 : left > right ? 1 : 0
|
|
387224
|
+
);
|
|
387225
|
+
if (ordered.length > 0 || derived === "no-repository") {
|
|
387226
|
+
return { status: "passed", runId: input.runId, changed: ordered };
|
|
387227
|
+
}
|
|
387228
|
+
const committed = commitsAfterCapture(
|
|
387229
|
+
root2,
|
|
387230
|
+
stored.capturedAt,
|
|
387231
|
+
stored.capturedTree
|
|
387232
|
+
);
|
|
387233
|
+
if (committed === "failed" || committed === "none") {
|
|
387234
|
+
return { status: "passed", runId: input.runId, changed: ordered };
|
|
387235
|
+
}
|
|
387236
|
+
return {
|
|
387237
|
+
status: "passed",
|
|
387238
|
+
runId: input.runId,
|
|
387239
|
+
changed: [...new Set(committed)].sort(
|
|
387240
|
+
(left, right) => left < right ? -1 : left > right ? 1 : 0
|
|
387241
|
+
),
|
|
387242
|
+
committedAfterCapture: true
|
|
387243
|
+
};
|
|
387244
|
+
}
|
|
387245
|
+
var SKIPPED_DIRECTORIES3, GRAPH_OWNED_SUFFIXES, PROJECT_BOUNDARY_MARKERS;
|
|
386138
387246
|
var init_onboarding_protected_paths = __esm({
|
|
386139
387247
|
"apps/cli/src/services/onboarding-protected-paths.ts"() {
|
|
386140
387248
|
"use strict";
|
|
@@ -386152,6 +387260,12 @@ var init_onboarding_protected_paths = __esm({
|
|
|
386152
387260
|
"__pycache__"
|
|
386153
387261
|
]);
|
|
386154
387262
|
GRAPH_OWNED_SUFFIXES = [".env", ".copilotkit/project.json"];
|
|
387263
|
+
PROJECT_BOUNDARY_MARKERS = [
|
|
387264
|
+
".git",
|
|
387265
|
+
"package.json",
|
|
387266
|
+
"pyproject.toml",
|
|
387267
|
+
".copilotkit"
|
|
387268
|
+
];
|
|
386155
387269
|
}
|
|
386156
387270
|
});
|
|
386157
387271
|
|
|
@@ -386583,6 +387697,9 @@ var init_resolved_dependencies = __esm({
|
|
|
386583
387697
|
|
|
386584
387698
|
// apps/cli/src/services/onboarding-inspection.ts
|
|
386585
387699
|
import * as path39 from "node:path";
|
|
387700
|
+
function requiredProjectFields(deployment) {
|
|
387701
|
+
return deployment === "managed" ? ["projectId", "projectSlug", "clerkOrgId"] : ["projectId", "projectSlug"];
|
|
387702
|
+
}
|
|
386586
387703
|
function relativize(root2, target) {
|
|
386587
387704
|
const relative7 = path39.relative(root2, target);
|
|
386588
387705
|
return relative7 === "" ? "." : relative7;
|
|
@@ -386608,12 +387725,13 @@ function packageManagerFor(appDir, root2) {
|
|
|
386608
387725
|
candidate = parent;
|
|
386609
387726
|
}
|
|
386610
387727
|
}
|
|
386611
|
-
function inspectProject(cwd2, root2) {
|
|
387728
|
+
function inspectProject(cwd2, root2, deployment) {
|
|
387729
|
+
const required3 = requiredProjectFields(deployment);
|
|
386612
387730
|
const resolution = resolveProjectConfig(cwd2);
|
|
386613
387731
|
if (resolution.kind === "absent") {
|
|
386614
387732
|
return {
|
|
386615
387733
|
configPath: null,
|
|
386616
|
-
missingFields: [...
|
|
387734
|
+
missingFields: [...required3],
|
|
386617
387735
|
presentFields: [],
|
|
386618
387736
|
status: "absent"
|
|
386619
387737
|
};
|
|
@@ -386625,18 +387743,18 @@ function inspectProject(cwd2, root2) {
|
|
|
386625
387743
|
if (resolution.kind === "unreadable") {
|
|
386626
387744
|
return {
|
|
386627
387745
|
configPath,
|
|
386628
|
-
missingFields: [...
|
|
387746
|
+
missingFields: [...required3],
|
|
386629
387747
|
presentFields: [],
|
|
386630
387748
|
status: "unreadable"
|
|
386631
387749
|
};
|
|
386632
387750
|
}
|
|
386633
387751
|
const held = resolution.config;
|
|
386634
|
-
const present2 =
|
|
387752
|
+
const present2 = required3.filter(
|
|
386635
387753
|
(field) => typeof held[field] === "string" && held[field] !== ""
|
|
386636
387754
|
);
|
|
386637
387755
|
return {
|
|
386638
387756
|
configPath,
|
|
386639
|
-
missingFields:
|
|
387757
|
+
missingFields: required3.filter(
|
|
386640
387758
|
(field) => !present2.includes(field)
|
|
386641
387759
|
),
|
|
386642
387760
|
presentFields: present2,
|
|
@@ -386698,12 +387816,11 @@ function buildInspectionPacket(inputs) {
|
|
|
386698
387816
|
command: "onboard inspect",
|
|
386699
387817
|
dependencies: readResolvedDependencies(apps2),
|
|
386700
387818
|
detection: detectStack(root2),
|
|
386701
|
-
project: inspectProject(cwd2, root2),
|
|
387819
|
+
project: inspectProject(cwd2, root2, inputs.deployment),
|
|
386702
387820
|
projectRoot: root2,
|
|
386703
387821
|
schemaVersion: 1
|
|
386704
387822
|
};
|
|
386705
387823
|
}
|
|
386706
|
-
var REQUIRED_PROJECT_FIELDS;
|
|
386707
387824
|
var init_onboarding_inspection = __esm({
|
|
386708
387825
|
"apps/cli/src/services/onboarding-inspection.ts"() {
|
|
386709
387826
|
"use strict";
|
|
@@ -386717,11 +387834,6 @@ var init_onboarding_inspection = __esm({
|
|
|
386717
387834
|
init_resolved_dependencies();
|
|
386718
387835
|
init_runtime_url();
|
|
386719
387836
|
init_verify_probes();
|
|
386720
|
-
REQUIRED_PROJECT_FIELDS = [
|
|
386721
|
-
"projectId",
|
|
386722
|
-
"projectSlug",
|
|
386723
|
-
"clerkOrgId"
|
|
386724
|
-
];
|
|
386725
387837
|
}
|
|
386726
387838
|
});
|
|
386727
387839
|
|
|
@@ -387001,7 +388113,11 @@ async function runOnboard(argv, dependencies) {
|
|
|
387001
388113
|
resolveAppDirectories(cwd2, findRepositoryRoot(cwd2) ?? cwd2).apps
|
|
387002
388114
|
);
|
|
387003
388115
|
},
|
|
387004
|
-
readInspection: () => buildInspectionPacket({
|
|
388116
|
+
readInspection: () => buildInspectionPacket({
|
|
388117
|
+
cwd: process.cwd(),
|
|
388118
|
+
deployment: getDeploymentTarget().name,
|
|
388119
|
+
env: process.env
|
|
388120
|
+
}),
|
|
387005
388121
|
readEnvStaleness: () => buildEnvStalenessPacket({
|
|
387006
388122
|
cwd: process.cwd(),
|
|
387007
388123
|
now: Date.now(),
|
|
@@ -387068,7 +388184,7 @@ async function runOnboard(argv, dependencies) {
|
|
|
387068
388184
|
...onboardingIntentProperties(deps),
|
|
387069
388185
|
onboarding_run_id: runId2,
|
|
387070
388186
|
cli_version: deps.cliVersion,
|
|
387071
|
-
|
|
388187
|
+
...codingAgentProperty(parsed.codingAgent)
|
|
387072
388188
|
}
|
|
387073
388189
|
});
|
|
387074
388190
|
deps.stdout.write(`Coding agent recorded for run ${runId2}.
|
|
@@ -387143,6 +388259,21 @@ async function runOnboard(argv, dependencies) {
|
|
|
387143
388259
|
const check4 = parseSurfaceCheck(blocked2.rest);
|
|
387144
388260
|
if (check4 === void 0)
|
|
387145
388261
|
throw new Error(SURFACE_CHECK_USAGE);
|
|
388262
|
+
const unchanged = unchangedProjectRefusal(deps, runId);
|
|
388263
|
+
if (unchanged !== void 0) {
|
|
388264
|
+
recordBestEffort(deps, {
|
|
388265
|
+
event: "cli.onboarding.complete_refused",
|
|
388266
|
+
properties: {
|
|
388267
|
+
command: "onboard",
|
|
388268
|
+
...onboardingIntentProperties(deps),
|
|
388269
|
+
onboarding_run_id: runId,
|
|
388270
|
+
cli_version: deps.cliVersion,
|
|
388271
|
+
refusal_code: "no-changes-in-project"
|
|
388272
|
+
}
|
|
388273
|
+
});
|
|
388274
|
+
deps.stdout.write(unchanged);
|
|
388275
|
+
return;
|
|
388276
|
+
}
|
|
387146
388277
|
const accepted = readAcceptedDriftBestEffort(deps, runId);
|
|
387147
388278
|
const authorized = readAuthorizationsBestEffort(deps, runId);
|
|
387148
388279
|
const removed = readRemovedPathsBestEffort(deps, runId);
|
|
@@ -387476,6 +388607,12 @@ Onboarding protects the developer\u2019s own tree and captures nothing beyond it
|
|
|
387476
388607
|
"git-failed": `\`git status\` failed in ${result.detail}, so the protected set could not be
|
|
387477
388608
|
derived. Nothing was captured: an empty baseline would read as "nothing here
|
|
387478
388609
|
needs protecting", which is the opposite of what just happened.
|
|
388610
|
+
`,
|
|
388611
|
+
"root-outside-project": `This run is anchored at ${result.detail}, above the project this command
|
|
388612
|
+
ran in. Nothing was captured: a baseline derived up there reads every file
|
|
388613
|
+
below it, including projects this run has no business in.
|
|
388614
|
+
Run \`copilotkit onboard start --run <id>\` here to give this project a run of
|
|
388615
|
+
its own, or run this step from the directory the run started in.
|
|
387479
388616
|
`
|
|
387480
388617
|
}[result.reason];
|
|
387481
388618
|
return `Status: blocked
|
|
@@ -388075,10 +389212,11 @@ function reportingRefusal(dependencies, runId, code, extra, read) {
|
|
|
388075
389212
|
throw error98;
|
|
388076
389213
|
}
|
|
388077
389214
|
}
|
|
388078
|
-
function recordTerminalWhenReached(dependencies, runId, promptName) {
|
|
389215
|
+
function recordTerminalWhenReached(dependencies, runId, promptName, routeBefore) {
|
|
388079
389216
|
const terminal = TERMINAL_NODES[promptName];
|
|
388080
389217
|
if (terminal === void 0)
|
|
388081
389218
|
return;
|
|
389219
|
+
const reason = terminalReasonForRoute(routeBefore);
|
|
388082
389220
|
markRunEndedBestEffort(dependencies, runId);
|
|
388083
389221
|
recordBestEffort(dependencies, {
|
|
388084
389222
|
event: "cli.onboarding.terminal_reached",
|
|
@@ -388088,6 +389226,10 @@ function recordTerminalWhenReached(dependencies, runId, promptName) {
|
|
|
388088
389226
|
onboarding_run_id: runId,
|
|
388089
389227
|
cli_version: dependencies.cliVersion,
|
|
388090
389228
|
terminal,
|
|
389229
|
+
// Omitted rather than sent as `other` when the route names no earlier
|
|
389230
|
+
// step: a route that could not be read has not said the reason is
|
|
389231
|
+
// unknown, it has said nothing at all.
|
|
389232
|
+
...reason === void 0 ? {} : { terminal_reason: reason },
|
|
388091
389233
|
...detectionProperties(dependencies)
|
|
388092
389234
|
}
|
|
388093
389235
|
});
|
|
@@ -388506,6 +389648,42 @@ function readAuthorizationsBestEffort(dependencies, runId) {
|
|
|
388506
389648
|
return [];
|
|
388507
389649
|
}
|
|
388508
389650
|
}
|
|
389651
|
+
function unchangedProjectRefusal(dependencies, runId) {
|
|
389652
|
+
let changes;
|
|
389653
|
+
try {
|
|
389654
|
+
changes = readProjectChanges(
|
|
389655
|
+
{ cwd: dependencies.cwd, store: dependencies.store },
|
|
389656
|
+
{ runId }
|
|
389657
|
+
);
|
|
389658
|
+
} catch {
|
|
389659
|
+
return void 0;
|
|
389660
|
+
}
|
|
389661
|
+
if (changes.status === "blocked")
|
|
389662
|
+
return void 0;
|
|
389663
|
+
if (changes.committedAfterCapture === true)
|
|
389664
|
+
return void 0;
|
|
389665
|
+
if (changes.changed.length > 0)
|
|
389666
|
+
return void 0;
|
|
389667
|
+
return [
|
|
389668
|
+
"Status: blocked",
|
|
389669
|
+
"no-changes-in-project",
|
|
389670
|
+
"This project holds no change since its protected baseline was captured: no",
|
|
389671
|
+
"tracked file was modified, and nothing new was added beyond the files this",
|
|
389672
|
+
"graph writes itself, `.env` and `.copilotkit/project.json`. Ignored files do",
|
|
389673
|
+
"not count as work.",
|
|
389674
|
+
"",
|
|
389675
|
+
"A run that built something and left this tree untouched built it somewhere",
|
|
389676
|
+
"else. The usual cause is an implementation subagent that worked in its own",
|
|
389677
|
+
"git worktree, a branch checkout, or a copy of the project, and reported back",
|
|
389678
|
+
"without bringing the changes here. This is not a preservation failure: no",
|
|
389679
|
+
"protected path was changed, and none had to be.",
|
|
389680
|
+
"",
|
|
389681
|
+
"Bring those changes into this project, then run `onboard audit` and this",
|
|
389682
|
+
"command again. Onboarding is not complete until they are here: the developer",
|
|
389683
|
+
"is left with the project in front of them, not the one the work was done in.",
|
|
389684
|
+
""
|
|
389685
|
+
].join("\n");
|
|
389686
|
+
}
|
|
388509
389687
|
function readAcceptedDriftBestEffort(dependencies, runId) {
|
|
388510
389688
|
try {
|
|
388511
389689
|
return readAcceptedDrift(
|
|
@@ -388528,7 +389706,7 @@ function recordStarted(dependencies, runId, origin, idOrigin, codingAgent) {
|
|
|
388528
389706
|
...onboardingIntentProperties(dependencies),
|
|
388529
389707
|
onboarding_run_id: runId,
|
|
388530
389708
|
cli_version: dependencies.cliVersion,
|
|
388531
|
-
|
|
389709
|
+
...codingAgentProperty(codingAgent),
|
|
388532
389710
|
started_by: origin,
|
|
388533
389711
|
run_id_origin: idOrigin
|
|
388534
389712
|
}
|
|
@@ -388568,7 +389746,7 @@ function writePrompt(dependencies, runId, prompt) {
|
|
|
388568
389746
|
`);
|
|
388569
389747
|
}
|
|
388570
389748
|
recordRouteBestEffort(dependencies, runId, prompt.name);
|
|
388571
|
-
recordTerminalWhenReached(dependencies, runId, prompt.name);
|
|
389749
|
+
recordTerminalWhenReached(dependencies, runId, prompt.name, routeBefore);
|
|
388572
389750
|
const routeAfter = readRouteBestEffort(dependencies);
|
|
388573
389751
|
recordBestEffort(dependencies, {
|
|
388574
389752
|
event: "cli.onboarding.prompt_served",
|
|
@@ -389131,7 +390309,7 @@ var init_channels_report = __esm({
|
|
|
389131
390309
|
"apps/cli/src/services/channels-report.ts"() {
|
|
389132
390310
|
"use strict";
|
|
389133
390311
|
init_channels();
|
|
389134
|
-
|
|
390312
|
+
init_src12();
|
|
389135
390313
|
init_api_client();
|
|
389136
390314
|
init_channel_credentials();
|
|
389137
390315
|
init_channels_state();
|
|
@@ -389799,7 +390977,7 @@ var MAX_CAPTURED_OUTPUT_BYTES, MicrosoftTeamsCliError, statusSchema, createdAppS
|
|
|
389799
390977
|
var init_microsoft_teams_cli = __esm({
|
|
389800
390978
|
"apps/cli/src/services/microsoft-teams-cli.ts"() {
|
|
389801
390979
|
"use strict";
|
|
389802
|
-
|
|
390980
|
+
init_src12();
|
|
389803
390981
|
init_zod();
|
|
389804
390982
|
init_channel_credentials();
|
|
389805
390983
|
MAX_CAPTURED_OUTPUT_BYTES = 1024 * 1024;
|
|
@@ -390424,7 +391602,7 @@ var command, microsoftMutationWarning, INGRESS_PROBE_TIMEOUT_MS, CONSENT_PROPAGA
|
|
|
390424
391602
|
var init_teams_provision = __esm({
|
|
390425
391603
|
"apps/cli/src/services/teams-provision.ts"() {
|
|
390426
391604
|
"use strict";
|
|
390427
|
-
|
|
391605
|
+
init_src12();
|
|
390428
391606
|
init_api_client();
|
|
390429
391607
|
init_channel_credentials();
|
|
390430
391608
|
init_microsoft_teams_cli();
|
|
@@ -390519,7 +391697,7 @@ async function runChannelProviders(options) {
|
|
|
390519
391697
|
var init_channel_providers = __esm({
|
|
390520
391698
|
"apps/cli/src/commands/channel-providers.ts"() {
|
|
390521
391699
|
"use strict";
|
|
390522
|
-
|
|
391700
|
+
init_src12();
|
|
390523
391701
|
init_channel_provider_catalog();
|
|
390524
391702
|
}
|
|
390525
391703
|
});
|
|
@@ -391366,7 +392544,7 @@ var init_channels2 = __esm({
|
|
|
391366
392544
|
async "apps/cli/src/commands/channels.ts"() {
|
|
391367
392545
|
"use strict";
|
|
391368
392546
|
init_channels();
|
|
391369
|
-
|
|
392547
|
+
init_src12();
|
|
391370
392548
|
init_config();
|
|
391371
392549
|
init_unknown_input();
|
|
391372
392550
|
init_agent_prompt();
|
|
@@ -391737,6 +392915,42 @@ var init_kite = __esm({
|
|
|
391737
392915
|
}
|
|
391738
392916
|
});
|
|
391739
392917
|
|
|
392918
|
+
// apps/cli/src/node-version.ts
|
|
392919
|
+
var MINIMUM_NODE_VERSION = "20.9.0";
|
|
392920
|
+
function readVersionParts(version6) {
|
|
392921
|
+
const match2 = /^v?(\d+)\.(\d+)\.(\d+)/.exec(version6.trim());
|
|
392922
|
+
if (match2 === null)
|
|
392923
|
+
return void 0;
|
|
392924
|
+
return [Number(match2[1]), Number(match2[2]), Number(match2[3])];
|
|
392925
|
+
}
|
|
392926
|
+
function meetsMinimumNodeVersion(running, minimum = MINIMUM_NODE_VERSION) {
|
|
392927
|
+
const current = readVersionParts(running);
|
|
392928
|
+
const floor = readVersionParts(minimum);
|
|
392929
|
+
if (current === void 0 || floor === void 0)
|
|
392930
|
+
return true;
|
|
392931
|
+
for (let index2 = 0; index2 < current.length; index2 += 1) {
|
|
392932
|
+
if (current[index2] !== floor[index2])
|
|
392933
|
+
return current[index2] > floor[index2];
|
|
392934
|
+
}
|
|
392935
|
+
return true;
|
|
392936
|
+
}
|
|
392937
|
+
function formatUnsupportedNodeMessage(running, minimum = MINIMUM_NODE_VERSION) {
|
|
392938
|
+
return `copilotkit needs Node.js ${minimum} or later.
|
|
392939
|
+
This machine is running Node.js ${running}.
|
|
392940
|
+
|
|
392941
|
+
Upgrade Node.js, then run the command again. A version manager installs a
|
|
392942
|
+
newer one beside the current one:
|
|
392943
|
+
|
|
392944
|
+
nvm install 22
|
|
392945
|
+
`;
|
|
392946
|
+
}
|
|
392947
|
+
|
|
392948
|
+
// apps/cli/src/node-version-gate.ts
|
|
392949
|
+
if (!meetsMinimumNodeVersion(process.versions.node)) {
|
|
392950
|
+
process.stderr.write(formatUnsupportedNodeMessage(process.versions.node));
|
|
392951
|
+
process.exit(1);
|
|
392952
|
+
}
|
|
392953
|
+
|
|
391740
392954
|
// apps/cli/src/index.ts
|
|
391741
392955
|
init_event_properties();
|
|
391742
392956
|
init_types();
|
|
@@ -392098,11 +393312,18 @@ records their answer with --unplanned, which marks the consent as taken outside
|
|
|
392098
393312
|
the plan wherever it is printed. The flag is refused before the plan is
|
|
392099
393313
|
reported, so it can never stand in for the plan's own approval.
|
|
392100
393314
|
|
|
393315
|
+
Complete refuses a run whose project holds no change since that baseline was
|
|
393316
|
+
captured, and prints Status: blocked with no-changes-in-project. The files
|
|
393317
|
+
onboarding writes itself do not count, and neither do ignored files. Work done
|
|
393318
|
+
in another worktree, a branch checkout, or a copy of the project leaves the
|
|
393319
|
+
developer nothing, so bring the changes into this project, then run audit and
|
|
393320
|
+
complete again.
|
|
393321
|
+
|
|
392101
393322
|
Checkpoint reports progress from inside a step, where the graph would
|
|
392102
393323
|
otherwise say nothing between one prompt and the next. --phase takes one of:
|
|
392103
|
-
research-
|
|
392104
|
-
|
|
392105
|
-
delegation-unavailable. Pass --attempt <1-9>
|
|
393324
|
+
research-dispatched, surface-probed, research-returned, starter-cloned,
|
|
393325
|
+
plan-written, container-surveyed, container-settled, build-validated,
|
|
393326
|
+
journey-attempted, repair-attempted, delegation-unavailable. Pass --attempt <1-9>
|
|
392106
393327
|
where the step loops, so a repair cycle can be counted.
|
|
392107
393328
|
A refused checkpoint exits zero and prints the closed set. It is called from
|
|
392108
393329
|
the middle of the longest step of a run, and a non-zero exit there reads as a
|
|
@@ -393041,18 +394262,19 @@ function parseGlobalArgs(argv) {
|
|
|
393041
394262
|
const parsed = {
|
|
393042
394263
|
verbose: false
|
|
393043
394264
|
};
|
|
393044
|
-
for (const [flag, key] of [
|
|
393045
|
-
["--app-api-url", "appApiUrl"],
|
|
393046
|
-
["--ops-api-url", "opsApiUrl"],
|
|
393047
|
-
["--ops-frontend-url", "opsFrontendUrl"],
|
|
393048
|
-
["--teams-ingress-url", "teamsIngressUrl"],
|
|
393049
|
-
["--slack-ingress-url", "slackIngressUrl"]
|
|
394265
|
+
for (const [flag, key, expects] of [
|
|
394266
|
+
["--app-api-url", "appApiUrl", "a URL argument"],
|
|
394267
|
+
["--ops-api-url", "opsApiUrl", "a URL argument"],
|
|
394268
|
+
["--ops-frontend-url", "opsFrontendUrl", "a URL argument"],
|
|
394269
|
+
["--teams-ingress-url", "teamsIngressUrl", "a URL argument"],
|
|
394270
|
+
["--slack-ingress-url", "slackIngressUrl", "a URL argument"],
|
|
394271
|
+
["--deployment", "deployment", '"managed" or "self-hosted"']
|
|
393050
394272
|
]) {
|
|
393051
394273
|
const idx = remaining.indexOf(flag);
|
|
393052
394274
|
if (idx !== -1) {
|
|
393053
394275
|
const url4 = remaining[idx + 1];
|
|
393054
394276
|
if (!url4 || url4.startsWith("-")) {
|
|
393055
|
-
process.stderr.write(`Error: ${flag} requires
|
|
394277
|
+
process.stderr.write(`Error: ${flag} requires ${expects}.
|
|
393056
394278
|
`);
|
|
393057
394279
|
process.exit(1);
|
|
393058
394280
|
}
|
|
@@ -393072,10 +394294,26 @@ function parseGlobalArgs(argv) {
|
|
|
393072
394294
|
...parsed.opsApiUrl ? { opsApiUrl: parsed.opsApiUrl } : {},
|
|
393073
394295
|
...parsed.opsFrontendUrl ? { opsFrontendUrl: parsed.opsFrontendUrl } : {},
|
|
393074
394296
|
...parsed.teamsIngressUrl ? { teamsIngressUrl: parsed.teamsIngressUrl } : {},
|
|
393075
|
-
...parsed.slackIngressUrl ? { slackIngressUrl: parsed.slackIngressUrl } : {}
|
|
394297
|
+
...parsed.slackIngressUrl ? { slackIngressUrl: parsed.slackIngressUrl } : {},
|
|
394298
|
+
...parsed.deployment ? { deployment: parsed.deployment } : {}
|
|
393076
394299
|
};
|
|
393077
394300
|
}
|
|
393078
394301
|
async function applyGlobalArgs(parsed) {
|
|
394302
|
+
if (parsed.deployment) {
|
|
394303
|
+
const { setDeploymentTarget: setDeploymentTarget2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
394304
|
+
if (parsed.deployment !== "managed" && parsed.deployment !== "self-hosted") {
|
|
394305
|
+
process.stderr.write(
|
|
394306
|
+
`Error: unknown deployment "${parsed.deployment}". Use "managed" or "self-hosted".
|
|
394307
|
+
`
|
|
394308
|
+
);
|
|
394309
|
+
process.exit(1);
|
|
394310
|
+
}
|
|
394311
|
+
const appApiUrl = parsed.appApiUrl ?? process.env["COPILOTKIT_APP_API_URL"]?.trim();
|
|
394312
|
+
setDeploymentTarget2({
|
|
394313
|
+
name: parsed.deployment,
|
|
394314
|
+
...appApiUrl ? { appApiUrl } : {}
|
|
394315
|
+
});
|
|
394316
|
+
}
|
|
393079
394317
|
if (parsed.appApiUrl || parsed.opsApiUrl || parsed.opsFrontendUrl || parsed.teamsIngressUrl || parsed.slackIngressUrl) {
|
|
393080
394318
|
const {
|
|
393081
394319
|
setAppApiUrl: setAppApiUrl2,
|
|
@@ -394588,14 +395826,17 @@ async function main(rawArgv = process.argv.slice(2)) {
|
|
|
394588
395826
|
const helpText = helpTopic === null ? null : helpTextForTopic(helpTopic);
|
|
394589
395827
|
const command2 = argv[0];
|
|
394590
395828
|
if (helpText !== null) {
|
|
395829
|
+
const helpBase = {
|
|
395830
|
+
command: "help",
|
|
395831
|
+
subcommand: helpTopic ?? "unknown"
|
|
395832
|
+
};
|
|
394591
395833
|
recordTelemetryEvent({
|
|
394592
|
-
properties: {
|
|
394593
|
-
command: "help",
|
|
394594
|
-
outcome: "started",
|
|
394595
|
-
subcommand: helpTopic ?? "unknown"
|
|
394596
|
-
}
|
|
395834
|
+
properties: { ...helpBase, outcome: "started" }
|
|
394597
395835
|
});
|
|
394598
395836
|
process.stdout.write(helpText);
|
|
395837
|
+
recordTelemetryEvent({
|
|
395838
|
+
properties: { ...helpBase, outcome: "succeeded" }
|
|
395839
|
+
});
|
|
394599
395840
|
return;
|
|
394600
395841
|
}
|
|
394601
395842
|
await applyGlobalArgs(globalArgs);
|
|
@@ -394651,6 +395892,7 @@ function installSignalHandlers() {
|
|
|
394651
395892
|
shuttingDown = true;
|
|
394652
395893
|
const safety = setTimeout(() => process.exit(130), 2e3);
|
|
394653
395894
|
safety.unref();
|
|
395895
|
+
recordAbandonedInvocation();
|
|
394654
395896
|
const reraise = () => {
|
|
394655
395897
|
process.kill(process.pid, signal);
|
|
394656
395898
|
};
|