openmeld 0.3.82 → 0.3.84

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/openmeld.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { $ as LEGACY_OPENMELD_AGENT_SESSION_ENV_KEY, At as openMeldManagedBinaryPath, Bt as resolveOpenMeldCliEntryNameFromArgv, D as toSpaceBoardUrl, Et as normalizeAccountKey, Ft as organizationSkillReleaseDir, G as isOpenMeldOrphanedLockError, H as acquireLock, It as profileDir, J as releaseLockSync, Jt as systemDir, Kt as skillsDir, Lt as profileViewPath, M as toSpaceDispatchLookupUrl, N as toSpaceDispatchTraceUrl, Nt as openMeldRootDir, O as toSpaceContractUrl, Ot as openMeldBackupsDir, S as updateConfiguredOnboardingConfig, T as normalizeBaseUrl, U as buildOpenMeldOrphanedLockAction, Ut as resolveOpenMeldRootDir, Vt as resolveOpenMeldEnvPreset, W as isOpenMeldLockError, X as resolveOpenMeldOrphanedLockIssue, Y as repairOrphanedLegacyLocks, Yt as formatLocalMachineIssueMessage, Z as runWithHeldLock, _t as accountProfileSpaceCacheDir, a as resolveBaseUrl, b as setConfiguredSkillsConfig, bt as accountsDir, c as resolveExplicitGatewayUrlOrThrow, ct as LocalMachineFailureError, et as OPENMELD_CLI_CONTEXT_ENV_KEY, ft as createOrphanedSetupConcurrencyIssue, h as getConfiguredSkillsConfig, jt as openMeldManagedVersionBinaryPath, m as getConfiguredOnboardingDisclaimerAcceptedAt, mt as toRecognizedLocalMachineFailureError, nn as agentControllerConversationRefSchema, o as resolveBaseUrlOrNull, ot as formatLaneScopeSentence, pt as isLocalMachineFailureError, qt as spacesDir, rt as resolveCliContext, st as resolveOpenMeldLaneDescriptor, u as alignRuntimeConfigStorage, ut as createActiveSetupConcurrencyIssue, vt as accountProfileViewPath, w as updateConfiguredStartV1OnboardingState, y as setConfiguredBaseUrl, z as toSpaceResultUrl } from "./base-url-Cv9x5Es9.js";
4
- import { $ as formatTransportModeDisplay, $a as formatOpenMeldCliCommands, $i as compareSemver, $n as canUseInteractivePrompts, $r as normalizeCustomProfileWorkspacePath, $t as readRecentDaemonDispatchJournalEvents, A as prepareAuthenticatedSpaceCommandContext, Aa as buildHumanAuthenticationCard, Ai as listAgentControllerPermissionModeOptions, An as assertNoRemovedCcSpaceAddressingSyntax, Ao as renderTextInfoCard, Ar as formatDualViewGuideForDisplay, At as readDaemonStartFailureLogTailLines, B as runAgents, Ba as requestLocalAgentActivitySync, Bi as resetCurrentCommandCheckState, Bn as promptSearchSelect, Bo as cliJsonSkillsShowEnvelopeSchema, Br as resolveServiceReadinessFromServiceStatus, Bt as writeInstalledLocalComponentsSnapshot, C as buildFormalSignalReadPayload, Ca as resolveOpenMeldProfile, Ci as ensureDaemonRuntimePaths, Cn as submitRuntimeAgentControllerReports, Co as runIfAgentActivityBindingGenerationIsCurrent, Cr as registerSkillsTargetSelectionOptions, Ct as buildProfileWorkspacePresentation, D as isSpaceCommandOutputHandledError, Da as getSelectedOpenMeldProfileId, Di as createAgentExecutionStatusDisplayRows, Dn as resolveLocalAgentControllerReportDecision, Do as enqueueControllerTaskLifecycleEventWhileLocked, Dr as registerBuiltinAgentSelectionOptions, Dt as createDelayedSpinner, E as parseEnvelope, Ea as clearSelectedOpenMeldProfileId, Ei as buildAgentControllerRef, En as resolveLocalAgentControllerLaunchability, Eo as canonicalizeLocalProjectPath, Er as registerAuthLoginRequestOptions, Et as emitDaemonAgentOverview, F as prepareLocalAgentReadiness, Fa as getProfileDefaultView, Fi as resolveEvidenceSyncHealth, Fn as buildSpaceRoundReadProjection, Fo as outLine, Fr as areAllowedActionsEquivalent, Ft as readGatewayJsonResponse, G as runAgentsCustomUpdate, Gi as readCurrentObservedDaemonRuntimeStatus, Gn as assertDispatchOwnedRuntimePublicWriteAllowed, Go as package_default, Gr as formatHumanReplyReadinessReason$1, Gt as runSkillsCheck$1, H as runAgentsCustomAdd, Ha as registerAgentActivityRoute, Hi as inspectDaemonServiceInventory, Hn as runInteractivePrompt, Ho as organizationJoinLinkErrorResponseSchema, Hr as resolveCurrentReplyReadinessSnapshot, Ht as runDaemonServiceParticipationGate, I as buildReplyReadinessGuidance, Ia as setProfileDefaultView, Ii as resolveNativeAgentControllerPermissionModeForController, In as buildUpdatesReplyWorkflowProjection, Io as cliBinaryDeltaPatchSchema, Ir as buildAgentFacingPublicationModeGuideLines, It as readGatewayTextResponse, J as runAgentsEnable, Ja as readAgentActivityIntegrationStatus, Ji as readDaemonServiceJobCrashExitCode, Jn as writeDispatchSpaceActionRecord, Jr as resolveOpenClawLocalDiagnosticsValue, Jt as runSkillsUninstall, K as runAgentsDetect, Ka as defaultManagedIntegrationPaths, Ki as getDaemonSystemServiceLogPath, Kn as readDispatchOwnedRuntimeGuard, Kr as mapAgentReplyReadinessToLegacyAutoReply, Kt as runSkillsEnsure, L as resolveHumanControllerDisplayName, La as LocalProjectConnectionError, Li as finishCurrentCommandCheckScope, Ln as createSpaceMemberIdentityIndex, Lo as cliJsonOutputEnvelopeSchema, Lr as canonicalizeAllowedActions, Lt as toStructuredGatewayFailure, M as resolveSpaceAccessLabel, Ma as resolveAuthenticationGuidance, Mi as resolveAgentControllerPermissionModeForController, Mn as buildDispatchResultReplyWorkflowProjection, Mo as emitCliJsonEnvelope, Mr as formatAgentOverviewPayload, Mt as createCliSpaceApi, N as emitSpaceAgentOverview, Na as resolveAuthenticationGuidanceFromError, Ni as resolveAgentExecutionStatus, Nn as buildSignalIndex, No as errLine, Nr as OPENMELD_AGENT_MENTAL_MODEL_LINES, Nt as fetchSpaceMeta, O as assertFullSignalIdArgument, Oa as setSelectedOpenMeldProfileId, Oi as getAgentControllerPermissionModeDisplayMetadata, On as inspectSpaceCacheFile, Oo as readControllerTaskLifecycleOutboxHealth, Or as buildAgentOverviewFromContract, Ot as shouldEmitAgentOverview, P as emitSpaceCliAgentOverview, Pa as resolveAuthenticationGuidanceFromMessage, Pi as resolveAgentProfileEditCapabilities, Pn as buildSignalMessageReadProjection, Po as outJsonLine, Pr as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, Pt as updateSpaceMeta, Q as runAgentsShow, Qa as formatOpenMeldCliCommand, Qi as buildNextVersionState, Qn as formatDaemonServiceMissingRecommendation, Qr as ensureOpenMeldManagedProfileWorkspace, Qt as readRuntimeReportingHealthState, R as persistAgentTransportSelection, Ra as validateLocalProjectConnectionPath, Ri as getCurrentCommandCheckState, Rn as formatRemovedCcRelationMessage, Ro as cliJsonSkillsListEnvelopeSchema, Rr as runDaemonServiceFullAlignment, Rt as parseJsonResponse, S as buildFormalDispatchResultReadPayload, Sa as primeOpenMeldProfilesSessionCache, Si as readRecentDaemonLifecycleEvents, Sn as submitRuntimeAgentControllerReport, So as removeProjectConnection, Sr as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, St as runDaemonUninstall, T as formatHumanReadTargetList, Ta as alignSelectedOpenMeldProfileStorage, Ti as resolveOpenMeldEnvironmentTarget, Tn as resolveLocalAgentControllerBlockerReasonCodes, To as unbindProject, Tr as registerDaemonControlTargetOptions, Tt as reconcileCliVersionView, U as runAgentsCustomList, Ua as resolveAgentActivityRouteForPath, Ui as resolveVersionChangeDirection, Un as assessCliUpdate, Uo as revokeOrganizationJoinLinkResponseSchema, Ur as formatAgentReplyReadinessLabel, Ut as runDaemonStartDecisionPrompt, V as runAgentsConfig, Va as isAgentActivityRouteRegistered, Vi as startCurrentCommandCheckScope, Vn as isReturnKeypress, Vo as getOrganizationJoinLinkResponseSchema, Vr as resolveDaemonServiceFreshnessWarning, Vt as resolveDaemonServiceParticipationStatus, W as runAgentsCustomRemove, Wa as unregisterAgentActivityRoute, Wi as readCurrentDaemonRuntimeContext, Wn as isCliUpdateCheckApplicable, Wo as compareAgentControllerRefsForDisplay, Wr as formatDeviceReplyReadinessLabel, Wt as collectSkillsReadinessSnapshot, X as runAgentsManage, Xa as uninstallAgentActivityIntegrations, Xi as buildInstallSelfJsonPayload, Xn as resolveElapsedTimeMs, Xr as createModelCatalogReadSession, Xt as ensureLocalSkills, Y as runAgentsList, Ya as resolveAgentActivityDispatcherCommand, Yi as resolveDaemonServiceManager, Yn as formatElapsedTime, Yr as syncProfileWorkspaceState, Yt as runSkillsUpdate, Z as runAgentsRepair, Za as formatInlineOpenMeldCliCommands, Zi as performManagedInstall, Zn as formatDaemonServiceDowngradeBlockedRecommendation, Zr as resolveProfileWorkspaceRuntime, Zt as readBundledOpenMeldCliSkillDocumentByPath, _ as emitHumanReadSignalsTextProjection, _a as resolveOpenMeldProfileOrNull, _i as getSetupFlowCopy, _n as formatServiceParticipationReadinessLabel, _o as removeProjectOutbox, _r as createStartAuthenticationGuideError, _t as runDaemonRunAfterEntryChecks, a as runSpaceDelete, aa as isBinaryDistribution, ai as describeProfileWorkspacePathValidationFailure, an as runAuthLogin, ao as syncLocalAgentActivity, ar as createSpaceAddMembersGuideError, at as renderOpenMeldHeader, b as loadSpaceSignalIndexOrNull, ba as deleteOpenMeldProfile, bi as classifyDaemonServiceRunStartability, bn as computeRetryDelayMs, bo as listProjectConnectionsWithStatus, br as getCommandHintsFromContract, bt as runDaemonStop, c as runSpaceLeave, ca as toStartBackgroundHelperExecutionCompatibility, ci as resolveAgentProfilePrimaryAgentControllerReport, cn as runAuthStatus, co as readAgentActivityContextForPath, cr as createSpaceLeaveGuideError, ct as resolveGatewayWebOrigin, d as runSpaceRemoveMembers, da as formatMessage, di as listBuiltinAgentsRegistryEntries, dn as formatActiveOrganizationLabel, do as resolveObservedAgentActivityBinding, dr as createSpaceRemoveMembersGuideError, dt as runDaemonAutostart, ea as ensureVersionStateReady, ei as readProfileWorkspaceConfig, en as connectWebSocket, eo as formatOpenMeldCliLine, er as createDoctorFailedGuideError, et as postLocalParticipationMutationReconcile, f as runSpaceSend, fa as parseCliViewMode, fi as notifyDaemonRouteCatalogChanged, fn as createProfileByKind, fo as normalizeSharedSessionTitle, fr as createSpaceResultGuideError, ft as runDaemonBackgroundStartForDecision, g as buildHumanReadSignalsTranscriptItems, ga as requireOpenMeldProfile, gi as buildOnboardingPlan, gn as ensureAgentProfileRuntimeBinding, go as readAgentActivityOutboxHealth, gr as createStartAgentIdentityGuideError, gt as runDaemonReinstall, h as runSpaceWriteWithPasswordRetry, ha as isSelectedOpenMeldProfileRequiredError, hi as buildDaemonRouteObservationPresentation$1, hn as promptTextEntry, ho as removeProjectInbox, hr as createSpaceUpdatesGuideError, ht as runDaemonInterrupt, i as runSpaceCreate, ia as writeVersionState, ii as validateCustomProfileWorkspacePath, in as evaluateCommandAuthentication, io as resolveUserFacingCliEntryCommand, ir as createResetConfirmationGuideError, it as renderOpenMeldBrandBlockLines, j as resolveOpenMeldProfileForSpaceCommand, ja as createAuthenticationError, ji as parseAgentControllerRef, jn as buildDispatchResultMessageReadProjection, jo as sanitizeTerminalDisplayText, jr as buildDualViewGuideMessage, jt as fetchSpaceUpdates, k as assertValidSpaceIdTarget, ka as buildAgentAuthenticationGuide, ki as getAgentControllerPermissionModeFieldLabel, kn as upsertSpaceConfig, ko as renderInfoCard, kr as DualViewGuideError, kt as runDaemonStartupPreflight, l as runSpaceList, la as resolveCurrentDaemonExpectedVersion, li as listAgentTargetStates, ln as buildAuthStatusRows, lo as removeAgentActivityContextCache, lr as createSpaceMenuGuideError, lt as resolveSpaceSendText, m as runSpaceReadWithPasswordRetry, ma as resolveViewProfileKey, mn as resolveCreateProfileName, mo as enqueueAgentActivityHookEvent, mr as createSpaceTargetGuideError, mt as runDaemonInstall, n as promptAndConfirmSpacePassword, na as fetchLatestPackageInfo, ni as setCustomProfileWorkspace, nn as buildCommandAuthenticationPromptMessage, no as formatProfileAwareOpenMeldCliCommands, nr as createProfileCreateGuideError, nt as colorizeDisplayProfileLabel, o as runSpaceHistory, oa as resolveOpenMeldDistribution, oi as syncDeviceRuntimeStateProjection, on as runAuthLogout, oo as readDaemonServiceContract, or as createSpaceAliasTargetGuideError, ot as renderOpenMeldLogo, p as runSpaceWatch, pa as resolveRuntimeContext, pi as resolveLocalRegistryAgentIdFromAgentControllerRef, pn as resolveCreateProfileKind, po as readCodexSessionTitles, pr as createSpaceSubcommandTargetGuideError, pt as runDaemonCancel, q as runAgentsDisable, qa as installAgentActivityIntegrations, qi as isDaemonServiceJobNeverSpawned, qn as readDispatchSpaceActionContextFromEnv, qr as resolveGatewayChainReadiness, qt as runSkillsInstall, r as runSpaceAddMembers, ra as readVersionState, ri as setOpenMeldManagedProfileWorkspace, rn as ensureCommandAuthenticationOrCancel, ro as resolveSetupFollowUpCliEntryCommand, rr as createProfileMenuGuideError, rt as printOpenMeldBanner, s as runSpaceJoin, sa as resolveDaemonRuntimeContractCompatibility, si as createPrimaryBindingReadSession, sn as runAuthMenu, so as upsertDaemonServiceContract, sr as createSpaceContractSetGuideError, st as renderOpenMeldTagline, t as buildCreateSpacePasswordPromptConfig, ta as fetchLatestCliBinaryRelease, ti as resolveConfiguredProfileWorkspacePath, tn as assessServerRequiredVersion, to as formatOpenMeldCliTextBlock, tr as createProfileActionGuideError, tt as colorizeAgentLabel, u as runSpacePassword, ua as createPresenter, ui as reconcileNewRunnableBuiltinAgentsForSetup, un as buildAuthStatusSnapshot, uo as buildAgentActivityEvent, ur as createSpacePublicationSetGuideError, ut as runDaemon, v as buildIdentityOnlyMembersSnapshotForReadProjection, va as createOpenMeldAgentProfile, vi as buildDaemonServiceTargetSpec, vn as resolveServiceParticipationReadiness, vo as bindProject, vr as createUpgradeConfirmationGuideError, vt as runDaemonSnapshot, w as buildHumanReplyContextSummary, wa as updateOpenMeldProfile, wi as resolveDaemonDeviceId, wn as collectLocalAgentControllerInventory, wo as setDefaultProjectConnection, wr as getCliVersionInfo, wt as buildProfileWorkspaceRows, x as toSpaceMetaUpsertInput, xa as listOpenMeldProfiles, xi as classifyDaemonServiceWakeability, xn as submitProfileRuntimeAgentControllerReport, xo as migrateProjectBindingStore, xr as registerSpaceMemberSelectionOptions, xt as runDaemonTeardownStrict, y as loadSpaceIdentityDirectoryOrNull, ya as createOpenMeldHumanProfile, yi as resolveDaemonServiceAlignmentDecision, yn as assessActionParticipationCandidate, yo as listProjectBindings, yr as getCommandEntryContract, yt as runDaemonStatusFlow, z as resolveAgentProfileSetup, za as LocalDaemonControlPlaneClientError, zi as isCurrentCommandCheckScopeActive, zn as promptSearchMultiselect, zo as cliJsonSkillsLoadEnvelopeSchema, zr as formatDaemonFailureContextText, zt as resolveLocalComponentsStatus } from "./command-BL4XDrtV.js";
5
- import { $ as projectOwnerComputerLocalRuntimes, $t as agentActivitySessionInventoryQuerySchema, B as sleep, Bt as agentActivitySessionStatusSchema, Ct as authProfileManagedRoleSchema, D as toStructuredApiClientFailure, Dt as submitFeedbackIssueRequestSchema, F as OPENMELD_HEADER_PROFILE_ID, G as resolveSpaceDispatchTraceRootCause, J as spaceDispatchTraceResponseSchema, K as spaceDispatchTraceAttemptStatusSchema, Q as ownerComputerDiagnosticsSchema, Qt as agentActivityInventorySessionStatusSchema, St as authProfileKindSchema, Vt as agentActivitySnapshotQuerySchema, W as projectSpaceDispatchTraceFinalVisibleOutcome, X as projectObservabilityWakeCorrelation, Y as observabilityWakeTraceSelectorSchema, Zt as agentActivityInventorySessionOriginSchema, _ as createOrganizationSkillsApi, b as createProjectsApi, c as createAgentProfileBindingApi, d as createCurrentDeviceApi, dn as START_BOUNDED_VERSION_SCHEMA, et as summarizeComputerFileAccessPolicy, f as createFeedbackApi, fn as START_ISO_DATE_TIME_SCHEMA, g as createOrganizationApi, hn as localAgentCatalogSchema, ht as organizationSkillBundleSchema, l as createCenterAgentApi, mn as startReplyReadinessSummarySchema, nt as agentProfileCreationConfigurationSchema, pn as START_TRIMMED_NON_EMPTY_STRING_SCHEMA, q as spaceDispatchTraceDispatchStatusSchema, s as createAgentActivityApi, tn as localAgentSessionProviderSchema, tt as DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION, u as createComputerFileAccessApi, un as START_BOUNDED_ID_SCHEMA, v as createPrepareReadinessApi, vt as stringifyOrganizationSkillBundleCanonicalJson, x as createRoutinesApi, zt as agentActivityProviderSchema } from "./dist-D9smLL6A.js";
6
- import { $n as openMeldProfileIdSchema, Ht as spaceThreadContextSchema, Kt as spaceContractFieldsSchema, Mn as clientMessageIdSchema, Mt as spaceStatusSchema, Nt as centerAgentInteractionSourceSchema, Vt as dispatchExecutionSchema, an as messageEnvelopeSchema, dr as nonEmptyTrimmedStringFromUnknown, ir as openMeldRuntimeProfileIdSchema, pr as trimmedStringFromUnknown, qt as spaceContractSchema } from "./runtime-transport-DI97Fndy.js";
4
+ import { $ as runAgentsRepair, $a as readAgentActivityIntegrationStatus, $i as performManagedInstall, $n as formatDaemonServiceDowngradeBlockedRecommendation, $r as resolveProfileWorkspaceRuntime, $t as readBundledOpenMeldCliSkillDocumentByPath, A as assertFullSignalIdArgument, Aa as alignSelectedOpenMeldProfileStorage, Ai as getAgentControllerPermissionModeDisplayMetadata, An as inspectSpaceCacheFile, Ao as unbindProject, Ar as buildAgentOverviewFromContract, At as shouldEmitAgentOverview, B as persistAgentTransportSelection, Ba as getProfileDefaultView, Bi as getCurrentCommandCheckState, Bn as formatRemovedCcRelationMessage, Bo as outLine, Br as runDaemonServiceFullAlignment, Bt as parseJsonResponse, C as toSpaceMetaUpsertInput, Ca as createOpenMeldAgentProfile, Ci as classifyDaemonServiceWakeability, Cn as submitProfileRuntimeAgentControllerReport, Co as bindProject, Cr as registerSpaceMemberSelectionOptions, Ct as runDaemonTeardownStrict, D as formatHumanReadTargetList, Da as primeOpenMeldProfilesSessionCache, Di as resolveOpenMeldEnvironmentTarget, Dn as resolveLocalAgentControllerBlockerReasonCodes, Do as removeProjectConnection, Dr as registerDaemonControlTargetOptions, Dt as reconcileCliVersionView, E as buildHumanReplyContextSummary, Ea as listOpenMeldProfiles, Ei as resolveDaemonDeviceId, En as collectLocalAgentControllerInventory, Eo as migrateProjectBindingStore, Er as getCliVersionInfo, Et as buildProfileWorkspaceRows, F as emitSpaceAgentOverview, Fa as buildHumanAuthenticationCard, Fi as resolveAgentExecutionStatus, Fn as buildSignalIndex, Fo as renderTextInfoCard, Fr as OPENMELD_AGENT_MENTAL_MODEL_LINES, Ft as fetchSpaceMeta, G as runAgentsCustomList, Ga as requestLocalAgentActivitySync, Gi as resolveVersionChangeDirection, Gn as assessCliUpdate, Go as cliJsonSkillsShowEnvelopeSchema, Gr as formatAgentReplyReadinessLabel, Gt as runDaemonStartDecisionPrompt, H as runAgents, Ha as LocalProjectConnectionError, Hi as resetCurrentCommandCheckState, Hn as promptSearchSelect, Ho as cliJsonOutputEnvelopeSchema, Hr as resolveServiceReadinessFromServiceStatus, Ht as writeInstalledLocalComponentsSnapshot, I as emitSpaceCliAgentOverview, Ia as createAuthenticationError, Ii as resolveAgentProfileEditCapabilities, In as buildSignalMessageReadProjection, Io as sanitizeTerminalDisplayText, Ir as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, It as updateSpaceMeta, J as runAgentsDetect, Ja as resolveAgentActivityRouteForPath, Ji as getDaemonSystemServiceLogPath, Jn as readDispatchOwnedRuntimeGuard, Jo as revokeOrganizationJoinLinkResponseSchema, Jr as mapAgentReplyReadinessToLegacyAutoReply, Jt as runSkillsEnsure, K as runAgentsCustomRemove, Ka as isAgentActivityRouteRegistered, Ki as readCurrentDaemonRuntimeContext, Kn as isCliUpdateCheckApplicable, Ko as getOrganizationJoinLinkResponseSchema, Kr as formatDeviceReplyReadinessLabel, Kt as collectSkillsReadinessSnapshot, L as prepareLocalAgentReadiness, La as resolveAuthenticationGuidance, Li as resolveEvidenceSyncHealth, Ln as buildSpaceRoundReadProjection, Lo as emitCliJsonEnvelope, Lr as areAllowedActionsEquivalent, Lt as readGatewayJsonResponse, M as prepareAuthenticatedSpaceCommandContext, Ma as getSelectedOpenMeldProfileId, Mi as listAgentControllerPermissionModeOptions, Mn as assertNoRemovedCcSpaceAddressingSyntax, Mo as enqueueControllerTaskLifecycleEventWhileLocked, Mr as formatDualViewGuideForDisplay, Mt as readDaemonStartFailureLogTailLines, N as resolveOpenMeldProfileForSpaceCommand, Na as setSelectedOpenMeldProfileId, Ni as parseAgentControllerRef, Nn as buildDispatchResultMessageReadProjection, No as readControllerTaskLifecycleOutboxHealth, Nr as buildDualViewGuideMessage, Nt as fetchSpaceUpdates, O as parseEnvelope, Oa as resolveOpenMeldProfile, Oi as buildAgentControllerRef, On as resolveLocalAgentControllerLaunchability, Oo as runIfAgentActivityBindingGenerationIsCurrent, Or as registerAuthLoginRequestOptions, Ot as emitDaemonAgentOverview, P as resolveSpaceAccessLabel, Pa as buildAgentAuthenticationGuide, Pi as resolveAgentControllerPermissionModeForController, Pn as buildDispatchResultReplyWorkflowProjection, Po as renderInfoCard, Pr as formatAgentOverviewPayload, Pt as createCliSpaceApi, Q as runAgentsManage, Qa as installAgentActivityIntegrations, Qi as buildInstallSelfJsonPayload, Qn as resolveElapsedTimeMs, Qr as createModelCatalogReadSession, Qt as ensureLocalSkills, R as buildReplyReadinessGuidance, Ra as resolveAuthenticationGuidanceFromError, Ri as resolveNativeAgentControllerPermissionModeForController, Rn as buildUpdatesReplyWorkflowProjection, Ro as errLine, Rr as buildAgentFacingPublicationModeGuideLines, Rt as readGatewayTextResponse, S as loadSpaceSignalIndexOrNull, Sa as resolveOpenMeldProfileOrNull, Si as classifyDaemonServiceRunStartability, Sn as computeRetryDelayMs, So as removeProjectOutbox, Sr as getCommandHintsFromContract, St as runDaemonStop, T as buildFormalSignalReadPayload, Ta as deleteOpenMeldProfile, Ti as ensureDaemonRuntimePaths, Tn as submitRuntimeAgentControllerReports, To as listProjectConnectionsWithStatus, Tr as registerSkillsTargetSelectionOptions, Tt as buildProfileWorkspacePresentation, U as runAgentsConfig, Ua as validateLocalProjectConnectionPath, Ui as startCurrentCommandCheckScope, Un as isReturnKeypress, Uo as cliJsonSkillsListEnvelopeSchema, Ur as resolveDaemonServiceFreshnessWarning, Ut as resolveDaemonServiceParticipationStatus, V as resolveAgentProfileSetup, Va as setProfileDefaultView, Vi as isCurrentCommandCheckScopeActive, Vn as promptSearchMultiselect, Vo as cliBinaryDeltaPatchSchema, Vr as formatDaemonFailureContextText, Vt as resolveLocalComponentsStatus, W as runAgentsCustomAdd, Wa as LocalDaemonControlPlaneClientError, Wi as inspectDaemonServiceInventory, Wn as runInteractivePrompt, Wo as cliJsonSkillsLoadEnvelopeSchema, Wr as resolveCurrentReplyReadinessSnapshot, Wt as runDaemonServiceParticipationGate, X as runAgentsEnable, Xi as readDaemonServiceJobCrashExitCode, Xn as writeDispatchSpaceActionRecord, Xo as package_default, Xr as resolveOpenClawLocalDiagnosticsValue, Xt as runSkillsUninstall, Y as runAgentsDisable, Ya as unregisterAgentActivityRoute, Yi as isDaemonServiceJobNeverSpawned, Yn as readDispatchSpaceActionContextFromEnv, Yo as compareAgentControllerRefsForDisplay, Yr as resolveGatewayChainReadiness, Yt as runSkillsInstall, Z as runAgentsList, Za as defaultManagedIntegrationPaths, Zi as resolveDaemonServiceManager, Zn as formatElapsedTime, Zr as syncProfileWorkspaceState, Zt as runSkillsUpdate, _ as runSpaceWriteWithPasswordRetry, _a as parseCliViewMode, _i as buildDaemonRouteObservationPresentation$1, _n as promptTextEntry, _o as normalizeSharedSessionTitle, _r as createSpaceUpdatesGuideError, _t as runDaemonInterrupt, a as runSpaceDelete, aa as readVersionState, ai as setOpenMeldManagedProfileWorkspace, an as ensureCommandAuthenticationOrCancel, ao as formatOpenMeldCliLine, ar as createProfileMenuGuideError, at as printOpenMeldBanner, b as buildIdentityOnlyMembersSnapshotForReadProjection, ba as isSelectedOpenMeldProfileRequiredError, bi as buildDaemonServiceTargetSpec, bn as resolveServiceParticipationReadiness, bo as removeProjectInbox, br as createUpgradeConfirmationGuideError, bt as runDaemonSnapshot, c as runSpaceLeave, ca as resolveOpenMeldDistribution, ci as syncDeviceRuntimeStateProjection, cn as runAuthLogout, co as resolveSetupFollowUpCliEntryCommand, cr as createSpaceAliasTargetGuideError, ct as renderOpenMeldLogo, d as runSpaceRemoveMembers, da as resolveCurrentDaemonExpectedVersion, di as listAgentTargetStates, dn as buildAuthStatusRows, do as readDaemonServiceContract, dr as createSpaceMenuGuideError, dt as resolveSpaceSendText, ea as buildNextVersionState, ei as ensureOpenMeldManagedProfileWorkspace, en as readRuntimeReportingHealthState, eo as resolveAgentActivityDispatcherCommand, er as formatDaemonServiceMissingRecommendation, et as runAgentsShow, f as runSpaceSend, fa as buildHumanErrorCopy, fi as reconcileNewRunnableBuiltinAgentsForSetup, fn as buildAuthStatusSnapshot, fo as upsertDaemonServiceContract, fr as createSpacePublicationSetGuideError, ft as runDaemon, g as runSpaceReadWithPasswordRetry, ga as formatMessage, gn as resolveCreateProfileName, go as resolveObservedAgentActivityBinding, gr as createSpaceTargetGuideError, gt as runDaemonInstall, h as uploadPreparedSpaceFiles, ha as createPresenter, hi as resolveLocalRegistryAgentIdFromAgentControllerRef, hn as resolveCreateProfileKind, ho as buildAgentActivityEvent, hr as createSpaceSubcommandTargetGuideError, ht as runDaemonCancel, i as runSpaceCreate, ia as fetchLatestPackageInfo, ii as setCustomProfileWorkspace, in as buildCommandAuthenticationPromptMessage, io as formatOpenMeldCliCommands, ir as createProfileCreateGuideError, it as colorizeDisplayProfileLabel, j as assertValidSpaceIdTarget, ja as clearSelectedOpenMeldProfileId, ji as getAgentControllerPermissionModeFieldLabel, jn as upsertSpaceConfig, jo as canonicalizeLocalProjectPath, jr as DualViewGuideError, jt as runDaemonStartupPreflight, k as isSpaceCommandOutputHandledError, ka as updateOpenMeldProfile, ki as createAgentExecutionStatusDisplayRows, kn as resolveLocalAgentControllerReportDecision, ko as setDefaultProjectConnection, kr as registerBuiltinAgentSelectionOptions, kt as createDelayedSpinner, l as runSpaceList, la as resolveDaemonRuntimeContractCompatibility, li as createPrimaryBindingReadSession, ln as runAuthMenu, lo as resolveUserFacingCliEntryCommand, lr as createSpaceContractSetGuideError, lt as renderOpenMeldTagline, m as prepareRequestedSpaceSendFiles, ma as renderHumanTextErrorCard, mi as notifyDaemonRouteCatalogChanged, mn as createProfileByKind, mo as removeAgentActivityContextCache, mr as createSpaceResultGuideError, mt as runDaemonBackgroundStartForDecision, n as promptAndConfirmSpacePassword, na as ensureVersionStateReady, ni as readProfileWorkspaceConfig, nn as connectWebSocket, no as formatInlineOpenMeldCliCommands, nr as createDoctorFailedGuideError, nt as postLocalParticipationMutationReconcile, o as runSpaceHistory, oa as writeVersionState, oi as validateCustomProfileWorkspacePath, on as evaluateCommandAuthentication, oo as formatOpenMeldCliTextBlock, or as createResetConfirmationGuideError, ot as renderOpenMeldBrandBlockLines, p as runSpaceWatch, pa as renderHumanErrorCard, pi as listBuiltinAgentsRegistryEntries, pn as formatActiveOrganizationLabel, po as readAgentActivityContextForPath, pr as createSpaceRemoveMembersGuideError, pt as runDaemonAutostart, q as runAgentsCustomUpdate, qa as registerAgentActivityRoute, qi as readCurrentObservedDaemonRuntimeStatus, qn as assertDispatchOwnedRuntimePublicWriteAllowed, qo as organizationJoinLinkErrorResponseSchema, qr as formatHumanReplyReadinessReason$1, qt as runSkillsCheck$1, r as runSpaceAddMembers, ra as fetchLatestCliBinaryRelease, ri as resolveConfiguredProfileWorkspacePath, rn as assessServerRequiredVersion, ro as formatOpenMeldCliCommand, rr as createProfileActionGuideError, rt as colorizeAgentLabel, s as runSpaceJoin, sa as isBinaryDistribution, si as describeProfileWorkspacePathValidationFailure, sn as runAuthLogin, so as formatProfileAwareOpenMeldCliCommands, sr as createSpaceAddMembersGuideError, st as renderOpenMeldHeader, t as buildCreateSpacePasswordPromptConfig, ta as compareSemver, ti as normalizeCustomProfileWorkspacePath, tn as readRecentDaemonDispatchJournalEvents, to as uninstallAgentActivityIntegrations, tr as canUseInteractivePrompts, tt as formatTransportModeDisplay, u as runSpacePassword, ua as toStartBackgroundHelperExecutionCompatibility, ui as resolveAgentProfilePrimaryAgentControllerReport, un as runAuthStatus, uo as syncLocalAgentActivity, ur as createSpaceLeaveGuideError, ut as resolveGatewayWebOrigin, v as buildHumanReadSignalsTranscriptItems, va as resolveRuntimeContext, vi as buildOnboardingPlan, vn as ensureAgentProfileRuntimeBinding, vo as readCodexSessionTitles, vr as createStartAgentIdentityGuideError, vt as runDaemonReinstall, w as buildFormalDispatchResultReadPayload, wa as createOpenMeldHumanProfile, wi as readRecentDaemonLifecycleEvents, wn as submitRuntimeAgentControllerReport, wo as listProjectBindings, wr as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, wt as runDaemonUninstall, x as loadSpaceIdentityDirectoryOrNull, xa as requireOpenMeldProfile, xi as resolveDaemonServiceAlignmentDecision, xn as assessActionParticipationCandidate, xo as readAgentActivityOutboxHealth, xr as getCommandEntryContract, xt as runDaemonStatusFlow, y as emitHumanReadSignalsTextProjection, ya as resolveViewProfileKey, yi as getSetupFlowCopy, yn as formatServiceParticipationReadinessLabel, yo as enqueueAgentActivityHookEvent, yr as createStartAuthenticationGuideError, yt as runDaemonRunAfterEntryChecks, z as resolveHumanControllerDisplayName, za as resolveAuthenticationGuidanceFromMessage, zi as finishCurrentCommandCheckScope, zn as createSpaceMemberIdentityIndex, zo as outJsonLine, zr as canonicalizeAllowedActions, zt as toStructuredGatewayFailure } from "./command-CYApmFQW.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-CJnq8AgJ.js";
6
+ import { At as centerAgentInteractionSourceSchema, Er as trimmedStringFromUnknown, Ft as isSpaceFileTextEditable, Gn as clientMessageIdSchema, Rt as resolveSpaceFileMimeType, _r as openMeldRuntimeProfileIdSchema, an as spaceContractFieldsSchema, en as dispatchExecutionSchema, fr as openMeldProfileIdSchema, kt as spaceStatusSchema, on as spaceContractSchema, tn as spaceThreadContextSchema, vn as messageEnvelopeSchema, wr as nonEmptyTrimmedStringFromUnknown } from "./runtime-transport-DEj52An9.js";
7
7
  import { r as daemonServiceLaneSchema } from "./service-contract-DZWQdPz5.js";
8
- import { O as getDaemonStatus } from "./daemon-runtime-lease-CKQef0lp.js";
9
- import { a as getAuthSessionState, i as getAuthSessionMetadata, l as updateAuthSessionActiveOrganization, n as clearAuthSession, o as getCurrentAuthOwnerUserId, s as normalizeStoredActiveOrganization } from "./auth-session-BJZuJ2bM.js";
10
- import { c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfile, n as createCliApiClientFoundation, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth } from "./api-client-foundation-CFHEblaZ.js";
8
+ import { O as getDaemonStatus } from "./daemon-runtime-lease-DiRoGxhm.js";
9
+ import { a as getAuthSessionState, i as getAuthSessionMetadata, l as updateAuthSessionActiveOrganization, n as clearAuthSession, o as getCurrentAuthOwnerUserId, s as normalizeStoredActiveOrganization } from "./auth-session-vFtLpWjB.js";
10
+ import { c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfile, n as createCliApiClientFoundation, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth } from "./api-client-foundation-9MJAKRpy.js";
11
11
  import { Command, Option } from "commander";
12
12
  import os, { homedir, hostname, release, tmpdir } from "node:os";
13
13
  import { z } from "zod/v4";
@@ -1772,15 +1772,12 @@ async function runProjectsUnbind(input) {
1772
1772
  });
1773
1773
  return;
1774
1774
  }
1775
- renderInfoCard({
1775
+ renderHumanErrorCard({
1776
1776
  codePrefix: "projects.unbind.error",
1777
+ message,
1778
+ nextStep: "Run `openmeld projects list`, then try again.",
1777
1779
  presenter,
1778
- rows: [{
1779
- label: "Problem",
1780
- value: message
1781
- }],
1782
- sanitize: true,
1783
- title: "Project Unbind Failed"
1780
+ title: "Project couldn't be disconnected"
1784
1781
  });
1785
1782
  }
1786
1783
  }
@@ -1814,18 +1811,12 @@ async function runProjectCommand(input, operation, run) {
1814
1811
  });
1815
1812
  return;
1816
1813
  }
1817
- renderInfoCard({
1814
+ renderHumanErrorCard({
1818
1815
  codePrefix: `${code}.error`,
1816
+ message,
1817
+ nextStep: operation.startsWith("activity.") ? "Try the command again." : "Run `openmeld projects list`, then try again.",
1819
1818
  presenter,
1820
- rows: [{
1821
- label: "Problem",
1822
- value: message
1823
- }, {
1824
- label: "Next",
1825
- value: operation.startsWith("activity.") ? "Run `openmeld activity --view agent` for explicit diagnostics." : "Run `openmeld projects list` and retry."
1826
- }],
1827
- sanitize: true,
1828
- title: operation.startsWith("activity.") ? "Agent Activity Failed" : "Project Command Failed"
1819
+ title: operation.startsWith("activity.") ? "Agent Activity couldn't finish" : "Project action couldn't finish"
1829
1820
  });
1830
1821
  }
1831
1822
  }
@@ -2294,6 +2285,18 @@ const COMMAND_CHECK_REQUIREMENTS = Object.freeze({
2294
2285
  "space.add-members": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2295
2286
  "space.remove-members": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, AUTO_FIX_LOCAL_RUNTIME, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2296
2287
  "space.leave": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, AUTO_FIX_LOCAL_RUNTIME, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2288
+ "space.files.list": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2289
+ "space.files.read": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2290
+ "space.files.upload": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2291
+ "space.files.write": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2292
+ "space.files.download": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2293
+ "space.files.mkdir": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2294
+ "space.files.rename": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2295
+ "space.files.move": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2296
+ "space.files.trash": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2297
+ "space.files.history": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2298
+ "space.files.restore": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2299
+ "space.files.restore-version": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2297
2300
  "space.watch": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, AUTO_FIX_LOCAL_RUNTIME, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2298
2301
  "space.send": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, AUTO_FIX_LOCAL_RUNTIME, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
2299
2302
  "space.history": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, AUTO_FIX_LOCAL_RUNTIME, REQUIRED_SIGN_IN, CONFIRM_SELECTED_PROFILE),
@@ -2482,6 +2485,30 @@ const COMMAND_ENTRY_NAME_BY_ROUTE = {
2482
2485
  "spaces remove-members": "space.remove-members",
2483
2486
  "space leave": "space.leave",
2484
2487
  "spaces leave": "space.leave",
2488
+ "space files list": "space.files.list",
2489
+ "spaces files list": "space.files.list",
2490
+ "space files read": "space.files.read",
2491
+ "spaces files read": "space.files.read",
2492
+ "space files upload": "space.files.upload",
2493
+ "spaces files upload": "space.files.upload",
2494
+ "space files write": "space.files.write",
2495
+ "spaces files write": "space.files.write",
2496
+ "space files download": "space.files.download",
2497
+ "spaces files download": "space.files.download",
2498
+ "space files mkdir": "space.files.mkdir",
2499
+ "spaces files mkdir": "space.files.mkdir",
2500
+ "space files rename": "space.files.rename",
2501
+ "spaces files rename": "space.files.rename",
2502
+ "space files move": "space.files.move",
2503
+ "spaces files move": "space.files.move",
2504
+ "space files trash": "space.files.trash",
2505
+ "spaces files trash": "space.files.trash",
2506
+ "space files history": "space.files.history",
2507
+ "spaces files history": "space.files.history",
2508
+ "space files restore": "space.files.restore",
2509
+ "spaces files restore": "space.files.restore",
2510
+ "space files restore-version": "space.files.restore-version",
2511
+ "spaces files restore-version": "space.files.restore-version",
2485
2512
  "space watch": "space.watch",
2486
2513
  "spaces watch": "space.watch",
2487
2514
  "space send": "space.send",
@@ -4511,6 +4538,78 @@ const COMMAND_ENTRY_COPY_BY_NAME = Object.freeze({
4511
4538
  cliUpdateAction: "leaving a space",
4512
4539
  serviceAction: null
4513
4540
  },
4541
+ "space.files.list": {
4542
+ signInAction: "listing Space files",
4543
+ profileAction: "listing Space files",
4544
+ cliUpdateAction: "listing Space files",
4545
+ serviceAction: null
4546
+ },
4547
+ "space.files.read": {
4548
+ signInAction: "reading a Space file",
4549
+ profileAction: "reading a Space file",
4550
+ cliUpdateAction: "reading a Space file",
4551
+ serviceAction: null
4552
+ },
4553
+ "space.files.upload": {
4554
+ signInAction: "uploading a Space file",
4555
+ profileAction: "uploading a Space file",
4556
+ cliUpdateAction: "uploading a Space file",
4557
+ serviceAction: null
4558
+ },
4559
+ "space.files.write": {
4560
+ signInAction: "updating a Space file",
4561
+ profileAction: "updating a Space file",
4562
+ cliUpdateAction: "updating a Space file",
4563
+ serviceAction: null
4564
+ },
4565
+ "space.files.download": {
4566
+ signInAction: "downloading a Space file",
4567
+ profileAction: "downloading a Space file",
4568
+ cliUpdateAction: "downloading a Space file",
4569
+ serviceAction: null
4570
+ },
4571
+ "space.files.mkdir": {
4572
+ signInAction: "creating a Space folder",
4573
+ profileAction: "creating a Space folder",
4574
+ cliUpdateAction: "creating a Space folder",
4575
+ serviceAction: null
4576
+ },
4577
+ "space.files.rename": {
4578
+ signInAction: "renaming a Space file or folder",
4579
+ profileAction: "renaming a Space file or folder",
4580
+ cliUpdateAction: "renaming a Space file or folder",
4581
+ serviceAction: null
4582
+ },
4583
+ "space.files.move": {
4584
+ signInAction: "moving a Space file or folder",
4585
+ profileAction: "moving a Space file or folder",
4586
+ cliUpdateAction: "moving a Space file or folder",
4587
+ serviceAction: null
4588
+ },
4589
+ "space.files.trash": {
4590
+ signInAction: "moving a Space file or folder to trash",
4591
+ profileAction: "moving a Space file or folder to trash",
4592
+ cliUpdateAction: "moving a Space file or folder to trash",
4593
+ serviceAction: null
4594
+ },
4595
+ "space.files.history": {
4596
+ signInAction: "viewing a Space file's history",
4597
+ profileAction: "viewing a Space file's history",
4598
+ cliUpdateAction: "viewing a Space file's history",
4599
+ serviceAction: null
4600
+ },
4601
+ "space.files.restore": {
4602
+ signInAction: "restoring a Space file or folder",
4603
+ profileAction: "restoring a Space file or folder",
4604
+ cliUpdateAction: "restoring a Space file or folder",
4605
+ serviceAction: null
4606
+ },
4607
+ "space.files.restore-version": {
4608
+ signInAction: "restoring a Space file version",
4609
+ profileAction: "restoring a Space file version",
4610
+ cliUpdateAction: "restoring a Space file version",
4611
+ serviceAction: null
4612
+ },
4514
4613
  "space.watch": {
4515
4614
  signInAction: "watching a space",
4516
4615
  profileAction: "watching a space",
@@ -6412,7 +6511,7 @@ function emitCliError(input) {
6412
6511
  const message = localMachineIssue ? formatLocalMachineIssueMessage(localMachineIssue) : input.message;
6413
6512
  const formattedMessage = formatOpenMeldCliTextBlock(message);
6414
6513
  const requestId = readCliErrorRequestId(input.error);
6415
- const authGuidance = resolveAuthenticationGuidanceFromError(input.error) ?? resolveAuthenticationGuidanceFromMessage(input.message);
6514
+ const authGuidance = resolveAuthenticationGuidanceFromError(input.error) ?? (shouldResolveAuthenticationGuidanceFromMessage(input.code) ? resolveAuthenticationGuidanceFromMessage(input.message) : null);
6416
6515
  if (input.effectiveView === "agent") {
6417
6516
  emitAgentCliError({
6418
6517
  code: input.code,
@@ -6435,13 +6534,17 @@ function emitCliError(input) {
6435
6534
  rows: card.rows,
6436
6535
  emitLine: outLine
6437
6536
  });
6438
- emitCliErrorRequestIdLine(requestId);
6439
6537
  return Promise.resolve("none");
6440
6538
  }
6441
- errLine(`error: ${formattedMessage}`);
6442
- emitCliErrorRequestIdLine(requestId);
6539
+ renderHumanTextErrorCard({
6540
+ emitLine: errLine,
6541
+ message
6542
+ });
6443
6543
  return Promise.resolve("none");
6444
6544
  }
6545
+ function shouldResolveAuthenticationGuidanceFromMessage(code) {
6546
+ return code === "cli.error" || code.startsWith("auth.");
6547
+ }
6445
6548
  function emitAgentCliError(input) {
6446
6549
  if (input.localMachineIssue) {
6447
6550
  const message = formatLocalMachineIssueMessage(input.localMachineIssue);
@@ -6500,10 +6603,6 @@ function emitAgentCliStructuredGuide(input) {
6500
6603
  payload: buildStructuredGuidePayload(input.formattedGuide)
6501
6604
  });
6502
6605
  }
6503
- function emitCliErrorRequestIdLine(requestId) {
6504
- if (!requestId) return;
6505
- errLine(`Request ID: ${requestId}`);
6506
- }
6507
6606
  function readCliErrorRequestId(error) {
6508
6607
  if (!error || typeof error !== "object") return null;
6509
6608
  const requestId = error.requestId;
@@ -7141,7 +7240,7 @@ function classifyBindingApiFailure(input) {
7141
7240
  const operationLabel = formatBindingOperationLabel(input.operation);
7142
7241
  return {
7143
7242
  code: `binding.${input.operation}_failed`,
7144
- title: "Binding Authorization Failed",
7243
+ title: "Binding couldn't be authorized",
7145
7244
  message: `OpenMeld could not ${operationLabel}.`,
7146
7245
  nextStep: "Retry after OpenMeld Gateway is reachable."
7147
7246
  };
@@ -7161,26 +7260,16 @@ function emitBindingCommandError(input) {
7161
7260
  message: input.message,
7162
7261
  nextStep: input.nextStep
7163
7262
  },
7263
+ ...input.details ? { details: input.details } : {},
7164
7264
  ...input.payload ?? {}
7165
7265
  };
7166
7266
  if (input.presenter.view === "human") {
7167
- renderInfoCard({
7168
- presenter: input.presenter,
7169
- title: input.title,
7267
+ renderHumanErrorCard({
7170
7268
  codePrefix: "binding.error.card",
7171
- rows: [
7172
- {
7173
- label: "Reason",
7174
- value: input.message
7175
- },
7176
- {
7177
- label: "Next Step",
7178
- value: input.nextStep
7179
- },
7180
- ...input.details ?? []
7181
- ],
7182
- sanitize: true,
7183
- minContentWidth: 72
7269
+ message: input.message,
7270
+ nextStep: input.nextStep,
7271
+ presenter: input.presenter,
7272
+ title: input.title
7184
7273
  });
7185
7274
  return;
7186
7275
  }
@@ -7614,7 +7703,7 @@ function emitCenterAgentApiError(input) {
7614
7703
  activeOrganization: input.activeOrganization,
7615
7704
  agentProfileId: input.agentProfileId,
7616
7705
  code: classified.code,
7617
- details: buildFailureDetails$1(failure),
7706
+ details: buildFailureDetails(failure),
7618
7707
  message: classified.message,
7619
7708
  nextStep: classified.nextStep,
7620
7709
  payload: {
@@ -7745,7 +7834,7 @@ function classifyCenterAgentApiFailure(input) {
7745
7834
  code: `center_agent.${input.operation}_failed`,
7746
7835
  message: `OpenMeld could not ${operationLabel}.`,
7747
7836
  nextStep: "Retry after OpenMeld Gateway is reachable.",
7748
- title: "Center Agent Command Failed"
7837
+ title: "Center Agent action couldn't finish"
7749
7838
  };
7750
7839
  }
7751
7840
  function emitCenterAgentCommandError(input) {
@@ -7759,25 +7848,15 @@ function emitCenterAgentCommandError(input) {
7759
7848
  nextStep: input.nextStep
7760
7849
  },
7761
7850
  ...input.agentProfileId ? { agentProfileId: input.agentProfileId } : {},
7851
+ ...input.details ? { details: input.details } : {},
7762
7852
  ...input.payload ?? {}
7763
7853
  };
7764
7854
  if (input.presenter.view === "human") {
7765
- renderInfoCard({
7855
+ renderHumanErrorCard({
7766
7856
  codePrefix: "center-agent.error.card",
7767
- minContentWidth: 72,
7857
+ message: input.message,
7858
+ nextStep: input.nextStep,
7768
7859
  presenter: input.presenter,
7769
- rows: [
7770
- {
7771
- label: "Reason",
7772
- value: input.message
7773
- },
7774
- {
7775
- label: "Next Step",
7776
- value: input.nextStep
7777
- },
7778
- ...input.details ?? []
7779
- ],
7780
- sanitize: true,
7781
7860
  title: input.title
7782
7861
  });
7783
7862
  return;
@@ -7787,7 +7866,7 @@ function emitCenterAgentCommandError(input) {
7787
7866
  payload
7788
7867
  });
7789
7868
  }
7790
- function buildFailureDetails$1(failure) {
7869
+ function buildFailureDetails(failure) {
7791
7870
  return [
7792
7871
  ...failure.status === null ? [] : [{
7793
7872
  label: "HTTP Status",
@@ -13578,11 +13657,14 @@ async function fetchSpaceDispatchTrace(input) {
13578
13657
  const response = await fetchSpaceRequestWithTimeout({
13579
13658
  url: endpoint,
13580
13659
  operation: "space.dispatch_trace",
13581
- init: { headers: await buildOpenMeldRequestContextHeadersWithAuth({
13582
- requestUrl: endpoint,
13583
- requestContext: input.requestContext,
13584
- spacePassword: input.password
13585
- }) }
13660
+ init: { headers: {
13661
+ ...await buildOpenMeldRequestContextHeadersWithAuth({
13662
+ requestUrl: endpoint,
13663
+ requestContext: input.requestContext,
13664
+ spacePassword: input.password
13665
+ }),
13666
+ [SPACE_DISPATCH_TRACE_RESPONSE_CONTRACT_VERSION_HEADER]: String(2)
13667
+ } }
13586
13668
  });
13587
13669
  const raw = await response.text();
13588
13670
  if (!response.ok) throw new Error(`HTTP ${response.status}: ${raw}`);
@@ -15211,6 +15293,25 @@ function buildAgentTraceCompactSummary(input) {
15211
15293
  reasonCode: finalVisibleOutcome.reasonCode,
15212
15294
  visibleOutcome: finalVisibleOutcome.status
15213
15295
  };
15296
+ const headLifecycle = trace.runtimeCoordinatorHeadLifecycle;
15297
+ if (headLifecycle?.readStatus === "found" && headLifecycle.waitingBoundary) {
15298
+ const waitingBoundary = headLifecycle.waitingBoundary;
15299
+ return {
15300
+ ...nativeDeliveryEvidence,
15301
+ currentState: headLifecycle.status,
15302
+ delivered: false,
15303
+ nextAction: waitingBoundary.userRecoveryAction === "wait_for_wake_route_report" ? "wait for the Wake route report, then rerun trace with the same selector" : "start or restart OpenMeld Service, then rerun trace with the same selector",
15304
+ reasonCode: waitingBoundary.reasonCode,
15305
+ visibleOutcome: finalVisibleOutcome.status,
15306
+ waitingBoundary: {
15307
+ deadlineAt: waitingBoundary.deadlineAt,
15308
+ softDeadlineAt: waitingBoundary.softDeadlineAt,
15309
+ userRecoveryAction: waitingBoundary.userRecoveryAction,
15310
+ waitingFor: waitingBoundary.waitingFor,
15311
+ waitingSince: waitingBoundary.waitingSince
15312
+ }
15313
+ };
15314
+ }
15214
15315
  if (finalVisibleOutcome.status === "publication_pending" || finalVisibleOutcome.status === "publication_retrying") return {
15215
15316
  ...nativeDeliveryEvidence,
15216
15317
  currentState: "publishing",
@@ -15264,6 +15365,11 @@ function formatAgentTraceCompactSummary(input) {
15264
15365
  `visible_outcome=${input.visibleOutcome}`,
15265
15366
  `current_state=${input.currentState}`,
15266
15367
  input.reasonCode ? `reason=${input.reasonCode}` : null,
15368
+ input.waitingBoundary ? `waiting_for=${input.waitingBoundary.waitingFor}` : null,
15369
+ input.waitingBoundary ? `waiting_deadline=${input.waitingBoundary.deadlineAt}` : null,
15370
+ input.waitingBoundary ? `recovery_action=${input.waitingBoundary.userRecoveryAction}` : null,
15371
+ input.waitingBoundary ? `waiting_soft_deadline=${input.waitingBoundary.softDeadlineAt}` : null,
15372
+ input.waitingBoundary ? `waiting_since=${input.waitingBoundary.waitingSince}` : null,
15267
15373
  input.runtimeFamily ? `runtime_family=${input.runtimeFamily}` : null,
15268
15374
  input.deliveryDestination ? `destination=${input.deliveryDestination}` : null,
15269
15375
  input.controllerNormalizationStatus ? `controller_normalization=${input.controllerNormalizationStatus}` : null,
@@ -16560,6 +16666,17 @@ function shouldForceSetupServiceRefresh() {
16560
16666
  return process.env.OPENMELD_SETUP_FORCE_SERVICE_REFRESH === "1";
16561
16667
  }
16562
16668
  //#endregion
16669
+ //#region src/runtime/cli-output-handled-error.ts
16670
+ var CliOutputHandledError = class extends Error {
16671
+ constructor(message) {
16672
+ super(message);
16673
+ this.name = "CliOutputHandledError";
16674
+ }
16675
+ };
16676
+ function isCliOutputHandledError(error) {
16677
+ return error instanceof CliOutputHandledError || error instanceof Error && error.name === "CliOutputHandledError";
16678
+ }
16679
+ //#endregion
16563
16680
  //#region src/commands/prepare-step-diagnostics.ts
16564
16681
  const PREPARE_STEP_DIAGNOSTICS_PAYLOAD_MAX_CHARS = Math.min(16e3, PREPARE_STEP_DIAGNOSTICS_MAX_CHARS);
16565
16682
  const PREPARE_STEP_DIAGNOSTICS_BUNDLE_VERSION = 2;
@@ -17305,21 +17422,25 @@ async function handleTerminalStepFailure(input) {
17305
17422
  revisionFloor: startedSnapshot.sessionRevision,
17306
17423
  stream: input.input.stream
17307
17424
  });
17308
- input.progress.fail(message);
17309
- const humanLines = [message];
17310
- if (!localMachineIssue) humanLines.push("After fixing this step, copy a fresh setup command from OpenMeld Web and run setup again.");
17311
- if (diagnostics !== null) humanLines.push(`A diagnostic summary was shared with OpenMeld to help fix this (support code: ${reasonCode}).`);
17312
- emitHumanStatus(input.input.input, "Setup blocked", humanLines);
17425
+ input.progress.fail("Setup stopped.");
17313
17426
  if (isLocalMachineFailureError(input.error)) throw input.error;
17314
- const userFacingError = new Error(message);
17315
- userFacingError.cause = input.error;
17316
- throw userFacingError;
17427
+ if (input.input.input.runtime.resolvedView === "human") {
17428
+ renderHumanErrorCard({
17429
+ codePrefix: "prepare.session.failed",
17430
+ message,
17431
+ presenter: input.input.input.presenter,
17432
+ title: "Setup couldn't finish"
17433
+ });
17434
+ throw new CliOutputHandledError(rawMessage);
17435
+ }
17436
+ const agentError = new Error(rawMessage, { cause: input.error });
17437
+ agentError.code = reasonCode;
17438
+ throw agentError;
17317
17439
  }
17318
17440
  function assertTerminalStepCompletedOrThrow(input) {
17319
17441
  if (findStep(input.snapshot, input.stepId)?.state === "complete" && input.snapshot.phase !== "blocked") return;
17320
- const blocker = input.snapshot.blockers.find((candidate) => candidate.stepId === input.stepId) ?? input.snapshot.blockers[0] ?? null;
17321
- const message = blocker?.message ?? "OpenMeld setup is blocked. Return to OpenMeld Web for details.";
17322
- emitHumanStatus(input.input, "Setup blocked", [message, ...blocker?.reasonCode ? [`Support code: ${blocker.reasonCode}`] : []]);
17442
+ const message = (input.snapshot.blockers.find((candidate) => candidate.stepId === input.stepId) ?? input.snapshot.blockers[0] ?? null)?.message ?? "OpenMeld setup is blocked. Return to OpenMeld Web for details.";
17443
+ emitHumanStatus(input.input, "Setup blocked", [message]);
17323
17444
  throw new PrepareSessionBlockedByCoreError(message);
17324
17445
  }
17325
17446
  function resolveNextTerminalPrepareStep(snapshot) {
@@ -17660,7 +17781,7 @@ async function enforcePrepareSessionTerminalAuth(input) {
17660
17781
  const step = findStep(snapshot, "connect_terminal");
17661
17782
  return snapshot.sessionRevision > beforeWriteRevision && step?.state === "blocked";
17662
17783
  });
17663
- emitHumanStatus(input.input, "Setup blocked", [result.message, `Support code: ${result.reasonCode}`]);
17784
+ emitHumanStatus(input.input, "Setup blocked", [result.message]);
17664
17785
  throw new Error(result.message);
17665
17786
  }
17666
17787
  async function connectSelectedLocalAgentsToOpenMeld(input) {
@@ -17820,7 +17941,7 @@ function buildSelectedRuntimeReadinessError(input) {
17820
17941
  return /* @__PURE__ */ new Error(`OpenMeld could not verify that selected local agents were reported to OpenMeld yet. Keep OpenMeld Service running, then run \`${formatOpenMeldCliCommand("openmeld setup --view agent")}\` again. You can also run \`${formatOpenMeldCliCommand("openmeld service status --view agent")}\` to inspect the local service. Support code: ${reasonCode}.`);
17821
17942
  }
17822
17943
  function buildSelectedRuntimeReadinessUnreachableError(lastError) {
17823
- return new Error(`OpenMeld could not reach OpenMeld to verify selected local agents during the setup verification window. Last network error: ${toErrorMessage$2(lastError)}. Support code: ${VERIFY_SETUP_READINESS_UNREACHABLE_SUPPORT_CODE}.`, { cause: lastError });
17944
+ return new Error(`OpenMeld could not connect to the setup service while checking your local agents. Last network error: ${toErrorMessage$2(lastError)}. Support code: ${VERIFY_SETUP_READINESS_UNREACHABLE_SUPPORT_CODE}.`, { cause: lastError });
17824
17945
  }
17825
17946
  function isSelectedRuntimeReadinessStillConverging(input) {
17826
17947
  if (!input.response.agentControllerReportsRead || input.response.openMeldServiceRuntimeId === void 0) return false;
@@ -17863,18 +17984,12 @@ async function resolveRefreshServiceJobVerdict(input) {
17863
17984
  function formatTerminalStepFailureMessage(input) {
17864
17985
  if (input.rawMessage.includes("prepare session revision conflict")) return "This setup changed while Terminal was working. Copy a fresh setup command from OpenMeld Web and run setup again to continue from the latest step.";
17865
17986
  if (input.stepId === "refresh_service") {
17866
- if (input.serviceJobVerdict === "never_spawned") return `macOS is blocking the OpenMeld Service background item, so OpenMeld Service never launched. Path A: open System Settings > General > Login Items & Extensions, enable the OpenMeld background item, then copy a fresh setup command from OpenMeld Web and run setup again. Path B: run \`${formatOpenMeldCliCommand("openmeld service start --mode foreground")}\` in a separate terminal and keep it open (Wake stops when you close that window), then run setup again.`;
17867
- if (input.serviceJobVerdict === "crashed") return `OpenMeld Service started but keeps exiting on this Mac. Run \`${formatOpenMeldCliCommand("openmeld service start --mode foreground")}\` to see the live error, fix it, then copy a fresh setup command from OpenMeld Web and run setup again.`;
17868
- const detail = formatTerminalStepFailureDetail(input.rawMessage);
17869
- return `OpenMeld Service did not report a running local connection during setup. Copy a fresh setup command from OpenMeld Web and run setup again to continue from this step. If it fails again, run \`${formatOpenMeldCliCommand("openmeld service start --mode foreground")}\` to see live startup logs, then copy a fresh setup command from OpenMeld Web and run setup again.${detail ? ` Detail: ${detail}` : ""}`;
17987
+ if (input.serviceJobVerdict === "never_spawned") return "macOS didn't start OpenMeld Service. Open System Settings > General > Login Items & Extensions, turn on the OpenMeld background item, then copy a new setup command from OpenMeld Web.";
17988
+ if (input.serviceJobVerdict === "crashed") return `OpenMeld Service keeps stopping after it starts. Run \`${formatOpenMeldCliCommand("openmeld service start --mode foreground")}\` to see the live error, then copy a new setup command from OpenMeld Web.`;
17989
+ return "OpenMeld couldn't update its background service. Restart your computer, then copy a new setup command from OpenMeld Web.";
17870
17990
  }
17871
- return input.rawMessage;
17872
- }
17873
- function formatTerminalStepFailureDetail(rawMessage) {
17874
- const normalized = rawMessage.replace(/\s+/g, " ").trim();
17875
- if (normalized.length === 0 || normalized === "OpenMeld Service is not connected yet.") return null;
17876
- const maxLength = 220;
17877
- return normalized.length > maxLength ? `${normalized.slice(0, maxLength - 3)}...` : normalized;
17991
+ const copy = buildHumanErrorCopy(input.rawMessage);
17992
+ return [copy.summary, copy.nextStep ?? "Copy a new setup command from OpenMeld Web and run it again."].join(" ");
17878
17993
  }
17879
17994
  function resolveTerminalStepFailureReasonCode(input) {
17880
17995
  if (input.rawMessage.includes("runtime.registration.device_forgotten")) return "runtime.registration.device_forgotten";
@@ -18200,8 +18315,7 @@ function emitTerminalStepCompletionNotice(input, notice) {
18200
18315
  emitHumanStatus(input, "Setup complete — final checks still running", [
18201
18316
  notice.message,
18202
18317
  "This usually completes automatically within a few minutes. You do not need to run setup again.",
18203
- `Run \`${formatOpenMeldCliCommand("openmeld service status")}\` to check progress.`,
18204
- `Support code: ${notice.supportCode}`
18318
+ `Run \`${formatOpenMeldCliCommand("openmeld service status")}\` to check progress.`
18205
18319
  ]);
18206
18320
  return;
18207
18321
  }
@@ -20944,31 +21058,19 @@ function buildMissingWhoamiProfileRows(guidance) {
20944
21058
  return rows;
20945
21059
  }
20946
21060
  function buildUnavailableWhoamiProfileRows(guidance) {
20947
- const [firstStep, retryStep] = guidance.nextSteps;
21061
+ const [firstStep] = guidance.nextSteps;
20948
21062
  return [
20949
21063
  {
20950
21064
  label: "Selected Shell Profile",
20951
21065
  value: pc.bold(pc.yellow("temporarily unavailable"))
20952
21066
  },
20953
21067
  {
20954
- label: "Why it matters",
20955
- value: "OpenMeld could not load the selected profile right now, so this command cannot show the active sender identity yet."
20956
- },
20957
- {
20958
- label: "Reason",
21068
+ label: "What happened",
20959
21069
  value: guidance.summary
20960
21070
  },
20961
21071
  {
20962
- label: "Details",
20963
- value: guidance.details
20964
- },
20965
- {
20966
- label: "Next step",
21072
+ label: "Next",
20967
21073
  value: formatInlineOpenMeldCliCommands(`Run \`${firstStep}\` first.`)
20968
- },
20969
- {
20970
- label: "Then",
20971
- value: formatInlineOpenMeldCliCommands(`Run \`${retryStep}\` and retry this command.`)
20972
21074
  }
20973
21075
  ];
20974
21076
  }
@@ -22803,7 +22905,8 @@ const TOP_LEVEL_HELP_EXAMPLES = [
22803
22905
  "openmeld space password <space-id> --password <new-password>",
22804
22906
  "openmeld space send <space-id> \"hello from Mars deck\"",
22805
22907
  "echo \"hello from file-safe input\" | openmeld space send <space-id> --stdin",
22806
- "openmeld space send <space-id> --file /tmp/message.txt",
22908
+ "openmeld space send <space-id> --text-file /tmp/message.txt",
22909
+ "openmeld space send <space-id> --file /tmp/launch-brief.pdf",
22807
22910
  "openmeld view",
22808
22911
  "openmeld view agent"
22809
22912
  ];
@@ -23026,9 +23129,8 @@ function emitHelpfulHints(input) {
23026
23129
  });
23027
23130
  return;
23028
23131
  }
23029
- outLine("");
23030
- outLine("available commands:");
23031
- for (const hint of hints) outLine(` - ${hint}`);
23132
+ if (buildHumanErrorCopy(input.message).nextStep) return;
23133
+ outLine(`Next: ${hints[0]}`);
23032
23134
  }
23033
23135
  function buildHints(argv, message, error) {
23034
23136
  if (resolveAuthenticationGuidanceFromError(error) !== null || resolveAuthenticationGuidanceFromMessage(message) !== null) return [];
@@ -23413,7 +23515,7 @@ function emitOrganizationApiError(input) {
23413
23515
  presenter: input.presenter,
23414
23516
  cliJsonOutput: input.cliJsonOutput,
23415
23517
  code: failure.code ?? "organization.unexpected_error",
23416
- title: "Organization Error",
23518
+ title: "Organization action couldn't finish",
23417
23519
  message: failure.message,
23418
23520
  nextStep: "Confirm the active Organization and retry after OpenMeld Gateway is reachable.",
23419
23521
  activeOrganization: input.activeOrganization,
@@ -23456,7 +23558,7 @@ function resolveOrganizationApiErrorPresentation(code) {
23456
23558
  nextStep: "Ask an Organization owner or admin to manage the invite link."
23457
23559
  };
23458
23560
  return {
23459
- title: "Organization Error",
23561
+ title: "Organization action couldn't finish",
23460
23562
  nextStep: "Retry the command after OpenMeld auth is reachable."
23461
23563
  };
23462
23564
  }
@@ -23478,26 +23580,16 @@ function emitOrganizationCommandError(input) {
23478
23580
  message: input.message,
23479
23581
  nextStep: input.nextStep
23480
23582
  },
23583
+ ...input.details ? { details: input.details } : {},
23481
23584
  ...input.payload ?? {}
23482
23585
  };
23483
23586
  if (input.presenter.view === "human") {
23484
- renderInfoCard({
23485
- presenter: input.presenter,
23486
- title: input.title,
23587
+ renderHumanErrorCard({
23487
23588
  codePrefix: "organization.error.card",
23488
- rows: [
23489
- {
23490
- label: "Reason",
23491
- value: input.message
23492
- },
23493
- {
23494
- label: "Next Step",
23495
- value: input.nextStep
23496
- },
23497
- ...input.details ?? []
23498
- ],
23499
- sanitize: true,
23500
- minContentWidth: 72
23589
+ message: input.message,
23590
+ nextStep: input.nextStep,
23591
+ presenter: input.presenter,
23592
+ title: input.title
23501
23593
  });
23502
23594
  return;
23503
23595
  }
@@ -24344,7 +24436,7 @@ function emitCommandError(input) {
24344
24436
  message: sessionUnavailable ? "OpenMeld cannot verify Resume or Fork against the selected local Session yet." : `OpenMeld could not ${input.operation} this Agent Profile request.`,
24345
24437
  nextStep: sessionUnavailable ? "Use a new-session request for now. Resume and Fork will become available through Agent Activity session verification." : "Check the request status and Organization, then retry.",
24346
24438
  presenter: input.context.presenter,
24347
- title: sessionUnavailable ? "Resume And Fork Not Ready" : "Agent Profile Request Failed"
24439
+ title: sessionUnavailable ? "Resume and Fork aren't ready" : "Agent Profile request couldn't be updated"
24348
24440
  });
24349
24441
  }
24350
24442
  function emitLocalError(input) {
@@ -24356,6 +24448,7 @@ function emitLocalError(input) {
24356
24448
  status: "error",
24357
24449
  error: {
24358
24450
  code: input.code,
24451
+ details: input.details,
24359
24452
  message: input.message,
24360
24453
  nextStep: input.nextStep
24361
24454
  }
@@ -24363,22 +24456,11 @@ function emitLocalError(input) {
24363
24456
  });
24364
24457
  return;
24365
24458
  }
24366
- renderInfoCard({
24459
+ renderHumanErrorCard({
24367
24460
  codePrefix: "profile.creation-request.error.card",
24368
- minContentWidth: 72,
24461
+ message: input.message,
24462
+ nextStep: input.nextStep,
24369
24463
  presenter: input.presenter,
24370
- rows: [
24371
- {
24372
- label: "Reason",
24373
- value: input.message
24374
- },
24375
- {
24376
- label: "Next Step",
24377
- value: input.nextStep
24378
- },
24379
- ...input.details ?? []
24380
- ],
24381
- sanitize: true,
24382
24464
  title: input.title
24383
24465
  });
24384
24466
  }
@@ -25612,22 +25694,11 @@ function emitClassifiedRoutineError(input) {
25612
25694
  }, { code: input.classified.code });
25613
25695
  return;
25614
25696
  }
25615
- renderInfoCard({
25697
+ renderHumanErrorCard({
25616
25698
  codePrefix: "routines.error.card",
25617
- minContentWidth: 72,
25699
+ message: input.classified.message,
25700
+ nextStep: input.classified.nextStep,
25618
25701
  presenter: input.context.presenter,
25619
- rows: [
25620
- {
25621
- label: "Reason",
25622
- value: input.classified.message
25623
- },
25624
- {
25625
- label: "Next Step",
25626
- value: input.classified.nextStep
25627
- },
25628
- ...buildFailureDetails(input.failure)
25629
- ],
25630
- sanitize: true,
25631
25702
  title: input.classified.title
25632
25703
  });
25633
25704
  }
@@ -25713,43 +25784,21 @@ function classifyRoutineApiFailure(failure, operation) {
25713
25784
  code: failure.code,
25714
25785
  message: formatSafeFailureMessage(failure),
25715
25786
  nextStep: "Check OpenMeld Gateway health, then retry this command.",
25716
- title: "Routine Command Failed"
25787
+ title: "Routine action couldn't finish"
25717
25788
  };
25718
25789
  if (failure.code) return {
25719
25790
  code: failure.code,
25720
25791
  message: failure.message,
25721
25792
  nextStep: "Check the diagnostic evidence, then retry this command.",
25722
- title: "Routine Command Failed"
25793
+ title: "Routine action couldn't finish"
25723
25794
  };
25724
25795
  return {
25725
25796
  code: `routine.${operation}_failed`,
25726
25797
  message: failure.message,
25727
25798
  nextStep: "Check your connection, then retry this command.",
25728
- title: "Routine Command Failed"
25799
+ title: "Routine action couldn't finish"
25729
25800
  };
25730
25801
  }
25731
- function buildFailureDetails(failure) {
25732
- if (!failure) return [];
25733
- const schemaIssue = formatSchemaIssue(failure);
25734
- return [
25735
- ...failure.status === null ? [] : [{
25736
- label: "HTTP Status",
25737
- value: String(failure.status)
25738
- }],
25739
- ...failure.upstreamCode ? [{
25740
- label: "Upstream Code",
25741
- value: failure.upstreamCode
25742
- }] : [],
25743
- ...schemaIssue ? [{
25744
- label: "Schema Issue",
25745
- value: schemaIssue
25746
- }] : [],
25747
- ...failure.requestId ? [{
25748
- label: "Request ID",
25749
- value: failure.requestId
25750
- }] : []
25751
- ];
25752
- }
25753
25802
  function buildSafeFailureEvidence(failure) {
25754
25803
  return {
25755
25804
  code: failure.code,
@@ -26239,8 +26288,7 @@ function formatRoutineLastRun(lastRun) {
26239
26288
  }
26240
26289
  function formatRoutineRunSummary(run) {
26241
26290
  const parts = [formatRoutineRunStatus(run.status), `Scheduled: ${new Date(run.scheduledFor).toISOString()}`];
26242
- if (run.failureCode) parts.push(`Code: ${run.failureCode}`);
26243
- if (run.failureDetail) parts.push(`Detail: ${run.failureDetail}`);
26291
+ if (run.failureDetail) parts.push(run.failureDetail);
26244
26292
  return parts.join(" · ");
26245
26293
  }
26246
26294
  function formatRoutineRunStatus(status) {
@@ -26638,21 +26686,66 @@ function runSpaceActionReply(input) {
26638
26686
  messageLength: text.length,
26639
26687
  referenceTargetCount: targetIds.referenceTargets.length
26640
26688
  });
26689
+ const filePaths = input.filePaths ?? [];
26690
+ if (filePaths.length === 0) {
26691
+ recordSpaceActionReply({
26692
+ context,
26693
+ files: [],
26694
+ targetIds,
26695
+ text,
26696
+ timing
26697
+ });
26698
+ return;
26699
+ }
26700
+ return uploadAndRecordSpaceActionReply({
26701
+ context,
26702
+ filePaths,
26703
+ targetIds,
26704
+ text,
26705
+ timing
26706
+ });
26707
+ }
26708
+ async function uploadAndRecordSpaceActionReply(input) {
26709
+ const files = await uploadSpaceActionReplyFiles({
26710
+ context: input.context,
26711
+ filePaths: input.filePaths
26712
+ });
26713
+ recordSpaceActionReply({
26714
+ ...input,
26715
+ files
26716
+ });
26717
+ }
26718
+ function recordSpaceActionReply(input) {
26641
26719
  const record = recordAction({
26642
26720
  action: {
26643
26721
  type: "post_message",
26722
+ ...input.files.length > 0 ? { files: [...input.files] } : {},
26644
26723
  messageEnvelope: {
26645
- activationTargets: targetIds.activationTargets,
26646
- referenceTargets: targetIds.referenceTargets,
26647
- ...context.replyToSignalId ? { replyToSignalId: context.replyToSignalId } : {},
26648
- text
26724
+ activationTargets: input.targetIds.activationTargets,
26725
+ referenceTargets: input.targetIds.referenceTargets,
26726
+ ...input.context.replyToSignalId ? { replyToSignalId: input.context.replyToSignalId } : {},
26727
+ text: input.text
26649
26728
  }
26650
26729
  },
26651
26730
  command: "reply",
26652
- context
26731
+ context: input.context
26732
+ });
26733
+ input.timing.emit("record_written", input.context, { actionType: record.action.type });
26734
+ input.timing.emit("done", input.context, { actionType: record.action.type });
26735
+ }
26736
+ async function uploadSpaceActionReplyFiles(input) {
26737
+ const prepared = await prepareRequestedSpaceSendFiles({ filePaths: input.filePaths });
26738
+ if (prepared.length === 0) return [];
26739
+ return await uploadPreparedSpaceFiles({
26740
+ files: prepared,
26741
+ requestContext: buildOpenMeldRequestContextFromProfile({ openMeldProfile: await requireOpenMeldProfile({
26742
+ openMeldProfileId: input.context.targetProfileId,
26743
+ persistSelection: false,
26744
+ authAction: "sharing files in a Space reply"
26745
+ }) }),
26746
+ spaceApi: createCliSpaceApi(await resolveBaseUrl()),
26747
+ spaceId: input.context.spaceId
26653
26748
  });
26654
- timing.emit("record_written", context, { actionType: record.action.type });
26655
- timing.emit("done", context, { actionType: record.action.type });
26656
26749
  }
26657
26750
  function runSpaceActionWake(input) {
26658
26751
  const context = readDispatchSpaceActionContextFromEnv();
@@ -27182,7 +27275,7 @@ function formatSpaceAddMeBindingReadFailure(input) {
27182
27275
  if (!isAgentProfileBindingReadTimeout(error)) return error;
27183
27276
  const statusCommand = formatOpenMeldCliCommand("openmeld service status");
27184
27277
  const retryCommand = formatOpenMeldCliCommand(`openmeld space add-me ${quoteShellArg(input.spaceId)} --project-folder ${quoteShellArg(input.projectFolder.path)}`);
27185
- return /* @__PURE__ */ new Error(`OpenMeld could not read Agent Profile Bindings while preparing add-me. No Space membership was written before this step completed.\n\nTry:\n ${statusCommand}\n ${retryCommand}\n\nDetails: ${error.message}`);
27278
+ return /* @__PURE__ */ new Error(`OpenMeld couldn't add you because it couldn't read Agent Profile Bindings, and no Space membership was changed. Run ${statusCommand}, then retry ${retryCommand}. Details: ${error.message}`);
27186
27279
  }
27187
27280
  function isAgentProfileBindingReadTimeout(error) {
27188
27281
  const code = error.code;
@@ -27306,7 +27399,7 @@ function normalizeOptionalString(value) {
27306
27399
  return normalized.length > 0 ? normalized : null;
27307
27400
  }
27308
27401
  async function runDefaultSpaceAddMeMembership(input) {
27309
- const { runSpaceAddMeMembership } = await import("./add-me-membership-Chf7oIxu.js");
27402
+ const { runSpaceAddMeMembership } = await import("./add-me-membership-DC8Kvpem.js");
27310
27403
  return await runSpaceAddMeMembership(input);
27311
27404
  }
27312
27405
  //#endregion
@@ -27873,6 +27966,623 @@ function pruneUnchangedSpaceContractPatch(input) {
27873
27966
  return Object.keys(nextPatch).length > 0 ? nextPatch : null;
27874
27967
  }
27875
27968
  //#endregion
27969
+ //#region src/space/files-command.ts
27970
+ async function runSpaceFilesList(input) {
27971
+ const context = await prepareSpaceFilesContext(input, "listing Space files");
27972
+ if (!context) return;
27973
+ const read = await runSpaceReadWithPasswordRetry({
27974
+ initialPassword: input.password,
27975
+ interactive: isInteractiveHumanOutput(context, input.json),
27976
+ presenter: context.presenter,
27977
+ execute: async (spacePassword) => await context.spaceApi.listFiles({
27978
+ spaceId: input.space,
27979
+ requestContext: context.requestContext,
27980
+ query: {
27981
+ ...input.trash ? {} : { parentId: normalizeFolderId(input.folder) },
27982
+ view: input.trash ? "trash" : "active"
27983
+ },
27984
+ ...spacePassword === void 0 ? {} : { spacePassword }
27985
+ })
27986
+ });
27987
+ if (read.status === "cancelled") return;
27988
+ emitListOutput({
27989
+ presenter: context.presenter,
27990
+ result: read.result,
27991
+ json: input.json
27992
+ });
27993
+ }
27994
+ async function runSpaceFilesRead(input) {
27995
+ const context = await prepareSpaceFilesContext(input, "reading a Space file");
27996
+ if (!context) return;
27997
+ const read = await runSpaceReadWithPasswordRetry({
27998
+ initialPassword: input.password,
27999
+ interactive: isInteractiveHumanOutput(context, input.json),
28000
+ presenter: context.presenter,
28001
+ execute: async (spacePassword) => {
28002
+ const [metadata, content] = await Promise.all([context.spaceApi.getFile({
28003
+ spaceId: input.space,
28004
+ requestContext: context.requestContext,
28005
+ fileId: input.fileId,
28006
+ ...spacePassword === void 0 ? {} : { spacePassword }
28007
+ }), context.spaceApi.downloadFileContent({
28008
+ spaceId: input.space,
28009
+ requestContext: context.requestContext,
28010
+ fileId: input.fileId,
28011
+ ...input.revision === void 0 ? {} : { revision: input.revision },
28012
+ ...spacePassword === void 0 ? {} : { spacePassword }
28013
+ })]);
28014
+ if (!isSpaceFileTextEditable({
28015
+ mimeType: content.mimeType,
28016
+ sizeBytes: content.bytes.byteLength
28017
+ })) throw new Error("This file is binary or too large to print. Use `openmeld space files download` instead.");
28018
+ return {
28019
+ file: metadata.file,
28020
+ revision: content.revision,
28021
+ content: new TextDecoder("utf-8", { fatal: true }).decode(content.bytes)
28022
+ };
28023
+ }
28024
+ });
28025
+ if (read.status === "cancelled") return;
28026
+ if (input.json) {
28027
+ outJsonLine(read.result);
28028
+ return;
28029
+ }
28030
+ if (context.runtime.resolvedView === "agent") {
28031
+ context.presenter.data({
28032
+ code: "space.files.read",
28033
+ payload: read.result
28034
+ });
28035
+ return;
28036
+ }
28037
+ context.presenter.line({
28038
+ code: "space.files.read",
28039
+ text: read.result.content
28040
+ });
28041
+ }
28042
+ async function runSpaceFilesHistory(input) {
28043
+ const context = await prepareSpaceFilesContext(input, "reading Space file history");
28044
+ if (!context) return;
28045
+ const read = await runSpaceReadWithPasswordRetry({
28046
+ initialPassword: input.password,
28047
+ interactive: isInteractiveHumanOutput(context, input.json),
28048
+ presenter: context.presenter,
28049
+ execute: async (spacePassword) => await context.spaceApi.listFileRevisions({
28050
+ spaceId: input.space,
28051
+ requestContext: context.requestContext,
28052
+ fileId: input.fileId,
28053
+ ...spacePassword === void 0 ? {} : { spacePassword }
28054
+ })
28055
+ });
28056
+ if (read.status === "cancelled") return;
28057
+ if (input.json) {
28058
+ outJsonLine(read.result);
28059
+ return;
28060
+ }
28061
+ if (context.presenter.view === "agent") {
28062
+ context.presenter.data({
28063
+ code: "space.files.history",
28064
+ payload: read.result
28065
+ });
28066
+ return;
28067
+ }
28068
+ context.presenter.line({
28069
+ code: "space.files.history",
28070
+ text: `Version history for ${read.result.file.path}:`
28071
+ });
28072
+ for (const revision of read.result.revisions) context.presenter.line({
28073
+ code: "space.files.history.version",
28074
+ text: `Version ${revision.revision} ${revision.createdAt} ${revision.createdBy.displayName} ${revision.sizeBytes} bytes`,
28075
+ data: { revision }
28076
+ });
28077
+ }
28078
+ async function runSpaceFilesUpload(input) {
28079
+ const context = await prepareSpaceFilesContext(input, "uploading a Space file");
28080
+ if (!context) return;
28081
+ const bytes = await readLocalFile(input.file);
28082
+ const write = await runSpaceWriteWithPasswordRetry({
28083
+ initialPassword: input.password,
28084
+ interactive: isInteractiveHumanOutput(context, input.json),
28085
+ presenter: context.presenter,
28086
+ execute: async (spacePassword) => await context.spaceApi.uploadFile({
28087
+ spaceId: input.space,
28088
+ requestContext: context.requestContext,
28089
+ name: input.name?.trim() || basename(input.file),
28090
+ parentId: normalizeFolderId(input.folder),
28091
+ mimeType: resolveMimeType(input.mimeType, input.file),
28092
+ bytes,
28093
+ clientMutationId: randomUUID(),
28094
+ ...spacePassword === void 0 ? {} : { spacePassword }
28095
+ })
28096
+ });
28097
+ if (write.status === "cancelled") return;
28098
+ emitMutationOutput({
28099
+ presenter: context.presenter,
28100
+ code: "space.files.uploaded",
28101
+ text: `Uploaded ${write.result.path} (revision ${write.result.latestRevision.revision}).`,
28102
+ payload: { file: write.result },
28103
+ json: input.json
28104
+ });
28105
+ }
28106
+ async function runSpaceFilesWrite(input) {
28107
+ const context = await prepareSpaceFilesContext(input, "updating a Space file");
28108
+ if (!context) return;
28109
+ const bytes = await resolveContentBytes({
28110
+ file: input.file,
28111
+ stdin: input.stdin
28112
+ });
28113
+ const write = await runSpaceWriteWithPasswordRetry({
28114
+ initialPassword: input.password,
28115
+ interactive: isInteractiveHumanOutput(context, input.json),
28116
+ presenter: context.presenter,
28117
+ execute: async (spacePassword) => await context.spaceApi.updateFileContent({
28118
+ spaceId: input.space,
28119
+ requestContext: context.requestContext,
28120
+ fileId: input.fileId,
28121
+ baseRevision: input.baseRevision,
28122
+ mimeType: resolveMimeType(input.mimeType, input.file),
28123
+ bytes,
28124
+ clientMutationId: randomUUID(),
28125
+ ...spacePassword === void 0 ? {} : { spacePassword }
28126
+ })
28127
+ });
28128
+ if (write.status === "cancelled") return;
28129
+ emitMutationOutput({
28130
+ presenter: context.presenter,
28131
+ code: "space.files.updated",
28132
+ text: `Saved ${write.result.path} as revision ${write.result.latestRevision.revision}.`,
28133
+ payload: { file: write.result },
28134
+ json: input.json
28135
+ });
28136
+ }
28137
+ async function runSpaceFilesDownload(input) {
28138
+ const context = await prepareSpaceFilesContext(input, "downloading a Space file");
28139
+ if (!context) return;
28140
+ const read = await runSpaceReadWithPasswordRetry({
28141
+ initialPassword: input.password,
28142
+ interactive: isInteractiveHumanOutput(context, input.json),
28143
+ presenter: context.presenter,
28144
+ execute: async (spacePassword) => await context.spaceApi.downloadFileContent({
28145
+ spaceId: input.space,
28146
+ requestContext: context.requestContext,
28147
+ fileId: input.fileId,
28148
+ ...input.revision === void 0 ? {} : { revision: input.revision },
28149
+ ...spacePassword === void 0 ? {} : { spacePassword }
28150
+ })
28151
+ });
28152
+ if (read.status === "cancelled") return;
28153
+ await writeFile(input.output, new Uint8Array(read.result.bytes), { flag: input.force ? "w" : "wx" });
28154
+ emitMutationOutput({
28155
+ presenter: context.presenter,
28156
+ code: "space.files.downloaded",
28157
+ text: `Downloaded revision ${read.result.revision} to ${input.output}.`,
28158
+ payload: {
28159
+ output: input.output,
28160
+ revision: read.result.revision,
28161
+ mimeType: read.result.mimeType,
28162
+ sizeBytes: read.result.bytes.byteLength
28163
+ },
28164
+ json: input.json
28165
+ });
28166
+ }
28167
+ async function runSpaceFilesMkdir(input) {
28168
+ const context = await prepareSpaceFilesContext(input, "creating a Space folder");
28169
+ if (!context) return;
28170
+ const write = await runSpaceWriteWithPasswordRetry({
28171
+ initialPassword: input.password,
28172
+ interactive: isInteractiveHumanOutput(context, input.json),
28173
+ presenter: context.presenter,
28174
+ execute: async (spacePassword) => await context.spaceApi.createFolder({
28175
+ spaceId: input.space,
28176
+ requestContext: context.requestContext,
28177
+ body: {
28178
+ name: input.name,
28179
+ parentId: normalizeFolderId(input.folder),
28180
+ clientMutationId: randomUUID()
28181
+ },
28182
+ ...spacePassword === void 0 ? {} : { spacePassword }
28183
+ })
28184
+ });
28185
+ if (write.status === "cancelled") return;
28186
+ emitMutationOutput({
28187
+ presenter: context.presenter,
28188
+ code: "space.files.folder_created",
28189
+ text: `Created folder ${write.result.folder.path}.`,
28190
+ payload: write.result,
28191
+ json: input.json
28192
+ });
28193
+ }
28194
+ async function runSpaceFilesRename(input) {
28195
+ await runSpaceFilesEntryUpdate({
28196
+ ...input,
28197
+ name: input.name
28198
+ });
28199
+ }
28200
+ async function runSpaceFilesMove(input) {
28201
+ await runSpaceFilesEntryUpdate({
28202
+ ...input,
28203
+ parentId: normalizeFolderId(input.folder)
28204
+ });
28205
+ }
28206
+ async function runSpaceFilesTrash(input) {
28207
+ const context = await prepareSpaceFilesContext(input, "moving a Space file to trash");
28208
+ if (!context) return;
28209
+ const write = await runSpaceWriteWithPasswordRetry({
28210
+ initialPassword: input.password,
28211
+ interactive: isInteractiveHumanOutput(context, input.json),
28212
+ presenter: context.presenter,
28213
+ execute: async (spacePassword) => await context.spaceApi.trashFileEntry({
28214
+ spaceId: input.space,
28215
+ requestContext: context.requestContext,
28216
+ entryId: input.entryId,
28217
+ clientMutationId: randomUUID(),
28218
+ ...spacePassword === void 0 ? {} : { spacePassword }
28219
+ })
28220
+ });
28221
+ if (write.status === "cancelled") return;
28222
+ emitMutationOutput({
28223
+ presenter: context.presenter,
28224
+ code: "space.files.trashed",
28225
+ text: "Moved the item to trash.",
28226
+ payload: write.result,
28227
+ json: input.json
28228
+ });
28229
+ }
28230
+ async function runSpaceFilesRestore(input) {
28231
+ const context = await prepareSpaceFilesContext(input, "restoring a Space file from Trash");
28232
+ if (!context) return;
28233
+ const write = await runSpaceWriteWithPasswordRetry({
28234
+ initialPassword: input.password,
28235
+ interactive: isInteractiveHumanOutput(context, input.json),
28236
+ presenter: context.presenter,
28237
+ execute: async (spacePassword) => await context.spaceApi.restoreFileEntry({
28238
+ spaceId: input.space,
28239
+ requestContext: context.requestContext,
28240
+ entryId: input.entryId,
28241
+ clientMutationId: randomUUID(),
28242
+ ...spacePassword === void 0 ? {} : { spacePassword }
28243
+ })
28244
+ });
28245
+ if (write.status === "cancelled") return;
28246
+ emitMutationOutput({
28247
+ presenter: context.presenter,
28248
+ code: "space.files.restored",
28249
+ text: `Restored ${write.result.path}.`,
28250
+ payload: { entry: write.result },
28251
+ json: input.json
28252
+ });
28253
+ }
28254
+ async function runSpaceFilesRestoreVersion(input) {
28255
+ const context = await prepareSpaceFilesContext(input, "restoring a Space file version");
28256
+ if (!context) return;
28257
+ const write = await runSpaceWriteWithPasswordRetry({
28258
+ initialPassword: input.password,
28259
+ interactive: isInteractiveHumanOutput(context, input.json),
28260
+ presenter: context.presenter,
28261
+ execute: async (spacePassword) => await context.spaceApi.restoreFileRevision({
28262
+ spaceId: input.space,
28263
+ requestContext: context.requestContext,
28264
+ fileId: input.fileId,
28265
+ revision: input.revision,
28266
+ baseRevision: input.baseRevision,
28267
+ clientMutationId: randomUUID(),
28268
+ ...spacePassword === void 0 ? {} : { spacePassword }
28269
+ })
28270
+ });
28271
+ if (write.status === "cancelled") return;
28272
+ emitMutationOutput({
28273
+ presenter: context.presenter,
28274
+ code: "space.files.version_restored",
28275
+ text: `Restored version ${input.revision} as version ${write.result.latestRevision.revision}.`,
28276
+ payload: {
28277
+ file: write.result,
28278
+ restoredRevision: input.revision
28279
+ },
28280
+ json: input.json
28281
+ });
28282
+ }
28283
+ async function runSpaceFilesEntryUpdate(input) {
28284
+ const context = await prepareSpaceFilesContext(input, "organizing Space files");
28285
+ if (!context) return;
28286
+ const write = await runSpaceWriteWithPasswordRetry({
28287
+ initialPassword: input.password,
28288
+ interactive: isInteractiveHumanOutput(context, input.json),
28289
+ presenter: context.presenter,
28290
+ execute: async (spacePassword) => await context.spaceApi.updateFileEntry({
28291
+ spaceId: input.space,
28292
+ requestContext: context.requestContext,
28293
+ entryId: input.entryId,
28294
+ body: {
28295
+ ...input.name === void 0 ? {} : { name: input.name },
28296
+ ...input.parentId === void 0 ? {} : { parentId: input.parentId },
28297
+ clientMutationId: randomUUID()
28298
+ },
28299
+ ...spacePassword === void 0 ? {} : { spacePassword }
28300
+ })
28301
+ });
28302
+ if (write.status === "cancelled") return;
28303
+ emitMutationOutput({
28304
+ presenter: context.presenter,
28305
+ code: "space.files.organized",
28306
+ text: `Updated ${write.result.path}.`,
28307
+ payload: { entry: write.result },
28308
+ json: input.json
28309
+ });
28310
+ }
28311
+ async function prepareSpaceFilesContext(input, action) {
28312
+ const context = await prepareAuthenticatedSpaceCommandContext({
28313
+ profile: input.profile,
28314
+ baseUrl: input.baseUrl,
28315
+ view: input.view,
28316
+ promptMessage: buildCommandAuthenticationPromptMessage(action),
28317
+ entryChecksHandled: input.entryChecksHandled
28318
+ });
28319
+ if (context.status === "cancelled") return null;
28320
+ assertValidSpaceIdTarget({
28321
+ space: input.space,
28322
+ resolvedView: context.runtime.resolvedView
28323
+ });
28324
+ const openMeldProfile = await resolveOpenMeldProfileForSpaceCommand({
28325
+ openMeldProfileId: input.profile,
28326
+ resolvedView: context.runtime.resolvedView,
28327
+ interactive: context.interactive
28328
+ });
28329
+ return {
28330
+ ...context,
28331
+ requestContext: buildOpenMeldRequestContextFromProfile({ openMeldProfile }),
28332
+ spaceApi: createCliSpaceApi(context.baseUrl)
28333
+ };
28334
+ }
28335
+ function emitListOutput(input) {
28336
+ if (input.json) {
28337
+ outJsonLine(input.result);
28338
+ return;
28339
+ }
28340
+ if (input.presenter.view === "agent") {
28341
+ input.presenter.data({
28342
+ code: "space.files.list",
28343
+ payload: input.result
28344
+ });
28345
+ return;
28346
+ }
28347
+ const location = input.result.breadcrumbs.map((item) => item.name).join(" / ");
28348
+ input.presenter.line({
28349
+ code: "space.files.location",
28350
+ text: `Files in ${location} (${input.result.capabilities.canWrite ? "can edit" : "view only"}):`
28351
+ });
28352
+ if (input.result.entries.length === 0) {
28353
+ input.presenter.line({
28354
+ code: "space.files.empty",
28355
+ text: input.result.view === "trash" ? "Trash is empty." : "This folder is empty."
28356
+ });
28357
+ return;
28358
+ }
28359
+ for (const entry of input.result.entries) input.presenter.line({
28360
+ code: "space.files.entry",
28361
+ text: formatEntry(entry),
28362
+ data: { entry }
28363
+ });
28364
+ }
28365
+ function emitMutationOutput(input) {
28366
+ if (input.json) {
28367
+ outJsonLine(input.payload);
28368
+ return;
28369
+ }
28370
+ if (input.presenter.view === "agent") {
28371
+ input.presenter.data({
28372
+ code: input.code,
28373
+ payload: input.payload
28374
+ });
28375
+ return;
28376
+ }
28377
+ input.presenter.line({
28378
+ code: input.code,
28379
+ text: input.text
28380
+ });
28381
+ }
28382
+ function formatEntry(entry) {
28383
+ if (entry.kind === "folder") return `[folder] ${entry.name} id=${entry.id}`;
28384
+ return `[file] ${entry.name} revision=${entry.latestRevision.revision} size=${entry.latestRevision.sizeBytes} id=${entry.id}`;
28385
+ }
28386
+ function normalizeFolderId(value) {
28387
+ const normalized = value?.trim();
28388
+ return !normalized || normalized === "root" ? null : normalized;
28389
+ }
28390
+ async function readLocalFile(path) {
28391
+ const bytes = await readFile(path);
28392
+ if (bytes.byteLength > 10485760) throw new Error("Space files must be 10 MiB or smaller.");
28393
+ return bytes;
28394
+ }
28395
+ async function resolveContentBytes(input) {
28396
+ const file = input.file?.trim();
28397
+ if (Boolean(file) === input.stdin) throw new Error("Choose exactly one content source: --file <path> or --stdin.");
28398
+ if (file) return await readLocalFile(file);
28399
+ const chunks = [];
28400
+ let total = 0;
28401
+ for await (const chunk of process.stdin) {
28402
+ const bytes = typeof chunk === "string" ? Buffer.from(chunk) : chunk;
28403
+ total += bytes.byteLength;
28404
+ if (total > 10485760) throw new Error("Space files must be 10 MiB or smaller.");
28405
+ chunks.push(bytes);
28406
+ }
28407
+ return Buffer.concat(chunks, total);
28408
+ }
28409
+ function resolveMimeType(explicitMimeType, path) {
28410
+ return resolveSpaceFileMimeType({
28411
+ declaredMimeType: explicitMimeType,
28412
+ fileName: path ?? ""
28413
+ });
28414
+ }
28415
+ function isInteractiveHumanOutput(context, json) {
28416
+ return context.interactive && context.runtime.resolvedView === "human" && !json;
28417
+ }
28418
+ //#endregion
28419
+ //#region src/space/files-registration.ts
28420
+ function registerSpaceFilesCommands(spaceCommand) {
28421
+ const filesCommand = spaceCommand.command("files").description("Share and collaborate on files in a Space.");
28422
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("list").description("List files and folders in a Space.").argument("<space>", "Space ID (64-character hex)").option("--folder <folder-id>", "Folder ID, or root", "root").option("--trash", "List items in Trash", false))).action(async (space, opts, command) => {
28423
+ await runFilesCommand(command, opts, "list", async (common) => {
28424
+ await runSpaceFilesList({
28425
+ ...common,
28426
+ space: String(space).trim(),
28427
+ folder: opts.folder,
28428
+ trash: opts.trash === true
28429
+ });
28430
+ });
28431
+ });
28432
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("read").description("Print a text Space file.").argument("<space>", "Space ID (64-character hex)").argument("<file-id>", "File ID").option("--revision <number>", "Read a specific revision"))).action(async (space, fileId, opts, command) => {
28433
+ await runFilesCommand(command, opts, "read", async (common) => {
28434
+ await runSpaceFilesRead({
28435
+ ...common,
28436
+ space: String(space).trim(),
28437
+ fileId: String(fileId).trim(),
28438
+ revision: parseRevision(opts.revision, "--revision")
28439
+ });
28440
+ });
28441
+ });
28442
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("history").description("List the saved versions of a Space file.").argument("<space>", "Space ID (64-character hex)").argument("<file-id>", "File ID"))).action(async (space, fileId, opts, command) => {
28443
+ await runFilesCommand(command, opts, "history", async (common) => {
28444
+ await runSpaceFilesHistory({
28445
+ ...common,
28446
+ space: String(space).trim(),
28447
+ fileId: String(fileId).trim()
28448
+ });
28449
+ });
28450
+ });
28451
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("upload").description("Upload a local file into a Space.").argument("<space>", "Space ID (64-character hex)").argument("<file>", "Local file path").option("--name <name>", "File name shown in the Space").option("--folder <folder-id>", "Destination folder ID, or root", "root").option("--type <mime-type>", "File media type"))).action(async (space, file, opts, command) => {
28452
+ await runFilesCommand(command, opts, "upload", async (common) => {
28453
+ await runSpaceFilesUpload({
28454
+ ...common,
28455
+ space: String(space).trim(),
28456
+ file: String(file),
28457
+ name: opts.name,
28458
+ folder: opts.folder,
28459
+ mimeType: opts.type
28460
+ });
28461
+ });
28462
+ });
28463
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("write").description("Save a new revision of an existing Space file.").argument("<space>", "Space ID (64-character hex)").argument("<file-id>", "File ID").requiredOption("--base-revision <number>", "Revision you read before making this change").option("--file <path>", "Read replacement content from a local file").option("--stdin", "Read replacement content from stdin (EOF to finish)", false).option("--type <mime-type>", "File media type"))).action(async (space, fileId, opts, command) => {
28464
+ await runFilesCommand(command, opts, "write", async (common) => {
28465
+ await runSpaceFilesWrite({
28466
+ ...common,
28467
+ space: String(space).trim(),
28468
+ fileId: String(fileId).trim(),
28469
+ baseRevision: parseRequiredRevision(opts.baseRevision, "--base-revision"),
28470
+ file: opts.file,
28471
+ stdin: opts.stdin === true,
28472
+ mimeType: opts.type ?? (opts.stdin === true ? "text/plain" : void 0)
28473
+ });
28474
+ });
28475
+ });
28476
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("download").description("Download a Space file to this computer.").argument("<space>", "Space ID (64-character hex)").argument("<file-id>", "File ID").requiredOption("--output <path>", "Destination path").option("--revision <number>", "Download a specific revision").option("--force", "Replace an existing destination file", false))).action(async (space, fileId, opts, command) => {
28477
+ await runFilesCommand(command, opts, "download", async (common) => {
28478
+ await runSpaceFilesDownload({
28479
+ ...common,
28480
+ space: String(space).trim(),
28481
+ fileId: String(fileId).trim(),
28482
+ output: String(opts.output),
28483
+ revision: parseRevision(opts.revision, "--revision"),
28484
+ force: opts.force === true
28485
+ });
28486
+ });
28487
+ });
28488
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("mkdir").description("Create a folder in a Space.").argument("<space>", "Space ID (64-character hex)").argument("<name>", "Folder name").option("--folder <folder-id>", "Parent folder ID, or root", "root"))).action(async (space, name, opts, command) => {
28489
+ await runFilesCommand(command, opts, "mkdir", async (common) => {
28490
+ await runSpaceFilesMkdir({
28491
+ ...common,
28492
+ space: String(space).trim(),
28493
+ name: String(name),
28494
+ folder: opts.folder
28495
+ });
28496
+ });
28497
+ });
28498
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("rename").description("Rename a Space file or folder.").argument("<space>", "Space ID (64-character hex)").argument("<entry-id>", "File or folder ID").argument("<name>", "New name"))).action(async (space, entryId, name, opts, command) => {
28499
+ await runFilesCommand(command, opts, "rename", async (common) => {
28500
+ await runSpaceFilesRename({
28501
+ ...common,
28502
+ space: String(space).trim(),
28503
+ entryId: String(entryId).trim(),
28504
+ name: String(name)
28505
+ });
28506
+ });
28507
+ });
28508
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("move").description("Move a Space file or folder.").argument("<space>", "Space ID (64-character hex)").argument("<entry-id>", "File or folder ID").option("--folder <folder-id>", "Destination folder ID, or root", "root"))).action(async (space, entryId, opts, command) => {
28509
+ await runFilesCommand(command, opts, "move", async (common) => {
28510
+ await runSpaceFilesMove({
28511
+ ...common,
28512
+ space: String(space).trim(),
28513
+ entryId: String(entryId).trim(),
28514
+ folder: opts.folder
28515
+ });
28516
+ });
28517
+ });
28518
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("trash").description("Move a Space file or folder to trash.").argument("<space>", "Space ID (64-character hex)").argument("<entry-id>", "File or folder ID"))).action(async (space, entryId, opts, command) => {
28519
+ await runFilesCommand(command, opts, "trash", async (common) => {
28520
+ await runSpaceFilesTrash({
28521
+ ...common,
28522
+ space: String(space).trim(),
28523
+ entryId: String(entryId).trim()
28524
+ });
28525
+ });
28526
+ });
28527
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("restore").description("Restore a Space file or folder from Trash.").argument("<space>", "Space ID (64-character hex)").argument("<entry-id>", "File or folder ID"))).action(async (space, entryId, opts, command) => {
28528
+ await runFilesCommand(command, opts, "restore", async (common) => {
28529
+ await runSpaceFilesRestore({
28530
+ ...common,
28531
+ space: String(space).trim(),
28532
+ entryId: String(entryId).trim()
28533
+ });
28534
+ });
28535
+ });
28536
+ withSpaceProfileOption(withCommonOptions(filesCommand.command("restore-version").description("Restore an older version as the newest version.").argument("<space>", "Space ID (64-character hex)").argument("<file-id>", "File ID").argument("<revision>", "Version to restore").requiredOption("--base-revision <number>", "Current revision before restoring"))).action(async (space, fileId, revision, opts, command) => {
28537
+ await runFilesCommand(command, opts, "restore-version", async (common) => {
28538
+ await runSpaceFilesRestoreVersion({
28539
+ ...common,
28540
+ space: String(space).trim(),
28541
+ fileId: String(fileId).trim(),
28542
+ revision: parseRequiredRevision(String(revision), "<revision>"),
28543
+ baseRevision: parseRequiredRevision(opts.baseRevision, "--base-revision")
28544
+ });
28545
+ });
28546
+ });
28547
+ }
28548
+ function withCommonOptions(command) {
28549
+ return command.option("--password <value>", "Space password for protected access").option("--json", "Print canonical JSON", false);
28550
+ }
28551
+ async function runFilesCommand(command, opts, action, run) {
28552
+ const cliOptions = resolveSpaceCommandCliOptions(command, opts);
28553
+ const view = getGlobalViewOption();
28554
+ await runCommandWithEntryChecks({
28555
+ routeTokens: [
28556
+ "space",
28557
+ "files",
28558
+ action
28559
+ ],
28560
+ view,
28561
+ profile: cliOptions.profile,
28562
+ gatewayUrl: cliOptions.gatewayUrl,
28563
+ run: async () => {
28564
+ await run({
28565
+ profile: cliOptions.profile,
28566
+ baseUrl: cliOptions.gatewayUrl,
28567
+ password: cliOptions.password,
28568
+ json: cliOptions.json === true,
28569
+ view,
28570
+ entryChecksHandled: true
28571
+ });
28572
+ }
28573
+ });
28574
+ }
28575
+ function parseRevision(raw, optionName) {
28576
+ const revision = parseNonNegativeIntegerOption(raw, optionName);
28577
+ if (revision === 0) throw new Error(`${optionName} must be at least 1`);
28578
+ return revision;
28579
+ }
28580
+ function parseRequiredRevision(raw, optionName) {
28581
+ const revision = parseRevision(raw, optionName);
28582
+ if (revision === void 0) throw new Error(`${optionName} is required`);
28583
+ return revision;
28584
+ }
28585
+ //#endregion
27876
28586
  //#region src/space/guide-output.ts
27877
28587
  function emitSpaceGuideHumanOutput(input) {
27878
28588
  const guideText = normalizeGuideText(input.meta.guide);
@@ -28740,30 +29450,12 @@ function emitOrganizationSpaceError(input) {
28740
29450
  });
28741
29451
  return;
28742
29452
  }
28743
- renderInfoCard({
29453
+ renderHumanErrorCard({
29454
+ message: failure.message,
29455
+ nextStep: "Try again in a moment.",
28744
29456
  presenter: input.presenter,
28745
- title: "Organization Space Error",
28746
- codePrefix: `${input.operation}.error.card`,
28747
- rows: [
28748
- {
28749
- label: "Reason",
28750
- value: failure.message
28751
- },
28752
- ...failure.requestId ? [{
28753
- label: "Request ID",
28754
- value: failure.requestId
28755
- }] : [],
28756
- ...failure.schemaIssuePath ? [{
28757
- label: "Schema Path",
28758
- value: failure.schemaIssuePath
28759
- }] : [],
28760
- ...failure.schemaIssueMessage ? [{
28761
- label: "Schema Issue",
28762
- value: failure.schemaIssueMessage
28763
- }] : []
28764
- ],
28765
- sanitize: true,
28766
- minContentWidth: 72
29457
+ title: "Organization Spaces couldn't be loaded",
29458
+ codePrefix: `${input.operation}.error.card`
28767
29459
  });
28768
29460
  }
28769
29461
  function readLocalSpaceCommandErrorCode(error) {
@@ -30231,30 +30923,12 @@ function emitWakeControlError(input) {
30231
30923
  });
30232
30924
  return;
30233
30925
  }
30234
- renderInfoCard({
30926
+ renderHumanErrorCard({
30927
+ message: failure.message,
30928
+ nextStep: "Try again in a moment.",
30235
30929
  presenter: input.presenter,
30236
- title: input.operation === "space.wake_stop" ? "Wake Stop Failed" : "Wake Progress Failed",
30237
- codePrefix: `${input.operation}.error.card`,
30238
- rows: [
30239
- {
30240
- label: "Reason",
30241
- value: failure.message
30242
- },
30243
- ...failure.requestId ? [{
30244
- label: "Request ID",
30245
- value: failure.requestId
30246
- }] : [],
30247
- ...failure.schemaIssuePath ? [{
30248
- label: "Schema Path",
30249
- value: failure.schemaIssuePath
30250
- }] : [],
30251
- ...failure.schemaIssueMessage ? [{
30252
- label: "Schema Issue",
30253
- value: failure.schemaIssueMessage
30254
- }] : []
30255
- ],
30256
- sanitize: true,
30257
- minContentWidth: 72
30930
+ title: input.operation === "space.wake_stop" ? "Wake couldn't be stopped" : "Wake progress couldn't be loaded",
30931
+ codePrefix: `${input.operation}.error.card`
30258
30932
  });
30259
30933
  }
30260
30934
  function readLocalWakeControlErrorCode(error) {
@@ -31756,11 +32430,13 @@ spaceCmd.option("--gateway-url <url>", "OpenMeld gateway URL (command line, OPEN
31756
32430
  }
31757
32431
  });
31758
32432
  });
32433
+ registerSpaceFilesCommands(spaceCmd);
31759
32434
  const spaceActionCmd = spaceCmd.command("action").description("Record a dispatch-scoped OpenMeld Space Action.").action(async () => {
31760
32435
  await runSpaceActionHelp();
31761
32436
  });
31762
- spaceActionCmd.command("reply").description("Record a final Space reply for the current dispatch.").argument("<message...>", "Reply message").option("--wake <target>", "Wake another Agent Profile with this reply", collectRepeatedOptionValue, []).option("--reference <target>", "Reference a Human or Agent Profile", collectRepeatedOptionValue, []).action(async (messageParts, opts) => {
32437
+ spaceActionCmd.command("reply").description("Record a final Space reply for the current dispatch.").argument("<message...>", "Reply message").option("--wake <target>", "Wake another Agent Profile with this reply", collectRepeatedOptionValue, []).option("--reference <target>", "Reference a Human or Agent Profile", collectRepeatedOptionValue, []).option("--file <path>", "Share a local file in this Space reply", collectRepeatedOptionValue, []).action(async (messageParts, opts) => {
31763
32438
  await runSpaceActionReply({
32439
+ filePaths: Array.isArray(opts.file) ? opts.file : [],
31764
32440
  messageParts: Array.isArray(messageParts) ? messageParts : [],
31765
32441
  wakeTargets: Array.isArray(opts.wake) ? opts.wake : [],
31766
32442
  referenceTargets: Array.isArray(opts.reference) ? opts.reference : []
@@ -32169,7 +32845,7 @@ withSpaceProfileOption(spaceCmd.command("watch").description("Watch a space in r
32169
32845
  }
32170
32846
  });
32171
32847
  });
32172
- withSpaceProfileOption(spaceCmd.command("send").description("Send one message to a Space.").argument("[space]", "Space ID (64-character hex)").argument("[text...]", "Text to send").option("--attach <path>", "Upload a JPEG or PNG attachment before sending (repeatable, max 4)", collectRepeatedOptionValue, []).option("--stdin", "Read message text from stdin (EOF to finish)", false).option("--file <path>", "Read message text from a UTF-8 file").option("--plain", "Send text literally without resolving @Name(wake) or @Name(reference) mentions", false).option("--reply-to <signal-id>", "Reply into the thread of a message (creates the thread if it does not exist yet)").option("--password <value>", "Space password for protected access")).action(async (space, textParts, opts, command) => {
32848
+ withSpaceProfileOption(spaceCmd.command("send").description("Send one message to a Space.").argument("[space]", "Space ID (64-character hex)").argument("[text...]", "Text to send").option("--file <path>", "Share a local file in this Space message (repeatable, max 10)", collectRepeatedOptionValue, []).option("--stdin", "Read message text from stdin (EOF to finish)", false).option("--text-file <path>", "Read message text from a UTF-8 file").option("--plain", "Send text literally without resolving @Name(wake) or @Name(reference) mentions", false).option("--reply-to <signal-id>", "Reply into the thread of a message (creates the thread if it does not exist yet)").option("--password <value>", "Space password for protected access")).action(async (space, textParts, opts, command) => {
32173
32849
  const cliOptions = resolveSpaceCommandCliOptions(command, opts);
32174
32850
  const spaceValue = String(space ?? "").trim();
32175
32851
  const outputView = await resolveEffectiveViewForOutput();
@@ -32189,11 +32865,11 @@ withSpaceProfileOption(spaceCmd.command("send").description("Send one message to
32189
32865
  profile: cliOptions.profile,
32190
32866
  baseUrl: cliOptions.gatewayUrl,
32191
32867
  space: spaceValue,
32192
- attachmentPaths: Array.isArray(opts.attach) ? opts.attach.map(String) : [],
32868
+ filePaths: Array.isArray(opts.file) ? opts.file.map(String) : [],
32193
32869
  password: cliOptions.password,
32194
32870
  text: textValue,
32195
32871
  stdin: Boolean(opts.stdin),
32196
- file: typeof opts.file === "string" ? opts.file : void 0,
32872
+ textFile: typeof opts.textFile === "string" ? opts.textFile : void 0,
32197
32873
  plainText: opts.plain === true,
32198
32874
  replyToSignalId: typeof opts.replyTo === "string" ? opts.replyTo : void 0,
32199
32875
  view,
@@ -32556,7 +33232,7 @@ withSpaceProfileOption(spaceCmd.command("password").description("Set, change, or
32556
33232
  }
32557
33233
  });
32558
33234
  });
32559
- program.command("send").description("Alias for `openmeld space send`.").argument("[text...]", "Text to send").option("--profile <id>", "OpenMeld profile ID").option("--base-url <url>", "OpenMeld gateway URL").option("--space <space>", "Space ID (64-character hex)").option("--stdin", "Read message text from stdin (EOF to finish)", false).option("--file <path>", "Read message text from a UTF-8 file").option("--plain", "Send text literally without resolving @Name(wake) or @Name(reference) mentions", false).option("--password <value>", "Space password for protected access").action(async (textParts, opts) => {
33235
+ program.command("send").description("Alias for `openmeld space send`.").argument("[text...]", "Text to send").option("--profile <id>", "OpenMeld profile ID").option("--base-url <url>", "OpenMeld gateway URL").option("--space <space>", "Space ID (64-character hex)").option("--stdin", "Read message text from stdin (EOF to finish)", false).option("--file <path>", "Share a local file in this Space message (repeatable, max 10)", collectRepeatedOptionValue, []).option("--text-file <path>", "Read message text from a UTF-8 file").option("--plain", "Send text literally without resolving @Name(wake) or @Name(reference) mentions", false).option("--password <value>", "Space password for protected access").action(async (textParts, opts) => {
32560
33236
  const space = String(opts.space ?? "").trim();
32561
33237
  if (!space) throw createSpaceAliasTargetGuideError("send");
32562
33238
  const view = getGlobalViewOption();
@@ -32573,7 +33249,8 @@ program.command("send").description("Alias for `openmeld space send`.").argument
32573
33249
  password: opts.password,
32574
33250
  text: Array.isArray(textParts) ? textParts.join(" ") : "",
32575
33251
  stdin: Boolean(opts.stdin),
32576
- file: typeof opts.file === "string" ? opts.file : void 0,
33252
+ filePaths: Array.isArray(opts.file) ? opts.file.map(String) : [],
33253
+ textFile: typeof opts.textFile === "string" ? opts.textFile : void 0,
32577
33254
  plainText: opts.plain === true,
32578
33255
  view,
32579
33256
  entryChecksHandled: true
@@ -33096,15 +33773,7 @@ async function runLocalCli(argv) {
33096
33773
  }
33097
33774
  await program.parseAsync(argv);
33098
33775
  } catch (err) {
33099
- if (isUpgradeOutputHandledError(err)) {
33100
- process.exitCode = 1;
33101
- return;
33102
- }
33103
- if (isSpaceCommandOutputHandledError(err)) {
33104
- if (err.shouldPrintMessage && err.message.trim()) errLine(err.message);
33105
- process.exitCode = 1;
33106
- return;
33107
- }
33776
+ if (handleKnownOutputError(err)) return;
33108
33777
  const effectiveView = await resolveEffectiveViewForError(argv);
33109
33778
  const message = err instanceof Error ? err.message : String(err);
33110
33779
  const code = resolveCliErrorCode({
@@ -33138,6 +33807,16 @@ async function runLocalCli(argv) {
33138
33807
  process.exitCode = 1;
33139
33808
  }
33140
33809
  }
33810
+ function handleKnownOutputError(error) {
33811
+ if (isCliOutputHandledError(error) || isUpgradeOutputHandledError(error)) {
33812
+ process.exitCode = 1;
33813
+ return true;
33814
+ }
33815
+ if (!isSpaceCommandOutputHandledError(error)) return false;
33816
+ if (error.shouldPrintMessage && error.message.trim()) errLine(error.message);
33817
+ process.exitCode = 1;
33818
+ return true;
33819
+ }
33141
33820
  async function runRootCommand() {
33142
33821
  const jsonOutput = hasJsonOutputArgv(process.argv);
33143
33822
  const runtime = await resolveRuntimeContext();