openmeld 0.3.207 → 0.3.209
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-1JHMjZoR.js → add-me-membership-Ck31xM9l.js} +2 -2
- package/dist/{add-me-membership-1JHMjZoR.js.map → add-me-membership-Ck31xM9l.js.map} +1 -1
- package/dist/{agents-CIDsThyG.js → agents-Caxxitma.js} +1190 -188
- package/dist/agents-Caxxitma.js.map +1 -0
- package/dist/{api-client-foundation-DSurenul.js → api-client-foundation-BGGVYxgq.js} +3 -3
- package/dist/{api-client-foundation-DSurenul.js.map → api-client-foundation-BGGVYxgq.js.map} +1 -1
- package/dist/{api-client-foundation-D6_NXHPV.js → api-client-foundation-LfQQZwak.js} +1 -1
- package/dist/{auth-session-CO5XtFaq.js → auth-session-CVxflepT.js} +2 -2
- package/dist/{auth-session-CO5XtFaq.js.map → auth-session-CVxflepT.js.map} +1 -1
- package/dist/auth-session-LTSqq_Tb.js +4 -0
- package/dist/{command-Bzt9zgnI.js → command-DqXu9TET.js} +48 -9
- package/dist/command-DqXu9TET.js.map +1 -0
- package/dist/{computer-connection-BOl79Ftf.js → computer-connection-TgsnU0K9.js} +2 -2
- package/dist/{computer-connection-BOl79Ftf.js.map → computer-connection-TgsnU0K9.js.map} +1 -1
- package/dist/{computer-connection-review-BTOvbJYL.js → computer-connection-review-Dg4TZc8O.js} +6 -6
- package/dist/{computer-connection-review-BTOvbJYL.js.map → computer-connection-review-Dg4TZc8O.js.map} +1 -1
- package/dist/{computer-setup-continuation-DmKdhR5u.js → computer-setup-continuation-Imn8Ykr-.js} +4 -4
- package/dist/{computer-setup-continuation-DmKdhR5u.js.map → computer-setup-continuation-Imn8Ykr-.js.map} +1 -1
- package/dist/{daemon-service-runtime-DQW9gSLT.js → daemon-service-runtime-CRHAVnEX.js} +3 -3
- package/dist/{daemon-service-runtime-DQW9gSLT.js.map → daemon-service-runtime-CRHAVnEX.js.map} +1 -1
- package/dist/{dist-D-kJdWZE.js → dist-CtoP6msP.js} +252 -188
- package/dist/dist-CtoP6msP.js.map +1 -0
- package/dist/dist-DVciurWV.js +4 -0
- package/dist/{elapsed-time-CcoM2R3N.js → elapsed-time-D6DCEnz7.js} +4 -4
- package/dist/{elapsed-time-CcoM2R3N.js.map → elapsed-time-D6DCEnz7.js.map} +1 -1
- package/dist/{installation-inventory-DJlwXa1q.js → installation-inventory-uRDaBzO_.js} +3 -3
- package/dist/{installation-inventory-DJlwXa1q.js.map → installation-inventory-uRDaBzO_.js.map} +1 -1
- package/dist/{openmeld-CiL4AiB0.js → openmeld-DYSsGBFL.js} +260 -38
- package/dist/openmeld-DYSsGBFL.js.map +1 -0
- package/dist/{openmeld-maintenance-worker-DjdmRASI.js → openmeld-maintenance-worker-sNN5314u.js} +5 -5
- package/dist/{openmeld-maintenance-worker-DjdmRASI.js.map → openmeld-maintenance-worker-sNN5314u.js.map} +1 -1
- package/dist/{openmeld-tools-update-coordinator-D9Skj8IE.js → openmeld-tools-update-coordinator-jJrVAHgC.js} +516 -104
- package/dist/openmeld-tools-update-coordinator-jJrVAHgC.js.map +1 -0
- package/dist/openmeld.js +3 -3
- package/dist/{prepare-session-executor-B0NtjHEL.js → prepare-session-executor-DtWDB9RM.js} +9 -9
- package/dist/{prepare-session-executor-B0NtjHEL.js.map → prepare-session-executor-DtWDB9RM.js.map} +1 -1
- package/dist/{runtime-transport-QIZmAo4-.js → runtime-transport-BrzIQru0.js} +3657 -3521
- package/dist/runtime-transport-BrzIQru0.js.map +1 -0
- package/dist/{service-account-authorization-Dt8kGvq8.js → service-account-authorization-Aft4cBFn.js} +3 -3
- package/dist/{service-account-authorization-Dt8kGvq8.js.map → service-account-authorization-Aft4cBFn.js.map} +1 -1
- package/dist/{service-control-capabilities-CzUB1ovW.js → service-control-capabilities-12ePIPVW.js} +1 -1
- package/dist/{service-control-capabilities-BU5F75zi.js → service-control-capabilities-B8pv0P4V.js} +2 -2
- package/dist/{service-control-capabilities-BU5F75zi.js.map → service-control-capabilities-B8pv0P4V.js.map} +1 -1
- package/dist/upgrade-Cie6yXZc.js +4 -0
- package/dist/{upgrade-NxpTydHp.js → upgrade-DrUXCeru.js} +4 -4
- package/dist/{upgrade-NxpTydHp.js.map → upgrade-DrUXCeru.js.map} +1 -1
- package/package.json +2 -2
- package/dist/agents-CIDsThyG.js.map +0 -1
- package/dist/auth-session-B7QMhHwh.js +0 -4
- package/dist/command-Bzt9zgnI.js.map +0 -1
- package/dist/dist-D-kJdWZE.js.map +0 -1
- package/dist/dist-DTG_Vqc7.js +0 -4
- package/dist/openmeld-CiL4AiB0.js.map +0 -1
- package/dist/openmeld-tools-update-coordinator-D9Skj8IE.js.map +0 -1
- package/dist/runtime-transport-QIZmAo4-.js.map +0 -1
- package/dist/upgrade-DLECkjMt.js +0 -4
|
@@ -2,41 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
import { f as toSpaceMetaUrl, g as toSpaceUpdatesUrl } from "./urls-CY2uzH2-.js";
|
|
4
4
|
import { t as isLoopbackHostname } from "./loopback-hostname-DHQPKq8N.js";
|
|
5
|
-
import { E as assessLocalMachineFailure, F as accountProfileSpaceCacheDir, J as legacyAccountProfileSpacesDir, M as formatLocalMachineIssueMessage, N as OPENMELD_HOME_ENV_KEY, R as accountsDir, X as normalizeAccountKey, Z as normalizeOpenMeldProfileId, dt as resolveOpenMeldEnvPreset, et as openMeldManagedBinaryPath, ft as resolveOpenMeldRootDir, i as isOpenMeldLockError, k as createServiceSpawnPendingIssue, pt as resolveOpenMeldServiceOwnedPathInput, q as isPublishedOpenMeldHome, rt as openMeldRootDir, u as resolveOpenMeldOrphanedLockIssue, v as resolveCliContextId, x as resolveOpenMeldLaneDescriptor } from "./lock-Dxp6o_t_.js";
|
|
6
|
-
import { $r as
|
|
5
|
+
import { E as assessLocalMachineFailure, F as accountProfileSpaceCacheDir, J as legacyAccountProfileSpacesDir, M as formatLocalMachineIssueMessage, N as OPENMELD_HOME_ENV_KEY, R as accountsDir, X as normalizeAccountKey, Z as normalizeOpenMeldProfileId, d as runWithHeldLock, dt as resolveOpenMeldEnvPreset, et as openMeldManagedBinaryPath, ft as resolveOpenMeldRootDir, i as isOpenMeldLockError, k as createServiceSpawnPendingIssue, pt as resolveOpenMeldServiceOwnedPathInput, q as isPublishedOpenMeldHome, rt as openMeldRootDir, s as releaseLock, t as acquireLock, u as resolveOpenMeldOrphanedLockIssue, v as resolveCliContextId, x as resolveOpenMeldLaneDescriptor } from "./lock-Dxp6o_t_.js";
|
|
6
|
+
import { $r as spaceMemberAgentWakeAvailabilitySchema, Ai as toCompatibleSpaceAddressingRequestWireValue, Br as resumeCenterAgentRoutineResponseSchema, Ci as projectSchema, Cr as spaceCreatorSchema, Di as computerFileAccessDaemonFrameSchema, Ei as OPENMELD_RUNTIME_CAPABILITIES_HEADER, En as toStructuredApiClientFailure, Er as listOrganizationSkillsResponseSchema, Fr as createCenterAgentRoutineResponseSchema, Hn as OPENMELD_HEADER_REQUEST_ID, Ir as deleteCenterAgentRoutineResponseSchema, Jr as agentActivitySnapshotResponseSchema, Kn as getSpaceUpdatesResponseSchema, Lr as listCenterAgentRoutineRunsResponseSchema, Mr as organizationComputersResponseSchema, Nn as DAEMON_STREAM_KEEPALIVE_PING, Nr as submitFeedbackIssueRequestSchema, Oi as computerFileAccessPolicyInputSchema, Or as organizationSkillReleaseSummarySchema, Pr as submitFeedbackIssueResponseSchema, Rr as listCenterAgentRoutinesResponseSchema, Si as listProjectsResponseSchema, Ti as COMPUTER_FILE_ACCESS_RUNTIME_CAPABILITY, Tr as getOrganizationSkillResponseSchema, Tt as buildSpaceAttachmentDownloadPath, Un as OPENMELD_HEADER_SPACE_ADDRESSING_VERSION, Ur as AGENT_ACTIVITY_PRESENCE_TTL_MAX_MS, Vr as updateCenterAgentRoutineResponseSchema, Wr as agentActivityEventSchema, Yn as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, _i as localProjectControlConnectionSchema, an as createRuntimeReportingApi, ar as submitAgentControllerTaskLifecycleEventItemSchema, bi as archiveProjectResponseSchema, dr as betterAuthDeviceAuthorizationCodeResponseSchema, ei as spaceMemberDirectoryAllowedRelationsSchema, fr as betterAuthDeviceAuthorizationErrorResponseSchema, hi as serviceConnectionEvidenceJournalSchema, hr as betterAuthSessionSnapshotResponseSchema, jr as organizationDirectoryResponseSchema, jt as createAgentActivityApi, ki as computerFileAccessPolicySchema, kr as organizationSkillSummarySchema, li as observedLocalAgentSessionSchema, lr as BETTER_AUTH_DEVICE_AUTHORIZATION_GRANT_TYPE, mi as serviceConnectionEvidenceEventSchema, mr as betterAuthDeviceAuthorizationTokenResponseSchema, ni as spaceMemberDirectorySchema, on as createServiceConnectionEvidenceApi, pr as betterAuthDeviceAuthorizationTokenRequestSchema, qn as spaceEntryTargetSchema, ri as spaceMemberKindSchema, si as agentActivitySessionInventoryResponseSchema, sn as createSpaceApi, t as OpenMeldApiClientHttpError, ti as spaceMemberDirectoryEntrySchema, ui as centerAgentToolSpeakerSchema, ur as betterAuthDeviceAuthorizationCodeRequestSchema, vi as localProjectControlDaemonFrameSchema, wi as updateProjectResponseSchema, wr as spaceMetaSchema, xi as createProjectResponseSchema, xr as organizationSpaceDirectoryWithMemberCountsResponseSchema, yi as localProjectControlDiscoverProjectsResponseSchema, yr as gatewayErrorEnvelopeSchema, zr as pauseCenterAgentRoutineResponseSchema } from "./dist-CtoP6msP.js";
|
|
7
7
|
import { b as normalizeKnownBuiltinAgentControllerId, d as resolveBuiltinAgentControllerConversationKind, l as buildAgentControllerConversationRef } from "./controller-contract-pe3_Re-c.js";
|
|
8
|
-
import { $i as
|
|
9
|
-
import { A as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema,
|
|
8
|
+
import { $i as buildDaemonSystemServiceCommandSpec, $n as resolveRouteRegistrationReconcileDecision, $r as renderWorkingLanguagePrompt, $t as resolveProjectBindingForPath, A as resolveDaemonStatusSnapshot, Aa as DAEMON_RUNTIME_CONTRACT_EPOCH, Ai as formatDaemonOwnerSummaryLabel, An as resolveSkillsAgentRegistry, Ar as seedLegacyAgentContext, B as formatDaemonServiceRefreshReliabilityMessage, Ba as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS, Bi as DaemonServiceRunError, Bn as repairBuiltinControllerInstall, Br as buildInformationProtectionPromptPlan, C as isSystemServiceStartupTimeoutError, Ca as toErrorMessage$10, Cn as removeAgentCustomTarget, Cr as buildRuntimeWorkspaceFingerprint, Ct as summarizeSkippedDaemonProfiles, D as captureDaemonServiceEvidence, Da as CONTROLLED_SHUTDOWN_REQUEST_TIMEOUT_MS, Di as createProviderOriginalError, Dn as updateAgentRegistrations, Dr as loadLedgerState, Dt as resolveLocalController, E as startDaemonSystemServiceWithAutoRepair, Ea as CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS, Ei as listAgentControllerSupervisedProcessIds, En as updateAgentCustomTarget, Er as commitResolvedAgentContext, Et as readLocalEnabledControllers, F as buildDaemonServiceRefreshNextStep, Fa as HEARTBEAT_RESPONSE_TIMEOUT_MS, Fi as summarizeDaemonOwnerSnapshot, Fr as assertLegacyAgentContextAssociation, G as buildDaemonServiceDependencyDetails, Ga as resolveOpenMeldProfileOrNull, Gn as isNpmGlobalCommandPath, Gt as bindProject, Ha as RUNTIME_STATE_PERSIST_MIN_INTERVAL_MS, Hn as resolveBuiltinAgentControllerDefinition, Hr as createAgentControllerInterfaceDisplayRows, I as buildDaemonServiceRefreshPromptMessage, Ia as MAX_RECONNECT_DELAY_MS, In as normalizeAgentId, Ir as buildAgentContextLookupKey, It as readProfileWorkspaceConfigForAccount, J as buildDaemonServiceDependencySummary, Jn as normalizeDispatchThreadAction, Jt as listProjectConnectionsWithStatus, K as buildDaemonServiceDependencyMeaning, Kn as isPnpmGlobalCommandPath, Kt as isProjectBound, La as PROVIDER_CONVERSATION_PROOF_SYNC_INTERVAL_MS, Ln as normalizeAgentIds, Lr as DEFAULT_TASK_LIFECYCLE_HEARTBEAT_INTERVAL_MS, M as resolveDaemonStatusAuthenticationAttention, Ma as DAEMON_STREAM_KEEPALIVE_INTERVAL_MS, Mi as readCurrentDaemonOwnerSnapshot, Mr as upsertConversationExecutionState, Mt as resolveProfileWorkspaceRuntime, N as resolveServiceReadiness, Na as DAEMON_STREAM_KEEPALIVE_PONG_TIMEOUT_MS, Ni as resolveDaemonStopStrategy, Nn as resolveRegistryRuntimeAdapterCapabilitySnapshot, Nr as withLedgerStateTransaction, Nt as ensureOpenMeldManagedProfileWorkspace, O as captureDaemonServiceEvidenceBestEffort, Oa as CONTROLLED_SHUTDOWN_RESULT_ACK_TIMEOUT_MS, Oi as inspectDaemonServiceInventory, On as canManageRegistryAgentSkillTargets, Or as removeConversationExecutionState, Ot as resolveLocalRuntimeControllerSupport, Pa as DEFAULT_RECONNECT_DELAY_MS, Pi as resolveStoppedContractWriteBlockedReason, Pn as resolveRegistryRuntimeAdapterContractByAgentControllerRef, Pr as buildAuthenticatedControlPlaneResponse, Qi as writeDaemonServiceContract, Qn as isDaemonReconcileInProgressError, Qr as renderInformationProtectionPrompt, Qt as removeProjectConnection, R as buildDaemonServiceStatusReadOnlyDetail, Ra as PROVIDER_CONVERSATION_PROOF_SYNC_RETRY_INTERVAL_MS, Ri as ensureDaemonRuntimeContractState, Rn as parseAgentEnabledOption, Rr as areAgentControllerInterfaceAccountsSame, Rt as resolveConfiguredProfileWorkspacePathForAccount, S as isDaemonInventoryRunningAndStartReady$1, Sa as nowIsoString, Si as createUnsupportedProviderUsageLimits, Sr as runRuntimeTask, St as loadDaemonRouteCatalog, T as waitForSystemServiceStartup$1, Ta as CATALOG_SYNC_RETRY_INTERVAL_MS, Ti as materializeCliLaunchCommand, Tn as setAgentRegistrationEnabled, Tr as appendLedgerHistoryEntry, Tt as buildRuntimeRouteTargets, U as clearDaemonStartFailureState, Un as isBunGlobalCommandPath, Ut as ProjectBindingOperationError, V as formatDaemonServiceUpdateRequiredMessage, Va as RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_RETRY_INTERVAL_MS, Vi as resolveCurrentDaemonExpectedVersion, Vn as EMPTY_AGENT_CONTROLLER_INTERFACE_CAPABILITIES, Vr as buildWorkingLanguagePromptPlan, W as writeDaemonStartFailureState, Wa as requireOpenMeldProfile, Wn as isHomebrewCommandPath, Wt as ProjectBindingStoreUpdateRequiredError, X as resolveDaemonServiceDependencyDiagnostics, Xn as SPACE_ACTION_CONTEXT_GUIDANCE_LINES, Xt as removeAgentActivityBindingsWhileDeliveryLocked, Y as buildDaemonServiceDependencyTitle, Yn as syncRuntimeEventToInflightTaskControlRegistry, Yr as parseAgentControllerRef, Zi as resolveCurrentOpenMeldAccountContext, Zn as SPACE_ACTION_TARGET_GUIDANCE_LINES, Zt as removeMissingProjectConnections, _ as DaemonServiceLifecycleDrainTimeoutError, _a as emitRunLine, _i as resolveInstalledCodexLaunchCandidates, _n as listAgentRegistrations, _o as compareAgentControllerRefsForDisplay, _r as resolveDispatchQueueLogMeta, _t as readDaemonRouteCatalogCache, a as resolveServiceUpdateUrgency, aa as DAEMON_SERVICE_AUTO_HEAL_ANOMALIES, an as withAgentActivityDeliveryLock, ar as createLocalTaskInterruptSender, ba as normalizeOptionalText$13, bi as resolveInstalledClaudeCodeLaunchCandidates, bn as readAgentRuntimeConfigHealth, br as resolveCompatibleConversationExecutionState, bt as createMutableRouteCatalogState, ca as DAEMON_SERVICE_WAKEABILITY_ADVISORY_ANOMALIES, ci as createLocalAdapterEntries, cn as syncDeviceRuntimeStateProjection, co as buildAuthenticationStatusLabel, cr as createInflightTaskControlRegistry, da as buildLedgerPaths, di as resolveInstalledOpenCodeLaunchCandidates, dn as emitReconcileStartedEvidence, do as createAuthenticationError, dr as MIN_HEARTBEAT_INTERVAL_MS, ea as ensureDaemonSystemServiceCommandFiles, er as createSerialAgentInteractionCallback, fa as ensureDaemonRuntimePaths, fi as GrokBuildAcpTransportError, fo as extractAuthenticationPromptAction, fr as applyAcceptedLeases, g as scheduleDaemonServiceUpdate, ga as dirnamePath, gi as resolveCodexTimeoutMs, gn as listAgentCustomTargets, go as resolveAuthenticationReasonFromState, gr as resolveCatalogSyncIntervalMs, gt as slugifyOpenClawNamePart, ha as asRecord, hi as projectCodexUsageLimits, hn as createRegistrationFromCatalogTarget, hr as resolveAdaptiveHeartbeatIntervalMs, ht as normalizeOpenClawSpaceIdPrefix, i as writeOpenMeldToolsMaintenancePolicy, in as resolveLocalProjectConnectionForPath, ir as mergeOpenClawGatewayVisibility, j as resolveDaemonStatusAttention, ja as DAEMON_STREAM_CONNECT_TIMEOUT_MS, ji as hasActiveDaemonOwners, jr as settleInflightTask, jt as resolveCurrentEffectiveProfileWorkingFolderRuntime, k as formatDaemonFailureContextText, ka as CONTROLLED_SHUTDOWN_SOCKET_CLOSE_TIMEOUT_MS, ki as buildDaemonOwnerSnapshotFromObservedState, kr as resolveConversationExecutionStateByLookupKey, la as classifyDaemonServiceRunStartability, li as parseOpenCodeGoUsageResponse, ln as emitDriftDetectedEvidence, lo as buildCommandAuthenticationPromptMessage$1, lr as ADAPTIVE_HEARTBEAT_JITTER_RATIO, ma as resolvePreferredDaemonDeviceId, mi as resolveInstalledGrokBuildLaunchCandidates, mn as addAgentCustomTarget, mr as pruneStaleLeases, mt as buildOpenClawSpaceSessionKey, n as readOpenMeldToolsMaintenancePolicy, na as resolveDaemonServiceAlignmentDecision, nr as normalizeDispatchPostMessageAction, o as assessServerRequiredVersion, oa as DAEMON_SERVICE_FULL_ALIGNMENT_ANOMALIES, oi as resolveCatalogSyncSkippedProfilesLogState, on as withAgentActivityLocalStateLock, oo as readDaemonCatalogSyncSignal, or as buildLocalServiceDiagnosticsPayload, pa as resolveDaemonDeviceId, pi as probeGrokBuildAcpInterface, pn as resolveAgentProfilePrimaryAgentControllerReport, po as resolveAuthenticationGuidance, pr as applyIntervalJitterMs$1, pt as prepareProviderRuntime, q as buildDaemonServiceDependencyNextStep, qa as clearAllSelectedOpenMeldProfileIds, qi as resolveRuntimeContext, qt as listProjectBindings, r as resolveOpenMeldToolsMaintenanceProjection, ra as isVersionDowngrade, rr as createPendingAgentInteractionRegistry, s as describeServerRequiredVersionUnavailableReason, sa as DAEMON_SERVICE_REPAIR_ANOMALIES, si as createLocalAdapterContainer, sr as createLocalExecutionSlots, t as createOpenMeldToolsUpdateCoordinator, ta as buildDaemonServiceTargetSpec, tn as setDefaultProjectConnection, tr as buildDispatchReplyContextSummary, u as assessCliUpdate, ua as classifyDaemonServiceWakeability, ui as forkOpenCodeServerSession, un as emitReconcileCompletedEvidence, uo as buildHumanAuthenticationCard, ur as MAX_HEARTBEAT_INTERVAL_MS, v as runDaemonServiceLifecycle, va as normalizeHeartbeatIntervalMs, vi as forkCodexAppServerThread, vn as listAgentTargetStates, vr as resolveDispatchContinuityObservation, vt as writeDaemonRouteCatalogCache, w as resolveSystemServiceStartupWaitMs, wa as warnDaemonEvent, wi as buildCliLaunchInvocation, wn as resolveAgentTargetState, wr as buildTaskResultEnvelope, wt as syncDaemonRouteCatalogState, x as uninstallDaemonServiceUpdateWorker, xa as normalizeText$2, xi as createUnavailableProviderUsageLimits, xn as reconcileNewRunnableBuiltinAgentRegistrations, xr as resolveLatestScopedConversationExecutionState, xt as createRouteCatalogFromMutableState, y as ensureDaemonServiceMaintenanceInstalled, ya as normalizeNonNegativeInteger$1, yi as verifyCodexAppServerThread, yn as manageAgentRegistrationInstallation, yr as resolveCompatibleAgentContextMatch, yt as resolveLocalServiceDemand, z as buildDaemonServiceUpdateRequiredNextStep, za as REGISTER_RESPONSE_TIMEOUT_MS, zi as readDaemonRuntimeContractRepairReport, zn as sortAgentRegistrations, zr as buildAgentControllerRef, zt as setCustomProfileWorkspace } from "./openmeld-tools-update-coordinator-jJrVAHgC.js";
|
|
9
|
+
import { A as runtimeTransportOpenMeldToolsControlResultFramePayloadSchema, An as normalizeMessageEnvelope, C as runtimeTransportLocalAgentControlInterruptFramePayloadSchema, Cr as LOCAL_FOLDER_PICKER_RUNTIME_CAPABILITY, D as runtimeTransportLocalAgentControlSetProfileWorkspaceFramePayloadSchema, Dr as localFolderPickerHelperResultSchema, E as runtimeTransportLocalAgentControlSetEnabledFramePayloadSchema, En as collectCanonicalMentionTextFragments, Er as localFolderPickerHelperProtocolResultSchema, F as runtimeTransportResumeControllerConversationResultFramePayloadSchema, Fn as executionContextAssignmentSchema, Gn as AGENT_INTERACTION_DEFAULT_TIMEOUT_MS, I as runtimeTransportRouteCatalogChangedFramePayloadSchema, J as openMeldSpaceEgressActionSchema, K as openMeldDaemonTaskResultPayloadSchema, Ln as executionContextTaskSchema, M as runtimeTransportRegisterSessionResponseSchema, On as getSpaceMessageAddressingRelationSupportForTargetKind, P as runtimeTransportResumeControllerConversationFramePayloadSchema, Q as sanitizeDispatchErrorSummary, R as runtimeTransportSubmitTaskResultRequestSchema, S as runtimeTransportLocalAgentControlForkSessionFramePayloadSchema, T as runtimeTransportLocalAgentControlRefreshCatalogFramePayloadSchema, Tn as MESSAGE_MENTION_TYPE_VALUES, Tr as localFolderPickerDaemonFrameSchema, X as resolvePublicAgentAvailabilityCopy, Xr as openMeldRequestContextSchema, _r as OPENMELD_REASONING_STREAM_HEADER, a as localWakeRouteWorkingFolderObservationSchema, b as runtimeTransportHeartbeatResponseSchema, c as runtimeTransportDispatchInteractionDeliveredRequestSchema, d as runtimeTransportDispatchLifecycleRequestSchema, f as runtimeTransportDispatchPreviewEndRequestSchema, g as runtimeTransportDispatchToolActivityRequestSchema, gr as LOCAL_AGENT_REASONING_MAX_CHARS, h as runtimeTransportDispatchRuntimeEvidenceRequestSchema, ir as runtimeTransportDeliveryExecutionIdentitySchema, j as runtimeTransportRegisterSessionRequestSchema, jn as resolveMessageEnvelopeTargetField, k as runtimeTransportOpenMeldToolsControlFramePayloadSchema, l as runtimeTransportDispatchInteractionRequestSchema, lr as resolveSingleSpaceMentionLabels, m as runtimeTransportDispatchReasoningRequestSchema, p as runtimeTransportDispatchPreviewRequestSchema, qn as agentInteractionRequestSchema, r as daemonStreamFrameSchema, rr as runtimeCoordinatorExecutionTokenEnvelopeSchema, s as runtimeTransportDeliverDispatchRequestSchema, sr as normalizeSpacePasswordText, t as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, u as runtimeTransportDispatchInteractionResponseFramePayloadSchema, ur as resolveSpaceMentionLabels, v as runtimeTransportForkAgentSessionResultSchema, vr as localAgentReasoningPreferencesSchema, w as runtimeTransportLocalAgentControlManageInstallationFramePayloadSchema, wr as OPENMELD_LOCAL_FOLDER_PICKER_CAPABILITY_HEADER, x as runtimeTransportLocalAgentControlCancelFramePayloadSchema, xt as sanitizeSignalTextPreview, y as runtimeTransportHeartbeatRequestSchema } from "./runtime-transport-BrzIQru0.js";
|
|
10
10
|
import { $ as literal, C as formatLocalSetupActionDescription, E as localCliComponentUpdateProjectionSchema, G as boolean, S as formatLocalComponentsSummaryLabel, T as installedLocalComponentsSnapshotSchema, Y as enumFactory, Z as iso, a as openMeldDaemonControlPlaneResponseSchema, ft as url, gt as openMeldRuntimeProfileIdSchema, ht as normalizeOptionalWorkingDirectory, j as localServiceComponentUpdateProjectionSchema, ot as strictObject, q as discriminatedUnion, st as string, w as formatLocalSetupActionLabel, x as formatLocalComponentsSummaryDescription } from "./control-plane-D9jDcbMZ.js";
|
|
11
11
|
import { r as daemonServiceLaneSchema } from "./service-contract-CRyDcIIf.js";
|
|
12
|
-
import { C as withAdmittedServiceSession, T as ServiceAccountAdmissionError, _ as onAuthSessionCredentialObservation, a as beginAuthSessionTransition, g as onAuthSessionCredentialAvailable, i as assertAuthSessionMutationAvailable, s as clearAuthSession, u as getAuthSessionState, x as setAuthSession } from "./auth-session-
|
|
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-
|
|
12
|
+
import { C as withAdmittedServiceSession, T as ServiceAccountAdmissionError, _ as onAuthSessionCredentialObservation, a as beginAuthSessionTransition, g as onAuthSessionCredentialAvailable, i as assertAuthSessionMutationAvailable, s as clearAuthSession, u as getAuthSessionState, x as setAuthSession } from "./auth-session-CVxflepT.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-uRDaBzO_.js";
|
|
14
14
|
import { n as resolveOpenMeldDistribution, o as serviceControlCapabilitiesSchema, t as isBinaryDistribution } from "./distribution-DY2fBeSW.js";
|
|
15
15
|
import { i as writeDaemonRuntimeLease } from "./daemon-runtime-lease-Dd4hdHNo.js";
|
|
16
|
-
import { $ as readManagedCliInstallation, A as prepareDaemonServiceBundle, Bt as readDaemonServiceContract, H as formatDaemonLifecycleOriginSummary, It as sendLocalDaemonControlPlaneRequest, J as runWithDaemonLifecycleCommandJournal, K as resolveRecentDaemonSignalStopCause, Lt as clearDaemonServiceContract, M as resolveAlignedDaemonActiveBundleEntryPath, N as resolveDaemonBundleEntryPathFromState, Pt as requestLocalDaemonShutdown, Rt as isDaemonServiceContractIdentityReusable, U as readLatestDaemonLifecycleConnectionStateEvent, V as emitDaemonLifecycleEvent, Vt as upsertDaemonServiceContract, W as readLatestDaemonLifecycleOriginEvent, a as resolveDaemonRuntimeState, b as cleanupInactiveDaemonServiceBundles, f as listDaemonOwnedProcesses, h as resolveDaemonBundleIdFromEntryPath, i as readCurrentObservedDaemonRuntimeStatus, j as readDaemonActiveBundleState, jt as LocalDaemonControlPlaneClientError, 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 } from "./daemon-service-runtime-
|
|
17
|
-
import { $ as buildAgentFacingMentalModelLines, At as validateDaemonControlTargetInput, Ft as getBuiltinAgentSelectionRequiredArguments, Gt as waitForOpenMeldToolsUpdateCompletion, Ht as formatAgentOverviewPayload, Jt as sanitizeTerminalDisplayText, Kt as resolveOpenMeldToolsUpdateOperation, Lt as validateBuiltinAgentSelectionInput, Mt as buildBuiltinAgentSelectionCommand, Nt as buildBuiltinAgentSelectionExamples, Pt as getBuiltinAgentSelectionOptionalArguments, Qt as outLine, Rt as buildAgentOverviewFromContract, Y as SPACE_COLLABORATION_CONTEXT_RULE, Z as SPACE_PERSONAL_CONTRIBUTION_RULE, Zt as outJsonLine, a as formatDaemonServiceDowngradeBlockedRecommendation, at as buildSpaceWakeParticipantLines, ct as deriveContinuity, d as formatDaemonServiceMissingStatus, dt as resolvePublicAgentFailureReason, f as getDaemonDowngradeBlockedTitle, ft as resolveSpacePublicationRequirement, h as createAuthLoginGuideError, i as formatDaemonInstallFailedMessage, it as buildSpaceEntryBriefNeedMoreLine, l as formatDaemonServiceMissingRunStepOne, lt as isSelfWakeSpaceAction, m as canUseInteractivePrompts, n as resolveElapsedTimeMs, nt as buildCompactDispatchActionGuidanceLines, o as formatDaemonServiceMissingAction, p as runDaemonInstallDecisionPrompt, pt as getCommandEntryContract, qt as createPresenter, r as formatDaemonDowngradeBlockedNextStep, rt as buildSpaceAgentIdentityLine, s as formatDaemonServiceMissingMeaning, st as composeDispatchBrief, t as formatElapsedTime, tt as buildCenterAgentRoleTemplateText, u as formatDaemonServiceMissingRunStepTwo, ut as renderSpaceEntryBrief } from "./elapsed-time-
|
|
16
|
+
import { $ as readManagedCliInstallation, A as prepareDaemonServiceBundle, Bt as readDaemonServiceContract, H as formatDaemonLifecycleOriginSummary, It as sendLocalDaemonControlPlaneRequest, J as runWithDaemonLifecycleCommandJournal, K as resolveRecentDaemonSignalStopCause, Lt as clearDaemonServiceContract, M as resolveAlignedDaemonActiveBundleEntryPath, N as resolveDaemonBundleEntryPathFromState, Pt as requestLocalDaemonShutdown, Rt as isDaemonServiceContractIdentityReusable, U as readLatestDaemonLifecycleConnectionStateEvent, V as emitDaemonLifecycleEvent, Vt as upsertDaemonServiceContract, W as readLatestDaemonLifecycleOriginEvent, a as resolveDaemonRuntimeState, b as cleanupInactiveDaemonServiceBundles, f as listDaemonOwnedProcesses, h as resolveDaemonBundleIdFromEntryPath, i as readCurrentObservedDaemonRuntimeStatus, j as readDaemonActiveBundleState, jt as LocalDaemonControlPlaneClientError, 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 } from "./daemon-service-runtime-CRHAVnEX.js";
|
|
17
|
+
import { $ as buildAgentFacingMentalModelLines, At as validateDaemonControlTargetInput, Ft as getBuiltinAgentSelectionRequiredArguments, Gt as waitForOpenMeldToolsUpdateCompletion, Ht as formatAgentOverviewPayload, Jt as sanitizeTerminalDisplayText, Kt as resolveOpenMeldToolsUpdateOperation, Lt as validateBuiltinAgentSelectionInput, Mt as buildBuiltinAgentSelectionCommand, Nt as buildBuiltinAgentSelectionExamples, Pt as getBuiltinAgentSelectionOptionalArguments, Qt as outLine, Rt as buildAgentOverviewFromContract, Y as SPACE_COLLABORATION_CONTEXT_RULE, Z as SPACE_PERSONAL_CONTRIBUTION_RULE, Zt as outJsonLine, a as formatDaemonServiceDowngradeBlockedRecommendation, at as buildSpaceWakeParticipantLines, ct as deriveContinuity, d as formatDaemonServiceMissingStatus, dt as resolvePublicAgentFailureReason, f as getDaemonDowngradeBlockedTitle, ft as resolveSpacePublicationRequirement, h as createAuthLoginGuideError, i as formatDaemonInstallFailedMessage, it as buildSpaceEntryBriefNeedMoreLine, l as formatDaemonServiceMissingRunStepOne, lt as isSelfWakeSpaceAction, m as canUseInteractivePrompts, n as resolveElapsedTimeMs, nt as buildCompactDispatchActionGuidanceLines, o as formatDaemonServiceMissingAction, p as runDaemonInstallDecisionPrompt, pt as getCommandEntryContract, qt as createPresenter, r as formatDaemonDowngradeBlockedNextStep, rt as buildSpaceAgentIdentityLine, s as formatDaemonServiceMissingMeaning, st as composeDispatchBrief, t as formatElapsedTime, tt as buildCenterAgentRoleTemplateText, u as formatDaemonServiceMissingRunStepTwo, ut as renderSpaceEntryBrief } from "./elapsed-time-D6DCEnz7.js";
|
|
18
18
|
import { a as resolveBaseUrl, c as resolveExplicitGatewayUrlOrThrow, d as createDefaultRuntimeAgentControllerSettings, f as getConfiguredDaemonDispatchLimits, g as getConfiguredSkillsConfig, i as normalizeGatewayBaseUrlOrNull, l as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, o as resolveBaseUrlOrNull, r as normalizeGatewayBaseUrl } from "./base-url-C6sHRNGu.js";
|
|
19
19
|
import { n as writeDaemonLocalStateFile, t as readDaemonLocalStateFile } from "./daemon-local-state-file-jOXuXrky.js";
|
|
20
20
|
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-C37ZtIZK.js";
|
|
21
21
|
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-GiMCiTmu.js";
|
|
22
22
|
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-NtJYJe1D.js";
|
|
23
|
-
import { t as admitServiceAccountStop } from "./service-account-authorization-
|
|
23
|
+
import { t as admitServiceAccountStop } from "./service-account-authorization-Aft4cBFn.js";
|
|
24
24
|
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-
|
|
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-BGGVYxgq.js";
|
|
26
26
|
import { createHash, randomUUID } from "node:crypto";
|
|
27
27
|
import { homedir, loadavg, tmpdir } from "node:os";
|
|
28
28
|
import { basename, delimiter, dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
29
|
-
import { access, appendFile, chmod, link, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
29
|
+
import { access, appendFile, chmod, copyFile, link, lstat, mkdir, mkdtemp, open, readFile, readdir, readlink, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
30
30
|
import * as z$1 from "zod/v4";
|
|
31
31
|
import { z } from "zod/v4";
|
|
32
32
|
import { accessSync, appendFileSync, chmodSync, constants, createReadStream, existsSync, mkdirSync, readFileSync, readSync, renameSync, watch, writeFileSync } from "node:fs";
|
|
33
33
|
import process$1 from "node:process";
|
|
34
34
|
import { execFile, spawn } from "node:child_process";
|
|
35
35
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
36
|
-
import { isDeepStrictEqual } from "node:util";
|
|
36
|
+
import { isDeepStrictEqual, promisify } from "node:util";
|
|
37
37
|
import { createServer } from "node:net";
|
|
38
38
|
import pc from "picocolors";
|
|
39
|
-
import { forkSession } from "@anthropic-ai/claude-agent-sdk";
|
|
39
|
+
import { forkSession, getSessionInfo, getSessionMessages } from "@anthropic-ai/claude-agent-sdk";
|
|
40
40
|
import { createOpencodeClient } from "@opencode-ai/sdk/v2";
|
|
41
41
|
import { cancel, confirm, isCancel, select } from "@clack/prompts";
|
|
42
42
|
import stringWidth from "string-width";
|
|
@@ -7304,9 +7304,8 @@ function createLedgerIo() {
|
|
|
7304
7304
|
await appendFile(filePath, content, { encoding });
|
|
7305
7305
|
},
|
|
7306
7306
|
copyFile: async (fromPath, toPath) => {
|
|
7307
|
-
const raw = await readFile(fromPath, "utf8");
|
|
7308
7307
|
await mkdir(dirnamePath(toPath), { recursive: true });
|
|
7309
|
-
await
|
|
7308
|
+
await copyFile(fromPath, toPath);
|
|
7310
7309
|
},
|
|
7311
7310
|
mkdir: async (dirPath, options) => {
|
|
7312
7311
|
await mkdir(dirPath, options);
|
|
@@ -7318,6 +7317,16 @@ function createLedgerIo() {
|
|
|
7318
7317
|
await mkdir(dirnamePath(toPath), { recursive: true });
|
|
7319
7318
|
await rename(fromPath, toPath);
|
|
7320
7319
|
},
|
|
7320
|
+
syncPath: async (fileOrDirectoryPath) => {
|
|
7321
|
+
const isWindows = process.platform === "win32";
|
|
7322
|
+
if (isWindows && (await stat(fileOrDirectoryPath)).isDirectory()) return;
|
|
7323
|
+
const handle = await open(fileOrDirectoryPath, isWindows ? "r+" : "r");
|
|
7324
|
+
try {
|
|
7325
|
+
await handle.sync();
|
|
7326
|
+
} finally {
|
|
7327
|
+
await handle.close();
|
|
7328
|
+
}
|
|
7329
|
+
},
|
|
7321
7330
|
rm: async (filePath, options) => {
|
|
7322
7331
|
await rm(filePath, options);
|
|
7323
7332
|
},
|
|
@@ -11221,7 +11230,8 @@ function parseDispatchTask(input) {
|
|
|
11221
11230
|
});
|
|
11222
11231
|
if (!(prompt && controllerSelection)) return null;
|
|
11223
11232
|
const fallbackControllerSettings = createDefaultRuntimeAgentControllerSettings(controllerSelection.agentControllerRef);
|
|
11224
|
-
const agentControllerConversationId =
|
|
11233
|
+
const agentControllerConversationId = resolveDispatchNativeConversationId(payload);
|
|
11234
|
+
if (!hasMatchingExecutionContextScope(payload, requiredFields)) return null;
|
|
11225
11235
|
const deliveryRecoveryReason = resolveDeliveryRecoveryReason(payload);
|
|
11226
11236
|
const executionTokenEcho = resolveExecutionTokenEcho(payload);
|
|
11227
11237
|
if (!executionTokenEcho) return null;
|
|
@@ -11230,6 +11240,7 @@ function parseDispatchTask(input) {
|
|
|
11230
11240
|
const contextIdMappingSpec = payload.contextIdMappingSpec ?? input.fallbackRouteConfig?.contextIdMappingSpec ?? fallbackControllerSettings.contextIdMappingSpec;
|
|
11231
11241
|
return {
|
|
11232
11242
|
...requiredFields,
|
|
11243
|
+
executionContext: payload.executionContext,
|
|
11233
11244
|
agentControllerConversationId,
|
|
11234
11245
|
...resolveDispatchSourceFiles(payload),
|
|
11235
11246
|
...controllerSelection,
|
|
@@ -11266,6 +11277,14 @@ function parseDispatchTask(input) {
|
|
|
11266
11277
|
contextIdMappingSpec
|
|
11267
11278
|
};
|
|
11268
11279
|
}
|
|
11280
|
+
function hasMatchingExecutionContextScope(payload, required) {
|
|
11281
|
+
const context = payload.executionContext;
|
|
11282
|
+
return !context || context.scope.targetProfileId === required.targetProfileId && context.scope.spaceId === required.spaceId && context.scope.threadId === (payload.threadContext?.threadId ?? null);
|
|
11283
|
+
}
|
|
11284
|
+
function resolveDispatchNativeConversationId(payload) {
|
|
11285
|
+
if (payload.executionContext) return payload.executionContext.nativeConversationId;
|
|
11286
|
+
return normalizeOptionalText$13(payload.agentControllerConversationId) ?? null;
|
|
11287
|
+
}
|
|
11269
11288
|
function resolveDispatchSourceFiles(payload) {
|
|
11270
11289
|
return {
|
|
11271
11290
|
attachments: payload.sourceSignalSnapshot?.attachments ?? [],
|
|
@@ -11515,7 +11534,7 @@ function renderMandatoryCompletionSection(input) {
|
|
|
11515
11534
|
return [
|
|
11516
11535
|
"Mandatory completion:",
|
|
11517
11536
|
"- Plain text is not a Space reply.",
|
|
11518
|
-
"-
|
|
11537
|
+
"- Use supplied context first. Discover read_history for this Wake's bounded Space text, or read_file with a file ID and revision. Both dispatch tools read as you without local login files; neither completes the Wake.",
|
|
11519
11538
|
buildMandatoryCompletionActionLine(publicationRequirement),
|
|
11520
11539
|
"- Use the Space Action tool first. If your harness offers tool search or discovery, look up the required action before declaring it unavailable. A tool missing from the initial list is not proof of unavailability. Do not read setup or onboarding guides merely to submit this result.",
|
|
11521
11540
|
...publicationRequirement.allowedActions.includes("post_message") ? ["- For a plain reply, omit wakeTargets and referenceTargets. Add targets only for an intentional handoff or reference to another Agent; never copy incoming activation targets or wake yourself."] : [],
|
|
@@ -11615,14 +11634,14 @@ function renderContinuityLine(input) {
|
|
|
11615
11634
|
if (input.higherAuthorityUpdates) parts.push("higher-authority updates: yes");
|
|
11616
11635
|
if (parts.length === 0) return null;
|
|
11617
11636
|
const sourceSignalId = normalizeOptionalText$13(input.sourceSignalId);
|
|
11618
|
-
if (!sourceSignalId) return `- Since your last public reply: ${parts.join("; ")} (run \`${buildSpaceHistoryCommand(input)}\`
|
|
11637
|
+
if (!sourceSignalId) return `- Since your last public reply: ${parts.join("; ")} (use dispatch tool \`read_history\` for bounded context; only if unavailable and terminal access is permitted, run \`${buildSpaceHistoryCommand(input)}\`)`;
|
|
11619
11638
|
const readCommand = buildSpaceContextWindowCommand({
|
|
11620
11639
|
cliEntry: input.cliEntry,
|
|
11621
11640
|
sourceSignalId,
|
|
11622
11641
|
spaceId: input.spaceId,
|
|
11623
11642
|
targetProfileId: input.targetProfileId
|
|
11624
11643
|
});
|
|
11625
|
-
return `- Since your last public reply: ${parts.join("; ")} (
|
|
11644
|
+
return `- Since your last public reply: ${parts.join("; ")} (use dispatch tool \`read_history\` for bounded context; only if unavailable and terminal access is permitted, run \`${readCommand}\`)`;
|
|
11626
11645
|
}
|
|
11627
11646
|
function shouldRenderReplyTargetLine(replyTarget) {
|
|
11628
11647
|
return normalizeOptionalText$13(replyTarget) !== "the current source message";
|
|
@@ -16568,7 +16587,10 @@ function resolveAdapterInterruptNote(input) {
|
|
|
16568
16587
|
//#region src/local-service/carrier/local-execution-slots.ts
|
|
16569
16588
|
function createDaemonLocalExecutionSlots(input) {
|
|
16570
16589
|
return createLocalExecutionSlots({
|
|
16571
|
-
limits:
|
|
16590
|
+
limits: {
|
|
16591
|
+
...input.limits,
|
|
16592
|
+
contextConcurrency: 5
|
|
16593
|
+
},
|
|
16572
16594
|
onTaskDropped: (event) => {
|
|
16573
16595
|
emitRunLine({
|
|
16574
16596
|
presenter: input.presenter,
|
|
@@ -18504,11 +18526,27 @@ function buildForkedSessionTitle(profileName) {
|
|
|
18504
18526
|
}
|
|
18505
18527
|
//#endregion
|
|
18506
18528
|
//#region src/local-service/session-control/session-fork-operation-store.ts
|
|
18507
|
-
const STORE_SCHEMA = "openmeld-agent-session-fork-operation-store-
|
|
18529
|
+
const STORE_SCHEMA = "openmeld-agent-session-fork-operation-store-v2";
|
|
18530
|
+
const LEGACY_STORE_SCHEMA = "openmeld-agent-session-fork-operation-store-v1";
|
|
18508
18531
|
const RECORD_SCHEMA = "openmeld-agent-session-fork-operation-record-v1";
|
|
18509
18532
|
const STORE_FILE_NAME = "agent-session-fork-operations.json";
|
|
18510
18533
|
const STORE_TEMP_FILE_NAME = "agent-session-fork-operations.tmp";
|
|
18511
18534
|
const MAX_RETAINED_RECORDS = 256;
|
|
18535
|
+
const contextForkRequestSchema = z.strictObject({
|
|
18536
|
+
kind: z.literal("execution_context"),
|
|
18537
|
+
operationId: z.string().uuid(),
|
|
18538
|
+
sourceNativeSessionId: z.string().min(1),
|
|
18539
|
+
completedHistoryId: z.string().min(1),
|
|
18540
|
+
workingDirectory: z.string().min(1)
|
|
18541
|
+
});
|
|
18542
|
+
const contextForkResultSchema = z.discriminatedUnion("status", [contextForkRequestSchema.extend({
|
|
18543
|
+
status: z.literal("completed"),
|
|
18544
|
+
childNativeSessionId: z.string().min(1)
|
|
18545
|
+
}), contextForkRequestSchema.extend({
|
|
18546
|
+
status: z.enum(["rejected", "outcome_unknown"]),
|
|
18547
|
+
reasonCode: z.string().min(1),
|
|
18548
|
+
message: z.string().min(1)
|
|
18549
|
+
})]);
|
|
18512
18550
|
const storeTails = /* @__PURE__ */ new Map();
|
|
18513
18551
|
async function runAgentSessionForkOperation(input) {
|
|
18514
18552
|
const previous = storeTails.get(input.ledgerRootPath) ?? Promise.resolve();
|
|
@@ -18536,6 +18574,7 @@ async function runSerialized(input) {
|
|
|
18536
18574
|
if (existing.requestFingerprint !== fingerprint) return rejected(input.request, "agent_session_fork.operation_identity_conflict", "This Fork operation id was already used for a different Session.");
|
|
18537
18575
|
return existing.result ?? outcomeUnknown(input.request, "The provider Fork started, but no authoritative child Session id was recorded.");
|
|
18538
18576
|
}
|
|
18577
|
+
if (records.filter((record) => record.result === null || record.result.status === "outcome_unknown").length >= MAX_RETAINED_RECORDS) return rejected(input.request, "agent_session_fork.unresolved_operation_limit", "Resolve uncertain fork operations before starting another fork.");
|
|
18539
18578
|
const started = {
|
|
18540
18579
|
operationId: input.request.operationId,
|
|
18541
18580
|
requestFingerprint: fingerprint,
|
|
@@ -18551,7 +18590,7 @@ async function runSerialized(input) {
|
|
|
18551
18590
|
let result;
|
|
18552
18591
|
try {
|
|
18553
18592
|
const forked = await input.execute();
|
|
18554
|
-
result =
|
|
18593
|
+
result = parseForkOperationResult({
|
|
18555
18594
|
...input.request,
|
|
18556
18595
|
childNativeSessionId: forked.childNativeSessionId,
|
|
18557
18596
|
status: "completed"
|
|
@@ -18599,8 +18638,13 @@ async function readRecords(ledgerRootPath) {
|
|
|
18599
18638
|
ok: false,
|
|
18600
18639
|
reasonCode: "agent_session_fork.operation_store_invalid"
|
|
18601
18640
|
};
|
|
18641
|
+
if ("schema" in parsed && parsed.schema === LEGACY_STORE_SCHEMA && "v" in parsed && parsed.v === 1) parsed = {
|
|
18642
|
+
...parsed,
|
|
18643
|
+
schema: STORE_SCHEMA,
|
|
18644
|
+
v: 2
|
|
18645
|
+
};
|
|
18602
18646
|
const candidate = parsed;
|
|
18603
|
-
if (candidate.schema !== STORE_SCHEMA || candidate.v !==
|
|
18647
|
+
if (candidate.schema !== STORE_SCHEMA || candidate.v !== 2) return {
|
|
18604
18648
|
ok: false,
|
|
18605
18649
|
reasonCode: "agent_session_fork.operation_store_update_required"
|
|
18606
18650
|
};
|
|
@@ -18620,12 +18664,14 @@ async function writeRecords(ledgerRootPath, records) {
|
|
|
18620
18664
|
mode: 448,
|
|
18621
18665
|
recursive: true
|
|
18622
18666
|
});
|
|
18623
|
-
const
|
|
18667
|
+
const ordered = [...records].sort((left, right) => right.updatedAtMs - left.updatedAtMs);
|
|
18668
|
+
const unresolved = ordered.filter((record) => record.result === null || record.result.status === "outcome_unknown");
|
|
18669
|
+
const retained = [...unresolved, ...ordered.filter((record) => !unresolved.includes(record)).slice(0, Math.max(0, MAX_RETAINED_RECORDS - unresolved.length))];
|
|
18624
18670
|
await writeFile(tempPath, `${JSON.stringify({
|
|
18625
18671
|
records: retained,
|
|
18626
18672
|
schema: STORE_SCHEMA,
|
|
18627
18673
|
updatedAtMs: Date.now(),
|
|
18628
|
-
v:
|
|
18674
|
+
v: 2
|
|
18629
18675
|
}, null, 2)}\n`, {
|
|
18630
18676
|
encoding: "utf8",
|
|
18631
18677
|
mode: 384
|
|
@@ -18635,15 +18681,15 @@ async function writeRecords(ledgerRootPath, records) {
|
|
|
18635
18681
|
function isOperationStore(value) {
|
|
18636
18682
|
if (!(value && typeof value === "object")) return false;
|
|
18637
18683
|
const candidate = value;
|
|
18638
|
-
return candidate.schema === STORE_SCHEMA && candidate.v ===
|
|
18684
|
+
return candidate.schema === STORE_SCHEMA && candidate.v === 2 && Array.isArray(candidate.records) && candidate.records.every(isStoredOperation);
|
|
18639
18685
|
}
|
|
18640
18686
|
function isStoredOperation(value) {
|
|
18641
18687
|
if (!(value && typeof value === "object")) return false;
|
|
18642
18688
|
const candidate = value;
|
|
18643
|
-
return candidate.schema === RECORD_SCHEMA && typeof candidate.operationId === "string" && typeof candidate.requestFingerprint === "string" && typeof candidate.updatedAtMs === "number" && (candidate.result === null || runtimeTransportForkAgentSessionResultSchema.safeParse(candidate.result).success);
|
|
18689
|
+
return candidate.schema === RECORD_SCHEMA && typeof candidate.operationId === "string" && typeof candidate.requestFingerprint === "string" && typeof candidate.updatedAtMs === "number" && (candidate.result === null || runtimeTransportForkAgentSessionResultSchema.safeParse(candidate.result).success || contextForkResultSchema.safeParse(candidate.result).success);
|
|
18644
18690
|
}
|
|
18645
18691
|
function rejected(request, reasonCode, message) {
|
|
18646
|
-
return
|
|
18692
|
+
return parseForkOperationResult({
|
|
18647
18693
|
...request,
|
|
18648
18694
|
message,
|
|
18649
18695
|
reasonCode,
|
|
@@ -18651,7 +18697,7 @@ function rejected(request, reasonCode, message) {
|
|
|
18651
18697
|
});
|
|
18652
18698
|
}
|
|
18653
18699
|
function outcomeUnknown(request, message) {
|
|
18654
|
-
return
|
|
18700
|
+
return parseForkOperationResult({
|
|
18655
18701
|
...request,
|
|
18656
18702
|
message,
|
|
18657
18703
|
reasonCode: "agent_session_fork.provider_outcome_unknown",
|
|
@@ -18661,6 +18707,9 @@ function outcomeUnknown(request, message) {
|
|
|
18661
18707
|
function readErrorCode(error) {
|
|
18662
18708
|
return error && typeof error === "object" && "code" in error ? String(error.code).trim() || null : null;
|
|
18663
18709
|
}
|
|
18710
|
+
function parseForkOperationResult(value) {
|
|
18711
|
+
return value.kind === "execution_context" ? contextForkResultSchema.parse(value) : runtimeTransportForkAgentSessionResultSchema.parse(value);
|
|
18712
|
+
}
|
|
18664
18713
|
function toErrorMessage$2(error) {
|
|
18665
18714
|
return error instanceof Error ? error.message : String(error);
|
|
18666
18715
|
}
|
|
@@ -18767,6 +18816,7 @@ async function prepareDispatchRuntimeExecution(input) {
|
|
|
18767
18816
|
}
|
|
18768
18817
|
//#endregion
|
|
18769
18818
|
//#region src/local-service/execution/task-execution-error.ts
|
|
18819
|
+
const EXECUTION_CONTEXT_ERROR_PATTERN = /^execution_context\.[a-z_]+$/u;
|
|
18770
18820
|
function toTaskExecutionError(error) {
|
|
18771
18821
|
if (error instanceof DaemonServiceRunError) return {
|
|
18772
18822
|
errorCode: error.code,
|
|
@@ -18775,6 +18825,11 @@ function toTaskExecutionError(error) {
|
|
|
18775
18825
|
openClawGatewayVisibility: error.openClawGatewayVisibility,
|
|
18776
18826
|
projectFailureContext: error.projectFailureContext
|
|
18777
18827
|
};
|
|
18828
|
+
if (error instanceof Error && EXECUTION_CONTEXT_ERROR_PATTERN.test(error.message)) return {
|
|
18829
|
+
errorCode: error.message,
|
|
18830
|
+
errorType: "config",
|
|
18831
|
+
message: error.message
|
|
18832
|
+
};
|
|
18778
18833
|
return {
|
|
18779
18834
|
errorCode: "dispatch.execution_failed",
|
|
18780
18835
|
errorType: "internal",
|
|
@@ -18784,6 +18839,16 @@ function toTaskExecutionError(error) {
|
|
|
18784
18839
|
//#endregion
|
|
18785
18840
|
//#region src/runtime/dispatch-space-action-context.ts
|
|
18786
18841
|
const OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV = "OPENMELD_SPACE_ACTION_CONTEXT_PATH";
|
|
18842
|
+
/** The local action context is known expired/closed/mismatched: a new ordinary action must be rejected, never recorded. */
|
|
18843
|
+
var DispatchSpaceActionClosedError = class extends Error {
|
|
18844
|
+
receipt = "rejected_closed";
|
|
18845
|
+
reasonCode;
|
|
18846
|
+
constructor(reasonCode, message) {
|
|
18847
|
+
super(message);
|
|
18848
|
+
this.name = "DispatchSpaceActionClosedError";
|
|
18849
|
+
this.reasonCode = reasonCode;
|
|
18850
|
+
}
|
|
18851
|
+
};
|
|
18787
18852
|
const DISPATCH_SPACE_ACTION_CONTEXT_VERSION = 1;
|
|
18788
18853
|
const DISPATCH_SPACE_ACTION_RECORD_VERSION = 1;
|
|
18789
18854
|
const DEFAULT_CONTEXT_TTL_MS = 720 * 60 * 1e3;
|
|
@@ -18824,6 +18889,11 @@ function createDispatchSpaceActionContext(input) {
|
|
|
18824
18889
|
};
|
|
18825
18890
|
}
|
|
18826
18891
|
function readDispatchSpaceActionContextFromEnv(env = process.env) {
|
|
18892
|
+
const context = readDispatchSpaceActionContextForReceiptFromEnv(env);
|
|
18893
|
+
assertContextActive(context, Date.now());
|
|
18894
|
+
return context;
|
|
18895
|
+
}
|
|
18896
|
+
function readDispatchSpaceActionContextForReceiptFromEnv(env = process.env) {
|
|
18827
18897
|
const contextPath = normalizeOptionalText$7(env[OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV]);
|
|
18828
18898
|
if (!contextPath) throw new Error("No active OpenMeld Space Action dispatch context was found. Use this command inside an OpenMeld Space Wake dispatch.");
|
|
18829
18899
|
const context = readDispatchSpaceActionContext(contextPath);
|
|
@@ -18831,17 +18901,19 @@ function readDispatchSpaceActionContextFromEnv(env = process.env) {
|
|
|
18831
18901
|
context,
|
|
18832
18902
|
env
|
|
18833
18903
|
});
|
|
18834
|
-
assertContextActive(context, Date.now());
|
|
18835
18904
|
return context;
|
|
18836
18905
|
}
|
|
18837
18906
|
function readDispatchSpaceActionContext(contextPath) {
|
|
18838
18907
|
return parseDispatchSpaceActionContext(readJsonFile(contextPath));
|
|
18839
18908
|
}
|
|
18840
18909
|
function writeDispatchSpaceActionRecord(input) {
|
|
18841
|
-
assertContextActive(input.context, input.nowMs ?? Date.now());
|
|
18842
18910
|
const parsedAction = openMeldSpaceEgressActionSchema.safeParse(input.action);
|
|
18843
18911
|
if (!parsedAction.success) throw parsedAction.error;
|
|
18844
18912
|
if (isSelfWakeSpaceAction(parsedAction.data, input.context.targetProfileId)) throw new Error("An Agent cannot Wake itself. To reply to the current message, omit wakeTargets (CLI: --wake) and submit the reply again. No action was recorded.");
|
|
18913
|
+
const existing = readDispatchSpaceActionRecord({ context: input.context });
|
|
18914
|
+
if (existing.status === "invalid") throw new Error(existing.errorMessage);
|
|
18915
|
+
if (existing.status === "loaded" && isDeepStrictEqual(existing.record.action, parsedAction.data)) return existing.record;
|
|
18916
|
+
assertContextActive(input.context, input.nowMs ?? Date.now());
|
|
18845
18917
|
const record = {
|
|
18846
18918
|
version: DISPATCH_SPACE_ACTION_RECORD_VERSION,
|
|
18847
18919
|
action: parsedAction.data,
|
|
@@ -18922,10 +18994,10 @@ function assertDispatchRuntimeEnvMatchesContext(input) {
|
|
|
18922
18994
|
if (normalizeOptionalText$7(input.env["OPENMELD_DISPATCH_RUNTIME_MODE"]) !== "dispatch-owned-runtime") return;
|
|
18923
18995
|
const envDispatchId = normalizeOptionalText$7(input.env[OPENMELD_DISPATCH_RUNTIME_DISPATCH_ID_ENV]);
|
|
18924
18996
|
if (!envDispatchId) throw new Error("OpenMeld Space Action dispatch runtime is missing the active dispatch ID.");
|
|
18925
|
-
if (envDispatchId !== input.context.dispatchId) throw new
|
|
18997
|
+
if (envDispatchId !== input.context.dispatchId) throw new DispatchSpaceActionClosedError("space_action.context_mismatch", "OpenMeld Space Action dispatch context does not match the active dispatch runtime.");
|
|
18926
18998
|
const envTargetProfileId = normalizeOptionalText$7(input.env[OPENMELD_DISPATCH_RUNTIME_TARGET_PROFILE_ID_ENV]);
|
|
18927
18999
|
if (!envTargetProfileId) throw new Error("OpenMeld Space Action dispatch runtime is missing the active target profile ID.");
|
|
18928
|
-
if (envTargetProfileId !== input.context.targetProfileId) throw new
|
|
19000
|
+
if (envTargetProfileId !== input.context.targetProfileId) throw new DispatchSpaceActionClosedError("space_action.context_mismatch", "OpenMeld Space Action target profile does not match the active dispatch runtime.");
|
|
18929
19001
|
}
|
|
18930
19002
|
function parseDispatchSpaceActionRecord(value) {
|
|
18931
19003
|
const record = toRecord$1(value, "OpenMeld Space Action record");
|
|
@@ -18974,7 +19046,7 @@ function parseSpaceContractSnapshot(value) {
|
|
|
18974
19046
|
};
|
|
18975
19047
|
}
|
|
18976
19048
|
function assertContextActive(context, nowMs) {
|
|
18977
|
-
if (nowMs > context.expiresAtMs) throw new
|
|
19049
|
+
if (nowMs > context.expiresAtMs) throw new DispatchSpaceActionClosedError("space_action.context_expired", "The OpenMeld Space Action dispatch context has expired.");
|
|
18978
19050
|
}
|
|
18979
19051
|
function readJsonFile(path) {
|
|
18980
19052
|
return JSON.parse(readFileSync(path, "utf8"));
|
|
@@ -20622,6 +20694,710 @@ function coerceRuntimeResultToStructuredActionFailure$1(input) {
|
|
|
20622
20694
|
};
|
|
20623
20695
|
}
|
|
20624
20696
|
//#endregion
|
|
20697
|
+
//#region src/local-service/dispatch/execution-context-workspace.ts
|
|
20698
|
+
const execFileAsync = promisify(execFile);
|
|
20699
|
+
const syncDirectory = createLedgerIo().syncPath;
|
|
20700
|
+
const COMMIT_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
|
|
20701
|
+
const manifestSchema = z.strictObject({
|
|
20702
|
+
version: z.union([z.literal(1), z.literal(2)]),
|
|
20703
|
+
identity: executionContextAssignmentSchema,
|
|
20704
|
+
sourceWorkingDirectory: z.string().nullable(),
|
|
20705
|
+
baseCommit: z.string().regex(COMMIT_PATTERN).nullable(),
|
|
20706
|
+
boundaryRoot: z.string(),
|
|
20707
|
+
workingDirectory: z.string(),
|
|
20708
|
+
status: z.enum([
|
|
20709
|
+
"preparing",
|
|
20710
|
+
"restoring",
|
|
20711
|
+
"completed",
|
|
20712
|
+
"in_use",
|
|
20713
|
+
"retiring",
|
|
20714
|
+
"released"
|
|
20715
|
+
]),
|
|
20716
|
+
pristineFingerprint: z.string().regex(/^[a-f0-9]{64}$/u).optional(),
|
|
20717
|
+
copiedUncommittedFiles: z.literal(false),
|
|
20718
|
+
processSupervisionId: z.uuid().optional(),
|
|
20719
|
+
retirement: z.strictObject({
|
|
20720
|
+
path: z.string(),
|
|
20721
|
+
pristineFingerprint: z.string().regex(/^[a-f0-9]{64}$/u)
|
|
20722
|
+
}).optional()
|
|
20723
|
+
}).refine((manifest) => manifest.version === 2 || (manifest.status === "preparing" || manifest.status === "completed") && !manifest.pristineFingerprint && !manifest.processSupervisionId && !manifest.retirement).refine((manifest) => manifest.identity.access === "space_context" ? manifest.sourceWorkingDirectory === null && manifest.baseCommit === null : manifest.sourceWorkingDirectory !== null && isAbsolute(manifest.sourceWorkingDirectory) && manifest.baseCommit !== null && manifest.identity.workspace === "isolated");
|
|
20724
|
+
async function prepareExecutionContextWorkspace(input) {
|
|
20725
|
+
const parsed = executionContextTaskSchema.safeParse(input.context);
|
|
20726
|
+
if (!parsed.success) throw failure("invalid_workspace_context");
|
|
20727
|
+
const { nativeConversationId, runtimeWorkspaceFingerprint } = parsed.data;
|
|
20728
|
+
const identity = executionContextAssignmentSchema.strip().parse(parsed.data);
|
|
20729
|
+
const source = identity.access !== "space_context" ? await canonicalDirectory(input.currentWorkingDirectory) : null;
|
|
20730
|
+
if (source) {
|
|
20731
|
+
assertSourceAllowed(source, input.policy);
|
|
20732
|
+
if (identity.workspace === "current") return {
|
|
20733
|
+
workingDirectory: source,
|
|
20734
|
+
boundaryRoot: source
|
|
20735
|
+
};
|
|
20736
|
+
}
|
|
20737
|
+
const ledgerRoot = await ensureDirectory(input.ledgerRootPath, true);
|
|
20738
|
+
const workspaceRoot = await ensureDirectory(join(ledgerRoot, "execution-context-workspaces"));
|
|
20739
|
+
const recordsRoot = await ensureDirectory(join(ledgerRoot, "execution-context-workspace-records"));
|
|
20740
|
+
const boundaryRoot = join(workspaceRoot, identity.id);
|
|
20741
|
+
const workingDirectory = source ? join(boundaryRoot, "worktree") : boundaryRoot;
|
|
20742
|
+
const recordPath = join(recordsRoot, `${identity.id}.json`);
|
|
20743
|
+
return await withWorkspaceLock(ledgerRoot, identity.id, async () => {
|
|
20744
|
+
const stored = await readManifest(recordPath);
|
|
20745
|
+
if (stored) {
|
|
20746
|
+
if (JSON.stringify(stored.identity) !== JSON.stringify(identity) || stored.sourceWorkingDirectory !== source || stored.boundaryRoot !== boundaryRoot || stored.workingDirectory !== workingDirectory) throw failure("workspace_identity_mismatch");
|
|
20747
|
+
await reconcileRetainedWorkspace(stored, recordPath, Boolean(runtimeWorkspaceFingerprint || nativeConversationId), ledgerRoot);
|
|
20748
|
+
return await verifyRetainedWorkspace(stored);
|
|
20749
|
+
}
|
|
20750
|
+
if (runtimeWorkspaceFingerprint || nativeConversationId) throw failure("workspace_record_missing");
|
|
20751
|
+
if (await inspectPath(boundaryRoot)) throw failure("workspace_already_exists");
|
|
20752
|
+
const baseCommit = source ? await resolveSourceCommit(source) : null;
|
|
20753
|
+
const manifest = {
|
|
20754
|
+
version: 2,
|
|
20755
|
+
identity,
|
|
20756
|
+
sourceWorkingDirectory: source,
|
|
20757
|
+
baseCommit,
|
|
20758
|
+
boundaryRoot,
|
|
20759
|
+
workingDirectory,
|
|
20760
|
+
status: "preparing",
|
|
20761
|
+
copiedUncommittedFiles: false,
|
|
20762
|
+
processSupervisionId: randomUUID()
|
|
20763
|
+
};
|
|
20764
|
+
await writeManifest(recordPath, manifest, "wx");
|
|
20765
|
+
await finishWorkspacePreparation(manifest, recordPath, true);
|
|
20766
|
+
return workspaceResult(manifest);
|
|
20767
|
+
});
|
|
20768
|
+
}
|
|
20769
|
+
async function reconcileRetainedWorkspace(record, path, hasNativeIdentity, ledgerRoot) {
|
|
20770
|
+
if (record.status === "retiring") await runWithHeldLock({
|
|
20771
|
+
lock: await acquireWorkspaceExecutionLock(ledgerRoot, record.identity.id),
|
|
20772
|
+
run: async () => {
|
|
20773
|
+
if (!record.processSupervisionId || (await listAgentControllerSupervisedProcessIds({
|
|
20774
|
+
fresh: true,
|
|
20775
|
+
processId: null,
|
|
20776
|
+
supervisionId: record.processSupervisionId
|
|
20777
|
+
})).length > 0) throw failure("workspace_execution_quiescence_unconfirmed");
|
|
20778
|
+
const reconciled = await finishWorkspaceRetirement(record, path);
|
|
20779
|
+
if (reconciled.status === "released") await restoreReleasedWorkspace(reconciled, path);
|
|
20780
|
+
}
|
|
20781
|
+
});
|
|
20782
|
+
else if (record.status === "released") await restoreReleasedWorkspace(record, path);
|
|
20783
|
+
else if (record.status === "preparing" || record.status === "restoring") {
|
|
20784
|
+
if (record.status === "preparing" && hasNativeIdentity) throw failure("workspace_creation_incomplete");
|
|
20785
|
+
if (!record.processSupervisionId || (await listAgentControllerSupervisedProcessIds({
|
|
20786
|
+
fresh: true,
|
|
20787
|
+
processId: null,
|
|
20788
|
+
supervisionId: record.processSupervisionId
|
|
20789
|
+
})).length > 0) throw failure("workspace_preparation_quiescence_unconfirmed");
|
|
20790
|
+
await finishWorkspacePreparation(record, path);
|
|
20791
|
+
} else if (record.status === "in_use") await runWithHeldLock({
|
|
20792
|
+
lock: await acquireWorkspaceExecutionLock(ledgerRoot, record.identity.id),
|
|
20793
|
+
run: async () => {
|
|
20794
|
+
if (!record.processSupervisionId || (await listAgentControllerSupervisedProcessIds({
|
|
20795
|
+
fresh: true,
|
|
20796
|
+
processId: null,
|
|
20797
|
+
supervisionId: record.processSupervisionId
|
|
20798
|
+
})).length > 0) throw failure("workspace_execution_quiescence_unconfirmed");
|
|
20799
|
+
await verifyRetainedWorkspace(record);
|
|
20800
|
+
await writeManifest(path, {
|
|
20801
|
+
...record,
|
|
20802
|
+
status: "completed"
|
|
20803
|
+
}, "r+");
|
|
20804
|
+
}
|
|
20805
|
+
});
|
|
20806
|
+
}
|
|
20807
|
+
async function finishWorkspacePreparation(manifest, recordPath, pristineCreation = false) {
|
|
20808
|
+
const { boundaryRoot, workingDirectory, sourceWorkingDirectory: source, baseCommit } = manifest;
|
|
20809
|
+
await ensureDirectory(boundaryRoot);
|
|
20810
|
+
const repository = join(boundaryRoot, "repository.git");
|
|
20811
|
+
if (source && baseCommit) {
|
|
20812
|
+
if (!await inspectPath(repository)) {
|
|
20813
|
+
if ((await readdir(boundaryRoot)).length > 0) throw failure("workspace_creation_incomplete");
|
|
20814
|
+
await git(boundaryRoot, [
|
|
20815
|
+
"init",
|
|
20816
|
+
"--bare",
|
|
20817
|
+
"--template=",
|
|
20818
|
+
`--object-format=${baseCommit.length === 64 ? "sha256" : "sha1"}`,
|
|
20819
|
+
repository
|
|
20820
|
+
], manifest.processSupervisionId);
|
|
20821
|
+
}
|
|
20822
|
+
await canonicalDirectory(repository);
|
|
20823
|
+
await assertPrivateMetadata(repository);
|
|
20824
|
+
if ((await readdir(boundaryRoot)).some((name) => name !== "repository.git" && name !== "worktree")) throw failure("workspace_creation_incomplete");
|
|
20825
|
+
if (await inspectPath(join(repository, "objects", "info", "alternates"))) throw failure("workspace_git_metadata_changed");
|
|
20826
|
+
if (!await inspectPath(workingDirectory)) {
|
|
20827
|
+
await git(boundaryRoot, [
|
|
20828
|
+
`--git-dir=${repository}`,
|
|
20829
|
+
"fetch",
|
|
20830
|
+
"--no-tags",
|
|
20831
|
+
"--no-recurse-submodules",
|
|
20832
|
+
"--depth=1",
|
|
20833
|
+
"--no-write-fetch-head",
|
|
20834
|
+
source,
|
|
20835
|
+
`${baseCommit}:refs/openmeld/base`
|
|
20836
|
+
], manifest.processSupervisionId);
|
|
20837
|
+
await git(boundaryRoot, [
|
|
20838
|
+
`--git-dir=${repository}`,
|
|
20839
|
+
"worktree",
|
|
20840
|
+
"add",
|
|
20841
|
+
"--detach",
|
|
20842
|
+
workingDirectory,
|
|
20843
|
+
baseCommit
|
|
20844
|
+
], manifest.processSupervisionId);
|
|
20845
|
+
}
|
|
20846
|
+
await verifyOwnedRepository(manifest);
|
|
20847
|
+
await finishMissingCheckoutFiles(manifest);
|
|
20848
|
+
if (!await isUnchangedCheckout(manifest)) throw failure("workspace_creation_incomplete");
|
|
20849
|
+
} else if ((await readdir(boundaryRoot)).length > 0) throw failure("workspace_creation_incomplete");
|
|
20850
|
+
await writeManifest(recordPath, {
|
|
20851
|
+
...manifest,
|
|
20852
|
+
status: "completed",
|
|
20853
|
+
pristineFingerprint: pristineCreation ? await fingerprintDirectory(boundaryRoot) : void 0
|
|
20854
|
+
}, "r+");
|
|
20855
|
+
}
|
|
20856
|
+
async function readExecutionContextWorkspace(input) {
|
|
20857
|
+
if (!executionContextAssignmentSchema.shape.id.safeParse(input.contextId).success) throw failure("invalid_workspace_context");
|
|
20858
|
+
if (!await inspectPath(input.ledgerRootPath)) return null;
|
|
20859
|
+
const ledgerRoot = await canonicalDirectory(input.ledgerRootPath);
|
|
20860
|
+
const recordsRoot = join(ledgerRoot, "execution-context-workspace-records");
|
|
20861
|
+
if (!await inspectPath(recordsRoot)) return null;
|
|
20862
|
+
await canonicalDirectory(recordsRoot);
|
|
20863
|
+
const manifest = await readManifest(join(recordsRoot, `${input.contextId}.json`));
|
|
20864
|
+
if (!manifest) return null;
|
|
20865
|
+
const boundaryRoot = join(await canonicalDirectory(join(ledgerRoot, "execution-context-workspaces")), input.contextId);
|
|
20866
|
+
const workingDirectory = manifest.identity.access !== "space_context" ? join(boundaryRoot, "worktree") : boundaryRoot;
|
|
20867
|
+
if (manifest.identity.id !== input.contextId || manifest.boundaryRoot !== boundaryRoot || manifest.workingDirectory !== workingDirectory) throw failure("workspace_identity_mismatch");
|
|
20868
|
+
if (manifest.status === "released" || manifest.status === "retiring") return workspaceResult(manifest);
|
|
20869
|
+
if (manifest.status === "preparing" || manifest.status === "restoring") throw failure("workspace_creation_incomplete");
|
|
20870
|
+
return await verifyRetainedWorkspace(manifest);
|
|
20871
|
+
}
|
|
20872
|
+
async function markExecutionContextWorkspaceInUse(input) {
|
|
20873
|
+
const context = input.context;
|
|
20874
|
+
if (!context || context.workspace !== "isolated" || context.access === "space_context") return null;
|
|
20875
|
+
const root = await canonicalDirectory(input.ledgerRootPath);
|
|
20876
|
+
const lock = await acquireWorkspaceExecutionLock(root, context.id);
|
|
20877
|
+
const processSupervisionId = randomUUID();
|
|
20878
|
+
try {
|
|
20879
|
+
await withWorkspaceLock(root, context.id, async () => {
|
|
20880
|
+
await readExecutionContextWorkspace({
|
|
20881
|
+
ledgerRootPath: root,
|
|
20882
|
+
contextId: context.id
|
|
20883
|
+
});
|
|
20884
|
+
const path = join(root, "execution-context-workspace-records", `${context.id}.json`);
|
|
20885
|
+
const record = await readManifest(path);
|
|
20886
|
+
if (record?.status !== "completed") throw failure("workspace_execution_quiescence_unconfirmed");
|
|
20887
|
+
await writeManifest(path, {
|
|
20888
|
+
...record,
|
|
20889
|
+
status: "in_use",
|
|
20890
|
+
processSupervisionId
|
|
20891
|
+
}, "r+");
|
|
20892
|
+
});
|
|
20893
|
+
return {
|
|
20894
|
+
lock,
|
|
20895
|
+
processSupervisionId
|
|
20896
|
+
};
|
|
20897
|
+
} catch (error) {
|
|
20898
|
+
await releaseLock(lock);
|
|
20899
|
+
throw error;
|
|
20900
|
+
}
|
|
20901
|
+
}
|
|
20902
|
+
async function releaseExecutionContextWorkspace(input) {
|
|
20903
|
+
const root = await canonicalDirectory(input.ledgerRootPath);
|
|
20904
|
+
try {
|
|
20905
|
+
return await withWorkspaceLock(root, input.context.id, async () => {
|
|
20906
|
+
await readExecutionContextWorkspace({
|
|
20907
|
+
ledgerRootPath: root,
|
|
20908
|
+
contextId: input.context.id
|
|
20909
|
+
});
|
|
20910
|
+
const path = join(root, "execution-context-workspace-records", `${input.context.id}.json`);
|
|
20911
|
+
let record = await readManifest(path);
|
|
20912
|
+
if (!(record && ["completed", "in_use"].includes(record.status))) throw failure("workspace_creation_incomplete");
|
|
20913
|
+
if (!input.ownedProcessesQuiescent) return {
|
|
20914
|
+
status: "retained",
|
|
20915
|
+
reason: "execution_quiescence_unconfirmed"
|
|
20916
|
+
};
|
|
20917
|
+
const completed = {
|
|
20918
|
+
...record,
|
|
20919
|
+
status: "completed"
|
|
20920
|
+
};
|
|
20921
|
+
await writeManifest(path, completed, "r+");
|
|
20922
|
+
record = await removePristineRetirement(completed, path);
|
|
20923
|
+
if (record.retirement) return {
|
|
20924
|
+
status: "retained",
|
|
20925
|
+
reason: "cleanup_incomplete"
|
|
20926
|
+
};
|
|
20927
|
+
if (!record.pristineFingerprint) return {
|
|
20928
|
+
status: "retained",
|
|
20929
|
+
reason: "baseline_unverified"
|
|
20930
|
+
};
|
|
20931
|
+
await verifyRetainedWorkspace(record);
|
|
20932
|
+
if (await fingerprintDirectory(record.boundaryRoot) !== record.pristineFingerprint) return {
|
|
20933
|
+
status: "retained",
|
|
20934
|
+
reason: "workspace_changed"
|
|
20935
|
+
};
|
|
20936
|
+
if (record.sourceWorkingDirectory && !await sourceHasCommit(record)) return {
|
|
20937
|
+
status: "retained",
|
|
20938
|
+
reason: "source_commit_unavailable"
|
|
20939
|
+
};
|
|
20940
|
+
return (await retirePristineWorkspace(record, path)).status === "released" ? { status: "released" } : {
|
|
20941
|
+
status: "retained",
|
|
20942
|
+
reason: "workspace_changed"
|
|
20943
|
+
};
|
|
20944
|
+
});
|
|
20945
|
+
} finally {
|
|
20946
|
+
if (input.use) await releaseLock(input.use.lock);
|
|
20947
|
+
}
|
|
20948
|
+
}
|
|
20949
|
+
async function retirePristineWorkspace(record, recordPath) {
|
|
20950
|
+
if (!record.pristineFingerprint || await fingerprintDirectory(record.boundaryRoot) !== record.pristineFingerprint) throw failure("workspace_release_incomplete");
|
|
20951
|
+
const retiring = {
|
|
20952
|
+
...record,
|
|
20953
|
+
status: "retiring",
|
|
20954
|
+
retirement: {
|
|
20955
|
+
path: `${recordPath}.retired-${randomUUID()}`,
|
|
20956
|
+
pristineFingerprint: record.pristineFingerprint
|
|
20957
|
+
}
|
|
20958
|
+
};
|
|
20959
|
+
await writeManifest(recordPath, retiring, "r+");
|
|
20960
|
+
return await finishWorkspaceRetirement(retiring, recordPath);
|
|
20961
|
+
}
|
|
20962
|
+
async function finishWorkspaceRetirement(record, recordPath) {
|
|
20963
|
+
const retirement = record.retirement;
|
|
20964
|
+
if (!retirement) throw failure("workspace_release_incomplete");
|
|
20965
|
+
const live = await inspectPath(record.boundaryRoot);
|
|
20966
|
+
const retired = await inspectPath(retirement.path);
|
|
20967
|
+
if (live && retired || !(live || retired)) throw failure("workspace_release_incomplete");
|
|
20968
|
+
if (live) await moveWorkspace(record.boundaryRoot, retirement.path);
|
|
20969
|
+
if (await fingerprintDirectory(retirement.path) !== retirement.pristineFingerprint) {
|
|
20970
|
+
if (await inspectPath(record.boundaryRoot)) throw failure("workspace_release_incomplete");
|
|
20971
|
+
await moveWorkspace(retirement.path, record.boundaryRoot);
|
|
20972
|
+
const retained = {
|
|
20973
|
+
...record,
|
|
20974
|
+
retirement: void 0,
|
|
20975
|
+
status: "completed"
|
|
20976
|
+
};
|
|
20977
|
+
await writeManifest(recordPath, retained, "r+");
|
|
20978
|
+
return retained;
|
|
20979
|
+
}
|
|
20980
|
+
const released = {
|
|
20981
|
+
...record,
|
|
20982
|
+
status: "released"
|
|
20983
|
+
};
|
|
20984
|
+
await writeManifest(recordPath, released, "r+");
|
|
20985
|
+
return await removePristineRetirement(released, recordPath);
|
|
20986
|
+
}
|
|
20987
|
+
async function removePristineRetirement(record, recordPath) {
|
|
20988
|
+
const retirement = record.retirement;
|
|
20989
|
+
if (!retirement) return record;
|
|
20990
|
+
if (await inspectPath(retirement.path)) {
|
|
20991
|
+
if (await fingerprintDirectory(retirement.path) !== retirement.pristineFingerprint) return record;
|
|
20992
|
+
await rm(retirement.path, { recursive: true });
|
|
20993
|
+
}
|
|
20994
|
+
const removed = {
|
|
20995
|
+
...record,
|
|
20996
|
+
retirement: void 0
|
|
20997
|
+
};
|
|
20998
|
+
await writeManifest(recordPath, removed, "r+");
|
|
20999
|
+
return removed;
|
|
21000
|
+
}
|
|
21001
|
+
async function restoreReleasedWorkspace(record, recordPath) {
|
|
21002
|
+
if (record.sourceWorkingDirectory && !await sourceHasCommit(record)) throw failure("workspace_base_commit_unavailable");
|
|
21003
|
+
if (await inspectPath(record.boundaryRoot)) throw failure("workspace_already_exists");
|
|
21004
|
+
const restoring = {
|
|
21005
|
+
...record,
|
|
21006
|
+
status: "restoring",
|
|
21007
|
+
processSupervisionId: randomUUID()
|
|
21008
|
+
};
|
|
21009
|
+
await writeManifest(recordPath, restoring, "r+");
|
|
21010
|
+
await finishWorkspacePreparation(restoring, recordPath, true);
|
|
21011
|
+
}
|
|
21012
|
+
async function sourceHasCommit(record) {
|
|
21013
|
+
if (!(record.sourceWorkingDirectory && record.baseCommit)) return false;
|
|
21014
|
+
try {
|
|
21015
|
+
await git(record.sourceWorkingDirectory, [
|
|
21016
|
+
"cat-file",
|
|
21017
|
+
"-e",
|
|
21018
|
+
`${record.baseCommit}^{commit}`
|
|
21019
|
+
]);
|
|
21020
|
+
return true;
|
|
21021
|
+
} catch {
|
|
21022
|
+
return false;
|
|
21023
|
+
}
|
|
21024
|
+
}
|
|
21025
|
+
async function isUnchangedCheckout(record) {
|
|
21026
|
+
return await git(record.workingDirectory, ["rev-parse", "HEAD"]) === record.baseCommit && await git(record.workingDirectory, [
|
|
21027
|
+
"status",
|
|
21028
|
+
"--porcelain",
|
|
21029
|
+
"--untracked-files=all",
|
|
21030
|
+
"--ignored"
|
|
21031
|
+
]) === "";
|
|
21032
|
+
}
|
|
21033
|
+
async function finishMissingCheckoutFiles(record) {
|
|
21034
|
+
if (await git(record.workingDirectory, ["rev-parse", "HEAD"]) !== record.baseCommit) throw failure("workspace_creation_incomplete");
|
|
21035
|
+
if ((await git(record.workingDirectory, [
|
|
21036
|
+
"ls-files",
|
|
21037
|
+
"-v",
|
|
21038
|
+
"-z"
|
|
21039
|
+
])).split("\0").some((entry) => entry && !entry.startsWith("H "))) throw failure("workspace_creation_incomplete");
|
|
21040
|
+
const status = await git(record.workingDirectory, [
|
|
21041
|
+
"status",
|
|
21042
|
+
"--porcelain",
|
|
21043
|
+
"-z",
|
|
21044
|
+
"--untracked-files=all",
|
|
21045
|
+
"--ignored"
|
|
21046
|
+
]);
|
|
21047
|
+
if (!status) return;
|
|
21048
|
+
const changes = status.split("\0").filter(Boolean);
|
|
21049
|
+
if (changes.some((entry) => !entry.startsWith(" D "))) throw failure("workspace_creation_incomplete");
|
|
21050
|
+
const paths = changes.map((entry) => entry.slice(3));
|
|
21051
|
+
for (let offset = 0; offset < paths.length; offset += 100) await git(record.workingDirectory, [
|
|
21052
|
+
"checkout-index",
|
|
21053
|
+
"--",
|
|
21054
|
+
...paths.slice(offset, offset + 100)
|
|
21055
|
+
], record.processSupervisionId);
|
|
21056
|
+
}
|
|
21057
|
+
async function fingerprintDirectory(root) {
|
|
21058
|
+
const hash = createHash("sha256");
|
|
21059
|
+
const visit = async (directory) => {
|
|
21060
|
+
for (const name of (await readdir(directory)).sort()) {
|
|
21061
|
+
const path = join(directory, name);
|
|
21062
|
+
const info = await lstat(path);
|
|
21063
|
+
hash.update(JSON.stringify([
|
|
21064
|
+
relative(root, path),
|
|
21065
|
+
info.mode,
|
|
21066
|
+
info.nlink
|
|
21067
|
+
]));
|
|
21068
|
+
if (info.isSymbolicLink()) hash.update(JSON.stringify(await readlink(path)));
|
|
21069
|
+
else if (info.isDirectory()) await visit(path);
|
|
21070
|
+
else if (info.isFile() && info.nlink === 1) {
|
|
21071
|
+
hash.update(String(info.size));
|
|
21072
|
+
hash.update(await fingerprintFile(path));
|
|
21073
|
+
} else throw failure("workspace_git_metadata_changed");
|
|
21074
|
+
}
|
|
21075
|
+
};
|
|
21076
|
+
await visit(root);
|
|
21077
|
+
return hash.digest("hex");
|
|
21078
|
+
}
|
|
21079
|
+
async function fingerprintFile(path) {
|
|
21080
|
+
const hash = createHash("sha256");
|
|
21081
|
+
const file = await open(path, "r");
|
|
21082
|
+
try {
|
|
21083
|
+
const buffer = Buffer.alloc(64 * 1024);
|
|
21084
|
+
for (;;) {
|
|
21085
|
+
const { bytesRead } = await file.read(buffer);
|
|
21086
|
+
if (!bytesRead) break;
|
|
21087
|
+
hash.update(buffer.subarray(0, bytesRead));
|
|
21088
|
+
}
|
|
21089
|
+
} finally {
|
|
21090
|
+
await file.close();
|
|
21091
|
+
}
|
|
21092
|
+
return hash.digest("hex");
|
|
21093
|
+
}
|
|
21094
|
+
async function withWorkspaceLock(root, contextId, run) {
|
|
21095
|
+
if (!executionContextAssignmentSchema.shape.id.safeParse(contextId).success) throw failure("invalid_workspace_context");
|
|
21096
|
+
return await runWithHeldLock({
|
|
21097
|
+
lock: await acquireLock({
|
|
21098
|
+
openMeldProfileId: "execution-context-workspaces",
|
|
21099
|
+
key: contextId,
|
|
21100
|
+
pathResolution: { env: { OPENMELD_HOME: root } }
|
|
21101
|
+
}),
|
|
21102
|
+
run
|
|
21103
|
+
});
|
|
21104
|
+
}
|
|
21105
|
+
async function verifyRetainedWorkspace(manifest) {
|
|
21106
|
+
await canonicalDirectory(manifest.boundaryRoot);
|
|
21107
|
+
await canonicalDirectory(manifest.workingDirectory);
|
|
21108
|
+
if (manifest.sourceWorkingDirectory) await verifyOwnedRepository(manifest);
|
|
21109
|
+
return workspaceResult(manifest);
|
|
21110
|
+
}
|
|
21111
|
+
async function acquireWorkspaceExecutionLock(root, contextId) {
|
|
21112
|
+
return await acquireLock({
|
|
21113
|
+
openMeldProfileId: "execution-context-workspaces",
|
|
21114
|
+
key: `${contextId}-execution`,
|
|
21115
|
+
pathResolution: { env: { OPENMELD_HOME: root } }
|
|
21116
|
+
});
|
|
21117
|
+
}
|
|
21118
|
+
function workspaceResult(manifest) {
|
|
21119
|
+
return {
|
|
21120
|
+
workingDirectory: manifest.workingDirectory,
|
|
21121
|
+
boundaryRoot: manifest.boundaryRoot,
|
|
21122
|
+
...manifest.sourceWorkingDirectory ? { sourceWorkingDirectory: manifest.sourceWorkingDirectory } : {},
|
|
21123
|
+
...manifest.baseCommit ? { baseCommit: manifest.baseCommit } : {}
|
|
21124
|
+
};
|
|
21125
|
+
}
|
|
21126
|
+
function assertSourceAllowed(source, policy) {
|
|
21127
|
+
if (policy.mode === "only_selected_folders" && !policy.folders.some((folder) => within(source, folder))) throw failure("workspace_outside_computer_policy");
|
|
21128
|
+
if (policy.mode === "block_selected_folders" && policy.folders.some((folder) => within(source, folder) || within(folder, source))) throw failure("workspace_overlaps_blocked_folder");
|
|
21129
|
+
}
|
|
21130
|
+
async function resolveSourceCommit(source) {
|
|
21131
|
+
if (!await inspectPath(join(source, ".git"))) throw failure("project_repository_required");
|
|
21132
|
+
if (await realpath(await git(source, ["rev-parse", "--show-toplevel"])) !== source) throw failure("project_repository_root_required");
|
|
21133
|
+
const commit = await git(source, [
|
|
21134
|
+
"rev-parse",
|
|
21135
|
+
"--verify",
|
|
21136
|
+
"HEAD^{commit}"
|
|
21137
|
+
]).catch((cause) => {
|
|
21138
|
+
throw new Error("execution_context.project_commit_required", { cause });
|
|
21139
|
+
});
|
|
21140
|
+
if (!COMMIT_PATTERN.test(commit)) throw failure("project_commit_required");
|
|
21141
|
+
return commit;
|
|
21142
|
+
}
|
|
21143
|
+
async function verifyOwnedRepository(manifest) {
|
|
21144
|
+
const repository = join(manifest.boundaryRoot, "repository.git");
|
|
21145
|
+
await canonicalDirectory(repository);
|
|
21146
|
+
await assertPrivateMetadata(repository);
|
|
21147
|
+
if (await inspectPath(join(repository, "objects", "info", "alternates"))) throw failure("workspace_git_metadata_changed");
|
|
21148
|
+
const gitFile = join(manifest.workingDirectory, ".git");
|
|
21149
|
+
const gitFileInfo = await inspectPath(gitFile);
|
|
21150
|
+
if (!gitFileInfo?.isFile() || gitFileInfo.size > 4096) throw failure("workspace_git_metadata_changed");
|
|
21151
|
+
const expectedGitDir = join(repository, "worktrees", "worktree");
|
|
21152
|
+
if ((await readFile(gitFile, "utf8")).trim() !== `gitdir: ${expectedGitDir}`) throw failure("workspace_git_metadata_changed");
|
|
21153
|
+
if (await realpath(join(expectedGitDir, (await readFile(join(expectedGitDir, "commondir"), "utf8")).trim())) !== repository) throw failure("workspace_git_metadata_changed");
|
|
21154
|
+
if (await git(manifest.boundaryRoot, [
|
|
21155
|
+
`--git-dir=${repository}`,
|
|
21156
|
+
"rev-parse",
|
|
21157
|
+
"--verify",
|
|
21158
|
+
"refs/openmeld/base^{commit}"
|
|
21159
|
+
]) !== manifest.baseCommit) throw failure("workspace_base_commit_changed");
|
|
21160
|
+
}
|
|
21161
|
+
async function assertPrivateMetadata(path) {
|
|
21162
|
+
for (const entry of await readdir(path, { withFileTypes: true })) {
|
|
21163
|
+
if (entry.isSymbolicLink()) throw failure("workspace_is_symlink");
|
|
21164
|
+
if (entry.isDirectory()) await assertPrivateMetadata(join(path, entry.name));
|
|
21165
|
+
else if ((await lstat(join(path, entry.name))).nlink !== 1) throw failure("workspace_git_metadata_changed");
|
|
21166
|
+
}
|
|
21167
|
+
}
|
|
21168
|
+
async function readManifest(path) {
|
|
21169
|
+
const info = await inspectPath(path);
|
|
21170
|
+
if (!info) return null;
|
|
21171
|
+
if (!info.isFile() || info.size > 32768) throw failure("workspace_record_invalid");
|
|
21172
|
+
let content;
|
|
21173
|
+
try {
|
|
21174
|
+
content = JSON.parse(await readFile(path, "utf8"));
|
|
21175
|
+
} catch {
|
|
21176
|
+
throw failure("workspace_record_invalid");
|
|
21177
|
+
}
|
|
21178
|
+
const parsed = manifestSchema.safeParse(content);
|
|
21179
|
+
if (!parsed.success) throw failure("workspace_record_invalid");
|
|
21180
|
+
const retirement = parsed.data.retirement;
|
|
21181
|
+
const prefix = `${path}.retired-`;
|
|
21182
|
+
if (parsed.data.status === "retiring" && !retirement || retirement && !(retirement.path.startsWith(prefix) && z.uuid().safeParse(retirement.path.slice(prefix.length)).success)) throw failure("workspace_record_invalid");
|
|
21183
|
+
return parsed.data;
|
|
21184
|
+
}
|
|
21185
|
+
async function writeManifest(path, manifest, flags) {
|
|
21186
|
+
const temporaryPath = flags === "wx" ? path : `${path}.${randomUUID()}.tmp`;
|
|
21187
|
+
const file = await open(temporaryPath, "wx", 384);
|
|
21188
|
+
try {
|
|
21189
|
+
await file.writeFile(`${JSON.stringify({
|
|
21190
|
+
...manifest,
|
|
21191
|
+
version: 2
|
|
21192
|
+
})}\n`, "utf8");
|
|
21193
|
+
await file.sync();
|
|
21194
|
+
} finally {
|
|
21195
|
+
await file.close();
|
|
21196
|
+
}
|
|
21197
|
+
if (flags !== "wx") await rename(temporaryPath, path);
|
|
21198
|
+
await syncDirectory(dirname(path));
|
|
21199
|
+
}
|
|
21200
|
+
async function moveWorkspace(from, to) {
|
|
21201
|
+
await rename(from, to);
|
|
21202
|
+
await syncDirectory(dirname(from));
|
|
21203
|
+
await syncDirectory(dirname(to));
|
|
21204
|
+
}
|
|
21205
|
+
async function inspectPath(path) {
|
|
21206
|
+
const info = await lstat(path).catch((error) => {
|
|
21207
|
+
if (error.code === "ENOENT") return null;
|
|
21208
|
+
throw error;
|
|
21209
|
+
});
|
|
21210
|
+
if (info?.isSymbolicLink()) throw failure("workspace_is_symlink");
|
|
21211
|
+
return info;
|
|
21212
|
+
}
|
|
21213
|
+
async function canonicalDirectory(path) {
|
|
21214
|
+
if (!(await inspectPath(path))?.isDirectory()) throw failure("workspace_directory_unavailable");
|
|
21215
|
+
return await realpath(path);
|
|
21216
|
+
}
|
|
21217
|
+
async function ensureDirectory(path, recursive = false) {
|
|
21218
|
+
await inspectPath(path);
|
|
21219
|
+
await mkdir(path, {
|
|
21220
|
+
recursive,
|
|
21221
|
+
mode: 448
|
|
21222
|
+
}).catch((error) => {
|
|
21223
|
+
if (error.code !== "EEXIST") throw error;
|
|
21224
|
+
});
|
|
21225
|
+
return await canonicalDirectory(path);
|
|
21226
|
+
}
|
|
21227
|
+
function within(child, parent) {
|
|
21228
|
+
const path = relative(resolve(parent), child);
|
|
21229
|
+
return path === "" || path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path);
|
|
21230
|
+
}
|
|
21231
|
+
const GIT_SETTINGS = {
|
|
21232
|
+
"core.hooksPath": "/dev/null",
|
|
21233
|
+
"core.attributesFile": "/dev/null",
|
|
21234
|
+
"core.fsmonitor": "false",
|
|
21235
|
+
"credential.helper": "",
|
|
21236
|
+
"protocol.allow": "never",
|
|
21237
|
+
"protocol.file.allow": "always",
|
|
21238
|
+
"fetch.recurseSubmodules": "false",
|
|
21239
|
+
"submodule.recurse": "false",
|
|
21240
|
+
"uploadpack.packObjectsHook": "",
|
|
21241
|
+
"gc.auto": "0",
|
|
21242
|
+
"maintenance.auto": "false"
|
|
21243
|
+
};
|
|
21244
|
+
async function git(cwd, args, processSupervisionId) {
|
|
21245
|
+
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith("GIT_")));
|
|
21246
|
+
Object.assign(env, {
|
|
21247
|
+
...processSupervisionId ? { OPENMELD_PROCESS_SUPERVISION_ID: processSupervisionId } : {},
|
|
21248
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
21249
|
+
GIT_CONFIG_SYSTEM: "/dev/null",
|
|
21250
|
+
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
21251
|
+
GIT_ATTR_NOSYSTEM: "1",
|
|
21252
|
+
GIT_NO_REPLACE_OBJECTS: "1",
|
|
21253
|
+
GIT_NO_LAZY_FETCH: "1",
|
|
21254
|
+
GIT_ALLOW_PROTOCOL: "file",
|
|
21255
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
21256
|
+
GIT_CONFIG_COUNT: String(Object.keys(GIT_SETTINGS).length)
|
|
21257
|
+
});
|
|
21258
|
+
for (const [index, [key, value]] of Object.entries(GIT_SETTINGS).entries()) {
|
|
21259
|
+
env[`GIT_CONFIG_KEY_${index}`] = key;
|
|
21260
|
+
env[`GIT_CONFIG_VALUE_${index}`] = value;
|
|
21261
|
+
}
|
|
21262
|
+
return (await execFileAsync("git", args, {
|
|
21263
|
+
cwd,
|
|
21264
|
+
env,
|
|
21265
|
+
encoding: "utf8",
|
|
21266
|
+
timeout: 3e4,
|
|
21267
|
+
maxBuffer: 1024 * 1024
|
|
21268
|
+
})).stdout.trimEnd();
|
|
21269
|
+
}
|
|
21270
|
+
function failure(code) {
|
|
21271
|
+
return /* @__PURE__ */ new Error(`execution_context.${code}`);
|
|
21272
|
+
}
|
|
21273
|
+
//#endregion
|
|
21274
|
+
//#region src/local-service/dispatch/execution-context-session.ts
|
|
21275
|
+
function executionContextLedgerPolicy(context) {
|
|
21276
|
+
return context ? "throw" : "backup_and_reset";
|
|
21277
|
+
}
|
|
21278
|
+
function executionContextResourceScope(context) {
|
|
21279
|
+
if (!context) return;
|
|
21280
|
+
if (context.access === "space_context") return "none";
|
|
21281
|
+
if (context.workspace === "isolated") return context.access === "workspace" ? "isolated" : "isolated_read";
|
|
21282
|
+
return context.access === "workspace" ? "exclusive" : "read_only";
|
|
21283
|
+
}
|
|
21284
|
+
function executionContextFileAccessBoundary(input) {
|
|
21285
|
+
const within = (child, parent) => {
|
|
21286
|
+
const path = relative(parent, child);
|
|
21287
|
+
return path === "" || path !== ".." && !path.startsWith("../") && !isAbsolute(path);
|
|
21288
|
+
};
|
|
21289
|
+
const policy = input.policy;
|
|
21290
|
+
if (input.context.access !== "space_context") {
|
|
21291
|
+
const policySource = input.taskWorkspace?.sourceWorkingDirectory ?? input.workingDirectory;
|
|
21292
|
+
if (policy.mode === "only_selected_folders" && !policy.folders.some((folder) => within(policySource, folder))) throw new Error("execution_context.workspace_outside_computer_policy");
|
|
21293
|
+
if (policy.mode === "block_selected_folders" && policy.folders.some((folder) => within(policySource, folder) || within(folder, policySource))) throw new Error("execution_context.workspace_overlaps_blocked_folder");
|
|
21294
|
+
}
|
|
21295
|
+
return {
|
|
21296
|
+
mode: "only_selected_folders",
|
|
21297
|
+
folders: [input.taskWorkspace?.boundaryRoot ?? input.workingDirectory],
|
|
21298
|
+
revision: policy.revision,
|
|
21299
|
+
updatedAtMs: policy.updatedAtMs,
|
|
21300
|
+
executionContextAccess: input.context.access
|
|
21301
|
+
};
|
|
21302
|
+
}
|
|
21303
|
+
async function executionContextWorkingDirectory(input) {
|
|
21304
|
+
if (!input.context) return input.currentWorkingDirectory;
|
|
21305
|
+
if (input.context.workspace === "current") return await realpath(input.currentWorkingDirectory);
|
|
21306
|
+
await mkdir(input.ledgerRootPath, {
|
|
21307
|
+
recursive: true,
|
|
21308
|
+
mode: 448
|
|
21309
|
+
});
|
|
21310
|
+
const root = join(await realpath(input.ledgerRootPath), "execution-context-workspaces");
|
|
21311
|
+
await mkdir(root, {
|
|
21312
|
+
recursive: true,
|
|
21313
|
+
mode: 448
|
|
21314
|
+
});
|
|
21315
|
+
if ((await lstat(root)).isSymbolicLink()) throw new Error("execution_context.workspace_is_symlink");
|
|
21316
|
+
const path = join(root, input.context.id);
|
|
21317
|
+
await mkdir(path, {
|
|
21318
|
+
recursive: true,
|
|
21319
|
+
mode: 448
|
|
21320
|
+
});
|
|
21321
|
+
if ((await lstat(path)).isSymbolicLink()) throw new Error("execution_context.workspace_is_symlink");
|
|
21322
|
+
return await realpath(path);
|
|
21323
|
+
}
|
|
21324
|
+
async function prepareExecutionContextConversation(input) {
|
|
21325
|
+
if (!input.context) return input.unscopedNativeConversationId;
|
|
21326
|
+
const nativeId = input.context.nativeConversationId;
|
|
21327
|
+
if (input.context.runtimeWorkspaceFingerprint && input.context.runtimeWorkspaceFingerprint !== buildRuntimeWorkspaceFingerprint(input.workingDirectory)) throw new Error("execution_context.workspace_changed");
|
|
21328
|
+
if (nativeId && input.existingNativeConversationId && nativeId !== input.existingNativeConversationId) throw new Error("execution_context.native_identity_mismatch");
|
|
21329
|
+
if (nativeId || input.existingNativeConversationId) return nativeId ?? input.existingNativeConversationId;
|
|
21330
|
+
const source = input.context.forkSource;
|
|
21331
|
+
if (!source) return null;
|
|
21332
|
+
const sourceWorkspace = source.workspace === "isolated" ? await readExecutionContextWorkspace({
|
|
21333
|
+
ledgerRootPath: input.ledgerRootPath,
|
|
21334
|
+
contextId: source.contextId
|
|
21335
|
+
}) : null;
|
|
21336
|
+
const sourceDirectory = sourceWorkspace?.workingDirectory ?? await realpath(source.workspace === "current" ? input.currentWorkingDirectory : sourceWorkspace?.workingDirectory ?? join(input.ledgerRootPath, "execution-context-workspaces", source.contextId));
|
|
21337
|
+
if (buildRuntimeWorkspaceFingerprint(sourceDirectory) !== source.runtimeWorkspaceFingerprint) throw new Error("execution_context.fork_source_workspace_changed");
|
|
21338
|
+
const result = await runAgentSessionForkOperation({
|
|
21339
|
+
ledgerRootPath: input.ledgerRootPath,
|
|
21340
|
+
request: {
|
|
21341
|
+
kind: "execution_context",
|
|
21342
|
+
operationId: input.context.id,
|
|
21343
|
+
sourceNativeSessionId: source.nativeConversationId,
|
|
21344
|
+
completedHistoryId: source.completedHistoryId,
|
|
21345
|
+
workingDirectory: input.workingDirectory
|
|
21346
|
+
},
|
|
21347
|
+
execute: async () => {
|
|
21348
|
+
if (input.agentControllerRef === "builtin:claude-code") {
|
|
21349
|
+
if (!(await readBoundedClaudeHistory(source.nativeConversationId)).find((message) => message.uuid === source.completedHistoryId && isCompletedAssistantMessage(message))) throw new Error("execution_context.fork_checkpoint_unavailable");
|
|
21350
|
+
return { childNativeSessionId: (await forkSession(source.nativeConversationId, { upToMessageId: source.completedHistoryId })).sessionId };
|
|
21351
|
+
}
|
|
21352
|
+
if (input.agentControllerRef === "builtin:codex" && input.launchContract) return { childNativeSessionId: (await forkCodexAppServerThread({
|
|
21353
|
+
computerFileAccessBoundary: input.computerFileAccessBoundary ?? void 0,
|
|
21354
|
+
codexTimeoutMs: 3e4,
|
|
21355
|
+
codexWorkdir: sourceDirectory,
|
|
21356
|
+
launchContract: input.launchContract,
|
|
21357
|
+
sourceThreadId: source.nativeConversationId,
|
|
21358
|
+
sourceCompletedTurnId: source.completedHistoryId,
|
|
21359
|
+
targetWorkingDirectory: input.workingDirectory,
|
|
21360
|
+
onRuntimeEvent: input.onRuntimeEvent,
|
|
21361
|
+
env: { OPENMELD_PROCESS_SUPERVISION_ID: input.processSupervisionId }
|
|
21362
|
+
})).threadId };
|
|
21363
|
+
throw new Error("execution_context.fork_unsupported");
|
|
21364
|
+
}
|
|
21365
|
+
});
|
|
21366
|
+
if (result.status !== "completed") throw new Error(`${result.reasonCode}: ${result.message}`);
|
|
21367
|
+
return result.childNativeSessionId;
|
|
21368
|
+
}
|
|
21369
|
+
async function captureExecutionContextCompletion(input) {
|
|
21370
|
+
if (!(input.context && input.nativeConversationId)) return;
|
|
21371
|
+
const completion = {
|
|
21372
|
+
contextId: input.context.id,
|
|
21373
|
+
nativeConversationId: input.nativeConversationId,
|
|
21374
|
+
runtimeWorkspaceFingerprint: buildRuntimeWorkspaceFingerprint(input.workingDirectory)
|
|
21375
|
+
};
|
|
21376
|
+
if (!input.providerSucceeded) return completion;
|
|
21377
|
+
if (input.agentControllerRef === "builtin:codex") return {
|
|
21378
|
+
...completion,
|
|
21379
|
+
...input.completedTurnId ? { completedHistoryId: input.completedTurnId } : {}
|
|
21380
|
+
};
|
|
21381
|
+
if (input.agentControllerRef === "builtin:claude-code") try {
|
|
21382
|
+
const completed = (await readBoundedClaudeHistory(input.nativeConversationId)).findLast(isCompletedAssistantMessage);
|
|
21383
|
+
if (completed) return {
|
|
21384
|
+
...completion,
|
|
21385
|
+
completedHistoryId: completed.uuid
|
|
21386
|
+
};
|
|
21387
|
+
} catch {
|
|
21388
|
+
console.warn("[execution_context.checkpoint_unavailable]", { contextId: input.context.id });
|
|
21389
|
+
}
|
|
21390
|
+
return completion;
|
|
21391
|
+
}
|
|
21392
|
+
async function readBoundedClaudeHistory(sessionId) {
|
|
21393
|
+
const info = await getSessionInfo(sessionId);
|
|
21394
|
+
if (!info || info.fileSize === void 0 || info.fileSize > 8 * 1024 * 1024) throw new Error("execution_context.history_unavailable_or_too_large");
|
|
21395
|
+
return await getSessionMessages(sessionId);
|
|
21396
|
+
}
|
|
21397
|
+
function isCompletedAssistantMessage(value) {
|
|
21398
|
+
return value.type === "assistant" && typeof value.message === "object" && value.message !== null && "stop_reason" in value.message && value.message.stop_reason === "end_turn";
|
|
21399
|
+
}
|
|
21400
|
+
//#endregion
|
|
20625
21401
|
//#region src/local-service/dispatch/prompt-trace.ts
|
|
20626
21402
|
const OMITTED_ORGANIZATION_POLICY = "[organization-protected information policy omitted]";
|
|
20627
21403
|
function buildDispatchPromptTrace(input) {
|
|
@@ -20861,6 +21637,7 @@ function enqueueDispatchDeliverFrame(input) {
|
|
|
20861
21637
|
presenter: input.presenter
|
|
20862
21638
|
});
|
|
20863
21639
|
const enqueueResult = input.localExecutionSlots.request({
|
|
21640
|
+
resourceScope: executionContextResourceScope(deliverRequest.payload.executionContext),
|
|
20864
21641
|
adapterId: queueLogMeta.adapterId,
|
|
20865
21642
|
attemptId: correlation.attemptId,
|
|
20866
21643
|
controllerKey: queueLogMeta.controllerKey,
|
|
@@ -21430,6 +22207,15 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21430
22207
|
let runtimeOpenClawBinding;
|
|
21431
22208
|
let agentControllerConversationOverride = null;
|
|
21432
22209
|
let dispatchSpaceActionContext = null;
|
|
22210
|
+
let nativeQuiescence;
|
|
22211
|
+
let workspaceUse = null;
|
|
22212
|
+
const workspaceProcesses = /* @__PURE__ */ new Map();
|
|
22213
|
+
const observeWorkspaceProcess = (event) => observeExecutionContextWorkspaceProcess(workspaceProcesses, event);
|
|
22214
|
+
let completedTurnId = null;
|
|
22215
|
+
let completedTurnConversationId = null;
|
|
22216
|
+
let completedNativeResult = null;
|
|
22217
|
+
let executionContextCompletion;
|
|
22218
|
+
const invalidStateStrategy = executionContextLedgerPolicy(parsedTask.executionContext);
|
|
21433
22219
|
try {
|
|
21434
22220
|
dispatchRuntimeContext = await resolveDispatchWorkingFolderRuntimeContext({
|
|
21435
22221
|
controllerSnapshot: input.deliverRequest.payload.controllerSnapshot,
|
|
@@ -21459,6 +22245,20 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21459
22245
|
targetProfileId: parsedTask.targetProfileId
|
|
21460
22246
|
});
|
|
21461
22247
|
effectiveRuntimeContext = runtimePreparation.effectiveRuntimeContext;
|
|
22248
|
+
const originalWorkingDirectory = effectiveRuntimeContext.providerRuntimeWorkingDirectory;
|
|
22249
|
+
await verifyDispatchLegacyContextAssociation({
|
|
22250
|
+
parsedTask,
|
|
22251
|
+
ledgerPaths: input.ledgerPaths,
|
|
22252
|
+
originalWorkingDirectory
|
|
22253
|
+
});
|
|
22254
|
+
const taskWorkspace = await prepareDispatchTaskWorkspace({
|
|
22255
|
+
parsedTask,
|
|
22256
|
+
ledgerRootPath: input.ledgerPaths.rootDirPath,
|
|
22257
|
+
currentWorkingDirectory: originalWorkingDirectory,
|
|
22258
|
+
computerFileAccessStorePath: input.computerFileAccessStorePath
|
|
22259
|
+
});
|
|
22260
|
+
effectiveRuntimeContext = { providerRuntimeWorkingDirectory: taskWorkspace.workingDirectory };
|
|
22261
|
+
runtimePreparation.effectiveRuntimeContext = effectiveRuntimeContext;
|
|
21462
22262
|
computerFileAccessBoundary = await resolveDispatchComputerFileAccess({
|
|
21463
22263
|
computerFileAccessStorePath: input.computerFileAccessStorePath,
|
|
21464
22264
|
onInteractionRequest,
|
|
@@ -21466,7 +22266,8 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21466
22266
|
presenter: input.presenter,
|
|
21467
22267
|
routeConfig,
|
|
21468
22268
|
runtimeControllerSupport,
|
|
21469
|
-
runtimePreparation
|
|
22269
|
+
runtimePreparation,
|
|
22270
|
+
taskWorkspace
|
|
21470
22271
|
});
|
|
21471
22272
|
const [sendTargetReference, imageAttachmentPreparation] = await Promise.all([bootstrapContext.sendTargetReferencePromise, materializeDispatchImageAttachments({
|
|
21472
22273
|
agentControllerRef: parsedTask.agentControllerRef,
|
|
@@ -21520,6 +22321,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21520
22321
|
contextStore: input.contextStore,
|
|
21521
22322
|
ledgerPaths: input.ledgerPaths,
|
|
21522
22323
|
parsedTask,
|
|
22324
|
+
originalWorkingDirectory,
|
|
21523
22325
|
runtimeWorkspaceFingerprint: buildRuntimeWorkspaceFingerprint(activeRuntimeContext.providerRuntimeWorkingDirectory)
|
|
21524
22326
|
});
|
|
21525
22327
|
contextLookupKey = dispatchLedgerContext.contextLookupKey;
|
|
@@ -21529,6 +22331,27 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21529
22331
|
agentControllerConversationId: parsedTask.agentControllerConversationId,
|
|
21530
22332
|
existingContextId
|
|
21531
22333
|
});
|
|
22334
|
+
workspaceUse = await markExecutionContextWorkspaceInUse({
|
|
22335
|
+
context: parsedTask.executionContext,
|
|
22336
|
+
ledgerRootPath: input.ledgerPaths.rootDirPath
|
|
22337
|
+
});
|
|
22338
|
+
runtimeEnvOverrides = {
|
|
22339
|
+
...runtimeEnvOverrides,
|
|
22340
|
+
OPENMELD_PROCESS_SUPERVISION_ID: workspaceUse?.processSupervisionId
|
|
22341
|
+
};
|
|
22342
|
+
effectiveAgentControllerConversationId = await prepareExecutionContextConversation({
|
|
22343
|
+
computerFileAccessBoundary,
|
|
22344
|
+
unscopedNativeConversationId: effectiveAgentControllerConversationId,
|
|
22345
|
+
context: parsedTask.executionContext,
|
|
22346
|
+
currentWorkingDirectory: originalWorkingDirectory,
|
|
22347
|
+
workingDirectory: activeRuntimeContext.providerRuntimeWorkingDirectory,
|
|
22348
|
+
existingNativeConversationId: existingContextId,
|
|
22349
|
+
ledgerRootPath: input.ledgerPaths.rootDirPath,
|
|
22350
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22351
|
+
launchContract: routeConfig?.launchContract,
|
|
22352
|
+
onRuntimeEvent: observeWorkspaceProcess,
|
|
22353
|
+
processSupervisionId: workspaceUse?.processSupervisionId
|
|
22354
|
+
});
|
|
21532
22355
|
latestScopedExecutionState = dispatchLedgerContext.latestScopedExecutionState;
|
|
21533
22356
|
ledgerIo = dispatchLedgerContext.ledgerIo;
|
|
21534
22357
|
input.inflightDispatchMetaByTaskId.set(parsedTask.taskId, { agentContextLookupKey: contextLookupKey });
|
|
@@ -21586,7 +22409,8 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21586
22409
|
profileOwnerName: input.profileOwnerName,
|
|
21587
22410
|
profileOwnerUserId: input.profileOwnerUserId,
|
|
21588
22411
|
sendTargetReference,
|
|
21589
|
-
shouldInjectBootstrap: bootstrapPlan.shouldInject
|
|
22412
|
+
shouldInjectBootstrap: bootstrapPlan.shouldInject,
|
|
22413
|
+
taskWorkspace
|
|
21590
22414
|
}), skillPreflight);
|
|
21591
22415
|
runtimePromptPlan = computerFileAccessBoundary ? applyComputerFileAccessAwareness({
|
|
21592
22416
|
policy: computerFileAccessBoundary,
|
|
@@ -21735,7 +22559,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21735
22559
|
});
|
|
21736
22560
|
}
|
|
21737
22561
|
withLedgerStateTransaction({
|
|
21738
|
-
invalidStateStrategy
|
|
22562
|
+
invalidStateStrategy,
|
|
21739
22563
|
io: providerConversationLedgerIo,
|
|
21740
22564
|
mutate: (state) => ({
|
|
21741
22565
|
nextState: commitResolvedAgentContext({
|
|
@@ -21784,6 +22608,8 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21784
22608
|
};
|
|
21785
22609
|
const syncProviderTurnAcceptedLifecycle = (event) => {
|
|
21786
22610
|
if (event.phase !== "provider_turn_accepted") return;
|
|
22611
|
+
completedTurnId = event.turnId;
|
|
22612
|
+
completedTurnConversationId = event.agentControllerConversationId;
|
|
21787
22613
|
if (providerAdmissionOwnsRunningLifecycle && runtimeLifecyclePhase !== "running") transitionDispatchLifecycle({ phase: "running" });
|
|
21788
22614
|
emitDispatchLocalPhaseJournalEvent({
|
|
21789
22615
|
deliverRequest: input.deliverRequest,
|
|
@@ -21796,6 +22622,129 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21796
22622
|
result: "accepted"
|
|
21797
22623
|
});
|
|
21798
22624
|
};
|
|
22625
|
+
const onNativeTurnStarted = () => {
|
|
22626
|
+
completedTurnId = null;
|
|
22627
|
+
completedTurnConversationId = null;
|
|
22628
|
+
executionContextCompletion = void 0;
|
|
22629
|
+
completedNativeResult = null;
|
|
22630
|
+
};
|
|
22631
|
+
const onNativeTurnCompleted = (result) => {
|
|
22632
|
+
completedNativeResult = result;
|
|
22633
|
+
};
|
|
22634
|
+
const onRuntimeEvent = routeReasoningEvents(observeReasoning, (event) => {
|
|
22635
|
+
observeWorkspaceProcess(event);
|
|
22636
|
+
syncAgentControllerConversationOccupancyLifecycle(event);
|
|
22637
|
+
syncProviderTurnAcceptedLifecycle(event);
|
|
22638
|
+
if (event.phase === "tool_activity") {
|
|
22639
|
+
agentToolActivitySequence += 1;
|
|
22640
|
+
emitDispatchAgentToolActivityFrame({
|
|
22641
|
+
currentSocketRef,
|
|
22642
|
+
daemonSessionId: input.daemonSessionId,
|
|
22643
|
+
deliverRequest: input.deliverRequest,
|
|
22644
|
+
event,
|
|
22645
|
+
parsedTask,
|
|
22646
|
+
presenter: input.presenter,
|
|
22647
|
+
sequence: agentToolActivitySequence
|
|
22648
|
+
});
|
|
22649
|
+
}
|
|
22650
|
+
if (event.phase === "provider_conversation_observed") recordProviderConversationObservation({
|
|
22651
|
+
agentControllerConversation: event.agentControllerConversation ?? null,
|
|
22652
|
+
agentControllerConversationId: event.agentControllerConversationId,
|
|
22653
|
+
source: "runtime_event"
|
|
22654
|
+
});
|
|
22655
|
+
if (event.phase === "provider_usage_limits_observed" && routeConfig?.launchContract) {
|
|
22656
|
+
const agentId = runtimeControllerSupport.runtimeAdapterMatch.adapterId;
|
|
22657
|
+
const launchContract = routeConfig.launchContract;
|
|
22658
|
+
usageObservationAuthPromise ??= probeAgentControllerUsageObservationAuth({
|
|
22659
|
+
agentId,
|
|
22660
|
+
launchContract
|
|
22661
|
+
});
|
|
22662
|
+
usageObservationAuthPromise.then((authSnapshot) => recordRuntimeProviderUsageLimits({
|
|
22663
|
+
agentId,
|
|
22664
|
+
authSnapshot,
|
|
22665
|
+
launchContract,
|
|
22666
|
+
usageLimits: event.usageLimits
|
|
22667
|
+
})).then((retained) => {
|
|
22668
|
+
if (retained) return;
|
|
22669
|
+
emitRunLine({
|
|
22670
|
+
presenter: input.presenter,
|
|
22671
|
+
code: "daemon.run.provider_usage_limits_observation_ignored",
|
|
22672
|
+
text: `provider usage limit observation could not be retained for task ${parsedTask.taskId}`,
|
|
22673
|
+
payload: {
|
|
22674
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22675
|
+
dispatchId: parsedTask.dispatchId,
|
|
22676
|
+
observedLimitKeys: event.usageLimits.map((limit) => limit.key),
|
|
22677
|
+
reasonCode: "provider_account_unconfirmed",
|
|
22678
|
+
targetProfileId: parsedTask.targetProfileId,
|
|
22679
|
+
taskId: parsedTask.taskId
|
|
22680
|
+
}
|
|
22681
|
+
});
|
|
22682
|
+
}).catch((error) => {
|
|
22683
|
+
emitRunLine({
|
|
22684
|
+
presenter: input.presenter,
|
|
22685
|
+
code: "daemon.run.provider_usage_limits_observation_ignored",
|
|
22686
|
+
text: `provider usage limit observation could not be retained for task ${parsedTask.taskId}`,
|
|
22687
|
+
payload: {
|
|
22688
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22689
|
+
dispatchId: parsedTask.dispatchId,
|
|
22690
|
+
errorMessage: toErrorMessage$10(error),
|
|
22691
|
+
observedLimitKeys: event.usageLimits.map((limit) => limit.key),
|
|
22692
|
+
targetProfileId: parsedTask.targetProfileId,
|
|
22693
|
+
taskId: parsedTask.taskId
|
|
22694
|
+
}
|
|
22695
|
+
});
|
|
22696
|
+
});
|
|
22697
|
+
}
|
|
22698
|
+
if (!firstOutputEvidenceSent && (event.phase === "first_stdout" || event.phase === "first_stderr")) {
|
|
22699
|
+
firstOutputEvidenceSent = true;
|
|
22700
|
+
emitDispatchRuntimeEvidenceTransition({
|
|
22701
|
+
currentSocketRef,
|
|
22702
|
+
daemonSessionId: input.daemonSessionId,
|
|
22703
|
+
deliverRequest: input.deliverRequest,
|
|
22704
|
+
durationMs: Math.max(0, event.tsMs - runtimeStartedAtMs),
|
|
22705
|
+
parsedTask,
|
|
22706
|
+
phase: "first_output",
|
|
22707
|
+
presenter: input.presenter
|
|
22708
|
+
});
|
|
22709
|
+
}
|
|
22710
|
+
const controlRegistrySyncResult = syncRuntimeEventToInflightTaskControlRegistry({
|
|
22711
|
+
event,
|
|
22712
|
+
registry: input.inflightTaskControlRegistry,
|
|
22713
|
+
taskId: parsedTask.taskId
|
|
22714
|
+
});
|
|
22715
|
+
if (controlRegistrySyncResult.updated) emitRunLine({
|
|
22716
|
+
presenter: input.presenter,
|
|
22717
|
+
code: "daemon.run.control_registry_synced",
|
|
22718
|
+
text: `control registry synced for task ${parsedTask.taskId}`,
|
|
22719
|
+
payload: {
|
|
22720
|
+
dispatchId: parsedTask.dispatchId,
|
|
22721
|
+
phase: event.phase,
|
|
22722
|
+
processId: controlRegistrySyncResult.processId,
|
|
22723
|
+
targetProfileId: parsedTask.targetProfileId,
|
|
22724
|
+
taskId: parsedTask.taskId
|
|
22725
|
+
}
|
|
22726
|
+
});
|
|
22727
|
+
if (event.phase === "process_spawned" || event.phase === "process_exit") emitDispatchLocalPhaseJournalEvent({
|
|
22728
|
+
deliverRequest: input.deliverRequest,
|
|
22729
|
+
metadata: buildProviderProcessJournalMetadata({
|
|
22730
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22731
|
+
event,
|
|
22732
|
+
runtimeStartedAtMs
|
|
22733
|
+
}),
|
|
22734
|
+
parsedTask,
|
|
22735
|
+
phase: event.phase,
|
|
22736
|
+
result: event.phase === "process_exit" ? "exited" : "spawned"
|
|
22737
|
+
});
|
|
22738
|
+
emitProviderRuntimePhaseLine({
|
|
22739
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22740
|
+
dispatchId: parsedTask.dispatchId,
|
|
22741
|
+
event,
|
|
22742
|
+
presenter: input.presenter,
|
|
22743
|
+
runtimeStartedAtMs,
|
|
22744
|
+
targetProfileId: parsedTask.targetProfileId,
|
|
22745
|
+
taskId: parsedTask.taskId
|
|
22746
|
+
});
|
|
22747
|
+
});
|
|
21799
22748
|
clearReasoning();
|
|
21800
22749
|
const runtimeExecutionPromise = Promise.resolve(runDispatchRuntimeExecution({
|
|
21801
22750
|
computerFileAccessBoundary,
|
|
@@ -21804,6 +22753,9 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21804
22753
|
io: ledgerIo,
|
|
21805
22754
|
ledgerPaths: input.ledgerPaths,
|
|
21806
22755
|
onInteractionRequest,
|
|
22756
|
+
onNativeTurnStarted,
|
|
22757
|
+
onNativeTurnCompleted,
|
|
22758
|
+
onRuntimeEvent,
|
|
21807
22759
|
onPreview: (preview) => {
|
|
21808
22760
|
emitDispatchPreviewFrame({
|
|
21809
22761
|
attemptId: parsedTask.attemptId,
|
|
@@ -21817,119 +22769,6 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21817
22769
|
taskId: parsedTask.taskId
|
|
21818
22770
|
});
|
|
21819
22771
|
},
|
|
21820
|
-
onRuntimeEvent: routeReasoningEvents(observeReasoning, (event) => {
|
|
21821
|
-
syncAgentControllerConversationOccupancyLifecycle(event);
|
|
21822
|
-
syncProviderTurnAcceptedLifecycle(event);
|
|
21823
|
-
if (event.phase === "tool_activity") {
|
|
21824
|
-
agentToolActivitySequence += 1;
|
|
21825
|
-
emitDispatchAgentToolActivityFrame({
|
|
21826
|
-
currentSocketRef,
|
|
21827
|
-
daemonSessionId: input.daemonSessionId,
|
|
21828
|
-
deliverRequest: input.deliverRequest,
|
|
21829
|
-
event,
|
|
21830
|
-
parsedTask,
|
|
21831
|
-
presenter: input.presenter,
|
|
21832
|
-
sequence: agentToolActivitySequence
|
|
21833
|
-
});
|
|
21834
|
-
}
|
|
21835
|
-
if (event.phase === "provider_conversation_observed") recordProviderConversationObservation({
|
|
21836
|
-
agentControllerConversation: event.agentControllerConversation ?? null,
|
|
21837
|
-
agentControllerConversationId: event.agentControllerConversationId,
|
|
21838
|
-
source: "runtime_event"
|
|
21839
|
-
});
|
|
21840
|
-
if (event.phase === "provider_usage_limits_observed" && routeConfig?.launchContract) {
|
|
21841
|
-
const agentId = runtimeControllerSupport.runtimeAdapterMatch.adapterId;
|
|
21842
|
-
const launchContract = routeConfig.launchContract;
|
|
21843
|
-
usageObservationAuthPromise ??= probeAgentControllerUsageObservationAuth({
|
|
21844
|
-
agentId,
|
|
21845
|
-
launchContract
|
|
21846
|
-
});
|
|
21847
|
-
usageObservationAuthPromise.then((authSnapshot) => recordRuntimeProviderUsageLimits({
|
|
21848
|
-
agentId,
|
|
21849
|
-
authSnapshot,
|
|
21850
|
-
launchContract,
|
|
21851
|
-
usageLimits: event.usageLimits
|
|
21852
|
-
})).then((retained) => {
|
|
21853
|
-
if (retained) return;
|
|
21854
|
-
emitRunLine({
|
|
21855
|
-
presenter: input.presenter,
|
|
21856
|
-
code: "daemon.run.provider_usage_limits_observation_ignored",
|
|
21857
|
-
text: `provider usage limit observation could not be retained for task ${parsedTask.taskId}`,
|
|
21858
|
-
payload: {
|
|
21859
|
-
agentControllerRef: parsedTask.agentControllerRef,
|
|
21860
|
-
dispatchId: parsedTask.dispatchId,
|
|
21861
|
-
observedLimitKeys: event.usageLimits.map((limit) => limit.key),
|
|
21862
|
-
reasonCode: "provider_account_unconfirmed",
|
|
21863
|
-
targetProfileId: parsedTask.targetProfileId,
|
|
21864
|
-
taskId: parsedTask.taskId
|
|
21865
|
-
}
|
|
21866
|
-
});
|
|
21867
|
-
}).catch((error) => {
|
|
21868
|
-
emitRunLine({
|
|
21869
|
-
presenter: input.presenter,
|
|
21870
|
-
code: "daemon.run.provider_usage_limits_observation_ignored",
|
|
21871
|
-
text: `provider usage limit observation could not be retained for task ${parsedTask.taskId}`,
|
|
21872
|
-
payload: {
|
|
21873
|
-
agentControllerRef: parsedTask.agentControllerRef,
|
|
21874
|
-
dispatchId: parsedTask.dispatchId,
|
|
21875
|
-
errorMessage: toErrorMessage$10(error),
|
|
21876
|
-
observedLimitKeys: event.usageLimits.map((limit) => limit.key),
|
|
21877
|
-
targetProfileId: parsedTask.targetProfileId,
|
|
21878
|
-
taskId: parsedTask.taskId
|
|
21879
|
-
}
|
|
21880
|
-
});
|
|
21881
|
-
});
|
|
21882
|
-
}
|
|
21883
|
-
if (!firstOutputEvidenceSent && (event.phase === "first_stdout" || event.phase === "first_stderr")) {
|
|
21884
|
-
firstOutputEvidenceSent = true;
|
|
21885
|
-
emitDispatchRuntimeEvidenceTransition({
|
|
21886
|
-
currentSocketRef,
|
|
21887
|
-
daemonSessionId: input.daemonSessionId,
|
|
21888
|
-
deliverRequest: input.deliverRequest,
|
|
21889
|
-
durationMs: Math.max(0, event.tsMs - runtimeStartedAtMs),
|
|
21890
|
-
parsedTask,
|
|
21891
|
-
phase: "first_output",
|
|
21892
|
-
presenter: input.presenter
|
|
21893
|
-
});
|
|
21894
|
-
}
|
|
21895
|
-
const controlRegistrySyncResult = syncRuntimeEventToInflightTaskControlRegistry({
|
|
21896
|
-
event,
|
|
21897
|
-
registry: input.inflightTaskControlRegistry,
|
|
21898
|
-
taskId: parsedTask.taskId
|
|
21899
|
-
});
|
|
21900
|
-
if (controlRegistrySyncResult.updated) emitRunLine({
|
|
21901
|
-
presenter: input.presenter,
|
|
21902
|
-
code: "daemon.run.control_registry_synced",
|
|
21903
|
-
text: `control registry synced for task ${parsedTask.taskId}`,
|
|
21904
|
-
payload: {
|
|
21905
|
-
dispatchId: parsedTask.dispatchId,
|
|
21906
|
-
phase: event.phase,
|
|
21907
|
-
processId: controlRegistrySyncResult.processId,
|
|
21908
|
-
targetProfileId: parsedTask.targetProfileId,
|
|
21909
|
-
taskId: parsedTask.taskId
|
|
21910
|
-
}
|
|
21911
|
-
});
|
|
21912
|
-
if (event.phase === "process_spawned" || event.phase === "process_exit") emitDispatchLocalPhaseJournalEvent({
|
|
21913
|
-
deliverRequest: input.deliverRequest,
|
|
21914
|
-
metadata: buildProviderProcessJournalMetadata({
|
|
21915
|
-
agentControllerRef: parsedTask.agentControllerRef,
|
|
21916
|
-
event,
|
|
21917
|
-
runtimeStartedAtMs
|
|
21918
|
-
}),
|
|
21919
|
-
parsedTask,
|
|
21920
|
-
phase: event.phase,
|
|
21921
|
-
result: event.phase === "process_exit" ? "exited" : "spawned"
|
|
21922
|
-
});
|
|
21923
|
-
emitProviderRuntimePhaseLine({
|
|
21924
|
-
agentControllerRef: parsedTask.agentControllerRef,
|
|
21925
|
-
dispatchId: parsedTask.dispatchId,
|
|
21926
|
-
event,
|
|
21927
|
-
presenter: input.presenter,
|
|
21928
|
-
runtimeStartedAtMs,
|
|
21929
|
-
targetProfileId: parsedTask.targetProfileId,
|
|
21930
|
-
taskId: parsedTask.taskId
|
|
21931
|
-
});
|
|
21932
|
-
}),
|
|
21933
22772
|
parsedTask,
|
|
21934
22773
|
instructionPrompt: runtimePromptPlan,
|
|
21935
22774
|
prompt: runtimePromptPlan.fallbackPrompt,
|
|
@@ -21940,6 +22779,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21940
22779
|
agentControllerConversationOverride
|
|
21941
22780
|
}));
|
|
21942
22781
|
const controllerTurnCompletion = runtimeExecutionPromise.then(() => void 0, () => void 0);
|
|
22782
|
+
nativeQuiescence = controllerTurnCompletion;
|
|
21943
22783
|
let runtimeResult = await resolveRuntimeResultFromRuntimeOrCliSpaceAction({
|
|
21944
22784
|
contextIdForDispatch,
|
|
21945
22785
|
dispatchSpaceActionContext,
|
|
@@ -21960,6 +22800,10 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21960
22800
|
runtimeExecutionPromise
|
|
21961
22801
|
});
|
|
21962
22802
|
const structuredSpaceActionOutcome = await resolveRuntimeResultStructuredSpaceAction({
|
|
22803
|
+
onInteractionRequest,
|
|
22804
|
+
onNativeTurnStarted,
|
|
22805
|
+
onNativeTurnCompleted,
|
|
22806
|
+
onRuntimeEvent,
|
|
21963
22807
|
computerFileAccessBoundary,
|
|
21964
22808
|
controllerTurnCompletion,
|
|
21965
22809
|
inflightTaskControlRegistry: input.inflightTaskControlRegistry,
|
|
@@ -21999,7 +22843,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
21999
22843
|
resolvedContextId: normalizeOptionalContextId(runtimeResult.contextResolution?.agentControllerConversationId ?? contextDelta?.agentControllerConversationId ?? null) ?? null
|
|
22000
22844
|
});
|
|
22001
22845
|
await withLedgerStateTransaction({
|
|
22002
|
-
invalidStateStrategy
|
|
22846
|
+
invalidStateStrategy,
|
|
22003
22847
|
io: ledgerIo,
|
|
22004
22848
|
mutate: (state) => {
|
|
22005
22849
|
let nextState = state;
|
|
@@ -22054,7 +22898,8 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22054
22898
|
runtimePromptPlan
|
|
22055
22899
|
});
|
|
22056
22900
|
const completedAgentControllerConversationOverride = agentControllerConversationOverride ?? null;
|
|
22057
|
-
const buildCurrentResultPayload = () => {
|
|
22901
|
+
const buildCurrentResultPayload = async () => {
|
|
22902
|
+
if (parsedTask.executionContext) await controllerTurnCompletion;
|
|
22058
22903
|
const currentContextDelta = resolveDispatchContextDeltaFromRuntimeResult(runtimeResult.dispatchResult);
|
|
22059
22904
|
const observedAgentControllerConversation = resolveObservedDispatchAgentControllerConversation({
|
|
22060
22905
|
plannedAgentControllerConversation,
|
|
@@ -22062,6 +22907,16 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22062
22907
|
contextResolution: runtimeResult.contextResolution ?? null,
|
|
22063
22908
|
agentControllerConversationOverride: completedAgentControllerConversationOverride
|
|
22064
22909
|
});
|
|
22910
|
+
const finalNativeResult = completedNativeResult;
|
|
22911
|
+
const nativeConversationId = (finalNativeResult ? resolveDispatchContextDeltaFromRuntimeResult(finalNativeResult.dispatchResult)?.agentControllerConversationId : null) ?? finalNativeResult?.contextResolution?.agentControllerConversationId ?? currentContextDelta?.agentControllerConversationId ?? runtimeResult.contextResolution?.agentControllerConversationId ?? observedAgentControllerConversation?.agentControllerConversationId ?? observedProviderConversationId;
|
|
22912
|
+
executionContextCompletion = await captureExecutionContextCompletion({
|
|
22913
|
+
context: parsedTask.executionContext,
|
|
22914
|
+
nativeConversationId,
|
|
22915
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22916
|
+
workingDirectory: activeRuntimeContext.providerRuntimeWorkingDirectory,
|
|
22917
|
+
completedTurnId: completedTurnConversationId === nativeConversationId ? completedTurnId : null,
|
|
22918
|
+
providerSucceeded: finalNativeResult?.resultPayload.status === "success" || finalNativeResult?.resultPayload.status === "partial_success"
|
|
22919
|
+
});
|
|
22065
22920
|
dispatchExecution = buildDispatchExecution({
|
|
22066
22921
|
bootstrapPlan: completedBootstrapPlan,
|
|
22067
22922
|
agentControllerConversationId: effectiveAgentControllerConversationId,
|
|
@@ -22069,32 +22924,40 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22069
22924
|
observedAgentControllerConversation,
|
|
22070
22925
|
plannedAgentControllerConversation
|
|
22071
22926
|
});
|
|
22072
|
-
return
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22076
|
-
|
|
22077
|
-
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
|
|
22081
|
-
|
|
22082
|
-
|
|
22083
|
-
|
|
22084
|
-
|
|
22085
|
-
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
|
|
22091
|
-
|
|
22927
|
+
return {
|
|
22928
|
+
...resolveDispatchResultPayload({
|
|
22929
|
+
attemptId: parsedTask.attemptId,
|
|
22930
|
+
contextDelta: currentContextDelta,
|
|
22931
|
+
contextResolution: runtimeResult.contextResolution ?? null,
|
|
22932
|
+
basePayload: runtimeResult.resultPayload,
|
|
22933
|
+
bootstrapTemplateFacts: bootstrapContext.bootstrapTemplateFacts,
|
|
22934
|
+
agentControllerRef: parsedTask.agentControllerRef,
|
|
22935
|
+
dispatchExecution,
|
|
22936
|
+
existingContextId: contextIdForDispatch,
|
|
22937
|
+
openClawBinding: runtimeOpenClawBinding,
|
|
22938
|
+
openClawGatewayVisibility: runtimeOpenClawGatewayVisibility,
|
|
22939
|
+
promptTrace: runtimePromptTrace,
|
|
22940
|
+
agentControllerConversationForDispatch: observedAgentControllerConversation ?? plannedAgentControllerConversation,
|
|
22941
|
+
workingDirectory: activeRuntimeContext.providerRuntimeWorkingDirectory,
|
|
22942
|
+
spaceAction: resolvedSpaceAction,
|
|
22943
|
+
spaceActionProvenance: resolvedSpaceActionProvenance,
|
|
22944
|
+
sourceEventId: parsedTask.sourceEventId,
|
|
22945
|
+
targetProfileId: parsedTask.targetProfileId,
|
|
22946
|
+
taskId: parsedTask.taskId
|
|
22947
|
+
}),
|
|
22948
|
+
executionContextId: parsedTask.executionContext?.id,
|
|
22949
|
+
executionContextCompletion
|
|
22950
|
+
};
|
|
22092
22951
|
};
|
|
22093
|
-
resultPayload = buildCurrentResultPayload();
|
|
22952
|
+
resultPayload = await buildCurrentResultPayload();
|
|
22094
22953
|
const replySettlement = await settleAgentReplyProposals({
|
|
22095
22954
|
initialResultPayload: resultPayload,
|
|
22096
22955
|
reconsider: async (agentReplyObservationCursor) => {
|
|
22097
22956
|
const reconsidered = await resolveRuntimeResultStructuredSpaceAction({
|
|
22957
|
+
onInteractionRequest,
|
|
22958
|
+
onNativeTurnStarted,
|
|
22959
|
+
onNativeTurnCompleted,
|
|
22960
|
+
onRuntimeEvent,
|
|
22098
22961
|
agentReplyObservationCursor,
|
|
22099
22962
|
computerFileAccessBoundary,
|
|
22100
22963
|
controllerTurnCompletion,
|
|
@@ -22119,7 +22982,7 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22119
22982
|
runtimeResult = reconsidered.runtimeResult;
|
|
22120
22983
|
resolvedSpaceAction = reconsidered.resolvedSpaceAction;
|
|
22121
22984
|
resolvedSpaceActionProvenance = reconsidered.resolvedSpaceActionProvenance;
|
|
22122
|
-
return buildCurrentResultPayload();
|
|
22985
|
+
return await buildCurrentResultPayload();
|
|
22123
22986
|
},
|
|
22124
22987
|
submit: (payload) => sendResultAndSummarize({
|
|
22125
22988
|
attemptId: parsedTask.attemptId,
|
|
@@ -22217,6 +23080,14 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22217
23080
|
}
|
|
22218
23081
|
});
|
|
22219
23082
|
} finally {
|
|
23083
|
+
await nativeQuiescence;
|
|
23084
|
+
await releaseDispatchTaskWorkspace({
|
|
23085
|
+
workspaceUse,
|
|
23086
|
+
parsedTask,
|
|
23087
|
+
ledgerRootPath: input.ledgerPaths.rootDirPath,
|
|
23088
|
+
workspaceProcesses,
|
|
23089
|
+
presenter: input.presenter
|
|
23090
|
+
});
|
|
22220
23091
|
reasoningStream.dispose();
|
|
22221
23092
|
currentSocketRef.reasoningPreferenceListeners?.delete(clearReasoning);
|
|
22222
23093
|
lifecycleKeepalive.stop?.();
|
|
@@ -22225,6 +23096,11 @@ async function handleDispatchDeliverFrame(input) {
|
|
|
22225
23096
|
input.inflightTaskControlRegistry.removeTask(parsedTask.taskId);
|
|
22226
23097
|
pendingAgentInteractionRegistry.removeTask(parsedTask.taskId);
|
|
22227
23098
|
}
|
|
23099
|
+
resultPayload = {
|
|
23100
|
+
...resultPayload,
|
|
23101
|
+
executionContextId: parsedTask.executionContext?.id,
|
|
23102
|
+
executionContextCompletion
|
|
23103
|
+
};
|
|
22228
23104
|
emitDispatchRuntimeEvidenceTransition({
|
|
22229
23105
|
currentSocketRef,
|
|
22230
23106
|
daemonSessionId: input.daemonSessionId,
|
|
@@ -22385,8 +23261,28 @@ async function rollbackBootstrapExecutionStateAfterFailureIfNeeded(input) {
|
|
|
22385
23261
|
paths: input.ledgerPaths
|
|
22386
23262
|
});
|
|
22387
23263
|
}
|
|
23264
|
+
async function verifyDispatchLegacyContextAssociation(input) {
|
|
23265
|
+
const association = input.parsedTask.executionContext?.legacyAssociation;
|
|
23266
|
+
if (!association) return;
|
|
23267
|
+
assertLegacyAgentContextAssociation({
|
|
23268
|
+
state: await loadLedgerState({
|
|
23269
|
+
invalidStateStrategy: "throw",
|
|
23270
|
+
io: createLedgerIo(),
|
|
23271
|
+
paths: input.ledgerPaths
|
|
23272
|
+
}),
|
|
23273
|
+
legacyNativeConversationId: association.nativeConversationId,
|
|
23274
|
+
key: {
|
|
23275
|
+
spaceId: input.parsedTask.spaceId,
|
|
23276
|
+
targetProfileId: input.parsedTask.targetProfileId,
|
|
23277
|
+
agentControllerRef: input.parsedTask.agentControllerRef,
|
|
23278
|
+
transportMode: input.parsedTask.transportMode,
|
|
23279
|
+
runtimeWorkspaceFingerprint: buildRuntimeWorkspaceFingerprint(input.originalWorkingDirectory)
|
|
23280
|
+
}
|
|
23281
|
+
});
|
|
23282
|
+
}
|
|
22388
23283
|
async function loadDispatchLedgerContext(input) {
|
|
22389
23284
|
const keyInput = {
|
|
23285
|
+
executionContextId: input.parsedTask.executionContext?.id,
|
|
22390
23286
|
spaceId: input.parsedTask.spaceId,
|
|
22391
23287
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
22392
23288
|
agentControllerRef: input.parsedTask.agentControllerRef,
|
|
@@ -22397,7 +23293,7 @@ async function loadDispatchLedgerContext(input) {
|
|
|
22397
23293
|
const ledgerIo = createLedgerIo();
|
|
22398
23294
|
const legacyContextId = input.contextStore.get(contextLookupKey) ?? null;
|
|
22399
23295
|
const { currentExecutionState, existingContextId, latestScopedExecutionState } = await withLedgerStateTransaction({
|
|
22400
|
-
invalidStateStrategy:
|
|
23296
|
+
invalidStateStrategy: executionContextLedgerPolicy(input.parsedTask.executionContext),
|
|
22401
23297
|
io: ledgerIo,
|
|
22402
23298
|
mutate: (state) => {
|
|
22403
23299
|
const scopeInput = {
|
|
@@ -22406,6 +23302,14 @@ async function loadDispatchLedgerContext(input) {
|
|
|
22406
23302
|
targetProfileId: input.parsedTask.targetProfileId,
|
|
22407
23303
|
transportMode: input.parsedTask.transportMode
|
|
22408
23304
|
};
|
|
23305
|
+
assertLegacyAgentContextAssociation({
|
|
23306
|
+
state,
|
|
23307
|
+
legacyNativeConversationId: input.parsedTask.executionContext?.legacyAssociation?.nativeConversationId,
|
|
23308
|
+
key: {
|
|
23309
|
+
...scopeInput,
|
|
23310
|
+
runtimeWorkspaceFingerprint: buildRuntimeWorkspaceFingerprint(input.originalWorkingDirectory)
|
|
23311
|
+
}
|
|
23312
|
+
});
|
|
22409
23313
|
const seededLedgerState = resolveCompatibleAgentContextMatch({
|
|
22410
23314
|
key: keyInput,
|
|
22411
23315
|
state
|
|
@@ -22426,16 +23330,17 @@ async function loadDispatchLedgerContext(input) {
|
|
|
22426
23330
|
state: seededLedgerState
|
|
22427
23331
|
});
|
|
22428
23332
|
const existingContextId = nextAgentContextMatch?.agentContext.agentControllerConversationId ?? null;
|
|
23333
|
+
const currentExecutionState = resolveCompatibleConversationExecutionState({
|
|
23334
|
+
key: keyInput,
|
|
23335
|
+
preferredLookupKey: nextAgentContextMatch?.agentContextLookupKey ?? null,
|
|
23336
|
+
state: seededLedgerState
|
|
23337
|
+
});
|
|
22429
23338
|
return {
|
|
22430
23339
|
nextState: seededLedgerState,
|
|
22431
23340
|
value: {
|
|
22432
|
-
currentExecutionState
|
|
22433
|
-
key: keyInput,
|
|
22434
|
-
preferredLookupKey: nextAgentContextMatch?.agentContextLookupKey ?? null,
|
|
22435
|
-
state: seededLedgerState
|
|
22436
|
-
}),
|
|
23341
|
+
currentExecutionState,
|
|
22437
23342
|
existingContextId,
|
|
22438
|
-
latestScopedExecutionState: resolveLatestScopedConversationExecutionState({
|
|
23343
|
+
latestScopedExecutionState: input.parsedTask.executionContext ? currentExecutionState : resolveLatestScopedConversationExecutionState({
|
|
22439
23344
|
scope: scopeInput,
|
|
22440
23345
|
state: seededLedgerState
|
|
22441
23346
|
})?.executionState ?? null
|
|
@@ -22579,7 +23484,12 @@ function buildDispatchRuntimePrompt(input) {
|
|
|
22579
23484
|
profileOwnerUserId: input.profileOwnerUserId,
|
|
22580
23485
|
organizationProtectedInformation: input.parsedTask.organizationProtectedInformation,
|
|
22581
23486
|
workingLanguage: input.parsedTask.workingLanguage,
|
|
22582
|
-
prompt: input.parsedTask.prompt
|
|
23487
|
+
prompt: input.taskWorkspace?.baseCommit ? `${input.parsedTask.prompt}\n\nOpenMeld task workspace: ${JSON.stringify({
|
|
23488
|
+
projectId: input.parsedTask.defaultProjectId,
|
|
23489
|
+
repositoryName: input.taskWorkspace.sourceWorkingDirectory ? basename(input.taskWorkspace.sourceWorkingDirectory) : null,
|
|
23490
|
+
workingDirectory: input.taskWorkspace.workingDirectory,
|
|
23491
|
+
baseCommit: input.taskWorkspace.baseCommit
|
|
23492
|
+
})}\nThis task uses an independent Git worktree with private Git metadata. The starting commit is frozen. Uncommitted and ignored source files were not copied. Make changes in this task worktree; the original checkout is not the task's working directory. Refer to the task and commit in public replies without disclosing private local paths.` : input.parsedTask.prompt,
|
|
22583
23493
|
recipientExplicitlyAddressedByActivationTargets: input.parsedTask.recipientExplicitlyAddressedByActivationTargets,
|
|
22584
23494
|
sourceSignalId: input.parsedTask.sourceEventId,
|
|
22585
23495
|
sourceMessageEnvelope: input.parsedTask.sourceMessageEnvelope,
|
|
@@ -22600,9 +23510,83 @@ function buildDispatchRuntimePrompt(input) {
|
|
|
22600
23510
|
targetProfileId: input.parsedTask.targetProfileId
|
|
22601
23511
|
});
|
|
22602
23512
|
}
|
|
23513
|
+
async function prepareDispatchTaskWorkspace(input) {
|
|
23514
|
+
const context = input.parsedTask.executionContext;
|
|
23515
|
+
if (context && context.access !== "space_context") return await prepareExecutionContextWorkspace({
|
|
23516
|
+
context,
|
|
23517
|
+
ledgerRootPath: input.ledgerRootPath,
|
|
23518
|
+
currentWorkingDirectory: input.currentWorkingDirectory,
|
|
23519
|
+
policy: await readComputerFileAccessPolicy(input.computerFileAccessStorePath)
|
|
23520
|
+
});
|
|
23521
|
+
const workingDirectory = await executionContextWorkingDirectory({
|
|
23522
|
+
context,
|
|
23523
|
+
ledgerRootPath: input.ledgerRootPath,
|
|
23524
|
+
currentWorkingDirectory: input.currentWorkingDirectory
|
|
23525
|
+
});
|
|
23526
|
+
return {
|
|
23527
|
+
workingDirectory,
|
|
23528
|
+
boundaryRoot: workingDirectory
|
|
23529
|
+
};
|
|
23530
|
+
}
|
|
23531
|
+
async function releaseDispatchTaskWorkspace(input) {
|
|
23532
|
+
const context = input.parsedTask.executionContext;
|
|
23533
|
+
if (!(input.workspaceUse && context)) return;
|
|
23534
|
+
try {
|
|
23535
|
+
const released = await releaseExecutionContextWorkspace({
|
|
23536
|
+
ledgerRootPath: input.ledgerRootPath,
|
|
23537
|
+
context,
|
|
23538
|
+
use: input.workspaceUse,
|
|
23539
|
+
ownedProcessesQuiescent: [...input.workspaceProcesses.values()].every(Boolean)
|
|
23540
|
+
});
|
|
23541
|
+
emitRunLine({
|
|
23542
|
+
presenter: input.presenter,
|
|
23543
|
+
code: `daemon.run.workspace_${released.status}`,
|
|
23544
|
+
text: released.status === "released" ? "Reclaimed the unchanged task workspace." : "Retained the task workspace.",
|
|
23545
|
+
payload: {
|
|
23546
|
+
contextId: context.id,
|
|
23547
|
+
...released
|
|
23548
|
+
}
|
|
23549
|
+
});
|
|
23550
|
+
} catch (error) {
|
|
23551
|
+
emitRunLine({
|
|
23552
|
+
presenter: input.presenter,
|
|
23553
|
+
code: "daemon.run.workspace_retained",
|
|
23554
|
+
text: "Task workspace cleanup needs reconciliation.",
|
|
23555
|
+
payload: {
|
|
23556
|
+
contextId: context.id,
|
|
23557
|
+
errorMessage: toErrorMessage$10(error)
|
|
23558
|
+
}
|
|
23559
|
+
});
|
|
23560
|
+
}
|
|
23561
|
+
}
|
|
23562
|
+
function observeExecutionContextWorkspaceProcess(processes, event) {
|
|
23563
|
+
if (event.phase === "process_spawned") processes.set(event.processId, false);
|
|
23564
|
+
else if (event.phase === "process_exit") processes.set(event.processId, event.ownedProcessesQuiescent === true);
|
|
23565
|
+
}
|
|
22603
23566
|
async function resolveDispatchComputerFileAccess(input) {
|
|
22604
23567
|
const policy = await readComputerFileAccessPolicy(input.computerFileAccessStorePath);
|
|
22605
23568
|
const verifier = input.runtimeControllerSupport.localAdapterEntry.adapter.verifyComputerFileAccessBoundary;
|
|
23569
|
+
if (input.parsedTask.executionContext) {
|
|
23570
|
+
const context = input.parsedTask.executionContext;
|
|
23571
|
+
if (input.parsedTask.agentControllerRef === "builtin:claude-code" && context.access === "space_context") return null;
|
|
23572
|
+
if (input.parsedTask.agentControllerRef !== "builtin:codex" || input.parsedTask.transportMode !== "codex-app-server" || !verifier) throw new Error("execution_context.file_access_unsupported");
|
|
23573
|
+
const workingDirectory = input.runtimePreparation.effectiveRuntimeContext.providerRuntimeWorkingDirectory;
|
|
23574
|
+
const boundary = executionContextFileAccessBoundary({
|
|
23575
|
+
context,
|
|
23576
|
+
workingDirectory,
|
|
23577
|
+
policy,
|
|
23578
|
+
taskWorkspace: input.taskWorkspace
|
|
23579
|
+
});
|
|
23580
|
+
if (!(await verifier({
|
|
23581
|
+
boundary,
|
|
23582
|
+
workingDirectory,
|
|
23583
|
+
executionMode: "normal",
|
|
23584
|
+
agentControllerPermissionMode: input.routeConfig?.agentControllerPermissionMode,
|
|
23585
|
+
launchContract: input.routeConfig?.launchContract ?? null,
|
|
23586
|
+
transportMode: input.parsedTask.transportMode
|
|
23587
|
+
})).supported) throw new Error("execution_context.file_access_unverified");
|
|
23588
|
+
return boundary;
|
|
23589
|
+
}
|
|
22606
23590
|
const admission = await resolveComputerFileAccessAdmission({
|
|
22607
23591
|
agentControllerPermissionMode: input.routeConfig?.agentControllerPermissionMode,
|
|
22608
23592
|
agentControllerRef: input.parsedTask.agentControllerRef,
|
|
@@ -22659,6 +23643,12 @@ function createDispatchSpaceActionRuntimeContext(input) {
|
|
|
22659
23643
|
}
|
|
22660
23644
|
async function resolveRuntimeResultFromRuntimeOrCliSpaceAction(input) {
|
|
22661
23645
|
if (!input.dispatchSpaceActionContext) return await input.runtimeExecutionPromise;
|
|
23646
|
+
if (input.parsedTask.executionContext) return await applyCliSpaceActionRecordIfPresent({
|
|
23647
|
+
dispatchSpaceActionContext: input.dispatchSpaceActionContext,
|
|
23648
|
+
parsedTask: input.parsedTask,
|
|
23649
|
+
presenter: input.presenter,
|
|
23650
|
+
runtimeResult: await input.runtimeExecutionPromise
|
|
23651
|
+
});
|
|
22662
23652
|
const cliSpaceActionAbortController = new AbortController();
|
|
22663
23653
|
let completion;
|
|
22664
23654
|
try {
|
|
@@ -23043,6 +24033,10 @@ async function resolveRuntimeResultStructuredSpaceAction(input) {
|
|
|
23043
24033
|
agentControllerConversationOverride: input.agentControllerConversationOverride
|
|
23044
24034
|
});
|
|
23045
24035
|
return runDispatchRuntimeExecution({
|
|
24036
|
+
onInteractionRequest: input.onInteractionRequest,
|
|
24037
|
+
onNativeTurnStarted: input.onNativeTurnStarted,
|
|
24038
|
+
onNativeTurnCompleted: input.onNativeTurnCompleted,
|
|
24039
|
+
onRuntimeEvent: input.onRuntimeEvent,
|
|
23046
24040
|
computerFileAccessBoundary: input.computerFileAccessBoundary,
|
|
23047
24041
|
contextId: repairContinuation.contextId,
|
|
23048
24042
|
executionMode: "repair",
|
|
@@ -23282,6 +24276,10 @@ async function coordinateConcurrentAgentReply(input) {
|
|
|
23282
24276
|
}
|
|
23283
24277
|
});
|
|
23284
24278
|
let runtimeResult = await runDispatchRuntimeExecution({
|
|
24279
|
+
onInteractionRequest: input.onInteractionRequest,
|
|
24280
|
+
onNativeTurnStarted: input.onNativeTurnStarted,
|
|
24281
|
+
onNativeTurnCompleted: input.onNativeTurnCompleted,
|
|
24282
|
+
onRuntimeEvent: input.onRuntimeEvent,
|
|
23285
24283
|
agentControllerConversationOverride: continuation.agentControllerConversationOverride,
|
|
23286
24284
|
computerFileAccessBoundary: input.computerFileAccessBoundary,
|
|
23287
24285
|
contextId: continuation.contextId,
|
|
@@ -23723,11 +24721,12 @@ function resolveStructuredSpaceActionProvenance(input) {
|
|
|
23723
24721
|
if (!input.resolvedSpaceAction) return;
|
|
23724
24722
|
return input.runtimeResult.resultPayload.spaceActionProvenance ?? "direct";
|
|
23725
24723
|
}
|
|
23726
|
-
function runDispatchRuntimeExecution(input) {
|
|
23727
|
-
|
|
23728
|
-
|
|
24724
|
+
async function runDispatchRuntimeExecution(input) {
|
|
24725
|
+
input.onNativeTurnStarted();
|
|
24726
|
+
const result = await runRuntimeTask({
|
|
24727
|
+
...input.parsedTask.executionContext || input.agentControllerConversationOverride ? { agentContextOverride: {
|
|
23729
24728
|
agentControllerConversationId: input.contextId,
|
|
23730
|
-
agentControllerConversationOverride: input.agentControllerConversationOverride
|
|
24729
|
+
agentControllerConversationOverride: input.agentControllerConversationOverride ?? null
|
|
23731
24730
|
} } : {},
|
|
23732
24731
|
io: input.io,
|
|
23733
24732
|
...input.onInteractionRequest ? { onInteractionRequest: input.onInteractionRequest } : {},
|
|
@@ -23751,6 +24750,8 @@ function runDispatchRuntimeExecution(input) {
|
|
|
23751
24750
|
runtimeContext: input.runtimeContext
|
|
23752
24751
|
})
|
|
23753
24752
|
});
|
|
24753
|
+
input.onNativeTurnCompleted(result);
|
|
24754
|
+
return result;
|
|
23754
24755
|
}
|
|
23755
24756
|
function buildDispatchRuntimeRoute(input) {
|
|
23756
24757
|
const runtimeEnv = input.contextId ? {
|
|
@@ -23784,6 +24785,7 @@ function buildDispatchRuntimeRoute(input) {
|
|
|
23784
24785
|
}
|
|
23785
24786
|
function buildDispatchRuntimeTask(input) {
|
|
23786
24787
|
return {
|
|
24788
|
+
executionContext: input.parsedTask.executionContext,
|
|
23787
24789
|
agentId: input.parsedTask.targetProfileId,
|
|
23788
24790
|
attemptId: input.parsedTask.attemptId,
|
|
23789
24791
|
bindingKey: `${input.parsedTask.spaceId}|${input.parsedTask.targetProfileId}`,
|
|
@@ -39971,6 +40973,6 @@ async function emitAgentsConfigParseFallbackSignal(input) {
|
|
|
39971
40973
|
});
|
|
39972
40974
|
}
|
|
39973
40975
|
//#endregion
|
|
39974
|
-
export { buildHumanErrorCopy as $,
|
|
40976
|
+
export { buildHumanErrorCopy as $, readAgentActivityIntegrationStatus as $n, buildDispatchResultMessageReadProjection as $t, runDaemonBackgroundStartForDecision as A, OPENMELD_DISPATCH_RUNTIME_MODE_ENV as An, cliJsonErrorEnvelopeSchema as Ar, submitRuntimeAgentControllerReport as At, runDaemonTeardownStrict as B, enqueueAgentActivityHookEvent as Bn, listSpaceConfigs as Bt, resolveGatewayWebOrigin as C, prepareSpaceComposerSubmission as Cn, isReturnKeypress as Cr, readDispatchSpaceActionContextForReceiptFromEnv as Ct, isManagedSystemServiceBootstrapRun as D, returnToTargetPickerState as Dn, isCurrentCommandCheckScopeActive as Dr, validateLocalProjectConnectionPath as Dt, bestEffortStopCurrentLaneDaemonService as E, resolveSpaceMemberAgentOwnerWakeDiagnosticsView as En, getCurrentCommandCheckState as Er, LocalProjectConnectionError as Et, runDaemonRunAfterEntryChecks as F, resolveObservedAgentActivityBinding as Fn, acceptOrganizationJoinLinkBodySchema as Fr, resolveLocalAgentControllerReportDecision as Ft, buildProfileWorkspacePresentation as G, readControllerTaskLifecycleOutboxHealth as Gn, removeSpaceConfig as Gt, formatServiceParticipationReadinessLabel as H, readAgentActivityOutboxHealth as Hn, readSpaceConfig as Ht, runDaemonServiceDetached as I, normalizeSharedSessionTitle as In, getOrganizationJoinLinkResponseSchema as Ir, projectSpaceProfileCache as It, createQuietPresenter as J, resolveAgentActivityRouteForPath as Jn, updateSpaceLastSeenTs as Jt, buildProfileWorkspaceRows as K, isAgentActivityRouteRegistered as Kn, toLocalSpaceStateIntegrityError as Kt, runDaemonSnapshot as L, readCodexSessionTitles as Ln, organizationJoinLinkErrorResponseSchema as Lr, LocalSpaceStateIntegrityError as Lt, runDaemonInstall as M, connectWebSocket as Mn, cliJsonSkillsListEnvelopeSchema as Mr, collectLocalAgentControllerInventory as Mt, runDaemonInterrupt as N, syncLocalAgentActivity as Nn, cliJsonSkillsLoadEnvelopeSchema as Nr, resolveLocalAgentControllerBlockerReasonCodes as Nt, runDaemon as O, updateAuthoredMentionRanges as On, resetCurrentCommandCheckState as Or, readRuntimeReportingHealthState as Ot, runDaemonReinstall as P, buildAgentActivityEvent as Pn, cliJsonSkillsShowEnvelopeSchema as Pr, resolveLocalAgentControllerLaunchability as Pt, runDaemonStartDecisionPrompt as Q, installAgentActivityIntegrations as Qn, SpaceComposerSubmissionError as Qt, runDaemonStatusFlow as R, readAgentActivityContextForPath as Rn, organizationJoinLinkManagementQuerySchema as Rr, inspectSpaceCacheFile as Rt, buildSpaceWebUrl as S, openTargetPickerState as Sn, promptTextEntry as Sr, OPENMELD_SPACE_ACTION_CONTEXT_PATH_ENV as St, runDaemonServiceParticipationGate as T, resolveNextRecentMentionProfileIdsForQueuedText as Tn, finishCurrentCommandCheckScope as Tr, writeDispatchSpaceActionRecord as Tt, formatServiceRuntimeHeadline as U, removeProjectOutbox as Un, readSpaceLastSeenTs as Ut, runDaemonUninstall as V, removeProjectInbox as Vn, readSpaceCacheDeletionNoticeState as Vt, resolveServiceParticipationReadiness as W, enqueueControllerTaskLifecycleEventWhileLocked as Wn, readSpaceRecentMentionProfileIds as Wt, createDelayedSpinner as X, AGENT_ACTIVITY_INTEGRATION_OWNER as Xn, writeSpaceCacheDeletionNoticeState as Xt, emitDaemonAgentOverview as Y, unregisterAgentActivityRoute as Yn, upsertSpaceConfig as Yt, shouldEmitAgentOverview as Z, defaultManagedIntegrationPaths as Zn, writeSpaceRecentMentionProfileIds as Zt, promptSearchSelect as _, formatRemovedCcRelationMessage as _n, fetchAuthUserSnapshot as _r, toStructuredGatewayFailure as _t, runAgentsCustomRemove as a, buildSpaceMemberAgentPresencePresentation as an, runAuthLogin as ar, resolveLocalComponentsStatus as at, resolveOffsetVisibleWindow as b, listSpaceMentionRelationChoices as bn, resolveDeviceTokenExpiresAt as br, readDispatchOwnedRuntimeGuard as bt, runAgentsDisable as c, buildSpaceProfileAddPlan as cn, runAuthStatus as cr, fetchSpaceUpdates as ct, runAgentsManage as d, closeMentionPickerState as dn, buildAuthStatusSnapshot as dr, updateSpaceMeta as dt, buildDispatchResultReplyWorkflowProjection as en, resolveAgentActivityDispatcherCommand as er, renderHumanErrorCard as et, runAgentsRepair as f, collectResolvedSpaceMentions as fn, formatActiveOrganizationLabel as fr, parseSpaceMetaPayload as ft, promptSearchMultiselectWorkbench as g, extractMentionAuthoringPrefix as gn, extractAuthApiErrorMessage as gr, readGatewayTextResponse as gt, promptSearchMultiselect as h, enterRelationPickerState as hn, buildUnifiedCardFrame as hr, readGatewayJsonResponse as ht, runAgentsCustomList as i, buildSignalReplyWorkflowProjection as in, evaluateCommandAuthentication as ir, readDaemonIncidentLogTail as it, runDaemonCancel as j, readRecentDaemonDispatchJournalEvents as jn, cliJsonOutputEnvelopeSchema as jr, submitRuntimeAgentControllerReports as jt, runDaemonAutostart as k, DISPATCH_OWNED_RUNTIME_MODE as kn, startCurrentCommandCheckScope as kr, submitProfileRuntimeAgentControllerReport as kt, runAgentsEnable as l, buildSpaceRoundReadProjection as ln, exchangeOneTimeTokenAuthSession as lr, createCliSpaceApi as lt, formatTransportModeDisplay as m, createSpaceTargetCatalog as mn, renderTextInfoCard as mr, GatewayHttpError as mt, runAgentsConfig as n, buildSignalIndex as nn, buildCommandAuthenticationPromptMessage as nr, emitCliJsonEnvelope as nt, runAgentsCustomUpdate as o, buildSpaceMentionProfileIndex as on, runAuthLogout as or, writeInstalledLocalComponentsSnapshot as ot, runAgentsShow as p, createSpaceMemberIdentityIndex as pn, renderInfoCard as pr, parseSpaceMetaResponse as pt, reconcileCliVersionView as q, registerAgentActivityRoute as qn, toSpaceConfigListIntegrityError as qt, runAgentsCustomAdd as r, buildSignalMessageReadProjection as rn, ensureCommandAuthenticationOrCancel as rr, runDaemonStartupPreflight as rt, runAgentsDetect as s, buildSpaceMessageReadRelationSummary as sn, runAuthMenu as sr, resolveDaemonServiceParticipationStatus as st, runAgents as t, buildPublicSpaceEntryUrl as tn, uninstallAgentActivityIntegrations as tr, renderHumanTextErrorCard as tt, runAgentsList as u, buildUpdatesReplyWorkflowProjection as un, buildAuthStatusRows as ur, fetchSpaceMeta as ut, clampNumber as v, isRelationPickerState as vn, requestDeviceToken as vr, parseJsonResponse as vt, resolveSpaceWebGatewayOrigin as w, prepareSpaceFileOnlySubmission as wn, runInteractivePrompt as wr, readDispatchSpaceActionContextFromEnv as wt, computeRetryDelayMs as x, listSpaceMentionSuggestions as xn, revokeAuthAccessToken as xr, DispatchSpaceActionClosedError as xt, resolveAnchoredVisibleWindow as y, isTargetPickerState as yn, resolveDeviceAuthClientId as yr, assertDispatchOwnedRuntimePublicWriteAllowed as yt, runDaemonStop as z, removeAgentActivityContextCache as zn, revokeOrganizationJoinLinkResponseSchema as zr, isLocalSpaceStateCorruptResult as zt };
|
|
39975
40977
|
|
|
39976
|
-
//# sourceMappingURL=agents-
|
|
40978
|
+
//# sourceMappingURL=agents-Caxxitma.js.map
|