ryco-cli 0.1.5 → 0.1.7
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/README.md +50 -2
- package/dist/{AzureDevOpsSourceControlProvider-CdgNqZ5j.cjs → AzureDevOpsSourceControlProvider-5exivY-1.cjs} +2 -2
- package/dist/{AzureDevOpsSourceControlProvider-OsyDSESj.mjs → AzureDevOpsSourceControlProvider-CF5LuCHp.mjs} +3 -3
- package/dist/{BitbucketSourceControlProvider-DBTH98i4.cjs → BitbucketSourceControlProvider-1GWENqcl.cjs} +2 -2
- package/dist/{BitbucketSourceControlProvider-SQ3gKdFs.mjs → BitbucketSourceControlProvider-CKH09tfT.mjs} +3 -3
- package/dist/{BunPTY-B_vjRZN4.mjs → BunPTY-BWhtEA50.mjs} +1 -1
- package/dist/{ClaudeDriver-D9yC2F0b.cjs → ClaudeDriver-BXLdjrht.cjs} +187 -8
- package/dist/{ClaudeDriver-2dTtrsFD.mjs → ClaudeDriver-WwWFTu61.mjs} +188 -9
- package/dist/{CodexDriver-CIDYevQX.mjs → CodexDriver-93-TmCrO.mjs} +16 -8
- package/dist/{CodexDriver-BC2B-qpT.cjs → CodexDriver-BboMT9uk.cjs} +15 -7
- package/dist/{CodexTextGeneration-DNeO-8GE.cjs → CodexTextGeneration-0pRbJji3.cjs} +3 -3
- package/dist/{CodexTextGeneration-CjknB1Xl.mjs → CodexTextGeneration-BU9Myn87.mjs} +4 -4
- package/dist/{CopilotDriver-NPhlLrk2.mjs → CopilotDriver-BASi8pJ0.mjs} +15 -8
- package/dist/{CopilotDriver-BGChrP5c.cjs → CopilotDriver-DCsv-17W.cjs} +14 -7
- package/dist/{CursorDriver-CYxn4_c1.cjs → CursorDriver-BTSiM3A8.cjs} +163 -16
- package/dist/{CursorDriver-BcAVbT8D.mjs → CursorDriver-D5LvIqUk.mjs} +164 -17
- package/dist/{ForgejoSourceControlProvider-D3wP2Cav.cjs → ForgejoSourceControlProvider-BTXRDCGB.cjs} +2 -2
- package/dist/{ForgejoSourceControlProvider-BjCE3730.mjs → ForgejoSourceControlProvider-e-4hvvZ_.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-DByZ_cnw.mjs → GitHubSourceControlProvider-26IofDAO.mjs} +3 -3
- package/dist/{GitHubSourceControlProvider-DU_7IvMa.cjs → GitHubSourceControlProvider-DWmwkA_y.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-BVJ5IqTS.cjs → GitLabSourceControlProvider-D-YHnxRe.cjs} +2 -2
- package/dist/{GitLabSourceControlProvider-BdMCIjXb.mjs → GitLabSourceControlProvider-DePct78W.mjs} +3 -3
- package/dist/{Metrics-BCOc3Ml2.mjs → Metrics-6Xj17Se3.mjs} +94 -2
- package/dist/{Metrics-DNOriWhP.cjs → Metrics-CIW1QH7M.cjs} +128 -0
- package/dist/{NodePTY-_u3kQLvd.mjs → NodePTY-C_cR3Ayy.mjs} +1 -1
- package/dist/{OpenCodeDriver-fwqXoVyH.mjs → OpenCodeDriver-BhvLOmvn.mjs} +336 -43
- package/dist/{OpenCodeDriver-DyR83FcY.cjs → OpenCodeDriver-CVeZ4n9-.cjs} +335 -42
- package/dist/{SourceControlProviderDiscoveryCatalog-DqQVhwYM.cjs → SourceControlProviderDiscoveryCatalog-DeFR5xH3.cjs} +98 -161
- package/dist/{SourceControlProviderDiscoveryCatalog-CQiMyDCC.mjs → SourceControlProviderDiscoveryCatalog-mJV_Xitr.mjs} +100 -145
- package/dist/bin.cjs +30639 -28744
- package/dist/bin.mjs +30602 -28709
- package/dist/client/assets/{AnimatedHeight-CYuVQOpY.js → AnimatedHeight-BSU0lzYs.js} +1 -1
- package/dist/client/assets/AppearanceSettings-D7q0ujGK.js +1 -0
- package/dist/client/assets/BranchToolbar.logic-CZIFSvhd.js +1 -0
- package/dist/client/assets/ChatRightPanel-CWHOIuiQ.js +188 -0
- package/dist/client/assets/ChatThreadRouteView-bA7xWXzc.js +1 -0
- package/dist/client/assets/CommandPaletteDialog-DNYaVOZO.js +1 -0
- package/dist/client/assets/CompositeRoot-B_KEfCUE.js +1 -0
- package/dist/client/assets/ConnectionsSettings-CLZPbx_K.js +1 -0
- package/dist/client/assets/DiagnosticsSettings-DtzPCb6N.js +1 -0
- package/dist/client/assets/DialogHandle-DuHnmWoE.js +1 -0
- package/dist/client/assets/{DialogRoot-DaMwpoP_.js → DialogRoot-BV25qAcA.js} +1 -1
- package/dist/client/assets/DialogTitle-DQsi-RTa.js +1 -0
- package/dist/client/assets/DialogTrigger-D0fA01C6.js +1 -0
- package/dist/client/assets/DialogViewport-CMV_BePU.js +1 -0
- package/dist/client/assets/DraftChatThreadRouteView-BoiKnrii.js +1 -0
- package/dist/client/assets/JetBrainsIcons-BcPxJlMf.js +1 -0
- package/dist/client/assets/KeybindingsSettings-LuI98pdF.js +7 -0
- package/dist/client/assets/McpServersSettings-BFMuWYVV.js +6 -0
- package/dist/client/assets/NoActiveThreadState-C2q_O1kP.js +1 -0
- package/dist/client/assets/OpinionatedPluginsSettings-Bqwct37O.js +1 -0
- package/dist/client/assets/ProjectFavicon-D2imiJ8M.js +1 -0
- package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-BFzNCo3I.js → ProviderUpdateLaunchNotification.logic-CJgA--nK.js} +1 -1
- package/dist/client/assets/ProvidersSettingsPanel-B97vbeu6.js +1 -0
- package/dist/client/assets/{RedactedSensitiveText-UnZZJnFF.js → RedactedSensitiveText-B2GFTyfq.js} +1 -1
- package/dist/client/assets/RootAppShell-C1xTR98P.js +12 -0
- package/dist/client/assets/SettingsDialog-Q0Q8O5oH.js +2 -0
- package/dist/client/assets/SourceControlSettings-KAvoPTNi.js +1 -0
- package/dist/client/assets/StatisticsPanel-BzsQ444K.js +64 -0
- package/dist/client/assets/ThreadStatusIndicators-Cw_jLVQf.js +1 -0
- package/dist/client/assets/{ThreadTerminalDrawer-BXoXAbsR.js → ThreadTerminalDrawer-D1WnSemH.js} +17 -17
- package/dist/client/assets/ThreadWorkspacePanel-L4qCPTOA.js +166 -0
- package/dist/client/assets/{alert-dialog-BJQbh5gX.js → alert-dialog-CNmKa0BK.js} +1 -1
- package/dist/client/assets/chart-column-BWSKYZ_a.js +1 -0
- package/dist/client/assets/{chatThreadActions--n7v5mnB.js → chatThreadActions-TtDsiwDC.js} +1 -1
- package/dist/client/assets/chevron-up-zopJ_99l.js +1 -0
- package/dist/client/assets/{clamp-NYtK3f5s.js → clamp-Ds6WJu8j.js} +1 -1
- package/dist/client/assets/clipboard-copy-BoJGpdmJ.js +1 -0
- package/dist/client/assets/clock-CzUHThzk.js +1 -0
- package/dist/client/assets/commandPaletteStore-KebG835b.js +1 -0
- package/dist/client/assets/composerDraftStore-DpPEQ6BN.js +21 -0
- package/dist/client/assets/desktopUpdateAtoms-BQ0GGEfM.js +2 -0
- package/dist/client/assets/{download-Bi4-cFbc.js → download-CUiRE0N9.js} +1 -1
- package/dist/client/assets/{draft-input-BGSRgOW7.js → draft-input-CwpGDtoT.js} +1 -1
- package/dist/client/assets/editorPreferences-jN7DKbyt.js +1 -0
- package/dist/client/assets/empty-CBuXePtg.js +1 -0
- package/dist/client/assets/{group-Dwm-OV-r.js → group-BpZvxjG5.js} +1 -1
- package/dist/client/assets/{index-BI5yFj9n.js → index-BKzXTNJ_.js} +2 -2
- package/dist/client/assets/{input-BfUa3JUD.js → input-CgDawd6k.js} +1 -1
- package/dist/client/assets/kbd-QYSL97CK.js +1 -0
- package/dist/client/assets/{keybindings--G1bkIjA.js → keybindings-CUTRYI_A.js} +1 -1
- package/dist/client/assets/{keyboard-B87VTfPa.js → keyboard-DFFiI7JY.js} +1 -1
- package/dist/client/assets/keyedQuery-DiOCbGH0.js +0 -0
- package/dist/client/assets/main-BgFGju3e.js +9 -0
- package/dist/client/assets/main-D0UFdwts.css +2 -0
- package/dist/client/assets/palette-BXCL909c.js +1 -0
- package/dist/client/assets/play-DI2LZohg.js +1 -0
- package/dist/client/assets/plus-DzgIfHUF.js +1 -0
- package/dist/client/assets/projectAtoms-DXXpuERK.js +1 -0
- package/dist/client/assets/providerDriverMeta-CRNNp0q3.js +1 -0
- package/dist/client/assets/providerIconUtils-D-DFhem2.js +47 -0
- package/dist/client/assets/radio-group-_PPYg3YY.js +1 -0
- package/dist/client/assets/{refresh-cw-CRxaXR0E.js → refresh-cw-BsQTNBXl.js} +1 -1
- package/dist/client/assets/{resolveAriaLabelledBy-D4fWpj84.js → resolveAriaLabelledBy-CRHo_s16.js} +1 -1
- package/dist/client/assets/rightPanelRouteSearch-CfmZ7osj.js +1 -0
- package/dist/client/assets/scale-DDEJ-tvn.js +1 -0
- package/dist/client/assets/scroll-area-HgsI-ErG.js +1 -0
- package/dist/client/assets/separator-ClnL4mUB.js +1 -0
- package/dist/client/assets/{server-tdx7WxLI.js → server-Bbs3L-6_.js} +1 -1
- package/dist/client/assets/session-logic-CKQkgIwo.js +4 -0
- package/dist/client/assets/settingsDialogStore-SG-W1q0A.js +1 -0
- package/dist/client/assets/settingsLayout-G5xVm-ZT.js +1 -0
- package/dist/client/assets/shallow-Dmd-gez1.js +1 -0
- package/dist/client/assets/sidebar-_u7SGgmC.js +1 -0
- package/dist/client/assets/sidebarStatusText-BTYnwflG.js +1 -0
- package/dist/client/assets/skeleton-CmUvhZGP.js +1 -0
- package/dist/client/assets/storeSelectors-DhJRpdiw.js +1 -0
- package/dist/client/assets/threadSelectionStore-ygmA4DNA.js +1 -0
- package/dist/client/assets/toast-DmA_ziPT.js +1 -0
- package/dist/client/assets/toggle-DGS7tKuj.js +1 -0
- package/dist/client/assets/{toggle-group-DdKXHoT3.js → toggle-group-Dtv1ZUFW.js} +1 -1
- package/dist/client/assets/tokenModePresentation-Dor1DnBx.js +1 -0
- package/dist/client/assets/{trash-2-CZQem-sz.js → trash-2-C2G3VGoV.js} +1 -1
- package/dist/client/assets/triangle-alert-Bpz3xGu5.js +1 -0
- package/dist/client/assets/undo-2-C3rtxuqZ.js +1 -0
- package/dist/client/assets/useHandleNewThread-ypSbzG0P.js +1 -0
- package/dist/client/assets/useLabelableId-Bc7KEnHU.js +1 -0
- package/dist/client/assets/useNavigate-_4hWGSey.js +1 -0
- package/dist/client/assets/useTheme-HcKmBfpF.js +1 -0
- package/dist/client/assets/{vscode-icons-E8NUFd62.js → vscode-icons-DdSTtxYd.js} +1 -1
- package/dist/client/assets/{wrench-DEteICtk.js → wrench-C4jdis40.js} +1 -1
- package/dist/client/assets/x-CG2WU63t.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/{collectUint8StreamText-DuFJyaQh.mjs → collectUint8StreamText-Lv4GGI79.mjs} +488 -16
- package/dist/{collectUint8StreamText-DbCOJom3.cjs → collectUint8StreamText-uNXVRHOf.cjs} +510 -14
- package/dist/{makeManagedServerProvider-C3cQUDkZ.cjs → makeManagedServerProvider-3SD-Q5xh.cjs} +1 -1
- package/dist/{makeManagedServerProvider-wFGZ2-vd.mjs → makeManagedServerProvider-CkPEptun.mjs} +2 -2
- package/package.json +1 -1
- package/dist/client/assets/AppearanceSettings-BBbC8CV5.js +0 -1
- package/dist/client/assets/BranchToolbar.logic-Di2EkKiO.js +0 -1
- package/dist/client/assets/ChatRightPanel-BJ_cVP66.js +0 -188
- package/dist/client/assets/ChatThreadRouteView-DmxD3m2U.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-CAzz6bsT.js +0 -1
- package/dist/client/assets/CompositeRoot-BvXCwn2c.js +0 -1
- package/dist/client/assets/ConnectionsSettings-Cmxm0y2u.js +0 -1
- package/dist/client/assets/DialogHandle-CXNAm3QY.js +0 -1
- package/dist/client/assets/DialogTitle-KXmfgzP3.js +0 -1
- package/dist/client/assets/DialogTrigger-NHyQnW3X.js +0 -1
- package/dist/client/assets/DialogViewport-CL0WR9a5.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-C_hqauF6.js +0 -1
- package/dist/client/assets/JetBrainsIcons-BcR8pCma.js +0 -1
- package/dist/client/assets/KeybindingsSettings-m2AteGOl.js +0 -7
- package/dist/client/assets/McpServersSettings-DndIDxgA.js +0 -6
- package/dist/client/assets/NoActiveThreadState-Bt-Wkv-C.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-oDtdE6qx.js +0 -1
- package/dist/client/assets/ProjectFavicon-j9IX_7-B.js +0 -1
- package/dist/client/assets/ProvidersSettingsPanel-CvlIBNVJ.js +0 -1
- package/dist/client/assets/QueryClientProvider-BZxRKpeb.js +0 -1
- package/dist/client/assets/RootAppShell-CyHZ_F5P.js +0 -12
- package/dist/client/assets/SettingsDialog-BYJ8AhQp.js +0 -2
- package/dist/client/assets/SourceControlSettings-7xU6VH6N.js +0 -1
- package/dist/client/assets/ThreadStatusIndicators-M9FWDEex.js +0 -1
- package/dist/client/assets/ThreadWorkspacePanel-D1J63TVD.js +0 -166
- package/dist/client/assets/codexUsageLimits-BJQiZCqn.js +0 -1
- package/dist/client/assets/commandPaletteStore-oFMPKPmp.js +0 -1
- package/dist/client/assets/composerDraftStore-xu3n5gdX.js +0 -21
- package/dist/client/assets/desktopUpdateReactQuery-YSCkifKp.js +0 -2
- package/dist/client/assets/empty-BTxheW4B.js +0 -1
- package/dist/client/assets/environmentApi-BFHi_M02.js +0 -1
- package/dist/client/assets/folder-open-DJmHEPv9.js +0 -1
- package/dist/client/assets/kbd-Dd57M8OY.js +0 -1
- package/dist/client/assets/main-BQf5U-fz.js +0 -9
- package/dist/client/assets/main-DrwkwNo9.css +0 -2
- package/dist/client/assets/mutation-DJZgOJRu.js +0 -1
- package/dist/client/assets/plus-B10j9MbZ.js +0 -1
- package/dist/client/assets/providerDriverMeta-B6xuq7ij.js +0 -1
- package/dist/client/assets/providerIconUtils-Ch6hejVW.js +0 -47
- package/dist/client/assets/rightPanelRouteSearch-CTMFCS6R.js +0 -1
- package/dist/client/assets/scroll-area-BgFq7GRd.js +0 -1
- package/dist/client/assets/separator-CB3Ctlvi.js +0 -1
- package/dist/client/assets/session-logic-CaiGe4hy.js +0 -4
- package/dist/client/assets/settingsDialogStore-9vo22xKp.js +0 -1
- package/dist/client/assets/settingsLayout-B5o13iGO.js +0 -1
- package/dist/client/assets/sidebar-Bbdql7Af.js +0 -1
- package/dist/client/assets/skeleton-C8OZcsPq.js +0 -1
- package/dist/client/assets/storeSelectors-DBRyhCGm.js +0 -1
- package/dist/client/assets/threadRoutes-CfldSp4X.js +0 -1
- package/dist/client/assets/threadSelectionStore-BggKwzmQ.js +0 -1
- package/dist/client/assets/toast-DE-WwLMa.js +0 -1
- package/dist/client/assets/toggle-BFMa0a0Y.js +0 -1
- package/dist/client/assets/useHandleNewThread-DOPZAFqE.js +0 -1
- package/dist/client/assets/useLabelableId-BzWaBebJ.js +0 -1
- package/dist/client/assets/useNavigate-B1qgM5mt.js +0 -1
- package/dist/client/assets/useTheme-C7Ji7x06.js +0 -1
- package/dist/client/assets/x-b9324xm-.js +0 -1
- package/dist/{NodeSqliteClient-BXy61fAd.mjs → NodeSqliteClient-A1TEgwj_.mjs} +1 -1
- package/dist/{NodeSqliteClient-homCO8-6.cjs → NodeSqliteClient-B5aDHbNc.cjs} +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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, t as makeManagedServerProvider, u as sanitizeCommitSubject } from "./makeManagedServerProvider-
|
|
3
|
+
import { Bn as ProviderInstanceId, I as ClaudeSettings, Sr as TurnId, _r as RuntimeRequestId, br as ThreadId, gr as RuntimeItemId, hr as ProviderItemId, lr as EventId, nr as ApprovalRequestId, vr as RuntimeSubagentId, x as TextGenerationError, yr as RuntimeTaskId, zn as ProviderDriverKind } from "./collectUint8StreamText-Lv4GGI79.mjs";
|
|
4
|
+
import { U as sanitizeBranchFragment, W as sanitizeFeatureBranchName, Y as ServerConfig } from "./Metrics-6Xj17Se3.mjs";
|
|
5
|
+
import { C as DEFAULT_TIMEOUT_MS, E as buildServerProvider, F as ProviderAdapterRequestError, I as ProviderAdapterSessionClosedError, L as ProviderAdapterSessionNotFoundError, M as providerModelsFromSettings, N as spawnAndCollect, O as detailFromResult, P as ProviderAdapterProcessError, Qt as makePackageManagedProviderMaintenanceResolver, R as ProviderAdapterValidationError, T as buildSelectOptionDescriptor, U as expandHomePath, Xt as enrichProviderSnapshotWithVersionAdvisory, _ as buildTokenReductionInstructions, an as resolveAttachmentPath, cn as createModelCapabilities, fn as getProviderOptionCurrentValue, g as makeEventNdjsonLogger, gn as resolvePromptInjectedEffort, h as ProviderEventLoggers, in as ServerSettingsService, j as parseGenericCliVersion, k as isCommandMissingCause, ln as getModelSelectionBooleanOptionValue, nn as resolveProviderMaintenanceCapabilitiesEffect, pn as getProviderOptionDescriptors, rn as compareCliVersions, sn as applyClaudePromptEffortPrefix, t as makeServerQueueMetrics, tn as normalizeCommandPath, un as getModelSelectionStringOptionValue, v as checkRtkAvailability, w as buildBooleanOptionDescriptor, y as mergeProviderInstanceEnvironment, z as ProviderDriverError } 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, t as makeManagedServerProvider, u as sanitizeCommitSubject } from "./makeManagedServerProvider-CkPEptun.mjs";
|
|
7
7
|
import { t as formatSourceControlContextsForAgent } from "./sourceControlContextFormatter-DEwpnVAH.mjs";
|
|
8
8
|
import { n as formatProjectCustomSystemPrompt } from "./ProjectCustomSystemPrompt-CS1nulhL.mjs";
|
|
9
9
|
import { t as defaultProviderContinuationIdentity } from "./ProviderDriver-kCV60GKk.mjs";
|
|
@@ -46,6 +46,7 @@ const CLAUDE_PRESENTATION = {
|
|
|
46
46
|
};
|
|
47
47
|
const MINIMUM_CLAUDE_OPUS_4_8_VERSION = "2.1.154";
|
|
48
48
|
const MINIMUM_CLAUDE_OPUS_4_7_VERSION = "2.1.111";
|
|
49
|
+
const MINIMUM_CLAUDE_FABLE_5_VERSION = "2.1.194";
|
|
49
50
|
function buildClaudeEffortOption(value, defaultEffort) {
|
|
50
51
|
const label = value === "xhigh" ? "Extra High" : value[0].toUpperCase() + value.slice(1).toLowerCase();
|
|
51
52
|
return value === defaultEffort ? {
|
|
@@ -117,6 +118,18 @@ const CLAUDE_OPUS_LEGACY_EFFORT_LEVELS = [
|
|
|
117
118
|
"max"
|
|
118
119
|
];
|
|
119
120
|
const BUILT_IN_MODELS = [
|
|
121
|
+
{
|
|
122
|
+
slug: "claude-fable-5",
|
|
123
|
+
name: "Claude Fable 5",
|
|
124
|
+
shortName: "Fable 5",
|
|
125
|
+
isCustom: false,
|
|
126
|
+
capabilities: buildClaudeOpusCapabilities({
|
|
127
|
+
effortLevels: CLAUDE_OPUS_ADAPTIVE_EFFORT_LEVELS,
|
|
128
|
+
defaultEffort: "high",
|
|
129
|
+
supportsFastMode: false,
|
|
130
|
+
supportsContextWindow: false
|
|
131
|
+
})
|
|
132
|
+
},
|
|
120
133
|
{
|
|
121
134
|
slug: "claude-opus-4-8",
|
|
122
135
|
name: "Claude Opus 4.8",
|
|
@@ -161,7 +174,7 @@ const BUILT_IN_MODELS = [
|
|
|
161
174
|
capabilities: buildClaudeOpusCapabilities({
|
|
162
175
|
effortLevels: CLAUDE_OPUS_LEGACY_EFFORT_LEVELS,
|
|
163
176
|
defaultEffort: "high",
|
|
164
|
-
supportsFastMode:
|
|
177
|
+
supportsFastMode: false,
|
|
165
178
|
supportsContextWindow: false
|
|
166
179
|
})
|
|
167
180
|
},
|
|
@@ -226,8 +239,12 @@ function supportsClaudeOpus48(version) {
|
|
|
226
239
|
function supportsClaudeOpus47(version) {
|
|
227
240
|
return supportsMinimumClaudeVersion(version, MINIMUM_CLAUDE_OPUS_4_7_VERSION);
|
|
228
241
|
}
|
|
242
|
+
function supportsClaudeFable5(version) {
|
|
243
|
+
return supportsMinimumClaudeVersion(version, MINIMUM_CLAUDE_FABLE_5_VERSION);
|
|
244
|
+
}
|
|
229
245
|
function getBuiltInClaudeModelsForVersion(version) {
|
|
230
246
|
return BUILT_IN_MODELS.filter((model) => {
|
|
247
|
+
if (model.slug === "claude-fable-5") return supportsClaudeFable5(version);
|
|
231
248
|
if (model.slug === "claude-opus-4-8") return supportsClaudeOpus48(version);
|
|
232
249
|
if (model.slug === "claude-opus-4-7") return supportsClaudeOpus47(version);
|
|
233
250
|
return true;
|
|
@@ -939,6 +956,54 @@ function readClaudeResumeState(resumeCursor) {
|
|
|
939
956
|
...turnCountValue !== void 0 && Number.isInteger(turnCountValue) && turnCountValue >= 0 ? { turnCount: turnCountValue } : {}
|
|
940
957
|
};
|
|
941
958
|
}
|
|
959
|
+
function trimmedClaudeString(value) {
|
|
960
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
961
|
+
}
|
|
962
|
+
function claudeTaskField(message, field) {
|
|
963
|
+
return trimmedClaudeString(message[field]);
|
|
964
|
+
}
|
|
965
|
+
function hasClaudeSubagentNameSignal(value) {
|
|
966
|
+
return value !== void 0 && /\b(?:sub[-\s]?agent|agent|subtask|task)\b/i.test(value);
|
|
967
|
+
}
|
|
968
|
+
function hasClaudeSubagentDescriptionSignal(value) {
|
|
969
|
+
return value !== void 0 && /\b(?:sub[-\s]?agent|agent|teammate|worker|delegate[sd]?|reviewer)\b/i.test(value);
|
|
970
|
+
}
|
|
971
|
+
function isClaudeSubagentTaskMessage(message) {
|
|
972
|
+
return hasClaudeSubagentNameSignal(claudeTaskField(message, "task_type")) || hasClaudeSubagentNameSignal(claudeTaskField(message, "last_tool_name")) || hasClaudeSubagentDescriptionSignal(claudeTaskField(message, "description")) || hasClaudeSubagentDescriptionSignal(claudeTaskField(message, "summary"));
|
|
973
|
+
}
|
|
974
|
+
function claudeTaskSubagentStatus(status) {
|
|
975
|
+
return status;
|
|
976
|
+
}
|
|
977
|
+
function claudeTaskCompletionStatus(status) {
|
|
978
|
+
return status;
|
|
979
|
+
}
|
|
980
|
+
function claudeTaskMetadata(message) {
|
|
981
|
+
const metadata = Object.fromEntries([
|
|
982
|
+
["source", "claude.task"],
|
|
983
|
+
["taskType", claudeTaskField(message, "task_type")],
|
|
984
|
+
["lastToolName", claudeTaskField(message, "last_tool_name")]
|
|
985
|
+
].filter(([, value]) => value !== void 0));
|
|
986
|
+
return Object.keys(metadata).length > 0 ? metadata : void 0;
|
|
987
|
+
}
|
|
988
|
+
function makeClaudeTaskSubagentRef(existing, message) {
|
|
989
|
+
const taskType = claudeTaskField(message, "task_type");
|
|
990
|
+
const lastToolName = claudeTaskField(message, "last_tool_name");
|
|
991
|
+
const description = claudeTaskField(message, "description") ?? existing?.description;
|
|
992
|
+
const label = taskType ?? lastToolName ?? existing?.label ?? "Claude task";
|
|
993
|
+
const taskMetadata = claudeTaskMetadata(message);
|
|
994
|
+
const metadata = {};
|
|
995
|
+
if (existing?.metadata) Object.assign(metadata, existing.metadata);
|
|
996
|
+
if (taskMetadata) Object.assign(metadata, taskMetadata);
|
|
997
|
+
return {
|
|
998
|
+
subagentId: existing?.subagentId ?? RuntimeSubagentId.make(`claude-task:${message.task_id}`),
|
|
999
|
+
origin: "native",
|
|
1000
|
+
capability: "summary",
|
|
1001
|
+
label,
|
|
1002
|
+
...description && { description },
|
|
1003
|
+
providerTaskId: RuntimeTaskId.make(message.task_id),
|
|
1004
|
+
...Object.keys(metadata).length > 0 && { metadata }
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
942
1007
|
function classifyToolItemType(toolName) {
|
|
943
1008
|
const normalized = toolName.toLowerCase();
|
|
944
1009
|
if (normalized.includes("agent")) return "collab_agent_tool_call";
|
|
@@ -1231,13 +1296,95 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
1231
1296
|
}));
|
|
1232
1297
|
const sessions = /* @__PURE__ */ new Map();
|
|
1233
1298
|
const runtimeEventQueue = yield* Queue.unbounded();
|
|
1299
|
+
const runtimeEventQueueMetrics = yield* makeServerQueueMetrics({
|
|
1300
|
+
queue: "provider.adapter.runtimeEvents",
|
|
1301
|
+
component: "ClaudeAdapter",
|
|
1302
|
+
provider: PROVIDER,
|
|
1303
|
+
providerInstanceId: boundInstanceId
|
|
1304
|
+
});
|
|
1234
1305
|
const nowIso = Effect.map(DateTime.now, DateTime.formatIso);
|
|
1235
1306
|
const nextEventId = Effect.map(Random.nextUUIDv4, (id) => EventId.make(id));
|
|
1236
1307
|
const makeEventStamp = () => Effect.all({
|
|
1237
1308
|
eventId: nextEventId,
|
|
1238
1309
|
createdAt: nowIso
|
|
1239
1310
|
});
|
|
1240
|
-
const offerRuntimeEvent = (event) => Queue.offer(runtimeEventQueue, event).pipe(Effect.asVoid);
|
|
1311
|
+
const offerRuntimeEvent = (event) => Queue.offer(runtimeEventQueue, event).pipe(Effect.andThen(runtimeEventQueueMetrics.recordEnqueued()), Effect.asVoid);
|
|
1312
|
+
const emitClaudeSubagentStarted = Effect.fn("emitClaudeSubagentStarted")(function* (context, subagent, raw) {
|
|
1313
|
+
const key = String(subagent.subagentId);
|
|
1314
|
+
if (context.startedSubagentIds.has(key)) return;
|
|
1315
|
+
context.startedSubagentIds.add(key);
|
|
1316
|
+
const stamp = yield* makeEventStamp();
|
|
1317
|
+
yield* offerRuntimeEvent({
|
|
1318
|
+
type: "subagent.started",
|
|
1319
|
+
eventId: stamp.eventId,
|
|
1320
|
+
provider: PROVIDER,
|
|
1321
|
+
createdAt: stamp.createdAt,
|
|
1322
|
+
threadId: context.session.threadId,
|
|
1323
|
+
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
1324
|
+
payload: { subagent },
|
|
1325
|
+
providerRefs: nativeProviderRefs(context),
|
|
1326
|
+
raw: {
|
|
1327
|
+
source: "claude.sdk.message",
|
|
1328
|
+
method: sdkNativeMethod(raw),
|
|
1329
|
+
messageType: `${raw.type}:${sdkMessageSubtype(raw) ?? ""}`,
|
|
1330
|
+
payload: raw
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
});
|
|
1334
|
+
const emitClaudeSubagentUpdated = Effect.fn("emitClaudeSubagentUpdated")(function* (context, input) {
|
|
1335
|
+
yield* emitClaudeSubagentStarted(context, input.subagent, input.raw);
|
|
1336
|
+
const stamp = yield* makeEventStamp();
|
|
1337
|
+
yield* offerRuntimeEvent({
|
|
1338
|
+
type: "subagent.updated",
|
|
1339
|
+
eventId: stamp.eventId,
|
|
1340
|
+
provider: PROVIDER,
|
|
1341
|
+
createdAt: stamp.createdAt,
|
|
1342
|
+
threadId: context.session.threadId,
|
|
1343
|
+
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
1344
|
+
payload: {
|
|
1345
|
+
subagent: input.subagent,
|
|
1346
|
+
...input.status ? { status: input.status } : {},
|
|
1347
|
+
...input.summary ? { summary: input.summary } : {},
|
|
1348
|
+
...input.detail ? { detail: input.detail } : {},
|
|
1349
|
+
...input.usage !== void 0 ? { usage: input.usage } : {}
|
|
1350
|
+
},
|
|
1351
|
+
providerRefs: nativeProviderRefs(context),
|
|
1352
|
+
raw: {
|
|
1353
|
+
source: "claude.sdk.message",
|
|
1354
|
+
method: sdkNativeMethod(input.raw),
|
|
1355
|
+
messageType: `${input.raw.type}:${sdkMessageSubtype(input.raw) ?? ""}`,
|
|
1356
|
+
payload: input.raw
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
});
|
|
1360
|
+
const emitClaudeSubagentCompleted = Effect.fn("emitClaudeSubagentCompleted")(function* (context, input) {
|
|
1361
|
+
const key = String(input.subagent.subagentId);
|
|
1362
|
+
if (context.completedSubagentIds.has(key)) return;
|
|
1363
|
+
yield* emitClaudeSubagentStarted(context, input.subagent, input.raw);
|
|
1364
|
+
context.completedSubagentIds.add(key);
|
|
1365
|
+
const stamp = yield* makeEventStamp();
|
|
1366
|
+
yield* offerRuntimeEvent({
|
|
1367
|
+
type: "subagent.completed",
|
|
1368
|
+
eventId: stamp.eventId,
|
|
1369
|
+
provider: PROVIDER,
|
|
1370
|
+
createdAt: stamp.createdAt,
|
|
1371
|
+
threadId: context.session.threadId,
|
|
1372
|
+
...context.turnState ? { turnId: asCanonicalTurnId(context.turnState.turnId) } : {},
|
|
1373
|
+
payload: {
|
|
1374
|
+
subagent: input.subagent,
|
|
1375
|
+
status: input.status,
|
|
1376
|
+
...input.summary ? { summary: input.summary } : {},
|
|
1377
|
+
...input.usage !== void 0 ? { usage: input.usage } : {}
|
|
1378
|
+
},
|
|
1379
|
+
providerRefs: nativeProviderRefs(context),
|
|
1380
|
+
raw: {
|
|
1381
|
+
source: "claude.sdk.message",
|
|
1382
|
+
method: sdkNativeMethod(input.raw),
|
|
1383
|
+
messageType: `${input.raw.type}:${sdkMessageSubtype(input.raw) ?? ""}`,
|
|
1384
|
+
payload: input.raw
|
|
1385
|
+
}
|
|
1386
|
+
});
|
|
1387
|
+
});
|
|
1241
1388
|
const logNativeSdkMessage = Effect.fn("logNativeSdkMessage")(function* (context, message) {
|
|
1242
1389
|
if (!nativeEventLogger) return;
|
|
1243
1390
|
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -2025,6 +2172,11 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
2025
2172
|
...message.task_type ? { taskType: message.task_type } : {}
|
|
2026
2173
|
}
|
|
2027
2174
|
});
|
|
2175
|
+
if (isClaudeSubagentTaskMessage(message)) {
|
|
2176
|
+
const subagent = makeClaudeTaskSubagentRef(context.subagentByTaskId.get(message.task_id), message);
|
|
2177
|
+
context.subagentByTaskId.set(message.task_id, subagent);
|
|
2178
|
+
yield* emitClaudeSubagentStarted(context, subagent, message);
|
|
2179
|
+
}
|
|
2028
2180
|
return;
|
|
2029
2181
|
case "task_progress":
|
|
2030
2182
|
if (message.usage) {
|
|
@@ -2052,6 +2204,18 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
2052
2204
|
...message.last_tool_name ? { lastToolName: message.last_tool_name } : {}
|
|
2053
2205
|
}
|
|
2054
2206
|
});
|
|
2207
|
+
if (isClaudeSubagentTaskMessage(message) || context.subagentByTaskId.has(message.task_id)) {
|
|
2208
|
+
const subagent = makeClaudeTaskSubagentRef(context.subagentByTaskId.get(message.task_id), message);
|
|
2209
|
+
context.subagentByTaskId.set(message.task_id, subagent);
|
|
2210
|
+
yield* emitClaudeSubagentUpdated(context, {
|
|
2211
|
+
subagent,
|
|
2212
|
+
status: claudeTaskSubagentStatus("running"),
|
|
2213
|
+
...message.summary ? { summary: message.summary } : {},
|
|
2214
|
+
detail: message.description,
|
|
2215
|
+
...message.usage ? { usage: message.usage } : {},
|
|
2216
|
+
raw: message
|
|
2217
|
+
});
|
|
2218
|
+
}
|
|
2055
2219
|
return;
|
|
2056
2220
|
case "task_notification":
|
|
2057
2221
|
if (message.usage) {
|
|
@@ -2078,6 +2242,17 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
2078
2242
|
...message.usage ? { usage: message.usage } : {}
|
|
2079
2243
|
}
|
|
2080
2244
|
});
|
|
2245
|
+
if (isClaudeSubagentTaskMessage(message) || context.subagentByTaskId.has(message.task_id)) {
|
|
2246
|
+
const subagent = makeClaudeTaskSubagentRef(context.subagentByTaskId.get(message.task_id), message);
|
|
2247
|
+
context.subagentByTaskId.set(message.task_id, subagent);
|
|
2248
|
+
yield* emitClaudeSubagentCompleted(context, {
|
|
2249
|
+
subagent,
|
|
2250
|
+
status: claudeTaskCompletionStatus(message.status),
|
|
2251
|
+
...message.summary ? { summary: message.summary } : {},
|
|
2252
|
+
...message.usage ? { usage: message.usage } : {},
|
|
2253
|
+
raw: message
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2081
2256
|
return;
|
|
2082
2257
|
case "files_persisted":
|
|
2083
2258
|
yield* offerRuntimeEvent({
|
|
@@ -2626,6 +2801,9 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
2626
2801
|
lastKnownTokenUsage: void 0,
|
|
2627
2802
|
lastAssistantUuid: resumeState?.resumeSessionAt,
|
|
2628
2803
|
lastThreadStartedId: void 0,
|
|
2804
|
+
subagentByTaskId: /* @__PURE__ */ new Map(),
|
|
2805
|
+
startedSubagentIds: /* @__PURE__ */ new Set(),
|
|
2806
|
+
completedSubagentIds: /* @__PURE__ */ new Set(),
|
|
2629
2807
|
stopped: false
|
|
2630
2808
|
};
|
|
2631
2809
|
yield* Ref.set(contextRef, context);
|
|
@@ -2796,7 +2974,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
2796
2974
|
return context !== void 0 && !context.stopped;
|
|
2797
2975
|
});
|
|
2798
2976
|
const stopAll = () => Effect.forEach(sessions, ([, context]) => stopSessionInternal(context, { emitExitEvent: true }), { discard: true });
|
|
2799
|
-
yield* Effect.addFinalizer(() => Effect.forEach(sessions, ([, context]) => stopSessionInternal(context, { emitExitEvent: false }), { discard: true }).pipe(Effect.tap(() => Queue.shutdown(runtimeEventQueue))));
|
|
2977
|
+
yield* Effect.addFinalizer(() => Effect.forEach(sessions, ([, context]) => stopSessionInternal(context, { emitExitEvent: false }), { discard: true }).pipe(Effect.tap(() => runtimeEventQueueMetrics.reset), Effect.tap(() => Queue.shutdown(runtimeEventQueue))));
|
|
2800
2978
|
return {
|
|
2801
2979
|
provider: PROVIDER,
|
|
2802
2980
|
capabilities: { sessionModelSwitch: "in-session" },
|
|
@@ -2812,7 +2990,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
2812
2990
|
hasSession,
|
|
2813
2991
|
stopAll,
|
|
2814
2992
|
get streamEvents() {
|
|
2815
|
-
return Stream.fromQueue(runtimeEventQueue);
|
|
2993
|
+
return Stream.fromQueue(runtimeEventQueue).pipe(Stream.tap(() => runtimeEventQueueMetrics.recordDequeued()));
|
|
2816
2994
|
}
|
|
2817
2995
|
};
|
|
2818
2996
|
});
|
|
@@ -3062,6 +3240,7 @@ const ClaudeDriver = {
|
|
|
3062
3240
|
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
3063
3241
|
const path = yield* Path.Path;
|
|
3064
3242
|
const httpClient = yield* HttpClient.HttpClient;
|
|
3243
|
+
const serverSettings = yield* ServerSettingsService;
|
|
3065
3244
|
const eventLoggers = yield* ProviderEventLoggers;
|
|
3066
3245
|
const processEnv = mergeProviderInstanceEnvironment(environment);
|
|
3067
3246
|
const fallbackContinuationIdentity = defaultProviderContinuationIdentity({
|
|
@@ -3108,7 +3287,7 @@ const ClaudeDriver = {
|
|
|
3108
3287
|
haveSettingsChanged: () => false,
|
|
3109
3288
|
initialSnapshot: (settings) => stampIdentity(makePendingClaudeProvider(settings)),
|
|
3110
3289
|
checkProvider,
|
|
3111
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
3290
|
+
enrichSnapshot: ({ snapshot, publishSnapshot }) => enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.provideService(ServerSettingsService, serverSettings), Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
3112
3291
|
refreshInterval: null
|
|
3113
3292
|
}).pipe(Effect.mapError((cause) => new ProviderDriverError({
|
|
3114
3293
|
driver: DRIVER_KIND,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { $ as
|
|
6
|
-
import { t as makeManagedServerProvider } from "./makeManagedServerProvider-
|
|
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-Lv4GGI79.mjs";
|
|
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, 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-CkPEptun.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-BU9Myn87.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";
|
|
@@ -1662,6 +1662,12 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (codexConfig, o
|
|
|
1662
1662
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
1663
1663
|
const managedNativeEventLogger = options?.nativeEventLogger === void 0 ? nativeEventLogger : void 0;
|
|
1664
1664
|
const runtimeEventQueue = yield* Queue.unbounded();
|
|
1665
|
+
const runtimeEventQueueMetrics = yield* makeServerQueueMetrics({
|
|
1666
|
+
queue: "provider.adapter.runtimeEvents",
|
|
1667
|
+
component: "CodexAdapter",
|
|
1668
|
+
provider: PROVIDER,
|
|
1669
|
+
providerInstanceId: boundInstanceId
|
|
1670
|
+
});
|
|
1665
1671
|
const sessions = /* @__PURE__ */ new Map();
|
|
1666
1672
|
const startSession = (input) => Effect.scoped(Effect.gen(function* () {
|
|
1667
1673
|
if (input.provider !== void 0 && input.provider !== PROVIDER) return yield* new ProviderAdapterValidationError({
|
|
@@ -1709,6 +1715,7 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (codexConfig, o
|
|
|
1709
1715
|
return;
|
|
1710
1716
|
}
|
|
1711
1717
|
yield* Queue.offerAll(runtimeEventQueue, runtimeEvents);
|
|
1718
|
+
yield* runtimeEventQueueMetrics.recordEnqueued(runtimeEvents.length);
|
|
1712
1719
|
})).pipe(Effect.forkChild);
|
|
1713
1720
|
const started = yield* runtime.start().pipe(Effect.mapError((cause) => new ProviderAdapterProcessError({
|
|
1714
1721
|
provider: PROVIDER,
|
|
@@ -1875,7 +1882,7 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (codexConfig, o
|
|
|
1875
1882
|
concurrency: 1,
|
|
1876
1883
|
discard: true
|
|
1877
1884
|
}).pipe(Effect.asVoid);
|
|
1878
|
-
yield* Effect.acquireRelease(Effect.void, () => stopAll().pipe(Effect.andThen(Queue.shutdown(runtimeEventQueue)), Effect.andThen(managedNativeEventLogger?.close() ?? Effect.void), Effect.ignore));
|
|
1885
|
+
yield* Effect.acquireRelease(Effect.void, () => stopAll().pipe(Effect.andThen(runtimeEventQueueMetrics.reset), Effect.andThen(Queue.shutdown(runtimeEventQueue)), Effect.andThen(managedNativeEventLogger?.close() ?? Effect.void), Effect.ignore));
|
|
1879
1886
|
return {
|
|
1880
1887
|
provider: PROVIDER,
|
|
1881
1888
|
capabilities: { sessionModelSwitch: "in-session" },
|
|
@@ -1891,7 +1898,7 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (codexConfig, o
|
|
|
1891
1898
|
hasSession,
|
|
1892
1899
|
stopAll,
|
|
1893
1900
|
get streamEvents() {
|
|
1894
|
-
return Stream.fromQueue(runtimeEventQueue);
|
|
1901
|
+
return Stream.fromQueue(runtimeEventQueue).pipe(Stream.tap(() => runtimeEventQueueMetrics.recordDequeued()));
|
|
1895
1902
|
}
|
|
1896
1903
|
};
|
|
1897
1904
|
});
|
|
@@ -1952,6 +1959,7 @@ const CodexDriver = {
|
|
|
1952
1959
|
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) => Effect.gen(function* () {
|
|
1953
1960
|
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
1954
1961
|
const httpClient = yield* HttpClient.HttpClient;
|
|
1962
|
+
const serverSettings = yield* ServerSettingsService;
|
|
1955
1963
|
const eventLoggers = yield* ProviderEventLoggers;
|
|
1956
1964
|
const processEnv = mergeProviderInstanceEnvironment(environment);
|
|
1957
1965
|
const homeLayout = yield* resolveCodexHomeLayout(config);
|
|
@@ -1998,7 +2006,7 @@ const CodexDriver = {
|
|
|
1998
2006
|
haveSettingsChanged: () => false,
|
|
1999
2007
|
initialSnapshot: (settings) => stampIdentity(makePendingCodexProvider(settings)),
|
|
2000
2008
|
checkProvider,
|
|
2001
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2009
|
+
enrichSnapshot: ({ snapshot, publishSnapshot }) => enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(Effect.provideService(HttpClient.HttpClient, httpClient), Effect.provideService(ServerSettingsService, serverSettings), Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2002
2010
|
refreshInterval: null
|
|
2003
2011
|
}).pipe(Effect.mapError((cause) => new ProviderDriverError({
|
|
2004
2012
|
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-
|
|
5
|
-
const require_Metrics = require("./Metrics-
|
|
4
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-uNXVRHOf.cjs");
|
|
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-3SD-Q5xh.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-0pRbJji3.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");
|
|
@@ -1664,6 +1664,12 @@ const makeCodexAdapter = effect.Effect.fn("makeCodexAdapter")(function* (codexCo
|
|
|
1664
1664
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* require_bin.makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
1665
1665
|
const managedNativeEventLogger = options?.nativeEventLogger === void 0 ? nativeEventLogger : void 0;
|
|
1666
1666
|
const runtimeEventQueue = yield* effect.Queue.unbounded();
|
|
1667
|
+
const runtimeEventQueueMetrics = yield* require_bin.makeServerQueueMetrics({
|
|
1668
|
+
queue: "provider.adapter.runtimeEvents",
|
|
1669
|
+
component: "CodexAdapter",
|
|
1670
|
+
provider: PROVIDER,
|
|
1671
|
+
providerInstanceId: boundInstanceId
|
|
1672
|
+
});
|
|
1667
1673
|
const sessions = /* @__PURE__ */ new Map();
|
|
1668
1674
|
const startSession = (input) => effect.Effect.scoped(effect.Effect.gen(function* () {
|
|
1669
1675
|
if (input.provider !== void 0 && input.provider !== PROVIDER) return yield* new require_bin.ProviderAdapterValidationError({
|
|
@@ -1711,6 +1717,7 @@ const makeCodexAdapter = effect.Effect.fn("makeCodexAdapter")(function* (codexCo
|
|
|
1711
1717
|
return;
|
|
1712
1718
|
}
|
|
1713
1719
|
yield* effect.Queue.offerAll(runtimeEventQueue, runtimeEvents);
|
|
1720
|
+
yield* runtimeEventQueueMetrics.recordEnqueued(runtimeEvents.length);
|
|
1714
1721
|
})).pipe(effect.Effect.forkChild);
|
|
1715
1722
|
const started = yield* runtime.start().pipe(effect.Effect.mapError((cause) => new require_bin.ProviderAdapterProcessError({
|
|
1716
1723
|
provider: PROVIDER,
|
|
@@ -1877,7 +1884,7 @@ const makeCodexAdapter = effect.Effect.fn("makeCodexAdapter")(function* (codexCo
|
|
|
1877
1884
|
concurrency: 1,
|
|
1878
1885
|
discard: true
|
|
1879
1886
|
}).pipe(effect.Effect.asVoid);
|
|
1880
|
-
yield* effect.Effect.acquireRelease(effect.Effect.void, () => stopAll().pipe(effect.Effect.andThen(effect.Queue.shutdown(runtimeEventQueue)), effect.Effect.andThen(managedNativeEventLogger?.close() ?? effect.Effect.void), effect.Effect.ignore));
|
|
1887
|
+
yield* effect.Effect.acquireRelease(effect.Effect.void, () => stopAll().pipe(effect.Effect.andThen(runtimeEventQueueMetrics.reset), effect.Effect.andThen(effect.Queue.shutdown(runtimeEventQueue)), effect.Effect.andThen(managedNativeEventLogger?.close() ?? effect.Effect.void), effect.Effect.ignore));
|
|
1881
1888
|
return {
|
|
1882
1889
|
provider: PROVIDER,
|
|
1883
1890
|
capabilities: { sessionModelSwitch: "in-session" },
|
|
@@ -1893,7 +1900,7 @@ const makeCodexAdapter = effect.Effect.fn("makeCodexAdapter")(function* (codexCo
|
|
|
1893
1900
|
hasSession,
|
|
1894
1901
|
stopAll,
|
|
1895
1902
|
get streamEvents() {
|
|
1896
|
-
return effect.Stream.fromQueue(runtimeEventQueue);
|
|
1903
|
+
return effect.Stream.fromQueue(runtimeEventQueue).pipe(effect.Stream.tap(() => runtimeEventQueueMetrics.recordDequeued()));
|
|
1897
1904
|
}
|
|
1898
1905
|
};
|
|
1899
1906
|
});
|
|
@@ -1954,6 +1961,7 @@ const CodexDriver = {
|
|
|
1954
1961
|
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) => effect.Effect.gen(function* () {
|
|
1955
1962
|
const spawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
|
|
1956
1963
|
const httpClient = yield* effect_unstable_http.HttpClient.HttpClient;
|
|
1964
|
+
const serverSettings = yield* require_bin.ServerSettingsService;
|
|
1957
1965
|
const eventLoggers = yield* require_bin.ProviderEventLoggers;
|
|
1958
1966
|
const processEnv = require_bin.mergeProviderInstanceEnvironment(environment);
|
|
1959
1967
|
const homeLayout = yield* require_bin.resolveCodexHomeLayout(config);
|
|
@@ -2000,7 +2008,7 @@ const CodexDriver = {
|
|
|
2000
2008
|
haveSettingsChanged: () => false,
|
|
2001
2009
|
initialSnapshot: (settings) => stampIdentity(require_bin.makePendingCodexProvider(settings)),
|
|
2002
2010
|
checkProvider,
|
|
2003
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => require_bin.enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(effect.Effect.provideService(effect_unstable_http.HttpClient.HttpClient, httpClient), effect.Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
2011
|
+
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))),
|
|
2004
2012
|
refreshInterval: null
|
|
2005
2013
|
}).pipe(effect.Effect.mapError((cause) => new require_bin.ProviderDriverError({
|
|
2006
2014
|
driver: DRIVER_KIND,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const require_collectUint8StreamText = require("./collectUint8StreamText-
|
|
4
|
-
const require_Metrics = require("./Metrics-
|
|
3
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-uNXVRHOf.cjs");
|
|
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-3SD-Q5xh.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,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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-
|
|
3
|
+
import { x as TextGenerationError } from "./collectUint8StreamText-Lv4GGI79.mjs";
|
|
4
|
+
import { U as sanitizeBranchFragment, W as sanitizeFeatureBranchName, Y as ServerConfig } from "./Metrics-6Xj17Se3.mjs";
|
|
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-CkPEptun.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,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as extractJsonObject, f as sanitizeThreadTitle, s as buildThreadTitlePrompt, t as makeManagedServerProvider } from "./makeManagedServerProvider-
|
|
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-Lv4GGI79.mjs";
|
|
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 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-CkPEptun.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-BU9Myn87.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";
|
|
@@ -792,6 +792,12 @@ const makeCopilotAdapter = Effect.fn("makeCopilotAdapter")(function* (copilotSet
|
|
|
792
792
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
793
793
|
const sessions = /* @__PURE__ */ new Map();
|
|
794
794
|
const runtimeEventQueue = yield* Queue.unbounded();
|
|
795
|
+
const runtimeEventQueueMetrics = yield* makeServerQueueMetrics({
|
|
796
|
+
queue: "provider.adapter.runtimeEvents",
|
|
797
|
+
component: "CopilotAdapter",
|
|
798
|
+
provider: COPILOT_DRIVER_KIND,
|
|
799
|
+
providerInstanceId: instanceId
|
|
800
|
+
});
|
|
795
801
|
const nextEventId = Effect.map(Random.nextUUIDv4, (id) => EventId.make(id));
|
|
796
802
|
const makeEventStamp = () => Effect.all({
|
|
797
803
|
eventId: nextEventId,
|
|
@@ -804,7 +810,7 @@ const makeCopilotAdapter = Effect.fn("makeCopilotAdapter")(function* (copilotSet
|
|
|
804
810
|
threadId
|
|
805
811
|
}));
|
|
806
812
|
};
|
|
807
|
-
const emit = (events) => Queue.offerAll(runtimeEventQueue, events).pipe(Effect.asVoid);
|
|
813
|
+
const emit = (events) => Queue.offerAll(runtimeEventQueue, events).pipe(Effect.andThen(runtimeEventQueueMetrics.recordEnqueued(events.length)), Effect.asVoid);
|
|
808
814
|
const logNativeEvent = Effect.fn("logCopilotNativeEvent")(function* (threadId, event) {
|
|
809
815
|
if (!nativeEventLogger) return;
|
|
810
816
|
yield* nativeEventLogger.write({
|
|
@@ -980,6 +986,7 @@ const makeCopilotAdapter = Effect.fn("makeCopilotAdapter")(function* (copilotSet
|
|
|
980
986
|
requestId
|
|
981
987
|
})]);
|
|
982
988
|
});
|
|
989
|
+
const stopAll = makeStopAll(sessionDeps);
|
|
983
990
|
return {
|
|
984
991
|
provider: COPILOT_DRIVER_KIND,
|
|
985
992
|
capabilities: { sessionModelSwitch: "in-session" },
|
|
@@ -993,9 +1000,9 @@ const makeCopilotAdapter = Effect.fn("makeCopilotAdapter")(function* (copilotSet
|
|
|
993
1000
|
hasSession: makeHasSession(sessionDeps),
|
|
994
1001
|
readThread: makeReadThread(sessionDeps),
|
|
995
1002
|
rollbackThread: makeRollbackThread(),
|
|
996
|
-
stopAll:
|
|
1003
|
+
stopAll: () => stopAll().pipe(Effect.tap(() => runtimeEventQueueMetrics.reset)),
|
|
997
1004
|
get streamEvents() {
|
|
998
|
-
return Stream.fromQueue(runtimeEventQueue);
|
|
1005
|
+
return Stream.fromQueue(runtimeEventQueue).pipe(Stream.tap(() => runtimeEventQueueMetrics.recordDequeued()));
|
|
999
1006
|
}
|
|
1000
1007
|
};
|
|
1001
1008
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const require_collectUint8StreamText = require("./collectUint8StreamText-
|
|
4
|
-
const require_Metrics = require("./Metrics-
|
|
3
|
+
const require_collectUint8StreamText = require("./collectUint8StreamText-uNXVRHOf.cjs");
|
|
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-3SD-Q5xh.cjs");
|
|
7
7
|
const require_ProviderDriver = require("./ProviderDriver--rNeAi3B.cjs");
|
|
8
|
-
const require_CodexTextGeneration = require("./CodexTextGeneration-
|
|
8
|
+
const require_CodexTextGeneration = require("./CodexTextGeneration-0pRbJji3.cjs");
|
|
9
9
|
let effect = require("effect");
|
|
10
10
|
let node_crypto = require("node:crypto");
|
|
11
11
|
require("effect/unstable/process");
|
|
@@ -792,6 +792,12 @@ const makeCopilotAdapter = effect.Effect.fn("makeCopilotAdapter")(function* (cop
|
|
|
792
792
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* require_bin.makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
793
793
|
const sessions = /* @__PURE__ */ new Map();
|
|
794
794
|
const runtimeEventQueue = yield* effect.Queue.unbounded();
|
|
795
|
+
const runtimeEventQueueMetrics = yield* require_bin.makeServerQueueMetrics({
|
|
796
|
+
queue: "provider.adapter.runtimeEvents",
|
|
797
|
+
component: "CopilotAdapter",
|
|
798
|
+
provider: COPILOT_DRIVER_KIND,
|
|
799
|
+
providerInstanceId: instanceId
|
|
800
|
+
});
|
|
795
801
|
const nextEventId = effect.Effect.map(effect.Random.nextUUIDv4, (id) => require_collectUint8StreamText.EventId.make(id));
|
|
796
802
|
const makeEventStamp = () => effect.Effect.all({
|
|
797
803
|
eventId: nextEventId,
|
|
@@ -804,7 +810,7 @@ const makeCopilotAdapter = effect.Effect.fn("makeCopilotAdapter")(function* (cop
|
|
|
804
810
|
threadId
|
|
805
811
|
}));
|
|
806
812
|
};
|
|
807
|
-
const emit = (events) => effect.Queue.offerAll(runtimeEventQueue, events).pipe(effect.Effect.asVoid);
|
|
813
|
+
const emit = (events) => effect.Queue.offerAll(runtimeEventQueue, events).pipe(effect.Effect.andThen(runtimeEventQueueMetrics.recordEnqueued(events.length)), effect.Effect.asVoid);
|
|
808
814
|
const logNativeEvent = effect.Effect.fn("logCopilotNativeEvent")(function* (threadId, event) {
|
|
809
815
|
if (!nativeEventLogger) return;
|
|
810
816
|
yield* nativeEventLogger.write({
|
|
@@ -980,6 +986,7 @@ const makeCopilotAdapter = effect.Effect.fn("makeCopilotAdapter")(function* (cop
|
|
|
980
986
|
requestId
|
|
981
987
|
})]);
|
|
982
988
|
});
|
|
989
|
+
const stopAll = makeStopAll(sessionDeps);
|
|
983
990
|
return {
|
|
984
991
|
provider: COPILOT_DRIVER_KIND,
|
|
985
992
|
capabilities: { sessionModelSwitch: "in-session" },
|
|
@@ -993,9 +1000,9 @@ const makeCopilotAdapter = effect.Effect.fn("makeCopilotAdapter")(function* (cop
|
|
|
993
1000
|
hasSession: makeHasSession(sessionDeps),
|
|
994
1001
|
readThread: makeReadThread(sessionDeps),
|
|
995
1002
|
rollbackThread: makeRollbackThread(),
|
|
996
|
-
stopAll:
|
|
1003
|
+
stopAll: () => stopAll().pipe(effect.Effect.tap(() => runtimeEventQueueMetrics.reset)),
|
|
997
1004
|
get streamEvents() {
|
|
998
|
-
return effect.Stream.fromQueue(runtimeEventQueue);
|
|
1005
|
+
return effect.Stream.fromQueue(runtimeEventQueue).pipe(effect.Stream.tap(() => runtimeEventQueueMetrics.recordDequeued()));
|
|
999
1006
|
}
|
|
1000
1007
|
};
|
|
1001
1008
|
});
|