@atlaskit/ads-cli 0.11.0 → 0.12.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +27 -9
  2. package/README.md +115 -19
  3. package/dist/cjs/atlas-cli.js +74 -11
  4. package/dist/cjs/commands/run-tool.js +1 -1
  5. package/dist/cjs/fetch-atlas-version-policy.js +68 -0
  6. package/dist/cjs/get-atlas-release-version.js +9 -0
  7. package/dist/cjs/get-atlas-version-policy.js +135 -0
  8. package/dist/cjs/is-atlas-release-outdated.js +13 -0
  9. package/dist/cjs/output/format-token.js +5 -2
  10. package/dist/cjs/parse-atlas-release-build.js +18 -0
  11. package/dist/cjs/types.js +1 -1
  12. package/dist/es2019/atlas-cli.js +51 -2
  13. package/dist/es2019/commands/run-tool.js +1 -1
  14. package/dist/es2019/fetch-atlas-version-policy.js +56 -0
  15. package/dist/es2019/get-atlas-release-version.js +1 -0
  16. package/dist/es2019/get-atlas-version-policy.js +86 -0
  17. package/dist/es2019/is-atlas-release-outdated.js +7 -0
  18. package/dist/es2019/output/format-token.js +5 -2
  19. package/dist/es2019/parse-atlas-release-build.js +12 -0
  20. package/dist/es2019/types.js +1 -1
  21. package/dist/esm/atlas-cli.js +74 -11
  22. package/dist/esm/commands/run-tool.js +1 -1
  23. package/dist/esm/fetch-atlas-version-policy.js +62 -0
  24. package/dist/esm/get-atlas-release-version.js +3 -0
  25. package/dist/esm/get-atlas-version-policy.js +128 -0
  26. package/dist/esm/is-atlas-release-outdated.js +7 -0
  27. package/dist/esm/output/format-token.js +5 -2
  28. package/dist/esm/parse-atlas-release-build.js +12 -0
  29. package/dist/esm/types.js +1 -1
  30. package/dist/types/atlas-cli.d.ts +2 -2
  31. package/dist/types/commands/run-tool.d.ts +1 -1
  32. package/dist/types/envelope/types.d.ts +4 -4
  33. package/dist/types/fetch-atlas-version-policy.d.ts +4 -0
  34. package/dist/types/get-atlas-release-version.d.ts +1 -0
  35. package/dist/types/get-atlas-version-policy.d.ts +9 -0
  36. package/dist/types/is-atlas-release-outdated.d.ts +1 -0
  37. package/dist/types/parse-atlas-release-build.d.ts +5 -0
  38. package/dist/types/types.d.ts +1 -1
  39. package/package.json +13 -8
@@ -28,7 +28,7 @@ export type UnwrappedToolResult = {
28
28
  * Invoke an ADS MCP tool handler and unwrap its result into plain data.
29
29
  *
30
30
  * @param handler - The tool function (e.g. `searchComponentsTool`).
31
- * @param args - The arguments object matching the tool's zod input schema, or `undefined`
31
+ * @param args - The arguments object matching the tool's input shape, or `undefined`
32
32
  * for zero-argument tools such as `getAllComponentsTool`.
33
33
  */
34
34
  export declare const runTool: ({ handler, args, }: {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Types for the stable JSON envelope emitted when the CLI is run with `--json`.
3
3
  *
4
- * Agents (and a future `atlas ads` plugin) consume this shape, so it must stay stable and
4
+ * Agents and the `atlas ads` plugin consume this shape, so it must stay stable and
5
5
  * self-describing. Every envelope carries a `type` discriminator (`ads-cli/<command>` for
6
6
  * success, `ads-cli/error` for failures) so consumers can branch without re-parsing.
7
7
  */
@@ -42,10 +42,10 @@ export type SuccessEnvelope<Data = unknown> = {
42
42
  /**
43
43
  * Machine-readable error codes used inside {@link ErrorEnvelope}.
44
44
  *
45
- * These mirror the process exit codes but are surfaced as strings so JSON consumers do not
46
- * depend on numeric codes.
45
+ * These identify failure types without relying on numeric process exit codes. Different error
46
+ * codes can share an exit code, such as RUNTIME_ERROR and UPGRADE_REQUIRED both exiting with 1.
47
47
  */
48
- export type EnvelopeErrorCode = 'USAGE_ERROR' | 'NOT_FOUND' | 'RUNTIME_ERROR';
48
+ export type EnvelopeErrorCode = 'USAGE_ERROR' | 'NOT_FOUND' | 'RUNTIME_ERROR' | 'UPGRADE_REQUIRED';
49
49
  /**
50
50
  * Failure envelope. Emitted (with `--json`) when a command cannot complete.
51
51
  */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A bounded, unauthenticated read of the ADS-owned policy; failures leave the CLI usable.
3
+ */
4
+ export declare const fetchAtlasVersionPolicy: () => Promise<unknown>;
@@ -0,0 +1 @@
1
+ export declare const getAtlasReleaseVersion: () => string | undefined;
@@ -0,0 +1,9 @@
1
+ export type AtlasVersionPolicy = {
2
+ enabled: boolean;
3
+ minimumVersion?: string;
4
+ recommendedVersion?: string;
5
+ };
6
+ /**
7
+ * Share a 24-hour policy cache across Atlas invocations, including disabled and failed checks.
8
+ */
9
+ export declare const getAtlasVersionPolicy: () => Promise<AtlasVersionPolicy | undefined>;
@@ -0,0 +1 @@
1
+ export declare const isAtlasReleaseOutdated: (installed: string | undefined, minimum: string | undefined) => boolean;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * ADS releases use <Bitbucket build number>-<8-character commit SHA>. The build number
3
+ * increases with each pipeline run; the SHA identifies the source but does not affect ordering.
4
+ */
5
+ export declare const parseAtlasReleaseBuild: (version: unknown) => number | undefined;
@@ -25,7 +25,7 @@ export type ToolResult = {
25
25
  /**
26
26
  * Any ADS MCP tool handler: takes an optional arguments object and resolves to a
27
27
  * {@link ToolResult}. Kept intentionally loose (`unknown` args) because each tool has its
28
- * own zod input schema; the registry is responsible for building well-formed args.
28
+ * own input type and schema; the registry is responsible for building well-formed args.
29
29
  */
30
30
  export type ToolHandler = (args?: unknown) => Promise<ToolResult>;
31
31
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/ads-cli",
3
- "version": "0.11.0",
3
+ "version": "0.12.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",
@@ -18,26 +18,31 @@
18
18
  "bin": "./bin/ads-cli.js",
19
19
  "scripts": {
20
20
  "start": "./bin/ads-cli.js",
21
- "build:atlas": "esbuild src/atlas-cli.tsx --bundle --outfile=build/atlas/ads-cli.js --format=cjs --platform=node --target=node18",
21
+ "build:atlas": "run-ts scripts/atlas/build-atlas.tsx",
22
22
  "package:atlas:darwin-amd64": "pkg --public --public-packages '*' --compress GZip --target node18-macos-x64 --output build/atlas/ads-darwin-amd64 build/atlas/ads-cli.js",
23
23
  "package:atlas:darwin-arm64": "pkg --public --public-packages '*' --compress GZip --target node18-macos-arm64 --output build/atlas/ads-darwin-arm64 build/atlas/ads-cli.js",
24
24
  "package:atlas:linux-amd64": "pkg --public --public-packages '*' --compress GZip --target node18-linux-x64 --output build/atlas/ads-linux-amd64 build/atlas/ads-cli.js",
25
25
  "package:atlas:linux-arm64": "pkg --public --public-packages '*' --compress GZip --target node18-linux-arm64 --output build/atlas/ads-linux-arm64 build/atlas/ads-cli.js",
26
26
  "package:atlas:windows-amd64": "pkg --public --public-packages '*' --compress GZip --target node18-win-x64 --output build/atlas/ads-windows-amd64.exe build/atlas/ads-cli.js",
27
27
  "package:atlas": "afm run build:atlas && afm run package:atlas:darwin-amd64 && afm run package:atlas:darwin-arm64 && afm run package:atlas:linux-amd64 && afm run package:atlas:linux-arm64 && afm run package:atlas:windows-amd64",
28
- "release:atlas:fetch-manifest": "bash scripts/atlas/fetch-manifest.sh",
29
- "release:atlas:prepare": "bash scripts/atlas/prepare-release.sh",
30
- "release:atlas:upload": "bash scripts/atlas/upload-release.sh",
31
- "release:atlas:promote": "bash scripts/atlas/promote-stable.sh"
28
+ "release:atlas:fetch-manifest": "run-ts scripts/atlas/fetch-manifest.tsx",
29
+ "release:atlas:prepare": "run-ts scripts/atlas/prepare-release.tsx",
30
+ "release:atlas:upload": "run-ts scripts/atlas/upload-release.tsx",
31
+ "release:atlas:promote": "run-ts scripts/atlas/promote-stable.tsx",
32
+ "release:atlas": "run-ts scripts/atlas/release-and-promote.tsx",
33
+ "release:atlas:policy": "run-ts scripts/atlas/publish-version-policy.tsx"
32
34
  },
33
35
  "dependencies": {
34
- "@atlaskit/ads-mcp": "^1.10.0",
36
+ "@atlaskit/ads-mcp": "^1.12.0",
35
37
  "@atlaskit/cli-output": "^0.1.0",
36
38
  "@babel/runtime": "^7.0.0",
37
- "chalk": "^4.1.2"
39
+ "chalk": "^4.1.2",
40
+ "file-system-cache": "^2.4.4"
38
41
  },
39
42
  "devDependencies": {
43
+ "@atlaskit/docs": "^12.3.0",
40
44
  "@atlassian/ts-loader": "^0.1.0",
45
+ "@iarna/toml": "^2.2.5",
41
46
  "esbuild": "^0.15.18",
42
47
  "pkg": "5.8.1"
43
48
  }