@invinite-org/invinite-data-cli 2.0.0 → 4.0.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 (129) hide show
  1. package/README.md +341 -374
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/claude-plugin/agents/invinite-data.md +59 -28
  4. package/claude-plugin/commands/analyze-earnings-call.md +15 -14
  5. package/claude-plugin/commands/analyze-filing.md +8 -7
  6. package/claude-plugin/commands/compare-companies.md +5 -5
  7. package/claude-plugin/commands/financial-research.md +9 -9
  8. package/claude-plugin/commands/ownership-review.md +6 -6
  9. package/claude-plugin/skills/invinite-data-cli/SKILL.md +466 -570
  10. package/dist/bin/invd.js +11 -2
  11. package/dist/bin/invd.js.map +1 -1
  12. package/dist/src/cli.d.ts +2 -0
  13. package/dist/src/cli.js +48 -29
  14. package/dist/src/cli.js.map +1 -1
  15. package/dist/src/client/api-client.d.ts +24 -24
  16. package/dist/src/client/api-client.js +52 -70
  17. package/dist/src/client/api-client.js.map +1 -1
  18. package/dist/src/client/pagination.d.ts +12 -11
  19. package/dist/src/client/pagination.js +47 -56
  20. package/dist/src/client/pagination.js.map +1 -1
  21. package/dist/src/commands/agent-setup.d.ts +21 -0
  22. package/dist/src/commands/agent-setup.js +112 -0
  23. package/dist/src/commands/agent-setup.js.map +1 -0
  24. package/dist/src/commands/api.d.ts +27 -0
  25. package/dist/src/commands/api.js +180 -0
  26. package/dist/src/commands/api.js.map +1 -0
  27. package/dist/src/commands/auth.d.ts +37 -0
  28. package/dist/src/commands/auth.js +336 -0
  29. package/dist/src/commands/auth.js.map +1 -0
  30. package/dist/src/commands/completion.d.ts +7 -0
  31. package/dist/src/commands/completion.js +115 -0
  32. package/dist/src/commands/completion.js.map +1 -0
  33. package/dist/src/commands/config.d.ts +4 -0
  34. package/dist/src/commands/config.js +85 -48
  35. package/dist/src/commands/config.js.map +1 -1
  36. package/dist/src/commands/plugin.d.ts +8 -0
  37. package/dist/src/commands/plugin.js +8 -10
  38. package/dist/src/commands/plugin.js.map +1 -1
  39. package/dist/src/config/auth.d.ts +17 -1
  40. package/dist/src/config/auth.js +50 -36
  41. package/dist/src/config/auth.js.map +1 -1
  42. package/dist/src/config/config-manager.d.ts +56 -4
  43. package/dist/src/config/config-manager.js +173 -29
  44. package/dist/src/config/config-manager.js.map +1 -1
  45. package/dist/src/config/toml.d.ts +7 -0
  46. package/dist/src/config/toml.js +79 -0
  47. package/dist/src/config/toml.js.map +1 -0
  48. package/dist/src/examples.d.ts +22 -0
  49. package/dist/src/examples.js +56 -0
  50. package/dist/src/examples.js.map +1 -0
  51. package/dist/src/generated/cli-manifest.json +5583 -4916
  52. package/dist/src/hand-written-commands.d.ts +11 -41
  53. package/dist/src/hand-written-commands.js +7 -17
  54. package/dist/src/hand-written-commands.js.map +1 -1
  55. package/dist/src/output/jq.d.ts +15 -0
  56. package/dist/src/output/jq.js +234 -0
  57. package/dist/src/output/jq.js.map +1 -0
  58. package/dist/src/output/options.d.ts +29 -0
  59. package/dist/src/output/options.js +72 -0
  60. package/dist/src/output/options.js.map +1 -0
  61. package/dist/src/output/render.d.ts +54 -0
  62. package/dist/src/output/render.js +160 -0
  63. package/dist/src/output/render.js.map +1 -0
  64. package/dist/src/shared/errors.d.ts +59 -15
  65. package/dist/src/shared/errors.js +126 -38
  66. package/dist/src/shared/errors.js.map +1 -1
  67. package/dist/src/shared/prompt.d.ts +10 -0
  68. package/dist/src/shared/prompt.js +24 -0
  69. package/dist/src/shared/prompt.js.map +1 -0
  70. package/dist/src/shared/spinner.js +2 -1
  71. package/dist/src/shared/spinner.js.map +1 -1
  72. package/dist/src/spec-commands.d.ts +14 -6
  73. package/dist/src/spec-commands.js +454 -174
  74. package/dist/src/spec-commands.js.map +1 -1
  75. package/dist/src/spec-flags.d.ts +11 -6
  76. package/dist/src/spec-flags.js +14 -7
  77. package/dist/src/spec-flags.js.map +1 -1
  78. package/dist/src/spec-manifest.d.ts +416 -116
  79. package/dist/src/spec-manifest.js +44 -13
  80. package/dist/src/spec-manifest.js.map +1 -1
  81. package/dist/src/update-notifier.d.ts +9 -0
  82. package/dist/src/update-notifier.js +63 -0
  83. package/dist/src/update-notifier.js.map +1 -0
  84. package/package.json +2 -3
  85. package/dist/src/client/earnings-live.d.ts +0 -194
  86. package/dist/src/client/earnings-live.js +0 -300
  87. package/dist/src/client/earnings-live.js.map +0 -1
  88. package/dist/src/client/news-live.d.ts +0 -72
  89. package/dist/src/client/news-live.js +0 -120
  90. package/dist/src/client/news-live.js.map +0 -1
  91. package/dist/src/client/pdf.d.ts +0 -15
  92. package/dist/src/client/pdf.js +0 -15
  93. package/dist/src/client/pdf.js.map +0 -1
  94. package/dist/src/client/websocket-client.d.ts +0 -19
  95. package/dist/src/client/websocket-client.js +0 -174
  96. package/dist/src/client/websocket-client.js.map +0 -1
  97. package/dist/src/commands/earnings.d.ts +0 -16
  98. package/dist/src/commands/earnings.js +0 -464
  99. package/dist/src/commands/earnings.js.map +0 -1
  100. package/dist/src/commands/login.d.ts +0 -15
  101. package/dist/src/commands/login.js +0 -249
  102. package/dist/src/commands/login.js.map +0 -1
  103. package/dist/src/commands/news.d.ts +0 -2
  104. package/dist/src/commands/news.js +0 -69
  105. package/dist/src/commands/news.js.map +0 -1
  106. package/dist/src/commands/sec.d.ts +0 -47
  107. package/dist/src/commands/sec.js +0 -191
  108. package/dist/src/commands/sec.js.map +0 -1
  109. package/dist/src/commands/ws.d.ts +0 -33
  110. package/dist/src/commands/ws.js +0 -116
  111. package/dist/src/commands/ws.js.map +0 -1
  112. package/dist/src/formatters/json-formatter.d.ts +0 -1
  113. package/dist/src/formatters/json-formatter.js +0 -4
  114. package/dist/src/formatters/json-formatter.js.map +0 -1
  115. package/dist/src/formatters/table-formatter.d.ts +0 -4
  116. package/dist/src/formatters/table-formatter.js +0 -73
  117. package/dist/src/formatters/table-formatter.js.map +0 -1
  118. package/dist/src/formatters/time.d.ts +0 -2
  119. package/dist/src/formatters/time.js +0 -14
  120. package/dist/src/formatters/time.js.map +0 -1
  121. package/dist/src/shared/output.d.ts +0 -3
  122. package/dist/src/shared/output.js +0 -13
  123. package/dist/src/shared/output.js.map +0 -1
  124. package/dist/src/shared/readiness.d.ts +0 -4
  125. package/dist/src/shared/readiness.js +0 -60
  126. package/dist/src/shared/readiness.js.map +0 -1
  127. package/dist/src/shared/types.d.ts +0 -11
  128. package/dist/src/shared/types.js +0 -2
  129. package/dist/src/shared/types.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * The compact, committed form of the Data API spec that `invd` registers its generated commands from
3
+ * The compact, committed form of the Data API v2 spec that `invd` registers its generated commands from
4
4
  * (`src/generated/cli-manifest.json`, written by `scripts/build-cli-manifest.ts` from `openapi.json`'s `x-cli`).
5
5
  * One schema for the builder's output, the startup loader and the dispatcher.
6
6
  */
@@ -8,183 +8,329 @@ export declare const MANIFEST_PARAM_TYPES: readonly ["string", "integer", "numbe
8
8
  export declare const MANIFEST_ITEM_TYPES: readonly ["string", "integer", "number"];
9
9
  export declare const MANIFEST_METHODS: readonly ["get", "post", "put", "patch", "delete"];
10
10
  export declare const MANIFEST_VIEWS: readonly ["table", "keyValue", "json"];
11
- export declare const MANIFEST_PAGINATIONS: readonly ["none", "top", "perCompany"];
12
11
  declare const manifestParamSchema: z.ZodObject<{
13
12
  name: z.ZodString;
14
- in: z.ZodEnum<["query", "path"]>;
13
+ in: z.ZodEnum<["query", "path", "header"]>;
15
14
  required: z.ZodBoolean;
16
15
  type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
17
16
  /** Arrays only: the item type; the value is sent as a repeated parameter. */
18
17
  items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
19
18
  /** Allowed values, stringified; on an array they apply to each item. */
20
19
  enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
+ /** The spec's `pattern` (comma lists like `income-statement,balance-sheet` are patterns, not arrays). */
21
+ pattern: z.ZodOptional<z.ZodString>;
21
22
  /** Shown in help, never sent — the API applies its own default. */
22
23
  default: z.ZodOptional<z.ZodUnknown>;
23
- /** The spec's `example`: shown in help and the skill's example line, never sent. */
24
+ /** The spec's `example`: shown in help and in the examples, never sent. */
24
25
  example: z.ZodOptional<z.ZodUnknown>;
25
26
  description: z.ZodOptional<z.ZodString>;
26
27
  /** One-letter short flag (`-q`). */
27
28
  alias: z.ZodOptional<z.ZodString>;
29
+ /** The long flag without dashes (`filed_at.gte` → `filed-at-gte`). */
30
+ flag: z.ZodString;
28
31
  }, "strict", z.ZodTypeAny, {
29
- type: "string" | "number" | "boolean" | "array" | "integer";
32
+ type: "string" | "number" | "boolean" | "integer" | "array";
30
33
  name: string;
31
34
  required: boolean;
32
- in: "path" | "query";
35
+ in: "query" | "path" | "header";
36
+ flag: string;
33
37
  default?: unknown;
34
38
  description?: string | undefined;
35
- enum?: string[] | undefined;
36
39
  items?: "string" | "number" | "integer" | undefined;
40
+ enum?: string[] | undefined;
41
+ pattern?: string | undefined;
37
42
  example?: unknown;
38
43
  alias?: string | undefined;
39
44
  }, {
40
- type: "string" | "number" | "boolean" | "array" | "integer";
45
+ type: "string" | "number" | "boolean" | "integer" | "array";
41
46
  name: string;
42
47
  required: boolean;
43
- in: "path" | "query";
48
+ in: "query" | "path" | "header";
49
+ flag: string;
44
50
  default?: unknown;
45
51
  description?: string | undefined;
46
- enum?: string[] | undefined;
47
52
  items?: "string" | "number" | "integer" | undefined;
53
+ enum?: string[] | undefined;
54
+ pattern?: string | undefined;
48
55
  example?: unknown;
49
56
  alias?: string | undefined;
50
57
  }>;
58
+ declare const bodyFieldSchema: z.ZodObject<{
59
+ /** The property's path in the JSON body (`["filters", "ciks"]`). */
60
+ path: z.ZodArray<z.ZodString, "many">;
61
+ type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
62
+ items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
63
+ required: z.ZodBoolean;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ alias: z.ZodOptional<z.ZodString>;
66
+ flag: z.ZodString;
67
+ }, "strict", z.ZodTypeAny, {
68
+ path: string[];
69
+ type: "string" | "number" | "boolean" | "integer" | "array";
70
+ required: boolean;
71
+ flag: string;
72
+ description?: string | undefined;
73
+ items?: "string" | "number" | "integer" | undefined;
74
+ alias?: string | undefined;
75
+ }, {
76
+ path: string[];
77
+ type: "string" | "number" | "boolean" | "integer" | "array";
78
+ required: boolean;
79
+ flag: string;
80
+ description?: string | undefined;
81
+ items?: "string" | "number" | "integer" | undefined;
82
+ alias?: string | undefined;
83
+ }>;
51
84
  declare const manifestOperationSchema: z.ZodObject<{
52
85
  operationId: z.ZodString;
53
86
  group: z.ZodString;
54
- /** `""` = the group itself is the command (`invd health`). */
87
+ /** `""` = the group itself is the command (`invd financials`, the `x-cli.command` operations). */
55
88
  action: z.ZodString;
56
89
  method: z.ZodEnum<["get", "post", "put", "patch", "delete"]>;
57
90
  path: z.ZodString;
58
- /** `false` = the operation needs no API key (`security: []` or none in the spec): no key is resolved or sent. */
91
+ /** `false` = the operation needs no API key: no key is resolved or sent. */
59
92
  auth: z.ZodBoolean;
60
93
  summary: z.ZodString;
94
+ /** The spec's `x-credits`: the base cost of one response (`--dry-run`, the `--all` confirmation). */
95
+ credits: z.ZodNumber;
96
+ /** The spec's `x-tier` (free, lite, standard, pro). */
97
+ tier: z.ZodString;
61
98
  params: z.ZodArray<z.ZodObject<{
62
99
  name: z.ZodString;
63
- in: z.ZodEnum<["query", "path"]>;
100
+ in: z.ZodEnum<["query", "path", "header"]>;
64
101
  required: z.ZodBoolean;
65
102
  type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
66
103
  /** Arrays only: the item type; the value is sent as a repeated parameter. */
67
104
  items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
68
105
  /** Allowed values, stringified; on an array they apply to each item. */
69
106
  enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
107
+ /** The spec's `pattern` (comma lists like `income-statement,balance-sheet` are patterns, not arrays). */
108
+ pattern: z.ZodOptional<z.ZodString>;
70
109
  /** Shown in help, never sent — the API applies its own default. */
71
110
  default: z.ZodOptional<z.ZodUnknown>;
72
- /** The spec's `example`: shown in help and the skill's example line, never sent. */
111
+ /** The spec's `example`: shown in help and in the examples, never sent. */
73
112
  example: z.ZodOptional<z.ZodUnknown>;
74
113
  description: z.ZodOptional<z.ZodString>;
75
114
  /** One-letter short flag (`-q`). */
76
115
  alias: z.ZodOptional<z.ZodString>;
116
+ /** The long flag without dashes (`filed_at.gte` → `filed-at-gte`). */
117
+ flag: z.ZodString;
77
118
  }, "strict", z.ZodTypeAny, {
78
- type: "string" | "number" | "boolean" | "array" | "integer";
119
+ type: "string" | "number" | "boolean" | "integer" | "array";
79
120
  name: string;
80
121
  required: boolean;
81
- in: "path" | "query";
122
+ in: "query" | "path" | "header";
123
+ flag: string;
82
124
  default?: unknown;
83
125
  description?: string | undefined;
84
- enum?: string[] | undefined;
85
126
  items?: "string" | "number" | "integer" | undefined;
127
+ enum?: string[] | undefined;
128
+ pattern?: string | undefined;
86
129
  example?: unknown;
87
130
  alias?: string | undefined;
88
131
  }, {
89
- type: "string" | "number" | "boolean" | "array" | "integer";
132
+ type: "string" | "number" | "boolean" | "integer" | "array";
90
133
  name: string;
91
134
  required: boolean;
92
- in: "path" | "query";
135
+ in: "query" | "path" | "header";
136
+ flag: string;
93
137
  default?: unknown;
94
138
  description?: string | undefined;
95
- enum?: string[] | undefined;
96
139
  items?: "string" | "number" | "integer" | undefined;
140
+ enum?: string[] | undefined;
141
+ pattern?: string | undefined;
97
142
  example?: unknown;
98
143
  alias?: string | undefined;
99
144
  }>, "many">;
145
+ /** The parameter the first positional fills: a company list (`AAPL MSFT` → `company=AAPL,MSFT`), a member id, `q`. */
146
+ positional: z.ZodOptional<z.ZodObject<{
147
+ name: z.ZodString;
148
+ required: z.ZodBoolean;
149
+ /** Several words: joined with `,` (a company list) or ` ` (a search text). */
150
+ variadic: z.ZodOptional<z.ZodEnum<["comma", "space"]>>;
151
+ }, "strict", z.ZodTypeAny, {
152
+ name: string;
153
+ required: boolean;
154
+ variadic?: "comma" | "space" | undefined;
155
+ }, {
156
+ name: string;
157
+ required: boolean;
158
+ variadic?: "comma" | "space" | undefined;
159
+ }>>;
160
+ /** One command over several operations (`invd financials`): the `--basis` / `--view` values that pick this one. */
161
+ select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
100
162
  /** The spec's `x-example-params`: the OPTIONAL params an example invocation passes beside the required ones. */
101
163
  exampleParams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
102
164
  body: z.ZodOptional<z.ZodObject<{
103
165
  required: z.ZodBoolean;
104
166
  contentType: z.ZodLiteral<"application/json">;
105
- /** The spec's request-body `example` (the skill's `--body`). */
167
+ /** The spec's request-body `example`. */
106
168
  example: z.ZodOptional<z.ZodUnknown>;
169
+ /** Flags for the body's scalar / list properties (`--url`, `--events a,b`, `--ciks` → `filters.ciks`). */
170
+ fields: z.ZodArray<z.ZodObject<{
171
+ /** The property's path in the JSON body (`["filters", "ciks"]`). */
172
+ path: z.ZodArray<z.ZodString, "many">;
173
+ type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
174
+ items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
175
+ required: z.ZodBoolean;
176
+ description: z.ZodOptional<z.ZodString>;
177
+ alias: z.ZodOptional<z.ZodString>;
178
+ flag: z.ZodString;
179
+ }, "strict", z.ZodTypeAny, {
180
+ path: string[];
181
+ type: "string" | "number" | "boolean" | "integer" | "array";
182
+ required: boolean;
183
+ flag: string;
184
+ description?: string | undefined;
185
+ items?: "string" | "number" | "integer" | undefined;
186
+ alias?: string | undefined;
187
+ }, {
188
+ path: string[];
189
+ type: "string" | "number" | "boolean" | "integer" | "array";
190
+ required: boolean;
191
+ flag: string;
192
+ description?: string | undefined;
193
+ items?: "string" | "number" | "integer" | undefined;
194
+ alias?: string | undefined;
195
+ }>, "many">;
107
196
  }, "strict", z.ZodTypeAny, {
108
197
  required: boolean;
109
198
  contentType: "application/json";
199
+ fields: {
200
+ path: string[];
201
+ type: "string" | "number" | "boolean" | "integer" | "array";
202
+ required: boolean;
203
+ flag: string;
204
+ description?: string | undefined;
205
+ items?: "string" | "number" | "integer" | undefined;
206
+ alias?: string | undefined;
207
+ }[];
110
208
  example?: unknown;
111
209
  }, {
112
210
  required: boolean;
113
211
  contentType: "application/json";
212
+ fields: {
213
+ path: string[];
214
+ type: "string" | "number" | "boolean" | "integer" | "array";
215
+ required: boolean;
216
+ flag: string;
217
+ description?: string | undefined;
218
+ items?: "string" | "number" | "integer" | undefined;
219
+ alias?: string | undefined;
220
+ }[];
114
221
  example?: unknown;
115
222
  }>>;
223
+ /** A cursor-paginated list (`{data, has_more, next_cursor, meta}`): `--all`, `--cursor`, JSONL / CSV rows. */
224
+ list: z.ZodBoolean;
116
225
  view: z.ZodEnum<["table", "keyValue", "json"]>;
117
- /** Dotted path to the table's rows, or to the ONE object a `keyValue` view shows (absent = the response root). */
118
- rowsPath: z.ZodOptional<z.ZodString>;
119
226
  columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
120
- pagination: z.ZodEnum<["none", "top", "perCompany"]>;
227
+ /** The JSON fields of one row (a list's `data[]` item, else the object): `--json a,b` and `--help`. */
228
+ fields: z.ZodArray<z.ZodString, "many">;
121
229
  /**
122
- * The arrays `--all` concatenates: top-level paths for `top` (default: `[rowsPath]`), paths under `companies[]`
123
- * for `perCompany`. Absent on `none`.
230
+ * Where the response carries a downloadable file (`{url, sha256?, bytes?, content_type?}`): `""` = the response
231
+ * root, else a dotted path (`pdf`, `deck`). Present = the command takes `--save <file>`.
124
232
  */
125
- allItemsPath: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
233
+ download: z.ZodOptional<z.ZodString>;
126
234
  }, "strict", z.ZodTypeAny, {
235
+ method: "get" | "post" | "put" | "patch" | "delete";
236
+ path: string;
237
+ auth: boolean;
238
+ list: boolean;
127
239
  params: {
128
- type: "string" | "number" | "boolean" | "array" | "integer";
240
+ type: "string" | "number" | "boolean" | "integer" | "array";
129
241
  name: string;
130
242
  required: boolean;
131
- in: "path" | "query";
243
+ in: "query" | "path" | "header";
244
+ flag: string;
132
245
  default?: unknown;
133
246
  description?: string | undefined;
134
- enum?: string[] | undefined;
135
247
  items?: "string" | "number" | "integer" | undefined;
248
+ enum?: string[] | undefined;
249
+ pattern?: string | undefined;
136
250
  example?: unknown;
137
251
  alias?: string | undefined;
138
252
  }[];
139
- method: "get" | "post" | "put" | "patch" | "delete";
140
- path: string;
141
- group: string;
142
253
  operationId: string;
254
+ group: string;
143
255
  action: string;
144
- auth: boolean;
145
256
  summary: string;
146
- view: "json" | "table" | "keyValue";
147
- pagination: "none" | "top" | "perCompany";
257
+ credits: number;
258
+ tier: string;
259
+ fields: string[];
260
+ view: "table" | "json" | "keyValue";
148
261
  body?: {
149
262
  required: boolean;
150
263
  contentType: "application/json";
264
+ fields: {
265
+ path: string[];
266
+ type: "string" | "number" | "boolean" | "integer" | "array";
267
+ required: boolean;
268
+ flag: string;
269
+ description?: string | undefined;
270
+ items?: "string" | "number" | "integer" | undefined;
271
+ alias?: string | undefined;
272
+ }[];
151
273
  example?: unknown;
152
274
  } | undefined;
275
+ select?: Record<string, string> | undefined;
276
+ positional?: {
277
+ name: string;
278
+ required: boolean;
279
+ variadic?: "comma" | "space" | undefined;
280
+ } | undefined;
153
281
  exampleParams?: string[] | undefined;
154
- rowsPath?: string | undefined;
155
282
  columns?: string[] | undefined;
156
- allItemsPath?: string[] | undefined;
283
+ download?: string | undefined;
157
284
  }, {
285
+ method: "get" | "post" | "put" | "patch" | "delete";
286
+ path: string;
287
+ auth: boolean;
288
+ list: boolean;
158
289
  params: {
159
- type: "string" | "number" | "boolean" | "array" | "integer";
290
+ type: "string" | "number" | "boolean" | "integer" | "array";
160
291
  name: string;
161
292
  required: boolean;
162
- in: "path" | "query";
293
+ in: "query" | "path" | "header";
294
+ flag: string;
163
295
  default?: unknown;
164
296
  description?: string | undefined;
165
- enum?: string[] | undefined;
166
297
  items?: "string" | "number" | "integer" | undefined;
298
+ enum?: string[] | undefined;
299
+ pattern?: string | undefined;
167
300
  example?: unknown;
168
301
  alias?: string | undefined;
169
302
  }[];
170
- method: "get" | "post" | "put" | "patch" | "delete";
171
- path: string;
172
- group: string;
173
303
  operationId: string;
304
+ group: string;
174
305
  action: string;
175
- auth: boolean;
176
306
  summary: string;
177
- view: "json" | "table" | "keyValue";
178
- pagination: "none" | "top" | "perCompany";
307
+ credits: number;
308
+ tier: string;
309
+ fields: string[];
310
+ view: "table" | "json" | "keyValue";
179
311
  body?: {
180
312
  required: boolean;
181
313
  contentType: "application/json";
314
+ fields: {
315
+ path: string[];
316
+ type: "string" | "number" | "boolean" | "integer" | "array";
317
+ required: boolean;
318
+ flag: string;
319
+ description?: string | undefined;
320
+ items?: "string" | "number" | "integer" | undefined;
321
+ alias?: string | undefined;
322
+ }[];
182
323
  example?: unknown;
183
324
  } | undefined;
325
+ select?: Record<string, string> | undefined;
326
+ positional?: {
327
+ name: string;
328
+ required: boolean;
329
+ variadic?: "comma" | "space" | undefined;
330
+ } | undefined;
184
331
  exampleParams?: string[] | undefined;
185
- rowsPath?: string | undefined;
186
332
  columns?: string[] | undefined;
187
- allItemsPath?: string[] | undefined;
333
+ download?: string | undefined;
188
334
  }>;
189
335
  export declare const manifestSchema: z.ZodObject<{
190
336
  specVersion: z.ZodString;
@@ -193,234 +339,388 @@ export declare const manifestSchema: z.ZodObject<{
193
339
  name: z.ZodString;
194
340
  description: z.ZodString;
195
341
  }, "strict", z.ZodTypeAny, {
196
- description: string;
197
342
  name: string;
198
- }, {
199
343
  description: string;
344
+ }, {
200
345
  name: string;
346
+ description: string;
201
347
  }>, "many">;
202
348
  operations: z.ZodArray<z.ZodObject<{
203
349
  operationId: z.ZodString;
204
350
  group: z.ZodString;
205
- /** `""` = the group itself is the command (`invd health`). */
351
+ /** `""` = the group itself is the command (`invd financials`, the `x-cli.command` operations). */
206
352
  action: z.ZodString;
207
353
  method: z.ZodEnum<["get", "post", "put", "patch", "delete"]>;
208
354
  path: z.ZodString;
209
- /** `false` = the operation needs no API key (`security: []` or none in the spec): no key is resolved or sent. */
355
+ /** `false` = the operation needs no API key: no key is resolved or sent. */
210
356
  auth: z.ZodBoolean;
211
357
  summary: z.ZodString;
358
+ /** The spec's `x-credits`: the base cost of one response (`--dry-run`, the `--all` confirmation). */
359
+ credits: z.ZodNumber;
360
+ /** The spec's `x-tier` (free, lite, standard, pro). */
361
+ tier: z.ZodString;
212
362
  params: z.ZodArray<z.ZodObject<{
213
363
  name: z.ZodString;
214
- in: z.ZodEnum<["query", "path"]>;
364
+ in: z.ZodEnum<["query", "path", "header"]>;
215
365
  required: z.ZodBoolean;
216
366
  type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
217
367
  /** Arrays only: the item type; the value is sent as a repeated parameter. */
218
368
  items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
219
369
  /** Allowed values, stringified; on an array they apply to each item. */
220
370
  enum: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
371
+ /** The spec's `pattern` (comma lists like `income-statement,balance-sheet` are patterns, not arrays). */
372
+ pattern: z.ZodOptional<z.ZodString>;
221
373
  /** Shown in help, never sent — the API applies its own default. */
222
374
  default: z.ZodOptional<z.ZodUnknown>;
223
- /** The spec's `example`: shown in help and the skill's example line, never sent. */
375
+ /** The spec's `example`: shown in help and in the examples, never sent. */
224
376
  example: z.ZodOptional<z.ZodUnknown>;
225
377
  description: z.ZodOptional<z.ZodString>;
226
378
  /** One-letter short flag (`-q`). */
227
379
  alias: z.ZodOptional<z.ZodString>;
380
+ /** The long flag without dashes (`filed_at.gte` → `filed-at-gte`). */
381
+ flag: z.ZodString;
228
382
  }, "strict", z.ZodTypeAny, {
229
- type: "string" | "number" | "boolean" | "array" | "integer";
383
+ type: "string" | "number" | "boolean" | "integer" | "array";
230
384
  name: string;
231
385
  required: boolean;
232
- in: "path" | "query";
386
+ in: "query" | "path" | "header";
387
+ flag: string;
233
388
  default?: unknown;
234
389
  description?: string | undefined;
235
- enum?: string[] | undefined;
236
390
  items?: "string" | "number" | "integer" | undefined;
391
+ enum?: string[] | undefined;
392
+ pattern?: string | undefined;
237
393
  example?: unknown;
238
394
  alias?: string | undefined;
239
395
  }, {
240
- type: "string" | "number" | "boolean" | "array" | "integer";
396
+ type: "string" | "number" | "boolean" | "integer" | "array";
241
397
  name: string;
242
398
  required: boolean;
243
- in: "path" | "query";
399
+ in: "query" | "path" | "header";
400
+ flag: string;
244
401
  default?: unknown;
245
402
  description?: string | undefined;
246
- enum?: string[] | undefined;
247
403
  items?: "string" | "number" | "integer" | undefined;
404
+ enum?: string[] | undefined;
405
+ pattern?: string | undefined;
248
406
  example?: unknown;
249
407
  alias?: string | undefined;
250
408
  }>, "many">;
409
+ /** The parameter the first positional fills: a company list (`AAPL MSFT` → `company=AAPL,MSFT`), a member id, `q`. */
410
+ positional: z.ZodOptional<z.ZodObject<{
411
+ name: z.ZodString;
412
+ required: z.ZodBoolean;
413
+ /** Several words: joined with `,` (a company list) or ` ` (a search text). */
414
+ variadic: z.ZodOptional<z.ZodEnum<["comma", "space"]>>;
415
+ }, "strict", z.ZodTypeAny, {
416
+ name: string;
417
+ required: boolean;
418
+ variadic?: "comma" | "space" | undefined;
419
+ }, {
420
+ name: string;
421
+ required: boolean;
422
+ variadic?: "comma" | "space" | undefined;
423
+ }>>;
424
+ /** One command over several operations (`invd financials`): the `--basis` / `--view` values that pick this one. */
425
+ select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
251
426
  /** The spec's `x-example-params`: the OPTIONAL params an example invocation passes beside the required ones. */
252
427
  exampleParams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
253
428
  body: z.ZodOptional<z.ZodObject<{
254
429
  required: z.ZodBoolean;
255
430
  contentType: z.ZodLiteral<"application/json">;
256
- /** The spec's request-body `example` (the skill's `--body`). */
431
+ /** The spec's request-body `example`. */
257
432
  example: z.ZodOptional<z.ZodUnknown>;
433
+ /** Flags for the body's scalar / list properties (`--url`, `--events a,b`, `--ciks` → `filters.ciks`). */
434
+ fields: z.ZodArray<z.ZodObject<{
435
+ /** The property's path in the JSON body (`["filters", "ciks"]`). */
436
+ path: z.ZodArray<z.ZodString, "many">;
437
+ type: z.ZodEnum<["string", "integer", "number", "boolean", "array"]>;
438
+ items: z.ZodOptional<z.ZodEnum<["string", "integer", "number"]>>;
439
+ required: z.ZodBoolean;
440
+ description: z.ZodOptional<z.ZodString>;
441
+ alias: z.ZodOptional<z.ZodString>;
442
+ flag: z.ZodString;
443
+ }, "strict", z.ZodTypeAny, {
444
+ path: string[];
445
+ type: "string" | "number" | "boolean" | "integer" | "array";
446
+ required: boolean;
447
+ flag: string;
448
+ description?: string | undefined;
449
+ items?: "string" | "number" | "integer" | undefined;
450
+ alias?: string | undefined;
451
+ }, {
452
+ path: string[];
453
+ type: "string" | "number" | "boolean" | "integer" | "array";
454
+ required: boolean;
455
+ flag: string;
456
+ description?: string | undefined;
457
+ items?: "string" | "number" | "integer" | undefined;
458
+ alias?: string | undefined;
459
+ }>, "many">;
258
460
  }, "strict", z.ZodTypeAny, {
259
461
  required: boolean;
260
462
  contentType: "application/json";
463
+ fields: {
464
+ path: string[];
465
+ type: "string" | "number" | "boolean" | "integer" | "array";
466
+ required: boolean;
467
+ flag: string;
468
+ description?: string | undefined;
469
+ items?: "string" | "number" | "integer" | undefined;
470
+ alias?: string | undefined;
471
+ }[];
261
472
  example?: unknown;
262
473
  }, {
263
474
  required: boolean;
264
475
  contentType: "application/json";
476
+ fields: {
477
+ path: string[];
478
+ type: "string" | "number" | "boolean" | "integer" | "array";
479
+ required: boolean;
480
+ flag: string;
481
+ description?: string | undefined;
482
+ items?: "string" | "number" | "integer" | undefined;
483
+ alias?: string | undefined;
484
+ }[];
265
485
  example?: unknown;
266
486
  }>>;
487
+ /** A cursor-paginated list (`{data, has_more, next_cursor, meta}`): `--all`, `--cursor`, JSONL / CSV rows. */
488
+ list: z.ZodBoolean;
267
489
  view: z.ZodEnum<["table", "keyValue", "json"]>;
268
- /** Dotted path to the table's rows, or to the ONE object a `keyValue` view shows (absent = the response root). */
269
- rowsPath: z.ZodOptional<z.ZodString>;
270
490
  columns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
271
- pagination: z.ZodEnum<["none", "top", "perCompany"]>;
491
+ /** The JSON fields of one row (a list's `data[]` item, else the object): `--json a,b` and `--help`. */
492
+ fields: z.ZodArray<z.ZodString, "many">;
272
493
  /**
273
- * The arrays `--all` concatenates: top-level paths for `top` (default: `[rowsPath]`), paths under `companies[]`
274
- * for `perCompany`. Absent on `none`.
494
+ * Where the response carries a downloadable file (`{url, sha256?, bytes?, content_type?}`): `""` = the response
495
+ * root, else a dotted path (`pdf`, `deck`). Present = the command takes `--save <file>`.
275
496
  */
276
- allItemsPath: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
497
+ download: z.ZodOptional<z.ZodString>;
277
498
  }, "strict", z.ZodTypeAny, {
499
+ method: "get" | "post" | "put" | "patch" | "delete";
500
+ path: string;
501
+ auth: boolean;
502
+ list: boolean;
278
503
  params: {
279
- type: "string" | "number" | "boolean" | "array" | "integer";
504
+ type: "string" | "number" | "boolean" | "integer" | "array";
280
505
  name: string;
281
506
  required: boolean;
282
- in: "path" | "query";
507
+ in: "query" | "path" | "header";
508
+ flag: string;
283
509
  default?: unknown;
284
510
  description?: string | undefined;
285
- enum?: string[] | undefined;
286
511
  items?: "string" | "number" | "integer" | undefined;
512
+ enum?: string[] | undefined;
513
+ pattern?: string | undefined;
287
514
  example?: unknown;
288
515
  alias?: string | undefined;
289
516
  }[];
290
- method: "get" | "post" | "put" | "patch" | "delete";
291
- path: string;
292
- group: string;
293
517
  operationId: string;
518
+ group: string;
294
519
  action: string;
295
- auth: boolean;
296
520
  summary: string;
297
- view: "json" | "table" | "keyValue";
298
- pagination: "none" | "top" | "perCompany";
521
+ credits: number;
522
+ tier: string;
523
+ fields: string[];
524
+ view: "table" | "json" | "keyValue";
299
525
  body?: {
300
526
  required: boolean;
301
527
  contentType: "application/json";
528
+ fields: {
529
+ path: string[];
530
+ type: "string" | "number" | "boolean" | "integer" | "array";
531
+ required: boolean;
532
+ flag: string;
533
+ description?: string | undefined;
534
+ items?: "string" | "number" | "integer" | undefined;
535
+ alias?: string | undefined;
536
+ }[];
302
537
  example?: unknown;
303
538
  } | undefined;
539
+ select?: Record<string, string> | undefined;
540
+ positional?: {
541
+ name: string;
542
+ required: boolean;
543
+ variadic?: "comma" | "space" | undefined;
544
+ } | undefined;
304
545
  exampleParams?: string[] | undefined;
305
- rowsPath?: string | undefined;
306
546
  columns?: string[] | undefined;
307
- allItemsPath?: string[] | undefined;
547
+ download?: string | undefined;
308
548
  }, {
549
+ method: "get" | "post" | "put" | "patch" | "delete";
550
+ path: string;
551
+ auth: boolean;
552
+ list: boolean;
309
553
  params: {
310
- type: "string" | "number" | "boolean" | "array" | "integer";
554
+ type: "string" | "number" | "boolean" | "integer" | "array";
311
555
  name: string;
312
556
  required: boolean;
313
- in: "path" | "query";
557
+ in: "query" | "path" | "header";
558
+ flag: string;
314
559
  default?: unknown;
315
560
  description?: string | undefined;
316
- enum?: string[] | undefined;
317
561
  items?: "string" | "number" | "integer" | undefined;
562
+ enum?: string[] | undefined;
563
+ pattern?: string | undefined;
318
564
  example?: unknown;
319
565
  alias?: string | undefined;
320
566
  }[];
321
- method: "get" | "post" | "put" | "patch" | "delete";
322
- path: string;
323
- group: string;
324
567
  operationId: string;
568
+ group: string;
325
569
  action: string;
326
- auth: boolean;
327
570
  summary: string;
328
- view: "json" | "table" | "keyValue";
329
- pagination: "none" | "top" | "perCompany";
571
+ credits: number;
572
+ tier: string;
573
+ fields: string[];
574
+ view: "table" | "json" | "keyValue";
330
575
  body?: {
331
576
  required: boolean;
332
577
  contentType: "application/json";
578
+ fields: {
579
+ path: string[];
580
+ type: "string" | "number" | "boolean" | "integer" | "array";
581
+ required: boolean;
582
+ flag: string;
583
+ description?: string | undefined;
584
+ items?: "string" | "number" | "integer" | undefined;
585
+ alias?: string | undefined;
586
+ }[];
333
587
  example?: unknown;
334
588
  } | undefined;
589
+ select?: Record<string, string> | undefined;
590
+ positional?: {
591
+ name: string;
592
+ required: boolean;
593
+ variadic?: "comma" | "space" | undefined;
594
+ } | undefined;
335
595
  exampleParams?: string[] | undefined;
336
- rowsPath?: string | undefined;
337
596
  columns?: string[] | undefined;
338
- allItemsPath?: string[] | undefined;
597
+ download?: string | undefined;
339
598
  }>, "many">;
340
599
  }, "strict", z.ZodTypeAny, {
341
600
  specVersion: string;
342
601
  specSha256: string;
343
602
  groups: {
344
- description: string;
345
603
  name: string;
604
+ description: string;
346
605
  }[];
347
606
  operations: {
607
+ method: "get" | "post" | "put" | "patch" | "delete";
608
+ path: string;
609
+ auth: boolean;
610
+ list: boolean;
348
611
  params: {
349
- type: "string" | "number" | "boolean" | "array" | "integer";
612
+ type: "string" | "number" | "boolean" | "integer" | "array";
350
613
  name: string;
351
614
  required: boolean;
352
- in: "path" | "query";
615
+ in: "query" | "path" | "header";
616
+ flag: string;
353
617
  default?: unknown;
354
618
  description?: string | undefined;
355
- enum?: string[] | undefined;
356
619
  items?: "string" | "number" | "integer" | undefined;
620
+ enum?: string[] | undefined;
621
+ pattern?: string | undefined;
357
622
  example?: unknown;
358
623
  alias?: string | undefined;
359
624
  }[];
360
- method: "get" | "post" | "put" | "patch" | "delete";
361
- path: string;
362
- group: string;
363
625
  operationId: string;
626
+ group: string;
364
627
  action: string;
365
- auth: boolean;
366
628
  summary: string;
367
- view: "json" | "table" | "keyValue";
368
- pagination: "none" | "top" | "perCompany";
629
+ credits: number;
630
+ tier: string;
631
+ fields: string[];
632
+ view: "table" | "json" | "keyValue";
369
633
  body?: {
370
634
  required: boolean;
371
635
  contentType: "application/json";
636
+ fields: {
637
+ path: string[];
638
+ type: "string" | "number" | "boolean" | "integer" | "array";
639
+ required: boolean;
640
+ flag: string;
641
+ description?: string | undefined;
642
+ items?: "string" | "number" | "integer" | undefined;
643
+ alias?: string | undefined;
644
+ }[];
372
645
  example?: unknown;
373
646
  } | undefined;
647
+ select?: Record<string, string> | undefined;
648
+ positional?: {
649
+ name: string;
650
+ required: boolean;
651
+ variadic?: "comma" | "space" | undefined;
652
+ } | undefined;
374
653
  exampleParams?: string[] | undefined;
375
- rowsPath?: string | undefined;
376
654
  columns?: string[] | undefined;
377
- allItemsPath?: string[] | undefined;
655
+ download?: string | undefined;
378
656
  }[];
379
657
  }, {
380
658
  specVersion: string;
381
659
  specSha256: string;
382
660
  groups: {
383
- description: string;
384
661
  name: string;
662
+ description: string;
385
663
  }[];
386
664
  operations: {
665
+ method: "get" | "post" | "put" | "patch" | "delete";
666
+ path: string;
667
+ auth: boolean;
668
+ list: boolean;
387
669
  params: {
388
- type: "string" | "number" | "boolean" | "array" | "integer";
670
+ type: "string" | "number" | "boolean" | "integer" | "array";
389
671
  name: string;
390
672
  required: boolean;
391
- in: "path" | "query";
673
+ in: "query" | "path" | "header";
674
+ flag: string;
392
675
  default?: unknown;
393
676
  description?: string | undefined;
394
- enum?: string[] | undefined;
395
677
  items?: "string" | "number" | "integer" | undefined;
678
+ enum?: string[] | undefined;
679
+ pattern?: string | undefined;
396
680
  example?: unknown;
397
681
  alias?: string | undefined;
398
682
  }[];
399
- method: "get" | "post" | "put" | "patch" | "delete";
400
- path: string;
401
- group: string;
402
683
  operationId: string;
684
+ group: string;
403
685
  action: string;
404
- auth: boolean;
405
686
  summary: string;
406
- view: "json" | "table" | "keyValue";
407
- pagination: "none" | "top" | "perCompany";
687
+ credits: number;
688
+ tier: string;
689
+ fields: string[];
690
+ view: "table" | "json" | "keyValue";
408
691
  body?: {
409
692
  required: boolean;
410
693
  contentType: "application/json";
694
+ fields: {
695
+ path: string[];
696
+ type: "string" | "number" | "boolean" | "integer" | "array";
697
+ required: boolean;
698
+ flag: string;
699
+ description?: string | undefined;
700
+ items?: "string" | "number" | "integer" | undefined;
701
+ alias?: string | undefined;
702
+ }[];
411
703
  example?: unknown;
412
704
  } | undefined;
705
+ select?: Record<string, string> | undefined;
706
+ positional?: {
707
+ name: string;
708
+ required: boolean;
709
+ variadic?: "comma" | "space" | undefined;
710
+ } | undefined;
413
711
  exampleParams?: string[] | undefined;
414
- rowsPath?: string | undefined;
415
712
  columns?: string[] | undefined;
416
- allItemsPath?: string[] | undefined;
713
+ download?: string | undefined;
417
714
  }[];
418
715
  }>;
419
716
  export type ManifestParam = z.infer<typeof manifestParamSchema>;
420
- /** A param's spec example as its flag takes it: an array comma-joined, anything else as its text. */
421
- export declare const exampleValue: (example: unknown) => string;
717
+ export type ManifestBodyField = z.infer<typeof bodyFieldSchema>;
422
718
  export type ManifestOperation = z.infer<typeof manifestOperationSchema>;
423
719
  export type Manifest = z.infer<typeof manifestSchema>;
720
+ /** A param's spec example as its flag takes it: an array comma-joined, anything else as its text. */
721
+ export declare const exampleValue: (example: unknown) => string;
722
+ /** `invd <group> <action>` without the program name (`financials`, `companies get`). */
723
+ export declare const commandName: (operation: Pick<ManifestOperation, "group" | "action">) => string;
424
724
  /** Parses a loaded manifest; a corrupt file fails by name rather than registering half a CLI. */
425
725
  export declare function parseManifest(raw: unknown, source?: string): Manifest;
426
726
  export {};