agent-transport-system 0.3.46 → 0.3.47

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-CA3rSDod.js";
4
- import { v as DEV_LOCAL_GATEWAY_BASE_URL } from "./runtime-config-Bp7NfBtS.js";
3
+ import "./lock-Bb7PYhPq.js";
4
+ import { v as DEV_LOCAL_GATEWAY_BASE_URL } from "./runtime-config-DrykJV63.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 currentDeviceTargetResponseSchema, $t as resolveSpaceMentionLabels, A as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, An as writeCurrentDeviceBootstrapObservationResponseSchema, At as normalizeBuiltinControllerAgentId, B as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, Bt as patchStartSessionBodySchema, C as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Cn as startSessionSpaceChoiceResponseSchema, Ct as getSpaceDispatchResultResponseSchema, D as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Dn as upsertProfileSpaceHistoryResponseSchema, Dt as isExplicitBuiltinControllerRef, E as LEGACY_RUNTIME_DISPATCH_POLICY, En as structuredGuidePayloadFromInputSchema, Et as incomingServerMessageSchema, F as atsRuntimeProfileIdSchema, Fn as writeStartObservedDeviceMetadataBodySchema, Ft as ownedDevicesResponseSchema, G as canonicalizeControllerRefForKind, Gt as profileWorkspaceModeSchema, H as buildControllerRoutingKeyForKind, Ht as postNormalMessageResponseSchema, I as atsSpaceEgressActionSchema, In as writeStartObservedDeviceMetadataResponseSchema, It as parseOptionalClientMessageId, J as continuitySchema, Jt as removeSpaceMembersResponseSchema, K as catchupResponseSchema, Kt as providerDispatchRuntimeContextSchema, L as atsdControlPlaneRequestSchema, Ln as writeStartSessionProgressBodySchema, Lt as patchProfileSpaceHistoryStatusResponseSchema, M as SPACE_PASSWORD_MIN_LENGTH, Mn as writeCurrentDeviceObservedMetadataResponseSchema, Mt as normalizeListSignalsReadQuerySemantics, N as SPACE_UPDATES_MAX_LIMIT, Nn as writeStartObservationBodySchema, Nt as normalizeMessageEnvelope, O as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, On as upsertSpaceDeletionTombstoneResponseSchema, Ot as leaveSpaceResponseSchema, P as atsProfileIdSchema, Pn as writeStartObservationResponseSchema, Pt as normalizeOptionalWorkingDirectory, Q as createStartSessionBodySchema, Qt as resolveSingleSpaceMentionLabels, R as atsdControlPlaneResponseSchema, Rn as writeStartSessionProgressResponseSchema, Rt as patchSpaceContractBodySchema, S as DAEMON_HUB_SCHEMA_VERSION, Sn as startSessionSpaceChoiceBodySchema, St as getSpaceDispatchLookupResponseSchema, T as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Tn as startStateResponseSchema, Tt as getSpaceUpdatesResponseSchema, U as buildUpstreamConversationRef, Ut as postSpaceMembersBodySchema, V as atsdTaskResultPayloadSchema, Vt as postNormalMessageBodySchema, W as canonicalizeBuiltinControllerRef, Wt as postSpaceMembersResponseSchema, X as createSpaceBodySchema, Xt as resolveBuiltinUpstreamConversationRefKind, Y as conversationExecutionStateSchema, Yt as resolveBuiltinProviderConversationCapability, Z as createSpaceResponseSchema, Zt as resolveMessageEnvelopeTargetField, _ as AGENT_REPLY_PREVIEW_END_PURPOSE, _n as spaceMetaSchema, _t as gatewayErrorCodeSchema, a as runWithHeldLock, an as serverErrorFrameSchema, at as daemonHubHeartbeatResponseSchema, b as ATSD_TASK_RESULT_SCHEMA_VERSION, bn as startSessionProgressSchema, bt as getSpaceConversationRemoteStatusResponseSchema, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as signalEnvelopeSchema, ct as daemonHubSubmitTaskResultRequestSchema, d as resolveRuntimeSession, dn as spaceConversationBindingImportResponseSchema, dt as daemonServiceContractSchema, en as resolveStartHandoffBodySchema, et as daemonHubDeliverDispatchRequestSchema, f as resolveRuntimeSessionId, fn as spaceConversationBindingResponseSchema, ft as daemonStreamFrameSchema, g as AGENT_REPLYING_PURPOSE, gn as spaceMembersSnapshotSchema, gt as formatCanonicalMentionLiteral, h as AGENT_REPLYING_END_PURPOSE, hn as spaceDispatchTraceResponseSchema, ht as forgetCurrentComputerResponseSchema, i as releaseLock, in as sanitizeSignalTextPreview, it as daemonHubHeartbeatRequestSchema, j as SPACE_MENTION_REJECT_NOTICE_PURPOSE, jn as writeCurrentDeviceObservedMetadataBodySchema, jt as normalizeBuiltinControllerProviderId, k as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, kn as writeCurrentDeviceBootstrapObservationBodySchema, kt as listProfileSpaceHistoryResponseSchema, l as listRuntimeSessionStates, ln as spaceConversationBindingConflictResponseSchema, lt as daemonRouteObservationResponseSchema, m as resolveBuiltinAgentControllerBrand, mn as spaceCreatorSchema, mt as entryBriefSchema, n as isAtsLockError, nt as daemonHubDispatchPreviewEndRequestSchema, o as tryCleanupStaleLock, on as setCurrentDeviceTargetBodySchema, ot as daemonHubRegisterSessionRequestSchema, p as writeRuntimeSessionState, pn as spaceConversationBindingUpsertResponseSchema, pt as dispatchBriefSchema, q as collectCanonicalMentionTextFragments, qt as querySpaceDeletionTombstonesResponseSchema, r as readLockMeta, rt as daemonHubDispatchPreviewRequestSchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as setOwnedDeviceDisplayNameBodySchema, st as daemonHubRegisterSessionResponseSchema, t as acquireLock, tn as resolveStartHandoffResponseSchema, tt as daemonHubDispatchLifecycleRequestSchema, u as readRuntimeSessionState, un as spaceConversationBindingDeleteResponseSchema, ut as daemonRuntimeLeaseSchema, v as AGENT_REPLY_PREVIEW_PURPOSE, vn as startDeviceProjectionSchema, vt as gatewayErrorEnvelopeSchema, w as DISPATCH_ACTIVITY_FAILED_PURPOSE, wn as startSessionWithTokenResponseSchema, wt as getSpaceStatusResponseSchema, x as CONVERSATION_CONTINUITY_WARNING_PURPOSE, xn as startSessionResponseSchema, xt as getSpaceConversationStatusResponseSchema, y as ATSD_CONTROL_PLANE_SCHEMA_VERSION, yn as startProfileReadinessSummarySchema, yt as getSpaceContractResponseSchema, z as atsdTaskResultEnvelopeWriteSchema, zn as createDaemonRouteObservationSummary, zt as patchSpaceContractResponseSchema } from "./lock-CA3rSDod.js";
4
- import { C as normalizeAtsProfileId, D as resolveAtsRootDir, E as resolveAtsEnvPreset, M as spacesDir, N as systemDir, O as runtimeDir, S as normalizeAccountKey, T as profileViewPath, a as accountProfileWorkspacePath, c as atsRootDir, d as deviceOpenClawProfileBootstrapPath, f as deviceOpenClawProfileDir, i as accountProfileViewPath, j as skillsDir, k as runtimeLogsDir, 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-B2sqzP1x.js";
5
- import { A as toSpaceDispatchTraceUrl, C as normalizeBaseUrl, D as toSpaceCursorUrl, E as toSpaceCreateUrl, F as toSpaceRemoveMembersUrl, I as toSpaceResultUrl, L as toSpaceSignalsUrl, M as toSpaceMembersUrl, N as toSpaceMetaUrl, O as toSpaceDeleteUrl, P as toSpacePasswordUrl, R as toSpaceUpdatesUrl, S as resolveExplicitGatewayUrlOrThrow, T as toSpaceContractUrl, _ as updateConfiguredStartV1OnboardingState, a as getConfiguredDeviceRuntimeState, b as resolveBaseUrl, c as getConfiguredStartV1OnboardingState, d as resolveRuntimeSkillsCustomTargetId, f as setConfiguredBaseUrl, g as updateConfiguredSkillsConfig, h as updateConfiguredOnboardingConfig, i as getConfiguredDaemonDispatchLimits, j as toSpaceLeaveUrl, k as toSpaceDispatchLookupUrl, 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 toDaemonRouteObservationUrl, x as resolveBaseUrlOrNull, y as normalizeGatewayBaseUrlOrNull, z as toSpaceWsUrl } from "./runtime-config-Bp7NfBtS.js";
3
+ import { $ as currentDeviceTargetResponseSchema, $t as resolveSpaceMentionLabels, A as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, An as writeCurrentDeviceBootstrapObservationResponseSchema, At as normalizeBuiltinControllerAgentId, B as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, Bt as patchStartSessionBodySchema, C as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Cn as startSessionSpaceChoiceResponseSchema, Ct as getSpaceDispatchResultResponseSchema, D as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Dn as upsertProfileSpaceHistoryResponseSchema, Dt as isExplicitBuiltinControllerRef, E as LEGACY_RUNTIME_DISPATCH_POLICY, En as structuredGuidePayloadFromInputSchema, Et as incomingServerMessageSchema, F as atsRuntimeProfileIdSchema, Fn as writeStartObservedDeviceMetadataBodySchema, Ft as ownedDevicesResponseSchema, G as canonicalizeControllerRefForKind, Gt as profileWorkspaceModeSchema, H as buildControllerRoutingKeyForKind, Ht as postNormalMessageResponseSchema, I as atsSpaceEgressActionSchema, In as writeStartObservedDeviceMetadataResponseSchema, It as parseOptionalClientMessageId, J as continuitySchema, Jt as removeSpaceMembersResponseSchema, K as catchupResponseSchema, Kt as providerDispatchRuntimeContextSchema, L as atsdControlPlaneRequestSchema, Ln as writeStartSessionProgressBodySchema, Lt as patchProfileSpaceHistoryStatusResponseSchema, M as SPACE_PASSWORD_MIN_LENGTH, Mn as writeCurrentDeviceObservedMetadataResponseSchema, Mt as normalizeListSignalsReadQuerySemantics, N as SPACE_UPDATES_MAX_LIMIT, Nn as writeStartObservationBodySchema, Nt as normalizeMessageEnvelope, O as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, On as upsertSpaceDeletionTombstoneResponseSchema, Ot as leaveSpaceResponseSchema, P as atsProfileIdSchema, Pn as writeStartObservationResponseSchema, Pt as normalizeOptionalWorkingDirectory, Q as createStartSessionBodySchema, Qt as resolveSingleSpaceMentionLabels, R as atsdControlPlaneResponseSchema, Rn as writeStartSessionProgressResponseSchema, Rt as patchSpaceContractBodySchema, S as DAEMON_HUB_SCHEMA_VERSION, Sn as startSessionSpaceChoiceBodySchema, St as getSpaceDispatchLookupResponseSchema, T as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Tn as startStateResponseSchema, Tt as getSpaceUpdatesResponseSchema, U as buildUpstreamConversationRef, Ut as postSpaceMembersBodySchema, V as atsdTaskResultPayloadSchema, Vt as postNormalMessageBodySchema, W as canonicalizeBuiltinControllerRef, Wt as postSpaceMembersResponseSchema, X as createSpaceBodySchema, Xt as resolveBuiltinUpstreamConversationRefKind, Y as conversationExecutionStateSchema, Yt as resolveBuiltinProviderConversationCapability, Z as createSpaceResponseSchema, Zt as resolveMessageEnvelopeTargetField, _ as AGENT_REPLY_PREVIEW_END_PURPOSE, _n as spaceMetaSchema, _t as gatewayErrorCodeSchema, a as runWithHeldLock, an as serverErrorFrameSchema, at as daemonHubHeartbeatResponseSchema, b as ATSD_TASK_RESULT_SCHEMA_VERSION, bn as startSessionProgressSchema, bt as getSpaceConversationRemoteStatusResponseSchema, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as signalEnvelopeSchema, ct as daemonHubSubmitTaskResultRequestSchema, d as resolveRuntimeSession, dn as spaceConversationBindingImportResponseSchema, dt as daemonServiceContractSchema, en as resolveStartHandoffBodySchema, et as daemonHubDeliverDispatchRequestSchema, f as resolveRuntimeSessionId, fn as spaceConversationBindingResponseSchema, ft as daemonStreamFrameSchema, g as AGENT_REPLYING_PURPOSE, gn as spaceMembersSnapshotSchema, gt as formatCanonicalMentionLiteral, h as AGENT_REPLYING_END_PURPOSE, hn as spaceDispatchTraceResponseSchema, ht as forgetCurrentComputerResponseSchema, i as releaseLock, in as sanitizeSignalTextPreview, it as daemonHubHeartbeatRequestSchema, j as SPACE_MENTION_REJECT_NOTICE_PURPOSE, jn as writeCurrentDeviceObservedMetadataBodySchema, jt as normalizeBuiltinControllerProviderId, k as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, kn as writeCurrentDeviceBootstrapObservationBodySchema, kt as listProfileSpaceHistoryResponseSchema, l as listRuntimeSessionStates, ln as spaceConversationBindingConflictResponseSchema, lt as daemonRouteObservationResponseSchema, m as resolveBuiltinAgentControllerBrand, mn as spaceCreatorSchema, mt as entryBriefSchema, n as isAtsLockError, nt as daemonHubDispatchPreviewEndRequestSchema, o as tryCleanupStaleLock, on as setCurrentDeviceTargetBodySchema, ot as daemonHubRegisterSessionRequestSchema, p as writeRuntimeSessionState, pn as spaceConversationBindingUpsertResponseSchema, pt as dispatchBriefSchema, q as collectCanonicalMentionTextFragments, qt as querySpaceDeletionTombstonesResponseSchema, r as readLockMeta, rt as daemonHubDispatchPreviewRequestSchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as setOwnedDeviceDisplayNameBodySchema, st as daemonHubRegisterSessionResponseSchema, t as acquireLock, tn as resolveStartHandoffResponseSchema, tt as daemonHubDispatchLifecycleRequestSchema, u as readRuntimeSessionState, un as spaceConversationBindingDeleteResponseSchema, ut as daemonRuntimeLeaseSchema, v as AGENT_REPLY_PREVIEW_PURPOSE, vn as startDeviceProjectionSchema, vt as gatewayErrorEnvelopeSchema, w as DISPATCH_ACTIVITY_FAILED_PURPOSE, wn as startSessionWithTokenResponseSchema, wt as getSpaceStatusResponseSchema, x as CONVERSATION_CONTINUITY_WARNING_PURPOSE, xn as startSessionResponseSchema, xt as getSpaceConversationStatusResponseSchema, y as ATSD_CONTROL_PLANE_SCHEMA_VERSION, yn as startProfileReadinessSummarySchema, yt as getSpaceContractResponseSchema, z as atsdTaskResultEnvelopeWriteSchema, zn as createDaemonRouteObservationSummary, zt as patchSpaceContractResponseSchema } from "./lock-Bb7PYhPq.js";
4
+ import { A as runtimeLogsDir, C as normalizeAtsProfileId, D as resolveAtsRootDir, E as resolveAtsEnvPreset, M as skillsDir, N as spacesDir, O as resolveKnownAtsEnvPresetFromArgv, 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-DTn3aLSP.js";
5
+ import { A as toSpaceDispatchTraceUrl, C as normalizeBaseUrl, D as toSpaceCursorUrl, E as toSpaceCreateUrl, F as toSpaceRemoveMembersUrl, I as toSpaceResultUrl, L as toSpaceSignalsUrl, M as toSpaceMembersUrl, N as toSpaceMetaUrl, O as toSpaceDeleteUrl, P as toSpacePasswordUrl, R as toSpaceUpdatesUrl, S as resolveExplicitGatewayUrlOrThrow, T as toSpaceContractUrl, _ as updateConfiguredStartV1OnboardingState, a as getConfiguredDeviceRuntimeState, b as resolveBaseUrl, c as getConfiguredStartV1OnboardingState, d as resolveRuntimeSkillsCustomTargetId, f as setConfiguredBaseUrl, g as updateConfiguredSkillsConfig, h as updateConfiguredOnboardingConfig, i as getConfiguredDaemonDispatchLimits, j as toSpaceLeaveUrl, k as toSpaceDispatchLookupUrl, 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 toDaemonRouteObservationUrl, x as resolveBaseUrlOrNull, y as normalizeGatewayBaseUrlOrNull, z as toSpaceWsUrl } from "./runtime-config-DrykJV63.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, 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.3.46";
30
+ var version = "0.3.47";
31
31
  var package_default = {
32
32
  name: "agent-transport-system",
33
33
  version,
@@ -4007,7 +4007,7 @@ async function setDaemonServiceRuntimeState(state, pathInput = {}) {
4007
4007
  await writeDaemonServiceRuntimeState(state, pathInput);
4008
4008
  }
4009
4009
  async function clearDaemonServiceRuntimeState(pathInput = {}) {
4010
- const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-BF-4jUcH.js");
4010
+ const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-CvsrTiRk.js");
4011
4011
  await Promise.all([rm(daemonServiceRuntimeStatePath(pathInput), { force: true }), clearDaemonRuntimeLease(pathInput)]);
4012
4012
  }
4013
4013
  async function withDaemonServiceRunLock(callback, meta = {
@@ -10236,8 +10236,8 @@ function collectProfileReadinessPlannerSignals(readModel, baseAction) {
10236
10236
  const memberResult = collectProfileSignalsForId({
10237
10237
  readModel,
10238
10238
  actionId: baseAction.actionId,
10239
- blockRouteOffline: false,
10240
- blockReplyBlocked: false,
10239
+ blockRouteOffline: baseAction.actionId === "space_entry",
10240
+ blockReplyBlocked: baseAction.actionId === "space_entry",
10241
10241
  profileId
10242
10242
  });
10243
10243
  attention.push(...memberResult.attention);
@@ -23809,6 +23809,7 @@ function prepareSpaceComposerSubmission(input) {
23809
23809
  mentionText: fragment.text,
23810
23810
  relation: parsedLiteral.type
23811
23811
  }));
23812
+ if (parsedLiteral.type === "wake" && target.wakeAvailability.status === "blocked") throw new Error(buildBlockedWakeCanonicalMentionMessage({ profileName: target.profileName }));
23812
23813
  envelopeInput[resolveMessageEnvelopeTargetField(parsedLiteral.type)].push(target.profileId);
23813
23814
  profileIdsInTextOrder.push(target.profileId);
23814
23815
  canonicalMentionsInTextOrder.push({
@@ -23901,6 +23902,9 @@ function describeRelationSupport(relation) {
23901
23902
  if (relation === "wake") return "agent targets";
23902
23903
  return "active targets";
23903
23904
  }
23905
+ function buildBlockedWakeCanonicalMentionMessage(input) {
23906
+ return `Cannot Wake "${input.profileName}" yet. Finish local agent setup on this computer first.`;
23907
+ }
23904
23908
  function formatCanonicalMentionEnvelopeError(error) {
23905
23909
  const issues = extractEnvelopeIssueMessages(error);
23906
23910
  for (const issueMessage of issues) {
@@ -24066,15 +24070,13 @@ function listSpaceMentionRelationChoices(input) {
24066
24070
  const choices = [];
24067
24071
  for (const relation of MENTION_RELATION_ORDER) {
24068
24072
  if (!input.allowedRelations[relation]) continue;
24073
+ if (relation === "wake" && input.wakeAvailability.status === "blocked") continue;
24069
24074
  choices.push({
24070
24075
  canonicalLiteral: formatCanonicalMentionLiteral({
24071
24076
  name: input.primaryMentionLabel,
24072
24077
  type: relation
24073
24078
  }),
24074
- description: buildRelationChoiceDescription({
24075
- relation,
24076
- wakeAvailability: input.wakeAvailability
24077
- }),
24079
+ description: RELATION_DESCRIPTIONS[relation],
24078
24080
  label: RELATION_LABELS[relation],
24079
24081
  relation
24080
24082
  });
@@ -24193,11 +24195,6 @@ function compareMentionSuggestions(left, right, recentRankByProfileId) {
24193
24195
  if (left.liveNow !== right.liveNow) return left.liveNow ? -1 : 1;
24194
24196
  return left.primaryMentionLabel.localeCompare(right.primaryMentionLabel, "en", { sensitivity: "base" });
24195
24197
  }
24196
- function buildRelationChoiceDescription(input) {
24197
- const segments = [RELATION_DESCRIPTIONS[input.relation]];
24198
- if (input.relation === "wake" && input.wakeAvailability.status === "blocked") segments.push("unavailable now");
24199
- return segments.join(" · ");
24200
- }
24201
24198
  function normalizeMentionQuery(value) {
24202
24199
  return value.trim().replace(MENTION_PREFIX_PATTERN, "").replace(MULTI_SPACE_PATTERN$1, " ").toLowerCase();
24203
24200
  }
@@ -33175,7 +33172,8 @@ async function createStartSession(client, input) {
33175
33172
  profileChoice: input.profileChoice,
33176
33173
  agentSelection: input.agentSelection,
33177
33174
  ...input.spaceMemberSelection === void 0 ? {} : { spaceMemberSelection: input.spaceMemberSelection },
33178
- spaceChoice: input.spaceChoice
33175
+ spaceChoice: input.spaceChoice,
33176
+ ...input.writeMode === void 0 ? {} : { writeMode: input.writeMode }
33179
33177
  });
33180
33178
  return await client.requestJson({
33181
33179
  url: buildStartSessionPath(input.deviceId),
@@ -52801,6 +52799,56 @@ function failCliStartHandoffProgress(input) {
52801
52799
  });
52802
52800
  }
52803
52801
 
52802
+ //#endregion
52803
+ //#region src/ui/delayed-spinner.ts
52804
+ const DEFAULT_SPINNER_DELAY_MS = 250;
52805
+ function createDelayedSpinner(input) {
52806
+ if (!(input.enabled === true && (input.isTTY ?? process.stdout.isTTY) === true && typeof clackPrompts.spinner === "function")) return {
52807
+ start: () => void 0,
52808
+ complete: () => void 0,
52809
+ fail: () => void 0
52810
+ };
52811
+ const progressSpinner = clackPrompts.spinner();
52812
+ const delayMs = input.delayMs ?? DEFAULT_SPINNER_DELAY_MS;
52813
+ let pendingTimer = null;
52814
+ let spinnerVisible = false;
52815
+ const latestMessage = input.message;
52816
+ const clearPendingTimer = () => {
52817
+ if (!pendingTimer) return;
52818
+ clearTimeout(pendingTimer);
52819
+ pendingTimer = null;
52820
+ };
52821
+ const ensureSpinnerStarted = () => {
52822
+ if (spinnerVisible || pendingTimer) return;
52823
+ pendingTimer = setTimeout(() => {
52824
+ pendingTimer = null;
52825
+ spinnerVisible = true;
52826
+ progressSpinner.start(latestMessage);
52827
+ }, delayMs);
52828
+ };
52829
+ return {
52830
+ start: () => {
52831
+ ensureSpinnerStarted();
52832
+ },
52833
+ complete: (message) => {
52834
+ clearPendingTimer();
52835
+ if (!spinnerVisible) return;
52836
+ spinnerVisible = false;
52837
+ if (message) {
52838
+ progressSpinner.stop(message);
52839
+ return;
52840
+ }
52841
+ progressSpinner.clear();
52842
+ },
52843
+ fail: () => {
52844
+ clearPendingTimer();
52845
+ if (!spinnerVisible) return;
52846
+ spinnerVisible = false;
52847
+ progressSpinner.clear();
52848
+ }
52849
+ };
52850
+ }
52851
+
52804
52852
  //#endregion
52805
52853
  //#region src/lib/profile-kind.ts
52806
52854
  function toProfileKind(value) {
@@ -53903,10 +53951,14 @@ async function runStartHandoff(input) {
53903
53951
  timeoutMs: waitConfig.timeoutMs
53904
53952
  });
53905
53953
  if (input.runtime.resolvedView === "human" && input.interactive) {
53906
- await waitForWebAgentSelection({
53907
- opaqueToken: input.startSession,
53908
- startApi,
53909
- waitConfig
53954
+ await runWithDelayedSpinner({
53955
+ message: "Waiting for your agent choices in ATS Web. Keep this Terminal open; setup will continue automatically.",
53956
+ completeMessage: "ATS received your agent choices from ATS Web.",
53957
+ run: async () => await waitForWebAgentSelection({
53958
+ opaqueToken: input.startSession,
53959
+ startApi,
53960
+ waitConfig
53961
+ })
53910
53962
  });
53911
53963
  await runStartHandoff(input);
53912
53964
  return;
@@ -53977,33 +54029,39 @@ async function runStartHandoff(input) {
53977
54029
  });
53978
54030
  }
53979
54031
  }) === "cancelled") return;
53980
- readiness = await collectHandoffReadiness(gatewayUrl);
53981
- observation = await buildValidatedHandoffObservation({
53982
- baseUrl: gatewayUrl,
53983
- profile,
53984
- sessionDeviceId,
53985
- targetProfileIds,
53986
- targetProfiles,
53987
- readiness
53988
- });
53989
- await writeHandoffObservation({
53990
- startApi,
53991
- opaqueToken: input.startSession,
53992
- observation
53993
- });
53994
- progress = touchCliStartHandoffProgress({ progress });
53995
- await writeHandoffProgress({
53996
- startApi,
53997
- opaqueToken: input.startSession,
53998
- progress
53999
- });
54000
- foundation = await buildCliStartHandoffFoundation({
54001
- baseUrl: gatewayUrl,
54002
- profile,
54003
- readiness,
54004
- session: sessionSlot,
54005
- targetProfileIds,
54006
- targetProfiles
54032
+ await runWithDelayedSpinner({
54033
+ message: "Finishing local setup. ATS is checking this computer and updating ATS Web.",
54034
+ completeMessage: "ATS finished checking this computer.",
54035
+ run: async () => {
54036
+ readiness = await collectHandoffReadiness(gatewayUrl);
54037
+ observation = await buildValidatedHandoffObservation({
54038
+ baseUrl: gatewayUrl,
54039
+ profile,
54040
+ sessionDeviceId,
54041
+ targetProfileIds,
54042
+ targetProfiles,
54043
+ readiness
54044
+ });
54045
+ await writeHandoffObservation({
54046
+ startApi,
54047
+ opaqueToken: input.startSession,
54048
+ observation
54049
+ });
54050
+ progress = touchCliStartHandoffProgress({ progress });
54051
+ await writeHandoffProgress({
54052
+ startApi,
54053
+ opaqueToken: input.startSession,
54054
+ progress
54055
+ });
54056
+ foundation = await buildCliStartHandoffFoundation({
54057
+ baseUrl: gatewayUrl,
54058
+ profile,
54059
+ readiness,
54060
+ session: sessionSlot,
54061
+ targetProfileIds,
54062
+ targetProfiles
54063
+ });
54064
+ }
54007
54065
  });
54008
54066
  const serviceStepResult = await runHandoffLocalStepWithFailedProgressSync({
54009
54067
  run: async () => await runStartServiceStep({
@@ -54024,19 +54082,25 @@ async function runStartHandoff(input) {
54024
54082
  });
54025
54083
  }
54026
54084
  });
54027
- readiness = await collectHandoffReadiness(gatewayUrl);
54028
- observation = await buildValidatedHandoffObservation({
54029
- baseUrl: gatewayUrl,
54030
- profile,
54031
- sessionDeviceId,
54032
- targetProfileIds,
54033
- targetProfiles,
54034
- readiness
54035
- });
54036
- await writeHandoffObservation({
54037
- startApi,
54038
- opaqueToken: input.startSession,
54039
- observation
54085
+ await runWithDelayedSpinner({
54086
+ message: "Verifying local agent readiness and telling ATS Web this computer is ready.",
54087
+ completeMessage: "ATS Web can now use this computer.",
54088
+ run: async () => {
54089
+ readiness = await collectHandoffReadiness(gatewayUrl);
54090
+ observation = await buildValidatedHandoffObservation({
54091
+ baseUrl: gatewayUrl,
54092
+ profile,
54093
+ sessionDeviceId,
54094
+ targetProfileIds,
54095
+ targetProfiles,
54096
+ readiness
54097
+ });
54098
+ await writeHandoffObservation({
54099
+ startApi,
54100
+ opaqueToken: input.startSession,
54101
+ observation
54102
+ });
54103
+ }
54040
54104
  });
54041
54105
  if (serviceStepResult !== "continue") return;
54042
54106
  progress = localSetupMode.kind === "selected_agents" ? advanceCliStartHandoffProgressAfterLocalSetup({ progress }) : touchCliStartHandoffProgress({ progress });
@@ -54091,6 +54155,21 @@ async function runHandoffLocalStepWithFailedProgressSync(input) {
54091
54155
  throw error;
54092
54156
  }
54093
54157
  }
54158
+ async function runWithDelayedSpinner(input) {
54159
+ const spinner = createDelayedSpinner({
54160
+ enabled: true,
54161
+ message: input.message
54162
+ });
54163
+ spinner.start();
54164
+ try {
54165
+ const result = await input.run();
54166
+ spinner.complete(input.completeMessage);
54167
+ return result;
54168
+ } catch (error) {
54169
+ spinner.fail();
54170
+ throw error;
54171
+ }
54172
+ }
54094
54173
  async function buildValidatedHandoffObservation(input) {
54095
54174
  const observation = await buildCliStartObservation({
54096
54175
  baseUrl: input.baseUrl,
@@ -54974,6 +55053,51 @@ function formatLastSeen(lastObservedAtMs) {
54974
55053
  }).format(new Date(lastObservedAtMs))}`;
54975
55054
  }
54976
55055
 
55056
+ //#endregion
55057
+ //#region src/commands/production-web-prepare-environment.ts
55058
+ const PRODUCTION_WEB_PREPARE_ENV_KEYS = [
55059
+ ATS_HOME_ENV_KEY,
55060
+ "ATS_GATEWAY_URL",
55061
+ "ATS_AUTH_URL",
55062
+ "ATS_ENV_PRESET",
55063
+ "ATS_DEV_MODE",
55064
+ "ATS_USER_FACING_CLI_COMMAND"
55065
+ ];
55066
+ async function runWithProductionWebPrepareEnvironment(input, run) {
55067
+ const env = input.env ?? process$1.env;
55068
+ if (!shouldUseProductionWebPrepareEnvironment(input)) return run();
55069
+ const previousEnv = captureEnvironment(env);
55070
+ clearProductionWebPrepareEnvironment(env);
55071
+ try {
55072
+ return await run();
55073
+ } finally {
55074
+ restoreEnvironment(env, previousEnv);
55075
+ }
55076
+ }
55077
+ function shouldUseProductionWebPrepareEnvironment(input) {
55078
+ if (resolveKnownAtsEnvPresetFromArgv(input.argv ?? process$1.argv) !== "prod") return false;
55079
+ if (hasText(input.humanProfile) || hasText(input.startSession)) return true;
55080
+ return hasText(input.profile) && hasText(input.ott);
55081
+ }
55082
+ function captureEnvironment(env) {
55083
+ return Object.fromEntries(PRODUCTION_WEB_PREPARE_ENV_KEYS.map((key) => [key, env[key]]));
55084
+ }
55085
+ function clearProductionWebPrepareEnvironment(env) {
55086
+ for (const key of PRODUCTION_WEB_PREPARE_ENV_KEYS) Reflect.deleteProperty(env, key);
55087
+ }
55088
+ function restoreEnvironment(env, previousEnv) {
55089
+ for (const [key, value] of Object.entries(previousEnv)) {
55090
+ if (value === void 0) {
55091
+ Reflect.deleteProperty(env, key);
55092
+ continue;
55093
+ }
55094
+ env[key] = value;
55095
+ }
55096
+ }
55097
+ function hasText(value) {
55098
+ return String(value ?? "").trim().length > 0;
55099
+ }
55100
+
54977
55101
  //#endregion
54978
55102
  //#region src/system/provider-diagnostics/openclaw/presentation.ts
54979
55103
  function formatOpenClawBootstrapDisplay(input) {
@@ -59405,56 +59529,6 @@ function buildAgentPreparationPromptMessage(profiles) {
59405
59529
  return `${String(profiles.length)} local agent profiles still need setup on this device before they can wake or reply in the background. Prepare them now?`;
59406
59530
  }
59407
59531
 
59408
- //#endregion
59409
- //#region src/ui/delayed-spinner.ts
59410
- const DEFAULT_SPINNER_DELAY_MS = 250;
59411
- function createDelayedSpinner(input) {
59412
- if (!(input.enabled === true && (input.isTTY ?? process.stdout.isTTY) === true && typeof clackPrompts.spinner === "function")) return {
59413
- start: () => void 0,
59414
- complete: () => void 0,
59415
- fail: () => void 0
59416
- };
59417
- const progressSpinner = clackPrompts.spinner();
59418
- const delayMs = input.delayMs ?? DEFAULT_SPINNER_DELAY_MS;
59419
- let pendingTimer = null;
59420
- let spinnerVisible = false;
59421
- const latestMessage = input.message;
59422
- const clearPendingTimer = () => {
59423
- if (!pendingTimer) return;
59424
- clearTimeout(pendingTimer);
59425
- pendingTimer = null;
59426
- };
59427
- const ensureSpinnerStarted = () => {
59428
- if (spinnerVisible || pendingTimer) return;
59429
- pendingTimer = setTimeout(() => {
59430
- pendingTimer = null;
59431
- spinnerVisible = true;
59432
- progressSpinner.start(latestMessage);
59433
- }, delayMs);
59434
- };
59435
- return {
59436
- start: () => {
59437
- ensureSpinnerStarted();
59438
- },
59439
- complete: (message) => {
59440
- clearPendingTimer();
59441
- if (!spinnerVisible) return;
59442
- spinnerVisible = false;
59443
- if (message) {
59444
- progressSpinner.stop(message);
59445
- return;
59446
- }
59447
- progressSpinner.clear();
59448
- },
59449
- fail: () => {
59450
- clearPendingTimer();
59451
- if (!spinnerVisible) return;
59452
- spinnerVisible = false;
59453
- progressSpinner.clear();
59454
- }
59455
- };
59456
- }
59457
-
59458
59532
  //#endregion
59459
59533
  //#region src/space/agent-overview.ts
59460
59534
  const STAGES_BY_COMMAND = {
@@ -86858,25 +86932,33 @@ agentsCmd.command("prepare").description("Prepare local agent readiness on this
86858
86932
  "ats service run"
86859
86933
  ])).action(async (opts) => {
86860
86934
  const view = getGlobalViewOption();
86861
- await runCommandWithEntryChecks({
86862
- routeTokens: ["agents", "prepare"],
86863
- view,
86935
+ await runWithProductionWebPrepareEnvironment({
86936
+ argv: process.argv,
86937
+ humanProfile: opts.humanProfile,
86938
+ ott: opts.ott,
86864
86939
  profile: opts.profile,
86865
- run: async () => {
86866
- await runAgentsPrepare({
86867
- profile: opts.profile,
86868
- humanProfile: opts.humanProfile,
86869
- agent: opts.agent,
86870
- ott: opts.ott,
86871
- resetThisComputer: Boolean(opts.resetThisComputer),
86872
- startSession: opts.startSession,
86873
- view
86874
- });
86875
- await maybeRunAgentViewRecoveryAfterSuccess({
86876
- view,
86877
- profile: opts.profile
86878
- });
86879
- }
86940
+ startSession: opts.startSession
86941
+ }, async () => {
86942
+ await runCommandWithEntryChecks({
86943
+ routeTokens: ["agents", "prepare"],
86944
+ view,
86945
+ profile: opts.profile,
86946
+ run: async () => {
86947
+ await runAgentsPrepare({
86948
+ profile: opts.profile,
86949
+ humanProfile: opts.humanProfile,
86950
+ agent: opts.agent,
86951
+ ott: opts.ott,
86952
+ resetThisComputer: Boolean(opts.resetThisComputer),
86953
+ startSession: opts.startSession,
86954
+ view
86955
+ });
86956
+ await maybeRunAgentViewRecoveryAfterSuccess({
86957
+ view,
86958
+ profile: opts.profile
86959
+ });
86960
+ }
86961
+ });
86880
86962
  });
86881
86963
  });
86882
86964
  agentsCmd.command("list").alias("ls").description("List the agents ATS can use on this device.").action(async () => {