openmeld 0.3.246 → 0.3.248
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/{add-me-membership-C7dYkfPz.js → add-me-membership-zSJAa2ET.js} +2 -2
- package/dist/{add-me-membership-C7dYkfPz.js.map → add-me-membership-zSJAa2ET.js.map} +1 -1
- package/dist/{agents-QisYIlFS.js → agents-DLjDbkLV.js} +10 -10
- package/dist/{agents-QisYIlFS.js.map → agents-DLjDbkLV.js.map} +1 -1
- package/dist/{api-client-foundation-CYbEdm9o.js → api-client-foundation-BZvzqIeX.js} +3 -3
- package/dist/{api-client-foundation-CYbEdm9o.js.map → api-client-foundation-BZvzqIeX.js.map} +1 -1
- package/dist/{api-client-foundation-B1aTRrIy.js → api-client-foundation-DE_UqE2s.js} +1 -1
- package/dist/auth-session-BOi-tZ2y.js +4 -0
- package/dist/{auth-session-JhILeJRO.js → auth-session-DywRZLBr.js} +4 -4
- package/dist/{auth-session-JhILeJRO.js.map → auth-session-DywRZLBr.js.map} +1 -1
- package/dist/{channel-C6tm9T7P.js → channel-40SR2b5S.js} +3 -3
- package/dist/{channel-C6tm9T7P.js.map → channel-40SR2b5S.js.map} +1 -1
- package/dist/{cloud-computer-J2tdcTPm.js → cloud-computer-BqFhsHhC.js} +4 -4
- package/dist/{cloud-computer-J2tdcTPm.js.map → cloud-computer-BqFhsHhC.js.map} +1 -1
- package/dist/{command-BXJ-OwBD.js → command-DBfu-GeG.js} +15 -15
- package/dist/{command-BXJ-OwBD.js.map → command-DBfu-GeG.js.map} +1 -1
- package/dist/{computer-connection-BKtrn0d2.js → computer-connection-CVyM42a0.js} +2 -2
- package/dist/{computer-connection-BKtrn0d2.js.map → computer-connection-CVyM42a0.js.map} +1 -1
- package/dist/{computer-connection-review-bUqNKi6q.js → computer-connection-review-B5qKu2C9.js} +5 -5
- package/dist/{computer-connection-review-bUqNKi6q.js.map → computer-connection-review-B5qKu2C9.js.map} +1 -1
- package/dist/{computer-disconnect-D_Apsn9P.js → computer-disconnect-BxhAjQQx.js} +7 -7
- package/dist/{computer-disconnect-D_Apsn9P.js.map → computer-disconnect-BxhAjQQx.js.map} +1 -1
- package/dist/{computer-setup-continuation-occq0LmS.js → computer-setup-continuation-V40ov5FS.js} +3 -3
- package/dist/{computer-setup-continuation-occq0LmS.js.map → computer-setup-continuation-V40ov5FS.js.map} +1 -1
- package/dist/{context-M7dvalCp.js → context-BEgBhfbb.js} +4 -4
- package/dist/{context-M7dvalCp.js.map → context-BEgBhfbb.js.map} +1 -1
- package/dist/{daemon-device-id-C3gKch4E.js → daemon-device-id-CmykIapy.js} +4 -4
- package/dist/{daemon-device-id-C3gKch4E.js.map → daemon-device-id-CmykIapy.js.map} +1 -1
- package/dist/{daemon-lifecycle-journal-CGUuJshv.js → daemon-lifecycle-journal-2dzGUSWU.js} +3 -3
- package/dist/{daemon-lifecycle-journal-CGUuJshv.js.map → daemon-lifecycle-journal-2dzGUSWU.js.map} +1 -1
- package/dist/{daemon-service-runtime-CktU3ER4.js → daemon-service-runtime-pECs8jVc.js} +2 -2
- package/dist/{daemon-service-runtime-CktU3ER4.js.map → daemon-service-runtime-pECs8jVc.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-D0-15tZW.js → daemon-service-update-coordinator-DJKBTEjx.js} +14 -14
- package/dist/daemon-service-update-coordinator-DJKBTEjx.js.map +1 -0
- package/dist/{dispatch-owned-runtime-gOluDX5_.js → dispatch-owned-runtime-QhxDRdNr.js} +191 -52
- package/dist/dispatch-owned-runtime-QhxDRdNr.js.map +1 -0
- package/dist/{dist-KibLweLD.js → dist-BQcUIyf6.js} +747 -529
- package/dist/dist-BQcUIyf6.js.map +1 -0
- package/dist/dist-C8M8nzJ2.js +4 -0
- package/dist/{dual-view-guide-catalog-0kSizTFt.js → dual-view-guide-catalog-DDsnLpIT.js} +3 -3
- package/dist/{dual-view-guide-catalog-0kSizTFt.js.map → dual-view-guide-catalog-DDsnLpIT.js.map} +1 -1
- package/dist/{elapsed-time-Bo1CJczC.js → elapsed-time-DTb6L36x.js} +3 -3
- package/dist/{elapsed-time-Bo1CJczC.js.map → elapsed-time-DTb6L36x.js.map} +1 -1
- package/dist/{entry-B11DkH2I.js → entry-B3w4ZTC5.js} +7 -7
- package/dist/{entry-B11DkH2I.js.map → entry-B3w4ZTC5.js.map} +1 -1
- package/dist/{installation-inventory-BZgQmVup.js → installation-inventory-CCkKix8R.js} +3 -3
- package/dist/{installation-inventory-BZgQmVup.js.map → installation-inventory-CCkKix8R.js.map} +1 -1
- package/dist/{installer-k2gOOs58.js → installer-BiZM-o_y.js} +2 -2
- package/dist/{installer-k2gOOs58.js.map → installer-BiZM-o_y.js.map} +1 -1
- package/dist/{meta-api-DruuiAx-.js → meta-api-9iqkG_MP.js} +5 -5
- package/dist/{meta-api-DruuiAx-.js.map → meta-api-9iqkG_MP.js.map} +1 -1
- package/dist/{open-code-permission-DHFJYc_o.js → open-code-permission-B5f1e5an.js} +2 -31
- package/dist/open-code-permission-B5f1e5an.js.map +1 -0
- package/dist/{openmeld-DUdN78WD.js → openmeld-C70uo4ON.js} +215 -71
- package/dist/openmeld-C70uo4ON.js.map +1 -0
- package/dist/{openmeld-maintenance-worker-DwkvZD0q.js → openmeld-maintenance-worker-BFPEm1rE.js} +9 -9
- package/dist/{openmeld-maintenance-worker-DwkvZD0q.js.map → openmeld-maintenance-worker-BFPEm1rE.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-BNUIw_Lo.js → openmeld-tools-update-join-Bki3ugUW.js} +4 -4
- package/dist/{openmeld-tools-update-join-BNUIw_Lo.js.map → openmeld-tools-update-join-Bki3ugUW.js.map} +1 -1
- package/dist/openmeld.js +4 -4
- package/dist/{prepare-provider-runtime-_XRIioDp.js → prepare-provider-runtime-CWZOcEF7.js} +85 -23
- package/dist/prepare-provider-runtime-CWZOcEF7.js.map +1 -0
- package/dist/{prepare-session-executor-B5AjN0qz.js → prepare-session-executor-B8XSTQdx.js} +18 -18
- package/dist/{prepare-session-executor-B5AjN0qz.js.map → prepare-session-executor-B8XSTQdx.js.map} +1 -1
- package/dist/{process-channel-CTXWjlBP.js → process-channel-DLXPiGRF.js} +2 -2
- package/dist/{process-channel-CTXWjlBP.js.map → process-channel-DLXPiGRF.js.map} +1 -1
- package/dist/{runtime-DCBc6YOq.js → runtime-DzToUfqW.js} +115 -32
- package/dist/{runtime-DCBc6YOq.js.map → runtime-DzToUfqW.js.map} +1 -1
- package/dist/{runtime-agent-controller-reporting-submission-CGa3GGL6.js → runtime-agent-controller-reporting-submission-BszHi0S1.js} +8 -8
- package/dist/{runtime-agent-controller-reporting-submission-CGa3GGL6.js.map → runtime-agent-controller-reporting-submission-BszHi0S1.js.map} +1 -1
- package/dist/{runtime-transport-BzCp9hM3.js → runtime-transport-DFBYm5Re.js} +214 -21
- package/dist/runtime-transport-DFBYm5Re.js.map +1 -0
- package/dist/{service-BEH6-P8U.js → service-8EozP77B.js} +546 -21
- package/dist/service-8EozP77B.js.map +1 -0
- package/dist/{service-account-authorization-CtvSn02O.js → service-account-authorization-CqUcNoD1.js} +2 -2
- package/dist/{service-account-authorization-CtvSn02O.js.map → service-account-authorization-CqUcNoD1.js.map} +1 -1
- package/dist/{service-account-control-BUPiFEGo.js → service-account-control-CzPgo-Iy.js} +9 -9
- package/dist/{service-account-control-BUPiFEGo.js.map → service-account-control-CzPgo-Iy.js.map} +1 -1
- package/dist/{service-control-capabilities-PMvSlaJj.js → service-control-capabilities-C5hd37o9.js} +3 -3
- package/dist/{service-control-capabilities-PMvSlaJj.js.map → service-control-capabilities-C5hd37o9.js.map} +1 -1
- package/dist/{service-control-capabilities-D-Nhqqgo.js → service-control-capabilities-CcwdbQf3.js} +1 -1
- package/dist/{state-C_iJAzKh.js → state-Fskb-utn.js} +2 -2
- package/dist/{state-C_iJAzKh.js.map → state-Fskb-utn.js.map} +1 -1
- package/dist/{updates-api-s2-QB929.js → updates-api-JM7f1ZDQ.js} +43 -146
- package/dist/updates-api-JM7f1ZDQ.js.map +1 -0
- package/dist/{upgrade-JmhCNmvs.js → upgrade-CDW-7zvb.js} +8 -8
- package/dist/{upgrade-JmhCNmvs.js.map → upgrade-CDW-7zvb.js.map} +1 -1
- package/dist/upgrade-r6W5TzOo.js +4 -0
- package/package.json +11 -11
- package/skills/openmeld-cli/SKILL.md +2 -0
- package/skills/openmeld-cli/playbooks/computer.md +55 -0
- package/skills/openmeld-cli/playbooks/plugins.md +37 -0
- package/dist/auth-session-DUYOBXO3.js +0 -4
- package/dist/daemon-service-update-coordinator-D0-15tZW.js.map +0 -1
- package/dist/dispatch-owned-runtime-gOluDX5_.js.map +0 -1
- package/dist/dist-DMlKqjUf.js +0 -4
- package/dist/dist-KibLweLD.js.map +0 -1
- package/dist/open-code-permission-DHFJYc_o.js.map +0 -1
- package/dist/openmeld-DUdN78WD.js.map +0 -1
- package/dist/prepare-provider-runtime-_XRIioDp.js.map +0 -1
- package/dist/runtime-transport-BzCp9hM3.js.map +0 -1
- package/dist/service-BEH6-P8U.js.map +0 -1
- package/dist/updates-api-s2-QB929.js.map +0 -1
- package/dist/upgrade-Dikfgr8z.js +0 -4
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { At as ensureOpenMeldManagedProfileWorkspace, Br as
|
|
3
|
+
import { At as ensureOpenMeldManagedProfileWorkspace, Br as applyAcceptedLeases, Bt as createMutableRouteCatalogState, Cn as resolveInstalledCodexLaunchCandidates, Ct as resolveLocalProjectConnectionForPath, Fn as emitReconcileStartedEvidence, Ft as resolveConfiguredProfileWorkspacePathForAccount, Hr as pruneStaleLeases, I as listAgentTargetStates, In as DaemonServiceRunError, Ir as resolveRouteRegistrationReconcileDecision, It as setCustomProfileWorkspace, Lr as ADAPTIVE_HEARTBEAT_JITTER_RATIO, Nn as emitDriftDetectedEvidence, Nt as readProfileWorkspaceConfigForAccount, O as syncDeviceRuntimeStateProjection, Ot as resolveRegistryRuntimeAdapterCapabilitySnapshot, Pn as emitReconcileCompletedEvidence, Rr as MAX_HEARTBEAT_INTERVAL_MS, Ur as resolveAdaptiveHeartbeatIntervalMs, Ut as summarizeSkippedDaemonProfiles, Vr as applyIntervalJitterMs$1, Vt as createRouteCatalogFromMutableState, Wr as resolveCatalogSyncIntervalMs, Wt as syncDaemonRouteCatalogState, Yn as buildAuthenticatedControlPlaneResponse, Yt as isDaemonReconcileInProgressError, _t as removeProjectConnection, bt as setDefaultProjectConnection, ct as ProjectBindingOperationError, ft as listProjectBindings, gt as removeMissingProjectConnections, lt as ProjectBindingStoreUpdateRequiredError, nn as buildLocalServiceDiagnosticsPayload, pt as listProjectConnectionsWithStatus, un as resolveCatalogSyncSkippedProfilesLogState, ut as bindProject, zr as MIN_HEARTBEAT_INTERVAL_MS } from "./prepare-provider-runtime-CWZOcEF7.js";
|
|
4
4
|
import { D as openMeldRootDir, F as resolveOpenMeldRootDir, I as resolveOpenMeldServiceOwnedPathInput, P as resolveOpenMeldEnvPreset, h as isPublishedOpenMeldHome, o as accountsDir, y as normalizeAccountKey } from "./paths-De9xdA2h.js";
|
|
5
5
|
import { r as resolveAuthBaseUrl } from "./auth-url-6Bb6YdNm.js";
|
|
6
|
-
import { A as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema,
|
|
6
|
+
import { A as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, Ar as localFolderPickerHelperProtocolResultSchema, C as runtimeTransportHeartbeatRequestSchema, Dr as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, F as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, I as runtimeTransportRegisterSessionRequestSchema, M as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Or as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, P as runtimeTransportOpenMeldToolsControlFramePayloadSchema, V as runtimeTransportRouteCatalogChangedFramePayloadSchema, jr as localFolderPickerHelperResultSchema, kr as localFolderPickerDaemonFrameSchema, n as OPENMELD_ADMISSION_EVIDENCE_HEADER, nn as OPENMELD_COMPUTER_CARE_HEADER, ot as sanitizeDispatchErrorSummary, qt as SPACE_WORK_HANDOFF_CAPABILITY_HEADER, r as OPENMELD_EXECUTION_ADMISSION_HEADER, s as localWakeRouteWorkingFolderObservationSchema, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, xr as OPENMELD_REASONING_STREAM_HEADER } from "./runtime-transport-DFBYm5Re.js";
|
|
7
7
|
import { s as openMeldDaemonControlPlaneResponseSchema } from "./control-plane-B93wmVS6.js";
|
|
8
8
|
import { a as formatLocalSetupActionLabel, i as formatLocalSetupActionDescription, n as formatLocalComponentsSummaryDescription, o as installedLocalComponentsSnapshotSchema, r as formatLocalComponentsSummaryLabel } from "./local-components-jXECvlEY.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Br as sessionHistoryPolicySchema, Cr as betterAuthSessionSnapshotResponseSchema, Hr as sessionHistoryRequestFrameSchema, Ir as SESSION_HISTORY_CAPABILITY_HEADER, Lr as SESSION_HISTORY_RUNTIME_CAPABILITY, Rr as sessionHistoryAuditSchema, Sr as betterAuthDeviceAuthorizationTokenResponseSchema, Ur as sessionHistoryResultFrameSchema, Xi as serviceConnectionEvidenceJournalSchema, Yi as serviceConnectionEvidenceEventSchema, Zn as DAEMON_STREAM_KEEPALIVE_PING, _r as BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE, br as betterAuthDeviceAuthorizationErrorResponseSchema, da as OPENMELD_RUNTIME_CAPABILITIES_HEADER, fa as computerFileAccessDaemonFrameSchema, hn as createServiceConnectionEvidenceApi, na as localProjectControlDaemonFrameSchema, ra as localProjectControlDiscoverProjectsResponseSchema, ua as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, vr as betterAuthDeviceAuthorizationCodeRequestSchema, xr as betterAuthDeviceAuthorizationTokenRequestSchema, yr as betterAuthDeviceAuthorizationCodeResponseSchema } from "./dist-BQcUIyf6.js";
|
|
10
10
|
import { o as resolveCliBinaryPlatform } from "./cli-binary-manifest-ChuzORh3.js";
|
|
11
|
-
import { D as ServiceAccountAdmissionError, S as setAuthSession, _ as onAuthSessionCredentialAvailable, a as beginAuthSessionTransition, d as getAuthSessionState, i as assertAuthSessionMutationAvailable, o as buildStoredAuthSessionIdentity, s as clearAuthSession, v as onAuthSessionCredentialObservation, w as withAdmittedServiceSession } from "./auth-session-
|
|
11
|
+
import { D as ServiceAccountAdmissionError, S as setAuthSession, _ as onAuthSessionCredentialAvailable, a as beginAuthSessionTransition, d as getAuthSessionState, i as assertAuthSessionMutationAvailable, o as buildStoredAuthSessionIdentity, s as clearAuthSession, v as onAuthSessionCredentialObservation, w as withAdmittedServiceSession } from "./auth-session-DywRZLBr.js";
|
|
12
12
|
import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
|
|
13
|
-
import { A as DEFAULT_RECONNECT_DELAY_MS, C as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, D as DAEMON_STREAM_CONNECT_TIMEOUT_MS, F as REGISTER_RESPONSE_TIMEOUT_MS, I as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, L as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, M as MAX_RECONNECT_DELAY_MS, N as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, O as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, P as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, R as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, _ as toErrorMessage$5, b as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, c as normalizeHeartbeatIntervalMs, d as normalizeText$1, f as nowIsoString, i as resolvePreferredDaemonDeviceId, j as HEARTBEAT_RESPONSE_TIMEOUT_MS, k as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, n as ensureDaemonRuntimePaths, r as resolveDaemonDeviceId, s as emitRunLine, u as normalizeOptionalText$1, v as warnDaemonEvent, w as DAEMON_RUNTIME_CONTRACT_EPOCH, x as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, y as CATALOG_SYNC_RETRY_INTERVAL_MS } from "./daemon-device-id-
|
|
14
|
-
import { c as serviceExecutionHostSnapshotSchema, d as localExecutionInputResponseSchema, l as LOCAL_EXECUTION_INPUT_CAPABILITY_HEADER, n as createExecutionHostClient, o as serviceExecutionHostMethods, t as ExecutionHostError, u as localExecutionInputFrameSchema } from "./channel-
|
|
15
|
-
import { m as hashBundledSkillAssets, p as computeDirectoryContentHash, u as loadSelectedSkillAssets } from "./state-
|
|
16
|
-
import {
|
|
17
|
-
import { A as prepareDaemonServiceBundle, G as readManagedCliInstallation, M as resolveAlignedDaemonActiveBundleEntryPath, N as resolveDaemonBundleEntryPathFromState, a as resolveDaemonRuntimeState, b as cleanupInactiveDaemonServiceBundles, f as listDaemonOwnedProcesses, h as resolveDaemonBundleIdFromEntryPath, i as readCurrentObservedDaemonRuntimeStatus, j as readDaemonActiveBundleState, n as getEffectiveDaemonRuntimeStatus, o as resolveDaemonServiceManagerForRuntimeState, p as extractDaemonCommandEntryPath, r as readCurrentDaemonRuntimeContext, s as waitForDaemonSystemServiceToStop, t as clearDaemonRuntimeStateIfDefinitelyStopped, u as cleanupLegacySharedDaemonServiceState, v as isOpenMeldManagedBinaryPath } from "./daemon-service-runtime-
|
|
13
|
+
import { A as DEFAULT_RECONNECT_DELAY_MS, C as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, D as DAEMON_STREAM_CONNECT_TIMEOUT_MS, F as REGISTER_RESPONSE_TIMEOUT_MS, I as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, L as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, M as MAX_RECONNECT_DELAY_MS, N as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, O as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, P as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, R as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, _ as toErrorMessage$5, b as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, c as normalizeHeartbeatIntervalMs, d as normalizeText$1, f as nowIsoString, i as resolvePreferredDaemonDeviceId, j as HEARTBEAT_RESPONSE_TIMEOUT_MS, k as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, n as ensureDaemonRuntimePaths, r as resolveDaemonDeviceId, s as emitRunLine, u as normalizeOptionalText$1, v as warnDaemonEvent, w as DAEMON_RUNTIME_CONTRACT_EPOCH, x as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, y as CATALOG_SYNC_RETRY_INTERVAL_MS } from "./daemon-device-id-CmykIapy.js";
|
|
14
|
+
import { c as serviceExecutionHostSnapshotSchema, d as localExecutionInputResponseSchema, l as LOCAL_EXECUTION_INPUT_CAPABILITY_HEADER, n as createExecutionHostClient, o as serviceExecutionHostMethods, t as ExecutionHostError, u as localExecutionInputFrameSchema } from "./channel-40SR2b5S.js";
|
|
15
|
+
import { m as hashBundledSkillAssets, p as computeDirectoryContentHash, u as loadSelectedSkillAssets } from "./state-Fskb-utn.js";
|
|
16
|
+
import { Q as emitDaemonDispatchJournalEvent, Z as resolveNextRuntimeAgentControllerReportSyncAtMs, _ as sendDaemonFrame, _n as cliJsonOutputEnvelopeSchema, et as ComputerFileAccessStoreError, g as parseDaemonFrame, h as handleDaemonTransportFrame, it as isSameOrDescendantPath, m as createCodexJsonRpcClient, n as assertDispatchOwnedRuntimeServiceMutationAllowed, nt as resolveComputerFileAccessStorePath, rt as updateComputerFileAccessPolicy, tt as readComputerFileAccessPolicy, v as collectObservedSessionWorkingDirectories, w as resolveOpenCodeDatabasePath, x as queryOpenCodeReadOnly, z as createServiceGitEnvironment } from "./dispatch-owned-runtime-QhxDRdNr.js";
|
|
17
|
+
import { A as prepareDaemonServiceBundle, G as readManagedCliInstallation, M as resolveAlignedDaemonActiveBundleEntryPath, N as resolveDaemonBundleEntryPathFromState, a as resolveDaemonRuntimeState, b as cleanupInactiveDaemonServiceBundles, f as listDaemonOwnedProcesses, h as resolveDaemonBundleIdFromEntryPath, i as readCurrentObservedDaemonRuntimeStatus, j as readDaemonActiveBundleState, n as getEffectiveDaemonRuntimeStatus, o as resolveDaemonServiceManagerForRuntimeState, p as extractDaemonCommandEntryPath, r as readCurrentDaemonRuntimeContext, s as waitForDaemonSystemServiceToStop, t as clearDaemonRuntimeStateIfDefinitelyStopped, u as cleanupLegacySharedDaemonServiceState, v as isOpenMeldManagedBinaryPath } from "./daemon-service-runtime-pECs8jVc.js";
|
|
18
18
|
import { i as writeDaemonRuntimeLease } from "./daemon-runtime-lease-Bv6vhqOe.js";
|
|
19
19
|
import { i as readProcessStartIdentity, n as isPreciseProcessStartIdentity, t as CURRENT_PROCESS_START_IDENTITY } from "./process-identity-BRbhGGTM.js";
|
|
20
|
-
import { $ as buildDaemonServiceDependencyTitle, At as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, C as formatDaemonServiceRefreshReliabilityMessage, Ct as ensureDaemonRuntimeContractState, D as writeDaemonStartFailureState, Dt as isVersionDowngrade, E as clearDaemonStartFailureState, Et as resolveDaemonServiceAlignmentDecision, Ft as resolveCurrentDaemonExpectedVersion, It as resolveServiceUpdateUrgency, Lt as assessServerRequiredVersion, Nt as classifyDaemonServiceRunStartability, Pt as classifyDaemonServiceWakeability, Q as buildDaemonServiceDependencySummary, Rt as describeServerRequiredVersionUnavailableReason, S as buildDaemonServiceUpdateRequiredNextStep, Tt as buildDaemonServiceTargetSpec, Ut as ensureDaemonSystemServiceCommandFiles, Vt as assessCliUpdate, W as resolveLocalServiceDemand, Wt as resolveInstalledDaemonSystemServiceCommandSpec, X as buildDaemonServiceDependencyMeaning, Y as buildDaemonServiceDependencyDetails, Z as buildDaemonServiceDependencyNextStep, _t as readCurrentDaemonOwnerSnapshot, a as isDaemonInventoryRunningAndStartReady$1, bt as summarizeDaemonOwnerSnapshot, c as waitForSystemServiceStartup$1, ct as writeOpenMeldToolsMaintenancePolicy, d as captureDaemonServiceEvidenceBestEffort, et as resolveDaemonServiceDependencyDiagnostics, f as formatDaemonFailureContextText, ft as uninstallDaemonServiceUpdateWorker, g as resolveServiceReadiness, gt as hasActiveDaemonOwners, h as resolveDaemonStatusAuthenticationAttention, ht as formatDaemonOwnerSummaryLabel, i as runDaemonServiceLifecycle, jt as DAEMON_SERVICE_REPAIR_ANOMALIES, kt as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, l as startDaemonSystemServiceWithAutoRepair, lt as ensureDaemonServiceMaintenanceInstalled, m as resolveDaemonStatusAttention, mt as buildDaemonOwnerSnapshotFromObservedState, n as scheduleDaemonServiceUpdate, nt as createOpenMeldToolsUpdateCoordinator, o as isSystemServiceStartupTimeoutError, ot as readOpenMeldToolsMaintenancePolicy, p as resolveDaemonStatusSnapshot, pt as inspectDaemonServiceInventory, r as DaemonServiceLifecycleDrainTimeoutError, s as resolveSystemServiceStartupWaitMs, st as resolveOpenMeldToolsMaintenanceProjection, tt as writeDaemonServiceContract, u as captureDaemonServiceEvidence, v as buildDaemonServiceRefreshNextStep, vt as resolveDaemonStopStrategy, w as formatDaemonServiceUpdateRequiredMessage, wt as readDaemonRuntimeContractRepairReport, x as buildDaemonServiceStatusReadOnlyDetail, y as buildDaemonServiceRefreshPromptMessage, yt as resolveStoppedContractWriteBlockedReason } from "./daemon-service-update-coordinator-
|
|
20
|
+
import { $ as buildDaemonServiceDependencyTitle, At as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, C as formatDaemonServiceRefreshReliabilityMessage, Ct as ensureDaemonRuntimeContractState, D as writeDaemonStartFailureState, Dt as isVersionDowngrade, E as clearDaemonStartFailureState, Et as resolveDaemonServiceAlignmentDecision, Ft as resolveCurrentDaemonExpectedVersion, It as resolveServiceUpdateUrgency, Lt as assessServerRequiredVersion, Nt as classifyDaemonServiceRunStartability, Pt as classifyDaemonServiceWakeability, Q as buildDaemonServiceDependencySummary, Rt as describeServerRequiredVersionUnavailableReason, S as buildDaemonServiceUpdateRequiredNextStep, Tt as buildDaemonServiceTargetSpec, Ut as ensureDaemonSystemServiceCommandFiles, Vt as assessCliUpdate, W as resolveLocalServiceDemand, Wt as resolveInstalledDaemonSystemServiceCommandSpec, X as buildDaemonServiceDependencyMeaning, Y as buildDaemonServiceDependencyDetails, Z as buildDaemonServiceDependencyNextStep, _t as readCurrentDaemonOwnerSnapshot, a as isDaemonInventoryRunningAndStartReady$1, bt as summarizeDaemonOwnerSnapshot, c as waitForSystemServiceStartup$1, ct as writeOpenMeldToolsMaintenancePolicy, d as captureDaemonServiceEvidenceBestEffort, et as resolveDaemonServiceDependencyDiagnostics, f as formatDaemonFailureContextText, ft as uninstallDaemonServiceUpdateWorker, g as resolveServiceReadiness, gt as hasActiveDaemonOwners, h as resolveDaemonStatusAuthenticationAttention, ht as formatDaemonOwnerSummaryLabel, i as runDaemonServiceLifecycle, jt as DAEMON_SERVICE_REPAIR_ANOMALIES, kt as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, l as startDaemonSystemServiceWithAutoRepair, lt as ensureDaemonServiceMaintenanceInstalled, m as resolveDaemonStatusAttention, mt as buildDaemonOwnerSnapshotFromObservedState, n as scheduleDaemonServiceUpdate, nt as createOpenMeldToolsUpdateCoordinator, o as isSystemServiceStartupTimeoutError, ot as readOpenMeldToolsMaintenancePolicy, p as resolveDaemonStatusSnapshot, pt as inspectDaemonServiceInventory, r as DaemonServiceLifecycleDrainTimeoutError, s as resolveSystemServiceStartupWaitMs, st as resolveOpenMeldToolsMaintenanceProjection, tt as writeDaemonServiceContract, u as captureDaemonServiceEvidence, v as buildDaemonServiceRefreshNextStep, vt as resolveDaemonStopStrategy, w as formatDaemonServiceUpdateRequiredMessage, wt as readDaemonRuntimeContractRepairReport, x as buildDaemonServiceStatusReadOnlyDetail, y as buildDaemonServiceRefreshPromptMessage, yt as resolveStoppedContractWriteBlockedReason } from "./daemon-service-update-coordinator-DJKBTEjx.js";
|
|
21
21
|
import { C as assessLocalMachineFailure, E as createServiceSpawnPendingIssue, i as isOpenMeldLockError, k as formatLocalMachineIssueMessage, u as resolveOpenMeldOrphanedLockIssue, x as resolveOpenMeldLaneDescriptor } from "./lock-BMI00i2F.js";
|
|
22
|
-
import { Ct as buildAgentOverviewFromContract, Q as getCommandEntryContract, ht as validateDaemonControlTargetInput, t as createAuthLoginGuideError } from "./dual-view-guide-catalog-
|
|
22
|
+
import { Ct as buildAgentOverviewFromContract, Q as getCommandEntryContract, ht as validateDaemonControlTargetInput, t as createAuthLoginGuideError } from "./dual-view-guide-catalog-DDsnLpIT.js";
|
|
23
23
|
import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, f as getConfiguredDaemonDispatchLimits, i as normalizeGatewayBaseUrlOrNull, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-0AoeTi3w.js";
|
|
24
24
|
import "./openmeld-dev-environment-DwdvL7jg.js";
|
|
25
25
|
import { n as toErrorMessage$6, t as sleep } from "./dist-BLuEEVHh.js";
|
|
26
|
-
import { D as createAuthenticationError, E as buildHumanAuthenticationCard, M as resolveAuthenticationReasonFromState, O as extractAuthenticationPromptAction, T as buildCommandAuthenticationPromptMessage$1, a as requireOpenMeldProfile, g as readDaemonCatalogSyncSignal, k as resolveAuthenticationGuidance, n as resolveRuntimeContext, o as resolveOpenMeldProfileOrNull, w as buildAuthenticationStatusLabel, y as clearAllSelectedOpenMeldProfileIds } from "./context-
|
|
26
|
+
import { D as createAuthenticationError, E as buildHumanAuthenticationCard, M as resolveAuthenticationReasonFromState, O as extractAuthenticationPromptAction, T as buildCommandAuthenticationPromptMessage$1, a as requireOpenMeldProfile, g as readDaemonCatalogSyncSignal, k as resolveAuthenticationGuidance, n as resolveRuntimeContext, o as resolveOpenMeldProfileOrNull, w as buildAuthenticationStatusLabel, y as clearAllSelectedOpenMeldProfileIds } from "./context-BEgBhfbb.js";
|
|
27
27
|
import { a as formatOpenMeldCliTextBlock, n as formatOpenMeldCliCommand, r as formatOpenMeldCliCommands, t as formatInlineOpenMeldCliCommands } from "./cli-entry-command-CR_9QU1i.js";
|
|
28
28
|
import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
|
|
29
29
|
import { t as isBinaryDistribution } from "./distribution-BDQT2ilb.js";
|
|
30
30
|
import { A as getDaemonStatus, G as withDaemonServiceRegistrationMutationLock, H as setDaemonServiceRuntimeState, I as readDaemonServiceRuntimeSnapshot, K as withDaemonServiceRunLock, L as releaseDaemonServiceLifecycleLock, M as isDaemonServiceRuntimeHeartbeatStale, O as ensureDaemonControlPlaneToken, R as resolveDaemonControlPlaneEndpoint, S as daemonServiceRepairJournalPath, U as uninstallDaemon, W as withDaemonServiceReconcileLock, _ as daemonRuntimeStateRootPath, a as DAEMON_SERVICE_RUNTIME_MODE_ENV, c as acquireDaemonServiceLifecycleLock, f as daemonLifecycleJournalPath, h as daemonRuntimeRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, j as installDaemon, l as clearDaemonServiceRuntimeState, o as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, q as withDaemonServiceStopLock, z as resolveDaemonServiceRuntimeMetadata } from "./daemon-state-Dte9re5V.js";
|
|
31
31
|
import { a as outJsonLine, n as sanitizeTerminalDisplayText, o as outLine, t as createPresenter } from "./presenter-BcxiQyJg.js";
|
|
32
|
-
import { c as buildRequestAuthHeaders, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, o as buildOpenMeldProfileRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-
|
|
32
|
+
import { c as buildRequestAuthHeaders, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, o as buildOpenMeldProfileRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-BZvzqIeX.js";
|
|
33
33
|
import { a as upsertDaemonServiceContract, i as readDaemonServiceContract, n as isDaemonServiceContractIdentityReusable, t as clearDaemonServiceContract } from "./daemon-service-contract-COPKbCy_.js";
|
|
34
34
|
import { t as resolveOpenMeldEnvironmentTarget } from "./openmeld-environment-target-BgYR6ozy.js";
|
|
35
|
-
import { t as admitServiceAccountStop } from "./service-account-authorization-
|
|
36
|
-
import { S as requestLocalDaemonShutdown, c as runWithDaemonLifecycleCommandJournal, d as compareSemver, i as readLatestDaemonLifecycleOriginEvent, l as OPENMELD_VERSION, n as formatDaemonLifecycleOriginSummary, o as resolveRecentDaemonSignalStopCause, r as readLatestDaemonLifecycleConnectionStateEvent, s as runDaemonServiceManagerAction, t as emitDaemonLifecycleEvent, w as sendLocalDaemonControlPlaneRequest, y as LocalDaemonControlPlaneClientError } from "./daemon-lifecycle-journal-
|
|
35
|
+
import { t as admitServiceAccountStop } from "./service-account-authorization-CqUcNoD1.js";
|
|
36
|
+
import { S as requestLocalDaemonShutdown, c as runWithDaemonLifecycleCommandJournal, d as compareSemver, i as readLatestDaemonLifecycleOriginEvent, l as OPENMELD_VERSION, n as formatDaemonLifecycleOriginSummary, o as resolveRecentDaemonSignalStopCause, r as readLatestDaemonLifecycleConnectionStateEvent, s as runDaemonServiceManagerAction, t as emitDaemonLifecycleEvent, w as sendLocalDaemonControlPlaneRequest, y as LocalDaemonControlPlaneClientError } from "./daemon-lifecycle-journal-2dzGUSWU.js";
|
|
37
37
|
import { r as readWindowsManagedCliInstallation } from "./windows-managed-install-BVlswqjA.js";
|
|
38
38
|
import { S as resolveDaemonServiceManager, _ as readDaemonServiceJobCrashExitCode, a as disableDaemonServiceAutostartIfConfigured, c as getDaemonSystemServiceLogPath, f as isDaemonServiceJobSpawnPending, o as formatDaemonServiceJobDiagnosticsEvidence, s as getDaemonServiceLaunchdLabel } from "./daemon-service-manager-SXQcFE9c.js";
|
|
39
|
-
import { a as formatDaemonServiceDowngradeBlockedRecommendation, d as formatDaemonServiceMissingStatus, f as getDaemonDowngradeBlockedTitle, g as canUseInteractivePrompts, h as resolveOpenMeldToolsUpdateOperationProjection, l as formatDaemonServiceMissingRunStepOne, n as resolveElapsedTimeMs, o as formatDaemonServiceMissingAction, r as formatDaemonDowngradeBlockedNextStep, s as formatDaemonServiceMissingMeaning, t as formatElapsedTime, u as formatDaemonServiceMissingRunStepTwo } from "./elapsed-time-
|
|
40
|
-
import { t as childExecutionHostChannel } from "./process-channel-
|
|
41
|
-
import { n as collectSkillsReadinessSnapshot } from "./installation-inventory-
|
|
39
|
+
import { a as formatDaemonServiceDowngradeBlockedRecommendation, d as formatDaemonServiceMissingStatus, f as getDaemonDowngradeBlockedTitle, g as canUseInteractivePrompts, h as resolveOpenMeldToolsUpdateOperationProjection, l as formatDaemonServiceMissingRunStepOne, n as resolveElapsedTimeMs, o as formatDaemonServiceMissingAction, r as formatDaemonDowngradeBlockedNextStep, s as formatDaemonServiceMissingMeaning, t as formatElapsedTime, u as formatDaemonServiceMissingRunStepTwo } from "./elapsed-time-DTb6L36x.js";
|
|
40
|
+
import { t as childExecutionHostChannel } from "./process-channel-DLXPiGRF.js";
|
|
41
|
+
import { n as collectSkillsReadinessSnapshot } from "./installation-inventory-CCkKix8R.js";
|
|
42
42
|
import { createHash, randomUUID } from "node:crypto";
|
|
43
|
+
import { homedir } from "node:os";
|
|
43
44
|
import { delimiter, dirname, isAbsolute, join, resolve } from "node:path";
|
|
44
45
|
import { access, mkdir, open, readFile, readdir, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
45
46
|
import * as z$1 from "zod/v4";
|
|
47
|
+
import { z } from "zod/v4";
|
|
46
48
|
import { accessSync, constants, readSync } from "node:fs";
|
|
47
49
|
import process$1 from "node:process";
|
|
48
50
|
import { execFile, spawn } from "node:child_process";
|
|
@@ -52,6 +54,7 @@ import { createServer } from "node:net";
|
|
|
52
54
|
import { cancel, confirm, isCancel, select } from "@clack/prompts";
|
|
53
55
|
import stringWidth from "string-width";
|
|
54
56
|
import WebSocket from "ws";
|
|
57
|
+
import { getSessionInfo, getSessionMessages } from "@anthropic-ai/claude-agent-sdk";
|
|
55
58
|
//#region ../../packages/schemas/dist/schemas/daemon/service-connection-correlation.js
|
|
56
59
|
const SERVICE_CONNECTION_ID_QUERY_PARAMETER = "connectionId";
|
|
57
60
|
z$1.uuid();
|
|
@@ -5790,6 +5793,508 @@ function waitForRegisterResponse(input) {
|
|
|
5790
5793
|
});
|
|
5791
5794
|
}
|
|
5792
5795
|
//#endregion
|
|
5796
|
+
//#region src/local-service/session-history/claude-history-reader.ts
|
|
5797
|
+
function projectClaudeHistory(items, sessionId) {
|
|
5798
|
+
const messages = [];
|
|
5799
|
+
let omittedNonMessageItems = false;
|
|
5800
|
+
for (const item of items) {
|
|
5801
|
+
if (item.session_id !== sessionId) throw new Error("Session identity mismatch.");
|
|
5802
|
+
if (item.type === "system" || item.parent_tool_use_id || item.parent_agent_id) {
|
|
5803
|
+
omittedNonMessageItems = true;
|
|
5804
|
+
continue;
|
|
5805
|
+
}
|
|
5806
|
+
const message = z.object({ content: z.union([z.string(), z.array(z.unknown())]) }).parse(item.message);
|
|
5807
|
+
const parts = typeof message.content === "string" ? [message.content] : message.content.flatMap((part) => {
|
|
5808
|
+
const text = z.object({
|
|
5809
|
+
type: z.literal("text"),
|
|
5810
|
+
text: z.string()
|
|
5811
|
+
}).safeParse(part);
|
|
5812
|
+
if (text.success) return [text.data.text];
|
|
5813
|
+
omittedNonMessageItems = true;
|
|
5814
|
+
return [];
|
|
5815
|
+
});
|
|
5816
|
+
if (!parts.length) continue;
|
|
5817
|
+
const text = parts.join("\n");
|
|
5818
|
+
messages.push({
|
|
5819
|
+
role: item.type,
|
|
5820
|
+
text: text.slice(0, 8e3),
|
|
5821
|
+
truncated: text.length > 8e3
|
|
5822
|
+
});
|
|
5823
|
+
}
|
|
5824
|
+
return {
|
|
5825
|
+
messages,
|
|
5826
|
+
omittedNonMessageItems
|
|
5827
|
+
};
|
|
5828
|
+
}
|
|
5829
|
+
async function readClaudeHistory(input) {
|
|
5830
|
+
const metadata = await getSessionInfo(input.sessionId);
|
|
5831
|
+
if (!metadata?.cwd || metadata.sessionId !== input.sessionId || metadata.fileSize === void 0 || metadata.fileSize > 8 * 1024 * 1024) throw new Error("Claude Code session metadata is unavailable or too large.");
|
|
5832
|
+
await input.authorizePath(metadata.cwd);
|
|
5833
|
+
const items = await getSessionMessages(input.sessionId, { dir: metadata.cwd });
|
|
5834
|
+
const current = await getSessionInfo(input.sessionId, { dir: metadata.cwd });
|
|
5835
|
+
if (!current || current.cwd !== metadata.cwd || current.fileSize !== metadata.fileSize || current.lastModified !== metadata.lastModified) throw new Error("Claude Code session changed during the read.");
|
|
5836
|
+
await input.authorizePath(current.cwd);
|
|
5837
|
+
return {
|
|
5838
|
+
cwd: current.cwd,
|
|
5839
|
+
...projectClaudeHistory(items, input.sessionId)
|
|
5840
|
+
};
|
|
5841
|
+
}
|
|
5842
|
+
//#endregion
|
|
5843
|
+
//#region src/local-service/session-history/codex-history-reader.ts
|
|
5844
|
+
const threadSchema = z.object({
|
|
5845
|
+
id: z.string(),
|
|
5846
|
+
cwd: z.string().min(1),
|
|
5847
|
+
turns: z.array(z.object({ items: z.array(z.unknown()) })).max(1e5)
|
|
5848
|
+
});
|
|
5849
|
+
const userMessage = z.object({
|
|
5850
|
+
type: z.literal("userMessage"),
|
|
5851
|
+
content: z.array(z.unknown())
|
|
5852
|
+
});
|
|
5853
|
+
const assistantMessage = z.object({
|
|
5854
|
+
type: z.literal("agentMessage"),
|
|
5855
|
+
text: z.string()
|
|
5856
|
+
});
|
|
5857
|
+
const textContent = z.object({
|
|
5858
|
+
type: z.literal("text"),
|
|
5859
|
+
text: z.string()
|
|
5860
|
+
});
|
|
5861
|
+
function projectCodexHistory(value, sessionId) {
|
|
5862
|
+
const { thread } = z.object({ thread: threadSchema }).parse(value);
|
|
5863
|
+
if (thread.id !== sessionId) throw new Error("Session identity mismatch.");
|
|
5864
|
+
const messages = [];
|
|
5865
|
+
let omittedNonMessageItems = false;
|
|
5866
|
+
for (const turn of thread.turns) for (const item of turn.items) {
|
|
5867
|
+
const assistant = assistantMessage.safeParse(item);
|
|
5868
|
+
const user = userMessage.safeParse(item);
|
|
5869
|
+
let text;
|
|
5870
|
+
let role;
|
|
5871
|
+
if (assistant.success) {
|
|
5872
|
+
text = assistant.data.text;
|
|
5873
|
+
role = "assistant";
|
|
5874
|
+
} else if (user.success) {
|
|
5875
|
+
text = user.data.content.flatMap((part) => {
|
|
5876
|
+
const parsed = textContent.safeParse(part);
|
|
5877
|
+
if (parsed.success) return [parsed.data.text];
|
|
5878
|
+
omittedNonMessageItems = true;
|
|
5879
|
+
return [];
|
|
5880
|
+
}).join("\n");
|
|
5881
|
+
role = "user";
|
|
5882
|
+
} else {
|
|
5883
|
+
omittedNonMessageItems = true;
|
|
5884
|
+
continue;
|
|
5885
|
+
}
|
|
5886
|
+
messages.push({
|
|
5887
|
+
role,
|
|
5888
|
+
text: text.slice(0, 8e3),
|
|
5889
|
+
truncated: text.length > 8e3
|
|
5890
|
+
});
|
|
5891
|
+
}
|
|
5892
|
+
return {
|
|
5893
|
+
cwd: thread.cwd,
|
|
5894
|
+
messages,
|
|
5895
|
+
omittedNonMessageItems
|
|
5896
|
+
};
|
|
5897
|
+
}
|
|
5898
|
+
async function readCodexHistory(input) {
|
|
5899
|
+
const launch = await resolveInstalledCodexLaunchCandidates({ timeoutMs: 5e3 });
|
|
5900
|
+
if (!(launch.ok && launch.candidates[0])) throw new Error("Codex is unavailable.");
|
|
5901
|
+
const client = createCodexJsonRpcClient(launch.candidates[0].launchContract);
|
|
5902
|
+
try {
|
|
5903
|
+
await client.request("initialize", { clientInfo: {
|
|
5904
|
+
name: "openmeld-session-history",
|
|
5905
|
+
version: "1"
|
|
5906
|
+
} });
|
|
5907
|
+
client.notify("initialized", {});
|
|
5908
|
+
const metadata = z.object({ thread: threadSchema }).parse(await client.request("thread/read", {
|
|
5909
|
+
threadId: input.sessionId,
|
|
5910
|
+
includeTurns: false
|
|
5911
|
+
}));
|
|
5912
|
+
if (metadata.thread.id !== input.sessionId) throw new Error("Session identity mismatch.");
|
|
5913
|
+
await input.authorizePath(metadata.thread.cwd);
|
|
5914
|
+
const history = projectCodexHistory(await client.request("thread/read", {
|
|
5915
|
+
threadId: input.sessionId,
|
|
5916
|
+
includeTurns: true
|
|
5917
|
+
}), input.sessionId);
|
|
5918
|
+
await input.authorizePath(history.cwd);
|
|
5919
|
+
return history;
|
|
5920
|
+
} finally {
|
|
5921
|
+
await client.close();
|
|
5922
|
+
}
|
|
5923
|
+
}
|
|
5924
|
+
//#endregion
|
|
5925
|
+
//#region src/local-service/session-history/grok-history-reader.ts
|
|
5926
|
+
async function readBoundedFile(path) {
|
|
5927
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
5928
|
+
try {
|
|
5929
|
+
const before = await file.stat();
|
|
5930
|
+
if (!before.isFile() || before.size > 8 * 1024 * 1024) throw new Error("Session file is too large.");
|
|
5931
|
+
const buffer = Buffer.alloc(before.size + 1);
|
|
5932
|
+
let length = 0;
|
|
5933
|
+
while (length < buffer.length) {
|
|
5934
|
+
const { bytesRead } = await file.read(buffer, length, buffer.length - length, null);
|
|
5935
|
+
if (!bytesRead) break;
|
|
5936
|
+
length += bytesRead;
|
|
5937
|
+
}
|
|
5938
|
+
const after = await file.stat();
|
|
5939
|
+
if (length !== before.size || after.mtimeMs !== before.mtimeMs || after.size !== before.size) throw new Error("Session changed during the read.");
|
|
5940
|
+
return buffer.subarray(0, length).toString("utf8");
|
|
5941
|
+
} finally {
|
|
5942
|
+
await file.close();
|
|
5943
|
+
}
|
|
5944
|
+
}
|
|
5945
|
+
function projectGrokHistory(source, sessionId) {
|
|
5946
|
+
const messages = [];
|
|
5947
|
+
let omittedNonMessageItems = false;
|
|
5948
|
+
let previousRole = null;
|
|
5949
|
+
for (const line of source.split("\n").filter(Boolean)) {
|
|
5950
|
+
const envelope = z.object({
|
|
5951
|
+
method: z.string(),
|
|
5952
|
+
params: z.object({
|
|
5953
|
+
sessionId: z.string(),
|
|
5954
|
+
update: z.object({ sessionUpdate: z.string() }).passthrough()
|
|
5955
|
+
})
|
|
5956
|
+
}).parse(JSON.parse(line));
|
|
5957
|
+
if (envelope.params.sessionId !== sessionId) throw new Error("Session identity mismatch.");
|
|
5958
|
+
const update = envelope.params.update;
|
|
5959
|
+
if (update.sessionUpdate === "rewind_marker") throw new Error("Rewound sessions are not supported.");
|
|
5960
|
+
if (envelope.method !== "session/update" || !["user_message_chunk", "agent_message_chunk"].includes(update.sessionUpdate)) {
|
|
5961
|
+
omittedNonMessageItems = true;
|
|
5962
|
+
previousRole = null;
|
|
5963
|
+
continue;
|
|
5964
|
+
}
|
|
5965
|
+
const chunk = z.object({
|
|
5966
|
+
content: z.object({
|
|
5967
|
+
type: z.string(),
|
|
5968
|
+
text: z.string().optional(),
|
|
5969
|
+
_meta: z.object({ bash_command: z.unknown().optional() }).optional()
|
|
5970
|
+
}),
|
|
5971
|
+
_meta: z.object({ host_turn: z.boolean().optional() }).optional()
|
|
5972
|
+
}).parse(update);
|
|
5973
|
+
if (chunk.content.type !== "text" || chunk.content.text === void 0 || chunk._meta?.host_turn || chunk.content._meta?.bash_command !== void 0) {
|
|
5974
|
+
omittedNonMessageItems = true;
|
|
5975
|
+
previousRole = null;
|
|
5976
|
+
continue;
|
|
5977
|
+
}
|
|
5978
|
+
const role = update.sessionUpdate === "user_message_chunk" ? "user" : "assistant";
|
|
5979
|
+
const previous = messages.at(-1);
|
|
5980
|
+
if (previous && previousRole === role) {
|
|
5981
|
+
const text = previous.text + chunk.content.text;
|
|
5982
|
+
previous.text = text.slice(0, 8e3);
|
|
5983
|
+
previous.truncated ||= text.length > 8e3;
|
|
5984
|
+
} else messages.push({
|
|
5985
|
+
role,
|
|
5986
|
+
text: chunk.content.text.slice(0, 8e3),
|
|
5987
|
+
truncated: chunk.content.text.length > 8e3
|
|
5988
|
+
});
|
|
5989
|
+
previousRole = role;
|
|
5990
|
+
}
|
|
5991
|
+
return {
|
|
5992
|
+
messages,
|
|
5993
|
+
omittedNonMessageItems
|
|
5994
|
+
};
|
|
5995
|
+
}
|
|
5996
|
+
async function readGrokHistory(input) {
|
|
5997
|
+
const sessionId = z.uuid().parse(input.sessionId);
|
|
5998
|
+
const root = join(input.grokHome ?? process.env.GROK_HOME ?? join(homedir(), ".grok"), "sessions");
|
|
5999
|
+
const matches = [];
|
|
6000
|
+
for (const project of await readdir(root, { withFileTypes: true })) {
|
|
6001
|
+
if (!project.isDirectory()) continue;
|
|
6002
|
+
for (const session of await readdir(join(root, project.name), { withFileTypes: true })) if (session.isDirectory() && session.name === sessionId) matches.push(join(root, project.name, session.name));
|
|
6003
|
+
}
|
|
6004
|
+
if (matches.length !== 1) throw new Error("Session identity is missing or ambiguous.");
|
|
6005
|
+
const directory = z.string().parse(matches[0]);
|
|
6006
|
+
const source = await readBoundedFile(join(directory, "summary.json"));
|
|
6007
|
+
const identity = z.object({
|
|
6008
|
+
id: z.string(),
|
|
6009
|
+
cwd: z.string().min(1)
|
|
6010
|
+
});
|
|
6011
|
+
const value = JSON.parse(source);
|
|
6012
|
+
const summary = identity.or(z.object({ info: identity }).transform(({ info }) => info)).parse(value);
|
|
6013
|
+
if (summary.id !== sessionId) throw new Error("Session identity mismatch.");
|
|
6014
|
+
await input.authorizePath(summary.cwd);
|
|
6015
|
+
const history = projectGrokHistory(await readBoundedFile(join(directory, "updates.jsonl")), sessionId);
|
|
6016
|
+
if (await readBoundedFile(join(directory, "summary.json")) !== source) throw new Error("Session changed during the read.");
|
|
6017
|
+
await input.authorizePath(summary.cwd);
|
|
6018
|
+
return {
|
|
6019
|
+
cwd: summary.cwd,
|
|
6020
|
+
...history
|
|
6021
|
+
};
|
|
6022
|
+
}
|
|
6023
|
+
//#endregion
|
|
6024
|
+
//#region src/local-service/session-history/opencode-history-reader.ts
|
|
6025
|
+
async function readOpenCodeHistory(input) {
|
|
6026
|
+
const databasePath = input.databasePath ?? resolveOpenCodeDatabasePath({ homeDir: homedir() });
|
|
6027
|
+
const metadataSchema = z.object({
|
|
6028
|
+
id: z.string(),
|
|
6029
|
+
directory: z.string().min(1),
|
|
6030
|
+
time_updated: z.number(),
|
|
6031
|
+
revert: z.string().nullable()
|
|
6032
|
+
});
|
|
6033
|
+
const metadataSql = "SELECT id, directory, time_updated, revert FROM session WHERE id = ?";
|
|
6034
|
+
const [row] = await queryOpenCodeReadOnly(databasePath, metadataSql, [input.sessionId]);
|
|
6035
|
+
const metadata = metadataSchema.parse(row);
|
|
6036
|
+
await input.authorizePath(metadata.directory);
|
|
6037
|
+
const revert = metadata.revert ? z.object({ messageID: z.string() }).parse(JSON.parse(metadata.revert)) : null;
|
|
6038
|
+
const rows = await queryOpenCodeReadOnly(databasePath, `
|
|
6039
|
+
SELECT m.id, json_extract(m.data, '$.role') AS role,
|
|
6040
|
+
substr(json_extract(p.data, '$.text'), 1, 8001) AS text
|
|
6041
|
+
FROM message m JOIN part p ON p.message_id = m.id AND p.session_id = m.session_id
|
|
6042
|
+
WHERE m.session_id = ? AND json_extract(p.data, '$.type') = 'text'
|
|
6043
|
+
AND coalesce(json_extract(p.data, '$.synthetic'), 0) = 0
|
|
6044
|
+
AND coalesce(json_extract(p.data, '$.ignored'), 0) = 0
|
|
6045
|
+
AND json_extract(m.data, '$.role') IN ('user', 'assistant')
|
|
6046
|
+
ORDER BY m.time_created, m.id, p.id LIMIT 1001`, [input.sessionId]);
|
|
6047
|
+
if (rows.length > 1e3 || JSON.stringify(rows).length > 8 * 1024 * 1024) throw new Error("Session is too large.");
|
|
6048
|
+
const messages = [];
|
|
6049
|
+
let previousId = null;
|
|
6050
|
+
for (const row of rows) {
|
|
6051
|
+
const part = z.object({
|
|
6052
|
+
id: z.string(),
|
|
6053
|
+
role: z.enum(["user", "assistant"]),
|
|
6054
|
+
text: z.string()
|
|
6055
|
+
}).parse(row);
|
|
6056
|
+
if (revert && part.id >= revert.messageID) break;
|
|
6057
|
+
const previous = messages.at(-1);
|
|
6058
|
+
if (previous && previousId === part.id) {
|
|
6059
|
+
const combined = `${previous.text}\n${part.text}`;
|
|
6060
|
+
previous.text = combined.slice(0, 8e3);
|
|
6061
|
+
previous.truncated ||= combined.length > 8e3;
|
|
6062
|
+
} else messages.push({
|
|
6063
|
+
role: part.role,
|
|
6064
|
+
text: part.text.slice(0, 8e3),
|
|
6065
|
+
truncated: part.text.length > 8e3
|
|
6066
|
+
});
|
|
6067
|
+
previousId = part.id;
|
|
6068
|
+
}
|
|
6069
|
+
const [current] = await queryOpenCodeReadOnly(databasePath, metadataSql, [input.sessionId]);
|
|
6070
|
+
if (JSON.stringify(metadataSchema.parse(current)) !== JSON.stringify(metadata)) throw new Error("Session changed during the read.");
|
|
6071
|
+
await input.authorizePath(metadata.directory);
|
|
6072
|
+
return {
|
|
6073
|
+
cwd: metadata.directory,
|
|
6074
|
+
messages,
|
|
6075
|
+
omittedNonMessageItems: true
|
|
6076
|
+
};
|
|
6077
|
+
}
|
|
6078
|
+
//#endregion
|
|
6079
|
+
//#region src/local-service/session-history/history-reader.ts
|
|
6080
|
+
async function readSessionHistory(input) {
|
|
6081
|
+
return await {
|
|
6082
|
+
codex: readCodexHistory,
|
|
6083
|
+
"claude-code": readClaudeHistory,
|
|
6084
|
+
opencode: readOpenCodeHistory,
|
|
6085
|
+
"grok-build": readGrokHistory
|
|
6086
|
+
}[input.provider ?? "codex"](input);
|
|
6087
|
+
}
|
|
6088
|
+
//#endregion
|
|
6089
|
+
//#region src/local-service/session-history/session-history-store.ts
|
|
6090
|
+
const storeSchema = z.strictObject({
|
|
6091
|
+
version: z.literal(2),
|
|
6092
|
+
policy: sessionHistoryPolicySchema,
|
|
6093
|
+
entries: z.array(sessionHistoryAuditSchema).max(200)
|
|
6094
|
+
});
|
|
6095
|
+
const legacyStoreSchema = storeSchema.extend({
|
|
6096
|
+
version: z.literal(1),
|
|
6097
|
+
policy: sessionHistoryPolicySchema.extend({ readerProfileIds: z.array(z.string()).max(64) })
|
|
6098
|
+
});
|
|
6099
|
+
const tails = /* @__PURE__ */ new Map();
|
|
6100
|
+
function sessionHistoryStorePath(dataRoot, owner, organization) {
|
|
6101
|
+
return join(dataRoot, "session-history", `${createHash("sha256").update(JSON.stringify([owner, organization])).digest("hex")}.json`);
|
|
6102
|
+
}
|
|
6103
|
+
async function readSessionHistoryStore(path) {
|
|
6104
|
+
const body = await readFile(path, "utf8").catch((error) => {
|
|
6105
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return null;
|
|
6106
|
+
throw error;
|
|
6107
|
+
});
|
|
6108
|
+
if (body === null) return storeSchema.parse({
|
|
6109
|
+
version: 2,
|
|
6110
|
+
policy: {
|
|
6111
|
+
enabled: false,
|
|
6112
|
+
connections: [],
|
|
6113
|
+
revision: 1,
|
|
6114
|
+
updatedAtMs: 0
|
|
6115
|
+
},
|
|
6116
|
+
entries: []
|
|
6117
|
+
});
|
|
6118
|
+
const parsed = JSON.parse(body);
|
|
6119
|
+
const legacy = legacyStoreSchema.safeParse(parsed);
|
|
6120
|
+
if (legacy.success) {
|
|
6121
|
+
const { readerProfileIds: _readers, ...policy } = legacy.data.policy;
|
|
6122
|
+
return storeSchema.parse({
|
|
6123
|
+
...legacy.data,
|
|
6124
|
+
version: 2,
|
|
6125
|
+
policy: {
|
|
6126
|
+
...policy,
|
|
6127
|
+
enabled: false,
|
|
6128
|
+
revision: policy.revision + 1
|
|
6129
|
+
}
|
|
6130
|
+
});
|
|
6131
|
+
}
|
|
6132
|
+
return storeSchema.parse(parsed);
|
|
6133
|
+
}
|
|
6134
|
+
async function updateSessionHistoryStore(path, operation) {
|
|
6135
|
+
const previous = tails.get(path) ?? Promise.resolve();
|
|
6136
|
+
let release = () => void 0;
|
|
6137
|
+
const next = new Promise((resolve) => {
|
|
6138
|
+
release = resolve;
|
|
6139
|
+
});
|
|
6140
|
+
tails.set(path, next);
|
|
6141
|
+
await previous;
|
|
6142
|
+
try {
|
|
6143
|
+
const store = await readSessionHistoryStore(path);
|
|
6144
|
+
const result = operation(store);
|
|
6145
|
+
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
6146
|
+
await mkdir(dirname(path), {
|
|
6147
|
+
recursive: true,
|
|
6148
|
+
mode: 448
|
|
6149
|
+
});
|
|
6150
|
+
try {
|
|
6151
|
+
await writeFile(temporary, JSON.stringify(storeSchema.parse(store)), { mode: 384 });
|
|
6152
|
+
await rename(temporary, path);
|
|
6153
|
+
} finally {
|
|
6154
|
+
await rm(temporary, { force: true });
|
|
6155
|
+
}
|
|
6156
|
+
return result;
|
|
6157
|
+
} finally {
|
|
6158
|
+
release();
|
|
6159
|
+
if (tails.get(path) === next) tails.delete(path);
|
|
6160
|
+
}
|
|
6161
|
+
}
|
|
6162
|
+
async function appendSessionHistoryAudit(path, entry, expectedRevision) {
|
|
6163
|
+
return await updateSessionHistoryStore(path, (store) => {
|
|
6164
|
+
const current = expectedRevision === void 0 || store.policy.revision === expectedRevision;
|
|
6165
|
+
store.entries = [{
|
|
6166
|
+
...entry,
|
|
6167
|
+
outcome: current ? entry.outcome : "denied",
|
|
6168
|
+
count: current ? entry.count : 0
|
|
6169
|
+
}, ...store.entries].slice(0, 200);
|
|
6170
|
+
return current;
|
|
6171
|
+
});
|
|
6172
|
+
}
|
|
6173
|
+
//#endregion
|
|
6174
|
+
//#region src/local-service/session-history/session-history-handler.ts
|
|
6175
|
+
var HistoryDenied = class extends Error {};
|
|
6176
|
+
const denied = () => ({
|
|
6177
|
+
kind: "error",
|
|
6178
|
+
code: "denied",
|
|
6179
|
+
message: "This session is outside your authorized history access."
|
|
6180
|
+
});
|
|
6181
|
+
async function handleSessionHistoryFrame(input) {
|
|
6182
|
+
const { requestId, request: envelope } = input.frame.payload;
|
|
6183
|
+
const { request, requester, organizationId } = envelope;
|
|
6184
|
+
const path = sessionHistoryStorePath(dirname(input.computerFileAccessStorePath), input.ownerUserId, organizationId);
|
|
6185
|
+
let result;
|
|
6186
|
+
try {
|
|
6187
|
+
if (envelope.expectedDeviceId !== input.deviceId || requester.ownerUserId !== input.ownerUserId || requester.requesterUserId !== input.ownerUserId) throw new HistoryDenied();
|
|
6188
|
+
if (request.operation !== "read_session" && (requester.readerProfileId !== null || requester.audience !== "owner_private")) throw new HistoryDenied();
|
|
6189
|
+
result = await execute();
|
|
6190
|
+
} catch (error) {
|
|
6191
|
+
result = error instanceof HistoryDenied ? denied() : {
|
|
6192
|
+
kind: "error",
|
|
6193
|
+
code: "failed",
|
|
6194
|
+
message: "Conversation could not be read. Check the local agent on this computer, then try again."
|
|
6195
|
+
};
|
|
6196
|
+
if (request.operation === "read_session") await appendSessionHistoryAudit(path, audit(error instanceof HistoryDenied ? "denied" : "failed", 0)).catch(() => void 0);
|
|
6197
|
+
}
|
|
6198
|
+
return sessionHistoryResultFrameSchema.parse({
|
|
6199
|
+
v: 1,
|
|
6200
|
+
code: "daemon.session_history.request_result",
|
|
6201
|
+
payload: {
|
|
6202
|
+
requestId,
|
|
6203
|
+
result
|
|
6204
|
+
}
|
|
6205
|
+
});
|
|
6206
|
+
function audit(outcome, count) {
|
|
6207
|
+
if (request.operation !== "read_session") throw new HistoryDenied();
|
|
6208
|
+
return {
|
|
6209
|
+
requestId,
|
|
6210
|
+
atMs: Date.now(),
|
|
6211
|
+
requester,
|
|
6212
|
+
projectId: request.projectId,
|
|
6213
|
+
provider: request.provider ?? "codex",
|
|
6214
|
+
sessionId: request.sessionId,
|
|
6215
|
+
offset: request.offset,
|
|
6216
|
+
outcome,
|
|
6217
|
+
count
|
|
6218
|
+
};
|
|
6219
|
+
}
|
|
6220
|
+
async function saveSettings(request, connections) {
|
|
6221
|
+
if (!request.policy.connections.every((grant) => connections.some((connection) => connection.projectId === grant.projectId && connection.bindingGeneration === grant.bindingGeneration))) throw new HistoryDenied();
|
|
6222
|
+
return await updateSessionHistoryStore(path, (current) => {
|
|
6223
|
+
if (current.policy.revision !== request.expectedRevision) return null;
|
|
6224
|
+
current.policy = {
|
|
6225
|
+
...request.policy,
|
|
6226
|
+
revision: current.policy.revision + 1,
|
|
6227
|
+
updatedAtMs: Date.now()
|
|
6228
|
+
};
|
|
6229
|
+
return current.policy;
|
|
6230
|
+
});
|
|
6231
|
+
}
|
|
6232
|
+
async function execute() {
|
|
6233
|
+
const store = await readSessionHistoryStore(path);
|
|
6234
|
+
const connections = await listProjectBindings({
|
|
6235
|
+
rootDir: input.rootDir,
|
|
6236
|
+
organizationId
|
|
6237
|
+
});
|
|
6238
|
+
const settings = () => ({
|
|
6239
|
+
kind: "settings",
|
|
6240
|
+
policy: store.policy,
|
|
6241
|
+
connections: connections.map(({ projectId, bindingGeneration, projectSlug }) => ({
|
|
6242
|
+
projectId,
|
|
6243
|
+
bindingGeneration,
|
|
6244
|
+
projectSlug
|
|
6245
|
+
}))
|
|
6246
|
+
});
|
|
6247
|
+
if (request.operation === "read_settings") return settings();
|
|
6248
|
+
if (request.operation === "read_audit") return {
|
|
6249
|
+
kind: "audit",
|
|
6250
|
+
entries: store.entries
|
|
6251
|
+
};
|
|
6252
|
+
if (request.operation === "update_settings") {
|
|
6253
|
+
const updated = await saveSettings(request, connections);
|
|
6254
|
+
if (!updated) return {
|
|
6255
|
+
kind: "error",
|
|
6256
|
+
code: "changed",
|
|
6257
|
+
message: "History settings changed. Reload them before saving."
|
|
6258
|
+
};
|
|
6259
|
+
store.policy = updated;
|
|
6260
|
+
return settings();
|
|
6261
|
+
}
|
|
6262
|
+
const revision = store.policy.revision;
|
|
6263
|
+
const authorizePath = async (cwd) => {
|
|
6264
|
+
const current = await readSessionHistoryStore(path);
|
|
6265
|
+
if (!current.policy.enabled || current.policy.revision !== revision) throw new HistoryDenied();
|
|
6266
|
+
const binding = await resolveLocalProjectConnectionForPath({
|
|
6267
|
+
path: cwd,
|
|
6268
|
+
connections: await listProjectBindings({ rootDir: input.rootDir })
|
|
6269
|
+
});
|
|
6270
|
+
if (!binding || binding.organizationId !== organizationId || binding.projectId !== request.projectId || !current.policy.connections.some((grant) => grant.projectId === binding.projectId && grant.bindingGeneration === binding.bindingGeneration)) throw new HistoryDenied();
|
|
6271
|
+
const canonical = await realpath(cwd);
|
|
6272
|
+
const files = await readComputerFileAccessPolicy(input.computerFileAccessStorePath);
|
|
6273
|
+
if (files.mode === "local_agent_settings") return;
|
|
6274
|
+
const folders = await Promise.all(files.folders.map((folder) => realpath(folder)));
|
|
6275
|
+
if (!(files.mode === "only_selected_folders" ? folders.some((folder) => isSameOrDescendantPath(canonical, folder)) : !folders.some((folder) => isSameOrDescendantPath(canonical, folder) || isSameOrDescendantPath(folder, binding.repositoryPath)))) throw new HistoryDenied();
|
|
6276
|
+
};
|
|
6277
|
+
if (!store.policy.enabled) throw new HistoryDenied();
|
|
6278
|
+
const history = await (input.readHistory ?? readSessionHistory)({
|
|
6279
|
+
provider: request.provider,
|
|
6280
|
+
sessionId: request.sessionId,
|
|
6281
|
+
authorizePath
|
|
6282
|
+
});
|
|
6283
|
+
await authorizePath(history.cwd);
|
|
6284
|
+
const messages = history.messages.slice(request.offset, request.offset + request.limit);
|
|
6285
|
+
if (!await appendSessionHistoryAudit(path, audit("allowed", messages.length), revision)) return denied();
|
|
6286
|
+
return {
|
|
6287
|
+
kind: "session",
|
|
6288
|
+
provider: request.provider ?? "codex",
|
|
6289
|
+
sessionId: request.sessionId,
|
|
6290
|
+
requester,
|
|
6291
|
+
messages,
|
|
6292
|
+
nextOffset: request.offset + messages.length < history.messages.length ? request.offset + messages.length : null,
|
|
6293
|
+
omittedNonMessageItems: history.omittedNonMessageItems
|
|
6294
|
+
};
|
|
6295
|
+
}
|
|
6296
|
+
}
|
|
6297
|
+
//#endregion
|
|
5793
6298
|
//#region src/local-service/carrier/run-socket-session.ts
|
|
5794
6299
|
function buildShutdownHeartbeatFacts(input) {
|
|
5795
6300
|
if (input.acceptingDispatches) return {};
|
|
@@ -5851,6 +6356,22 @@ function classifyDaemonSocketDisconnect(input) {
|
|
|
5851
6356
|
if (input.closeCode === 1006) return "possible_deploy_or_edge_restart";
|
|
5852
6357
|
return "abnormal_socket_close";
|
|
5853
6358
|
}
|
|
6359
|
+
function handleSessionHistorySocketFrame(input) {
|
|
6360
|
+
if (input.frame.code !== "daemon.session_history.request") return false;
|
|
6361
|
+
const parsed = sessionHistoryRequestFrameSchema.safeParse(input.frame);
|
|
6362
|
+
if (!parsed.success) return true;
|
|
6363
|
+
handleSessionHistoryFrame({
|
|
6364
|
+
...input,
|
|
6365
|
+
frame: parsed.data
|
|
6366
|
+
}).then((frame) => input.socket.send(JSON.stringify(frame))).catch(() => {
|
|
6367
|
+
emitRunLine({
|
|
6368
|
+
presenter: input.presenter,
|
|
6369
|
+
code: "daemon.run.session_history_failed",
|
|
6370
|
+
text: "Session history request failed. No transcript content was logged."
|
|
6371
|
+
});
|
|
6372
|
+
});
|
|
6373
|
+
return true;
|
|
6374
|
+
}
|
|
5854
6375
|
function handleComputerFileAccessSocketFrame(input) {
|
|
5855
6376
|
if (!input.frame.code.startsWith("daemon.computer_file_access.")) return false;
|
|
5856
6377
|
const parsed = computerFileAccessDaemonFrameSchema.safeParse(input.frame);
|
|
@@ -6976,7 +7497,10 @@ async function runDaemonSocketSession(input) {
|
|
|
6976
7497
|
});
|
|
6977
7498
|
return;
|
|
6978
7499
|
}
|
|
6979
|
-
if (
|
|
7500
|
+
if (handleSessionHistorySocketFrame({
|
|
7501
|
+
...input,
|
|
7502
|
+
frame: parsedFrame
|
|
7503
|
+
}) || handleLocalFolderPickerSocketFrame({
|
|
6980
7504
|
deviceId: input.deviceId,
|
|
6981
7505
|
frame: parsedFrame,
|
|
6982
7506
|
presenter: input.presenter,
|
|
@@ -7806,7 +8330,8 @@ function buildLocalServiceCapabilityHeaders(input) {
|
|
|
7806
8330
|
[OPENMELD_EXECUTION_ADMISSION_HEADER]: "1",
|
|
7807
8331
|
[OPENMELD_ADMISSION_EVIDENCE_HEADER]: "1",
|
|
7808
8332
|
...input.localFolderPickerAvailable ? { [OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER]: LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY } : {},
|
|
7809
|
-
[OPENMELD_RUNTIME_CAPABILITIES_HEADER]: COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY
|
|
8333
|
+
[OPENMELD_RUNTIME_CAPABILITIES_HEADER]: COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY,
|
|
8334
|
+
[SESSION_HISTORY_CAPABILITY_HEADER]: SESSION_HISTORY_RUNTIME_CAPABILITY
|
|
7810
8335
|
};
|
|
7811
8336
|
}
|
|
7812
8337
|
var DaemonStreamAuthenticationRequiredError = class extends Error {
|
|
@@ -16065,4 +16590,4 @@ function parseDaemonRunMode(rawMode) {
|
|
|
16065
16590
|
//#endregion
|
|
16066
16591
|
export { buildAuthStatusSnapshot as $, buildDaemonStartNeedsAttentionCard as A, resolveDaemonServiceParticipationStatus as B, buildProfileWorkspaceRows as C, createDelayedSpinner as D, emitDaemonAgentOverview as E, emitCliJsonEnvelope as F, ensureCommandAuthenticationOrCancel as G, validateLocalProjectConnectionPath as H, runDaemonStartupPreflight as I, runAuthLogout as J, evaluateCommandAuthentication as K, readDaemonIncidentLogTail as L, buildHumanErrorCopy as M, renderHumanErrorCard as N, shouldEmitAgentOverview as O, renderHumanTextErrorCard as P, buildAuthStatusRows as Q, resolveLocalComponentsStatus as R, buildProfileWorkspacePresentation as S, createQuietPresenter as T, connectWebSocket as U, LocalProjectConnectionError as V, buildCommandAuthenticationPromptMessage as W, runAuthStatus as X, runAuthMenu as Y, exchangeOneTimeTokenAuthSession as Z, buildDaemonBackgroundStartFailure as _, resolveDeviceTokenExpiresAt as _t, runDaemonBackgroundStartForDecision as a, promptTextEntry as at, formatServiceRuntimeHeadline as b, runDaemonInterrupt as c, finishCurrentCommandCheckScope as ct, runDaemonServiceDetached as d, resetCurrentCommandCheckState as dt, formatActiveOrganizationLabel as et, runDaemonSnapshot as f, startCurrentCommandCheckScope as ft, runDaemonUninstall as g, resolveDeviceAuthClientId as gt, runDaemonTeardownStrict as h, requestDeviceToken as ht, runDaemonAutostart as i, buildUnifiedCardFrame as it, runDaemonStartDecisionPrompt as j, buildDaemonStartDeferredCard as k, runDaemonReinstall as l, getCurrentCommandCheckState as lt, runDaemonStop as m, fetchAuthUserSnapshot as mt, isManagedSystemServiceBootstrapRun as n, renderInfoCard as nt, runDaemonCancel as o, isReturnKeypress as ot, runDaemonStatusFlow as p, extractAuthApiErrorMessage as pt, runAuthLogin as q, runDaemon as r, renderTextInfoCard as rt, runDaemonInstall as s, runInteractivePrompt as st, bestEffortStopCurrentLaneDaemonService as t, buildTextInfoCardLines as tt, runDaemonRunAfterEntryChecks as u, isCurrentCommandCheckScopeActive as ut, buildSystemServiceStartupFailureReportFromVerdict as v, revokeAuthAccessToken as vt, reconcileCliVersionView as w, resolveServiceParticipationReadiness as x, formatServiceParticipationReadinessLabel as y, writeInstalledLocalComponentsSnapshot as z };
|
|
16067
16592
|
|
|
16068
|
-
//# sourceMappingURL=service-
|
|
16593
|
+
//# sourceMappingURL=service-8EozP77B.js.map
|