@runtypelabs/cli 2.54.0 → 2.55.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +273 -495
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/cli
|
|
|
41
41
|
import WebSocket from "ws";
|
|
42
42
|
import { Readable, Transform } from "node:stream";
|
|
43
43
|
import { pipeline } from "node:stream/promises";
|
|
44
|
-
|
|
44
|
+
// \0rolldown/runtime.js
|
|
45
45
|
var __defProp = Object.defineProperty;
|
|
46
46
|
var __exportAll = (all, no_symbols) => {
|
|
47
47
|
let target = {};
|
|
@@ -53,8 +53,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
53
53
|
return target;
|
|
54
54
|
};
|
|
55
55
|
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
56
|
-
|
|
57
|
-
//#region ../shared/dist/chunk-CBBsMeGB.mjs
|
|
56
|
+
// ../shared/dist/chunk-D9RiVw4h.mjs
|
|
58
57
|
/**
|
|
59
58
|
* Every product surface type the platform stores and serves. The single source for the FPO surface
|
|
60
59
|
* enum, the REST create and ensure schemas, and the shared `SurfaceType`; add a new type here only.
|
|
@@ -108,8 +107,7 @@ function mergeResults(...results) {
|
|
|
108
107
|
merged.valid = merged.errors.length === 0;
|
|
109
108
|
return merged;
|
|
110
109
|
}
|
|
111
|
-
|
|
112
|
-
//#region ../shared/dist/chunk-DHTzYHWZ.mjs
|
|
110
|
+
// ../shared/dist/chunk-XcxbQPuh.mjs
|
|
113
111
|
/** Names every key of `T` exactly once, so a new credential field fails the build. */
|
|
114
112
|
function credentialKeysOf(presence) {
|
|
115
113
|
return Object.keys(presence);
|
|
@@ -134,14 +132,13 @@ const SURFACE_OUTBOUND_CREDENTIAL_KEYS = credentialKeysOf({
|
|
|
134
132
|
smtpPassword: true
|
|
135
133
|
});
|
|
136
134
|
[.../* @__PURE__ */ new Set([...SURFACE_INBOUND_CREDENTIAL_KEYS, ...SURFACE_OUTBOUND_CREDENTIAL_KEYS])];
|
|
137
|
-
|
|
138
|
-
//#region ../shared/dist/chunk-BXAx6kZN.mjs
|
|
135
|
+
// ../shared/dist/chunk-BgsR9QB6.mjs
|
|
139
136
|
/** Every evaluation model the gateway lists, keyed by the gateway id a call names. */
|
|
140
137
|
const GATEWAY_EVALUATION_MODELS = Object.freeze({
|
|
141
138
|
"baseten/elephant-1": Object.freeze({
|
|
142
139
|
id: "baseten/elephant-1",
|
|
143
140
|
name: "Elephant-1",
|
|
144
|
-
description: "Elephant-1 is a 9B
|
|
141
|
+
description: "Elephant-1 is a 9B decision model from Baseten's Base Labs for classification, routing, and scoring. It evaluates structured context against choice, yes/no, and ordered scoring questions and returns answer probabilities and confidence in a single forward pass, without generating free-form text. Applications can use these probabilities to select answers or set confidence thresholds.",
|
|
145
142
|
contextWindow: 16384,
|
|
146
143
|
supportedSpecifications: Object.freeze(["v4"]),
|
|
147
144
|
pricing: Object.freeze({
|
|
@@ -154,7 +151,7 @@ const GATEWAY_EVALUATION_MODELS = Object.freeze({
|
|
|
154
151
|
"baseten/mammoth-1": Object.freeze({
|
|
155
152
|
id: "baseten/mammoth-1",
|
|
156
153
|
name: "Mammoth-1",
|
|
157
|
-
description: "Mammoth-1 is a 27B
|
|
154
|
+
description: "Mammoth-1 is a 27B decision model from Baseten's Base Labs, fine-tuned from Qwen3.5-27B for classification, routing, and scoring. It answers multiple-choice, yes/no, and ordered scoring questions with probabilities over predefined options rather than generated text. Shared-prefix caching reuses context across questions, while per-option probabilities support confidence thresholds and escalation decisions.",
|
|
158
155
|
contextWindow: 16384,
|
|
159
156
|
supportedSpecifications: Object.freeze(["v4"]),
|
|
160
157
|
pricing: Object.freeze({
|
|
@@ -387,8 +384,7 @@ const modelsById$1 = new Map(models$1.map((model) => [model.id, model]));
|
|
|
387
384
|
function getDecisionModel(modelId) {
|
|
388
385
|
return modelsById$1.get(modelId);
|
|
389
386
|
}
|
|
390
|
-
|
|
391
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
387
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
392
388
|
function getEnumValues(entries) {
|
|
393
389
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
394
390
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -805,6 +801,7 @@ function hide(inst, key, value) {
|
|
|
805
801
|
return own(inst, key, value, false);
|
|
806
802
|
}
|
|
807
803
|
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
804
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
808
805
|
function derived(computes, table) {
|
|
809
806
|
for (const key in computes) {
|
|
810
807
|
const compute = computes[key];
|
|
@@ -928,8 +925,7 @@ function constantCatch(value) {
|
|
|
928
925
|
fn[CONSTANT_CATCH] = true;
|
|
929
926
|
return fn;
|
|
930
927
|
}
|
|
931
|
-
|
|
932
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
|
|
928
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
|
|
933
929
|
var _a$1;
|
|
934
930
|
const _zodDesc = {
|
|
935
931
|
value: void 0,
|
|
@@ -956,6 +952,7 @@ function newError(Definition) {
|
|
|
956
952
|
}
|
|
957
953
|
return new Definition();
|
|
958
954
|
}
|
|
955
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
959
956
|
function $constructor(name, initializer, proto, params) {
|
|
960
957
|
const zodProto = {};
|
|
961
958
|
function Internals(def) {
|
|
@@ -1034,8 +1031,7 @@ function config(newConfig) {
|
|
|
1034
1031
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
1035
1032
|
return globalConfig;
|
|
1036
1033
|
}
|
|
1037
|
-
|
|
1038
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
|
|
1034
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
|
|
1039
1035
|
function _getMessage() {
|
|
1040
1036
|
const internals = this._zod;
|
|
1041
1037
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1086,8 +1082,7 @@ const initializer$1 = (inst, def) => {
|
|
|
1086
1082
|
});
|
|
1087
1083
|
}
|
|
1088
1084
|
};
|
|
1089
|
-
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
1090
|
-
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
1085
|
+
const $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
|
|
1091
1086
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
1092
1087
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
1093
1088
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
@@ -1150,8 +1145,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
1150
1145
|
processError(error);
|
|
1151
1146
|
return fieldErrors;
|
|
1152
1147
|
}
|
|
1153
|
-
|
|
1154
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
|
|
1148
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
|
|
1155
1149
|
function finalizeParams(callee, params) {
|
|
1156
1150
|
return {
|
|
1157
1151
|
callee: params?.callee ?? callee,
|
|
@@ -1353,8 +1347,7 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1353
1347
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1354
1348
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1355
1349
|
};
|
|
1356
|
-
|
|
1357
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
|
|
1350
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
|
|
1358
1351
|
/**
|
|
1359
1352
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
1360
1353
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1426,8 +1419,7 @@ const boolean$1 = /^(?:true|false)$/i;
|
|
|
1426
1419
|
const _null$2 = /^null$/i;
|
|
1427
1420
|
const lowercase = /^[^A-Z]*$/;
|
|
1428
1421
|
const uppercase = /^[^a-z]*$/;
|
|
1429
|
-
|
|
1430
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
|
|
1422
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
|
|
1431
1423
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1432
1424
|
var _a;
|
|
1433
1425
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1722,8 +1714,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1722
1714
|
payload.value = def.tx(payload.value);
|
|
1723
1715
|
};
|
|
1724
1716
|
});
|
|
1725
|
-
|
|
1726
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
|
|
1717
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
|
|
1727
1718
|
var Doc = class {
|
|
1728
1719
|
constructor(args = [], closed = {}) {
|
|
1729
1720
|
this.content = [];
|
|
@@ -1756,15 +1747,13 @@ var Doc = class {
|
|
|
1756
1747
|
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
|
|
1757
1748
|
}
|
|
1758
1749
|
};
|
|
1759
|
-
|
|
1760
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
1750
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
1761
1751
|
const version = {
|
|
1762
1752
|
major: 4,
|
|
1763
1753
|
minor: 6,
|
|
1764
1754
|
patch: 5
|
|
1765
1755
|
};
|
|
1766
|
-
|
|
1767
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
|
|
1756
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
|
|
1768
1757
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1769
1758
|
var _a;
|
|
1770
1759
|
inst ?? (inst = {});
|
|
@@ -3343,8 +3332,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3343
3332
|
payload.issues.push(issue(_iss));
|
|
3344
3333
|
}
|
|
3345
3334
|
}
|
|
3346
|
-
|
|
3347
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
|
|
3335
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
|
|
3348
3336
|
var $ZodCyclicError = class extends Error {
|
|
3349
3337
|
constructor() {
|
|
3350
3338
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3596,8 +3584,7 @@ function isBackEdge(ctx, value) {
|
|
|
3596
3584
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3597
3585
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3598
3586
|
}
|
|
3599
|
-
|
|
3600
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
|
|
3587
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
|
|
3601
3588
|
const error = () => {
|
|
3602
3589
|
const Sizable = {
|
|
3603
3590
|
string: {
|
|
@@ -3704,8 +3691,7 @@ const error = () => {
|
|
|
3704
3691
|
function en_default() {
|
|
3705
3692
|
return { localeError: error() };
|
|
3706
3693
|
}
|
|
3707
|
-
|
|
3708
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
|
|
3694
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
|
|
3709
3695
|
var _a;
|
|
3710
3696
|
var $ZodRegistry = class {
|
|
3711
3697
|
constructor() {
|
|
@@ -3751,8 +3737,7 @@ function registry() {
|
|
|
3751
3737
|
}
|
|
3752
3738
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3753
3739
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3754
|
-
|
|
3755
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
|
|
3740
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
|
|
3756
3741
|
function snapshotChecks(def) {
|
|
3757
3742
|
if (def.checks) def.checks = [...def.checks];
|
|
3758
3743
|
return def;
|
|
@@ -4291,8 +4276,7 @@ function _check(fn, params) {
|
|
|
4291
4276
|
ch._zod.check = fn;
|
|
4292
4277
|
return ch;
|
|
4293
4278
|
}
|
|
4294
|
-
|
|
4295
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
|
|
4279
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
|
|
4296
4280
|
function assignProps(target, ...sources) {
|
|
4297
4281
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
4298
4282
|
return target;
|
|
@@ -4735,8 +4719,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
4735
4719
|
extractDefs(ctx, schema);
|
|
4736
4720
|
return finalize$1(ctx, schema);
|
|
4737
4721
|
};
|
|
4738
|
-
|
|
4739
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
4722
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
4740
4723
|
const narrowMin = (agg, key, value) => {
|
|
4741
4724
|
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4742
4725
|
};
|
|
@@ -5381,8 +5364,7 @@ function toJSONSchema(input, params) {
|
|
|
5381
5364
|
extractDefs(ctx, input);
|
|
5382
5365
|
return finalize$1(ctx, input);
|
|
5383
5366
|
}
|
|
5384
|
-
|
|
5385
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
|
|
5367
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
|
|
5386
5368
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5387
5369
|
function _lazyMethod(proto, key, make) {
|
|
5388
5370
|
Object.defineProperty(proto, key, {
|
|
@@ -5431,8 +5413,7 @@ const initializer = (inst, issues) => {
|
|
|
5431
5413
|
});
|
|
5432
5414
|
};
|
|
5433
5415
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
5434
|
-
|
|
5435
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
|
|
5416
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
|
|
5436
5417
|
const parse$1 = /* @__PURE__ */ _parse(ZodRealError);
|
|
5437
5418
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5438
5419
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5445,8 +5426,7 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
5445
5426
|
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
5446
5427
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5447
5428
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5448
|
-
|
|
5449
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
|
|
5429
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
|
|
5450
5430
|
function _ensureDefaultLocale() {
|
|
5451
5431
|
if (!globalConfig.localeError) config(en_default());
|
|
5452
5432
|
}
|
|
@@ -6422,8 +6402,7 @@ function preprocess(fn, schema) {
|
|
|
6422
6402
|
out: schema
|
|
6423
6403
|
});
|
|
6424
6404
|
}
|
|
6425
|
-
|
|
6426
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.js
|
|
6405
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.js
|
|
6427
6406
|
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
6428
6407
|
const ZodIssueCode = {
|
|
6429
6408
|
invalid_type: "invalid_type",
|
|
@@ -6441,21 +6420,18 @@ const ZodIssueCode = {
|
|
|
6441
6420
|
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
6442
6421
|
var ZodFirstPartyTypeKind;
|
|
6443
6422
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6444
|
-
|
|
6445
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
6423
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
6446
6424
|
function datetime(params) {
|
|
6447
6425
|
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
6448
6426
|
}
|
|
6449
6427
|
function date(params) {
|
|
6450
6428
|
return /* @__PURE__ */ _isoDate(ZodISODate, params);
|
|
6451
6429
|
}
|
|
6452
|
-
|
|
6453
|
-
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.js
|
|
6430
|
+
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.js
|
|
6454
6431
|
function number(params) {
|
|
6455
6432
|
return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
|
|
6456
6433
|
}
|
|
6457
|
-
|
|
6458
|
-
//#region ../shared/dist/chunk-DKcBd-4r.mjs
|
|
6434
|
+
// ../shared/dist/chunk-BwvziRCX.mjs
|
|
6459
6435
|
const judgmentJsonValueSchema = lazy(() => union([
|
|
6460
6436
|
_null(),
|
|
6461
6437
|
string(),
|
|
@@ -6542,7 +6518,7 @@ const judgmentQuestionMessages = {
|
|
|
6542
6518
|
scoreLevelCount: (id, count) => count === void 0 ? `Score question "${id}" needs criteria as an ordered list of 2 to 10 levels.` : `Score question "${id}" has ${count} ${count === 1 ? "level" : "levels"}, but a score question needs 2 to 10.`,
|
|
6543
6519
|
malformed: (id, path, detail) => `Question "${id}" is malformed at ${path.length > 0 ? path.join(".") : "its root"}: ${detail.replace(/\.$/, "")}.`
|
|
6544
6520
|
};
|
|
6545
|
-
function isPlainObject$
|
|
6521
|
+
function isPlainObject$3(value) {
|
|
6546
6522
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6547
6523
|
}
|
|
6548
6524
|
function instructionsMissing(value) {
|
|
@@ -6550,7 +6526,7 @@ function instructionsMissing(value) {
|
|
|
6550
6526
|
return typeof value === "string" && value.trim().length === 0;
|
|
6551
6527
|
}
|
|
6552
6528
|
function collectRuleIssues(id, question) {
|
|
6553
|
-
if (!isPlainObject$
|
|
6529
|
+
if (!isPlainObject$3(question)) return [{
|
|
6554
6530
|
code: "JUDGMENT_QUESTION_NOT_OBJECT",
|
|
6555
6531
|
path: [id],
|
|
6556
6532
|
message: judgmentQuestionMessages.notObject(id)
|
|
@@ -6569,7 +6545,7 @@ function collectRuleIssues(id, question) {
|
|
|
6569
6545
|
});
|
|
6570
6546
|
const criteria = question.criteria;
|
|
6571
6547
|
if (type === "choice") {
|
|
6572
|
-
if (!isPlainObject$
|
|
6548
|
+
if (!isPlainObject$3(criteria) || Object.keys(criteria).length === 0) issues.push({
|
|
6573
6549
|
code: "JUDGMENT_CHOICE_CRITERIA_EMPTY",
|
|
6574
6550
|
path: [id, "criteria"],
|
|
6575
6551
|
message: judgmentQuestionMessages.choiceCriteriaEmpty(id)
|
|
@@ -6608,7 +6584,7 @@ function collectShapeIssues(id, question) {
|
|
|
6608
6584
|
* an author sees the rule's sentence rather than a generic parser message.
|
|
6609
6585
|
*/
|
|
6610
6586
|
function validateJudgmentQuestions(questions) {
|
|
6611
|
-
if (!isPlainObject$
|
|
6587
|
+
if (!isPlainObject$3(questions) || Object.keys(questions).length === 0) return [{
|
|
6612
6588
|
code: "JUDGMENT_NO_QUESTIONS",
|
|
6613
6589
|
path: [],
|
|
6614
6590
|
message: judgmentQuestionMessages.noQuestions()
|
|
@@ -6767,8 +6743,7 @@ function hasNoReservedInputKeys(inputs) {
|
|
|
6767
6743
|
if (!inputs) return true;
|
|
6768
6744
|
return Object.keys(inputs).every((key) => !key.startsWith("_"));
|
|
6769
6745
|
}
|
|
6770
|
-
|
|
6771
|
-
//#region ../shared/dist/chunk-CBi4Kg_f.mjs
|
|
6746
|
+
// ../shared/dist/chunk-DWLsnzbx.mjs
|
|
6772
6747
|
/**
|
|
6773
6748
|
* Get nested property value using dot notation and bracket notation.
|
|
6774
6749
|
* Example: getNestedValue({user: {name: 'John'}}, 'user.name') returns 'John'.
|
|
@@ -7112,8 +7087,7 @@ function resolveFallback(parsed, context, tracking, options = {}) {
|
|
|
7112
7087
|
return tracking.match;
|
|
7113
7088
|
}
|
|
7114
7089
|
new SimpleTemplateEngine();
|
|
7115
|
-
|
|
7116
|
-
//#region ../shared/dist/chunk-DYthNbe0.mjs
|
|
7090
|
+
// ../shared/dist/chunk-CRRVsJap.mjs
|
|
7117
7091
|
/**
|
|
7118
7092
|
* Canonical record type guard: a non-null object that is NOT an array.
|
|
7119
7093
|
* This is the array-EXCLUDING variant — `isRecord([])` is false.
|
|
@@ -7121,8 +7095,7 @@ new SimpleTemplateEngine();
|
|
|
7121
7095
|
function isRecord$5(value) {
|
|
7122
7096
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7123
7097
|
}
|
|
7124
|
-
|
|
7125
|
-
//#region ../shared/dist/chunk-CFak88Vc.mjs
|
|
7098
|
+
// ../shared/dist/chunk-DJMWTgFP.mjs
|
|
7126
7099
|
/**
|
|
7127
7100
|
* The AI-SDK tool-name sanitizer, as a dependency-free leaf.
|
|
7128
7101
|
* Canonical home: the rule is enforced in three places that cannot all import model-execution.
|
|
@@ -7151,8 +7124,7 @@ function modelVisibleToolName(toolId) {
|
|
|
7151
7124
|
function toolNamesCollideForAiSdk(left, right) {
|
|
7152
7125
|
return sanitizeToolNameForAiSdk(left) === sanitizeToolNameForAiSdk(right);
|
|
7153
7126
|
}
|
|
7154
|
-
|
|
7155
|
-
//#region ../shared/dist/chunk-HH7aA8wp.mjs
|
|
7127
|
+
// ../shared/dist/chunk-DZsv6wYf.mjs
|
|
7156
7128
|
const BUILTIN_TOOLS_LEAN = [
|
|
7157
7129
|
{
|
|
7158
7130
|
"id": "gpt-image-2-5",
|
|
@@ -9636,8 +9608,7 @@ const BUILTIN_TOOLS_LEAN = [
|
|
|
9636
9608
|
"managedExecutionKind": "orthogonal"
|
|
9637
9609
|
}
|
|
9638
9610
|
];
|
|
9639
|
-
|
|
9640
|
-
//#region ../shared/dist/chunk-CS4x6DfE.mjs
|
|
9611
|
+
// ../shared/dist/chunk-B-U9MA7t.mjs
|
|
9641
9612
|
const BuiltInToolProvider = {
|
|
9642
9613
|
OPENAI: "openai",
|
|
9643
9614
|
ANTHROPIC: "anthropic",
|
|
@@ -9681,8 +9652,7 @@ const BuiltInToolGroup = {
|
|
|
9681
9652
|
SANDBOX_AGENT: "sandbox_agent",
|
|
9682
9653
|
TEMPORAL: "temporal"
|
|
9683
9654
|
};
|
|
9684
|
-
|
|
9685
|
-
//#region ../shared/dist/chunk-B_P1LIsa.mjs
|
|
9655
|
+
// ../shared/dist/chunk-DsafYLgI.mjs
|
|
9686
9656
|
/**
|
|
9687
9657
|
* Built-in Model Tools Registry — the LEAN tier.
|
|
9688
9658
|
*
|
|
@@ -9741,8 +9711,7 @@ function isToolCompatibleWithModel(toolId, modelId, provider) {
|
|
|
9741
9711
|
if (compatibility.models.length === 0) return true;
|
|
9742
9712
|
return compatibility.models.some((m) => modelId.includes(m));
|
|
9743
9713
|
}
|
|
9744
|
-
|
|
9745
|
-
//#region ../shared/dist/chunk-CL_QZn3S.mjs
|
|
9714
|
+
// ../shared/dist/chunk-9uTZDlBG.mjs
|
|
9746
9715
|
const nonNegativeInteger = number$1().int().nonnegative();
|
|
9747
9716
|
const annotations = {
|
|
9748
9717
|
title: string().optional(),
|
|
@@ -9816,8 +9785,7 @@ function isSupportedElicitationSchema(schema) {
|
|
|
9816
9785
|
const parsed = schemaNode.safeParse(schema);
|
|
9817
9786
|
return parsed.success && typeof parsed.data !== "boolean" && parsed.data.type === "object";
|
|
9818
9787
|
}
|
|
9819
|
-
|
|
9820
|
-
//#region ../shared/dist/chunk-BcjKHO7O.mjs
|
|
9788
|
+
// ../shared/dist/chunk-DBw0Iwzv.mjs
|
|
9821
9789
|
/** The Tenancy Assurance Levels, in the order `tenancyAssuranceLevelSchema` is built from. */
|
|
9822
9790
|
const TENANCY_ASSURANCE_LEVELS = [
|
|
9823
9791
|
"anonymous",
|
|
@@ -9860,8 +9828,7 @@ function identityAudienceAllowed(audience, patterns) {
|
|
|
9860
9828
|
return HOSTNAME_LABEL.test(label);
|
|
9861
9829
|
});
|
|
9862
9830
|
}
|
|
9863
|
-
|
|
9864
|
-
//#region ../shared/dist/chunk-CCF2zL4u.mjs
|
|
9831
|
+
// ../shared/dist/chunk-sRQYvcOi.mjs
|
|
9865
9832
|
function extractSecretReferences(template) {
|
|
9866
9833
|
const keys = /* @__PURE__ */ new Set();
|
|
9867
9834
|
let match;
|
|
@@ -10449,8 +10416,7 @@ function separateToolIds(toolIds) {
|
|
|
10449
10416
|
function isDataConnectionToolId(toolId) {
|
|
10450
10417
|
return toolId.startsWith("dc:");
|
|
10451
10418
|
}
|
|
10452
|
-
|
|
10453
|
-
//#region ../shared/dist/chunk-RD6b0or7.mjs
|
|
10419
|
+
// ../shared/dist/chunk-DTtvtyD1.mjs
|
|
10454
10420
|
/**
|
|
10455
10421
|
* The reserved model-facing name of the agent state write tool
|
|
10456
10422
|
* (`packages/runtime/src/engine/state-write-tool.ts`). The model is told to call
|
|
@@ -10511,8 +10477,7 @@ function resolveDirectProviderToolOwner(toolId) {
|
|
|
10511
10477
|
const owner = ownerOf(toolId);
|
|
10512
10478
|
return owner && DIRECT_PROVIDER_TOOL_OWNERS.has(owner) ? owner : void 0;
|
|
10513
10479
|
}
|
|
10514
|
-
|
|
10515
|
-
//#region ../shared/dist/chunk-C-OBmD9q.mjs
|
|
10480
|
+
// ../shared/dist/chunk-CCggKUGZ.mjs
|
|
10516
10481
|
/**
|
|
10517
10482
|
* Unwraps a single {{variableName}} template to its bare variable name, preserving array/object identity instead of stringifying via the template engine.
|
|
10518
10483
|
* Returns source unchanged when it is not a lone {{...}} wrapper.
|
|
@@ -10558,8 +10523,7 @@ function getConditionalBranches(config) {
|
|
|
10558
10523
|
isBinary: true
|
|
10559
10524
|
};
|
|
10560
10525
|
}
|
|
10561
|
-
|
|
10562
|
-
//#region ../shared/dist/chunk-D-Avt9oa.mjs
|
|
10526
|
+
// ../shared/dist/chunk-DaWm3aVW.mjs
|
|
10563
10527
|
/** Post-normalization metadata key shape. Mirrors the api's key-length cap (64). */
|
|
10564
10528
|
const RECORD_COLLECTION_FIELD_NAME_PATTERN = /^[a-z0-9_]{1,64}$/;
|
|
10565
10529
|
const RECORD_COLLECTION_VALIDATION_MODES = [
|
|
@@ -10675,8 +10639,7 @@ function parseRecordCollectionSchema(input) {
|
|
|
10675
10639
|
}))
|
|
10676
10640
|
};
|
|
10677
10641
|
}
|
|
10678
|
-
|
|
10679
|
-
//#region ../shared/dist/browser-domain-policy.mjs
|
|
10642
|
+
// ../shared/dist/browser-domain-policy.mjs
|
|
10680
10643
|
function canonicalHostname(hostname) {
|
|
10681
10644
|
let end = hostname.length;
|
|
10682
10645
|
while (end > 0 && hostname.charCodeAt(end - 1) === 46) end--;
|
|
@@ -10701,8 +10664,7 @@ const COMPACTION_STRATEGIES = [
|
|
|
10701
10664
|
"provider_native",
|
|
10702
10665
|
"summary"
|
|
10703
10666
|
];
|
|
10704
|
-
|
|
10705
|
-
//#region ../shared/dist/chunk-fDlRxlNl.mjs
|
|
10667
|
+
// ../shared/dist/chunk-65wXea33.mjs
|
|
10706
10668
|
const EXTRACTION_FIELD_TYPES = [
|
|
10707
10669
|
"text",
|
|
10708
10670
|
"number",
|
|
@@ -10816,8 +10778,7 @@ object({
|
|
|
10816
10778
|
schemaTokens: number$1().int().min(0).optional(),
|
|
10817
10779
|
passes: number$1().int().min(0).optional()
|
|
10818
10780
|
});
|
|
10819
|
-
|
|
10820
|
-
//#region ../shared/dist/chunk-BQYclXzM.mjs
|
|
10781
|
+
// ../shared/dist/chunk-aBxNuVz7.mjs
|
|
10821
10782
|
const CONTEXT_STEP_TYPES = [
|
|
10822
10783
|
"crawl",
|
|
10823
10784
|
"fetch-url",
|
|
@@ -10851,8 +10812,7 @@ const CONTEXT_STEP_TYPES = [
|
|
|
10851
10812
|
"extract"
|
|
10852
10813
|
];
|
|
10853
10814
|
const FLOW_STEP_TYPES = ["prompt", ...CONTEXT_STEP_TYPES];
|
|
10854
|
-
|
|
10855
|
-
//#region ../shared/dist/durable-poll-limits.mjs
|
|
10815
|
+
// ../shared/dist/durable-poll-limits.mjs
|
|
10856
10816
|
/**
|
|
10857
10817
|
* Durable-poll budget limits shared between the api's Cloudflare Workflow poll loops and the author-time flow validator.
|
|
10858
10818
|
* Cloudflare Workflows bounds an instance to 10,000 steps (paid plan); each poll attempt consumes up to TWO steps.
|
|
@@ -10944,8 +10904,7 @@ function durableCrawlBudget(plan) {
|
|
|
10944
10904
|
worstCaseMs: Math.max(nominalBudgetMs, requestOverheadMs + sleepMs)
|
|
10945
10905
|
};
|
|
10946
10906
|
}
|
|
10947
|
-
|
|
10948
|
-
//#region ../shared/dist/chunk-jV5RTDSl.mjs
|
|
10907
|
+
// ../shared/dist/chunk-BQzmoulw.mjs
|
|
10949
10908
|
const DEFAULT_EXTRACTION_MODEL = "@cf/cloudflare/clairic";
|
|
10950
10909
|
const MIB = 1048576;
|
|
10951
10910
|
const clairic = Object.freeze({
|
|
@@ -11093,16 +11052,14 @@ function validateExtractionFields(fields) {
|
|
|
11093
11052
|
* fragments, and the agent-facing skill references.
|
|
11094
11053
|
*/
|
|
11095
11054
|
const DISPATCH_TRANSIENT_SECRETS_RETIRED_NOTE = `Retired on BOTH dispatch targets. A NON-EMPTY map is rejected with 400: RUNTIME_AGENT_TRANSIENT_SECRETS_UNSUPPORTED on an agent dispatch, RUNTIME_FLOW_TRANSIENT_SECRETS_UNSUPPORTED on a flow dispatch (the flow target used to drop the map silently). An empty map is accepted and does nothing. Store credentials as managed secrets and reference them as {{secret:NAME}}. The field is kept on the wire for compatibility only.`;
|
|
11096
|
-
|
|
11097
|
-
//#region ../shared/dist/dispatch-timeout-limits.mjs
|
|
11055
|
+
// ../shared/dist/dispatch-timeout-limits.mjs
|
|
11098
11056
|
/**
|
|
11099
11057
|
* Continuous-run ceiling for a Flow detached through `Prefer: respond-async`.
|
|
11100
11058
|
* Cloudflare Workflows caps an explicitly configured `step.do` timeout at the
|
|
11101
11059
|
* same 30-minute boundary, and batch execution already exposes this budget.
|
|
11102
11060
|
*/
|
|
11103
11061
|
const ASYNC_DISPATCH_TIMEOUT_MAX_MS = 18e5;
|
|
11104
|
-
|
|
11105
|
-
//#region ../shared/dist/container-sandbox-timeout.mjs
|
|
11062
|
+
// ../shared/dist/container-sandbox-timeout.mjs
|
|
11106
11063
|
/**
|
|
11107
11064
|
* The Cloudflare container instance type every Runtype sandbox provisions (a deployment fact, not a producer choice).
|
|
11108
11065
|
* Carried on the exec RPC and sandbox_billing_sessions because the spend ledger's rate card keys by instance type.
|
|
@@ -11110,8 +11067,7 @@ const ASYNC_DISPATCH_TIMEOUT_MAX_MS = 18e5;
|
|
|
11110
11067
|
* Pinned against wrangler config by apps/sandbox/tests/wrangler-instance-type-lockstep.test.ts.
|
|
11111
11068
|
*/
|
|
11112
11069
|
const CONTAINER_SANDBOX_INSTANCE_TYPE = "standard-4";
|
|
11113
|
-
|
|
11114
|
-
//#region ../shared/dist/chunk-2GuzPgAk.mjs
|
|
11070
|
+
// ../shared/dist/chunk-DH-C5yxa.mjs
|
|
11115
11071
|
/** The person a turn runs as: exposed to tools as `_endUser.*`, shards memory, and satisfies `end-user-isolated`. */
|
|
11116
11072
|
const hostEndUserIdentitySchema = object({
|
|
11117
11073
|
id: string().min(1),
|
|
@@ -11431,8 +11387,7 @@ object({
|
|
|
11431
11387
|
expected: caseExpectedSchema.optional(),
|
|
11432
11388
|
notes: string().optional()
|
|
11433
11389
|
}).strict();
|
|
11434
|
-
|
|
11435
|
-
//#region ../shared/dist/tool-annotations.mjs
|
|
11390
|
+
// ../shared/dist/tool-annotations.mjs
|
|
11436
11391
|
/** Advisory WebMCP and MCP metadata; never an authorization or replay-safety grant. */
|
|
11437
11392
|
const ToolAnnotationsSchema = object({
|
|
11438
11393
|
readOnlyHint: boolean().optional(),
|
|
@@ -11443,8 +11398,7 @@ const ToolAnnotationsSchema = object({
|
|
|
11443
11398
|
openWorldHint: boolean().optional(),
|
|
11444
11399
|
debugging: boolean().optional()
|
|
11445
11400
|
});
|
|
11446
|
-
|
|
11447
|
-
//#region ../shared/dist/chunk-Cwt-3iUR.mjs
|
|
11401
|
+
// ../shared/dist/chunk-Rt9Q4CVj.mjs
|
|
11448
11402
|
/**
|
|
11449
11403
|
* Inline client-side tool executed on the dispatching client (browser/SDK), not on Runtype.
|
|
11450
11404
|
* `origin: 'webmcp'` marks tools harvested from `document.modelContext` and requires a `webmcp:` name prefix.
|
|
@@ -11542,8 +11496,7 @@ object({
|
|
|
11542
11496
|
externalId: string().min(1).max(500).optional().describe("The conversation id in the source system. Re-creating with the same system and externalId returns the existing conversation with imported: false instead of a duplicate."),
|
|
11543
11497
|
importedAt: string().datetime({ offset: true }).optional()
|
|
11544
11498
|
});
|
|
11545
|
-
|
|
11546
|
-
//#region ../shared/dist/chunk-DPqK6XE9.mjs
|
|
11499
|
+
// ../shared/dist/chunk--1WwmeLq.mjs
|
|
11547
11500
|
const voiceInterruptionModeSchema = _enum([
|
|
11548
11501
|
"none",
|
|
11549
11502
|
"cancel",
|
|
@@ -21889,7 +21842,7 @@ const fpoTemplateVariableSchema = object({
|
|
|
21889
21842
|
path: ["options"]
|
|
21890
21843
|
});
|
|
21891
21844
|
});
|
|
21892
|
-
function isPlainObject$
|
|
21845
|
+
function isPlainObject$4(value) {
|
|
21893
21846
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21894
21847
|
}
|
|
21895
21848
|
function valueAtPath(root, path) {
|
|
@@ -21921,7 +21874,7 @@ function isDeferredToResolution(issue, productObject, basePath = []) {
|
|
|
21921
21874
|
/** Whether a template needs setup beyond its variables: declared or referenced secrets. */
|
|
21922
21875
|
function declaresPendingSecrets(productObject) {
|
|
21923
21876
|
if ((Array.isArray(productObject.tools) ? productObject.tools : []).some((tool) => {
|
|
21924
|
-
const auth = isPlainObject$
|
|
21877
|
+
const auth = isPlainObject$4(tool) && isPlainObject$4(tool.auth) ? tool.auth : void 0;
|
|
21925
21878
|
return auth?.setupRequired === true && Array.isArray(auth.secrets) && auth.secrets.length > 0;
|
|
21926
21879
|
})) return true;
|
|
21927
21880
|
if (Array.isArray(productObject.secrets) && productObject.secrets.length > 0) return true;
|
|
@@ -21929,7 +21882,7 @@ function declaresPendingSecrets(productObject) {
|
|
|
21929
21882
|
}
|
|
21930
21883
|
const fullProductObjectTemplateSchema = object({
|
|
21931
21884
|
version: _enum(["1.0", "1.1"]),
|
|
21932
|
-
productObject: custom(isPlainObject$
|
|
21885
|
+
productObject: custom(isPlainObject$4, { message: "productObject must be a Full Product Object" }),
|
|
21933
21886
|
template: object({ variables: array(fpoTemplateVariableSchema).max(50) }),
|
|
21934
21887
|
internalDocs: internalDocsSchema.optional()
|
|
21935
21888
|
}).superRefine((doc, ctx) => {
|
|
@@ -22152,8 +22105,7 @@ function validateFPOTemplate(body, options = {}) {
|
|
|
22152
22105
|
defaultsValidation
|
|
22153
22106
|
};
|
|
22154
22107
|
}
|
|
22155
|
-
|
|
22156
|
-
//#region ../shared/dist/chunk-DwruX1rx.mjs
|
|
22108
|
+
// ../shared/dist/chunk-BM6tsheI.mjs
|
|
22157
22109
|
/**
|
|
22158
22110
|
* A single RFC-6902 operation, JSON-shape so Zod-first per `.claude/rules/runtime.md`.
|
|
22159
22111
|
* value/from are optional at the schema level rather than a discriminated union.
|
|
@@ -22179,8 +22131,7 @@ const jsonPatchOperationSchema = object({
|
|
|
22179
22131
|
/** An RFC-6902 patch: an ordered, atomically-applied list of operations. */
|
|
22180
22132
|
const jsonPatchSchema = array(jsonPatchOperationSchema);
|
|
22181
22133
|
new Set(jsonPatchOperationSchema.shape.op.options);
|
|
22182
|
-
|
|
22183
|
-
//#region ../shared/dist/unified-terminal-outcome.mjs
|
|
22134
|
+
// ../shared/dist/unified-terminal-outcome.mjs
|
|
22184
22135
|
/**
|
|
22185
22136
|
* How a unified execution ended, carried as `outcome` on `execution_complete` and `execution_error`.
|
|
22186
22137
|
* A pause is not an outcome: it ends the stream on `approval_start` / `await` with no terminal frame.
|
|
@@ -22190,8 +22141,7 @@ const UNIFIED_TERMINAL_OUTCOMES = [
|
|
|
22190
22141
|
"error",
|
|
22191
22142
|
"aborted"
|
|
22192
22143
|
];
|
|
22193
|
-
|
|
22194
|
-
//#region ../shared/dist/chunk-CAzK0R6E.mjs
|
|
22144
|
+
// ../shared/dist/chunk-mLybVlrx.mjs
|
|
22195
22145
|
const tokensSchema$1 = object({
|
|
22196
22146
|
input: number$1(),
|
|
22197
22147
|
output: number$1()
|
|
@@ -22850,8 +22800,7 @@ const UNIFIED_SSE_EVENT_TYPES = _unifiedTuple([
|
|
|
22850
22800
|
"ping",
|
|
22851
22801
|
"custom"
|
|
22852
22802
|
]);
|
|
22853
|
-
|
|
22854
|
-
//#region ../shared/dist/chunk-LEMSxKn9.mjs
|
|
22803
|
+
// ../shared/dist/chunk-BH-i05S2.mjs
|
|
22855
22804
|
/** {@link MediaContentPart} — mirror of the union in `../media-types`. */
|
|
22856
22805
|
const mediaAnnotationsSchema = object({ audience: array(_enum(["user", "assistant"])).optional() });
|
|
22857
22806
|
const mediaContentPartSchema = union([
|
|
@@ -23559,8 +23508,7 @@ discriminatedUnion("type", [
|
|
|
23559
23508
|
}).passthrough()
|
|
23560
23509
|
]);
|
|
23561
23510
|
new Set(UNIFIED_SSE_EVENT_TYPES);
|
|
23562
|
-
|
|
23563
|
-
//#region ../shared/dist/chunk-B4H63iE3.mjs
|
|
23511
|
+
// ../shared/dist/chunk-DoHuU_c7.mjs
|
|
23564
23512
|
/** Types the extraction model answers. */
|
|
23565
23513
|
const SIGNAL_EXTRACTION_TYPES = [
|
|
23566
23514
|
"text",
|
|
@@ -23908,8 +23856,7 @@ object({
|
|
|
23908
23856
|
agentExecutionRowId: string().nullable().describe("The agent_executions ROW id the scheduled run stored. Provenance only: a different id space from executionId, and never a /v1/runs key."),
|
|
23909
23857
|
batchExecutionId: string().nullable().describe("The batch whose per-record runs are GET /v1/runs?batchExecutionId=.")
|
|
23910
23858
|
});
|
|
23911
|
-
|
|
23912
|
-
//#region ../shared/dist/chunk-Di71fDrM.mjs
|
|
23859
|
+
// ../shared/dist/chunk-COkqZIIU.mjs
|
|
23913
23860
|
const HTTP_REASON_PHRASES = "bad request|unauthori[sz]ed|forbidden|not found|method not allowed|request timeout|conflict|gone|unprocessable entity|too many requests|internal server error|not implemented|bad gateway|service unavailable|gateway timeout";
|
|
23914
23861
|
/** A bare status number ends the message, meets punctuation (not a `,000` digit group), or leads its reason phrase. */
|
|
23915
23862
|
const STATUS_NUMBER_END = String.raw`(?=\s*$|[:;)\]]|[.,](?!\d)|\s*[:-]?\s*(?:${HTTP_REASON_PHRASES})\b)`;
|
|
@@ -23939,8 +23886,7 @@ const GEN_AI_ATTRIBUTES = {
|
|
|
23939
23886
|
toolType: "gen_ai.tool.type",
|
|
23940
23887
|
toolCallId: "gen_ai.tool.call.id"
|
|
23941
23888
|
};
|
|
23942
|
-
|
|
23943
|
-
//#region ../shared/dist/context-manifest-wire.mjs
|
|
23889
|
+
// ../shared/dist/context-manifest-wire.mjs
|
|
23944
23890
|
const entryTupleSchema = union([tuple([
|
|
23945
23891
|
string(),
|
|
23946
23892
|
number$1().int(),
|
|
@@ -23980,8 +23926,7 @@ object({
|
|
|
23980
23926
|
content: string(),
|
|
23981
23927
|
truncated: boolean()
|
|
23982
23928
|
});
|
|
23983
|
-
|
|
23984
|
-
//#region ../shared/dist/chunk-_ZhmfUpr.mjs
|
|
23929
|
+
// ../shared/dist/chunk-B0KsOsGW.mjs
|
|
23985
23930
|
/**
|
|
23986
23931
|
* GenAI semconv content attributes, set by a customer's own instrumentation when it opts into content export.
|
|
23987
23932
|
* Two first-party producers write them: @runtypelabs/runtime's OTLP tracer for exported agents (content on by default), and @runtypelabs/flue-otel (opt-in).
|
|
@@ -24051,8 +23996,7 @@ const CLOUDFLARE_AGENTS_CONTENT_PREFIXES = ["cloudflare.agents.metadata.", "clou
|
|
|
24051
23996
|
];
|
|
24052
23997
|
[...Object.values(GEN_AI_CONTENT_ATTRIBUTES), ...Object.values(GEN_AI_CONTENT_ATTRIBUTE_ALIASES).flat()];
|
|
24053
23998
|
GEN_AI_ATTRIBUTES.responseModel;
|
|
24054
|
-
|
|
24055
|
-
//#region ../shared/dist/chunk-DKbPTNRC.mjs
|
|
23999
|
+
// ../shared/dist/chunk-MA677TZK.mjs
|
|
24056
24000
|
/**
|
|
24057
24001
|
* Regex-only HTML adapter for source-injection isolates, where DOMParser and
|
|
24058
24002
|
* HTMLRewriter are unavailable. This function is intentionally self-contained
|
|
@@ -24399,8 +24343,7 @@ _enum([
|
|
|
24399
24343
|
"cancelled",
|
|
24400
24344
|
"interrupted"
|
|
24401
24345
|
]);
|
|
24402
|
-
|
|
24403
|
-
//#region ../shared/dist/chunk-BCcCVYD-.mjs
|
|
24346
|
+
// ../shared/dist/chunk-aheuzo9K.mjs
|
|
24404
24347
|
/**
|
|
24405
24348
|
* Maps model families to provider-specific model IDs.
|
|
24406
24349
|
* Use for routing: family + provider → exact model ID
|
|
@@ -24725,8 +24668,6 @@ const MODEL_FAMILY_PROVIDER_IDS = {
|
|
|
24725
24668
|
"openai": "gpt-4.1-nano",
|
|
24726
24669
|
"vercel": "openai/gpt-4.1-nano"
|
|
24727
24670
|
},
|
|
24728
|
-
"gpt-4-1-nano-batch": { "vercel": "openai/gpt-4.1-nano-batch" },
|
|
24729
|
-
"gpt-4-1-nano-fast": { "vercel": "openai/gpt-4.1-nano-fast" },
|
|
24730
24671
|
"gpt-4.1": {
|
|
24731
24672
|
"openai": "gpt-4.1",
|
|
24732
24673
|
"vercel": "openai/gpt-4.1"
|
|
@@ -24743,8 +24684,6 @@ const MODEL_FAMILY_PROVIDER_IDS = {
|
|
|
24743
24684
|
"openai": "gpt-4.1-nano",
|
|
24744
24685
|
"vercel": "openai/gpt-4.1-nano"
|
|
24745
24686
|
},
|
|
24746
|
-
"gpt-4.1-nano-batch": { "vercel": "openai/gpt-4.1-nano-batch" },
|
|
24747
|
-
"gpt-4.1-nano-fast": { "vercel": "openai/gpt-4.1-nano-fast" },
|
|
24748
24687
|
"gpt-4o": {
|
|
24749
24688
|
"openai": "gpt-4o",
|
|
24750
24689
|
"vercel": "openai/gpt-4o"
|
|
@@ -24930,9 +24869,9 @@ const MODEL_FAMILY_PROVIDER_IDS = {
|
|
|
24930
24869
|
"openai": "gpt-6.1-sol",
|
|
24931
24870
|
"vercel": "openai/gpt-6.1-sol"
|
|
24932
24871
|
},
|
|
24933
|
-
"gpt-6-1-sol-ultrafast": { "openai": "gpt-6.1-sol-ultrafast" },
|
|
24934
24872
|
"gpt-6-1-sol-batch": { "vercel": "openai/gpt-6.1-sol-batch" },
|
|
24935
24873
|
"gpt-6-1-sol-fast": { "vercel": "openai/gpt-6.1-sol-fast" },
|
|
24874
|
+
"gpt-6-1-sol-ultrafast": { "openai": "gpt-6.1-sol-ultrafast" },
|
|
24936
24875
|
"gpt-6-astra": {
|
|
24937
24876
|
"openai": "gpt-6-astra",
|
|
24938
24877
|
"vercel": "openai/gpt-6-astra"
|
|
@@ -24955,9 +24894,9 @@ const MODEL_FAMILY_PROVIDER_IDS = {
|
|
|
24955
24894
|
"openai": "gpt-6.1-sol",
|
|
24956
24895
|
"vercel": "openai/gpt-6.1-sol"
|
|
24957
24896
|
},
|
|
24958
|
-
"gpt-6.1-sol-ultrafast": { "openai": "gpt-6.1-sol-ultrafast" },
|
|
24959
24897
|
"gpt-6.1-sol-batch": { "vercel": "openai/gpt-6.1-sol-batch" },
|
|
24960
24898
|
"gpt-6.1-sol-fast": { "vercel": "openai/gpt-6.1-sol-fast" },
|
|
24899
|
+
"gpt-6.1-sol-ultrafast": { "openai": "gpt-6.1-sol-ultrafast" },
|
|
24961
24900
|
"gpt-image-1-5": { "openai": "gpt-image-1.5" },
|
|
24962
24901
|
"gpt-image-1-mini": { "openai": "gpt-image-1-mini" },
|
|
24963
24902
|
"gpt-image-1.5": { "openai": "gpt-image-1.5" },
|
|
@@ -25042,7 +24981,11 @@ const MODEL_FAMILY_PROVIDER_IDS = {
|
|
|
25042
24981
|
"kimi-k2.7-code": { "vercel": "moonshotai/kimi-k2.7-code" },
|
|
25043
24982
|
"kimi-k2.7-code-highspeed": { "vercel": "moonshotai/kimi-k2.7-code-highspeed" },
|
|
25044
24983
|
"kimi-k3": { "vercel": "moonshotai/kimi-k3" },
|
|
24984
|
+
"kimi-k3-1-pro": { "vercel": "moonshotai/kimi-k3.1-pro" },
|
|
24985
|
+
"kimi-k3-1-pro-highspeed": { "vercel": "moonshotai/kimi-k3.1-pro-highspeed" },
|
|
25045
24986
|
"kimi-k3-fast": { "vercel": "moonshotai/kimi-k3-fast" },
|
|
24987
|
+
"kimi-k3.1-pro": { "vercel": "moonshotai/kimi-k3.1-pro" },
|
|
24988
|
+
"kimi-k3.1-pro-highspeed": { "vercel": "moonshotai/kimi-k3.1-pro-highspeed" },
|
|
25046
24989
|
"laguna-s-2-1": { "vercel": "poolside/laguna-s-2.1" },
|
|
25047
24990
|
"laguna-s-2-1-free": { "vercel": "poolside/laguna-s-2.1-free" },
|
|
25048
24991
|
"laguna-s-2.1": { "vercel": "poolside/laguna-s-2.1" },
|
|
@@ -25498,8 +25441,7 @@ const CREATOR_TO_PROVIDER = {
|
|
|
25498
25441
|
"xiaomi": "vercel",
|
|
25499
25442
|
"unknown": "openai"
|
|
25500
25443
|
};
|
|
25501
|
-
|
|
25502
|
-
//#region ../shared/dist/chunk-jaE_lS2E.mjs
|
|
25444
|
+
// ../shared/dist/chunk-DFt584Tt.mjs
|
|
25503
25445
|
const DEFAULT_GENERIC_OPENAI_API_FORMAT = "chat-completions";
|
|
25504
25446
|
/** Provider defaults shared by every execution engine and deploy guidance. */
|
|
25505
25447
|
const DEFAULT_BEDROCK_REGION = "us-east-1";
|
|
@@ -25785,8 +25727,7 @@ MCPServerCategory.DEVELOPMENT;
|
|
|
25785
25727
|
MCPServerCategory.COMMUNICATION;
|
|
25786
25728
|
MCPServerCategory.COMMUNICATION;
|
|
25787
25729
|
MCPServerCategory.PRODUCTIVITY;
|
|
25788
|
-
|
|
25789
|
-
//#region ../shared/dist/chunk-D_ntTgKu.mjs
|
|
25730
|
+
// ../shared/dist/chunk-DUhmP1k_.mjs
|
|
25790
25731
|
/** The persona knob (DataMorgana pattern) — who is writing the input. */
|
|
25791
25732
|
const EVAL_CASE_PERSONAS = [
|
|
25792
25733
|
{
|
|
@@ -25857,8 +25798,7 @@ object({ verdicts: array(object({
|
|
|
25857
25798
|
gradeable: boolean(),
|
|
25858
25799
|
reason: string().optional()
|
|
25859
25800
|
})) });
|
|
25860
|
-
|
|
25861
|
-
//#region ../shared/dist/chunk-CIi5jW2t.mjs
|
|
25801
|
+
// ../shared/dist/chunk-afupRRVE.mjs
|
|
25862
25802
|
/**
|
|
25863
25803
|
* Registry of all available brand configurations
|
|
25864
25804
|
* Add new brand configs here when creating additional deployments
|
|
@@ -25926,8 +25866,7 @@ function loadBrandConfig(env) {
|
|
|
25926
25866
|
}
|
|
25927
25867
|
loadBrandConfig();
|
|
25928
25868
|
BRAND_CONFIGS[DEFAULT_BRAND_NAME];
|
|
25929
|
-
|
|
25930
|
-
//#region ../shared/dist/chunk-CNTixTjk.mjs
|
|
25869
|
+
// ../shared/dist/chunk-CggV6srJ.mjs
|
|
25931
25870
|
const ARCHITECTURE_PREVIEW_SURFACE_TYPES = [
|
|
25932
25871
|
"chat",
|
|
25933
25872
|
"api",
|
|
@@ -25946,8 +25885,7 @@ const ARCHITECTURE_PREVIEW_SURFACE_TYPES = [
|
|
|
25946
25885
|
"messaging"
|
|
25947
25886
|
];
|
|
25948
25887
|
new Set(ARCHITECTURE_PREVIEW_SURFACE_TYPES);
|
|
25949
|
-
|
|
25950
|
-
//#region ../shared/dist/chunk-CoMlpzHZ.mjs
|
|
25888
|
+
// ../shared/dist/chunk-D3z94Ai6.mjs
|
|
25951
25889
|
const citedRunClaimSchema = object({
|
|
25952
25890
|
text: string().min(1).max(700),
|
|
25953
25891
|
eventIds: array(string().min(1).max(256)).min(1).max(4)
|
|
@@ -25972,8 +25910,7 @@ object({
|
|
|
25972
25910
|
analysis: runAnalysisSchema
|
|
25973
25911
|
})
|
|
25974
25912
|
});
|
|
25975
|
-
|
|
25976
|
-
//#region ../shared/dist/managed-sandbox-provider-contract.mjs
|
|
25913
|
+
// ../shared/dist/managed-sandbox-provider-contract.mjs
|
|
25977
25914
|
/**
|
|
25978
25915
|
* Contract types for the hosted managed-sandbox provider boundary: the closed
|
|
25979
25916
|
* capability vocabulary, the profile identity a capability claim is scoped to,
|
|
@@ -26079,8 +26016,7 @@ Object.freeze({
|
|
|
26079
26016
|
deployment: "runtype.deployment",
|
|
26080
26017
|
generation: "runtype.generation"
|
|
26081
26018
|
});
|
|
26082
|
-
|
|
26083
|
-
//#region ../shared/dist/index.mjs
|
|
26019
|
+
// ../shared/dist/index.mjs
|
|
26084
26020
|
/**
|
|
26085
26021
|
* Neutralize spreadsheet formula injection (CSV injection).
|
|
26086
26022
|
* A cell starting with `=+-@` or leading tab/CR/LF is treated as a formula by Excel/Sheets/LibreOffice; prefix a single quote to force text.
|
|
@@ -28924,8 +28860,17 @@ object({
|
|
|
28924
28860
|
byFlowSurface: record(string(), runStatsBucketSchema).describe("Runs grouped by flow and surface, keyed `<flowId>:<surfaceId>`."),
|
|
28925
28861
|
byAgentSurface: record(string(), runStatsBucketSchema).describe("Runs grouped by agent and surface, keyed `<agentId>:<surfaceId>`.")
|
|
28926
28862
|
});
|
|
28927
|
-
|
|
28928
|
-
|
|
28863
|
+
runListQuerySchema.pick({
|
|
28864
|
+
traffic: true,
|
|
28865
|
+
from: true,
|
|
28866
|
+
to: true
|
|
28867
|
+
}).extend({ productIds: string().describe(`Comma-separated product ids, at most 100. A product the caller does not own is left out of the answer.`) });
|
|
28868
|
+
const runProductStatsBucketSchema = object({
|
|
28869
|
+
total: count("Runs of the product's flows plus runs of its agents."),
|
|
28870
|
+
failed: count("Of those, the runs that read as failed in `/v1/runs` (the same predicate as `status=failed`).")
|
|
28871
|
+
});
|
|
28872
|
+
object({ byProductId: record(string(), runProductStatsBucketSchema).describe("One entry per named product the caller owns, a product with no flow or agent reading zero. Each sums `/v1/runs/stats` for its flows and for its agents, read one family at a time.") });
|
|
28873
|
+
// src/config/paths.ts
|
|
28929
28874
|
/** Root state directory: RUNTYPE_STATE_DIR or ~/.runtype */
|
|
28930
28875
|
function getRuntypeHomeDir() {
|
|
28931
28876
|
return process.env.RUNTYPE_STATE_DIR || path$2.join(os$1.homedir(), ".runtype");
|
|
@@ -28946,8 +28891,7 @@ function getProjectStateDir(projectDir) {
|
|
|
28946
28891
|
function getMarathonStateDir(projectDir) {
|
|
28947
28892
|
return path$2.join(getProjectStateDir(projectDir), "marathons");
|
|
28948
28893
|
}
|
|
28949
|
-
|
|
28950
|
-
//#region src/auth/secret-backend.ts
|
|
28894
|
+
// src/auth/secret-backend.ts
|
|
28951
28895
|
const KEYCHAIN_SERVICE = "runtype-cli";
|
|
28952
28896
|
let keyringModule;
|
|
28953
28897
|
/** Load the native keyring binding lazily; a missing prebuilt binary means "no keychain", not a crash. */
|
|
@@ -29044,8 +28988,7 @@ function getSecretStorePreference() {
|
|
|
29044
28988
|
const value = process.env.RUNTYPE_CREDENTIAL_STORE?.trim().toLowerCase();
|
|
29045
28989
|
return value === "file" || value === "keychain" ? value : "auto";
|
|
29046
28990
|
}
|
|
29047
|
-
|
|
29048
|
-
//#region src/auth/account-store.ts
|
|
28991
|
+
// src/auth/account-store.ts
|
|
29049
28992
|
const LAST_USED_RESOLUTION_MS = 6e4;
|
|
29050
28993
|
/** Canonical API base used for account identity; mirrors normalizeApiUrl for valid URLs. */
|
|
29051
28994
|
function canonicalApiUrl(value) {
|
|
@@ -29368,8 +29311,7 @@ var AccountStore = class {
|
|
|
29368
29311
|
writePrivateJsonFile(this.filePath, data);
|
|
29369
29312
|
}
|
|
29370
29313
|
};
|
|
29371
|
-
|
|
29372
|
-
//#region src/auth/credential-store.ts
|
|
29314
|
+
// src/auth/credential-store.ts
|
|
29373
29315
|
var credential_store_exports = /* @__PURE__ */ __exportAll({ CredentialStore: () => CredentialStore });
|
|
29374
29316
|
/**
|
|
29375
29317
|
* Credential access for CLI commands. "Active" methods act on the login this invocation
|
|
@@ -29509,8 +29451,7 @@ var CredentialStore = class {
|
|
|
29509
29451
|
return (await this.accounts.list()).filter((account) => account.claim).sort((a, b) => b.createdAt.localeCompare(a.createdAt))[0] ?? null;
|
|
29510
29452
|
}
|
|
29511
29453
|
};
|
|
29512
|
-
|
|
29513
|
-
//#region src/config/project-link.ts
|
|
29454
|
+
// src/config/project-link.ts
|
|
29514
29455
|
const PROJECT_LINK_DIR = ".runtype";
|
|
29515
29456
|
const PROJECT_LINK_FILENAME = "project.json";
|
|
29516
29457
|
var ProjectLinkError = class extends Error {
|
|
@@ -29599,8 +29540,7 @@ function removeProjectLink(directory) {
|
|
|
29599
29540
|
} catch {}
|
|
29600
29541
|
return true;
|
|
29601
29542
|
}
|
|
29602
|
-
|
|
29603
|
-
//#region src/config/effective-context.ts
|
|
29543
|
+
// src/config/effective-context.ts
|
|
29604
29544
|
var CliContextError = class extends Error {
|
|
29605
29545
|
code;
|
|
29606
29546
|
constructor(message, code = "INVALID_INPUT") {
|
|
@@ -29785,8 +29725,7 @@ function redactEffectiveContext(context) {
|
|
|
29785
29725
|
projectLink: context.projectLink?.path ?? null
|
|
29786
29726
|
};
|
|
29787
29727
|
}
|
|
29788
|
-
|
|
29789
|
-
//#region src/config/env.ts
|
|
29728
|
+
// src/config/env.ts
|
|
29790
29729
|
function getApiUrl() {
|
|
29791
29730
|
return getEffectiveApiUrl();
|
|
29792
29731
|
}
|
|
@@ -29805,8 +29744,7 @@ function getRuntimeApiKey() {
|
|
|
29805
29744
|
function getDevPlanOverride() {
|
|
29806
29745
|
return process.env.RUNTYPE_DEV_PLAN_OVERRIDE;
|
|
29807
29746
|
}
|
|
29808
|
-
|
|
29809
|
-
//#region src/lib/cli-version.ts
|
|
29747
|
+
// src/lib/cli-version.ts
|
|
29810
29748
|
const CLI_PACKAGE_NAME = "@runtypelabs/cli";
|
|
29811
29749
|
let cachedCliVersion = null;
|
|
29812
29750
|
/** Read the published package version from package.json so runtime and npm stay aligned. */
|
|
@@ -29824,8 +29762,7 @@ function getCliVersion() {
|
|
|
29824
29762
|
cachedCliVersion = "0.0.0";
|
|
29825
29763
|
return cachedCliVersion;
|
|
29826
29764
|
}
|
|
29827
|
-
|
|
29828
|
-
//#region src/lib/sdk-client.ts
|
|
29765
|
+
// src/lib/sdk-client.ts
|
|
29829
29766
|
/**
|
|
29830
29767
|
* Construct the SDK client used by every CLI command for API access.
|
|
29831
29768
|
* The SDK is the single source of truth for the API surface; do NOT reintroduce raw fetch (enforced by `runtype/cli-use-sdk`).
|
|
@@ -29848,8 +29785,7 @@ function createCliClient(apiKey, baseUrl) {
|
|
|
29848
29785
|
}
|
|
29849
29786
|
});
|
|
29850
29787
|
}
|
|
29851
|
-
|
|
29852
|
-
//#region src/auth/api-key-manager.ts
|
|
29788
|
+
// src/auth/api-key-manager.ts
|
|
29853
29789
|
const isCliTokenResponse = (value) => {
|
|
29854
29790
|
if (!value || typeof value !== "object") return false;
|
|
29855
29791
|
const record = value;
|
|
@@ -29943,8 +29879,7 @@ var ApiKeyManager = class {
|
|
|
29943
29879
|
return data;
|
|
29944
29880
|
}
|
|
29945
29881
|
};
|
|
29946
|
-
|
|
29947
|
-
//#region src/auth/callback-server.ts
|
|
29882
|
+
// src/auth/callback-server.ts
|
|
29948
29883
|
var CallbackServer = class {
|
|
29949
29884
|
server = null;
|
|
29950
29885
|
app;
|
|
@@ -30271,8 +30206,7 @@ var CallbackServer = class {
|
|
|
30271
30206
|
`;
|
|
30272
30207
|
}
|
|
30273
30208
|
};
|
|
30274
|
-
|
|
30275
|
-
//#region src/auth/oauth-manager.ts
|
|
30209
|
+
// src/auth/oauth-manager.ts
|
|
30276
30210
|
var OAuthManager = class {
|
|
30277
30211
|
clerkPublishableKey;
|
|
30278
30212
|
dashboardUrl;
|
|
@@ -30317,8 +30251,7 @@ var OAuthManager = class {
|
|
|
30317
30251
|
return code;
|
|
30318
30252
|
}
|
|
30319
30253
|
};
|
|
30320
|
-
|
|
30321
|
-
//#region src/auth/login-flow.ts
|
|
30254
|
+
// src/auth/login-flow.ts
|
|
30322
30255
|
var InvalidApiKeyError = class extends Error {
|
|
30323
30256
|
constructor() {
|
|
30324
30257
|
super("Invalid API key");
|
|
@@ -30374,8 +30307,7 @@ function orgMismatchWarning(login) {
|
|
|
30374
30307
|
if (!login.requestedOrgId || login.requestedOrgId === login.orgId) return null;
|
|
30375
30308
|
return `Logged in to ${login.orgId ?? "a personal account"}, but this invocation targets ${login.requestedOrgId}. Commands here will keep asking for a login to ${login.requestedOrgId}; run "runtype login" again and pick that organization, or update the link with "runtype link ${login.orgId ?? ""}".`;
|
|
30376
30309
|
}
|
|
30377
|
-
|
|
30378
|
-
//#region src/lib/ensure-auth.ts
|
|
30310
|
+
// src/lib/ensure-auth.ts
|
|
30379
30311
|
const verifiedUsers = /* @__PURE__ */ new WeakMap();
|
|
30380
30312
|
async function getAuthenticatedUser() {
|
|
30381
30313
|
const context = await loadEffectiveContext();
|
|
@@ -30494,8 +30426,7 @@ async function handleBrowserLogin(apiUrl) {
|
|
|
30494
30426
|
return null;
|
|
30495
30427
|
}
|
|
30496
30428
|
}
|
|
30497
|
-
|
|
30498
|
-
//#region src/lib/output.ts
|
|
30429
|
+
// src/lib/output.ts
|
|
30499
30430
|
/**
|
|
30500
30431
|
* Print data as formatted JSON.
|
|
30501
30432
|
*/
|
|
@@ -30573,8 +30504,7 @@ function printNextCursorHint(commandPath, pagination) {
|
|
|
30573
30504
|
if (!hasMore || !nextCursor) return;
|
|
30574
30505
|
console.log(chalk.yellow("\n More results available — fetch the next page with:") + chalk.dim(`\n ${commandPath} --cursor ${nextCursor}`));
|
|
30575
30506
|
}
|
|
30576
|
-
|
|
30577
|
-
//#region src/commands/sandbox-deployments.ts
|
|
30507
|
+
// src/commands/sandbox-deployments.ts
|
|
30578
30508
|
const sandboxDeploymentsCommand = new Command("sandbox-deployments").description("Author managed deployments using retained runtime profiles and uploaded source IDs");
|
|
30579
30509
|
async function run$2(action) {
|
|
30580
30510
|
try {
|
|
@@ -30601,8 +30531,7 @@ sandboxDeploymentsCommand.command("update <id>").description("Replace the comple
|
|
|
30601
30531
|
ifMatch: options.ifMatch
|
|
30602
30532
|
});
|
|
30603
30533
|
}));
|
|
30604
|
-
|
|
30605
|
-
//#region src/lib/load-env.ts
|
|
30534
|
+
// src/lib/load-env.ts
|
|
30606
30535
|
function loadEnv(path = resolve(process.cwd(), ".env")) {
|
|
30607
30536
|
try {
|
|
30608
30537
|
const content = readFileSync(path, "utf8").replace(/\r\n?/g, "\n");
|
|
@@ -30616,8 +30545,7 @@ function loadEnv(path = resolve(process.cwd(), ".env")) {
|
|
|
30616
30545
|
}
|
|
30617
30546
|
} catch {}
|
|
30618
30547
|
}
|
|
30619
|
-
|
|
30620
|
-
//#region src/ink/shared/isTTY.ts
|
|
30548
|
+
// src/ink/shared/isTTY.ts
|
|
30621
30549
|
/**
|
|
30622
30550
|
* Determine whether the current environment supports TTY (Ink rendering).
|
|
30623
30551
|
* Respects explicit --tty / --no-tty flags, falling back to process.stdout.isTTY.
|
|
@@ -30627,8 +30555,7 @@ function isTTY(options) {
|
|
|
30627
30555
|
if (options.tty) return true;
|
|
30628
30556
|
return process.stdout.isTTY === true;
|
|
30629
30557
|
}
|
|
30630
|
-
|
|
30631
|
-
//#region src/ink/shared/altScreen.ts
|
|
30558
|
+
// src/ink/shared/altScreen.ts
|
|
30632
30559
|
/**
|
|
30633
30560
|
* Enter the terminal's alternate screen buffer for fullscreen TUI apps.
|
|
30634
30561
|
* Fullscreen apps use the alternate screen so rendering doesn't pollute scrollback history.
|
|
@@ -30648,8 +30575,7 @@ function enterAltScreen() {
|
|
|
30648
30575
|
process.on("exit", restore);
|
|
30649
30576
|
return restore;
|
|
30650
30577
|
}
|
|
30651
|
-
|
|
30652
|
-
//#region src/ink/shared/EntityCard.tsx
|
|
30578
|
+
// src/ink/shared/EntityCard.tsx
|
|
30653
30579
|
function EntityCard({ fields, title }) {
|
|
30654
30580
|
const visibleFields = fields.filter((f) => f.value !== null && f.value !== void 0);
|
|
30655
30581
|
return /* @__PURE__ */ jsxs(Box, {
|
|
@@ -30673,8 +30599,7 @@ function EntityCard({ fields, title }) {
|
|
|
30673
30599
|
] }, index))]
|
|
30674
30600
|
});
|
|
30675
30601
|
}
|
|
30676
|
-
|
|
30677
|
-
//#region src/ink/shared/ConfirmPrompt.tsx
|
|
30602
|
+
// src/ink/shared/ConfirmPrompt.tsx
|
|
30678
30603
|
function ConfirmPrompt({ message, defaultValue = false, onConfirm }) {
|
|
30679
30604
|
const [answered, setAnswered] = useState(false);
|
|
30680
30605
|
const [result, setResult] = useState(null);
|
|
@@ -30717,8 +30642,7 @@ function ConfirmPrompt({ message, defaultValue = false, onConfirm }) {
|
|
|
30717
30642
|
})
|
|
30718
30643
|
] });
|
|
30719
30644
|
}
|
|
30720
|
-
|
|
30721
|
-
//#region src/ink/shared/DataList.tsx
|
|
30645
|
+
// src/ink/shared/DataList.tsx
|
|
30722
30646
|
function DataList({ title, items, error, loading, renderCard, emptyMessage = "None found", total, onRetry, onDone }) {
|
|
30723
30647
|
const { exit } = useApp();
|
|
30724
30648
|
const hasDone = useRef(false);
|
|
@@ -30780,8 +30704,7 @@ function DataList({ title, items, error, loading, renderCard, emptyMessage = "No
|
|
|
30780
30704
|
]
|
|
30781
30705
|
});
|
|
30782
30706
|
}
|
|
30783
|
-
|
|
30784
|
-
//#region src/ink/shared/MutationResult.tsx
|
|
30707
|
+
// src/ink/shared/MutationResult.tsx
|
|
30785
30708
|
function MutationResult({ loading, loadingLabel = "Processing...", success, successMessage, result, error, onRetry, onDone }) {
|
|
30786
30709
|
const { exit } = useApp();
|
|
30787
30710
|
const hasDone = useRef(false);
|
|
@@ -30838,8 +30761,7 @@ function MutationResult({ loading, loadingLabel = "Processing...", success, succ
|
|
|
30838
30761
|
});
|
|
30839
30762
|
return null;
|
|
30840
30763
|
}
|
|
30841
|
-
|
|
30842
|
-
//#region src/ink/shared/account-picker.ts
|
|
30764
|
+
// src/ink/shared/account-picker.ts
|
|
30843
30765
|
/** Interactive picker over stored logins; resolves undefined if the user exits without choosing. */
|
|
30844
30766
|
async function promptForAccount(accounts) {
|
|
30845
30767
|
let chosen;
|
|
@@ -30857,8 +30779,7 @@ async function promptForAccount(accounts) {
|
|
|
30857
30779
|
await waitUntilExit();
|
|
30858
30780
|
return chosen;
|
|
30859
30781
|
}
|
|
30860
|
-
|
|
30861
|
-
//#region src/auth/agent-auth-client.ts
|
|
30782
|
+
// src/auth/agent-auth-client.ts
|
|
30862
30783
|
/**
|
|
30863
30784
|
* Protocol error with the spec error code and an agent-actionable hint.
|
|
30864
30785
|
* `hint` is safe to surface verbatim in JSON output as the next step.
|
|
@@ -30967,8 +30888,7 @@ async function completeClaim(claimToken, otp, apiUrl) {
|
|
|
30967
30888
|
scopes: stringArray(data.scopes)
|
|
30968
30889
|
};
|
|
30969
30890
|
}
|
|
30970
|
-
|
|
30971
|
-
//#region src/commands/auth-agent.ts
|
|
30891
|
+
// src/commands/auth-agent.ts
|
|
30972
30892
|
const VERIFY_NEXT = "Ask the user for the 6-digit code from their email, then run: runtype auth verify <code>";
|
|
30973
30893
|
function claimNext(email) {
|
|
30974
30894
|
return email ? `Send the verification email with: runtype auth claim ${email}` : "Ask the user for their email address, then run: runtype auth claim <email>";
|
|
@@ -31164,8 +31084,7 @@ function registerAgentAuthCommands(authCommand) {
|
|
|
31164
31084
|
authCommand.command("claim <email>").description("Email the user a 6-digit code to attach the account to them").option("--api-url <url>", "Custom API URL").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(claimAction);
|
|
31165
31085
|
authCommand.command("verify <code>").description("Complete signup with the 6-digit code from the verification email (step 2 of 2)").option("--api-url <url>", "Custom API URL").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(verifyAction);
|
|
31166
31086
|
}
|
|
31167
|
-
|
|
31168
|
-
//#region src/commands/auth.ts
|
|
31087
|
+
// src/commands/auth.ts
|
|
31169
31088
|
const authCommand = new Command("auth").description("Manage authentication");
|
|
31170
31089
|
const NON_TTY_LOGIN_GUIDANCE = {
|
|
31171
31090
|
status: "error",
|
|
@@ -31687,8 +31606,7 @@ authCommand.command("whoami").description("Display current user information").op
|
|
|
31687
31606
|
};
|
|
31688
31607
|
});
|
|
31689
31608
|
});
|
|
31690
|
-
|
|
31691
|
-
//#region src/commands/link.ts
|
|
31609
|
+
// src/commands/link.ts
|
|
31692
31610
|
const PRODUCTION_API_URL = "https://api.runtype.com";
|
|
31693
31611
|
async function chooseOrganization(orgArgument, options) {
|
|
31694
31612
|
if (orgArgument) return { orgId: orgArgument };
|
|
@@ -31776,8 +31694,7 @@ const unlinkCommand = new Command("unlink").description("Remove the nearest .run
|
|
|
31776
31694
|
}
|
|
31777
31695
|
console.log(removedPath ? chalk.green(`Removed ${removedPath}. Commands here now use the default login.`) : chalk.yellow("No .runtype/project.json found in this directory or its parents."));
|
|
31778
31696
|
});
|
|
31779
|
-
|
|
31780
|
-
//#region src/lib/file-utils.ts
|
|
31697
|
+
// src/lib/file-utils.ts
|
|
31781
31698
|
/** Parse a string as a JSON object, exiting with a clear error on failure. */
|
|
31782
31699
|
function parseJsonObject$1(raw, label) {
|
|
31783
31700
|
let parsed;
|
|
@@ -31835,8 +31752,7 @@ function resolveJsonPayload(inline, fromFile, label) {
|
|
|
31835
31752
|
if (fromFile !== void 0) return readJsonFile(fromFile, { label });
|
|
31836
31753
|
return parseJsonObject$1(inline, label);
|
|
31837
31754
|
}
|
|
31838
|
-
|
|
31839
|
-
//#region src/lib/ensure-output.ts
|
|
31755
|
+
// src/lib/ensure-output.ts
|
|
31840
31756
|
/**
|
|
31841
31757
|
* Emit a pulled definition as JSON: to `out` when given, otherwise to stdout so
|
|
31842
31758
|
* `runtype <entity> pull <name> > file.json` works. Hash and warnings go to stderr.
|
|
@@ -31850,8 +31766,7 @@ function writePulledDefinition(data, meta) {
|
|
|
31850
31766
|
if (meta.contentHash) console.error(chalk.gray(`contentHash ${meta.contentHash}`));
|
|
31851
31767
|
for (const warning of meta.warnings ?? []) console.error(chalk.yellow(`warning: ${warning}`));
|
|
31852
31768
|
}
|
|
31853
|
-
|
|
31854
|
-
//#region src/commands/entity-ensure.ts
|
|
31769
|
+
// src/commands/entity-ensure.ts
|
|
31855
31770
|
function namespaceTransport(client) {
|
|
31856
31771
|
const transport = {
|
|
31857
31772
|
get: (path, params) => client.get(path, params),
|
|
@@ -32113,8 +32028,7 @@ const clientTokenEnsureCommand = new Command("ensure").description("Converge a c
|
|
|
32113
32028
|
fail$4("Failed to converge the client token", error);
|
|
32114
32029
|
}
|
|
32115
32030
|
});
|
|
32116
|
-
|
|
32117
|
-
//#region src/lib/execution-input.ts
|
|
32031
|
+
// src/lib/execution-input.ts
|
|
32118
32032
|
function addExecutionInputOptions(command) {
|
|
32119
32033
|
return command.option("--inputs <json>", "Typed input variables as a JSON object").option("--inputs-file <file|->", "Read input variables from a JSON object file or stdin").option("-v, --variable <key=value>", "Set a string variable (repeatable)", collectVariables, []).option("--messages-file <file|->", "Read structured messages from a JSON array file or stdin");
|
|
32120
32034
|
}
|
|
@@ -32221,8 +32135,7 @@ function resolveExecutionInput(options, agent = false) {
|
|
|
32221
32135
|
...record ? { record } : {}
|
|
32222
32136
|
};
|
|
32223
32137
|
}
|
|
32224
|
-
|
|
32225
|
-
//#region src/lib/execution-output.ts
|
|
32138
|
+
// src/lib/execution-output.ts
|
|
32226
32139
|
function asObject(value) {
|
|
32227
32140
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
32228
32141
|
}
|
|
@@ -32429,8 +32342,7 @@ async function runExecution(options, build, execute, label, renderResult) {
|
|
|
32429
32342
|
else console.error(chalk.red(String(result.error.message)));
|
|
32430
32343
|
}
|
|
32431
32344
|
}
|
|
32432
|
-
|
|
32433
|
-
//#region src/commands/flows.ts
|
|
32345
|
+
// src/commands/flows.ts
|
|
32434
32346
|
/** Build the typed list params the SDK endpoint expects from the CLI's string flags. */
|
|
32435
32347
|
function flowsListParams(options) {
|
|
32436
32348
|
return {
|
|
@@ -32766,8 +32678,7 @@ flowsCommand.command("delete <id>").description("Delete a flow").option("--tty",
|
|
|
32766
32678
|
const { waitUntilExit } = render(React.createElement(App));
|
|
32767
32679
|
await waitUntilExit();
|
|
32768
32680
|
});
|
|
32769
|
-
|
|
32770
|
-
//#region src/lib/terminal-image.ts
|
|
32681
|
+
// src/lib/terminal-image.ts
|
|
32771
32682
|
const ESC = "\x1B";
|
|
32772
32683
|
const BEL = "\x07";
|
|
32773
32684
|
const ST = `${ESC}\\`;
|
|
@@ -32842,8 +32753,7 @@ function renderInlineImage(value, protocol) {
|
|
|
32842
32753
|
protocol
|
|
32843
32754
|
});
|
|
32844
32755
|
}
|
|
32845
|
-
|
|
32846
|
-
//#region src/lib/message-content.ts
|
|
32756
|
+
// src/lib/message-content.ts
|
|
32847
32757
|
/**
|
|
32848
32758
|
* Render a message's `content` to a single human-readable line for the CLI.
|
|
32849
32759
|
* A plain string passes through; an array of parts renders text inline and collapses media parts to compact markers.
|
|
@@ -32893,8 +32803,7 @@ function renderMessageContentWithImages(content, protocol) {
|
|
|
32893
32803
|
images
|
|
32894
32804
|
};
|
|
32895
32805
|
}
|
|
32896
|
-
|
|
32897
|
-
//#region src/commands/records.ts
|
|
32806
|
+
// src/commands/records.ts
|
|
32898
32807
|
/**
|
|
32899
32808
|
* Resolve the owner-key intent of a `records update` invocation into the body field the API expects.
|
|
32900
32809
|
* `--owner-id` reassigns the owner; `--clear-owner` sends an explicit `null`; omitting both leaves the stored owner untouched.
|
|
@@ -33655,8 +33564,7 @@ function csvEscape(value) {
|
|
|
33655
33564
|
if (text.includes(",") || text.includes("\"") || text.includes("\n")) return `"${text.replace(/"/g, "\"\"")}"`;
|
|
33656
33565
|
return text;
|
|
33657
33566
|
}
|
|
33658
|
-
|
|
33659
|
-
//#region src/commands/collections.ts
|
|
33567
|
+
// src/commands/collections.ts
|
|
33660
33568
|
/**
|
|
33661
33569
|
* Record collections: a collection registers a record type (slug =
|
|
33662
33570
|
* records.type) and optionally owns a metadata schema, validated at every
|
|
@@ -34063,8 +33971,7 @@ collectionsCommand.command("validate <slug>").description("Dry-run existing reco
|
|
|
34063
33971
|
process.exit(1);
|
|
34064
33972
|
}
|
|
34065
33973
|
});
|
|
34066
|
-
|
|
34067
|
-
//#region src/commands/prompts.ts
|
|
33974
|
+
// src/commands/prompts.ts
|
|
34068
33975
|
const promptsCommand = new Command("prompts").description("Manage prompts");
|
|
34069
33976
|
promptsCommand.command("list").description("List all prompts").option("--limit <n>", "Limit results (defaults to the API page size)").option("--cursor <cursor>", "Pagination cursor for the next page").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
34070
33977
|
const apiKey = await ensureAuth();
|
|
@@ -34492,8 +34399,7 @@ promptsCommand.command("delete <id>").description("Delete a prompt").option("--t
|
|
|
34492
34399
|
const { waitUntilExit } = render(React.createElement(runDelete()));
|
|
34493
34400
|
await waitUntilExit();
|
|
34494
34401
|
});
|
|
34495
|
-
|
|
34496
|
-
//#region src/lib/wait-for-status.ts
|
|
34402
|
+
// src/lib/wait-for-status.ts
|
|
34497
34403
|
const MAX_WAIT_DURATION_MS = 2147483647;
|
|
34498
34404
|
/** Poll read-only status until terminal, timeout, or caller abort; never cancel the remote task. */
|
|
34499
34405
|
async function waitForStatus(options) {
|
|
@@ -34540,8 +34446,7 @@ async function waitForStatus(options) {
|
|
|
34540
34446
|
controller.abort();
|
|
34541
34447
|
}
|
|
34542
34448
|
}
|
|
34543
|
-
|
|
34544
|
-
//#region src/commands/batch.ts
|
|
34449
|
+
// src/commands/batch.ts
|
|
34545
34450
|
function parseWatchDuration(value) {
|
|
34546
34451
|
const duration = Number(value);
|
|
34547
34452
|
if (!/^\d+$/.test(value) || !Number.isInteger(duration) || duration <= 0 || duration > 2147483647) throw new InvalidArgumentError(`Expected an integer between 1 and ${MAX_WAIT_DURATION_MS} ms`);
|
|
@@ -35019,8 +34924,7 @@ batchCommand.command("cost <id>").description("Show the total cost of a batch jo
|
|
|
35019
34924
|
const { waitUntilExit } = render(React.createElement(App));
|
|
35020
34925
|
await waitUntilExit();
|
|
35021
34926
|
});
|
|
35022
|
-
|
|
35023
|
-
//#region src/commands/config.ts
|
|
34927
|
+
// src/commands/config.ts
|
|
35024
34928
|
const CLI_CONFIG_KEYS = [
|
|
35025
34929
|
"apiUrl",
|
|
35026
34930
|
"defaultModel",
|
|
@@ -35111,8 +35015,7 @@ configCommand.command("reset").description("Reset all configuration to defaults"
|
|
|
35111
35015
|
configCommand.command("path").description("Show configuration file path").action(() => {
|
|
35112
35016
|
console.log(getCliConfig().path);
|
|
35113
35017
|
});
|
|
35114
|
-
|
|
35115
|
-
//#region src/commands/secrets.ts
|
|
35018
|
+
// src/commands/secrets.ts
|
|
35116
35019
|
/**
|
|
35117
35020
|
* Read a secret value from stdin without echoing it back. Used when `--value`
|
|
35118
35021
|
* is not supplied so the value never appears in shell history or terminal
|
|
@@ -35630,8 +35533,7 @@ secretsCommand.command("check <keys...>").description("Check which secret keys e
|
|
|
35630
35533
|
const { waitUntilExit } = render(React.createElement(App));
|
|
35631
35534
|
await waitUntilExit();
|
|
35632
35535
|
});
|
|
35633
|
-
|
|
35634
|
-
//#region src/commands/tools.ts
|
|
35536
|
+
// src/commands/tools.ts
|
|
35635
35537
|
function buildToolRunBody(options) {
|
|
35636
35538
|
const parameters = resolveJsonPayload(options.input, options.fromFile, "input parameters");
|
|
35637
35539
|
const toolConfig = options.config !== void 0 || options.configFile !== void 0 ? resolveJsonPayload(options.config, options.configFile, "tool config") : void 0;
|
|
@@ -36242,8 +36144,7 @@ toolsCommand.command("test <id>").description("Test a tool with sample input par
|
|
|
36242
36144
|
const { waitUntilExit } = render(React.createElement(App));
|
|
36243
36145
|
await waitUntilExit();
|
|
36244
36146
|
});
|
|
36245
|
-
|
|
36246
|
-
//#region src/commands/integrations.ts
|
|
36147
|
+
// src/commands/integrations.ts
|
|
36247
36148
|
const integrationsCommand = new Command("integrations").description("View built-in integrations (Slack, Google, Linear, GitHub, and more)");
|
|
36248
36149
|
integrationsCommand.command("list").description("List all available integrations").option("--environment <env>", "Filter credential status by environment: development or production").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
36249
36150
|
const apiKey = await ensureAuth();
|
|
@@ -36445,8 +36346,7 @@ integrationsCommand.command("get <id>").description("Get integration details, in
|
|
|
36445
36346
|
const { waitUntilExit } = render(React.createElement(App));
|
|
36446
36347
|
await waitUntilExit();
|
|
36447
36348
|
});
|
|
36448
|
-
|
|
36449
|
-
//#region src/commands/surfaces.ts
|
|
36349
|
+
// src/commands/surfaces.ts
|
|
36450
36350
|
const DELIVERY_ID_PATTERN = /^[A-Za-z0-9._:-]{1,128}$/;
|
|
36451
36351
|
async function readStdin$2() {
|
|
36452
36352
|
let value = "";
|
|
@@ -36751,8 +36651,7 @@ surfacesCommand.command("test <id>").description("Send a provider fixture throug
|
|
|
36751
36651
|
process.exitCode = 1;
|
|
36752
36652
|
}
|
|
36753
36653
|
});
|
|
36754
|
-
|
|
36755
|
-
//#region src/commands/logs.ts
|
|
36654
|
+
// src/commands/logs.ts
|
|
36756
36655
|
/** The API's own sentence for a store refusal; both log commands answer on it. */
|
|
36757
36656
|
const STORE_UNAVAILABLE_MESSAGE = "Log store temporarily unavailable";
|
|
36758
36657
|
/**
|
|
@@ -37041,8 +36940,7 @@ logsCommand.command("stats").description("Aggregate log stats: totals, counts by
|
|
|
37041
36940
|
const { waitUntilExit } = render(React.createElement(App));
|
|
37042
36941
|
await waitUntilExit();
|
|
37043
36942
|
});
|
|
37044
|
-
|
|
37045
|
-
//#region src/commands/signals.ts
|
|
36943
|
+
// src/commands/signals.ts
|
|
37046
36944
|
const signalsCommand = new Command("signals").description("Configure trace signals: typed fields read out of every bound agent turn");
|
|
37047
36945
|
async function run$1(action) {
|
|
37048
36946
|
try {
|
|
@@ -37071,6 +36969,7 @@ signalsCommand.command("create <name>").description("Create a signal set from a
|
|
|
37071
36969
|
...options.file ? { definition: await readDefinition(options.file) } : {}
|
|
37072
36970
|
})));
|
|
37073
36971
|
signalsCommand.command("update <signalSetId>").description("Rename or re-describe a signal set").option("--name <name>", "New name").option("--description <text>", "New description").action((id, options) => run$1((client) => client.signals.updateSet(id, options)));
|
|
36972
|
+
signalsCommand.command("delete <signalSetId>").description("Delete a signal set; unbind every binding of it first").action((id) => run$1((client) => client.signals.deleteSet(id)));
|
|
37074
36973
|
signalsCommand.command("publish <signalSetId>").description("Publish a new immutable version from a definition file and make it current").requiredOption("-f, --file <path>", "JSON definition").action((id, options) => run$1(async (client) => client.signals.publishVersion(id, await readDefinition(options.file))));
|
|
37075
36974
|
signalsCommand.command("preview <signalSetId> <version>").description("Dry-run a version over an agent's recent traces (billed, writes nothing)").requiredOption("--agent <agentId>", "Agent whose recent completed traces to read").option("--limit <n>", "Traces to read (default 20, at most 50)", positiveNumber).option("--acknowledge-external-processing", "Only after a human confirms (PHI organization, model outside Workers AI)").action((id, version, options) => run$1((client) => client.signals.preview(id, positiveNumber(version), {
|
|
37076
36975
|
agentId: options.agent,
|
|
@@ -37117,8 +37016,7 @@ runsCommand.command("list").description("List runs, newest first").option("--age
|
|
|
37117
37016
|
...options.limit !== void 0 ? { limit: options.limit } : {},
|
|
37118
37017
|
...options.cursor ? { cursor: options.cursor } : {}
|
|
37119
37018
|
})));
|
|
37120
|
-
|
|
37121
|
-
//#region src/lib/account-context.ts
|
|
37019
|
+
// src/lib/account-context.ts
|
|
37122
37020
|
/**
|
|
37123
37021
|
* Resolve the Clerk ID (`org_...` preferred, else `user_...`) to embed as `?account=` in dashboard URLs.
|
|
37124
37022
|
* When an API key is provided, prefer asking the API who that key belongs to.
|
|
@@ -37146,8 +37044,7 @@ async function getCurrentAccountId(options) {
|
|
|
37146
37044
|
return;
|
|
37147
37045
|
}
|
|
37148
37046
|
}
|
|
37149
|
-
|
|
37150
|
-
//#region src/lib/quick-start-api.ts
|
|
37047
|
+
// src/lib/quick-start-api.ts
|
|
37151
37048
|
function isObjectRecord(value) {
|
|
37152
37049
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
37153
37050
|
}
|
|
@@ -37184,8 +37081,7 @@ async function createQuickStartProduct(apiKey, input, apiUrl) {
|
|
|
37184
37081
|
throw error;
|
|
37185
37082
|
}
|
|
37186
37083
|
}
|
|
37187
|
-
|
|
37188
|
-
//#region src/commands/products.ts
|
|
37084
|
+
// src/commands/products.ts
|
|
37189
37085
|
function displayAgentCard(agentCard) {
|
|
37190
37086
|
console.log(chalk.cyan("\nAgent Details:"));
|
|
37191
37087
|
console.log(` Name: ${agentCard.name}`);
|
|
@@ -37688,8 +37584,7 @@ async function getApiKeyOrExit(isJsonMode, agentCard) {
|
|
|
37688
37584
|
}
|
|
37689
37585
|
return apiKey;
|
|
37690
37586
|
}
|
|
37691
|
-
|
|
37692
|
-
//#region src/ink/init/WizardStep.tsx
|
|
37587
|
+
// src/ink/init/WizardStep.tsx
|
|
37693
37588
|
function WizardStep({ stepNumber, totalSteps, title, children }) {
|
|
37694
37589
|
return /* @__PURE__ */ jsxs(Box, {
|
|
37695
37590
|
flexDirection: "column",
|
|
@@ -37719,8 +37614,7 @@ function WizardStep({ stepNumber, totalSteps, title, children }) {
|
|
|
37719
37614
|
]
|
|
37720
37615
|
});
|
|
37721
37616
|
}
|
|
37722
|
-
|
|
37723
|
-
//#region src/ink/init/StepSummary.tsx
|
|
37617
|
+
// src/ink/init/StepSummary.tsx
|
|
37724
37618
|
function StepSummary({ answers }) {
|
|
37725
37619
|
if (answers.length === 0) return null;
|
|
37726
37620
|
return /* @__PURE__ */ jsx(Box, {
|
|
@@ -37742,8 +37636,7 @@ function StepSummary({ answers }) {
|
|
|
37742
37636
|
}, index))
|
|
37743
37637
|
});
|
|
37744
37638
|
}
|
|
37745
|
-
|
|
37746
|
-
//#region src/ink/init/InitApp.tsx
|
|
37639
|
+
// src/ink/init/InitApp.tsx
|
|
37747
37640
|
const TOTAL_VISIBLE_STEPS = 3;
|
|
37748
37641
|
function getStepNumber(step) {
|
|
37749
37642
|
if (step <= 1) return 1;
|
|
@@ -38314,8 +38207,7 @@ function ConfirmInput({ onConfirm }) {
|
|
|
38314
38207
|
}, { isActive: !answered });
|
|
38315
38208
|
return null;
|
|
38316
38209
|
}
|
|
38317
|
-
|
|
38318
|
-
//#region src/commands/init.ts
|
|
38210
|
+
// src/commands/init.ts
|
|
38319
38211
|
const initCommand = new Command("init").description("Set up Runtype CLI with guided onboarding").option("--api-url <url>", "Custom API URL").option("--api-key <key>", "API key for non-interactive setup").option("--name <name>", "Product name for non-interactive setup").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
38320
38212
|
if (!isTTY(options)) {
|
|
38321
38213
|
if (!options.apiKey) {
|
|
@@ -38389,8 +38281,7 @@ const initCommand = new Command("init").description("Set up Runtype CLI with gui
|
|
|
38389
38281
|
}), { exitOnCtrlC: false });
|
|
38390
38282
|
await waitUntilExit();
|
|
38391
38283
|
});
|
|
38392
|
-
|
|
38393
|
-
//#region src/lib/agent-version-selector.ts
|
|
38284
|
+
// src/lib/agent-version-selector.ts
|
|
38394
38285
|
var AgentVersionSelectorConflictError = class extends Error {
|
|
38395
38286
|
name = "AgentVersionSelectorConflictError";
|
|
38396
38287
|
constructor() {
|
|
@@ -38415,8 +38306,7 @@ function buildNestedAgentSelector(flags) {
|
|
|
38415
38306
|
const selector = buildAgentVersionSelector(flags);
|
|
38416
38307
|
return selector ? { agent: selector } : {};
|
|
38417
38308
|
}
|
|
38418
|
-
|
|
38419
|
-
//#region src/commands/dispatch.ts
|
|
38309
|
+
// src/commands/dispatch.ts
|
|
38420
38310
|
const dispatchCommand = addExecutionInputOptions(new Command("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("--alias <name>", "Run whichever version this release alias points at").option("--version-id <id>", "Run this exact version snapshot").option("-r, --record <id>", "Existing record ID").option("--record-json <file>", "JSON file with record data (use - for stdin)").option("-m, --message <text>", "Message to send").option("--stream", "Stream the response (default)", true).option("--no-stream", "Wait for complete response").option("--json", "Output one final JSON result").option("--jsonl", "Output stream events and a terminal execution_summary as JSON lines").option("--debug", "Show step-level details").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode")).action(async (options) => {
|
|
38421
38311
|
await runExecution(options, () => buildDispatchRequest(options), (client, payload) => options.stream ? client.dispatch.executeStream(payload) : client.dispatch.execute(payload), "execution", renderDispatchResult);
|
|
38422
38312
|
});
|
|
@@ -38448,8 +38338,7 @@ function renderDispatchResult(value) {
|
|
|
38448
38338
|
else printJson(step.result);
|
|
38449
38339
|
}
|
|
38450
38340
|
}
|
|
38451
|
-
|
|
38452
|
-
//#region src/commands/conversations.ts
|
|
38341
|
+
// src/commands/conversations.ts
|
|
38453
38342
|
/**
|
|
38454
38343
|
* Write one message line, emitting inline image escape sequences for renderable
|
|
38455
38344
|
* image parts and falling back to the text marker (via {@link renderMessageContent})
|
|
@@ -38756,8 +38645,7 @@ conversationsCommand.command("delete <id>").description("Delete a conversation")
|
|
|
38756
38645
|
const { waitUntilExit } = render(React.createElement(runDelete()));
|
|
38757
38646
|
await waitUntilExit();
|
|
38758
38647
|
});
|
|
38759
|
-
|
|
38760
|
-
//#region src/ink/marathon/context-compaction-format.ts
|
|
38648
|
+
// src/ink/marathon/context-compaction-format.ts
|
|
38761
38649
|
function formatTokenCount$1(value) {
|
|
38762
38650
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return void 0;
|
|
38763
38651
|
return value.toLocaleString();
|
|
@@ -38772,8 +38660,7 @@ function formatCompactionThresholdLabel(compaction) {
|
|
|
38772
38660
|
if (threshold && contextLimit) return `${threshold}/${contextLimit} tokens`;
|
|
38773
38661
|
return contextLimit ? `${contextLimit} tokens` : threshold ? `${threshold} tokens` : void 0;
|
|
38774
38662
|
}
|
|
38775
|
-
|
|
38776
|
-
//#region src/ink/marathon/transcript-utils.ts
|
|
38663
|
+
// src/ink/marathon/transcript-utils.ts
|
|
38777
38664
|
function appendTranscriptText(content, delta, previousKind) {
|
|
38778
38665
|
if (!content) return delta;
|
|
38779
38666
|
return previousKind === "tool" && !content.endsWith("\n") && !delta.startsWith("\n") ? `${content}\n${delta}` : `${content}${delta}`;
|
|
@@ -38784,8 +38671,7 @@ function getVisibleReasoningLines(reasoning, maxLines) {
|
|
|
38784
38671
|
if (!trimmed) return [];
|
|
38785
38672
|
return trimmed.split("\n").slice(-maxLines);
|
|
38786
38673
|
}
|
|
38787
|
-
|
|
38788
|
-
//#region src/ink/marathon/useMarathonStream.ts
|
|
38674
|
+
// src/ink/marathon/useMarathonStream.ts
|
|
38789
38675
|
const INITIAL_STATE = {
|
|
38790
38676
|
phase: "idle",
|
|
38791
38677
|
content: "",
|
|
@@ -39414,8 +39300,7 @@ function useMarathonStream() {
|
|
|
39414
39300
|
}, [])
|
|
39415
39301
|
};
|
|
39416
39302
|
}
|
|
39417
|
-
|
|
39418
|
-
//#region src/ink/marathon/RunnerTrack.tsx
|
|
39303
|
+
// src/ink/marathon/RunnerTrack.tsx
|
|
39419
39304
|
const TRAIL_CHARS = [
|
|
39420
39305
|
"•",
|
|
39421
39306
|
"·",
|
|
@@ -39628,8 +39513,7 @@ function useRunnerTrack({ width, isAnimating, runnerChar = "🏃", finishChar =
|
|
|
39628
39513
|
borderSegments
|
|
39629
39514
|
};
|
|
39630
39515
|
}
|
|
39631
|
-
|
|
39632
|
-
//#region src/ink/marathon/SessionHeader.tsx
|
|
39516
|
+
// src/ink/marathon/SessionHeader.tsx
|
|
39633
39517
|
/** Render an array of TrackSegments as nested <Text> spans */
|
|
39634
39518
|
function renderSegments(segments) {
|
|
39635
39519
|
return segments.map((seg, i) => /* @__PURE__ */ jsx(Text, {
|
|
@@ -39752,8 +39636,7 @@ function SessionHeader({ sessionName, sessionCount, model, cost, goal, goalExpan
|
|
|
39752
39636
|
children: /* @__PURE__ */ jsx(Text, { children: rows.map((row, rowIdx) => rowIdx === 0 ? renderSegments(row) : ["\n", ...renderSegments(row)]) })
|
|
39753
39637
|
});
|
|
39754
39638
|
}
|
|
39755
|
-
|
|
39756
|
-
//#region src/ink/marathon/SessionTabs.tsx
|
|
39639
|
+
// src/ink/marathon/SessionTabs.tsx
|
|
39757
39640
|
const SELECTED_TAB_TEXT = "#0f161d";
|
|
39758
39641
|
function getTabLabelColor(tab) {
|
|
39759
39642
|
if (tab.isUnread) return theme.success;
|
|
@@ -39813,8 +39696,7 @@ function SessionTabs({ tabs, hiddenLeft, hiddenRight, shortcutHint }) {
|
|
|
39813
39696
|
})
|
|
39814
39697
|
] });
|
|
39815
39698
|
}
|
|
39816
|
-
|
|
39817
|
-
//#region src/ink/marathon/ScreenTabs.tsx
|
|
39699
|
+
// src/ink/marathon/ScreenTabs.tsx
|
|
39818
39700
|
const TABS = [
|
|
39819
39701
|
{
|
|
39820
39702
|
key: "overview",
|
|
@@ -39864,8 +39746,7 @@ function ScreenTabs({ activeTab, width, shortcutHint }) {
|
|
|
39864
39746
|
})]
|
|
39865
39747
|
});
|
|
39866
39748
|
}
|
|
39867
|
-
|
|
39868
|
-
//#region src/ink/marathon/Scrollbar.tsx
|
|
39749
|
+
// src/ink/marathon/Scrollbar.tsx
|
|
39869
39750
|
/**
|
|
39870
39751
|
* Vertical scrollbar with thumb + rail.
|
|
39871
39752
|
* Only renders when totalLines > visibleLines.
|
|
@@ -39888,8 +39769,7 @@ function Scrollbar({ totalLines, visibleLines, scrollOffset, height }) {
|
|
|
39888
39769
|
})
|
|
39889
39770
|
});
|
|
39890
39771
|
}
|
|
39891
|
-
|
|
39892
|
-
//#region src/ink/marathon/ToolsPanel.tsx
|
|
39772
|
+
// src/ink/marathon/ToolsPanel.tsx
|
|
39893
39773
|
function getVisibleToolWindow(total, selectedIndex, maxVisibleLines) {
|
|
39894
39774
|
const toolSlots = Math.floor(maxVisibleLines / 2);
|
|
39895
39775
|
let start = selectedIndex - Math.floor(toolSlots / 2);
|
|
@@ -40233,8 +40113,7 @@ const ToolsPanel = memo(function ToolsPanel({ tools, maxVisibleLines = 50, selec
|
|
|
40233
40113
|
}, (prev, next) => {
|
|
40234
40114
|
return visibleToolsFingerprint(prev.tools, prev.selectedIndex, prev.maxVisibleLines ?? 50) === visibleToolsFingerprint(next.tools, next.selectedIndex, next.maxVisibleLines ?? 50) && prev.detailTool === next.detailTool && prev.detailScrollOffset === next.detailScrollOffset && prev.width === next.width;
|
|
40235
40115
|
});
|
|
40236
|
-
|
|
40237
|
-
//#region src/ink/marathon/EventStreamPanel.tsx
|
|
40116
|
+
// src/ink/marathon/EventStreamPanel.tsx
|
|
40238
40117
|
/** Color per event type for visual scanning */
|
|
40239
40118
|
const EVENT_COLORS = {
|
|
40240
40119
|
agent_start: theme.success,
|
|
@@ -40500,8 +40379,7 @@ const EventStreamPanel = memo(function EventStreamPanel({ events, startTime, max
|
|
|
40500
40379
|
}, (prev, next) => {
|
|
40501
40380
|
return prev.events.length === next.events.length && prev.selectedIndex === next.selectedIndex && prev.maxVisibleLines === next.maxVisibleLines && prev.startTime === next.startTime && prev.detailEvent === next.detailEvent && prev.detailScrollOffset === next.detailScrollOffset && prev.width === next.width && prev.activeFilterCount === next.activeFilterCount && prev.totalTypeCount === next.totalTypeCount;
|
|
40502
40381
|
});
|
|
40503
|
-
|
|
40504
|
-
//#region src/ink/marathon/EventTypeFilter.tsx
|
|
40382
|
+
// src/ink/marathon/EventTypeFilter.tsx
|
|
40505
40383
|
/** Max visible rows in the event type list */
|
|
40506
40384
|
const MAX_VISIBLE$1 = 14;
|
|
40507
40385
|
function EventTypeFilter({ eventTypes, selectedTypes, onApply, onCancel }) {
|
|
@@ -40628,8 +40506,7 @@ function EventTypeFilter({ eventTypes, selectedTypes, onApply, onCancel }) {
|
|
|
40628
40506
|
]
|
|
40629
40507
|
});
|
|
40630
40508
|
}
|
|
40631
|
-
|
|
40632
|
-
//#region src/ink/marathon/ReasoningPanel.tsx
|
|
40509
|
+
// src/ink/marathon/ReasoningPanel.tsx
|
|
40633
40510
|
/** Wrap long lines at a given width so scroll math matches visual rows */
|
|
40634
40511
|
function wrapLines$1(lines, width) {
|
|
40635
40512
|
if (width <= 0) return lines;
|
|
@@ -40711,8 +40588,7 @@ function ReasoningPanel({ reasoning, maxVisibleLines = 50, scrollOffset = 0, wid
|
|
|
40711
40588
|
})]
|
|
40712
40589
|
});
|
|
40713
40590
|
}
|
|
40714
|
-
|
|
40715
|
-
//#region src/ink/marathon/FilesPanel.tsx
|
|
40591
|
+
// src/ink/marathon/FilesPanel.tsx
|
|
40716
40592
|
const TYPE_COLORS = {
|
|
40717
40593
|
plan: theme.accent,
|
|
40718
40594
|
written: theme.success,
|
|
@@ -40998,8 +40874,7 @@ function FilesPanel({ files, maxVisibleLines = 50, selectedIndex, detailFile, de
|
|
|
40998
40874
|
})]
|
|
40999
40875
|
});
|
|
41000
40876
|
}
|
|
41001
|
-
|
|
41002
|
-
//#region src/ink/marathon/HelpPanel.tsx
|
|
40877
|
+
// src/ink/marathon/HelpPanel.tsx
|
|
41003
40878
|
const NAVIGATION_SHORTCUTS = [
|
|
41004
40879
|
{
|
|
41005
40880
|
key: "Tab",
|
|
@@ -41296,8 +41171,7 @@ function HelpPanel({ width, height, isCheckpoint, scrollOffset }) {
|
|
|
41296
41171
|
]
|
|
41297
41172
|
});
|
|
41298
41173
|
}
|
|
41299
|
-
|
|
41300
|
-
//#region src/ink/marathon/file-utils.ts
|
|
41174
|
+
// src/ink/marathon/file-utils.ts
|
|
41301
41175
|
/**
|
|
41302
41176
|
* Extract tracked files from tool entries across all session snapshots + live tools.
|
|
41303
41177
|
* Deduplicates by path, preferring 'written' over 'read'.
|
|
@@ -41391,8 +41265,7 @@ function readFileContent(filePath, snapshots, liveTools, maxLines = 5e3) {
|
|
|
41391
41265
|
source: "disk"
|
|
41392
41266
|
};
|
|
41393
41267
|
}
|
|
41394
|
-
|
|
41395
|
-
//#region src/marathon/sandbox.ts
|
|
41268
|
+
// src/marathon/sandbox.ts
|
|
41396
41269
|
function isRecord$3(value) {
|
|
41397
41270
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41398
41271
|
}
|
|
@@ -41885,8 +41758,7 @@ function createDeployCfSandboxLocalTool(client, debugMode) {
|
|
|
41885
41758
|
}
|
|
41886
41759
|
};
|
|
41887
41760
|
}
|
|
41888
|
-
|
|
41889
|
-
//#region src/marathon/event-log.ts
|
|
41761
|
+
// src/marathon/event-log.ts
|
|
41890
41762
|
/** Derive the events directory from the state file path.
|
|
41891
41763
|
* `task-name.json` → `task-name.events/` */
|
|
41892
41764
|
function eventsDirForStateFile(stateFilePath) {
|
|
@@ -42329,8 +42201,7 @@ function syncTreeLogWithState(stateFilePath, state) {
|
|
|
42329
42201
|
}
|
|
42330
42202
|
} catch {}
|
|
42331
42203
|
}
|
|
42332
|
-
|
|
42333
|
-
//#region src/marathon/session-tree-view.ts
|
|
42204
|
+
// src/marathon/session-tree-view.ts
|
|
42334
42205
|
const PREVIEW_LENGTH = 60;
|
|
42335
42206
|
function previewText(text, length = PREVIEW_LENGTH) {
|
|
42336
42207
|
const collapsed = text.replace(/\s+/g, " ").trim();
|
|
@@ -42412,8 +42283,7 @@ function listForkCandidates(log) {
|
|
|
42412
42283
|
});
|
|
42413
42284
|
return candidates;
|
|
42414
42285
|
}
|
|
42415
|
-
|
|
42416
|
-
//#region src/marathon/steering-queue.ts
|
|
42286
|
+
// src/marathon/steering-queue.ts
|
|
42417
42287
|
/**
|
|
42418
42288
|
* Create an in-memory FIFO steering queue. State lives in the closure, so the
|
|
42419
42289
|
* caller should hold a single instance for the lifetime of a run (e.g. via a
|
|
@@ -42537,8 +42407,7 @@ function BlinkingTextInput({ value: originalValue, placeholder = "", focus = tru
|
|
|
42537
42407
|
}, { isActive: focus });
|
|
42538
42408
|
return /* @__PURE__ */ jsx(Text, { children: placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue });
|
|
42539
42409
|
}
|
|
42540
|
-
|
|
42541
|
-
//#region src/ink/talk/ModelPicker.tsx
|
|
42410
|
+
// src/ink/talk/ModelPicker.tsx
|
|
42542
42411
|
const DEFAULT_MODELS = [
|
|
42543
42412
|
{
|
|
42544
42413
|
label: "Claude Opus 4.6",
|
|
@@ -42861,8 +42730,7 @@ function ModelPicker({ currentModel, onSelect, onCancel, models }) {
|
|
|
42861
42730
|
]
|
|
42862
42731
|
});
|
|
42863
42732
|
}
|
|
42864
|
-
|
|
42865
|
-
//#region src/ink/marathon/types.ts
|
|
42733
|
+
// src/ink/marathon/types.ts
|
|
42866
42734
|
const MARATHON_CHECKPOINT_COMMANDS = [
|
|
42867
42735
|
{
|
|
42868
42736
|
name: "/model",
|
|
@@ -42935,8 +42803,7 @@ const MARATHON_CHECKPOINT_COMMANDS = [
|
|
|
42935
42803
|
hasArgs: false
|
|
42936
42804
|
}
|
|
42937
42805
|
];
|
|
42938
|
-
|
|
42939
|
-
//#region src/ink/marathon/CommandPicker.tsx
|
|
42806
|
+
// src/ink/marathon/CommandPicker.tsx
|
|
42940
42807
|
function CommandPicker({ onSelect, onCancel, initialFilter = "" }) {
|
|
42941
42808
|
const { stdout } = useStdout();
|
|
42942
42809
|
const [search, setSearch] = useState(initialFilter);
|
|
@@ -43035,8 +42902,7 @@ function CommandPicker({ onSelect, onCancel, initialFilter = "" }) {
|
|
|
43035
42902
|
]
|
|
43036
42903
|
});
|
|
43037
42904
|
}
|
|
43038
|
-
|
|
43039
|
-
//#region src/ink/marathon/text-area-editing.ts
|
|
42905
|
+
// src/ink/marathon/text-area-editing.ts
|
|
43040
42906
|
function ensureLines(lines) {
|
|
43041
42907
|
return lines.length > 0 ? lines : [""];
|
|
43042
42908
|
}
|
|
@@ -43106,8 +42972,7 @@ function deleteToLineStart(lines, cursor) {
|
|
|
43106
42972
|
}
|
|
43107
42973
|
};
|
|
43108
42974
|
}
|
|
43109
|
-
|
|
43110
|
-
//#region src/ink/marathon/TextArea.tsx
|
|
42975
|
+
// src/ink/marathon/TextArea.tsx
|
|
43111
42976
|
function splitLines(text) {
|
|
43112
42977
|
const lines = text.split("\n");
|
|
43113
42978
|
return lines.length === 0 ? [""] : lines;
|
|
@@ -43412,8 +43277,7 @@ function CursorLine({ content, cursorCol, maxWidth, visible = true }) {
|
|
|
43412
43277
|
})
|
|
43413
43278
|
] });
|
|
43414
43279
|
}
|
|
43415
|
-
|
|
43416
|
-
//#region src/ink/marathon/ReflectEditor.tsx
|
|
43280
|
+
// src/ink/marathon/ReflectEditor.tsx
|
|
43417
43281
|
const DEFAULT_REFLECT_PROMPT = `Before continuing, step back and reflect:
|
|
43418
43282
|
- What has been accomplished so far?
|
|
43419
43283
|
- What isn't working or is blocking progress?
|
|
@@ -43428,8 +43292,7 @@ function ReflectEditor({ onSubmit, onCancel, maxHeight = 10 }) {
|
|
|
43428
43292
|
maxHeight
|
|
43429
43293
|
});
|
|
43430
43294
|
}
|
|
43431
|
-
|
|
43432
|
-
//#region src/ink/marathon/CheckpointRecap.tsx
|
|
43295
|
+
// src/ink/marathon/CheckpointRecap.tsx
|
|
43433
43296
|
function formatTokenCount(value) {
|
|
43434
43297
|
return value.toLocaleString("en-US");
|
|
43435
43298
|
}
|
|
@@ -43469,8 +43332,7 @@ function CheckpointRecap({ sessionNumber, toolCallsMade, tokensInput, tokensOutp
|
|
|
43469
43332
|
]
|
|
43470
43333
|
});
|
|
43471
43334
|
}
|
|
43472
|
-
|
|
43473
|
-
//#region src/ink/marathon/TreePanel.tsx
|
|
43335
|
+
// src/ink/marathon/TreePanel.tsx
|
|
43474
43336
|
const MAX_VISIBLE_ROWS$1 = 12;
|
|
43475
43337
|
function TreePanel({ rows, onSelect, onCancel }) {
|
|
43476
43338
|
const initialIndex = Math.max(rows.findIndex((row) => row.isHead), 0);
|
|
@@ -43548,8 +43410,7 @@ function TreePanel({ rows, onSelect, onCancel }) {
|
|
|
43548
43410
|
]
|
|
43549
43411
|
});
|
|
43550
43412
|
}
|
|
43551
|
-
|
|
43552
|
-
//#region src/ink/marathon/ForkPicker.tsx
|
|
43413
|
+
// src/ink/marathon/ForkPicker.tsx
|
|
43553
43414
|
const MAX_VISIBLE_ROWS = 10;
|
|
43554
43415
|
function ForkPicker({ candidates, onSelect, onCancel }) {
|
|
43555
43416
|
const [selectedIndex, setSelectedIndex] = useState(Math.max(candidates.length - 1, 0));
|
|
@@ -43621,8 +43482,7 @@ function ForkPicker({ candidates, onSelect, onCancel }) {
|
|
|
43621
43482
|
]
|
|
43622
43483
|
});
|
|
43623
43484
|
}
|
|
43624
|
-
|
|
43625
|
-
//#region src/ink/marathon/checkpoint-prompt-state.ts
|
|
43485
|
+
// src/ink/marathon/checkpoint-prompt-state.ts
|
|
43626
43486
|
function shouldPauseCheckpointTimer(state) {
|
|
43627
43487
|
return Boolean(state.isTerminal || state.isStopped || state.timeout === 0 || state.isTyping || state.hasPendingChanges || state.showModelPicker || state.showReflectEditor || state.showCommandPicker || state.showTreePanel || state.showForkPicker || state.isReviewing);
|
|
43628
43488
|
}
|
|
@@ -43635,8 +43495,7 @@ function getCheckpointCountdownText(state) {
|
|
|
43635
43495
|
if (state.isReviewing) return "(reviewing)";
|
|
43636
43496
|
return `(${state.remaining}s)`;
|
|
43637
43497
|
}
|
|
43638
|
-
|
|
43639
|
-
//#region src/ink/marathon/CheckpointPrompt.tsx
|
|
43498
|
+
// src/ink/marathon/CheckpointPrompt.tsx
|
|
43640
43499
|
function CheckpointPrompt({ onSubmit, onToggleHelp, onCopySession, onCopySessionTrimmed, onOpenStateFile, onLoadTreeView, onLoadForkCandidates, timeout, isTerminal, isStopped = false, initialMessage, currentModel, recap, isReviewing = false }) {
|
|
43641
43500
|
const [value, setValue] = useState(initialMessage ?? "");
|
|
43642
43501
|
const [remaining, setRemaining] = useState(timeout);
|
|
@@ -43963,8 +43822,7 @@ function CheckpointPrompt({ onSubmit, onToggleHelp, onCopySession, onCopySession
|
|
|
43963
43822
|
})]
|
|
43964
43823
|
});
|
|
43965
43824
|
}
|
|
43966
|
-
|
|
43967
|
-
//#region src/ink/marathon/SteerComposer.tsx
|
|
43825
|
+
// src/ink/marathon/SteerComposer.tsx
|
|
43968
43826
|
/**
|
|
43969
43827
|
* Mid-run steering composer (Pi-style message queue). Opened with Enter while
|
|
43970
43828
|
* the marathon is streaming; Enter queues, Tab toggles delivery timing,
|
|
@@ -44035,8 +43893,7 @@ function SteerComposer({ initialDraft = "", onSubmit, onCancel }) {
|
|
|
44035
43893
|
})]
|
|
44036
43894
|
});
|
|
44037
43895
|
}
|
|
44038
|
-
|
|
44039
|
-
//#region src/ink/marathon/SessionActionMenu.tsx
|
|
43896
|
+
// src/ink/marathon/SessionActionMenu.tsx
|
|
44040
43897
|
const MENU_ITEMS = [
|
|
44041
43898
|
{
|
|
44042
43899
|
key: "c",
|
|
@@ -44127,8 +43984,7 @@ function SessionActionMenu({ onCopySession, onCopySessionTrimmed, onOpenStateFil
|
|
|
44127
43984
|
]
|
|
44128
43985
|
});
|
|
44129
43986
|
}
|
|
44130
|
-
|
|
44131
|
-
//#region src/ink/marathon/session-context-copy.ts
|
|
43987
|
+
// src/ink/marathon/session-context-copy.ts
|
|
44132
43988
|
const DEFAULT_MAX_CHARS = 900;
|
|
44133
43989
|
const HEAVY_PREVIEW_MAX_CHARS = 360;
|
|
44134
43990
|
const STREAM_EVENT_HEAVY_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -44273,8 +44129,7 @@ function compactLiveMarathonPayloadForContextExport(payload) {
|
|
|
44273
44129
|
rawEvents: payload.rawEvents.map(compactRawStreamEventForCopy)
|
|
44274
44130
|
};
|
|
44275
44131
|
}
|
|
44276
|
-
|
|
44277
|
-
//#region src/ink/marathon/UpgradeModal.tsx
|
|
44132
|
+
// src/ink/marathon/UpgradeModal.tsx
|
|
44278
44133
|
function UpgradeModal({ prompt, width }) {
|
|
44279
44134
|
return /* @__PURE__ */ jsxs(Box, {
|
|
44280
44135
|
width,
|
|
@@ -44355,8 +44210,7 @@ function UpgradeModal({ prompt, width }) {
|
|
|
44355
44210
|
]
|
|
44356
44211
|
});
|
|
44357
44212
|
}
|
|
44358
|
-
|
|
44359
|
-
//#region src/ink/marathon/ToolPanel.tsx
|
|
44213
|
+
// src/ink/marathon/ToolPanel.tsx
|
|
44360
44214
|
const TOOL_PANEL_TIMER_MS = 500;
|
|
44361
44215
|
function formatCharCount(chars) {
|
|
44362
44216
|
if (chars >= 1e3) return `${(chars / 1e3).toFixed(1)}k chars`;
|
|
@@ -44563,8 +44417,7 @@ const ToolPanel = memo(function ToolPanel({ tools, reasoningCharCount = 0, files
|
|
|
44563
44417
|
}, (prev, next) => {
|
|
44564
44418
|
return toolsFingerprint(prev.tools) === toolsFingerprint(next.tools) && prev.maxHeight === next.maxHeight && (prev.reasoningCharCount ?? 0) === (next.reasoningCharCount ?? 0) && filesFingerprint(prev.files) === filesFingerprint(next.files);
|
|
44565
44419
|
});
|
|
44566
|
-
|
|
44567
|
-
//#region src/ink/marathon/OverviewActivityPane.tsx
|
|
44420
|
+
// src/ink/marathon/OverviewActivityPane.tsx
|
|
44568
44421
|
const OverviewActivityPane = memo(function OverviewActivityPane({ tools, reasoningCharCount, files, maxHeight, stacked = false, width }) {
|
|
44569
44422
|
return /* @__PURE__ */ jsx(Box, {
|
|
44570
44423
|
flexDirection: "column",
|
|
@@ -44583,8 +44436,7 @@ const OverviewActivityPane = memo(function OverviewActivityPane({ tools, reasoni
|
|
|
44583
44436
|
})
|
|
44584
44437
|
});
|
|
44585
44438
|
});
|
|
44586
|
-
|
|
44587
|
-
//#region src/ink/marathon/ThinkingIndicator.tsx
|
|
44439
|
+
// src/ink/marathon/ThinkingIndicator.tsx
|
|
44588
44440
|
function ThinkingIndicator({ startedAt }) {
|
|
44589
44441
|
const [elapsed, setElapsed] = useState(() => startedAt ? Math.floor((Date.now() - startedAt) / 1e3) : 0);
|
|
44590
44442
|
useEffect(() => {
|
|
@@ -44600,8 +44452,7 @@ function ThinkingIndicator({ startedAt }) {
|
|
|
44600
44452
|
color: theme.textMuted
|
|
44601
44453
|
});
|
|
44602
44454
|
}
|
|
44603
|
-
|
|
44604
|
-
//#region src/ink/marathon/ContextCompactionIndicator.tsx
|
|
44455
|
+
// src/ink/marathon/ContextCompactionIndicator.tsx
|
|
44605
44456
|
function buildCompactionLabel(compaction, elapsedSeconds) {
|
|
44606
44457
|
const modeLabel = compaction.mode === "auto" ? "auto" : "manual";
|
|
44607
44458
|
const strategyLabel = compaction.strategy === "provider_native" ? "native" : "summary";
|
|
@@ -44624,8 +44475,7 @@ function ContextCompactionIndicator({ compaction }) {
|
|
|
44624
44475
|
color: theme.warning
|
|
44625
44476
|
});
|
|
44626
44477
|
}
|
|
44627
|
-
|
|
44628
|
-
//#region src/ink/marathon/ReasoningBlock.tsx
|
|
44478
|
+
// src/ink/marathon/ReasoningBlock.tsx
|
|
44629
44479
|
const REASONING_LABEL_COLOR = theme.accent;
|
|
44630
44480
|
const REASONING_TEXT_COLOR = theme.textMuted;
|
|
44631
44481
|
const REASONING_HINT_COLOR = theme.textSubtle;
|
|
@@ -44662,8 +44512,7 @@ function ReasoningBlock({ lines, live = false, collapsed = false, compact = fals
|
|
|
44662
44512
|
]
|
|
44663
44513
|
});
|
|
44664
44514
|
}
|
|
44665
|
-
|
|
44666
|
-
//#region src/ink/marathon/OverviewTranscriptPane.tsx
|
|
44515
|
+
// src/ink/marathon/OverviewTranscriptPane.tsx
|
|
44667
44516
|
const UPGRADE_BROWSE_HINT_LINES = ["Upgrade modal dismissed.", "Use Shift+Left/Right or 1-9 to review previous marathon runs."];
|
|
44668
44517
|
const OverviewTranscriptPane = memo(function OverviewTranscriptPane({ content, enableMarkdown, isStreaming, maxVisibleLines, scrollOffset, totalLines, paneWidth, contentHeight, showLoadingAnimation = false, hasReasoning = false, visibleReasoningLines = [], reasoningCollapsed = false, reasoningLive = false, showThinkingIndicator = false, thinkingStartedAt, contextCompaction = null, showUpgradeBrowseHint = false, error = null }) {
|
|
44669
44518
|
if (showLoadingAnimation) return /* @__PURE__ */ jsx(Box, {
|
|
@@ -44719,8 +44568,7 @@ const OverviewTranscriptPane = memo(function OverviewTranscriptPane({ content, e
|
|
|
44719
44568
|
error && /* @__PURE__ */ jsx(ErrorDisplay, { error })
|
|
44720
44569
|
] });
|
|
44721
44570
|
});
|
|
44722
|
-
|
|
44723
|
-
//#region src/ink/marathon/upgrade-modal-utils.ts
|
|
44571
|
+
// src/ink/marathon/upgrade-modal-utils.ts
|
|
44724
44572
|
const UPGRADE_LIMIT_TYPES = /* @__PURE__ */ new Set([
|
|
44725
44573
|
"daily_limit",
|
|
44726
44574
|
"monthly_limit",
|
|
@@ -44753,8 +44601,7 @@ function parseMarathonUpgradePrompt(error) {
|
|
|
44753
44601
|
...retryAfter ? { retryAfter } : {}
|
|
44754
44602
|
};
|
|
44755
44603
|
}
|
|
44756
|
-
|
|
44757
|
-
//#region src/ink/marathon/session-tabs-utils.ts
|
|
44604
|
+
// src/ink/marathon/session-tabs-utils.ts
|
|
44758
44605
|
const MAX_VISIBLE_TAB_SHORTCUTS = 9;
|
|
44759
44606
|
const TAB_PADDING = 4;
|
|
44760
44607
|
const TAB_SEPARATOR_WIDTH = 1;
|
|
@@ -44857,13 +44704,11 @@ function getSessionTabKeyForShortcut(visibleTabs, input) {
|
|
|
44857
44704
|
const slot = Number(input);
|
|
44858
44705
|
return visibleTabs.find((tab) => tab.shortcut === slot)?.key;
|
|
44859
44706
|
}
|
|
44860
|
-
|
|
44861
|
-
//#region src/ink/marathon/checkpoint-navigation.ts
|
|
44707
|
+
// src/ink/marathon/checkpoint-navigation.ts
|
|
44862
44708
|
function isAllowedCheckpointBrowseKey(key, isBrowsingScreen) {
|
|
44863
44709
|
return Boolean(key.upArrow || key.downArrow || key.return && isBrowsingScreen || key.input === "c" && isBrowsingScreen || key.leftArrow && isBrowsingScreen || key.rightArrow && isBrowsingScreen || key.tab || key.escape || key.shift && key.leftArrow || key.shift && key.rightArrow);
|
|
44864
44710
|
}
|
|
44865
|
-
|
|
44866
|
-
//#region src/ink/marathon/MarathonApp.tsx
|
|
44711
|
+
// src/ink/marathon/MarathonApp.tsx
|
|
44867
44712
|
/** Columns allocated for tool panel in wide terminals */
|
|
44868
44713
|
const TOOL_PANEL_WIDE = 48;
|
|
44869
44714
|
/** Columns allocated for tool panel in medium terminals */
|
|
@@ -46166,8 +46011,7 @@ function MarathonApp({ taskName, agentId, model, sandbox, goal, initialSessionCo
|
|
|
46166
46011
|
]
|
|
46167
46012
|
});
|
|
46168
46013
|
}
|
|
46169
|
-
|
|
46170
|
-
//#region src/ink/marathon/MarathonStartupShell.tsx
|
|
46014
|
+
// src/ink/marathon/MarathonStartupShell.tsx
|
|
46171
46015
|
const SCROLL_HINT = "↑↓ Enter 1-3";
|
|
46172
46016
|
const PROMPT_COLUMN_MAX = 68;
|
|
46173
46017
|
const MIN_HOLD_MS = 1500;
|
|
@@ -46642,8 +46486,7 @@ function MarathonStartupShell({ startupRef, marathonAppProps, version }) {
|
|
|
46642
46486
|
]
|
|
46643
46487
|
});
|
|
46644
46488
|
}
|
|
46645
|
-
|
|
46646
|
-
//#region src/lib/terminal-title.ts
|
|
46489
|
+
// src/lib/terminal-title.ts
|
|
46647
46490
|
/** Set the terminal tab title via OSC 0 escape sequence. */
|
|
46648
46491
|
function setTerminalTitle(title) {
|
|
46649
46492
|
if (process.stdout.isTTY) process.stdout.write(`\x1b]0;${title}\x07`);
|
|
@@ -46660,8 +46503,7 @@ function setCliTitle() {
|
|
|
46660
46503
|
function setMarathonTitle() {
|
|
46661
46504
|
setTerminalTitle(`Runtype: Marathon (${getFolderName()})`);
|
|
46662
46505
|
}
|
|
46663
|
-
|
|
46664
|
-
//#region src/marathon/checkpoint.ts
|
|
46506
|
+
// src/marathon/checkpoint.ts
|
|
46665
46507
|
function defaultStateDir$2() {
|
|
46666
46508
|
return getMarathonStateDir();
|
|
46667
46509
|
}
|
|
@@ -46711,8 +46553,7 @@ function restoreMarathonFileCheckpoint(taskName, targetPath, stateDir, stateFile
|
|
|
46711
46553
|
checkpointPath
|
|
46712
46554
|
};
|
|
46713
46555
|
}
|
|
46714
|
-
|
|
46715
|
-
//#region src/marathon/errors.ts
|
|
46556
|
+
// src/marathon/errors.ts
|
|
46716
46557
|
/** Patterns that indicate a transient network failure (connection lost, DNS, timeout). */
|
|
46717
46558
|
const NETWORK_ERROR_PATTERNS = [
|
|
46718
46559
|
"fetch failed",
|
|
@@ -46916,8 +46757,7 @@ function formatMarathonApiError(error) {
|
|
|
46916
46757
|
return chalk.gray(line);
|
|
46917
46758
|
});
|
|
46918
46759
|
}
|
|
46919
|
-
|
|
46920
|
-
//#region src/marathon/verification.ts
|
|
46760
|
+
// src/marathon/verification.ts
|
|
46921
46761
|
/**
|
|
46922
46762
|
* Verification command safety gate.
|
|
46923
46763
|
*
|
|
@@ -47113,8 +46953,7 @@ function isScriptConfigModified(cwd, files) {
|
|
|
47113
46953
|
return true;
|
|
47114
46954
|
}
|
|
47115
46955
|
}
|
|
47116
|
-
|
|
47117
|
-
//#region src/lib/select-prompt.ts
|
|
46956
|
+
// src/lib/select-prompt.ts
|
|
47118
46957
|
function canUseArrowKeySelect() {
|
|
47119
46958
|
return process.stdin.isTTY === true && process.stdout.isTTY === true && typeof process.stdin.setRawMode === "function";
|
|
47120
46959
|
}
|
|
@@ -47217,8 +47056,7 @@ async function promptSelect(message, choices, options) {
|
|
|
47217
47056
|
renderMenu();
|
|
47218
47057
|
});
|
|
47219
47058
|
}
|
|
47220
|
-
|
|
47221
|
-
//#region src/marathon/state.ts
|
|
47059
|
+
// src/marathon/state.ts
|
|
47222
47060
|
function defaultStateDir$1() {
|
|
47223
47061
|
return getMarathonStateDir();
|
|
47224
47062
|
}
|
|
@@ -47580,8 +47418,7 @@ async function resolveMarathonStateResolution(options, taskName, filePath, promp
|
|
|
47580
47418
|
function buildResumeCommand(agent, options, parsedSandbox) {
|
|
47581
47419
|
return `runtype marathon ${agent} --resume${options.name ? ` --name ${options.name}` : ""}${options.session ? ` --session ${options.session}` : ""}${parsedSandbox ? ` --sandbox ${parsedSandbox}` : ""}`;
|
|
47582
47420
|
}
|
|
47583
|
-
|
|
47584
|
-
//#region src/marathon/session-tree-nav.ts
|
|
47421
|
+
// src/marathon/session-tree-nav.ts
|
|
47585
47422
|
/**
|
|
47586
47423
|
* Apply `/tree` / `/fork` from a checkpoint result. Returns null when there
|
|
47587
47424
|
* is nothing to do (no navigation requested, no state file, no tree log yet,
|
|
@@ -47646,8 +47483,7 @@ function applyCheckpointTreeNavigation(stateFilePath, navigation) {
|
|
|
47646
47483
|
mergedState
|
|
47647
47484
|
};
|
|
47648
47485
|
}
|
|
47649
|
-
|
|
47650
|
-
//#region src/marathon/repo-discovery.ts
|
|
47486
|
+
// src/marathon/repo-discovery.ts
|
|
47651
47487
|
const IGNORED_REPO_DIRS = /* @__PURE__ */ new Set([
|
|
47652
47488
|
".git",
|
|
47653
47489
|
".next",
|
|
@@ -47912,8 +47748,7 @@ function buildTree(dirPath, maxDepth, depth = 0) {
|
|
|
47912
47748
|
}
|
|
47913
47749
|
return lines;
|
|
47914
47750
|
}
|
|
47915
|
-
|
|
47916
|
-
//#region src/marathon/local-tools.ts
|
|
47751
|
+
// src/marathon/local-tools.ts
|
|
47917
47752
|
const DIRECT_TOOL_BLOCKED_SEGMENTS = /* @__PURE__ */ new Set([".git", ".runtype"]);
|
|
47918
47753
|
const MAX_TOOL_PATH_SYMLINKS = 40;
|
|
47919
47754
|
function stateSafeName$1(name) {
|
|
@@ -48564,8 +48399,7 @@ function buildLocalTools(client, sandboxProvider, options, context) {
|
|
|
48564
48399
|
}
|
|
48565
48400
|
return Object.keys(enabledTools).length > 0 ? enabledTools : void 0;
|
|
48566
48401
|
}
|
|
48567
|
-
|
|
48568
|
-
//#region src/marathon/session-chunker.ts
|
|
48402
|
+
// src/marathon/session-chunker.ts
|
|
48569
48403
|
/** Approximate max characters per chunk (~512 tokens) */
|
|
48570
48404
|
const DEFAULT_MAX_CHUNK_CHARS = 2e3;
|
|
48571
48405
|
/** Minimum content length worth indexing */
|
|
@@ -48675,8 +48509,7 @@ function chunkText(text, type, maxChars, toolName) {
|
|
|
48675
48509
|
});
|
|
48676
48510
|
return chunks;
|
|
48677
48511
|
}
|
|
48678
|
-
|
|
48679
|
-
//#region src/marathon/loop-detector.ts
|
|
48512
|
+
// src/marathon/loop-detector.ts
|
|
48680
48513
|
const DEFAULT_MAX_HISTORY = 30;
|
|
48681
48514
|
const DEFAULT_MIN_PATTERN_LENGTH = 2;
|
|
48682
48515
|
const DEFAULT_MAX_PATTERN_LENGTH = 5;
|
|
@@ -48750,8 +48583,7 @@ function createLoopDetector(options = {}) {
|
|
|
48750
48583
|
}
|
|
48751
48584
|
};
|
|
48752
48585
|
}
|
|
48753
|
-
|
|
48754
|
-
//#region src/marathon/context-offload.ts
|
|
48586
|
+
// src/marathon/context-offload.ts
|
|
48755
48587
|
/** Character threshold above which tool output is offloaded to a file */
|
|
48756
48588
|
const DEFAULT_OUTPUT_THRESHOLD = 2e3;
|
|
48757
48589
|
/** How many characters of the original output to include in the reference */
|
|
@@ -48869,8 +48701,7 @@ function withOffloading(tool, taskName, toolName, options, stateDir) {
|
|
|
48869
48701
|
}
|
|
48870
48702
|
};
|
|
48871
48703
|
}
|
|
48872
|
-
|
|
48873
|
-
//#region src/marathon/model-context.ts
|
|
48704
|
+
// src/marathon/model-context.ts
|
|
48874
48705
|
const DEFAULT_AUTO_COMPACT_THRESHOLD_RATIO = .8;
|
|
48875
48706
|
const DEFAULT_PROVIDER_NATIVE_COMPACT_THRESHOLD_RATIO = .9;
|
|
48876
48707
|
const DEFAULT_OUTPUT_RESERVE_RATIO = .15;
|
|
@@ -48965,8 +48796,7 @@ function resolveAutoCompactTokenThreshold(modelContextLength, rawThreshold, stra
|
|
|
48965
48796
|
if (!Number.isFinite(numericValue) || numericValue <= 0) throw new Error(`Invalid --compact-threshold value "${rawThreshold}". Use a percentage (e.g. 80%) or absolute token count (e.g. 120000).`);
|
|
48966
48797
|
return Math.max(1, Math.floor(numericValue));
|
|
48967
48798
|
}
|
|
48968
|
-
|
|
48969
|
-
//#region src/marathon/recipes.ts
|
|
48799
|
+
// src/marathon/recipes.ts
|
|
48970
48800
|
const RULES_DIR = ".marathon/rules";
|
|
48971
48801
|
function loadRules(cwd) {
|
|
48972
48802
|
const baseCwd = cwd || process.cwd();
|
|
@@ -49110,8 +48940,7 @@ function resolveErrorHandlingForPhase(phase, cliFallbackModel, milestoneFallback
|
|
|
49110
48940
|
...triggers ? { triggers } : {}
|
|
49111
48941
|
};
|
|
49112
48942
|
}
|
|
49113
|
-
|
|
49114
|
-
//#region src/marathon/playbook-loader.ts
|
|
48943
|
+
// src/marathon/playbook-loader.ts
|
|
49115
48944
|
const PLAYBOOKS_DIR = ".runtype/marathons/playbooks";
|
|
49116
48945
|
function getCandidatePaths(nameOrPath, cwd) {
|
|
49117
48946
|
const home = os$1.homedir();
|
|
@@ -49295,8 +49124,7 @@ function normalizeFallbackModel(input) {
|
|
|
49295
49124
|
...input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : {}
|
|
49296
49125
|
};
|
|
49297
49126
|
}
|
|
49298
|
-
|
|
49299
|
-
//#region src/commands/agents-task.ts
|
|
49127
|
+
// src/commands/agents-task.ts
|
|
49300
49128
|
function shouldRequestResumeCheckpoint(status, resumeMessage, noCheckpoint, originalMessage, continuations) {
|
|
49301
49129
|
if (status !== "paused" || noCheckpoint) return false;
|
|
49302
49130
|
const normalizedResumeMessage = resumeMessage?.trim();
|
|
@@ -50696,8 +50524,7 @@ const taskCommand = applyTaskOptions(new Command("task").description("Run a mult
|
|
|
50696
50524
|
function createMarathonCommand() {
|
|
50697
50525
|
return applyTaskOptions(new Command("marathon").description("Run a multi-session agent task (alias for agents task)"));
|
|
50698
50526
|
}
|
|
50699
|
-
|
|
50700
|
-
//#region src/commands/agent-aliases.ts
|
|
50527
|
+
// src/commands/agent-aliases.ts
|
|
50701
50528
|
/** Print a failure the way every other CLI command does, then exit non-zero. */
|
|
50702
50529
|
function fail$3(headline, error) {
|
|
50703
50530
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -50938,8 +50765,7 @@ agentDeploymentsCommand.command("list <agentId>").description("List deployment r
|
|
|
50938
50765
|
fail$3("Failed to list deployment receipts", error);
|
|
50939
50766
|
}
|
|
50940
50767
|
});
|
|
50941
|
-
|
|
50942
|
-
//#region src/commands/agent-ensure.ts
|
|
50768
|
+
// src/commands/agent-ensure.ts
|
|
50943
50769
|
/**
|
|
50944
50770
|
* The activation the flags ask for. `release` and `deploy` are two spellings of
|
|
50945
50771
|
* one thing, so supplying both is refused before any request is sent.
|
|
@@ -51125,8 +50951,7 @@ const agentPullCommand = new Command("pull").description("Print an agent as the
|
|
|
51125
50951
|
process.exit(1);
|
|
51126
50952
|
}
|
|
51127
50953
|
});
|
|
51128
|
-
|
|
51129
|
-
//#region src/commands/agent-promote.ts
|
|
50954
|
+
// src/commands/agent-promote.ts
|
|
51130
50955
|
const DEFAULT_SOURCE_KEY_ENV = "RUNTYPE_SOURCE_API_KEY";
|
|
51131
50956
|
const DEFAULT_TARGET_KEY_ENV = "RUNTYPE_TARGET_API_KEY";
|
|
51132
50957
|
const DEFAULT_MANIFEST_PATH = "promotion.json";
|
|
@@ -51250,8 +51075,7 @@ addCredentialOptions(agentPromoteCommand.command("activate <manifest>").descript
|
|
|
51250
51075
|
fail$2("Failed to activate the promotion", error);
|
|
51251
51076
|
}
|
|
51252
51077
|
});
|
|
51253
|
-
|
|
51254
|
-
//#region src/commands/deploy.ts
|
|
51078
|
+
// src/commands/deploy.ts
|
|
51255
51079
|
function bashSingleQuote(s) {
|
|
51256
51080
|
return "'" + s.replace(/'/g, "'\\''") + "'";
|
|
51257
51081
|
}
|
|
@@ -52580,8 +52404,7 @@ const deployCommand = new Command("deploy").description("Export an agent and sca
|
|
|
52580
52404
|
console.log(" --allow-unauthenticated --port 8080");
|
|
52581
52405
|
}
|
|
52582
52406
|
});
|
|
52583
|
-
|
|
52584
|
-
//#region src/commands/agent-export-runtime.ts
|
|
52407
|
+
// src/commands/agent-export-runtime.ts
|
|
52585
52408
|
const agentExportRuntimeCommand = new Command("export-runtime").description("Export an agent for @runtypelabs/runtime, as JSON or as a vendorable bundle zip").argument("<id>", "Agent ID").option("--alias <name>", "Export the version the agent's release alias points at").option("--version-id <id>", "Export this published agent version").option("--format <format>", "json (the definition) or bundle (definition + prebuilt runtime zip)", "json").option("--output <path>", "Write to this file (bundle default: the server-provided file name)").action(async (id, options) => {
|
|
52586
52409
|
if (options.format !== "json" && options.format !== "bundle") {
|
|
52587
52410
|
console.error(chalk.red(`Error: unknown --format "${options.format}". Must be json or bundle.`));
|
|
@@ -52620,8 +52443,7 @@ const agentExportRuntimeCommand = new Command("export-runtime").description("Exp
|
|
|
52620
52443
|
process.exit(1);
|
|
52621
52444
|
}
|
|
52622
52445
|
});
|
|
52623
|
-
|
|
52624
|
-
//#region src/commands/agents.ts
|
|
52446
|
+
// src/commands/agents.ts
|
|
52625
52447
|
const agentsCommand = new Command("agents").description("Manage agents");
|
|
52626
52448
|
agentsCommand.addCommand(taskCommand);
|
|
52627
52449
|
agentsCommand.addCommand(agentAliasesCommand);
|
|
@@ -53001,8 +52823,7 @@ addExecutionInputOptions(agentsCommand.command("execute <id>").description("Exec
|
|
|
53001
52823
|
return options.stream ? client.agents.executeStream(id, payload) : client.agents.execute(id, payload);
|
|
53002
52824
|
}, "agent");
|
|
53003
52825
|
});
|
|
53004
|
-
|
|
53005
|
-
//#region src/commands/models.ts
|
|
52826
|
+
// src/commands/models.ts
|
|
53006
52827
|
const modelsCommand = new Command("models").description("Manage model configurations");
|
|
53007
52828
|
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) => {
|
|
53008
52829
|
const apiKey = await ensureAuth();
|
|
@@ -53292,8 +53113,7 @@ modelsCommand.command("usage").description("Show model usage statistics").option
|
|
|
53292
53113
|
process.exit(1);
|
|
53293
53114
|
}
|
|
53294
53115
|
});
|
|
53295
|
-
|
|
53296
|
-
//#region src/commands/schedules.ts
|
|
53116
|
+
// src/commands/schedules.ts
|
|
53297
53117
|
const schedulesCommand = new Command("schedules").description("Manage schedules");
|
|
53298
53118
|
schedulesCommand.command("list").description("List all schedules").option("--limit <n>", "Limit results (defaults to the API page size)").option("--cursor <cursor>", "Pagination cursor for the next page").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
53299
53119
|
const apiKey = await ensureAuth();
|
|
@@ -53825,8 +53645,7 @@ schedulesCommand.command("delete <id>").description("Delete a schedule").option(
|
|
|
53825
53645
|
const { waitUntilExit } = render(React.createElement(App));
|
|
53826
53646
|
await waitUntilExit();
|
|
53827
53647
|
});
|
|
53828
|
-
|
|
53829
|
-
//#region src/lib/eval-discovery.ts
|
|
53648
|
+
// src/lib/eval-discovery.ts
|
|
53830
53649
|
/** Suffixes that mark a file as an eval suite. */
|
|
53831
53650
|
const EVAL_FILE_SUFFIXES = [".eval.ts", ".eval.mts"];
|
|
53832
53651
|
/** Directories never worth walking into during discovery. */
|
|
@@ -53900,8 +53719,7 @@ async function loadEvalDefinition(filePath) {
|
|
|
53900
53719
|
if (typeof exported !== "object" || !("target" in exported) || !("cases" in exported) || !Array.isArray(exported.cases)) throw new Error(`Eval file ${filePath} default export is not an eval definition. Export defineEval({ target, cases, ... }).`);
|
|
53901
53720
|
return exported;
|
|
53902
53721
|
}
|
|
53903
|
-
|
|
53904
|
-
//#region src/lib/eval-junit.ts
|
|
53722
|
+
// src/lib/eval-junit.ts
|
|
53905
53723
|
/** XML-escape text/attribute content (the five predefined XML entities). */
|
|
53906
53724
|
function escapeXml(value) {
|
|
53907
53725
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -53934,8 +53752,7 @@ function buildJUnitXml(suites) {
|
|
|
53934
53752
|
lines.push("</testsuites>");
|
|
53935
53753
|
return lines.join("\n") + "\n";
|
|
53936
53754
|
}
|
|
53937
|
-
|
|
53938
|
-
//#region src/commands/eval.ts
|
|
53755
|
+
// src/commands/eval.ts
|
|
53939
53756
|
const evalCommand = new Command("eval").description("Manage evaluations");
|
|
53940
53757
|
evalCommand.command("submit").description("Submit an eval batch").requiredOption("-f, --flow <id>", "Flow ID to evaluate").requiredOption("-r, --records <file>", "JSON file with record IDs").option("-n, --name <name>", "Eval batch name").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
53941
53758
|
const apiKey = await ensureAuth();
|
|
@@ -54455,8 +54272,7 @@ async function writeApiKeyFile(file, options = {}) {
|
|
|
54455
54272
|
usageHint: apiKeyFileUsageHint(targetPath)
|
|
54456
54273
|
};
|
|
54457
54274
|
}
|
|
54458
|
-
|
|
54459
|
-
//#region src/lib/api-key-request-flow.ts
|
|
54275
|
+
// src/lib/api-key-request-flow.ts
|
|
54460
54276
|
var ApiKeyRequestError = class extends Error {
|
|
54461
54277
|
code;
|
|
54462
54278
|
resumeCommand;
|
|
@@ -54756,8 +54572,7 @@ function deliveredKeyJson(delivered) {
|
|
|
54756
54572
|
nextSteps: delivered.nextSteps
|
|
54757
54573
|
};
|
|
54758
54574
|
}
|
|
54759
|
-
|
|
54760
|
-
//#region src/commands/api-keys-requests.ts
|
|
54575
|
+
// src/commands/api-keys-requests.ts
|
|
54761
54576
|
/**
|
|
54762
54577
|
* `runtype api-keys request` and `runtype api-keys claim` are the CLI half of the agent key-request ceremony.
|
|
54763
54578
|
* `request` files the request, hands a human the approval URL, polls, and redeems.
|
|
@@ -55044,8 +54859,7 @@ async function claimWithoutLogin(args) {
|
|
|
55044
54859
|
});
|
|
55045
54860
|
return deliverClaimedKey(args.json ? await redeem(() => {}) : await withSpinner(args.useInk && args.wait, "Redeeming without a login...", redeem), delivery);
|
|
55046
54861
|
}
|
|
55047
|
-
|
|
55048
|
-
//#region src/commands/api-keys.ts
|
|
54862
|
+
// src/commands/api-keys.ts
|
|
55049
54863
|
/** Best-effort org id for the key file; provenance only, never authorization. */
|
|
55050
54864
|
async function storedOrganizationId() {
|
|
55051
54865
|
try {
|
|
@@ -55546,8 +55360,7 @@ apiKeysCommand.command("analytics").description("Show API key usage analytics").
|
|
|
55546
55360
|
await waitUntilExit();
|
|
55547
55361
|
});
|
|
55548
55362
|
registerApiKeyRequestCommands(apiKeysCommand);
|
|
55549
|
-
|
|
55550
|
-
//#region src/commands/client-tokens.ts
|
|
55363
|
+
// src/commands/client-tokens.ts
|
|
55551
55364
|
const clientTokensCommand = new Command("client-tokens").description("Manage client tokens for Persona widget embedding");
|
|
55552
55365
|
clientTokensCommand.command("list").description("List your client tokens").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
|
|
55553
55366
|
const apiKey = await ensureAuth();
|
|
@@ -56037,10 +55850,9 @@ clientTokensCommand.command("regenerate <id>").description("Regenerate a client
|
|
|
56037
55850
|
await waitUntilExit();
|
|
56038
55851
|
});
|
|
56039
55852
|
clientTokensCommand.addCommand(clientTokenEnsureCommand);
|
|
56040
|
-
|
|
56041
|
-
//#region ../../node_modules/.pnpm/@runtypelabs+persona@4.32.2/node_modules/@runtypelabs/persona/dist/codegen.js
|
|
55853
|
+
// ../../node_modules/.pnpm/@runtypelabs+persona@4.33.0/node_modules/@runtypelabs/persona/dist/codegen.js
|
|
56042
55854
|
function e(e) {
|
|
56043
|
-
return e?.cdnBase?.trim().replace(/\/+$/, ``).replace(/[\\'"<>`]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase().padStart(2, `0`)}`) || `https://cdn.jsdelivr.net/npm/@runtypelabs/persona@4.
|
|
55855
|
+
return e?.cdnBase?.trim().replace(/\/+$/, ``).replace(/[\\'"<>`]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase().padStart(2, `0`)}`) || `https://cdn.jsdelivr.net/npm/@runtypelabs/persona@4.33.0/dist`;
|
|
56044
55856
|
}
|
|
56045
55857
|
function t(e) {
|
|
56046
55858
|
if (e !== void 0) return typeof e == `string` ? e : Array.isArray(e) ? `[${e.map((e) => e.toString()).join(`, `)}]` : e.toString();
|
|
@@ -56639,8 +56451,7 @@ function k(t, n) {
|
|
|
56639
56451
|
});`), a.push(` };`)), a.push(``), r?.actionParsers ? (a.push(` // Action parsers (custom merged with defaults)`), a.push(` var customParsers = ${r.actionParsers};`), a.push(` widgetConfig.actionParsers = customParsers.concat([`), a.push(` agentWidget.defaultJsonActionParser,`), a.push(` ${i}`), a.push(` ]);`)) : (a.push(` // Action parsers to detect JSON actions in responses`), a.push(` widgetConfig.actionParsers = [`), a.push(` agentWidget.defaultJsonActionParser,`), a.push(` ${i}`), a.push(` ];`)), a.push(``), r?.actionHandlers ? (a.push(` // Action handlers (custom merged with defaults)`), a.push(` var customHandlers = ${r.actionHandlers};`), a.push(` widgetConfig.actionHandlers = customHandlers.concat([`), a.push(` agentWidget.defaultActionHandlers.message,`), a.push(` agentWidget.defaultActionHandlers.messageAndClick,`), a.push(` ${o}`), a.push(` ]);`)) : (a.push(` // Action handlers for navigation and other actions`), a.push(` widgetConfig.actionHandlers = [`), a.push(` agentWidget.defaultActionHandlers.message,`), a.push(` agentWidget.defaultActionHandlers.messageAndClick,`), a.push(` ${o}`), a.push(` ];`)), a.push(``), r?.requestMiddleware ? (a.push(` // Request middleware (custom merged with DOM context)`), a.push(` widgetConfig.requestMiddleware = function(ctx) {`), a.push(` var customResult = (${r.requestMiddleware})(ctx);`), a.push(` var merged = customResult || ctx.payload;`), a.push(` return Object.assign({}, merged, { metadata: Object.assign({}, merged.metadata, domContextProvider()) });`), a.push(` };`)) : (a.push(` // Send DOM context with each request`), a.push(` widgetConfig.requestMiddleware = function(ctx) {`), a.push(` return Object.assign({}, ctx.payload, { metadata: domContextProvider() });`), a.push(` };`)), a.push(``), r?.postprocessMessage ? a.push(` widgetConfig.postprocessMessage = ${r.postprocessMessage};`) : (a.push(` // Markdown postprocessor`), a.push(` widgetConfig.postprocessMessage = function(ctx) {`), a.push(` return agentWidget.markdownPostprocessor(ctx.text);`), a.push(` };`)), a.push(``), (r?.onFeedback || r?.onCopy) && (a.push(` // Message action callbacks`), a.push(` widgetConfig.messageActions = widgetConfig.messageActions || {};`), r?.onFeedback && a.push(` widgetConfig.messageActions.onFeedback = ${r.onFeedback};`), r?.onCopy && a.push(` widgetConfig.messageActions.onCopy = ${r.onCopy};`), a.push(``)), a.push(` return widgetConfig;`, ` };`, ``, ` // Initialize widget`, ` var init = function() {`, ` var agentWidget = window.AgentWidget;`, ` if (!agentWidget) {`, ` console.error('AgentWidget not loaded');`, ` return;`, ` }`, ``, ` var widgetConfig = createWidgetConfig(agentWidget);`, ``, ` // Load saved state`, ` var savedState = localStorage.getItem(STORAGE_KEY);`, ` if (savedState) {`, ` try {`, ` var parsed = JSON.parse(savedState);`, ` widgetConfig.initialMessages = parsed.messages || [];`, ` } catch (e) {`, ` console.error('Failed to load saved state:', e);`, ` }`, ` }`, ``, ` // Initialize widget`, ` var handle = agentWidget.initAgentWidget({`, ` target: '${b(n)}',`, ` useShadowDom: false,`, ...n?.windowKey ? [` windowKey: '${n.windowKey}',`] : [], ` config: widgetConfig`, ` });`, ``, ` // Save state on message events`, ` window.addEventListener('persona:message', function() {`, ` var session = handle.getSession ? handle.getSession() : null;`, ` if (session) {`, ` localStorage.setItem(STORAGE_KEY, JSON.stringify({`, ` messages: session.messages,`, ` timestamp: new Date().toISOString()`, ` }));`, ` }`, ` });`, ``, ` // Clear state on clear chat`, ` window.addEventListener('persona:clear-chat', function() {`, ` localStorage.removeItem(STORAGE_KEY);`, ` localStorage.removeItem(PROCESSED_ACTIONS_KEY);`, ` });`, ` };`, ``, ` // Wait for framework hydration to complete (Next.js, Nuxt, etc.)`, ` // This prevents the framework from removing dynamically added CSS during reconciliation`, ` var waitForHydration = function(callback) {`, ` var executed = false;`, ` `, ` var execute = function() {`, ` if (executed) return;`, ` executed = true;`, ` callback();`, ` };`, ``, ` var afterDom = function() {`, ` // Strategy 1: Use requestIdleCallback if available (best for detecting idle after hydration)`, ` if (typeof requestIdleCallback !== 'undefined') {`, ` requestIdleCallback(function() {`, ` // Double requestAnimationFrame ensures at least one full paint cycle completed`, ` requestAnimationFrame(function() {`, ` requestAnimationFrame(execute);`, ` });`, ` }, { timeout: 3000 }); // Max wait 3 seconds, then proceed anyway`, ` } else {`, ` // Strategy 2: Fallback for Safari (no requestIdleCallback)`, ` // 300ms is typically enough for hydration on most pages`, ` setTimeout(execute, 300);`, ` }`, ` };`, ``, ` if (document.readyState === 'loading') {`, ` document.addEventListener('DOMContentLoaded', afterDom);`, ` } else {`, ` // DOM already ready, but still wait for potential hydration`, ` afterDom();`, ` }`, ` };`, ``, ` // Boot sequence: wait for hydration, then load CSS and JS, then initialize`, ` // This prevents Next.js/Nuxt/etc. from removing dynamically added CSS during reconciliation`, ` waitForHydration(function() {`, ` loadCSS();`, ` loadJS(function() {`, ` init();`, ` });`, ` });`, `})();`, `<\/script>`), a.join(`
|
|
56640
56452
|
`);
|
|
56641
56453
|
}
|
|
56642
|
-
|
|
56643
|
-
//#region src/lib/persona-snippets.ts
|
|
56454
|
+
// src/lib/persona-snippets.ts
|
|
56644
56455
|
/**
|
|
56645
56456
|
* Map a CLI format to its real Persona generator format. Each maps to its true
|
|
56646
56457
|
* equivalent: `script-manual` → Persona's CDN global-script `script-manual` (not
|
|
@@ -56692,8 +56503,7 @@ function getPersonaInstallerScriptUrl() {
|
|
|
56692
56503
|
parserType: "json"
|
|
56693
56504
|
}, "script-installer").match(/<script\s+src="([^"]+)"/)?.[1] ?? "https://cdn.jsdelivr.net/npm/@runtypelabs/persona/dist/install.global.js";
|
|
56694
56505
|
}
|
|
56695
|
-
|
|
56696
|
-
//#region src/lib/persona-init.ts
|
|
56506
|
+
// src/lib/persona-init.ts
|
|
56697
56507
|
const PERSONA_INIT_AGENT_MODEL = "nemotron-3-ultra-550b-a55b";
|
|
56698
56508
|
const PERSONA_INIT_DEMO_SYSTEM_PROMPT = `
|
|
56699
56509
|
# Persona Playground Agent
|
|
@@ -56849,8 +56659,7 @@ async function runPersonaInit(options) {
|
|
|
56849
56659
|
...demoResources ? { demo: demoResources } : {}
|
|
56850
56660
|
};
|
|
56851
56661
|
}
|
|
56852
|
-
|
|
56853
|
-
//#region src/lib/persona-demo.ts
|
|
56662
|
+
// src/lib/persona-demo.ts
|
|
56854
56663
|
const PERSONA_DEMO_DEFAULT_DIR = "persona-demo";
|
|
56855
56664
|
const PERSONA_DEMO_DEFAULT_PORT = 43110;
|
|
56856
56665
|
const PERSONA_DEMO_TOOL_NAMES = ["get_playground_state", "update_playground"];
|
|
@@ -57534,8 +57343,7 @@ Then open ${input.localUrl}.
|
|
|
57534
57343
|
- Allowed origins: ${input.allowedOrigins.join(", ")}
|
|
57535
57344
|
`;
|
|
57536
57345
|
}
|
|
57537
|
-
|
|
57538
|
-
//#region src/commands/persona.ts
|
|
57346
|
+
// src/commands/persona.ts
|
|
57539
57347
|
const FORMAT_CYCLE = [
|
|
57540
57348
|
"script-installer",
|
|
57541
57349
|
"react",
|
|
@@ -57998,8 +57806,7 @@ personaCommand.command("init").description("Create agent + client token and outp
|
|
|
57998
57806
|
await demoServer?.close().catch(() => {});
|
|
57999
57807
|
}
|
|
58000
57808
|
});
|
|
58001
|
-
|
|
58002
|
-
//#region src/commands/analytics.ts
|
|
57809
|
+
// src/commands/analytics.ts
|
|
58003
57810
|
const analyticsCommand = new Command("analytics").description("View analytics and execution results");
|
|
58004
57811
|
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) => {
|
|
58005
57812
|
const apiKey = await ensureAuth();
|
|
@@ -58155,8 +57962,7 @@ analyticsCommand.command("results").description("List execution results").option
|
|
|
58155
57962
|
const { waitUntilExit } = render(React.createElement(App));
|
|
58156
57963
|
await waitUntilExit();
|
|
58157
57964
|
});
|
|
58158
|
-
|
|
58159
|
-
//#region src/commands/billing.ts
|
|
57965
|
+
// src/commands/billing.ts
|
|
58160
57966
|
/**
|
|
58161
57967
|
* Render the execution count from `GET /v1/billing/status`.
|
|
58162
57968
|
* No plan bounds an account by execution count, so this is a plain number, never a fraction.
|
|
@@ -58400,8 +58206,7 @@ billingCommand.command("refresh").description("Refresh plan data from billing pr
|
|
|
58400
58206
|
const { waitUntilExit } = render(React.createElement(App));
|
|
58401
58207
|
await waitUntilExit();
|
|
58402
58208
|
});
|
|
58403
|
-
|
|
58404
|
-
//#region src/commands/flow-versions.ts
|
|
58209
|
+
// src/commands/flow-versions.ts
|
|
58405
58210
|
const flowVersionsCommand = new Command("flow-versions").description("Manage flow versions");
|
|
58406
58211
|
flowVersionsCommand.command("list <flowId>").description("List all versions for a flow").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (flowId, options) => {
|
|
58407
58212
|
const apiKey = await ensureAuth();
|
|
@@ -58704,8 +58509,7 @@ flowVersionsCommand.command("publish <flowId>").description("Publish a version")
|
|
|
58704
58509
|
const { waitUntilExit } = render(React.createElement(App));
|
|
58705
58510
|
await waitUntilExit();
|
|
58706
58511
|
});
|
|
58707
|
-
|
|
58708
|
-
//#region src/commands/agent-versions.ts
|
|
58512
|
+
// src/commands/agent-versions.ts
|
|
58709
58513
|
const agentVersionsCommand = new Command("agent-versions").description("Manage agent versions");
|
|
58710
58514
|
agentVersionsCommand.command("list <agentId>").description("List all versions for an agent").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (agentId, options) => {
|
|
58711
58515
|
const apiKey = await ensureAuth();
|
|
@@ -59017,8 +58821,7 @@ agentVersionsCommand.command("publish <agentId>").description("Publish a version
|
|
|
59017
58821
|
const { waitUntilExit } = render(React.createElement(App));
|
|
59018
58822
|
await waitUntilExit();
|
|
59019
58823
|
});
|
|
59020
|
-
|
|
59021
|
-
//#region src/commands/tail.ts
|
|
58824
|
+
// src/commands/tail.ts
|
|
59022
58825
|
/** Show TypeID prefix + first 4 chars of suffix for compact display. */
|
|
59023
58826
|
function abbreviateId(id) {
|
|
59024
58827
|
const underscoreIdx = id.lastIndexOf("_");
|
|
@@ -59206,8 +59009,7 @@ async function runTail$1(options) {
|
|
|
59206
59009
|
const tailCommand = new Command("tail").description("Stream live execution logs from the Runtype API").option("--flow <id>", "Filter by flow ID").option("--agent <id>", "Filter by agent ID").option("--surface <id>", "Filter by surface ID").option("--execution <id>", "Filter by execution ID").option("--level <level>", "Filter by level (debug/info/warn/error)").option("--category <category>", "Filter by category (execution/agent/tool/model/system/error)").option("--json", "Output raw JSON (one object per line)").option("--no-color", "Disable color output").action(async (options) => {
|
|
59207
59010
|
await runTail$1(options);
|
|
59208
59011
|
});
|
|
59209
|
-
|
|
59210
|
-
//#region src/commands/events.ts
|
|
59012
|
+
// src/commands/events.ts
|
|
59211
59013
|
const LONG_POLL_WAIT_MS = PRODUCT_EVENT_MAX_WAIT_MS;
|
|
59212
59014
|
const BASE_DELAY_MS = 1e3;
|
|
59213
59015
|
const MAX_DELAY_MS = 3e4;
|
|
@@ -59428,8 +59230,7 @@ eventsCommand.command("types").description("List the product event types you can
|
|
|
59428
59230
|
eventsCommand.command("watch").description("Long-poll product events and print one line per event").option("--name <name>", "Event type to watch (default: every type; see `runtype events types`)").option("--agent <id>", "Filter by agent ID").option("--flow <id>", "Filter by flow ID").option("--product <id>", "Filter by product ID").option("--surface <id>", "Filter by surface ID").option("--schedule <id>", "Filter by schedule ID").option("--suite <id>", "Filter by eval suite ID").option("--simulation <id>", "Filter by simulation ID").option("--task <id>", "Filter by delegated task ID").option("--key <key>", "Signal events: only this signal key, such as tool_error").option("--only-regressions", "Eval runs: only those whose pass rate dropped").option("--since <cursor>", "Start after this cursor, or \"now\" (default)").option("--json", "Output NDJSON: one event object per line on stdout").option("--once", "Exit after the first poll that returns events").option("--no-color", "Disable color output").action(async (options) => {
|
|
59429
59231
|
await runWatch(options);
|
|
59430
59232
|
});
|
|
59431
|
-
|
|
59432
|
-
//#region src/commands/validate-product.ts
|
|
59233
|
+
// src/commands/validate-product.ts
|
|
59433
59234
|
function createValidateProductCommand() {
|
|
59434
59235
|
return new Command("validate-product").description("Validate a product (FPO) or FPO template locally (no API call)").argument("[input]", "Path to JSON file, raw JSON string (starts with \"{\"), or \"-\" for stdin").option("--template", "Force FPO template validation").option("--fpo", "Force FPO (non-template) validation").addOption(new Option("--json", "Output the full validation result as JSON").default(void 0)).option("-q, --quiet", "Suppress output; rely on exit code only").addHelpText("after", `\nExamples:\n $ runtype validate-product ./my-product.json\n $ runtype validate-product '{"version":"1.0",...}'\n $ cat template.json | runtype validate-product -\n $ runtype validate-product ./tpl.json --template --json\n\nExit codes:\n 0 Valid (no errors)\n 1 Invalid (errors present) or input/IO failure\n`).action(runValidateAction);
|
|
59435
59236
|
}
|
|
@@ -59548,8 +59349,7 @@ function printIssues(title, issues, color) {
|
|
|
59548
59349
|
if (issue.suggestedFix) console.log(` ${chalk.gray("fix:")} ${issue.suggestedFix}`);
|
|
59549
59350
|
}
|
|
59550
59351
|
}
|
|
59551
|
-
|
|
59552
|
-
//#region src/lib/skills-install.ts
|
|
59352
|
+
// src/lib/skills-install.ts
|
|
59553
59353
|
/**
|
|
59554
59354
|
* Detects AI coding agents on the machine and installs Runtype's agent skills into their global skills directories.
|
|
59555
59355
|
* The heavy lifting is delegated to `rosie-skills`; this is the thin Runtype orchestration layer, mirroring wrangler's equivalent.
|
|
@@ -59758,8 +59558,7 @@ async function maybeOfferSkillsInstall() {
|
|
|
59758
59558
|
await runSkillsInstall(agents, { accepted: true });
|
|
59759
59559
|
} catch {}
|
|
59760
59560
|
}
|
|
59761
|
-
|
|
59762
|
-
//#region src/commands/skills.ts
|
|
59561
|
+
// src/commands/skills.ts
|
|
59763
59562
|
const skillsCommand = new Command("skills").description("Install Runtype agent skills into your AI coding agents (Claude Code, Cursor, Codex, …)");
|
|
59764
59563
|
skillsCommand.command("list").description("List AI coding agents detected on this machine").option("--json", "Structured JSON output").action(async (options, cmd) => {
|
|
59765
59564
|
const globals = cmd.optsWithGlobals();
|
|
@@ -59854,8 +59653,7 @@ skillsCommand.command("install").description(`Install Runtype skills (${SKILLS_R
|
|
|
59854
59653
|
}
|
|
59855
59654
|
if (hadFailure) process.exit(1);
|
|
59856
59655
|
});
|
|
59857
|
-
|
|
59858
|
-
//#region src/lib/mcp-install.ts
|
|
59656
|
+
// src/lib/mcp-install.ts
|
|
59859
59657
|
const RUNTYPE_MCP_NAME = "runtype";
|
|
59860
59658
|
const RUNTYPE_MCP_URL = "https://api.runtype.com/v1/mcp/protocol";
|
|
59861
59659
|
const SUPPORTED_MCP_AGENTS = [
|
|
@@ -60387,8 +60185,7 @@ async function selectAgent(options, tty) {
|
|
|
60387
60185
|
description: "user-level MCP configuration"
|
|
60388
60186
|
})), { promptLabel: "Agent" });
|
|
60389
60187
|
}
|
|
60390
|
-
|
|
60391
|
-
//#region src/commands/install-mcp.ts
|
|
60188
|
+
// src/commands/install-mcp.ts
|
|
60392
60189
|
async function installSkillsForAgent(agent, jsonMode) {
|
|
60393
60190
|
const rosieId = getMcpSkillsAgentId(agent);
|
|
60394
60191
|
try {
|
|
@@ -60508,8 +60305,7 @@ const installMcpCommand = new Command("install-mcp").description("Install Runtyp
|
|
|
60508
60305
|
}
|
|
60509
60306
|
if (partial) process.exitCode = 1;
|
|
60510
60307
|
});
|
|
60511
|
-
|
|
60512
|
-
//#region ../shared/dist/agent-onboarding-content.mjs
|
|
60308
|
+
// ../shared/dist/agent-onboarding-content.mjs
|
|
60513
60309
|
const AGENT_ONBOARDING_MARKDOWN = `# Runtype for Coding Agents
|
|
60514
60310
|
|
|
60515
60311
|
Use this guide when the user asks to connect their coding harness to Runtype. If they only ask what Runtype does, explain it without installing software or creating an account. During setup, use the CLI until the hosted MCP tools are available.
|
|
@@ -60639,8 +60435,7 @@ Docs: [docs.runtype.com](https://docs.runtype.com)
|
|
|
60639
60435
|
Dashboard: [use.runtype.com](https://use.runtype.com)
|
|
60640
60436
|
API: [api.runtype.com](https://api.runtype.com)
|
|
60641
60437
|
`;
|
|
60642
|
-
|
|
60643
|
-
//#region src/commands/onboard.ts
|
|
60438
|
+
// src/commands/onboard.ts
|
|
60644
60439
|
const AUTH_LOGIN_INSTRUCTION = "Sign in to Runtype first. New account: `runtype auth register --email <email>` then `runtype auth verify <code>`. Existing account: `runtype auth login --api-key <key>` (or set RUNTYPE_API_KEY). Then re-run `runtype onboard`.";
|
|
60645
60440
|
const AFTER_RESTART_STEPS = [
|
|
60646
60441
|
"Use the Runtype MCP server first for all Runtype work.",
|
|
@@ -60857,8 +60652,7 @@ function createOnboardCommand(overrides = {}) {
|
|
|
60857
60652
|
});
|
|
60858
60653
|
}
|
|
60859
60654
|
const onboardCommand = createOnboardCommand();
|
|
60860
|
-
|
|
60861
|
-
//#region src/commands/apps.ts
|
|
60655
|
+
// src/commands/apps.ts
|
|
60862
60656
|
const appsCommand = new Command("apps").description("Manage Runtype Apps (hosted AI apps on *.runtype.run)");
|
|
60863
60657
|
const MANIFEST_FILENAME = "runtype.app.json";
|
|
60864
60658
|
/** Walk a directory into a zippable map of relative paths, skipping dotfiles. */
|
|
@@ -61065,8 +60859,7 @@ appsCommand.command("delete <appId>").description("Permanently delete an app, it
|
|
|
61065
60859
|
fail$1(`Delete failed: ${error instanceof Error ? error.message : String(error)}`, jsonMode, "DELETE_FAILED", error);
|
|
61066
60860
|
}
|
|
61067
60861
|
});
|
|
61068
|
-
|
|
61069
|
-
//#region src/lib/update-check.ts
|
|
60862
|
+
// src/lib/update-check.ts
|
|
61070
60863
|
const UPDATE_CHECK_INTERVAL_MS = 36e5;
|
|
61071
60864
|
const UPDATE_NOTIFY_INTERVAL_MS = 864e5;
|
|
61072
60865
|
const UPDATE_CHECK_TIMEOUT_MS = 1500;
|
|
@@ -61178,8 +60971,7 @@ function maybeNotifyAboutCliUpdate(args, options = {}) {
|
|
|
61178
60971
|
});
|
|
61179
60972
|
refreshCliUpdateMetadata(options);
|
|
61180
60973
|
}
|
|
61181
|
-
|
|
61182
|
-
//#region src/lib/auto-update.ts
|
|
60974
|
+
// src/lib/auto-update.ts
|
|
61183
60975
|
const INTERNAL_AUTO_UPDATE_ARG = "__runtype_internal_auto_update";
|
|
61184
60976
|
const AUTO_UPDATE_WORKER_ENV = "RUNTYPE_CLI_AUTO_UPDATE_WORKER";
|
|
61185
60977
|
const MANAGED_CLI_ENV = "RUNTYPE_CLI_MANAGED_RUN";
|
|
@@ -61656,8 +61448,7 @@ function rollbackManagedCli(homeDir = getRuntypeHomeDir()) {
|
|
|
61656
61448
|
to: to ?? void 0
|
|
61657
61449
|
};
|
|
61658
61450
|
}
|
|
61659
|
-
|
|
61660
|
-
//#region src/commands/update.ts
|
|
61451
|
+
// src/commands/update.ts
|
|
61661
61452
|
const updateCommand = new Command("update").description("Check for, install, or roll back CLI updates").option("--check", "Check for an update without installing it").option("--rollback", "Roll back the most recent managed update").action(async (options) => {
|
|
61662
61453
|
if (options.check && options.rollback) {
|
|
61663
61454
|
console.error(chalk.red("Use either --check or --rollback, not both"));
|
|
@@ -61706,8 +61497,7 @@ const updateCommand = new Command("update").description("Check for, install, or
|
|
|
61706
61497
|
process.exitCode = 1;
|
|
61707
61498
|
}
|
|
61708
61499
|
});
|
|
61709
|
-
|
|
61710
|
-
//#region src/lib/mcp-client.ts
|
|
61500
|
+
// src/lib/mcp-client.ts
|
|
61711
61501
|
const CONNECT_TIMEOUT_MS = 1e4;
|
|
61712
61502
|
function parseHttpUrl(raw, label) {
|
|
61713
61503
|
let url;
|
|
@@ -61811,8 +61601,7 @@ async function listAllMcpTools(client) {
|
|
|
61811
61601
|
} while (cursor !== void 0);
|
|
61812
61602
|
return tools;
|
|
61813
61603
|
}
|
|
61814
|
-
|
|
61815
|
-
//#region src/lib/mcp-input.ts
|
|
61604
|
+
// src/lib/mcp-input.ts
|
|
61816
61605
|
/** Whether resolving these arguments will consume the process stdin stream. */
|
|
61817
61606
|
function usesMcpStdin(options) {
|
|
61818
61607
|
if (options.input === "-") return true;
|
|
@@ -61894,8 +61683,7 @@ async function resolveMcpArguments(options, dependencies = {}) {
|
|
|
61894
61683
|
}
|
|
61895
61684
|
return result;
|
|
61896
61685
|
}
|
|
61897
|
-
|
|
61898
|
-
//#region src/commands/mcp.ts
|
|
61686
|
+
// src/commands/mcp.ts
|
|
61899
61687
|
const defaultDependencies$1 = {
|
|
61900
61688
|
ensureAuth,
|
|
61901
61689
|
connect: connectMcpClient,
|
|
@@ -62051,8 +61839,7 @@ function createMcpCommand(overrides = {}) {
|
|
|
62051
61839
|
return command;
|
|
62052
61840
|
}
|
|
62053
61841
|
const mcpCommand = createMcpCommand();
|
|
62054
|
-
|
|
62055
|
-
//#region src/lib/device-provider.ts
|
|
61842
|
+
// src/lib/device-provider.ts
|
|
62056
61843
|
var DeviceProviderError = class extends Error {
|
|
62057
61844
|
code;
|
|
62058
61845
|
retryable;
|
|
@@ -62087,8 +61874,7 @@ function base64UrlToBytes(value) {
|
|
|
62087
61874
|
return null;
|
|
62088
61875
|
}
|
|
62089
61876
|
}
|
|
62090
|
-
|
|
62091
|
-
//#region ../device-bridge/src/device-identity.ts
|
|
61877
|
+
// ../device-bridge/src/device-identity.ts
|
|
62092
61878
|
const encoder$1 = new TextEncoder();
|
|
62093
61879
|
function toArrayBuffer(bytes) {
|
|
62094
61880
|
const copy = new Uint8Array(bytes.byteLength);
|
|
@@ -62314,8 +62100,7 @@ function deviceError(code, message, retryable, details) {
|
|
|
62314
62100
|
details
|
|
62315
62101
|
});
|
|
62316
62102
|
}
|
|
62317
|
-
|
|
62318
|
-
//#region ../device-bridge/src/localhost-http.ts
|
|
62103
|
+
// ../device-bridge/src/localhost-http.ts
|
|
62319
62104
|
const LOCALHOST_HTTP_TOOL_NAME = "localhost_http_call";
|
|
62320
62105
|
const LOCALHOST_HTTP_MAX_BODY_BYTES = DEVICE_MAX_FRAME_BYTES;
|
|
62321
62106
|
const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
|
|
@@ -62460,8 +62245,7 @@ async function executeLocalhostHttpCall(args, fetchImpl = fetch, signal) {
|
|
|
62460
62245
|
body
|
|
62461
62246
|
});
|
|
62462
62247
|
}
|
|
62463
|
-
|
|
62464
|
-
//#region src/lib/device-listen-identity.ts
|
|
62248
|
+
// src/lib/device-listen-identity.ts
|
|
62465
62249
|
const DEVICE_LISTEN_CONFIG = "device-listen";
|
|
62466
62250
|
function isRecord$2(value) {
|
|
62467
62251
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -62812,8 +62596,7 @@ function startDeviceListenSession(options) {
|
|
|
62812
62596
|
}
|
|
62813
62597
|
};
|
|
62814
62598
|
}
|
|
62815
|
-
|
|
62816
|
-
//#region src/lib/device-listen.ts
|
|
62599
|
+
// src/lib/device-listen.ts
|
|
62817
62600
|
const DEVICE_LISTEN_RECONNECT_DELAYS_MS = [
|
|
62818
62601
|
250,
|
|
62819
62602
|
500,
|
|
@@ -63038,8 +62821,7 @@ async function runDeviceListen(options) {
|
|
|
63038
62821
|
uninstall();
|
|
63039
62822
|
}
|
|
63040
62823
|
}
|
|
63041
|
-
|
|
63042
|
-
//#region src/lib/macos-device-provider.ts
|
|
62824
|
+
// src/lib/macos-device-provider.ts
|
|
63043
62825
|
const MAX_SIDECAR_OUTPUT_BYTES = 1048576;
|
|
63044
62826
|
const MAX_HELPER_BYTES = 104857600;
|
|
63045
62827
|
const DEFAULT_SIDECAR_TIMEOUT_MS = 3e4;
|
|
@@ -63291,8 +63073,7 @@ var MacOSDeviceProvider = class {
|
|
|
63291
63073
|
return response.result;
|
|
63292
63074
|
}
|
|
63293
63075
|
};
|
|
63294
|
-
|
|
63295
|
-
//#region src/commands/devices.ts
|
|
63076
|
+
// src/commands/devices.ts
|
|
63296
63077
|
const defaultDependencies = {
|
|
63297
63078
|
ensureAuth,
|
|
63298
63079
|
createClient: (apiKey) => createCliClient(apiKey),
|
|
@@ -63817,8 +63598,7 @@ object({
|
|
|
63817
63598
|
reason: string().nullable().optional(),
|
|
63818
63599
|
revealed: array(string()).optional()
|
|
63819
63600
|
});
|
|
63820
|
-
|
|
63821
|
-
//#region ../shared/dist/chunk-C_UG0PQc.mjs
|
|
63601
|
+
// ../shared/dist/chunk-BOnokEtt.mjs
|
|
63822
63602
|
/** Every change kind a scrub report can name; a leaf so the data-source contracts reach it without the scrubber. */
|
|
63823
63603
|
const METADATA_SCRUB_CHANGE_KIND_NAMES = [
|
|
63824
63604
|
"url_redirected",
|
|
@@ -63872,8 +63652,7 @@ const productKindSchema = _enum([
|
|
|
63872
63652
|
"external",
|
|
63873
63653
|
"spec_only"
|
|
63874
63654
|
]);
|
|
63875
|
-
|
|
63876
|
-
//#region ../shared/dist/chunk-CTgbBN2x.mjs
|
|
63655
|
+
// ../shared/dist/chunk-B1-br4C3.mjs
|
|
63877
63656
|
/** The manifest file at the root of a candidate's source bundle. */
|
|
63878
63657
|
const CANDIDATE_MANIFEST_FILENAME = "runtype-candidate.json";
|
|
63879
63658
|
const candidateRuntimeSchema = _enum([
|
|
@@ -65201,6 +64980,8 @@ const toolCallFactsSchema = object({
|
|
|
65201
64980
|
designedBy: _enum(FUTURE_STATE_OPS).optional(),
|
|
65202
64981
|
/** The synthesizer's answer failed its contract twice, so the call was answered with a stub (D5). */
|
|
65203
64982
|
synthesisFailed: boolean().optional(),
|
|
64983
|
+
/** A recorded read answer that shows the values of the episode's own earlier accepted recorded writes (D3). */
|
|
64984
|
+
writeOverlay: boolean().optional(),
|
|
65204
64985
|
/** No rung could answer the call under its policy, so it got a stub; a policy stub of a write never sets it. */
|
|
65205
64986
|
unanswered: boolean().optional(),
|
|
65206
64987
|
/** Why the synthesizer answered as it did, on a synthesized call; the review panel and the judge citation read it. */
|
|
@@ -65485,6 +65266,8 @@ const reportVariantSummarySchema = object({
|
|
|
65485
65266
|
clientLimitEpisodes: number$1().int().optional(),
|
|
65486
65267
|
/** Episodes that ended `recording_miss`: a `recorded` policy met a call with no recording. Unscored. */
|
|
65487
65268
|
recordingMissEpisodes: number$1().int().nonnegative().optional(),
|
|
65269
|
+
/** Recorded read answers the read-your-writes overlay patched (`ToolCallFacts.writeOverlay`); absent when none. */
|
|
65270
|
+
writeOverlayAnswers: number$1().int().nonnegative().optional(),
|
|
65488
65271
|
/** Episodes that ended `agent_error` on a client-model provider stall (`metrics.clientModelStall`). Unscored. */
|
|
65489
65272
|
clientModelStallEpisodes: number$1().int().nonnegative().optional(),
|
|
65490
65273
|
scoringFailedEpisodes: number$1().int().optional(),
|
|
@@ -65849,7 +65632,7 @@ const comparisonQualitySchema = object({
|
|
|
65849
65632
|
unscoredEpisodes: number$1().int().nonnegative(),
|
|
65850
65633
|
/**
|
|
65851
65634
|
* Episodes that ended `recording_miss`. Each leaves the paired comparison with its partner; past
|
|
65852
|
-
* `RECORDING_MISS_SHARE_CAP` of finished episodes or of
|
|
65635
|
+
* `RECORDING_MISS_SHARE_CAP` of finished episodes or of an overlay's pooled pairs (misses and client-model stalls
|
|
65853
65636
|
* together), or with a comparison left without pairs, the reason is `recording_coverage`. Absent when none missed.
|
|
65854
65637
|
*/
|
|
65855
65638
|
recordingMissEpisodes: number$1().int().nonnegative().optional(),
|
|
@@ -66785,8 +66568,7 @@ simulationSyntheticDatasetResponseSchema.extend({
|
|
|
66785
66568
|
}).nullable()
|
|
66786
66569
|
});
|
|
66787
66570
|
object({ deleted: literal(true) });
|
|
66788
|
-
|
|
66789
|
-
//#region src/lib/candidate-bundle.ts
|
|
66571
|
+
// src/lib/candidate-bundle.ts
|
|
66790
66572
|
/** The largest compressed bundle the API accepts (`POST /v1/simulations/candidate-bundles`). */
|
|
66791
66573
|
const CANDIDATE_BUNDLE_MAX_BYTES = 262144e3;
|
|
66792
66574
|
/** The API refuses a manifest larger than this. */
|
|
@@ -67235,8 +67017,7 @@ function registerToolMemoryCommands(simulations) {
|
|
|
67235
67017
|
}
|
|
67236
67018
|
});
|
|
67237
67019
|
}
|
|
67238
|
-
|
|
67239
|
-
//#region src/commands/simulations.ts
|
|
67020
|
+
// src/commands/simulations.ts
|
|
67240
67021
|
const ACTION_SCOPE = {
|
|
67241
67022
|
upload: "SIMULATIONS:WRITE",
|
|
67242
67023
|
"read-target": "SIMULATIONS:READ",
|
|
@@ -67451,8 +67232,7 @@ simulationsCommand.command("candidate").description("Sandbox candidates: an agen
|
|
|
67451
67232
|
}
|
|
67452
67233
|
if (!passed) process.exit(1);
|
|
67453
67234
|
});
|
|
67454
|
-
|
|
67455
|
-
//#region src/lib/global-option-forwarding.ts
|
|
67235
|
+
// src/lib/global-option-forwarding.ts
|
|
67456
67236
|
const DESTRUCTIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
67457
67237
|
"delete",
|
|
67458
67238
|
"bulk-delete",
|
|
@@ -67502,8 +67282,7 @@ function registerGlobalOptionForwarding(program) {
|
|
|
67502
67282
|
if (invocation.expectApiUrl !== void 0) assertExpectedApiUrl((await loadEffectiveContext(invocation.apiUrl)).apiUrl);
|
|
67503
67283
|
});
|
|
67504
67284
|
}
|
|
67505
|
-
|
|
67506
|
-
//#region src/index.ts
|
|
67285
|
+
// src/index.ts
|
|
67507
67286
|
loadEnv();
|
|
67508
67287
|
const program = new Command();
|
|
67509
67288
|
program.name("runtype").description("CLI for Runtype AI Platform").version(getCliVersion()).option("-v, --verbose", "Enable verbose output").option("--api-url <url>", "API URL (flag > env > project link > saved config > credential endpoint > default)").option("--org <id>", "Use the stored login for this organization (overrides RUNTYPE_ORG and .runtype/project.json)").option("--expect-api-url <url>", "Refuse actions unless the effective API URL matches").option("--expect-org <id>", "Require authenticated organization ID before API actions").option("--no-input", "Disable prompts; destructive delete/revoke/reset requires --yes").option("-y, --yes", "Explicitly consent to destructive commands in --no-input mode").option("--json", "Output as JSON").action(() => program.outputHelp());
|
|
@@ -67628,6 +67407,5 @@ async function handleNoCommand() {
|
|
|
67628
67407
|
else throw error;
|
|
67629
67408
|
}
|
|
67630
67409
|
}
|
|
67631
|
-
//#endregion
|
|
67632
67410
|
export {};
|
|
67633
67411
|
|