copilotkit 2.0.1 → 2.0.3
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/index.js +324 -364
- package/package.json +1 -1
- package/src/commands/init.d.ts.map +1 -1
- package/src/services/api-client.d.ts +0 -7
- package/src/services/api-client.d.ts.map +1 -1
- package/src/services/auth.service.d.ts +36 -2
- package/src/services/auth.service.d.ts.map +1 -1
- package/src/ui/browser-login.d.ts +5 -1
- package/src/ui/browser-login.d.ts.map +1 -1
- package/src/ui/init-flow.d.ts +2 -9
- package/src/ui/init-flow.d.ts.map +1 -1
- package/src/services/feature-flags.d.ts +0 -14
- package/src/services/feature-flags.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -63,9 +63,9 @@ function setOpsFrontendUrl(url2) {
|
|
|
63
63
|
}
|
|
64
64
|
function getBuildInfo() {
|
|
65
65
|
return {
|
|
66
|
-
version: "2.0.
|
|
67
|
-
buildNumber: "
|
|
68
|
-
commitSha: "
|
|
66
|
+
version: "2.0.3",
|
|
67
|
+
buildNumber: "25387853955",
|
|
68
|
+
commitSha: "6a568f521454b79698cc96223bf7bc7a6bb0c819"
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
var opsApiUrlOverride, opsFrontendUrlOverride;
|
|
@@ -15961,15 +15961,6 @@ function createApiClient(baseUrl, token) {
|
|
|
15961
15961
|
throw await readApiError(res);
|
|
15962
15962
|
}
|
|
15963
15963
|
return res.json();
|
|
15964
|
-
},
|
|
15965
|
-
async requestThreadsAccess() {
|
|
15966
|
-
await fetch(`${baseUrl}/api/cli/threads-interest`, {
|
|
15967
|
-
method: "POST",
|
|
15968
|
-
headers: {
|
|
15969
|
-
"Content-Type": "application/json",
|
|
15970
|
-
Authorization: `Bearer ${token}`
|
|
15971
|
-
}
|
|
15972
|
-
});
|
|
15973
15964
|
}
|
|
15974
15965
|
};
|
|
15975
15966
|
}
|
|
@@ -16850,6 +16841,7 @@ __export(auth_service_exports, {
|
|
|
16850
16841
|
isTerminalSessionInvalidationError: () => isTerminalSessionInvalidationError,
|
|
16851
16842
|
login: () => login,
|
|
16852
16843
|
logout: () => logout,
|
|
16844
|
+
raceForClerkToken: () => raceForClerkToken,
|
|
16853
16845
|
startCallbackServer: () => startCallbackServer,
|
|
16854
16846
|
verifyAndRefresh: () => verifyAndRefresh
|
|
16855
16847
|
});
|
|
@@ -16986,7 +16978,26 @@ function startCallbackServer(expectedState) {
|
|
|
16986
16978
|
});
|
|
16987
16979
|
});
|
|
16988
16980
|
}
|
|
16989
|
-
async function
|
|
16981
|
+
async function raceForClerkToken(resultPromise, manualClerkToken) {
|
|
16982
|
+
const callbackBranch = resultPromise.then((result) => ({
|
|
16983
|
+
clerkToken: result.clerkToken,
|
|
16984
|
+
source: "callback"
|
|
16985
|
+
}));
|
|
16986
|
+
if (!manualClerkToken) {
|
|
16987
|
+
return await callbackBranch;
|
|
16988
|
+
}
|
|
16989
|
+
const manualBranch = manualClerkToken.then((clerkToken) => ({
|
|
16990
|
+
clerkToken,
|
|
16991
|
+
source: "manual"
|
|
16992
|
+
}));
|
|
16993
|
+
const swallow = (promise2) => {
|
|
16994
|
+
promise2.catch(() => void 0);
|
|
16995
|
+
};
|
|
16996
|
+
swallow(callbackBranch);
|
|
16997
|
+
swallow(manualBranch);
|
|
16998
|
+
return await Promise.race([callbackBranch, manualBranch]);
|
|
16999
|
+
}
|
|
17000
|
+
async function login(options = {}) {
|
|
16990
17001
|
const state = crypto2.randomBytes(16).toString("hex");
|
|
16991
17002
|
const diagnostics = createCliAuthDiagnostics(state);
|
|
16992
17003
|
diagnostics.logPhase("login.start", {
|
|
@@ -16995,6 +17006,7 @@ async function login() {
|
|
|
16995
17006
|
state: summarizeState(state)
|
|
16996
17007
|
});
|
|
16997
17008
|
const { port, resultPromise, server } = await startCallbackServer(state);
|
|
17009
|
+
let tokenSource = null;
|
|
16998
17010
|
try {
|
|
16999
17011
|
const callbackUrl = `http://127.0.0.1:${port}/callback`;
|
|
17000
17012
|
const loginParams = new URLSearchParams({
|
|
@@ -17026,9 +17038,14 @@ async function login() {
|
|
|
17026
17038
|
);
|
|
17027
17039
|
}
|
|
17028
17040
|
diagnostics.logPhase("login.waiting-for-callback");
|
|
17029
|
-
const { clerkToken } = await
|
|
17041
|
+
const { clerkToken, source } = await raceForClerkToken(
|
|
17042
|
+
resultPromise,
|
|
17043
|
+
options.manualClerkToken
|
|
17044
|
+
);
|
|
17045
|
+
tokenSource = source;
|
|
17030
17046
|
diagnostics.logPhase("login.callback-complete", {
|
|
17031
|
-
clerkTokenReceived: true
|
|
17047
|
+
clerkTokenReceived: true,
|
|
17048
|
+
tokenSource: source
|
|
17032
17049
|
});
|
|
17033
17050
|
const apiClient = createApiClient(getOpsApiUrl());
|
|
17034
17051
|
let authPayload;
|
|
@@ -17076,15 +17093,27 @@ async function login() {
|
|
|
17076
17093
|
email: authPayload.user.email,
|
|
17077
17094
|
organizationId: authPayload.organization.clerkOrgId
|
|
17078
17095
|
});
|
|
17079
|
-
return {
|
|
17096
|
+
return {
|
|
17097
|
+
user: authPayload.user,
|
|
17098
|
+
organization: authPayload.organization,
|
|
17099
|
+
source
|
|
17100
|
+
};
|
|
17080
17101
|
} catch (error48) {
|
|
17081
17102
|
diagnostics.logError("login.failed", error48);
|
|
17082
17103
|
throw error48;
|
|
17083
17104
|
} finally {
|
|
17084
17105
|
diagnostics.logPhase("login.cleanup-start");
|
|
17085
|
-
|
|
17086
|
-
|
|
17087
|
-
|
|
17106
|
+
if (tokenSource === "manual") {
|
|
17107
|
+
setTimeout(() => {
|
|
17108
|
+
server.close();
|
|
17109
|
+
server.closeAllConnections();
|
|
17110
|
+
diagnostics.logPhase("login.cleanup-complete", { deferred: true });
|
|
17111
|
+
}, MANUAL_PASTE_SERVER_LINGER_MS);
|
|
17112
|
+
} else {
|
|
17113
|
+
server.close();
|
|
17114
|
+
server.closeAllConnections();
|
|
17115
|
+
diagnostics.logPhase("login.cleanup-complete", { deferred: false });
|
|
17116
|
+
}
|
|
17088
17117
|
}
|
|
17089
17118
|
}
|
|
17090
17119
|
function isTerminalSessionInvalidationError(error48) {
|
|
@@ -17134,7 +17163,7 @@ async function logout() {
|
|
|
17134
17163
|
}
|
|
17135
17164
|
authStore.clear();
|
|
17136
17165
|
}
|
|
17137
|
-
var TERMINAL_SESSION_INVALID_MESSAGE;
|
|
17166
|
+
var MANUAL_PASTE_SERVER_LINGER_MS, TERMINAL_SESSION_INVALID_MESSAGE;
|
|
17138
17167
|
var init_auth_service = __esm({
|
|
17139
17168
|
"apps/cli/src/services/auth.service.ts"() {
|
|
17140
17169
|
"use strict";
|
|
@@ -17142,6 +17171,7 @@ var init_auth_service = __esm({
|
|
|
17142
17171
|
init_api_client();
|
|
17143
17172
|
init_cli_auth_diagnostics();
|
|
17144
17173
|
init_config();
|
|
17174
|
+
MANUAL_PASTE_SERVER_LINGER_MS = 6e3;
|
|
17145
17175
|
TERMINAL_SESSION_INVALID_MESSAGE = "Existing CLI sessions are invalid after the Clerk cutover. Please log in again.";
|
|
17146
17176
|
}
|
|
17147
17177
|
});
|
|
@@ -50341,7 +50371,7 @@ var require_backend = __commonJS({
|
|
|
50341
50371
|
}
|
|
50342
50372
|
throw Error("An unsupported type was passed to use(): " + String(usable));
|
|
50343
50373
|
},
|
|
50344
|
-
useCallback: function
|
|
50374
|
+
useCallback: function useCallback5(callback) {
|
|
50345
50375
|
var hook = nextHook();
|
|
50346
50376
|
hookLog.push({
|
|
50347
50377
|
displayName: null,
|
|
@@ -71934,6 +71964,104 @@ var init_build2 = __esm({
|
|
|
71934
71964
|
}
|
|
71935
71965
|
});
|
|
71936
71966
|
|
|
71967
|
+
// node_modules/.pnpm/ink-text-input@6.0.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-text-input/build/index.js
|
|
71968
|
+
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
71969
|
+
const [state, setState] = (0, import_react29.useState)({
|
|
71970
|
+
cursorOffset: (originalValue || "").length,
|
|
71971
|
+
cursorWidth: 0
|
|
71972
|
+
});
|
|
71973
|
+
const { cursorOffset, cursorWidth } = state;
|
|
71974
|
+
(0, import_react29.useEffect)(() => {
|
|
71975
|
+
setState((previousState) => {
|
|
71976
|
+
if (!focus || !showCursor) {
|
|
71977
|
+
return previousState;
|
|
71978
|
+
}
|
|
71979
|
+
const newValue = originalValue || "";
|
|
71980
|
+
if (previousState.cursorOffset > newValue.length - 1) {
|
|
71981
|
+
return {
|
|
71982
|
+
cursorOffset: newValue.length,
|
|
71983
|
+
cursorWidth: 0
|
|
71984
|
+
};
|
|
71985
|
+
}
|
|
71986
|
+
return previousState;
|
|
71987
|
+
});
|
|
71988
|
+
}, [originalValue, focus, showCursor]);
|
|
71989
|
+
const cursorActualWidth = highlightPastedText ? cursorWidth : 0;
|
|
71990
|
+
const value = mask ? mask.repeat(originalValue.length) : originalValue;
|
|
71991
|
+
let renderedValue = value;
|
|
71992
|
+
let renderedPlaceholder = placeholder ? source_default.grey(placeholder) : void 0;
|
|
71993
|
+
if (showCursor && focus) {
|
|
71994
|
+
renderedPlaceholder = placeholder.length > 0 ? source_default.inverse(placeholder[0]) + source_default.grey(placeholder.slice(1)) : source_default.inverse(" ");
|
|
71995
|
+
renderedValue = value.length > 0 ? "" : source_default.inverse(" ");
|
|
71996
|
+
let i = 0;
|
|
71997
|
+
for (const char of value) {
|
|
71998
|
+
renderedValue += i >= cursorOffset - cursorActualWidth && i <= cursorOffset ? source_default.inverse(char) : char;
|
|
71999
|
+
i++;
|
|
72000
|
+
}
|
|
72001
|
+
if (value.length > 0 && cursorOffset === value.length) {
|
|
72002
|
+
renderedValue += source_default.inverse(" ");
|
|
72003
|
+
}
|
|
72004
|
+
}
|
|
72005
|
+
use_input_default((input, key) => {
|
|
72006
|
+
if (key.upArrow || key.downArrow || key.ctrl && input === "c" || key.tab || key.shift && key.tab) {
|
|
72007
|
+
return;
|
|
72008
|
+
}
|
|
72009
|
+
if (key.return) {
|
|
72010
|
+
if (onSubmit) {
|
|
72011
|
+
onSubmit(originalValue);
|
|
72012
|
+
}
|
|
72013
|
+
return;
|
|
72014
|
+
}
|
|
72015
|
+
let nextCursorOffset = cursorOffset;
|
|
72016
|
+
let nextValue = originalValue;
|
|
72017
|
+
let nextCursorWidth = 0;
|
|
72018
|
+
if (key.leftArrow) {
|
|
72019
|
+
if (showCursor) {
|
|
72020
|
+
nextCursorOffset--;
|
|
72021
|
+
}
|
|
72022
|
+
} else if (key.rightArrow) {
|
|
72023
|
+
if (showCursor) {
|
|
72024
|
+
nextCursorOffset++;
|
|
72025
|
+
}
|
|
72026
|
+
} else if (key.backspace || key.delete) {
|
|
72027
|
+
if (cursorOffset > 0) {
|
|
72028
|
+
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
|
72029
|
+
nextCursorOffset--;
|
|
72030
|
+
}
|
|
72031
|
+
} else {
|
|
72032
|
+
nextValue = originalValue.slice(0, cursorOffset) + input + originalValue.slice(cursorOffset, originalValue.length);
|
|
72033
|
+
nextCursorOffset += input.length;
|
|
72034
|
+
if (input.length > 1) {
|
|
72035
|
+
nextCursorWidth = input.length;
|
|
72036
|
+
}
|
|
72037
|
+
}
|
|
72038
|
+
if (cursorOffset < 0) {
|
|
72039
|
+
nextCursorOffset = 0;
|
|
72040
|
+
}
|
|
72041
|
+
if (cursorOffset > originalValue.length) {
|
|
72042
|
+
nextCursorOffset = originalValue.length;
|
|
72043
|
+
}
|
|
72044
|
+
setState({
|
|
72045
|
+
cursorOffset: nextCursorOffset,
|
|
72046
|
+
cursorWidth: nextCursorWidth
|
|
72047
|
+
});
|
|
72048
|
+
if (nextValue !== originalValue) {
|
|
72049
|
+
onChange(nextValue);
|
|
72050
|
+
}
|
|
72051
|
+
}, { isActive: focus });
|
|
72052
|
+
return import_react29.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
72053
|
+
}
|
|
72054
|
+
var import_react29, build_default;
|
|
72055
|
+
var init_build3 = __esm({
|
|
72056
|
+
async "node_modules/.pnpm/ink-text-input@6.0.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-text-input/build/index.js"() {
|
|
72057
|
+
"use strict";
|
|
72058
|
+
import_react29 = __toESM(require_react(), 1);
|
|
72059
|
+
await init_build2();
|
|
72060
|
+
init_source2();
|
|
72061
|
+
build_default = TextInput;
|
|
72062
|
+
}
|
|
72063
|
+
});
|
|
72064
|
+
|
|
71937
72065
|
// node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
71938
72066
|
var require_react_jsx_runtime_production = __commonJS({
|
|
71939
72067
|
"node_modules/.pnpm/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
|
|
@@ -72242,8 +72370,8 @@ var require_jsx_runtime = __commonJS({
|
|
|
72242
72370
|
|
|
72243
72371
|
// apps/cli/src/ui/spinner.tsx
|
|
72244
72372
|
function Spinner({ label }) {
|
|
72245
|
-
const [frame, setFrame] = (0,
|
|
72246
|
-
(0,
|
|
72373
|
+
const [frame, setFrame] = (0, import_react30.useState)(0);
|
|
72374
|
+
(0, import_react30.useEffect)(() => {
|
|
72247
72375
|
const id = setInterval(() => {
|
|
72248
72376
|
setFrame((prev) => (prev + 1) % KITE_FRAMES.length);
|
|
72249
72377
|
}, FRAME_INTERVAL_MS);
|
|
@@ -72255,11 +72383,11 @@ function Spinner({ label }) {
|
|
|
72255
72383
|
label
|
|
72256
72384
|
] });
|
|
72257
72385
|
}
|
|
72258
|
-
var
|
|
72386
|
+
var import_react30, import_jsx_runtime, KITE_FRAMES, FRAME_INTERVAL_MS;
|
|
72259
72387
|
var init_spinner = __esm({
|
|
72260
72388
|
async "apps/cli/src/ui/spinner.tsx"() {
|
|
72261
72389
|
"use strict";
|
|
72262
|
-
|
|
72390
|
+
import_react30 = __toESM(require_react(), 1);
|
|
72263
72391
|
await init_build2();
|
|
72264
72392
|
import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
72265
72393
|
KITE_FRAMES = [
|
|
@@ -72284,10 +72412,11 @@ function BrowserLoginProvider({
|
|
|
72284
72412
|
loginRunner = login,
|
|
72285
72413
|
isInteractive
|
|
72286
72414
|
}) {
|
|
72287
|
-
const [state, setState] = (0,
|
|
72288
|
-
const pendingConfirmationRef = (0,
|
|
72415
|
+
const [state, setState] = (0, import_react31.useState)(idleState);
|
|
72416
|
+
const pendingConfirmationRef = (0, import_react31.useRef)(null);
|
|
72417
|
+
const pendingManualTokenRef = (0, import_react31.useRef)(null);
|
|
72289
72418
|
const shouldConfirm = isInteractive ?? isBrowserLoginConfirmationInteractive();
|
|
72290
|
-
const confirmBrowserLoginStart = (0,
|
|
72419
|
+
const confirmBrowserLoginStart = (0, import_react31.useCallback)(() => {
|
|
72291
72420
|
const pendingConfirmation = pendingConfirmationRef.current;
|
|
72292
72421
|
if (pendingConfirmation === null) {
|
|
72293
72422
|
return void 0;
|
|
@@ -72296,7 +72425,20 @@ function BrowserLoginProvider({
|
|
|
72296
72425
|
pendingConfirmation.resolve(void 0);
|
|
72297
72426
|
return void 0;
|
|
72298
72427
|
}, []);
|
|
72299
|
-
const
|
|
72428
|
+
const submitManualClerkToken = (0, import_react31.useCallback)((clerkToken) => {
|
|
72429
|
+
const pendingManualToken = pendingManualTokenRef.current;
|
|
72430
|
+
if (pendingManualToken === null) {
|
|
72431
|
+
return void 0;
|
|
72432
|
+
}
|
|
72433
|
+
const trimmed = clerkToken.trim();
|
|
72434
|
+
if (trimmed.length === 0) {
|
|
72435
|
+
return void 0;
|
|
72436
|
+
}
|
|
72437
|
+
pendingManualTokenRef.current = null;
|
|
72438
|
+
pendingManualToken.resolve(trimmed);
|
|
72439
|
+
return void 0;
|
|
72440
|
+
}, []);
|
|
72441
|
+
const runLogin2 = (0, import_react31.useCallback)(async (passthroughOptions) => {
|
|
72300
72442
|
if (pendingConfirmationRef.current !== null) {
|
|
72301
72443
|
throw new Error("Browser login is already waiting for confirmation.");
|
|
72302
72444
|
}
|
|
@@ -72313,15 +72455,42 @@ function BrowserLoginProvider({
|
|
|
72313
72455
|
});
|
|
72314
72456
|
}
|
|
72315
72457
|
setState({ ...idleState, phase: "waiting" });
|
|
72458
|
+
const manualClerkToken = new Promise((resolve2, reject) => {
|
|
72459
|
+
pendingManualTokenRef.current = {
|
|
72460
|
+
resolve: resolve2,
|
|
72461
|
+
reject: (reason) => {
|
|
72462
|
+
reject(reason);
|
|
72463
|
+
return void 0;
|
|
72464
|
+
}
|
|
72465
|
+
};
|
|
72466
|
+
});
|
|
72467
|
+
manualClerkToken.catch(() => void 0);
|
|
72316
72468
|
try {
|
|
72317
|
-
const result = await loginRunner(
|
|
72469
|
+
const result = await loginRunner({
|
|
72470
|
+
...passthroughOptions ?? {},
|
|
72471
|
+
manualClerkToken
|
|
72472
|
+
});
|
|
72318
72473
|
const organizationName = result.organization.organizationName ?? result.organization.clerkOrgId;
|
|
72474
|
+
pendingManualTokenRef.current = null;
|
|
72475
|
+
const identity = {
|
|
72476
|
+
email: result.user.email,
|
|
72477
|
+
organizationName
|
|
72478
|
+
};
|
|
72479
|
+
if (result.source === "manual") {
|
|
72480
|
+
setState({
|
|
72481
|
+
phase: "finalizing",
|
|
72482
|
+
identity,
|
|
72483
|
+
errorMessage: ""
|
|
72484
|
+
});
|
|
72485
|
+
await new Promise((resolve2) => {
|
|
72486
|
+
setTimeout(() => {
|
|
72487
|
+
resolve2(void 0);
|
|
72488
|
+
}, MANUAL_PASTE_FINALIZING_MS);
|
|
72489
|
+
});
|
|
72490
|
+
}
|
|
72319
72491
|
setState({
|
|
72320
72492
|
phase: "success",
|
|
72321
|
-
identity
|
|
72322
|
-
email: result.user.email,
|
|
72323
|
-
organizationName
|
|
72324
|
-
},
|
|
72493
|
+
identity,
|
|
72325
72494
|
errorMessage: ""
|
|
72326
72495
|
});
|
|
72327
72496
|
return result;
|
|
@@ -72330,6 +72499,7 @@ function BrowserLoginProvider({
|
|
|
72330
72499
|
error48,
|
|
72331
72500
|
"An unexpected error occurred."
|
|
72332
72501
|
);
|
|
72502
|
+
pendingManualTokenRef.current = null;
|
|
72333
72503
|
setState({
|
|
72334
72504
|
phase: "error",
|
|
72335
72505
|
identity: null,
|
|
@@ -72338,37 +72508,45 @@ function BrowserLoginProvider({
|
|
|
72338
72508
|
throw concreteError;
|
|
72339
72509
|
}
|
|
72340
72510
|
}, [loginRunner, shouldConfirm]);
|
|
72341
|
-
(0,
|
|
72511
|
+
(0, import_react31.useEffect)(() => {
|
|
72342
72512
|
return () => {
|
|
72343
72513
|
const pendingConfirmation = pendingConfirmationRef.current;
|
|
72344
|
-
if (pendingConfirmation
|
|
72345
|
-
|
|
72514
|
+
if (pendingConfirmation !== null) {
|
|
72515
|
+
pendingConfirmationRef.current = null;
|
|
72516
|
+
pendingConfirmation.reject(
|
|
72517
|
+
new Error("Browser login confirmation was interrupted.")
|
|
72518
|
+
);
|
|
72519
|
+
}
|
|
72520
|
+
const pendingManualToken = pendingManualTokenRef.current;
|
|
72521
|
+
if (pendingManualToken !== null) {
|
|
72522
|
+
pendingManualTokenRef.current = null;
|
|
72523
|
+
pendingManualToken.reject(
|
|
72524
|
+
new Error("Browser login manual paste was interrupted.")
|
|
72525
|
+
);
|
|
72346
72526
|
}
|
|
72347
|
-
pendingConfirmationRef.current = null;
|
|
72348
|
-
pendingConfirmation.reject(
|
|
72349
|
-
new Error("Browser login confirmation was interrupted.")
|
|
72350
|
-
);
|
|
72351
72527
|
};
|
|
72352
72528
|
}, []);
|
|
72353
|
-
const value = (0,
|
|
72529
|
+
const value = (0, import_react31.useMemo)(
|
|
72354
72530
|
() => ({
|
|
72355
72531
|
runLogin: runLogin2,
|
|
72356
72532
|
state,
|
|
72357
|
-
confirmBrowserLoginStart
|
|
72533
|
+
confirmBrowserLoginStart,
|
|
72534
|
+
submitManualClerkToken
|
|
72358
72535
|
}),
|
|
72359
|
-
[confirmBrowserLoginStart, runLogin2, state]
|
|
72536
|
+
[confirmBrowserLoginStart, runLogin2, state, submitManualClerkToken]
|
|
72360
72537
|
);
|
|
72361
72538
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BrowserLoginContext.Provider, { value, children });
|
|
72362
72539
|
}
|
|
72363
72540
|
function useBrowserLogin() {
|
|
72364
|
-
const context = (0,
|
|
72541
|
+
const context = (0, import_react31.useContext)(BrowserLoginContext);
|
|
72365
72542
|
if (context === null) {
|
|
72366
72543
|
throw new Error("useBrowserLogin must be used inside BrowserLoginProvider.");
|
|
72367
72544
|
}
|
|
72368
72545
|
return context;
|
|
72369
72546
|
}
|
|
72370
72547
|
function BrowserLoginConfirmation() {
|
|
72371
|
-
const { state, confirmBrowserLoginStart } = useBrowserLogin();
|
|
72548
|
+
const { state, confirmBrowserLoginStart, submitManualClerkToken } = useBrowserLogin();
|
|
72549
|
+
const [manualTokenInput, setManualTokenInput] = (0, import_react31.useState)("");
|
|
72372
72550
|
use_input_default((_input, key) => {
|
|
72373
72551
|
if (state.phase === "confirming" && key.return) {
|
|
72374
72552
|
confirmBrowserLoginStart();
|
|
@@ -72384,7 +72562,44 @@ function BrowserLoginConfirmation() {
|
|
|
72384
72562
|
] });
|
|
72385
72563
|
}
|
|
72386
72564
|
if (state.phase === "waiting") {
|
|
72387
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
72565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
72566
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spinner, { label: "\u{1FA81} Waiting for browser sign-in\u2026" }),
|
|
72567
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { marginTop: 1, flexDirection: "column", children: [
|
|
72568
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "gray", children: BROWSER_LOGIN_MANUAL_PASTE_LABEL }),
|
|
72569
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
72570
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
72571
|
+
">",
|
|
72572
|
+
" "
|
|
72573
|
+
] }),
|
|
72574
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
72575
|
+
build_default,
|
|
72576
|
+
{
|
|
72577
|
+
value: manualTokenInput,
|
|
72578
|
+
onChange: setManualTokenInput,
|
|
72579
|
+
onSubmit: (value) => {
|
|
72580
|
+
submitManualClerkToken(value);
|
|
72581
|
+
setManualTokenInput("");
|
|
72582
|
+
},
|
|
72583
|
+
placeholder: "paste code and press Enter"
|
|
72584
|
+
}
|
|
72585
|
+
)
|
|
72586
|
+
] })
|
|
72587
|
+
] })
|
|
72588
|
+
] });
|
|
72589
|
+
}
|
|
72590
|
+
if (state.phase === "finalizing" && state.identity !== null) {
|
|
72591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
72592
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "green", children: "Logged in successfully!" }),
|
|
72593
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
72594
|
+
"Email: ",
|
|
72595
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, children: state.identity.email })
|
|
72596
|
+
] }),
|
|
72597
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
72598
|
+
"Organization: ",
|
|
72599
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, children: state.identity.organizationName })
|
|
72600
|
+
] }),
|
|
72601
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spinner, { label: "Wrapping up..." }) })
|
|
72602
|
+
] });
|
|
72388
72603
|
}
|
|
72389
72604
|
if (state.phase === "success" && state.identity !== null) {
|
|
72390
72605
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
@@ -72404,24 +72619,27 @@ function BrowserLoginConfirmation() {
|
|
|
72404
72619
|
state.errorMessage
|
|
72405
72620
|
] }) });
|
|
72406
72621
|
}
|
|
72407
|
-
var
|
|
72622
|
+
var import_react31, import_jsx_runtime2, BROWSER_LOGIN_CONFIRMATION_MESSAGE, BROWSER_LOGIN_CONFIRMATION_PROMPT, MANUAL_PASTE_FINALIZING_MS, idleState, BrowserLoginContext, BROWSER_LOGIN_MANUAL_PASTE_LABEL;
|
|
72408
72623
|
var init_browser_login = __esm({
|
|
72409
72624
|
async "apps/cli/src/ui/browser-login.tsx"() {
|
|
72410
72625
|
"use strict";
|
|
72411
|
-
|
|
72626
|
+
import_react31 = __toESM(require_react(), 1);
|
|
72412
72627
|
await init_build2();
|
|
72628
|
+
await init_build3();
|
|
72413
72629
|
init_auth_service();
|
|
72414
72630
|
init_cli_auth_diagnostics();
|
|
72415
72631
|
await init_spinner();
|
|
72416
72632
|
import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
72417
72633
|
BROWSER_LOGIN_CONFIRMATION_MESSAGE = "Sign in to your \u{1FA81} CopilotKit account in your browser.";
|
|
72418
72634
|
BROWSER_LOGIN_CONFIRMATION_PROMPT = "Press Enter to continue...";
|
|
72635
|
+
MANUAL_PASTE_FINALIZING_MS = 6e3;
|
|
72419
72636
|
idleState = {
|
|
72420
72637
|
phase: "idle",
|
|
72421
72638
|
identity: null,
|
|
72422
72639
|
errorMessage: ""
|
|
72423
72640
|
};
|
|
72424
|
-
BrowserLoginContext = (0,
|
|
72641
|
+
BrowserLoginContext = (0, import_react31.createContext)(null);
|
|
72642
|
+
BROWSER_LOGIN_MANUAL_PASTE_LABEL = "If your browser finished sign-in but the CLI didn't notice, paste the code shown in the browser:";
|
|
72425
72643
|
}
|
|
72426
72644
|
});
|
|
72427
72645
|
|
|
@@ -72527,10 +72745,10 @@ function formatLicenseList(scope, licenses) {
|
|
|
72527
72745
|
function LicenseCreateApp({ onIssued }) {
|
|
72528
72746
|
const { exit } = use_app_default();
|
|
72529
72747
|
const browserLogin = useBrowserLogin();
|
|
72530
|
-
const [phase, setPhase] = (0,
|
|
72531
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
72532
|
-
const [authMessage, setAuthMessage] = (0,
|
|
72533
|
-
(0,
|
|
72748
|
+
const [phase, setPhase] = (0, import_react32.useState)("auth");
|
|
72749
|
+
const [errorMessage, setErrorMessage] = (0, import_react32.useState)("");
|
|
72750
|
+
const [authMessage, setAuthMessage] = (0, import_react32.useState)("");
|
|
72751
|
+
(0, import_react32.useEffect)(() => {
|
|
72534
72752
|
let cancelled = false;
|
|
72535
72753
|
async function run() {
|
|
72536
72754
|
setPhase("auth");
|
|
@@ -72643,11 +72861,11 @@ async function runLicense(command) {
|
|
|
72643
72861
|
`);
|
|
72644
72862
|
}
|
|
72645
72863
|
}
|
|
72646
|
-
var
|
|
72864
|
+
var import_react32, import_jsx_runtime3;
|
|
72647
72865
|
var init_license = __esm({
|
|
72648
72866
|
async "apps/cli/src/commands/license.tsx"() {
|
|
72649
72867
|
"use strict";
|
|
72650
|
-
|
|
72868
|
+
import_react32 = __toESM(require_react(), 1);
|
|
72651
72869
|
await init_build2();
|
|
72652
72870
|
await init_build2();
|
|
72653
72871
|
init_auth_service();
|
|
@@ -73261,22 +73479,6 @@ var init_types = __esm({
|
|
|
73261
73479
|
}
|
|
73262
73480
|
});
|
|
73263
73481
|
|
|
73264
|
-
// apps/cli/src/services/feature-flags.ts
|
|
73265
|
-
function hasThreadsAccess() {
|
|
73266
|
-
return configStore.get("threads-access") === true;
|
|
73267
|
-
}
|
|
73268
|
-
function grantThreadsAccess() {
|
|
73269
|
-
configStore.set("threads-access", true);
|
|
73270
|
-
}
|
|
73271
|
-
var THREADS_PASSWORD;
|
|
73272
|
-
var init_feature_flags = __esm({
|
|
73273
|
-
"apps/cli/src/services/feature-flags.ts"() {
|
|
73274
|
-
"use strict";
|
|
73275
|
-
init_config_service();
|
|
73276
|
-
THREADS_PASSWORD = "earlyaccess";
|
|
73277
|
-
}
|
|
73278
|
-
});
|
|
73279
|
-
|
|
73280
73482
|
// apps/cli/src/services/project-scaffold.ts
|
|
73281
73483
|
import * as fs13 from "node:fs";
|
|
73282
73484
|
import * as path9 from "node:path";
|
|
@@ -73765,13 +73967,13 @@ var init_figures = __esm({
|
|
|
73765
73967
|
|
|
73766
73968
|
// node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/Indicator.js
|
|
73767
73969
|
function Indicator({ isSelected = false }) {
|
|
73768
|
-
return
|
|
73970
|
+
return import_react33.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react33.default.createElement(Text, { color: "blue" }, figures_default.pointer) : import_react33.default.createElement(Text, null, " "));
|
|
73769
73971
|
}
|
|
73770
|
-
var
|
|
73972
|
+
var import_react33, Indicator_default;
|
|
73771
73973
|
var init_Indicator = __esm({
|
|
73772
73974
|
async "node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/Indicator.js"() {
|
|
73773
73975
|
"use strict";
|
|
73774
|
-
|
|
73976
|
+
import_react33 = __toESM(require_react(), 1);
|
|
73775
73977
|
await init_build2();
|
|
73776
73978
|
init_figures();
|
|
73777
73979
|
Indicator_default = Indicator;
|
|
@@ -73780,13 +73982,13 @@ var init_Indicator = __esm({
|
|
|
73780
73982
|
|
|
73781
73983
|
// node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/Item.js
|
|
73782
73984
|
function Item({ isSelected = false, label }) {
|
|
73783
|
-
return
|
|
73985
|
+
return React13.createElement(Text, { color: isSelected ? "blue" : void 0 }, label);
|
|
73784
73986
|
}
|
|
73785
|
-
var
|
|
73987
|
+
var React13, Item_default;
|
|
73786
73988
|
var init_Item = __esm({
|
|
73787
73989
|
async "node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/Item.js"() {
|
|
73788
73990
|
"use strict";
|
|
73789
|
-
|
|
73991
|
+
React13 = __toESM(require_react(), 1);
|
|
73790
73992
|
await init_build2();
|
|
73791
73993
|
Item_default = Item;
|
|
73792
73994
|
}
|
|
@@ -73825,17 +74027,17 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
73825
74027
|
const hasLimit = typeof customLimit === "number" && items.length > customLimit;
|
|
73826
74028
|
const limit = hasLimit ? Math.min(customLimit, items.length) : items.length;
|
|
73827
74029
|
const lastIndex = limit - 1;
|
|
73828
|
-
const [rotateIndex, setRotateIndex] = (0,
|
|
73829
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
73830
|
-
const previousItems = (0,
|
|
73831
|
-
(0,
|
|
74030
|
+
const [rotateIndex, setRotateIndex] = (0, import_react34.useState)(initialIndex > lastIndex ? lastIndex - initialIndex : 0);
|
|
74031
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react34.useState)(initialIndex ? initialIndex > lastIndex ? lastIndex : initialIndex : 0);
|
|
74032
|
+
const previousItems = (0, import_react34.useRef)(items);
|
|
74033
|
+
(0, import_react34.useEffect)(() => {
|
|
73832
74034
|
if (!isDeepStrictEqual2(previousItems.current.map((item) => item.value), items.map((item) => item.value))) {
|
|
73833
74035
|
setRotateIndex(0);
|
|
73834
74036
|
setSelectedIndex(0);
|
|
73835
74037
|
}
|
|
73836
74038
|
previousItems.current = items;
|
|
73837
74039
|
}, [items]);
|
|
73838
|
-
use_input_default((0,
|
|
74040
|
+
use_input_default((0, import_react34.useCallback)((input, key) => {
|
|
73839
74041
|
if (input === "k" || key.upArrow) {
|
|
73840
74042
|
const lastIndex2 = (hasLimit ? limit : items.length) - 1;
|
|
73841
74043
|
const atFirstIndex = selectedIndex === 0;
|
|
@@ -73887,24 +74089,24 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
73887
74089
|
onHighlight
|
|
73888
74090
|
]), { isActive: isFocused });
|
|
73889
74091
|
const slicedItems = hasLimit ? toRotated(items, rotateIndex).slice(0, limit) : items;
|
|
73890
|
-
return
|
|
74092
|
+
return import_react34.default.createElement(Box_default, { flexDirection: "column" }, slicedItems.map((item, index) => {
|
|
73891
74093
|
const isSelected = index === selectedIndex;
|
|
73892
74094
|
return (
|
|
73893
74095
|
// @ts-expect-error - `key` can't be optional but `item.value` is generic T
|
|
73894
|
-
|
|
74096
|
+
import_react34.default.createElement(
|
|
73895
74097
|
Box_default,
|
|
73896
74098
|
{ key: item.key ?? item.value },
|
|
73897
|
-
|
|
73898
|
-
|
|
74099
|
+
import_react34.default.createElement(indicatorComponent, { isSelected }),
|
|
74100
|
+
import_react34.default.createElement(itemComponent, { ...item, isSelected })
|
|
73899
74101
|
)
|
|
73900
74102
|
);
|
|
73901
74103
|
}));
|
|
73902
74104
|
}
|
|
73903
|
-
var
|
|
74105
|
+
var import_react34, SelectInput_default;
|
|
73904
74106
|
var init_SelectInput = __esm({
|
|
73905
74107
|
async "node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/SelectInput.js"() {
|
|
73906
74108
|
"use strict";
|
|
73907
|
-
|
|
74109
|
+
import_react34 = __toESM(require_react(), 1);
|
|
73908
74110
|
init_to_rotated();
|
|
73909
74111
|
await init_build2();
|
|
73910
74112
|
await init_Indicator();
|
|
@@ -73914,7 +74116,7 @@ var init_SelectInput = __esm({
|
|
|
73914
74116
|
});
|
|
73915
74117
|
|
|
73916
74118
|
// node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/index.js
|
|
73917
|
-
var
|
|
74119
|
+
var init_build4 = __esm({
|
|
73918
74120
|
async "node_modules/.pnpm/ink-select-input@6.2.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-select-input/build/index.js"() {
|
|
73919
74121
|
"use strict";
|
|
73920
74122
|
await init_Indicator();
|
|
@@ -73923,104 +74125,6 @@ var init_build3 = __esm({
|
|
|
73923
74125
|
}
|
|
73924
74126
|
});
|
|
73925
74127
|
|
|
73926
|
-
// node_modules/.pnpm/ink-text-input@6.0.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-text-input/build/index.js
|
|
73927
|
-
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
73928
|
-
const [state, setState] = (0, import_react34.useState)({
|
|
73929
|
-
cursorOffset: (originalValue || "").length,
|
|
73930
|
-
cursorWidth: 0
|
|
73931
|
-
});
|
|
73932
|
-
const { cursorOffset, cursorWidth } = state;
|
|
73933
|
-
(0, import_react34.useEffect)(() => {
|
|
73934
|
-
setState((previousState) => {
|
|
73935
|
-
if (!focus || !showCursor) {
|
|
73936
|
-
return previousState;
|
|
73937
|
-
}
|
|
73938
|
-
const newValue = originalValue || "";
|
|
73939
|
-
if (previousState.cursorOffset > newValue.length - 1) {
|
|
73940
|
-
return {
|
|
73941
|
-
cursorOffset: newValue.length,
|
|
73942
|
-
cursorWidth: 0
|
|
73943
|
-
};
|
|
73944
|
-
}
|
|
73945
|
-
return previousState;
|
|
73946
|
-
});
|
|
73947
|
-
}, [originalValue, focus, showCursor]);
|
|
73948
|
-
const cursorActualWidth = highlightPastedText ? cursorWidth : 0;
|
|
73949
|
-
const value = mask ? mask.repeat(originalValue.length) : originalValue;
|
|
73950
|
-
let renderedValue = value;
|
|
73951
|
-
let renderedPlaceholder = placeholder ? source_default.grey(placeholder) : void 0;
|
|
73952
|
-
if (showCursor && focus) {
|
|
73953
|
-
renderedPlaceholder = placeholder.length > 0 ? source_default.inverse(placeholder[0]) + source_default.grey(placeholder.slice(1)) : source_default.inverse(" ");
|
|
73954
|
-
renderedValue = value.length > 0 ? "" : source_default.inverse(" ");
|
|
73955
|
-
let i = 0;
|
|
73956
|
-
for (const char of value) {
|
|
73957
|
-
renderedValue += i >= cursorOffset - cursorActualWidth && i <= cursorOffset ? source_default.inverse(char) : char;
|
|
73958
|
-
i++;
|
|
73959
|
-
}
|
|
73960
|
-
if (value.length > 0 && cursorOffset === value.length) {
|
|
73961
|
-
renderedValue += source_default.inverse(" ");
|
|
73962
|
-
}
|
|
73963
|
-
}
|
|
73964
|
-
use_input_default((input, key) => {
|
|
73965
|
-
if (key.upArrow || key.downArrow || key.ctrl && input === "c" || key.tab || key.shift && key.tab) {
|
|
73966
|
-
return;
|
|
73967
|
-
}
|
|
73968
|
-
if (key.return) {
|
|
73969
|
-
if (onSubmit) {
|
|
73970
|
-
onSubmit(originalValue);
|
|
73971
|
-
}
|
|
73972
|
-
return;
|
|
73973
|
-
}
|
|
73974
|
-
let nextCursorOffset = cursorOffset;
|
|
73975
|
-
let nextValue = originalValue;
|
|
73976
|
-
let nextCursorWidth = 0;
|
|
73977
|
-
if (key.leftArrow) {
|
|
73978
|
-
if (showCursor) {
|
|
73979
|
-
nextCursorOffset--;
|
|
73980
|
-
}
|
|
73981
|
-
} else if (key.rightArrow) {
|
|
73982
|
-
if (showCursor) {
|
|
73983
|
-
nextCursorOffset++;
|
|
73984
|
-
}
|
|
73985
|
-
} else if (key.backspace || key.delete) {
|
|
73986
|
-
if (cursorOffset > 0) {
|
|
73987
|
-
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
|
73988
|
-
nextCursorOffset--;
|
|
73989
|
-
}
|
|
73990
|
-
} else {
|
|
73991
|
-
nextValue = originalValue.slice(0, cursorOffset) + input + originalValue.slice(cursorOffset, originalValue.length);
|
|
73992
|
-
nextCursorOffset += input.length;
|
|
73993
|
-
if (input.length > 1) {
|
|
73994
|
-
nextCursorWidth = input.length;
|
|
73995
|
-
}
|
|
73996
|
-
}
|
|
73997
|
-
if (cursorOffset < 0) {
|
|
73998
|
-
nextCursorOffset = 0;
|
|
73999
|
-
}
|
|
74000
|
-
if (cursorOffset > originalValue.length) {
|
|
74001
|
-
nextCursorOffset = originalValue.length;
|
|
74002
|
-
}
|
|
74003
|
-
setState({
|
|
74004
|
-
cursorOffset: nextCursorOffset,
|
|
74005
|
-
cursorWidth: nextCursorWidth
|
|
74006
|
-
});
|
|
74007
|
-
if (nextValue !== originalValue) {
|
|
74008
|
-
onChange(nextValue);
|
|
74009
|
-
}
|
|
74010
|
-
}, { isActive: focus });
|
|
74011
|
-
return import_react34.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
74012
|
-
}
|
|
74013
|
-
var import_react34, build_default;
|
|
74014
|
-
var init_build4 = __esm({
|
|
74015
|
-
async "node_modules/.pnpm/ink-text-input@6.0.0_ink@6.8.0_@types+react@19.2.14_react-devtools-core@7.0.1_react@19.2.4__react@19.2.4/node_modules/ink-text-input/build/index.js"() {
|
|
74016
|
-
"use strict";
|
|
74017
|
-
import_react34 = __toESM(require_react(), 1);
|
|
74018
|
-
await init_build2();
|
|
74019
|
-
init_source2();
|
|
74020
|
-
build_default = TextInput;
|
|
74021
|
-
}
|
|
74022
|
-
});
|
|
74023
|
-
|
|
74024
74128
|
// apps/cli/src/ui/init-flow.tsx
|
|
74025
74129
|
function validateName(name) {
|
|
74026
74130
|
if (name.length === 0)
|
|
@@ -74035,20 +74139,17 @@ function InitFlow({
|
|
|
74035
74139
|
initialName,
|
|
74036
74140
|
initialIntelligence,
|
|
74037
74141
|
initialFramework,
|
|
74038
|
-
onComplete
|
|
74039
|
-
onRequestThreadsAccess
|
|
74142
|
+
onComplete
|
|
74040
74143
|
}) {
|
|
74041
74144
|
const [name, setName] = (0, import_react35.useState)(initialName ?? "");
|
|
74042
74145
|
const [nameError, setNameError] = (0, import_react35.useState)(null);
|
|
74043
|
-
const [password, setPassword] = (0, import_react35.useState)("");
|
|
74044
74146
|
function firstStep() {
|
|
74045
74147
|
if (initialName === null)
|
|
74046
74148
|
return "name";
|
|
74047
74149
|
if (initialFramework !== null)
|
|
74048
74150
|
return "done";
|
|
74049
|
-
if (initialIntelligence === true)
|
|
74050
|
-
return
|
|
74051
|
-
}
|
|
74151
|
+
if (initialIntelligence === true)
|
|
74152
|
+
return "done";
|
|
74052
74153
|
if (initialIntelligence === false)
|
|
74053
74154
|
return "framework";
|
|
74054
74155
|
return "intelligence";
|
|
@@ -74101,15 +74202,11 @@ function InitFlow({
|
|
|
74101
74202
|
return;
|
|
74102
74203
|
}
|
|
74103
74204
|
if (initialIntelligence === true) {
|
|
74104
|
-
|
|
74105
|
-
|
|
74106
|
-
|
|
74107
|
-
|
|
74108
|
-
|
|
74109
|
-
});
|
|
74110
|
-
return;
|
|
74111
|
-
}
|
|
74112
|
-
setStep("password-menu");
|
|
74205
|
+
onComplete({
|
|
74206
|
+
name: resolvedName,
|
|
74207
|
+
intelligence: true,
|
|
74208
|
+
framework: null
|
|
74209
|
+
});
|
|
74113
74210
|
return;
|
|
74114
74211
|
}
|
|
74115
74212
|
if (initialIntelligence === false) {
|
|
@@ -74120,46 +74217,11 @@ function InitFlow({
|
|
|
74120
74217
|
}
|
|
74121
74218
|
function handleIntelligenceSelect(item) {
|
|
74122
74219
|
if (item.value === "yes") {
|
|
74123
|
-
if (hasThreadsAccess()) {
|
|
74124
|
-
completeWithIntelligence();
|
|
74125
|
-
return;
|
|
74126
|
-
}
|
|
74127
|
-
setStep("password-menu");
|
|
74128
|
-
} else {
|
|
74129
|
-
setStep("framework");
|
|
74130
|
-
}
|
|
74131
|
-
}
|
|
74132
|
-
function handlePasswordMenuSelect(item) {
|
|
74133
|
-
if (item.value === "enter-password") {
|
|
74134
|
-
setStep("password-input");
|
|
74135
|
-
} else if (item.value === "request-access") {
|
|
74136
|
-
setStep("mailing-list");
|
|
74137
|
-
} else if (item.value === "skip") {
|
|
74138
|
-
setStep("framework");
|
|
74139
|
-
}
|
|
74140
|
-
}
|
|
74141
|
-
function handlePasswordSubmit(value) {
|
|
74142
|
-
if (value === THREADS_PASSWORD) {
|
|
74143
|
-
grantThreadsAccess();
|
|
74144
|
-
setPassword("");
|
|
74145
74220
|
completeWithIntelligence();
|
|
74146
74221
|
} else {
|
|
74147
|
-
setPassword("");
|
|
74148
|
-
setStep("password-wrong");
|
|
74149
|
-
}
|
|
74150
|
-
}
|
|
74151
|
-
function handlePasswordRetrySelect(item) {
|
|
74152
|
-
if (item.value === "retry") {
|
|
74153
|
-
setStep("password-input");
|
|
74154
|
-
} else if (item.value === "request-access") {
|
|
74155
|
-
setStep("mailing-list");
|
|
74156
|
-
} else if (item.value === "skip") {
|
|
74157
74222
|
setStep("framework");
|
|
74158
74223
|
}
|
|
74159
74224
|
}
|
|
74160
|
-
function handleMailingListDone() {
|
|
74161
|
-
setStep("password-menu");
|
|
74162
|
-
}
|
|
74163
74225
|
function handleFrameworkSelect(item) {
|
|
74164
74226
|
const chosen = item.value;
|
|
74165
74227
|
onComplete({
|
|
@@ -74194,111 +74256,27 @@ function InitFlow({
|
|
|
74194
74256
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "gray", children: "Intelligence adds durable threads, state persistence, and insights." }),
|
|
74195
74257
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectInput_default, { items: INTELLIGENCE_CHOICES, onSelect: handleIntelligenceSelect })
|
|
74196
74258
|
] }),
|
|
74197
|
-
step === "password-menu" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
74198
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: "Intelligence requires an access password." }),
|
|
74199
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectInput_default, { items: PASSWORD_MENU_CHOICES, onSelect: handlePasswordMenuSelect })
|
|
74200
|
-
] }),
|
|
74201
|
-
step === "password-input" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
74202
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: "Enter your Intelligence access password" }),
|
|
74203
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { children: [
|
|
74204
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text, { children: [
|
|
74205
|
-
">",
|
|
74206
|
-
" "
|
|
74207
|
-
] }),
|
|
74208
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
74209
|
-
build_default,
|
|
74210
|
-
{
|
|
74211
|
-
value: password,
|
|
74212
|
-
onChange: setPassword,
|
|
74213
|
-
onSubmit: handlePasswordSubmit,
|
|
74214
|
-
placeholder: "password",
|
|
74215
|
-
mask: "*"
|
|
74216
|
-
}
|
|
74217
|
-
)
|
|
74218
|
-
] })
|
|
74219
|
-
] }),
|
|
74220
|
-
step === "password-wrong" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
74221
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "red", children: "Incorrect password." }),
|
|
74222
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
74223
|
-
SelectInput_default,
|
|
74224
|
-
{
|
|
74225
|
-
items: [
|
|
74226
|
-
{ label: "Try again", value: "retry" },
|
|
74227
|
-
{ label: "I don't have a password \u2014 how do I get one?", value: "request-access" },
|
|
74228
|
-
{ label: "Continue without Intelligence", value: "skip" }
|
|
74229
|
-
],
|
|
74230
|
-
onSelect: handlePasswordRetrySelect
|
|
74231
|
-
}
|
|
74232
|
-
)
|
|
74233
|
-
] }),
|
|
74234
|
-
step === "mailing-list" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
74235
|
-
MailingListScreen,
|
|
74236
|
-
{
|
|
74237
|
-
onRequestAccess: onRequestThreadsAccess,
|
|
74238
|
-
onDone: handleMailingListDone
|
|
74239
|
-
}
|
|
74240
|
-
),
|
|
74241
74259
|
step === "framework" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
74242
74260
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { bold: true, children: "Select agent framework" }),
|
|
74243
74261
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectInput_default, { items: FRAMEWORK_CHOICES, onSelect: handleFrameworkSelect })
|
|
74244
74262
|
] })
|
|
74245
74263
|
] });
|
|
74246
74264
|
}
|
|
74247
|
-
|
|
74248
|
-
const [status, setStatus] = (0, import_react35.useState)("sending");
|
|
74249
|
-
(0, import_react35.useEffect)(() => {
|
|
74250
|
-
let cancelled = false;
|
|
74251
|
-
async function run() {
|
|
74252
|
-
try {
|
|
74253
|
-
await onRequestAccess();
|
|
74254
|
-
} catch {
|
|
74255
|
-
}
|
|
74256
|
-
if (!cancelled) {
|
|
74257
|
-
setStatus("sent");
|
|
74258
|
-
}
|
|
74259
|
-
}
|
|
74260
|
-
run();
|
|
74261
|
-
return () => {
|
|
74262
|
-
cancelled = true;
|
|
74263
|
-
};
|
|
74264
|
-
}, [onRequestAccess]);
|
|
74265
|
-
if (status === "sending") {
|
|
74266
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "gray", children: "Registering your interest\u2026" }) });
|
|
74267
|
-
}
|
|
74268
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
74269
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "green", children: "Thanks! We've registered your interest." }),
|
|
74270
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { color: "gray", children: "You'll receive access details via email." }),
|
|
74271
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text, { children: "Press enter to go back and enter your password." }) }),
|
|
74272
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
74273
|
-
SelectInput_default,
|
|
74274
|
-
{
|
|
74275
|
-
items: [{ label: "Back to password", value: "back" }],
|
|
74276
|
-
onSelect: onDone
|
|
74277
|
-
}
|
|
74278
|
-
)
|
|
74279
|
-
] });
|
|
74280
|
-
}
|
|
74281
|
-
var import_react35, import_jsx_runtime5, PROJECT_NAME_RE, INTELLIGENCE_CHOICES, PASSWORD_MENU_CHOICES;
|
|
74265
|
+
var import_react35, import_jsx_runtime5, PROJECT_NAME_RE, INTELLIGENCE_CHOICES;
|
|
74282
74266
|
var init_init_flow = __esm({
|
|
74283
74267
|
async "apps/cli/src/ui/init-flow.tsx"() {
|
|
74284
74268
|
"use strict";
|
|
74285
74269
|
import_react35 = __toESM(require_react(), 1);
|
|
74286
74270
|
await init_build2();
|
|
74287
|
-
await init_build3();
|
|
74288
74271
|
await init_build4();
|
|
74272
|
+
await init_build3();
|
|
74289
74273
|
init_types();
|
|
74290
|
-
init_feature_flags();
|
|
74291
74274
|
import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
74292
74275
|
PROJECT_NAME_RE = /^[a-z0-9-]{1,30}$/;
|
|
74293
74276
|
INTELLIGENCE_CHOICES = [
|
|
74294
74277
|
{ label: "Yes \u2014 enable Intelligence (threads, persistence, insights)", value: "yes" },
|
|
74295
74278
|
{ label: "No \u2014 standard setup", value: "no" }
|
|
74296
74279
|
];
|
|
74297
|
-
PASSWORD_MENU_CHOICES = [
|
|
74298
|
-
{ label: "Enter password", value: "enter-password" },
|
|
74299
|
-
{ label: "I don't have a password \u2014 how do I get one?", value: "request-access" },
|
|
74300
|
-
{ label: "Continue without Intelligence", value: "skip" }
|
|
74301
|
-
];
|
|
74302
74280
|
}
|
|
74303
74281
|
});
|
|
74304
74282
|
|
|
@@ -74350,42 +74328,33 @@ function buildInitNextSteps(templateDefinition, projectName, result) {
|
|
|
74350
74328
|
const envTarget = result.envCreatedFromExample || result.licenseWritten ? "the scaffolded .env file" : ".env";
|
|
74351
74329
|
return `Set ${envKey.key} in ${envTarget}. ${envKey.note}`;
|
|
74352
74330
|
});
|
|
74353
|
-
const commandPrefix = `cd ${projectName}`;
|
|
74354
|
-
const steps = [`Directory: ${result.projectDir}`];
|
|
74355
74331
|
const setupMissing = missingPrerequisites.filter(
|
|
74356
74332
|
(prerequisite) => prerequisite.phase === "setup"
|
|
74357
74333
|
);
|
|
74358
|
-
|
|
74359
|
-
|
|
74360
|
-
|
|
74361
|
-
|
|
74362
|
-
|
|
74363
|
-
|
|
74364
|
-
steps.push(
|
|
74365
|
-
`After installing setup prerequisites, run: ${commandPrefix} && ${templateDefinition.installCommand}`
|
|
74366
|
-
);
|
|
74367
|
-
} else {
|
|
74368
|
-
steps.push(
|
|
74369
|
-
`Install: ${commandPrefix} && ${templateDefinition.installCommand}`
|
|
74370
|
-
);
|
|
74371
|
-
}
|
|
74372
|
-
for (const postInstallCommand of templateDefinition.postInstallCommands ?? []) {
|
|
74373
|
-
const label = setupMissing.length > 0 ? "Then run" : "Setup";
|
|
74374
|
-
steps.push(`${label}: ${commandPrefix} && ${postInstallCommand}`);
|
|
74334
|
+
const runtimeMissing = missingPrerequisites.filter(
|
|
74335
|
+
(prerequisite) => prerequisite.phase === "runtime"
|
|
74336
|
+
);
|
|
74337
|
+
const steps = [`Directory: ${result.projectDir}`];
|
|
74338
|
+
for (const prerequisite of missingPrerequisites) {
|
|
74339
|
+
steps.push(`Missing ${prerequisite.label}: ${prerequisite.installHint}`);
|
|
74375
74340
|
}
|
|
74376
74341
|
for (const envNote of envNotes) {
|
|
74377
74342
|
steps.push(envNote);
|
|
74378
74343
|
}
|
|
74379
|
-
|
|
74380
|
-
|
|
74381
|
-
|
|
74382
|
-
if (runtimeMissing.length
|
|
74383
|
-
|
|
74384
|
-
} else {
|
|
74385
|
-
steps.push(
|
|
74386
|
-
`After runtime prerequisites are ready, run: ${commandPrefix} && ${templateDefinition.runCommand}`
|
|
74387
|
-
);
|
|
74344
|
+
let header = "Run these commands:";
|
|
74345
|
+
if (setupMissing.length > 0) {
|
|
74346
|
+
header = "After installing setup prerequisites, run:";
|
|
74347
|
+
} else if (runtimeMissing.length > 0) {
|
|
74348
|
+
header = "After runtime prerequisites are ready, run:";
|
|
74388
74349
|
}
|
|
74350
|
+
steps.push(header);
|
|
74351
|
+
steps.push(` cd ${projectName}`);
|
|
74352
|
+
steps.push(` ${templateDefinition.installCommand}`);
|
|
74353
|
+
for (const postInstallCommand of templateDefinition.postInstallCommands ?? []) {
|
|
74354
|
+
const formatted = postInstallCommand.startsWith("cd ") ? `(${postInstallCommand})` : postInstallCommand;
|
|
74355
|
+
steps.push(` ${formatted}`);
|
|
74356
|
+
}
|
|
74357
|
+
steps.push(` ${templateDefinition.runCommand}`);
|
|
74389
74358
|
return steps;
|
|
74390
74359
|
}
|
|
74391
74360
|
async function ensureCliToken2(dependencies, onTerminalSessionInvalidation) {
|
|
@@ -74577,7 +74546,7 @@ function ScaffoldProgress({ options }) {
|
|
|
74577
74546
|
options.name,
|
|
74578
74547
|
'" created successfully!'
|
|
74579
74548
|
] }),
|
|
74580
|
-
nextSteps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "gray", children: step }, step))
|
|
74549
|
+
nextSteps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { color: "gray", children: step }, `step-${index}`))
|
|
74581
74550
|
] });
|
|
74582
74551
|
}
|
|
74583
74552
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Text, { color: "red", children: [
|
|
@@ -74595,7 +74564,7 @@ function resolvePrefilledOptions(name, intelligence, framework) {
|
|
|
74595
74564
|
framework
|
|
74596
74565
|
};
|
|
74597
74566
|
}
|
|
74598
|
-
if (intelligence === true
|
|
74567
|
+
if (intelligence === true) {
|
|
74599
74568
|
return { name, intelligence: true, framework: null };
|
|
74600
74569
|
}
|
|
74601
74570
|
return null;
|
|
@@ -74611,13 +74580,6 @@ function InitApp({
|
|
|
74611
74580
|
initialFramework
|
|
74612
74581
|
);
|
|
74613
74582
|
const [options, setOptions] = (0, import_react36.useState)(prefilled);
|
|
74614
|
-
const handleRequestThreadsAccess = (0, import_react36.useCallback)(async () => {
|
|
74615
|
-
const cliToken = authStore.getToken();
|
|
74616
|
-
if (cliToken) {
|
|
74617
|
-
const apiClient = createApiClient(getOpsApiUrl(), cliToken);
|
|
74618
|
-
await apiClient.requestThreadsAccess();
|
|
74619
|
-
}
|
|
74620
|
-
}, []);
|
|
74621
74583
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
74622
74584
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Banner, {}),
|
|
74623
74585
|
options !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ScaffoldProgress, { options }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -74630,8 +74592,7 @@ function InitApp({
|
|
|
74630
74592
|
if (resolved !== null) {
|
|
74631
74593
|
setOptions(resolved);
|
|
74632
74594
|
}
|
|
74633
|
-
}
|
|
74634
|
-
onRequestThreadsAccess: handleRequestThreadsAccess
|
|
74595
|
+
}
|
|
74635
74596
|
}
|
|
74636
74597
|
)
|
|
74637
74598
|
] });
|
|
@@ -74665,7 +74626,6 @@ var init_init = __esm({
|
|
|
74665
74626
|
await init_build2();
|
|
74666
74627
|
await init_build2();
|
|
74667
74628
|
init_types();
|
|
74668
|
-
init_feature_flags();
|
|
74669
74629
|
init_auth_service();
|
|
74670
74630
|
init_api_client();
|
|
74671
74631
|
init_project_scaffold();
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/init.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,WAAW,EACX,sBAAsB,EACvB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/commands/init.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,WAAW,EACX,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAOrB,OAAO,EAEL,KAAK,EAEL,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,eAAe,EAIf,cAAc,EACf,MAAM,iCAAiC,CAAC;AAWzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,KAAK,aAAa,GACd,MAAM,GACN,UAAU,GACV,SAAS,GACT,KAAK,GACL,SAAS,GACT,OAAO,CAAC;AAQZ,yDAAyD;AACzD,iBAAS,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAErE;AAED,6EAA6E;AAC7E,iBAAe,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,MAAM,CAAC,UAAwB,EAC5C,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CA0BT;AAED,mEAAmE;AACnE,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qDAAqD;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,+CAA+C;IAC/C,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,8EAA8E;IAC9E,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,wEAAwE;IACxE,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,kEAAkE;IAClE,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,+CAA+C;IAC/C,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,4DAA4D;IAC5D,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,0DAA0D;IAC1D,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,2DAA2D;IAC3D,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,oDAAoD;IACpD,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,iEAAiE;IACjE,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,kEAAkE;IAClE,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,0EAA0E;IAC1E,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;CACpD;AAiBD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,kBAAkB,EAAE,sBAAsB,EAC1C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,GACzB,MAAM,EAAE,CAqDV;AA0FD;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,YAAY,GAAE,wBAA0D,EACxE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,EAC5E,6BAA6B,CAAC,EAAE,MAAM,IAAI,GACzC,OAAO,CAAC,kBAAkB,CAAC,CA0D7B;AAyND;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB7D"}
|
|
@@ -83,13 +83,6 @@ export interface ApiClient {
|
|
|
83
83
|
issueLicense(): Promise<{
|
|
84
84
|
licenseKey: string;
|
|
85
85
|
}>;
|
|
86
|
-
/**
|
|
87
|
-
* Registers the user's interest in threads access (mailing list signup).
|
|
88
|
-
*
|
|
89
|
-
* POSTs to `/api/cli/threads-interest`. The user is already authenticated,
|
|
90
|
-
* so this just records their opt-in on the server side.
|
|
91
|
-
*/
|
|
92
|
-
requestThreadsAccess(): Promise<void>;
|
|
93
86
|
}
|
|
94
87
|
/**
|
|
95
88
|
* Creates an HTTP client bound to the given base URL and optional bearer token.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,uCAAuC;IACvC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,0CAA0C;IAC1C,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAM3D;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,qDAAqD;IACrD,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAmBD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7D;;;;;;;OAOG;IACH,aAAa,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEhD;;;;OAIG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAElE;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,uCAAuC;IACvC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,0CAA0C;IAC1C,SAAgB,IAAI,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAM3D;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,qDAAqD;IACrD,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE;AAmBD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;OAQG;IACH,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE7D;;;;;;;OAOG;IACH,aAAa,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEhD;;;;OAIG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAElE;;;;;;;OAOG;IACH,YAAY,IAAI,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAmE1E"}
|
|
@@ -30,6 +30,37 @@ export declare function startCallbackServer(expectedState: string): Promise<{
|
|
|
30
30
|
resultPromise: Promise<CallbackResult>;
|
|
31
31
|
server: http.Server;
|
|
32
32
|
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Origin of the Clerk token resolved during a CLI login attempt.
|
|
35
|
+
*/
|
|
36
|
+
export type ClerkTokenSource = "callback" | "manual";
|
|
37
|
+
/**
|
|
38
|
+
* Races the loopback callback against an optional manual paste promise so
|
|
39
|
+
* either path can complete the login flow.
|
|
40
|
+
*
|
|
41
|
+
* Both inputs are guarded with rejection handlers because the loser may stay
|
|
42
|
+
* pending or reject after the winner is consumed; a hanging or rejected loser
|
|
43
|
+
* must not produce an unhandled rejection or block cleanup.
|
|
44
|
+
*
|
|
45
|
+
* @param resultPromise - Loopback callback result for the CLI auth state.
|
|
46
|
+
* @param manualClerkToken - Optional manual paste promise.
|
|
47
|
+
* @returns The resolved Clerk token and the path that produced it.
|
|
48
|
+
*/
|
|
49
|
+
export declare function raceForClerkToken(resultPromise: Promise<CallbackResult>, manualClerkToken: Promise<string> | undefined): Promise<{
|
|
50
|
+
clerkToken: string;
|
|
51
|
+
source: ClerkTokenSource;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Optional inputs that adjust how {@link login} resolves the Clerk token.
|
|
55
|
+
*/
|
|
56
|
+
export interface LoginOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Promise that resolves with a manually pasted Clerk token. Races against
|
|
59
|
+
* the loopback callback so the CLI can recover when the browser redirect
|
|
60
|
+
* never reaches the local callback server.
|
|
61
|
+
*/
|
|
62
|
+
manualClerkToken?: Promise<string>;
|
|
63
|
+
}
|
|
33
64
|
/**
|
|
34
65
|
* Launches the browser-based login flow, waits for the callback, exchanges
|
|
35
66
|
* the Clerk token for a CLI session token, persists the credentials, and
|
|
@@ -39,13 +70,15 @@ export declare function startCallbackServer(expectedState: string): Promise<{
|
|
|
39
70
|
* 1. Generate a random CSRF state token.
|
|
40
71
|
* 2. Start a local callback server.
|
|
41
72
|
* 3. Open the browser to the ops-frontend CLI auth page.
|
|
42
|
-
* 4. Wait for the callback with the Clerk token
|
|
73
|
+
* 4. Wait for the callback with the Clerk token, or accept a manually pasted
|
|
74
|
+
* token from {@link LoginOptions.manualClerkToken} when supplied.
|
|
43
75
|
* 5. Exchange the Clerk token for a CLI session via ops-api.
|
|
44
76
|
* 6. Persist credentials to the auth store.
|
|
45
77
|
*
|
|
78
|
+
* @param options - Optional login overrides such as a manual paste token.
|
|
46
79
|
* @returns The authenticated user and organization from the ops-api response.
|
|
47
80
|
*/
|
|
48
|
-
export declare function login(): Promise<{
|
|
81
|
+
export declare function login(options?: LoginOptions): Promise<{
|
|
49
82
|
user: {
|
|
50
83
|
id: string;
|
|
51
84
|
email: string;
|
|
@@ -55,6 +88,7 @@ export declare function login(): Promise<{
|
|
|
55
88
|
clerkOrgId: string;
|
|
56
89
|
organizationName?: string;
|
|
57
90
|
};
|
|
91
|
+
source: ClerkTokenSource;
|
|
58
92
|
}>;
|
|
59
93
|
export interface VerifyAndRefreshOptions {
|
|
60
94
|
/** When true, preserve the specific auth/session error instead of returning null. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/auth.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAmB,MAAM,iBAAiB,CAAC;AASlE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI7D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB,CAAC,CA8ID;AAED
|
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/auth.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAmB,MAAM,iBAAiB,CAAC;AASlE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI7D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;CACrB,CAAC,CA8ID;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,QAAQ,CAAC;AASrD;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,EACtC,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,GAC5C,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAqB3D;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC;IAC/D,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACzD,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC,CAiID;AAED,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,oFACsC,CAAC;AAEpF;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,cAAc,CAOzB;AAED;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAO9E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA2BvC;AAED;;;;;;GAMG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAa5C"}
|
|
@@ -7,7 +7,7 @@ export declare const BROWSER_LOGIN_CONFIRMATION_PROMPT = "Press Enter to continu
|
|
|
7
7
|
/** Browser login function shape shared by command flows. */
|
|
8
8
|
export type BrowserLoginRunner = typeof defaultLogin;
|
|
9
9
|
/** Rendered state for the shared browser-login interaction. */
|
|
10
|
-
export type BrowserLoginPhase = "idle" | "confirming" | "waiting" | "success" | "error";
|
|
10
|
+
export type BrowserLoginPhase = "idle" | "confirming" | "waiting" | "finalizing" | "success" | "error";
|
|
11
11
|
/** User and organization data displayed after a successful login. */
|
|
12
12
|
export interface BrowserLoginIdentity {
|
|
13
13
|
/** Authenticated user email. */
|
|
@@ -32,6 +32,8 @@ export interface BrowserLoginContextValue {
|
|
|
32
32
|
state: BrowserLoginState;
|
|
33
33
|
/** Confirms that the browser login may begin. */
|
|
34
34
|
confirmBrowserLoginStart: () => unknown;
|
|
35
|
+
/** Submits a manually pasted Clerk token to complete login when the loopback callback never fires. */
|
|
36
|
+
submitManualClerkToken: (clerkToken: string) => unknown;
|
|
35
37
|
}
|
|
36
38
|
/** Props for {@link BrowserLoginProvider}. */
|
|
37
39
|
export interface BrowserLoginProviderProps {
|
|
@@ -62,6 +64,8 @@ export declare function BrowserLoginProvider({ children, loginRunner, isInteract
|
|
|
62
64
|
* @throws When rendered outside {@link BrowserLoginProvider}.
|
|
63
65
|
*/
|
|
64
66
|
export declare function useBrowserLogin(): BrowserLoginContextValue;
|
|
67
|
+
/** Hint shown beneath the spinner so users know about the manual paste fallback. */
|
|
68
|
+
export declare const BROWSER_LOGIN_MANUAL_PASTE_LABEL = "If your browser finished sign-in but the CLI didn't notice, paste the code shown in the browser:";
|
|
65
69
|
/**
|
|
66
70
|
* Renders the shared browser-login confirmation and result states.
|
|
67
71
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-login.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/browser-login.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-login.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/browser-login.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIpE,yEAAyE;AACzE,eAAO,MAAM,kCAAkC,qEACW,CAAC;AAE3D,oDAAoD;AACpD,eAAO,MAAM,iCAAiC,+BAChB,CAAC;AAE/B,4DAA4D;AAC5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,YAAY,CAAC;AAErD,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,SAAS,GACT,OAAO,CAAC;AAUZ,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,KAAK,EAAE,iBAAiB,CAAC;IACzB,uDAAuD;IACvD,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,6DAA6D;AAC7D,MAAM,WAAW,wBAAwB;IACvC,mFAAmF;IACnF,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,iBAAiB,CAAC;IACzB,iDAAiD;IACjD,wBAAwB,EAAE,MAAM,OAAO,CAAC;IACxC,sGAAsG;IACtG,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CACzD;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA2BD;;;;GAIG;AACH,wBAAgB,qCAAqC,IAAI,OAAO,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,WAA0B,EAC1B,aAAa,GACd,EAAE,yBAAyB,GAAG,YAAY,CAoJ1C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,wBAAwB,CAO1D;AAED,oFAAoF;AACpF,eAAO,MAAM,gCAAgC,qGACuD,CAAC;AAErG;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,YAAY,GAAG,IAAI,CAkF9D"}
|
package/src/ui/init-flow.d.ts
CHANGED
|
@@ -14,13 +14,6 @@ export interface InitFlowProps {
|
|
|
14
14
|
* user cancels (future extension point).
|
|
15
15
|
*/
|
|
16
16
|
onComplete: (options: InitOptions | null) => void;
|
|
17
|
-
/**
|
|
18
|
-
* Callback invoked when the user wants to sign up for threads access.
|
|
19
|
-
*
|
|
20
|
-
* The init flow renders the mailing list screen; this callback fires the
|
|
21
|
-
* API request. When it resolves, the flow returns to the password screen.
|
|
22
|
-
*/
|
|
23
|
-
onRequestThreadsAccess: () => Promise<void>;
|
|
24
17
|
}
|
|
25
18
|
/**
|
|
26
19
|
* Ink component that steps through the interactive `init` prompts.
|
|
@@ -28,8 +21,8 @@ export interface InitFlowProps {
|
|
|
28
21
|
* Flow:
|
|
29
22
|
* 1. Project name
|
|
30
23
|
* 2. Do you want Intelligence?
|
|
31
|
-
* - Yes →
|
|
24
|
+
* - Yes → done with threads template
|
|
32
25
|
* - No → framework picker → done with framework template
|
|
33
26
|
*/
|
|
34
|
-
export declare function InitFlow({ initialName, initialIntelligence, initialFramework, onComplete,
|
|
27
|
+
export declare function InitFlow({ initialName, initialIntelligence, initialFramework, onComplete, }: InitFlowProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
28
|
//# sourceMappingURL=init-flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-flow.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/init-flow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"init-flow.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/init-flow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AAuB/D,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iEAAiE;IACjE,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,8DAA8D;IAC9D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;OAKG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAeD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,GACX,EAAE,aAAa,kDA8If"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Hardcoded password for threads access (temporary). */
|
|
2
|
-
export declare const THREADS_PASSWORD = "earlyaccess";
|
|
3
|
-
/**
|
|
4
|
-
* Checks whether the user has previously unlocked threads access.
|
|
5
|
-
*
|
|
6
|
-
* Reads the `threads-access` key from the global config store.
|
|
7
|
-
* Returns `false` when the key is absent or not `true`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function hasThreadsAccess(): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Grants threads access by writing `threads-access: true` to the global config.
|
|
12
|
-
*/
|
|
13
|
-
export declare function grantThreadsAccess(): void;
|
|
14
|
-
//# sourceMappingURL=feature-flags.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/services/feature-flags.ts"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|