@runtypelabs/cli 1.5.4 → 1.6.0
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/dist/index.js +371 -260
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2937,10 +2937,10 @@ ${userInput}`;
|
|
|
2937
2937
|
};
|
|
2938
2938
|
|
|
2939
2939
|
// src/ink/talk/TalkApp.tsx
|
|
2940
|
-
import { useState as
|
|
2940
|
+
import { useState as useState11, useEffect as useEffect9, useRef as useRef4 } from "react";
|
|
2941
2941
|
import fs3 from "fs";
|
|
2942
2942
|
import path3 from "path";
|
|
2943
|
-
import { Box as Box11, useApp as useApp3, useInput as useInput7, useStdout } from "ink";
|
|
2943
|
+
import { Box as Box11, useApp as useApp3, useInput as useInput7, useStdout as useStdout2 } from "ink";
|
|
2944
2944
|
import { StatusBar, ErrorDisplay as ErrorDisplay3, theme as theme12 } from "@runtypelabs/ink-components";
|
|
2945
2945
|
|
|
2946
2946
|
// src/ink/talk/useTalkStream.ts
|
|
@@ -3362,29 +3362,114 @@ function ChatInput({
|
|
|
3362
3362
|
}
|
|
3363
3363
|
|
|
3364
3364
|
// src/ink/talk/ModelPicker.tsx
|
|
3365
|
-
import {
|
|
3366
|
-
import
|
|
3365
|
+
import { useState as useState10, useMemo as useMemo2, useCallback as useCallback3 } from "react";
|
|
3366
|
+
import { Box as Box10, Text as Text11, useInput as useInput6, useStdout } from "ink";
|
|
3367
|
+
import TextInput2 from "ink-text-input";
|
|
3368
|
+
import open2 from "open";
|
|
3367
3369
|
import { theme as theme11 } from "@runtypelabs/ink-components";
|
|
3368
3370
|
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3369
|
-
var
|
|
3370
|
-
|
|
3371
|
-
{ label: "Claude
|
|
3372
|
-
{ label: "
|
|
3373
|
-
{ label: "
|
|
3374
|
-
|
|
3375
|
-
{ label: "
|
|
3371
|
+
var ALL_MODELS = [
|
|
3372
|
+
// Anthropic
|
|
3373
|
+
{ label: "Claude Opus 4.6", value: "claude-opus-4-6", group: "Anthropic" },
|
|
3374
|
+
{ label: "Claude Sonnet 4.6", value: "claude-sonnet-4-6", group: "Anthropic" },
|
|
3375
|
+
{ label: "Claude Haiku 4.5", value: "claude-haiku-4-5", group: "Anthropic" },
|
|
3376
|
+
// OpenAI
|
|
3377
|
+
{ label: "GPT-5", value: "gpt-5", group: "OpenAI" },
|
|
3378
|
+
{ label: "GPT-5 Mini", value: "gpt-5-mini", group: "OpenAI" },
|
|
3379
|
+
{ label: "GPT-4.1", value: "gpt-4.1", group: "OpenAI" },
|
|
3380
|
+
{ label: "GPT-4.1 Mini", value: "gpt-4.1-mini", group: "OpenAI" },
|
|
3381
|
+
{ label: "GPT-4.1 Nano", value: "gpt-4.1-nano", group: "OpenAI" },
|
|
3382
|
+
{ label: "GPT-5 Nano", value: "gpt-5-nano", group: "OpenAI" },
|
|
3383
|
+
// Google
|
|
3384
|
+
{ label: "Gemini 3.1 Pro", value: "gemini-3.1-pro", group: "Google" },
|
|
3385
|
+
{ label: "Gemini 3 Pro Image", value: "gemini-3-pro-image", group: "Google" },
|
|
3386
|
+
{ label: "Gemini 3 Flash", value: "gemini-3-flash", group: "Google" },
|
|
3387
|
+
{ label: "Gemini 2.5 Pro", value: "gemini-2.5-pro", group: "Google" },
|
|
3388
|
+
{ label: "Gemini 2.5 Flash", value: "gemini-2.5-flash", group: "Google" },
|
|
3389
|
+
{ label: "Gemini 2.5 Flash Image", value: "gemini-2.5-flash-image", group: "Google" },
|
|
3390
|
+
{ label: "Gemini 2.5 Flash-Lite", value: "gemini-2.5-flash-lite", group: "Google" },
|
|
3391
|
+
// xAI
|
|
3392
|
+
{ label: "Grok 4", value: "grok-4", group: "xAI" },
|
|
3393
|
+
{ label: "Grok 4 Fast", value: "grok-4-fast", group: "xAI" },
|
|
3394
|
+
{ label: "Grok 4.1 Fast", value: "grok-4.1-fast", group: "xAI" },
|
|
3395
|
+
// Qwen
|
|
3396
|
+
{ label: "Qwen 3.5 Plus", value: "qwen3.5-plus", group: "Qwen" },
|
|
3397
|
+
{ label: "Qwen 3.5 35B A3B", value: "qwen3.5-35b-a3b", group: "Qwen" },
|
|
3398
|
+
{ label: "Qwen 3.5 Flash", value: "qwen3.5-flash", group: "Qwen" },
|
|
3399
|
+
{ label: "Qwen 3 8B", value: "qwen/qwen3-8b", group: "Qwen" }
|
|
3376
3400
|
];
|
|
3401
|
+
var MAX_VISIBLE = 12;
|
|
3377
3402
|
function ModelPicker({ currentModel, onSelect, onCancel }) {
|
|
3403
|
+
const { stdout } = useStdout();
|
|
3404
|
+
const [search, setSearch] = useState10("");
|
|
3405
|
+
const [selectedIndex, setSelectedIndex] = useState10(0);
|
|
3406
|
+
const contentWidth = (stdout?.columns ?? 120) - 4;
|
|
3407
|
+
const pad = useCallback3(
|
|
3408
|
+
(text) => text.length < contentWidth ? text + " ".repeat(contentWidth - text.length) : text,
|
|
3409
|
+
[contentWidth]
|
|
3410
|
+
);
|
|
3411
|
+
const filtered = useMemo2(() => {
|
|
3412
|
+
if (!search.trim()) return ALL_MODELS;
|
|
3413
|
+
const q = search.toLowerCase();
|
|
3414
|
+
return ALL_MODELS.filter(
|
|
3415
|
+
(m) => m.label.toLowerCase().includes(q) || m.value.toLowerCase().includes(q) || m.group.toLowerCase().includes(q)
|
|
3416
|
+
);
|
|
3417
|
+
}, [search]);
|
|
3418
|
+
const handleSearchChange = (value) => {
|
|
3419
|
+
if (value === search) return;
|
|
3420
|
+
setSearch(value);
|
|
3421
|
+
setSelectedIndex(0);
|
|
3422
|
+
};
|
|
3378
3423
|
useInput6((_input, key) => {
|
|
3379
3424
|
if (key.escape) {
|
|
3380
3425
|
onCancel();
|
|
3426
|
+
return;
|
|
3427
|
+
}
|
|
3428
|
+
if (key.return) {
|
|
3429
|
+
if (filtered.length > 0) {
|
|
3430
|
+
onSelect(filtered[selectedIndex].value);
|
|
3431
|
+
}
|
|
3432
|
+
return;
|
|
3433
|
+
}
|
|
3434
|
+
if (key.upArrow) {
|
|
3435
|
+
setSelectedIndex((prev) => prev > 0 ? prev - 1 : filtered.length - 1);
|
|
3436
|
+
return;
|
|
3437
|
+
}
|
|
3438
|
+
if (key.downArrow) {
|
|
3439
|
+
setSelectedIndex((prev) => prev < filtered.length - 1 ? prev + 1 : 0);
|
|
3440
|
+
return;
|
|
3441
|
+
}
|
|
3442
|
+
if (key.tab) {
|
|
3443
|
+
void open2(`${getDashboardUrl()}/settings/models`);
|
|
3444
|
+
return;
|
|
3381
3445
|
}
|
|
3382
3446
|
});
|
|
3383
|
-
const
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3447
|
+
const MODEL_WINDOW = MAX_VISIBLE - 4;
|
|
3448
|
+
const modelWindowStart = Math.max(
|
|
3449
|
+
0,
|
|
3450
|
+
Math.min(
|
|
3451
|
+
selectedIndex - Math.floor(MODEL_WINDOW / 2),
|
|
3452
|
+
filtered.length - MODEL_WINDOW
|
|
3453
|
+
)
|
|
3454
|
+
);
|
|
3455
|
+
const modelWindowEnd = Math.min(modelWindowStart + MODEL_WINDOW, filtered.length);
|
|
3456
|
+
const rows = [];
|
|
3457
|
+
let lastGroup = "";
|
|
3458
|
+
for (let i = modelWindowStart; i < modelWindowEnd; i++) {
|
|
3459
|
+
const model = filtered[i];
|
|
3460
|
+
if (model.group !== lastGroup) {
|
|
3461
|
+
rows.push({ type: "group", label: model.group });
|
|
3462
|
+
lastGroup = model.group;
|
|
3463
|
+
}
|
|
3464
|
+
rows.push({
|
|
3465
|
+
type: "model",
|
|
3466
|
+
model,
|
|
3467
|
+
isHighlighted: i === selectedIndex,
|
|
3468
|
+
isCurrent: model.value === currentModel
|
|
3469
|
+
});
|
|
3470
|
+
}
|
|
3471
|
+
const showScrollUp = modelWindowStart > 0;
|
|
3472
|
+
const showScrollDown = modelWindowEnd < filtered.length;
|
|
3388
3473
|
return /* @__PURE__ */ jsxs9(
|
|
3389
3474
|
Box10,
|
|
3390
3475
|
{
|
|
@@ -3395,18 +3480,44 @@ function ModelPicker({ currentModel, onSelect, onCancel }) {
|
|
|
3395
3480
|
paddingY: theme11.panelPaddingY,
|
|
3396
3481
|
flexDirection: "column",
|
|
3397
3482
|
children: [
|
|
3398
|
-
/* @__PURE__ */
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3483
|
+
/* @__PURE__ */ jsxs9(Box10, { marginBottom: 1, children: [
|
|
3484
|
+
/* @__PURE__ */ jsx11(Text11, { color: theme11.accent, bold: true, children: "Select Model" }),
|
|
3485
|
+
/* @__PURE__ */ jsxs9(Text11, { color: theme11.textSubtle, children: [
|
|
3486
|
+
" ",
|
|
3487
|
+
filtered.length,
|
|
3488
|
+
" models"
|
|
3489
|
+
] })
|
|
3490
|
+
] }),
|
|
3491
|
+
/* @__PURE__ */ jsxs9(Box10, { marginBottom: 1, children: [
|
|
3492
|
+
/* @__PURE__ */ jsx11(Text11, { color: theme11.textSubtle, children: "/ " }),
|
|
3493
|
+
/* @__PURE__ */ jsx11(
|
|
3494
|
+
TextInput2,
|
|
3495
|
+
{
|
|
3496
|
+
value: search,
|
|
3497
|
+
onChange: handleSearchChange,
|
|
3498
|
+
placeholder: "Search models..."
|
|
3499
|
+
}
|
|
3500
|
+
)
|
|
3501
|
+
] }),
|
|
3502
|
+
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { color: theme11.textSubtle, children: pad(showScrollUp ? " ..." : "") }) }),
|
|
3503
|
+
/* @__PURE__ */ jsx11(Box10, { flexDirection: "column", height: MAX_VISIBLE, children: filtered.length === 0 ? /* @__PURE__ */ jsx11(Text11, { color: theme11.textSubtle, children: " No matching models" }) : rows.map((row) => {
|
|
3504
|
+
if (row.type === "group") {
|
|
3505
|
+
return /* @__PURE__ */ jsx11(Box10, { children: /* @__PURE__ */ jsx11(Text11, { color: theme11.textSubtle, dimColor: true, children: pad(` ${row.label}`) }) }, `group-${row.label}`);
|
|
3408
3506
|
}
|
|
3409
|
-
|
|
3507
|
+
const { model, isHighlighted, isCurrent } = row;
|
|
3508
|
+
const indicator = isHighlighted ? "\u203A " : " ";
|
|
3509
|
+
const suffix = isCurrent ? " *" : "";
|
|
3510
|
+
return /* @__PURE__ */ jsx11(Box10, { children: /* @__PURE__ */ jsx11(
|
|
3511
|
+
Text11,
|
|
3512
|
+
{
|
|
3513
|
+
color: isHighlighted ? theme11.accentActive : isCurrent ? theme11.accent : theme11.textMuted,
|
|
3514
|
+
bold: isHighlighted,
|
|
3515
|
+
children: pad(`${indicator}${model.label}${suffix}`)
|
|
3516
|
+
}
|
|
3517
|
+
) }, model.value);
|
|
3518
|
+
}) }),
|
|
3519
|
+
/* @__PURE__ */ jsx11(Box10, { height: 1, children: /* @__PURE__ */ jsx11(Text11, { color: theme11.textSubtle, children: pad(showScrollDown ? " ..." : "") }) }),
|
|
3520
|
+
/* @__PURE__ */ jsx11(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx11(Text11, { color: theme11.textSubtle, children: ["\u2191\u2193 navigate", "Enter select", "Tab manage models", "Esc cancel"].join(theme11.separator ?? " \xB7 ") }) })
|
|
3410
3521
|
]
|
|
3411
3522
|
}
|
|
3412
3523
|
);
|
|
@@ -3430,7 +3541,7 @@ function TalkApp({
|
|
|
3430
3541
|
}) {
|
|
3431
3542
|
const { state, callbacks, reset, contentRef } = useTalkStream();
|
|
3432
3543
|
const { exit } = useApp3();
|
|
3433
|
-
const { stdout } =
|
|
3544
|
+
const { stdout } = useStdout2();
|
|
3434
3545
|
const separator = theme12.separator ?? " \xB7 ";
|
|
3435
3546
|
useEffect9(() => {
|
|
3436
3547
|
streamRef.current = {
|
|
@@ -3438,16 +3549,16 @@ function TalkApp({
|
|
|
3438
3549
|
getState: () => state
|
|
3439
3550
|
};
|
|
3440
3551
|
});
|
|
3441
|
-
const [messages, setMessages] =
|
|
3442
|
-
const [scrollOffset, setScrollOffset] =
|
|
3443
|
-
const [enableMarkdown, setEnableMarkdown] =
|
|
3444
|
-
const [currentModel, setCurrentModel] =
|
|
3445
|
-
const [showModelPicker, setShowModelPicker] =
|
|
3552
|
+
const [messages, setMessages] = useState11([]);
|
|
3553
|
+
const [scrollOffset, setScrollOffset] = useState11(0);
|
|
3554
|
+
const [enableMarkdown, setEnableMarkdown] = useState11(initialMarkdown);
|
|
3555
|
+
const [currentModel, setCurrentModel] = useState11(model);
|
|
3556
|
+
const [showModelPicker, setShowModelPicker] = useState11(false);
|
|
3446
3557
|
const terminalWidth = stdout?.columns ?? 120;
|
|
3447
3558
|
const terminalRows = stdout?.rows ?? 40;
|
|
3448
3559
|
const contentHeight = Math.max(5, terminalRows - CHROME_ROWS);
|
|
3449
3560
|
const isStreaming = state.phase === "thinking" || state.phase === "streaming";
|
|
3450
|
-
const [ctrlCPressed, setCtrlCPressed] =
|
|
3561
|
+
const [ctrlCPressed, setCtrlCPressed] = useState11(false);
|
|
3451
3562
|
const ctrlCTimeout = useRef4(null);
|
|
3452
3563
|
function appendSystemMessage(text) {
|
|
3453
3564
|
setMessages((prev) => [
|
|
@@ -3827,8 +3938,8 @@ import { Command as Command8 } from "commander";
|
|
|
3827
3938
|
import chalk11 from "chalk";
|
|
3828
3939
|
import React9 from "react";
|
|
3829
3940
|
import { render as render7 } from "ink";
|
|
3830
|
-
import { useState as
|
|
3831
|
-
import
|
|
3941
|
+
import { useState as useState12, useEffect as useEffect10 } from "react";
|
|
3942
|
+
import open3 from "open";
|
|
3832
3943
|
function displayAgentCard(agentCard) {
|
|
3833
3944
|
console.log(chalk11.cyan("\nAgent Details:"));
|
|
3834
3945
|
console.log(` Name: ${agentCard.name}`);
|
|
@@ -3967,7 +4078,7 @@ productsCommand.command("init").description("Initialize a product from an extern
|
|
|
3967
4078
|
} else {
|
|
3968
4079
|
console.log(chalk11.cyan("\nOpening browser to complete setup..."));
|
|
3969
4080
|
}
|
|
3970
|
-
await
|
|
4081
|
+
await open3(targetUrl);
|
|
3971
4082
|
return;
|
|
3972
4083
|
}
|
|
3973
4084
|
const createResult = await createProduct(
|
|
@@ -4001,11 +4112,11 @@ productsCommand.command("init").description("Initialize a product from an extern
|
|
|
4001
4112
|
return;
|
|
4002
4113
|
}
|
|
4003
4114
|
const ProductInitApp = () => {
|
|
4004
|
-
const [loading, setLoading] =
|
|
4005
|
-
const [loadingLabel, setLoadingLabel] =
|
|
4006
|
-
const [success, setSuccess] =
|
|
4007
|
-
const [error, setError] =
|
|
4008
|
-
const [resultNode, setResultNode] =
|
|
4115
|
+
const [loading, setLoading] = useState12(!!options.from);
|
|
4116
|
+
const [loadingLabel, setLoadingLabel] = useState12("Validating URL...");
|
|
4117
|
+
const [success, setSuccess] = useState12(null);
|
|
4118
|
+
const [error, setError] = useState12(null);
|
|
4119
|
+
const [resultNode, setResultNode] = useState12(void 0);
|
|
4009
4120
|
useEffect10(() => {
|
|
4010
4121
|
if (!options.from) return void 0;
|
|
4011
4122
|
const run = async () => {
|
|
@@ -4029,7 +4140,7 @@ productsCommand.command("init").description("Initialize a product from an extern
|
|
|
4029
4140
|
const dashboardUrl2 = getDashboardUrl();
|
|
4030
4141
|
const encodedUrl = encodeURIComponent(options.from);
|
|
4031
4142
|
const targetUrl = `${dashboardUrl2}/now?from=${encodedUrl}&cli=true`;
|
|
4032
|
-
await
|
|
4143
|
+
await open3(targetUrl);
|
|
4033
4144
|
setSuccess(true);
|
|
4034
4145
|
setLoading(false);
|
|
4035
4146
|
setResultNode(
|
|
@@ -4130,10 +4241,10 @@ import { render as render8 } from "ink";
|
|
|
4130
4241
|
|
|
4131
4242
|
// src/ink/init/InitApp.tsx
|
|
4132
4243
|
init_credential_store();
|
|
4133
|
-
import { useState as
|
|
4244
|
+
import { useState as useState13, useEffect as useEffect11, useCallback as useCallback4 } from "react";
|
|
4134
4245
|
import { Box as Box14, Text as Text14, useApp as useApp4, useInput as useInput8 } from "ink";
|
|
4135
|
-
import
|
|
4136
|
-
import
|
|
4246
|
+
import TextInput3 from "ink-text-input";
|
|
4247
|
+
import SelectInput2 from "ink-select-input";
|
|
4137
4248
|
import { Spinner as Spinner4, theme as theme15 } from "@runtypelabs/ink-components";
|
|
4138
4249
|
|
|
4139
4250
|
// src/ink/init/WizardStep.tsx
|
|
@@ -4189,7 +4300,7 @@ function getStepNumber(step) {
|
|
|
4189
4300
|
}
|
|
4190
4301
|
function InitApp({ apiUrl, onComplete }) {
|
|
4191
4302
|
const { exit } = useApp4();
|
|
4192
|
-
const [state, setState] =
|
|
4303
|
+
const [state, setState] = useState13({
|
|
4193
4304
|
step: 0,
|
|
4194
4305
|
authMethod: null,
|
|
4195
4306
|
apiKey: null,
|
|
@@ -4205,7 +4316,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4205
4316
|
complete: false,
|
|
4206
4317
|
createdProductId: null
|
|
4207
4318
|
});
|
|
4208
|
-
const getSummary =
|
|
4319
|
+
const getSummary = useCallback4(() => {
|
|
4209
4320
|
const answers = [];
|
|
4210
4321
|
if (state.authMethod) {
|
|
4211
4322
|
const labels = {
|
|
@@ -4276,7 +4387,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4276
4387
|
},
|
|
4277
4388
|
{ isActive: !state.loading && !state.complete }
|
|
4278
4389
|
);
|
|
4279
|
-
const handleAuthMethodSelect =
|
|
4390
|
+
const handleAuthMethodSelect = useCallback4(
|
|
4280
4391
|
(item) => {
|
|
4281
4392
|
const method = item.value;
|
|
4282
4393
|
setState((prev) => ({
|
|
@@ -4335,7 +4446,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4335
4446
|
},
|
|
4336
4447
|
[apiUrl]
|
|
4337
4448
|
);
|
|
4338
|
-
const handleApiKeySubmit =
|
|
4449
|
+
const handleApiKeySubmit = useCallback4(
|
|
4339
4450
|
(value) => {
|
|
4340
4451
|
if (!value.trim()) {
|
|
4341
4452
|
setState((prev) => ({ ...prev, error: "API key is required" }));
|
|
@@ -4390,7 +4501,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4390
4501
|
},
|
|
4391
4502
|
[apiUrl]
|
|
4392
4503
|
);
|
|
4393
|
-
const handleProductChoice =
|
|
4504
|
+
const handleProductChoice = useCallback4(
|
|
4394
4505
|
(item) => {
|
|
4395
4506
|
const choice = item.value;
|
|
4396
4507
|
setState((prev) => ({
|
|
@@ -4405,7 +4516,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4405
4516
|
},
|
|
4406
4517
|
[]
|
|
4407
4518
|
);
|
|
4408
|
-
const handleUrlSubmit =
|
|
4519
|
+
const handleUrlSubmit = useCallback4(
|
|
4409
4520
|
(value) => {
|
|
4410
4521
|
if (!value.trim()) {
|
|
4411
4522
|
setState((prev) => ({ ...prev, error: "URL is required" }));
|
|
@@ -4472,14 +4583,14 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4472
4583
|
},
|
|
4473
4584
|
[apiUrl]
|
|
4474
4585
|
);
|
|
4475
|
-
const handleConfirmCreate =
|
|
4586
|
+
const handleConfirmCreate = useCallback4((confirmed) => {
|
|
4476
4587
|
if (!confirmed) {
|
|
4477
4588
|
setState((prev) => ({ ...prev, step: 8, complete: true }));
|
|
4478
4589
|
return;
|
|
4479
4590
|
}
|
|
4480
4591
|
setState((prev) => ({ ...prev, step: 6 }));
|
|
4481
4592
|
}, []);
|
|
4482
|
-
const handleProductNameSubmit =
|
|
4593
|
+
const handleProductNameSubmit = useCallback4(
|
|
4483
4594
|
(value) => {
|
|
4484
4595
|
const name = value.trim() || state.agentCard?.name || "My Product";
|
|
4485
4596
|
setState((prev) => ({
|
|
@@ -4579,7 +4690,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4579
4690
|
children: /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
|
|
4580
4691
|
state.error && /* @__PURE__ */ jsx15(Text14, { color: theme15.error, children: state.error }),
|
|
4581
4692
|
/* @__PURE__ */ jsx15(
|
|
4582
|
-
|
|
4693
|
+
SelectInput2,
|
|
4583
4694
|
{
|
|
4584
4695
|
items: [
|
|
4585
4696
|
{ label: "Create a new account", value: "signup" },
|
|
@@ -4609,7 +4720,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4609
4720
|
state.loading ? /* @__PURE__ */ jsx15(Spinner4, { label: state.loadingLabel }) : /* @__PURE__ */ jsxs13(Box14, { children: [
|
|
4610
4721
|
/* @__PURE__ */ jsx15(Text14, { color: theme15.muted, children: "> " }),
|
|
4611
4722
|
/* @__PURE__ */ jsx15(
|
|
4612
|
-
|
|
4723
|
+
TextInput3,
|
|
4613
4724
|
{
|
|
4614
4725
|
value: state.apiKeyInput,
|
|
4615
4726
|
onChange: (value) => setState((prev) => ({
|
|
@@ -4650,7 +4761,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4650
4761
|
totalSteps: TOTAL_VISIBLE_STEPS,
|
|
4651
4762
|
title: "What would you like to do?",
|
|
4652
4763
|
children: /* @__PURE__ */ jsx15(
|
|
4653
|
-
|
|
4764
|
+
SelectInput2,
|
|
4654
4765
|
{
|
|
4655
4766
|
items: [
|
|
4656
4767
|
{ label: "Import A2A agent URL", value: "url" },
|
|
@@ -4677,7 +4788,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4677
4788
|
state.loading ? /* @__PURE__ */ jsx15(Spinner4, { label: state.loadingLabel }) : /* @__PURE__ */ jsxs13(Box14, { children: [
|
|
4678
4789
|
/* @__PURE__ */ jsx15(Text14, { color: theme15.muted, children: "> " }),
|
|
4679
4790
|
/* @__PURE__ */ jsx15(
|
|
4680
|
-
|
|
4791
|
+
TextInput3,
|
|
4681
4792
|
{
|
|
4682
4793
|
value: state.urlInput,
|
|
4683
4794
|
onChange: (value) => setState((prev) => ({
|
|
@@ -4756,7 +4867,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4756
4867
|
/* @__PURE__ */ jsxs13(Box14, { children: [
|
|
4757
4868
|
/* @__PURE__ */ jsx15(Text14, { color: theme15.muted, children: "> " }),
|
|
4758
4869
|
/* @__PURE__ */ jsx15(
|
|
4759
|
-
|
|
4870
|
+
TextInput3,
|
|
4760
4871
|
{
|
|
4761
4872
|
value: state.productName,
|
|
4762
4873
|
onChange: (value) => setState((prev) => ({
|
|
@@ -4857,7 +4968,7 @@ function InitApp({ apiUrl, onComplete }) {
|
|
|
4857
4968
|
function ConfirmInput({
|
|
4858
4969
|
onConfirm
|
|
4859
4970
|
}) {
|
|
4860
|
-
const [answered, setAnswered] =
|
|
4971
|
+
const [answered, setAnswered] = useState13(false);
|
|
4861
4972
|
useInput8(
|
|
4862
4973
|
(input) => {
|
|
4863
4974
|
if (answered) return;
|
|
@@ -4961,7 +5072,7 @@ import { Command as Command10 } from "commander";
|
|
|
4961
5072
|
import chalk12 from "chalk";
|
|
4962
5073
|
import React11 from "react";
|
|
4963
5074
|
import { render as render9 } from "ink";
|
|
4964
|
-
import { useState as
|
|
5075
|
+
import { useState as useState14, useEffect as useEffect12 } from "react";
|
|
4965
5076
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4966
5077
|
import { processStream as processStream4 } from "@runtypelabs/sdk";
|
|
4967
5078
|
var dispatchCommand = new Command10("dispatch").description("Execute a flow or agent via the dispatch API").option("-f, --flow <id>", "Flow ID to execute").option("-a, --agent <id>", "Agent ID to execute").option("-r, --record <id>", "Existing record ID").option("--record-json <file>", "JSON file with record data").option("-m, --message <text>", "Message to send").option("-v, --variable <key=value>", "Set a variable (repeatable)", collectVariables, []).option("--stream", "Stream the response (default)", true).option("--no-stream", "Wait for complete response").option("--json", "Output as JSON").option("--debug", "Show step-level details").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
@@ -5088,9 +5199,9 @@ async function handleNonStreaming(client, payload, options) {
|
|
|
5088
5199
|
return;
|
|
5089
5200
|
}
|
|
5090
5201
|
const App = () => {
|
|
5091
|
-
const [loading, setLoading] =
|
|
5092
|
-
const [success, setSuccess] =
|
|
5093
|
-
const [error, setError] =
|
|
5202
|
+
const [loading, setLoading] = useState14(true);
|
|
5203
|
+
const [success, setSuccess] = useState14(null);
|
|
5204
|
+
const [error, setError] = useState14(null);
|
|
5094
5205
|
useEffect12(() => {
|
|
5095
5206
|
const run = async () => {
|
|
5096
5207
|
try {
|
|
@@ -5141,7 +5252,7 @@ import { Command as Command12 } from "commander";
|
|
|
5141
5252
|
import chalk17 from "chalk";
|
|
5142
5253
|
import React13 from "react";
|
|
5143
5254
|
import { render as render11 } from "ink";
|
|
5144
|
-
import { useState as
|
|
5255
|
+
import { useState as useState21, useEffect as useEffect18 } from "react";
|
|
5145
5256
|
import { processStream as processStream5 } from "@runtypelabs/sdk";
|
|
5146
5257
|
|
|
5147
5258
|
// src/commands/agents-task.ts
|
|
@@ -5151,15 +5262,15 @@ import { render as render10 } from "ink";
|
|
|
5151
5262
|
import React12 from "react";
|
|
5152
5263
|
|
|
5153
5264
|
// src/ink/marathon/MarathonApp.tsx
|
|
5154
|
-
import { useState as
|
|
5265
|
+
import { useState as useState20, useEffect as useEffect17, useRef as useRef8, useCallback as useCallback7, useMemo as useMemo6 } from "react";
|
|
5155
5266
|
import { execSync } from "child_process";
|
|
5156
|
-
import
|
|
5157
|
-
import { Box as Box24, useApp as useApp5, useInput as useInput9, useStdout as
|
|
5267
|
+
import open4 from "open";
|
|
5268
|
+
import { Box as Box24, useApp as useApp5, useInput as useInput9, useStdout as useStdout3 } from "ink";
|
|
5158
5269
|
import { StreamOutput as StreamOutput3, StatusBar as StatusBar2, ErrorDisplay as ErrorDisplay4, theme as theme27 } from "@runtypelabs/ink-components";
|
|
5159
5270
|
import { LoadingAnimation } from "@runtypelabs/terminal-animations";
|
|
5160
5271
|
|
|
5161
5272
|
// src/ink/marathon/useMarathonStream.ts
|
|
5162
|
-
import { useState as
|
|
5273
|
+
import { useState as useState15, useRef as useRef5, useMemo as useMemo3, useCallback as useCallback5 } from "react";
|
|
5163
5274
|
|
|
5164
5275
|
// src/ink/marathon/transcript-utils.ts
|
|
5165
5276
|
function appendTranscriptText(content, delta, previousKind) {
|
|
@@ -5202,10 +5313,10 @@ function pushRawEvent(prev, type, data) {
|
|
|
5202
5313
|
}
|
|
5203
5314
|
var toolCounter = 0;
|
|
5204
5315
|
function useMarathonStream() {
|
|
5205
|
-
const [state, setState] =
|
|
5316
|
+
const [state, setState] = useState15(INITIAL_STATE2);
|
|
5206
5317
|
const stateRef = useRef5(state);
|
|
5207
5318
|
stateRef.current = state;
|
|
5208
|
-
const callbacks =
|
|
5319
|
+
const callbacks = useMemo3(
|
|
5209
5320
|
() => ({
|
|
5210
5321
|
onAgentStart() {
|
|
5211
5322
|
setState((prev) => ({
|
|
@@ -5338,13 +5449,13 @@ function useMarathonStream() {
|
|
|
5338
5449
|
}),
|
|
5339
5450
|
[]
|
|
5340
5451
|
);
|
|
5341
|
-
const reset =
|
|
5452
|
+
const reset = useCallback5(() => {
|
|
5342
5453
|
setState(INITIAL_STATE2);
|
|
5343
5454
|
}, []);
|
|
5344
|
-
const setSteering =
|
|
5455
|
+
const setSteering = useCallback5(() => {
|
|
5345
5456
|
setState((prev) => ({ ...prev, phase: "steering" }));
|
|
5346
5457
|
}, []);
|
|
5347
|
-
const resetForNewSession =
|
|
5458
|
+
const resetForNewSession = useCallback5(() => {
|
|
5348
5459
|
setState((prev) => ({
|
|
5349
5460
|
...prev,
|
|
5350
5461
|
phase: "idle",
|
|
@@ -5357,7 +5468,7 @@ function useMarathonStream() {
|
|
|
5357
5468
|
error: null
|
|
5358
5469
|
}));
|
|
5359
5470
|
}, []);
|
|
5360
|
-
const showError =
|
|
5471
|
+
const showError = useCallback5((error) => {
|
|
5361
5472
|
setState((prev) => ({
|
|
5362
5473
|
...prev,
|
|
5363
5474
|
phase: "error",
|
|
@@ -5373,7 +5484,7 @@ import { Box as Box15, Text as Text15 } from "ink";
|
|
|
5373
5484
|
import { theme as theme17 } from "@runtypelabs/ink-components";
|
|
5374
5485
|
|
|
5375
5486
|
// src/ink/marathon/RunnerTrack.tsx
|
|
5376
|
-
import { useState as
|
|
5487
|
+
import { useState as useState16, useEffect as useEffect13, useRef as useRef6, useCallback as useCallback6 } from "react";
|
|
5377
5488
|
import { theme as theme16 } from "@runtypelabs/ink-components";
|
|
5378
5489
|
var TRAIL_CHARS = ["\u2022", "\xB7", "."];
|
|
5379
5490
|
var BORDER_H = "\u2500";
|
|
@@ -5393,11 +5504,11 @@ function useRunnerTrack({
|
|
|
5393
5504
|
}) {
|
|
5394
5505
|
const innerWidth = Math.max(4, width - 2);
|
|
5395
5506
|
const perimeter = innerWidth * 2;
|
|
5396
|
-
const [position, setPosition] =
|
|
5507
|
+
const [position, setPosition] = useState16(
|
|
5397
5508
|
() => Math.min(initialPosition, perimeter - 1)
|
|
5398
5509
|
);
|
|
5399
|
-
const [laps, setLaps] =
|
|
5400
|
-
const [elapsed, setElapsed] =
|
|
5510
|
+
const [laps, setLaps] = useState16(initialLaps);
|
|
5511
|
+
const [elapsed, setElapsed] = useState16(0);
|
|
5401
5512
|
const startTimeRef = useRef6(Date.now());
|
|
5402
5513
|
const onPositionChangeRef = useRef6(onPositionChange);
|
|
5403
5514
|
onPositionChangeRef.current = onPositionChange;
|
|
@@ -5430,7 +5541,7 @@ function useRunnerTrack({
|
|
|
5430
5541
|
return () => clearInterval(interval);
|
|
5431
5542
|
}, [isAnimating, perimeter, laps]);
|
|
5432
5543
|
const finishPosition = Math.floor(innerWidth / 2);
|
|
5433
|
-
const getRowCol =
|
|
5544
|
+
const getRowCol = useCallback6(
|
|
5434
5545
|
(pos) => {
|
|
5435
5546
|
if (pos < innerWidth) {
|
|
5436
5547
|
return { row: "top", col: pos };
|
|
@@ -5655,11 +5766,11 @@ function SessionTabs({ tabs, hiddenLeft, hiddenRight }) {
|
|
|
5655
5766
|
}
|
|
5656
5767
|
|
|
5657
5768
|
// src/ink/marathon/ThinkingIndicator.tsx
|
|
5658
|
-
import { useState as
|
|
5769
|
+
import { useState as useState17, useEffect as useEffect14 } from "react";
|
|
5659
5770
|
import { Spinner as Spinner5, theme as theme19 } from "@runtypelabs/ink-components";
|
|
5660
5771
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
5661
5772
|
function ThinkingIndicator({ startedAt }) {
|
|
5662
|
-
const [elapsed, setElapsed] =
|
|
5773
|
+
const [elapsed, setElapsed] = useState17(
|
|
5663
5774
|
() => startedAt ? Math.floor((Date.now() - startedAt) / 1e3) : 0
|
|
5664
5775
|
);
|
|
5665
5776
|
useEffect14(() => {
|
|
@@ -5674,7 +5785,7 @@ function ThinkingIndicator({ startedAt }) {
|
|
|
5674
5785
|
}
|
|
5675
5786
|
|
|
5676
5787
|
// src/ink/marathon/ToolPanel.tsx
|
|
5677
|
-
import { useState as
|
|
5788
|
+
import { useState as useState18, useEffect as useEffect15, useMemo as useMemo4 } from "react";
|
|
5678
5789
|
import { Box as Box19, Text as Text19 } from "ink";
|
|
5679
5790
|
import { theme as theme22 } from "@runtypelabs/ink-components";
|
|
5680
5791
|
|
|
@@ -5773,9 +5884,9 @@ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
|
5773
5884
|
var ROWS_PER_TOOL = 3;
|
|
5774
5885
|
var REASONING_PREVIEW_LINES = 4;
|
|
5775
5886
|
function ToolPanel({ tools, reasoning, maxHeight }) {
|
|
5776
|
-
const [now, setNow] =
|
|
5887
|
+
const [now, setNow] = useState18(Date.now());
|
|
5777
5888
|
const hasRunning = tools.some((t) => t.status === "running");
|
|
5778
|
-
const reasoningLines =
|
|
5889
|
+
const reasoningLines = useMemo4(
|
|
5779
5890
|
() => getVisibleReasoningLines(reasoning || "", REASONING_PREVIEW_LINES),
|
|
5780
5891
|
[reasoning]
|
|
5781
5892
|
);
|
|
@@ -5786,7 +5897,7 @@ function ToolPanel({ tools, reasoning, maxHeight }) {
|
|
|
5786
5897
|
}, 100);
|
|
5787
5898
|
return () => clearInterval(interval);
|
|
5788
5899
|
}, [hasRunning]);
|
|
5789
|
-
const visibleTools =
|
|
5900
|
+
const visibleTools = useMemo4(() => {
|
|
5790
5901
|
if (!maxHeight) return tools;
|
|
5791
5902
|
const reasoningRows = reasoningLines.length > 0 ? 1 + reasoningLines.length + 1 : 0;
|
|
5792
5903
|
const availableRows = maxHeight - 1 - reasoningRows;
|
|
@@ -5808,7 +5919,7 @@ function ToolPanel({ tools, reasoning, maxHeight }) {
|
|
|
5808
5919
|
}
|
|
5809
5920
|
|
|
5810
5921
|
// src/ink/marathon/EventStreamPanel.tsx
|
|
5811
|
-
import { useMemo as
|
|
5922
|
+
import { useMemo as useMemo5 } from "react";
|
|
5812
5923
|
import { Box as Box20, Text as Text20 } from "ink";
|
|
5813
5924
|
import { theme as theme23 } from "@runtypelabs/ink-components";
|
|
5814
5925
|
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -5843,7 +5954,7 @@ function EventDetailView({
|
|
|
5843
5954
|
scrollOffset = 0
|
|
5844
5955
|
}) {
|
|
5845
5956
|
const separator = theme23.separator ?? " \xB7 ";
|
|
5846
|
-
const { lines, totalLines } =
|
|
5957
|
+
const { lines, totalLines } = useMemo5(() => {
|
|
5847
5958
|
const json = JSON.stringify(event.data, null, 2);
|
|
5848
5959
|
const allLines = json.split("\n");
|
|
5849
5960
|
const total = allLines.length;
|
|
@@ -5901,7 +6012,7 @@ function EventStreamPanel({
|
|
|
5901
6012
|
}
|
|
5902
6013
|
);
|
|
5903
6014
|
}
|
|
5904
|
-
const { rows, hiddenAbove, hiddenBelow } =
|
|
6015
|
+
const { rows, hiddenAbove, hiddenBelow } = useMemo5(() => {
|
|
5905
6016
|
if (events.length === 0) return { rows: [], hiddenAbove: 0, hiddenBelow: 0 };
|
|
5906
6017
|
const total = events.length;
|
|
5907
6018
|
const half = Math.floor(maxVisibleLines / 2);
|
|
@@ -5980,9 +6091,9 @@ function EventStreamPanel({
|
|
|
5980
6091
|
}
|
|
5981
6092
|
|
|
5982
6093
|
// src/ink/marathon/SteeringPrompt.tsx
|
|
5983
|
-
import { useState as
|
|
6094
|
+
import { useState as useState19, useEffect as useEffect16, useRef as useRef7 } from "react";
|
|
5984
6095
|
import { Box as Box22, Text as Text22 } from "ink";
|
|
5985
|
-
import
|
|
6096
|
+
import TextInput4 from "ink-text-input";
|
|
5986
6097
|
import { theme as theme25 } from "@runtypelabs/ink-components";
|
|
5987
6098
|
|
|
5988
6099
|
// src/ink/marathon/SteeringRecap.tsx
|
|
@@ -6046,11 +6157,11 @@ function SteeringPrompt({
|
|
|
6046
6157
|
currentSandbox: _currentSandbox,
|
|
6047
6158
|
recap
|
|
6048
6159
|
}) {
|
|
6049
|
-
const [value, setValue] =
|
|
6050
|
-
const [remaining, setRemaining] =
|
|
6051
|
-
const [isTyping, setIsTyping] =
|
|
6052
|
-
const [showModelPicker, setShowModelPicker] =
|
|
6053
|
-
const [showHelp, setShowHelp] =
|
|
6160
|
+
const [value, setValue] = useState19("");
|
|
6161
|
+
const [remaining, setRemaining] = useState19(timeout);
|
|
6162
|
+
const [isTyping, setIsTyping] = useState19(false);
|
|
6163
|
+
const [showModelPicker, setShowModelPicker] = useState19(false);
|
|
6164
|
+
const [showHelp, setShowHelp] = useState19(false);
|
|
6054
6165
|
const timerRef = useRef7(null);
|
|
6055
6166
|
const separator = theme25.separator ?? " \xB7 ";
|
|
6056
6167
|
useEffect16(() => {
|
|
@@ -6153,7 +6264,7 @@ function SteeringPrompt({
|
|
|
6153
6264
|
/* @__PURE__ */ jsxs20(Box22, { children: [
|
|
6154
6265
|
/* @__PURE__ */ jsx24(Text22, { color: theme25.accentActive, children: "> " }),
|
|
6155
6266
|
/* @__PURE__ */ jsx24(Box22, { flexGrow: 1, children: /* @__PURE__ */ jsx24(
|
|
6156
|
-
|
|
6267
|
+
TextInput4,
|
|
6157
6268
|
{
|
|
6158
6269
|
value,
|
|
6159
6270
|
onChange: handleChange,
|
|
@@ -6472,25 +6583,25 @@ function MarathonApp({
|
|
|
6472
6583
|
}) {
|
|
6473
6584
|
const { state, callbacks, reset: _reset, setSteering, resetForNewSession, showError } = useMarathonStream();
|
|
6474
6585
|
const { exit } = useApp5();
|
|
6475
|
-
const { stdout } =
|
|
6586
|
+
const { stdout } = useStdout3();
|
|
6476
6587
|
const separator = theme27.separator ?? " \xB7 ";
|
|
6477
6588
|
const steeringResolveRef = useRef8(null);
|
|
6478
|
-
const [steeringRecap, setSteeringRecap] =
|
|
6479
|
-
const [currentModel, setCurrentModel] =
|
|
6480
|
-
const [currentSandbox, setCurrentSandbox] =
|
|
6481
|
-
const [isTerminalSteering, setIsTerminalSteering] =
|
|
6482
|
-
const [sessionSnapshots, setSessionSnapshots] =
|
|
6589
|
+
const [steeringRecap, setSteeringRecap] = useState20(null);
|
|
6590
|
+
const [currentModel, setCurrentModel] = useState20(model || "default");
|
|
6591
|
+
const [currentSandbox, setCurrentSandbox] = useState20(sandbox);
|
|
6592
|
+
const [isTerminalSteering, setIsTerminalSteering] = useState20(false);
|
|
6593
|
+
const [sessionSnapshots, setSessionSnapshots] = useState20(
|
|
6483
6594
|
() => (initialSessionSnapshots || []).map((snapshot) => cloneSessionSnapshot(snapshot))
|
|
6484
6595
|
);
|
|
6485
|
-
const [selectedSessionKey, setSelectedSessionKey] =
|
|
6486
|
-
const [followLatest, setFollowLatest] =
|
|
6487
|
-
const [latestUnreadKey, setLatestUnreadKey] =
|
|
6488
|
-
const [previewUrl, setPreviewUrl] =
|
|
6489
|
-
const [runnerPosition, setRunnerPosition] =
|
|
6490
|
-
const [runnerLaps, setRunnerLaps] =
|
|
6596
|
+
const [selectedSessionKey, setSelectedSessionKey] = useState20(void 0);
|
|
6597
|
+
const [followLatest, setFollowLatest] = useState20(true);
|
|
6598
|
+
const [latestUnreadKey, setLatestUnreadKey] = useState20(void 0);
|
|
6599
|
+
const [previewUrl, setPreviewUrl] = useState20(void 0);
|
|
6600
|
+
const [runnerPosition, setRunnerPosition] = useState20(initialRunnerPosition ?? 0);
|
|
6601
|
+
const [runnerLaps, setRunnerLaps] = useState20(initialRunnerLaps ?? 0);
|
|
6491
6602
|
const runnerPositionRef = useRef8(initialRunnerPosition ?? 0);
|
|
6492
6603
|
const runnerLapsRef = useRef8(initialRunnerLaps ?? 0);
|
|
6493
|
-
const handleRunnerPositionChange =
|
|
6604
|
+
const handleRunnerPositionChange = useCallback7((position, laps) => {
|
|
6494
6605
|
setRunnerPosition(position);
|
|
6495
6606
|
setRunnerLaps(laps);
|
|
6496
6607
|
runnerPositionRef.current = position;
|
|
@@ -6498,7 +6609,7 @@ function MarathonApp({
|
|
|
6498
6609
|
}, []);
|
|
6499
6610
|
const isRunnerAnimating = state.phase === "thinking" || state.phase === "streaming" || state.phase === "tool";
|
|
6500
6611
|
const isTerminalSteeringRef = useRef8(false);
|
|
6501
|
-
const handleSteeringSubmit =
|
|
6612
|
+
const handleSteeringSubmit = useCallback7(
|
|
6502
6613
|
(result) => {
|
|
6503
6614
|
if (result.action === "model" && result.model) {
|
|
6504
6615
|
setCurrentModel(result.model);
|
|
@@ -6571,17 +6682,17 @@ function MarathonApp({
|
|
|
6571
6682
|
const contentHeight = Math.max(5, terminalRows - chromeRows);
|
|
6572
6683
|
const isStacked = terminalWidth < STACKED_THRESHOLD;
|
|
6573
6684
|
const toolPanelWidth = terminalWidth < NARROW_THRESHOLD ? TOOL_PANEL_NARROW : TOOL_PANEL_WIDE;
|
|
6574
|
-
const [ctrlCPressed, setCtrlCPressed] =
|
|
6685
|
+
const [ctrlCPressed, setCtrlCPressed] = useState20(false);
|
|
6575
6686
|
const ctrlCTimeout = useRef8(null);
|
|
6576
|
-
const [showEventStream, setShowEventStream] =
|
|
6577
|
-
const [scrollOffset, setScrollOffset] =
|
|
6578
|
-
const [reasoningCollapsed, setReasoningCollapsed] =
|
|
6579
|
-
const [eventCursor, setEventCursor] =
|
|
6580
|
-
const [detailEvent, setDetailEvent] =
|
|
6581
|
-
const [detailScrollOffset, setDetailScrollOffset] =
|
|
6582
|
-
const [goalExpanded, setGoalExpanded] =
|
|
6583
|
-
const [upgradeModalDismissed, setUpgradeModalDismissed] =
|
|
6584
|
-
const [clipboardFlash, setClipboardFlash] =
|
|
6687
|
+
const [showEventStream, setShowEventStream] = useState20(false);
|
|
6688
|
+
const [scrollOffset, setScrollOffset] = useState20(0);
|
|
6689
|
+
const [reasoningCollapsed, setReasoningCollapsed] = useState20(false);
|
|
6690
|
+
const [eventCursor, setEventCursor] = useState20(-1);
|
|
6691
|
+
const [detailEvent, setDetailEvent] = useState20(null);
|
|
6692
|
+
const [detailScrollOffset, setDetailScrollOffset] = useState20(0);
|
|
6693
|
+
const [goalExpanded, setGoalExpanded] = useState20(false);
|
|
6694
|
+
const [upgradeModalDismissed, setUpgradeModalDismissed] = useState20(false);
|
|
6695
|
+
const [clipboardFlash, setClipboardFlash] = useState20(null);
|
|
6585
6696
|
const flashTimeout = useRef8(null);
|
|
6586
6697
|
const billingPageUrl = billingUrl || `${(dashboardUrl || "https://use.runtype.com").replace(/\/$/, "")}/settings/billing`;
|
|
6587
6698
|
function showFlash(msg) {
|
|
@@ -6591,21 +6702,21 @@ function MarathonApp({
|
|
|
6591
6702
|
}
|
|
6592
6703
|
const latestCompletedSessionIndex = sessionSnapshots[sessionSnapshots.length - 1]?.sessionIndex ?? initialSessionCount;
|
|
6593
6704
|
const shouldShowLiveTab = state.phase !== "idle" && state.phase !== "steering" && state.phase !== "complete" && (Boolean(state.content) || Boolean(state.reasoning) || state.tools.length > 0 || state.rawEvents.length > 0 || state.phase === "thinking" || state.phase === "error");
|
|
6594
|
-
const liveSessionSnapshot =
|
|
6705
|
+
const liveSessionSnapshot = useMemo6(
|
|
6595
6706
|
() => shouldShowLiveTab ? buildLiveSessionSnapshot(state, latestCompletedSessionIndex + 1, currentModel) : void 0,
|
|
6596
6707
|
[currentModel, latestCompletedSessionIndex, shouldShowLiveTab, state]
|
|
6597
6708
|
);
|
|
6598
6709
|
const liveSessionKey = liveSessionSnapshot ? createSessionTabKey(liveSessionSnapshot.sessionIndex, "live") : void 0;
|
|
6599
6710
|
const latestSessionKey = getLatestSessionTabKey(sessionSnapshots, liveSessionSnapshot);
|
|
6600
|
-
const allTabs =
|
|
6711
|
+
const allTabs = useMemo6(
|
|
6601
6712
|
() => buildSessionTabs(sessionSnapshots, selectedSessionKey, latestUnreadKey, liveSessionSnapshot),
|
|
6602
6713
|
[latestUnreadKey, liveSessionSnapshot, selectedSessionKey, sessionSnapshots]
|
|
6603
6714
|
);
|
|
6604
|
-
const visibleTabs =
|
|
6715
|
+
const visibleTabs = useMemo6(
|
|
6605
6716
|
() => getVisibleSessionTabs(allTabs, selectedSessionKey, terminalWidth),
|
|
6606
6717
|
[allTabs, selectedSessionKey, terminalWidth]
|
|
6607
6718
|
);
|
|
6608
|
-
const displayedSessionSnapshot =
|
|
6719
|
+
const displayedSessionSnapshot = useMemo6(() => {
|
|
6609
6720
|
if (!selectedSessionKey) return liveSessionSnapshot ?? sessionSnapshots[sessionSnapshots.length - 1];
|
|
6610
6721
|
if (selectedSessionKey === liveSessionKey) return liveSessionSnapshot;
|
|
6611
6722
|
return sessionSnapshots.find(
|
|
@@ -6618,14 +6729,14 @@ function MarathonApp({
|
|
|
6618
6729
|
const displayedTools = displayedSessionSnapshot?.tools ?? state.tools;
|
|
6619
6730
|
const displayedEvents = displayedSessionSnapshot?.rawEvents ?? state.rawEvents;
|
|
6620
6731
|
const latestLiveActivityRef = useRef8(void 0);
|
|
6621
|
-
const upgradePrompt =
|
|
6622
|
-
const upgradePromptKey =
|
|
6732
|
+
const upgradePrompt = useMemo6(() => parseMarathonUpgradePrompt(state.error), [state.error]);
|
|
6733
|
+
const upgradePromptKey = useMemo6(
|
|
6623
6734
|
() => upgradePrompt ? `${upgradePrompt.message}|${upgradePrompt.code ?? ""}|${upgradePrompt.limitType ?? ""}|${upgradePrompt.retryAfter ?? ""}` : void 0,
|
|
6624
6735
|
[upgradePrompt]
|
|
6625
6736
|
);
|
|
6626
6737
|
const showUpgradeModal = Boolean(upgradePrompt && !upgradeModalDismissed);
|
|
6627
6738
|
const canBrowseAfterUpgradeError = Boolean(upgradePrompt && !showUpgradeModal);
|
|
6628
|
-
const selectSessionTab =
|
|
6739
|
+
const selectSessionTab = useCallback7(
|
|
6629
6740
|
(nextKey, manual = true) => {
|
|
6630
6741
|
if (!nextKey) return;
|
|
6631
6742
|
setSelectedSessionKey(nextKey);
|
|
@@ -6696,7 +6807,7 @@ function MarathonApp({
|
|
|
6696
6807
|
setEventCursor(displayedEvents.length - 1);
|
|
6697
6808
|
}
|
|
6698
6809
|
}, [displayedEvents.length, eventCursor, showEventStream]);
|
|
6699
|
-
const navigateToEvent =
|
|
6810
|
+
const navigateToEvent = useCallback7(
|
|
6700
6811
|
(index) => {
|
|
6701
6812
|
const clamped = Math.max(0, Math.min(displayedEvents.length - 1, index));
|
|
6702
6813
|
const evt = displayedEvents[clamped];
|
|
@@ -6711,12 +6822,12 @@ function MarathonApp({
|
|
|
6711
6822
|
const agentPageUrl = agentId && dashboardUrl ? `${dashboardUrl.replace(/\/$/, "")}/agents/${agentId}` : null;
|
|
6712
6823
|
useInput9((_input, key) => {
|
|
6713
6824
|
if (_input === "u" && upgradePrompt) {
|
|
6714
|
-
void
|
|
6825
|
+
void open4(billingPageUrl);
|
|
6715
6826
|
setUpgradeModalDismissed(true);
|
|
6716
6827
|
return;
|
|
6717
6828
|
}
|
|
6718
6829
|
if (_input === "o" && agentPageUrl && !(state.phase === "steering" && steeringRecap)) {
|
|
6719
|
-
void
|
|
6830
|
+
void open4(agentPageUrl);
|
|
6720
6831
|
return;
|
|
6721
6832
|
}
|
|
6722
6833
|
if (key.ctrl && _input === "c") {
|
|
@@ -6748,7 +6859,7 @@ function MarathonApp({
|
|
|
6748
6859
|
return;
|
|
6749
6860
|
}
|
|
6750
6861
|
if (key.return) {
|
|
6751
|
-
void
|
|
6862
|
+
void open4(billingPageUrl);
|
|
6752
6863
|
setUpgradeModalDismissed(true);
|
|
6753
6864
|
return;
|
|
6754
6865
|
}
|
|
@@ -6935,7 +7046,7 @@ function MarathonApp({
|
|
|
6935
7046
|
adjustedContentHeight - reasoningHintRows - reasoningLiveRows - thinkingRows - 3
|
|
6936
7047
|
);
|
|
6937
7048
|
const targetReasoningRows = hasReasoning && !reasoningCollapsed ? Math.min(maxReasoningRows, Math.max(3, Math.min(8, Math.floor(adjustedContentHeight * 0.3)))) : 0;
|
|
6938
|
-
const visibleReasoningLines =
|
|
7049
|
+
const visibleReasoningLines = useMemo6(
|
|
6939
7050
|
() => getVisibleReasoningLines(displayedReasoning, targetReasoningRows),
|
|
6940
7051
|
[displayedReasoning, targetReasoningRows]
|
|
6941
7052
|
);
|
|
@@ -9456,9 +9567,9 @@ agentsCommand.command("list").description("List all agents").option("--json", "O
|
|
|
9456
9567
|
return;
|
|
9457
9568
|
}
|
|
9458
9569
|
const App = () => {
|
|
9459
|
-
const [items, setItems] =
|
|
9460
|
-
const [error, setError] =
|
|
9461
|
-
const [total, setTotal] =
|
|
9570
|
+
const [items, setItems] = useState21(null);
|
|
9571
|
+
const [error, setError] = useState21(null);
|
|
9572
|
+
const [total, setTotal] = useState21();
|
|
9462
9573
|
useEffect18(() => {
|
|
9463
9574
|
client.get("/agents", { limit: options.limit }).then((res) => {
|
|
9464
9575
|
setItems(res.data ?? []);
|
|
@@ -9517,8 +9628,8 @@ agentsCommand.command("get <id>").description("Get agent details").option("--jso
|
|
|
9517
9628
|
return;
|
|
9518
9629
|
}
|
|
9519
9630
|
const App = () => {
|
|
9520
|
-
const [items, setItems] =
|
|
9521
|
-
const [error, setError] =
|
|
9631
|
+
const [items, setItems] = useState21(null);
|
|
9632
|
+
const [error, setError] = useState21(null);
|
|
9522
9633
|
useEffect18(() => {
|
|
9523
9634
|
client.get(`/agents/${id}`).then((res) => setItems([res])).catch((err) => setError(err instanceof Error ? err : new Error(String(err))));
|
|
9524
9635
|
}, []);
|
|
@@ -9569,10 +9680,10 @@ agentsCommand.command("create").description("Create a new agent").requiredOption
|
|
|
9569
9680
|
return;
|
|
9570
9681
|
}
|
|
9571
9682
|
const App = () => {
|
|
9572
|
-
const [loading, setLoading] =
|
|
9573
|
-
const [success, setSuccess] =
|
|
9574
|
-
const [error, setError] =
|
|
9575
|
-
const [result, setResult] =
|
|
9683
|
+
const [loading, setLoading] = useState21(true);
|
|
9684
|
+
const [success, setSuccess] = useState21(null);
|
|
9685
|
+
const [error, setError] = useState21(null);
|
|
9686
|
+
const [result, setResult] = useState21(null);
|
|
9576
9687
|
useEffect18(() => {
|
|
9577
9688
|
client.post("/agents", {
|
|
9578
9689
|
name: options.name,
|
|
@@ -9620,10 +9731,10 @@ agentsCommand.command("delete <id>").description("Delete an agent").option("--tt
|
|
|
9620
9731
|
return;
|
|
9621
9732
|
}
|
|
9622
9733
|
const App = () => {
|
|
9623
|
-
const [confirmed, setConfirmed] =
|
|
9624
|
-
const [loading, setLoading] =
|
|
9625
|
-
const [success, setSuccess] =
|
|
9626
|
-
const [error, setError] =
|
|
9734
|
+
const [confirmed, setConfirmed] = useState21(null);
|
|
9735
|
+
const [loading, setLoading] = useState21(false);
|
|
9736
|
+
const [success, setSuccess] = useState21(null);
|
|
9737
|
+
const [error, setError] = useState21(null);
|
|
9627
9738
|
useEffect18(() => {
|
|
9628
9739
|
if (confirmed !== true) return void 0;
|
|
9629
9740
|
setLoading(true);
|
|
@@ -9714,7 +9825,7 @@ import { Command as Command13 } from "commander";
|
|
|
9714
9825
|
import chalk18 from "chalk";
|
|
9715
9826
|
import React14 from "react";
|
|
9716
9827
|
import { render as render12 } from "ink";
|
|
9717
|
-
import { useState as
|
|
9828
|
+
import { useState as useState22, useEffect as useEffect19 } from "react";
|
|
9718
9829
|
var modelsCommand = new Command13("models").description("Manage model configurations");
|
|
9719
9830
|
modelsCommand.command("list").description("List your enabled model configurations").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
9720
9831
|
const apiKey = await ensureAuth();
|
|
@@ -9751,9 +9862,9 @@ modelsCommand.command("list").description("List your enabled model configuration
|
|
|
9751
9862
|
return;
|
|
9752
9863
|
}
|
|
9753
9864
|
const App = () => {
|
|
9754
|
-
const [items, setItems] =
|
|
9755
|
-
const [error, setError] =
|
|
9756
|
-
const [total, setTotal] =
|
|
9865
|
+
const [items, setItems] = useState22(null);
|
|
9866
|
+
const [error, setError] = useState22(null);
|
|
9867
|
+
const [total, setTotal] = useState22();
|
|
9757
9868
|
useEffect19(() => {
|
|
9758
9869
|
client.get("/model-configs").then((res) => {
|
|
9759
9870
|
setItems(res.data ?? []);
|
|
@@ -9816,8 +9927,8 @@ modelsCommand.command("available").description("List all available models groupe
|
|
|
9816
9927
|
return;
|
|
9817
9928
|
}
|
|
9818
9929
|
const App = () => {
|
|
9819
|
-
const [items, setItems] =
|
|
9820
|
-
const [error, setError] =
|
|
9930
|
+
const [items, setItems] = useState22(null);
|
|
9931
|
+
const [error, setError] = useState22(null);
|
|
9821
9932
|
useEffect19(() => {
|
|
9822
9933
|
client.get("/model-configs/grouped").then((res) => setItems(res.data ?? [])).catch((err) => setError(err instanceof Error ? err : new Error(String(err))));
|
|
9823
9934
|
}, []);
|
|
@@ -9864,10 +9975,10 @@ modelsCommand.command("enable <modelId>").description("Enable a model by creatin
|
|
|
9864
9975
|
return;
|
|
9865
9976
|
}
|
|
9866
9977
|
const App = () => {
|
|
9867
|
-
const [loading, setLoading] =
|
|
9868
|
-
const [success, setSuccess] =
|
|
9869
|
-
const [error, setError] =
|
|
9870
|
-
const [result, setResult] =
|
|
9978
|
+
const [loading, setLoading] = useState22(true);
|
|
9979
|
+
const [success, setSuccess] = useState22(null);
|
|
9980
|
+
const [error, setError] = useState22(null);
|
|
9981
|
+
const [result, setResult] = useState22(null);
|
|
9871
9982
|
useEffect19(() => {
|
|
9872
9983
|
client.post("/model-configs", { modelId }).then((data) => {
|
|
9873
9984
|
setResult(data);
|
|
@@ -9912,9 +10023,9 @@ modelsCommand.command("disable <id>").description("Disable a model configuration
|
|
|
9912
10023
|
return;
|
|
9913
10024
|
}
|
|
9914
10025
|
const App = () => {
|
|
9915
|
-
const [loading, setLoading] =
|
|
9916
|
-
const [success, setSuccess] =
|
|
9917
|
-
const [error, setError] =
|
|
10026
|
+
const [loading, setLoading] = useState22(true);
|
|
10027
|
+
const [success, setSuccess] = useState22(null);
|
|
10028
|
+
const [error, setError] = useState22(null);
|
|
9918
10029
|
useEffect19(() => {
|
|
9919
10030
|
client.patch(`/model-configs/${id}/status`, { enabled: false }).then(() => {
|
|
9920
10031
|
setSuccess(true);
|
|
@@ -9952,9 +10063,9 @@ modelsCommand.command("default <id>").description("Set a model configuration as
|
|
|
9952
10063
|
return;
|
|
9953
10064
|
}
|
|
9954
10065
|
const App = () => {
|
|
9955
|
-
const [loading, setLoading] =
|
|
9956
|
-
const [success, setSuccess] =
|
|
9957
|
-
const [error, setError] =
|
|
10066
|
+
const [loading, setLoading] = useState22(true);
|
|
10067
|
+
const [success, setSuccess] = useState22(null);
|
|
10068
|
+
const [error, setError] = useState22(null);
|
|
9958
10069
|
useEffect19(() => {
|
|
9959
10070
|
client.patch(`/model-configs/${id}/default`, {}).then(() => {
|
|
9960
10071
|
setSuccess(true);
|
|
@@ -9996,7 +10107,7 @@ import { Command as Command14 } from "commander";
|
|
|
9996
10107
|
import chalk19 from "chalk";
|
|
9997
10108
|
import React15 from "react";
|
|
9998
10109
|
import { render as render13 } from "ink";
|
|
9999
|
-
import { useState as
|
|
10110
|
+
import { useState as useState23, useEffect as useEffect20 } from "react";
|
|
10000
10111
|
var schedulesCommand = new Command14("schedules").description("Manage schedules");
|
|
10001
10112
|
schedulesCommand.command("list").description("List all schedules").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
10002
10113
|
const apiKey = await ensureAuth();
|
|
@@ -10040,9 +10151,9 @@ schedulesCommand.command("list").description("List all schedules").option("--jso
|
|
|
10040
10151
|
return;
|
|
10041
10152
|
}
|
|
10042
10153
|
const App = () => {
|
|
10043
|
-
const [items, setItems] =
|
|
10044
|
-
const [error, setError] =
|
|
10045
|
-
const [total, setTotal] =
|
|
10154
|
+
const [items, setItems] = useState23(null);
|
|
10155
|
+
const [error, setError] = useState23(null);
|
|
10156
|
+
const [total, setTotal] = useState23();
|
|
10046
10157
|
useEffect20(() => {
|
|
10047
10158
|
client.get("/schedules").then((res) => {
|
|
10048
10159
|
setItems(res.data ?? []);
|
|
@@ -10106,8 +10217,8 @@ schedulesCommand.command("get <id>").description("Get schedule details").option(
|
|
|
10106
10217
|
return;
|
|
10107
10218
|
}
|
|
10108
10219
|
const App = () => {
|
|
10109
|
-
const [items, setItems] =
|
|
10110
|
-
const [error, setError] =
|
|
10220
|
+
const [items, setItems] = useState23(null);
|
|
10221
|
+
const [error, setError] = useState23(null);
|
|
10111
10222
|
useEffect20(() => {
|
|
10112
10223
|
client.get(`/schedules/${id}`).then((res) => setItems([res])).catch((err) => setError(err instanceof Error ? err : new Error(String(err))));
|
|
10113
10224
|
}, []);
|
|
@@ -10162,10 +10273,10 @@ schedulesCommand.command("create").description("Create a new schedule").required
|
|
|
10162
10273
|
return;
|
|
10163
10274
|
}
|
|
10164
10275
|
const App = () => {
|
|
10165
|
-
const [loading, setLoading] =
|
|
10166
|
-
const [success, setSuccess] =
|
|
10167
|
-
const [error, setError] =
|
|
10168
|
-
const [result, setResult] =
|
|
10276
|
+
const [loading, setLoading] = useState23(true);
|
|
10277
|
+
const [success, setSuccess] = useState23(null);
|
|
10278
|
+
const [error, setError] = useState23(null);
|
|
10279
|
+
const [result, setResult] = useState23(null);
|
|
10169
10280
|
useEffect20(() => {
|
|
10170
10281
|
client.post("/schedules", {
|
|
10171
10282
|
flowId: options.flow,
|
|
@@ -10217,9 +10328,9 @@ function simpleMutationCommand(name, description, mutationFn, successMsg, loadin
|
|
|
10217
10328
|
return;
|
|
10218
10329
|
}
|
|
10219
10330
|
const App = () => {
|
|
10220
|
-
const [loading, setLoading] =
|
|
10221
|
-
const [success, setSuccess] =
|
|
10222
|
-
const [error, setError] =
|
|
10331
|
+
const [loading, setLoading] = useState23(true);
|
|
10332
|
+
const [success, setSuccess] = useState23(null);
|
|
10333
|
+
const [error, setError] = useState23(null);
|
|
10223
10334
|
useEffect20(() => {
|
|
10224
10335
|
mutationFn(client, id).then(() => {
|
|
10225
10336
|
setSuccess(true);
|
|
@@ -10279,10 +10390,10 @@ schedulesCommand.command("delete <id>").description("Delete a schedule").option(
|
|
|
10279
10390
|
return;
|
|
10280
10391
|
}
|
|
10281
10392
|
const App = () => {
|
|
10282
|
-
const [confirmed, setConfirmed] =
|
|
10283
|
-
const [loading, setLoading] =
|
|
10284
|
-
const [success, setSuccess] =
|
|
10285
|
-
const [error, setError] =
|
|
10393
|
+
const [confirmed, setConfirmed] = useState23(null);
|
|
10394
|
+
const [loading, setLoading] = useState23(false);
|
|
10395
|
+
const [success, setSuccess] = useState23(null);
|
|
10396
|
+
const [error, setError] = useState23(null);
|
|
10286
10397
|
useEffect20(() => {
|
|
10287
10398
|
if (confirmed !== true) return void 0;
|
|
10288
10399
|
setLoading(true);
|
|
@@ -10327,7 +10438,7 @@ import { Command as Command15 } from "commander";
|
|
|
10327
10438
|
import chalk20 from "chalk";
|
|
10328
10439
|
import React16 from "react";
|
|
10329
10440
|
import { render as render14 } from "ink";
|
|
10330
|
-
import { useState as
|
|
10441
|
+
import { useState as useState24, useEffect as useEffect21 } from "react";
|
|
10331
10442
|
import { Text as Text24 } from "ink";
|
|
10332
10443
|
import { readFileSync as readFileSync8 } from "fs";
|
|
10333
10444
|
var evalCommand = new Command15("eval").description("Manage evaluations");
|
|
@@ -10372,10 +10483,10 @@ evalCommand.command("submit").description("Submit an eval batch").requiredOption
|
|
|
10372
10483
|
return;
|
|
10373
10484
|
}
|
|
10374
10485
|
const App = () => {
|
|
10375
|
-
const [loading, setLoading] =
|
|
10376
|
-
const [success, setSuccess] =
|
|
10377
|
-
const [error, setError] =
|
|
10378
|
-
const [resultNode, setResultNode] =
|
|
10486
|
+
const [loading, setLoading] = useState24(true);
|
|
10487
|
+
const [success, setSuccess] = useState24(null);
|
|
10488
|
+
const [error, setError] = useState24(null);
|
|
10489
|
+
const [resultNode, setResultNode] = useState24(void 0);
|
|
10379
10490
|
useEffect21(() => {
|
|
10380
10491
|
const run = async () => {
|
|
10381
10492
|
try {
|
|
@@ -10455,10 +10566,10 @@ evalCommand.command("list").description("List eval batches").option("--flow <id>
|
|
|
10455
10566
|
return;
|
|
10456
10567
|
}
|
|
10457
10568
|
const App = () => {
|
|
10458
|
-
const [loading, setLoading] =
|
|
10459
|
-
const [items, setItems] =
|
|
10460
|
-
const [total, setTotal] =
|
|
10461
|
-
const [error, setError] =
|
|
10569
|
+
const [loading, setLoading] = useState24(true);
|
|
10570
|
+
const [items, setItems] = useState24(null);
|
|
10571
|
+
const [total, setTotal] = useState24(void 0);
|
|
10572
|
+
const [error, setError] = useState24(null);
|
|
10462
10573
|
useEffect21(() => {
|
|
10463
10574
|
const run = async () => {
|
|
10464
10575
|
try {
|
|
@@ -10535,10 +10646,10 @@ evalCommand.command("results <id>").description("Get eval batch results").option
|
|
|
10535
10646
|
return;
|
|
10536
10647
|
}
|
|
10537
10648
|
const App = () => {
|
|
10538
|
-
const [loading, setLoading] =
|
|
10539
|
-
const [success, setSuccess] =
|
|
10540
|
-
const [error, setError] =
|
|
10541
|
-
const [resultNode, setResultNode] =
|
|
10649
|
+
const [loading, setLoading] = useState24(true);
|
|
10650
|
+
const [success, setSuccess] = useState24(null);
|
|
10651
|
+
const [error, setError] = useState24(null);
|
|
10652
|
+
const [resultNode, setResultNode] = useState24(void 0);
|
|
10542
10653
|
useEffect21(() => {
|
|
10543
10654
|
const run = async () => {
|
|
10544
10655
|
try {
|
|
@@ -10599,9 +10710,9 @@ evalCommand.command("compare <groupId>").description("Compare evals in a group")
|
|
|
10599
10710
|
return;
|
|
10600
10711
|
}
|
|
10601
10712
|
const App = () => {
|
|
10602
|
-
const [loading, setLoading] =
|
|
10603
|
-
const [success, setSuccess] =
|
|
10604
|
-
const [error, setError] =
|
|
10713
|
+
const [loading, setLoading] = useState24(true);
|
|
10714
|
+
const [success, setSuccess] = useState24(null);
|
|
10715
|
+
const [error, setError] = useState24(null);
|
|
10605
10716
|
useEffect21(() => {
|
|
10606
10717
|
const run = async () => {
|
|
10607
10718
|
try {
|
|
@@ -10634,7 +10745,7 @@ import { Command as Command16 } from "commander";
|
|
|
10634
10745
|
import chalk21 from "chalk";
|
|
10635
10746
|
import React17 from "react";
|
|
10636
10747
|
import { render as render15 } from "ink";
|
|
10637
|
-
import { useState as
|
|
10748
|
+
import { useState as useState25, useEffect as useEffect22 } from "react";
|
|
10638
10749
|
import { Text as Text25 } from "ink";
|
|
10639
10750
|
var apiKeysCommand = new Command16("api-keys").description("Manage API keys");
|
|
10640
10751
|
apiKeysCommand.command("list").description("List your API keys").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
@@ -10673,10 +10784,10 @@ apiKeysCommand.command("list").description("List your API keys").option("--json"
|
|
|
10673
10784
|
return;
|
|
10674
10785
|
}
|
|
10675
10786
|
const App = () => {
|
|
10676
|
-
const [loading, setLoading] =
|
|
10677
|
-
const [items, setItems] =
|
|
10678
|
-
const [total, setTotal] =
|
|
10679
|
-
const [error, setError] =
|
|
10787
|
+
const [loading, setLoading] = useState25(true);
|
|
10788
|
+
const [items, setItems] = useState25(null);
|
|
10789
|
+
const [total, setTotal] = useState25(void 0);
|
|
10790
|
+
const [error, setError] = useState25(null);
|
|
10680
10791
|
useEffect22(() => {
|
|
10681
10792
|
const run = async () => {
|
|
10682
10793
|
try {
|
|
@@ -10737,10 +10848,10 @@ apiKeysCommand.command("get <id>").description("Get API key details").option("--
|
|
|
10737
10848
|
return;
|
|
10738
10849
|
}
|
|
10739
10850
|
const App = () => {
|
|
10740
|
-
const [loading, setLoading] =
|
|
10741
|
-
const [success, setSuccess] =
|
|
10742
|
-
const [error, setError] =
|
|
10743
|
-
const [resultNode, setResultNode] =
|
|
10851
|
+
const [loading, setLoading] = useState25(true);
|
|
10852
|
+
const [success, setSuccess] = useState25(null);
|
|
10853
|
+
const [error, setError] = useState25(null);
|
|
10854
|
+
const [resultNode, setResultNode] = useState25(void 0);
|
|
10744
10855
|
useEffect22(() => {
|
|
10745
10856
|
const run = async () => {
|
|
10746
10857
|
try {
|
|
@@ -10806,10 +10917,10 @@ apiKeysCommand.command("create").description("Create a new API key").requiredOpt
|
|
|
10806
10917
|
return;
|
|
10807
10918
|
}
|
|
10808
10919
|
const App = () => {
|
|
10809
|
-
const [loading, setLoading] =
|
|
10810
|
-
const [success, setSuccess] =
|
|
10811
|
-
const [error, setError] =
|
|
10812
|
-
const [resultNode, setResultNode] =
|
|
10920
|
+
const [loading, setLoading] = useState25(true);
|
|
10921
|
+
const [success, setSuccess] = useState25(null);
|
|
10922
|
+
const [error, setError] = useState25(null);
|
|
10923
|
+
const [resultNode, setResultNode] = useState25(void 0);
|
|
10813
10924
|
useEffect22(() => {
|
|
10814
10925
|
const run = async () => {
|
|
10815
10926
|
try {
|
|
@@ -10865,9 +10976,9 @@ apiKeysCommand.command("delete <id>").description("Delete an API key").option("-
|
|
|
10865
10976
|
}
|
|
10866
10977
|
if (options.yes) {
|
|
10867
10978
|
const App = () => {
|
|
10868
|
-
const [loading, setLoading] =
|
|
10869
|
-
const [success, setSuccess] =
|
|
10870
|
-
const [error, setError] =
|
|
10979
|
+
const [loading, setLoading] = useState25(true);
|
|
10980
|
+
const [success, setSuccess] = useState25(null);
|
|
10981
|
+
const [error, setError] = useState25(null);
|
|
10871
10982
|
useEffect22(() => {
|
|
10872
10983
|
const run = async () => {
|
|
10873
10984
|
try {
|
|
@@ -10908,9 +11019,9 @@ apiKeysCommand.command("delete <id>").description("Delete an API key").option("-
|
|
|
10908
11019
|
});
|
|
10909
11020
|
if (!confirmed) return;
|
|
10910
11021
|
const DeleteApp = () => {
|
|
10911
|
-
const [loading, setLoading] =
|
|
10912
|
-
const [success, setSuccess] =
|
|
10913
|
-
const [error, setError] =
|
|
11022
|
+
const [loading, setLoading] = useState25(true);
|
|
11023
|
+
const [success, setSuccess] = useState25(null);
|
|
11024
|
+
const [error, setError] = useState25(null);
|
|
10914
11025
|
useEffect22(() => {
|
|
10915
11026
|
const run = async () => {
|
|
10916
11027
|
try {
|
|
@@ -10961,10 +11072,10 @@ apiKeysCommand.command("regenerate <id>").description("Regenerate an API key").o
|
|
|
10961
11072
|
return;
|
|
10962
11073
|
}
|
|
10963
11074
|
const App = () => {
|
|
10964
|
-
const [loading, setLoading] =
|
|
10965
|
-
const [success, setSuccess] =
|
|
10966
|
-
const [error, setError] =
|
|
10967
|
-
const [resultNode, setResultNode] =
|
|
11075
|
+
const [loading, setLoading] = useState25(true);
|
|
11076
|
+
const [success, setSuccess] = useState25(null);
|
|
11077
|
+
const [error, setError] = useState25(null);
|
|
11078
|
+
const [resultNode, setResultNode] = useState25(void 0);
|
|
10968
11079
|
useEffect22(() => {
|
|
10969
11080
|
const run = async () => {
|
|
10970
11081
|
try {
|
|
@@ -11017,9 +11128,9 @@ apiKeysCommand.command("analytics").description("Show API key usage analytics").
|
|
|
11017
11128
|
return;
|
|
11018
11129
|
}
|
|
11019
11130
|
const App = () => {
|
|
11020
|
-
const [loading, setLoading] =
|
|
11021
|
-
const [success, setSuccess] =
|
|
11022
|
-
const [error, setError] =
|
|
11131
|
+
const [loading, setLoading] = useState25(true);
|
|
11132
|
+
const [success, setSuccess] = useState25(null);
|
|
11133
|
+
const [error, setError] = useState25(null);
|
|
11023
11134
|
useEffect22(() => {
|
|
11024
11135
|
const run = async () => {
|
|
11025
11136
|
try {
|
|
@@ -11053,7 +11164,7 @@ import { Command as Command17 } from "commander";
|
|
|
11053
11164
|
import chalk22 from "chalk";
|
|
11054
11165
|
import React18 from "react";
|
|
11055
11166
|
import { render as render16 } from "ink";
|
|
11056
|
-
import { useState as
|
|
11167
|
+
import { useState as useState26, useEffect as useEffect23 } from "react";
|
|
11057
11168
|
import { Text as Text26 } from "ink";
|
|
11058
11169
|
var analyticsCommand = new Command17("analytics").description("View analytics and execution results");
|
|
11059
11170
|
analyticsCommand.command("stats").description("Show account statistics").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
@@ -11082,10 +11193,10 @@ analyticsCommand.command("stats").description("Show account statistics").option(
|
|
|
11082
11193
|
return;
|
|
11083
11194
|
}
|
|
11084
11195
|
const App = () => {
|
|
11085
|
-
const [loading, setLoading] =
|
|
11086
|
-
const [success, setSuccess] =
|
|
11087
|
-
const [error, setError] =
|
|
11088
|
-
const [resultNode, setResultNode] =
|
|
11196
|
+
const [loading, setLoading] = useState26(true);
|
|
11197
|
+
const [success, setSuccess] = useState26(null);
|
|
11198
|
+
const [error, setError] = useState26(null);
|
|
11199
|
+
const [resultNode, setResultNode] = useState26(void 0);
|
|
11089
11200
|
useEffect23(() => {
|
|
11090
11201
|
const run = async () => {
|
|
11091
11202
|
try {
|
|
@@ -11166,10 +11277,10 @@ analyticsCommand.command("results").description("List execution results").option
|
|
|
11166
11277
|
return;
|
|
11167
11278
|
}
|
|
11168
11279
|
const App = () => {
|
|
11169
|
-
const [loading, setLoading] =
|
|
11170
|
-
const [items, setItems] =
|
|
11171
|
-
const [total, setTotal] =
|
|
11172
|
-
const [error, setError] =
|
|
11280
|
+
const [loading, setLoading] = useState26(true);
|
|
11281
|
+
const [items, setItems] = useState26(null);
|
|
11282
|
+
const [total, setTotal] = useState26(void 0);
|
|
11283
|
+
const [error, setError] = useState26(null);
|
|
11173
11284
|
useEffect23(() => {
|
|
11174
11285
|
const run = async () => {
|
|
11175
11286
|
try {
|
|
@@ -11215,8 +11326,8 @@ import { Command as Command18 } from "commander";
|
|
|
11215
11326
|
import chalk23 from "chalk";
|
|
11216
11327
|
import React19 from "react";
|
|
11217
11328
|
import { render as render17 } from "ink";
|
|
11218
|
-
import { useState as
|
|
11219
|
-
import
|
|
11329
|
+
import { useState as useState27, useEffect as useEffect24 } from "react";
|
|
11330
|
+
import open5 from "open";
|
|
11220
11331
|
var billingCommand = new Command18("billing").description("View billing and subscription info");
|
|
11221
11332
|
billingCommand.command("status").description("Show current plan and usage").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
11222
11333
|
const apiKey = await ensureAuth();
|
|
@@ -11261,10 +11372,10 @@ billingCommand.command("status").description("Show current plan and usage").opti
|
|
|
11261
11372
|
return;
|
|
11262
11373
|
}
|
|
11263
11374
|
const App = () => {
|
|
11264
|
-
const [loading, setLoading] =
|
|
11265
|
-
const [success, setSuccess] =
|
|
11266
|
-
const [error, setError] =
|
|
11267
|
-
const [resultNode, setResultNode] =
|
|
11375
|
+
const [loading, setLoading] = useState27(true);
|
|
11376
|
+
const [success, setSuccess] = useState27(null);
|
|
11377
|
+
const [error, setError] = useState27(null);
|
|
11378
|
+
const [resultNode, setResultNode] = useState27(void 0);
|
|
11268
11379
|
useEffect24(() => {
|
|
11269
11380
|
const run = async () => {
|
|
11270
11381
|
try {
|
|
@@ -11319,7 +11430,7 @@ billingCommand.command("portal").description("Open the billing portal in your br
|
|
|
11319
11430
|
if (data.url) {
|
|
11320
11431
|
console.log("Opening billing portal...");
|
|
11321
11432
|
console.log(data.url);
|
|
11322
|
-
await
|
|
11433
|
+
await open5(data.url);
|
|
11323
11434
|
} else {
|
|
11324
11435
|
console.log("No portal URL returned. You may need to set up billing first.");
|
|
11325
11436
|
}
|
|
@@ -11332,16 +11443,16 @@ billingCommand.command("portal").description("Open the billing portal in your br
|
|
|
11332
11443
|
return;
|
|
11333
11444
|
}
|
|
11334
11445
|
const App = () => {
|
|
11335
|
-
const [loading, setLoading] =
|
|
11336
|
-
const [success, setSuccess] =
|
|
11337
|
-
const [error, setError] =
|
|
11338
|
-
const [msg, setMsg] =
|
|
11446
|
+
const [loading, setLoading] = useState27(true);
|
|
11447
|
+
const [success, setSuccess] = useState27(null);
|
|
11448
|
+
const [error, setError] = useState27(null);
|
|
11449
|
+
const [msg, setMsg] = useState27("Opening billing portal...");
|
|
11339
11450
|
useEffect24(() => {
|
|
11340
11451
|
const run = async () => {
|
|
11341
11452
|
try {
|
|
11342
11453
|
const data = await client.post("/billing/portal");
|
|
11343
11454
|
if (data.url) {
|
|
11344
|
-
await
|
|
11455
|
+
await open5(data.url);
|
|
11345
11456
|
setMsg("Billing portal opened in browser");
|
|
11346
11457
|
setSuccess(true);
|
|
11347
11458
|
} else {
|
|
@@ -11385,9 +11496,9 @@ billingCommand.command("refresh").description("Refresh plan data from billing pr
|
|
|
11385
11496
|
return;
|
|
11386
11497
|
}
|
|
11387
11498
|
const App = () => {
|
|
11388
|
-
const [loading, setLoading] =
|
|
11389
|
-
const [success, setSuccess] =
|
|
11390
|
-
const [error, setError] =
|
|
11499
|
+
const [loading, setLoading] = useState27(true);
|
|
11500
|
+
const [success, setSuccess] = useState27(null);
|
|
11501
|
+
const [error, setError] = useState27(null);
|
|
11391
11502
|
useEffect24(() => {
|
|
11392
11503
|
const run = async () => {
|
|
11393
11504
|
try {
|
|
@@ -11419,7 +11530,7 @@ import { Command as Command19 } from "commander";
|
|
|
11419
11530
|
import chalk24 from "chalk";
|
|
11420
11531
|
import React20 from "react";
|
|
11421
11532
|
import { render as render18 } from "ink";
|
|
11422
|
-
import { useState as
|
|
11533
|
+
import { useState as useState28, useEffect as useEffect25 } from "react";
|
|
11423
11534
|
import { Text as Text27 } from "ink";
|
|
11424
11535
|
var flowVersionsCommand = new Command19("flow-versions").description(
|
|
11425
11536
|
"Manage flow versions"
|
|
@@ -11456,9 +11567,9 @@ flowVersionsCommand.command("list <flowId>").description("List all versions for
|
|
|
11456
11567
|
return;
|
|
11457
11568
|
}
|
|
11458
11569
|
const App = () => {
|
|
11459
|
-
const [loading, setLoading] =
|
|
11460
|
-
const [items, setItems] =
|
|
11461
|
-
const [error, setError] =
|
|
11570
|
+
const [loading, setLoading] = useState28(true);
|
|
11571
|
+
const [items, setItems] = useState28(null);
|
|
11572
|
+
const [error, setError] = useState28(null);
|
|
11462
11573
|
useEffect25(() => {
|
|
11463
11574
|
const run = async () => {
|
|
11464
11575
|
try {
|
|
@@ -11517,10 +11628,10 @@ flowVersionsCommand.command("get <flowId> <versionId>").description("Get a speci
|
|
|
11517
11628
|
return;
|
|
11518
11629
|
}
|
|
11519
11630
|
const App = () => {
|
|
11520
|
-
const [loading, setLoading] =
|
|
11521
|
-
const [success, setSuccess] =
|
|
11522
|
-
const [error, setError] =
|
|
11523
|
-
const [resultNode, setResultNode] =
|
|
11631
|
+
const [loading, setLoading] = useState28(true);
|
|
11632
|
+
const [success, setSuccess] = useState28(null);
|
|
11633
|
+
const [error, setError] = useState28(null);
|
|
11634
|
+
const [resultNode, setResultNode] = useState28(void 0);
|
|
11524
11635
|
useEffect25(() => {
|
|
11525
11636
|
const run = async () => {
|
|
11526
11637
|
try {
|
|
@@ -11583,10 +11694,10 @@ flowVersionsCommand.command("published <flowId>").description("Get the published
|
|
|
11583
11694
|
return;
|
|
11584
11695
|
}
|
|
11585
11696
|
const App = () => {
|
|
11586
|
-
const [loading, setLoading] =
|
|
11587
|
-
const [success, setSuccess] =
|
|
11588
|
-
const [error, setError] =
|
|
11589
|
-
const [resultNode, setResultNode] =
|
|
11697
|
+
const [loading, setLoading] = useState28(true);
|
|
11698
|
+
const [success, setSuccess] = useState28(null);
|
|
11699
|
+
const [error, setError] = useState28(null);
|
|
11700
|
+
const [resultNode, setResultNode] = useState28(void 0);
|
|
11590
11701
|
useEffect25(() => {
|
|
11591
11702
|
const run = async () => {
|
|
11592
11703
|
try {
|
|
@@ -11640,9 +11751,9 @@ flowVersionsCommand.command("publish <flowId>").description("Publish a version")
|
|
|
11640
11751
|
return;
|
|
11641
11752
|
}
|
|
11642
11753
|
const App = () => {
|
|
11643
|
-
const [loading, setLoading] =
|
|
11644
|
-
const [success, setSuccess] =
|
|
11645
|
-
const [error, setError] =
|
|
11754
|
+
const [loading, setLoading] = useState28(true);
|
|
11755
|
+
const [success, setSuccess] = useState28(null);
|
|
11756
|
+
const [error, setError] = useState28(null);
|
|
11646
11757
|
useEffect25(() => {
|
|
11647
11758
|
const run = async () => {
|
|
11648
11759
|
try {
|