copilotkit 4.9.0 → 4.9.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 +24 -0
- package/cli-build-info.json +7 -7
- package/index.js +542 -95
- package/onboarding/prompts/authenticate/start.md +37 -17
- package/onboarding/prompts/credentials/finalize-plan.md +32 -7
- package/onboarding/prompts/credentials/plan.md +26 -20
- package/onboarding/prompts/fallback/best-effort.md +10 -3
- package/onboarding/prompts/framework/ag2.md +2 -2
- package/onboarding/prompts/framework/agno.md +2 -2
- package/onboarding/prompts/framework/built-in.md +2 -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 +2 -2
- package/onboarding/prompts/framework/google-adk.md +2 -2
- package/onboarding/prompts/framework/langgraph-fastapi.md +2 -2
- package/onboarding/prompts/framework/langgraph-python.md +2 -2
- package/onboarding/prompts/framework/langgraph-typescript.md +2 -2
- package/onboarding/prompts/framework/llamaindex.md +2 -2
- package/onboarding/prompts/framework/mastra.md +2 -2
- package/onboarding/prompts/framework/ms-agent-dotnet.md +2 -2
- package/onboarding/prompts/framework/ms-agent-harness-dotnet.md +2 -2
- package/onboarding/prompts/framework/ms-agent-python.md +2 -2
- package/onboarding/prompts/framework/pydantic-ai.md +2 -2
- package/onboarding/prompts/framework/strands-python.md +2 -2
- package/onboarding/prompts/framework/strands-typescript.md +2 -2
- package/onboarding/prompts/frontend/angular.md +2 -2
- package/onboarding/prompts/frontend/nextjs.md +2 -2
- package/onboarding/prompts/frontend/plan.md +12 -6
- 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 +2 -2
- package/onboarding/prompts/proof/complete.md +40 -14
- package/onboarding/prompts/proof/oss-baseline.md +3 -3
- package/onboarding/prompts/proof/round-trip.md +29 -17
- package/onboarding/prompts/subagent/inspect-repository.md +6 -1
- package/onboarding/prompts/subagent/prove-oss-baseline.md +1 -1
- package/onboarding/prompts/subagent/prove-round-trip.md +27 -15
- package/onboarding/prompts/unsupported/no-validated-path.md +6 -5
- package/package.json +1 -1
- package/release/release-tool.js +1 -1
package/index.js
CHANGED
|
@@ -96,14 +96,14 @@ function getTelemetryEndpointUrl() {
|
|
|
96
96
|
}
|
|
97
97
|
function getBuildInfo() {
|
|
98
98
|
return {
|
|
99
|
-
version: true ? "4.9.
|
|
100
|
-
buildNumber: true ? "
|
|
101
|
-
commitSha: true ? "
|
|
99
|
+
version: true ? "4.9.1" : "dev",
|
|
100
|
+
buildNumber: true ? "32915219082" : "dev",
|
|
101
|
+
commitSha: true ? "0528d9de0d7915386d789deb676d44c4668842b1" : "dev",
|
|
102
102
|
copilotKitCommit: getTemplateRef()
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
function getTemplateRef() {
|
|
106
|
-
return true ? "
|
|
106
|
+
return true ? "2ad03320fe1f0834b138113fffe791781e5b226e" : "main";
|
|
107
107
|
}
|
|
108
108
|
function getC15tBackendUrl() {
|
|
109
109
|
return true ? "https://calm-hazelnut-joy-copilotkit.inth.app" : "";
|
|
@@ -93909,11 +93909,15 @@ function BrowserLoginConfirmation({
|
|
|
93909
93909
|
} = {}) {
|
|
93910
93910
|
const { state, confirmBrowserLoginStart, submitManualClerkToken } = useBrowserLogin();
|
|
93911
93911
|
const [manualTokenInput, setManualTokenInput] = (0, import_react35.useState)("");
|
|
93912
|
-
|
|
93913
|
-
|
|
93914
|
-
|
|
93915
|
-
|
|
93916
|
-
|
|
93912
|
+
const canPrompt = isBrowserLoginConfirmationInteractive();
|
|
93913
|
+
use_input_default(
|
|
93914
|
+
(_input, key) => {
|
|
93915
|
+
if (state.phase === "confirming" && key.return) {
|
|
93916
|
+
confirmBrowserLoginStart();
|
|
93917
|
+
}
|
|
93918
|
+
},
|
|
93919
|
+
{ isActive: canPrompt }
|
|
93920
|
+
);
|
|
93917
93921
|
if (state.phase === "idle") {
|
|
93918
93922
|
return null;
|
|
93919
93923
|
}
|
|
@@ -93931,7 +93935,7 @@ function BrowserLoginConfirmation({
|
|
|
93931
93935
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: BROWSER_LOGIN_MANUAL_URL_LABEL }),
|
|
93932
93936
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: state.loginUrl })
|
|
93933
93937
|
] }) : null,
|
|
93934
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
|
|
93938
|
+
canPrompt ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
|
|
93935
93939
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { dimColor: true, children: BROWSER_LOGIN_MANUAL_PASTE_LABEL }),
|
|
93936
93940
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
|
|
93937
93941
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
|
|
@@ -93951,7 +93955,7 @@ function BrowserLoginConfirmation({
|
|
|
93951
93955
|
}
|
|
93952
93956
|
)
|
|
93953
93957
|
] })
|
|
93954
|
-
] }),
|
|
93958
|
+
] }) : null,
|
|
93955
93959
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CliTip, {})
|
|
93956
93960
|
] });
|
|
93957
93961
|
}
|
|
@@ -95687,15 +95691,15 @@ function createFlagPrompts(request) {
|
|
|
95687
95691
|
};
|
|
95688
95692
|
return { prompts, refusal };
|
|
95689
95693
|
}
|
|
95690
|
-
function formatFlagRefusal(refusal) {
|
|
95694
|
+
function formatFlagRefusal(refusal, command2 = "project select") {
|
|
95691
95695
|
if (refusal.kind === "name-rejected") {
|
|
95692
|
-
const remedy = refusal.duplicateSlug === void 0 ? "Pass a different --create name." : `Pass a different --create name, or select it with \`copilotkit
|
|
95696
|
+
const remedy = refusal.duplicateSlug === void 0 ? "Pass a different --create name." : `Pass a different --create name, or select it with \`copilotkit ${command2} --project ${refusal.duplicateSlug}\`.`;
|
|
95693
95697
|
return `${refusal.message} ${remedy}
|
|
95694
95698
|
`;
|
|
95695
95699
|
}
|
|
95696
95700
|
if (refusal.available.length === 0) {
|
|
95697
95701
|
return `No hosted Intelligence projects exist in this organization, so --project ${refusal.requested} cannot be selected.
|
|
95698
|
-
Create one with \`copilotkit
|
|
95702
|
+
Create one with \`copilotkit ${command2} --create <name>\`.
|
|
95699
95703
|
`;
|
|
95700
95704
|
}
|
|
95701
95705
|
return `No hosted project matches --project ${refusal.requested} in this organization.
|
|
@@ -377321,6 +377325,146 @@ var init_env_file = __esm({
|
|
|
377321
377325
|
}
|
|
377322
377326
|
});
|
|
377323
377327
|
|
|
377328
|
+
// apps/cli/src/commands/init-project-flag.ts
|
|
377329
|
+
var init_project_flag_exports = {};
|
|
377330
|
+
__export(init_project_flag_exports, {
|
|
377331
|
+
hostedProjectFlagUnsupportedError: () => hostedProjectFlagUnsupportedError,
|
|
377332
|
+
resolveInitProjectFlag: () => resolveInitProjectFlag,
|
|
377333
|
+
selectHostedProjectFromFlag: () => selectHostedProjectFromFlag
|
|
377334
|
+
});
|
|
377335
|
+
function resolveInitProjectFlag(input) {
|
|
377336
|
+
const project = input.project?.trim();
|
|
377337
|
+
const create3 = input.create?.trim();
|
|
377338
|
+
if (input.project !== void 0 && input.create !== void 0) {
|
|
377339
|
+
return {
|
|
377340
|
+
status: "invalid",
|
|
377341
|
+
message: "`--project` and `--create` cannot be combined: one selects an existing hosted Intelligence project, the other makes a new one.\nRun `copilotkit project list --json` to see what already exists."
|
|
377342
|
+
};
|
|
377343
|
+
}
|
|
377344
|
+
if (input.project !== void 0) {
|
|
377345
|
+
if (project === void 0 || project === "") {
|
|
377346
|
+
return {
|
|
377347
|
+
status: "invalid",
|
|
377348
|
+
message: "`--project` needs a project slug or id.\nRun `copilotkit project list --json` to see them."
|
|
377349
|
+
};
|
|
377350
|
+
}
|
|
377351
|
+
return resolveAgainstFramework(
|
|
377352
|
+
{ kind: "project", value: project },
|
|
377353
|
+
input.framework
|
|
377354
|
+
);
|
|
377355
|
+
}
|
|
377356
|
+
if (input.create !== void 0) {
|
|
377357
|
+
if (create3 === void 0 || create3 === "") {
|
|
377358
|
+
return {
|
|
377359
|
+
status: "invalid",
|
|
377360
|
+
message: "`--create` needs a project name."
|
|
377361
|
+
};
|
|
377362
|
+
}
|
|
377363
|
+
return resolveAgainstFramework(
|
|
377364
|
+
{ kind: "create", name: create3 },
|
|
377365
|
+
input.framework
|
|
377366
|
+
);
|
|
377367
|
+
}
|
|
377368
|
+
return { status: "ok", request: null };
|
|
377369
|
+
}
|
|
377370
|
+
function resolveAgainstFramework(request, framework) {
|
|
377371
|
+
const unsupported = hostedProjectFlagUnsupportedError(
|
|
377372
|
+
request,
|
|
377373
|
+
framework ?? null
|
|
377374
|
+
);
|
|
377375
|
+
return unsupported === void 0 ? { status: "ok", request } : { status: "invalid", message: unsupported };
|
|
377376
|
+
}
|
|
377377
|
+
function hostedProjectFlagUnsupportedError(hostedProject, framework) {
|
|
377378
|
+
if (hostedProject === null || framework === null)
|
|
377379
|
+
return void 0;
|
|
377380
|
+
const resolved = resolveFrameworkAlias(framework);
|
|
377381
|
+
if (!isAgentFramework(resolved) || THREADS_FRAMEWORKS.has(resolved)) {
|
|
377382
|
+
return void 0;
|
|
377383
|
+
}
|
|
377384
|
+
const flag = hostedProject.kind === "project" ? `--project ${hostedProject.value}` : `--create ${hostedProject.name}`;
|
|
377385
|
+
return `The ${resolved} starter ships no Intelligence threads, so there is no hosted project to bind and \`${flag}\` cannot be used with it.
|
|
377386
|
+
Run \`copilotkit framework list\` to see which frameworks bind a project, or scaffold without the flag.`;
|
|
377387
|
+
}
|
|
377388
|
+
async function selectHostedProjectFromFlag(apiClient, request, telemetry) {
|
|
377389
|
+
const { prompts, refusal } = createFlagPrompts(request);
|
|
377390
|
+
const result = await selectOrCreateHostedProject({
|
|
377391
|
+
apiClient,
|
|
377392
|
+
prompts,
|
|
377393
|
+
...telemetry ? { telemetry } : {}
|
|
377394
|
+
});
|
|
377395
|
+
if ("canceled" in result) {
|
|
377396
|
+
const recorded = refusal.value;
|
|
377397
|
+
throw tagError(
|
|
377398
|
+
new Error(
|
|
377399
|
+
recorded === null ? "Project selection canceled." : formatFlagRefusal(recorded, "init").trimEnd()
|
|
377400
|
+
),
|
|
377401
|
+
TELEMETRY_ERROR_CODES.PROJECT_NOT_FOUND
|
|
377402
|
+
);
|
|
377403
|
+
}
|
|
377404
|
+
return result;
|
|
377405
|
+
}
|
|
377406
|
+
var init_init_project_flag = __esm({
|
|
377407
|
+
"apps/cli/src/commands/init-project-flag.ts"() {
|
|
377408
|
+
"use strict";
|
|
377409
|
+
init_hosted_project2();
|
|
377410
|
+
init_types();
|
|
377411
|
+
init_event_properties();
|
|
377412
|
+
init_project_select_flags();
|
|
377413
|
+
}
|
|
377414
|
+
});
|
|
377415
|
+
|
|
377416
|
+
// apps/cli/src/commands/init-non-interactive.ts
|
|
377417
|
+
var init_non_interactive_exports = {};
|
|
377418
|
+
__export(init_non_interactive_exports, {
|
|
377419
|
+
NON_INTERACTIVE_LOGIN_MESSAGE: () => NON_INTERACTIVE_LOGIN_MESSAGE,
|
|
377420
|
+
formatNonInteractiveInitRefusal: () => formatNonInteractiveInitRefusal,
|
|
377421
|
+
missingNonInteractiveInitFlags: () => missingNonInteractiveInitFlags,
|
|
377422
|
+
resolveInitInstallFlag: () => resolveInitInstallFlag
|
|
377423
|
+
});
|
|
377424
|
+
function missingNonInteractiveInitFlags(answers) {
|
|
377425
|
+
const missing = [];
|
|
377426
|
+
if (answers.name === void 0 || answers.name.trim() === "") {
|
|
377427
|
+
missing.push("--name");
|
|
377428
|
+
}
|
|
377429
|
+
const framework = answers.framework === void 0 ? void 0 : resolveFrameworkAlias(answers.framework);
|
|
377430
|
+
if (framework === void 0 || framework.trim() === "") {
|
|
377431
|
+
missing.push("--framework");
|
|
377432
|
+
} else if (isAgentFramework(framework) && THREADS_FRAMEWORKS.has(framework) && !answers.hostedProjectNamed) {
|
|
377433
|
+
missing.push("--project");
|
|
377434
|
+
}
|
|
377435
|
+
if (!answers.installAnswered) {
|
|
377436
|
+
missing.push("--yes");
|
|
377437
|
+
}
|
|
377438
|
+
return missing;
|
|
377439
|
+
}
|
|
377440
|
+
function formatNonInteractiveInitRefusal(missing) {
|
|
377441
|
+
return `\`copilotkit init\` prompts for anything you do not name, and this shell has no terminal to prompt in.
|
|
377442
|
+
Name the rest up front: ${missing.join(", ")}
|
|
377443
|
+
` + (missing.includes("--project") ? "Run `copilotkit project list --json` to see your projects, or pass `--create <name>` to make one.\n" : "") + (missing.includes("--framework") ? "Run `copilotkit framework list` to see the frameworks and the flags each accepts.\n" : "") + (missing.includes("--yes") ? "`--yes` installs dependencies; pass `--no-install` to answer the same question without installing.\n" : "");
|
|
377444
|
+
}
|
|
377445
|
+
function resolveInitInstallFlag(input) {
|
|
377446
|
+
const wantsInstall = input.yes === true || input.install === true;
|
|
377447
|
+
if (wantsInstall && input.noInstall === true) {
|
|
377448
|
+
return {
|
|
377449
|
+
status: "invalid",
|
|
377450
|
+
message: "Pass either `--install` (or `--yes`) or `--no-install`, not both: they answer the same question in opposite ways."
|
|
377451
|
+
};
|
|
377452
|
+
}
|
|
377453
|
+
if (wantsInstall)
|
|
377454
|
+
return { status: "ok", install: true };
|
|
377455
|
+
if (input.noInstall === true)
|
|
377456
|
+
return { status: "ok", install: false };
|
|
377457
|
+
return { status: "ok", install: null };
|
|
377458
|
+
}
|
|
377459
|
+
var NON_INTERACTIVE_LOGIN_MESSAGE;
|
|
377460
|
+
var init_init_non_interactive = __esm({
|
|
377461
|
+
"apps/cli/src/commands/init-non-interactive.ts"() {
|
|
377462
|
+
"use strict";
|
|
377463
|
+
init_types();
|
|
377464
|
+
NON_INTERACTIVE_LOGIN_MESSAGE = "`copilotkit init` needs a CopilotKit session, and signing in opens a browser that finishes back at a terminal this shell does not have.\nRun `copilotkit login` in a terminal, then re-run this command.";
|
|
377465
|
+
}
|
|
377466
|
+
});
|
|
377467
|
+
|
|
377324
377468
|
// apps/cli/src/ui/init-flow.tsx
|
|
377325
377469
|
import * as path26 from "node:path";
|
|
377326
377470
|
function FrameworkIndicator({ isSelected = false }) {
|
|
@@ -379110,6 +379254,12 @@ import {
|
|
|
379110
379254
|
rmSync as rmSync4
|
|
379111
379255
|
} from "node:fs";
|
|
379112
379256
|
import * as path33 from "node:path";
|
|
379257
|
+
function markDisplayedAtTerminal(error98) {
|
|
379258
|
+
if (process.stdout.isTTY === true) {
|
|
379259
|
+
error98.displayed = true;
|
|
379260
|
+
}
|
|
379261
|
+
return error98;
|
|
379262
|
+
}
|
|
379113
379263
|
function shouldRenderInitBrowserLoginConfirmation(phase) {
|
|
379114
379264
|
return phase === "confirming" || phase === "waiting" || phase === "finalizing";
|
|
379115
379265
|
}
|
|
@@ -379137,6 +379287,16 @@ function commandExists(command2, environment = process.env, platform4 = process.
|
|
|
379137
379287
|
function vendorKeyPromptInteractive() {
|
|
379138
379288
|
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
379139
379289
|
}
|
|
379290
|
+
function createHostedProjectApiClient(auth2) {
|
|
379291
|
+
return createApiClient(getOpsApiUrl(), auth2.cliToken, {
|
|
379292
|
+
onProductCredential: (productCredential) => {
|
|
379293
|
+
authStore.save({ ...auth2, productCredential });
|
|
379294
|
+
},
|
|
379295
|
+
productBaseUrl: getAppApiUrl(),
|
|
379296
|
+
productCredential: auth2.productCredential,
|
|
379297
|
+
productOrganizationId: auth2.clerkOrgId
|
|
379298
|
+
});
|
|
379299
|
+
}
|
|
379140
379300
|
function buildInitNextSteps(templateDefinition, projectName, result, unsatisfiedKeys, installAlreadyRan = false, mockProvider = void 0) {
|
|
379141
379301
|
const missingPrerequisites = templateDefinition.prerequisites.filter(
|
|
379142
379302
|
(prerequisite) => result.missingPrerequisites.includes(prerequisite.command)
|
|
@@ -379322,6 +379482,12 @@ async function ensureCliToken2(dependencies, onTerminalSessionInvalidation, onBr
|
|
|
379322
379482
|
}
|
|
379323
379483
|
};
|
|
379324
379484
|
const openBrowser = async () => {
|
|
379485
|
+
if (!(dependencies.isBrowserLoginInteractive ?? isBrowserLoginConfirmationInteractive)()) {
|
|
379486
|
+
throw tagError(
|
|
379487
|
+
new Error(NON_INTERACTIVE_LOGIN_MESSAGE),
|
|
379488
|
+
TELEMETRY_ERROR_CODES.NON_INTERACTIVE
|
|
379489
|
+
);
|
|
379490
|
+
}
|
|
379325
379491
|
emitGate(false);
|
|
379326
379492
|
if (!openedBrowser) {
|
|
379327
379493
|
openedBrowser = true;
|
|
@@ -379579,13 +379745,16 @@ async function scaffoldInitProject(options, dependencies = defaultInitScaffoldDe
|
|
|
379579
379745
|
});
|
|
379580
379746
|
} catch (selectionError) {
|
|
379581
379747
|
const detail = selectionError instanceof Error ? selectionError.message : String(selectionError);
|
|
379582
|
-
warnings.push(
|
|
379583
|
-
`Project not selected (${detail}); run \`copilotkit project select\` in the project to choose one.`
|
|
379584
|
-
);
|
|
379585
379748
|
writeCliLog("error", {
|
|
379586
379749
|
event: "init.project_select_failed",
|
|
379587
379750
|
detail
|
|
379588
379751
|
});
|
|
379752
|
+
if (options.hostedProject !== null && options.hostedProject !== void 0) {
|
|
379753
|
+
throw selectionError instanceof Error ? selectionError : new Error(detail);
|
|
379754
|
+
}
|
|
379755
|
+
warnings.push(
|
|
379756
|
+
`Project not selected (${detail}); run \`copilotkit project select\` in the project to choose one.`
|
|
379757
|
+
);
|
|
379589
379758
|
}
|
|
379590
379759
|
}
|
|
379591
379760
|
telemetry?.onScaffoldSucceeded({
|
|
@@ -379757,6 +379926,7 @@ function ScaffoldProgress({
|
|
|
379757
379926
|
const channelOfferDeferredRef = (0, import_react48.useRef)(null);
|
|
379758
379927
|
const channelCompletionOfferedRef = (0, import_react48.useRef)(false);
|
|
379759
379928
|
const installAlreadyRanRef = (0, import_react48.useRef)(false);
|
|
379929
|
+
const installAnsweredRef = (0, import_react48.useRef)(false);
|
|
379760
379930
|
const [credentialRequest, setCredentialRequest] = (0, import_react48.useState)(null);
|
|
379761
379931
|
const [attachingChannel, setAttachingChannel] = (0, import_react48.useState)(false);
|
|
379762
379932
|
const channelFlagError = (0, import_react48.useMemo)(
|
|
@@ -379766,6 +379936,13 @@ function ScaffoldProgress({
|
|
|
379766
379936
|
),
|
|
379767
379937
|
[options.channel, options.framework]
|
|
379768
379938
|
);
|
|
379939
|
+
const hostedProjectFlagError = (0, import_react48.useMemo)(
|
|
379940
|
+
() => hostedProjectFlagUnsupportedError(
|
|
379941
|
+
options.hostedProject ?? null,
|
|
379942
|
+
options.framework ?? null
|
|
379943
|
+
),
|
|
379944
|
+
[options.hostedProject, options.framework]
|
|
379945
|
+
);
|
|
379769
379946
|
const flagChannelOffer = (0, import_react48.useMemo)(
|
|
379770
379947
|
() => channelOfferFromFlag(options.channel ?? null),
|
|
379771
379948
|
[options.channel]
|
|
@@ -379781,6 +379958,19 @@ function ScaffoldProgress({
|
|
|
379781
379958
|
new Error("Not authenticated for project selection.")
|
|
379782
379959
|
);
|
|
379783
379960
|
}
|
|
379961
|
+
const named = options.hostedProject;
|
|
379962
|
+
if (named !== null && named !== void 0) {
|
|
379963
|
+
return selectHostedProjectFromFlag(
|
|
379964
|
+
createHostedProjectApiClient(auth2),
|
|
379965
|
+
named,
|
|
379966
|
+
{
|
|
379967
|
+
onPickerViewed: (projectCount) => telemetry?.onProjectPickerViewed({ projectCount }),
|
|
379968
|
+
onResolved: (outcome, projectCount) => telemetry?.onProjectResolved({ outcome, projectCount }),
|
|
379969
|
+
onCreateNameRejected: (reason) => telemetry?.onProjectCreateNameRejected({ reason }),
|
|
379970
|
+
onBack: () => telemetry?.onProjectPickerBack()
|
|
379971
|
+
}
|
|
379972
|
+
);
|
|
379973
|
+
}
|
|
379784
379974
|
return new Promise((resolve9, reject) => {
|
|
379785
379975
|
selectionDeferredRef.current = { resolve: resolve9, reject };
|
|
379786
379976
|
});
|
|
@@ -379846,11 +380036,11 @@ function ScaffoldProgress({
|
|
|
379846
380036
|
}, [phase, scaffoldResult]);
|
|
379847
380037
|
(0, import_react48.useEffect)(() => {
|
|
379848
380038
|
let cancelled = false;
|
|
379849
|
-
|
|
379850
|
-
|
|
379851
|
-
error98
|
|
380039
|
+
const flagError = channelFlagError ?? hostedProjectFlagError;
|
|
380040
|
+
if (flagError !== void 0) {
|
|
380041
|
+
const error98 = markDisplayedAtTerminal(new Error(flagError));
|
|
379852
380042
|
scaffoldErrorRef.current = error98;
|
|
379853
|
-
setErrorMessage(
|
|
380043
|
+
setErrorMessage(flagError);
|
|
379854
380044
|
setPhase("error");
|
|
379855
380045
|
return () => {
|
|
379856
380046
|
cancelled = true;
|
|
@@ -379892,8 +380082,9 @@ function ScaffoldProgress({
|
|
|
379892
380082
|
run().catch((err2) => {
|
|
379893
380083
|
if (cancelled)
|
|
379894
380084
|
return;
|
|
379895
|
-
const error98 =
|
|
379896
|
-
|
|
380085
|
+
const error98 = markDisplayedAtTerminal(
|
|
380086
|
+
err2 instanceof Error ? err2 : new Error("An unexpected error occurred.")
|
|
380087
|
+
);
|
|
379897
380088
|
scaffoldErrorRef.current = error98;
|
|
379898
380089
|
setErrorMessage(error98.message);
|
|
379899
380090
|
setPhase("error");
|
|
@@ -379940,6 +380131,45 @@ function ScaffoldProgress({
|
|
|
379940
380131
|
}
|
|
379941
380132
|
setPhase("success");
|
|
379942
380133
|
}
|
|
380134
|
+
function answerInstall(result, install) {
|
|
380135
|
+
if (!install) {
|
|
380136
|
+
finalizeSuccess(result);
|
|
380137
|
+
return;
|
|
380138
|
+
}
|
|
380139
|
+
setPhase("installing");
|
|
380140
|
+
scaffoldDependencies.installDependencies({
|
|
380141
|
+
cwd: result.projectDir,
|
|
380142
|
+
command: templateDefinition.installCommand,
|
|
380143
|
+
log: writeCliLog
|
|
380144
|
+
}).then((r2) => {
|
|
380145
|
+
if (r2.ok)
|
|
380146
|
+
return true;
|
|
380147
|
+
if (isMountedRef.current) {
|
|
380148
|
+
setInstallError(r2.stderrTail || "install failed");
|
|
380149
|
+
}
|
|
380150
|
+
return false;
|
|
380151
|
+
}).catch((e2) => {
|
|
380152
|
+
if (isMountedRef.current) {
|
|
380153
|
+
setInstallError(e2 instanceof Error ? e2.message : String(e2));
|
|
380154
|
+
}
|
|
380155
|
+
return false;
|
|
380156
|
+
}).then((installSucceeded) => {
|
|
380157
|
+
if (!isMountedRef.current)
|
|
380158
|
+
return;
|
|
380159
|
+
finalizeSuccess(result, installSucceeded);
|
|
380160
|
+
});
|
|
380161
|
+
}
|
|
380162
|
+
(0, import_react48.useEffect)(() => {
|
|
380163
|
+
if (phase !== "install-prompt" || scaffoldResult === null)
|
|
380164
|
+
return;
|
|
380165
|
+
const answer = options.installDependencies;
|
|
380166
|
+
if (answer !== true && answer !== false)
|
|
380167
|
+
return;
|
|
380168
|
+
if (installAnsweredRef.current)
|
|
380169
|
+
return;
|
|
380170
|
+
installAnsweredRef.current = true;
|
|
380171
|
+
answerInstall(scaffoldResult, answer);
|
|
380172
|
+
}, [phase, scaffoldResult, options.installDependencies]);
|
|
379943
380173
|
function completeChannel(result, channel2) {
|
|
379944
380174
|
const complete = scaffoldDependencies.completeChannelSetup;
|
|
379945
380175
|
if (complete === void 0) {
|
|
@@ -380033,6 +380263,9 @@ function ScaffoldProgress({
|
|
|
380033
380263
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Spinner, { label: "\u{1FA81} Downloading template\u2026" }) });
|
|
380034
380264
|
}
|
|
380035
380265
|
if (phase === "select-project") {
|
|
380266
|
+
if (options.hostedProject !== null && options.hostedProject !== void 0) {
|
|
380267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Spinner, { label: "\u{1FA81} Selecting your Intelligence project\u2026" });
|
|
380268
|
+
}
|
|
380036
380269
|
const auth2 = authStore.get();
|
|
380037
380270
|
if (auth2 === null) {
|
|
380038
380271
|
return null;
|
|
@@ -380040,14 +380273,7 @@ function ScaffoldProgress({
|
|
|
380040
380273
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
380041
380274
|
HostedProjectSelect,
|
|
380042
380275
|
{
|
|
380043
|
-
apiClient:
|
|
380044
|
-
onProductCredential: (productCredential) => {
|
|
380045
|
-
authStore.save({ ...auth2, productCredential });
|
|
380046
|
-
},
|
|
380047
|
-
productBaseUrl: getAppApiUrl(),
|
|
380048
|
-
productCredential: auth2.productCredential,
|
|
380049
|
-
productOrganizationId: auth2.clerkOrgId
|
|
380050
|
-
}),
|
|
380276
|
+
apiClient: createHostedProjectApiClient(auth2),
|
|
380051
380277
|
defaultName: options.name,
|
|
380052
380278
|
telemetry: {
|
|
380053
380279
|
onPickerViewed: (projectCount) => telemetry?.onProjectPickerViewed({ projectCount }),
|
|
@@ -380163,38 +380389,17 @@ function ScaffoldProgress({
|
|
|
380163
380389
|
);
|
|
380164
380390
|
}
|
|
380165
380391
|
if (phase === "install-prompt" && scaffoldResult) {
|
|
380392
|
+
if (options.installDependencies === true) {
|
|
380393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Spinner, { label: "\u{1FA81} Installing dependencies\u2026" });
|
|
380394
|
+
}
|
|
380395
|
+
if (options.installDependencies === false) {
|
|
380396
|
+
return null;
|
|
380397
|
+
}
|
|
380166
380398
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
380167
380399
|
InstallPrompt,
|
|
380168
380400
|
{
|
|
380169
380401
|
installCommand: templateDefinition.installCommand,
|
|
380170
|
-
onAnswer: (install) =>
|
|
380171
|
-
if (!install) {
|
|
380172
|
-
finalizeSuccess(scaffoldResult);
|
|
380173
|
-
return;
|
|
380174
|
-
}
|
|
380175
|
-
setPhase("installing");
|
|
380176
|
-
scaffoldDependencies.installDependencies({
|
|
380177
|
-
cwd: scaffoldResult.projectDir,
|
|
380178
|
-
command: templateDefinition.installCommand,
|
|
380179
|
-
log: writeCliLog
|
|
380180
|
-
}).then((r2) => {
|
|
380181
|
-
if (r2.ok)
|
|
380182
|
-
return true;
|
|
380183
|
-
if (isMountedRef.current) {
|
|
380184
|
-
setInstallError(r2.stderrTail || "install failed");
|
|
380185
|
-
}
|
|
380186
|
-
return false;
|
|
380187
|
-
}).catch((e2) => {
|
|
380188
|
-
if (isMountedRef.current) {
|
|
380189
|
-
setInstallError(e2 instanceof Error ? e2.message : String(e2));
|
|
380190
|
-
}
|
|
380191
|
-
return false;
|
|
380192
|
-
}).then((installSucceeded) => {
|
|
380193
|
-
if (!isMountedRef.current)
|
|
380194
|
-
return;
|
|
380195
|
-
finalizeSuccess(scaffoldResult, installSucceeded);
|
|
380196
|
-
});
|
|
380197
|
-
}
|
|
380402
|
+
onAnswer: (install) => answerInstall(scaffoldResult, install)
|
|
380198
380403
|
}
|
|
380199
380404
|
);
|
|
380200
380405
|
}
|
|
@@ -380269,6 +380474,8 @@ function InitApp({
|
|
|
380269
380474
|
noBanner = false,
|
|
380270
380475
|
initialMock = false,
|
|
380271
380476
|
initialChannel = null,
|
|
380477
|
+
initialHostedProject = null,
|
|
380478
|
+
initialInstall = null,
|
|
380272
380479
|
renderScaffoldProgress = renderDefaultScaffoldProgress,
|
|
380273
380480
|
onIntelligenceSelected,
|
|
380274
380481
|
onFrameworkSelected,
|
|
@@ -380281,7 +380488,12 @@ function InitApp({
|
|
|
380281
380488
|
initialFramework,
|
|
380282
380489
|
mock
|
|
380283
380490
|
);
|
|
380284
|
-
const prefilled = prefilledBase === null ? null : {
|
|
380491
|
+
const prefilled = prefilledBase === null ? null : {
|
|
380492
|
+
...prefilledBase,
|
|
380493
|
+
channel: initialChannel,
|
|
380494
|
+
hostedProject: initialHostedProject,
|
|
380495
|
+
installDependencies: initialInstall
|
|
380496
|
+
};
|
|
380285
380497
|
const [options, setOptions] = (0, import_react48.useState)(prefilled);
|
|
380286
380498
|
(0, import_react48.useEffect)(() => {
|
|
380287
380499
|
if (prefilled !== null) {
|
|
@@ -380315,7 +380527,13 @@ function InitApp({
|
|
|
380315
380527
|
onFrameworkSelected,
|
|
380316
380528
|
onComplete: (resolved) => {
|
|
380317
380529
|
if (resolved !== null) {
|
|
380318
|
-
setOptions({
|
|
380530
|
+
setOptions({
|
|
380531
|
+
...resolved,
|
|
380532
|
+
mock,
|
|
380533
|
+
channel: initialChannel,
|
|
380534
|
+
hostedProject: initialHostedProject,
|
|
380535
|
+
installDependencies: initialInstall
|
|
380536
|
+
});
|
|
380319
380537
|
}
|
|
380320
380538
|
}
|
|
380321
380539
|
}
|
|
@@ -380359,6 +380577,8 @@ async function runInit(flags, callbacks) {
|
|
|
380359
380577
|
initialFramework,
|
|
380360
380578
|
initialMock: flags.mock ?? false,
|
|
380361
380579
|
initialChannel: flags.channel ?? null,
|
|
380580
|
+
initialHostedProject: flags.hostedProject ?? null,
|
|
380581
|
+
initialInstall: flags.installDependencies ?? null,
|
|
380362
380582
|
noBanner: flags.noBanner === true,
|
|
380363
380583
|
onIntelligenceSelected: callbacks?.onIntelligenceSelected,
|
|
380364
380584
|
onFrameworkSelected: callbacks?.onFrameworkSelected,
|
|
@@ -380387,6 +380607,8 @@ var init_init = __esm({
|
|
|
380387
380607
|
await init_vendor_key_prompt();
|
|
380388
380608
|
init_feature_flags();
|
|
380389
380609
|
await init_install_prompt();
|
|
380610
|
+
init_init_project_flag();
|
|
380611
|
+
init_init_non_interactive();
|
|
380390
380612
|
init_config_service();
|
|
380391
380613
|
init_event_properties();
|
|
380392
380614
|
init_cli_logs();
|
|
@@ -380449,7 +380671,8 @@ var init_init = __esm({
|
|
|
380449
380671
|
appendIntelligenceReadme,
|
|
380450
380672
|
writeHostedApiKey,
|
|
380451
380673
|
writeVendorKey,
|
|
380452
|
-
isVendorKeyPromptInteractive: vendorKeyPromptInteractive
|
|
380674
|
+
isVendorKeyPromptInteractive: vendorKeyPromptInteractive,
|
|
380675
|
+
isBrowserLoginInteractive: isBrowserLoginConfirmationInteractive
|
|
380453
380676
|
};
|
|
380454
380677
|
}
|
|
380455
380678
|
});
|
|
@@ -380965,6 +381188,56 @@ var init_onboarding_state = __esm({
|
|
|
380965
381188
|
}
|
|
380966
381189
|
});
|
|
380967
381190
|
|
|
381191
|
+
// apps/cli/src/services/onboarding-classification.ts
|
|
381192
|
+
function requireOnboardingChoice(flag, value, choices) {
|
|
381193
|
+
const selected = choices.find((choice) => choice === value);
|
|
381194
|
+
if (selected === void 0) {
|
|
381195
|
+
throw new Error(`${flag} must be one of: ${choices.join(", ")}.`);
|
|
381196
|
+
}
|
|
381197
|
+
return selected;
|
|
381198
|
+
}
|
|
381199
|
+
var ONBOARDING_STARTING_STATES, ONBOARDING_AGENT_FRAMEWORKS, ONBOARDING_FRONTENDS;
|
|
381200
|
+
var init_onboarding_classification = __esm({
|
|
381201
|
+
"apps/cli/src/services/onboarding-classification.ts"() {
|
|
381202
|
+
"use strict";
|
|
381203
|
+
ONBOARDING_STARTING_STATES = [
|
|
381204
|
+
"empty",
|
|
381205
|
+
"agent-only",
|
|
381206
|
+
"frontend-only",
|
|
381207
|
+
"both",
|
|
381208
|
+
"both-oss"
|
|
381209
|
+
];
|
|
381210
|
+
ONBOARDING_AGENT_FRAMEWORKS = [
|
|
381211
|
+
"ag2",
|
|
381212
|
+
"agno",
|
|
381213
|
+
"built-in",
|
|
381214
|
+
"claude-sdk-python",
|
|
381215
|
+
"claude-sdk-typescript",
|
|
381216
|
+
"crewai-flows",
|
|
381217
|
+
"deep-agents",
|
|
381218
|
+
"google-adk",
|
|
381219
|
+
"langgraph-fastapi",
|
|
381220
|
+
"langgraph-python",
|
|
381221
|
+
"langgraph-typescript",
|
|
381222
|
+
"llamaindex",
|
|
381223
|
+
"mastra",
|
|
381224
|
+
"ms-agent-dotnet",
|
|
381225
|
+
"ms-agent-harness-dotnet",
|
|
381226
|
+
"ms-agent-python",
|
|
381227
|
+
"pydantic-ai",
|
|
381228
|
+
"strands-python",
|
|
381229
|
+
"strands-typescript"
|
|
381230
|
+
];
|
|
381231
|
+
ONBOARDING_FRONTENDS = [
|
|
381232
|
+
"react-spa",
|
|
381233
|
+
"nextjs",
|
|
381234
|
+
"angular",
|
|
381235
|
+
"vue",
|
|
381236
|
+
"react-native"
|
|
381237
|
+
];
|
|
381238
|
+
}
|
|
381239
|
+
});
|
|
381240
|
+
|
|
380968
381241
|
// apps/cli/src/commands/onboard.ts
|
|
380969
381242
|
var onboard_exports = {};
|
|
380970
381243
|
__export(onboard_exports, {
|
|
@@ -381024,25 +381297,61 @@ async function runOnboard(argv, dependencies) {
|
|
|
381024
381297
|
return;
|
|
381025
381298
|
}
|
|
381026
381299
|
if (subcommand === "complete") {
|
|
381027
|
-
const
|
|
381028
|
-
if (
|
|
381029
|
-
throw new Error(
|
|
381030
|
-
"Usage: copilotkit onboard complete --visual-check <performed|skipped-no-browser-tool|failed>"
|
|
381031
|
-
);
|
|
381032
|
-
}
|
|
381300
|
+
const check4 = parseSurfaceCheck(argv.slice(1));
|
|
381301
|
+
if (check4 === void 0)
|
|
381302
|
+
throw new Error(SURFACE_CHECK_USAGE);
|
|
381033
381303
|
recordBestEffort(deps, {
|
|
381034
381304
|
event: "cli.onboarding.completed",
|
|
381035
381305
|
properties: {
|
|
381036
381306
|
command: "onboard",
|
|
381037
381307
|
onboarding_run_id: binding.runId,
|
|
381038
381308
|
cli_version: deps.cliVersion,
|
|
381039
|
-
visual_check:
|
|
381309
|
+
...check4.kind === "visual" ? { visual_check: check4.outcome } : { device_check: check4.outcome }
|
|
381040
381310
|
}
|
|
381041
381311
|
});
|
|
381042
|
-
deps.stdout.write(
|
|
381043
|
-
|
|
381044
|
-
|
|
381045
|
-
|
|
381312
|
+
deps.stdout.write(
|
|
381313
|
+
check4.outcome === "performed" ? "CopilotKit onboarding marked complete.\n" : blockedWithoutSurfaceProof(check4)
|
|
381314
|
+
);
|
|
381315
|
+
return;
|
|
381316
|
+
}
|
|
381317
|
+
if (subcommand === "classify") {
|
|
381318
|
+
const parsed = parseArgs2({
|
|
381319
|
+
args: [...argv.slice(1)],
|
|
381320
|
+
allowPositionals: false,
|
|
381321
|
+
options: {
|
|
381322
|
+
"starting-state": { type: "string" },
|
|
381323
|
+
"agent-framework": { type: "string" },
|
|
381324
|
+
frontend: { type: "string" }
|
|
381325
|
+
},
|
|
381326
|
+
strict: true
|
|
381327
|
+
});
|
|
381328
|
+
const startingState = requireOnboardingChoice(
|
|
381329
|
+
"--starting-state",
|
|
381330
|
+
parsed.values["starting-state"],
|
|
381331
|
+
ONBOARDING_STARTING_STATES
|
|
381332
|
+
);
|
|
381333
|
+
const agentFramework = requireOnboardingChoice(
|
|
381334
|
+
"--agent-framework",
|
|
381335
|
+
parsed.values["agent-framework"],
|
|
381336
|
+
ONBOARDING_AGENT_FRAMEWORKS
|
|
381337
|
+
);
|
|
381338
|
+
const frontend = requireOnboardingChoice(
|
|
381339
|
+
"--frontend",
|
|
381340
|
+
parsed.values.frontend,
|
|
381341
|
+
ONBOARDING_FRONTENDS
|
|
381342
|
+
);
|
|
381343
|
+
recordBestEffort(deps, {
|
|
381344
|
+
event: "cli.onboarding.classified",
|
|
381345
|
+
properties: {
|
|
381346
|
+
command: "onboard",
|
|
381347
|
+
onboarding_run_id: binding.runId,
|
|
381348
|
+
cli_version: deps.cliVersion,
|
|
381349
|
+
starting_state: startingState,
|
|
381350
|
+
agent_framework: agentFramework,
|
|
381351
|
+
frontend
|
|
381352
|
+
}
|
|
381353
|
+
});
|
|
381354
|
+
deps.stdout.write("Onboarding path included in telemetry when enabled.\n");
|
|
381046
381355
|
return;
|
|
381047
381356
|
}
|
|
381048
381357
|
if (subcommand === "feedback") {
|
|
@@ -381057,28 +381366,66 @@ async function runOnboard(argv, dependencies) {
|
|
|
381057
381366
|
return;
|
|
381058
381367
|
}
|
|
381059
381368
|
throw new Error(
|
|
381060
|
-
"Usage: copilotkit onboard <start|read|complete|feedback|friction>"
|
|
381369
|
+
"Usage: copilotkit onboard <start|read|classify|complete|feedback|friction>"
|
|
381061
381370
|
);
|
|
381062
381371
|
}
|
|
381063
|
-
function
|
|
381064
|
-
if (rest.length !== 2
|
|
381372
|
+
function parseSurfaceCheck(rest) {
|
|
381373
|
+
if (rest.length !== 2)
|
|
381065
381374
|
return void 0;
|
|
381066
|
-
const value = rest
|
|
381067
|
-
|
|
381375
|
+
const [flag, value] = rest;
|
|
381376
|
+
if (flag === "--visual-check") {
|
|
381377
|
+
const outcome = VISUAL_CHECK_OUTCOMES.find((known) => known === value);
|
|
381378
|
+
return outcome === void 0 ? void 0 : { kind: "visual", outcome };
|
|
381379
|
+
}
|
|
381380
|
+
if (flag === "--device-check") {
|
|
381381
|
+
const outcome = DEVICE_CHECK_OUTCOMES.find((known) => known === value);
|
|
381382
|
+
return outcome === void 0 ? void 0 : { kind: "device", outcome };
|
|
381383
|
+
}
|
|
381384
|
+
return void 0;
|
|
381068
381385
|
}
|
|
381069
|
-
function
|
|
381070
|
-
const
|
|
381386
|
+
function blockedWithoutSurfaceProof(check4) {
|
|
381387
|
+
const failed2 = check4.outcome === "failed";
|
|
381388
|
+
const visual = {
|
|
381389
|
+
headline: [
|
|
381390
|
+
" The live UI check was NOT performed:",
|
|
381391
|
+
failed2 ? " it did not succeed." : " no browser automation was available, so nothing drove the real frontend."
|
|
381392
|
+
],
|
|
381393
|
+
uncovered: [
|
|
381394
|
+
"realtime delivery to a browser over the gateway",
|
|
381395
|
+
"browser-origin CORS and CSP, which a CLI request never exercises",
|
|
381396
|
+
"the frontend provider being wired to this runtime",
|
|
381397
|
+
"generative UI actually rendering a component"
|
|
381398
|
+
],
|
|
381399
|
+
reach: "which reaches no browser",
|
|
381400
|
+
close: "configure a browser MCP server for your coding agent and drive\n the app once by hand, then run this command again with\n `--visual-check performed`"
|
|
381401
|
+
};
|
|
381402
|
+
const device = {
|
|
381403
|
+
headline: [
|
|
381404
|
+
" The on-device check was NOT performed:",
|
|
381405
|
+
failed2 ? " it did not succeed." : " no device or emulator was available, so nothing ran the real app."
|
|
381406
|
+
],
|
|
381407
|
+
uncovered: [
|
|
381408
|
+
"the app rendering at all on a real screen",
|
|
381409
|
+
"a tool-rendered component painted in the view tree",
|
|
381410
|
+
"an unresolved redbox, which no terminal output shows",
|
|
381411
|
+
"realtime delivery to the app over the gateway"
|
|
381412
|
+
],
|
|
381413
|
+
reach: "which reaches no screen",
|
|
381414
|
+
close: "run the app on a device or emulator and capture the terminal state --\n `adb exec-out screencap -p` on Android -- then run this command again\n with `--device-check performed`"
|
|
381415
|
+
};
|
|
381416
|
+
const surface = check4.kind === "visual" ? visual : device;
|
|
381071
381417
|
return [
|
|
381072
381418
|
"",
|
|
381073
|
-
|
|
381074
|
-
|
|
381075
|
-
|
|
381076
|
-
"
|
|
381077
|
-
|
|
381078
|
-
"
|
|
381079
|
-
"
|
|
381080
|
-
"
|
|
381081
|
-
"
|
|
381419
|
+
"! Onboarding is NOT complete.",
|
|
381420
|
+
...surface.headline,
|
|
381421
|
+
` The agent round trip is what \`copilotkit verify --round-trip\` proves, ${surface.reach}.`,
|
|
381422
|
+
" Not covered by it, and still unverified here:",
|
|
381423
|
+
...surface.uncovered.map((line) => ` - ${line}`),
|
|
381424
|
+
"",
|
|
381425
|
+
" Report this run as blocked, and name the unverified lines above as the",
|
|
381426
|
+
" evidence it is missing. Do not report it as complete: every other check in",
|
|
381427
|
+
" this graph can pass while all four of those fail.",
|
|
381428
|
+
` To close it, ${surface.close}.`,
|
|
381082
381429
|
""
|
|
381083
381430
|
].join("\n");
|
|
381084
381431
|
}
|
|
@@ -381232,7 +381579,7 @@ function recordBestEffort(dependencies, event) {
|
|
|
381232
381579
|
} catch {
|
|
381233
381580
|
}
|
|
381234
381581
|
}
|
|
381235
|
-
var VISUAL_CHECK_OUTCOMES;
|
|
381582
|
+
var VISUAL_CHECK_OUTCOMES, DEVICE_CHECK_OUTCOMES, SURFACE_CHECK_USAGE;
|
|
381236
381583
|
var init_onboard = __esm({
|
|
381237
381584
|
async "apps/cli/src/commands/onboard.ts"() {
|
|
381238
381585
|
"use strict";
|
|
@@ -381242,12 +381589,19 @@ var init_onboard = __esm({
|
|
|
381242
381589
|
init_onboarding_friction();
|
|
381243
381590
|
init_onboarding_feedback();
|
|
381244
381591
|
init_onboarding_state();
|
|
381592
|
+
init_onboarding_classification();
|
|
381245
381593
|
await init_telemetry();
|
|
381246
381594
|
VISUAL_CHECK_OUTCOMES = [
|
|
381247
381595
|
"performed",
|
|
381248
381596
|
"skipped-no-browser-tool",
|
|
381249
381597
|
"failed"
|
|
381250
381598
|
];
|
|
381599
|
+
DEVICE_CHECK_OUTCOMES = [
|
|
381600
|
+
"performed",
|
|
381601
|
+
"skipped-no-device",
|
|
381602
|
+
"failed"
|
|
381603
|
+
];
|
|
381604
|
+
SURFACE_CHECK_USAGE = "Usage: copilotkit onboard complete --visual-check <performed|skipped-no-browser-tool|failed>\n or: copilotkit onboard complete --device-check <performed|skipped-no-device|failed>\nPass exactly one. A web journey is proven in a browser and a mobile one on a device;\nwhich flag you pass is how this run states which surface it proved.";
|
|
381251
381605
|
}
|
|
381252
381606
|
});
|
|
381253
381607
|
|
|
@@ -384427,6 +384781,7 @@ Options:
|
|
|
384427
384781
|
`,
|
|
384428
384782
|
onboard: `Usage: copilotkit onboard start [--run <id>] [--coding-agent <slug>]
|
|
384429
384783
|
copilotkit onboard read <prompt-name>
|
|
384784
|
+
copilotkit onboard classify --starting-state <state> --agent-framework <framework> --frontend <frontend>
|
|
384430
384785
|
copilotkit onboard complete
|
|
384431
384786
|
copilotkit onboard feedback
|
|
384432
384787
|
copilotkit onboard friction --category <slug> --cost-seconds <seconds>
|
|
@@ -384436,6 +384791,7 @@ Guide a coding agent through the Markdown graph bundled with this exact CLI.
|
|
|
384436
384791
|
Subcommands:
|
|
384437
384792
|
start Start or replace the repository-bound onboarding run
|
|
384438
384793
|
read Print one rendered prompt as the only stdout payload
|
|
384794
|
+
classify Send the bounded matrix path for this run
|
|
384439
384795
|
complete Mark a proven onboarding run complete
|
|
384440
384796
|
feedback Read one non-empty message from standard input
|
|
384441
384797
|
friction Report one papercut that slowed a run down
|
|
@@ -384552,9 +384908,28 @@ ${isCliFlagEnabled("cli.aimock-mock-mode") ? ` --mock Run keyle
|
|
|
384552
384908
|
provider will ask you for. A named provider is set up as
|
|
384553
384909
|
far as it can go without credentials, then reports what
|
|
384554
384910
|
is left -- it never prompts for a secret.
|
|
384911
|
+
--project <ref> Select an existing hosted Intelligence project by slug
|
|
384912
|
+
or id, instead of showing the picker
|
|
384913
|
+
--create <name> Create a hosted Intelligence project with this name and
|
|
384914
|
+
select it
|
|
384915
|
+
-y, --yes Install dependencies without asking
|
|
384916
|
+
--install Install dependencies without asking (same as --yes)
|
|
384917
|
+
--no-install Skip the install without asking
|
|
384555
384918
|
--no-banner Suppress the CopilotKit welcome banner (used when a
|
|
384556
384919
|
parent tool, e.g. create-ag-ui-app, shows its own)
|
|
384557
384920
|
-h, --help Show help for init
|
|
384921
|
+
|
|
384922
|
+
Pass --project or --create, never both. They resolve the same way
|
|
384923
|
+
\`copilotkit project select\` does: a typo fails with the real slugs rather than
|
|
384924
|
+
creating something you did not ask for.
|
|
384925
|
+
|
|
384926
|
+
init prompts for anything you do not name, so a shell with no terminal needs the
|
|
384927
|
+
answers up front: -n, -f, -y, and --project or --create. It then refuses only the
|
|
384928
|
+
ones still missing, and names them.
|
|
384929
|
+
|
|
384930
|
+
Signing in is the one answer no flag supplies: it opens a browser and finishes
|
|
384931
|
+
back at the terminal. Run \`copilotkit login\` first, or a run with no terminal is
|
|
384932
|
+
refused rather than opening a browser it cannot finish with.
|
|
384558
384933
|
`,
|
|
384559
384934
|
license: `Usage: copilotkit license [create]
|
|
384560
384935
|
copilotkit license list [options]
|
|
@@ -385735,6 +386110,11 @@ var INIT_PARSE_OPTIONS = {
|
|
|
385735
386110
|
framework: { type: "string", short: "f" },
|
|
385736
386111
|
mock: { type: "boolean" },
|
|
385737
386112
|
channel: { type: "string" },
|
|
386113
|
+
project: { type: "string" },
|
|
386114
|
+
create: { type: "string" },
|
|
386115
|
+
yes: { type: "boolean", short: "y" },
|
|
386116
|
+
install: { type: "boolean" },
|
|
386117
|
+
"no-install": { type: "boolean" },
|
|
385738
386118
|
"no-banner": { type: "boolean" }
|
|
385739
386119
|
};
|
|
385740
386120
|
async function runInitCommand(invokedAs, argv) {
|
|
@@ -385775,17 +386155,22 @@ async function runInitCommand(invokedAs, argv) {
|
|
|
385775
386155
|
await exitWithFlush(1);
|
|
385776
386156
|
return;
|
|
385777
386157
|
}
|
|
385778
|
-
|
|
386158
|
+
const { resolveInitProjectFlag: resolveInitProjectFlag2 } = await Promise.resolve().then(() => (init_init_project_flag(), init_project_flag_exports));
|
|
386159
|
+
const projectResolution = resolveInitProjectFlag2({
|
|
386160
|
+
project: parsed.values["project"],
|
|
386161
|
+
create: parsed.values["create"],
|
|
386162
|
+
framework: frameworkFlag
|
|
386163
|
+
});
|
|
386164
|
+
if (projectResolution.status === "invalid") {
|
|
385779
386165
|
recordTelemetryEvent({
|
|
385780
386166
|
properties: {
|
|
385781
386167
|
...telemetryBase,
|
|
385782
386168
|
outcome: "failed",
|
|
385783
|
-
error_code: "
|
|
386169
|
+
error_code: "validation"
|
|
385784
386170
|
}
|
|
385785
386171
|
});
|
|
385786
|
-
process.stderr.write(
|
|
385787
|
-
|
|
385788
|
-
);
|
|
386172
|
+
process.stderr.write(`Error: ${projectResolution.message}
|
|
386173
|
+
`);
|
|
385789
386174
|
await exitWithFlush(1);
|
|
385790
386175
|
return;
|
|
385791
386176
|
}
|
|
@@ -385817,12 +386202,74 @@ async function runInitCommand(invokedAs, argv) {
|
|
|
385817
386202
|
await exitWithFlush(1);
|
|
385818
386203
|
return;
|
|
385819
386204
|
}
|
|
386205
|
+
const {
|
|
386206
|
+
formatNonInteractiveInitRefusal: formatNonInteractiveInitRefusal2,
|
|
386207
|
+
missingNonInteractiveInitFlags: missingNonInteractiveInitFlags2,
|
|
386208
|
+
resolveInitInstallFlag: resolveInitInstallFlag2,
|
|
386209
|
+
NON_INTERACTIVE_LOGIN_MESSAGE: NON_INTERACTIVE_LOGIN_MESSAGE2
|
|
386210
|
+
} = await Promise.resolve().then(() => (init_init_non_interactive(), init_non_interactive_exports));
|
|
386211
|
+
const installResolution = resolveInitInstallFlag2({
|
|
386212
|
+
yes: parsed.values["yes"],
|
|
386213
|
+
install: parsed.values["install"],
|
|
386214
|
+
noInstall: parsed.values["no-install"]
|
|
386215
|
+
});
|
|
386216
|
+
if (installResolution.status === "invalid") {
|
|
386217
|
+
recordTelemetryEvent({
|
|
386218
|
+
properties: {
|
|
386219
|
+
...telemetryBase,
|
|
386220
|
+
outcome: "failed",
|
|
386221
|
+
error_code: "validation"
|
|
386222
|
+
}
|
|
386223
|
+
});
|
|
386224
|
+
process.stderr.write(`Error: ${installResolution.message}
|
|
386225
|
+
`);
|
|
386226
|
+
await exitWithFlush(1);
|
|
386227
|
+
return;
|
|
386228
|
+
}
|
|
386229
|
+
if (!process.stdin.isTTY) {
|
|
386230
|
+
const missing = missingNonInteractiveInitFlags2({
|
|
386231
|
+
name: parsed.values["name"],
|
|
386232
|
+
framework: frameworkFlag,
|
|
386233
|
+
hostedProjectNamed: projectResolution.request !== null,
|
|
386234
|
+
installAnswered: installResolution.install !== null
|
|
386235
|
+
});
|
|
386236
|
+
if (missing.length > 0) {
|
|
386237
|
+
recordTelemetryEvent({
|
|
386238
|
+
properties: {
|
|
386239
|
+
...telemetryBase,
|
|
386240
|
+
outcome: "failed",
|
|
386241
|
+
error_code: "non_interactive"
|
|
386242
|
+
}
|
|
386243
|
+
});
|
|
386244
|
+
process.stderr.write(
|
|
386245
|
+
`Error: ${formatNonInteractiveInitRefusal2(missing)}`
|
|
386246
|
+
);
|
|
386247
|
+
await exitWithFlush(1);
|
|
386248
|
+
return;
|
|
386249
|
+
}
|
|
386250
|
+
const { authStore: authStore2 } = await Promise.resolve().then(() => (init_config_service(), config_service_exports));
|
|
386251
|
+
if (authStore2.get() === null) {
|
|
386252
|
+
recordTelemetryEvent({
|
|
386253
|
+
properties: {
|
|
386254
|
+
...telemetryBase,
|
|
386255
|
+
outcome: "failed",
|
|
386256
|
+
error_code: "non_interactive"
|
|
386257
|
+
}
|
|
386258
|
+
});
|
|
386259
|
+
process.stderr.write(`Error: ${NON_INTERACTIVE_LOGIN_MESSAGE2}
|
|
386260
|
+
`);
|
|
386261
|
+
await exitWithFlush(1);
|
|
386262
|
+
return;
|
|
386263
|
+
}
|
|
386264
|
+
}
|
|
385820
386265
|
const flags = {
|
|
385821
386266
|
name: parsed.values["name"],
|
|
385822
386267
|
intelligence,
|
|
385823
386268
|
framework,
|
|
385824
386269
|
mock,
|
|
385825
386270
|
channel: channelResolution.channel,
|
|
386271
|
+
hostedProject: projectResolution.request,
|
|
386272
|
+
installDependencies: installResolution.install,
|
|
385826
386273
|
noBanner: parsed.values["no-banner"]
|
|
385827
386274
|
};
|
|
385828
386275
|
await withTelemetry(telemetryBase, async (ctx) => {
|