@invinite-org/invinite-data-cli 0.4.0 → 0.5.1

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 (84) hide show
  1. package/README.md +90 -802
  2. package/claude-plugin/agents/invinite-data.md +1 -1
  3. package/claude-plugin/commands/analyze-earnings-call.md +3 -3
  4. package/claude-plugin/skills/invinite-data-cli/SKILL.md +444 -187
  5. package/dist/src/cli.d.ts +6 -0
  6. package/dist/src/cli.js +21 -31
  7. package/dist/src/cli.js.map +1 -1
  8. package/dist/src/client/api-client.d.ts +2 -4
  9. package/dist/src/client/api-client.js +15 -15
  10. package/dist/src/client/api-client.js.map +1 -1
  11. package/dist/src/client/pagination.d.ts +23 -0
  12. package/dist/src/client/pagination.js +76 -7
  13. package/dist/src/client/pagination.js.map +1 -1
  14. package/dist/src/commands/earnings.d.ts +0 -3
  15. package/dist/src/commands/earnings.js +46 -524
  16. package/dist/src/commands/earnings.js.map +1 -1
  17. package/dist/src/generated/cli-manifest.json +4983 -0
  18. package/dist/src/hand-written-commands.d.ts +43 -0
  19. package/dist/src/hand-written-commands.js +21 -0
  20. package/dist/src/hand-written-commands.js.map +1 -0
  21. package/dist/src/shared/errors.d.ts +12 -1
  22. package/dist/src/shared/errors.js +27 -1
  23. package/dist/src/shared/errors.js.map +1 -1
  24. package/dist/src/shared/options.d.ts +0 -13
  25. package/dist/src/shared/options.js +0 -13
  26. package/dist/src/shared/options.js.map +1 -1
  27. package/dist/src/spec-commands.d.ts +10 -0
  28. package/dist/src/spec-commands.js +224 -0
  29. package/dist/src/spec-commands.js.map +1 -0
  30. package/dist/src/spec-flags.d.ts +6 -0
  31. package/dist/src/spec-flags.js +9 -0
  32. package/dist/src/spec-flags.js.map +1 -0
  33. package/dist/src/spec-manifest.d.ts +382 -0
  34. package/dist/src/spec-manifest.js +65 -0
  35. package/dist/src/spec-manifest.js.map +1 -0
  36. package/package.json +7 -3
  37. package/dist/src/commands/company.d.ts +0 -2
  38. package/dist/src/commands/company.js +0 -220
  39. package/dist/src/commands/company.js.map +0 -1
  40. package/dist/src/commands/earnings-selector.d.ts +0 -15
  41. package/dist/src/commands/earnings-selector.js +0 -29
  42. package/dist/src/commands/earnings-selector.js.map +0 -1
  43. package/dist/src/commands/filings.d.ts +0 -2
  44. package/dist/src/commands/filings.js +0 -139
  45. package/dist/src/commands/filings.js.map +0 -1
  46. package/dist/src/commands/financials.d.ts +0 -2
  47. package/dist/src/commands/financials.js +0 -162
  48. package/dist/src/commands/financials.js.map +0 -1
  49. package/dist/src/commands/health.d.ts +0 -2
  50. package/dist/src/commands/health.js +0 -18
  51. package/dist/src/commands/health.js.map +0 -1
  52. package/dist/src/commands/insider-trades.d.ts +0 -2
  53. package/dist/src/commands/insider-trades.js +0 -56
  54. package/dist/src/commands/insider-trades.js.map +0 -1
  55. package/dist/src/commands/ipos.d.ts +0 -2
  56. package/dist/src/commands/ipos.js +0 -42
  57. package/dist/src/commands/ipos.js.map +0 -1
  58. package/dist/src/commands/market.d.ts +0 -2
  59. package/dist/src/commands/market.js +0 -34
  60. package/dist/src/commands/market.js.map +0 -1
  61. package/dist/src/commands/metadata.d.ts +0 -2
  62. package/dist/src/commands/metadata.js +0 -39
  63. package/dist/src/commands/metadata.js.map +0 -1
  64. package/dist/src/commands/metrics.d.ts +0 -2
  65. package/dist/src/commands/metrics.js +0 -158
  66. package/dist/src/commands/metrics.js.map +0 -1
  67. package/dist/src/commands/ownership.d.ts +0 -2
  68. package/dist/src/commands/ownership.js +0 -152
  69. package/dist/src/commands/ownership.js.map +0 -1
  70. package/dist/src/commands/segments.d.ts +0 -2
  71. package/dist/src/commands/segments.js +0 -64
  72. package/dist/src/commands/segments.js.map +0 -1
  73. package/dist/src/commands/usage.d.ts +0 -38
  74. package/dist/src/commands/usage.js +0 -82
  75. package/dist/src/commands/usage.js.map +0 -1
  76. package/dist/src/commands/webhooks.d.ts +0 -16
  77. package/dist/src/commands/webhooks.js +0 -186
  78. package/dist/src/commands/webhooks.js.map +0 -1
  79. package/dist/src/formatters/sparkline.d.ts +0 -2
  80. package/dist/src/formatters/sparkline.js +0 -11
  81. package/dist/src/formatters/sparkline.js.map +0 -1
  82. package/dist/src/formatters/tree-formatter.d.ts +0 -11
  83. package/dist/src/formatters/tree-formatter.js +0 -30
  84. package/dist/src/formatters/tree-formatter.js.map +0 -1
@@ -0,0 +1,382 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The compact, committed form of the Data API spec that `invd` registers its generated commands from
4
+ * (`src/generated/cli-manifest.json`, written by `scripts/build-cli-manifest.ts` from `openapi.json`'s `x-cli`).
5
+ * One schema for the builder's output, the startup loader and the dispatcher.
6
+ */
7
+ export declare const MANIFEST_PARAM_TYPES: readonly ["string", "integer", "number", "boolean", "array"];
8
+ export declare const MANIFEST_ITEM_TYPES: readonly ["string", "integer", "number"];
9
+ export declare const MANIFEST_METHODS: readonly ["get", "post", "put", "patch", "delete"];
10
+ export declare const MANIFEST_VIEWS: readonly ["table", "keyValue", "json"];
11
+ export declare const MANIFEST_PAGINATIONS: readonly ["none", "top", "perCompany"];
12
+ declare const manifestParamSchema: z.ZodObject<{
13
+ name: z.ZodString;
14
+ in: z.ZodEnum<["query", "path"]>;
15
+ required: z.ZodBoolean;
16
+ type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
17
+ /** Arrays only: the item type; the value is sent as a repeated parameter. */
18
+ items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
19
+ /** Allowed values, stringified; on an array they apply to each item. */
20
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
21
+ /** Shown in help, never sent — the API applies its own default. */
22
+ default: z.ZodOptional<z.ZodUnknown>;
23
+ description: z.ZodOptional<z.ZodString>;
24
+ /** One-letter short flag (`-q`). */
25
+ alias: z.ZodOptional<z.ZodString>;
26
+ }, "strict", z.ZodTypeAny, {
27
+ type: "string" | "number" | "boolean" | "array" | "integer";
28
+ name: string;
29
+ required: boolean;
30
+ in: "path" | "query";
31
+ default?: unknown;
32
+ description?: string | undefined;
33
+ enum?: string[] | undefined;
34
+ items?: "string" | "number" | "integer" | undefined;
35
+ alias?: string | undefined;
36
+ }, {
37
+ type: "string" | "number" | "boolean" | "array" | "integer";
38
+ name: string;
39
+ required: boolean;
40
+ in: "path" | "query";
41
+ default?: unknown;
42
+ description?: string | undefined;
43
+ enum?: string[] | undefined;
44
+ items?: "string" | "number" | "integer" | undefined;
45
+ alias?: string | undefined;
46
+ }>;
47
+ declare const manifestOperationSchema: z.ZodObject<{
48
+ operationId: z.ZodString;
49
+ group: z.ZodString;
50
+ /** `""` = the group itself is the command (`invd health`). */
51
+ action: z.ZodString;
52
+ method: z.ZodEnum<["get", "post", "put", "patch", "delete"]>;
53
+ path: z.ZodString;
54
+ /** `false` = the operation needs no API key (`security: []` or none in the spec): no key is resolved or sent. */
55
+ auth: z.ZodBoolean;
56
+ summary: z.ZodString;
57
+ params: z.ZodArray<z.ZodObject<{
58
+ name: z.ZodString;
59
+ in: z.ZodEnum<["query", "path"]>;
60
+ required: z.ZodBoolean;
61
+ type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
62
+ /** Arrays only: the item type; the value is sent as a repeated parameter. */
63
+ items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
64
+ /** Allowed values, stringified; on an array they apply to each item. */
65
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
66
+ /** Shown in help, never sent — the API applies its own default. */
67
+ default: z.ZodOptional<z.ZodUnknown>;
68
+ description: z.ZodOptional<z.ZodString>;
69
+ /** One-letter short flag (`-q`). */
70
+ alias: z.ZodOptional<z.ZodString>;
71
+ }, "strict", z.ZodTypeAny, {
72
+ type: "string" | "number" | "boolean" | "array" | "integer";
73
+ name: string;
74
+ required: boolean;
75
+ in: "path" | "query";
76
+ default?: unknown;
77
+ description?: string | undefined;
78
+ enum?: string[] | undefined;
79
+ items?: "string" | "number" | "integer" | undefined;
80
+ alias?: string | undefined;
81
+ }, {
82
+ type: "string" | "number" | "boolean" | "array" | "integer";
83
+ name: string;
84
+ required: boolean;
85
+ in: "path" | "query";
86
+ default?: unknown;
87
+ description?: string | undefined;
88
+ enum?: string[] | undefined;
89
+ items?: "string" | "number" | "integer" | undefined;
90
+ alias?: string | undefined;
91
+ }>, "many">;
92
+ body: z.ZodOptional<z.ZodObject<{
93
+ required: z.ZodBoolean;
94
+ contentType: z.ZodLiteral<"application/json">;
95
+ }, "strict", z.ZodTypeAny, {
96
+ required: boolean;
97
+ contentType: "application/json";
98
+ }, {
99
+ required: boolean;
100
+ contentType: "application/json";
101
+ }>>;
102
+ view: z.ZodEnum<["table", "keyValue", "json"]>;
103
+ /** Dotted path to the table's rows, or to the ONE object a `keyValue` view shows (absent = the response root). */
104
+ rowsPath: z.ZodOptional<z.ZodString>;
105
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
+ pagination: z.ZodEnum<["none", "top", "perCompany"]>;
107
+ /**
108
+ * The arrays `--all` concatenates: top-level paths for `top` (default: `[rowsPath]`), paths under `companies[]`
109
+ * for `perCompany`. Absent on `none`.
110
+ */
111
+ allItemsPath: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
112
+ }, "strict", z.ZodTypeAny, {
113
+ params: {
114
+ type: "string" | "number" | "boolean" | "array" | "integer";
115
+ name: string;
116
+ required: boolean;
117
+ in: "path" | "query";
118
+ default?: unknown;
119
+ description?: string | undefined;
120
+ enum?: string[] | undefined;
121
+ items?: "string" | "number" | "integer" | undefined;
122
+ alias?: string | undefined;
123
+ }[];
124
+ method: "get" | "post" | "put" | "patch" | "delete";
125
+ path: string;
126
+ operationId: string;
127
+ group: string;
128
+ action: string;
129
+ auth: boolean;
130
+ summary: string;
131
+ view: "json" | "table" | "keyValue";
132
+ pagination: "none" | "top" | "perCompany";
133
+ body?: {
134
+ required: boolean;
135
+ contentType: "application/json";
136
+ } | undefined;
137
+ rowsPath?: string | undefined;
138
+ columns?: string[] | undefined;
139
+ allItemsPath?: string[] | undefined;
140
+ }, {
141
+ params: {
142
+ type: "string" | "number" | "boolean" | "array" | "integer";
143
+ name: string;
144
+ required: boolean;
145
+ in: "path" | "query";
146
+ default?: unknown;
147
+ description?: string | undefined;
148
+ enum?: string[] | undefined;
149
+ items?: "string" | "number" | "integer" | undefined;
150
+ alias?: string | undefined;
151
+ }[];
152
+ method: "get" | "post" | "put" | "patch" | "delete";
153
+ path: string;
154
+ operationId: string;
155
+ group: string;
156
+ action: string;
157
+ auth: boolean;
158
+ summary: string;
159
+ view: "json" | "table" | "keyValue";
160
+ pagination: "none" | "top" | "perCompany";
161
+ body?: {
162
+ required: boolean;
163
+ contentType: "application/json";
164
+ } | undefined;
165
+ rowsPath?: string | undefined;
166
+ columns?: string[] | undefined;
167
+ allItemsPath?: string[] | undefined;
168
+ }>;
169
+ export declare const manifestSchema: z.ZodObject<{
170
+ specVersion: z.ZodString;
171
+ specSha256: z.ZodString;
172
+ groups: z.ZodArray<z.ZodObject<{
173
+ name: z.ZodString;
174
+ description: z.ZodString;
175
+ }, "strict", z.ZodTypeAny, {
176
+ description: string;
177
+ name: string;
178
+ }, {
179
+ description: string;
180
+ name: string;
181
+ }>, "many">;
182
+ operations: z.ZodArray<z.ZodObject<{
183
+ operationId: z.ZodString;
184
+ group: z.ZodString;
185
+ /** `""` = the group itself is the command (`invd health`). */
186
+ action: z.ZodString;
187
+ method: z.ZodEnum<["get", "post", "put", "patch", "delete"]>;
188
+ path: z.ZodString;
189
+ /** `false` = the operation needs no API key (`security: []` or none in the spec): no key is resolved or sent. */
190
+ auth: z.ZodBoolean;
191
+ summary: z.ZodString;
192
+ params: z.ZodArray<z.ZodObject<{
193
+ name: z.ZodString;
194
+ in: z.ZodEnum<["query", "path"]>;
195
+ required: z.ZodBoolean;
196
+ type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
197
+ /** Arrays only: the item type; the value is sent as a repeated parameter. */
198
+ items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
199
+ /** Allowed values, stringified; on an array they apply to each item. */
200
+ enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
201
+ /** Shown in help, never sent — the API applies its own default. */
202
+ default: z.ZodOptional<z.ZodUnknown>;
203
+ description: z.ZodOptional<z.ZodString>;
204
+ /** One-letter short flag (`-q`). */
205
+ alias: z.ZodOptional<z.ZodString>;
206
+ }, "strict", z.ZodTypeAny, {
207
+ type: "string" | "number" | "boolean" | "array" | "integer";
208
+ name: string;
209
+ required: boolean;
210
+ in: "path" | "query";
211
+ default?: unknown;
212
+ description?: string | undefined;
213
+ enum?: string[] | undefined;
214
+ items?: "string" | "number" | "integer" | undefined;
215
+ alias?: string | undefined;
216
+ }, {
217
+ type: "string" | "number" | "boolean" | "array" | "integer";
218
+ name: string;
219
+ required: boolean;
220
+ in: "path" | "query";
221
+ default?: unknown;
222
+ description?: string | undefined;
223
+ enum?: string[] | undefined;
224
+ items?: "string" | "number" | "integer" | undefined;
225
+ alias?: string | undefined;
226
+ }>, "many">;
227
+ body: z.ZodOptional<z.ZodObject<{
228
+ required: z.ZodBoolean;
229
+ contentType: z.ZodLiteral<"application/json">;
230
+ }, "strict", z.ZodTypeAny, {
231
+ required: boolean;
232
+ contentType: "application/json";
233
+ }, {
234
+ required: boolean;
235
+ contentType: "application/json";
236
+ }>>;
237
+ view: z.ZodEnum<["table", "keyValue", "json"]>;
238
+ /** Dotted path to the table's rows, or to the ONE object a `keyValue` view shows (absent = the response root). */
239
+ rowsPath: z.ZodOptional<z.ZodString>;
240
+ columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
241
+ pagination: z.ZodEnum<["none", "top", "perCompany"]>;
242
+ /**
243
+ * The arrays `--all` concatenates: top-level paths for `top` (default: `[rowsPath]`), paths under `companies[]`
244
+ * for `perCompany`. Absent on `none`.
245
+ */
246
+ allItemsPath: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
247
+ }, "strict", z.ZodTypeAny, {
248
+ params: {
249
+ type: "string" | "number" | "boolean" | "array" | "integer";
250
+ name: string;
251
+ required: boolean;
252
+ in: "path" | "query";
253
+ default?: unknown;
254
+ description?: string | undefined;
255
+ enum?: string[] | undefined;
256
+ items?: "string" | "number" | "integer" | undefined;
257
+ alias?: string | undefined;
258
+ }[];
259
+ method: "get" | "post" | "put" | "patch" | "delete";
260
+ path: string;
261
+ operationId: string;
262
+ group: string;
263
+ action: string;
264
+ auth: boolean;
265
+ summary: string;
266
+ view: "json" | "table" | "keyValue";
267
+ pagination: "none" | "top" | "perCompany";
268
+ body?: {
269
+ required: boolean;
270
+ contentType: "application/json";
271
+ } | undefined;
272
+ rowsPath?: string | undefined;
273
+ columns?: string[] | undefined;
274
+ allItemsPath?: string[] | undefined;
275
+ }, {
276
+ params: {
277
+ type: "string" | "number" | "boolean" | "array" | "integer";
278
+ name: string;
279
+ required: boolean;
280
+ in: "path" | "query";
281
+ default?: unknown;
282
+ description?: string | undefined;
283
+ enum?: string[] | undefined;
284
+ items?: "string" | "number" | "integer" | undefined;
285
+ alias?: string | undefined;
286
+ }[];
287
+ method: "get" | "post" | "put" | "patch" | "delete";
288
+ path: string;
289
+ operationId: string;
290
+ group: string;
291
+ action: string;
292
+ auth: boolean;
293
+ summary: string;
294
+ view: "json" | "table" | "keyValue";
295
+ pagination: "none" | "top" | "perCompany";
296
+ body?: {
297
+ required: boolean;
298
+ contentType: "application/json";
299
+ } | undefined;
300
+ rowsPath?: string | undefined;
301
+ columns?: string[] | undefined;
302
+ allItemsPath?: string[] | undefined;
303
+ }>, "many">;
304
+ }, "strict", z.ZodTypeAny, {
305
+ specVersion: string;
306
+ specSha256: string;
307
+ groups: {
308
+ description: string;
309
+ name: string;
310
+ }[];
311
+ operations: {
312
+ params: {
313
+ type: "string" | "number" | "boolean" | "array" | "integer";
314
+ name: string;
315
+ required: boolean;
316
+ in: "path" | "query";
317
+ default?: unknown;
318
+ description?: string | undefined;
319
+ enum?: string[] | undefined;
320
+ items?: "string" | "number" | "integer" | undefined;
321
+ alias?: string | undefined;
322
+ }[];
323
+ method: "get" | "post" | "put" | "patch" | "delete";
324
+ path: string;
325
+ operationId: string;
326
+ group: string;
327
+ action: string;
328
+ auth: boolean;
329
+ summary: string;
330
+ view: "json" | "table" | "keyValue";
331
+ pagination: "none" | "top" | "perCompany";
332
+ body?: {
333
+ required: boolean;
334
+ contentType: "application/json";
335
+ } | undefined;
336
+ rowsPath?: string | undefined;
337
+ columns?: string[] | undefined;
338
+ allItemsPath?: string[] | undefined;
339
+ }[];
340
+ }, {
341
+ specVersion: string;
342
+ specSha256: string;
343
+ groups: {
344
+ description: string;
345
+ name: string;
346
+ }[];
347
+ operations: {
348
+ params: {
349
+ type: "string" | "number" | "boolean" | "array" | "integer";
350
+ name: string;
351
+ required: boolean;
352
+ in: "path" | "query";
353
+ default?: unknown;
354
+ description?: string | undefined;
355
+ enum?: string[] | undefined;
356
+ items?: "string" | "number" | "integer" | undefined;
357
+ alias?: string | undefined;
358
+ }[];
359
+ method: "get" | "post" | "put" | "patch" | "delete";
360
+ path: string;
361
+ operationId: string;
362
+ group: string;
363
+ action: string;
364
+ auth: boolean;
365
+ summary: string;
366
+ view: "json" | "table" | "keyValue";
367
+ pagination: "none" | "top" | "perCompany";
368
+ body?: {
369
+ required: boolean;
370
+ contentType: "application/json";
371
+ } | undefined;
372
+ rowsPath?: string | undefined;
373
+ columns?: string[] | undefined;
374
+ allItemsPath?: string[] | undefined;
375
+ }[];
376
+ }>;
377
+ export type ManifestParam = z.infer<typeof manifestParamSchema>;
378
+ export type ManifestOperation = z.infer<typeof manifestOperationSchema>;
379
+ export type Manifest = z.infer<typeof manifestSchema>;
380
+ /** Parses a loaded manifest; a corrupt file fails by name rather than registering half a CLI. */
381
+ export declare function parseManifest(raw: unknown, source?: string): Manifest;
382
+ export {};
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The compact, committed form of the Data API spec that `invd` registers its generated commands from
4
+ * (`src/generated/cli-manifest.json`, written by `scripts/build-cli-manifest.ts` from `openapi.json`'s `x-cli`).
5
+ * One schema for the builder's output, the startup loader and the dispatcher.
6
+ */
7
+ export const MANIFEST_PARAM_TYPES = ['string', 'integer', 'number', 'boolean', 'array'];
8
+ export const MANIFEST_ITEM_TYPES = ['string', 'integer', 'number'];
9
+ export const MANIFEST_METHODS = ['get', 'post', 'put', 'patch', 'delete'];
10
+ export const MANIFEST_VIEWS = ['table', 'keyValue', 'json'];
11
+ export const MANIFEST_PAGINATIONS = ['none', 'top', 'perCompany'];
12
+ const manifestParamSchema = z.object({
13
+ name: z.string().min(1),
14
+ in: z.enum(['query', 'path']),
15
+ required: z.boolean(),
16
+ type: z.enum(MANIFEST_PARAM_TYPES),
17
+ /** Arrays only: the item type; the value is sent as a repeated parameter. */
18
+ items: z.enum(MANIFEST_ITEM_TYPES).optional(),
19
+ /** Allowed values, stringified; on an array they apply to each item. */
20
+ enum: z.array(z.string()).optional(),
21
+ /** Shown in help, never sent — the API applies its own default. */
22
+ default: z.unknown().optional(),
23
+ description: z.string().optional(),
24
+ /** One-letter short flag (`-q`). */
25
+ alias: z.string().length(1).optional(),
26
+ }).strict();
27
+ const manifestOperationSchema = z.object({
28
+ operationId: z.string().min(1),
29
+ group: z.string().min(1),
30
+ /** `""` = the group itself is the command (`invd health`). */
31
+ action: z.string(),
32
+ method: z.enum(MANIFEST_METHODS),
33
+ path: z.string().startsWith('/'),
34
+ /** `false` = the operation needs no API key (`security: []` or none in the spec): no key is resolved or sent. */
35
+ auth: z.boolean(),
36
+ summary: z.string(),
37
+ params: z.array(manifestParamSchema),
38
+ body: z.object({ required: z.boolean(), contentType: z.literal('application/json') }).strict().optional(),
39
+ view: z.enum(MANIFEST_VIEWS),
40
+ /** Dotted path to the table's rows, or to the ONE object a `keyValue` view shows (absent = the response root). */
41
+ rowsPath: z.string().optional(),
42
+ columns: z.array(z.string()).optional(),
43
+ pagination: z.enum(MANIFEST_PAGINATIONS),
44
+ /**
45
+ * The arrays `--all` concatenates: top-level paths for `top` (default: `[rowsPath]`), paths under `companies[]`
46
+ * for `perCompany`. Absent on `none`.
47
+ */
48
+ allItemsPath: z.array(z.string()).min(1).optional(),
49
+ }).strict();
50
+ export const manifestSchema = z.object({
51
+ specVersion: z.string(),
52
+ specSha256: z.string().regex(/^[0-9a-f]{64}$/),
53
+ groups: z.array(z.object({ name: z.string().min(1), description: z.string() }).strict()),
54
+ operations: z.array(manifestOperationSchema),
55
+ }).strict();
56
+ /** Parses a loaded manifest; a corrupt file fails by name rather than registering half a CLI. */
57
+ export function parseManifest(raw, source = 'src/generated/cli-manifest.json') {
58
+ const result = manifestSchema.safeParse(raw);
59
+ if (!result.success) {
60
+ const issue = result.error.issues[0];
61
+ throw new Error(`Invalid command manifest ${source}: ${issue?.path.join('.') || '(root)'}: ${issue?.message}`);
62
+ }
63
+ return result.data;
64
+ }
65
+ //# sourceMappingURL=spec-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-manifest.js","sourceRoot":"","sources":["../../src/spec-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AACjG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAU,CAAC;AAE3E,MAAM,mBAAmB,GAAG,CAAC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AC,GAAY,EAAE,MAAM,GAAG,iCAAiC;IACpF,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,KAAK,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invinite-org/invinite-data-cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "CLI for the Invinite Data API",
6
6
  "publishConfig": {
@@ -42,11 +42,15 @@
42
42
  "vitest": "^2.1.8"
43
43
  },
44
44
  "scripts": {
45
- "build": "tsc",
45
+ "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc && node scripts/copy-manifest.mjs",
46
46
  "dev": "tsx bin/invd.ts",
47
47
  "lint": "eslint src",
48
48
  "test": "vitest run",
49
49
  "test:watch": "vitest",
50
- "publish:version": "pnpm version patch && export $(cat .env | xargs) && pnpm publish --access public"
50
+ "publish:version": "pnpm version patch && export $(cat .env | xargs) && pnpm publish --access public",
51
+ "cli:manifest": "tsx scripts/build-cli-manifest.ts",
52
+ "cli:manifest:check": "tsx scripts/build-cli-manifest.ts --check",
53
+ "skill:commands": "tsx scripts/build-skill-commands.ts",
54
+ "skill:commands:check": "tsx scripts/build-skill-commands.ts --check"
51
55
  }
52
56
  }
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function registerCompanyCommands(program: Command): void;