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_ProviderDriver = require("./ProviderDriver--rNeAi3B.cjs");
|
|
10
10
|
let effect = require("effect");
|
|
@@ -281,6 +281,68 @@ const PROVIDER$1 = require_collectUint8StreamText.ProviderDriverKind.make("openc
|
|
|
281
281
|
function nowIso() {
|
|
282
282
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
283
283
|
}
|
|
284
|
+
function nonEmptyString(value) {
|
|
285
|
+
const trimmed = value?.trim();
|
|
286
|
+
return trimmed && trimmed.length > 0 ? trimmed : void 0;
|
|
287
|
+
}
|
|
288
|
+
function scopedOpenCodeId(sessionId, id) {
|
|
289
|
+
return `${sessionId}:${id}`;
|
|
290
|
+
}
|
|
291
|
+
function openCodeSubagentId(kind, id) {
|
|
292
|
+
return require_collectUint8StreamText.RuntimeSubagentId.make(`opencode:${kind}:${id}`);
|
|
293
|
+
}
|
|
294
|
+
function subagentKey(subagentId) {
|
|
295
|
+
return String(subagentId);
|
|
296
|
+
}
|
|
297
|
+
function statusFromOpenCodeSubagentState(status) {
|
|
298
|
+
return status;
|
|
299
|
+
}
|
|
300
|
+
function subagentCompletionStatus(status) {
|
|
301
|
+
return status;
|
|
302
|
+
}
|
|
303
|
+
function metadataWithEntries(entries) {
|
|
304
|
+
const metadata = Object.fromEntries(entries.filter(([, value]) => value !== void 0 && value !== null && value !== ""));
|
|
305
|
+
return Object.keys(metadata).length > 0 ? metadata : void 0;
|
|
306
|
+
}
|
|
307
|
+
function makeSubtaskSubagentRef(part) {
|
|
308
|
+
const description = nonEmptyString(part.description) ?? nonEmptyString(part.prompt);
|
|
309
|
+
const label = nonEmptyString(part.agent) ?? nonEmptyString(part.command) ?? (description ? "OpenCode subtask" : void 0);
|
|
310
|
+
return {
|
|
311
|
+
subagentId: openCodeSubagentId("subtask", part.id),
|
|
312
|
+
origin: "native",
|
|
313
|
+
capability: "summary",
|
|
314
|
+
...label ? { label } : {},
|
|
315
|
+
...description ? { description } : {},
|
|
316
|
+
parentProviderItemId: require_collectUint8StreamText.ProviderItemId.make(part.id),
|
|
317
|
+
metadata: metadataWithEntries([
|
|
318
|
+
["source", "opencode.subtask"],
|
|
319
|
+
["prompt", nonEmptyString(part.prompt)],
|
|
320
|
+
["agent", nonEmptyString(part.agent)],
|
|
321
|
+
["command", nonEmptyString(part.command)],
|
|
322
|
+
["model", part.model]
|
|
323
|
+
])
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function mergeOpenCodeChildSessionRef(existing, session, parentSessionId) {
|
|
327
|
+
const label = nonEmptyString(session.title) ?? existing?.label ?? "OpenCode subagent";
|
|
328
|
+
return {
|
|
329
|
+
subagentId: existing?.subagentId ?? openCodeSubagentId("session", session.id),
|
|
330
|
+
origin: "native",
|
|
331
|
+
capability: "transcript",
|
|
332
|
+
label,
|
|
333
|
+
...existing?.description ? { description: existing.description } : {},
|
|
334
|
+
providerSessionId: session.id,
|
|
335
|
+
providerThreadId: session.id,
|
|
336
|
+
...existing?.parentProviderItemId && { parentProviderItemId: existing.parentProviderItemId },
|
|
337
|
+
metadata: {
|
|
338
|
+
...existing?.metadata,
|
|
339
|
+
source: "opencode.session",
|
|
340
|
+
parentSessionId,
|
|
341
|
+
slug: session.slug,
|
|
342
|
+
directory: session.directory
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
}
|
|
284
346
|
/**
|
|
285
347
|
* Map a tagged OpenCodeRuntimeError produced by {@link runOpenCodeSdk} into
|
|
286
348
|
* the adapter-boundary `ProviderAdapterRequestError`. SDK-method-level call
|
|
@@ -424,7 +486,7 @@ function isoFromEpochMs(value) {
|
|
|
424
486
|
return new Date(value).toISOString();
|
|
425
487
|
}
|
|
426
488
|
function messageRoleForPart(context, part) {
|
|
427
|
-
const known = context.messageRoleById.get(part.messageID);
|
|
489
|
+
const known = context.messageRoleById.get(scopedOpenCodeId(part.sessionID, part.messageID));
|
|
428
490
|
if (known) return known;
|
|
429
491
|
return part.type === "tool" ? "assistant" : void 0;
|
|
430
492
|
}
|
|
@@ -495,6 +557,122 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
495
557
|
const emit = (event) => effect.Queue.offer(runtimeEvents, event).pipe(effect.Effect.andThen(runtimeEventQueueMetrics.recordEnqueued()), effect.Effect.asVoid);
|
|
496
558
|
const writeNativeEvent = (threadId, event) => nativeEventLogger ? nativeEventLogger.write(event, threadId) : effect.Effect.void;
|
|
497
559
|
const writeNativeEventBestEffort = (threadId, event) => writeNativeEvent(threadId, event).pipe(effect.Effect.catchCause(() => effect.Effect.void));
|
|
560
|
+
const emitOpenCodeSubagentStarted = effect.Effect.fn("emitOpenCodeSubagentStarted")(function* (context, subagent, raw) {
|
|
561
|
+
const key = subagentKey(subagent.subagentId);
|
|
562
|
+
if (context.startedSubagentIds.has(key)) return;
|
|
563
|
+
context.startedSubagentIds.add(key);
|
|
564
|
+
yield* emit({
|
|
565
|
+
...yield* buildEventBase({
|
|
566
|
+
threadId: context.session.threadId,
|
|
567
|
+
turnId: context.activeTurnId,
|
|
568
|
+
raw
|
|
569
|
+
}),
|
|
570
|
+
type: "subagent.started",
|
|
571
|
+
payload: { subagent }
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
const emitOpenCodeSubagentUpdated = effect.Effect.fn("emitOpenCodeSubagentUpdated")(function* (context, input) {
|
|
575
|
+
yield* emitOpenCodeSubagentStarted(context, input.subagent, input.raw);
|
|
576
|
+
yield* emit({
|
|
577
|
+
...yield* buildEventBase({
|
|
578
|
+
threadId: context.session.threadId,
|
|
579
|
+
turnId: context.activeTurnId,
|
|
580
|
+
raw: input.raw
|
|
581
|
+
}),
|
|
582
|
+
type: "subagent.updated",
|
|
583
|
+
payload: {
|
|
584
|
+
subagent: input.subagent,
|
|
585
|
+
...input.status ? { status: input.status } : {},
|
|
586
|
+
...input.summary ? { summary: input.summary } : {},
|
|
587
|
+
...input.detail ? { detail: input.detail } : {}
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
});
|
|
591
|
+
const emitOpenCodeSubagentCompleted = effect.Effect.fn("emitOpenCodeSubagentCompleted")(function* (context, input) {
|
|
592
|
+
const key = subagentKey(input.subagent.subagentId);
|
|
593
|
+
if (context.completedSubagentIds.has(key)) return;
|
|
594
|
+
yield* emitOpenCodeSubagentStarted(context, input.subagent, input.raw);
|
|
595
|
+
context.completedSubagentIds.add(key);
|
|
596
|
+
yield* emit({
|
|
597
|
+
...yield* buildEventBase({
|
|
598
|
+
threadId: context.session.threadId,
|
|
599
|
+
turnId: context.activeTurnId,
|
|
600
|
+
raw: input.raw
|
|
601
|
+
}),
|
|
602
|
+
type: "subagent.completed",
|
|
603
|
+
payload: {
|
|
604
|
+
subagent: input.subagent,
|
|
605
|
+
status: input.status,
|
|
606
|
+
...input.summary ? { summary: input.summary } : {}
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
const bindOpenCodeSubtaskPart = effect.Effect.fn("bindOpenCodeSubtaskPart")(function* (context, part, raw) {
|
|
611
|
+
const partKey = scopedOpenCodeId(part.sessionID, part.id);
|
|
612
|
+
const existing = context.subagentBySubtaskPartId.get(partKey);
|
|
613
|
+
const subagent = existing ?? makeSubtaskSubagentRef(part);
|
|
614
|
+
context.subagentBySubtaskPartId.set(partKey, subagent);
|
|
615
|
+
if (!existing && !context.unboundSubtaskPartIds.includes(partKey)) context.unboundSubtaskPartIds.push(partKey);
|
|
616
|
+
yield* emitOpenCodeSubagentUpdated(context, {
|
|
617
|
+
subagent,
|
|
618
|
+
status: statusFromOpenCodeSubagentState("starting"),
|
|
619
|
+
summary: nonEmptyString(part.description) ?? nonEmptyString(part.prompt),
|
|
620
|
+
detail: nonEmptyString(part.prompt),
|
|
621
|
+
raw
|
|
622
|
+
});
|
|
623
|
+
return subagent;
|
|
624
|
+
});
|
|
625
|
+
const takeUnboundOpenCodeSubtask = (context) => {
|
|
626
|
+
const partKey = context.unboundSubtaskPartIds.shift();
|
|
627
|
+
if (!partKey) return;
|
|
628
|
+
return context.subagentBySubtaskPartId.get(partKey);
|
|
629
|
+
};
|
|
630
|
+
const registerOpenCodeChildSession = effect.Effect.fn("registerOpenCodeChildSession")(function* (context, session, raw) {
|
|
631
|
+
if (session.parentID !== context.openCodeSessionId) return;
|
|
632
|
+
const subagent = mergeOpenCodeChildSessionRef(context.subagentBySessionId.get(session.id) ?? takeUnboundOpenCodeSubtask(context), session, context.openCodeSessionId);
|
|
633
|
+
const known = context.childSessionIds.has(session.id);
|
|
634
|
+
context.childSessionIds.add(session.id);
|
|
635
|
+
context.subagentBySessionId.set(session.id, subagent);
|
|
636
|
+
if (known) {
|
|
637
|
+
yield* emitOpenCodeSubagentUpdated(context, {
|
|
638
|
+
subagent,
|
|
639
|
+
status: statusFromOpenCodeSubagentState("running"),
|
|
640
|
+
raw
|
|
641
|
+
});
|
|
642
|
+
return subagent;
|
|
643
|
+
}
|
|
644
|
+
const wasStartedFromSubtask = context.startedSubagentIds.has(subagentKey(subagent.subagentId));
|
|
645
|
+
yield* emitOpenCodeSubagentStarted(context, subagent, raw);
|
|
646
|
+
if (wasStartedFromSubtask) yield* emitOpenCodeSubagentUpdated(context, {
|
|
647
|
+
subagent,
|
|
648
|
+
status: statusFromOpenCodeSubagentState("running"),
|
|
649
|
+
raw
|
|
650
|
+
});
|
|
651
|
+
return subagent;
|
|
652
|
+
});
|
|
653
|
+
const hydrateOpenCodeChildSessions = effect.Effect.fn("hydrateOpenCodeChildSessions")(function* (context) {
|
|
654
|
+
const children = yield* require_bin.runOpenCodeSdk("session.children", () => context.client.session.children({ sessionID: context.openCodeSessionId })).pipe(effect.Effect.map((response) => {
|
|
655
|
+
const value = response;
|
|
656
|
+
if (Array.isArray(value)) return value;
|
|
657
|
+
const data = value.data;
|
|
658
|
+
return Array.isArray(data) ? data : [];
|
|
659
|
+
}), effect.Effect.catchCause((cause) => effect.Effect.gen(function* () {
|
|
660
|
+
const error = effect.Cause.squash(cause);
|
|
661
|
+
yield* emit({
|
|
662
|
+
...yield* buildEventBase({ threadId: context.session.threadId }),
|
|
663
|
+
type: "runtime.warning",
|
|
664
|
+
payload: {
|
|
665
|
+
message: "OpenCode child session hydration failed.",
|
|
666
|
+
detail: require_bin.OpenCodeRuntimeError.is(error) ? error.detail : require_bin.openCodeRuntimeErrorDetail(error)
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
return [];
|
|
670
|
+
})));
|
|
671
|
+
for (const child of children) yield* registerOpenCodeChildSession(context, child, {
|
|
672
|
+
method: "session.children",
|
|
673
|
+
child
|
|
674
|
+
});
|
|
675
|
+
});
|
|
498
676
|
const emitUnexpectedExit = effect.Effect.fn("emitUnexpectedExit")(function* (context, message) {
|
|
499
677
|
if (yield* effect.Ref.getAndSet(context.stopped, true)) return;
|
|
500
678
|
const turnId = context.activeTurnId;
|
|
@@ -529,29 +707,52 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
529
707
|
const emitAssistantTextDelta = effect.Effect.fn("emitAssistantTextDelta")(function* (context, part, turnId, raw) {
|
|
530
708
|
const text = textFromPart(part);
|
|
531
709
|
if (text === void 0) return;
|
|
532
|
-
const
|
|
533
|
-
context.emittedTextByPartId.
|
|
534
|
-
|
|
710
|
+
const partKey = scopedOpenCodeId(part.sessionID, part.id);
|
|
711
|
+
const { latestText, deltaToEmit } = mergeOpenCodeAssistantText(context.emittedTextByPartId.get(partKey), text);
|
|
712
|
+
context.emittedTextByPartId.set(partKey, latestText);
|
|
713
|
+
if (latestText !== text) context.partById.set(partKey, part.type === "text" || part.type === "reasoning" ? {
|
|
535
714
|
...part,
|
|
536
715
|
text: latestText
|
|
537
716
|
} : part);
|
|
538
|
-
if (deltaToEmit.length > 0)
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
717
|
+
if (deltaToEmit.length > 0) {
|
|
718
|
+
const subagent = context.subagentBySessionId.get(part.sessionID);
|
|
719
|
+
if (subagent) yield* emit({
|
|
720
|
+
...yield* buildEventBase({
|
|
721
|
+
threadId: context.session.threadId,
|
|
722
|
+
turnId,
|
|
723
|
+
itemId: part.id,
|
|
724
|
+
createdAt: part.type === "text" || part.type === "reasoning" ? isoFromEpochMs(part.time?.start) : void 0,
|
|
725
|
+
raw
|
|
726
|
+
}),
|
|
727
|
+
type: "subagent.message.delta",
|
|
728
|
+
payload: {
|
|
729
|
+
subagentId: subagent.subagentId,
|
|
730
|
+
delta: deltaToEmit,
|
|
731
|
+
streamKind: resolveTextStreamKind(part),
|
|
732
|
+
role: "assistant",
|
|
733
|
+
providerSessionId: part.sessionID,
|
|
734
|
+
providerThreadId: part.sessionID,
|
|
735
|
+
providerMessageId: part.messageID
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
else yield* emit({
|
|
739
|
+
...yield* buildEventBase({
|
|
740
|
+
threadId: context.session.threadId,
|
|
741
|
+
turnId,
|
|
742
|
+
itemId: part.id,
|
|
743
|
+
createdAt: part.type === "text" || part.type === "reasoning" ? isoFromEpochMs(part.time?.start) : void 0,
|
|
744
|
+
raw
|
|
745
|
+
}),
|
|
746
|
+
type: "content.delta",
|
|
747
|
+
payload: {
|
|
748
|
+
streamKind: resolveTextStreamKind(part),
|
|
749
|
+
delta: deltaToEmit
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
if (part.type === "text" && part.time?.end !== void 0 && !context.completedAssistantPartIds.has(partKey)) {
|
|
754
|
+
context.completedAssistantPartIds.add(partKey);
|
|
755
|
+
if (!context.subagentBySessionId.get(part.sessionID)) yield* emit({
|
|
555
756
|
...yield* buildEventBase({
|
|
556
757
|
threadId: context.session.threadId,
|
|
557
758
|
turnId,
|
|
@@ -570,45 +771,73 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
570
771
|
}
|
|
571
772
|
});
|
|
572
773
|
const handleSubscribedEvent = effect.Effect.fn("handleSubscribedEvent")(function* (context, event) {
|
|
573
|
-
|
|
774
|
+
const payloadSessionId = "properties" in event ? event.properties.sessionID : void 0;
|
|
775
|
+
const eventSessionId = typeof payloadSessionId === "string" ? payloadSessionId : void 0;
|
|
776
|
+
const isRootSessionEvent = eventSessionId === context.openCodeSessionId;
|
|
777
|
+
const isKnownChildSessionEvent = eventSessionId !== void 0 && context.childSessionIds.has(eventSessionId);
|
|
778
|
+
const isChildSessionCreatedEvent = event.type === "session.created" && event.properties.info.parentID === context.openCodeSessionId;
|
|
779
|
+
if (!isRootSessionEvent && !isKnownChildSessionEvent && !isChildSessionCreatedEvent) return;
|
|
574
780
|
const turnId = context.activeTurnId;
|
|
575
781
|
yield* writeNativeEventBestEffort(context.session.threadId, {
|
|
576
782
|
observedAt: nowIso(),
|
|
577
783
|
event: {
|
|
578
784
|
provider: PROVIDER$1,
|
|
579
785
|
threadId: context.session.threadId,
|
|
580
|
-
providerThreadId: context.openCodeSessionId,
|
|
786
|
+
providerThreadId: eventSessionId ?? context.openCodeSessionId,
|
|
581
787
|
type: event.type,
|
|
582
788
|
...turnId ? { turnId } : {},
|
|
583
789
|
payload: event
|
|
584
790
|
}
|
|
585
791
|
});
|
|
586
792
|
switch (event.type) {
|
|
793
|
+
case "session.created":
|
|
794
|
+
yield* registerOpenCodeChildSession(context, event.properties.info, event);
|
|
795
|
+
break;
|
|
587
796
|
case "message.updated":
|
|
588
|
-
context.messageRoleById.set(event.properties.info.id, event.properties.info.role);
|
|
797
|
+
context.messageRoleById.set(scopedOpenCodeId(event.properties.sessionID, event.properties.info.id), event.properties.info.role);
|
|
589
798
|
if (event.properties.info.role === "assistant") for (const part of context.partById.values()) {
|
|
590
|
-
if (part.messageID !== event.properties.info.id) continue;
|
|
799
|
+
if (part.sessionID !== event.properties.sessionID || part.messageID !== event.properties.info.id) continue;
|
|
591
800
|
yield* emitAssistantTextDelta(context, part, turnId, event);
|
|
592
801
|
}
|
|
593
802
|
break;
|
|
594
803
|
case "message.removed":
|
|
595
|
-
context.messageRoleById.delete(event.properties.messageID);
|
|
804
|
+
context.messageRoleById.delete(scopedOpenCodeId(event.properties.sessionID, event.properties.messageID));
|
|
596
805
|
break;
|
|
597
806
|
case "message.part.delta": {
|
|
598
|
-
const
|
|
807
|
+
const partKey = scopedOpenCodeId(event.properties.sessionID, event.properties.partID);
|
|
808
|
+
const existingPart = context.partById.get(partKey);
|
|
599
809
|
if (!existingPart) break;
|
|
600
810
|
if (messageRoleForPart(context, existingPart) !== "assistant") break;
|
|
601
811
|
const streamKind = resolveTextStreamKind(existingPart);
|
|
602
812
|
const delta = event.properties.delta;
|
|
603
813
|
if (delta.length === 0) break;
|
|
604
|
-
const { nextText, deltaToEmit } = appendOpenCodeAssistantTextDelta(context.emittedTextByPartId.get(
|
|
814
|
+
const { nextText, deltaToEmit } = appendOpenCodeAssistantTextDelta(context.emittedTextByPartId.get(partKey) ?? textFromPart(existingPart) ?? "", delta);
|
|
605
815
|
if (deltaToEmit.length === 0) break;
|
|
606
|
-
context.emittedTextByPartId.set(
|
|
607
|
-
if (existingPart.type === "text" || existingPart.type === "reasoning") context.partById.set(
|
|
816
|
+
context.emittedTextByPartId.set(partKey, nextText);
|
|
817
|
+
if (existingPart.type === "text" || existingPart.type === "reasoning") context.partById.set(partKey, {
|
|
608
818
|
...existingPart,
|
|
609
819
|
text: nextText
|
|
610
820
|
});
|
|
611
|
-
|
|
821
|
+
const subagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
822
|
+
if (subagent) yield* emit({
|
|
823
|
+
...yield* buildEventBase({
|
|
824
|
+
threadId: context.session.threadId,
|
|
825
|
+
turnId,
|
|
826
|
+
itemId: event.properties.partID,
|
|
827
|
+
raw: event
|
|
828
|
+
}),
|
|
829
|
+
type: "subagent.message.delta",
|
|
830
|
+
payload: {
|
|
831
|
+
subagentId: subagent.subagentId,
|
|
832
|
+
delta: deltaToEmit,
|
|
833
|
+
streamKind,
|
|
834
|
+
role: "assistant",
|
|
835
|
+
providerSessionId: event.properties.sessionID,
|
|
836
|
+
providerThreadId: event.properties.sessionID,
|
|
837
|
+
providerMessageId: event.properties.messageID
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
else yield* emit({
|
|
612
841
|
...yield* buildEventBase({
|
|
613
842
|
threadId: context.session.threadId,
|
|
614
843
|
turnId,
|
|
@@ -625,12 +854,24 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
625
854
|
}
|
|
626
855
|
case "message.part.updated": {
|
|
627
856
|
const part = event.properties.part;
|
|
628
|
-
context.partById.set(part.id, part);
|
|
857
|
+
context.partById.set(scopedOpenCodeId(part.sessionID, part.id), part);
|
|
629
858
|
if (messageRoleForPart(context, part) === "assistant") yield* emitAssistantTextDelta(context, part, turnId, event);
|
|
859
|
+
if (part.type === "subtask" && part.sessionID === context.openCodeSessionId) yield* bindOpenCodeSubtaskPart(context, part, event);
|
|
630
860
|
if (part.type === "tool") {
|
|
631
861
|
const itemType = toToolLifecycleItemType(part.tool);
|
|
632
862
|
const title = part.state.status === "running" ? part.state.title ?? part.tool : part.tool;
|
|
633
863
|
const detail = detailFromToolPart(part);
|
|
864
|
+
const childSubagent = context.subagentBySessionId.get(part.sessionID);
|
|
865
|
+
if (childSubagent) {
|
|
866
|
+
yield* emitOpenCodeSubagentUpdated(context, {
|
|
867
|
+
subagent: childSubagent,
|
|
868
|
+
status: statusFromOpenCodeSubagentState("running"),
|
|
869
|
+
summary: title,
|
|
870
|
+
detail,
|
|
871
|
+
raw: event
|
|
872
|
+
});
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
634
875
|
const payload = {
|
|
635
876
|
itemType,
|
|
636
877
|
...part.state.status === "error" ? { status: "failed" } : part.state.status === "completed" ? { status: "completed" } : { status: "inProgress" },
|
|
@@ -732,7 +973,25 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
732
973
|
payload: { answers: {} }
|
|
733
974
|
});
|
|
734
975
|
break;
|
|
735
|
-
case "session.status":
|
|
976
|
+
case "session.status": {
|
|
977
|
+
const childSubagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
978
|
+
if (childSubagent) {
|
|
979
|
+
if (event.properties.status.type === "idle") {
|
|
980
|
+
yield* emitOpenCodeSubagentCompleted(context, {
|
|
981
|
+
subagent: childSubagent,
|
|
982
|
+
status: subagentCompletionStatus("completed"),
|
|
983
|
+
raw: event
|
|
984
|
+
});
|
|
985
|
+
break;
|
|
986
|
+
}
|
|
987
|
+
yield* emitOpenCodeSubagentUpdated(context, {
|
|
988
|
+
subagent: childSubagent,
|
|
989
|
+
status: statusFromOpenCodeSubagentState("running"),
|
|
990
|
+
...event.properties.status.type === "retry" ? { detail: event.properties.status.message } : {},
|
|
991
|
+
raw: event
|
|
992
|
+
});
|
|
993
|
+
break;
|
|
994
|
+
}
|
|
736
995
|
if (event.properties.status.type === "busy") updateProviderSession(context, {
|
|
737
996
|
status: "running",
|
|
738
997
|
activeTurnId: turnId
|
|
@@ -766,8 +1025,28 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
766
1025
|
});
|
|
767
1026
|
}
|
|
768
1027
|
break;
|
|
1028
|
+
}
|
|
1029
|
+
case "session.idle": {
|
|
1030
|
+
const childSubagent = context.subagentBySessionId.get(event.properties.sessionID);
|
|
1031
|
+
if (childSubagent) yield* emitOpenCodeSubagentCompleted(context, {
|
|
1032
|
+
subagent: childSubagent,
|
|
1033
|
+
status: subagentCompletionStatus("completed"),
|
|
1034
|
+
raw: event
|
|
1035
|
+
});
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
769
1038
|
case "session.error": {
|
|
770
1039
|
const message = sessionErrorMessage(event.properties.error);
|
|
1040
|
+
const childSubagent = event.properties.sessionID !== void 0 ? context.subagentBySessionId.get(event.properties.sessionID) : void 0;
|
|
1041
|
+
if (childSubagent) {
|
|
1042
|
+
yield* emitOpenCodeSubagentCompleted(context, {
|
|
1043
|
+
subagent: childSubagent,
|
|
1044
|
+
status: subagentCompletionStatus("failed"),
|
|
1045
|
+
summary: message,
|
|
1046
|
+
raw: event
|
|
1047
|
+
});
|
|
1048
|
+
break;
|
|
1049
|
+
}
|
|
771
1050
|
const activeTurnId = context.activeTurnId;
|
|
772
1051
|
context.activeTurnId = void 0;
|
|
773
1052
|
updateProviderSession(context, {
|
|
@@ -895,6 +1174,12 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
895
1174
|
emittedTextByPartId: /* @__PURE__ */ new Map(),
|
|
896
1175
|
messageRoleById: /* @__PURE__ */ new Map(),
|
|
897
1176
|
completedAssistantPartIds: /* @__PURE__ */ new Set(),
|
|
1177
|
+
childSessionIds: /* @__PURE__ */ new Set(),
|
|
1178
|
+
subagentBySessionId: /* @__PURE__ */ new Map(),
|
|
1179
|
+
subagentBySubtaskPartId: /* @__PURE__ */ new Map(),
|
|
1180
|
+
unboundSubtaskPartIds: [],
|
|
1181
|
+
startedSubagentIds: /* @__PURE__ */ new Set(),
|
|
1182
|
+
completedSubagentIds: /* @__PURE__ */ new Set(),
|
|
898
1183
|
turns: [],
|
|
899
1184
|
activeTurnId: void 0,
|
|
900
1185
|
activeAgent: void 0,
|
|
@@ -903,7 +1188,6 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
903
1188
|
sessionScope: started.sessionScope
|
|
904
1189
|
};
|
|
905
1190
|
sessions.set(input.threadId, context);
|
|
906
|
-
yield* startEventPump(context);
|
|
907
1191
|
yield* emit({
|
|
908
1192
|
...yield* buildEventBase({ threadId: input.threadId }),
|
|
909
1193
|
type: "session.started",
|
|
@@ -914,6 +1198,8 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
914
1198
|
type: "thread.started",
|
|
915
1199
|
payload: { providerThreadId: started.openCodeSession.id }
|
|
916
1200
|
});
|
|
1201
|
+
yield* startEventPump(context);
|
|
1202
|
+
yield* hydrateOpenCodeChildSessions(context).pipe(effect.Effect.forkIn(context.sessionScope));
|
|
917
1203
|
return session;
|
|
918
1204
|
});
|
|
919
1205
|
const sendTurn = effect.Effect.fn("sendTurn")(function* (input) {
|
|
@@ -951,7 +1237,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
951
1237
|
const agent = require_bin.getModelSelectionStringOptionValue(modelSelection, "agent");
|
|
952
1238
|
const variant = require_bin.getModelSelectionStringOptionValue(modelSelection, "variant");
|
|
953
1239
|
context.activeTurnId = turnId;
|
|
954
|
-
context.activeAgent = agent ?? (input.interactionMode === "plan" ? "plan" : void 0);
|
|
1240
|
+
context.activeAgent = agent ?? (input.interactionMode === "plan" || input.interactionMode === "ask" ? "plan" : void 0);
|
|
955
1241
|
context.activeVariant = variant;
|
|
956
1242
|
updateProviderSession(context, {
|
|
957
1243
|
status: "running",
|
|
@@ -1436,6 +1722,7 @@ const OpenCodeDriver = {
|
|
|
1436
1722
|
const openCodeRuntime = yield* require_bin.OpenCodeRuntime;
|
|
1437
1723
|
const serverConfig = yield* require_Metrics.ServerConfig;
|
|
1438
1724
|
const httpClient = yield* effect_unstable_http.HttpClient.HttpClient;
|
|
1725
|
+
const serverSettings = yield* require_bin.ServerSettingsService;
|
|
1439
1726
|
const eventLoggers = yield* require_bin.ProviderEventLoggers;
|
|
1440
1727
|
const processEnv = require_bin.mergeProviderInstanceEnvironment(environment);
|
|
1441
1728
|
const continuationIdentity = require_ProviderDriver.defaultProviderContinuationIdentity({
|
|
@@ -1477,7 +1764,7 @@ const OpenCodeDriver = {
|
|
|
1477
1764
|
haveSettingsChanged: () => false,
|
|
1478
1765
|
initialSnapshot: (settings) => stampIdentity(makePendingOpenCodeProvider(settings)),
|
|
1479
1766
|
checkProvider,
|
|
1480
|
-
enrichSnapshot: ({ snapshot, publishSnapshot }) => require_bin.enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(effect.Effect.provideService(effect_unstable_http.HttpClient.HttpClient, httpClient), effect.Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot))),
|
|
1767
|
+
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))),
|
|
1481
1768
|
refreshInterval: null
|
|
1482
1769
|
}).pipe(effect.Effect.mapError((cause) => new require_bin.ProviderDriverError({
|
|
1483
1770
|
driver: DRIVER_KIND,
|
|
@@ -1,53 +1,8 @@
|
|
|
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
|
let effect = require("effect");
|
|
5
5
|
let effect_unstable_process = require("effect/unstable/process");
|
|
6
|
-
//#region ../../packages/shared/src/schemaJson.ts
|
|
7
|
-
const decodeJsonResult = (schema) => {
|
|
8
|
-
const decode = effect.Schema.decodeExit(effect.Schema.fromJsonString(schema));
|
|
9
|
-
return (input) => {
|
|
10
|
-
const result = decode(input);
|
|
11
|
-
if (effect.Exit.isFailure(result)) return effect.Result.fail(result.cause);
|
|
12
|
-
return effect.Result.succeed(result.value);
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const formatSchemaError = (cause) => {
|
|
16
|
-
const squashed = effect.Cause.squash(cause);
|
|
17
|
-
return effect.Schema.isSchemaError(squashed) ? effect.SchemaIssue.makeFormatterDefault()(squashed.issue) : effect.Cause.pretty(cause);
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* A `Getter` that parses a lenient JSON string (tolerating trailing commas
|
|
21
|
-
* and JS-style comments) into an unknown value.
|
|
22
|
-
*
|
|
23
|
-
* Mirrors `SchemaGetter.parseJson()` but uses `parseLenientJson` instead
|
|
24
|
-
* of `JSON.parse`.
|
|
25
|
-
*/
|
|
26
|
-
const parseLenientJsonGetter = effect.SchemaGetter.onSome((input) => effect.Effect.try({
|
|
27
|
-
try: () => {
|
|
28
|
-
let stripped = input.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g, (match, stringLiteral) => stringLiteral ? match : "");
|
|
29
|
-
stripped = stripped.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g, (match, stringLiteral) => stringLiteral ? match : "");
|
|
30
|
-
stripped = stripped.replace(/,(\s*[}\]])/g, "$1");
|
|
31
|
-
return effect.Option.some(JSON.parse(stripped));
|
|
32
|
-
},
|
|
33
|
-
catch: (e) => new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message: String(e) })
|
|
34
|
-
}));
|
|
35
|
-
/**
|
|
36
|
-
* Schema transformation: lenient JSONC string ↔ unknown.
|
|
37
|
-
*
|
|
38
|
-
* Same API as `SchemaTransformation.fromJsonString`, but the decode side
|
|
39
|
-
* strips trailing commas and JS-style comments before parsing.
|
|
40
|
-
* Encoding produces strict JSON via `JSON.stringify`.
|
|
41
|
-
*/
|
|
42
|
-
const fromLenientJsonString = new effect.SchemaTransformation.Transformation(parseLenientJsonGetter, effect.SchemaGetter.stringifyJson());
|
|
43
|
-
/**
|
|
44
|
-
* Build a schema that decodes a lenient JSON string into `A`.
|
|
45
|
-
*
|
|
46
|
-
* Drop-in replacement for `Schema.fromJsonString(schema)` that tolerates
|
|
47
|
-
* trailing commas and comments in the input.
|
|
48
|
-
*/
|
|
49
|
-
const fromLenientJson = (schema) => effect.Schema.String.pipe(effect.Schema.decodeTo(schema, fromLenientJsonString));
|
|
50
|
-
//#endregion
|
|
51
6
|
//#region src/vcs/VcsProcess.ts
|
|
52
7
|
var VcsProcess = class extends effect.Context.Service()("ryco/vcs/VcsProcess") {};
|
|
53
8
|
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
@@ -584,12 +539,6 @@ Object.defineProperty(exports, "azureDevOpsDiscovery", {
|
|
|
584
539
|
return azureDevOpsDiscovery;
|
|
585
540
|
}
|
|
586
541
|
});
|
|
587
|
-
Object.defineProperty(exports, "decodeJsonResult", {
|
|
588
|
-
enumerable: true,
|
|
589
|
-
get: function() {
|
|
590
|
-
return decodeJsonResult;
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
542
|
Object.defineProperty(exports, "detailFromCause", {
|
|
594
543
|
enumerable: true,
|
|
595
544
|
get: function() {
|
|
@@ -602,18 +551,6 @@ Object.defineProperty(exports, "firstNonEmptyLine", {
|
|
|
602
551
|
return firstNonEmptyLine;
|
|
603
552
|
}
|
|
604
553
|
});
|
|
605
|
-
Object.defineProperty(exports, "formatSchemaError", {
|
|
606
|
-
enumerable: true,
|
|
607
|
-
get: function() {
|
|
608
|
-
return formatSchemaError;
|
|
609
|
-
}
|
|
610
|
-
});
|
|
611
|
-
Object.defineProperty(exports, "fromLenientJson", {
|
|
612
|
-
enumerable: true,
|
|
613
|
-
get: function() {
|
|
614
|
-
return fromLenientJson;
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
554
|
Object.defineProperty(exports, "githubDiscovery", {
|
|
618
555
|
enumerable: true,
|
|
619
556
|
get: function() {
|
|
@@ -1,53 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { An as
|
|
4
|
-
import {
|
|
3
|
+
import { An as VcsOutputDecodeError, Mn as VcsProcessSpawnError, Nn as VcsProcessTimeoutError, jn as VcsProcessExitError, t as collectUint8StreamText } from "./collectUint8StreamText-COE2_gie.mjs";
|
|
4
|
+
import { Context, Duration, Effect, Layer, Option, Schema, Sink, Stream } from "effect";
|
|
5
5
|
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
|
|
6
|
-
//#region ../../packages/shared/src/schemaJson.ts
|
|
7
|
-
const decodeJsonResult = (schema) => {
|
|
8
|
-
const decode = Schema.decodeExit(Schema.fromJsonString(schema));
|
|
9
|
-
return (input) => {
|
|
10
|
-
const result = decode(input);
|
|
11
|
-
if (Exit.isFailure(result)) return Result.fail(result.cause);
|
|
12
|
-
return Result.succeed(result.value);
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
const formatSchemaError = (cause) => {
|
|
16
|
-
const squashed = Cause.squash(cause);
|
|
17
|
-
return Schema.isSchemaError(squashed) ? SchemaIssue.makeFormatterDefault()(squashed.issue) : Cause.pretty(cause);
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* A `Getter` that parses a lenient JSON string (tolerating trailing commas
|
|
21
|
-
* and JS-style comments) into an unknown value.
|
|
22
|
-
*
|
|
23
|
-
* Mirrors `SchemaGetter.parseJson()` but uses `parseLenientJson` instead
|
|
24
|
-
* of `JSON.parse`.
|
|
25
|
-
*/
|
|
26
|
-
const parseLenientJsonGetter = SchemaGetter.onSome((input) => Effect.try({
|
|
27
|
-
try: () => {
|
|
28
|
-
let stripped = input.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g, (match, stringLiteral) => stringLiteral ? match : "");
|
|
29
|
-
stripped = stripped.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g, (match, stringLiteral) => stringLiteral ? match : "");
|
|
30
|
-
stripped = stripped.replace(/,(\s*[}\]])/g, "$1");
|
|
31
|
-
return Option.some(JSON.parse(stripped));
|
|
32
|
-
},
|
|
33
|
-
catch: (e) => new SchemaIssue.InvalidValue(Option.some(input), { message: String(e) })
|
|
34
|
-
}));
|
|
35
|
-
/**
|
|
36
|
-
* Schema transformation: lenient JSONC string ↔ unknown.
|
|
37
|
-
*
|
|
38
|
-
* Same API as `SchemaTransformation.fromJsonString`, but the decode side
|
|
39
|
-
* strips trailing commas and JS-style comments before parsing.
|
|
40
|
-
* Encoding produces strict JSON via `JSON.stringify`.
|
|
41
|
-
*/
|
|
42
|
-
const fromLenientJsonString = new SchemaTransformation.Transformation(parseLenientJsonGetter, SchemaGetter.stringifyJson());
|
|
43
|
-
/**
|
|
44
|
-
* Build a schema that decodes a lenient JSON string into `A`.
|
|
45
|
-
*
|
|
46
|
-
* Drop-in replacement for `Schema.fromJsonString(schema)` that tolerates
|
|
47
|
-
* trailing commas and comments in the input.
|
|
48
|
-
*/
|
|
49
|
-
const fromLenientJson = (schema) => Schema.String.pipe(Schema.decodeTo(schema, fromLenientJsonString));
|
|
50
|
-
//#endregion
|
|
51
6
|
//#region src/vcs/VcsProcess.ts
|
|
52
7
|
var VcsProcess = class extends Context.Service()("ryco/vcs/VcsProcess") {};
|
|
53
8
|
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
@@ -566,4 +521,4 @@ function makeForgejoDiscovery(forgejo) {
|
|
|
566
521
|
};
|
|
567
522
|
}
|
|
568
523
|
//#endregion
|
|
569
|
-
export {
|
|
524
|
+
export { makeForgejoDiscovery as a, sourceBranch as c, firstNonEmptyLine as d, probeSourceControlProvider as f, layer as h, makeBitbucketDiscovery as i, sourceControlRefFromInput as l, VcsProcess as m, githubDiscovery as n, SourceControlProvider as o, refineUnknownRemoteProvider as p, gitlabDiscovery as r, parseSourceControlOwnerRef as s, azureDevOpsDiscovery as t, detailFromCause as u };
|