openmeld 0.3.144 → 0.3.146

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 resolveOpenMeldOrphanedLockIssue, $t as systemDir, A as toSpaceContractUrl, Bt as organizationSkillReleaseDir, Ct as accountProfileViewPath, D as normalizeBaseUrl, E as updateConfiguredStartV1OnboardingState, F as toSpaceDispatchTraceUrl, Ft as openMeldManagedBinaryPath, G as acquireLock, Gt as resolveOpenMeldCliEntryNameFromArgv, Ht as profileViewPath, It as openMeldManagedVersionBinaryPath, J as isOpenMeldOrphanedLockError, Jt as resolveOpenMeldRootDir, K as buildOpenMeldOrphanedLockAction, Kt as resolveOpenMeldEnvPreset, Nt as openMeldBackupsDir, P as toSpaceDispatchLookupUrl, Q as repairOrphanedLegacyLocks, Qt as spacesDir, Rt as openMeldRootDir, S as setConfiguredSkillsConfig, St as accountProfileSpaceCacheDir, Tt as accountsDir, V as toSpaceResultUrl, Vt as profileDir, Z as releaseLockSync, Zt as skillsDir, _t as toRecognizedLocalMachineFailureError, a as resolveBaseUrl, b as setConfiguredBaseUrl, c as resolveExplicitGatewayUrlOrThrow, dt as LocalMachineFailureError, en as formatLocalMachineIssueMessage, et as runWithHeldLock, g as getConfiguredSkillsConfig, gt as isLocalMachineFailureError, ht as createOrphanedSetupConcurrencyIssue, jt as normalizeAccountKey, k as toSpaceBoardUrl, lt as formatLaneScopeSentence, m as getConfiguredOnboardingDisclaimerAcceptedAt, nt as LEGACY_OPENMELD_AGENT_SESSION_ENV_KEY, o as resolveBaseUrlOrNull, ot as resolveCliContext, pt as createActiveSetupConcurrencyIssue, q as isOpenMeldLockError, rt as OPENMELD_CLI_CONTEXT_ENV_KEY, sn as agentControllerConversationRefSchema, u as alignRuntimeConfigStorage, ut as resolveOpenMeldLaneDescriptor, w as updateConfiguredOnboardingConfig } from "./base-url-CY_j4bLH.js";
4
- import { $ as runAgentsManage, $a as resolveAuthenticationGuidanceFromMessage, $i as getCurrentCommandCheckState, $n as assessCliUpdate, $o as outJsonLine, $r as resolveDaemonDeviceId, $t as runSkillsUpdate, A as parseEnvelope, Aa as formatMessage, Ai as createAgentExecutionStatusDisplayRows, An as computeRetryDelayMs, Ao as resolveObservedAgentActivityBinding, Ar as getCommandHintsFromContract, At as emitDaemonAgentOverview, B as resolveHumanControllerDisplayName, Ba as listOpenMeldProfiles, Bn as assertNoRemovedCcSpaceAddressingSyntax, Bo as migrateProjectBindingStore, Br as formatDualViewGuideForDisplay, Bt as readGatewayTextResponse, C as toSpaceMetaUpsertInput, Ca as toStartBackgroundHelperExecutionCompatibility, Ci as resolveAgentProfilePrimaryAgentControllerReport, Cn as resolveCreateProfileKind, Co as resolveUserFacingCliEntryCommand, Cr as createSpaceSubcommandTargetGuideError, Ct as runDaemonStatusFlow, D as formatHumanReadTargetList, Da as renderHumanErrorCard, Di as notifyDaemonRouteCatalogChanged, Dn as formatServiceParticipationReadinessLabel, Do as readAgentActivityContextForPath, Dr as createStartAuthenticationGuideError, Dt as buildProfileWorkspacePresentation, E as buildHumanReplyContextSummary, Ea as buildHumanErrorCopy, Ei as listBuiltinAgentsRegistryEntries, En as ensureAgentProfileRuntimeBinding, Eo as upsertDaemonServiceContract, Er as createStartAgentIdentityGuideError, Et as runDaemonUninstall, F as resolveOpenMeldProfileForSpaceCommand, Fa as requireOpenMeldProfile, Fi as resolveAgentControllerPermissionModeForController, Fn as resolveLocalAgentControllerBlockerReasonCodes, Fo as readAgentActivityOutboxHealth, Fr as registerDaemonControlTargetOptions, Ft as fetchSpaceUpdates, G as runAgentsCustomAdd, Ga as clearSelectedOpenMeldProfileId, Gi as resolveDaemonServiceAlignmentDecision, Gn as buildSpaceRoundReadProjection, Go as canonicalizeLocalProjectPath, Gr as areAllowedActionsEquivalent, Gt as resolveDaemonServiceParticipationStatus, H as resolveAgentProfileSetup, Ha as resolveOpenMeldProfile, Hi as buildOnboardingPlan, Hn as buildDispatchResultReplyWorkflowProjection, Ho as runIfAgentActivityBindingGenerationIsCurrent, Hr as formatAgentOverviewPayload, Ht as parseJsonResponse, I as emitSpaceAgentOverview, Ia as resolveOpenMeldProfileOrNull, Ii as resolveAgentExecutionStatus, In as resolveLocalAgentControllerLaunchability, Io as removeProjectOutbox, Ir as registerAuthLoginRequestOptions, It as createCliSpaceApi, J as runAgentsCustomUpdate, Ja as buildAgentAuthenticationGuide, Ji as resolveServiceUpdateUrgency, Jn as formatRemovedCcRelationMessage, Jo as renderInfoCard, Jr as readPendingOpenMeldToolsUpdateAttempt, Jt as collectSkillsReadinessSnapshot, K as runAgentsCustomList, Ka as getSelectedOpenMeldProfileId, Ki as classifyDaemonServiceRunStartability, Kn as buildUpdatesReplyWorkflowProjection, Ko as enqueueControllerTaskLifecycleEventWhileLocked, Kr as buildAgentFacingPublicationModeGuideLines, Kt as runDaemonServiceParticipationGate, L as emitSpaceCliAgentOverview, La as createOpenMeldAgentProfile, Li as resolveAgentProfileEditCapabilities, Ln as resolveLocalAgentControllerReportDecision, Lo as bindProject, Lr as registerBuiltinAgentSelectionOptions, Lt as fetchSpaceMeta, M as assertFullSignalIdArgument, Ma as resolveRuntimeContext, Mi as getAgentControllerPermissionModeFieldLabel, Mn as submitRuntimeAgentControllerReport, Mo as readCodexSessionTitles, Mr as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, Mt as shouldEmitAgentOverview, N as assertValidSpaceIdTarget, Na as resolveViewProfileKey, Ni as listAgentControllerPermissionModeOptions, Nn as submitRuntimeAgentControllerReports, No as enqueueAgentActivityHookEvent, Nr as registerSkillsTargetSelectionOptions, Nt as runDaemonStartupPreflight, O as resolveLinkAccessLabel, Oa as renderHumanTextErrorCard, Oi as resolveLocalRegistryAgentIdFromAgentControllerRef, On as resolveServiceParticipationReadiness, Oo as removeAgentActivityContextCache, Or as createUpgradeConfirmationGuideError, Ot as buildProfileWorkspaceRows, P as prepareAuthenticatedSpaceCommandContext, Pa as isSelectedOpenMeldProfileRequiredError, Pi as parseAgentControllerRef, Pn as collectLocalAgentControllerInventory, Po as removeProjectInbox, Pr as getCliVersionInfo, Pt as readDaemonStartFailureLogTailLines, Q as runAgentsList, Qa as resolveAuthenticationGuidanceFromError, Qi as finishCurrentCommandCheckScope, Qn as runInteractivePrompt, Qo as errLine, Qr as ensureDaemonRuntimePaths, Qt as runSkillsUninstall, R as prepareLocalAgentReadiness, Ra as createOpenMeldHumanProfile, Ri as resolveEvidenceSyncHealth, Rn as inspectSpaceCacheFile, Ro as listProjectBindings, Rr as buildAgentOverviewFromContract, Rt as updateSpaceMeta, S as loadSpaceSignalIndexOrNull, Sa as resolveDaemonRuntimeContractCompatibility, Si as createPrimaryBindingReadSession, Sn as createProfileByKind, So as resolveSetupFollowUpCliEntryCommand, Sr as createSpaceResultGuideError, St as runDaemonSnapshot, T as buildFormalSignalReadPayload, Ta as OPENMELD_VERSION, Ti as reconcileNewRunnableBuiltinAgentsForSetup, Tn as promptTextEntry, To as readDaemonServiceContract, Tr as createSpaceUpdatesGuideError, Tt as runDaemonTeardownStrict, U as runAgents, Ua as updateOpenMeldProfile, Ui as getSetupFlowCopy, Un as buildSignalIndex, Uo as setDefaultProjectConnection, Ur as OPENMELD_AGENT_MENTAL_MODEL_LINES, Ut as resolveLocalComponentsStatus, V as persistAgentTransportSelection, Va as primeOpenMeldProfilesSessionCache, Vi as buildDaemonRouteObservationPresentation$1, Vn as buildDispatchResultMessageReadProjection, Vo as removeProjectConnection, Vr as buildDualViewGuideMessage, Vt as toStructuredGatewayFailure, W as runAgentsConfig, Wa as alignSelectedOpenMeldProfileStorage, Wi as buildDaemonServiceTargetSpec, Wn as buildSignalMessageReadProjection, Wo as unbindProject, Wr as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, Wt as writeInstalledLocalComponentsSnapshot, X as runAgentsDisable, Xa as createAuthenticationError, Xi as resolveOpenMeldEnvironmentTarget, Xn as promptSearchSelect, Xo as sanitizeTerminalDisplayText, Xr as runPendingDaemonServiceUpdate, Xt as runSkillsEnsure, Y as runAgentsDetect, Ya as buildHumanAuthenticationCard, Yi as assessServerRequiredVersion, Yn as promptSearchMultiselect, Yo as renderTextInfoCard, Yr as readOpenMeldToolsUpdateContextFromEnv, Yt as runSkillsCheck$1, Z as runAgentsEnable, Za as resolveAuthenticationGuidance, Zi as resolveAuthBaseUrl, Zn as isReturnKeypress, Zo as emitCliJsonEnvelope, Zr as scheduleDaemonServiceUpdate, Zt as runSkillsInstall, _ as runSpaceWriteWithPasswordRetry, _a as ensureVersionStateReady, _i as setCustomProfileWorkspace, _n as fetchAuthUserSnapshot, _o as formatOpenMeldCliCommand, _r as createSpaceContractSetGuideError, _t as runDaemonCancel, a as runSpaceDelete, aa as readCurrentDaemonRuntimeContext, ai as formatDeviceReplyReadinessLabel, an as buildCommandAuthenticationPromptMessage, ao as requestLocalAgentActivitySync, ar as formatElapsedTime, as as cliJsonSkillsShowEnvelopeSchema, at as printOpenMeldBanner, b as buildIdentityOnlyMembersSnapshotForReadProjection, ba as readVersionState, bi as describeProfileWorkspacePathValidationFailure, bn as resolveDeviceTokenExpiresAt, bo as formatOpenMeldCliTextBlock, br as createSpacePublicationSetGuideError, bt as runDaemonReinstall, c as runSpaceLeave, ca as isDaemonServiceJobNeverSpawned, ci as resolveGatewayChainReadiness, cn as runAuthLogin, co as resolveAgentActivityRouteForPath, cr as formatDaemonServiceMissingRecommendation, cs as revokeOrganizationJoinLinkResponseSchema, ct as renderOpenMeldLogo, d as runSpaceRemoveMembers, da as readRecentDaemonLifecycleEvents, di as createModelCatalogReadSession, dn as runAuthStatus, do as defaultManagedIntegrationPaths, dr as createProfileActionGuideError, dt as resolveSpaceWebGatewayOrigin, ea as isCurrentCommandCheckScopeActive, ei as formatDaemonFailureContextText, en as ensureLocalSkills, eo as getProfileDefaultView, er as isCliUpdateCheckApplicable, es as outLine, et as runAgentsRepair, f as runSpaceSend, fa as buildInstallSelfJsonPayload, fi as resolveProfileWorkspaceRuntime, fn as exchangeOneTimeTokenAuthSession, fo as installAgentActivityIntegrations, fr as createProfileCreateGuideError, ft as resolveSpaceSendText, g as runSpaceReadWithPasswordRetry, ga as compareSemver, gi as resolveConfiguredProfileWorkspacePath, gn as extractAuthApiErrorMessage, go as formatInlineOpenMeldCliCommands, gr as createSpaceAliasTargetGuideError, gt as runDaemonBackgroundStartForDecision, h as uploadPreparedSpaceFiles, ha as buildNextVersionState, hi as readProfileWorkspaceConfig, hn as formatActiveOrganizationLabel, ho as uninstallAgentActivityIntegrations, hr as createSpaceAddMembersGuideError, ht as runDaemonAutostart, i as runSpaceCreate, ia as resolveVersionChangeDirection, ii as formatAgentReplyReadinessLabel, in as connectWebSocket, io as LocalDaemonControlPlaneClientError, ir as writeDispatchSpaceActionRecord, is as cliJsonSkillsLoadEnvelopeSchema, it as colorizeDisplayProfileLabel, j as isSpaceCommandOutputHandledError, ja as parseCliViewMode, ji as getAgentControllerPermissionModeDisplayMetadata, jn as submitProfileRuntimeAgentControllerReport, jo as normalizeSharedSessionTitle, jr as registerSpaceMemberSelectionOptions, jt as createDelayedSpinner, k as resolveOrganizationVisibilityLabel, ka as createPresenter, ki as buildAgentControllerRef, kn as assessActionParticipationCandidate, ko as buildAgentActivityEvent, kr as getCommandEntryContract, kt as reconcileCliVersionView, l as runSpaceList, la as readDaemonServiceJobCrashExitCode, li as resolveOpenClawLocalDiagnosticsValue, ln as runAuthLogout, lo as unregisterAgentActivityRoute, lr as canUseInteractivePrompts, ls as compareAgentControllerRefsForDisplay, lt as renderOpenMeldTagline, m as prepareRequestedSpaceSendFiles, ma as readPendingDaemonServiceUpdate, mi as normalizeCustomProfileWorkspacePath, mn as buildAuthStatusSnapshot, mo as resolveAgentActivityDispatcherCommand, mr as createResetConfirmationGuideError, mt as runDaemon, n as promptAndConfirmSpacePassword, na as startCurrentCommandCheckScope, ni as resolveDaemonServiceFreshnessWarning, nn as readRuntimeReportingHealthState, no as LocalProjectConnectionError, nr as readDispatchOwnedRuntimeGuard, ns as cliJsonOutputEnvelopeSchema, nt as formatTransportModeDisplay, o as runSpaceHistory, oa as readCurrentObservedDaemonRuntimeStatus, oi as formatHumanReplyReadinessReason$1, on as ensureCommandAuthenticationOrCancel, oo as isAgentActivityRouteRegistered, or as resolveElapsedTimeMs, os as getOrganizationJoinLinkResponseSchema, ot as renderOpenMeldBrandBlockLines, p as runSpaceWatch, pa as performManagedInstall, pi as ensureOpenMeldManagedProfileWorkspace, pn as buildAuthStatusRows, po as readAgentActivityIntegrationStatus, pr as createProfileMenuGuideError, pt as bestEffortStopCurrentLaneDaemonService, q as runAgentsCustomRemove, qa as setSelectedOpenMeldProfileId, qi as classifyDaemonServiceWakeability, qn as createSpaceMemberIdentityIndex, qo as readControllerTaskLifecycleOutboxHealth, qr as canonicalizeAllowedActions, qt as runDaemonStartDecisionPrompt, r as runSpaceAddMembers, ra as inspectDaemonServiceInventory, ri as resolveCurrentReplyReadinessSnapshot, rn as readRecentDaemonDispatchJournalEvents, ro as validateLocalProjectConnectionPath, rr as readDispatchSpaceActionContextFromEnv, rs as cliJsonSkillsListEnvelopeSchema, rt as colorizeAgentLabel, s as runSpaceJoin, sa as getDaemonSystemServiceLogPath, si as mapAgentReplyReadinessToLegacyAutoReply, sn as evaluateCommandAuthentication, so as registerAgentActivityRoute, sr as formatDaemonServiceDowngradeBlockedRecommendation, ss as organizationJoinLinkErrorResponseSchema, st as renderOpenMeldHeader, t as buildCreateSpacePasswordPromptConfig, ta as resetCurrentCommandCheckState, ti as resolveServiceReadinessFromServiceStatus, tn as readBundledOpenMeldCliSkillDocumentByPath, to as setProfileDefaultView, tr as assertDispatchOwnedRuntimePublicWriteAllowed, ts as cliBinaryDeltaPatchSchema, tt as runAgentsShow, u as runSpacePassword, ua as resolveDaemonServiceManager, ui as syncProfileWorkspaceState, un as runAuthMenu, ur as createDoctorFailedGuideError, ut as resolveGatewayWebOrigin, v as buildHumanReadSignalsTranscriptItems, va as fetchLatestCliBinaryRelease, vi as setOpenMeldManagedProfileWorkspace, vn as requestDeviceToken, vo as formatOpenMeldCliCommands, vr as createSpaceLeaveGuideError, vt as runDaemonInstall, w as buildFormalDispatchResultReadPayload, wa as resolveCurrentDaemonExpectedVersion, wi as listAgentTargetStates, wn as resolveCreateProfileName, wo as syncLocalAgentActivity, wr as createSpaceTargetGuideError, wt as runDaemonStop, x as loadSpaceIdentityDirectoryOrNull, xa as writeVersionState, xi as syncDeviceRuntimeStateProjection, xn as revokeAuthAccessToken, xo as formatProfileAwareOpenMeldCliCommands, xr as createSpaceRemoveMembersGuideError, xt as runDaemonRunAfterEntryChecks, y as emitHumanReadSignalsTextProjection, ya as fetchLatestPackageInfo, yi as validateCustomProfileWorkspacePath, yn as resolveDeviceAuthClientId, yo as formatOpenMeldCliLine, yr as createSpaceMenuGuideError, yt as runDaemonInterrupt, z as buildReplyReadinessGuidance, za as deleteOpenMeldProfile, zi as resolveNativeAgentControllerPermissionModeForController, zn as upsertSpaceConfig, zo as listProjectConnectionsWithStatus, zr as DualViewGuideError, zt as readGatewayJsonResponse } from "./command-Be-JdIkv.js";
5
- import { At as submitFeedbackIssueRequestSchema, D as toStructuredApiClientFailure, Et as authProfileManagedRoleSchema, F as OPENMELD_HEADER_PROFILE_ID, G as SPACE_DISPATCH_TRACE_RESPONSE_CONTRACT_VERSION_HEADER, Ht as agentActivityProviderSchema, J as spaceDispatchTraceAttemptStatusSchema, K as projectSpaceDispatchTraceFinalVisibleOutcome, Q as projectObservabilityWakeCorrelation, R as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Tt as authProfileKindSchema, Ut as agentActivitySessionStatusSchema, V as sleep, Wt as agentActivitySnapshotQuerySchema, X as spaceDispatchTraceResponseSchema, Y as spaceDispatchTraceDispatchStatusSchema, Z as observabilityWakeTraceSelectorSchema, _ as createOrganizationSkillsApi, _n as startReplyReadinessSummarySchema, b as createProjectsApi, c as createAgentProfileBindingApi, d as createCurrentDeviceApi, en as agentActivityInventorySessionOriginSchema, et as ownerComputerDiagnosticsSchema, f as createFeedbackApi, g as createOrganizationApi, gn as START_TRIMMED_NON_EMPTY_STRING_SCHEMA, hn as START_ISO_DATE_TIME_SCHEMA, in as localAgentSessionProviderSchema, it as agentProfileCreationConfigurationSchema, l as createCenterAgentApi, mn as START_BOUNDED_VERSION_SCHEMA, nn as agentActivitySessionInventoryQuerySchema, nt as summarizeComputerFileAccessPolicy, pn as START_BOUNDED_ID_SCHEMA, q as resolveSpaceDispatchTraceRootCause, rt as DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION, s as createAgentActivityApi, tn as agentActivityInventorySessionStatusSchema, tt as projectOwnerComputerLocalRuntimes, u as createComputerFileAccessApi, v as createPrepareReadinessApi, vn as localAgentCatalogSchema, vt as organizationSkillBundleSchema, x as createRoutinesApi, xt as stringifyOrganizationSkillBundleCanonicalJson } from "./dist-QiJwpnJk.js";
4
+ import { $ as runAgentsManage, $a as resolveAuthenticationGuidanceFromMessage, $i as getCurrentCommandCheckState, $n as assessCliUpdate, $o as outJsonLine, $r as resolveDaemonDeviceId, $t as runSkillsUpdate, A as parseEnvelope, Aa as formatMessage, Ai as createAgentExecutionStatusDisplayRows, An as computeRetryDelayMs, Ao as resolveObservedAgentActivityBinding, Ar as getCommandHintsFromContract, At as emitDaemonAgentOverview, B as resolveHumanControllerDisplayName, Ba as listOpenMeldProfiles, Bn as assertNoRemovedCcSpaceAddressingSyntax, Bo as migrateProjectBindingStore, Br as formatDualViewGuideForDisplay, Bt as readGatewayTextResponse, C as toSpaceMetaUpsertInput, Ca as toStartBackgroundHelperExecutionCompatibility, Ci as resolveAgentProfilePrimaryAgentControllerReport, Cn as resolveCreateProfileKind, Co as resolveUserFacingCliEntryCommand, Cr as createSpaceSubcommandTargetGuideError, Ct as runDaemonStatusFlow, D as formatHumanReadTargetList, Da as renderHumanErrorCard, Di as notifyDaemonRouteCatalogChanged, Dn as formatServiceParticipationReadinessLabel, Do as readAgentActivityContextForPath, Dr as createStartAuthenticationGuideError, Dt as buildProfileWorkspacePresentation, E as buildHumanReplyContextSummary, Ea as buildHumanErrorCopy, Ei as listBuiltinAgentsRegistryEntries, En as ensureAgentProfileRuntimeBinding, Eo as upsertDaemonServiceContract, Er as createStartAgentIdentityGuideError, Et as runDaemonUninstall, F as resolveOpenMeldProfileForSpaceCommand, Fa as requireOpenMeldProfile, Fi as resolveAgentControllerPermissionModeForController, Fn as resolveLocalAgentControllerBlockerReasonCodes, Fo as readAgentActivityOutboxHealth, Fr as registerDaemonControlTargetOptions, Ft as fetchSpaceUpdates, G as runAgentsCustomAdd, Ga as clearSelectedOpenMeldProfileId, Gi as resolveDaemonServiceAlignmentDecision, Gn as buildSpaceRoundReadProjection, Go as canonicalizeLocalProjectPath, Gr as areAllowedActionsEquivalent, Gt as resolveDaemonServiceParticipationStatus, H as resolveAgentProfileSetup, Ha as resolveOpenMeldProfile, Hi as buildOnboardingPlan, Hn as buildDispatchResultReplyWorkflowProjection, Ho as runIfAgentActivityBindingGenerationIsCurrent, Hr as formatAgentOverviewPayload, Ht as parseJsonResponse, I as emitSpaceAgentOverview, Ia as resolveOpenMeldProfileOrNull, Ii as resolveAgentExecutionStatus, In as resolveLocalAgentControllerLaunchability, Io as removeProjectOutbox, Ir as registerAuthLoginRequestOptions, It as createCliSpaceApi, J as runAgentsCustomUpdate, Ja as buildAgentAuthenticationGuide, Ji as resolveServiceUpdateUrgency, Jn as formatRemovedCcRelationMessage, Jo as renderInfoCard, Jr as readPendingOpenMeldToolsUpdateAttempt, Jt as collectSkillsReadinessSnapshot, K as runAgentsCustomList, Ka as getSelectedOpenMeldProfileId, Ki as classifyDaemonServiceRunStartability, Kn as buildUpdatesReplyWorkflowProjection, Ko as enqueueControllerTaskLifecycleEventWhileLocked, Kr as buildAgentFacingPublicationModeGuideLines, Kt as runDaemonServiceParticipationGate, L as emitSpaceCliAgentOverview, La as createOpenMeldAgentProfile, Li as resolveAgentProfileEditCapabilities, Ln as resolveLocalAgentControllerReportDecision, Lo as bindProject, Lr as registerBuiltinAgentSelectionOptions, Lt as fetchSpaceMeta, M as assertFullSignalIdArgument, Ma as resolveRuntimeContext, Mi as getAgentControllerPermissionModeFieldLabel, Mn as submitRuntimeAgentControllerReport, Mo as readCodexSessionTitles, Mr as SPACE_ADD_MEMBERS_PROGRESS_HEARTBEAT_MS, Mt as shouldEmitAgentOverview, N as assertValidSpaceIdTarget, Na as resolveViewProfileKey, Ni as listAgentControllerPermissionModeOptions, Nn as submitRuntimeAgentControllerReports, No as enqueueAgentActivityHookEvent, Nr as registerSkillsTargetSelectionOptions, Nt as runDaemonStartupPreflight, O as resolveLinkAccessLabel, Oa as renderHumanTextErrorCard, Oi as resolveLocalRegistryAgentIdFromAgentControllerRef, On as resolveServiceParticipationReadiness, Oo as removeAgentActivityContextCache, Or as createUpgradeConfirmationGuideError, Ot as buildProfileWorkspaceRows, P as prepareAuthenticatedSpaceCommandContext, Pa as isSelectedOpenMeldProfileRequiredError, Pi as parseAgentControllerRef, Pn as collectLocalAgentControllerInventory, Po as removeProjectInbox, Pr as getCliVersionInfo, Pt as readDaemonStartFailureLogTailLines, Q as runAgentsList, Qa as resolveAuthenticationGuidanceFromError, Qi as finishCurrentCommandCheckScope, Qn as runInteractivePrompt, Qo as errLine, Qr as ensureDaemonRuntimePaths, Qt as runSkillsUninstall, R as prepareLocalAgentReadiness, Ra as createOpenMeldHumanProfile, Ri as resolveEvidenceSyncHealth, Rn as inspectSpaceCacheFile, Ro as listProjectBindings, Rr as buildAgentOverviewFromContract, Rt as updateSpaceMeta, S as loadSpaceSignalIndexOrNull, Sa as resolveDaemonRuntimeContractCompatibility, Si as createPrimaryBindingReadSession, Sn as createProfileByKind, So as resolveSetupFollowUpCliEntryCommand, Sr as createSpaceResultGuideError, St as runDaemonSnapshot, T as buildFormalSignalReadPayload, Ta as OPENMELD_VERSION, Ti as reconcileNewRunnableBuiltinAgentsForSetup, Tn as promptTextEntry, To as readDaemonServiceContract, Tr as createSpaceUpdatesGuideError, Tt as runDaemonTeardownStrict, U as runAgents, Ua as updateOpenMeldProfile, Ui as getSetupFlowCopy, Un as buildSignalIndex, Uo as setDefaultProjectConnection, Ur as OPENMELD_AGENT_MENTAL_MODEL_LINES, Ut as resolveLocalComponentsStatus, V as persistAgentTransportSelection, Va as primeOpenMeldProfilesSessionCache, Vi as buildDaemonRouteObservationPresentation$1, Vn as buildDispatchResultMessageReadProjection, Vo as removeProjectConnection, Vr as buildDualViewGuideMessage, Vt as toStructuredGatewayFailure, W as runAgentsConfig, Wa as alignSelectedOpenMeldProfileStorage, Wi as buildDaemonServiceTargetSpec, Wn as buildSignalMessageReadProjection, Wo as unbindProject, Wr as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, Wt as writeInstalledLocalComponentsSnapshot, X as runAgentsDisable, Xa as createAuthenticationError, Xi as resolveOpenMeldEnvironmentTarget, Xn as promptSearchSelect, Xo as sanitizeTerminalDisplayText, Xr as runPendingDaemonServiceUpdate, Xt as runSkillsEnsure, Y as runAgentsDetect, Ya as buildHumanAuthenticationCard, Yi as assessServerRequiredVersion, Yn as promptSearchMultiselect, Yo as renderTextInfoCard, Yr as readOpenMeldToolsUpdateContextFromEnv, Yt as runSkillsCheck$1, Z as runAgentsEnable, Za as resolveAuthenticationGuidance, Zi as resolveAuthBaseUrl, Zn as isReturnKeypress, Zo as emitCliJsonEnvelope, Zr as scheduleDaemonServiceUpdate, Zt as runSkillsInstall, _ as runSpaceWriteWithPasswordRetry, _a as ensureVersionStateReady, _i as setCustomProfileWorkspace, _n as fetchAuthUserSnapshot, _o as formatOpenMeldCliCommand, _r as createSpaceContractSetGuideError, _t as runDaemonCancel, a as runSpaceDelete, aa as readCurrentDaemonRuntimeContext, ai as formatDeviceReplyReadinessLabel, an as buildCommandAuthenticationPromptMessage, ao as requestLocalAgentActivitySync, ar as formatElapsedTime, as as cliJsonSkillsShowEnvelopeSchema, at as printOpenMeldBanner, b as buildIdentityOnlyMembersSnapshotForReadProjection, ba as readVersionState, bi as describeProfileWorkspacePathValidationFailure, bn as resolveDeviceTokenExpiresAt, bo as formatOpenMeldCliTextBlock, br as createSpacePublicationSetGuideError, bt as runDaemonReinstall, c as runSpaceLeave, ca as isDaemonServiceJobNeverSpawned, ci as resolveGatewayChainReadiness, cn as runAuthLogin, co as resolveAgentActivityRouteForPath, cr as formatDaemonServiceMissingRecommendation, cs as revokeOrganizationJoinLinkResponseSchema, ct as renderOpenMeldLogo, d as runSpaceRemoveMembers, da as readRecentDaemonLifecycleEvents, di as createModelCatalogReadSession, dn as runAuthStatus, do as defaultManagedIntegrationPaths, dr as createProfileActionGuideError, dt as resolveSpaceWebGatewayOrigin, ea as isCurrentCommandCheckScopeActive, ei as formatDaemonFailureContextText, en as ensureLocalSkills, eo as getProfileDefaultView, er as isCliUpdateCheckApplicable, es as outLine, et as runAgentsRepair, f as runSpaceSend, fa as buildInstallSelfJsonPayload, fi as resolveProfileWorkspaceRuntime, fn as exchangeOneTimeTokenAuthSession, fo as installAgentActivityIntegrations, fr as createProfileCreateGuideError, ft as resolveSpaceSendText, g as runSpaceReadWithPasswordRetry, ga as compareSemver, gi as resolveConfiguredProfileWorkspacePath, gn as extractAuthApiErrorMessage, go as formatInlineOpenMeldCliCommands, gr as createSpaceAliasTargetGuideError, gt as runDaemonBackgroundStartForDecision, h as uploadPreparedSpaceFiles, ha as buildNextVersionState, hi as readProfileWorkspaceConfig, hn as formatActiveOrganizationLabel, ho as uninstallAgentActivityIntegrations, hr as createSpaceAddMembersGuideError, ht as runDaemonAutostart, i as runSpaceCreate, ia as resolveVersionChangeDirection, ii as formatAgentReplyReadinessLabel, in as connectWebSocket, io as LocalDaemonControlPlaneClientError, ir as writeDispatchSpaceActionRecord, is as cliJsonSkillsLoadEnvelopeSchema, it as colorizeDisplayProfileLabel, j as isSpaceCommandOutputHandledError, ja as parseCliViewMode, ji as getAgentControllerPermissionModeDisplayMetadata, jn as submitProfileRuntimeAgentControllerReport, jo as normalizeSharedSessionTitle, jr as registerSpaceMemberSelectionOptions, jt as createDelayedSpinner, k as resolveOrganizationVisibilityLabel, ka as createPresenter, ki as buildAgentControllerRef, kn as assessActionParticipationCandidate, ko as buildAgentActivityEvent, kr as getCommandEntryContract, kt as reconcileCliVersionView, l as runSpaceList, la as readDaemonServiceJobCrashExitCode, li as resolveOpenClawLocalDiagnosticsValue, ln as runAuthLogout, lo as unregisterAgentActivityRoute, lr as canUseInteractivePrompts, ls as compareAgentControllerRefsForDisplay, lt as renderOpenMeldTagline, m as prepareRequestedSpaceSendFiles, ma as readPendingDaemonServiceUpdate, mi as normalizeCustomProfileWorkspacePath, mn as buildAuthStatusSnapshot, mo as resolveAgentActivityDispatcherCommand, mr as createResetConfirmationGuideError, mt as runDaemon, n as promptAndConfirmSpacePassword, na as startCurrentCommandCheckScope, ni as resolveDaemonServiceFreshnessWarning, nn as readRuntimeReportingHealthState, no as LocalProjectConnectionError, nr as readDispatchOwnedRuntimeGuard, ns as cliJsonOutputEnvelopeSchema, nt as formatTransportModeDisplay, o as runSpaceHistory, oa as readCurrentObservedDaemonRuntimeStatus, oi as formatHumanReplyReadinessReason$1, on as ensureCommandAuthenticationOrCancel, oo as isAgentActivityRouteRegistered, or as resolveElapsedTimeMs, os as getOrganizationJoinLinkResponseSchema, ot as renderOpenMeldBrandBlockLines, p as runSpaceWatch, pa as performManagedInstall, pi as ensureOpenMeldManagedProfileWorkspace, pn as buildAuthStatusRows, po as readAgentActivityIntegrationStatus, pr as createProfileMenuGuideError, pt as bestEffortStopCurrentLaneDaemonService, q as runAgentsCustomRemove, qa as setSelectedOpenMeldProfileId, qi as classifyDaemonServiceWakeability, qn as createSpaceMemberIdentityIndex, qo as readControllerTaskLifecycleOutboxHealth, qr as canonicalizeAllowedActions, qt as runDaemonStartDecisionPrompt, r as runSpaceAddMembers, ra as inspectDaemonServiceInventory, ri as resolveCurrentReplyReadinessSnapshot, rn as readRecentDaemonDispatchJournalEvents, ro as validateLocalProjectConnectionPath, rr as readDispatchSpaceActionContextFromEnv, rs as cliJsonSkillsListEnvelopeSchema, rt as colorizeAgentLabel, s as runSpaceJoin, sa as getDaemonSystemServiceLogPath, si as mapAgentReplyReadinessToLegacyAutoReply, sn as evaluateCommandAuthentication, so as registerAgentActivityRoute, sr as formatDaemonServiceDowngradeBlockedRecommendation, ss as organizationJoinLinkErrorResponseSchema, st as renderOpenMeldHeader, t as buildCreateSpacePasswordPromptConfig, ta as resetCurrentCommandCheckState, ti as resolveServiceReadinessFromServiceStatus, tn as readBundledOpenMeldCliSkillDocumentByPath, to as setProfileDefaultView, tr as assertDispatchOwnedRuntimePublicWriteAllowed, ts as cliBinaryDeltaPatchSchema, tt as runAgentsShow, u as runSpacePassword, ua as resolveDaemonServiceManager, ui as syncProfileWorkspaceState, un as runAuthMenu, ur as createDoctorFailedGuideError, ut as resolveGatewayWebOrigin, v as buildHumanReadSignalsTranscriptItems, va as fetchLatestCliBinaryRelease, vi as setOpenMeldManagedProfileWorkspace, vn as requestDeviceToken, vo as formatOpenMeldCliCommands, vr as createSpaceLeaveGuideError, vt as runDaemonInstall, w as buildFormalDispatchResultReadPayload, wa as resolveCurrentDaemonExpectedVersion, wi as listAgentTargetStates, wn as resolveCreateProfileName, wo as syncLocalAgentActivity, wr as createSpaceTargetGuideError, wt as runDaemonStop, x as loadSpaceIdentityDirectoryOrNull, xa as writeVersionState, xi as syncDeviceRuntimeStateProjection, xn as revokeAuthAccessToken, xo as formatProfileAwareOpenMeldCliCommands, xr as createSpaceRemoveMembersGuideError, xt as runDaemonRunAfterEntryChecks, y as emitHumanReadSignalsTextProjection, ya as fetchLatestPackageInfo, yi as validateCustomProfileWorkspacePath, yn as resolveDeviceAuthClientId, yo as formatOpenMeldCliLine, yr as createSpaceMenuGuideError, yt as runDaemonInterrupt, z as buildReplyReadinessGuidance, za as deleteOpenMeldProfile, zi as resolveNativeAgentControllerPermissionModeForController, zn as upsertSpaceConfig, zo as listProjectConnectionsWithStatus, zr as DualViewGuideError, zt as readGatewayJsonResponse } from "./command-DH6wJoZy.js";
5
+ import { At as submitFeedbackIssueRequestSchema, D as toStructuredApiClientFailure, Et as authProfileManagedRoleSchema, F as OPENMELD_HEADER_PROFILE_ID, G as SPACE_DISPATCH_TRACE_RESPONSE_CONTRACT_VERSION_HEADER, Ht as agentActivityProviderSchema, J as spaceDispatchTraceAttemptStatusSchema, K as projectSpaceDispatchTraceFinalVisibleOutcome, Q as projectObservabilityWakeCorrelation, R as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Tt as authProfileKindSchema, Ut as agentActivitySessionStatusSchema, V as sleep, Wt as agentActivitySnapshotQuerySchema, X as spaceDispatchTraceResponseSchema, Y as spaceDispatchTraceDispatchStatusSchema, Z as observabilityWakeTraceSelectorSchema, _ as createOrganizationSkillsApi, _n as startReplyReadinessSummarySchema, b as createProjectsApi, c as createAgentProfileBindingApi, d as createCurrentDeviceApi, en as agentActivityInventorySessionOriginSchema, et as ownerComputerDiagnosticsSchema, f as createFeedbackApi, g as createOrganizationApi, gn as START_TRIMMED_NON_EMPTY_STRING_SCHEMA, hn as START_ISO_DATE_TIME_SCHEMA, in as localAgentSessionProviderSchema, it as agentProfileCreationConfigurationSchema, l as createCenterAgentApi, mn as START_BOUNDED_VERSION_SCHEMA, nn as agentActivitySessionInventoryQuerySchema, nt as summarizeComputerFileAccessPolicy, pn as START_BOUNDED_ID_SCHEMA, q as resolveSpaceDispatchTraceRootCause, rt as DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION, s as createAgentActivityApi, tn as agentActivityInventorySessionStatusSchema, tt as projectOwnerComputerLocalRuntimes, u as createComputerFileAccessApi, v as createPrepareReadinessApi, vn as localAgentCatalogSchema, vt as organizationSkillBundleSchema, x as createRoutinesApi, xt as stringifyOrganizationSkillBundleCanonicalJson } from "./dist-Cl9HGiaA.js";
6
6
  import { Ar as clientMessageIdSchema, Dn as messageEnvelopeSchema, Er as unknown, Ft as spaceStatusSchema, Ht as isSpaceFileTextEditable, It as centerAgentInteractionSourceSchema, Kt as resolveSpaceFileMimeType, Sr as string, Tr as union, Zr as openMeldProfileIdSchema, br as record, di as trimmedStringFromUnknown, dr as enumFactory, fr as int, gr as nullFactory, hn as spaceContractSchema, li as nonEmptyTrimmedStringFromUnknown, ln as dispatchExecutionSchema, lr as discriminatedUnion, mn as spaceContractFieldsSchema, mr as literal, ni as openMeldRuntimeProfileIdSchema, or as array, pr as iso, sr as boolean, un as spaceThreadContextSchema, vr as object, xr as strictObject } from "./runtime-transport-QslOj6uZ.js";
7
7
  import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
8
8
  import { j as getDaemonStatus } from "./daemon-runtime-lease-6DIprlJy.js";
9
9
  import { _ as runMacOsNativeKeychainHelperIfRequested, a as beginAuthSessionTransition, c as getAuthSessionMetadata, d as getInterruptedComputerAuthSessionRecovery, f as markInterruptedComputerAuthSessionRecovery, g as updateAuthSessionActiveOrganization, l as getAuthSessionState, m as recordInterruptedComputerAuthSessionRecoveryFailure, n as AuthSessionRecoveryInProgressError, o as clearAuthSession, p as normalizeStoredActiveOrganization, s as completeInterruptedComputerAuthSessionRecovery, t as AuthSessionChangedBeforeTransitionError, u as getCurrentAuthOwnerUserId, v as isBinaryDistribution, y as resolveOpenMeldDistribution } from "./auth-session-BFa5tO5y.js";
10
- import { c as buildOpenMeldRequestContextHeadersWithAuth, d as buildOpenMeldRequestContextFromProfile, l as buildRequestAuthHeaders, n as createCliApiClientFoundation, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout } from "./api-client-foundation-C9xMaR4i.js";
10
+ import { c as buildOpenMeldRequestContextHeadersWithAuth, d as buildOpenMeldRequestContextFromProfile, l as buildRequestAuthHeaders, n as createCliApiClientFoundation, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout } from "./api-client-foundation-BXB-m4ub.js";
11
11
  import { Command, Option } from "commander";
12
12
  import os, { homedir, hostname, release, tmpdir } from "node:os";
13
13
  import * as z$1 from "zod/v4";
@@ -27427,7 +27427,22 @@ async function runSpaceAddMe(input) {
27427
27427
  detectedSubject,
27428
27428
  modelSelection,
27429
27429
  projectFolder,
27430
- spaceId: target.spaceId
27430
+ spaceId: target.spaceId,
27431
+ onAgentProfileCreated: (profile) => {
27432
+ emitSpaceAddMeProfileCreated({
27433
+ actorProfileId: actorProfile.openMeldProfileId,
27434
+ agentControllerPermissionMode: controllerPermissionMode.agentControllerPermissionMode ?? null,
27435
+ confirmDangerousAgentControllerPermissionMode: input.confirmDangerousAgentControllerPermissionMode === true,
27436
+ details: input.details === true,
27437
+ json: input.json === true,
27438
+ modelSelection,
27439
+ passwordRequiredOnRetry: Boolean(input.password),
27440
+ presenter,
27441
+ profile,
27442
+ projectFolder: projectFolder.path,
27443
+ space: target.spaceId
27444
+ });
27445
+ }
27431
27446
  })
27432
27447
  });
27433
27448
  const status = await addMembers({
@@ -27510,7 +27525,7 @@ async function ensureCurrentAgentProfile(input) {
27510
27525
  projectFolder: input.projectFolder,
27511
27526
  spaceId: input.spaceId
27512
27527
  });
27513
- if (match) {
27528
+ if (match?.kind === "bound_to_current_session") {
27514
27529
  const projectFolderAction = await ensureAgentProfileProjectFolder({
27515
27530
  profile: match.profile,
27516
27531
  projectFolder: input.projectFolder.path
@@ -27528,6 +27543,27 @@ async function ensureCurrentAgentProfile(input) {
27528
27543
  projectFolderAction
27529
27544
  };
27530
27545
  }
27546
+ if (match?.kind === "unbound") try {
27547
+ const projectFolderAction = await ensureAgentProfileProjectFolder({
27548
+ profile: match.profile,
27549
+ projectFolder: input.projectFolder.path
27550
+ });
27551
+ const binding = await bindAgentProfileToCurrentSession({
27552
+ controllerPermissionMode: input.controllerPermissionMode,
27553
+ detectedSubject: input.detectedSubject,
27554
+ modelSelection: input.modelSelection,
27555
+ profile: match.profile
27556
+ });
27557
+ return {
27558
+ bindingOutcome: binding.outcome ?? "reconnected",
27559
+ bindingStatus: binding.status,
27560
+ profile: match.profile,
27561
+ profileAction: "reused",
27562
+ projectFolderAction
27563
+ };
27564
+ } catch (error) {
27565
+ if (!(error instanceof AgentProfileProjectFolderMismatchError)) throw error;
27566
+ }
27531
27567
  const profile = await createOpenMeldAgentProfile({
27532
27568
  profileName: buildAgentProfileName({
27533
27569
  detectedSubject: input.detectedSubject,
@@ -27535,13 +27571,29 @@ async function ensureCurrentAgentProfile(input) {
27535
27571
  }),
27536
27572
  creatorProfileId: input.actorProfile.openMeldProfileId
27537
27573
  });
27574
+ input.onAgentProfileCreated(profile);
27538
27575
  await setCustomProfileWorkspace({
27539
27576
  openMeldProfileId: profile.openMeldProfileId,
27540
27577
  customWorkspacePath: input.projectFolder.path
27541
27578
  });
27579
+ const binding = await bindAgentProfileToCurrentSession({
27580
+ controllerPermissionMode: input.controllerPermissionMode,
27581
+ detectedSubject: input.detectedSubject,
27582
+ modelSelection: input.modelSelection,
27583
+ profile
27584
+ });
27585
+ return {
27586
+ bindingOutcome: binding.outcome ?? "created",
27587
+ bindingStatus: binding.status,
27588
+ profile,
27589
+ profileAction: "created",
27590
+ projectFolderAction: "created"
27591
+ };
27592
+ }
27593
+ async function bindAgentProfileToCurrentSession(input) {
27542
27594
  const runtimeReportSubmission = await submitRuntimeAgentControllerReport({
27543
27595
  agentControllerRef: input.detectedSubject.agentControllerRef,
27544
- diagnosticProfileId: profile.openMeldProfileId,
27596
+ diagnosticProfileId: input.profile.openMeldProfileId,
27545
27597
  localParticipationState: "ready",
27546
27598
  reasonCodes: ["space.add_me.current_agent"]
27547
27599
  });
@@ -27553,21 +27605,15 @@ async function ensureCurrentAgentProfile(input) {
27553
27605
  ...input.modelSelection.reasoningLevel ? { reasoningLevel: input.modelSelection.reasoningLevel } : {}
27554
27606
  } : {},
27555
27607
  confirmLocalExecutionEvidence: false,
27556
- profile,
27608
+ profile: input.profile,
27557
27609
  runtimeReportSubmission
27558
27610
  });
27559
27611
  if (binding.status !== "accepted") {
27560
27612
  const existingProfileId = normalizeOptionalString(binding.existingBinding?.agentProfileId);
27561
27613
  const reuseGuidance = existingProfileId ? ` This conversation is already bound to ${existingProfileId}. If that is the exact Agent Profile you created for this conversation, retry with --agent-profile ${existingProfileId}.` : "";
27562
- throw new Error(`Agent Profile Binding was not accepted for ${profile.openMeldProfileId}: ${binding.status}${binding.reason ? ` (${binding.reason})` : ""}.${reuseGuidance}`);
27614
+ throw new Error(`Agent Profile Binding was not accepted for ${input.profile.openMeldProfileId}: ${binding.status}${binding.reason ? ` (${binding.reason})` : ""}.${reuseGuidance}`);
27563
27615
  }
27564
- return {
27565
- bindingOutcome: binding.outcome ?? "created",
27566
- bindingStatus: binding.status,
27567
- profile,
27568
- profileAction: "created",
27569
- projectFolderAction: "created"
27570
- };
27616
+ return binding;
27571
27617
  }
27572
27618
  async function updateExistingAgentProfileBinding(input) {
27573
27619
  if (input.controllerPermissionMode) await updateAgentProfilePrimaryBindingAgentControllerPermissionMode({
@@ -27600,6 +27646,22 @@ async function resolveRequestedAgentProfile(input) {
27600
27646
  });
27601
27647
  if (profile.profileKind !== "agent" || profile.status !== "active") throw new Error(`--agent-profile ${agentProfileId} must identify an active Agent Profile.`);
27602
27648
  const bindingReads = createPrimaryBindingReadSession({ baseUrl: input.baseUrl });
27649
+ const bindingRead = await bindingReads.readPrimaryBinding(profile).catch((error) => {
27650
+ throw formatSpaceAddMeBindingReadFailure({
27651
+ agentProfileId,
27652
+ error,
27653
+ projectFolder: input.projectFolder,
27654
+ spaceId: input.spaceId
27655
+ });
27656
+ });
27657
+ if (bindingRead.status === "missing" && bindingRead.binding.bindingState === "missing") return {
27658
+ kind: "unbound",
27659
+ profile
27660
+ };
27661
+ if (resolveRequestedAgentProfileBindingReadAction({
27662
+ agentProfileId,
27663
+ bindingRead
27664
+ }) === "create_new") return null;
27603
27665
  const report = await resolveAgentProfilePrimaryAgentControllerReport({
27604
27666
  baseUrl: input.baseUrl,
27605
27667
  bindingReads,
@@ -27612,14 +27674,22 @@ async function resolveRequestedAgentProfile(input) {
27612
27674
  spaceId: input.spaceId
27613
27675
  });
27614
27676
  });
27615
- const executionTarget = report?.primaryBinding.executionTarget;
27616
- if (executionTarget?.agentControllerConversationId === input.detectedSubject.agentControllerConversationId && report?.agentControllerRef !== input.detectedSubject.agentControllerRef) throw new Error(`Agent Controller conversation ${input.detectedSubject.agentControllerConversationId} is bound to ${agentProfileId} through ${report?.agentControllerRef}. OpenMeld will not reuse it for ${input.detectedSubject.agentControllerRef}.`);
27617
- if (!report || executionTarget?.agentControllerConversationId !== input.detectedSubject.agentControllerConversationId || report.agentControllerRef !== input.detectedSubject.agentControllerRef) return null;
27677
+ if (!report) throw new Error(`OpenMeld found Binding data for Agent Profile ${agentProfileId}, but it could not identify one current Agent Controller. No new Agent Profile or Space membership was created.`);
27678
+ const executionTarget = report.primaryBinding.executionTarget;
27679
+ if (executionTarget?.agentControllerConversationId === input.detectedSubject.agentControllerConversationId && report.agentControllerRef !== input.detectedSubject.agentControllerRef) throw new Error(`Agent Controller conversation ${input.detectedSubject.agentControllerConversationId} is bound to ${agentProfileId} through ${report.agentControllerRef}. OpenMeld will not reuse it for ${input.detectedSubject.agentControllerRef}.`);
27680
+ if (executionTarget?.agentControllerConversationId !== input.detectedSubject.agentControllerConversationId || report.agentControllerRef !== input.detectedSubject.agentControllerRef) return null;
27618
27681
  return {
27682
+ kind: "bound_to_current_session",
27619
27683
  profile,
27620
27684
  report
27621
27685
  };
27622
27686
  }
27687
+ function resolveRequestedAgentProfileBindingReadAction(input) {
27688
+ if (input.bindingRead.status === "found" && input.bindingRead.binding.bindingState === "enabled_primary") return "inspect_active";
27689
+ if (input.bindingRead.status === "found" && input.bindingRead.binding.bindingState === "disabled_historical") return "create_new";
27690
+ const reasonCodes = input.bindingRead.binding.reasonCodes.join(", ");
27691
+ throw new Error(`OpenMeld could not confirm whether Agent Profile ${input.agentProfileId} already has a Binding${reasonCodes ? ` (${reasonCodes})` : ""}. No new Agent Profile or Space membership was created.`);
27692
+ }
27623
27693
  function formatRequestedAgentProfileReadFailure(input) {
27624
27694
  const error = normalizeError(input.error);
27625
27695
  if (error.message.includes("Agent Profile can only be managed in the workspace where it was created.")) return /* @__PURE__ */ new Error(`Agent Profile ${input.agentProfileId} belongs to a different OpenMeld Organization. Organization is the account boundary here, not the local Project folder. Omit --agent-profile to create a new profile in the current Organization, or switch Organizations before retrying.`);
@@ -27679,9 +27749,60 @@ async function ensureAgentProfileProjectFolder(input) {
27679
27749
  openMeldProfileId: input.profile.openMeldProfileId,
27680
27750
  value: config.value
27681
27751
  }));
27682
- if (existingPath !== input.projectFolder) throw new Error(`Agent Profile ${input.profile.openMeldProfileId} is already bound to Project folder ${existingPath} for this controller conversation. Refusing to reuse it for ${input.projectFolder}.`);
27752
+ if (existingPath !== input.projectFolder) throw new AgentProfileProjectFolderMismatchError(`Agent Profile ${input.profile.openMeldProfileId} is already bound to Project folder ${existingPath} for this controller conversation. Refusing to reuse it for ${input.projectFolder}.`);
27683
27753
  return "reused";
27684
27754
  }
27755
+ var AgentProfileProjectFolderMismatchError = class extends Error {};
27756
+ function emitSpaceAddMeProfileCreated(input) {
27757
+ const resumeCommand = buildSpaceAddMeResumeCommand({
27758
+ actorProfileId: input.actorProfileId,
27759
+ agentControllerPermissionMode: input.agentControllerPermissionMode,
27760
+ agentProfileId: input.profile.openMeldProfileId,
27761
+ confirmDangerousAgentControllerPermissionMode: input.confirmDangerousAgentControllerPermissionMode,
27762
+ modelSelection: input.modelSelection,
27763
+ projectFolder: input.projectFolder,
27764
+ space: input.space
27765
+ });
27766
+ const payload = {
27767
+ agentProfileId: input.profile.openMeldProfileId,
27768
+ passwordRequiredOnRetry: input.passwordRequiredOnRetry,
27769
+ profileCreation: "completed",
27770
+ profileSetup: "in_progress",
27771
+ resumeCommand,
27772
+ spaceMembership: "not_confirmed",
27773
+ wakeReadiness: "not_checked"
27774
+ };
27775
+ if (input.json || input.details) {
27776
+ input.presenter.data({
27777
+ code: "space.add_me.profile_created",
27778
+ payload
27779
+ });
27780
+ return;
27781
+ }
27782
+ const passwordNote = input.passwordRequiredOnRetry ? " Add --password again if the Space still requires it; OpenMeld does not print password values." : "";
27783
+ input.presenter.line({
27784
+ code: "space.add_me.profile_created",
27785
+ text: input.presenter.view === "agent" ? `Agent Profile ${input.profile.openMeldProfileId} was created; setup is still in progress. Space membership and Wake readiness are not confirmed.` : `Agent Profile ${input.profile.openMeldProfileId} was created; setup is still in progress. Space membership and Wake readiness are not confirmed. If this command stops, resume with: ${resumeCommand}.${passwordNote}`,
27786
+ data: payload
27787
+ });
27788
+ }
27789
+ function buildSpaceAddMeResumeCommand(input) {
27790
+ const parts = [
27791
+ "openmeld space add-me",
27792
+ quoteShellArg(input.space),
27793
+ "--profile",
27794
+ quoteShellArg(input.actorProfileId),
27795
+ "--project-folder",
27796
+ quoteShellArg(input.projectFolder),
27797
+ "--agent-profile",
27798
+ quoteShellArg(input.agentProfileId)
27799
+ ];
27800
+ if (input.agentControllerPermissionMode) parts.push("--agent-controller-permission-mode", quoteShellArg(input.agentControllerPermissionMode));
27801
+ if (input.confirmDangerousAgentControllerPermissionMode) parts.push("--confirm-dangerous-agent-controller-permission-mode");
27802
+ if (input.modelSelection.modelId) parts.push("--model", quoteShellArg(input.modelSelection.modelId));
27803
+ if (input.modelSelection.reasoningLevel) parts.push("--reasoning-effort", quoteShellArg(input.modelSelection.reasoningLevel));
27804
+ return formatOpenMeldCliCommand(parts.join(" "));
27805
+ }
27685
27806
  async function validateProjectFolder(projectFolder) {
27686
27807
  const validation = await validateCustomProfileWorkspacePath(projectFolder);
27687
27808
  if (validation.status === "invalid") throw new Error(`Project folder is invalid: ${describeProfileWorkspacePathValidationFailure({
@@ -27761,7 +27882,7 @@ function normalizeOptionalString(value) {
27761
27882
  return normalized.length > 0 ? normalized : null;
27762
27883
  }
27763
27884
  async function runDefaultSpaceAddMeMembership(input) {
27764
- const { runSpaceAddMeMembership } = await import("./add-me-membership-Dmli2EyP.js");
27885
+ const { runSpaceAddMeMembership } = await import("./add-me-membership-qgbz9HyG.js");
27765
27886
  return await runSpaceAddMeMembership(input);
27766
27887
  }
27767
27888
  //#endregion