@onesi/genesis 0.1.13 → 0.2.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 (69) 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 +109 -0
  7. package/dist/blinds-owner-enrollment.js +21 -2
  8. package/dist/client.d.ts +3 -19947
  9. package/dist/client.js +124 -17
  10. package/dist/errors.js +1 -1
  11. package/dist/flares.d.ts +32 -0
  12. package/dist/flares.js +5 -0
  13. package/dist/fleets.d.ts +32 -0
  14. package/dist/fleets.js +59 -6
  15. package/dist/flocks.d.ts +285 -1
  16. package/dist/flocks.js +59 -0
  17. package/dist/foundry.d.ts +424 -0
  18. package/dist/foundry.js +133 -0
  19. package/dist/garden.d.ts +754 -0
  20. package/dist/garden.js +76 -0
  21. package/dist/gateway.d.ts +365 -0
  22. package/dist/gateway.js +82 -0
  23. package/dist/gears.d.ts +121 -2
  24. package/dist/gears.js +24 -2
  25. package/dist/generated/operations.d.ts +3 -19948
  26. package/dist/generated/operations.js +54590 -13302
  27. package/dist/generated/schema.d.ts +69793 -17548
  28. package/dist/genesis.d.ts +7908 -1260
  29. package/dist/genesis.js +90 -25
  30. package/dist/genesis.openapi.json +109121 -29920
  31. package/dist/henry.d.ts +202 -1
  32. package/dist/henry.js +223 -0
  33. package/dist/hives-environment.d.ts +9 -0
  34. package/dist/hives-environment.js +22 -0
  35. package/dist/hives-node.js +3 -0
  36. package/dist/hives-operations.d.ts +114 -0
  37. package/dist/hives-operations.js +2 -0
  38. package/dist/hives-platform.d.ts +149 -0
  39. package/dist/hives-platform.js +183 -0
  40. package/dist/hives-sse.d.ts +24 -0
  41. package/dist/hives-sse.js +111 -0
  42. package/dist/iam-directory.d.ts +8 -0
  43. package/dist/iam-directory.js +23 -0
  44. package/dist/iam.d.ts +391 -0
  45. package/dist/iam.js +92 -0
  46. package/dist/idempotency.d.ts +3 -0
  47. package/dist/idempotency.js +22 -0
  48. package/dist/index.d.ts +18 -4
  49. package/dist/index.js +16 -4
  50. package/dist/instances.d.ts +177 -2
  51. package/dist/instances.js +37 -5
  52. package/dist/minds-agent.d.ts +28 -0
  53. package/dist/minds-agent.js +53 -10
  54. package/dist/minds-engine.d.ts +394 -0
  55. package/dist/minds-engine.js +555 -0
  56. package/dist/minds.d.ts +109 -1
  57. package/dist/minds.js +49 -14
  58. package/dist/orgs.d.ts +405 -0
  59. package/dist/orgs.js +63 -0
  60. package/dist/runner.d.ts +4 -0
  61. package/dist/runner.js +1 -0
  62. package/dist/scopes.d.ts +310 -0
  63. package/dist/scopes.js +40 -0
  64. package/dist/taps.d.ts +118 -0
  65. package/dist/taps.js +45 -0
  66. package/dist/traces.d.ts +574 -0
  67. package/dist/traces.js +97 -0
  68. package/dist/types.d.ts +12 -1
  69. package/package.json +1 -1
package/dist/genesis.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { selectGenesisContext } from './context.js';
2
2
  import { mindsModule } from './minds.js';
3
+ import { mindsEngineModule } from './minds-engine.js';
3
4
  import { foundryBilling } from './foundry-billing.js';
5
+ import { foundryModule, foundryRegistry } from './foundry.js';
4
6
  import { relaysEnrollment } from './relays-enrollment.js';
5
7
  import { blindsModule } from './blinds-owner-enrollment.js';
6
8
  import { beaconsModule } from './beacons.js';
@@ -11,8 +13,16 @@ import { fleetsModule } from './fleets.js';
11
13
  import { flocksModule } from './flocks.js';
12
14
  import { rigsModule, panesModule, shellsModule } from './instances.js';
13
15
  import { gearsModule } from './gears.js';
16
+ import { autoModule } from './auto.js';
17
+ import { scopesModule } from './scopes.js';
18
+ import { gardenModule } from './garden.js';
19
+ import { tapsModule } from './taps.js';
14
20
  import { lanesModule } from './lanes.js';
15
21
  import { flaresModule } from './flares.js';
22
+ import { tracesModule } from './traces.js';
23
+ import { billingModule, gatewayModule, orgsModule } from './gateway.js';
24
+ import { orgsEntitiesModule } from './orgs.js';
25
+ import { iamModule } from './iam.js';
16
26
  import { hivesUploadBody } from './hives-upload.js';
17
27
  import { runnerModule } from './runner.js';
18
28
  import { hivesOperations } from './hives-operations.js';
@@ -28,9 +38,11 @@ import { hivesInvokeHeaders, hivesOperationStatus } from './hives-functions.js';
28
38
  export class Genesis extends GenesisClient {
29
39
  constructor(opts = {}) { super(opts); }
30
40
  /** Generic escape hatch: genesis.call('hives_list_projects', {...}) */
31
- call = this.request.bind(this);
41
+ // Typed as request's own signature: `.bind` over a generic with ~1260 operation ids exceeds tsc's union limit (TS2590).
42
+ call = (operationId, input, init) => this.request(operationId, input, init);
32
43
  context = { select: (selection, options = {}) => selectGenesisContext(selection, { credential: () => this.credential(), fetch: this.contextFetch, signal: options.signal }) };
33
- minds = mindsModule(this);
44
+ /** minds.engine: every tenant Minds engine (Akasha daemon) route, one capability per call. */
45
+ minds = { ...mindsModule(this), engine: mindsEngineModule(this) };
34
46
  blinds = blindsModule(this);
35
47
  dials = dialsModule(this);
36
48
  henry = henryModule(this);
@@ -42,9 +54,20 @@ export class Genesis extends GenesisClient {
42
54
  panes = panesModule(this);
43
55
  shells = shellsModule(this);
44
56
  gears = gearsModule(this);
57
+ auto = autoModule(this);
58
+ scopes = scopesModule(this);
59
+ garden = gardenModule(this);
45
60
  lanes = lanesModule(this);
46
61
  flares = flaresModule(this);
62
+ gateway = gatewayModule(this);
63
+ /** Your organization's usage and billing reads, and Orgs: legal entities, seats, resolutions, documents, filings, formation and the record. */
64
+ orgs = { ...orgsModule(this), ...orgsEntitiesModule(this) };
65
+ billing = billingModule(this);
66
+ /** IAM v4: organizations, fleets, agents, roles, grants, capabilities and checks (login or org API key with iam:read / iam:write). */
67
+ iam = iamModule(this);
68
+ taps = tapsModule(this);
47
69
  foundry = {
70
+ ...foundryModule(this),
48
71
  billing: foundryBilling(this),
49
72
  models: {
50
73
  list: () => this.request('foundry_listModels'),
@@ -54,10 +77,7 @@ export class Genesis extends GenesisClient {
54
77
  /** Streaming chat: yields content deltas parsed from the SSE stream. */
55
78
  chatStream: (body) => this.streamChat(body),
56
79
  embeddings: (body) => this.request('foundry_createEmbedding', { body }),
57
- registry: {
58
- models: (q = {}) => this.request('foundry_listRegistryModels', q),
59
- model: (canonical_model_id) => this.request('foundry_getRegistryModel', { canonical_model_id }),
60
- },
80
+ registry: foundryRegistry(this),
61
81
  };
62
82
  hives = {
63
83
  ...hivesOperations(this),
@@ -115,6 +135,8 @@ export class Genesis extends GenesisClient {
115
135
  delete: (project_id, function_id) => this.request('hives_delete_function', { project_id, function_id }),
116
136
  /** Completed raw guest response; parse text/JSON/bytes explicitly. Never follows redirects. */
117
137
  invoke: (project_id, function_id, body = {}, init = {}) => this.raw('hives_invoke_function', { project_id, function_id, body }, { signal: init.signal, headers: hivesInvokeHeaders(init) }),
138
+ /** Compatibility alias of invoke: the same completed raw guest response, no durable queue. */
139
+ invokeAsync: (project_id, function_id, body = {}, init = {}) => this.raw('hives_invoke_function_async', { project_id, function_id, body }, { signal: init.signal, headers: hivesInvokeHeaders(init) }),
118
140
  operations: {
119
141
  get: async (project_id, function_id, operation_id, init = {}) => hivesOperationStatus(await this.request('hives_get_function_operation', { project_id, function_id, operation_id }, init), operation_id),
120
142
  release: async (project_id, function_id, operation_id, init = {}) => hivesOperationStatus(await this.request('hives_release_function_operation', { project_id, function_id, operation_id }, init), operation_id),
@@ -123,27 +145,46 @@ export class Genesis extends GenesisClient {
123
145
  regions: { list: () => this.request('hives_list_regions') },
124
146
  };
125
147
  silos = {
126
- /** Internal resource UUIDs; organization and parent ownership are enforced by Silos. */
127
- databases: {
128
- list: (project_id) => this.request('silos_listDatabases', { project_id }),
129
- get: (project_id, database_id) => this.request('silos_getDatabase', { project_id, database_id }),
130
- },
131
- projects: {
132
- list: () => this.request('silos_listProjects'),
133
- create: (body) => this.request('silos_createProject', { body }),
134
- get: (project_id) => this.request('silos_getProject', { project_id }),
135
- },
136
- };
137
- traces = {
138
- runs: {
139
- create: (body, idempotencyKey) => this.request('traces_createRun', { body }, { headers: { 'idempotency-key': idempotencyKey } }),
140
- list: (q = {}) => this.request('traces_listRuns', q),
141
- get: (id) => this.request('traces_getRun', { id }),
142
- evidence: (id) => this.request('traces_getRunEvidence', { id }),
148
+ /** Silos queries, compute time and storage of the selected Genesis project, last 30 days. */
149
+ usage: () => this.request('silos_getUsage'),
150
+ /** Regions Silos instances are created in. */
151
+ regions: { list: () => this.request('silos_listRegions') },
152
+ /** Database instances in the selected Genesis project; Silos verifies the signed selection. */
153
+ instances: {
154
+ list: () => this.request('silos_listInstances'),
155
+ create: (body) => this.request('silos_createInstance', { body }),
156
+ get: (instance_id) => this.request('silos_getInstance', { instance_id }),
157
+ /** Rename within the selected project; 409 when the name is taken. */
158
+ update: (instance_id, body) => this.request('silos_updateInstance', { instance_id, body }),
159
+ /** Removes the instance from the project and stops it; resolves with no body (204). */
160
+ delete: (instance_id) => this.request('silos_deleteInstance', { instance_id }),
161
+ /** Checkpoint, then stop. A later statement or resume starts it again. */
162
+ suspend: (instance_id) => this.request('silos_suspendInstance', { instance_id }),
163
+ resume: (instance_id) => this.request('silos_resumeInstance', { instance_id }),
164
+ /** One SQL statement, run once (never replayed) and metered on success. */
165
+ query: (instance_id, body) => this.request('silos_queryInstance', { instance_id, body }),
166
+ /** Up to 50 statements in one transaction: all commit or none do. */
167
+ batch: (instance_id, body) => this.request('silos_queryInstanceBatch', { instance_id, body }),
168
+ metrics: (instance_id) => this.request('silos_getInstanceMetrics', { instance_id }),
169
+ /** Waits up to waitMs (≤ 15000) for NOTIFY on the channels; call again to keep listening. */
170
+ listen: (instance_id, body) => this.request('silos_listenInstance', { instance_id, body }),
171
+ branches: {
172
+ list: (instance_id) => this.request('silos_listInstanceBranches', { instance_id }),
173
+ /** Copies the parent's latest checkpoint (the default branch when no parent is given). */
174
+ create: (instance_id, body) => this.request('silos_createInstanceBranch', { instance_id, body }),
175
+ get: (instance_id, branch_id) => this.request('silos_getInstanceBranch', { instance_id, branch_id }),
176
+ update: (instance_id, branch_id, body) => this.request('silos_updateInstanceBranch', { instance_id, branch_id, body }),
177
+ delete: (instance_id, branch_id) => this.request('silos_deleteInstanceBranch', { instance_id, branch_id }),
178
+ /** Replaces the branch's data with a stored snapshot. */
179
+ restore: (instance_id, branch_id, body) => this.request('silos_restoreInstanceBranch', { instance_id, branch_id, body }),
180
+ },
181
+ snapshots: {
182
+ list: (instance_id) => this.request('silos_listInstanceSnapshots', { instance_id }),
183
+ create: (instance_id, body = {}) => this.request('silos_createInstanceSnapshot', { instance_id, body }),
184
+ },
143
185
  },
144
- search: (body, idempotencyKey) => this.request('traces_search', { body }, { headers: { 'idempotency-key': idempotencyKey } }),
145
- usage: { events: () => this.request('traces_listUsageEvents') },
146
186
  };
187
+ traces = tracesModule(this);
147
188
  relays = {
148
189
  enrollment: relaysEnrollment(this),
149
190
  zones: {
@@ -151,10 +192,13 @@ export class Genesis extends GenesisClient {
151
192
  get: (zone) => this.request('relays_getZone', { zone }),
152
193
  dnssec: (zone) => this.request('relays_getDnssec', { zone }),
153
194
  create: (body) => this.request('relays_createZone', { body }),
195
+ update: (zone, body) => this.request('relays_updateZone', { zone, body }),
154
196
  delete: (zone) => this.request('relays_deleteZone', { zone }),
155
197
  },
156
198
  records: {
157
199
  list: (zone, q = {}) => this.request('relays_listRecords', { zone, ...q }),
200
+ get: (zone, recordId) => this.request('relays_getRecord', { zone, recordId }),
201
+ /** One record, or up to 100 with { records: [...] }. */
158
202
  create: (zone, body) => this.request('relays_createRecord', { zone, body }),
159
203
  update: (zone, recordId, body) => this.request('relays_updateRecord', { zone, recordId, body }),
160
204
  delete: (zone, recordId) => this.request('relays_deleteRecord', { zone, recordId }),
@@ -166,6 +210,27 @@ export class Genesis extends GenesisClient {
166
210
  create: (org_id, body) => this.request('iam_createOrgApiKey', { org_id, body }),
167
211
  revoke: (key_id) => this.request('iam_revokeApiKey', { key_id }),
168
212
  };
213
+ /** IAM organization directory: projects. One account login (human session) only; writes need iam:write and owner/admin. */
214
+ projects = {
215
+ list: (org_id) => this.request('iam_listProjects', { org_id }),
216
+ get: (org_id, project_id) => this.request('iam_getProject', { org_id, project_id }),
217
+ /** Reuse the same idempotencyKey to replay an uncertain create instead of making a second project. */
218
+ create: (org_id, body, idempotencyKey) => this.request('iam_createProject', { org_id, body }, { headers: { 'idempotency-key': idempotencyKey } }),
219
+ update: (org_id, project_id, body) => this.request('iam_updateProject', { org_id, project_id, body }),
220
+ rename: (org_id, project_id, name) => this.request('iam_updateProject', { org_id, project_id, body: { name } }),
221
+ /** Permanent; IAM refuses while workspaces, fleets or grants reference the project. */
222
+ delete: (org_id, project_id) => this.request('iam_deleteProject', { org_id, project_id }),
223
+ };
224
+ /** IAM organization directory: workspaces. One account login (human session) only; writes need iam:write and owner/admin. */
225
+ workspaces = {
226
+ list: (org_id) => this.request('iam_listWorkspaces', { org_id }),
227
+ get: (org_id, workspace_id) => this.request('iam_getWorkspace', { org_id, workspace_id }),
228
+ create: (org_id, body, idempotencyKey) => this.request('iam_createWorkspace', { org_id, body }, { headers: { 'idempotency-key': idempotencyKey } }),
229
+ update: (org_id, workspace_id, body) => this.request('iam_updateWorkspace', { org_id, workspace_id, body }),
230
+ rename: (org_id, workspace_id, name) => this.request('iam_updateWorkspace', { org_id, workspace_id, body: { name } }),
231
+ /** Permanent; IAM refuses while fleets or grants reference the workspace. */
232
+ delete: (org_id, workspace_id) => this.request('iam_deleteWorkspace', { org_id, workspace_id }),
233
+ };
169
234
  /** Who is this credential? (One account verify: org, principal, scopes, kind) */
170
235
  async whoami() {
171
236
  const credential_value = await this.credential();