t3 0.0.0-alpha.21 → 0.0.0-alpha.22
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/client/apple-touch-icon.png +0 -0
- package/dist/client/apple-touch-icon.png.publish-bak +0 -0
- package/dist/client/assets/{DiffPanel-Zd3inx_c.js → DiffPanel-DKqeIAg6.js} +3 -3
- package/dist/client/assets/{angular-html-DxYQrPFg.js → angular-html-CP4NCBag.js} +1 -1
- package/dist/client/assets/{angular-ts-BpsLjr2u.js → angular-ts--nCabZ6J.js} +1 -1
- package/dist/client/assets/{apl-ChWT0sCb.js → apl-BW0Es-iS.js} +1 -1
- package/dist/client/assets/{astro-CKjqgbtt.js → astro-CwY_yYu9.js} +1 -1
- package/dist/client/assets/{blade-BwMsFYgj.js → blade-BDhtCLqr.js} +1 -1
- package/dist/client/assets/{c-CVXnSkKh.js → c-B8COQ7uM.js} +1 -1
- package/dist/client/assets/{cobol-CB56kk6x.js → cobol-fyV85zwh.js} +1 -1
- package/dist/client/assets/{coffee-BFEV7ztW.js → coffee-DJWwWS5q.js} +1 -1
- package/dist/client/assets/{cpp-DZ1GqnaI.js → cpp-CCk8ETRL.js} +1 -1
- package/dist/client/assets/{crystal-CWwUkqyl.js → crystal-Dpf2FWT2.js} +1 -1
- package/dist/client/assets/{css-BcxH_i76.js → css-C0AKsvZ0.js} +1 -1
- package/dist/client/assets/{edge-CWqcq4ts.js → edge-CwP5lUVh.js} +1 -1
- package/dist/client/assets/{elixir-CmLXNmp_.js → elixir-BDgIV7rx.js} +1 -1
- package/dist/client/assets/{elm-BcNxEQlu.js → elm-C7YTEajK.js} +1 -1
- package/dist/client/assets/{erb-B_XSTyet.js → erb-v5kZtWQ9.js} +1 -1
- package/dist/client/assets/{git-rebase-ldjjto83.js → git-rebase-TJmTpUNd.js} +1 -1
- package/dist/client/assets/{glimmer-js-exOVwp_W.js → glimmer-js-D5DC1vAI.js} +1 -1
- package/dist/client/assets/{glimmer-ts-CFhH3_vL.js → glimmer-ts-j5g3BbMT.js} +1 -1
- package/dist/client/assets/{glsl-DOTJVGJy.js → glsl-BSxMNlae.js} +1 -1
- package/dist/client/assets/{graphql-CWnuVw-l.js → graphql-B2QsKKSk.js} +1 -1
- package/dist/client/assets/{hack-BOYN6JF3.js → hack-wyTNQ9ia.js} +1 -1
- package/dist/client/assets/{haml-C74vX10_.js → haml-CkWSEqef.js} +1 -1
- package/dist/client/assets/{handlebars-CGx2O4by.js → handlebars-gomArnsp.js} +1 -1
- package/dist/client/assets/{html-COcZHORq.js → html-Cb5kzwQ0.js} +1 -1
- package/dist/client/assets/{html-derivative-BtQAEKKr.js → html-derivative-B-F985Ye.js} +1 -1
- package/dist/client/assets/{http-lXBZSfrN.js → http-OunjsWGB.js} +1 -1
- package/dist/client/assets/{hurl-D53Qel1A.js → hurl-D5-3WUV7.js} +1 -1
- package/dist/client/assets/index-BS8l4ttp.css +1 -0
- package/dist/client/assets/index-CDOSnvWn.js +286 -0
- package/dist/client/assets/{java-B7VoXjom.js → java-RRTszf0e.js} +1 -1
- package/dist/client/assets/{javascript-uBE7Rhpg.js → javascript-D82s65Ke.js} +1 -1
- package/dist/client/assets/{jinja-CXVVbzk7.js → jinja-vtJJZW27.js} +1 -1
- package/dist/client/assets/{jison-DD0JiVUm.js → jison-DtzSI3p6.js} +1 -1
- package/dist/client/assets/{json-CBnzVAVO.js → json-BZWMVT1H.js} +1 -1
- package/dist/client/assets/{jsx-KGWSubfF.js → jsx-RQL-S6Se.js} +1 -1
- package/dist/client/assets/{julia-krJAx7yk.js → julia-BlilvCQ6.js} +1 -1
- package/dist/client/assets/{just-siShKR9h.js → just-mbBPwJI-.js} +1 -1
- package/dist/client/assets/{latex-CpMDQqtD.js → latex-Cj3fEkuZ.js} +1 -1
- package/dist/client/assets/{liquid-BDPu6iRZ.js → liquid-LPHrAu3K.js} +1 -1
- package/dist/client/assets/{lua-Dgub3eS0.js → lua-rNOeRHCe.js} +1 -1
- package/dist/client/assets/{marko-BsSYgoyy.js → marko-BBsNvcAO.js} +1 -1
- package/dist/client/assets/{mdc-CYY8fZz1.js → mdc-4OtYS9EG.js} +1 -1
- package/dist/client/assets/{nginx-D7vXpvlC.js → nginx-BjvipNQy.js} +1 -1
- package/dist/client/assets/{nim-BzqPEf8o.js → nim-BiQo6Okc.js} +1 -1
- package/dist/client/assets/{perl-jbJi7e9r.js → perl-HpT2FKFw.js} +1 -1
- package/dist/client/assets/{php-DrTmyQlH.js → php-BhcAN57f.js} +1 -1
- package/dist/client/assets/{pug-VrDNwjQS.js → pug-BIj6Gi4E.js} +1 -1
- package/dist/client/assets/{qml-pal1RGRh.js → qml-BmAdVs1Y.js} +1 -1
- package/dist/client/assets/{r-DN_hXvsQ.js → r-BC-wnvlJ.js} +1 -1
- package/dist/client/assets/{razor-BdGp5QUi.js → razor-3W0dz7V-.js} +1 -1
- package/dist/client/assets/{regexp-CvwKtx9-.js → regexp-CQzmnQ2y.js} +1 -1
- package/dist/client/assets/{rst-CtsdQV9w.js → rst-C3OA9O9i.js} +1 -1
- package/dist/client/assets/{ruby-DOs_Gm7z.js → ruby-BM45701c.js} +1 -1
- package/dist/client/assets/{sas-BLh6SFKC.js → sas-BJMha9fK.js} +1 -1
- package/dist/client/assets/{scss-g3eLeVBg.js → scss-CULcoRNT.js} +1 -1
- package/dist/client/assets/{shellscript-W56gfaew.js → shellscript-DozDNfsB.js} +1 -1
- package/dist/client/assets/{shellsession-BzfuHw4k.js → shellsession-TkdwTEFJ.js} +1 -1
- package/dist/client/assets/{soy-L7m12KRy.js → soy-D6WDzBZG.js} +1 -1
- package/dist/client/assets/{sql-CSo-irVy.js → sql-DTli-5GD.js} +1 -1
- package/dist/client/assets/{stata-CKjVwIqB.js → stata-CZywLgCb.js} +1 -1
- package/dist/client/assets/{surrealql-BAnRQnZB.js → surrealql-DPMnAF9g.js} +1 -1
- package/dist/client/assets/{svelte-bAc_EbvS.js → svelte-uesWQTgs.js} +1 -1
- package/dist/client/assets/{templ-KBL0DPD1.js → templ-BgQoyieQ.js} +1 -1
- package/dist/client/assets/{tex-C4gBNcWM.js → tex-fy-VFvTE.js} +1 -1
- package/dist/client/assets/{ts-tags-BY70bHPR.js → ts-tags-DrcVY2Sg.js} +1 -1
- package/dist/client/assets/{tsx-IbU4Bg1g.js → tsx-GdGQySaV.js} +1 -1
- package/dist/client/assets/{twig-DJkrRgQU.js → twig-Jrz8R_vP.js} +1 -1
- package/dist/client/assets/{typescript-CzJIvBAj.js → typescript-BjqryDaV.js} +1 -1
- package/dist/client/assets/{vue-CeM67yGj.js → vue-D0uU2iT6.js} +1 -1
- package/dist/client/assets/{vue-html-CEwlsyy7.js → vue-html-6wgewjqK.js} +1 -1
- package/dist/client/assets/{vue-vine-CyY76ywE.js → vue-vine-DEIXiZz4.js} +1 -1
- package/dist/client/assets/{xml-BXdNuKec.js → xml-BfWPo8-_.js} +1 -1
- package/dist/client/assets/{xsl-BR83_daW.js → xsl-D48jX_AM.js} +1 -1
- package/dist/client/assets/{yaml-BO3i02Kh.js → yaml-BmrzMxmi.js} +1 -1
- package/dist/client/favicon-16x16.png +0 -0
- package/dist/client/favicon-16x16.png.publish-bak +0 -0
- package/dist/client/favicon-32x32.png +0 -0
- package/dist/client/favicon-32x32.png.publish-bak +0 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/favicon.ico.publish-bak +0 -0
- package/dist/client/index.html +2 -2
- package/dist/index.cjs +102 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +102 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-CK5K88y0.css +0 -1
- package/dist/client/assets/index-D_VBjaZg.js +0 -286
- package/dist/client/favicon.svg +0 -4
package/dist/index.mjs
CHANGED
|
@@ -409,6 +409,18 @@ const ORCHESTRATION_WS_METHODS = {
|
|
|
409
409
|
};
|
|
410
410
|
const ORCHESTRATION_WS_CHANNELS = { domainEvent: "orchestration.domainEvent" };
|
|
411
411
|
const ProviderKind = Schema.Literal("codex");
|
|
412
|
+
const ProviderApprovalPolicy = Schema.Literals([
|
|
413
|
+
"untrusted",
|
|
414
|
+
"on-failure",
|
|
415
|
+
"on-request",
|
|
416
|
+
"never"
|
|
417
|
+
]);
|
|
418
|
+
const ProviderSandboxMode = Schema.Literals([
|
|
419
|
+
"read-only",
|
|
420
|
+
"workspace-write",
|
|
421
|
+
"danger-full-access"
|
|
422
|
+
]);
|
|
423
|
+
const ProviderServiceTier = Schema.Literals(["fast", "flex"]);
|
|
412
424
|
const RuntimeMode = Schema.Literals(["approval-required", "full-access"]);
|
|
413
425
|
const DEFAULT_RUNTIME_MODE$2 = "full-access";
|
|
414
426
|
const ProviderInteractionMode = Schema.Literals(["default", "plan"]);
|
|
@@ -665,6 +677,7 @@ const ThreadTurnStartCommand = Schema.Struct({
|
|
|
665
677
|
}),
|
|
666
678
|
provider: Schema.optional(ProviderKind),
|
|
667
679
|
model: Schema.optional(TrimmedNonEmptyString),
|
|
680
|
+
serviceTier: Schema.optional(Schema.NullOr(ProviderServiceTier)),
|
|
668
681
|
modelOptions: Schema.optional(ProviderModelOptions),
|
|
669
682
|
assistantDeliveryMode: Schema.optional(AssistantDeliveryMode),
|
|
670
683
|
runtimeMode: RuntimeMode.pipe(Schema.withDecodingDefault(() => DEFAULT_RUNTIME_MODE$2)),
|
|
@@ -683,6 +696,7 @@ const ClientThreadTurnStartCommand = Schema.Struct({
|
|
|
683
696
|
}),
|
|
684
697
|
provider: Schema.optional(ProviderKind),
|
|
685
698
|
model: Schema.optional(TrimmedNonEmptyString),
|
|
699
|
+
serviceTier: Schema.optional(Schema.NullOr(ProviderServiceTier)),
|
|
686
700
|
modelOptions: Schema.optional(ProviderModelOptions),
|
|
687
701
|
assistantDeliveryMode: Schema.optional(AssistantDeliveryMode),
|
|
688
702
|
runtimeMode: RuntimeMode,
|
|
@@ -924,6 +938,7 @@ const ThreadTurnStartRequestedPayload = Schema.Struct({
|
|
|
924
938
|
messageId: MessageId,
|
|
925
939
|
provider: Schema.optional(ProviderKind),
|
|
926
940
|
model: Schema.optional(TrimmedNonEmptyString),
|
|
941
|
+
serviceTier: Schema.optional(Schema.NullOr(ProviderServiceTier)),
|
|
927
942
|
modelOptions: Schema.optional(ProviderModelOptions),
|
|
928
943
|
assistantDeliveryMode: Schema.optional(AssistantDeliveryMode),
|
|
929
944
|
runtimeMode: RuntimeMode.pipe(Schema.withDecodingDefault(() => DEFAULT_RUNTIME_MODE$2)),
|
|
@@ -1296,6 +1311,9 @@ const ProviderSessionStartInput = Schema.Struct({
|
|
|
1296
1311
|
model: Schema.optional(TrimmedNonEmptyStringSchema$2),
|
|
1297
1312
|
modelOptions: Schema.optional(ProviderModelOptions),
|
|
1298
1313
|
resumeCursor: Schema.optional(Schema.Unknown),
|
|
1314
|
+
serviceTier: Schema.optional(Schema.NullOr(ProviderServiceTier)),
|
|
1315
|
+
approvalPolicy: Schema.optional(ProviderApprovalPolicy),
|
|
1316
|
+
sandboxMode: Schema.optional(ProviderSandboxMode),
|
|
1299
1317
|
providerOptions: Schema.optional(ProviderStartOptions),
|
|
1300
1318
|
runtimeMode: RuntimeMode
|
|
1301
1319
|
});
|
|
@@ -1304,6 +1322,7 @@ const ProviderSendTurnInput = Schema.Struct({
|
|
|
1304
1322
|
input: Schema.optional(TrimmedNonEmptyStringSchema$2.check(Schema.isMaxLength(PROVIDER_SEND_TURN_MAX_INPUT_CHARS))),
|
|
1305
1323
|
attachments: Schema.optional(Schema.Array(ChatAttachment).check(Schema.isMaxLength(PROVIDER_SEND_TURN_MAX_ATTACHMENTS))),
|
|
1306
1324
|
model: Schema.optional(TrimmedNonEmptyStringSchema$2),
|
|
1325
|
+
serviceTier: Schema.optional(Schema.NullOr(ProviderServiceTier)),
|
|
1307
1326
|
modelOptions: Schema.optional(ProviderModelOptions),
|
|
1308
1327
|
interactionMode: Schema.optional(ProviderInteractionMode)
|
|
1309
1328
|
});
|
|
@@ -4353,6 +4372,7 @@ const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand")(funct
|
|
|
4353
4372
|
messageId: command.message.messageId,
|
|
4354
4373
|
...command.provider !== void 0 ? { provider: command.provider } : {},
|
|
4355
4374
|
...command.model !== void 0 ? { model: command.model } : {},
|
|
4375
|
+
...command.serviceTier !== void 0 ? { serviceTier: command.serviceTier } : {},
|
|
4356
4376
|
...command.modelOptions !== void 0 ? { modelOptions: command.modelOptions } : {},
|
|
4357
4377
|
assistantDeliveryMode: command.assistantDeliveryMode ?? DEFAULT_ASSISTANT_DELIVERY_MODE$1,
|
|
4358
4378
|
runtimeMode: readModel.threads.find((entry) => entry.id === command.threadId)?.runtimeMode ?? command.runtimeMode,
|
|
@@ -5795,6 +5815,7 @@ const make$1 = Effect.gen(function* () {
|
|
|
5795
5815
|
...input?.provider ?? preferredProvider ? { provider: input?.provider ?? preferredProvider } : {},
|
|
5796
5816
|
...effectiveCwd ? { cwd: effectiveCwd } : {},
|
|
5797
5817
|
...desiredModel ? { model: desiredModel } : {},
|
|
5818
|
+
...options?.serviceTier !== void 0 ? { serviceTier: options.serviceTier } : {},
|
|
5798
5819
|
...options?.modelOptions !== void 0 ? { modelOptions: options.modelOptions } : {},
|
|
5799
5820
|
...input?.resumeCursor !== void 0 ? { resumeCursor: input.resumeCursor } : {},
|
|
5800
5821
|
runtimeMode: desiredRuntimeMode
|
|
@@ -5858,6 +5879,7 @@ const make$1 = Effect.gen(function* () {
|
|
|
5858
5879
|
yield* ensureSessionForThread(input.threadId, input.createdAt, {
|
|
5859
5880
|
...input.provider !== void 0 ? { provider: input.provider } : {},
|
|
5860
5881
|
...input.model !== void 0 ? { model: input.model } : {},
|
|
5882
|
+
...input.serviceTier !== void 0 ? { serviceTier: input.serviceTier } : {},
|
|
5861
5883
|
...input.modelOptions !== void 0 ? { modelOptions: input.modelOptions } : {}
|
|
5862
5884
|
});
|
|
5863
5885
|
const normalizedInput = toNonEmptyProviderInput(input.messageText);
|
|
@@ -5869,6 +5891,7 @@ const make$1 = Effect.gen(function* () {
|
|
|
5869
5891
|
...normalizedInput ? { input: normalizedInput } : {},
|
|
5870
5892
|
...normalizedAttachments.length > 0 ? { attachments: normalizedAttachments } : {},
|
|
5871
5893
|
...modelForTurn !== void 0 ? { model: modelForTurn } : {},
|
|
5894
|
+
...input.serviceTier !== void 0 ? { serviceTier: input.serviceTier } : {},
|
|
5872
5895
|
...input.modelOptions !== void 0 ? { modelOptions: input.modelOptions } : {},
|
|
5873
5896
|
...input.interactionMode !== void 0 ? { interactionMode: input.interactionMode } : {}
|
|
5874
5897
|
});
|
|
@@ -5944,6 +5967,7 @@ const make$1 = Effect.gen(function* () {
|
|
|
5944
5967
|
...message.attachments !== void 0 ? { attachments: message.attachments } : {},
|
|
5945
5968
|
...event.payload.provider !== void 0 ? { provider: event.payload.provider } : {},
|
|
5946
5969
|
...event.payload.model !== void 0 ? { model: event.payload.model } : {},
|
|
5970
|
+
...event.payload.serviceTier !== void 0 ? { serviceTier: event.payload.serviceTier } : {},
|
|
5947
5971
|
...event.payload.modelOptions !== void 0 ? { modelOptions: event.payload.modelOptions } : {},
|
|
5948
5972
|
interactionMode: event.payload.interactionMode,
|
|
5949
5973
|
createdAt: event.payload.createdAt
|
|
@@ -8479,7 +8503,7 @@ function proposedPlanIdFromEvent(event, threadId) {
|
|
|
8479
8503
|
if (event.itemId) return `plan:${threadId}:item:${event.itemId}`;
|
|
8480
8504
|
return `plan:${threadId}:event:${event.eventId}`;
|
|
8481
8505
|
}
|
|
8482
|
-
function asString$
|
|
8506
|
+
function asString$2(value) {
|
|
8483
8507
|
return typeof value === "string" ? value : void 0;
|
|
8484
8508
|
}
|
|
8485
8509
|
function runtimePayloadRecord(event) {
|
|
@@ -8497,13 +8521,13 @@ function normalizeRuntimeTurnState(value) {
|
|
|
8497
8521
|
}
|
|
8498
8522
|
}
|
|
8499
8523
|
function runtimeTurnState(event) {
|
|
8500
|
-
return normalizeRuntimeTurnState(asString$
|
|
8524
|
+
return normalizeRuntimeTurnState(asString$2(runtimePayloadRecord(event)?.state));
|
|
8501
8525
|
}
|
|
8502
8526
|
function runtimeTurnErrorMessage(event) {
|
|
8503
|
-
return asString$
|
|
8527
|
+
return asString$2(runtimePayloadRecord(event)?.errorMessage);
|
|
8504
8528
|
}
|
|
8505
8529
|
function runtimeErrorMessageFromEvent(event) {
|
|
8506
|
-
return asString$
|
|
8530
|
+
return asString$2(runtimePayloadRecord(event)?.message);
|
|
8507
8531
|
}
|
|
8508
8532
|
function orchestrationSessionStatusFromRuntimeState(state) {
|
|
8509
8533
|
switch (state) {
|
|
@@ -9133,6 +9157,43 @@ const RECOVERABLE_THREAD_RESUME_ERROR_SNIPPETS = [
|
|
|
9133
9157
|
"unknown thread",
|
|
9134
9158
|
"does not exist"
|
|
9135
9159
|
];
|
|
9160
|
+
const CODEX_DEFAULT_MODEL = "gpt-5.3-codex";
|
|
9161
|
+
const CODEX_SPARK_MODEL = "gpt-5.3-codex-spark";
|
|
9162
|
+
const CODEX_SPARK_DISABLED_PLAN_TYPES = new Set([
|
|
9163
|
+
"free",
|
|
9164
|
+
"go",
|
|
9165
|
+
"plus"
|
|
9166
|
+
]);
|
|
9167
|
+
function asObject$1(value) {
|
|
9168
|
+
if (!value || typeof value !== "object") return;
|
|
9169
|
+
return value;
|
|
9170
|
+
}
|
|
9171
|
+
function asString$1(value) {
|
|
9172
|
+
return typeof value === "string" ? value : void 0;
|
|
9173
|
+
}
|
|
9174
|
+
function readCodexAccountSnapshot(response) {
|
|
9175
|
+
const record = asObject$1(response);
|
|
9176
|
+
const account = asObject$1(record?.account) ?? record;
|
|
9177
|
+
const accountType = asString$1(account?.type);
|
|
9178
|
+
if (accountType === "apiKey") return {
|
|
9179
|
+
type: "apiKey",
|
|
9180
|
+
planType: null,
|
|
9181
|
+
sparkEnabled: true
|
|
9182
|
+
};
|
|
9183
|
+
if (accountType === "chatgpt") {
|
|
9184
|
+
const planType = account?.planType ?? "unknown";
|
|
9185
|
+
return {
|
|
9186
|
+
type: "chatgpt",
|
|
9187
|
+
planType,
|
|
9188
|
+
sparkEnabled: !CODEX_SPARK_DISABLED_PLAN_TYPES.has(planType)
|
|
9189
|
+
};
|
|
9190
|
+
}
|
|
9191
|
+
return {
|
|
9192
|
+
type: "unknown",
|
|
9193
|
+
planType: null,
|
|
9194
|
+
sparkEnabled: true
|
|
9195
|
+
};
|
|
9196
|
+
}
|
|
9136
9197
|
const CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS = `<collaboration_mode># Plan Mode (Conversational)
|
|
9137
9198
|
|
|
9138
9199
|
You work in 3 phases, and you should *chat your way* to a great plan before finalizing it. A great plan is very detailed-intent- and implementation-wise-so that it can be handed to another engineer or agent to be implemented right away. It must be **decision complete**, where the implementer does not need to make any decisions.
|
|
@@ -9276,6 +9337,10 @@ function mapCodexRuntimeMode(runtimeMode) {
|
|
|
9276
9337
|
sandbox: "danger-full-access"
|
|
9277
9338
|
};
|
|
9278
9339
|
}
|
|
9340
|
+
function resolveCodexModelForAccount(model, account) {
|
|
9341
|
+
if (model !== CODEX_SPARK_MODEL || account.sparkEnabled) return model;
|
|
9342
|
+
return CODEX_DEFAULT_MODEL;
|
|
9343
|
+
}
|
|
9279
9344
|
/**
|
|
9280
9345
|
* On Windows with `shell: true`, `child.kill()` only terminates the `cmd.exe`
|
|
9281
9346
|
* wrapper, leaving the actual command running. Use `taskkill /T` to kill the
|
|
@@ -9390,6 +9455,11 @@ var CodexAppServerManager = class extends EventEmitter {
|
|
|
9390
9455
|
});
|
|
9391
9456
|
context = {
|
|
9392
9457
|
session,
|
|
9458
|
+
account: {
|
|
9459
|
+
type: "unknown",
|
|
9460
|
+
planType: null,
|
|
9461
|
+
sparkEnabled: true
|
|
9462
|
+
},
|
|
9393
9463
|
child,
|
|
9394
9464
|
output: readline.createInterface({ input: child.stdout }),
|
|
9395
9465
|
pending: /* @__PURE__ */ new Map(),
|
|
@@ -9403,11 +9473,29 @@ var CodexAppServerManager = class extends EventEmitter {
|
|
|
9403
9473
|
this.emitLifecycleEvent(context, "session/connecting", "Starting codex app-server");
|
|
9404
9474
|
await this.sendRequest(context, "initialize", buildCodexInitializeParams());
|
|
9405
9475
|
this.writeMessage(context, { method: "initialized" });
|
|
9406
|
-
|
|
9476
|
+
try {
|
|
9477
|
+
const modelListResponse = await this.sendRequest(context, "model/list", {});
|
|
9478
|
+
console.log("codex model/list response", modelListResponse);
|
|
9479
|
+
} catch (error) {
|
|
9480
|
+
console.log("codex model/list failed", error);
|
|
9481
|
+
}
|
|
9482
|
+
try {
|
|
9483
|
+
const accountReadResponse = await this.sendRequest(context, "account/read", {});
|
|
9484
|
+
console.log("codex account/read response", accountReadResponse);
|
|
9485
|
+
context.account = readCodexAccountSnapshot(accountReadResponse);
|
|
9486
|
+
console.log("codex subscription status", {
|
|
9487
|
+
type: context.account.type,
|
|
9488
|
+
planType: context.account.planType,
|
|
9489
|
+
sparkEnabled: context.account.sparkEnabled
|
|
9490
|
+
});
|
|
9491
|
+
} catch (error) {
|
|
9492
|
+
console.log("codex account/read failed", error);
|
|
9493
|
+
}
|
|
9494
|
+
const normalizedModel = resolveCodexModelForAccount(normalizeCodexModelSlug(input.model), context.account);
|
|
9407
9495
|
const sessionOverrides = {
|
|
9408
9496
|
model: normalizedModel ?? null,
|
|
9409
|
-
cwd: input.cwd ?? null,
|
|
9410
9497
|
...input.serviceTier !== void 0 ? { serviceTier: input.serviceTier } : {},
|
|
9498
|
+
cwd: input.cwd ?? null,
|
|
9411
9499
|
...mapCodexRuntimeMode(input.runtimeMode ?? "full-access")
|
|
9412
9500
|
};
|
|
9413
9501
|
const threadStartParams = {
|
|
@@ -9520,10 +9608,10 @@ var CodexAppServerManager = class extends EventEmitter {
|
|
|
9520
9608
|
threadId: providerThreadId,
|
|
9521
9609
|
input: turnInput
|
|
9522
9610
|
};
|
|
9523
|
-
const normalizedModel = normalizeCodexModelSlug(input.model ?? context.session.model);
|
|
9611
|
+
const normalizedModel = resolveCodexModelForAccount(normalizeCodexModelSlug(input.model ?? context.session.model), context.account);
|
|
9524
9612
|
if (normalizedModel) turnStartParams.model = normalizedModel;
|
|
9613
|
+
if (input.serviceTier !== void 0) turnStartParams.serviceTier = input.serviceTier;
|
|
9525
9614
|
if (input.effort) turnStartParams.effort = input.effort;
|
|
9526
|
-
if (input.serviceTier) turnStartParams.serviceTier = input.serviceTier;
|
|
9527
9615
|
const collaborationMode = buildCodexCollaborationMode({
|
|
9528
9616
|
...input.interactionMode !== void 0 ? { interactionMode: input.interactionMode } : {},
|
|
9529
9617
|
...normalizedModel !== void 0 ? { model: normalizedModel } : {},
|
|
@@ -11050,6 +11138,7 @@ const makeCodexAdapter = (options) => Effect.gen(function* () {
|
|
|
11050
11138
|
threadId: input.threadId,
|
|
11051
11139
|
...input.input !== void 0 ? { input: input.input } : {},
|
|
11052
11140
|
...input.model !== void 0 ? { model: input.model } : {},
|
|
11141
|
+
...input.serviceTier !== void 0 ? { serviceTier: input.serviceTier } : {},
|
|
11053
11142
|
...input.modelOptions?.codex?.reasoningEffort !== void 0 ? { effort: input.modelOptions.codex.reasoningEffort } : {},
|
|
11054
11143
|
...input.modelOptions?.codex?.fastMode ? { serviceTier: "fast" } : {},
|
|
11055
11144
|
...input.interactionMode !== void 0 ? { interactionMode: input.interactionMode } : {},
|
|
@@ -11504,7 +11593,7 @@ const makeProviderService = (options) => Effect.gen(function* () {
|
|
|
11504
11593
|
turns: input.numTurns
|
|
11505
11594
|
});
|
|
11506
11595
|
});
|
|
11507
|
-
const
|
|
11596
|
+
const runStopAll = () => Effect.gen(function* () {
|
|
11508
11597
|
const threadIds = yield* directory.listThreadIds();
|
|
11509
11598
|
yield* Effect.forEach(adapters, (adapter) => adapter.stopAll()).pipe(Effect.asVoid);
|
|
11510
11599
|
yield* Effect.forEach(threadIds, (threadId) => directory.getProvider(threadId).pipe(Effect.flatMap((provider) => directory.upsert({
|
|
@@ -11520,6 +11609,7 @@ const makeProviderService = (options) => Effect.gen(function* () {
|
|
|
11520
11609
|
yield* analytics.record("provider.sessions.stopped_all", { sessionCount: threadIds.length });
|
|
11521
11610
|
yield* analytics.flush;
|
|
11522
11611
|
});
|
|
11612
|
+
yield* Effect.addFinalizer(() => Effect.catch(runStopAll(), (cause) => Effect.logWarning("failed to stop provider service", { cause })));
|
|
11523
11613
|
return {
|
|
11524
11614
|
startSession,
|
|
11525
11615
|
sendTurn,
|
|
@@ -11530,7 +11620,6 @@ const makeProviderService = (options) => Effect.gen(function* () {
|
|
|
11530
11620
|
listSessions,
|
|
11531
11621
|
getCapabilities,
|
|
11532
11622
|
rollbackConversation,
|
|
11533
|
-
stopAll,
|
|
11534
11623
|
streamEvents: Stream.fromPubSub(runtimeEventPubSub)
|
|
11535
11624
|
};
|
|
11536
11625
|
});
|
|
@@ -15943,7 +16032,6 @@ const createServer = Effect.fn(function* () {
|
|
|
15943
16032
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
15944
16033
|
const projectionReadModelQuery = yield* ProjectionSnapshotQuery;
|
|
15945
16034
|
const checkpointDiffQuery = yield* CheckpointDiffQuery;
|
|
15946
|
-
const liveProviderService = yield* ProviderService;
|
|
15947
16035
|
const orchestrationReactor = yield* OrchestrationReactor;
|
|
15948
16036
|
const { openInEditor } = yield* Open;
|
|
15949
16037
|
const subscriptionsScope = yield* Scope.make("sequential");
|
|
@@ -16015,7 +16103,6 @@ const createServer = Effect.fn(function* () {
|
|
|
16015
16103
|
cause
|
|
16016
16104
|
})));
|
|
16017
16105
|
const runPromise = yield* Effect.map(Effect.services(), Effect.runPromiseWith);
|
|
16018
|
-
yield* Effect.addFinalizer(() => Effect.catch(liveProviderService.stopAll(), (cause) => Effect.logWarning("failed to stop provider service", { cause })));
|
|
16019
16106
|
const unsubscribeTerminalEvents = yield* terminalManager.subscribe((event) => void Effect.runPromise(onTerminalEvent(event)));
|
|
16020
16107
|
yield* Effect.addFinalizer(() => Effect.sync(() => unsubscribeTerminalEvents()));
|
|
16021
16108
|
yield* NodeHttpServer.make(() => httpServer, listenOptions).pipe(Effect.mapError((cause) => new ServerLifecycleError({
|
|
@@ -16244,9 +16331,8 @@ const ServerLive = Layer.succeed(Server, {
|
|
|
16244
16331
|
//#endregion
|
|
16245
16332
|
//#region src/serverLogger.ts
|
|
16246
16333
|
const ServerLoggerLive = Effect.gen(function* () {
|
|
16247
|
-
const config = yield*
|
|
16248
|
-
|
|
16249
|
-
const logDir = path.join(config.value.stateDir, "logs");
|
|
16334
|
+
const config = yield* ServerConfig$1;
|
|
16335
|
+
const logDir = path.join(config.stateDir, "logs");
|
|
16250
16336
|
const logPath = path.join(logDir, "server.log");
|
|
16251
16337
|
yield* Effect.sync(() => {
|
|
16252
16338
|
fs.mkdirSync(logDir, { recursive: true });
|
|
@@ -16300,7 +16386,7 @@ const getTelemetryIdentifier = Effect.gen(function* () {
|
|
|
16300
16386
|
|
|
16301
16387
|
//#endregion
|
|
16302
16388
|
//#region package.json
|
|
16303
|
-
var version = "0.0.0-alpha.
|
|
16389
|
+
var version = "0.0.0-alpha.21";
|
|
16304
16390
|
|
|
16305
16391
|
//#endregion
|
|
16306
16392
|
//#region src/telemetry/Layers/AnalyticsService.ts
|