codexuse-cli 3.7.5 → 3.7.6
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 +3 -1
- package/dist/index.js.map +1 -1
- package/dist/server/{NodeSqliteClient-BPNNnMBz.mjs → NodeSqliteClient-8mlwim6r.mjs} +3 -3
- package/dist/server/{SqlClient-B-Bb00hw.mjs → SqlClient-8hJa5MAm.mjs} +2 -1
- package/dist/server/{SqlError-3S4KD3xN.mjs → SqlError-4YSIrGT4.mjs} +2 -2
- package/dist/server/{SqliteClient-9lnXlJby.mjs → SqliteClient-DkbUL5wr.mjs} +3 -3
- package/dist/server/index.mjs +436 -363
- package/package.json +1 -1
package/dist/server/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import { $ as is, $a as fromInputUnsafe, $i as succeed$1, $n as cached, $o as structure, $r as serviceOption, $t as splitLines, A as Record, Aa as scope, Ai as mergeAll, An as makeUnsafe$1, Ao as isNone, Ar as logError$1, At as make$21, B as Void, Ba as void_$2, Bi as provide$2, Bn as InvalidValue$1, Bo as PipeInspectableProto, Br as orElseSucceed, Bt as fromIterable$1, C as Literal, Ca as forkDetach, Ci as Class, Cn as shutdown, Co as isFailure$1, Cr as gen, Ct as Path$1, D as Null, Da as ignore$1, Di as effectDiscard, Dn as unbounded$1, Do as getOrElse, Dr as isEffect, Dt as FileTypeId, E as NonEmptyString, Ea as gen$1, Ei as effect, En as publish, Eo as fromNullishOr, Er as interrupt, Et as FileSystem, F as Trim, Fa as succeedNone, Fi as unwrap$1, Fn as nominal, Fo as some, Fr as matchCauseEffect, Ft as empty$4, G as decodeTo, Ga as Reference, Gi as isDone, Gn as acquireUseRelease, Go as BaseProto, Gr as result, Gt as make$30, H as declare, Ha as CurrentLogSpans, Hi as doneUnsafe, Hn as make$31, Ho as exitSucceed, Hr as provide, Ht as fromQueue, I as Tuple, Ia as suspend$1, Ii as Scope, In as transform$1, Io as Number$2, Ir as matchEffect, It as fail$5, J as decodeUnknownSync, Ja as empty$5, Ji as succeed$5, Jn as andThen, Jo as format$1, Jr as runPromiseWith, Jt as onExit$1, K as decodeUnknownEffect, Ka as Service, Ki as make$27, Kn as addFinalizer$1, Ko as Class$1, Kr as runFork, Kt as merge$1, L as URLFromString, La as sync$1, Li as addFinalizer, Ln as transformOrFail, Lo as make$26, Lr as never, Lt as flatMap$2, M as Struct, Ma as servicesWith, Mi as provideMerge, Mn as BadArgument, Mo as map$4, Mr as logWarning$1, Mt as concat, N as TaggedErrorClass, Na as sleep$1, Ni as succeed$2, Nn as badArgument, No as match, Nr as map$2, Nt as decodeText, O as NullOr, Oa as loggerMake, On as make$20, Oo as getOrNull, Or as log$1, Ot as Size, P as TemplateLiteral, Pa as succeed$3, Pi as sync$2, Pn as systemError, Po as none, Pr as mapError, Q as fromJsonString, Qa as merge$2, Qi as isSuccess, Qn as asVoid, Qo as array, Qr as service, Qt as runForEach, R as Union, Ra as uninterruptibleMask, Ri as close, Rn as parseJson, Ro as make$32, Rr as onInterrupt, Rt as fromChannel$1, S as Int, Sa as forever$1, Si as clamp, Sn as offerUnsafe, So as failVoid, Sr as forkScoped, St as omit, T as NonEmptyArray, Ta as formatLogSpan, Ti as TaggedError, Tn as unbounded, To as filter$1, Tr as ignoreCause, Tt as FileDescriptor, U as decodeEffect, Ua as MinimumLogLevel, Ui as fail$4, Un as encodeBase64Url, Uo as isEffect$1, Ur as provideService, Ut as fromReadableStream, V as brand, Va as CurrentLogAnnotations, Vi as _await, Vn as makeFormatterDefault, Vo as YieldableProto, Vr as promise, Vt as fromPubSub, W as decodeExit, Wa as DisablePropagation, Wi as failCause$1, Wn as acquireRelease, Wo as withFiber, Wr as provideServices, Wt as isStream, X as encodeEffect, Xi as hasInterrupts$1, Xn as as, Xo as symbolRedactable, Xt as runCollect, Y as encode, Ya as get$4, Yi as fail, Yn as annotateLogs, Yo as redact$1, Yr as runSync, Yt as run$2, Z as encodeUnknownEffect, Za as make$25, Zi as isFailure, Zn as asSome$1, Zo as symbol, Zr as scoped, Zt as runFold, _ as url, _a as causePretty, _i as withFiber$1, _n as endUnsafe, _o as makeEquivalence, _r as forEach, _t as toJsonSchemaDocument, aa as fail$2, ai as sync, an as make$22, ao as toMillis, ar as catchTags, as as isUndefined, at as isMaxProperties, b as Defect, ba as flatMap$1, bi as zipWith, bn as offer$1, bo as makeEquivalence$2, br as forkDetach$1, bt as withDecodingDefault, c as FalseValues, ca as pretty, ci as timeoutOption, cn as isSink, co as filter, cr as effectify, cs as constVoid, ct as isPattern, d as boolean$3, da as ConsoleRef, di as try_, dn as make$29, do as isArray, dr as fail$1, ds as pipe, dt as makeFilter, ea as void_$3, ei as services, en as suspend$3, eo as infinity, er as callback, es as symbol$1, et as isBetween, f as map$5, fa as CurrentLoggers$1, fi as uninterruptible, fn as get$3, fo as isReadonlyArrayNonEmpty, fr as failCause, fs as pipeArguments, ft as mutable, ga as asSome, gi as void_$1, gn as size, go as sort, gr as fnUntraced, gt as toCodecStringTree, h as string$3, ha as as$1, hi as useSpan, hn as set$3, ho as of, hr as fn, ht as tag, ia as done, ii as suspend, in as get$2, io as seconds, ir as catchTag, is as isNullish, it as isMaxLength, j as String$1, ja as scopeAddFinalizerExit, ji as provide$1, jo as isSome, jr as logInfo$1, jt as callback$1, k as Number$1, ka as onExit, ki as empty$6, kn as set$4, ko as getOrUndefined, kr as logDebug, kt as WatchBackend, l as TrueValues, la as squash, li as timeoutOrElse, ln as fromTransform, lo as flatMapNullishOr, lr as ensuring, ls as dual, lt as isSchemaError, m as port, ma as andThen$1, mi as updateServices$1, mn as remove$2, mo as map$3, mr as flatMap, mt as suspend$2, n as SqlClient, na as NoSuchElementError, ni as succeed, nn as transduce, no as isZero, nr as catchDefect, ns as isNotNull, nt as isGreaterThanOrEqualTo, oa as hasInterrupts, oi as tap, on as drain, oo as zero, or as catch_, os as constFalse, ot as isMinLength, p as option, pa as addFinalizer$2, pi as uninterruptibleMask$1, pn as make$24, po as makeEquivalence$1, pr as filterOrFail, pt as optional$2, q as decodeUnknownExit, qi as makeUnsafe$2, qn as all, qo as NodeInspectSymbol, qr as runPromise, qt as mkString, ra as UnknownError, ri as succeedNone$1, rn as unwrap, ro as minutes, rr as catchFilter, rs as isNotUndefined, rt as isLessThanOrEqualTo, s as Boolean$1, sa as hasInterruptsOnly, si as tapCause, sn as fromChannel, so as ensure, sr as die, ss as constTrue, st as isNonEmpty, ta as Done, ti as servicesWith$1, tn as toReadableStreamEffect, to as isFinite$1, tr as catchCause, ts as hasProperty, tt as isGreaterThan, u as all$1, ua as ClockRef, ui as tryPromise, un as mapDone, uo as fromIterable$2, ur as exit, us as identity, ut as link$1, v as Array$1, va as defaultLogger$1, vi as withParentSpan, vn as failCauseUnsafe, vo as map$6, vr as forever, vt as toType, w as Literals, wa as formatLabel, wi as Error$1, wn as take, wo as succeed$4, wr as ignore, wt as TypeId$17, x as ErrorClass, xa as fnUntraced$1, xi as catchDone, xn as offerAll, xo as fail$3, xr as forkIn, xt as assign, y as Boolean$2, ya as fiberInterrupt, yi as withSpan, yn as make$23, yo as filterMap, yr as forkChild, yt as withConstructorDefault, z as Unknown, za as updateServices, zi as make$28, zn as stringifyJson, zo as strictEqual, zr as orDie, zt as fromEffect } from "./SqlClient-
|
|
3
|
+
import { $ as is, $a as fromInputUnsafe, $i as succeed$1, $n as cached, $o as structure, $r as serviceOption, $t as splitLines, A as Record, Aa as scope, Ai as mergeAll, An as makeUnsafe$1, Ao as isNone, Ar as logError$1, At as make$21, B as Void, Ba as void_$2, Bi as provide$2, Bn as InvalidValue$1, Bo as PipeInspectableProto, Br as orElseSucceed, Bt as fromIterable$1, C as Literal, Ca as forkDetach, Ci as Class, Cn as shutdown, Co as isFailure$1, Cr as gen, Ct as Path$1, D as Null, Da as ignore$1, Di as effectDiscard, Dn as unbounded$1, Do as getOrElse, Dr as isEffect, Dt as FileTypeId, E as NonEmptyString, Ea as gen$1, Ei as effect, En as publish, Eo as fromNullishOr, Er as interrupt, Et as FileSystem, F as Trim, Fa as succeedNone, Fi as unwrap$1, Fn as nominal, Fo as some, Fr as matchCauseEffect, Ft as empty$4, G as decodeTo, Ga as Reference, Gi as isDone, Gn as acquireUseRelease, Go as BaseProto, Gr as result, Gt as make$30, H as declare, Ha as CurrentLogSpans, Hi as doneUnsafe, Hn as make$31, Ho as exitSucceed, Hr as provide, Ht as fromQueue, I as Tuple, Ia as suspend$1, Ii as Scope, In as transform$1, Io as Number$2, Ir as matchEffect, It as fail$5, J as decodeUnknownSync, Ja as empty$5, Ji as succeed$5, Jn as andThen, Jo as format$1, Jr as runPromiseWith, Jt as onExit$1, K as decodeUnknownEffect, Ka as Service, Ki as make$27, Kn as addFinalizer$1, Ko as Class$1, Kr as runFork, Kt as merge$1, L as URLFromString, La as sync$1, Li as addFinalizer, Ln as transformOrFail, Lo as make$26, Lr as never, Lt as flatMap$2, M as Struct, Ma as servicesWith, Mi as provideMerge, Mn as BadArgument, Mo as map$4, Mr as logWarning$1, Mt as concat, N as TaggedErrorClass, Na as sleep$1, Ni as succeed$2, Nn as badArgument, No as match, Nr as map$2, Nt as decodeText, O as NullOr, Oa as loggerMake, On as make$20, Oo as getOrNull, Or as log$1, Ot as Size, P as TemplateLiteral, Pa as succeed$3, Pi as sync$2, Pn as systemError, Po as none, Pr as mapError, Q as fromJsonString, Qa as merge$2, Qi as isSuccess, Qn as asVoid, Qo as array, Qr as service, Qt as runForEach, R as Union, Ra as uninterruptibleMask, Ri as close, Rn as parseJson, Ro as make$32, Rr as onInterrupt, Rt as fromChannel$1, S as Int, Sa as forever$1, Si as clamp, Sn as offerUnsafe, So as failVoid, Sr as forkScoped, St as omit, T as NonEmptyArray, Ta as formatLogSpan, Ti as TaggedError, Tn as unbounded, To as filter$1, Tr as ignoreCause, Tt as FileDescriptor, U as decodeEffect, Ua as MinimumLogLevel, Ui as fail$4, Un as encodeBase64Url, Uo as isEffect$1, Ur as provideService, Ut as fromReadableStream, V as brand, Va as CurrentLogAnnotations, Vi as _await, Vn as makeFormatterDefault, Vo as YieldableProto, Vr as promise, Vt as fromPubSub, W as decodeExit, Wa as DisablePropagation, Wi as failCause$1, Wn as acquireRelease, Wo as withFiber, Wr as provideServices, Wt as isStream, X as encodeEffect, Xi as hasInterrupts$1, Xn as as, Xo as symbolRedactable, Xt as runCollect, Y as encode, Ya as get$4, Yi as fail, Yn as annotateLogs, Yo as redact$1, Yr as runSync, Yt as run$2, Z as encodeUnknownEffect, Za as make$25, Zi as isFailure, Zn as asSome$1, Zo as symbol, Zr as scoped, Zt as runFold, _ as url, _a as causePretty, _i as withFiber$1, _n as endUnsafe, _o as makeEquivalence, _r as forEach, _t as toJsonSchemaDocument, aa as fail$2, ai as sync, an as make$22, ao as toMillis, ar as catchTags, as as isUndefined, at as isMaxProperties, b as Defect, ba as flatMap$1, bi as zipWith, bn as offer$1, bo as makeEquivalence$2, br as forkDetach$1, bt as withDecodingDefault, c as FalseValues, ca as pretty, ci as timeoutOption, cn as isSink, co as filter, cr as effectify, cs as constVoid, ct as isPattern, d as boolean$3, da as ConsoleRef, di as try_, dn as make$29, do as isArray, dr as fail$1, ds as pipe, dt as makeFilter, ea as void_$3, ei as services, en as suspend$3, eo as infinity, er as callback, es as symbol$1, et as isBetween, f as map$5, fa as CurrentLoggers$1, fi as uninterruptible, fn as get$3, fo as isReadonlyArrayNonEmpty, fr as failCause, fs as pipeArguments, ft as mutable, ga as asSome, gi as void_$1, gn as size, go as sort, gr as fnUntraced, gt as toCodecStringTree, h as string$3, ha as as$1, hi as useSpan, hn as set$3, ho as of, hr as fn, ht as tag, ia as done, ii as suspend, in as get$2, io as seconds, ir as catchTag, is as isNullish, it as isMaxLength, j as String$1, ja as scopeAddFinalizerExit, ji as provide$1, jo as isSome, jr as logInfo$1, jt as callback$1, k as Number$1, ka as onExit, ki as empty$6, kn as set$4, ko as getOrUndefined, kr as logDebug, kt as WatchBackend, l as TrueValues, la as squash, li as timeoutOrElse, ln as fromTransform, lo as flatMapNullishOr, lr as ensuring, ls as dual, lt as isSchemaError, m as port, ma as andThen$1, mi as updateServices$1, mn as remove$2, mo as map$3, mr as flatMap, mt as suspend$2, n as SqlClient, na as NoSuchElementError, ni as succeed, nn as transduce, no as isZero, nr as catchDefect, ns as isNotNull, nt as isGreaterThanOrEqualTo, oa as hasInterrupts, oi as tap, on as drain, oo as zero, or as catch_, os as constFalse, ot as isMinLength, p as option, pa as addFinalizer$2, pi as uninterruptibleMask$1, pn as make$24, po as makeEquivalence$1, pr as filterOrFail, pt as optional$2, q as decodeUnknownExit, qi as makeUnsafe$2, qn as all, qo as NodeInspectSymbol, qr as runPromise, qt as mkString, ra as UnknownError, ri as succeedNone$1, rn as unwrap, ro as minutes, rr as catchFilter, rs as isNotUndefined, rt as isLessThanOrEqualTo, s as Boolean$1, sa as hasInterruptsOnly, si as tapCause, sn as fromChannel, so as ensure, sr as die, ss as constTrue, st as isNonEmpty, ta as Done, ti as servicesWith$1, tn as toReadableStreamEffect, to as isFinite$1, tr as catchCause, ts as hasProperty, tt as isGreaterThan, u as all$1, ua as ClockRef, ui as tryPromise, un as mapDone, uo as fromIterable$2, ur as exit, us as identity, ut as link$1, v as Array$1, va as defaultLogger$1, vi as withParentSpan, vn as failCauseUnsafe, vo as map$6, vr as forever, vt as toType, w as Literals, wa as formatLabel, wi as Error$1, wn as take, wo as succeed$4, wr as ignore, wt as TypeId$17, x as ErrorClass, xa as fnUntraced$1, xi as catchDone, xn as offerAll, xo as fail$3, xr as forkIn, xt as assign, y as Boolean$2, ya as fiberInterrupt, yi as withSpan, yn as make$23, yo as filterMap, yr as forkChild, yt as withConstructorDefault, z as Unknown, za as updateServices, zi as make$28, zn as stringifyJson, zo as strictEqual, zr as orDie, zt as fromEffect } from "./SqlClient-8hJa5MAm.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as NodeChildProcess from "node:child_process";
|
|
6
6
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -7773,6 +7773,11 @@ var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7773
7773
|
prevAnchors.add(anchor);
|
|
7774
7774
|
return anchor;
|
|
7775
7775
|
},
|
|
7776
|
+
/**
|
|
7777
|
+
* With circular references, the source node is only resolved after all
|
|
7778
|
+
* of its child nodes are. This is why anchors are set only after all of
|
|
7779
|
+
* the nodes have been created.
|
|
7780
|
+
*/
|
|
7776
7781
|
setAnchors: () => {
|
|
7777
7782
|
for (const source of aliasObjects) {
|
|
7778
7783
|
const ref = sourceObjects.get(source);
|
|
@@ -9520,6 +9525,14 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9520
9525
|
identify: (value) => value instanceof Uint8Array,
|
|
9521
9526
|
default: false,
|
|
9522
9527
|
tag: "tag:yaml.org,2002:binary",
|
|
9528
|
+
/**
|
|
9529
|
+
* Returns a Buffer in node and an Uint8Array in browsers
|
|
9530
|
+
*
|
|
9531
|
+
* To use the resulting buffer as an image, you'll want to do something like:
|
|
9532
|
+
*
|
|
9533
|
+
* const blob = new Blob([buffer], { type: 'image/jpeg' })
|
|
9534
|
+
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
9535
|
+
*/
|
|
9523
9536
|
resolve(src, onError) {
|
|
9524
9537
|
if (typeof node_buffer.Buffer === "function") return node_buffer.Buffer.from(src, "base64");
|
|
9525
9538
|
else if (typeof atob === "function") {
|
|
@@ -17076,6 +17089,10 @@ const CodexModelOptions = Struct({
|
|
|
17076
17089
|
});
|
|
17077
17090
|
const ProviderModelOptions = Struct({ codex: optional$2(CodexModelOptions) });
|
|
17078
17091
|
const MODEL_OPTIONS_BY_PROVIDER = { codex: [
|
|
17092
|
+
{
|
|
17093
|
+
slug: "gpt-5.5",
|
|
17094
|
+
name: "GPT-5.5"
|
|
17095
|
+
},
|
|
17079
17096
|
{
|
|
17080
17097
|
slug: "gpt-5.4",
|
|
17081
17098
|
name: "GPT-5.4"
|
|
@@ -17091,19 +17108,12 @@ const MODEL_OPTIONS_BY_PROVIDER = { codex: [
|
|
|
17091
17108
|
{
|
|
17092
17109
|
slug: "gpt-5.3-codex-spark",
|
|
17093
17110
|
name: "GPT-5.3 Codex Spark"
|
|
17094
|
-
},
|
|
17095
|
-
{
|
|
17096
|
-
slug: "gpt-5.2-codex",
|
|
17097
|
-
name: "GPT-5.2 Codex"
|
|
17098
|
-
},
|
|
17099
|
-
{
|
|
17100
|
-
slug: "gpt-5.2",
|
|
17101
|
-
name: "GPT-5.2"
|
|
17102
17111
|
}
|
|
17103
17112
|
] };
|
|
17104
|
-
const DEFAULT_MODEL_BY_PROVIDER = { codex: "gpt-5.
|
|
17113
|
+
const DEFAULT_MODEL_BY_PROVIDER = { codex: "gpt-5.5" };
|
|
17105
17114
|
const DEFAULT_GIT_TEXT_GENERATION_MODEL = "gpt-5.4-mini";
|
|
17106
17115
|
const MODEL_SLUG_ALIASES_BY_PROVIDER = { codex: {
|
|
17116
|
+
"5.5": "gpt-5.5",
|
|
17107
17117
|
"5.4": "gpt-5.4",
|
|
17108
17118
|
"5.3": "gpt-5.3-codex",
|
|
17109
17119
|
"gpt-5.3": "gpt-5.3-codex",
|
|
@@ -19305,6 +19315,7 @@ const WS_METHODS = {
|
|
|
19305
19315
|
agentsReadFile: "agents.readFile",
|
|
19306
19316
|
agentsSaveFile: "agents.saveFile",
|
|
19307
19317
|
codexRuntimeInspect: "codexRuntime.inspect",
|
|
19318
|
+
codexRuntimeUpdate: "codexRuntime.update",
|
|
19308
19319
|
telegramStatus: "telegram.status",
|
|
19309
19320
|
telegramTestToken: "telegram.testToken",
|
|
19310
19321
|
profilesFetch: "profiles.fetch",
|
|
@@ -19426,6 +19437,7 @@ const WebSocketRequestBody = Union([
|
|
|
19426
19437
|
args: optional$2(Union([String$1, Null])),
|
|
19427
19438
|
codexHomePath: optional$2(Union([String$1, Null]))
|
|
19428
19439
|
})),
|
|
19440
|
+
tagRequestBody(WS_METHODS.codexRuntimeUpdate, Struct({})),
|
|
19429
19441
|
tagRequestBody(WS_METHODS.telegramStatus, Struct({})),
|
|
19430
19442
|
tagRequestBody(WS_METHODS.telegramTestToken, Struct({ token: optional$2(Unknown) })),
|
|
19431
19443
|
tagRequestBody(WS_METHODS.accountPoolGetStatus, Struct({})),
|
|
@@ -20360,7 +20372,7 @@ var _018_CanonicalizeModelSelections_default = gen(function* () {
|
|
|
20360
20372
|
SET payload_json = json_set(
|
|
20361
20373
|
payload_json,
|
|
20362
20374
|
'$.modelSelection',
|
|
20363
|
-
json(json_object('provider', 'codex', 'model', 'gpt-5.
|
|
20375
|
+
json(json_object('provider', 'codex', 'model', 'gpt-5.5'))
|
|
20364
20376
|
)
|
|
20365
20377
|
WHERE event_type = 'thread.created'
|
|
20366
20378
|
AND json_type(payload_json, '$.modelSelection') IS NULL
|
|
@@ -20551,8 +20563,8 @@ const runMigrations = gen(function* () {
|
|
|
20551
20563
|
//#endregion
|
|
20552
20564
|
//#region src/persistence/Layers/Sqlite.ts
|
|
20553
20565
|
const defaultSqliteClientLoaders = {
|
|
20554
|
-
bun: () => import("./SqliteClient-
|
|
20555
|
-
node: () => import("./NodeSqliteClient-
|
|
20566
|
+
bun: () => import("./SqliteClient-DkbUL5wr.mjs"),
|
|
20567
|
+
node: () => import("./NodeSqliteClient-8mlwim6r.mjs")
|
|
20556
20568
|
};
|
|
20557
20569
|
const makeRuntimeSqliteLayer = (config) => gen(function* () {
|
|
20558
20570
|
const loader = defaultSqliteClientLoaders[process.versions.bun !== void 0 ? "bun" : "node"];
|
|
@@ -24600,10 +24612,18 @@ function normalizeSpawnError(command, args, error) {
|
|
|
24600
24612
|
if (error.code === "ENOENT") return /* @__PURE__ */ new Error(`Command not found: ${command}`);
|
|
24601
24613
|
return /* @__PURE__ */ new Error(`Failed to run ${commandLabel$1(command, args)}: ${error.message}`);
|
|
24602
24614
|
}
|
|
24615
|
+
const WINDOWS_COMMAND_NOT_FOUND_PATTERNS = [
|
|
24616
|
+
/is not recognized as an internal or external command/i,
|
|
24617
|
+
/n.o . reconhecido como um comando interno/i,
|
|
24618
|
+
/non . riconosciuto come comando interno o esterno/i,
|
|
24619
|
+
/n.est pas reconnu en tant que commande interne/i,
|
|
24620
|
+
/no se reconoce como un comando interno o externo/i,
|
|
24621
|
+
/wird nicht als interner oder externer befehl/i
|
|
24622
|
+
];
|
|
24603
24623
|
function isWindowsCommandNotFound(code, stderr) {
|
|
24604
24624
|
if (process.platform !== "win32") return false;
|
|
24605
24625
|
if (code === 9009) return true;
|
|
24606
|
-
return
|
|
24626
|
+
return WINDOWS_COMMAND_NOT_FOUND_PATTERNS.some((pattern) => pattern.test(stderr));
|
|
24607
24627
|
}
|
|
24608
24628
|
function normalizeExitError(command, args, result) {
|
|
24609
24629
|
if (isWindowsCommandNotFound(result.code, result.stderr)) return /* @__PURE__ */ new Error(`Command not found: ${command}`);
|
|
@@ -28986,7 +29006,7 @@ function createDefaultAppState() {
|
|
|
28986
29006
|
}
|
|
28987
29007
|
};
|
|
28988
29008
|
}
|
|
28989
|
-
function asString$
|
|
29009
|
+
function asString$9(value) {
|
|
28990
29010
|
if (typeof value !== "string") return null;
|
|
28991
29011
|
const trimmed = value.trim();
|
|
28992
29012
|
return trimmed.length > 0 ? trimmed : null;
|
|
@@ -29001,19 +29021,19 @@ function normalizeAppState(raw) {
|
|
|
29001
29021
|
if (!Number.isFinite(merged.autoRoll.switchThreshold)) merged.autoRoll.switchThreshold = 95;
|
|
29002
29022
|
if (merged.autoRoll.warningThreshold < 50 || merged.autoRoll.warningThreshold > 99) merged.autoRoll.warningThreshold = 85;
|
|
29003
29023
|
if (merged.autoRoll.switchThreshold <= merged.autoRoll.warningThreshold || merged.autoRoll.switchThreshold > 100) merged.autoRoll.switchThreshold = Math.min(100, Math.max(merged.autoRoll.warningThreshold + 1, 95));
|
|
29004
|
-
merged.app.lastAppVersion = asString$
|
|
29005
|
-
merged.app.pendingUpdateVersion = asString$
|
|
29006
|
-
merged.app.lastProfileName = asString$
|
|
29024
|
+
merged.app.lastAppVersion = asString$9(merged.app.lastAppVersion);
|
|
29025
|
+
merged.app.pendingUpdateVersion = asString$9(merged.app.pendingUpdateVersion);
|
|
29026
|
+
merged.app.lastProfileName = asString$9(merged.app.lastProfileName);
|
|
29007
29027
|
{
|
|
29008
29028
|
const allowedAppKeys = new Set(Object.keys(defaults.app));
|
|
29009
29029
|
for (const key of Object.keys(merged.app)) if (!allowedAppKeys.has(key)) delete merged.app[key];
|
|
29010
29030
|
}
|
|
29011
|
-
merged.license.licenseKey = asString$
|
|
29012
|
-
merged.license.purchaseEmail = asString$
|
|
29013
|
-
merged.license.lastVerifiedAt = asString$
|
|
29014
|
-
merged.license.nextCheckAt = asString$
|
|
29015
|
-
merged.license.lastVerificationError = asString$
|
|
29016
|
-
merged.license.signature = asString$
|
|
29031
|
+
merged.license.licenseKey = asString$9(merged.license.licenseKey);
|
|
29032
|
+
merged.license.purchaseEmail = asString$9(merged.license.purchaseEmail);
|
|
29033
|
+
merged.license.lastVerifiedAt = asString$9(merged.license.lastVerifiedAt);
|
|
29034
|
+
merged.license.nextCheckAt = asString$9(merged.license.nextCheckAt);
|
|
29035
|
+
merged.license.lastVerificationError = asString$9(merged.license.lastVerificationError);
|
|
29036
|
+
merged.license.signature = asString$9(merged.license.signature);
|
|
29017
29037
|
if (![
|
|
29018
29038
|
"inactive",
|
|
29019
29039
|
"active",
|
|
@@ -29039,15 +29059,15 @@ function normalizeAppState(raw) {
|
|
|
29039
29059
|
if (typeof merged.ui.layout.sidebarCollapsed !== "boolean") merged.ui.layout.sidebarCollapsed = null;
|
|
29040
29060
|
if (!isRecord$7(merged.ui.profiles)) merged.ui.profiles = clone(defaults.ui.profiles);
|
|
29041
29061
|
merged.ui.profiles.viewMode = merged.ui.profiles.viewMode === "cards" || merged.ui.profiles.viewMode === "compact" ? merged.ui.profiles.viewMode : null;
|
|
29042
|
-
merged.ui.profiles.sortBy = asString$
|
|
29043
|
-
merged.ui.profiles.groupBy = asString$
|
|
29044
|
-
merged.ui.profiles.planFilter = asString$
|
|
29045
|
-
merged.ui.profiles.healthFilter = asString$
|
|
29046
|
-
merged.ui.profiles.customGroupFilter = asString$
|
|
29062
|
+
merged.ui.profiles.sortBy = asString$9(merged.ui.profiles.sortBy);
|
|
29063
|
+
merged.ui.profiles.groupBy = asString$9(merged.ui.profiles.groupBy);
|
|
29064
|
+
merged.ui.profiles.planFilter = asString$9(merged.ui.profiles.planFilter);
|
|
29065
|
+
merged.ui.profiles.healthFilter = asString$9(merged.ui.profiles.healthFilter);
|
|
29066
|
+
merged.ui.profiles.customGroupFilter = asString$9(merged.ui.profiles.customGroupFilter);
|
|
29047
29067
|
if (typeof merged.ui.profiles.toolbarOpen !== "boolean") merged.ui.profiles.toolbarOpen = null;
|
|
29048
29068
|
if (!isRecord$7(merged.ui.profiles.collapsedSections)) merged.ui.profiles.collapsedSections = {};
|
|
29049
29069
|
else merged.ui.profiles.collapsedSections = Object.fromEntries(Object.entries(merged.ui.profiles.collapsedSections).flatMap(([key, value]) => {
|
|
29050
|
-
const normalizedKey = asString$
|
|
29070
|
+
const normalizedKey = asString$9(key);
|
|
29051
29071
|
if (!normalizedKey || typeof value !== "boolean") return [];
|
|
29052
29072
|
return [[normalizedKey, value]];
|
|
29053
29073
|
}));
|
|
@@ -29061,24 +29081,24 @@ function normalizeAppState(raw) {
|
|
|
29061
29081
|
if (!Number.isFinite(merged.ui.onboarding.sessionCount)) merged.ui.onboarding.sessionCount = 0;
|
|
29062
29082
|
if (!isRecord$7(merged.ui.onboarding.nudgeCooldowns)) merged.ui.onboarding.nudgeCooldowns = {};
|
|
29063
29083
|
else merged.ui.onboarding.nudgeCooldowns = Object.fromEntries(Object.entries(merged.ui.onboarding.nudgeCooldowns).flatMap(([key, value]) => {
|
|
29064
|
-
const normalizedKey = asString$
|
|
29084
|
+
const normalizedKey = asString$9(key);
|
|
29065
29085
|
if (!normalizedKey || !Number.isFinite(value)) return [];
|
|
29066
29086
|
return [[normalizedKey, Number(value)]];
|
|
29067
29087
|
}));
|
|
29068
29088
|
if (!isRecord$7(merged.ui.onboarding.nudgeDismissCount)) merged.ui.onboarding.nudgeDismissCount = {};
|
|
29069
29089
|
else merged.ui.onboarding.nudgeDismissCount = Object.fromEntries(Object.entries(merged.ui.onboarding.nudgeDismissCount).flatMap(([key, value]) => {
|
|
29070
|
-
const normalizedKey = asString$
|
|
29090
|
+
const normalizedKey = asString$9(key);
|
|
29071
29091
|
if (!normalizedKey || !Number.isFinite(value)) return [];
|
|
29072
29092
|
return [[normalizedKey, Number(value)]];
|
|
29073
29093
|
}));
|
|
29074
29094
|
if (typeof merged.ui.onboarding.proUnlockedCelebrated !== "boolean") merged.ui.onboarding.proUnlockedCelebrated = false;
|
|
29075
29095
|
if (!isRecord$7(merged.ui.projectThreadSelections)) merged.ui.projectThreadSelections = {};
|
|
29076
29096
|
else merged.ui.projectThreadSelections = Object.fromEntries(Object.entries(merged.ui.projectThreadSelections).flatMap(([projectId, threadId]) => {
|
|
29077
|
-
const normalizedProjectId = asString$
|
|
29097
|
+
const normalizedProjectId = asString$9(projectId);
|
|
29078
29098
|
if (!normalizedProjectId) return [];
|
|
29079
29099
|
return [[normalizedProjectId, typeof threadId === "string" && threadId.trim().length > 0 ? threadId.trim() : null]];
|
|
29080
29100
|
}));
|
|
29081
|
-
merged.ui.duplicateWarningDismissedKey = asString$
|
|
29101
|
+
merged.ui.duplicateWarningDismissedKey = asString$9(merged.ui.duplicateWarningDismissedKey);
|
|
29082
29102
|
if (typeof merged.ui.pendingLicenseActivation !== "boolean") merged.ui.pendingLicenseActivation = false;
|
|
29083
29103
|
{
|
|
29084
29104
|
const allowedUiKeys = new Set(Object.keys(defaults.ui));
|
|
@@ -29087,8 +29107,8 @@ function normalizeAppState(raw) {
|
|
|
29087
29107
|
if (!isRecord$7(merged.profileDashboard)) merged.profileDashboard = clone(defaults.profileDashboard);
|
|
29088
29108
|
if (!isRecord$7(merged.profileDashboard.customGroupsByAccountKey)) merged.profileDashboard.customGroupsByAccountKey = {};
|
|
29089
29109
|
else merged.profileDashboard.customGroupsByAccountKey = Object.fromEntries(Object.entries(merged.profileDashboard.customGroupsByAccountKey).flatMap(([key, value]) => {
|
|
29090
|
-
const normalizedKey = asString$
|
|
29091
|
-
const normalizedValue = asString$
|
|
29110
|
+
const normalizedKey = asString$9(key);
|
|
29111
|
+
const normalizedValue = asString$9(value);
|
|
29092
29112
|
if (!normalizedKey || !normalizedValue) return [];
|
|
29093
29113
|
return [[normalizedKey, normalizedValue]];
|
|
29094
29114
|
}));
|
|
@@ -29115,19 +29135,19 @@ function normalizeAppState(raw) {
|
|
|
29115
29135
|
if (!Array.isArray(merged.skills.sources)) merged.skills.sources = [];
|
|
29116
29136
|
if (!isRecord$7(merged.skills.installsBySlug)) merged.skills.installsBySlug = {};
|
|
29117
29137
|
if (!isRecord$7(merged.sync)) merged.sync = clone(defaults.sync);
|
|
29118
|
-
merged.sync.lastPushAt = asString$
|
|
29119
|
-
merged.sync.lastPullAt = asString$
|
|
29120
|
-
merged.sync.lastError = asString$
|
|
29121
|
-
merged.sync.remoteUpdatedAt = asString$
|
|
29138
|
+
merged.sync.lastPushAt = asString$9(merged.sync.lastPushAt);
|
|
29139
|
+
merged.sync.lastPullAt = asString$9(merged.sync.lastPullAt);
|
|
29140
|
+
merged.sync.lastError = asString$9(merged.sync.lastError);
|
|
29141
|
+
merged.sync.remoteUpdatedAt = asString$9(merged.sync.remoteUpdatedAt);
|
|
29122
29142
|
if (!isRecord$7(merged.analytics)) merged.analytics = isRecord$7(merged.telemetry) ? clone(merged.telemetry) : clone(defaults.analytics);
|
|
29123
|
-
merged.analytics.anonymousId = asString$
|
|
29143
|
+
merged.analytics.anonymousId = asString$9(merged.analytics.anonymousId);
|
|
29124
29144
|
if (!merged.analytics.anonymousId) {
|
|
29125
|
-
const legacyInstallId = asString$
|
|
29145
|
+
const legacyInstallId = asString$9(merged.telemetry?.installId);
|
|
29126
29146
|
merged.analytics.anonymousId = legacyInstallId;
|
|
29127
29147
|
}
|
|
29128
29148
|
if (typeof merged.analytics.enabled !== "boolean") merged.analytics.enabled = true;
|
|
29129
|
-
merged.analytics.lastFlushAt = asString$
|
|
29130
|
-
merged.analytics.lastError = asString$
|
|
29149
|
+
merged.analytics.lastFlushAt = asString$9(merged.analytics.lastFlushAt);
|
|
29150
|
+
merged.analytics.lastError = asString$9(merged.analytics.lastError);
|
|
29131
29151
|
if ("telemetry" in merged) delete merged.telemetry;
|
|
29132
29152
|
if (!isRecord$7(merged.profilesByName)) merged.profilesByName = {};
|
|
29133
29153
|
if (!isRecord$7(merged.migration)) merged.migration = clone(defaults.migration);
|
|
@@ -29136,10 +29156,10 @@ function normalizeAppState(raw) {
|
|
|
29136
29156
|
"pending_local_storage",
|
|
29137
29157
|
"complete"
|
|
29138
29158
|
].includes(merged.migration.status)) merged.migration.status = "pending";
|
|
29139
|
-
merged.migration.startedAt = asString$
|
|
29140
|
-
merged.migration.completedAt = asString$
|
|
29141
|
-
merged.migration.localStorageImportedAt = asString$
|
|
29142
|
-
merged.migration.lastError = asString$
|
|
29159
|
+
merged.migration.startedAt = asString$9(merged.migration.startedAt);
|
|
29160
|
+
merged.migration.completedAt = asString$9(merged.migration.completedAt);
|
|
29161
|
+
merged.migration.localStorageImportedAt = asString$9(merged.migration.localStorageImportedAt);
|
|
29162
|
+
merged.migration.lastError = asString$9(merged.migration.lastError);
|
|
29143
29163
|
return merged;
|
|
29144
29164
|
}
|
|
29145
29165
|
function deepMerge(base, patch) {
|
|
@@ -29336,7 +29356,7 @@ function normalizeAutoRollSettings(raw) {
|
|
|
29336
29356
|
}
|
|
29337
29357
|
//#endregion
|
|
29338
29358
|
//#region ../../packages/runtime-codex/src/codex/settings.ts
|
|
29339
|
-
function asString$
|
|
29359
|
+
function asString$8(value) {
|
|
29340
29360
|
if (typeof value !== "string") return null;
|
|
29341
29361
|
const trimmed = value.trim();
|
|
29342
29362
|
return trimmed.length > 0 ? trimmed : null;
|
|
@@ -29354,7 +29374,7 @@ function parseAutoRoll(raw) {
|
|
|
29354
29374
|
}
|
|
29355
29375
|
function parseStoredLicense(raw) {
|
|
29356
29376
|
if (!isRecord$6(raw)) return null;
|
|
29357
|
-
const statusCandidate = asString$
|
|
29377
|
+
const statusCandidate = asString$8(raw.status);
|
|
29358
29378
|
const status = [
|
|
29359
29379
|
"inactive",
|
|
29360
29380
|
"active",
|
|
@@ -29362,21 +29382,21 @@ function parseStoredLicense(raw) {
|
|
|
29362
29382
|
"error"
|
|
29363
29383
|
].includes(statusCandidate ?? "") ? statusCandidate : void 0;
|
|
29364
29384
|
const license = {
|
|
29365
|
-
licenseKey: asString$
|
|
29366
|
-
purchaseEmail: asString$
|
|
29367
|
-
lastVerifiedAt: asString$
|
|
29368
|
-
nextCheckAt: asString$
|
|
29369
|
-
lastVerificationError: asString$
|
|
29385
|
+
licenseKey: asString$8(raw.licenseKey ?? raw.license_key),
|
|
29386
|
+
purchaseEmail: asString$8(raw.purchaseEmail ?? raw.purchase_email),
|
|
29387
|
+
lastVerifiedAt: asString$8(raw.lastVerifiedAt ?? raw.last_verified_at),
|
|
29388
|
+
nextCheckAt: asString$8(raw.nextCheckAt ?? raw.next_check_at),
|
|
29389
|
+
lastVerificationError: asString$8(raw.lastVerificationError ?? raw.last_verification_error),
|
|
29370
29390
|
status,
|
|
29371
|
-
signature: asString$
|
|
29391
|
+
signature: asString$8(raw.signature)
|
|
29372
29392
|
};
|
|
29373
29393
|
return Boolean(license.licenseKey || license.purchaseEmail || license.lastVerifiedAt || license.nextCheckAt || license.lastVerificationError || license.status) ? license : null;
|
|
29374
29394
|
}
|
|
29375
29395
|
async function getLastProfileName() {
|
|
29376
|
-
return asString$
|
|
29396
|
+
return asString$8((await getAppState()).app.lastProfileName);
|
|
29377
29397
|
}
|
|
29378
29398
|
async function persistLastProfileName(profileName) {
|
|
29379
|
-
await patchAppState({ app: { lastProfileName: asString$
|
|
29399
|
+
await patchAppState({ app: { lastProfileName: asString$8(profileName) } });
|
|
29380
29400
|
}
|
|
29381
29401
|
async function getStoredLicense() {
|
|
29382
29402
|
return parseStoredLicense((await getAppState()).license);
|
|
@@ -29441,9 +29461,9 @@ async function writeCodexSettingsJsonRaw(payload) {
|
|
|
29441
29461
|
const license = parseStoredLicense(payload.license);
|
|
29442
29462
|
await patchAppState({
|
|
29443
29463
|
app: {
|
|
29444
|
-
lastProfileName: asString$
|
|
29445
|
-
lastAppVersion: asString$
|
|
29446
|
-
pendingUpdateVersion: asString$
|
|
29464
|
+
lastProfileName: asString$8(payload.lastProfileName ?? payload.last_profile_name),
|
|
29465
|
+
lastAppVersion: asString$8(payload.lastAppVersion ?? payload.last_app_version),
|
|
29466
|
+
pendingUpdateVersion: asString$8(payload.pendingUpdateVersion ?? payload.pending_update_version)
|
|
29447
29467
|
},
|
|
29448
29468
|
autoRoll: autoRoll ? {
|
|
29449
29469
|
enabled: autoRoll.enabled,
|
|
@@ -30196,6 +30216,83 @@ function buildCodexCommand$1(binaryPath, args, env) {
|
|
|
30196
30216
|
};
|
|
30197
30217
|
}
|
|
30198
30218
|
//#endregion
|
|
30219
|
+
//#region ../../packages/runtime-codex/src/codex/home.ts
|
|
30220
|
+
function resolveHomeDir$1() {
|
|
30221
|
+
return process.env.HOME || process.env.USERPROFILE || os.homedir();
|
|
30222
|
+
}
|
|
30223
|
+
function expandHomePrefix(input, homeDir) {
|
|
30224
|
+
if (input === "~") return homeDir;
|
|
30225
|
+
if (input.startsWith("~/") || input.startsWith("~\\")) return path.join(homeDir, input.slice(2));
|
|
30226
|
+
return input;
|
|
30227
|
+
}
|
|
30228
|
+
function normalizePathCandidate(value) {
|
|
30229
|
+
if (typeof value !== "string") return null;
|
|
30230
|
+
const trimmed = value.trim();
|
|
30231
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
30232
|
+
}
|
|
30233
|
+
function normalizeCodexHomePath(input) {
|
|
30234
|
+
const configured = normalizePathCandidate(input);
|
|
30235
|
+
if (!configured) return null;
|
|
30236
|
+
return path.resolve(expandHomePrefix(configured, resolveHomeDir$1()));
|
|
30237
|
+
}
|
|
30238
|
+
function resolveDefaultCodexHomeDir() {
|
|
30239
|
+
return path.join(resolveHomeDir$1(), ".codex");
|
|
30240
|
+
}
|
|
30241
|
+
function resolveProfileCodexHomeDir(profileName) {
|
|
30242
|
+
return path.join(getUserDataDir(), "profile-homes", profileName);
|
|
30243
|
+
}
|
|
30244
|
+
function resolveCodexHomeDir(options) {
|
|
30245
|
+
return normalizeCodexHomePath(options?.codexHomePath) ?? resolveDefaultCodexHomeDir();
|
|
30246
|
+
}
|
|
30247
|
+
async function resolveCodexRuntimeContext(options) {
|
|
30248
|
+
const explicit = normalizeCodexHomePath(options?.codexHomePath);
|
|
30249
|
+
if (explicit) return {
|
|
30250
|
+
codexHomePath: explicit,
|
|
30251
|
+
profileName: null,
|
|
30252
|
+
source: "explicit"
|
|
30253
|
+
};
|
|
30254
|
+
const state = await getAppState();
|
|
30255
|
+
const profileName = normalizePathCandidate(state.app.lastProfileName);
|
|
30256
|
+
if (profileName && state.profilesByName[profileName]) return {
|
|
30257
|
+
codexHomePath: resolveProfileCodexHomeDir(profileName),
|
|
30258
|
+
profileName,
|
|
30259
|
+
source: "profile"
|
|
30260
|
+
};
|
|
30261
|
+
const configured = normalizeCodexHomePath(state.runtimeSettings?.codexHome);
|
|
30262
|
+
if (configured) return {
|
|
30263
|
+
codexHomePath: configured,
|
|
30264
|
+
profileName: null,
|
|
30265
|
+
source: "settings"
|
|
30266
|
+
};
|
|
30267
|
+
return {
|
|
30268
|
+
codexHomePath: resolveDefaultCodexHomeDir(),
|
|
30269
|
+
profileName: null,
|
|
30270
|
+
source: "default"
|
|
30271
|
+
};
|
|
30272
|
+
}
|
|
30273
|
+
async function resolveExternalCodexRuntimeContext(options) {
|
|
30274
|
+
const explicit = normalizeCodexHomePath(options?.codexHomePath);
|
|
30275
|
+
if (explicit) return {
|
|
30276
|
+
codexHomePath: explicit,
|
|
30277
|
+
profileName: null,
|
|
30278
|
+
source: "explicit"
|
|
30279
|
+
};
|
|
30280
|
+
const configured = normalizeCodexHomePath((await getAppState()).runtimeSettings?.codexHome);
|
|
30281
|
+
if (configured) return {
|
|
30282
|
+
codexHomePath: configured,
|
|
30283
|
+
profileName: null,
|
|
30284
|
+
source: "settings"
|
|
30285
|
+
};
|
|
30286
|
+
return {
|
|
30287
|
+
codexHomePath: resolveDefaultCodexHomeDir(),
|
|
30288
|
+
profileName: null,
|
|
30289
|
+
source: "default"
|
|
30290
|
+
};
|
|
30291
|
+
}
|
|
30292
|
+
async function resolveGlobalCodexRuntimeContext(options) {
|
|
30293
|
+
return resolveExternalCodexRuntimeContext(options);
|
|
30294
|
+
}
|
|
30295
|
+
//#endregion
|
|
30199
30296
|
//#region ../../packages/contracts/src/apps/rpc.ts
|
|
30200
30297
|
const APPS_LIST_METHODS = new Set([
|
|
30201
30298
|
"app/list",
|
|
@@ -30294,7 +30391,7 @@ function isThreadNotFoundError$1(error) {
|
|
|
30294
30391
|
const lower = message.toLowerCase();
|
|
30295
30392
|
return lower.includes("thread not found") || lower.includes("rollout");
|
|
30296
30393
|
}
|
|
30297
|
-
function asString$
|
|
30394
|
+
function asString$7(value) {
|
|
30298
30395
|
return typeof value === "string" ? value : value != null ? String(value) : "";
|
|
30299
30396
|
}
|
|
30300
30397
|
function isInlineImageValue(value) {
|
|
@@ -30303,11 +30400,11 @@ function isInlineImageValue(value) {
|
|
|
30303
30400
|
}
|
|
30304
30401
|
function normalizeSendUserMessageItem(value) {
|
|
30305
30402
|
if (!isRecord$5(value)) return null;
|
|
30306
|
-
const type = asString$
|
|
30403
|
+
const type = asString$7(value.type).trim();
|
|
30307
30404
|
if (!type) return null;
|
|
30308
30405
|
const data = isRecord$5(value.data) ? value.data : {};
|
|
30309
30406
|
if (type === "text") {
|
|
30310
|
-
const text = asString$
|
|
30407
|
+
const text = asString$7(data.text ?? value.text);
|
|
30311
30408
|
if (!text.trim()) return null;
|
|
30312
30409
|
return {
|
|
30313
30410
|
type: "text",
|
|
@@ -30315,7 +30412,7 @@ function normalizeSendUserMessageItem(value) {
|
|
|
30315
30412
|
};
|
|
30316
30413
|
}
|
|
30317
30414
|
if (type === "image") {
|
|
30318
|
-
const imageUrl = asString$
|
|
30415
|
+
const imageUrl = asString$7(data.image_url ?? data.imageUrl ?? data.url ?? value.image_url ?? value.imageUrl ?? value.url).trim();
|
|
30319
30416
|
if (!imageUrl) return null;
|
|
30320
30417
|
return {
|
|
30321
30418
|
type: "image",
|
|
@@ -30323,7 +30420,7 @@ function normalizeSendUserMessageItem(value) {
|
|
|
30323
30420
|
};
|
|
30324
30421
|
}
|
|
30325
30422
|
if (type === "localImage") {
|
|
30326
|
-
const path = asString$
|
|
30423
|
+
const path = asString$7(data.path ?? value.path).trim();
|
|
30327
30424
|
if (!path) return null;
|
|
30328
30425
|
return {
|
|
30329
30426
|
type: "localImage",
|
|
@@ -30334,12 +30431,12 @@ function normalizeSendUserMessageItem(value) {
|
|
|
30334
30431
|
}
|
|
30335
30432
|
function normalizeTurnInputParams(params) {
|
|
30336
30433
|
const normalized = { ...params };
|
|
30337
|
-
const threadId = asString$
|
|
30338
|
-
if (threadId && !asString$
|
|
30339
|
-
const expectedTurnId = asString$
|
|
30340
|
-
if (expectedTurnId && !asString$
|
|
30341
|
-
const turnId = asString$
|
|
30342
|
-
if (turnId && !asString$
|
|
30434
|
+
const threadId = asString$7(params.threadId ?? params.thread_id ?? params.conversationId ?? params.conversation_id ?? "").trim();
|
|
30435
|
+
if (threadId && !asString$7(params.threadId).trim()) normalized.threadId = threadId;
|
|
30436
|
+
const expectedTurnId = asString$7(params.expectedTurnId ?? params.expected_turn_id ?? params.turnId ?? params.turn_id ?? "").trim();
|
|
30437
|
+
if (expectedTurnId && !asString$7(params.expectedTurnId).trim()) normalized.expectedTurnId = expectedTurnId;
|
|
30438
|
+
const turnId = asString$7(params.turnId ?? params.turn_id ?? expectedTurnId).trim();
|
|
30439
|
+
if (turnId && !asString$7(params.turnId).trim()) normalized.turnId = turnId;
|
|
30343
30440
|
const providedInput = Array.isArray(params.input) ? params.input.filter((entry) => isRecord$5(entry)) : [];
|
|
30344
30441
|
if (providedInput.length > 0) {
|
|
30345
30442
|
normalized.input = providedInput;
|
|
@@ -30348,17 +30445,17 @@ function normalizeTurnInputParams(params) {
|
|
|
30348
30445
|
const providedItems = Array.isArray(params.items) ? params.items.map((item) => normalizeSendUserMessageItem(item)).filter((item) => item !== null) : [];
|
|
30349
30446
|
if (providedItems.length > 0) {
|
|
30350
30447
|
const input = providedItems.flatMap((item) => {
|
|
30351
|
-
const type = asString$
|
|
30448
|
+
const type = asString$7(item.type).trim();
|
|
30352
30449
|
const data = isRecord$5(item.data) ? item.data : item;
|
|
30353
30450
|
if (type === "text") {
|
|
30354
|
-
const text = asString$
|
|
30451
|
+
const text = asString$7(data.text).trim();
|
|
30355
30452
|
return text ? [{
|
|
30356
30453
|
type: "text",
|
|
30357
30454
|
text
|
|
30358
30455
|
}] : [];
|
|
30359
30456
|
}
|
|
30360
30457
|
if (type === "localImage") {
|
|
30361
|
-
const path = asString$
|
|
30458
|
+
const path = asString$7(data.path).trim();
|
|
30362
30459
|
return path ? [{
|
|
30363
30460
|
type: "localImage",
|
|
30364
30461
|
path
|
|
@@ -30372,13 +30469,13 @@ function normalizeTurnInputParams(params) {
|
|
|
30372
30469
|
}
|
|
30373
30470
|
}
|
|
30374
30471
|
const input = [];
|
|
30375
|
-
const text = asString$
|
|
30472
|
+
const text = asString$7(params.text);
|
|
30376
30473
|
if (text.trim()) input.push({
|
|
30377
30474
|
type: "text",
|
|
30378
30475
|
text
|
|
30379
30476
|
});
|
|
30380
30477
|
if (Array.isArray(params.images)) for (const candidate of params.images) {
|
|
30381
|
-
const image = asString$
|
|
30478
|
+
const image = asString$7(candidate).trim();
|
|
30382
30479
|
if (!image || isInlineImageValue(image)) continue;
|
|
30383
30480
|
input.push({
|
|
30384
30481
|
type: "localImage",
|
|
@@ -30429,7 +30526,7 @@ function getRequestTimeoutMs(method) {
|
|
|
30429
30526
|
return DEFAULT_REQUEST_TIMEOUT_MS;
|
|
30430
30527
|
}
|
|
30431
30528
|
function normalizeThreadLiveWorkspaceId(value) {
|
|
30432
|
-
return asString$
|
|
30529
|
+
return asString$7(value).trim() || DEFAULT_THREAD_LIVE_WORKSPACE_ID;
|
|
30433
30530
|
}
|
|
30434
30531
|
function threadLiveKey(workspaceId, threadId) {
|
|
30435
30532
|
return `${workspaceId}:${threadId}`;
|
|
@@ -30495,7 +30592,7 @@ var CodexAppServer = class extends EventEmitter {
|
|
|
30495
30592
|
this.threadLiveSubscriptionIdByKey = /* @__PURE__ */ new Map();
|
|
30496
30593
|
this.threadLiveModeByKey = /* @__PURE__ */ new Map();
|
|
30497
30594
|
this.addConversationListenerSupported = null;
|
|
30498
|
-
this.homePath = options?.homePath
|
|
30595
|
+
this.homePath = normalizeCodexHomePath(options?.homePath);
|
|
30499
30596
|
this.setMaxListeners(50);
|
|
30500
30597
|
}
|
|
30501
30598
|
async start() {
|
|
@@ -30633,8 +30730,8 @@ var CodexAppServer = class extends EventEmitter {
|
|
|
30633
30730
|
}
|
|
30634
30731
|
async addConversationListener(params) {
|
|
30635
30732
|
if (this.addConversationListenerSupported === false) return {};
|
|
30636
|
-
const conversationId = asString$
|
|
30637
|
-
const workspaceId = asString$
|
|
30733
|
+
const conversationId = asString$7(params.conversationId ?? params.threadId ?? params.thread_id ?? "").trim();
|
|
30734
|
+
const workspaceId = asString$7(params.workspaceId ?? params.workspace_id ?? "").trim();
|
|
30638
30735
|
if (!conversationId) try {
|
|
30639
30736
|
const response = await this.request("addConversationListener", params);
|
|
30640
30737
|
this.addConversationListenerSupported = true;
|
|
@@ -30662,7 +30759,7 @@ var CodexAppServer = class extends EventEmitter {
|
|
|
30662
30759
|
}
|
|
30663
30760
|
async threadLiveSubscribe(params) {
|
|
30664
30761
|
const workspaceId = normalizeThreadLiveWorkspaceId(params.workspaceId ?? params.workspace_id);
|
|
30665
|
-
const threadId = asString$
|
|
30762
|
+
const threadId = asString$7(params.threadId ?? params.thread_id ?? params.conversationId).trim();
|
|
30666
30763
|
if (!threadId) return {};
|
|
30667
30764
|
const key = threadLiveKey(workspaceId, threadId);
|
|
30668
30765
|
this.threadLiveModeByKey.set(key, "listener");
|
|
@@ -30671,7 +30768,7 @@ var CodexAppServer = class extends EventEmitter {
|
|
|
30671
30768
|
}
|
|
30672
30769
|
async threadLiveUnsubscribe(params) {
|
|
30673
30770
|
const workspaceId = normalizeThreadLiveWorkspaceId(params.workspaceId ?? params.workspace_id);
|
|
30674
|
-
const threadId = asString$
|
|
30771
|
+
const threadId = asString$7(params.threadId ?? params.thread_id ?? params.conversationId).trim();
|
|
30675
30772
|
if (!threadId) return {};
|
|
30676
30773
|
const key = threadLiveKey(workspaceId, threadId);
|
|
30677
30774
|
this.threadLiveModeByKey.delete(key);
|
|
@@ -31142,83 +31239,6 @@ var CodexAppServer = class extends EventEmitter {
|
|
|
31142
31239
|
}
|
|
31143
31240
|
};
|
|
31144
31241
|
//#endregion
|
|
31145
|
-
//#region ../../packages/runtime-codex/src/codex/home.ts
|
|
31146
|
-
function resolveHomeDir$1() {
|
|
31147
|
-
return process.env.HOME || process.env.USERPROFILE || os.homedir();
|
|
31148
|
-
}
|
|
31149
|
-
function expandHomePrefix(input, homeDir) {
|
|
31150
|
-
if (input === "~") return homeDir;
|
|
31151
|
-
if (input.startsWith("~/") || input.startsWith("~\\")) return path.join(homeDir, input.slice(2));
|
|
31152
|
-
return input;
|
|
31153
|
-
}
|
|
31154
|
-
function normalizePathCandidate(value) {
|
|
31155
|
-
if (typeof value !== "string") return null;
|
|
31156
|
-
const trimmed = value.trim();
|
|
31157
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
31158
|
-
}
|
|
31159
|
-
function normalizeCodexHomePath(input) {
|
|
31160
|
-
const configured = normalizePathCandidate(input);
|
|
31161
|
-
if (!configured) return null;
|
|
31162
|
-
return path.resolve(expandHomePrefix(configured, resolveHomeDir$1()));
|
|
31163
|
-
}
|
|
31164
|
-
function resolveDefaultCodexHomeDir() {
|
|
31165
|
-
return path.join(resolveHomeDir$1(), ".codex");
|
|
31166
|
-
}
|
|
31167
|
-
function resolveProfileCodexHomeDir(profileName) {
|
|
31168
|
-
return path.join(getUserDataDir(), "profile-homes", profileName);
|
|
31169
|
-
}
|
|
31170
|
-
function resolveCodexHomeDir(options) {
|
|
31171
|
-
return normalizeCodexHomePath(options?.codexHomePath) ?? resolveDefaultCodexHomeDir();
|
|
31172
|
-
}
|
|
31173
|
-
async function resolveCodexRuntimeContext(options) {
|
|
31174
|
-
const explicit = normalizeCodexHomePath(options?.codexHomePath);
|
|
31175
|
-
if (explicit) return {
|
|
31176
|
-
codexHomePath: explicit,
|
|
31177
|
-
profileName: null,
|
|
31178
|
-
source: "explicit"
|
|
31179
|
-
};
|
|
31180
|
-
const state = await getAppState();
|
|
31181
|
-
const profileName = normalizePathCandidate(state.app.lastProfileName);
|
|
31182
|
-
if (profileName && state.profilesByName[profileName]) return {
|
|
31183
|
-
codexHomePath: resolveProfileCodexHomeDir(profileName),
|
|
31184
|
-
profileName,
|
|
31185
|
-
source: "profile"
|
|
31186
|
-
};
|
|
31187
|
-
const configured = normalizeCodexHomePath(state.runtimeSettings?.codexHome);
|
|
31188
|
-
if (configured) return {
|
|
31189
|
-
codexHomePath: configured,
|
|
31190
|
-
profileName: null,
|
|
31191
|
-
source: "settings"
|
|
31192
|
-
};
|
|
31193
|
-
return {
|
|
31194
|
-
codexHomePath: resolveDefaultCodexHomeDir(),
|
|
31195
|
-
profileName: null,
|
|
31196
|
-
source: "default"
|
|
31197
|
-
};
|
|
31198
|
-
}
|
|
31199
|
-
async function resolveExternalCodexRuntimeContext(options) {
|
|
31200
|
-
const explicit = normalizeCodexHomePath(options?.codexHomePath);
|
|
31201
|
-
if (explicit) return {
|
|
31202
|
-
codexHomePath: explicit,
|
|
31203
|
-
profileName: null,
|
|
31204
|
-
source: "explicit"
|
|
31205
|
-
};
|
|
31206
|
-
const configured = normalizeCodexHomePath((await getAppState()).runtimeSettings?.codexHome);
|
|
31207
|
-
if (configured) return {
|
|
31208
|
-
codexHomePath: configured,
|
|
31209
|
-
profileName: null,
|
|
31210
|
-
source: "settings"
|
|
31211
|
-
};
|
|
31212
|
-
return {
|
|
31213
|
-
codexHomePath: resolveDefaultCodexHomeDir(),
|
|
31214
|
-
profileName: null,
|
|
31215
|
-
source: "default"
|
|
31216
|
-
};
|
|
31217
|
-
}
|
|
31218
|
-
async function resolveGlobalCodexRuntimeContext(options) {
|
|
31219
|
-
return resolveExternalCodexRuntimeContext(options);
|
|
31220
|
-
}
|
|
31221
|
-
//#endregion
|
|
31222
31242
|
//#region src/migrations/legacy-codexuse/parityStore.ts
|
|
31223
31243
|
const STORE_FILE = "workspace-parity.json";
|
|
31224
31244
|
const LEGACY_STORE_FILE = "workspace-parity.json";
|
|
@@ -31410,14 +31430,14 @@ async function listParityWorkspaces() {
|
|
|
31410
31430
|
//#region src/externalThreadOverrides.ts
|
|
31411
31431
|
const EXTERNAL_THREAD_OVERRIDES_DOCUMENT = "desktop.external-thread-overrides.v1";
|
|
31412
31432
|
const EXTERNAL_THREAD_OVERRIDES_VERSION = 1;
|
|
31413
|
-
function asRecord$
|
|
31433
|
+
function asRecord$4(value) {
|
|
31414
31434
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
31415
31435
|
}
|
|
31416
31436
|
function normalizeOptionalTitle(value) {
|
|
31417
31437
|
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
31418
31438
|
}
|
|
31419
31439
|
function sanitizeOverride(value) {
|
|
31420
|
-
const record = asRecord$
|
|
31440
|
+
const record = asRecord$4(value);
|
|
31421
31441
|
if (!record) return null;
|
|
31422
31442
|
const suppressed = record.suppressed === true ? true : void 0;
|
|
31423
31443
|
const localTitle = normalizeOptionalTitle(record.localTitle);
|
|
@@ -31458,8 +31478,8 @@ function resolveOverridesDbPath(stateDir) {
|
|
|
31458
31478
|
}
|
|
31459
31479
|
async function readExternalThreadOverrides(stateDir) {
|
|
31460
31480
|
return await readDocument(resolveOverridesDbPath(stateDir), EXTERNAL_THREAD_OVERRIDES_DOCUMENT, (value) => {
|
|
31461
|
-
const record = asRecord$
|
|
31462
|
-
const threadsRecord = asRecord$
|
|
31481
|
+
const record = asRecord$4(value);
|
|
31482
|
+
const threadsRecord = asRecord$4(record?.threads) ?? {};
|
|
31463
31483
|
const threads = {};
|
|
31464
31484
|
for (const [threadId, entry] of Object.entries(threadsRecord)) {
|
|
31465
31485
|
const sanitized = sanitizeOverride(entry);
|
|
@@ -31595,7 +31615,7 @@ let externalCodexThreadSyncWatcherSettleTimer = null;
|
|
|
31595
31615
|
let externalCodexThreadSyncWatcherPendingTrigger = null;
|
|
31596
31616
|
const externalSyncAppServerLeaseCount = /* @__PURE__ */ new Map();
|
|
31597
31617
|
let externalCodexThreadSyncRefreshQueue = null;
|
|
31598
|
-
function asRecord$
|
|
31618
|
+
function asRecord$3(value) {
|
|
31599
31619
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
31600
31620
|
}
|
|
31601
31621
|
function clearSharedExternalSyncAppServerIdleTimer() {
|
|
@@ -31802,11 +31822,11 @@ function startExternalCodexThreadSyncWatcher(homePath) {
|
|
|
31802
31822
|
function resolveStateDbPath(stateDir) {
|
|
31803
31823
|
return path.join(stateDir, "state.sqlite");
|
|
31804
31824
|
}
|
|
31805
|
-
function asString$
|
|
31825
|
+
function asString$6(value) {
|
|
31806
31826
|
return typeof value === "string" ? value : value == null ? "" : String(value);
|
|
31807
31827
|
}
|
|
31808
31828
|
function asTrimmedString$1(value) {
|
|
31809
|
-
return asString$
|
|
31829
|
+
return asString$6(value).trim();
|
|
31810
31830
|
}
|
|
31811
31831
|
function asFiniteNumber(value) {
|
|
31812
31832
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -31863,9 +31883,9 @@ async function readImportedVisibleMessageTimeline(thread) {
|
|
|
31863
31883
|
} catch {
|
|
31864
31884
|
continue;
|
|
31865
31885
|
}
|
|
31866
|
-
const record = asRecord$
|
|
31886
|
+
const record = asRecord$3(entry);
|
|
31867
31887
|
if (!record || asTrimmedString$1(record.type) !== "event_msg") continue;
|
|
31868
|
-
const payload = asRecord$
|
|
31888
|
+
const payload = asRecord$3(record.payload);
|
|
31869
31889
|
if (!payload) continue;
|
|
31870
31890
|
const timestamp = firstNonEmptyString(record.timestamp, payload.timestamp, payload.createdAt, payload.created_at);
|
|
31871
31891
|
if (!timestamp || !Number.isFinite(Date.parse(timestamp))) continue;
|
|
@@ -31892,16 +31912,16 @@ function takeImportedVisibleMessageTimestamp(timeline, role) {
|
|
|
31892
31912
|
return nextTimestamp;
|
|
31893
31913
|
}
|
|
31894
31914
|
function listThreadSummariesFromResponse(payload) {
|
|
31895
|
-
const root = asRecord$
|
|
31896
|
-
const result = asRecord$
|
|
31915
|
+
const root = asRecord$3(payload);
|
|
31916
|
+
const result = asRecord$3(root?.result) ?? root;
|
|
31897
31917
|
return {
|
|
31898
|
-
threads: (Array.isArray(result?.data) ? result.data : []).map((entry) => asRecord$
|
|
31918
|
+
threads: (Array.isArray(result?.data) ? result.data : []).map((entry) => asRecord$3(entry)).filter((entry) => Boolean(asTrimmedString$1(entry?.id))),
|
|
31899
31919
|
nextCursor: firstNonEmptyString(result?.nextCursor, result?.next_cursor)
|
|
31900
31920
|
};
|
|
31901
31921
|
}
|
|
31902
31922
|
function extractLegacyThread(payload) {
|
|
31903
|
-
const root = asRecord$
|
|
31904
|
-
const thread = asRecord$
|
|
31923
|
+
const root = asRecord$3(payload);
|
|
31924
|
+
const thread = asRecord$3((asRecord$3(root?.result) ?? root)?.thread) ?? asRecord$3(root?.thread);
|
|
31905
31925
|
return thread && asTrimmedString$1(thread.id) ? thread : null;
|
|
31906
31926
|
}
|
|
31907
31927
|
function normalizeProjectScriptIcon(value) {
|
|
@@ -32018,19 +32038,19 @@ const MODEL_KEYS = [
|
|
|
32018
32038
|
"model_name"
|
|
32019
32039
|
];
|
|
32020
32040
|
function extractModelFromRecord(record) {
|
|
32021
|
-
const payload = asRecord$
|
|
32041
|
+
const payload = asRecord$3(record.payload);
|
|
32022
32042
|
const containers = [
|
|
32023
32043
|
record,
|
|
32024
32044
|
payload,
|
|
32025
|
-
asRecord$
|
|
32026
|
-
asRecord$
|
|
32027
|
-
asRecord$
|
|
32028
|
-
asRecord$
|
|
32029
|
-
asRecord$
|
|
32030
|
-
asRecord$
|
|
32031
|
-
asRecord$
|
|
32032
|
-
asRecord$
|
|
32033
|
-
asRecord$
|
|
32045
|
+
asRecord$3(payload?.info),
|
|
32046
|
+
asRecord$3(record.info),
|
|
32047
|
+
asRecord$3(record.metadata),
|
|
32048
|
+
asRecord$3(record.context),
|
|
32049
|
+
asRecord$3(record.turnContext),
|
|
32050
|
+
asRecord$3(record.turn_context),
|
|
32051
|
+
asRecord$3(record.params),
|
|
32052
|
+
asRecord$3(record.settings),
|
|
32053
|
+
asRecord$3(record.config)
|
|
32034
32054
|
].filter((value) => value !== null);
|
|
32035
32055
|
for (const container of containers) {
|
|
32036
32056
|
const value = pickString(container, MODEL_KEYS);
|
|
@@ -32041,13 +32061,13 @@ function extractModelFromRecord(record) {
|
|
|
32041
32061
|
function resolveImportedModel(thread) {
|
|
32042
32062
|
const turns = Array.isArray(thread.turns) ? thread.turns : [];
|
|
32043
32063
|
for (let turnIndex = turns.length - 1; turnIndex >= 0; turnIndex -= 1) {
|
|
32044
|
-
const turn = asRecord$
|
|
32064
|
+
const turn = asRecord$3(turns[turnIndex]);
|
|
32045
32065
|
if (!turn) continue;
|
|
32046
32066
|
const turnLevel = extractModelFromRecord(turn);
|
|
32047
32067
|
if (turnLevel) return turnLevel;
|
|
32048
32068
|
const items = Array.isArray(turn.items) ? turn.items : [];
|
|
32049
32069
|
for (let itemIndex = items.length - 1; itemIndex >= 0; itemIndex -= 1) {
|
|
32050
|
-
const item = asRecord$
|
|
32070
|
+
const item = asRecord$3(items[itemIndex]);
|
|
32051
32071
|
if (!item) continue;
|
|
32052
32072
|
const model = extractModelFromRecord(item);
|
|
32053
32073
|
if (model) return model;
|
|
@@ -32062,7 +32082,7 @@ function resolveThreadTitle(thread) {
|
|
|
32062
32082
|
return firstNonEmptyString(thread.name, thread.preview, thread.title)?.split(/\r?\n/, 1)[0]?.trim()?.slice(0, 140) || "Imported thread";
|
|
32063
32083
|
}
|
|
32064
32084
|
function readLegacyContentRecord(value) {
|
|
32065
|
-
return asRecord$
|
|
32085
|
+
return asRecord$3(value);
|
|
32066
32086
|
}
|
|
32067
32087
|
function readLegacyContentText(item) {
|
|
32068
32088
|
const data = readLegacyContentRecord(item.data);
|
|
@@ -32154,7 +32174,7 @@ async function parseUserMessageContent(input) {
|
|
|
32154
32174
|
const attachments = [];
|
|
32155
32175
|
let imageIndex = 0;
|
|
32156
32176
|
for (const entry of content) {
|
|
32157
|
-
const item = asRecord$
|
|
32177
|
+
const item = asRecord$3(entry);
|
|
32158
32178
|
if (!item) continue;
|
|
32159
32179
|
const type = asTrimmedString$1(item.type);
|
|
32160
32180
|
if (type === "text") {
|
|
@@ -32225,13 +32245,13 @@ async function buildThreadImportArtifacts(input) {
|
|
|
32225
32245
|
let latestArtifactUpdatedAt = createdAt;
|
|
32226
32246
|
let latestUpdatedAt = summaryUpdatedAt;
|
|
32227
32247
|
for (const [turnIndex, turnEntry] of turns.entries()) {
|
|
32228
|
-
const turn = asRecord$
|
|
32248
|
+
const turn = asRecord$3(turnEntry);
|
|
32229
32249
|
if (!turn) continue;
|
|
32230
32250
|
const turnIdRaw = firstNonEmptyString(turn.id, turn.turnId, turn.turn_id);
|
|
32231
32251
|
const turnId = turnIdRaw ? TurnId.makeUnsafe(turnIdRaw) : null;
|
|
32232
32252
|
const items = Array.isArray(turn.items) ? turn.items : [];
|
|
32233
32253
|
for (const [itemIndex, itemEntry] of items.entries()) {
|
|
32234
|
-
const item = asRecord$
|
|
32254
|
+
const item = asRecord$3(itemEntry);
|
|
32235
32255
|
if (!item) continue;
|
|
32236
32256
|
const itemId = firstNonEmptyString(item.id) ?? `${turnIndex + 1}-${itemIndex + 1}`;
|
|
32237
32257
|
const type = asTrimmedString$1(item.type);
|
|
@@ -32454,7 +32474,7 @@ async function isDirectory(targetPath) {
|
|
|
32454
32474
|
async function readImportMarker(stateDir) {
|
|
32455
32475
|
const dbPath = resolveStateDbPath(stateDir);
|
|
32456
32476
|
const stored = await readDocument(dbPath, EXTERNAL_SYNC_MARKER_DOCUMENT, (value) => {
|
|
32457
|
-
const version = asFiniteNumber(asRecord$
|
|
32477
|
+
const version = asFiniteNumber(asRecord$3(value)?.version);
|
|
32458
32478
|
if (version === null || version <= 0) return null;
|
|
32459
32479
|
return { version };
|
|
32460
32480
|
});
|
|
@@ -32462,7 +32482,7 @@ async function readImportMarker(stateDir) {
|
|
|
32462
32482
|
const markerPath = path.join(stateDir, EXTERNAL_SYNC_MARKER_FILE);
|
|
32463
32483
|
try {
|
|
32464
32484
|
const raw = await fs$1.readFile(markerPath, "utf8");
|
|
32465
|
-
const version = asFiniteNumber(asRecord$
|
|
32485
|
+
const version = asFiniteNumber(asRecord$3(JSON.parse(raw))?.version);
|
|
32466
32486
|
if (version === null || version <= 0) return null;
|
|
32467
32487
|
const marker = { version };
|
|
32468
32488
|
await writeDocument(dbPath, EXTERNAL_SYNC_MARKER_DOCUMENT, marker);
|
|
@@ -32542,7 +32562,7 @@ function hasImportedThreadArtifacts(state) {
|
|
|
32542
32562
|
return state.messageIds.size > 0 || state.activityIds.size > 0 || state.planIds.size > 0;
|
|
32543
32563
|
}
|
|
32544
32564
|
function readProviderThreadIdFromResumeCursor(resumeCursor) {
|
|
32545
|
-
const cursor = asRecord$
|
|
32565
|
+
const cursor = asRecord$3(resumeCursor);
|
|
32546
32566
|
return firstNonEmptyString(cursor?.threadId, cursor?.thread_id, cursor?.conversationId, cursor?.conversation_id) ?? null;
|
|
32547
32567
|
}
|
|
32548
32568
|
function resolveLegacyThreadReadIds(input) {
|
|
@@ -33373,7 +33393,7 @@ function proposedPlanIdFromEvent(event, threadId) {
|
|
|
33373
33393
|
if (event.itemId) return `plan:${threadId}:item:${event.itemId}`;
|
|
33374
33394
|
return `plan:${threadId}:event:${event.eventId}`;
|
|
33375
33395
|
}
|
|
33376
|
-
function asString$
|
|
33396
|
+
function asString$5(value) {
|
|
33377
33397
|
return typeof value === "string" ? value : void 0;
|
|
33378
33398
|
}
|
|
33379
33399
|
function runtimePayloadRecord(event) {
|
|
@@ -33391,13 +33411,13 @@ function normalizeRuntimeTurnState(value) {
|
|
|
33391
33411
|
}
|
|
33392
33412
|
}
|
|
33393
33413
|
function runtimeTurnState(event) {
|
|
33394
|
-
return normalizeRuntimeTurnState(asString$
|
|
33414
|
+
return normalizeRuntimeTurnState(asString$5(runtimePayloadRecord(event)?.state));
|
|
33395
33415
|
}
|
|
33396
33416
|
function runtimeTurnErrorMessage(event) {
|
|
33397
|
-
return asString$
|
|
33417
|
+
return asString$5(runtimePayloadRecord(event)?.errorMessage);
|
|
33398
33418
|
}
|
|
33399
33419
|
function runtimeErrorMessageFromEvent(event) {
|
|
33400
|
-
return asString$
|
|
33420
|
+
return asString$5(runtimePayloadRecord(event)?.message);
|
|
33401
33421
|
}
|
|
33402
33422
|
function shouldTriggerPassiveImportedThreadRecovery(event) {
|
|
33403
33423
|
switch (event.type) {
|
|
@@ -34148,13 +34168,13 @@ function asObject$1(value) {
|
|
|
34148
34168
|
if (!value || typeof value !== "object") return;
|
|
34149
34169
|
return value;
|
|
34150
34170
|
}
|
|
34151
|
-
function asString$
|
|
34171
|
+
function asString$4(value) {
|
|
34152
34172
|
return typeof value === "string" ? value : void 0;
|
|
34153
34173
|
}
|
|
34154
34174
|
function readCodexAccountSnapshot(response) {
|
|
34155
34175
|
const record = asObject$1(response);
|
|
34156
34176
|
const account = asObject$1(record?.account) ?? record;
|
|
34157
|
-
const accountType = asString$
|
|
34177
|
+
const accountType = asString$4(account?.type);
|
|
34158
34178
|
if (accountType === "apiKey") return {
|
|
34159
34179
|
type: "apiKey",
|
|
34160
34180
|
planType: null,
|
|
@@ -34523,7 +34543,7 @@ var CodexAppServerManager = class extends EventEmitter {
|
|
|
34523
34543
|
};
|
|
34524
34544
|
const codexOptions = readCodexProviderOptions(input);
|
|
34525
34545
|
const codexBinaryPath = codexOptions.binaryPath ?? "codex";
|
|
34526
|
-
const codexHomePath = codexOptions.homePath;
|
|
34546
|
+
const codexHomePath = normalizeCodexHomePath(codexOptions.homePath);
|
|
34527
34547
|
this.assertSupportedCodexCliVersion({
|
|
34528
34548
|
binaryPath: codexBinaryPath,
|
|
34529
34549
|
cwd: resolvedCwd,
|
|
@@ -35284,7 +35304,7 @@ function readCodexProviderOptions(input) {
|
|
|
35284
35304
|
if (!options) return {};
|
|
35285
35305
|
return {
|
|
35286
35306
|
...options.binaryPath ? { binaryPath: options.binaryPath } : {},
|
|
35287
|
-
...options.homePath ? { homePath: options.homePath } : {}
|
|
35307
|
+
...options.homePath ? { homePath: normalizeCodexHomePath(options.homePath) ?? options.homePath } : {}
|
|
35288
35308
|
};
|
|
35289
35309
|
}
|
|
35290
35310
|
function assertSupportedCodexCliVersion(input) {
|
|
@@ -35698,7 +35718,7 @@ function asObject(value) {
|
|
|
35698
35718
|
if (!value || typeof value !== "object") return;
|
|
35699
35719
|
return value;
|
|
35700
35720
|
}
|
|
35701
|
-
function asString$
|
|
35721
|
+
function asString$3(value) {
|
|
35702
35722
|
return typeof value === "string" ? value : void 0;
|
|
35703
35723
|
}
|
|
35704
35724
|
function asArray(value) {
|
|
@@ -35717,7 +35737,7 @@ function toTurnStatus(value) {
|
|
|
35717
35737
|
}
|
|
35718
35738
|
}
|
|
35719
35739
|
function normalizeItemType(raw) {
|
|
35720
|
-
const type = asString$
|
|
35740
|
+
const type = asString$3(raw);
|
|
35721
35741
|
if (!type) return "item";
|
|
35722
35742
|
return type.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[._/-]/g, " ").replace(/\s+/g, " ").trim().toLowerCase();
|
|
35723
35743
|
}
|
|
@@ -35759,16 +35779,16 @@ function itemTitle(itemType) {
|
|
|
35759
35779
|
function itemDetail(item, payload) {
|
|
35760
35780
|
const nestedResult = asObject(item.result);
|
|
35761
35781
|
const candidates = [
|
|
35762
|
-
asString$
|
|
35763
|
-
asString$
|
|
35764
|
-
asString$
|
|
35765
|
-
asString$
|
|
35766
|
-
asString$
|
|
35767
|
-
asString$
|
|
35768
|
-
asString$
|
|
35769
|
-
asString$
|
|
35770
|
-
asString$
|
|
35771
|
-
asString$
|
|
35782
|
+
asString$3(item.command),
|
|
35783
|
+
asString$3(item.title),
|
|
35784
|
+
asString$3(item.summary),
|
|
35785
|
+
asString$3(item.text),
|
|
35786
|
+
asString$3(item.path),
|
|
35787
|
+
asString$3(item.prompt),
|
|
35788
|
+
asString$3(nestedResult?.command),
|
|
35789
|
+
asString$3(payload.command),
|
|
35790
|
+
asString$3(payload.message),
|
|
35791
|
+
asString$3(payload.prompt)
|
|
35772
35792
|
];
|
|
35773
35793
|
for (const candidate of candidates) {
|
|
35774
35794
|
if (!candidate) continue;
|
|
@@ -35800,9 +35820,9 @@ function toRequestTypeFromKind(kind) {
|
|
|
35800
35820
|
}
|
|
35801
35821
|
function toRequestTypeFromResolvedPayload(payload) {
|
|
35802
35822
|
const request = asObject(payload?.request);
|
|
35803
|
-
const method = asString$
|
|
35823
|
+
const method = asString$3(request?.method) ?? asString$3(payload?.method);
|
|
35804
35824
|
if (method) return toRequestTypeFromMethod(method);
|
|
35805
|
-
const requestKind = asString$
|
|
35825
|
+
const requestKind = asString$3(request?.kind) ?? asString$3(payload?.requestKind);
|
|
35806
35826
|
if (requestKind) return toRequestTypeFromKind(requestKind);
|
|
35807
35827
|
return "unknown";
|
|
35808
35828
|
}
|
|
@@ -35828,17 +35848,17 @@ function toUserInputQuestions(payload) {
|
|
|
35828
35848
|
const options = asArray(question.options)?.map((option) => {
|
|
35829
35849
|
const optionRecord = asObject(option);
|
|
35830
35850
|
if (!optionRecord) return void 0;
|
|
35831
|
-
const label = asString$
|
|
35832
|
-
const description = asString$
|
|
35851
|
+
const label = asString$3(optionRecord.label)?.trim();
|
|
35852
|
+
const description = asString$3(optionRecord.description)?.trim();
|
|
35833
35853
|
if (!label || !description) return;
|
|
35834
35854
|
return {
|
|
35835
35855
|
label,
|
|
35836
35856
|
description
|
|
35837
35857
|
};
|
|
35838
35858
|
}).filter((option) => option !== void 0);
|
|
35839
|
-
const id = asString$
|
|
35840
|
-
const header = asString$
|
|
35841
|
-
const prompt = asString$
|
|
35859
|
+
const id = asString$3(question.id)?.trim();
|
|
35860
|
+
const header = asString$3(question.header)?.trim();
|
|
35861
|
+
const prompt = asString$3(question.question)?.trim();
|
|
35842
35862
|
if (!id || !header || !prompt || !options || options.length === 0) return;
|
|
35843
35863
|
return {
|
|
35844
35864
|
id,
|
|
@@ -35889,9 +35909,9 @@ function codexEventMessage(payload) {
|
|
|
35889
35909
|
}
|
|
35890
35910
|
function codexEventBase(event, canonicalThreadId) {
|
|
35891
35911
|
const msg = codexEventMessage(asObject(event.payload));
|
|
35892
|
-
const turnId = asString$
|
|
35893
|
-
const itemId = asString$
|
|
35894
|
-
const requestId = asString$
|
|
35912
|
+
const turnId = asString$3(msg?.turn_id) ?? asString$3(msg?.turnId);
|
|
35913
|
+
const itemId = asString$3(msg?.item_id) ?? asString$3(msg?.itemId);
|
|
35914
|
+
const requestId = asString$3(msg?.request_id) ?? asString$3(msg?.requestId);
|
|
35895
35915
|
const base = runtimeEventBase(event, canonicalThreadId);
|
|
35896
35916
|
const providerRefs = base.providerRefs ? {
|
|
35897
35917
|
...base.providerRefs,
|
|
@@ -35984,7 +36004,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
35984
36004
|
payload: { questions }
|
|
35985
36005
|
}];
|
|
35986
36006
|
}
|
|
35987
|
-
const detail = asString$
|
|
36007
|
+
const detail = asString$3(payload?.command) ?? asString$3(payload?.reason) ?? asString$3(payload?.prompt);
|
|
35988
36008
|
return [{
|
|
35989
36009
|
...runtimeEventBase(event, canonicalThreadId),
|
|
35990
36010
|
type: "request.opened",
|
|
@@ -36041,7 +36061,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36041
36061
|
}
|
|
36042
36062
|
}];
|
|
36043
36063
|
if (event.method === "thread/started") {
|
|
36044
|
-
const providerThreadId = asString$
|
|
36064
|
+
const providerThreadId = asString$3(asObject(payload?.thread)?.id) ?? asString$3(payload?.threadId);
|
|
36045
36065
|
if (!providerThreadId) return [];
|
|
36046
36066
|
return [{
|
|
36047
36067
|
...runtimeEventBase(event, canonicalThreadId),
|
|
@@ -36057,7 +36077,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36057
36077
|
type: "thread.state.changed",
|
|
36058
36078
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36059
36079
|
payload: {
|
|
36060
|
-
state: event.method === "thread/archived" ? "archived" : event.method === "thread/closed" ? "closed" : event.method === "thread/compacted" ? "compacted" : toThreadState(asString$
|
|
36080
|
+
state: event.method === "thread/archived" ? "archived" : event.method === "thread/closed" ? "closed" : event.method === "thread/compacted" ? "compacted" : toThreadState(asString$3(statusRecord?.type) ?? asString$3(threadStatusRecord?.type) ?? asString$3(threadRecord?.state) ?? payload?.state),
|
|
36061
36081
|
...event.payload !== void 0 ? { detail: event.payload } : {}
|
|
36062
36082
|
}
|
|
36063
36083
|
}];
|
|
@@ -36066,7 +36086,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36066
36086
|
type: "thread.metadata.updated",
|
|
36067
36087
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36068
36088
|
payload: {
|
|
36069
|
-
...asString$
|
|
36089
|
+
...asString$3(payload?.threadName) ? { name: asString$3(payload?.threadName) } : {},
|
|
36070
36090
|
...event.payload !== void 0 ? { metadata: asObject(event.payload) } : {}
|
|
36071
36091
|
}
|
|
36072
36092
|
}];
|
|
@@ -36083,19 +36103,19 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36083
36103
|
turnId,
|
|
36084
36104
|
type: "turn.started",
|
|
36085
36105
|
payload: {
|
|
36086
|
-
...asString$
|
|
36087
|
-
...asString$
|
|
36106
|
+
...asString$3(turn?.model) ? { model: asString$3(turn?.model) } : {},
|
|
36107
|
+
...asString$3(turn?.effort) ? { effort: asString$3(turn?.effort) } : {}
|
|
36088
36108
|
}
|
|
36089
36109
|
}];
|
|
36090
36110
|
}
|
|
36091
36111
|
if (event.method === "turn/completed") {
|
|
36092
|
-
const errorMessage = asString$
|
|
36112
|
+
const errorMessage = asString$3(asObject(turn?.error)?.message);
|
|
36093
36113
|
return [{
|
|
36094
36114
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36095
36115
|
type: "turn.completed",
|
|
36096
36116
|
payload: {
|
|
36097
36117
|
state: toTurnStatus(turn?.status),
|
|
36098
|
-
...asString$
|
|
36118
|
+
...asString$3(turn?.stopReason) ? { stopReason: asString$3(turn?.stopReason) } : {},
|
|
36099
36119
|
...turn?.usage !== void 0 ? { usage: turn.usage } : {},
|
|
36100
36120
|
...asObject(turn?.modelUsage) ? { modelUsage: asObject(turn?.modelUsage) } : {},
|
|
36101
36121
|
...asNumber$2(turn?.totalCostUsd) !== void 0 ? { totalCostUsd: asNumber$2(turn?.totalCostUsd) } : {},
|
|
@@ -36114,9 +36134,9 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36114
36134
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36115
36135
|
type: "turn.plan.updated",
|
|
36116
36136
|
payload: {
|
|
36117
|
-
...asString$
|
|
36137
|
+
...asString$3(payload?.explanation) ? { explanation: asString$3(payload?.explanation) } : {},
|
|
36118
36138
|
plan: steps.map((entry) => asObject(entry)).filter((entry) => entry !== void 0).map((entry) => ({
|
|
36119
|
-
step: asString$
|
|
36139
|
+
step: asString$3(entry.step) ?? "step",
|
|
36120
36140
|
status: entry.status === "completed" || entry.status === "inProgress" ? entry.status : "pending"
|
|
36121
36141
|
}))
|
|
36122
36142
|
}
|
|
@@ -36125,7 +36145,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36125
36145
|
if (event.method === "turn/diff/updated") return [{
|
|
36126
36146
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36127
36147
|
type: "turn.diff.updated",
|
|
36128
|
-
payload: { unifiedDiff: asString$
|
|
36148
|
+
payload: { unifiedDiff: asString$3(payload?.unifiedDiff) ?? asString$3(payload?.diff) ?? asString$3(payload?.patch) ?? "" }
|
|
36129
36149
|
}];
|
|
36130
36150
|
if (event.method === "item/started") {
|
|
36131
36151
|
const started = mapItemLifecycle(event, canonicalThreadId, "item.started");
|
|
@@ -36152,7 +36172,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36152
36172
|
return updated ? [updated] : [];
|
|
36153
36173
|
}
|
|
36154
36174
|
if (event.method === "item/plan/delta") {
|
|
36155
|
-
const delta = event.textDelta ?? asString$
|
|
36175
|
+
const delta = event.textDelta ?? asString$3(payload?.delta) ?? asString$3(payload?.text) ?? asString$3(asObject(payload?.content)?.text);
|
|
36156
36176
|
if (!delta || delta.length === 0) return [];
|
|
36157
36177
|
return [{
|
|
36158
36178
|
...runtimeEventBase(event, canonicalThreadId),
|
|
@@ -36161,7 +36181,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36161
36181
|
}];
|
|
36162
36182
|
}
|
|
36163
36183
|
if (event.method === "item/agentMessage/delta" || event.method === "item/commandExecution/outputDelta" || event.method === "item/fileChange/outputDelta" || event.method === "item/reasoning/summaryTextDelta" || event.method === "item/reasoning/textDelta") {
|
|
36164
|
-
const delta = event.textDelta ?? asString$
|
|
36184
|
+
const delta = event.textDelta ?? asString$3(payload?.delta) ?? asString$3(payload?.text) ?? asString$3(asObject(payload?.content)?.text);
|
|
36165
36185
|
if (!delta || delta.length === 0) return [];
|
|
36166
36186
|
return [{
|
|
36167
36187
|
...runtimeEventBase(event, canonicalThreadId),
|
|
@@ -36178,9 +36198,9 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36178
36198
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36179
36199
|
type: "tool.progress",
|
|
36180
36200
|
payload: {
|
|
36181
|
-
...asString$
|
|
36182
|
-
...asString$
|
|
36183
|
-
...asString$
|
|
36201
|
+
...asString$3(payload?.toolUseId) ? { toolUseId: asString$3(payload?.toolUseId) } : {},
|
|
36202
|
+
...asString$3(payload?.toolName) ? { toolName: asString$3(payload?.toolName) } : {},
|
|
36203
|
+
...asString$3(payload?.summary) ? { summary: asString$3(payload?.summary) } : {},
|
|
36184
36204
|
...asNumber$2(payload?.elapsedSeconds) !== void 0 ? { elapsedSeconds: asNumber$2(payload?.elapsedSeconds) } : {}
|
|
36185
36205
|
}
|
|
36186
36206
|
}];
|
|
@@ -36202,21 +36222,21 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36202
36222
|
}];
|
|
36203
36223
|
if (event.method === "codex/event/task_started") {
|
|
36204
36224
|
const msg = codexEventMessage(payload);
|
|
36205
|
-
const taskId = asString$
|
|
36225
|
+
const taskId = asString$3(payload?.id) ?? asString$3(msg?.turn_id);
|
|
36206
36226
|
if (!taskId) return [];
|
|
36207
36227
|
return [{
|
|
36208
36228
|
...codexEventBase(event, canonicalThreadId),
|
|
36209
36229
|
type: "task.started",
|
|
36210
36230
|
payload: {
|
|
36211
36231
|
taskId: asRuntimeTaskId(taskId),
|
|
36212
|
-
...asString$
|
|
36232
|
+
...asString$3(msg?.collaboration_mode_kind) ? { taskType: asString$3(msg?.collaboration_mode_kind) } : {}
|
|
36213
36233
|
}
|
|
36214
36234
|
}];
|
|
36215
36235
|
}
|
|
36216
36236
|
if (event.method === "codex/event/task_complete") {
|
|
36217
36237
|
const msg = codexEventMessage(payload);
|
|
36218
|
-
const taskId = asString$
|
|
36219
|
-
const proposedPlanMarkdown = extractProposedPlanMarkdown(asString$
|
|
36238
|
+
const taskId = asString$3(payload?.id) ?? asString$3(msg?.turn_id);
|
|
36239
|
+
const proposedPlanMarkdown = extractProposedPlanMarkdown(asString$3(msg?.last_agent_message));
|
|
36220
36240
|
if (!taskId) {
|
|
36221
36241
|
if (!proposedPlanMarkdown) return [];
|
|
36222
36242
|
return [{
|
|
@@ -36231,7 +36251,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36231
36251
|
payload: {
|
|
36232
36252
|
taskId: asRuntimeTaskId(taskId),
|
|
36233
36253
|
status: "completed",
|
|
36234
|
-
...asString$
|
|
36254
|
+
...asString$3(msg?.last_agent_message) ? { summary: asString$3(msg?.last_agent_message) } : {}
|
|
36235
36255
|
}
|
|
36236
36256
|
}];
|
|
36237
36257
|
if (proposedPlanMarkdown) events.push({
|
|
@@ -36243,8 +36263,8 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36243
36263
|
}
|
|
36244
36264
|
if (event.method === "codex/event/agent_reasoning") {
|
|
36245
36265
|
const msg = codexEventMessage(payload);
|
|
36246
|
-
const taskId = asString$
|
|
36247
|
-
const description = asString$
|
|
36266
|
+
const taskId = asString$3(payload?.id);
|
|
36267
|
+
const description = asString$3(msg?.text);
|
|
36248
36268
|
if (!taskId || !description) return [];
|
|
36249
36269
|
return [{
|
|
36250
36270
|
...codexEventBase(event, canonicalThreadId),
|
|
@@ -36257,7 +36277,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36257
36277
|
}
|
|
36258
36278
|
if (event.method === "codex/event/reasoning_content_delta") {
|
|
36259
36279
|
const msg = codexEventMessage(payload);
|
|
36260
|
-
const delta = asString$
|
|
36280
|
+
const delta = asString$3(msg?.delta);
|
|
36261
36281
|
if (!delta) return [];
|
|
36262
36282
|
return [{
|
|
36263
36283
|
...codexEventBase(event, canonicalThreadId),
|
|
@@ -36273,26 +36293,26 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36273
36293
|
type: "model.rerouted",
|
|
36274
36294
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36275
36295
|
payload: {
|
|
36276
|
-
fromModel: asString$
|
|
36277
|
-
toModel: asString$
|
|
36278
|
-
reason: asString$
|
|
36296
|
+
fromModel: asString$3(payload?.fromModel) ?? "unknown",
|
|
36297
|
+
toModel: asString$3(payload?.toModel) ?? "unknown",
|
|
36298
|
+
reason: asString$3(payload?.reason) ?? "unknown"
|
|
36279
36299
|
}
|
|
36280
36300
|
}];
|
|
36281
36301
|
if (event.method === "deprecationNotice") return [{
|
|
36282
36302
|
type: "deprecation.notice",
|
|
36283
36303
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36284
36304
|
payload: {
|
|
36285
|
-
summary: asString$
|
|
36286
|
-
...asString$
|
|
36305
|
+
summary: asString$3(payload?.summary) ?? "Deprecation notice",
|
|
36306
|
+
...asString$3(payload?.details) ? { details: asString$3(payload?.details) } : {}
|
|
36287
36307
|
}
|
|
36288
36308
|
}];
|
|
36289
36309
|
if (event.method === "configWarning") return [{
|
|
36290
36310
|
type: "config.warning",
|
|
36291
36311
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36292
36312
|
payload: {
|
|
36293
|
-
summary: asString$
|
|
36294
|
-
...asString$
|
|
36295
|
-
...asString$
|
|
36313
|
+
summary: asString$3(payload?.summary) ?? "Configuration warning",
|
|
36314
|
+
...asString$3(payload?.details) ? { details: asString$3(payload?.details) } : {},
|
|
36315
|
+
...asString$3(payload?.path) ? { path: asString$3(payload?.path) } : {},
|
|
36296
36316
|
...payload?.range !== void 0 ? { range: payload.range } : {}
|
|
36297
36317
|
}
|
|
36298
36318
|
}];
|
|
@@ -36311,12 +36331,12 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36311
36331
|
...runtimeEventBase(event, canonicalThreadId),
|
|
36312
36332
|
payload: {
|
|
36313
36333
|
success: payload?.success === true,
|
|
36314
|
-
...asString$
|
|
36315
|
-
...asString$
|
|
36334
|
+
...asString$3(payload?.name) ? { name: asString$3(payload?.name) } : {},
|
|
36335
|
+
...asString$3(payload?.error) ? { error: asString$3(payload?.error) } : {}
|
|
36316
36336
|
}
|
|
36317
36337
|
}];
|
|
36318
36338
|
if (event.method === "thread/realtime/started") {
|
|
36319
|
-
const realtimeSessionId = asString$
|
|
36339
|
+
const realtimeSessionId = asString$3(payload?.realtimeSessionId);
|
|
36320
36340
|
return [{
|
|
36321
36341
|
type: "thread.realtime.started",
|
|
36322
36342
|
...runtimeEventBase(event, canonicalThreadId),
|
|
@@ -36334,7 +36354,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36334
36354
|
payload: { audio: event.payload ?? {} }
|
|
36335
36355
|
}];
|
|
36336
36356
|
if (event.method === "thread/realtime/error") {
|
|
36337
|
-
const message = asString$
|
|
36357
|
+
const message = asString$3(payload?.message) ?? event.message ?? "Realtime error";
|
|
36338
36358
|
return [{
|
|
36339
36359
|
type: "thread.realtime.error",
|
|
36340
36360
|
...runtimeEventBase(event, canonicalThreadId),
|
|
@@ -36347,7 +36367,7 @@ function mapToRuntimeEvents(event, canonicalThreadId) {
|
|
|
36347
36367
|
payload: { reason: event.message }
|
|
36348
36368
|
}];
|
|
36349
36369
|
if (event.method === "error") {
|
|
36350
|
-
const message = asString$
|
|
36370
|
+
const message = asString$3(asObject(payload?.error)?.message) ?? event.message ?? "Provider runtime error";
|
|
36351
36371
|
const willRetry = payload?.willRetry === true;
|
|
36352
36372
|
return [{
|
|
36353
36373
|
type: willRetry ? "runtime.warning" : "runtime.error",
|
|
@@ -41225,6 +41245,7 @@ const ProviderHealthLive = effect(ProviderHealth, gen(function* () {
|
|
|
41225
41245
|
//#endregion
|
|
41226
41246
|
//#region ../../packages/contracts/src/settings/types.ts
|
|
41227
41247
|
const DEFAULT_ACCOUNT_POOL_EXPOSED_MODELS = [
|
|
41248
|
+
"gpt-5.5",
|
|
41228
41249
|
"gpt-5.4",
|
|
41229
41250
|
"gpt-5.4-mini",
|
|
41230
41251
|
"gpt-5.4-nano"
|
|
@@ -41272,7 +41293,7 @@ const LEGACY_APP_SETTINGS_KEYS = new Set([
|
|
|
41272
41293
|
"activeRemoteBackendId",
|
|
41273
41294
|
"keepDaemonRunningAfterAppClose"
|
|
41274
41295
|
]);
|
|
41275
|
-
function asRecord$
|
|
41296
|
+
function asRecord$2(value) {
|
|
41276
41297
|
return value && typeof value === "object" ? value : {};
|
|
41277
41298
|
}
|
|
41278
41299
|
function stripLegacyAppSettingsKeys(settings) {
|
|
@@ -41286,10 +41307,10 @@ function stripLegacyAppSettingsKeys(settings) {
|
|
|
41286
41307
|
return changed ? next : settings;
|
|
41287
41308
|
}
|
|
41288
41309
|
async function readAppSettings() {
|
|
41289
|
-
return stripLegacyAppSettingsKeys(asRecord$
|
|
41310
|
+
return stripLegacyAppSettingsKeys(asRecord$2((await getAppState()).runtimeSettings));
|
|
41290
41311
|
}
|
|
41291
41312
|
async function writeAppSettings(settings, onUpdated) {
|
|
41292
|
-
const nextSettings = stripLegacyAppSettingsKeys(asRecord$
|
|
41313
|
+
const nextSettings = stripLegacyAppSettingsKeys(asRecord$2(settings));
|
|
41293
41314
|
await updateAppState((current) => ({
|
|
41294
41315
|
...current,
|
|
41295
41316
|
runtimeSettings: nextSettings
|
|
@@ -45946,7 +45967,7 @@ var AccountPoolTurnFailure = class extends Error {
|
|
|
45946
45967
|
function isRecord$2(value) {
|
|
45947
45968
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
45948
45969
|
}
|
|
45949
|
-
function asString$
|
|
45970
|
+
function asString$2(value) {
|
|
45950
45971
|
if (typeof value !== "string") return null;
|
|
45951
45972
|
const trimmed = value.trim();
|
|
45952
45973
|
return trimmed.length > 0 ? trimmed : null;
|
|
@@ -45955,7 +45976,7 @@ function asNumber$1(value) {
|
|
|
45955
45976
|
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
45956
45977
|
}
|
|
45957
45978
|
function normalizeIsoString(value) {
|
|
45958
|
-
const normalized = asString$
|
|
45979
|
+
const normalized = asString$2(value);
|
|
45959
45980
|
if (!normalized) return null;
|
|
45960
45981
|
const parsed = Date.parse(normalized);
|
|
45961
45982
|
return Number.isNaN(parsed) ? null : new Date(parsed).toISOString();
|
|
@@ -45965,7 +45986,7 @@ function normalizeStringArray(value) {
|
|
|
45965
45986
|
const result = [];
|
|
45966
45987
|
const seen = /* @__PURE__ */ new Set();
|
|
45967
45988
|
for (const entry of input) {
|
|
45968
|
-
const normalized = asString$
|
|
45989
|
+
const normalized = asString$2(entry);
|
|
45969
45990
|
if (!normalized || seen.has(normalized)) continue;
|
|
45970
45991
|
seen.add(normalized);
|
|
45971
45992
|
result.push(normalized);
|
|
@@ -45973,11 +45994,11 @@ function normalizeStringArray(value) {
|
|
|
45973
45994
|
return result;
|
|
45974
45995
|
}
|
|
45975
45996
|
function normalizeReasoningEffort(value) {
|
|
45976
|
-
const normalized = asString$
|
|
45997
|
+
const normalized = asString$2(value)?.toLowerCase() ?? null;
|
|
45977
45998
|
return normalized && normalized.length > 0 ? normalized : null;
|
|
45978
45999
|
}
|
|
45979
46000
|
function normalizeServiceTier(value) {
|
|
45980
|
-
const normalized = asString$
|
|
46001
|
+
const normalized = asString$2(value)?.toLowerCase() ?? null;
|
|
45981
46002
|
return normalized && normalized.length > 0 ? normalized : null;
|
|
45982
46003
|
}
|
|
45983
46004
|
function normalizeConfiguredAccountPoolModels(value) {
|
|
@@ -46013,7 +46034,7 @@ const SHORTCUT_SETTINGS_KEYS = [
|
|
|
46013
46034
|
];
|
|
46014
46035
|
function normalizeShortcutFields(raw) {
|
|
46015
46036
|
const result = {};
|
|
46016
|
-
for (const key of SHORTCUT_SETTINGS_KEYS) result[key] = asString$
|
|
46037
|
+
for (const key of SHORTCUT_SETTINGS_KEYS) result[key] = asString$2(raw[key]) ?? null;
|
|
46017
46038
|
return result;
|
|
46018
46039
|
}
|
|
46019
46040
|
function normalizeStringArrayField(raw, key) {
|
|
@@ -46078,8 +46099,8 @@ function createDefaultStore() {
|
|
|
46078
46099
|
}
|
|
46079
46100
|
function normalizeApiKeyRecord(id, value) {
|
|
46080
46101
|
const record = isRecord$2(value) ? value : null;
|
|
46081
|
-
const tokenHash = asString$
|
|
46082
|
-
const tokenPreview = asString$
|
|
46102
|
+
const tokenHash = asString$2(record?.tokenHash);
|
|
46103
|
+
const tokenPreview = asString$2(record?.tokenPreview);
|
|
46083
46104
|
const createdAt = normalizeIsoString(record?.createdAt);
|
|
46084
46105
|
if (!tokenHash || !tokenPreview || !createdAt) return null;
|
|
46085
46106
|
return {
|
|
@@ -46093,25 +46114,25 @@ function normalizeApiKeyRecord(id, value) {
|
|
|
46093
46114
|
}
|
|
46094
46115
|
function normalizeLegacySessionRecord(id, value) {
|
|
46095
46116
|
const record = isRecord$2(value) ? value : null;
|
|
46096
|
-
const profileName = asString$
|
|
46097
|
-
const threadId = asString$
|
|
46117
|
+
const profileName = asString$2(record?.profileName);
|
|
46118
|
+
const threadId = asString$2(record?.threadId);
|
|
46098
46119
|
const createdAt = normalizeIsoString(record?.createdAt);
|
|
46099
46120
|
const lastUsedAt = normalizeIsoString(record?.lastUsedAt);
|
|
46100
46121
|
if (!profileName || !threadId || !createdAt || !lastUsedAt) return null;
|
|
46101
46122
|
return {
|
|
46102
46123
|
id,
|
|
46103
46124
|
affinityKind: normalizeLegacyAffinityKind(record?.affinityKind),
|
|
46104
|
-
affinityKey: asString$
|
|
46125
|
+
affinityKey: asString$2(record?.affinityKey),
|
|
46105
46126
|
profileName,
|
|
46106
46127
|
threadId,
|
|
46107
|
-
providerThreadId: asString$
|
|
46108
|
-
model: asString$
|
|
46128
|
+
providerThreadId: asString$2(record?.providerThreadId),
|
|
46129
|
+
model: asString$2(record?.model),
|
|
46109
46130
|
status: normalizeSessionStatus(record?.status),
|
|
46110
|
-
lastError: asString$
|
|
46131
|
+
lastError: asString$2(record?.lastError),
|
|
46111
46132
|
createdAt,
|
|
46112
46133
|
lastUsedAt,
|
|
46113
46134
|
expiresAt: normalizeIsoString(record?.expiresAt),
|
|
46114
|
-
lastResponseId: asString$
|
|
46135
|
+
lastResponseId: asString$2(record?.lastResponseId),
|
|
46115
46136
|
responseIds: normalizeStringArray(record?.responseIds).slice(0, MAX_RESPONSE_IDS_PER_SESSION)
|
|
46116
46137
|
};
|
|
46117
46138
|
}
|
|
@@ -46129,7 +46150,7 @@ function normalizeLegacyStore(value) {
|
|
|
46129
46150
|
}
|
|
46130
46151
|
const responseIndex = {};
|
|
46131
46152
|
for (const [responseId, sessionId] of Object.entries(isRecord$2(record?.responseIndex) ? record.responseIndex : {})) {
|
|
46132
|
-
const normalizedSessionId = asString$
|
|
46153
|
+
const normalizedSessionId = asString$2(sessionId);
|
|
46133
46154
|
if (normalizedSessionId) responseIndex[responseId] = normalizedSessionId;
|
|
46134
46155
|
}
|
|
46135
46156
|
return {
|
|
@@ -46142,58 +46163,58 @@ function normalizeLegacyStore(value) {
|
|
|
46142
46163
|
}
|
|
46143
46164
|
function normalizeTranscriptEntry(value) {
|
|
46144
46165
|
const record = isRecord$2(value) ? value : null;
|
|
46145
|
-
const role = asString$
|
|
46166
|
+
const role = asString$2(record?.role);
|
|
46146
46167
|
const createdAt = normalizeIsoString(record?.createdAt);
|
|
46147
46168
|
if (role !== "user" && role !== "assistant" || !createdAt) return null;
|
|
46148
46169
|
return {
|
|
46149
46170
|
role,
|
|
46150
|
-
text: asString$
|
|
46171
|
+
text: asString$2(record?.text),
|
|
46151
46172
|
images: normalizeStringArray(record?.images),
|
|
46152
46173
|
createdAt
|
|
46153
46174
|
};
|
|
46154
46175
|
}
|
|
46155
46176
|
function normalizeSessionRecord(id, value) {
|
|
46156
46177
|
const record = isRecord$2(value) ? value : null;
|
|
46157
|
-
const activeSegmentId = asString$
|
|
46178
|
+
const activeSegmentId = asString$2(record?.activeSegmentId);
|
|
46158
46179
|
const createdAt = normalizeIsoString(record?.createdAt);
|
|
46159
46180
|
const lastUsedAt = normalizeIsoString(record?.lastUsedAt);
|
|
46160
46181
|
if (!activeSegmentId || !createdAt || !lastUsedAt) return null;
|
|
46161
46182
|
const transcript = Array.isArray(record?.transcript) ? record.transcript.map(normalizeTranscriptEntry).filter((entry) => entry !== null) : [];
|
|
46162
|
-
const legacyExposedModel = asString$
|
|
46183
|
+
const legacyExposedModel = asString$2(record?.exposedModel);
|
|
46163
46184
|
const parsedLegacyExposedModel = legacyExposedModel ? parseAccountPoolReasoningVariantModelId(legacyExposedModel) : null;
|
|
46164
46185
|
const forcedServiceTier = normalizeServiceTier(record?.forcedServiceTier);
|
|
46165
46186
|
const forcedReasoningEffort = normalizeReasoningEffort(record?.forcedReasoningEffort) ?? parsedLegacyExposedModel?.reasoningEffort ?? null;
|
|
46166
46187
|
return {
|
|
46167
46188
|
id,
|
|
46168
46189
|
affinityKind: normalizeSessionAffinityKind(record?.affinityKind),
|
|
46169
|
-
affinityKey: asString$
|
|
46190
|
+
affinityKey: asString$2(record?.affinityKey),
|
|
46170
46191
|
activeSegmentId,
|
|
46171
46192
|
segmentIds: normalizeStringArray(record?.segmentIds),
|
|
46172
|
-
model: asString$
|
|
46193
|
+
model: asString$2(record?.model),
|
|
46173
46194
|
exposedModel: parsedLegacyExposedModel ? buildAccountPoolVariantModelId({
|
|
46174
46195
|
modelId: parsedLegacyExposedModel.modelId,
|
|
46175
46196
|
reasoningEffort: parsedLegacyExposedModel.reasoningEffort,
|
|
46176
46197
|
fastMode: forcedServiceTier === "fast"
|
|
46177
|
-
}) : legacyExposedModel ?? asString$
|
|
46198
|
+
}) : legacyExposedModel ?? asString$2(record?.model),
|
|
46178
46199
|
forcedReasoningEffort,
|
|
46179
46200
|
forcedServiceTier,
|
|
46180
46201
|
status: normalizeSessionStatus(record?.status),
|
|
46181
|
-
lastError: asString$
|
|
46202
|
+
lastError: asString$2(record?.lastError),
|
|
46182
46203
|
createdAt,
|
|
46183
46204
|
lastUsedAt,
|
|
46184
46205
|
expiresAt: normalizeIsoString(record?.expiresAt),
|
|
46185
|
-
lastResponseId: asString$
|
|
46206
|
+
lastResponseId: asString$2(record?.lastResponseId),
|
|
46186
46207
|
responseIds: normalizeStringArray(record?.responseIds).slice(0, MAX_RESPONSE_IDS_PER_SESSION),
|
|
46187
46208
|
rolloverCount: asNumber$1(record?.rolloverCount) ?? 0,
|
|
46188
|
-
lastRolloverReason: asString$
|
|
46209
|
+
lastRolloverReason: asString$2(record?.lastRolloverReason),
|
|
46189
46210
|
transcript: transcript.slice(-MAX_TRANSCRIPT_ENTRIES_PER_SESSION)
|
|
46190
46211
|
};
|
|
46191
46212
|
}
|
|
46192
46213
|
function normalizeSegmentRecord(id, value) {
|
|
46193
46214
|
const record = isRecord$2(value) ? value : null;
|
|
46194
|
-
const sessionId = asString$
|
|
46195
|
-
const profileName = asString$
|
|
46196
|
-
const threadId = asString$
|
|
46215
|
+
const sessionId = asString$2(record?.sessionId);
|
|
46216
|
+
const profileName = asString$2(record?.profileName);
|
|
46217
|
+
const threadId = asString$2(record?.threadId);
|
|
46197
46218
|
const createdAt = normalizeIsoString(record?.createdAt);
|
|
46198
46219
|
const lastUsedAt = normalizeIsoString(record?.lastUsedAt);
|
|
46199
46220
|
if (!sessionId || !profileName || !threadId || !createdAt || !lastUsedAt) return null;
|
|
@@ -46202,11 +46223,11 @@ function normalizeSegmentRecord(id, value) {
|
|
|
46202
46223
|
sessionId,
|
|
46203
46224
|
profileName,
|
|
46204
46225
|
threadId,
|
|
46205
|
-
providerThreadId: asString$
|
|
46226
|
+
providerThreadId: asString$2(record?.providerThreadId),
|
|
46206
46227
|
createdAt,
|
|
46207
46228
|
lastUsedAt,
|
|
46208
46229
|
closedAt: normalizeIsoString(record?.closedAt),
|
|
46209
|
-
closeReason: asString$
|
|
46230
|
+
closeReason: asString$2(record?.closeReason),
|
|
46210
46231
|
failureClass: normalizeFailureClass(record?.failureClass)
|
|
46211
46232
|
};
|
|
46212
46233
|
}
|
|
@@ -46216,13 +46237,13 @@ function normalizeProfileStateRecord(value) {
|
|
|
46216
46237
|
cooldownUntil: normalizeIsoString(record?.cooldownUntil),
|
|
46217
46238
|
lastFailureClass: normalizeFailureClass(record?.lastFailureClass),
|
|
46218
46239
|
lastFailureAt: normalizeIsoString(record?.lastFailureAt),
|
|
46219
|
-
lastFailureMessage: asString$
|
|
46240
|
+
lastFailureMessage: asString$2(record?.lastFailureMessage)
|
|
46220
46241
|
};
|
|
46221
46242
|
}
|
|
46222
46243
|
function normalizeResponseIndexRecord(value) {
|
|
46223
46244
|
const record = isRecord$2(value) ? value : null;
|
|
46224
|
-
const sessionId = asString$
|
|
46225
|
-
const segmentId = asString$
|
|
46245
|
+
const sessionId = asString$2(record?.sessionId);
|
|
46246
|
+
const segmentId = asString$2(record?.segmentId);
|
|
46226
46247
|
const createdAt = normalizeIsoString(record?.createdAt) ?? (/* @__PURE__ */ new Date(0)).toISOString();
|
|
46227
46248
|
if (!sessionId || !segmentId) return null;
|
|
46228
46249
|
return {
|
|
@@ -46250,7 +46271,7 @@ function normalizeStore(value) {
|
|
|
46250
46271
|
}
|
|
46251
46272
|
const profilesByName = {};
|
|
46252
46273
|
for (const [name, profileValue] of Object.entries(isRecord$2(record?.profilesByName) ? record.profilesByName : {})) {
|
|
46253
|
-
const normalizedName = asString$
|
|
46274
|
+
const normalizedName = asString$2(name);
|
|
46254
46275
|
if (!normalizedName) continue;
|
|
46255
46276
|
profilesByName[normalizedName] = normalizeProfileStateRecord(profileValue);
|
|
46256
46277
|
}
|
|
@@ -46382,8 +46403,8 @@ function extractTextAndImages(value) {
|
|
|
46382
46403
|
};
|
|
46383
46404
|
const record = isRecord$2(value) ? value : null;
|
|
46384
46405
|
const arrayValue = Array.isArray(value) ? value : Array.isArray(record?.content) ? record?.content : null;
|
|
46385
|
-
const directText = asString$
|
|
46386
|
-
const directImage = asString$
|
|
46406
|
+
const directText = asString$2(record?.text) ?? asString$2(record?.content);
|
|
46407
|
+
const directImage = asString$2(record?.image_url) ?? asString$2(record?.url) ?? asString$2(record?.imageUrl);
|
|
46387
46408
|
if (!arrayValue) return {
|
|
46388
46409
|
text: directText,
|
|
46389
46410
|
images: directImage ? [directImage] : []
|
|
@@ -46397,9 +46418,9 @@ function extractTextAndImages(value) {
|
|
|
46397
46418
|
}
|
|
46398
46419
|
const part = isRecord$2(entry) ? entry : null;
|
|
46399
46420
|
if (!part) continue;
|
|
46400
|
-
const partType = asString$
|
|
46401
|
-
const text = asString$
|
|
46402
|
-
const image = asString$
|
|
46421
|
+
const partType = asString$2(part.type) ?? "text";
|
|
46422
|
+
const text = asString$2(part.text) ?? asString$2(part.content) ?? asString$2(part.value);
|
|
46423
|
+
const image = asString$2(part.image_url) ?? asString$2(part.url) ?? asString$2(part.imageUrl);
|
|
46403
46424
|
if ((partType === "text" || partType === "input_text" || partType === "output_text" || partType === "refusal") && text) {
|
|
46404
46425
|
texts.push(text);
|
|
46405
46426
|
continue;
|
|
@@ -46412,7 +46433,7 @@ function extractTextAndImages(value) {
|
|
|
46412
46433
|
};
|
|
46413
46434
|
}
|
|
46414
46435
|
function assistantLabel(value) {
|
|
46415
|
-
const normalized = asString$
|
|
46436
|
+
const normalized = asString$2(value)?.toLowerCase();
|
|
46416
46437
|
return normalized && normalized.length > 0 ? normalized : null;
|
|
46417
46438
|
}
|
|
46418
46439
|
function isAssistantLikeRecord(value) {
|
|
@@ -46432,8 +46453,8 @@ function collectTextFragments(value, depth = 0) {
|
|
|
46432
46453
|
const record = isRecord$2(value) ? value : null;
|
|
46433
46454
|
if (!record) return [];
|
|
46434
46455
|
return [
|
|
46435
|
-
asString$
|
|
46436
|
-
asString$
|
|
46456
|
+
asString$2(record.text),
|
|
46457
|
+
asString$2(record.output_text),
|
|
46437
46458
|
...collectTextFragments(record.content, depth + 1),
|
|
46438
46459
|
...collectTextFragments(record.parts, depth + 1),
|
|
46439
46460
|
...collectTextFragments(record.output, depth + 1),
|
|
@@ -46467,7 +46488,7 @@ function extractAssistantTextSnapshot(value, depth = 0) {
|
|
|
46467
46488
|
}
|
|
46468
46489
|
function prepareTurnInput(body, fallbackModel) {
|
|
46469
46490
|
const input = body.input;
|
|
46470
|
-
const instructions = asString$
|
|
46491
|
+
const instructions = asString$2(body.instructions);
|
|
46471
46492
|
const messages = [];
|
|
46472
46493
|
const looseImages = [];
|
|
46473
46494
|
let looseText = null;
|
|
@@ -46479,8 +46500,8 @@ function prepareTurnInput(body, fallbackModel) {
|
|
|
46479
46500
|
}
|
|
46480
46501
|
const record = isRecord$2(entry) ? entry : null;
|
|
46481
46502
|
if (!record) continue;
|
|
46482
|
-
const entryRole = asString$
|
|
46483
|
-
const entryType = asString$
|
|
46503
|
+
const entryRole = asString$2(record.role);
|
|
46504
|
+
const entryType = asString$2(record.type);
|
|
46484
46505
|
if (entryRole || entryType === "message") {
|
|
46485
46506
|
const { text, images } = extractTextAndImages(record.content ?? record);
|
|
46486
46507
|
messages.push({
|
|
@@ -46522,8 +46543,8 @@ function prepareTurnInput(body, fallbackModel) {
|
|
|
46522
46543
|
if (instructions) promptParts.push(`Instructions:\n${instructions}`);
|
|
46523
46544
|
if (transcriptParts.length > 0) promptParts.push(`Conversation so far:\n${transcriptParts.join("\n\n")}`);
|
|
46524
46545
|
if (finalPrompt) promptParts.push(finalPrompt);
|
|
46525
|
-
const normalizedModel = normalizeModelSlug(asString$
|
|
46526
|
-
const effort = asString$
|
|
46546
|
+
const normalizedModel = normalizeModelSlug(asString$2(body.model) ?? fallbackModel, "codex") ?? fallbackModel;
|
|
46547
|
+
const effort = asString$2((isRecord$2(body.reasoning) ? body.reasoning : null)?.effort) ?? asString$2(body.effort) ?? void 0;
|
|
46527
46548
|
return {
|
|
46528
46549
|
prompt: promptParts.join("\n\n").trim() || null,
|
|
46529
46550
|
attachments: [...looseImages, ...finalUserImages].map((url) => ({
|
|
@@ -46532,27 +46553,27 @@ function prepareTurnInput(body, fallbackModel) {
|
|
|
46532
46553
|
})),
|
|
46533
46554
|
model: normalizedModel,
|
|
46534
46555
|
effort,
|
|
46535
|
-
serviceTier: asString$
|
|
46556
|
+
serviceTier: asString$2(body.service_tier),
|
|
46536
46557
|
userText: finalPrompt ?? looseText,
|
|
46537
46558
|
userImages: [...looseImages, ...finalUserImages],
|
|
46538
46559
|
includesConversationHistory: transcriptParts.length > 0
|
|
46539
46560
|
};
|
|
46540
46561
|
}
|
|
46541
46562
|
function resolveResponseContinuationKey(body, headers) {
|
|
46542
|
-
const previousResponseId = asString$
|
|
46543
|
-
const conversation = asString$
|
|
46563
|
+
const previousResponseId = asString$2(body.previous_response_id);
|
|
46564
|
+
const conversation = asString$2(body.conversation) ?? (isRecord$2(body.conversation) ? asString$2(body.conversation.id) : null);
|
|
46544
46565
|
if (conversation && previousResponseId) throw new AccountPoolRequestError({
|
|
46545
46566
|
statusCode: 400,
|
|
46546
46567
|
code: "invalid_request_error",
|
|
46547
46568
|
message: "Provide either 'conversation' or 'previous_response_id', not both."
|
|
46548
46569
|
});
|
|
46549
|
-
const durableKey = asString$
|
|
46570
|
+
const durableKey = asString$2(headers["x-codex-turn-state"]) ?? asString$2(body.session_id) ?? asString$2(headers["x-session-id"]) ?? asString$2(headers["x-codex-session-id"]) ?? asString$2(headers["x-conversation-id"]) ?? conversation;
|
|
46550
46571
|
if (durableKey) return {
|
|
46551
46572
|
previousResponseId,
|
|
46552
46573
|
affinityKind: "pool_session",
|
|
46553
46574
|
affinityKey: durableKey
|
|
46554
46575
|
};
|
|
46555
|
-
const promptCacheKey = asString$
|
|
46576
|
+
const promptCacheKey = asString$2(body.prompt_cache_key);
|
|
46556
46577
|
if (promptCacheKey) return {
|
|
46557
46578
|
previousResponseId,
|
|
46558
46579
|
affinityKind: "prompt_cache",
|
|
@@ -46629,48 +46650,25 @@ function buildAccountPoolExposedModel(id) {
|
|
|
46629
46650
|
const normalizedId = normalizeModelSlug(id, "codex") ?? id.trim();
|
|
46630
46651
|
if (normalizedId.length === 0) return null;
|
|
46631
46652
|
const architecture = inferAccountPoolModelArchitecture(normalizedId);
|
|
46632
|
-
const
|
|
46633
|
-
if (lowerId.startsWith("gpt-5.4-mini")) return {
|
|
46634
|
-
id: normalizedId,
|
|
46635
|
-
actualModelId: normalizedId,
|
|
46636
|
-
name: "GPT-5.4 Mini",
|
|
46637
|
-
description: "GPT-5.4 Mini exposed through the local accounts pool.",
|
|
46638
|
-
architecture,
|
|
46639
|
-
supportedParameters: ACCOUNT_POOL_MODEL_SUPPORTED_PARAMETERS,
|
|
46640
|
-
forcedReasoningEffort: null,
|
|
46641
|
-
forcedServiceTier: null
|
|
46642
|
-
};
|
|
46643
|
-
if (lowerId.startsWith("gpt-5.4-nano")) return {
|
|
46644
|
-
id: normalizedId,
|
|
46645
|
-
actualModelId: normalizedId,
|
|
46646
|
-
name: "GPT-5.4 Nano",
|
|
46647
|
-
description: "GPT-5.4 Nano exposed through the local accounts pool.",
|
|
46648
|
-
architecture,
|
|
46649
|
-
supportedParameters: ACCOUNT_POOL_MODEL_SUPPORTED_PARAMETERS,
|
|
46650
|
-
forcedReasoningEffort: null,
|
|
46651
|
-
forcedServiceTier: null
|
|
46652
|
-
};
|
|
46653
|
-
if (lowerId.startsWith("gpt-5.4-pro")) return {
|
|
46654
|
-
id: normalizedId,
|
|
46655
|
-
actualModelId: normalizedId,
|
|
46656
|
-
name: "GPT-5.4 Pro",
|
|
46657
|
-
description: "GPT-5.4 Pro exposed through the local accounts pool.",
|
|
46658
|
-
architecture,
|
|
46659
|
-
supportedParameters: ACCOUNT_POOL_MODEL_SUPPORTED_PARAMETERS,
|
|
46660
|
-
forcedReasoningEffort: null,
|
|
46661
|
-
forcedServiceTier: null
|
|
46662
|
-
};
|
|
46653
|
+
const displayName = formatAccountPoolModelName(normalizedId);
|
|
46663
46654
|
return {
|
|
46664
46655
|
id: normalizedId,
|
|
46665
46656
|
actualModelId: normalizedId,
|
|
46666
|
-
name:
|
|
46667
|
-
description:
|
|
46657
|
+
name: displayName ?? normalizedId,
|
|
46658
|
+
description: displayName ? `${displayName} exposed through the local accounts pool.` : `${normalizedId} exposed through the local accounts pool.`,
|
|
46668
46659
|
architecture,
|
|
46669
46660
|
supportedParameters: ACCOUNT_POOL_MODEL_SUPPORTED_PARAMETERS,
|
|
46670
46661
|
forcedReasoningEffort: null,
|
|
46671
46662
|
forcedServiceTier: null
|
|
46672
46663
|
};
|
|
46673
46664
|
}
|
|
46665
|
+
function formatAccountPoolModelName(modelId) {
|
|
46666
|
+
const match = /^gpt-(\d+(?:\.\d+)?)(?:-(mini|nano|pro))?$/i.exec(modelId.trim());
|
|
46667
|
+
if (!match) return null;
|
|
46668
|
+
const variant = match[2];
|
|
46669
|
+
const suffix = variant ? ` ${variant.charAt(0).toUpperCase()}${variant.slice(1)}` : "";
|
|
46670
|
+
return `GPT-${match[1]}${suffix}`;
|
|
46671
|
+
}
|
|
46674
46672
|
function inferAccountPoolModelArchitecture(modelId) {
|
|
46675
46673
|
return modelId.trim().toLowerCase().startsWith("gpt-5") ? ACCOUNT_POOL_MULTIMODAL_ARCHITECTURE : ACCOUNT_POOL_TEXT_ONLY_ARCHITECTURE;
|
|
46676
46674
|
}
|
|
@@ -47030,7 +47028,7 @@ var LocalAccountPool = class LocalAccountPool {
|
|
|
47030
47028
|
const responseItemId = `msg_${responseId}`;
|
|
47031
47029
|
let streamOpened = false;
|
|
47032
47030
|
let sequenceNumber = 1;
|
|
47033
|
-
const requestedModel = asString$
|
|
47031
|
+
const requestedModel = asString$2(body.model);
|
|
47034
47032
|
const defaultSelection = this.defaultModelSelection(settings);
|
|
47035
47033
|
const requestedSelection = requestedModel ? this.resolveConfiguredModelSelection(settings, requestedModel) : null;
|
|
47036
47034
|
let responseModel = requestedModel ?? defaultSelection.exposedModelId;
|
|
@@ -47778,8 +47776,8 @@ var LocalAccountPool = class LocalAccountPool {
|
|
|
47778
47776
|
if (event.method === "turn/completed") {
|
|
47779
47777
|
const payload = isRecord$2(event.payload) ? event.payload : null;
|
|
47780
47778
|
const turn = isRecord$2(payload?.turn) ? payload?.turn : payload;
|
|
47781
|
-
const turnStatus = asString$
|
|
47782
|
-
const errorMessage = asString$
|
|
47779
|
+
const turnStatus = asString$2(turn?.status);
|
|
47780
|
+
const errorMessage = asString$2(isRecord$2(turn?.error) ? turn.error.message : void 0) ?? asString$2(payload?.message);
|
|
47783
47781
|
if (turnStatus === "failed" || errorMessage) {
|
|
47784
47782
|
observer.done = true;
|
|
47785
47783
|
observer.reject(new Error(errorMessage ?? "Provider turn failed."));
|
|
@@ -47829,7 +47827,7 @@ var LocalAccountPool = class LocalAccountPool {
|
|
|
47829
47827
|
}
|
|
47830
47828
|
extractEventErrorMessage(payload) {
|
|
47831
47829
|
if (!isRecord$2(payload)) return null;
|
|
47832
|
-
return asString$
|
|
47830
|
+
return asString$2((isRecord$2(payload.error) ? payload.error : payload).message) ?? null;
|
|
47833
47831
|
}
|
|
47834
47832
|
readLiveProviderThreadId(threadId) {
|
|
47835
47833
|
const active = this.manager.listSessions().find((session) => session.threadId === ThreadId.makeUnsafe(threadId));
|
|
@@ -47837,7 +47835,7 @@ var LocalAccountPool = class LocalAccountPool {
|
|
|
47837
47835
|
}
|
|
47838
47836
|
readResumeCursorThreadId(resumeCursor) {
|
|
47839
47837
|
if (!isRecord$2(resumeCursor)) return null;
|
|
47840
|
-
return asString$
|
|
47838
|
+
return asString$2(resumeCursor.threadId);
|
|
47841
47839
|
}
|
|
47842
47840
|
async closeLiveSegment(segmentId) {
|
|
47843
47841
|
const liveSegment = this.liveSegments.get(segmentId);
|
|
@@ -48029,13 +48027,13 @@ var LocalAccountPool = class LocalAccountPool {
|
|
|
48029
48027
|
if (this.settingsCache && this.settingsCache.expiresAt > now) return this.settingsCache.settings;
|
|
48030
48028
|
const raw = await readAppSettings();
|
|
48031
48029
|
const settings = {
|
|
48032
|
-
codexBin: asString$
|
|
48033
|
-
codexArgs: asString$
|
|
48034
|
-
codexHome: asString$
|
|
48030
|
+
codexBin: asString$2(raw.codexBin) ?? null,
|
|
48031
|
+
codexArgs: asString$2(raw.codexArgs) ?? null,
|
|
48032
|
+
codexHome: asString$2(raw.codexHome) ?? null,
|
|
48035
48033
|
automaticAppUpdateChecksEnabled: raw.automaticAppUpdateChecksEnabled !== false,
|
|
48036
48034
|
keepAppRunningAfterWindowClose: raw.keepAppRunningAfterWindowClose === true,
|
|
48037
48035
|
telegramBridgeEnabled: raw.telegramBridgeEnabled === true,
|
|
48038
|
-
telegramBotToken: asString$
|
|
48036
|
+
telegramBotToken: asString$2(raw.telegramBotToken) ?? null,
|
|
48039
48037
|
telegramAllowedChatIds: normalizeStringArrayField(raw, "telegramAllowedChatIds"),
|
|
48040
48038
|
defaultAccessMode: "current",
|
|
48041
48039
|
reviewDeliveryMode: "inline",
|
|
@@ -48046,6 +48044,7 @@ var LocalAccountPool = class LocalAccountPool {
|
|
|
48046
48044
|
projectsDefaultThreadEnvMode: raw.projectsDefaultThreadEnvMode === "worktree" ? "worktree" : "local",
|
|
48047
48045
|
projectsAssistantStreamingEnabled: false,
|
|
48048
48046
|
projectsConfirmThreadDelete: true,
|
|
48047
|
+
projectsAddProjectBaseDirectory: asString$2(raw.projectsAddProjectBaseDirectory) ?? null,
|
|
48049
48048
|
projectsCustomCodexModels: normalizeStringArrayField(raw, "projectsCustomCodexModels"),
|
|
48050
48049
|
...normalizeAccountPoolFields(raw)
|
|
48051
48050
|
};
|
|
@@ -48139,7 +48138,8 @@ const FAVICON_CANDIDATES = [
|
|
|
48139
48138
|
"assets/icon.svg",
|
|
48140
48139
|
"assets/icon.png",
|
|
48141
48140
|
"assets/logo.svg",
|
|
48142
|
-
"assets/logo.png"
|
|
48141
|
+
"assets/logo.png",
|
|
48142
|
+
".idea/icon.svg"
|
|
48143
48143
|
];
|
|
48144
48144
|
const ICON_SOURCE_FILES = [
|
|
48145
48145
|
"index.html",
|
|
@@ -49455,6 +49455,8 @@ const COMMAND_TIMEOUT_MS = 5e3;
|
|
|
49455
49455
|
const AUTH_STATUS_TIMEOUT_MS = 8e3;
|
|
49456
49456
|
const APP_SERVER_TIMEOUT_MS = 8e3;
|
|
49457
49457
|
const MODEL_LIST_TIMEOUT_MS = 5e3;
|
|
49458
|
+
const CODEX_NPM_PACKAGE = "@openai/codex";
|
|
49459
|
+
const CODEX_INSTALL_TIMEOUT_MS = 12e4;
|
|
49458
49460
|
function tokenizeArgs(rawArgs) {
|
|
49459
49461
|
const input = rawArgs?.trim();
|
|
49460
49462
|
if (!input) return [];
|
|
@@ -49542,16 +49544,26 @@ function runCommand(command, args, options) {
|
|
|
49542
49544
|
globalThis.clearTimeout(timeout);
|
|
49543
49545
|
reject(error);
|
|
49544
49546
|
});
|
|
49545
|
-
child.on("close", (code) => {
|
|
49547
|
+
child.on("close", (code, signal) => {
|
|
49546
49548
|
globalThis.clearTimeout(timeout);
|
|
49547
49549
|
resolve({
|
|
49548
49550
|
stdout,
|
|
49549
49551
|
stderr,
|
|
49550
|
-
code
|
|
49552
|
+
code,
|
|
49553
|
+
signal
|
|
49551
49554
|
});
|
|
49552
49555
|
});
|
|
49553
49556
|
});
|
|
49554
49557
|
}
|
|
49558
|
+
function describeCommandFailure(result, fallback) {
|
|
49559
|
+
const stderr = result.stderr.trim();
|
|
49560
|
+
if (stderr) return stderr;
|
|
49561
|
+
const stdout = result.stdout.trim();
|
|
49562
|
+
if (stdout) return stdout;
|
|
49563
|
+
if (result.signal) return `Codex CLI was found but was terminated by ${result.signal}.`;
|
|
49564
|
+
if (result.code !== null) return `Codex CLI exited with code ${result.code}.`;
|
|
49565
|
+
return fallback;
|
|
49566
|
+
}
|
|
49555
49567
|
function coerceModelListItems(response) {
|
|
49556
49568
|
if (!response || typeof response !== "object") return [];
|
|
49557
49569
|
const record = response;
|
|
@@ -49593,6 +49605,26 @@ function parseModelListResponse(response) {
|
|
|
49593
49605
|
};
|
|
49594
49606
|
}).filter((model) => model !== null);
|
|
49595
49607
|
}
|
|
49608
|
+
function asRecord$1(value) {
|
|
49609
|
+
return value && typeof value === "object" ? value : null;
|
|
49610
|
+
}
|
|
49611
|
+
function asString$1(value) {
|
|
49612
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
49613
|
+
}
|
|
49614
|
+
function formatCodexAccountLabel(response) {
|
|
49615
|
+
const record = asRecord$1(response);
|
|
49616
|
+
const account = asRecord$1(record?.account) ?? record;
|
|
49617
|
+
if (!account) return null;
|
|
49618
|
+
const type = asString$1(account.type);
|
|
49619
|
+
const email = asString$1(account.email) ?? asString$1(account.login) ?? asString$1(account.accountEmail) ?? asString$1(account.account_email);
|
|
49620
|
+
const plan = asString$1(account.planType) ?? asString$1(account.plan_type) ?? asString$1(account.plan);
|
|
49621
|
+
if (email && plan) return `${email} (${plan})`;
|
|
49622
|
+
if (email) return email;
|
|
49623
|
+
if (type === "apiKey") return "API key";
|
|
49624
|
+
if (type === "chatgpt" && plan) return `ChatGPT ${plan}`;
|
|
49625
|
+
if (type === "chatgpt") return "ChatGPT";
|
|
49626
|
+
return null;
|
|
49627
|
+
}
|
|
49596
49628
|
function compareModelsByLatest(left, right) {
|
|
49597
49629
|
const parseVersionScore = (model) => {
|
|
49598
49630
|
const match = /^gpt-(\d+)(?:\.(\d+))?(?:\.(\d+))?/i.exec(model.trim());
|
|
@@ -49710,10 +49742,13 @@ async function inspectAppServer(input) {
|
|
|
49710
49742
|
params: {}
|
|
49711
49743
|
})}\n`);
|
|
49712
49744
|
try {
|
|
49745
|
+
const modelListResponse = await request("model/list", {}, MODEL_LIST_TIMEOUT_MS);
|
|
49746
|
+
const accountResponse = await request("account/read", {}, MODEL_LIST_TIMEOUT_MS).catch(() => null);
|
|
49713
49747
|
return {
|
|
49714
49748
|
appServerOk: true,
|
|
49715
|
-
models: parseModelListResponse(
|
|
49749
|
+
models: parseModelListResponse(modelListResponse).sort(compareModelsByLatest),
|
|
49716
49750
|
modelsError: null,
|
|
49751
|
+
accountLabel: formatCodexAccountLabel(accountResponse),
|
|
49717
49752
|
details: null
|
|
49718
49753
|
};
|
|
49719
49754
|
} catch (error) {
|
|
@@ -49721,6 +49756,7 @@ async function inspectAppServer(input) {
|
|
|
49721
49756
|
appServerOk: true,
|
|
49722
49757
|
models: [],
|
|
49723
49758
|
modelsError: error instanceof Error ? error.message : "Unable to read model list.",
|
|
49759
|
+
accountLabel: null,
|
|
49724
49760
|
details: stderr.trim() || null
|
|
49725
49761
|
};
|
|
49726
49762
|
}
|
|
@@ -49729,6 +49765,7 @@ async function inspectAppServer(input) {
|
|
|
49729
49765
|
appServerOk: false,
|
|
49730
49766
|
models: [],
|
|
49731
49767
|
modelsError: null,
|
|
49768
|
+
accountLabel: null,
|
|
49732
49769
|
details: error instanceof Error ? error.message : stderr.trim() || "Unable to start codex app-server."
|
|
49733
49770
|
};
|
|
49734
49771
|
} finally {
|
|
@@ -49754,7 +49791,7 @@ async function inspectCodexRuntime(input) {
|
|
|
49754
49791
|
});
|
|
49755
49792
|
const parsedVersion = parseCodexCliVersion(`${versionResult.stdout}\n${versionResult.stderr}`);
|
|
49756
49793
|
version = parsedVersion ?? (versionResult.stdout.trim() || null);
|
|
49757
|
-
if (versionResult.code !== 0) details =
|
|
49794
|
+
if (versionResult.code !== 0) details = describeCommandFailure(versionResult, "Codex CLI failed to run `--version`.");
|
|
49758
49795
|
else if (parsedVersion && !isCodexCliVersionSupported(parsedVersion)) details = formatCodexCliUpgradeMessage(parsedVersion);
|
|
49759
49796
|
} catch (error) {
|
|
49760
49797
|
details = error instanceof Error ? error.message : "Unable to run Codex CLI.";
|
|
@@ -49799,6 +49836,7 @@ async function inspectCodexRuntime(input) {
|
|
|
49799
49836
|
appServerOk: false,
|
|
49800
49837
|
models: [],
|
|
49801
49838
|
modelsError: null,
|
|
49839
|
+
accountLabel: null,
|
|
49802
49840
|
details: null
|
|
49803
49841
|
};
|
|
49804
49842
|
return {
|
|
@@ -49809,6 +49847,7 @@ async function inspectCodexRuntime(input) {
|
|
|
49809
49847
|
appServerOk: appServerInspection.appServerOk,
|
|
49810
49848
|
authStatus,
|
|
49811
49849
|
authMessage,
|
|
49850
|
+
accountLabel: appServerInspection.accountLabel,
|
|
49812
49851
|
details: details ?? appServerInspection.details,
|
|
49813
49852
|
path: binaryPath,
|
|
49814
49853
|
nodeOk,
|
|
@@ -49819,6 +49858,39 @@ async function inspectCodexRuntime(input) {
|
|
|
49819
49858
|
modelsError: appServerInspection.modelsError
|
|
49820
49859
|
};
|
|
49821
49860
|
}
|
|
49861
|
+
function compactCommandOutput(output) {
|
|
49862
|
+
const trimmed = output.trim();
|
|
49863
|
+
if (!trimmed) return null;
|
|
49864
|
+
return trimmed.length > 4e3 ? `${trimmed.slice(-4e3)}` : trimmed;
|
|
49865
|
+
}
|
|
49866
|
+
async function updateCodexRuntime() {
|
|
49867
|
+
const beforeVersion = (await inspectCodexRuntime({}).catch(() => null))?.doctor.version ?? null;
|
|
49868
|
+
const result = await runCommand("npm", [
|
|
49869
|
+
"install",
|
|
49870
|
+
"-g",
|
|
49871
|
+
CODEX_NPM_PACKAGE
|
|
49872
|
+
], {
|
|
49873
|
+
timeoutMs: CODEX_INSTALL_TIMEOUT_MS,
|
|
49874
|
+
env: process.env
|
|
49875
|
+
}).catch((error) => ({
|
|
49876
|
+
stdout: "",
|
|
49877
|
+
stderr: error instanceof Error ? error.message : String(error),
|
|
49878
|
+
code: 1
|
|
49879
|
+
}));
|
|
49880
|
+
const afterVersion = (await inspectCodexRuntime({}).catch(() => null))?.doctor.version ?? null;
|
|
49881
|
+
const ok = result.code === 0 && Boolean(afterVersion);
|
|
49882
|
+
const output = compactCommandOutput(`${result.stdout}\n${result.stderr}`);
|
|
49883
|
+
return {
|
|
49884
|
+
ok,
|
|
49885
|
+
method: "npm",
|
|
49886
|
+
package: CODEX_NPM_PACKAGE,
|
|
49887
|
+
beforeVersion,
|
|
49888
|
+
afterVersion,
|
|
49889
|
+
upgraded: Boolean(ok && afterVersion && (!beforeVersion || beforeVersion !== afterVersion)),
|
|
49890
|
+
output,
|
|
49891
|
+
details: ok ? null : output ?? `Failed to run npm install -g ${CODEX_NPM_PACKAGE}.`
|
|
49892
|
+
};
|
|
49893
|
+
}
|
|
49822
49894
|
//#endregion
|
|
49823
49895
|
//#region src/agentChat.ts
|
|
49824
49896
|
const AGENT_CHAT_AGENTS_CONTENT = `# AGENTS.md — Agent
|
|
@@ -52923,6 +52995,7 @@ const createServer = fn(function* () {
|
|
|
52923
52995
|
codexHomePath: runtimeContext.codexHomePath
|
|
52924
52996
|
}));
|
|
52925
52997
|
}
|
|
52998
|
+
case WS_METHODS.codexRuntimeUpdate: return yield* promise(() => updateCodexRuntime());
|
|
52926
52999
|
case WS_METHODS.telegramStatus: return telegramBridge.getStatus();
|
|
52927
53000
|
case WS_METHODS.telegramTestToken: {
|
|
52928
53001
|
const body = stripRequestTag(request.body);
|