zinkee 0.1.44 → 0.1.46

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 +4 -0
  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-67U5IRBS.js} +866 -1141
  5. package/dist/examples-67U5IRBS.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
@@ -1,150 +0,0 @@
1
- import type { Writable } from "node:stream";
2
-
3
- import { Command } from "commander";
4
-
5
- import {
6
- defaultConfigPath,
7
- readConfig,
8
- redactConfig,
9
- resolveProfile,
10
- } from "../config.js";
11
- import { CliError } from "../utils/errors.js";
12
- import { buildJsonSuccess, printTable } from "../utils/output.js";
13
-
14
- interface CommandIo {
15
- write(chunk: string): unknown;
16
- }
17
-
18
- export interface RegisterConfigCommandsOptions {
19
- configPath?: string;
20
- stdout?: CommandIo;
21
- }
22
-
23
- interface GlobalOptions {
24
- json?: boolean;
25
- }
26
-
27
- function getCommandIo(stdout: CommandIo | undefined): CommandIo {
28
- return stdout ?? (process.stdout as Writable);
29
- }
30
-
31
- function writeLine(stdout: CommandIo, value: string): void {
32
- stdout.write(`${value}\n`);
33
- }
34
-
35
- function getGlobalOptions(command: Command): GlobalOptions {
36
- return command.optsWithGlobals<GlobalOptions>();
37
- }
38
-
39
- function emitJson(
40
- stdout: CommandIo,
41
- commandName: string,
42
- data: unknown,
43
- configPath: string,
44
- ): void {
45
- writeLine(
46
- stdout,
47
- JSON.stringify(buildJsonSuccess(data, { command: commandName, configPath })),
48
- );
49
- }
50
-
51
- function toConfigurationError(filePath: string, error: unknown): never {
52
- if (error instanceof CliError) {
53
- throw error;
54
- }
55
-
56
- if (
57
- typeof error === "object" &&
58
- error !== null &&
59
- "code" in error &&
60
- error.code === "ENOENT"
61
- ) {
62
- throw new CliError("configuration_error", `Config file not found at ${filePath}.`);
63
- }
64
-
65
- if (error instanceof Error) {
66
- throw new CliError("configuration_error", error.message);
67
- }
68
-
69
- throw error;
70
- }
71
-
72
- export function registerConfigCommands(
73
- program: Command,
74
- options: RegisterConfigCommandsOptions = {},
75
- ): void {
76
- const filePath = options.configPath ?? defaultConfigPath;
77
- const stdout = getCommandIo(options.stdout);
78
- const config = program.command("config").description("Inspect local CLI config");
79
-
80
- config
81
- .command("path")
82
- .description("Show the effective config file path")
83
- .action(function action(this: Command) {
84
- const data = { path: filePath };
85
-
86
- if (getGlobalOptions(this).json) {
87
- emitJson(stdout, "config path", data, filePath);
88
- return;
89
- }
90
-
91
- writeLine(stdout, filePath);
92
- });
93
-
94
- config
95
- .command("show")
96
- .description("Show the local config with secrets redacted")
97
- .action(function action(this: Command) {
98
- try {
99
- const data = redactConfig(readConfig(filePath));
100
-
101
- if (getGlobalOptions(this).json) {
102
- emitJson(stdout, "config show", data, filePath);
103
- return;
104
- }
105
-
106
- writeLine(stdout, `Default profile: ${data.defaultProfile ?? "(none)"}`);
107
- printTable(
108
- Object.entries(data.profiles).map(([name, profile]) => ({
109
- name,
110
- default: data.defaultProfile === name ? "yes" : "",
111
- baseUrl:
112
- typeof profile.baseUrl === "string"
113
- ? profile.baseUrl
114
- : "",
115
- apiKey:
116
- typeof profile.apiKey === "string"
117
- ? profile.apiKey
118
- : "",
119
- })),
120
- ["name", "default", "baseUrl", "apiKey"],
121
- stdout,
122
- );
123
- } catch (error) {
124
- toConfigurationError(filePath, error);
125
- }
126
- });
127
-
128
- config
129
- .command("validate")
130
- .description("Validate that the local config can resolve a profile")
131
- .action(function action(this: Command) {
132
- try {
133
- const parsed = readConfig(filePath);
134
- const profile = resolveProfile(parsed);
135
- const data = {
136
- valid: true,
137
- profile: profile.name,
138
- };
139
-
140
- if (getGlobalOptions(this).json) {
141
- emitJson(stdout, "config validate", data, filePath);
142
- return;
143
- }
144
-
145
- writeLine(stdout, `Config is valid. Resolved profile "${profile.name}".`);
146
- } catch (error) {
147
- toConfigurationError(filePath, error);
148
- }
149
- });
150
- }