openmeld 0.3.124 → 0.3.127
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-NHxQFPU0.js → add-me-membership-CSOBspmn.js} +2 -2
- package/dist/{add-me-membership-NHxQFPU0.js.map → add-me-membership-CSOBspmn.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-Cp18onuk.js → command-Dk3z-M2K.js} +1059 -592
- package/dist/{command-Cp18onuk.js.map → command-Dk3z-M2K.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 +504 -101
- 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 +1 -1
- 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
|
|
@@ -7971,6 +7989,7 @@ async function invokeClaudeAgentSdkTransport(input) {
|
|
|
7971
7989
|
prompt: createSinglePrompt(input.instructionPrompt?.userPrompt ?? prompt)
|
|
7972
7990
|
});
|
|
7973
7991
|
if (input.taskId) unregisterQuery = input.registerQuery?.({
|
|
7992
|
+
permissionModeUpdatesAllowed: input.executionMode !== "repair",
|
|
7974
7993
|
query: queryRuntime,
|
|
7975
7994
|
taskId: input.taskId
|
|
7976
7995
|
});
|
|
@@ -8469,7 +8488,7 @@ async function invokeClaudeWithSingleContextHeal(input) {
|
|
|
8469
8488
|
return new ClaudeRuntimeError({
|
|
8470
8489
|
code: "context.rebuild_failed",
|
|
8471
8490
|
errorType: "adapter",
|
|
8472
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
8491
|
+
message: `context.rebuild_failed: ${toErrorMessage$40(error)}`,
|
|
8473
8492
|
...providerAccessEvidence ? { providerAccessEvidence } : {},
|
|
8474
8493
|
...telemetry ? { telemetry } : {}
|
|
8475
8494
|
});
|
|
@@ -8529,7 +8548,7 @@ async function invokeClaudeOnce(input) {
|
|
|
8529
8548
|
throw new ClaudeRuntimeError({
|
|
8530
8549
|
code: "upstream_unreachable",
|
|
8531
8550
|
errorType: "adapter",
|
|
8532
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
8551
|
+
message: `upstream_unreachable: ${toErrorMessage$40(error)}`
|
|
8533
8552
|
});
|
|
8534
8553
|
}
|
|
8535
8554
|
}
|
|
@@ -8582,7 +8601,7 @@ function getClaudeTelemetry(error) {
|
|
|
8582
8601
|
const telemetry = error.telemetry;
|
|
8583
8602
|
return telemetry && typeof telemetry === "object" ? telemetry : null;
|
|
8584
8603
|
}
|
|
8585
|
-
function toErrorMessage$
|
|
8604
|
+
function toErrorMessage$40(error) {
|
|
8586
8605
|
if (error instanceof Error) return error.message;
|
|
8587
8606
|
return String(error);
|
|
8588
8607
|
}
|
|
@@ -8592,27 +8611,31 @@ const CLAUDE_CODE_CONVERSATION_BRIDGE_SPEC = resolveBuiltinAdapterConversationBr
|
|
|
8592
8611
|
const EXPECTED_FORCE_CLOSE_INTERRUPT_ERROR_RE = /query closed before response received/i;
|
|
8593
8612
|
const createClaudeCodeAdapter = (options) => {
|
|
8594
8613
|
const activeAgentSdkQueries = /* @__PURE__ */ new Map();
|
|
8595
|
-
const registerAgentSdkQuery = ({ query, taskId }) => {
|
|
8596
|
-
|
|
8614
|
+
const registerAgentSdkQuery = ({ permissionModeUpdatesAllowed, query, taskId }) => {
|
|
8615
|
+
const activeQuery = {
|
|
8616
|
+
permissionModeUpdatesAllowed,
|
|
8617
|
+
query
|
|
8618
|
+
};
|
|
8619
|
+
activeAgentSdkQueries.set(taskId, activeQuery);
|
|
8597
8620
|
return () => {
|
|
8598
|
-
if (activeAgentSdkQueries.get(taskId) ===
|
|
8621
|
+
if (activeAgentSdkQueries.get(taskId) === activeQuery) activeAgentSdkQueries.delete(taskId);
|
|
8599
8622
|
};
|
|
8600
8623
|
};
|
|
8601
8624
|
const sendInterrupt = async (signal) => {
|
|
8602
8625
|
const activeQuery = activeAgentSdkQueries.get(signal.taskId);
|
|
8603
8626
|
if (activeQuery) {
|
|
8604
8627
|
if (signal.mode === "force") {
|
|
8605
|
-
Promise.resolve().then(() => activeQuery.interrupt()).catch((error) => {
|
|
8628
|
+
Promise.resolve().then(() => activeQuery.query.interrupt()).catch((error) => {
|
|
8606
8629
|
if (isExpectedForceCloseInterruptError(error)) return;
|
|
8607
8630
|
console.warn("[openmeld.claude_code.force_interrupt_failed_after_close]", {
|
|
8608
8631
|
error: error instanceof Error ? error.message : String(error),
|
|
8609
8632
|
taskId: signal.taskId
|
|
8610
8633
|
});
|
|
8611
8634
|
});
|
|
8612
|
-
activeQuery.close();
|
|
8635
|
+
activeQuery.query.close();
|
|
8613
8636
|
return;
|
|
8614
8637
|
}
|
|
8615
|
-
await activeQuery.interrupt();
|
|
8638
|
+
await activeQuery.query.interrupt();
|
|
8616
8639
|
return;
|
|
8617
8640
|
}
|
|
8618
8641
|
if (options.sendInterrupt) {
|
|
@@ -8627,6 +8650,30 @@ const createClaudeCodeAdapter = (options) => {
|
|
|
8627
8650
|
sendInterrupt,
|
|
8628
8651
|
waitForMs: options.waitForMs
|
|
8629
8652
|
});
|
|
8653
|
+
const updatePermissionMode = async (input) => {
|
|
8654
|
+
if (!input.agentControllerPermissionMode.startsWith("claude-code:")) return {
|
|
8655
|
+
reasonCode: "adapter.permission_mode_incompatible",
|
|
8656
|
+
status: "not_applied",
|
|
8657
|
+
taskId: input.taskId
|
|
8658
|
+
};
|
|
8659
|
+
const activeQuery = activeAgentSdkQueries.get(input.taskId);
|
|
8660
|
+
if (!activeQuery) return {
|
|
8661
|
+
reasonCode: "adapter.task_not_active",
|
|
8662
|
+
status: "not_applied",
|
|
8663
|
+
taskId: input.taskId
|
|
8664
|
+
};
|
|
8665
|
+
if (!activeQuery.permissionModeUpdatesAllowed) return {
|
|
8666
|
+
reasonCode: "adapter.permission_mode_update_unsupported",
|
|
8667
|
+
status: "not_applied",
|
|
8668
|
+
taskId: input.taskId
|
|
8669
|
+
};
|
|
8670
|
+
await activeQuery.query.setPermissionMode(resolveClaudePermissionMode({ agentControllerPermissionMode: input.agentControllerPermissionMode }));
|
|
8671
|
+
return {
|
|
8672
|
+
effectiveFrom: "subsequent_tool_requests",
|
|
8673
|
+
status: "applied",
|
|
8674
|
+
taskId: input.taskId
|
|
8675
|
+
};
|
|
8676
|
+
};
|
|
8630
8677
|
const dispatch = createSharedDispatchShell({
|
|
8631
8678
|
adapterId: "claude-code",
|
|
8632
8679
|
bridgeSpec: CLAUDE_CODE_CONVERSATION_BRIDGE_SPEC,
|
|
@@ -8643,7 +8690,8 @@ const createClaudeCodeAdapter = (options) => {
|
|
|
8643
8690
|
adapterId: "claude-code",
|
|
8644
8691
|
cancel: controlShell.cancel,
|
|
8645
8692
|
dispatch,
|
|
8646
|
-
interrupt: controlShell.interrupt
|
|
8693
|
+
interrupt: controlShell.interrupt,
|
|
8694
|
+
updatePermissionMode
|
|
8647
8695
|
};
|
|
8648
8696
|
};
|
|
8649
8697
|
const isExpectedForceCloseInterruptError = (error) => {
|
|
@@ -9884,7 +9932,7 @@ var CodexAppServerSession = class {
|
|
|
9884
9932
|
this.#failAll(new CodexAppServerTransportError({
|
|
9885
9933
|
code: "protocol.invalid",
|
|
9886
9934
|
errorType: "adapter",
|
|
9887
|
-
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)})`
|
|
9888
9936
|
}));
|
|
9889
9937
|
return;
|
|
9890
9938
|
}
|
|
@@ -10626,15 +10674,15 @@ function toCodexAppServerTransportError(error, timeoutMs) {
|
|
|
10626
10674
|
errorType: error.errorType,
|
|
10627
10675
|
message: error.message
|
|
10628
10676
|
});
|
|
10629
|
-
if (timeoutMs !== null && toErrorMessage$
|
|
10677
|
+
if (timeoutMs !== null && toErrorMessage$39(error).includes("timed out")) return new CodexAppServerTransportError({
|
|
10630
10678
|
code: "process.timeout",
|
|
10631
10679
|
errorType: "timeout",
|
|
10632
|
-
message: toErrorMessage$
|
|
10680
|
+
message: toErrorMessage$39(error)
|
|
10633
10681
|
});
|
|
10634
10682
|
return new CodexAppServerTransportError({
|
|
10635
10683
|
code: "upstream_unreachable",
|
|
10636
10684
|
errorType: "adapter",
|
|
10637
|
-
message: `upstream_unreachable: failed to execute codex app-server (${toErrorMessage$
|
|
10685
|
+
message: `upstream_unreachable: failed to execute codex app-server (${toErrorMessage$39(error)})`
|
|
10638
10686
|
});
|
|
10639
10687
|
}
|
|
10640
10688
|
function readRequiredText(value, label) {
|
|
@@ -10664,7 +10712,7 @@ function resolveCodexAppServerAuthStatus(input) {
|
|
|
10664
10712
|
if (input.account) return "authenticated";
|
|
10665
10713
|
return input.response?.requiresOpenaiAuth === true ? "unauthenticated" : "unknown";
|
|
10666
10714
|
}
|
|
10667
|
-
function toErrorMessage$
|
|
10715
|
+
function toErrorMessage$39(error) {
|
|
10668
10716
|
if (error instanceof Error) return error.message;
|
|
10669
10717
|
return String(error);
|
|
10670
10718
|
}
|
|
@@ -10722,7 +10770,7 @@ async function verifyCodexLaunchContract(input) {
|
|
|
10722
10770
|
return fileCheck;
|
|
10723
10771
|
} catch (error) {
|
|
10724
10772
|
return {
|
|
10725
|
-
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)}`,
|
|
10726
10774
|
failureKind: error instanceof CodexAppServerTransportError && error.errorType === "timeout" ? "incomplete_check" : "completed_negative",
|
|
10727
10775
|
ok: false
|
|
10728
10776
|
};
|
|
@@ -10762,7 +10810,7 @@ async function inspectCodexLaunchCandidate(input) {
|
|
|
10762
10810
|
};
|
|
10763
10811
|
} catch (error) {
|
|
10764
10812
|
return {
|
|
10765
|
-
errorMessage: toErrorMessage$
|
|
10813
|
+
errorMessage: toErrorMessage$38(error),
|
|
10766
10814
|
failureKind: error instanceof CodexAppServerTransportError && error.errorType === "timeout" ? "incomplete_check" : "completed_negative",
|
|
10767
10815
|
ok: false
|
|
10768
10816
|
};
|
|
@@ -10806,7 +10854,7 @@ function resolveCodexControlProbeTimeoutMs(timeoutMs) {
|
|
|
10806
10854
|
if (typeof timeoutMs === "number") return timeoutMs;
|
|
10807
10855
|
return resolveCodexTimeoutMs() ?? CODEX_CONTROL_PROBE_TIMEOUT_MS;
|
|
10808
10856
|
}
|
|
10809
|
-
function toErrorMessage$
|
|
10857
|
+
function toErrorMessage$38(error) {
|
|
10810
10858
|
return error instanceof Error ? error.message : String(error);
|
|
10811
10859
|
}
|
|
10812
10860
|
function normalizeOptionalText$58(value) {
|
|
@@ -11369,7 +11417,7 @@ async function invokeCodexWithSingleContextHeal(input) {
|
|
|
11369
11417
|
createRebuildFailedError: (error) => new CodexRuntimeError({
|
|
11370
11418
|
code: "context.rebuild_failed",
|
|
11371
11419
|
errorType: "adapter",
|
|
11372
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
11420
|
+
message: `context.rebuild_failed: ${toErrorMessage$37(error)}`
|
|
11373
11421
|
}),
|
|
11374
11422
|
invokeOnce: (threadId) => invokeCodexOnce({
|
|
11375
11423
|
agentControllerPermissionMode: input.agentControllerPermissionMode,
|
|
@@ -11408,7 +11456,7 @@ async function invokeCodexAppServer(input) {
|
|
|
11408
11456
|
createRebuildFailedError: (error) => new CodexRuntimeError({
|
|
11409
11457
|
code: "context.rebuild_failed",
|
|
11410
11458
|
errorType: "adapter",
|
|
11411
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
11459
|
+
message: `context.rebuild_failed: ${toErrorMessage$37(error)}`
|
|
11412
11460
|
}),
|
|
11413
11461
|
invokeOnce: (threadId) => invokeCodexAppServerOnceWithAdmissionRetry({
|
|
11414
11462
|
...input,
|
|
@@ -11472,7 +11520,7 @@ function toCodexRuntimeError(error) {
|
|
|
11472
11520
|
return new CodexRuntimeError({
|
|
11473
11521
|
code: "upstream_unreachable",
|
|
11474
11522
|
errorType: "adapter",
|
|
11475
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
11523
|
+
message: `upstream_unreachable: ${toErrorMessage$37(error)}`
|
|
11476
11524
|
});
|
|
11477
11525
|
}
|
|
11478
11526
|
async function invokeCodexOnce(input) {
|
|
@@ -11503,11 +11551,11 @@ async function invokeCodexOnce(input) {
|
|
|
11503
11551
|
throw new CodexRuntimeError({
|
|
11504
11552
|
code: "upstream_unreachable",
|
|
11505
11553
|
errorType: "adapter",
|
|
11506
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
11554
|
+
message: `upstream_unreachable: ${toErrorMessage$37(error)}`
|
|
11507
11555
|
});
|
|
11508
11556
|
}
|
|
11509
11557
|
}
|
|
11510
|
-
function toErrorMessage$
|
|
11558
|
+
function toErrorMessage$37(error) {
|
|
11511
11559
|
if (error instanceof Error) return error.message;
|
|
11512
11560
|
return String(error);
|
|
11513
11561
|
}
|
|
@@ -11860,7 +11908,7 @@ async function interruptCodexActiveAppServerTurn(input) {
|
|
|
11860
11908
|
accepted: false,
|
|
11861
11909
|
plan,
|
|
11862
11910
|
reasonCode: "signal.send_failed",
|
|
11863
|
-
reasonDetail: toErrorMessage$
|
|
11911
|
+
reasonDetail: toErrorMessage$36(error),
|
|
11864
11912
|
signalDelivery: "not_sent",
|
|
11865
11913
|
taskId: input.request.taskId
|
|
11866
11914
|
};
|
|
@@ -11888,7 +11936,7 @@ const normalizeOptionalText$55 = (value) => {
|
|
|
11888
11936
|
const normalized = String(value ?? "").trim();
|
|
11889
11937
|
return normalized.length > 0 ? normalized : null;
|
|
11890
11938
|
};
|
|
11891
|
-
const toErrorMessage$
|
|
11939
|
+
const toErrorMessage$36 = (error) => error instanceof Error ? error.message : String(error);
|
|
11892
11940
|
const isDefaultInvokeDisabledForTests = (options) => options[TEST_DISABLE_DEFAULT_INVOKE] === true;
|
|
11893
11941
|
//#endregion
|
|
11894
11942
|
//#region ../../runtime/adapters/grok-build/dist/config/grok-build-runtime-config.js
|
|
@@ -12767,7 +12815,7 @@ async function emitFinalPreviewIfRequested$1(input) {
|
|
|
12767
12815
|
await input.onPreview({ text: input.output });
|
|
12768
12816
|
}
|
|
12769
12817
|
function toGrokBuildTransportError(error, stderr, diagnostics) {
|
|
12770
|
-
const combined = [toErrorMessage$
|
|
12818
|
+
const combined = [toErrorMessage$35(error), normalizeOptionalText$53(stderr)].filter((value) => value !== null).join("\n");
|
|
12771
12819
|
const providerFailure = !(error instanceof GrokBuildAcpTransportError) || error.code.startsWith("protocol.") ? classifyGrokBuildProviderFailure(combined) : null;
|
|
12772
12820
|
if (providerFailure) return diagnostics ? new GrokBuildAcpTransportError({
|
|
12773
12821
|
cause: error,
|
|
@@ -12833,7 +12881,7 @@ function normalizeOptionalText$53(value) {
|
|
|
12833
12881
|
function toRecord$7(value) {
|
|
12834
12882
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
12835
12883
|
}
|
|
12836
|
-
function toErrorMessage$
|
|
12884
|
+
function toErrorMessage$35(error) {
|
|
12837
12885
|
return error instanceof Error ? error.message : String(error);
|
|
12838
12886
|
}
|
|
12839
12887
|
//#endregion
|
|
@@ -12904,7 +12952,7 @@ function createDefaultGrokBuildInvoke(input) {
|
|
|
12904
12952
|
code: "context.rebuild_failed",
|
|
12905
12953
|
...error instanceof GrokBuildAcpTransportError && error.diagnostics ? { diagnostics: error.diagnostics } : {},
|
|
12906
12954
|
errorType: "adapter",
|
|
12907
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
12955
|
+
message: `context.rebuild_failed: ${toErrorMessage$34(error)}`
|
|
12908
12956
|
}),
|
|
12909
12957
|
invokeOnce: async (sessionId) => {
|
|
12910
12958
|
const transportResult = await invokeGrokBuildAcpTransport({
|
|
@@ -12984,7 +13032,7 @@ async function cancelActiveGrokBuildTurn(input) {
|
|
|
12984
13032
|
return {
|
|
12985
13033
|
accepted: false,
|
|
12986
13034
|
reasonCode: "signal.send_failed",
|
|
12987
|
-
reasonDetail: toErrorMessage$
|
|
13035
|
+
reasonDetail: toErrorMessage$34(error),
|
|
12988
13036
|
signalDelivery: "not_sent",
|
|
12989
13037
|
taskId: input.request.taskId
|
|
12990
13038
|
};
|
|
@@ -13013,7 +13061,7 @@ function normalizeOptionalText$52(value) {
|
|
|
13013
13061
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
13014
13062
|
return normalized.length > 0 ? normalized : null;
|
|
13015
13063
|
}
|
|
13016
|
-
function toErrorMessage$
|
|
13064
|
+
function toErrorMessage$34(error) {
|
|
13017
13065
|
return error instanceof Error ? error.message : String(error);
|
|
13018
13066
|
}
|
|
13019
13067
|
//#endregion
|
|
@@ -14744,7 +14792,7 @@ async function invokeOpenCodeWithSingleContextHeal(input) {
|
|
|
14744
14792
|
createRebuildFailedError: (error) => new OpenCodeRuntimeError({
|
|
14745
14793
|
code: "context.rebuild_failed",
|
|
14746
14794
|
errorType: "adapter",
|
|
14747
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
14795
|
+
message: `context.rebuild_failed: ${toErrorMessage$33(error)}`
|
|
14748
14796
|
}),
|
|
14749
14797
|
invokeOnce: (sessionId) => invokeOpenCodeOnce({
|
|
14750
14798
|
launchContract: input.launchContract,
|
|
@@ -14815,11 +14863,11 @@ async function invokeOpenCodeOnce(input) {
|
|
|
14815
14863
|
throw new OpenCodeRuntimeError({
|
|
14816
14864
|
code: "upstream_unreachable",
|
|
14817
14865
|
errorType: "adapter",
|
|
14818
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
14866
|
+
message: `upstream_unreachable: ${toErrorMessage$33(error)}`
|
|
14819
14867
|
});
|
|
14820
14868
|
}
|
|
14821
14869
|
}
|
|
14822
|
-
function toErrorMessage$
|
|
14870
|
+
function toErrorMessage$33(error) {
|
|
14823
14871
|
if (error instanceof Error) return error.message;
|
|
14824
14872
|
return String(error);
|
|
14825
14873
|
}
|
|
@@ -15131,7 +15179,7 @@ async function mapCodexThread(input) {
|
|
|
15131
15179
|
if (!(nativeSessionId && cwd && lastActiveAtMs !== null)) throw new Error("Codex returned a malformed retained thread record.");
|
|
15132
15180
|
const binding = await resolveObservedAgentActivityBinding(cwd, input.bindings);
|
|
15133
15181
|
if (!binding) return null;
|
|
15134
|
-
const runtimeStatus = isRecord$
|
|
15182
|
+
const runtimeStatus = isRecord$7(input.thread.status) ? text$1(input.thread.status.type) : null;
|
|
15135
15183
|
return {
|
|
15136
15184
|
binding,
|
|
15137
15185
|
session: observedLocalAgentSessionSchema.parse({
|
|
@@ -15175,7 +15223,7 @@ async function listAllCodexThreads(launchContract) {
|
|
|
15175
15223
|
sourceKinds: CODEX_THREAD_SOURCE_KINDS,
|
|
15176
15224
|
useStateDbOnly: false
|
|
15177
15225
|
});
|
|
15178
|
-
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.");
|
|
15179
15227
|
pages.push({
|
|
15180
15228
|
archived,
|
|
15181
15229
|
data: response.data
|
|
@@ -15300,12 +15348,12 @@ function consumeCodexJsonRpcChunk(input) {
|
|
|
15300
15348
|
}
|
|
15301
15349
|
}
|
|
15302
15350
|
function settleCodexJsonRpcResponse(message, pending) {
|
|
15303
|
-
if (!isRecord$
|
|
15351
|
+
if (!isRecord$7(message) || typeof message.id !== "number") return;
|
|
15304
15352
|
const request = pending.get(message.id);
|
|
15305
15353
|
if (!request) return;
|
|
15306
15354
|
pending.delete(message.id);
|
|
15307
15355
|
clearTimeout(request.timer);
|
|
15308
|
-
if (isRecord$
|
|
15356
|
+
if (isRecord$7(message.error)) {
|
|
15309
15357
|
request.reject(new Error(text$1(message.error.message) ?? "Codex app-server request failed."));
|
|
15310
15358
|
return;
|
|
15311
15359
|
}
|
|
@@ -15426,7 +15474,7 @@ function applyClaudeSessionLine(state, line) {
|
|
|
15426
15474
|
} catch (error) {
|
|
15427
15475
|
throw new Error("Claude Code Session file contains malformed JSON.", { cause: error });
|
|
15428
15476
|
}
|
|
15429
|
-
if (!isRecord$
|
|
15477
|
+
if (!isRecord$7(value)) return;
|
|
15430
15478
|
const rowSessionId = text$1(value.sessionId);
|
|
15431
15479
|
if (rowSessionId && state.nativeSessionId !== rowSessionId) {
|
|
15432
15480
|
if (state.nativeSessionId) throw new Error("Claude Code Session file contains conflicting IDs.");
|
|
@@ -15598,12 +15646,12 @@ async function discoverGrokBuildRetainedSessions(input) {
|
|
|
15598
15646
|
const identities = /* @__PURE__ */ new Set();
|
|
15599
15647
|
for (const path of paths) {
|
|
15600
15648
|
const summary = JSON.parse(await readFile(path, "utf8"));
|
|
15601
|
-
if (!isRecord$
|
|
15649
|
+
if (!isRecord$7(summary)) throw new Error("Grok Build summary metadata is invalid.");
|
|
15602
15650
|
const topLevelIdentity = {
|
|
15603
15651
|
cwd: text$1(summary.cwd),
|
|
15604
15652
|
nativeSessionId: text$1(summary.id)
|
|
15605
15653
|
};
|
|
15606
|
-
const nestedInfo = isRecord$
|
|
15654
|
+
const nestedInfo = isRecord$7(summary.info) ? summary.info : null;
|
|
15607
15655
|
const nestedIdentity = {
|
|
15608
15656
|
cwd: text$1(nestedInfo?.cwd),
|
|
15609
15657
|
nativeSessionId: text$1(nestedInfo?.id)
|
|
@@ -15753,7 +15801,7 @@ function mapClaudeAgentStatus(value) {
|
|
|
15753
15801
|
}
|
|
15754
15802
|
function collectRecords(value) {
|
|
15755
15803
|
if (Array.isArray(value)) return value.flatMap(collectRecords);
|
|
15756
|
-
if (!isRecord$
|
|
15804
|
+
if (!isRecord$7(value)) return [];
|
|
15757
15805
|
return [value, ...Object.values(value).flatMap(collectRecords)];
|
|
15758
15806
|
}
|
|
15759
15807
|
function secondsTimestamp(value) {
|
|
@@ -15776,7 +15824,7 @@ function parseCodexNextCursor(value) {
|
|
|
15776
15824
|
function text$1(value) {
|
|
15777
15825
|
return nullableText(value);
|
|
15778
15826
|
}
|
|
15779
|
-
function isRecord$
|
|
15827
|
+
function isRecord$7(value) {
|
|
15780
15828
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
15781
15829
|
}
|
|
15782
15830
|
function isNodeError$4(error, code) {
|
|
@@ -16963,7 +17011,7 @@ async function readAgentActivityIntegrationStatus(paths) {
|
|
|
16963
17011
|
claude: claude !== null && CLAUDE_EVENTS.every((event) => {
|
|
16964
17012
|
try {
|
|
16965
17013
|
const settings = parseSettings(claude);
|
|
16966
|
-
const hooks = isRecord$
|
|
17014
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
16967
17015
|
return Array.isArray(hooks?.[event]) && hooks[event].some((group) => knownArtifacts.some((artifacts) => hasOwnedClaudeHook(group, artifacts)));
|
|
16968
17016
|
} catch {
|
|
16969
17017
|
return false;
|
|
@@ -16973,7 +17021,7 @@ async function readAgentActivityIntegrationStatus(paths) {
|
|
|
16973
17021
|
cursor: cursor !== null && CURSOR_EVENTS.every((event) => {
|
|
16974
17022
|
try {
|
|
16975
17023
|
const settings = parseJsonObject(cursor, "Cursor hooks");
|
|
16976
|
-
const hooks = isRecord$
|
|
17024
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
16977
17025
|
return Array.isArray(hooks?.[event]) && hooks[event].some((entry) => knownArtifacts.some((artifacts) => isOwnedCursorHook(entry, artifacts.cursorCommand)));
|
|
16978
17026
|
} catch {
|
|
16979
17027
|
return false;
|
|
@@ -17028,7 +17076,7 @@ function installCursorHooks(raw, artifacts, knownArtifacts) {
|
|
|
17028
17076
|
}
|
|
17029
17077
|
function uninstallCursorHooks(raw, knownArtifacts) {
|
|
17030
17078
|
const settings = parseJsonObject(raw, "Cursor hooks");
|
|
17031
|
-
const hooks = isRecord$
|
|
17079
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
17032
17080
|
if (!hooks) return raw;
|
|
17033
17081
|
for (const event of CURSOR_EVENTS) {
|
|
17034
17082
|
if (!Array.isArray(hooks[event])) continue;
|
|
@@ -17044,17 +17092,17 @@ function ownedCursorHook(command) {
|
|
|
17044
17092
|
};
|
|
17045
17093
|
}
|
|
17046
17094
|
function isOwnedCursorHook(value, command) {
|
|
17047
|
-
return isRecord$
|
|
17095
|
+
return isRecord$6(value) && Object.keys(value).length === 2 && value.command === command && value.timeout === 10;
|
|
17048
17096
|
}
|
|
17049
17097
|
function isKnownOwnedCursorHook(value, knownArtifacts) {
|
|
17050
17098
|
return knownArtifacts.some((artifacts) => isOwnedCursorHook(value, artifacts.cursorCommand) || isOwnedCursorHook(value, artifacts.legacyCursorCommand));
|
|
17051
17099
|
}
|
|
17052
17100
|
function hasUnknownOpenMeldCursorHook(value, knownArtifacts) {
|
|
17053
|
-
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);
|
|
17054
17102
|
}
|
|
17055
17103
|
function uninstallClaudeHooks(raw, knownArtifacts) {
|
|
17056
17104
|
const settings = parseSettings(raw);
|
|
17057
|
-
const hooks = isRecord$
|
|
17105
|
+
const hooks = isRecord$6(settings.hooks) ? settings.hooks : null;
|
|
17058
17106
|
if (!hooks) return raw;
|
|
17059
17107
|
for (const event of CLAUDE_EVENTS) {
|
|
17060
17108
|
if (!Array.isArray(hooks[event])) continue;
|
|
@@ -17071,14 +17119,14 @@ function ownedClaudeGroup(artifacts) {
|
|
|
17071
17119
|
}] };
|
|
17072
17120
|
}
|
|
17073
17121
|
function isOwnedClaudeGroup(value, artifacts) {
|
|
17074
|
-
if (!isRecord$
|
|
17075
|
-
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;
|
|
17076
17124
|
}
|
|
17077
17125
|
function hasOwnedClaudeHook(value, artifacts) {
|
|
17078
|
-
return isRecord$
|
|
17126
|
+
return isRecord$6(value) && Array.isArray(value.hooks) && value.hooks.some((hook) => isRecord$6(hook) && hook.command === artifacts.claudeCommand);
|
|
17079
17127
|
}
|
|
17080
17128
|
function hasUnknownOpenMeldClaudeHook(value, knownArtifacts) {
|
|
17081
|
-
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);
|
|
17082
17130
|
}
|
|
17083
17131
|
function isLegacyOwnedClaudeGroup(value, artifacts) {
|
|
17084
17132
|
return isOwnedClaudeGroupForCommand(value, artifacts.legacyClaudeCommand);
|
|
@@ -17137,8 +17185,8 @@ function extractCodexTrustState(block, endMarker) {
|
|
|
17137
17185
|
};
|
|
17138
17186
|
}
|
|
17139
17187
|
function isOwnedClaudeGroupForCommand(value, command) {
|
|
17140
|
-
if (!isRecord$
|
|
17141
|
-
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;
|
|
17142
17190
|
}
|
|
17143
17191
|
async function planPluginInstall(path, artifacts, knownArtifacts) {
|
|
17144
17192
|
const current = await readOptionalFile$1(path);
|
|
@@ -17278,12 +17326,12 @@ function parseSettings(raw) {
|
|
|
17278
17326
|
function parseJsonObject(raw, label) {
|
|
17279
17327
|
if (!raw.trim()) return {};
|
|
17280
17328
|
const value = JSON.parse(raw);
|
|
17281
|
-
if (!isRecord$
|
|
17329
|
+
if (!isRecord$6(value)) throw new Error(`${label} must be a JSON object.`);
|
|
17282
17330
|
return value;
|
|
17283
17331
|
}
|
|
17284
17332
|
function ensureRecord(parent, key, label = "Claude settings") {
|
|
17285
17333
|
if (parent[key] === void 0) parent[key] = {};
|
|
17286
|
-
if (!isRecord$
|
|
17334
|
+
if (!isRecord$6(parent[key])) throw new Error(`${label} ${key} must be an object.`);
|
|
17287
17335
|
return parent[key];
|
|
17288
17336
|
}
|
|
17289
17337
|
function emptyFileFor(path) {
|
|
@@ -17293,7 +17341,7 @@ function revisionConflict(path) {
|
|
|
17293
17341
|
const digest = createHash("sha256").update(path).digest("hex").slice(0, 12);
|
|
17294
17342
|
return /* @__PURE__ */ new Error(`Managed integration revision changed before commit (${digest}).`);
|
|
17295
17343
|
}
|
|
17296
|
-
function isRecord$
|
|
17344
|
+
function isRecord$6(value) {
|
|
17297
17345
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
17298
17346
|
}
|
|
17299
17347
|
function isNodeError$2(error, code) {
|
|
@@ -17910,13 +17958,13 @@ function resolveOpenMeldAccountContext(input) {
|
|
|
17910
17958
|
key: normalizeAccountKey({}),
|
|
17911
17959
|
source: "fallback"
|
|
17912
17960
|
};
|
|
17913
|
-
const normalizedBaseUrl = normalizeOptionalString$
|
|
17961
|
+
const normalizedBaseUrl = normalizeOptionalString$18(session.authBaseUrl);
|
|
17914
17962
|
const hostKey = resolveHostKey(normalizedBaseUrl);
|
|
17915
17963
|
const user = normalizeUser(session.user);
|
|
17916
17964
|
const userKey = user?.id ?? user?.email ?? buildSessionScopedUserKey({
|
|
17917
17965
|
authBaseUrl: normalizedBaseUrl,
|
|
17918
|
-
clientId: normalizeOptionalString$
|
|
17919
|
-
createdAt: normalizeOptionalString$
|
|
17966
|
+
clientId: normalizeOptionalString$18(session.clientId),
|
|
17967
|
+
createdAt: normalizeOptionalString$18(session.createdAt)
|
|
17920
17968
|
});
|
|
17921
17969
|
return {
|
|
17922
17970
|
key: normalizeAccountKey({
|
|
@@ -17929,7 +17977,7 @@ function resolveOpenMeldAccountContext(input) {
|
|
|
17929
17977
|
};
|
|
17930
17978
|
}
|
|
17931
17979
|
async function resolveCurrentOpenMeldAccountContext() {
|
|
17932
|
-
const { getAuthSessionMetadata } = await import("./auth-session-
|
|
17980
|
+
const { getAuthSessionMetadata } = await import("./auth-session-B1jSy0ws.js").then((n) => n.r);
|
|
17933
17981
|
return resolveOpenMeldAccountContext({ session: await getAuthSessionMetadata().catch(() => null) });
|
|
17934
17982
|
}
|
|
17935
17983
|
function resolveHostKey(baseUrl) {
|
|
@@ -17952,9 +18000,9 @@ function buildSessionScopedUserKey(input) {
|
|
|
17952
18000
|
function normalizeUser(value) {
|
|
17953
18001
|
if (!(value && typeof value === "object")) return null;
|
|
17954
18002
|
const record = value;
|
|
17955
|
-
const id = normalizeOptionalString$
|
|
17956
|
-
const email = normalizeOptionalString$
|
|
17957
|
-
const name = normalizeOptionalString$
|
|
18003
|
+
const id = normalizeOptionalString$18(record.id);
|
|
18004
|
+
const email = normalizeOptionalString$18(record.email);
|
|
18005
|
+
const name = normalizeOptionalString$18(record.name);
|
|
17958
18006
|
if (!(id || email || name)) return null;
|
|
17959
18007
|
return {
|
|
17960
18008
|
...id ? { id } : {},
|
|
@@ -17962,7 +18010,7 @@ function normalizeUser(value) {
|
|
|
17962
18010
|
...name ? { name } : {}
|
|
17963
18011
|
};
|
|
17964
18012
|
}
|
|
17965
|
-
function normalizeOptionalString$
|
|
18013
|
+
function normalizeOptionalString$18(value) {
|
|
17966
18014
|
if (typeof value !== "string") return null;
|
|
17967
18015
|
const normalized = value.trim();
|
|
17968
18016
|
return normalized.length > 0 ? normalized : null;
|
|
@@ -18072,9 +18120,9 @@ function createAuthenticationError(input) {
|
|
|
18072
18120
|
return new OpenMeldAuthenticationError(resolveAuthenticationGuidance(input));
|
|
18073
18121
|
}
|
|
18074
18122
|
function resolveAuthenticationGuidance(input) {
|
|
18075
|
-
const action = normalizeOptionalString$
|
|
18076
|
-
const authBaseUrl = normalizeOptionalString$
|
|
18077
|
-
const gatewayUrl = normalizeOptionalString$
|
|
18123
|
+
const action = normalizeOptionalString$17(input.action);
|
|
18124
|
+
const authBaseUrl = normalizeOptionalString$17(input.authBaseUrl);
|
|
18125
|
+
const gatewayUrl = normalizeOptionalString$17(input.gatewayUrl);
|
|
18078
18126
|
if (input.reason === "mismatch") return {
|
|
18079
18127
|
reason: input.reason,
|
|
18080
18128
|
action,
|
|
@@ -18098,7 +18146,7 @@ function resolveAuthenticationGuidance(input) {
|
|
|
18098
18146
|
};
|
|
18099
18147
|
}
|
|
18100
18148
|
function buildCommandAuthenticationPromptMessage$1(action) {
|
|
18101
|
-
const normalizedAction = normalizeOptionalString$
|
|
18149
|
+
const normalizedAction = normalizeOptionalString$17(action);
|
|
18102
18150
|
if (!normalizedAction) return "Sign in is required to continue. What do you want to do?";
|
|
18103
18151
|
return `Sign in is required before ${normalizedAction}. What do you want to do?`;
|
|
18104
18152
|
}
|
|
@@ -18185,7 +18233,7 @@ function resolveAuthenticationGuidanceFromMessage(message) {
|
|
|
18185
18233
|
function extractAuthenticationPromptAction(promptMessage) {
|
|
18186
18234
|
const normalizedMessage = String(promptMessage ?? "").trim();
|
|
18187
18235
|
if (normalizedMessage.length === 0) return null;
|
|
18188
|
-
return normalizeOptionalString$
|
|
18236
|
+
return normalizeOptionalString$17(AUTH_PROMPT_ACTION_RE.exec(normalizedMessage)?.groups?.action);
|
|
18189
18237
|
}
|
|
18190
18238
|
function resolveRequiredAuthenticationGuidance(reason) {
|
|
18191
18239
|
switch (reason) {
|
|
@@ -18265,7 +18313,7 @@ function buildAgentAuthenticationNotes(guidance) {
|
|
|
18265
18313
|
if (guidance.gatewayUrl) notes.push(`Current gateway: ${guidance.gatewayUrl}`);
|
|
18266
18314
|
return notes;
|
|
18267
18315
|
}
|
|
18268
|
-
function normalizeOptionalString$
|
|
18316
|
+
function normalizeOptionalString$17(value) {
|
|
18269
18317
|
const normalized = String(value ?? "").trim();
|
|
18270
18318
|
return normalized.length > 0 ? normalized : null;
|
|
18271
18319
|
}
|
|
@@ -18419,15 +18467,15 @@ function parseLegacySelectionPayload(raw) {
|
|
|
18419
18467
|
try {
|
|
18420
18468
|
const payload = JSON.parse(raw);
|
|
18421
18469
|
if (payload.v !== 1) return null;
|
|
18422
|
-
const sessionId = normalizeOptionalString$
|
|
18423
|
-
const openMeldProfileId = normalizeOptionalString$
|
|
18470
|
+
const sessionId = normalizeOptionalString$16(payload.sessionId);
|
|
18471
|
+
const openMeldProfileId = normalizeOptionalString$16(payload.openMeldProfileId);
|
|
18424
18472
|
if (!(sessionId && openMeldProfileId)) return null;
|
|
18425
18473
|
return {
|
|
18426
18474
|
v: 1,
|
|
18427
18475
|
sessionId,
|
|
18428
|
-
sessionSource: normalizeOptionalString$
|
|
18476
|
+
sessionSource: normalizeOptionalString$16(payload.sessionSource) ?? "manual",
|
|
18429
18477
|
openMeldProfileId,
|
|
18430
|
-
updatedAt: normalizeOptionalString$
|
|
18478
|
+
updatedAt: normalizeOptionalString$16(payload.updatedAt) ?? (/* @__PURE__ */ new Date(0)).toISOString()
|
|
18431
18479
|
};
|
|
18432
18480
|
} catch {
|
|
18433
18481
|
return null;
|
|
@@ -18457,12 +18505,12 @@ function toSafeSessionFile(value) {
|
|
|
18457
18505
|
const maxBaseLength = Math.max(1, SESSION_FILE_MAX_LENGTH - SESSION_FILE_HASH_LENGTH - 1);
|
|
18458
18506
|
return `${safeBase.slice(0, maxBaseLength)}-${hash}`;
|
|
18459
18507
|
}
|
|
18460
|
-
function normalizeOptionalString$
|
|
18508
|
+
function normalizeOptionalString$16(value) {
|
|
18461
18509
|
const normalized = String(value ?? "").trim();
|
|
18462
18510
|
return normalized.length > 0 ? normalized : null;
|
|
18463
18511
|
}
|
|
18464
18512
|
function normalizeRequiredString$1(value, field) {
|
|
18465
|
-
const normalized = normalizeOptionalString$
|
|
18513
|
+
const normalized = normalizeOptionalString$16(value);
|
|
18466
18514
|
if (!normalized) throw new Error(`${field} is required`);
|
|
18467
18515
|
return normalized;
|
|
18468
18516
|
}
|
|
@@ -18558,7 +18606,7 @@ var AuthProfilesApiError = class extends Error {
|
|
|
18558
18606
|
this.name = "AuthProfilesApiError";
|
|
18559
18607
|
this.status = input.status;
|
|
18560
18608
|
this.endpoint = input.endpoint;
|
|
18561
|
-
this.code = normalizeOptionalString$
|
|
18609
|
+
this.code = normalizeOptionalString$15(input.code);
|
|
18562
18610
|
}
|
|
18563
18611
|
};
|
|
18564
18612
|
function isAuthProfilesApiError(error) {
|
|
@@ -18584,13 +18632,13 @@ async function resolveOpenMeldProfile(input) {
|
|
|
18584
18632
|
method: "POST",
|
|
18585
18633
|
path: "/v1/profiles/resolve",
|
|
18586
18634
|
body: {
|
|
18587
|
-
...normalizeOptionalString$
|
|
18635
|
+
...normalizeOptionalString$15(input.openMeldProfileId) ? { openMeldProfileId: normalizeOptionalString$15(input.openMeldProfileId) } : {},
|
|
18588
18636
|
...input.profileKind ? { profileKind: input.profileKind } : {}
|
|
18589
18637
|
}
|
|
18590
18638
|
}), "profile"));
|
|
18591
18639
|
}
|
|
18592
18640
|
async function resolveOpenMeldProfileByIdOrName(input) {
|
|
18593
|
-
const profileIdentifier = normalizeOptionalString$
|
|
18641
|
+
const profileIdentifier = normalizeOptionalString$15(input.profileIdentifier);
|
|
18594
18642
|
if (!profileIdentifier) throw new Error("profile identifier is required");
|
|
18595
18643
|
try {
|
|
18596
18644
|
return await resolveOpenMeldProfile({
|
|
@@ -18609,8 +18657,8 @@ async function resolveOpenMeldProfileByIdOrName(input) {
|
|
|
18609
18657
|
}
|
|
18610
18658
|
}
|
|
18611
18659
|
function createOpenMeldAgentProfile(input) {
|
|
18612
|
-
const profileName = normalizeOptionalString$
|
|
18613
|
-
const creatorProfileId = normalizeOptionalString$
|
|
18660
|
+
const profileName = normalizeOptionalString$15(input.profileName);
|
|
18661
|
+
const creatorProfileId = normalizeOptionalString$15(input.creatorProfileId) ?? void 0;
|
|
18614
18662
|
if (!profileName) throw new Error("profile name is required");
|
|
18615
18663
|
return createOpenMeldAgentProfileRequest({
|
|
18616
18664
|
profileName,
|
|
@@ -18618,8 +18666,8 @@ function createOpenMeldAgentProfile(input) {
|
|
|
18618
18666
|
});
|
|
18619
18667
|
}
|
|
18620
18668
|
async function createOpenMeldHumanProfile(input) {
|
|
18621
|
-
const profileName = normalizeOptionalString$
|
|
18622
|
-
const creatorProfileId = normalizeOptionalString$
|
|
18669
|
+
const profileName = normalizeOptionalString$15(input.profileName);
|
|
18670
|
+
const creatorProfileId = normalizeOptionalString$15(input.creatorProfileId) ?? void 0;
|
|
18623
18671
|
if (!profileName) throw new Error("profile name is required");
|
|
18624
18672
|
try {
|
|
18625
18673
|
assertAdditionalHumanProfileCreationEnabled(await getOpenMeldProfileCapabilities());
|
|
@@ -18642,9 +18690,9 @@ async function createOpenMeldHumanProfile(input) {
|
|
|
18642
18690
|
return created;
|
|
18643
18691
|
}
|
|
18644
18692
|
async function updateOpenMeldProfile(input) {
|
|
18645
|
-
const openMeldProfileId = normalizeOptionalString$
|
|
18693
|
+
const openMeldProfileId = normalizeOptionalString$15(input.openMeldProfileId);
|
|
18646
18694
|
if (!openMeldProfileId) throw new Error("openMeldProfileId is required");
|
|
18647
|
-
const profileName = normalizeOptionalString$
|
|
18695
|
+
const profileName = normalizeOptionalString$15(input.profileName);
|
|
18648
18696
|
if (!Boolean(profileName)) throw new Error("profileName is required");
|
|
18649
18697
|
const updated = parseOpenMeldProfileItem(readRecordField(await requestOpenMeldProfilesApi({
|
|
18650
18698
|
method: "PATCH",
|
|
@@ -18655,7 +18703,7 @@ async function updateOpenMeldProfile(input) {
|
|
|
18655
18703
|
return updated;
|
|
18656
18704
|
}
|
|
18657
18705
|
async function deleteOpenMeldProfile(input) {
|
|
18658
|
-
const openMeldProfileId = normalizeOptionalString$
|
|
18706
|
+
const openMeldProfileId = normalizeOptionalString$15(input.openMeldProfileId);
|
|
18659
18707
|
if (!openMeldProfileId) throw new Error("openMeldProfileId is required");
|
|
18660
18708
|
const deleted = parseOpenMeldProfileItem(readRecordField(await requestOpenMeldProfilesApi({
|
|
18661
18709
|
method: "DELETE",
|
|
@@ -18666,7 +18714,7 @@ async function deleteOpenMeldProfile(input) {
|
|
|
18666
18714
|
}
|
|
18667
18715
|
async function requestOpenMeldProfilesApi(input) {
|
|
18668
18716
|
const session = await requireOpenMeldProfilesSession();
|
|
18669
|
-
const endpoint = toAuthEndpoint$
|
|
18717
|
+
const endpoint = toAuthEndpoint$4(session.authBaseUrl, input.path);
|
|
18670
18718
|
const response = await fetch(endpoint, {
|
|
18671
18719
|
method: input.method,
|
|
18672
18720
|
headers: {
|
|
@@ -18676,7 +18724,7 @@ async function requestOpenMeldProfilesApi(input) {
|
|
|
18676
18724
|
...input.body ? { body: JSON.stringify(input.body) } : {},
|
|
18677
18725
|
signal: AbortSignal.timeout(resolveOpenMeldProfilesApiTimeoutMs(endpoint))
|
|
18678
18726
|
});
|
|
18679
|
-
const payload = await parseResponseJson$
|
|
18727
|
+
const payload = await parseResponseJson$3(response);
|
|
18680
18728
|
if (!response.ok) {
|
|
18681
18729
|
const parsedError = profileErrorResponseSchema.safeParse(payload);
|
|
18682
18730
|
const status = response.status;
|
|
@@ -18697,7 +18745,7 @@ async function requestOpenMeldProfilesApi(input) {
|
|
|
18697
18745
|
})
|
|
18698
18746
|
});
|
|
18699
18747
|
}
|
|
18700
|
-
const record = isRecord$
|
|
18748
|
+
const record = isRecord$5(payload) ? payload : {};
|
|
18701
18749
|
if (!readBooleanField(record, "ok")) {
|
|
18702
18750
|
const parsedError = profileErrorResponseSchema.safeParse(payload);
|
|
18703
18751
|
const code = parsedError.success ? parsedError.data.code : null;
|
|
@@ -18778,8 +18826,8 @@ async function emitRouteCatalogSync(reason) {
|
|
|
18778
18826
|
await touchDaemonCatalogSyncSignal({ reason }).catch(() => void 0);
|
|
18779
18827
|
}
|
|
18780
18828
|
function parseOpenMeldProfileItem(value) {
|
|
18781
|
-
const record = isRecord$
|
|
18782
|
-
const openMeldProfileId = readOptionalStringField
|
|
18829
|
+
const record = isRecord$5(value) ? value : {};
|
|
18830
|
+
const openMeldProfileId = readOptionalStringField(record, "openMeldProfileId");
|
|
18783
18831
|
if (!openMeldProfileId) throw new Error("invalid profile payload: missing openMeldProfileId");
|
|
18784
18832
|
const profileName = readRequiredStringField(record, "profileName");
|
|
18785
18833
|
const profileHandle = readRequiredStringField(record, "profileHandle");
|
|
@@ -18787,14 +18835,14 @@ function parseOpenMeldProfileItem(value) {
|
|
|
18787
18835
|
const isDefault = readOptionalBooleanField(record, "isDefault") ?? false;
|
|
18788
18836
|
const status = readProfileStatus(record, "status");
|
|
18789
18837
|
const ownerUserId = readRequiredStringField(record, "ownerUserId");
|
|
18790
|
-
const ownerName = readOptionalStringField
|
|
18838
|
+
const ownerName = readOptionalStringField(record, "ownerName") ?? void 0;
|
|
18791
18839
|
const source = readRequiredStringField(record, "source");
|
|
18792
18840
|
const managedRole = readOptionalManagedRoleField(record, "managedRole");
|
|
18793
|
-
const createdByUserId = readOptionalStringField
|
|
18794
|
-
const defaultProjectId = readOptionalStringField
|
|
18795
|
-
const creationActorProfileId = readOptionalStringField
|
|
18796
|
-
const creatorProfileId = readOptionalStringField
|
|
18797
|
-
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");
|
|
18798
18846
|
const createdAt = readRequiredStringField(record, "createdAt");
|
|
18799
18847
|
const updatedAt = readRequiredStringField(record, "updatedAt");
|
|
18800
18848
|
return {
|
|
@@ -18828,7 +18876,7 @@ function readProfileStatus(input, field) {
|
|
|
18828
18876
|
throw new Error(`invalid profile payload: unsupported ${field}`);
|
|
18829
18877
|
}
|
|
18830
18878
|
function readOptionalManagedRoleField(input, field) {
|
|
18831
|
-
const value = readOptionalStringField
|
|
18879
|
+
const value = readOptionalStringField(input, field);
|
|
18832
18880
|
if (!value) return null;
|
|
18833
18881
|
const parsed = authProfileManagedRoleSchema.safeParse(value);
|
|
18834
18882
|
if (parsed.success) return parsed.data;
|
|
@@ -18836,21 +18884,21 @@ function readOptionalManagedRoleField(input, field) {
|
|
|
18836
18884
|
}
|
|
18837
18885
|
function readRecordField(input, field) {
|
|
18838
18886
|
const value = input[field];
|
|
18839
|
-
if (isRecord$
|
|
18887
|
+
if (isRecord$5(value)) return value;
|
|
18840
18888
|
throw new Error(`invalid api payload: missing ${field}`);
|
|
18841
18889
|
}
|
|
18842
18890
|
function readArrayField(input, field) {
|
|
18843
18891
|
const value = input[field];
|
|
18844
18892
|
if (!Array.isArray(value)) throw new Error(`invalid api payload: missing ${field}`);
|
|
18845
|
-
return value.filter(isRecord$
|
|
18893
|
+
return value.filter(isRecord$5);
|
|
18846
18894
|
}
|
|
18847
18895
|
function readRequiredStringField(input, field) {
|
|
18848
|
-
const value = normalizeOptionalString$
|
|
18896
|
+
const value = normalizeOptionalString$15(input[field]);
|
|
18849
18897
|
if (!value) throw new Error(`invalid profile payload: missing ${field}`);
|
|
18850
18898
|
return value;
|
|
18851
18899
|
}
|
|
18852
|
-
function readOptionalStringField
|
|
18853
|
-
return normalizeOptionalString$
|
|
18900
|
+
function readOptionalStringField(input, field) {
|
|
18901
|
+
return normalizeOptionalString$15(input[field]);
|
|
18854
18902
|
}
|
|
18855
18903
|
function readBooleanField(input, field) {
|
|
18856
18904
|
return input[field] === true;
|
|
@@ -18860,7 +18908,7 @@ function readOptionalBooleanField(input, field) {
|
|
|
18860
18908
|
if (typeof value === "boolean") return value;
|
|
18861
18909
|
return null;
|
|
18862
18910
|
}
|
|
18863
|
-
function normalizeOptionalString$
|
|
18911
|
+
function normalizeOptionalString$15(value) {
|
|
18864
18912
|
const normalized = String(value ?? "").trim();
|
|
18865
18913
|
return normalized.length > 0 ? normalized : null;
|
|
18866
18914
|
}
|
|
@@ -18868,14 +18916,14 @@ function normalizeTokenType(tokenType) {
|
|
|
18868
18916
|
const normalized = tokenType.trim();
|
|
18869
18917
|
return normalized.length > 0 ? normalized : "Bearer";
|
|
18870
18918
|
}
|
|
18871
|
-
function toAuthEndpoint$
|
|
18919
|
+
function toAuthEndpoint$4(baseUrl, pathname) {
|
|
18872
18920
|
const url = new URL(baseUrl);
|
|
18873
18921
|
url.pathname = pathname;
|
|
18874
18922
|
url.search = "";
|
|
18875
18923
|
url.hash = "";
|
|
18876
18924
|
return url.toString();
|
|
18877
18925
|
}
|
|
18878
|
-
async function parseResponseJson$
|
|
18926
|
+
async function parseResponseJson$3(response) {
|
|
18879
18927
|
const raw = await response.text();
|
|
18880
18928
|
if (!raw) return null;
|
|
18881
18929
|
try {
|
|
@@ -18885,8 +18933,8 @@ async function parseResponseJson$1(response) {
|
|
|
18885
18933
|
}
|
|
18886
18934
|
}
|
|
18887
18935
|
function extractApiErrorMessage$1(payload, status) {
|
|
18888
|
-
const record = isRecord$
|
|
18889
|
-
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);
|
|
18890
18938
|
if (message) return message;
|
|
18891
18939
|
return `request failed with status ${status}`;
|
|
18892
18940
|
}
|
|
@@ -18923,7 +18971,7 @@ function isHostedProfilesEndpoint(endpoint) {
|
|
|
18923
18971
|
const url = parseUrlOrNull$1(endpoint);
|
|
18924
18972
|
return Boolean(url && !isLoopbackHostname$2(url.hostname) && url.pathname.startsWith("/v1/profiles"));
|
|
18925
18973
|
}
|
|
18926
|
-
function isRecord$
|
|
18974
|
+
function isRecord$5(value) {
|
|
18927
18975
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
18928
18976
|
}
|
|
18929
18977
|
//#endregion
|
|
@@ -18940,7 +18988,7 @@ function isSelectedOpenMeldProfileRequiredError(error) {
|
|
|
18940
18988
|
return error.message.startsWith(PROFILE_REQUIRED_ERROR_PREFIX) && error.message.endsWith(PROFILE_REQUIRED_ERROR_SUFFIX);
|
|
18941
18989
|
}
|
|
18942
18990
|
async function resolveOpenMeldProfileOrNull(input = {}) {
|
|
18943
|
-
const explicitOpenMeldProfileId = normalizeOptionalString$
|
|
18991
|
+
const explicitOpenMeldProfileId = normalizeOptionalString$14(input.openMeldProfileId);
|
|
18944
18992
|
if (explicitOpenMeldProfileId) return await resolveExplicitOpenMeldProfile(explicitOpenMeldProfileId, {
|
|
18945
18993
|
profileKind: input.profileKind,
|
|
18946
18994
|
allowUnauthenticated: input.allowUnauthenticated === true,
|
|
@@ -19013,7 +19061,7 @@ async function resolveSelectedOpenMeldProfile(selectedOpenMeldProfileId, input)
|
|
|
19013
19061
|
throw error;
|
|
19014
19062
|
}
|
|
19015
19063
|
}
|
|
19016
|
-
function normalizeOptionalString$
|
|
19064
|
+
function normalizeOptionalString$14(value) {
|
|
19017
19065
|
const normalized = String(value ?? "").trim();
|
|
19018
19066
|
return normalized.length > 0 ? normalized : null;
|
|
19019
19067
|
}
|
|
@@ -19027,13 +19075,13 @@ function isProfileMissingError(error) {
|
|
|
19027
19075
|
//#endregion
|
|
19028
19076
|
//#region src/config/view-profile-key.ts
|
|
19029
19077
|
async function resolveViewProfileKey(inputProfile) {
|
|
19030
|
-
const explicit = normalizeOptionalString$
|
|
19078
|
+
const explicit = normalizeOptionalString$13(inputProfile);
|
|
19031
19079
|
if (explicit) return (await resolveOpenMeldProfileByIdOrName({ profileIdentifier: explicit }).catch(() => null))?.openMeldProfileId ?? explicit;
|
|
19032
19080
|
const selected = await getSelectedOpenMeldProfileId();
|
|
19033
19081
|
if (selected) return selected;
|
|
19034
19082
|
return null;
|
|
19035
19083
|
}
|
|
19036
|
-
function normalizeOptionalString$
|
|
19084
|
+
function normalizeOptionalString$13(value) {
|
|
19037
19085
|
const normalized = String(value ?? "").trim();
|
|
19038
19086
|
return normalized.length > 0 ? normalized : null;
|
|
19039
19087
|
}
|
|
@@ -19470,7 +19518,7 @@ function splitSentences(message) {
|
|
|
19470
19518
|
var package_default = {
|
|
19471
19519
|
$schema: "https://www.schemastore.org/package.json",
|
|
19472
19520
|
name: "openmeld",
|
|
19473
|
-
version: "0.3.
|
|
19521
|
+
version: "0.3.127",
|
|
19474
19522
|
openMeldReleaseDate: "2026-08-28",
|
|
19475
19523
|
description: "OpenMeld CLI - https://openmeld.ai",
|
|
19476
19524
|
license: "MIT",
|
|
@@ -19670,7 +19718,7 @@ function warnDaemonEvent(eventName, fields) {
|
|
|
19670
19718
|
const definedFields = Object.fromEntries(Object.entries(fields).filter((entry) => entry[1] !== void 0));
|
|
19671
19719
|
console.warn(`${nowIsoString()} ${eventName} ${JSON.stringify(definedFields)}`);
|
|
19672
19720
|
}
|
|
19673
|
-
const toErrorMessage$
|
|
19721
|
+
const toErrorMessage$32 = toErrorMessage$43;
|
|
19674
19722
|
function dirnamePath(path) {
|
|
19675
19723
|
const lastSlash = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
|
19676
19724
|
if (lastSlash <= 0) return ".";
|
|
@@ -19696,7 +19744,7 @@ var DaemonServiceRunError = class extends Error {
|
|
|
19696
19744
|
//#region src/local-service/state/runtime-contract-guard.ts
|
|
19697
19745
|
const RUNTIME_CONTRACT_META_SCHEMA = "daemon.runtime.contract.meta";
|
|
19698
19746
|
const RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA = "daemon.runtime.contract.repair.report";
|
|
19699
|
-
const isRecord$
|
|
19747
|
+
const isRecord$4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19700
19748
|
const createRuntimeContractMeta = (input) => ({
|
|
19701
19749
|
schema: RUNTIME_CONTRACT_META_SCHEMA,
|
|
19702
19750
|
v: 1,
|
|
@@ -19716,7 +19764,7 @@ const createRuntimeContractRepairReport = (input) => ({
|
|
|
19716
19764
|
errorMessage: input.errorMessage
|
|
19717
19765
|
});
|
|
19718
19766
|
const parseRuntimeContractMeta = (value) => {
|
|
19719
|
-
if (!isRecord$
|
|
19767
|
+
if (!isRecord$4(value)) return null;
|
|
19720
19768
|
if (value.schema !== RUNTIME_CONTRACT_META_SCHEMA || value.v !== 1) return null;
|
|
19721
19769
|
const contractEpoch = normalizeOptionalText$46(value.contractEpoch);
|
|
19722
19770
|
const updatedAt = normalizeOptionalText$46(value.updatedAt);
|
|
@@ -19729,7 +19777,7 @@ const parseRuntimeContractMeta = (value) => {
|
|
|
19729
19777
|
};
|
|
19730
19778
|
};
|
|
19731
19779
|
const parseRuntimeContractRepairReport = (value) => {
|
|
19732
|
-
if (!isRecord$
|
|
19780
|
+
if (!isRecord$4(value)) return null;
|
|
19733
19781
|
if (value.schema !== RUNTIME_CONTRACT_REPAIR_REPORT_SCHEMA || value.v !== 1) return null;
|
|
19734
19782
|
const status = value.status;
|
|
19735
19783
|
const reason = value.reason;
|
|
@@ -19875,7 +19923,7 @@ const backupAndCleanRuntimeState = async (input) => {
|
|
|
19875
19923
|
appliedAt: input.nowIso,
|
|
19876
19924
|
backupPaths,
|
|
19877
19925
|
cleanedPaths,
|
|
19878
|
-
errorMessage: toErrorMessage$
|
|
19926
|
+
errorMessage: toErrorMessage$32(error),
|
|
19879
19927
|
fromEpoch: input.fromEpoch,
|
|
19880
19928
|
reason: input.reason,
|
|
19881
19929
|
status: "failed",
|
|
@@ -19965,7 +20013,7 @@ async function resolveDaemonRuntimeContractCompatibility(input) {
|
|
|
19965
20013
|
observedEpoch: null,
|
|
19966
20014
|
updatedAt: null,
|
|
19967
20015
|
reasonCode: "daemon.runtime_contract.unavailable",
|
|
19968
|
-
errorMessage: toErrorMessage$
|
|
20016
|
+
errorMessage: toErrorMessage$32(error)
|
|
19969
20017
|
};
|
|
19970
20018
|
}
|
|
19971
20019
|
if (!meta) return {
|
|
@@ -20188,7 +20236,7 @@ async function requestLatestPackageInfo(packageName) {
|
|
|
20188
20236
|
minRequiredCliVersion: readMinRequiredCliVersion(parsed.openmeld)
|
|
20189
20237
|
};
|
|
20190
20238
|
} catch (error) {
|
|
20191
|
-
throw new Error(`version check failed: invalid registry response: ${toErrorMessage$
|
|
20239
|
+
throw new Error(`version check failed: invalid registry response: ${toErrorMessage$31(error)}`);
|
|
20192
20240
|
}
|
|
20193
20241
|
}
|
|
20194
20242
|
const CLI_BINARY_MANIFEST_URL = toNonEmptyString(process$1.env.OPENMELD_CLI_BINARY_MANIFEST_URL) ?? "https://openmeld.ai/cli/manifest.json";
|
|
@@ -20209,7 +20257,7 @@ async function requestCliBinaryManifest() {
|
|
|
20209
20257
|
try {
|
|
20210
20258
|
return parseCliBinaryManifest(raw);
|
|
20211
20259
|
} catch (error) {
|
|
20212
|
-
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)}`);
|
|
20213
20261
|
}
|
|
20214
20262
|
}
|
|
20215
20263
|
function parseCliBinaryManifest(raw) {
|
|
@@ -20295,7 +20343,7 @@ function toNonEmptyString(value) {
|
|
|
20295
20343
|
const normalized = value.trim();
|
|
20296
20344
|
return normalized.length > 0 ? normalized : null;
|
|
20297
20345
|
}
|
|
20298
|
-
function toErrorMessage$
|
|
20346
|
+
function toErrorMessage$31(error) {
|
|
20299
20347
|
if (error instanceof Error) return error.message;
|
|
20300
20348
|
return String(error);
|
|
20301
20349
|
}
|
|
@@ -25487,10 +25535,17 @@ async function runCursorAcpTurn(input) {
|
|
|
25487
25535
|
session: input.session
|
|
25488
25536
|
});
|
|
25489
25537
|
const unregisterActiveTurn = input.input.onActiveTurn?.({
|
|
25538
|
+
agentControllerPermissionMode: resolveCursorPermissionMode(input.input.agentControllerPermissionMode),
|
|
25490
25539
|
cancel: () => {
|
|
25491
25540
|
input.session.notify("session/cancel", { sessionId: descriptor.sessionId });
|
|
25492
25541
|
return Promise.resolve();
|
|
25493
25542
|
},
|
|
25543
|
+
setPermissionMode: async (permissionMode) => {
|
|
25544
|
+
await input.session.request("session/set_mode", {
|
|
25545
|
+
modeId: resolveCursorAcpMode(permissionMode),
|
|
25546
|
+
sessionId: descriptor.sessionId
|
|
25547
|
+
});
|
|
25548
|
+
},
|
|
25494
25549
|
sessionId: descriptor.sessionId,
|
|
25495
25550
|
taskId: input.input.taskId
|
|
25496
25551
|
});
|
|
@@ -26023,7 +26078,7 @@ function toCursorAcpTransportError(error, stderr, diagnostics) {
|
|
|
26023
26078
|
errorType: error.errorType,
|
|
26024
26079
|
message: error.message
|
|
26025
26080
|
});
|
|
26026
|
-
const classified = classifyCursorFailure([toErrorMessage$
|
|
26081
|
+
const classified = classifyCursorFailure([toErrorMessage$30(error), normalizeOptionalText$42(stderr)].filter((value) => value !== null).join("\n"));
|
|
26027
26082
|
return diagnostics ? new CursorAcpTransportError({
|
|
26028
26083
|
code: classified.code,
|
|
26029
26084
|
diagnostics,
|
|
@@ -26070,7 +26125,7 @@ function normalizeOptionalText$42(value) {
|
|
|
26070
26125
|
function toRecord$4(value) {
|
|
26071
26126
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
26072
26127
|
}
|
|
26073
|
-
function toErrorMessage$
|
|
26128
|
+
function toErrorMessage$30(error) {
|
|
26074
26129
|
return error instanceof Error ? error.message : String(error);
|
|
26075
26130
|
}
|
|
26076
26131
|
//#endregion
|
|
@@ -26080,7 +26135,9 @@ function createCursorAdapter(options) {
|
|
|
26080
26135
|
const activeTurns = /* @__PURE__ */ new Map();
|
|
26081
26136
|
const registerActiveTurn = (registration) => {
|
|
26082
26137
|
const turn = {
|
|
26138
|
+
agentControllerPermissionMode: registration.agentControllerPermissionMode,
|
|
26083
26139
|
cancel: registration.cancel,
|
|
26140
|
+
setPermissionMode: registration.setPermissionMode,
|
|
26084
26141
|
sessionId: registration.sessionId
|
|
26085
26142
|
};
|
|
26086
26143
|
activeTurns.set(registration.taskId, turn);
|
|
@@ -26112,9 +26169,41 @@ function createCursorAdapter(options) {
|
|
|
26112
26169
|
interrupt: (request) => interruptActiveCursorTurn({
|
|
26113
26170
|
activeTurns,
|
|
26114
26171
|
request
|
|
26172
|
+
}),
|
|
26173
|
+
updatePermissionMode: (request) => updateCursorActivePermissionMode({
|
|
26174
|
+
activeTurns,
|
|
26175
|
+
request
|
|
26115
26176
|
})
|
|
26116
26177
|
};
|
|
26117
26178
|
}
|
|
26179
|
+
async function updateCursorActivePermissionMode(input) {
|
|
26180
|
+
if (!input.request.agentControllerPermissionMode.startsWith("cursor:")) return {
|
|
26181
|
+
reasonCode: "adapter.permission_mode_incompatible",
|
|
26182
|
+
status: "not_applied",
|
|
26183
|
+
taskId: input.request.taskId
|
|
26184
|
+
};
|
|
26185
|
+
const activeTurn = input.activeTurns.get(input.request.taskId);
|
|
26186
|
+
if (!activeTurn) return {
|
|
26187
|
+
reasonCode: "adapter.task_not_active",
|
|
26188
|
+
status: "not_applied",
|
|
26189
|
+
taskId: input.request.taskId
|
|
26190
|
+
};
|
|
26191
|
+
if (!(isCursorAcpSessionPermissionMode(activeTurn.agentControllerPermissionMode) && isCursorAcpSessionPermissionMode(input.request.agentControllerPermissionMode))) return {
|
|
26192
|
+
reasonCode: "adapter.permission_mode_update_unsupported",
|
|
26193
|
+
status: "not_applied",
|
|
26194
|
+
taskId: input.request.taskId
|
|
26195
|
+
};
|
|
26196
|
+
await activeTurn.setPermissionMode(input.request.agentControllerPermissionMode);
|
|
26197
|
+
activeTurn.agentControllerPermissionMode = input.request.agentControllerPermissionMode;
|
|
26198
|
+
return {
|
|
26199
|
+
effectiveFrom: "subsequent_tool_requests",
|
|
26200
|
+
status: "applied",
|
|
26201
|
+
taskId: input.request.taskId
|
|
26202
|
+
};
|
|
26203
|
+
}
|
|
26204
|
+
function isCursorAcpSessionPermissionMode(permissionMode) {
|
|
26205
|
+
return permissionMode === "cursor:ask" || permissionMode === "cursor:default" || permissionMode === "cursor:plan";
|
|
26206
|
+
}
|
|
26118
26207
|
function createDefaultCursorInvoke(input) {
|
|
26119
26208
|
const cursorTimeoutMs = input.options.cursorTimeoutMs ?? resolveCursorTimeoutMs();
|
|
26120
26209
|
return async (dispatchInput) => {
|
|
@@ -26137,7 +26226,7 @@ function createDefaultCursorInvoke(input) {
|
|
|
26137
26226
|
code: "context.rebuild_failed",
|
|
26138
26227
|
...error instanceof CursorAcpTransportError && error.diagnostics ? { diagnostics: error.diagnostics } : {},
|
|
26139
26228
|
errorType: "adapter",
|
|
26140
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
26229
|
+
message: `context.rebuild_failed: ${toErrorMessage$29(error)}`
|
|
26141
26230
|
}),
|
|
26142
26231
|
invokeOnce: async (sessionId) => {
|
|
26143
26232
|
const transportResult = await invokeCursorAcpTransport({
|
|
@@ -26216,7 +26305,7 @@ async function cancelActiveCursorTurn(input) {
|
|
|
26216
26305
|
return {
|
|
26217
26306
|
accepted: false,
|
|
26218
26307
|
reasonCode: "signal.send_failed",
|
|
26219
|
-
reasonDetail: toErrorMessage$
|
|
26308
|
+
reasonDetail: toErrorMessage$29(error),
|
|
26220
26309
|
signalDelivery: "not_sent",
|
|
26221
26310
|
taskId: input.request.taskId
|
|
26222
26311
|
};
|
|
@@ -26250,7 +26339,7 @@ async function interruptActiveCursorTurn(input) {
|
|
|
26250
26339
|
accepted: false,
|
|
26251
26340
|
plan,
|
|
26252
26341
|
reasonCode: "signal.send_failed",
|
|
26253
|
-
reasonDetail: toErrorMessage$
|
|
26342
|
+
reasonDetail: toErrorMessage$29(error),
|
|
26254
26343
|
signalDelivery: "not_sent",
|
|
26255
26344
|
taskId: input.request.taskId
|
|
26256
26345
|
};
|
|
@@ -26260,7 +26349,7 @@ function normalizeOptionalText$41(value) {
|
|
|
26260
26349
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
26261
26350
|
return normalized.length > 0 ? normalized : null;
|
|
26262
26351
|
}
|
|
26263
|
-
function toErrorMessage$
|
|
26352
|
+
function toErrorMessage$29(error) {
|
|
26264
26353
|
return error instanceof Error ? error.message : String(error);
|
|
26265
26354
|
}
|
|
26266
26355
|
//#endregion
|
|
@@ -26928,7 +27017,7 @@ async function invokeOpenClawWithSingleContextHeal(input) {
|
|
|
26928
27017
|
createRebuildFailedError: (error) => new OpenClawRuntimeError({
|
|
26929
27018
|
code: "context.rebuild_failed",
|
|
26930
27019
|
errorType: "adapter",
|
|
26931
|
-
message: `context.rebuild_failed: ${toErrorMessage$
|
|
27020
|
+
message: `context.rebuild_failed: ${toErrorMessage$28(error)}`
|
|
26932
27021
|
}),
|
|
26933
27022
|
invokeOnce: (sessionId) => invokeOpenClawOnce({
|
|
26934
27023
|
openClawAgentId: input.openClawAgentId,
|
|
@@ -26979,11 +27068,11 @@ async function invokeOpenClawOnce(input) {
|
|
|
26979
27068
|
throw new OpenClawRuntimeError({
|
|
26980
27069
|
code: "upstream_unreachable",
|
|
26981
27070
|
errorType: "adapter",
|
|
26982
|
-
message: `upstream_unreachable: ${toErrorMessage$
|
|
27071
|
+
message: `upstream_unreachable: ${toErrorMessage$28(error)}`
|
|
26983
27072
|
});
|
|
26984
27073
|
}
|
|
26985
27074
|
}
|
|
26986
|
-
function toErrorMessage$
|
|
27075
|
+
function toErrorMessage$28(error) {
|
|
26987
27076
|
if (error instanceof Error) return error.message;
|
|
26988
27077
|
return String(error);
|
|
26989
27078
|
}
|
|
@@ -27275,7 +27364,7 @@ function toOpenClawGatewayTransportError(error) {
|
|
|
27275
27364
|
});
|
|
27276
27365
|
const stderr = normalizeOptionalText$35(error?.stderr);
|
|
27277
27366
|
const stdout = normalizeOptionalText$35(error?.stdout);
|
|
27278
|
-
return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$
|
|
27367
|
+
return classifyGatewayFailure(stderr ?? stdout ?? toErrorMessage$27(error));
|
|
27279
27368
|
}
|
|
27280
27369
|
function classifyGatewayFailure(message) {
|
|
27281
27370
|
return new OpenClawGatewayTransportError(classifyOpenClawFailureMessage({ message }));
|
|
@@ -27284,7 +27373,7 @@ function normalizeOptionalText$35(value) {
|
|
|
27284
27373
|
const normalized = String(value ?? "").trim();
|
|
27285
27374
|
return normalized.length > 0 ? normalized : null;
|
|
27286
27375
|
}
|
|
27287
|
-
function toErrorMessage$
|
|
27376
|
+
function toErrorMessage$27(error) {
|
|
27288
27377
|
return error instanceof Error ? error.message : String(error);
|
|
27289
27378
|
}
|
|
27290
27379
|
//#endregion
|
|
@@ -28940,14 +29029,14 @@ const createAuthorityOpenMeldServiceRuntimeId = (input) => {
|
|
|
28940
29029
|
source: RUNTIME_REGISTRY_AUTHORITY_SOURCE
|
|
28941
29030
|
};
|
|
28942
29031
|
};
|
|
28943
|
-
const normalizeOptionalString$
|
|
29032
|
+
const normalizeOptionalString$12 = (value) => {
|
|
28944
29033
|
const normalized = String(value ?? "").trim();
|
|
28945
29034
|
return normalized.length > 0 ? normalized : void 0;
|
|
28946
29035
|
};
|
|
28947
29036
|
const createAgentProfileBindingModelSelection = (input) => {
|
|
28948
|
-
const modelId = normalizeOptionalString$
|
|
29037
|
+
const modelId = normalizeOptionalString$12(input?.modelId);
|
|
28949
29038
|
if (!modelId) return;
|
|
28950
|
-
const reasoningLevel = normalizeOptionalString$
|
|
29039
|
+
const reasoningLevel = normalizeOptionalString$12(input?.reasoningLevel);
|
|
28951
29040
|
return {
|
|
28952
29041
|
modelId,
|
|
28953
29042
|
...reasoningLevel ? { reasoningLevel } : {}
|
|
@@ -31198,7 +31287,7 @@ const INFLIGHT_RETENTION_MS = DEDUPE_RETENTION_MS;
|
|
|
31198
31287
|
const AGENT_CONTEXT_RETENTION_MS = 720 * 60 * 60 * 1e3;
|
|
31199
31288
|
const AGENT_CONTEXT_MAX_ENTRIES = 2e3;
|
|
31200
31289
|
const AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR = "|";
|
|
31201
|
-
const isRecord$
|
|
31290
|
+
const isRecord$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31202
31291
|
const isPositiveInteger = (value) => Number.isInteger(value) && typeof value === "number" && value >= 0;
|
|
31203
31292
|
const isRuntimeTransportMode = (value) => runtimeTransportModeSchema.safeParse(value).success;
|
|
31204
31293
|
const utf8ByteLength = (value) => {
|
|
@@ -31222,7 +31311,7 @@ const utf8ByteLength = (value) => {
|
|
|
31222
31311
|
return byteLength;
|
|
31223
31312
|
};
|
|
31224
31313
|
const toErrorCode = (error) => {
|
|
31225
|
-
if (!isRecord$
|
|
31314
|
+
if (!isRecord$3(error)) return null;
|
|
31226
31315
|
const code = error.code;
|
|
31227
31316
|
if (typeof code !== "string") return null;
|
|
31228
31317
|
return code;
|
|
@@ -31242,7 +31331,7 @@ const buildLegacySpaceScopedAgentContextLookupKey = (input) => [
|
|
|
31242
31331
|
input.runtimeWorkspaceFingerprint
|
|
31243
31332
|
].map(encodeAgentContextLookupKeyPart).join(AGENT_CONTEXT_LOOKUP_KEY_SEPARATOR);
|
|
31244
31333
|
const parseInflightTask = (value) => {
|
|
31245
|
-
if (!isRecord$
|
|
31334
|
+
if (!isRecord$3(value)) return null;
|
|
31246
31335
|
const { bindingKey, firstSeenAtMs, idempotencyKey, output, sequence, taskId } = value;
|
|
31247
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;
|
|
31248
31337
|
if (output !== void 0 && (typeof output !== "string" || output.length === 0)) return null;
|
|
@@ -31256,7 +31345,7 @@ const parseInflightTask = (value) => {
|
|
|
31256
31345
|
};
|
|
31257
31346
|
};
|
|
31258
31347
|
const parseAgentContextState = (agentContextLookupKey, value) => {
|
|
31259
|
-
if (!isRecord$
|
|
31348
|
+
if (!isRecord$3(value)) return null;
|
|
31260
31349
|
const { agentControllerConversationId, agentControllerRef, createdAtMs, lastTaskId, spaceId, targetProfileId, transportMode, runtimeWorkspaceFingerprint, updatedAtMs } = value;
|
|
31261
31350
|
const parsedAgentControllerRef = typeof agentControllerRef === "string" ? parseAgentControllerRef$1(agentControllerRef) : null;
|
|
31262
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;
|
|
@@ -31288,7 +31377,7 @@ const parseAgentContextState = (agentContextLookupKey, value) => {
|
|
|
31288
31377
|
};
|
|
31289
31378
|
};
|
|
31290
31379
|
const parseAgentContextLifecycleCounters = (value) => {
|
|
31291
|
-
if (!isRecord$
|
|
31380
|
+
if (!isRecord$3(value)) return null;
|
|
31292
31381
|
const { created, guardBlocked, recreated, reused } = value;
|
|
31293
31382
|
if (!(isPositiveInteger(created) && isPositiveInteger(recreated) && isPositiveInteger(reused) && isPositiveInteger(guardBlocked))) return null;
|
|
31294
31383
|
return {
|
|
@@ -31305,7 +31394,7 @@ const createEmptyAgentContextLifecycleCounters = () => ({
|
|
|
31305
31394
|
reused: 0
|
|
31306
31395
|
});
|
|
31307
31396
|
const parseAgentContextRotationRecord = (value) => {
|
|
31308
|
-
if (!isRecord$
|
|
31397
|
+
if (!isRecord$3(value)) return null;
|
|
31309
31398
|
const { nextAgentControllerConversationId, previousAgentControllerConversationId, rotationAt, rotationReason, rotationTaskId, rotationTriggerErrorCode } = value;
|
|
31310
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;
|
|
31311
31400
|
return {
|
|
@@ -31329,7 +31418,7 @@ const parseAgentContextRotationsOrDefault = (value) => {
|
|
|
31329
31418
|
return nextRecords;
|
|
31330
31419
|
};
|
|
31331
31420
|
const parseDedupeFirstSeenByKey = (value) => {
|
|
31332
|
-
if (!isRecord$
|
|
31421
|
+
if (!isRecord$3(value)) return null;
|
|
31333
31422
|
const nextDedupeFirstSeenByKey = {};
|
|
31334
31423
|
for (const [key, firstSeenAtMs] of Object.entries(value)) {
|
|
31335
31424
|
if (!isPositiveInteger(firstSeenAtMs)) return null;
|
|
@@ -31338,7 +31427,7 @@ const parseDedupeFirstSeenByKey = (value) => {
|
|
|
31338
31427
|
return nextDedupeFirstSeenByKey;
|
|
31339
31428
|
};
|
|
31340
31429
|
const parseInflightByTaskId = (value) => {
|
|
31341
|
-
if (!isRecord$
|
|
31430
|
+
if (!isRecord$3(value)) return null;
|
|
31342
31431
|
const nextInflightByTaskId = {};
|
|
31343
31432
|
for (const [taskId, inflightTask] of Object.entries(value)) {
|
|
31344
31433
|
const parsedTask = parseInflightTask(inflightTask);
|
|
@@ -31348,7 +31437,7 @@ const parseInflightByTaskId = (value) => {
|
|
|
31348
31437
|
return nextInflightByTaskId;
|
|
31349
31438
|
};
|
|
31350
31439
|
const parseReplayedTaskIds = (value) => {
|
|
31351
|
-
if (!isRecord$
|
|
31440
|
+
if (!isRecord$3(value)) return null;
|
|
31352
31441
|
const nextReplayedTaskIds = {};
|
|
31353
31442
|
for (const [taskId, replayed] of Object.entries(value)) {
|
|
31354
31443
|
if (replayed !== true) return null;
|
|
@@ -31357,7 +31446,7 @@ const parseReplayedTaskIds = (value) => {
|
|
|
31357
31446
|
return nextReplayedTaskIds;
|
|
31358
31447
|
};
|
|
31359
31448
|
const parseAgentContextByLookupKey = (value) => {
|
|
31360
|
-
if (!isRecord$
|
|
31449
|
+
if (!isRecord$3(value)) return null;
|
|
31361
31450
|
const nextAgentContextByLookupKey = {};
|
|
31362
31451
|
for (const [agentContextLookupKey, rawAgentContextState] of Object.entries(value)) {
|
|
31363
31452
|
const parsedAgentContextState = parseAgentContextState(agentContextLookupKey, rawAgentContextState);
|
|
@@ -31369,7 +31458,7 @@ const parseAgentContextByLookupKey = (value) => {
|
|
|
31369
31458
|
const parseAgentContextLifecycleCountersOrDefault = (value) => parseAgentContextLifecycleCounters(value);
|
|
31370
31459
|
const parseBootstrapExecutionByLookupKey = (value) => {
|
|
31371
31460
|
if (value === void 0) return {};
|
|
31372
|
-
if (!isRecord$
|
|
31461
|
+
if (!isRecord$3(value)) return null;
|
|
31373
31462
|
const nextBootstrapExecutionByLookupKey = {};
|
|
31374
31463
|
for (const [agentContextLookupKey, executionState] of Object.entries(value)) {
|
|
31375
31464
|
const parsedExecutionState = conversationExecutionStateSchema.safeParse(executionState);
|
|
@@ -31380,7 +31469,7 @@ const parseBootstrapExecutionByLookupKey = (value) => {
|
|
|
31380
31469
|
return nextBootstrapExecutionByLookupKey;
|
|
31381
31470
|
};
|
|
31382
31471
|
const parseLedgerStateV1 = (value) => {
|
|
31383
|
-
if (!isRecord$
|
|
31472
|
+
if (!isRecord$3(value)) return null;
|
|
31384
31473
|
const { agentContextRotations, dedupeFirstSeenByKey, inflightByTaskId, replayedTaskIds, agentContextByLookupKey, bootstrapExecutionByLookupKey, agentContextLifecycleCounters, updatedAtMs, v } = value;
|
|
31385
31474
|
if (v !== 1 || !isPositiveInteger(updatedAtMs)) return null;
|
|
31386
31475
|
const nextDedupeFirstSeenByKey = parseDedupeFirstSeenByKey(dedupeFirstSeenByKey);
|
|
@@ -32823,10 +32912,12 @@ function createInflightTaskControlRegistry() {
|
|
|
32823
32912
|
if (existing && existing.dispatchId !== input.dispatchId && taskIdByDispatchId.get(existing.dispatchId) === existing.taskId) taskIdByDispatchId.delete(existing.dispatchId);
|
|
32824
32913
|
const record = {
|
|
32825
32914
|
adapterId: input.adapterId,
|
|
32915
|
+
agentControllerPermissionMode: input.agentControllerPermissionMode ?? existing?.agentControllerPermissionMode ?? null,
|
|
32826
32916
|
dispatchId: input.dispatchId,
|
|
32827
32917
|
processId: existing?.processId ?? null,
|
|
32828
32918
|
runtimeCoordinatorExecutionId: input.runtimeCoordinatorExecutionId ?? null,
|
|
32829
32919
|
signalTarget: existing?.signalTarget ?? null,
|
|
32920
|
+
targetProfileId: input.targetProfileId ?? existing?.targetProfileId ?? null,
|
|
32830
32921
|
taskId: input.taskId,
|
|
32831
32922
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
32832
32923
|
};
|
|
@@ -32834,6 +32925,17 @@ function createInflightTaskControlRegistry() {
|
|
|
32834
32925
|
taskIdByDispatchId.set(input.dispatchId, input.taskId);
|
|
32835
32926
|
return record;
|
|
32836
32927
|
},
|
|
32928
|
+
updateTaskPermissionMode(input) {
|
|
32929
|
+
const existing = readRecord(input.taskId);
|
|
32930
|
+
if (!existing) return null;
|
|
32931
|
+
const updated = {
|
|
32932
|
+
...existing,
|
|
32933
|
+
agentControllerPermissionMode: input.agentControllerPermissionMode,
|
|
32934
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
32935
|
+
};
|
|
32936
|
+
recordByTaskId.set(input.taskId, updated);
|
|
32937
|
+
return updated;
|
|
32938
|
+
},
|
|
32837
32939
|
updateTaskProcess(input) {
|
|
32838
32940
|
const existing = readRecord(input.taskId);
|
|
32839
32941
|
if (!existing) return null;
|
|
@@ -33003,7 +33105,7 @@ function createLocalExecutionSlots(input) {
|
|
|
33003
33105
|
}),
|
|
33004
33106
|
durationMs: Math.max(0, Date.now() - startedAtMs),
|
|
33005
33107
|
errorCode: null,
|
|
33006
|
-
errorMessage: toErrorMessage$
|
|
33108
|
+
errorMessage: toErrorMessage$26(error),
|
|
33007
33109
|
result: "failed"
|
|
33008
33110
|
});
|
|
33009
33111
|
}).finally(() => {
|
|
@@ -33118,7 +33220,7 @@ function createLocalExecutionSlots(input) {
|
|
|
33118
33220
|
function buildAttemptKey(dispatchId, attemptId) {
|
|
33119
33221
|
return `${dispatchId}::${attemptId}`;
|
|
33120
33222
|
}
|
|
33121
|
-
function toErrorMessage$
|
|
33223
|
+
function toErrorMessage$26(error) {
|
|
33122
33224
|
if (error instanceof Error && error.message.trim().length > 0) return error.message;
|
|
33123
33225
|
if (typeof error === "string" && error.trim().length > 0) return error;
|
|
33124
33226
|
return "unknown error";
|
|
@@ -37510,7 +37612,7 @@ async function syncDeviceRuntimeStateProjection(input) {
|
|
|
37510
37612
|
});
|
|
37511
37613
|
const registeredCustomTargetIds = await loadRegisteredCustomTargetIds();
|
|
37512
37614
|
const targetStates = await listAgentTargetStates().catch((error) => {
|
|
37513
|
-
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)}`);
|
|
37514
37616
|
});
|
|
37515
37617
|
const targetStateById = new Map(targetStates.map((state) => [state.agentId, state]));
|
|
37516
37618
|
const projectedControllerIds = [...projectedControllers.keys()].sort();
|
|
@@ -37586,7 +37688,7 @@ async function loadProjectedControllers(input) {
|
|
|
37586
37688
|
const expectedRoutesResult = await (input.expectedRoutesRead ?? createExpectedRoutesReadSession()).read();
|
|
37587
37689
|
if (expectedRoutesResult.status === "resolved") return collectProjectedControllersFromExpectedRoutes(expectedRoutesResult.response.expectedRoutes);
|
|
37588
37690
|
const profiles = await listOpenMeldProfiles().catch((error) => {
|
|
37589
|
-
throw new Error(`failed to list OpenMeld profiles: ${toErrorMessage$
|
|
37691
|
+
throw new Error(`failed to list OpenMeld profiles: ${toErrorMessage$25(error)}`);
|
|
37590
37692
|
});
|
|
37591
37693
|
return await collectProjectedControllers({
|
|
37592
37694
|
bindingReads: input.bindingReads,
|
|
@@ -37607,7 +37709,7 @@ function collectProjectedControllersFromExpectedRoutes(expectedRoutes) {
|
|
|
37607
37709
|
}
|
|
37608
37710
|
async function loadRegisteredCustomTargetIds() {
|
|
37609
37711
|
const customTargets = await listAgentCustomTargets().catch((error) => {
|
|
37610
|
-
throw new Error(`failed to list OpenMeld custom targets: ${toErrorMessage$
|
|
37712
|
+
throw new Error(`failed to list OpenMeld custom targets: ${toErrorMessage$25(error)}`);
|
|
37611
37713
|
});
|
|
37612
37714
|
return new Set(customTargets.map((target) => target.id));
|
|
37613
37715
|
}
|
|
@@ -37885,7 +37987,7 @@ function emitProjectionEvidence(result) {
|
|
|
37885
37987
|
function normalizeText$2(value) {
|
|
37886
37988
|
return String(value ?? "").trim();
|
|
37887
37989
|
}
|
|
37888
|
-
function toErrorMessage$
|
|
37990
|
+
function toErrorMessage$25(error) {
|
|
37889
37991
|
if (error instanceof Error) return error.message;
|
|
37890
37992
|
return String(error);
|
|
37891
37993
|
}
|
|
@@ -38490,9 +38592,9 @@ function createModelCatalogReadSession(input) {
|
|
|
38490
38592
|
async function readModelCatalogOnce(baseUrl) {
|
|
38491
38593
|
try {
|
|
38492
38594
|
const [apiClient, baseUrlModule, clientFoundationModule] = await Promise.all([
|
|
38493
|
-
import("./dist-
|
|
38494
|
-
import("./base-url-
|
|
38495
|
-
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)
|
|
38496
38598
|
]);
|
|
38497
38599
|
if (typeof apiClient.createConfigApi !== "function") throw new Error("config api client is unavailable");
|
|
38498
38600
|
const resolvedBaseUrl = baseUrl ?? await baseUrlModule.resolveBaseUrl();
|
|
@@ -39108,7 +39210,7 @@ async function repairLocalReplyStateOrThrow(input) {
|
|
|
39108
39210
|
mode: "repair"
|
|
39109
39211
|
});
|
|
39110
39212
|
} catch (error) {
|
|
39111
|
-
const errorMessage = toErrorMessage$
|
|
39213
|
+
const errorMessage = toErrorMessage$32(error);
|
|
39112
39214
|
emitRunLine({
|
|
39113
39215
|
presenter: input.presenter,
|
|
39114
39216
|
code: "daemon.run.projection_sync_failed",
|
|
@@ -39125,7 +39227,7 @@ async function repairLocalReplyStateOrThrow(input) {
|
|
|
39125
39227
|
try {
|
|
39126
39228
|
await syncProfileWorkspaceState({ mode: "repair" });
|
|
39127
39229
|
} catch (error) {
|
|
39128
|
-
const errorMessage = toErrorMessage$
|
|
39230
|
+
const errorMessage = toErrorMessage$32(error);
|
|
39129
39231
|
emitRunLine({
|
|
39130
39232
|
presenter: input.presenter,
|
|
39131
39233
|
code: "daemon.run.profile_workspace_sync_failed",
|
|
@@ -39177,7 +39279,7 @@ async function syncDaemonRouteCatalogState(input) {
|
|
|
39177
39279
|
return {
|
|
39178
39280
|
status: "failed",
|
|
39179
39281
|
reason: "load_failed",
|
|
39180
|
-
errorMessage: toErrorMessage$
|
|
39282
|
+
errorMessage: toErrorMessage$32(error)
|
|
39181
39283
|
};
|
|
39182
39284
|
}
|
|
39183
39285
|
const nextFingerprint = buildRouteCatalogFingerprint(nextCatalog);
|
|
@@ -39190,7 +39292,7 @@ async function syncDaemonRouteCatalogState(input) {
|
|
|
39190
39292
|
return {
|
|
39191
39293
|
status: "failed",
|
|
39192
39294
|
reason: "register_failed",
|
|
39193
|
-
errorMessage: toErrorMessage$
|
|
39295
|
+
errorMessage: toErrorMessage$32(error)
|
|
39194
39296
|
};
|
|
39195
39297
|
}
|
|
39196
39298
|
applyAcceptedLeases({
|
|
@@ -39223,7 +39325,7 @@ async function syncDaemonRouteCatalogState(input) {
|
|
|
39223
39325
|
return {
|
|
39224
39326
|
status: "failed",
|
|
39225
39327
|
reason: "register_failed",
|
|
39226
|
-
errorMessage: toErrorMessage$
|
|
39328
|
+
errorMessage: toErrorMessage$32(error)
|
|
39227
39329
|
};
|
|
39228
39330
|
}
|
|
39229
39331
|
const diff = buildRouteCatalogDiff({
|
|
@@ -39344,7 +39446,7 @@ async function resolveLocalServiceDemand(input) {
|
|
|
39344
39446
|
expectedRoutesRead: input.expectedRoutesRead,
|
|
39345
39447
|
mode: "check"
|
|
39346
39448
|
}).catch(() => null) : input.projection;
|
|
39347
|
-
const ownerUserId = normalizeOptionalString$
|
|
39449
|
+
const ownerUserId = normalizeOptionalString$11(input.ownerUserId);
|
|
39348
39450
|
if (!ownerUserId) return {
|
|
39349
39451
|
decision: "indeterminate",
|
|
39350
39452
|
hasLocalExecutionRoute: false,
|
|
@@ -39382,7 +39484,7 @@ async function resolveLocalServiceDemand(input) {
|
|
|
39382
39484
|
decision: "indeterminate",
|
|
39383
39485
|
hasLocalExecutionRoute: false,
|
|
39384
39486
|
repairableReplyCandidateCount: 0,
|
|
39385
|
-
reason: `failed to load local daemon routes: ${toErrorMessage$
|
|
39487
|
+
reason: `failed to load local daemon routes: ${toErrorMessage$32(error)}`,
|
|
39386
39488
|
localExecutionRouteCount: 0,
|
|
39387
39489
|
projection
|
|
39388
39490
|
};
|
|
@@ -39415,7 +39517,7 @@ async function resolveLocalServiceDemand(input) {
|
|
|
39415
39517
|
function isRepairableSkippedDaemonProfile(skipReason) {
|
|
39416
39518
|
return skipReason === "projection.missing" || skipReason === "workspace.missing";
|
|
39417
39519
|
}
|
|
39418
|
-
function normalizeOptionalString$
|
|
39520
|
+
function normalizeOptionalString$11(value) {
|
|
39419
39521
|
const normalized = String(value ?? "").trim();
|
|
39420
39522
|
return normalized.length > 0 ? normalized : null;
|
|
39421
39523
|
}
|
|
@@ -39879,7 +39981,7 @@ async function runOpenClawJsonCommand(input) {
|
|
|
39879
39981
|
try {
|
|
39880
39982
|
return JSON.parse(stdout);
|
|
39881
39983
|
} catch (error) {
|
|
39882
|
-
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)}`);
|
|
39883
39985
|
}
|
|
39884
39986
|
}
|
|
39885
39987
|
async function runOpenClawCommand(input) {
|
|
@@ -39914,7 +40016,7 @@ function normalizeOptionalText$24(value) {
|
|
|
39914
40016
|
const normalized = String(value ?? "").trim();
|
|
39915
40017
|
return normalized.length > 0 ? normalized : null;
|
|
39916
40018
|
}
|
|
39917
|
-
function toErrorMessage$
|
|
40019
|
+
function toErrorMessage$24(error) {
|
|
39918
40020
|
return error instanceof Error ? error.message : String(error);
|
|
39919
40021
|
}
|
|
39920
40022
|
function isExecFileTimeoutError(error) {
|
|
@@ -39928,7 +40030,7 @@ function resolveOpenClawCliErrorMessage(error, timeoutMs) {
|
|
|
39928
40030
|
const cliMessage = normalizeOptionalText$24(error.stderr) ?? stdout;
|
|
39929
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`;
|
|
39930
40032
|
if (cliMessage) return cliMessage;
|
|
39931
|
-
return `openclaw command failed: ${toErrorMessage$
|
|
40033
|
+
return `openclaw command failed: ${toErrorMessage$24(error)}`;
|
|
39932
40034
|
}
|
|
39933
40035
|
function parseOpenClawAgentSummary(value) {
|
|
39934
40036
|
if (!value || typeof value !== "object") return null;
|
|
@@ -40305,7 +40407,7 @@ async function ensureOpenClawGatewayAgentVisible(input, deps = DEFAULT_OPENCLAW_
|
|
|
40305
40407
|
gatewayRestartAttempted: true,
|
|
40306
40408
|
gatewayVisibility: "missing_before_restart"
|
|
40307
40409
|
},
|
|
40308
|
-
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)}`
|
|
40309
40411
|
});
|
|
40310
40412
|
}
|
|
40311
40413
|
let lastVisibilityError = null;
|
|
@@ -40334,7 +40436,7 @@ async function ensureOpenClawGatewayAgentVisible(input, deps = DEFAULT_OPENCLAW_
|
|
|
40334
40436
|
gatewayRestartAttempted: true,
|
|
40335
40437
|
gatewayVisibility: "missing_after_restart"
|
|
40336
40438
|
},
|
|
40337
|
-
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)}`
|
|
40338
40440
|
});
|
|
40339
40441
|
}
|
|
40340
40442
|
async function maybeCopyOpenClawAuth(input) {
|
|
@@ -40375,7 +40477,7 @@ async function ensureParentDirectory(path) {
|
|
|
40375
40477
|
async function pathExists$1(path) {
|
|
40376
40478
|
return await access(path, constants.F_OK).then(() => true).catch(() => false);
|
|
40377
40479
|
}
|
|
40378
|
-
function toErrorMessage$
|
|
40480
|
+
function toErrorMessage$23(error) {
|
|
40379
40481
|
return error instanceof Error ? error.message : String(error);
|
|
40380
40482
|
}
|
|
40381
40483
|
function normalizeBootstrapReadError(error) {
|
|
@@ -40494,7 +40596,7 @@ function assertOpenClawWorkspaceMatch(input) {
|
|
|
40494
40596
|
});
|
|
40495
40597
|
}
|
|
40496
40598
|
function isOpenClawAgentAlreadyExistsError(error) {
|
|
40497
|
-
const normalizedMessage = toErrorMessage$
|
|
40599
|
+
const normalizedMessage = toErrorMessage$23(error).toLowerCase();
|
|
40498
40600
|
return normalizedMessage.includes("agent") && normalizedMessage.includes("already exists");
|
|
40499
40601
|
}
|
|
40500
40602
|
function resolveProviderRuntimeWorkingDirectory(value) {
|
|
@@ -40531,7 +40633,7 @@ async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PRE
|
|
|
40531
40633
|
}).catch((error) => {
|
|
40532
40634
|
throw new DaemonServiceRunError({
|
|
40533
40635
|
code: "controller.bootstrap.failed",
|
|
40534
|
-
message: `controller.bootstrap.failed: ${toErrorMessage$
|
|
40636
|
+
message: `controller.bootstrap.failed: ${toErrorMessage$22(error)}`,
|
|
40535
40637
|
providerErrorCode: extractErrorCode$1(error)
|
|
40536
40638
|
});
|
|
40537
40639
|
});
|
|
@@ -40541,7 +40643,7 @@ async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PRE
|
|
|
40541
40643
|
}).catch((error) => {
|
|
40542
40644
|
throw new DaemonServiceRunError({
|
|
40543
40645
|
code: "controller.gateway.unhealthy",
|
|
40544
|
-
message: `controller.gateway.unhealthy: ${toErrorMessage$
|
|
40646
|
+
message: `controller.gateway.unhealthy: ${toErrorMessage$22(error)}`,
|
|
40545
40647
|
providerErrorCode: extractErrorCode$1(error)
|
|
40546
40648
|
});
|
|
40547
40649
|
});
|
|
@@ -40553,7 +40655,7 @@ async function prepareOpenClawRuntime(input, deps = DEFAULT_OPENCLAW_RUNTIME_PRE
|
|
|
40553
40655
|
const gatewayFailure = buildOpenClawGatewayVisibilityFailure(error);
|
|
40554
40656
|
throw new DaemonServiceRunError({
|
|
40555
40657
|
code: "controller.gateway.unhealthy",
|
|
40556
|
-
message: `controller.gateway.unhealthy: ${toErrorMessage$
|
|
40658
|
+
message: `controller.gateway.unhealthy: ${toErrorMessage$22(error)}`,
|
|
40557
40659
|
providerErrorCode: extractErrorCode$1(error),
|
|
40558
40660
|
...gatewayFailure
|
|
40559
40661
|
});
|
|
@@ -40592,7 +40694,7 @@ function resolveOpenClawGatewayVisibilityDiagnostics(error) {
|
|
|
40592
40694
|
gatewayVisibility: parsedGatewayVisibility.data
|
|
40593
40695
|
};
|
|
40594
40696
|
}
|
|
40595
|
-
function toErrorMessage$
|
|
40697
|
+
function toErrorMessage$22(error) {
|
|
40596
40698
|
return error instanceof Error ? error.message : String(error);
|
|
40597
40699
|
}
|
|
40598
40700
|
//#endregion
|
|
@@ -40640,7 +40742,7 @@ function createOpenClawLocalDiagnosticsFailure(error) {
|
|
|
40640
40742
|
return {
|
|
40641
40743
|
errorCode: extractErrorCode(error),
|
|
40642
40744
|
kind: "failed",
|
|
40643
|
-
message: toErrorMessage$
|
|
40745
|
+
message: toErrorMessage$21(error)
|
|
40644
40746
|
};
|
|
40645
40747
|
}
|
|
40646
40748
|
function isOpenClawLocalDiagnosticsFailure(diagnostics) {
|
|
@@ -40724,7 +40826,7 @@ async function resolveInspectModeDiagnostics(input) {
|
|
|
40724
40826
|
openClawBin: input.openClawBin
|
|
40725
40827
|
}).then(() => "healthy").catch((error) => ({
|
|
40726
40828
|
errorCode: extractErrorCode(error),
|
|
40727
|
-
message: toErrorMessage$
|
|
40829
|
+
message: toErrorMessage$21(error)
|
|
40728
40830
|
}));
|
|
40729
40831
|
if (gatewayHealth !== "healthy") return {
|
|
40730
40832
|
...inspected,
|
|
@@ -40804,7 +40906,7 @@ async function resolveInspectGatewayVisibility(input) {
|
|
|
40804
40906
|
return {
|
|
40805
40907
|
errorCode: extractErrorCode(error),
|
|
40806
40908
|
gatewayVisibility: "not_checked",
|
|
40807
|
-
message: toErrorMessage$
|
|
40909
|
+
message: toErrorMessage$21(error)
|
|
40808
40910
|
};
|
|
40809
40911
|
}
|
|
40810
40912
|
}
|
|
@@ -40813,7 +40915,7 @@ function resolveDiagnosticsFailureDetail(input) {
|
|
|
40813
40915
|
const inspectedMessage = typeof input.inspected.message === "string" && input.inspected.message.trim().length > 0 ? input.inspected.message.trim() : null;
|
|
40814
40916
|
return {
|
|
40815
40917
|
errorCode: inspectedErrorCode ?? extractErrorCode(input.error),
|
|
40816
|
-
message: inspectedMessage ?? toErrorMessage$
|
|
40918
|
+
message: inspectedMessage ?? toErrorMessage$21(input.error)
|
|
40817
40919
|
};
|
|
40818
40920
|
}
|
|
40819
40921
|
function resolveDiagnosticsTargetAgent(input) {
|
|
@@ -40874,7 +40976,7 @@ function buildBootstrapDiagnosticStatus(bootstrapStatus, errorCode, message) {
|
|
|
40874
40976
|
}
|
|
40875
40977
|
function resolveExplicitBootstrapDiagnostic(error) {
|
|
40876
40978
|
const explicitErrorCode = extractErrorCode(error);
|
|
40877
|
-
const explicitMessage = error ? toErrorMessage$
|
|
40979
|
+
const explicitMessage = error ? toErrorMessage$21(error) : null;
|
|
40878
40980
|
switch (explicitErrorCode) {
|
|
40879
40981
|
case "openclaw.bootstrap.binding_conflict": return buildBootstrapDiagnosticStatus("binding_conflict", explicitErrorCode, explicitMessage);
|
|
40880
40982
|
case "openclaw.bootstrap.workspace_mismatch": return buildBootstrapDiagnosticStatus("workspace_mismatch", explicitErrorCode, explicitMessage);
|
|
@@ -40894,7 +40996,7 @@ function resolveExistingBootstrapStatus(input) {
|
|
|
40894
40996
|
}
|
|
40895
40997
|
function resolveInvalidBootstrapStatus(input) {
|
|
40896
40998
|
if (input.workspaceAgents.length > 1) return buildBootstrapDiagnosticStatus("workspace_ambiguous", "openclaw.bootstrap.workspace_ambiguous", null);
|
|
40897
|
-
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));
|
|
40898
41000
|
}
|
|
40899
41001
|
function resolveMissingBootstrapStatus(workspaceAgents, input = {}) {
|
|
40900
41002
|
if (workspaceAgents.length > 1) return buildBootstrapDiagnosticStatus("workspace_ambiguous", "openclaw.bootstrap.workspace_ambiguous", null);
|
|
@@ -40938,7 +41040,7 @@ function extractProviderErrorCode(error) {
|
|
|
40938
41040
|
const normalized = String(error.providerErrorCode ?? "").trim();
|
|
40939
41041
|
return normalized.length > 0 ? normalized : null;
|
|
40940
41042
|
}
|
|
40941
|
-
function toErrorMessage$
|
|
41043
|
+
function toErrorMessage$21(error) {
|
|
40942
41044
|
return error instanceof Error ? error.message : String(error);
|
|
40943
41045
|
}
|
|
40944
41046
|
//#endregion
|
|
@@ -41011,9 +41113,9 @@ async function resolveGatewayChainReadiness(input = {}) {
|
|
|
41011
41113
|
applicable: true,
|
|
41012
41114
|
baseUrl: fallbackBaseUrl,
|
|
41013
41115
|
checkedAt,
|
|
41014
|
-
details: toErrorMessage$
|
|
41116
|
+
details: toErrorMessage$44(error),
|
|
41015
41117
|
errorCode: null,
|
|
41016
|
-
errorMessage: toErrorMessage$
|
|
41118
|
+
errorMessage: toErrorMessage$44(error),
|
|
41017
41119
|
failureKind: "gateway_unreachable",
|
|
41018
41120
|
ready: false,
|
|
41019
41121
|
status: null,
|
|
@@ -42101,7 +42203,7 @@ function buildLookupFailedRouteObservationDetail(input) {
|
|
|
42101
42203
|
observedAt: input.observedAt,
|
|
42102
42204
|
reasonCode: "lookup_failed"
|
|
42103
42205
|
});
|
|
42104
|
-
const rawError = toErrorMessage$
|
|
42206
|
+
const rawError = toErrorMessage$20(input.error).trim();
|
|
42105
42207
|
if (rawError.length === 0 || rawError === detail) return detail;
|
|
42106
42208
|
return `${detail} Raw lookup error: ${rawError}`;
|
|
42107
42209
|
}
|
|
@@ -42129,7 +42231,7 @@ function enrichRuntimeStateWithManager(input) {
|
|
|
42129
42231
|
serviceController: input.runtimeState.serviceController === "unknown" && input.serviceManager?.controller !== void 0 ? input.serviceManager.controller : input.runtimeState.serviceController
|
|
42130
42232
|
};
|
|
42131
42233
|
}
|
|
42132
|
-
function toErrorMessage$
|
|
42234
|
+
function toErrorMessage$20(error) {
|
|
42133
42235
|
if (error instanceof Error) return error.message;
|
|
42134
42236
|
return String(error);
|
|
42135
42237
|
}
|
|
@@ -42342,7 +42444,7 @@ async function clearDaemonStartFailureState(pathInput = {}) {
|
|
|
42342
42444
|
await rm(daemonStartFailureStatePath(pathInput), { force: true }).catch(() => void 0);
|
|
42343
42445
|
}
|
|
42344
42446
|
function parseDaemonStartFailureState(value) {
|
|
42345
|
-
if (!isRecord$
|
|
42447
|
+
if (!isRecord$2(value)) return null;
|
|
42346
42448
|
if (value.schema !== DAEMON_START_FAILURE_STATE_SCHEMA || value.v !== 1) return null;
|
|
42347
42449
|
const recordedAt = normalizeOptionalText$46(value.recordedAt);
|
|
42348
42450
|
const detail = normalizeOptionalText$46(value.detail);
|
|
@@ -42365,7 +42467,7 @@ function parseDaemonStartFailureState(value) {
|
|
|
42365
42467
|
function normalizeDependencyIssues(issues) {
|
|
42366
42468
|
const normalized = [];
|
|
42367
42469
|
for (const issue of issues) {
|
|
42368
|
-
if (!isRecord$
|
|
42470
|
+
if (!isRecord$2(issue)) continue;
|
|
42369
42471
|
const kind = issue.kind;
|
|
42370
42472
|
const status = issue.status;
|
|
42371
42473
|
const scope = issue.scope;
|
|
@@ -42384,7 +42486,7 @@ function normalizeDependencyIssues(issues) {
|
|
|
42384
42486
|
}
|
|
42385
42487
|
return normalized;
|
|
42386
42488
|
}
|
|
42387
|
-
function isRecord$
|
|
42489
|
+
function isRecord$2(value) {
|
|
42388
42490
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
42389
42491
|
}
|
|
42390
42492
|
async function writeJsonAtomic(input) {
|
|
@@ -43146,7 +43248,7 @@ async function captureDaemonServiceEvidence(input = {}) {
|
|
|
43146
43248
|
errorMessage: null
|
|
43147
43249
|
})).catch((error) => ({
|
|
43148
43250
|
snapshot: null,
|
|
43149
|
-
errorMessage: toErrorMessage$
|
|
43251
|
+
errorMessage: toErrorMessage$19(error)
|
|
43150
43252
|
})),
|
|
43151
43253
|
captureOwnedProcessesArtifact(phaseRootPath),
|
|
43152
43254
|
captureSystemServiceDiagnosticsArtifact(phaseRootPath)
|
|
@@ -43260,7 +43362,7 @@ async function captureDirectoryArtifact(input) {
|
|
|
43260
43362
|
};
|
|
43261
43363
|
} catch (error) {
|
|
43262
43364
|
return {
|
|
43263
|
-
errorMessage: toErrorMessage$
|
|
43365
|
+
errorMessage: toErrorMessage$19(error),
|
|
43264
43366
|
relativePath: null,
|
|
43265
43367
|
sourcePath: input.sourcePath,
|
|
43266
43368
|
status: "error"
|
|
@@ -43286,7 +43388,7 @@ async function captureFileArtifact(input) {
|
|
|
43286
43388
|
};
|
|
43287
43389
|
} catch (error) {
|
|
43288
43390
|
return {
|
|
43289
|
-
errorMessage: toErrorMessage$
|
|
43391
|
+
errorMessage: toErrorMessage$19(error),
|
|
43290
43392
|
relativePath: null,
|
|
43291
43393
|
sourcePath: input.sourcePath,
|
|
43292
43394
|
status: "error"
|
|
@@ -43308,7 +43410,7 @@ async function captureOwnedProcessesArtifact(evidencePath) {
|
|
|
43308
43410
|
} };
|
|
43309
43411
|
} catch (error) {
|
|
43310
43412
|
return { artifact: {
|
|
43311
|
-
errorMessage: toErrorMessage$
|
|
43413
|
+
errorMessage: toErrorMessage$19(error),
|
|
43312
43414
|
relativePath: null,
|
|
43313
43415
|
sourcePath: null,
|
|
43314
43416
|
status: "error"
|
|
@@ -43415,7 +43517,7 @@ async function runCommand$2(command, args, input = {}) {
|
|
|
43415
43517
|
child.once("close", handleClose);
|
|
43416
43518
|
});
|
|
43417
43519
|
}
|
|
43418
|
-
function toErrorMessage$
|
|
43520
|
+
function toErrorMessage$19(error) {
|
|
43419
43521
|
if (error instanceof Error) return error.message;
|
|
43420
43522
|
return String(error);
|
|
43421
43523
|
}
|
|
@@ -43887,7 +43989,7 @@ var DaemonServiceLifecycleDrainTimeoutError = class extends Error {
|
|
|
43887
43989
|
var DaemonServiceLifecycleControlledDrainError = class extends Error {
|
|
43888
43990
|
cause;
|
|
43889
43991
|
constructor(cause) {
|
|
43890
|
-
super(`controlled service drain failed: ${toErrorMessage$
|
|
43992
|
+
super(`controlled service drain failed: ${toErrorMessage$43(cause)}`);
|
|
43891
43993
|
this.name = "DaemonServiceLifecycleControlledDrainError";
|
|
43892
43994
|
this.cause = cause;
|
|
43893
43995
|
}
|
|
@@ -44051,7 +44153,7 @@ async function runDaemonServiceLifecycle(input) {
|
|
|
44051
44153
|
evidencePath: state.evidencePath,
|
|
44052
44154
|
recoveryStatus: "failed_before_safe_state",
|
|
44053
44155
|
errorCode: resolveLifecycleFailureErrorCode(error),
|
|
44054
|
-
errorMessage: toErrorMessage$
|
|
44156
|
+
errorMessage: toErrorMessage$43(error)
|
|
44055
44157
|
};
|
|
44056
44158
|
} finally {
|
|
44057
44159
|
await cleanupPreparedBundleAfterLifecycle({
|
|
@@ -44087,7 +44189,7 @@ async function cleanupPreparedBundleAfterLifecycle(input) {
|
|
|
44087
44189
|
} catch (error) {
|
|
44088
44190
|
console.warn("[openmeld.daemon_bundle.cleanup_warning]", {
|
|
44089
44191
|
bundleId: input.preparedBundle.bundleId,
|
|
44090
|
-
errorMessage: toErrorMessage$
|
|
44192
|
+
errorMessage: toErrorMessage$43(error),
|
|
44091
44193
|
operation: input.operation
|
|
44092
44194
|
});
|
|
44093
44195
|
}
|
|
@@ -44243,7 +44345,7 @@ async function executeDaemonServiceLifecycle(input) {
|
|
|
44243
44345
|
}
|
|
44244
44346
|
}
|
|
44245
44347
|
async function recoverLifecycleFailure(input) {
|
|
44246
|
-
const originalErrorMessage = toErrorMessage$
|
|
44348
|
+
const originalErrorMessage = toErrorMessage$43(input.error);
|
|
44247
44349
|
const originalErrorCode = resolveLifecycleFailureErrorCode(input.error);
|
|
44248
44350
|
const originalFailureStage = resolveLifecycleFailureStage(input.error, input.state.failureStage);
|
|
44249
44351
|
const originalReasonCodes = resolveLifecycleFailureReasonCodes(input.error);
|
|
@@ -44277,7 +44379,7 @@ async function recoverLifecycleFailure(input) {
|
|
|
44277
44379
|
}).catch((error) => {
|
|
44278
44380
|
verifiedRollbackError = error;
|
|
44279
44381
|
console.warn("[openmeld.daemon_service.verified_rollback_failed]", {
|
|
44280
|
-
errorMessage: toErrorMessage$
|
|
44382
|
+
errorMessage: toErrorMessage$43(error),
|
|
44281
44383
|
failureStage: originalFailureStage,
|
|
44282
44384
|
operation: input.operation,
|
|
44283
44385
|
previousVersion: input.restorePoint.previousInstallState?.daemonVersion ?? null,
|
|
@@ -44302,7 +44404,7 @@ async function recoverLifecycleFailure(input) {
|
|
|
44302
44404
|
errorMessage: originalErrorMessage
|
|
44303
44405
|
};
|
|
44304
44406
|
}
|
|
44305
|
-
const recoveryErrorMessage = verifiedRollbackError ? `${originalErrorMessage}; verified previous Service recovery failed: ${toErrorMessage$
|
|
44407
|
+
const recoveryErrorMessage = verifiedRollbackError ? `${originalErrorMessage}; verified previous Service recovery failed: ${toErrorMessage$43(verifiedRollbackError)}` : originalErrorMessage;
|
|
44306
44408
|
const stoppedSafe = await transitionLifecycleToStoppedSafeCurrentVersion({
|
|
44307
44409
|
commandOptions: input.commandOptions,
|
|
44308
44410
|
currentContract: input.currentContract,
|
|
@@ -44330,7 +44432,7 @@ async function recoverLifecycleFailure(input) {
|
|
|
44330
44432
|
evidencePath: input.state.evidencePath,
|
|
44331
44433
|
recoveryStatus: "failed_before_safe_state",
|
|
44332
44434
|
errorCode: originalErrorCode,
|
|
44333
|
-
errorMessage: `${recoveryErrorMessage}; stopped-safe recovery failed: ${toErrorMessage$
|
|
44435
|
+
errorMessage: `${recoveryErrorMessage}; stopped-safe recovery failed: ${toErrorMessage$43(stoppedSafe.safeStopError)}`
|
|
44334
44436
|
};
|
|
44335
44437
|
}
|
|
44336
44438
|
input.state.runtimeDataBackup = null;
|
|
@@ -44562,7 +44664,7 @@ async function stopLifecycleSystemServiceRuntime(input) {
|
|
|
44562
44664
|
} catch (restoreError) {
|
|
44563
44665
|
throw new DaemonServiceLifecycleStageError({
|
|
44564
44666
|
cause: restoreError,
|
|
44565
|
-
message: `${toErrorMessage$
|
|
44667
|
+
message: `${toErrorMessage$43(drainError)}; failed to restore service autostart: ${toErrorMessage$43(restoreError)}`,
|
|
44566
44668
|
stage: "stop_or_drain"
|
|
44567
44669
|
});
|
|
44568
44670
|
}
|
|
@@ -44617,7 +44719,7 @@ async function requestControlledSystemServiceDrain(input) {
|
|
|
44617
44719
|
observedDaemonVersion
|
|
44618
44720
|
} : {},
|
|
44619
44721
|
...isManagerRunningWithoutRuntime ? { compatibilityReason: "manager_running_without_runtime" } : {},
|
|
44620
|
-
errorMessage: toErrorMessage$
|
|
44722
|
+
errorMessage: toErrorMessage$43(error)
|
|
44621
44723
|
},
|
|
44622
44724
|
result: isCompatibilityFallback ? "fallback" : "failed",
|
|
44623
44725
|
stopCause: "controlled_service_update",
|
|
@@ -44689,7 +44791,7 @@ async function waitForLifecycleRuntimeAbsentWithRetry(serviceManager) {
|
|
|
44689
44791
|
} catch (retryError) {
|
|
44690
44792
|
throw new DaemonServiceLifecycleStageError({
|
|
44691
44793
|
cause: retryError,
|
|
44692
|
-
message: `${toErrorMessage$
|
|
44794
|
+
message: `${toErrorMessage$43(retryError)}; initial absence verification failed: ${toErrorMessage$43(initialError)}`,
|
|
44693
44795
|
stage: "wait_absent"
|
|
44694
44796
|
});
|
|
44695
44797
|
}
|
|
@@ -44699,7 +44801,7 @@ async function cleanupStaleDaemonRuntimeDataBackupsAfterHealthyLifecycle(operati
|
|
|
44699
44801
|
await cleanupStaleDaemonRuntimeDataBackups();
|
|
44700
44802
|
} catch (error) {
|
|
44701
44803
|
console.warn("[openmeld.daemon_runtime_data.cleanup_warning]", {
|
|
44702
|
-
errorMessage: toErrorMessage$
|
|
44804
|
+
errorMessage: toErrorMessage$43(error),
|
|
44703
44805
|
operation
|
|
44704
44806
|
});
|
|
44705
44807
|
}
|
|
@@ -45109,7 +45211,7 @@ async function stopDaemonProcess$1(pid, signal) {
|
|
|
45109
45211
|
process$1.kill(pid, signal);
|
|
45110
45212
|
} catch (error) {
|
|
45111
45213
|
if (error instanceof Error && error.code === "ESRCH") return true;
|
|
45112
|
-
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)}`);
|
|
45113
45215
|
}
|
|
45114
45216
|
if (signal === "SIGKILL") return true;
|
|
45115
45217
|
return await waitForProcessToExit$1(pid, PROCESS_STOP_WAIT_MS);
|
|
@@ -45119,7 +45221,7 @@ async function stopDaemonProcessWithTimeout(pid, signal, timeoutMs) {
|
|
|
45119
45221
|
process$1.kill(pid, signal);
|
|
45120
45222
|
} catch (error) {
|
|
45121
45223
|
if (error instanceof Error && error.code === "ESRCH") return true;
|
|
45122
|
-
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)}`);
|
|
45123
45225
|
}
|
|
45124
45226
|
return await waitForProcessToExit$1(pid, timeoutMs);
|
|
45125
45227
|
}
|
|
@@ -45133,7 +45235,7 @@ async function waitForProcessToExit$1(pid, timeoutMs) {
|
|
|
45133
45235
|
}
|
|
45134
45236
|
function isLaunchdBootstrapIoError(serviceManager, error) {
|
|
45135
45237
|
if (serviceManager.controller !== "launchd") return false;
|
|
45136
|
-
const message = toErrorMessage$
|
|
45238
|
+
const message = toErrorMessage$43(error).toLowerCase();
|
|
45137
45239
|
return message.includes("bootstrap failed") && message.includes("input/output error");
|
|
45138
45240
|
}
|
|
45139
45241
|
async function writeLifecycleEvidenceEvent(input) {
|
|
@@ -45660,7 +45762,7 @@ async function discardReplacedBundleBestEffort(input) {
|
|
|
45660
45762
|
await input.dependencies.discardBundle(input.pending.preparedBundle).catch((error) => {
|
|
45661
45763
|
console.warn("[openmeld.daemon_service.update_bundle_cleanup_failed]", {
|
|
45662
45764
|
bundleId: input.pending.preparedBundle.bundleId,
|
|
45663
|
-
errorMessage: toErrorMessage$
|
|
45765
|
+
errorMessage: toErrorMessage$43(error),
|
|
45664
45766
|
operationId: input.pending.jobId
|
|
45665
45767
|
});
|
|
45666
45768
|
});
|
|
@@ -45694,7 +45796,7 @@ async function preparePendingUpdateForSwitch(deps) {
|
|
|
45694
45796
|
} catch (error) {
|
|
45695
45797
|
await deps.persistPendingJob({
|
|
45696
45798
|
...waiting,
|
|
45697
|
-
errorMessage: toErrorMessage$
|
|
45799
|
+
errorMessage: toErrorMessage$43(error),
|
|
45698
45800
|
updatedAt: deps.now()
|
|
45699
45801
|
});
|
|
45700
45802
|
throw error;
|
|
@@ -45742,7 +45844,7 @@ async function runPreparedPendingUpdate(deps) {
|
|
|
45742
45844
|
await deps.completePendingJob(completed);
|
|
45743
45845
|
return completed;
|
|
45744
45846
|
} catch (error) {
|
|
45745
|
-
const errorMessage = toErrorMessage$
|
|
45847
|
+
const errorMessage = toErrorMessage$43(error);
|
|
45746
45848
|
if (running.attempts < MAX_BACKGROUND_UPDATE_ATTEMPTS) {
|
|
45747
45849
|
const retry = {
|
|
45748
45850
|
...running,
|
|
@@ -52265,7 +52367,7 @@ function storeNewestSpaceConfig(list, candidate) {
|
|
|
52265
52367
|
if (!existing || compareIsoDateDesc(candidate.updatedAt, existing.updatedAt) < 0) list.set(candidate.space, candidate);
|
|
52266
52368
|
}
|
|
52267
52369
|
function normalizeSpaceConfig(value) {
|
|
52268
|
-
if (!isRecord(value)) return null;
|
|
52370
|
+
if (!isRecord$1(value)) return null;
|
|
52269
52371
|
if (value.v === 2) return normalizeCurrentSpaceConfig(value);
|
|
52270
52372
|
if (value.v === 1) return normalizeLegacySpaceConfig(value);
|
|
52271
52373
|
return null;
|
|
@@ -52294,7 +52396,7 @@ function normalizeCurrentSpaceConfig(parsed) {
|
|
|
52294
52396
|
});
|
|
52295
52397
|
}
|
|
52296
52398
|
function normalizeSpaceCacheMaintenanceState(value) {
|
|
52297
|
-
if (!isRecord(value)) return null;
|
|
52399
|
+
if (!isRecord$1(value)) return null;
|
|
52298
52400
|
const lastRunAt = resolveIsoTimestamp(value.lastRunAt);
|
|
52299
52401
|
const lastRemovedByRemote = resolveOptionalNonNegativeInteger(value.lastRemovedByRemote);
|
|
52300
52402
|
const lastRemovedByTtl = resolveOptionalNonNegativeInteger(value.lastRemovedByTtl);
|
|
@@ -52309,8 +52411,8 @@ function normalizeSpaceCacheMaintenanceState(value) {
|
|
|
52309
52411
|
};
|
|
52310
52412
|
}
|
|
52311
52413
|
function normalizeSpaceCacheDeletionNoticeState(value) {
|
|
52312
|
-
if (!isRecord(value)) return null;
|
|
52313
|
-
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;
|
|
52314
52416
|
const seen = {};
|
|
52315
52417
|
for (const [rawKey, rawValue] of Object.entries(value.seen)) {
|
|
52316
52418
|
const key = normalizeTrimmedOptionalString(rawKey);
|
|
@@ -52411,7 +52513,7 @@ function hasInvalidLegacySpaceConfigPrimitives(parsed) {
|
|
|
52411
52513
|
hasInvalidOptionalStringEntry(parsed, "role"),
|
|
52412
52514
|
hasInvalidOptionalStringEntry(parsed, "mentionAlias"),
|
|
52413
52515
|
hasInvalidOptionalStringEntry(parsed, "guide"),
|
|
52414
|
-
hasOwn(parsed, "permissions") && !isRecord(parsed.permissions),
|
|
52516
|
+
hasOwn(parsed, "permissions") && !isRecord$1(parsed.permissions),
|
|
52415
52517
|
hasInvalidOptionalBooleanEntry(parsed, "passwordProtected"),
|
|
52416
52518
|
hasInvalidOptionalStringEntry(parsed, "spacePurpose"),
|
|
52417
52519
|
hasInvalidOptionalNonNegativeIntegerEntry(parsed, "activeAgentCount"),
|
|
@@ -52496,7 +52598,7 @@ function areStringListsEqual(left, right) {
|
|
|
52496
52598
|
for (let index = 0; index < left.length; index += 1) if (left[index] !== right[index]) return false;
|
|
52497
52599
|
return true;
|
|
52498
52600
|
}
|
|
52499
|
-
function isRecord(value) {
|
|
52601
|
+
function isRecord$1(value) {
|
|
52500
52602
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
52501
52603
|
}
|
|
52502
52604
|
function hasOwn(value, key) {
|
|
@@ -53348,7 +53450,7 @@ async function probeOpenCodeReadiness(input) {
|
|
|
53348
53450
|
const auth = resolveOpenCodeAuthSnapshotFromProbeError(error);
|
|
53349
53451
|
return {
|
|
53350
53452
|
auth,
|
|
53351
|
-
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)}`,
|
|
53352
53454
|
models: [],
|
|
53353
53455
|
probeCompleted: auth.status === "unauthenticated",
|
|
53354
53456
|
status: "error"
|
|
@@ -53596,7 +53698,7 @@ function stripAnsi$1(value) {
|
|
|
53596
53698
|
}
|
|
53597
53699
|
return output;
|
|
53598
53700
|
}
|
|
53599
|
-
function toErrorMessage$
|
|
53701
|
+
function toErrorMessage$18(error) {
|
|
53600
53702
|
if (error instanceof Error) {
|
|
53601
53703
|
const message = error.message.trim();
|
|
53602
53704
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -54089,7 +54191,7 @@ async function resolveGrokBuildInterfaceSnapshot(input) {
|
|
|
54089
54191
|
snapshot: {
|
|
54090
54192
|
...input.baseSnapshot,
|
|
54091
54193
|
auth: { status: unauthenticated ? "unauthenticated" : "unknown" },
|
|
54092
|
-
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)}`,
|
|
54093
54195
|
status: unauthenticated ? "error" : "warning",
|
|
54094
54196
|
version,
|
|
54095
54197
|
versionAdvisory: await resolveControllerVersionAdvisory({
|
|
@@ -54323,7 +54425,7 @@ function probeCodexAppServer(launchContract) {
|
|
|
54323
54425
|
child.stdin.on("error", (error) => {
|
|
54324
54426
|
finish({
|
|
54325
54427
|
auth: { status: "unknown" },
|
|
54326
|
-
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)}`,
|
|
54327
54429
|
ok: false
|
|
54328
54430
|
});
|
|
54329
54431
|
});
|
|
@@ -54351,7 +54453,7 @@ function probeCodexAppServer(launchContract) {
|
|
|
54351
54453
|
}).catch((error) => {
|
|
54352
54454
|
finish({
|
|
54353
54455
|
auth: { status: "unknown" },
|
|
54354
|
-
message: `Codex app-server status check failed: ${toErrorMessage$
|
|
54456
|
+
message: `Codex app-server status check failed: ${toErrorMessage$17(error)}`,
|
|
54355
54457
|
ok: false
|
|
54356
54458
|
});
|
|
54357
54459
|
});
|
|
@@ -54614,7 +54716,7 @@ function normalizeOptionalText$15(value) {
|
|
|
54614
54716
|
const normalized = value.trim();
|
|
54615
54717
|
return normalized.length > 0 ? normalized : null;
|
|
54616
54718
|
}
|
|
54617
|
-
function toErrorMessage$
|
|
54719
|
+
function toErrorMessage$17(error) {
|
|
54618
54720
|
if (error instanceof Error) {
|
|
54619
54721
|
const message = error.message.trim();
|
|
54620
54722
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -55162,7 +55264,7 @@ async function notifyRuntimeReportingAttemptObserver(observer, attempt) {
|
|
|
55162
55264
|
} catch (error) {
|
|
55163
55265
|
warnDaemonEvent("[openmeld.runtime_reporting.attempt_observer_failed]", {
|
|
55164
55266
|
authenticationRejected: attempt.authenticationRejected,
|
|
55165
|
-
error: toErrorMessage$
|
|
55267
|
+
error: toErrorMessage$16(error),
|
|
55166
55268
|
event: "cli.runtime_reporting.attempt_observer_failed",
|
|
55167
55269
|
family: attempt.family,
|
|
55168
55270
|
reasonCode: attempt.reasonCode,
|
|
@@ -55223,7 +55325,7 @@ async function submitAgentControllerReportsWithCompatibilityRetry(input) {
|
|
|
55223
55325
|
requestedReports: input.requestedReports
|
|
55224
55326
|
})) {
|
|
55225
55327
|
warnDaemonEvent("[openmeld.runtime_reporting.usage_limits_downgraded]", {
|
|
55226
|
-
error: toErrorMessage$
|
|
55328
|
+
error: toErrorMessage$16(error),
|
|
55227
55329
|
event: "cli.runtime_reporting.usage_limits_downgraded",
|
|
55228
55330
|
reportCount: input.requestedReports.length
|
|
55229
55331
|
});
|
|
@@ -55239,7 +55341,7 @@ async function submitAgentControllerReportsWithCompatibilityRetry(input) {
|
|
|
55239
55341
|
requestedReports: input.requestedReports
|
|
55240
55342
|
})) throw compatibilityError;
|
|
55241
55343
|
warnDaemonEvent("[openmeld.runtime_reporting.agent_controller_interface_downgraded]", {
|
|
55242
|
-
error: toErrorMessage$
|
|
55344
|
+
error: toErrorMessage$16(compatibilityError),
|
|
55243
55345
|
event: "cli.runtime_reporting.agent_controller_interface_downgraded",
|
|
55244
55346
|
profileIds: input.requestedReports.map((report) => report.diagnosticProfileId).filter((profileId) => Boolean(profileId)),
|
|
55245
55347
|
reportCount: input.requestedReports.length
|
|
@@ -55448,7 +55550,7 @@ function failedProviderConversationProofSubmission(input) {
|
|
|
55448
55550
|
status: "failed"
|
|
55449
55551
|
};
|
|
55450
55552
|
}
|
|
55451
|
-
function toErrorMessage$
|
|
55553
|
+
function toErrorMessage$16(error) {
|
|
55452
55554
|
if (error instanceof Error) {
|
|
55453
55555
|
const message = error.message.trim();
|
|
55454
55556
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -55780,7 +55882,7 @@ async function ensureAgentProfileRuntimeBinding(input) {
|
|
|
55780
55882
|
};
|
|
55781
55883
|
} catch (error) {
|
|
55782
55884
|
console.warn("[openmeld.agent_profile_binding.ensure_failed]", {
|
|
55783
|
-
error: toErrorMessage$
|
|
55885
|
+
error: toErrorMessage$15(error),
|
|
55784
55886
|
event: "cli.agent_profile_binding.ensure_failed",
|
|
55785
55887
|
profileId: input.profile.openMeldProfileId
|
|
55786
55888
|
});
|
|
@@ -55917,7 +56019,7 @@ function orderReasonCodesBySupportRelevance(input) {
|
|
|
55917
56019
|
reasonCodes: input.reasonCodes
|
|
55918
56020
|
}), ...input.reasonCodes]);
|
|
55919
56021
|
}
|
|
55920
|
-
function toErrorMessage$
|
|
56022
|
+
function toErrorMessage$15(error) {
|
|
55921
56023
|
if (error instanceof Error) {
|
|
55922
56024
|
const message = error.message.trim();
|
|
55923
56025
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -56348,6 +56450,195 @@ function resolveOpenCommand() {
|
|
|
56348
56450
|
return "xdg-open";
|
|
56349
56451
|
}
|
|
56350
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
|
|
56351
56642
|
//#region src/commands/auth-status-shared.ts
|
|
56352
56643
|
function buildAuthStatusSnapshot(input) {
|
|
56353
56644
|
const session = input.session;
|
|
@@ -56369,7 +56660,7 @@ function buildAuthStatusSnapshot(input) {
|
|
|
56369
56660
|
expired: false,
|
|
56370
56661
|
activeOrganization: null
|
|
56371
56662
|
};
|
|
56372
|
-
const expiresAt = normalizeOptionalString$
|
|
56663
|
+
const expiresAt = normalizeOptionalString$9(session.expiresAt);
|
|
56373
56664
|
const expiresAtMs = expiresAt ? Date.parse(expiresAt) : NaN;
|
|
56374
56665
|
const hasValidExpiresAt = Number.isFinite(expiresAtMs);
|
|
56375
56666
|
const expiresInMs = hasValidExpiresAt ? expiresAtMs - Date.now() : NaN;
|
|
@@ -56379,14 +56670,14 @@ function buildAuthStatusSnapshot(input) {
|
|
|
56379
56670
|
state: input.state,
|
|
56380
56671
|
...input.reasonCode ? { reasonCode: input.reasonCode } : {},
|
|
56381
56672
|
...input.errorMessage ? { errorMessage: input.errorMessage } : {},
|
|
56382
|
-
userId: normalizeOptionalString$
|
|
56383
|
-
userEmail: normalizeOptionalString$
|
|
56384
|
-
userName: normalizeOptionalString$
|
|
56385
|
-
clientId: normalizeOptionalString$
|
|
56386
|
-
authBaseUrl: normalizeOptionalString$
|
|
56387
|
-
tokenType: normalizeOptionalString$
|
|
56388
|
-
scope: normalizeOptionalString$
|
|
56389
|
-
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),
|
|
56390
56681
|
expiresAt,
|
|
56391
56682
|
expiresIn: hasValidExpiresAt ? formatRemainingDuration(expiresInMs) : null,
|
|
56392
56683
|
expired,
|
|
@@ -56470,7 +56761,7 @@ function appendRowIfValue(rows, label, value) {
|
|
|
56470
56761
|
value
|
|
56471
56762
|
});
|
|
56472
56763
|
}
|
|
56473
|
-
function normalizeOptionalString$
|
|
56764
|
+
function normalizeOptionalString$9(value) {
|
|
56474
56765
|
const normalized = String(value ?? "").trim();
|
|
56475
56766
|
return normalized.length > 0 ? normalized : null;
|
|
56476
56767
|
}
|
|
@@ -56487,8 +56778,196 @@ function formatRemainingDuration(inputMs) {
|
|
|
56487
56778
|
return `${seconds}s`;
|
|
56488
56779
|
}
|
|
56489
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
|
|
56490
56970
|
//#region src/commands/auth.ts
|
|
56491
|
-
const DEFAULT_DEVICE_CLIENT_ID = "openmeld-cli";
|
|
56492
56971
|
const LOGIN_METHOD_DEVICE = "device";
|
|
56493
56972
|
const LOGIN_METHOD_OTT = "ott";
|
|
56494
56973
|
const LOGIN_METHOD_CANCEL = "__auth_login_method_cancel__";
|
|
@@ -56499,8 +56978,6 @@ const DEFAULT_POLL_INTERVAL_SECONDS = 5;
|
|
|
56499
56978
|
const MAX_POLL_INTERVAL_SECONDS = 60;
|
|
56500
56979
|
const MIN_POLL_INTERVAL_SECONDS = 1;
|
|
56501
56980
|
const POLL_PROGRESS_EMIT_INTERVAL_MS = 15e3;
|
|
56502
|
-
const DEVICE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
|
|
56503
|
-
const DEVICE_CLIENT_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{1,63}$/;
|
|
56504
56981
|
const TRAILING_SLASH_PATTERN = /\/+$/;
|
|
56505
56982
|
var DeviceAuthError = class extends Error {
|
|
56506
56983
|
code;
|
|
@@ -56509,13 +56986,6 @@ var DeviceAuthError = class extends Error {
|
|
|
56509
56986
|
this.code = code;
|
|
56510
56987
|
}
|
|
56511
56988
|
};
|
|
56512
|
-
var OneTimeTokenAuthError = class extends Error {
|
|
56513
|
-
code;
|
|
56514
|
-
constructor(code, message) {
|
|
56515
|
-
super(message);
|
|
56516
|
-
this.code = code;
|
|
56517
|
-
}
|
|
56518
|
-
};
|
|
56519
56989
|
var AuthHttpError = class extends Error {
|
|
56520
56990
|
status;
|
|
56521
56991
|
endpoint;
|
|
@@ -56526,6 +56996,7 @@ var AuthHttpError = class extends Error {
|
|
|
56526
56996
|
}
|
|
56527
56997
|
};
|
|
56528
56998
|
async function runAuthLogin(input) {
|
|
56999
|
+
await assertAuthSessionMutationAvailable();
|
|
56529
57000
|
const runtime = await resolveRuntimeContext({ view: input.view });
|
|
56530
57001
|
const presenter = createPresenter(runtime);
|
|
56531
57002
|
emitAuthOverviewIfNeeded({
|
|
@@ -56859,7 +57330,7 @@ async function runDeviceLoginFlow(input) {
|
|
|
56859
57330
|
tokenType: token.token_type ?? "Bearer",
|
|
56860
57331
|
authBaseUrl: input.authBaseUrl,
|
|
56861
57332
|
clientId: input.clientId,
|
|
56862
|
-
expiresAt:
|
|
57333
|
+
expiresAt: resolveDeviceTokenExpiresAt(token.expires_in),
|
|
56863
57334
|
scope: normalizeOptionalString$7(token.scope) ?? void 0,
|
|
56864
57335
|
user: authUser ?? void 0
|
|
56865
57336
|
});
|
|
@@ -56876,28 +57347,44 @@ async function runOneTimeTokenLoginFlow(input) {
|
|
|
56876
57347
|
isHumanView: input.isHumanView,
|
|
56877
57348
|
authBaseUrl: input.authBaseUrl
|
|
56878
57349
|
});
|
|
56879
|
-
const verified = await
|
|
56880
|
-
authBaseUrl: input.authBaseUrl,
|
|
56881
|
-
token: input.token
|
|
56882
|
-
});
|
|
56883
|
-
const authUser = verified.user ?? await fetchAuthUserSnapshot({
|
|
56884
|
-
authBaseUrl: input.authBaseUrl,
|
|
56885
|
-
accessToken: verified.accessToken
|
|
56886
|
-
});
|
|
56887
|
-
await setAuthSession({
|
|
56888
|
-
accessToken: verified.accessToken,
|
|
56889
|
-
tokenType: "Bearer",
|
|
57350
|
+
const verified = await exchangeOneTimeTokenAuthSession({
|
|
56890
57351
|
authBaseUrl: input.authBaseUrl,
|
|
56891
57352
|
clientId: input.clientId,
|
|
56892
|
-
|
|
56893
|
-
user: authUser ?? void 0
|
|
57353
|
+
token: input.token
|
|
56894
57354
|
});
|
|
56895
|
-
|
|
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
|
+
}
|
|
56896
57383
|
emitLineWithHumanSpacer({
|
|
56897
57384
|
presenter: input.presenter,
|
|
56898
57385
|
isHumanView: input.isHumanView,
|
|
56899
57386
|
code: "auth.login.success",
|
|
56900
|
-
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"
|
|
56901
57388
|
});
|
|
56902
57389
|
}
|
|
56903
57390
|
async function assertOneTimeTokenAuthSessionSaved(input) {
|
|
@@ -56957,7 +57444,7 @@ function parseAuthLoginMethod(value) {
|
|
|
56957
57444
|
}
|
|
56958
57445
|
function resolveClientIdForLogin(value, resolvedView) {
|
|
56959
57446
|
try {
|
|
56960
|
-
return
|
|
57447
|
+
return resolveDeviceAuthClientId(value);
|
|
56961
57448
|
} catch (error) {
|
|
56962
57449
|
if (resolvedView === "agent") throw createAuthLoginGuideError(toErrorMessage$13(error));
|
|
56963
57450
|
throw error;
|
|
@@ -57027,6 +57514,7 @@ function emitBrowserOpenLine(input) {
|
|
|
57027
57514
|
});
|
|
57028
57515
|
}
|
|
57029
57516
|
async function runAuthLogout(input) {
|
|
57517
|
+
await assertAuthSessionMutationAvailable();
|
|
57030
57518
|
const runtime = await resolveRuntimeContext({ view: input?.view });
|
|
57031
57519
|
const presenter = createPresenter(runtime);
|
|
57032
57520
|
emitAuthOverviewIfNeeded({
|
|
@@ -57199,47 +57687,13 @@ function resolveDaemonStopWarningText(input) {
|
|
|
57199
57687
|
if (input.reason === "invalid_state") return "OpenMeld found stale local OpenMeld Service runtime state and cleared what it could.";
|
|
57200
57688
|
return formatInlineOpenMeldCliCommands(`OpenMeld could not stop OpenMeld Service cleanly.${input.errorMessage ? ` ${input.errorMessage}` : ""} Run \`openmeld service stop --force\` if it is still running.`);
|
|
57201
57689
|
}
|
|
57202
|
-
async function verifyOneTimeToken(input) {
|
|
57203
|
-
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/one-time-token/verify");
|
|
57204
|
-
const response = await fetch(endpoint, {
|
|
57205
|
-
method: "POST",
|
|
57206
|
-
headers: { "content-type": "application/json" },
|
|
57207
|
-
body: JSON.stringify({ token: input.token }),
|
|
57208
|
-
signal: AbortSignal.timeout(1e4)
|
|
57209
|
-
});
|
|
57210
|
-
const payload = await parseResponseJson(response);
|
|
57211
|
-
if (!response.ok) {
|
|
57212
|
-
const message = extractApiErrorMessage(payload, response.status);
|
|
57213
|
-
const normalizedMessage = message.toLowerCase();
|
|
57214
|
-
if (normalizedMessage.includes("expired")) throw new OneTimeTokenAuthError("expired_token", "one-time token expired; generate a new token and retry");
|
|
57215
|
-
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");
|
|
57216
|
-
if (normalizedMessage.includes("invalid")) throw new OneTimeTokenAuthError("invalid_token", "invalid one-time token; generate a new token and retry");
|
|
57217
|
-
throw new OneTimeTokenAuthError("unknown", `one-time token verification failed: ${message}`);
|
|
57218
|
-
}
|
|
57219
|
-
const accessToken = normalizeOptionalString$7(response.headers.get("set-auth-token"));
|
|
57220
|
-
if (!accessToken) throw new OneTimeTokenAuthError("missing_access_token", "one-time token verified but auth response is missing set-auth-token");
|
|
57221
|
-
return {
|
|
57222
|
-
accessToken,
|
|
57223
|
-
user: readAuthUserFromSessionPayload(payload),
|
|
57224
|
-
expiresAt: readSessionExpiresAtFromPayload(payload)
|
|
57225
|
-
};
|
|
57226
|
-
}
|
|
57227
|
-
function readSessionExpiresAtFromPayload(payload) {
|
|
57228
|
-
if (!(payload && typeof payload === "object" && "session" in payload)) return;
|
|
57229
|
-
const session = payload.session;
|
|
57230
|
-
if (!(session && typeof session === "object")) return;
|
|
57231
|
-
const raw = readOptionalStringField(session, "expiresAt");
|
|
57232
|
-
if (!raw) return;
|
|
57233
|
-
const parsed = new Date(raw);
|
|
57234
|
-
if (Number.isNaN(parsed.getTime())) return;
|
|
57235
|
-
return parsed.toISOString();
|
|
57236
|
-
}
|
|
57237
57690
|
async function requestDeviceCode(input) {
|
|
57238
57691
|
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/device/code");
|
|
57692
|
+
const requestBody = betterAuthDeviceAuthorizationCodeRequestSchema.parse({ client_id: input.clientId });
|
|
57239
57693
|
const response = await fetch(endpoint, {
|
|
57240
57694
|
method: "POST",
|
|
57241
57695
|
headers: { "content-type": "application/json" },
|
|
57242
|
-
body: JSON.stringify(
|
|
57696
|
+
body: JSON.stringify(requestBody),
|
|
57243
57697
|
signal: AbortSignal.timeout(1e4)
|
|
57244
57698
|
});
|
|
57245
57699
|
const payload = await parseResponseJson(response);
|
|
@@ -57248,46 +57702,13 @@ async function requestDeviceCode(input) {
|
|
|
57248
57702
|
status: response.status,
|
|
57249
57703
|
endpoint
|
|
57250
57704
|
});
|
|
57251
|
-
|
|
57252
|
-
|
|
57253
|
-
|
|
57254
|
-
|
|
57255
|
-
|
|
57256
|
-
expires_in: readNumberField(payload, "expires_in"),
|
|
57257
|
-
interval: readNumberField(payload, "interval")
|
|
57258
|
-
};
|
|
57259
|
-
}
|
|
57260
|
-
async function requestDeviceToken(input) {
|
|
57261
|
-
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/device/token");
|
|
57262
|
-
const response = await fetch(endpoint, {
|
|
57263
|
-
method: "POST",
|
|
57264
|
-
headers: { "content-type": "application/json" },
|
|
57265
|
-
body: JSON.stringify({
|
|
57266
|
-
grant_type: DEVICE_GRANT_TYPE,
|
|
57267
|
-
device_code: input.deviceCode,
|
|
57268
|
-
client_id: input.clientId
|
|
57269
|
-
}),
|
|
57270
|
-
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
|
|
57271
57710
|
});
|
|
57272
|
-
|
|
57273
|
-
if (response.ok) return {
|
|
57274
|
-
ok: true,
|
|
57275
|
-
data: {
|
|
57276
|
-
access_token: normalizeRequiredString(readStringField$2(payload, "access_token"), "missing access_token in device token response"),
|
|
57277
|
-
token_type: normalizeOptionalString$7(readStringField$2(payload, "token_type")) ?? void 0,
|
|
57278
|
-
expires_in: readNumberField(payload, "expires_in"),
|
|
57279
|
-
scope: normalizeOptionalString$7(readStringField$2(payload, "scope")) ?? void 0
|
|
57280
|
-
}
|
|
57281
|
-
};
|
|
57282
|
-
return {
|
|
57283
|
-
ok: false,
|
|
57284
|
-
error: {
|
|
57285
|
-
error: normalizeOptionalString$7(readStringField$2(payload, "error")) ?? void 0,
|
|
57286
|
-
error_description: normalizeOptionalString$7(readStringField$2(payload, "error_description")) ?? void 0,
|
|
57287
|
-
message: normalizeOptionalString$7(readStringField$2(payload, "message")) ?? void 0
|
|
57288
|
-
},
|
|
57289
|
-
status: response.status
|
|
57290
|
-
};
|
|
57711
|
+
return parsed.data;
|
|
57291
57712
|
}
|
|
57292
57713
|
async function pollForDeviceToken(input) {
|
|
57293
57714
|
const deadline = Date.now() + input.expiresInSeconds * 1e3;
|
|
@@ -57326,7 +57747,7 @@ async function pollForDeviceToken(input) {
|
|
|
57326
57747
|
if (errorCode === "access_denied") throw new DeviceAuthError("access_denied", "browser sign-in was canceled");
|
|
57327
57748
|
if (errorCode === "expired_token") throw new DeviceAuthError("expired_token", "browser sign-in expired; sign in again");
|
|
57328
57749
|
if (errorCode === "invalid_grant") throw new DeviceAuthError("invalid_grant", "browser sign-in is no longer valid; sign in again");
|
|
57329
|
-
throw new DeviceAuthError("unknown", `browser sign-in failed: ${
|
|
57750
|
+
throw new DeviceAuthError("unknown", `browser sign-in failed: ${extractAuthApiErrorMessage(result.error, result.status)}`);
|
|
57330
57751
|
}
|
|
57331
57752
|
throw new DeviceAuthError("expired_token", "browser sign-in timed out; sign in again");
|
|
57332
57753
|
}
|
|
@@ -57359,23 +57780,9 @@ function resolveExpiresInSeconds(value) {
|
|
|
57359
57780
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return 1800;
|
|
57360
57781
|
return clampInteger(value, 60, 1440 * 60);
|
|
57361
57782
|
}
|
|
57362
|
-
function resolveExpiresAt(expiresIn) {
|
|
57363
|
-
if (typeof expiresIn !== "number" || !Number.isFinite(expiresIn) || expiresIn <= 0) return;
|
|
57364
|
-
const now = Date.now();
|
|
57365
|
-
const maxFutureMs = Math.max(0, Math.min(Number.MAX_SAFE_INTEGER, 864e13) - now);
|
|
57366
|
-
const maxFutureSeconds = Math.floor(maxFutureMs / 1e3);
|
|
57367
|
-
const safeExpiresInSeconds = Math.min(Math.floor(expiresIn), maxFutureSeconds);
|
|
57368
|
-
if (safeExpiresInSeconds <= 0) return;
|
|
57369
|
-
return new Date(now + safeExpiresInSeconds * 1e3).toISOString();
|
|
57370
|
-
}
|
|
57371
57783
|
function clampInteger(value, min, max) {
|
|
57372
57784
|
return Math.max(min, Math.min(max, Math.floor(value)));
|
|
57373
57785
|
}
|
|
57374
|
-
function resolveClientId(value) {
|
|
57375
|
-
const clientId = normalizeOptionalString$7(value) ?? normalizeOptionalString$7(process.env.OPENMELD_AUTH_CLIENT_ID) ?? DEFAULT_DEVICE_CLIENT_ID;
|
|
57376
|
-
if (!DEVICE_CLIENT_ID_PATTERN.test(clientId)) throw new Error(`invalid client_id "${clientId}" (allowed: letters, numbers, . _ : -)`);
|
|
57377
|
-
return clientId;
|
|
57378
|
-
}
|
|
57379
57786
|
function normalizeRequiredString(value, message) {
|
|
57380
57787
|
const normalized = normalizeOptionalString$7(value);
|
|
57381
57788
|
if (!normalized) throw new Error(message);
|
|
@@ -57394,11 +57801,6 @@ function readStringField$2(payload, key) {
|
|
|
57394
57801
|
const value = payload[key];
|
|
57395
57802
|
return typeof value === "string" ? value : null;
|
|
57396
57803
|
}
|
|
57397
|
-
function readNumberField(payload, key) {
|
|
57398
|
-
if (!(payload && typeof payload === "object" && key in payload)) return;
|
|
57399
|
-
const value = payload[key];
|
|
57400
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
57401
|
-
}
|
|
57402
57804
|
async function parseResponseJson(response) {
|
|
57403
57805
|
const raw = await response.text();
|
|
57404
57806
|
if (!raw) return null;
|
|
@@ -57459,45 +57861,11 @@ function emitLineWithHumanSpacer(input) {
|
|
|
57459
57861
|
text: ""
|
|
57460
57862
|
});
|
|
57461
57863
|
}
|
|
57462
|
-
async function fetchAuthUserSnapshot(input) {
|
|
57463
|
-
const endpoint = toAuthEndpoint$1(input.authBaseUrl, "/api/auth/get-session");
|
|
57464
|
-
try {
|
|
57465
|
-
const response = await fetch(endpoint, {
|
|
57466
|
-
method: "GET",
|
|
57467
|
-
headers: { authorization: `Bearer ${input.accessToken}` },
|
|
57468
|
-
signal: AbortSignal.timeout(1e4)
|
|
57469
|
-
});
|
|
57470
|
-
if (!response.ok) return null;
|
|
57471
|
-
return readAuthUserFromSessionPayload(await parseResponseJson(response));
|
|
57472
|
-
} catch {
|
|
57473
|
-
return null;
|
|
57474
|
-
}
|
|
57475
|
-
}
|
|
57476
|
-
function readAuthUserFromSessionPayload(payload) {
|
|
57477
|
-
if (!(payload && typeof payload === "object" && "user" in payload)) return null;
|
|
57478
|
-
const user = payload.user;
|
|
57479
|
-
if (!(user && typeof user === "object")) return null;
|
|
57480
|
-
const userRecord = user;
|
|
57481
|
-
const id = readOptionalStringField(userRecord, "id");
|
|
57482
|
-
const email = readOptionalStringField(userRecord, "email");
|
|
57483
|
-
const name = readOptionalStringField(userRecord, "name");
|
|
57484
|
-
if (!(id || email || name)) return null;
|
|
57485
|
-
return {
|
|
57486
|
-
...id ? { id } : {},
|
|
57487
|
-
...email ? { email } : {},
|
|
57488
|
-
...name ? { name } : {}
|
|
57489
|
-
};
|
|
57490
|
-
}
|
|
57491
57864
|
function resolveHumanLoginSuccessText(user) {
|
|
57492
57865
|
const email = normalizeOptionalString$7(user?.email);
|
|
57493
57866
|
if (email) return `✅ Welcome ${email}`;
|
|
57494
57867
|
return "✅ Signed in.";
|
|
57495
57868
|
}
|
|
57496
|
-
function readOptionalStringField(input, key) {
|
|
57497
|
-
const value = input[key];
|
|
57498
|
-
if (typeof value !== "string") return;
|
|
57499
|
-
return normalizeOptionalString$7(value) ?? void 0;
|
|
57500
|
-
}
|
|
57501
57869
|
function toDeviceAuthError(error) {
|
|
57502
57870
|
if (error instanceof DeviceAuthError) return error;
|
|
57503
57871
|
if (error instanceof Error) return new DeviceAuthError("unknown", error.message);
|
|
@@ -58887,7 +59255,7 @@ function flushDispatchResultOutbox(input) {
|
|
|
58887
59255
|
return {
|
|
58888
59256
|
...record,
|
|
58889
59257
|
attemptCount: record.attemptCount + 1,
|
|
58890
|
-
lastFailureReason: toErrorMessage$
|
|
59258
|
+
lastFailureReason: toErrorMessage$32(error),
|
|
58891
59259
|
nextAttemptAtMs: nowMs + resolveSendFailureBackoffMs(record.attemptCount + 1),
|
|
58892
59260
|
updatedAtMs: nowMs
|
|
58893
59261
|
};
|
|
@@ -60865,7 +61233,7 @@ async function runAttempt(attempt, deps) {
|
|
|
60865
61233
|
} catch (error) {
|
|
60866
61234
|
await deps.completeAttempt({
|
|
60867
61235
|
...running,
|
|
60868
|
-
errorMessage: toErrorMessage$
|
|
61236
|
+
errorMessage: toErrorMessage$43(error),
|
|
60869
61237
|
operation: {
|
|
60870
61238
|
...running.operation,
|
|
60871
61239
|
phase: "needs_help",
|
|
@@ -61129,7 +61497,7 @@ async function persistRuntimeReportingAttempt(attempt, serviceIdentity) {
|
|
|
61129
61497
|
});
|
|
61130
61498
|
} catch (error) {
|
|
61131
61499
|
warnDaemonEvent("[openmeld.runtime_reporting.health_write_failed]", {
|
|
61132
|
-
error: toErrorMessage$
|
|
61500
|
+
error: toErrorMessage$32(error),
|
|
61133
61501
|
event: "cli.runtime_reporting.health_write_failed",
|
|
61134
61502
|
family: attempt.family,
|
|
61135
61503
|
reasonCode: attempt.reasonCode,
|
|
@@ -65152,7 +65520,7 @@ function resolveSystemServiceStartupFailureVerdict(input) {
|
|
|
65152
65520
|
controller: input.controller,
|
|
65153
65521
|
jobDiagnostics,
|
|
65154
65522
|
localMachineIssue,
|
|
65155
|
-
message: sanitizeSystemServiceErrorMessage$1(toErrorMessage$
|
|
65523
|
+
message: sanitizeSystemServiceErrorMessage$1(toErrorMessage$43(input.error)),
|
|
65156
65524
|
detail: input.detail ?? null
|
|
65157
65525
|
};
|
|
65158
65526
|
}
|
|
@@ -65671,7 +66039,7 @@ async function runDaemonServiceParticipationRefresh(input) {
|
|
|
65671
66039
|
suppressed: input.input.suppressRefreshHumanResultCard === true
|
|
65672
66040
|
});
|
|
65673
66041
|
return {
|
|
65674
|
-
errorMessage: toErrorMessage$
|
|
66042
|
+
errorMessage: toErrorMessage$32(error),
|
|
65675
66043
|
status: "needs_attention"
|
|
65676
66044
|
};
|
|
65677
66045
|
}
|
|
@@ -67454,6 +67822,66 @@ function summarizeSubmissions(submissions) {
|
|
|
67454
67822
|
};
|
|
67455
67823
|
}
|
|
67456
67824
|
//#endregion
|
|
67825
|
+
//#region src/local-service/routing/active-permission-mode-sync.ts
|
|
67826
|
+
async function syncActiveTaskPermissionModes(input) {
|
|
67827
|
+
const outcomes = [];
|
|
67828
|
+
for (const task of input.inflightTaskControlRegistry.listTasks()) {
|
|
67829
|
+
if (!task.targetProfileId) continue;
|
|
67830
|
+
const nextPermissionMode = input.catalogState.routeByProfileId.get(task.targetProfileId)?.agentControllerPermissionMode;
|
|
67831
|
+
if (!nextPermissionMode || nextPermissionMode === task.agentControllerPermissionMode) continue;
|
|
67832
|
+
const updatePermissionMode = input.localAdapterContainer.getAdapter(task.adapterId)?.adapter.updatePermissionMode;
|
|
67833
|
+
if (!updatePermissionMode) {
|
|
67834
|
+
outcomes.push({
|
|
67835
|
+
adapterId: task.adapterId,
|
|
67836
|
+
agentControllerPermissionMode: nextPermissionMode,
|
|
67837
|
+
reasonCode: "adapter.permission_mode_update_unsupported",
|
|
67838
|
+
status: "not_applied",
|
|
67839
|
+
targetProfileId: task.targetProfileId,
|
|
67840
|
+
taskId: task.taskId
|
|
67841
|
+
});
|
|
67842
|
+
continue;
|
|
67843
|
+
}
|
|
67844
|
+
try {
|
|
67845
|
+
const result = await updatePermissionMode({
|
|
67846
|
+
agentControllerPermissionMode: nextPermissionMode,
|
|
67847
|
+
taskId: task.taskId
|
|
67848
|
+
});
|
|
67849
|
+
if (result.status === "not_applied") {
|
|
67850
|
+
outcomes.push({
|
|
67851
|
+
adapterId: task.adapterId,
|
|
67852
|
+
agentControllerPermissionMode: nextPermissionMode,
|
|
67853
|
+
reasonCode: result.reasonCode,
|
|
67854
|
+
status: "not_applied",
|
|
67855
|
+
targetProfileId: task.targetProfileId,
|
|
67856
|
+
taskId: task.taskId
|
|
67857
|
+
});
|
|
67858
|
+
continue;
|
|
67859
|
+
}
|
|
67860
|
+
input.inflightTaskControlRegistry.updateTaskPermissionMode({
|
|
67861
|
+
agentControllerPermissionMode: nextPermissionMode,
|
|
67862
|
+
taskId: task.taskId
|
|
67863
|
+
});
|
|
67864
|
+
outcomes.push({
|
|
67865
|
+
adapterId: task.adapterId,
|
|
67866
|
+
agentControllerPermissionMode: nextPermissionMode,
|
|
67867
|
+
status: "applied",
|
|
67868
|
+
targetProfileId: task.targetProfileId,
|
|
67869
|
+
taskId: task.taskId
|
|
67870
|
+
});
|
|
67871
|
+
} catch (error) {
|
|
67872
|
+
outcomes.push({
|
|
67873
|
+
adapterId: task.adapterId,
|
|
67874
|
+
agentControllerPermissionMode: nextPermissionMode,
|
|
67875
|
+
errorMessage: error instanceof Error ? error.message : String(error),
|
|
67876
|
+
status: "failed",
|
|
67877
|
+
targetProfileId: task.targetProfileId,
|
|
67878
|
+
taskId: task.taskId
|
|
67879
|
+
});
|
|
67880
|
+
}
|
|
67881
|
+
}
|
|
67882
|
+
return outcomes;
|
|
67883
|
+
}
|
|
67884
|
+
//#endregion
|
|
67457
67885
|
//#region src/local-service/session-control/fork-agent-session.ts
|
|
67458
67886
|
const PROVIDER_PROBE_TIMEOUT_MS = 5e3;
|
|
67459
67887
|
const PROVIDER_FORK_TIMEOUT_MS = 3e4;
|
|
@@ -67806,7 +68234,7 @@ function toTaskExecutionError(error) {
|
|
|
67806
68234
|
return {
|
|
67807
68235
|
errorCode: "dispatch.execution_failed",
|
|
67808
68236
|
errorType: "internal",
|
|
67809
|
-
message: toErrorMessage$
|
|
68237
|
+
message: toErrorMessage$32(error)
|
|
67810
68238
|
};
|
|
67811
68239
|
}
|
|
67812
68240
|
//#endregion
|
|
@@ -69637,7 +70065,7 @@ function reportInvalidDeliverRequest(input) {
|
|
|
69637
70065
|
leaseEpoch: identity.leaseEpoch,
|
|
69638
70066
|
metadata: {
|
|
69639
70067
|
...buildResultDispatchJournalMetadata(resultPayload),
|
|
69640
|
-
errorMessage: toErrorMessage$
|
|
70068
|
+
errorMessage: toErrorMessage$32(error),
|
|
69641
70069
|
parseIssues: issues
|
|
69642
70070
|
},
|
|
69643
70071
|
profileId: identity.targetProfileId,
|
|
@@ -69648,10 +70076,10 @@ function reportInvalidDeliverRequest(input) {
|
|
|
69648
70076
|
emitRunLine({
|
|
69649
70077
|
presenter: input.presenter,
|
|
69650
70078
|
code: "daemon.run.invalid_deliver_result_send_failed",
|
|
69651
|
-
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)}`,
|
|
69652
70080
|
payload: {
|
|
69653
70081
|
dispatchId: identity.dispatchId,
|
|
69654
|
-
errorMessage: toErrorMessage$
|
|
70082
|
+
errorMessage: toErrorMessage$32(error),
|
|
69655
70083
|
result: "failed",
|
|
69656
70084
|
taskId: identity.taskId
|
|
69657
70085
|
}
|
|
@@ -69814,8 +70242,10 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
69814
70242
|
let firstOutputEvidenceSent = false;
|
|
69815
70243
|
input.inflightTaskControlRegistry.registerTask({
|
|
69816
70244
|
adapterId: runtimeControllerSupport.runtimeAdapterMatch.adapterId,
|
|
70245
|
+
agentControllerPermissionMode: routeConfig?.agentControllerPermissionMode ?? null,
|
|
69817
70246
|
dispatchId: parsedTask.dispatchId,
|
|
69818
70247
|
runtimeCoordinatorExecutionId: parsedTask.runtimeCoordinatorExecutionId,
|
|
70248
|
+
targetProfileId: parsedTask.targetProfileId,
|
|
69819
70249
|
taskId: parsedTask.taskId
|
|
69820
70250
|
});
|
|
69821
70251
|
const runtimeStartedAtMs = Date.now();
|
|
@@ -70102,7 +70532,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70102
70532
|
text: `Session Inventory origin could not be recorded for task ${parsedTask.taskId}`,
|
|
70103
70533
|
payload: {
|
|
70104
70534
|
dispatchId: parsedTask.dispatchId,
|
|
70105
|
-
errorMessage: toErrorMessage$
|
|
70535
|
+
errorMessage: toErrorMessage$32(error),
|
|
70106
70536
|
targetProfileId: parsedTask.targetProfileId,
|
|
70107
70537
|
taskId: parsedTask.taskId
|
|
70108
70538
|
}
|
|
@@ -70135,7 +70565,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70135
70565
|
text: `provider conversation observation could not be persisted for task ${parsedTask.taskId}`,
|
|
70136
70566
|
payload: {
|
|
70137
70567
|
dispatchId: parsedTask.dispatchId,
|
|
70138
|
-
errorMessage: toErrorMessage$
|
|
70568
|
+
errorMessage: toErrorMessage$32(error),
|
|
70139
70569
|
source: observation.source,
|
|
70140
70570
|
targetProfileId: parsedTask.targetProfileId,
|
|
70141
70571
|
taskId: parsedTask.taskId
|
|
@@ -70219,7 +70649,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
70219
70649
|
payload: {
|
|
70220
70650
|
agentControllerRef: parsedTask.agentControllerRef,
|
|
70221
70651
|
dispatchId: parsedTask.dispatchId,
|
|
70222
|
-
errorMessage: toErrorMessage$
|
|
70652
|
+
errorMessage: toErrorMessage$32(error),
|
|
70223
70653
|
observedLimitKeys: event.usageLimits.map((limit) => limit.key),
|
|
70224
70654
|
targetProfileId: parsedTask.targetProfileId,
|
|
70225
70655
|
taskId: parsedTask.taskId
|
|
@@ -70904,7 +71334,7 @@ async function resolveDispatchSpaceMetaContext(input) {
|
|
|
70904
71334
|
} catch (error) {
|
|
70905
71335
|
return {
|
|
70906
71336
|
status: "failed",
|
|
70907
|
-
errorMessage: toErrorMessage$
|
|
71337
|
+
errorMessage: toErrorMessage$32(error),
|
|
70908
71338
|
spaceGuide: null,
|
|
70909
71339
|
spaceName: null,
|
|
70910
71340
|
spacePurpose: null
|
|
@@ -71278,7 +71708,7 @@ async function resolveAlreadyCompletedRuntimeResultAfterCliSpaceAction(input) {
|
|
|
71278
71708
|
text: `runtime failed after CLI OpenMeld Space Action finalized task ${input.parsedTask.taskId}`,
|
|
71279
71709
|
payload: {
|
|
71280
71710
|
dispatchId: input.parsedTask.dispatchId,
|
|
71281
|
-
errorMessage: toErrorMessage$
|
|
71711
|
+
errorMessage: toErrorMessage$32(error),
|
|
71282
71712
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
71283
71713
|
taskId: input.parsedTask.taskId
|
|
71284
71714
|
}
|
|
@@ -71296,7 +71726,7 @@ function observeRuntimeResultAfterCliSpaceAction(input) {
|
|
|
71296
71726
|
text: `runtime failed after CLI OpenMeld Space Action finalized task ${input.parsedTask.taskId}`,
|
|
71297
71727
|
payload: {
|
|
71298
71728
|
dispatchId: input.parsedTask.dispatchId,
|
|
71299
|
-
errorMessage: toErrorMessage$
|
|
71729
|
+
errorMessage: toErrorMessage$32(error),
|
|
71300
71730
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
71301
71731
|
taskId: input.parsedTask.taskId
|
|
71302
71732
|
}
|
|
@@ -71544,7 +71974,7 @@ async function coordinateConcurrentAgentReply(input) {
|
|
|
71544
71974
|
text: `Agent reply observation unavailable for task ${input.parsedTask.taskId}`,
|
|
71545
71975
|
payload: {
|
|
71546
71976
|
dispatchId: input.parsedTask.dispatchId,
|
|
71547
|
-
errorMessage: toErrorMessage$
|
|
71977
|
+
errorMessage: toErrorMessage$32(error),
|
|
71548
71978
|
observedThroughSignalId,
|
|
71549
71979
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
71550
71980
|
taskId: input.parsedTask.taskId
|
|
@@ -71716,7 +72146,7 @@ function normalizeResolvedPostMessageAction(input) {
|
|
|
71716
72146
|
resolvedSpaceAction: normalizedPostMessageAction.action
|
|
71717
72147
|
};
|
|
71718
72148
|
} catch (error) {
|
|
71719
|
-
const failureReason = toErrorMessage$
|
|
72149
|
+
const failureReason = toErrorMessage$32(error);
|
|
71720
72150
|
emitRunLine({
|
|
71721
72151
|
presenter: input.presenter,
|
|
71722
72152
|
code: "daemon.run.post_message_validation_rejected",
|
|
@@ -71778,7 +72208,7 @@ function normalizeResolvedThreadAction(input) {
|
|
|
71778
72208
|
})
|
|
71779
72209
|
};
|
|
71780
72210
|
} catch (error) {
|
|
71781
|
-
const failureReason = toErrorMessage$
|
|
72211
|
+
const failureReason = toErrorMessage$32(error);
|
|
71782
72212
|
emitRunLine({
|
|
71783
72213
|
presenter: input.presenter,
|
|
71784
72214
|
code: "daemon.run.thread_action_validation_rejected",
|
|
@@ -71861,7 +72291,7 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
71861
72291
|
dispatchId: input.parsedTask.dispatchId,
|
|
71862
72292
|
...resolveStructuredActionFailureDiagnostics({
|
|
71863
72293
|
carrierKind: "none",
|
|
71864
|
-
parseError: toErrorMessage$
|
|
72294
|
+
parseError: toErrorMessage$32(error),
|
|
71865
72295
|
publicFailureReason: input.failureReason,
|
|
71866
72296
|
repairMode: "controller_roundtrip",
|
|
71867
72297
|
runtimeResult: input.runtimeResult
|
|
@@ -71877,7 +72307,7 @@ async function maybeRepairStructuredSpaceAction(input) {
|
|
|
71877
72307
|
return {
|
|
71878
72308
|
finalFailureDiagnostics: resolveStructuredActionFailureDiagnostics({
|
|
71879
72309
|
carrierKind: "none",
|
|
71880
|
-
parseError: toErrorMessage$
|
|
72310
|
+
parseError: toErrorMessage$32(error),
|
|
71881
72311
|
publicFailureReason: input.failureReason,
|
|
71882
72312
|
repairMode: "controller_roundtrip",
|
|
71883
72313
|
runtimeResult: input.runtimeResult
|
|
@@ -72320,7 +72750,7 @@ function sendResultAndSummarize(input) {
|
|
|
72320
72750
|
leaseEpoch: input.leaseEpoch,
|
|
72321
72751
|
metadata: {
|
|
72322
72752
|
...buildResultDispatchJournalMetadata(input.payload),
|
|
72323
|
-
errorMessage: toErrorMessage$
|
|
72753
|
+
errorMessage: toErrorMessage$32(error)
|
|
72324
72754
|
},
|
|
72325
72755
|
result: input.payload.status,
|
|
72326
72756
|
taskId: input.taskId,
|
|
@@ -72329,7 +72759,7 @@ function sendResultAndSummarize(input) {
|
|
|
72329
72759
|
emitRunLine({
|
|
72330
72760
|
presenter: input.presenter,
|
|
72331
72761
|
code: "daemon.run.result_send_failed",
|
|
72332
|
-
text: `daemon result send failed for dispatch ${input.dispatchId}: ${toErrorMessage$
|
|
72762
|
+
text: `daemon result send failed for dispatch ${input.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72333
72763
|
payload: {
|
|
72334
72764
|
attemptId: input.attemptId,
|
|
72335
72765
|
connectionGeneration: input.connectionGeneration,
|
|
@@ -72434,7 +72864,7 @@ async function requestDispatchAgentInteraction(input) {
|
|
|
72434
72864
|
taskId: input.parsedTask.taskId
|
|
72435
72865
|
});
|
|
72436
72866
|
} catch (error) {
|
|
72437
|
-
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)));
|
|
72438
72868
|
throw error;
|
|
72439
72869
|
}
|
|
72440
72870
|
emitRunLine({
|
|
@@ -72470,7 +72900,7 @@ function emitDispatchPreviewFrame(input) {
|
|
|
72470
72900
|
emitRunLine({
|
|
72471
72901
|
presenter: input.presenter,
|
|
72472
72902
|
code: "daemon.run.preview_send_failed",
|
|
72473
|
-
text: `daemon preview send failed for dispatch ${input.dispatchId}: ${toErrorMessage$
|
|
72903
|
+
text: `daemon preview send failed for dispatch ${input.dispatchId}: ${toErrorMessage$32(error)}`,
|
|
72474
72904
|
payload: {
|
|
72475
72905
|
attemptId: input.attemptId,
|
|
72476
72906
|
dispatchId: input.dispatchId,
|
|
@@ -72512,7 +72942,7 @@ function emitDispatchAgentToolActivityFrame(input) {
|
|
|
72512
72942
|
emitRunLine({
|
|
72513
72943
|
presenter: input.presenter,
|
|
72514
72944
|
code: "daemon.run.tool_activity_send_failed",
|
|
72515
|
-
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)}`,
|
|
72516
72946
|
payload: {
|
|
72517
72947
|
attemptId: input.parsedTask.attemptId,
|
|
72518
72948
|
dispatchId: input.parsedTask.dispatchId,
|
|
@@ -72541,7 +72971,7 @@ function emitDispatchPreviewEndFrame(input) {
|
|
|
72541
72971
|
emitRunLine({
|
|
72542
72972
|
presenter: input.presenter,
|
|
72543
72973
|
code: "daemon.run.preview_end_send_failed",
|
|
72544
|
-
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)}`,
|
|
72545
72975
|
payload: {
|
|
72546
72976
|
attemptId: input.attemptId,
|
|
72547
72977
|
dispatchId: input.dispatchId,
|
|
@@ -72583,7 +73013,7 @@ function emitDispatchRuntimeEvidenceTransition(input) {
|
|
|
72583
73013
|
emitRunLine({
|
|
72584
73014
|
presenter: input.presenter,
|
|
72585
73015
|
code: "daemon.run.runtime_evidence_send_failed",
|
|
72586
|
-
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)}`,
|
|
72587
73017
|
payload: {
|
|
72588
73018
|
attemptId: identity.attemptId,
|
|
72589
73019
|
dispatchId: identity.dispatchId,
|
|
@@ -72682,7 +73112,7 @@ function emitDispatchLifecycleTransition(input) {
|
|
|
72682
73112
|
dispatchId: input.dispatchId,
|
|
72683
73113
|
leaseEpoch: input.leaseEpoch,
|
|
72684
73114
|
metadata: {
|
|
72685
|
-
errorMessage: toErrorMessage$
|
|
73115
|
+
errorMessage: toErrorMessage$32(error),
|
|
72686
73116
|
localQueue: input.localQueue ?? null,
|
|
72687
73117
|
phase: input.phase
|
|
72688
73118
|
},
|
|
@@ -72693,7 +73123,7 @@ function emitDispatchLifecycleTransition(input) {
|
|
|
72693
73123
|
emitRunLine({
|
|
72694
73124
|
presenter: input.presenter,
|
|
72695
73125
|
code: "daemon.run.lifecycle_send_failed",
|
|
72696
|
-
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)}`,
|
|
72697
73127
|
payload: {
|
|
72698
73128
|
attemptId: input.attemptId,
|
|
72699
73129
|
dispatchId: input.dispatchId,
|
|
@@ -73120,7 +73550,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73120
73550
|
emitRunLine({
|
|
73121
73551
|
presenter: input.presenter,
|
|
73122
73552
|
code: "daemon.run.control_cancel_failed",
|
|
73123
|
-
text: `local cancel handling failed: ${toErrorMessage$
|
|
73553
|
+
text: `local cancel handling failed: ${toErrorMessage$32(error)}`,
|
|
73124
73554
|
payload: {
|
|
73125
73555
|
requestId: parsedCancelFrame.data.requestId,
|
|
73126
73556
|
target: parsedCancelFrame.data.payload.target
|
|
@@ -73132,7 +73562,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73132
73562
|
requestId: parsedCancelFrame.data.requestId,
|
|
73133
73563
|
payload: {
|
|
73134
73564
|
accepted: false,
|
|
73135
|
-
note: toErrorMessage$
|
|
73565
|
+
note: toErrorMessage$32(error),
|
|
73136
73566
|
reasonCode: "local_control.unhandled_error",
|
|
73137
73567
|
target: parsedCancelFrame.data.payload.target
|
|
73138
73568
|
}
|
|
@@ -73168,7 +73598,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73168
73598
|
emitRunLine({
|
|
73169
73599
|
presenter: input.presenter,
|
|
73170
73600
|
code: "daemon.run.control_interrupt_failed",
|
|
73171
|
-
text: `local interrupt handling failed: ${toErrorMessage$
|
|
73601
|
+
text: `local interrupt handling failed: ${toErrorMessage$32(error)}`,
|
|
73172
73602
|
payload: {
|
|
73173
73603
|
requestId: parsedInterruptFrame.data.requestId,
|
|
73174
73604
|
target: parsedInterruptFrame.data.payload.target
|
|
@@ -73180,7 +73610,7 @@ function handleDaemonSocketFrame(input) {
|
|
|
73180
73610
|
requestId: parsedInterruptFrame.data.requestId,
|
|
73181
73611
|
payload: {
|
|
73182
73612
|
accepted: false,
|
|
73183
|
-
note: toErrorMessage$
|
|
73613
|
+
note: toErrorMessage$32(error),
|
|
73184
73614
|
reasonCode: "local_control.unhandled_error",
|
|
73185
73615
|
target: parsedInterruptFrame.data.payload.target
|
|
73186
73616
|
}
|
|
@@ -73371,7 +73801,7 @@ function handleComputerFileAccessSocketFrame(input) {
|
|
|
73371
73801
|
emitRunLine({
|
|
73372
73802
|
presenter: input.presenter,
|
|
73373
73803
|
code: "daemon.run.computer_file_access_failed",
|
|
73374
|
-
text: `Computer file access failed: ${toErrorMessage$
|
|
73804
|
+
text: `Computer file access failed: ${toErrorMessage$32(error)}`
|
|
73375
73805
|
});
|
|
73376
73806
|
});
|
|
73377
73807
|
return true;
|
|
@@ -73390,14 +73820,14 @@ function handleLocalProjectControlSocketFrame(input) {
|
|
|
73390
73820
|
emitRunLine({
|
|
73391
73821
|
presenter: input.presenter,
|
|
73392
73822
|
code: "daemon.run.agent_activity_connection_signal_failed",
|
|
73393
|
-
text: `Agent Activity connection signal failed: ${toErrorMessage$
|
|
73823
|
+
text: `Agent Activity connection signal failed: ${toErrorMessage$32(error)}`
|
|
73394
73824
|
});
|
|
73395
73825
|
}
|
|
73396
73826
|
}).catch((error) => {
|
|
73397
73827
|
emitRunLine({
|
|
73398
73828
|
presenter: input.presenter,
|
|
73399
73829
|
code: "daemon.run.local_project_control_failed",
|
|
73400
|
-
text: `local Project control failed: ${toErrorMessage$
|
|
73830
|
+
text: `local Project control failed: ${toErrorMessage$32(error)}`
|
|
73401
73831
|
});
|
|
73402
73832
|
});
|
|
73403
73833
|
return true;
|
|
@@ -73612,7 +74042,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73612
74042
|
function recordHeartbeatFailure(error) {
|
|
73613
74043
|
consecutiveHeartbeatFailures += 1;
|
|
73614
74044
|
const shouldCloseSocket = consecutiveHeartbeatFailures >= 3;
|
|
73615
|
-
const errorMessage = toErrorMessage$
|
|
74045
|
+
const errorMessage = toErrorMessage$32(error);
|
|
73616
74046
|
emitRunLine({
|
|
73617
74047
|
presenter: input.presenter,
|
|
73618
74048
|
code: "daemon.run.heartbeat_failed",
|
|
@@ -73805,7 +74235,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73805
74235
|
emitRunLine({
|
|
73806
74236
|
presenter: input.presenter,
|
|
73807
74237
|
code: "daemon.run.heartbeat_failed",
|
|
73808
|
-
text: `heartbeat failed: ${toErrorMessage$
|
|
74238
|
+
text: `heartbeat failed: ${toErrorMessage$32(error)}`
|
|
73809
74239
|
});
|
|
73810
74240
|
});
|
|
73811
74241
|
}, normalizedDelayMs);
|
|
@@ -73847,7 +74277,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73847
74277
|
emitRunLine({
|
|
73848
74278
|
presenter: input.presenter,
|
|
73849
74279
|
code: "daemon.run.catalog_sync_signal_read_failed",
|
|
73850
|
-
text: `catalog sync signal read failed: ${toErrorMessage$
|
|
74280
|
+
text: `catalog sync signal read failed: ${toErrorMessage$32(error)}`
|
|
73851
74281
|
});
|
|
73852
74282
|
}).finally(() => {
|
|
73853
74283
|
scheduleCatalogSyncSignalPoll();
|
|
@@ -73908,7 +74338,7 @@ async function runDaemonSocketSession(input) {
|
|
|
73908
74338
|
emitRunLine({
|
|
73909
74339
|
presenter: input.presenter,
|
|
73910
74340
|
code: "daemon.run.local_components_status_failed",
|
|
73911
|
-
text: `local components status unavailable: ${toErrorMessage$
|
|
74341
|
+
text: `local components status unavailable: ${toErrorMessage$32(error)}`
|
|
73912
74342
|
});
|
|
73913
74343
|
return null;
|
|
73914
74344
|
}
|
|
@@ -74072,6 +74502,14 @@ async function runDaemonSocketSession(input) {
|
|
|
74072
74502
|
}),
|
|
74073
74503
|
registerCatalog: registerDaemonSession
|
|
74074
74504
|
});
|
|
74505
|
+
if (syncResult.status !== "failed") {
|
|
74506
|
+
const permissionModeOutcomes = await syncActiveTaskPermissionModes({
|
|
74507
|
+
catalogState: input.routeCatalogState,
|
|
74508
|
+
inflightTaskControlRegistry: input.inflightTaskControlRegistry,
|
|
74509
|
+
localAdapterContainer: input.localAdapterContainer
|
|
74510
|
+
});
|
|
74511
|
+
emitActivePermissionModeSyncOutcomes(permissionModeOutcomes);
|
|
74512
|
+
}
|
|
74075
74513
|
if (syncResult.status === "changed") {
|
|
74076
74514
|
await handleChangedCatalogSync(syncResult, inputSync);
|
|
74077
74515
|
resolvePendingRouteCatalogSyncRequests(syncResult);
|
|
@@ -74090,17 +74528,36 @@ async function runDaemonSocketSession(input) {
|
|
|
74090
74528
|
handleFailedCatalogSync(syncResult);
|
|
74091
74529
|
resolvePendingRouteCatalogSyncRequests(syncResult);
|
|
74092
74530
|
};
|
|
74531
|
+
const emitActivePermissionModeSyncOutcomes = (outcomes) => {
|
|
74532
|
+
for (const outcome of outcomes) {
|
|
74533
|
+
if (outcome.status === "applied") {
|
|
74534
|
+
emitRunLine({
|
|
74535
|
+
presenter: input.presenter,
|
|
74536
|
+
code: "daemon.run.active_permission_mode_updated",
|
|
74537
|
+
text: `updated permission mode for active task ${outcome.taskId}`,
|
|
74538
|
+
payload: outcome
|
|
74539
|
+
});
|
|
74540
|
+
continue;
|
|
74541
|
+
}
|
|
74542
|
+
emitRunLine({
|
|
74543
|
+
presenter: input.presenter,
|
|
74544
|
+
code: outcome.status === "failed" ? "daemon.run.active_permission_mode_update_failed" : "daemon.run.active_permission_mode_not_applied",
|
|
74545
|
+
text: outcome.status === "failed" ? `failed to update permission mode for active task ${outcome.taskId}: ${outcome.errorMessage ?? "unknown error"}` : `active permission mode update was not applied for task ${outcome.taskId} (${outcome.reasonCode})`,
|
|
74546
|
+
payload: outcome
|
|
74547
|
+
});
|
|
74548
|
+
}
|
|
74549
|
+
};
|
|
74093
74550
|
const shouldStartRouteCatalogSync = () => Boolean(forceCatalogSyncReason) || Date.now() >= nextCatalogSyncAtMs;
|
|
74094
74551
|
function startRouteCatalogSyncIfDue() {
|
|
74095
74552
|
if (closed || routeCatalogSyncInFlight || !shouldStartRouteCatalogSync()) return;
|
|
74096
74553
|
routeCatalogSyncInFlight = true;
|
|
74097
74554
|
syncRouteCatalogIfDue().catch((error) => {
|
|
74098
|
-
const syncError = error instanceof Error ? error : new Error(toErrorMessage$
|
|
74555
|
+
const syncError = error instanceof Error ? error : new Error(toErrorMessage$32(error));
|
|
74099
74556
|
failPendingRouteCatalogSyncRequests(syncError);
|
|
74100
74557
|
emitRunLine({
|
|
74101
74558
|
presenter: input.presenter,
|
|
74102
74559
|
code: "daemon.run.catalog_sync_failed",
|
|
74103
|
-
text: `catalog sync failed: ${toErrorMessage$
|
|
74560
|
+
text: `catalog sync failed: ${toErrorMessage$32(error)}`
|
|
74104
74561
|
});
|
|
74105
74562
|
}).finally(() => {
|
|
74106
74563
|
routeCatalogSyncInFlight = false;
|
|
@@ -74158,7 +74615,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74158
74615
|
emitRunLine({
|
|
74159
74616
|
presenter: input.presenter,
|
|
74160
74617
|
code: "daemon.run.runtime_agent_controller_report_sync_failed",
|
|
74161
|
-
text: `runtime agent controller report sync failed: ${toErrorMessage$
|
|
74618
|
+
text: `runtime agent controller report sync failed: ${toErrorMessage$32(error)}`
|
|
74162
74619
|
});
|
|
74163
74620
|
throw error;
|
|
74164
74621
|
}
|
|
@@ -74233,7 +74690,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74233
74690
|
emitRunLine({
|
|
74234
74691
|
presenter: input.presenter,
|
|
74235
74692
|
code: "daemon.run.provider_conversation_proof_sync_failed",
|
|
74236
|
-
text: `provider conversation proof sync failed: ${toErrorMessage$
|
|
74693
|
+
text: `provider conversation proof sync failed: ${toErrorMessage$32(error)}`
|
|
74237
74694
|
});
|
|
74238
74695
|
} finally {
|
|
74239
74696
|
providerConversationProofSyncInFlight = false;
|
|
@@ -74244,14 +74701,14 @@ async function runDaemonSocketSession(input) {
|
|
|
74244
74701
|
emitRunLine({
|
|
74245
74702
|
presenter: input.presenter,
|
|
74246
74703
|
code: "daemon.run.runtime_agent_controller_report_sync_failed",
|
|
74247
|
-
text: `runtime agent controller report sync failed: ${toErrorMessage$
|
|
74704
|
+
text: `runtime agent controller report sync failed: ${toErrorMessage$32(error)}`
|
|
74248
74705
|
});
|
|
74249
74706
|
});
|
|
74250
74707
|
syncProviderConversationProofsIfDue().catch((error) => {
|
|
74251
74708
|
emitRunLine({
|
|
74252
74709
|
presenter: input.presenter,
|
|
74253
74710
|
code: "daemon.run.provider_conversation_proof_sync_failed",
|
|
74254
|
-
text: `provider conversation proof sync failed: ${toErrorMessage$
|
|
74711
|
+
text: `provider conversation proof sync failed: ${toErrorMessage$32(error)}`
|
|
74255
74712
|
});
|
|
74256
74713
|
});
|
|
74257
74714
|
};
|
|
@@ -74403,7 +74860,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74403
74860
|
emitRunLine({
|
|
74404
74861
|
presenter: input.presenter,
|
|
74405
74862
|
code: "daemon.run.local_agent_control_report_sync_failed",
|
|
74406
|
-
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)}`
|
|
74407
74864
|
});
|
|
74408
74865
|
}
|
|
74409
74866
|
if (result.changed) requestLocalExecutionEvidenceRefresh({
|
|
@@ -74432,7 +74889,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74432
74889
|
status: result.status
|
|
74433
74890
|
};
|
|
74434
74891
|
} catch (error) {
|
|
74435
|
-
const message = toErrorMessage$
|
|
74892
|
+
const message = toErrorMessage$32(error);
|
|
74436
74893
|
const reasonCode = resolveLocalAgentEnabledErrorCode$1(error);
|
|
74437
74894
|
emitRunLine({
|
|
74438
74895
|
presenter: input.presenter,
|
|
@@ -74468,7 +74925,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74468
74925
|
emitRunLine({
|
|
74469
74926
|
presenter: input.presenter,
|
|
74470
74927
|
code: "daemon.run.local_agent_installation_report_sync_failed",
|
|
74471
|
-
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)}`
|
|
74472
74929
|
});
|
|
74473
74930
|
}
|
|
74474
74931
|
requestLocalExecutionEvidenceRefresh({
|
|
@@ -74501,7 +74958,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74501
74958
|
status: result.status
|
|
74502
74959
|
};
|
|
74503
74960
|
} catch (error) {
|
|
74504
|
-
const message = toErrorMessage$
|
|
74961
|
+
const message = toErrorMessage$32(error);
|
|
74505
74962
|
const reasonCode = resolveLocalAgentEnabledErrorCode$1(error);
|
|
74506
74963
|
emitRunLine({
|
|
74507
74964
|
presenter: input.presenter,
|
|
@@ -74554,7 +75011,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74554
75011
|
workspacePath: result.workspacePath
|
|
74555
75012
|
};
|
|
74556
75013
|
} catch (error) {
|
|
74557
|
-
const message = toErrorMessage$
|
|
75014
|
+
const message = toErrorMessage$32(error);
|
|
74558
75015
|
const reasonCode = resolveProfileWorkspaceControlErrorCode(error);
|
|
74559
75016
|
emitRunLine({
|
|
74560
75017
|
presenter: input.presenter,
|
|
@@ -74593,7 +75050,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74593
75050
|
});
|
|
74594
75051
|
return payload;
|
|
74595
75052
|
} catch (error) {
|
|
74596
|
-
const errorMessage = toErrorMessage$
|
|
75053
|
+
const errorMessage = toErrorMessage$32(error);
|
|
74597
75054
|
emitRunLine({
|
|
74598
75055
|
presenter: input.presenter,
|
|
74599
75056
|
code: "daemon.run.local_agent_control_refresh_catalog_failed",
|
|
@@ -74611,7 +75068,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74611
75068
|
emitRunLine({
|
|
74612
75069
|
presenter: input.presenter,
|
|
74613
75070
|
code: "daemon.run.socket_error",
|
|
74614
|
-
text: `daemon stream socket error: ${toErrorMessage$
|
|
75071
|
+
text: `daemon stream socket error: ${toErrorMessage$32(error)}`
|
|
74615
75072
|
});
|
|
74616
75073
|
});
|
|
74617
75074
|
const handleLocalAgentRegistrationControlFrame = (frame) => {
|
|
@@ -74620,7 +75077,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74620
75077
|
emitRunLine({
|
|
74621
75078
|
presenter: input.presenter,
|
|
74622
75079
|
code: "daemon.run.local_agent_control_failed",
|
|
74623
|
-
text: `local agent control failed: ${toErrorMessage$
|
|
75080
|
+
text: `local agent control failed: ${toErrorMessage$32(error)}`
|
|
74624
75081
|
});
|
|
74625
75082
|
});
|
|
74626
75083
|
return true;
|
|
@@ -74630,7 +75087,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74630
75087
|
emitRunLine({
|
|
74631
75088
|
presenter: input.presenter,
|
|
74632
75089
|
code: "daemon.run.agent_session_fork_failed",
|
|
74633
|
-
text: `Agent Session Fork failed: ${toErrorMessage$
|
|
75090
|
+
text: `Agent Session Fork failed: ${toErrorMessage$32(error)}`
|
|
74634
75091
|
});
|
|
74635
75092
|
});
|
|
74636
75093
|
return true;
|
|
@@ -74640,7 +75097,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74640
75097
|
emitRunLine({
|
|
74641
75098
|
presenter: input.presenter,
|
|
74642
75099
|
code: "daemon.run.local_agent_control_failed",
|
|
74643
|
-
text: `local agent installation control failed: ${toErrorMessage$
|
|
75100
|
+
text: `local agent installation control failed: ${toErrorMessage$32(error)}`
|
|
74644
75101
|
});
|
|
74645
75102
|
});
|
|
74646
75103
|
return true;
|
|
@@ -74678,7 +75135,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74678
75135
|
emitRunLine({
|
|
74679
75136
|
presenter: input.presenter,
|
|
74680
75137
|
code: "daemon.run.openmeld_tools_control_failed",
|
|
74681
|
-
text: `OpenMeld Tools control failed: ${toErrorMessage$
|
|
75138
|
+
text: `OpenMeld Tools control failed: ${toErrorMessage$32(error)}`
|
|
74682
75139
|
});
|
|
74683
75140
|
});
|
|
74684
75141
|
return true;
|
|
@@ -74717,7 +75174,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74717
75174
|
emitRunLine({
|
|
74718
75175
|
presenter: input.presenter,
|
|
74719
75176
|
code: "daemon.run.local_agent_control_failed",
|
|
74720
|
-
text: `local agent control failed: ${toErrorMessage$
|
|
75177
|
+
text: `local agent control failed: ${toErrorMessage$32(error)}`
|
|
74721
75178
|
});
|
|
74722
75179
|
});
|
|
74723
75180
|
return;
|
|
@@ -74727,7 +75184,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74727
75184
|
emitRunLine({
|
|
74728
75185
|
presenter: input.presenter,
|
|
74729
75186
|
code: "daemon.run.local_agent_control_failed",
|
|
74730
|
-
text: `local agent control failed: ${toErrorMessage$
|
|
75187
|
+
text: `local agent control failed: ${toErrorMessage$32(error)}`
|
|
74731
75188
|
});
|
|
74732
75189
|
});
|
|
74733
75190
|
return;
|
|
@@ -74737,7 +75194,7 @@ async function runDaemonSocketSession(input) {
|
|
|
74737
75194
|
emitRunLine({
|
|
74738
75195
|
presenter: input.presenter,
|
|
74739
75196
|
code: "daemon.run.execution_recovery_failed",
|
|
74740
|
-
text: `execution recovery failed: ${toErrorMessage$
|
|
75197
|
+
text: `execution recovery failed: ${toErrorMessage$32(error)}`
|
|
74741
75198
|
});
|
|
74742
75199
|
});
|
|
74743
75200
|
return;
|
|
@@ -75147,41 +75604,51 @@ async function resolveDaemonServiceOwnerContext(input) {
|
|
|
75147
75604
|
});
|
|
75148
75605
|
}
|
|
75149
75606
|
async function resolveDaemonStreamAuthContext(input) {
|
|
75150
|
-
|
|
75151
|
-
|
|
75152
|
-
|
|
75153
|
-
|
|
75154
|
-
|
|
75155
|
-
|
|
75156
|
-
|
|
75157
|
-
|
|
75158
|
-
|
|
75159
|
-
|
|
75160
|
-
|
|
75161
|
-
|
|
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",
|
|
75162
75623
|
status: "authentication_required"
|
|
75163
75624
|
};
|
|
75164
75625
|
return {
|
|
75165
75626
|
authState: "valid",
|
|
75166
|
-
headers
|
|
75167
|
-
authSession: authState.session,
|
|
75168
|
-
requestUrl: input.requestUrl,
|
|
75169
|
-
selectedOpenMeldProfile: input.selectedOpenMeldProfile
|
|
75170
|
-
}),
|
|
75627
|
+
headers,
|
|
75171
75628
|
status: "ready"
|
|
75172
75629
|
};
|
|
75173
75630
|
}
|
|
75174
|
-
function
|
|
75175
|
-
if (
|
|
75631
|
+
function resolveCredentialFailureAuthState(reason) {
|
|
75632
|
+
if (reason === "session_expired") return "expired";
|
|
75633
|
+
if (reason === "remote_session_revoked" || reason === "session_revoked") return "revoked";
|
|
75176
75634
|
return "invalid";
|
|
75177
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
|
+
}
|
|
75178
75645
|
async function buildDaemonStreamRequestHeaders(input) {
|
|
75179
75646
|
return input.selectedOpenMeldProfile ? await buildOpenMeldProfileRequestHeadersWithAuth({
|
|
75180
75647
|
openMeldProfile: input.selectedOpenMeldProfile,
|
|
75181
|
-
authSession: input.authSession,
|
|
75648
|
+
...input.authSession ? { authSession: input.authSession } : {},
|
|
75182
75649
|
requestUrl: input.requestUrl
|
|
75183
75650
|
}) : await buildRequestAuthHeaders({
|
|
75184
|
-
authSession: input.authSession,
|
|
75651
|
+
...input.authSession ? { authSession: input.authSession } : {},
|
|
75185
75652
|
requestUrl: input.requestUrl
|
|
75186
75653
|
});
|
|
75187
75654
|
}
|
|
@@ -75539,7 +76006,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75539
76006
|
emitRunLine({
|
|
75540
76007
|
presenter: input.presenter,
|
|
75541
76008
|
code: "daemon.run.agent_activity_integration_refresh_failed",
|
|
75542
|
-
text: `Managed Agent integration refresh failed: ${toErrorMessage$
|
|
76009
|
+
text: `Managed Agent integration refresh failed: ${toErrorMessage$32(error)}`
|
|
75543
76010
|
});
|
|
75544
76011
|
});
|
|
75545
76012
|
const stopRegistrationReconcile = startDaemonServiceRegistrationReconcileLoop({
|
|
@@ -75555,7 +76022,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75555
76022
|
const openMeldToolsUpdateCoordinator = createOpenMeldToolsUpdateCoordinator({ reportBackgroundError: (error) => {
|
|
75556
76023
|
warnDaemonEvent("[openmeld.tools.update_failed]", {
|
|
75557
76024
|
event: "cli.openmeld_tools.update_failed",
|
|
75558
|
-
errorMessage: toErrorMessage$
|
|
76025
|
+
errorMessage: toErrorMessage$32(error)
|
|
75559
76026
|
});
|
|
75560
76027
|
} });
|
|
75561
76028
|
const stopOpenMeldToolsAutomaticUpdates = startOpenMeldToolsAutomaticUpdateLoop({
|
|
@@ -75563,7 +76030,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75563
76030
|
onError: (error) => {
|
|
75564
76031
|
warnDaemonEvent("[openmeld.tools.automatic_update_failed]", {
|
|
75565
76032
|
event: "cli.openmeld_tools.automatic_update_failed",
|
|
75566
|
-
errorMessage: toErrorMessage$
|
|
76033
|
+
errorMessage: toErrorMessage$32(error)
|
|
75567
76034
|
});
|
|
75568
76035
|
}
|
|
75569
76036
|
});
|
|
@@ -75572,7 +76039,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75572
76039
|
emitRunLine({
|
|
75573
76040
|
presenter: input.presenter,
|
|
75574
76041
|
code: "daemon.run.agent_activity_sync_failed",
|
|
75575
|
-
text: `Agent Activity sync failed: ${toErrorMessage$
|
|
76042
|
+
text: `Agent Activity sync failed: ${toErrorMessage$32(error)}`
|
|
75576
76043
|
});
|
|
75577
76044
|
},
|
|
75578
76045
|
onResult: (result) => {
|
|
@@ -75605,7 +76072,7 @@ const runDaemonServiceLoop = async (input) => {
|
|
|
75605
76072
|
emitRunLine({
|
|
75606
76073
|
presenter: input.presenter,
|
|
75607
76074
|
code: "daemon.run.agent_activity_integration_refresh_failed",
|
|
75608
|
-
text: `Managed Agent integration refresh failed: ${toErrorMessage$
|
|
76075
|
+
text: `Managed Agent integration refresh failed: ${toErrorMessage$32(error)}`
|
|
75609
76076
|
});
|
|
75610
76077
|
},
|
|
75611
76078
|
onResult: (result) => {
|
|
@@ -75825,14 +76292,14 @@ async function loadInitialDaemonRouteCatalog(input) {
|
|
|
75825
76292
|
emitRunLine({
|
|
75826
76293
|
presenter: input.presenter,
|
|
75827
76294
|
code: "daemon.run.route_catalog_initial_load_failed",
|
|
75828
|
-
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)}`,
|
|
75829
76296
|
payload: { reason: "initial_load_failed_no_cache" }
|
|
75830
76297
|
});
|
|
75831
76298
|
await emitInitialRouteCatalogLoadEvent({
|
|
75832
76299
|
result: "failed_empty_start",
|
|
75833
76300
|
metadata: {
|
|
75834
76301
|
durationMs: Date.now() - loadStartedAt,
|
|
75835
|
-
errorMessage: toErrorMessage$
|
|
76302
|
+
errorMessage: toErrorMessage$32(error),
|
|
75836
76303
|
phaseTimings
|
|
75837
76304
|
}
|
|
75838
76305
|
});
|
|
@@ -75845,7 +76312,7 @@ async function loadInitialDaemonRouteCatalog(input) {
|
|
|
75845
76312
|
emitRunLine({
|
|
75846
76313
|
presenter: input.presenter,
|
|
75847
76314
|
code: "daemon.run.route_catalog_cache_recovered",
|
|
75848
|
-
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)}`,
|
|
75849
76316
|
payload: {
|
|
75850
76317
|
profileIds: cached.profileIds,
|
|
75851
76318
|
reason: "initial_load_failed"
|
|
@@ -75855,7 +76322,7 @@ async function loadInitialDaemonRouteCatalog(input) {
|
|
|
75855
76322
|
result: "cache_recovered",
|
|
75856
76323
|
metadata: {
|
|
75857
76324
|
durationMs: Date.now() - loadStartedAt,
|
|
75858
|
-
errorMessage: toErrorMessage$
|
|
76325
|
+
errorMessage: toErrorMessage$32(error),
|
|
75859
76326
|
phaseTimings,
|
|
75860
76327
|
profileCount: cached.profileIds.length
|
|
75861
76328
|
}
|
|
@@ -75882,7 +76349,7 @@ async function persistDaemonRouteCatalogCache(input) {
|
|
|
75882
76349
|
emitRunLine({
|
|
75883
76350
|
presenter: input.presenter,
|
|
75884
76351
|
code: "daemon.run.route_catalog_cache_write_failed",
|
|
75885
|
-
text: `route catalog cache write failed: ${toErrorMessage$
|
|
76352
|
+
text: `route catalog cache write failed: ${toErrorMessage$32(error)}`
|
|
75886
76353
|
});
|
|
75887
76354
|
}
|
|
75888
76355
|
}
|
|
@@ -75922,14 +76389,14 @@ async function handleLocalControlPlaneSetLocalAgentEnabled(input) {
|
|
|
75922
76389
|
emitRunLine({
|
|
75923
76390
|
presenter: input.presenter,
|
|
75924
76391
|
code: "daemon.run.local_agent_enabled_report_sync_failed",
|
|
75925
|
-
text: `local agent report sync failed after enabled update: ${toErrorMessage$
|
|
76392
|
+
text: `local agent report sync failed after enabled update: ${toErrorMessage$32(error)}`
|
|
75926
76393
|
});
|
|
75927
76394
|
}
|
|
75928
76395
|
if (result.changed && input.requestActiveRouteCatalogSync) await input.requestActiveRouteCatalogSync("local_agent_enabled_changed").catch((error) => {
|
|
75929
76396
|
emitRunLine({
|
|
75930
76397
|
presenter: input.presenter,
|
|
75931
76398
|
code: "daemon.run.local_agent_enabled_route_sync_failed",
|
|
75932
|
-
text: `route catalog sync failed after enabled update: ${toErrorMessage$
|
|
76399
|
+
text: `route catalog sync failed after enabled update: ${toErrorMessage$32(error)}`
|
|
75933
76400
|
});
|
|
75934
76401
|
});
|
|
75935
76402
|
emitRunLine({
|
|
@@ -75954,7 +76421,7 @@ async function handleLocalControlPlaneSetLocalAgentEnabled(input) {
|
|
|
75954
76421
|
status: result.status
|
|
75955
76422
|
};
|
|
75956
76423
|
} catch (error) {
|
|
75957
|
-
const message = toErrorMessage$
|
|
76424
|
+
const message = toErrorMessage$32(error);
|
|
75958
76425
|
emitRunLine({
|
|
75959
76426
|
presenter: input.presenter,
|
|
75960
76427
|
code: "daemon.run.local_agent_enabled_rejected",
|
|
@@ -76077,7 +76544,7 @@ function createRunLoopConnectionStateTracker(presenter) {
|
|
|
76077
76544
|
} });
|
|
76078
76545
|
}
|
|
76079
76546
|
function noteRunLoopReconnectScheduled(input) {
|
|
76080
|
-
const errorMessage = toErrorMessage$
|
|
76547
|
+
const errorMessage = toErrorMessage$32(input.error);
|
|
76081
76548
|
const failureReason = classifyConnectionFailureReason(errorMessage);
|
|
76082
76549
|
const authState = input.error instanceof DaemonStreamAuthenticationRequiredError ? input.error.authState : null;
|
|
76083
76550
|
const backoffMs = resolveServiceConnectionReconnectBackoffMs({
|
|
@@ -78629,7 +79096,7 @@ var DaemonReinstallUnexpectedStartError = class extends Error {
|
|
|
78629
79096
|
diagnosticDetail;
|
|
78630
79097
|
outcome;
|
|
78631
79098
|
constructor(input) {
|
|
78632
|
-
super(toErrorMessage$
|
|
79099
|
+
super(toErrorMessage$43(input.cause));
|
|
78633
79100
|
this.name = "DaemonReinstallUnexpectedStartError";
|
|
78634
79101
|
this.cause = input.cause;
|
|
78635
79102
|
this.diagnosticDetail = input.diagnosticDetail;
|
|
@@ -78648,7 +79115,7 @@ var DaemonReinstallFailureError = class extends Error {
|
|
|
78648
79115
|
evidencePath;
|
|
78649
79116
|
failureStage;
|
|
78650
79117
|
constructor(input) {
|
|
78651
|
-
super(toErrorMessage$
|
|
79118
|
+
super(toErrorMessage$43(input.cause));
|
|
78652
79119
|
this.name = "DaemonReinstallFailureError";
|
|
78653
79120
|
this.backupDataPath = input.backupDataPath;
|
|
78654
79121
|
this.cause = input.cause;
|
|
@@ -79306,18 +79773,18 @@ async function prepareManagedDaemonServiceForStop(input) {
|
|
|
79306
79773
|
intent: "stop",
|
|
79307
79774
|
metadata: {
|
|
79308
79775
|
compatibilityFallback: isCompatibilityFallback,
|
|
79309
|
-
errorMessage: toErrorMessage$
|
|
79776
|
+
errorMessage: toErrorMessage$43(error)
|
|
79310
79777
|
},
|
|
79311
79778
|
result: isCompatibilityFallback ? "fallback" : "failed",
|
|
79312
79779
|
stopCause: "user_stop",
|
|
79313
79780
|
type: "stop.controlled_drain"
|
|
79314
79781
|
});
|
|
79315
79782
|
if (isCompatibilityFallback) return null;
|
|
79316
|
-
let errorMessage = toErrorMessage$
|
|
79783
|
+
let errorMessage = toErrorMessage$43(error);
|
|
79317
79784
|
if (shouldRestoreAutostart) try {
|
|
79318
79785
|
await serviceManager.enableAutostart();
|
|
79319
79786
|
} catch (restoreError) {
|
|
79320
|
-
errorMessage = `${errorMessage}; failed to restore service autostart: ${toErrorMessage$
|
|
79787
|
+
errorMessage = `${errorMessage}; failed to restore service autostart: ${toErrorMessage$43(restoreError)}`;
|
|
79321
79788
|
}
|
|
79322
79789
|
if (input.mode !== "best_effort") throw new Error(`OpenMeld Service stayed running because its final offline status could not be delivered: ${errorMessage}`);
|
|
79323
79790
|
return buildDaemonStopWarningResult({
|
|
@@ -79367,11 +79834,11 @@ async function stopRegisteredDaemonServiceManager(input) {
|
|
|
79367
79834
|
run: async () => await input.ownerSnapshot.serviceManager?.stop()
|
|
79368
79835
|
});
|
|
79369
79836
|
} catch (error) {
|
|
79370
|
-
if (input.mode !== "best_effort") throw new Error(`Failed to stop system service (${input.ownerSnapshot.runtimeStatus.serviceController}): ${toErrorMessage$
|
|
79837
|
+
if (input.mode !== "best_effort") throw new Error(`Failed to stop system service (${input.ownerSnapshot.runtimeStatus.serviceController}): ${toErrorMessage$43(error)}`);
|
|
79371
79838
|
return buildDaemonStopWarningResult({
|
|
79372
79839
|
reason: "stop_failed",
|
|
79373
79840
|
runtimeStatus: input.ownerSnapshot.runtimeStatus,
|
|
79374
|
-
errorMessage: toErrorMessage$
|
|
79841
|
+
errorMessage: toErrorMessage$43(error)
|
|
79375
79842
|
});
|
|
79376
79843
|
}
|
|
79377
79844
|
if (!await waitForDaemonSystemServiceToStop({
|
|
@@ -79402,7 +79869,7 @@ async function stopRegisteredDaemonServiceManager(input) {
|
|
|
79402
79869
|
return buildDaemonStopWarningResult({
|
|
79403
79870
|
reason: "stop_failed",
|
|
79404
79871
|
runtimeStatus: input.ownerSnapshot.runtimeStatus,
|
|
79405
|
-
errorMessage: toErrorMessage$
|
|
79872
|
+
errorMessage: toErrorMessage$43(error)
|
|
79406
79873
|
});
|
|
79407
79874
|
}
|
|
79408
79875
|
const finalOwnerSnapshot = residualCleanupResult.shouldRefresh ? await readCurrentDaemonOwnerSnapshot() : residualCleanupResult.ownerSnapshot;
|
|
@@ -79475,7 +79942,7 @@ async function stopCurrentLaneDaemonProcess(input) {
|
|
|
79475
79942
|
pid: daemonPid,
|
|
79476
79943
|
reason: "stop_failed",
|
|
79477
79944
|
runtimeStatus: input.runtimeStatus,
|
|
79478
|
-
errorMessage: toErrorMessage$
|
|
79945
|
+
errorMessage: toErrorMessage$43(error)
|
|
79479
79946
|
};
|
|
79480
79947
|
}
|
|
79481
79948
|
}
|
|
@@ -79559,7 +80026,7 @@ async function stopTrackedDaemonProcess(input) {
|
|
|
79559
80026
|
type: "process_stop.action",
|
|
79560
80027
|
result: "failed",
|
|
79561
80028
|
metadata: {
|
|
79562
|
-
errorMessage: toErrorMessage$
|
|
80029
|
+
errorMessage: toErrorMessage$43(error),
|
|
79563
80030
|
pid: input.pid,
|
|
79564
80031
|
reason: input.reason,
|
|
79565
80032
|
signal: input.signal
|
|
@@ -79594,7 +80061,7 @@ async function stopDaemonProcess(pid, signal) {
|
|
|
79594
80061
|
process.kill(pid, signal);
|
|
79595
80062
|
} catch (error) {
|
|
79596
80063
|
if (isNodeErrorCode(error, "ESRCH")) return true;
|
|
79597
|
-
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$
|
|
80064
|
+
throw new Error(`Failed to send ${signal} to pid ${String(pid)}: ${toErrorMessage$43(error)}`);
|
|
79598
80065
|
}
|
|
79599
80066
|
if (signal === "SIGKILL") return true;
|
|
79600
80067
|
return await waitForProcessToExit(pid);
|
|
@@ -79668,7 +80135,7 @@ async function stopDaemonForStrictTeardown(input) {
|
|
|
79668
80135
|
await input.context.serviceManager.stop().catch((error) => {
|
|
79669
80136
|
throw createStrictTeardownError({
|
|
79670
80137
|
reason: input.reason,
|
|
79671
|
-
message: `failed to stop system service (${input.context.serviceManager?.controller}): ${toErrorMessage$
|
|
80138
|
+
message: `failed to stop system service (${input.context.serviceManager?.controller}): ${toErrorMessage$43(error)}`,
|
|
79672
80139
|
hint: "run `openmeld service stop --force` and retry",
|
|
79673
80140
|
stage: "stop-wait"
|
|
79674
80141
|
});
|
|
@@ -79713,7 +80180,7 @@ async function uninstallSystemServiceForStrictTeardown(input) {
|
|
|
79713
80180
|
for (const manager of managers) await manager.uninstall().catch((error) => {
|
|
79714
80181
|
throw createStrictTeardownError({
|
|
79715
80182
|
reason: input.reason,
|
|
79716
|
-
message: `failed to uninstall system service (${manager.controller}): ${toErrorMessage$
|
|
80183
|
+
message: `failed to uninstall system service (${manager.controller}): ${toErrorMessage$43(error)}`,
|
|
79717
80184
|
hint: "fix OS service permissions and retry",
|
|
79718
80185
|
stage: "uninstall-verify"
|
|
79719
80186
|
});
|
|
@@ -79730,7 +80197,7 @@ async function verifySystemServiceRemovedAfterStrictTeardown(input) {
|
|
|
79730
80197
|
const finalManagerStatus = await manager.status().catch((error) => {
|
|
79731
80198
|
throw createStrictTeardownError({
|
|
79732
80199
|
reason: input.reason,
|
|
79733
|
-
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$
|
|
80200
|
+
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$43(error)}`,
|
|
79734
80201
|
hint: "run `openmeld service status` and confirm service manager state",
|
|
79735
80202
|
stage: "uninstall-verify"
|
|
79736
80203
|
});
|
|
@@ -79747,7 +80214,7 @@ async function verifySystemServiceRemovedAfterStrictTeardown(input) {
|
|
|
79747
80214
|
const finalManagerStatus = await manager.status().catch((error) => {
|
|
79748
80215
|
throw createStrictTeardownError({
|
|
79749
80216
|
reason: input.reason,
|
|
79750
|
-
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$
|
|
80217
|
+
message: `failed to verify system service status (${manager.controller}): ${toErrorMessage$43(error)}`,
|
|
79751
80218
|
hint: "run `openmeld service status` and confirm service manager state",
|
|
79752
80219
|
stage: "uninstall-verify"
|
|
79753
80220
|
});
|
|
@@ -80187,7 +80654,7 @@ async function runDaemonReinstall(input, options = {}) {
|
|
|
80187
80654
|
action: displayAction,
|
|
80188
80655
|
backupDataPath: error.backupDataPath,
|
|
80189
80656
|
errorCode: error.errorCode,
|
|
80190
|
-
errorMessage: toErrorMessage$
|
|
80657
|
+
errorMessage: toErrorMessage$43(error.cause),
|
|
80191
80658
|
failureStage: error.failureStage,
|
|
80192
80659
|
evidencePath: error.evidencePath ?? await captureDaemonServiceEvidenceBestEffort({
|
|
80193
80660
|
runtime,
|
|
@@ -81026,7 +81493,7 @@ async function runDirectDaemonServiceLoop(input) {
|
|
|
81026
81493
|
};
|
|
81027
81494
|
} catch (error) {
|
|
81028
81495
|
return await handleDaemonRunStartFailure({
|
|
81029
|
-
fallbackRawLine: toErrorMessage$
|
|
81496
|
+
fallbackRawLine: toErrorMessage$43(error),
|
|
81030
81497
|
gatewayUrl: input.gatewayUrl,
|
|
81031
81498
|
presenter: input.presenter,
|
|
81032
81499
|
runtime: input.runtime,
|
|
@@ -81227,7 +81694,7 @@ async function bestEffortStopCurrentLaneDaemonService(input) {
|
|
|
81227
81694
|
if (!isOpenMeldLockError(error)) throw error;
|
|
81228
81695
|
let errorMessage = error.message;
|
|
81229
81696
|
const runtimeStatus = await readCurrentObservedDaemonRuntimeStatus().catch((statusError) => {
|
|
81230
|
-
errorMessage = `${errorMessage}; service status could not be read: ${toErrorMessage$
|
|
81697
|
+
errorMessage = `${errorMessage}; service status could not be read: ${toErrorMessage$43(statusError)}`;
|
|
81231
81698
|
return {
|
|
81232
81699
|
status: "unknown",
|
|
81233
81700
|
mode: null,
|
|
@@ -81663,7 +82130,7 @@ async function runSystemDaemonCore(context) {
|
|
|
81663
82130
|
} catch (error) {
|
|
81664
82131
|
if (!isSystemServiceBootstrap) throw error;
|
|
81665
82132
|
return await handleDaemonRunStartFailure({
|
|
81666
|
-
fallbackRawLine: toErrorMessage$
|
|
82133
|
+
fallbackRawLine: toErrorMessage$43(error),
|
|
81667
82134
|
gatewayUrl: input.gatewayUrl,
|
|
81668
82135
|
presenter,
|
|
81669
82136
|
runtime,
|
|
@@ -82264,7 +82731,7 @@ async function recoverSystemServiceStartupAfterTimeout(input) {
|
|
|
82264
82731
|
error,
|
|
82265
82732
|
recovery: {
|
|
82266
82733
|
...recovery,
|
|
82267
|
-
failureMessage: toErrorMessage$
|
|
82734
|
+
failureMessage: toErrorMessage$43(error)
|
|
82268
82735
|
}
|
|
82269
82736
|
};
|
|
82270
82737
|
}
|
|
@@ -82490,7 +82957,7 @@ function resolvePersistedDaemonServiceContractGatewayUrl(gatewayUrl) {
|
|
|
82490
82957
|
try {
|
|
82491
82958
|
return normalizeGatewayBaseUrl(gatewayUrl);
|
|
82492
82959
|
} catch (error) {
|
|
82493
|
-
throw new Error(`Invalid persisted OpenMeld Service contract gateway URL "${gatewayUrl}": ${toErrorMessage$
|
|
82960
|
+
throw new Error(`Invalid persisted OpenMeld Service contract gateway URL "${gatewayUrl}": ${toErrorMessage$43(error)}`);
|
|
82494
82961
|
}
|
|
82495
82962
|
}
|
|
82496
82963
|
function resolveSystemServiceStartupWaitMs(controller) {
|
|
@@ -82619,13 +83086,13 @@ async function runDaemonServiceDetached(input) {
|
|
|
82619
83086
|
if (typeof child.pid === "number" && child.pid > 0) await cleanupDetachedRuntimeStateIfOwnedByPid(child.pid).catch(() => {});
|
|
82620
83087
|
return await handleDaemonRunStartFailure({
|
|
82621
83088
|
cursor: startFailureLogCursor,
|
|
82622
|
-
fallbackRawLine: selectRelevantDaemonStartFailureLogLine(startupOutput.summary()) ?? toErrorMessage$
|
|
83089
|
+
fallbackRawLine: selectRelevantDaemonStartFailureLogLine(startupOutput.summary()) ?? toErrorMessage$43(error),
|
|
82623
83090
|
gatewayUrl: input.gatewayUrl,
|
|
82624
83091
|
presenter: input.presenter,
|
|
82625
83092
|
runtime: input.runtime,
|
|
82626
83093
|
genericErrorPayload: {
|
|
82627
83094
|
codePrefix: "daemon.run.start_failed",
|
|
82628
|
-
error: /* @__PURE__ */ new Error(`Failed to start OpenMeld Service process: ${toErrorMessage$
|
|
83095
|
+
error: /* @__PURE__ */ new Error(`Failed to start OpenMeld Service process: ${toErrorMessage$43(error)}`)
|
|
82629
83096
|
}
|
|
82630
83097
|
});
|
|
82631
83098
|
} finally {
|
|
@@ -109545,6 +110012,6 @@ function isHumanInteractiveSpaceRuntime(runtime) {
|
|
|
109545
110012
|
return runtime.resolvedView === "human" && canUseInteractivePrompts(runtime);
|
|
109546
110013
|
}
|
|
109547
110014
|
//#endregion
|
|
109548
|
-
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 };
|
|
110015
|
+
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 };
|
|
109549
110016
|
|
|
109550
|
-
//# sourceMappingURL=command-
|
|
110017
|
+
//# sourceMappingURL=command-Dk3z-M2K.js.map
|