@atlaskit/ads-cli 0.5.0 → 0.6.0
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/CHANGELOG.md +22 -0
- package/README.md +62 -10
- package/dist/cjs/cli.js +300 -58
- package/dist/cjs/commands/definitions.js +84 -0
- package/dist/cjs/output/format-human-result.js +33 -0
- package/dist/cjs/output/write-human-result.js +8 -10
- package/dist/es2019/cli.js +208 -16
- package/dist/es2019/commands/definitions.js +69 -0
- package/dist/es2019/output/format-human-result.js +28 -0
- package/dist/es2019/output/write-human-result.js +8 -9
- package/dist/esm/cli.js +300 -58
- package/dist/esm/commands/definitions.js +84 -0
- package/dist/esm/output/format-human-result.js +27 -0
- package/dist/esm/output/write-human-result.js +8 -9
- package/dist/types/commands/types.d.ts +16 -0
- package/dist/types/output/format-human-result.d.ts +17 -0
- package/dist/types/output/write-human-result.d.ts +2 -2
- package/dist/types/parse-args.d.ts +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,11 @@ export type CommandInput = {
|
|
|
17
17
|
* Parsed `--flag` values (numbers, strings, booleans, or repeated string arrays).
|
|
18
18
|
*/
|
|
19
19
|
flags: Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Original argv for commands whose grammar needs token boundaries that generic flag parsing
|
|
22
|
+
* intentionally discards (currently the batch command's repeated `--command` boundaries).
|
|
23
|
+
*/
|
|
24
|
+
rawArgs?: string[];
|
|
20
25
|
};
|
|
21
26
|
/**
|
|
22
27
|
* A documented positional argument for a command, surfaced by `manifest`.
|
|
@@ -55,6 +60,12 @@ export type ToolCall = {
|
|
|
55
60
|
handlerName: string;
|
|
56
61
|
args?: unknown;
|
|
57
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* One independently-addressed command invocation in a composite batch.
|
|
65
|
+
*/
|
|
66
|
+
export type BatchRequest = {
|
|
67
|
+
argv: string[];
|
|
68
|
+
};
|
|
58
69
|
/**
|
|
59
70
|
* The successful result of resolving a command: one or more ADS MCP tool calls.
|
|
60
71
|
*
|
|
@@ -67,6 +78,11 @@ export type ToolCall = {
|
|
|
67
78
|
export type ResolvedCommand = {
|
|
68
79
|
tools: ToolCall[];
|
|
69
80
|
grouped?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* When present, each request is executed through the command registry inside the current
|
|
83
|
+
* process. Its existing envelope and rendering semantics are preserved independently.
|
|
84
|
+
*/
|
|
85
|
+
batch?: BatchRequest[];
|
|
70
86
|
meta?: Record<string, unknown>;
|
|
71
87
|
};
|
|
72
88
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic last-resort human formatting for a successful command result.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Render a successful result with the generic last-resort formatting, used when a command
|
|
6
|
+
* declares neither a compact result kind nor its own `formatHuman`.
|
|
7
|
+
*
|
|
8
|
+
* Structured data is pretty-printed as JSON (the underlying tools already return rich objects),
|
|
9
|
+
* while plain-string payloads such as guideline markdown are returned verbatim.
|
|
10
|
+
*
|
|
11
|
+
* Kept separate from the writer so callers that compose text rather than write it — notably
|
|
12
|
+
* `batch`, which concatenates one section per child — produce byte-identical output without
|
|
13
|
+
* duplicating these rules.
|
|
14
|
+
*/
|
|
15
|
+
export declare const formatHumanResult: ({ data }: {
|
|
16
|
+
data: unknown;
|
|
17
|
+
}) => string;
|
|
@@ -5,8 +5,8 @@ import type { Writer } from './writer';
|
|
|
5
5
|
/**
|
|
6
6
|
* Emit a human-readable rendering of a successful result to stdout.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* An absent payload is a diagnostic rather than data, so it goes to stderr to keep stdout clean
|
|
9
|
+
* for piping.
|
|
10
10
|
*/
|
|
11
11
|
export declare const writeHumanResult: ({ data, writer }: {
|
|
12
12
|
data: unknown;
|
|
@@ -18,7 +18,7 @@ export type ParsedArgs = {
|
|
|
18
18
|
*/
|
|
19
19
|
positionals: string[];
|
|
20
20
|
/**
|
|
21
|
-
* Parsed flags. Values may be string
|
|
21
|
+
* Parsed flags. Values may be a string (including number-like strings) or a boolean.
|
|
22
22
|
*/
|
|
23
23
|
flags: Record<string, unknown>;
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/ads-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "An npx-runnable command-line tool to query Atlassian Design System (ADS) structured content — components, tokens, icons, and guidelines — from the terminal.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|