agent-transport-system 0.7.8 → 0.7.9

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.8";
30
+ var version = "0.7.9";
31
31
  var package_default = {
32
32
  $schema: "https://www.schemastore.org/package.json",
33
33
  name: "agent-transport-system",
@@ -7401,7 +7401,7 @@ function createProfileMenuGuideError() {
7401
7401
  "ats profiles list | ats profiles ls",
7402
7402
  "ats profiles show <profile-id> [--profile <id>]",
7403
7403
  "ats profiles set <profile-id> [--profile <id>]",
7404
- "ats profiles update <profile-id> [--profile <id>] [--name <profileName>] [--controller-kind <builtin|custom>] [--controller-ref <id>] [--controller-enabled <true|false>] [--transport-mode <mode>] [--workspace-mode <ats-managed|custom>] [--workspace-path <path>]",
7404
+ "ats profiles update <profile-id> [--profile <id>] [--name <profileName>] [--workspace-mode <ats-managed|custom>] [--workspace-path <path>]",
7405
7405
  "ats profiles delete <profile-id> [--profile <id>] --force"
7406
7406
  ]
7407
7407
  },
@@ -24007,17 +24007,24 @@ function extractGatewayErrorDetails(raw) {
24007
24007
  return resolveGatewayErrorDetails(raw).details;
24008
24008
  }
24009
24009
  function resolveGatewayChainRepairGuidance(input) {
24010
- if (input.failureKind === "dispatch_storage_not_ready") return {
24011
- nextSteps: [
24012
- "pnpm db:migrate:dev",
24013
- "pnpm db:verify:dev",
24014
- "pnpm dev:stop",
24015
- "pnpm dev",
24016
- formatAtsCliCommand("ats service status")
24017
- ],
24018
- summary: "Run `pnpm db:migrate:dev`, then `pnpm db:verify:dev`, then restart the local ATS dev stack with `pnpm dev:stop` and `pnpm dev`, then verify with `ats service status`."
24019
- };
24020
- if ((input.lane ?? resolveAtsEnvPreset()) === "dev-local") {
24010
+ const lane = input.lane ?? resolveAtsEnvPreset();
24011
+ if (input.failureKind === "dispatch_storage_not_ready") {
24012
+ if (lane !== "dev-local") return {
24013
+ nextSteps: ["Retry the ATS command shortly.", "If this continues, contact ATS support with the latest command output."],
24014
+ summary: "ATS cloud execution storage is temporarily unavailable. Retry shortly; if it continues, contact ATS support."
24015
+ };
24016
+ return {
24017
+ nextSteps: [
24018
+ "pnpm db:migrate:dev",
24019
+ "pnpm db:verify:dev",
24020
+ "pnpm dev:stop",
24021
+ "pnpm dev",
24022
+ formatAtsCliCommand("ats service status")
24023
+ ],
24024
+ summary: "Run `pnpm db:migrate:dev`, then `pnpm db:verify:dev`, then restart the local ATS dev stack with `pnpm dev:stop` and `pnpm dev`, then verify with `ats service status`."
24025
+ };
24026
+ }
24027
+ if (lane === "dev-local") {
24021
24028
  const repairCommand = formatAtsCliCommand("ats doctor --repair");
24022
24029
  return {
24023
24030
  nextSteps: [
@@ -24047,7 +24054,7 @@ function describeGatewayChainFailure(failureKind) {
24047
24054
  switch (failureKind) {
24048
24055
  case "local_dev_session_missing": return "ATS gateway can't reach the local ATS auth worker session.";
24049
24056
  case "auth_required": return "Gateway auth chain requires sign-in for this ATS environment.";
24050
- case "dispatch_storage_not_ready": return "Core dispatch storage is unavailable for wake execution yet.";
24057
+ case "dispatch_storage_not_ready": return "ATS cloud execution storage is temporarily unavailable.";
24051
24058
  case "gateway_unreachable": return "Gateway auth chain is unavailable.";
24052
24059
  default: return "Gateway auth chain is unhealthy.";
24053
24060
  }
@@ -25341,8 +25348,8 @@ function resolveServiceReadiness(input) {
25341
25348
  nextSteps: guidance.nextSteps,
25342
25349
  reasonCodes,
25343
25350
  runtimeHeadline,
25344
- state: "local_repair_needed",
25345
- summaryText: "Needs repair"
25351
+ state: "unknown",
25352
+ summaryText: "ATS cloud temporarily unavailable"
25346
25353
  };
25347
25354
  }
25348
25355
  if (reasonCodes.some((code) => LOCAL_REPAIR_REASON_CODES.has(code))) {
@@ -59360,6 +59367,7 @@ async function runProfileCreate(input) {
59360
59367
  controllerRef: draft.setupResult.controllerRef,
59361
59368
  transportMode: draft.setupResult.transportMode
59362
59369
  });
59370
+ if (created.profileKind === "agent" && draft.localAgentSelection) await ensureAtsManagedProfileWorkspace({ atsProfileId: created.atsProfileId });
59363
59371
  await emitProfileCreateResult({
59364
59372
  runtime,
59365
59373
  presenter,
@@ -59509,7 +59517,7 @@ async function emitProfileCreateResult(input) {
59509
59517
  function emitProfileCreateAgentSetupHint(input) {
59510
59518
  if (!input.setupResult || input.setupResult.status === "configured") return;
59511
59519
  const prepareCommand = formatAtsCliCommand(`ats setup --profile ${input.profile.atsProfileId}`);
59512
- const explicitControllerCreateCommand = formatAtsCliCommand("ats profiles create \"<agent-name>\" --kind agent --controller-kind builtin --controller-ref codex --view agent");
59520
+ const explicitLocalAgentSetupCommand = formatAtsCliCommand(`ats setup --profile ${input.profile.atsProfileId} --local-agent <local-agent-id> --view agent`);
59513
59521
  const summary = input.setupResult.status === "skipped_no_enabled_controllers" ? "No enabled agent controller is available, so the profile was created without one." : "Agent controller setup was skipped, so the profile was created without one.";
59514
59522
  if (input.resolvedView === "agent") {
59515
59523
  input.presenter.line({
@@ -59519,19 +59527,15 @@ function emitProfileCreateAgentSetupHint(input) {
59519
59527
  status: input.setupResult.status,
59520
59528
  ...input.setupResult.status === "skipped_no_enabled_controllers" && input.setupResult.reason ? { reason: input.setupResult.reason } : {},
59521
59529
  profileId: input.profile.atsProfileId,
59522
- nextSteps: [
59523
- `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.`,
59524
- `Or run ${prepareCommand} in an interactive Terminal and choose the local agent there.`,
59525
- `For a new CLI-only Codex profile, run ${explicitControllerCreateCommand}.`
59526
- ],
59527
- cliOnlyCreateCommand: explicitControllerCreateCommand
59530
+ nextSteps: [`For this existing profile, run ${explicitLocalAgentSetupCommand} when you know which local agent it should use.`, `Or run ${prepareCommand} in an interactive Terminal and choose the local agent there.`],
59531
+ localAgentSetupCommand: explicitLocalAgentSetupCommand
59528
59532
  }
59529
59533
  });
59530
59534
  return;
59531
59535
  }
59532
59536
  input.presenter.line({
59533
59537
  code: "profile.create.agent_setup.skipped",
59534
- 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}\`.`)
59538
+ 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.`)
59535
59539
  });
59536
59540
  }
59537
59541
  async function runProfileSet(input) {
@@ -59670,11 +59674,6 @@ async function runProfileDelete(input) {
59670
59674
  }
59671
59675
  async function runProfileUpdate(input) {
59672
59676
  const runtime = await resolveRuntimeContext({ view: input.view });
59673
- normalizeControllerArgumentInput({
59674
- controllerKind: input.controllerKind,
59675
- controllerRef: input.controllerRef,
59676
- controllerEnabled: input.controllerEnabled
59677
- });
59678
59677
  if (!input.entryChecksHandled) {
59679
59678
  if (!await ensureProfileCommandAuthenticationOrCancel({
59680
59679
  action: "update",
@@ -59697,10 +59696,6 @@ async function runProfileUpdate(input) {
59697
59696
  visibleProfiles,
59698
59697
  currentProfileId: current,
59699
59698
  profileName: input.profileName,
59700
- controllerKind: input.controllerKind,
59701
- controllerRef: input.controllerRef,
59702
- controllerEnabled: input.controllerEnabled,
59703
- transportMode: input.transportMode,
59704
59699
  workspaceMode: input.workspaceMode,
59705
59700
  workspacePath: input.workspacePath
59706
59701
  });
@@ -59762,10 +59757,6 @@ async function resolveProfileUpdateSelection(input) {
59762
59757
  resolvedView: input.resolvedView,
59763
59758
  allowPrompt: input.allowPrompt,
59764
59759
  profileName: input.profileName,
59765
- controllerKind: input.controllerKind,
59766
- controllerRef: input.controllerRef,
59767
- controllerEnabled: input.controllerEnabled,
59768
- transportMode: input.transportMode,
59769
59760
  workspaceMode: input.workspaceMode,
59770
59761
  workspacePath: input.workspacePath
59771
59762
  });
@@ -59786,10 +59777,6 @@ async function resolveProfileUpdateSelectionForProfile(input) {
59786
59777
  allowPrompt: input.allowPrompt,
59787
59778
  resolvedView: input.resolvedView,
59788
59779
  profileName: input.profileName,
59789
- controllerKind: input.controllerKind,
59790
- controllerRef: input.controllerRef,
59791
- controllerEnabled: input.controllerEnabled,
59792
- transportMode: input.transportMode,
59793
59780
  workspaceMode: input.workspaceMode,
59794
59781
  workspacePath: input.workspacePath
59795
59782
  });
@@ -59900,11 +59887,6 @@ function emitProfileUpdateCandidatesForHuman(input) {
59900
59887
  }
59901
59888
  async function resolveProfileUpdatePayload(input) {
59902
59889
  const profileName = normalizeOptionalString$10(input.profileName);
59903
- if (normalizeControllerArgumentInput({
59904
- controllerKind: input.controllerKind,
59905
- controllerRef: input.controllerRef,
59906
- controllerEnabled: input.controllerEnabled
59907
- }).hasAnyControllerInput || normalizeOptionalString$10(input.transportMode)) throw new Error(formatInlineAtsCliCommands("Local agent connections are managed by ATS Core. Open ATS Web setup to choose or change this profile's local agent. To create a new CLI-only Codex profile, run `ats profiles create <agent-name> --kind agent --controller-kind builtin --controller-ref codex --view agent`."));
59908
59890
  const explicitWorkspace = resolveExplicitWorkspacePatchForProfile({
59909
59891
  profile: input.profile,
59910
59892
  workspaceMode: input.workspaceMode,
@@ -64242,15 +64224,6 @@ async function repairProfileReadinessState(input) {
64242
64224
  workspaceSync
64243
64225
  })) prepared = true;
64244
64226
  }
64245
- if (input.reasonCodes.includes("dispatch.storage_not_ready") || input.reasonCodes.includes("service.gateway_chain_unhealthy")) {
64246
- await runDoctor({
64247
- profile: input.profile.atsProfileId,
64248
- repair: true,
64249
- view: input.view,
64250
- agentOverviewHandled: true
64251
- });
64252
- prepared = true;
64253
- }
64254
64227
  return { prepared };
64255
64228
  }
64256
64229
  function needsControllerSetup(input) {
@@ -68609,7 +68582,8 @@ function emitSetupComplete(input) {
68609
68582
  status: report.localParticipationState === "ready" ? "available_for_wake" : "blocked_from_wake",
68610
68583
  reasonCodes: [...report.reasonCodes],
68611
68584
  runtimeId: report.runtimeReportSubmission.runtimeId
68612
- }))
68585
+ })),
68586
+ spaceSetupHint: formatSetupCompleteSpaceSetupHint(input.runtimeReports)
68613
68587
  },
68614
68588
  localComponents: input.localComponents,
68615
68589
  routeCatalogSync: input.routeCatalogSync,
@@ -68636,8 +68610,8 @@ function emitSetupComplete(input) {
68636
68610
  value: formatSetupCompleteLocalAgents(input.selectedLocalAgentIds)
68637
68611
  },
68638
68612
  {
68639
- label: "Wake",
68640
- value: formatSetupCompleteWakeAvailability(input.runtimeReports)
68613
+ label: "Space setup",
68614
+ value: formatSetupCompleteSpaceSetupHint(input.runtimeReports)
68641
68615
  },
68642
68616
  {
68643
68617
  label: "Service",
@@ -68702,15 +68676,14 @@ function emitHumanSetupCompleteAgentHandoff(input) {
68702
68676
  }
68703
68677
  function formatSetupCompleteLocalAgents(selectedLocalAgentIds) {
68704
68678
  if (selectedLocalAgentIds.length === 0) return "No local agents selected";
68705
- return `${selectedLocalAgentIds.length} connected: ${selectedLocalAgentIds.join(", ")}`;
68679
+ return `${selectedLocalAgentIds.length} detected: ${selectedLocalAgentIds.join(", ")}`;
68706
68680
  }
68707
- function formatSetupCompleteWakeAvailability(runtimeReports) {
68708
- if (runtimeReports.length === 0) return "No local agents selected";
68681
+ function formatSetupCompleteSpaceSetupHint(runtimeReports) {
68682
+ if (runtimeReports.length === 0) return "Choose a local agent when creating a Space";
68709
68683
  const availableCount = runtimeReports.filter((report) => report.localParticipationState === "ready").length;
68710
- const blockedCount = runtimeReports.length - availableCount;
68711
- if (blockedCount === 0) return `${availableCount} available for Wake`;
68712
- if (availableCount === 0) return `${blockedCount} blocked from Wake`;
68713
- return `${availableCount} available for Wake, ${blockedCount} blocked`;
68684
+ if (runtimeReports.length - availableCount === 0) return "Choose one detected agent to add to a Space";
68685
+ if (availableCount === 0) return "Resolve local-agent blockers before adding one to a Space";
68686
+ return "Choose a detected agent without blockers, or resolve blockers first";
68714
68687
  }
68715
68688
  function formatSetupCompleteService(runtimeIdentity) {
68716
68689
  if (!runtimeIdentity) return "Not connected";
@@ -84431,7 +84404,7 @@ function emitJoinCreatedProfileCard(input) {
84431
84404
  sanitize: true
84432
84405
  });
84433
84406
  if (!input.setupResult || input.setupResult.status === "configured") return;
84434
- const assignControllerCommand = `ats profile update ${input.profile.atsProfileId} --controller-kind builtin --controller-ref <agent-id> --controller-enabled true`;
84407
+ const assignControllerCommand = `ats setup --profile ${input.profile.atsProfileId} --local-agent <agent-id>`;
84435
84408
  const summary = input.setupResult.status === "skipped_no_enabled_controllers" ? "ATS created this profile without an agent because none is turned on right now." : "ATS created this profile without an agent.";
84436
84409
  input.presenter.line({
84437
84410
  code: "space.join.profile_setup.skipped",
@@ -85737,7 +85710,7 @@ function buildSpaceWebUrl(baseUrl, spaceId) {
85737
85710
  url.port = "";
85738
85711
  url.protocol = "https:";
85739
85712
  }
85740
- url.pathname = `/app/spaces/${encodeURIComponent(spaceId)}`;
85713
+ url.pathname = `/spaces/${encodeURIComponent(spaceId)}`;
85741
85714
  url.search = "";
85742
85715
  url.hash = "";
85743
85716
  return url.toString();
@@ -99523,7 +99496,7 @@ profileCmd.command("show").description("Show one ATS profile.").argument("[profi
99523
99496
  }
99524
99497
  });
99525
99498
  });
99526
- profileCmd.command("update").description("Update an ATS profile.").argument("[profile]", "ATS profile ID").option("--profile <id>", "ATS profile ID").option("--name <profileName>", "ATS profile name").option("--controller-kind <kind>", "Agent controller source for this agent profile: builtin or custom").option("--controller-ref <ref>", "Agent controller ID for this profile").option("--controller-enabled <value>", "Whether the assigned agent controller is enabled for this profile (true|false)").option("--transport-mode <mode>", "Agent controller transport mode for this profile (for example: local-cli)").option("--workspace-mode <mode>", "Workspace mode for this agent profile: ats-managed or custom").option("--workspace-path <path>", "Custom workspace folder for this agent profile").action(async (profile, opts) => {
99499
+ profileCmd.command("update").description("Update an ATS profile.").argument("[profile]", "ATS profile ID").option("--profile <id>", "ATS profile ID").option("--name <profileName>", "ATS profile name").option("--workspace-mode <mode>", "Workspace mode for this agent profile: ats-managed or custom").option("--workspace-path <path>", "Custom workspace folder for this agent profile").action(async (profile, opts) => {
99527
99500
  const outputView = await resolveEffectiveViewForOutput();
99528
99501
  const view = getGlobalViewOption();
99529
99502
  const targetProfile = (typeof profile === "string" ? profile : void 0) ?? opts.profile;
@@ -99539,10 +99512,6 @@ profileCmd.command("update").description("Update an ATS profile.").argument("[pr
99539
99512
  await runProfileUpdate({
99540
99513
  profile: targetProfile,
99541
99514
  profileName: opts.name,
99542
- controllerKind: opts.controllerKind,
99543
- controllerRef: opts.controllerRef,
99544
- controllerEnabled: typeof opts.controllerEnabled === "string" ? parseBooleanOption(opts.controllerEnabled, "--controller-enabled") : void 0,
99545
- transportMode: typeof opts.transportMode === "string" ? opts.transportMode : void 0,
99546
99515
  workspaceMode: typeof opts.workspaceMode === "string" ? opts.workspaceMode : void 0,
99547
99516
  workspacePath: typeof opts.workspacePath === "string" ? opts.workspacePath : void 0,
99548
99517
  view,
@@ -99590,7 +99559,7 @@ function parseBooleanOption(value, optionName) {
99590
99559
  throw new Error(`${optionName} must be true|false`);
99591
99560
  }
99592
99561
  function hasExplicitProfileUpdateField(input) {
99593
- return typeof input.name === "string" || typeof input.controllerKind === "string" || typeof input.controllerRef === "string" || typeof input.controllerEnabled === "string" || typeof input.transportMode === "string" || typeof input.workspaceMode === "string" || typeof input.workspacePath === "string";
99562
+ return typeof input.name === "string" || typeof input.workspaceMode === "string" || typeof input.workspacePath === "string";
99594
99563
  }
99595
99564
  async function maybeRunAgentViewRecoveryAfterSuccess(input) {
99596
99565
  if ((await resolveRuntimeContext({