agent-transport-system 0.6.5 → 0.6.6

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
@@ -27,7 +27,7 @@ import wrapAnsi from "wrap-ansi";
27
27
  import { Box, Container, Editor, Key, ProcessTerminal, TUI, Text, getEditorKeybindings, matchesKey } from "@mariozechner/pi-tui";
28
28
 
29
29
  //#region package.json
30
- var version = "0.6.5";
30
+ var version = "0.6.6";
31
31
  var package_default = {
32
32
  $schema: "https://www.schemastore.org/package.json",
33
33
  name: "agent-transport-system",
@@ -45076,7 +45076,10 @@ function buildLocalServiceDiagnosticsPayload(input) {
45076
45076
  return { localServiceDiagnostics: {
45077
45077
  source: "local_service_diagnostics",
45078
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.",
45079
+ authoritative: false,
45080
+ verdict: "not_wake_readiness",
45081
+ meaning: "Diagnostic-only local service evidence. It can explain local problems, but it is not the Ready verdict and not a Space Wake outcome. Use daemonRouteObservation for current route evidence and service trace for a concrete Wake delivery.",
45082
+ useInstead: ["daemonRouteObservation", "ats service trace"],
45080
45083
  deviceEvidence: input.deviceEvidence,
45081
45084
  agentEvidence: input.agentEvidence
45082
45085
  } };
@@ -51891,6 +51894,7 @@ async function runSkillsCheck$1(input) {
51891
51894
  targetStates,
51892
51895
  legacyFindings,
51893
51896
  legacyFindingCount: legacyFindings.length,
51897
+ legacyReview: legacyFindings.length > 0 ? buildLegacyAtsSkillAgentReview(legacyFindings) : null,
51894
51898
  requiresReview: summary.outdated > 0 || summary.missing > 0 || summary.externalConflict > 0 || legacyFindings.length > 0
51895
51899
  };
51896
51900
  if (runtime.resolvedView === "agent" && !input.suppressAgentOverview) emitSkillsAgentOverview({
@@ -53359,6 +53363,15 @@ function buildLegacyAtsSkillNextStepRows(legacyFindings) {
53359
53363
  value: pc.bold(formatInlineAtsCliCommands("Remove or rename the listed legacy ATS skill directories after installing the current skill with `ats skills ensure --all --view agent` or `ats skills ensure --dir <absolute-path> --view agent`."))
53360
53364
  }];
53361
53365
  }
53366
+ function buildLegacyAtsSkillAgentReview(legacyFindings) {
53367
+ return {
53368
+ priority: "high",
53369
+ reason: "Legacy or unmanaged ATS skill copies can make agents read old ATS instructions even when the current ATS-managed skill is up to date.",
53370
+ nextStep: "Install the current ATS skill first, then remove or rename each listed legacy directory.",
53371
+ paths: legacyFindings.map((finding) => finding.skillDir),
53372
+ cleanupCommands: legacyFindings.flatMap((finding) => finding.cleanupCommands)
53373
+ };
53374
+ }
53362
53375
  function formatSkillsCommand(command) {
53363
53376
  return pc.bold(pc.cyan(formatAtsCliCommand(command)));
53364
53377
  }
@@ -53886,6 +53899,7 @@ function emitInstallSummary(input) {
53886
53899
  results: input.installResults,
53887
53900
  legacyFindings: input.legacyFindings ?? [],
53888
53901
  legacyFindingCount: input.legacyFindings?.length ?? 0,
53902
+ legacyReview: (input.legacyFindings?.length ?? 0) > 0 ? buildLegacyAtsSkillAgentReview(input.legacyFindings ?? []) : null,
53889
53903
  requiresReview: summary.failed > 0 || (input.legacyFindings?.length ?? 0) > 0
53890
53904
  };
53891
53905
  if (input.resolvedView === "agent") {
@@ -68247,10 +68261,20 @@ function buildSpaceAgentOverviewPayload(command) {
68247
68261
  commands: guide.agentCommands ?? [],
68248
68262
  stages: STAGES_BY_COMMAND[command],
68249
68263
  notes: guide.notes ?? [],
68250
- humanActionRequired: {
68251
- possible: (guide.humanSteps?.length ?? 0) > 0,
68252
- steps: guide.humanSteps ?? []
68253
- }
68264
+ humanActionRequired: resolveSpaceAgentOverviewHumanActionRequired({
68265
+ command,
68266
+ humanSteps: guide.humanSteps ?? []
68267
+ })
68268
+ };
68269
+ }
68270
+ function resolveSpaceAgentOverviewHumanActionRequired(input) {
68271
+ if (input.command !== "delete") return {
68272
+ possible: false,
68273
+ steps: []
68274
+ };
68275
+ return {
68276
+ possible: input.humanSteps.length > 0,
68277
+ steps: input.humanSteps
68254
68278
  };
68255
68279
  }
68256
68280
  function resolveGuide$1(command) {
@@ -83322,9 +83346,18 @@ async function runSend(input) {
83322
83346
  };
83323
83347
  const text = sanitizeText(input.text);
83324
83348
  if (!text.ok) throw new Error(text.reason);
83349
+ emitAgentSendProgress({
83350
+ presenter,
83351
+ resolvedView: runtime.resolvedView,
83352
+ stage: "prepare_message",
83353
+ summary: "Preparing message text and canonical Space mentions.",
83354
+ spaceId: space
83355
+ });
83325
83356
  const { outboundMessageEnvelope, outboundText } = await resolveOutboundSubmission({
83326
83357
  atsProfile,
83327
83358
  password: input.password,
83359
+ presenter,
83360
+ resolvedView: runtime.resolvedView,
83328
83361
  space,
83329
83362
  spaceApi,
83330
83363
  text: text.value
@@ -83340,6 +83373,13 @@ async function runSend(input) {
83340
83373
  });
83341
83374
  const requestContext = buildAtsRequestContextFromProfile({ atsProfile });
83342
83375
  const clientMessageId = crypto.randomUUID();
83376
+ emitAgentSendProgress({
83377
+ presenter,
83378
+ resolvedView: runtime.resolvedView,
83379
+ stage: "post_message",
83380
+ summary: "Posting the Space message through ATS Gateway.",
83381
+ spaceId: space
83382
+ });
83343
83383
  const payload = await spaceApi.postNormalMessage({
83344
83384
  spaceId: space,
83345
83385
  requestContext,
@@ -83364,6 +83404,13 @@ async function resolveOutboundSubmission(input) {
83364
83404
  rethrowCanonicalMentionSnapshotLoadFailure(error);
83365
83405
  },
83366
83406
  loadMembersSnapshot: async () => {
83407
+ emitAgentSendProgress({
83408
+ presenter: input.presenter,
83409
+ resolvedView: input.resolvedView,
83410
+ stage: "load_members",
83411
+ summary: "Loading current Space members to resolve canonical mentions.",
83412
+ spaceId: input.space
83413
+ });
83367
83414
  const requestContext = buildAtsRequestContextFromProfile({ atsProfile: input.atsProfile });
83368
83415
  return await input.spaceApi.getMembersSnapshot({
83369
83416
  requestContext,
@@ -83378,6 +83425,17 @@ async function resolveOutboundSubmission(input) {
83378
83425
  outboundText: preparedSubmission.outboundText
83379
83426
  };
83380
83427
  }
83428
+ function emitAgentSendProgress(input) {
83429
+ if (input.resolvedView !== "agent") return;
83430
+ input.presenter.line({
83431
+ code: "send.progress",
83432
+ text: `${input.stage}: ${input.summary}`,
83433
+ data: {
83434
+ spaceId: input.spaceId,
83435
+ stage: input.stage
83436
+ }
83437
+ });
83438
+ }
83381
83439
 
83382
83440
  //#endregion
83383
83441
  //#region src/space/send-input.ts
@@ -83666,7 +83724,17 @@ async function runSpaceCreate(input) {
83666
83724
  }).catch((error) => {
83667
83725
  contextPresenter.event("info", "connect.warn.profile_space_history_sync_failed", { error: toErrorMessage$2(error) });
83668
83726
  });
83669
- if (!(isHumanInteractiveSpaceRuntime(contextRuntime) ? Boolean(createInput.value.joinInput) : await resolveJoinAfterCreate(createInput.value.joinInput, contextInteractive))) return "completed";
83727
+ const joinNow = isHumanInteractiveSpaceRuntime(contextRuntime) ? Boolean(createInput.value.joinInput) : await resolveJoinAfterCreate(createInput.value.joinInput, contextInteractive);
83728
+ if (contextRuntime.resolvedView === "agent") {
83729
+ emitSpaceCreateAgentFollowUp({
83730
+ presenter: contextPresenter,
83731
+ profileId: atsProfile.atsProfileId,
83732
+ spaceId: parsed.spaceId,
83733
+ joinRequested: joinNow
83734
+ });
83735
+ return "completed";
83736
+ }
83737
+ if (!joinNow) return "completed";
83670
83738
  return await runSpaceJoin(buildPostCreateJoinRequest({
83671
83739
  atsProfileId: atsProfile.atsProfileId,
83672
83740
  baseUrl,
@@ -83691,6 +83759,20 @@ async function runSpaceCreate(input) {
83691
83759
  throw error;
83692
83760
  }
83693
83761
  }
83762
+ function emitSpaceCreateAgentFollowUp(input) {
83763
+ const historyCommand = formatAtsCliCommand(`ats space history ${input.spaceId} --profile ${input.profileId} --kind text --brief --limit 20 --view agent`);
83764
+ const sendCommand = formatAtsCliCommand(`ats space send ${input.spaceId} --profile ${input.profileId} "hello" --view agent`);
83765
+ input.presenter.data({
83766
+ code: "space.create.next_commands",
83767
+ payload: {
83768
+ spaceId: input.spaceId,
83769
+ joinRequested: input.joinRequested,
83770
+ joinedByCreate: true,
83771
+ note: "Agent View create returns after creating the Space. Use explicit follow-up commands instead of opening a long-running join session.",
83772
+ nextCommands: [historyCommand, sendCommand]
83773
+ }
83774
+ });
83775
+ }
83694
83776
  async function syncProfileSpaceHistoryForCreate(input) {
83695
83777
  const gatewayHost = resolveGatewayHost(input.baseUrl);
83696
83778
  if (!gatewayHost) return;
@@ -84739,6 +84821,13 @@ async function runSpaceAddMembersForTarget(input) {
84739
84821
  authenticatedGatewayUrl: input.authenticatedGatewayUrl
84740
84822
  });
84741
84823
  if (!authenticatedGatewayUrl) return { status: "cancelled" };
84824
+ emitAgentSpaceAddMembersProgress({
84825
+ presenter: input.presenter,
84826
+ resolvedView: input.runtime.resolvedView,
84827
+ spaceId: input.target.space,
84828
+ stage: "resolve_candidates",
84829
+ summary: "Reading selectable profiles for this Space."
84830
+ });
84742
84831
  const candidates = await resolveSpaceMemberCandidatesForAdd({
84743
84832
  currentProfile: input.atsProfile,
84744
84833
  currentOwnerUserId: input.atsProfile.ownerUserId,
@@ -84776,6 +84865,14 @@ async function runSpaceAddMembersForTarget(input) {
84776
84865
  selectedProfileIds
84777
84866
  });
84778
84867
  if (selectedCandidates.length === 0) return { status: "completed" };
84868
+ emitAgentSpaceAddMembersProgress({
84869
+ presenter: input.presenter,
84870
+ resolvedView: input.runtime.resolvedView,
84871
+ spaceId: input.target.space,
84872
+ stage: "prepare_local_participation",
84873
+ summary: "Checking selected profiles before adding them to the Space.",
84874
+ profileIds: selectedCandidates.map((candidate) => candidate.profileId)
84875
+ });
84779
84876
  const servicePreparationResult = await ensureSpaceMemberCandidatesLocalParticipationReady({
84780
84877
  atsProfile: input.atsProfile,
84781
84878
  candidates: selectedCandidates,
@@ -84789,6 +84886,14 @@ async function runSpaceAddMembersForTarget(input) {
84789
84886
  authenticatedGatewayUrl
84790
84887
  } : { status: "cancelled" };
84791
84888
  const preparedCandidates = servicePreparationResult.candidates;
84889
+ emitAgentSpaceAddMembersProgress({
84890
+ presenter: input.presenter,
84891
+ resolvedView: input.runtime.resolvedView,
84892
+ spaceId: input.target.space,
84893
+ stage: "add_members",
84894
+ summary: "Adding selected profiles to the Space.",
84895
+ profileIds: preparedCandidates.map((candidate) => candidate.profileId)
84896
+ });
84792
84897
  const result = await applySpaceAddMembers({
84793
84898
  actorProfile: input.atsProfile,
84794
84899
  candidates: preparedCandidates,
@@ -84797,6 +84902,14 @@ async function runSpaceAddMembersForTarget(input) {
84797
84902
  baseUrl: targetBaseUrl,
84798
84903
  password: input.password
84799
84904
  });
84905
+ emitAgentSpaceAddMembersProgress({
84906
+ presenter: input.presenter,
84907
+ resolvedView: input.runtime.resolvedView,
84908
+ spaceId: input.target.space,
84909
+ stage: "record_join_notices",
84910
+ summary: "Recording visible join notices for newly added members.",
84911
+ profileIds: result.added.map((candidate) => candidate.profileId)
84912
+ });
84800
84913
  const joinNoticeSummary = await persistSpaceAddMembersJoinNotices({
84801
84914
  actorProfile: input.atsProfile,
84802
84915
  baseUrl: targetBaseUrl,
@@ -84826,6 +84939,18 @@ async function runSpaceAddMembersForTarget(input) {
84826
84939
  });
84827
84940
  return { status: "completed" };
84828
84941
  }
84942
+ function emitAgentSpaceAddMembersProgress(input) {
84943
+ if (input.resolvedView !== "agent") return;
84944
+ input.presenter.line({
84945
+ code: "space.add_members.progress",
84946
+ text: `${input.stage}: ${input.summary}`,
84947
+ data: {
84948
+ stage: input.stage,
84949
+ spaceId: input.spaceId,
84950
+ ...input.profileIds ? { profileIds: input.profileIds } : {}
84951
+ }
84952
+ });
84953
+ }
84829
84954
  async function runSpaceRemoveMembersForTarget(input) {
84830
84955
  const targetBaseUrl = input.hasExplicitBaseUrlInput ? input.baseUrl : input.target.baseUrl ?? input.baseUrl;
84831
84956
  const authenticatedGatewayUrl = await ensureSpaceCommandGatewayAuthenticationOrCancel({