openmeld 0.3.213 → 0.3.214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-me-membership-GbaxKxz-.js → add-me-membership-BaqG9F5c.js} +2 -2
- package/dist/{add-me-membership-GbaxKxz-.js.map → add-me-membership-BaqG9F5c.js.map} +1 -1
- package/dist/{agents-BNoz9DA5.js → agents-y9C8FCyv.js} +8 -8
- package/dist/{agents-BNoz9DA5.js.map → agents-y9C8FCyv.js.map} +1 -1
- package/dist/{api-client-foundation-TEBOwWl1.js → api-client-foundation-BYnU1pbS.js} +1 -1
- package/dist/{api-client-foundation-km8Ol1P4.js → api-client-foundation-CKRP7Ymg.js} +3 -3
- package/dist/{api-client-foundation-km8Ol1P4.js.map → api-client-foundation-CKRP7Ymg.js.map} +1 -1
- package/dist/auth-session-BWKfXWxl.js +4 -0
- package/dist/{auth-session-DgHvRt5i.js → auth-session-gaLjWIKR.js} +8 -6
- package/dist/auth-session-gaLjWIKR.js.map +1 -0
- package/dist/{base-url-C6sHRNGu.js → base-url-BczddvzH.js} +2 -2
- package/dist/{base-url-C6sHRNGu.js.map → base-url-BczddvzH.js.map} +1 -1
- package/dist/{base-url-BE3pFiOZ.js → base-url-CfyKRz89.js} +1 -1
- package/dist/{command-Dsa8gaFe.js → command-C72QNhjP.js} +12 -12
- package/dist/{command-Dsa8gaFe.js.map → command-C72QNhjP.js.map} +1 -1
- package/dist/{computer-connection-D8tX14R_.js → computer-connection-Dv9kex7h.js} +2 -2
- package/dist/{computer-connection-D8tX14R_.js.map → computer-connection-Dv9kex7h.js.map} +1 -1
- package/dist/{computer-connection-review-CjOXBWiV.js → computer-connection-review-_ZLPsdE_.js} +6 -6
- package/dist/{computer-connection-review-CjOXBWiV.js.map → computer-connection-review-_ZLPsdE_.js.map} +1 -1
- package/dist/{computer-disconnect-k6UVCsVF.js → computer-disconnect-BJ-Tl-7q.js} +9 -9
- package/dist/{computer-disconnect-k6UVCsVF.js.map → computer-disconnect-BJ-Tl-7q.js.map} +1 -1
- package/dist/{computer-setup-continuation-DhY_sJis.js → computer-setup-continuation-CN383Vvy.js} +4 -4
- package/dist/{computer-setup-continuation-DhY_sJis.js.map → computer-setup-continuation-CN383Vvy.js.map} +1 -1
- package/dist/{daemon-runtime-lease-Dd4hdHNo.js → daemon-runtime-lease-CIzOT1zx.js} +2 -2
- package/dist/{daemon-runtime-lease-Dd4hdHNo.js.map → daemon-runtime-lease-CIzOT1zx.js.map} +1 -1
- package/dist/{daemon-runtime-lease-y3n1K0-C.js → daemon-runtime-lease-_M6hW8Mg.js} +1 -1
- package/dist/{daemon-service-manager-GiMCiTmu.js → daemon-service-manager-DxS5eH_N.js} +4 -4
- package/dist/{daemon-service-manager-GiMCiTmu.js.map → daemon-service-manager-DxS5eH_N.js.map} +1 -1
- package/dist/{daemon-service-manager-Bh0LoLed.js → daemon-service-manager-fPpyIyrU.js} +1 -1
- package/dist/{daemon-service-runtime-CY6wdBe1.js → daemon-service-runtime-CGT3yVOs.js} +22 -16
- package/dist/{daemon-service-runtime-CY6wdBe1.js.map → daemon-service-runtime-CGT3yVOs.js.map} +1 -1
- package/dist/{daemon-service-update-coordinator-BcbbIDzC.js → daemon-service-update-coordinator--xLHNqDT.js} +625 -55
- package/dist/daemon-service-update-coordinator--xLHNqDT.js.map +1 -0
- package/dist/{daemon-state-C37ZtIZK.js → daemon-state-CoAZLwpi.js} +3 -3
- package/dist/{daemon-state-C37ZtIZK.js.map → daemon-state-CoAZLwpi.js.map} +1 -1
- package/dist/dist-CABuqfdH.js +4 -0
- package/dist/{dist-CAx_kxvt.js → dist-Dj3TOx03.js} +481 -195
- package/dist/dist-Dj3TOx03.js.map +1 -0
- package/dist/distribution-BDQT2ilb.js +20 -0
- package/dist/distribution-BDQT2ilb.js.map +1 -0
- package/dist/{elapsed-time-Do3uIV__.js → elapsed-time-CCFWbCC8.js} +5 -5
- package/dist/{elapsed-time-Do3uIV__.js.map → elapsed-time-CCFWbCC8.js.map} +1 -1
- package/dist/{installation-inventory-C92AkQkA.js → installation-inventory-C4WKcVEj.js} +6 -6
- package/dist/{installation-inventory-C92AkQkA.js.map → installation-inventory-C4WKcVEj.js.map} +1 -1
- package/dist/{lock-Dxp6o_t_.js → lock-CAt9uTnZ.js} +5 -48
- package/dist/lock-CAt9uTnZ.js.map +1 -0
- package/dist/{openmeld-I4pLxQsY.js → openmeld-DpV9lAF-.js} +312 -188
- package/dist/openmeld-DpV9lAF-.js.map +1 -0
- package/dist/openmeld-dev.js +1 -1
- package/dist/{openmeld-environment-target-NtJYJe1D.js → openmeld-environment-target-BWI2adGw.js} +3 -3
- package/dist/{openmeld-environment-target-NtJYJe1D.js.map → openmeld-environment-target-BWI2adGw.js.map} +1 -1
- package/dist/{openmeld-maintenance-worker-D5VAO9GD.js → openmeld-maintenance-worker-Blfu_oOo.js} +9 -9
- package/dist/{openmeld-maintenance-worker-D5VAO9GD.js.map → openmeld-maintenance-worker-Blfu_oOo.js.map} +1 -1
- package/dist/{openmeld-tools-update-join-DsQdgYNw.js → openmeld-tools-update-join-BpLwmowQ.js} +4 -4
- package/dist/{openmeld-tools-update-join-DsQdgYNw.js.map → openmeld-tools-update-join-BpLwmowQ.js.map} +1 -1
- package/dist/openmeld.js +3 -3
- package/dist/{prepare-session-executor-BEzlM0hJ.js → prepare-session-executor-Cfm3EvXl.js} +16 -16
- package/dist/{prepare-session-executor-BEzlM0hJ.js.map → prepare-session-executor-Cfm3EvXl.js.map} +1 -1
- package/dist/process-identity-Clby123a.js +145 -0
- package/dist/process-identity-Clby123a.js.map +1 -0
- package/dist/{runtime-transport-DxISZdzf.js → runtime-transport-D8G8sANa.js} +92 -6
- package/dist/runtime-transport-D8G8sANa.js.map +1 -0
- package/dist/{service-Cev-7yAJ.js → service-Cl_Ge6oJ.js} +720 -35
- package/dist/service-Cl_Ge6oJ.js.map +1 -0
- package/dist/{distribution-DY2fBeSW.js → service-account-admission-Dy2W3n3_.js} +9 -19
- package/dist/service-account-admission-Dy2W3n3_.js.map +1 -0
- package/dist/{service-account-authorization-AbowIr6n.js → service-account-authorization-4oZuo8sT.js} +6 -6
- package/dist/{service-account-authorization-AbowIr6n.js.map → service-account-authorization-4oZuo8sT.js.map} +1 -1
- package/dist/{service-account-control-BV_tBiio.js → service-account-control-CTXv3924.js} +11 -12
- package/dist/service-account-control-CTXv3924.js.map +1 -0
- package/dist/{service-control-capabilities-BGXPenm1.js → service-control-capabilities-B-vCQoBV.js} +1 -1
- package/dist/service-control-capabilities-ptf0u8n5.js +70 -0
- package/dist/service-control-capabilities-ptf0u8n5.js.map +1 -0
- package/dist/service-control-carrier-capability-hvpD7hGf.js +24 -0
- package/dist/service-control-carrier-capability-hvpD7hGf.js.map +1 -0
- package/dist/upgrade-EWdIdoHm.js +4 -0
- package/dist/{upgrade-9h70HCQP.js → upgrade-vuPM1iX3.js} +7 -7
- package/dist/{upgrade-9h70HCQP.js.map → upgrade-vuPM1iX3.js.map} +1 -1
- package/dist/{windows-user-task-DxPN7TzK.js → windows-user-task-FdycoSb4.js} +1 -1
- package/dist/{windows-user-task-DqJWtlAm.js → windows-user-task-i0oHCBc0.js} +49 -19
- package/dist/windows-user-task-i0oHCBc0.js.map +1 -0
- package/package.json +2 -2
- package/dist/auth-session-D6UDl3r3.js +0 -4
- package/dist/auth-session-DgHvRt5i.js.map +0 -1
- package/dist/daemon-service-update-coordinator-BcbbIDzC.js.map +0 -1
- package/dist/dist-Bsz_wafH.js +0 -4
- package/dist/dist-CAx_kxvt.js.map +0 -1
- package/dist/distribution-DY2fBeSW.js.map +0 -1
- package/dist/lock-Dxp6o_t_.js.map +0 -1
- package/dist/openmeld-I4pLxQsY.js.map +0 -1
- package/dist/runtime-transport-DxISZdzf.js.map +0 -1
- package/dist/service-Cev-7yAJ.js.map +0 -1
- package/dist/service-account-control-BV_tBiio.js.map +0 -1
- package/dist/service-control-capabilities-DUudAKoj.js +0 -54
- package/dist/service-control-capabilities-DUudAKoj.js.map +0 -1
- package/dist/upgrade-CXgHeEKK.js +0 -4
- package/dist/windows-user-task-DqJWtlAm.js.map +0 -1
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { f as toSpaceMetaUrl, g as toSpaceUpdatesUrl } from "./urls-CY2uzH2-.js";
|
|
4
|
-
import {
|
|
5
|
-
import { $r as
|
|
4
|
+
import { A as OPENMELD_HOME_ENV_KEY, C as assessLocalMachineFailure, E as createServiceSpawnPendingIssue, F as accountsDir, G as legacyAccountProfileSpacesDir, J as normalizeOpenMeldProfileId, M as accountProfileSpaceCacheDir, W as isPublishedOpenMeldHome, Z as openMeldManagedBinaryPath, ct as resolveOpenMeldEnvPreset, d as runWithHeldLock, et as openMeldRootDir, i as isOpenMeldLockError, k as formatLocalMachineIssueMessage, lt as resolveOpenMeldRootDir, nt as organizationSkillReleaseDir, q as normalizeAccountKey, s as releaseLock, t as acquireLock, u as resolveOpenMeldOrphanedLockIssue, ut as resolveOpenMeldServiceOwnedPathInput, v as resolveCliContextId, x as resolveOpenMeldLaneDescriptor } from "./lock-CAt9uTnZ.js";
|
|
5
|
+
import { $n as getSpaceUpdatesResponseSchema, $r as updateCenterAgentRoutineResponseSchema, Ai as localProjectControlDaemonFrameSchema, Bi as computerFileAccessPolicyInputSchema, Bn as DAEMON_STREAM_KEEPALIVE_PING, Br as organizationSkillReleaseSummarySchema, Cr as betterAuthDeviceAuthorizationCodeResponseSchema, Di as serviceConnectionEvidenceJournalSchema, Dr as betterAuthSessionSnapshotResponseSchema, Ei as serviceConnectionEvidenceEventSchema, Er as betterAuthDeviceAuthorizationTokenResponseSchema, Fi as projectSchema, Fr as spaceCreatorSchema, Gr as submitFeedbackIssueRequestSchema, Hi as toCompatibleSpaceAddressingRequestWireValue, Hr as stringifyOrganizationSkillBundleCanonicalJson, Ii as updateProjectResponseSchema, Ir as spaceMetaSchema, Jr as deleteCenterAgentRoutineResponseSchema, Kr as submitFeedbackIssueResponseSchema, Li as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, Lr as getOrganizationSkillResponseSchema, Mi as archiveProjectResponseSchema, Ni as createProjectResponseSchema, Nn as toStructuredApiClientFailure, Nr as organizationSpaceDirectoryWithMemberCountsResponseSchema, Pi as listProjectsResponseSchema, Qr as resumeCenterAgentRoutineResponseSchema, Ri as OPENMELD_RUNTIME_CAPABILITIES_HEADER, Rr as listOrganizationSkillsResponseSchema, Si as centerAgentToolSpeakerSchema, Sr as betterAuthDeviceAuthorizationCodeRequestSchema, Tr as betterAuthDeviceAuthorizationTokenRequestSchema, Tt as buildSpaceAttachmentDownloadPath, Ur as organizationDirectoryResponseSchema, Vi as computerFileAccessPolicySchema, Vr as organizationSkillSummarySchema, Wr as organizationComputersResponseSchema, Xn as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Xr as listCenterAgentRoutinesResponseSchema, Xt as createOrganizationSkillsApi, Yn as OPENMELD_HEADER_REQUEST_ID, Yr as listCenterAgentRoutineRunsResponseSchema, Zr as pauseCenterAgentRoutineResponseSchema, _r as submitAgentControllerTaskLifecycleEventItemSchema, an as createRuntimeReportingApi, ar as spaceEntryTargetSchema, di as spaceMemberAgentWakeAvailabilitySchema, fi as spaceMemberDirectoryAllowedRelationsSchema, hi as spaceMemberKindSchema, ji as localProjectControlDiscoverProjectsResponseSchema, jr as gatewayErrorEnvelopeSchema, jt as createAgentActivityApi, ki as localProjectControlConnectionSchema, mi as spaceMemberDirectorySchema, ni as agentActivityEventSchema, oi as agentActivitySnapshotResponseSchema, on as createServiceConnectionEvidenceApi, pi as spaceMemberDirectoryEntrySchema, qr as createCenterAgentRoutineResponseSchema, sn as createSpaceApi, sr as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, t as OpenMeldApiClientHttpError, ti as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, wr as betterAuthDeviceAuthorizationErrorResponseSchema, xi as observedLocalAgentSessionSchema, xr as BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE, yi as agentActivitySessionInventoryResponseSchema, zi as computerFileAccessDaemonFrameSchema, zr as organizationSkillBundleSchema } from "./dist-Dj3TOx03.js";
|
|
6
6
|
import { b as normalizeKnownBuiltinAgentControllerId, d as resolveBuiltinAgentControllerConversationKind, l as buildAgentControllerConversationRef } from "./controller-contract-pe3_Re-c.js";
|
|
7
|
-
import { $ as buildDaemonServiceDependencyTitle, $a as readDaemonCatalogSyncSignal, $i as describeServerRequiredVersionUnavailableReason, $n as ProjectBindingStoreUpdateRequiredError, $r as settleInflightTask, $t as resolveCurrentDaemonExpectedVersion, Aa as HEARTBEAT_RESPONSE_TIMEOUT_MS, Ai as createLocalAdapterEntries, An as setAgentRegistrationEnabled, Ar as createInflightTaskControlRegistry, At as uninstallDaemonServiceUpdateWorker, Bi as forkCodexAppServerThread, Bn as resolveSkillsAgentRegistry, Br as resolveDispatchContinuityObservation, C as formatDaemonServiceRefreshReliabilityMessage, Ca as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, Cn as listAgentTargetStates, Cr as buildDispatchReplyContextSummary, D as writeDaemonStartFailureState, Da as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Dr as createLocalTaskInterruptSender, Dt as writeOpenMeldToolsMaintenancePolicy, E as clearDaemonStartFailureState, Ea as DAEMON_STREAM_CONNECT_TIMEOUT_MS, En as reconcileNewRunnableBuiltinAgentRegistrations, Er as mergeOpenClawGatewayVisibility, Et as resolveOpenMeldToolsMaintenanceProjection, Fa as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, Fi as probeGrokBuildAcpInterface, Fr as applyIntervalJitterMs$1, Ft as readCurrentDaemonOwnerSnapshot, Gi as createUnsupportedProviderUsageLimits, Gn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Gr as buildRuntimeWorkspaceFingerprint, Gt as isVersionDowngrade, Ha as requireOpenMeldProfile, Hi as verifyCodexAppServerThread, Hr as resolveCompatibleConversationExecutionState, Ht as readDaemonRuntimeContractRepairReport, Ia as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, Ii as resolveInstalledGrokBuildLaunchCandidates, Ir as pruneStaleLeases, It as resolveDaemonStopStrategy, Ji as materializeCliLaunchCommand, Jn as isHomebrewCommandPath, Jr as commitResolvedAgentContext, Jt as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, Kn as resolveBuiltinAgentControllerDefinition, Kr as buildTaskResultEnvelope, La as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, Li as projectCodexUsageLimits, Lr as resolveAdaptiveHeartbeatIntervalMs, Lt as resolveStoppedContractWriteBlockedReason, Ma as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, Mi as forkOpenCodeServerSession, Mr as MAX_HEARTBEAT_INTERVAL_MS, Mt as buildDaemonOwnerSnapshotFromObservedState, Na as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, Ni as resolveInstalledOpenCodeLaunchCandidates, Nr as MIN_HEARTBEAT_INTERVAL_MS, Nt as formatDaemonOwnerSummaryLabel, Oa as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Oi as resolveCatalogSyncSkippedProfilesLogState, Or as buildLocalServiceDiagnosticsPayload, Ot as ensureDaemonServiceMaintenanceInstalled, Pa as REGISTER_RESPONSE_TIMEOUT_MS, Pi as GrokBuildAcpTransportError, Pr as applyAcceptedLeases, Pt as hasActiveDaemonOwners, Q as buildDaemonServiceDependencySummary, Qi as assessServerRequiredVersion, Qn as ProjectBindingOperationError, Qr as seedLegacyAgentContext, Qt as classifyDaemonServiceWakeability, Ri as resolveCodexTimeoutMs, Rn as canManageRegistryAgentSkillTargets, Rr as resolveCatalogSyncIntervalMs, Rt as summarizeDaemonOwnerSnapshot, S as buildDaemonServiceUpdateRequiredNextStep, Sa as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Sr as createSerialAgentInteractionCallback, Ta as DAEMON_RUNTIME_CONTRACT_EPOCH, Tr as createPendingAgentInteractionRegistry, Tt as readOpenMeldToolsMaintenancePolicy, Ua as resolveOpenMeldProfileOrNull, Ui as resolveInstalledClaudeCodeLaunchCandidates, Un as resolveRegistryRuntimeAdapterCapabilitySnapshot, Ur as resolveLatestScopedConversationExecutionState, Ut as buildDaemonServiceTargetSpec, Vi as resolveCodexAppServerCompletedTurn, Vr as resolveCompatibleAgentContextMatch, Vt as ensureDaemonRuntimeContractState, W as resolveLocalServiceDemand, Wi as createUnavailableProviderUsageLimits, Wn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, Wr as runRuntimeTask, Wt as resolveDaemonServiceAlignmentDecision, X as buildDaemonServiceDependencyMeaning, Xi as createProviderOriginalError, Xn as isPnpmGlobalCommandPath, Xr as removeConversationExecutionState, Y as buildDaemonServiceDependencyDetails, Yi as listAgentControllerSupervisedProcessIds, Yn as isNpmGlobalCommandPath, Yr as loadLedgerState, Yt as DAEMON_SERVICE_REPAIR_ANOMALIES, Z as buildDaemonServiceDependencyNextStep, Zi as resolveServiceUpdateUrgency, Zr as resolveConversationExecutionStateByLookupKey, Zt as classifyDaemonServiceRunStartability, _i as parseAgentControllerRef, _o as resolveCurrentOpenMeldAccountContext, _r as syncRuntimeEventToInflightTaskControlRegistry, _t as syncDeviceRuntimeStateProjection, a as isDaemonInventoryRunningAndStartReady$1, aa as resolvePreferredDaemonDeviceId, ai as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, an as readLocalEnabledControllers, ar as removeAgentActivityBindingsWhileDeliveryLocked, at as slugifyOpenClawNamePart, ba as CATALOG_SYNC_RETRY_INTERVAL_MS, bi as renderInformationProtectionPrompt, br as isDaemonReconcileInProgressError, c as waitForSystemServiceStartup$1, ca as emitRunLine, ci as buildInformationProtectionPromptPlan, cn as resolveProfileWorkspaceRuntime, co as buildHumanAuthenticationCard, cr as resolveProjectBindingForPath, ct as createMutableRouteCatalogState, d as captureDaemonServiceEvidenceBestEffort, da as normalizeOptionalText$11, do as resolveAuthenticationGuidance, dt as summarizeSkippedDaemonProfiles, ei as upsertConversationExecutionState, en as emitDriftDetectedEvidence, er as bindProject, et as resolveDaemonServiceDependencyDiagnostics, f as formatDaemonFailureContextText, fa as normalizeText$2, fn as readProfileWorkspaceConfigForAccount, ft as syncDaemonRouteCatalogState, g as resolveServiceReadiness, ga as assessCliUpdate, gr as normalizeDispatchThreadAction, h as resolveDaemonStatusAuthenticationAttention, ha as warnDaemonEvent, hn as setCustomProfileWorkspace, hr as withAgentActivityLocalStateLock, ht as resolveCurrentEffectiveProfileWorkingFolderRuntime, i as runDaemonServiceLifecycle, ia as resolveDaemonDeviceId, ii as buildAgentContextLookupKey, in as buildRuntimeRouteTargets, it as normalizeOpenClawSpaceIdPrefix, ja as MAX_RECONNECT_DELAY_MS, ji as parseOpenCodeGoUsageResponse, jr as ADAPTIVE_HEARTBEAT_JITTER_RATIO, jt as inspectDaemonServiceInventory, ka as DEFAULT_RECONNECT_DELAY_MS, ki as createLocalAdapterContainer, kr as createLocalExecutionSlots, l as startDaemonSystemServiceWithAutoRepair, la as normalizeHeartbeatIntervalMs, li as buildWorkingLanguagePromptPlan, ln as ensureOpenMeldManagedProfileWorkspace, lo as createAuthenticationError, lt as createRouteCatalogFromMutableState, m as resolveDaemonStatusAttention, ma as toErrorMessage$10, mn as resolveConfiguredProfileWorkspacePathForAccount, mo as resolveAuthenticationReasonFromState, mr as withAgentActivityDeliveryLock, n as scheduleDaemonServiceUpdate, na as buildLedgerPaths, ni as buildAuthenticatedControlPlaneResponse, nn as emitReconcileStartedEvidence, nr as listProjectBindings, nt as prepareProviderRuntime, o as isSystemServiceStartupTimeoutError, oa as asRecord, oi as areAgentControllerInterfaceAccountsSame, on as resolveLocalController, oo as buildAuthenticationStatusLabel, or as removeMissingProjectConnections, ot as readDaemonRouteCatalogCache, p as resolveDaemonStatusSnapshot, pa as nowIsoString, pr as resolveLocalProjectConnectionForPath, qi as buildCliLaunchInvocation, qn as isBunGlobalCommandPath, qr as appendLedgerHistoryEntry, qt as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, r as DaemonServiceLifecycleDrainTimeoutError, ra as ensureDaemonRuntimePaths, ri as assertLegacyAgentContextAssociation, rn as DaemonServiceRunError, rr as listProjectConnectionsWithStatus, rt as buildOpenClawSpaceSessionKey, s as resolveSystemServiceStartupWaitMs, sa as dirnamePath, si as buildAgentControllerRef, sn as resolveLocalRuntimeControllerSupport, so as buildCommandAuthenticationPromptMessage$1, sr as removeProjectConnection, st as writeDaemonRouteCatalogCache, ti as withLedgerStateTransaction, tn as emitReconcileCompletedEvidence, to as clearAllSelectedOpenMeldProfileIds, tr as isProjectBound, tt as writeDaemonServiceContract, u as captureDaemonServiceEvidence, ua as normalizeNonNegativeInteger$1, uo as extractAuthenticationPromptAction, ur as setDefaultProjectConnection, ut as loadDaemonRouteCatalog, v as buildDaemonServiceRefreshNextStep, va as buildDaemonSystemServiceCommandSpec, vr as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, w as formatDaemonServiceUpdateRequiredMessage, wa as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, wn as manageAgentRegistrationInstallation, wr as normalizeDispatchPostMessageAction, x as buildDaemonServiceStatusReadOnlyDetail, xa as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, xi as renderWorkingLanguagePrompt, xr as resolveRouteRegistrationReconcileDecision, xt as createOpenMeldToolsUpdateCoordinator, y as buildDaemonServiceRefreshPromptMessage, ya as ensureDaemonSystemServiceCommandFiles, yr as SPACE_ACTION_TARGET_GUIDANCE_LINES, yt as resolveAgentProfilePrimaryAgentControllerReport, za as resolveRuntimeContext, zi as resolveInstalledCodexLaunchCandidates, zr as resolveDispatchQueueLogMeta } from "./daemon-service-update-coordinator
|
|
8
|
-
import { A as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema,
|
|
9
|
-
import { E as ServiceAccountAdmissionError, S as setAuthSession, _ as onAuthSessionCredentialAvailable, a as beginAuthSessionTransition, d as getAuthSessionState, i as assertAuthSessionMutationAvailable, s as clearAuthSession, v as onAuthSessionCredentialObservation, w as withAdmittedServiceSession } from "./auth-session-
|
|
7
|
+
import { $ as buildDaemonServiceDependencyTitle, $a as readDaemonCatalogSyncSignal, $i as describeServerRequiredVersionUnavailableReason, $n as ProjectBindingStoreUpdateRequiredError, $r as settleInflightTask, $t as resolveCurrentDaemonExpectedVersion, Aa as HEARTBEAT_RESPONSE_TIMEOUT_MS, Ai as createLocalAdapterEntries, An as setAgentRegistrationEnabled, Ar as createInflightTaskControlRegistry, At as uninstallDaemonServiceUpdateWorker, Bi as forkCodexAppServerThread, Bn as resolveSkillsAgentRegistry, Br as resolveDispatchContinuityObservation, C as formatDaemonServiceRefreshReliabilityMessage, Ca as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, Cn as listAgentTargetStates, Cr as buildDispatchReplyContextSummary, D as writeDaemonStartFailureState, Da as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Dr as createLocalTaskInterruptSender, Dt as writeOpenMeldToolsMaintenancePolicy, E as clearDaemonStartFailureState, Ea as DAEMON_STREAM_CONNECT_TIMEOUT_MS, En as reconcileNewRunnableBuiltinAgentRegistrations, Er as mergeOpenClawGatewayVisibility, Et as resolveOpenMeldToolsMaintenanceProjection, Fa as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, Fi as probeGrokBuildAcpInterface, Fr as applyIntervalJitterMs$1, Ft as readCurrentDaemonOwnerSnapshot, Gi as createUnsupportedProviderUsageLimits, Gn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Gr as buildRuntimeWorkspaceFingerprint, Gt as isVersionDowngrade, Ha as requireOpenMeldProfile, Hi as verifyCodexAppServerThread, Hr as resolveCompatibleConversationExecutionState, Ht as readDaemonRuntimeContractRepairReport, Ia as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, Ii as resolveInstalledGrokBuildLaunchCandidates, Ir as pruneStaleLeases, It as resolveDaemonStopStrategy, Ji as materializeCliLaunchCommand, Jn as isHomebrewCommandPath, Jr as commitResolvedAgentContext, Jt as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, Kn as resolveBuiltinAgentControllerDefinition, Kr as buildTaskResultEnvelope, La as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, Li as projectCodexUsageLimits, Lr as resolveAdaptiveHeartbeatIntervalMs, Lt as resolveStoppedContractWriteBlockedReason, Ma as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, Mi as forkOpenCodeServerSession, Mr as MAX_HEARTBEAT_INTERVAL_MS, Mt as buildDaemonOwnerSnapshotFromObservedState, Na as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, Ni as resolveInstalledOpenCodeLaunchCandidates, Nr as MIN_HEARTBEAT_INTERVAL_MS, Nt as formatDaemonOwnerSummaryLabel, Oa as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Oi as resolveCatalogSyncSkippedProfilesLogState, Or as buildLocalServiceDiagnosticsPayload, Ot as ensureDaemonServiceMaintenanceInstalled, Pa as REGISTER_RESPONSE_TIMEOUT_MS, Pi as GrokBuildAcpTransportError, Pr as applyAcceptedLeases, Pt as hasActiveDaemonOwners, Q as buildDaemonServiceDependencySummary, Qi as assessServerRequiredVersion, Qn as ProjectBindingOperationError, Qr as seedLegacyAgentContext, Qt as classifyDaemonServiceWakeability, Ri as resolveCodexTimeoutMs, Rn as canManageRegistryAgentSkillTargets, Rr as resolveCatalogSyncIntervalMs, Rt as summarizeDaemonOwnerSnapshot, S as buildDaemonServiceUpdateRequiredNextStep, Sa as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Sr as createSerialAgentInteractionCallback, Ta as DAEMON_RUNTIME_CONTRACT_EPOCH, Tr as createPendingAgentInteractionRegistry, Tt as readOpenMeldToolsMaintenancePolicy, Ua as resolveOpenMeldProfileOrNull, Ui as resolveInstalledClaudeCodeLaunchCandidates, Un as resolveRegistryRuntimeAdapterCapabilitySnapshot, Ur as resolveLatestScopedConversationExecutionState, Ut as buildDaemonServiceTargetSpec, Vi as resolveCodexAppServerCompletedTurn, Vr as resolveCompatibleAgentContextMatch, Vt as ensureDaemonRuntimeContractState, W as resolveLocalServiceDemand, Wi as createUnavailableProviderUsageLimits, Wn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, Wr as runRuntimeTask, Wt as resolveDaemonServiceAlignmentDecision, X as buildDaemonServiceDependencyMeaning, Xi as createProviderOriginalError, Xn as isPnpmGlobalCommandPath, Xr as removeConversationExecutionState, Y as buildDaemonServiceDependencyDetails, Yi as listAgentControllerSupervisedProcessIds, Yn as isNpmGlobalCommandPath, Yr as loadLedgerState, Yt as DAEMON_SERVICE_REPAIR_ANOMALIES, Z as buildDaemonServiceDependencyNextStep, Zi as resolveServiceUpdateUrgency, Zr as resolveConversationExecutionStateByLookupKey, Zt as classifyDaemonServiceRunStartability, _i as parseAgentControllerRef, _o as resolveCurrentOpenMeldAccountContext, _r as syncRuntimeEventToInflightTaskControlRegistry, _t as syncDeviceRuntimeStateProjection, a as isDaemonInventoryRunningAndStartReady$1, aa as resolvePreferredDaemonDeviceId, ai as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, an as readLocalEnabledControllers, ar as removeAgentActivityBindingsWhileDeliveryLocked, at as slugifyOpenClawNamePart, ba as CATALOG_SYNC_RETRY_INTERVAL_MS, bi as renderInformationProtectionPrompt, br as isDaemonReconcileInProgressError, c as waitForSystemServiceStartup$1, ca as emitRunLine, ci as buildInformationProtectionPromptPlan, cn as resolveProfileWorkspaceRuntime, co as buildHumanAuthenticationCard, cr as resolveProjectBindingForPath, ct as createMutableRouteCatalogState, d as captureDaemonServiceEvidenceBestEffort, da as normalizeOptionalText$11, do as resolveAuthenticationGuidance, dt as summarizeSkippedDaemonProfiles, ei as upsertConversationExecutionState, en as emitDriftDetectedEvidence, er as bindProject, et as resolveDaemonServiceDependencyDiagnostics, f as formatDaemonFailureContextText, fa as normalizeText$2, fn as readProfileWorkspaceConfigForAccount, ft as syncDaemonRouteCatalogState, g as resolveServiceReadiness, ga as assessCliUpdate, gr as normalizeDispatchThreadAction, h as resolveDaemonStatusAuthenticationAttention, ha as warnDaemonEvent, hn as setCustomProfileWorkspace, hr as withAgentActivityLocalStateLock, ht as resolveCurrentEffectiveProfileWorkingFolderRuntime, i as runDaemonServiceLifecycle, ia as resolveDaemonDeviceId, ii as buildAgentContextLookupKey, in as buildRuntimeRouteTargets, it as normalizeOpenClawSpaceIdPrefix, ja as MAX_RECONNECT_DELAY_MS, ji as parseOpenCodeGoUsageResponse, jr as ADAPTIVE_HEARTBEAT_JITTER_RATIO, jt as inspectDaemonServiceInventory, ka as DEFAULT_RECONNECT_DELAY_MS, ki as createLocalAdapterContainer, kr as createLocalExecutionSlots, l as startDaemonSystemServiceWithAutoRepair, la as normalizeHeartbeatIntervalMs, li as buildWorkingLanguagePromptPlan, ln as ensureOpenMeldManagedProfileWorkspace, lo as createAuthenticationError, lt as createRouteCatalogFromMutableState, m as resolveDaemonStatusAttention, ma as toErrorMessage$10, mn as resolveConfiguredProfileWorkspacePathForAccount, mo as resolveAuthenticationReasonFromState, mr as withAgentActivityDeliveryLock, n as scheduleDaemonServiceUpdate, na as buildLedgerPaths, ni as buildAuthenticatedControlPlaneResponse, nn as emitReconcileStartedEvidence, nr as listProjectBindings, nt as prepareProviderRuntime, o as isSystemServiceStartupTimeoutError, oa as asRecord, oi as areAgentControllerInterfaceAccountsSame, on as resolveLocalController, oo as buildAuthenticationStatusLabel, or as removeMissingProjectConnections, ot as readDaemonRouteCatalogCache, p as resolveDaemonStatusSnapshot, pa as nowIsoString, pr as resolveLocalProjectConnectionForPath, qi as buildCliLaunchInvocation, qn as isBunGlobalCommandPath, qr as appendLedgerHistoryEntry, qt as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, r as DaemonServiceLifecycleDrainTimeoutError, ra as ensureDaemonRuntimePaths, ri as assertLegacyAgentContextAssociation, rn as DaemonServiceRunError, rr as listProjectConnectionsWithStatus, rt as buildOpenClawSpaceSessionKey, s as resolveSystemServiceStartupWaitMs, sa as dirnamePath, si as buildAgentControllerRef, sn as resolveLocalRuntimeControllerSupport, so as buildCommandAuthenticationPromptMessage$1, sr as removeProjectConnection, st as writeDaemonRouteCatalogCache, ti as withLedgerStateTransaction, tn as emitReconcileCompletedEvidence, to as clearAllSelectedOpenMeldProfileIds, tr as isProjectBound, tt as writeDaemonServiceContract, u as captureDaemonServiceEvidence, ua as normalizeNonNegativeInteger$1, uo as extractAuthenticationPromptAction, ur as setDefaultProjectConnection, ut as loadDaemonRouteCatalog, v as buildDaemonServiceRefreshNextStep, va as buildDaemonSystemServiceCommandSpec, vr as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, w as formatDaemonServiceUpdateRequiredMessage, wa as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, wn as manageAgentRegistrationInstallation, wr as normalizeDispatchPostMessageAction, x as buildDaemonServiceStatusReadOnlyDetail, xa as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, xi as renderWorkingLanguagePrompt, xr as resolveRouteRegistrationReconcileDecision, xt as createOpenMeldToolsUpdateCoordinator, y as buildDaemonServiceRefreshPromptMessage, ya as ensureDaemonSystemServiceCommandFiles, yr as SPACE_ACTION_TARGET_GUIDANCE_LINES, yt as resolveAgentProfilePrimaryAgentControllerReport, za as resolveRuntimeContext, zi as resolveInstalledCodexLaunchCandidates, zr as resolveDispatchQueueLogMeta } from "./daemon-service-update-coordinator--xLHNqDT.js";
|
|
8
|
+
import { A as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, Ar as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, Bt as spaceWorkRelativePathSchema, C as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, Cr as LOCAL_AGENT_REASONING_MAX_CHARS, D as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, E as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, F as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Fn as getSpaceMessageAddressingRelationSupportForTargetKind, Hn as executionContextAssignmentSchema, I as runtimeTransportRouteCatalogChangedFramePayloadSchema, J as openMeldSpaceEgressActionSchema, K as openMeldDaemonTaskResultPayloadSchema, Ln as normalizeMessageEnvelope, Lt as SPACE_WORK_HANDOFF_CAPABILITY_HEADER, M as runtimeTransportRegisterSessionResponseSchema, Mn as MESSAGE_MENTION_TYPE_VALUES, Mr as localFolderPickerDaemonFrameSchema, Nn as collectCanonicalMentionTextFragments, Nr as localFolderPickerHelperProtocolResultSchema, P as runtimeTransportResumeControllerConversationFramePayloadSchema, Pr as localFolderPickerHelperResultSchema, Q as sanitizeDispatchErrorSummary, Qn as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, R as runtimeTransportSubmitTaskResultRequestSchema, Rn as resolveMessageEnvelopeTargetField, Rt as SPACE_WORK_MAX_BYTES, S as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, T as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, Tr as localAgentReasoningPreferencesSchema, Vt as spaceWorkSelectionSchema, Wn as executionContextTaskSchema, X as resolvePublicAgentAvailabilityCopy, _r as resolveSpaceMentionLabels, a as localWakeRouteWorkingFolderObservationSchema, b as runtimeTransportHeartbeatResponseSchema, c as runtimeTransportDispatchInteractionDeliveredRequestSchema, d as runtimeTransportDispatchLifecycleRequestSchema, dr as runtimeTransportDeliveryExecutionIdentitySchema, er as agentInteractionRequestSchema, f as runtimeTransportDispatchPreviewEndRequestSchema, g as runtimeTransportDispatchToolActivityRequestSchema, gr as resolveSingleSpaceMentionLabels, h as runtimeTransportDispatchRuntimeEvidenceRequestSchema, j as runtimeTransportRegisterSessionRequestSchema, jr as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, k as runtimeTransportOpenMeldToolsControlFramePayloadSchema, l as runtimeTransportDispatchInteractionRequestSchema, m as runtimeTransportDispatchReasoningRequestSchema, mr as normalizeSpacePasswordText, p as runtimeTransportDispatchPreviewRequestSchema, r as daemonStreamFrameSchema, ri as openMeldRequestContextSchema, s as runtimeTransportDeliverDispatchRequestSchema, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, u as runtimeTransportDispatchInteractionResponseFramePayloadSchema, ur as runtimeCoordinatorExecutionTokenEnvelopeSchema, v as runtimeTransportForkAgentSessionResultSchema, w as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, wr as OPENMELD_REASONING_STREAM_HEADER, x as runtimeTransportLocalAgentControlCancelFramePayloadSchema, xt as sanitizeSignalTextPreview, y as runtimeTransportHeartbeatRequestSchema } from "./runtime-transport-D8G8sANa.js";
|
|
9
|
+
import { E as ServiceAccountAdmissionError, S as setAuthSession, _ as onAuthSessionCredentialAvailable, a as beginAuthSessionTransition, d as getAuthSessionState, i as assertAuthSessionMutationAvailable, s as clearAuthSession, v as onAuthSessionCredentialObservation, w as withAdmittedServiceSession } from "./auth-session-gaLjWIKR.js";
|
|
10
10
|
import { C as normalizeOptionalWorkingDirectory, a as openMeldDaemonControlPlaneResponseSchema, w as openMeldRuntimeProfileIdSchema } from "./control-plane-Bpu7g9Av.js";
|
|
11
11
|
import { F as iso, G as string, L as literal, N as enumFactory, W as strictObject, X as url, a as formatLocalSetupActionLabel, f as localServiceComponentUpdateProjectionSchema, i as formatLocalSetupActionDescription, j as discriminatedUnion, k as boolean, n as formatLocalComponentsSummaryDescription, o as installedLocalComponentsSnapshotSchema, r as formatLocalComponentsSummaryLabel, s as localCliComponentUpdateProjectionSchema } from "./local-components-B6SCXZf9.js";
|
|
12
12
|
import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
|
|
13
|
-
import { b as withSkillsInstallLock, f as ensureLocalSkills, g as loadSelectedSkillAssets, l as installSkillsToTargets, n as collectSkillsReadinessSnapshot, u as resolveSkillInstallStateForTarget, v as hashBundledSkillAssets, x as OFFICIAL_CLI_SKILL_URL, y as computeDirectoryContentHash } from "./installation-inventory-
|
|
14
|
-
import {
|
|
15
|
-
import { i as writeDaemonRuntimeLease } from "./daemon-runtime-lease-
|
|
16
|
-
import { $ as readManagedCliInstallation, A as prepareDaemonServiceBundle, Ft as requestLocalDaemonShutdown, H as formatDaemonLifecycleOriginSummary, Ht as upsertDaemonServiceContract, J as runWithDaemonLifecycleCommandJournal, K as resolveRecentDaemonSignalStopCause, Lt as sendLocalDaemonControlPlaneRequest, M as resolveAlignedDaemonActiveBundleEntryPath, Mt as LocalDaemonControlPlaneClientError, N as resolveDaemonBundleEntryPathFromState, Rt as clearDaemonServiceContract, U as readLatestDaemonLifecycleConnectionStateEvent, V as emitDaemonLifecycleEvent, Vt as readDaemonServiceContract, W as readLatestDaemonLifecycleOriginEvent, a as resolveDaemonRuntimeState, b as cleanupInactiveDaemonServiceBundles, f as listDaemonOwnedProcesses, h as resolveDaemonBundleIdFromEntryPath, i as readCurrentObservedDaemonRuntimeStatus, j as readDaemonActiveBundleState, lt as compareSemver, n as getEffectiveDaemonRuntimeStatus, nt as OPENMELD_VERSION, o as resolveDaemonServiceManagerForRuntimeState, p as extractDaemonCommandEntryPath, q as runDaemonServiceManagerAction, r as readCurrentDaemonRuntimeContext, s as waitForDaemonSystemServiceToStop, t as clearDaemonRuntimeStateIfDefinitelyStopped, u as cleanupLegacySharedDaemonServiceState, v as isOpenMeldManagedBinaryPath, zt as isDaemonServiceContractIdentityReusable } from "./daemon-service-runtime-
|
|
17
|
-
import { $ as SPACE_PERSONAL_CONTRIBUTION_RULE, Bt as buildAgentOverviewFromContract, Gt as createPresenter, Kt as sanitizeTerminalDisplayText, Mt as validateDaemonControlTargetInput, Xt as outLine, Yt as outJsonLine, Z as SPACE_COLLABORATION_CONTEXT_RULE, _ as createAuthLoginGuideError, a as formatDaemonServiceDowngradeBlockedRecommendation, at as buildSpaceAgentIdentityLine, d as formatDaemonServiceMissingStatus, dt as isSelfWakeSpaceAction, f as getDaemonDowngradeBlockedTitle, ft as renderSpaceEntryBrief, g as canUseInteractivePrompts, h as resolveOpenMeldToolsUpdateOperationProjection, ht as getCommandEntryContract, it as buildCompactDispatchActionGuidanceLines, l as formatDaemonServiceMissingRunStepOne, lt as composeDispatchBrief, mt as resolveSpacePublicationRequirement, n as resolveElapsedTimeMs, o as formatDaemonServiceMissingAction, ot as buildSpaceEntryBriefNeedMoreLine, pt as resolvePublicAgentFailureReason, r as formatDaemonDowngradeBlockedNextStep, rt as buildCenterAgentRoleTemplateText, s as formatDaemonServiceMissingMeaning, st as buildSpaceWakeParticipantLines, t as formatElapsedTime, tt as buildAgentFacingMentalModelLines, u as formatDaemonServiceMissingRunStepTwo, ut as deriveContinuity } from "./elapsed-time-
|
|
18
|
-
import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, i as normalizeGatewayBaseUrlOrNull, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-
|
|
13
|
+
import { b as withSkillsInstallLock, f as ensureLocalSkills, g as loadSelectedSkillAssets, l as installSkillsToTargets, n as collectSkillsReadinessSnapshot, u as resolveSkillInstallStateForTarget, v as hashBundledSkillAssets, x as OFFICIAL_CLI_SKILL_URL, y as computeDirectoryContentHash } from "./installation-inventory-C4WKcVEj.js";
|
|
14
|
+
import { i as serviceControlCapabilitiesSchema } from "./service-account-admission-Dy2W3n3_.js";
|
|
15
|
+
import { i as writeDaemonRuntimeLease } from "./daemon-runtime-lease-CIzOT1zx.js";
|
|
16
|
+
import { $ as readManagedCliInstallation, A as prepareDaemonServiceBundle, Ft as requestLocalDaemonShutdown, H as formatDaemonLifecycleOriginSummary, Ht as upsertDaemonServiceContract, J as runWithDaemonLifecycleCommandJournal, K as resolveRecentDaemonSignalStopCause, Lt as sendLocalDaemonControlPlaneRequest, M as resolveAlignedDaemonActiveBundleEntryPath, Mt as LocalDaemonControlPlaneClientError, N as resolveDaemonBundleEntryPathFromState, Rt as clearDaemonServiceContract, U as readLatestDaemonLifecycleConnectionStateEvent, V as emitDaemonLifecycleEvent, Vt as readDaemonServiceContract, W as readLatestDaemonLifecycleOriginEvent, a as resolveDaemonRuntimeState, b as cleanupInactiveDaemonServiceBundles, f as listDaemonOwnedProcesses, h as resolveDaemonBundleIdFromEntryPath, i as readCurrentObservedDaemonRuntimeStatus, j as readDaemonActiveBundleState, lt as compareSemver, n as getEffectiveDaemonRuntimeStatus, nt as OPENMELD_VERSION, o as resolveDaemonServiceManagerForRuntimeState, p as extractDaemonCommandEntryPath, q as runDaemonServiceManagerAction, r as readCurrentDaemonRuntimeContext, s as waitForDaemonSystemServiceToStop, t as clearDaemonRuntimeStateIfDefinitelyStopped, u as cleanupLegacySharedDaemonServiceState, v as isOpenMeldManagedBinaryPath, zt as isDaemonServiceContractIdentityReusable } from "./daemon-service-runtime-CGT3yVOs.js";
|
|
17
|
+
import { $ as SPACE_PERSONAL_CONTRIBUTION_RULE, Bt as buildAgentOverviewFromContract, Gt as createPresenter, Kt as sanitizeTerminalDisplayText, Mt as validateDaemonControlTargetInput, Xt as outLine, Yt as outJsonLine, Z as SPACE_COLLABORATION_CONTEXT_RULE, _ as createAuthLoginGuideError, a as formatDaemonServiceDowngradeBlockedRecommendation, at as buildSpaceAgentIdentityLine, d as formatDaemonServiceMissingStatus, dt as isSelfWakeSpaceAction, f as getDaemonDowngradeBlockedTitle, ft as renderSpaceEntryBrief, g as canUseInteractivePrompts, h as resolveOpenMeldToolsUpdateOperationProjection, ht as getCommandEntryContract, it as buildCompactDispatchActionGuidanceLines, l as formatDaemonServiceMissingRunStepOne, lt as composeDispatchBrief, mt as resolveSpacePublicationRequirement, n as resolveElapsedTimeMs, o as formatDaemonServiceMissingAction, ot as buildSpaceEntryBriefNeedMoreLine, pt as resolvePublicAgentFailureReason, r as formatDaemonDowngradeBlockedNextStep, rt as buildCenterAgentRoleTemplateText, s as formatDaemonServiceMissingMeaning, st as buildSpaceWakeParticipantLines, t as formatElapsedTime, tt as buildAgentFacingMentalModelLines, u as formatDaemonServiceMissingRunStepTwo, ut as deriveContinuity } from "./elapsed-time-CCFWbCC8.js";
|
|
18
|
+
import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, i as normalizeGatewayBaseUrlOrNull, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-BczddvzH.js";
|
|
19
|
+
import { n as isPreciseProcessStartIdentity, t as CURRENT_PROCESS_START_IDENTITY } from "./process-identity-Clby123a.js";
|
|
19
20
|
import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
|
|
20
|
-
import {
|
|
21
|
-
import { S as
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
21
|
+
import { n as resolveOpenMeldDistribution, t as isBinaryDistribution } from "./distribution-BDQT2ilb.js";
|
|
22
|
+
import { A as getDaemonStatus, G as withDaemonServiceRegistrationMutationLock, H as setDaemonServiceRuntimeState, I as readDaemonServiceRuntimeSnapshot, K as withDaemonServiceRunLock, L as releaseDaemonServiceLifecycleLock, M as isDaemonServiceRuntimeHeartbeatStale, O as ensureDaemonControlPlaneToken, R as resolveDaemonControlPlaneEndpoint, S as daemonServiceRepairJournalPath, U as uninstallDaemon, W as withDaemonServiceReconcileLock, _ as daemonRuntimeStateRootPath, a as DAEMON_SERVICE_RUNTIME_MODE_ENV, c as acquireDaemonServiceLifecycleLock, d as daemonDispatchJournalPath, f as daemonLifecycleJournalPath, h as daemonRuntimeRootPath, i as DAEMON_SERVICE_RUNTIME_DETACHED_ENV, j as installDaemon, l as clearDaemonServiceRuntimeState, o as DAEMON_SERVICE_RUNTIME_STATE_SCHEMA, q as withDaemonServiceStopLock, z as resolveDaemonServiceRuntimeMetadata } from "./daemon-state-CoAZLwpi.js";
|
|
23
|
+
import { S as resolveDaemonServiceManager, _ as readDaemonServiceJobCrashExitCode, a as disableDaemonServiceAutostartIfConfigured, c as getDaemonSystemServiceLogPath, f as isDaemonServiceJobSpawnPending, o as formatDaemonServiceJobDiagnosticsEvidence, s as getDaemonServiceLaunchdLabel } from "./daemon-service-manager-DxS5eH_N.js";
|
|
24
|
+
import { a as formatOpenMeldCliCommand, c as formatOpenMeldCliTextBlock, f as resolveUserFacingCliEntryCommand, i as formatInlineOpenMeldCliCommands, o as formatOpenMeldCliCommands, r as resolveAuthBaseUrl, t as resolveOpenMeldEnvironmentTarget } from "./openmeld-environment-target-BWI2adGw.js";
|
|
25
|
+
import { t as admitServiceAccountStop } from "./service-account-authorization-4oZuo8sT.js";
|
|
24
26
|
import { n as toErrorMessage$11, t as sleep } from "./dist-o3UL1EGQ.js";
|
|
25
|
-
import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, c as buildRequestAuthHeaders, f as buildOpenMeldRequestContextFromProfileIdentity, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, o as buildOpenMeldProfileRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-
|
|
27
|
+
import { a as buildOpenMeldProfileIdentityRequestHeadersWithAuth, c as buildRequestAuthHeaders, f as buildOpenMeldRequestContextFromProfileIdentity, i as AuthRequestCredentialError, l as canAttachAuthTokenToRequest, n as fetchSpaceRequestWithTimeout, o as buildOpenMeldProfileRequestHeadersWithAuth, p as deriveAuthBaseUrlFromGatewayUrl, s as buildOpenMeldRequestContextHeadersWithAuth, t as createCliApiClientFoundation, u as fingerprintRequestAuthorization } from "./api-client-foundation-CKRP7Ymg.js";
|
|
26
28
|
import { createHash, randomUUID } from "node:crypto";
|
|
27
29
|
import { homedir, loadavg, tmpdir } from "node:os";
|
|
28
30
|
import { basename, delimiter, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
@@ -11319,6 +11321,7 @@ function parseDispatchTask(input) {
|
|
|
11319
11321
|
return {
|
|
11320
11322
|
...requiredFields,
|
|
11321
11323
|
executionContext: payload.executionContext,
|
|
11324
|
+
workHandoff: payload.sourceSignalSnapshot?.workHandoff,
|
|
11322
11325
|
agentControllerConversationId,
|
|
11323
11326
|
...resolveDispatchSourceFiles(payload),
|
|
11324
11327
|
...controllerSelection,
|
|
@@ -11832,6 +11835,19 @@ function buildDispatchCorrelation(input) {
|
|
|
11832
11835
|
};
|
|
11833
11836
|
}
|
|
11834
11837
|
//#endregion
|
|
11838
|
+
//#region src/lib/path-containment.ts
|
|
11839
|
+
const nativePath = {
|
|
11840
|
+
isAbsolute,
|
|
11841
|
+
relative,
|
|
11842
|
+
sep
|
|
11843
|
+
};
|
|
11844
|
+
/** Lexical containment of already canonical absolute paths, not symlink resolution. */
|
|
11845
|
+
function isSameOrDescendantPath(candidate, parent, paths = nativePath) {
|
|
11846
|
+
if (!(paths.isAbsolute(candidate) && paths.isAbsolute(parent))) return false;
|
|
11847
|
+
const relation = paths.relative(parent, candidate);
|
|
11848
|
+
return relation === "" || relation !== ".." && !relation.startsWith(`..${paths.sep}`) && !paths.isAbsolute(relation);
|
|
11849
|
+
}
|
|
11850
|
+
//#endregion
|
|
11835
11851
|
//#region src/local-service/file-access/computer-file-access-store.ts
|
|
11836
11852
|
const LEGACY_COMPUTER_FILE_ACCESS_STORE_SCHEMA = "openmeld-computer-file-access-v1";
|
|
11837
11853
|
const COMPUTER_FILE_ACCESS_STORE_SCHEMA = "openmeld-computer-file-access-v2";
|
|
@@ -11989,8 +12005,7 @@ function removeRedundantFolders(folders) {
|
|
|
11989
12005
|
return unique.filter((candidate, index) => !unique.some((parent, parentIndex) => parentIndex !== index && isPathInside(candidate, parent)));
|
|
11990
12006
|
}
|
|
11991
12007
|
function isPathInside(candidate, parent) {
|
|
11992
|
-
|
|
11993
|
-
return relation.length > 0 && !relation.startsWith("..") && !isAbsolute(relation);
|
|
12008
|
+
return relative(parent, candidate) !== "" && isSameOrDescendantPath(candidate, parent);
|
|
11994
12009
|
}
|
|
11995
12010
|
function hasSamePolicyValue(current, next) {
|
|
11996
12011
|
if (current.mode !== next.mode) return false;
|
|
@@ -16849,17 +16864,13 @@ async function resolveComputerFileAccessAdmission(input) {
|
|
|
16849
16864
|
}
|
|
16850
16865
|
async function assertComputerFileAccessWorkingDirectoryAllowed(input) {
|
|
16851
16866
|
const workingDirectory = await realpath(input.providerRuntimeWorkingDirectory);
|
|
16852
|
-
const matchesConfiguredFolder = input.boundary.folders.some((folder) =>
|
|
16867
|
+
const matchesConfiguredFolder = input.boundary.folders.some((folder) => isSameOrDescendantPath(workingDirectory, folder));
|
|
16853
16868
|
if (input.boundary.mode === "only_selected_folders" ? matchesConfiguredFolder : !matchesConfiguredFolder) return;
|
|
16854
16869
|
throw new DaemonServiceRunError({
|
|
16855
16870
|
code: "computer.file_access.working_directory_denied",
|
|
16856
16871
|
message: "computer.file_access.working_directory_denied: this Wake’s working folder is outside the Computer file access boundary"
|
|
16857
16872
|
});
|
|
16858
16873
|
}
|
|
16859
|
-
function isSameOrDescendant(candidate, parent) {
|
|
16860
|
-
const relativePath = relative(parent, candidate);
|
|
16861
|
-
return relativePath === "" || !(relativePath.startsWith("..") || isAbsolute(relativePath));
|
|
16862
|
-
}
|
|
16863
16874
|
//#endregion
|
|
16864
16875
|
//#region src/local-service/file-access/computer-file-access-prompt.ts
|
|
16865
16876
|
const COMPUTER_FILE_ACCESS_AWARENESS = "Stay within the file access available to this OpenMeld run. Treat denied paths as intentional and continue with the safest useful alternative. Only the Computer owner can change this boundary.";
|
|
@@ -18971,6 +18982,7 @@ function createDispatchSpaceActionContext(input) {
|
|
|
18971
18982
|
const contextPath = join(contextDir, "context.json");
|
|
18972
18983
|
const actionRecordPath = join(contextDir, "action.json");
|
|
18973
18984
|
const context = {
|
|
18985
|
+
...input.workingCopyId ? { workingCopyId: input.workingCopyId } : {},
|
|
18974
18986
|
version: DISPATCH_SPACE_ACTION_CONTEXT_VERSION,
|
|
18975
18987
|
actionRecordPath,
|
|
18976
18988
|
attemptId: input.attemptId,
|
|
@@ -19094,7 +19106,8 @@ function parseDispatchSpaceActionContext(value) {
|
|
|
19094
19106
|
spaceContractSnapshot: parseSpaceContractSnapshot(record.spaceContractSnapshot),
|
|
19095
19107
|
spaceId: requiredString(record.spaceId, "spaceId"),
|
|
19096
19108
|
targetProfileId: requiredString(record.targetProfileId, "targetProfileId"),
|
|
19097
|
-
taskId: requiredString(record.taskId, "taskId")
|
|
19109
|
+
taskId: requiredString(record.taskId, "taskId"),
|
|
19110
|
+
...record.workingCopyId ? { workingCopyId: requiredString(record.workingCopyId, "workingCopyId") } : {}
|
|
19098
19111
|
};
|
|
19099
19112
|
}
|
|
19100
19113
|
function assertDispatchRuntimeEnvMatchesContext(input) {
|
|
@@ -19714,6 +19727,673 @@ function normalizeOptionalText(value) {
|
|
|
19714
19727
|
return normalized.length > 0 ? normalized : null;
|
|
19715
19728
|
}
|
|
19716
19729
|
//#endregion
|
|
19730
|
+
//#region src/organization-skills/cache.ts
|
|
19731
|
+
const CACHE_MARKER_FILENAME = ".openmeld-organization-skill.json";
|
|
19732
|
+
const DIRECTORY_READ_ONLY_MODE = 365;
|
|
19733
|
+
const FILE_READ_ONLY_MODE = 292;
|
|
19734
|
+
const PRIVATE_DIRECTORY_MODE = 448;
|
|
19735
|
+
const PRIVATE_FILE_MODE = 384;
|
|
19736
|
+
async function materializeOrganizationSkillRelease(input) {
|
|
19737
|
+
const bundle = organizationSkillBundleSchema.parse(input.bundle);
|
|
19738
|
+
if (sha256(stringifyOrganizationSkillBundleCanonicalJson(bundle)) !== input.digest) throw new Error("The Organization Skill release digest does not match its downloaded bundle.");
|
|
19739
|
+
const releaseDir = input.releaseDirectory ?? organizationSkillReleaseDir(input.organizationId, input.skillId, input.releaseId);
|
|
19740
|
+
const skillMarkdown = serializePortableSkillMarkdown(bundle);
|
|
19741
|
+
const expectedFiles = buildExpectedCacheFiles({
|
|
19742
|
+
bundle,
|
|
19743
|
+
marker: {
|
|
19744
|
+
digest: input.digest,
|
|
19745
|
+
organizationId: input.organizationId,
|
|
19746
|
+
releaseId: input.releaseId,
|
|
19747
|
+
schemaVersion: 1,
|
|
19748
|
+
skillId: input.skillId
|
|
19749
|
+
},
|
|
19750
|
+
skillMarkdown
|
|
19751
|
+
});
|
|
19752
|
+
if (await cacheMatches(releaseDir, expectedFiles)) return buildResult({
|
|
19753
|
+
bundle,
|
|
19754
|
+
releaseDir,
|
|
19755
|
+
reused: true
|
|
19756
|
+
});
|
|
19757
|
+
const skillDir = dirname(releaseDir);
|
|
19758
|
+
await mkdir(skillDir, {
|
|
19759
|
+
mode: PRIVATE_DIRECTORY_MODE,
|
|
19760
|
+
recursive: true
|
|
19761
|
+
});
|
|
19762
|
+
await chmod(skillDir, PRIVATE_DIRECTORY_MODE);
|
|
19763
|
+
const temporaryDir = await mkdtemp(join(skillDir, `.load-${randomUUID()}-`));
|
|
19764
|
+
try {
|
|
19765
|
+
await writeCacheFiles(temporaryDir, expectedFiles);
|
|
19766
|
+
await makeCacheReadOnly(temporaryDir, bundle);
|
|
19767
|
+
if (await pathExists$1(releaseDir)) throw new Error(`The existing Organization Skill cache is not valid. Remove "${releaseDir}" and run the load command again.`);
|
|
19768
|
+
await rename(temporaryDir, releaseDir);
|
|
19769
|
+
} catch (error) {
|
|
19770
|
+
await rm(temporaryDir, {
|
|
19771
|
+
force: true,
|
|
19772
|
+
recursive: true
|
|
19773
|
+
}).catch(() => {});
|
|
19774
|
+
throw error;
|
|
19775
|
+
}
|
|
19776
|
+
return buildResult({
|
|
19777
|
+
bundle,
|
|
19778
|
+
releaseDir,
|
|
19779
|
+
reused: false
|
|
19780
|
+
});
|
|
19781
|
+
}
|
|
19782
|
+
function serializePortableSkillMarkdown(bundle) {
|
|
19783
|
+
const portable = bundle.portable;
|
|
19784
|
+
return `${[
|
|
19785
|
+
"---",
|
|
19786
|
+
`name: ${toYamlString(portable.name)}`,
|
|
19787
|
+
`description: ${toYamlString(portable.description)}`,
|
|
19788
|
+
...portable.license === null ? [] : [`license: ${toYamlString(portable.license)}`],
|
|
19789
|
+
...portable.compatibility === null ? [] : [`compatibility: ${toYamlString(portable.compatibility)}`],
|
|
19790
|
+
...portable.allowedTools === null ? [] : [`allowed-tools: ${toYamlString(portable.allowedTools)}`],
|
|
19791
|
+
...serializeMetadata(portable.metadata),
|
|
19792
|
+
"---",
|
|
19793
|
+
""
|
|
19794
|
+
].join("\n")}${bundle.instructions}${bundle.instructions.endsWith("\n") ? "" : "\n"}`;
|
|
19795
|
+
}
|
|
19796
|
+
function buildExpectedCacheFiles(input) {
|
|
19797
|
+
const files = /* @__PURE__ */ new Map();
|
|
19798
|
+
files.set("SKILL.md", Buffer.from(input.skillMarkdown, "utf8"));
|
|
19799
|
+
for (const file of input.bundle.files) files.set(file.path, decodeSkillFile(file));
|
|
19800
|
+
files.set(CACHE_MARKER_FILENAME, Buffer.from(`${JSON.stringify(input.marker, null, 2)}\n`, "utf8"));
|
|
19801
|
+
return files;
|
|
19802
|
+
}
|
|
19803
|
+
async function writeCacheFiles(rootDir, files) {
|
|
19804
|
+
for (const [relativePath, bytes] of files) {
|
|
19805
|
+
const absolutePath = join(rootDir, relativePath);
|
|
19806
|
+
await mkdir(dirname(absolutePath), {
|
|
19807
|
+
mode: PRIVATE_DIRECTORY_MODE,
|
|
19808
|
+
recursive: true
|
|
19809
|
+
});
|
|
19810
|
+
await writeFile(absolutePath, bytes, { mode: PRIVATE_FILE_MODE });
|
|
19811
|
+
}
|
|
19812
|
+
}
|
|
19813
|
+
async function cacheMatches(rootDir, expectedFiles) {
|
|
19814
|
+
if (!await pathExists$1(rootDir)) return false;
|
|
19815
|
+
try {
|
|
19816
|
+
for (const [relativePath, expected] of expectedFiles) {
|
|
19817
|
+
let current = join(rootDir, relativePath);
|
|
19818
|
+
while (current !== dirname(rootDir)) {
|
|
19819
|
+
const info = await lstat(current);
|
|
19820
|
+
if (info.isSymbolicLink() || info.isFile() && info.nlink !== 1) return false;
|
|
19821
|
+
current = dirname(current);
|
|
19822
|
+
}
|
|
19823
|
+
if (!(await readFile(join(rootDir, relativePath))).equals(expected)) return false;
|
|
19824
|
+
}
|
|
19825
|
+
return true;
|
|
19826
|
+
} catch {
|
|
19827
|
+
return false;
|
|
19828
|
+
}
|
|
19829
|
+
}
|
|
19830
|
+
async function makeCacheReadOnly(rootDir, bundle) {
|
|
19831
|
+
const directories = /* @__PURE__ */ new Set([rootDir]);
|
|
19832
|
+
for (const relativePath of [
|
|
19833
|
+
"SKILL.md",
|
|
19834
|
+
CACHE_MARKER_FILENAME,
|
|
19835
|
+
...bundle.files.map((file) => file.path)
|
|
19836
|
+
]) {
|
|
19837
|
+
const absolutePath = join(rootDir, relativePath);
|
|
19838
|
+
await chmod(absolutePath, FILE_READ_ONLY_MODE);
|
|
19839
|
+
let current = dirname(absolutePath);
|
|
19840
|
+
while (current !== rootDir && current.startsWith(`${rootDir}/`)) {
|
|
19841
|
+
directories.add(current);
|
|
19842
|
+
current = dirname(current);
|
|
19843
|
+
}
|
|
19844
|
+
}
|
|
19845
|
+
const deepestFirst = [...directories].sort((left, right) => right.length - left.length);
|
|
19846
|
+
for (const directory of deepestFirst) await chmod(directory, DIRECTORY_READ_ONLY_MODE);
|
|
19847
|
+
}
|
|
19848
|
+
function buildResult(input) {
|
|
19849
|
+
return {
|
|
19850
|
+
cachePath: input.releaseDir,
|
|
19851
|
+
resourcePaths: input.bundle.files.map((file) => join(input.releaseDir, file.path)),
|
|
19852
|
+
reused: input.reused,
|
|
19853
|
+
skillMarkdownPath: join(input.releaseDir, "SKILL.md")
|
|
19854
|
+
};
|
|
19855
|
+
}
|
|
19856
|
+
function decodeSkillFile(file) {
|
|
19857
|
+
return Buffer.from(file.content, file.encoding === "base64" ? "base64" : "utf8");
|
|
19858
|
+
}
|
|
19859
|
+
function serializeMetadata(metadata) {
|
|
19860
|
+
const entries = Object.entries(metadata).sort(([left], [right]) => {
|
|
19861
|
+
if (left < right) return -1;
|
|
19862
|
+
if (left > right) return 1;
|
|
19863
|
+
return 0;
|
|
19864
|
+
});
|
|
19865
|
+
if (entries.length === 0) return [];
|
|
19866
|
+
return ["metadata:", ...entries.map(([key, value]) => ` ${toYamlString(key)}: ${toYamlString(value)}`)];
|
|
19867
|
+
}
|
|
19868
|
+
function toYamlString(value) {
|
|
19869
|
+
return JSON.stringify(value);
|
|
19870
|
+
}
|
|
19871
|
+
function sha256(value) {
|
|
19872
|
+
return createHash("sha256").update(value).digest("hex");
|
|
19873
|
+
}
|
|
19874
|
+
async function pathExists$1(path) {
|
|
19875
|
+
try {
|
|
19876
|
+
await stat(path);
|
|
19877
|
+
return true;
|
|
19878
|
+
} catch {
|
|
19879
|
+
return false;
|
|
19880
|
+
}
|
|
19881
|
+
}
|
|
19882
|
+
//#endregion
|
|
19883
|
+
//#region src/space/working-copy-download.ts
|
|
19884
|
+
/** Bound bytes while reading, rather than allocating an oversized response first. */
|
|
19885
|
+
async function downloadWorkingCopyFile(api, input) {
|
|
19886
|
+
const content = await api.streamFileContent({
|
|
19887
|
+
...input,
|
|
19888
|
+
signal: AbortSignal.timeout(3e4)
|
|
19889
|
+
});
|
|
19890
|
+
const reader = content.bytes.getReader();
|
|
19891
|
+
const chunks = [];
|
|
19892
|
+
let size = 0;
|
|
19893
|
+
try {
|
|
19894
|
+
while (true) {
|
|
19895
|
+
const { value, done } = await reader.read();
|
|
19896
|
+
if (done) break;
|
|
19897
|
+
size += value.byteLength;
|
|
19898
|
+
if (size > 10485760) throw new Error("Handoff files must be 10 MiB or smaller.");
|
|
19899
|
+
chunks.push(value);
|
|
19900
|
+
}
|
|
19901
|
+
} finally {
|
|
19902
|
+
await reader.cancel();
|
|
19903
|
+
reader.releaseLock();
|
|
19904
|
+
}
|
|
19905
|
+
return {
|
|
19906
|
+
revision: content.revision,
|
|
19907
|
+
mimeType: content.mimeType,
|
|
19908
|
+
bytes: Buffer.concat(chunks)
|
|
19909
|
+
};
|
|
19910
|
+
}
|
|
19911
|
+
//#endregion
|
|
19912
|
+
//#region src/local-service/file-access/space-working-copy.ts
|
|
19913
|
+
const hash = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
19914
|
+
const O_NOFOLLOW_ANY = 536870912;
|
|
19915
|
+
const CREATE_FLAGS = constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | O_NOFOLLOW_ANY;
|
|
19916
|
+
const READ_FLAGS = constants.O_RDONLY | O_NOFOLLOW_ANY | constants.O_NONBLOCK;
|
|
19917
|
+
const fileStateSchema = z.object({
|
|
19918
|
+
fileId: z.string(),
|
|
19919
|
+
relativePath: spaceWorkRelativePathSchema,
|
|
19920
|
+
revision: z.number().int().positive(),
|
|
19921
|
+
mimeType: z.string().optional(),
|
|
19922
|
+
sizeBytes: z.number().int().nonnegative().optional(),
|
|
19923
|
+
baseHash: z.string().optional(),
|
|
19924
|
+
conflict: z.object({
|
|
19925
|
+
digest: z.string(),
|
|
19926
|
+
mutationId: z.string().uuid(),
|
|
19927
|
+
incoming: z.object({
|
|
19928
|
+
revision: z.number().int().positive(),
|
|
19929
|
+
relativePath: spaceWorkRelativePathSchema,
|
|
19930
|
+
digest: z.string(),
|
|
19931
|
+
mimeType: z.string(),
|
|
19932
|
+
sizeBytes: z.number().int().nonnegative()
|
|
19933
|
+
}).optional()
|
|
19934
|
+
}).optional(),
|
|
19935
|
+
pending: z.object({
|
|
19936
|
+
mutationId: z.string().uuid(),
|
|
19937
|
+
digest: z.string(),
|
|
19938
|
+
baseRevision: z.number().int().positive()
|
|
19939
|
+
}).optional()
|
|
19940
|
+
});
|
|
19941
|
+
const stateSchema = z.object({
|
|
19942
|
+
schemaVersion: z.literal(1),
|
|
19943
|
+
copyId: z.string().uuid(),
|
|
19944
|
+
scope: z.string(),
|
|
19945
|
+
root: z.string(),
|
|
19946
|
+
rootDevice: z.number(),
|
|
19947
|
+
rootInode: z.number(),
|
|
19948
|
+
files: z.array(fileStateSchema).min(1).max(10)
|
|
19949
|
+
});
|
|
19950
|
+
/** Local receipts only. Every network operation still uses ordinary Space authorization. */
|
|
19951
|
+
function createSpaceWorkingCopies(input) {
|
|
19952
|
+
if (process.platform !== "darwin") throw new Error("Managed working copies are not supported on this platform yet. Use explicit file download and write commands.");
|
|
19953
|
+
const scope = hash(JSON.stringify({
|
|
19954
|
+
accountId: input.scope.accountId,
|
|
19955
|
+
organizationId: input.scope.organizationId,
|
|
19956
|
+
spaceId: input.scope.spaceId,
|
|
19957
|
+
profileId: input.scope.profileId,
|
|
19958
|
+
baseUrl: input.scope.baseUrl
|
|
19959
|
+
}));
|
|
19960
|
+
const directory = join(input.laneRoot, "space-working-copies", scope);
|
|
19961
|
+
const metadataPath = (id) => join(directory, `${z.string().uuid().parse(id)}.json`);
|
|
19962
|
+
async function save(state) {
|
|
19963
|
+
const path = metadataPath(state.copyId);
|
|
19964
|
+
const temporary = `${path}.${randomUUID()}.tmp`;
|
|
19965
|
+
await writeDurablePrivateFile(temporary, JSON.stringify(state));
|
|
19966
|
+
await rename(temporary, path);
|
|
19967
|
+
await createLedgerIo().syncPath(directory);
|
|
19968
|
+
}
|
|
19969
|
+
async function owned(id, run) {
|
|
19970
|
+
const lock = await acquireLock({
|
|
19971
|
+
openMeldProfileId: input.scope.profileId,
|
|
19972
|
+
key: `space-copy:${scope}:${id}`,
|
|
19973
|
+
pathResolution: { env: {
|
|
19974
|
+
...process.env,
|
|
19975
|
+
OPENMELD_HOME: input.laneRoot
|
|
19976
|
+
} }
|
|
19977
|
+
});
|
|
19978
|
+
try {
|
|
19979
|
+
await input.assertCurrentIdentity();
|
|
19980
|
+
const state = stateSchema.parse(JSON.parse(await readFile(metadataPath(id), "utf8")));
|
|
19981
|
+
if (state.scope !== scope || state.copyId !== id) throw new Error("This working copy belongs to another account or Space.");
|
|
19982
|
+
await verifyRoot(state);
|
|
19983
|
+
return await run(state);
|
|
19984
|
+
} finally {
|
|
19985
|
+
await releaseLock(lock);
|
|
19986
|
+
}
|
|
19987
|
+
}
|
|
19988
|
+
async function prepareFiles(state) {
|
|
19989
|
+
let total = 0;
|
|
19990
|
+
for (const file of state.files) {
|
|
19991
|
+
if (file.baseHash) continue;
|
|
19992
|
+
await input.assertCurrentIdentity();
|
|
19993
|
+
const remote = await input.transport.read(file.fileId, file.revision);
|
|
19994
|
+
total += remote.bytes.byteLength;
|
|
19995
|
+
if (remote.revision !== file.revision || remote.bytes.byteLength > 10485760 || total > SPACE_WORK_MAX_BYTES) throw new Error("The selected files exceed transfer limits or do not match their revisions.");
|
|
19996
|
+
const path = await safePath(state, file.relativePath, true);
|
|
19997
|
+
const current = await localBytes(state, file.relativePath);
|
|
19998
|
+
if (current && hash(current) !== hash(remote.bytes)) throw new Error("Preparation found local changes. Keep this copy and prepare a new directory.");
|
|
19999
|
+
if (!current) {
|
|
20000
|
+
const handle = await open(path, CREATE_FLAGS, 384);
|
|
20001
|
+
try {
|
|
20002
|
+
await handle.writeFile(remote.bytes);
|
|
20003
|
+
await handle.sync();
|
|
20004
|
+
} finally {
|
|
20005
|
+
await handle.close();
|
|
20006
|
+
}
|
|
20007
|
+
}
|
|
20008
|
+
file.baseHash = hash(remote.bytes);
|
|
20009
|
+
file.mimeType = remote.mimeType;
|
|
20010
|
+
file.sizeBytes = remote.bytes.byteLength;
|
|
20011
|
+
await save(state);
|
|
20012
|
+
}
|
|
20013
|
+
return {
|
|
20014
|
+
copyId: state.copyId,
|
|
20015
|
+
root: state.root,
|
|
20016
|
+
ready: true
|
|
20017
|
+
};
|
|
20018
|
+
}
|
|
20019
|
+
async function submitPending(state, file) {
|
|
20020
|
+
if (file.conflict) throw new Error("Resolve the file conflict before saving. Use refresh to retrieve the shared version, merge your edits, then resolve with its file ID and revision.");
|
|
20021
|
+
if (!(file.pending && file.mimeType)) return;
|
|
20022
|
+
const pending = file.pending;
|
|
20023
|
+
const bytes = await readFile(join(directory, `${pending.mutationId}.bin`));
|
|
20024
|
+
if (hash(bytes) !== pending.digest) throw new Error("The pending upload snapshot is damaged. Local edits have been preserved.");
|
|
20025
|
+
await input.assertCurrentIdentity();
|
|
20026
|
+
const receipt = await input.transport.write({
|
|
20027
|
+
fileId: file.fileId,
|
|
20028
|
+
baseRevision: pending.baseRevision,
|
|
20029
|
+
bytes,
|
|
20030
|
+
mimeType: file.mimeType,
|
|
20031
|
+
clientMutationId: pending.mutationId
|
|
20032
|
+
}).catch(async (error) => {
|
|
20033
|
+
if (error instanceof OpenMeldApiClientHttpError && error.status === 409 && (error.code === "space_file.conflict" || error.upstreamCode === "space_file.conflict")) {
|
|
20034
|
+
file.conflict = {
|
|
20035
|
+
digest: pending.digest,
|
|
20036
|
+
mutationId: pending.mutationId
|
|
20037
|
+
};
|
|
20038
|
+
file.pending = void 0;
|
|
20039
|
+
await save(state);
|
|
20040
|
+
}
|
|
20041
|
+
throw error;
|
|
20042
|
+
});
|
|
20043
|
+
if (receipt.id !== file.fileId || receipt.latestRevision.sizeBytes !== bytes.byteLength) throw new Error("The file receipt does not match the pending write.");
|
|
20044
|
+
file.revision = receipt.latestRevision.revision;
|
|
20045
|
+
file.baseHash = pending.digest;
|
|
20046
|
+
file.sizeBytes = bytes.byteLength;
|
|
20047
|
+
file.pending = void 0;
|
|
20048
|
+
await save(state);
|
|
20049
|
+
await unlink(join(directory, `${pending.mutationId}.bin`));
|
|
20050
|
+
}
|
|
20051
|
+
return {
|
|
20052
|
+
async prepare(selection, root, copyId = randomUUID()) {
|
|
20053
|
+
const validated = spaceWorkSelectionSchema.parse(selection);
|
|
20054
|
+
await input.assertCurrentIdentity();
|
|
20055
|
+
await mkdir(directory, {
|
|
20056
|
+
recursive: true,
|
|
20057
|
+
mode: 448
|
|
20058
|
+
});
|
|
20059
|
+
const canonicalRoot = join(await realpath(dirname(resolve(root))), basename(resolve(root)));
|
|
20060
|
+
await mkdir(canonicalRoot, { mode: 448 });
|
|
20061
|
+
const identity = await lstat(canonicalRoot);
|
|
20062
|
+
const state = {
|
|
20063
|
+
schemaVersion: 1,
|
|
20064
|
+
copyId: z.uuid().parse(copyId),
|
|
20065
|
+
scope,
|
|
20066
|
+
root: canonicalRoot,
|
|
20067
|
+
rootDevice: identity.dev,
|
|
20068
|
+
rootInode: identity.ino,
|
|
20069
|
+
files: validated.files
|
|
20070
|
+
};
|
|
20071
|
+
await save(state);
|
|
20072
|
+
try {
|
|
20073
|
+
return await owned(state.copyId, prepareFiles);
|
|
20074
|
+
} catch (error) {
|
|
20075
|
+
throw new Error(`Working copy ${state.copyId} is incomplete. Resume preparation with this copy ID; its files are preserved.`, { cause: error });
|
|
20076
|
+
}
|
|
20077
|
+
},
|
|
20078
|
+
resume: (copyId) => owned(copyId, prepareFiles),
|
|
20079
|
+
status: (copyId) => owned(copyId, async (state) => ({
|
|
20080
|
+
copyId,
|
|
20081
|
+
root: state.root,
|
|
20082
|
+
files: await Promise.all(state.files.map(async (file) => {
|
|
20083
|
+
const bytes = file.baseHash ? await localBytes(state, file.relativePath) : null;
|
|
20084
|
+
return {
|
|
20085
|
+
fileId: file.fileId,
|
|
20086
|
+
relativePath: file.relativePath,
|
|
20087
|
+
revision: file.revision,
|
|
20088
|
+
status: localStatus(file, bytes),
|
|
20089
|
+
...file.conflict?.incoming ? {
|
|
20090
|
+
incomingRevision: file.conflict.incoming.revision,
|
|
20091
|
+
incomingPath: file.conflict.incoming.relativePath
|
|
20092
|
+
} : {}
|
|
20093
|
+
};
|
|
20094
|
+
}))
|
|
20095
|
+
})),
|
|
20096
|
+
commit: (copyId) => owned(copyId, async (state) => {
|
|
20097
|
+
if (state.files.some((file) => !(file.baseHash && file.mimeType))) throw new Error("Finish preparing all selected files before committing.");
|
|
20098
|
+
for (const file of state.files) await submitPending(state, file);
|
|
20099
|
+
for (const file of state.files) {
|
|
20100
|
+
const bytes = await localBytes(state, file.relativePath);
|
|
20101
|
+
if (!bytes) throw new Error("A selected local file is missing. Missing files do not delete shared files.");
|
|
20102
|
+
if (hash(bytes) === file.baseHash) continue;
|
|
20103
|
+
const mutationId = randomUUID();
|
|
20104
|
+
await writeDurablePrivateFile(join(directory, `${mutationId}.bin`), bytes);
|
|
20105
|
+
file.pending = {
|
|
20106
|
+
mutationId,
|
|
20107
|
+
digest: hash(bytes),
|
|
20108
|
+
baseRevision: file.revision
|
|
20109
|
+
};
|
|
20110
|
+
await save(state);
|
|
20111
|
+
await submitPending(state, file);
|
|
20112
|
+
}
|
|
20113
|
+
return {
|
|
20114
|
+
copyId,
|
|
20115
|
+
references: await Promise.all(state.files.map(async (file) => {
|
|
20116
|
+
await input.assertCurrentIdentity();
|
|
20117
|
+
const current = await input.transport.get(file.fileId);
|
|
20118
|
+
return {
|
|
20119
|
+
fileId: file.fileId,
|
|
20120
|
+
revision: file.revision,
|
|
20121
|
+
name: current.name,
|
|
20122
|
+
mimeType: z.string().parse(file.mimeType),
|
|
20123
|
+
sizeBytes: z.number().int().nonnegative().parse(file.sizeBytes)
|
|
20124
|
+
};
|
|
20125
|
+
})),
|
|
20126
|
+
files: state.files.map(({ fileId, relativePath, revision }) => ({
|
|
20127
|
+
fileId,
|
|
20128
|
+
relativePath,
|
|
20129
|
+
revision
|
|
20130
|
+
}))
|
|
20131
|
+
};
|
|
20132
|
+
}),
|
|
20133
|
+
reconcile: (copyId) => owned(copyId, async (state) => {
|
|
20134
|
+
for (const file of state.files) await submitPending(state, file);
|
|
20135
|
+
return {
|
|
20136
|
+
copyId,
|
|
20137
|
+
reconciled: true
|
|
20138
|
+
};
|
|
20139
|
+
}),
|
|
20140
|
+
refresh: (copyId) => owned(copyId, async (state) => {
|
|
20141
|
+
for (const file of state.files) {
|
|
20142
|
+
if (!file.conflict || file.conflict.incoming) continue;
|
|
20143
|
+
await input.assertCurrentIdentity();
|
|
20144
|
+
const revision = (await input.transport.get(file.fileId)).latestRevision.revision;
|
|
20145
|
+
const remote = await input.transport.read(file.fileId, revision);
|
|
20146
|
+
if (remote.revision !== revision || remote.bytes.byteLength > 10485760) throw new Error("The incoming file does not match its revision or exceeds transfer limits.");
|
|
20147
|
+
const relativePath = `.openmeld-incoming-${randomUUID()}`;
|
|
20148
|
+
const handle = await open(await safePath(state, relativePath), CREATE_FLAGS, 384);
|
|
20149
|
+
try {
|
|
20150
|
+
await handle.writeFile(remote.bytes);
|
|
20151
|
+
await handle.sync();
|
|
20152
|
+
} finally {
|
|
20153
|
+
await handle.close();
|
|
20154
|
+
}
|
|
20155
|
+
file.conflict.incoming = {
|
|
20156
|
+
revision,
|
|
20157
|
+
relativePath,
|
|
20158
|
+
digest: hash(remote.bytes),
|
|
20159
|
+
mimeType: remote.mimeType,
|
|
20160
|
+
sizeBytes: remote.bytes.byteLength
|
|
20161
|
+
};
|
|
20162
|
+
await save(state);
|
|
20163
|
+
}
|
|
20164
|
+
return {
|
|
20165
|
+
copyId,
|
|
20166
|
+
refreshed: true
|
|
20167
|
+
};
|
|
20168
|
+
}),
|
|
20169
|
+
resolve: (copyId, fileId, revision) => owned(copyId, async (state) => {
|
|
20170
|
+
const file = state.files.find((entry) => entry.fileId === fileId);
|
|
20171
|
+
const conflict = file?.conflict;
|
|
20172
|
+
const incoming = conflict?.incoming;
|
|
20173
|
+
if (!(file && incoming) || incoming.revision !== revision) throw new Error("Refresh this conflicted file and explicitly select the downloaded incoming revision.");
|
|
20174
|
+
const bytes = await localBytes(state, file.relativePath);
|
|
20175
|
+
const digest = bytes ? hash(bytes) : null;
|
|
20176
|
+
if (!digest || digest === conflict.digest && digest !== incoming.digest) throw new Error("Merge the incoming version into the working file before resolving. The rejected edit cannot be resubmitted against a newer base unchanged.");
|
|
20177
|
+
file.revision = revision;
|
|
20178
|
+
file.baseHash = incoming.digest;
|
|
20179
|
+
file.mimeType = incoming.mimeType;
|
|
20180
|
+
file.sizeBytes = incoming.sizeBytes;
|
|
20181
|
+
file.conflict = void 0;
|
|
20182
|
+
await save(state);
|
|
20183
|
+
return {
|
|
20184
|
+
copyId,
|
|
20185
|
+
resolved: true
|
|
20186
|
+
};
|
|
20187
|
+
}),
|
|
20188
|
+
incoming: (copyId, root) => owned(copyId, async (state) => {
|
|
20189
|
+
const files = [];
|
|
20190
|
+
for (const file of state.files) {
|
|
20191
|
+
await input.assertCurrentIdentity();
|
|
20192
|
+
const current = await input.transport.get(file.fileId);
|
|
20193
|
+
files.push({
|
|
20194
|
+
fileId: file.fileId,
|
|
20195
|
+
relativePath: file.relativePath,
|
|
20196
|
+
revision: current.latestRevision.revision
|
|
20197
|
+
});
|
|
20198
|
+
}
|
|
20199
|
+
return await createSpaceWorkingCopies(input).prepare({
|
|
20200
|
+
schemaVersion: 1,
|
|
20201
|
+
files
|
|
20202
|
+
}, root);
|
|
20203
|
+
})
|
|
20204
|
+
};
|
|
20205
|
+
}
|
|
20206
|
+
async function writeDurablePrivateFile(path, data) {
|
|
20207
|
+
const file = await open(path, "wx", 384);
|
|
20208
|
+
try {
|
|
20209
|
+
await file.writeFile(data);
|
|
20210
|
+
await file.sync();
|
|
20211
|
+
} finally {
|
|
20212
|
+
await file.close();
|
|
20213
|
+
}
|
|
20214
|
+
}
|
|
20215
|
+
async function verifyRoot(state) {
|
|
20216
|
+
const root = await lstat(state.root);
|
|
20217
|
+
if (!root.isDirectory() || root.isSymbolicLink() || root.dev !== state.rootDevice || root.ino !== state.rootInode || await realpath(state.root) !== state.root) throw new Error("The working directory changed. No files were submitted.");
|
|
20218
|
+
}
|
|
20219
|
+
async function safePath(state, relativePath, createParents = false) {
|
|
20220
|
+
await verifyRoot(state);
|
|
20221
|
+
const segments = spaceWorkRelativePathSchema.parse(relativePath).split("/");
|
|
20222
|
+
let parent = state.root;
|
|
20223
|
+
for (const segment of segments.slice(0, -1)) {
|
|
20224
|
+
parent = join(parent, segment);
|
|
20225
|
+
if (createParents) try {
|
|
20226
|
+
await mkdir(parent, { mode: 448 });
|
|
20227
|
+
} catch (error) {
|
|
20228
|
+
if (error.code !== "EEXIST") throw error;
|
|
20229
|
+
}
|
|
20230
|
+
const stat = await lstat(parent);
|
|
20231
|
+
if (!stat.isDirectory() || stat.isSymbolicLink() || await realpath(parent) !== parent) throw new Error("A working file path crosses a symbolic link or changed directory.");
|
|
20232
|
+
}
|
|
20233
|
+
return join(parent, segments.at(-1) ?? "");
|
|
20234
|
+
}
|
|
20235
|
+
async function localBytes(state, relativePath) {
|
|
20236
|
+
const path = await safePath(state, relativePath);
|
|
20237
|
+
let handle;
|
|
20238
|
+
try {
|
|
20239
|
+
handle = await open(path, READ_FLAGS);
|
|
20240
|
+
} catch (error) {
|
|
20241
|
+
if (error.code === "ENOENT") return null;
|
|
20242
|
+
throw error;
|
|
20243
|
+
}
|
|
20244
|
+
try {
|
|
20245
|
+
const stat = await handle.stat();
|
|
20246
|
+
if (!stat.isFile() || stat.nlink !== 1 || stat.size > 10485760) throw new Error("Select a regular file up to 10 MiB without hard links.");
|
|
20247
|
+
const bytes = Buffer.alloc(stat.size);
|
|
20248
|
+
let offset = 0;
|
|
20249
|
+
while (offset < bytes.length) {
|
|
20250
|
+
const result = await handle.read(bytes, offset, bytes.length - offset, offset);
|
|
20251
|
+
if (result.bytesRead === 0) throw new Error("The local file changed while it was being read. Retry the save.");
|
|
20252
|
+
offset += result.bytesRead;
|
|
20253
|
+
}
|
|
20254
|
+
const after = await handle.stat();
|
|
20255
|
+
if (after.size !== stat.size || after.mtimeMs !== stat.mtimeMs || after.ctimeMs !== stat.ctimeMs) throw new Error("The local file changed while it was being read. Retry the save.");
|
|
20256
|
+
await verifyRoot(state);
|
|
20257
|
+
return bytes;
|
|
20258
|
+
} finally {
|
|
20259
|
+
await handle.close();
|
|
20260
|
+
}
|
|
20261
|
+
}
|
|
20262
|
+
function localStatus(file, bytes) {
|
|
20263
|
+
if (file.conflict) return "conflict";
|
|
20264
|
+
if (file.pending) return "pending";
|
|
20265
|
+
if (!file.baseHash) return "preparing";
|
|
20266
|
+
if (!bytes) return "missing";
|
|
20267
|
+
return hash(bytes) === file.baseHash ? "clean" : "changed";
|
|
20268
|
+
}
|
|
20269
|
+
//#endregion
|
|
20270
|
+
//#region src/local-service/file-access/dispatch-work-handoff.ts
|
|
20271
|
+
/** The admitted Service prepares inputs; no login state is copied into the workspace. */
|
|
20272
|
+
async function prepareDispatchWorkHandoff(input) {
|
|
20273
|
+
const { task } = input;
|
|
20274
|
+
if (!task.workHandoff) return input.workingDirectory;
|
|
20275
|
+
if (!task.executionContext || task.executionContext.access !== "space_context" || task.agentControllerRef !== "builtin:codex" || task.transportMode !== "codex-app-server") throw new Error("Selected-file handoffs require a new Space-only context on Codex App Server. This controller cannot enforce that boundary.");
|
|
20276
|
+
const organizationId = task.executionContext.scope.organizationId;
|
|
20277
|
+
const baseUrl = await resolveBaseUrl();
|
|
20278
|
+
const laneRoot = resolveOpenMeldRootDir();
|
|
20279
|
+
const assertCurrentIdentity = async () => {
|
|
20280
|
+
const auth = await getAuthSessionState({ validateRemote: false });
|
|
20281
|
+
if (auth.session?.user?.id !== input.ownerUserId || auth.session?.activeOrganization?.id !== organizationId) throw new Error("The account or Organization changed before handoff preparation.");
|
|
20282
|
+
};
|
|
20283
|
+
await assertCurrentIdentity();
|
|
20284
|
+
const requestContext = buildOpenMeldRequestContextFromProfileIdentity({ profileIdentity: {
|
|
20285
|
+
openMeldProfileId: task.targetProfileId,
|
|
20286
|
+
profileKind: "agent",
|
|
20287
|
+
ownerUserId: input.ownerUserId,
|
|
20288
|
+
profileName: task.targetProfileName ?? task.targetProfileId
|
|
20289
|
+
} });
|
|
20290
|
+
const foundation = createCliApiClientFoundation(baseUrl, {
|
|
20291
|
+
expectedOwnerUserId: input.ownerUserId,
|
|
20292
|
+
organizationId
|
|
20293
|
+
});
|
|
20294
|
+
const api = createSpaceApi(foundation);
|
|
20295
|
+
const common = {
|
|
20296
|
+
spaceId: task.spaceId,
|
|
20297
|
+
requestContext,
|
|
20298
|
+
...task.spacePassword ? { spacePassword: task.spacePassword } : {}
|
|
20299
|
+
};
|
|
20300
|
+
const copies = createSpaceWorkingCopies({
|
|
20301
|
+
laneRoot,
|
|
20302
|
+
scope: {
|
|
20303
|
+
accountId: input.ownerUserId,
|
|
20304
|
+
organizationId,
|
|
20305
|
+
spaceId: task.spaceId,
|
|
20306
|
+
profileId: task.targetProfileId,
|
|
20307
|
+
baseUrl
|
|
20308
|
+
},
|
|
20309
|
+
assertCurrentIdentity,
|
|
20310
|
+
transport: {
|
|
20311
|
+
read: (fileId, revision) => downloadWorkingCopyFile(api, {
|
|
20312
|
+
...common,
|
|
20313
|
+
fileId,
|
|
20314
|
+
revision
|
|
20315
|
+
}),
|
|
20316
|
+
get: async (fileId) => (await api.getFile({
|
|
20317
|
+
...common,
|
|
20318
|
+
fileId
|
|
20319
|
+
})).file,
|
|
20320
|
+
write: async (write) => await api.updateFileContent({
|
|
20321
|
+
...common,
|
|
20322
|
+
...write
|
|
20323
|
+
})
|
|
20324
|
+
}
|
|
20325
|
+
});
|
|
20326
|
+
const key = createHash("sha256").update(JSON.stringify([
|
|
20327
|
+
baseUrl,
|
|
20328
|
+
input.ownerUserId,
|
|
20329
|
+
organizationId,
|
|
20330
|
+
task.spaceId,
|
|
20331
|
+
task.targetProfileId,
|
|
20332
|
+
task.taskId
|
|
20333
|
+
])).digest("hex");
|
|
20334
|
+
const records = join(laneRoot, "space-work-dispatches");
|
|
20335
|
+
await mkdir(records, {
|
|
20336
|
+
recursive: true,
|
|
20337
|
+
mode: 448
|
|
20338
|
+
});
|
|
20339
|
+
const recordPath = join(records, `${key}.json`);
|
|
20340
|
+
let copyId;
|
|
20341
|
+
let root;
|
|
20342
|
+
const stored = await readFile(recordPath, "utf8").catch((error) => {
|
|
20343
|
+
if (error.code === "ENOENT") return null;
|
|
20344
|
+
throw error;
|
|
20345
|
+
});
|
|
20346
|
+
if (stored) {
|
|
20347
|
+
const record = JSON.parse(stored);
|
|
20348
|
+
copyId = record.copyId;
|
|
20349
|
+
root = (await copies.resume(copyId)).root;
|
|
20350
|
+
if (root !== record.root || root !== join(input.workingDirectory, `handoff-${copyId}`)) throw new Error("The handoff workspace identity changed.");
|
|
20351
|
+
} else {
|
|
20352
|
+
copyId = randomUUID();
|
|
20353
|
+
root = join(input.workingDirectory, `handoff-${copyId}`);
|
|
20354
|
+
await copies.prepare(spaceWorkSelectionSchema.parse({
|
|
20355
|
+
schemaVersion: 1,
|
|
20356
|
+
files: task.workHandoff.files
|
|
20357
|
+
}), root, copyId);
|
|
20358
|
+
await writeFile(recordPath, JSON.stringify({
|
|
20359
|
+
copyId,
|
|
20360
|
+
root
|
|
20361
|
+
}), {
|
|
20362
|
+
flag: "wx",
|
|
20363
|
+
mode: 384
|
|
20364
|
+
});
|
|
20365
|
+
}
|
|
20366
|
+
const skillsRoot = join(root, ".openmeld-skills");
|
|
20367
|
+
if (task.workHandoff.skills.length) {
|
|
20368
|
+
await mkdir(skillsRoot, {
|
|
20369
|
+
recursive: true,
|
|
20370
|
+
mode: 448
|
|
20371
|
+
});
|
|
20372
|
+
if ((await lstat(skillsRoot)).isSymbolicLink()) throw new Error("The Skill directory was replaced by a symbolic link.");
|
|
20373
|
+
}
|
|
20374
|
+
const skills = createOrganizationSkillsApi(foundation);
|
|
20375
|
+
for (const [index, selected] of task.workHandoff.skills.entries()) {
|
|
20376
|
+
await assertCurrentIdentity();
|
|
20377
|
+
const result = await skills.get({
|
|
20378
|
+
...selected,
|
|
20379
|
+
requestContext
|
|
20380
|
+
});
|
|
20381
|
+
const release = result.selectedRelease;
|
|
20382
|
+
if (!release || result.skill.organizationId !== organizationId || !result.skill.enabled || release.releaseId !== selected.releaseId || release.digest !== selected.digest || release.bundle.portable.name !== selected.name) throw new Error("The selected Skill release is unavailable or changed. No latest-version fallback is allowed.");
|
|
20383
|
+
await materializeOrganizationSkillRelease({
|
|
20384
|
+
...selected,
|
|
20385
|
+
organizationId,
|
|
20386
|
+
bundle: release.bundle,
|
|
20387
|
+
releaseDirectory: join(skillsRoot, String(index))
|
|
20388
|
+
});
|
|
20389
|
+
}
|
|
20390
|
+
await assertCurrentIdentity();
|
|
20391
|
+
await copies.status(copyId);
|
|
20392
|
+
task.workingCopyId = copyId;
|
|
20393
|
+
task.prompt += "\n\nThe selected inputs are prepared in your working directory. Selected Skills (including resources) are in .openmeld-skills/<selection index>/SKILL.md. Use the working_copy tool to check, commit or reconcile your edits; it does not complete this Wake. Attach the exact saved file references with the reply tool when delivering results.";
|
|
20394
|
+
return root;
|
|
20395
|
+
}
|
|
20396
|
+
//#endregion
|
|
19717
20397
|
//#region src/space/cli-space-api.ts
|
|
19718
20398
|
function createCliSpaceApi(baseUrl, options = {}) {
|
|
19719
20399
|
return createSpaceApi(createCliApiClientFoundation(baseUrl, options));
|
|
@@ -21389,10 +22069,7 @@ function executionContextResourceScope(context) {
|
|
|
21389
22069
|
return context.access === "workspace" ? "exclusive" : "read_only";
|
|
21390
22070
|
}
|
|
21391
22071
|
function executionContextFileAccessBoundary(input) {
|
|
21392
|
-
const within =
|
|
21393
|
-
const path = relative(parent, child);
|
|
21394
|
-
return path === "" || path !== ".." && !path.startsWith("../") && !isAbsolute(path);
|
|
21395
|
-
};
|
|
22072
|
+
const within = isSameOrDescendantPath;
|
|
21396
22073
|
const policy = input.policy;
|
|
21397
22074
|
if (input.context.access !== "space_context") {
|
|
21398
22075
|
const policySource = input.taskWorkspace?.sourceWorkingDirectory ?? input.workingDirectory;
|
|
@@ -21401,10 +22078,11 @@ function executionContextFileAccessBoundary(input) {
|
|
|
21401
22078
|
}
|
|
21402
22079
|
return {
|
|
21403
22080
|
mode: "only_selected_folders",
|
|
21404
|
-
folders: [input.taskWorkspace?.boundaryRoot ?? input.workingDirectory],
|
|
22081
|
+
folders: [input.context.access === "space_context" && input.workingCopyId ? input.workingDirectory : input.taskWorkspace?.boundaryRoot ?? input.workingDirectory],
|
|
21405
22082
|
revision: policy.revision,
|
|
21406
22083
|
updatedAtMs: policy.updatedAtMs,
|
|
21407
|
-
executionContextAccess: input.context.access
|
|
22084
|
+
executionContextAccess: input.context.access,
|
|
22085
|
+
...input.context.access === "space_context" && input.workingCopyId ? { workingCopyId: input.workingCopyId } : {}
|
|
21408
22086
|
};
|
|
21409
22087
|
}
|
|
21410
22088
|
async function executionContextWorkingDirectory(input) {
|
|
@@ -22375,7 +23053,11 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22375
23053
|
currentWorkingDirectory: originalWorkingDirectory,
|
|
22376
23054
|
computerFileAccessStorePath: input.computerFileAccessStorePath
|
|
22377
23055
|
});
|
|
22378
|
-
effectiveRuntimeContext = { providerRuntimeWorkingDirectory:
|
|
23056
|
+
effectiveRuntimeContext = { providerRuntimeWorkingDirectory: await prepareDispatchWorkHandoff({
|
|
23057
|
+
task: parsedTask,
|
|
23058
|
+
ownerUserId: input.profileOwnerUserId,
|
|
23059
|
+
workingDirectory: taskWorkspace.workingDirectory
|
|
23060
|
+
}) };
|
|
22379
23061
|
runtimePreparation.effectiveRuntimeContext = effectiveRuntimeContext;
|
|
22380
23062
|
computerFileAccessBoundary = await resolveDispatchComputerFileAccess({
|
|
22381
23063
|
computerFileAccessStorePath: input.computerFileAccessStorePath,
|
|
@@ -23693,7 +24375,8 @@ async function resolveDispatchComputerFileAccess(input) {
|
|
|
23693
24375
|
context,
|
|
23694
24376
|
workingDirectory,
|
|
23695
24377
|
policy,
|
|
23696
|
-
taskWorkspace: input.taskWorkspace
|
|
24378
|
+
taskWorkspace: input.taskWorkspace,
|
|
24379
|
+
workingCopyId: input.parsedTask.workingCopyId
|
|
23697
24380
|
});
|
|
23698
24381
|
if (!(await verifier({
|
|
23699
24382
|
boundary,
|
|
@@ -23740,6 +24423,7 @@ async function resolveDispatchComputerFileAccess(input) {
|
|
|
23740
24423
|
}
|
|
23741
24424
|
function createDispatchSpaceActionRuntimeContext(input) {
|
|
23742
24425
|
const contextResult = createDispatchSpaceActionContext({
|
|
24426
|
+
workingCopyId: input.parsedTask.workingCopyId,
|
|
23743
24427
|
attemptId: input.parsedTask.attemptId,
|
|
23744
24428
|
dispatchId: input.parsedTask.dispatchId,
|
|
23745
24429
|
env: process.env,
|
|
@@ -28469,6 +29153,7 @@ function createStopAwareDelay() {
|
|
|
28469
29153
|
//#region src/local-service/carrier/service-runner.ts
|
|
28470
29154
|
function buildLocalServiceCapabilityHeaders(input) {
|
|
28471
29155
|
return {
|
|
29156
|
+
...process.platform === "darwin" ? { [SPACE_WORK_HANDOFF_CAPABILITY_HEADER]: "1" } : {},
|
|
28472
29157
|
[OPENMELD_REASONING_STREAM_HEADER]: "1",
|
|
28473
29158
|
...input.localFolderPickerAvailable ? { [OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER]: LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY } : {},
|
|
28474
29159
|
[OPENMELD_RUNTIME_CAPABILITIES_HEADER]: COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY
|
|
@@ -28888,7 +29573,7 @@ const runAccountBoundDaemonServiceLoop = async (input) => {
|
|
|
28888
29573
|
});
|
|
28889
29574
|
},
|
|
28890
29575
|
getContext: async () => ({
|
|
28891
|
-
accountCheckedServiceControl:
|
|
29576
|
+
accountCheckedServiceControl: isPreciseProcessStartIdentity(CURRENT_PROCESS_START_IDENTITY),
|
|
28892
29577
|
healthPayload: {
|
|
28893
29578
|
checkedAt: nowIsoString(),
|
|
28894
29579
|
...toHealthProjection(stopRequested ? {
|
|
@@ -37056,6 +37741,6 @@ function parseDaemonRunMode(rawMode) {
|
|
|
37056
37741
|
return DEFAULT_DAEMON_RUN_MODE;
|
|
37057
37742
|
}
|
|
37058
37743
|
//#endregion
|
|
37059
|
-
export {
|
|
37744
|
+
export { toStructuredGatewayFailure as $, buildUnifiedCardFrame as $n, extractMentionAuthoringPrefix as $t, buildDaemonStartNeedsAttentionCard as A, registerAgentActivityRoute as An, toSpaceConfigListIntegrityError as At, resolveDaemonServiceParticipationStatus as B, ensureCommandAuthenticationOrCancel as Bn, buildSignalMessageReadProjection as Bt, buildProfileWorkspaceRows as C, enqueueAgentActivityHookEvent as Cn, revokeOrganizationJoinLinkResponseSchema as Cr, listSpaceConfigs as Ct, createDelayedSpinner as D, enqueueControllerTaskLifecycleEventWhileLocked as Dn, readSpaceRecentMentionProfileIds as Dt, emitDaemonAgentOverview as E, removeProjectOutbox as En, readSpaceLastSeenTs as Et, emitCliJsonEnvelope as F, installAgentActivityIntegrations as Fn, SpaceComposerSubmissionError as Ft, materializeOrganizationSkillRelease as G, runAuthStatus as Gn, buildSpaceProfileAddPlan as Gt, createCliSpaceApi as H, runAuthLogin as Hn, buildSpaceMemberAgentPresencePresentation as Ht, runDaemonStartupPreflight as I, readAgentActivityIntegrationStatus as In, buildDispatchResultMessageReadProjection as It, parseSpaceMetaPayload as J, buildAuthStatusSnapshot as Jn, closeMentionPickerState as Jt, fetchSpaceMeta as K, exchangeOneTimeTokenAuthSession as Kn, buildSpaceRoundReadProjection as Kt, readDaemonIncidentLogTail as L, resolveAgentActivityDispatcherCommand as Ln, buildDispatchResultReplyWorkflowProjection as Lt, buildHumanErrorCopy as M, unregisterAgentActivityRoute as Mn, upsertSpaceConfig as Mt, renderHumanErrorCard as N, AGENT_ACTIVITY_INTEGRATION_OWNER as Nn, writeSpaceCacheDeletionNoticeState as Nt, shouldEmitAgentOverview as O, readControllerTaskLifecycleOutboxHealth as On, removeSpaceConfig as Ot, renderHumanTextErrorCard as P, defaultManagedIntegrationPaths as Pn, writeSpaceRecentMentionProfileIds as Pt, readGatewayTextResponse as Q, renderTextInfoCard as Qn, enterRelationPickerState as Qt, resolveLocalComponentsStatus as R, uninstallAgentActivityIntegrations as Rn, buildPublicSpaceEntryUrl as Rt, buildProfileWorkspacePresentation as S, removeAgentActivityContextCache as Sn, organizationJoinLinkManagementQuerySchema as Sr, isLocalSpaceStateCorruptResult as St, createQuietPresenter as T, readAgentActivityOutboxHealth as Tn, readSpaceConfig as Tt, createSpaceWorkingCopies as U, runAuthLogout as Un, buildSpaceMentionProfileIndex as Ut, fetchSpaceUpdates as V, evaluateCommandAuthentication as Vn, buildSignalReplyWorkflowProjection as Vt, downloadWorkingCopyFile as W, runAuthMenu as Wn, buildSpaceMessageReadRelationSummary as Wt, GatewayHttpError as X, buildTextInfoCardLines as Xn, createSpaceMemberIdentityIndex as Xt, parseSpaceMetaResponse as Y, formatActiveOrganizationLabel as Yn, collectResolvedSpaceMentions as Yt, readGatewayJsonResponse as Z, renderInfoCard as Zn, createSpaceTargetCatalog as Zt, buildDaemonBackgroundStartFailure as _, buildAgentActivityEvent as _n, cliJsonSkillsLoadEnvelopeSchema as _r, resolveLocalAgentControllerReportDecision as _t, runDaemonBackgroundStartForDecision as a, openTargetPickerState as an, isCurrentCommandCheckScopeActive as ar, readDispatchSpaceActionContextForReceiptFromEnv as at, formatServiceRuntimeHeadline as b, readCodexSessionTitles as bn, getOrganizationJoinLinkResponseSchema as br, LocalSpaceStateIntegrityError as bt, runDaemonInterrupt as c, resolveNextRecentMentionProfileIdsForQueuedText as cn, extractAuthApiErrorMessage as cr, LocalProjectConnectionError as ct, runDaemonServiceDetached as d, updateAuthoredMentionRanges as dn, resolveDeviceAuthClientId as dr, submitProfileRuntimeAgentControllerReport as dt, formatRemovedCcRelationMessage as en, promptTextEntry as er, parseJsonResponse as et, runDaemonSnapshot as f, DISPATCH_OWNED_RUNTIME_MODE as fn, resolveDeviceTokenExpiresAt as fr, submitRuntimeAgentControllerReport as ft, runDaemonUninstall as g, syncLocalAgentActivity as gn, cliJsonSkillsListEnvelopeSchema as gr, resolveLocalAgentControllerLaunchability as gt, runDaemonTeardownStrict as h, connectWebSocket as hn, cliJsonOutputEnvelopeSchema as hr, resolveLocalAgentControllerBlockerReasonCodes as ht, runDaemonAutostart as i, listSpaceMentionSuggestions as in, getCurrentCommandCheckState as ir, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as it, runDaemonStartDecisionPrompt as j, resolveAgentActivityRouteForPath as jn, updateSpaceLastSeenTs as jt, buildDaemonStartDeferredCard as k, isAgentActivityRouteRegistered as kn, toLocalSpaceStateIntegrityError as kt, runDaemonReinstall as l, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as ln, fetchAuthUserSnapshot as lr, validateLocalProjectConnectionPath as lt, runDaemonStop as m, readRecentDaemonDispatchJournalEvents as mn, cliJsonErrorEnvelopeSchema as mr, collectLocalAgentControllerInventory as mt, isManagedSystemServiceBootstrapRun as n, isTargetPickerState as nn, runInteractivePrompt as nr, readDispatchOwnedRuntimeGuard as nt, runDaemonCancel as o, prepareSpaceComposerSubmission as on, resetCurrentCommandCheckState as or, readDispatchSpaceActionContextFromEnv as ot, runDaemonStatusFlow as p, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as pn, revokeAuthAccessToken as pr, submitRuntimeAgentControllerReports as pt, updateSpaceMeta as q, buildAuthStatusRows as qn, buildUpdatesReplyWorkflowProjection as qt, runDaemon as r, listSpaceMentionRelationChoices as rn, finishCurrentCommandCheckScope as rr, DispatchSpaceActionClosedError as rt, runDaemonInstall as s, prepareSpaceFileOnlySubmission as sn, startCurrentCommandCheckScope as sr, writeDispatchSpaceActionRecord as st, bestEffortStopCurrentLaneDaemonService as t, isRelationPickerState as tn, isReturnKeypress as tr, assertDispatchOwnedRuntimePublicWriteAllowed as tt, runDaemonRunAfterEntryChecks as u, returnToTargetPickerState as un, requestDeviceToken as ur, readRuntimeReportingHealthState as ut, buildSystemServiceStartupFailureReportFromVerdict as v, resolveObservedAgentActivityBinding as vn, cliJsonSkillsShowEnvelopeSchema as vr, resolveAgentControllerInterfaceSnapshot as vt, reconcileCliVersionView as w, removeProjectInbox as wn, readSpaceCacheDeletionNoticeState as wt, resolveServiceParticipationReadiness as x, readAgentActivityContextForPath as xn, organizationJoinLinkErrorResponseSchema as xr, inspectSpaceCacheFile as xt, formatServiceParticipationReadinessLabel as y, normalizeSharedSessionTitle as yn, acceptOrganizationJoinLinkBodySchema as yr, projectSpaceProfileCache as yt, writeInstalledLocalComponentsSnapshot as z, buildCommandAuthenticationPromptMessage as zn, buildSignalIndex as zt };
|
|
37060
37745
|
|
|
37061
|
-
//# sourceMappingURL=service-
|
|
37746
|
+
//# sourceMappingURL=service-Cl_Ge6oJ.js.map
|