@onesi/genesis 0.1.13 → 0.2.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 (80) hide show
  1. package/README.md +1 -1
  2. package/dist/auto.d.ts +1010 -0
  3. package/dist/auto.js +125 -0
  4. package/dist/beacons.d.ts +42 -0
  5. package/dist/beacons.js +71 -0
  6. package/dist/blinds-owner-enrollment.d.ts +121 -0
  7. package/dist/blinds-owner-enrollment.js +23 -2
  8. package/dist/boxes.d.ts +1074 -0
  9. package/dist/boxes.js +338 -0
  10. package/dist/client.d.ts +3 -19947
  11. package/dist/client.js +127 -18
  12. package/dist/errors.d.ts +6 -0
  13. package/dist/errors.js +38 -3
  14. package/dist/flares.d.ts +32 -0
  15. package/dist/flares.js +5 -0
  16. package/dist/fleets.d.ts +32 -0
  17. package/dist/fleets.js +59 -6
  18. package/dist/flocks.d.ts +334 -1
  19. package/dist/flocks.js +85 -0
  20. package/dist/foundry.d.ts +429 -0
  21. package/dist/foundry.js +135 -0
  22. package/dist/garden.d.ts +754 -0
  23. package/dist/garden.js +76 -0
  24. package/dist/gateway.d.ts +365 -0
  25. package/dist/gateway.js +82 -0
  26. package/dist/gears.d.ts +121 -2
  27. package/dist/gears.js +24 -2
  28. package/dist/generated/operations.d.ts +3 -19948
  29. package/dist/generated/operations.js +64214 -13423
  30. package/dist/generated/schema.d.ts +85708 -17364
  31. package/dist/genesis.d.ts +9041 -1250
  32. package/dist/genesis.js +92 -25
  33. package/dist/genesis.openapi.json +133172 -31267
  34. package/dist/henry.d.ts +202 -1
  35. package/dist/henry.js +223 -0
  36. package/dist/hives-cells.d.ts +8 -3
  37. package/dist/hives-cells.js +17 -4
  38. package/dist/hives-environment.d.ts +9 -0
  39. package/dist/hives-environment.js +22 -0
  40. package/dist/hives-node.js +4 -1
  41. package/dist/hives-operations.d.ts +121 -3
  42. package/dist/hives-operations.js +2 -0
  43. package/dist/hives-platform.d.ts +149 -0
  44. package/dist/hives-platform.js +183 -0
  45. package/dist/hives-resources-transport.d.ts +7 -1
  46. package/dist/hives-resources-transport.js +10 -2
  47. package/dist/hives-sse.d.ts +24 -0
  48. package/dist/hives-sse.js +111 -0
  49. package/dist/hives-topics.d.ts +4 -3
  50. package/dist/hives-topics.js +9 -4
  51. package/dist/iam-directory.d.ts +8 -0
  52. package/dist/iam-directory.js +23 -0
  53. package/dist/iam.d.ts +397 -0
  54. package/dist/iam.js +92 -0
  55. package/dist/idempotency.d.ts +3 -0
  56. package/dist/idempotency.js +27 -0
  57. package/dist/index.d.ts +22 -6
  58. package/dist/index.js +19 -5
  59. package/dist/instances.d.ts +177 -2
  60. package/dist/instances.js +37 -5
  61. package/dist/minds-agent.d.ts +28 -0
  62. package/dist/minds-agent.js +53 -10
  63. package/dist/minds-engine.d.ts +394 -0
  64. package/dist/minds-engine.js +555 -0
  65. package/dist/minds.d.ts +109 -1
  66. package/dist/minds.js +49 -14
  67. package/dist/orgs.d.ts +405 -0
  68. package/dist/orgs.js +63 -0
  69. package/dist/redact.d.ts +37 -0
  70. package/dist/redact.js +330 -0
  71. package/dist/runner.d.ts +4 -0
  72. package/dist/runner.js +1 -0
  73. package/dist/scopes.d.ts +316 -0
  74. package/dist/scopes.js +40 -0
  75. package/dist/taps.d.ts +118 -0
  76. package/dist/taps.js +45 -0
  77. package/dist/traces.d.ts +574 -0
  78. package/dist/traces.js +97 -0
  79. package/dist/types.d.ts +12 -1
  80. package/package.json +1 -1
package/dist/orgs.d.ts ADDED
@@ -0,0 +1,405 @@
1
+ import type { GenesisClient } from './client.js';
2
+ import type { OperationInput as In } from './types.js';
3
+ type Page = {
4
+ after?: number;
5
+ limit?: number;
6
+ };
7
+ type Version = number | string;
8
+ /** A downloaded Orgs document: its bytes, media type and the sha256 the service reported (hex). */
9
+ export interface OrgsDocumentContent {
10
+ bytes: Uint8Array;
11
+ contentType: string;
12
+ sha256: string | null;
13
+ }
14
+ /**
15
+ * Orgs (legal entities): entities, the registered agent, seats, resolutions and votes, documents and
16
+ * signatures, filings, formation rehearsals and the hash-chained record. PATCH, PUT and DELETE take
17
+ * the `version` you read (sent as If-Match); a stale one is a 409. Formation never files or pays.
18
+ */
19
+ export declare function orgsEntitiesModule(client: GenesisClient): {
20
+ whoami: () => Promise<{
21
+ org: string;
22
+ principal: string;
23
+ kind: "api_key" | "m2m_token" | "bridge_session";
24
+ scopes: string[];
25
+ }>;
26
+ portals: () => Promise<{
27
+ data: import("./index.js").components["schemas"]["Orgs.Portal"][];
28
+ }>;
29
+ entities: {
30
+ list: (includeArchived?: boolean) => Promise<{
31
+ data: import("./index.js").components["schemas"]["Orgs.Entity"][];
32
+ }>;
33
+ get: (entity: string) => Promise<{
34
+ id: string;
35
+ legal_name: string;
36
+ kind: import("./index.js").components["schemas"]["Orgs.EntityKind"];
37
+ jurisdiction: string;
38
+ purpose?: string | null;
39
+ management: import("./index.js").components["schemas"]["Orgs.Management"];
40
+ addresses?: import("./index.js").components["schemas"]["Orgs.Addresses"];
41
+ registered_agent?: import("./index.js").components["schemas"]["Orgs.RegisteredAgent"] | null;
42
+ registered_agent_since?: string | null;
43
+ file_number?: string | null;
44
+ formed_on?: string | null;
45
+ auto_org_id?: string | null;
46
+ status: "draft" | "forming" | "formed" | "active" | "suspended" | "dissolved" | "archived";
47
+ version: number;
48
+ created_at?: string;
49
+ updated_at?: string;
50
+ }>;
51
+ create: (body: In<"orgs_create_entity">["body"]) => Promise<{
52
+ id: string;
53
+ legal_name: string;
54
+ kind: import("./index.js").components["schemas"]["Orgs.EntityKind"];
55
+ jurisdiction: string;
56
+ purpose?: string | null;
57
+ management: import("./index.js").components["schemas"]["Orgs.Management"];
58
+ addresses?: import("./index.js").components["schemas"]["Orgs.Addresses"];
59
+ registered_agent?: import("./index.js").components["schemas"]["Orgs.RegisteredAgent"] | null;
60
+ registered_agent_since?: string | null;
61
+ file_number?: string | null;
62
+ formed_on?: string | null;
63
+ auto_org_id?: string | null;
64
+ status: "draft" | "forming" | "formed" | "active" | "suspended" | "dissolved" | "archived";
65
+ version: number;
66
+ created_at?: string;
67
+ updated_at?: string;
68
+ }>;
69
+ update: (entity: string, version: Version, body: In<"orgs_update_entity">["body"]) => Promise<{
70
+ id: string;
71
+ legal_name: string;
72
+ kind: import("./index.js").components["schemas"]["Orgs.EntityKind"];
73
+ jurisdiction: string;
74
+ purpose?: string | null;
75
+ management: import("./index.js").components["schemas"]["Orgs.Management"];
76
+ addresses?: import("./index.js").components["schemas"]["Orgs.Addresses"];
77
+ registered_agent?: import("./index.js").components["schemas"]["Orgs.RegisteredAgent"] | null;
78
+ registered_agent_since?: string | null;
79
+ file_number?: string | null;
80
+ formed_on?: string | null;
81
+ auto_org_id?: string | null;
82
+ status: "draft" | "forming" | "formed" | "active" | "suspended" | "dissolved" | "archived";
83
+ version: number;
84
+ created_at?: string;
85
+ updated_at?: string;
86
+ }>;
87
+ archive: (entity: string, version: Version) => Promise<{
88
+ id: string;
89
+ legal_name: string;
90
+ kind: import("./index.js").components["schemas"]["Orgs.EntityKind"];
91
+ jurisdiction: string;
92
+ purpose?: string | null;
93
+ management: import("./index.js").components["schemas"]["Orgs.Management"];
94
+ addresses?: import("./index.js").components["schemas"]["Orgs.Addresses"];
95
+ registered_agent?: import("./index.js").components["schemas"]["Orgs.RegisteredAgent"] | null;
96
+ registered_agent_since?: string | null;
97
+ file_number?: string | null;
98
+ formed_on?: string | null;
99
+ auto_org_id?: string | null;
100
+ status: "draft" | "forming" | "formed" | "active" | "suspended" | "dissolved" | "archived";
101
+ version: number;
102
+ created_at?: string;
103
+ updated_at?: string;
104
+ }>;
105
+ setRegisteredAgent: (entity: string, version: Version, body: In<"orgs_set_registered_agent">["body"]) => Promise<{
106
+ id: string;
107
+ legal_name: string;
108
+ kind: import("./index.js").components["schemas"]["Orgs.EntityKind"];
109
+ jurisdiction: string;
110
+ purpose?: string | null;
111
+ management: import("./index.js").components["schemas"]["Orgs.Management"];
112
+ addresses?: import("./index.js").components["schemas"]["Orgs.Addresses"];
113
+ registered_agent?: import("./index.js").components["schemas"]["Orgs.RegisteredAgent"] | null;
114
+ registered_agent_since?: string | null;
115
+ file_number?: string | null;
116
+ formed_on?: string | null;
117
+ auto_org_id?: string | null;
118
+ status: "draft" | "forming" | "formed" | "active" | "suspended" | "dissolved" | "archived";
119
+ version: number;
120
+ created_at?: string;
121
+ updated_at?: string;
122
+ }>;
123
+ removeRegisteredAgent: (entity: string, version: Version) => Promise<{
124
+ id: string;
125
+ legal_name: string;
126
+ kind: import("./index.js").components["schemas"]["Orgs.EntityKind"];
127
+ jurisdiction: string;
128
+ purpose?: string | null;
129
+ management: import("./index.js").components["schemas"]["Orgs.Management"];
130
+ addresses?: import("./index.js").components["schemas"]["Orgs.Addresses"];
131
+ registered_agent?: import("./index.js").components["schemas"]["Orgs.RegisteredAgent"] | null;
132
+ registered_agent_since?: string | null;
133
+ file_number?: string | null;
134
+ formed_on?: string | null;
135
+ auto_org_id?: string | null;
136
+ status: "draft" | "forming" | "formed" | "active" | "suspended" | "dissolved" | "archived";
137
+ version: number;
138
+ created_at?: string;
139
+ updated_at?: string;
140
+ }>;
141
+ seats: (entity: string, includeEnded?: boolean) => Promise<{
142
+ data: import("./index.js").components["schemas"]["Orgs.Seat"][];
143
+ }>;
144
+ createSeat: (entity: string, body: In<"orgs_create_seat">["body"]) => Promise<{
145
+ id: string;
146
+ entity_id: string;
147
+ role: import("./index.js").components["schemas"]["Orgs.SeatRole"];
148
+ title?: string | null;
149
+ holder: import("./index.js").components["schemas"]["Orgs.Holder"];
150
+ voting_weight: number;
151
+ status: "active" | "ended";
152
+ started_at?: string | null;
153
+ ended_at?: string | null;
154
+ version: number;
155
+ }>;
156
+ resolutions: (entity: string) => Promise<{
157
+ data: import("./index.js").components["schemas"]["Orgs.Resolution"][];
158
+ }>;
159
+ createResolution: (entity: string, body: In<"orgs_create_resolution">["body"]) => Promise<{
160
+ id: string;
161
+ entity_id: string;
162
+ body_kind: "board" | "members" | "managers";
163
+ title: string;
164
+ text: string;
165
+ votes: import("./index.js").components["schemas"]["Orgs.Vote"][];
166
+ status: "draft" | "adopted" | "rejected" | "withdrawn";
167
+ decided_at?: string | null;
168
+ version: number;
169
+ }>;
170
+ documents: (entity: string, kind?: In<"orgs_list_documents">["kind"]) => Promise<{
171
+ data: import("./index.js").components["schemas"]["Orgs.Document"][];
172
+ }>;
173
+ addDocument: (entity: string, body: In<"orgs_add_document">["body"]) => Promise<{
174
+ id: string;
175
+ entity_id: string;
176
+ kind: import("./index.js").components["schemas"]["Orgs.DocumentKind"];
177
+ title: string;
178
+ media_type: string;
179
+ bytes: number;
180
+ sha256: string;
181
+ storage?: {
182
+ kind?: "gcs" | "boxes";
183
+ file_id?: string;
184
+ };
185
+ source?: string | null;
186
+ signatures?: import("./index.js").components["schemas"]["Orgs.Signature"][];
187
+ created_by?: string;
188
+ created_at?: string;
189
+ }>;
190
+ filings: (entity: string) => Promise<{
191
+ data: import("./index.js").components["schemas"]["Orgs.Filing"][];
192
+ }>;
193
+ createFiling: (entity: string, body: In<"orgs_create_filing">["body"]) => Promise<{
194
+ id: string;
195
+ entity_id: string;
196
+ kind: import("./index.js").components["schemas"]["Orgs.FilingKind"];
197
+ jurisdiction?: string;
198
+ status: "draft" | "prepared" | "ready_to_submit" | "submitted" | "accepted" | "rejected" | "cancelled";
199
+ due_on?: string | null;
200
+ packet?: Record<string, never> | null;
201
+ fee?: unknown;
202
+ receipt?: unknown;
203
+ job_id?: string | null;
204
+ version: number;
205
+ }>;
206
+ /** Prepare the formation packet and queue a rehearsal run (202), or with `dry_run: true` only build the packet (200). */
207
+ requestFormation: (entity: string, body: In<"orgs_request_formation">["body"]) => Promise<{
208
+ packet: import("./index.js").components["schemas"]["Orgs.FormationPacket"];
209
+ }>;
210
+ formationJobs: (entity: string) => Promise<{
211
+ data: import("./index.js").components["schemas"]["Orgs.FormationJob"][];
212
+ }>;
213
+ record: (entity: string, page?: Page) => Promise<{
214
+ data: import("./index.js").components["schemas"]["Orgs.RecordEntry"][];
215
+ next_after?: number | null;
216
+ }>;
217
+ verifyRecord: (entity: string) => Promise<{
218
+ ok: boolean;
219
+ entries: number;
220
+ head?: string | null;
221
+ broken_at?: number | null;
222
+ }>;
223
+ };
224
+ seats: {
225
+ get: (seat: string) => Promise<{
226
+ id: string;
227
+ entity_id: string;
228
+ role: import("./index.js").components["schemas"]["Orgs.SeatRole"];
229
+ title?: string | null;
230
+ holder: import("./index.js").components["schemas"]["Orgs.Holder"];
231
+ voting_weight: number;
232
+ status: "active" | "ended";
233
+ started_at?: string | null;
234
+ ended_at?: string | null;
235
+ version: number;
236
+ }>;
237
+ update: (seat: string, version: Version, body: In<"orgs_update_seat">["body"]) => Promise<{
238
+ id: string;
239
+ entity_id: string;
240
+ role: import("./index.js").components["schemas"]["Orgs.SeatRole"];
241
+ title?: string | null;
242
+ holder: import("./index.js").components["schemas"]["Orgs.Holder"];
243
+ voting_weight: number;
244
+ status: "active" | "ended";
245
+ started_at?: string | null;
246
+ ended_at?: string | null;
247
+ version: number;
248
+ }>;
249
+ end: (seat: string, version: Version) => Promise<{
250
+ id: string;
251
+ entity_id: string;
252
+ role: import("./index.js").components["schemas"]["Orgs.SeatRole"];
253
+ title?: string | null;
254
+ holder: import("./index.js").components["schemas"]["Orgs.Holder"];
255
+ voting_weight: number;
256
+ status: "active" | "ended";
257
+ started_at?: string | null;
258
+ ended_at?: string | null;
259
+ version: number;
260
+ }>;
261
+ };
262
+ resolutions: {
263
+ get: (resolution: string) => Promise<{
264
+ id: string;
265
+ entity_id: string;
266
+ body_kind: "board" | "members" | "managers";
267
+ title: string;
268
+ text: string;
269
+ votes: import("./index.js").components["schemas"]["Orgs.Vote"][];
270
+ status: "draft" | "adopted" | "rejected" | "withdrawn";
271
+ decided_at?: string | null;
272
+ version: number;
273
+ }>;
274
+ vote: (resolution: string, body: In<"orgs_vote">["body"]) => Promise<{
275
+ id: string;
276
+ entity_id: string;
277
+ body_kind: "board" | "members" | "managers";
278
+ title: string;
279
+ text: string;
280
+ votes: import("./index.js").components["schemas"]["Orgs.Vote"][];
281
+ status: "draft" | "adopted" | "rejected" | "withdrawn";
282
+ decided_at?: string | null;
283
+ version: number;
284
+ }>;
285
+ };
286
+ documents: {
287
+ get: (document: string) => Promise<{
288
+ id: string;
289
+ entity_id: string;
290
+ kind: import("./index.js").components["schemas"]["Orgs.DocumentKind"];
291
+ title: string;
292
+ media_type: string;
293
+ bytes: number;
294
+ sha256: string;
295
+ storage?: {
296
+ kind?: "gcs" | "boxes";
297
+ file_id?: string;
298
+ };
299
+ source?: string | null;
300
+ signatures?: import("./index.js").components["schemas"]["Orgs.Signature"][];
301
+ created_by?: string;
302
+ created_at?: string;
303
+ }>;
304
+ /** The document's raw bytes, its content type and the sha256 the service reported. */
305
+ content: (document: string, init?: {
306
+ signal?: AbortSignal;
307
+ }) => Promise<OrgsDocumentContent>;
308
+ sign: (document: string, body: In<"orgs_sign_document">["body"]) => Promise<{
309
+ id: string;
310
+ entity_id: string;
311
+ kind: import("./index.js").components["schemas"]["Orgs.DocumentKind"];
312
+ title: string;
313
+ media_type: string;
314
+ bytes: number;
315
+ sha256: string;
316
+ storage?: {
317
+ kind?: "gcs" | "boxes";
318
+ file_id?: string;
319
+ };
320
+ source?: string | null;
321
+ signatures?: import("./index.js").components["schemas"]["Orgs.Signature"][];
322
+ created_by?: string;
323
+ created_at?: string;
324
+ }>;
325
+ };
326
+ filings: {
327
+ get: (filing: string) => Promise<{
328
+ id: string;
329
+ entity_id: string;
330
+ kind: import("./index.js").components["schemas"]["Orgs.FilingKind"];
331
+ jurisdiction?: string;
332
+ status: "draft" | "prepared" | "ready_to_submit" | "submitted" | "accepted" | "rejected" | "cancelled";
333
+ due_on?: string | null;
334
+ packet?: Record<string, never> | null;
335
+ fee?: unknown;
336
+ receipt?: unknown;
337
+ job_id?: string | null;
338
+ version: number;
339
+ }>;
340
+ update: (filing: string, version: Version, body: In<"orgs_update_filing">["body"]) => Promise<{
341
+ id: string;
342
+ entity_id: string;
343
+ kind: import("./index.js").components["schemas"]["Orgs.FilingKind"];
344
+ jurisdiction?: string;
345
+ status: "draft" | "prepared" | "ready_to_submit" | "submitted" | "accepted" | "rejected" | "cancelled";
346
+ due_on?: string | null;
347
+ packet?: Record<string, never> | null;
348
+ fee?: unknown;
349
+ receipt?: unknown;
350
+ job_id?: string | null;
351
+ version: number;
352
+ }>;
353
+ };
354
+ formationJobs: {
355
+ get: (job: string) => Promise<{
356
+ id: string;
357
+ entity_id: string;
358
+ filing_id?: string | null;
359
+ portal?: string;
360
+ mode?: "rehearsal";
361
+ runtime?: {
362
+ kind?: "panes" | "rigs" | "shells";
363
+ instance_id?: string | null;
364
+ };
365
+ model?: string | null;
366
+ status: "queued" | "running" | "stopped_at_submit" | "needs_attention" | "failed" | "cancelled";
367
+ stop_reason?: string | null;
368
+ error?: unknown;
369
+ turns?: number;
370
+ actions?: number;
371
+ usage?: unknown;
372
+ requested_by?: string;
373
+ started_at?: string | null;
374
+ finished_at?: string | null;
375
+ version?: number;
376
+ }>;
377
+ steps: (job: string, page?: Page) => Promise<{
378
+ data: import("./index.js").components["schemas"]["Orgs.FormationStep"][];
379
+ next_after?: number | null;
380
+ }>;
381
+ cancel: (job: string) => Promise<{
382
+ id: string;
383
+ entity_id: string;
384
+ filing_id?: string | null;
385
+ portal?: string;
386
+ mode?: "rehearsal";
387
+ runtime?: {
388
+ kind?: "panes" | "rigs" | "shells";
389
+ instance_id?: string | null;
390
+ };
391
+ model?: string | null;
392
+ status: "queued" | "running" | "stopped_at_submit" | "needs_attention" | "failed" | "cancelled";
393
+ stop_reason?: string | null;
394
+ error?: unknown;
395
+ turns?: number;
396
+ actions?: number;
397
+ usage?: unknown;
398
+ requested_by?: string;
399
+ started_at?: string | null;
400
+ finished_at?: string | null;
401
+ version?: number;
402
+ }>;
403
+ };
404
+ };
405
+ export {};
package/dist/orgs.js ADDED
@@ -0,0 +1,63 @@
1
+ import { ifMatchHeaders } from './idempotency.js';
2
+ /**
3
+ * Orgs (legal entities): entities, the registered agent, seats, resolutions and votes, documents and
4
+ * signatures, filings, formation rehearsals and the hash-chained record. PATCH, PUT and DELETE take
5
+ * the `version` you read (sent as If-Match); a stale one is a 409. Formation never files or pays.
6
+ */
7
+ export function orgsEntitiesModule(client) {
8
+ const guarded = (id, input, version) => client.request(id, input, { headers: ifMatchHeaders(id, version) });
9
+ return {
10
+ whoami: () => client.request('orgs_whoami'),
11
+ portals: () => client.request('orgs_list_portals'),
12
+ entities: {
13
+ list: (includeArchived) => client.request('orgs_list_entities', includeArchived === undefined ? {} : { include_archived: includeArchived }),
14
+ get: (entity) => client.request('orgs_get_entity', { entity }),
15
+ create: (body) => client.request('orgs_create_entity', { body }),
16
+ update: (entity, version, body) => guarded('orgs_update_entity', { entity, body }, version),
17
+ archive: (entity, version) => guarded('orgs_archive_entity', { entity }, version),
18
+ setRegisteredAgent: (entity, version, body) => guarded('orgs_set_registered_agent', { entity, body }, version),
19
+ removeRegisteredAgent: (entity, version) => guarded('orgs_remove_registered_agent', { entity }, version),
20
+ seats: (entity, includeEnded) => client.request('orgs_list_seats', includeEnded === undefined ? { entity } : { entity, include_ended: includeEnded }),
21
+ createSeat: (entity, body) => client.request('orgs_create_seat', { entity, body }),
22
+ resolutions: (entity) => client.request('orgs_list_resolutions', { entity }),
23
+ createResolution: (entity, body) => client.request('orgs_create_resolution', { entity, body }),
24
+ documents: (entity, kind) => client.request('orgs_list_documents', kind ? { entity, kind } : { entity }),
25
+ addDocument: (entity, body) => client.request('orgs_add_document', { entity, body }),
26
+ filings: (entity) => client.request('orgs_list_filings', { entity }),
27
+ createFiling: (entity, body) => client.request('orgs_create_filing', { entity, body }),
28
+ /** Prepare the formation packet and queue a rehearsal run (202), or with `dry_run: true` only build the packet (200). */
29
+ requestFormation: (entity, body) => client.request('orgs_request_formation', { entity, body }),
30
+ formationJobs: (entity) => client.request('orgs_list_formation_jobs', { entity }),
31
+ record: (entity, page = {}) => client.request('orgs_get_record', { entity, ...page }),
32
+ verifyRecord: (entity) => client.request('orgs_verify_record', { entity }),
33
+ },
34
+ seats: {
35
+ get: (seat) => client.request('orgs_get_seat', { seat }),
36
+ update: (seat, version, body) => guarded('orgs_update_seat', { seat, body }, version),
37
+ end: (seat, version) => guarded('orgs_end_seat', { seat }, version),
38
+ },
39
+ resolutions: {
40
+ get: (resolution) => client.request('orgs_get_resolution', { resolution }),
41
+ vote: (resolution, body) => client.request('orgs_vote', { resolution, body }),
42
+ },
43
+ documents: {
44
+ get: (document) => client.request('orgs_get_document', { document }),
45
+ /** The document's raw bytes, its content type and the sha256 the service reported. */
46
+ content: async (document, init = {}) => {
47
+ const res = await client.raw('orgs_get_document_content', { document }, init);
48
+ return { bytes: new Uint8Array(await res.arrayBuffer()), contentType: res.headers.get('content-type') ?? 'application/octet-stream',
49
+ sha256: res.headers.get('x-content-sha256') };
50
+ },
51
+ sign: (document, body) => client.request('orgs_sign_document', { document, body }),
52
+ },
53
+ filings: {
54
+ get: (filing) => client.request('orgs_get_filing', { filing }),
55
+ update: (filing, version, body) => guarded('orgs_update_filing', { filing, body }, version),
56
+ },
57
+ formationJobs: {
58
+ get: (job) => client.request('orgs_get_formation_job', { job }),
59
+ steps: (job, page = {}) => client.request('orgs_list_formation_steps', { job, ...page }),
60
+ cancel: (job) => client.request('orgs_cancel_formation_job', { job }),
61
+ },
62
+ };
63
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Redaction for service error bodies and messages before the CLI or MCP prints them. The design is
3
+ * conservative: when a key or value might be a secret, it is replaced with `[redacted]`. Field names are
4
+ * matched after normalisation (camelCase split, `-`/`.`/space to `_`, lower-cased), so `x-api-key`,
5
+ * `privateKey`, `Set-Cookie` and `client_secret` are all the same kind of name.
6
+ */
7
+ export declare const REDACTED = "[redacted]";
8
+ /** Bounds of the printed body: serialized bytes, per string, per array/object, nesting and the oversize preview. */
9
+ export declare const ERROR_BODY_LIMITS: {
10
+ readonly bytes: 16384;
11
+ readonly string: 2048;
12
+ readonly items: 100;
13
+ readonly depth: 8;
14
+ readonly preview: 4096;
15
+ };
16
+ /** True when a field of this name may hold a secret. */
17
+ export declare function secretField(key: string, value?: unknown): boolean;
18
+ /** True when a run of 12 to 19 digits passes the Luhn check and could be a card number (a `1` prefix only for 15-digit UATP cards, so ms timestamps stay readable). */
19
+ export declare function cardNumber(digits: string): boolean;
20
+ /** A value that looks random (letters and digits, no separators, 16 or more characters): an authorization code, never an error code. */
21
+ export declare const randomCode: (v: unknown) => boolean;
22
+ /** Redacts secret forms in free text: an error message, a raw body or a string field. Control and invisible characters are removed first. */
23
+ export declare function redactErrorText(text: string): string;
24
+ /** True when an object looks like an OAuth token or authorize answer (so `code` may be an authorization code). */
25
+ export declare const oauthShaped: (row: Record<string, unknown>) => boolean;
26
+ /**
27
+ * True when the `code` of this object may be an authorization code: an OAuth-shaped object, a `code` beside an
28
+ * OAuth error token (`{error: "invalid_grant", code}`), or a random-looking value. `errorBody` redacts that `code`.
29
+ */
30
+ export declare const authorizationCode: (row: Record<string, unknown>) => boolean;
31
+ /**
32
+ * A redacted, bounded copy of an error body: secret-named fields (after key normalisation, glued names included),
33
+ * header pairs (`{name, value}` in any case, `[name, value]` tuples, flat `rawHeaders`, `Name: value` lines) and
34
+ * validation echoes of secret fields, OAuth authorization codes, card numbers (Luhn-checked) and other payment or
35
+ * personal data, Stripe client secrets, secret-shaped keys and values, and JSON nested in strings, escaped or not. A result still over 16 KiB serialized becomes `{truncated, bytes, preview}` of the redacted text.
36
+ */
37
+ export declare function redactErrorBody(body: unknown): unknown;