aui-agent-builder 0.3.122 → 0.3.123
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/README.md +62 -0
- package/dist/api-client/apollo-client.d.ts +62 -0
- package/dist/api-client/apollo-client.d.ts.map +1 -1
- package/dist/api-client/apollo-client.js +18 -0
- package/dist/api-client/apollo-client.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +22 -4
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/integration-test.d.ts +77 -0
- package/dist/commands/integration-test.d.ts.map +1 -0
- package/dist/commands/integration-test.js +207 -0
- package/dist/commands/integration-test.js.map +1 -0
- package/dist/index.js +115 -8
- package/dist/index.js.map +1 -1
- package/dist/utils/help-json.d.ts +44 -0
- package/dist/utils/help-json.d.ts.map +1 -0
- package/dist/utils/help-json.js +62 -0
- package/dist/utils/help-json.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-json.d.ts","sourceRoot":"","sources":["../../src/utils/help-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iEAAiE;IACjE,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAcD,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAgC9D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAWT"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize a Commander `Command` tree into a plain JSON-friendly shape.
|
|
3
|
+
*
|
|
4
|
+
* Powers `aui --help --json` (and `aui <command> --help --json`): instead of
|
|
5
|
+
* the human-formatted help text, emit a structured description of every
|
|
6
|
+
* command, its arguments, options, and nested subcommands. This is intended
|
|
7
|
+
* for tooling and coding agents (Claude/Cursor) that want to discover the
|
|
8
|
+
* full CLI surface programmatically.
|
|
9
|
+
*/
|
|
10
|
+
function serializeOption(o) {
|
|
11
|
+
return {
|
|
12
|
+
flags: o.flags,
|
|
13
|
+
description: o.description || "",
|
|
14
|
+
default: o.defaultValue,
|
|
15
|
+
// These describe whether the option *takes* a required or optional value
|
|
16
|
+
// (Commander semantics), NOT whether the option itself is mandatory.
|
|
17
|
+
takesRequiredValue: !!o.required,
|
|
18
|
+
takesOptionalValue: !!o.optional,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Recursively serialize a command and all of its subcommands. */
|
|
22
|
+
export function serializeCommand(cmd) {
|
|
23
|
+
// Commander 12 exposes positional args via `registeredArguments`; fall back
|
|
24
|
+
// to the older `_args` for resilience across minor versions.
|
|
25
|
+
const cmdAny = cmd;
|
|
26
|
+
const args = (cmdAny.registeredArguments ?? cmdAny._args ?? []);
|
|
27
|
+
return {
|
|
28
|
+
name: cmd.name(),
|
|
29
|
+
aliases: cmd.aliases(),
|
|
30
|
+
description: cmd.description() || "",
|
|
31
|
+
usage: cmd.usage(),
|
|
32
|
+
arguments: args.map((a) => ({
|
|
33
|
+
name: typeof a.name === "function" ? a.name() : a._name || "",
|
|
34
|
+
description: a.description || "",
|
|
35
|
+
required: !!a.required,
|
|
36
|
+
variadic: !!a.variadic,
|
|
37
|
+
})),
|
|
38
|
+
options: cmd.options.map(serializeOption),
|
|
39
|
+
commands: cmd.commands
|
|
40
|
+
// Skip Commander's auto-generated `help` subcommand — it's noise.
|
|
41
|
+
.filter((c) => c.name() !== "help")
|
|
42
|
+
.map(serializeCommand),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Walk into the command tree following the non-flag tokens in argv, returning
|
|
47
|
+
* the deepest command that matches (so `aui integration test --help --json`
|
|
48
|
+
* scopes the output to the `test` command). Falls back to `root`.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveCommandFromArgv(root, argv) {
|
|
51
|
+
let target = root;
|
|
52
|
+
for (const tok of argv) {
|
|
53
|
+
if (tok.startsWith("-"))
|
|
54
|
+
continue;
|
|
55
|
+
const sub = target.commands.find((c) => c.name() === tok || c.aliases().includes(tok));
|
|
56
|
+
if (!sub)
|
|
57
|
+
break;
|
|
58
|
+
target = sub;
|
|
59
|
+
}
|
|
60
|
+
return target;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=help-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-json.js","sourceRoot":"","sources":["../../src/utils/help-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgCH,SAAS,eAAe,CAAC,CAAS;IAChC,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE;QAChC,OAAO,EAAE,CAAC,CAAC,YAAY;QACvB,yEAAyE;QACzE,qEAA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