agent-transport-system 0.7.51 → 0.7.52

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/ats-dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import "./lock-Dvj4X1DR.js";
4
- import { t as DEV_LOCAL_GATEWAY_BASE_URL } from "./base-url-Cuza4k9w.js";
3
+ import "./lock-ZVYnqvct.js";
4
+ import { t as DEV_LOCAL_GATEWAY_BASE_URL } from "./base-url-Do1VBi_A.js";
5
5
 
6
6
  //#region src/ats-dev.ts
7
7
  const LOCAL_GATEWAY_URL = DEV_LOCAL_GATEWAY_BASE_URL;
package/dist/ats.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { $ as formatLocalSetupActionLabel, $n as atsdTaskResultPayloadSchema, $t as setLocalRuntimeDisplayNameBodySchema, A as continuitySchema, An as AGENT_REPLYING_PURPOSE, Ar as parseOptionalClientMessageId, At as notifyAgentProfileRouteCatalogChangedResponseSchema, B as daemonRouteCatalogCacheSchema, Bn as LEGACY_RUNTIME_DISPATCH_POLICY, Bt as postSpaceThreadSignalBodySchema, C as agentExecutionReadinessRouteParamsSchema, Cn as submitRuntimeRegistrationResponseSchema, Cr as getSpaceMessageAddressingRelationSupportForTargetKind, Ct as listSpaceThreadSignalsResponseSchema, D as atsdControlPlaneRequestSchema, Dn as writeSetupTokenLocalRuntimeObservedMetadataBodySchema, Dr as normalizeOptionalWorkingDirectory, Dt as normalizeListSignalsReadQuerySemantics, E as atsRequestContextSchema, En as writeCurrentDeviceObservedMetadataResponseSchema, Er as normalizeMessageEnvelope, Et as localRuntimesResponseSchema, F as createSpaceThreadBodySchema, Fn as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, Fr as resolveSpaceMentionLabels, Ft as patchStartSessionBodySchema, G as ensureAgentProfilePrimaryBindingBodySchema, Gn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, Gt as projectSpaceDispatchTraceFinalVisibleOutcome, H as daemonRuntimeLeaseSchema, Hn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, Ht as prepareSessionResponseSchema, I as createSpaceThreadResponseSchema, In as DAEMON_HUB_SCHEMA_VERSION, It as postNormalMessageBodySchema, J as forgetComputerResponseSchema, Jn as SPACE_UPDATES_MAX_LIMIT, Jt as resolveSpaceDispatchTraceRootCause, K as ensureAgentProfilePrimaryBindingResponseSchema, Kn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Kt as providerDispatchRuntimeContextSchema, L as createStartSessionBodySchema, Ln as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Lt as postNormalMessageResponseSchema, M as createSpaceDiagnosticReportBodySchema, Mn as AGENT_REPLY_PREVIEW_PURPOSE, Mr as resolveBuiltinAgentControllerConversationKind, Mt as patchProfileSpaceHistoryStatusResponseSchema, N as createSpaceDiagnosticReportResponseSchema, Nn as ATSD_TASK_RESULT_SCHEMA_VERSION, Nr as resolveMessageEnvelopeTargetField, Nt as patchSpaceContractBodySchema, O as atsdControlPlaneResponseSchema, On as writeSetupTokenLocalRuntimeObservedMetadataResponseSchema, Or as normalizeSpacePasswordText, Ot as normalizeSpaceCursorPatch, P as createSpaceResponseSchema, Pn as CONVERSATION_CONTINUITY_WARNING_PURPOSE, Pr as resolveSingleSpaceMentionLabels, Pt as patchSpaceContractResponseSchema, Q as formatLocalSetupActionDescription, Qn as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, Qt as setCurrentDeviceTargetBodySchema, R as currentDeviceTargetResponseSchema, Rn as DISPATCH_ACTIVITY_FAILED_PURPOSE, Rr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Rt as postSpaceMembersBodySchema, S as accountSpaceIndexResponseSchema, Sn as submitRuntimeRegistrationBodySchema, Sr as formatCanonicalMentionLiteral, St as listSpaceThreadEventsResponseSchema, T as atsProfileIdSchema, Tn as writeCurrentDeviceObservedMetadataBodySchema, Tr as normalizeKnownBuiltinAgentControllerId, Tt as localRuntimesQuerySchema, U as deleteSpaceResponseSchema, Un as MESSAGE_MENTION_TYPE_VALUES, Ut as prepareSessionStreamServerFrameSchema, V as daemonRouteObservationResponseSchema, Vn as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Vt as postSpaceThreadSignalResponseSchema, W as dispatchBriefSchema, Wn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Wt as projectObservabilityWakeCorrelation, X as formatLocalComponentsSummaryDescription, Xn as atsSpaceEgressActionSchema, Xt as resolveStartHandoffResponseSchema, Y as forgetCurrentComputerResponseSchema, Yn as atsRuntimeProfileIdSchema, Yt as resolveStartHandoffBodySchema, Z as formatLocalComponentsSummaryLabel, Zn as atsdTaskResultEnvelopeWriteSchema, Zt as serverErrorFrameSchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as structuredGuidePayloadFromInputSchema, _r as daemonHubRouteCatalogChangedFramePayloadSchema, _t as getSpaceWakeTraceWaterfallResponseSchema, a as runWithHeldLock, an as spaceMemberDirectoryEntrySchema, ar as conversationExecutionStateSchema, at as getAgentExecutionReadinessResponseSchema, b as LOCAL_COMPONENTS_SCHEMA_VERSION, bn as submitRuntimeProviderConversationProofsBodySchema, br as daemonServiceLaneSchema, bt as leaveSpaceResponseSchema, c as LEGACY_ATS_CLI_CONTEXT_ENV_KEY, cn as spaceMetaSchema, cr as daemonHubDeliveryExecutionIdentitySchema, ct as getPrepareReadinessResponseSchema, d as resolveCliContext, dn as startProfileReadinessSummarySchema, dr as daemonHubDispatchPreviewRequestSchema, dt as getSpaceDispatchResultResponseSchema, en as signalEnvelopeSchema, er as buildAgentControllerConversationRef, et as gatewayErrorCodeSchema, f as resolveCliContextId, fn as startSessionProgressSchema, fr as daemonHubDispatchRuntimeEvidenceRequestSchema, ft as getSpaceMessageDetailsResponseSchema, g as resolveMappedPublicAgentFailureReason, gn as startSessionWithTokenResponseSchema, gr as daemonHubRegisterSessionResponseSchema, gt as getSpaceWakeProgressResponseSchema, h as resolveBuiltinAgentControllerBrand, hn as startSessionSpaceChoiceResponseSchema, hr as daemonHubRegisterSessionRequestSchema, ht as getSpaceUpdatesResponseSchema, i as releaseLock, in as spaceIdentityDirectorySchema, ir as collectCanonicalMentionTextFragments, it as getAgentExecutionReadinessBatchResponseSchema, j as createSpaceBodySchema, jn as AGENT_REPLY_PREVIEW_END_PURPOSE, jr as profileWorkspaceModeSchema, jt as observabilityWakeTraceSelectorSchema, k as catchupResponseSchema, kn as AGENT_REPLYING_END_PURPOSE, kr as parseAgentControllerRef$1, kt as notifyAgentProfileRouteCatalogChangedBodySchema, l as listCliContextStates, ln as spaceViewerMembershipResponseSchema, lr as daemonHubDispatchLifecycleRequestSchema, lt as getSpaceContractResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as startSessionSpaceChoiceBodySchema, mr as daemonHubHeartbeatResponseSchema, mt as getSpaceThreadResponseSchema, n as isAtsLockError, nn as spaceCreatorSchema, nr as canonicalizeAgentControllerRef, nt as getActiveSpaceWakeProgressResponseSchema, o as tryCleanupStaleLock, on as spaceMemberDirectorySchema, or as createDaemonRouteObservationSummary, ot as getAgentProfilePrimaryBindingResponseSchema, p as writeCliContextState, pn as startSessionResponseSchema, pr as daemonHubHeartbeatRequestSchema, pt as getSpaceStatusResponseSchema, q as entryBriefSchema, qn as SPACE_PASSWORD_MIN_LENGTH, qt as removeSpaceMembersResponseSchema, r as readLockMeta, rn as spaceDispatchTraceResponseSchema, rr as canonicalizeBuiltinAgentControllerRef, rt as getAgentExecutionReadinessBatchBodySchema, s as ATS_CLI_CONTEXT_ENV_KEY, sn as spaceMembersSnapshotSchema, sr as daemonHubDeliverDispatchRequestSchema, st as getPrepareReadinessQuerySchema, t as acquireLock, tn as spaceBootstrapResponseSchema, tr as buildAgentControllerRoutingKey, tt as gatewayErrorEnvelopeSchema, u as readCliContextState, un as startDeviceProjectionSchema, ur as daemonHubDispatchPreviewEndRequestSchema, ut as getSpaceDispatchLookupResponseSchema, v as DAEMON_ROUTE_CATALOG_CACHE_SCHEMA_NAME, vn as submitRuntimeAgentControllerReportsBodySchema, vr as daemonHubSubmitTaskResultRequestSchema, vt as incomingServerMessageSchema, w as agentProfileBindingRouteParamsSchema, wn as upsertProfileSpaceHistoryResponseSchema, wr as normalizeBuiltinAgentControllerId, wt as listSpaceThreadsResponseSchema, x as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, xn as submitRuntimeProviderConversationProofsResponseSchema, xr as daemonStreamFrameSchema, xt as listProfileSpaceHistoryResponseSchema, y as DAEMON_ROUTE_CATALOG_CACHE_SCHEMA_VERSION, yn as submitRuntimeAgentControllerReportsResponseSchema, yr as daemonServiceContractSchema, yt as installedLocalComponentsSnapshotSchema, z as currentLocalRuntimeReplyReadinessResponseSchema, zn as DISPATCH_ACTIVITY_RETRYING_PURPOSE, zr as sanitizeSignalTextPreview, zt as postSpaceMembersResponseSchema } from "./lock-Dvj4X1DR.js";
3
+ import { $ as formatLocalSetupActionLabel, $n as atsdTaskResultPayloadSchema, $t as setLocalRuntimeDisplayNameBodySchema, A as continuitySchema, An as AGENT_REPLYING_PURPOSE, Ar as parseOptionalClientMessageId, At as notifyAgentProfileRouteCatalogChangedResponseSchema, B as daemonRouteCatalogCacheSchema, Bn as LEGACY_RUNTIME_DISPATCH_POLICY, Bt as postSpaceThreadSignalBodySchema, C as agentExecutionReadinessRouteParamsSchema, Cn as submitRuntimeRegistrationResponseSchema, Cr as getSpaceMessageAddressingRelationSupportForTargetKind, Ct as listSpaceThreadSignalsResponseSchema, D as atsdControlPlaneRequestSchema, Dn as writeSetupTokenLocalRuntimeObservedMetadataBodySchema, Dr as normalizeOptionalWorkingDirectory, Dt as normalizeListSignalsReadQuerySemantics, E as atsRequestContextSchema, En as writeCurrentDeviceObservedMetadataResponseSchema, Er as normalizeMessageEnvelope, Et as localRuntimesResponseSchema, F as createSpaceThreadBodySchema, Fn as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, Fr as resolveSpaceMentionLabels, Ft as patchStartSessionBodySchema, G as ensureAgentProfilePrimaryBindingBodySchema, Gn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, Gt as projectSpaceDispatchTraceFinalVisibleOutcome, H as daemonRuntimeLeaseSchema, Hn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, Ht as prepareSessionResponseSchema, I as createSpaceThreadResponseSchema, In as DAEMON_HUB_SCHEMA_VERSION, It as postNormalMessageBodySchema, J as forgetComputerResponseSchema, Jn as SPACE_UPDATES_MAX_LIMIT, Jt as resolveSpaceDispatchTraceRootCause, K as ensureAgentProfilePrimaryBindingResponseSchema, Kn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Kt as providerDispatchRuntimeContextSchema, L as createStartSessionBodySchema, Ln as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Lt as postNormalMessageResponseSchema, M as createSpaceDiagnosticReportBodySchema, Mn as AGENT_REPLY_PREVIEW_PURPOSE, Mr as resolveBuiltinAgentControllerConversationKind, Mt as patchProfileSpaceHistoryStatusResponseSchema, N as createSpaceDiagnosticReportResponseSchema, Nn as ATSD_TASK_RESULT_SCHEMA_VERSION, Nr as resolveMessageEnvelopeTargetField, Nt as patchSpaceContractBodySchema, O as atsdControlPlaneResponseSchema, On as writeSetupTokenLocalRuntimeObservedMetadataResponseSchema, Or as normalizeSpacePasswordText, Ot as normalizeSpaceCursorPatch, P as createSpaceResponseSchema, Pn as CONVERSATION_CONTINUITY_WARNING_PURPOSE, Pr as resolveSingleSpaceMentionLabels, Pt as patchSpaceContractResponseSchema, Q as formatLocalSetupActionDescription, Qn as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, Qt as setCurrentDeviceTargetBodySchema, R as currentDeviceTargetResponseSchema, Rn as DISPATCH_ACTIVITY_FAILED_PURPOSE, Rr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Rt as postSpaceMembersBodySchema, S as accountSpaceIndexResponseSchema, Sn as submitRuntimeRegistrationBodySchema, Sr as formatCanonicalMentionLiteral, St as listSpaceThreadEventsResponseSchema, T as atsProfileIdSchema, Tn as writeCurrentDeviceObservedMetadataBodySchema, Tr as normalizeKnownBuiltinAgentControllerId, Tt as localRuntimesQuerySchema, U as deleteSpaceResponseSchema, Un as MESSAGE_MENTION_TYPE_VALUES, Ut as prepareSessionStreamServerFrameSchema, V as daemonRouteObservationResponseSchema, Vn as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Vt as postSpaceThreadSignalResponseSchema, W as dispatchBriefSchema, Wn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Wt as projectObservabilityWakeCorrelation, X as formatLocalComponentsSummaryDescription, Xn as atsSpaceEgressActionSchema, Xt as resolveStartHandoffResponseSchema, Y as forgetCurrentComputerResponseSchema, Yn as atsRuntimeProfileIdSchema, Yt as resolveStartHandoffBodySchema, Z as formatLocalComponentsSummaryLabel, Zn as atsdTaskResultEnvelopeWriteSchema, Zt as serverErrorFrameSchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as structuredGuidePayloadFromInputSchema, _r as daemonHubRouteCatalogChangedFramePayloadSchema, _t as getSpaceWakeTraceWaterfallResponseSchema, a as runWithHeldLock, an as spaceMemberDirectoryEntrySchema, ar as conversationExecutionStateSchema, at as getAgentExecutionReadinessResponseSchema, b as LOCAL_COMPONENTS_SCHEMA_VERSION, bn as submitRuntimeProviderConversationProofsBodySchema, br as daemonServiceLaneSchema, bt as leaveSpaceResponseSchema, c as LEGACY_ATS_CLI_CONTEXT_ENV_KEY, cn as spaceMetaSchema, cr as daemonHubDeliveryExecutionIdentitySchema, ct as getPrepareReadinessResponseSchema, d as resolveCliContext, dn as startProfileReadinessSummarySchema, dr as daemonHubDispatchPreviewRequestSchema, dt as getSpaceDispatchResultResponseSchema, en as signalEnvelopeSchema, er as buildAgentControllerConversationRef, et as gatewayErrorCodeSchema, f as resolveCliContextId, fn as startSessionProgressSchema, fr as daemonHubDispatchRuntimeEvidenceRequestSchema, ft as getSpaceMessageDetailsResponseSchema, g as resolveMappedPublicAgentFailureReason, gn as startSessionWithTokenResponseSchema, gr as daemonHubRegisterSessionResponseSchema, gt as getSpaceWakeProgressResponseSchema, h as resolveBuiltinAgentControllerBrand, hn as startSessionSpaceChoiceResponseSchema, hr as daemonHubRegisterSessionRequestSchema, ht as getSpaceUpdatesResponseSchema, i as releaseLock, in as spaceIdentityDirectorySchema, ir as collectCanonicalMentionTextFragments, it as getAgentExecutionReadinessBatchResponseSchema, j as createSpaceBodySchema, jn as AGENT_REPLY_PREVIEW_END_PURPOSE, jr as profileWorkspaceModeSchema, jt as observabilityWakeTraceSelectorSchema, k as catchupResponseSchema, kn as AGENT_REPLYING_END_PURPOSE, kr as parseAgentControllerRef$1, kt as notifyAgentProfileRouteCatalogChangedBodySchema, l as listCliContextStates, ln as spaceViewerMembershipResponseSchema, lr as daemonHubDispatchLifecycleRequestSchema, lt as getSpaceContractResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as startSessionSpaceChoiceBodySchema, mr as daemonHubHeartbeatResponseSchema, mt as getSpaceThreadResponseSchema, n as isAtsLockError, nn as spaceCreatorSchema, nr as canonicalizeAgentControllerRef, nt as getActiveSpaceWakeProgressResponseSchema, o as tryCleanupStaleLock, on as spaceMemberDirectorySchema, or as createDaemonRouteObservationSummary, ot as getAgentProfilePrimaryBindingResponseSchema, p as writeCliContextState, pn as startSessionResponseSchema, pr as daemonHubHeartbeatRequestSchema, pt as getSpaceStatusResponseSchema, q as entryBriefSchema, qn as SPACE_PASSWORD_MIN_LENGTH, qt as removeSpaceMembersResponseSchema, r as readLockMeta, rn as spaceDispatchTraceResponseSchema, rr as canonicalizeBuiltinAgentControllerRef, rt as getAgentExecutionReadinessBatchBodySchema, s as ATS_CLI_CONTEXT_ENV_KEY, sn as spaceMembersSnapshotSchema, sr as daemonHubDeliverDispatchRequestSchema, st as getPrepareReadinessQuerySchema, t as acquireLock, tn as spaceBootstrapResponseSchema, tr as buildAgentControllerRoutingKey, tt as gatewayErrorEnvelopeSchema, u as readCliContextState, un as startDeviceProjectionSchema, ur as daemonHubDispatchPreviewEndRequestSchema, ut as getSpaceDispatchLookupResponseSchema, v as DAEMON_ROUTE_CATALOG_CACHE_SCHEMA_NAME, vn as submitRuntimeAgentControllerReportsBodySchema, vr as daemonHubSubmitTaskResultRequestSchema, vt as incomingServerMessageSchema, w as agentProfileBindingRouteParamsSchema, wn as upsertProfileSpaceHistoryResponseSchema, wr as normalizeBuiltinAgentControllerId, wt as listSpaceThreadsResponseSchema, x as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, xn as submitRuntimeProviderConversationProofsResponseSchema, xr as daemonStreamFrameSchema, xt as listProfileSpaceHistoryResponseSchema, y as DAEMON_ROUTE_CATALOG_CACHE_SCHEMA_VERSION, yn as submitRuntimeAgentControllerReportsResponseSchema, yr as daemonServiceContractSchema, yt as installedLocalComponentsSnapshotSchema, z as currentLocalRuntimeReplyReadinessResponseSchema, zn as DISPATCH_ACTIVITY_RETRYING_PURPOSE, zr as sanitizeSignalTextPreview, zt as postSpaceMembersResponseSchema } from "./lock-ZVYnqvct.js";
4
4
  import { A as runtimeDir, C as normalizeAtsProfileId, D as resolveAtsEnvPreset, E as resolveAtsCliEntryNameFromArgv, F as systemDir, N as skillsDir, O as resolveAtsRootDir, P as spacesDir, S as normalizeAccountKey, T as profileViewPath, a as accountProfileWorkspacePath, c as atsRootDir, d as deviceOpenClawProfileBootstrapPath, f as deviceOpenClawProfileDir, i as accountProfileViewPath, j as runtimeLogsDir, k as resolveDefaultAtsHomeDirname, n as accountProfileLocalMetaPath, o as accountsDir, p as deviceOpenClawProfileWorkspaceDir, r as accountProfileSpaceCacheDir, s as atsBackupsDir, t as ATS_HOME_ENV_KEY, w as profileDir, y as legacyAccountProfileSpacesDir } from "./paths-DFiopT5Y.js";
5
- import { A as toSpaceDeleteUrl, B as toSpaceUpdatesUrl, C as updateConfiguredSkillsConfig, D as toSpaceContractUrl, E as toDaemonRouteObservationUrl, F as toSpaceMetaUrl, I as toSpacePasswordUrl, L as toSpaceRemoveMembersUrl, M as toSpaceDispatchTraceUrl, N as toSpaceLeaveUrl, O as toSpaceCreateUrl, P as toSpaceMembersUrl, R as toSpaceResultUrl, S as updateConfiguredOnboardingConfig, T as normalizeBaseUrl, V as toSpaceWsUrl, _ as getRuntimeConfigReadHealth, a as resolveBaseUrlOrNull, b as setConfiguredSkillsConfig, c as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, d as getConfiguredDaemonDispatchLimits, f as getConfiguredDeviceRuntimeState, g as getConfiguredViewCustomization, h as getConfiguredStartV1OnboardingState, i as resolveBaseUrl, j as toSpaceDispatchLookupUrl, k as toSpaceCursorUrl, l as alignRuntimeConfigStorage, m as getConfiguredSkillsConfig, n as normalizeGatewayBaseUrl, o as resolveDefaultGatewayBaseUrl, p as getConfiguredOnboardingDisclaimerAcceptedAt, r as normalizeGatewayBaseUrlOrNull, s as resolveExplicitGatewayUrlOrThrow, u as createDefaultRuntimeAgentControllerSettings, v as resolveRuntimeSkillsCustomTargetId, w as updateConfiguredStartV1OnboardingState, x as updateConfiguredDeviceRuntimeState, y as setConfiguredBaseUrl, z as toSpaceSignalsUrl } from "./base-url-Cuza4k9w.js";
5
+ import { A as toSpaceDeleteUrl, B as toSpaceUpdatesUrl, C as updateConfiguredSkillsConfig, D as toSpaceContractUrl, E as toDaemonRouteObservationUrl, F as toSpaceMetaUrl, I as toSpacePasswordUrl, L as toSpaceRemoveMembersUrl, M as toSpaceDispatchTraceUrl, N as toSpaceLeaveUrl, O as toSpaceCreateUrl, P as toSpaceMembersUrl, R as toSpaceResultUrl, S as updateConfiguredOnboardingConfig, T as normalizeBaseUrl, V as toSpaceWsUrl, _ as getRuntimeConfigReadHealth, a as resolveBaseUrlOrNull, b as setConfiguredSkillsConfig, c as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, d as getConfiguredDaemonDispatchLimits, f as getConfiguredDeviceRuntimeState, g as getConfiguredViewCustomization, h as getConfiguredStartV1OnboardingState, i as resolveBaseUrl, j as toSpaceDispatchLookupUrl, k as toSpaceCursorUrl, l as alignRuntimeConfigStorage, m as getConfiguredSkillsConfig, n as normalizeGatewayBaseUrl, o as resolveDefaultGatewayBaseUrl, p as getConfiguredOnboardingDisclaimerAcceptedAt, r as normalizeGatewayBaseUrlOrNull, s as resolveExplicitGatewayUrlOrThrow, u as createDefaultRuntimeAgentControllerSettings, v as resolveRuntimeSkillsCustomTargetId, w as updateConfiguredStartV1OnboardingState, x as updateConfiguredDeviceRuntimeState, y as setConfiguredBaseUrl, z as toSpaceSignalsUrl } from "./base-url-Do1VBi_A.js";
6
6
  import { createRequire } from "node:module";
7
7
  import { Command, Option } from "commander";
8
8
  import { accessSync, appendFileSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, realpathSync, renameSync, statSync, writeFileSync } from "node:fs";
@@ -27,12 +27,12 @@ import wrapAnsi from "wrap-ansi";
27
27
  import { Box, Container, Editor, Key, ProcessTerminal, TUI, Text, getEditorKeybindings, matchesKey } from "@mariozechner/pi-tui";
28
28
 
29
29
  //#region package.json
30
- var version = "0.7.51";
30
+ var version = "0.7.52";
31
31
  var package_default = {
32
32
  $schema: "https://www.schemastore.org/package.json",
33
33
  name: "agent-transport-system",
34
34
  version,
35
- atsReleaseDate: "2026-06-08",
35
+ atsReleaseDate: "2026-06-10",
36
36
  description: "Agent Transport System CLI - https://ats.sh",
37
37
  license: "MIT",
38
38
  type: "module",
@@ -12872,7 +12872,7 @@ async function setDaemonServiceRuntimeState(state, pathInput = {}) {
12872
12872
  await writeDaemonServiceRuntimeState(state, pathInput);
12873
12873
  }
12874
12874
  async function clearDaemonServiceRuntimeState(pathInput = {}) {
12875
- const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-DGexMALq.js");
12875
+ const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-WesI-E7s.js");
12876
12876
  await Promise.all([rm(daemonServiceRuntimeStatePath(pathInput), { force: true }), clearDaemonRuntimeLease(pathInput)]);
12877
12877
  }
12878
12878
  async function withDaemonServiceRunLock(callback, meta = {
@@ -13489,7 +13489,7 @@ function normalizeFixtureText(value) {
13489
13489
  }
13490
13490
  function buildContractCandidate(input, pathInput, current) {
13491
13491
  const lane = input.lane ?? resolveAtsEnvPreset(pathInput);
13492
- const connectedComputerId = input.connectedComputerId ?? (current && current.lane === lane && current.gatewayUrl === input.gatewayUrl && current.deviceId === input.deviceId ? current.connectedComputerId : void 0);
13492
+ const connectedComputerId = input.connectedComputerId ?? (current && canReuseConnectedComputerEvidence(current, input, lane) ? current.connectedComputerId : void 0);
13493
13493
  return {
13494
13494
  schema: "ats-daemon-service-contract-v1",
13495
13495
  v: 1,
@@ -13500,14 +13500,21 @@ function buildContractCandidate(input, pathInput, current) {
13500
13500
  serviceController: input.serviceController,
13501
13501
  autoStart: input.autoStart,
13502
13502
  gatewayUrl: input.gatewayUrl,
13503
+ ...input.ownerUserId ? { ownerUserId: input.ownerUserId } : {},
13503
13504
  ...input.profileId ? { profileId: input.profileId } : {},
13504
13505
  deviceId: input.deviceId,
13505
13506
  ...connectedComputerId ? { connectedComputerId } : {},
13506
13507
  heartbeatMs: input.heartbeatMs
13507
13508
  };
13508
13509
  }
13510
+ function canReuseConnectedComputerEvidence(current, input, lane) {
13511
+ if (current.lane !== lane || current.gatewayUrl !== input.gatewayUrl || current.deviceId !== input.deviceId) return false;
13512
+ if (current.ownerUserId && input.ownerUserId) return current.ownerUserId === input.ownerUserId;
13513
+ if (current.profileId && input.profileId) return current.profileId === input.profileId;
13514
+ return !(current.ownerUserId || input.ownerUserId);
13515
+ }
13509
13516
  function isSameContractState(current, candidate) {
13510
- return current.schema === candidate.schema && current.v === candidate.v && current.lane === candidate.lane && current.daemonVersion === candidate.daemonVersion && current.bundleId === candidate.bundleId && current.desiredState === candidate.desiredState && current.serviceController === candidate.serviceController && current.autoStart === candidate.autoStart && current.gatewayUrl === candidate.gatewayUrl && current.profileId === candidate.profileId && current.deviceId === candidate.deviceId && current.connectedComputerId === candidate.connectedComputerId && current.heartbeatMs === candidate.heartbeatMs;
13517
+ return current.schema === candidate.schema && current.v === candidate.v && current.lane === candidate.lane && current.daemonVersion === candidate.daemonVersion && current.bundleId === candidate.bundleId && current.desiredState === candidate.desiredState && current.serviceController === candidate.serviceController && current.autoStart === candidate.autoStart && current.gatewayUrl === candidate.gatewayUrl && current.ownerUserId === candidate.ownerUserId && current.profileId === candidate.profileId && current.deviceId === candidate.deviceId && current.connectedComputerId === candidate.connectedComputerId && current.heartbeatMs === candidate.heartbeatMs;
13511
13518
  }
13512
13519
 
13513
13520
  //#endregion
@@ -16438,6 +16445,7 @@ async function writeDaemonServiceContract(input) {
16438
16445
  autoStart: input.autoStart,
16439
16446
  desiredState: input.desiredState,
16440
16447
  deviceId: contract.deviceId,
16448
+ ...contract.ownerUserId ? { ownerUserId: contract.ownerUserId } : {},
16441
16449
  ...contract.profileId ? { profileId: contract.profileId } : {},
16442
16450
  serviceController: contract.serviceController
16443
16451
  }
@@ -16456,6 +16464,7 @@ function requireCompleteContractInput(input) {
16456
16464
  serviceController: input.serviceController,
16457
16465
  autoStart: input.autoStart,
16458
16466
  gatewayUrl: input.gatewayUrl,
16467
+ ...input.ownerUserId ? { ownerUserId: input.ownerUserId } : {},
16459
16468
  ...input.profileId ? { profileId: input.profileId } : {},
16460
16469
  deviceId: input.deviceId,
16461
16470
  ...input.connectedComputerId ? { connectedComputerId: input.connectedComputerId } : {},
@@ -28545,6 +28554,18 @@ async function resolveLifecycleCommandOptions(input) {
28545
28554
  const preferCommandGateway = shouldPreferCommandResolvedGatewayForLifecycle();
28546
28555
  const gatewayUrl = explicitGatewayUrl ?? (preferCommandGateway ? commandGatewayUrl : null) ?? normalizeGatewayBaseUrlOrNull(currentContract?.gatewayUrl) ?? normalizeGatewayBaseUrlOrNull(runtimeSnapshot?.gatewayUrl) ?? commandGatewayUrl;
28547
28556
  const atsProfileId = normalizeOptionalText$28(input.profile) ?? normalizeOptionalText$28(runtimeSnapshot?.atsProfileId) ?? fallbackProfile?.atsProfileId ?? reusableCurrentContract?.profileId;
28557
+ let ownerUserId = fallbackProfile && fallbackProfile.atsProfileId === atsProfileId ? normalizeOptionalText$28(fallbackProfile.ownerUserId) : null;
28558
+ if (!ownerUserId && atsProfileId) {
28559
+ const resolvedProfile = await resolveAtsProfileOrNull({
28560
+ atsProfileId,
28561
+ allowDefaultFallback: false,
28562
+ allowUnauthenticated: true,
28563
+ persistSelection: false
28564
+ }).catch(() => null);
28565
+ if (resolvedProfile?.atsProfileId === atsProfileId) ownerUserId = normalizeOptionalText$28(resolvedProfile.ownerUserId);
28566
+ }
28567
+ if (!ownerUserId && reusableCurrentContract && reusableCurrentContract.profileId === atsProfileId) ownerUserId = normalizeOptionalText$28(reusableCurrentContract.ownerUserId);
28568
+ if (!ownerUserId && !atsProfileId) ownerUserId = normalizeOptionalText$28(reusableCurrentContract?.ownerUserId);
28548
28569
  const shouldDiscardPersistedDeviceId = resolveAtsEnvPreset() === "prod" ? isUnsafeProductionDeviceId : void 0;
28549
28570
  const deviceId = runtimePaths ? await resolveDaemonDeviceId({
28550
28571
  deviceId: resolvePreferredDaemonDeviceId({
@@ -28558,6 +28579,7 @@ async function resolveLifecycleCommandOptions(input) {
28558
28579
  return {
28559
28580
  environmentTarget,
28560
28581
  ...gatewayUrl ? { gatewayUrl } : {},
28582
+ ...ownerUserId ? { ownerUserId } : {},
28561
28583
  ...atsProfileId ? { atsProfileId } : {},
28562
28584
  ...deviceId ? { deviceId } : {},
28563
28585
  ...typeof heartbeatMs === "number" ? { heartbeatMs } : {}
@@ -28636,7 +28658,8 @@ async function ensureLifecycleServiceContract(input) {
28636
28658
  serviceController: input.serviceController,
28637
28659
  autoStart: input.desiredState === "background",
28638
28660
  gatewayUrl: input.commandOptions.gatewayUrl ?? null,
28639
- profileId: input.commandOptions.atsProfileId ?? null,
28661
+ ...input.commandOptions.ownerUserId ? { ownerUserId: input.commandOptions.ownerUserId } : {},
28662
+ ...input.commandOptions.atsProfileId ? { profileId: input.commandOptions.atsProfileId } : {},
28640
28663
  deviceId: input.commandOptions.deviceId ?? null,
28641
28664
  heartbeatMs: input.commandOptions.heartbeatMs ?? input.currentContract?.heartbeatMs ?? null,
28642
28665
  ...reusableCurrentContract ? { lane: reusableCurrentContract.lane } : {}
@@ -28662,7 +28685,8 @@ async function restoreLifecycleServiceContractSnapshot(snapshot) {
28662
28685
  serviceController: snapshot.serviceController,
28663
28686
  autoStart: snapshot.autoStart,
28664
28687
  gatewayUrl: snapshot.gatewayUrl,
28665
- profileId: snapshot.profileId,
28688
+ ...snapshot.ownerUserId ? { ownerUserId: snapshot.ownerUserId } : {},
28689
+ ...snapshot.profileId ? { profileId: snapshot.profileId } : {},
28666
28690
  deviceId: snapshot.deviceId,
28667
28691
  ...snapshot.connectedComputerId ? { connectedComputerId: snapshot.connectedComputerId } : {},
28668
28692
  heartbeatMs: snapshot.heartbeatMs,
@@ -47972,6 +47996,7 @@ async function runDaemonInstall(input, options = {}) {
47972
47996
  runtimeStatus,
47973
47997
  autoStart: desiredState === "background" && runtimeStatus !== null,
47974
47998
  atsProfileId: input.profile,
47999
+ contractProfileId: input.profile,
47975
48000
  allowDetachedFallback: serviceManager === null
47976
48001
  });
47977
48002
  }
@@ -48226,6 +48251,8 @@ async function performDaemonReinstall(input) {
48226
48251
  forceReinstall: true,
48227
48252
  drainWaitMs: input.resolved.drainWaitMs,
48228
48253
  forceKillAfterDrainTimeout,
48254
+ ...input.gatewayUrl ? { gatewayUrl: input.gatewayUrl } : {},
48255
+ ...input.profile ? { profile: input.profile } : {},
48229
48256
  ...input.resolved.cliScriptPath ? { cliScriptPath: input.resolved.cliScriptPath } : {}
48230
48257
  });
48231
48258
  try {
@@ -48260,13 +48287,17 @@ async function performDaemonReinstall(input) {
48260
48287
  });
48261
48288
  await applyDaemonReinstallTargetDesiredState({
48262
48289
  runtime: input.runtime,
48263
- desiredState: reinstallTargetDesiredState
48290
+ desiredState: reinstallTargetDesiredState,
48291
+ gatewayUrl: input.gatewayUrl,
48292
+ profile: input.profile
48264
48293
  });
48265
48294
  return await completeDaemonReinstallStart({
48266
48295
  runtime: input.runtime,
48267
48296
  resolved: input.resolved,
48268
48297
  forceUsed,
48269
- targetDesiredState: reinstallTargetDesiredState
48298
+ targetDesiredState: reinstallTargetDesiredState,
48299
+ gatewayUrl: input.gatewayUrl,
48300
+ profile: input.profile
48270
48301
  });
48271
48302
  } catch (error) {
48272
48303
  if (isAtsLockError(error)) return createDaemonReinstallInProgressOutcome(error.meta, input.displayAction);
@@ -48402,6 +48433,9 @@ async function applyDaemonReinstallTargetDesiredState(input) {
48402
48433
  desiredState: "background",
48403
48434
  serviceController: serviceManager?.controller,
48404
48435
  autoStart: true,
48436
+ gatewayUrl: input.gatewayUrl,
48437
+ atsProfileId: input.profile,
48438
+ contractProfileId: input.profile,
48405
48439
  allowDetachedFallback: serviceManager === null
48406
48440
  });
48407
48441
  }
@@ -49670,7 +49704,7 @@ async function confirmStopServiceManager(runtime, runtimeStatus) {
49670
49704
  }) === true;
49671
49705
  }
49672
49706
  async function resolveDaemonRunAuthReadiness(input) {
49673
- const authState = await getAuthSessionState({ validateRemote: false }).catch(() => null);
49707
+ const authState = await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch(() => null);
49674
49708
  const session = authState?.session ?? null;
49675
49709
  if (authState?.state !== "valid" || !session) return {
49676
49710
  ready: false,
@@ -50725,6 +50759,7 @@ async function runSystemDaemonCore(context) {
50725
50759
  }
50726
50760
  const preflight = null;
50727
50761
  const daemonAtsProfileId = runConfig.atsProfileId;
50762
+ const contractAtsProfileId = runConfig.contractAtsProfileId;
50728
50763
  const inventoryRunResult = await maybeResolveRunResultFromDaemonInventory({
50729
50764
  daemonVersion,
50730
50765
  preflight,
@@ -50733,6 +50768,7 @@ async function runSystemDaemonCore(context) {
50733
50768
  runtime,
50734
50769
  gatewayUrl: runConfig.gatewayUrl,
50735
50770
  atsProfileId: daemonAtsProfileId,
50771
+ contractAtsProfileId,
50736
50772
  deviceId: runConfig.deviceId,
50737
50773
  heartbeatMs: runConfig.heartbeatMs,
50738
50774
  isSystemServiceBootstrap
@@ -50788,6 +50824,7 @@ async function runSystemDaemonCore(context) {
50788
50824
  mode,
50789
50825
  gatewayUrl: runConfig.gatewayUrl,
50790
50826
  atsProfileId: daemonAtsProfileId,
50827
+ contractAtsProfileId,
50791
50828
  deviceId: runConfig.deviceId,
50792
50829
  heartbeatMs: runConfig.heartbeatMs
50793
50830
  });
@@ -50814,6 +50851,7 @@ async function maybeResolveRunResultFromDaemonInventory(input) {
50814
50851
  autoStart: inventory.serviceManager !== null,
50815
50852
  gatewayUrl: input.gatewayUrl,
50816
50853
  atsProfileId: input.atsProfileId,
50854
+ contractProfileId: input.contractAtsProfileId,
50817
50855
  deviceId: input.deviceId,
50818
50856
  heartbeatMs: input.heartbeatMs
50819
50857
  });
@@ -50852,6 +50890,7 @@ async function runDaemonBackgroundStart(input) {
50852
50890
  autoStart: false,
50853
50891
  gatewayUrl: input.gatewayUrl,
50854
50892
  atsProfileId: input.atsProfileId,
50893
+ contractProfileId: input.contractAtsProfileId,
50855
50894
  deviceId: input.deviceId,
50856
50895
  heartbeatMs: input.heartbeatMs
50857
50896
  });
@@ -50879,6 +50918,7 @@ async function runDaemonBackgroundStart(input) {
50879
50918
  autoStart: true,
50880
50919
  gatewayUrl: input.gatewayUrl,
50881
50920
  atsProfileId: input.atsProfileId,
50921
+ contractProfileId: input.contractAtsProfileId,
50882
50922
  deviceId: input.deviceId,
50883
50923
  heartbeatMs: input.heartbeatMs
50884
50924
  });
@@ -51049,6 +51089,11 @@ async function maybeWriteDaemonServiceContract(input) {
51049
51089
  }),
51050
51090
  deviceIdPath: runtimePaths.deviceIdPath
51051
51091
  }).catch(() => reusableCurrentContract?.deviceId ?? null) : normalizeOptionalText$28(input.deviceId) ?? reusableCurrentContract?.deviceId ?? null;
51092
+ const resolvedProfileId = normalizeOptionalText$28(input.contractProfileId);
51093
+ const resolvedOwnerUserId = await resolveDaemonServiceContractOwnerUserId({
51094
+ currentContract,
51095
+ atsProfileId: resolvedProfileId
51096
+ });
51052
51097
  const writeResult = await writeDaemonServiceContract({
51053
51098
  daemonVersion,
51054
51099
  bundleId,
@@ -51056,6 +51101,8 @@ async function maybeWriteDaemonServiceContract(input) {
51056
51101
  serviceController,
51057
51102
  autoStart: input.autoStart,
51058
51103
  gatewayUrl: resolvedGatewayUrl,
51104
+ ...resolvedOwnerUserId ? { ownerUserId: resolvedOwnerUserId } : {},
51105
+ ...resolvedProfileId ? { profileId: resolvedProfileId } : {},
51059
51106
  deviceId: resolvedDeviceId,
51060
51107
  heartbeatMs: input.heartbeatMs ?? currentContract?.heartbeatMs ?? null,
51061
51108
  ...reusableCurrentContract ? { lane: reusableCurrentContract.lane } : {}
@@ -51063,6 +51110,22 @@ async function maybeWriteDaemonServiceContract(input) {
51063
51110
  if (writeResult.status === "skipped_missing_fields") return null;
51064
51111
  return writeResult.contract;
51065
51112
  }
51113
+ async function resolveDaemonServiceContractOwnerUserId(input) {
51114
+ const profileId = normalizeOptionalText$28(input.atsProfileId);
51115
+ if (profileId) {
51116
+ const selectedProfile = getCurrentCommandCheckState().selectedProfile;
51117
+ if (selectedProfile?.atsProfileId === profileId) return normalizeOptionalText$28(selectedProfile.profile.ownerUserId) ?? void 0;
51118
+ return normalizeOptionalText$28((await resolveAtsProfileOrNull({
51119
+ atsProfileId: profileId,
51120
+ allowDefaultFallback: false,
51121
+ allowUnauthenticated: true,
51122
+ persistSelection: false
51123
+ }).catch(() => null))?.ownerUserId) ?? void 0;
51124
+ }
51125
+ const authOwnerUserId = normalizeOptionalText$28((await Promise.resolve(getAuthSessionState({ validateRemote: false })).catch(() => null))?.session?.user?.id);
51126
+ if (authOwnerUserId) return authOwnerUserId;
51127
+ return normalizeOptionalText$28(input.currentContract?.ownerUserId) ?? void 0;
51128
+ }
51066
51129
  async function stageDaemonBackgroundServiceContract(input) {
51067
51130
  const previousContract = await readDaemonServiceContract().catch(() => null);
51068
51131
  if (!await maybeWriteDaemonServiceContract(input)) return { rollback: async () => void 0 };
@@ -51104,7 +51167,8 @@ async function maybeWriteDaemonStoppedContract(input) {
51104
51167
  serviceController: reusableCurrentContract.serviceController,
51105
51168
  autoStart: false,
51106
51169
  gatewayUrl: reusableCurrentContract.gatewayUrl,
51107
- profileId: reusableCurrentContract.profileId,
51170
+ ...reusableCurrentContract.ownerUserId ? { ownerUserId: reusableCurrentContract.ownerUserId } : {},
51171
+ ...reusableCurrentContract.profileId ? { profileId: reusableCurrentContract.profileId } : {},
51108
51172
  deviceId: reusableCurrentContract.deviceId,
51109
51173
  ...reusableCurrentContract.connectedComputerId ? { connectedComputerId: reusableCurrentContract.connectedComputerId } : {},
51110
51174
  heartbeatMs: reusableCurrentContract.heartbeatMs,
@@ -51138,7 +51202,8 @@ async function restoreDaemonServiceContractSnapshot(snapshot) {
51138
51202
  serviceController: snapshot.serviceController,
51139
51203
  autoStart: snapshot.autoStart,
51140
51204
  gatewayUrl: snapshot.gatewayUrl,
51141
- profileId: snapshot.profileId,
51205
+ ...snapshot.ownerUserId ? { ownerUserId: snapshot.ownerUserId } : {},
51206
+ ...snapshot.profileId ? { profileId: snapshot.profileId } : {},
51142
51207
  deviceId: snapshot.deviceId,
51143
51208
  ...snapshot.connectedComputerId ? { connectedComputerId: snapshot.connectedComputerId } : {},
51144
51209
  heartbeatMs: snapshot.heartbeatMs,
@@ -51303,6 +51368,7 @@ async function resolveContractFirstDaemonRunConfig(input) {
51303
51368
  return {
51304
51369
  gatewayUrl: bootstrapContract?.gatewayUrl,
51305
51370
  atsProfileId: bootstrapContract?.profileId,
51371
+ ...bootstrapContract?.profileId ? { contractAtsProfileId: bootstrapContract.profileId } : {},
51306
51372
  deviceId: bootstrapContract?.deviceId,
51307
51373
  heartbeatMs: bootstrapContract?.heartbeatMs,
51308
51374
  bootstrapContract
@@ -51322,6 +51388,7 @@ async function resolveSystemBootstrapDaemonContract(input) {
51322
51388
  autoStart: systemManager !== null,
51323
51389
  gatewayUrl: explicitGatewayUrl,
51324
51390
  atsProfileId: input.atsProfileId,
51391
+ contractProfileId: input.atsProfileId,
51325
51392
  deviceId: input.deviceId,
51326
51393
  heartbeatMs: input.heartbeatMs,
51327
51394
  allowDetachedFallback: systemManager === null
@@ -52836,17 +52903,27 @@ async function runDaemonServiceParticipationRefresh(input) {
52836
52903
  }
52837
52904
  async function resolveDaemonServiceAccountAlignmentIssue(input) {
52838
52905
  const expectedProfileId = normalizeOptionalText$10(input.atsProfileId);
52906
+ const expectedOwnerUserId = normalizeOptionalText$10(input.expectedOwnerUserId);
52839
52907
  const expectedGatewayUrl = normalizeGatewayBaseUrlOrNull(input.gatewayUrl);
52840
- if (!(expectedProfileId || expectedGatewayUrl)) return null;
52908
+ if (!(expectedProfileId || expectedOwnerUserId || expectedGatewayUrl)) return null;
52841
52909
  const contract = await readDaemonServiceContract().catch(() => null);
52842
52910
  if (!contract) return {
52843
52911
  reasonCode: "service_contract.missing",
52844
52912
  summary: "ATS Service is running, but this setup could not verify the service account contract for this computer."
52845
52913
  };
52914
+ const contractOwnerUserId = normalizeOptionalText$10(contract.ownerUserId);
52915
+ if (expectedOwnerUserId && contractOwnerUserId && contractOwnerUserId !== expectedOwnerUserId) return {
52916
+ reasonCode: "service_contract.owner_mismatch",
52917
+ summary: "ATS Service is running for a different ATS account. This setup will reconnect ATS Service to the current Web account."
52918
+ };
52846
52919
  if (expectedProfileId && contract.profileId && contract.profileId !== expectedProfileId) return {
52847
52920
  reasonCode: "service_contract.profile_mismatch",
52848
52921
  summary: "ATS Service is running for a different ATS account. This setup will reconnect ATS Service to the current Web account."
52849
52922
  };
52923
+ if (expectedOwnerUserId && expectedProfileId && !(contractOwnerUserId || contract.profileId)) return {
52924
+ reasonCode: "service_contract.owner_unverified",
52925
+ summary: "ATS Service is running, but this setup could not verify that ATS Service belongs to the current Web account. This setup will reconnect ATS Service to the current Web account."
52926
+ };
52850
52927
  const contractGatewayUrl = normalizeGatewayBaseUrlOrNull(contract.gatewayUrl);
52851
52928
  if (expectedGatewayUrl && contractGatewayUrl && contractGatewayUrl !== expectedGatewayUrl) return {
52852
52929
  reasonCode: "service_contract.gateway_mismatch",
@@ -88876,7 +88953,8 @@ async function writeConnectedComputerEnrollmentToServiceContract(input) {
88876
88953
  gatewayUrl: input.serviceContract.gatewayUrl,
88877
88954
  heartbeatMs: input.serviceContract.heartbeatMs,
88878
88955
  lane: input.serviceContract.lane,
88879
- profileId: input.serviceContract.profileId,
88956
+ ...input.serviceContract.ownerUserId ? { ownerUserId: input.serviceContract.ownerUserId } : {},
88957
+ ...input.serviceContract.profileId ? { profileId: input.serviceContract.profileId } : {},
88880
88958
  serviceController: input.serviceContract.serviceController
88881
88959
  });
88882
88960
  }
@@ -89166,6 +89244,7 @@ async function executeSelectedAgentPreparation(input) {
89166
89244
  humanProfileId: snapshot.humanProfileId,
89167
89245
  input: input.input,
89168
89246
  localAgentIds: snapshot.selectedLocalAgentIds,
89247
+ ownerUserId: snapshot.ownerUserId,
89169
89248
  stepId
89170
89249
  });
89171
89250
  snapshot = await runTerminalStep({
@@ -89280,6 +89359,7 @@ function buildTerminalStep(input) {
89280
89359
  autoRepair: true,
89281
89360
  gatewayUrl: input.input.gatewayUrl,
89282
89361
  ...input.humanProfileId ? { atsProfileId: input.humanProfileId } : {},
89362
+ ...input.ownerUserId ? { expectedOwnerUserId: input.ownerUserId } : {},
89283
89363
  forcePrompt: true,
89284
89364
  view: input.input.view
89285
89365
  });