@yawlabs/ansible-mcp 0.1.0 → 0.1.2

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/server.js CHANGED
@@ -8,203 +8,6 @@ import { createHash } from "crypto";
8
8
  import { existsSync as existsSync2, statSync } from "fs";
9
9
  import { resolve } from "path";
10
10
 
11
- // src/ansibleDoc.ts
12
- var asText = (d) => Array.isArray(d) ? d.map(String).join(" ") : typeof d === "string" ? d : d === void 0 || d === null ? "" : String(d);
13
- function parseDocJson(text2) {
14
- const out = /* @__PURE__ */ new Map();
15
- const t = text2.trim();
16
- if (!t) return out;
17
- let data;
18
- try {
19
- data = JSON.parse(t);
20
- } catch (e) {
21
- throw new Error(`ansible-doc --json did not return JSON (${e instanceof Error ? e.message : String(e)}).`);
22
- }
23
- for (const [key, entry] of Object.entries(data ?? {})) {
24
- const doc = entry?.doc;
25
- if (!doc || typeof doc !== "object") continue;
26
- out.set(key, {
27
- key,
28
- fqcn: String(doc.plugin_name ?? key),
29
- collection: String(doc.collection ?? ""),
30
- filename: String(doc.filename ?? ""),
31
- hasAction: doc.has_action === true,
32
- shortDescription: asText(doc.short_description),
33
- description: asText(doc.description),
34
- options: doc.options ?? {},
35
- deprecated: doc.deprecated && typeof doc.deprecated === "object" ? doc.deprecated : void 0,
36
- checkMode: doc.attributes?.check_mode?.support,
37
- requirements: Array.isArray(doc.requirements) ? doc.requirements.map(String) : [],
38
- returns: entry.return && typeof entry.return === "object" ? entry.return : null,
39
- examples: typeof entry.examples === "string" ? entry.examples : "",
40
- versionAdded: doc.version_added
41
- });
42
- }
43
- return out;
44
- }
45
- var TOMBSTONE = /\[ERROR\]: (?:\w+ )?(\S+) Missing documentation \(or could not parse documentation\): (?:The '[^']+' \w+ has been removed\. )?(.*?) ?This feature was removed from collection '([^']+)' version ([^\s]+?)\.?$/;
46
- function classifyDocStderr(stderr) {
47
- const r = { missing: [], deprecations: [], tombstones: [], errors: [] };
48
- for (const line of stderr.split(/\r?\n/)) {
49
- let m = /^\[WARNING\]: (\S+) was not found$/.exec(line);
50
- if (m) {
51
- if (!r.missing.includes(m[1])) r.missing.push(m[1]);
52
- continue;
53
- }
54
- m = /^\[DEPRECATION WARNING\]: (\S+) has been deprecated\. (.*)$/.exec(line);
55
- if (m) {
56
- r.deprecations.push({ name: m[1], text: m[2] });
57
- continue;
58
- }
59
- m = TOMBSTONE.exec(line);
60
- if (m) {
61
- if (!r.tombstones.some((t) => t.name === m[1])) {
62
- r.tombstones.push({ name: m[1], text: m[2].trim(), collection: m[3], version: m[4] });
63
- }
64
- continue;
65
- }
66
- if (line.startsWith("[ERROR]:")) r.errors.push(line.slice(9).trim());
67
- }
68
- return r;
69
- }
70
- function choicesOf(o) {
71
- if (!o?.choices) return null;
72
- return Array.isArray(o.choices) ? o.choices : Object.keys(o.choices);
73
- }
74
- function subOptionsOf(o) {
75
- return o?.suboptions ?? o?.options ?? null;
76
- }
77
- var typeOf = (o) => o?.type ?? "str";
78
- function findOption(options, name) {
79
- if (Object.hasOwn(options, name)) return [name, options[name], void 0];
80
- for (const [k, o] of Object.entries(options)) {
81
- if (o.aliases?.includes(name)) return [k, o, name];
82
- }
83
- return null;
84
- }
85
- function oneLine(desc, max) {
86
- let d = asText(desc).replace(/\s+/g, " ").trim();
87
- if (max && d.length > max) d = `${d.slice(0, max)}...`;
88
- return d;
89
- }
90
- var fmtDefault = (v) => JSON.stringify(v);
91
- function optionLine(name, o, pad, descLen, majorFloor) {
92
- const t = typeOf(o);
93
- const type = o.elements ? `${t} of ${o.elements}` : t;
94
- const flags = [];
95
- if (o.required) flags.push("[required]");
96
- if (o.default !== void 0 && o.default !== null)
97
- flags.push(o.no_log ? "[default: (no_log)]" : `[default: ${fmtDefault(o.default)}]`);
98
- const ch = choicesOf(o);
99
- if (ch) flags.push(`[choices: ${ch.map((c) => String(c)).join("|")}]`);
100
- if (o.aliases?.length) flags.push(`[aliases: ${o.aliases.join(", ")}]`);
101
- if (o.no_log) flags.push("[no_log]");
102
- if (o.deprecated) {
103
- const d = o.deprecated;
104
- flags.push(
105
- `[deprecated${d.removed_in ? `: removed in ${d.removed_in}` : ""}${d.alternative ? `, ${oneLine(d.alternative, 80)}` : ""}]`
106
- );
107
- }
108
- if (o.version_added && majorFloor && o.version_added_collection && newerThan(o.version_added, majorFloor)) {
109
- flags.push(`[added in ${o.version_added_collection} ${o.version_added}]`);
110
- }
111
- const desc = oneLine(o.description, descLen);
112
- return `${pad}${name} (${type})${flags.length ? ` ${flags.join(" ")}` : ""}${desc ? ` - ${desc}` : ""}`;
113
- }
114
- function newerThan(v, floor) {
115
- const a = String(v).split(".").map(Number);
116
- const b = floor.split(".").map(Number);
117
- for (let i = 0; i < 3; i++) {
118
- if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
119
- }
120
- return false;
121
- }
122
- function renderOptions(options, depth, descLen, majorFloor) {
123
- const lines = [];
124
- const pad = " ".repeat(depth);
125
- for (const name of Object.keys(options).sort()) {
126
- const o = options[name];
127
- lines.push(optionLine(name, o, pad, descLen, majorFloor));
128
- const sub = subOptionsOf(o);
129
- if (sub) lines.push(...renderOptions(sub, depth + 1, descLen, majorFloor));
130
- }
131
- return lines;
132
- }
133
- function renderModuleDoc(r) {
134
- const d = r.doc;
135
- const resolved = r.asked !== d.fqcn ? ` [resolved from '${r.asked}']` : "";
136
- let head = `${d.fqcn} (${r.type}, ${r.source})${resolved}`;
137
- if (d.deprecated) {
138
- const dep = d.deprecated;
139
- head += ` [DEPRECATED${dep.removed_in ? `: removed in ${dep.removed_in}` : ""}${dep.why ? `; ${oneLine(dep.why, 120)}` : ""}${dep.alternative ? `; ${oneLine(dep.alternative, 120)}` : ""}]`;
140
- }
141
- if (d.hasAction) head += " [has action plugin]";
142
- if (d.shortDescription) head += ` - ${d.shortDescription}`;
143
- const lines = [head];
144
- const meta = [];
145
- if (d.checkMode) meta.push(`check_mode: ${d.checkMode}`);
146
- if (d.requirements.length) meta.push(`requirements: ${d.requirements.join("; ")}`);
147
- if (meta.length) lines.push(meta.join(" | "));
148
- const opts = d.options ?? {};
149
- lines.push(`options (${Object.keys(opts).length}):`);
150
- lines.push(...renderOptions(opts, 1, r.descriptionChars, r.majorFloor));
151
- if (r.type === "module") {
152
- lines.push(
153
- "not in ansible-doc output: cross-option rules (mutually_exclusive, required_if, ...); see the module description and notes"
154
- );
155
- }
156
- if (r.includeReturn && r.type === "module") {
157
- const ret = Object.entries(d.returns ?? {});
158
- if (ret.length === 0) {
159
- lines.push("returns: (none documented)");
160
- } else {
161
- lines.push(`returns (${ret.length}):`);
162
- for (const [k, v] of ret.sort(([a], [b]) => a < b ? -1 : 1)) {
163
- const desc = oneLine(v?.description, r.descriptionChars);
164
- lines.push(
165
- ` ${k} (${v?.type ?? "?"}${v?.returned ? `, ${oneLine(v.returned, 40)}` : ""})${desc ? ` - ${desc}` : ""}`
166
- );
167
- }
168
- }
169
- }
170
- if (r.includeExamples && d.examples.trim()) {
171
- lines.push("examples:");
172
- lines.push(...d.examples.replace(/^\n+|\s+$/g, "").split("\n"));
173
- }
174
- return lines.join("\n");
175
- }
176
- function collectionRootOf(filename) {
177
- const m = /^(.*\/ansible_collections\/[^/]+\/[^/]+)\//.exec(filename.replace(/\\/g, "/"));
178
- return m ? m[1] : null;
179
- }
180
- function collectionsPathOf(filename) {
181
- const m = /^(.*)\/ansible_collections\//.exec(filename.replace(/\\/g, "/"));
182
- return m ? m[1] : null;
183
- }
184
- var PLUGIN_TYPES = [
185
- "module",
186
- "lookup",
187
- "filter",
188
- "test",
189
- "callback",
190
- "connection",
191
- "inventory",
192
- "become",
193
- "cache",
194
- "vars",
195
- "strategy",
196
- "shell",
197
- "cliconf",
198
- "httpapi",
199
- "netconf",
200
- "keyword",
201
- "role"
202
- ];
203
- function isPluginType(t) {
204
- return PLUGIN_TYPES.includes(t);
205
- }
206
- var BAD_TYPE_MESSAGE = `type must be one of ${PLUGIN_TYPES.join(", ")}`;
207
-
208
11
  // src/redact.ts
209
12
  var VAULTED = "<vaulted>";
210
13
  var REDACTED_VALUE = "(redacted: contains a secret value)";
@@ -362,7 +165,7 @@ var SHAPES = [
362
165
  /LS0tLS1CRUdJTi[A-Za-z0-9+/=]{0,40}(UFJJVkFURSBLRVk|BSSVZBVEUgS0VZ|UklWQVRFIEtFW)/
363
166
  ];
364
167
  var VAULT_TEXT = /^\s*\$ANSIBLE_VAULT;/;
365
- var URL_USERINFO = /\b([a-z][a-z0-9+.-]*:\/\/)([^\s:@/]+):([^\s@/]+)@/gi;
168
+ var URL_USERINFO = /\b([a-z][a-z0-9+.-]*:\/\/)([^\s:@/]*):([^\s@/]+)@/gi;
366
169
  function hasSecretShape(s) {
367
170
  return SHAPES.some((re) => re.test(s));
368
171
  }
@@ -490,11 +293,13 @@ var Redactor = class {
490
293
  const url = maskUrlPasswords(v);
491
294
  if (url !== null) this.counts.url++;
492
295
  const inline = maskInlineCredentials(url ?? v);
493
- if (inline !== null) {
494
- this.counts.shape++;
495
- return inline;
296
+ if (inline !== null) this.counts.shape++;
297
+ const masked = inline ?? url;
298
+ if (masked !== null) {
299
+ if (!this.matches(masked)) return masked;
300
+ this.counts.value++;
301
+ return new Hidden(REDACTED_VALUE);
496
302
  }
497
- if (url !== null) return url;
498
303
  if (this.matches(v)) {
499
304
  this.counts.value++;
500
305
  return new Hidden(REDACTED_VALUE);
@@ -540,11 +345,212 @@ var Redactor = class {
540
345
  return parts.length ? `redacted: ${parts.join(", ")}` : "";
541
346
  }
542
347
  };
348
+ function redactStandalone(value, key) {
349
+ const red = new Redactor();
350
+ red.learn(value, [key]);
351
+ return red.render(value, [key]);
352
+ }
543
353
  function stringify(v) {
544
354
  if (v instanceof Hidden) return v.text;
545
355
  return JSON.stringify(v, (_k, x) => x instanceof Hidden ? x.text : x) ?? "null";
546
356
  }
547
357
 
358
+ // src/ansibleDoc.ts
359
+ var asText = (d) => Array.isArray(d) ? d.map(String).join(" ") : typeof d === "string" ? d : d === void 0 || d === null ? "" : String(d);
360
+ function parseDocJson(text2) {
361
+ const out = /* @__PURE__ */ new Map();
362
+ const t = text2.trim();
363
+ if (!t) return out;
364
+ let data;
365
+ try {
366
+ data = JSON.parse(t);
367
+ } catch (e) {
368
+ throw new Error(`ansible-doc --json did not return JSON (${e instanceof Error ? e.message : String(e)}).`);
369
+ }
370
+ for (const [key, entry] of Object.entries(data ?? {})) {
371
+ const doc = entry?.doc;
372
+ if (!doc || typeof doc !== "object") continue;
373
+ out.set(key, {
374
+ key,
375
+ fqcn: String(doc.plugin_name ?? key),
376
+ collection: String(doc.collection ?? ""),
377
+ filename: String(doc.filename ?? ""),
378
+ hasAction: doc.has_action === true,
379
+ shortDescription: asText(doc.short_description),
380
+ description: asText(doc.description),
381
+ options: doc.options ?? {},
382
+ deprecated: doc.deprecated && typeof doc.deprecated === "object" ? doc.deprecated : void 0,
383
+ checkMode: doc.attributes?.check_mode?.support,
384
+ requirements: Array.isArray(doc.requirements) ? doc.requirements.map(String) : [],
385
+ returns: entry.return && typeof entry.return === "object" ? entry.return : null,
386
+ examples: typeof entry.examples === "string" ? entry.examples : "",
387
+ versionAdded: doc.version_added
388
+ });
389
+ }
390
+ return out;
391
+ }
392
+ var TOMBSTONE = /\[ERROR\]: (?:\w+ )?(\S+) Missing documentation \(or could not parse documentation\): (?:The '[^']+' \w+ has been removed\. )?(.*?) ?This feature was removed from collection '([^']+)' version ([^\s]+?)\.?$/;
393
+ function classifyDocStderr(stderr) {
394
+ const r = { missing: [], deprecations: [], tombstones: [], errors: [] };
395
+ for (const line of stderr.split(/\r?\n/)) {
396
+ let m = /^\[WARNING\]: (\S+) was not found$/.exec(line);
397
+ if (m) {
398
+ if (!r.missing.includes(m[1])) r.missing.push(m[1]);
399
+ continue;
400
+ }
401
+ m = /^\[DEPRECATION WARNING\]: (\S+) has been deprecated\. (.*)$/.exec(line);
402
+ if (m) {
403
+ r.deprecations.push({ name: m[1], text: m[2] });
404
+ continue;
405
+ }
406
+ m = TOMBSTONE.exec(line);
407
+ if (m) {
408
+ if (!r.tombstones.some((t) => t.name === m[1])) {
409
+ r.tombstones.push({ name: m[1], text: m[2].trim(), collection: m[3], version: m[4] });
410
+ }
411
+ continue;
412
+ }
413
+ if (line.startsWith("[ERROR]:")) r.errors.push(line.slice(9).trim());
414
+ }
415
+ return r;
416
+ }
417
+ function choicesOf(o) {
418
+ if (!o?.choices) return null;
419
+ return Array.isArray(o.choices) ? o.choices : Object.keys(o.choices);
420
+ }
421
+ function subOptionsOf(o) {
422
+ return o?.suboptions ?? o?.options ?? null;
423
+ }
424
+ var typeOf = (o) => o?.type ?? "str";
425
+ function findOption(options, name) {
426
+ if (Object.hasOwn(options, name)) return [name, options[name], void 0];
427
+ for (const [k, o] of Object.entries(options)) {
428
+ if (o.aliases?.includes(name)) return [k, o, name];
429
+ }
430
+ return null;
431
+ }
432
+ function oneLine(desc, max) {
433
+ let d = asText(desc).replace(/\s+/g, " ").trim();
434
+ if (max && d.length > max) d = `${d.slice(0, max)}...`;
435
+ return d;
436
+ }
437
+ function optionLine(name, o, pad, descLen, majorFloor) {
438
+ const t = typeOf(o);
439
+ const type = o.elements ? `${t} of ${o.elements}` : t;
440
+ const flags = [];
441
+ if (o.required) flags.push("[required]");
442
+ if (o.default !== void 0 && o.default !== null)
443
+ flags.push(o.no_log ? "[default: (no_log)]" : `[default: ${redactStandalone(o.default, name)}]`);
444
+ const ch = choicesOf(o);
445
+ if (ch) flags.push(`[choices: ${ch.map((c) => String(c)).join("|")}]`);
446
+ if (o.aliases?.length) flags.push(`[aliases: ${o.aliases.join(", ")}]`);
447
+ if (o.no_log) flags.push("[no_log]");
448
+ if (o.deprecated) {
449
+ const d = o.deprecated;
450
+ flags.push(
451
+ `[deprecated${d.removed_in ? `: removed in ${d.removed_in}` : ""}${d.alternative ? `, ${oneLine(d.alternative, 80)}` : ""}]`
452
+ );
453
+ }
454
+ if (o.version_added && majorFloor && o.version_added_collection && newerThan(o.version_added, majorFloor)) {
455
+ flags.push(`[added in ${o.version_added_collection} ${o.version_added}]`);
456
+ }
457
+ const desc = oneLine(o.description, descLen);
458
+ return `${pad}${name} (${type})${flags.length ? ` ${flags.join(" ")}` : ""}${desc ? ` - ${desc}` : ""}`;
459
+ }
460
+ function newerThan(v, floor) {
461
+ const a = String(v).split(".").map(Number);
462
+ const b = floor.split(".").map(Number);
463
+ for (let i = 0; i < 3; i++) {
464
+ if ((a[i] ?? 0) !== (b[i] ?? 0)) return (a[i] ?? 0) > (b[i] ?? 0);
465
+ }
466
+ return false;
467
+ }
468
+ function renderOptions(options, depth, descLen, majorFloor) {
469
+ const lines = [];
470
+ const pad = " ".repeat(depth);
471
+ for (const name of Object.keys(options).sort()) {
472
+ const o = options[name];
473
+ lines.push(optionLine(name, o, pad, descLen, majorFloor));
474
+ const sub = subOptionsOf(o);
475
+ if (sub) lines.push(...renderOptions(sub, depth + 1, descLen, majorFloor));
476
+ }
477
+ return lines;
478
+ }
479
+ function renderModuleDoc(r) {
480
+ const d = r.doc;
481
+ const resolved = r.asked !== d.fqcn ? ` [resolved from '${r.asked}']` : "";
482
+ let head = `${d.fqcn} (${r.type}, ${r.source})${resolved}`;
483
+ if (d.deprecated) {
484
+ const dep = d.deprecated;
485
+ head += ` [DEPRECATED${dep.removed_in ? `: removed in ${dep.removed_in}` : ""}${dep.why ? `; ${oneLine(dep.why, 120)}` : ""}${dep.alternative ? `; ${oneLine(dep.alternative, 120)}` : ""}]`;
486
+ }
487
+ if (d.hasAction) head += " [has action plugin]";
488
+ if (d.shortDescription) head += ` - ${d.shortDescription}`;
489
+ const lines = [head];
490
+ const meta = [];
491
+ if (d.checkMode) meta.push(`check_mode: ${d.checkMode}`);
492
+ if (d.requirements.length) meta.push(`requirements: ${d.requirements.join("; ")}`);
493
+ if (meta.length) lines.push(meta.join(" | "));
494
+ const opts = d.options ?? {};
495
+ lines.push(`options (${Object.keys(opts).length}):`);
496
+ lines.push(...renderOptions(opts, 1, r.descriptionChars, r.majorFloor));
497
+ if (r.type === "module") {
498
+ lines.push(
499
+ "not in ansible-doc output: cross-option rules (mutually_exclusive, required_if, ...); see the module description and notes"
500
+ );
501
+ }
502
+ if (r.includeReturn && r.type === "module") {
503
+ const ret = Object.entries(d.returns ?? {});
504
+ if (ret.length === 0) {
505
+ lines.push("returns: (none documented)");
506
+ } else {
507
+ lines.push(`returns (${ret.length}):`);
508
+ for (const [k, v] of ret.sort(([a], [b]) => a < b ? -1 : 1)) {
509
+ const desc = oneLine(v?.description, r.descriptionChars);
510
+ lines.push(
511
+ ` ${k} (${v?.type ?? "?"}${v?.returned ? `, ${oneLine(v.returned, 40)}` : ""})${desc ? ` - ${desc}` : ""}`
512
+ );
513
+ }
514
+ }
515
+ }
516
+ if (r.includeExamples && d.examples.trim()) {
517
+ lines.push("examples:");
518
+ lines.push(...d.examples.replace(/^\n+|\s+$/g, "").split("\n"));
519
+ }
520
+ return lines.join("\n");
521
+ }
522
+ function collectionRootOf(filename) {
523
+ const m = /^(.*\/ansible_collections\/[^/]+\/[^/]+)\//.exec(filename.replace(/\\/g, "/"));
524
+ return m ? m[1] : null;
525
+ }
526
+ function collectionsPathOf(filename) {
527
+ const m = /^(.*)\/ansible_collections\//.exec(filename.replace(/\\/g, "/"));
528
+ return m ? m[1] : null;
529
+ }
530
+ var PLUGIN_TYPES = [
531
+ "module",
532
+ "lookup",
533
+ "filter",
534
+ "test",
535
+ "callback",
536
+ "connection",
537
+ "inventory",
538
+ "become",
539
+ "cache",
540
+ "vars",
541
+ "strategy",
542
+ "shell",
543
+ "cliconf",
544
+ "httpapi",
545
+ "netconf",
546
+ "keyword",
547
+ "role"
548
+ ];
549
+ function isPluginType(t) {
550
+ return PLUGIN_TYPES.includes(t);
551
+ }
552
+ var BAD_TYPE_MESSAGE = `type must be one of ${PLUGIN_TYPES.join(", ")}`;
553
+
548
554
  // src/config.ts
549
555
  function parseConfigDump(text2) {
550
556
  let data;
@@ -959,24 +965,44 @@ var AnsibleRunner = class {
959
965
  const d = this.distro();
960
966
  return d ? `\\\\wsl.localhost\\${d}${p.replace(/\//g, "\\")}` : null;
961
967
  }
962
- /** The Ansible side's environment (prefix mode; learned once per process). */
968
+ /**
969
+ * The Ansible side's environment (prefix mode; learned once per process). A
970
+ * spawn failure, a non-zero exit or an empty listing rejects and is not
971
+ * cached, so the next call asks again.
972
+ */
963
973
  sideEnv() {
964
974
  if (!this.prefixed) return Promise.resolve(process.env);
965
- this.sideEnvCache ??= this.raw("env", [], {}).then((r) => {
966
- const out = {};
967
- for (const line of r.stdout.split("\n")) {
968
- const i = line.indexOf("=");
969
- if (i > 0) out[line.slice(0, i)] = line.slice(i + 1);
970
- }
971
- return out;
972
- });
975
+ if (!this.sideEnvCache) {
976
+ const p = this.raw("env", [], {}).then((r) => {
977
+ const out = {};
978
+ for (const line of r.stdout.split("\n")) {
979
+ const i = line.indexOf("=");
980
+ if (i > 0) out[line.slice(0, i)] = line.slice(i + 1);
981
+ }
982
+ if (r.code !== 0 || Object.keys(out).length === 0) {
983
+ throw new Error(
984
+ `could not read the Ansible side's environment (env exit ${r.code})${r.stderr.trim() ? `: ${r.stderr.trim().slice(0, 512)}` : ""}`
985
+ );
986
+ }
987
+ return out;
988
+ });
989
+ p.catch(() => {
990
+ this.sideEnvCache = null;
991
+ });
992
+ this.sideEnvCache = p;
993
+ }
973
994
  return this.sideEnvCache;
974
995
  }
975
996
  /** Ansible-side cache root: ANSIBLE_MCP_REMOTE_CACHE, else $HOME/.cache/ansible-mcp (never /tmp, F24). */
976
997
  async sideCacheRoot() {
977
998
  if (!this.prefixed) return this.localCache;
978
999
  if (this.remoteCacheOverride) return this.remoteCacheOverride;
979
- const home = (await this.sideEnv()).HOME || "/tmp";
1000
+ const home = (await this.sideEnv()).HOME;
1001
+ if (!home) {
1002
+ throw new Error(
1003
+ "HOME is not set on the Ansible side, so there is no cache dir (never /tmp, F24). Set ANSIBLE_MCP_REMOTE_CACHE to an Ansible-side directory."
1004
+ );
1005
+ }
980
1006
  return posix.join(home, ".cache", "ansible-mcp");
981
1007
  }
982
1008
  /**
@@ -1124,10 +1150,17 @@ var AnsibleRunner = class {
1124
1150
  const r = await this.raw("mv", ["-T", "--", from, to], {});
1125
1151
  return r.code === 0;
1126
1152
  }
1127
- /** Recursive delete of a `.tmp-*` dir, only under `guardRoot` (asserted). */
1153
+ /**
1154
+ * Recursive delete of a `.tmp-*` dir, only under `guardRoot` (asserted): the
1155
+ * last segment must start with `.tmp-`, and no segment of either path may be
1156
+ * `.` or `..` (a plain prefix test would accept `<root>/../x/.tmp-y`).
1157
+ */
1128
1158
  async sideRemoveTemp(p, guardRoot) {
1129
- const norm = (s) => s.replace(/\\/g, "/").replace(/\/+$/, "");
1130
- if (!norm(p).startsWith(`${norm(guardRoot)}/`) || !norm(p).includes("/.tmp-")) {
1159
+ const segs = (s) => s.replace(/\\/g, "/").replace(/\/+$/, "").split("/");
1160
+ const ps = segs(p);
1161
+ const rs = segs(guardRoot);
1162
+ const dotted = (x) => x.some((s) => s === "." || s === "..");
1163
+ if (dotted(ps) || dotted(rs) || ps.length <= rs.length || rs.some((s, i) => s !== ps[i]) || !ps.at(-1).startsWith(".tmp-")) {
1131
1164
  throw new Error(`refusing to remove ${p}: not a temp dir under ${guardRoot}`);
1132
1165
  }
1133
1166
  if (!this.prefixed) {
@@ -1172,6 +1205,7 @@ var AnsibleContext = class {
1172
1205
  configCache = /* @__PURE__ */ new Map();
1173
1206
  versionCache = null;
1174
1207
  fingerprints = /* @__PURE__ */ new Map();
1208
+ /** Per-name doc results; `deprecations` replays the batch's warnings naming that entry on a hit. */
1175
1209
  docCache = /* @__PURE__ */ new Map();
1176
1210
  listCache = /* @__PURE__ */ new Map();
1177
1211
  /** Serializes ansible_upgrade_impact calls in this process. */
@@ -1329,6 +1363,9 @@ ${r.stderr.trim().slice(0, 2048)}`);
1329
1363
  * tombstone retry (F2: one tombstone fails the whole batch, so it is recorded
1330
1364
  * and the batch re-run without it). `collectionsPath` overrides
1331
1365
  * ANSIBLE_COLLECTIONS_PATH (upgrade targets); those results are not cached.
1366
+ * A name starting with `-` is never a plugin name: it is reported missing and
1367
+ * never reaches argv (task keys are user data; `-M x` would be an option), and
1368
+ * the names follow `--` besides.
1332
1369
  */
1333
1370
  async docs(p, names, opts = {}) {
1334
1371
  const type = opts.type ?? "module";
@@ -1338,20 +1375,31 @@ ${r.stderr.trim().slice(0, 2048)}`);
1338
1375
  const fp = cacheable ? await this.fingerprint(p) : "";
1339
1376
  const todo = [];
1340
1377
  for (const n of unique) {
1378
+ if (n.startsWith("-")) {
1379
+ result.missing.push(n);
1380
+ continue;
1381
+ }
1341
1382
  const c = cacheable ? this.docCache.get(`${fp}|${type}|${n}`) : void 0;
1342
1383
  if (!c) todo.push(n);
1343
- else if ("kind" in c && c.kind === "doc") result.docs.set(n, c.doc);
1344
- else if ("kind" in c && c.kind === "missing") result.missing.push(n);
1345
- else result.tombstones.push(c);
1384
+ else if ("kind" in c) {
1385
+ if (c.kind === "doc" && c.doc) result.docs.set(n, c.doc);
1386
+ else result.missing.push(n);
1387
+ result.deprecations.push(...c.deprecations);
1388
+ } else result.tombstones.push(c);
1346
1389
  }
1347
1390
  const env = {};
1348
1391
  if (opts.collectionsPath) env.ANSIBLE_COLLECTIONS_PATH = opts.collectionsPath;
1349
1392
  for (let i = 0; i < todo.length; i += DOC_BATCH) {
1350
1393
  let batch = todo.slice(i, i + DOC_BATCH);
1351
1394
  for (let attempt = 0; batch.length > 0 && attempt <= batch.length; attempt++) {
1352
- const r = await this.runSafe(p, "ansible-doc", ["--json", "-t", type, ...opts.extraArgs ?? [], ...batch], {
1353
- env
1354
- });
1395
+ const r = await this.runSafe(
1396
+ p,
1397
+ "ansible-doc",
1398
+ ["--json", "-t", type, ...opts.extraArgs ?? [], "--", ...batch],
1399
+ {
1400
+ env
1401
+ }
1402
+ );
1355
1403
  const st = classifyDocStderr(r.stderr);
1356
1404
  if (r.code !== 0) {
1357
1405
  const tomb = st.tombstones.filter((t) => batch.includes(t.name));
@@ -1369,12 +1417,14 @@ ${r.stderr.trim().slice(0, 2048)}`);
1369
1417
  const docs = parseDocJson(r.stdout);
1370
1418
  for (const n of batch) {
1371
1419
  const d = docs.get(n);
1372
- if (d) {
1373
- result.docs.set(n, d);
1374
- if (cacheable) this.docCache.set(`${fp}|${type}|${n}`, { kind: "doc", doc: d });
1375
- } else {
1376
- result.missing.push(n);
1377
- if (cacheable) this.docCache.set(`${fp}|${type}|${n}`, { kind: "missing" });
1420
+ if (d) result.docs.set(n, d);
1421
+ else result.missing.push(n);
1422
+ if (cacheable) {
1423
+ const deprecations = st.deprecations.filter((x) => x.name === n);
1424
+ this.docCache.set(
1425
+ `${fp}|${type}|${n}`,
1426
+ d ? { kind: "doc", doc: d, deprecations } : { kind: "missing", deprecations }
1427
+ );
1378
1428
  }
1379
1429
  }
1380
1430
  result.deprecations.push(...st.deprecations);
@@ -1420,11 +1470,11 @@ import { z } from "zod";
1420
1470
 
1421
1471
  // src/handlers.ts
1422
1472
  import { readdirSync as readdirSync5, readFileSync as readFileSync4 } from "fs";
1423
- import { dirname as dirname3, join as join6 } from "path";
1473
+ import { dirname as dirname3, join as join6, normalize } from "path";
1424
1474
 
1425
1475
  // src/project.ts
1426
- import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync2, statSync as statSync2 } from "fs";
1427
- import { dirname, join as join2, posix as posix2 } from "path";
1476
+ import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync2, realpathSync, statSync as statSync2 } from "fs";
1477
+ import { dirname, isAbsolute, join as join2, posix as posix2 } from "path";
1428
1478
 
1429
1479
  // src/yaml.ts
1430
1480
  import {
@@ -1462,6 +1512,8 @@ var pyFalse = {
1462
1512
  resolve: () => false
1463
1513
  };
1464
1514
  var NULL_SCALAR = (line) => ({ kind: "scalar", value: null, line, raw: "" });
1515
+ var MAX_ALIAS_EXPANSION = 1e5;
1516
+ var ALIAS_LIMIT_ERROR = "alias expansion limit exceeded";
1465
1517
  function parseYaml(src) {
1466
1518
  const lc = new LineCounter();
1467
1519
  const docs = parseAllDocuments(src, {
@@ -1485,6 +1537,16 @@ function parseYaml(src) {
1485
1537
  const line = (offset) => offset === void 0 ? 0 : lc.linePos(offset).line;
1486
1538
  const convertedCache = /* @__PURE__ */ new WeakMap();
1487
1539
  const inProgress = /* @__PURE__ */ new WeakSet();
1540
+ const sizes = /* @__PURE__ */ new WeakMap();
1541
+ let aliasBudget = MAX_ALIAS_EXPANSION;
1542
+ let aliasLimitHit = false;
1543
+ const sizeOf = (y) => {
1544
+ const known = sizes.get(y);
1545
+ if (known !== void 0) return known;
1546
+ const n = y.kind === "scalar" ? 1 : y.kind === "seq" ? y.items.reduce((a, i) => a + sizeOf(i), 1) : y.entries.reduce((a, e) => a + sizeOf(e.value), 1);
1547
+ sizes.set(y, n);
1548
+ return n;
1549
+ };
1488
1550
  const mergeEntries = (node) => {
1489
1551
  const anchors = isAlias(node) ? [node] : isSeq(node) ? node.items : [];
1490
1552
  const out = [];
@@ -1496,10 +1558,23 @@ function parseYaml(src) {
1496
1558
  }
1497
1559
  return out;
1498
1560
  };
1561
+ const aliasKey = (k, fallbackLine) => {
1562
+ const conv = convert(k, fallbackLine);
1563
+ return conv.kind === "scalar" && conv.value !== null && typeof conv.value !== "object" ? String(conv.value) : String(k);
1564
+ };
1499
1565
  const convert = (node, fallbackLine) => {
1500
1566
  if (node === null || node === void 0) return NULL_SCALAR(fallbackLine);
1501
1567
  if (isAlias(node)) {
1502
- return NULL_SCALAR(line(node.range?.[0]));
1568
+ const target = node.resolve(docs[0]);
1569
+ const aliasLine = line(node.range?.[0]);
1570
+ if (!target || aliasLimitHit) return NULL_SCALAR(aliasLine);
1571
+ const out = convert(target, aliasLine);
1572
+ aliasBudget -= sizeOf(out);
1573
+ if (aliasBudget < 0) {
1574
+ aliasLimitHit = true;
1575
+ return NULL_SCALAR(aliasLine);
1576
+ }
1577
+ return out;
1503
1578
  }
1504
1579
  const n = node;
1505
1580
  const cached = convertedCache.get(n);
@@ -1533,7 +1608,7 @@ function parseYaml(src) {
1533
1608
  for (const e of mergeEntries(item.value)) merged.push(e);
1534
1609
  continue;
1535
1610
  }
1536
- const keyText = isScalar(k) ? String(k.value) : k ? String(k) : "";
1611
+ const keyText = isScalar(k) ? String(k.value) : isAlias(k) ? aliasKey(k, start) : k ? String(k) : "";
1537
1612
  const keyLine = line(k?.range?.[0]) || start;
1538
1613
  if (seen.has(keyText)) duplicates.push({ key: keyText, line: keyLine });
1539
1614
  seen.add(keyText);
@@ -1572,6 +1647,7 @@ function parseYaml(src) {
1572
1647
  for (const e of d.errors) errors.push(e.message.split("\n")[0]);
1573
1648
  if (i === 0) root = d.contents ? convert(d.contents, 1) : null;
1574
1649
  }
1650
+ if (aliasLimitHit) errors.push(`${ALIAS_LIMIT_ERROR} (more than ${MAX_ALIAS_EXPANSION} nodes through aliases)`);
1575
1651
  return { root, errors, duplicates };
1576
1652
  }
1577
1653
  function toJS(node) {
@@ -1679,6 +1755,38 @@ function isFreeForm(fqcnOrName) {
1679
1755
  }
1680
1756
  return FREE_FORM.has(parts[parts.length - 1]);
1681
1757
  }
1758
+ var CHECK_RAW_MODULES = /* @__PURE__ */ new Set(["command", "raw", "script", "shell", "win_command", "win_shell"]);
1759
+ var CHECK_RAW_OPTIONS = /* @__PURE__ */ new Set([
1760
+ "creates",
1761
+ "removes",
1762
+ "chdir",
1763
+ "executable",
1764
+ "warn",
1765
+ "stdin",
1766
+ "stdin_add_newline",
1767
+ "strip_empty_ends"
1768
+ ]);
1769
+ function isCheckRawAction(action) {
1770
+ const parts = action.split(".");
1771
+ if (parts.length === 1) return CHECK_RAW_MODULES.has(action);
1772
+ if (parts.length !== 3) return false;
1773
+ if (parts[0] === "ansible" && (parts[1] === "builtin" || parts[1] === "legacy"))
1774
+ return CHECK_RAW_MODULES.has(parts[2]);
1775
+ return parts[0] === "ansible" && parts[1] === "windows" && /^win_(command|shell)$/.test(parts[2]);
1776
+ }
1777
+ var IMPORT_PLAYBOOK_KEYS = [
1778
+ "import_playbook",
1779
+ "ansible.builtin.import_playbook",
1780
+ "ansible.legacy.import_playbook"
1781
+ ];
1782
+ var isPlayKey = (k) => k === "hosts" || IMPORT_PLAYBOOK_KEYS.includes(k);
1783
+ function importPlaybookEntry(play) {
1784
+ if (play.kind !== "map") return void 0;
1785
+ for (let i = play.entries.length - 1; i >= 0; i--) {
1786
+ if (IMPORT_PLAYBOOK_KEYS.includes(play.entries[i].key)) return play.entries[i].value;
1787
+ }
1788
+ return void 0;
1789
+ }
1682
1790
  var INCLUDE_TASKS = /* @__PURE__ */ new Set(["include_tasks", "import_tasks", "include"]);
1683
1791
  var INCLUDE_ROLE = /* @__PURE__ */ new Set(["include_role", "import_role"]);
1684
1792
  var builtinName = (a) => a.replace(/^ansible\.(builtin|legacy)\./, "");
@@ -1730,7 +1838,7 @@ function unquote(v) {
1730
1838
  if (v.length >= 2 && (v[0] === '"' || v[0] === "'") && v[v.length - 1] === v[0]) return v.slice(1, -1);
1731
1839
  return v;
1732
1840
  }
1733
- function parseKv(s) {
1841
+ function parseKv(s, checkRaw = false) {
1734
1842
  const options = {};
1735
1843
  const raw = [];
1736
1844
  for (const tok of splitArgs(s)) {
@@ -1746,7 +1854,7 @@ function parseKv(s) {
1746
1854
  continue;
1747
1855
  }
1748
1856
  const k = tok.slice(0, pos).trim();
1749
- if (/["']/.test(k)) {
1857
+ if (/["']/.test(k) || checkRaw && !CHECK_RAW_OPTIONS.has(k)) {
1750
1858
  raw.push(tok);
1751
1859
  continue;
1752
1860
  }
@@ -1802,14 +1910,20 @@ function extractTask(map, file, doc, extra = {}) {
1802
1910
  if (v.kind === "scalar" && typeof v.value === "string") {
1803
1911
  const [mod, ...rest] = splitArgs(v.value);
1804
1912
  t.action = mod;
1805
- const kv = parseKv(rest.join(" "));
1913
+ const kv = parseKv(rest.join(" "), !!mod && isCheckRawAction(mod));
1806
1914
  t.form = "kv";
1807
1915
  t.args = Object.entries(kv).map(([k, val]) => ({ name: k, line: v.line, value: val }));
1808
1916
  } else if (v.kind === "map") {
1809
- const mod = scalarString(get(v, "module"));
1917
+ const modNode = get(v, "module");
1918
+ const [mod, ...rest] = splitArgs(scalarString(modNode) ?? "");
1810
1919
  if (mod) t.action = mod;
1811
1920
  t.form = "dict";
1812
1921
  t.args = v.entries.filter((e) => e.key !== "module").map((e) => entryArg(e.key, e.keyLine, e.value));
1922
+ if (mod && rest.length > 0) {
1923
+ const kv = parseKv(rest.join(" "), isCheckRawAction(mod));
1924
+ t.args = t.args.filter((a) => !(a.name in kv));
1925
+ for (const [k, val] of Object.entries(kv)) t.args.push({ name: k, line: modNode.line, value: val });
1926
+ }
1813
1927
  }
1814
1928
  if (actions.length > 0) t.conflicting = [actionKw.key, ...actions.map((a) => a.key)];
1815
1929
  } else if (actions.length > 0) {
@@ -1826,12 +1940,18 @@ function extractTask(map, file, doc, extra = {}) {
1826
1940
  } else if (actionNode.kind === "scalar" && actionNode.value !== null && actionNode.value !== void 0) {
1827
1941
  t.form = "kv";
1828
1942
  const text2 = typeof actionNode.value === "string" ? actionNode.value : String(actionNode.value);
1829
- t.args = Object.entries(parseKv(text2)).map(([k, val]) => ({ name: k, line: actionNode.line, value: val }));
1943
+ t.args = Object.entries(parseKv(text2, isCheckRawAction(t.action))).map(([k, val]) => ({
1944
+ name: k,
1945
+ line: actionNode.line,
1946
+ value: val
1947
+ }));
1830
1948
  }
1831
1949
  }
1832
1950
  const argsKw = get(map, "args");
1833
1951
  if (argsKw?.kind === "map") {
1952
+ const own = new Set(t.args.map((a) => a.name));
1834
1953
  for (const e of argsKw.entries) {
1954
+ if (own.has(e.key)) continue;
1835
1955
  t.args = t.args.filter((a) => a.name !== e.key);
1836
1956
  t.args.push(entryArg(e.key, e.keyLine, e.value));
1837
1957
  }
@@ -1874,11 +1994,11 @@ function tasksOf(seq, file, doc, extra = {}) {
1874
1994
  }
1875
1995
  function isPlaybookRoot(root) {
1876
1996
  if (root?.kind !== "seq" || root.items.length === 0) return false;
1877
- return root.items.every(
1878
- (i) => i.kind === "map" && i.entries.some(
1879
- (e) => e.key === "hosts" || e.key === "import_playbook" || e.key === "ansible.builtin.import_playbook"
1880
- )
1881
- );
1997
+ return root.items.every((i) => i.kind === "map" && i.entries.some((e) => isPlayKey(e.key)));
1998
+ }
1999
+ function isPlaybookLike(root) {
2000
+ if (root?.kind !== "seq") return false;
2001
+ return root.items.some((i) => i.kind === "map" && i.entries.some((e) => isPlayKey(e.key)));
1882
2002
  }
1883
2003
  var MAX_YAML_BYTES = 2 * 1024 * 1024;
1884
2004
  var ProjectFiles = class {
@@ -1886,25 +2006,37 @@ var ProjectFiles = class {
1886
2006
  this.dir = dir;
1887
2007
  }
1888
2008
  dir;
2009
+ /** Per path: the parsed doc (null when unread), and the file size (undefined when not a readable file). */
1889
2010
  cache = /* @__PURE__ */ new Map();
2011
+ /** An absolute input is returned unchanged (a playbook outside dir); a relative one joins dir. */
1890
2012
  abs(rel) {
1891
- return join2(this.dir, rel);
2013
+ return isAbsolute(rel) ? rel : join2(this.dir, rel);
1892
2014
  }
2015
+ /** Relative to dir when inside it (drive-letter / case-insensitive on Windows), else the forward-slashed path. */
1893
2016
  rel(abs) {
1894
2017
  const a = abs.replace(/\\/g, "/");
1895
2018
  const b = this.dir.replace(/\\/g, "/").replace(/\/+$/, "");
1896
- return a.startsWith(`${b}/`) ? a.slice(b.length + 1) : a;
1897
- }
1898
- read(abs) {
1899
- if (this.cache.has(abs)) return this.cache.get(abs);
2019
+ const fold = (x) => process.platform === "win32" ? x.toLowerCase() : x;
2020
+ return fold(a).startsWith(fold(`${b}/`)) ? a.slice(b.length + 1) : a;
2021
+ }
2022
+ /** Parse a YAML file of at most `maxBytes` (default 2 MiB); null when missing, unreadable or larger. */
2023
+ read(abs, maxBytes = MAX_YAML_BYTES) {
2024
+ const hit = this.cache.get(abs);
2025
+ if (hit && (hit.size === void 0 || hit.size > maxBytes)) return null;
2026
+ if (hit?.doc) return hit.doc;
1900
2027
  let doc = null;
2028
+ let size;
1901
2029
  try {
1902
2030
  const st = statSync2(abs);
1903
- if (st.isFile() && st.size <= MAX_YAML_BYTES) doc = parseYaml(readFileSync2(abs, "utf8"));
2031
+ if (st.isFile()) {
2032
+ size = st.size;
2033
+ if (st.size <= maxBytes) doc = parseYaml(readFileSync2(abs, "utf8"));
2034
+ }
1904
2035
  } catch {
1905
2036
  doc = null;
2037
+ size = void 0;
1906
2038
  }
1907
- this.cache.set(abs, doc);
2039
+ this.cache.set(abs, { doc, size });
1908
2040
  return doc;
1909
2041
  }
1910
2042
  };
@@ -2034,7 +2166,7 @@ function walkPlaybooks(files, playbooks, opts) {
2034
2166
  const rel = files.rel(abs);
2035
2167
  for (const play of root.items) {
2036
2168
  if (play.kind !== "map") continue;
2037
- const imp = get(play, "import_playbook") ?? get(play, "ansible.builtin.import_playbook");
2169
+ const imp = importPlaybookEntry(play);
2038
2170
  if (imp) {
2039
2171
  const target = scalarString(imp);
2040
2172
  if (target && !isTemplated(target)) {
@@ -2115,6 +2247,53 @@ function walkFiles(dir, depth, out, base = dir) {
2115
2247
  }
2116
2248
  }
2117
2249
  }
2250
+ var TREE_SKIP_DIRS = /* @__PURE__ */ new Set([".cache", ".git", ".hg", ".svn", ".tox"]);
2251
+ var TREE_MAX_ENTRIES = 2e5;
2252
+ function yamlFilesUnder(dir, maxEntries = TREE_MAX_ENTRIES) {
2253
+ const files = [];
2254
+ const realSeen = /* @__PURE__ */ new Set();
2255
+ let entriesSeen = 0;
2256
+ let incomplete;
2257
+ const walk = (d) => {
2258
+ if (incomplete) return;
2259
+ try {
2260
+ const real = realpathSync(d);
2261
+ if (realSeen.has(real)) return;
2262
+ realSeen.add(real);
2263
+ } catch {
2264
+ incomplete = `could not be fully listed (${d})`;
2265
+ return;
2266
+ }
2267
+ let entries;
2268
+ try {
2269
+ entries = readdirSync(d, { withFileTypes: true });
2270
+ } catch {
2271
+ incomplete = `could not be fully listed (${d})`;
2272
+ return;
2273
+ }
2274
+ for (const e of entries.sort((x, y) => x.name < y.name ? -1 : x.name > y.name ? 1 : 0)) {
2275
+ if (++entriesSeen > maxEntries) {
2276
+ incomplete = `has more than ${maxEntries} entries to pre-scan`;
2277
+ return;
2278
+ }
2279
+ const p = join2(d, e.name);
2280
+ let isDirEntry = e.isDirectory();
2281
+ let isFileEntry = e.isFile();
2282
+ if (e.isSymbolicLink()) {
2283
+ isDirEntry = isDir(p);
2284
+ isFileEntry = isFile(p);
2285
+ }
2286
+ if (isDirEntry) {
2287
+ if (!TREE_SKIP_DIRS.has(e.name)) walk(p);
2288
+ } else if (isFileEntry && /\.ya?ml$/i.test(e.name)) {
2289
+ files.push(p);
2290
+ }
2291
+ if (incomplete) return;
2292
+ }
2293
+ };
2294
+ walk(dir);
2295
+ return incomplete ? { files, incomplete } : { files };
2296
+ }
2118
2297
  function readCfgStatic(dir) {
2119
2298
  const p = join2(dir, "ansible.cfg");
2120
2299
  if (!isFile(p)) return {};
@@ -2304,7 +2483,7 @@ function checkValue(label, spec, v, line, node, out) {
2304
2483
  }
2305
2484
  const choices = choicesOf(spec);
2306
2485
  const elements = type === "list" ? spec.elements ?? null : null;
2307
- const items = elements && Array.isArray(v) ? v : [v];
2486
+ const items = type === "list" && Array.isArray(v) ? v : [v];
2308
2487
  if (choices && (type !== "list" || Array.isArray(v) || typeof v !== "object")) {
2309
2488
  const list = type === "list" && typeof v === "string" ? v.split(",").map((s) => s.trim()) : items;
2310
2489
  for (const item of list) {
@@ -2312,7 +2491,7 @@ function checkValue(label, spec, v, line, node, out) {
2312
2491
  if (choices.some((c) => c === item || String(c) === String(item))) continue;
2313
2492
  if (typeof item === "boolean" && raw && isYaml11BoolWord(raw)) {
2314
2493
  out.values.push(
2315
- `${where}: unquoted ${raw} is the boolean ${item} in YAML 1.1, not one of ${choices.map(String).join("|")}; quote it ("${raw}")`
2494
+ sensitive(label, spec, item) ? `${where}: an unquoted value is a boolean in YAML 1.1, not one of ${choices.map(String).join("|")}; quote it` : `${where}: unquoted ${raw} is the boolean ${item} in YAML 1.1, not one of ${choices.map(String).join("|")}; quote it ("${raw}")`
2316
2495
  );
2317
2496
  } else {
2318
2497
  out.values.push(`${where}: ${show(item)} is not one of ${choices.map(String).join("|")}`);
@@ -2327,13 +2506,16 @@ function checkValue(label, spec, v, line, node, out) {
2327
2506
  out.values.push(`${where}: expected ${type}, got ${err}${detail}`);
2328
2507
  return;
2329
2508
  }
2509
+ const hide = sensitive(label, spec, v);
2330
2510
  if (type === "str" && typeof v === "boolean" && raw && isYaml11BoolWord(raw)) {
2331
2511
  out.values.push(
2332
- `${where}: unquoted ${raw} becomes the boolean ${v} in YAML 1.1 (Ansible passes the string '${v ? "True" : "False"}'); quote it ("${raw}")`
2512
+ hide ? `${where}: an unquoted value becomes a boolean in YAML 1.1; quote it` : `${where}: unquoted ${raw} becomes the boolean ${v} in YAML 1.1 (Ansible passes the string '${v ? "True" : "False"}'); quote it ("${raw}")`
2333
2513
  );
2334
2514
  }
2335
2515
  if (type === "str" && typeof v === "number" && /^0[0-7]+$/.test(raw)) {
2336
- out.values.push(`${where}: unquoted ${raw} is the octal integer ${v} in YAML 1.1; quote it ("${raw}")`);
2516
+ out.values.push(
2517
+ hide ? `${where}: an unquoted value is an octal integer in YAML 1.1; quote it` : `${where}: unquoted ${raw} is the octal integer ${v} in YAML 1.1; quote it ("${raw}")`
2518
+ );
2337
2519
  }
2338
2520
  if (elements && Array.isArray(v)) {
2339
2521
  const sub2 = subOptionsOf(spec);
@@ -3042,7 +3224,7 @@ function renderLint(version2, issues, stderr, maxLocations, profile) {
3042
3224
  }
3043
3225
 
3044
3226
  // src/playbook.ts
3045
- import { readdirSync as readdirSync3 } from "fs";
3227
+ import { existsSync as existsSync4, readdirSync as readdirSync3 } from "fs";
3046
3228
  import { dirname as dirname2, join as join4 } from "path";
3047
3229
  var tagList = (s) => (s ?? "").replace(/^\[|\]$/g, "").split(",").map((x) => x.trim()).filter(Boolean);
3048
3230
  function parseListOutput(text2) {
@@ -3121,35 +3303,51 @@ function firstSentence(text2) {
3121
3303
  const i = text2.search(/\.\s+(?=[A-Z])/);
3122
3304
  return (i > 0 ? text2.slice(0, i) : text2).replace(/\.$/, "");
3123
3305
  }
3124
- var LOOKUP_RE = /lookup\s*\(|query\s*\(|\bq\s*\(|\bpipe\b/;
3306
+ var LOOKUP_RE = /\b(?:lookup|query|pipe)\b/;
3307
+ var Q_RE = /\bq\b/;
3308
+ function mentionsLookup(s) {
3309
+ if (LOOKUP_RE.test(s)) return true;
3310
+ const open = s.search(/\{[{%]/);
3311
+ return open >= 0 && Q_RE.test(s.slice(open));
3312
+ }
3313
+ var PRESCAN_MAX_BYTES = 32 * 1024 * 1024;
3125
3314
  function prescanPlaybook(files, rel) {
3126
3315
  const hits = [];
3127
3316
  const seen = /* @__PURE__ */ new Set();
3128
3317
  const visit = (abs) => {
3129
3318
  if (seen.has(abs)) return;
3130
3319
  seen.add(abs);
3131
- const root = files.read(abs)?.root;
3132
- if (root?.kind !== "seq") return;
3133
3320
  const file = files.rel(abs);
3321
+ const doc = files.read(abs, PRESCAN_MAX_BYTES);
3322
+ if (!doc) {
3323
+ hits.push({ file, line: 0, play: "", field: "", unreadable: "could not be read" });
3324
+ return;
3325
+ }
3326
+ if (doc.errors.some((e) => e.startsWith(ALIAS_LIMIT_ERROR))) {
3327
+ hits.push({ file, line: 0, play: "", field: "", unreadable: `could not be fully parsed (${ALIAS_LIMIT_ERROR})` });
3328
+ return;
3329
+ }
3330
+ const root = doc.root;
3331
+ if (root?.kind !== "seq") return;
3134
3332
  for (const play of root.items) {
3135
3333
  if (play.kind !== "map") continue;
3136
3334
  const nameNode = get(play, "name");
3137
3335
  const label = nameNode?.kind === "scalar" && typeof nameNode.value === "string" ? nameNode.value : `#${play.line}`;
3138
3336
  const check = (field, node) => {
3139
3337
  for (const s of strings(node)) {
3140
- if (LOOKUP_RE.test(s.value)) hits.push({ file, line: s.line, play: label, field });
3338
+ if (mentionsLookup(s.value)) hits.push({ file, line: s.line, play: label, field });
3141
3339
  }
3142
3340
  };
3143
3341
  check("name", nameNode);
3144
3342
  check("hosts", get(play, "hosts"));
3145
3343
  check("vars_files", get(play, "vars_files"));
3146
- const imp = get(play, "import_playbook") ?? get(play, "ansible.builtin.import_playbook");
3344
+ const imp = importPlaybookEntry(play);
3147
3345
  if (imp) {
3148
3346
  check("import_playbook", imp);
3149
3347
  const target = imp.kind === "scalar" && typeof imp.value === "string" ? imp.value : null;
3150
3348
  if (target && !isTemplated(target)) {
3151
3349
  const p = join4(dirname2(abs), target);
3152
- if (isFile(p)) visit(p);
3350
+ if (existsSync4(p)) visit(p);
3153
3351
  }
3154
3352
  }
3155
3353
  }
@@ -3157,6 +3355,29 @@ function prescanPlaybook(files, rel) {
3157
3355
  visit(files.abs(rel));
3158
3356
  return hits;
3159
3357
  }
3358
+ function prescanLintTargets(files, paths, maxEntries) {
3359
+ const hits = [];
3360
+ const seen = /* @__PURE__ */ new Set();
3361
+ const scanFile = (abs) => {
3362
+ if (seen.has(abs)) return;
3363
+ seen.add(abs);
3364
+ const doc = files.read(abs, PRESCAN_MAX_BYTES);
3365
+ if (doc && !doc.errors.some((e) => e.startsWith(ALIAS_LIMIT_ERROR)) && !isPlaybookLike(doc.root)) return;
3366
+ hits.push(...prescanPlaybook(files, abs));
3367
+ };
3368
+ for (const p of paths) {
3369
+ if (isDir(p)) {
3370
+ const walk = yamlFilesUnder(p, maxEntries);
3371
+ if (walk.incomplete) {
3372
+ hits.push({ file: files.rel(p), line: 0, play: "", field: "", unreadable: walk.incomplete });
3373
+ }
3374
+ for (const abs of walk.files) scanFile(abs);
3375
+ } else if (existsSync4(p)) {
3376
+ scanFile(p);
3377
+ }
3378
+ }
3379
+ return hits;
3380
+ }
3160
3381
  function strings(node) {
3161
3382
  if (!node) return [];
3162
3383
  if (node.kind === "scalar") return typeof node.value === "string" ? [{ value: node.value, line: node.line }] : [];
@@ -3165,7 +3386,7 @@ function strings(node) {
3165
3386
  }
3166
3387
  function prescanRefusal(hits) {
3167
3388
  const lines = hits.map(
3168
- (h) => `${h.file}:${h.line} play '${h.play}' has a lookup in '${h.field}'; Ansible would run it on this machine while parsing. Not run.`
3389
+ (h) => h.unreadable ? `${h.file} ${h.unreadable} for the lookup pre-scan; Ansible would parse it. Not run.` : `${h.file}:${h.line} play '${h.play}' has a lookup in '${h.field}'; Ansible would run it on this machine while parsing. Not run.`
3169
3390
  );
3170
3391
  lines.push("Set ANSIBLE_MCP_ALLOW_PLAY_LOOKUPS=1 to allow.");
3171
3392
  return lines.join("\n");
@@ -3287,7 +3508,7 @@ function optionLines(opts, depth, descLen, defaults, warnings, ep, prefix) {
3287
3508
  const flags = [];
3288
3509
  if (o.required) flags.push("[required]");
3289
3510
  if (o.default !== void 0 && o.default !== null)
3290
- flags.push(o.no_log ? "[default: (no_log)]" : `[default: ${JSON.stringify(o.default)}]`);
3511
+ flags.push(o.no_log ? "[default: (no_log)]" : `[default: ${redactStandalone(o.default, name)}]`);
3291
3512
  const ch = choicesOf(o);
3292
3513
  if (ch) flags.push(`[choices: ${ch.map(String).join("|")}]`);
3293
3514
  if (o.no_log) flags.push("[no_log]");
@@ -3327,13 +3548,16 @@ function renderRole(r) {
3327
3548
  if (defaults) {
3328
3549
  const noLog = /* @__PURE__ */ new Set();
3329
3550
  const documented = /* @__PURE__ */ new Set();
3551
+ const red = new Redactor();
3330
3552
  for (const e of Object.values(specs)) {
3331
3553
  for (const [k, o] of Object.entries(e.options ?? {})) {
3332
3554
  documented.add(k);
3333
3555
  if (o.no_log) noLog.add(k);
3556
+ if (o.default === void 0 || o.default === null) continue;
3557
+ if (!o.no_log) red.learn(o.default, [k]);
3558
+ else if (typeof o.default === "string") red.addSecret(o.default);
3334
3559
  }
3335
3560
  }
3336
- const red = new Redactor();
3337
3561
  for (const [k, v] of Object.entries(defaults.values)) {
3338
3562
  if (noLog.has(k)) {
3339
3563
  if (typeof v === "string") red.addSecret(v);
@@ -3389,6 +3613,7 @@ function refuseDash(param, v) {
3389
3613
  function assertRelative(ctx, p, rel, what) {
3390
3614
  ctx.runner.assertLocal(rel);
3391
3615
  refuseDash(what, rel);
3616
+ refuseDash(what, normalize(rel.trim()));
3392
3617
  const abs = /^[A-Za-z]:[\\/]|^\//.test(rel) ? rel : join6(p.dir, rel);
3393
3618
  ctx.runner.assertLocal(abs);
3394
3619
  return abs;
@@ -3688,9 +3913,10 @@ async function roleInterface(ctx, x) {
3688
3913
  let specs = null;
3689
3914
  let source = "meta/argument_specs.yml";
3690
3915
  if (ctx.runner.available()) {
3916
+ const base = roleDir.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
3917
+ refuseDash("role", base);
3691
3918
  try {
3692
3919
  const sideParent = await ctx.runner.toSide(dirname3(roleDir));
3693
- const base = roleDir.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
3694
3920
  const r = await ctx.runSafe(p, "ansible-doc", ["--json", "-t", "role", "-r", sideParent, base]);
3695
3921
  if (r.code === 0) {
3696
3922
  specs = roleSpecsFromDocJson(r.stdout, base)?.specs ?? null;
@@ -3757,11 +3983,6 @@ ${redactText(graph.stderr.trim()).slice(0, 2048)}`
3757
3983
  for (const s of sources) bases.set(isDir(s) ? s : dirname3(s), "");
3758
3984
  bases.set(p.dir, "");
3759
3985
  const files = new ProjectFiles(p.dir);
3760
- const fb = renderVarsFilesFallback(
3761
- [...bases.keys()].map((b) => ({ base: b, label: files.rel(b) })),
3762
- (abs) => files.rel(abs),
3763
- red
3764
- );
3765
3986
  const env = { ANSIBLE_VARS_ENABLED: "none" };
3766
3987
  const r = await ctx.runSafe(
3767
3988
  p,
@@ -3771,23 +3992,32 @@ ${redactText(graph.stderr.trim()).slice(0, 2048)}`
3771
3992
  env
3772
3993
  }
3773
3994
  );
3774
- const out = [
3775
- `degraded: group_vars/host_vars merged by Ansible are unavailable because ${fb.vaulted.join(", ") || "a vars file"} ${fb.vaulted.length === 1 ? "is a whole-file vault" : "are whole-file vaults"} (ansible-mcp never supplies vault secrets); showing per-file contents instead, without precedence.`
3776
- ];
3995
+ let hv = null;
3777
3996
  if (r.code === 0) {
3778
3997
  try {
3779
3998
  const data = JSON.parse(r.stdout);
3780
- const hv = host ? { [host]: data } : data?._meta?.hostvars ?? {};
3999
+ hv = host ? { [host]: data } : data?._meta?.hostvars ?? {};
3781
4000
  learnAll(red, hv);
3782
- out.push("inventory-file vars only:");
3783
- for (const [h, vars] of Object.entries(hv)) {
3784
- if (varsMode === "names") out.push(` ${h}: ${Object.keys(vars).sort().join(" ") || "(none)"}`);
3785
- else {
3786
- out.push(` ${h}:`);
3787
- out.push(...renderHostVars(vars, red, " "));
3788
- }
3789
- }
3790
4001
  } catch {
4002
+ hv = null;
4003
+ }
4004
+ }
4005
+ const fb = renderVarsFilesFallback(
4006
+ [...bases.keys()].map((b) => ({ base: b, label: files.rel(b) })),
4007
+ (abs) => files.rel(abs),
4008
+ red
4009
+ );
4010
+ const out = [
4011
+ `degraded: group_vars/host_vars merged by Ansible are unavailable because ${fb.vaulted.join(", ") || "a vars file"} ${fb.vaulted.length === 1 ? "is a whole-file vault" : "are whole-file vaults"} (ansible-mcp never supplies vault secrets); showing per-file contents instead, without precedence.`
4012
+ ];
4013
+ if (hv) {
4014
+ out.push("inventory-file vars only:");
4015
+ for (const [h, vars] of Object.entries(hv)) {
4016
+ if (varsMode === "names") out.push(` ${h}: ${Object.keys(vars).sort().join(" ") || "(none)"}`);
4017
+ else {
4018
+ out.push(` ${h}:`);
4019
+ out.push(...renderHostVars(vars, red, " "));
4020
+ }
3791
4021
  }
3792
4022
  }
3793
4023
  out.push("group_vars / host_vars files:");
@@ -4025,15 +4255,24 @@ async function lintSummary(ctx, x) {
4025
4255
  if (x.profile && !PROFILES.includes(x.profile)) return `profile must be one of ${PROFILES.join(", ")}`;
4026
4256
  const p = await ctx.project(x.dir);
4027
4257
  const files = new ProjectFiles(p.dir);
4028
- const targets = (x.paths ?? []).map((rel) => {
4029
- const abs = assertRelative(ctx, p, rel, "paths");
4030
- return files.rel(abs);
4031
- });
4032
- const playbooks = targets.length ? targets.filter((t) => isPlaybookRoot(files.read(join6(p.dir, t))?.root ?? null)) : detectProject(p.dir).playbooks.map((pb) => pb.rel);
4033
- const hits = playbooks.flatMap((pb) => prescanPlaybook(files, pb));
4258
+ const targetAbs = (x.paths ?? []).map((rel) => assertRelative(ctx, p, rel, "paths"));
4259
+ const hits = prescanLintTargets(files, targetAbs.length ? targetAbs : [p.dir]);
4034
4260
  if (hits.length && !ctx.allowPlayLookups) return prescanRefusal(hits);
4035
4261
  ctx.runner.assertAvailable();
4036
- const args = ["--offline", "-f", "codeclimate", ...x.profile ? ["--profile", x.profile] : [], ...targets];
4262
+ const targets = [];
4263
+ for (const a of targetAbs) {
4264
+ const rel = files.rel(a);
4265
+ const target = rel === a.replace(/\\/g, "/") ? await ctx.runner.toSide(a) : rel;
4266
+ refuseDash("paths", target);
4267
+ targets.push(target);
4268
+ }
4269
+ const args = [
4270
+ "--offline",
4271
+ "-f",
4272
+ "codeclimate",
4273
+ ...x.profile ? ["--profile", x.profile] : [],
4274
+ ...targets.length ? ["--", ...targets] : []
4275
+ ];
4037
4276
  const [r, v] = await Promise.all([
4038
4277
  ctx.runSafe(p, "ansible-lint", args),
4039
4278
  ctx.quietEnv().then((env) => ctx.runner.run("ansible-lint", ["--version", "--offline"], { env })).catch(() => null)
@@ -4068,7 +4307,18 @@ function routingFor(rt, type, fqcn, collection) {
4068
4307
  const short = fqcn.startsWith(`${collection}.`) ? fqcn.slice(collection.length + 1) : fqcn;
4069
4308
  return t[short] ?? t[fqcn];
4070
4309
  }
4071
- var fmtDefault2 = (v) => typeof v === "string" ? `'${v}'` : JSON.stringify(v ?? null);
4310
+ function fmtDefault(v, name, noLog) {
4311
+ if (noLog) return NO_LOG;
4312
+ const r = redactStandalone(v ?? null, name);
4313
+ if (r.startsWith('"')) {
4314
+ try {
4315
+ const s = JSON.parse(r);
4316
+ if (typeof s === "string") return `'${s}'`;
4317
+ } catch {
4318
+ }
4319
+ }
4320
+ return r;
4321
+ }
4072
4322
  var fmtChoiceValue = (v) => typeof v === "string" ? v : JSON.stringify(v);
4073
4323
  function sensitive2(label, spec, v) {
4074
4324
  return spec.no_log === true || isSecretKey(label) || typeof v === "string" && hasSecretShape(v);
@@ -4150,7 +4400,12 @@ function diffOptions(inst, targ, args, prefix, push) {
4150
4400
  const dI = specI.default ?? null;
4151
4401
  const dT = specT.default ?? null;
4152
4402
  if (JSON.stringify(dI) !== JSON.stringify(dT)) {
4153
- push("BEHAVIOR CHANGE", `${prefix}${name} not set; default ${fmtDefault2(dI)} -> ${fmtDefault2(dT)}`, 7);
4403
+ const noLog = specI.no_log === true || specT.no_log === true;
4404
+ push(
4405
+ "BEHAVIOR CHANGE",
4406
+ `${prefix}${name} not set; default ${fmtDefault(dI, name, noLog)} -> ${fmtDefault(dT, name, noLog)}`,
4407
+ 7
4408
+ );
4154
4409
  }
4155
4410
  }
4156
4411
  }
@@ -4210,7 +4465,7 @@ function renderUpgrade(r) {
4210
4465
  lines.push(
4211
4466
  `upgrade ${r.collection} ${r.installedVersion} -> ${r.targetVersion} (${bumpKind(r.installedVersion, r.targetVersion)}${down}) for ${r.dirLabel}`
4212
4467
  );
4213
- const req = r.requiresAnsible ? `requires_ansible '${r.requiresAnsible}' ${r.requiresOk ? "ok" : "NOT satisfied"} (ansible-core ${r.core})` : "requires_ansible not declared";
4468
+ const req = !r.requiresAnsible ? "requires_ansible not declared" : r.requiresOk === void 0 ? `requires_ansible '${r.requiresAnsible}' could not evaluate (${r.requiresError ?? "unparseable"}; ansible-core ${r.core})` : `requires_ansible '${r.requiresAnsible}' ${r.requiresOk ? "ok" : "NOT satisfied"} (ansible-core ${r.core})`;
4214
4469
  lines.push(
4215
4470
  `target: ${req}; dependencies: ${r.dependencies.length ? r.dependencies.join(", ") : "none"}; ${r.cacheNote}`
4216
4471
  );
@@ -4266,6 +4521,8 @@ function renderUpgrade(r) {
4266
4521
  else verdict = "NO IMPACT on used modules";
4267
4522
  if (r.requiresAnsible && r.requiresOk === false) {
4268
4523
  verdict = `BLOCKED (requires_ansible '${r.requiresAnsible}' excludes ansible-core ${r.core})${verdict.startsWith("BREAKING") ? `; also ${verdict}` : ""}`;
4524
+ } else if (r.requiresAnsible && r.requiresOk === void 0) {
4525
+ verdict += "; requires_ansible not checked";
4269
4526
  }
4270
4527
  lines.push(`verdict: ${verdict}`);
4271
4528
  return lines.join("\n");
@@ -4354,6 +4611,7 @@ async function ensureTarget(ctx, p, collection, version2) {
4354
4611
  if (hit && hit.collection_info?.version === version2) return { dir: target, downloaded: false, manifest: hit };
4355
4612
  await ctx.runner.sideMkdirp(base);
4356
4613
  const tmp = ctx.runner.sideJoin(base, `.tmp-${version2}-${randomBytes2(4).toString("hex")}`);
4614
+ let stale;
4357
4615
  try {
4358
4616
  const r = await ctx.runSafe(
4359
4617
  p,
@@ -4371,16 +4629,22 @@ async function ensureTarget(ctx, p, collection, version2) {
4371
4629
  if (!m || m.collection_info?.version !== version2) {
4372
4630
  throw new Error(`ansible-galaxy installed ${collection} but MANIFEST.json does not say ${version2}.`);
4373
4631
  }
4374
- if (!await ctx.runner.sideRename(tmp, target)) {
4375
- const winner = await readManifest(ctx, target, collection);
4376
- if (!winner)
4377
- throw new Error(`could not move the downloaded ${collection} ${version2} into the cache at ${target}.`);
4378
- return { dir: target, downloaded: true, manifest: winner };
4632
+ if (await ctx.runner.sideRename(tmp, target)) return { dir: target, downloaded: true, manifest: m };
4633
+ const winner = await readManifest(ctx, target, collection);
4634
+ if (winner?.collection_info?.version === version2) return { dir: target, downloaded: true, manifest: winner };
4635
+ const aside = ctx.runner.sideJoin(base, `.tmp-stale-${randomBytes2(4).toString("hex")}`);
4636
+ if (await ctx.runner.sideRename(target, aside)) stale = aside;
4637
+ if (!stale || !await ctx.runner.sideRename(tmp, target)) {
4638
+ throw new Error(
4639
+ `could not move the downloaded ${collection} ${version2} into the cache at ${target} (it holds ${winner ? `a tree that says ${winner.collection_info?.version ?? "no version"}` : "no MANIFEST.json"}); remove that directory and retry.`
4640
+ );
4379
4641
  }
4380
4642
  return { dir: target, downloaded: true, manifest: m };
4381
4643
  } finally {
4382
4644
  await ctx.runner.sideRemoveTemp(tmp, root).catch(() => {
4383
4645
  });
4646
+ if (stale) await ctx.runner.sideRemoveTemp(stale, root).catch(() => {
4647
+ });
4384
4648
  }
4385
4649
  }
4386
4650
  function sweepStaleTempDirs(cacheDir, now = Date.now()) {
@@ -4436,7 +4700,7 @@ async function runUpgrade(ctx, x) {
4436
4700
  if (listRes.code !== 0)
4437
4701
  throw new Error(
4438
4702
  `ansible-galaxy collection list failed (exit ${listRes.code}):
4439
- ${listRes.stderr.trim().slice(0, 2048)}`
4703
+ ${redactText(listRes.stderr.trim()).slice(0, 2048)}`
4440
4704
  );
4441
4705
  const installedAll = byCollection(parseCollectionList(listRes.stdout), collectionsPaths);
4442
4706
  const eff = installedAll.get(collection)?.[0];
@@ -4559,11 +4823,13 @@ ${listRes.stderr.trim().slice(0, 2048)}`
4559
4823
  }
4560
4824
  );
4561
4825
  let requiresOk;
4826
+ let requiresError;
4562
4827
  if (targetRuntime.requiresAnsible) {
4563
4828
  try {
4564
4829
  requiresOk = satisfies(ver.core.replace(/[^\d.].*$/, ""), targetRuntime.requiresAnsible);
4565
- } catch {
4830
+ } catch (e) {
4566
4831
  requiresOk = void 0;
4832
+ requiresError = e instanceof Error ? e.message : String(e);
4567
4833
  }
4568
4834
  }
4569
4835
  const reqFiles = det.requirements.map((f) => {
@@ -4610,7 +4876,7 @@ ${listRes.stderr.trim().slice(0, 2048)}`
4610
4876
  targetVersion: version2,
4611
4877
  dirLabel: p.dir,
4612
4878
  core: ver.core,
4613
- ...targetRuntime.requiresAnsible ? { requiresAnsible: targetRuntime.requiresAnsible, requiresOk } : {},
4879
+ ...targetRuntime.requiresAnsible ? { requiresAnsible: targetRuntime.requiresAnsible, requiresOk, ...requiresError ? { requiresError } : {} } : {},
4614
4880
  dependencies: deps,
4615
4881
  cacheNote,
4616
4882
  constraints,
@@ -4899,6 +5165,7 @@ async function startServer() {
4899
5165
  await server.connect(transport);
4900
5166
  }
4901
5167
  export {
5168
+ ALIAS_LIMIT_ERROR,
4902
5169
  AnsibleContext,
4903
5170
  AnsibleRunner,
4904
5171
  BAD_TYPE_MESSAGE,
@@ -4909,6 +5176,7 @@ export {
4909
5176
  DRVFS_NOTE,
4910
5177
  EXACT_VERSION_RE,
4911
5178
  GALAXY_REDACTED,
5179
+ IMPORT_PLAYBOOK_KEYS,
4912
5180
  INSTRUCTIONS,
4913
5181
  MAX_TIMEOUT_MS,
4914
5182
  NATIVE_WINDOWS_MESSAGE,
@@ -4961,10 +5229,13 @@ export {
4961
5229
  groupsOf,
4962
5230
  hasSecretShape,
4963
5231
  hostMissing,
5232
+ importPlaybookEntry,
5233
+ isCheckRawAction,
4964
5234
  isDir,
4965
5235
  isFile,
4966
5236
  isFreeForm,
4967
5237
  isPlainTemplateRef,
5238
+ isPlaybookLike,
4968
5239
  isPlaybookRoot,
4969
5240
  isPluginType,
4970
5241
  isSecretKey,
@@ -4982,6 +5253,7 @@ export {
4982
5253
  maskInlineCredentials,
4983
5254
  maskUrlPasswords,
4984
5255
  maskedSecretValues,
5256
+ mentionsLookup,
4985
5257
  missingBinaryPath,
4986
5258
  mountRootFromWslpath,
4987
5259
  nodeSpawner,
@@ -5004,11 +5276,13 @@ export {
5004
5276
  parseWslUnc,
5005
5277
  parseYaml,
5006
5278
  prefixDistro,
5279
+ prescanLintTargets,
5007
5280
  prescanPlaybook,
5008
5281
  prescanRefusal,
5009
5282
  readCfgStatic,
5010
5283
  readDefaults,
5011
5284
  readExecConfig,
5285
+ redactStandalone,
5012
5286
  redactText,
5013
5287
  relativeTo,
5014
5288
  renderChecks,
@@ -5055,5 +5329,6 @@ export {
5055
5329
  walkPlaybooks,
5056
5330
  winToWsl,
5057
5331
  wslToWin,
5058
- yaml11Choices
5332
+ yaml11Choices,
5333
+ yamlFilesUnder
5059
5334
  };