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
package/dist/openmeld.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $ as runWithHeldLock, A as toSpaceContractUrl, At as
|
|
4
|
-
import { $ as runAgentsRepair, $a as installAgentActivityIntegrations, $i as readRecentDaemonLifecycleEvents, $n as canUseInteractivePrompts, $r as syncProfileWorkspaceState, $t as readRuntimeReportingHealthState, A as assertFullSignalIdArgument, Aa as updateOpenMeldProfile, Ai as buildDaemonRouteObservationPresentation$1, An as assertNoRemovedCcSpaceAddressingSyntax, Ao as setDefaultProjectConnection, Ar as formatDualViewGuideForDisplay, At as runDaemonStartupPreflight, B as persistAgentTransportSelection, Ba as resolveAuthenticationGuidanceFromMessage, Bi as finishCurrentCommandCheckScope, Bn as promptSearchSelect, Bo as outJsonLine, Br as scheduleDaemonServiceUpdate, Bt as resolveLocalComponentsStatus, C as toSpaceMetaUpsertInput, Ca as resolveOpenMeldProfileOrNull, Ci as parseAgentControllerRef, Cn as submitRuntimeAgentControllerReports, Co as removeProjectOutbox, Cr as registerSkillsTargetSelectionOptions, Ct as runDaemonUninstall, D as formatHumanReadTargetList, Da as listOpenMeldProfiles, Di as resolveEvidenceSyncHealth, Dn as resolveLocalAgentControllerReportDecision, Do as migrateProjectBindingStore, Dr as registerBuiltinAgentSelectionOptions, Dt as emitDaemonAgentOverview, E as buildHumanReplyContextSummary, Ea as deleteOpenMeldProfile, Ei as resolveAgentProfileEditCapabilities, En as resolveLocalAgentControllerLaunchability, Eo as listProjectConnectionsWithStatus, Er as registerAuthLoginRequestOptions, Et as reconcileCliVersionView, F as emitSpaceAgentOverview, Fa as buildAgentAuthenticationGuide, Fi as classifyDaemonServiceRunStartability, Fn as buildSpaceRoundReadProjection, Fo as renderInfoCard, Fr as areAllowedActionsEquivalent, Ft as updateSpaceMeta, G as runAgentsCustomList, Ga as LocalDaemonControlPlaneClientError, Gi as inspectDaemonServiceInventory, Gn as assertDispatchOwnedRuntimePublicWriteAllowed, Go as cliJsonSkillsLoadEnvelopeSchema, Gr as resolveDaemonServiceFreshnessWarning, Gt as collectSkillsReadinessSnapshot, H as runAgents, Ha as setProfileDefaultView, Hi as isCurrentCommandCheckScopeActive, Hn as runInteractivePrompt, Ho as cliBinaryDeltaPatchSchema, Hr as resolveDaemonDeviceId, Ht as resolveDaemonServiceParticipationStatus, I as emitSpaceCliAgentOverview, Ia as buildHumanAuthenticationCard, Ii as classifyDaemonServiceWakeability, In as buildUpdatesReplyWorkflowProjection, Io as renderTextInfoCard, Ir as buildAgentFacingPublicationModeGuideLines, It as readGatewayJsonResponse, J as runAgentsDetect, Ja as registerAgentActivityRoute, Ji as readCurrentObservedDaemonRuntimeStatus, Jn as writeDispatchSpaceActionRecord, Jo as organizationJoinLinkErrorResponseSchema, Jr as formatDeviceReplyReadinessLabel, Jt as runSkillsInstall, K as runAgentsCustomRemove, Ka as requestLocalAgentActivitySync, Ki as resolveVersionChangeDirection, Kn as readDispatchOwnedRuntimeGuard, Ko as cliJsonSkillsShowEnvelopeSchema, Kr as resolveCurrentReplyReadinessSnapshot, Kt as runSkillsCheck$1, L as prepareLocalAgentReadiness, La as createAuthenticationError, Li as resolveServiceUpdateUrgency, Ln as createSpaceMemberIdentityIndex, Lo as sanitizeTerminalDisplayText, Lr as canonicalizeAllowedActions, Lt as readGatewayTextResponse, M as prepareAuthenticatedSpaceCommandContext, Ma as clearSelectedOpenMeldProfileId, Mi as getSetupFlowCopy, Mn as buildDispatchResultReplyWorkflowProjection, Mo as canonicalizeLocalProjectPath, Mr as formatAgentOverviewPayload, Mt as fetchSpaceUpdates, N as resolveOpenMeldProfileForSpaceCommand, Na as getSelectedOpenMeldProfileId, Ni as buildDaemonServiceTargetSpec, Nn as buildSignalIndex, No as enqueueControllerTaskLifecycleEventWhileLocked, Nr as OPENMELD_AGENT_MENTAL_MODEL_LINES, Nt as createCliSpaceApi, O as parseEnvelope, Oa as primeOpenMeldProfilesSessionCache, Oi as resolveNativeAgentControllerPermissionModeForController, On as inspectSpaceCacheFile, Oo as removeProjectConnection, Or as buildAgentOverviewFromContract, Ot as createDelayedSpinner, P as resolveSpaceAccessLabel, Pa as setSelectedOpenMeldProfileId, Pi as resolveDaemonServiceAlignmentDecision, Pn as buildSignalMessageReadProjection, Po as readControllerTaskLifecycleOutboxHealth, Pr as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, Pt as fetchSpaceMeta, Q as runAgentsManage, Qa as defaultManagedIntegrationPaths, Qi as resolveDaemonServiceManager, Qn as formatDaemonServiceMissingRecommendation, Qr as resolveOpenClawLocalDiagnosticsValue, Qt as readBundledOpenMeldCliSkillDocumentByPath, R as buildReplyReadinessGuidance, Ra as resolveAuthenticationGuidance, Ri as assessServerRequiredVersion, Rn as formatRemovedCcRelationMessage, Ro as emitCliJsonEnvelope, Rr as readOpenMeldToolsUpdateContextFromEnv, Rt as toStructuredGatewayFailure, S as loadSpaceSignalIndexOrNull, Sa as requireOpenMeldProfile, Si as listAgentControllerPermissionModeOptions, Sn as submitRuntimeAgentControllerReport, So as readAgentActivityOutboxHealth, Sr as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, St as runDaemonTeardownStrict, T as buildFormalSignalReadPayload, Ta as createOpenMeldHumanProfile, Ti as resolveAgentExecutionStatus, Tn as resolveLocalAgentControllerBlockerReasonCodes, To as listProjectBindings, Tr as registerDaemonControlTargetOptions, Tt as buildProfileWorkspaceRows, U as runAgentsConfig, Ua as LocalProjectConnectionError, Ui as resetCurrentCommandCheckState, Un as assessCliUpdate, Uo as cliJsonOutputEnvelopeSchema, Ur as formatDaemonFailureContextText, Ut as runDaemonServiceParticipationGate, V as resolveAgentProfileSetup, Va as getProfileDefaultView, Vi as getCurrentCommandCheckState, Vn as isReturnKeypress, Vo as outLine, Vr as ensureDaemonRuntimePaths, Vt as writeInstalledLocalComponentsSnapshot, W as runAgentsCustomAdd, Wa as validateLocalProjectConnectionPath, Wi as startCurrentCommandCheckScope, Wn as isCliUpdateCheckApplicable, Wo as cliJsonSkillsListEnvelopeSchema, Wr as resolveServiceReadinessFromServiceStatus, Wt as runDaemonStartDecisionPrompt, X as runAgentsEnable, Xa as unregisterAgentActivityRoute, Xi as isDaemonServiceJobNeverSpawned, Xn as resolveElapsedTimeMs, Xo as compareAgentControllerRefsForDisplay, Xr as mapAgentReplyReadinessToLegacyAutoReply, Xt as runSkillsUpdate, Y as runAgentsDisable, Ya as resolveAgentActivityRouteForPath, Yi as getDaemonSystemServiceLogPath, Yn as formatElapsedTime, Yo as revokeOrganizationJoinLinkResponseSchema, Yr as formatHumanReplyReadinessReason$1, Yt as runSkillsUninstall, Z as runAgentsList, Zi as readDaemonServiceJobCrashExitCode, Zn as formatDaemonServiceDowngradeBlockedRecommendation, Zr as resolveGatewayChainReadiness, Zt as ensureLocalSkills, _ as runSpaceWriteWithPasswordRetry, _a as formatMessage, _i as resolveLocalRegistryAgentIdFromAgentControllerRef, _n as formatServiceParticipationReadinessLabel, _o as resolveObservedAgentActivityBinding, _r as createStartAuthenticationGuideError, _t as runDaemonReinstall, a as runSpaceDelete, aa as fetchLatestCliBinaryRelease, ai as resolveConfiguredProfileWorkspacePath, an as runAuthLogin, ao as formatOpenMeldCliCommands, ar as createSpaceAddMembersGuideError, at as renderOpenMeldBrandBlockLines, b as buildIdentityOnlyMembersSnapshotForReadProjection, ba as resolveViewProfileKey, bi as getAgentControllerPermissionModeDisplayMetadata, bn as computeRetryDelayMs, bo as enqueueAgentActivityHookEvent, br as getCommandHintsFromContract, bt as runDaemonStatusFlow, c as runSpaceLeave, ca as writeVersionState, ci as validateCustomProfileWorkspacePath, cn as runAuthStatus, co as formatProfileAwareOpenMeldCliCommands, cr as createSpaceLeaveGuideError, ct as renderOpenMeldTagline, d as runSpaceRemoveMembers, da as resolveCurrentDaemonExpectedVersion, di as createPrimaryBindingReadSession, dn as formatActiveOrganizationLabel, do as syncLocalAgentActivity, dr as createSpaceRemoveMembersGuideError, dt as runDaemon, ea as buildInstallSelfJsonPayload, ei as createModelCatalogReadSession, en as readRecentDaemonDispatchJournalEvents, eo as readAgentActivityIntegrationStatus, er as createDoctorFailedGuideError, et as runAgentsShow, f as runSpaceSend, fa as OPENMELD_VERSION, fi as resolveAgentProfilePrimaryAgentControllerReport, fn as createProfileByKind, fo as readDaemonServiceContract, fr as createSpaceResultGuideError, ft as runDaemonAutostart, g as runSpaceReadWithPasswordRetry, ga as createPresenter, gi as notifyDaemonRouteCatalogChanged, gn as ensureAgentProfileRuntimeBinding, go as buildAgentActivityEvent, gr as createStartAgentIdentityGuideError, gt as runDaemonInterrupt, h as uploadPreparedSpaceFiles, ha as renderHumanTextErrorCard, hi as listBuiltinAgentsRegistryEntries, hn as promptTextEntry, ho as removeAgentActivityContextCache, hr as createSpaceUpdatesGuideError, ht as runDaemonInstall, i as runSpaceCreate, ia as ensureVersionStateReady, ii as readProfileWorkspaceConfig, in as evaluateCommandAuthentication, io as formatOpenMeldCliCommand, ir as createResetConfirmationGuideError, it as printOpenMeldBanner, j as assertValidSpaceIdTarget, ja as alignSelectedOpenMeldProfileStorage, ji as buildOnboardingPlan, jn as buildDispatchResultMessageReadProjection, jo as unbindProject, jr as buildDualViewGuideMessage, jt as readDaemonStartFailureLogTailLines, k as isSpaceCommandOutputHandledError, ka as resolveOpenMeldProfile, kn as upsertSpaceConfig, ko as runIfAgentActivityBindingGenerationIsCurrent, kr as DualViewGuideError, kt as shouldEmitAgentOverview, l as runSpaceList, la as resolveDaemonRuntimeContractCompatibility, li as describeProfileWorkspacePathValidationFailure, ln as buildAuthStatusRows, lo as resolveSetupFollowUpCliEntryCommand, lr as createSpaceMenuGuideError, lt as resolveGatewayWebOrigin, m as prepareRequestedSpaceSendFiles, ma as renderHumanErrorCard, mi as reconcileNewRunnableBuiltinAgentsForSetup, mn as resolveCreateProfileName, mo as readAgentActivityContextForPath, mr as createSpaceTargetGuideError, mt as runDaemonCancel, n as promptAndConfirmSpacePassword, na as buildNextVersionState, ni as ensureOpenMeldManagedProfileWorkspace, nn as buildCommandAuthenticationPromptMessage, no as uninstallAgentActivityIntegrations, nr as createProfileCreateGuideError, nt as colorizeAgentLabel, o as runSpaceHistory, oa as fetchLatestPackageInfo, oi as setCustomProfileWorkspace, on as runAuthLogout, oo as formatOpenMeldCliLine, or as createSpaceAliasTargetGuideError, ot as renderOpenMeldHeader, p as runSpaceWatch, pa as buildHumanErrorCopy, pi as listAgentTargetStates, pn as resolveCreateProfileKind, po as upsertDaemonServiceContract, pr as createSpaceSubcommandTargetGuideError, pt as runDaemonBackgroundStartForDecision, q as runAgentsCustomUpdate, qa as isAgentActivityRouteRegistered, qi as readCurrentDaemonRuntimeContext, qn as readDispatchSpaceActionContextFromEnv, qo as getOrganizationJoinLinkResponseSchema, qr as formatAgentReplyReadinessLabel, qt as runSkillsEnsure, r as runSpaceAddMembers, ra as compareSemver, ri as normalizeCustomProfileWorkspacePath, rn as ensureCommandAuthenticationOrCancel, ro as formatInlineOpenMeldCliCommands, rr as createProfileMenuGuideError, rt as colorizeDisplayProfileLabel, s as runSpaceJoin, sa as readVersionState, si as setOpenMeldManagedProfileWorkspace, sn as runAuthMenu, so as formatOpenMeldCliTextBlock, sr as createSpaceContractSetGuideError, st as renderOpenMeldLogo, t as buildCreateSpacePasswordPromptConfig, ta as performManagedInstall, ti as resolveProfileWorkspaceRuntime, tn as connectWebSocket, to as resolveAgentActivityDispatcherCommand, tr as createProfileActionGuideError, tt as formatTransportModeDisplay, u as runSpacePassword, ua as toStartBackgroundHelperExecutionCompatibility, ui as syncDeviceRuntimeStateProjection, un as buildAuthStatusSnapshot, uo as resolveUserFacingCliEntryCommand, ur as createSpacePublicationSetGuideError, ut as resolveSpaceSendText, v as buildHumanReadSignalsTranscriptItems, va as parseCliViewMode, vi as buildAgentControllerRef, vn as resolveServiceParticipationReadiness, vo as normalizeSharedSessionTitle, vr as createUpgradeConfirmationGuideError, vt as runDaemonRunAfterEntryChecks, w as buildFormalDispatchResultReadPayload, wa as createOpenMeldAgentProfile, wi as resolveAgentControllerPermissionModeForController, wn as collectLocalAgentControllerInventory, wo as bindProject, wr as getCliVersionInfo, wt as buildProfileWorkspacePresentation, x as loadSpaceIdentityDirectoryOrNull, xa as isSelectedOpenMeldProfileRequiredError, xi as getAgentControllerPermissionModeFieldLabel, xn as submitProfileRuntimeAgentControllerReport, xo as removeProjectInbox, xr as registerSpaceMemberSelectionOptions, xt as runDaemonStop, y as emitHumanReadSignalsTextProjection, ya as resolveRuntimeContext, yi as createAgentExecutionStatusDisplayRows, yn as assessActionParticipationCandidate, yo as readCodexSessionTitles, yr as getCommandEntryContract, yt as runDaemonSnapshot, z as resolveHumanControllerDisplayName, za as resolveAuthenticationGuidanceFromError, zi as resolveOpenMeldEnvironmentTarget, zn as promptSearchMultiselect, zo as errLine, zr as runPendingDaemonServiceUpdate, zt as parseJsonResponse } from "./command-Cp18onuk.js";
|
|
5
|
-
import { $ as ownerComputerDiagnosticsSchema, $t as agentActivityInventorySessionStatusSchema, B as sleep, Bt as agentActivityProviderSchema, Ct as authProfileKindSchema, D as toStructuredApiClientFailure, F as OPENMELD_HEADER_PROFILE_ID, G as projectSpaceDispatchTraceFinalVisibleOutcome, Ht as agentActivitySnapshotQuerySchema, J as spaceDispatchTraceDispatchStatusSchema, K as resolveSpaceDispatchTraceRootCause, Ot as submitFeedbackIssueRequestSchema, Qt as agentActivityInventorySessionOriginSchema, Vt as agentActivitySessionStatusSchema, W as SPACE_DISPATCH_TRACE_RESPONSE_CONTRACT_VERSION_HEADER, X as observabilityWakeTraceSelectorSchema, Y as spaceDispatchTraceResponseSchema, Z as projectObservabilityWakeCorrelation, _ as createOrganizationSkillsApi, b as createProjectsApi, c as createAgentProfileBindingApi, d as createCurrentDeviceApi, dn as START_BOUNDED_ID_SCHEMA, en as agentActivitySessionInventoryQuerySchema, et as projectOwnerComputerLocalRuntimes, f as createFeedbackApi, fn as START_BOUNDED_VERSION_SCHEMA, g as createOrganizationApi, gn as localAgentCatalogSchema, gt as organizationSkillBundleSchema, hn as startReplyReadinessSummarySchema, l as createCenterAgentApi, mn as START_TRIMMED_NON_EMPTY_STRING_SCHEMA, nn as localAgentSessionProviderSchema, nt as DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION, pn as START_ISO_DATE_TIME_SCHEMA, q as spaceDispatchTraceAttemptStatusSchema, rt as agentProfileCreationConfigurationSchema, s as createAgentActivityApi, tt as summarizeComputerFileAccessPolicy, u as createComputerFileAccessApi, v as createPrepareReadinessApi, wt as authProfileManagedRoleSchema, x as createRoutinesApi, yt as stringifyOrganizationSkillBundleCanonicalJson } from "./dist-
|
|
6
|
-
import { $n as array, Bt as resolveSpaceFileMimeType, Cr as clientMessageIdSchema, Lt as isSpaceFileTextEditable, Mt as centerAgentInteractionSourceSchema, Wr as openMeldProfileIdSchema, Yr as openMeldRuntimeProfileIdSchema, ar as int, bn as messageEnvelopeSchema, cn as spaceContractSchema, dr as object, er as boolean, hr as string, ii as trimmedStringFromUnknown, ir as enumFactory, jt as spaceStatusSchema, lr as nullFactory, mr as strictObject, ni as nonEmptyTrimmedStringFromUnknown, nn as dispatchExecutionSchema, nr as discriminatedUnion, or as iso, pr as record, rn as spaceThreadContextSchema, sn as spaceContractFieldsSchema, sr as literal, vr as union, yr as unknown } from "./runtime-transport-
|
|
3
|
+
import { $ as runWithHeldLock, $t as formatLocalMachineIssueMessage, A as toSpaceContractUrl, At as normalizeAccountKey, Bt as profileDir, D as normalizeBaseUrl, E as updateConfiguredStartV1OnboardingState, F as toSpaceDispatchTraceUrl, Ft as openMeldManagedVersionBinaryPath, G as buildOpenMeldOrphanedLockAction, Gt as resolveOpenMeldEnvPreset, K as isOpenMeldLockError, Lt as openMeldRootDir, Mt as openMeldBackupsDir, P as toSpaceDispatchLookupUrl, Pt as openMeldManagedBinaryPath, Q as resolveOpenMeldOrphanedLockIssue, Qt as systemDir, S as setConfiguredSkillsConfig, St as accountProfileViewPath, V as toSpaceResultUrl, Vt as profileViewPath, W as acquireLock, Wt as resolveOpenMeldCliEntryNameFromArgv, X as releaseLockSync, Xt as skillsDir, Z as repairOrphanedLegacyLocks, Zt as spacesDir, a as resolveBaseUrl, at as resolveCliContext, b as setConfiguredBaseUrl, c as resolveExplicitGatewayUrlOrThrow, ct as formatLaneScopeSentence, ft as createActiveSetupConcurrencyIssue, g as getConfiguredSkillsConfig, gt as toRecognizedLocalMachineFailureError, ht as isLocalMachineFailureError, k as toSpaceBoardUrl, lt as resolveOpenMeldLaneDescriptor, m as getConfiguredOnboardingDisclaimerAcceptedAt, mt as createOrphanedSetupConcurrencyIssue, nt as OPENMELD_CLI_CONTEXT_ENV_KEY, o as resolveBaseUrlOrNull, on as agentControllerConversationRefSchema, q as isOpenMeldOrphanedLockError, qt as resolveOpenMeldRootDir, tt as LEGACY_OPENMELD_AGENT_SESSION_ENV_KEY, u as alignRuntimeConfigStorage, ut as LocalMachineFailureError, w as updateConfiguredOnboardingConfig, wt as accountsDir, xt as accountProfileSpaceCacheDir, zt as organizationSkillReleaseDir } from "./base-url-BtqW4aLS.js";
|
|
4
|
+
import { $ as runAgentsRepair, $a as validateLocalProjectConnectionPath, $i as startCurrentCommandCheckScope, $n as assertDispatchOwnedRuntimePublicWriteAllowed, $o as cliJsonSkillsListEnvelopeSchema, $r as resolveDaemonServiceFreshnessWarning, $t as readBundledOpenMeldCliSkillDocumentByPath, A as assertFullSignalIdArgument, Aa as isSelectedOpenMeldProfileRequiredError, Ai as listAgentControllerPermissionModeOptions, An as submitRuntimeAgentControllerReport, Ao as removeProjectInbox, Ar as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, At as shouldEmitAgentOverview, B as persistAgentTransportSelection, Ba as alignSelectedOpenMeldProfileStorage, Bi as getSetupFlowCopy, Bn as buildDispatchResultReplyWorkflowProjection, Bo as unbindProject, Br as formatAgentOverviewPayload, Bt as parseJsonResponse, C as toSpaceMetaUpsertInput, Ca as renderHumanErrorCard, Ci as listBuiltinAgentsRegistryEntries, Cn as promptTextEntry, Co as readAgentActivityContextForPath, Cr as createSpaceUpdatesGuideError, Ct as runDaemonTeardownStrict, D as formatHumanReadTargetList, Da as parseCliViewMode, Di as createAgentExecutionStatusDisplayRows, Dn as assessActionParticipationCandidate, Do as normalizeSharedSessionTitle, Dr as getCommandEntryContract, Dt as reconcileCliVersionView, E as buildHumanReplyContextSummary, Ea as formatMessage, Ei as buildAgentControllerRef, En as resolveServiceParticipationReadiness, Eo as resolveObservedAgentActivityBinding, Er as createUpgradeConfirmationGuideError, Et as buildProfileWorkspaceRows, F as emitSpaceAgentOverview, Fa as deleteOpenMeldProfile, Fi as resolveEvidenceSyncHealth, Fn as resolveLocalAgentControllerReportDecision, Fo as listProjectConnectionsWithStatus, Fr as registerBuiltinAgentSelectionOptions, Ft as fetchSpaceMeta, G as runAgentsCustomList, Ga as buildHumanAuthenticationCard, Gi as resolveServiceUpdateUrgency, Gn as createSpaceMemberIdentityIndex, Go as renderTextInfoCard, Gr as canonicalizeAllowedActions, Gt as runDaemonStartDecisionPrompt, H as runAgents, Ha as getSelectedOpenMeldProfileId, Hi as resolveDaemonServiceAlignmentDecision, Hn as buildSignalMessageReadProjection, Ho as enqueueControllerTaskLifecycleEventWhileLocked, Hr as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, Ht as writeInstalledLocalComponentsSnapshot, I as emitSpaceCliAgentOverview, Ia as listOpenMeldProfiles, Ii as resolveNativeAgentControllerPermissionModeForController, In as inspectSpaceCacheFile, Io as migrateProjectBindingStore, Ir as buildAgentOverviewFromContract, It as updateSpaceMeta, J as runAgentsDetect, Ja as resolveAuthenticationGuidanceFromError, Ji as resolveAuthBaseUrl, Jn as promptSearchSelect, Jo as errLine, Jr as scheduleDaemonServiceUpdate, Jt as runSkillsEnsure, K as runAgentsCustomRemove, Ka as createAuthenticationError, Ki as assessServerRequiredVersion, Kn as formatRemovedCcRelationMessage, Ko as sanitizeTerminalDisplayText, Kr as readOpenMeldToolsUpdateContextFromEnv, Kt as collectSkillsReadinessSnapshot, L as prepareLocalAgentReadiness, La as primeOpenMeldProfilesSessionCache, Ln as upsertSpaceConfig, Lo as removeProjectConnection, Lr as DualViewGuideError, Lt as readGatewayJsonResponse, M as prepareAuthenticatedSpaceCommandContext, Ma as resolveOpenMeldProfileOrNull, Mi as resolveAgentControllerPermissionModeForController, Mn as collectLocalAgentControllerInventory, Mo as removeProjectOutbox, Mr as getCliVersionInfo, Mt as readDaemonStartFailureLogTailLines, N as resolveOpenMeldProfileForSpaceCommand, Na as createOpenMeldAgentProfile, Ni as resolveAgentExecutionStatus, Nn as resolveLocalAgentControllerBlockerReasonCodes, No as bindProject, Nr as registerDaemonControlTargetOptions, Nt as fetchSpaceUpdates, O as parseEnvelope, Oa as resolveRuntimeContext, Oi as getAgentControllerPermissionModeDisplayMetadata, On as computeRetryDelayMs, Oo as readCodexSessionTitles, Or as getCommandHintsFromContract, Ot as emitDaemonAgentOverview, P as resolveSpaceAccessLabel, Pa as createOpenMeldHumanProfile, Pi as resolveAgentProfileEditCapabilities, Pn as resolveLocalAgentControllerLaunchability, Po as listProjectBindings, Pr as registerAuthLoginRequestOptions, Pt as createCliSpaceApi, Q as runAgentsManage, Qa as LocalProjectConnectionError, Qi as resetCurrentCommandCheckState, Qn as isCliUpdateCheckApplicable, Qo as cliJsonOutputEnvelopeSchema, Qr as resolveServiceReadinessFromServiceStatus, Qt as ensureLocalSkills, R as buildReplyReadinessGuidance, Ra as resolveOpenMeldProfile, Ri as buildDaemonRouteObservationPresentation$1, Rn as assertNoRemovedCcSpaceAddressingSyntax, Ro as runIfAgentActivityBindingGenerationIsCurrent, Rr as formatDualViewGuideForDisplay, Rt as readGatewayTextResponse, S as loadSpaceSignalIndexOrNull, Sa as buildHumanErrorCopy, Si as reconcileNewRunnableBuiltinAgentsForSetup, Sn as resolveCreateProfileName, So as upsertDaemonServiceContract, Sr as createSpaceTargetGuideError, St as runDaemonStop, T as buildFormalSignalReadPayload, Ta as createPresenter, Ti as resolveLocalRegistryAgentIdFromAgentControllerRef, Tn as formatServiceParticipationReadinessLabel, To as buildAgentActivityEvent, Tr as createStartAuthenticationGuideError, Tt as buildProfileWorkspacePresentation, U as runAgentsConfig, Ua as setSelectedOpenMeldProfileId, Ui as classifyDaemonServiceRunStartability, Un as buildSpaceRoundReadProjection, Uo as readControllerTaskLifecycleOutboxHealth, Ur as areAllowedActionsEquivalent, Ut as resolveDaemonServiceParticipationStatus, V as resolveAgentProfileSetup, Va as clearSelectedOpenMeldProfileId, Vi as buildDaemonServiceTargetSpec, Vn as buildSignalIndex, Vo as canonicalizeLocalProjectPath, Vr as OPENMELD_AGENT_MENTAL_MODEL_LINES, Vt as resolveLocalComponentsStatus, W as runAgentsCustomAdd, Wa as buildAgentAuthenticationGuide, Wi as classifyDaemonServiceWakeability, Wn as buildUpdatesReplyWorkflowProjection, Wo as renderInfoCard, Wr as buildAgentFacingPublicationModeGuideLines, Wt as runDaemonServiceParticipationGate, X as runAgentsEnable, Xa as getProfileDefaultView, Xi as getCurrentCommandCheckState, Xn as runInteractivePrompt, Xo as outLine, Xr as resolveDaemonDeviceId, Xt as runSkillsUninstall, Y as runAgentsDisable, Ya as resolveAuthenticationGuidanceFromMessage, Yi as finishCurrentCommandCheckScope, Yn as isReturnKeypress, Yo as outJsonLine, Yr as ensureDaemonRuntimePaths, Yt as runSkillsInstall, Z as runAgentsList, Za as setProfileDefaultView, Zi as isCurrentCommandCheckScopeActive, Zn as assessCliUpdate, Zo as cliBinaryDeltaPatchSchema, Zr as formatDaemonFailureContextText, Zt as runSkillsUpdate, _ as runSpaceWriteWithPasswordRetry, _a as writeVersionState, _i as describeProfileWorkspacePathValidationFailure, _n as resolveDeviceAuthClientId, _o as formatProfileAwareOpenMeldCliCommands, _r as createSpaceMenuGuideError, _t as runDaemonInterrupt, a as runSpaceDelete, aa as isDaemonServiceJobNeverSpawned, ai as resolveGatewayChainReadiness, an as evaluateCommandAuthentication, ao as unregisterAgentActivityRoute, ar as formatDaemonServiceDowngradeBlockedRecommendation, as as compareAgentControllerRefsForDisplay, at as renderOpenMeldBrandBlockLines, b as buildIdentityOnlyMembersSnapshotForReadProjection, ba as resolveCurrentDaemonExpectedVersion, bi as resolveAgentProfilePrimaryAgentControllerReport, bn as createProfileByKind, bo as syncLocalAgentActivity, br as createSpaceResultGuideError, bt as runDaemonSnapshot, c as runSpaceLeave, ca as readRecentDaemonLifecycleEvents, ci as createModelCatalogReadSession, cn as runAuthMenu, co as installAgentActivityIntegrations, cr as createDoctorFailedGuideError, ct as renderOpenMeldTagline, d as runSpaceRemoveMembers, da as buildNextVersionState, di as normalizeCustomProfileWorkspacePath, dn as buildAuthStatusRows, do as uninstallAgentActivityIntegrations, dr as createProfileMenuGuideError, dt as bestEffortStopCurrentLaneDaemonService, ea as inspectDaemonServiceInventory, ei as resolveCurrentReplyReadinessSnapshot, en as readRuntimeReportingHealthState, eo as LocalDaemonControlPlaneClientError, er as readDispatchOwnedRuntimeGuard, es as cliJsonSkillsLoadEnvelopeSchema, et as runAgentsShow, f as runSpaceSend, fa as compareSemver, fi as readProfileWorkspaceConfig, fn as buildAuthStatusSnapshot, fo as formatInlineOpenMeldCliCommands, fr as createResetConfirmationGuideError, ft as runDaemon, g as runSpaceReadWithPasswordRetry, ga as readVersionState, gi as validateCustomProfileWorkspacePath, gn as requestDeviceToken, go as formatOpenMeldCliTextBlock, gr as createSpaceLeaveGuideError, gt as runDaemonInstall, h as uploadPreparedSpaceFiles, ha as fetchLatestPackageInfo, hi as setOpenMeldManagedProfileWorkspace, hn as fetchAuthUserSnapshot, ho as formatOpenMeldCliLine, hr as createSpaceContractSetGuideError, ht as runDaemonCancel, i as runSpaceCreate, ia as getDaemonSystemServiceLogPath, ii as mapAgentReplyReadinessToLegacyAutoReply, in as ensureCommandAuthenticationOrCancel, io as resolveAgentActivityRouteForPath, ir as resolveElapsedTimeMs, is as revokeOrganizationJoinLinkResponseSchema, it as printOpenMeldBanner, j as assertValidSpaceIdTarget, ja as requireOpenMeldProfile, ji as parseAgentControllerRef, jn as submitRuntimeAgentControllerReports, jo as readAgentActivityOutboxHealth, jr as registerSkillsTargetSelectionOptions, jt as runDaemonStartupPreflight, k as isSpaceCommandOutputHandledError, ka as resolveViewProfileKey, ki as getAgentControllerPermissionModeFieldLabel, kn as submitProfileRuntimeAgentControllerReport, ko as enqueueAgentActivityHookEvent, kr as registerSpaceMemberSelectionOptions, kt as createDelayedSpinner, l as runSpaceList, la as buildInstallSelfJsonPayload, li as resolveProfileWorkspaceRuntime, ln as runAuthStatus, lo as readAgentActivityIntegrationStatus, lr as createProfileActionGuideError, lt as resolveGatewayWebOrigin, m as prepareRequestedSpaceSendFiles, ma as fetchLatestCliBinaryRelease, mi as setCustomProfileWorkspace, mn as extractAuthApiErrorMessage, mo as formatOpenMeldCliCommands, mr as createSpaceAliasTargetGuideError, mt as runDaemonBackgroundStartForDecision, n as promptAndConfirmSpacePassword, na as readCurrentDaemonRuntimeContext, ni as formatDeviceReplyReadinessLabel, nn as connectWebSocket, no as isAgentActivityRouteRegistered, nr as writeDispatchSpaceActionRecord, ns as getOrganizationJoinLinkResponseSchema, nt as colorizeAgentLabel, o as runSpaceHistory, oa as readDaemonServiceJobCrashExitCode, oi as resolveOpenClawLocalDiagnosticsValue, on as runAuthLogin, or as formatDaemonServiceMissingRecommendation, ot as renderOpenMeldHeader, p as runSpaceWatch, pa as ensureVersionStateReady, pi as resolveConfiguredProfileWorkspacePath, pn as formatActiveOrganizationLabel, po as formatOpenMeldCliCommand, pr as createSpaceAddMembersGuideError, pt as runDaemonAutostart, q as runAgentsCustomUpdate, qa as resolveAuthenticationGuidance, qi as resolveOpenMeldEnvironmentTarget, qn as promptSearchMultiselect, qo as emitCliJsonEnvelope, qr as runPendingDaemonServiceUpdate, qt as runSkillsCheck$1, r as runSpaceAddMembers, ra as readCurrentObservedDaemonRuntimeStatus, ri as formatHumanReplyReadinessReason$1, rn as buildCommandAuthenticationPromptMessage, ro as registerAgentActivityRoute, rr as formatElapsedTime, rs as organizationJoinLinkErrorResponseSchema, rt as colorizeDisplayProfileLabel, s as runSpaceJoin, sa as resolveDaemonServiceManager, si as syncProfileWorkspaceState, sn as runAuthLogout, so as defaultManagedIntegrationPaths, sr as canUseInteractivePrompts, st as renderOpenMeldLogo, t as buildCreateSpacePasswordPromptConfig, ta as resolveVersionChangeDirection, ti as formatAgentReplyReadinessLabel, tn as readRecentDaemonDispatchJournalEvents, to as requestLocalAgentActivitySync, tr as readDispatchSpaceActionContextFromEnv, ts as cliJsonSkillsShowEnvelopeSchema, tt as formatTransportModeDisplay, u as runSpacePassword, ua as performManagedInstall, ui as ensureOpenMeldManagedProfileWorkspace, un as exchangeOneTimeTokenAuthSession, uo as resolveAgentActivityDispatcherCommand, ur as createProfileCreateGuideError, ut as resolveSpaceSendText, v as buildHumanReadSignalsTranscriptItems, va as resolveDaemonRuntimeContractCompatibility, vi as syncDeviceRuntimeStateProjection, vn as resolveDeviceTokenExpiresAt, vo as resolveSetupFollowUpCliEntryCommand, vr as createSpacePublicationSetGuideError, vt as runDaemonReinstall, w as buildFormalDispatchResultReadPayload, wa as renderHumanTextErrorCard, wi as notifyDaemonRouteCatalogChanged, wn as ensureAgentProfileRuntimeBinding, wo as removeAgentActivityContextCache, wr as createStartAgentIdentityGuideError, wt as runDaemonUninstall, x as loadSpaceIdentityDirectoryOrNull, xa as OPENMELD_VERSION, xi as listAgentTargetStates, xn as resolveCreateProfileKind, xo as readDaemonServiceContract, xr as createSpaceSubcommandTargetGuideError, xt as runDaemonStatusFlow, y as emitHumanReadSignalsTextProjection, ya as toStartBackgroundHelperExecutionCompatibility, yi as createPrimaryBindingReadSession, yn as revokeAuthAccessToken, yo as resolveUserFacingCliEntryCommand, yr as createSpaceRemoveMembersGuideError, yt as runDaemonRunAfterEntryChecks, z as resolveHumanControllerDisplayName, za as updateOpenMeldProfile, zi as buildOnboardingPlan, zn as buildDispatchResultMessageReadProjection, zo as setDefaultProjectConnection, zr as buildDualViewGuideMessage, zt as toStructuredGatewayFailure } from "./command-Dk3z-M2K.js";
|
|
5
|
+
import { $ as ownerComputerDiagnosticsSchema, $t as agentActivityInventorySessionStatusSchema, B as sleep, Bt as agentActivityProviderSchema, Ct as authProfileKindSchema, D as toStructuredApiClientFailure, F as OPENMELD_HEADER_PROFILE_ID, G as projectSpaceDispatchTraceFinalVisibleOutcome, Ht as agentActivitySnapshotQuerySchema, J as spaceDispatchTraceDispatchStatusSchema, K as resolveSpaceDispatchTraceRootCause, Ot as submitFeedbackIssueRequestSchema, Qt as agentActivityInventorySessionOriginSchema, Vt as agentActivitySessionStatusSchema, W as SPACE_DISPATCH_TRACE_RESPONSE_CONTRACT_VERSION_HEADER, X as observabilityWakeTraceSelectorSchema, Y as spaceDispatchTraceResponseSchema, Z as projectObservabilityWakeCorrelation, _ as createOrganizationSkillsApi, b as createProjectsApi, c as createAgentProfileBindingApi, d as createCurrentDeviceApi, dn as START_BOUNDED_ID_SCHEMA, en as agentActivitySessionInventoryQuerySchema, et as projectOwnerComputerLocalRuntimes, f as createFeedbackApi, fn as START_BOUNDED_VERSION_SCHEMA, g as createOrganizationApi, gn as localAgentCatalogSchema, gt as organizationSkillBundleSchema, hn as startReplyReadinessSummarySchema, l as createCenterAgentApi, mn as START_TRIMMED_NON_EMPTY_STRING_SCHEMA, nn as localAgentSessionProviderSchema, nt as DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION, pn as START_ISO_DATE_TIME_SCHEMA, q as spaceDispatchTraceAttemptStatusSchema, rt as agentProfileCreationConfigurationSchema, s as createAgentActivityApi, tt as summarizeComputerFileAccessPolicy, u as createComputerFileAccessApi, v as createPrepareReadinessApi, wt as authProfileManagedRoleSchema, x as createRoutinesApi, yt as stringifyOrganizationSkillBundleCanonicalJson } from "./dist-BnHChh7U.js";
|
|
6
|
+
import { $n as array, Bt as resolveSpaceFileMimeType, Cr as clientMessageIdSchema, Lt as isSpaceFileTextEditable, Mt as centerAgentInteractionSourceSchema, Wr as openMeldProfileIdSchema, Yr as openMeldRuntimeProfileIdSchema, ar as int, bn as messageEnvelopeSchema, cn as spaceContractSchema, dr as object, er as boolean, hr as string, ii as trimmedStringFromUnknown, ir as enumFactory, jt as spaceStatusSchema, lr as nullFactory, mr as strictObject, ni as nonEmptyTrimmedStringFromUnknown, nn as dispatchExecutionSchema, nr as discriminatedUnion, or as iso, pr as record, rn as spaceThreadContextSchema, sn as spaceContractFieldsSchema, sr as literal, vr as union, yr as unknown } from "./runtime-transport-CHbXitKu.js";
|
|
7
7
|
import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
|
|
8
|
-
import { j as getDaemonStatus } from "./daemon-runtime-lease-
|
|
9
|
-
import { a as
|
|
10
|
-
import { c as
|
|
8
|
+
import { j as getDaemonStatus } from "./daemon-runtime-lease-D82uDZ5s.js";
|
|
9
|
+
import { _ as isBinaryDistribution, a as clearAuthSession, c as getAuthSessionState, d as markInterruptedComputerAuthSessionRecovery, f as normalizeStoredActiveOrganization, g as runMacOsNativeKeychainHelperIfRequested, h as updateAuthSessionActiveOrganization, i as beginAuthSessionTransition, l as getCurrentAuthOwnerUserId, o as completeInterruptedComputerAuthSessionRecovery, p as recordInterruptedComputerAuthSessionRecoveryFailure, s as getAuthSessionMetadata, t as AuthSessionRecoveryInProgressError, u as getInterruptedComputerAuthSessionRecovery, v as resolveOpenMeldDistribution } from "./auth-session-B1jSy0ws.js";
|
|
10
|
+
import { c as buildOpenMeldRequestContextHeadersWithAuth, d as buildOpenMeldRequestContextFromProfile, l as buildRequestAuthHeaders, n as createCliApiClientFoundation, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout } from "./api-client-foundation-eG7A-GEB.js";
|
|
11
11
|
import { Command, Option } from "commander";
|
|
12
12
|
import os, { homedir, hostname, release, tmpdir } from "node:os";
|
|
13
13
|
import * as z$1 from "zod/v4";
|
|
@@ -3399,7 +3399,7 @@ async function resolveUpgradeStatus(input) {
|
|
|
3399
3399
|
distribution,
|
|
3400
3400
|
currentVersion: input.currentVersion,
|
|
3401
3401
|
checkedAt: input.checkedAt,
|
|
3402
|
-
error: toErrorMessage$
|
|
3402
|
+
error: toErrorMessage$9(error)
|
|
3403
3403
|
};
|
|
3404
3404
|
}
|
|
3405
3405
|
}
|
|
@@ -3483,7 +3483,7 @@ function parseInstallSelfJsonOutput(output) {
|
|
|
3483
3483
|
try {
|
|
3484
3484
|
parsed = JSON.parse(jsonLine);
|
|
3485
3485
|
} catch (error) {
|
|
3486
|
-
throw new Error(`binary install-self emitted invalid JSON: ${toErrorMessage$
|
|
3486
|
+
throw new Error(`binary install-self emitted invalid JSON: ${toErrorMessage$9(error)}`);
|
|
3487
3487
|
}
|
|
3488
3488
|
if (!parsed || typeof parsed !== "object") throw new Error("binary install-self emitted an invalid JSON payload");
|
|
3489
3489
|
const record = parsed;
|
|
@@ -3820,7 +3820,7 @@ function emitUpgradeCompleted(input) {
|
|
|
3820
3820
|
text: "OpenMeld CLI upgrade completed."
|
|
3821
3821
|
});
|
|
3822
3822
|
}
|
|
3823
|
-
function toErrorMessage$
|
|
3823
|
+
function toErrorMessage$9(error) {
|
|
3824
3824
|
if (error instanceof Error) return error.message;
|
|
3825
3825
|
return String(error);
|
|
3826
3826
|
}
|
|
@@ -5546,7 +5546,7 @@ const CHOOSE_PROFILE = "__command_entry_choose_profile__";
|
|
|
5546
5546
|
const CREATE_PROFILE = "__command_entry_create_profile__";
|
|
5547
5547
|
const CANCEL_PROFILE = "__command_entry_cancel_profile__";
|
|
5548
5548
|
async function runSelectedProfileCheck(input) {
|
|
5549
|
-
const explicitProfileArg = normalizeOptionalString$
|
|
5549
|
+
const explicitProfileArg = normalizeOptionalString$16(input.context.profileArg);
|
|
5550
5550
|
const hasExplicitProfileArg = explicitProfileArg !== null;
|
|
5551
5551
|
const requiresConfirmation = input.requirement.mode === "confirm" && input.context.runtime.resolvedView === "human" && input.context.allowPrompt && !hasExplicitProfileArg;
|
|
5552
5552
|
const currentState = getCurrentCommandCheckState();
|
|
@@ -5719,7 +5719,7 @@ function ensureCurrentProfileIsVisible(input) {
|
|
|
5719
5719
|
function resolveProfileConfirmationMessage(entryName) {
|
|
5720
5720
|
return entryName === "space.join" ? SPACE_JOIN_PROFILE_SELECTION_MESSAGE : SPACE_COMMAND_PROFILE_SELECTION_MESSAGE;
|
|
5721
5721
|
}
|
|
5722
|
-
function normalizeOptionalString$
|
|
5722
|
+
function normalizeOptionalString$16(value) {
|
|
5723
5723
|
const normalized = String(value ?? "").trim();
|
|
5724
5724
|
return normalized.length > 0 ? normalized : null;
|
|
5725
5725
|
}
|
|
@@ -6418,7 +6418,7 @@ async function runCommandWithEntryChecks(input) {
|
|
|
6418
6418
|
allowPrompt: runtime.interactive,
|
|
6419
6419
|
environmentTarget,
|
|
6420
6420
|
gatewayUrl: normalizedGatewayUrl,
|
|
6421
|
-
profileArg: normalizeOptionalString$
|
|
6421
|
+
profileArg: normalizeOptionalString$15(input.profile),
|
|
6422
6422
|
jsonOutput
|
|
6423
6423
|
}),
|
|
6424
6424
|
jsonOutput
|
|
@@ -6427,7 +6427,7 @@ async function runCommandWithEntryChecks(input) {
|
|
|
6427
6427
|
finishCurrentCommandCheckScope();
|
|
6428
6428
|
}
|
|
6429
6429
|
}
|
|
6430
|
-
function normalizeOptionalString$
|
|
6430
|
+
function normalizeOptionalString$15(value) {
|
|
6431
6431
|
const normalized = String(value ?? "").trim();
|
|
6432
6432
|
return normalized.length > 0 ? normalized : null;
|
|
6433
6433
|
}
|
|
@@ -7534,8 +7534,8 @@ function normalizeOrganizationSelectionPayload(payload) {
|
|
|
7534
7534
|
message: "OpenMeld auth returned an invalid Organization selection."
|
|
7535
7535
|
});
|
|
7536
7536
|
return {
|
|
7537
|
-
activeOrganizationId: normalizeOptionalString$
|
|
7538
|
-
lastSelectedOrganizationId: normalizeOptionalString$
|
|
7537
|
+
activeOrganizationId: normalizeOptionalString$14(payload.session.activeOrganizationId),
|
|
7538
|
+
lastSelectedOrganizationId: normalizeOptionalString$14(payload.user.lastSelectedOrganizationId)
|
|
7539
7539
|
};
|
|
7540
7540
|
}
|
|
7541
7541
|
function normalizeOrganizationListPayload(payload) {
|
|
@@ -7567,7 +7567,7 @@ function normalizeOrganizationFromPayload(payload) {
|
|
|
7567
7567
|
if (!isRecord(payload)) return null;
|
|
7568
7568
|
const organization = normalizeStoredActiveOrganization(payload.organization);
|
|
7569
7569
|
if (!organization) return null;
|
|
7570
|
-
const role = normalizeOptionalString$
|
|
7570
|
+
const role = normalizeOptionalString$14(payload.role) ?? (isRecord(payload.member) ? normalizeOptionalString$14(payload.member.role) : null);
|
|
7571
7571
|
return {
|
|
7572
7572
|
...organization,
|
|
7573
7573
|
...role ? { role } : {}
|
|
@@ -7637,13 +7637,13 @@ function parseJsonOrNull(raw) {
|
|
|
7637
7637
|
}
|
|
7638
7638
|
function readRequestId(payload) {
|
|
7639
7639
|
if (!isRecord(payload)) return null;
|
|
7640
|
-
return normalizeOptionalString$
|
|
7640
|
+
return normalizeOptionalString$14(payload.requestId) ?? (isRecord(payload.error) ? normalizeOptionalString$14(payload.error.requestId) : null);
|
|
7641
7641
|
}
|
|
7642
7642
|
function readErrorMessage(payload) {
|
|
7643
7643
|
if (!isRecord(payload)) return null;
|
|
7644
|
-
return normalizeOptionalString$
|
|
7644
|
+
return normalizeOptionalString$14(payload.message) ?? (isRecord(payload.error) ? normalizeOptionalString$14(payload.error.message) : null);
|
|
7645
7645
|
}
|
|
7646
|
-
function normalizeOptionalString$
|
|
7646
|
+
function normalizeOptionalString$14(value) {
|
|
7647
7647
|
const normalized = String(value ?? "").trim();
|
|
7648
7648
|
return normalized.length > 0 ? normalized : null;
|
|
7649
7649
|
}
|
|
@@ -8051,7 +8051,7 @@ async function createCenterAgentApiClient(input) {
|
|
|
8051
8051
|
const CODEX_THREAD_ID_ENV = "CODEX_THREAD_ID";
|
|
8052
8052
|
const CLAUDE_CODE_SESSION_ID_ENV = "CLAUDE_CODE_SESSION_ID";
|
|
8053
8053
|
function detectLocalAgentEnvironment(env) {
|
|
8054
|
-
const claudeSessionId = normalizeOptionalString$
|
|
8054
|
+
const claudeSessionId = normalizeOptionalString$13(env[CLAUDE_CODE_SESSION_ID_ENV]);
|
|
8055
8055
|
if (claudeSessionId) return {
|
|
8056
8056
|
kind: "agent",
|
|
8057
8057
|
agentControllerConversationId: claudeSessionId,
|
|
@@ -8059,7 +8059,7 @@ function detectLocalAgentEnvironment(env) {
|
|
|
8059
8059
|
conversationKind: "session",
|
|
8060
8060
|
label: "Claude Code"
|
|
8061
8061
|
};
|
|
8062
|
-
const codexThreadId = normalizeOptionalString$
|
|
8062
|
+
const codexThreadId = normalizeOptionalString$13(env[CODEX_THREAD_ID_ENV]);
|
|
8063
8063
|
if (codexThreadId) return {
|
|
8064
8064
|
kind: "agent",
|
|
8065
8065
|
agentControllerConversationId: codexThreadId,
|
|
@@ -8071,9 +8071,9 @@ function detectLocalAgentEnvironment(env) {
|
|
|
8071
8071
|
return { kind: "human" };
|
|
8072
8072
|
}
|
|
8073
8073
|
function isCodexLikeEnvironment(env) {
|
|
8074
|
-
return Boolean(normalizeOptionalString$
|
|
8074
|
+
return Boolean(normalizeOptionalString$13(env.CODEX_SHELL) || normalizeOptionalString$13(env.CODEX_CI) || normalizeOptionalString$13(env.CODEX_SESSION_ID) || normalizeOptionalString$13(env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE));
|
|
8075
8075
|
}
|
|
8076
|
-
function normalizeOptionalString$
|
|
8076
|
+
function normalizeOptionalString$13(value) {
|
|
8077
8077
|
if (typeof value !== "string") return null;
|
|
8078
8078
|
const normalized = value.trim();
|
|
8079
8079
|
return normalized.length > 0 ? normalized : null;
|
|
@@ -9453,6 +9453,190 @@ function formatLastSeen(lastObservedAtMs) {
|
|
|
9453
9453
|
}).format(new Date(lastObservedAtMs))}`;
|
|
9454
9454
|
}
|
|
9455
9455
|
//#endregion
|
|
9456
|
+
//#region src/commands/computer-auth-session.ts
|
|
9457
|
+
async function exchangeComputerAuthorizationGrant(input) {
|
|
9458
|
+
const authBaseUrl = resolveAuthBaseUrl(input.authBaseUrl);
|
|
9459
|
+
const clientId = resolveDeviceAuthClientId(input.clientId);
|
|
9460
|
+
const tokenResult = await requestDeviceToken({
|
|
9461
|
+
authBaseUrl,
|
|
9462
|
+
clientId,
|
|
9463
|
+
deviceCode: normalizeRequiredString(input.deviceCode, "computer authorization code is required")
|
|
9464
|
+
});
|
|
9465
|
+
if (!tokenResult.ok) throw new Error(`computer authorization failed: ${extractAuthApiErrorMessage(tokenResult.error, tokenResult.status)}`);
|
|
9466
|
+
let user;
|
|
9467
|
+
try {
|
|
9468
|
+
user = await fetchAuthUserSnapshot({
|
|
9469
|
+
authBaseUrl,
|
|
9470
|
+
accessToken: tokenResult.data.access_token
|
|
9471
|
+
});
|
|
9472
|
+
} catch (error) {
|
|
9473
|
+
const cleanup = await revokeAuthAccessToken({
|
|
9474
|
+
accessToken: tokenResult.data.access_token,
|
|
9475
|
+
authBaseUrl,
|
|
9476
|
+
tokenType: tokenResult.data.token_type
|
|
9477
|
+
});
|
|
9478
|
+
throw new Error(`computer authorization could not verify its OpenMeld account: ${toErrorMessage$8(error)}${formatCleanupFailure(cleanup)}`, { cause: error });
|
|
9479
|
+
}
|
|
9480
|
+
const userId = normalizeOptionalString$12(user?.id);
|
|
9481
|
+
if (!userId) {
|
|
9482
|
+
const cleanup = await revokeAuthAccessToken({
|
|
9483
|
+
accessToken: tokenResult.data.access_token,
|
|
9484
|
+
authBaseUrl,
|
|
9485
|
+
tokenType: tokenResult.data.token_type
|
|
9486
|
+
});
|
|
9487
|
+
throw new Error(`computer authorization account response did not include a user id${formatCleanupFailure(cleanup)}`);
|
|
9488
|
+
}
|
|
9489
|
+
const expiresAt = resolveDeviceTokenExpiresAt(tokenResult.data.expires_in);
|
|
9490
|
+
const scope = normalizeOptionalString$12(tokenResult.data.scope);
|
|
9491
|
+
return {
|
|
9492
|
+
accessToken: tokenResult.data.access_token,
|
|
9493
|
+
tokenType: tokenResult.data.token_type,
|
|
9494
|
+
authBaseUrl,
|
|
9495
|
+
clientId,
|
|
9496
|
+
...expiresAt ? { expiresAt } : {},
|
|
9497
|
+
...scope ? { scope } : {},
|
|
9498
|
+
user: {
|
|
9499
|
+
...user,
|
|
9500
|
+
id: userId
|
|
9501
|
+
}
|
|
9502
|
+
};
|
|
9503
|
+
}
|
|
9504
|
+
function revokePreparedAuthSession(session) {
|
|
9505
|
+
return revokeAuthAccessToken(session);
|
|
9506
|
+
}
|
|
9507
|
+
function formatCleanupFailure(result) {
|
|
9508
|
+
if (result.ok) return "";
|
|
9509
|
+
const status = result.error.status === null ? "network error" : `HTTP ${result.error.status}`;
|
|
9510
|
+
return `; cleanup failed at ${result.error.endpoint} (${status}): ${result.error.message}`;
|
|
9511
|
+
}
|
|
9512
|
+
function toErrorMessage$8(error) {
|
|
9513
|
+
return error instanceof Error && error.message.trim() ? error.message.trim() : String(error ?? "unknown error");
|
|
9514
|
+
}
|
|
9515
|
+
function normalizeRequiredString(value, message) {
|
|
9516
|
+
const normalized = normalizeOptionalString$12(value);
|
|
9517
|
+
if (!normalized) throw new Error(message);
|
|
9518
|
+
return normalized;
|
|
9519
|
+
}
|
|
9520
|
+
function normalizeOptionalString$12(value) {
|
|
9521
|
+
const normalized = String(value ?? "").trim();
|
|
9522
|
+
return normalized.length > 0 ? normalized : null;
|
|
9523
|
+
}
|
|
9524
|
+
//#endregion
|
|
9525
|
+
//#region src/commands/computer-auth-handoff-recovery.ts
|
|
9526
|
+
const UNUSED_SETUP_SESSION_CLEANUP_SUFFIX = " OpenMeld also could not revoke the unused setup session.";
|
|
9527
|
+
async function recoverInterruptedComputerAuthHandoff(input) {
|
|
9528
|
+
const recovery = await getInterruptedComputerAuthSessionRecovery();
|
|
9529
|
+
if (!recovery) return "none";
|
|
9530
|
+
const previousOwnerUserId = normalizeOptionalString$11(recovery.previousSession?.user?.id);
|
|
9531
|
+
if (!recovery.serviceReconciled) {
|
|
9532
|
+
const stopped = await bestEffortStopCurrentLaneDaemonService({ runtime: input.runtime });
|
|
9533
|
+
if (stopped.status === "warning") {
|
|
9534
|
+
const error = new Error(stopped.errorMessage ?? "OpenMeld could not stop the incomplete Computer connection.");
|
|
9535
|
+
await recordInterruptedComputerAuthSessionRecoveryFailure({
|
|
9536
|
+
id: recovery.id,
|
|
9537
|
+
message: error.message,
|
|
9538
|
+
phase: "service"
|
|
9539
|
+
});
|
|
9540
|
+
logDeferredComputerAuthHandoffRecovery({
|
|
9541
|
+
error: error.message,
|
|
9542
|
+
phase: "service",
|
|
9543
|
+
transitionId: recovery.id
|
|
9544
|
+
});
|
|
9545
|
+
throw error;
|
|
9546
|
+
}
|
|
9547
|
+
if (previousOwnerUserId) {
|
|
9548
|
+
const restored = await runDaemonServiceParticipationGate({
|
|
9549
|
+
intent: "start",
|
|
9550
|
+
presenter: input.presenter,
|
|
9551
|
+
resolvedView: input.runtime.resolvedView,
|
|
9552
|
+
allowPrompt: false,
|
|
9553
|
+
autoRepair: true,
|
|
9554
|
+
expectedOwnerUserId: previousOwnerUserId,
|
|
9555
|
+
forcePrompt: true,
|
|
9556
|
+
forceRefresh: true,
|
|
9557
|
+
gatewayUrl: recovery.gatewayUrl,
|
|
9558
|
+
suppressRefreshHumanResultCard: true,
|
|
9559
|
+
suppressStartSpinner: true,
|
|
9560
|
+
view: input.view
|
|
9561
|
+
});
|
|
9562
|
+
if (restored.status !== "aligned") {
|
|
9563
|
+
const error = new Error(restored.errorMessage ?? "OpenMeld could not reconnect the previous Computer account.");
|
|
9564
|
+
await recordInterruptedComputerAuthSessionRecoveryFailure({
|
|
9565
|
+
id: recovery.id,
|
|
9566
|
+
message: error.message,
|
|
9567
|
+
phase: "service"
|
|
9568
|
+
});
|
|
9569
|
+
logDeferredComputerAuthHandoffRecovery({
|
|
9570
|
+
error: error.message,
|
|
9571
|
+
phase: "service",
|
|
9572
|
+
transitionId: recovery.id
|
|
9573
|
+
});
|
|
9574
|
+
throw error;
|
|
9575
|
+
}
|
|
9576
|
+
}
|
|
9577
|
+
await markInterruptedComputerAuthSessionRecovery({
|
|
9578
|
+
id: recovery.id,
|
|
9579
|
+
phase: "service"
|
|
9580
|
+
});
|
|
9581
|
+
}
|
|
9582
|
+
if (!recovery.remoteSessionRevoked) {
|
|
9583
|
+
const revoked = await revokePreparedAuthSession(recovery.candidateSession);
|
|
9584
|
+
if (!revoked.ok) {
|
|
9585
|
+
await recordInterruptedComputerAuthSessionRecoveryFailure({
|
|
9586
|
+
endpoint: revoked.error.endpoint,
|
|
9587
|
+
id: recovery.id,
|
|
9588
|
+
message: revoked.error.message,
|
|
9589
|
+
phase: "remote_session",
|
|
9590
|
+
status: revoked.error.status
|
|
9591
|
+
});
|
|
9592
|
+
logDeferredComputerAuthHandoffRecovery({
|
|
9593
|
+
endpoint: revoked.error.endpoint,
|
|
9594
|
+
error: revoked.error.message,
|
|
9595
|
+
phase: "remote_session",
|
|
9596
|
+
status: revoked.error.status,
|
|
9597
|
+
transitionId: recovery.id
|
|
9598
|
+
});
|
|
9599
|
+
emitUnusedSetupSessionCleanupWarning(input.presenter, revoked.error);
|
|
9600
|
+
return "deferred";
|
|
9601
|
+
}
|
|
9602
|
+
await markInterruptedComputerAuthSessionRecovery({
|
|
9603
|
+
id: recovery.id,
|
|
9604
|
+
phase: "remote_session"
|
|
9605
|
+
});
|
|
9606
|
+
}
|
|
9607
|
+
return await completeInterruptedComputerAuthSessionRecovery(recovery.id) ? "completed" : "deferred";
|
|
9608
|
+
}
|
|
9609
|
+
function logDeferredComputerAuthHandoffRecovery(input) {
|
|
9610
|
+
console.warn("[openmeld.auth.computer_handoff_recovery_deferred]", {
|
|
9611
|
+
...input.endpoint ? { endpoint: input.endpoint } : {},
|
|
9612
|
+
error: input.error,
|
|
9613
|
+
phase: input.phase,
|
|
9614
|
+
...input.status === void 0 ? {} : { status: input.status },
|
|
9615
|
+
transitionId: input.transitionId
|
|
9616
|
+
});
|
|
9617
|
+
}
|
|
9618
|
+
function emitUnusedSetupSessionCleanupWarning(presenter, cleanupError) {
|
|
9619
|
+
presenter.line({
|
|
9620
|
+
code: "setup.computer_authorization.cleanup_warning",
|
|
9621
|
+
text: "OpenMeld kept the current Computer sign-in, but could not revoke the unused setup session. You can remove it later from Account sessions.",
|
|
9622
|
+
data: {
|
|
9623
|
+
endpoint: cleanupError.endpoint ?? null,
|
|
9624
|
+
status: cleanupError.status ?? null,
|
|
9625
|
+
error: cleanupError.message
|
|
9626
|
+
}
|
|
9627
|
+
});
|
|
9628
|
+
}
|
|
9629
|
+
function formatComputerAuthCleanupFailureSuffix(result) {
|
|
9630
|
+
if (result.ok) return "";
|
|
9631
|
+
const status = result.error.status === null ? "network error" : `HTTP ${result.error.status}`;
|
|
9632
|
+
return `${UNUSED_SETUP_SESSION_CLEANUP_SUFFIX} Cleanup endpoint ${result.error.endpoint} returned ${status}: ${result.error.message}`;
|
|
9633
|
+
}
|
|
9634
|
+
function normalizeOptionalString$11(value) {
|
|
9635
|
+
if (typeof value !== "string") return null;
|
|
9636
|
+
const normalized = value.trim();
|
|
9637
|
+
return normalized.length > 0 ? normalized : null;
|
|
9638
|
+
}
|
|
9639
|
+
//#endregion
|
|
9456
9640
|
//#region src/local-service/diagnostics/runtime-reporting-health-diagnostic.ts
|
|
9457
9641
|
const REPORTING_SUCCESS_STALE_AFTER_MS = 30 * 6e4;
|
|
9458
9642
|
const REPORTING_DEGRADED_FAILURE_THRESHOLD = 3;
|
|
@@ -9888,7 +10072,7 @@ async function runDoctorProfileCheck(input) {
|
|
|
9888
10072
|
}
|
|
9889
10073
|
openMeldProfile = {
|
|
9890
10074
|
ok: false,
|
|
9891
|
-
message: `openmeld-profile failed: ${toErrorMessage$
|
|
10075
|
+
message: `openmeld-profile failed: ${toErrorMessage$7(error)}`
|
|
9892
10076
|
};
|
|
9893
10077
|
}
|
|
9894
10078
|
emitCheckResult(input.presenter, openMeldProfile, {
|
|
@@ -10406,7 +10590,7 @@ async function runCheck(label, fn) {
|
|
|
10406
10590
|
} catch (err) {
|
|
10407
10591
|
return {
|
|
10408
10592
|
ok: false,
|
|
10409
|
-
message: `${label} failed: ${toErrorMessage$
|
|
10593
|
+
message: `${label} failed: ${toErrorMessage$7(err)}`
|
|
10410
10594
|
};
|
|
10411
10595
|
}
|
|
10412
10596
|
}
|
|
@@ -10540,7 +10724,7 @@ async function maybePromptRepairAfterLogin(presenter) {
|
|
|
10540
10724
|
function normalizeDoctorHumanText(text) {
|
|
10541
10725
|
return text.replace(DOCTOR_TEXT_PREFIX_RE, "");
|
|
10542
10726
|
}
|
|
10543
|
-
function toErrorMessage$
|
|
10727
|
+
function toErrorMessage$7(err) {
|
|
10544
10728
|
if (err instanceof Error) return err.message;
|
|
10545
10729
|
return String(err);
|
|
10546
10730
|
}
|
|
@@ -10612,11 +10796,11 @@ function resolveDaemonRouteSkipMessage(input) {
|
|
|
10612
10796
|
return `Reply route checks were skipped because the OpenMeld profile check failed: ${input.openMeldProfileMessage}`;
|
|
10613
10797
|
}
|
|
10614
10798
|
function resolveFeedbackInboxKey(input) {
|
|
10615
|
-
const fromCli = normalizeOptionalString$
|
|
10799
|
+
const fromCli = normalizeOptionalString$10(input.cliValue);
|
|
10616
10800
|
if (fromCli) return fromCli;
|
|
10617
|
-
return normalizeOptionalString$
|
|
10801
|
+
return normalizeOptionalString$10((input.env ?? process.env).OPENMELD_FEEDBACK_INBOX_KEY) ?? "feedback_key_8oDRg9Aq-Q4crzVGV6hUqhKT2dQpKkBn4bKg9bjXLcE";
|
|
10618
10802
|
}
|
|
10619
|
-
function normalizeOptionalString$
|
|
10803
|
+
function normalizeOptionalString$10(value) {
|
|
10620
10804
|
const normalized = String(value ?? "").trim();
|
|
10621
10805
|
return normalized.length > 0 ? normalized : null;
|
|
10622
10806
|
}
|
|
@@ -10900,7 +11084,7 @@ async function activateManagedCommandOrWarn(outcome) {
|
|
|
10900
11084
|
if (activationNotice) process$1.stderr.write(`${activationNotice}\n`);
|
|
10901
11085
|
if (activation.status === "unsupported_shell") process$1.stderr.write(`OpenMeld installed the CLI, but could not add the openmeld command to this shell automatically. Add ${dirname(outcome.currentPointerPath)} to your shell PATH.\n`);
|
|
10902
11086
|
} catch (error) {
|
|
10903
|
-
process$1.stderr.write(`OpenMeld installed the CLI, but could not update your shell PATH: ${toErrorMessage$
|
|
11087
|
+
process$1.stderr.write(`OpenMeld installed the CLI, but could not update your shell PATH: ${toErrorMessage$6(error)}. The managed command is ${outcome.currentPointerPath}.\n`);
|
|
10904
11088
|
}
|
|
10905
11089
|
}
|
|
10906
11090
|
function formatInstallSelfHuman(outcome) {
|
|
@@ -10908,7 +11092,7 @@ function formatInstallSelfHuman(outcome) {
|
|
|
10908
11092
|
if (outcome.result === "noop_same_version") return `OpenMeld CLI ${outcome.version} is already installed. Nothing to do.\n`;
|
|
10909
11093
|
return `A newer OpenMeld CLI (${outcome.previousVersion}) is already installed; keeping it. Use --force to install ${outcome.version} anyway.\n`;
|
|
10910
11094
|
}
|
|
10911
|
-
function toErrorMessage$
|
|
11095
|
+
function toErrorMessage$6(error) {
|
|
10912
11096
|
return error instanceof Error ? error.message : String(error);
|
|
10913
11097
|
}
|
|
10914
11098
|
//#endregion
|
|
@@ -10957,7 +11141,7 @@ async function resolveAgentControllerPermissionModeInput(input) {
|
|
|
10957
11141
|
value: input.agentControllerPermissionModeInput
|
|
10958
11142
|
});
|
|
10959
11143
|
if (!agentControllerPermissionMode) return { hasAnyAgentControllerPermissionModeInput: false };
|
|
10960
|
-
const agentControllerRef = normalizeOptionalString$
|
|
11144
|
+
const agentControllerRef = normalizeOptionalString$9(input.agentControllerRef);
|
|
10961
11145
|
assertAgentControllerPermissionModeSupported({
|
|
10962
11146
|
agentControllerPermissionMode,
|
|
10963
11147
|
agentControllerRef,
|
|
@@ -10978,7 +11162,7 @@ async function resolveAgentControllerPermissionModeInput(input) {
|
|
|
10978
11162
|
};
|
|
10979
11163
|
}
|
|
10980
11164
|
function normalizeAgentControllerPermissionModeCliInput(input) {
|
|
10981
|
-
const raw = normalizeOptionalString$
|
|
11165
|
+
const raw = normalizeOptionalString$9(input.value);
|
|
10982
11166
|
if (!raw) return null;
|
|
10983
11167
|
const options = listAgentControllerPermissionModeOptions(input.agentControllerRef ? { agentControllerRef: input.agentControllerRef } : void 0);
|
|
10984
11168
|
for (const option of options) if (raw === option.value) return option.value;
|
|
@@ -11081,7 +11265,7 @@ const AGENT_CONTROLLER_PERMISSION_MODE_BY_CLI_VALUE = {
|
|
|
11081
11265
|
"run-everything": "cursor:force",
|
|
11082
11266
|
runeverything: "cursor:force"
|
|
11083
11267
|
};
|
|
11084
|
-
function normalizeOptionalString$
|
|
11268
|
+
function normalizeOptionalString$9(value) {
|
|
11085
11269
|
const normalized = String(value ?? "").trim();
|
|
11086
11270
|
return normalized.length > 0 ? normalized : null;
|
|
11087
11271
|
}
|
|
@@ -11445,7 +11629,7 @@ async function runProfileShow(input) {
|
|
|
11445
11629
|
}
|
|
11446
11630
|
const presenter = createPresenter(runtime);
|
|
11447
11631
|
const allowPrompt = canUseInteractivePrompts(runtime);
|
|
11448
|
-
const explicitProfileId = normalizeOptionalString$
|
|
11632
|
+
const explicitProfileId = normalizeOptionalString$8(input.profile);
|
|
11449
11633
|
const visibleProfiles = explicitProfileId ? [] : await listVisibleProfilesForListByView(runtime.resolvedView);
|
|
11450
11634
|
const current = explicitProfileId ? null : await resolveCurrentProfileId({
|
|
11451
11635
|
profiles: visibleProfiles,
|
|
@@ -11927,7 +12111,7 @@ async function runProfileUpdate(input) {
|
|
|
11927
12111
|
}
|
|
11928
12112
|
const presenter = createPresenter(runtime);
|
|
11929
12113
|
const allowPrompt = canUseInteractivePrompts(runtime);
|
|
11930
|
-
const explicitProfileId = normalizeOptionalString$
|
|
12114
|
+
const explicitProfileId = normalizeOptionalString$8(input.profile);
|
|
11931
12115
|
const visibleProfiles = explicitProfileId ? [] : await listVisibleProfilesForListByView(runtime.resolvedView);
|
|
11932
12116
|
const current = explicitProfileId ? null : await resolveCurrentProfileId({
|
|
11933
12117
|
profiles: visibleProfiles,
|
|
@@ -12155,7 +12339,7 @@ function emitProfileUpdateCandidatesForHuman(input) {
|
|
|
12155
12339
|
}
|
|
12156
12340
|
}
|
|
12157
12341
|
async function resolveProfileUpdatePayload(input) {
|
|
12158
|
-
const profileName = normalizeOptionalString$
|
|
12342
|
+
const profileName = normalizeOptionalString$8(input.profileName);
|
|
12159
12343
|
const explicitAgentController = await resolveExplicitAgentControllerPatchForProfile({
|
|
12160
12344
|
agentController: input.agentController,
|
|
12161
12345
|
agentControllerConversationId: input.agentControllerConversationId,
|
|
@@ -12200,7 +12384,7 @@ async function resolveProfileUpdatePayload(input) {
|
|
|
12200
12384
|
}
|
|
12201
12385
|
function resolveExplicitWorkspacePatchForProfile(input) {
|
|
12202
12386
|
const normalizedMode = normalizeWorkspaceModeInput(input.workspaceMode);
|
|
12203
|
-
const normalizedWorkspacePath = normalizeOptionalString$
|
|
12387
|
+
const normalizedWorkspacePath = normalizeOptionalString$8(input.workspacePath);
|
|
12204
12388
|
if (!(normalizedMode || normalizedWorkspacePath)) return null;
|
|
12205
12389
|
if (input.profile.profileKind !== "agent") throw new Error("Workspace can only be configured for agent profiles.");
|
|
12206
12390
|
if (!normalizedMode) throw new Error("--workspace-path can only be used with --workspace-mode custom.");
|
|
@@ -12233,7 +12417,7 @@ function resolveExplicitModelSelectionPatchForProfile(input) {
|
|
|
12233
12417
|
};
|
|
12234
12418
|
}
|
|
12235
12419
|
async function resolveExplicitAgentControllerPermissionModePatchForProfile(input) {
|
|
12236
|
-
if (!normalizeOptionalString$
|
|
12420
|
+
if (!normalizeOptionalString$8(input.agentControllerPermissionModeInput)) return null;
|
|
12237
12421
|
if (input.profile.profileKind !== "agent") throw new Error("Agent Controller Permission Mode can only be configured for agent profiles.");
|
|
12238
12422
|
const currentBinding = input.agentControllerRef ? null : await resolveAgentProfilePrimaryAgentControllerReport({ profile: input.profile });
|
|
12239
12423
|
const agentControllerRef = input.agentControllerRef ?? currentBinding?.agentControllerRef ?? null;
|
|
@@ -12252,8 +12436,8 @@ async function resolveExplicitAgentControllerPermissionModePatchForProfile(input
|
|
|
12252
12436
|
};
|
|
12253
12437
|
}
|
|
12254
12438
|
async function resolveExplicitAgentControllerPatchForProfile(input) {
|
|
12255
|
-
const agentController = normalizeOptionalString$
|
|
12256
|
-
const agentControllerConversationId = normalizeOptionalString$
|
|
12439
|
+
const agentController = normalizeOptionalString$8(input.agentController);
|
|
12440
|
+
const agentControllerConversationId = normalizeOptionalString$8(input.agentControllerConversationId);
|
|
12257
12441
|
if (!(agentController || agentControllerConversationId)) return null;
|
|
12258
12442
|
if (input.profile.profileKind !== "agent") throw new Error("Agent controller can only be configured for agent profiles.");
|
|
12259
12443
|
if (!agentController) throw new Error("--agent-controller-conversation-id requires --agent-controller.");
|
|
@@ -12267,7 +12451,7 @@ async function resolveExplicitAgentControllerPatchForProfile(input) {
|
|
|
12267
12451
|
};
|
|
12268
12452
|
}
|
|
12269
12453
|
async function applyAgentProfileControllerBinding(input) {
|
|
12270
|
-
const agentControllerRef = normalizeOptionalString$
|
|
12454
|
+
const agentControllerRef = normalizeOptionalString$8(input.agentControllerRef);
|
|
12271
12455
|
const hasModelSelectionPatch = input.modelId !== void 0;
|
|
12272
12456
|
if (!(agentControllerRef || hasModelSelectionPatch)) return;
|
|
12273
12457
|
if (input.profile.profileKind !== "agent") throw new Error("Agent controller can only be configured for agent profiles.");
|
|
@@ -12405,7 +12589,7 @@ async function promptWorkspacePayload(profile) {
|
|
|
12405
12589
|
});
|
|
12406
12590
|
if (workspacePath.status === "cancelled") return { status: "cancelled" };
|
|
12407
12591
|
if (workspacePath.status === "back") continue;
|
|
12408
|
-
const customWorkspacePath = normalizeOptionalString$
|
|
12592
|
+
const customWorkspacePath = normalizeOptionalString$8(workspacePath.value);
|
|
12409
12593
|
if (!customWorkspacePath) throw new Error("Custom workspace path is required.");
|
|
12410
12594
|
return {
|
|
12411
12595
|
status: "submitted",
|
|
@@ -12510,7 +12694,7 @@ async function promptModelSelectionPayload(profile) {
|
|
|
12510
12694
|
});
|
|
12511
12695
|
if (isCancel(selectedReasoningLevel)) return { status: "cancelled" };
|
|
12512
12696
|
if (selectedReasoningLevel === BACK_UPDATE_FIELD_SELECTION) return { status: "back" };
|
|
12513
|
-
const reasoningLevel = normalizeOptionalString$
|
|
12697
|
+
const reasoningLevel = normalizeOptionalString$8(selectedReasoningLevel);
|
|
12514
12698
|
return {
|
|
12515
12699
|
status: "submitted",
|
|
12516
12700
|
value: {
|
|
@@ -12578,7 +12762,7 @@ async function promptProfileNamePayload(currentProfileName) {
|
|
|
12578
12762
|
});
|
|
12579
12763
|
if (nextName.status === "cancelled") return { status: "cancelled" };
|
|
12580
12764
|
if (nextName.status === "back") return { status: "back" };
|
|
12581
|
-
const profileName = normalizeOptionalString$
|
|
12765
|
+
const profileName = normalizeOptionalString$8(nextName.value);
|
|
12582
12766
|
if (!profileName) throw new Error("profileName is required");
|
|
12583
12767
|
return {
|
|
12584
12768
|
status: "submitted",
|
|
@@ -12834,11 +13018,11 @@ function buildProfileSearchItem(input) {
|
|
|
12834
13018
|
function buildProfileSearchText(profile) {
|
|
12835
13019
|
return [
|
|
12836
13020
|
profile.openMeldProfileId,
|
|
12837
|
-
normalizeOptionalString$
|
|
13021
|
+
normalizeOptionalString$8(profile.profileName),
|
|
12838
13022
|
profile.profileKind,
|
|
12839
|
-
normalizeOptionalString$
|
|
12840
|
-
normalizeOptionalString$
|
|
12841
|
-
normalizeOptionalString$
|
|
13023
|
+
normalizeOptionalString$8(profile.ownerUserId),
|
|
13024
|
+
normalizeOptionalString$8(profile.ownerName),
|
|
13025
|
+
normalizeOptionalString$8(profile.source)
|
|
12842
13026
|
].filter((value) => typeof value === "string").join("\n");
|
|
12843
13027
|
}
|
|
12844
13028
|
function resolveProfileSelectLabel(input) {
|
|
@@ -12889,7 +13073,7 @@ function normalizeProfileDisplayName(profile) {
|
|
|
12889
13073
|
}
|
|
12890
13074
|
function normalizeAgentControllerArgumentInput(input) {
|
|
12891
13075
|
const agentController = String(input.agentController ?? "").trim();
|
|
12892
|
-
const agentControllerConversationId = normalizeOptionalString$
|
|
13076
|
+
const agentControllerConversationId = normalizeOptionalString$8(input.agentControllerConversationId);
|
|
12893
13077
|
const hasControllerEnabled = typeof input.controllerEnabled === "boolean";
|
|
12894
13078
|
const hasAnyAgentControllerInput = Boolean(agentController) || Boolean(agentControllerConversationId) || hasControllerEnabled;
|
|
12895
13079
|
return {
|
|
@@ -13097,7 +13281,7 @@ function resolveProfileUpdateCommandExamples() {
|
|
|
13097
13281
|
function toProfileActionGuideExamples(_input) {
|
|
13098
13282
|
return {};
|
|
13099
13283
|
}
|
|
13100
|
-
function normalizeOptionalString$
|
|
13284
|
+
function normalizeOptionalString$8(value) {
|
|
13101
13285
|
const normalized = String(value ?? "").trim();
|
|
13102
13286
|
return normalized.length > 0 ? normalized : null;
|
|
13103
13287
|
}
|
|
@@ -13108,8 +13292,8 @@ function normalizeWorkspaceModeInput(value) {
|
|
|
13108
13292
|
throw new Error("--workspace-mode must be openmeld-managed|custom");
|
|
13109
13293
|
}
|
|
13110
13294
|
function normalizeModelSelectionInput(input) {
|
|
13111
|
-
const modelId = normalizeOptionalString$
|
|
13112
|
-
const reasoningLevel = normalizeOptionalString$
|
|
13295
|
+
const modelId = normalizeOptionalString$8(input.model);
|
|
13296
|
+
const reasoningLevel = normalizeOptionalString$8(input.reasoningEffort);
|
|
13113
13297
|
if (!(modelId || reasoningLevel)) return { hasAnyModelSelectionInput: false };
|
|
13114
13298
|
if (!modelId) throw new Error("--reasoning-effort requires --model.");
|
|
13115
13299
|
return {
|
|
@@ -13664,7 +13848,7 @@ async function resolvePrepareReadinessApiEvidence(input) {
|
|
|
13664
13848
|
} catch (error) {
|
|
13665
13849
|
console.warn("[openmeld.prepare_readiness.api_read_failed]", {
|
|
13666
13850
|
event: "cli.prepare_readiness.api_read_failed",
|
|
13667
|
-
error: toErrorMessage$
|
|
13851
|
+
error: toErrorMessage$5(error),
|
|
13668
13852
|
profileId: input.profile.openMeldProfileId
|
|
13669
13853
|
});
|
|
13670
13854
|
return unavailableEvidence({
|
|
@@ -13705,7 +13889,7 @@ function unavailableEvidence(input) {
|
|
|
13705
13889
|
status: "unavailable"
|
|
13706
13890
|
};
|
|
13707
13891
|
}
|
|
13708
|
-
function toErrorMessage$
|
|
13892
|
+
function toErrorMessage$5(error) {
|
|
13709
13893
|
if (error instanceof Error) {
|
|
13710
13894
|
const message = error.message.trim();
|
|
13711
13895
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -14118,10 +14302,10 @@ function resolveDaemonDispatchJournalEvidence(dispatchId) {
|
|
|
14118
14302
|
};
|
|
14119
14303
|
}
|
|
14120
14304
|
async function resolveDispatchTraceSelection(input) {
|
|
14121
|
-
const dispatchSelector = normalizeOptionalString$
|
|
14122
|
-
const sourceSignalSelector = normalizeOptionalString$
|
|
14123
|
-
const clientMessageSelector = normalizeOptionalString$
|
|
14124
|
-
const targetProfileSelector = normalizeOptionalString$
|
|
14305
|
+
const dispatchSelector = normalizeOptionalString$7(input.dispatchId);
|
|
14306
|
+
const sourceSignalSelector = normalizeOptionalString$7(input.sourceSignalId);
|
|
14307
|
+
const clientMessageSelector = normalizeOptionalString$7(input.clientMessageId);
|
|
14308
|
+
const targetProfileSelector = normalizeOptionalString$7(input.targetProfileId);
|
|
14125
14309
|
if (Number(dispatchSelector !== null) + Number(sourceSignalSelector !== null) + Number(clientMessageSelector !== null) !== 1) throw new Error("exactly one of dispatchId, sourceSignalId, or clientMessageId is required");
|
|
14126
14310
|
if (dispatchSelector) return {
|
|
14127
14311
|
dispatchId: dispatchSelector,
|
|
@@ -14628,7 +14812,7 @@ function parenthesizedDetail(value, label) {
|
|
|
14628
14812
|
return detail.length > 0 ? detail : null;
|
|
14629
14813
|
}
|
|
14630
14814
|
async function resolveServiceTraceActorProfile(input) {
|
|
14631
|
-
if (normalizeOptionalString$
|
|
14815
|
+
if (normalizeOptionalString$7(input.explicitProfileId) || !canUseInteractivePrompts(input.runtime)) return input.actingProfile;
|
|
14632
14816
|
while (true) {
|
|
14633
14817
|
const selectedAction = await select({
|
|
14634
14818
|
message: `Use ${input.actingProfile.profileName} (${input.actingProfile.openMeldProfileId}) to read this dispatch trace?`,
|
|
@@ -15509,7 +15693,7 @@ function truncateText(text, maxLength) {
|
|
|
15509
15693
|
if (text.length <= maxLength) return text;
|
|
15510
15694
|
return `${text.slice(0, maxLength)}...`;
|
|
15511
15695
|
}
|
|
15512
|
-
function normalizeOptionalString$
|
|
15696
|
+
function normalizeOptionalString$7(value) {
|
|
15513
15697
|
const normalized = String(value ?? "").trim();
|
|
15514
15698
|
return normalized.length > 0 ? normalized : null;
|
|
15515
15699
|
}
|
|
@@ -16199,7 +16383,7 @@ async function runSetupFirstBootstrap(input) {
|
|
|
16199
16383
|
const stepError = error instanceof SetupBootstrapStepError ? error : null;
|
|
16200
16384
|
const cause = stepError?.causeValue ?? error;
|
|
16201
16385
|
const failedStep = stepError?.step ?? "unknown";
|
|
16202
|
-
const message = toErrorMessage$
|
|
16386
|
+
const message = toErrorMessage$4(cause);
|
|
16203
16387
|
console.warn("[openmeld.setup.bootstrap.failed]", {
|
|
16204
16388
|
event: "cli.setup.bootstrap.failed",
|
|
16205
16389
|
error: message,
|
|
@@ -16263,13 +16447,13 @@ var SetupBootstrapStepError = class extends Error {
|
|
|
16263
16447
|
causeValue;
|
|
16264
16448
|
step;
|
|
16265
16449
|
constructor(step, causeValue) {
|
|
16266
|
-
super(`${step}: ${toErrorMessage$
|
|
16450
|
+
super(`${step}: ${toErrorMessage$4(causeValue)}`);
|
|
16267
16451
|
this.name = "SetupBootstrapStepError";
|
|
16268
16452
|
this.step = step;
|
|
16269
16453
|
this.causeValue = causeValue;
|
|
16270
16454
|
}
|
|
16271
16455
|
};
|
|
16272
|
-
function toErrorMessage$
|
|
16456
|
+
function toErrorMessage$4(error) {
|
|
16273
16457
|
if (error instanceof Error && error.message.trim().length > 0) return error.message;
|
|
16274
16458
|
if (typeof error === "string" && error.trim().length > 0) return error;
|
|
16275
16459
|
return "Unknown setup bootstrap error.";
|
|
@@ -16337,7 +16521,7 @@ async function acquireSetupCommandLockWithTakeover(input) {
|
|
|
16337
16521
|
pid,
|
|
16338
16522
|
startedAtLabel
|
|
16339
16523
|
};
|
|
16340
|
-
if (!(normalizeOptionalString$
|
|
16524
|
+
if (!(normalizeOptionalString$6(input.startSession) !== null && pid !== null && pid !== deps.selfPid && deps.probePid(pid) === "alive")) return {
|
|
16341
16525
|
status: "contended",
|
|
16342
16526
|
...contendedBase,
|
|
16343
16527
|
takeoverAttempted: false
|
|
@@ -16574,7 +16758,7 @@ function getErrorCode(error) {
|
|
|
16574
16758
|
const code = error.code;
|
|
16575
16759
|
return typeof code === "string" ? code : void 0;
|
|
16576
16760
|
}
|
|
16577
|
-
function normalizeOptionalString$
|
|
16761
|
+
function normalizeOptionalString$6(value) {
|
|
16578
16762
|
const normalized = String(value ?? "").trim();
|
|
16579
16763
|
return normalized.length > 0 ? normalized : null;
|
|
16580
16764
|
}
|
|
@@ -16862,7 +17046,7 @@ var PrepareSessionCancelledError = class extends Error {
|
|
|
16862
17046
|
}
|
|
16863
17047
|
};
|
|
16864
17048
|
async function runPrepareSessionExecutor(input) {
|
|
16865
|
-
let initial = await
|
|
17049
|
+
let initial = input.initialSnapshot ?? await resolvePrepareSessionForHandoff({
|
|
16866
17050
|
gatewayUrl: input.gatewayUrl,
|
|
16867
17051
|
opaqueToken: input.startSession
|
|
16868
17052
|
});
|
|
@@ -16921,7 +17105,7 @@ async function reconnectPrepareSession(input) {
|
|
|
16921
17105
|
if (Date.now() >= deadlineMs) break;
|
|
16922
17106
|
let snapshot;
|
|
16923
17107
|
try {
|
|
16924
|
-
snapshot = await
|
|
17108
|
+
snapshot = await resolvePrepareSessionForHandoff({
|
|
16925
17109
|
gatewayUrl: input.input.gatewayUrl,
|
|
16926
17110
|
opaqueToken: input.input.startSession
|
|
16927
17111
|
});
|
|
@@ -17818,7 +18002,7 @@ function buildPrepareSessionExecutorCompletionFacts(input) {
|
|
|
17818
18002
|
};
|
|
17819
18003
|
}
|
|
17820
18004
|
function isTransientSelectedAgentConnectionError(error) {
|
|
17821
|
-
const rawMessage = toErrorMessage$
|
|
18005
|
+
const rawMessage = toErrorMessage$3(error).toLowerCase();
|
|
17822
18006
|
return rawMessage.includes("service has not finished starting") || rawMessage.includes("openmeld service is not running") || rawMessage.includes("service.not_running") || rawMessage.includes("service_contract_unavailable") || rawMessage.includes("runtime.reporting.write_failed");
|
|
17823
18007
|
}
|
|
17824
18008
|
async function finishPrepareSetup() {
|
|
@@ -18079,7 +18263,7 @@ async function connectPrepareSessionStream(input) {
|
|
|
18079
18263
|
}
|
|
18080
18264
|
};
|
|
18081
18265
|
}
|
|
18082
|
-
async function
|
|
18266
|
+
async function resolvePrepareSessionForHandoff(input) {
|
|
18083
18267
|
const response = await fetchSpaceRequestWithTimeout({
|
|
18084
18268
|
url: new URL("/v1/prepare/sessions/resolve-token", input.gatewayUrl).toString(),
|
|
18085
18269
|
operation: "prepare.session.resolve_token",
|
|
@@ -18186,7 +18370,7 @@ function toStatusCodeSlug(title) {
|
|
|
18186
18370
|
const slug = title.toLowerCase().replaceAll(/[^a-z0-9]+/g, "_").replaceAll(/^_+|_+$/g, "");
|
|
18187
18371
|
return slug.length > 0 ? slug : "status";
|
|
18188
18372
|
}
|
|
18189
|
-
function toErrorMessage$
|
|
18373
|
+
function toErrorMessage$3(error) {
|
|
18190
18374
|
if (error instanceof Error) {
|
|
18191
18375
|
const message = error.message.trim();
|
|
18192
18376
|
return message.length > 0 ? message : "unknown error";
|
|
@@ -18225,6 +18409,193 @@ function errorFromPrepareSessionServerError(input) {
|
|
|
18225
18409
|
return new Error(input.message);
|
|
18226
18410
|
}
|
|
18227
18411
|
//#endregion
|
|
18412
|
+
//#region src/commands/computer-auth-handoff.ts
|
|
18413
|
+
function runComputerAuthorizationHandoff(input) {
|
|
18414
|
+
return runPreparedComputerAuthHandoff({
|
|
18415
|
+
...input,
|
|
18416
|
+
exchangeCandidate: async () => await exchangeComputerAuthorizationGrant({ deviceCode: input.deviceCode })
|
|
18417
|
+
});
|
|
18418
|
+
}
|
|
18419
|
+
function runOneTimeTokenComputerHandoff(input) {
|
|
18420
|
+
return runPreparedComputerAuthHandoff({
|
|
18421
|
+
...input,
|
|
18422
|
+
exchangeCandidate: async () => await exchangeOneTimeTokenAuthSession({
|
|
18423
|
+
authBaseUrl: resolveAuthBaseUrl(),
|
|
18424
|
+
clientId: "openmeld-cli",
|
|
18425
|
+
token: input.oneTimeToken
|
|
18426
|
+
})
|
|
18427
|
+
});
|
|
18428
|
+
}
|
|
18429
|
+
async function runPreparedComputerAuthHandoff(input) {
|
|
18430
|
+
if (await recoverInterruptedComputerAuthHandoff({
|
|
18431
|
+
presenter: input.presenter,
|
|
18432
|
+
runtime: input.runtime,
|
|
18433
|
+
view: input.view
|
|
18434
|
+
}) === "deferred") throw new AuthSessionRecoveryInProgressError();
|
|
18435
|
+
const gatewayUrl = await resolveBaseUrl();
|
|
18436
|
+
const initialSnapshot = await resolvePrepareSessionForHandoff({
|
|
18437
|
+
gatewayUrl,
|
|
18438
|
+
opaqueToken: input.startSession
|
|
18439
|
+
});
|
|
18440
|
+
const candidate = await input.exchangeCandidate();
|
|
18441
|
+
await assertPrepareSessionOwner({
|
|
18442
|
+
candidate,
|
|
18443
|
+
ownerUserId: initialSnapshot.ownerUserId
|
|
18444
|
+
});
|
|
18445
|
+
if (!await confirmComputerAccountSwitch({
|
|
18446
|
+
candidate,
|
|
18447
|
+
currentSession: await resolveCurrentComputerSession(candidate),
|
|
18448
|
+
interactive: input.interactive,
|
|
18449
|
+
presenter: input.presenter,
|
|
18450
|
+
resolvedView: input.runtime.resolvedView
|
|
18451
|
+
})) {
|
|
18452
|
+
const revoked = await revokePreparedAuthSession(candidate);
|
|
18453
|
+
if (!revoked.ok) emitUnusedSetupSessionCleanupWarning(input.presenter, revoked.error);
|
|
18454
|
+
return {
|
|
18455
|
+
reason: "user_cancelled",
|
|
18456
|
+
status: "not_completed"
|
|
18457
|
+
};
|
|
18458
|
+
}
|
|
18459
|
+
const transition = await beginComputerSessionTransition({
|
|
18460
|
+
candidate,
|
|
18461
|
+
gatewayUrl
|
|
18462
|
+
});
|
|
18463
|
+
try {
|
|
18464
|
+
const sessionResult = await runPrepareSessionExecutor({
|
|
18465
|
+
gatewayUrl,
|
|
18466
|
+
initialSnapshot,
|
|
18467
|
+
startSession: input.startSession,
|
|
18468
|
+
runtime: input.runtime,
|
|
18469
|
+
presenter: input.presenter,
|
|
18470
|
+
interactive: input.interactive,
|
|
18471
|
+
localAgentSelection: input.localAgentSelection,
|
|
18472
|
+
view: input.view
|
|
18473
|
+
});
|
|
18474
|
+
if (sessionResult.status !== "completed") {
|
|
18475
|
+
await restorePreviousComputerAfterFailedHandoff({
|
|
18476
|
+
candidate,
|
|
18477
|
+
gatewayUrl,
|
|
18478
|
+
presenter: input.presenter,
|
|
18479
|
+
runtime: input.runtime,
|
|
18480
|
+
transition,
|
|
18481
|
+
view: input.view
|
|
18482
|
+
});
|
|
18483
|
+
return sessionResult;
|
|
18484
|
+
}
|
|
18485
|
+
await transition.commit();
|
|
18486
|
+
return sessionResult;
|
|
18487
|
+
} catch (error) {
|
|
18488
|
+
try {
|
|
18489
|
+
await restorePreviousComputerAfterFailedHandoff({
|
|
18490
|
+
candidate,
|
|
18491
|
+
gatewayUrl,
|
|
18492
|
+
presenter: input.presenter,
|
|
18493
|
+
runtime: input.runtime,
|
|
18494
|
+
transition,
|
|
18495
|
+
view: input.view
|
|
18496
|
+
});
|
|
18497
|
+
} catch (recoveryError) {
|
|
18498
|
+
throw new Error(`Computer setup failed, and OpenMeld could not restore the previous local account: ${toErrorMessage$2(recoveryError)}`, { cause: error });
|
|
18499
|
+
}
|
|
18500
|
+
throw error;
|
|
18501
|
+
}
|
|
18502
|
+
}
|
|
18503
|
+
async function assertPrepareSessionOwner(input) {
|
|
18504
|
+
if (input.candidate.user.id === input.ownerUserId) return;
|
|
18505
|
+
const revoked = await revokePreparedAuthSession(input.candidate);
|
|
18506
|
+
throw new Error(`This setup command and its computer authorization belong to different OpenMeld accounts. Copy a fresh setup command from OpenMeld Web and try again.${formatComputerAuthCleanupFailureSuffix(revoked)}`);
|
|
18507
|
+
}
|
|
18508
|
+
async function resolveCurrentComputerSession(candidate) {
|
|
18509
|
+
let currentState;
|
|
18510
|
+
try {
|
|
18511
|
+
currentState = await getAuthSessionState({ validateRemote: false });
|
|
18512
|
+
} catch (error) {
|
|
18513
|
+
const revoked = await revokePreparedAuthSession(candidate);
|
|
18514
|
+
throw new Error(`OpenMeld could not inspect the current Computer sign-in. The current Computer connection was not changed. ${toErrorMessage$2(error)}${formatComputerAuthCleanupFailureSuffix(revoked)}`, { cause: error });
|
|
18515
|
+
}
|
|
18516
|
+
if (currentState.state === "missing" || currentState.session) return currentState.session;
|
|
18517
|
+
const revoked = await revokePreparedAuthSession(candidate);
|
|
18518
|
+
const detail = normalizeOptionalString$5(currentState.errorMessage) ?? normalizeOptionalString$5(currentState.reasonCode);
|
|
18519
|
+
throw new Error(`OpenMeld could not inspect the current Computer sign-in. The current Computer connection was not changed.${detail ? ` ${detail}` : ""}${formatComputerAuthCleanupFailureSuffix(revoked)}`);
|
|
18520
|
+
}
|
|
18521
|
+
async function beginComputerSessionTransition(input) {
|
|
18522
|
+
try {
|
|
18523
|
+
return await beginAuthSessionTransition(input.candidate, { computerHandoff: { gatewayUrl: input.gatewayUrl } });
|
|
18524
|
+
} catch (error) {
|
|
18525
|
+
const revoked = await revokePreparedAuthSession(input.candidate);
|
|
18526
|
+
if (!revoked.ok) throw new Error(`OpenMeld could not save the new Computer sign-in.${formatComputerAuthCleanupFailureSuffix(revoked)} ${toErrorMessage$2(error)}`, { cause: error });
|
|
18527
|
+
throw error;
|
|
18528
|
+
}
|
|
18529
|
+
}
|
|
18530
|
+
async function confirmComputerAccountSwitch(input) {
|
|
18531
|
+
const currentUserId = normalizeOptionalString$5(input.currentSession?.user?.id);
|
|
18532
|
+
if (!input.currentSession) return true;
|
|
18533
|
+
if (!currentUserId) {
|
|
18534
|
+
const revoked = await revokePreparedAuthSession(input.candidate);
|
|
18535
|
+
throw new Error(`OpenMeld could not verify the account currently connected to this Computer. The current Computer connection was not changed.${formatComputerAuthCleanupFailureSuffix(revoked)}`);
|
|
18536
|
+
}
|
|
18537
|
+
if (currentUserId === input.candidate.user.id) return true;
|
|
18538
|
+
const currentAccount = normalizeOptionalString$5(input.currentSession?.user?.email) ?? "the current account";
|
|
18539
|
+
const nextAccount = normalizeOptionalString$5(input.candidate.user.email) ?? "another account";
|
|
18540
|
+
if (!input.interactive || input.resolvedView !== "human") {
|
|
18541
|
+
const revoked = await revokePreparedAuthSession(input.candidate);
|
|
18542
|
+
throw new Error(`This computer is signed in as ${currentAccount}, but the setup command uses ${nextAccount}. Run the setup command in an interactive Terminal to review and confirm the account switch. The current Computer connection was not changed.${formatComputerAuthCleanupFailureSuffix(revoked)}`);
|
|
18543
|
+
}
|
|
18544
|
+
const confirmed = await confirm({
|
|
18545
|
+
initialValue: false,
|
|
18546
|
+
message: `Switch this computer from ${currentAccount} to ${nextAccount}?`
|
|
18547
|
+
});
|
|
18548
|
+
if (isCancel(confirmed) || !confirmed) {
|
|
18549
|
+
input.presenter.line({
|
|
18550
|
+
code: "setup.account_switch.cancelled",
|
|
18551
|
+
text: "Account switch canceled. The current Computer connection was not changed."
|
|
18552
|
+
});
|
|
18553
|
+
return false;
|
|
18554
|
+
}
|
|
18555
|
+
return true;
|
|
18556
|
+
}
|
|
18557
|
+
async function restorePreviousComputerAfterFailedHandoff(input) {
|
|
18558
|
+
await input.transition.rollback();
|
|
18559
|
+
if (await recoverInterruptedComputerAuthHandoff({
|
|
18560
|
+
presenter: input.presenter,
|
|
18561
|
+
runtime: input.runtime,
|
|
18562
|
+
view: input.view
|
|
18563
|
+
}) === "none") await restoreLegacyComputerAuthTransition(input);
|
|
18564
|
+
}
|
|
18565
|
+
async function restoreLegacyComputerAuthTransition(input) {
|
|
18566
|
+
const revoked = await revokePreparedAuthSession(input.candidate);
|
|
18567
|
+
if (!revoked.ok) emitUnusedSetupSessionCleanupWarning(input.presenter, revoked.error);
|
|
18568
|
+
const previousOwnerUserId = normalizeOptionalString$5(input.transition.previousSession?.user?.id);
|
|
18569
|
+
if (!previousOwnerUserId) {
|
|
18570
|
+
const stopped = await bestEffortStopCurrentLaneDaemonService({ runtime: input.runtime });
|
|
18571
|
+
if (stopped.status === "warning") throw new Error(stopped.errorMessage ?? "OpenMeld could not stop the incomplete Computer connection.");
|
|
18572
|
+
return;
|
|
18573
|
+
}
|
|
18574
|
+
const restored = await runDaemonServiceParticipationGate({
|
|
18575
|
+
intent: "start",
|
|
18576
|
+
presenter: input.presenter,
|
|
18577
|
+
resolvedView: input.runtime.resolvedView,
|
|
18578
|
+
allowPrompt: false,
|
|
18579
|
+
autoRepair: true,
|
|
18580
|
+
expectedOwnerUserId: previousOwnerUserId,
|
|
18581
|
+
forcePrompt: true,
|
|
18582
|
+
forceRefresh: true,
|
|
18583
|
+
gatewayUrl: input.gatewayUrl,
|
|
18584
|
+
suppressRefreshHumanResultCard: true,
|
|
18585
|
+
suppressStartSpinner: true,
|
|
18586
|
+
view: input.view
|
|
18587
|
+
});
|
|
18588
|
+
if (restored.status !== "aligned") throw new Error(restored.errorMessage ?? "OpenMeld could not reconnect the previous Computer account.");
|
|
18589
|
+
}
|
|
18590
|
+
function normalizeOptionalString$5(value) {
|
|
18591
|
+
if (typeof value !== "string") return null;
|
|
18592
|
+
const normalized = value.trim();
|
|
18593
|
+
return normalized.length > 0 ? normalized : null;
|
|
18594
|
+
}
|
|
18595
|
+
function toErrorMessage$2(error) {
|
|
18596
|
+
return error instanceof Error && error.message.trim() ? error.message.trim() : String(error ?? "unknown error");
|
|
18597
|
+
}
|
|
18598
|
+
//#endregion
|
|
18228
18599
|
//#region src/commands/setup-local-agent-connection.ts
|
|
18229
18600
|
const LOCAL_AGENT_CONNECTION_CARD_TITLE = "Local Agent Connection";
|
|
18230
18601
|
const RETIRED_HUMAN_PROFILE_SETUP_MESSAGE = "This OpenMeld Web setup command is retired. Run `openmeld setup` to set up this computer, or open the org-scoped Connect page in OpenMeld Web and copy a fresh setup command.";
|
|
@@ -18242,6 +18613,26 @@ async function runSetupLocalAgentConnection(input) {
|
|
|
18242
18613
|
view: runtime.resolvedView
|
|
18243
18614
|
});
|
|
18244
18615
|
if (input.humanProfile) throw new Error(RETIRED_HUMAN_PROFILE_SETUP_MESSAGE);
|
|
18616
|
+
const deviceCode = normalizeOptionalString$4(input.deviceCode);
|
|
18617
|
+
if (input.startSession && deviceCode) return buildPrepareSessionSetupResult(await runComputerAuthorizationHandoff({
|
|
18618
|
+
deviceCode,
|
|
18619
|
+
interactive,
|
|
18620
|
+
localAgentSelection: resolvePrepareSessionLocalAgentSelection(input),
|
|
18621
|
+
presenter,
|
|
18622
|
+
runtime,
|
|
18623
|
+
startSession: input.startSession,
|
|
18624
|
+
view: input.view
|
|
18625
|
+
}));
|
|
18626
|
+
const oneTimeToken = normalizeOptionalString$4(input.ott);
|
|
18627
|
+
if (input.startSession && oneTimeToken) return buildPrepareSessionSetupResult(await runOneTimeTokenComputerHandoff({
|
|
18628
|
+
oneTimeToken,
|
|
18629
|
+
interactive,
|
|
18630
|
+
localAgentSelection: resolvePrepareSessionLocalAgentSelection(input),
|
|
18631
|
+
presenter,
|
|
18632
|
+
runtime,
|
|
18633
|
+
startSession: input.startSession,
|
|
18634
|
+
view: input.view
|
|
18635
|
+
}));
|
|
18245
18636
|
await maybeLogInWithOneTimeToken$1({
|
|
18246
18637
|
ott: input.ott,
|
|
18247
18638
|
view: input.view
|
|
@@ -18258,19 +18649,15 @@ async function runSetupLocalAgentConnection(input) {
|
|
|
18258
18649
|
status: "not_completed"
|
|
18259
18650
|
};
|
|
18260
18651
|
}
|
|
18261
|
-
if (input.startSession) {
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
});
|
|
18271
|
-
if (sessionResult.status !== "completed") return resolveIncompletePrepareSessionSetupResult(sessionResult);
|
|
18272
|
-
return buildCompletedSetupSessionResult(sessionResult);
|
|
18273
|
-
}
|
|
18652
|
+
if (input.startSession) return buildPrepareSessionSetupResult(await runPrepareSessionExecutor({
|
|
18653
|
+
gatewayUrl: await resolveBaseUrl(),
|
|
18654
|
+
startSession: input.startSession,
|
|
18655
|
+
runtime,
|
|
18656
|
+
presenter,
|
|
18657
|
+
interactive,
|
|
18658
|
+
localAgentSelection: resolvePrepareSessionLocalAgentSelection(input),
|
|
18659
|
+
view: input.view
|
|
18660
|
+
}));
|
|
18274
18661
|
if (input.agent && input.agent.length > 0) {
|
|
18275
18662
|
await runAgentsRepair({
|
|
18276
18663
|
agent: input.agent,
|
|
@@ -18358,6 +18745,9 @@ function resolveIncompletePrepareSessionSetupResult(sessionResult) {
|
|
|
18358
18745
|
status: "not_completed"
|
|
18359
18746
|
};
|
|
18360
18747
|
}
|
|
18748
|
+
function buildPrepareSessionSetupResult(sessionResult) {
|
|
18749
|
+
return sessionResult.status === "completed" ? buildCompletedSetupSessionResult(sessionResult) : resolveIncompletePrepareSessionSetupResult(sessionResult);
|
|
18750
|
+
}
|
|
18361
18751
|
function buildCompletedSetupSessionResult(sessionResult) {
|
|
18362
18752
|
return {
|
|
18363
18753
|
...sessionResult.completionFacts ? { completionFacts: sessionResult.completionFacts } : {},
|
|
@@ -18386,6 +18776,8 @@ function emitSetupLocalAgentConnectionHeader(input) {
|
|
|
18386
18776
|
}
|
|
18387
18777
|
function assertValidSetupLocalAgentConnectionInput(input) {
|
|
18388
18778
|
const facts = resolveSetupLocalAgentConnectionInputFacts(input);
|
|
18779
|
+
if (normalizeOptionalString$4(input.deviceCode) && !facts.hasStartSession) throw new Error("--device-code requires --start-session.");
|
|
18780
|
+
if (normalizeOptionalString$4(input.deviceCode) && normalizeOptionalString$4(input.ott)) throw new Error("use either --device-code or --ott, not both");
|
|
18389
18781
|
if (facts.hasStartSession && (facts.hasProfile || facts.hasHumanProfile || facts.hasLocalAgentPreparation)) throw new Error("--start-session cannot be combined with --profile, --human-profile, or --agent.");
|
|
18390
18782
|
if (!facts.hasStartSession && facts.hasPrepareSessionLocalAgentMode) throw new Error("--local-agents requires --start-session.");
|
|
18391
18783
|
assertValidLocalAgentSelectionInput({
|
|
@@ -27435,7 +27827,7 @@ function normalizeOptionalString(value) {
|
|
|
27435
27827
|
return normalized.length > 0 ? normalized : null;
|
|
27436
27828
|
}
|
|
27437
27829
|
async function runDefaultSpaceAddMeMembership(input) {
|
|
27438
|
-
const { runSpaceAddMeMembership } = await import("./add-me-membership-
|
|
27830
|
+
const { runSpaceAddMeMembership } = await import("./add-me-membership-CSOBspmn.js");
|
|
27439
27831
|
return await runSpaceAddMeMembership(input);
|
|
27440
27832
|
}
|
|
27441
27833
|
//#endregion
|
|
@@ -31108,7 +31500,7 @@ withStartOptions(program.command("start").description("Initial onboarding: set u
|
|
|
31108
31500
|
}
|
|
31109
31501
|
});
|
|
31110
31502
|
});
|
|
31111
|
-
program.command("setup").description("Set up this computer for OpenMeld Space Wake.").option("--profile <id>", "Existing OpenMeld agent profile ID to connect to this computer").option("--agent <id...>", "Builtin local agent ID to repair directly when you already know the target").option("--human-profile <id>", "Retired OpenMeld Web setup flag; copy a fresh setup command from OpenMeld Web instead").option("--ott <token>", "One-time token to sign in on this device before setup").option("--start-session <opaque-token>", "Continue an OpenMeld Web Prepare setup command on this device").option("--local-agents <mode>", "Select local agents during setup: all or none").option("--local-agent <id...>", "Select specific local agent IDs during setup").option("--reset-this-computer", "Stop stale local OpenMeld Service state before reconnecting this computer").addHelpText("after", buildCommandHelpExamples("Primary entry points", [
|
|
31503
|
+
program.command("setup").description("Set up this computer for OpenMeld Space Wake.").option("--profile <id>", "Existing OpenMeld agent profile ID to connect to this computer").option("--agent <id...>", "Builtin local agent ID to repair directly when you already know the target").option("--human-profile <id>", "Retired OpenMeld Web setup flag; copy a fresh setup command from OpenMeld Web instead").option("--ott <token>", "One-time token to sign in on this device before setup").option("--device-code <code>", "Browser-approved code used to create this computer's independent sign-in session").option("--start-session <opaque-token>", "Continue an OpenMeld Web Prepare setup command on this device").option("--local-agents <mode>", "Select local agents during setup: all or none").option("--local-agent <id...>", "Select specific local agent IDs during setup").option("--reset-this-computer", "Stop stale local OpenMeld Service state before reconnecting this computer").addHelpText("after", buildCommandHelpExamples("Primary entry points", [
|
|
31112
31504
|
"openmeld setup",
|
|
31113
31505
|
"openmeld setup --start-session <opaque-token> --local-agents all",
|
|
31114
31506
|
"openmeld setup --profile <agent-profile-id> --local-agent <local-agent-id>"
|
|
@@ -31121,6 +31513,7 @@ program.command("setup").description("Set up this computer for OpenMeld Space Wa
|
|
|
31121
31513
|
run: async () => {
|
|
31122
31514
|
await runSetup({
|
|
31123
31515
|
agent: opts.agent,
|
|
31516
|
+
deviceCode: opts.deviceCode,
|
|
31124
31517
|
humanProfile: opts.humanProfile,
|
|
31125
31518
|
localAgent: opts.localAgent,
|
|
31126
31519
|
localAgents: opts.localAgents,
|
|
@@ -32313,10 +32706,10 @@ serviceCmd.command("trace").description("Read a Space delivery trace for debuggi
|
|
|
32313
32706
|
profile: opts.profile,
|
|
32314
32707
|
gatewayUrl: opts.gatewayUrl,
|
|
32315
32708
|
run: async () => {
|
|
32316
|
-
const dispatchId = normalizeOptionalString$
|
|
32317
|
-
const sourceSignalId = normalizeOptionalString$
|
|
32318
|
-
const clientMessageId = normalizeOptionalString$
|
|
32319
|
-
const targetProfileId = normalizeOptionalString$
|
|
32709
|
+
const dispatchId = normalizeOptionalString$15(opts.dispatch);
|
|
32710
|
+
const sourceSignalId = normalizeOptionalString$15(opts.sourceSignal);
|
|
32711
|
+
const clientMessageId = normalizeOptionalString$15(opts.clientMessage);
|
|
32712
|
+
const targetProfileId = normalizeOptionalString$15(opts.targetProfile);
|
|
32320
32713
|
if (Number(dispatchId !== null) + Number(sourceSignalId !== null) + Number(clientMessageId !== null) !== 1) throw new Error("exactly one of --dispatch, --source-signal, or --client-message is required");
|
|
32321
32714
|
await runServiceTrace({
|
|
32322
32715
|
profile: opts.profile,
|
|
@@ -32507,7 +32900,7 @@ spaceActionCmd.command("help").description("Show OpenMeld Space Action help.").a
|
|
|
32507
32900
|
withSpaceProfileOption(spaceCmd.command("create").description("Create a new space and print its space ID.").option("--name <name>", "Space name (<=80 chars; prompted in human interactive mode)").option("--visibility <public|private>", "Organization visibility for this space").option("--guide <text>", "Optional space guide").option("--password <value>", "Optional space password (minimum 6 characters; numbers/letters/symbols accepted)").option("--join", "Join immediately after create").option("--no-join", "Do not ask to join after create").option("--output <mode>", "Output mode when auto-joining: ndjson|text", "text")).action(async (opts, command) => {
|
|
32508
32901
|
const cliOptions = resolveSpaceCommandCliOptions(command, opts);
|
|
32509
32902
|
const view = getGlobalViewOption();
|
|
32510
|
-
if (view === "agent" && (normalizeOptionalString$
|
|
32903
|
+
if (view === "agent" && (normalizeOptionalString$15(opts.name) === null || normalizeOptionalString$15(opts.visibility) === null)) {
|
|
32511
32904
|
await runSpaceCreate({
|
|
32512
32905
|
profile: cliOptions.profile,
|
|
32513
32906
|
baseUrl: cliOptions.gatewayUrl,
|
|
@@ -32567,7 +32960,7 @@ withSpaceProfileOption(spaceCmd.command("join").description("Open an existing Sp
|
|
|
32567
32960
|
const localEcho = opts.noLocalEcho !== true;
|
|
32568
32961
|
const view = getGlobalViewOption();
|
|
32569
32962
|
if (opts.selfServe === true) {
|
|
32570
|
-
const spaceValue = normalizeOptionalString$
|
|
32963
|
+
const spaceValue = normalizeOptionalString$15(space);
|
|
32571
32964
|
if (!spaceValue) throw Object.assign(/* @__PURE__ */ new Error("space join --self-serve requires an explicit public Organization Space ID"), { code: "space.join.self_serve.space_required" });
|
|
32572
32965
|
await runCommandWithEntryChecks({
|
|
32573
32966
|
routeTokens: [
|
|
@@ -32591,7 +32984,7 @@ withSpaceProfileOption(spaceCmd.command("join").description("Open an existing Sp
|
|
|
32591
32984
|
});
|
|
32592
32985
|
return;
|
|
32593
32986
|
}
|
|
32594
|
-
if (view === "agent" && normalizeOptionalString$
|
|
32987
|
+
if (view === "agent" && normalizeOptionalString$15(space) === null) {
|
|
32595
32988
|
await runSpaceJoin({
|
|
32596
32989
|
profile: cliOptions.profile,
|
|
32597
32990
|
baseUrl: cliOptions.gatewayUrl,
|
|
@@ -32643,8 +33036,8 @@ withSpaceProfileOption(spaceCmd.command("wake-progress").description("Read live
|
|
|
32643
33036
|
profile: cliOptions.profile,
|
|
32644
33037
|
baseUrl: cliOptions.gatewayUrl,
|
|
32645
33038
|
space: String(space),
|
|
32646
|
-
clientMessageId: normalizeOptionalString$
|
|
32647
|
-
targetProfileId: normalizeOptionalString$
|
|
33039
|
+
clientMessageId: normalizeOptionalString$15(opts.clientMessage) ?? void 0,
|
|
33040
|
+
targetProfileId: normalizeOptionalString$15(opts.targetProfile) ?? void 0,
|
|
32648
33041
|
password: cliOptions.password,
|
|
32649
33042
|
view,
|
|
32650
33043
|
entryChecksHandled: true
|
|
@@ -32665,10 +33058,10 @@ withSpaceProfileOption(spaceCmd.command("wake-stop").description("Request Stop f
|
|
|
32665
33058
|
profile: cliOptions.profile,
|
|
32666
33059
|
baseUrl: cliOptions.gatewayUrl,
|
|
32667
33060
|
space: String(space),
|
|
32668
|
-
clientMessageId: normalizeOptionalString$
|
|
32669
|
-
sourceSignalId: normalizeOptionalString$
|
|
33061
|
+
clientMessageId: normalizeOptionalString$15(opts.clientMessage) ?? void 0,
|
|
33062
|
+
sourceSignalId: normalizeOptionalString$15(opts.sourceSignal) ?? void 0,
|
|
32670
33063
|
targetProfileId: String(opts.targetProfile),
|
|
32671
|
-
reason: normalizeOptionalString$
|
|
33064
|
+
reason: normalizeOptionalString$15(opts.reason) ?? void 0,
|
|
32672
33065
|
password: cliOptions.password,
|
|
32673
33066
|
view,
|
|
32674
33067
|
entryChecksHandled: true
|
|
@@ -33176,8 +33569,8 @@ withSpaceProfileOption(spaceCmd.command("updates").description("Read formal upda
|
|
|
33176
33569
|
withSpaceProfileOption(spaceCmd.command("result").description("Read one formal dispatch result scoped to this space.").argument("[space]", "Space ID (64-character hex)").option("--dispatch <dispatch-id>", "Lookup by dispatch ID").option("--result-ref <result-ref>", "Lookup by dispatch result ref").option("--json", "Print canonical JSON", false).option("--password <value>", "Space password for protected access")).action(async (space, opts, command) => {
|
|
33177
33570
|
const cliOptions = resolveSpaceCommandCliOptions(command, opts);
|
|
33178
33571
|
const spaceValue = String(space ?? "").trim();
|
|
33179
|
-
const dispatchId = normalizeOptionalString$
|
|
33180
|
-
const resultRef = normalizeOptionalString$
|
|
33572
|
+
const dispatchId = normalizeOptionalString$15(opts.dispatch);
|
|
33573
|
+
const resultRef = normalizeOptionalString$15(opts.resultRef);
|
|
33181
33574
|
const selectorCount = Number(dispatchId !== null) + Number(resultRef !== null);
|
|
33182
33575
|
const outputView = await resolveEffectiveViewForOutput();
|
|
33183
33576
|
if ((spaceValue.length === 0 || selectorCount !== 1) && outputView === "agent") throw createSpaceResultGuideError();
|
|
@@ -33805,6 +34198,16 @@ function isDispatchSpaceActionToolServerArgv(argv) {
|
|
|
33805
34198
|
async function runLocalCli(argv) {
|
|
33806
34199
|
try {
|
|
33807
34200
|
await ensureSystemLayout();
|
|
34201
|
+
const [startupCommand, startupSubcommand] = parseLeadingCommandTokensFromArgv(argv, 2);
|
|
34202
|
+
if (!(startupCommand === "service" && startupSubcommand === "run")) await recoverInterruptedComputerAuthHandoff({
|
|
34203
|
+
presenter: createSilentPresenter("agent"),
|
|
34204
|
+
runtime: {
|
|
34205
|
+
interactive: false,
|
|
34206
|
+
resolvedView: "agent",
|
|
34207
|
+
viewMode: "agent"
|
|
34208
|
+
},
|
|
34209
|
+
view: "agent"
|
|
34210
|
+
});
|
|
33808
34211
|
const removedCcInputMessage = getRemovedCcCliInputMessage(argv);
|
|
33809
34212
|
if (removedCcInputMessage) throw new Error(removedCcInputMessage);
|
|
33810
34213
|
const retiredCommandMessage = resolveRetiredCliCommandMessage(argv);
|