@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/iam.js ADDED
@@ -0,0 +1,92 @@
1
+ import { GenesisError } from './errors.js';
2
+ import { idempotencyHeaders } from './idempotency.js';
3
+ const key = (operationId, idempotencyKey) => ({ headers: idempotencyHeaders(operationId, idempotencyKey) });
4
+ const ENROLLMENT_KEY = /^mek_[A-Za-z0-9_-]{16,512}$/;
5
+ /**
6
+ * IAM v4 tenant operations at /v1/iam/... (iam.l1fe.ai). Use a One account login or an organization API key with iam:read
7
+ * (reads) or iam:write (changes). The gateway exchanges either at Auth for a short-lived IAM token and forwards only that;
8
+ * IAM decides authority (owner or manager for most changes). `org_id` must be your own organization.
9
+ *
10
+ * Inviting members, changing member roles, removing members, Mind API keys and enterprise settings are not here: they stay
11
+ * with a person in the Console. Projects and workspaces are `genesis.projects` and `genesis.workspaces`.
12
+ */
13
+ export function iamModule(client) {
14
+ return {
15
+ orgs: {
16
+ list: (query = {}) => client.request('iam_listOrgs', query),
17
+ get: (org_id) => client.request('iam_getOrg', { org_id }),
18
+ update: (org_id, body) => client.request('iam_updateOrg', { org_id, body }),
19
+ members: (org_id, query = {}) => client.request('iam_listMembers', { org_id, ...query }),
20
+ entitlements: (org_id, environment_id) => client.request('iam_listEntitlements', { org_id, ...(environment_id ? { environment_id } : {}) }),
21
+ },
22
+ fleets: {
23
+ list: (org_id) => client.request('iam_listFleets', { org_id }),
24
+ get: (org_id, fleet_id) => client.request('iam_getFleet', { org_id, fleet_id }),
25
+ /** Reuse the same idempotencyKey to replay an uncertain create instead of making a second fleet. */
26
+ create: (org_id, body, idempotencyKey) => client.request('iam_createFleet', { org_id, body }, key('iam_createFleet', idempotencyKey)),
27
+ update: (org_id, fleet_id, body) => client.request('iam_updateFleet', { org_id, fleet_id, body }),
28
+ /** Permanent; IAM refuses while grants reference the fleet. */
29
+ delete: (org_id, fleet_id) => client.request('iam_deleteFleet', { org_id, fleet_id }),
30
+ },
31
+ agents: {
32
+ list: (org_id) => client.request('iam_listAgents', { org_id }),
33
+ get: (org_id, agent_did) => client.request('iam_getAgent', { org_id, agent_did }),
34
+ /** Without `publicKey` IAM generates a key pair and returns `privateKey` once. */
35
+ create: (org_id, body) => client.request('iam_createAgent', { org_id, body }),
36
+ /** Revokes the agent (status `revoked`); the record stays. */
37
+ delete: (org_id, agent_did) => client.request('iam_deleteAgent', { org_id, agent_did }),
38
+ suspend: (org_id, agent_did) => client.request('iam_suspendAgent', { org_id, agent_did }),
39
+ resume: (org_id, agent_did) => client.request('iam_resumeAgent', { org_id, agent_did }),
40
+ rotate: (org_id, agent_did, body = {}) => client.request('iam_rotateAgentKey', { org_id, agent_did, body }),
41
+ acts: {
42
+ list: (org_id, agent_did) => client.request('iam_listAgentActs', { org_id, agent_did }),
43
+ issue: (org_id, agent_did, body) => client.request('iam_issueAgentAct', { org_id, agent_did, body }),
44
+ },
45
+ publication: (org_id, agent_id) => client.request('iam_getAgentPublication', { org_id, agent_id }),
46
+ orbitMsgsGrant: (org_id, agent_id) => client.request('iam_getOrbitMsgsProductGrant', { org_id, agent_id }),
47
+ /** A published agent's public card (anonymous). */
48
+ publicCard: (agent_id) => client.request('iam_getPublicAgent', { agent_id }),
49
+ /** Agents enrolled for a Mind with a currently valid credential. */
50
+ forMind: (org_id, mind_id) => client.request('iam_listMindAgents', { org_id, mind_id }),
51
+ enrollmentGrants: (org_id) => client.request('iam_listAgentEnrollmentGrants', { org_id }),
52
+ /**
53
+ * Enroll an agent under an agent enrollment grant. Only the grant's enrollment key (`mek_...`) is sent, as the bearer;
54
+ * this client's own Genesis credential is not. The credential secret in the answer is returned once.
55
+ */
56
+ enroll: (enrollmentKey, body) => {
57
+ if (typeof enrollmentKey !== 'string' || !ENROLLMENT_KEY.test(enrollmentKey))
58
+ throw new GenesisError({ status: 0, type: 'invalid_request', operationId: 'iam_enrollAgent', message: 'Agent enrollment needs the grant\'s enrollment key (mek_...).' });
59
+ return client.request('iam_enrollAgent', { body }, { headers: { authorization: `Bearer ${enrollmentKey}` } });
60
+ },
61
+ },
62
+ roles: {
63
+ list: (org_id) => client.request('iam_listRoles', { org_id }),
64
+ get: (org_id, role_id) => client.request('iam_getRole', { org_id, role_id }),
65
+ create: (org_id, body) => client.request('iam_createRole', { org_id, body }),
66
+ update: (org_id, role_id, body) => client.request('iam_updateRole', { org_id, role_id, body }),
67
+ delete: (org_id, role_id) => client.request('iam_deleteRole', { org_id, role_id }),
68
+ },
69
+ grants: {
70
+ list: (query = {}) => client.request('iam_listGrants', query),
71
+ get: (grant_id) => client.request('iam_getGrant', { grant_id }),
72
+ /** `organization_id` must be your organization. With an idempotencyKey a retry returns the original grant. */
73
+ create: (body, idempotencyKey) => client.request('iam_createGrant', { body }, key('iam_createGrant', idempotencyKey)),
74
+ update: (grant_id, body) => client.request('iam_updateGrant', { grant_id, body }),
75
+ delete: (grant_id) => client.request('iam_deleteGrant', { grant_id }),
76
+ },
77
+ capabilities: {
78
+ get: (capability_id) => client.request('iam_getCapability', { capability_id }),
79
+ /** You are always the issuer; `organization_id` must be your organization. */
80
+ create: (body, idempotencyKey) => client.request('iam_createCapability', { body }, key('iam_createCapability', idempotencyKey)),
81
+ update: (capability_id, body) => client.request('iam_updateCapability', { capability_id, body }),
82
+ /** Revoke (issuer only), with an optional recorded reason. */
83
+ delete: (capability_id, reason) => client.request('iam_deleteCapability', { capability_id, body: reason === undefined ? {} : { reason } }),
84
+ verify: (body) => client.request('iam_verifyCapability', { body }),
85
+ },
86
+ platforms: () => client.request('iam_listPlatforms'),
87
+ tenantContext: () => client.request('iam_getTenantContext'),
88
+ checkPermission: (body) => client.request('iam_checkPermission', { body }),
89
+ requirePermission: (body) => client.request('iam_requirePermission', { body }),
90
+ checkEntitlement: (body) => client.request('iam_checkEntitlement', { body }),
91
+ };
92
+ }
@@ -2,3 +2,6 @@ import { type OperationId } from './generated/operations.js';
2
2
  /** The Idempotency-Key header an operation's spec declares. A required key is refused locally when missing
3
3
  * or malformed, before any request is sent; reuse the same key to replay instead of acting twice. */
4
4
  export declare function idempotencyHeaders(operationId: OperationId, key: string | undefined): Record<string, string>;
5
+ /** The If-Match header an operation's spec requires (Auto's optimistic concurrency): the resource `version`
6
+ * you read, or its ETag. A missing or malformed version is refused locally, before anything is sent. */
7
+ export declare function ifMatchHeaders(operationId: OperationId, version: string | number | undefined): Record<string, string>;
@@ -2,6 +2,8 @@ import { GenesisError } from './errors.js';
2
2
  import { operationTable } from './generated/operations.js';
3
3
  const REQUIRED = /^[\x21-\x7e]{8,128}$/;
4
4
  const OPTIONAL = /^[\x21-\x7e]{1,256}$/;
5
+ /** Auto's Idempotency-Key grammar (l1felabs/auto src/operating.ts IDEMPOTENCY_KEY). */
6
+ const AUTO_KEY = /^[A-Za-z0-9_.:-]{8,128}$/;
5
7
  /** The Idempotency-Key header an operation's spec declares. A required key is refused locally when missing
6
8
  * or malformed, before any request is sent; reuse the same key to replay instead of acting twice. */
7
9
  export function idempotencyHeaders(operationId, key) {
@@ -13,5 +15,30 @@ export function idempotencyHeaders(operationId, key) {
13
15
  message: need === 'required' ? `${operationId} needs a stable idempotency key (8-128 printable ASCII characters)`
14
16
  : need ? `${operationId} idempotency key must be 1-256 printable ASCII characters` : `${operationId} does not take an idempotency key` });
15
17
  }
18
+ // Zaps (spec IdempotencyKey, gateway key lane) admits only 8-128 printable characters, required or optional.
19
+ if (operationTable[operationId].service === 'zaps' && !REQUIRED.test(key)) {
20
+ throw new GenesisError({ status: 0, type: 'invalid_request', operationId,
21
+ message: `${operationId} idempotency key must be 8-128 printable ASCII characters` });
22
+ }
23
+ // Auto takes 8-128 characters of [A-Za-z0-9_.:-] (its authority check); refuse anything it would 422 before sending.
24
+ if (operationTable[operationId].service === 'auto' && !AUTO_KEY.test(key)) {
25
+ throw new GenesisError({ status: 0, type: 'invalid_request', operationId,
26
+ message: `${operationId} idempotency key must be 8-128 characters of A-Z a-z 0-9 _ . : -` });
27
+ }
16
28
  return { 'idempotency-key': key };
17
29
  }
30
+ /** The If-Match header an operation's spec requires (Auto's optimistic concurrency): the resource `version`
31
+ * you read, or its ETag. A missing or malformed version is refused locally, before anything is sent. */
32
+ export function ifMatchHeaders(operationId, version) {
33
+ const need = operationTable[operationId].ifMatch;
34
+ if (!need) {
35
+ if (version === undefined)
36
+ return {};
37
+ throw new GenesisError({ status: 0, type: 'invalid_request', operationId, message: `${operationId} does not take If-Match` });
38
+ }
39
+ const v = typeof version === 'number' ? String(version) : version;
40
+ if (typeof v !== 'string' || !/^(?:W\/)?"?[1-9][0-9]{0,8}"?$/.test(v)) {
41
+ throw new GenesisError({ status: 0, type: 'invalid_request', operationId, message: `${operationId} needs the version you read (If-Match, e.g. 3)` });
42
+ }
43
+ return { 'if-match': `"${v.replace(/^W\//, '').replace(/"/g, '')}"` };
44
+ }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  export { Genesis, type ChatMessage } from './genesis.js';
2
2
  export { GenesisClient, DEFAULT_BASE_URL, type GenesisOptions, type CredentialProvider } from './client.js';
3
- export { GenesisError, errorCatalog, errorToken, errorOutcome } from './errors.js';
3
+ export { iamDirectoryOperations, isIamDirectoryOperation, iamDirectoryFailure } from './iam-directory.js';
4
+ export { iamModule } from './iam.js';
5
+ export { GenesisError, errorCatalog, errorBody, errorToken, errorOutcome } from './errors.js';
6
+ export { ERROR_BODY_LIMITS, cardNumber, redactErrorBody, redactErrorText, secretField } from './redact.js';
4
7
  export { requireSecureUrl } from './urls.js';
5
8
  export { operationTable, services, type OperationId } from './generated/operations.js';
6
9
  export type { OperationInput, OperationOutput, OperationMeta, ServiceMeta } from './types.js';
@@ -10,24 +13,37 @@ export { validateHivesInvocation, hivesFunctionResponseHeaders, HivesOperationEr
10
13
  export { hivesResponseBytes } from './hives-response.js';
11
14
  export { runnerModule, type RunnerStartInput, type RunnerSnapshot, type RunnerCatalog, type RunnerEvent, type RunnerProviderResult, type RunnerRequestOptions } from './runner.js';
12
15
  export type { RunnerSelfExecutionGrantInput, RunnerSelfExecutionGrant } from './runner-grant.js';
13
- export { beaconsModule } from './beacons.js';
16
+ export { beaconsModule, BEACONS_RESOURCE_FAMILIES, BEACONS_CLIENT_PLATFORMS, type BeaconsResourceFamily } from './beacons.js';
17
+ export type { BeaconsClientPlatform } from './beacons.js';
14
18
  export { rigsModule, panesModule, shellsModule } from './instances.js';
15
19
  export { gearsModule } from './gears.js';
20
+ export { tapsModule } from './taps.js';
16
21
  export { lanesModule } from './lanes.js';
17
22
  export { flaresModule } from './flares.js';
18
- export { idempotencyHeaders } from './idempotency.js';
23
+ export { idempotencyHeaders, ifMatchHeaders } from './idempotency.js';
24
+ export type { FlocksWriteOptions, WaitForJobOptions, FlocksJob, FlocksRun } from './flocks.js';
25
+ export { autoModule } from './auto.js';
26
+ export { gardenModule } from './garden.js';
27
+ export { orgsEntitiesModule, type OrgsDocumentContent } from './orgs.js';
28
+ export { scopesModule } from './scopes.js';
29
+ export { billingModule, gatewayModule, orgsModule } from './gateway.js';
30
+ export { boxesModule } from './boxes.js';
19
31
  export { dialsModule, dialsEmergencyAddressFeedback, type DialsEmergencyAddressFeedback, type DialsScope, type DialsOutboundCall, type DialsCallControl, type DialsEmergencyAddress, type DialsCallListItem, type DialsCallDispatchState, type DialsMessage, type DialsMessageTemplate, type DialsMessagingBrand, type DialsMessagingCampaign, type DialsWorkflowDocument, type DialsRoutingAction, type DialsRoutingRule, type DialsRoutingRuleReceipt, type DialsOutboundCallReceipt, type DialsRecoveredOutboundCallReceipt } from './dials.js';
20
32
  export { hivesObjectKey, type HivesBucket, type HivesObject, type HivesObjectAcknowledgement, type HivesObjectList, type HivesCorsRule, type HivesCreateBucket, type HivesPresign, type HivesPresignedUrl } from './hives-cells.js';
33
+ export { hivesSseEvents, hivesSseReader, type HivesLogStreamEvent, type HivesLogStreamQuery, type HivesLogWindow, type HivesLogWindowOptions } from './hives-platform.js';
21
34
  export { hivesQueueBody, type HivesQueue, type HivesQueueConfig, type HivesQueueCreate, type HivesQueueSend, type HivesQueueDelivery, type HivesDeadLetter, type HivesDeadLetterStats } from './hives-queues.js';
22
35
  export type { HivesRuntime, HivesRuntimeSelection } from './hives-runtimes.js';
23
36
  export type { HivesVolume, HivesVolumeCreate, HivesVolumeMount, HivesVolumePage } from './hives-volumes.js';
24
- export { HIVES_OBJECT_BYTES, HIVES_QUEUE_BYTES, type HivesResourceOptions } from './hives-resources-transport.js';
37
+ export { HIVES_OBJECT_BYTES, HIVES_QUEUE_BYTES, type HivesResourceOptions, type HivesFundedWriteOptions } from './hives-resources-transport.js';
25
38
  export type { HivesMarketplacePackage, HivesMarketplaceVersion, HivesMarketplaceInstallation, HivesMarketplaceCategory, HivesMarketplacePage, HivesMarketplacePublish, HivesMarketplaceInstall, HivesMarketplaceSearch, HivesMarketplaceDetail } from './hives-marketplace.js';
26
39
  export type { HivesQueueConsumerConfig, HivesQueueConsumerBinding, HivesQueueConsumerAttempt, HivesQueueConsumerStatus } from './hives-queue-consumer.js';
27
40
  export { foundryBillingOperations, isFoundryBillingOperation } from './foundry-billing.js';
28
41
  export type { HivesTopic, HivesTopicSubscription, HivesTopicPublish, HivesTopicPublication } from './hives-topics.js';
29
- export { mindsModule, mindsOperations, isMindsOperation, type MindsCreateOptions, type MindsResumeOptions, type MindsStopOptions, type MindsWakeReason, type MindsRequestOptions, type MindsUsage, type MindsEventInput } from './minds.js';
30
- export { MindsAgentError, mindsAgentOperations, isMindsAgentOperation, type MindsAgentOptions, type MindsAgentEventInput } from './minds-agent.js';
42
+ export { mindsModule, mindsOperations, isMindsOperation, mindsServices, type MindsService, type MindsDeleteOptions, type MindsResizeOptions, type MindsCreateOptions, type MindsResumeOptions, type MindsStopOptions, type MindsWakeReason, type MindsRequestOptions, type MindsUsage, type MindsEventInput, type MindsWebhookDelivery, type MindsWebhookDeliveryReceipt } from './minds.js';
43
+ export { MindsAgentError, mindsAgentOperations, isMindsAgentOperation, mindsAgentCreateOperations, isMindsAgentCreateOperation, type MindsAgentOptions, type MindsAgentEventInput, type MindsAgentCreateInput, type MindsAgentCreateOptions } from './minds-agent.js';
44
+ export { mindsEngineModule, mindsEngineOperations, isMindsEngineOperation, mindsEngineCommands, type MindsEngineOperation, type MindsEngineOptions } from './minds-engine.js';
31
45
  export { MindsOwnerError, mindsOwnerOperations, isMindsOwnerOperation, type MindsOwnerOptions, type MindsOwnerVersion, type MindsAttachmentSubject, type MindsAttachInput } from './minds-owner.js';
32
46
  export { selectGenesisContext, checkedGenesisContextSession, type GenesisContextSelection, type GenesisContextSession } from './context.js';
33
47
  export { HivesQueueOperationError, hivesQueueOperationId, type HivesQueueOperation, type HivesQueueSendOptions } from './hives-queue-funding.js';
48
+ export { foldHenryTurns, type HenryRun, type HenryRunEvent, type HenryRunEventMessage, type HenryRunStreamStatus, type HenryMessageDelivery, type HenryStreamEvent, type HenryStreamOptions, type HenryTurn, type HenryReplay } from './henry.js';
49
+ export { hivesSseWindow, type HivesSseEvent, type HivesSseWindow, type HivesSseWindowOptions } from './hives-sse.js';
package/dist/index.js CHANGED
@@ -1,25 +1,39 @@
1
1
  export { Genesis } from './genesis.js';
2
2
  export { GenesisClient, DEFAULT_BASE_URL } from './client.js';
3
- export { GenesisError, errorCatalog, errorToken, errorOutcome } from './errors.js';
3
+ export { iamDirectoryOperations, isIamDirectoryOperation, iamDirectoryFailure } from './iam-directory.js';
4
+ export { iamModule } from './iam.js';
5
+ export { GenesisError, errorCatalog, errorBody, errorToken, errorOutcome } from './errors.js';
6
+ export { ERROR_BODY_LIMITS, cardNumber, redactErrorBody, redactErrorText, secretField } from './redact.js';
4
7
  export { requireSecureUrl } from './urls.js';
5
8
  export { operationTable, services } from './generated/operations.js';
6
9
  export { hivesUploadBody, MAX_WASM_BYTES } from './hives-upload.js';
7
10
  export { validateHivesInvocation, hivesFunctionResponseHeaders, HivesOperationError, MAX_FUNCTION_BODY_BYTES, MAX_FUNCTION_JSON_BYTES } from './hives-functions.js';
8
11
  export { hivesResponseBytes } from './hives-response.js';
9
12
  export { runnerModule } from './runner.js';
10
- export { beaconsModule } from './beacons.js';
13
+ export { beaconsModule, BEACONS_RESOURCE_FAMILIES, BEACONS_CLIENT_PLATFORMS } from './beacons.js';
11
14
  export { rigsModule, panesModule, shellsModule } from './instances.js';
12
15
  export { gearsModule } from './gears.js';
16
+ export { tapsModule } from './taps.js';
13
17
  export { lanesModule } from './lanes.js';
14
18
  export { flaresModule } from './flares.js';
15
- export { idempotencyHeaders } from './idempotency.js';
19
+ export { idempotencyHeaders, ifMatchHeaders } from './idempotency.js';
20
+ export { autoModule } from './auto.js';
21
+ export { gardenModule } from './garden.js';
22
+ export { orgsEntitiesModule } from './orgs.js';
23
+ export { scopesModule } from './scopes.js';
24
+ export { billingModule, gatewayModule, orgsModule } from './gateway.js';
25
+ export { boxesModule } from './boxes.js';
16
26
  export { dialsModule, dialsEmergencyAddressFeedback } from './dials.js';
17
27
  export { hivesObjectKey } from './hives-cells.js';
28
+ export { hivesSseEvents, hivesSseReader } from './hives-platform.js';
18
29
  export { hivesQueueBody } from './hives-queues.js';
19
30
  export { HIVES_OBJECT_BYTES, HIVES_QUEUE_BYTES } from './hives-resources-transport.js';
20
31
  export { foundryBillingOperations, isFoundryBillingOperation } from './foundry-billing.js';
21
- export { mindsModule, mindsOperations, isMindsOperation } from './minds.js';
22
- export { MindsAgentError, mindsAgentOperations, isMindsAgentOperation } from './minds-agent.js';
32
+ export { mindsModule, mindsOperations, isMindsOperation, mindsServices } from './minds.js';
33
+ export { MindsAgentError, mindsAgentOperations, isMindsAgentOperation, mindsAgentCreateOperations, isMindsAgentCreateOperation } from './minds-agent.js';
34
+ export { mindsEngineModule, mindsEngineOperations, isMindsEngineOperation, mindsEngineCommands } from './minds-engine.js';
23
35
  export { MindsOwnerError, mindsOwnerOperations, isMindsOwnerOperation } from './minds-owner.js';
24
36
  export { selectGenesisContext, checkedGenesisContextSession } from './context.js';
25
37
  export { HivesQueueOperationError, hivesQueueOperationId } from './hives-queue-funding.js';
38
+ export { foldHenryTurns } from './henry.js';
39
+ export { hivesSseWindow } from './hives-sse.js';
@@ -1,11 +1,63 @@
1
1
  import type { GenesisClient } from './client.js';
2
- /** Read-only instance inventories. Each needs an interactive One account login with a selected
3
- * organization and project; the gateway admits nothing else on these products. */
2
+ import type { OperationInput } from './types.js';
3
+ /** Instance inventory and lifecycle. Each needs a One account login with a selected organization
4
+ * and project, or an org API key whose binding selects them. `create` needs a stable idempotency
5
+ * key (8-128 printable ASCII characters): reuse it to retry and the same instance is returned.
6
+ * `delete` runs the instance's stop action (an optional key makes the stop one replayable
7
+ * operation); Omega's native stop deletes the deployment. Ids are Omega deployment UUIDs. */
4
8
  export declare function rigsModule(client: GenesisClient): {
5
9
  list: () => Promise<{
6
10
  product: "rigs";
7
11
  instances: import("./index.js").components["schemas"]["Rigs.Instance"][];
8
12
  }>;
13
+ get: (id: string) => Promise<{
14
+ product: "rigs";
15
+ instance: import("./index.js").components["schemas"]["Rigs.Instance"];
16
+ }>;
17
+ create: (body: NonNullable<OperationInput<"rigs_createRig">["body"]>, idempotencyKey: string) => Promise<{
18
+ product: "rigs";
19
+ instance: import("./index.js").components["schemas"]["Rigs.Instance"];
20
+ }>;
21
+ delete: (id: string, idempotencyKey?: string) => Promise<{
22
+ ok: true;
23
+ product: "rigs";
24
+ id: string;
25
+ capability: "stop";
26
+ result: {
27
+ ok?: boolean;
28
+ capability?: string;
29
+ status?: string;
30
+ completed?: boolean;
31
+ pending?: boolean;
32
+ bridge?: boolean;
33
+ };
34
+ }>;
35
+ /** `{capability, args}`; the key is required for every capability but `stop`. */
36
+ action: (id: string, body: NonNullable<OperationInput<"rigs_actOnRig">["body"]>, idempotencyKey?: string) => Promise<{
37
+ ok: boolean;
38
+ product: string;
39
+ id: string;
40
+ capability: string;
41
+ result?: {
42
+ [key: string]: unknown;
43
+ } | null;
44
+ } & {
45
+ [key: string]: unknown;
46
+ }>;
47
+ term: (id: string) => Promise<{
48
+ product: string;
49
+ id: string;
50
+ kind?: string;
51
+ credentials: {
52
+ url?: string;
53
+ token?: string;
54
+ expires_in?: number | string;
55
+ } & {
56
+ [key: string]: unknown;
57
+ };
58
+ } & {
59
+ [key: string]: unknown;
60
+ }>;
9
61
  };
10
62
  export declare function panesModule(client: GenesisClient): {
11
63
  list: () => Promise<{
@@ -14,6 +66,61 @@ export declare function panesModule(client: GenesisClient): {
14
66
  } & {
15
67
  [key: string]: unknown;
16
68
  }>;
69
+ get: (id: string) => Promise<{
70
+ product: "panes";
71
+ instance: import("./index.js").components["schemas"]["Panes.Instance"];
72
+ } & {
73
+ [key: string]: unknown;
74
+ }>;
75
+ create: (body: NonNullable<OperationInput<"panes_createPane">["body"]>, idempotencyKey: string) => Promise<{
76
+ product: "panes";
77
+ instance: import("./index.js").components["schemas"]["Panes.Instance"];
78
+ } & {
79
+ [key: string]: unknown;
80
+ }>;
81
+ delete: (id: string, idempotencyKey?: string) => Promise<{
82
+ ok: true;
83
+ product: "panes";
84
+ id: string;
85
+ capability: "stop";
86
+ result?: {
87
+ [key: string]: unknown;
88
+ };
89
+ accepted?: boolean;
90
+ completed?: boolean;
91
+ pending?: boolean;
92
+ status?: string;
93
+ } & {
94
+ [key: string]: unknown;
95
+ }>;
96
+ /** `{capability, args}`; the key is required for every capability but `stop`. */
97
+ action: (id: string, body: NonNullable<OperationInput<"panes_actOnPane">["body"]>, idempotencyKey?: string) => Promise<{
98
+ ok: boolean;
99
+ product: string;
100
+ id: string;
101
+ capability: string;
102
+ result?: {
103
+ [key: string]: unknown;
104
+ } | null;
105
+ } & {
106
+ [key: string]: unknown;
107
+ }>;
108
+ term: (id: string) => Promise<{
109
+ product: string;
110
+ id: string;
111
+ kind?: string;
112
+ credentials: {
113
+ url?: string;
114
+ token?: string;
115
+ expires_in?: number | string;
116
+ } & {
117
+ [key: string]: unknown;
118
+ };
119
+ } & {
120
+ [key: string]: unknown;
121
+ }>;
122
+ /** The screenshot image as a raw Response (PNG or JPEG). */
123
+ screenshot: (id: string, artifactId: string) => Promise<unknown>;
17
124
  };
18
125
  export declare function shellsModule(client: GenesisClient): {
19
126
  list: () => Promise<{
@@ -22,4 +129,72 @@ export declare function shellsModule(client: GenesisClient): {
22
129
  } & {
23
130
  [key: string]: unknown;
24
131
  }>;
132
+ get: (id: string) => Promise<{
133
+ product: "shells";
134
+ instance: import("./index.js").components["schemas"]["Shells.Instance"];
135
+ } & {
136
+ [key: string]: unknown;
137
+ }>;
138
+ create: (body: NonNullable<OperationInput<"shells_createShell">["body"]>, idempotencyKey: string) => Promise<{
139
+ product: "shells";
140
+ instance: import("./index.js").components["schemas"]["Shells.Instance"];
141
+ } & {
142
+ [key: string]: unknown;
143
+ }>;
144
+ delete: (id: string, idempotencyKey?: string) => Promise<{
145
+ ok: true;
146
+ product: "shells";
147
+ id: string;
148
+ capability: "stop";
149
+ result?: {
150
+ [key: string]: unknown;
151
+ };
152
+ cambium?: unknown;
153
+ } & {
154
+ [key: string]: unknown;
155
+ }>;
156
+ /** `{capability, args}`; the key is required for every capability but `stop`. */
157
+ action: (id: string, body: NonNullable<OperationInput<"shells_actOnShell">["body"]>, idempotencyKey?: string) => Promise<{
158
+ ok: boolean;
159
+ product: string;
160
+ id: string;
161
+ capability: string;
162
+ result?: {
163
+ [key: string]: unknown;
164
+ } | null;
165
+ } & {
166
+ [key: string]: unknown;
167
+ }>;
168
+ term: (id: string) => Promise<{
169
+ product: string;
170
+ id: string;
171
+ kind?: string;
172
+ credentials: {
173
+ url?: string;
174
+ token?: string;
175
+ expires_in?: number | string;
176
+ } & {
177
+ [key: string]: unknown;
178
+ };
179
+ } & {
180
+ [key: string]: unknown;
181
+ }>;
182
+ /** One-shot exec; a repeat with the same key and body replays the stored result. */
183
+ exec: (id: string, body: NonNullable<OperationInput<"shells_execShell">["body"]>, idempotencyKey: string) => Promise<{
184
+ ok: true;
185
+ product: "shells";
186
+ id: string;
187
+ result: {
188
+ exitCode: number | null;
189
+ encoding: "base64";
190
+ stdout: string;
191
+ stderr: string;
192
+ truncated: {
193
+ stdout?: boolean;
194
+ stderr?: boolean;
195
+ };
196
+ timedOut: boolean;
197
+ durationMs: number;
198
+ };
199
+ }>;
25
200
  };
package/dist/instances.js CHANGED
@@ -1,11 +1,43 @@
1
- /** Read-only instance inventories. Each needs an interactive One account login with a selected
2
- * organization and project; the gateway admits nothing else on these products. */
1
+ import { idempotencyHeaders } from './idempotency.js';
2
+ /** Instance inventory and lifecycle. Each needs a One account login with a selected organization
3
+ * and project, or an org API key whose binding selects them. `create` needs a stable idempotency
4
+ * key (8-128 printable ASCII characters): reuse it to retry and the same instance is returned.
5
+ * `delete` runs the instance's stop action (an optional key makes the stop one replayable
6
+ * operation); Omega's native stop deletes the deployment. Ids are Omega deployment UUIDs. */
3
7
  export function rigsModule(client) {
4
- return { list: () => client.request('rigs_listRigs') };
8
+ return {
9
+ list: () => client.request('rigs_listRigs'),
10
+ get: (id) => client.request('rigs_getRig', { id }),
11
+ create: (body, idempotencyKey) => client.request('rigs_createRig', { body }, { headers: idempotencyHeaders('rigs_createRig', idempotencyKey) }),
12
+ delete: (id, idempotencyKey) => client.request('rigs_deleteRig', { id }, { headers: idempotencyHeaders('rigs_deleteRig', idempotencyKey) }),
13
+ /** `{capability, args}`; the key is required for every capability but `stop`. */
14
+ action: (id, body, idempotencyKey) => client.request('rigs_actOnRig', { id, body }, { headers: idempotencyHeaders('rigs_actOnRig', idempotencyKey) }),
15
+ term: (id) => client.request('rigs_openRigTerm', { id }),
16
+ };
5
17
  }
6
18
  export function panesModule(client) {
7
- return { list: () => client.request('panes_listPanes') };
19
+ return {
20
+ list: () => client.request('panes_listPanes'),
21
+ get: (id) => client.request('panes_getPane', { id }),
22
+ create: (body, idempotencyKey) => client.request('panes_createPane', { body }, { headers: idempotencyHeaders('panes_createPane', idempotencyKey) }),
23
+ delete: (id, idempotencyKey) => client.request('panes_deletePane', { id }, { headers: idempotencyHeaders('panes_deletePane', idempotencyKey) }),
24
+ /** `{capability, args}`; the key is required for every capability but `stop`. */
25
+ action: (id, body, idempotencyKey) => client.request('panes_actOnPane', { id, body }, { headers: idempotencyHeaders('panes_actOnPane', idempotencyKey) }),
26
+ term: (id) => client.request('panes_openPaneTerm', { id }),
27
+ /** The screenshot image as a raw Response (PNG or JPEG). */
28
+ screenshot: (id, artifactId) => client.request('panes_getPaneScreenshotData', { id, artifactId }),
29
+ };
8
30
  }
9
31
  export function shellsModule(client) {
10
- return { list: () => client.request('shells_listShells') };
32
+ return {
33
+ list: () => client.request('shells_listShells'),
34
+ get: (id) => client.request('shells_getShell', { id }),
35
+ create: (body, idempotencyKey) => client.request('shells_createShell', { body }, { headers: idempotencyHeaders('shells_createShell', idempotencyKey) }),
36
+ delete: (id, idempotencyKey) => client.request('shells_deleteShell', { id }, { headers: idempotencyHeaders('shells_deleteShell', idempotencyKey) }),
37
+ /** `{capability, args}`; the key is required for every capability but `stop`. */
38
+ action: (id, body, idempotencyKey) => client.request('shells_actOnShell', { id, body }, { headers: idempotencyHeaders('shells_actOnShell', idempotencyKey) }),
39
+ term: (id) => client.request('shells_openShellTerm', { id }),
40
+ /** One-shot exec; a repeat with the same key and body replays the stored result. */
41
+ exec: (id, body, idempotencyKey) => client.request('shells_execShell', { id, body }, { headers: idempotencyHeaders('shells_execShell', idempotencyKey) }),
42
+ };
11
43
  }
@@ -1,6 +1,9 @@
1
1
  import type { GenesisClient } from './client.js';
2
2
  import { GenesisError } from './errors.js';
3
3
  export declare const mindsAgentOperations: readonly ["minds_agentInsertEpisodicMemory", "minds_agentGetEpisodicMemory", "minds_agentSearchMemory"];
4
+ /** Agent Mind creation: an approved agent-create token with DPoP, default-off at the gateway (MINDS_AGENT_CREATE_ENABLED). */
5
+ export declare const mindsAgentCreateOperations: readonly ["minds_agentCreateMind", "minds_agentGetCreateOperation"];
6
+ export declare const isMindsAgentCreateOperation: (id: string) => boolean;
4
7
  export declare const isMindsAgentOperation: (id: string) => boolean;
5
8
  declare const EVENT_TYPES: readonly ["Conversation", "Command", "Query", "Document", "Error", "Success", "Learning", "Decision", "Action", "Context", "Knowledge"];
6
9
  type Row = Record<string, unknown>;
@@ -12,6 +15,18 @@ export interface MindsAgentEventInput {
12
15
  summary?: string | null;
13
16
  tags?: string[];
14
17
  }
18
+ export interface MindsAgentCreateInput {
19
+ /** "Sandbox" or "Sandbox <label>", at most 80 characters. */
20
+ name: string;
21
+ approvalId: string;
22
+ approvalVersion: number;
23
+ /** Persisted UUID4 for this creation; also the idempotency key and the status lookup id. */
24
+ operationId: string;
25
+ }
26
+ export interface MindsAgentCreateOptions {
27
+ dpopProof: string;
28
+ signal?: AbortSignal;
29
+ }
15
30
  export interface MindsAgentOptions {
16
31
  /** Omit for the agent's private namespace; group authority is checked by the controller. */
17
32
  group?: string;
@@ -38,6 +53,19 @@ export declare function mindsAgentTransport(options: {
38
53
  signal?: AbortSignal;
39
54
  }): Promise<Response>;
40
55
  export declare function mindsAgentModule(client: GenesisClient): {
56
+ /** Free/F1 Sandbox only; the fixed spec is the only shape the gateway admits. */
57
+ create: (input: MindsAgentCreateInput, options: MindsAgentCreateOptions) => Promise<{
58
+ mind_id: string;
59
+ status: string;
60
+ } & {
61
+ [key: string]: unknown;
62
+ }>;
63
+ createStatus: (operation_id: string, options: MindsAgentCreateOptions) => Promise<{
64
+ mind_id: string;
65
+ status: string;
66
+ } & {
67
+ [key: string]: unknown;
68
+ }>;
41
69
  memory: {
42
70
  insert: (mind: string, event: MindsAgentEventInput, options?: MindsAgentOptions) => Promise<{
43
71
  id: string;