@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/garden.js ADDED
@@ -0,0 +1,76 @@
1
+ import { idempotencyHeaders, ifMatchHeaders } from './idempotency.js';
2
+ const query = (q) => Object.fromEntries(Object.entries(q).filter(([, v]) => v !== undefined));
3
+ /** Garden (finance): books, chart of accounts, journal, customers and vendors, invoices, payments, payouts,
4
+ * reports and the audit trail. Changes to an existing record take the `version` you read (sent as If-Match);
5
+ * payments, payouts and invoice receipts take an optional idempotency key (a retry returns the first result). */
6
+ export function gardenModule(client) {
7
+ return {
8
+ whoami: () => client.request('garden_whoami'),
9
+ books: {
10
+ list: (includeArchived) => client.request('garden_listBooks', includeArchived === undefined ? {} : { include_archived: includeArchived }),
11
+ get: (books) => client.request('garden_getBooks', { books }),
12
+ create: (body) => client.request('garden_createBooks', { body }),
13
+ update: (books, version, body) => client.request('garden_updateBooks', { books, body }, { headers: ifMatchHeaders('garden_updateBooks', version) }),
14
+ archive: (books, version) => client.request('garden_archiveBooks', { books }, { headers: ifMatchHeaders('garden_archiveBooks', version) }),
15
+ accounts: (books, includeArchived) => client.request('garden_listAccounts', includeArchived === undefined ? { books } : { books, include_archived: includeArchived }),
16
+ createAccount: (books, body) => client.request('garden_createAccount', { books, body }),
17
+ journalEntries: (books, filter = {}) => client.request('garden_listJournalEntries', query({ books, ...filter })),
18
+ createJournalEntry: (books, body) => client.request('garden_createJournalEntry', { books, body }),
19
+ counterparties: (books, filter = {}) => client.request('garden_listCounterparties', query({ books, ...filter })),
20
+ createCounterparty: (books, body) => client.request('garden_createCounterparty', { books, body }),
21
+ invoices: (books, filter = {}) => client.request('garden_listInvoices', query({ books, ...filter })),
22
+ createInvoice: (books, body) => client.request('garden_createInvoice', { books, body }),
23
+ payments: (books, filter = {}) => client.request('garden_listPayments', query({ books, ...filter })),
24
+ /** 201 when it settled, 202 while it waits for authority, 200 when replayed with the same key. */
25
+ createPayment: (books, body, idempotencyKey) => client.request('garden_createPayment', { books, body }, { headers: idempotencyHeaders('garden_createPayment', idempotencyKey) }),
26
+ payouts: (books, filter = {}) => client.request('garden_listPayouts', query({ books, ...filter })),
27
+ /** Needs garden:manage. 201 when it settled, 202 while it waits for authority, 200 when replayed with the same key. */
28
+ createPayout: (books, body, idempotencyKey) => client.request('garden_createPayout', { books, body }, { headers: idempotencyHeaders('garden_createPayout', idempotencyKey) }),
29
+ /** Oldest first from `after` (response `next_after`), or newest first with `order: 'desc'` from `before` (response `next_before`). */
30
+ events: (books, page = {}) => client.request('garden_listEvents', query({ books, ...page })),
31
+ verifyEvents: (books) => client.request('garden_verifyEvents', { books }),
32
+ },
33
+ reports: {
34
+ trialBalance: (books, asOf) => client.request('garden_getTrialBalance', query({ books, as_of: asOf })),
35
+ balanceSheet: (books, asOf) => client.request('garden_getBalanceSheet', query({ books, as_of: asOf })),
36
+ incomeStatement: (books, from, to) => client.request('garden_getIncomeStatement', { books, from, to }),
37
+ arAging: (books, asOf) => client.request('garden_getArAging', query({ books, as_of: asOf })),
38
+ },
39
+ accounts: {
40
+ get: (account) => client.request('garden_getAccount', { account }),
41
+ update: (account, version, body) => client.request('garden_updateAccount', { account, body }, { headers: ifMatchHeaders('garden_updateAccount', version) }),
42
+ },
43
+ journalEntries: {
44
+ get: (entry) => client.request('garden_getJournalEntry', { entry }),
45
+ update: (entry, version, body) => client.request('garden_updateJournalEntry', { entry, body }, { headers: ifMatchHeaders('garden_updateJournalEntry', version) }),
46
+ discard: (entry, version) => client.request('garden_discardJournalEntry', { entry }, { headers: ifMatchHeaders('garden_discardJournalEntry', version) }),
47
+ post: (entry, version) => client.request('garden_postJournalEntry', { entry }, { headers: ifMatchHeaders('garden_postJournalEntry', version) }),
48
+ reverse: (entry, body = {}) => client.request('garden_reverseJournalEntry', { entry, body }),
49
+ },
50
+ counterparties: {
51
+ get: (counterparty) => client.request('garden_getCounterparty', { counterparty }),
52
+ update: (counterparty, version, body) => client.request('garden_updateCounterparty', { counterparty, body }, { headers: ifMatchHeaders('garden_updateCounterparty', version) }),
53
+ },
54
+ invoices: {
55
+ get: (invoice) => client.request('garden_getInvoice', { invoice }),
56
+ update: (invoice, version, body) => client.request('garden_updateInvoice', { invoice, body }, { headers: ifMatchHeaders('garden_updateInvoice', version) }),
57
+ finalize: (invoice, version) => client.request('garden_finalizeInvoice', { invoice }, { headers: ifMatchHeaders('garden_finalizeInvoice', version) }),
58
+ void: (invoice, version, body = {}) => client.request('garden_voidInvoice', { invoice, body }, { headers: ifMatchHeaders('garden_voidInvoice', version) }),
59
+ markUncollectible: (invoice, version, body = {}) => client.request('garden_markInvoiceUncollectible', { invoice, body }, { headers: ifMatchHeaders('garden_markInvoiceUncollectible', version) }),
60
+ /** 201 when recorded, 200 when replayed with the same key. */
61
+ recordPayment: (invoice, body, idempotencyKey) => client.request('garden_recordInvoicePayment', { invoice, body }, { headers: idempotencyHeaders('garden_recordInvoicePayment', idempotencyKey) }),
62
+ },
63
+ payments: {
64
+ get: (payment) => client.request('garden_getPayment', { payment }),
65
+ /** As the principal Auto escalated to: 200 when it settled or failed, 202 while it still waits. */
66
+ authorize: (payment) => client.request('garden_authorizePayment', { payment }),
67
+ cancel: (payment, body = {}) => client.request('garden_cancelPayment', { payment, body }),
68
+ },
69
+ /** Payout authorize and cancel need garden:manage. */
70
+ payouts: {
71
+ get: (payout) => client.request('garden_getPayout', { payout }),
72
+ authorize: (payout) => client.request('garden_authorizePayout', { payout }),
73
+ cancel: (payout, body = {}) => client.request('garden_cancelPayout', { payout, body }),
74
+ },
75
+ };
76
+ }
@@ -0,0 +1,365 @@
1
+ import type { GenesisClient } from './client.js';
2
+ import type { OperationInput as In } from './types.js';
3
+ /** Reads the gateway answers itself (status, caller, errors, spec, usage). Gateway-only: there is no direct upstream. */
4
+ export declare function gatewayModule(client: GenesisClient): {
5
+ /** Live state of each Genesis service (public). */
6
+ status: () => Promise<{
7
+ object: "gateway_status";
8
+ checked_at: string;
9
+ cache_ttl_seconds: number;
10
+ services: {
11
+ service: string;
12
+ state: "up" | "degraded" | "down" | "unknown" | "disabled";
13
+ http_status?: number;
14
+ latency_ms?: number;
15
+ reason?: string;
16
+ }[];
17
+ }>;
18
+ /** The verified caller as the gateway sees it: kind, org, principal, scopes, selected context. */
19
+ whoami: () => Promise<{
20
+ object: "principal";
21
+ kind: "api_key" | "m2m_token" | "bridge_session";
22
+ org: string;
23
+ principal: string;
24
+ scopes: string[];
25
+ selected_context?: {
26
+ organization_id?: string;
27
+ project_id?: string | null;
28
+ workspace_id?: string | null;
29
+ platform_id?: string;
30
+ environment?: string;
31
+ };
32
+ }>;
33
+ /** Your organization's usage, or one service's detail with `service`. Login session with genesis.usage.read. */
34
+ usage: (service?: string) => Promise<{
35
+ object: string;
36
+ org_id: string;
37
+ } & {
38
+ [key: string]: unknown;
39
+ }>;
40
+ /** Every error code the gateway emits (public). */
41
+ errors: () => Promise<{
42
+ object: "list";
43
+ docs_url: string;
44
+ data: {
45
+ code: string;
46
+ status: number;
47
+ type: string;
48
+ description: string;
49
+ }[];
50
+ }>;
51
+ /** The OpenAPI document this gateway serves (public). */
52
+ openapi: () => Promise<{
53
+ [key: string]: unknown;
54
+ }>;
55
+ /** Auth's public discovery documents, passed through unchanged (public). `issuer` stays https://auth.life.one. */
56
+ auth: {
57
+ /** OpenID Connect discovery document (`/.well-known/openid-configuration`). */
58
+ openidConfiguration: () => Promise<{
59
+ [key: string]: unknown;
60
+ }>;
61
+ /** JSON Web Key Set that verifies Auth-issued tokens (`/.well-known/jwks.json`). */
62
+ jwks: () => Promise<{
63
+ [key: string]: unknown;
64
+ }>;
65
+ /** One account discovery document (`/.well-known/lifeid`). */
66
+ lifeid: () => Promise<{
67
+ [key: string]: unknown;
68
+ }>;
69
+ };
70
+ };
71
+ /** Your own organization's usage and billing reads. Login session only; `org` must be the session's organization. */
72
+ export declare function orgsModule(client: GenesisClient): {
73
+ usage: (org: string) => Promise<{
74
+ object: string;
75
+ org_id: string;
76
+ } & {
77
+ [key: string]: unknown;
78
+ }>;
79
+ observations: (org: string, days?: 7 | 30) => Promise<{
80
+ object: string;
81
+ org_id: string;
82
+ } & {
83
+ [key: string]: unknown;
84
+ }>;
85
+ billing: (org: string) => Promise<{
86
+ object: string;
87
+ org_id: string;
88
+ } & {
89
+ [key: string]: unknown;
90
+ }>;
91
+ paymentMethods: (org: string) => Promise<{
92
+ object: "org_payment_methods";
93
+ org_id: string;
94
+ has_more: boolean;
95
+ data: {
96
+ type: string;
97
+ card_brand: string | null;
98
+ last4: string | null;
99
+ exp_month: number | null;
100
+ exp_year: number | null;
101
+ default: boolean;
102
+ }[];
103
+ }>;
104
+ service: (org: string, service: string) => Promise<{
105
+ object: string;
106
+ org_id: string;
107
+ } & {
108
+ [key: string]: unknown;
109
+ }>;
110
+ };
111
+ /**
112
+ * Your organization's billing: account, contacts, tax IDs, activity, quotas and quota requests, the Minds account,
113
+ * invoices, the raw usage report and the public service catalog. A login session, or an org API key bound to `org`
114
+ * holding genesis.billing.read (reads), genesis.billing.manage (writes) or genesis.usage.read (usage report).
115
+ * Writes need a stable idempotency key; reuse it to replay instead of acting twice. Nothing here pays or charges.
116
+ */
117
+ export declare function billingModule(client: GenesisClient): {
118
+ account: {
119
+ get: (org: string) => Promise<{
120
+ object: "billing_account";
121
+ org_id: string;
122
+ environment: "sandbox" | "live";
123
+ status: "not_created" | "active" | "customer_deleted";
124
+ legal_name?: string | null;
125
+ email?: string | null;
126
+ phone?: string | null;
127
+ address?: import("./index.js").components["schemas"]["Gateway.BillingAddress"] | null;
128
+ currency?: string;
129
+ invoice?: {
130
+ po_number?: string | null;
131
+ memo?: string | null;
132
+ };
133
+ stripe?: {
134
+ account_id?: string;
135
+ customer_id?: string | null;
136
+ livemode?: boolean;
137
+ };
138
+ created_at?: string | null;
139
+ updated_at?: string | null;
140
+ }>;
141
+ update: (org: string, body: In<"gateway_updateBillingAccount">["body"], idempotencyKey: string) => Promise<{
142
+ object: "billing_account";
143
+ org_id: string;
144
+ environment: "sandbox" | "live";
145
+ status: "not_created" | "active" | "customer_deleted";
146
+ legal_name?: string | null;
147
+ email?: string | null;
148
+ phone?: string | null;
149
+ address?: import("./index.js").components["schemas"]["Gateway.BillingAddress"] | null;
150
+ currency?: string;
151
+ invoice?: {
152
+ po_number?: string | null;
153
+ memo?: string | null;
154
+ };
155
+ stripe?: {
156
+ account_id?: string;
157
+ customer_id?: string | null;
158
+ livemode?: boolean;
159
+ };
160
+ created_at?: string | null;
161
+ updated_at?: string | null;
162
+ }>;
163
+ activity: (org: string) => Promise<{
164
+ object: "list";
165
+ data: {
166
+ object: "billing_activity";
167
+ id: string;
168
+ at: string;
169
+ actor: string;
170
+ surface: string;
171
+ action: string;
172
+ target?: string | null;
173
+ changed?: string[];
174
+ request_id?: string | null;
175
+ stripe_request_id?: string | null;
176
+ }[];
177
+ }>;
178
+ };
179
+ contacts: {
180
+ list: (org: string) => Promise<{
181
+ object: "list";
182
+ data: import("./index.js").components["schemas"]["Gateway.BillingContact"][];
183
+ }>;
184
+ create: (org: string, body: In<"gateway_createBillingContact">["body"], idempotencyKey: string) => Promise<{
185
+ object: "billing_contact";
186
+ id: string;
187
+ email: string;
188
+ name?: string | null;
189
+ created_at?: string;
190
+ }>;
191
+ delete: (org: string, contactId: string, idempotencyKey: string) => Promise<{
192
+ object: "billing_contact" | "billing_tax_id";
193
+ id: string;
194
+ deleted: true;
195
+ }>;
196
+ };
197
+ taxIds: {
198
+ list: (org: string) => Promise<{
199
+ object: "list";
200
+ data: import("./index.js").components["schemas"]["Gateway.BillingTaxId"][];
201
+ }>;
202
+ create: (org: string, body: In<"gateway_createBillingTaxId">["body"], idempotencyKey: string) => Promise<{
203
+ object: "billing_tax_id";
204
+ id: string;
205
+ type: string;
206
+ value: string;
207
+ country?: string | null;
208
+ verification?: {
209
+ status?: string;
210
+ verified_name?: string | null;
211
+ } | null;
212
+ }>;
213
+ delete: (org: string, taxId: string, idempotencyKey: string) => Promise<{
214
+ object: "billing_contact" | "billing_tax_id";
215
+ id: string;
216
+ deleted: true;
217
+ }>;
218
+ };
219
+ quotas: {
220
+ get: (org: string) => Promise<{
221
+ object: "org_quotas";
222
+ org_id: string;
223
+ coverage_rule?: string;
224
+ pools: ({
225
+ pool?: string;
226
+ label?: string;
227
+ products?: string[];
228
+ tier?: {
229
+ [key: string]: unknown;
230
+ };
231
+ org?: {
232
+ [key: string]: unknown;
233
+ };
234
+ user?: {
235
+ [key: string]: unknown;
236
+ };
237
+ how_to_raise?: {
238
+ [key: string]: unknown;
239
+ };
240
+ placeholder_limits?: boolean;
241
+ } & {
242
+ [key: string]: unknown;
243
+ })[];
244
+ }>;
245
+ requests: {
246
+ list: (org: string) => Promise<{
247
+ object: "list";
248
+ data: import("./index.js").components["schemas"]["Gateway.QuotaRequest"][];
249
+ }>;
250
+ create: (org: string, body: In<"gateway_createQuotaRequest">["body"], idempotencyKey: string) => Promise<{
251
+ object?: "quota_increase_request";
252
+ id: number;
253
+ pool: string;
254
+ org_id: string;
255
+ requested_by?: string;
256
+ scope: "org" | "user";
257
+ max_concurrent_units?: number | null;
258
+ max_monthly_hours?: number | null;
259
+ justification?: string;
260
+ status: string;
261
+ decided_by?: string | null;
262
+ decision_note?: string | null;
263
+ }>;
264
+ };
265
+ };
266
+ minds: {
267
+ account: (org: string) => Promise<{
268
+ object: string;
269
+ org_id: string;
270
+ } & {
271
+ [key: string]: unknown;
272
+ }>;
273
+ };
274
+ invoices: (org: string, query?: {
275
+ service?: string;
276
+ limit?: number;
277
+ }) => Promise<{
278
+ object: "list";
279
+ org_id: string;
280
+ service?: string | null;
281
+ has_more: boolean;
282
+ data: {
283
+ [key: string]: unknown;
284
+ }[];
285
+ }>;
286
+ usage: {
287
+ /** Raw metered quantities over a window (ISO-8601 UTC `from`/`to`, default the last 30 days). */
288
+ report: (org: string, query?: {
289
+ service?: string;
290
+ from?: string;
291
+ to?: string;
292
+ }) => Promise<{
293
+ object: "usage";
294
+ org_id: string;
295
+ service?: string | null;
296
+ period: {
297
+ from?: string;
298
+ to?: string;
299
+ };
300
+ generated_at: string;
301
+ metered: boolean;
302
+ data: {
303
+ service?: string;
304
+ meter?: string;
305
+ unit?: string | null;
306
+ quantity?: string;
307
+ event_count?: number;
308
+ first_occurred_at?: string;
309
+ last_occurred_at?: string;
310
+ }[];
311
+ }>;
312
+ /** Allowance consumption, one line per service (same as genesis.orgs.usage). */
313
+ get: (org: string) => Promise<{
314
+ object: string;
315
+ org_id: string;
316
+ } & {
317
+ [key: string]: unknown;
318
+ }>;
319
+ observations: (org: string, days?: 7 | 30) => Promise<{
320
+ object: string;
321
+ org_id: string;
322
+ } & {
323
+ [key: string]: unknown;
324
+ }>;
325
+ };
326
+ summary: (org: string) => Promise<{
327
+ object: string;
328
+ org_id: string;
329
+ } & {
330
+ [key: string]: unknown;
331
+ }>;
332
+ paymentMethods: (org: string) => Promise<{
333
+ object: "org_payment_methods";
334
+ org_id: string;
335
+ has_more: boolean;
336
+ data: {
337
+ type: string;
338
+ card_brand: string | null;
339
+ last4: string | null;
340
+ exp_month: number | null;
341
+ exp_year: number | null;
342
+ default: boolean;
343
+ }[];
344
+ }>;
345
+ service: (org: string, service: string) => Promise<{
346
+ object: string;
347
+ org_id: string;
348
+ } & {
349
+ [key: string]: unknown;
350
+ }>;
351
+ /** The metered service catalog (public, no credential). */
352
+ catalog: () => Promise<{
353
+ object: "list";
354
+ data: {
355
+ service: string;
356
+ display_name: string;
357
+ meter_status: string;
358
+ meters: {
359
+ event_name?: string;
360
+ code_meter?: string | null;
361
+ unit?: string;
362
+ }[];
363
+ }[];
364
+ }>;
365
+ };
@@ -0,0 +1,82 @@
1
+ import { idempotencyHeaders } from './idempotency.js';
2
+ /** Reads the gateway answers itself (status, caller, errors, spec, usage). Gateway-only: there is no direct upstream. */
3
+ export function gatewayModule(client) {
4
+ return {
5
+ /** Live state of each Genesis service (public). */
6
+ status: () => client.request('gateway_getStatus'),
7
+ /** The verified caller as the gateway sees it: kind, org, principal, scopes, selected context. */
8
+ whoami: () => client.request('gateway_whoami'),
9
+ /** Your organization's usage, or one service's detail with `service`. Login session with genesis.usage.read. */
10
+ usage: (service) => client.request('gateway_getUsage', service === undefined ? {} : { service }),
11
+ /** Every error code the gateway emits (public). */
12
+ errors: () => client.request('gateway_listErrors'),
13
+ /** The OpenAPI document this gateway serves (public). */
14
+ openapi: () => client.request('gateway_getOpenApi'),
15
+ /** Auth's public discovery documents, passed through unchanged (public). `issuer` stays https://auth.life.one. */
16
+ auth: {
17
+ /** OpenID Connect discovery document (`/.well-known/openid-configuration`). */
18
+ openidConfiguration: () => client.request('gateway_getAuthOpenIdConfiguration'),
19
+ /** JSON Web Key Set that verifies Auth-issued tokens (`/.well-known/jwks.json`). */
20
+ jwks: () => client.request('gateway_getAuthJwks'),
21
+ /** One account discovery document (`/.well-known/lifeid`). */
22
+ lifeid: () => client.request('gateway_getAuthLifeId'),
23
+ },
24
+ };
25
+ }
26
+ /** Your own organization's usage and billing reads. Login session only; `org` must be the session's organization. */
27
+ export function orgsModule(client) {
28
+ return {
29
+ usage: (org) => client.request('gateway_getOrgUsage', { org }),
30
+ observations: (org, days) => client.request('gateway_getOrgUsageObservations', { org, ...(days === undefined ? {} : { days }) }),
31
+ billing: (org) => client.request('gateway_getOrgBilling', { org }),
32
+ paymentMethods: (org) => client.request('gateway_listOrgPaymentMethods', { org }),
33
+ service: (org, service) => client.request('gateway_getOrgServiceBilling', { org, service }),
34
+ };
35
+ }
36
+ /**
37
+ * Your organization's billing: account, contacts, tax IDs, activity, quotas and quota requests, the Minds account,
38
+ * invoices, the raw usage report and the public service catalog. A login session, or an org API key bound to `org`
39
+ * holding genesis.billing.read (reads), genesis.billing.manage (writes) or genesis.usage.read (usage report).
40
+ * Writes need a stable idempotency key; reuse it to replay instead of acting twice. Nothing here pays or charges.
41
+ */
42
+ export function billingModule(client) {
43
+ const write = (id, input, idempotencyKey) => client.request(id, input, { headers: idempotencyHeaders(id, idempotencyKey) });
44
+ return {
45
+ account: {
46
+ get: (org) => client.request('gateway_getBillingAccount', { org }),
47
+ update: (org, body, idempotencyKey) => write('gateway_updateBillingAccount', { org, body }, idempotencyKey),
48
+ activity: (org) => client.request('gateway_listBillingActivity', { org }),
49
+ },
50
+ contacts: {
51
+ list: (org) => client.request('gateway_listBillingContacts', { org }),
52
+ create: (org, body, idempotencyKey) => write('gateway_createBillingContact', { org, body }, idempotencyKey),
53
+ delete: (org, contactId, idempotencyKey) => write('gateway_deleteBillingContact', { org, contact_id: contactId }, idempotencyKey),
54
+ },
55
+ taxIds: {
56
+ list: (org) => client.request('gateway_listBillingTaxIds', { org }),
57
+ create: (org, body, idempotencyKey) => write('gateway_createBillingTaxId', { org, body }, idempotencyKey),
58
+ delete: (org, taxId, idempotencyKey) => write('gateway_deleteBillingTaxId', { org, tax_id: taxId }, idempotencyKey),
59
+ },
60
+ quotas: {
61
+ get: (org) => client.request('gateway_getOrgQuotas', { org }),
62
+ requests: {
63
+ list: (org) => client.request('gateway_listQuotaRequests', { org }),
64
+ create: (org, body, idempotencyKey) => write('gateway_createQuotaRequest', { org, body }, idempotencyKey),
65
+ },
66
+ },
67
+ minds: { account: (org) => client.request('gateway_getMindsAccount', { org }) },
68
+ invoices: (org, query = {}) => client.request('gateway_listOrgInvoices', { org, ...query }),
69
+ usage: {
70
+ /** Raw metered quantities over a window (ISO-8601 UTC `from`/`to`, default the last 30 days). */
71
+ report: (org, query = {}) => client.request('gateway_getOrgUsageReport', { org, ...query }),
72
+ /** Allowance consumption, one line per service (same as genesis.orgs.usage). */
73
+ get: (org) => client.request('gateway_getOrgUsage', { org }),
74
+ observations: (org, days) => client.request('gateway_getOrgUsageObservations', { org, ...(days === undefined ? {} : { days }) }),
75
+ },
76
+ summary: (org) => client.request('gateway_getOrgBilling', { org }),
77
+ paymentMethods: (org) => client.request('gateway_listOrgPaymentMethods', { org }),
78
+ service: (org, service) => client.request('gateway_getOrgServiceBilling', { org, service }),
79
+ /** The metered service catalog (public, no credential). */
80
+ catalog: () => client.request('gateway_listBillingServices'),
81
+ };
82
+ }
package/dist/gears.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { GenesisClient } from './client.js';
2
2
  import type { OperationInput as In } from './types.js';
3
- /** Gears durable workflows: exactly the gateway-admitted reads, register, start and signal.
4
- * Writes take an optional idempotency key; with one, a retry returns the original result. */
3
+ /** Gears durable workflows: exactly the gateway-admitted reads, register, start, signal and run lifecycle verbs.
4
+ * Writes the service keys by Idempotency-Key take an optional key; with one, a retry returns the original result. */
5
5
  export declare function gearsModule(client: GenesisClient): {
6
6
  workflows: {
7
7
  list: () => Promise<{
@@ -71,7 +71,126 @@ export declare function gearsModule(client: GenesisClient): {
71
71
  stationSessionId?: string | null;
72
72
  }>;
73
73
  signal: (id: string, body: In<"gears_signalRun">["body"], idempotencyKey?: string) => Promise<Record<string, never>>;
74
+ cancel: (id: string, idempotencyKey?: string) => Promise<{
75
+ id: string;
76
+ scope?: import("./index.js").components["schemas"]["Gears.Scope"];
77
+ workflowId: string;
78
+ workflowVersion: string;
79
+ status: "Running" | "Succeeded" | "Failed" | "Cancelled";
80
+ actorId: string;
81
+ inputRef: string;
82
+ contextFrameId?: string | null;
83
+ stationSessionId?: string | null;
84
+ }>;
85
+ resume: (id: string) => Promise<{
86
+ id: string;
87
+ scope?: import("./index.js").components["schemas"]["Gears.Scope"];
88
+ workflowId: string;
89
+ workflowVersion: string;
90
+ status: "Running" | "Succeeded" | "Failed" | "Cancelled";
91
+ actorId: string;
92
+ inputRef: string;
93
+ contextFrameId?: string | null;
94
+ stationSessionId?: string | null;
95
+ }>;
96
+ complete: (id: string, body: In<"gears_completeRun">["body"], idempotencyKey?: string) => Promise<{
97
+ id: string;
98
+ scope?: import("./index.js").components["schemas"]["Gears.Scope"];
99
+ workflowId: string;
100
+ workflowVersion: string;
101
+ status: "Running" | "Succeeded" | "Failed" | "Cancelled";
102
+ actorId: string;
103
+ inputRef: string;
104
+ contextFrameId?: string | null;
105
+ stationSessionId?: string | null;
106
+ }>;
107
+ fail: (id: string, body: In<"gears_failRun">["body"], idempotencyKey?: string) => Promise<{
108
+ id: string;
109
+ scope?: import("./index.js").components["schemas"]["Gears.Scope"];
110
+ workflowId: string;
111
+ workflowVersion: string;
112
+ status: "Running" | "Succeeded" | "Failed" | "Cancelled";
113
+ actorId: string;
114
+ inputRef: string;
115
+ contextFrameId?: string | null;
116
+ stationSessionId?: string | null;
117
+ }>;
118
+ timers: {
119
+ start: (id: string, body: In<"gears_startTimer">["body"], idempotencyKey?: string) => Promise<{
120
+ timerId: string;
121
+ runId: string;
122
+ actorId: string;
123
+ durationMs: number;
124
+ timerRef: string;
125
+ status: string;
126
+ }>;
127
+ };
128
+ retries: {
129
+ schedule: (id: string, body: In<"gears_scheduleRetry">["body"], idempotencyKey?: string) => Promise<{
130
+ runId: string;
131
+ stepId: string;
132
+ attempt: number;
133
+ maxAttempts: number;
134
+ backoffMs: number;
135
+ reasonRef: string;
136
+ actorId: string;
137
+ retryRef: string;
138
+ status: string;
139
+ journalSequence: number;
140
+ }>;
141
+ execute: (id: string, stepId: string, attempt: number, body: In<"gears_executeRetry">["body"], idempotencyKey?: string) => Promise<Record<string, never>>;
142
+ };
143
+ stepRefs: {
144
+ record: (id: string, body: In<"gears_recordStepRefs">["body"], idempotencyKey?: string) => Promise<Record<string, never>>;
145
+ };
146
+ children: {
147
+ start: (id: string, body: In<"gears_startChildRun">["body"]) => Promise<{
148
+ parentRunId: string;
149
+ childRunId: string;
150
+ workflowId: string;
151
+ workflowVersion: string;
152
+ actorId: string;
153
+ inputRef: string;
154
+ closePolicy: import("./index.js").components["schemas"]["Gears.ChildClosePolicy"];
155
+ childRunRef: string;
156
+ childExecutionRef: string;
157
+ status: string;
158
+ }>;
159
+ };
160
+ compensations: {
161
+ register: (id: string, body: In<"gears_registerCompensation">["body"]) => Promise<{
162
+ runId: string;
163
+ name: string;
164
+ actionRef: string;
165
+ payloadRef: string;
166
+ actorId: string;
167
+ stackIndex: number;
168
+ compensationRef: string;
169
+ status: string;
170
+ }>;
171
+ rollback: (id: string, body: In<"gears_rollbackCompensations">["body"]) => Promise<{
172
+ runId: string;
173
+ actorId: string;
174
+ results: {
175
+ name: string;
176
+ stackIndex: number;
177
+ success: boolean;
178
+ attempts: number;
179
+ compensationRef: string;
180
+ error?: string | null;
181
+ }[];
182
+ }>;
183
+ };
74
184
  };
185
+ runtime: () => Promise<{
186
+ engineId?: string;
187
+ runtimeType?: string;
188
+ configType?: string;
189
+ executionContextType?: string;
190
+ workflowHandlerTrait?: string;
191
+ defaultDispatchMode?: string;
192
+ durablePrimitives?: string[];
193
+ }>;
75
194
  records: () => Promise<{
76
195
  meterRecords?: {
77
196
  product?: string;