zinkee 0.1.43 → 0.1.45

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 (94) hide show
  1. package/README.md +9 -4
  2. package/dist/chunk-MHEVRMDX.js +1230 -0
  3. package/dist/chunk-MHEVRMDX.js.map +1 -0
  4. package/{src/utils/examples.ts → dist/examples-E6FFEVBE.js} +856 -1141
  5. package/dist/examples-E6FFEVBE.js.map +1 -0
  6. package/dist/index.js +1145 -8456
  7. package/dist/index.js.map +1 -1
  8. package/package.json +6 -3
  9. package/.github/workflows/npm-publish.yml +0 -77
  10. package/.github/workflows/pr-checks.yml +0 -36
  11. package/AGENTS.md +0 -110
  12. package/docs/cli-contract.md +0 -41
  13. package/docs/npm-release.md +0 -64
  14. package/docs/superpowers/plans/2026-03-24-zinkee-cli-implementation.md +0 -837
  15. package/docs/superpowers/plans/2026-03-25-cli-backend-error-contract.md +0 -503
  16. package/docs/superpowers/plans/2026-03-26-display-freeform-create.md +0 -389
  17. package/docs/superpowers/specs/2026-03-24-zinkee-cli-backend-blockers.md +0 -172
  18. package/docs/superpowers/specs/2026-03-24-zinkee-cli-design.md +0 -1576
  19. package/docs/superpowers/specs/2026-03-24-zinkee-cli-e2e-checklist.md +0 -215
  20. package/docs/superpowers/specs/2026-03-24-zinkee-cli-e2e-design.md +0 -492
  21. package/docs/superpowers/specs/2026-03-24-zinkee-cli-e2e-status.md +0 -307
  22. package/docs/superpowers/specs/2026-07-30-cli-pr-checks-design.md +0 -37
  23. package/src/api/automations.ts +0 -404
  24. package/src/api/comments.ts +0 -51
  25. package/src/api/displays.ts +0 -337
  26. package/src/api/document-templates.ts +0 -110
  27. package/src/api/files.ts +0 -50
  28. package/src/api/formulas.test.ts +0 -65
  29. package/src/api/formulas.ts +0 -67
  30. package/src/api/logs.ts +0 -34
  31. package/src/api/navigation.ts +0 -70
  32. package/src/api/records.ts +0 -184
  33. package/src/api/schemas.ts +0 -148
  34. package/src/api/teamspace.ts +0 -110
  35. package/src/cli-examples.ts +0 -130
  36. package/src/cli-runner.ts +0 -95
  37. package/src/client.test.ts +0 -189
  38. package/src/client.ts +0 -269
  39. package/src/command-registry.ts +0 -882
  40. package/src/commands/automations.test.ts +0 -1030
  41. package/src/commands/automations.ts +0 -2102
  42. package/src/commands/comments.test.ts +0 -214
  43. package/src/commands/comments.ts +0 -303
  44. package/src/commands/config.test.ts +0 -81
  45. package/src/commands/config.ts +0 -150
  46. package/src/commands/displays.test.ts +0 -1105
  47. package/src/commands/displays.ts +0 -1442
  48. package/src/commands/document-templates.test.ts +0 -569
  49. package/src/commands/document-templates.ts +0 -563
  50. package/src/commands/files.test.ts +0 -284
  51. package/src/commands/files.ts +0 -280
  52. package/src/commands/formulas.test.ts +0 -194
  53. package/src/commands/formulas.ts +0 -243
  54. package/src/commands/logs.test.ts +0 -123
  55. package/src/commands/logs.ts +0 -159
  56. package/src/commands/navigation.test.ts +0 -211
  57. package/src/commands/navigation.ts +0 -348
  58. package/src/commands/profiles.test.ts +0 -191
  59. package/src/commands/profiles.ts +0 -303
  60. package/src/commands/records.test.ts +0 -860
  61. package/src/commands/records.ts +0 -883
  62. package/src/commands/schemas.test.ts +0 -1252
  63. package/src/commands/schemas.ts +0 -890
  64. package/src/commands/teamspace.test.ts +0 -229
  65. package/src/commands/teamspace.ts +0 -546
  66. package/src/completion/engine.test.ts +0 -138
  67. package/src/completion/engine.ts +0 -168
  68. package/src/completion/install.test.ts +0 -179
  69. package/src/completion/install.ts +0 -260
  70. package/src/completion/runtime.ts +0 -150
  71. package/src/completion/scripts.ts +0 -91
  72. package/src/config.test.ts +0 -362
  73. package/src/config.ts +0 -294
  74. package/src/index.test.ts +0 -217
  75. package/src/index.ts +0 -8
  76. package/src/parsers/expressions.test.ts +0 -95
  77. package/src/parsers/expressions.ts +0 -128
  78. package/src/parsers/kv.test.ts +0 -35
  79. package/src/parsers/kv.ts +0 -49
  80. package/src/parsers/selectors.test.ts +0 -23
  81. package/src/parsers/selectors.ts +0 -29
  82. package/src/program.ts +0 -64
  83. package/src/runtime-context.ts +0 -103
  84. package/src/types.ts +0 -76
  85. package/src/utils/argv-rewrite.test.ts +0 -149
  86. package/src/utils/argv-rewrite.ts +0 -269
  87. package/src/utils/errors.test.ts +0 -85
  88. package/src/utils/errors.ts +0 -191
  89. package/src/utils/examples.test.ts +0 -374
  90. package/src/utils/output.test.ts +0 -65
  91. package/src/utils/output.ts +0 -154
  92. package/src/utils/schema-fields.ts +0 -1016
  93. package/tsconfig.json +0 -20
  94. package/tsup.config.ts +0 -13
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "zinkee",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "CLI for Zinkee API v2",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/Zinkee-Engineering/cli.git"
7
+ "url": "git+https://github.com/Zinkee-Engineering/z2.git",
8
+ "directory": "cli"
8
9
  },
10
+ "files": ["dist"],
9
11
  "type": "module",
10
12
  "bin": {
11
13
  "zinkee": "dist/index.js"
@@ -18,7 +20,8 @@
18
20
  "dev": "tsx src/index.ts",
19
21
  "test": "vitest run",
20
22
  "test:watch": "vitest",
21
- "typecheck": "tsc --noEmit"
23
+ "typecheck": "tsc --noEmit",
24
+ "benchmark": "node scripts/benchmark.mjs"
22
25
  },
23
26
  "dependencies": {
24
27
  "chalk": "^5.6.2",
@@ -1,77 +0,0 @@
1
- name: Publish to npm
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: read
10
- id-token: write
11
-
12
- jobs:
13
- publish:
14
- name: Publish package
15
- runs-on: ubuntu-latest
16
-
17
- steps:
18
- - name: Checkout repository
19
- uses: actions/checkout@v6
20
-
21
- - name: Set up Node.js
22
- uses: actions/setup-node@v6
23
- with:
24
- node-version: 24
25
- registry-url: https://registry.npmjs.org
26
- package-manager-cache: false
27
-
28
- - name: Check package version
29
- id: version
30
- shell: bash
31
- run: |
32
- package_name="$(node -p "require('./package.json').name")"
33
- package_version="$(node -p "require('./package.json').version")"
34
-
35
- set +e
36
- lookup_output="$(npm view "${package_name}@${package_version}" version 2>&1)"
37
- lookup_status=$?
38
- set -e
39
-
40
- if [ "$lookup_status" -eq 0 ]; then
41
- echo "${package_name}@${package_version} is already published; skipping."
42
- echo "already-published=true" >> "$GITHUB_OUTPUT"
43
- elif echo "$lookup_output" | grep -q "E404"; then
44
- echo "${package_name}@${package_version} is not published yet."
45
- echo "already-published=false" >> "$GITHUB_OUTPUT"
46
- else
47
- echo "$lookup_output" >&2
48
- exit "$lookup_status"
49
- fi
50
-
51
- - name: Set up trusted publishing
52
- if: steps.version.outputs.already-published == 'false'
53
- run: npm install --global npm@11.5.1
54
-
55
- - name: Install dependencies
56
- if: steps.version.outputs.already-published == 'false'
57
- run: npm ci
58
-
59
- - name: Run tests
60
- if: steps.version.outputs.already-published == 'false'
61
- run: npm test
62
-
63
- - name: Run typecheck
64
- if: steps.version.outputs.already-published == 'false'
65
- run: npm run typecheck
66
-
67
- - name: Build project
68
- if: steps.version.outputs.already-published == 'false'
69
- run: npm run build
70
-
71
- - name: Inspect package contents
72
- if: steps.version.outputs.already-published == 'false'
73
- run: npm pack --dry-run
74
-
75
- - name: Publish package
76
- if: steps.version.outputs.already-published == 'false'
77
- run: npm publish --access public
@@ -1,36 +0,0 @@
1
- name: PR Checks
2
-
3
- on:
4
- pull_request:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- validate:
13
- name: Test, Typecheck, and Build
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - name: Checkout repository
18
- uses: actions/checkout@v4
19
-
20
- - name: Set up Node.js
21
- uses: actions/setup-node@v4
22
- with:
23
- node-version: 24
24
- cache: npm
25
-
26
- - name: Install dependencies
27
- run: npm ci
28
-
29
- - name: Run tests
30
- run: npm test
31
-
32
- - name: Run typecheck
33
- run: npm run typecheck
34
-
35
- - name: Build project
36
- run: npm run build
package/AGENTS.md DELETED
@@ -1,110 +0,0 @@
1
- # Zinkee CLI Notes
2
-
3
- This repository contains a TypeScript ESM CLI for Zinkee API v2.
4
-
5
- ## Source Of Truth
6
-
7
- Use this order when reasoning about behavior:
8
-
9
- 1. live command registration in `src/index.ts`
10
- 2. command modules in `src/commands`
11
- 3. docs in `README.md`
12
-
13
- ## Key Runtime Rules
14
-
15
- - Existing config compatibility is mandatory: `~/.config/zinkee/config.toml`
16
- - Runtime env compatibility is mandatory for agentic/backend use:
17
- - `ZINKEE_PROFILE`
18
- - `ZINKEE_API_BASE_URL`
19
- - `ZINKEE_API_KEY`
20
- - `--read-only` must block write/destructive commands before network calls
21
- - `--example <command path>` should return concrete usage examples without running the command
22
- - `--json` must keep stdout machine-readable
23
- - success JSON shape is `{ data, meta }`
24
- - error JSON shape is `{ error, meta }`
25
-
26
- ## Current Command Groups
27
-
28
- - `profiles`
29
- - `config`
30
- - `files`
31
- - `schemas`
32
- - `records`
33
- - `comments`
34
- - `logs`
35
- - `navigation`
36
- - `teamspace`
37
- - `displays`
38
- - `automations`
39
- - `document-templates`
40
- - `formulas`
41
-
42
- ## Implementation Shape
43
-
44
- - REST transport lives in `src/api`
45
- - commander commands live in `src/commands`
46
- - shared config/runtime lives in `src/config.ts` and `src/runtime-context.ts`
47
- - JSON/table output helpers live in `src/utils/output.ts`
48
- - shared CLI error handling lives in `src/utils/errors.ts`
49
- - parsers live in `src/parsers`
50
- - shell completion (engine, scripts, install, runtime) lives in `src/completion`
51
-
52
- ## API Examples (`--example`)
53
-
54
- - `--example` output comes 100% from hand-written `src/utils/examples.ts`
55
- (`specificExamples`, keyed by command path e.g. `"schemas update"`). No
56
- codegen, no OpenAPI import.
57
- - These MIRROR the swagger `@ExampleObject`s in the `z2-backend` repo
58
- (`api/src/main/java/com/zinkee/api/infra/web/v2/ApiV2<Resource>Documentation.java`).
59
- When you add/change an example on either side, update the other with the same
60
- payload (request `raw` and `response`). Nothing keeps them in sync
61
- automatically.
62
- - Keep `response` shapes aligned with the backend DTO field order (e.g.
63
- `SchemaV2ResourceResponse`: `… commentable, highlightedField, fields`).
64
-
65
- ## Testing
66
-
67
- Prefer focused command tests and parser/client unit tests.
68
-
69
- > **Unit tests use `fetchMock` and never hit the real API.** When changing the
70
- > shape of a payload (enum values, property names, structure), unit tests will
71
- > still pass even if the real API would reject the request with `400`. For
72
- > shape-sensitive changes — especially edits to strings in `src/utils/examples.ts`
73
- > — also run the resulting command against a real workspace and confirm the API
74
- > accepts it.
75
-
76
- ## Contributing
77
-
78
- ### Branches
79
-
80
- - `feature/eng-<ticket>-<slug>` for Linear-tracked work
81
- - `fix/<slug>` / `chore/<slug>` / `docs/<slug>` for untracked work
82
- - Never push to `main` directly; always open a PR
83
-
84
- ### Commits
85
-
86
- - Conventional Commits format: `<type>(<scope>): <subject>` (e.g.
87
- `fix(displays): correct chart-type values in widget examples`)
88
- - Subject in imperative mood, under ~72 chars, no trailing period
89
- - Body explains the *why*, not the *what* — the diff already shows what changed
90
- - Stage files explicitly (`git add <path>`); never `git add -A`
91
- - Don't add `Co-Authored-By:` trailers; existing history doesn't use them
92
-
93
- ### Before committing
94
-
95
- 1. `npm run typecheck` — must pass
96
- 2. `npm test` — must pass
97
- 3. For changes that affect runtime behaviour or `--example` output, also
98
- exercise the affected commands against a live workspace (see Testing note
99
- above).
100
-
101
- ### Versioning
102
-
103
- - Versioning is patch-only today (`0.1.x`). Bump the patch number unless the
104
- team decides to move to a different scheme.
105
- - If an agent determines that a PR requires a new published version, it must
106
- bump the version in `package.json` in that same PR and keep
107
- `package-lock.json` in sync. User-visible changes (new commands, fixed
108
- examples, behaviour changes) always require this.
109
- - Before bumping, fetch `origin/main` to make sure the version you pick isn't
110
- already taken by another PR that merged ahead of yours.
@@ -1,41 +0,0 @@
1
- # CLI Contract
2
-
3
- This file is a quick reference for the implemented CLI surface.
4
-
5
- ## Global Flags
6
-
7
- - `--profile <name>`
8
- - `--base-url <url>`
9
- - `--api-key <token>`
10
- - `--read-only`
11
- - `--example <command path>`
12
- - `--json`
13
-
14
- ## Command Groups
15
-
16
- - `profiles`
17
- - `config`
18
- - `files`
19
- - `schemas`
20
- - `records`
21
- - `comments`
22
- - `navigation`
23
- - `teamspace`
24
- - `displays`
25
- - `automations`
26
-
27
- ## Current Conventions
28
-
29
- - selectors are UUID-or-slug where the domain supports it
30
- - `records` writes use `--set`, `--set-json`, `--unset`, `--raw`, `--raw-file`
31
- - `comments create` is text-first with raw fallback
32
- - `files download --json` requires `--output`
33
- - `widgets` and `automation actions` are generic and type-driven via `--type`
34
-
35
- ## Verification Commands
36
-
37
- ```bash
38
- npm run build
39
- npm run typecheck
40
- npm test
41
- ```
@@ -1,64 +0,0 @@
1
- # Publish to npm
2
-
3
- The `Publish to npm` GitHub Actions workflow publishes new CLI versions when
4
- they reach `main`. It uses npm trusted publishing with GitHub OIDC, so the
5
- repository does not need an `NPM_TOKEN`.
6
-
7
- ## One-time npm configuration
8
-
9
- Configure the `zinkee` package on npmjs.com with this trusted publisher:
10
-
11
- - Provider: GitHub Actions
12
- - Organization: `Zinkee-Engineering`
13
- - Repository: `cli`
14
- - Workflow filename: `npm-publish.yml`
15
- - Environment: empty
16
- - Allowed action: `npm publish`
17
-
18
- Enter only the workflow filename, not `.github/workflows/npm-publish.yml`.
19
-
20
- ## Release flow
21
-
22
- Every pull request that ships a user-visible change must update the package
23
- version. For a patch release, run:
24
-
25
- ```bash
26
- npm version patch --no-git-tag-version
27
- ```
28
-
29
- This updates `package.json` and `package-lock.json` without creating a commit or
30
- tag. Include both files in the feature pull request and run:
31
-
32
- ```bash
33
- npm ci
34
- npm test
35
- npm run typecheck
36
- npm run build
37
- npm pack --dry-run
38
- ```
39
-
40
- After the pull request is merged, `.github/workflows/npm-publish.yml`:
41
-
42
- 1. Checks whether the package version already exists on npm.
43
- 2. Skips the publish successfully when the version already exists.
44
- 3. Runs the full quality gate for a new version.
45
- 4. Publishes the package with `npm publish --access public`.
46
-
47
- ## Verification
48
-
49
- Check the workflow run and the published version:
50
-
51
- ```bash
52
- gh run list --workflow npm-publish.yml
53
- npm view zinkee version
54
- ```
55
-
56
- Optionally install the published version and exercise the CLI:
57
-
58
- ```bash
59
- npm install -g zinkee@latest
60
- zinkee --help
61
- ```
62
-
63
- Do not create another version bump after a failed publish unless npm confirms
64
- that the failed version was already published.