openmeld 0.3.76 → 0.3.78
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/README.md +7 -0
- package/dist/{add-me-membership-C_dCTz9h.js → add-me-membership-BP7P_X-r.js} +2 -2
- package/dist/{add-me-membership-C_dCTz9h.js.map → add-me-membership-BP7P_X-r.js.map} +1 -1
- package/dist/{api-client-foundation-CO_4tB8y.js → api-client-foundation-jjwUa25Q.js} +4 -4
- package/dist/{api-client-foundation-CO_4tB8y.js.map → api-client-foundation-jjwUa25Q.js.map} +1 -1
- package/dist/{auth-session-BZgsNHJA.js → auth-session-BOKcW_84.js} +3 -3
- package/dist/{auth-session-BZgsNHJA.js.map → auth-session-BOKcW_84.js.map} +1 -1
- package/dist/{base-url-KfrIdedc.js → base-url-Cv9x5Es9.js} +11 -3
- package/dist/base-url-Cv9x5Es9.js.map +1 -0
- package/dist/{command-Bn3Sm1p8.js → command-Pj7c1mH5.js} +21164 -18939
- package/dist/{command-Bn3Sm1p8.js.map → command-Pj7c1mH5.js.map} +1 -1
- package/dist/{daemon-runtime-lease-7AQYjp3h.js → daemon-runtime-lease-CKQef0lp.js} +2 -2
- package/dist/{daemon-runtime-lease-7AQYjp3h.js.map → daemon-runtime-lease-CKQef0lp.js.map} +1 -1
- package/dist/{dist-nJqZxjtc.js → dist-DtEdipqO.js} +4690 -3965
- package/dist/dist-DtEdipqO.js.map +1 -0
- package/dist/openmeld-dev.js +1 -1
- package/dist/openmeld.js +965 -65
- package/dist/openmeld.js.map +1 -1
- package/dist/{runtime-transport-Bs6YfTqj.js → runtime-transport-BLEvh9zX.js} +53 -4
- package/dist/runtime-transport-BLEvh9zX.js.map +1 -0
- package/package.json +5 -3
- package/skills/openmeld-cli/SKILL.md +150 -2
- package/skills/openmeld-cli/references/commands.md +72 -0
- package/dist/base-url-KfrIdedc.js.map +0 -1
- package/dist/dist-nJqZxjtc.js.map +0 -1
- package/dist/runtime-transport-Bs6YfTqj.js.map +0 -1
package/dist/openmeld.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
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-
|
|
4
|
-
import { $ as formatTransportModeDisplay, $a as formatOpenMeldCliTextBlock, $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 emitCliJsonEnvelope, Ar as formatDualViewGuideForDisplay, At as readDaemonStartFailureLogTailLines, B as runAgents, Ba as registerAgentActivityRoute, Bi as resetCurrentCommandCheckState, Bn as promptSearchSelect, Bo as organizationJoinLinkErrorResponseSchema, Br as resolveServiceReadinessFromServiceStatus, Bt as writeInstalledLocalComponentsSnapshot, C as buildFormalSignalReadPayload, Ca as resolveOpenMeldProfile, Ci as ensureDaemonRuntimePaths, Cn as submitRuntimeAgentControllerReports, Co as unbindProject, Cr as registerSkillsTargetSelectionOptions, Ct as buildProfileWorkspacePresentation, D as isSpaceCommandOutputHandledError, Da as getSelectedOpenMeldProfileId, Di as createAgentExecutionStatusDisplayRows, Dn as resolveLocalAgentControllerReportDecision, Do as renderInfoCard, Dr as registerBuiltinAgentSelectionOptions, Dt as createDelayedSpinner, E as parseEnvelope, Ea as clearSelectedOpenMeldProfileId, Ei as buildAgentControllerRef, En as resolveLocalAgentControllerLaunchability, Eo as readControllerTaskLifecycleOutboxHealth, Er as registerAuthLoginRequestOptions, Et as emitDaemonAgentOverview, F as prepareLocalAgentReadiness, Fa as getProfileDefaultView, Fi as resolveEvidenceSyncHealth, Fn as buildSpaceRoundReadProjection, Fo as cliJsonOutputEnvelopeSchema, Fr as areAllowedActionsEquivalent, Ft as readGatewayJsonResponse, G as runAgentsCustomUpdate, Ga as installAgentActivityIntegrations, Gi as readCurrentObservedDaemonRuntimeStatus, Gn as assertDispatchOwnedRuntimePublicWriteAllowed, Gr as formatHumanReplyReadinessReason$1, Gt as runSkillsCheck$1, H as runAgentsCustomAdd, Ha as unregisterAgentActivityRoute, Hi as inspectDaemonServiceInventory, Hn as runInteractivePrompt, Ho as compareAgentControllerRefsForDisplay, Hr as resolveCurrentReplyReadinessSnapshot, Ht as runDaemonServiceParticipationGate, I as buildReplyReadinessGuidance, Ia as setProfileDefaultView, Ii as resolveNativeAgentControllerPermissionModeForController, In as buildUpdatesReplyWorkflowProjection, Io as cliJsonSkillsListEnvelopeSchema, Ir as buildAgentFacingPublicationModeGuideLines, It as readGatewayTextResponse, J as runAgentsEnable, Ja as uninstallAgentActivityIntegrations, Ji as readDaemonServiceJobCrashExitCode, Jn as writeDispatchSpaceActionRecord, Jr as resolveOpenClawLocalDiagnosticsValue, Jt as runSkillsUninstall, K as runAgentsDetect, Ka as readAgentActivityIntegrationStatus, 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 cliJsonSkillsLoadEnvelopeSchema, Lr as canonicalizeAllowedActions, Lt as toStructuredGatewayFailure, M as resolveSpaceAccessLabel, Ma as resolveAuthenticationGuidance, Mi as resolveAgentControllerPermissionModeForController, Mn as buildDispatchResultReplyWorkflowProjection, Mo as outJsonLine, Mr as formatAgentOverviewPayload, Mt as createCliSpaceApi, N as emitSpaceAgentOverview, Na as resolveAuthenticationGuidanceFromError, Ni as resolveAgentExecutionStatus, Nn as buildSignalIndex, No as outLine, Nr as OPENMELD_AGENT_MENTAL_MODEL_LINES, Nt as fetchSpaceMeta, O as assertFullSignalIdArgument, Oa as setSelectedOpenMeldProfileId, Oi as getAgentControllerPermissionModeDisplayMetadata, On as inspectSpaceCacheFile, Oo as renderTextInfoCard, Or as buildAgentOverviewFromContract, Ot as shouldEmitAgentOverview, P as emitSpaceCliAgentOverview, Pa as resolveAuthenticationGuidanceFromMessage, Pi as resolveAgentProfileEditCapabilities, Pn as buildSignalMessageReadProjection, Po as cliBinaryDeltaPatchSchema, Pr as SPACE_CONTRACT_ALLOWED_ACTION_ORDER, Pt as updateSpaceMeta, Q as runAgentsShow, Qa as formatOpenMeldCliLine, 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 cliJsonSkillsShowEnvelopeSchema, Rr as runDaemonServiceFullAlignment, Rt as parseJsonResponse, S as buildFormalDispatchResultReadPayload, Sa as primeOpenMeldProfilesSessionCache, Si as readRecentDaemonLifecycleEvents, Sn as submitRuntimeAgentControllerReport, So as setDefaultProjectConnection, 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 enqueueControllerTaskLifecycleEventWhileLocked, Tr as registerDaemonControlTargetOptions, Tt as reconcileCliVersionView, U as runAgentsCustomList, Ui as resolveVersionChangeDirection, Un as assessCliUpdate, Uo as package_default, Ur as formatAgentReplyReadinessLabel, Ut as runDaemonStartDecisionPrompt, V as runAgentsConfig, Va as resolveAgentActivityRouteForPath, Vi as startCurrentCommandCheckScope, Vn as isReturnKeypress, Vo as revokeOrganizationJoinLinkResponseSchema, Vr as resolveDaemonServiceFreshnessWarning, Vt as resolveDaemonServiceParticipationStatus, W as runAgentsCustomRemove, Wa as defaultManagedIntegrationPaths, Wi as readCurrentDaemonRuntimeContext, Wn as isCliUpdateCheckApplicable, Wr as formatDeviceReplyReadinessLabel, Wt as collectSkillsReadinessSnapshot, X as runAgentsManage, Xa as formatOpenMeldCliCommand, Xi as buildInstallSelfJsonPayload, Xn as resolveElapsedTimeMs, Xr as createModelCatalogReadSession, Xt as ensureLocalSkills, Y as runAgentsList, Ya as formatInlineOpenMeldCliCommands, Yi as resolveDaemonServiceManager, Yn as formatElapsedTime, Yr as syncProfileWorkspaceState, Yt as runSkillsUpdate, Z as runAgentsRepair, Za as formatOpenMeldCliCommands, 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 listProjectBindings, _r as createStartAuthenticationGuideError, _t as runDaemonRunAfterEntryChecks, a as runSpaceDelete, aa as isBinaryDistribution, ai as describeProfileWorkspacePathValidationFailure, an as runAuthLogin, ao as upsertDaemonServiceContract, ar as createSpaceAddMembersGuideError, at as renderOpenMeldHeader, b as loadSpaceSignalIndexOrNull, ba as deleteOpenMeldProfile, bi as classifyDaemonServiceRunStartability, bn as computeRetryDelayMs, bo as removeProjectConnection, br as getCommandHintsFromContract, bt as runDaemonStop, c as runSpaceLeave, ca as toStartBackgroundHelperExecutionCompatibility, ci as resolveAgentProfilePrimaryAgentControllerReport, cn as runAuthStatus, co as buildAgentActivityEvent, cr as createSpaceLeaveGuideError, ct as resolveGatewayWebOrigin, d as runSpaceRemoveMembers, da as formatMessage, di as listBuiltinAgentsRegistryEntries, dn as formatActiveOrganizationLabel, do as readCodexSessionTitles, dr as createSpaceRemoveMembersGuideError, dt as runDaemonAutostart, ea as ensureVersionStateReady, ei as readProfileWorkspaceConfig, en as connectWebSocket, eo as formatProfileAwareOpenMeldCliCommands, er as createDoctorFailedGuideError, et as postLocalParticipationMutationReconcile, f as runSpaceSend, fa as parseCliViewMode, fi as notifyDaemonRouteCatalogChanged, fn as createProfileByKind, fo as enqueueAgentActivityHookEvent, fr as createSpaceResultGuideError, ft as runDaemonBackgroundStartForDecision, g as buildHumanReadSignalsTranscriptItems, ga as requireOpenMeldProfile, gi as buildOnboardingPlan, gn as ensureAgentProfileRuntimeBinding, go as bindProject, gr as createStartAgentIdentityGuideError, gt as runDaemonReinstall, h as runSpaceWriteWithPasswordRetry, ha as isSelectedOpenMeldProfileRequiredError, hi as buildDaemonRouteObservationPresentation$1, hn as promptTextEntry, ho as removeProjectOutbox, hr as createSpaceUpdatesGuideError, ht as runDaemonInterrupt, i as runSpaceCreate, ia as writeVersionState, ii as validateCustomProfileWorkspacePath, in as evaluateCommandAuthentication, io as readDaemonServiceContract, ir as createResetConfirmationGuideError, it as renderOpenMeldBrandBlockLines, j as resolveOpenMeldProfileForSpaceCommand, ja as createAuthenticationError, ji as parseAgentControllerRef, jn as buildDispatchResultMessageReadProjection, jo as errLine, jr as buildDualViewGuideMessage, jt as fetchSpaceUpdates, k as assertValidSpaceIdTarget, ka as buildAgentAuthenticationGuide, ki as getAgentControllerPermissionModeFieldLabel, kn as upsertSpaceConfig, ko as sanitizeTerminalDisplayText, kr as DualViewGuideError, kt as runDaemonStartupPreflight, l as runSpaceList, la as resolveCurrentDaemonExpectedVersion, li as listAgentTargetStates, ln as buildAuthStatusRows, lo as resolveObservedAgentActivityBinding, lr as createSpaceMenuGuideError, lt as resolveSpaceSendText, m as runSpaceReadWithPasswordRetry, ma as resolveViewProfileKey, mn as resolveCreateProfileName, mo as readAgentActivityOutboxHealth, mr as createSpaceTargetGuideError, mt as runDaemonInstall, n as promptAndConfirmSpacePassword, na as fetchLatestPackageInfo, ni as setCustomProfileWorkspace, nn as buildCommandAuthenticationPromptMessage, no as resolveUserFacingCliEntryCommand, nr as createProfileCreateGuideError, nt as colorizeDisplayProfileLabel, o as runSpaceHistory, oa as resolveOpenMeldDistribution, oi as syncDeviceRuntimeStateProjection, on as runAuthLogout, oo as readAgentActivityContextForPath, or as createSpaceAliasTargetGuideError, ot as renderOpenMeldLogo, p as runSpaceWatch, pa as resolveRuntimeContext, pi as resolveLocalRegistryAgentIdFromAgentControllerRef, pn as resolveCreateProfileKind, po as removeProjectInbox, pr as createSpaceSubcommandTargetGuideError, pt as runDaemonCancel, q as runAgentsDisable, qa as resolveAgentActivityDispatcherCommand, 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 syncLocalAgentActivity, rr as createProfileMenuGuideError, rt as printOpenMeldBanner, s as runSpaceJoin, sa as resolveDaemonRuntimeContractCompatibility, si as createPrimaryBindingReadSession, sn as runAuthMenu, so as removeAgentActivityContextCache, sr as createSpaceContractSetGuideError, st as renderOpenMeldTagline, t as buildCreateSpacePasswordPromptConfig, ta as fetchLatestCliBinaryRelease, ti as resolveConfiguredProfileWorkspacePath, tn as assessServerRequiredVersion, to as resolveSetupFollowUpCliEntryCommand, tr as createProfileActionGuideError, tt as colorizeAgentLabel, u as runSpacePassword, ua as createPresenter, ui as reconcileNewRunnableBuiltinAgentsForSetup, un as buildAuthStatusSnapshot, uo as normalizeSharedSessionTitle, ur as createSpacePublicationSetGuideError, ut as runDaemon, v as buildIdentityOnlyMembersSnapshotForReadProjection, va as createOpenMeldAgentProfile, vi as buildDaemonServiceTargetSpec, vn as resolveServiceParticipationReadiness, vo as listProjectConnectionsWithStatus, vr as createUpgradeConfirmationGuideError, vt as runDaemonSnapshot, w as buildHumanReplyContextSummary, wa as updateOpenMeldProfile, wi as resolveDaemonDeviceId, wn as collectLocalAgentControllerInventory, wo as canonicalizeLocalProjectPath, wr as getCliVersionInfo, wt as buildProfileWorkspaceRows, x as toSpaceMetaUpsertInput, xa as listOpenMeldProfiles, xi as classifyDaemonServiceWakeability, xn as submitProfileRuntimeAgentControllerReport, xo as runIfAgentActivityBindingGenerationIsCurrent, xr as registerSpaceMemberSelectionOptions, xt as runDaemonTeardownStrict, y as loadSpaceIdentityDirectoryOrNull, ya as createOpenMeldHumanProfile, yi as resolveDaemonServiceAlignmentDecision, yn as assessActionParticipationCandidate, yo as migrateProjectBindingStore, yr as getCommandEntryContract, yt as runDaemonStatusFlow, z as resolveAgentProfileSetup, za as isAgentActivityRouteRegistered, zi as isCurrentCommandCheckScopeActive, zn as promptSearchMultiselect, zo as getOrganizationJoinLinkResponseSchema, zr as formatDaemonFailureContextText, zt as resolveLocalComponentsStatus } from "./command-Bn3Sm1p8.js";
|
|
5
|
-
import { $ as projectOwnerComputerLocalRuntimes, B as sleep, D as toStructuredApiClientFailure,
|
|
6
|
-
import {
|
|
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-Pj7c1mH5.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-DtEdipqO.js";
|
|
6
|
+
import { Bn as clientMessageIdSchema, Bt as spaceStatusSchema, Vt as centerAgentInteractionSourceSchema, Xt as spaceThreadContextSchema, Yt as dispatchExecutionSchema, en as spaceContractFieldsSchema, fr as openMeldRuntimeProfileIdSchema, pn as messageEnvelopeSchema, sr as openMeldProfileIdSchema, tn as spaceContractSchema, xr as trimmedStringFromUnknown, yr as nonEmptyTrimmedStringFromUnknown } from "./runtime-transport-BLEvh9zX.js";
|
|
7
7
|
import { r as daemonServiceLaneSchema } from "./service-contract-DZWQdPz5.js";
|
|
8
|
-
import { O as getDaemonStatus } from "./daemon-runtime-lease-
|
|
9
|
-
import { a as getAuthSessionState, i as getAuthSessionMetadata, l as updateAuthSessionActiveOrganization, n as clearAuthSession, o as getCurrentAuthOwnerUserId, s as normalizeStoredActiveOrganization } from "./auth-session-
|
|
10
|
-
import { c as buildRequestAuthHeaders, d as buildOpenMeldRequestContextFromProfile, n as createCliApiClientFoundation, p as deriveAuthBaseUrlFromGatewayUrl, r as fetchSpaceRequestWithTimeout, s as buildOpenMeldRequestContextHeadersWithAuth } from "./api-client-foundation-
|
|
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-BOKcW_84.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-jjwUa25Q.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";
|
|
@@ -1048,7 +1048,7 @@ async function ingestAgentActivityHook(input) {
|
|
|
1048
1048
|
if (!(cwd && providerSessionId)) return "ignored";
|
|
1049
1049
|
const nowMs = input.nowMs ?? Date.now();
|
|
1050
1050
|
const hookEvent = text$1(input.payload.hook_event_name) ?? "unknown";
|
|
1051
|
-
const status = hookStatus(hookEvent, input.payload.status ?? input.payload.reason);
|
|
1051
|
+
const status = hookStatus(input.provider, hookEvent, input.payload.status ?? input.payload.reason);
|
|
1052
1052
|
const binding = await resolveObservedAgentActivityBinding(cwd, await listProjectBindings({ rootDir: input.rootDir }));
|
|
1053
1053
|
if (!binding) return "unbound";
|
|
1054
1054
|
const lifecycleOutcome = await enqueueControllerTaskLifecycleForHook({
|
|
@@ -1202,7 +1202,8 @@ async function readAgentActivityHookStdin(input) {
|
|
|
1202
1202
|
return null;
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
|
-
function hookStatus(name, providerStatus) {
|
|
1205
|
+
function hookStatus(provider, name, providerStatus) {
|
|
1206
|
+
if (provider === "claude-code") return claudeCodeHookStatus(name, providerStatus);
|
|
1206
1207
|
if (name === "session.error") return "error";
|
|
1207
1208
|
if (name === "session.deleted") return "ended";
|
|
1208
1209
|
if (name === "sessionEnd") return text$1(providerStatus) === "error" ? "error" : "ended";
|
|
@@ -1217,6 +1218,13 @@ function hookStatus(name, providerStatus) {
|
|
|
1217
1218
|
if (name === "stop") return text$1(providerStatus) === "error" ? "error" : "idle";
|
|
1218
1219
|
return "active";
|
|
1219
1220
|
}
|
|
1221
|
+
function claudeCodeHookStatus(name, providerStatus) {
|
|
1222
|
+
if (name === "StopFailure") return "error";
|
|
1223
|
+
if (name === "SessionEnd") return text$1(providerStatus) === "error" ? "error" : "ended";
|
|
1224
|
+
if (name === "Stop") return text$1(providerStatus) === "error" ? "error" : "idle";
|
|
1225
|
+
if (name === "SessionStart" || name === "UserPromptSubmit" || name === "PreToolUse" || name === "PostToolUse") return "active";
|
|
1226
|
+
return "unknown";
|
|
1227
|
+
}
|
|
1220
1228
|
function resolveHookCwd(payload) {
|
|
1221
1229
|
const cwd = text$1(payload.cwd);
|
|
1222
1230
|
if (cwd) return cwd;
|
|
@@ -1553,6 +1561,29 @@ async function runAgentActivityRead(input = {}) {
|
|
|
1553
1561
|
emitSuccess(context, "activity.read", response);
|
|
1554
1562
|
});
|
|
1555
1563
|
}
|
|
1564
|
+
async function runAgentActivitySessions(input = {}) {
|
|
1565
|
+
await runProjectCommand(input, "activity.sessions", async (context) => {
|
|
1566
|
+
let projectId;
|
|
1567
|
+
if (input.project) {
|
|
1568
|
+
const projects = await context.projectsApi.list();
|
|
1569
|
+
requireOrganizationIdentity$1(context.organizationId, context.organizationSlug, projects.organizationId);
|
|
1570
|
+
projectId = resolveProjectId(projects.projects, input.project);
|
|
1571
|
+
}
|
|
1572
|
+
const response = await context.activityApi.readSessions(agentActivitySessionInventoryQuerySchema.parse({
|
|
1573
|
+
...input.cursor === void 0 ? {} : { cursor: input.cursor },
|
|
1574
|
+
...input.limit === void 0 ? {} : { limit: input.limit },
|
|
1575
|
+
...input.member === void 0 ? {} : { memberUserId: input.member },
|
|
1576
|
+
...input.nativeSession === void 0 ? {} : { nativeSessionId: input.nativeSession },
|
|
1577
|
+
...input.origin === void 0 ? {} : { origin: agentActivityInventorySessionOriginSchema.parse(input.origin) },
|
|
1578
|
+
...projectId === void 0 ? {} : { projectId },
|
|
1579
|
+
...input.provider === void 0 ? {} : { provider: localAgentSessionProviderSchema.parse(input.provider) },
|
|
1580
|
+
...input.query === void 0 ? {} : { query: input.query },
|
|
1581
|
+
...input.status === void 0 ? {} : { status: agentActivityInventorySessionStatusSchema.parse(input.status) }
|
|
1582
|
+
}));
|
|
1583
|
+
requireOrganizationIdentity$1(context.organizationId, context.organizationSlug, response.organization.id);
|
|
1584
|
+
emitSuccess(context, "activity.sessions", response);
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1556
1587
|
async function runProjectsCreate(input) {
|
|
1557
1588
|
await runProjectCommand(input, "create", async (context) => {
|
|
1558
1589
|
const response = await context.projectsApi.create({
|
|
@@ -1602,10 +1633,23 @@ async function unbindAndPurgeLocalProject(binding, options = {}) {
|
|
|
1602
1633
|
projectId: binding.projectId
|
|
1603
1634
|
});
|
|
1604
1635
|
for (const removed of removedProjectScopes.values()) await purgeLocalProject(removed);
|
|
1636
|
+
if (removedProjectScopes.size > 0) await requestSessionInventoryReconciliationAfterProjectDisconnect();
|
|
1605
1637
|
if ((await listProjectBindings({})).length === 0) await unregisterAgentActivityRoute({ rootDir: resolveOpenMeldRootDir() }).catch((error) => {
|
|
1606
1638
|
process.stderr.write(`[openmeld.agent_activity.route_unregister_failed] ${error instanceof Error ? error.message : String(error)}\n`);
|
|
1607
1639
|
});
|
|
1608
1640
|
}
|
|
1641
|
+
async function requestSessionInventoryReconciliationAfterProjectDisconnect() {
|
|
1642
|
+
try {
|
|
1643
|
+
await requestLocalAgentActivitySync({ payload: { reason: "project_connection_disconnected" } });
|
|
1644
|
+
} catch (error) {
|
|
1645
|
+
if (error instanceof LocalDaemonControlPlaneClientError && [
|
|
1646
|
+
"daemon.control.auth_token_missing",
|
|
1647
|
+
"daemon.control.contract_mismatch",
|
|
1648
|
+
"daemon.control.endpoint_missing"
|
|
1649
|
+
].includes(error.code)) return;
|
|
1650
|
+
process.stderr.write(`[openmeld.agent_activity.session_inventory_sync_request_failed] ${error instanceof Error ? error.message : String(error)}\n`);
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1609
1653
|
async function purgeLocalProject(binding) {
|
|
1610
1654
|
await Promise.all([
|
|
1611
1655
|
removeProjectInbox({
|
|
@@ -1799,18 +1843,7 @@ function emitSuccess(context, code, payload) {
|
|
|
1799
1843
|
}));
|
|
1800
1844
|
return;
|
|
1801
1845
|
}
|
|
1802
|
-
if (
|
|
1803
|
-
emitAgentActivitySnapshot(context.presenter, payload);
|
|
1804
|
-
return;
|
|
1805
|
-
}
|
|
1806
|
-
if (code === "activity.read") {
|
|
1807
|
-
emitHumanAgentActivitySnapshot({
|
|
1808
|
-
organizationName: context.organizationName,
|
|
1809
|
-
presenter: context.presenter,
|
|
1810
|
-
snapshot: payload
|
|
1811
|
-
});
|
|
1812
|
-
return;
|
|
1813
|
-
}
|
|
1846
|
+
if (emitActivitySuccess(context, code, payload)) return;
|
|
1814
1847
|
const nowMs = Date.now();
|
|
1815
1848
|
const project = "project" in payload ? payload.project : null;
|
|
1816
1849
|
const projectCount = "projects" in payload && Array.isArray(payload.projects) ? payload.projects.length : null;
|
|
@@ -1858,6 +1891,32 @@ function emitSuccess(context, code, payload) {
|
|
|
1858
1891
|
title: titleForCode(code)
|
|
1859
1892
|
});
|
|
1860
1893
|
}
|
|
1894
|
+
function emitActivitySuccess(context, code, payload) {
|
|
1895
|
+
if (code === "activity.read" && context.presenter.view === "agent") {
|
|
1896
|
+
emitAgentActivitySnapshot(context.presenter, payload);
|
|
1897
|
+
return true;
|
|
1898
|
+
}
|
|
1899
|
+
if (code === "activity.sessions" && context.presenter.view === "agent") {
|
|
1900
|
+
emitAgentActivitySessionInventory(context.presenter, payload);
|
|
1901
|
+
return true;
|
|
1902
|
+
}
|
|
1903
|
+
if (code === "activity.sessions") {
|
|
1904
|
+
emitHumanAgentActivitySessionInventory({
|
|
1905
|
+
inventory: payload,
|
|
1906
|
+
presenter: context.presenter
|
|
1907
|
+
});
|
|
1908
|
+
return true;
|
|
1909
|
+
}
|
|
1910
|
+
if (code === "activity.read") {
|
|
1911
|
+
emitHumanAgentActivitySnapshot({
|
|
1912
|
+
organizationName: context.organizationName,
|
|
1913
|
+
presenter: context.presenter,
|
|
1914
|
+
snapshot: payload
|
|
1915
|
+
});
|
|
1916
|
+
return true;
|
|
1917
|
+
}
|
|
1918
|
+
return false;
|
|
1919
|
+
}
|
|
1861
1920
|
function buildLocalConnectionRows(payload) {
|
|
1862
1921
|
const values = readLocalConnectionValues(payload);
|
|
1863
1922
|
if (!values) return [];
|
|
@@ -1926,6 +1985,71 @@ function emitAgentActivitySnapshot(presenter, snapshot) {
|
|
|
1926
1985
|
payload: event
|
|
1927
1986
|
});
|
|
1928
1987
|
}
|
|
1988
|
+
function emitAgentActivitySessionInventory(presenter, inventory) {
|
|
1989
|
+
presenter.data({
|
|
1990
|
+
code: "activity.sessions.inventory",
|
|
1991
|
+
payload: {
|
|
1992
|
+
asOfMs: inventory.asOfMs,
|
|
1993
|
+
nextCursor: inventory.nextCursor,
|
|
1994
|
+
organization: inventory.organization,
|
|
1995
|
+
sessionCount: inventory.sessions.length
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1998
|
+
for (const coverage of inventory.coverage) presenter.data({
|
|
1999
|
+
code: "activity.sessions.coverage",
|
|
2000
|
+
payload: coverage
|
|
2001
|
+
});
|
|
2002
|
+
for (const session of inventory.sessions) presenter.data({
|
|
2003
|
+
code: "activity.sessions.session",
|
|
2004
|
+
payload: session
|
|
2005
|
+
});
|
|
2006
|
+
}
|
|
2007
|
+
function emitHumanAgentActivitySessionInventory(input) {
|
|
2008
|
+
const { inventory } = input;
|
|
2009
|
+
const coverageProblems = inventory.coverage.filter((coverage) => coverage.state !== "current");
|
|
2010
|
+
renderInfoCard({
|
|
2011
|
+
codePrefix: "activity.sessions",
|
|
2012
|
+
presenter: input.presenter,
|
|
2013
|
+
rows: [
|
|
2014
|
+
{
|
|
2015
|
+
label: "Organization",
|
|
2016
|
+
value: inventory.organization.name
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
label: "As of",
|
|
2020
|
+
value: new Date(inventory.asOfMs).toISOString()
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
label: "Sessions on this page",
|
|
2024
|
+
value: String(inventory.sessions.length)
|
|
2025
|
+
},
|
|
2026
|
+
...coverageProblems.map((coverage) => ({
|
|
2027
|
+
label: `${providerDisplayName(coverage.provider)} coverage`,
|
|
2028
|
+
value: `${coverage.state}${coverage.problemCode ? ` · ${coverage.problemCode}` : ""}`
|
|
2029
|
+
})),
|
|
2030
|
+
...inventory.sessions.map((session) => ({
|
|
2031
|
+
label: session.nativeSessionTitle ?? session.nativeSessionId,
|
|
2032
|
+
value: [
|
|
2033
|
+
session.owner.name,
|
|
2034
|
+
session.project.name,
|
|
2035
|
+
session.computer.name,
|
|
2036
|
+
session.localAgent.name,
|
|
2037
|
+
session.status,
|
|
2038
|
+
session.dataState,
|
|
2039
|
+
new Date(session.lastActiveAtMs).toISOString(),
|
|
2040
|
+
`ID ${session.nativeSessionId}`,
|
|
2041
|
+
session.boundAgentProfileId ? `Agent Profile ${session.boundAgentProfileId}` : "Not connected to an Agent Profile"
|
|
2042
|
+
].join(" · ")
|
|
2043
|
+
})),
|
|
2044
|
+
...inventory.nextCursor ? [{
|
|
2045
|
+
label: "Next page",
|
|
2046
|
+
value: `Run again with --cursor ${inventory.nextCursor}`
|
|
2047
|
+
}] : []
|
|
2048
|
+
],
|
|
2049
|
+
sanitize: true,
|
|
2050
|
+
title: "Agent Activity Sessions"
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
1929
2053
|
function emitHumanAgentActivitySnapshot(input) {
|
|
1930
2054
|
const nowMs = input.nowMs ?? Date.now();
|
|
1931
2055
|
const { snapshot } = input;
|
|
@@ -1976,6 +2100,15 @@ function providerLabel(provider) {
|
|
|
1976
2100
|
if (provider === "cursor") return "Cursor";
|
|
1977
2101
|
return provider === "opencode" ? "OpenCode" : "Codex";
|
|
1978
2102
|
}
|
|
2103
|
+
function providerDisplayName(provider) {
|
|
2104
|
+
return {
|
|
2105
|
+
"claude-code": "Claude Code",
|
|
2106
|
+
codex: "Codex",
|
|
2107
|
+
cursor: "Cursor",
|
|
2108
|
+
"grok-build": "Grok Build",
|
|
2109
|
+
opencode: "OpenCode"
|
|
2110
|
+
}[provider];
|
|
2111
|
+
}
|
|
1979
2112
|
function requireOption(value, label) {
|
|
1980
2113
|
const normalized = value?.trim();
|
|
1981
2114
|
if (!normalized) throw new Error(`${label} is required.`);
|
|
@@ -1989,7 +2122,7 @@ function resolveProjectCommandErrorMessage(message, organizationSlug) {
|
|
|
1989
2122
|
return message;
|
|
1990
2123
|
}
|
|
1991
2124
|
function titleForCode(code) {
|
|
1992
|
-
if (code === "activity.read") return "Agent Activity";
|
|
2125
|
+
if (code === "activity.read" || code === "activity.sessions") return "Agent Activity";
|
|
1993
2126
|
const action = (code.split(".").at(-1) ?? "complete").replaceAll("_", " ");
|
|
1994
2127
|
return `Project ${action.charAt(0).toUpperCase()}${action.slice(1)}`;
|
|
1995
2128
|
}
|
|
@@ -2078,6 +2211,7 @@ const COMMAND_CHECK_REQUIREMENTS = Object.freeze({
|
|
|
2078
2211
|
"organization.current": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
2079
2212
|
"organization.switch": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
2080
2213
|
"organization.directory": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
2214
|
+
"organization.computers": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
2081
2215
|
"organization.invite_link.get": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
2082
2216
|
"organization.invite_link.create": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
2083
2217
|
"organization.invite_link.revoke": buildCommandChecks(REQUIRED_DISCLAIMER, OPTIONAL_CLI_UPDATE, REQUIRED_SIGN_IN),
|
|
@@ -2215,6 +2349,7 @@ const COMMAND_ENTRY_NAME_BY_ROUTE = {
|
|
|
2215
2349
|
"org current": "organization.current",
|
|
2216
2350
|
"org switch": "organization.switch",
|
|
2217
2351
|
"org directory": "organization.directory",
|
|
2352
|
+
"org computers": "organization.computers",
|
|
2218
2353
|
"org invite-link get": "organization.invite_link.get",
|
|
2219
2354
|
"org invite-link create": "organization.invite_link.create",
|
|
2220
2355
|
"org invite-link revoke": "organization.invite_link.revoke",
|
|
@@ -3893,6 +4028,12 @@ const COMMAND_ENTRY_COPY_BY_NAME = Object.freeze({
|
|
|
3893
4028
|
cliUpdateAction: "reading the Organization Directory",
|
|
3894
4029
|
serviceAction: null
|
|
3895
4030
|
},
|
|
4031
|
+
"organization.computers": {
|
|
4032
|
+
signInAction: "reading Organization Computers",
|
|
4033
|
+
profileAction: null,
|
|
4034
|
+
cliUpdateAction: "reading Organization Computers",
|
|
4035
|
+
serviceAction: null
|
|
4036
|
+
},
|
|
3896
4037
|
"organization.invite_link.get": {
|
|
3897
4038
|
signInAction: "reading the Organization invite link",
|
|
3898
4039
|
profileAction: null,
|
|
@@ -6647,6 +6788,9 @@ function registerAgentActivityCommands(program, handlers) {
|
|
|
6647
6788
|
addActivityReadOptions(activity).action(runRead);
|
|
6648
6789
|
activity.command("context").description("Read fresh cached Organization activity context for agent startup.").option("--path <path>", "Resolve context for this bound repository path").option("--json", "Print one machine-readable JSON envelope.", false).action(runWithActivityJson(handlers.context));
|
|
6649
6790
|
addActivityReadOptions(activity.command("read").description("Read the current Organization's safe Agent Activity snapshot.")).action(runRead);
|
|
6791
|
+
addActivitySessionsOptions(activity.command("sessions").description("List the Organization's authorized Local Agent Session Inventory.")).action(async (_options, command) => {
|
|
6792
|
+
await handlers.sessions(command.optsWithGlobals());
|
|
6793
|
+
});
|
|
6650
6794
|
activity.command("install").description("Enable managed Codex, Claude Code, Cursor, and OpenCode observers.").option("--json", "Print one machine-readable JSON envelope.", false).action(runWithActivityJson(handlers.install));
|
|
6651
6795
|
activity.command("uninstall").description("Remove only OpenMeld-owned activity observers.").option("--json", "Print one machine-readable JSON envelope.", false).action(runWithActivityJson(handlers.uninstall));
|
|
6652
6796
|
activity.command("status").description("Show managed observer and local outbox status.").option("--json", "Print one machine-readable JSON envelope.", false).action(runWithActivityJson(handlers.status));
|
|
@@ -6658,6 +6802,9 @@ function registerAgentActivityCommands(program, handlers) {
|
|
|
6658
6802
|
function addActivityReadOptions(command) {
|
|
6659
6803
|
return command.option("--project <project-slug>", "Filter by Project slug").option("--member <member-user-id>", "Filter by member user id").option("--provider <provider>", "Filter by codex, claude-code, cursor, or opencode").option("--status <status>", "Filter by active, idle, ended, error, or unknown").option("--view <mode>", "Output view: human or agent", "human").option("--json", "Print one machine-readable JSON envelope.", false);
|
|
6660
6804
|
}
|
|
6805
|
+
function addActivitySessionsOptions(command) {
|
|
6806
|
+
return command.option("--project <project-slug>", "Filter by Project slug").option("--member <member-user-id>", "Filter by member user id").option("--provider <provider>", "Filter by codex, claude-code, cursor, opencode, or grok-build").option("--status <status>", "Filter by working, idle, ended, error, or unknown").option("--origin <origin>", "Filter by openmeld, local, or unknown").option("--native-session <id>", "Locate one Native Session ID").option("--query <text>", "Search Native Session title or ID").option("--limit <count>", "Page size, from 1 through 100", "50").option("--cursor <cursor>", "Continue from a prior page cursor").option("--view <mode>", "Output view: human or agent", "human").option("--json", "Print one machine-readable JSON envelope.", false);
|
|
6807
|
+
}
|
|
6661
6808
|
function registerProjectCommands(program, handlers) {
|
|
6662
6809
|
const projects = program.command("projects").description("Manage Agent Activity Projects and local opt-in bindings.");
|
|
6663
6810
|
projects.command("list").description("List Projects and this device's local bindings.").option("--json", "Print one machine-readable JSON envelope.", false).action(handlers.list);
|
|
@@ -7421,97 +7568,97 @@ function emitCenterAgentApiError(input) {
|
|
|
7421
7568
|
});
|
|
7422
7569
|
}
|
|
7423
7570
|
function classifyCenterAgentApiFailure(input) {
|
|
7424
|
-
if (input.failure.status === 401 || hasFailureCode$
|
|
7571
|
+
if (input.failure.status === 401 || hasFailureCode$2(input.failure, "auth.unauthenticated")) return {
|
|
7425
7572
|
code: "center_agent.auth_required",
|
|
7426
7573
|
message: "OpenMeld could not verify your sign-in for this Center Agent command.",
|
|
7427
7574
|
nextStep: "Run `openmeld login`, then retry this command.",
|
|
7428
7575
|
title: "Sign In Needed"
|
|
7429
7576
|
};
|
|
7430
|
-
if (hasFailureCode$
|
|
7577
|
+
if (hasFailureCode$2(input.failure, "center_agent.creator_required")) return {
|
|
7431
7578
|
code: "center_agent.creator_required",
|
|
7432
7579
|
message: "Only the Organization creator can pause or resume the Center Agent.",
|
|
7433
7580
|
nextStep: "Ask the Organization creator to run this command for the active Organization.",
|
|
7434
7581
|
title: "Organization Creator Needed"
|
|
7435
7582
|
};
|
|
7436
|
-
if (hasFailureCode$
|
|
7583
|
+
if (hasFailureCode$2(input.failure, "organization.context_required", "organization.context_unavailable", "organization.membership_required")) return {
|
|
7437
7584
|
code: "center_agent.organization_required",
|
|
7438
7585
|
message: "OpenMeld could not resolve an active Organization for this Center Agent command.",
|
|
7439
7586
|
nextStep: "Run `openmeld org list`, then `openmeld org switch <slug>`.",
|
|
7440
7587
|
title: "No Active Organization"
|
|
7441
7588
|
};
|
|
7442
|
-
if (hasFailureCode$
|
|
7589
|
+
if (hasFailureCode$2(input.failure, "center_agent.permission_required", "organization.role_required")) return {
|
|
7443
7590
|
code: "center_agent.owner_or_admin_required",
|
|
7444
7591
|
message: "Only an Organization owner or admin can change the Center Agent designation.",
|
|
7445
7592
|
nextStep: "Run `openmeld org current` to confirm the active Organization, then ask an owner or admin for access.",
|
|
7446
7593
|
title: "Owner Or Admin Needed"
|
|
7447
7594
|
};
|
|
7448
|
-
if (hasFailureCode$
|
|
7595
|
+
if (hasFailureCode$2(input.failure, "center_agent.profile_not_found")) return {
|
|
7449
7596
|
code: "center_agent.profile_not_found",
|
|
7450
7597
|
message: "OpenMeld could not find that Agent Profile.",
|
|
7451
7598
|
nextStep: "Check the Agent Profile ID, then retry this command.",
|
|
7452
7599
|
title: "Agent Profile Not Found"
|
|
7453
7600
|
};
|
|
7454
|
-
if (hasFailureCode$
|
|
7601
|
+
if (hasFailureCode$2(input.failure, "center_agent.profile_invalid")) return {
|
|
7455
7602
|
code: "center_agent.profile_invalid",
|
|
7456
7603
|
message: "Only an Agent Profile can be designated as the Center Agent.",
|
|
7457
7604
|
nextStep: "Choose an Agent Profile ID, then retry this command.",
|
|
7458
7605
|
title: "Agent Profile Required"
|
|
7459
7606
|
};
|
|
7460
|
-
if (hasFailureCode$
|
|
7607
|
+
if (hasFailureCode$2(input.failure, "center_agent.profile_org_mismatch")) return {
|
|
7461
7608
|
code: "center_agent.profile_org_mismatch",
|
|
7462
7609
|
message: "That Agent Profile does not belong to the active Organization.",
|
|
7463
7610
|
nextStep: "Run `openmeld org current` and choose an Agent Profile from that Organization.",
|
|
7464
7611
|
title: "Agent Profile Not In Organization"
|
|
7465
7612
|
};
|
|
7466
|
-
if (hasFailureCode$
|
|
7613
|
+
if (hasFailureCode$2(input.failure, "center_agent.profile_binding_required")) return {
|
|
7467
7614
|
code: "center_agent.profile_binding_required",
|
|
7468
7615
|
message: "Designating a self-hosted Center Agent requires your enabled primary Binding for that Agent Profile.",
|
|
7469
7616
|
nextStep: "Run `openmeld setup --profile <agent-profile-id> --local-agent <local-agent-id>`, then retry designation.",
|
|
7470
7617
|
title: "Agent Profile Binding Needed"
|
|
7471
7618
|
};
|
|
7472
|
-
if (hasFailureCode$
|
|
7619
|
+
if (hasFailureCode$2(input.failure, "center_agent.profile_details_missing")) return {
|
|
7473
7620
|
code: "center_agent.profile_details_missing",
|
|
7474
7621
|
message: "The Center Agent designation exists, but its Agent Profile is not visible in the Organization directory.",
|
|
7475
7622
|
nextStep: "Retry after OpenMeld refreshes the Organization directory.",
|
|
7476
7623
|
title: "Center Agent Profile Missing"
|
|
7477
7624
|
};
|
|
7478
|
-
if (hasFailureCode$
|
|
7625
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_token_budget_too_small")) return {
|
|
7479
7626
|
code: "center_agent.context_token_budget_too_small",
|
|
7480
7627
|
message: "The next visible message needs more context space than this token budget allows.",
|
|
7481
7628
|
nextStep: "Retry with `openmeld center-agent context --max-tokens 8000`. OpenMeld did not skip the message.",
|
|
7482
7629
|
title: "Context Token Budget Too Small"
|
|
7483
7630
|
};
|
|
7484
|
-
if (hasFailureCode$
|
|
7631
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_conversation_required")) return {
|
|
7485
7632
|
code: "center_agent.context_conversation_required",
|
|
7486
7633
|
message: "There is no Center Agent conversation to read yet.",
|
|
7487
7634
|
nextStep: "Run `openmeld center-agent ask \"What should we work on?\"`, then retry this command.",
|
|
7488
7635
|
title: "Start A Center Agent Conversation"
|
|
7489
7636
|
};
|
|
7490
|
-
if (hasFailureCode$
|
|
7637
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_manifest_not_found")) return {
|
|
7491
7638
|
code: "center_agent.context_manifest_not_found",
|
|
7492
7639
|
message: "That Center Agent context snapshot is unavailable or belongs to a different member.",
|
|
7493
7640
|
nextStep: "Request fresh context with `openmeld center-agent context`, then report the new manifest load.",
|
|
7494
7641
|
title: "Fresh Center Agent Context Needed"
|
|
7495
7642
|
};
|
|
7496
|
-
if (hasFailureCode$
|
|
7643
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_load_manifest_empty")) return {
|
|
7497
7644
|
code: "center_agent.context_load_manifest_empty",
|
|
7498
7645
|
message: "This context snapshot has no verifiable messages to record as loaded.",
|
|
7499
7646
|
nextStep: "Request fresh context with `openmeld center-agent context`. Older snapshots cannot be turned into load receipts.",
|
|
7500
7647
|
title: "Fresh Center Agent Context Needed"
|
|
7501
7648
|
};
|
|
7502
|
-
if (hasFailureCode$
|
|
7649
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_load_client_mismatch")) return {
|
|
7503
7650
|
code: "center_agent.context_load_client_mismatch",
|
|
7504
7651
|
message: "The Local Agent reporting this load is different from the one that requested the context.",
|
|
7505
7652
|
nextStep: "Report the load from the original Local Agent, or request fresh context from the current one.",
|
|
7506
7653
|
title: "Local Agent Does Not Match"
|
|
7507
7654
|
};
|
|
7508
|
-
if (hasFailureCode$
|
|
7655
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_load_already_recorded")) return {
|
|
7509
7656
|
code: "center_agent.context_load_already_recorded",
|
|
7510
7657
|
message: "This context snapshot already has a different load receipt, so OpenMeld will not overwrite its audit history.",
|
|
7511
7658
|
nextStep: "Request fresh context before loading a different set of messages.",
|
|
7512
7659
|
title: "Context Load Already Recorded"
|
|
7513
7660
|
};
|
|
7514
|
-
if (hasFailureCode$
|
|
7661
|
+
if (hasFailureCode$2(input.failure, "center_agent.context_load_selection_duplicate", "center_agent.context_load_selection_invalid")) return {
|
|
7515
7662
|
code: "center_agent.context_load_selection_invalid",
|
|
7516
7663
|
message: "The reported messages do not exactly match the sources and content hashes in this context snapshot.",
|
|
7517
7664
|
nextStep: "Use each loaded message's exact sourceRef.id and materializedContentHash once, or report `--all`.",
|
|
@@ -7523,7 +7670,7 @@ function classifyCenterAgentApiFailure(input) {
|
|
|
7523
7670
|
nextStep: "Retry after OpenMeld Gateway is updated and healthy.",
|
|
7524
7671
|
title: "Center Agent Response Invalid"
|
|
7525
7672
|
};
|
|
7526
|
-
if (hasFailureCode$
|
|
7673
|
+
if (hasFailureCode$2(input.failure, "center_agent.audit_store_unavailable", "center_agent.designation_store_unavailable")) return {
|
|
7527
7674
|
code: "center_agent.store_unavailable",
|
|
7528
7675
|
message: "OpenMeld could not reach the Center Agent designation or audit store.",
|
|
7529
7676
|
nextStep: "Retry after OpenMeld is healthy.",
|
|
@@ -7596,7 +7743,7 @@ function buildFailureDetails$1(failure) {
|
|
|
7596
7743
|
}] : []
|
|
7597
7744
|
];
|
|
7598
7745
|
}
|
|
7599
|
-
function hasFailureCode$
|
|
7746
|
+
function hasFailureCode$2(failure, ...codes) {
|
|
7600
7747
|
return codes.some((code) => failure.code === code || failure.upstreamCode === code);
|
|
7601
7748
|
}
|
|
7602
7749
|
function formatCenterAgentOperationLabel(operation) {
|
|
@@ -8987,7 +9134,7 @@ async function collectObservedDeviceMetadata(input) {
|
|
|
8987
9134
|
return {
|
|
8988
9135
|
observedDisplayName,
|
|
8989
9136
|
platformFamily: resolveObservedPlatformFamily(process.platform),
|
|
8990
|
-
osVersion: normalizeOptionalText$
|
|
9137
|
+
osVersion: normalizeOptionalText$6(release()),
|
|
8991
9138
|
deviceType: resolveObservedDeviceType({
|
|
8992
9139
|
platform: process.platform,
|
|
8993
9140
|
observedDisplayName
|
|
@@ -9000,14 +9147,14 @@ async function resolveObservedDeviceDisplayName() {
|
|
|
9000
9147
|
const computerName = await readMacComputerName();
|
|
9001
9148
|
if (computerName) return computerName;
|
|
9002
9149
|
}
|
|
9003
|
-
if (process.platform === "win32") return normalizeOptionalText$
|
|
9004
|
-
return normalizeOptionalText$
|
|
9150
|
+
if (process.platform === "win32") return normalizeOptionalText$6(process.env.COMPUTERNAME) ?? normalizeOptionalText$6(hostname());
|
|
9151
|
+
return normalizeOptionalText$6(hostname());
|
|
9005
9152
|
}
|
|
9006
9153
|
async function readMacComputerName() {
|
|
9007
9154
|
try {
|
|
9008
|
-
return normalizeOptionalText$
|
|
9155
|
+
return normalizeOptionalText$6((await execFile$1("scutil", ["--get", "ComputerName"])).stdout);
|
|
9009
9156
|
} catch {
|
|
9010
|
-
return normalizeOptionalText$
|
|
9157
|
+
return normalizeOptionalText$6(hostname());
|
|
9011
9158
|
}
|
|
9012
9159
|
}
|
|
9013
9160
|
function resolveObservedPlatformFamily(platform) {
|
|
@@ -9024,7 +9171,7 @@ function resolveObservedDeviceType(input) {
|
|
|
9024
9171
|
if (input.observedDisplayName?.match(DESKTOP_MAC_DISPLAY_NAME_PATTERN)) return "desktop";
|
|
9025
9172
|
return "unknown";
|
|
9026
9173
|
}
|
|
9027
|
-
function normalizeOptionalText$
|
|
9174
|
+
function normalizeOptionalText$6(input) {
|
|
9028
9175
|
const normalized = input?.trim();
|
|
9029
9176
|
return normalized ? normalized : null;
|
|
9030
9177
|
}
|
|
@@ -9034,7 +9181,7 @@ async function runComputerList(input) {
|
|
|
9034
9181
|
const presenter = createPresenter(await resolveRuntimeContext({ view: input.view }));
|
|
9035
9182
|
const currentDeviceApi = createCurrentDeviceApi(createCliApiClientFoundation(await resolveBaseUrl()));
|
|
9036
9183
|
await syncCurrentComputerObservationIfAvailable({ currentDeviceApi });
|
|
9037
|
-
const response = await currentDeviceApi.listLocalRuntimes();
|
|
9184
|
+
const response = await currentDeviceApi.listLocalRuntimes({ includeUsageLimits: "true" });
|
|
9038
9185
|
if (presenter.view === "agent") {
|
|
9039
9186
|
presenter.data({
|
|
9040
9187
|
code: "computer.list.completed",
|
|
@@ -9069,7 +9216,7 @@ async function runComputerCurrent(input) {
|
|
|
9069
9216
|
deviceId,
|
|
9070
9217
|
now: input.now
|
|
9071
9218
|
});
|
|
9072
|
-
const response = await currentDeviceApi.listLocalRuntimes();
|
|
9219
|
+
const response = await currentDeviceApi.listLocalRuntimes({ includeUsageLimits: "true" });
|
|
9073
9220
|
const currentComputer = findLocalRuntime(response, deviceId);
|
|
9074
9221
|
if (presenter.view === "agent") {
|
|
9075
9222
|
const diagnostics = await readCurrentComputerDiagnostics({
|
|
@@ -10540,13 +10687,13 @@ function getManagedCliCommandActivationNotice(activation) {
|
|
|
10540
10687
|
}
|
|
10541
10688
|
async function activateManagedCliCommand(input) {
|
|
10542
10689
|
const env = input.env ?? process.env;
|
|
10543
|
-
if (resolveOpenMeldEnvPreset({ env }) !== "prod" || normalizeOptionalText$
|
|
10544
|
-
const home = normalizeOptionalText$
|
|
10690
|
+
if (resolveOpenMeldEnvPreset({ env }) !== "prod" || normalizeOptionalText$5(env["OPENMELD_HOME"])) return { status: "not_applicable" };
|
|
10691
|
+
const home = normalizeOptionalText$5(env.HOME);
|
|
10545
10692
|
if (!home) return {
|
|
10546
|
-
shell: normalizeOptionalText$
|
|
10693
|
+
shell: normalizeOptionalText$5(env.SHELL),
|
|
10547
10694
|
status: "unsupported_shell"
|
|
10548
10695
|
};
|
|
10549
|
-
const shell = normalizeOptionalText$
|
|
10696
|
+
const shell = normalizeOptionalText$5(env.SHELL);
|
|
10550
10697
|
const profile = resolveShellProfile({
|
|
10551
10698
|
env,
|
|
10552
10699
|
home,
|
|
@@ -10605,7 +10752,7 @@ async function withManagedCliCommandActivationLock(input) {
|
|
|
10605
10752
|
function resolveShellProfile(input) {
|
|
10606
10753
|
const shellName = input.shell ? basename(input.shell) : null;
|
|
10607
10754
|
if (shellName === "zsh") {
|
|
10608
|
-
const zDotDir = normalizeOptionalText$
|
|
10755
|
+
const zDotDir = normalizeOptionalText$5(input.env.ZDOTDIR);
|
|
10609
10756
|
if (zDotDir && !isAbsolute(zDotDir)) return null;
|
|
10610
10757
|
return {
|
|
10611
10758
|
path: join(zDotDir ?? input.home, ".zshrc"),
|
|
@@ -10617,7 +10764,7 @@ function resolveShellProfile(input) {
|
|
|
10617
10764
|
pathLine: POSIX_PATH_LINE
|
|
10618
10765
|
};
|
|
10619
10766
|
if (shellName === "fish") {
|
|
10620
|
-
const configHome = normalizeOptionalText$
|
|
10767
|
+
const configHome = normalizeOptionalText$5(input.env.XDG_CONFIG_HOME);
|
|
10621
10768
|
if (configHome && !isAbsolute(configHome)) return null;
|
|
10622
10769
|
return {
|
|
10623
10770
|
path: join(configHome ?? join(input.home, ".config"), "fish", "conf.d", "openmeld.fish"),
|
|
@@ -10626,7 +10773,7 @@ function resolveShellProfile(input) {
|
|
|
10626
10773
|
}
|
|
10627
10774
|
return null;
|
|
10628
10775
|
}
|
|
10629
|
-
function normalizeOptionalText$
|
|
10776
|
+
function normalizeOptionalText$5(value) {
|
|
10630
10777
|
const normalized = String(value ?? "").trim();
|
|
10631
10778
|
return normalized.length > 0 ? normalized : null;
|
|
10632
10779
|
}
|
|
@@ -11059,7 +11206,7 @@ async function updateAgentProfilePrimaryBindingAgentControllerPermissionMode(inp
|
|
|
11059
11206
|
async function updateAgentProfilePrimaryBindingModelSelection(input) {
|
|
11060
11207
|
const api = createAgentProfileBindingApi(createCliApiClientFoundation(await resolveBaseUrl()));
|
|
11061
11208
|
const modelId = normalizeRequiredText$1(input.modelId, "--model is required.");
|
|
11062
|
-
const reasoningLevel = normalizeOptionalText$
|
|
11209
|
+
const reasoningLevel = normalizeOptionalText$4(input.reasoningLevel);
|
|
11063
11210
|
return await api.updatePrimaryBindingModelSelection({
|
|
11064
11211
|
agentProfileId: input.profile.openMeldProfileId,
|
|
11065
11212
|
modelId,
|
|
@@ -11068,11 +11215,11 @@ async function updateAgentProfilePrimaryBindingModelSelection(input) {
|
|
|
11068
11215
|
});
|
|
11069
11216
|
}
|
|
11070
11217
|
function normalizeRequiredText$1(value, message) {
|
|
11071
|
-
const normalized = normalizeOptionalText$
|
|
11218
|
+
const normalized = normalizeOptionalText$4(value);
|
|
11072
11219
|
if (!normalized) throw new Error(message);
|
|
11073
11220
|
return normalized;
|
|
11074
11221
|
}
|
|
11075
|
-
function normalizeOptionalText$
|
|
11222
|
+
function normalizeOptionalText$4(value) {
|
|
11076
11223
|
const normalized = String(value ?? "").trim();
|
|
11077
11224
|
return normalized.length > 0 ? normalized : null;
|
|
11078
11225
|
}
|
|
@@ -19095,7 +19242,7 @@ async function emitSetupCompleteForDelegatedPath(input) {
|
|
|
19095
19242
|
});
|
|
19096
19243
|
}
|
|
19097
19244
|
async function recordSetupBootstrapResultForPrepareSession(input) {
|
|
19098
|
-
const prepareSessionId = normalizeOptionalText$
|
|
19245
|
+
const prepareSessionId = normalizeOptionalText$3(input.setupSessionSnapshot?.prepareSessionId);
|
|
19099
19246
|
if (!prepareSessionId) return;
|
|
19100
19247
|
try {
|
|
19101
19248
|
await writePrepareSessionSetupBootstrapResult({
|
|
@@ -19430,7 +19577,7 @@ function formatSetupBootstrapHumanSummary(bootstrap) {
|
|
|
19430
19577
|
if (bootstrap.status === "completed") return "Center Agent Home will guide next steps";
|
|
19431
19578
|
return `Not created: ${bootstrap.message}`;
|
|
19432
19579
|
}
|
|
19433
|
-
function normalizeOptionalText$
|
|
19580
|
+
function normalizeOptionalText$3(value) {
|
|
19434
19581
|
const normalized = String(value ?? "").trim();
|
|
19435
19582
|
return normalized.length > 0 ? normalized : null;
|
|
19436
19583
|
}
|
|
@@ -21158,7 +21305,7 @@ async function resolveManagedCliDelegation(input) {
|
|
|
21158
21305
|
if (input.distribution !== "npm" || resolveOpenMeldEnvPreset({
|
|
21159
21306
|
env,
|
|
21160
21307
|
argv: input.argv
|
|
21161
|
-
}) !== "prod" || normalizeOptionalText$
|
|
21308
|
+
}) !== "prod" || normalizeOptionalText$2(env["OPENMELD_HOME"]) || env[MANAGED_CLI_DELEGATION_ENV] === "1" || isServiceCarrierCommand(firstCommand, secondCommand) || args.includes(UPGRADE_INTERNAL_ALIGN_SERVICE_FLAG)) return { status: "stay" };
|
|
21162
21309
|
const managed = await resolveUsableManagedCli({
|
|
21163
21310
|
env,
|
|
21164
21311
|
argv: input.argv
|
|
@@ -21218,7 +21365,7 @@ async function resolveUsableManagedCli(input) {
|
|
|
21218
21365
|
function isServiceCarrierCommand(firstCommand, secondCommand) {
|
|
21219
21366
|
return (firstCommand === "service" || firstCommand === "daemon") && secondCommand === "run";
|
|
21220
21367
|
}
|
|
21221
|
-
function normalizeOptionalText$
|
|
21368
|
+
function normalizeOptionalText$2(value) {
|
|
21222
21369
|
const normalized = String(value ?? "").trim();
|
|
21223
21370
|
return normalized.length > 0 ? normalized : null;
|
|
21224
21371
|
}
|
|
@@ -23017,7 +23164,7 @@ async function runOrgDirectory(input) {
|
|
|
23017
23164
|
}
|
|
23018
23165
|
let directory;
|
|
23019
23166
|
try {
|
|
23020
|
-
directory = await createOrganizationApi(createCliApiClientFoundation(await resolveBaseUrl())).getCurrentDirectory();
|
|
23167
|
+
directory = await createOrganizationApi(createCliApiClientFoundation(await resolveBaseUrl())).getCurrentDirectory({ includeMemberLastActiveAt: true });
|
|
23021
23168
|
} catch (error) {
|
|
23022
23169
|
emitOrganizationApiError({
|
|
23023
23170
|
presenter: context.presenter,
|
|
@@ -23047,6 +23194,53 @@ async function runOrgDirectory(input) {
|
|
|
23047
23194
|
directory
|
|
23048
23195
|
});
|
|
23049
23196
|
}
|
|
23197
|
+
async function runOrgComputers(input) {
|
|
23198
|
+
const context = await resolveOrganizationCommandContext(input);
|
|
23199
|
+
if (!context) return;
|
|
23200
|
+
if (!context.session.activeOrganization) {
|
|
23201
|
+
emitOrganizationCommandError({
|
|
23202
|
+
presenter: context.presenter,
|
|
23203
|
+
cliJsonOutput: context.cliJsonOutput,
|
|
23204
|
+
code: "organization.active_missing",
|
|
23205
|
+
title: "No Active Organization",
|
|
23206
|
+
message: "No active OpenMeld organization is selected.",
|
|
23207
|
+
nextStep: "Run `openmeld org list`, then `openmeld org switch <slug>`.",
|
|
23208
|
+
activeOrganization: null
|
|
23209
|
+
});
|
|
23210
|
+
return;
|
|
23211
|
+
}
|
|
23212
|
+
let computers;
|
|
23213
|
+
try {
|
|
23214
|
+
computers = await createOrganizationApi(createCliApiClientFoundation(await resolveBaseUrl())).getCurrentComputers({ includeUsageLimits: "true" });
|
|
23215
|
+
} catch (error) {
|
|
23216
|
+
emitOrganizationApiError({
|
|
23217
|
+
presenter: context.presenter,
|
|
23218
|
+
error,
|
|
23219
|
+
activeOrganization: context.session.activeOrganization,
|
|
23220
|
+
cliJsonOutput: context.cliJsonOutput
|
|
23221
|
+
});
|
|
23222
|
+
return;
|
|
23223
|
+
}
|
|
23224
|
+
if (context.cliJsonOutput) {
|
|
23225
|
+
emitCliJsonEnvelope({
|
|
23226
|
+
schemaVersion: 1,
|
|
23227
|
+
type: "organization.computers",
|
|
23228
|
+
...computers
|
|
23229
|
+
});
|
|
23230
|
+
return;
|
|
23231
|
+
}
|
|
23232
|
+
if (context.runtime.resolvedView === "agent") {
|
|
23233
|
+
context.presenter.data({
|
|
23234
|
+
code: "organization.computers",
|
|
23235
|
+
payload: computers
|
|
23236
|
+
});
|
|
23237
|
+
return;
|
|
23238
|
+
}
|
|
23239
|
+
renderOrganizationComputersCard({
|
|
23240
|
+
presenter: context.presenter,
|
|
23241
|
+
computers
|
|
23242
|
+
});
|
|
23243
|
+
}
|
|
23050
23244
|
async function runOrgInviteLink(input) {
|
|
23051
23245
|
const context = await resolveOrganizationCommandContext(input);
|
|
23052
23246
|
if (!context) return;
|
|
@@ -23305,6 +23499,32 @@ function renderOrganizationDirectoryCard(input) {
|
|
|
23305
23499
|
minContentWidth: 72
|
|
23306
23500
|
});
|
|
23307
23501
|
}
|
|
23502
|
+
function renderOrganizationComputersCard(input) {
|
|
23503
|
+
renderInfoCard({
|
|
23504
|
+
presenter: input.presenter,
|
|
23505
|
+
title: "Organization Computers",
|
|
23506
|
+
codePrefix: "organization.computers.card",
|
|
23507
|
+
rows: input.computers.computers.length === 0 ? [{
|
|
23508
|
+
label: "Computers",
|
|
23509
|
+
value: "No member computers reported"
|
|
23510
|
+
}] : input.computers.computers.flatMap((computer) => [{
|
|
23511
|
+
label: "Computer",
|
|
23512
|
+
value: `${computer.deviceDisplayName} · ${computer.serviceState}`
|
|
23513
|
+
}, ...computer.localAgents.flatMap((agent) => {
|
|
23514
|
+
const usageLimits = agent.details?.usageLimits ?? [];
|
|
23515
|
+
if (usageLimits.length === 0) return [{
|
|
23516
|
+
label: "Local Agent",
|
|
23517
|
+
value: `${agent.agentControllerRef} · ${agent.status}`
|
|
23518
|
+
}];
|
|
23519
|
+
return usageLimits.map((limit) => ({
|
|
23520
|
+
label: "Local Agent",
|
|
23521
|
+
value: `${agent.agentControllerRef} · ${agent.status} · ${limit.label} · ${limit.usedPercent === null ? limit.status : `${limit.usedPercent}% used · ${limit.status}`}`
|
|
23522
|
+
}));
|
|
23523
|
+
})]),
|
|
23524
|
+
sanitize: true,
|
|
23525
|
+
minContentWidth: 72
|
|
23526
|
+
});
|
|
23527
|
+
}
|
|
23308
23528
|
function renderOrganizationInviteLinkCard(input) {
|
|
23309
23529
|
renderInfoCard({
|
|
23310
23530
|
presenter: input.presenter,
|
|
@@ -23878,6 +24098,527 @@ function hasExplicitProfileUpdateField(input) {
|
|
|
23878
24098
|
return typeof input.name === "string" || typeof input.agentController === "string" || typeof input.agentControllerConversationId === "string" || typeof input.agentControllerPermissionMode === "string" || typeof input.model === "string" || typeof input.reasoningEffort === "string" || typeof input.workspaceMode === "string" || typeof input.workspacePath === "string";
|
|
23879
24099
|
}
|
|
23880
24100
|
//#endregion
|
|
24101
|
+
//#region src/profile-creation-request/input.ts
|
|
24102
|
+
var ProfileCreationRequestCliError = class extends Error {
|
|
24103
|
+
code;
|
|
24104
|
+
nextStep;
|
|
24105
|
+
title;
|
|
24106
|
+
constructor(input) {
|
|
24107
|
+
super(input.message);
|
|
24108
|
+
this.name = "ProfileCreationRequestCliError";
|
|
24109
|
+
this.code = input.code;
|
|
24110
|
+
this.nextStep = input.nextStep;
|
|
24111
|
+
this.title = input.title;
|
|
24112
|
+
}
|
|
24113
|
+
};
|
|
24114
|
+
function resolveTargetOwnerUserId(input) {
|
|
24115
|
+
const value = requireText(input.value, "Target owner");
|
|
24116
|
+
if (value.toLowerCase() !== "self") return value;
|
|
24117
|
+
if (input.callerUserId) return input.callerUserId;
|
|
24118
|
+
throw new ProfileCreationRequestCliError({
|
|
24119
|
+
code: "profile.creation_request.owner_identity_unavailable",
|
|
24120
|
+
message: "OpenMeld could not resolve your user ID from the current sign-in.",
|
|
24121
|
+
nextStep: "Run `openmeld org directory --view agent`, then pass `--owner <user-id>`.",
|
|
24122
|
+
title: "Target Owner Needed"
|
|
24123
|
+
});
|
|
24124
|
+
}
|
|
24125
|
+
function parseSessionStrategy(value) {
|
|
24126
|
+
const normalized = normalizeOptionalText$1(value)?.toLowerCase() ?? "new";
|
|
24127
|
+
if (normalized === "new" || normalized === "resume" || normalized === "fork") return normalized;
|
|
24128
|
+
throw new ProfileCreationRequestCliError({
|
|
24129
|
+
code: "profile.creation_request.session_strategy_invalid",
|
|
24130
|
+
message: "Session must be new, resume, or fork.",
|
|
24131
|
+
nextStep: "Pass `--session new`, `--session resume`, or `--session fork`.",
|
|
24132
|
+
title: "Session Strategy Invalid"
|
|
24133
|
+
});
|
|
24134
|
+
}
|
|
24135
|
+
function parseRequestSource(value) {
|
|
24136
|
+
const normalized = normalizeOptionalText$1(value)?.toLowerCase().replaceAll("-", "_") ?? "cli";
|
|
24137
|
+
if (normalized === "cli" || normalized === "local_agent") return normalized;
|
|
24138
|
+
throw new ProfileCreationRequestCliError({
|
|
24139
|
+
code: "profile.creation_request.source_invalid",
|
|
24140
|
+
message: "CLI requests must identify their source as CLI or Local Agent.",
|
|
24141
|
+
nextStep: "Pass `--source cli` or `--source local-agent`.",
|
|
24142
|
+
title: "Request Source Invalid"
|
|
24143
|
+
});
|
|
24144
|
+
}
|
|
24145
|
+
function parseApprovalPolicy(value, label) {
|
|
24146
|
+
const normalized = normalizeOptionalText$1(value)?.toLowerCase().replaceAll("-", "_");
|
|
24147
|
+
if (normalized === "never_allow" || normalized === "ask_every_time" || normalized === "automatically_allow") return normalized;
|
|
24148
|
+
throw new ProfileCreationRequestCliError({
|
|
24149
|
+
code: "profile.creation_request.approval_policy_invalid",
|
|
24150
|
+
message: `${label} must be never-allow, ask-every-time, or automatically-allow.`,
|
|
24151
|
+
nextStep: "Use one of the approval policies shown by `openmeld profiles requests preferences set --help`.",
|
|
24152
|
+
title: "Approval Policy Invalid"
|
|
24153
|
+
});
|
|
24154
|
+
}
|
|
24155
|
+
function validateNativeSessionInput(input) {
|
|
24156
|
+
if (input.sessionStrategy === "new" && input.nativeSessionId) throw new ProfileCreationRequestCliError({
|
|
24157
|
+
code: "profile.creation_request.native_session_unexpected",
|
|
24158
|
+
message: "A new-session request cannot include a native Session ID.",
|
|
24159
|
+
nextStep: "Remove `--native-session`, or choose resume or fork.",
|
|
24160
|
+
title: "Native Session Not Needed"
|
|
24161
|
+
});
|
|
24162
|
+
if (input.sessionStrategy !== "new" && !input.nativeSessionId) throw new ProfileCreationRequestCliError({
|
|
24163
|
+
code: "profile.creation_request.native_session_required",
|
|
24164
|
+
message: "Resume and fork requests require the native Session ID.",
|
|
24165
|
+
nextStep: "Pass `--native-session <provider-session-id>`.",
|
|
24166
|
+
title: "Native Session Needed"
|
|
24167
|
+
});
|
|
24168
|
+
}
|
|
24169
|
+
function requireText(value, label) {
|
|
24170
|
+
const normalized = normalizeOptionalText$1(value);
|
|
24171
|
+
if (normalized) return normalized;
|
|
24172
|
+
throw new ProfileCreationRequestCliError({
|
|
24173
|
+
code: "profile.creation_request.argument_required",
|
|
24174
|
+
message: `${label} is required.`,
|
|
24175
|
+
nextStep: "Run this command with `--help` to see the required arguments.",
|
|
24176
|
+
title: `${label} Needed`
|
|
24177
|
+
});
|
|
24178
|
+
}
|
|
24179
|
+
function normalizeOptionalText$1(value) {
|
|
24180
|
+
if (typeof value !== "string") return;
|
|
24181
|
+
const normalized = value.trim();
|
|
24182
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
24183
|
+
}
|
|
24184
|
+
//#endregion
|
|
24185
|
+
//#region src/profile-creation-request/presentation.ts
|
|
24186
|
+
function emitRequest(input) {
|
|
24187
|
+
if (input.context.runtime.resolvedView === "agent") {
|
|
24188
|
+
input.context.presenter.data({
|
|
24189
|
+
code: input.code,
|
|
24190
|
+
payload: {
|
|
24191
|
+
organization: input.context.organization,
|
|
24192
|
+
...input.replayed === void 0 ? {} : { replayed: input.replayed },
|
|
24193
|
+
request: input.request
|
|
24194
|
+
}
|
|
24195
|
+
});
|
|
24196
|
+
return;
|
|
24197
|
+
}
|
|
24198
|
+
renderInfoCard({
|
|
24199
|
+
codePrefix: "profile.creation-request.card",
|
|
24200
|
+
minContentWidth: 72,
|
|
24201
|
+
presenter: input.context.presenter,
|
|
24202
|
+
rows: buildRequestRows(input.request),
|
|
24203
|
+
sanitize: true,
|
|
24204
|
+
title: input.title
|
|
24205
|
+
});
|
|
24206
|
+
}
|
|
24207
|
+
function emitRequestList(input) {
|
|
24208
|
+
if (input.requests.length === 0) {
|
|
24209
|
+
renderInfoCard({
|
|
24210
|
+
codePrefix: "profile.creation-request.list.card",
|
|
24211
|
+
minContentWidth: 72,
|
|
24212
|
+
presenter: input.context.presenter,
|
|
24213
|
+
rows: [{
|
|
24214
|
+
label: "Organization",
|
|
24215
|
+
value: input.context.organization.name
|
|
24216
|
+
}, {
|
|
24217
|
+
label: "Requests",
|
|
24218
|
+
value: "No Agent Profile requests yet."
|
|
24219
|
+
}],
|
|
24220
|
+
sanitize: true,
|
|
24221
|
+
title: "Agent Profile Requests"
|
|
24222
|
+
});
|
|
24223
|
+
return;
|
|
24224
|
+
}
|
|
24225
|
+
for (const request of input.requests) renderInfoCard({
|
|
24226
|
+
codePrefix: "profile.creation-request.list.card",
|
|
24227
|
+
compact: true,
|
|
24228
|
+
minContentWidth: 72,
|
|
24229
|
+
presenter: input.context.presenter,
|
|
24230
|
+
rows: buildRequestRows(request),
|
|
24231
|
+
sanitize: true,
|
|
24232
|
+
title: request.profileName
|
|
24233
|
+
});
|
|
24234
|
+
}
|
|
24235
|
+
function emitPreference(input) {
|
|
24236
|
+
if (input.context.runtime.resolvedView === "agent") {
|
|
24237
|
+
input.context.presenter.data({
|
|
24238
|
+
code: "profile.creation_request.preferences",
|
|
24239
|
+
payload: { preference: input.preference }
|
|
24240
|
+
});
|
|
24241
|
+
return;
|
|
24242
|
+
}
|
|
24243
|
+
renderInfoCard({
|
|
24244
|
+
codePrefix: "profile.creation-request.preferences.card",
|
|
24245
|
+
minContentWidth: 72,
|
|
24246
|
+
presenter: input.context.presenter,
|
|
24247
|
+
rows: [{
|
|
24248
|
+
label: "New Sessions",
|
|
24249
|
+
value: input.preference.newSessionPolicy
|
|
24250
|
+
}, {
|
|
24251
|
+
label: "Existing Sessions",
|
|
24252
|
+
value: input.preference.existingSessionPolicy
|
|
24253
|
+
}],
|
|
24254
|
+
sanitize: true,
|
|
24255
|
+
title: input.title
|
|
24256
|
+
});
|
|
24257
|
+
}
|
|
24258
|
+
function emitCommandError(input) {
|
|
24259
|
+
if (input.error instanceof ProfileCreationRequestCliError) {
|
|
24260
|
+
emitLocalError({
|
|
24261
|
+
code: input.error.code,
|
|
24262
|
+
message: input.error.message,
|
|
24263
|
+
nextStep: input.error.nextStep,
|
|
24264
|
+
presenter: input.context.presenter,
|
|
24265
|
+
title: input.error.title
|
|
24266
|
+
});
|
|
24267
|
+
return;
|
|
24268
|
+
}
|
|
24269
|
+
const failure = toStructuredApiClientFailure(input.error);
|
|
24270
|
+
const sessionUnavailable = hasFailureCode$1(failure, "agent_profile_creation_request.session_strategy_unavailable");
|
|
24271
|
+
emitLocalError({
|
|
24272
|
+
code: failure.code ?? `profile.creation_request.${input.operation}_failed`,
|
|
24273
|
+
details: [...failure.status === null ? [] : [{
|
|
24274
|
+
label: "HTTP Status",
|
|
24275
|
+
value: String(failure.status)
|
|
24276
|
+
}], ...failure.requestId ? [{
|
|
24277
|
+
label: "Request ID",
|
|
24278
|
+
value: failure.requestId
|
|
24279
|
+
}] : []],
|
|
24280
|
+
message: sessionUnavailable ? "OpenMeld cannot verify Resume or Fork against the selected local Session yet." : `OpenMeld could not ${input.operation} this Agent Profile request.`,
|
|
24281
|
+
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.",
|
|
24282
|
+
presenter: input.context.presenter,
|
|
24283
|
+
title: sessionUnavailable ? "Resume And Fork Not Ready" : "Agent Profile Request Failed"
|
|
24284
|
+
});
|
|
24285
|
+
}
|
|
24286
|
+
function emitLocalError(input) {
|
|
24287
|
+
process.exitCode = 1;
|
|
24288
|
+
if (input.presenter.view === "agent") {
|
|
24289
|
+
input.presenter.data({
|
|
24290
|
+
code: input.code,
|
|
24291
|
+
payload: {
|
|
24292
|
+
status: "error",
|
|
24293
|
+
error: {
|
|
24294
|
+
code: input.code,
|
|
24295
|
+
message: input.message,
|
|
24296
|
+
nextStep: input.nextStep
|
|
24297
|
+
}
|
|
24298
|
+
}
|
|
24299
|
+
});
|
|
24300
|
+
return;
|
|
24301
|
+
}
|
|
24302
|
+
renderInfoCard({
|
|
24303
|
+
codePrefix: "profile.creation-request.error.card",
|
|
24304
|
+
minContentWidth: 72,
|
|
24305
|
+
presenter: input.presenter,
|
|
24306
|
+
rows: [
|
|
24307
|
+
{
|
|
24308
|
+
label: "Reason",
|
|
24309
|
+
value: input.message
|
|
24310
|
+
},
|
|
24311
|
+
{
|
|
24312
|
+
label: "Next Step",
|
|
24313
|
+
value: input.nextStep
|
|
24314
|
+
},
|
|
24315
|
+
...input.details ?? []
|
|
24316
|
+
],
|
|
24317
|
+
sanitize: true,
|
|
24318
|
+
title: input.title
|
|
24319
|
+
});
|
|
24320
|
+
}
|
|
24321
|
+
function buildRequestRows(request) {
|
|
24322
|
+
return [
|
|
24323
|
+
{
|
|
24324
|
+
label: "Status",
|
|
24325
|
+
value: request.status
|
|
24326
|
+
},
|
|
24327
|
+
{
|
|
24328
|
+
label: "Request ID",
|
|
24329
|
+
value: request.id
|
|
24330
|
+
},
|
|
24331
|
+
{
|
|
24332
|
+
label: "Target Owner",
|
|
24333
|
+
value: request.targetOwnerUserId
|
|
24334
|
+
},
|
|
24335
|
+
{
|
|
24336
|
+
label: "Session",
|
|
24337
|
+
value: request.sessionStrategy
|
|
24338
|
+
},
|
|
24339
|
+
...request.nativeSessionId ? [{
|
|
24340
|
+
label: "Native Session ID",
|
|
24341
|
+
value: request.nativeSessionId
|
|
24342
|
+
}] : [],
|
|
24343
|
+
{
|
|
24344
|
+
label: "Requested By",
|
|
24345
|
+
value: request.requesterUserId
|
|
24346
|
+
},
|
|
24347
|
+
{
|
|
24348
|
+
label: "Source",
|
|
24349
|
+
value: request.source
|
|
24350
|
+
},
|
|
24351
|
+
...request.createdAgentProfileId ? [{
|
|
24352
|
+
label: "Created Agent Profile",
|
|
24353
|
+
value: request.createdAgentProfileId
|
|
24354
|
+
}] : []
|
|
24355
|
+
];
|
|
24356
|
+
}
|
|
24357
|
+
function hasFailureCode$1(failure, code) {
|
|
24358
|
+
return failure.code === code || failure.upstreamCode === code;
|
|
24359
|
+
}
|
|
24360
|
+
//#endregion
|
|
24361
|
+
//#region src/profile-creation-request/context.ts
|
|
24362
|
+
async function resolveProfileCreationRequestCommandContext(input) {
|
|
24363
|
+
const runtime = await resolveRuntimeContext({ view: input.view });
|
|
24364
|
+
const presenter = createPresenter(runtime);
|
|
24365
|
+
const authState = await getAuthSessionState({ validateRemote: true });
|
|
24366
|
+
if (authState.state !== "valid" || !authState.session) {
|
|
24367
|
+
emitLocalError({
|
|
24368
|
+
code: "profile.creation_request.auth_required",
|
|
24369
|
+
message: "Sign in to OpenMeld before managing Agent Profile requests.",
|
|
24370
|
+
nextStep: "Run `openmeld login`, then retry this command.",
|
|
24371
|
+
presenter,
|
|
24372
|
+
title: "Sign In Needed"
|
|
24373
|
+
});
|
|
24374
|
+
return null;
|
|
24375
|
+
}
|
|
24376
|
+
try {
|
|
24377
|
+
const [organizations, selection] = await Promise.all([listAuthOrganizations(authState.session), getAuthOrganizationSelection(authState.session)]);
|
|
24378
|
+
const organization = resolveOrganization({
|
|
24379
|
+
organizations,
|
|
24380
|
+
selectedOrganizationId: selection.lastSelectedOrganizationId ?? selection.activeOrganizationId,
|
|
24381
|
+
selector: input.organization
|
|
24382
|
+
});
|
|
24383
|
+
if (!organization) {
|
|
24384
|
+
emitLocalError({
|
|
24385
|
+
code: "profile.creation_request.organization_required",
|
|
24386
|
+
message: input.organization ? `No Organization with the slug or ID "${input.organization}" is available to this account.` : "OpenMeld could not resolve the current Organization for this request.",
|
|
24387
|
+
nextStep: "Run `openmeld org list`, then retry with `--organization <slug-or-id>`.",
|
|
24388
|
+
presenter,
|
|
24389
|
+
title: "Organization Needed"
|
|
24390
|
+
});
|
|
24391
|
+
return null;
|
|
24392
|
+
}
|
|
24393
|
+
return {
|
|
24394
|
+
api: createOrganizationApi(createCliApiClientFoundation(await resolveBaseUrl(), { organizationId: organization.id })),
|
|
24395
|
+
callerUserId: normalizeOptionalText$1(authState.session.user?.id) ?? null,
|
|
24396
|
+
organization,
|
|
24397
|
+
presenter,
|
|
24398
|
+
runtime
|
|
24399
|
+
};
|
|
24400
|
+
} catch (error) {
|
|
24401
|
+
emitCommandError({
|
|
24402
|
+
context: {
|
|
24403
|
+
api: null,
|
|
24404
|
+
callerUserId: normalizeOptionalText$1(authState.session.user?.id) ?? null,
|
|
24405
|
+
organization: authState.session.activeOrganization ?? fallbackOrganization(),
|
|
24406
|
+
presenter,
|
|
24407
|
+
runtime
|
|
24408
|
+
},
|
|
24409
|
+
error,
|
|
24410
|
+
operation: "resolve Organization"
|
|
24411
|
+
});
|
|
24412
|
+
return null;
|
|
24413
|
+
}
|
|
24414
|
+
}
|
|
24415
|
+
function resolveOrganization(input) {
|
|
24416
|
+
const selector = normalizeOptionalText$1(input.selector);
|
|
24417
|
+
if (selector) {
|
|
24418
|
+
const normalizedSlug = selector.toLowerCase();
|
|
24419
|
+
return input.organizations.find((organization) => organization.id === selector || organization.slug.toLowerCase() === normalizedSlug) ?? null;
|
|
24420
|
+
}
|
|
24421
|
+
return input.organizations.find((organization) => organization.id === input.selectedOrganizationId) ?? null;
|
|
24422
|
+
}
|
|
24423
|
+
function fallbackOrganization() {
|
|
24424
|
+
return {
|
|
24425
|
+
id: "unresolved",
|
|
24426
|
+
name: "Unresolved Organization",
|
|
24427
|
+
slug: "unresolved"
|
|
24428
|
+
};
|
|
24429
|
+
}
|
|
24430
|
+
//#endregion
|
|
24431
|
+
//#region src/profile-creation-request/command.ts
|
|
24432
|
+
async function runProfileCreationRequestCreate(input) {
|
|
24433
|
+
const context = await resolveProfileCreationRequestCommandContext(input);
|
|
24434
|
+
if (!context) return;
|
|
24435
|
+
try {
|
|
24436
|
+
const profileName = requireText(input.profileName, "Agent Profile name");
|
|
24437
|
+
const sessionStrategy = parseSessionStrategy(input.sessionStrategy);
|
|
24438
|
+
const nativeSessionId = normalizeOptionalText$1(input.nativeSessionId);
|
|
24439
|
+
validateNativeSessionInput({
|
|
24440
|
+
nativeSessionId,
|
|
24441
|
+
sessionStrategy
|
|
24442
|
+
});
|
|
24443
|
+
const targetOwnerUserId = resolveTargetOwnerUserId({
|
|
24444
|
+
callerUserId: context.callerUserId,
|
|
24445
|
+
value: input.targetOwner
|
|
24446
|
+
});
|
|
24447
|
+
const configuration = await resolveRequestConfiguration(input);
|
|
24448
|
+
const response = await context.api.createAgentProfileCreationRequest({
|
|
24449
|
+
configuration,
|
|
24450
|
+
idempotencyKey: normalizeOptionalText$1(input.idempotencyKey) ?? randomUUID(),
|
|
24451
|
+
nativeSessionId,
|
|
24452
|
+
organizationId: context.organization.id,
|
|
24453
|
+
profileName,
|
|
24454
|
+
requestedSpaceId: normalizeOptionalText$1(input.requestedSpaceId),
|
|
24455
|
+
sessionStrategy,
|
|
24456
|
+
source: parseRequestSource(input.source),
|
|
24457
|
+
targetOwnerUserId
|
|
24458
|
+
});
|
|
24459
|
+
emitRequest({
|
|
24460
|
+
code: "profile.creation_request.created",
|
|
24461
|
+
context,
|
|
24462
|
+
replayed: response.replayed,
|
|
24463
|
+
request: response.request,
|
|
24464
|
+
title: response.replayed ? "Agent Profile Request Reused" : "Agent Profile Request Created"
|
|
24465
|
+
});
|
|
24466
|
+
} catch (error) {
|
|
24467
|
+
emitCommandError({
|
|
24468
|
+
context,
|
|
24469
|
+
error,
|
|
24470
|
+
operation: "create"
|
|
24471
|
+
});
|
|
24472
|
+
}
|
|
24473
|
+
}
|
|
24474
|
+
async function resolveRequestConfiguration(input) {
|
|
24475
|
+
const agentControllerRef = normalizeOptionalText$1(input.agentController);
|
|
24476
|
+
const targetComputerId = normalizeOptionalText$1(input.targetComputerId);
|
|
24477
|
+
if (Boolean(agentControllerRef) !== Boolean(targetComputerId)) throw new Error("--agent-controller and --computer must be provided together for a creation request.");
|
|
24478
|
+
const permissionMode = await resolveAgentControllerPermissionModeInput({
|
|
24479
|
+
agentControllerRef,
|
|
24480
|
+
agentControllerPermissionModeInput: input.agentControllerPermissionModeInput,
|
|
24481
|
+
allowPrompt: false,
|
|
24482
|
+
confirmDangerousAgentControllerPermissionMode: input.confirmDangerousAgentControllerPermissionMode,
|
|
24483
|
+
flagName: "--agent-controller-permission-mode"
|
|
24484
|
+
});
|
|
24485
|
+
return agentProfileCreationConfigurationSchema.parse({
|
|
24486
|
+
...DEFAULT_AGENT_PROFILE_CREATION_CONFIGURATION,
|
|
24487
|
+
agentControllerPermissionMode: permissionMode.agentControllerPermissionMode ?? null,
|
|
24488
|
+
agentControllerRef: agentControllerRef ?? null,
|
|
24489
|
+
authorizeForOrganization: input.authorizeForOrganization !== false,
|
|
24490
|
+
defaultProjectId: normalizeOptionalText$1(input.defaultProjectId) ?? null,
|
|
24491
|
+
modelId: normalizeOptionalText$1(input.modelId) ?? null,
|
|
24492
|
+
reasoningLevel: normalizeOptionalText$1(input.reasoningLevel) ?? null,
|
|
24493
|
+
targetComputerId: targetComputerId ?? null
|
|
24494
|
+
});
|
|
24495
|
+
}
|
|
24496
|
+
async function runProfileCreationRequestList(input = {}) {
|
|
24497
|
+
const context = await resolveProfileCreationRequestCommandContext(input);
|
|
24498
|
+
if (!context) return;
|
|
24499
|
+
try {
|
|
24500
|
+
const response = await context.api.listAgentProfileCreationRequests({ organizationId: context.organization.id });
|
|
24501
|
+
if (context.runtime.resolvedView === "agent") {
|
|
24502
|
+
context.presenter.data({
|
|
24503
|
+
code: "profile.creation_request.list",
|
|
24504
|
+
payload: response
|
|
24505
|
+
});
|
|
24506
|
+
return;
|
|
24507
|
+
}
|
|
24508
|
+
emitRequestList({
|
|
24509
|
+
context,
|
|
24510
|
+
requests: response.requests
|
|
24511
|
+
});
|
|
24512
|
+
} catch (error) {
|
|
24513
|
+
emitCommandError({
|
|
24514
|
+
context,
|
|
24515
|
+
error,
|
|
24516
|
+
operation: "list"
|
|
24517
|
+
});
|
|
24518
|
+
}
|
|
24519
|
+
}
|
|
24520
|
+
async function runProfileCreationRequestDecide(input) {
|
|
24521
|
+
const context = await resolveProfileCreationRequestCommandContext(input);
|
|
24522
|
+
if (!context) return;
|
|
24523
|
+
try {
|
|
24524
|
+
const response = await context.api.decideAgentProfileCreationRequest({
|
|
24525
|
+
decision: input.decision,
|
|
24526
|
+
organizationId: context.organization.id,
|
|
24527
|
+
requestId: requireText(input.requestId, "Request ID")
|
|
24528
|
+
});
|
|
24529
|
+
emitRequest({
|
|
24530
|
+
code: `profile.creation_request.${input.decision}`,
|
|
24531
|
+
context,
|
|
24532
|
+
request: response.request,
|
|
24533
|
+
title: input.decision === "approve" ? "Agent Profile Request Approved" : "Agent Profile Request Declined"
|
|
24534
|
+
});
|
|
24535
|
+
} catch (error) {
|
|
24536
|
+
emitCommandError({
|
|
24537
|
+
context,
|
|
24538
|
+
error,
|
|
24539
|
+
operation: input.decision
|
|
24540
|
+
});
|
|
24541
|
+
}
|
|
24542
|
+
}
|
|
24543
|
+
async function runProfileCreationRequestCancel(input) {
|
|
24544
|
+
await runRequestMutation({
|
|
24545
|
+
...input,
|
|
24546
|
+
action: "cancel",
|
|
24547
|
+
title: "Agent Profile Request Cancelled"
|
|
24548
|
+
});
|
|
24549
|
+
}
|
|
24550
|
+
async function runProfileCreationRequestRetry(input) {
|
|
24551
|
+
await runRequestMutation({
|
|
24552
|
+
...input,
|
|
24553
|
+
action: "retry",
|
|
24554
|
+
title: "Agent Profile Request Retried"
|
|
24555
|
+
});
|
|
24556
|
+
}
|
|
24557
|
+
async function runProfileCreationRequestPreferenceGet(input = {}) {
|
|
24558
|
+
const context = await resolveProfileCreationRequestCommandContext(input);
|
|
24559
|
+
if (!context) return;
|
|
24560
|
+
try {
|
|
24561
|
+
emitPreference({
|
|
24562
|
+
context,
|
|
24563
|
+
preference: await context.api.getAgentProfileCreationApprovalPreference({ organizationId: context.organization.id }),
|
|
24564
|
+
title: "Agent Creation Approvals"
|
|
24565
|
+
});
|
|
24566
|
+
} catch (error) {
|
|
24567
|
+
emitCommandError({
|
|
24568
|
+
context,
|
|
24569
|
+
error,
|
|
24570
|
+
operation: "read preferences"
|
|
24571
|
+
});
|
|
24572
|
+
}
|
|
24573
|
+
}
|
|
24574
|
+
async function runProfileCreationRequestPreferenceSet(input) {
|
|
24575
|
+
const context = await resolveProfileCreationRequestCommandContext(input);
|
|
24576
|
+
if (!context) return;
|
|
24577
|
+
try {
|
|
24578
|
+
emitPreference({
|
|
24579
|
+
context,
|
|
24580
|
+
preference: await context.api.setAgentProfileCreationApprovalPreference({
|
|
24581
|
+
existingSessionPolicy: parseApprovalPolicy(input.existingSessionPolicy, "Existing-session policy"),
|
|
24582
|
+
newSessionPolicy: parseApprovalPolicy(input.newSessionPolicy, "New-session policy"),
|
|
24583
|
+
organizationId: context.organization.id
|
|
24584
|
+
}),
|
|
24585
|
+
title: "Agent Creation Approvals Updated"
|
|
24586
|
+
});
|
|
24587
|
+
} catch (error) {
|
|
24588
|
+
emitCommandError({
|
|
24589
|
+
context,
|
|
24590
|
+
error,
|
|
24591
|
+
operation: "update preferences"
|
|
24592
|
+
});
|
|
24593
|
+
}
|
|
24594
|
+
}
|
|
24595
|
+
async function runRequestMutation(input) {
|
|
24596
|
+
const context = await resolveProfileCreationRequestCommandContext(input);
|
|
24597
|
+
if (!context) return;
|
|
24598
|
+
try {
|
|
24599
|
+
const requestId = requireText(input.requestId, "Request ID");
|
|
24600
|
+
const response = input.action === "cancel" ? await context.api.cancelAgentProfileCreationRequest({
|
|
24601
|
+
organizationId: context.organization.id,
|
|
24602
|
+
requestId
|
|
24603
|
+
}) : await context.api.retryAgentProfileCreationRequest({
|
|
24604
|
+
organizationId: context.organization.id,
|
|
24605
|
+
requestId
|
|
24606
|
+
});
|
|
24607
|
+
emitRequest({
|
|
24608
|
+
code: `profile.creation_request.${input.action}`,
|
|
24609
|
+
context,
|
|
24610
|
+
request: response.request,
|
|
24611
|
+
title: input.title
|
|
24612
|
+
});
|
|
24613
|
+
} catch (error) {
|
|
24614
|
+
emitCommandError({
|
|
24615
|
+
context,
|
|
24616
|
+
error,
|
|
24617
|
+
operation: input.action
|
|
24618
|
+
});
|
|
24619
|
+
}
|
|
24620
|
+
}
|
|
24621
|
+
//#endregion
|
|
23881
24622
|
//#region ../../node_modules/.pnpm/croner@10.0.1/node_modules/croner/dist/croner.js
|
|
23882
24623
|
function T(s) {
|
|
23883
24624
|
return Date.UTC(s.y, s.m - 1, s.d, s.h, s.i, s.s);
|
|
@@ -26501,7 +27242,7 @@ function normalizeOptionalString(value) {
|
|
|
26501
27242
|
return normalized.length > 0 ? normalized : null;
|
|
26502
27243
|
}
|
|
26503
27244
|
async function runDefaultSpaceAddMeMembership(input) {
|
|
26504
|
-
const { runSpaceAddMeMembership } = await import("./add-me-membership-
|
|
27245
|
+
const { runSpaceAddMeMembership } = await import("./add-me-membership-BP7P_X-r.js");
|
|
26505
27246
|
return await runSpaceAddMeMembership(input);
|
|
26506
27247
|
}
|
|
26507
27248
|
//#endregion
|
|
@@ -29802,6 +30543,21 @@ orgCmd.command("directory").description("List Organization members and Agent Pro
|
|
|
29802
30543
|
}
|
|
29803
30544
|
});
|
|
29804
30545
|
});
|
|
30546
|
+
orgCmd.command("computers").description("List member Computers and team-safe Local Agent details.").option("--json", "Print one machine-readable JSON envelope.", false).action(async (opts) => {
|
|
30547
|
+
const json = opts.json === true;
|
|
30548
|
+
const view = json ? "agent" : getGlobalViewOption();
|
|
30549
|
+
await runCommandWithEntryChecks({
|
|
30550
|
+
jsonOutput: json,
|
|
30551
|
+
routeTokens: ["org", "computers"],
|
|
30552
|
+
view,
|
|
30553
|
+
run: async () => {
|
|
30554
|
+
await runOrgComputers({
|
|
30555
|
+
json,
|
|
30556
|
+
view
|
|
30557
|
+
});
|
|
30558
|
+
}
|
|
30559
|
+
});
|
|
30560
|
+
});
|
|
29805
30561
|
const orgInviteLinkCmd = orgCmd.command("invite-link").description("Manage the active Organization invite link.");
|
|
29806
30562
|
for (const action of [
|
|
29807
30563
|
"get",
|
|
@@ -30226,6 +30982,7 @@ registerAgentActivityCommands(program, {
|
|
|
30226
30982
|
hook: runActivityHook,
|
|
30227
30983
|
install: runActivityInstall,
|
|
30228
30984
|
read: runAgentActivityRead,
|
|
30985
|
+
sessions: runAgentActivitySessions,
|
|
30229
30986
|
status: runActivityStatus,
|
|
30230
30987
|
sync: runActivitySync,
|
|
30231
30988
|
uninstall: runActivityUninstall
|
|
@@ -31931,7 +32688,7 @@ profileCmd.action(async () => {
|
|
|
31931
32688
|
}
|
|
31932
32689
|
});
|
|
31933
32690
|
});
|
|
31934
|
-
profileCmd.command("create").description("Create an Agent Profile, or an additional Human Profile when enabled.").argument("[profileName]", "OpenMeld profile name").option("--name <profileName>", "OpenMeld profile name").option("--kind <kind>", "Profile kind (agent; human when additional Human Profile creation is enabled)").option("--agent-controller <ref>", "Agent controller for this profile, such as builtin:codex or custom:reviewer").option("--agent-controller-conversation-id <id>", "Private Agent Controller conversation ID for this Agent Profile").option("--model <modelId>", "Model intent for this Agent Profile Binding").option("--reasoning-effort <level>", "Reasoning effort intent for the selected model").option("--agent-controller-permission-mode <policy>", formatAgentControllerPermissionModeHelp()).option("--confirm-dangerous-agent-controller-permission-mode", "Confirm a dangerous Agent Controller Permission Mode without prompting", false).action(async (profileName, opts) => {
|
|
32691
|
+
profileCmd.command("create").description("Create an Agent Profile, or an additional Human Profile when enabled.").argument("[profileName]", "OpenMeld profile name").option("--name <profileName>", "OpenMeld profile name").option("--kind <kind>", "Profile kind (agent; human when additional Human Profile creation is enabled)").option("--agent-controller <ref>", "Agent controller for this profile, such as builtin:codex or custom:reviewer").option("--agent-controller-conversation-id <id>", "Private Agent Controller conversation ID for this Agent Profile").option("--model <modelId>", "Model intent for this Agent Profile Binding").option("--reasoning-effort <level>", "Reasoning effort intent for the selected model").option("--agent-controller-permission-mode <policy>", formatAgentControllerPermissionModeHelp()).option("--confirm-dangerous-agent-controller-permission-mode", "Confirm a dangerous Agent Controller Permission Mode without prompting", false).option("--owner <userId>", "Create for a member from `openmeld org directory --view agent`, or self").option("--computer <computerId>", "Exact Organization-visible Computer for a teammate-owned Agent").option("--project <projectId>", "Default Project for the new Agent").option("--session <strategy>", "Session strategy for an owner request: new, resume, or fork", "new").option("--native-session <id>", "Native provider Session ID required for resume or fork").option("--space <spaceId>", "Add the created Agent to this Space").option("--source <source>", "Request source: cli or local-agent", "cli").option("--request-key <key>", "Stable idempotency key for safely retrying an owner request").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").option("--no-organization-wake-access", "Do not request Organization Wake access for the selected Binding").action(async (profileName, opts) => {
|
|
31935
32692
|
const outputView = await resolveEffectiveViewForOutput();
|
|
31936
32693
|
const targetName = (typeof profileName === "string" ? profileName : void 0) ?? opts.name;
|
|
31937
32694
|
if (outputView === "agent") {
|
|
@@ -31943,6 +32700,29 @@ profileCmd.command("create").description("Create an Agent Profile, or an additio
|
|
|
31943
32700
|
routeTokens: ["profile", "create"],
|
|
31944
32701
|
view,
|
|
31945
32702
|
run: async () => {
|
|
32703
|
+
if (typeof opts.owner === "string") {
|
|
32704
|
+
if (typeof opts.kind === "string" && opts.kind.trim().toLowerCase() !== "agent") throw createProfileCreateGuideError("--owner can only create an Agent Profile; pass --kind agent.");
|
|
32705
|
+
await runProfileCreationRequestCreate({
|
|
32706
|
+
agentController: opts.agentController,
|
|
32707
|
+
agentControllerPermissionModeInput: opts.agentControllerPermissionMode,
|
|
32708
|
+
authorizeForOrganization: opts.organizationWakeAccess,
|
|
32709
|
+
confirmDangerousAgentControllerPermissionMode: Boolean(opts.confirmDangerousAgentControllerPermissionMode),
|
|
32710
|
+
defaultProjectId: opts.project,
|
|
32711
|
+
idempotencyKey: opts.requestKey,
|
|
32712
|
+
modelId: opts.model,
|
|
32713
|
+
nativeSessionId: opts.nativeSession,
|
|
32714
|
+
organization: opts.organization,
|
|
32715
|
+
profileName: targetName,
|
|
32716
|
+
reasoningLevel: opts.reasoningEffort,
|
|
32717
|
+
requestedSpaceId: opts.space,
|
|
32718
|
+
sessionStrategy: opts.session,
|
|
32719
|
+
source: opts.source,
|
|
32720
|
+
targetComputerId: opts.computer,
|
|
32721
|
+
targetOwner: opts.owner,
|
|
32722
|
+
view
|
|
32723
|
+
});
|
|
32724
|
+
return;
|
|
32725
|
+
}
|
|
31946
32726
|
await runProfileCreate({
|
|
31947
32727
|
profileName: targetName,
|
|
31948
32728
|
kind: opts.kind,
|
|
@@ -31973,6 +32753,126 @@ profileCmd.command("list").alias("ls").description("List OpenMeld profiles.").ac
|
|
|
31973
32753
|
}
|
|
31974
32754
|
});
|
|
31975
32755
|
});
|
|
32756
|
+
const profileRequestsCmd = profileCmd.command("requests").description("Create and manage Organization Agent Profile creation requests.");
|
|
32757
|
+
profileRequestsCmd.command("create").description("Request an Agent Profile for yourself or a teammate.").argument("<profileName>", "Agent Profile name").requiredOption("--owner <userId>", "Target member user ID from `openmeld org directory --view agent`, or self").option("--session <strategy>", "Session strategy: new, resume, or fork", "new").option("--native-session <id>", "Native provider Session ID required for resume or fork").option("--space <spaceId>", "Intended Space to record on the request").option("--source <source>", "Request source: cli or local-agent", "cli").option("--request-key <key>", "Stable idempotency key to safely retry this request").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").action(async (profileName, opts) => {
|
|
32758
|
+
const view = getGlobalViewOption();
|
|
32759
|
+
await runCommandWithEntryChecks({
|
|
32760
|
+
routeTokens: [
|
|
32761
|
+
"profile",
|
|
32762
|
+
"requests",
|
|
32763
|
+
"create"
|
|
32764
|
+
],
|
|
32765
|
+
view,
|
|
32766
|
+
run: async () => {
|
|
32767
|
+
await runProfileCreationRequestCreate({
|
|
32768
|
+
idempotencyKey: opts.requestKey,
|
|
32769
|
+
nativeSessionId: opts.nativeSession,
|
|
32770
|
+
organization: opts.organization,
|
|
32771
|
+
profileName,
|
|
32772
|
+
requestedSpaceId: opts.space,
|
|
32773
|
+
sessionStrategy: opts.session,
|
|
32774
|
+
source: opts.source,
|
|
32775
|
+
targetOwner: opts.owner,
|
|
32776
|
+
view
|
|
32777
|
+
});
|
|
32778
|
+
}
|
|
32779
|
+
});
|
|
32780
|
+
});
|
|
32781
|
+
profileRequestsCmd.command("list").alias("ls").description("List Agent Profile creation requests involving you.").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").action(async (opts) => {
|
|
32782
|
+
const view = getGlobalViewOption();
|
|
32783
|
+
await runCommandWithEntryChecks({
|
|
32784
|
+
routeTokens: [
|
|
32785
|
+
"profile",
|
|
32786
|
+
"requests",
|
|
32787
|
+
"list"
|
|
32788
|
+
],
|
|
32789
|
+
view,
|
|
32790
|
+
run: async () => {
|
|
32791
|
+
await runProfileCreationRequestList({
|
|
32792
|
+
organization: opts.organization,
|
|
32793
|
+
view
|
|
32794
|
+
});
|
|
32795
|
+
}
|
|
32796
|
+
});
|
|
32797
|
+
});
|
|
32798
|
+
for (const decision of ["approve", "decline"]) profileRequestsCmd.command(decision).description(`${decision === "approve" ? "Approve" : "Decline"} an Agent Profile creation request for you.`).argument("<requestId>", "Agent Profile creation request ID").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").action(async (requestId, opts) => {
|
|
32799
|
+
const view = getGlobalViewOption();
|
|
32800
|
+
await runCommandWithEntryChecks({
|
|
32801
|
+
routeTokens: [
|
|
32802
|
+
"profile",
|
|
32803
|
+
"requests",
|
|
32804
|
+
decision
|
|
32805
|
+
],
|
|
32806
|
+
view,
|
|
32807
|
+
run: async () => {
|
|
32808
|
+
await runProfileCreationRequestDecide({
|
|
32809
|
+
decision,
|
|
32810
|
+
organization: opts.organization,
|
|
32811
|
+
requestId,
|
|
32812
|
+
view
|
|
32813
|
+
});
|
|
32814
|
+
}
|
|
32815
|
+
});
|
|
32816
|
+
});
|
|
32817
|
+
for (const action of ["cancel", "retry"]) profileRequestsCmd.command(action).description(`${action === "cancel" ? "Cancel" : "Retry"} an Agent Profile creation request.`).argument("<requestId>", "Agent Profile creation request ID").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").action(async (requestId, opts) => {
|
|
32818
|
+
const view = getGlobalViewOption();
|
|
32819
|
+
await runCommandWithEntryChecks({
|
|
32820
|
+
routeTokens: [
|
|
32821
|
+
"profile",
|
|
32822
|
+
"requests",
|
|
32823
|
+
action
|
|
32824
|
+
],
|
|
32825
|
+
view,
|
|
32826
|
+
run: async () => {
|
|
32827
|
+
const input = {
|
|
32828
|
+
organization: opts.organization,
|
|
32829
|
+
requestId,
|
|
32830
|
+
view
|
|
32831
|
+
};
|
|
32832
|
+
if (action === "cancel") await runProfileCreationRequestCancel(input);
|
|
32833
|
+
else await runProfileCreationRequestRetry(input);
|
|
32834
|
+
}
|
|
32835
|
+
});
|
|
32836
|
+
});
|
|
32837
|
+
const profileRequestPreferencesCmd = profileRequestsCmd.command("preferences").description("Manage approvals for teammate Agent Profile requests.");
|
|
32838
|
+
profileRequestPreferencesCmd.command("get").description("Show your Agent Profile creation approval preferences.").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").action(async (opts) => {
|
|
32839
|
+
const view = getGlobalViewOption();
|
|
32840
|
+
await runCommandWithEntryChecks({
|
|
32841
|
+
routeTokens: [
|
|
32842
|
+
"profile",
|
|
32843
|
+
"requests",
|
|
32844
|
+
"preferences",
|
|
32845
|
+
"get"
|
|
32846
|
+
],
|
|
32847
|
+
view,
|
|
32848
|
+
run: async () => {
|
|
32849
|
+
await runProfileCreationRequestPreferenceGet({
|
|
32850
|
+
organization: opts.organization,
|
|
32851
|
+
view
|
|
32852
|
+
});
|
|
32853
|
+
}
|
|
32854
|
+
});
|
|
32855
|
+
});
|
|
32856
|
+
profileRequestPreferencesCmd.command("set").description("Update your Agent Profile creation approval preferences.").requiredOption("--new-session <policy>", "New-session policy: never-allow, ask-every-time, or automatically-allow").requiredOption("--existing-session <policy>", "Existing-session policy: never-allow, ask-every-time, or automatically-allow").option("--organization <slugOrId>", "Organization slug or ID; defaults to the current Organization").action(async (opts) => {
|
|
32857
|
+
const view = getGlobalViewOption();
|
|
32858
|
+
await runCommandWithEntryChecks({
|
|
32859
|
+
routeTokens: [
|
|
32860
|
+
"profile",
|
|
32861
|
+
"requests",
|
|
32862
|
+
"preferences",
|
|
32863
|
+
"set"
|
|
32864
|
+
],
|
|
32865
|
+
view,
|
|
32866
|
+
run: async () => {
|
|
32867
|
+
await runProfileCreationRequestPreferenceSet({
|
|
32868
|
+
existingSessionPolicy: opts.existingSession,
|
|
32869
|
+
newSessionPolicy: opts.newSession,
|
|
32870
|
+
organization: opts.organization,
|
|
32871
|
+
view
|
|
32872
|
+
});
|
|
32873
|
+
}
|
|
32874
|
+
});
|
|
32875
|
+
});
|
|
31976
32876
|
profileCmd.command("set").description("Switch to a different OpenMeld profile.").argument("[profile]", "OpenMeld profile ID").option("--profile <id>", "OpenMeld profile ID").action(async (profile, opts) => {
|
|
31977
32877
|
const outputView = await resolveEffectiveViewForOutput();
|
|
31978
32878
|
const view = getGlobalViewOption();
|