agent-transport-system 0.7.11 → 0.7.13

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.7.11";
30
+ var version = "0.7.13";
31
31
  var package_default = {
32
32
  $schema: "https://www.schemastore.org/package.json",
33
33
  name: "agent-transport-system",
@@ -29803,6 +29803,11 @@ function spaceTextHasOneShotMentionAttempts(text) {
29803
29803
  return spaceTextHasCanonicalMentionAttempts(text);
29804
29804
  }
29805
29805
  function buildSpaceMemberAgentPresencePresentation(member) {
29806
+ const { publicReplyPresence: publicPresence } = resolveSpaceMemberAgentPublicCollaborationView(member);
29807
+ if (publicPresence) return buildPublicReplyPresencePresentation({
29808
+ liveNow: member.liveNow,
29809
+ status: publicPresence.status
29810
+ });
29806
29811
  return buildSpaceMemberAgentOwnerLocalControlPresencePresentation(member);
29807
29812
  }
29808
29813
  function buildSpaceMemberAgentOwnerLocalControlPresencePresentation(member) {
@@ -52962,6 +52967,7 @@ async function runSkillsInstall(input) {
52962
52967
  presenter,
52963
52968
  installResults,
52964
52969
  legacyFindings,
52970
+ quiet: input.quiet,
52965
52971
  storeDir: skillsDir()
52966
52972
  });
52967
52973
  return "completed";
@@ -54567,6 +54573,7 @@ function emitInstallSummary(input) {
54567
54573
  legacyReview: legacyFindings.length > 0 ? buildLegacyAtsSkillAgentReview(legacyFindings) : null,
54568
54574
  requiresReview: summary.failed > 0 || legacyFindings.length > 0
54569
54575
  };
54576
+ if (input.quiet && !payload.requiresReview) return;
54570
54577
  if (input.resolvedView === "agent") {
54571
54578
  emitLegacyAtsSkillAgentAttention({
54572
54579
  legacyFindings,
@@ -67878,31 +67885,6 @@ async function emitSetupLocalAgentConnectionReadinessResult(input) {
67878
67885
  reasonCodes: assessment.reasonCodes,
67879
67886
  runtimeReportSubmission
67880
67887
  });
67881
- const basePayload = {
67882
- profile: {
67883
- profileId: input.profile.atsProfileId,
67884
- profileName: input.profile.profileName,
67885
- profileKind: input.profile.profileKind
67886
- },
67887
- localAgentReadiness,
67888
- atsService: {
67889
- serviceReadiness: serviceReadiness.serviceReadiness,
67890
- serviceReadinessState: serviceReadiness.serviceReadinessState,
67891
- summaryText: serviceReadiness.summaryText,
67892
- detailText: serviceReadiness.detailText,
67893
- nextSteps: serviceReadiness.nextSteps,
67894
- runtimeHeadline: serviceReadiness.runtimeHeadline
67895
- },
67896
- diagnostics: buildLocalReplyReadinessEvidenceDiagnostics({
67897
- deviceReplyReadiness: snapshot.deviceReplyReadiness,
67898
- legacyAgentReplyReadiness: snapshot.agentReplyReadiness
67899
- }),
67900
- runtimeReportSubmission,
67901
- agentProfileBindingEnsure,
67902
- formalAgentConnection,
67903
- agentConnectionReadiness,
67904
- guidance
67905
- };
67906
67888
  if (input.view === "human") {
67907
67889
  renderInfoCard({
67908
67890
  presenter: input.presenter,
@@ -67946,19 +67928,23 @@ async function emitSetupLocalAgentConnectionReadinessResult(input) {
67946
67928
  });
67947
67929
  return completionFacts;
67948
67930
  }
67949
- const prepareReadiness = await resolvePrepareReadinessApiEvidence({ profile: input.profile });
67950
- const payload = {
67951
- ...basePayload,
67952
- prepareReadiness
67953
- };
67931
+ const payload = buildSetupLocalAgentConnectionAgentPayload({
67932
+ agentConnectionReadiness,
67933
+ agentProfileBindingEnsure,
67934
+ formalAgentConnection,
67935
+ guidance,
67936
+ localAgentReadiness,
67937
+ profile: input.profile,
67938
+ runtimeReportSubmission,
67939
+ serviceReadiness
67940
+ });
67954
67941
  input.presenter.data({
67955
67942
  code: "setup.local_agent_connection.result",
67956
67943
  payload
67957
67944
  });
67958
67945
  input.presenter.line({
67959
67946
  code: "setup.local_agent_connection.summary",
67960
- text: `profile ${input.profile.atsProfileId}: agent_connection=${agentConnectionReadiness.status}, can_reply_from_this_computer=${agentConnectionReadiness.canReplyFromThisComputer ? "true" : "false"}, local_agent_readiness_evidence=${localAgentReadiness.status}, ats_service=${serviceReadiness.serviceReadiness}, next_action=${agentConnectionReadiness.nextAction ?? "none"}`,
67961
- data: payload
67947
+ text: `profile ${input.profile.atsProfileId}: agent_connection=${agentConnectionReadiness.status}, can_reply_from_this_computer=${agentConnectionReadiness.canReplyFromThisComputer ? "true" : "false"}, local_agent_readiness_evidence=${localAgentReadiness.status}, ats_service=${serviceReadiness.serviceReadiness}, next_action=${agentConnectionReadiness.nextAction ?? "none"}`
67962
67948
  });
67963
67949
  return completionFacts;
67964
67950
  }
@@ -68051,6 +68037,54 @@ function resolveLocalAgentReadinessSummary(state) {
68051
68037
  };
68052
68038
  }
68053
68039
  }
68040
+ function buildSetupLocalAgentConnectionAgentPayload(input) {
68041
+ const reportDetail = input.runtimeReportSubmission;
68042
+ const capability = parseCapabilityRef(input.runtimeReportSubmission.capabilityRef);
68043
+ return {
68044
+ profile: {
68045
+ profileId: input.profile.atsProfileId,
68046
+ profileName: input.profile.profileName,
68047
+ profileKind: input.profile.profileKind
68048
+ },
68049
+ localAgent: capability ? {
68050
+ agentId: capability.id,
68051
+ capabilityRef: capability.ref
68052
+ } : null,
68053
+ connection: {
68054
+ status: input.agentConnectionReadiness.status,
68055
+ canBeWokenInSpaces: input.agentConnectionReadiness.canBeWokenInSpaces,
68056
+ canReplyFromThisComputer: input.agentConnectionReadiness.canReplyFromThisComputer,
68057
+ summary: input.agentConnectionReadiness.summary,
68058
+ nextAction: input.agentConnectionReadiness.nextAction,
68059
+ reasonCodes: [...input.agentConnectionReadiness.reasonCodes]
68060
+ },
68061
+ localAgentReadiness: {
68062
+ status: input.localAgentReadiness.status,
68063
+ label: input.localAgentReadiness.label
68064
+ },
68065
+ atsService: {
68066
+ status: input.serviceReadiness.serviceReadiness,
68067
+ label: formatServiceParticipationReadinessLabel(input.serviceReadiness),
68068
+ nextSteps: input.serviceReadiness.nextSteps
68069
+ },
68070
+ serverConnectionReport: {
68071
+ status: input.runtimeReportSubmission.status,
68072
+ runtimeId: reportDetail.runtimeId ?? null,
68073
+ reason: reportDetail.reason ?? null
68074
+ },
68075
+ binding: {
68076
+ status: input.agentProfileBindingEnsure.status,
68077
+ label: input.formalAgentConnection.label,
68078
+ routable: input.agentProfileBindingEnsure.routable,
68079
+ reasonCodes: [...input.formalAgentConnection.reasonCodes]
68080
+ },
68081
+ guidance: {
68082
+ summary: input.guidance.summary,
68083
+ nextSteps: input.guidance.nextSteps
68084
+ },
68085
+ detailsCommand: formatAtsCliCommand(`ats service status --profile ${input.profile.atsProfileId} --view agent`)
68086
+ };
68087
+ }
68054
68088
  function resolveFormalAgentConnectionProjection(result) {
68055
68089
  if (result.status === "accepted" && result.routable) return {
68056
68090
  label: "Connected to this computer.",
@@ -68172,12 +68206,6 @@ function isLocalServiceConnectionUnavailableReason(reasonCode) {
68172
68206
  function isConnectionVerificationPendingReason(reasonCode) {
68173
68207
  return reasonCode === "agent_profile_binding.execution_readiness_pending";
68174
68208
  }
68175
- function buildLocalReplyReadinessEvidenceDiagnostics(input) {
68176
- return buildLocalServiceDiagnosticsPayload({
68177
- deviceEvidence: input.deviceReplyReadiness,
68178
- agentEvidence: input.legacyAgentReplyReadiness
68179
- });
68180
- }
68181
68209
  function formatRuntimeReportSubmission(submission) {
68182
68210
  switch (submission.status) {
68183
68211
  case "submitted": return "Submitted.";
@@ -68517,9 +68545,44 @@ function emitSetupComplete(input) {
68517
68545
  }
68518
68546
  input.presenter.data({
68519
68547
  code: "setup.complete",
68520
- payload
68548
+ payload: buildSetupCompleteAgentPayload(payload)
68521
68549
  });
68522
68550
  }
68551
+ function buildSetupCompleteAgentPayload(input) {
68552
+ return {
68553
+ lane: input.lane,
68554
+ cliCommandPrefix: input.cliCommandPrefix,
68555
+ laneRoot: input.laneRoot,
68556
+ gatewayUrl: input.gatewayUrl,
68557
+ authBaseUrl: input.authBaseUrl,
68558
+ path: input.path,
68559
+ service: input.service,
68560
+ localAgents: input.localAgents,
68561
+ localComponents: {
68562
+ entrypoint: input.localComponents.entrypoint,
68563
+ summaryLabel: input.localComponents.summaryLabel,
68564
+ setupAction: input.localComponents.setupAction,
68565
+ setupActionLabel: input.localComponents.setupActionLabel,
68566
+ cli: {
68567
+ status: input.localComponents.cli.status,
68568
+ packageVersion: input.localComponents.cli.packageVersion,
68569
+ latestPackageVersion: input.localComponents.cli.latestPackageVersion ?? null
68570
+ },
68571
+ service: {
68572
+ status: input.localComponents.service.status,
68573
+ installedBundleVersion: input.localComponents.service.installedBundleVersion ?? null,
68574
+ expectedBundleVersion: input.localComponents.service.expectedBundleVersion ?? null
68575
+ },
68576
+ skills: {
68577
+ status: input.localComponents.skills.status,
68578
+ targetCount: input.localComponents.skills.targetCount
68579
+ }
68580
+ },
68581
+ routeCatalogSync: input.routeCatalogSync,
68582
+ nextCommands: input.nextCommands,
68583
+ note: input.note
68584
+ };
68585
+ }
68523
68586
  async function ensureSetupManagedSkills(input) {
68524
68587
  const result = await runSkillsEnsure({
68525
68588
  all: true,
@@ -76061,12 +76124,6 @@ function buildLocalServiceNotRequiredPreflight(input) {
76061
76124
  },
76062
76125
  actionRequirements: input.actionRequirements,
76063
76126
  agentReplyReadiness: null,
76064
- services: { daemon: {
76065
- installed: false,
76066
- version: null,
76067
- runtimeStatus: "unknown",
76068
- runtimeReason: null
76069
- } },
76070
76127
  env: {
76071
76128
  baseUrl: input.baseUrl,
76072
76129
  requestTimeoutMs: resolveSpaceRequestTimeoutMsForDiagnostics()
@@ -76163,7 +76220,7 @@ function shouldSurfaceServiceRepairGuidanceInPreflight(command) {
76163
76220
  }
76164
76221
  function buildAgentSpaceCommandPreflightText(input) {
76165
76222
  if (input.payload.actionRequirements.localService === "not_required") return `preflight ${input.payload.command}: auth=${input.payload.auth.state}, profile=${input.payload.profile.profileId}, local_service=not_required`;
76166
- return `preflight ${input.payload.command}: auth=${input.payload.auth.state}, profile=${input.payload.profile.profileId}, daemon=${input.payload.services.daemon.runtimeStatus}, local_service_link=${input.serviceParticipationReadiness.serviceReadiness}, service_state=${input.serviceParticipationReadiness.serviceReadinessState}`;
76223
+ return `preflight ${input.payload.command}: auth=${input.payload.auth.state}, profile=${input.payload.profile.profileId}, daemon=${input.payload.services?.daemon.runtimeStatus ?? "unknown"}, local_service_link=${input.serviceParticipationReadiness.serviceReadiness}, service_state=${input.serviceParticipationReadiness.serviceReadinessState}`;
76167
76224
  }
76168
76225
  function buildHumanSpaceCommandPreflightText(input) {
76169
76226
  const actionRequirements = resolveSpacePreflightActionRequirements(input.command);
@@ -83529,7 +83586,7 @@ async function prepareSpaceJoinEntryContext(input) {
83529
83586
  view: input.view
83530
83587
  });
83531
83588
  const presenter = createPresenter(runtime);
83532
- emitJoinEntryOverview({
83589
+ if (runtime.resolvedView === "agent" && String(input.space ?? "").trim().length === 0) emitJoinEntryOverview({
83533
83590
  presenter,
83534
83591
  resolvedView: runtime.resolvedView,
83535
83592
  rawStream: input.rawStream
@@ -87129,12 +87186,14 @@ async function prepareSpaceCreateRuntimeState(input) {
87129
87186
  });
87130
87187
  const presenter = createPresenter(runtime);
87131
87188
  const interactive = canUseInteractivePrompts(runtime);
87132
- emitSpaceAgentOverview({
87133
- presenter,
87134
- resolvedView: runtime.resolvedView,
87135
- command: "create"
87136
- });
87137
- if (runtime.resolvedView === "agent" && String(input.name ?? "").trim().length === 0) throw createSpaceCreateGuideError();
87189
+ if (runtime.resolvedView === "agent" && String(input.name ?? "").trim().length === 0) {
87190
+ emitSpaceAgentOverview({
87191
+ presenter,
87192
+ resolvedView: runtime.resolvedView,
87193
+ command: "create"
87194
+ });
87195
+ throw createSpaceCreateGuideError();
87196
+ }
87138
87197
  return {
87139
87198
  runtime,
87140
87199
  presenter,
@@ -96852,6 +96911,33 @@ function emitSpaceStatusHumanOutput(input) {
96852
96911
  minContentWidth: 56
96853
96912
  });
96854
96913
  }
96914
+ function emitSpaceStatusAgentOutput(input) {
96915
+ const spaceLabel = input.status.name?.trim() || input.status.spaceId;
96916
+ input.presenter.line({
96917
+ code: "space.status",
96918
+ text: `space status: ${spaceLabel}, members=${input.status.members.totalCount}, agents=${input.status.members.agentCount}, wakeable=${input.status.members.wakeableAgentCount}, offline=${input.status.members.offlineAgentCount}`,
96919
+ data: {
96920
+ spaceId: input.status.spaceId,
96921
+ spaceName: input.status.name ?? null,
96922
+ members: {
96923
+ totalCount: input.status.members.totalCount,
96924
+ humanCount: input.status.members.humanCount,
96925
+ agentCount: input.status.members.agentCount,
96926
+ liveHumanCount: input.status.members.liveHumanCount,
96927
+ liveAgentCount: input.status.members.liveAgentCount,
96928
+ wakeableAgentCount: input.status.members.wakeableAgentCount,
96929
+ offlineAgentCount: input.status.members.offlineAgentCount
96930
+ },
96931
+ latestVisibleUpdate: input.status.latestVisibleUpdate ? {
96932
+ signalId: input.status.latestVisibleUpdate.signalId,
96933
+ signalType: input.status.latestVisibleUpdate.signalType,
96934
+ actorProfileId: input.status.latestVisibleUpdate.actorProfileId,
96935
+ actorName: input.status.latestVisibleUpdate.actorName ?? null,
96936
+ previewText: sanitizeTerminalDisplayText(input.status.latestVisibleUpdate.previewText, "single-line")
96937
+ } : null
96938
+ }
96939
+ });
96940
+ }
96855
96941
  function buildSpaceStatusOverviewRows(status) {
96856
96942
  return [
96857
96943
  {
@@ -96990,6 +97076,13 @@ async function runSpaceStatus(input) {
96990
97076
  outJsonLine(statusRead.result);
96991
97077
  return;
96992
97078
  }
97079
+ if (runtime.resolvedView === "agent") {
97080
+ emitSpaceStatusAgentOutput({
97081
+ presenter,
97082
+ status: statusRead.result
97083
+ });
97084
+ return;
97085
+ }
96993
97086
  emitSpaceStatusHumanOutput({
96994
97087
  presenter,
96995
97088
  status: statusRead.result
@@ -99445,6 +99538,7 @@ async function main() {
99445
99538
  const argv = process.argv.map((arg) => arg === "--h" ? "--help" : arg);
99446
99539
  try {
99447
99540
  await ensureSystemLayout();
99541
+ if (await handleExplicitHelpCommand(argv)) return;
99448
99542
  if (isPassiveCliQueryArgv(argv)) {
99449
99543
  await program.parseAsync(argv);
99450
99544
  return;
@@ -99465,10 +99559,9 @@ async function main() {
99465
99559
  });
99466
99560
  return;
99467
99561
  }
99468
- if (handleExplicitHelpCommand(argv)) return;
99469
99562
  const startupOutputView = await resolveEffectiveViewForOutput();
99470
99563
  const [firstCommandToken = null, secondCommandToken = null, thirdCommandToken = null] = parseLeadingCommandTokensFromArgv(argv, 3);
99471
- if (startupOutputView === "agent" && !isPassiveCliQueryArgv(argv) && !argv.includes("--raw-stream") && !argv.includes(UPGRADE_INTERNAL_ALIGN_SERVICE_FLAG)) emitStartupAgentOverviewForCommand({
99564
+ if (startupOutputView === "agent" && argv.includes("--details") && !isPassiveCliQueryArgv(argv) && !argv.includes("--raw-stream") && !argv.includes(UPGRADE_INTERNAL_ALIGN_SERVICE_FLAG)) emitStartupAgentOverviewForCommand({
99472
99565
  firstCommandToken,
99473
99566
  secondCommandToken,
99474
99567
  thirdCommandToken
@@ -99572,16 +99665,26 @@ function stripViewArgs(args) {
99572
99665
  }
99573
99666
  return out;
99574
99667
  }
99575
- function handleExplicitHelpCommand(argv) {
99668
+ async function handleExplicitHelpCommand(argv) {
99576
99669
  const args = stripViewArgs(argv.slice(2));
99577
99670
  if (args.length === 0 || args[0] !== "help") return false;
99578
99671
  const targetTokens = parseHelpTargetTokens(args.slice(1));
99672
+ const effectiveView = await resolveEffectiveViewForOutput();
99579
99673
  if (targetTokens.length === 0) {
99674
+ if (effectiveView === "agent") {
99675
+ emitTopLevelCliAgentOverview("root");
99676
+ return true;
99677
+ }
99580
99678
  program.outputHelp();
99581
99679
  return true;
99582
99680
  }
99583
99681
  const targetCommand = resolveHelpCommandTarget(program, targetTokens);
99584
99682
  if (!targetCommand) throw new Error(`unknown help target: ${targetTokens.join(" ")}`);
99683
+ if (effectiveView === "agent" && emitStartupAgentOverviewForCommand({
99684
+ firstCommandToken: targetTokens[0] ?? null,
99685
+ secondCommandToken: targetTokens[1] ?? null,
99686
+ thirdCommandToken: targetTokens[2] ?? null
99687
+ })) return true;
99585
99688
  targetCommand.outputHelp();
99586
99689
  return true;
99587
99690
  }
@@ -99739,10 +99842,14 @@ function emitStartupAgentOverviewForCommand(input) {
99739
99842
  const profileCommand = resolveProfileAgentOverviewCommandFromTokens(input);
99740
99843
  if (profileCommand) {
99741
99844
  emitProfileAgentOverview(profileCommand);
99742
- return;
99845
+ return true;
99743
99846
  }
99744
99847
  const spaceCommand = resolveSpaceAgentOverviewCommandFromTokens(input);
99745
- if (spaceCommand) emitSpaceCliAgentOverview(spaceCommand);
99848
+ if (spaceCommand) {
99849
+ emitSpaceCliAgentOverview(spaceCommand);
99850
+ return true;
99851
+ }
99852
+ return false;
99746
99853
  }
99747
99854
  function resolveProfileAgentOverviewCommandFromTokens(input) {
99748
99855
  if (input.firstCommandToken !== "profile" && input.firstCommandToken !== "profiles") return null;