agent-transport-system 0.4.7 → 0.4.8

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-BpLCoUUk.js";
4
- import { v as DEV_LOCAL_GATEWAY_BASE_URL } from "./runtime-config-C1-AIbb-.js";
3
+ import "./lock-Ba3w5EZN.js";
4
+ import { v as DEV_LOCAL_GATEWAY_BASE_URL } from "./runtime-config-DGAxTtv2.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 getAgentExecutionReadinessResponseSchema, $n as atsRuntimeProfileIdSchema, $t as spaceConversationBindingDeleteResponseSchema, A as claimExecutionDiagnosticsResponseSchema, An as writeStartObservedDeviceMetadataResponseSchema, Ar as resolveSpaceMentionLabels, At as patchStartSessionBodySchema, B as daemonRouteObservationResponseSchema, Bn as DAEMON_HUB_SCHEMA_VERSION, Bt as providerDispatchRuntimeContextSchema, C as atsdControlPlaneRequestSchema, Cn as writeCurrentDeviceBootstrapObservationBodySchema, Cr as normalizeOptionalWorkingDirectory, Ct as notifyAgentProfileRouteCatalogChangedBodySchema, D as canonicalizeControllerRefForKind, Dn as writeStartObservationBodySchema, Dr as resolveBuiltinUpstreamConversationRefKind, Dt as patchProfileSpaceHistoryStatusResponseSchema, E as canonicalizeBuiltinControllerRef, En as writeCurrentDeviceObservedMetadataResponseSchema, Er as profileWorkspaceModeSchema, Et as ownedDevicesResponseSchema, F as createSpaceResponseSchema, Fn as AGENT_REPLY_PREVIEW_END_PURPOSE, Ft as postSpaceThreadSignalBodySchema, G as entryBriefSchema, Gn as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Gt as resolveBuiltinProviderConversationCapability, H as dispatchBriefSchema, Hn as DISPATCH_ACTIVITY_FAILED_PURPOSE, Ht as removeSpaceMembersResponseSchema, I as createSpaceThreadBodySchema, In as AGENT_REPLY_PREVIEW_PURPOSE, It as postSpaceThreadSignalResponseSchema, J as forgetCurrentComputerResponseSchema, Jn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Jt as serverErrorFrameSchema, K as finalClaimRouteParamsSchema, Kn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, Kt as resolveStartHandoffBodySchema, L as createSpaceThreadResponseSchema, Ln as ATSD_TASK_RESULT_SCHEMA_VERSION, Lt as prepareSessionResponseSchema, M as createSpaceBodySchema, Mn as writeStartSessionProgressResponseSchema, Mt as postNormalMessageResponseSchema, N as createSpaceDiagnosticReportBodySchema, Nn as AGENT_REPLYING_END_PURPOSE, Nr as sanitizeSignalTextPreview, Nt as postSpaceMembersBodySchema, O as catchupResponseSchema, On as writeStartObservationResponseSchema, Or as resolveMessageEnvelopeTargetField, Ot as patchSpaceContractBodySchema, P as createSpaceDiagnosticReportResponseSchema, Pn as AGENT_REPLYING_PURPOSE, Pt as postSpaceMembersResponseSchema, Q as getAgentExecutionReadinessBatchResponseSchema, Qn as SPACE_UPDATES_MAX_LIMIT, Qt as spaceConversationBindingConflictResponseSchema, R as createStartSessionBodySchema, Rn as CONVERSATION_CONTINUITY_WARNING_PURPOSE, Rt as prepareSessionStreamServerFrameSchema, S as atsRequestContextSchema, Sn as upsertSpaceDeletionTombstoneResponseSchema, Sr as normalizeMessageEnvelope, St as normalizeSpaceCursorPatch, T as buildControllerRoutingKeyForKind, Tn as writeCurrentDeviceObservedMetadataBodySchema, Tr as parseOptionalClientMessageId, Tt as observabilityWakeTraceSelectorSchema, U as ensureAgentProfilePrimaryBindingBodySchema, Un as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Ut as reserveFinalClaimBodySchema, V as daemonRuntimeLeaseSchema, Vn as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Vt as querySpaceDeletionTombstonesResponseSchema, W as ensureAgentProfilePrimaryBindingResponseSchema, Wn as LEGACY_RUNTIME_DISPATCH_POLICY, Wt as reserveFinalClaimResponseSchema, X as gatewayErrorEnvelopeSchema, Xn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Xt as setOwnedDeviceDisplayNameBodySchema, Y as gatewayErrorCodeSchema, Yn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, Yt as setCurrentDeviceTargetBodySchema, Z as getAgentExecutionReadinessBatchBodySchema, Zn as SPACE_PASSWORD_MIN_LENGTH, Zt as signalEnvelopeSchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as submitRuntimeCapabilityReportsBodySchema, _r as daemonHubSubmitTaskResultRequestSchema, _t as listSpaceThreadSignalsResponseSchema, a as runWithHeldLock, an as spaceMembersSnapshotSchema, ar as collectCanonicalMentionTextFragments, at as getSpaceConversationStatusResponseSchema, b as agentProfileBindingRouteParamsSchema, bn as submitRuntimeRegistrationResponseSchema, br as formatCanonicalMentionLiteral, bt as normalizeBuiltinControllerProviderId, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as startDeviceProjectionSchema, cr as daemonHubDeliverDispatchRequestSchema, ct as getSpaceStatusResponseSchema, d as resolveRuntimeSession, dn as startSessionResponseSchema, dr as daemonHubDispatchPreviewRequestSchema, dt as getSpaceWakeProgressResponseSchema, en as spaceConversationBindingImportResponseSchema, er as atsSpaceEgressActionSchema, et as getAgentProfilePrimaryBindingResponseSchema, f as resolveRuntimeSessionId, fn as startSessionSpaceChoiceBodySchema, fr as daemonHubHeartbeatRequestSchema, ft as incomingServerMessageSchema, g as resolveMappedPublicAgentFailureReason, gn as structuredGuidePayloadFromInputSchema, gr as daemonHubRouteCatalogChangedFramePayloadSchema, gt as listSpaceThreadEventsResponseSchema, h as resolveBuiltinAgentControllerBrand, hn as startStateResponseSchema, hr as daemonHubRegisterSessionResponseSchema, ht as listProfileSpaceHistoryResponseSchema, i as releaseLock, in as spaceDispatchTraceResponseSchema, ir as buildUpstreamConversationRef, it as getSpaceConversationRemoteStatusResponseSchema, j as continuitySchema, jn as writeStartSessionProgressBodySchema, jt as postNormalMessageBodySchema, k as claimExecutionDiagnosticsQuerySchema, kn as writeStartObservedDeviceMetadataBodySchema, kr as resolveSingleSpaceMentionLabels, kt as patchSpaceContractResponseSchema, l as listRuntimeSessionStates, ln as startProfileReadinessSummarySchema, lr as daemonHubDispatchLifecycleRequestSchema, lt as getSpaceThreadResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as startSessionWithTokenResponseSchema, mr as daemonHubRegisterSessionRequestSchema, mt as leaveSpaceResponseSchema, n as isAtsLockError, nn as spaceConversationBindingUpsertResponseSchema, nr as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, nt as getPrepareReadinessResponseSchema, o as tryCleanupStaleLock, on as spaceMetaSchema, or as conversationExecutionStateSchema, ot as getSpaceDispatchLookupResponseSchema, p as writeRuntimeSessionState, pn as startSessionSpaceChoiceResponseSchema, pr as daemonHubHeartbeatResponseSchema, pt as isExplicitBuiltinControllerRef, q as forgetComputerResponseSchema, qn as MESSAGE_MENTION_TYPE_VALUES, qt as resolveStartHandoffResponseSchema, r as readLockMeta, rn as spaceCreatorSchema, rr as atsdTaskResultPayloadSchema, rt as getSpaceContractResponseSchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as spaceViewerMembershipResponseSchema, sr as createDaemonRouteObservationSummary, st as getSpaceDispatchResultResponseSchema, t as acquireLock, tn as spaceConversationBindingResponseSchema, tr as atsdTaskResultEnvelopeWriteSchema, tt as getPrepareReadinessQuerySchema, u as readRuntimeSessionState, un as startSessionProgressSchema, ur as daemonHubDispatchPreviewEndRequestSchema, ut as getSpaceUpdatesResponseSchema, v as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, vn as submitRuntimeCapabilityReportsResponseSchema, vr as daemonServiceContractSchema, vt as listSpaceThreadsResponseSchema, w as atsdControlPlaneResponseSchema, wn as writeCurrentDeviceBootstrapObservationResponseSchema, wr as normalizeSpacePasswordText, wt as notifyAgentProfileRouteCatalogChangedResponseSchema, x as atsProfileIdSchema, xn as upsertProfileSpaceHistoryResponseSchema, xr as getSpaceMessageAddressingRelationSupportForTargetKind, xt as normalizeListSignalsReadQuerySemantics, y as agentExecutionReadinessRouteParamsSchema, yn as submitRuntimeRegistrationBodySchema, yr as daemonStreamFrameSchema, yt as normalizeBuiltinControllerAgentId, z as currentDeviceTargetResponseSchema, zn as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, zt as projectObservabilityWakeCorrelation } from "./lock-BpLCoUUk.js";
3
+ import { $ as getAgentExecutionReadinessBatchResponseSchema, $n as SPACE_UPDATES_MAX_LIMIT, $t as spaceConversationBindingConflictResponseSchema, A as claimExecutionDiagnosticsResponseSchema, An as writeStartObservedDeviceMetadataBodySchema, Ar as resolveSingleSpaceMentionLabels, At as patchSpaceContractResponseSchema, B as daemonRouteObservationResponseSchema, Bn as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, Bt as projectObservabilityWakeCorrelation, C as atsdControlPlaneRequestSchema, Cn as upsertSpaceDeletionTombstoneResponseSchema, Cr as normalizeMessageEnvelope, Ct as normalizeSpaceCursorPatch, D as canonicalizeControllerRefForKind, Dn as writeCurrentDeviceObservedMetadataResponseSchema, Dr as profileWorkspaceModeSchema, Dt as ownedDevicesResponseSchema, E as canonicalizeBuiltinControllerRef, En as writeCurrentDeviceObservedMetadataBodySchema, Er as parseOptionalClientMessageId, Et as observabilityWakeTraceSelectorSchema, F as createSpaceResponseSchema, Fn as AGENT_REPLYING_PURPOSE, Ft as postSpaceMembersResponseSchema, G as ensureAgentProfilePrimaryBindingResponseSchema, Gn as LEGACY_RUNTIME_DISPATCH_POLICY, Gt as reserveFinalClaimResponseSchema, H as deleteSpaceResponseSchema, Hn as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Ht as querySpaceDeletionTombstonesResponseSchema, I as createSpaceThreadBodySchema, In as AGENT_REPLY_PREVIEW_END_PURPOSE, It as postSpaceThreadSignalBodySchema, J as forgetComputerResponseSchema, Jn as MESSAGE_MENTION_TYPE_VALUES, Jt as resolveStartHandoffResponseSchema, K as entryBriefSchema, Kn as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Kt as resolveBuiltinProviderConversationCapability, L as createSpaceThreadResponseSchema, Ln as AGENT_REPLY_PREVIEW_PURPOSE, Lt as postSpaceThreadSignalResponseSchema, M as createSpaceBodySchema, Mn as writeStartSessionProgressBodySchema, Mt as postNormalMessageBodySchema, N as createSpaceDiagnosticReportBodySchema, Nn as writeStartSessionProgressResponseSchema, Nt as postNormalMessageResponseSchema, O as catchupResponseSchema, On as writeStartObservationBodySchema, Or as resolveBuiltinUpstreamConversationRefKind, Ot as patchProfileSpaceHistoryStatusResponseSchema, P as createSpaceDiagnosticReportResponseSchema, Pn as AGENT_REPLYING_END_PURPOSE, Pr as sanitizeSignalTextPreview, Pt as postSpaceMembersBodySchema, Q as getAgentExecutionReadinessBatchBodySchema, Qn as SPACE_PASSWORD_MIN_LENGTH, Qt as signalEnvelopeSchema, R as createStartSessionBodySchema, Rn as ATSD_TASK_RESULT_SCHEMA_VERSION, Rt as prepareSessionResponseSchema, S as atsRequestContextSchema, Sn as upsertProfileSpaceHistoryResponseSchema, Sr as getSpaceMessageAddressingRelationSupportForTargetKind, St as normalizeListSignalsReadQuerySemantics, T as buildControllerRoutingKeyForKind, Tn as writeCurrentDeviceBootstrapObservationResponseSchema, Tr as normalizeSpacePasswordText, Tt as notifyAgentProfileRouteCatalogChangedResponseSchema, U as dispatchBriefSchema, Un as DISPATCH_ACTIVITY_FAILED_PURPOSE, Ut as removeSpaceMembersResponseSchema, V as daemonRuntimeLeaseSchema, Vn as DAEMON_HUB_SCHEMA_VERSION, Vt as providerDispatchRuntimeContextSchema, W as ensureAgentProfilePrimaryBindingBodySchema, Wn as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Wt as reserveFinalClaimBodySchema, X as gatewayErrorCodeSchema, Xn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, Xt as setCurrentDeviceTargetBodySchema, Y as forgetCurrentComputerResponseSchema, Yn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Yt as serverErrorFrameSchema, Z as gatewayErrorEnvelopeSchema, Zn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Zt as setOwnedDeviceDisplayNameBodySchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as structuredGuidePayloadFromInputSchema, _r as daemonHubRouteCatalogChangedFramePayloadSchema, _t as listSpaceThreadEventsResponseSchema, a as runWithHeldLock, an as spaceDispatchTraceResponseSchema, ar as buildUpstreamConversationRef, at as getSpaceConversationRemoteStatusResponseSchema, b as agentProfileBindingRouteParamsSchema, bn as submitRuntimeRegistrationBodySchema, br as daemonStreamFrameSchema, bt as normalizeBuiltinControllerAgentId, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as spaceViewerMembershipResponseSchema, cr as createDaemonRouteObservationSummary, ct as getSpaceDispatchResultResponseSchema, d as resolveRuntimeSession, dn as startSessionProgressSchema, dr as daemonHubDispatchPreviewEndRequestSchema, dt as getSpaceUpdatesResponseSchema, en as spaceConversationBindingDeleteResponseSchema, er as atsRuntimeProfileIdSchema, et as getAgentExecutionReadinessResponseSchema, f as resolveRuntimeSessionId, fn as startSessionResponseSchema, fr as daemonHubDispatchPreviewRequestSchema, ft as getSpaceWakeProgressResponseSchema, g as resolveMappedPublicAgentFailureReason, gn as startStateResponseSchema, gr as daemonHubRegisterSessionResponseSchema, gt as listProfileSpaceHistoryResponseSchema, h as resolveBuiltinAgentControllerBrand, hn as startSessionWithTokenResponseSchema, hr as daemonHubRegisterSessionRequestSchema, ht as leaveSpaceResponseSchema, i as releaseLock, in as spaceCreatorSchema, ir as atsdTaskResultPayloadSchema, it as getSpaceContractResponseSchema, j as continuitySchema, jn as writeStartObservedDeviceMetadataResponseSchema, jr as resolveSpaceMentionLabels, jt as patchStartSessionBodySchema, k as claimExecutionDiagnosticsQuerySchema, kn as writeStartObservationResponseSchema, kr as resolveMessageEnvelopeTargetField, kt as patchSpaceContractBodySchema, l as listRuntimeSessionStates, ln as startDeviceProjectionSchema, lr as daemonHubDeliverDispatchRequestSchema, lt as getSpaceStatusResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as startSessionSpaceChoiceResponseSchema, mr as daemonHubHeartbeatResponseSchema, mt as isExplicitBuiltinControllerRef, n as isAtsLockError, nn as spaceConversationBindingResponseSchema, nr as atsdTaskResultEnvelopeWriteSchema, nt as getPrepareReadinessQuerySchema, o as tryCleanupStaleLock, on as spaceMembersSnapshotSchema, or as collectCanonicalMentionTextFragments, ot as getSpaceConversationStatusResponseSchema, p as writeRuntimeSessionState, pn as startSessionSpaceChoiceBodySchema, pr as daemonHubHeartbeatRequestSchema, pt as incomingServerMessageSchema, q as finalClaimRouteParamsSchema, qn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, qt as resolveStartHandoffBodySchema, r as readLockMeta, rn as spaceConversationBindingUpsertResponseSchema, rr as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, rt as getPrepareReadinessResponseSchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as spaceMetaSchema, sr as conversationExecutionStateSchema, st as getSpaceDispatchLookupResponseSchema, t as acquireLock, tn as spaceConversationBindingImportResponseSchema, tr as atsSpaceEgressActionSchema, tt as getAgentProfilePrimaryBindingResponseSchema, u as readRuntimeSessionState, un as startProfileReadinessSummarySchema, ur as daemonHubDispatchLifecycleRequestSchema, ut as getSpaceThreadResponseSchema, v as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, vn as submitRuntimeCapabilityReportsBodySchema, vr as daemonHubSubmitTaskResultRequestSchema, vt as listSpaceThreadSignalsResponseSchema, w as atsdControlPlaneResponseSchema, wn as writeCurrentDeviceBootstrapObservationBodySchema, wr as normalizeOptionalWorkingDirectory, wt as notifyAgentProfileRouteCatalogChangedBodySchema, x as atsProfileIdSchema, xn as submitRuntimeRegistrationResponseSchema, xr as formatCanonicalMentionLiteral, xt as normalizeBuiltinControllerProviderId, y as agentExecutionReadinessRouteParamsSchema, yn as submitRuntimeCapabilityReportsResponseSchema, yr as daemonServiceContractSchema, yt as listSpaceThreadsResponseSchema, z as currentDeviceTargetResponseSchema, zn as CONVERSATION_CONTINUITY_WARNING_PURPOSE, zt as prepareSessionStreamServerFrameSchema } from "./lock-Ba3w5EZN.js";
4
4
  import { A as runtimeLogsDir, C as normalizeAtsProfileId, D as resolveAtsEnvPreset, E as resolveAtsCliEntryNameFromArgv, M as skillsDir, N as spacesDir, O as resolveAtsRootDir, P as systemDir, S as normalizeAccountKey, T as profileViewPath, a as accountProfileWorkspacePath, c as atsRootDir, d as deviceOpenClawProfileBootstrapPath, f as deviceOpenClawProfileDir, i as accountProfileViewPath, k as runtimeDir, 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-DyLxjg9Z.js";
5
- import { A as toSpaceCursorUrl, B as toSpaceSignalsUrl, C as resolveDefaultGatewayBaseUrl, D as toDaemonRouteObservationUrl, E as toClaimExecutionDiagnosticsUrl, F as toSpaceMembersUrl, H as toSpaceWsUrl, I as toSpaceMetaUrl, L as toSpacePasswordUrl, M as toSpaceDispatchLookupUrl, N as toSpaceDispatchTraceUrl, O as toSpaceContractUrl, P as toSpaceLeaveUrl, R as toSpaceRemoveMembersUrl, S as resolveBaseUrlOrNull, T as normalizeBaseUrl, V as toSpaceUpdatesUrl, _ as updateConfiguredStartV1OnboardingState, a as getConfiguredDeviceRuntimeState, b as normalizeGatewayBaseUrlOrNull, c as getConfiguredStartV1OnboardingState, d as resolveRuntimeSkillsCustomTargetId, f as setConfiguredBaseUrl, g as updateConfiguredSkillsConfig, h as updateConfiguredOnboardingConfig, i as getConfiguredDaemonDispatchLimits, j as toSpaceDeleteUrl, k as toSpaceCreateUrl, l as getConfiguredViewCustomization, m as updateConfiguredDeviceRuntimeState, n as alignRuntimeConfigStorage, o as getConfiguredOnboardingDisclaimerAcceptedAt, p as setConfiguredSkillsConfig, r as createDefaultRuntimeAgentControllerSettings, s as getConfiguredSkillsConfig, t as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, u as getRuntimeConfigReadHealth, w as resolveExplicitGatewayUrlOrThrow, x as resolveBaseUrl, y as normalizeGatewayBaseUrl, z as toSpaceResultUrl } from "./runtime-config-C1-AIbb-.js";
5
+ import { A as toSpaceCursorUrl, B as toSpaceSignalsUrl, C as resolveDefaultGatewayBaseUrl, D as toDaemonRouteObservationUrl, E as toClaimExecutionDiagnosticsUrl, F as toSpaceMembersUrl, H as toSpaceWsUrl, I as toSpaceMetaUrl, L as toSpacePasswordUrl, M as toSpaceDispatchLookupUrl, N as toSpaceDispatchTraceUrl, O as toSpaceContractUrl, P as toSpaceLeaveUrl, R as toSpaceRemoveMembersUrl, S as resolveBaseUrlOrNull, T as normalizeBaseUrl, V as toSpaceUpdatesUrl, _ as updateConfiguredStartV1OnboardingState, a as getConfiguredDeviceRuntimeState, b as normalizeGatewayBaseUrlOrNull, c as getConfiguredStartV1OnboardingState, d as resolveRuntimeSkillsCustomTargetId, f as setConfiguredBaseUrl, g as updateConfiguredSkillsConfig, h as updateConfiguredOnboardingConfig, i as getConfiguredDaemonDispatchLimits, j as toSpaceDeleteUrl, k as toSpaceCreateUrl, l as getConfiguredViewCustomization, m as updateConfiguredDeviceRuntimeState, n as alignRuntimeConfigStorage, o as getConfiguredOnboardingDisclaimerAcceptedAt, p as setConfiguredSkillsConfig, r as createDefaultRuntimeAgentControllerSettings, s as getConfiguredSkillsConfig, t as DEFAULT_RUNTIME_AGENT_TRANSPORT_MODE, u as getRuntimeConfigReadHealth, w as resolveExplicitGatewayUrlOrThrow, x as resolveBaseUrl, y as normalizeGatewayBaseUrl, z as toSpaceResultUrl } from "./runtime-config-DGAxTtv2.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,7 +27,7 @@ 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.4.7";
30
+ var version = "0.4.8";
31
31
  var package_default = {
32
32
  $schema: "https://www.schemastore.org/package.json",
33
33
  name: "agent-transport-system",
@@ -4014,7 +4014,7 @@ async function setDaemonServiceRuntimeState(state, pathInput = {}) {
4014
4014
  await writeDaemonServiceRuntimeState(state, pathInput);
4015
4015
  }
4016
4016
  async function clearDaemonServiceRuntimeState(pathInput = {}) {
4017
- const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-ChCq-G9h.js");
4017
+ const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-Ca09Dw7e.js");
4018
4018
  await Promise.all([rm(daemonServiceRuntimeStatePath(pathInput), { force: true }), clearDaemonRuntimeLease(pathInput)]);
4019
4019
  }
4020
4020
  async function withDaemonServiceRunLock(callback, meta = {
@@ -15728,13 +15728,13 @@ function formatBindingEvidence(projection) {
15728
15728
  }
15729
15729
  function formatLocalServiceEvidence(projection) {
15730
15730
  if (!projection.facts.service.executionCompatible) return formatPrimaryReason(projection.facts.service.reasonCodes);
15731
- if (projection.facts.localService.reachable) return projection.facts.localService.refreshable ? "ATS Service can refresh this agent's local readiness." : "ATS Service is connected for this account.";
15731
+ if (projection.facts.localService.reachable) return projection.facts.localService.refreshable ? "ATS Service can check this agent again on this computer." : "ATS Service is connected for this account.";
15732
15732
  if (projection.facts.localService.source === "not_checked") return "ATS Service has not been checked for this agent yet.";
15733
15733
  return formatPrimaryReason(projection.facts.localService.reasonCodes);
15734
15734
  }
15735
15735
  function formatRuntimeEvidence(projection) {
15736
15736
  if (projection.facts.runtime.ready) return "Local readiness is current.";
15737
- if (projection.facts.runtime.source === "missing") return "ATS has not received a current readiness report from this computer.";
15737
+ if (projection.facts.runtime.source === "missing") return "ATS needs a current setup check from this computer.";
15738
15738
  if (projection.facts.runtime.reasonCodes.includes("prepare_readiness.read_failed")) return formatPrimaryReason(projection.facts.runtime.reasonCodes);
15739
15739
  return formatPrimaryReason(projection.facts.runtime.reasonCodes);
15740
15740
  }
@@ -15748,7 +15748,7 @@ function formatClaimEvidence(projection) {
15748
15748
  if (projection.facts.claim.source === "not_checked") return "Wake has not been checked yet.";
15749
15749
  if (projection.facts.claim.executionBlocked) return formatPrimaryReason(projection.facts.claim.reasonCodes);
15750
15750
  if (projection.displayState === "ready") return "Wake is available from this computer.";
15751
- if (!projection.facts.runtime.ready) return "Wake is waiting for this computer to send a fresh local readiness report.";
15751
+ if (!projection.facts.runtime.ready) return "Wake is waiting for this computer to check local agent support again.";
15752
15752
  if (!projection.facts.binding.routable) return "Wake needs a local agent connection first.";
15753
15753
  if (!projection.facts.localService.reachable) return "Wake needs ATS Service connected for this account.";
15754
15754
  if (!projection.facts.service.executionCompatible) return "Wake needs ATS Service updated before this agent can reply.";
@@ -15768,11 +15768,11 @@ function formatReasonCodeFamily(reasonCode) {
15768
15768
  if (reasonCode.startsWith("service.") || reasonCode.startsWith("background_helper.") || reasonCode.startsWith("daemon.runtime_contract.")) return "ATS Service is not ready on this computer.";
15769
15769
  if (reasonCode.startsWith("claim_eligibility.") || reasonCode.startsWith("dispatch.claim_eligibility.")) return "Wake cannot use this local connection for this agent yet.";
15770
15770
  if (reasonCode.startsWith("runtime.capability_report_") || reasonCode.startsWith("runtime.capability_report.")) return "This computer has not reported ready local agent support yet.";
15771
- if (reasonCode.startsWith("runtime.")) return "Local readiness is not current for this agent.";
15771
+ if (reasonCode.startsWith("runtime.")) return "This computer needs a fresh check for this agent.";
15772
15772
  if (reasonCode.startsWith("agent_profile_binding.")) return "This agent's local connection needs setup.";
15773
15773
  if (reasonCode.startsWith("local_service.")) return "ATS Service is not connected for this account.";
15774
15774
  if (reasonCode.startsWith("agent_execution.route_")) return REPLY_ROUTE_RECONNECTING_REASON;
15775
- return "ATS needs more current local readiness evidence.";
15775
+ return "ATS needs a more current setup check from this computer.";
15776
15776
  }
15777
15777
  function formatNotReadyReason(projection) {
15778
15778
  if (!projection.facts.profile.active || projection.facts.profile.source === "unavailable") return formatPrimaryReason(projection.facts.profile.reasonCodes);
@@ -15796,7 +15796,7 @@ const DIFFERENT_ACCOUNT_REASON = "This agent is connected to a different ATS acc
15796
15796
  const CONFLICTING_REPLY_CONNECTION_REASON = "This agent has a conflicting reply connection.";
15797
15797
  const WAKE_REQUEST_NOT_ACTIVE_REASON = "This Wake request is no longer active.";
15798
15798
  const AGENT_NOT_IN_SPACE_REASON = "This agent is no longer available in this space.";
15799
- const LOCAL_AGENT_READINESS_STALE_REASON = "This computer's local agent readiness report is out of date.";
15799
+ const LOCAL_AGENT_READINESS_STALE_REASON = "This computer's setup check is out of date.";
15800
15800
  const REPLY_ROUTE_RECONNECTING_REASON = "ATS is checking this agent's local reply route.";
15801
15801
  const REASON_TEXT = {
15802
15802
  "agent_profile.identity_lookup_failed": "ATS could not confirm this agent profile.",
@@ -15815,7 +15815,7 @@ const REASON_TEXT = {
15815
15815
  "agent_profile_binding.read_unavailable": "ATS could not check this agent's local connection.",
15816
15816
  "local_service.identity_mismatch": "ATS Service is connected to a different local runtime for this account.",
15817
15817
  "local_service.not_connected_for_account": "ATS Service is not connected for this ATS account on this computer.",
15818
- "local_service.refresh_in_progress": "ATS Service is refreshing this agent's local readiness.",
15818
+ "local_service.refresh_in_progress": "ATS Service is checking this agent again on this computer.",
15819
15819
  "local_service.unavailable": "ATS could not check ATS Service for this account.",
15820
15820
  "claim_execution_diagnostics.lease_missing": "Wake reservation evidence is missing.",
15821
15821
  "claim_execution_diagnostics.mismatch": "Wake reservation details do not match this agent.",
@@ -15866,7 +15866,7 @@ const REASON_TEXT = {
15866
15866
  "dispatch.claim_eligibility.binding.missing": "This agent is not connected to a local agent yet.",
15867
15867
  "dispatch.claim_eligibility.binding.owner_mismatch": DIFFERENT_ACCOUNT_REASON,
15868
15868
  "final_claim.rejected": "ATS could not reserve this agent for Wake.",
15869
- "prepare_readiness.read_failed": "ATS could not check local readiness.",
15869
+ "prepare_readiness.read_failed": "ATS could not check this computer for local agent support.",
15870
15870
  "background_helper.update_required": SERVICE_UPDATE_REQUIRED_REASON,
15871
15871
  "runtime.capability_ref_invalid": "ATS could not identify this local agent capability.",
15872
15872
  "runtime.capability_report_disabled": "This local agent is turned off on this computer.",
@@ -15879,7 +15879,7 @@ const REASON_TEXT = {
15879
15879
  "runtime.capability_report.stale": LOCAL_AGENT_READINESS_STALE_REASON,
15880
15880
  "runtime.capability_report.unavailable": "This local agent is not available on this computer right now.",
15881
15881
  "runtime.capability_report.unknown": "ATS cannot confirm this local agent's readiness yet.",
15882
- "runtime.projection_missing": "ATS has not received a current readiness report from this computer yet.",
15882
+ "runtime.projection_missing": "ATS needs a current setup check from this computer.",
15883
15883
  "service.update_required": SERVICE_UPDATE_REQUIRED_REASON
15884
15884
  };
15885
15885
  const CAPABILITY_REF_SEPARATOR = ":";
@@ -16630,6 +16630,9 @@ const createRuntimeReportingApi = (client) => {
16630
16630
  function buildCreateSpacePath() {
16631
16631
  return "/v1/spaces";
16632
16632
  }
16633
+ function buildSpaceDeletePath(spaceId) {
16634
+ return `/v1/spaces/${encodeURIComponent(spaceId)}`;
16635
+ }
16633
16636
  function buildSpaceStatusPath(spaceId) {
16634
16637
  return buildSpaceRoutePath(spaceId, "status");
16635
16638
  }
@@ -16813,6 +16816,17 @@ function buildCreateSpaceBody(input) {
16813
16816
  ...input.password === void 0 ? {} : { password: input.password }
16814
16817
  };
16815
16818
  }
16819
+ async function deleteSpace$1(client, input) {
16820
+ return await client.requestJson({
16821
+ url: buildSpaceDeletePath(input.spaceId),
16822
+ operation: "space.delete",
16823
+ method: "DELETE",
16824
+ requestContext: input.requestContext,
16825
+ ...input.spacePassword === void 0 ? {} : { spacePassword: input.spacePassword },
16826
+ schema: deleteSpaceResponseSchema,
16827
+ invalidMessage: "invalid delete space response"
16828
+ });
16829
+ }
16816
16830
  async function createSpaceDiagnosticReport(client, input) {
16817
16831
  const parsedBody = createSpaceDiagnosticReportBodySchema.safeParse(input.body);
16818
16832
  if (!parsedBody.success) {
@@ -17109,6 +17123,7 @@ async function getSpaceWakeProgress(client, input) {
17109
17123
  const createSpaceApi = (client) => {
17110
17124
  return {
17111
17125
  createSpace: async (input) => await createSpace(client, input),
17126
+ deleteSpace: async (input) => await deleteSpace$1(client, input),
17112
17127
  addMembers: async (input) => await addSpaceMembers(client, input),
17113
17128
  leaveSpace: async (input) => await leaveSpace$1(client, input),
17114
17129
  getConversationBinding: async (input) => await getSpaceConversationBinding(client, input),
@@ -21142,7 +21157,7 @@ async function loadDaemonRouteCatalog(input) {
21142
21157
  const bindingApi = createAgentProfileBindingApi(createCliApiClientFoundation(await resolveBaseUrl()));
21143
21158
  const routeByProfileId = /* @__PURE__ */ new Map();
21144
21159
  const skippedProfiles = [];
21145
- for (const profile of profiles) {
21160
+ const resolutions = await Promise.all(profiles.map(async (profile) => {
21146
21161
  const primaryBinding = await readPrimaryBindingForRouteCatalog({
21147
21162
  bindingApi,
21148
21163
  profile
@@ -21154,10 +21169,15 @@ async function loadDaemonRouteCatalog(input) {
21154
21169
  primaryBinding,
21155
21170
  profile
21156
21171
  });
21157
- const nextResolvedRoute = resolvedRoute.status === "accepted" ? await resolveCatalogRouteWorkspaceState({
21158
- route: resolvedRoute.route,
21159
- profileId: resolvedRoute.profileId
21160
- }) : resolvedRoute;
21172
+ return {
21173
+ nextResolvedRoute: resolvedRoute.status === "accepted" ? await resolveCatalogRouteWorkspaceState({
21174
+ route: resolvedRoute.route,
21175
+ profileId: resolvedRoute.profileId
21176
+ }) : resolvedRoute,
21177
+ profile
21178
+ };
21179
+ }));
21180
+ for (const { nextResolvedRoute, profile } of resolutions) {
21161
21181
  if (nextResolvedRoute.status === "skipped") {
21162
21182
  if (nextResolvedRoute.profileId && nextResolvedRoute.skipReason) skippedProfiles.push({
21163
21183
  profileId: nextResolvedRoute.profileId,
@@ -41646,20 +41666,7 @@ const runDaemonServiceLoop = async (input) => {
41646
41666
  code: "daemon.run.adapter_missing",
41647
41667
  message: "no local adapters configured for daemon runtime"
41648
41668
  });
41649
- const projectionSyncResult = await syncDeviceRuntimeStateProjection({ mode: "repair" }).catch((error) => {
41650
- emitRunLine({
41651
- presenter: input.presenter,
41652
- code: "daemon.run.projection_sync_failed",
41653
- text: `local projection repair failed before route registration: ${toErrorMessage$35(error)}`
41654
- });
41655
- return null;
41656
- });
41657
- if (projectionSyncResult?.repairedControllerIds.length) emitRunLine({
41658
- presenter: input.presenter,
41659
- code: "daemon.run.projection_repaired",
41660
- text: `repaired local projection for ${projectionSyncResult.repairedControllerIds.length} controller(s) before route registration`,
41661
- payload: { repairedControllerIds: projectionSyncResult.repairedControllerIds }
41662
- });
41669
+ await touchRuntimeState({}, { forcePersist: true });
41663
41670
  const routeCatalog = await loadDaemonRouteCatalog({
41664
41671
  localAdapterContainer,
41665
41672
  localReplyStateMode: "repair",
@@ -41768,7 +41775,6 @@ const runDaemonServiceLoop = async (input) => {
41768
41775
  text: "no eligible local profiles yet; daemon will keep running and auto-register when profiles become available"
41769
41776
  });
41770
41777
  }
41771
- await touchRuntimeState({}, { forcePersist: true });
41772
41778
  while (!stopRequested) try {
41773
41779
  const wsUrl = toDaemonStreamUrl(baseUrl);
41774
41780
  const ws = await connectWebSocket(wsUrl, { headers: selectedAtsProfile ? await buildAtsProfileRequestHeadersWithAuth({
@@ -49282,6 +49288,12 @@ const DAEMON_RUN_BLOCKING_ANOMALIES = new Set([
49282
49288
  "duplicate_owned_processes",
49283
49289
  "foreground_background_conflict"
49284
49290
  ]);
49291
+ const DAEMON_STARTUP_BLOCKING_ANOMALIES = new Set([
49292
+ "duplicate_owned_processes",
49293
+ "multiple_active_owners",
49294
+ "runtime_bundle_mismatch",
49295
+ "runtime_contract_mismatch"
49296
+ ]);
49285
49297
  const DAEMON_RUN_MODE_CHOICES = {
49286
49298
  background: "background",
49287
49299
  foreground: "foreground",
@@ -50156,10 +50168,6 @@ async function autoStartDaemonAfterReinstall(input) {
50156
50168
  readDaemonStatus: input.resolved.readDaemonStatus,
50157
50169
  verifyWaitMs: input.resolved.verifyWaitMs
50158
50170
  });
50159
- await waitForDaemonReadinessAfterReinstall({
50160
- readCurrentReplyReadinessSnapshot: input.resolved.readCurrentReplyReadinessSnapshot,
50161
- verifyWaitMs: input.resolved.verifyWaitMs
50162
- });
50163
50171
  await clearDaemonStartFailureStateSafely();
50164
50172
  return createDaemonReinstallCompletedOutcome({
50165
50173
  backupDataPath: null,
@@ -50242,11 +50250,10 @@ function isDaemonInventoryRunningAndAligned(inventory) {
50242
50250
  }) === "running" && inventory.runtimeStatus.mode === "background" && inventory.serviceManagerStatus?.running === true;
50243
50251
  }
50244
50252
  function isDaemonInventoryRunningAndStartReady(inventory) {
50245
- if (getEffectiveDaemonRuntimeStatus({
50246
- runtimeState: inventory.runtimeStatus,
50247
- serviceManagerStatus: inventory.serviceManagerStatus
50248
- }) !== "running" || inventory.runtimeStatus.mode !== "background" || inventory.serviceManagerStatus?.running !== true) return false;
50249
- return !classifyDaemonServiceWakeability({ inventory }).blocksWake;
50253
+ if (inventory.runtimeStatus.status !== "running") return false;
50254
+ if (inventory.runtimeStatus.mode !== "background") return false;
50255
+ if (inventory.runtimeStatus.managedBySystemService !== true) return false;
50256
+ return !inventory.anomalies.some((anomaly) => DAEMON_STARTUP_BLOCKING_ANOMALIES.has(anomaly.code));
50250
50257
  }
50251
50258
  function buildDaemonReinstallUnexpectedStartNextStep() {
50252
50259
  return formatInlineAtsCliCommands(`Run \`ats service run --mode foreground\` to see the live error. The latest local service log is at \`${getDaemonSystemServiceLogPath()}\`. If it still fails, run \`ats service reinstall\` again.`);
@@ -50298,7 +50305,6 @@ function resolveDaemonReinstallOptions(options) {
50298
50305
  daemonVersion,
50299
50306
  runRun: options.runRun ?? runDaemonRun,
50300
50307
  readDaemonStatus: options.readDaemonStatus ?? getDaemonStatus,
50301
- readCurrentReplyReadinessSnapshot: options.readCurrentReplyReadinessSnapshot ?? resolveCurrentReplyReadinessSnapshot,
50302
50308
  withReconcileLock: options.withReconcileLock ?? (async (callback) => await withDaemonServiceReconcileLock(callback, {
50303
50309
  intent: "reinstall",
50304
50310
  command: "ats service reinstall"
@@ -50341,41 +50347,6 @@ async function waitForDaemonHealthyAfterReinstall(input) {
50341
50347
  const statusText = lastRuntime ? describeDaemonRuntimeStatus(lastRuntime) : "No runtime status available.";
50342
50348
  throw new Error(`ATS service reinstall verification timed out after ${String(input.verifyWaitMs)}ms. ${statusText}`);
50343
50349
  }
50344
- async function waitForDaemonReadinessAfterReinstall(input) {
50345
- const blockingReasonCodes = new Set(["service.not_running", "service.drifted"]);
50346
- const deadline = Date.now() + input.verifyWaitMs;
50347
- let lastBlockingReasonCodes = [];
50348
- let lastSnapshotState = null;
50349
- let lastSnapshotError = null;
50350
- while (Date.now() < deadline) {
50351
- let snapshot;
50352
- try {
50353
- snapshot = await input.readCurrentReplyReadinessSnapshot({
50354
- checkGatewayChain: false,
50355
- includeDaemonRouteObservation: false,
50356
- openClawDiagnosticsMode: null,
50357
- profile: null
50358
- });
50359
- lastSnapshotState = "readable";
50360
- lastSnapshotError = null;
50361
- } catch (error) {
50362
- lastSnapshotState = "unreadable";
50363
- lastSnapshotError = error;
50364
- await sleep$4(REINSTALL_VERIFY_POLL_MS);
50365
- continue;
50366
- }
50367
- const currentBlockingReasonCodes = snapshot.deviceReplyReadiness.reasonCodes.filter((reasonCode) => blockingReasonCodes.has(reasonCode));
50368
- if (currentBlockingReasonCodes.length === 0) return;
50369
- lastBlockingReasonCodes = currentBlockingReasonCodes;
50370
- await sleep$4(REINSTALL_VERIFY_POLL_MS);
50371
- }
50372
- let detail = "No reply-readiness status was available.";
50373
- if (lastSnapshotState === "unreadable") {
50374
- const lastErrorMessage = toErrorMessage$12(lastSnapshotError);
50375
- detail = lastErrorMessage.length > 0 ? `Reply-readiness snapshot remained unreadable. Last error: ${lastErrorMessage}.` : "Reply-readiness snapshot remained unreadable.";
50376
- } else if (lastBlockingReasonCodes.length > 0) detail = `device reply readiness is still blocked by ${lastBlockingReasonCodes.join(", ")}.`;
50377
- throw new Error(`ATS service reinstall readiness verification timed out after ${String(input.verifyWaitMs)}ms. ${detail}`);
50378
- }
50379
50350
  async function confirmDaemonReinstall(runtime, force) {
50380
50351
  if (!canUseInteractivePrompts(runtime)) return true;
50381
50352
  const confirmed = await confirm({
@@ -51435,7 +51406,7 @@ async function waitForSystemServiceStartup(input) {
51435
51406
  };
51436
51407
  const finalRuntimeStatus = await readCurrentObservedDaemonRuntimeStatus().catch(() => null);
51437
51408
  const finalManagerStatus = await input.manager.status().catch(() => null);
51438
- throw new Error(`ATS Service failed to reach a running start-ready state in time. runtime=${finalRuntimeStatus?.status ?? "unknown"}, reason=${finalRuntimeStatus?.reason || "unknown"}, managerRunning=${String(finalManagerStatus?.running ?? false)}, anomalies=${finalInventory?.anomalies.map((anomaly) => anomaly.code).join(",") || "unknown"}`);
51409
+ throw new Error(`ATS Service failed to reach a running local service state in time. runtime=${finalRuntimeStatus?.status ?? "unknown"}, reason=${finalRuntimeStatus?.reason || "unknown"}, managerRunning=${String(finalManagerStatus?.running ?? false)}, anomalies=${finalInventory?.anomalies.map((anomaly) => anomaly.code).join(",") || "unknown"}`);
51439
51410
  }
51440
51411
  async function confirmStopServiceManager(runtime, runtimeStatus) {
51441
51412
  if (!canUseInteractivePrompts(runtime)) return true;
@@ -52035,10 +52006,18 @@ async function stopRegisteredDaemonServiceManager(input) {
52035
52006
  manager: input.ownerSnapshot.serviceManager,
52036
52007
  waitMs: SERVICE_STOP_CHECK_MS,
52037
52008
  pollMs: SERVICE_STOP_POLL_MS
52038
- })) return buildDaemonStopWarningResult({
52039
- reason: "system_timeout",
52040
- runtimeStatus: input.ownerSnapshot.runtimeStatus
52041
- });
52009
+ })) {
52010
+ const finalOwnerSnapshot = await readCurrentDaemonOwnerSnapshot();
52011
+ if (hasDifferentActiveDaemonOwnerAfterSystemStop(input.ownerSnapshot, finalOwnerSnapshot)) return buildDaemonStopWarningResult({
52012
+ reason: "stop_failed",
52013
+ runtimeStatus: finalOwnerSnapshot.runtimeStatus,
52014
+ errorMessage: "daemon owners are still active after stopping the system service"
52015
+ });
52016
+ return buildDaemonStopWarningResult({
52017
+ reason: "system_timeout",
52018
+ runtimeStatus: input.ownerSnapshot.runtimeStatus
52019
+ });
52020
+ }
52042
52021
  try {
52043
52022
  await stopResidualDaemonProcessesAfterManagerStop({
52044
52023
  force: input.force,
@@ -52061,6 +52040,13 @@ async function stopRegisteredDaemonServiceManager(input) {
52061
52040
  });
52062
52041
  return null;
52063
52042
  }
52043
+ function hasDifferentActiveDaemonOwnerAfterSystemStop(initialOwnerSnapshot, finalOwnerSnapshot) {
52044
+ if (!hasActiveDaemonOwners(finalOwnerSnapshot)) return false;
52045
+ if (finalOwnerSnapshot.activeOwnerKinds.some((ownerKind) => ownerKind !== "system_service")) return true;
52046
+ const initialPid = initialOwnerSnapshot.runtimeStatus.pid;
52047
+ const finalPid = finalOwnerSnapshot.runtimeStatus.pid;
52048
+ return finalOwnerSnapshot.runtimeStatus.status === "running" && finalPid !== null && initialPid !== null && finalPid !== initialPid;
52049
+ }
52064
52050
  function buildDaemonStopWarningResult(input) {
52065
52051
  return {
52066
52052
  status: "warning",