openmeld 0.3.125 → 0.3.128
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-BCGn5T-D.js → add-me-membership-CoSmA50L.js} +2 -2
- package/dist/{add-me-membership-BCGn5T-D.js.map → add-me-membership-CoSmA50L.js.map} +1 -1
- package/dist/{api-client-foundation-w4Oa06t4.js → api-client-foundation-eG7A-GEB.js} +84 -25
- package/dist/api-client-foundation-eG7A-GEB.js.map +1 -0
- package/dist/auth-session-B1jSy0ws.js +1905 -0
- package/dist/auth-session-B1jSy0ws.js.map +1 -0
- package/dist/{base-url-PkgATS5u.js → base-url-BtqW4aLS.js} +73 -8
- package/dist/base-url-BtqW4aLS.js.map +1 -0
- package/dist/{command-CD_g9eAM.js → command-BTuYFU2T.js} +884 -587
- package/dist/{command-CD_g9eAM.js.map → command-BTuYFU2T.js.map} +1 -1
- package/dist/{daemon-runtime-lease-Cvo63MGd.js → daemon-runtime-lease-D82uDZ5s.js} +2 -2
- package/dist/{daemon-runtime-lease-Cvo63MGd.js.map → daemon-runtime-lease-D82uDZ5s.js.map} +1 -1
- package/dist/{dist-DYE9Q3T4.js → dist-BnHChh7U.js} +3 -3
- package/dist/{dist-DYE9Q3T4.js.map → dist-BnHChh7U.js.map} +1 -1
- package/dist/openmeld-dev.js +1 -1
- package/dist/openmeld.js +512 -102
- package/dist/openmeld.js.map +1 -1
- package/dist/{runtime-transport-CWWB2Ily.js → runtime-transport-CHbXitKu.js} +2 -2
- package/dist/{runtime-transport-CWWB2Ily.js.map → runtime-transport-CHbXitKu.js.map} +1 -1
- package/package.json +2 -2
- package/dist/api-client-foundation-w4Oa06t4.js.map +0 -1
- package/dist/auth-session-qk94UQqs.js +0 -1146
- package/dist/auth-session-qk94UQqs.js.map +0 -1
- package/dist/base-url-PkgATS5u.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $ as runWithHeldLock, $t as
|
|
4
|
-
import { A as MAX_TEXT_LENGTH, At as createCenterAgentRoutineResponseSchema, B as sleep, C as createSpaceApi, D as toStructuredApiClientFailure, Dt as organizationComputersResponseSchema, E as resolveProfileSpaceHistoryGatewayHost, Et as profileErrorResponseSchema, F as OPENMELD_HEADER_PROFILE_ID, Ft as resumeCenterAgentRoutineResponseSchema, Gt as localProjectControlDaemonFrameSchema, H as getSpaceUpdatesResponseSchema, It as updateCenterAgentRoutineResponseSchema, Jt as postSpaceMembersResponseSchema, Kt as localProjectControlDiscoverProjectsResponseSchema, L as OPENMELD_HEADER_REQUEST_ID, M as parseIncoming$1, Mt as listCenterAgentRoutineRunsResponseSchema, N as parseServerErrorFrame$1, Nt as listCenterAgentRoutinesResponseSchema, O as DAEMON_STREAM_KEEPALIVE_PING, Ot as submitFeedbackIssueRequestSchema, P as resolveCustomMentionAliasOverride, Pt as pauseCenterAgentRoutineResponseSchema, Q as submitAgentControllerTaskLifecycleEventItemSchema, Rt as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, S as createRuntimeReportingApi, St as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, T as resolveAccountSpaceIndexGatewayHost, Tt as profileCapabilitiesResponseSchema, U as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Ut as agentActivitySnapshotResponseSchema, V as toErrorMessage$
|
|
5
|
-
import { $r as profileWorkspaceModeSchema, $t as skippedDaemonProfileSchema, A as runtimeTransportRegisterSessionResponseSchema, An as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, B as openMeldDaemonTaskResultPayloadSchema, Bn as localCliComponentUpdateProjectionSchema, Bt as resolveSpaceFileMimeType, C as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, D as runtimeTransportOpenMeldToolsControlFramePayloadSchema, E as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, Fn as formatLocalComponentsSummaryDescription, Fr as resolveSpaceMentionLabels, G as localFolderPickerDaemonFrameSchema, Gr as openMeldRequestContextSchema, H as openMeldSpaceEgressActionSchema, I as runtimeTransportSubmitTaskResultRequestSchema, In as formatLocalComponentsSummaryLabel, Jn as openMeldToolsUpdateOperationPhaseSchema, Jr as normalizeOptionalWorkingDirectory, K as localFolderPickerHelperProtocolResultSchema, Kr as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Ln as formatLocalSetupActionDescription, M as runtimeTransportResumeControllerConversationFramePayloadSchema, Mn as agentInteractionRequestSchema, Mr as normalizeSpacePasswordText, N as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Nn as agentInteractionResolutionSchema, O as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Or as runtimeCoordinatorExecutionTokenEnvelopeSchema, P as runtimeTransportRouteCatalogChangedFramePayloadSchema, Pr as resolveSingleSpaceMentionLabels, Pt as SPACE_FILE_MAX_SIZE_BYTES, R as openMeldDaemonTaskResultEnvelopeWriteSchema, Rn as formatLocalSetupActionLabel, S as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Sn as resolveMessageEnvelopeTargetField, T as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, U as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, W as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, Wn as localServiceComponentUpdateProjectionSchema, Wt as spaceFileNameSchema, Xt as openMeldDaemonControlPlaneRequestSchema, Yr as openMeldRuntimeProfileIdSchema, Zn as openMeldToolsUpdateRequestSourceSchema, Zt as openMeldDaemonControlPlaneResponseSchema, _ as runtimeTransportHeartbeatRequestSchema, _n as collectCanonicalMentionTextFragments, a as runtimeTransportCapabilitiesSchema, ai as MAX_TEXT_LENGTH$1, b as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, br as url, c as runtimeTransportDispatchInteractionRequestSchema, ci as resolvePublicAgentAvailabilityCopy, d as runtimeTransportDispatchPreviewEndRequestSchema, di as shouldPreferMappedPublicAgentFailureReason, en as providerDispatchRuntimeContextSchema, er as boolean, f as runtimeTransportDispatchPreviewRequestSchema, g as runtimeTransportForkAgentSessionResultSchema, gn as MESSAGE_MENTION_TYPE_VALUES, gt as SPACE_MENTION_REJECT_NOTICE_PURPOSE, h as runtimeTransportErrorCodeSchema, hi as resolveCommandAgentWorkActivity, hr as string, ht as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, i as localWakeRouteReportSchema, ii as trimmedStringFromUnknown, ir as enumFactory, j as runtimeTransportRejectedProfileRegistrationSchema, k as runtimeTransportRegisterSessionRequestSchema, kr as runtimeTransportDeliveryExecutionIdentitySchema, l as runtimeTransportDispatchInteractionResponseFramePayloadSchema, li as resolvePublicAgentFailureRecovery, m as runtimeTransportDispatchToolActivityRequestSchema, mr as strictObject, mt as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, n as daemonExecutionCompatibilitySchema, nr as discriminatedUnion, o as runtimeTransportDeliverDispatchRequestSchema, oi as resolveDetailedPublicAgentFailureReason$1, or as iso, p as runtimeTransportDispatchRuntimeEvidenceRequestSchema, q as localFolderPickerHelperResultSchema, qn as openMeldToolsUpdateAttemptSchema, qr as agentProfileIdSchema, r as daemonStreamFrameSchema, s as runtimeTransportDispatchInteractionDeliveredRequestSchema, si as resolveMappedPublicAgentFailureReason, sr as literal, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, tn as conversationExecutionStateSchema, u as runtimeTransportDispatchLifecycleRequestSchema, ui as sanitizeDispatchErrorSummary, ut as CONVERSATION_CONTINUITY_WARNING_PURPOSE, v as runtimeTransportHeartbeatResponseSchema, vn as formatCanonicalMentionLiteral, vt as sanitizeSignalTextPreview, w as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, wr as parseOptionalClientMessageId, x as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, xn as normalizeMessageEnvelope, y as runtimeTransportLocalAgentControlCancelFramePayloadSchema, yn as getSpaceMessageAddressingRelationSupportForTargetKind, z as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, zn as installedLocalComponentsSnapshotSchema } from "./runtime-transport-
|
|
3
|
+
import { $ as runWithHeldLock, $t as formatLocalMachineIssueMessage, At as normalizeAccountKey, B as toSpaceRemoveMembersUrl, C as updateConfiguredDeviceRuntimeState, Ct as accountProfileWorkspacePath, D as normalizeBaseUrl, Dt as deviceOpenClawProfileWorkspaceDir, Et as deviceOpenClawProfileDir, Ft as openMeldManagedVersionBinaryPath, Gt as resolveOpenMeldEnvPreset, H as toSpaceUpdatesUrl, Ht as resolveDefaultOpenMeldHomeDirname, I as toSpaceLeaveUrl, It as openMeldManagedVersionDir, Jt as runtimeDir, K as isOpenMeldLockError, Kt as resolveOpenMeldPresetOwnedPathInput, L as toSpaceMembersUrl, Lt as openMeldRootDir, M as toSpaceCursorUrl, Mt as openMeldBackupsDir, N as toSpaceDeleteUrl, Nt as openMeldBinDir, O as toDaemonRouteObservationUrl, Ot as isPublishedOpenMeldHome, Pt as openMeldManagedBinaryPath, Q as resolveOpenMeldOrphanedLockIssue, Qt as systemDir, R as toSpaceMetaUrl, Rt as openMeldVersionsDir, S as setConfiguredSkillsConfig, St as accountProfileViewPath, T as updateConfiguredSkillsConfig, Tt as deviceOpenClawProfileBootstrapPath, U as toSpaceWsUrl, Ut as resolveExplicitOpenMeldEnvPreset, W as acquireLock, Xt as skillsDir, Yt as runtimeLogsDir, _ as getConfiguredViewCustomization, _n as normalizeKnownBuiltinAgentControllerId, _t as CURRENT_PROCESS_START_IDENTITY, a as resolveBaseUrl, an as runtimeTransportModeSchema, at as resolveCliContext, bt as accountProfileLocalMetaPath, c as resolveExplicitGatewayUrlOrThrow, cn as conversationPolicySchema, d as createDefaultRuntimeAgentControllerSettings, dn as HOSTED_CENTER_AGENT_CONTROLLER_REF_ID, dt as assessLocalMachineFailure, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, gn as normalizeBuiltinAgentControllerId, h as getConfiguredOpenMeldToolsMaintenance, hn as canonicalizeBuiltinAgentControllerRef, i as normalizeGatewayBaseUrlOrNull, in as runtimeStreamingModeSchema, it as readCliContextState, j as toSpaceCreateUrl, jt as normalizeOpenMeldProfileId, kt as legacyAccountProfileSpacesDir, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, ln as resolveBuiltinAgentControllerConversationKind, lt as resolveOpenMeldLaneDescriptor, mn as canonicalizeAgentControllerRef, nn as runtimeAgentControllerLaunchContractSchema, o as resolveBaseUrlOrNull, ot as resolveCliContextId, p as getConfiguredDeviceRuntimeState, pn as buildAgentControllerRoutingKey, pt as createBackgroundExecutionBlockedIssue, q as isOpenMeldOrphanedLockError, qt as resolveOpenMeldRootDir, r as normalizeGatewayBaseUrl, rt as listCliContextStates, s as resolveDefaultGatewayBaseUrl, sn as buildAgentControllerConversationRef, st as writeCliContextState, tn as runtimeAgentControllerConversationIdMappingSpecSchema, un as HOSTED_CENTER_AGENT_CONTROLLER_REF, v as getRuntimeConfigReadHealth, vn as parseAgentControllerRef$1, vt as isProcessIdentityAlive, wt as accountsDir, x as setConfiguredOpenMeldToolsMaintenance, xt as accountProfileSpaceCacheDir, y as resolveRuntimeSkillsCustomTargetId, yt as OPENMELD_HOME_ENV_KEY, z as toSpacePasswordUrl } from "./base-url-BtqW4aLS.js";
|
|
4
|
+
import { A as MAX_TEXT_LENGTH, At as createCenterAgentRoutineResponseSchema, B as sleep, C as createSpaceApi, D as toStructuredApiClientFailure, Dt as organizationComputersResponseSchema, E as resolveProfileSpaceHistoryGatewayHost, Et as profileErrorResponseSchema, F as OPENMELD_HEADER_PROFILE_ID, Ft as resumeCenterAgentRoutineResponseSchema, Gt as localProjectControlDaemonFrameSchema, H as getSpaceUpdatesResponseSchema, It as updateCenterAgentRoutineResponseSchema, Jt as postSpaceMembersResponseSchema, Kt as localProjectControlDiscoverProjectsResponseSchema, L as OPENMELD_HEADER_REQUEST_ID, M as parseIncoming$1, Mt as listCenterAgentRoutineRunsResponseSchema, N as parseServerErrorFrame$1, Nt as listCenterAgentRoutinesResponseSchema, O as DAEMON_STREAM_KEEPALIVE_PING, Ot as submitFeedbackIssueRequestSchema, P as resolveCustomMentionAliasOverride, Pt as pauseCenterAgentRoutineResponseSchema, Q as submitAgentControllerTaskLifecycleEventItemSchema, Rt as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, S as createRuntimeReportingApi, St as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_MESSAGE, T as resolveAccountSpaceIndexGatewayHost, Tt as profileCapabilitiesResponseSchema, U as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, Ut as agentActivitySnapshotResponseSchema, V as toErrorMessage$43, Wt as localProjectControlConnectionSchema, Xt as spaceMemberDirectoryEntrySchema, Yt as removeSpaceMembersResponseSchema, Zt as spaceMemberDirectorySchema, _n as agentControllerPermissionModeSchema, _t as organizationSkillReleaseSummarySchema, a as buildSpaceAttachmentDownloadPath, an as createProjectResponseSchema, at as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, bt as organizationDirectoryResponseSchema, c as createAgentProfileBindingApi, cn as updateProjectResponseSchema, ct as computerFileAccessPolicyInputSchema, d as createCurrentDeviceApi, dt as organizationSpaceDirectoryWithMemberCountsResponseSchema, ft as spaceCreatorSchema, g as createOrganizationApi, h as createOpenMeldApiClient, ht as listOrganizationSkillsResponseSchema, i as buildProfileSpaceHistoryUpsertPath, in as archiveProjectResponseSchema, it as gatewayErrorEnvelopeSchema, j as parseEnvelope$1, jt as deleteCenterAgentRoutineResponseSchema, kt as submitFeedbackIssueResponseSchema, ln as centerAgentToolSpeakerSchema, lt as computerFileAccessPolicySchema, m as createLocalRuntimeExpectedRoutesApi, mt as getOrganizationSkillResponseSchema, n as OpenMeldApiClientInvalidResponseError, o as createAccountSpaceIndexApi, on as listProjectsResponseSchema, ot as OPENMELD_RUNTIME_CAPABILITIES_HEADER, p as createFetchTransport, pt as spaceMetaSchema, qt as leaveSpaceResponseSchema, r as buildProfileSpaceHistoryStatusPath, rn as observedLocalAgentSessionSchema, s as createAgentActivityApi, sn as projectSchema, st as computerFileAccessDaemonFrameSchema, t as OpenMeldApiClientHttpError, tn as agentActivitySessionInventoryResponseSchema, un as openCodePermissionConfigSchema, ut as modelCatalogSchema, vn as agentControllerCollaborationModeSchema, vt as organizationSkillSummarySchema, wt as authProfileManagedRoleSchema, xt as ADDITIONAL_HUMAN_PROFILE_CREATION_DISABLED_CODE, y as createProfileSpaceHistoryApi, yn as toLegacySpaceAddressingWireValue, z as toErrorMessage$44, zt as agentActivityEventSchema } from "./dist-BnHChh7U.js";
|
|
5
|
+
import { $r as profileWorkspaceModeSchema, $t as skippedDaemonProfileSchema, A as runtimeTransportRegisterSessionResponseSchema, An as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, B as openMeldDaemonTaskResultPayloadSchema, Bn as localCliComponentUpdateProjectionSchema, Bt as resolveSpaceFileMimeType, C as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, D as runtimeTransportOpenMeldToolsControlFramePayloadSchema, E as runtimeTransportLookupRouteOwnerServiceEvidenceSchema, Fn as formatLocalComponentsSummaryDescription, Fr as resolveSpaceMentionLabels, G as localFolderPickerDaemonFrameSchema, Gr as openMeldRequestContextSchema, H as openMeldSpaceEgressActionSchema, I as runtimeTransportSubmitTaskResultRequestSchema, In as formatLocalComponentsSummaryLabel, Jn as openMeldToolsUpdateOperationPhaseSchema, Jr as normalizeOptionalWorkingDirectory, K as localFolderPickerHelperProtocolResultSchema, Kr as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Ln as formatLocalSetupActionDescription, M as runtimeTransportResumeControllerConversationFramePayloadSchema, Mn as agentInteractionRequestSchema, Mr as normalizeSpacePasswordText, N as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Nn as agentInteractionResolutionSchema, O as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Or as runtimeCoordinatorExecutionTokenEnvelopeSchema, P as runtimeTransportRouteCatalogChangedFramePayloadSchema, Pr as resolveSingleSpaceMentionLabels, Pt as SPACE_FILE_MAX_SIZE_BYTES, R as openMeldDaemonTaskResultEnvelopeWriteSchema, Rn as formatLocalSetupActionLabel, S as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, Sn as resolveMessageEnvelopeTargetField, T as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, U as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, W as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, Wn as localServiceComponentUpdateProjectionSchema, Wt as spaceFileNameSchema, Xt as openMeldDaemonControlPlaneRequestSchema, Yr as openMeldRuntimeProfileIdSchema, Zn as openMeldToolsUpdateRequestSourceSchema, Zt as openMeldDaemonControlPlaneResponseSchema, _ as runtimeTransportHeartbeatRequestSchema, _n as collectCanonicalMentionTextFragments, a as runtimeTransportCapabilitiesSchema, ai as MAX_TEXT_LENGTH$1, b as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, br as url, c as runtimeTransportDispatchInteractionRequestSchema, ci as resolvePublicAgentAvailabilityCopy, d as runtimeTransportDispatchPreviewEndRequestSchema, di as shouldPreferMappedPublicAgentFailureReason, en as providerDispatchRuntimeContextSchema, er as boolean, f as runtimeTransportDispatchPreviewRequestSchema, g as runtimeTransportForkAgentSessionResultSchema, gn as MESSAGE_MENTION_TYPE_VALUES, gt as SPACE_MENTION_REJECT_NOTICE_PURPOSE, h as runtimeTransportErrorCodeSchema, hi as resolveCommandAgentWorkActivity, hr as string, ht as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, i as localWakeRouteReportSchema, ii as trimmedStringFromUnknown, ir as enumFactory, j as runtimeTransportRejectedProfileRegistrationSchema, k as runtimeTransportRegisterSessionRequestSchema, kr as runtimeTransportDeliveryExecutionIdentitySchema, l as runtimeTransportDispatchInteractionResponseFramePayloadSchema, li as resolvePublicAgentFailureRecovery, m as runtimeTransportDispatchToolActivityRequestSchema, mr as strictObject, mt as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, n as daemonExecutionCompatibilitySchema, nr as discriminatedUnion, o as runtimeTransportDeliverDispatchRequestSchema, oi as resolveDetailedPublicAgentFailureReason$1, or as iso, p as runtimeTransportDispatchRuntimeEvidenceRequestSchema, q as localFolderPickerHelperResultSchema, qn as openMeldToolsUpdateAttemptSchema, qr as agentProfileIdSchema, r as daemonStreamFrameSchema, s as runtimeTransportDispatchInteractionDeliveredRequestSchema, si as resolveMappedPublicAgentFailureReason, sr as literal, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, tn as conversationExecutionStateSchema, u as runtimeTransportDispatchLifecycleRequestSchema, ui as sanitizeDispatchErrorSummary, ut as CONVERSATION_CONTINUITY_WARNING_PURPOSE, v as runtimeTransportHeartbeatResponseSchema, vn as formatCanonicalMentionLiteral, vt as sanitizeSignalTextPreview, w as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, wr as parseOptionalClientMessageId, x as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, xn as normalizeMessageEnvelope, y as runtimeTransportLocalAgentControlCancelFramePayloadSchema, yn as getSpaceMessageAddressingRelationSupportForTargetKind, z as openMeldDaemonTaskResultOpenClawGatewayVisibilityStatusSchema, zn as installedLocalComponentsSnapshotSchema } from "./runtime-transport-CHbXitKu.js";
|
|
6
6
|
import { r as daemonServiceLaneSchema, t as daemonServiceContractSchema } from "./service-contract-CRyDcIIf.js";
|
|
7
|
-
import { A as getDaemonRuntimeStatus, B as resolveDaemonServiceRuntimeMetadata, C as daemonServiceRepairJournalPath, D as daemonServiceUpdateWorkerBinaryExecutablePath, E as daemonServiceStableLauncherPath, F as readDaemonServiceLifecycleLockMeta, G as withDaemonServiceReconcileLock, H as rotateDaemonControlPlaneTokenIfExpired, I as readDaemonServiceLifecycleLockMetaWithCleanup, J as withDaemonServiceStopLock, K as withDaemonServiceRegistrationMutationLock, L as readDaemonServiceRuntimeSnapshot, M as installDaemon, N as isDaemonServiceRuntimeHeartbeatStale, O as daemonStatePath, P as readDaemonControlPlaneToken, R as releaseDaemonServiceLifecycleLock, S as daemonServiceRecognizedExecutablePaths$1, T as daemonServiceStableExecutableWrapperPath, U as setDaemonServiceRuntimeState, V as restoreDaemonInstallStateSnapshot, W as uninstallDaemon, X as writeDaemonLocalStateFile, Y as readDaemonLocalStateFile, _ as daemonRuntimeServiceManagerPath, a as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, b as daemonServiceExecutableWrapperPaths$1, c as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, d as clearDaemonServiceRuntimeState, f as daemonDispatchJournalPath, g as daemonRuntimeRootPath, h as daemonRuntimeDataPath, i as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, j as getDaemonStatus, k as ensureDaemonControlPlaneToken, l as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV, m as daemonRuntimeBundlesPath, n as writeDaemonRuntimeLease, o as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, p as daemonLifecycleJournalPath, q as withDaemonServiceRunLock, r as DAEMON_HEARTBEAT_STALE_MS, s as DAEMON_SERVICE_RUNTIME_MODE_ENV, t as readDaemonRuntimeLease, u as acquireDaemonServiceLifecycleLock, v as daemonRuntimeStateRootPath, w as daemonServiceStableBinaryExecutablePath, x as daemonServiceLegacyExecutableWrapperPath, y as daemonServiceActiveBundleStatePath, z as resolveDaemonControlPlaneEndpoint } from "./daemon-runtime-lease-
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
7
|
+
import { A as getDaemonRuntimeStatus, B as resolveDaemonServiceRuntimeMetadata, C as daemonServiceRepairJournalPath, D as daemonServiceUpdateWorkerBinaryExecutablePath, E as daemonServiceStableLauncherPath, F as readDaemonServiceLifecycleLockMeta, G as withDaemonServiceReconcileLock, H as rotateDaemonControlPlaneTokenIfExpired, I as readDaemonServiceLifecycleLockMetaWithCleanup, J as withDaemonServiceStopLock, K as withDaemonServiceRegistrationMutationLock, L as readDaemonServiceRuntimeSnapshot, M as installDaemon, N as isDaemonServiceRuntimeHeartbeatStale, O as daemonStatePath, P as readDaemonControlPlaneToken, R as releaseDaemonServiceLifecycleLock, S as daemonServiceRecognizedExecutablePaths$1, T as daemonServiceStableExecutableWrapperPath, U as setDaemonServiceRuntimeState, V as restoreDaemonInstallStateSnapshot, W as uninstallDaemon, X as writeDaemonLocalStateFile, Y as readDaemonLocalStateFile, _ as daemonRuntimeServiceManagerPath, a as DAEMON_SERVICE_RUNTIME_CONTROLLER_ENV, b as daemonServiceExecutableWrapperPaths$1, c as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, d as clearDaemonServiceRuntimeState, f as daemonDispatchJournalPath, g as daemonRuntimeRootPath, h as daemonRuntimeDataPath, i as DAEMON_SERVICE_RUNTIME_AUTO_START_ENV, j as getDaemonStatus, k as ensureDaemonControlPlaneToken, l as DAEMON_SERVICE_RUNTIME_SYSTEM_SERVICE_ENV, m as daemonRuntimeBundlesPath, n as writeDaemonRuntimeLease, o as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, p as daemonLifecycleJournalPath, q as withDaemonServiceRunLock, r as DAEMON_HEARTBEAT_STALE_MS, s as DAEMON_SERVICE_RUNTIME_MODE_ENV, t as readDaemonRuntimeLease, u as acquireDaemonServiceLifecycleLock, v as daemonRuntimeStateRootPath, w as daemonServiceStableBinaryExecutablePath, x as daemonServiceLegacyExecutableWrapperPath, y as daemonServiceActiveBundleStatePath, z as resolveDaemonControlPlaneEndpoint } from "./daemon-runtime-lease-D82uDZ5s.js";
|
|
8
|
+
import { A as MAX_HEARTBEAT_INTERVAL_MS$2, B as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS$1, C as DAEMON_STREAM_CONNECT_TIMEOUT_MS$1, D as DEFAULT_HEARTBEAT_INTERVAL_MS$1, E as DEFAULT_GATEWAY_CHAIN_TIMEOUT_MS$1, F as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS$1, I as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS$1, L as REGISTER_RESPONSE_TIMEOUT_MS$1, M as MIN_HEARTBEAT_INTERVAL_MS$2, P as OPENCLAW_CLI_TIMEOUT_MS$1, S as DAEMON_RUNTIME_CONTRACT_EPOCH$1, T as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS$1, V as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS$1, _ as isBinaryDistribution, a as clearAuthSession, b as CATALOG_SYNC_RETRY_INTERVAL_MS$1, c as getAuthSessionState, i as beginAuthSessionTransition, k as HEARTBEAT_RESPONSE_TIMEOUT_MS$1, m as setAuthSession, n as assertAuthSessionMutationAvailable, v as resolveOpenMeldDistribution, w as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1, x as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1, z as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1 } from "./auth-session-B1jSy0ws.js";
|
|
9
|
+
import { a as AuthRequestCredentialError, c as buildOpenMeldRequestContextHeadersWithAuth, d as buildOpenMeldRequestContextFromProfile, f as buildOpenMeldRequestContextFromProfileIdentity, i as resolveSpaceRequestTimeoutMsForDiagnostics, l as buildRequestAuthHeaders, m as resolveAuthRequestCompatibility, n as createCliApiClientFoundation, o as buildOpenMeldProfileIdentityRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout, s as buildOpenMeldProfileRequestHeadersWithAuth, u as canAttachAuthTokenToRequest } from "./api-client-foundation-eG7A-GEB.js";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import { homedir, tmpdir, userInfo } from "node:os";
|
|
12
12
|
import * as z$1 from "zod/v4";
|
|
@@ -20,13 +20,13 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
20
20
|
import { access, appendFile, chmod, copyFile, cp, link, lstat, mkdir, mkdtemp, open, readFile, readdir, readlink, realpath, rename, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
21
21
|
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
22
22
|
import { accessSync, appendFileSync, chmodSync, constants, createReadStream, existsSync, mkdirSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, statSync, watch, writeFileSync } from "node:fs";
|
|
23
|
+
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
23
24
|
import { fileURLToPath } from "node:url";
|
|
24
25
|
import { Worker } from "node:worker_threads";
|
|
25
26
|
import { clearLine, createInterface, cursorTo, moveCursor } from "node:readline";
|
|
26
27
|
import { forkSession, query } from "@anthropic-ai/claude-agent-sdk";
|
|
27
28
|
import { createConnection, createServer } from "node:net";
|
|
28
29
|
import { createOpencodeClient } from "@opencode-ai/sdk/v2";
|
|
29
|
-
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
30
30
|
import { cancel, confirm, isCancel, multiselect, password, select, text } from "@clack/prompts";
|
|
31
31
|
import WebSocket from "ws";
|
|
32
32
|
import wrapAnsi from "wrap-ansi";
|
|
@@ -744,6 +744,59 @@ const daemonServiceUpdateJobSchema = daemonServiceUpdateJobBodySchema.extend({
|
|
|
744
744
|
});
|
|
745
745
|
const storedDaemonServiceUpdateJobSchema = z$1.discriminatedUnion("v", [daemonServiceUpdateJobV1Schema, daemonServiceUpdateJobSchema]);
|
|
746
746
|
//#endregion
|
|
747
|
+
//#region ../../packages/schemas/dist/schemas/http/auth-device-authorization.js
|
|
748
|
+
const BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
749
|
+
const betterAuthDeviceAuthorizationCodeRequestSchema = z$1.object({
|
|
750
|
+
client_id: z$1.string().min(1),
|
|
751
|
+
scope: z$1.string().optional(),
|
|
752
|
+
user_id: z$1.string().optional()
|
|
753
|
+
});
|
|
754
|
+
const betterAuthDeviceAuthorizationCodeResponseSchema = z$1.object({
|
|
755
|
+
device_code: z$1.string().min(1),
|
|
756
|
+
user_code: z$1.string().min(1),
|
|
757
|
+
verification_uri: z$1.string().min(1),
|
|
758
|
+
verification_uri_complete: z$1.string().min(1),
|
|
759
|
+
expires_in: z$1.number().finite().positive(),
|
|
760
|
+
interval: z$1.number().finite().positive()
|
|
761
|
+
});
|
|
762
|
+
const betterAuthDeviceAuthorizationStatusSchema = z$1.enum([
|
|
763
|
+
"pending",
|
|
764
|
+
"approved",
|
|
765
|
+
"denied"
|
|
766
|
+
]);
|
|
767
|
+
z$1.object({
|
|
768
|
+
user_code: z$1.string().min(1),
|
|
769
|
+
status: betterAuthDeviceAuthorizationStatusSchema
|
|
770
|
+
});
|
|
771
|
+
z$1.object({ userCode: z$1.string().min(1) });
|
|
772
|
+
z$1.object({ success: z$1.boolean() });
|
|
773
|
+
const betterAuthDeviceAuthorizationTokenRequestSchema = z$1.object({
|
|
774
|
+
grant_type: z$1.literal(BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE),
|
|
775
|
+
device_code: z$1.string().min(1),
|
|
776
|
+
client_id: z$1.string().min(1)
|
|
777
|
+
});
|
|
778
|
+
const betterAuthDeviceAuthorizationTokenResponseSchema = z$1.object({
|
|
779
|
+
access_token: z$1.string().min(1),
|
|
780
|
+
token_type: z$1.string().min(1),
|
|
781
|
+
expires_in: z$1.number().finite().positive(),
|
|
782
|
+
scope: z$1.string()
|
|
783
|
+
});
|
|
784
|
+
const betterAuthDeviceAuthorizationErrorResponseSchema = z$1.object({
|
|
785
|
+
error: z$1.string().optional(),
|
|
786
|
+
error_description: z$1.string().optional(),
|
|
787
|
+
message: z$1.string().optional(),
|
|
788
|
+
detail: z$1.string().optional()
|
|
789
|
+
});
|
|
790
|
+
const betterAuthSessionUserSnapshotSchema = z$1.object({
|
|
791
|
+
id: z$1.string().optional(),
|
|
792
|
+
email: z$1.string().optional(),
|
|
793
|
+
name: z$1.string().optional()
|
|
794
|
+
});
|
|
795
|
+
const betterAuthSessionSnapshotResponseSchema = z$1.nullable(z$1.object({
|
|
796
|
+
session: z$1.unknown().optional(),
|
|
797
|
+
user: betterAuthSessionUserSnapshotSchema.nullable()
|
|
798
|
+
}));
|
|
799
|
+
//#endregion
|
|
747
800
|
//#region ../../packages/schemas/dist/schemas/http/cli-binary-manifest.js
|
|
748
801
|
const SHA256_HEX_PATTERN = /^[a-f0-9]{64}$/u;
|
|
749
802
|
function isBase64(value) {
|
|
@@ -1174,7 +1227,6 @@ function sanitizeCardValue(value) {
|
|
|
1174
1227
|
//#region src/agent-activity/local-state-lock.ts
|
|
1175
1228
|
const POLL_MS = 20;
|
|
1176
1229
|
const OWNER_INITIALIZATION_GRACE_MS = 1e3;
|
|
1177
|
-
const PROCESS_START_IDENTITY = readProcessStartIdentity(process.pid) ?? `fallback:${process.pid}:${Math.floor(Date.now() - process.uptime() * 1e3)}`;
|
|
1178
1230
|
async function withAgentActivityLocalStateLock(input, operation) {
|
|
1179
1231
|
return await withDirectoryLease(input, "state", 5e3, 3e4, operation);
|
|
1180
1232
|
}
|
|
@@ -1318,50 +1370,16 @@ function currentLeaseOwner(token, leaseMs) {
|
|
|
1318
1370
|
return {
|
|
1319
1371
|
expiresAtMs: Date.now() + leaseMs,
|
|
1320
1372
|
ownerPid: process.pid,
|
|
1321
|
-
ownerProcessStartedAt:
|
|
1373
|
+
ownerProcessStartedAt: CURRENT_PROCESS_START_IDENTITY,
|
|
1322
1374
|
token,
|
|
1323
1375
|
version: 1
|
|
1324
1376
|
};
|
|
1325
1377
|
}
|
|
1326
1378
|
function isCurrentOwner(owner, token) {
|
|
1327
|
-
return Boolean(owner && owner.token === token && owner.ownerPid === process.pid && owner.ownerProcessStartedAt ===
|
|
1379
|
+
return Boolean(owner && owner.token === token && owner.ownerPid === process.pid && owner.ownerProcessStartedAt === CURRENT_PROCESS_START_IDENTITY);
|
|
1328
1380
|
}
|
|
1329
1381
|
function isLeaseOwnerStillRunning(owner) {
|
|
1330
|
-
|
|
1331
|
-
const observedIdentity = readProcessStartIdentity(owner.ownerPid);
|
|
1332
|
-
if (observedIdentity?.startsWith("ps:") && owner.ownerProcessStartedAt.startsWith("ps:")) return observedIdentity === owner.ownerProcessStartedAt;
|
|
1333
|
-
return true;
|
|
1334
|
-
}
|
|
1335
|
-
function readProcessStartIdentity(pid) {
|
|
1336
|
-
if (!(Number.isSafeInteger(pid) && pid > 0)) return null;
|
|
1337
|
-
try {
|
|
1338
|
-
const output = execFileSync("ps", [
|
|
1339
|
-
"-o",
|
|
1340
|
-
"lstart=",
|
|
1341
|
-
"-p",
|
|
1342
|
-
String(pid)
|
|
1343
|
-
], {
|
|
1344
|
-
encoding: "utf8",
|
|
1345
|
-
stdio: [
|
|
1346
|
-
"ignore",
|
|
1347
|
-
"pipe",
|
|
1348
|
-
"ignore"
|
|
1349
|
-
],
|
|
1350
|
-
timeout: 1e3,
|
|
1351
|
-
windowsHide: true
|
|
1352
|
-
}).trim();
|
|
1353
|
-
return output.length > 0 ? `ps:${output}` : null;
|
|
1354
|
-
} catch {
|
|
1355
|
-
return null;
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
function isProcessAlive$1(pid) {
|
|
1359
|
-
try {
|
|
1360
|
-
process.kill(pid, 0);
|
|
1361
|
-
return true;
|
|
1362
|
-
} catch (error) {
|
|
1363
|
-
return !isNodeError$11(error, "ESRCH");
|
|
1364
|
-
}
|
|
1382
|
+
return isProcessIdentityAlive(owner);
|
|
1365
1383
|
}
|
|
1366
1384
|
function isNodeError$11(error, code) {
|
|
1367
1385
|
return error instanceof Error && "code" in error && String(error.code) === code;
|
|
@@ -2161,13 +2179,13 @@ async function migrateProjectBindingStore(input) {
|
|
|
2161
2179
|
}));
|
|
2162
2180
|
}
|
|
2163
2181
|
function parseProjectBindingStore(value, path) {
|
|
2164
|
-
if (isRecord$
|
|
2165
|
-
if (!(isRecord$
|
|
2182
|
+
if (isRecord$10(value) && typeof value.version === "number" && Number.isSafeInteger(value.version) && value.version > 3) throw new ProjectBindingStoreUpdateRequiredError(path, value.version);
|
|
2183
|
+
if (!(isRecord$10(value) && (value.version === 1 || value.version === LEGACY_STORE_VERSION || value.version === 3) && Array.isArray(value.bindings))) throw new Error(`Project binding store is invalid: ${path}`);
|
|
2166
2184
|
const storeVersion = value.version;
|
|
2167
2185
|
const bindings = value.bindings.map((binding, index) => {
|
|
2168
2186
|
const label = `${path} bindings[${index}]`;
|
|
2169
2187
|
const parsed = parseBinding(binding, label, storeVersion === 1 ? 1 : LEGACY_STORE_VERSION);
|
|
2170
|
-
const isDefault = storeVersion === 3 ? requireBoolean(isRecord$
|
|
2188
|
+
const isDefault = storeVersion === 3 ? requireBoolean(isRecord$10(binding) ? binding.isDefault : void 0, `${label}.isDefault`) : true;
|
|
2171
2189
|
return {
|
|
2172
2190
|
...parsed,
|
|
2173
2191
|
isDefault
|
|
@@ -2202,7 +2220,7 @@ function assertProjectBindingStoreV3Invariants(bindings, path, sourceVersion) {
|
|
|
2202
2220
|
}
|
|
2203
2221
|
}
|
|
2204
2222
|
function parseBinding(value, label, storeVersion) {
|
|
2205
|
-
if (!isRecord$
|
|
2223
|
+
if (!isRecord$10(value)) throw new Error(`Agent Activity Project binding is invalid: ${label}`);
|
|
2206
2224
|
const repositoryFingerprint = value.repositoryFingerprint === null ? null : normalizeFingerprint(value.repositoryFingerprint);
|
|
2207
2225
|
const boundAtMs = Number(value.boundAtMs);
|
|
2208
2226
|
if (!Number.isSafeInteger(boundAtMs) || boundAtMs < 0) throw new Error(`Agent Activity Project binding is invalid: ${label}`);
|
|
@@ -2217,7 +2235,7 @@ function parseBinding(value, label, storeVersion) {
|
|
|
2217
2235
|
};
|
|
2218
2236
|
}
|
|
2219
2237
|
function readProjectBindingStoreVersion(value) {
|
|
2220
|
-
if (!(isRecord$
|
|
2238
|
+
if (!(isRecord$10(value) && (value.version === 1 || value.version === LEGACY_STORE_VERSION || value.version === 3))) throw new Error("Project binding store version is invalid");
|
|
2221
2239
|
return value.version;
|
|
2222
2240
|
}
|
|
2223
2241
|
function normalizeFingerprint(value) {
|
|
@@ -2234,7 +2252,7 @@ function requireBoolean(value, label) {
|
|
|
2234
2252
|
if (typeof value !== "boolean") throw new Error(`${label} is required`);
|
|
2235
2253
|
return value;
|
|
2236
2254
|
}
|
|
2237
|
-
function isRecord$
|
|
2255
|
+
function isRecord$10(value) {
|
|
2238
2256
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
2239
2257
|
}
|
|
2240
2258
|
function isNodeError$9(error, code) {
|
|
@@ -2668,7 +2686,7 @@ async function readCodexSessionTitles(input) {
|
|
|
2668
2686
|
if (!line.trim()) continue;
|
|
2669
2687
|
try {
|
|
2670
2688
|
const record = JSON.parse(line);
|
|
2671
|
-
if (!isRecord$
|
|
2689
|
+
if (!isRecord$9(record)) continue;
|
|
2672
2690
|
const sessionId = text$4(record.id);
|
|
2673
2691
|
const title = normalizeSharedSessionTitle(record.thread_name);
|
|
2674
2692
|
if (sessionId && title) titles.set(sessionId, title);
|
|
@@ -2683,7 +2701,7 @@ function normalizeSharedSessionTitle(value) {
|
|
|
2683
2701
|
function text$4(value) {
|
|
2684
2702
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2685
2703
|
}
|
|
2686
|
-
function isRecord$
|
|
2704
|
+
function isRecord$9(value) {
|
|
2687
2705
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2688
2706
|
}
|
|
2689
2707
|
function isNodeError$6(error) {
|
|
@@ -2693,12 +2711,12 @@ function isNodeError$6(error) {
|
|
|
2693
2711
|
//#region src/agent-activity/observer-adapters.ts
|
|
2694
2712
|
const ACTIVE_WINDOW_MS = 2 * 6e4;
|
|
2695
2713
|
function parseCodexRolloutSnapshot(input) {
|
|
2696
|
-
const meta = input.lines.find((line) => isRecord$
|
|
2697
|
-
if (!(isRecord$
|
|
2714
|
+
const meta = input.lines.find((line) => isRecord$8(line) && line.type === "session_meta" && isRecord$8(line.payload));
|
|
2715
|
+
if (!(isRecord$8(meta) && isRecord$8(meta.payload))) return null;
|
|
2698
2716
|
const sessionId = text$3(meta.payload.id);
|
|
2699
2717
|
const cwd = text$3(meta.payload.cwd);
|
|
2700
2718
|
if (!(sessionId && cwd)) return null;
|
|
2701
|
-
const safeEvidence = input.lines.filter((line) => isRecord$
|
|
2719
|
+
const safeEvidence = input.lines.filter((line) => isRecord$8(line)).map((line) => ({
|
|
2702
2720
|
line,
|
|
2703
2721
|
observedAtMs: timestamp$1(line.timestamp)
|
|
2704
2722
|
})).filter((entry) => entry.observedAtMs !== null).sort((left, right) => Number(left.observedAtMs) - Number(right.observedAtMs));
|
|
@@ -2706,17 +2724,17 @@ function parseCodexRolloutSnapshot(input) {
|
|
|
2706
2724
|
const latestTurn = [...safeEvidence].reverse().find((entry) => entry.line.type === "turn_context");
|
|
2707
2725
|
const observedAtMs = latest?.observedAtMs ?? timestamp$1(meta.timestamp);
|
|
2708
2726
|
if (observedAtMs === null) return null;
|
|
2709
|
-
const turnPayload = isRecord$
|
|
2727
|
+
const turnPayload = isRecord$8(latestTurn?.line.payload) ? latestTurn.line.payload : {};
|
|
2710
2728
|
const originator = normalizeCodexOriginator(meta.payload);
|
|
2711
2729
|
const status = resolveObservedStatus({
|
|
2712
2730
|
explicitIdle: safeEvidence.slice(-4).some((entry) => {
|
|
2713
|
-
const payload = isRecord$
|
|
2731
|
+
const payload = isRecord$8(entry.line.payload) ? entry.line.payload : null;
|
|
2714
2732
|
return entry.line.type === "event_msg" && (payload?.type === "task_complete" || payload?.type === "turn_aborted");
|
|
2715
2733
|
}),
|
|
2716
2734
|
nowMs: input.nowMs,
|
|
2717
2735
|
observedAtMs
|
|
2718
2736
|
});
|
|
2719
|
-
const git = isRecord$
|
|
2737
|
+
const git = isRecord$8(meta.payload.git) ? meta.payload.git : {};
|
|
2720
2738
|
return {
|
|
2721
2739
|
clientKind: resolveCodexClientKind(originator),
|
|
2722
2740
|
cwd,
|
|
@@ -2734,7 +2752,7 @@ function parseCodexRolloutSnapshot(input) {
|
|
|
2734
2752
|
"never"
|
|
2735
2753
|
]),
|
|
2736
2754
|
cliVersion: nullableText$1(meta.payload.cli_version),
|
|
2737
|
-
contextWindow: positiveInteger(isRecord$
|
|
2755
|
+
contextWindow: positiveInteger(isRecord$8(turnPayload.summary) ? turnPayload.summary.model_context_window : void 0),
|
|
2738
2756
|
modelProvider: nullableText$1(meta.payload.model_provider),
|
|
2739
2757
|
originator,
|
|
2740
2758
|
reasoningEffort: enumValue(turnPayload.effort, [
|
|
@@ -2745,7 +2763,7 @@ function parseCodexRolloutSnapshot(input) {
|
|
|
2745
2763
|
"xhigh",
|
|
2746
2764
|
"ultra"
|
|
2747
2765
|
]),
|
|
2748
|
-
sandboxMode: enumValue(isRecord$
|
|
2766
|
+
sandboxMode: enumValue(isRecord$8(turnPayload.sandbox_policy) ? turnPayload.sandbox_policy.type : turnPayload.sandbox_policy, [
|
|
2749
2767
|
"read-only",
|
|
2750
2768
|
"workspace-write",
|
|
2751
2769
|
"danger-full-access"
|
|
@@ -2763,7 +2781,7 @@ function resolveCodexClientKind(originator) {
|
|
|
2763
2781
|
return originator === "cli" ? "codex-cli" : "unknown";
|
|
2764
2782
|
}
|
|
2765
2783
|
function parseClaudeTranscriptSnapshot(input) {
|
|
2766
|
-
const records = input.lines.filter((line) => isRecord$
|
|
2784
|
+
const records = input.lines.filter((line) => isRecord$8(line));
|
|
2767
2785
|
const identity = records.find((line) => text$3(line.sessionId) && text$3(line.cwd));
|
|
2768
2786
|
if (!identity) return null;
|
|
2769
2787
|
const providerSessionId = text$3(identity.sessionId);
|
|
@@ -2775,7 +2793,7 @@ function parseClaudeTranscriptSnapshot(input) {
|
|
|
2775
2793
|
})).filter((entry) => entry.observedAtMs !== null).sort((left, right) => left.observedAtMs - right.observedAtMs);
|
|
2776
2794
|
const latest = timed.at(-1);
|
|
2777
2795
|
if (!latest) return null;
|
|
2778
|
-
const latestWithModel = [...timed].reverse().find((entry) => isRecord$
|
|
2796
|
+
const latestWithModel = [...timed].reverse().find((entry) => isRecord$8(entry.line.message) && text$3(entry.line.message.model));
|
|
2779
2797
|
const customTitle = [...records].reverse().find((line) => line.type === "custom-title");
|
|
2780
2798
|
const status = resolveObservedStatus({
|
|
2781
2799
|
explicitIdle: false,
|
|
@@ -2788,7 +2806,7 @@ function parseClaudeTranscriptSnapshot(input) {
|
|
|
2788
2806
|
eventType: status === "active" ? "heartbeat" : statusEventType(status),
|
|
2789
2807
|
gitBranch: nullableText$1(latest.line.gitBranch ?? identity.gitBranch),
|
|
2790
2808
|
gitCommit: null,
|
|
2791
|
-
model: isRecord$
|
|
2809
|
+
model: isRecord$8(latestWithModel?.line.message) ? nullableText$1(latestWithModel.line.message.model) : null,
|
|
2792
2810
|
observedAtMs: latest.observedAtMs,
|
|
2793
2811
|
provider: "claude-code",
|
|
2794
2812
|
providerMetadata: compact({
|
|
@@ -2915,7 +2933,7 @@ function resolveObservedStatus(input) {
|
|
|
2915
2933
|
}
|
|
2916
2934
|
function normalizeCodexOriginator(meta) {
|
|
2917
2935
|
if (text$3(meta.originator) === "Codex Desktop") return "desktop";
|
|
2918
|
-
if (isRecord$
|
|
2936
|
+
if (isRecord$8(meta.source) && "subagent" in meta.source) return "subagent";
|
|
2919
2937
|
const originator = text$3(meta.originator)?.toLowerCase();
|
|
2920
2938
|
return originator === "codex cli" || originator === "codex_cli" ? "cli" : void 0;
|
|
2921
2939
|
}
|
|
@@ -2960,16 +2978,16 @@ function text$3(value) {
|
|
|
2960
2978
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2961
2979
|
}
|
|
2962
2980
|
function parseJsonRecord$1(value) {
|
|
2963
|
-
if (isRecord$
|
|
2981
|
+
if (isRecord$8(value)) return value;
|
|
2964
2982
|
if (typeof value !== "string") return null;
|
|
2965
2983
|
try {
|
|
2966
2984
|
const parsed = JSON.parse(value);
|
|
2967
|
-
return isRecord$
|
|
2985
|
+
return isRecord$8(parsed) ? parsed : null;
|
|
2968
2986
|
} catch {
|
|
2969
2987
|
return null;
|
|
2970
2988
|
}
|
|
2971
2989
|
}
|
|
2972
|
-
function isRecord$
|
|
2990
|
+
function isRecord$8(value) {
|
|
2973
2991
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
2974
2992
|
}
|
|
2975
2993
|
//#endregion
|
|
@@ -4683,7 +4701,7 @@ async function verifyLaunchContractFiles(input) {
|
|
|
4683
4701
|
};
|
|
4684
4702
|
} catch (error) {
|
|
4685
4703
|
return {
|
|
4686
|
-
errorMessage: toErrorMessage$
|
|
4704
|
+
errorMessage: toErrorMessage$42(error),
|
|
4687
4705
|
failureKind: "completed_negative",
|
|
4688
4706
|
ok: false
|
|
4689
4707
|
};
|
|
@@ -4712,7 +4730,7 @@ async function verifyCliLaunchContract(input) {
|
|
|
4712
4730
|
return fileCheck;
|
|
4713
4731
|
} catch (error) {
|
|
4714
4732
|
return {
|
|
4715
|
-
errorMessage: `${input.displayName} can't start on this device: ${toErrorMessage$
|
|
4733
|
+
errorMessage: `${input.displayName} can't start on this device: ${toErrorMessage$42(error)}`,
|
|
4716
4734
|
failureKind: classifyLaunchContractVerificationFailure(error),
|
|
4717
4735
|
ok: false
|
|
4718
4736
|
};
|
|
@@ -4828,7 +4846,7 @@ async function inspectInstalledNodeScriptLaunchCandidate(input) {
|
|
|
4828
4846
|
};
|
|
4829
4847
|
} catch (error) {
|
|
4830
4848
|
return {
|
|
4831
|
-
errorMessage: `${input.displayName} is installed, but OpenMeld could not inspect its launch files: ${toErrorMessage$
|
|
4849
|
+
errorMessage: `${input.displayName} is installed, but OpenMeld could not inspect its launch files: ${toErrorMessage$42(error)}`,
|
|
4832
4850
|
ok: false
|
|
4833
4851
|
};
|
|
4834
4852
|
}
|
|
@@ -5256,7 +5274,7 @@ function normalizePathForDetection(path) {
|
|
|
5256
5274
|
function pathIsEqualOrDescendant(path, parentPath) {
|
|
5257
5275
|
return path === parentPath || path.startsWith(`${parentPath}/`);
|
|
5258
5276
|
}
|
|
5259
|
-
function toErrorMessage$
|
|
5277
|
+
function toErrorMessage$42(error) {
|
|
5260
5278
|
return error instanceof Error ? error.message : String(error);
|
|
5261
5279
|
}
|
|
5262
5280
|
//#endregion
|
|
@@ -5534,7 +5552,7 @@ var AcpProcessSession = class {
|
|
|
5534
5552
|
cause: error,
|
|
5535
5553
|
code: "protocol.invalid",
|
|
5536
5554
|
errorType: "adapter",
|
|
5537
|
-
message: `protocol.invalid: ${this.#processLabel} ACP emitted non-JSON-RPC output (${toErrorMessage$
|
|
5555
|
+
message: `protocol.invalid: ${this.#processLabel} ACP emitted non-JSON-RPC output (${toErrorMessage$41(error)})`
|
|
5538
5556
|
}));
|
|
5539
5557
|
return;
|
|
5540
5558
|
}
|
|
@@ -5696,7 +5714,7 @@ function normalizeOptionalText$73(value) {
|
|
|
5696
5714
|
const normalized = String(value ?? "").trim();
|
|
5697
5715
|
return normalized.length > 0 ? normalized : null;
|
|
5698
5716
|
}
|
|
5699
|
-
function toErrorMessage$
|
|
5717
|
+
function toErrorMessage$41(error) {
|
|
5700
5718
|
return error instanceof Error ? error.message : String(error);
|
|
5701
5719
|
}
|
|
5702
5720
|
//#endregion
|
|
@@ -8470,7 +8488,7 @@ async function invokeClaudeWithSingleContextHeal(input) {
|
|
|
8470
8488
|
return new ClaudeRuntimeError({
|
|
8471
8489
|
code: "context.rebuild_failed",
|
|
8472
8490
|
errorType: "adapter",
|
|
8473
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
8491
|
+
message: `context.rebuild_failed: ${toErrorMessage$40(error)}`,
|
|
8474
8492
|
...providerAccessEvidence ? { providerAccessEvidence } : {},
|
|
8475
8493
|
...telemetry ? { telemetry } : {}
|
|
8476
8494
|
});
|
|
@@ -8530,7 +8548,7 @@ async function invokeClaudeOnce(input) {
|
|
|
8530
8548
|
throw new ClaudeRuntimeError({
|
|
8531
8549
|
code: "upstream_unreachable",
|
|
8532
8550
|
errorType: "adapter",
|
|
8533
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
8551
|
+
message: `upstream_unreachable: ${toErrorMessage$40(error)}`
|
|
8534
8552
|
});
|
|
8535
8553
|
}
|
|
8536
8554
|
}
|
|
@@ -8583,7 +8601,7 @@ function getClaudeTelemetry(error) {
|
|
|
8583
8601
|
const telemetry = error.telemetry;
|
|
8584
8602
|
return telemetry && typeof telemetry === "object" ? telemetry : null;
|
|
8585
8603
|
}
|
|
8586
|
-
function toErrorMessage$
|
|
8604
|
+
function toErrorMessage$40(error) {
|
|
8587
8605
|
if (error instanceof Error) return error.message;
|
|
8588
8606
|
return String(error);
|
|
8589
8607
|
}
|
|
@@ -9914,7 +9932,7 @@ var CodexAppServerSession = class {
|
|
|
9914
9932
|
this.#failAll(new CodexAppServerTransportError({
|
|
9915
9933
|
code: "protocol.invalid",
|
|
9916
9934
|
errorType: "adapter",
|
|
9917
|
-
message: `protocol.invalid: codex app-server emitted non-JSON output (${toErrorMessage$
|
|
9935
|
+
message: `protocol.invalid: codex app-server emitted non-JSON output (${toErrorMessage$39(error)})`
|
|
9918
9936
|
}));
|
|
9919
9937
|
return;
|
|
9920
9938
|
}
|
|
@@ -10656,15 +10674,15 @@ function toCodexAppServerTransportError(error, timeoutMs) {
|
|
|
10656
10674
|
errorType: error.errorType,
|
|
10657
10675
|
message: error.message
|
|
10658
10676
|
});
|
|
10659
|
-
if (timeoutMs !== null && toErrorMessage$
|
|
10677
|
+
if (timeoutMs !== null && toErrorMessage$39(error).includes("timed out")) return new CodexAppServerTransportError({
|
|
10660
10678
|
code: "process.timeout",
|
|
10661
10679
|
errorType: "timeout",
|
|
10662
|
-
message: toErrorMessage$
|
|
10680
|
+
message: toErrorMessage$39(error)
|
|
10663
10681
|
});
|
|
10664
10682
|
return new CodexAppServerTransportError({
|
|
10665
10683
|
code: "upstream_unreachable",
|
|
10666
10684
|
errorType: "adapter",
|
|
10667
|
-
message: `upstream_unreachable: failed to execute codex app-server (${toErrorMessage$
|
|
10685
|
+
message: `upstream_unreachable: failed to execute codex app-server (${toErrorMessage$39(error)})`
|
|
10668
10686
|
});
|
|
10669
10687
|
}
|
|
10670
10688
|
function readRequiredText(value, label) {
|
|
@@ -10694,7 +10712,7 @@ function resolveCodexAppServerAuthStatus(input) {
|
|
|
10694
10712
|
if (input.account) return "authenticated";
|
|
10695
10713
|
return input.response?.requiresOpenaiAuth === true ? "unauthenticated" : "unknown";
|
|
10696
10714
|
}
|
|
10697
|
-
function toErrorMessage$
|
|
10715
|
+
function toErrorMessage$39(error) {
|
|
10698
10716
|
if (error instanceof Error) return error.message;
|
|
10699
10717
|
return String(error);
|
|
10700
10718
|
}
|
|
@@ -10752,7 +10770,7 @@ async function verifyCodexLaunchContract(input) {
|
|
|
10752
10770
|
return fileCheck;
|
|
10753
10771
|
} catch (error) {
|
|
10754
10772
|
return {
|
|
10755
|
-
errorMessage: `Codex app-server can't start on this device: ${toErrorMessage$
|
|
10773
|
+
errorMessage: `Codex app-server can't start on this device: ${toErrorMessage$38(error)}`,
|
|
10756
10774
|
failureKind: error instanceof CodexAppServerTransportError && error.errorType === "timeout" ? "incomplete_check" : "completed_negative",
|
|
10757
10775
|
ok: false
|
|
10758
10776
|
};
|
|
@@ -10792,7 +10810,7 @@ async function inspectCodexLaunchCandidate(input) {
|
|
|
10792
10810
|
};
|
|
10793
10811
|
} catch (error) {
|
|
10794
10812
|
return {
|
|
10795
|
-
errorMessage: toErrorMessage$
|
|
10813
|
+
errorMessage: toErrorMessage$38(error),
|
|
10796
10814
|
failureKind: error instanceof CodexAppServerTransportError && error.errorType === "timeout" ? "incomplete_check" : "completed_negative",
|
|
10797
10815
|
ok: false
|
|
10798
10816
|
};
|
|
@@ -10836,7 +10854,7 @@ function resolveCodexControlProbeTimeoutMs(timeoutMs) {
|
|
|
10836
10854
|
if (typeof timeoutMs === "number") return timeoutMs;
|
|
10837
10855
|
return resolveCodexTimeoutMs() ?? CODEX_CONTROL_PROBE_TIMEOUT_MS;
|
|
10838
10856
|
}
|
|
10839
|
-
function toErrorMessage$
|
|
10857
|
+
function toErrorMessage$38(error) {
|
|
10840
10858
|
return error instanceof Error ? error.message : String(error);
|
|
10841
10859
|
}
|
|
10842
10860
|
function normalizeOptionalText$58(value) {
|
|
@@ -11399,7 +11417,7 @@ async function invokeCodexWithSingleContextHeal(input) {
|
|
|
11399
11417
|
createRebuildFailedError: (error) => new CodexRuntimeError({
|
|
11400
11418
|
code: "context.rebuild_failed",
|
|
11401
11419
|
errorType: "adapter",
|
|
11402
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
11420
|
+
message: `context.rebuild_failed: ${toErrorMessage$37(error)}`
|
|
11403
11421
|
}),
|
|
11404
11422
|
invokeOnce: (threadId) => invokeCodexOnce({
|
|
11405
11423
|
agentControllerPermissionMode: input.agentControllerPermissionMode,
|
|
@@ -11438,7 +11456,7 @@ async function invokeCodexAppServer(input) {
|
|
|
11438
11456
|
createRebuildFailedError: (error) => new CodexRuntimeError({
|
|
11439
11457
|
code: "context.rebuild_failed",
|
|
11440
11458
|
errorType: "adapter",
|
|
11441
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
11459
|
+
message: `context.rebuild_failed: ${toErrorMessage$37(error)}`
|
|
11442
11460
|
}),
|
|
11443
11461
|
invokeOnce: (threadId) => invokeCodexAppServerOnceWithAdmissionRetry({
|
|
11444
11462
|
...input,
|
|
@@ -11502,7 +11520,7 @@ function toCodexRuntimeError(error) {
|
|
|
11502
11520
|
return new CodexRuntimeError({
|
|
11503
11521
|
code: "upstream_unreachable",
|
|
11504
11522
|
errorType: "adapter",
|
|
11505
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
11523
|
+
message: `upstream_unreachable: ${toErrorMessage$37(error)}`
|
|
11506
11524
|
});
|
|
11507
11525
|
}
|
|
11508
11526
|
async function invokeCodexOnce(input) {
|
|
@@ -11533,11 +11551,11 @@ async function invokeCodexOnce(input) {
|
|
|
11533
11551
|
throw new CodexRuntimeError({
|
|
11534
11552
|
code: "upstream_unreachable",
|
|
11535
11553
|
errorType: "adapter",
|
|
11536
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
11554
|
+
message: `upstream_unreachable: ${toErrorMessage$37(error)}`
|
|
11537
11555
|
});
|
|
11538
11556
|
}
|
|
11539
11557
|
}
|
|
11540
|
-
function toErrorMessage$
|
|
11558
|
+
function toErrorMessage$37(error) {
|
|
11541
11559
|
if (error instanceof Error) return error.message;
|
|
11542
11560
|
return String(error);
|
|
11543
11561
|
}
|
|
@@ -11890,7 +11908,7 @@ async function interruptCodexActiveAppServerTurn(input) {
|
|
|
11890
11908
|
accepted: false,
|
|
11891
11909
|
plan,
|
|
11892
11910
|
reasonCode: "signal.send_failed",
|
|
11893
|
-
reasonDetail: toErrorMessage$
|
|
11911
|
+
reasonDetail: toErrorMessage$36(error),
|
|
11894
11912
|
signalDelivery: "not_sent",
|
|
11895
11913
|
taskId: input.request.taskId
|
|
11896
11914
|
};
|
|
@@ -11918,7 +11936,7 @@ const normalizeOptionalText$55 = (value) => {
|
|
|
11918
11936
|
const normalized = String(value ?? "").trim();
|
|
11919
11937
|
return normalized.length > 0 ? normalized : null;
|
|
11920
11938
|
};
|
|
11921
|
-
const toErrorMessage$
|
|
11939
|
+
const toErrorMessage$36 = (error) => error instanceof Error ? error.message : String(error);
|
|
11922
11940
|
const isDefaultInvokeDisabledForTests = (options) => options[TEST_DISABLE_DEFAULT_INVOKE] === true;
|
|
11923
11941
|
//#endregion
|
|
11924
11942
|
//#region ../../runtime/adapters/grok-build/dist/config/grok-build-runtime-config.js
|
|
@@ -12797,7 +12815,7 @@ async function emitFinalPreviewIfRequested$1(input) {
|
|
|
12797
12815
|
await input.onPreview({ text: input.output });
|
|
12798
12816
|
}
|
|
12799
12817
|
function toGrokBuildTransportError(error, stderr, diagnostics) {
|
|
12800
|
-
const combined = [toErrorMessage$
|
|
12818
|
+
const combined = [toErrorMessage$35(error), normalizeOptionalText$53(stderr)].filter((value) => value !== null).join("\n");
|
|
12801
12819
|
const providerFailure = !(error instanceof GrokBuildAcpTransportError) || error.code.startsWith("protocol.") ? classifyGrokBuildProviderFailure(combined) : null;
|
|
12802
12820
|
if (providerFailure) return diagnostics ? new GrokBuildAcpTransportError({
|
|
12803
12821
|
cause: error,
|
|
@@ -12863,7 +12881,7 @@ function normalizeOptionalText$53(value) {
|
|
|
12863
12881
|
function toRecord$7(value) {
|
|
12864
12882
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
12865
12883
|
}
|
|
12866
|
-
function toErrorMessage$
|
|
12884
|
+
function toErrorMessage$35(error) {
|
|
12867
12885
|
return error instanceof Error ? error.message : String(error);
|
|
12868
12886
|
}
|
|
12869
12887
|
//#endregion
|
|
@@ -12934,7 +12952,7 @@ function createDefaultGrokBuildInvoke(input) {
|
|
|
12934
12952
|
code: "context.rebuild_failed",
|
|
12935
12953
|
...error instanceof GrokBuildAcpTransportError && error.diagnostics ? { diagnostics: error.diagnostics } : {},
|
|
12936
12954
|
errorType: "adapter",
|
|
12937
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
12955
|
+
message: `context.rebuild_failed: ${toErrorMessage$34(error)}`
|
|
12938
12956
|
}),
|
|
12939
12957
|
invokeOnce: async (sessionId) => {
|
|
12940
12958
|
const transportResult = await invokeGrokBuildAcpTransport({
|
|
@@ -13014,7 +13032,7 @@ async function cancelActiveGrokBuildTurn(input) {
|
|
|
13014
13032
|
return {
|
|
13015
13033
|
accepted: false,
|
|
13016
13034
|
reasonCode: "signal.send_failed",
|
|
13017
|
-
reasonDetail: toErrorMessage$
|
|
13035
|
+
reasonDetail: toErrorMessage$34(error),
|
|
13018
13036
|
signalDelivery: "not_sent",
|
|
13019
13037
|
taskId: input.request.taskId
|
|
13020
13038
|
};
|
|
@@ -13043,7 +13061,7 @@ function normalizeOptionalText$52(value) {
|
|
|
13043
13061
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
13044
13062
|
return normalized.length > 0 ? normalized : null;
|
|
13045
13063
|
}
|
|
13046
|
-
function toErrorMessage$
|
|
13064
|
+
function toErrorMessage$34(error) {
|
|
13047
13065
|
return error instanceof Error ? error.message : String(error);
|
|
13048
13066
|
}
|
|
13049
13067
|
//#endregion
|
|
@@ -14774,7 +14792,7 @@ async function invokeOpenCodeWithSingleContextHeal(input) {
|
|
|
14774
14792
|
createRebuildFailedError: (error) => new OpenCodeRuntimeError({
|
|
14775
14793
|
code: "context.rebuild_failed",
|
|
14776
14794
|
errorType: "adapter",
|
|
14777
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
14795
|
+
message: `context.rebuild_failed: ${toErrorMessage$33(error)}`
|
|
14778
14796
|
}),
|
|
14779
14797
|
invokeOnce: (sessionId) => invokeOpenCodeOnce({
|
|
14780
14798
|
launchContract: input.launchContract,
|
|
@@ -14845,11 +14863,11 @@ async function invokeOpenCodeOnce(input) {
|
|
|
14845
14863
|
throw new OpenCodeRuntimeError({
|
|
14846
14864
|
code: "upstream_unreachable",
|
|
14847
14865
|
errorType: "adapter",
|
|
14848
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
14866
|
+
message: `upstream_unreachable: ${toErrorMessage$33(error)}`
|
|
14849
14867
|
});
|
|
14850
14868
|
}
|
|
14851
14869
|
}
|
|
14852
|
-
function toErrorMessage$
|
|
14870
|
+
function toErrorMessage$33(error) {
|
|
14853
14871
|
if (error instanceof Error) return error.message;
|
|
14854
14872
|
return String(error);
|
|
14855
14873
|
}
|
|
@@ -15161,7 +15179,7 @@ async function mapCodexThread(input) {
|
|
|
15161
15179
|
if (!(nativeSessionId && cwd && lastActiveAtMs !== null)) throw new Error("Codex returned a malformed retained thread record.");
|
|
15162
15180
|
const binding = await resolveObservedAgentActivityBinding(cwd, input.bindings);
|
|
15163
15181
|
if (!binding) return null;
|
|
15164
|
-
const runtimeStatus = isRecord$
|
|
15182
|
+
const runtimeStatus = isRecord$7(input.thread.status) ? text$1(input.thread.status.type) : null;
|
|
15165
15183
|
return {
|
|
15166
15184
|
binding,
|
|
15167
15185
|
session: observedLocalAgentSessionSchema.parse({
|
|
@@ -15205,7 +15223,7 @@ async function listAllCodexThreads(launchContract) {
|
|
|
15205
15223
|
sourceKinds: CODEX_THREAD_SOURCE_KINDS,
|
|
15206
15224
|
useStateDbOnly: false
|
|
15207
15225
|
});
|
|
15208
|
-
if (!(isRecord$
|
|
15226
|
+
if (!(isRecord$7(response) && Array.isArray(response.data) && response.data.every(isRecord$7))) throw new Error("Codex thread/list response is invalid.");
|
|
15209
15227
|
pages.push({
|
|
15210
15228
|
archived,
|
|
15211
15229
|
data: response.data
|
|
@@ -15330,12 +15348,12 @@ function consumeCodexJsonRpcChunk(input) {
|
|
|
15330
15348
|
}
|
|
15331
15349
|
}
|
|
15332
15350
|
function settleCodexJsonRpcResponse(message, pending) {
|
|
15333
|
-
if (!isRecord$
|
|
15351
|
+
if (!isRecord$7(message) || typeof message.id !== "number") return;
|
|
15334
15352
|
const request = pending.get(message.id);
|
|
15335
15353
|
if (!request) return;
|
|
15336
15354
|
pending.delete(message.id);
|
|
15337
15355
|
clearTimeout(request.timer);
|
|
15338
|
-
if (isRecord$
|
|
15356
|
+
if (isRecord$7(message.error)) {
|
|
15339
15357
|
request.reject(new Error(text$1(message.error.message) ?? "Codex app-server request failed."));
|
|
15340
15358
|
return;
|
|
15341
15359
|
}
|
|
@@ -15456,7 +15474,7 @@ function applyClaudeSessionLine(state, line) {
|
|
|
15456
15474
|
} catch (error) {
|
|
15457
15475
|
throw new Error("Claude Code Session file contains malformed JSON.", { cause: error });
|
|
15458
15476
|
}
|
|
15459
|
-
if (!isRecord$
|
|
15477
|
+
if (!isRecord$7(value)) return;
|
|
15460
15478
|
const rowSessionId = text$1(value.sessionId);
|
|
15461
15479
|
if (rowSessionId && state.nativeSessionId !== rowSessionId) {
|
|
15462
15480
|
if (state.nativeSessionId) throw new Error("Claude Code Session file contains conflicting IDs.");
|
|
@@ -15628,12 +15646,12 @@ async function discoverGrokBuildRetainedSessions(input) {
|
|
|
15628
15646
|
const identities = /* @__PURE__ */ new Set();
|
|
15629
15647
|
for (const path of paths) {
|
|
15630
15648
|
const summary = JSON.parse(await readFile(path, "utf8"));
|
|
15631
|
-
if (!isRecord$
|
|
15649
|
+
if (!isRecord$7(summary)) throw new Error("Grok Build summary metadata is invalid.");
|
|
15632
15650
|
const topLevelIdentity = {
|
|
15633
15651
|
cwd: text$1(summary.cwd),
|
|
15634
15652
|
nativeSessionId: text$1(summary.id)
|
|
15635
15653
|
};
|
|
15636
|
-
const nestedInfo = isRecord$
|
|
15654
|
+
const nestedInfo = isRecord$7(summary.info) ? summary.info : null;
|
|
15637
15655
|
const nestedIdentity = {
|
|
15638
15656
|
cwd: text$1(nestedInfo?.cwd),
|
|
15639
15657
|
nativeSessionId: text$1(nestedInfo?.id)
|
|
@@ -15783,7 +15801,7 @@ function mapClaudeAgentStatus(value) {
|
|
|
15783
15801
|
}
|
|
15784
15802
|
function collectRecords(value) {
|
|
15785
15803
|
if (Array.isArray(value)) return value.flatMap(collectRecords);
|
|
15786
|
-
if (!isRecord$
|
|
15804
|
+
if (!isRecord$7(value)) return [];
|
|
15787
15805
|
return [value, ...Object.values(value).flatMap(collectRecords)];
|
|
15788
15806
|
}
|
|
15789
15807
|
function secondsTimestamp(value) {
|
|
@@ -15806,7 +15824,7 @@ function parseCodexNextCursor(value) {
|
|
|
15806
15824
|
function text$1(value) {
|
|
15807
15825
|
return nullableText(value);
|
|
15808
15826
|
}
|
|
15809
|
-
function isRecord$
|
|
15827
|
+
function isRecord$7(value) {
|
|
15810
15828
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
15811
15829
|
}
|
|
15812
15830
|
function isNodeError$4(error, code) {
|
|
@@ -16993,7 +17011,7 @@ async function readAgentActivityIntegrationStatus(paths) {
|
|
|
16993
17011
|
claude: claude !== null && CLAUDE_EVENTS.every((event) => {
|
|
16994
17012
|
try {
|
|
16995
17013
|
const settings = parseSettings(claude);
|
|
16996
|
-
const hooks = isRecord$
|
|
17014
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
16997
17015
|
return Array.isArray(hooks?.[event]) && hooks[event].some((group) => knownArtifacts.some((artifacts) => hasOwnedClaudeHook(group, artifacts)));
|
|
16998
17016
|
} catch {
|
|
16999
17017
|
return false;
|
|
@@ -17003,7 +17021,7 @@ async function readAgentActivityIntegrationStatus(paths) {
|
|
|
17003
17021
|
cursor: cursor !== null && CURSOR_EVENTS.every((event) => {
|
|
17004
17022
|
try {
|
|
17005
17023
|
const settings = parseJsonObject(cursor, "Cursor hooks");
|
|
17006
|
-
const hooks = isRecord$
|
|
17024
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
17007
17025
|
return Array.isArray(hooks?.[event]) && hooks[event].some((entry) => knownArtifacts.some((artifacts) => isOwnedCursorHook(entry, artifacts.cursorCommand)));
|
|
17008
17026
|
} catch {
|
|
17009
17027
|
return false;
|
|
@@ -17058,7 +17076,7 @@ function installCursorHooks(raw, artifacts, knownArtifacts) {
|
|
|
17058
17076
|
}
|
|
17059
17077
|
function uninstallCursorHooks(raw, knownArtifacts) {
|
|
17060
17078
|
const settings = parseJsonObject(raw, "Cursor hooks");
|
|
17061
|
-
const hooks = isRecord$
|
|
17079
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
17062
17080
|
if (!hooks) return raw;
|
|
17063
17081
|
for (const event of CURSOR_EVENTS) {
|
|
17064
17082
|
if (!Array.isArray(hooks[event])) continue;
|
|
@@ -17074,17 +17092,17 @@ function ownedCursorHook(command) {
|
|
|
17074
17092
|
};
|
|
17075
17093
|
}
|
|
17076
17094
|
function isOwnedCursorHook(value, command) {
|
|
17077
|
-
return isRecord$
|
|
17095
|
+
return isRecord$6(value) && Object.keys(value).length === 2 && value.command === command && value.timeout === 10;
|
|
17078
17096
|
}
|
|
17079
17097
|
function isKnownOwnedCursorHook(value, knownArtifacts) {
|
|
17080
17098
|
return knownArtifacts.some((artifacts) => isOwnedCursorHook(value, artifacts.cursorCommand) || isOwnedCursorHook(value, artifacts.legacyCursorCommand));
|
|
17081
17099
|
}
|
|
17082
17100
|
function hasUnknownOpenMeldCursorHook(value, knownArtifacts) {
|
|
17083
|
-
return isRecord$
|
|
17101
|
+
return isRecord$6(value) && typeof value.command === "string" && value.command.includes(" activity hook --provider cursor --owner ") && value.command.includes("openmeld-agent-activity-") && !isKnownOwnedCursorHook(value, knownArtifacts);
|
|
17084
17102
|
}
|
|
17085
17103
|
function uninstallClaudeHooks(raw, knownArtifacts) {
|
|
17086
17104
|
const settings = parseSettings(raw);
|
|
17087
|
-
const hooks = isRecord$
|
|
17105
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
17088
17106
|
if (!hooks) return raw;
|
|
17089
17107
|
for (const event of CLAUDE_EVENTS) {
|
|
17090
17108
|
if (!Array.isArray(hooks[event])) continue;
|
|
@@ -17101,14 +17119,14 @@ function ownedClaudeGroup(artifacts) {
|
|
|
17101
17119
|
}] };
|
|
17102
17120
|
}
|
|
17103
17121
|
function isOwnedClaudeGroup(value, artifacts) {
|
|
17104
|
-
if (!isRecord$
|
|
17105
|
-
return value.hooks.length === 1 && isRecord$
|
|
17122
|
+
if (!isRecord$6(value) || Object.keys(value).length !== 1 || !Array.isArray(value.hooks)) return false;
|
|
17123
|
+
return value.hooks.length === 1 && isRecord$6(value.hooks[0]) && value.hooks[0].command === artifacts.claudeCommand && value.hooks[0].timeout === 10 && value.hooks[0].type === "command" && Object.keys(value.hooks[0]).length === 3;
|
|
17106
17124
|
}
|
|
17107
17125
|
function hasOwnedClaudeHook(value, artifacts) {
|
|
17108
|
-
return isRecord$
|
|
17126
|
+
return isRecord$6(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$6(hook) && hook.command === artifacts.claudeCommand);
|
|
17109
17127
|
}
|
|
17110
17128
|
function hasUnknownOpenMeldClaudeHook(value, knownArtifacts) {
|
|
17111
|
-
return isRecord$
|
|
17129
|
+
return isRecord$6(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$6(hook) && typeof hook.command === "string" && hook.command.includes(" activity hook --provider claude-code --owner ") && hook.command.includes("openmeld-agent-activity-")) && !isKnownOwnedClaudeGroup(value, knownArtifacts);
|
|
17112
17130
|
}
|
|
17113
17131
|
function isLegacyOwnedClaudeGroup(value, artifacts) {
|
|
17114
17132
|
return isOwnedClaudeGroupForCommand(value, artifacts.legacyClaudeCommand);
|
|
@@ -17167,8 +17185,8 @@ function extractCodexTrustState(block, endMarker) {
|
|
|
17167
17185
|
};
|
|
17168
17186
|
}
|
|
17169
17187
|
function isOwnedClaudeGroupForCommand(value, command) {
|
|
17170
|
-
if (!isRecord$
|
|
17171
|
-
return value.hooks.length === 1 && isRecord$
|
|
17188
|
+
if (!isRecord$6(value) || Object.keys(value).length !== 1 || !Array.isArray(value.hooks)) return false;
|
|
17189
|
+
return value.hooks.length === 1 && isRecord$6(value.hooks[0]) && value.hooks[0].command === command && value.hooks[0].timeout === 10 && value.hooks[0].type === "command" && Object.keys(value.hooks[0]).length === 3;
|
|
17172
17190
|
}
|
|
17173
17191
|
async function planPluginInstall(path, artifacts, knownArtifacts) {
|
|
17174
17192
|
const current = await readOptionalFile$1(path);
|
|
@@ -17308,12 +17326,12 @@ function parseSettings(raw) {
|
|
|
17308
17326
|
function parseJsonObject(raw, label) {
|
|
17309
17327
|
if (!raw.trim()) return {};
|
|
17310
17328
|
const value = JSON.parse(raw);
|
|
17311
|
-
if (!isRecord$
|
|
17329
|
+
if (!isRecord$6(value)) throw new Error(`${label} must be a JSON object.`);
|
|
17312
17330
|
return value;
|
|
17313
17331
|
}
|
|
17314
17332
|
function ensureRecord(parent, key, label = "Claude settings") {
|
|
17315
17333
|
if (parent[key] === void 0) parent[key] = {};
|
|
17316
|
-
if (!isRecord$
|
|
17334
|
+
if (!isRecord$6(parent[key])) throw new Error(`${label} ${key} must be an object.`);
|
|
17317
17335
|
return parent[key];
|
|
17318
17336
|
}
|
|
17319
17337
|
function emptyFileFor(path) {
|
|
@@ -17323,7 +17341,7 @@ function revisionConflict(path) {
|
|
|
17323
17341
|
const digest = createHash("sha256").update(path).digest("hex").slice(0, 12);
|
|
17324
17342
|
return /* @__PURE__ */ new Error(`Managed integration revision changed before commit (${digest}).`);
|
|
17325
17343
|
}
|
|
17326
|
-
function isRecord$
|
|
17344
|
+
function isRecord$6(value) {
|
|
17327
17345
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
17328
17346
|
}
|
|
17329
17347
|
function isNodeError$2(error, code) {
|
|
@@ -17940,13 +17958,13 @@ function resolveOpenMeldAccountContext(input) {
|
|
|
17940
17958
|
key: normalizeAccountKey({}),
|
|
17941
17959
|
source: "fallback"
|
|
17942
17960
|
};
|
|
17943
|
-
const normalizedBaseUrl = normalizeOptionalString$
|
|
17961
|
+
const normalizedBaseUrl = normalizeOptionalString$18(session.authBaseUrl);
|
|
17944
17962
|
const hostKey = resolveHostKey(normalizedBaseUrl);
|
|
17945
17963
|
const user = normalizeUser(session.user);
|
|
17946
17964
|
const userKey = user?.id ?? user?.email ?? buildSessionScopedUserKey({
|
|
17947
17965
|
authBaseUrl: normalizedBaseUrl,
|
|
17948
|
-
clientId: normalizeOptionalString$
|
|
17949
|
-
createdAt: normalizeOptionalString$
|
|
17966
|
+
clientId: normalizeOptionalString$18(session.clientId),
|
|
17967
|
+
createdAt: normalizeOptionalString$18(session.createdAt)
|
|
17950
17968
|
});
|
|
17951
17969
|
return {
|
|
17952
17970
|
key: normalizeAccountKey({
|
|
@@ -17959,7 +17977,7 @@ function resolveOpenMeldAccountContext(input) {
|
|
|
17959
17977
|
};
|
|
17960
17978
|
}
|
|
17961
17979
|
async function resolveCurrentOpenMeldAccountContext() {
|
|
17962
|
-
const { getAuthSessionMetadata } = await import("./auth-session-
|
|
17980
|
+
const { getAuthSessionMetadata } = await import("./auth-session-B1jSy0ws.js").then((n) => n.r);
|
|
17963
17981
|
return resolveOpenMeldAccountContext({ session: await getAuthSessionMetadata().catch(() => null) });
|
|
17964
17982
|
}
|
|
17965
17983
|
function resolveHostKey(baseUrl) {
|
|
@@ -17982,9 +18000,9 @@ function buildSessionScopedUserKey(input) {
|
|
|
17982
18000
|
function normalizeUser(value) {
|
|
17983
18001
|
if (!(value && typeof value === "object")) return null;
|
|
17984
18002
|
const record = value;
|
|
17985
|
-
const id = normalizeOptionalString$
|
|
17986
|
-
const email = normalizeOptionalString$
|
|
17987
|
-
const name = normalizeOptionalString$
|
|
18003
|
+
const id = normalizeOptionalString$18(record.id);
|
|
18004
|
+
const email = normalizeOptionalString$18(record.email);
|
|
18005
|
+
const name = normalizeOptionalString$18(record.name);
|
|
17988
18006
|
if (!(id || email || name)) return null;
|
|
17989
18007
|
return {
|
|
17990
18008
|
...id ? { id } : {},
|
|
@@ -17992,7 +18010,7 @@ function normalizeUser(value) {
|
|
|
17992
18010
|
...name ? { name } : {}
|
|
17993
18011
|
};
|
|
17994
18012
|
}
|
|
17995
|
-
function normalizeOptionalString$
|
|
18013
|
+
function normalizeOptionalString$18(value) {
|
|
17996
18014
|
if (typeof value !== "string") return null;
|
|
17997
18015
|
const normalized = value.trim();
|
|
17998
18016
|
return normalized.length > 0 ? normalized : null;
|
|
@@ -18102,9 +18120,9 @@ function createAuthenticationError(input) {
|
|
|
18102
18120
|
return new OpenMeldAuthenticationError(resolveAuthenticationGuidance(input));
|
|
18103
18121
|
}
|
|
18104
18122
|
function resolveAuthenticationGuidance(input) {
|
|
18105
|
-
const action = normalizeOptionalString$
|
|
18106
|
-
const authBaseUrl = normalizeOptionalString$
|
|
18107
|
-
const gatewayUrl = normalizeOptionalString$
|
|
18123
|
+
const action = normalizeOptionalString$17(input.action);
|
|
18124
|
+
const authBaseUrl = normalizeOptionalString$17(input.authBaseUrl);
|
|
18125
|
+
const gatewayUrl = normalizeOptionalString$17(input.gatewayUrl);
|
|
18108
18126
|
if (input.reason === "mismatch") return {
|
|
18109
18127
|
reason: input.reason,
|
|
18110
18128
|
action,
|
|
@@ -18128,7 +18146,7 @@ function resolveAuthenticationGuidance(input) {
|
|
|
18128
18146
|
};
|
|
18129
18147
|
}
|
|
18130
18148
|
function buildCommandAuthenticationPromptMessage$1(action) {
|
|
18131
|
-
const normalizedAction = normalizeOptionalString$
|
|
18149
|
+
const normalizedAction = normalizeOptionalString$17(action);
|
|
18132
18150
|
if (!normalizedAction) return "Sign in is required to continue. What do you want to do?";
|
|
18133
18151
|
return `Sign in is required before ${normalizedAction}. What do you want to do?`;
|
|
18134
18152
|
}
|
|
@@ -18215,7 +18233,7 @@ function resolveAuthenticationGuidanceFromMessage(message) {
|
|
|
18215
18233
|
function extractAuthenticationPromptAction(promptMessage) {
|
|
18216
18234
|
const normalizedMessage = String(promptMessage ?? "").trim();
|
|
18217
18235
|
if (normalizedMessage.length === 0) return null;
|
|
18218
|
-
return normalizeOptionalString$
|
|
18236
|
+
return normalizeOptionalString$17(AUTH_PROMPT_ACTION_RE.exec(normalizedMessage)?.groups?.action);
|
|
18219
18237
|
}
|
|
18220
18238
|
function resolveRequiredAuthenticationGuidance(reason) {
|
|
18221
18239
|
switch (reason) {
|
|
@@ -18295,7 +18313,7 @@ function buildAgentAuthenticationNotes(guidance) {
|
|
|
18295
18313
|
if (guidance.gatewayUrl) notes.push(`Current gateway: ${guidance.gatewayUrl}`);
|
|
18296
18314
|
return notes;
|
|
18297
18315
|
}
|
|
18298
|
-
function normalizeOptionalString$
|
|
18316
|
+
function normalizeOptionalString$17(value) {
|
|
18299
18317
|
const normalized = String(value ?? "").trim();
|
|
18300
18318
|
return normalized.length > 0 ? normalized : null;
|
|
18301
18319
|
}
|
|
@@ -18449,15 +18467,15 @@ function parseLegacySelectionPayload(raw) {
|
|
|
18449
18467
|
try {
|
|
18450
18468
|
const payload = JSON.parse(raw);
|
|
18451
18469
|
if (payload.v !== 1) return null;
|
|
18452
|
-
const sessionId = normalizeOptionalString$
|
|
18453
|
-
const openMeldProfileId = normalizeOptionalString$
|
|
18470
|
+
const sessionId = normalizeOptionalString$16(payload.sessionId);
|
|
18471
|
+
const openMeldProfileId = normalizeOptionalString$16(payload.openMeldProfileId);
|
|
18454
18472
|
if (!(sessionId && openMeldProfileId)) return null;
|
|
18455
18473
|
return {
|
|
18456
18474
|
v: 1,
|
|
18457
18475
|
sessionId,
|
|
18458
|
-
sessionSource: normalizeOptionalString$
|
|
18476
|
+
sessionSource: normalizeOptionalString$16(payload.sessionSource) ?? "manual",
|
|
18459
18477
|
openMeldProfileId,
|
|
18460
|
-
updatedAt: normalizeOptionalString$
|
|
18478
|
+
updatedAt: normalizeOptionalString$16(payload.updatedAt) ?? (/* @__PURE__ */ new Date(0)).toISOString()
|
|
18461
18479
|
};
|
|
18462
18480
|
} catch {
|
|
18463
18481
|
return null;
|
|
@@ -18487,12 +18505,12 @@ function toSafeSessionFile(value) {
|
|
|
18487
18505
|
const maxBaseLength = Math.max(1, SESSION_FILE_MAX_LENGTH - SESSION_FILE_HASH_LENGTH - 1);
|
|
18488
18506
|
return `${safeBase.slice(0, maxBaseLength)}-${hash}`;
|
|
18489
18507
|
}
|
|
18490
|
-
function normalizeOptionalString$
|
|
18508
|
+
function normalizeOptionalString$16(value) {
|
|
18491
18509
|
const normalized = String(value ?? "").trim();
|
|
18492
18510
|
return normalized.length > 0 ? normalized : null;
|
|
18493
18511
|
}
|
|
18494
18512
|
function normalizeRequiredString$1(value, field) {
|
|
18495
|
-
const normalized = normalizeOptionalString$
|
|
18513
|
+
const normalized = normalizeOptionalString$16(value);
|
|
18496
18514
|
if (!normalized) throw new Error(`${field} is required`);
|
|
18497
18515
|
return normalized;
|
|
18498
18516
|
}
|
|
@@ -18588,7 +18606,7 @@ var AuthProfilesApiError = class extends Error {
|
|
|
18588
18606
|
this.name = "AuthProfilesApiError";
|
|
18589
18607
|
this.status = input.status;
|
|
18590
18608
|
this.endpoint = input.endpoint;
|
|
18591
|
-
this.code = normalizeOptionalString$
|
|
18609
|
+
this.code = normalizeOptionalString$15(input.code);
|
|
18592
18610
|
}
|
|
18593
18611
|
};
|
|
18594
18612
|
function isAuthProfilesApiError(error) {
|
|
@@ -18614,13 +18632,13 @@ async function resolveOpenMeldProfile(input) {
|
|
|
18614
18632
|
method: "POST",
|
|
18615
18633
|
path: "/v1/profiles/resolve",
|
|
18616
18634
|
body: {
|
|
18617
|
-
...normalizeOptionalString$
|
|
18635
|
+
...normalizeOptionalString$15(input.openMeldProfileId) ? { openMeldProfileId: normalizeOptionalString$15(input.openMeldProfileId) } : {},
|
|
18618
18636
|
...input.profileKind ? { profileKind: input.profileKind } : {}
|
|
18619
18637
|
}
|
|
18620
18638
|
}), "profile"));
|
|
18621
18639
|
}
|
|
18622
18640
|
async function resolveOpenMeldProfileByIdOrName(input) {
|
|
18623
|
-
const profileIdentifier = normalizeOptionalString$
|
|
18641
|
+
const profileIdentifier = normalizeOptionalString$15(input.profileIdentifier);
|
|
18624
18642
|
if (!profileIdentifier) throw new Error("profile identifier is required");
|
|
18625
18643
|
try {
|
|
18626
18644
|
return await resolveOpenMeldProfile({
|
|
@@ -18639,8 +18657,8 @@ async function resolveOpenMeldProfileByIdOrName(input) {
|
|
|
18639
18657
|
}
|
|
18640
18658
|
}
|
|
18641
18659
|
function createOpenMeldAgentProfile(input) {
|
|
18642
|
-
const profileName = normalizeOptionalString$
|
|
18643
|
-
const creatorProfileId = normalizeOptionalString$
|
|
18660
|
+
const profileName = normalizeOptionalString$15(input.profileName);
|
|
18661
|
+
const creatorProfileId = normalizeOptionalString$15(input.creatorProfileId) ?? void 0;
|
|
18644
18662
|
if (!profileName) throw new Error("profile name is required");
|
|
18645
18663
|
return createOpenMeldAgentProfileRequest({
|
|
18646
18664
|
profileName,
|
|
@@ -18648,8 +18666,8 @@ function createOpenMeldAgentProfile(input) {
|
|
|
18648
18666
|
});
|
|
18649
18667
|
}
|
|
18650
18668
|
async function createOpenMeldHumanProfile(input) {
|
|
18651
|
-
const profileName = normalizeOptionalString$
|
|
18652
|
-
const creatorProfileId = normalizeOptionalString$
|
|
18669
|
+
const profileName = normalizeOptionalString$15(input.profileName);
|
|
18670
|
+
const creatorProfileId = normalizeOptionalString$15(input.creatorProfileId) ?? void 0;
|
|
18653
18671
|
if (!profileName) throw new Error("profile name is required");
|
|
18654
18672
|
try {
|
|
18655
18673
|
assertAdditionalHumanProfileCreationEnabled(await getOpenMeldProfileCapabilities());
|
|
@@ -18672,9 +18690,9 @@ async function createOpenMeldHumanProfile(input) {
|
|
|
18672
18690
|
return created;
|
|
18673
18691
|
}
|
|
18674
18692
|
async function updateOpenMeldProfile(input) {
|
|
18675
|
-
const openMeldProfileId = normalizeOptionalString$
|
|
18693
|
+
const openMeldProfileId = normalizeOptionalString$15(input.openMeldProfileId);
|
|
18676
18694
|
if (!openMeldProfileId) throw new Error("openMeldProfileId is required");
|
|
18677
|
-
const profileName = normalizeOptionalString$
|
|
18695
|
+
const profileName = normalizeOptionalString$15(input.profileName);
|
|
18678
18696
|
if (!Boolean(profileName)) throw new Error("profileName is required");
|
|
18679
18697
|
const updated = parseOpenMeldProfileItem(readRecordField(await requestOpenMeldProfilesApi({
|
|
18680
18698
|
method: "PATCH",
|
|
@@ -18685,7 +18703,7 @@ async function updateOpenMeldProfile(input) {
|
|
|
18685
18703
|
return updated;
|
|
18686
18704
|
}
|
|
18687
18705
|
async function deleteOpenMeldProfile(input) {
|
|
18688
|
-
const openMeldProfileId = normalizeOptionalString$
|
|
18706
|
+
const openMeldProfileId = normalizeOptionalString$15(input.openMeldProfileId);
|
|
18689
18707
|
if (!openMeldProfileId) throw new Error("openMeldProfileId is required");
|
|
18690
18708
|
const deleted = parseOpenMeldProfileItem(readRecordField(await requestOpenMeldProfilesApi({
|
|
18691
18709
|
method: "DELETE",
|
|
@@ -18696,7 +18714,7 @@ async function deleteOpenMeldProfile(input) {
|
|
|
18696
18714
|
}
|
|
18697
18715
|
async function requestOpenMeldProfilesApi(input) {
|
|
18698
18716
|
const session = await requireOpenMeldProfilesSession();
|
|
18699
|
-
const endpoint = toAuthEndpoint$
|
|
18717
|
+
const endpoint = toAuthEndpoint$4(session.authBaseUrl, input.path);
|
|
18700
18718
|
const response = await fetch(endpoint, {
|
|
18701
18719
|
method: input.method,
|
|
18702
18720
|
headers: {
|
|
@@ -18706,7 +18724,7 @@ async function requestOpenMeldProfilesApi(input) {
|
|
|
18706
18724
|
...input.body ? { body: JSON.stringify(input.body) } : {},
|
|
18707
18725
|
signal: AbortSignal.timeout(resolveOpenMeldProfilesApiTimeoutMs(endpoint))
|
|
18708
18726
|
});
|
|
18709
|
-
const payload = await parseResponseJson$
|
|
18727
|
+
const payload = await parseResponseJson$3(response);
|
|
18710
18728
|
if (!response.ok) {
|
|
18711
18729
|
const parsedError = profileErrorResponseSchema.safeParse(payload);
|
|
18712
18730
|
const status = response.status;
|
|
@@ -18727,7 +18745,7 @@ async function requestOpenMeldProfilesApi(input) {
|
|
|
18727
18745
|
})
|
|
18728
18746
|
});
|
|
18729
18747
|
}
|
|
18730
|
-
const record = isRecord$
|
|
18748
|
+
const record = isRecord$5(payload) ? payload : {};
|
|
18731
18749
|
if (!readBooleanField(record, "ok")) {
|
|
18732
18750
|
const parsedError = profileErrorResponseSchema.safeParse(payload);
|
|
18733
18751
|
const code = parsedError.success ? parsedError.data.code : null;
|
|
@@ -18808,8 +18826,8 @@ async function emitRouteCatalogSync(reason) {
|
|
|
18808
18826
|
await touchDaemonCatalogSyncSignal({ reason }).catch(() => void 0);
|
|
18809
18827
|
}
|
|
18810
18828
|
function parseOpenMeldProfileItem(value) {
|
|
18811
|
-
const record = isRecord$
|
|
18812
|
-
const openMeldProfileId = readOptionalStringField
|
|
18829
|
+
const record = isRecord$5(value) ? value : {};
|
|
18830
|
+
const openMeldProfileId = readOptionalStringField(record, "openMeldProfileId");
|
|
18813
18831
|
if (!openMeldProfileId) throw new Error("invalid profile payload: missing openMeldProfileId");
|
|
18814
18832
|
const profileName = readRequiredStringField(record, "profileName");
|
|
18815
18833
|
const profileHandle = readRequiredStringField(record, "profileHandle");
|
|
@@ -18817,14 +18835,14 @@ function parseOpenMeldProfileItem(value) {
|
|
|
18817
18835
|
const isDefault = readOptionalBooleanField(record, "isDefault") ?? false;
|
|
18818
18836
|
const status = readProfileStatus(record, "status");
|
|
18819
18837
|
const ownerUserId = readRequiredStringField(record, "ownerUserId");
|
|
18820
|
-
const ownerName = readOptionalStringField
|
|
18838
|
+
const ownerName = readOptionalStringField(record, "ownerName") ?? void 0;
|
|
18821
18839
|
const source = readRequiredStringField(record, "source");
|
|
18822
18840
|
const managedRole = readOptionalManagedRoleField(record, "managedRole");
|
|
18823
|
-
const createdByUserId = readOptionalStringField
|
|
18824
|
-
const defaultProjectId = readOptionalStringField
|
|
18825
|
-
const creationActorProfileId = readOptionalStringField
|
|
18826
|
-
const creatorProfileId = readOptionalStringField
|
|
18827
|
-
const lastUsedAt = readOptionalStringField
|
|
18841
|
+
const createdByUserId = readOptionalStringField(record, "createdByUserId") ?? null;
|
|
18842
|
+
const defaultProjectId = readOptionalStringField(record, "defaultProjectId");
|
|
18843
|
+
const creationActorProfileId = readOptionalStringField(record, "creationActorProfileId") ?? null;
|
|
18844
|
+
const creatorProfileId = readOptionalStringField(record, "creatorProfileId") ?? null;
|
|
18845
|
+
const lastUsedAt = readOptionalStringField(record, "lastUsedAt");
|
|
18828
18846
|
const createdAt = readRequiredStringField(record, "createdAt");
|
|
18829
18847
|
const updatedAt = readRequiredStringField(record, "updatedAt");
|
|
18830
18848
|
return {
|
|
@@ -18858,7 +18876,7 @@ function readProfileStatus(input, field) {
|
|
|
18858
18876
|
throw new Error(`invalid profile payload: unsupported ${field}`);
|
|
18859
18877
|
}
|
|
18860
18878
|
function readOptionalManagedRoleField(input, field) {
|
|
18861
|
-
const value = readOptionalStringField
|
|
18879
|
+
const value = readOptionalStringField(input, field);
|
|
18862
18880
|
if (!value) return null;
|
|
18863
18881
|
const parsed = authProfileManagedRoleSchema.safeParse(value);
|
|
18864
18882
|
if (parsed.success) return parsed.data;
|
|
@@ -18866,21 +18884,21 @@ function readOptionalManagedRoleField(input, field) {
|
|
|
18866
18884
|
}
|
|
18867
18885
|
function readRecordField(input, field) {
|
|
18868
18886
|
const value = input[field];
|
|
18869
|
-
if (isRecord$
|
|
18887
|
+
if (isRecord$5(value)) return value;
|
|
18870
18888
|
throw new Error(`invalid api payload: missing ${field}`);
|
|
18871
18889
|
}
|
|
18872
18890
|
function readArrayField(input, field) {
|
|
18873
18891
|
const value = input[field];
|
|
18874
18892
|
if (!Array.isArray(value)) throw new Error(`invalid api payload: missing ${field}`);
|
|
18875
|
-
return value.filter(isRecord$
|
|
18893
|
+
return value.filter(isRecord$5);
|
|
18876
18894
|
}
|
|
18877
18895
|
function readRequiredStringField(input, field) {
|
|
18878
|
-
const value = normalizeOptionalString$
|
|
18896
|
+
const value = normalizeOptionalString$15(input[field]);
|
|
18879
18897
|
if (!value) throw new Error(`invalid profile payload: missing ${field}`);
|
|
18880
18898
|
return value;
|
|
18881
18899
|
}
|
|
18882
|
-
function readOptionalStringField
|
|
18883
|
-
return normalizeOptionalString$
|
|
18900
|
+
function readOptionalStringField(input, field) {
|
|
18901
|
+
return normalizeOptionalString$15(input[field]);
|
|
18884
18902
|
}
|
|
18885
18903
|
function readBooleanField(input, field) {
|
|
18886
18904
|
return input[field] === true;
|
|
@@ -18890,7 +18908,7 @@ function readOptionalBooleanField(input, field) {
|
|
|
18890
18908
|
if (typeof value === "boolean") return value;
|
|
18891
18909
|
return null;
|
|
18892
18910
|
}
|
|
18893
|
-
function normalizeOptionalString$
|
|
18911
|
+
function normalizeOptionalString$15(value) {
|
|
18894
18912
|
const normalized = String(value ?? "").trim();
|
|
18895
18913
|
return normalized.length > 0 ? normalized : null;
|
|
18896
18914
|
}
|
|
@@ -18898,14 +18916,14 @@ function normalizeTokenType(tokenType) {
|
|
|
18898
18916
|
const normalized = tokenType.trim();
|
|
18899
18917
|
return normalized.length > 0 ? normalized : "Bearer";
|
|
18900
18918
|
}
|
|
18901
|
-
function toAuthEndpoint$
|
|
18919
|
+
function toAuthEndpoint$4(baseUrl, pathname) {
|
|
18902
18920
|
const url = new URL(baseUrl);
|
|
18903
18921
|
url.pathname = pathname;
|
|
18904
18922
|
url.search = "";
|
|
18905
18923
|
url.hash = "";
|
|
18906
18924
|
return url.toString();
|
|
18907
18925
|
}
|
|
18908
|
-
async function parseResponseJson$
|
|
18926
|
+
async function parseResponseJson$3(response) {
|
|
18909
18927
|
const raw = await response.text();
|
|
18910
18928
|
if (!raw) return null;
|
|
18911
18929
|
try {
|
|
@@ -18915,8 +18933,8 @@ async function parseResponseJson$1(response) {
|
|
|
18915
18933
|
}
|
|
18916
18934
|
}
|
|
18917
18935
|
function extractApiErrorMessage$1(payload, status) {
|
|
18918
|
-
const record = isRecord$
|
|
18919
|
-
const message = normalizeOptionalString$
|
|
18936
|
+
const record = isRecord$5(payload) ? payload : {};
|
|
18937
|
+
const message = normalizeOptionalString$15(record.message) ?? normalizeOptionalString$15(record.error_description) ?? normalizeOptionalString$15(record.error);
|
|
18920
18938
|
if (message) return message;
|
|
18921
18939
|
return `request failed with status ${status}`;
|
|
18922
18940
|
}
|
|
@@ -18953,7 +18971,7 @@ function isHostedProfilesEndpoint(endpoint) {
|
|
|
18953
18971
|
const url = parseUrlOrNull$1(endpoint);
|
|
18954
18972
|
return Boolean(url && !isLoopbackHostname$2(url.hostname) && url.pathname.startsWith("/v1/profiles"));
|
|
18955
18973
|
}
|
|
18956
|
-
function isRecord$
|
|
18974
|
+
function isRecord$5(value) {
|
|
18957
18975
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
18958
18976
|
}
|
|
18959
18977
|
//#endregion
|
|
@@ -18970,7 +18988,7 @@ function isSelectedOpenMeldProfileRequiredError(error) {
|
|
|
18970
18988
|
return error.message.startsWith(PROFILE_REQUIRED_ERROR_PREFIX) && error.message.endsWith(PROFILE_REQUIRED_ERROR_SUFFIX);
|
|
18971
18989
|
}
|
|
18972
18990
|
async function resolveOpenMeldProfileOrNull(input = {}) {
|
|
18973
|
-
const explicitOpenMeldProfileId = normalizeOptionalString$
|
|
18991
|
+
const explicitOpenMeldProfileId = normalizeOptionalString$14(input.openMeldProfileId);
|
|
18974
18992
|
if (explicitOpenMeldProfileId) return await resolveExplicitOpenMeldProfile(explicitOpenMeldProfileId, {
|
|
18975
18993
|
profileKind: input.profileKind,
|
|
18976
18994
|
allowUnauthenticated: input.allowUnauthenticated === true,
|
|
@@ -19043,7 +19061,7 @@ async function resolveSelectedOpenMeldProfile(selectedOpenMeldProfileId, input)
|
|
|
19043
19061
|
throw error;
|
|
19044
19062
|
}
|
|
19045
19063
|
}
|
|
19046
|
-
function normalizeOptionalString$
|
|
19064
|
+
function normalizeOptionalString$14(value) {
|
|
19047
19065
|
const normalized = String(value ?? "").trim();
|
|
19048
19066
|
return normalized.length > 0 ? normalized : null;
|
|
19049
19067
|
}
|
|
@@ -19057,13 +19075,13 @@ function isProfileMissingError(error) {
|
|
|
19057
19075
|
//#endregion
|
|
19058
19076
|
//#region src/config/view-profile-key.ts
|
|
19059
19077
|
async function resolveViewProfileKey(inputProfile) {
|
|
19060
|
-
const explicit = normalizeOptionalString$
|
|
19078
|
+
const explicit = normalizeOptionalString$13(inputProfile);
|
|
19061
19079
|
if (explicit) return (await resolveOpenMeldProfileByIdOrName({ profileIdentifier: explicit }).catch(() => null))?.openMeldProfileId ?? explicit;
|
|
19062
19080
|
const selected = await getSelectedOpenMeldProfileId();
|
|
19063
19081
|
if (selected) return selected;
|
|
19064
19082
|
return null;
|
|
19065
19083
|
}
|
|
19066
|
-
function normalizeOptionalString$
|
|
19084
|
+
function normalizeOptionalString$13(value) {
|
|
19067
19085
|
const normalized = String(value ?? "").trim();
|
|
19068
19086
|
return normalized.length > 0 ? normalized : null;
|
|
19069
19087
|
}
|
|
@@ -19500,8 +19518,8 @@ function splitSentences(message) {
|
|
|
19500
19518
|
var package_default = {
|
|
19501
19519
|
$schema: "https://www.schemastore.org/package.json",
|
|
19502
19520
|
name: "openmeld",
|
|
19503
|
-
version: "0.3.
|
|
19504
|
-
openMeldReleaseDate: "2026-08-
|
|
19521
|
+
version: "0.3.128",
|
|
19522
|
+
openMeldReleaseDate: "2026-08-29",
|
|
19505
19523
|
description: "OpenMeld CLI - https://openmeld.ai",
|
|
19506
19524
|
license: "MIT",
|
|
19507
19525
|
type: "module",
|
|
@@ -19700,7 +19718,7 @@ function warnDaemonEvent(eventName, fields) {
|
|
|
19700
19718
|
const definedFields = Object.fromEntries(Object.entries(fields).filter((entry) => entry[1] !== void 0));
|
|
19701
19719
|
console.warn(`${nowIsoString()} ${eventName} ${JSON.stringify(definedFields)}`);
|
|
19702
19720
|
}
|
|
19703
|
-
const toErrorMessage$
|
|
19721
|
+
const toErrorMessage$32 = toErrorMessage$43;
|
|
19704
19722
|
function dirnamePath(path) {
|
|
19705
19723
|
const lastSlash = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
|
19706
19724
|
if (lastSlash <= 0) return ".";
|
|
@@ -19726,7 +19744,7 @@ var DaemonServiceRunError = class extends Error {
|
|
|
19726
19744
|
//#region src/local-service/state/runtime-contract-guard.ts
|
|
19727
19745
|
const RUNTIME_CONTRACT_META_SCHEMA = "daemon.runtime.contract.meta";
|
|
19728
19746
|
const RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA = "daemon.runtime.contract.repair.report";
|
|
19729
|
-
const isRecord$
|
|
19747
|
+
const isRecord$4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19730
19748
|
const createRuntimeContractMeta = (input) => ({
|
|
19731
19749
|
schema: RUNTIME_CONTRACT_META_SCHEMA,
|
|
19732
19750
|
v: 1,
|
|
@@ -19746,7 +19764,7 @@ const createRuntimeContractRepairReport = (input) => ({
|
|
|
19746
19764
|
errorMessage: input.errorMessage
|
|
19747
19765
|
});
|
|
19748
19766
|
const parseRuntimeContractMeta = (value) => {
|
|
19749
|
-
if (!isRecord$
|
|
19767
|
+
if (!isRecord$4(value)) return null;
|
|
19750
19768
|
if (value.schema !== RUNTIME_CONTRACT_META_SCHEMA || value.v !== 1) return null;
|
|
19751
19769
|
const contractEpoch = normalizeOptionalText$46(value.contractEpoch);
|
|
19752
19770
|
const updatedAt = normalizeOptionalText$46(value.updatedAt);
|
|
@@ -19759,7 +19777,7 @@ const parseRuntimeContractMeta = (value) => {
|
|
|
19759
19777
|
};
|
|
19760
19778
|
};
|
|
19761
19779
|
const parseRuntimeContractRepairReport = (value) => {
|
|
19762
|
-
if (!isRecord$
|
|
19780
|
+
if (!isRecord$4(value)) return null;
|
|
19763
19781
|
if (value.schema !== RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA || value.v !== 1) return null;
|
|
19764
19782
|
const status = value.status;
|
|
19765
19783
|
const reason = value.reason;
|
|
@@ -19905,7 +19923,7 @@ const backupAndCleanRuntimeState = async (input) => {
|
|
|
19905
19923
|
appliedAt: input.nowIso,
|
|
19906
19924
|
backupPaths,
|
|
19907
19925
|
cleanedPaths,
|
|
19908
|
-
errorMessage: toErrorMessage$
|
|
19926
|
+
errorMessage: toErrorMessage$32(error),
|
|
19909
19927
|
fromEpoch: input.fromEpoch,
|
|
19910
19928
|
reason: input.reason,
|
|
19911
19929
|
status: "failed",
|
|
@@ -19995,7 +20013,7 @@ async function resolveDaemonRuntimeContractCompatibility(input) {
|
|
|
19995
20013
|
observedEpoch: null,
|
|
19996
20014
|
updatedAt: null,
|
|
19997
20015
|
reasonCode: "daemon.runtime_contract.unavailable",
|
|
19998
|
-
errorMessage: toErrorMessage$
|
|
20016
|
+
errorMessage: toErrorMessage$32(error)
|
|
19999
20017
|
};
|
|
20000
20018
|
}
|
|
20001
20019
|
if (!meta) return {
|
|
@@ -20218,7 +20236,7 @@ async function requestLatestPackageInfo(packageName) {
|
|
|
20218
20236
|
minRequiredCliVersion: readMinRequiredCliVersion(parsed.openmeld)
|
|
20219
20237
|
};
|
|
20220
20238
|
} catch (error) {
|
|
20221
|
-
throw new Error(`version check failed: invalid registry response: ${toErrorMessage$
|
|
20239
|
+
throw new Error(`version check failed: invalid registry response: ${toErrorMessage$31(error)}`);
|
|
20222
20240
|
}
|
|
20223
20241
|
}
|
|
20224
20242
|
const CLI_BINARY_MANIFEST_URL = toNonEmptyString(process$1.env.OPENMELD_CLI_BINARY_MANIFEST_URL) ?? "https://openmeld.ai/cli/manifest.json";
|
|
@@ -20239,7 +20257,7 @@ async function requestCliBinaryManifest() {
|
|
|
20239
20257
|
try {
|
|
20240
20258
|
return parseCliBinaryManifest(raw);
|
|
20241
20259
|
} catch (error) {
|
|
20242
|
-
throw new Error(`version check failed: invalid CLI manifest response: ${toErrorMessage$
|
|
20260
|
+
throw new Error(`version check failed: invalid CLI manifest response: ${toErrorMessage$31(error)}`);
|
|
20243
20261
|
}
|
|
20244
20262
|
}
|
|
20245
20263
|
function parseCliBinaryManifest(raw) {
|
|
@@ -20325,7 +20343,7 @@ function toNonEmptyString(value) {
|
|
|
20325
20343
|
const normalized = value.trim();
|
|
20326
20344
|
return normalized.length > 0 ? normalized : null;
|
|
20327
20345
|
}
|
|
20328
|
-
function toErrorMessage$
|
|
20346
|
+
function toErrorMessage$31(error) {
|
|
20329
20347
|
if (error instanceof Error) return error.message;
|
|
20330
20348
|
return String(error);
|
|
20331
20349
|
}
|
|
@@ -26060,7 +26078,7 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
|
|
|
26060
26078
|
errorType: error.errorType,
|
|
26061
26079
|
message: error.message
|
|
26062
26080
|
});
|
|
26063
|
-
const classified = classifyCursorFailure([toErrorMessage$
|
|
26081
|
+
const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$42(stderr)].filter((value) => value !== null).join("\n"));
|
|
26064
26082
|
return diagnostics ? new CursorAcpTransportError({
|
|
26065
26083
|
code: classified.code,
|
|
26066
26084
|
diagnostics,
|
|
@@ -26107,7 +26125,7 @@ function normalizeOptionalText$42(value) {
|
|
|
26107
26125
|
function toRecord$4(value) {
|
|
26108
26126
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
26109
26127
|
}
|
|
26110
|
-
function toErrorMessage$
|
|
26128
|
+
function toErrorMessage$30(error) {
|
|
26111
26129
|
return error instanceof Error ? error.message : String(error);
|
|
26112
26130
|
}
|
|
26113
26131
|
//#endregion
|
|
@@ -26208,7 +26226,7 @@ function createDefaultCursorInvoke(input) {
|
|
|
26208
26226
|
code: "context.rebuild_failed",
|
|
26209
26227
|
...error instanceof CursorAcpTransportError && error.diagnostics ? { diagnostics: error.diagnostics } : {},
|
|
26210
26228
|
errorType: "adapter",
|
|
26211
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
26229
|
+
message: `context.rebuild_failed: ${toErrorMessage$29(error)}`
|
|
26212
26230
|
}),
|
|
26213
26231
|
invokeOnce: async (sessionId) => {
|
|
26214
26232
|
const transportResult = await invokeCursorAcpTransport({
|
|
@@ -26287,7 +26305,7 @@ async function cancelActiveCursorTurn(input) {
|
|
|
26287
26305
|
return {
|
|
26288
26306
|
accepted: false,
|
|
26289
26307
|
reasonCode: "signal.send_failed",
|
|
26290
|
-
reasonDetail: toErrorMessage$
|
|
26308
|
+
reasonDetail: toErrorMessage$29(error),
|
|
26291
26309
|
signalDelivery: "not_sent",
|
|
26292
26310
|
taskId: input.request.taskId
|
|
26293
26311
|
};
|
|
@@ -26321,7 +26339,7 @@ async function interruptActiveCursorTurn(input) {
|
|
|
26321
26339
|
accepted: false,
|
|
26322
26340
|
plan,
|
|
26323
26341
|
reasonCode: "signal.send_failed",
|
|
26324
|
-
reasonDetail: toErrorMessage$
|
|
26342
|
+
reasonDetail: toErrorMessage$29(error),
|
|
26325
26343
|
signalDelivery: "not_sent",
|
|
26326
26344
|
taskId: input.request.taskId
|
|
26327
26345
|
};
|
|
@@ -26331,7 +26349,7 @@ function normalizeOptionalText$41(value) {
|
|
|
26331
26349
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
26332
26350
|
return normalized.length > 0 ? normalized : null;
|
|
26333
26351
|
}
|
|
26334
|
-
function toErrorMessage$
|
|
26352
|
+
function toErrorMessage$29(error) {
|
|
26335
26353
|
return error instanceof Error ? error.message : String(error);
|
|
26336
26354
|
}
|
|
26337
26355
|
//#endregion
|
|
@@ -26999,7 +27017,7 @@ async function invokeOpenClawWithSingleContextHeal(input) {
|
|
|
26999
27017
|
createRebuildFailedError: (error) => new OpenClawRuntimeError({
|
|
27000
27018
|
code: "context.rebuild_failed",
|
|
27001
27019
|
errorType: "adapter",
|
|
27002
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
27020
|
+
message: `context.rebuild_failed: ${toErrorMessage$28(error)}`
|
|
27003
27021
|
}),
|
|
27004
27022
|
invokeOnce: (sessionId) => invokeOpenClawOnce({
|
|
27005
27023
|
openClawAgentId: input.openClawAgentId,
|
|
@@ -27050,11 +27068,11 @@ async function invokeOpenClawOnce(input) {
|
|
|
27050
27068
|
throw new OpenClawRuntimeError({
|
|
27051
27069
|
code: "upstream_unreachable",
|
|
27052
27070
|
errorType: "adapter",
|
|
27053
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
27071
|
+
message: `upstream_unreachable: ${toErrorMessage$28(error)}`
|
|
27054
27072
|
});
|
|
27055
27073
|
}
|
|
27056
27074
|
}
|
|
27057
|
-
function toErrorMessage$
|
|
27075
|
+
function toErrorMessage$28(error) {
|
|
27058
27076
|
if (error instanceof Error) return error.message;
|
|
27059
27077
|
return String(error);
|
|
27060
27078
|
}
|
|
@@ -27346,7 +27364,7 @@ function toOpenClawGatewayTransportError(error) {
|
|
|
27346
27364
|
});
|
|
27347
27365
|
const stderr = normalizeOptionalText$35(error?.stderr);
|
|
27348
27366
|
const stdout = normalizeOptionalText$35(error?.stdout);
|
|
27349
|
-
return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$
|
|
27367
|
+
return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$27(error));
|
|
27350
27368
|
}
|
|
27351
27369
|
function classifyGatewayFailure(message) {
|
|
27352
27370
|
return new OpenClawGatewayTransportError(classifyOpenClawFailureMessage({ message }));
|
|
@@ -27355,7 +27373,7 @@ function normalizeOptionalText$35(value) {
|
|
|
27355
27373
|
const normalized = String(value ?? "").trim();
|
|
27356
27374
|
return normalized.length > 0 ? normalized : null;
|
|
27357
27375
|
}
|
|
27358
|
-
function toErrorMessage$
|
|
27376
|
+
function toErrorMessage$27(error) {
|
|
27359
27377
|
return error instanceof Error ? error.message : String(error);
|
|
27360
27378
|
}
|
|
27361
27379
|
//#endregion
|
|
@@ -29011,14 +29029,14 @@ const createAuthorityOpenMeldServiceRuntimeId = (input) => {
|
|
|
29011
29029
|
source: RUNTIME_REGISTRY_AUTHORITY_SOURCE
|
|
29012
29030
|
};
|
|
29013
29031
|
};
|
|
29014
|
-
const normalizeOptionalString$
|
|
29032
|
+
const normalizeOptionalString$12 = (value) => {
|
|
29015
29033
|
const normalized = String(value ?? "").trim();
|
|
29016
29034
|
return normalized.length > 0 ? normalized : void 0;
|
|
29017
29035
|
};
|
|
29018
29036
|
const createAgentProfileBindingModelSelection = (input) => {
|
|
29019
|
-
const modelId = normalizeOptionalString$
|
|
29037
|
+
const modelId = normalizeOptionalString$12(input?.modelId);
|
|
29020
29038
|
if (!modelId) return;
|
|
29021
|
-
const reasoningLevel = normalizeOptionalString$
|
|
29039
|
+
const reasoningLevel = normalizeOptionalString$12(input?.reasoningLevel);
|
|
29022
29040
|
return {
|
|
29023
29041
|
modelId,
|
|
29024
29042
|
...reasoningLevel ? { reasoningLevel } : {}
|
|
@@ -31269,7 +31287,7 @@ const INFLIGHT_RETENTION_MS = DEDUPE_RETENTION_MS;
|
|
|
31269
31287
|
const AGENT_CONTEXT_RETENTION_MS = 720 * 60 * 60 * 1e3;
|
|
31270
31288
|
const AGENT_CONTEXT_MAX_ENTRIES = 2e3;
|
|
31271
31289
|
const AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR = "|";
|
|
31272
|
-
const isRecord$
|
|
31290
|
+
const isRecord$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31273
31291
|
const isPositiveInteger = (value) => Number.isInteger(value) && typeof value === "number" && value >= 0;
|
|
31274
31292
|
const isRuntimeTransportMode = (value) => runtimeTransportModeSchema.safeParse(value).success;
|
|
31275
31293
|
const utf8ByteLength = (value) => {
|
|
@@ -31293,7 +31311,7 @@ const utf8ByteLength = (value) => {
|
|
|
31293
31311
|
return byteLength;
|
|
31294
31312
|
};
|
|
31295
31313
|
const toErrorCode = (error) => {
|
|
31296
|
-
if (!isRecord$
|
|
31314
|
+
if (!isRecord$3(error)) return null;
|
|
31297
31315
|
const code = error.code;
|
|
31298
31316
|
if (typeof code !== "string") return null;
|
|
31299
31317
|
return code;
|
|
@@ -31313,7 +31331,7 @@ const buildLegacySpaceScopedAgentContextLookupKey = (input) => [
|
|
|
31313
31331
|
input.runtimeWorkspaceFingerprint
|
|
31314
31332
|
].map(encodeAgentContextLookupKeyPart).join(AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR);
|
|
31315
31333
|
const parseInflightTask = (value) => {
|
|
31316
|
-
if (!isRecord$
|
|
31334
|
+
if (!isRecord$3(value)) return null;
|
|
31317
31335
|
const { bindingKey, firstSeenAtMs, idempotencyKey, output, sequence, taskId } = value;
|
|
31318
31336
|
if (typeof taskId !== "string" || taskId.length === 0 || typeof bindingKey !== "string" || bindingKey.length === 0 || typeof idempotencyKey !== "string" || idempotencyKey.length === 0 || !isPositiveInteger(sequence) || !isPositiveInteger(firstSeenAtMs)) return null;
|
|
31319
31337
|
if (output !== void 0 && (typeof output !== "string" || output.length === 0)) return null;
|
|
@@ -31327,7 +31345,7 @@ const parseInflightTask = (value) => {
|
|
|
31327
31345
|
};
|
|
31328
31346
|
};
|
|
31329
31347
|
const parseAgentContextState = (agentContextLookupKey, value) => {
|
|
31330
|
-
if (!isRecord$
|
|
31348
|
+
if (!isRecord$3(value)) return null;
|
|
31331
31349
|
const { agentControllerConversationId, agentControllerRef, createdAtMs, lastTaskId, spaceId, targetProfileId, transportMode, runtimeWorkspaceFingerprint, updatedAtMs } = value;
|
|
31332
31350
|
const parsedAgentControllerRef = typeof agentControllerRef === "string" ? parseAgentControllerRef$1(agentControllerRef) : null;
|
|
31333
31351
|
if (!isRuntimeTransportMode(transportMode) || typeof agentContextLookupKey !== "string" || agentContextLookupKey.length === 0 || typeof spaceId !== "string" || spaceId.length === 0 || typeof targetProfileId !== "string" || targetProfileId.length === 0 || !parsedAgentControllerRef || typeof runtimeWorkspaceFingerprint !== "string" || runtimeWorkspaceFingerprint.length === 0 || typeof agentControllerConversationId !== "string" || agentControllerConversationId.length === 0 || !isPositiveInteger(createdAtMs) || !isPositiveInteger(updatedAtMs) || typeof lastTaskId !== "string" || lastTaskId.length === 0) return null;
|
|
@@ -31359,7 +31377,7 @@ const parseAgentContextState = (agentContextLookupKey, value) => {
|
|
|
31359
31377
|
};
|
|
31360
31378
|
};
|
|
31361
31379
|
const parseAgentContextLifecycleCounters = (value) => {
|
|
31362
|
-
if (!isRecord$
|
|
31380
|
+
if (!isRecord$3(value)) return null;
|
|
31363
31381
|
const { created, guardBlocked, recreated, reused } = value;
|
|
31364
31382
|
if (!(isPositiveInteger(created) && isPositiveInteger(recreated) && isPositiveInteger(reused) && isPositiveInteger(guardBlocked))) return null;
|
|
31365
31383
|
return {
|
|
@@ -31376,7 +31394,7 @@ const createEmptyAgentContextLifecycleCounters = () => ({
|
|
|
31376
31394
|
reused: 0
|
|
31377
31395
|
});
|
|
31378
31396
|
const parseAgentContextRotationRecord = (value) => {
|
|
31379
|
-
if (!isRecord$
|
|
31397
|
+
if (!isRecord$3(value)) return null;
|
|
31380
31398
|
const { nextAgentControllerConversationId, previousAgentControllerConversationId, rotationAt, rotationReason, rotationTaskId, rotationTriggerErrorCode } = value;
|
|
31381
31399
|
if (typeof previousAgentControllerConversationId !== "string" || previousAgentControllerConversationId.length === 0 || typeof nextAgentControllerConversationId !== "string" || nextAgentControllerConversationId.length === 0 || typeof rotationTriggerErrorCode !== "string" || rotationTriggerErrorCode.length === 0 || typeof rotationReason !== "string" || rotationReason.length === 0 || !isPositiveInteger(rotationAt) || typeof rotationTaskId !== "string" || rotationTaskId.length === 0) return null;
|
|
31382
31400
|
return {
|
|
@@ -31400,7 +31418,7 @@ const parseAgentContextRotationsOrDefault = (value) => {
|
|
|
31400
31418
|
return nextRecords;
|
|
31401
31419
|
};
|
|
31402
31420
|
const parseDedupeFirstSeenByKey = (value) => {
|
|
31403
|
-
if (!isRecord$
|
|
31421
|
+
if (!isRecord$3(value)) return null;
|
|
31404
31422
|
const nextDedupeFirstSeenByKey = {};
|
|
31405
31423
|
for (const [key, firstSeenAtMs] of Object.entries(value)) {
|
|
31406
31424
|
if (!isPositiveInteger(firstSeenAtMs)) return null;
|
|
@@ -31409,7 +31427,7 @@ const parseDedupeFirstSeenByKey = (value) => {
|
|
|
31409
31427
|
return nextDedupeFirstSeenByKey;
|
|
31410
31428
|
};
|
|
31411
31429
|
const parseInflightByTaskId = (value) => {
|
|
31412
|
-
if (!isRecord$
|
|
31430
|
+
if (!isRecord$3(value)) return null;
|
|
31413
31431
|
const nextInflightByTaskId = {};
|
|
31414
31432
|
for (const [taskId, inflightTask] of Object.entries(value)) {
|
|
31415
31433
|
const parsedTask = parseInflightTask(inflightTask);
|
|
@@ -31419,7 +31437,7 @@ const parseInflightByTaskId = (value) => {
|
|
|
31419
31437
|
return nextInflightByTaskId;
|
|
31420
31438
|
};
|
|
31421
31439
|
const parseReplayedTaskIds = (value) => {
|
|
31422
|
-
if (!isRecord$
|
|
31440
|
+
if (!isRecord$3(value)) return null;
|
|
31423
31441
|
const nextReplayedTaskIds = {};
|
|
31424
31442
|
for (const [taskId, replayed] of Object.entries(value)) {
|
|
31425
31443
|
if (replayed !== true) return null;
|
|
@@ -31428,7 +31446,7 @@ const parseReplayedTaskIds = (value) => {
|
|
|
31428
31446
|
return nextReplayedTaskIds;
|
|
31429
31447
|
};
|
|
31430
31448
|
const parseAgentContextByLookupKey = (value) => {
|
|
31431
|
-
if (!isRecord$
|
|
31449
|
+
if (!isRecord$3(value)) return null;
|
|
31432
31450
|
const nextAgentContextByLookupKey = {};
|
|
31433
31451
|
for (const [agentContextLookupKey, rawAgentContextState] of Object.entries(value)) {
|
|
31434
31452
|
const parsedAgentContextState = parseAgentContextState(agentContextLookupKey, rawAgentContextState);
|
|
@@ -31440,7 +31458,7 @@ const parseAgentContextByLookupKey = (value) => {
|
|
|
31440
31458
|
const parseAgentContextLifecycleCountersOrDefault = (value) => parseAgentContextLifecycleCounters(value);
|
|
31441
31459
|
const parseBootstrapExecutionByLookupKey = (value) => {
|
|
31442
31460
|
if (value === void 0) return {};
|
|
31443
|
-
if (!isRecord$
|
|
31461
|
+
if (!isRecord$3(value)) return null;
|
|
31444
31462
|
const nextBootstrapExecutionByLookupKey = {};
|
|
31445
31463
|
for (const [agentContextLookupKey, executionState] of Object.entries(value)) {
|
|
31446
31464
|
const parsedExecutionState = conversationExecutionStateSchema.safeParse(executionState);
|
|
@@ -31451,7 +31469,7 @@ const parseBootstrapExecutionByLookupKey = (value) => {
|
|
|
31451
31469
|
return nextBootstrapExecutionByLookupKey;
|
|
31452
31470
|
};
|
|
31453
31471
|
const parseLedgerStateV1 = (value) => {
|
|
31454
|
-
if (!isRecord$
|
|
31472
|
+
if (!isRecord$3(value)) return null;
|
|
31455
31473
|
const { agentContextRotations, dedupeFirstSeenByKey, inflightByTaskId, replayedTaskIds, agentContextByLookupKey, bootstrapExecutionByLookupKey, agentContextLifecycleCounters, updatedAtMs, v } = value;
|
|
31456
31474
|
if (v !== 1 || !isPositiveInteger(updatedAtMs)) return null;
|
|
31457
31475
|
const nextDedupeFirstSeenByKey = parseDedupeFirstSeenByKey(dedupeFirstSeenByKey);
|
|
@@ -33087,7 +33105,7 @@ function createLocalExecutionSlots(input) {
|
|
|
33087
33105
|
}),
|
|
33088
33106
|
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
33089
33107
|
errorCode: null,
|
|
33090
|
-
errorMessage: toErrorMessage$
|
|
33108
|
+
errorMessage: toErrorMessage$26(error),
|
|
33091
33109
|
result: "failed"
|
|
33092
33110
|
});
|
|
33093
33111
|
}).finally(() => {
|
|
@@ -33202,7 +33220,7 @@ function createLocalExecutionSlots(input) {
|
|
|
33202
33220
|
function buildAttemptKey(dispatchId, attemptId) {
|
|
33203
33221
|
return `${dispatchId}::${attemptId}`;
|
|
33204
33222
|
}
|
|
33205
|
-
function toErrorMessage$
|
|
33223
|
+
function toErrorMessage$26(error) {
|
|
33206
33224
|
if (error instanceof Error && error.message.trim().length > 0) return error.message;
|
|
33207
33225
|
if (typeof error === "string" && error.trim().length > 0) return error;
|
|
33208
33226
|
return "unknown error";
|
|
@@ -37594,7 +37612,7 @@ async function syncDeviceRuntimeStateProjection(input) {
|
|
|
37594
37612
|
});
|
|
37595
37613
|
const registeredCustomTargetIds = await loadRegisteredCustomTargetIds();
|
|
37596
37614
|
const targetStates = await listAgentTargetStates().catch((error) => {
|
|
37597
|
-
throw new Error(`failed to load OpenMeld agent target states: ${toErrorMessage$
|
|
37615
|
+
throw new Error(`failed to load OpenMeld agent target states: ${toErrorMessage$25(error)}`);
|
|
37598
37616
|
});
|
|
37599
37617
|
const targetStateById = new Map(targetStates.map((state) => [state.agentId, state]));
|
|
37600
37618
|
const projectedControllerIds = [...projectedControllers.keys()].sort();
|
|
@@ -37670,7 +37688,7 @@ async function loadProjectedControllers(input) {
|
|
|
37670
37688
|
const expectedRoutesResult = await (input.expectedRoutesRead ?? createExpectedRoutesReadSession()).read();
|
|
37671
37689
|
if (expectedRoutesResult.status === "resolved") return collectProjectedControllersFromExpectedRoutes(expectedRoutesResult.response.expectedRoutes);
|
|
37672
37690
|
const profiles = await listOpenMeldProfiles().catch((error) => {
|
|
37673
|
-
throw new Error(`failed to list OpenMeld profiles: ${toErrorMessage$
|
|
37691
|
+
throw new Error(`failed to list OpenMeld profiles: ${toErrorMessage$25(error)}`);
|
|
37674
37692
|
});
|
|
37675
37693
|
return await collectProjectedControllers({
|
|
37676
37694
|
bindingReads: input.bindingReads,
|
|
@@ -37691,7 +37709,7 @@ function collectProjectedControllersFromExpectedRoutes(expectedRoutes) {
|
|
|
37691
37709
|
}
|
|
37692
37710
|
async function loadRegisteredCustomTargetIds() {
|
|
37693
37711
|
const customTargets = await listAgentCustomTargets().catch((error) => {
|
|
37694
|
-
throw new Error(`failed to list OpenMeld custom targets: ${toErrorMessage$
|
|
37712
|
+
throw new Error(`failed to list OpenMeld custom targets: ${toErrorMessage$25(error)}`);
|
|
37695
37713
|
});
|
|
37696
37714
|
return new Set(customTargets.map((target) => target.id));
|
|
37697
37715
|
}
|
|
@@ -37969,7 +37987,7 @@ function emitProjectionEvidence(result) {
|
|
|
37969
37987
|
function normalizeText$2(value) {
|
|
37970
37988
|
return String(value ?? "").trim();
|
|
37971
37989
|
}
|
|
37972
|
-
function toErrorMessage$
|
|
37990
|
+
function toErrorMessage$25(error) {
|
|
37973
37991
|
if (error instanceof Error) return error.message;
|
|
37974
37992
|
return String(error);
|
|
37975
37993
|
}
|
|
@@ -38574,9 +38592,9 @@ function createModelCatalogReadSession(input) {
|
|
|
38574
38592
|
async function readModelCatalogOnce(baseUrl) {
|
|
38575
38593
|
try {
|
|
38576
38594
|
const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
|
|
38577
|
-
import("./dist-
|
|
38578
|
-
import("./base-url-
|
|
38579
|
-
import("./api-client-foundation-
|
|
38595
|
+
import("./dist-BnHChh7U.js").then((n) => n.w),
|
|
38596
|
+
import("./base-url-BtqW4aLS.js").then((n) => n.n),
|
|
38597
|
+
import("./api-client-foundation-eG7A-GEB.js").then((n) => n.t)
|
|
38580
38598
|
]);
|
|
38581
38599
|
if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
|
|
38582
38600
|
const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
|
|
@@ -39192,7 +39210,7 @@ async function repairLocalReplyStateOrThrow(input) {
|
|
|
39192
39210
|
mode: "repair"
|
|
39193
39211
|
});
|
|
39194
39212
|
} catch (error) {
|
|
39195
|
-
const errorMessage = toErrorMessage$
|
|
39213
|
+
const errorMessage = toErrorMessage$32(error);
|
|
39196
39214
|
emitRunLine({
|
|
39197
39215
|
presenter: input.presenter,
|
|
39198
39216
|
code: "daemon.run.projection_sync_failed",
|
|
@@ -39209,7 +39227,7 @@ async function repairLocalReplyStateOrThrow(input) {
|
|
|
39209
39227
|
try {
|
|
39210
39228
|
await syncProfileWorkspaceState({ mode: "repair" });
|
|
39211
39229
|
} catch (error) {
|
|
39212
|
-
const errorMessage = toErrorMessage$
|
|
39230
|
+
const errorMessage = toErrorMessage$32(error);
|
|
39213
39231
|
emitRunLine({
|
|
39214
39232
|
presenter: input.presenter,
|
|
39215
39233
|
code: "daemon.run.profile_workspace_sync_failed",
|
|
@@ -39261,7 +39279,7 @@ async function syncDaemonRouteCatalogState(input) {
|
|
|
39261
39279
|
return {
|
|
39262
39280
|
status: "failed",
|
|
39263
39281
|
reason: "load_failed",
|
|
39264
|
-
errorMessage: toErrorMessage$
|
|
39282
|
+
errorMessage: toErrorMessage$32(error)
|
|
39265
39283
|
};
|
|
39266
39284
|
}
|
|
39267
39285
|
const nextFingerprint = buildRouteCatalogFingerprint(nextCatalog);
|
|
@@ -39274,7 +39292,7 @@ async function syncDaemonRouteCatalogState(input) {
|
|
|
39274
39292
|
return {
|
|
39275
39293
|
status: "failed",
|
|
39276
39294
|
reason: "register_failed",
|
|
39277
|
-
errorMessage: toErrorMessage$
|
|
39295
|
+
errorMessage: toErrorMessage$32(error)
|
|
39278
39296
|
};
|
|
39279
39297
|
}
|
|
39280
39298
|
applyAcceptedLeases({
|
|
@@ -39307,7 +39325,7 @@ async function syncDaemonRouteCatalogState(input) {
|
|
|
39307
39325
|
return {
|
|
39308
39326
|
status: "failed",
|
|
39309
39327
|
reason: "register_failed",
|
|
39310
|
-
errorMessage: toErrorMessage$
|
|
39328
|
+
errorMessage: toErrorMessage$32(error)
|
|
39311
39329
|
};
|
|
39312
39330
|
}
|
|
39313
39331
|
const diff = buildRouteCatalogDiff({
|
|
@@ -39428,7 +39446,7 @@ async function resolveLocalServiceDemand(input) {
|
|
|
39428
39446
|
expectedRoutesRead: input.expectedRoutesRead,
|
|
39429
39447
|
mode: "check"
|
|
39430
39448
|
}).catch(() => null) : input.projection;
|
|
39431
|
-
const ownerUserId = normalizeOptionalString$
|
|
39449
|
+
const ownerUserId = normalizeOptionalString$11(input.ownerUserId);
|
|
39432
39450
|
if (!ownerUserId) return {
|
|
39433
39451
|
decision: "indeterminate",
|
|
39434
39452
|
hasLocalExecutionRoute: false,
|
|
@@ -39466,7 +39484,7 @@ async function resolveLocalServiceDemand(input) {
|
|
|
39466
39484
|
decision: "indeterminate",
|
|
39467
39485
|
hasLocalExecutionRoute: false,
|
|
39468
39486
|
repairableReplyCandidateCount: 0,
|
|
39469
|
-
reason: `failed to load local daemon routes: ${toErrorMessage$
|
|
39487
|
+
reason: `failed to load local daemon routes: ${toErrorMessage$32(error)}`,
|
|
39470
39488
|
localExecutionRouteCount: 0,
|
|
39471
39489
|
projection
|
|
39472
39490
|
};
|
|
@@ -39499,7 +39517,7 @@ async function resolveLocalServiceDemand(input) {
|
|
|
39499
39517
|
function isRepairableSkippedDaemonProfile(skipReason) {
|
|
39500
39518
|
return skipReason === "projection.missing" || skipReason === "workspace.missing";
|
|
39501
39519
|
}
|
|
39502
|
-
function normalizeOptionalString$
|
|
39520
|
+
function normalizeOptionalString$11(value) {
|
|
39503
39521
|
const normalized = String(value ?? "").trim();
|
|
39504
39522
|
return normalized.length > 0 ? normalized : null;
|
|
39505
39523
|
}
|
|
@@ -39963,7 +39981,7 @@ async function runOpenClawJsonCommand(input) {
|
|
|
39963
39981
|
try {
|
|
39964
39982
|
return JSON.parse(stdout);
|
|
39965
39983
|
} catch (error) {
|
|
39966
|
-
throw new Error(`openclaw JSON output could not be parsed: ${toErrorMessage$
|
|
39984
|
+
throw new Error(`openclaw JSON output could not be parsed: ${toErrorMessage$24(error)}`);
|
|
39967
39985
|
}
|
|
39968
39986
|
}
|
|
39969
39987
|
async function runOpenClawCommand(input) {
|
|
@@ -39998,7 +40016,7 @@ function normalizeOptionalText$24(value) {
|
|
|
39998
40016
|
const normalized = String(value ?? "").trim();
|
|
39999
40017
|
return normalized.length > 0 ? normalized : null;
|
|
40000
40018
|
}
|
|
40001
|
-
function toErrorMessage$
|
|
40019
|
+
function toErrorMessage$24(error) {
|
|
40002
40020
|
return error instanceof Error ? error.message : String(error);
|
|
40003
40021
|
}
|
|
40004
40022
|
function isExecFileTimeoutError(error) {
|
|
@@ -40012,7 +40030,7 @@ function resolveOpenClawCliErrorMessage(error, timeoutMs) {
|
|
|
40012
40030
|
const cliMessage = normalizeOptionalText$24(error.stderr) ?? stdout;
|
|
40013
40031
|
if (timeoutMs !== void 0 && isExecFileTimeoutError(error)) return cliMessage ? `openclaw command timed out after ${String(timeoutMs)}ms: ${cliMessage}` : `openclaw command timed out after ${String(timeoutMs)}ms`;
|
|
40014
40032
|
if (cliMessage) return cliMessage;
|
|
40015
|
-
return `openclaw command failed: ${toErrorMessage$
|
|
40033
|
+
return `openclaw command failed: ${toErrorMessage$24(error)}`;
|
|
40016
40034
|
}
|
|
40017
40035
|
function parseOpenClawAgentSummary(value) {
|
|
40018
40036
|
if (!value || typeof value !== "object") return null;
|
|
@@ -40389,7 +40407,7 @@ async function ensureOpenClawGatewayAgentVisible(input, deps = DEFAULT_OPENCLAW_
|
|
|
40389
40407
|
gatewayRestartAttempted: true,
|
|
40390
40408
|
gatewayVisibility: "missing_before_restart"
|
|
40391
40409
|
},
|
|
40392
|
-
message: `OpenClaw gateway restart failed while making agent '${agentId}' visible: ${toErrorMessage$
|
|
40410
|
+
message: `OpenClaw gateway restart failed while making agent '${agentId}' visible: ${toErrorMessage$23(error)}`
|
|
40393
40411
|
});
|
|
40394
40412
|
}
|
|
40395
40413
|
let lastVisibilityError = null;
|
|
@@ -40418,7 +40436,7 @@ async function ensureOpenClawGatewayAgentVisible(input, deps = DEFAULT_OPENCLAW_
|
|
|
40418
40436
|
gatewayRestartAttempted: true,
|
|
40419
40437
|
gatewayVisibility: "missing_after_restart"
|
|
40420
40438
|
},
|
|
40421
|
-
message: lastVisibilityError === null ? `OpenClaw gateway is running but agent '${agentId}' is still not visible after a gateway restart` : `OpenClaw gateway still cannot confirm agent '${agentId}' after a gateway restart: ${toErrorMessage$
|
|
40439
|
+
message: lastVisibilityError === null ? `OpenClaw gateway is running but agent '${agentId}' is still not visible after a gateway restart` : `OpenClaw gateway still cannot confirm agent '${agentId}' after a gateway restart: ${toErrorMessage$23(lastVisibilityError)}`
|
|
40422
40440
|
});
|
|
40423
40441
|
}
|
|
40424
40442
|
async function maybeCopyOpenClawAuth(input) {
|
|
@@ -40459,7 +40477,7 @@ async function ensureParentDirectory(path) {
|
|
|
40459
40477
|
async function pathExists$1(path) {
|
|
40460
40478
|
return await access(path, constants.F_OK).then(() => true).catch(() => false);
|
|
40461
40479
|
}
|
|
40462
|
-
function toErrorMessage$
|
|
40480
|
+
function toErrorMessage$23(error) {
|
|
40463
40481
|
return error instanceof Error ? error.message : String(error);
|
|
40464
40482
|
}
|
|
40465
40483
|
function normalizeBootstrapReadError(error) {
|
|
@@ -40578,7 +40596,7 @@ function assertOpenClawWorkspaceMatch(input) {
|
|
|
40578
40596
|
});
|
|
40579
40597
|
}
|
|
40580
40598
|
function isOpenClawAgentAlreadyExistsError(error) {
|
|
40581
|
-
const normalizedMessage = toErrorMessage$
|
|
40599
|
+
const normalizedMessage = toErrorMessage$23(error).toLowerCase();
|
|
40582
40600
|
return normalizedMessage.includes("agent") && normalizedMessage.includes("already exists");
|
|
40583
40601
|
}
|
|
40584
40602
|
function resolveProviderRuntimeWorkingDirectory(value) {
|
|
@@ -40615,7 +40633,7 @@ async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PRE
|
|
|
40615
40633
|
}).catch((error) => {
|
|
40616
40634
|
throw new DaemonServiceRunError({
|
|
40617
40635
|
code: "controller.bootstrap.failed",
|
|
40618
|
-
message: `controller.bootstrap.failed: ${toErrorMessage$
|
|
40636
|
+
message: `controller.bootstrap.failed: ${toErrorMessage$22(error)}`,
|
|
40619
40637
|
providerErrorCode: extractErrorCode$1(error)
|
|
40620
40638
|
});
|
|
40621
40639
|
});
|
|
@@ -40625,7 +40643,7 @@ async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PRE
|
|
|
40625
40643
|
}).catch((error) => {
|
|
40626
40644
|
throw new DaemonServiceRunError({
|
|
40627
40645
|
code: "controller.gateway.unhealthy",
|
|
40628
|
-
message: `controller.gateway.unhealthy: ${toErrorMessage$
|
|
40646
|
+
message: `controller.gateway.unhealthy: ${toErrorMessage$22(error)}`,
|
|
40629
40647
|
providerErrorCode: extractErrorCode$1(error)
|
|
40630
40648
|
});
|
|
40631
40649
|
});
|
|
@@ -40637,7 +40655,7 @@ async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PRE
|
|
|
40637
40655
|
const gatewayFailure = buildOpenClawGatewayVisibilityFailure(error);
|
|
40638
40656
|
throw new DaemonServiceRunError({
|
|
40639
40657
|
code: "controller.gateway.unhealthy",
|
|
40640
|
-
message: `controller.gateway.unhealthy: ${toErrorMessage$
|
|
40658
|
+
message: `controller.gateway.unhealthy: ${toErrorMessage$22(error)}`,
|
|
40641
40659
|
providerErrorCode: extractErrorCode$1(error),
|
|
40642
40660
|
...gatewayFailure
|
|
40643
40661
|
});
|
|
@@ -40676,7 +40694,7 @@ function resolveOpenClawGatewayVisibilityDiagnostics(error) {
|
|
|
40676
40694
|
gatewayVisibility: parsedGatewayVisibility.data
|
|
40677
40695
|
};
|
|
40678
40696
|
}
|
|
40679
|
-
function toErrorMessage$
|
|
40697
|
+
function toErrorMessage$22(error) {
|
|
40680
40698
|
return error instanceof Error ? error.message : String(error);
|
|
40681
40699
|
}
|
|
40682
40700
|
//#endregion
|
|
@@ -40724,7 +40742,7 @@ function createOpenClawLocalDiagnosticsFailure(error) {
|
|
|
40724
40742
|
return {
|
|
40725
40743
|
errorCode: extractErrorCode(error),
|
|
40726
40744
|
kind: "failed",
|
|
40727
|
-
message: toErrorMessage$
|
|
40745
|
+
message: toErrorMessage$21(error)
|
|
40728
40746
|
};
|
|
40729
40747
|
}
|
|
40730
40748
|
function isOpenClawLocalDiagnosticsFailure(diagnostics) {
|
|
@@ -40808,7 +40826,7 @@ async function resolveInspectModeDiagnostics(input) {
|
|
|
40808
40826
|
openClawBin: input.openClawBin
|
|
40809
40827
|
}).then(() => "healthy").catch((error) => ({
|
|
40810
40828
|
errorCode: extractErrorCode(error),
|
|
40811
|
-
message: toErrorMessage$
|
|
40829
|
+
message: toErrorMessage$21(error)
|
|
40812
40830
|
}));
|
|
40813
40831
|
if (gatewayHealth !== "healthy") return {
|
|
40814
40832
|
...inspected,
|
|
@@ -40888,7 +40906,7 @@ async function resolveInspectGatewayVisibility(input) {
|
|
|
40888
40906
|
return {
|
|
40889
40907
|
errorCode: extractErrorCode(error),
|
|
40890
40908
|
gatewayVisibility: "not_checked",
|
|
40891
|
-
message: toErrorMessage$
|
|
40909
|
+
message: toErrorMessage$21(error)
|
|
40892
40910
|
};
|
|
40893
40911
|
}
|
|
40894
40912
|
}
|
|
@@ -40897,7 +40915,7 @@ function resolveDiagnosticsFailureDetail(input) {
|
|
|
40897
40915
|
const inspectedMessage = typeof input.inspected.message === "string" && input.inspected.message.trim().length > 0 ? input.inspected.message.trim() : null;
|
|
40898
40916
|
return {
|
|
40899
40917
|
errorCode: inspectedErrorCode ?? extractErrorCode(input.error),
|
|
40900
|
-
message: inspectedMessage ?? toErrorMessage$
|
|
40918
|
+
message: inspectedMessage ?? toErrorMessage$21(input.error)
|
|
40901
40919
|
};
|
|
40902
40920
|
}
|
|
40903
40921
|
function resolveDiagnosticsTargetAgent(input) {
|
|
@@ -40958,7 +40976,7 @@ function buildBootstrapDiagnosticStatus(bootstrapStatus, errorCode, message) {
|
|
|
40958
40976
|
}
|
|
40959
40977
|
function resolveExplicitBootstrapDiagnostic(error) {
|
|
40960
40978
|
const explicitErrorCode = extractErrorCode(error);
|
|
40961
|
-
const explicitMessage = error ? toErrorMessage$
|
|
40979
|
+
const explicitMessage = error ? toErrorMessage$21(error) : null;
|
|
40962
40980
|
switch (explicitErrorCode) {
|
|
40963
40981
|
case "openclaw.bootstrap.binding_conflict": return buildBootstrapDiagnosticStatus("binding_conflict", explicitErrorCode, explicitMessage);
|
|
40964
40982
|
case "openclaw.bootstrap.workspace_mismatch": return buildBootstrapDiagnosticStatus("workspace_mismatch", explicitErrorCode, explicitMessage);
|
|
@@ -40978,7 +40996,7 @@ function resolveExistingBootstrapStatus(input) {
|
|
|
40978
40996
|
}
|
|
40979
40997
|
function resolveInvalidBootstrapStatus(input) {
|
|
40980
40998
|
if (input.workspaceAgents.length > 1) return buildBootstrapDiagnosticStatus("workspace_ambiguous", "openclaw.bootstrap.workspace_ambiguous", null);
|
|
40981
|
-
return buildBootstrapDiagnosticStatus("invalid", input.bootstrapRead.error?.code ?? extractErrorCode(input.error), input.bootstrapRead.error?.message ?? (input.error ? toErrorMessage$
|
|
40999
|
+
return buildBootstrapDiagnosticStatus("invalid", input.bootstrapRead.error?.code ?? extractErrorCode(input.error), input.bootstrapRead.error?.message ?? (input.error ? toErrorMessage$21(input.error) : null));
|
|
40982
41000
|
}
|
|
40983
41001
|
function resolveMissingBootstrapStatus(workspaceAgents, input = {}) {
|
|
40984
41002
|
if (workspaceAgents.length > 1) return buildBootstrapDiagnosticStatus("workspace_ambiguous", "openclaw.bootstrap.workspace_ambiguous", null);
|
|
@@ -41022,7 +41040,7 @@ function extractProviderErrorCode(error) {
|
|
|
41022
41040
|
const normalized = String(error.providerErrorCode ?? "").trim();
|
|
41023
41041
|
return normalized.length > 0 ? normalized : null;
|
|
41024
41042
|
}
|
|
41025
|
-
function toErrorMessage$
|
|
41043
|
+
function toErrorMessage$21(error) {
|
|
41026
41044
|
return error instanceof Error ? error.message : String(error);
|
|
41027
41045
|
}
|
|
41028
41046
|
//#endregion
|
|
@@ -41095,9 +41113,9 @@ async function resolveGatewayChainReadiness(input = {}) {
|
|
|
41095
41113
|
applicable: true,
|
|
41096
41114
|
baseUrl: fallbackBaseUrl,
|
|
41097
41115
|
checkedAt,
|
|
41098
|
-
details: toErrorMessage$
|
|
41116
|
+
details: toErrorMessage$44(error),
|
|
41099
41117
|
errorCode: null,
|
|
41100
|
-
errorMessage: toErrorMessage$
|
|
41118
|
+
errorMessage: toErrorMessage$44(error),
|
|
41101
41119
|
failureKind: "gateway_unreachable",
|
|
41102
41120
|
ready: false,
|
|
41103
41121
|
status: null,
|
|
@@ -42185,7 +42203,7 @@ function buildLookupFailedRouteObservationDetail(input) {
|
|
|
42185
42203
|
observedAt: input.observedAt,
|
|
42186
42204
|
reasonCode: "lookup_failed"
|
|
42187
42205
|
});
|
|
42188
|
-
const rawError = toErrorMessage$
|
|
42206
|
+
const rawError = toErrorMessage$20(input.error).trim();
|
|
42189
42207
|
if (rawError.length === 0 || rawError === detail) return detail;
|
|
42190
42208
|
return `${detail} Raw lookup error: ${rawError}`;
|
|
42191
42209
|
}
|
|
@@ -42213,7 +42231,7 @@ function enrichRuntimeStateWithManager(input) {
|
|
|
42213
42231
|
serviceController: input.runtimeState.serviceController === "unknown" && input.serviceManager?.controller !== void 0 ? input.serviceManager.controller : input.runtimeState.serviceController
|
|
42214
42232
|
};
|
|
42215
42233
|
}
|
|
42216
|
-
function toErrorMessage$
|
|
42234
|
+
function toErrorMessage$20(error) {
|
|
42217
42235
|
if (error instanceof Error) return error.message;
|
|
42218
42236
|
return String(error);
|
|
42219
42237
|
}
|
|
@@ -42426,7 +42444,7 @@ async function clearDaemonStartFailureState(pathInput = {}) {
|
|
|
42426
42444
|
await rm(daemonStartFailureStatePath(pathInput), { force: true }).catch(() => void 0);
|
|
42427
42445
|
}
|
|
42428
42446
|
function parseDaemonStartFailureState(value) {
|
|
42429
|
-
if (!isRecord$
|
|
42447
|
+
if (!isRecord$2(value)) return null;
|
|
42430
42448
|
if (value.schema !== DAEMON_START_FAILURE_STATE_SCHEMA || value.v !== 1) return null;
|
|
42431
42449
|
const recordedAt = normalizeOptionalText$46(value.recordedAt);
|
|
42432
42450
|
const detail = normalizeOptionalText$46(value.detail);
|
|
@@ -42449,7 +42467,7 @@ function parseDaemonStartFailureState(value) {
|
|
|
42449
42467
|
function normalizeDependencyIssues(issues) {
|
|
42450
42468
|
const normalized = [];
|
|
42451
42469
|
for (const issue of issues) {
|
|
42452
|
-
if (!isRecord$
|
|
42470
|
+
if (!isRecord$2(issue)) continue;
|
|
42453
42471
|
const kind = issue.kind;
|
|
42454
42472
|
const status = issue.status;
|
|
42455
42473
|
const scope = issue.scope;
|
|
@@ -42468,7 +42486,7 @@ function normalizeDependencyIssues(issues) {
|
|
|
42468
42486
|
}
|
|
42469
42487
|
return normalized;
|
|
42470
42488
|
}
|
|
42471
|
-
function isRecord$
|
|
42489
|
+
function isRecord$2(value) {
|
|
42472
42490
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
42473
42491
|
}
|
|
42474
42492
|
async function writeJsonAtomic(input) {
|
|
@@ -43230,7 +43248,7 @@ async function captureDaemonServiceEvidence(input = {}) {
|
|
|
43230
43248
|
errorMessage: null
|
|
43231
43249
|
})).catch((error) => ({
|
|
43232
43250
|
snapshot: null,
|
|
43233
|
-
errorMessage: toErrorMessage$
|
|
43251
|
+
errorMessage: toErrorMessage$19(error)
|
|
43234
43252
|
})),
|
|
43235
43253
|
captureOwnedProcessesArtifact(phaseRootPath),
|
|
43236
43254
|
captureSystemServiceDiagnosticsArtifact(phaseRootPath)
|
|
@@ -43344,7 +43362,7 @@ async function captureDirectoryArtifact(input) {
|
|
|
43344
43362
|
};
|
|
43345
43363
|
} catch (error) {
|
|
43346
43364
|
return {
|
|
43347
|
-
errorMessage: toErrorMessage$
|
|
43365
|
+
errorMessage: toErrorMessage$19(error),
|
|
43348
43366
|
relativePath: null,
|
|
43349
43367
|
sourcePath: input.sourcePath,
|
|
43350
43368
|
status: "error"
|
|
@@ -43370,7 +43388,7 @@ async function captureFileArtifact(input) {
|
|
|
43370
43388
|
};
|
|
43371
43389
|
} catch (error) {
|
|
43372
43390
|
return {
|
|
43373
|
-
errorMessage: toErrorMessage$
|
|
43391
|
+
errorMessage: toErrorMessage$19(error),
|
|
43374
43392
|
relativePath: null,
|
|
43375
43393
|
sourcePath: input.sourcePath,
|
|
43376
43394
|
status: "error"
|
|
@@ -43392,7 +43410,7 @@ async function captureOwnedProcessesArtifact(evidencePath) {
|
|
|
43392
43410
|
} };
|
|
43393
43411
|
} catch (error) {
|
|
43394
43412
|
return { artifact: {
|
|
43395
|
-
errorMessage: toErrorMessage$
|
|
43413
|
+
errorMessage: toErrorMessage$19(error),
|
|
43396
43414
|
relativePath: null,
|
|
43397
43415
|
sourcePath: null,
|
|
43398
43416
|
status: "error"
|
|
@@ -43499,7 +43517,7 @@ async function runCommand$2(command, args, input = {}) {
|
|
|
43499
43517
|
child.once("close", handleClose);
|
|
43500
43518
|
});
|
|
43501
43519
|
}
|
|
43502
|
-
function toErrorMessage$
|
|
43520
|
+
function toErrorMessage$19(error) {
|
|
43503
43521
|
if (error instanceof Error) return error.message;
|
|
43504
43522
|
return String(error);
|
|
43505
43523
|
}
|
|
@@ -43971,7 +43989,7 @@ var DaemonServiceLifecycleDrainTimeoutError = class extends Error {
|
|
|
43971
43989
|
var DaemonServiceLifecycleControlledDrainError = class extends Error {
|
|
43972
43990
|
cause;
|
|
43973
43991
|
constructor(cause) {
|
|
43974
|
-
super(`controlled service drain failed: ${toErrorMessage$
|
|
43992
|
+
super(`controlled service drain failed: ${toErrorMessage$43(cause)}`);
|
|
43975
43993
|
this.name = "DaemonServiceLifecycleControlledDrainError";
|
|
43976
43994
|
this.cause = cause;
|
|
43977
43995
|
}
|
|
@@ -44135,7 +44153,7 @@ async function runDaemonServiceLifecycle(input) {
|
|
|
44135
44153
|
evidencePath: state.evidencePath,
|
|
44136
44154
|
recoveryStatus: "failed_before_safe_state",
|
|
44137
44155
|
errorCode: resolveLifecycleFailureErrorCode(error),
|
|
44138
|
-
errorMessage: toErrorMessage$
|
|
44156
|
+
errorMessage: toErrorMessage$43(error)
|
|
44139
44157
|
};
|
|
44140
44158
|
} finally {
|
|
44141
44159
|
await cleanupPreparedBundleAfterLifecycle({
|
|
@@ -44171,7 +44189,7 @@ async function cleanupPreparedBundleAfterLifecycle(input) {
|
|
|
44171
44189
|
} catch (error) {
|
|
44172
44190
|
console.warn("[openmeld.daemon_bundle.cleanup_warning]", {
|
|
44173
44191
|
bundleId: input.preparedBundle.bundleId,
|
|
44174
|
-
errorMessage: toErrorMessage$
|
|
44192
|
+
errorMessage: toErrorMessage$43(error),
|
|
44175
44193
|
operation: input.operation
|
|
44176
44194
|
});
|
|
44177
44195
|
}
|
|
@@ -44327,7 +44345,7 @@ async function executeDaemonServiceLifecycle(input) {
|
|
|
44327
44345
|
}
|
|
44328
44346
|
}
|
|
44329
44347
|
async function recoverLifecycleFailure(input) {
|
|
44330
|
-
const originalErrorMessage = toErrorMessage$
|
|
44348
|
+
const originalErrorMessage = toErrorMessage$43(input.error);
|
|
44331
44349
|
const originalErrorCode = resolveLifecycleFailureErrorCode(input.error);
|
|
44332
44350
|
const originalFailureStage = resolveLifecycleFailureStage(input.error, input.state.failureStage);
|
|
44333
44351
|
const originalReasonCodes = resolveLifecycleFailureReasonCodes(input.error);
|
|
@@ -44361,7 +44379,7 @@ async function recoverLifecycleFailure(input) {
|
|
|
44361
44379
|
}).catch((error) => {
|
|
44362
44380
|
verifiedRollbackError = error;
|
|
44363
44381
|
console.warn("[openmeld.daemon_service.verified_rollback_failed]", {
|
|
44364
|
-
errorMessage: toErrorMessage$
|
|
44382
|
+
errorMessage: toErrorMessage$43(error),
|
|
44365
44383
|
failureStage: originalFailureStage,
|
|
44366
44384
|
operation: input.operation,
|
|
44367
44385
|
previousVersion: input.restorePoint.previousInstallState?.daemonVersion ?? null,
|
|
@@ -44386,7 +44404,7 @@ async function recoverLifecycleFailure(input) {
|
|
|
44386
44404
|
errorMessage: originalErrorMessage
|
|
44387
44405
|
};
|
|
44388
44406
|
}
|
|
44389
|
-
const recoveryErrorMessage = verifiedRollbackError ? `${originalErrorMessage}; verified previous Service recovery failed: ${toErrorMessage$
|
|
44407
|
+
const recoveryErrorMessage = verifiedRollbackError ? `${originalErrorMessage}; verified previous Service recovery failed: ${toErrorMessage$43(verifiedRollbackError)}` : originalErrorMessage;
|
|
44390
44408
|
const stoppedSafe = await transitionLifecycleToStoppedSafeCurrentVersion({
|
|
44391
44409
|
commandOptions: input.commandOptions,
|
|
44392
44410
|
currentContract: input.currentContract,
|
|
@@ -44414,7 +44432,7 @@ async function recoverLifecycleFailure(input) {
|
|
|
44414
44432
|
evidencePath: input.state.evidencePath,
|
|
44415
44433
|
recoveryStatus: "failed_before_safe_state",
|
|
44416
44434
|
errorCode: originalErrorCode,
|
|
44417
|
-
errorMessage: `${recoveryErrorMessage}; stopped-safe recovery failed: ${toErrorMessage$
|
|
44435
|
+
errorMessage: `${recoveryErrorMessage}; stopped-safe recovery failed: ${toErrorMessage$43(stoppedSafe.safeStopError)}`
|
|
44418
44436
|
};
|
|
44419
44437
|
}
|
|
44420
44438
|
input.state.runtimeDataBackup = null;
|
|
@@ -44646,7 +44664,7 @@ async function stopLifecycleSystemServiceRuntime(input) {
|
|
|
44646
44664
|
} catch (restoreError) {
|
|
44647
44665
|
throw new DaemonServiceLifecycleStageError({
|
|
44648
44666
|
cause: restoreError,
|
|
44649
|
-
message: `${toErrorMessage$
|
|
44667
|
+
message: `${toErrorMessage$43(drainError)}; failed to restore service autostart: ${toErrorMessage$43(restoreError)}`,
|
|
44650
44668
|
stage: "stop_or_drain"
|
|
44651
44669
|
});
|
|
44652
44670
|
}
|
|
@@ -44701,7 +44719,7 @@ async function requestControlledSystemServiceDrain(input) {
|
|
|
44701
44719
|
observedDaemonVersion
|
|
44702
44720
|
} : {},
|
|
44703
44721
|
...isManagerRunningWithoutRuntime ? { compatibilityReason: "manager_running_without_runtime" } : {},
|
|
44704
|
-
errorMessage: toErrorMessage$
|
|
44722
|
+
errorMessage: toErrorMessage$43(error)
|
|
44705
44723
|
},
|
|
44706
44724
|
result: isCompatibilityFallback ? "fallback" : "failed",
|
|
44707
44725
|
stopCause: "controlled_service_update",
|
|
@@ -44773,7 +44791,7 @@ async function waitForLifecycleRuntimeAbsentWithRetry(serviceManager) {
|
|
|
44773
44791
|
} catch (retryError) {
|
|
44774
44792
|
throw new DaemonServiceLifecycleStageError({
|
|
44775
44793
|
cause: retryError,
|
|
44776
|
-
message: `${toErrorMessage$
|
|
44794
|
+
message: `${toErrorMessage$43(retryError)}; initial absence verification failed: ${toErrorMessage$43(initialError)}`,
|
|
44777
44795
|
stage: "wait_absent"
|
|
44778
44796
|
});
|
|
44779
44797
|
}
|
|
@@ -44783,7 +44801,7 @@ async function cleanupStaleDaemonRuntimeDataBackupsAfterHealthyLifecycle(operati
|
|
|
44783
44801
|
await cleanupStaleDaemonRuntimeDataBackups();
|
|
44784
44802
|
} catch (error) {
|
|
44785
44803
|
console.warn("[openmeld.daemon_runtime_data.cleanup_warning]", {
|
|
44786
|
-
errorMessage: toErrorMessage$
|
|
44804
|
+
errorMessage: toErrorMessage$43(error),
|
|
44787
44805
|
operation
|
|
44788
44806
|
});
|
|
44789
44807
|
}
|
|
@@ -45193,7 +45211,7 @@ async function stopDaemonProcess$1(pid, signal) {
|
|
|
45193
45211
|
process$1.kill(pid, signal);
|
|
45194
45212
|
} catch (error) {
|
|
45195
45213
|
if (error instanceof Error && error.code === "ESRCH") return true;
|
|
45196
|
-
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$
|
|
45214
|
+
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$43(error)}`);
|
|
45197
45215
|
}
|
|
45198
45216
|
if (signal === "SIGKILL") return true;
|
|
45199
45217
|
return await waitForProcessToExit$1(pid, PROCESS_STOP_WAIT_MS);
|
|
@@ -45203,7 +45221,7 @@ async function stopDaemonProcessWithTimeout(pid, signal, timeoutMs) {
|
|
|
45203
45221
|
process$1.kill(pid, signal);
|
|
45204
45222
|
} catch (error) {
|
|
45205
45223
|
if (error instanceof Error && error.code === "ESRCH") return true;
|
|
45206
|
-
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$
|
|
45224
|
+
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$43(error)}`);
|
|
45207
45225
|
}
|
|
45208
45226
|
return await waitForProcessToExit$1(pid, timeoutMs);
|
|
45209
45227
|
}
|
|
@@ -45217,7 +45235,7 @@ async function waitForProcessToExit$1(pid, timeoutMs) {
|
|
|
45217
45235
|
}
|
|
45218
45236
|
function isLaunchdBootstrapIoError(serviceManager, error) {
|
|
45219
45237
|
if (serviceManager.controller !== "launchd") return false;
|
|
45220
|
-
const message = toErrorMessage$
|
|
45238
|
+
const message = toErrorMessage$43(error).toLowerCase();
|
|
45221
45239
|
return message.includes("bootstrap failed") && message.includes("input/output error");
|
|
45222
45240
|
}
|
|
45223
45241
|
async function writeLifecycleEvidenceEvent(input) {
|
|
@@ -45744,7 +45762,7 @@ async function discardReplacedBundleBestEffort(input) {
|
|
|
45744
45762
|
await input.dependencies.discardBundle(input.pending.preparedBundle).catch((error) => {
|
|
45745
45763
|
console.warn("[openmeld.daemon_service.update_bundle_cleanup_failed]", {
|
|
45746
45764
|
bundleId: input.pending.preparedBundle.bundleId,
|
|
45747
|
-
errorMessage: toErrorMessage$
|
|
45765
|
+
errorMessage: toErrorMessage$43(error),
|
|
45748
45766
|
operationId: input.pending.jobId
|
|
45749
45767
|
});
|
|
45750
45768
|
});
|
|
@@ -45778,7 +45796,7 @@ async function preparePendingUpdateForSwitch(deps) {
|
|
|
45778
45796
|
} catch (error) {
|
|
45779
45797
|
await deps.persistPendingJob({
|
|
45780
45798
|
...waiting,
|
|
45781
|
-
errorMessage: toErrorMessage$
|
|
45799
|
+
errorMessage: toErrorMessage$43(error),
|
|
45782
45800
|
updatedAt: deps.now()
|
|
45783
45801
|
});
|
|
45784
45802
|
throw error;
|
|
@@ -45826,7 +45844,7 @@ async function runPreparedPendingUpdate(deps) {
|
|
|
45826
45844
|
await deps.completePendingJob(completed);
|
|
45827
45845
|
return completed;
|
|
45828
45846
|
} catch (error) {
|
|
45829
|
-
const errorMessage = toErrorMessage$
|
|
45847
|
+
const errorMessage = toErrorMessage$43(error);
|
|
45830
45848
|
if (running.attempts < MAX_BACKGROUND_UPDATE_ATTEMPTS) {
|
|
45831
45849
|
const retry = {
|
|
45832
45850
|
...running,
|
|
@@ -52349,7 +52367,7 @@ function storeNewestSpaceConfig(list, candidate) {
|
|
|
52349
52367
|
if (!existing || compareIsoDateDesc(candidate.updatedAt, existing.updatedAt) < 0) list.set(candidate.space, candidate);
|
|
52350
52368
|
}
|
|
52351
52369
|
function normalizeSpaceConfig(value) {
|
|
52352
|
-
if (!isRecord(value)) return null;
|
|
52370
|
+
if (!isRecord$1(value)) return null;
|
|
52353
52371
|
if (value.v === 2) return normalizeCurrentSpaceConfig(value);
|
|
52354
52372
|
if (value.v === 1) return normalizeLegacySpaceConfig(value);
|
|
52355
52373
|
return null;
|
|
@@ -52378,7 +52396,7 @@ function normalizeCurrentSpaceConfig(parsed) {
|
|
|
52378
52396
|
});
|
|
52379
52397
|
}
|
|
52380
52398
|
function normalizeSpaceCacheMaintenanceState(value) {
|
|
52381
|
-
if (!isRecord(value)) return null;
|
|
52399
|
+
if (!isRecord$1(value)) return null;
|
|
52382
52400
|
const lastRunAt = resolveIsoTimestamp(value.lastRunAt);
|
|
52383
52401
|
const lastRemovedByRemote = resolveOptionalNonNegativeInteger(value.lastRemovedByRemote);
|
|
52384
52402
|
const lastRemovedByTtl = resolveOptionalNonNegativeInteger(value.lastRemovedByTtl);
|
|
@@ -52393,8 +52411,8 @@ function normalizeSpaceCacheMaintenanceState(value) {
|
|
|
52393
52411
|
};
|
|
52394
52412
|
}
|
|
52395
52413
|
function normalizeSpaceCacheDeletionNoticeState(value) {
|
|
52396
|
-
if (!isRecord(value)) return null;
|
|
52397
|
-
if (value.v !== SPACE_CACHE_DELETION_NOTICE_SCHEMA_VERSION || !isRecord(value.seen)) return null;
|
|
52414
|
+
if (!isRecord$1(value)) return null;
|
|
52415
|
+
if (value.v !== SPACE_CACHE_DELETION_NOTICE_SCHEMA_VERSION || !isRecord$1(value.seen)) return null;
|
|
52398
52416
|
const seen = {};
|
|
52399
52417
|
for (const [rawKey, rawValue] of Object.entries(value.seen)) {
|
|
52400
52418
|
const key = normalizeTrimmedOptionalString(rawKey);
|
|
@@ -52495,7 +52513,7 @@ function hasInvalidLegacySpaceConfigPrimitives(parsed) {
|
|
|
52495
52513
|
hasInvalidOptionalStringEntry(parsed, "role"),
|
|
52496
52514
|
hasInvalidOptionalStringEntry(parsed, "mentionAlias"),
|
|
52497
52515
|
hasInvalidOptionalStringEntry(parsed, "guide"),
|
|
52498
|
-
hasOwn(parsed, "permissions") && !isRecord(parsed.permissions),
|
|
52516
|
+
hasOwn(parsed, "permissions") && !isRecord$1(parsed.permissions),
|
|
52499
52517
|
hasInvalidOptionalBooleanEntry(parsed, "passwordProtected"),
|
|
52500
52518
|
hasInvalidOptionalStringEntry(parsed, "spacePurpose"),
|
|
52501
52519
|
hasInvalidOptionalNonNegativeIntegerEntry(parsed, "activeAgentCount"),
|
|
@@ -52580,7 +52598,7 @@ function areStringListsEqual(left, right) {
|
|
|
52580
52598
|
for (let index = 0; index < left.length; index += 1) if (left[index] !== right[index]) return false;
|
|
52581
52599
|
return true;
|
|
52582
52600
|
}
|
|
52583
|
-
function isRecord(value) {
|
|
52601
|
+
function isRecord$1(value) {
|
|
52584
52602
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
52585
52603
|
}
|
|
52586
52604
|
function hasOwn(value, key) {
|
|
@@ -53432,7 +53450,7 @@ async function probeOpenCodeReadiness(input) {
|
|
|
53432
53450
|
const auth = resolveOpenCodeAuthSnapshotFromProbeError(error);
|
|
53433
53451
|
return {
|
|
53434
53452
|
auth,
|
|
53435
|
-
message: `OpenCode is installed, but OpenMeld could not confirm a connected OpenCode provider: ${toErrorMessage$
|
|
53453
|
+
message: `OpenCode is installed, but OpenMeld could not confirm a connected OpenCode provider: ${toErrorMessage$18(error)}`,
|
|
53436
53454
|
models: [],
|
|
53437
53455
|
probeCompleted: auth.status === "unauthenticated",
|
|
53438
53456
|
status: "error"
|
|
@@ -53680,7 +53698,7 @@ function stripAnsi$1(value) {
|
|
|
53680
53698
|
}
|
|
53681
53699
|
return output;
|
|
53682
53700
|
}
|
|
53683
|
-
function toErrorMessage$
|
|
53701
|
+
function toErrorMessage$18(error) {
|
|
53684
53702
|
if (error instanceof Error) {
|
|
53685
53703
|
const message = error.message.trim();
|
|
53686
53704
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -54173,7 +54191,7 @@ async function resolveGrokBuildInterfaceSnapshot(input) {
|
|
|
54173
54191
|
snapshot: {
|
|
54174
54192
|
...input.baseSnapshot,
|
|
54175
54193
|
auth: { status: unauthenticated ? "unauthenticated" : "unknown" },
|
|
54176
|
-
message: unauthenticated ? requireControllerSignInInterfaceDescription("grok-build") : `OpenMeld could not read Grok Build's ACP status: ${toErrorMessage$
|
|
54194
|
+
message: unauthenticated ? requireControllerSignInInterfaceDescription("grok-build") : `OpenMeld could not read Grok Build's ACP status: ${toErrorMessage$17(interfaceProbe.error)}`,
|
|
54177
54195
|
status: unauthenticated ? "error" : "warning",
|
|
54178
54196
|
version,
|
|
54179
54197
|
versionAdvisory: await resolveControllerVersionAdvisory({
|
|
@@ -54407,7 +54425,7 @@ function probeCodexAppServer(launchContract) {
|
|
|
54407
54425
|
child.stdin.on("error", (error) => {
|
|
54408
54426
|
finish({
|
|
54409
54427
|
auth: { status: "unknown" },
|
|
54410
|
-
message: `Codex app-server input closed before status could be read: ${toErrorMessage$
|
|
54428
|
+
message: `Codex app-server input closed before status could be read: ${toErrorMessage$17(error)}`,
|
|
54411
54429
|
ok: false
|
|
54412
54430
|
});
|
|
54413
54431
|
});
|
|
@@ -54435,7 +54453,7 @@ function probeCodexAppServer(launchContract) {
|
|
|
54435
54453
|
}).catch((error) => {
|
|
54436
54454
|
finish({
|
|
54437
54455
|
auth: { status: "unknown" },
|
|
54438
|
-
message: `Codex app-server status check failed: ${toErrorMessage$
|
|
54456
|
+
message: `Codex app-server status check failed: ${toErrorMessage$17(error)}`,
|
|
54439
54457
|
ok: false
|
|
54440
54458
|
});
|
|
54441
54459
|
});
|
|
@@ -54698,7 +54716,7 @@ function normalizeOptionalText$15(value) {
|
|
|
54698
54716
|
const normalized = value.trim();
|
|
54699
54717
|
return normalized.length > 0 ? normalized : null;
|
|
54700
54718
|
}
|
|
54701
|
-
function toErrorMessage$
|
|
54719
|
+
function toErrorMessage$17(error) {
|
|
54702
54720
|
if (error instanceof Error) {
|
|
54703
54721
|
const message = error.message.trim();
|
|
54704
54722
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -55246,7 +55264,7 @@ async function notifyRuntimeReportingAttemptObserver(observer, attempt) {
|
|
|
55246
55264
|
} catch (error) {
|
|
55247
55265
|
warnDaemonEvent("[openmeld.runtime_reporting.attempt_observer_failed]", {
|
|
55248
55266
|
authenticationRejected: attempt.authenticationRejected,
|
|
55249
|
-
error: toErrorMessage$
|
|
55267
|
+
error: toErrorMessage$16(error),
|
|
55250
55268
|
event: "cli.runtime_reporting.attempt_observer_failed",
|
|
55251
55269
|
family: attempt.family,
|
|
55252
55270
|
reasonCode: attempt.reasonCode,
|
|
@@ -55307,7 +55325,7 @@ async function submitAgentControllerReportsWithCompatibilityRetry(input) {
|
|
|
55307
55325
|
requestedReports: input.requestedReports
|
|
55308
55326
|
})) {
|
|
55309
55327
|
warnDaemonEvent("[openmeld.runtime_reporting.usage_limits_downgraded]", {
|
|
55310
|
-
error: toErrorMessage$
|
|
55328
|
+
error: toErrorMessage$16(error),
|
|
55311
55329
|
event: "cli.runtime_reporting.usage_limits_downgraded",
|
|
55312
55330
|
reportCount: input.requestedReports.length
|
|
55313
55331
|
});
|
|
@@ -55323,7 +55341,7 @@ async function submitAgentControllerReportsWithCompatibilityRetry(input) {
|
|
|
55323
55341
|
requestedReports: input.requestedReports
|
|
55324
55342
|
})) throw compatibilityError;
|
|
55325
55343
|
warnDaemonEvent("[openmeld.runtime_reporting.agent_controller_interface_downgraded]", {
|
|
55326
|
-
error: toErrorMessage$
|
|
55344
|
+
error: toErrorMessage$16(compatibilityError),
|
|
55327
55345
|
event: "cli.runtime_reporting.agent_controller_interface_downgraded",
|
|
55328
55346
|
profileIds: input.requestedReports.map((report) => report.diagnosticProfileId).filter((profileId) => Boolean(profileId)),
|
|
55329
55347
|
reportCount: input.requestedReports.length
|
|
@@ -55532,7 +55550,7 @@ function failedProviderConversationProofSubmission(input) {
|
|
|
55532
55550
|
status: "failed"
|
|
55533
55551
|
};
|
|
55534
55552
|
}
|
|
55535
|
-
function toErrorMessage$
|
|
55553
|
+
function toErrorMessage$16(error) {
|
|
55536
55554
|
if (error instanceof Error) {
|
|
55537
55555
|
const message = error.message.trim();
|
|
55538
55556
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -55864,7 +55882,7 @@ async function ensureAgentProfileRuntimeBinding(input) {
|
|
|
55864
55882
|
};
|
|
55865
55883
|
} catch (error) {
|
|
55866
55884
|
console.warn("[openmeld.agent_profile_binding.ensure_failed]", {
|
|
55867
|
-
error: toErrorMessage$
|
|
55885
|
+
error: toErrorMessage$15(error),
|
|
55868
55886
|
event: "cli.agent_profile_binding.ensure_failed",
|
|
55869
55887
|
profileId: input.profile.openMeldProfileId
|
|
55870
55888
|
});
|
|
@@ -56001,7 +56019,7 @@ function orderReasonCodesBySupportRelevance(input) {
|
|
|
56001
56019
|
reasonCodes: input.reasonCodes
|
|
56002
56020
|
}), ...input.reasonCodes]);
|
|
56003
56021
|
}
|
|
56004
|
-
function toErrorMessage$
|
|
56022
|
+
function toErrorMessage$15(error) {
|
|
56005
56023
|
if (error instanceof Error) {
|
|
56006
56024
|
const message = error.message.trim();
|
|
56007
56025
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -56432,6 +56450,195 @@ function resolveOpenCommand() {
|
|
|
56432
56450
|
return "xdg-open";
|
|
56433
56451
|
}
|
|
56434
56452
|
//#endregion
|
|
56453
|
+
//#region src/commands/auth-device-session-client.ts
|
|
56454
|
+
const DEFAULT_DEVICE_CLIENT_ID = "openmeld-cli";
|
|
56455
|
+
const DEVICE_CLIENT_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{1,63}$/;
|
|
56456
|
+
var AuthDeviceSessionClientError = class extends Error {
|
|
56457
|
+
endpoint;
|
|
56458
|
+
operation;
|
|
56459
|
+
status;
|
|
56460
|
+
constructor(input) {
|
|
56461
|
+
super(input.message, input.cause === void 0 ? void 0 : { cause: input.cause });
|
|
56462
|
+
this.name = "AuthDeviceSessionClientError";
|
|
56463
|
+
this.endpoint = input.endpoint;
|
|
56464
|
+
this.operation = input.operation;
|
|
56465
|
+
this.status = input.status ?? null;
|
|
56466
|
+
}
|
|
56467
|
+
};
|
|
56468
|
+
async function requestDeviceToken(input) {
|
|
56469
|
+
const endpoint = toAuthEndpoint$3(input.authBaseUrl, "/api/auth/device/token");
|
|
56470
|
+
const parsedRequest = betterAuthDeviceAuthorizationTokenRequestSchema.safeParse({
|
|
56471
|
+
grant_type: BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE,
|
|
56472
|
+
device_code: input.deviceCode,
|
|
56473
|
+
client_id: input.clientId
|
|
56474
|
+
});
|
|
56475
|
+
if (!parsedRequest.success) throw createClientError({
|
|
56476
|
+
endpoint,
|
|
56477
|
+
operation: "exchange_device_token",
|
|
56478
|
+
message: "computer authorization token request was invalid",
|
|
56479
|
+
cause: parsedRequest.error
|
|
56480
|
+
});
|
|
56481
|
+
let response;
|
|
56482
|
+
try {
|
|
56483
|
+
response = await fetch(endpoint, {
|
|
56484
|
+
method: "POST",
|
|
56485
|
+
headers: { "content-type": "application/json" },
|
|
56486
|
+
body: JSON.stringify(parsedRequest.data),
|
|
56487
|
+
signal: AbortSignal.timeout(1e4)
|
|
56488
|
+
});
|
|
56489
|
+
} catch (error) {
|
|
56490
|
+
throw createClientError({
|
|
56491
|
+
endpoint,
|
|
56492
|
+
operation: "exchange_device_token",
|
|
56493
|
+
message: "computer authorization token request failed",
|
|
56494
|
+
cause: error
|
|
56495
|
+
});
|
|
56496
|
+
}
|
|
56497
|
+
const payload = await parseResponseJson$2(response);
|
|
56498
|
+
if (response.ok) {
|
|
56499
|
+
const parsed = betterAuthDeviceAuthorizationTokenResponseSchema.safeParse(payload);
|
|
56500
|
+
if (!parsed.success) throw createClientError({
|
|
56501
|
+
endpoint,
|
|
56502
|
+
operation: "exchange_device_token",
|
|
56503
|
+
status: response.status,
|
|
56504
|
+
message: "computer authorization token response was invalid",
|
|
56505
|
+
cause: parsed.error
|
|
56506
|
+
});
|
|
56507
|
+
return {
|
|
56508
|
+
ok: true,
|
|
56509
|
+
data: parsed.data
|
|
56510
|
+
};
|
|
56511
|
+
}
|
|
56512
|
+
const parsedError = betterAuthDeviceAuthorizationErrorResponseSchema.safeParse(payload);
|
|
56513
|
+
return {
|
|
56514
|
+
ok: false,
|
|
56515
|
+
error: parsedError.success ? parsedError.data : { message: response.statusText || `HTTP ${response.status}` },
|
|
56516
|
+
status: response.status
|
|
56517
|
+
};
|
|
56518
|
+
}
|
|
56519
|
+
async function fetchAuthUserSnapshot(input) {
|
|
56520
|
+
const endpoint = toAuthEndpoint$3(input.authBaseUrl, "/api/auth/get-session");
|
|
56521
|
+
let response;
|
|
56522
|
+
try {
|
|
56523
|
+
response = await fetch(endpoint, {
|
|
56524
|
+
method: "GET",
|
|
56525
|
+
headers: { authorization: `Bearer ${input.accessToken}` },
|
|
56526
|
+
signal: AbortSignal.timeout(1e4)
|
|
56527
|
+
});
|
|
56528
|
+
} catch (error) {
|
|
56529
|
+
throw createClientError({
|
|
56530
|
+
endpoint,
|
|
56531
|
+
operation: "read_auth_session",
|
|
56532
|
+
message: "computer authorization account request failed",
|
|
56533
|
+
cause: error
|
|
56534
|
+
});
|
|
56535
|
+
}
|
|
56536
|
+
if (!response.ok) {
|
|
56537
|
+
const payload = await parseResponseJson$2(response);
|
|
56538
|
+
throw createClientError({
|
|
56539
|
+
endpoint,
|
|
56540
|
+
operation: "read_auth_session",
|
|
56541
|
+
status: response.status,
|
|
56542
|
+
message: `computer authorization account request failed: ${extractAuthApiErrorMessage(payload, response.status)}`
|
|
56543
|
+
});
|
|
56544
|
+
}
|
|
56545
|
+
const payload = await parseResponseJson$2(response);
|
|
56546
|
+
const parsed = betterAuthSessionSnapshotResponseSchema.safeParse(payload);
|
|
56547
|
+
if (!parsed.success) throw createClientError({
|
|
56548
|
+
endpoint,
|
|
56549
|
+
operation: "read_auth_session",
|
|
56550
|
+
status: response.status,
|
|
56551
|
+
message: "computer authorization account response was invalid",
|
|
56552
|
+
cause: parsed.error
|
|
56553
|
+
});
|
|
56554
|
+
if (!parsed.data?.user) throw createClientError({
|
|
56555
|
+
endpoint,
|
|
56556
|
+
operation: "read_auth_session",
|
|
56557
|
+
status: response.status,
|
|
56558
|
+
message: "computer authorization account response did not include a user"
|
|
56559
|
+
});
|
|
56560
|
+
return parsed.data.user;
|
|
56561
|
+
}
|
|
56562
|
+
async function revokeAuthAccessToken(input) {
|
|
56563
|
+
const endpoint = toAuthEndpoint$3(input.authBaseUrl, "/api/auth/sign-out");
|
|
56564
|
+
let response;
|
|
56565
|
+
try {
|
|
56566
|
+
response = await fetch(endpoint, {
|
|
56567
|
+
method: "POST",
|
|
56568
|
+
headers: { authorization: `${input.tokenType} ${input.accessToken}` },
|
|
56569
|
+
signal: AbortSignal.timeout(1e4)
|
|
56570
|
+
});
|
|
56571
|
+
} catch (error) {
|
|
56572
|
+
return {
|
|
56573
|
+
ok: false,
|
|
56574
|
+
error: createClientError({
|
|
56575
|
+
endpoint,
|
|
56576
|
+
operation: "revoke_auth_session",
|
|
56577
|
+
message: "unused computer authorization session could not be revoked",
|
|
56578
|
+
cause: error
|
|
56579
|
+
})
|
|
56580
|
+
};
|
|
56581
|
+
}
|
|
56582
|
+
if (!response.ok) {
|
|
56583
|
+
const payload = await parseResponseJson$2(response);
|
|
56584
|
+
return {
|
|
56585
|
+
ok: false,
|
|
56586
|
+
error: createClientError({
|
|
56587
|
+
endpoint,
|
|
56588
|
+
operation: "revoke_auth_session",
|
|
56589
|
+
status: response.status,
|
|
56590
|
+
message: `unused computer authorization session could not be revoked: ${extractAuthApiErrorMessage(payload, response.status)}`
|
|
56591
|
+
})
|
|
56592
|
+
};
|
|
56593
|
+
}
|
|
56594
|
+
return { ok: true };
|
|
56595
|
+
}
|
|
56596
|
+
function resolveDeviceAuthClientId(value) {
|
|
56597
|
+
const clientId = normalizeOptionalString$10(value) ?? normalizeOptionalString$10(process.env.OPENMELD_AUTH_CLIENT_ID) ?? DEFAULT_DEVICE_CLIENT_ID;
|
|
56598
|
+
if (!DEVICE_CLIENT_ID_PATTERN.test(clientId)) throw new Error(`invalid client_id "${clientId}" (allowed: letters, numbers, . _ : -)`);
|
|
56599
|
+
return clientId;
|
|
56600
|
+
}
|
|
56601
|
+
function resolveDeviceTokenExpiresAt(expiresIn) {
|
|
56602
|
+
if (typeof expiresIn !== "number" || !Number.isFinite(expiresIn) || expiresIn <= 0) return;
|
|
56603
|
+
const now = Date.now();
|
|
56604
|
+
const maxFutureMs = Math.max(0, Math.min(Number.MAX_SAFE_INTEGER, 864e13) - now);
|
|
56605
|
+
const safeExpiresInSeconds = Math.min(Math.floor(expiresIn), Math.floor(maxFutureMs / 1e3));
|
|
56606
|
+
if (safeExpiresInSeconds <= 0) return;
|
|
56607
|
+
return new Date(now + safeExpiresInSeconds * 1e3).toISOString();
|
|
56608
|
+
}
|
|
56609
|
+
function extractAuthApiErrorMessage(payload, status) {
|
|
56610
|
+
const parsed = betterAuthDeviceAuthorizationErrorResponseSchema.safeParse(payload);
|
|
56611
|
+
if (!parsed.success) return `HTTP ${status}`;
|
|
56612
|
+
return normalizeOptionalString$10(parsed.data.error_description) ?? normalizeOptionalString$10(parsed.data.detail) ?? normalizeOptionalString$10(parsed.data.message) ?? normalizeOptionalString$10(parsed.data.error) ?? `HTTP ${status}`;
|
|
56613
|
+
}
|
|
56614
|
+
function readAuthUserFromSessionPayload(payload) {
|
|
56615
|
+
const parsed = betterAuthSessionSnapshotResponseSchema.safeParse(payload);
|
|
56616
|
+
return parsed.success ? parsed.data?.user ?? null : null;
|
|
56617
|
+
}
|
|
56618
|
+
function createClientError(input) {
|
|
56619
|
+
return new AuthDeviceSessionClientError(input);
|
|
56620
|
+
}
|
|
56621
|
+
function toAuthEndpoint$3(baseUrl, pathname) {
|
|
56622
|
+
const url = new URL(baseUrl);
|
|
56623
|
+
url.pathname = pathname;
|
|
56624
|
+
url.search = "";
|
|
56625
|
+
url.hash = "";
|
|
56626
|
+
return url.toString();
|
|
56627
|
+
}
|
|
56628
|
+
function normalizeOptionalString$10(value) {
|
|
56629
|
+
const normalized = String(value ?? "").trim();
|
|
56630
|
+
return normalized.length > 0 ? normalized : null;
|
|
56631
|
+
}
|
|
56632
|
+
async function parseResponseJson$2(response) {
|
|
56633
|
+
const raw = await response.text();
|
|
56634
|
+
if (!raw) return null;
|
|
56635
|
+
try {
|
|
56636
|
+
return JSON.parse(raw);
|
|
56637
|
+
} catch {
|
|
56638
|
+
return { message: raw };
|
|
56639
|
+
}
|
|
56640
|
+
}
|
|
56641
|
+
//#endregion
|
|
56435
56642
|
//#region src/commands/auth-status-shared.ts
|
|
56436
56643
|
function buildAuthStatusSnapshot(input) {
|
|
56437
56644
|
const session = input.session;
|
|
@@ -56453,7 +56660,7 @@ function buildAuthStatusSnapshot(input) {
|
|
|
56453
56660
|
expired: false,
|
|
56454
56661
|
activeOrganization: null
|
|
56455
56662
|
};
|
|
56456
|
-
const expiresAt = normalizeOptionalString$
|
|
56663
|
+
const expiresAt = normalizeOptionalString$9(session.expiresAt);
|
|
56457
56664
|
const expiresAtMs = expiresAt ? Date.parse(expiresAt) : NaN;
|
|
56458
56665
|
const hasValidExpiresAt = Number.isFinite(expiresAtMs);
|
|
56459
56666
|
const expiresInMs = hasValidExpiresAt ? expiresAtMs - Date.now() : NaN;
|
|
@@ -56463,14 +56670,14 @@ function buildAuthStatusSnapshot(input) {
|
|
|
56463
56670
|
state: input.state,
|
|
56464
56671
|
...input.reasonCode ? { reasonCode: input.reasonCode } : {},
|
|
56465
56672
|
...input.errorMessage ? { errorMessage: input.errorMessage } : {},
|
|
56466
|
-
userId: normalizeOptionalString$
|
|
56467
|
-
userEmail: normalizeOptionalString$
|
|
56468
|
-
userName: normalizeOptionalString$
|
|
56469
|
-
clientId: normalizeOptionalString$
|
|
56470
|
-
authBaseUrl: normalizeOptionalString$
|
|
56471
|
-
tokenType: normalizeOptionalString$
|
|
56472
|
-
scope: normalizeOptionalString$
|
|
56473
|
-
createdAt: normalizeOptionalString$
|
|
56673
|
+
userId: normalizeOptionalString$9(session.user?.id),
|
|
56674
|
+
userEmail: normalizeOptionalString$9(session.user?.email),
|
|
56675
|
+
userName: normalizeOptionalString$9(session.user?.name),
|
|
56676
|
+
clientId: normalizeOptionalString$9(session.clientId),
|
|
56677
|
+
authBaseUrl: normalizeOptionalString$9(session.authBaseUrl),
|
|
56678
|
+
tokenType: normalizeOptionalString$9(session.tokenType),
|
|
56679
|
+
scope: normalizeOptionalString$9(session.scope),
|
|
56680
|
+
createdAt: normalizeOptionalString$9(session.createdAt),
|
|
56474
56681
|
expiresAt,
|
|
56475
56682
|
expiresIn: hasValidExpiresAt ? formatRemainingDuration(expiresInMs) : null,
|
|
56476
56683
|
expired,
|
|
@@ -56554,7 +56761,7 @@ function appendRowIfValue(rows, label, value) {
|
|
|
56554
56761
|
value
|
|
56555
56762
|
});
|
|
56556
56763
|
}
|
|
56557
|
-
function normalizeOptionalString$
|
|
56764
|
+
function normalizeOptionalString$9(value) {
|
|
56558
56765
|
const normalized = String(value ?? "").trim();
|
|
56559
56766
|
return normalized.length > 0 ? normalized : null;
|
|
56560
56767
|
}
|
|
@@ -56571,8 +56778,196 @@ function formatRemainingDuration(inputMs) {
|
|
|
56571
56778
|
return `${seconds}s`;
|
|
56572
56779
|
}
|
|
56573
56780
|
//#endregion
|
|
56781
|
+
//#region src/commands/one-time-token-auth-session.ts
|
|
56782
|
+
var OneTimeTokenAuthError = class extends Error {
|
|
56783
|
+
code;
|
|
56784
|
+
constructor(code, message, options) {
|
|
56785
|
+
super(message, options);
|
|
56786
|
+
this.name = "OneTimeTokenAuthError";
|
|
56787
|
+
this.code = code;
|
|
56788
|
+
}
|
|
56789
|
+
};
|
|
56790
|
+
var OneTimeTokenCandidateSessionCleanupError = class extends OneTimeTokenAuthError {
|
|
56791
|
+
cleanup;
|
|
56792
|
+
constructor(input) {
|
|
56793
|
+
const redactedValues = input.redactedValues ?? [];
|
|
56794
|
+
const cleanup = createSanitizedErrorDiagnostic(input.cleanupError, redactedValues);
|
|
56795
|
+
const primary = createSanitizedErrorDiagnostic(input.cause, redactedValues);
|
|
56796
|
+
const safeCause = input.cause instanceof OneTimeTokenLocalSessionRecoveryError ? input.cause : createErrorFromDiagnostic(primary);
|
|
56797
|
+
const status = cleanup.status === null ? "network error" : `HTTP ${String(cleanup.status)}`;
|
|
56798
|
+
super(input.cause instanceof OneTimeTokenAuthError ? input.cause.code : "unknown", `${primary.message}; cleanup failed at ${cleanup.endpoint ?? "unknown endpoint"} (${status}): ${cleanup.message}`, { cause: safeCause });
|
|
56799
|
+
this.name = "OneTimeTokenCandidateSessionCleanupError";
|
|
56800
|
+
this.cleanup = cleanup;
|
|
56801
|
+
}
|
|
56802
|
+
};
|
|
56803
|
+
var OneTimeTokenLocalSessionRecoveryError = class extends OneTimeTokenAuthError {
|
|
56804
|
+
primary;
|
|
56805
|
+
recovery;
|
|
56806
|
+
constructor(input) {
|
|
56807
|
+
const redactedValues = input.redactedValues ?? [];
|
|
56808
|
+
const primary = createSanitizedErrorDiagnostic(input.cause, redactedValues);
|
|
56809
|
+
const recovery = createSanitizedErrorDiagnostic(input.recoveryError, redactedValues);
|
|
56810
|
+
const aggregateCause = new AggregateError([createErrorFromDiagnostic(primary), createErrorFromDiagnostic(recovery)], "one-time token local session recovery failed");
|
|
56811
|
+
super(input.cause instanceof OneTimeTokenAuthError ? input.cause.code : "unknown", `${primary.message}; local session recovery failed: ${recovery.message}`, { cause: aggregateCause });
|
|
56812
|
+
this.name = "OneTimeTokenLocalSessionRecoveryError";
|
|
56813
|
+
this.primary = primary;
|
|
56814
|
+
this.recovery = recovery;
|
|
56815
|
+
}
|
|
56816
|
+
};
|
|
56817
|
+
async function rejectOneTimeTokenCandidateSession(input) {
|
|
56818
|
+
const cleanup = await revokeAuthAccessToken(input.session);
|
|
56819
|
+
if (cleanup.ok) throw input.cause;
|
|
56820
|
+
throw new OneTimeTokenCandidateSessionCleanupError({
|
|
56821
|
+
cause: input.cause,
|
|
56822
|
+
cleanupError: cleanup.error,
|
|
56823
|
+
redactedValues: [input.session.accessToken]
|
|
56824
|
+
});
|
|
56825
|
+
}
|
|
56826
|
+
async function exchangeOneTimeTokenAuthSession(input) {
|
|
56827
|
+
const endpoint = toAuthEndpoint$2(input.authBaseUrl, "/api/auth/one-time-token/verify");
|
|
56828
|
+
let response;
|
|
56829
|
+
try {
|
|
56830
|
+
response = await fetch(endpoint, {
|
|
56831
|
+
method: "POST",
|
|
56832
|
+
headers: { "content-type": "application/json" },
|
|
56833
|
+
body: JSON.stringify({ token: input.token }),
|
|
56834
|
+
signal: AbortSignal.timeout(1e4)
|
|
56835
|
+
});
|
|
56836
|
+
} catch (error) {
|
|
56837
|
+
throw new OneTimeTokenAuthError("unknown", `one-time token verification request failed at ${endpoint}: ${toErrorMessage$14(error)}`);
|
|
56838
|
+
}
|
|
56839
|
+
const payload = await parseResponseJson$1(response);
|
|
56840
|
+
if (!response.ok) throw mapOneTimeTokenHttpError(payload, response.status);
|
|
56841
|
+
const accessToken = normalizeOptionalString$8(response.headers.get("set-auth-token"));
|
|
56842
|
+
if (!accessToken) throw new OneTimeTokenAuthError("missing_access_token", "one-time token verified but auth response is missing set-auth-token");
|
|
56843
|
+
try {
|
|
56844
|
+
const user = readAuthUserFromSessionPayload(payload) ?? await fetchAuthUserSnapshot({
|
|
56845
|
+
authBaseUrl: input.authBaseUrl,
|
|
56846
|
+
accessToken
|
|
56847
|
+
});
|
|
56848
|
+
const userId = normalizeOptionalString$8(user.id);
|
|
56849
|
+
if (!userId) throw new OneTimeTokenAuthError("unknown", "one-time token account response did not include a user id");
|
|
56850
|
+
return {
|
|
56851
|
+
accessToken,
|
|
56852
|
+
tokenType: "Bearer",
|
|
56853
|
+
authBaseUrl: input.authBaseUrl,
|
|
56854
|
+
clientId: input.clientId,
|
|
56855
|
+
...readSessionExpiresAtFromPayload(payload),
|
|
56856
|
+
user: {
|
|
56857
|
+
...user,
|
|
56858
|
+
id: userId
|
|
56859
|
+
}
|
|
56860
|
+
};
|
|
56861
|
+
} catch (error) {
|
|
56862
|
+
return await rejectOneTimeTokenCandidateSession({
|
|
56863
|
+
cause: error,
|
|
56864
|
+
session: {
|
|
56865
|
+
accessToken,
|
|
56866
|
+
authBaseUrl: input.authBaseUrl,
|
|
56867
|
+
tokenType: "Bearer"
|
|
56868
|
+
}
|
|
56869
|
+
});
|
|
56870
|
+
}
|
|
56871
|
+
}
|
|
56872
|
+
function mapOneTimeTokenHttpError(payload, status) {
|
|
56873
|
+
const message = extractAuthApiErrorMessage(payload, status);
|
|
56874
|
+
const normalizedMessage = message.toLowerCase();
|
|
56875
|
+
if (normalizedMessage.includes("expired")) return new OneTimeTokenAuthError("expired_token", "one-time token expired; generate a new token and retry");
|
|
56876
|
+
if (normalizedMessage.includes("session not found")) return new OneTimeTokenAuthError("expired_token", "one-time token session is no longer valid; sign in to OpenMeld Web again, copy a fresh command, and retry");
|
|
56877
|
+
if (normalizedMessage.includes("invalid")) return new OneTimeTokenAuthError("invalid_token", "invalid one-time token; generate a new token and retry");
|
|
56878
|
+
return new OneTimeTokenAuthError("unknown", `one-time token verification failed: ${message}`);
|
|
56879
|
+
}
|
|
56880
|
+
function readSessionExpiresAtFromPayload(payload) {
|
|
56881
|
+
if (!(payload && typeof payload === "object" && "session" in payload)) return {};
|
|
56882
|
+
const session = payload.session;
|
|
56883
|
+
if (!(session && typeof session === "object")) return {};
|
|
56884
|
+
const raw = normalizeOptionalString$8(session.expiresAt);
|
|
56885
|
+
if (!raw) return {};
|
|
56886
|
+
const expiresAtMs = Date.parse(raw);
|
|
56887
|
+
return Number.isNaN(expiresAtMs) ? {} : { expiresAt: new Date(expiresAtMs).toISOString() };
|
|
56888
|
+
}
|
|
56889
|
+
function toAuthEndpoint$2(baseUrl, pathname) {
|
|
56890
|
+
const url = new URL(baseUrl);
|
|
56891
|
+
url.pathname = pathname;
|
|
56892
|
+
url.search = "";
|
|
56893
|
+
url.hash = "";
|
|
56894
|
+
return url.toString();
|
|
56895
|
+
}
|
|
56896
|
+
function normalizeOptionalString$8(value) {
|
|
56897
|
+
const normalized = String(value ?? "").trim();
|
|
56898
|
+
return normalized.length > 0 ? normalized : null;
|
|
56899
|
+
}
|
|
56900
|
+
function toErrorMessage$14(error) {
|
|
56901
|
+
return error instanceof Error && error.message.trim() ? error.message.trim() : String(error ?? "unknown error");
|
|
56902
|
+
}
|
|
56903
|
+
function createSanitizedErrorDiagnostic(error, redactedValues, seen = /* @__PURE__ */ new Set(), depth = 0) {
|
|
56904
|
+
if (depth >= 8) return {
|
|
56905
|
+
message: "Nested error cause omitted after maximum diagnostic depth",
|
|
56906
|
+
name: "ErrorCauseDepthLimit"
|
|
56907
|
+
};
|
|
56908
|
+
if (typeof error === "object" && error !== null || typeof error === "function") {
|
|
56909
|
+
if (seen.has(error)) return {
|
|
56910
|
+
message: "Circular error cause omitted",
|
|
56911
|
+
name: "CircularErrorCause"
|
|
56912
|
+
};
|
|
56913
|
+
seen.add(error);
|
|
56914
|
+
}
|
|
56915
|
+
const record = isRecord(error) ? error : null;
|
|
56916
|
+
const diagnostic = {
|
|
56917
|
+
name: redactSensitiveText(error instanceof Error && error.name.trim() ? error.name.trim() : readDiagnosticString(record?.name) ?? "Error", redactedValues),
|
|
56918
|
+
message: redactSensitiveText(toErrorMessage$14(error), redactedValues)
|
|
56919
|
+
};
|
|
56920
|
+
const stack = error instanceof Error ? readDiagnosticString(error.stack) : void 0;
|
|
56921
|
+
if (stack) diagnostic.stack = redactSensitiveText(stack, redactedValues);
|
|
56922
|
+
copyDiagnosticString(record, diagnostic, "path", redactedValues);
|
|
56923
|
+
copyDiagnosticString(record, diagnostic, "endpoint", redactedValues);
|
|
56924
|
+
copyDiagnosticString(record, diagnostic, "operation", redactedValues);
|
|
56925
|
+
const code = record?.code;
|
|
56926
|
+
if (typeof code === "string" || typeof code === "number") diagnostic.code = typeof code === "string" ? redactSensitiveText(code, redactedValues) : code;
|
|
56927
|
+
const status = record?.status;
|
|
56928
|
+
if (status === null || typeof status === "number") diagnostic.status = status;
|
|
56929
|
+
if (record && "cause" in record && record.cause !== void 0) diagnostic.cause = createSanitizedErrorDiagnostic(record.cause, redactedValues, seen, depth + 1);
|
|
56930
|
+
return diagnostic;
|
|
56931
|
+
}
|
|
56932
|
+
function createErrorFromDiagnostic(diagnostic) {
|
|
56933
|
+
const cause = diagnostic.cause ? createErrorFromDiagnostic(diagnostic.cause) : void 0;
|
|
56934
|
+
const error = new Error(diagnostic.message, cause === void 0 ? void 0 : { cause });
|
|
56935
|
+
error.name = diagnostic.name;
|
|
56936
|
+
if (diagnostic.stack) error.stack = diagnostic.stack;
|
|
56937
|
+
const enriched = error;
|
|
56938
|
+
enriched.code = diagnostic.code;
|
|
56939
|
+
enriched.endpoint = diagnostic.endpoint;
|
|
56940
|
+
enriched.operation = diagnostic.operation;
|
|
56941
|
+
enriched.path = diagnostic.path;
|
|
56942
|
+
enriched.status = diagnostic.status;
|
|
56943
|
+
return enriched;
|
|
56944
|
+
}
|
|
56945
|
+
function copyDiagnosticString(source, target, key, redactedValues) {
|
|
56946
|
+
const value = readDiagnosticString(source?.[key]);
|
|
56947
|
+
if (value) target[key] = redactSensitiveText(value, redactedValues);
|
|
56948
|
+
}
|
|
56949
|
+
function readDiagnosticString(value) {
|
|
56950
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
56951
|
+
}
|
|
56952
|
+
function redactSensitiveText(value, redactedValues) {
|
|
56953
|
+
let redacted = value;
|
|
56954
|
+
for (const sensitiveValue of redactedValues) if (sensitiveValue) redacted = redacted.split(sensitiveValue).join("[REDACTED]");
|
|
56955
|
+
return redacted;
|
|
56956
|
+
}
|
|
56957
|
+
function isRecord(value) {
|
|
56958
|
+
return Boolean(value && typeof value === "object");
|
|
56959
|
+
}
|
|
56960
|
+
async function parseResponseJson$1(response) {
|
|
56961
|
+
const raw = await response.text();
|
|
56962
|
+
if (!raw) return null;
|
|
56963
|
+
try {
|
|
56964
|
+
return JSON.parse(raw);
|
|
56965
|
+
} catch {
|
|
56966
|
+
return { message: raw };
|
|
56967
|
+
}
|
|
56968
|
+
}
|
|
56969
|
+
//#endregion
|
|
56574
56970
|
//#region src/commands/auth.ts
|
|
56575
|
-
const DEFAULT_DEVICE_CLIENT_ID = "openmeld-cli";
|
|
56576
56971
|
const LOGIN_METHOD_DEVICE = "device";
|
|
56577
56972
|
const LOGIN_METHOD_OTT = "ott";
|
|
56578
56973
|
const LOGIN_METHOD_CANCEL = "__auth_login_method_cancel__";
|
|
@@ -56583,8 +56978,6 @@ const DEFAULT_POLL_INTERVAL_SECONDS = 5;
|
|
|
56583
56978
|
const MAX_POLL_INTERVAL_SECONDS = 60;
|
|
56584
56979
|
const MIN_POLL_INTERVAL_SECONDS = 1;
|
|
56585
56980
|
const POLL_PROGRESS_EMIT_INTERVAL_MS = 15e3;
|
|
56586
|
-
const DEVICE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
56587
|
-
const DEVICE_CLIENT_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{1,63}$/;
|
|
56588
56981
|
const TRAILING_SLASH_PATTERN = /\/+$/;
|
|
56589
56982
|
var DeviceAuthError = class extends Error {
|
|
56590
56983
|
code;
|
|
@@ -56593,13 +56986,6 @@ var DeviceAuthError = class extends Error {
|
|
|
56593
56986
|
this.code = code;
|
|
56594
56987
|
}
|
|
56595
56988
|
};
|
|
56596
|
-
var OneTimeTokenAuthError = class extends Error {
|
|
56597
|
-
code;
|
|
56598
|
-
constructor(code, message) {
|
|
56599
|
-
super(message);
|
|
56600
|
-
this.code = code;
|
|
56601
|
-
}
|
|
56602
|
-
};
|
|
56603
56989
|
var AuthHttpError = class extends Error {
|
|
56604
56990
|
status;
|
|
56605
56991
|
endpoint;
|
|
@@ -56610,6 +56996,7 @@ var AuthHttpError = class extends Error {
|
|
|
56610
56996
|
}
|
|
56611
56997
|
};
|
|
56612
56998
|
async function runAuthLogin(input) {
|
|
56999
|
+
await assertAuthSessionMutationAvailable();
|
|
56613
57000
|
const runtime = await resolveRuntimeContext({ view: input.view });
|
|
56614
57001
|
const presenter = createPresenter(runtime);
|
|
56615
57002
|
emitAuthOverviewIfNeeded({
|
|
@@ -56943,7 +57330,7 @@ async function runDeviceLoginFlow(input) {
|
|
|
56943
57330
|
tokenType: token.token_type ?? "Bearer",
|
|
56944
57331
|
authBaseUrl: input.authBaseUrl,
|
|
56945
57332
|
clientId: input.clientId,
|
|
56946
|
-
expiresAt:
|
|
57333
|
+
expiresAt: resolveDeviceTokenExpiresAt(token.expires_in),
|
|
56947
57334
|
scope: normalizeOptionalString$7(token.scope) ?? void 0,
|
|
56948
57335
|
user: authUser ?? void 0
|
|
56949
57336
|
});
|
|
@@ -56960,28 +57347,44 @@ async function runOneTimeTokenLoginFlow(input) {
|
|
|
56960
57347
|
isHumanView: input.isHumanView,
|
|
56961
57348
|
authBaseUrl: input.authBaseUrl
|
|
56962
57349
|
});
|
|
56963
|
-
const verified = await
|
|
56964
|
-
authBaseUrl: input.authBaseUrl,
|
|
56965
|
-
token: input.token
|
|
56966
|
-
});
|
|
56967
|
-
const authUser = verified.user ?? await fetchAuthUserSnapshot({
|
|
56968
|
-
authBaseUrl: input.authBaseUrl,
|
|
56969
|
-
accessToken: verified.accessToken
|
|
56970
|
-
});
|
|
56971
|
-
await setAuthSession({
|
|
56972
|
-
accessToken: verified.accessToken,
|
|
56973
|
-
tokenType: "Bearer",
|
|
57350
|
+
const verified = await exchangeOneTimeTokenAuthSession({
|
|
56974
57351
|
authBaseUrl: input.authBaseUrl,
|
|
56975
57352
|
clientId: input.clientId,
|
|
56976
|
-
|
|
56977
|
-
user: authUser ?? void 0
|
|
57353
|
+
token: input.token
|
|
56978
57354
|
});
|
|
56979
|
-
|
|
57355
|
+
let transition = null;
|
|
57356
|
+
try {
|
|
57357
|
+
transition = await beginAuthSessionTransition({
|
|
57358
|
+
accessToken: verified.accessToken,
|
|
57359
|
+
tokenType: verified.tokenType,
|
|
57360
|
+
authBaseUrl: verified.authBaseUrl,
|
|
57361
|
+
clientId: verified.clientId,
|
|
57362
|
+
expiresAt: verified.expiresAt,
|
|
57363
|
+
user: verified.user
|
|
57364
|
+
});
|
|
57365
|
+
await assertOneTimeTokenAuthSessionSaved({ accessToken: verified.accessToken });
|
|
57366
|
+
await transition.commit();
|
|
57367
|
+
} catch (error) {
|
|
57368
|
+
let failure = error;
|
|
57369
|
+
if (transition) try {
|
|
57370
|
+
await transition.rollback();
|
|
57371
|
+
} catch (recoveryError) {
|
|
57372
|
+
failure = new OneTimeTokenLocalSessionRecoveryError({
|
|
57373
|
+
cause: error,
|
|
57374
|
+
recoveryError,
|
|
57375
|
+
redactedValues: [verified.accessToken]
|
|
57376
|
+
});
|
|
57377
|
+
}
|
|
57378
|
+
await rejectOneTimeTokenCandidateSession({
|
|
57379
|
+
cause: failure,
|
|
57380
|
+
session: verified
|
|
57381
|
+
});
|
|
57382
|
+
}
|
|
56980
57383
|
emitLineWithHumanSpacer({
|
|
56981
57384
|
presenter: input.presenter,
|
|
56982
57385
|
isHumanView: input.isHumanView,
|
|
56983
57386
|
code: "auth.login.success",
|
|
56984
|
-
text: input.isHumanView ? pc.green(resolveHumanLoginSuccessText(
|
|
57387
|
+
text: input.isHumanView ? pc.green(resolveHumanLoginSuccessText(verified.user)) : "one-time token verified; bearer token saved on this device"
|
|
56985
57388
|
});
|
|
56986
57389
|
}
|
|
56987
57390
|
async function assertOneTimeTokenAuthSessionSaved(input) {
|
|
@@ -57041,7 +57444,7 @@ function parseAuthLoginMethod(value) {
|
|
|
57041
57444
|
}
|
|
57042
57445
|
function resolveClientIdForLogin(value, resolvedView) {
|
|
57043
57446
|
try {
|
|
57044
|
-
return
|
|
57447
|
+
return resolveDeviceAuthClientId(value);
|
|
57045
57448
|
} catch (error) {
|
|
57046
57449
|
if (resolvedView === "agent") throw createAuthLoginGuideError(toErrorMessage$13(error));
|
|
57047
57450
|
throw error;
|
|
@@ -57111,6 +57514,7 @@ function emitBrowserOpenLine(input) {
|
|
|
57111
57514
|
});
|
|
57112
57515
|
}
|
|
57113
57516
|
async function runAuthLogout(input) {
|
|
57517
|
+
await assertAuthSessionMutationAvailable();
|
|
57114
57518
|
const runtime = await resolveRuntimeContext({ view: input?.view });
|
|
57115
57519
|
const presenter = createPresenter(runtime);
|
|
57116
57520
|
emitAuthOverviewIfNeeded({
|
|
@@ -57283,47 +57687,13 @@ function resolveDaemonStopWarningText(input) {
|
|
|
57283
57687
|
if (input.reason === "invalid_state") return "OpenMeld found stale local OpenMeld Service runtime state and cleared what it could.";
|
|
57284
57688
|
return formatInlineOpenMeldCliCommands(`OpenMeld could not stop OpenMeld Service cleanly.${input.errorMessage ? ` ${input.errorMessage}` : ""} Run \`openmeld service stop --force\` if it is still running.`);
|
|
57285
57689
|
}
|
|
57286
|
-
async function verifyOneTimeToken(input) {
|
|
57287
|
-
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/one-time-token/verify");
|
|
57288
|
-
const response = await fetch(endpoint, {
|
|
57289
|
-
method: "POST",
|
|
57290
|
-
headers: { "content-type": "application/json" },
|
|
57291
|
-
body: JSON.stringify({ token: input.token }),
|
|
57292
|
-
signal: AbortSignal.timeout(1e4)
|
|
57293
|
-
});
|
|
57294
|
-
const payload = await parseResponseJson(response);
|
|
57295
|
-
if (!response.ok) {
|
|
57296
|
-
const message = extractApiErrorMessage(payload, response.status);
|
|
57297
|
-
const normalizedMessage = message.toLowerCase();
|
|
57298
|
-
if (normalizedMessage.includes("expired")) throw new OneTimeTokenAuthError("expired_token", "one-time token expired; generate a new token and retry");
|
|
57299
|
-
if (normalizedMessage.includes("session not found")) throw new OneTimeTokenAuthError("expired_token", "one-time token session is no longer valid; sign in to OpenMeld Web again, copy a fresh command, and retry");
|
|
57300
|
-
if (normalizedMessage.includes("invalid")) throw new OneTimeTokenAuthError("invalid_token", "invalid one-time token; generate a new token and retry");
|
|
57301
|
-
throw new OneTimeTokenAuthError("unknown", `one-time token verification failed: ${message}`);
|
|
57302
|
-
}
|
|
57303
|
-
const accessToken = normalizeOptionalString$7(response.headers.get("set-auth-token"));
|
|
57304
|
-
if (!accessToken) throw new OneTimeTokenAuthError("missing_access_token", "one-time token verified but auth response is missing set-auth-token");
|
|
57305
|
-
return {
|
|
57306
|
-
accessToken,
|
|
57307
|
-
user: readAuthUserFromSessionPayload(payload),
|
|
57308
|
-
expiresAt: readSessionExpiresAtFromPayload(payload)
|
|
57309
|
-
};
|
|
57310
|
-
}
|
|
57311
|
-
function readSessionExpiresAtFromPayload(payload) {
|
|
57312
|
-
if (!(payload && typeof payload === "object" && "session" in payload)) return;
|
|
57313
|
-
const session = payload.session;
|
|
57314
|
-
if (!(session && typeof session === "object")) return;
|
|
57315
|
-
const raw = readOptionalStringField(session, "expiresAt");
|
|
57316
|
-
if (!raw) return;
|
|
57317
|
-
const parsed = new Date(raw);
|
|
57318
|
-
if (Number.isNaN(parsed.getTime())) return;
|
|
57319
|
-
return parsed.toISOString();
|
|
57320
|
-
}
|
|
57321
57690
|
async function requestDeviceCode(input) {
|
|
57322
57691
|
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/device/code");
|
|
57692
|
+
const requestBody = betterAuthDeviceAuthorizationCodeRequestSchema.parse({ client_id: input.clientId });
|
|
57323
57693
|
const response = await fetch(endpoint, {
|
|
57324
57694
|
method: "POST",
|
|
57325
57695
|
headers: { "content-type": "application/json" },
|
|
57326
|
-
body: JSON.stringify(
|
|
57696
|
+
body: JSON.stringify(requestBody),
|
|
57327
57697
|
signal: AbortSignal.timeout(1e4)
|
|
57328
57698
|
});
|
|
57329
57699
|
const payload = await parseResponseJson(response);
|
|
@@ -57332,46 +57702,13 @@ async function requestDeviceCode(input) {
|
|
|
57332
57702
|
status: response.status,
|
|
57333
57703
|
endpoint
|
|
57334
57704
|
});
|
|
57335
|
-
|
|
57336
|
-
|
|
57337
|
-
|
|
57338
|
-
|
|
57339
|
-
|
|
57340
|
-
expires_in: readNumberField(payload, "expires_in"),
|
|
57341
|
-
interval: readNumberField(payload, "interval")
|
|
57342
|
-
};
|
|
57343
|
-
}
|
|
57344
|
-
async function requestDeviceToken(input) {
|
|
57345
|
-
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/device/token");
|
|
57346
|
-
const response = await fetch(endpoint, {
|
|
57347
|
-
method: "POST",
|
|
57348
|
-
headers: { "content-type": "application/json" },
|
|
57349
|
-
body: JSON.stringify({
|
|
57350
|
-
grant_type: DEVICE_GRANT_TYPE,
|
|
57351
|
-
device_code: input.deviceCode,
|
|
57352
|
-
client_id: input.clientId
|
|
57353
|
-
}),
|
|
57354
|
-
signal: AbortSignal.timeout(1e4)
|
|
57705
|
+
const parsed = betterAuthDeviceAuthorizationCodeResponseSchema.safeParse(payload);
|
|
57706
|
+
if (!parsed.success) throw new AuthHttpError({
|
|
57707
|
+
message: "device code response did not match the Better Auth contract",
|
|
57708
|
+
status: response.status,
|
|
57709
|
+
endpoint
|
|
57355
57710
|
});
|
|
57356
|
-
|
|
57357
|
-
if (response.ok) return {
|
|
57358
|
-
ok: true,
|
|
57359
|
-
data: {
|
|
57360
|
-
access_token: normalizeRequiredString(readStringField$2(payload, "access_token"), "missing access_token in device token response"),
|
|
57361
|
-
token_type: normalizeOptionalString$7(readStringField$2(payload, "token_type")) ?? void 0,
|
|
57362
|
-
expires_in: readNumberField(payload, "expires_in"),
|
|
57363
|
-
scope: normalizeOptionalString$7(readStringField$2(payload, "scope")) ?? void 0
|
|
57364
|
-
}
|
|
57365
|
-
};
|
|
57366
|
-
return {
|
|
57367
|
-
ok: false,
|
|
57368
|
-
error: {
|
|
57369
|
-
error: normalizeOptionalString$7(readStringField$2(payload, "error")) ?? void 0,
|
|
57370
|
-
error_description: normalizeOptionalString$7(readStringField$2(payload, "error_description")) ?? void 0,
|
|
57371
|
-
message: normalizeOptionalString$7(readStringField$2(payload, "message")) ?? void 0
|
|
57372
|
-
},
|
|
57373
|
-
status: response.status
|
|
57374
|
-
};
|
|
57711
|
+
return parsed.data;
|
|
57375
57712
|
}
|
|
57376
57713
|
async function pollForDeviceToken(input) {
|
|
57377
57714
|
const deadline = Date.now() + input.expiresInSeconds * 1e3;
|
|
@@ -57410,7 +57747,7 @@ async function pollForDeviceToken(input) {
|
|
|
57410
57747
|
if (errorCode === "access_denied") throw new DeviceAuthError("access_denied", "browser sign-in was canceled");
|
|
57411
57748
|
if (errorCode === "expired_token") throw new DeviceAuthError("expired_token", "browser sign-in expired; sign in again");
|
|
57412
57749
|
if (errorCode === "invalid_grant") throw new DeviceAuthError("invalid_grant", "browser sign-in is no longer valid; sign in again");
|
|
57413
|
-
throw new DeviceAuthError("unknown", `browser sign-in failed: ${
|
|
57750
|
+
throw new DeviceAuthError("unknown", `browser sign-in failed: ${extractAuthApiErrorMessage(result.error, result.status)}`);
|
|
57414
57751
|
}
|
|
57415
57752
|
throw new DeviceAuthError("expired_token", "browser sign-in timed out; sign in again");
|
|
57416
57753
|
}
|
|
@@ -57443,23 +57780,9 @@ function resolveExpiresInSeconds(value) {
|
|
|
57443
57780
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return 1800;
|
|
57444
57781
|
return clampInteger(value, 60, 1440 * 60);
|
|
57445
57782
|
}
|
|
57446
|
-
function resolveExpiresAt(expiresIn) {
|
|
57447
|
-
if (typeof expiresIn !== "number" || !Number.isFinite(expiresIn) || expiresIn <= 0) return;
|
|
57448
|
-
const now = Date.now();
|
|
57449
|
-
const maxFutureMs = Math.max(0, Math.min(Number.MAX_SAFE_INTEGER, 864e13) - now);
|
|
57450
|
-
const maxFutureSeconds = Math.floor(maxFutureMs / 1e3);
|
|
57451
|
-
const safeExpiresInSeconds = Math.min(Math.floor(expiresIn), maxFutureSeconds);
|
|
57452
|
-
if (safeExpiresInSeconds <= 0) return;
|
|
57453
|
-
return new Date(now + safeExpiresInSeconds * 1e3).toISOString();
|
|
57454
|
-
}
|
|
57455
57783
|
function clampInteger(value, min, max) {
|
|
57456
57784
|
return Math.max(min, Math.min(max, Math.floor(value)));
|
|
57457
57785
|
}
|
|
57458
|
-
function resolveClientId(value) {
|
|
57459
|
-
const clientId = normalizeOptionalString$7(value) ?? normalizeOptionalString$7(process.env.OPENMELD_AUTH_CLIENT_ID) ?? DEFAULT_DEVICE_CLIENT_ID;
|
|
57460
|
-
if (!DEVICE_CLIENT_ID_PATTERN.test(clientId)) throw new Error(`invalid client_id "${clientId}" (allowed: letters, numbers, . _ : -)`);
|
|
57461
|
-
return clientId;
|
|
57462
|
-
}
|
|
57463
57786
|
function normalizeRequiredString(value, message) {
|
|
57464
57787
|
const normalized = normalizeOptionalString$7(value);
|
|
57465
57788
|
if (!normalized) throw new Error(message);
|
|
@@ -57478,11 +57801,6 @@ function readStringField$2(payload, key) {
|
|
|
57478
57801
|
const value = payload[key];
|
|
57479
57802
|
return typeof value === "string" ? value : null;
|
|
57480
57803
|
}
|
|
57481
|
-
function readNumberField(payload, key) {
|
|
57482
|
-
if (!(payload && typeof payload === "object" && key in payload)) return;
|
|
57483
|
-
const value = payload[key];
|
|
57484
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
57485
|
-
}
|
|
57486
57804
|
async function parseResponseJson(response) {
|
|
57487
57805
|
const raw = await response.text();
|
|
57488
57806
|
if (!raw) return null;
|
|
@@ -57543,45 +57861,11 @@ function emitLineWithHumanSpacer(input) {
|
|
|
57543
57861
|
text: ""
|
|
57544
57862
|
});
|
|
57545
57863
|
}
|
|
57546
|
-
async function fetchAuthUserSnapshot(input) {
|
|
57547
|
-
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/get-session");
|
|
57548
|
-
try {
|
|
57549
|
-
const response = await fetch(endpoint, {
|
|
57550
|
-
method: "GET",
|
|
57551
|
-
headers: { authorization: `Bearer ${input.accessToken}` },
|
|
57552
|
-
signal: AbortSignal.timeout(1e4)
|
|
57553
|
-
});
|
|
57554
|
-
if (!response.ok) return null;
|
|
57555
|
-
return readAuthUserFromSessionPayload(await parseResponseJson(response));
|
|
57556
|
-
} catch {
|
|
57557
|
-
return null;
|
|
57558
|
-
}
|
|
57559
|
-
}
|
|
57560
|
-
function readAuthUserFromSessionPayload(payload) {
|
|
57561
|
-
if (!(payload && typeof payload === "object" && "user" in payload)) return null;
|
|
57562
|
-
const user = payload.user;
|
|
57563
|
-
if (!(user && typeof user === "object")) return null;
|
|
57564
|
-
const userRecord = user;
|
|
57565
|
-
const id = readOptionalStringField(userRecord, "id");
|
|
57566
|
-
const email = readOptionalStringField(userRecord, "email");
|
|
57567
|
-
const name = readOptionalStringField(userRecord, "name");
|
|
57568
|
-
if (!(id || email || name)) return null;
|
|
57569
|
-
return {
|
|
57570
|
-
...id ? { id } : {},
|
|
57571
|
-
...email ? { email } : {},
|
|
57572
|
-
...name ? { name } : {}
|
|
57573
|
-
};
|
|
57574
|
-
}
|
|
57575
57864
|
function resolveHumanLoginSuccessText(user) {
|
|
57576
57865
|
const email = normalizeOptionalString$7(user?.email);
|
|
57577
57866
|
if (email) return `✅ Welcome ${email}`;
|
|
57578
57867
|
return "✅ Signed in.";
|
|
57579
57868
|
}
|
|
57580
|
-
function readOptionalStringField(input, key) {
|
|
57581
|
-
const value = input[key];
|
|
57582
|
-
if (typeof value !== "string") return;
|
|
57583
|
-
return normalizeOptionalString$7(value) ?? void 0;
|
|
57584
|
-
}
|
|
57585
57869
|
function toDeviceAuthError(error) {
|
|
57586
57870
|
if (error instanceof DeviceAuthError) return error;
|
|
57587
57871
|
if (error instanceof Error) return new DeviceAuthError("unknown", error.message);
|
|
@@ -58971,7 +59255,7 @@ function flushDispatchResultOutbox(input) {
|
|
|
58971
59255
|
return {
|
|
58972
59256
|
...record,
|
|
58973
59257
|
attemptCount: record.attemptCount + 1,
|
|
58974
|
-
lastFailureReason: toErrorMessage$
|
|
59258
|
+
lastFailureReason: toErrorMessage$32(error),
|
|
58975
59259
|
nextAttemptAtMs: nowMs + resolveSendFailureBackoffMs(record.attemptCount + 1),
|
|
58976
59260
|
updatedAtMs: nowMs
|
|
58977
59261
|
};
|
|
@@ -60949,7 +61233,7 @@ async function runAttempt(attempt, deps) {
|
|
|
60949
61233
|
} catch (error) {
|
|
60950
61234
|
await deps.completeAttempt({
|
|
60951
61235
|
...running,
|
|
60952
|
-
errorMessage: toErrorMessage$
|
|
61236
|
+
errorMessage: toErrorMessage$43(error),
|
|
60953
61237
|
operation: {
|
|
60954
61238
|
...running.operation,
|
|
60955
61239
|
phase: "needs_help",
|
|
@@ -61213,7 +61497,7 @@ async function persistRuntimeReportingAttempt(attempt, serviceIdentity) {
|
|
|
61213
61497
|
});
|
|
61214
61498
|
} catch (error) {
|
|
61215
61499
|
warnDaemonEvent("[openmeld.runtime_reporting.health_write_failed]", {
|
|
61216
|
-
error: toErrorMessage$
|
|
61500
|
+
error: toErrorMessage$32(error),
|
|
61217
61501
|
event: "cli.runtime_reporting.health_write_failed",
|
|
61218
61502
|
family: attempt.family,
|
|
61219
61503
|
reasonCode: attempt.reasonCode,
|
|
@@ -65236,7 +65520,7 @@ function resolveSystemServiceStartupFailureVerdict(input) {
|
|
|
65236
65520
|
controller: input.controller,
|
|
65237
65521
|
jobDiagnostics,
|
|
65238
65522
|
localMachineIssue,
|
|
65239
|
-
message: sanitizeSystemServiceErrorMessage$1(toErrorMessage$
|
|
65523
|
+
message: sanitizeSystemServiceErrorMessage$1(toErrorMessage$43(input.error)),
|
|
65240
65524
|
detail: input.detail ?? null
|
|
65241
65525
|
};
|
|
65242
65526
|
}
|
|
@@ -65755,7 +66039,7 @@ async function runDaemonServiceParticipationRefresh(input) {
|
|
|
65755
66039
|
suppressed: input.input.suppressRefreshHumanResultCard === true
|
|
65756
66040
|
});
|
|
65757
66041
|
return {
|
|
65758
|
-
errorMessage: toErrorMessage$
|
|
66042
|
+
errorMessage: toErrorMessage$32(error),
|
|
65759
66043
|
status: "needs_attention"
|
|
65760
66044
|
};
|
|
65761
66045
|
}
|
|
@@ -67950,7 +68234,7 @@ function toTaskExecutionError(error) {
|
|
|
67950
68234
|
return {
|
|
67951
68235
|
errorCode: "dispatch.execution_failed",
|
|
67952
68236
|
errorType: "internal",
|
|
67953
|
-
message: toErrorMessage$
|
|
68237
|
+
message: toErrorMessage$32(error)
|
|
67954
68238
|
};
|
|
67955
68239
|
}
|
|
67956
68240
|
//#endregion
|
|
@@ -69781,7 +70065,7 @@ function reportInvalidDeliverRequest(input) {
|
|
|
69781
70065
|
leaseEpoch: identity.leaseEpoch,
|
|
69782
70066
|
metadata: {
|
|
69783
70067
|
...buildResultDispatchJournalMetadata(resultPayload),
|
|
69784
|
-
errorMessage: toErrorMessage$
|
|
70068
|
+
errorMessage: toErrorMessage$32(error),
|
|
69785
70069
|
parseIssues: issues
|
|
69786
70070
|
},
|
|
69787
70071
|
profileId: identity.targetProfileId,
|
|
@@ -69792,10 +70076,10 @@ function reportInvalidDeliverRequest(input) {
|
|
|
69792
70076
|
emitRunLine({
|
|
69793
70077
|
presenter: input.presenter,
|
|
69794
70078
|
code: "daemon.run.invalid_deliver_result_send_failed",
|
|
69795
|
-
text: `failed to send invalid deliver result for dispatch ${identity.dispatchId}: ${toErrorMessage$
|
|
70079
|
+
text: `failed to send invalid deliver result for dispatch ${identity.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
69796
70080
|
payload: {
|
|
69797
70081
|
dispatchId: identity.dispatchId,
|
|
69798
|
-
errorMessage: toErrorMessage$
|
|
70082
|
+
errorMessage: toErrorMessage$32(error),
|
|
69799
70083
|
result: "failed",
|
|
69800
70084
|
taskId: identity.taskId
|
|
69801
70085
|
}
|
|
@@ -70248,7 +70532,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70248
70532
|
text: `Session Inventory origin could not be recorded for task ${parsedTask.taskId}`,
|
|
70249
70533
|
payload: {
|
|
70250
70534
|
dispatchId: parsedTask.dispatchId,
|
|
70251
|
-
errorMessage: toErrorMessage$
|
|
70535
|
+
errorMessage: toErrorMessage$32(error),
|
|
70252
70536
|
targetProfileId: parsedTask.targetProfileId,
|
|
70253
70537
|
taskId: parsedTask.taskId
|
|
70254
70538
|
}
|
|
@@ -70281,7 +70565,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70281
70565
|
text: `provider conversation observation could not be persisted for task ${parsedTask.taskId}`,
|
|
70282
70566
|
payload: {
|
|
70283
70567
|
dispatchId: parsedTask.dispatchId,
|
|
70284
|
-
errorMessage: toErrorMessage$
|
|
70568
|
+
errorMessage: toErrorMessage$32(error),
|
|
70285
70569
|
source: observation.source,
|
|
70286
70570
|
targetProfileId: parsedTask.targetProfileId,
|
|
70287
70571
|
taskId: parsedTask.taskId
|
|
@@ -70365,7 +70649,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70365
70649
|
payload: {
|
|
70366
70650
|
agentControllerRef: parsedTask.agentControllerRef,
|
|
70367
70651
|
dispatchId: parsedTask.dispatchId,
|
|
70368
|
-
errorMessage: toErrorMessage$
|
|
70652
|
+
errorMessage: toErrorMessage$32(error),
|
|
70369
70653
|
observedLimitKeys: event.usageLimits.map((limit) => limit.key),
|
|
70370
70654
|
targetProfileId: parsedTask.targetProfileId,
|
|
70371
70655
|
taskId: parsedTask.taskId
|
|
@@ -71050,7 +71334,7 @@ async function resolveDispatchSpaceMetaContext(input) {
|
|
|
71050
71334
|
} catch (error) {
|
|
71051
71335
|
return {
|
|
71052
71336
|
status: "failed",
|
|
71053
|
-
errorMessage: toErrorMessage$
|
|
71337
|
+
errorMessage: toErrorMessage$32(error),
|
|
71054
71338
|
spaceGuide: null,
|
|
71055
71339
|
spaceName: null,
|
|
71056
71340
|
spacePurpose: null
|
|
@@ -71424,7 +71708,7 @@ async function resolveAlreadyCompletedRuntimeResultAfterCliSpaceAction(input) {
|
|
|
71424
71708
|
text: `runtime failed after CLI OpenMeld Space Action finalized task ${input.parsedTask.taskId}`,
|
|
71425
71709
|
payload: {
|
|
71426
71710
|
dispatchId: input.parsedTask.dispatchId,
|
|
71427
|
-
errorMessage: toErrorMessage$
|
|
71711
|
+
errorMessage: toErrorMessage$32(error),
|
|
71428
71712
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
71429
71713
|
taskId: input.parsedTask.taskId
|
|
71430
71714
|
}
|
|
@@ -71442,7 +71726,7 @@ function observeRuntimeResultAfterCliSpaceAction(input) {
|
|
|
71442
71726
|
text: `runtime failed after CLI OpenMeld Space Action finalized task ${input.parsedTask.taskId}`,
|
|
71443
71727
|
payload: {
|
|
71444
71728
|
dispatchId: input.parsedTask.dispatchId,
|
|
71445
|
-
errorMessage: toErrorMessage$
|
|
71729
|
+
errorMessage: toErrorMessage$32(error),
|
|
71446
71730
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
71447
71731
|
taskId: input.parsedTask.taskId
|
|
71448
71732
|
}
|
|
@@ -71690,7 +71974,7 @@ async function coordinateConcurrentAgentReply(input) {
|
|
|
71690
71974
|
text: `Agent reply observation unavailable for task ${input.parsedTask.taskId}`,
|
|
71691
71975
|
payload: {
|
|
71692
71976
|
dispatchId: input.parsedTask.dispatchId,
|
|
71693
|
-
errorMessage: toErrorMessage$
|
|
71977
|
+
errorMessage: toErrorMessage$32(error),
|
|
71694
71978
|
observedThroughSignalId,
|
|
71695
71979
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
71696
71980
|
taskId: input.parsedTask.taskId
|
|
@@ -71862,7 +72146,7 @@ function normalizeResolvedPostMessageAction(input) {
|
|
|
71862
72146
|
resolvedSpaceAction: normalizedPostMessageAction.action
|
|
71863
72147
|
};
|
|
71864
72148
|
} catch (error) {
|
|
71865
|
-
const failureReason = toErrorMessage$
|
|
72149
|
+
const failureReason = toErrorMessage$32(error);
|
|
71866
72150
|
emitRunLine({
|
|
71867
72151
|
presenter: input.presenter,
|
|
71868
72152
|
code: "daemon.run.post_message_validation_rejected",
|
|
@@ -71924,7 +72208,7 @@ function normalizeResolvedThreadAction(input) {
|
|
|
71924
72208
|
})
|
|
71925
72209
|
};
|
|
71926
72210
|
} catch (error) {
|
|
71927
|
-
const failureReason = toErrorMessage$
|
|
72211
|
+
const failureReason = toErrorMessage$32(error);
|
|
71928
72212
|
emitRunLine({
|
|
71929
72213
|
presenter: input.presenter,
|
|
71930
72214
|
code: "daemon.run.thread_action_validation_rejected",
|
|
@@ -72007,7 +72291,7 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
72007
72291
|
dispatchId: input.parsedTask.dispatchId,
|
|
72008
72292
|
...resolveStructuredActionFailureDiagnostics({
|
|
72009
72293
|
carrierKind: "none",
|
|
72010
|
-
parseError: toErrorMessage$
|
|
72294
|
+
parseError: toErrorMessage$32(error),
|
|
72011
72295
|
publicFailureReason: input.failureReason,
|
|
72012
72296
|
repairMode: "controller_roundtrip",
|
|
72013
72297
|
runtimeResult: input.runtimeResult
|
|
@@ -72023,7 +72307,7 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
72023
72307
|
return {
|
|
72024
72308
|
finalFailureDiagnostics: resolveStructuredActionFailureDiagnostics({
|
|
72025
72309
|
carrierKind: "none",
|
|
72026
|
-
parseError: toErrorMessage$
|
|
72310
|
+
parseError: toErrorMessage$32(error),
|
|
72027
72311
|
publicFailureReason: input.failureReason,
|
|
72028
72312
|
repairMode: "controller_roundtrip",
|
|
72029
72313
|
runtimeResult: input.runtimeResult
|
|
@@ -72466,7 +72750,7 @@ function sendResultAndSummarize(input) {
|
|
|
72466
72750
|
leaseEpoch: input.leaseEpoch,
|
|
72467
72751
|
metadata: {
|
|
72468
72752
|
...buildResultDispatchJournalMetadata(input.payload),
|
|
72469
|
-
errorMessage: toErrorMessage$
|
|
72753
|
+
errorMessage: toErrorMessage$32(error)
|
|
72470
72754
|
},
|
|
72471
72755
|
result: input.payload.status,
|
|
72472
72756
|
taskId: input.taskId,
|
|
@@ -72475,7 +72759,7 @@ function sendResultAndSummarize(input) {
|
|
|
72475
72759
|
emitRunLine({
|
|
72476
72760
|
presenter: input.presenter,
|
|
72477
72761
|
code: "daemon.run.result_send_failed",
|
|
72478
|
-
text: `daemon result send failed for dispatch ${input.dispatchId}: ${toErrorMessage$
|
|
72762
|
+
text: `daemon result send failed for dispatch ${input.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72479
72763
|
payload: {
|
|
72480
72764
|
attemptId: input.attemptId,
|
|
72481
72765
|
connectionGeneration: input.connectionGeneration,
|
|
@@ -72580,7 +72864,7 @@ async function requestDispatchAgentInteraction(input) {
|
|
|
72580
72864
|
taskId: input.parsedTask.taskId
|
|
72581
72865
|
});
|
|
72582
72866
|
} catch (error) {
|
|
72583
|
-
input.pendingAgentInteractionRegistry.reject(parsedInteraction.data.interactionId, error instanceof Error ? error : new Error(toErrorMessage$
|
|
72867
|
+
input.pendingAgentInteractionRegistry.reject(parsedInteraction.data.interactionId, error instanceof Error ? error : new Error(toErrorMessage$32(error)));
|
|
72584
72868
|
throw error;
|
|
72585
72869
|
}
|
|
72586
72870
|
emitRunLine({
|
|
@@ -72616,7 +72900,7 @@ function emitDispatchPreviewFrame(input) {
|
|
|
72616
72900
|
emitRunLine({
|
|
72617
72901
|
presenter: input.presenter,
|
|
72618
72902
|
code: "daemon.run.preview_send_failed",
|
|
72619
|
-
text: `daemon preview send failed for dispatch ${input.dispatchId}: ${toErrorMessage$
|
|
72903
|
+
text: `daemon preview send failed for dispatch ${input.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72620
72904
|
payload: {
|
|
72621
72905
|
attemptId: input.attemptId,
|
|
72622
72906
|
dispatchId: input.dispatchId,
|
|
@@ -72658,7 +72942,7 @@ function emitDispatchAgentToolActivityFrame(input) {
|
|
|
72658
72942
|
emitRunLine({
|
|
72659
72943
|
presenter: input.presenter,
|
|
72660
72944
|
code: "daemon.run.tool_activity_send_failed",
|
|
72661
|
-
text: `daemon tool activity send failed for dispatch ${input.parsedTask.dispatchId}: ${toErrorMessage$
|
|
72945
|
+
text: `daemon tool activity send failed for dispatch ${input.parsedTask.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72662
72946
|
payload: {
|
|
72663
72947
|
attemptId: input.parsedTask.attemptId,
|
|
72664
72948
|
dispatchId: input.parsedTask.dispatchId,
|
|
@@ -72687,7 +72971,7 @@ function emitDispatchPreviewEndFrame(input) {
|
|
|
72687
72971
|
emitRunLine({
|
|
72688
72972
|
presenter: input.presenter,
|
|
72689
72973
|
code: "daemon.run.preview_end_send_failed",
|
|
72690
|
-
text: `daemon preview end send failed for dispatch ${input.dispatchId}: ${toErrorMessage$
|
|
72974
|
+
text: `daemon preview end send failed for dispatch ${input.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72691
72975
|
payload: {
|
|
72692
72976
|
attemptId: input.attemptId,
|
|
72693
72977
|
dispatchId: input.dispatchId,
|
|
@@ -72729,7 +73013,7 @@ function emitDispatchRuntimeEvidenceTransition(input) {
|
|
|
72729
73013
|
emitRunLine({
|
|
72730
73014
|
presenter: input.presenter,
|
|
72731
73015
|
code: "daemon.run.runtime_evidence_send_failed",
|
|
72732
|
-
text: `daemon runtime evidence ${input.phase} send failed for dispatch ${identity.dispatchId}: ${toErrorMessage$
|
|
73016
|
+
text: `daemon runtime evidence ${input.phase} send failed for dispatch ${identity.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72733
73017
|
payload: {
|
|
72734
73018
|
attemptId: identity.attemptId,
|
|
72735
73019
|
dispatchId: identity.dispatchId,
|
|
@@ -72828,7 +73112,7 @@ function emitDispatchLifecycleTransition(input) {
|
|
|
72828
73112
|
dispatchId: input.dispatchId,
|
|
72829
73113
|
leaseEpoch: input.leaseEpoch,
|
|
72830
73114
|
metadata: {
|
|
72831
|
-
errorMessage: toErrorMessage$
|
|
73115
|
+
errorMessage: toErrorMessage$32(error),
|
|
72832
73116
|
localQueue: input.localQueue ?? null,
|
|
72833
73117
|
phase: input.phase
|
|
72834
73118
|
},
|
|
@@ -72839,7 +73123,7 @@ function emitDispatchLifecycleTransition(input) {
|
|
|
72839
73123
|
emitRunLine({
|
|
72840
73124
|
presenter: input.presenter,
|
|
72841
73125
|
code: "daemon.run.lifecycle_send_failed",
|
|
72842
|
-
text: `daemon lifecycle ${input.phase} send failed for dispatch ${input.dispatchId}: ${toErrorMessage$
|
|
73126
|
+
text: `daemon lifecycle ${input.phase} send failed for dispatch ${input.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72843
73127
|
payload: {
|
|
72844
73128
|
attemptId: input.attemptId,
|
|
72845
73129
|
dispatchId: input.dispatchId,
|
|
@@ -73266,7 +73550,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73266
73550
|
emitRunLine({
|
|
73267
73551
|
presenter: input.presenter,
|
|
73268
73552
|
code: "daemon.run.control_cancel_failed",
|
|
73269
|
-
text: `local cancel handling failed: ${toErrorMessage$
|
|
73553
|
+
text: `local cancel handling failed: ${toErrorMessage$32(error)}`,
|
|
73270
73554
|
payload: {
|
|
73271
73555
|
requestId: parsedCancelFrame.data.requestId,
|
|
73272
73556
|
target: parsedCancelFrame.data.payload.target
|
|
@@ -73278,7 +73562,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73278
73562
|
requestId: parsedCancelFrame.data.requestId,
|
|
73279
73563
|
payload: {
|
|
73280
73564
|
accepted: false,
|
|
73281
|
-
note: toErrorMessage$
|
|
73565
|
+
note: toErrorMessage$32(error),
|
|
73282
73566
|
reasonCode: "local_control.unhandled_error",
|
|
73283
73567
|
target: parsedCancelFrame.data.payload.target
|
|
73284
73568
|
}
|
|
@@ -73314,7 +73598,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73314
73598
|
emitRunLine({
|
|
73315
73599
|
presenter: input.presenter,
|
|
73316
73600
|
code: "daemon.run.control_interrupt_failed",
|
|
73317
|
-
text: `local interrupt handling failed: ${toErrorMessage$
|
|
73601
|
+
text: `local interrupt handling failed: ${toErrorMessage$32(error)}`,
|
|
73318
73602
|
payload: {
|
|
73319
73603
|
requestId: parsedInterruptFrame.data.requestId,
|
|
73320
73604
|
target: parsedInterruptFrame.data.payload.target
|
|
@@ -73326,7 +73610,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73326
73610
|
requestId: parsedInterruptFrame.data.requestId,
|
|
73327
73611
|
payload: {
|
|
73328
73612
|
accepted: false,
|
|
73329
|
-
note: toErrorMessage$
|
|
73613
|
+
note: toErrorMessage$32(error),
|
|
73330
73614
|
reasonCode: "local_control.unhandled_error",
|
|
73331
73615
|
target: parsedInterruptFrame.data.payload.target
|
|
73332
73616
|
}
|
|
@@ -73517,7 +73801,7 @@ function handleComputerFileAccessSocketFrame(input) {
|
|
|
73517
73801
|
emitRunLine({
|
|
73518
73802
|
presenter: input.presenter,
|
|
73519
73803
|
code: "daemon.run.computer_file_access_failed",
|
|
73520
|
-
text: `Computer file access failed: ${toErrorMessage$
|
|
73804
|
+
text: `Computer file access failed: ${toErrorMessage$32(error)}`
|
|
73521
73805
|
});
|
|
73522
73806
|
});
|
|
73523
73807
|
return true;
|
|
@@ -73536,14 +73820,14 @@ function handleLocalProjectControlSocketFrame(input) {
|
|
|
73536
73820
|
emitRunLine({
|
|
73537
73821
|
presenter: input.presenter,
|
|
73538
73822
|
code: "daemon.run.agent_activity_connection_signal_failed",
|
|
73539
|
-
text: `Agent Activity connection signal failed: ${toErrorMessage$
|
|
73823
|
+
text: `Agent Activity connection signal failed: ${toErrorMessage$32(error)}`
|
|
73540
73824
|
});
|
|
73541
73825
|
}
|
|
73542
73826
|
}).catch((error) => {
|
|
73543
73827
|
emitRunLine({
|
|
73544
73828
|
presenter: input.presenter,
|
|
73545
73829
|
code: "daemon.run.local_project_control_failed",
|
|
73546
|
-
text: `local Project control failed: ${toErrorMessage$
|
|
73830
|
+
text: `local Project control failed: ${toErrorMessage$32(error)}`
|
|
73547
73831
|
});
|
|
73548
73832
|
});
|
|
73549
73833
|
return true;
|
|
@@ -73758,7 +74042,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73758
74042
|
function recordHeartbeatFailure(error) {
|
|
73759
74043
|
consecutiveHeartbeatFailures += 1;
|
|
73760
74044
|
const shouldCloseSocket = consecutiveHeartbeatFailures >= 3;
|
|
73761
|
-
const errorMessage = toErrorMessage$
|
|
74045
|
+
const errorMessage = toErrorMessage$32(error);
|
|
73762
74046
|
emitRunLine({
|
|
73763
74047
|
presenter: input.presenter,
|
|
73764
74048
|
code: "daemon.run.heartbeat_failed",
|
|
@@ -73951,7 +74235,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73951
74235
|
emitRunLine({
|
|
73952
74236
|
presenter: input.presenter,
|
|
73953
74237
|
code: "daemon.run.heartbeat_failed",
|
|
73954
|
-
text: `heartbeat failed: ${toErrorMessage$
|
|
74238
|
+
text: `heartbeat failed: ${toErrorMessage$32(error)}`
|
|
73955
74239
|
});
|
|
73956
74240
|
});
|
|
73957
74241
|
}, normalizedDelayMs);
|
|
@@ -73993,7 +74277,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73993
74277
|
emitRunLine({
|
|
73994
74278
|
presenter: input.presenter,
|
|
73995
74279
|
code: "daemon.run.catalog_sync_signal_read_failed",
|
|
73996
|
-
text: `catalog sync signal read failed: ${toErrorMessage$
|
|
74280
|
+
text: `catalog sync signal read failed: ${toErrorMessage$32(error)}`
|
|
73997
74281
|
});
|
|
73998
74282
|
}).finally(() => {
|
|
73999
74283
|
scheduleCatalogSyncSignalPoll();
|
|
@@ -74054,7 +74338,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74054
74338
|
emitRunLine({
|
|
74055
74339
|
presenter: input.presenter,
|
|
74056
74340
|
code: "daemon.run.local_components_status_failed",
|
|
74057
|
-
text: `local components status unavailable: ${toErrorMessage$
|
|
74341
|
+
text: `local components status unavailable: ${toErrorMessage$32(error)}`
|
|
74058
74342
|
});
|
|
74059
74343
|
return null;
|
|
74060
74344
|
}
|
|
@@ -74268,12 +74552,12 @@ async function runDaemonSocketSession(input) {
|
|
|
74268
74552
|
if (closed || routeCatalogSyncInFlight || !shouldStartRouteCatalogSync()) return;
|
|
74269
74553
|
routeCatalogSyncInFlight = true;
|
|
74270
74554
|
syncRouteCatalogIfDue().catch((error) => {
|
|
74271
|
-
const syncError = error instanceof Error ? error : new Error(toErrorMessage$
|
|
74555
|
+
const syncError = error instanceof Error ? error : new Error(toErrorMessage$32(error));
|
|
74272
74556
|
failPendingRouteCatalogSyncRequests(syncError);
|
|
74273
74557
|
emitRunLine({
|
|
74274
74558
|
presenter: input.presenter,
|
|
74275
74559
|
code: "daemon.run.catalog_sync_failed",
|
|
74276
|
-
text: `catalog sync failed: ${toErrorMessage$
|
|
74560
|
+
text: `catalog sync failed: ${toErrorMessage$32(error)}`
|
|
74277
74561
|
});
|
|
74278
74562
|
}).finally(() => {
|
|
74279
74563
|
routeCatalogSyncInFlight = false;
|
|
@@ -74331,7 +74615,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74331
74615
|
emitRunLine({
|
|
74332
74616
|
presenter: input.presenter,
|
|
74333
74617
|
code: "daemon.run.runtime_agent_controller_report_sync_failed",
|
|
74334
|
-
text: `runtime agent controller report sync failed: ${toErrorMessage$
|
|
74618
|
+
text: `runtime agent controller report sync failed: ${toErrorMessage$32(error)}`
|
|
74335
74619
|
});
|
|
74336
74620
|
throw error;
|
|
74337
74621
|
}
|
|
@@ -74406,7 +74690,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74406
74690
|
emitRunLine({
|
|
74407
74691
|
presenter: input.presenter,
|
|
74408
74692
|
code: "daemon.run.provider_conversation_proof_sync_failed",
|
|
74409
|
-
text: `provider conversation proof sync failed: ${toErrorMessage$
|
|
74693
|
+
text: `provider conversation proof sync failed: ${toErrorMessage$32(error)}`
|
|
74410
74694
|
});
|
|
74411
74695
|
} finally {
|
|
74412
74696
|
providerConversationProofSyncInFlight = false;
|
|
@@ -74417,14 +74701,14 @@ async function runDaemonSocketSession(input) {
|
|
|
74417
74701
|
emitRunLine({
|
|
74418
74702
|
presenter: input.presenter,
|
|
74419
74703
|
code: "daemon.run.runtime_agent_controller_report_sync_failed",
|
|
74420
|
-
text: `runtime agent controller report sync failed: ${toErrorMessage$
|
|
74704
|
+
text: `runtime agent controller report sync failed: ${toErrorMessage$32(error)}`
|
|
74421
74705
|
});
|
|
74422
74706
|
});
|
|
74423
74707
|
syncProviderConversationProofsIfDue().catch((error) => {
|
|
74424
74708
|
emitRunLine({
|
|
74425
74709
|
presenter: input.presenter,
|
|
74426
74710
|
code: "daemon.run.provider_conversation_proof_sync_failed",
|
|
74427
|
-
text: `provider conversation proof sync failed: ${toErrorMessage$
|
|
74711
|
+
text: `provider conversation proof sync failed: ${toErrorMessage$32(error)}`
|
|
74428
74712
|
});
|
|
74429
74713
|
});
|
|
74430
74714
|
};
|
|
@@ -74576,7 +74860,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74576
74860
|
emitRunLine({
|
|
74577
74861
|
presenter: input.presenter,
|
|
74578
74862
|
code: "daemon.run.local_agent_control_report_sync_failed",
|
|
74579
|
-
text: `runtime agent controller report sync failed after local agent control: ${toErrorMessage$
|
|
74863
|
+
text: `runtime agent controller report sync failed after local agent control: ${toErrorMessage$32(error)}`
|
|
74580
74864
|
});
|
|
74581
74865
|
}
|
|
74582
74866
|
if (result.changed) requestLocalExecutionEvidenceRefresh({
|
|
@@ -74605,7 +74889,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74605
74889
|
status: result.status
|
|
74606
74890
|
};
|
|
74607
74891
|
} catch (error) {
|
|
74608
|
-
const message = toErrorMessage$
|
|
74892
|
+
const message = toErrorMessage$32(error);
|
|
74609
74893
|
const reasonCode = resolveLocalAgentEnabledErrorCode$1(error);
|
|
74610
74894
|
emitRunLine({
|
|
74611
74895
|
presenter: input.presenter,
|
|
@@ -74641,7 +74925,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74641
74925
|
emitRunLine({
|
|
74642
74926
|
presenter: input.presenter,
|
|
74643
74927
|
code: "daemon.run.local_agent_installation_report_sync_failed",
|
|
74644
|
-
text: `runtime agent controller report sync failed after installation change: ${toErrorMessage$
|
|
74928
|
+
text: `runtime agent controller report sync failed after installation change: ${toErrorMessage$32(error)}`
|
|
74645
74929
|
});
|
|
74646
74930
|
}
|
|
74647
74931
|
requestLocalExecutionEvidenceRefresh({
|
|
@@ -74674,7 +74958,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74674
74958
|
status: result.status
|
|
74675
74959
|
};
|
|
74676
74960
|
} catch (error) {
|
|
74677
|
-
const message = toErrorMessage$
|
|
74961
|
+
const message = toErrorMessage$32(error);
|
|
74678
74962
|
const reasonCode = resolveLocalAgentEnabledErrorCode$1(error);
|
|
74679
74963
|
emitRunLine({
|
|
74680
74964
|
presenter: input.presenter,
|
|
@@ -74727,7 +75011,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74727
75011
|
workspacePath: result.workspacePath
|
|
74728
75012
|
};
|
|
74729
75013
|
} catch (error) {
|
|
74730
|
-
const message = toErrorMessage$
|
|
75014
|
+
const message = toErrorMessage$32(error);
|
|
74731
75015
|
const reasonCode = resolveProfileWorkspaceControlErrorCode(error);
|
|
74732
75016
|
emitRunLine({
|
|
74733
75017
|
presenter: input.presenter,
|
|
@@ -74766,7 +75050,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74766
75050
|
});
|
|
74767
75051
|
return payload;
|
|
74768
75052
|
} catch (error) {
|
|
74769
|
-
const errorMessage = toErrorMessage$
|
|
75053
|
+
const errorMessage = toErrorMessage$32(error);
|
|
74770
75054
|
emitRunLine({
|
|
74771
75055
|
presenter: input.presenter,
|
|
74772
75056
|
code: "daemon.run.local_agent_control_refresh_catalog_failed",
|
|
@@ -74784,7 +75068,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74784
75068
|
emitRunLine({
|
|
74785
75069
|
presenter: input.presenter,
|
|
74786
75070
|
code: "daemon.run.socket_error",
|
|
74787
|
-
text: `daemon stream socket error: ${toErrorMessage$
|
|
75071
|
+
text: `daemon stream socket error: ${toErrorMessage$32(error)}`
|
|
74788
75072
|
});
|
|
74789
75073
|
});
|
|
74790
75074
|
const handleLocalAgentRegistrationControlFrame = (frame) => {
|
|
@@ -74793,7 +75077,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74793
75077
|
emitRunLine({
|
|
74794
75078
|
presenter: input.presenter,
|
|
74795
75079
|
code: "daemon.run.local_agent_control_failed",
|
|
74796
|
-
text: `local agent control failed: ${toErrorMessage$
|
|
75080
|
+
text: `local agent control failed: ${toErrorMessage$32(error)}`
|
|
74797
75081
|
});
|
|
74798
75082
|
});
|
|
74799
75083
|
return true;
|
|
@@ -74803,7 +75087,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74803
75087
|
emitRunLine({
|
|
74804
75088
|
presenter: input.presenter,
|
|
74805
75089
|
code: "daemon.run.agent_session_fork_failed",
|
|
74806
|
-
text: `Agent Session Fork failed: ${toErrorMessage$
|
|
75090
|
+
text: `Agent Session Fork failed: ${toErrorMessage$32(error)}`
|
|
74807
75091
|
});
|
|
74808
75092
|
});
|
|
74809
75093
|
return true;
|
|
@@ -74813,7 +75097,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74813
75097
|
emitRunLine({
|
|
74814
75098
|
presenter: input.presenter,
|
|
74815
75099
|
code: "daemon.run.local_agent_control_failed",
|
|
74816
|
-
text: `local agent installation control failed: ${toErrorMessage$
|
|
75100
|
+
text: `local agent installation control failed: ${toErrorMessage$32(error)}`
|
|
74817
75101
|
});
|
|
74818
75102
|
});
|
|
74819
75103
|
return true;
|
|
@@ -74851,7 +75135,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74851
75135
|
emitRunLine({
|
|
74852
75136
|
presenter: input.presenter,
|
|
74853
75137
|
code: "daemon.run.openmeld_tools_control_failed",
|
|
74854
|
-
text: `OpenMeld Tools control failed: ${toErrorMessage$
|
|
75138
|
+
text: `OpenMeld Tools control failed: ${toErrorMessage$32(error)}`
|
|
74855
75139
|
});
|
|
74856
75140
|
});
|
|
74857
75141
|
return true;
|
|
@@ -74890,7 +75174,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74890
75174
|
emitRunLine({
|
|
74891
75175
|
presenter: input.presenter,
|
|
74892
75176
|
code: "daemon.run.local_agent_control_failed",
|
|
74893
|
-
text: `local agent control failed: ${toErrorMessage$
|
|
75177
|
+
text: `local agent control failed: ${toErrorMessage$32(error)}`
|
|
74894
75178
|
});
|
|
74895
75179
|
});
|
|
74896
75180
|
return;
|
|
@@ -74900,7 +75184,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74900
75184
|
emitRunLine({
|
|
74901
75185
|
presenter: input.presenter,
|
|
74902
75186
|
code: "daemon.run.local_agent_control_failed",
|
|
74903
|
-
text: `local agent control failed: ${toErrorMessage$
|
|
75187
|
+
text: `local agent control failed: ${toErrorMessage$32(error)}`
|
|
74904
75188
|
});
|
|
74905
75189
|
});
|
|
74906
75190
|
return;
|
|
@@ -74910,7 +75194,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74910
75194
|
emitRunLine({
|
|
74911
75195
|
presenter: input.presenter,
|
|
74912
75196
|
code: "daemon.run.execution_recovery_failed",
|
|
74913
|
-
text: `execution recovery failed: ${toErrorMessage$
|
|
75197
|
+
text: `execution recovery failed: ${toErrorMessage$32(error)}`
|
|
74914
75198
|
});
|
|
74915
75199
|
});
|
|
74916
75200
|
return;
|
|
@@ -75320,41 +75604,51 @@ async function resolveDaemonServiceOwnerContext(input) {
|
|
|
75320
75604
|
});
|
|
75321
75605
|
}
|
|
75322
75606
|
async function resolveDaemonStreamAuthContext(input) {
|
|
75323
|
-
|
|
75324
|
-
|
|
75325
|
-
|
|
75326
|
-
|
|
75327
|
-
|
|
75328
|
-
|
|
75329
|
-
|
|
75330
|
-
|
|
75331
|
-
|
|
75332
|
-
|
|
75333
|
-
|
|
75334
|
-
|
|
75607
|
+
let headers;
|
|
75608
|
+
try {
|
|
75609
|
+
headers = await buildDaemonStreamRequestHeaders({
|
|
75610
|
+
requestUrl: input.requestUrl,
|
|
75611
|
+
selectedOpenMeldProfile: input.selectedOpenMeldProfile
|
|
75612
|
+
});
|
|
75613
|
+
} catch (error) {
|
|
75614
|
+
if (!(error instanceof AuthRequestCredentialError)) throw error;
|
|
75615
|
+
return {
|
|
75616
|
+
authState: resolveCredentialFailureAuthState(error.reason),
|
|
75617
|
+
credentialFailure: toDaemonStreamCredentialFailure(error),
|
|
75618
|
+
status: "authentication_required"
|
|
75619
|
+
};
|
|
75620
|
+
}
|
|
75621
|
+
if (!headers.Authorization) return {
|
|
75622
|
+
authState: "missing",
|
|
75335
75623
|
status: "authentication_required"
|
|
75336
75624
|
};
|
|
75337
75625
|
return {
|
|
75338
75626
|
authState: "valid",
|
|
75339
|
-
headers
|
|
75340
|
-
authSession: authState.session,
|
|
75341
|
-
requestUrl: input.requestUrl,
|
|
75342
|
-
selectedOpenMeldProfile: input.selectedOpenMeldProfile
|
|
75343
|
-
}),
|
|
75627
|
+
headers,
|
|
75344
75628
|
status: "ready"
|
|
75345
75629
|
};
|
|
75346
75630
|
}
|
|
75347
|
-
function
|
|
75348
|
-
if (
|
|
75631
|
+
function resolveCredentialFailureAuthState(reason) {
|
|
75632
|
+
if (reason === "session_expired") return "expired";
|
|
75633
|
+
if (reason === "remote_session_revoked" || reason === "session_revoked") return "revoked";
|
|
75349
75634
|
return "invalid";
|
|
75350
75635
|
}
|
|
75636
|
+
function toDaemonStreamCredentialFailure(error) {
|
|
75637
|
+
return {
|
|
75638
|
+
authHost: error.authHost,
|
|
75639
|
+
expectedGatewayHost: error.expectedGatewayHost,
|
|
75640
|
+
reason: error.reason,
|
|
75641
|
+
requestHost: error.requestHost,
|
|
75642
|
+
status: "dropped"
|
|
75643
|
+
};
|
|
75644
|
+
}
|
|
75351
75645
|
async function buildDaemonStreamRequestHeaders(input) {
|
|
75352
75646
|
return input.selectedOpenMeldProfile ? await buildOpenMeldProfileRequestHeadersWithAuth({
|
|
75353
75647
|
openMeldProfile: input.selectedOpenMeldProfile,
|
|
75354
|
-
authSession: input.authSession,
|
|
75648
|
+
...input.authSession ? { authSession: input.authSession } : {},
|
|
75355
75649
|
requestUrl: input.requestUrl
|
|
75356
75650
|
}) : await buildRequestAuthHeaders({
|
|
75357
|
-
authSession: input.authSession,
|
|
75651
|
+
...input.authSession ? { authSession: input.authSession } : {},
|
|
75358
75652
|
requestUrl: input.requestUrl
|
|
75359
75653
|
});
|
|
75360
75654
|
}
|
|
@@ -75712,7 +76006,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75712
76006
|
emitRunLine({
|
|
75713
76007
|
presenter: input.presenter,
|
|
75714
76008
|
code: "daemon.run.agent_activity_integration_refresh_failed",
|
|
75715
|
-
text: `Managed Agent integration refresh failed: ${toErrorMessage$
|
|
76009
|
+
text: `Managed Agent integration refresh failed: ${toErrorMessage$32(error)}`
|
|
75716
76010
|
});
|
|
75717
76011
|
});
|
|
75718
76012
|
const stopRegistrationReconcile = startDaemonServiceRegistrationReconcileLoop({
|
|
@@ -75728,7 +76022,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75728
76022
|
const openMeldToolsUpdateCoordinator = createOpenMeldToolsUpdateCoordinator({ reportBackgroundError: (error) => {
|
|
75729
76023
|
warnDaemonEvent("[openmeld.tools.update_failed]", {
|
|
75730
76024
|
event: "cli.openmeld_tools.update_failed",
|
|
75731
|
-
errorMessage: toErrorMessage$
|
|
76025
|
+
errorMessage: toErrorMessage$32(error)
|
|
75732
76026
|
});
|
|
75733
76027
|
} });
|
|
75734
76028
|
const stopOpenMeldToolsAutomaticUpdates = startOpenMeldToolsAutomaticUpdateLoop({
|
|
@@ -75736,7 +76030,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75736
76030
|
onError: (error) => {
|
|
75737
76031
|
warnDaemonEvent("[openmeld.tools.automatic_update_failed]", {
|
|
75738
76032
|
event: "cli.openmeld_tools.automatic_update_failed",
|
|
75739
|
-
errorMessage: toErrorMessage$
|
|
76033
|
+
errorMessage: toErrorMessage$32(error)
|
|
75740
76034
|
});
|
|
75741
76035
|
}
|
|
75742
76036
|
});
|
|
@@ -75745,7 +76039,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75745
76039
|
emitRunLine({
|
|
75746
76040
|
presenter: input.presenter,
|
|
75747
76041
|
code: "daemon.run.agent_activity_sync_failed",
|
|
75748
|
-
text: `Agent Activity sync failed: ${toErrorMessage$
|
|
76042
|
+
text: `Agent Activity sync failed: ${toErrorMessage$32(error)}`
|
|
75749
76043
|
});
|
|
75750
76044
|
},
|
|
75751
76045
|
onResult: (result) => {
|
|
@@ -75778,7 +76072,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75778
76072
|
emitRunLine({
|
|
75779
76073
|
presenter: input.presenter,
|
|
75780
76074
|
code: "daemon.run.agent_activity_integration_refresh_failed",
|
|
75781
|
-
text: `Managed Agent integration refresh failed: ${toErrorMessage$
|
|
76075
|
+
text: `Managed Agent integration refresh failed: ${toErrorMessage$32(error)}`
|
|
75782
76076
|
});
|
|
75783
76077
|
},
|
|
75784
76078
|
onResult: (result) => {
|
|
@@ -75998,14 +76292,14 @@ async function loadInitialDaemonRouteCatalog(input) {
|
|
|
75998
76292
|
emitRunLine({
|
|
75999
76293
|
presenter: input.presenter,
|
|
76000
76294
|
code: "daemon.run.route_catalog_initial_load_failed",
|
|
76001
|
-
text: `initial route catalog load failed; starting with an empty catalog and retrying via catalog sync: ${toErrorMessage$
|
|
76295
|
+
text: `initial route catalog load failed; starting with an empty catalog and retrying via catalog sync: ${toErrorMessage$32(error)}`,
|
|
76002
76296
|
payload: { reason: "initial_load_failed_no_cache" }
|
|
76003
76297
|
});
|
|
76004
76298
|
await emitInitialRouteCatalogLoadEvent({
|
|
76005
76299
|
result: "failed_empty_start",
|
|
76006
76300
|
metadata: {
|
|
76007
76301
|
durationMs: Date.now() - loadStartedAt,
|
|
76008
|
-
errorMessage: toErrorMessage$
|
|
76302
|
+
errorMessage: toErrorMessage$32(error),
|
|
76009
76303
|
phaseTimings
|
|
76010
76304
|
}
|
|
76011
76305
|
});
|
|
@@ -76018,7 +76312,7 @@ async function loadInitialDaemonRouteCatalog(input) {
|
|
|
76018
76312
|
emitRunLine({
|
|
76019
76313
|
presenter: input.presenter,
|
|
76020
76314
|
code: "daemon.run.route_catalog_cache_recovered",
|
|
76021
|
-
text: `using last known route catalog after initial catalog load failed: ${toErrorMessage$
|
|
76315
|
+
text: `using last known route catalog after initial catalog load failed: ${toErrorMessage$32(error)}`,
|
|
76022
76316
|
payload: {
|
|
76023
76317
|
profileIds: cached.profileIds,
|
|
76024
76318
|
reason: "initial_load_failed"
|
|
@@ -76028,7 +76322,7 @@ async function loadInitialDaemonRouteCatalog(input) {
|
|
|
76028
76322
|
result: "cache_recovered",
|
|
76029
76323
|
metadata: {
|
|
76030
76324
|
durationMs: Date.now() - loadStartedAt,
|
|
76031
|
-
errorMessage: toErrorMessage$
|
|
76325
|
+
errorMessage: toErrorMessage$32(error),
|
|
76032
76326
|
phaseTimings,
|
|
76033
76327
|
profileCount: cached.profileIds.length
|
|
76034
76328
|
}
|
|
@@ -76055,7 +76349,7 @@ async function persistDaemonRouteCatalogCache(input) {
|
|
|
76055
76349
|
emitRunLine({
|
|
76056
76350
|
presenter: input.presenter,
|
|
76057
76351
|
code: "daemon.run.route_catalog_cache_write_failed",
|
|
76058
|
-
text: `route catalog cache write failed: ${toErrorMessage$
|
|
76352
|
+
text: `route catalog cache write failed: ${toErrorMessage$32(error)}`
|
|
76059
76353
|
});
|
|
76060
76354
|
}
|
|
76061
76355
|
}
|
|
@@ -76095,14 +76389,14 @@ async function handleLocalControlPlaneSetLocalAgentEnabled(input) {
|
|
|
76095
76389
|
emitRunLine({
|
|
76096
76390
|
presenter: input.presenter,
|
|
76097
76391
|
code: "daemon.run.local_agent_enabled_report_sync_failed",
|
|
76098
|
-
text: `local agent report sync failed after enabled update: ${toErrorMessage$
|
|
76392
|
+
text: `local agent report sync failed after enabled update: ${toErrorMessage$32(error)}`
|
|
76099
76393
|
});
|
|
76100
76394
|
}
|
|
76101
76395
|
if (result.changed && input.requestActiveRouteCatalogSync) await input.requestActiveRouteCatalogSync("local_agent_enabled_changed").catch((error) => {
|
|
76102
76396
|
emitRunLine({
|
|
76103
76397
|
presenter: input.presenter,
|
|
76104
76398
|
code: "daemon.run.local_agent_enabled_route_sync_failed",
|
|
76105
|
-
text: `route catalog sync failed after enabled update: ${toErrorMessage$
|
|
76399
|
+
text: `route catalog sync failed after enabled update: ${toErrorMessage$32(error)}`
|
|
76106
76400
|
});
|
|
76107
76401
|
});
|
|
76108
76402
|
emitRunLine({
|
|
@@ -76127,7 +76421,7 @@ async function handleLocalControlPlaneSetLocalAgentEnabled(input) {
|
|
|
76127
76421
|
status: result.status
|
|
76128
76422
|
};
|
|
76129
76423
|
} catch (error) {
|
|
76130
|
-
const message = toErrorMessage$
|
|
76424
|
+
const message = toErrorMessage$32(error);
|
|
76131
76425
|
emitRunLine({
|
|
76132
76426
|
presenter: input.presenter,
|
|
76133
76427
|
code: "daemon.run.local_agent_enabled_rejected",
|
|
@@ -76250,7 +76544,7 @@ function createRunLoopConnectionStateTracker(presenter) {
|
|
|
76250
76544
|
} });
|
|
76251
76545
|
}
|
|
76252
76546
|
function noteRunLoopReconnectScheduled(input) {
|
|
76253
|
-
const errorMessage = toErrorMessage$
|
|
76547
|
+
const errorMessage = toErrorMessage$32(input.error);
|
|
76254
76548
|
const failureReason = classifyConnectionFailureReason(errorMessage);
|
|
76255
76549
|
const authState = input.error instanceof DaemonStreamAuthenticationRequiredError ? input.error.authState : null;
|
|
76256
76550
|
const backoffMs = resolveServiceConnectionReconnectBackoffMs({
|
|
@@ -78802,7 +79096,7 @@ var DaemonReinstallUnexpectedStartError = class extends Error {
|
|
|
78802
79096
|
diagnosticDetail;
|
|
78803
79097
|
outcome;
|
|
78804
79098
|
constructor(input) {
|
|
78805
|
-
super(toErrorMessage$
|
|
79099
|
+
super(toErrorMessage$43(input.cause));
|
|
78806
79100
|
this.name = "DaemonReinstallUnexpectedStartError";
|
|
78807
79101
|
this.cause = input.cause;
|
|
78808
79102
|
this.diagnosticDetail = input.diagnosticDetail;
|
|
@@ -78821,7 +79115,7 @@ var DaemonReinstallFailureError = class extends Error {
|
|
|
78821
79115
|
evidencePath;
|
|
78822
79116
|
failureStage;
|
|
78823
79117
|
constructor(input) {
|
|
78824
|
-
super(toErrorMessage$
|
|
79118
|
+
super(toErrorMessage$43(input.cause));
|
|
78825
79119
|
this.name = "DaemonReinstallFailureError";
|
|
78826
79120
|
this.backupDataPath = input.backupDataPath;
|
|
78827
79121
|
this.cause = input.cause;
|
|
@@ -79473,24 +79767,27 @@ async function prepareManagedDaemonServiceForStop(input) {
|
|
|
79473
79767
|
});
|
|
79474
79768
|
return null;
|
|
79475
79769
|
} catch (error) {
|
|
79476
|
-
const
|
|
79770
|
+
const isLegacyShutdownContract = error instanceof LocalDaemonControlPlaneClientError && error.code === "daemon.control.contract_mismatch";
|
|
79771
|
+
const isManagerRunningWithoutRuntime = error instanceof LocalDaemonControlPlaneClientError && error.code === "daemon.control.endpoint_missing" && input.ownerSnapshot.runtimeStatus.status !== "running" && input.ownerSnapshot.ownedProcesses.length === 0;
|
|
79772
|
+
const isCompatibilityFallback = isLegacyShutdownContract || isManagerRunningWithoutRuntime;
|
|
79477
79773
|
await emitDaemonLifecycleEvent({
|
|
79478
79774
|
command: "openmeld service stop",
|
|
79479
79775
|
intent: "stop",
|
|
79480
79776
|
metadata: {
|
|
79481
79777
|
compatibilityFallback: isCompatibilityFallback,
|
|
79482
|
-
|
|
79778
|
+
...isManagerRunningWithoutRuntime ? { compatibilityReason: "manager_running_without_runtime" } : {},
|
|
79779
|
+
errorMessage: toErrorMessage$43(error)
|
|
79483
79780
|
},
|
|
79484
79781
|
result: isCompatibilityFallback ? "fallback" : "failed",
|
|
79485
79782
|
stopCause: "user_stop",
|
|
79486
79783
|
type: "stop.controlled_drain"
|
|
79487
79784
|
});
|
|
79488
79785
|
if (isCompatibilityFallback) return null;
|
|
79489
|
-
let errorMessage = toErrorMessage$
|
|
79786
|
+
let errorMessage = toErrorMessage$43(error);
|
|
79490
79787
|
if (shouldRestoreAutostart) try {
|
|
79491
79788
|
await serviceManager.enableAutostart();
|
|
79492
79789
|
} catch (restoreError) {
|
|
79493
|
-
errorMessage = `${errorMessage}; failed to restore service autostart: ${toErrorMessage$
|
|
79790
|
+
errorMessage = `${errorMessage}; failed to restore service autostart: ${toErrorMessage$43(restoreError)}`;
|
|
79494
79791
|
}
|
|
79495
79792
|
if (input.mode !== "best_effort") throw new Error(`OpenMeld Service stayed running because its final offline status could not be delivered: ${errorMessage}`);
|
|
79496
79793
|
return buildDaemonStopWarningResult({
|
|
@@ -79540,11 +79837,11 @@ async function stopRegisteredDaemonServiceManager(input) {
|
|
|
79540
79837
|
run: async () => await input.ownerSnapshot.serviceManager?.stop()
|
|
79541
79838
|
});
|
|
79542
79839
|
} catch (error) {
|
|
79543
|
-
if (input.mode !== "best_effort") throw new Error(`Failed to stop system service (${input.ownerSnapshot.runtimeStatus.serviceController}): ${toErrorMessage$
|
|
79840
|
+
if (input.mode !== "best_effort") throw new Error(`Failed to stop system service (${input.ownerSnapshot.runtimeStatus.serviceController}): ${toErrorMessage$43(error)}`);
|
|
79544
79841
|
return buildDaemonStopWarningResult({
|
|
79545
79842
|
reason: "stop_failed",
|
|
79546
79843
|
runtimeStatus: input.ownerSnapshot.runtimeStatus,
|
|
79547
|
-
errorMessage: toErrorMessage$
|
|
79844
|
+
errorMessage: toErrorMessage$43(error)
|
|
79548
79845
|
});
|
|
79549
79846
|
}
|
|
79550
79847
|
if (!await waitForDaemonSystemServiceToStop({
|
|
@@ -79575,7 +79872,7 @@ async function stopRegisteredDaemonServiceManager(input) {
|
|
|
79575
79872
|
return buildDaemonStopWarningResult({
|
|
79576
79873
|
reason: "stop_failed",
|
|
79577
79874
|
runtimeStatus: input.ownerSnapshot.runtimeStatus,
|
|
79578
|
-
errorMessage: toErrorMessage$
|
|
79875
|
+
errorMessage: toErrorMessage$43(error)
|
|
79579
79876
|
});
|
|
79580
79877
|
}
|
|
79581
79878
|
const finalOwnerSnapshot = residualCleanupResult.shouldRefresh ? await readCurrentDaemonOwnerSnapshot() : residualCleanupResult.ownerSnapshot;
|
|
@@ -79648,7 +79945,7 @@ async function stopCurrentLaneDaemonProcess(input) {
|
|
|
79648
79945
|
pid: daemonPid,
|
|
79649
79946
|
reason: "stop_failed",
|
|
79650
79947
|
runtimeStatus: input.runtimeStatus,
|
|
79651
|
-
errorMessage: toErrorMessage$
|
|
79948
|
+
errorMessage: toErrorMessage$43(error)
|
|
79652
79949
|
};
|
|
79653
79950
|
}
|
|
79654
79951
|
}
|
|
@@ -79732,7 +80029,7 @@ async function stopTrackedDaemonProcess(input) {
|
|
|
79732
80029
|
type: "process_stop.action",
|
|
79733
80030
|
result: "failed",
|
|
79734
80031
|
metadata: {
|
|
79735
|
-
errorMessage: toErrorMessage$
|
|
80032
|
+
errorMessage: toErrorMessage$43(error),
|
|
79736
80033
|
pid: input.pid,
|
|
79737
80034
|
reason: input.reason,
|
|
79738
80035
|
signal: input.signal
|
|
@@ -79767,7 +80064,7 @@ async function stopDaemonProcess(pid, signal) {
|
|
|
79767
80064
|
process.kill(pid, signal);
|
|
79768
80065
|
} catch (error) {
|
|
79769
80066
|
if (isNodeErrorCode(error, "ESRCH")) return true;
|
|
79770
|
-
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$
|
|
80067
|
+
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$43(error)}`);
|
|
79771
80068
|
}
|
|
79772
80069
|
if (signal === "SIGKILL") return true;
|
|
79773
80070
|
return await waitForProcessToExit(pid);
|
|
@@ -79841,7 +80138,7 @@ async function stopDaemonForStrictTeardown(input) {
|
|
|
79841
80138
|
await input.context.serviceManager.stop().catch((error) => {
|
|
79842
80139
|
throw createStrictTeardownError({
|
|
79843
80140
|
reason: input.reason,
|
|
79844
|
-
message: `failed to stop system service (${input.context.serviceManager?.controller}): ${toErrorMessage$
|
|
80141
|
+
message: `failed to stop system service (${input.context.serviceManager?.controller}): ${toErrorMessage$43(error)}`,
|
|
79845
80142
|
hint: "run `openmeld service stop --force` and retry",
|
|
79846
80143
|
stage: "stop-wait"
|
|
79847
80144
|
});
|
|
@@ -79886,7 +80183,7 @@ async function uninstallSystemServiceForStrictTeardown(input) {
|
|
|
79886
80183
|
for (const manager of managers) await manager.uninstall().catch((error) => {
|
|
79887
80184
|
throw createStrictTeardownError({
|
|
79888
80185
|
reason: input.reason,
|
|
79889
|
-
message: `failed to uninstall system service (${manager.controller}): ${toErrorMessage$
|
|
80186
|
+
message: `failed to uninstall system service (${manager.controller}): ${toErrorMessage$43(error)}`,
|
|
79890
80187
|
hint: "fix OS service permissions and retry",
|
|
79891
80188
|
stage: "uninstall-verify"
|
|
79892
80189
|
});
|
|
@@ -79903,7 +80200,7 @@ async function verifySystemServiceRemovedAfterStrictTeardown(input) {
|
|
|
79903
80200
|
const finalManagerStatus = await manager.status().catch((error) => {
|
|
79904
80201
|
throw createStrictTeardownError({
|
|
79905
80202
|
reason: input.reason,
|
|
79906
|
-
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$
|
|
80203
|
+
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$43(error)}`,
|
|
79907
80204
|
hint: "run `openmeld service status` and confirm service manager state",
|
|
79908
80205
|
stage: "uninstall-verify"
|
|
79909
80206
|
});
|
|
@@ -79920,7 +80217,7 @@ async function verifySystemServiceRemovedAfterStrictTeardown(input) {
|
|
|
79920
80217
|
const finalManagerStatus = await manager.status().catch((error) => {
|
|
79921
80218
|
throw createStrictTeardownError({
|
|
79922
80219
|
reason: input.reason,
|
|
79923
|
-
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$
|
|
80220
|
+
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$43(error)}`,
|
|
79924
80221
|
hint: "run `openmeld service status` and confirm service manager state",
|
|
79925
80222
|
stage: "uninstall-verify"
|
|
79926
80223
|
});
|
|
@@ -80360,7 +80657,7 @@ async function runDaemonReinstall(input, options = {}) {
|
|
|
80360
80657
|
action: displayAction,
|
|
80361
80658
|
backupDataPath: error.backupDataPath,
|
|
80362
80659
|
errorCode: error.errorCode,
|
|
80363
|
-
errorMessage: toErrorMessage$
|
|
80660
|
+
errorMessage: toErrorMessage$43(error.cause),
|
|
80364
80661
|
failureStage: error.failureStage,
|
|
80365
80662
|
evidencePath: error.evidencePath ?? await captureDaemonServiceEvidenceBestEffort({
|
|
80366
80663
|
runtime,
|
|
@@ -81199,7 +81496,7 @@ async function runDirectDaemonServiceLoop(input) {
|
|
|
81199
81496
|
};
|
|
81200
81497
|
} catch (error) {
|
|
81201
81498
|
return await handleDaemonRunStartFailure({
|
|
81202
|
-
fallbackRawLine: toErrorMessage$
|
|
81499
|
+
fallbackRawLine: toErrorMessage$43(error),
|
|
81203
81500
|
gatewayUrl: input.gatewayUrl,
|
|
81204
81501
|
presenter: input.presenter,
|
|
81205
81502
|
runtime: input.runtime,
|
|
@@ -81400,7 +81697,7 @@ async function bestEffortStopCurrentLaneDaemonService(input) {
|
|
|
81400
81697
|
if (!isOpenMeldLockError(error)) throw error;
|
|
81401
81698
|
let errorMessage = error.message;
|
|
81402
81699
|
const runtimeStatus = await readCurrentObservedDaemonRuntimeStatus().catch((statusError) => {
|
|
81403
|
-
errorMessage = `${errorMessage}; service status could not be read: ${toErrorMessage$
|
|
81700
|
+
errorMessage = `${errorMessage}; service status could not be read: ${toErrorMessage$43(statusError)}`;
|
|
81404
81701
|
return {
|
|
81405
81702
|
status: "unknown",
|
|
81406
81703
|
mode: null,
|
|
@@ -81836,7 +82133,7 @@ async function runSystemDaemonCore(context) {
|
|
|
81836
82133
|
} catch (error) {
|
|
81837
82134
|
if (!isSystemServiceBootstrap) throw error;
|
|
81838
82135
|
return await handleDaemonRunStartFailure({
|
|
81839
|
-
fallbackRawLine: toErrorMessage$
|
|
82136
|
+
fallbackRawLine: toErrorMessage$43(error),
|
|
81840
82137
|
gatewayUrl: input.gatewayUrl,
|
|
81841
82138
|
presenter,
|
|
81842
82139
|
runtime,
|
|
@@ -82437,7 +82734,7 @@ async function recoverSystemServiceStartupAfterTimeout(input) {
|
|
|
82437
82734
|
error,
|
|
82438
82735
|
recovery: {
|
|
82439
82736
|
...recovery,
|
|
82440
|
-
failureMessage: toErrorMessage$
|
|
82737
|
+
failureMessage: toErrorMessage$43(error)
|
|
82441
82738
|
}
|
|
82442
82739
|
};
|
|
82443
82740
|
}
|
|
@@ -82663,7 +82960,7 @@ function resolvePersistedDaemonServiceContractGatewayUrl(gatewayUrl) {
|
|
|
82663
82960
|
try {
|
|
82664
82961
|
return normalizeGatewayBaseUrl(gatewayUrl);
|
|
82665
82962
|
} catch (error) {
|
|
82666
|
-
throw new Error(`Invalid persisted OpenMeld Service contract gateway URL "${gatewayUrl}": ${toErrorMessage$
|
|
82963
|
+
throw new Error(`Invalid persisted OpenMeld Service contract gateway URL "${gatewayUrl}": ${toErrorMessage$43(error)}`);
|
|
82667
82964
|
}
|
|
82668
82965
|
}
|
|
82669
82966
|
function resolveSystemServiceStartupWaitMs(controller) {
|
|
@@ -82792,13 +83089,13 @@ async function runDaemonServiceDetached(input) {
|
|
|
82792
83089
|
if (typeof child.pid === "number" && child.pid > 0) await cleanupDetachedRuntimeStateIfOwnedByPid(child.pid).catch(() => {});
|
|
82793
83090
|
return await handleDaemonRunStartFailure({
|
|
82794
83091
|
cursor: startFailureLogCursor,
|
|
82795
|
-
fallbackRawLine: selectRelevantDaemonStartFailureLogLine(startupOutput.summary()) ?? toErrorMessage$
|
|
83092
|
+
fallbackRawLine: selectRelevantDaemonStartFailureLogLine(startupOutput.summary()) ?? toErrorMessage$43(error),
|
|
82796
83093
|
gatewayUrl: input.gatewayUrl,
|
|
82797
83094
|
presenter: input.presenter,
|
|
82798
83095
|
runtime: input.runtime,
|
|
82799
83096
|
genericErrorPayload: {
|
|
82800
83097
|
codePrefix: "daemon.run.start_failed",
|
|
82801
|
-
error: /* @__PURE__ */ new Error(`Failed to start OpenMeld Service process: ${toErrorMessage$
|
|
83098
|
+
error: /* @__PURE__ */ new Error(`Failed to start OpenMeld Service process: ${toErrorMessage$43(error)}`)
|
|
82802
83099
|
}
|
|
82803
83100
|
});
|
|
82804
83101
|
} finally {
|
|
@@ -109718,6 +110015,6 @@ function isHumanInteractiveSpaceRuntime(runtime) {
|
|
|
109718
110015
|
return runtime.resolvedView === "human" && canUseInteractivePrompts(runtime);
|
|
109719
110016
|
}
|
|
109720
110017
|
//#endregion
|
|
109721
|
-
export { runAgentsRepair as $, installAgentActivityIntegrations as $a, readRecentDaemonLifecycleEvents as $i, canUseInteractivePrompts as $n, syncProfileWorkspaceState as $r, readRuntimeReportingHealthState as $t, assertFullSignalIdArgument as A, updateOpenMeldProfile as Aa, buildDaemonRouteObservationPresentation as Ai, assertNoRemovedCcSpaceAddressingSyntax as An, setDefaultProjectConnection as Ao, formatDualViewGuideForDisplay as Ar, runDaemonStartupPreflight as At, persistAgentTransportSelection as B, resolveAuthenticationGuidanceFromMessage as Ba, finishCurrentCommandCheckScope as Bi, promptSearchSelect as Bn, outJsonLine as Bo, scheduleDaemonServiceUpdate as Br, resolveLocalComponentsStatus as Bt, toSpaceMetaUpsertInput as C, resolveOpenMeldProfileOrNull as Ca, parseAgentControllerRef as Ci, submitRuntimeAgentControllerReports as Cn, removeProjectOutbox as Co, registerSkillsTargetSelectionOptions as Cr, runDaemonUninstall as Ct, formatHumanReadTargetList as D, listOpenMeldProfiles as Da, resolveEvidenceSyncHealth as Di, resolveLocalAgentControllerReportDecision as Dn, migrateProjectBindingStore as Do, registerBuiltinAgentSelectionOptions as Dr, emitDaemonAgentOverview as Dt, buildHumanReplyContextSummary as E, deleteOpenMeldProfile as Ea, resolveAgentProfileEditCapabilities as Ei, resolveLocalAgentControllerLaunchability as En, listProjectConnectionsWithStatus as Eo, registerAuthLoginRequestOptions as Er, reconcileCliVersionView as Et, emitSpaceAgentOverview as F, buildAgentAuthenticationGuide as Fa, classifyDaemonServiceRunStartability as Fi, buildSpaceRoundReadProjection as Fn, renderInfoCard as Fo, areAllowedActionsEquivalent as Fr, updateSpaceMeta as Ft, runAgentsCustomList as G, LocalDaemonControlPlaneClientError as Ga, inspectDaemonServiceInventory as Gi, assertDispatchOwnedRuntimePublicWriteAllowed as Gn, cliJsonSkillsLoadEnvelopeSchema as Go, resolveDaemonServiceFreshnessWarning as Gr, collectSkillsReadinessSnapshot as Gt, runAgents as H, setProfileDefaultView as Ha, isCurrentCommandCheckScopeActive as Hi, runInteractivePrompt as Hn, cliBinaryDeltaPatchSchema as Ho, resolveDaemonDeviceId as Hr, resolveDaemonServiceParticipationStatus as Ht, emitSpaceCliAgentOverview as I, buildHumanAuthenticationCard as Ia, classifyDaemonServiceWakeability as Ii, buildUpdatesReplyWorkflowProjection as In, renderTextInfoCard as Io, buildAgentFacingPublicationModeGuideLines as Ir, readGatewayJsonResponse as It, runAgentsDetect as J, registerAgentActivityRoute as Ja, readCurrentObservedDaemonRuntimeStatus as Ji, writeDispatchSpaceActionRecord as Jn, organizationJoinLinkErrorResponseSchema as Jo, formatDeviceReplyReadinessLabel as Jr, runSkillsInstall as Jt, runAgentsCustomRemove as K, requestLocalAgentActivitySync as Ka, resolveVersionChangeDirection as Ki, readDispatchOwnedRuntimeGuard as Kn, cliJsonSkillsShowEnvelopeSchema as Ko, resolveCurrentReplyReadinessSnapshot as Kr, runSkillsCheck as Kt, prepareLocalAgentReadiness as L, createAuthenticationError as La, resolveServiceUpdateUrgency as Li, createSpaceMemberIdentityIndex as Ln, sanitizeTerminalDisplayText as Lo, canonicalizeAllowedActions as Lr, readGatewayTextResponse as Lt, prepareAuthenticatedSpaceCommandContext as M, clearSelectedOpenMeldProfileId as Ma, getSetupFlowCopy as Mi, buildDispatchResultReplyWorkflowProjection as Mn, canonicalizeLocalProjectPath as Mo, formatAgentOverviewPayload as Mr, fetchSpaceUpdates as Mt, resolveOpenMeldProfileForSpaceCommand as N, getSelectedOpenMeldProfileId as Na, buildDaemonServiceTargetSpec as Ni, buildSignalIndex as Nn, enqueueControllerTaskLifecycleEventWhileLocked as No, OPENMELD_AGENT_MENTAL_MODEL_LINES as Nr, createCliSpaceApi as Nt, parseEnvelope as O, primeOpenMeldProfilesSessionCache as Oa, resolveNativeAgentControllerPermissionModeForController as Oi, inspectSpaceCacheFile as On, removeProjectConnection as Oo, buildAgentOverviewFromContract as Or, createDelayedSpinner as Ot, resolveSpaceAccessLabel as P, setSelectedOpenMeldProfileId as Pa, resolveDaemonServiceAlignmentDecision as Pi, buildSignalMessageReadProjection as Pn, readControllerTaskLifecycleOutboxHealth as Po, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Pr, fetchSpaceMeta as Pt, runAgentsManage as Q, defaultManagedIntegrationPaths as Qa, resolveDaemonServiceManager as Qi, formatDaemonServiceMissingRecommendation as Qn, resolveOpenClawLocalDiagnosticsValue as Qr, readBundledOpenMeldCliSkillDocumentByPath as Qt, buildReplyReadinessGuidance as R, resolveAuthenticationGuidance as Ra, assessServerRequiredVersion as Ri, formatRemovedCcRelationMessage as Rn, emitCliJsonEnvelope as Ro, readOpenMeldToolsUpdateContextFromEnv as Rr, toStructuredGatewayFailure as Rt, loadSpaceSignalIndexOrNull as S, requireOpenMeldProfile as Sa, listAgentControllerPermissionModeOptions as Si, submitRuntimeAgentControllerReport as Sn, readAgentActivityOutboxHealth as So, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as Sr, runDaemonTeardownStrict as St, buildFormalSignalReadPayload as T, createOpenMeldHumanProfile as Ta, resolveAgentExecutionStatus as Ti, resolveLocalAgentControllerBlockerReasonCodes as Tn, listProjectBindings as To, registerDaemonControlTargetOptions as Tr, buildProfileWorkspaceRows as Tt, runAgentsConfig as U, LocalProjectConnectionError as Ua, resetCurrentCommandCheckState as Ui, assessCliUpdate as Un, cliJsonOutputEnvelopeSchema as Uo, formatDaemonFailureContextText as Ur, runDaemonServiceParticipationGate as Ut, resolveAgentProfileSetup as V, getProfileDefaultView as Va, getCurrentCommandCheckState as Vi, isReturnKeypress as Vn, outLine as Vo, ensureDaemonRuntimePaths as Vr, writeInstalledLocalComponentsSnapshot as Vt, runAgentsCustomAdd as W, validateLocalProjectConnectionPath as Wa, startCurrentCommandCheckScope as Wi, isCliUpdateCheckApplicable as Wn, cliJsonSkillsListEnvelopeSchema as Wo, resolveServiceReadinessFromServiceStatus as Wr, runDaemonStartDecisionPrompt as Wt, runAgentsEnable as X, unregisterAgentActivityRoute as Xa, isDaemonServiceJobNeverSpawned as Xi, resolveElapsedTimeMs as Xn, compareAgentControllerRefsForDisplay as Xo, mapAgentReplyReadinessToLegacyAutoReply as Xr, runSkillsUpdate as Xt, runAgentsDisable as Y, resolveAgentActivityRouteForPath as Ya, getDaemonSystemServiceLogPath as Yi, formatElapsedTime as Yn, revokeOrganizationJoinLinkResponseSchema as Yo, formatHumanReplyReadinessReason as Yr, runSkillsUninstall as Yt, runAgentsList as Z, AGENT_ACTIVITY_INTEGRATION_OWNER as Za, readDaemonServiceJobCrashExitCode as Zi, formatDaemonServiceDowngradeBlockedRecommendation as Zn, resolveGatewayChainReadiness as Zr, ensureLocalSkills as Zt, runSpaceWriteWithPasswordRetry as _, formatMessage as _a, resolveLocalRegistryAgentIdFromAgentControllerRef as _i, formatServiceParticipationReadinessLabel as _n, resolveObservedAgentActivityBinding as _o, createStartAuthenticationGuideError as _r, runDaemonReinstall as _t, runSpaceDelete as a, fetchLatestCliBinaryRelease as aa, resolveConfiguredProfileWorkspacePath as ai, runAuthLogin as an, formatOpenMeldCliCommands as ao, createSpaceAddMembersGuideError as ar, renderOpenMeldBrandBlockLines as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, resolveViewProfileKey as ba, getAgentControllerPermissionModeDisplayMetadata as bi, computeRetryDelayMs as bn, enqueueAgentActivityHookEvent as bo, getCommandHintsFromContract as br, runDaemonStatusFlow as bt, runSpaceLeave as c, writeVersionState as ca, validateCustomProfileWorkspacePath as ci, runAuthStatus as cn, formatProfileAwareOpenMeldCliCommands as co, createSpaceLeaveGuideError as cr, renderOpenMeldTagline as ct, runSpaceRemoveMembers as d, resolveCurrentDaemonExpectedVersion as da, createPrimaryBindingReadSession as di, formatActiveOrganizationLabel as dn, syncLocalAgentActivity as do, createSpaceRemoveMembersGuideError as dr, runDaemon as dt, buildInstallSelfJsonPayload as ea, createModelCatalogReadSession as ei, readRecentDaemonDispatchJournalEvents as en, readAgentActivityIntegrationStatus as eo, createDoctorFailedGuideError as er, runAgentsShow as et, runSpaceSend as f, OPENMELD_VERSION as fa, resolveAgentProfilePrimaryAgentControllerReport as fi, createProfileByKind as fn, readDaemonServiceContract as fo, createSpaceResultGuideError as fr, runDaemonAutostart as ft, runSpaceReadWithPasswordRetry as g, createPresenter as ga, notifyDaemonRouteCatalogChanged as gi, ensureAgentProfileRuntimeBinding as gn, buildAgentActivityEvent as go, createStartAgentIdentityGuideError as gr, runDaemonInterrupt as gt, uploadPreparedSpaceFiles as h, renderHumanTextErrorCard as ha, listBuiltinAgentsRegistryEntries as hi, promptTextEntry as hn, removeAgentActivityContextCache as ho, createSpaceUpdatesGuideError as hr, runDaemonInstall as ht, runSpaceCreate as i, ensureVersionStateReady as ia, readProfileWorkspaceConfig as ii, evaluateCommandAuthentication as in, formatOpenMeldCliCommand as io, createResetConfirmationGuideError as ir, printOpenMeldBanner as it, assertValidSpaceIdTarget as j, alignSelectedOpenMeldProfileStorage as ja, buildOnboardingPlan as ji, buildDispatchResultMessageReadProjection as jn, unbindProject as jo, buildDualViewGuideMessage as jr, readDaemonStartFailureLogTailLines as jt, isSpaceCommandOutputHandledError as k, resolveOpenMeldProfile as ka, PREPARE_SESSION_RECONNECT_GRACE_MS as ki, upsertSpaceConfig as kn, runIfAgentActivityBindingGenerationIsCurrent as ko, DualViewGuideError as kr, shouldEmitAgentOverview as kt, runSpaceList as l, resolveDaemonRuntimeContractCompatibility as la, describeProfileWorkspacePathValidationFailure as li, buildAuthStatusRows as ln, resolveSetupFollowUpCliEntryCommand as lo, createSpaceMenuGuideError as lr, resolveGatewayWebOrigin as lt, prepareRequestedSpaceSendFiles as m, renderHumanErrorCard as ma, reconcileNewRunnableBuiltinAgentsForSetup as mi, resolveCreateProfileName as mn, readAgentActivityContextForPath as mo, createSpaceTargetGuideError as mr, runDaemonCancel as mt, promptAndConfirmSpacePassword as n, buildNextVersionState as na, ensureOpenMeldManagedProfileWorkspace as ni, buildCommandAuthenticationPromptMessage as nn, uninstallAgentActivityIntegrations as no, createProfileCreateGuideError as nr, colorizeAgentLabel as nt, runSpaceHistory as o, fetchLatestPackageInfo as oa, setCustomProfileWorkspace as oi, runAuthLogout as on, formatOpenMeldCliLine as oo, createSpaceAliasTargetGuideError as or, renderOpenMeldHeader as ot, runSpaceWatch as p, buildHumanErrorCopy as pa, listAgentTargetStates as pi, resolveCreateProfileKind as pn, upsertDaemonServiceContract as po, createSpaceSubcommandTargetGuideError as pr, runDaemonBackgroundStartForDecision as pt, runAgentsCustomUpdate as q, isAgentActivityRouteRegistered as qa, readCurrentDaemonRuntimeContext as qi, readDispatchSpaceActionContextFromEnv as qn, getOrganizationJoinLinkResponseSchema as qo, formatAgentReplyReadinessLabel as qr, runSkillsEnsure as qt, runSpaceAddMembers as r, compareSemver as ra, normalizeCustomProfileWorkspacePath as ri, ensureCommandAuthenticationOrCancel as rn, formatInlineOpenMeldCliCommands as ro, createProfileMenuGuideError as rr, colorizeDisplayProfileLabel as rt, runSpaceJoin as s, readVersionState as sa, setOpenMeldManagedProfileWorkspace as si, runAuthMenu as sn, formatOpenMeldCliTextBlock as so, createSpaceContractSetGuideError as sr, renderOpenMeldLogo as st, buildCreateSpacePasswordPromptConfig as t, performManagedInstall as ta, resolveProfileWorkspaceRuntime as ti, connectWebSocket as tn, resolveAgentActivityDispatcherCommand as to, createProfileActionGuideError as tr, formatTransportModeDisplay as tt, runSpacePassword as u, toStartBackgroundHelperExecutionCompatibility as ua, syncDeviceRuntimeStateProjection as ui, buildAuthStatusSnapshot as un, resolveUserFacingCliEntryCommand as uo, createSpacePublicationSetGuideError as ur, resolveSpaceSendText as ut, buildHumanReadSignalsTranscriptItems as v, parseCliViewMode as va, buildAgentControllerRef as vi, resolveServiceParticipationReadiness as vn, normalizeSharedSessionTitle as vo, createUpgradeConfirmationGuideError as vr, runDaemonRunAfterEntryChecks as vt, buildFormalDispatchResultReadPayload as w, createOpenMeldAgentProfile as wa, resolveAgentControllerPermissionModeForController as wi, collectLocalAgentControllerInventory as wn, bindProject as wo, getCliVersionInfo as wr, buildProfileWorkspacePresentation as wt, loadSpaceIdentityDirectoryOrNull as x, isSelectedOpenMeldProfileRequiredError as xa, getAgentControllerPermissionModeFieldLabel as xi, submitProfileRuntimeAgentControllerReport as xn, removeProjectInbox as xo, registerSpaceMemberSelectionOptions as xr, runDaemonStop as xt, emitHumanReadSignalsTextProjection as y, resolveRuntimeContext as ya, createAgentExecutionStatusDisplayRows as yi, assessActionParticipationCandidate as yn, readCodexSessionTitles as yo, getCommandEntryContract as yr, runDaemonSnapshot as yt, resolveHumanControllerDisplayName as z, resolveAuthenticationGuidanceFromError as za, resolveOpenMeldEnvironmentTarget as zi, promptSearchMultiselect as zn, errLine as zo, runPendingDaemonServiceUpdate as zr, parseJsonResponse$1 as zt };
|
|
110018
|
+
export { runAgentsRepair as $, validateLocalProjectConnectionPath as $a, startCurrentCommandCheckScope as $i, assertDispatchOwnedRuntimePublicWriteAllowed as $n, cliJsonSkillsListEnvelopeSchema as $o, resolveDaemonServiceFreshnessWarning as $r, readBundledOpenMeldCliSkillDocumentByPath as $t, assertFullSignalIdArgument as A, isSelectedOpenMeldProfileRequiredError as Aa, listAgentControllerPermissionModeOptions as Ai, submitRuntimeAgentControllerReport as An, removeProjectInbox as Ao, SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS as Ar, shouldEmitAgentOverview as At, persistAgentTransportSelection as B, alignSelectedOpenMeldProfileStorage as Ba, getSetupFlowCopy as Bi, buildDispatchResultReplyWorkflowProjection as Bn, unbindProject as Bo, formatAgentOverviewPayload as Br, parseJsonResponse$1 as Bt, toSpaceMetaUpsertInput as C, renderHumanErrorCard as Ca, listBuiltinAgentsRegistryEntries as Ci, promptTextEntry as Cn, readAgentActivityContextForPath as Co, createSpaceUpdatesGuideError as Cr, runDaemonTeardownStrict as Ct, formatHumanReadTargetList as D, parseCliViewMode as Da, createAgentExecutionStatusDisplayRows as Di, assessActionParticipationCandidate as Dn, normalizeSharedSessionTitle as Do, getCommandEntryContract as Dr, reconcileCliVersionView as Dt, buildHumanReplyContextSummary as E, formatMessage as Ea, buildAgentControllerRef as Ei, resolveServiceParticipationReadiness as En, resolveObservedAgentActivityBinding as Eo, createUpgradeConfirmationGuideError as Er, buildProfileWorkspaceRows as Et, emitSpaceAgentOverview as F, deleteOpenMeldProfile as Fa, resolveEvidenceSyncHealth as Fi, resolveLocalAgentControllerReportDecision as Fn, listProjectConnectionsWithStatus as Fo, registerBuiltinAgentSelectionOptions as Fr, fetchSpaceMeta as Ft, runAgentsCustomList as G, buildHumanAuthenticationCard as Ga, resolveServiceUpdateUrgency as Gi, createSpaceMemberIdentityIndex as Gn, renderTextInfoCard as Go, canonicalizeAllowedActions as Gr, runDaemonStartDecisionPrompt as Gt, runAgents as H, getSelectedOpenMeldProfileId as Ha, resolveDaemonServiceAlignmentDecision as Hi, buildSignalMessageReadProjection as Hn, enqueueControllerTaskLifecycleEventWhileLocked as Ho, SPACE_CONTRACT_ALLOWED_ACTION_ORDER as Hr, writeInstalledLocalComponentsSnapshot as Ht, emitSpaceCliAgentOverview as I, listOpenMeldProfiles as Ia, resolveNativeAgentControllerPermissionModeForController as Ii, inspectSpaceCacheFile as In, migrateProjectBindingStore as Io, buildAgentOverviewFromContract as Ir, updateSpaceMeta as It, runAgentsDetect as J, resolveAuthenticationGuidanceFromError as Ja, resolveAuthBaseUrl as Ji, promptSearchSelect as Jn, errLine as Jo, scheduleDaemonServiceUpdate as Jr, runSkillsEnsure as Jt, runAgentsCustomRemove as K, createAuthenticationError as Ka, assessServerRequiredVersion as Ki, formatRemovedCcRelationMessage as Kn, sanitizeTerminalDisplayText as Ko, readOpenMeldToolsUpdateContextFromEnv as Kr, collectSkillsReadinessSnapshot as Kt, prepareLocalAgentReadiness as L, primeOpenMeldProfilesSessionCache as La, PREPARE_SESSION_RECONNECT_GRACE_MS as Li, upsertSpaceConfig as Ln, removeProjectConnection as Lo, DualViewGuideError as Lr, readGatewayJsonResponse as Lt, prepareAuthenticatedSpaceCommandContext as M, resolveOpenMeldProfileOrNull as Ma, resolveAgentControllerPermissionModeForController as Mi, collectLocalAgentControllerInventory as Mn, removeProjectOutbox as Mo, getCliVersionInfo as Mr, readDaemonStartFailureLogTailLines as Mt, resolveOpenMeldProfileForSpaceCommand as N, createOpenMeldAgentProfile as Na, resolveAgentExecutionStatus as Ni, resolveLocalAgentControllerBlockerReasonCodes as Nn, bindProject as No, registerDaemonControlTargetOptions as Nr, fetchSpaceUpdates as Nt, parseEnvelope as O, resolveRuntimeContext as Oa, getAgentControllerPermissionModeDisplayMetadata as Oi, computeRetryDelayMs as On, readCodexSessionTitles as Oo, getCommandHintsFromContract as Or, emitDaemonAgentOverview as Ot, resolveSpaceAccessLabel as P, createOpenMeldHumanProfile as Pa, resolveAgentProfileEditCapabilities as Pi, resolveLocalAgentControllerLaunchability as Pn, listProjectBindings as Po, registerAuthLoginRequestOptions as Pr, createCliSpaceApi as Pt, runAgentsManage as Q, LocalProjectConnectionError as Qa, resetCurrentCommandCheckState as Qi, isCliUpdateCheckApplicable as Qn, cliJsonOutputEnvelopeSchema as Qo, resolveServiceReadinessFromServiceStatus as Qr, ensureLocalSkills as Qt, buildReplyReadinessGuidance as R, resolveOpenMeldProfile as Ra, buildDaemonRouteObservationPresentation as Ri, assertNoRemovedCcSpaceAddressingSyntax as Rn, runIfAgentActivityBindingGenerationIsCurrent as Ro, formatDualViewGuideForDisplay as Rr, readGatewayTextResponse as Rt, loadSpaceSignalIndexOrNull as S, buildHumanErrorCopy as Sa, reconcileNewRunnableBuiltinAgentsForSetup as Si, resolveCreateProfileName as Sn, upsertDaemonServiceContract as So, createSpaceTargetGuideError as Sr, runDaemonStop as St, buildFormalSignalReadPayload as T, createPresenter as Ta, resolveLocalRegistryAgentIdFromAgentControllerRef as Ti, formatServiceParticipationReadinessLabel as Tn, buildAgentActivityEvent as To, createStartAuthenticationGuideError as Tr, buildProfileWorkspacePresentation as Tt, runAgentsConfig as U, setSelectedOpenMeldProfileId as Ua, classifyDaemonServiceRunStartability as Ui, buildSpaceRoundReadProjection as Un, readControllerTaskLifecycleOutboxHealth as Uo, areAllowedActionsEquivalent as Ur, resolveDaemonServiceParticipationStatus as Ut, resolveAgentProfileSetup as V, clearSelectedOpenMeldProfileId as Va, buildDaemonServiceTargetSpec as Vi, buildSignalIndex as Vn, canonicalizeLocalProjectPath as Vo, OPENMELD_AGENT_MENTAL_MODEL_LINES as Vr, resolveLocalComponentsStatus as Vt, runAgentsCustomAdd as W, buildAgentAuthenticationGuide as Wa, classifyDaemonServiceWakeability as Wi, buildUpdatesReplyWorkflowProjection as Wn, renderInfoCard as Wo, buildAgentFacingPublicationModeGuideLines as Wr, runDaemonServiceParticipationGate as Wt, runAgentsEnable as X, getProfileDefaultView as Xa, getCurrentCommandCheckState as Xi, runInteractivePrompt as Xn, outLine as Xo, resolveDaemonDeviceId as Xr, runSkillsUninstall as Xt, runAgentsDisable as Y, resolveAuthenticationGuidanceFromMessage as Ya, finishCurrentCommandCheckScope as Yi, isReturnKeypress as Yn, outJsonLine as Yo, ensureDaemonRuntimePaths as Yr, runSkillsInstall as Yt, runAgentsList as Z, setProfileDefaultView as Za, isCurrentCommandCheckScopeActive as Zi, assessCliUpdate as Zn, cliBinaryDeltaPatchSchema as Zo, formatDaemonFailureContextText as Zr, runSkillsUpdate as Zt, runSpaceWriteWithPasswordRetry as _, writeVersionState as _a, describeProfileWorkspacePathValidationFailure as _i, resolveDeviceAuthClientId as _n, formatProfileAwareOpenMeldCliCommands as _o, createSpaceMenuGuideError as _r, runDaemonInterrupt as _t, runSpaceDelete as a, isDaemonServiceJobNeverSpawned as aa, resolveGatewayChainReadiness as ai, evaluateCommandAuthentication as an, unregisterAgentActivityRoute as ao, formatDaemonServiceDowngradeBlockedRecommendation as ar, compareAgentControllerRefsForDisplay as as, renderOpenMeldBrandBlockLines as at, buildIdentityOnlyMembersSnapshotForReadProjection as b, resolveCurrentDaemonExpectedVersion as ba, resolveAgentProfilePrimaryAgentControllerReport as bi, createProfileByKind as bn, syncLocalAgentActivity as bo, createSpaceResultGuideError as br, runDaemonSnapshot as bt, runSpaceLeave as c, readRecentDaemonLifecycleEvents as ca, createModelCatalogReadSession as ci, runAuthMenu as cn, installAgentActivityIntegrations as co, createDoctorFailedGuideError as cr, renderOpenMeldTagline as ct, runSpaceRemoveMembers as d, buildNextVersionState as da, normalizeCustomProfileWorkspacePath as di, buildAuthStatusRows as dn, uninstallAgentActivityIntegrations as do, createProfileMenuGuideError as dr, bestEffortStopCurrentLaneDaemonService as dt, inspectDaemonServiceInventory as ea, resolveCurrentReplyReadinessSnapshot as ei, readRuntimeReportingHealthState as en, LocalDaemonControlPlaneClientError as eo, readDispatchOwnedRuntimeGuard as er, cliJsonSkillsLoadEnvelopeSchema as es, runAgentsShow as et, runSpaceSend as f, compareSemver as fa, readProfileWorkspaceConfig as fi, buildAuthStatusSnapshot as fn, formatInlineOpenMeldCliCommands as fo, createResetConfirmationGuideError as fr, runDaemon as ft, runSpaceReadWithPasswordRetry as g, readVersionState as ga, validateCustomProfileWorkspacePath as gi, requestDeviceToken as gn, formatOpenMeldCliTextBlock as go, createSpaceLeaveGuideError as gr, runDaemonInstall as gt, uploadPreparedSpaceFiles as h, fetchLatestPackageInfo as ha, setOpenMeldManagedProfileWorkspace as hi, fetchAuthUserSnapshot as hn, formatOpenMeldCliLine as ho, createSpaceContractSetGuideError as hr, runDaemonCancel as ht, runSpaceCreate as i, getDaemonSystemServiceLogPath as ia, mapAgentReplyReadinessToLegacyAutoReply as ii, ensureCommandAuthenticationOrCancel as in, resolveAgentActivityRouteForPath as io, resolveElapsedTimeMs as ir, revokeOrganizationJoinLinkResponseSchema as is, printOpenMeldBanner as it, assertValidSpaceIdTarget as j, requireOpenMeldProfile as ja, parseAgentControllerRef as ji, submitRuntimeAgentControllerReports as jn, readAgentActivityOutboxHealth as jo, registerSkillsTargetSelectionOptions as jr, runDaemonStartupPreflight as jt, isSpaceCommandOutputHandledError as k, resolveViewProfileKey as ka, getAgentControllerPermissionModeFieldLabel as ki, submitProfileRuntimeAgentControllerReport as kn, enqueueAgentActivityHookEvent as ko, registerSpaceMemberSelectionOptions as kr, createDelayedSpinner as kt, runSpaceList as l, buildInstallSelfJsonPayload as la, resolveProfileWorkspaceRuntime as li, runAuthStatus as ln, readAgentActivityIntegrationStatus as lo, createProfileActionGuideError as lr, resolveGatewayWebOrigin as lt, prepareRequestedSpaceSendFiles as m, fetchLatestCliBinaryRelease as ma, setCustomProfileWorkspace as mi, extractAuthApiErrorMessage as mn, formatOpenMeldCliCommands as mo, createSpaceAliasTargetGuideError as mr, runDaemonBackgroundStartForDecision as mt, promptAndConfirmSpacePassword as n, readCurrentDaemonRuntimeContext as na, formatDeviceReplyReadinessLabel as ni, connectWebSocket as nn, isAgentActivityRouteRegistered as no, writeDispatchSpaceActionRecord as nr, getOrganizationJoinLinkResponseSchema as ns, colorizeAgentLabel as nt, runSpaceHistory as o, readDaemonServiceJobCrashExitCode as oa, resolveOpenClawLocalDiagnosticsValue as oi, runAuthLogin as on, AGENT_ACTIVITY_INTEGRATION_OWNER as oo, formatDaemonServiceMissingRecommendation as or, renderOpenMeldHeader as ot, runSpaceWatch as p, ensureVersionStateReady as pa, resolveConfiguredProfileWorkspacePath as pi, formatActiveOrganizationLabel as pn, formatOpenMeldCliCommand as po, createSpaceAddMembersGuideError as pr, runDaemonAutostart as pt, runAgentsCustomUpdate as q, resolveAuthenticationGuidance as qa, resolveOpenMeldEnvironmentTarget as qi, promptSearchMultiselect as qn, emitCliJsonEnvelope as qo, runPendingDaemonServiceUpdate as qr, runSkillsCheck as qt, runSpaceAddMembers as r, readCurrentObservedDaemonRuntimeStatus as ra, formatHumanReplyReadinessReason as ri, buildCommandAuthenticationPromptMessage as rn, registerAgentActivityRoute as ro, formatElapsedTime as rr, organizationJoinLinkErrorResponseSchema as rs, colorizeDisplayProfileLabel as rt, runSpaceJoin as s, resolveDaemonServiceManager as sa, syncProfileWorkspaceState as si, runAuthLogout as sn, defaultManagedIntegrationPaths as so, canUseInteractivePrompts as sr, renderOpenMeldLogo as st, buildCreateSpacePasswordPromptConfig as t, resolveVersionChangeDirection as ta, formatAgentReplyReadinessLabel as ti, readRecentDaemonDispatchJournalEvents as tn, requestLocalAgentActivitySync as to, readDispatchSpaceActionContextFromEnv as tr, cliJsonSkillsShowEnvelopeSchema as ts, formatTransportModeDisplay as tt, runSpacePassword as u, performManagedInstall as ua, ensureOpenMeldManagedProfileWorkspace as ui, exchangeOneTimeTokenAuthSession as un, resolveAgentActivityDispatcherCommand as uo, createProfileCreateGuideError as ur, resolveSpaceSendText as ut, buildHumanReadSignalsTranscriptItems as v, resolveDaemonRuntimeContractCompatibility as va, syncDeviceRuntimeStateProjection as vi, resolveDeviceTokenExpiresAt as vn, resolveSetupFollowUpCliEntryCommand as vo, createSpacePublicationSetGuideError as vr, runDaemonReinstall as vt, buildFormalDispatchResultReadPayload as w, renderHumanTextErrorCard as wa, notifyDaemonRouteCatalogChanged as wi, ensureAgentProfileRuntimeBinding as wn, removeAgentActivityContextCache as wo, createStartAgentIdentityGuideError as wr, runDaemonUninstall as wt, loadSpaceIdentityDirectoryOrNull as x, OPENMELD_VERSION as xa, listAgentTargetStates as xi, resolveCreateProfileKind as xn, readDaemonServiceContract as xo, createSpaceSubcommandTargetGuideError as xr, runDaemonStatusFlow as xt, emitHumanReadSignalsTextProjection as y, toStartBackgroundHelperExecutionCompatibility as ya, createPrimaryBindingReadSession as yi, revokeAuthAccessToken as yn, resolveUserFacingCliEntryCommand as yo, createSpaceRemoveMembersGuideError as yr, runDaemonRunAfterEntryChecks as yt, resolveHumanControllerDisplayName as z, updateOpenMeldProfile as za, buildOnboardingPlan as zi, buildDispatchResultMessageReadProjection as zn, setDefaultProjectConnection as zo, buildDualViewGuideMessage as zr, toStructuredGatewayFailure as zt };
|
|
109722
110019
|
|
|
109723
|
-
//# sourceMappingURL=command-
|
|
110020
|
+
//# sourceMappingURL=command-BTuYFU2T.js.map
|