@knowttl/artium-axi 0.0.4 → 0.0.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.
Files changed (3) hide show
  1. package/README.md +79 -30
  2. package/bin/artium-axi.mjs +1420 -227
  3. package/package.json +1 -1
@@ -19692,7 +19692,7 @@ var definitions = {
19692
19692
  PASSWORD_FILE_INVALID: { status: 400, message: "The password file is missing or unreadable.", next: "Supply a readable UTF-8 password file containing the exact password, without an added newline." },
19693
19693
  BOOTSTRAP_INCONSISTENT: { status: 503, message: "The store contains data without a bootstrap marker.", next: "Stop the server and restore a consistent bootstrapped store and matching master key." },
19694
19694
  RECOVERY_FAILED: { status: 500, message: "Administrator recovery did not complete.", next: "Use an existing local username in a bootstrapped store, check the matching master key and inspect local storage." },
19695
- PASSWORD_INVALID: { status: 400, message: "The password does not meet the local password rules.", next: "Use 15 to 128 Unicode code points, at most 512 UTF-8 bytes, and avoid common passwords." },
19695
+ PASSWORD_INVALID: { status: 400, message: "The password must be non-empty and at most 512 UTF-8 bytes.", next: "Enter a password of at most 512 UTF-8 bytes." },
19696
19696
  SIGN_IN_FAILED: { status: 401, message: "The username or password is incorrect.", next: "Check your username and password." },
19697
19697
  SSO_STATE_INVALID: { status: 400, message: "The SSO sign-in request expired or was already used.", next: "Start a new sign-in from this browser." },
19698
19698
  SSO_TOKEN_INVALID: { status: 401, message: "The identity provider response could not be verified.", next: "Start a new sign-in or ask an administrator to check provider settings." },
@@ -19711,7 +19711,7 @@ var definitions = {
19711
19711
  MAINTENANCE_BUSY: { status: 503, message: "The store is held by another server or maintenance process.", next: "Stop the server and wait for maintenance to finish before retrying." },
19712
19712
  MAINTENANCE_UNAVAILABLE: { status: 503, message: "The store maintenance lock is unavailable.", next: "Check data-volume capacity and permissions." },
19713
19713
  ROTATION_FAILED: { status: 500, message: "Master key rotation did not complete.", next: "Keep both keys. Inspect the durable key_rotations receipt and restart with its latest new_key_id, or the old key if no rotation committed." },
19714
- CLIENT_CONFIG_INVALID: { status: 400, message: "The CLI server configuration is invalid.", next: "Set ARTIUM_AXI_URL to an HTTPS URL; optionally set ARTIUM_AXI_CA_FILE. Windows requires APPDATA." },
19714
+ CLIENT_CONFIG_INVALID: { status: 400, message: "The CLI server configuration is invalid.", next: "Set ARTIUM_AXI_URL to an HTTPS URL; optionally set ARTIUM_AXI_CA_FILE." },
19715
19715
  SESSION_STORAGE_UNAVAILABLE: { status: 500, message: "Secure CLI session storage is unavailable.", next: "Check your configuration folder permissions and capacity, then sign in again." },
19716
19716
  SESSION_SERVER_MISMATCH: { status: 400, message: "The stored session belongs to a different server.", next: "Restore ARTIUM_AXI_URL or use artium-axi logout before signing in to the new server." },
19717
19717
  SESSION_BUSY: { status: 503, message: "Another CLI process holds the session lock.", next: "Wait for the other CLI process. If all CLI processes exited, remove the session.lock directory in your artium-axi configuration folder." },
@@ -19729,9 +19729,14 @@ var definitions = {
19729
19729
  TOOL_DISABLED: { status: 403, message: "The tool is disabled.", next: "Ask the administrator to enable the tool." },
19730
19730
  TOOL_NOT_GRANTED: { status: 403, message: "The user has no role granting this tool.", next: "Ask the administrator to assign a role granting the tool." },
19731
19731
  MASTER_KEY_INVALID: { status: 503, message: "The master key is missing or invalid.", next: "Supply a 32-byte master key file or a base64 master key." },
19732
- CREDENTIAL_INVALID: { status: 503, message: "A stored credential could not be authenticated or contains malformed JSON.", next: "Restore the matching master key and an intact credential store containing valid credential JSON." },
19732
+ CREDENTIAL_INVALID: { status: 503, message: "The stored credential is invalid.", next: "Ask an administrator to check the named field, matching master key and credential JSON, then save and test again." },
19733
19733
  FLAG_BLOCKED: { status: 400, message: "The arguments override the managed tool boundary.", next: "Remove destination, tenant, credential or local configuration overrides." },
19734
- CREDENTIAL_UNAVAILABLE: { status: 503, message: "The tool credential is unavailable.", next: "Ask the administrator to check the tool configuration and stored credentials." },
19734
+ CREDENTIAL_NOT_CONFIGURED: { status: 503, message: "No credential is configured for the tool.", next: "Ask an administrator to save a credential and run Test credential." },
19735
+ UPSTREAM_AUTH_FAILED: { status: 503, message: "The upstream service rejected the credential.", next: "Ask an administrator to check the provider code, identity, secret expiry and permissions, then test again." },
19736
+ UPSTREAM_NETWORK_FAILED: { status: 503, message: "The upstream service could not be reached.", next: "Ask an administrator to check DNS, routing, firewall rules and the diagnostic host and stage." },
19737
+ UPSTREAM_TLS_FAILED: { status: 503, message: "The upstream certificate could not be verified.", next: "Ask an administrator to check the host, certificate chain and trusted CA configuration." },
19738
+ TOOL_REJECTED_INPUT: { status: 503, message: "The tool rejected its configuration or arguments.", next: "Ask an administrator to correct the field or combination named by the tool and test again." },
19739
+ TOOL_FAILED: { status: 503, message: "The tool exited unsuccessfully.", next: "Ask an administrator to inspect the diagnostic message and hint from Test credential." },
19735
19740
  INVALID_INPUT: { status: 400, message: "The request input is invalid.", next: "Check the request fields and content type." },
19736
19741
  UNSUPPORTED_INPUT: { status: 400, message: "The input file is not a matching upload.", next: "Upload the file using a reviewed input-file flag." },
19737
19742
  SECRET_IN_OUTPUT: { status: 500, message: "A known secret was detected in tool output.", next: "Check upstream output redaction before retrying." },
@@ -19758,6 +19763,7 @@ var ArtiumError = class extends Error {
19758
19763
  }
19759
19764
  code;
19760
19765
  requestId;
19766
+ diagnostic;
19761
19767
  source;
19762
19768
  next;
19763
19769
  };
@@ -19776,10 +19782,7 @@ var inputLimits = {
19776
19782
  files: 8
19777
19783
  };
19778
19784
  var byteLength = (value) => new TextEncoder().encode(value).length;
19779
- var passwordSchema = external_exports.string().refine((value) => {
19780
- const length = [...value].length;
19781
- return length >= 15 && length <= 128 && byteLength(value) <= 512;
19782
- }, "Expected 15 to 128 Unicode code points and at most 512 UTF-8 bytes");
19785
+ var passwordSchema = external_exports.string().min(1).refine((value) => byteLength(value) <= 512, "Expected at most 512 UTF-8 bytes");
19783
19786
  var passwordChangeSchema = external_exports.strictObject({ newPassword: external_exports.string(), currentPassword: external_exports.string().optional() });
19784
19787
  var loginSchema = external_exports.strictObject({ username: external_exports.string(), password: external_exports.string() });
19785
19788
  var refreshSchema = external_exports.strictObject({ refreshToken: external_exports.string().min(1) });
@@ -19823,7 +19826,7 @@ var meResponseSchema = external_exports.strictObject({
19823
19826
  accessExpiresAt: external_exports.number().int()
19824
19827
  });
19825
19828
  var accountId = external_exports.string().min(1);
19826
- var toolSchema = external_exports.enum(["falcon-axi", "vectra-axi", "az-axi", "mg-axi", "ldap-axi"]);
19829
+ var toolSchema = external_exports.enum(["falcon-axi", "vectra-axi", "az-axi", "mg-axi", "ldap-axi", "ado-axi"]);
19827
19830
  var skillsResponseSchema = external_exports.strictObject({ skills: external_exports.array(external_exports.strictObject({
19828
19831
  name: toolSchema,
19829
19832
  content: external_exports.string().min(1)
@@ -20044,6 +20047,7 @@ var adminAuditRoute = {
20044
20047
  };
20045
20048
  var nativeSettingsSchemas = {
20046
20049
  "ldap-axi": external_exports.strictObject({}),
20050
+ "ado-axi": external_exports.strictObject({ allowWrites: external_exports.boolean().optional() }),
20047
20051
  "mg-axi": external_exports.strictObject({ preview: external_exports.boolean().optional(), writes: external_exports.strictObject({
20048
20052
  allowWrites: external_exports.boolean(),
20049
20053
  operations: external_exports.array(external_exports.string().min(1).max(256)).min(1).max(64)
@@ -20061,8 +20065,21 @@ var nativeSettingsSchemas = {
20061
20065
  allowWrites: external_exports.boolean().optional()
20062
20066
  })
20063
20067
  };
20068
+ var diagnosticSchema = external_exports.strictObject({
20069
+ stage: external_exports.enum(["configuration", "token acquisition", "DNS", "TCP", "TLS", "authentication", "tool run"]),
20070
+ message: external_exports.string().max(4096),
20071
+ toolCode: external_exports.string().max(80).optional(),
20072
+ providerCode: external_exports.string().max(80).optional(),
20073
+ hint: external_exports.string().max(4096).optional(),
20074
+ host: external_exports.string().max(4096).optional(),
20075
+ issuer: external_exports.string().max(4096).optional(),
20076
+ trust: external_exports.enum(["self-signed", "untrusted"]).optional(),
20077
+ checkedAt: external_exports.number().int().optional(),
20078
+ credentialRevision: external_exports.number().int().nullable().optional()
20079
+ });
20064
20080
  var healthSchema = external_exports.strictObject({
20065
20081
  status: external_exports.enum(["unconfigured", "unknown", "ok", "error", "disabled"]),
20082
+ diagnostic: diagnosticSchema.optional(),
20066
20083
  readOnly: external_exports.boolean().default(true),
20067
20084
  checkedAt: external_exports.number().int().nullable(),
20068
20085
  credentialRevision: external_exports.number().int().nullable(),
@@ -20085,7 +20102,9 @@ var adminCredentialSchema = external_exports.strictObject({
20085
20102
  metadata: external_exports.record(external_exports.string(), external_exports.unknown()),
20086
20103
  revision: external_exports.number().int().nonnegative(),
20087
20104
  updatedAt: external_exports.number().int().nullable(),
20088
- updatedBy: accountId.nullable()
20105
+ updatedBy: accountId.nullable(),
20106
+ // Save/replacement reports name fields and changes, never submitted values.
20107
+ normalizations: external_exports.array(external_exports.strictObject({ field: external_exports.string(), reason: external_exports.string() })).optional()
20089
20108
  });
20090
20109
  var adminToolParamsSchema = external_exports.strictObject({ tool: toolSchema });
20091
20110
  var adminToolRoutes = {
@@ -20133,11 +20152,14 @@ var adminToolRoutes = {
20133
20152
  // Certificate auth for Azure/Graph also accepts value.certificatePem containing one
20134
20153
  // certificate and matching unencrypted private key; the host derives the fingerprint.
20135
20154
  // Omitted optional non-secret fields are removed; explicit empty or null secrets are invalid.
20136
- // Changing mode, kind, auth, tenantId, clientId or origin requires new secrets.
20155
+ // Changing mode, kind, auth, tenantId, clientId, origin or org requires new secrets.
20137
20156
  // Native settings are retained; edits belong to patch above and are rejected inside value here.
20138
20157
  // Both current revisions are required (credential revision 0 before first save);
20139
20158
  // stale edits fail with REVISION_CONFLICT without mutation.
20140
20159
  // PUT remains a complete replacement of credentials and native settings.
20160
+ // Profile-backed saves and replacements normalize rejected input using schema
20161
+ // rules before validation. Already valid values remain byte for byte unchanged.
20162
+ // INVALID_INPUT names invalid fields and rules without echoing their values.
20141
20163
  save: {
20142
20164
  method: "PATCH",
20143
20165
  path: "/v1/admin/tools/:tool/credential",
@@ -20438,7 +20460,8 @@ var errorResponseSchema = external_exports.strictObject({
20438
20460
  source: external_exports.literal("artium-axi"),
20439
20461
  message: external_exports.string().min(1).refine((value) => !/[\r\n\0]/.test(value)),
20440
20462
  next: external_exports.string().min(1),
20441
- requestId: external_exports.string().min(1)
20463
+ requestId: external_exports.string().min(1),
20464
+ diagnostic: diagnosticSchema.optional()
20442
20465
  })
20443
20466
  });
20444
20467
  var runResponseSchema = external_exports.union([runSuccessSchema, errorResponseSchema]);
@@ -20452,7 +20475,7 @@ import { rootCertificates } from "node:tls";
20452
20475
  // package.json
20453
20476
  var package_default = {
20454
20477
  name: "artium-axi",
20455
- version: "0.0.4",
20478
+ version: "0.0.6",
20456
20479
  private: true,
20457
20480
  license: "MIT",
20458
20481
  type: "module",
@@ -20484,11 +20507,13 @@ var package_default = {
20484
20507
  "hygiene:check": "node scripts/hygiene-check.mjs"
20485
20508
  },
20486
20509
  devDependencies: {
20510
+ "@actions/expressions": "0.3.61",
20487
20511
  "@types/better-sqlite3": "9.6.0",
20488
20512
  "@types/node": "22.20.5",
20489
20513
  esbuild: "0.28.2",
20490
20514
  typescript: "5.9.3",
20491
- vitest: "4.1.0"
20515
+ vitest: "4.1.0",
20516
+ yaml: "2.9.1"
20492
20517
  },
20493
20518
  pnpm: {
20494
20519
  onlyBuiltDependencies: [
@@ -20525,7 +20550,7 @@ import { randomUUID } from "node:crypto";
20525
20550
  function sessionPath(platform = process.platform, environment = process.env, home = homedir()) {
20526
20551
  const paths = platform === "win32" ? win32 : { join };
20527
20552
  const base = platform === "win32" ? environment.APPDATA : environment.XDG_CONFIG_HOME || join(home, ".config");
20528
- if (!base) throw new ArtiumError("CLIENT_CONFIG_INVALID");
20553
+ if (!base) throw new ArtiumError("CLIENT_CONFIG_INVALID", void 0, "Set APPDATA to your writable roaming configuration folder, then sign in again.");
20529
20554
  return paths.join(base, "artium-axi", "session.json");
20530
20555
  }
20531
20556
  function restrictWindowsAcl(path, directory) {
@@ -20636,21 +20661,24 @@ var SessionStore = class {
20636
20661
  // src/cli/http.ts
20637
20662
  var DEFAULT_REQUEST_DEADLINE_MS = 9e4;
20638
20663
  var Client = class {
20639
- constructor(environment = process.env, managed2) {
20664
+ constructor(environment = process.env, managed2, requestDeadlineMs = DEFAULT_REQUEST_DEADLINE_MS) {
20640
20665
  this.environment = environment;
20641
20666
  this.managed = managed2;
20667
+ this.requestDeadlineMs = requestDeadlineMs;
20642
20668
  try {
20643
20669
  const url2 = new URL(environment.ARTIUM_AXI_URL);
20644
20670
  if (url2.username || url2.password || url2.href.includes("?") || url2.href.includes("#") || url2.protocol !== "https:" && !(url2.protocol === "http:" && environment.ARTIUM_AXI_TEST_HTTP === "1" && ["localhost", "127.0.0.1", "[::1]"].includes(url2.hostname))) throw new Error();
20645
20671
  this.serverUrl = url2.href.replace(/\/$/, "");
20646
20672
  if (!managed2) this.storedSessions = new SessionStore(this.serverUrl, sessionPath(process.platform, environment));
20647
- } catch {
20673
+ } catch (error62) {
20674
+ if (error62 instanceof ArtiumError) throw error62;
20648
20675
  throw new ArtiumError("CLIENT_CONFIG_INVALID");
20649
20676
  }
20650
20677
  managed2?.checkServer(this.serverUrl);
20651
20678
  }
20652
20679
  environment;
20653
20680
  managed;
20681
+ requestDeadlineMs;
20654
20682
  serverUrl;
20655
20683
  storedSessions;
20656
20684
  get sessions() {
@@ -20668,7 +20696,7 @@ var Client = class {
20668
20696
  }
20669
20697
  const body = input2 === void 0 ? void 0 : JSON.stringify(input2);
20670
20698
  const controller = new AbortController();
20671
- const deadline = setTimeout(() => controller.abort(), DEFAULT_REQUEST_DEADLINE_MS);
20699
+ const deadline = setTimeout(() => controller.abort(), this.requestDeadlineMs);
20672
20700
  const url2 = new URL(`${this.serverUrl}${path}`);
20673
20701
  const result = await new Promise((resolve3, reject) => {
20674
20702
  const request = (url2.protocol === "https:" ? httpsRequest : httpRequest)(url2, {
@@ -20821,7 +20849,8 @@ async function readPassword(stdin, environmentVariable) {
20821
20849
  }
20822
20850
 
20823
20851
  // src/cli/doctor.ts
20824
- async function doctor(createClient = () => new Client(), write = (text2) => {
20852
+ var DIAGNOSTIC_REQUEST_DEADLINE_MS = 5e3;
20853
+ async function doctor(createClient = (deadline) => new Client(process.env, void 0, deadline), write = (text2) => {
20825
20854
  process.stdout.write(text2);
20826
20855
  }) {
20827
20856
  let failure2;
@@ -20832,21 +20861,23 @@ async function doctor(createClient = () => new Client(), write = (text2) => {
20832
20861
  };
20833
20862
  let client;
20834
20863
  try {
20835
- client = createClient();
20864
+ client = createClient(DIAGNOSTIC_REQUEST_DEADLINE_MS);
20836
20865
  } catch (error62) {
20837
20866
  for (const name of ["server address", "certificate", "token", "CLI version"]) line(name, false, "CLIENT_CONFIG_INVALID");
20838
20867
  throw error62;
20839
20868
  }
20869
+ let addressOk = false;
20840
20870
  try {
20841
20871
  const live = await client.request("/health/live", "GET");
20842
- const ok = !!live && typeof live === "object" && "status" in live && live.status === "ok";
20843
- line("server address", ok);
20872
+ addressOk = !!live && typeof live === "object" && "status" in live && live.status === "ok";
20873
+ line("server address", addressOk);
20844
20874
  line("certificate", client.certificateVerified, client.certificateVerified ? void 0 : "test HTTP", new ArtiumError("CLIENT_CONFIG_INVALID"));
20845
20875
  } catch (error62) {
20846
20876
  const cause = error62 instanceof ArtiumError ? error62 : new ArtiumError("INVALID_RESPONSE");
20847
20877
  line("server address", cause.code === "CERTIFICATE_INVALID", cause.code, cause);
20848
20878
  line("certificate", client.certificateVerified, client.certificateVerified ? void 0 : cause.code, cause);
20849
20879
  }
20880
+ if (!addressOk && failure2) throw failure2;
20850
20881
  let versionOk = true;
20851
20882
  let versionError;
20852
20883
  try {
@@ -20872,7 +20903,7 @@ async function doctor(createClient = () => new Client(), write = (text2) => {
20872
20903
  tool.name,
20873
20904
  tool.status === "ok",
20874
20905
  tool.status,
20875
- new ArtiumError(tool.status === "unconfigured" || tool.status === "error" ? "CREDENTIAL_UNAVAILABLE" : tool.status === "disabled" ? "TOOL_DISABLED" : "SERVER_UNAVAILABLE")
20906
+ new ArtiumError(tool.status === "unconfigured" ? "CREDENTIAL_NOT_CONFIGURED" : tool.status === "error" ? "TOOL_FAILED" : tool.status === "disabled" ? "TOOL_DISABLED" : "SERVER_UNAVAILABLE")
20876
20907
  );
20877
20908
  } catch (error62) {
20878
20909
  const cause = error62 instanceof ArtiumError ? error62 : new ArtiumError("INVALID_RESPONSE");
@@ -22889,24 +22920,104 @@ var commands = {
22889
22920
  purpose: "Read directory data with the managed LDAP bind identity.",
22890
22921
  flags: ["Arguments after ldap-axi are forwarded upstream, including --help."],
22891
22922
  example: `artium-axi ldap-axi ${ldap_axi_default.discovery.example.join(" ")}`
22923
+ },
22924
+ "ado-axi": {
22925
+ usage: "artium-axi ado-axi [<args>]",
22926
+ purpose: "Run Azure DevOps commands with a managed PAT.",
22927
+ flags: ["Arguments after ado-axi include --help. Organization and credentials are managed by Artium; api is GET only; writes are off by default."],
22928
+ example: "artium-axi ado-axi project list --limit 1"
22929
+ },
22930
+ "az-axi": {
22931
+ usage: "artium-axi az-axi [<args>]",
22932
+ purpose: "Run Azure commands with your managed identity.",
22933
+ flags: ["Arguments after az-axi are forwarded upstream, including --help."],
22934
+ example: "artium-axi az-axi sub list"
22935
+ },
22936
+ "mg-axi": {
22937
+ usage: "artium-axi mg-axi [<args>]",
22938
+ purpose: "Run Microsoft Graph commands with your managed identity.",
22939
+ flags: ["Arguments after mg-axi are forwarded upstream, including --help."],
22940
+ example: "artium-axi mg-axi entra user list"
22941
+ },
22942
+ "managed-session": {
22943
+ usage: "artium-axi --managed-session <command> [<args>]",
22944
+ purpose: "Let a caller supply and persist sessions through private pipes.",
22945
+ flags: [],
22946
+ example: "artium-axi --managed-session whoami"
22892
22947
  }
22893
22948
  };
22894
22949
  function commandHelp(command) {
22895
22950
  const entry = commands[command];
22896
22951
  const flags = [
22897
- command === "falcon-axi" || command === "vectra-axi" || command === "ldap-axi" ? "--help before the tool name (default false)" : "--help (default false)",
22952
+ toolSchema.safeParse(command).success ? "--help before the tool name (default false)" : "--help (default false)",
22898
22953
  ...entry.flags,
22899
- "--managed-session before the command (default false; login and authenticated calls; session JSON on inherited pipe fd 3, new sessions and rotations as JSON lines on private pipe fd 4; no session file)",
22954
+ "--managed-session before the command (default false; caller-owned sessions; see artium-axi --managed-session --help)"
22955
+ ];
22956
+ const protocol = [
22957
+ "Session JSON on inherited pipe fd 3, new sessions and rotations as JSON lines on private pipe fd 4; no session file.",
22900
22958
  "Managed input: {serverUrl, accessToken, refreshToken?}; close fd 3 after JSON (64 KiB maximum). Output: {serverUrl, status, accessToken, refreshToken, accessExpiresAt, familyExpiresAt} per rotation, before retry, including on later failure.",
22901
22959
  "Managed login: fd 3 is unused; fd 4 must be a writable private pipe/socket. Local sign-in requires --username <username> --password-stdin with protected inherited stdin; password argv and ARTIUM_AXI_PASSWORD are refused. SSO uses login --sso and displays browser approval instructions immediately. New sessions use the rotation envelope; password-change-required returns {serverUrl, status, passwordChangeToken, passwordChangeExpiresAt} on fd 4 and exits 1.",
22902
22960
  "Managed exits: 0 success; 2 invalid JSON/descriptors or refused passwd/logout/setup; 1 authentication/transport failure; tool exit codes pass through. Only TOKEN_EXPIRED permits one refresh/retry; without refreshToken or on refusal, return control to the caller."
22903
22961
  ];
22904
- return `usage: ${entry.usage}
22905
- purpose: ${entry.purpose}
22906
- flags[${flags.length}]:
22962
+ const purposes = command === "home" ? `commands[${Object.keys(commands).length - 2}]{command,purpose}:
22963
+ ${Object.entries(commands).filter(([name]) => name !== "home" && name !== "managed-session").map(([name, value]) => ` ${name},${JSON.stringify(value.purpose)}`).join("\n")}
22964
+ ` : "";
22965
+ return `purpose: ${entry.purpose}
22966
+ usage: ${entry.usage}
22967
+ ${purposes}flags[${flags.length}]:
22907
22968
  ${flags.map((flag) => ` - ${JSON.stringify(flag)}`).join("\n")}
22908
22969
  example: ${entry.example}
22909
- `;
22970
+ ` + (command === "login" || command === "managed-session" ? `managedSession[${protocol.length}]:
22971
+ ${protocol.map((line) => ` - ${JSON.stringify(line)}`).join("\n")}
22972
+ ` : "");
22973
+ }
22974
+ function validateArguments(args, prefixHelp) {
22975
+ const command = args[0];
22976
+ if (command === "tools") args = [...args.filter((arg) => arg !== "--help"), ...args.filter((arg) => arg === "--help")];
22977
+ const rootFlags = "--help, --version, --managed-session (before the command)";
22978
+ const rootCommands = Object.keys(commands).filter((name) => name !== "home" && name !== "managed-session" && name !== "tools show").join(", ");
22979
+ function fail(token, level2, choices2) {
22980
+ const kind = token?.startsWith("-") ? "flag" : "argument";
22981
+ const message = token === void 0 ? `Missing argument for ${level2}.` : command === "login" || command === "passwd" ? `Unexpected argument at position ${args.indexOf(token) + 1} for ${level2}. Password arguments are refused.` : `Unknown or unexpected ${kind} ${JSON.stringify(kind === "flag" ? token.split("=")[0] : token)} for ${level2}.`;
22982
+ throw new ArtiumError("INVALID_INPUT", message, choices2);
22983
+ }
22984
+ if (!command) return;
22985
+ if (command === "--version" && args.length === 1) return;
22986
+ if (!Object.hasOwn(commands, command) || command === "home" || command === "managed-session" || command === "tools show") {
22987
+ fail(command, "artium-axi", `Valid commands: ${rootCommands}. Valid flags: ${rootFlags}.`);
22988
+ }
22989
+ if (toolSchema.safeParse(command).success) {
22990
+ if (prefixHelp && args.length > 1) fail(args[1], command, `Use artium-axi --help ${command} for local help; artium-axi ${command} --help for upstream flags.`);
22991
+ return;
22992
+ }
22993
+ let level = command;
22994
+ let start = 1;
22995
+ if (command === "tools" && args[1] === "show") {
22996
+ level = "tools show";
22997
+ start = 2;
22998
+ }
22999
+ const entry = commands[level];
23000
+ const validFlags = ["--help", ...entry.flags.map((flag) => flag.split(" ")[0])];
23001
+ const choices = `Valid flags for ${level}: ${validFlags.join(", ")}.` + (level === "tools" ? " Valid subcommands: show <tool>." : level === "tools show" ? ` Valid tools: ${toolSchema.options.join(", ")}.` : "");
23002
+ let tool = false;
23003
+ const seen = /* @__PURE__ */ new Set();
23004
+ for (let index = start; index < args.length; index++) {
23005
+ const token = args[index];
23006
+ if (level === "tools show" && !token.startsWith("-") && !tool) {
23007
+ if (!toolSchema.safeParse(token).success) fail(token, level, choices);
23008
+ tool = true;
23009
+ } else {
23010
+ if (!validFlags.includes(token) || seen.has(token)) fail(token, level, choices);
23011
+ seen.add(token);
23012
+ if (token === "--username" || token === "--host") {
23013
+ const value = args[index + 1];
23014
+ if (!value) fail(value, `${level} ${token}`, `Supply ${token} ${token === "--host" ? "<claude|codex|opencode|pi>" : "<username>"}. ${choices}`);
23015
+ if (token === "--host" && !["claude", "codex", "opencode", "pi"].includes(value)) fail(value, `${level} --host`, `Valid hosts: claude, codex, opencode, pi. Use ${entry.usage}.`);
23016
+ index++;
23017
+ }
23018
+ }
23019
+ }
23020
+ if (level === "tools show" && !tool && !seen.has("--help") && !prefixHelp) fail(void 0, level, choices);
22910
23021
  }
22911
23022
  function helpCommand(args, prefixHelp = false) {
22912
23023
  if (args[0] === "setup" && args.includes("--help")) {
@@ -22917,7 +23028,7 @@ function helpCommand(args, prefixHelp = false) {
22917
23028
  }
22918
23029
  return "setup";
22919
23030
  }
22920
- if (args[0] === "falcon-axi" || args[0] === "vectra-axi" || args[0] === "ldap-axi") return prefixHelp && args.length === 2 ? args[0] : void 0;
23031
+ if (toolSchema.safeParse(args[0]).success) return prefixHelp && args.length === 2 ? args[0] : void 0;
22921
23032
  if (args[0] === "login" || args[0] === "passwd") {
22922
23033
  if (args[0] === "login" && args.length === 3 && args.includes("--sso") && args.includes("--help")) return "login";
22923
23034
  let requested = false;
@@ -32347,189 +32458,1255 @@ var mg_axi_default = {
32347
32458
  ]
32348
32459
  };
32349
32460
 
32350
- // src/shared/tool-manifests.ts
32351
- var toolManifests = { "falcon-axi": falcon_axi_default, "vectra-axi": vectra_axi_default, "az-axi": az_axi_default, "mg-axi": mg_axi_default, "ldap-axi": ldap_axi_default };
32352
-
32353
- // node_modules/.pnpm/@toon-format+toon@2.3.1/node_modules/@toon-format/toon/dist/index.mjs
32354
- var NULL_LITERAL = "null";
32355
- var DELIMITERS = {
32356
- comma: ",",
32357
- tab: " ",
32358
- pipe: "|"
32359
- };
32360
- var DEFAULT_DELIMITER = DELIMITERS.comma;
32361
- function escapeString(value) {
32362
- return value.replace(/\\/g, `\\\\`).replace(/"/g, `\\"`).replace(/\n/g, `\\n`).replace(/\r/g, `\\r`).replace(/\t/g, `\\t`).replace(/[\u0000-\u001F]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
32363
- }
32364
- function unescapeString(value) {
32365
- let unescaped = "";
32366
- let i = 0;
32367
- while (i < value.length) {
32368
- if (value[i] === "\\") {
32369
- if (i + 1 >= value.length) throw new SyntaxError("Invalid escape sequence: backslash at end of string");
32370
- const next = value[i + 1];
32371
- if (next === "n") {
32372
- unescaped += "\n";
32373
- i += 2;
32374
- continue;
32375
- }
32376
- if (next === "t") {
32377
- unescaped += " ";
32378
- i += 2;
32379
- continue;
32380
- }
32381
- if (next === "r") {
32382
- unescaped += "\r";
32383
- i += 2;
32384
- continue;
32385
- }
32386
- if (next === "\\") {
32387
- unescaped += "\\";
32388
- i += 2;
32389
- continue;
32390
- }
32391
- if (next === '"') {
32392
- unescaped += '"';
32393
- i += 2;
32394
- continue;
32395
- }
32396
- if (next === "u") {
32397
- if (i + 6 > value.length) throw new SyntaxError(`Invalid escape sequence: truncated \\u escape at "${value.slice(i, i + 6)}"`);
32398
- const hex3 = value.slice(i + 2, i + 6);
32399
- if (!/^[0-9a-f]{4}$/i.test(hex3)) throw new SyntaxError(`Invalid escape sequence: \\u must be followed by 4 hex digits, got "${hex3}"`);
32400
- const codeUnit = Number.parseInt(hex3, 16);
32401
- if (codeUnit >= 55296 && codeUnit <= 57343) throw new SyntaxError(`Invalid escape sequence: \\u${hex3} is a lone surrogate; supplementary code points MUST appear as literal UTF-8`);
32402
- unescaped += String.fromCodePoint(codeUnit);
32403
- i += 6;
32404
- continue;
32405
- }
32406
- throw new SyntaxError(`Invalid escape sequence: \\${next}`);
32407
- }
32408
- unescaped += value[i];
32409
- i++;
32410
- }
32411
- return unescaped;
32412
- }
32413
- function findClosingQuote(content, start) {
32414
- let i = start + 1;
32415
- while (i < content.length) {
32416
- if (content[i] === "\\" && i + 1 < content.length) {
32417
- i += 2;
32418
- continue;
32419
- }
32420
- if (content[i] === '"') return i;
32421
- i++;
32422
- }
32423
- return -1;
32424
- }
32425
- function findUnquotedChar(content, char, start = 0) {
32426
- let inQuotes = false;
32427
- let i = start;
32428
- while (i < content.length) {
32429
- if (content[i] === "\\" && i + 1 < content.length && inQuotes) {
32430
- i += 2;
32431
- continue;
32432
- }
32433
- if (content[i] === '"') {
32434
- inQuotes = !inQuotes;
32435
- i++;
32436
- continue;
32437
- }
32438
- if (content[i] === char && !inQuotes) return i;
32439
- i++;
32440
- }
32441
- return -1;
32442
- }
32443
- var ToonDecodeError = class extends SyntaxError {
32444
- constructor(message, context) {
32445
- const prefix = context?.line !== void 0 ? `Line ${context.line}: ` : "";
32446
- super(prefix + message, context?.cause !== void 0 ? { cause: context.cause } : void 0);
32447
- this.name = "ToonDecodeError";
32448
- this.line = context?.line;
32449
- this.source = context?.source;
32450
- }
32451
- };
32452
- function withLine(line, fn) {
32453
- try {
32454
- return fn();
32455
- } catch (error62) {
32456
- if (error62 instanceof ToonDecodeError) throw error62;
32457
- if (error62 instanceof Error) throw new ToonDecodeError(error62.message, {
32458
- line: line.lineNumber,
32459
- source: line.raw,
32460
- cause: error62
32461
- });
32462
- throw error62;
32463
- }
32464
- }
32465
- var NUMERIC_LITERAL_PATTERN = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:e[+-]?\d+)?$/i;
32466
- function isBooleanOrNullLiteral(token) {
32467
- return token === "true" || token === "false" || token === "null";
32468
- }
32469
- function isNumericLiteral(token) {
32470
- if (!token) return false;
32471
- if (!NUMERIC_LITERAL_PATTERN.test(token)) return false;
32472
- const numericValue = Number(token);
32473
- return !Number.isNaN(numericValue) && Number.isFinite(numericValue);
32474
- }
32475
- function parseArrayHeaderLine(content, defaultDelimiter, strict = false) {
32476
- const trimmedToken = content.trimStart();
32477
- let bracketStart = -1;
32478
- if (trimmedToken.startsWith('"')) {
32479
- const closingQuoteIndex = findClosingQuote(trimmedToken, 0);
32480
- if (closingQuoteIndex === -1) return;
32481
- if (!trimmedToken.slice(closingQuoteIndex + 1).startsWith("[")) return;
32482
- const keyEndIndex = content.length - trimmedToken.length + closingQuoteIndex + 1;
32483
- bracketStart = content.indexOf("[", keyEndIndex);
32484
- } else bracketStart = findUnquotedChar(content, "[");
32485
- if (bracketStart === -1) return;
32486
- const bracketEnd = findUnquotedChar(content, "]", bracketStart);
32487
- if (bracketEnd === -1) return;
32488
- let colonIndex = bracketEnd + 1;
32489
- let braceEnd = colonIndex;
32490
- const braceStart = findUnquotedChar(content, "{", bracketEnd);
32491
- if (braceStart !== -1 && braceStart < findUnquotedChar(content, ":", bracketEnd)) {
32492
- const gapBeforeBrace = content.slice(bracketEnd + 1, braceStart);
32493
- if (gapBeforeBrace !== "") {
32494
- if (strict) {
32495
- const trimmedGap = gapBeforeBrace.trim();
32496
- throw new SyntaxError(trimmedGap === "" ? `Unexpected whitespace between bracket and fields segment` : `Unexpected content "${trimmedGap}" between bracket and fields segment`);
32497
- }
32498
- return;
32461
+ // tools/inventories/ado-axi.json
32462
+ var ado_axi_default = {
32463
+ generatedBy: "scripts/ado-inventory.mjs",
32464
+ tool: "ado-axi",
32465
+ version: "0.4.6",
32466
+ integrity: "sha512-DThi4K9uO/jz93QQMBXtpnCXeHaYsOWSt6TFdYGhnqDN8aScow3bwbhVTIg4KEMVT0KHPYPdH00V9UOPX0c2fA==",
32467
+ parserEvidence: "Reviewed published dispatch switches, aliases and command flag constants",
32468
+ sources: [
32469
+ {
32470
+ path: "dist/bin/ado-axi.js",
32471
+ sha256: "d3786fe4009b1543c1118eb94dc1c84130806cc7d5e09d674eccdad3eb2351cf"
32472
+ },
32473
+ {
32474
+ path: "dist/lib/auth.js",
32475
+ sha256: "287d52a41b3412a8c716fa39bbf1c2a1fa0f5dd18728e23bbedc9cc1fd20e947"
32476
+ },
32477
+ {
32478
+ path: "dist/lib/client.js",
32479
+ sha256: "de6ffea225b2ffc3ff31de67431dfd20625f1d42e9575ffa05d79bcdeb534feb"
32480
+ },
32481
+ {
32482
+ path: "dist/lib/args.js",
32483
+ sha256: "f61e2fd78a259f8bcf1e1a3d89933e1c123778bcc63f3c667efba11a2915c758"
32484
+ },
32485
+ {
32486
+ path: "dist/lib/argv.js",
32487
+ sha256: "3c5015cd2ecde9249714f97c59bb365e1f8242573c643ca608bf3863126bcc81"
32488
+ },
32489
+ {
32490
+ path: "dist/lib/config.js",
32491
+ sha256: "32afbb32fa0f06056436e0d856d0f251c407f31850ff7d9a89dc57ff2c43ce8d"
32492
+ },
32493
+ {
32494
+ path: "dist/lib/adoUrl.js",
32495
+ sha256: "d75adff40b6c501e3f3c8bef747a53d128b597ec24da692e7ddec00f4658c4cc"
32496
+ },
32497
+ {
32498
+ path: "dist/lib/stdin.js",
32499
+ sha256: "5cd2b7c7aedf02df9778f6566a19bc837cfba367a7e25c4fe626f8ec0077d959"
32500
+ },
32501
+ {
32502
+ path: "dist/lib/context.js",
32503
+ sha256: "0ddc87da536069a2399545bd0f98860e3fad64d32fd78242ca7fcb500a301276"
32504
+ },
32505
+ {
32506
+ path: "dist/commands/api.js",
32507
+ sha256: "538d9d4139d88f52eb07a7bb753695a0e81013b7834fd948a1c84b2e9f9914ff"
32508
+ },
32509
+ {
32510
+ path: "dist/commands/config.js",
32511
+ sha256: "653a3fec29463b38c59039bf29d3d08f02cb9018e2f2eaf6ad147888eab6d665"
32512
+ },
32513
+ {
32514
+ path: "dist/commands/doctor.js",
32515
+ sha256: "106f5e1d7f29735f0905096add34939826a831e93719fedeee5e8b535fd98731"
32516
+ },
32517
+ {
32518
+ path: "dist/commands/home.js",
32519
+ sha256: "b5913e4c692e2ec6b63e004e457a97381c445c91185a400db13649df1e6d50a7"
32520
+ },
32521
+ {
32522
+ path: "dist/commands/pipeline.js",
32523
+ sha256: "152885bd4f9dc67855b64fbbca8e5b9e0d46d07ec6b5abc3a393ed29b620bc3b"
32524
+ },
32525
+ {
32526
+ path: "dist/commands/pr.js",
32527
+ sha256: "7b4f81ce93f18c1079294e71237be8e85a4c71313ae0bceac50b0245324d8772"
32528
+ },
32529
+ {
32530
+ path: "dist/commands/ref.js",
32531
+ sha256: "b87a5c738721b8d6f453044258a6e95eaea067e4c2dd5321f605c79aa6411d09"
32532
+ },
32533
+ {
32534
+ path: "dist/commands/repo.js",
32535
+ sha256: "8d446c3bc69a6a5bf36dca02a5e05748098a78269d9078f90da9169b15a5049d"
32536
+ },
32537
+ {
32538
+ path: "dist/commands/test.js",
32539
+ sha256: "b151392b7a6ae7b9cba8031da66b86dfc3811b01413ee25b4a4f0ef7cd5fa384"
32540
+ },
32541
+ {
32542
+ path: "dist/commands/workItem.js",
32543
+ sha256: "38adf6d7b86ff4809cd3a8402ad894286f6f23e750fdbf303d4a4abb31215058"
32544
+ },
32545
+ {
32546
+ path: "axi-sdk-js/dist/cli.js",
32547
+ sha256: "7bda640cc33a6f5226e60b7df2ef7ea8c765431c0e89a267273993370bdd8121"
32499
32548
  }
32500
- const foundBraceEnd = findUnquotedChar(content, "}", braceStart);
32501
- if (foundBraceEnd !== -1) braceEnd = foundBraceEnd + 1;
32502
- }
32503
- colonIndex = findUnquotedChar(content, ":", Math.max(bracketEnd, braceEnd));
32504
- if (colonIndex === -1) return;
32505
- const gapStart = Math.max(bracketEnd + 1, braceEnd);
32506
- const gapBeforeColon = content.slice(gapStart, colonIndex);
32507
- if (gapBeforeColon !== "") {
32508
- if (strict) {
32509
- const trimmedGap = gapBeforeColon.trim();
32510
- throw new SyntaxError(trimmedGap === "" ? `Unexpected whitespace between bracket segment and colon` : `Unexpected content "${trimmedGap}" between bracket segment and colon`);
32549
+ ],
32550
+ adapterBoundary: {
32551
+ unsafeOverrides: [
32552
+ "org",
32553
+ "profile",
32554
+ "config"
32555
+ ],
32556
+ blockedCommands: [
32557
+ "config",
32558
+ "update"
32559
+ ],
32560
+ nativeWrites: "host-classified",
32561
+ inputs: {
32562
+ stdin: "unsupported",
32563
+ files: "unsupported"
32511
32564
  }
32512
- return;
32513
- }
32514
- let key;
32515
- if (bracketStart > 0) {
32516
- const rawKey = content.slice(0, bracketStart).trim();
32517
- key = rawKey.startsWith('"') ? parseStringLiteral(rawKey) : rawKey;
32518
- }
32519
- const afterColon = content.slice(colonIndex + 1).trim();
32520
- const bracketContent = content.slice(bracketStart + 1, bracketEnd);
32521
- let parsedBracket;
32522
- try {
32523
- parsedBracket = parseBracketSegment(bracketContent, defaultDelimiter);
32524
- } catch (error62) {
32525
- if (strict) throw error62;
32526
- return;
32527
- }
32528
- const { length, delimiter } = parsedBracket;
32529
- let fields;
32530
- if (braceStart !== -1 && braceStart < colonIndex) {
32531
- const foundBraceEnd = findUnquotedChar(content, "}", braceStart);
32532
- if (foundBraceEnd !== -1 && foundBraceEnd < colonIndex) {
32565
+ },
32566
+ aliases: {
32567
+ wi: "work-item",
32568
+ workitem: "work-item",
32569
+ "work-items": "work-item",
32570
+ prs: "pr",
32571
+ pipelines: "pipeline",
32572
+ tests: "test",
32573
+ repos: "repo",
32574
+ refs: "ref",
32575
+ projects: "project"
32576
+ },
32577
+ discovery: {
32578
+ commands: [
32579
+ "work-item",
32580
+ "pr",
32581
+ "pipeline",
32582
+ "test",
32583
+ "repo",
32584
+ "ref",
32585
+ "project",
32586
+ "api",
32587
+ "doctor"
32588
+ ],
32589
+ example: [
32590
+ "project",
32591
+ "list",
32592
+ "--limit",
32593
+ "1"
32594
+ ],
32595
+ help: "ado-axi project list [--name <filter>] [--limit <n>] [--fields <fields>]\napi accepts relative paths and GET only. Writes are off by default; administrators control allowWrites. No stdin or files. For pipeline watch use --timeout 50 or less.\n"
32596
+ },
32597
+ suggestionFields: [
32598
+ "help"
32599
+ ],
32600
+ format: "TOON",
32601
+ commands: [
32602
+ {
32603
+ command: "home",
32604
+ effect: "read",
32605
+ flags: {
32606
+ profile: "value",
32607
+ org: "value",
32608
+ project: "value",
32609
+ config: "value",
32610
+ help: "boolean",
32611
+ full: "boolean",
32612
+ fields: "value"
32613
+ },
32614
+ positionals: 0,
32615
+ aliases: []
32616
+ },
32617
+ {
32618
+ command: "doctor",
32619
+ effect: "read",
32620
+ flags: {
32621
+ profile: "value",
32622
+ org: "value",
32623
+ project: "value",
32624
+ config: "value",
32625
+ help: "boolean",
32626
+ full: "boolean",
32627
+ fields: "value"
32628
+ },
32629
+ positionals: 0,
32630
+ aliases: []
32631
+ },
32632
+ {
32633
+ command: "work-item list",
32634
+ effect: "read",
32635
+ flags: {
32636
+ profile: "value",
32637
+ org: "value",
32638
+ project: "value",
32639
+ config: "value",
32640
+ help: "boolean",
32641
+ full: "boolean",
32642
+ fields: "value",
32643
+ state: "value",
32644
+ type: "value",
32645
+ "assigned-to": "value",
32646
+ iteration: "value",
32647
+ area: "value",
32648
+ tag: "value",
32649
+ search: "value",
32650
+ query: "value",
32651
+ limit: "value"
32652
+ },
32653
+ positionals: 0,
32654
+ aliases: []
32655
+ },
32656
+ {
32657
+ command: "work-item get",
32658
+ effect: "read",
32659
+ flags: {
32660
+ profile: "value",
32661
+ org: "value",
32662
+ project: "value",
32663
+ config: "value",
32664
+ help: "boolean",
32665
+ full: "boolean",
32666
+ fields: "value",
32667
+ comments: "boolean",
32668
+ relations: "boolean"
32669
+ },
32670
+ positionals: 1,
32671
+ aliases: [
32672
+ "work-item view"
32673
+ ]
32674
+ },
32675
+ {
32676
+ command: "work-item create",
32677
+ effect: "write",
32678
+ flags: {
32679
+ profile: "value",
32680
+ org: "value",
32681
+ project: "value",
32682
+ config: "value",
32683
+ help: "boolean",
32684
+ full: "boolean",
32685
+ fields: "value",
32686
+ type: "value",
32687
+ title: "value",
32688
+ description: "value",
32689
+ "description-format": "value",
32690
+ "assigned-to": "value",
32691
+ area: "value",
32692
+ iteration: "value",
32693
+ parent: "value",
32694
+ tags: "value",
32695
+ set: "value"
32696
+ },
32697
+ positionals: 0,
32698
+ aliases: []
32699
+ },
32700
+ {
32701
+ command: "work-item update",
32702
+ effect: "write",
32703
+ flags: {
32704
+ profile: "value",
32705
+ org: "value",
32706
+ project: "value",
32707
+ config: "value",
32708
+ help: "boolean",
32709
+ full: "boolean",
32710
+ fields: "value",
32711
+ title: "value",
32712
+ state: "value",
32713
+ "assigned-to": "value",
32714
+ area: "value",
32715
+ iteration: "value",
32716
+ description: "value",
32717
+ "description-format": "value",
32718
+ tags: "value",
32719
+ "add-tags": "value",
32720
+ "remove-tags": "value",
32721
+ set: "value",
32722
+ reason: "value",
32723
+ "if-rev": "value"
32724
+ },
32725
+ positionals: 1,
32726
+ aliases: []
32727
+ },
32728
+ {
32729
+ command: "work-item comment",
32730
+ effect: "write",
32731
+ flags: {
32732
+ profile: "value",
32733
+ org: "value",
32734
+ project: "value",
32735
+ config: "value",
32736
+ help: "boolean",
32737
+ full: "boolean",
32738
+ fields: "value",
32739
+ body: "value",
32740
+ format: "value"
32741
+ },
32742
+ positionals: 2,
32743
+ aliases: []
32744
+ },
32745
+ {
32746
+ command: "work-item link list",
32747
+ effect: "read",
32748
+ flags: {
32749
+ profile: "value",
32750
+ org: "value",
32751
+ project: "value",
32752
+ config: "value",
32753
+ help: "boolean",
32754
+ full: "boolean",
32755
+ fields: "value",
32756
+ limit: "value"
32757
+ },
32758
+ positionals: 1,
32759
+ aliases: [
32760
+ "work-item links list"
32761
+ ]
32762
+ },
32763
+ {
32764
+ command: "work-item link add",
32765
+ effect: "write",
32766
+ flags: {
32767
+ profile: "value",
32768
+ org: "value",
32769
+ project: "value",
32770
+ config: "value",
32771
+ help: "boolean",
32772
+ full: "boolean",
32773
+ fields: "value",
32774
+ parent: "value",
32775
+ child: "value",
32776
+ related: "value",
32777
+ pr: "value",
32778
+ commit: "value",
32779
+ branch: "value",
32780
+ repo: "value",
32781
+ comment: "value",
32782
+ "if-rev": "value"
32783
+ },
32784
+ positionals: 1,
32785
+ aliases: [
32786
+ "work-item links add"
32787
+ ]
32788
+ },
32789
+ {
32790
+ command: "pr list",
32791
+ effect: "read",
32792
+ flags: {
32793
+ profile: "value",
32794
+ org: "value",
32795
+ project: "value",
32796
+ config: "value",
32797
+ help: "boolean",
32798
+ full: "boolean",
32799
+ fields: "value",
32800
+ repo: "value",
32801
+ status: "value",
32802
+ creator: "value",
32803
+ reviewer: "value",
32804
+ target: "value",
32805
+ source: "value",
32806
+ limit: "value"
32807
+ },
32808
+ positionals: 0,
32809
+ aliases: []
32810
+ },
32811
+ {
32812
+ command: "pr get",
32813
+ effect: "read",
32814
+ flags: {
32815
+ profile: "value",
32816
+ org: "value",
32817
+ project: "value",
32818
+ config: "value",
32819
+ help: "boolean",
32820
+ full: "boolean",
32821
+ fields: "value",
32822
+ repo: "value",
32823
+ id: "value",
32824
+ threads: "boolean",
32825
+ commits: "boolean"
32826
+ },
32827
+ positionals: 1,
32828
+ aliases: [
32829
+ "pr view",
32830
+ "pr comments",
32831
+ "pr threads"
32832
+ ]
32833
+ },
32834
+ {
32835
+ command: "pr create",
32836
+ effect: "write",
32837
+ flags: {
32838
+ profile: "value",
32839
+ org: "value",
32840
+ project: "value",
32841
+ config: "value",
32842
+ help: "boolean",
32843
+ full: "boolean",
32844
+ fields: "value",
32845
+ repo: "value",
32846
+ source: "value",
32847
+ target: "value",
32848
+ title: "value",
32849
+ description: "value",
32850
+ reviewers: "value",
32851
+ "work-items": "value",
32852
+ draft: "boolean",
32853
+ "auto-complete": "boolean"
32854
+ },
32855
+ positionals: 0,
32856
+ aliases: []
32857
+ },
32858
+ {
32859
+ command: "pr update",
32860
+ effect: "write",
32861
+ flags: {
32862
+ profile: "value",
32863
+ org: "value",
32864
+ project: "value",
32865
+ config: "value",
32866
+ help: "boolean",
32867
+ full: "boolean",
32868
+ fields: "value",
32869
+ repo: "value",
32870
+ title: "value",
32871
+ description: "value",
32872
+ draft: "boolean",
32873
+ "auto-complete": "boolean"
32874
+ },
32875
+ positionals: 1,
32876
+ aliases: []
32877
+ },
32878
+ {
32879
+ command: "pr complete",
32880
+ effect: "write",
32881
+ flags: {
32882
+ profile: "value",
32883
+ org: "value",
32884
+ project: "value",
32885
+ config: "value",
32886
+ help: "boolean",
32887
+ full: "boolean",
32888
+ fields: "value",
32889
+ repo: "value",
32890
+ squash: "boolean",
32891
+ "delete-source-branch": "boolean"
32892
+ },
32893
+ positionals: 1,
32894
+ aliases: []
32895
+ },
32896
+ {
32897
+ command: "pr abandon",
32898
+ effect: "write",
32899
+ flags: {
32900
+ profile: "value",
32901
+ org: "value",
32902
+ project: "value",
32903
+ config: "value",
32904
+ help: "boolean",
32905
+ full: "boolean",
32906
+ fields: "value",
32907
+ repo: "value"
32908
+ },
32909
+ positionals: 1,
32910
+ aliases: []
32911
+ },
32912
+ {
32913
+ command: "pr checks",
32914
+ effect: "read",
32915
+ flags: {
32916
+ profile: "value",
32917
+ org: "value",
32918
+ project: "value",
32919
+ config: "value",
32920
+ help: "boolean",
32921
+ full: "boolean",
32922
+ fields: "value",
32923
+ repo: "value",
32924
+ limit: "value"
32925
+ },
32926
+ positionals: 1,
32927
+ aliases: []
32928
+ },
32929
+ {
32930
+ command: "pr diff",
32931
+ effect: "read",
32932
+ flags: {
32933
+ profile: "value",
32934
+ org: "value",
32935
+ project: "value",
32936
+ config: "value",
32937
+ help: "boolean",
32938
+ full: "boolean",
32939
+ fields: "value",
32940
+ repo: "value",
32941
+ limit: "value"
32942
+ },
32943
+ positionals: 1,
32944
+ aliases: [
32945
+ "pr changes"
32946
+ ]
32947
+ },
32948
+ {
32949
+ command: "pr reviewers",
32950
+ effect: "read",
32951
+ flags: {
32952
+ profile: "value",
32953
+ org: "value",
32954
+ project: "value",
32955
+ config: "value",
32956
+ help: "boolean",
32957
+ full: "boolean",
32958
+ fields: "value",
32959
+ repo: "value",
32960
+ reviewer: "value",
32961
+ required: "boolean"
32962
+ },
32963
+ positionals: 1,
32964
+ aliases: []
32965
+ },
32966
+ {
32967
+ command: "pr reviewer list",
32968
+ effect: "read",
32969
+ flags: {
32970
+ profile: "value",
32971
+ org: "value",
32972
+ project: "value",
32973
+ config: "value",
32974
+ help: "boolean",
32975
+ full: "boolean",
32976
+ fields: "value",
32977
+ repo: "value",
32978
+ reviewer: "value",
32979
+ required: "boolean"
32980
+ },
32981
+ positionals: 1,
32982
+ aliases: []
32983
+ },
32984
+ {
32985
+ command: "pr reviewer add",
32986
+ effect: "write",
32987
+ flags: {
32988
+ profile: "value",
32989
+ org: "value",
32990
+ project: "value",
32991
+ config: "value",
32992
+ help: "boolean",
32993
+ full: "boolean",
32994
+ fields: "value",
32995
+ repo: "value",
32996
+ reviewer: "value",
32997
+ required: "boolean"
32998
+ },
32999
+ positionals: 1,
33000
+ aliases: []
33001
+ },
33002
+ {
33003
+ command: "pr reviewer remove",
33004
+ effect: "write",
33005
+ flags: {
33006
+ profile: "value",
33007
+ org: "value",
33008
+ project: "value",
33009
+ config: "value",
33010
+ help: "boolean",
33011
+ full: "boolean",
33012
+ fields: "value",
33013
+ repo: "value",
33014
+ reviewer: "value",
33015
+ required: "boolean"
33016
+ },
33017
+ positionals: 1,
33018
+ aliases: []
33019
+ },
33020
+ {
33021
+ command: "pr approve",
33022
+ effect: "write",
33023
+ flags: {
33024
+ profile: "value",
33025
+ org: "value",
33026
+ project: "value",
33027
+ config: "value",
33028
+ help: "boolean",
33029
+ full: "boolean",
33030
+ fields: "value",
33031
+ repo: "value",
33032
+ vote: "value"
33033
+ },
33034
+ positionals: 1,
33035
+ aliases: [
33036
+ "pr vote"
33037
+ ]
33038
+ },
33039
+ {
33040
+ command: "pr comment",
33041
+ effect: "write",
33042
+ flags: {
33043
+ profile: "value",
33044
+ org: "value",
33045
+ project: "value",
33046
+ config: "value",
33047
+ help: "boolean",
33048
+ full: "boolean",
33049
+ fields: "value",
33050
+ repo: "value",
33051
+ body: "value",
33052
+ thread: "value",
33053
+ file: "value",
33054
+ line: "value"
33055
+ },
33056
+ positionals: 2,
33057
+ aliases: []
33058
+ },
33059
+ {
33060
+ command: "pr thread list",
33061
+ effect: "read",
33062
+ flags: {
33063
+ profile: "value",
33064
+ org: "value",
33065
+ project: "value",
33066
+ config: "value",
33067
+ help: "boolean",
33068
+ full: "boolean",
33069
+ fields: "value",
33070
+ repo: "value",
33071
+ limit: "value",
33072
+ id: "value"
33073
+ },
33074
+ positionals: 1,
33075
+ aliases: []
33076
+ },
33077
+ {
33078
+ command: "pr thread resolve",
33079
+ effect: "write",
33080
+ flags: {
33081
+ profile: "value",
33082
+ org: "value",
33083
+ project: "value",
33084
+ config: "value",
33085
+ help: "boolean",
33086
+ full: "boolean",
33087
+ fields: "value",
33088
+ repo: "value",
33089
+ thread: "value",
33090
+ status: "value",
33091
+ id: "value"
33092
+ },
33093
+ positionals: 2,
33094
+ aliases: []
33095
+ },
33096
+ {
33097
+ command: "pr thread reopen",
33098
+ effect: "write",
33099
+ flags: {
33100
+ profile: "value",
33101
+ org: "value",
33102
+ project: "value",
33103
+ config: "value",
33104
+ help: "boolean",
33105
+ full: "boolean",
33106
+ fields: "value",
33107
+ repo: "value",
33108
+ thread: "value",
33109
+ status: "value",
33110
+ id: "value"
33111
+ },
33112
+ positionals: 2,
33113
+ aliases: []
33114
+ },
33115
+ {
33116
+ command: "pr thread reply",
33117
+ effect: "write",
33118
+ flags: {
33119
+ profile: "value",
33120
+ org: "value",
33121
+ project: "value",
33122
+ config: "value",
33123
+ help: "boolean",
33124
+ full: "boolean",
33125
+ fields: "value",
33126
+ repo: "value",
33127
+ thread: "value",
33128
+ body: "value",
33129
+ status: "value",
33130
+ id: "value",
33131
+ resolve: "boolean"
33132
+ },
33133
+ positionals: 3,
33134
+ aliases: []
33135
+ },
33136
+ {
33137
+ command: "pipeline list",
33138
+ effect: "read",
33139
+ flags: {
33140
+ profile: "value",
33141
+ org: "value",
33142
+ project: "value",
33143
+ config: "value",
33144
+ help: "boolean",
33145
+ full: "boolean",
33146
+ fields: "value",
33147
+ limit: "value",
33148
+ name: "value"
33149
+ },
33150
+ positionals: 0,
33151
+ aliases: []
33152
+ },
33153
+ {
33154
+ command: "pipeline runs",
33155
+ effect: "read",
33156
+ flags: {
33157
+ profile: "value",
33158
+ org: "value",
33159
+ project: "value",
33160
+ config: "value",
33161
+ help: "boolean",
33162
+ full: "boolean",
33163
+ fields: "value",
33164
+ pipeline: "value",
33165
+ branch: "value",
33166
+ status: "value",
33167
+ result: "value",
33168
+ "requested-for": "value",
33169
+ limit: "value"
33170
+ },
33171
+ positionals: 0,
33172
+ aliases: []
33173
+ },
33174
+ {
33175
+ command: "pipeline run",
33176
+ effect: "write",
33177
+ flags: {
33178
+ profile: "value",
33179
+ org: "value",
33180
+ project: "value",
33181
+ config: "value",
33182
+ help: "boolean",
33183
+ full: "boolean",
33184
+ fields: "value",
33185
+ pipeline: "value",
33186
+ branch: "value",
33187
+ variables: "value",
33188
+ parameters: "value"
33189
+ },
33190
+ positionals: 1,
33191
+ aliases: []
33192
+ },
33193
+ {
33194
+ command: "pipeline logs",
33195
+ effect: "read",
33196
+ flags: {
33197
+ profile: "value",
33198
+ org: "value",
33199
+ project: "value",
33200
+ config: "value",
33201
+ help: "boolean",
33202
+ full: "boolean",
33203
+ fields: "value",
33204
+ log: "value",
33205
+ tail: "value",
33206
+ "failed-only": "boolean"
33207
+ },
33208
+ positionals: 1,
33209
+ aliases: []
33210
+ },
33211
+ {
33212
+ command: "pipeline timeline",
33213
+ effect: "read",
33214
+ flags: {
33215
+ profile: "value",
33216
+ org: "value",
33217
+ project: "value",
33218
+ config: "value",
33219
+ help: "boolean",
33220
+ full: "boolean",
33221
+ fields: "value",
33222
+ limit: "value"
33223
+ },
33224
+ positionals: 1,
33225
+ aliases: [
33226
+ "pipeline steps"
33227
+ ]
33228
+ },
33229
+ {
33230
+ command: "pipeline watch",
33231
+ effect: "read",
33232
+ flags: {
33233
+ profile: "value",
33234
+ org: "value",
33235
+ project: "value",
33236
+ config: "value",
33237
+ help: "boolean",
33238
+ full: "boolean",
33239
+ fields: "value",
33240
+ interval: "value",
33241
+ timeout: "value"
33242
+ },
33243
+ positionals: 1,
33244
+ aliases: []
33245
+ },
33246
+ {
33247
+ command: "test results",
33248
+ effect: "read",
33249
+ flags: {
33250
+ profile: "value",
33251
+ org: "value",
33252
+ project: "value",
33253
+ config: "value",
33254
+ help: "boolean",
33255
+ full: "boolean",
33256
+ fields: "value",
33257
+ run: "value",
33258
+ outcome: "value",
33259
+ limit: "value"
33260
+ },
33261
+ positionals: 1,
33262
+ aliases: [
33263
+ "test failures"
33264
+ ]
33265
+ },
33266
+ {
33267
+ command: "repo list",
33268
+ effect: "read",
33269
+ flags: {
33270
+ profile: "value",
33271
+ org: "value",
33272
+ project: "value",
33273
+ config: "value",
33274
+ help: "boolean",
33275
+ full: "boolean",
33276
+ fields: "value",
33277
+ name: "value",
33278
+ limit: "value"
33279
+ },
33280
+ positionals: 0,
33281
+ aliases: []
33282
+ },
33283
+ {
33284
+ command: "repo branches",
33285
+ effect: "read",
33286
+ flags: {
33287
+ profile: "value",
33288
+ org: "value",
33289
+ project: "value",
33290
+ config: "value",
33291
+ help: "boolean",
33292
+ full: "boolean",
33293
+ fields: "value",
33294
+ repo: "value",
33295
+ limit: "value",
33296
+ name: "value"
33297
+ },
33298
+ positionals: 1,
33299
+ aliases: []
33300
+ },
33301
+ {
33302
+ command: "repo file",
33303
+ effect: "read",
33304
+ flags: {
33305
+ profile: "value",
33306
+ org: "value",
33307
+ project: "value",
33308
+ config: "value",
33309
+ help: "boolean",
33310
+ full: "boolean",
33311
+ fields: "value",
33312
+ repo: "value",
33313
+ path: "value",
33314
+ ref: "value",
33315
+ commit: "value",
33316
+ limit: "value"
33317
+ },
33318
+ positionals: 2,
33319
+ aliases: [
33320
+ "repo cat"
33321
+ ]
33322
+ },
33323
+ {
33324
+ command: "ref list",
33325
+ effect: "read",
33326
+ flags: {
33327
+ profile: "value",
33328
+ org: "value",
33329
+ project: "value",
33330
+ config: "value",
33331
+ help: "boolean",
33332
+ full: "boolean",
33333
+ fields: "value",
33334
+ repo: "value",
33335
+ name: "value",
33336
+ limit: "value"
33337
+ },
33338
+ positionals: 0,
33339
+ aliases: []
33340
+ },
33341
+ {
33342
+ command: "ref create",
33343
+ effect: "write",
33344
+ flags: {
33345
+ profile: "value",
33346
+ org: "value",
33347
+ project: "value",
33348
+ config: "value",
33349
+ help: "boolean",
33350
+ full: "boolean",
33351
+ fields: "value",
33352
+ repo: "value",
33353
+ name: "value",
33354
+ source: "value",
33355
+ "source-object-id": "value"
33356
+ },
33357
+ positionals: 0,
33358
+ aliases: []
33359
+ },
33360
+ {
33361
+ command: "ref delete",
33362
+ effect: "write",
33363
+ flags: {
33364
+ profile: "value",
33365
+ org: "value",
33366
+ project: "value",
33367
+ config: "value",
33368
+ help: "boolean",
33369
+ full: "boolean",
33370
+ fields: "value",
33371
+ repo: "value",
33372
+ name: "value",
33373
+ "old-object-id": "value"
33374
+ },
33375
+ positionals: 0,
33376
+ aliases: []
33377
+ },
33378
+ {
33379
+ command: "project list",
33380
+ effect: "read",
33381
+ flags: {
33382
+ profile: "value",
33383
+ org: "value",
33384
+ project: "value",
33385
+ config: "value",
33386
+ help: "boolean",
33387
+ full: "boolean",
33388
+ fields: "value",
33389
+ limit: "value",
33390
+ name: "value"
33391
+ },
33392
+ positionals: 0,
33393
+ aliases: []
33394
+ },
33395
+ {
33396
+ command: "api",
33397
+ effect: "read",
33398
+ flags: {
33399
+ profile: "value",
33400
+ org: "value",
33401
+ project: "value",
33402
+ config: "value",
33403
+ help: "boolean",
33404
+ full: "boolean",
33405
+ fields: "value",
33406
+ method: "value",
33407
+ body: "value",
33408
+ query: "value",
33409
+ "api-version": "value",
33410
+ host: "value",
33411
+ limit: "value",
33412
+ "content-type": "value",
33413
+ "no-project": "boolean",
33414
+ raw: "boolean"
33415
+ },
33416
+ positionals: 2,
33417
+ aliases: []
33418
+ },
33419
+ {
33420
+ command: "config",
33421
+ effect: "blocked",
33422
+ flags: {
33423
+ profile: "value",
33424
+ org: "value",
33425
+ project: "value",
33426
+ config: "value",
33427
+ help: "boolean",
33428
+ full: "boolean",
33429
+ fields: "value"
33430
+ },
33431
+ positionals: 0,
33432
+ aliases: []
33433
+ },
33434
+ {
33435
+ command: "config list",
33436
+ effect: "blocked",
33437
+ flags: {
33438
+ profile: "value",
33439
+ org: "value",
33440
+ project: "value",
33441
+ config: "value",
33442
+ help: "boolean",
33443
+ full: "boolean",
33444
+ fields: "value"
33445
+ },
33446
+ positionals: 0,
33447
+ aliases: []
33448
+ },
33449
+ {
33450
+ command: "config show",
33451
+ effect: "blocked",
33452
+ flags: {
33453
+ profile: "value",
33454
+ org: "value",
33455
+ project: "value",
33456
+ config: "value",
33457
+ help: "boolean",
33458
+ full: "boolean",
33459
+ fields: "value"
33460
+ },
33461
+ positionals: 0,
33462
+ aliases: []
33463
+ },
33464
+ {
33465
+ command: "config path",
33466
+ effect: "blocked",
33467
+ flags: {
33468
+ profile: "value",
33469
+ org: "value",
33470
+ project: "value",
33471
+ config: "value",
33472
+ help: "boolean",
33473
+ full: "boolean",
33474
+ fields: "value"
33475
+ },
33476
+ positionals: 0,
33477
+ aliases: []
33478
+ },
33479
+ {
33480
+ command: "config init",
33481
+ effect: "blocked",
33482
+ flags: {
33483
+ profile: "value",
33484
+ org: "value",
33485
+ project: "value",
33486
+ config: "value",
33487
+ help: "boolean",
33488
+ full: "boolean",
33489
+ fields: "value"
33490
+ },
33491
+ positionals: 0,
33492
+ aliases: []
33493
+ },
33494
+ {
33495
+ command: "config add",
33496
+ effect: "blocked",
33497
+ flags: {
33498
+ profile: "value",
33499
+ org: "value",
33500
+ project: "value",
33501
+ config: "value",
33502
+ help: "boolean",
33503
+ full: "boolean",
33504
+ fields: "value"
33505
+ },
33506
+ positionals: 0,
33507
+ aliases: []
33508
+ },
33509
+ {
33510
+ command: "update",
33511
+ effect: "blocked",
33512
+ flags: {
33513
+ profile: "value",
33514
+ org: "value",
33515
+ project: "value",
33516
+ config: "value",
33517
+ help: "boolean",
33518
+ full: "boolean",
33519
+ fields: "value"
33520
+ },
33521
+ positionals: 0,
33522
+ aliases: []
33523
+ }
33524
+ ]
33525
+ };
33526
+
33527
+ // src/shared/tool-manifests.ts
33528
+ var toolManifests = { "falcon-axi": falcon_axi_default, "vectra-axi": vectra_axi_default, "az-axi": az_axi_default, "mg-axi": mg_axi_default, "ldap-axi": ldap_axi_default, "ado-axi": ado_axi_default };
33529
+
33530
+ // node_modules/.pnpm/@toon-format+toon@2.3.1/node_modules/@toon-format/toon/dist/index.mjs
33531
+ var NULL_LITERAL = "null";
33532
+ var DELIMITERS = {
33533
+ comma: ",",
33534
+ tab: " ",
33535
+ pipe: "|"
33536
+ };
33537
+ var DEFAULT_DELIMITER = DELIMITERS.comma;
33538
+ function escapeString(value) {
33539
+ return value.replace(/\\/g, `\\\\`).replace(/"/g, `\\"`).replace(/\n/g, `\\n`).replace(/\r/g, `\\r`).replace(/\t/g, `\\t`).replace(/[\u0000-\u001F]/g, (c) => `\\u${c.charCodeAt(0).toString(16).padStart(4, "0")}`);
33540
+ }
33541
+ function unescapeString(value) {
33542
+ let unescaped = "";
33543
+ let i = 0;
33544
+ while (i < value.length) {
33545
+ if (value[i] === "\\") {
33546
+ if (i + 1 >= value.length) throw new SyntaxError("Invalid escape sequence: backslash at end of string");
33547
+ const next = value[i + 1];
33548
+ if (next === "n") {
33549
+ unescaped += "\n";
33550
+ i += 2;
33551
+ continue;
33552
+ }
33553
+ if (next === "t") {
33554
+ unescaped += " ";
33555
+ i += 2;
33556
+ continue;
33557
+ }
33558
+ if (next === "r") {
33559
+ unescaped += "\r";
33560
+ i += 2;
33561
+ continue;
33562
+ }
33563
+ if (next === "\\") {
33564
+ unescaped += "\\";
33565
+ i += 2;
33566
+ continue;
33567
+ }
33568
+ if (next === '"') {
33569
+ unescaped += '"';
33570
+ i += 2;
33571
+ continue;
33572
+ }
33573
+ if (next === "u") {
33574
+ if (i + 6 > value.length) throw new SyntaxError(`Invalid escape sequence: truncated \\u escape at "${value.slice(i, i + 6)}"`);
33575
+ const hex3 = value.slice(i + 2, i + 6);
33576
+ if (!/^[0-9a-f]{4}$/i.test(hex3)) throw new SyntaxError(`Invalid escape sequence: \\u must be followed by 4 hex digits, got "${hex3}"`);
33577
+ const codeUnit = Number.parseInt(hex3, 16);
33578
+ if (codeUnit >= 55296 && codeUnit <= 57343) throw new SyntaxError(`Invalid escape sequence: \\u${hex3} is a lone surrogate; supplementary code points MUST appear as literal UTF-8`);
33579
+ unescaped += String.fromCodePoint(codeUnit);
33580
+ i += 6;
33581
+ continue;
33582
+ }
33583
+ throw new SyntaxError(`Invalid escape sequence: \\${next}`);
33584
+ }
33585
+ unescaped += value[i];
33586
+ i++;
33587
+ }
33588
+ return unescaped;
33589
+ }
33590
+ function findClosingQuote(content, start) {
33591
+ let i = start + 1;
33592
+ while (i < content.length) {
33593
+ if (content[i] === "\\" && i + 1 < content.length) {
33594
+ i += 2;
33595
+ continue;
33596
+ }
33597
+ if (content[i] === '"') return i;
33598
+ i++;
33599
+ }
33600
+ return -1;
33601
+ }
33602
+ function findUnquotedChar(content, char, start = 0) {
33603
+ let inQuotes = false;
33604
+ let i = start;
33605
+ while (i < content.length) {
33606
+ if (content[i] === "\\" && i + 1 < content.length && inQuotes) {
33607
+ i += 2;
33608
+ continue;
33609
+ }
33610
+ if (content[i] === '"') {
33611
+ inQuotes = !inQuotes;
33612
+ i++;
33613
+ continue;
33614
+ }
33615
+ if (content[i] === char && !inQuotes) return i;
33616
+ i++;
33617
+ }
33618
+ return -1;
33619
+ }
33620
+ var ToonDecodeError = class extends SyntaxError {
33621
+ constructor(message, context) {
33622
+ const prefix = context?.line !== void 0 ? `Line ${context.line}: ` : "";
33623
+ super(prefix + message, context?.cause !== void 0 ? { cause: context.cause } : void 0);
33624
+ this.name = "ToonDecodeError";
33625
+ this.line = context?.line;
33626
+ this.source = context?.source;
33627
+ }
33628
+ };
33629
+ function withLine(line, fn) {
33630
+ try {
33631
+ return fn();
33632
+ } catch (error62) {
33633
+ if (error62 instanceof ToonDecodeError) throw error62;
33634
+ if (error62 instanceof Error) throw new ToonDecodeError(error62.message, {
33635
+ line: line.lineNumber,
33636
+ source: line.raw,
33637
+ cause: error62
33638
+ });
33639
+ throw error62;
33640
+ }
33641
+ }
33642
+ var NUMERIC_LITERAL_PATTERN = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:e[+-]?\d+)?$/i;
33643
+ function isBooleanOrNullLiteral(token) {
33644
+ return token === "true" || token === "false" || token === "null";
33645
+ }
33646
+ function isNumericLiteral(token) {
33647
+ if (!token) return false;
33648
+ if (!NUMERIC_LITERAL_PATTERN.test(token)) return false;
33649
+ const numericValue = Number(token);
33650
+ return !Number.isNaN(numericValue) && Number.isFinite(numericValue);
33651
+ }
33652
+ function parseArrayHeaderLine(content, defaultDelimiter, strict = false) {
33653
+ const trimmedToken = content.trimStart();
33654
+ let bracketStart = -1;
33655
+ if (trimmedToken.startsWith('"')) {
33656
+ const closingQuoteIndex = findClosingQuote(trimmedToken, 0);
33657
+ if (closingQuoteIndex === -1) return;
33658
+ if (!trimmedToken.slice(closingQuoteIndex + 1).startsWith("[")) return;
33659
+ const keyEndIndex = content.length - trimmedToken.length + closingQuoteIndex + 1;
33660
+ bracketStart = content.indexOf("[", keyEndIndex);
33661
+ } else bracketStart = findUnquotedChar(content, "[");
33662
+ if (bracketStart === -1) return;
33663
+ const bracketEnd = findUnquotedChar(content, "]", bracketStart);
33664
+ if (bracketEnd === -1) return;
33665
+ let colonIndex = bracketEnd + 1;
33666
+ let braceEnd = colonIndex;
33667
+ const braceStart = findUnquotedChar(content, "{", bracketEnd);
33668
+ if (braceStart !== -1 && braceStart < findUnquotedChar(content, ":", bracketEnd)) {
33669
+ const gapBeforeBrace = content.slice(bracketEnd + 1, braceStart);
33670
+ if (gapBeforeBrace !== "") {
33671
+ if (strict) {
33672
+ const trimmedGap = gapBeforeBrace.trim();
33673
+ throw new SyntaxError(trimmedGap === "" ? `Unexpected whitespace between bracket and fields segment` : `Unexpected content "${trimmedGap}" between bracket and fields segment`);
33674
+ }
33675
+ return;
33676
+ }
33677
+ const foundBraceEnd = findUnquotedChar(content, "}", braceStart);
33678
+ if (foundBraceEnd !== -1) braceEnd = foundBraceEnd + 1;
33679
+ }
33680
+ colonIndex = findUnquotedChar(content, ":", Math.max(bracketEnd, braceEnd));
33681
+ if (colonIndex === -1) return;
33682
+ const gapStart = Math.max(bracketEnd + 1, braceEnd);
33683
+ const gapBeforeColon = content.slice(gapStart, colonIndex);
33684
+ if (gapBeforeColon !== "") {
33685
+ if (strict) {
33686
+ const trimmedGap = gapBeforeColon.trim();
33687
+ throw new SyntaxError(trimmedGap === "" ? `Unexpected whitespace between bracket segment and colon` : `Unexpected content "${trimmedGap}" between bracket segment and colon`);
33688
+ }
33689
+ return;
33690
+ }
33691
+ let key;
33692
+ if (bracketStart > 0) {
33693
+ const rawKey = content.slice(0, bracketStart).trim();
33694
+ key = rawKey.startsWith('"') ? parseStringLiteral(rawKey) : rawKey;
33695
+ }
33696
+ const afterColon = content.slice(colonIndex + 1).trim();
33697
+ const bracketContent = content.slice(bracketStart + 1, bracketEnd);
33698
+ let parsedBracket;
33699
+ try {
33700
+ parsedBracket = parseBracketSegment(bracketContent, defaultDelimiter);
33701
+ } catch (error62) {
33702
+ if (strict) throw error62;
33703
+ return;
33704
+ }
33705
+ const { length, delimiter } = parsedBracket;
33706
+ let fields;
33707
+ if (braceStart !== -1 && braceStart < colonIndex) {
33708
+ const foundBraceEnd = findUnquotedChar(content, "}", braceStart);
33709
+ if (foundBraceEnd !== -1 && foundBraceEnd < colonIndex) {
32533
33710
  const fieldsContent = content.slice(braceStart + 1, foundBraceEnd);
32534
33711
  const mismatchedDelimiter = findUnquotedMismatchedDelimiter(fieldsContent, delimiter);
32535
33712
  if (mismatchedDelimiter !== void 0) {
@@ -33720,7 +34897,8 @@ var managedFlags = {
33720
34897
  "vectra-axi": vectra_axi_default.adapterBoundary.unsafeOverrides,
33721
34898
  "az-axi": az_axi_default.adapterBoundary.unsafeOverrides,
33722
34899
  "mg-axi": mg_axi_default.adapterBoundary.unsafeOverrides,
33723
- "ldap-axi": ldap_axi_default.adapterBoundary.unsafeOverrides
34900
+ "ldap-axi": ldap_axi_default.adapterBoundary.unsafeOverrides,
34901
+ "ado-axi": ado_axi_default.adapterBoundary.unsafeOverrides
33724
34902
  };
33725
34903
  var ldapHelp = /^(?:Read Active Directory and LDAPv3 directories\.|(?:entry (?:search|show)|auth status) |Usage: (?:artium-axi )?ldap-axi )/m;
33726
34904
  var ldapCommands = ldap_axi_default.commands.filter((route) => route.command !== "home").map((route) => route.command);
@@ -33740,7 +34918,7 @@ function rewriteSuggestions(output3, tool, truncated = false) {
33740
34918
  const flags = managedFlags[tool];
33741
34919
  if (!flags) return output3;
33742
34920
  const executable = new RegExp(`^(?:artium-axi |npx -y @knowttl/)?${tool}(?=\\s|$)`);
33743
- if (executable.test(output3.replace(/^[ \t]*(?:(?:Command|Native operation|Examples): )?/, "")) || tool === "ldap-axi" && ldapHelp.test(output3)) return hostedHelp(output3, tool, flags, true);
34921
+ if (executable.test(output3.replace(/^[ \t]*(?:(?:Command|Native operation|Examples|Usage): )?/, "")) || tool === "ldap-axi" && ldapHelp.test(output3)) return hostedHelp(output3, tool, flags, true);
33744
34922
  let spans;
33745
34923
  let unknownOutcome = false;
33746
34924
  try {
@@ -33764,9 +34942,9 @@ function rewriteSuggestions(output3, tool, truncated = false) {
33764
34942
  return output3;
33765
34943
  }
33766
34944
  for (const span of [...spans].reverse()) {
33767
- const value = hostedHelp(span.value, tool, flags, /^[ \t]*(?:Command|Native operation|Examples):/m.test(span.value));
34945
+ const value = hostedHelp(span.value, tool, flags, /^[ \t]*(?:Command|Native operation|Examples|Usage):/m.test(span.value));
33768
34946
  if (value === span.value) continue;
33769
- output3 = output3.slice(0, span.start) + (span.quoted || tool === "ldap-axi" && /[,\r\n]/.test(value) ? JSON.stringify(value) : value) + output3.slice(span.start + span.raw.length);
34947
+ output3 = output3.slice(0, span.start) + (span.quoted || ["ldap-axi", "ado-axi"].includes(tool) && /[,\r\n]/.test(value) ? JSON.stringify(value) : value) + output3.slice(span.start + span.raw.length);
33770
34948
  }
33771
34949
  spans = (output3.trimStart().startsWith("{") ? jsonHelp(output3) : toonHelp(output3)).spans;
33772
34950
  if (spans.some((span) => /\\[`'"]/.test(span.value))) return output3;
@@ -33841,6 +35019,15 @@ function managedFlagRanges(command, tool) {
33841
35019
  return ranges;
33842
35020
  }
33843
35021
  function hostedHelp(help, tool, flags, commands2) {
35022
+ if (tool === "ado-axi") {
35023
+ const guidance = "Artium manages the organization, profile, config and PAT. api accepts relative paths and GET only. Writes are off by default; administrators control allowWrites. No stdin or files. Use pipeline watch --timeout 50 or less.";
35024
+ if (/^(?:Usage: |(?:Run|Use) [`'"]?)?(?:artium-axi )?ado-axi api(?:\s|$)/.test(help)) {
35025
+ help = "ado-axi api [GET] <relative-path> [--method GET] [--query <query>] [--api-version <version>] [--host dev|vsrm|vssps|almsearch] [--no-project] [--raw] [--limit <n>] [--full] [--fields <fields>]\n";
35026
+ }
35027
+ help = help.replace(/\n"built-in":\n[\s\S]*$/, "").split("\n").filter((line) => /^\s*(?:(?:Run|Use) [`'"]?|Usage: )?(?:artium-axi )?ado-axi (?!config\b|update\b)/.test(line) || !/(?:\bado-axi (?:config|update)\b|\baz (?:CLI )?login\b|\baz login\b|\bADO_[A-Z_]+\b|\bPAT\b.*\benv\b|stdin|piped|--profile|--org\b|--config\b)/i.test(line)).map((line) => line.replace(/<path\|url>/g, "<relative-path>").replace(/--timeout 1800/g, "--timeout 50").replace(/^([ \t]*MSYS_NO_PATHCONV=1 )ado-axi(?=\s|$)/, "$1artium-axi ado-axi").replace("raw REST escape hatch for everything else", "GET-only REST calls").replace(/ \| config\b/g, "")).join("\n");
35028
+ if (!help.trim()) help = guidance;
35029
+ else if (commands2 && !help.includes(guidance)) help = help.trimEnd() + "\n" + guidance + "\n";
35030
+ }
33844
35031
  const selectors = flags.join("|");
33845
35032
  if (tool === "ldap-axi" && !commands2 && !/^(?:Run|Use) [`'"]?(?:artium-axi )?ldap-axi\b/.test(help)) {
33846
35033
  help = help.replace(
@@ -34424,18 +35611,14 @@ function output2(stream, text2) {
34424
35611
  else process[stream].write(text2);
34425
35612
  }
34426
35613
  async function main(args) {
34427
- const managedMode = args[0] === "--managed-session";
34428
- if (managedMode) {
34429
- args = args.slice(1);
34430
- if (["passwd", "logout", "setup"].includes(args[0])) {
34431
- throw new ArtiumError(
34432
- "INVALID_INPUT",
34433
- "This command is unavailable in managed session mode.",
34434
- "The caller manages session persistence, password changes and revocation."
34435
- );
34436
- }
34437
- managed = await ManagedSession.read(args[0] === "login");
35614
+ if (args.length === 2 && args.includes("--managed-session") && args.includes("--help")) {
35615
+ output2("stdout", commandHelp("managed-session"));
35616
+ return;
34438
35617
  }
35618
+ const localArgs = args[0] === "--managed-session" ? args.slice(1) : args;
35619
+ validateArguments(localArgs[0] === "--help" ? localArgs.slice(1) : localArgs, localArgs[0] === "--help");
35620
+ const managedMode = args[0] === "--managed-session";
35621
+ if (managedMode) args = args.slice(1);
34439
35622
  if (args.length === 1 && args[0] === "--version") {
34440
35623
  output2("stdout", `${cliVersion}
34441
35624
  `);
@@ -34450,13 +35633,23 @@ async function main(args) {
34450
35633
  output2("stdout", commandHelp(help));
34451
35634
  return;
34452
35635
  }
35636
+ if (managedMode) {
35637
+ if (["passwd", "logout", "setup"].includes(args[0])) {
35638
+ throw new ArtiumError(
35639
+ "INVALID_INPUT",
35640
+ "This command is unavailable in managed session mode.",
35641
+ "The caller manages session persistence, password changes and revocation."
35642
+ );
35643
+ }
35644
+ managed = await ManagedSession.read(args[0] === "login");
35645
+ }
34453
35646
  if (command === "setup") {
34454
35647
  output2("stdout", await setup(args.slice(1)));
34455
35648
  return;
34456
35649
  }
34457
35650
  if (command === "doctor") {
34458
35651
  if (args.length !== 1) throw new ArtiumError("INVALID_INPUT", void 0, "Use artium-axi doctor.");
34459
- if (managed) await doctor(() => new Client(process.env, managed), (text2) => output2("stdout", text2));
35652
+ if (managed) await doctor((deadline) => new Client(process.env, managed, deadline), (text2) => output2("stdout", text2));
34460
35653
  else await doctor();
34461
35654
  return;
34462
35655
  }