@onesi/genesis 0.0.1-stage → 0.1.13
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.
- package/README.md +29 -0
- package/dist/beacons.d.ts +103 -0
- package/dist/beacons.js +77 -0
- package/dist/blinds-owner-enrollment.d.ts +171 -0
- package/dist/blinds-owner-enrollment.js +150 -0
- package/dist/client.d.ts +19996 -0
- package/dist/client.js +277 -0
- package/dist/context.d.ts +50 -0
- package/dist/context.js +153 -0
- package/dist/dials.d.ts +299 -0
- package/dist/dials.js +100 -0
- package/dist/errors.d.ts +35 -0
- package/dist/errors.js +66 -0
- package/dist/flares.d.ts +170 -0
- package/dist/flares.js +56 -0
- package/dist/fleets.d.ts +186 -0
- package/dist/fleets.js +136 -0
- package/dist/flocks.d.ts +155 -0
- package/dist/flocks.js +39 -0
- package/dist/foundry-billing.d.ts +97 -0
- package/dist/foundry-billing.js +107 -0
- package/dist/gears.d.ts +107 -0
- package/dist/gears.js +20 -0
- package/dist/generated/operations.d.ts +19949 -0
- package/dist/generated/operations.js +23846 -0
- package/dist/generated/schema.d.ts +35413 -0
- package/dist/generated/schema.js +1 -0
- package/dist/genesis.d.ts +2926 -0
- package/dist/genesis.js +206 -0
- package/dist/genesis.openapi.json +49321 -0
- package/dist/henry.d.ts +168 -0
- package/dist/henry.js +45 -0
- package/dist/hives-cells.d.ts +127 -0
- package/dist/hives-cells.js +151 -0
- package/dist/hives-environment.d.ts +28 -0
- package/dist/hives-environment.js +58 -0
- package/dist/hives-functions.d.ts +36 -0
- package/dist/hives-functions.js +185 -0
- package/dist/hives-marketplace.d.ts +128 -0
- package/dist/hives-marketplace.js +187 -0
- package/dist/hives-node.d.ts +9 -0
- package/dist/hives-node.js +152 -0
- package/dist/hives-operations.d.ts +337 -0
- package/dist/hives-operations.js +41 -0
- package/dist/hives-queue-consumer.d.ts +56 -0
- package/dist/hives-queue-consumer.js +95 -0
- package/dist/hives-queue-funding.d.ts +28 -0
- package/dist/hives-queue-funding.js +81 -0
- package/dist/hives-queues.d.ts +137 -0
- package/dist/hives-queues.js +143 -0
- package/dist/hives-resources-transport.d.ts +23 -0
- package/dist/hives-resources-transport.js +204 -0
- package/dist/hives-response.d.ts +2 -0
- package/dist/hives-response.js +32 -0
- package/dist/hives-runtimes.d.ts +34 -0
- package/dist/hives-runtimes.js +32 -0
- package/dist/hives-topics.d.ts +51 -0
- package/dist/hives-topics.js +79 -0
- package/dist/hives-upload.d.ts +9 -0
- package/dist/hives-upload.js +23 -0
- package/dist/hives-volumes.d.ts +64 -0
- package/dist/hives-volumes.js +117 -0
- package/dist/idempotency.d.ts +4 -0
- package/dist/idempotency.js +17 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +25 -0
- package/dist/instances.d.ts +25 -0
- package/dist/instances.js +11 -0
- package/dist/lanes.d.ts +267 -0
- package/dist/lanes.js +41 -0
- package/dist/minds-agent.d.ts +60 -0
- package/dist/minds-agent.js +190 -0
- package/dist/minds-owner.d.ts +110 -0
- package/dist/minds-owner.js +226 -0
- package/dist/minds.d.ts +269 -0
- package/dist/minds.js +193 -0
- package/dist/relays-enrollment.d.ts +33 -0
- package/dist/relays-enrollment.js +115 -0
- package/dist/runner-grant.d.ts +10 -0
- package/dist/runner-grant.js +133 -0
- package/dist/runner.d.ts +68 -0
- package/dist/runner.js +116 -0
- package/dist/types.d.ts +87 -0
- package/dist/types.js +1 -0
- package/dist/urls.d.ts +6 -0
- package/dist/urls.js +31 -0
- package/package.json +49 -1
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { envelopeExtrasValid, ENVELOPE_EXTRA_FIELDS, GenesisError } from './errors.js';
|
|
2
|
+
export const mindsOwnerOperations = ['minds_listAgentGroups', 'minds_createAgentGroup', 'minds_listAgentGroupMembers', 'minds_addAgentGroupMember',
|
|
3
|
+
'minds_removeAgentGroupMember', 'minds_listMindAttachments', 'minds_attachMind', 'minds_detachMind'];
|
|
4
|
+
export const isMindsOwnerOperation = (id) => mindsOwnerOperations.includes(id);
|
|
5
|
+
export class MindsOwnerError extends GenesisError {
|
|
6
|
+
}
|
|
7
|
+
const row = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
8
|
+
const exact = (value, keys) => row(value)
|
|
9
|
+
&& Object.keys(value).length === keys.length && keys.every(key => Object.hasOwn(value, key));
|
|
10
|
+
const canonical = (value, prefix) => typeof value === 'string' && new RegExp(`^${prefix}[0-7][0-9A-HJKMNP-TV-Z]{25}$`).test(value);
|
|
11
|
+
const uuid = (value) => typeof value === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(value) && value !== '00000000-0000-0000-0000-000000000000';
|
|
12
|
+
const utf8 = (value) => new TextEncoder().encode(value).length;
|
|
13
|
+
const version = (value) => Number.isSafeInteger(value) && Number(value) >= 0 && Number(value) < Number.MAX_SAFE_INTEGER;
|
|
14
|
+
const positive = (value) => Number.isSafeInteger(value) && Number(value) > 0;
|
|
15
|
+
const tombstone = (value) => value === null || positive(value);
|
|
16
|
+
const name = (value) => typeof value === 'string' && !!value.trim() && utf8(value) <= 128;
|
|
17
|
+
const text = (value) => typeof value === 'string' && value.length > 0;
|
|
18
|
+
const permissions = (value) => JSON.stringify(value) === '["minds.agent_data.read"]'
|
|
19
|
+
|| JSON.stringify(value) === '["minds.agent_data.read","minds.agent_data.write"]';
|
|
20
|
+
const subject = (value) => exact(value, ['kind', 'agentId']) && value.kind === 'agent' && canonical(value.agentId, 'a_')
|
|
21
|
+
|| exact(value, ['kind', 'groupId']) && value.kind === 'group' && canonical(value.groupId, 'agp_');
|
|
22
|
+
const reads = new Set(['minds_listAgentGroups', 'minds_listAgentGroupMembers', 'minds_listMindAttachments']);
|
|
23
|
+
const removes = new Set(['minds_removeAgentGroupMember', 'minds_detachMind']);
|
|
24
|
+
function validBody(id, value) {
|
|
25
|
+
if (reads.has(id))
|
|
26
|
+
return value === undefined;
|
|
27
|
+
if (id === 'minds_createAgentGroup')
|
|
28
|
+
return exact(value, ['operationId', 'name']) && uuid(value.operationId) && name(value.name);
|
|
29
|
+
if (id === 'minds_addAgentGroupMember')
|
|
30
|
+
return exact(value, ['operationId', 'expectedVersion', 'agentId'])
|
|
31
|
+
&& uuid(value.operationId) && version(value.expectedVersion) && canonical(value.agentId, 'a_');
|
|
32
|
+
if (removes.has(id))
|
|
33
|
+
return exact(value, ['operationId', 'expectedVersion']) && uuid(value.operationId) && version(value.expectedVersion);
|
|
34
|
+
return exact(value, ['operationId', 'expectedVersion', 'subject', 'permissions', 'expiresAt']) && uuid(value.operationId)
|
|
35
|
+
&& version(value.expectedVersion) && subject(value.subject) && permissions(value.permissions) && Number.isSafeInteger(value.expiresAt)
|
|
36
|
+
&& Number(value.expiresAt) > Date.now() && Number(value.expiresAt) <= Date.now() + 30 * 86400000;
|
|
37
|
+
}
|
|
38
|
+
function validResponse(id, input, value) {
|
|
39
|
+
const requested = row(input.body) ? input.body : undefined;
|
|
40
|
+
const group = (v) => exact(v, ['id', 'organizationId', 'ownerId', 'organizationGeneration', 'name', 'version', 'revokedAt'])
|
|
41
|
+
&& canonical(v.id, 'agp_') && text(v.organizationId) && text(v.ownerId) && positive(v.organizationGeneration)
|
|
42
|
+
&& name(v.name) && positive(v.version) && tombstone(v.revokedAt)
|
|
43
|
+
&& (id !== 'minds_createAgentGroup' || v.name === requested?.name && v.version === 1 && v.revokedAt === null);
|
|
44
|
+
const member = (v) => exact(v, ['groupId', 'agentId', 'agentDid', 'agentCreatedAt', 'version', 'revokedAt'])
|
|
45
|
+
&& v.groupId === input.group_id && canonical(v.agentId, 'a_') && (input.agent_id === undefined || v.agentId === input.agent_id)
|
|
46
|
+
&& typeof v.agentDid === 'string' && /^did:[A-Za-z0-9:._%-]{1,512}$/.test(v.agentDid)
|
|
47
|
+
&& positive(v.agentCreatedAt) && positive(v.version) && tombstone(v.revokedAt)
|
|
48
|
+
&& (id !== 'minds_addAgentGroupMember' || v.agentId === requested?.agentId && v.version === Number(requested?.expectedVersion) + 1 && v.revokedAt === null)
|
|
49
|
+
&& (id !== 'minds_removeAgentGroupMember' || v.version === Number(requested?.expectedVersion) + 1 && positive(v.revokedAt));
|
|
50
|
+
const attachment = (v) => {
|
|
51
|
+
if (!exact(v, ['id', 'version', 'organizationId', 'projectId', 'mindId', 'subject', 'permissions', 'sharedNamespace', 'expiresAt', 'revokedAt'])
|
|
52
|
+
|| !canonical(v.id, 'mat_') || (input.attachment_id !== undefined && v.id !== input.attachment_id)
|
|
53
|
+
|| !positive(v.version) || !text(v.organizationId) || !text(v.projectId) || v.mindId !== input.mind_id
|
|
54
|
+
|| !subject(v.subject) || !permissions(v.permissions) || !positive(v.expiresAt) || !tombstone(v.revokedAt))
|
|
55
|
+
return false;
|
|
56
|
+
const s = v.subject;
|
|
57
|
+
if (v.sharedNamespace !== (s.kind === 'group' ? `group:${s.groupId}` : null))
|
|
58
|
+
return false;
|
|
59
|
+
if (id === 'minds_attachMind') {
|
|
60
|
+
const selected = requested?.subject;
|
|
61
|
+
return s.kind === selected.kind && (s.kind === 'agent' ? s.agentId === selected.agentId : s.groupId === selected.groupId)
|
|
62
|
+
&& JSON.stringify(v.permissions) === JSON.stringify(requested?.permissions) && v.expiresAt === requested?.expiresAt
|
|
63
|
+
&& v.version === Number(requested?.expectedVersion) + 1 && v.revokedAt === null;
|
|
64
|
+
}
|
|
65
|
+
return id !== 'minds_detachMind' || v.version === Number(requested?.expectedVersion) + 1 && positive(v.revokedAt);
|
|
66
|
+
};
|
|
67
|
+
const list = (key, valid) => exact(value, [key]) && Array.isArray(value[key]) && value[key].every(valid);
|
|
68
|
+
if (id === 'minds_listAgentGroups')
|
|
69
|
+
return list('groups', group);
|
|
70
|
+
if (id === 'minds_listAgentGroupMembers')
|
|
71
|
+
return list('members', member);
|
|
72
|
+
if (id === 'minds_listMindAttachments')
|
|
73
|
+
return list('attachments', attachment);
|
|
74
|
+
return id === 'minds_createAgentGroup' ? group(value) : id === 'minds_addAgentGroupMember' || id === 'minds_removeAgentGroupMember' ? member(value) : attachment(value);
|
|
75
|
+
}
|
|
76
|
+
/** Original-human owner operations. No context selection, token substitution or automatic retry. */
|
|
77
|
+
export async function mindsOwnerTransport(options) {
|
|
78
|
+
const id = options.operationId;
|
|
79
|
+
let dispatched = false;
|
|
80
|
+
const fail = (status, type, info = {}) => new MindsOwnerError({
|
|
81
|
+
status, type, operationId: id, code: info.code, requestId: info.requestId,
|
|
82
|
+
message: 'Minds owner operation was not confirmed. Preserve its operation ID and version when reconciling.',
|
|
83
|
+
...(info.unknown || dispatched && (status === 0 || status >= 500 || type === 'invalid_response' && status >= 200 && status < 300) ? { body: { outcome: 'unknown' } } : {}),
|
|
84
|
+
});
|
|
85
|
+
if (!isMindsOwnerOperation(id) || options.routing !== 'gateway' || Object.keys(options.headers ?? {}).length)
|
|
86
|
+
throw fail(0, 'invalid_request');
|
|
87
|
+
const input = options.input, fields = id === 'minds_listAgentGroups' ? [] : id === 'minds_createAgentGroup' ? ['body']
|
|
88
|
+
: id === 'minds_removeAgentGroupMember' ? ['group_id', 'agent_id', 'body']
|
|
89
|
+
: id === 'minds_listAgentGroupMembers' ? ['group_id'] : id === 'minds_addAgentGroupMember' ? ['group_id', 'body']
|
|
90
|
+
: id === 'minds_listMindAttachments' ? ['mind_id'] : id === 'minds_detachMind' ? ['mind_id', 'attachment_id', 'body'] : ['mind_id', 'body'];
|
|
91
|
+
if (!exact(input, fields) || input.group_id !== undefined && !canonical(input.group_id, 'agp_')
|
|
92
|
+
|| input.agent_id !== undefined && !canonical(input.agent_id, 'a_') || input.mind_id !== undefined && !uuid(input.mind_id)
|
|
93
|
+
|| input.attachment_id !== undefined && !canonical(input.attachment_id, 'mat_') || !validBody(id, input.body))
|
|
94
|
+
throw fail(0, 'invalid_request');
|
|
95
|
+
const body = input.body === undefined ? undefined : JSON.stringify(input.body);
|
|
96
|
+
if (body !== undefined && utf8(body) > 8192)
|
|
97
|
+
throw fail(0, 'invalid_request');
|
|
98
|
+
const controller = new AbortController(), cancel = () => controller.abort(options.signal?.reason);
|
|
99
|
+
options.signal?.addEventListener('abort', cancel, { once: true });
|
|
100
|
+
if (options.signal?.aborted)
|
|
101
|
+
cancel();
|
|
102
|
+
const timer = setTimeout(() => controller.abort(), 35_000);
|
|
103
|
+
async function bounded(work) {
|
|
104
|
+
controller.signal.throwIfAborted();
|
|
105
|
+
let abort = () => { };
|
|
106
|
+
const cancelled = new Promise((_, reject) => { abort = () => reject(fail(0, 'transport_error')); controller.signal.addEventListener('abort', abort, { once: true }); });
|
|
107
|
+
try {
|
|
108
|
+
controller.signal.throwIfAborted();
|
|
109
|
+
let pending;
|
|
110
|
+
try {
|
|
111
|
+
pending = work();
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
pending = Promise.reject(error);
|
|
115
|
+
}
|
|
116
|
+
return await Promise.race([cancelled, pending]);
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
controller.signal.removeEventListener('abort', abort);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
const credential = await bounded(options.credential);
|
|
124
|
+
controller.signal.throwIfAborted();
|
|
125
|
+
if (!text(credential) || utf8(credential) > 16384 || /[^\x21-\x7e]|,/.test(credential))
|
|
126
|
+
throw fail(401, 'unauthenticated');
|
|
127
|
+
const response = await bounded(() => {
|
|
128
|
+
dispatched = !reads.has(id);
|
|
129
|
+
return options.fetch(options.url, { method: reads.has(id) ? 'GET' : removes.has(id) ? 'DELETE' : 'POST',
|
|
130
|
+
headers: { authorization: `Bearer ${credential}`, accept: 'application/json', ...(body === undefined ? {} : { 'content-type': 'application/json' }) },
|
|
131
|
+
...(body === undefined ? {} : { body }), signal: controller.signal, redirect: 'error', cache: 'no-store' }).then(response => {
|
|
132
|
+
if (controller.signal.aborted) {
|
|
133
|
+
void response.body?.cancel().catch(() => { });
|
|
134
|
+
throw fail(0, 'transport_error');
|
|
135
|
+
}
|
|
136
|
+
return response;
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
if (response.headers.get('content-type')?.split(';')[0].trim().toLowerCase() !== 'application/json')
|
|
140
|
+
throw fail(response.status, 'invalid_response');
|
|
141
|
+
const reader = response.body?.getReader();
|
|
142
|
+
if (!reader)
|
|
143
|
+
throw fail(response.status, 'invalid_response');
|
|
144
|
+
const chunks = [];
|
|
145
|
+
let size = 0;
|
|
146
|
+
const stop = () => { void reader.cancel().catch(() => { }); };
|
|
147
|
+
controller.signal.addEventListener('abort', stop, { once: true });
|
|
148
|
+
try {
|
|
149
|
+
for (;;) {
|
|
150
|
+
const next = await bounded(() => reader.read());
|
|
151
|
+
if (next.done)
|
|
152
|
+
break;
|
|
153
|
+
size += next.value.length;
|
|
154
|
+
if (size > 2 * 1024 * 1024)
|
|
155
|
+
throw fail(response.status, 'invalid_response');
|
|
156
|
+
chunks.push(next.value);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
finally {
|
|
160
|
+
controller.signal.removeEventListener('abort', stop);
|
|
161
|
+
stop();
|
|
162
|
+
try {
|
|
163
|
+
reader.releaseLock();
|
|
164
|
+
}
|
|
165
|
+
catch { /* pending cancellation owns the reader */ }
|
|
166
|
+
}
|
|
167
|
+
const bytes = new Uint8Array(size);
|
|
168
|
+
let offset = 0;
|
|
169
|
+
for (const chunk of chunks) {
|
|
170
|
+
bytes.set(chunk, offset);
|
|
171
|
+
offset += chunk.length;
|
|
172
|
+
}
|
|
173
|
+
let value;
|
|
174
|
+
try {
|
|
175
|
+
value = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
throw fail(response.status, 'invalid_response');
|
|
179
|
+
}
|
|
180
|
+
if (!response.ok) {
|
|
181
|
+
if (!exact(value, ['error']) || !row(value.error) || !['code', 'request_id'].every(k => Object.hasOwn(value.error, k))
|
|
182
|
+
|| Object.keys(value.error).some(k => !['code', 'request_id', 'outcome', ...ENVELOPE_EXTRA_FIELDS].includes(k)) || !envelopeExtrasValid(value.error) || typeof value.error.code !== 'string'
|
|
183
|
+
|| !/^[A-Z][A-Z0-9_]{0,127}$/.test(value.error.code) || typeof value.error.request_id !== 'string'
|
|
184
|
+
|| !/^[\x21-\x7e]{1,256}$/.test(value.error.request_id) || value.error.outcome !== undefined && value.error.outcome !== 'unknown')
|
|
185
|
+
throw fail(response.status, 'invalid_response');
|
|
186
|
+
throw fail(response.status, 'minds_owner_error', { code: value.error.code, requestId: value.error.request_id, unknown: !reads.has(id) && value.error.outcome === 'unknown' });
|
|
187
|
+
}
|
|
188
|
+
if (response.status !== 200 || !validResponse(id, input, value))
|
|
189
|
+
throw fail(response.status, 'invalid_response');
|
|
190
|
+
return Response.json(value, { status: 200, headers: { 'cache-control': 'private, no-store' } });
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
if (error instanceof MindsOwnerError)
|
|
194
|
+
throw error;
|
|
195
|
+
throw fail(0, 'transport_error');
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
clearTimeout(timer);
|
|
199
|
+
controller.abort();
|
|
200
|
+
options.signal?.removeEventListener('abort', cancel);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export function mindsOwnerModule(client) {
|
|
204
|
+
const validOptions = (value) => exact(value, []) || exact(value, ['signal']);
|
|
205
|
+
const init = (options) => {
|
|
206
|
+
if (!validOptions(options))
|
|
207
|
+
throw new MindsOwnerError({ status: 0, type: 'invalid_request', message: 'Unknown Minds owner option.' });
|
|
208
|
+
return { signal: options.signal };
|
|
209
|
+
};
|
|
210
|
+
return {
|
|
211
|
+
groups: {
|
|
212
|
+
list: (options = {}) => client.request('minds_listAgentGroups', {}, init(options)),
|
|
213
|
+
create: (body, options = {}) => client.request('minds_createAgentGroup', { body }, init(options)),
|
|
214
|
+
members: {
|
|
215
|
+
list: (group_id, options = {}) => client.request('minds_listAgentGroupMembers', { group_id }, init(options)),
|
|
216
|
+
add: (group_id, body, options = {}) => client.request('minds_addAgentGroupMember', { group_id, body }, init(options)),
|
|
217
|
+
remove: (group_id, agent_id, body, options = {}) => client.request('minds_removeAgentGroupMember', { group_id, agent_id, body }, init(options)),
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
attachments: {
|
|
221
|
+
list: (mind_id, options = {}) => client.request('minds_listMindAttachments', { mind_id }, init(options)),
|
|
222
|
+
attach: (mind_id, body, options = {}) => client.request('minds_attachMind', { mind_id, body }, init(options)),
|
|
223
|
+
detach: (mind_id, attachment_id, body, options = {}) => client.request('minds_detachMind', { mind_id, attachment_id, body }, init(options)),
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
}
|
package/dist/minds.d.ts
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import type { GenesisClient } from './client.js';
|
|
2
|
+
import type { OperationInput, OperationOutput } from './types.js';
|
|
3
|
+
export declare const mindsOperations: readonly ["minds_listMinds", "minds_getMind", "minds_getUsage", "minds_createMind", "minds_resumeMind", "minds_stopMind", "minds_insertEpisodicMemory", "minds_getEpisodicMemory", "minds_updateEpisodicMemory", "minds_searchMemory"];
|
|
4
|
+
export declare const isMindsOperation: (id: string) => boolean;
|
|
5
|
+
export type MindsEventInput = OperationInput<'minds_insertEpisodicMemory'>['body']['event'];
|
|
6
|
+
export type MindsUsage = OperationOutput<'minds_getUsage'>;
|
|
7
|
+
export interface MindsRequestOptions {
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
export type MindsWakeReason = 'manual' | 'scheduled_job' | 'webhook' | 'memory_consolidation' | 'activity';
|
|
11
|
+
export interface MindsResumeOptions extends MindsRequestOptions {
|
|
12
|
+
idempotencyKey: string;
|
|
13
|
+
wakeReason?: MindsWakeReason;
|
|
14
|
+
}
|
|
15
|
+
export interface MindsStopOptions extends MindsRequestOptions {
|
|
16
|
+
idempotencyKey: string;
|
|
17
|
+
}
|
|
18
|
+
export interface MindsCreateOptions extends MindsRequestOptions {
|
|
19
|
+
idempotencyKey: string;
|
|
20
|
+
contextSha256: string;
|
|
21
|
+
plan?: 'free' | 'pro';
|
|
22
|
+
profileId?: 'F1' | 'D1' | 'D2';
|
|
23
|
+
}
|
|
24
|
+
/** One dispatch only. Creation retains its operation key; episodic insertion returns a storage UUID distinct from event.id. */
|
|
25
|
+
export declare function mindsTransport(options: {
|
|
26
|
+
operationId: string;
|
|
27
|
+
input: Record<string, unknown>;
|
|
28
|
+
headers?: Record<string, string>;
|
|
29
|
+
routing: string;
|
|
30
|
+
url: string;
|
|
31
|
+
credential: () => Promise<string | undefined>;
|
|
32
|
+
fetch: typeof fetch;
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
}): Promise<Response>;
|
|
35
|
+
export declare function mindsModule(client: GenesisClient): {
|
|
36
|
+
agent: {
|
|
37
|
+
memory: {
|
|
38
|
+
insert: (mind: string, event: import("./minds-agent.js").MindsAgentEventInput, options?: import("./minds-agent.js").MindsAgentOptions) => Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
}>;
|
|
41
|
+
get: (mind: string, storage_id: string, options?: import("./minds-agent.js").MindsAgentOptions) => Promise<{
|
|
42
|
+
item: import("./index.js").components["schemas"]["Minds.EpisodicEvent"] | null;
|
|
43
|
+
}>;
|
|
44
|
+
search: (mind: string, text: string, limit?: number, options?: import("./minds-agent.js").MindsAgentOptions) => Promise<({
|
|
45
|
+
id: string;
|
|
46
|
+
content: string;
|
|
47
|
+
timestamp: string;
|
|
48
|
+
event_type: "Conversation" | "Command" | "Query" | "Document" | "Error" | "Success" | "Learning" | "Decision" | "Action" | "Context" | "Knowledge";
|
|
49
|
+
summary?: string | null;
|
|
50
|
+
tags: string[];
|
|
51
|
+
} & {
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
})[]>;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
list: (query?: OperationInput<"minds_listMinds">, options?: MindsRequestOptions) => Promise<{
|
|
57
|
+
schema_version: "minds.controller.v1";
|
|
58
|
+
items: import("./index.js").components["schemas"]["Minds.Mind"][];
|
|
59
|
+
next_cursor: string | null;
|
|
60
|
+
context_sha256: string;
|
|
61
|
+
}>;
|
|
62
|
+
get: (mind_id: string, options?: MindsRequestOptions) => Promise<{
|
|
63
|
+
schema_version: "minds.controller.v1";
|
|
64
|
+
mind_id: string;
|
|
65
|
+
organization_id: string;
|
|
66
|
+
project_id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
region: string;
|
|
69
|
+
plan: "free" | "pro";
|
|
70
|
+
capacity: import("./index.js").components["schemas"]["Minds.Capacity"];
|
|
71
|
+
observed_capacity: import("./index.js").components["schemas"]["Minds.Capacity"] | null;
|
|
72
|
+
services: string[];
|
|
73
|
+
volume_id: string;
|
|
74
|
+
base_url: string;
|
|
75
|
+
desired_state: "running" | "stopped" | "deleted";
|
|
76
|
+
observed_state: "pending" | "running" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
77
|
+
desired_generation: number;
|
|
78
|
+
observed_generation: number;
|
|
79
|
+
status: "ready" | "provisioning" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
80
|
+
capacity_applied: boolean;
|
|
81
|
+
operation_id: string | null;
|
|
82
|
+
error_code: string | null;
|
|
83
|
+
created_at: string;
|
|
84
|
+
updated_at: string;
|
|
85
|
+
} & {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
}>;
|
|
88
|
+
usage: (window: OperationInput<"minds_getUsage">, options?: MindsRequestOptions) => Promise<{
|
|
89
|
+
schema_version: "minds.controller.v1";
|
|
90
|
+
organization_id: string;
|
|
91
|
+
project_id: string;
|
|
92
|
+
from: string;
|
|
93
|
+
to: string;
|
|
94
|
+
measured_at: string;
|
|
95
|
+
basis: "host_confirmed_intervals";
|
|
96
|
+
minds: import("./index.js").components["schemas"]["Minds.UsageMind"][];
|
|
97
|
+
}>;
|
|
98
|
+
create: (name: string, options: MindsCreateOptions) => Promise<{
|
|
99
|
+
schema_version: "minds.controller.v1";
|
|
100
|
+
mind_id: string;
|
|
101
|
+
organization_id: string;
|
|
102
|
+
project_id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
region: string;
|
|
105
|
+
plan: "free" | "pro";
|
|
106
|
+
capacity: import("./index.js").components["schemas"]["Minds.Capacity"];
|
|
107
|
+
observed_capacity: import("./index.js").components["schemas"]["Minds.Capacity"] | null;
|
|
108
|
+
services: string[];
|
|
109
|
+
volume_id: string;
|
|
110
|
+
base_url: string;
|
|
111
|
+
desired_state: "running" | "stopped" | "deleted";
|
|
112
|
+
observed_state: "pending" | "running" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
113
|
+
desired_generation: number;
|
|
114
|
+
observed_generation: number;
|
|
115
|
+
status: "ready" | "provisioning" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
116
|
+
capacity_applied: boolean;
|
|
117
|
+
operation_id: string | null;
|
|
118
|
+
error_code: string | null;
|
|
119
|
+
created_at: string;
|
|
120
|
+
updated_at: string;
|
|
121
|
+
} & {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
}>;
|
|
124
|
+
resume: (mind_id: string, expected_generation: number, options: MindsResumeOptions) => Promise<{
|
|
125
|
+
schema_version: "minds.controller.v1";
|
|
126
|
+
mind_id: string;
|
|
127
|
+
organization_id: string;
|
|
128
|
+
project_id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
region: string;
|
|
131
|
+
plan: "free" | "pro";
|
|
132
|
+
capacity: import("./index.js").components["schemas"]["Minds.Capacity"];
|
|
133
|
+
observed_capacity: import("./index.js").components["schemas"]["Minds.Capacity"] | null;
|
|
134
|
+
services: string[];
|
|
135
|
+
volume_id: string;
|
|
136
|
+
base_url: string;
|
|
137
|
+
desired_state: "running" | "stopped" | "deleted";
|
|
138
|
+
observed_state: "pending" | "running" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
139
|
+
desired_generation: number;
|
|
140
|
+
observed_generation: number;
|
|
141
|
+
status: "ready" | "provisioning" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
142
|
+
capacity_applied: boolean;
|
|
143
|
+
operation_id: string | null;
|
|
144
|
+
error_code: string | null;
|
|
145
|
+
created_at: string;
|
|
146
|
+
updated_at: string;
|
|
147
|
+
} & {
|
|
148
|
+
[key: string]: unknown;
|
|
149
|
+
}>;
|
|
150
|
+
stop: (mind_id: string, expected_generation: number, options: MindsStopOptions) => Promise<{
|
|
151
|
+
schema_version: "minds.controller.v1";
|
|
152
|
+
mind_id: string;
|
|
153
|
+
organization_id: string;
|
|
154
|
+
project_id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
region: string;
|
|
157
|
+
plan: "free" | "pro";
|
|
158
|
+
capacity: import("./index.js").components["schemas"]["Minds.Capacity"];
|
|
159
|
+
observed_capacity: import("./index.js").components["schemas"]["Minds.Capacity"] | null;
|
|
160
|
+
services: string[];
|
|
161
|
+
volume_id: string;
|
|
162
|
+
base_url: string;
|
|
163
|
+
desired_state: "running" | "stopped" | "deleted";
|
|
164
|
+
observed_state: "pending" | "running" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
165
|
+
desired_generation: number;
|
|
166
|
+
observed_generation: number;
|
|
167
|
+
status: "ready" | "provisioning" | "stopped" | "deleted" | "failed" | "uncertain";
|
|
168
|
+
capacity_applied: boolean;
|
|
169
|
+
operation_id: string | null;
|
|
170
|
+
error_code: string | null;
|
|
171
|
+
created_at: string;
|
|
172
|
+
updated_at: string;
|
|
173
|
+
} & {
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
}>;
|
|
176
|
+
memory: {
|
|
177
|
+
insert: (mind: string, event: MindsEventInput, options?: MindsRequestOptions) => Promise<{
|
|
178
|
+
id: string;
|
|
179
|
+
}>;
|
|
180
|
+
get: (mind: string, storage_id: string, options?: MindsRequestOptions) => Promise<{
|
|
181
|
+
item: import("./index.js").components["schemas"]["Minds.EpisodicEvent"] | null;
|
|
182
|
+
}>;
|
|
183
|
+
update: (mind: string, storage_id: string, body: {
|
|
184
|
+
event_id: string;
|
|
185
|
+
content: string;
|
|
186
|
+
}, options?: MindsRequestOptions) => Promise<{
|
|
187
|
+
ok: true;
|
|
188
|
+
}>;
|
|
189
|
+
search: (mind: string, text: string, limit?: number, options?: MindsRequestOptions) => Promise<({
|
|
190
|
+
id: string;
|
|
191
|
+
content: string;
|
|
192
|
+
timestamp: string;
|
|
193
|
+
event_type: "Conversation" | "Command" | "Query" | "Document" | "Error" | "Success" | "Learning" | "Decision" | "Action" | "Context" | "Knowledge";
|
|
194
|
+
summary?: string | null;
|
|
195
|
+
tags: string[];
|
|
196
|
+
} & {
|
|
197
|
+
[key: string]: unknown;
|
|
198
|
+
})[]>;
|
|
199
|
+
};
|
|
200
|
+
groups: {
|
|
201
|
+
list: (options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
202
|
+
groups: import("./index.js").components["schemas"]["Minds.OwnerAgentGroup"][];
|
|
203
|
+
}>;
|
|
204
|
+
create: (body: {
|
|
205
|
+
operationId: string;
|
|
206
|
+
name: string;
|
|
207
|
+
}, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
208
|
+
id: string;
|
|
209
|
+
organizationId: string;
|
|
210
|
+
ownerId: string;
|
|
211
|
+
organizationGeneration: number;
|
|
212
|
+
name: string;
|
|
213
|
+
version: number;
|
|
214
|
+
revokedAt: number | null;
|
|
215
|
+
}>;
|
|
216
|
+
members: {
|
|
217
|
+
list: (group_id: string, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
218
|
+
members: import("./index.js").components["schemas"]["Minds.OwnerAgentGroupMember"][];
|
|
219
|
+
}>;
|
|
220
|
+
add: (group_id: string, body: import("./minds-owner.js").MindsOwnerVersion & {
|
|
221
|
+
agentId: string;
|
|
222
|
+
}, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
223
|
+
groupId: string;
|
|
224
|
+
agentId: string;
|
|
225
|
+
agentDid: string;
|
|
226
|
+
agentCreatedAt: number;
|
|
227
|
+
version: number;
|
|
228
|
+
revokedAt: number | null;
|
|
229
|
+
}>;
|
|
230
|
+
remove: (group_id: string, agent_id: string, body: import("./minds-owner.js").MindsOwnerVersion, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
231
|
+
groupId: string;
|
|
232
|
+
agentId: string;
|
|
233
|
+
agentDid: string;
|
|
234
|
+
agentCreatedAt: number;
|
|
235
|
+
version: number;
|
|
236
|
+
revokedAt: number | null;
|
|
237
|
+
}>;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
attachments: {
|
|
241
|
+
list: (mind_id: string, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
242
|
+
attachments: import("./index.js").components["schemas"]["Minds.MindAttachment"][];
|
|
243
|
+
}>;
|
|
244
|
+
attach: (mind_id: string, body: import("./minds-owner.js").MindsAttachInput, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
245
|
+
id: string;
|
|
246
|
+
version: number;
|
|
247
|
+
organizationId: string;
|
|
248
|
+
projectId: string;
|
|
249
|
+
mindId: string;
|
|
250
|
+
subject: import("./index.js").components["schemas"]["Minds.MindAttachmentSubject"];
|
|
251
|
+
permissions: ["minds.agent_data.read"] | ["minds.agent_data.read", "minds.agent_data.write"];
|
|
252
|
+
sharedNamespace: string | null;
|
|
253
|
+
expiresAt: number;
|
|
254
|
+
revokedAt: number | null;
|
|
255
|
+
}>;
|
|
256
|
+
detach: (mind_id: string, attachment_id: string, body: import("./minds-owner.js").MindsOwnerVersion, options?: import("./minds-owner.js").MindsOwnerOptions) => Promise<{
|
|
257
|
+
id: string;
|
|
258
|
+
version: number;
|
|
259
|
+
organizationId: string;
|
|
260
|
+
projectId: string;
|
|
261
|
+
mindId: string;
|
|
262
|
+
subject: import("./index.js").components["schemas"]["Minds.MindAttachmentSubject"];
|
|
263
|
+
permissions: ["minds.agent_data.read"] | ["minds.agent_data.read", "minds.agent_data.write"];
|
|
264
|
+
sharedNamespace: string | null;
|
|
265
|
+
expiresAt: number;
|
|
266
|
+
revokedAt: number | null;
|
|
267
|
+
}>;
|
|
268
|
+
};
|
|
269
|
+
};
|