agent-transport-system 0.7.2 → 0.7.3

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.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { $ as formatLocalSetupActionDescription, $n as SPACE_PASSWORD_MIN_LENGTH, $t as resolveBuiltinProviderConversationCapability, A as claimExecutionDiagnosticsQuerySchema, An as upsertSpaceDeletionTombstoneResponseSchema, Ar as profileWorkspaceModeSchema, At as normalizeBuiltinControllerProviderId, B as currentDeviceTargetResponseSchema, Bn as CONVERSATION_CONTINUITY_WARNING_PURPOSE, Bt as postNormalMessageBodySchema, C as atsRequestContextSchema, Cn as startSessionWithTokenResponseSchema, Cr as daemonStreamFrameSchema, Ct as listProfileSpaceHistoryResponseSchema, D as canonicalizeBuiltinControllerRef, Dn as submitRuntimeRegistrationBodySchema, Dr as normalizeOptionalWorkingDirectory, Dt as localRuntimesQuerySchema, E as buildControllerRoutingKeyForKind, En as submitRuntimeCapabilityReportsResponseSchema, Er as normalizeMessageEnvelope, Et as listSpaceThreadsResponseSchema, F as createSpaceDiagnosticReportResponseSchema, Fn as AGENT_REPLYING_END_PURPOSE, Ft as observabilityWakeTraceSelectorSchema, G as dispatchBriefSchema, Gn as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Gt as postSpaceThreadSignalResponseSchema, H as daemonRouteObservationResponseSchema, Hn as DAEMON_HUB_SCHEMA_VERSION, Ht as postSpaceMembersBodySchema, I as createSpaceResponseSchema, In as AGENT_REPLYING_PURPOSE, It as patchProfileSpaceHistoryStatusResponseSchema, J as entryBriefSchema, Jn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, Jt as projectObservabilityWakeCorrelation, K as ensureAgentProfilePrimaryBindingBodySchema, Kn as LEGACY_RUNTIME_DISPATCH_POLICY, Kt as prepareSessionResponseSchema, L as createSpaceThreadBodySchema, Ln as AGENT_REPLY_PREVIEW_END_PURPOSE, Lr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Lt as patchSpaceContractBodySchema, M as continuitySchema, Mn as writeCurrentDeviceObservedMetadataResponseSchema, Mr as resolveMessageEnvelopeTargetField, Mt as normalizeSpaceCursorPatch, N as createSpaceBodySchema, Nn as writeSetupTokenLocalRuntimeObservedMetadataBodySchema, Nr as resolveSingleSpaceMentionLabels, Nt as notifyAgentProfileRouteCatalogChangedBodySchema, O as canonicalizeControllerRefForKind, On as submitRuntimeRegistrationResponseSchema, Or as normalizeSpacePasswordText, Ot as localRuntimesResponseSchema, P as createSpaceDiagnosticReportBodySchema, Pn as writeSetupTokenLocalRuntimeObservedMetadataResponseSchema, Pr as resolveSpaceMentionLabels, Pt as notifyAgentProfileRouteCatalogChangedResponseSchema, Q as formatLocalComponentsSummaryLabel, Qn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Qt as removeSpaceMembersResponseSchema, R as createSpaceThreadResponseSchema, Rn as AGENT_REPLY_PREVIEW_PURPOSE, Rr as sanitizeSignalTextPreview, Rt as patchSpaceContractResponseSchema, S as atsProfileIdSchema, Sn as startSessionSpaceChoiceResponseSchema, Sr as daemonServiceContractSchema, St as leaveSpaceResponseSchema, T as atsdControlPlaneResponseSchema, Tn as submitRuntimeCapabilityReportsBodySchema, Tr as getSpaceMessageAddressingRelationSupportForTargetKind, Tt as listSpaceThreadSignalsResponseSchema, U as daemonRuntimeLeaseSchema, Un as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Ut as postSpaceMembersResponseSchema, V as currentLocalRuntimeReplyReadinessResponseSchema, Vn as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, Vt as postNormalMessageResponseSchema, W as deleteSpaceResponseSchema, Wn as DISPATCH_ACTIVITY_FAILED_PURPOSE, Wt as postSpaceThreadSignalBodySchema, X as forgetCurrentComputerResponseSchema, Xn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Xt as providerDispatchRuntimeContextSchema, Y as forgetComputerResponseSchema, Yn as MESSAGE_MENTION_TYPE_VALUES, Yt as projectSpaceDispatchTraceFinalVisibleOutcome, Z as formatLocalComponentsSummaryDescription, Zn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, Zt as querySpaceDeletionTombstonesResponseSchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as startDeviceProjectionSchema, _r as daemonHubHeartbeatResponseSchema, _t as getSpaceWakeProgressResponseSchema, a as runWithHeldLock, an as setLocalRuntimeDisplayNameBodySchema, ar as atsdTaskResultPayloadSchema, at as getAgentExecutionReadinessResponseSchema, b as agentExecutionReadinessRouteParamsSchema, bn as startSessionResponseSchema, br as daemonHubRouteCatalogChangedFramePayloadSchema, bt as installedLocalComponentsSnapshotSchema, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as spaceConversationBindingDeleteResponseSchema, cr as conversationExecutionStateSchema, ct as getPrepareReadinessResponseSchema, d as resolveRuntimeSession, dn as spaceConversationBindingUpsertResponseSchema, dr as daemonHubDeliveryExecutionIdentitySchema, dt as getSpaceConversationStatusResponseSchema, en as resolveSpaceDispatchTraceRootCause, er as SPACE_UPDATES_MAX_LIMIT, et as formatLocalSetupActionLabel, f as resolveRuntimeSessionId, fn as spaceCreatorSchema, fr as daemonHubDispatchLifecycleRequestSchema, ft as getSpaceDispatchLookupResponseSchema, g as resolveMappedPublicAgentFailureReason, gn as spaceViewerMembershipResponseSchema, gr as daemonHubHeartbeatRequestSchema, gt as getSpaceUpdatesResponseSchema, h as resolveBuiltinAgentControllerBrand, hn as spaceMetaSchema, hr as daemonHubDispatchRuntimeEvidenceRequestSchema, ht as getSpaceThreadResponseSchema, i as releaseLock, in as setCurrentDeviceTargetBodySchema, ir as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, it as getAgentExecutionReadinessBatchResponseSchema, j as claimExecutionDiagnosticsResponseSchema, jn as writeCurrentDeviceObservedMetadataBodySchema, jr as resolveBuiltinUpstreamConversationRefKind, jt as normalizeListSignalsReadQuerySemantics, k as catchupResponseSchema, kn as upsertProfileSpaceHistoryResponseSchema, kr as parseOptionalClientMessageId, kt as normalizeBuiltinControllerAgentId, l as listRuntimeSessionStates, ln as spaceConversationBindingImportResponseSchema, lr as createDaemonRouteObservationSummary, lt as getSpaceContractResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as spaceMembersSnapshotSchema, mr as daemonHubDispatchPreviewRequestSchema, mt as getSpaceStatusResponseSchema, n as isAtsLockError, nn as resolveStartHandoffResponseSchema, nr as atsSpaceEgressActionSchema, nt as gatewayErrorEnvelopeSchema, o as tryCleanupStaleLock, on as signalEnvelopeSchema, or as buildUpstreamConversationRef, ot as getAgentProfilePrimaryBindingResponseSchema, p as writeRuntimeSessionState, pn as spaceDispatchTraceResponseSchema, pr as daemonHubDispatchPreviewEndRequestSchema, pt as getSpaceDispatchResultResponseSchema, q as ensureAgentProfilePrimaryBindingResponseSchema, qn as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, qt as prepareSessionStreamServerFrameSchema, r as readLockMeta, rn as serverErrorFrameSchema, rr as atsdTaskResultEnvelopeWriteSchema, rt as getAgentExecutionReadinessBatchBodySchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as spaceConversationBindingConflictResponseSchema, sr as collectCanonicalMentionTextFragments, st as getPrepareReadinessQuerySchema, t as acquireLock, tn as resolveStartHandoffBodySchema, tr as atsRuntimeProfileIdSchema, tt as gatewayErrorCodeSchema, u as readRuntimeSessionState, un as spaceConversationBindingResponseSchema, ur as daemonHubDeliverDispatchRequestSchema, ut as getSpaceConversationRemoteStatusResponseSchema, v as LOCAL_COMPONENTS_SCHEMA_VERSION, vn as startProfileReadinessSummarySchema, vr as daemonHubRegisterSessionRequestSchema, vt as getSpaceWakeTraceWaterfallResponseSchema, w as atsdControlPlaneRequestSchema, wn as structuredGuidePayloadFromInputSchema, wr as formatCanonicalMentionLiteral, wt as listSpaceThreadEventsResponseSchema, x as agentProfileBindingRouteParamsSchema, xn as startSessionSpaceChoiceBodySchema, xr as daemonHubSubmitTaskResultRequestSchema, xt as isExplicitBuiltinControllerRef, y as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, yn as startSessionProgressSchema, yr as daemonHubRegisterSessionResponseSchema, yt as incomingServerMessageSchema, z as createStartSessionBodySchema, zn as ATSD_TASK_RESULT_SCHEMA_VERSION, zt as patchStartSessionBodySchema } from "./lock-BG0gWBdN.js";
3
+ import { $ as formatLocalSetupActionDescription, $n as SPACE_PASSWORD_MIN_LENGTH, $t as resolveBuiltinProviderConversationCapability, A as claimExecutionDiagnosticsQuerySchema, An as upsertSpaceDeletionTombstoneResponseSchema, Ar as profileWorkspaceModeSchema, At as normalizeBuiltinControllerProviderId, B as currentDeviceTargetResponseSchema, Bn as CONVERSATION_CONTINUITY_WARNING_PURPOSE, Bt as postNormalMessageBodySchema, C as atsRequestContextSchema, Cn as startSessionWithTokenResponseSchema, Cr as daemonStreamFrameSchema, Ct as listProfileSpaceHistoryResponseSchema, D as canonicalizeBuiltinControllerRef, Dn as submitRuntimeRegistrationBodySchema, Dr as normalizeOptionalWorkingDirectory, Dt as localRuntimesQuerySchema, E as buildControllerRoutingKeyForKind, En as submitRuntimeCapabilityReportsResponseSchema, Er as normalizeMessageEnvelope, Et as listSpaceThreadsResponseSchema, F as createSpaceDiagnosticReportResponseSchema, Fn as AGENT_REPLYING_END_PURPOSE, Ft as observabilityWakeTraceSelectorSchema, G as dispatchBriefSchema, Gn as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Gt as postSpaceThreadSignalResponseSchema, H as daemonRouteObservationResponseSchema, Hn as DAEMON_HUB_SCHEMA_VERSION, Ht as postSpaceMembersBodySchema, I as createSpaceResponseSchema, In as AGENT_REPLYING_PURPOSE, It as patchProfileSpaceHistoryStatusResponseSchema, J as entryBriefSchema, Jn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, Jt as projectObservabilityWakeCorrelation, K as ensureAgentProfilePrimaryBindingBodySchema, Kn as LEGACY_RUNTIME_DISPATCH_POLICY, Kt as prepareSessionResponseSchema, L as createSpaceThreadBodySchema, Ln as AGENT_REPLY_PREVIEW_END_PURPOSE, Lr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Lt as patchSpaceContractBodySchema, M as continuitySchema, Mn as writeCurrentDeviceObservedMetadataResponseSchema, Mr as resolveMessageEnvelopeTargetField, Mt as normalizeSpaceCursorPatch, N as createSpaceBodySchema, Nn as writeSetupTokenLocalRuntimeObservedMetadataBodySchema, Nr as resolveSingleSpaceMentionLabels, Nt as notifyAgentProfileRouteCatalogChangedBodySchema, O as canonicalizeControllerRefForKind, On as submitRuntimeRegistrationResponseSchema, Or as normalizeSpacePasswordText, Ot as localRuntimesResponseSchema, P as createSpaceDiagnosticReportBodySchema, Pn as writeSetupTokenLocalRuntimeObservedMetadataResponseSchema, Pr as resolveSpaceMentionLabels, Pt as notifyAgentProfileRouteCatalogChangedResponseSchema, Q as formatLocalComponentsSummaryLabel, Qn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Qt as removeSpaceMembersResponseSchema, R as createSpaceThreadResponseSchema, Rn as AGENT_REPLY_PREVIEW_PURPOSE, Rr as sanitizeSignalTextPreview, Rt as patchSpaceContractResponseSchema, S as atsProfileIdSchema, Sn as startSessionSpaceChoiceResponseSchema, Sr as daemonServiceContractSchema, St as leaveSpaceResponseSchema, T as atsdControlPlaneResponseSchema, Tn as submitRuntimeCapabilityReportsBodySchema, Tr as getSpaceMessageAddressingRelationSupportForTargetKind, Tt as listSpaceThreadSignalsResponseSchema, U as daemonRuntimeLeaseSchema, Un as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, Ut as postSpaceMembersResponseSchema, V as currentLocalRuntimeReplyReadinessResponseSchema, Vn as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, Vt as postNormalMessageResponseSchema, W as deleteSpaceResponseSchema, Wn as DISPATCH_ACTIVITY_FAILED_PURPOSE, Wt as postSpaceThreadSignalBodySchema, X as forgetCurrentComputerResponseSchema, Xn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Xt as providerDispatchRuntimeContextSchema, Y as forgetComputerResponseSchema, Yn as MESSAGE_MENTION_TYPE_VALUES, Yt as projectSpaceDispatchTraceFinalVisibleOutcome, Z as formatLocalComponentsSummaryDescription, Zn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, Zt as querySpaceDeletionTombstonesResponseSchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as startDeviceProjectionSchema, _r as daemonHubHeartbeatResponseSchema, _t as getSpaceWakeProgressResponseSchema, a as runWithHeldLock, an as setLocalRuntimeDisplayNameBodySchema, ar as atsdTaskResultPayloadSchema, at as getAgentExecutionReadinessResponseSchema, b as agentExecutionReadinessRouteParamsSchema, bn as startSessionResponseSchema, br as daemonHubRouteCatalogChangedFramePayloadSchema, bt as installedLocalComponentsSnapshotSchema, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as spaceConversationBindingDeleteResponseSchema, cr as conversationExecutionStateSchema, ct as getPrepareReadinessResponseSchema, d as resolveRuntimeSession, dn as spaceConversationBindingUpsertResponseSchema, dr as daemonHubDeliveryExecutionIdentitySchema, dt as getSpaceConversationStatusResponseSchema, en as resolveSpaceDispatchTraceRootCause, er as SPACE_UPDATES_MAX_LIMIT, et as formatLocalSetupActionLabel, f as resolveRuntimeSessionId, fn as spaceCreatorSchema, fr as daemonHubDispatchLifecycleRequestSchema, ft as getSpaceDispatchLookupResponseSchema, g as resolveMappedPublicAgentFailureReason, gn as spaceViewerMembershipResponseSchema, gr as daemonHubHeartbeatRequestSchema, gt as getSpaceUpdatesResponseSchema, h as resolveBuiltinAgentControllerBrand, hn as spaceMetaSchema, hr as daemonHubDispatchRuntimeEvidenceRequestSchema, ht as getSpaceThreadResponseSchema, i as releaseLock, in as setCurrentDeviceTargetBodySchema, ir as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, it as getAgentExecutionReadinessBatchResponseSchema, j as claimExecutionDiagnosticsResponseSchema, jn as writeCurrentDeviceObservedMetadataBodySchema, jr as resolveBuiltinUpstreamConversationRefKind, jt as normalizeListSignalsReadQuerySemantics, k as catchupResponseSchema, kn as upsertProfileSpaceHistoryResponseSchema, kr as parseOptionalClientMessageId, kt as normalizeBuiltinControllerAgentId, l as listRuntimeSessionStates, ln as spaceConversationBindingImportResponseSchema, lr as createDaemonRouteObservationSummary, lt as getSpaceContractResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as spaceMembersSnapshotSchema, mr as daemonHubDispatchPreviewRequestSchema, mt as getSpaceStatusResponseSchema, n as isAtsLockError, nn as resolveStartHandoffResponseSchema, nr as atsSpaceEgressActionSchema, nt as gatewayErrorEnvelopeSchema, o as tryCleanupStaleLock, on as signalEnvelopeSchema, or as buildUpstreamConversationRef, ot as getAgentProfilePrimaryBindingResponseSchema, p as writeRuntimeSessionState, pn as spaceDispatchTraceResponseSchema, pr as daemonHubDispatchPreviewEndRequestSchema, pt as getSpaceDispatchResultResponseSchema, q as ensureAgentProfilePrimaryBindingResponseSchema, qn as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, qt as prepareSessionStreamServerFrameSchema, r as readLockMeta, rn as serverErrorFrameSchema, rr as atsdTaskResultEnvelopeWriteSchema, rt as getAgentExecutionReadinessBatchBodySchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as spaceConversationBindingConflictResponseSchema, sr as collectCanonicalMentionTextFragments, st as getPrepareReadinessQuerySchema, t as acquireLock, tn as resolveStartHandoffBodySchema, tr as atsRuntimeProfileIdSchema, tt as gatewayErrorCodeSchema, u as readRuntimeSessionState, un as spaceConversationBindingResponseSchema, ur as daemonHubDeliverDispatchRequestSchema, ut as getSpaceConversationRemoteStatusResponseSchema, v as LOCAL_COMPONENTS_SCHEMA_VERSION, vn as startProfileReadinessSummarySchema, vr as daemonHubRegisterSessionRequestSchema, vt as getSpaceWakeTraceWaterfallResponseSchema, w as atsdControlPlaneRequestSchema, wn as structuredGuidePayloadFromInputSchema, wr as formatCanonicalMentionLiteral, wt as listSpaceThreadEventsResponseSchema, x as agentProfileBindingRouteParamsSchema, xn as startSessionSpaceChoiceBodySchema, xr as daemonHubSubmitTaskResultRequestSchema, xt as isExplicitBuiltinControllerRef, y as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, yn as startSessionProgressSchema, yr as daemonHubRegisterSessionResponseSchema, yt as incomingServerMessageSchema, z as createStartSessionBodySchema, zn as ATSD_TASK_RESULT_SCHEMA_VERSION, zt as patchStartSessionBodySchema } from "./lock-BeL3w4ma.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 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-D3F15r0W.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-BmPPPJcT.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.2";
30
+ var version = "0.7.3";
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-05-31",
35
+ atsReleaseDate: "2026-06-01",
36
36
  description: "Agent Transport System CLI - https://ats.sh",
37
37
  license: "MIT",
38
38
  type: "module",
@@ -4336,7 +4336,7 @@ async function setDaemonServiceRuntimeState(state, pathInput = {}) {
4336
4336
  await writeDaemonServiceRuntimeState(state, pathInput);
4337
4337
  }
4338
4338
  async function clearDaemonServiceRuntimeState(pathInput = {}) {
4339
- const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-DYVTk_Z6.js");
4339
+ const { clearDaemonRuntimeLease } = await import("./daemon-runtime-lease-BWYGVA4a.js");
4340
4340
  await Promise.all([rm(daemonServiceRuntimeStatePath(pathInput), { force: true }), clearDaemonRuntimeLease(pathInput)]);
4341
4341
  }
4342
4342
  async function withDaemonServiceRunLock(callback, meta = {
@@ -21298,6 +21298,8 @@ function extractOutputFromCodexLine(line) {
21298
21298
  const item = record.item && typeof record.item === "object" && !Array.isArray(record.item) ? record.item : null;
21299
21299
  const response = record.response && typeof record.response === "object" && !Array.isArray(record.response) ? record.response : null;
21300
21300
  if (record.type === "item.completed" && item?.type === "agent_message") {
21301
+ const phase = normalizeOptionalText$23(item.phase ?? record.phase);
21302
+ if (phase && phase !== "final_answer") return null;
21301
21303
  const text = normalizeOptionalText$23(item.text);
21302
21304
  return text ? {
21303
21305
  previewable: false,
@@ -29078,6 +29080,110 @@ function normalizeOptionalText$7$1(value) {
29078
29080
  const normalized = String(value ?? "").trim();
29079
29081
  return normalized.length > 0 ? normalized : null;
29080
29082
  }
29083
+ const WORD_CHARACTER_PATTERN = /\w/u;
29084
+ const BARE_MENTION_BOUNDARY_PATTERN = /[\s.,!?;:,。!?;:\]})"'`]/u;
29085
+ const WHITESPACE_PATTERN$1 = /\s+/g;
29086
+ const MAX_BARE_MENTION_DIAGNOSTICS = 5;
29087
+ function listSpaceBareMentionDiagnostics(input) {
29088
+ if (!input.text.includes("@")) return [];
29089
+ const candidates = buildBareMentionCandidates(createSpaceTargetCatalog(input.snapshot).entries);
29090
+ if (candidates.length === 0) return [];
29091
+ const maxResults = Math.max(1, Math.min(input.maxResults ?? MAX_BARE_MENTION_DIAGNOSTICS, 20));
29092
+ const diagnostics = [];
29093
+ const seenStarts = /* @__PURE__ */ new Set();
29094
+ for (let cursor = 0; cursor < input.text.length; cursor += 1) {
29095
+ const atIndex = input.text.indexOf("@", cursor);
29096
+ if (atIndex < 0) break;
29097
+ cursor = atIndex;
29098
+ if (!isPotentialBareMentionStart(input.text, atIndex)) continue;
29099
+ const match = resolveBareMentionCandidateAt({
29100
+ atIndex,
29101
+ candidates,
29102
+ text: input.text
29103
+ });
29104
+ if (!match || seenStarts.has(atIndex)) continue;
29105
+ seenStarts.add(atIndex);
29106
+ diagnostics.push(toBareMentionDiagnostic(match));
29107
+ cursor = Math.max(cursor, match.end - 1);
29108
+ if (diagnostics.length >= maxResults) break;
29109
+ }
29110
+ return diagnostics;
29111
+ }
29112
+ function buildBareMentionCandidates(entries) {
29113
+ const candidatesByLabel = /* @__PURE__ */ new Map();
29114
+ for (const entry of entries) {
29115
+ const labels = new Set([
29116
+ entry.profileName,
29117
+ entry.primaryMentionLabel,
29118
+ ...entry.mentionAlias ? [entry.mentionAlias] : [],
29119
+ ...entry.exactMentionLabels
29120
+ ]);
29121
+ for (const label of labels) {
29122
+ const normalized = normalizeLabel(label);
29123
+ if (!normalized) continue;
29124
+ const key = normalized.toLowerCase();
29125
+ const existing = candidatesByLabel.get(key);
29126
+ if (existing === void 0) {
29127
+ candidatesByLabel.set(key, {
29128
+ entry,
29129
+ label: normalized
29130
+ });
29131
+ continue;
29132
+ }
29133
+ if (existing === null || existing.entry.profileId !== entry.profileId) candidatesByLabel.set(key, null);
29134
+ }
29135
+ }
29136
+ return [...candidatesByLabel.values()].filter((candidate) => candidate !== null).sort((left, right) => right.label.length - left.label.length);
29137
+ }
29138
+ function resolveBareMentionCandidateAt(input) {
29139
+ const tail = input.text.slice(input.atIndex + 1);
29140
+ const lowerTail = tail.toLowerCase();
29141
+ for (const candidate of input.candidates) {
29142
+ const lowerLabel = candidate.label.toLowerCase();
29143
+ if (!lowerTail.startsWith(lowerLabel)) continue;
29144
+ const afterLabel = tail.slice(candidate.label.length);
29145
+ if (isCanonicalMentionRelationSuffix(afterLabel)) continue;
29146
+ if (!isBareMentionBoundary(afterLabel[0] ?? "")) continue;
29147
+ const end = input.atIndex + 1 + candidate.label.length;
29148
+ return {
29149
+ candidate,
29150
+ end,
29151
+ mentionText: input.text.slice(input.atIndex, end),
29152
+ start: input.atIndex
29153
+ };
29154
+ }
29155
+ return null;
29156
+ }
29157
+ function toBareMentionDiagnostic(input) {
29158
+ const label = input.candidate.entry.primaryMentionLabel;
29159
+ const suggestedWakeText = input.candidate.entry.profileKind === "agent" && input.candidate.entry.allowedRelations.wake ? `@${label}(wake)` : null;
29160
+ return {
29161
+ end: input.end,
29162
+ mentionText: input.mentionText,
29163
+ profileId: input.candidate.entry.profileId,
29164
+ profileKind: input.candidate.entry.profileKind,
29165
+ profileName: input.candidate.entry.profileName,
29166
+ start: input.start,
29167
+ suggestedCcText: `@${label}(cc)`,
29168
+ suggestedReferenceText: `@${label}(reference)`,
29169
+ suggestedWakeText
29170
+ };
29171
+ }
29172
+ function isPotentialBareMentionStart(text, atIndex) {
29173
+ const previous = atIndex > 0 ? text[atIndex - 1] ?? "" : "";
29174
+ return !(previous === "\\" || WORD_CHARACTER_PATTERN.test(previous));
29175
+ }
29176
+ function isBareMentionBoundary(value) {
29177
+ if (!value) return true;
29178
+ return BARE_MENTION_BOUNDARY_PATTERN.test(value);
29179
+ }
29180
+ function isCanonicalMentionRelationSuffix(value) {
29181
+ return value.startsWith("(wake)") || value.startsWith("(reference)") || value.startsWith("(cc)");
29182
+ }
29183
+ function normalizeLabel(value) {
29184
+ const normalized = String(value ?? "").replaceAll(WHITESPACE_PATTERN$1, " ").trim();
29185
+ return normalized.length > 0 ? normalized : null;
29186
+ }
29081
29187
  const CANONICAL_MENTION_TYPES = new Set(MESSAGE_MENTION_TYPE_VALUES);
29082
29188
  const DUPLICATE_TARGET_ISSUE_PATTERN = /^(activationTargets|referenceTargets|ccTargets) must not contain duplicate profileId$/u;
29083
29189
  const DISTINCT_TARGET_ISSUE_PATTERN = /^(activationTargets|referenceTargets|ccTargets) must not reuse profileId from (activationTargets|referenceTargets|ccTargets)$/u;
@@ -37489,24 +37595,36 @@ function buildActionGuidanceLines(input) {
37489
37595
  const lines = [];
37490
37596
  if (publicationRequirement.allowsRawReplyWithoutAction) lines.push("- Default: share your raw reply to the Space.");
37491
37597
  else lines.push("- Keep private work, progress narration, tool logs, and drafts in your local agent context unless the user explicitly asked to publish them.");
37492
- lines.push(`- ${publicationRequirement.actionRequirementLine}`);
37493
- lines.push("- When ATS Space Action commands are available, run one command in the shell. Do not print fallback JSON as your final answer unless every Space Action command fails.");
37494
- lines.push(...buildSpaceActionCommandLines(input, publicationRequirement));
37598
+ lines.push(buildPrimaryFinalActionLine(input, publicationRequirement));
37599
+ lines.push(...buildConditionalSpaceActionCommandLines(input, publicationRequirement));
37495
37600
  lines.push(`- Need context? Run \`${buildSpaceHistoryCommand({
37496
37601
  cliEntry: input.cliEntry,
37497
37602
  spaceId: input.spaceId
37498
37603
  })}\`.`);
37499
37604
  if (input.threadContext) lines.push("- This dispatch belongs to a thread. Public replies should stay in that thread unless explicitly asked to reply in the main Space.");
37500
37605
  lines.push("- If the current message mentions multiple targets, handle only the part assigned to you unless it explicitly asks you to synthesize for the group.");
37501
- lines.push("- For a normal reply to this Wake, do not add target flags.", "- To hand off, reference, or CC someone else, use ATS Space Action target flags instead of only typing @names in prose.");
37606
+ lines.push("- Wake asks another Agent Profile to act. Reference and CC are context only. Bare @names in prose do not create executable work.", "- For a normal reply to this Wake, do not add target flags. Use target flags only when this Wake asks you to hand off, reference, or CC another profile.");
37502
37607
  lines.push(`- Need action details? Run \`${buildSpaceActionCommand(input, "help")}\`. Only if every Space Action command fails, use \`${buildPromptSpaceActionCommand(input)}\` for fallback JSON.`);
37503
37608
  return lines;
37504
37609
  }
37505
- function buildSpaceActionCommandLines(input, publicationRequirement) {
37610
+ function buildPrimaryFinalActionLine(input, publicationRequirement) {
37611
+ if (publicationRequirement.allowsRawReplyWithoutAction) return "- Final action for this Wake: write the public reply normally.";
37612
+ if (publicationRequirement.allowedActions.includes("post_message")) return `- Final action for this Wake: run \`${buildSpaceActionCommand(input, "reply \"message\"")}\`.`;
37613
+ if (publicationRequirement.allowedActions.includes("post_status")) return `- Final action for this Wake: run \`${buildSpaceActionCommand(input, "status done \"short completion update\"")}\`.`;
37614
+ if (publicationRequirement.allowedActions.includes("stay_silent")) return `- Final action for this Wake: run \`${buildSpaceActionCommand(input, "silent --reason \"reason\"")}\`.`;
37615
+ return `- Final action for this Wake: run \`${buildPromptSpaceActionCommand(input)}\` and use one trailing ats-space-action block.`;
37616
+ }
37617
+ function buildConditionalSpaceActionCommandLines(input, publicationRequirement) {
37506
37618
  const lines = [];
37507
- if (publicationRequirement.allowedActions.includes("post_message")) lines.push(` Reply: \`${buildSpaceActionCommand(input, "reply \"message\"")}\``, ` Handoff: \`${buildSpaceActionCommand(input, "wake \"@Agent Name\" \"summary and request\"")}\``, ` Reply + handoff: \`${buildSpaceActionCommand(input, "reply --wake \"@Agent Name\" \"message\"")}\``);
37508
- if (publicationRequirement.allowedActions.includes("post_status")) lines.push(` Status: \`${buildSpaceActionCommand(input, "status done \"short update\"")}\``);
37509
- if (publicationRequirement.allowedActions.includes("stay_silent")) lines.push(` Silent: \`${buildSpaceActionCommand(input, "silent --reason \"reason\"")}\``);
37619
+ if (publicationRequirement.allowedActions.includes("post_message")) lines.push("- Other action forms only when this Wake requires them:", ` Handoff: \`${buildSpaceActionCommand(input, "wake \"@Agent Name\" \"summary and request\"")}\``, ` Reply + handoff: \`${buildSpaceActionCommand(input, "reply --wake \"@Agent Name\" \"message\"")}\``);
37620
+ if (publicationRequirement.allowedActions.includes("post_status")) {
37621
+ if (lines.length === 0) lines.push("- Other action forms only when this Wake requires them:");
37622
+ lines.push(` Status: \`${buildSpaceActionCommand(input, "status done \"short update\"")}\``);
37623
+ }
37624
+ if (publicationRequirement.allowedActions.includes("stay_silent")) {
37625
+ if (lines.length === 0) lines.push("- Other action forms only when this Wake requires them:");
37626
+ lines.push(` Silent: \`${buildSpaceActionCommand(input, "silent --reason \"reason\"")}\``);
37627
+ }
37510
37628
  lines.push(` Targets: \`${buildSpaceActionCommand(input, "targets")}\``, ` Help: \`${buildSpaceActionCommand(input, "help")}\``);
37511
37629
  return lines;
37512
37630
  }
@@ -59346,8 +59464,8 @@ function emitProfileCreateAgentSetupHint(input) {
59346
59464
  ...input.setupResult.status === "skipped_no_enabled_controllers" && input.setupResult.reason ? { reason: input.setupResult.reason } : {},
59347
59465
  profileId: input.profile.atsProfileId,
59348
59466
  nextSteps: [
59349
- "For this existing profile, open ATS Web setup and choose a local agent.",
59350
- `After it is connected, run ${prepareCommand} to connect this computer for that profile.`,
59467
+ `For this existing profile, run ${formatAtsCliCommand(`ats setup --profile ${input.profile.atsProfileId} --local-agent <local-agent-id> --view agent`)} when you know which local agent it should use.`,
59468
+ `Or run ${prepareCommand} in an interactive Terminal and choose the local agent there.`,
59351
59469
  `For a new CLI-only Codex profile, run ${explicitControllerCreateCommand}.`
59352
59470
  ],
59353
59471
  cliOnlyCreateCommand: explicitControllerCreateCommand
@@ -59357,7 +59475,7 @@ function emitProfileCreateAgentSetupHint(input) {
59357
59475
  }
59358
59476
  input.presenter.line({
59359
59477
  code: "profile.create.agent_setup.skipped",
59360
- text: formatInlineAtsCliCommands(`${summary} For this existing profile, open ATS Web setup and choose a local agent. For a new CLI-only Codex profile, run \`${explicitControllerCreateCommand}\`.`)
59478
+ text: formatInlineAtsCliCommands(`${summary} For this existing profile, run \`ats setup --profile ${input.profile.atsProfileId} --local-agent <local-agent-id>\` when you know which local agent it should use, or run \`${prepareCommand}\` in an interactive Terminal. For a new CLI-only Codex profile, run \`${explicitControllerCreateCommand}\`.`)
59361
59479
  });
59362
59480
  }
59363
59481
  async function runProfileSet(input) {
@@ -60315,6 +60433,7 @@ function renderProfileSummaryCard(input) {
60315
60433
  }
60316
60434
  function buildAgentCreateNextSteps(profile) {
60317
60435
  if (profile.profileKind === "agent") return [
60436
+ formatAtsCliCommand(`ats setup --profile ${profile.atsProfileId} --local-agent <local-agent-id> --view agent`),
60318
60437
  formatAtsCliCommand(`ats setup --profile ${profile.atsProfileId} --view agent`),
60319
60438
  formatAtsCliCommand(`ats service status --profile ${profile.atsProfileId} --view agent`),
60320
60439
  formatAtsCliCommand(`ats profiles show ${profile.atsProfileId} --view agent`),
@@ -60343,13 +60462,14 @@ function buildProfileCreateWakeReadinessRows(input) {
60343
60462
  value: "Not verified by profile creation"
60344
60463
  }, {
60345
60464
  label: "Next",
60346
- value: `Run ${formatAtsCliCommand(`ats setup --profile ${input.profile.atsProfileId}`)} before expecting this Agent Profile to reply from a Space.`
60465
+ value: `Run ${formatAtsCliCommand(`ats setup --profile ${input.profile.atsProfileId} --local-agent <local-agent-id>`)} before expecting this Agent Profile to reply from a Space.`
60347
60466
  }];
60348
60467
  }
60349
60468
  function buildAgentUpdateNextSteps(profile) {
60350
60469
  return [
60351
60470
  formatAtsCliCommand(`ats profiles show ${profile.atsProfileId} --view agent`),
60352
60471
  formatAtsCliCommand(`ats profiles update ${profile.atsProfileId} --name <new-name> --view agent`),
60472
+ formatAtsCliCommand(`ats setup --profile ${profile.atsProfileId} --local-agent <local-agent-id> --view agent`),
60353
60473
  formatAtsCliCommand(`ats setup --profile ${profile.atsProfileId} --view agent`),
60354
60474
  formatAtsCliCommand(`ats profiles update ${profile.atsProfileId} --workspace-mode ats-managed --view agent`),
60355
60475
  formatAtsCliCommand(`ats profiles update ${profile.atsProfileId} --workspace-mode custom --workspace-path /absolute/path --view agent`),
@@ -60524,8 +60644,10 @@ const PROMPT_GUIDE_CATALOG = {
60524
60644
  summary: "Use this guide when an agent needs to reply, hand off, status, or stay silent inside an ATS Space Wake dispatch.",
60525
60645
  humanSteps: [
60526
60646
  "Use the exact `<DISPATCH_ACTION_CLI> space action ...` command printed in the current Wake dispatch prompt.",
60647
+ "Run the one final action named at the top of the current dispatch prompt before reading optional forms.",
60527
60648
  "Use `reply` for the normal final answer.",
60528
- "Use `wake` or `reply --wake` when handing off to another Agent Profile.",
60649
+ "Use `wake` or `reply --wake` only when handing off work to another Agent Profile.",
60650
+ "Use `--reference` or `--cc` when another profile should be mentioned for context but should not start work.",
60529
60651
  "Use `status` only for final-safe status outcomes, not ongoing progress.",
60530
60652
  "Use `ats-space-action` structured blocks only as a fallback when the CLI action command is unavailable."
60531
60653
  ],
@@ -60543,6 +60665,7 @@ const PROMPT_GUIDE_CATALOG = {
60543
60665
  "`<DISPATCH_ACTION_CLI>` is a placeholder in guides, not a literal command.",
60544
60666
  "Fallback JSON is last resort: only if every Space Action CLI command fails, run `ats prompt space-action --raw` and use one trailing `ats-space-action` block.",
60545
60667
  "Wake targets must be Agent Profiles available for Wake in the current Space.",
60668
+ "Bare @names in prose are not execution targets in the agent path; use target flags for Wake, Reference, or CC semantics.",
60546
60669
  "`working` is not accepted here because status actions are final visible outcomes in the current contract."
60547
60670
  ]
60548
60671
  }
@@ -61575,7 +61698,7 @@ async function runServiceTrace(input, deps = {}) {
61575
61698
  guidance: traceReadinessGuidance
61576
61699
  };
61577
61700
  if (runtime.resolvedView === "agent") {
61578
- presenter.data({
61701
+ if (input.details === true) presenter.data({
61579
61702
  code: "service.trace.result",
61580
61703
  payload
61581
61704
  });
@@ -61583,7 +61706,11 @@ async function runServiceTrace(input, deps = {}) {
61583
61706
  code: "service.trace.summary",
61584
61707
  text: formatAgentTraceCompactSummary(agentSummary),
61585
61708
  data: {
61586
- ...payload,
61709
+ correlation: payload.correlation,
61710
+ query: payload.query,
61711
+ selector: payload.selector,
61712
+ targetProfile: payload.targetProfile,
61713
+ agentSummary,
61587
61714
  diagnosticSummary: buildAgentTraceSummary({
61588
61715
  dispatchId: traceResponse.query.dispatchId,
61589
61716
  trace: traceResponse.trace
@@ -63901,6 +64028,7 @@ async function prepareLocalAgentReadiness(input) {
63901
64028
  }
63902
64029
  const result = await prepareSingleAgentProfile({
63903
64030
  profile,
64031
+ explicitLocalAgentId: input.explicitLocalAgentSelections?.get(profile.atsProfileId),
63904
64032
  interactive: input.interactive,
63905
64033
  view: input.view
63906
64034
  });
@@ -63920,9 +64048,18 @@ async function prepareSingleAgentProfile(input) {
63920
64048
  const profile = input.profile;
63921
64049
  let prepared = false;
63922
64050
  let snapshot = await resolveProfileReadinessSnapshot(profile);
63923
- if (needsControllerSetup({
64051
+ if (input.explicitLocalAgentId) {
64052
+ await bindAgentProfileToExplicitLocalAgent({
64053
+ localAgentId: input.explicitLocalAgentId,
64054
+ profile
64055
+ });
64056
+ prepared = true;
64057
+ snapshot = await resolveProfileReadinessSnapshot(profile);
64058
+ }
64059
+ const initialReasonCodes = collectPreparationReasonCodes(snapshot);
64060
+ if (!input.explicitLocalAgentId && needsControllerSetup({
63924
64061
  profile,
63925
- reasonCodes: collectPreparationReasonCodes(snapshot)
64062
+ reasonCodes: initialReasonCodes
63926
64063
  })) {
63927
64064
  if (!input.interactive) return {
63928
64065
  status: "unchanged",
@@ -63987,6 +64124,27 @@ async function prepareSingleAgentProfile(input) {
63987
64124
  profile
63988
64125
  };
63989
64126
  }
64127
+ async function bindAgentProfileToExplicitLocalAgent(input) {
64128
+ const capabilityRef = resolveCapabilityRefFromControllerTarget({
64129
+ controllerKind: "builtin",
64130
+ controllerRef: input.localAgentId
64131
+ });
64132
+ if (!capabilityRef) throw new Error(`Unknown local agent "${input.localAgentId}". Use a builtin local agent ID such as codex or claude-code.`);
64133
+ const runtimeReportSubmission = await submitRuntimeCapabilityReport({
64134
+ capabilityRef,
64135
+ diagnosticProfileId: input.profile.atsProfileId,
64136
+ localParticipationState: "ready",
64137
+ reasonCodes: ["runtime.capability_report.ready"]
64138
+ });
64139
+ await ensureAgentProfileRuntimeBinding({
64140
+ profile: input.profile,
64141
+ runtimeReportSubmission
64142
+ });
64143
+ await persistAgentTransportSelection({
64144
+ controllerRef: input.localAgentId,
64145
+ transportMode: "local-cli"
64146
+ });
64147
+ }
63990
64148
  async function prepareLocalAgentLaunchIfNeeded(input) {
63991
64149
  if (needsLocalAgentLaunchChoice(input.reasonCodes)) {
63992
64150
  const enableResult = await runAgentsEnable({
@@ -64736,10 +64894,12 @@ async function connectSelectedLocalAgentsToAts(input) {
64736
64894
  localAgentIds: input.localAgentIds
64737
64895
  }));
64738
64896
  if (input.syncRouteCatalog) await waitForConfirmedRouteCatalogSync$1({
64739
- confirmWakeAvailability: async () => await assertCurrentLocalRuntimeCanReceiveWake({
64740
- gatewayUrl: input.gatewayUrl,
64741
- runtimeIdentity
64742
- }),
64897
+ confirmWakeAvailability: async () => {
64898
+ await assertCurrentLocalRuntimeCanReceiveWake({
64899
+ gatewayUrl: input.gatewayUrl,
64900
+ runtimeIdentity
64901
+ });
64902
+ },
64743
64903
  reason: "prepare_selected_agents_connected"
64744
64904
  });
64745
64905
  return {
@@ -67403,9 +67563,11 @@ async function runSetupLocalAgentConnection(input) {
67403
67563
  };
67404
67564
  }
67405
67565
  const agentProfile = profile;
67566
+ const explicitLocalAgentId = resolveStandaloneProfileLocalAgentId(input);
67406
67567
  const result = await prepareLocalAgentReadiness({
67407
67568
  profiles: [agentProfile],
67408
67569
  interactive,
67570
+ ...explicitLocalAgentId ? { explicitLocalAgentSelections: new Map([[agentProfile.atsProfileId, explicitLocalAgentId]]) } : {},
67409
67571
  view: input.view
67410
67572
  });
67411
67573
  if (result.status === "cancelled") return {
@@ -67450,24 +67612,28 @@ function emitSetupLocalAgentConnectionHeader(input) {
67450
67612
  });
67451
67613
  }
67452
67614
  function assertValidSetupLocalAgentConnectionInput(input) {
67453
- const hasStartSession = typeof input.startSession === "string" && input.startSession.trim().length > 0;
67454
- const hasProfile = typeof input.profile === "string" && input.profile.trim().length > 0;
67455
- const hasHumanProfile = typeof input.humanProfile === "string" && input.humanProfile.trim().length > 0;
67456
- const hasLocalAgentPreparation = Array.isArray(input.agent) && input.agent.length > 0;
67457
- const localAgentMode = normalizeOptionalString$6(input.localAgents);
67458
- const hasPrepareSessionLocalAgentMode = localAgentMode !== null;
67459
- const hasPrepareSessionLocalAgentIds = Array.isArray(input.localAgent) && input.localAgent.length > 0;
67460
- if (hasStartSession && (hasProfile || hasHumanProfile || hasLocalAgentPreparation)) throw new Error("--start-session cannot be combined with --profile, --human-profile, or --agent.");
67461
- if (!hasStartSession && (hasPrepareSessionLocalAgentMode || hasPrepareSessionLocalAgentIds)) throw new Error("--local-agents and --local-agent require --start-session.");
67462
- if (hasPrepareSessionLocalAgentMode && hasPrepareSessionLocalAgentIds) throw new Error("use either --local-agents <all|none> or --local-agent <id...>, not both");
67463
- if (hasPrepareSessionLocalAgentMode && localAgentMode !== "all" && localAgentMode !== "none") throw new Error("--local-agents must be either all or none.");
67464
- if (hasHumanProfile && (hasProfile || hasLocalAgentPreparation)) throw new Error("--human-profile cannot be combined with --profile or --agent.");
67465
- if (hasProfile && hasLocalAgentPreparation) throw new Error("use either --profile <id> or --agent <id...>, not both");
67615
+ const facts = resolveSetupLocalAgentConnectionInputFacts(input);
67616
+ if (facts.hasStartSession && (facts.hasProfile || facts.hasHumanProfile || facts.hasLocalAgentPreparation)) throw new Error("--start-session cannot be combined with --profile, --human-profile, or --agent.");
67617
+ if (!facts.hasStartSession && facts.hasPrepareSessionLocalAgentMode) throw new Error("--local-agents requires --start-session.");
67618
+ assertValidLocalAgentSelectionInput({
67619
+ facts,
67620
+ localAgent: input.localAgent
67621
+ });
67622
+ if (facts.hasPrepareSessionLocalAgentMode && facts.localAgentMode !== "all" && facts.localAgentMode !== "none") throw new Error("--local-agents must be either all or none.");
67623
+ if (facts.hasHumanProfile && (facts.hasProfile || facts.hasLocalAgentPreparation)) throw new Error("--human-profile cannot be combined with --profile or --agent.");
67624
+ if (facts.hasProfile && facts.hasLocalAgentPreparation) throw new Error("use either --profile <id> or --agent <id...>, not both");
67625
+ }
67626
+ function resolveStandaloneProfileLocalAgentId(input) {
67627
+ if (!normalizeOptionalString$6(input.profile)) return null;
67628
+ return normalizeLocalAgentIds(input.localAgent)[0] ?? null;
67629
+ }
67630
+ function normalizeLocalAgentIds(localAgent) {
67631
+ return Array.from(new Set((localAgent ?? []).map((agentId) => normalizeOptionalString$6(agentId)).filter((agentId) => agentId !== null)));
67466
67632
  }
67467
67633
  function resolvePrepareSessionLocalAgentSelection(input) {
67468
67634
  const localAgentMode = normalizeOptionalString$6(input.localAgents);
67469
67635
  if (localAgentMode === "all" || localAgentMode === "none") return { mode: localAgentMode };
67470
- const localAgentIds = Array.from(new Set((input.localAgent ?? []).map((agentId) => agentId.trim()).filter((agentId) => agentId.length > 0)));
67636
+ const localAgentIds = normalizeLocalAgentIds(input.localAgent);
67471
67637
  if (localAgentIds.length > 0) return {
67472
67638
  localAgentIds,
67473
67639
  mode: "specific"
@@ -67499,6 +67665,25 @@ async function maybeLogInWithOneTimeToken$1(input) {
67499
67665
  agentOverviewHandled: true
67500
67666
  }) !== "completed") throw new Error("ATS sign-in was cancelled before local preparation ran.");
67501
67667
  }
67668
+ function resolveSetupLocalAgentConnectionInputFacts(input) {
67669
+ const localAgentMode = normalizeOptionalString$6(input.localAgents);
67670
+ return {
67671
+ hasHumanProfile: typeof input.humanProfile === "string" && input.humanProfile.trim().length > 0,
67672
+ hasLocalAgentIds: Array.isArray(input.localAgent) && input.localAgent.length > 0,
67673
+ hasLocalAgentPreparation: Array.isArray(input.agent) && input.agent.length > 0,
67674
+ hasPrepareSessionLocalAgentMode: localAgentMode !== null,
67675
+ hasProfile: typeof input.profile === "string" && input.profile.trim().length > 0,
67676
+ hasStartSession: typeof input.startSession === "string" && input.startSession.trim().length > 0,
67677
+ localAgentMode
67678
+ };
67679
+ }
67680
+ function assertValidLocalAgentSelectionInput(input) {
67681
+ const { facts } = input;
67682
+ if (!(facts.hasStartSession || facts.hasProfile) && facts.hasLocalAgentIds) throw new Error("--local-agent requires --start-session or --profile.");
67683
+ if (facts.hasPrepareSessionLocalAgentMode && facts.hasLocalAgentIds) throw new Error("use either --local-agents <all|none> or --local-agent <id...>, not both");
67684
+ if (!(facts.hasProfile && facts.hasLocalAgentIds)) return;
67685
+ if (normalizeLocalAgentIds(input.localAgent).length !== 1) throw new Error("--profile setup accepts exactly one --local-agent <id>.");
67686
+ }
67502
67687
  async function runSetupLocalAgentConnectionWebBootstrap(input) {
67503
67688
  if (input.resetThisComputer) await stopServiceForResetThisComputer({ view: input.view });
67504
67689
  const gatewayUrl = await resolveBaseUrl();
@@ -68207,25 +68392,26 @@ async function emitSetupCompleteForDelegatedPath(input) {
68207
68392
  });
68208
68393
  }
68209
68394
  async function resolveDelegatedSetupCompletionFacts(input) {
68210
- if (input.setupResult.completionFacts) {
68211
- const routeCatalogSync = input.setupResult.completionFacts.runtimeReports.length > 0 ? await waitForConfirmedRouteCatalogSync({
68395
+ const completionFacts = input.setupResult.completionFacts;
68396
+ if (completionFacts) {
68397
+ const routeCatalogSync = completionFacts.runtimeReports.length > 0 ? await waitForConfirmedRouteCatalogSync({
68212
68398
  confirmWakeAvailability: async () => await assertSetupCompletionCanReceiveWake({
68213
68399
  gatewayUrl: input.gatewayUrl,
68214
- runtimeIdentity: input.setupResult.completionFacts.runtimeIdentity,
68215
- selectedLocalAgentIds: input.setupResult.completionFacts.selectedLocalAgentIds
68400
+ runtimeIdentity: completionFacts.runtimeIdentity,
68401
+ selectedLocalAgentIds: completionFacts.selectedLocalAgentIds
68216
68402
  }),
68217
68403
  reason: "setup_profile_connection_path_connected"
68218
68404
  }) : null;
68219
68405
  await assertSetupCompletionCanReceiveWake({
68220
68406
  gatewayUrl: input.gatewayUrl,
68221
- runtimeIdentity: input.setupResult.completionFacts.runtimeIdentity,
68222
- selectedLocalAgentIds: input.setupResult.completionFacts.selectedLocalAgentIds
68407
+ runtimeIdentity: completionFacts.runtimeIdentity,
68408
+ selectedLocalAgentIds: completionFacts.selectedLocalAgentIds
68223
68409
  });
68224
68410
  return {
68225
68411
  routeCatalogSync,
68226
- runtimeIdentity: input.setupResult.completionFacts.runtimeIdentity,
68227
- runtimeReports: input.setupResult.completionFacts.runtimeReports,
68228
- selectedLocalAgentIds: input.setupResult.completionFacts.selectedLocalAgentIds
68412
+ runtimeIdentity: completionFacts.runtimeIdentity,
68413
+ runtimeReports: completionFacts.runtimeReports,
68414
+ selectedLocalAgentIds: completionFacts.selectedLocalAgentIds
68229
68415
  };
68230
68416
  }
68231
68417
  const sessionSelectedLocalAgentIds = input.setupResult.setupSessionSnapshot?.selectedLocalAgentIds ?? null;
@@ -84480,6 +84666,11 @@ async function runSend(input) {
84480
84666
  spaceApi,
84481
84667
  text: text.value
84482
84668
  });
84669
+ emitSendAddressingSummary({
84670
+ outboundMessageEnvelope,
84671
+ presenter,
84672
+ resolvedView: runtime.resolvedView
84673
+ });
84483
84674
  presenter.line({
84484
84675
  code: "send.acting_profile",
84485
84676
  text: `sender: ${profileIdentity.profileId} (${profileIdentity.kind})`,
@@ -84516,8 +84707,12 @@ async function runSend(input) {
84516
84707
  });
84517
84708
  }
84518
84709
  async function resolveOutboundSubmission(input) {
84710
+ let loadedMembersSnapshot = null;
84519
84711
  const preparedSubmission = await prepareCliSpaceComposerSubmission({
84520
84712
  missingSnapshotMessage: "Cannot validate mention labels right now because current space members could not be loaded.",
84713
+ onMembersSnapshotLoaded: (snapshot) => {
84714
+ loadedMembersSnapshot = snapshot;
84715
+ },
84521
84716
  onSnapshotLoadFailure: (error) => {
84522
84717
  rethrowCanonicalMentionSnapshotLoadFailure(error);
84523
84718
  },
@@ -84538,11 +84733,103 @@ async function resolveOutboundSubmission(input) {
84538
84733
  },
84539
84734
  text: input.text
84540
84735
  });
84736
+ const bareMentionDiagnostics = await resolveBareMentionDiagnostics({
84737
+ atsProfile: input.atsProfile,
84738
+ loadedMembersSnapshot,
84739
+ password: input.password,
84740
+ preparedSubmission: preparedSubmission.preparedSubmission,
84741
+ presenter: input.presenter,
84742
+ resolvedView: input.resolvedView,
84743
+ space: input.space,
84744
+ spaceApi: input.spaceApi,
84745
+ text: input.text
84746
+ });
84747
+ emitBareMentionDiagnostics({
84748
+ diagnostics: bareMentionDiagnostics,
84749
+ presenter: input.presenter,
84750
+ resolvedView: input.resolvedView
84751
+ });
84541
84752
  return {
84753
+ bareMentionDiagnostics,
84542
84754
  outboundMessageEnvelope: preparedSubmission.outboundMessageEnvelope,
84543
84755
  outboundText: preparedSubmission.outboundText
84544
84756
  };
84545
84757
  }
84758
+ async function resolveBareMentionDiagnostics(input) {
84759
+ if (!input.text.includes("@")) return [];
84760
+ const snapshot = input.loadedMembersSnapshot ?? await loadMembersSnapshotForBareMentionDiagnostics(input);
84761
+ if (!snapshot) return [];
84762
+ return listSpaceBareMentionDiagnostics({
84763
+ snapshot,
84764
+ text: input.preparedSubmission.text
84765
+ });
84766
+ }
84767
+ async function loadMembersSnapshotForBareMentionDiagnostics(input) {
84768
+ try {
84769
+ emitAgentSendProgress({
84770
+ presenter: input.presenter,
84771
+ resolvedView: input.resolvedView,
84772
+ stage: "load_members",
84773
+ summary: "Checking whether bare @mentions match Space members.",
84774
+ spaceId: input.space
84775
+ });
84776
+ const requestContext = buildAtsRequestContextFromProfile({ atsProfile: input.atsProfile });
84777
+ return await input.spaceApi.getMembersSnapshot({
84778
+ requestContext,
84779
+ spaceId: input.space,
84780
+ ...input.password === void 0 ? {} : { spacePassword: input.password }
84781
+ });
84782
+ } catch (error) {
84783
+ if (input.resolvedView === "agent") input.presenter.line({
84784
+ code: "space.send.bare_mention_check_unavailable",
84785
+ text: `bare @mention check unavailable: ${error instanceof Error ? error.message : String(error)}`
84786
+ });
84787
+ return null;
84788
+ }
84789
+ }
84790
+ function emitSendAddressingSummary(input) {
84791
+ if (input.resolvedView !== "agent") return;
84792
+ const envelope = input.outboundMessageEnvelope;
84793
+ const wakeCount = envelope?.activationTargets.length ?? 0;
84794
+ const referenceCount = envelope?.referenceTargets.length ?? 0;
84795
+ const ccCount = envelope?.ccTargets.length ?? 0;
84796
+ input.presenter.line({
84797
+ code: "space.send.addressing_summary",
84798
+ text: `Space Message Addressing: wake=${wakeCount}, reference=${referenceCount}, cc=${ccCount}.`,
84799
+ data: {
84800
+ ccTargetCount: ccCount,
84801
+ referenceTargetCount: referenceCount,
84802
+ wakeTargetCount: wakeCount
84803
+ }
84804
+ });
84805
+ }
84806
+ function emitBareMentionDiagnostics(input) {
84807
+ if (input.diagnostics.length === 0) return;
84808
+ const first = input.diagnostics[0];
84809
+ if (!first) return;
84810
+ const suggestion = first.suggestedWakeText ?? first.suggestedReferenceText;
84811
+ const text = `Bare mention ${first.mentionText} is plain text and does not create a Wake. Use ${suggestion} when you want ATS to address that profile.`;
84812
+ if (input.resolvedView === "agent") {
84813
+ input.presenter.line({
84814
+ code: "space.send.bare_mention_warning",
84815
+ text,
84816
+ data: { mentions: input.diagnostics.map((diagnostic) => ({
84817
+ mentionText: diagnostic.mentionText,
84818
+ profileId: diagnostic.profileId,
84819
+ profileKind: diagnostic.profileKind,
84820
+ profileName: diagnostic.profileName,
84821
+ suggestedCcText: diagnostic.suggestedCcText,
84822
+ suggestedReferenceText: diagnostic.suggestedReferenceText,
84823
+ suggestedWakeText: diagnostic.suggestedWakeText
84824
+ })) }
84825
+ });
84826
+ return;
84827
+ }
84828
+ input.presenter.line({
84829
+ code: "space.send.bare_mention_warning",
84830
+ text
84831
+ });
84832
+ }
84546
84833
  function emitAgentSendProgress(input) {
84547
84834
  if (input.resolvedView !== "agent") return;
84548
84835
  input.presenter.line({
@@ -85785,6 +86072,7 @@ async function runSpaceAddMembers(input) {
85785
86072
  password: input.password,
85786
86073
  explicitMembers: input.members,
85787
86074
  selectAll: input.all === true,
86075
+ details: input.details === true,
85788
86076
  allowPrompt: interactive,
85789
86077
  allowBackToCaller: input.allowBackToCaller === true,
85790
86078
  view: input.view
@@ -85960,15 +86248,18 @@ async function runSpaceAddMembersForTarget(input) {
85960
86248
  resolvedView: input.runtime.resolvedView,
85961
86249
  spaceId: input.target.space
85962
86250
  };
86251
+ const explicitMemberIds = normalizeRequestedMemberIds(input.explicitMembers);
86252
+ const progress = input.details || explicitMemberIds.length === 0 ? addMembersProgress : void 0;
85963
86253
  const candidates = await resolveSpaceMemberCandidatesForAdd({
85964
86254
  currentProfile: input.atsProfile,
85965
86255
  currentOwnerUserId: input.atsProfile.ownerUserId,
85966
86256
  space: input.target.space,
85967
86257
  baseUrl: targetBaseUrl,
85968
86258
  password: input.password,
85969
- progress: addMembersProgress
86259
+ explicitMemberIds,
86260
+ progress
85970
86261
  });
85971
- if (candidates.length === 0) {
86262
+ if (candidates.length === 0 && explicitMemberIds.length === 0) {
85972
86263
  input.presenter.line({
85973
86264
  code: "space.add_members.no_candidates",
85974
86265
  text: "No additional profiles are available to add.",
@@ -85998,10 +86289,7 @@ async function runSpaceAddMembersForTarget(input) {
85998
86289
  selectedProfileIds
85999
86290
  });
86000
86291
  if (selectedCandidates.length === 0) return { status: "completed" };
86001
- emitAgentSpaceAddMembersProgress({
86002
- presenter: input.presenter,
86003
- resolvedView: input.runtime.resolvedView,
86004
- spaceId: input.target.space,
86292
+ emitSpaceAddMembersProgressIfRequested(progress, {
86005
86293
  stage: "check_local_wake_readiness",
86006
86294
  phase: "start",
86007
86295
  summary: "Checking whether selected agent profiles can wake from this computer. Members can still be added if local Wake setup needs attention.",
@@ -86010,6 +86298,7 @@ async function runSpaceAddMembersForTarget(input) {
86010
86298
  const servicePreparationResult = await ensureSpaceMemberCandidatesLocalParticipationReady({
86011
86299
  atsProfile: input.atsProfile,
86012
86300
  candidates: selectedCandidates,
86301
+ progress,
86013
86302
  presenter: input.presenter,
86014
86303
  resolvedView: input.runtime.resolvedView,
86015
86304
  allowPrompt: input.allowPrompt,
@@ -86021,10 +86310,7 @@ async function runSpaceAddMembersForTarget(input) {
86021
86310
  authenticatedGatewayUrl
86022
86311
  } : { status: "cancelled" };
86023
86312
  const preparedCandidates = servicePreparationResult.candidates;
86024
- emitAgentSpaceAddMembersProgress({
86025
- presenter: input.presenter,
86026
- resolvedView: input.runtime.resolvedView,
86027
- spaceId: input.target.space,
86313
+ emitSpaceAddMembersProgressIfRequested(progress, {
86028
86314
  stage: "add_members",
86029
86315
  phase: "write_membership",
86030
86316
  summary: "Adding selected profiles to the Space.",
@@ -86038,10 +86324,7 @@ async function runSpaceAddMembersForTarget(input) {
86038
86324
  baseUrl: targetBaseUrl,
86039
86325
  password: input.password
86040
86326
  });
86041
- emitAgentSpaceAddMembersProgress({
86042
- presenter: input.presenter,
86043
- resolvedView: input.runtime.resolvedView,
86044
- spaceId: input.target.space,
86327
+ emitSpaceAddMembersProgressIfRequested(progress, {
86045
86328
  stage: "record_join_notices",
86046
86329
  phase: "write_join_notices",
86047
86330
  summary: "Recording visible join notices for newly added members.",
@@ -86076,6 +86359,13 @@ async function runSpaceAddMembersForTarget(input) {
86076
86359
  });
86077
86360
  return { status: "completed" };
86078
86361
  }
86362
+ function emitSpaceAddMembersProgressIfRequested(progress, input) {
86363
+ if (!progress) return;
86364
+ emitAgentSpaceAddMembersProgress({
86365
+ ...progress,
86366
+ ...input
86367
+ });
86368
+ }
86079
86369
  function emitAgentSpaceAddMembersProgress(input) {
86080
86370
  if (input.resolvedView !== "agent") return;
86081
86371
  const phaseContract = resolveSpaceAddMembersProgressPhase({
@@ -86238,21 +86528,15 @@ function resolveSelectedSpaceMemberCandidates(input) {
86238
86528
  return input.selectedProfileIds.map((profileId) => input.candidates.find((candidate) => candidate.profileId === profileId)).filter((candidate) => Boolean(candidate));
86239
86529
  }
86240
86530
  async function ensureSpaceMemberCandidatesLocalParticipationReady(input) {
86241
- let preparedCandidates = await refreshSpaceMemberCandidatesLocalReadiness(input.candidates, {
86242
- presenter: input.presenter,
86243
- resolvedView: input.resolvedView,
86244
- spaceId: input.spaceId
86245
- });
86531
+ let preparedCandidates = await refreshSpaceMemberCandidatesLocalReadiness(input.candidates, input.progress);
86246
86532
  const localDemand = input.resolvedView === "human" ? await resolveDaemonLocalServiceDemand({ ownerUserId: input.atsProfile.ownerUserId }).catch(() => null) : null;
86247
86533
  while (true) {
86248
86534
  const participationPlan = planActionParticipation({
86249
86535
  intent: "space_add_members",
86250
86536
  candidates: preparedCandidates.map(toActionParticipationCandidateFromSpaceMemberCandidate)
86251
86537
  });
86252
- emitAgentSpaceAddMembersProgress({
86253
- presenter: input.presenter,
86254
- resolvedView: input.resolvedView,
86255
- spaceId: input.spaceId,
86538
+ if (input.progress) emitAgentSpaceAddMembersProgress({
86539
+ ...input.progress,
86256
86540
  stage: "plan_local_wake_participation",
86257
86541
  phase: "plan",
86258
86542
  summary: buildSpaceAddMembersLocalWakePlanSummary(participationPlan),
@@ -86272,26 +86556,16 @@ async function ensureSpaceMemberCandidatesLocalParticipationReady(input) {
86272
86556
  });
86273
86557
  if (orchestratorResult.status === "cancelled") return { status: "cancelled" };
86274
86558
  if (orchestratorResult.status !== "recheck_required") break;
86275
- preparedCandidates = await refreshSpaceMemberCandidatesLocalReadiness(preparedCandidates, {
86276
- presenter: input.presenter,
86277
- resolvedView: input.resolvedView,
86278
- spaceId: input.spaceId
86279
- });
86559
+ preparedCandidates = await refreshSpaceMemberCandidatesLocalReadiness(preparedCandidates, input.progress);
86280
86560
  }
86281
- emitAgentSpaceAddMembersProgress({
86282
- presenter: input.presenter,
86283
- resolvedView: input.resolvedView,
86284
- spaceId: input.spaceId,
86561
+ if (input.progress) emitAgentSpaceAddMembersProgress({
86562
+ ...input.progress,
86285
86563
  stage: "confirm_local_wake_bindings",
86286
86564
  phase: "start",
86287
86565
  summary: "Confirming available local agent profiles have Wake bindings before adding them.",
86288
86566
  profileIds: preparedCandidates.map((candidate) => candidate.profileId)
86289
86567
  });
86290
- preparedCandidates = await ensureFormalBindingsForReadySpaceMemberCandidates(preparedCandidates, {
86291
- presenter: input.presenter,
86292
- resolvedView: input.resolvedView,
86293
- spaceId: input.spaceId
86294
- });
86568
+ preparedCandidates = await ensureFormalBindingsForReadySpaceMemberCandidates(preparedCandidates, input.progress);
86295
86569
  emitSpaceMemberJoinOnlyWarnings({
86296
86570
  candidates: preparedCandidates,
86297
86571
  presenter: input.presenter,
@@ -86317,7 +86591,7 @@ async function ensureFormalBindingsForReadySpaceMemberCandidates(candidates, pro
86317
86591
  continue;
86318
86592
  }
86319
86593
  const candidateAtsProfile = candidate.atsProfile;
86320
- emitAgentSpaceAddMembersProgress({
86594
+ if (progress) emitAgentSpaceAddMembersProgress({
86321
86595
  ...progress,
86322
86596
  stage: "confirm_local_wake_bindings",
86323
86597
  phase: "profile_binding_sync",
@@ -86325,7 +86599,7 @@ async function ensureFormalBindingsForReadySpaceMemberCandidates(candidates, pro
86325
86599
  profileId: candidate.profileId,
86326
86600
  profileIds: [candidate.profileId]
86327
86601
  });
86328
- const result = await runSpaceAddMembersProgressHeartbeat({
86602
+ const result = progress ? await runSpaceAddMembersProgressHeartbeat({
86329
86603
  ...progress,
86330
86604
  stage: "confirm_local_wake_bindings",
86331
86605
  phase: "profile_binding_sync_wait",
@@ -86333,9 +86607,9 @@ async function ensureFormalBindingsForReadySpaceMemberCandidates(candidates, pro
86333
86607
  profileId: candidate.profileId,
86334
86608
  profileIds: [candidate.profileId],
86335
86609
  operation: async () => await ensureFormalAgentBindingForReadyLocalProfile({ profile: candidateAtsProfile })
86336
- });
86610
+ }) : await ensureFormalAgentBindingForReadyLocalProfile({ profile: candidateAtsProfile });
86337
86611
  if (result.status === "ready") {
86338
- emitAgentSpaceAddMembersProgress({
86612
+ if (progress) emitAgentSpaceAddMembersProgress({
86339
86613
  ...progress,
86340
86614
  stage: "confirm_local_wake_bindings",
86341
86615
  phase: "profile_binding_confirmed",
@@ -86346,7 +86620,7 @@ async function ensureFormalBindingsForReadySpaceMemberCandidates(candidates, pro
86346
86620
  nextCandidates.push(candidate);
86347
86621
  continue;
86348
86622
  }
86349
- emitAgentSpaceAddMembersProgress({
86623
+ if (progress) emitAgentSpaceAddMembersProgress({
86350
86624
  ...progress,
86351
86625
  stage: "confirm_local_wake_bindings",
86352
86626
  phase: "profile_binding_not_confirmed",
@@ -87811,7 +88085,11 @@ async function resolveSpaceMemberCandidatesForAdd(input) {
87811
88085
  }) : await listAgentTargetStates().catch(() => []);
87812
88086
  const localTargetStateById = new Map(localTargetStates.map((state) => [state.agentId, state]));
87813
88087
  const ownerProfileNameByOwnerUserId = buildOwnerProfileNameByOwnerUserId(profiles);
87814
- const candidateProfiles = profiles.filter((profile) => profile.status === "active" && isSpaceMembershipProfileKind(profile.profileKind) && profile.atsProfileId !== input.currentProfile.atsProfileId).filter((profile) => typeof input.currentOwnerUserId !== "string" || input.currentOwnerUserId.trim().length === 0 || profile.ownerUserId === input.currentOwnerUserId);
88088
+ const candidateProfiles = profiles.filter((profile) => profile.status === "active" && isSpaceMembershipProfileKind(profile.profileKind) && profile.atsProfileId !== input.currentProfile.atsProfileId).filter((profile) => {
88089
+ const explicitMemberIds = input.explicitMemberIds ?? [];
88090
+ if (explicitMemberIds.length > 0 && !explicitMemberIds.includes(profile.atsProfileId)) return false;
88091
+ return typeof input.currentOwnerUserId !== "string" || input.currentOwnerUserId.trim().length === 0 || profile.ownerUserId === input.currentOwnerUserId;
88092
+ });
87815
88093
  if (candidateProfiles.length === 0) return [];
87816
88094
  if (input.progress) emitAgentSpaceAddMembersProgress({
87817
88095
  ...input.progress,
@@ -94359,12 +94637,14 @@ function runSpaceActionHelp() {
94359
94637
  outLine(formatSpaceActionHelpExample("Reply", "reply \"message\"", context));
94360
94638
  outLine(formatSpaceActionHelpExample("Handoff and wake another agent", "wake \"@Agent Name\" \"summary and request\"", context));
94361
94639
  outLine(formatSpaceActionHelpExample("Reply and also wake another agent", "reply --wake \"@Agent Name\" \"message\"", context));
94640
+ outLine(formatSpaceActionHelpExample("Reply and reference another profile", "reply --reference \"@Agent Name\" \"message\"", context));
94641
+ outLine(formatSpaceActionHelpExample("Reply and copy another profile", "reply --cc \"@Human or Agent Name\" \"message\"", context));
94362
94642
  outLine(formatSpaceActionHelpExample("Final status", "status done \"short completion update\"", context));
94363
94643
  outLine(formatSpaceActionHelpExample("Stay silent", "silent --reason \"No public reply is needed.\"", context));
94364
94644
  outLine(formatSpaceActionHelpExample("Current targets", "targets", context));
94365
94645
  outLine(formatSpaceActionHelpExample("Help", "help", context));
94366
94646
  outLine("");
94367
- outLine("These commands only record a dispatch-scoped action. ATS still publishes through RuntimeCoordinator and Agent Transport Space Action Delivery.");
94647
+ outLine("Run exactly one final action for the current Wake. ATS posts the accepted action to the Space.");
94368
94648
  if (!context) {
94369
94649
  outLine("");
94370
94650
  outLine(`No active dispatch context was found. ${DISPATCH_ACTION_CLI_PLACEHOLDER} is a placeholder for the exact Space Action command prefix printed in an ATS Space Wake dispatch prompt.`);
@@ -94383,7 +94663,7 @@ function formatSpaceActionHelpCommand(action, context) {
94383
94663
  return formatAtsCliCommand(`ats space action ${action}`);
94384
94664
  }
94385
94665
  function recordAction(input) {
94386
- outLine(`ATS Space Action recorded: ${writeDispatchSpaceActionRecord(input).action.type}. It will be delivered through the current dispatch finalization path.`);
94666
+ outLine(`Posted to Space: ATS accepted this final action (${writeDispatchSpaceActionRecord(input).action.type}) for the current Wake.`);
94387
94667
  }
94388
94668
  function resolveMessageEnvelopeTargetIds(input) {
94389
94669
  const targets = {
@@ -97246,7 +97526,7 @@ withStartOptions(program.command("start").description("Initial onboarding: set u
97246
97526
  program.command("setup").description("Set up this computer for ATS Space Wake.").option("--profile <id>", "Existing ATS agent profile ID to connect to this computer").option("--agent <id...>", "Builtin local agent ID to repair directly when you already know the target").option("--human-profile <id>", "ATS human profile ID from ATS Web for account setup").option("--ott <token>", "One-time token to sign in on this device before setup").option("--start-session <opaque-token>", "Continue an ATS Web Agent Interface setup handoff on this device").option("--local-agents <mode>", "Select local agents during setup: all or none").option("--local-agent <id...>", "Select specific local agent IDs during setup").option("--reset-this-computer", "Stop stale local ATS Service state before reconnecting this computer").addHelpText("after", buildCommandHelpExamples("Primary entry points", [
97247
97527
  "ats setup",
97248
97528
  "ats setup --start-session <opaque-token> --local-agents all",
97249
- "ats setup --profile <agent-profile-id>"
97529
+ "ats setup --profile <agent-profile-id> --local-agent <local-agent-id>"
97250
97530
  ])).action(async (opts) => {
97251
97531
  const view = getGlobalViewOption();
97252
97532
  await runCommandWithEntryChecks({
@@ -97838,7 +98118,7 @@ registerDaemonControlTargetOptions({ command: serviceCmd.command("cancel").descr
97838
98118
  }
97839
98119
  });
97840
98120
  });
97841
- serviceCmd.command("trace").description("Read a Space delivery trace for debugging.").requiredOption("--space <id>", "Space ID (64-character hex)").option("--dispatch <id>", "Dispatch ID").option("--source-signal <id>", "Source signal ID").option("--client-message <id>", "Client message ID from the sender").option("--target-profile <id>", "Target ATS profile ID for source-signal lookup").option("--password <value>", "Space password for protected access").option("--profile <id>", "ATS profile ID used for auth context").option("--gateway-url <url>", "ATS gateway URL (command line, ATS_GATEWAY_URL, or saved ATS settings)").action(async (opts) => {
98121
+ serviceCmd.command("trace").description("Read a Space delivery trace for debugging.").requiredOption("--space <id>", "Space ID (64-character hex)").option("--dispatch <id>", "Dispatch ID").option("--source-signal <id>", "Source signal ID").option("--client-message <id>", "Client message ID from the sender").option("--target-profile <id>", "Target ATS profile ID for source-signal lookup").option("--password <value>", "Space password for protected access").option("--profile <id>", "ATS profile ID used for auth context").option("--gateway-url <url>", "ATS gateway URL (command line, ATS_GATEWAY_URL, or saved ATS settings)").option("--details", "Print the full trace payload in agent view", false).action(async (opts) => {
97842
98122
  const view = getGlobalViewOption();
97843
98123
  await runCommandWithEntryChecks({
97844
98124
  routeTokens: ["service", "trace"],
@@ -97856,6 +98136,7 @@ serviceCmd.command("trace").description("Read a Space delivery trace for debuggi
97856
98136
  baseUrl: opts.gatewayUrl,
97857
98137
  space: String(opts.space ?? ""),
97858
98138
  ...dispatchId ? { dispatchId } : {},
98139
+ details: opts.details === true,
97859
98140
  ...sourceSignalId ? { sourceSignalId } : {},
97860
98141
  ...clientMessageId ? { clientMessageId } : {},
97861
98142
  ...targetProfileId ? { targetProfileId } : {},
@@ -98116,7 +98397,7 @@ withSpaceProfileOption(spaceCmd.command("join").description("Join a space and ch
98116
98397
  });
98117
98398
  });
98118
98399
  withSpaceProfileOption(registerSpaceMemberSelectionOptions({
98119
- command: spaceCmd.command("add-members").alias("add-agents").alias("add-profiles").description("Add your own profiles as members of a space.").argument("[space]", "Space ID (64-character hex)").option("--password <value>", "Space password for protected access"),
98400
+ command: spaceCmd.command("add-members").alias("add-agents").alias("add-profiles").description("Add your own profiles as members of a space.").argument("[space]", "Space ID (64-character hex)").option("--password <value>", "Space password for protected access").option("--details", "Print detailed add-members progress in agent view"),
98120
98401
  selectionCommand: "add-members"
98121
98402
  })).action(async (space, opts, command) => {
98122
98403
  const cliOptions = resolveSpaceCommandCliOptions(command, opts);
@@ -98139,6 +98420,7 @@ withSpaceProfileOption(registerSpaceMemberSelectionOptions({
98139
98420
  password: cliOptions.password,
98140
98421
  members,
98141
98422
  all: opts.all === true,
98423
+ details: opts.details === true,
98142
98424
  view,
98143
98425
  entryChecksHandled: true
98144
98426
  });