ryco-cli 0.1.6 → 0.1.8
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/{AzureDevOpsSourceControlProvider-CC2_COxP.mjs → AzureDevOpsSourceControlProvider-B5vb4DOU.mjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-6holYS_D.cjs → AzureDevOpsSourceControlProvider-CYZmJqSM.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-CYR_BD1d.mjs → BitbucketSourceControlProvider-CcAb4IgH.mjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-a0IsNFyG.cjs → BitbucketSourceControlProvider-D_7i4YQz.cjs} +2 -2
- package/dist/{ClaudeDriver-D3nsxwH9.mjs → ClaudeDriver-CoPBpdrp.mjs} +198 -8
- package/dist/{ClaudeDriver-C6tQNEWO.cjs → ClaudeDriver-ScqmbPKW.cjs} +197 -7
- package/dist/{CodexDriver-ms_YgFD7.cjs → CodexDriver-CtCCc3CC.cjs} +36 -8
- package/dist/{CodexDriver-BILrJG8o.mjs → CodexDriver-DH7vqku4.mjs} +37 -9
- package/dist/{CodexTextGeneration-BIKHl7E3.mjs → CodexTextGeneration-CJV1jPda.mjs} +3 -3
- package/dist/{CodexTextGeneration-CHEgoANm.cjs → CodexTextGeneration-Db2hn8Qz.cjs} +2 -2
- package/dist/{CopilotDriver-CmD3Ffyl.mjs → CopilotDriver-CFCF68Te.mjs} +7 -6
- package/dist/{CopilotDriver-B0--ZwIK.cjs → CopilotDriver-DLN2KEoc.cjs} +6 -5
- package/dist/{CursorDriver-DTVPXZ-R.cjs → CursorDriver-BlvQbOEZ.cjs} +201 -15
- package/dist/{CursorDriver-CbeaIbdb.mjs → CursorDriver-Dej81rwD.mjs} +202 -16
- package/dist/{ForgejoSourceControlProvider-DX6d9gvz.mjs → ForgejoSourceControlProvider-3cFD7SqY.mjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-DwAog76b.cjs → ForgejoSourceControlProvider-DYFUGvBk.cjs} +2 -2
- package/dist/{GitHubSourceControlProvider-9lJFzjsu.cjs → GitHubSourceControlProvider-B1Tp0TbY.cjs} +27 -4
- package/dist/{GitHubSourceControlProvider-C-LGwho3.mjs → GitHubSourceControlProvider-Kf4rrBTF.mjs} +27 -4
- package/dist/{GitLabSourceControlProvider-CvKA74lg.cjs → GitLabSourceControlProvider-D3vvKrB4.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-CkeT2aEx.mjs → GitLabSourceControlProvider-Ygppeftk.mjs} +2 -2
- package/dist/{NodeSqliteClient-B5aDHbNc.cjs → NodeSqliteClient-D1O-MR8w.cjs} +4 -1
- package/dist/{NodeSqliteClient-A1TEgwj_.mjs → NodeSqliteClient-DdTjpAko.mjs} +4 -1
- package/dist/{OpenCodeDriver-ClWtCk0j.mjs → OpenCodeDriver-BGa9Tkot.mjs} +326 -39
- package/dist/{OpenCodeDriver-CXUsnl5o.cjs → OpenCodeDriver-mbR9mF54.cjs} +325 -38
- package/dist/{SourceControlProviderDiscoveryCatalog-_rg0mc1o.cjs → SourceControlProviderDiscoveryCatalog-CTb100Uk.cjs} +1 -64
- package/dist/{SourceControlProviderDiscoveryCatalog-yMDer_Yh.mjs → SourceControlProviderDiscoveryCatalog-Zk11tJoL.mjs} +3 -48
- package/dist/bin.cjs +1481 -704
- package/dist/bin.mjs +1435 -659
- package/dist/client/assets/{AnimatedHeight-DgItDSis.js → AnimatedHeight-CPQ2q38I.js} +1 -1
- package/dist/client/assets/AppearanceSettings-B0FYiIxL.js +1 -0
- package/dist/client/assets/{BranchToolbar.logic-C_xHEt9C.js → BranchToolbar.logic-C1yjFjxJ.js} +1 -1
- package/dist/client/assets/ChatRightPanel-CJDSKMU2.js +188 -0
- package/dist/client/assets/ChatThreadRouteView-BaKwKGbC.js +1 -0
- package/dist/client/assets/CommandPaletteDialog-BHG_MdZk.js +1 -0
- package/dist/client/assets/CompositeRoot-Bs0hfelE.js +1 -0
- package/dist/client/assets/ConnectionsSettings-DvZNgO60.js +1 -0
- package/dist/client/assets/{DiagnosticsSettings-B340S_mq.js → DiagnosticsSettings-0v_hh1Qh.js} +1 -1
- package/dist/client/assets/{DialogHandle-BJY7cHCV.js → DialogHandle-CwEAVRF_.js} +1 -1
- package/dist/client/assets/{DialogRoot-Ej1FVk-_.js → DialogRoot-CYuaaDI3.js} +1 -1
- package/dist/client/assets/DialogTitle-Cak6zT3u.js +1 -0
- package/dist/client/assets/DialogTrigger-BD0KYYT-.js +1 -0
- package/dist/client/assets/{DialogViewport-DvjAl76K.js → DialogViewport-9sGf4JUp.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-pOkyeKPS.js → DraftChatThreadRouteView-nvKLHlii.js} +1 -1
- package/dist/client/assets/{JetBrainsIcons-DTTF47I0.js → JetBrainsIcons-CflvH7gO.js} +1 -1
- package/dist/client/assets/KeybindingsSettings-DhLKhgYn.js +7 -0
- package/dist/client/assets/McpServersSettings-COs_dng1.js +6 -0
- package/dist/client/assets/{NoActiveThreadState-DVHwrkCp.js → NoActiveThreadState-cxMCW-cQ.js} +1 -1
- package/dist/client/assets/OpinionatedPluginsSettings-ag_OgOGj.js +1 -0
- package/dist/client/assets/{ProjectFavicon-TDP7HRfn.js → ProjectFavicon-D97Hy4xo.js} +1 -1
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-6TpFsmiI.js → ProviderUpdateLaunchNotification.logic-RMYvRSEk.js} +1 -1
- package/dist/client/assets/ProvidersSettingsPanel-DcdVMRVC.js +1 -0
- package/dist/client/assets/{RedactedSensitiveText-BfoVjPsE.js → RedactedSensitiveText-CQY4pFAq.js} +1 -1
- package/dist/client/assets/RootAppShell-BRjETnaT.js +12 -0
- package/dist/client/assets/SettingsDialog-DRi5jsmq.js +2 -0
- package/dist/client/assets/SourceControlSettings-CdUulS4O.js +1 -0
- package/dist/client/assets/StatisticsPanel-NLU3ecLt.js +64 -0
- package/dist/client/assets/{ThreadStatusIndicators-B0leIJGD.js → ThreadStatusIndicators-CebYbeXP.js} +1 -1
- package/dist/client/assets/{ThreadTerminalDrawer-COq2Fk17.js → ThreadTerminalDrawer-DlI0gGer.js} +17 -17
- package/dist/client/assets/ThreadWorkspacePanel-CEIVrCZ0.js +166 -0
- package/dist/client/assets/{alert-dialog-lMfKpG2t.js → alert-dialog-wh07u3JU.js} +1 -1
- package/dist/client/assets/chart-column-Cg34FxwD.js +1 -0
- package/dist/client/assets/{chatThreadActions-PPyTj_x0.js → chatThreadActions-UitETN_n.js} +1 -1
- package/dist/client/assets/chevron-up-C3DS3evc.js +1 -0
- package/dist/client/assets/{clamp-JiD4IZ0Z.js → clamp-DPbdAzEu.js} +1 -1
- package/dist/client/assets/{clipboard-copy-CYBLSG2q.js → clipboard-copy-ClVNnHW5.js} +1 -1
- package/dist/client/assets/clock-Cr66Pt4W.js +1 -0
- package/dist/client/assets/{commandPaletteStore-uVfCD7zE.js → commandPaletteStore-DzUBFRor.js} +1 -1
- package/dist/client/assets/composerDraftStore-BfLPHwHL.js +21 -0
- package/dist/client/assets/{desktopUpdateAtoms-X6uM5SoD.js → desktopUpdateAtoms-BiqPT2_z.js} +1 -1
- package/dist/client/assets/{download-DLBlpp4h.js → download-DJ1juHK4.js} +1 -1
- package/dist/client/assets/{draft-input-dLlVMl5P.js → draft-input-B1txZFC7.js} +1 -1
- package/dist/client/assets/editorPreferences-Bbmh6Bm1.js +1 -0
- package/dist/client/assets/{empty-DlLY-Hhj.js → empty-CUEYr1p8.js} +1 -1
- package/dist/client/assets/{group-zDBPF7rR.js → group-BouZ2n9F.js} +1 -1
- package/dist/client/assets/{index-Dq8sT2lF.js → index-DiHgOLH_.js} +2 -2
- package/dist/client/assets/{input-B9-RWT56.js → input-Do_m9U-4.js} +1 -1
- package/dist/client/assets/kbd-DJilTfYF.js +1 -0
- package/dist/client/assets/{keybindings-Dx4Nc1vY.js → keybindings-CRkz0yvp.js} +1 -1
- package/dist/client/assets/{keyboard-DDTWQkr0.js → keyboard-D3WgbAUQ.js} +1 -1
- package/dist/client/assets/{keyedQuery-Ds4OGhX2.js → keyedQuery-PQcOnB2O.js} +0 -0
- package/dist/client/assets/{main-DxfpmoKJ.js → main-C-491vdD.js} +2 -2
- package/dist/client/assets/main-fW5L_SdM.css +2 -0
- package/dist/client/assets/{palette-BQcz-ZYV.js → palette-BRoYo327.js} +1 -1
- package/dist/client/assets/{play-QloDGe4R.js → play-BZbHk_vw.js} +1 -1
- package/dist/client/assets/plus-D0S72hZS.js +1 -0
- package/dist/client/assets/projectAtoms-KYCIIuVn.js +1 -0
- package/dist/client/assets/providerDriverMeta-BX4CLldz.js +1 -0
- package/dist/client/assets/providerIconUtils-DTRc3qno.js +47 -0
- package/dist/client/assets/radio-group-De3hRQoY.js +1 -0
- package/dist/client/assets/{refresh-cw-DkBMGllm.js → refresh-cw-D_1NT-T2.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-DDfIbj05.js → resolveAriaLabelledBy-RblUm3b1.js} +1 -1
- package/dist/client/assets/rightPanelRouteSearch-DLllyqRr.js +1 -0
- package/dist/client/assets/{scale-BActunFu.js → scale-s57Ro96s.js} +1 -1
- package/dist/client/assets/{scroll-area-D-YOUG02.js → scroll-area-B0_k8-iT.js} +1 -1
- package/dist/client/assets/{separator-TInKeIDo.js → separator-AyXRgdnJ.js} +1 -1
- package/dist/client/assets/{server-BtEG3NAw.js → server-Z-m1OqE5.js} +1 -1
- package/dist/client/assets/{session-logic-DNf1aXq_.js → session-logic-B87Htlw4.js} +2 -2
- package/dist/client/assets/settingsDialogStore-CxUfUnd9.js +1 -0
- package/dist/client/assets/{settingsLayout-D22Mm0u3.js → settingsLayout-BtKS3Z8f.js} +1 -1
- package/dist/client/assets/sidebar-B0WxOej2.js +1 -0
- package/dist/client/assets/sidebarStatusText-C_EsHj20.js +1 -0
- package/dist/client/assets/{skeleton-DWaac_qp.js → skeleton-COt2Az5i.js} +1 -1
- package/dist/client/assets/{storeSelectors-Cx1IYPA4.js → storeSelectors-BuB4Kzj6.js} +1 -1
- package/dist/client/assets/threadSelectionStore-BS6X6HHt.js +1 -0
- package/dist/client/assets/toast-CaV8TQi_.js +1 -0
- package/dist/client/assets/toggle-DE4ApNIU.js +1 -0
- package/dist/client/assets/{toggle-group-CnLjaHSL.js → toggle-group-BuzAkAEk.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-BSYdIvBm.js → tokenModePresentation-BCL2aeat.js} +1 -1
- package/dist/client/assets/{trash-2-BI5xcbsm.js → trash-2-ZZ1feCT6.js} +1 -1
- package/dist/client/assets/{triangle-alert-DJef_Uvh.js → triangle-alert-CL3zqnKL.js} +1 -1
- package/dist/client/assets/{undo-2-DeZ2cMGS.js → undo-2-Cu9H3R3q.js} +1 -1
- package/dist/client/assets/{useHandleNewThread-XB82O6SA.js → useHandleNewThread-Gke-ZFBr.js} +1 -1
- package/dist/client/assets/useLabelableId-DfuxWqrk.js +1 -0
- package/dist/client/assets/{useNavigate-B2tgshhW.js → useNavigate-DQEHh6ky.js} +1 -1
- package/dist/client/assets/useTheme-HcKmBfpF.js +1 -0
- package/dist/client/assets/{vscode-icons-DM9qFoEr.js → vscode-icons-DGDiHkqG.js} +1 -1
- package/dist/client/assets/{wrench-je4QOyG-.js → wrench-C_OATMLq.js} +1 -1
- package/dist/client/assets/x-BG9zZGeD.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-TCG6xW_P.cjs → collectUint8StreamText-B-GW3u_2.cjs} +367 -15
- package/dist/{collectUint8StreamText-C2z5Y8tF.mjs → collectUint8StreamText-COE2_gie.mjs} +345 -17
- package/dist/{makeManagedServerProvider-BXO8QvzC.mjs → makeManagedServerProvider-D1_iEWGi.mjs} +1 -1
- package/dist/{makeManagedServerProvider-DPFw9gV_.cjs → makeManagedServerProvider-DTsQ87HL.cjs} +1 -1
- package/package.json +4 -2
- package/dist/client/assets/AppearanceSettings-BlsMFBvJ.js +0 -1
- package/dist/client/assets/ChatRightPanel-CThudBb1.js +0 -188
- package/dist/client/assets/ChatThreadRouteView-CV6ETYG5.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-C_H7R8S5.js +0 -1
- package/dist/client/assets/CompositeRoot-DjnzUIwC.js +0 -1
- package/dist/client/assets/ConnectionsSettings-hArR4Oe3.js +0 -1
- package/dist/client/assets/DialogTitle-H1yIMmA9.js +0 -1
- package/dist/client/assets/DialogTrigger-BHMq_K2G.js +0 -1
- package/dist/client/assets/KeybindingsSettings-CW3RRi-7.js +0 -7
- package/dist/client/assets/McpServersSettings-dQ3BzOWY.js +0 -6
- package/dist/client/assets/OpinionatedPluginsSettings-Cjj23Fs4.js +0 -1
- package/dist/client/assets/ProvidersSettingsPanel-D15EeWAq.js +0 -1
- package/dist/client/assets/RootAppShell-CWBPSA2w.js +0 -12
- package/dist/client/assets/SettingsDialog-oJCE5foT.js +0 -2
- package/dist/client/assets/SourceControlSettings-CPnlMxNm.js +0 -1
- package/dist/client/assets/ThreadWorkspacePanel-qF9y6QT9.js +0 -166
- package/dist/client/assets/composerDraftStore-D12lUSfh.js +0 -21
- package/dist/client/assets/editorPreferences-BLeEBSD_.js +0 -1
- package/dist/client/assets/folder-open-DMjz0lpx.js +0 -1
- package/dist/client/assets/kbd-aeSsjiPI.js +0 -1
- package/dist/client/assets/main-C57RhHZ_.css +0 -2
- package/dist/client/assets/plus-4Oy56d-3.js +0 -1
- package/dist/client/assets/projectAtoms-DUEBb7Zz.js +0 -1
- package/dist/client/assets/providerDriverMeta-Dwi6Zqgd.js +0 -1
- package/dist/client/assets/providerIconUtils-uhWb4bdg.js +0 -47
- package/dist/client/assets/radio-group-DHyQlLeX.js +0 -1
- package/dist/client/assets/rightPanelRouteSearch-DfuWVvXN.js +0 -1
- package/dist/client/assets/settingsDialogStore-BINi7pdD.js +0 -1
- package/dist/client/assets/sidebar-DHwNQmWp.js +0 -1
- package/dist/client/assets/threadSelectionStore-C0ig4405.js +0 -1
- package/dist/client/assets/toast-DE7a4wkW.js +0 -1
- package/dist/client/assets/toggle-BIW4AyPY.js +0 -1
- package/dist/client/assets/useLabelableId-DBAgv9qQ.js +0 -1
- package/dist/client/assets/useTheme-Dv42Z8uy.js +0 -1
- package/dist/client/assets/x-fI9snvD3.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const require_chunk = require("./chunk-jM1PLTSZ.cjs");
|
|
4
|
-
const require_collectUint8StreamText = require("./collectUint8StreamText-
|
|
4
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-B-GW3u_2.cjs");
|
|
5
5
|
const require_Metrics = require("./Metrics-CIW1QH7M.cjs");
|
|
6
6
|
const require_bin = require("./bin.cjs");
|
|
7
|
-
const require_makeManagedServerProvider = require("./makeManagedServerProvider-
|
|
7
|
+
const require_makeManagedServerProvider = require("./makeManagedServerProvider-DTsQ87HL.cjs");
|
|
8
8
|
const require_sourceControlContextFormatter = require("./sourceControlContextFormatter-BDZqn-4T.cjs");
|
|
9
9
|
const require_ProjectCustomSystemPrompt = require("./ProjectCustomSystemPrompt-B8SUlNGa.cjs");
|
|
10
10
|
const require_ProviderDriver = require("./ProviderDriver--rNeAi3B.cjs");
|
|
@@ -46,10 +46,12 @@ const DEFAULT_CLAUDE_MODEL_CAPABILITIES = require_bin.createModelCapabilities({
|
|
|
46
46
|
const PROVIDER$1 = require_collectUint8StreamText.ProviderDriverKind.make("claudeAgent");
|
|
47
47
|
const CLAUDE_PRESENTATION = {
|
|
48
48
|
displayName: "Claude",
|
|
49
|
-
showInteractionModeToggle: true
|
|
49
|
+
showInteractionModeToggle: true,
|
|
50
|
+
supportsAskMode: true
|
|
50
51
|
};
|
|
51
52
|
const MINIMUM_CLAUDE_OPUS_4_8_VERSION = "2.1.154";
|
|
52
53
|
const MINIMUM_CLAUDE_OPUS_4_7_VERSION = "2.1.111";
|
|
54
|
+
const MINIMUM_CLAUDE_FABLE_5_VERSION = "2.1.194";
|
|
53
55
|
function buildClaudeEffortOption(value, defaultEffort) {
|
|
54
56
|
const label = value === "xhigh" ? "Extra High" : value[0].toUpperCase() + value.slice(1).toLowerCase();
|
|
55
57
|
return value === defaultEffort ? {
|
|
@@ -121,6 +123,18 @@ const CLAUDE_OPUS_LEGACY_EFFORT_LEVELS = [
|
|
|
121
123
|
"max"
|
|
122
124
|
];
|
|
123
125
|
const BUILT_IN_MODELS = [
|
|
126
|
+
{
|
|
127
|
+
slug: "claude-fable-5",
|
|
128
|
+
name: "Claude Fable 5",
|
|
129
|
+
shortName: "Fable 5",
|
|
130
|
+
isCustom: false,
|
|
131
|
+
capabilities: buildClaudeOpusCapabilities({
|
|
132
|
+
effortLevels: CLAUDE_OPUS_ADAPTIVE_EFFORT_LEVELS,
|
|
133
|
+
defaultEffort: "high",
|
|
134
|
+
supportsFastMode: false,
|
|
135
|
+
supportsContextWindow: false
|
|
136
|
+
})
|
|
137
|
+
},
|
|
124
138
|
{
|
|
125
139
|
slug: "claude-opus-4-8",
|
|
126
140
|
name: "Claude Opus 4.8",
|
|
@@ -165,10 +179,22 @@ const BUILT_IN_MODELS = [
|
|
|
165
179
|
capabilities: buildClaudeOpusCapabilities({
|
|
166
180
|
effortLevels: CLAUDE_OPUS_LEGACY_EFFORT_LEVELS,
|
|
167
181
|
defaultEffort: "high",
|
|
168
|
-
supportsFastMode:
|
|
182
|
+
supportsFastMode: false,
|
|
169
183
|
supportsContextWindow: false
|
|
170
184
|
})
|
|
171
185
|
},
|
|
186
|
+
{
|
|
187
|
+
slug: "claude-sonnet-5",
|
|
188
|
+
name: "Claude Sonnet 5",
|
|
189
|
+
shortName: "Sonnet 5",
|
|
190
|
+
isCustom: false,
|
|
191
|
+
capabilities: buildClaudeOpusCapabilities({
|
|
192
|
+
effortLevels: CLAUDE_OPUS_ADAPTIVE_EFFORT_LEVELS,
|
|
193
|
+
defaultEffort: "high",
|
|
194
|
+
supportsFastMode: false,
|
|
195
|
+
supportsContextWindow: true
|
|
196
|
+
})
|
|
197
|
+
},
|
|
172
198
|
{
|
|
173
199
|
slug: "claude-sonnet-4-6",
|
|
174
200
|
name: "Claude Sonnet 4.6",
|
|
@@ -230,8 +256,12 @@ function supportsClaudeOpus48(version) {
|
|
|
230
256
|
function supportsClaudeOpus47(version) {
|
|
231
257
|
return supportsMinimumClaudeVersion(version, MINIMUM_CLAUDE_OPUS_4_7_VERSION);
|
|
232
258
|
}
|
|
259
|
+
function supportsClaudeFable5(version) {
|
|
260
|
+
return supportsMinimumClaudeVersion(version, MINIMUM_CLAUDE_FABLE_5_VERSION);
|
|
261
|
+
}
|
|
233
262
|
function getBuiltInClaudeModelsForVersion(version) {
|
|
234
263
|
return BUILT_IN_MODELS.filter((model) => {
|
|
264
|
+
if (model.slug === "claude-fable-5") return supportsClaudeFable5(version);
|
|
235
265
|
if (model.slug === "claude-opus-4-8") return supportsClaudeOpus48(version);
|
|
236
266
|
if (model.slug === "claude-opus-4-7") return supportsClaudeOpus47(version);
|
|
237
267
|
return true;
|
|
@@ -903,7 +933,10 @@ function maxClaudeContextWindowFromModelUsage(modelUsage) {
|
|
|
903
933
|
function normalizeClaudeTokenUsage(value, contextWindow) {
|
|
904
934
|
if (!value || typeof value !== "object") return;
|
|
905
935
|
const usage = value;
|
|
906
|
-
const
|
|
936
|
+
const directInputTokens = typeof usage.input_tokens === "number" && Number.isFinite(usage.input_tokens) ? usage.input_tokens : 0;
|
|
937
|
+
const cacheCreationInputTokens = typeof usage.cache_creation_input_tokens === "number" && Number.isFinite(usage.cache_creation_input_tokens) ? usage.cache_creation_input_tokens : 0;
|
|
938
|
+
const cachedInputTokens = typeof usage.cache_read_input_tokens === "number" && Number.isFinite(usage.cache_read_input_tokens) ? usage.cache_read_input_tokens : 0;
|
|
939
|
+
const inputTokens = directInputTokens + cacheCreationInputTokens + cachedInputTokens;
|
|
907
940
|
const outputTokens = typeof usage.output_tokens === "number" && Number.isFinite(usage.output_tokens) ? usage.output_tokens : 0;
|
|
908
941
|
const derivedTotalProcessedTokens = inputTokens + outputTokens;
|
|
909
942
|
const totalProcessedTokens = (typeof usage.total_tokens === "number" && Number.isFinite(usage.total_tokens) ? usage.total_tokens : void 0) ?? (derivedTotalProcessedTokens > 0 ? derivedTotalProcessedTokens : void 0);
|
|
@@ -915,6 +948,7 @@ function normalizeClaudeTokenUsage(value, contextWindow) {
|
|
|
915
948
|
lastUsedTokens: usedTokens,
|
|
916
949
|
...totalProcessedTokens > usedTokens ? { totalProcessedTokens } : {},
|
|
917
950
|
...inputTokens > 0 ? { inputTokens } : {},
|
|
951
|
+
...cachedInputTokens > 0 ? { cachedInputTokens } : {},
|
|
918
952
|
...outputTokens > 0 ? { outputTokens } : {},
|
|
919
953
|
...maxTokens !== void 0 ? { maxTokens } : {},
|
|
920
954
|
...typeof usage.tool_uses === "number" && Number.isFinite(usage.tool_uses) ? { toolUses: usage.tool_uses } : {},
|
|
@@ -943,6 +977,54 @@ function readClaudeResumeState(resumeCursor) {
|
|
|
943
977
|
...turnCountValue !== void 0 && Number.isInteger(turnCountValue) && turnCountValue >= 0 ? { turnCount: turnCountValue } : {}
|
|
944
978
|
};
|
|
945
979
|
}
|
|
980
|
+
function trimmedClaudeString(value) {
|
|
981
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
982
|
+
}
|
|
983
|
+
function claudeTaskField(message, field) {
|
|
984
|
+
return trimmedClaudeString(message[field]);
|
|
985
|
+
}
|
|
986
|
+
function hasClaudeSubagentNameSignal(value) {
|
|
987
|
+
return value !== void 0 && /\b(?:sub[-\s]?agent|agent|subtask|task)\b/i.test(value);
|
|
988
|
+
}
|
|
989
|
+
function hasClaudeSubagentDescriptionSignal(value) {
|
|
990
|
+
return value !== void 0 && /\b(?:sub[-\s]?agent|agent|teammate|worker|delegate[sd]?|reviewer)\b/i.test(value);
|
|
991
|
+
}
|
|
992
|
+
function isClaudeSubagentTaskMessage(message) {
|
|
993
|
+
return hasClaudeSubagentNameSignal(claudeTaskField(message, "task_type")) || hasClaudeSubagentNameSignal(claudeTaskField(message, "last_tool_name")) || hasClaudeSubagentDescriptionSignal(claudeTaskField(message, "description")) || hasClaudeSubagentDescriptionSignal(claudeTaskField(message, "summary"));
|
|
994
|
+
}
|
|
995
|
+
function claudeTaskSubagentStatus(status) {
|
|
996
|
+
return status;
|
|
997
|
+
}
|
|
998
|
+
function claudeTaskCompletionStatus(status) {
|
|
999
|
+
return status;
|
|
1000
|
+
}
|
|
1001
|
+
function claudeTaskMetadata(message) {
|
|
1002
|
+
const metadata = Object.fromEntries([
|
|
1003
|
+
["source", "claude.task"],
|
|
1004
|
+
["taskType", claudeTaskField(message, "task_type")],
|
|
1005
|
+
["lastToolName", claudeTaskField(message, "last_tool_name")]
|
|
1006
|
+
].filter(([, value]) => value !== void 0));
|
|
1007
|
+
return Object.keys(metadata).length > 0 ? metadata : void 0;
|
|
1008
|
+
}
|
|
1009
|
+
function makeClaudeTaskSubagentRef(existing, message) {
|
|
1010
|
+
const taskType = claudeTaskField(message, "task_type");
|
|
1011
|
+
const lastToolName = claudeTaskField(message, "last_tool_name");
|
|
1012
|
+
const description = claudeTaskField(message, "description") ?? existing?.description;
|
|
1013
|
+
const label = taskType ?? lastToolName ?? existing?.label ?? "Claude task";
|
|
1014
|
+
const taskMetadata = claudeTaskMetadata(message);
|
|
1015
|
+
const metadata = {};
|
|
1016
|
+
if (existing?.metadata) Object.assign(metadata, existing.metadata);
|
|
1017
|
+
if (taskMetadata) Object.assign(metadata, taskMetadata);
|
|
1018
|
+
return {
|
|
1019
|
+
subagentId: existing?.subagentId ?? require_collectUint8StreamText.RuntimeSubagentId.make(`claude-task:${message.task_id}`),
|
|
1020
|
+
origin: "native",
|
|
1021
|
+
capability: "summary",
|
|
1022
|
+
label,
|
|
1023
|
+
...description && { description },
|
|
1024
|
+
providerTaskId: require_collectUint8StreamText.RuntimeTaskId.make(message.task_id),
|
|
1025
|
+
...Object.keys(metadata).length > 0 && { metadata }
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
946
1028
|
function classifyToolItemType(toolName) {
|
|
947
1029
|
const normalized = toolName.toLowerCase();
|
|
948
1030
|
if (normalized.includes("agent")) return "collab_agent_tool_call";
|
|
@@ -1248,6 +1330,82 @@ const makeClaudeAdapter = effect.Effect.fn("makeClaudeAdapter")(function* (claud
|
|
|
1248
1330
|
createdAt: nowIso
|
|
1249
1331
|
});
|
|
1250
1332
|
const offerRuntimeEvent = (event) => effect.Queue.offer(runtimeEventQueue, event).pipe(effect.Effect.andThen(runtimeEventQueueMetrics.recordEnqueued()), effect.Effect.asVoid);
|
|
1333
|
+
const emitClaudeSubagentStarted = effect.Effect.fn("emitClaudeSubagentStarted")(function* (context, subagent, raw) {
|
|
1334
|
+
const key = String(subagent.subagentId);
|
|
1335
|
+
if (context.startedSubagentIds.has(key)) return;
|
|
1336
|
+
context.startedSubagentIds.add(key);
|
|
1337
|
+
const stamp = yield* makeEventStamp();
|
|
1338
|
+
yield* offerRuntimeEvent({
|
|
1339
|
+
type: "subagent.started",
|
|
1340
|
+
eventId: stamp.eventId,
|
|
1341
|
+
provider: PROVIDER,
|
|
1342
|
+
createdAt: stamp.createdAt,
|
|
1343
|
+
threadId: context.session.threadId,
|
|
1344
|
+
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
1345
|
+
payload: { subagent },
|
|
1346
|
+
providerRefs: nativeProviderRefs(context),
|
|
1347
|
+
raw: {
|
|
1348
|
+
source: "claude.sdk.message",
|
|
1349
|
+
method: sdkNativeMethod(raw),
|
|
1350
|
+
messageType: `${raw.type}:${sdkMessageSubtype(raw) ?? ""}`,
|
|
1351
|
+
payload: raw
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
const emitClaudeSubagentUpdated = effect.Effect.fn("emitClaudeSubagentUpdated")(function* (context, input) {
|
|
1356
|
+
yield* emitClaudeSubagentStarted(context, input.subagent, input.raw);
|
|
1357
|
+
const stamp = yield* makeEventStamp();
|
|
1358
|
+
yield* offerRuntimeEvent({
|
|
1359
|
+
type: "subagent.updated",
|
|
1360
|
+
eventId: stamp.eventId,
|
|
1361
|
+
provider: PROVIDER,
|
|
1362
|
+
createdAt: stamp.createdAt,
|
|
1363
|
+
threadId: context.session.threadId,
|
|
1364
|
+
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
1365
|
+
payload: {
|
|
1366
|
+
subagent: input.subagent,
|
|
1367
|
+
...input.status ? { status: input.status } : {},
|
|
1368
|
+
...input.summary ? { summary: input.summary } : {},
|
|
1369
|
+
...input.detail ? { detail: input.detail } : {},
|
|
1370
|
+
...input.usage !== void 0 ? { usage: input.usage } : {}
|
|
1371
|
+
},
|
|
1372
|
+
providerRefs: nativeProviderRefs(context),
|
|
1373
|
+
raw: {
|
|
1374
|
+
source: "claude.sdk.message",
|
|
1375
|
+
method: sdkNativeMethod(input.raw),
|
|
1376
|
+
messageType: `${input.raw.type}:${sdkMessageSubtype(input.raw) ?? ""}`,
|
|
1377
|
+
payload: input.raw
|
|
1378
|
+
}
|
|
1379
|
+
});
|
|
1380
|
+
});
|
|
1381
|
+
const emitClaudeSubagentCompleted = effect.Effect.fn("emitClaudeSubagentCompleted")(function* (context, input) {
|
|
1382
|
+
const key = String(input.subagent.subagentId);
|
|
1383
|
+
if (context.completedSubagentIds.has(key)) return;
|
|
1384
|
+
yield* emitClaudeSubagentStarted(context, input.subagent, input.raw);
|
|
1385
|
+
context.completedSubagentIds.add(key);
|
|
1386
|
+
const stamp = yield* makeEventStamp();
|
|
1387
|
+
yield* offerRuntimeEvent({
|
|
1388
|
+
type: "subagent.completed",
|
|
1389
|
+
eventId: stamp.eventId,
|
|
1390
|
+
provider: PROVIDER,
|
|
1391
|
+
createdAt: stamp.createdAt,
|
|
1392
|
+
threadId: context.session.threadId,
|
|
1393
|
+
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
1394
|
+
payload: {
|
|
1395
|
+
subagent: input.subagent,
|
|
1396
|
+
status: input.status,
|
|
1397
|
+
...input.summary ? { summary: input.summary } : {},
|
|
1398
|
+
...input.usage !== void 0 ? { usage: input.usage } : {}
|
|
1399
|
+
},
|
|
1400
|
+
providerRefs: nativeProviderRefs(context),
|
|
1401
|
+
raw: {
|
|
1402
|
+
source: "claude.sdk.message",
|
|
1403
|
+
method: sdkNativeMethod(input.raw),
|
|
1404
|
+
messageType: `${input.raw.type}:${sdkMessageSubtype(input.raw) ?? ""}`,
|
|
1405
|
+
payload: input.raw
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
});
|
|
1251
1409
|
const logNativeSdkMessage = effect.Effect.fn("logNativeSdkMessage")(function* (context, message) {
|
|
1252
1410
|
if (!nativeEventLogger) return;
|
|
1253
1411
|
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -2035,6 +2193,11 @@ const makeClaudeAdapter = effect.Effect.fn("makeClaudeAdapter")(function* (claud
|
|
|
2035
2193
|
...message.task_type ? { taskType: message.task_type } : {}
|
|
2036
2194
|
}
|
|
2037
2195
|
});
|
|
2196
|
+
if (isClaudeSubagentTaskMessage(message)) {
|
|
2197
|
+
const subagent = makeClaudeTaskSubagentRef(context.subagentByTaskId.get(message.task_id), message);
|
|
2198
|
+
context.subagentByTaskId.set(message.task_id, subagent);
|
|
2199
|
+
yield* emitClaudeSubagentStarted(context, subagent, message);
|
|
2200
|
+
}
|
|
2038
2201
|
return;
|
|
2039
2202
|
case "task_progress":
|
|
2040
2203
|
if (message.usage) {
|
|
@@ -2062,6 +2225,18 @@ const makeClaudeAdapter = effect.Effect.fn("makeClaudeAdapter")(function* (claud
|
|
|
2062
2225
|
...message.last_tool_name ? { lastToolName: message.last_tool_name } : {}
|
|
2063
2226
|
}
|
|
2064
2227
|
});
|
|
2228
|
+
if (isClaudeSubagentTaskMessage(message) || context.subagentByTaskId.has(message.task_id)) {
|
|
2229
|
+
const subagent = makeClaudeTaskSubagentRef(context.subagentByTaskId.get(message.task_id), message);
|
|
2230
|
+
context.subagentByTaskId.set(message.task_id, subagent);
|
|
2231
|
+
yield* emitClaudeSubagentUpdated(context, {
|
|
2232
|
+
subagent,
|
|
2233
|
+
status: claudeTaskSubagentStatus("running"),
|
|
2234
|
+
...message.summary ? { summary: message.summary } : {},
|
|
2235
|
+
detail: message.description,
|
|
2236
|
+
...message.usage ? { usage: message.usage } : {},
|
|
2237
|
+
raw: message
|
|
2238
|
+
});
|
|
2239
|
+
}
|
|
2065
2240
|
return;
|
|
2066
2241
|
case "task_notification":
|
|
2067
2242
|
if (message.usage) {
|
|
@@ -2088,6 +2263,17 @@ const makeClaudeAdapter = effect.Effect.fn("makeClaudeAdapter")(function* (claud
|
|
|
2088
2263
|
...message.usage ? { usage: message.usage } : {}
|
|
2089
2264
|
}
|
|
2090
2265
|
});
|
|
2266
|
+
if (isClaudeSubagentTaskMessage(message) || context.subagentByTaskId.has(message.task_id)) {
|
|
2267
|
+
const subagent = makeClaudeTaskSubagentRef(context.subagentByTaskId.get(message.task_id), message);
|
|
2268
|
+
context.subagentByTaskId.set(message.task_id, subagent);
|
|
2269
|
+
yield* emitClaudeSubagentCompleted(context, {
|
|
2270
|
+
subagent,
|
|
2271
|
+
status: claudeTaskCompletionStatus(message.status),
|
|
2272
|
+
...message.summary ? { summary: message.summary } : {},
|
|
2273
|
+
...message.usage ? { usage: message.usage } : {},
|
|
2274
|
+
raw: message
|
|
2275
|
+
});
|
|
2276
|
+
}
|
|
2091
2277
|
return;
|
|
2092
2278
|
case "files_persisted":
|
|
2093
2279
|
yield* offerRuntimeEvent({
|
|
@@ -2636,6 +2822,9 @@ const makeClaudeAdapter = effect.Effect.fn("makeClaudeAdapter")(function* (claud
|
|
|
2636
2822
|
lastKnownTokenUsage: void 0,
|
|
2637
2823
|
lastAssistantUuid: resumeState?.resumeSessionAt,
|
|
2638
2824
|
lastThreadStartedId: void 0,
|
|
2825
|
+
subagentByTaskId: /* @__PURE__ */ new Map(),
|
|
2826
|
+
startedSubagentIds: /* @__PURE__ */ new Set(),
|
|
2827
|
+
completedSubagentIds: /* @__PURE__ */ new Set(),
|
|
2639
2828
|
stopped: false
|
|
2640
2829
|
};
|
|
2641
2830
|
yield* effect.Ref.set(contextRef, context);
|
|
@@ -2706,7 +2895,7 @@ const makeClaudeAdapter = effect.Effect.fn("makeClaudeAdapter")(function* (claud
|
|
|
2706
2895
|
model: modelSelection.model
|
|
2707
2896
|
};
|
|
2708
2897
|
}
|
|
2709
|
-
if (input.interactionMode === "plan") yield* effect.Effect.tryPromise({
|
|
2898
|
+
if (input.interactionMode === "plan" || input.interactionMode === "ask") yield* effect.Effect.tryPromise({
|
|
2710
2899
|
try: () => context.query.setPermissionMode("plan"),
|
|
2711
2900
|
catch: (cause) => toRequestError(input.threadId, "turn/setPermissionMode", cause)
|
|
2712
2901
|
});
|
|
@@ -3072,6 +3261,7 @@ const ClaudeDriver = {
|
|
|
3072
3261
|
const spawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
3073
3262
|
const path = yield* effect.Path.Path;
|
|
3074
3263
|
const httpClient = yield* effect_unstable_http.HttpClient.HttpClient;
|
|
3264
|
+
const serverSettings = yield* require_bin.ServerSettingsService;
|
|
3075
3265
|
const eventLoggers = yield* require_bin.ProviderEventLoggers;
|
|
3076
3266
|
const processEnv = require_bin.mergeProviderInstanceEnvironment(environment);
|
|
3077
3267
|
const fallbackContinuationIdentity = require_ProviderDriver.defaultProviderContinuationIdentity({
|
|
@@ -3118,7 +3308,7 @@ const ClaudeDriver = {
|
|
|
3118
3308
|
haveSettingsChanged: () => false,
|
|
3119
3309
|
initialSnapshot: (settings) => stampIdentity(makePendingClaudeProvider(settings)),
|
|
3120
3310
|
checkProvider,
|
|
3121
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => require_bin.enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(effect.Effect.provideService(effect_unstable_http.HttpClient.HttpClient, httpClient), effect.Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
3311
|
+
enrichSnapshot: ({ snapshot, publishSnapshot }) => require_bin.enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(effect.Effect.provideService(effect_unstable_http.HttpClient.HttpClient, httpClient), effect.Effect.provideService(require_bin.ServerSettingsService, serverSettings), effect.Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
3122
3312
|
refreshInterval: null
|
|
3123
3313
|
}).pipe(effect.Effect.mapError((cause) => new require_bin.ProviderDriverError({
|
|
3124
3314
|
driver: DRIVER_KIND,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const require_chunk = require("./chunk-jM1PLTSZ.cjs");
|
|
4
|
-
const require_collectUint8StreamText = require("./collectUint8StreamText-
|
|
4
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-B-GW3u_2.cjs");
|
|
5
5
|
const require_Metrics = require("./Metrics-CIW1QH7M.cjs");
|
|
6
6
|
const require_bin = require("./bin.cjs");
|
|
7
|
-
const require_makeManagedServerProvider = require("./makeManagedServerProvider-
|
|
7
|
+
const require_makeManagedServerProvider = require("./makeManagedServerProvider-DTsQ87HL.cjs");
|
|
8
8
|
const require_sourceControlContextFormatter = require("./sourceControlContextFormatter-BDZqn-4T.cjs");
|
|
9
9
|
const require_ProjectCustomSystemPrompt = require("./ProjectCustomSystemPrompt-B8SUlNGa.cjs");
|
|
10
|
-
const require_CodexTextGeneration = require("./CodexTextGeneration-
|
|
10
|
+
const require_CodexTextGeneration = require("./CodexTextGeneration-Db2hn8Qz.cjs");
|
|
11
11
|
let effect = require("effect");
|
|
12
12
|
let effect_unstable_http = require("effect/unstable/http");
|
|
13
13
|
let effect_unstable_process = require("effect/unstable/process");
|
|
@@ -135,11 +135,37 @@ Do not ask "should I proceed?" in the final output. The user can easily switch o
|
|
|
135
135
|
|
|
136
136
|
Only produce at most one \`<proposed_plan>\` block per turn, and only when you are presenting a complete spec.
|
|
137
137
|
</collaboration_mode>`;
|
|
138
|
+
const CODEX_ASK_MODE_DEVELOPER_INSTRUCTIONS = `<collaboration_mode># Collaboration Mode: Ask (Read-Only)
|
|
139
|
+
|
|
140
|
+
You are now in Ask mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
|
|
141
|
+
|
|
142
|
+
Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default, Plan, and Ask.
|
|
143
|
+
|
|
144
|
+
## Mode rules (strict)
|
|
145
|
+
|
|
146
|
+
Ask mode is a read-only question-answering mode. Answer the user's questions by exploring and inspecting the environment; do not carry out changes.
|
|
147
|
+
|
|
148
|
+
You are in Ask mode until a developer message explicitly ends it. Ask mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Ask mode, explain what you would do and note that they can switch out of Ask mode to have it done.
|
|
149
|
+
|
|
150
|
+
### Allowed (non-mutating)
|
|
151
|
+
|
|
152
|
+
* Reading or searching files, configs, schemas, types, manifests, and docs
|
|
153
|
+
* Static analysis, inspection, and repo exploration
|
|
154
|
+
* Non-mutating commands that gather information without changing repo-tracked state
|
|
155
|
+
|
|
156
|
+
### Not allowed (mutating)
|
|
157
|
+
|
|
158
|
+
* Editing or writing files
|
|
159
|
+
* Running formatters, linters, patches, migrations, or codegen that rewrite files
|
|
160
|
+
* Side-effectful commands that change repo-tracked or system state
|
|
161
|
+
|
|
162
|
+
Your sandbox is read-only in this mode; mutating actions will fail. Do not attempt to work around the sandbox.
|
|
163
|
+
</collaboration_mode>`;
|
|
138
164
|
const CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS = `<collaboration_mode># Collaboration Mode: Default
|
|
139
165
|
|
|
140
166
|
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
|
|
141
167
|
|
|
142
|
-
Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default and
|
|
168
|
+
Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default, Plan, and Ask.
|
|
143
169
|
|
|
144
170
|
## request_user_input availability
|
|
145
171
|
|
|
@@ -235,9 +261,9 @@ function runtimeModeToTurnSandboxPolicy(input) {
|
|
|
235
261
|
function buildCodexCollaborationMode(input) {
|
|
236
262
|
if (input.interactionMode === void 0) return;
|
|
237
263
|
const model = normalizeCodexModelSlug(input.model) ?? "gpt-5.4";
|
|
238
|
-
const developerInstructions = require_ProjectCustomSystemPrompt.appendProjectCustomSystemPrompt(require_ProjectCustomSystemPrompt.appendProjectCustomSystemPrompt(input.interactionMode === "plan" ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS, input.tokenReductionInstructions), input.customSystemPrompt);
|
|
264
|
+
const developerInstructions = require_ProjectCustomSystemPrompt.appendProjectCustomSystemPrompt(require_ProjectCustomSystemPrompt.appendProjectCustomSystemPrompt(input.interactionMode === "plan" ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS : input.interactionMode === "ask" ? CODEX_ASK_MODE_DEVELOPER_INSTRUCTIONS : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS, input.tokenReductionInstructions), input.customSystemPrompt);
|
|
239
265
|
return {
|
|
240
|
-
mode: input.interactionMode,
|
|
266
|
+
mode: input.interactionMode === "plan" ? "plan" : "default",
|
|
241
267
|
settings: {
|
|
242
268
|
model,
|
|
243
269
|
reasoning_effort: input.effort ?? "medium",
|
|
@@ -260,11 +286,12 @@ function buildTurnStartParams(input) {
|
|
|
260
286
|
...input.customSystemPrompt ? { customSystemPrompt: input.customSystemPrompt } : {},
|
|
261
287
|
...input.tokenReductionInstructions ? { tokenReductionInstructions: input.tokenReductionInstructions } : {}
|
|
262
288
|
});
|
|
289
|
+
const sandboxPolicy = input.interactionMode === "ask" ? { type: "readOnly" } : runtimeModeToTurnSandboxPolicy(input.runtimeMode);
|
|
263
290
|
return effect.Schema.decodeUnknownEffect(CodexTurnStartParamsWithCollaborationMode)({
|
|
264
291
|
threadId: input.threadId,
|
|
265
292
|
input: turnInput,
|
|
266
293
|
approvalPolicy: config.approvalPolicy,
|
|
267
|
-
sandboxPolicy
|
|
294
|
+
sandboxPolicy,
|
|
268
295
|
...input.model ? { model: input.model } : {},
|
|
269
296
|
...input.serviceTier ? { serviceTier: input.serviceTier } : {},
|
|
270
297
|
...input.effort ? { effort: input.effort } : {},
|
|
@@ -1961,6 +1988,7 @@ const CodexDriver = {
|
|
|
1961
1988
|
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) => effect.Effect.gen(function* () {
|
|
1962
1989
|
const spawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
1963
1990
|
const httpClient = yield* effect_unstable_http.HttpClient.HttpClient;
|
|
1991
|
+
const serverSettings = yield* require_bin.ServerSettingsService;
|
|
1964
1992
|
const eventLoggers = yield* require_bin.ProviderEventLoggers;
|
|
1965
1993
|
const processEnv = require_bin.mergeProviderInstanceEnvironment(environment);
|
|
1966
1994
|
const homeLayout = yield* require_bin.resolveCodexHomeLayout(config);
|
|
@@ -2007,7 +2035,7 @@ const CodexDriver = {
|
|
|
2007
2035
|
haveSettingsChanged: () => false,
|
|
2008
2036
|
initialSnapshot: (settings) => stampIdentity(require_bin.makePendingCodexProvider(settings)),
|
|
2009
2037
|
checkProvider,
|
|
2010
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => require_bin.enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(effect.Effect.provideService(effect_unstable_http.HttpClient.HttpClient, httpClient), effect.Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2038
|
+
enrichSnapshot: ({ snapshot, publishSnapshot }) => require_bin.enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(effect.Effect.provideService(effect_unstable_http.HttpClient.HttpClient, httpClient), effect.Effect.provideService(require_bin.ServerSettingsService, serverSettings), effect.Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2011
2039
|
refreshInterval: null
|
|
2012
2040
|
}).pipe(effect.Effect.mapError((cause) => new require_bin.ProviderDriverError({
|
|
2013
2041
|
driver: DRIVER_KIND,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Bn as ProviderInstanceId, Gt as ProviderApprovalDecision, It as PROVIDER_SEND_TURN_MAX_IMAGE_BYTES, L as CodexSettings, Sr as TurnId, _r as RuntimeRequestId, gr as RuntimeItemId, hr as ProviderItemId, lr as EventId, nr as ApprovalRequestId, zn as ProviderDriverKind } from "./collectUint8StreamText-COE2_gie.mjs";
|
|
4
4
|
import { Y as ServerConfig } from "./Metrics-6Xj17Se3.mjs";
|
|
5
|
-
import { $ as ServerRequest__CommandExecutionRequestApprovalParams, At as V2ThreadStatusChangedNotification, B as codexContinuationIdentity, Ct as V2ThreadNameUpdatedNotification, Dt as V2ThreadRealtimeOutputAudioDeltaNotification, Et as V2ThreadRealtimeItemAddedNotification, F as ProviderAdapterRequestError, Ft as V2TurnStartParams, G as layerChildProcess, H as resolveCodexHomeLayout, I as ProviderAdapterSessionClosedError, It as V2TurnStartParams__CollaborationMode, J as CodexAppServerRequestError, K as CodexAppServerProcessExitedError, L as ProviderAdapterSessionNotFoundError, Lt as V2TurnStartResponse, Mt as V2TurnCompletedNotification, Nt as V2TurnDiffUpdatedNotification, Ot as V2ThreadRealtimeStartedNotification, P as ProviderAdapterProcessError, Pt as V2TurnPlanUpdatedNotification, Q as ServerRequest__ApplyPatchApprovalParams, Qt as makePackageManagedProviderMaintenanceResolver, R as ProviderAdapterValidationError, Rt as V2WindowsSandboxSetupCompletedNotification, S as makePendingCodexProvider, St as V2ServerRequestResolvedNotification, Tt as V2ThreadRealtimeErrorNotification, U as expandHomePath, V as materializeCodexShadowHome, W as CodexAppServerClient, X as CodexAppServerTransportError, Xt as enrichProviderSnapshotWithVersionAdvisory, Y as CodexAppServerSpawnError, Z as SERVER_NOTIFICATION_METHODS, _ as buildTokenReductionInstructions, _t as V2McpToolCallProgressNotification, at as ToolRequestUserInputResponse, b as buildCodexInitializeParams, bt as V2ReasoningSummaryTextDeltaNotification,
|
|
6
|
-
import { t as makeManagedServerProvider } from "./makeManagedServerProvider-
|
|
5
|
+
import { $ as ServerRequest__CommandExecutionRequestApprovalParams, At as V2ThreadStatusChangedNotification, B as codexContinuationIdentity, Ct as V2ThreadNameUpdatedNotification, Dt as V2ThreadRealtimeOutputAudioDeltaNotification, Et as V2ThreadRealtimeItemAddedNotification, F as ProviderAdapterRequestError, Ft as V2TurnStartParams, G as layerChildProcess, H as resolveCodexHomeLayout, I as ProviderAdapterSessionClosedError, It as V2TurnStartParams__CollaborationMode, J as CodexAppServerRequestError, K as CodexAppServerProcessExitedError, L as ProviderAdapterSessionNotFoundError, Lt as V2TurnStartResponse, Mt as V2TurnCompletedNotification, Nt as V2TurnDiffUpdatedNotification, Ot as V2ThreadRealtimeStartedNotification, P as ProviderAdapterProcessError, Pt as V2TurnPlanUpdatedNotification, Q as ServerRequest__ApplyPatchApprovalParams, Qt as makePackageManagedProviderMaintenanceResolver, R as ProviderAdapterValidationError, Rt as V2WindowsSandboxSetupCompletedNotification, S as makePendingCodexProvider, St as V2ServerRequestResolvedNotification, Tt as V2ThreadRealtimeErrorNotification, U as expandHomePath, V as materializeCodexShadowHome, W as CodexAppServerClient, X as CodexAppServerTransportError, Xt as enrichProviderSnapshotWithVersionAdvisory, Y as CodexAppServerSpawnError, Z as SERVER_NOTIFICATION_METHODS, _ as buildTokenReductionInstructions, _t as V2McpToolCallProgressNotification, an as resolveAttachmentPath, at as ToolRequestUserInputResponse, b as buildCodexInitializeParams, bt as V2ReasoningSummaryTextDeltaNotification, ct as V2AgentMessageDeltaNotification, dt as V2DeprecationNoticeNotification, et as ServerRequest__DynamicToolCallParams, ft as V2ErrorNotification, g as makeEventNdjsonLogger, gt as V2McpServerOauthLoginCompletedNotification, h as ProviderEventLoggers, hn as normalizeModelSlug, ht as V2ItemStartedNotification, in as ServerSettingsService, it as ToolRequestUserInputParams, jt as V2ThreadTokenUsageUpdatedNotification, kt as V2ThreadStartedNotification, ln as getModelSelectionBooleanOptionValue, lt as V2CommandExecutionOutputDeltaNotification, mt as V2ItemCompletedNotification, nn as resolveProviderMaintenanceCapabilitiesEffect, nt as ServerRequest__FileChangeRequestApprovalParams, ot as V2AccountRateLimitsUpdatedNotification, pt as V2FileChangeOutputDeltaNotification, q as CodexAppServerProtocolParseError, rt as ServerRequest__ToolRequestUserInputParams, st as V2AccountUpdatedNotification, t as makeServerQueueMetrics, tt as ServerRequest__ExecCommandApprovalParams, un as getModelSelectionStringOptionValue, ut as V2ConfigWarningNotification, v as checkRtkAvailability, vt as V2ModelReroutedNotification, wt as V2ThreadRealtimeClosedNotification, x as checkCodexProviderStatus, xt as V2ReasoningTextDeltaNotification, y as mergeProviderInstanceEnvironment, yt as V2PlanDeltaNotification, z as ProviderDriverError, zt as V2WindowsWorldWritableWarningNotification } from "./bin.mjs";
|
|
6
|
+
import { t as makeManagedServerProvider } from "./makeManagedServerProvider-D1_iEWGi.mjs";
|
|
7
7
|
import { t as formatSourceControlContextsForAgent } from "./sourceControlContextFormatter-DEwpnVAH.mjs";
|
|
8
8
|
import { t as appendProjectCustomSystemPrompt } from "./ProjectCustomSystemPrompt-CS1nulhL.mjs";
|
|
9
|
-
import { t as makeCodexTextGeneration } from "./CodexTextGeneration-
|
|
9
|
+
import { t as makeCodexTextGeneration } from "./CodexTextGeneration-CJV1jPda.mjs";
|
|
10
10
|
import { Deferred, Effect, Exit, Fiber, FileSystem, Layer, Queue, Random, Ref, Schema, Scope, Stream } from "effect";
|
|
11
11
|
import { HttpClient } from "effect/unstable/http";
|
|
12
12
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
|
|
@@ -133,11 +133,37 @@ Do not ask "should I proceed?" in the final output. The user can easily switch o
|
|
|
133
133
|
|
|
134
134
|
Only produce at most one \`<proposed_plan>\` block per turn, and only when you are presenting a complete spec.
|
|
135
135
|
</collaboration_mode>`;
|
|
136
|
+
const CODEX_ASK_MODE_DEVELOPER_INSTRUCTIONS = `<collaboration_mode># Collaboration Mode: Ask (Read-Only)
|
|
137
|
+
|
|
138
|
+
You are now in Ask mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
|
|
139
|
+
|
|
140
|
+
Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default, Plan, and Ask.
|
|
141
|
+
|
|
142
|
+
## Mode rules (strict)
|
|
143
|
+
|
|
144
|
+
Ask mode is a read-only question-answering mode. Answer the user's questions by exploring and inspecting the environment; do not carry out changes.
|
|
145
|
+
|
|
146
|
+
You are in Ask mode until a developer message explicitly ends it. Ask mode is not changed by user intent, tone, or imperative language. If a user asks for execution while still in Ask mode, explain what you would do and note that they can switch out of Ask mode to have it done.
|
|
147
|
+
|
|
148
|
+
### Allowed (non-mutating)
|
|
149
|
+
|
|
150
|
+
* Reading or searching files, configs, schemas, types, manifests, and docs
|
|
151
|
+
* Static analysis, inspection, and repo exploration
|
|
152
|
+
* Non-mutating commands that gather information without changing repo-tracked state
|
|
153
|
+
|
|
154
|
+
### Not allowed (mutating)
|
|
155
|
+
|
|
156
|
+
* Editing or writing files
|
|
157
|
+
* Running formatters, linters, patches, migrations, or codegen that rewrite files
|
|
158
|
+
* Side-effectful commands that change repo-tracked or system state
|
|
159
|
+
|
|
160
|
+
Your sandbox is read-only in this mode; mutating actions will fail. Do not attempt to work around the sandbox.
|
|
161
|
+
</collaboration_mode>`;
|
|
136
162
|
const CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS = `<collaboration_mode># Collaboration Mode: Default
|
|
137
163
|
|
|
138
164
|
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
|
|
139
165
|
|
|
140
|
-
Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default and
|
|
166
|
+
Your active mode changes only when new developer instructions with a different \`<collaboration_mode>...</collaboration_mode>\` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default, Plan, and Ask.
|
|
141
167
|
|
|
142
168
|
## request_user_input availability
|
|
143
169
|
|
|
@@ -233,9 +259,9 @@ function runtimeModeToTurnSandboxPolicy(input) {
|
|
|
233
259
|
function buildCodexCollaborationMode(input) {
|
|
234
260
|
if (input.interactionMode === void 0) return;
|
|
235
261
|
const model = normalizeCodexModelSlug(input.model) ?? "gpt-5.4";
|
|
236
|
-
const developerInstructions = appendProjectCustomSystemPrompt(appendProjectCustomSystemPrompt(input.interactionMode === "plan" ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS, input.tokenReductionInstructions), input.customSystemPrompt);
|
|
262
|
+
const developerInstructions = appendProjectCustomSystemPrompt(appendProjectCustomSystemPrompt(input.interactionMode === "plan" ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS : input.interactionMode === "ask" ? CODEX_ASK_MODE_DEVELOPER_INSTRUCTIONS : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS, input.tokenReductionInstructions), input.customSystemPrompt);
|
|
237
263
|
return {
|
|
238
|
-
mode: input.interactionMode,
|
|
264
|
+
mode: input.interactionMode === "plan" ? "plan" : "default",
|
|
239
265
|
settings: {
|
|
240
266
|
model,
|
|
241
267
|
reasoning_effort: input.effort ?? "medium",
|
|
@@ -258,11 +284,12 @@ function buildTurnStartParams(input) {
|
|
|
258
284
|
...input.customSystemPrompt ? { customSystemPrompt: input.customSystemPrompt } : {},
|
|
259
285
|
...input.tokenReductionInstructions ? { tokenReductionInstructions: input.tokenReductionInstructions } : {}
|
|
260
286
|
});
|
|
287
|
+
const sandboxPolicy = input.interactionMode === "ask" ? { type: "readOnly" } : runtimeModeToTurnSandboxPolicy(input.runtimeMode);
|
|
261
288
|
return Schema.decodeUnknownEffect(CodexTurnStartParamsWithCollaborationMode)({
|
|
262
289
|
threadId: input.threadId,
|
|
263
290
|
input: turnInput,
|
|
264
291
|
approvalPolicy: config.approvalPolicy,
|
|
265
|
-
sandboxPolicy
|
|
292
|
+
sandboxPolicy,
|
|
266
293
|
...input.model ? { model: input.model } : {},
|
|
267
294
|
...input.serviceTier ? { serviceTier: input.serviceTier } : {},
|
|
268
295
|
...input.effort ? { effort: input.effort } : {},
|
|
@@ -1959,6 +1986,7 @@ const CodexDriver = {
|
|
|
1959
1986
|
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) => Effect.gen(function* () {
|
|
1960
1987
|
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
1961
1988
|
const httpClient = yield* HttpClient.HttpClient;
|
|
1989
|
+
const serverSettings = yield* ServerSettingsService;
|
|
1962
1990
|
const eventLoggers = yield* ProviderEventLoggers;
|
|
1963
1991
|
const processEnv = mergeProviderInstanceEnvironment(environment);
|
|
1964
1992
|
const homeLayout = yield* resolveCodexHomeLayout(config);
|
|
@@ -2005,7 +2033,7 @@ const CodexDriver = {
|
|
|
2005
2033
|
haveSettingsChanged: () => false,
|
|
2006
2034
|
initialSnapshot: (settings) => stampIdentity(makePendingCodexProvider(settings)),
|
|
2007
2035
|
checkProvider,
|
|
2008
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2036
|
+
enrichSnapshot: ({ snapshot, publishSnapshot }) => enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.provideService(ServerSettingsService, serverSettings), Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2009
2037
|
refreshInterval: null
|
|
2010
2038
|
}).pipe(Effect.mapError((cause) => new ProviderDriverError({
|
|
2011
2039
|
driver: DRIVER_KIND,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { x as TextGenerationError } from "./collectUint8StreamText-COE2_gie.mjs";
|
|
4
4
|
import { U as sanitizeBranchFragment, W as sanitizeFeatureBranchName, Y as ServerConfig } from "./Metrics-6Xj17Se3.mjs";
|
|
5
|
-
import { U as expandHomePath,
|
|
6
|
-
import { a as buildIssueContentTitlePrompt, d as sanitizePrTitle, f as sanitizeThreadTitle, i as buildIssueContentPolishPrompt, l as normalizeCliError, n as buildBranchNamePrompt, o as buildPrContentPrompt, p as toJsonSchemaObject, r as buildCommitMessagePrompt, s as buildThreadTitlePrompt, u as sanitizeCommitSubject } from "./makeManagedServerProvider-
|
|
5
|
+
import { U as expandHomePath, an as resolveAttachmentPath, ln as getModelSelectionBooleanOptionValue, un as getModelSelectionStringOptionValue } from "./bin.mjs";
|
|
6
|
+
import { a as buildIssueContentTitlePrompt, d as sanitizePrTitle, f as sanitizeThreadTitle, i as buildIssueContentPolishPrompt, l as normalizeCliError, n as buildBranchNamePrompt, o as buildPrContentPrompt, p as toJsonSchemaObject, r as buildCommitMessagePrompt, s as buildThreadTitlePrompt, u as sanitizeCommitSubject } from "./makeManagedServerProvider-D1_iEWGi.mjs";
|
|
7
7
|
import { Effect, FileSystem, Option, Path, Random, Schema, Stream } from "effect";
|
|
8
8
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
|
|
9
9
|
//#region src/textGeneration/CodexTextGeneration.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const require_collectUint8StreamText = require("./collectUint8StreamText-
|
|
3
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-B-GW3u_2.cjs");
|
|
4
4
|
const require_Metrics = require("./Metrics-CIW1QH7M.cjs");
|
|
5
5
|
const require_bin = require("./bin.cjs");
|
|
6
|
-
const require_makeManagedServerProvider = require("./makeManagedServerProvider-
|
|
6
|
+
const require_makeManagedServerProvider = require("./makeManagedServerProvider-DTsQ87HL.cjs");
|
|
7
7
|
let effect = require("effect");
|
|
8
8
|
let effect_unstable_process = require("effect/unstable/process");
|
|
9
9
|
//#region src/textGeneration/CodexTextGeneration.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Bn as ProviderInstanceId, In as DEFAULT_GIT_TEXT_GENERATION_MODEL_BY_PROVIDER, L as CodexSettings, R as CopilotSettings, Sr as TurnId, _r as RuntimeRequestId, gr as RuntimeItemId, hr as ProviderItemId, lr as EventId, x as TextGenerationError, zn as ProviderDriverKind } from "./collectUint8StreamText-COE2_gie.mjs";
|
|
4
4
|
import { Y as ServerConfig } from "./Metrics-6Xj17Se3.mjs";
|
|
5
|
-
import { E as buildServerProvider, F as ProviderAdapterRequestError, L as ProviderAdapterSessionNotFoundError, M as providerModelsFromSettings, P as ProviderAdapterProcessError, R as ProviderAdapterValidationError, T as buildSelectOptionDescriptor, Zt as makeManualOnlyProviderMaintenanceCapabilities, an as
|
|
6
|
-
import { c as extractJsonObject, f as sanitizeThreadTitle, s as buildThreadTitlePrompt, t as makeManagedServerProvider } from "./makeManagedServerProvider-
|
|
5
|
+
import { E as buildServerProvider, F as ProviderAdapterRequestError, L as ProviderAdapterSessionNotFoundError, M as providerModelsFromSettings, P as ProviderAdapterProcessError, R as ProviderAdapterValidationError, T as buildSelectOptionDescriptor, Zt as makeManualOnlyProviderMaintenanceCapabilities, an as resolveAttachmentPath, cn as createModelCapabilities, g as makeEventNdjsonLogger, h as ProviderEventLoggers, k as isCommandMissingCause, mn as getProviderOptionStringSelectionValue, on as resolveCommandPath, t as makeServerQueueMetrics, un as getModelSelectionStringOptionValue, y as mergeProviderInstanceEnvironment, z as ProviderDriverError } from "./bin.mjs";
|
|
6
|
+
import { c as extractJsonObject, f as sanitizeThreadTitle, s as buildThreadTitlePrompt, t as makeManagedServerProvider } from "./makeManagedServerProvider-D1_iEWGi.mjs";
|
|
7
7
|
import { t as defaultProviderContinuationIdentity } from "./ProviderDriver-kCV60GKk.mjs";
|
|
8
|
-
import { t as makeCodexTextGeneration } from "./CodexTextGeneration-
|
|
8
|
+
import { t as makeCodexTextGeneration } from "./CodexTextGeneration-CJV1jPda.mjs";
|
|
9
9
|
import { Effect, Queue, Random, Result, Schema, Stream } from "effect";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
import "effect/unstable/process";
|
|
@@ -39,11 +39,12 @@ function toProviderItemId(value) {
|
|
|
39
39
|
return value ? ProviderItemId.make(value) : void 0;
|
|
40
40
|
}
|
|
41
41
|
function normalizeUsage(event) {
|
|
42
|
-
const
|
|
42
|
+
const directInputTokens = event.data.inputTokens ?? 0;
|
|
43
43
|
const outputTokens = event.data.outputTokens ?? 0;
|
|
44
44
|
const cachedInputTokens = event.data.cacheReadTokens ?? 0;
|
|
45
45
|
const reasoningOutputTokens = event.data.reasoningTokens ?? 0;
|
|
46
|
-
const
|
|
46
|
+
const inputTokens = directInputTokens + cachedInputTokens;
|
|
47
|
+
const usedTokens = inputTokens + outputTokens;
|
|
47
48
|
return {
|
|
48
49
|
usedTokens,
|
|
49
50
|
totalProcessedTokens: usedTokens,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const require_collectUint8StreamText = require("./collectUint8StreamText-
|
|
3
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-B-GW3u_2.cjs");
|
|
4
4
|
const require_Metrics = require("./Metrics-CIW1QH7M.cjs");
|
|
5
5
|
const require_bin = require("./bin.cjs");
|
|
6
|
-
const require_makeManagedServerProvider = require("./makeManagedServerProvider-
|
|
6
|
+
const require_makeManagedServerProvider = require("./makeManagedServerProvider-DTsQ87HL.cjs");
|
|
7
7
|
const require_ProviderDriver = require("./ProviderDriver--rNeAi3B.cjs");
|
|
8
|
-
const require_CodexTextGeneration = require("./CodexTextGeneration-
|
|
8
|
+
const require_CodexTextGeneration = require("./CodexTextGeneration-Db2hn8Qz.cjs");
|
|
9
9
|
let effect = require("effect");
|
|
10
10
|
let node_crypto = require("node:crypto");
|
|
11
11
|
require("effect/unstable/process");
|
|
@@ -39,11 +39,12 @@ function toProviderItemId(value) {
|
|
|
39
39
|
return value ? require_collectUint8StreamText.ProviderItemId.make(value) : void 0;
|
|
40
40
|
}
|
|
41
41
|
function normalizeUsage(event) {
|
|
42
|
-
const
|
|
42
|
+
const directInputTokens = event.data.inputTokens ?? 0;
|
|
43
43
|
const outputTokens = event.data.outputTokens ?? 0;
|
|
44
44
|
const cachedInputTokens = event.data.cacheReadTokens ?? 0;
|
|
45
45
|
const reasoningOutputTokens = event.data.reasoningTokens ?? 0;
|
|
46
|
-
const
|
|
46
|
+
const inputTokens = directInputTokens + cachedInputTokens;
|
|
47
|
+
const usedTokens = inputTokens + outputTokens;
|
|
47
48
|
return {
|
|
48
49
|
usedTokens,
|
|
49
50
|
totalProcessedTokens: usedTokens,
|