agent-transport-system 0.6.4 → 0.6.5

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
3
  import "./lock-BYMWvQAg.js";
4
- import { v as DEV_LOCAL_GATEWAY_BASE_URL } from "./runtime-config-0EDwy6l-.js";
4
+ import { v as DEV_LOCAL_GATEWAY_BASE_URL } from "./runtime-config-CxhCKyAq.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
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { $ as getAgentExecutionReadinessBatchBodySchema, $n as atsdTaskResultEnvelopeWriteSchema, $t as serverErrorFrameSchema, A as claimExecutionDiagnosticsResponseSchema, An as writeSetupTokenLocalRuntimeObservedMetadataResponseSchema, Ar as resolveSpaceMentionLabels, At as observabilityWakeTraceSelectorSchema, B as currentLocalRuntimeReplyReadinessResponseSchema, Bn as DISPATCH_ACTIVITY_FAILED_PURPOSE, Bt as postSpaceThreadSignalResponseSchema, C as atsdControlPlaneRequestSchema, Cn as submitRuntimeRegistrationBodySchema, Cr as normalizeOptionalWorkingDirectory, Ct as localRuntimesResponseSchema, D as canonicalizeControllerRefForKind, Dn as writeCurrentDeviceObservedMetadataBodySchema, Dr as resolveBuiltinUpstreamConversationRefKind, Dt as normalizeSpaceCursorPatch, E as canonicalizeBuiltinControllerRef, En as upsertSpaceDeletionTombstoneResponseSchema, Er as profileWorkspaceModeSchema, Et as normalizeListSignalsReadQuerySemantics, F as createSpaceResponseSchema, Fn as ATSD_TASK_RESULT_SCHEMA_VERSION, Ft as postNormalMessageBodySchema, G as ensureAgentProfilePrimaryBindingBodySchema, Gn as MESSAGE_MENTION_TYPE_VALUES, Gt as providerDispatchRuntimeContextSchema, H as daemonRuntimeLeaseSchema, Hn as LEGACY_RUNTIME_DISPATCH_POLICY, Ht as prepareSessionStreamServerFrameSchema, I as createSpaceThreadBodySchema, In as CONVERSATION_CONTINUITY_WARNING_PURPOSE, It as postNormalMessageResponseSchema, J as finalClaimRouteParamsSchema, Jn as SPACE_MENTION_REJECT_NOTICE_PURPOSE, Jt as reserveFinalClaimBodySchema, K as ensureAgentProfilePrimaryBindingResponseSchema, Kn as SPACE_MEMBER_JOIN_NOTICE_PURPOSE, Kt as querySpaceDeletionTombstonesResponseSchema, L as createSpaceThreadResponseSchema, Ln as CURRENT_DAEMON_EXECUTION_CONTRACT_EPOCH, Lt as postSpaceMembersBodySchema, M as createSpaceBodySchema, Mn as AGENT_REPLYING_PURPOSE, Mt as patchSpaceContractBodySchema, N as createSpaceDiagnosticReportBodySchema, Nn as AGENT_REPLY_PREVIEW_END_PURPOSE, Nr as runtimeCoordinatorExecutionTokenEnvelopeSchema, Nt as patchSpaceContractResponseSchema, O as catchupResponseSchema, On as writeCurrentDeviceObservedMetadataResponseSchema, Or as resolveMessageEnvelopeTargetField, Ot as notifyAgentProfileRouteCatalogChangedBodySchema, P as createSpaceDiagnosticReportResponseSchema, Pn as AGENT_REPLY_PREVIEW_PURPOSE, Pr as sanitizeSignalTextPreview, Pt as patchStartSessionBodySchema, Q as gatewayErrorEnvelopeSchema, Qn as atsSpaceEgressActionSchema, Qt as resolveStartHandoffResponseSchema, R as createStartSessionBodySchema, Rn as DAEMON_HUB_SCHEMA_VERSION, Rt as postSpaceMembersResponseSchema, S as atsRequestContextSchema, Sn as submitRuntimeCapabilityReportsResponseSchema, Sr as normalizeMessageEnvelope, St as localRuntimesQuerySchema, T as buildControllerRoutingKeyForKind, Tn as upsertProfileSpaceHistoryResponseSchema, Tr as parseOptionalClientMessageId, Tt as normalizeBuiltinControllerProviderId, U as deleteSpaceResponseSchema, Un as MAX_PROFILE_WORKING_DIRECTORY_LENGTH, Ut as projectObservabilityWakeCorrelation, V as daemonRouteObservationResponseSchema, Vn as DISPATCH_ACTIVITY_RETRYING_PURPOSE, Vt as prepareSessionResponseSchema, W as dispatchBriefSchema, Wn as MAX_SIGNAL_REPLY_TO_PREVIEW_LENGTH, Wt as projectSpaceDispatchTraceFinalVisibleOutcome, X as forgetCurrentComputerResponseSchema, Xn as SPACE_UPDATES_MAX_LIMIT, Xt as resolveSpaceDispatchTraceRootCause, Y as forgetComputerResponseSchema, Yn as SPACE_PASSWORD_MIN_LENGTH, Yt as resolveBuiltinProviderConversationCapability, Z as gatewayErrorCodeSchema, Zn as atsRuntimeProfileIdSchema, Zt as resolveStartHandoffBodySchema, _ as ATSD_CONTROL_PLANE_SCHEMA_VERSION, _n as startSessionSpaceChoiceBodySchema, _r as daemonHubSubmitTaskResultRequestSchema, _t as leaveSpaceResponseSchema, a as runWithHeldLock, an as spaceConversationBindingImportResponseSchema, ar as createDaemonRouteObservationSummary, at as getSpaceContractResponseSchema, b as agentProfileBindingRouteParamsSchema, bn as structuredGuidePayloadFromInputSchema, br as formatCanonicalMentionLiteral, bt as listSpaceThreadSignalsResponseSchema, c as LEGACY_ATS_RUNTIME_SESSION_ENV_KEY, cn as spaceCreatorSchema, cr as daemonHubDispatchLifecycleRequestSchema, ct as getSpaceDispatchLookupResponseSchema, d as resolveRuntimeSession, dn as spaceMetaSchema, dr as daemonHubDispatchRuntimeEvidenceRequestSchema, dt as getSpaceThreadResponseSchema, en as setCurrentDeviceTargetBodySchema, er as atsdTaskResultOpenClawGatewayVisibilityStatusSchema, et as getAgentExecutionReadinessBatchResponseSchema, f as resolveRuntimeSessionId, fn as spaceViewerMembershipResponseSchema, fr as daemonHubHeartbeatRequestSchema, ft as getSpaceUpdatesResponseSchema, g as resolveMappedPublicAgentFailureReason, gn as startSessionResponseSchema, gr as daemonHubRouteCatalogChangedFramePayloadSchema, gt as isExplicitBuiltinControllerRef, h as resolveBuiltinAgentControllerBrand, hn as startSessionProgressSchema, hr as daemonHubRegisterSessionResponseSchema, ht as incomingServerMessageSchema, i as releaseLock, in as spaceConversationBindingDeleteResponseSchema, ir as conversationExecutionStateSchema, it as getPrepareReadinessResponseSchema, j as continuitySchema, jn as AGENT_REPLYING_END_PURPOSE, jt as patchProfileSpaceHistoryStatusResponseSchema, k as claimExecutionDiagnosticsQuerySchema, kn as writeSetupTokenLocalRuntimeObservedMetadataBodySchema, kr as resolveSingleSpaceMentionLabels, kt as notifyAgentProfileRouteCatalogChangedResponseSchema, l as listRuntimeSessionStates, ln as spaceDispatchTraceResponseSchema, lr as daemonHubDispatchPreviewEndRequestSchema, lt as getSpaceDispatchResultResponseSchema, m as CODEX_UPGRADE_REQUIRED_REASON, mn as startProfileReadinessSummarySchema, mr as daemonHubRegisterSessionRequestSchema, mt as getSpaceWakeTraceWaterfallResponseSchema, n as isAtsLockError, nn as signalEnvelopeSchema, nr as buildUpstreamConversationRef, nt as getAgentProfilePrimaryBindingResponseSchema, o as tryCleanupStaleLock, on as spaceConversationBindingResponseSchema, or as daemonHubDeliverDispatchRequestSchema, ot as getSpaceConversationRemoteStatusResponseSchema, p as writeRuntimeSessionState, pn as startDeviceProjectionSchema, pr as daemonHubHeartbeatResponseSchema, pt as getSpaceWakeProgressResponseSchema, q as entryBriefSchema, qn as SPACE_MEMBER_REMOVE_NOTICE_PURPOSE, qt as removeSpaceMembersResponseSchema, r as readLockMeta, rn as spaceConversationBindingConflictResponseSchema, rr as collectCanonicalMentionTextFragments, rt as getPrepareReadinessQuerySchema, s as ATS_RUNTIME_SESSION_ENV_KEY, sn as spaceConversationBindingUpsertResponseSchema, sr as daemonHubDeliveryExecutionIdentitySchema, st as getSpaceConversationStatusResponseSchema, t as acquireLock, tn as setLocalRuntimeDisplayNameBodySchema, tr as atsdTaskResultPayloadSchema, tt as getAgentExecutionReadinessResponseSchema, u as readRuntimeSessionState, un as spaceMembersSnapshotSchema, ur as daemonHubDispatchPreviewRequestSchema, ut as getSpaceStatusResponseSchema, v as SPACE_DISPATCH_TRACE_PROMPT_PREVIEW_MAX_CHARS, vn as startSessionSpaceChoiceResponseSchema, vr as daemonServiceContractSchema, vt as listProfileSpaceHistoryResponseSchema, w as atsdControlPlaneResponseSchema, wn as submitRuntimeRegistrationResponseSchema, wr as normalizeSpacePasswordText, wt as normalizeBuiltinControllerAgentId, x as atsProfileIdSchema, xn as submitRuntimeCapabilityReportsBodySchema, xr as getSpaceMessageAddressingRelationSupportForTargetKind, xt as listSpaceThreadsResponseSchema, y as agentExecutionReadinessRouteParamsSchema, yn as startSessionWithTokenResponseSchema, yr as daemonStreamFrameSchema, yt as listSpaceThreadEventsResponseSchema, z as currentDeviceTargetResponseSchema, zn as DISPATCH_ACTIVITY_DISPATCHING_PURPOSE, zt as postSpaceThreadSignalBodySchema } from "./lock-BYMWvQAg.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-0EDwy6l-.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-CxhCKyAq.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.6.4";
30
+ var version = "0.6.5";
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-27",
35
+ atsReleaseDate: "2026-05-28",
36
36
  description: "Agent Transport System CLI - https://ats.sh",
37
37
  license: "MIT",
38
38
  type: "module",
@@ -6311,7 +6311,7 @@ function createSpaceUnsupportedProfileKindGuideError(input) {
6311
6311
  agentCommands: [
6312
6312
  "ats profiles list --view agent",
6313
6313
  "ats space list --profile <profile-id> --view agent",
6314
- "ats space history <space-id> --profile <profile-id> --view agent"
6314
+ "ats space history <space-id> --profile <profile-id> --kind text --limit 20 --view agent"
6315
6315
  ],
6316
6316
  notes: ["`--view agent` controls machine-readable output. It does not require the acting identity to be an Agent Profile.", "System profiles are internal and cannot be used as the acting identity for Space commands."]
6317
6317
  },
@@ -6344,7 +6344,7 @@ function createSpaceRemoveMembersCurrentProfileGuideError(input) {
6344
6344
  ],
6345
6345
  agentRequiredArgs: ["<space-id>", `--profile ${input.profileId}`],
6346
6346
  agentOptionalArgs: ["--view <agent|human|auto>"],
6347
- agentCommands: [`ats space leave <space-id> --profile ${input.profileId} --view agent`, `ats space history <space-id> --profile ${input.profileId} --view agent`],
6347
+ agentCommands: [`ats space leave <space-id> --profile ${input.profileId} --view agent`, `ats space history <space-id> --profile ${input.profileId} --kind text --limit 20 --view agent`],
6348
6348
  notes: ["self-removal is blocked for remove-members; leave is the self-exit command."]
6349
6349
  },
6350
6350
  hints: [`ats space leave <space-id> --profile ${input.profileId} --view agent`]
@@ -37125,6 +37125,7 @@ function buildActionGuidanceLines(input) {
37125
37125
  const lines = [];
37126
37126
  if (publicationRequirement.allowsRawReplyWithoutAction) lines.push("- Default: share your raw reply to the Space.");
37127
37127
  lines.push(`- ${publicationRequirement.actionRequirementLine}`);
37128
+ 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.");
37128
37129
  lines.push(...buildSpaceActionCommandLines(input, publicationRequirement));
37129
37130
  lines.push(`- Need context? Run \`${buildSpaceHistoryCommand({
37130
37131
  cliEntry: input.cliEntry,
@@ -37164,7 +37165,7 @@ function buildIfUnsureLine(input) {
37164
37165
  function buildSpaceHistoryCommand(input) {
37165
37166
  const cliEntry = normalizeOptionalText$46(input.cliEntry) ?? "ats";
37166
37167
  const normalizedSpaceId = normalizeOptionalText$46(input.spaceId);
37167
- return normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId}` : `${cliEntry} space history <space-id>`;
37168
+ return normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId} --kind text --limit 20` : `${cliEntry} space history <space-id> --kind text --limit 20`;
37168
37169
  }
37169
37170
  function buildActivatedByLine(input) {
37170
37171
  const mentionSourceProfileName = normalizeOptionalText$46(input.mentionSourceProfileName);
@@ -41545,7 +41546,7 @@ function buildStructuredActionRepairPrompt(input) {
41545
41546
  const previousOutput = normalizeOptionalText$46(input.previousOutput);
41546
41547
  const normalizedSpaceId = normalizeOptionalText$46(input.spaceId);
41547
41548
  const cliEntry = normalizeOptionalText$46(input.cliEntry) ?? "ats";
41548
- const historyCommand = normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId}` : `${cliEntry} space history <space-id>`;
41549
+ const historyCommand = normalizedSpaceId ? `${cliEntry} space history ${normalizedSpaceId} --kind text --limit 20` : `${cliEntry} space history <space-id> --kind text --limit 20`;
41549
41550
  const promptCommand = `${cliEntry} prompt`;
41550
41551
  const spaceGuideCommand = normalizedSpaceId ? `${cliEntry} space guide ${normalizedSpaceId}` : `${cliEntry} space guide <space-id>`;
41551
41552
  const publicationRequirement = resolveSpacePublicationRequirement(input.spaceContractSnapshot);
@@ -41560,6 +41561,7 @@ function buildStructuredActionRepairPrompt(input) {
41560
41561
  ] : [],
41561
41562
  "Do not change the user's intent.",
41562
41563
  "ATS only consumes your final answer and at most one valid trailing ```ats-space-action``` JSON block.",
41564
+ "If an ATS Space Action CLI command is available, run that command instead of printing fallback JSON.",
41563
41565
  "Return the corrected final answer again.",
41564
41566
  publicationRequirement.repairRequirementLine,
41565
41567
  ...SPACE_ACTION_TARGET_GUIDANCE_LINES,
@@ -45068,6 +45070,18 @@ function consumeAnsiOperatingSystemCommand(value, startIndex) {
45068
45070
  return value.length;
45069
45071
  }
45070
45072
 
45073
+ //#endregion
45074
+ //#region src/system/local-service-diagnostics.ts
45075
+ function buildLocalServiceDiagnosticsPayload(input) {
45076
+ return { localServiceDiagnostics: {
45077
+ source: "local_service_diagnostics",
45078
+ scope: "diagnostic_only",
45079
+ meaning: "Local service and local agent evidence only. Do not treat this as final Space delivery or Wake outcome truth; use daemonRouteObservation and service trace for actual delivery.",
45080
+ deviceEvidence: input.deviceEvidence,
45081
+ agentEvidence: input.agentEvidence
45082
+ } };
45083
+ }
45084
+
45071
45085
  //#endregion
45072
45086
  //#region src/commands/daemon.ts
45073
45087
  const STATUS_CLEANUP_SIGNIFICANT_ANOMALIES = DAEMON_SERVICE_REPAIR_ANOMALIES;
@@ -46767,13 +46781,10 @@ function emitDaemonAgentStatus(input) {
46767
46781
  });
46768
46782
  }
46769
46783
  function buildDaemonLocalReplyReadinessEvidenceDiagnostics(input) {
46770
- return { localReplyReadinessEvidence: {
46771
- source: "legacy_local_reply_readiness",
46772
- scope: "local_diagnostics",
46773
- meaning: "Local service and local agent evidence only; not final Agent connection readiness.",
46774
- device: input.deviceReplyReadiness,
46775
- agent: input.legacyAgentReplyReadiness
46776
- } };
46784
+ return buildLocalServiceDiagnosticsPayload({
46785
+ deviceEvidence: input.deviceReplyReadiness,
46786
+ agentEvidence: input.legacyAgentReplyReadiness
46787
+ });
46777
46788
  }
46778
46789
  function emitDaemonAgentLocalStatus(input) {
46779
46790
  const { environmentTarget, presenter, snapshot } = input;
@@ -51601,7 +51612,8 @@ async function inspectPotentialLegacyAtsSkill(input) {
51601
51612
  parentDir,
51602
51613
  reasonCode: "legacy_ats_skill_id",
51603
51614
  problem: "This is an old ATS skill name. Agents can still load it and learn stale ATS instructions.",
51604
- recommendation: "Install the current ATS skill into this skill root, then remove or rename this legacy skill directory."
51615
+ recommendation: "Install the current ATS skill into this skill root, then remove or rename this legacy skill directory.",
51616
+ cleanupCommands: buildLegacySkillCleanupCommands(skillDir)
51605
51617
  };
51606
51618
  if (input.currentSkillIds.has(input.skillId) && !input.targetCurrentSkillDirs.has(skillDir) && isLikelyAtsSkillDocument(rawSkill)) return {
51607
51619
  skillId: input.skillId,
@@ -51609,10 +51621,17 @@ async function inspectPotentialLegacyAtsSkill(input) {
51609
51621
  parentDir,
51610
51622
  reasonCode: "unmanaged_current_ats_skill_copy",
51611
51623
  problem: "This looks like an ATS skill copy, but this ATS installation does not manage it.",
51612
- recommendation: "Replace it through ats skills ensure for that skill root, or remove it if this agent should not use ATS."
51624
+ recommendation: "Replace it through ats skills ensure for that skill root, or remove it if this agent should not use ATS.",
51625
+ cleanupCommands: buildLegacySkillCleanupCommands(skillDir)
51613
51626
  };
51614
51627
  return null;
51615
51628
  }
51629
+ function buildLegacySkillCleanupCommands(skillDir) {
51630
+ return [`rm -rf ${quoteShellArg(skillDir)}`, `mv ${quoteShellArg(skillDir)} ${quoteShellArg(`${skillDir}.legacy`)}`];
51631
+ }
51632
+ function quoteShellArg(value) {
51633
+ return `'${value.replace(/'/g, "'\\''")}'`;
51634
+ }
51616
51635
  function isLikelyAtsSkillDocument(rawSkill) {
51617
51636
  const normalized = rawSkill.toLowerCase();
51618
51637
  return normalized.includes("agent transport system") || normalized.includes("ats cli") || normalized.includes("ats space action") || normalized.includes("ats skills");
@@ -53326,7 +53345,8 @@ function emitLegacyAtsSkillFindingsHumanCard(input) {
53326
53345
  `path: ${finding.skillDir}`,
53327
53346
  "not managed by this ATS installation",
53328
53347
  finding.problem,
53329
- finding.recommendation
53348
+ finding.recommendation,
53349
+ `cleanup: ${finding.cleanupCommands.join(" or ")}`
53330
53350
  ].join(" · ")
53331
53351
  })),
53332
53352
  compact: true
@@ -62796,13 +62816,10 @@ function isConnectionVerificationPendingReason(reasonCode) {
62796
62816
  return reasonCode === "agent_profile_binding.execution_readiness_pending";
62797
62817
  }
62798
62818
  function buildLocalReplyReadinessEvidenceDiagnostics(input) {
62799
- return { localReplyReadinessEvidence: {
62800
- source: "legacy_local_reply_readiness",
62801
- scope: "local_diagnostics",
62802
- meaning: "Local service and local agent evidence only; not final Agent connection readiness.",
62803
- device: input.deviceReplyReadiness,
62804
- agent: input.legacyAgentReplyReadiness
62805
- } };
62819
+ return buildLocalServiceDiagnosticsPayload({
62820
+ deviceEvidence: input.deviceReplyReadiness,
62821
+ agentEvidence: input.legacyAgentReplyReadiness
62822
+ });
62806
62823
  }
62807
62824
  function formatRuntimeReportSubmission(submission) {
62808
62825
  switch (submission.status) {
@@ -63407,7 +63424,7 @@ async function runProfileCreate(input) {
63407
63424
  presenter,
63408
63425
  profile: created,
63409
63426
  agentRuntimeState: await resolveAgentProfileRuntimeState(created),
63410
- selectionResult: await setSelectedAtsProfileId(created.atsProfileId),
63427
+ selectionResult: runtime.resolvedView === "human" ? await setSelectedAtsProfileId(created.atsProfileId) : null,
63411
63428
  setupResult: draft.setupResult
63412
63429
  });
63413
63430
  }
@@ -63493,6 +63510,7 @@ async function resolveProfileCreateLocalAgentSelection(input) {
63493
63510
  }
63494
63511
  async function emitProfileCreateResult(input) {
63495
63512
  if (input.runtime.resolvedView === "human") {
63513
+ if (!input.selectionResult) throw new Error("profile.create selection result missing in human view");
63496
63514
  renderProfileReadyCard({
63497
63515
  presenter: input.presenter,
63498
63516
  profile: input.profile,
@@ -63523,7 +63541,9 @@ async function emitProfileCreateResult(input) {
63523
63541
  profileKind: input.profile.profileKind,
63524
63542
  ownerUserId: input.profile.ownerUserId,
63525
63543
  ...buildAgentProfileStateData(input.profile),
63526
- ...buildAgentProfileRuntimeData(input.agentRuntimeState)
63544
+ ...buildAgentProfileRuntimeData(input.agentRuntimeState),
63545
+ currentProfileChanged: false,
63546
+ nextSteps: buildAgentCreateNextSteps(input.profile)
63527
63547
  }
63528
63548
  });
63529
63549
  await emitProfileCreateAgentSetupHint({
@@ -63533,26 +63553,15 @@ async function emitProfileCreateResult(input) {
63533
63553
  setupResult: input.setupResult
63534
63554
  });
63535
63555
  input.presenter.line({
63536
- code: "profile.current_set",
63537
- text: formatMessage(input.runtime.resolvedView, "profile.current_set", { profile: input.profile.atsProfileId }),
63556
+ code: "profile.selection_unchanged",
63557
+ text: `created profile ${input.profile.atsProfileId}; current profile was not changed`,
63538
63558
  data: {
63539
- profile: input.profile.atsProfileId,
63540
- atsProfileId: input.profile.atsProfileId,
63541
- profileName: input.profile.profileName,
63542
- profileHandle: input.profile.profileHandle,
63543
- profileKind: input.profile.profileKind,
63544
- ownerUserId: input.profile.ownerUserId,
63545
- ...buildAgentProfileStateData(input.profile),
63546
- ...buildAgentProfileRuntimeData(input.agentRuntimeState),
63559
+ createdProfileId: input.profile.atsProfileId,
63560
+ currentProfileChanged: false,
63561
+ reason: "Agent View profile creation does not change the acting identity. Pass --profile explicitly when this profile should act.",
63547
63562
  nextSteps: buildAgentCreateNextSteps(input.profile)
63548
63563
  }
63549
63564
  });
63550
- emitNonPersistentSelectionWarning({
63551
- runtime: input.runtime,
63552
- presenter: input.presenter,
63553
- selectionPersistent: input.selectionResult.persistent,
63554
- runtimeSessionSource: input.selectionResult.runtimeSessionSource
63555
- });
63556
63565
  }
63557
63566
  function emitProfileCreateAgentSetupHint(input) {
63558
63567
  if (!input.setupResult || input.setupResult.status === "configured") return;
@@ -66423,7 +66432,7 @@ function buildHumanTraceRows(input) {
66423
66432
  },
66424
66433
  {
66425
66434
  label: "Next",
66426
- value: formatAtsCliCommand("ats space history <space-id> --limit 20")
66435
+ value: formatAtsCliCommand("ats space history <space-id> --kind text --limit 20")
66427
66436
  }
66428
66437
  ];
66429
66438
  const rows = [
@@ -68178,7 +68187,7 @@ const SUMMARY_BY_COMMAND = {
68178
68187
  join: "Use `ats space join --view agent` with an explicit space ID to connect deterministically.",
68179
68188
  watch: "Use `ats space watch --view agent` with an explicit space ID to read space activity deterministically.",
68180
68189
  send: "Use `ats space send --view agent` with an explicit space ID and explicit message input.",
68181
- history: "Use `ats space history --view agent` with an explicit space ID to read recent history, pull context after one signal, or inspect a local window around one signal. `--json` emits signal envelopes plus `messageReadProjection`.",
68190
+ history: "Use `ats space history --kind text --brief --view agent` with an explicit space ID for conversation context. Use `--json` only when you need signal envelopes plus `messageReadProjection`.",
68182
68191
  contract: "Use `ats space contract --view agent` with an explicit space ID to read the current space contract deterministically.",
68183
68192
  contract_set: "Use `ats space contract set --view agent` with an explicit space ID and explicit patch flags to update the current space contract deterministically.",
68184
68193
  status: "Use `ats space status --view agent` with an explicit space ID to read the current space status deterministically.",
@@ -74727,7 +74736,10 @@ async function emitSpaceCommandPreflight(input) {
74727
74736
  profileName: input.profile.profileName,
74728
74737
  profileKind: input.profile.profileKind
74729
74738
  },
74730
- agentReplyReadiness: toSpacePreflightAgentReplyReadiness(replyReadinessSnapshot.agentReplyReadiness),
74739
+ agentReplyReadiness: toSpacePreflightAgentReplyReadiness({
74740
+ command: input.command,
74741
+ readiness: replyReadinessSnapshot.agentReplyReadiness
74742
+ }),
74731
74743
  services: { daemon: {
74732
74744
  installed: replyReadinessSnapshot.daemonStatus.installed,
74733
74745
  version: replyReadinessSnapshot.daemonStatus.installed ? replyReadinessSnapshot.daemonStatus.state.daemonVersion : null,
@@ -74898,13 +74910,17 @@ function resolveSpacePreflightRepairReason(serviceParticipationReadiness) {
74898
74910
  }
74899
74911
  }
74900
74912
  function toSpacePreflightAgentReplyReadiness(input) {
74901
- if (!input) return null;
74913
+ if (!shouldIncludeWakeReadinessInSpacePreflight(input.command)) return null;
74914
+ if (!input.readiness) return null;
74902
74915
  return {
74903
- reasonCodes: input.reasonCodes,
74904
- reasonText: input.reasonText,
74905
- replyReadiness: input.replyReadiness
74916
+ reasonCodes: input.readiness.reasonCodes,
74917
+ reasonText: input.readiness.reasonText,
74918
+ replyReadiness: input.readiness.replyReadiness
74906
74919
  };
74907
74920
  }
74921
+ function shouldIncludeWakeReadinessInSpacePreflight(command) {
74922
+ return command === "join";
74923
+ }
74908
74924
  function emitSpacePreflightRepairGuidance(input) {
74909
74925
  if (!input.guidance || input.mode === "suppress") return;
74910
74926
  input.presenter.line({
@@ -74920,7 +74936,7 @@ function shouldEmitSpaceCommandPreflightOutput(emitOutput) {
74920
74936
  return emitOutput !== false;
74921
74937
  }
74922
74938
  function emitSpaceFailureNextStep(input) {
74923
- const guidance = resolveSpaceFailureGuidance(input.error);
74939
+ const guidance = resolveSpaceFailureGuidance(input.error, { command: input.command });
74924
74940
  if (!guidance) return;
74925
74941
  input.presenter.line({
74926
74942
  code: `space.${input.command}.next_step`,
@@ -74931,7 +74947,7 @@ function emitSpaceFailureNextStep(input) {
74931
74947
  }
74932
74948
  });
74933
74949
  }
74934
- function resolveSpaceFailureGuidance(error) {
74950
+ function resolveSpaceFailureGuidance(error, options = {}) {
74935
74951
  const message = toErrorMessage$7(error);
74936
74952
  const lowered = message.toLowerCase();
74937
74953
  const localErrorCode = readErrorCode(error);
@@ -75016,6 +75032,7 @@ function resolveSpaceFailureGuidance(error) {
75016
75032
  }
75017
75033
  if (lowered.includes("network.timeout") || lowered.includes("timed out") || lowered.includes("upstream_unreachable") || lowered.includes("gateway is unreachable") || lowered.includes("can't reach the gateway")) return resolveGatewayUnavailableFailureGuidance({
75018
75034
  code,
75035
+ command: options.command,
75019
75036
  message,
75020
75037
  parsedHttpError,
75021
75038
  status
@@ -75023,6 +75040,11 @@ function resolveSpaceFailureGuidance(error) {
75023
75040
  return null;
75024
75041
  }
75025
75042
  function resolveGatewayUnavailableFailureGuidance(input) {
75043
+ if (input.command === "send") return {
75044
+ reason: "space_send_timeout_uncertain",
75045
+ summary: "the send request timed out before ATS could confirm the result. Check recent text history before retrying so you do not duplicate a message.",
75046
+ steps: [formatAtsCliCommand("ats space history <space-id> --kind text --limit 20 --view agent")]
75047
+ };
75026
75048
  const failureKind = classifyGatewayChainFailure({
75027
75049
  code: input.code,
75028
75050
  message: resolveGatewayFailureMessage(input),
@@ -84498,7 +84520,7 @@ function buildSpaceListProofPayload() {
84498
84520
  wakeExecutionSucceeded: "not_checked",
84499
84521
  proves: "This command proves known Space records are visible to the acting profile.",
84500
84522
  doesNotProve: "It does not prove conversation history is readable, members are wake-ready, or a Wake produced a visible reply.",
84501
- nextChecks: ["<ATS_CLI> space history <space-id> --brief --limit 20 --view agent", "<ATS_CLI> space status <space-id> --json --view agent"]
84523
+ nextChecks: ["<ATS_CLI> space history <space-id> --kind text --brief --limit 20 --view agent", "<ATS_CLI> space status <space-id> --json --view agent"]
84502
84524
  };
84503
84525
  }
84504
84526
  async function runSpaceAddMembers(input) {
@@ -98026,12 +98048,12 @@ function resolveSpaceHintByMessage(message) {
98026
98048
  commandPrefix: "ats space send"
98027
98049
  })) return [
98028
98050
  "ats space send <space-id> \"hello world\"",
98029
- "ats space history <space-id> --limit 20",
98051
+ "ats space history <space-id> --kind text --limit 20",
98030
98052
  "ats space join <space-id>"
98031
98053
  ];
98032
98054
  if (message.includes("agent role is required for this space; pass --role <text>") || message.includes("agent roleInstructions is required for this space; pass --role-instructions <text>")) return [
98033
98055
  "ats space join <space-id> --role <text> --role-instructions <text>",
98034
- "ats space history <space-id> --limit 20",
98056
+ "ats space history <space-id> --kind text --limit 20",
98035
98057
  "ats space watch <space-id>"
98036
98058
  ];
98037
98059
  if (includesMissingRequiredArgumentMessage(message, {
@@ -98039,7 +98061,7 @@ function resolveSpaceHintByMessage(message) {
98039
98061
  commandPrefix: "ats space"
98040
98062
  })) return [
98041
98063
  "ats --view human space",
98042
- "ats space history <space-id>",
98064
+ "ats space history <space-id> --kind text",
98043
98065
  "ats space join <space-id>"
98044
98066
  ];
98045
98067
  return null;