@muxoai/platform 1.3.0 → 1.3.2
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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +19 -4
- package/.codex/config.toml +9 -2
- package/README.md +63 -20
- package/dist/clerk.d.ts +33 -0
- package/dist/clerk.js +198 -0
- package/dist/cli.js +1181 -99
- package/dist/engine.d.ts +22 -1
- package/dist/engine.js +284 -14
- package/dist/mcp.d.ts +6 -1
- package/dist/mcp.js +109 -22
- package/dist/nl.js +60 -36
- package/dist/policy.d.ts +9 -0
- package/dist/policy.js +73 -0
- package/dist/providers/composio-instant.d.ts +4 -0
- package/dist/providers/composio-instant.js +634 -534
- package/dist/providers/composio-sdk.d.ts +1 -0
- package/dist/providers/composio-sdk.js +6 -2
- package/dist/providers/microsoft-governance.d.ts +61 -2
- package/dist/providers/microsoft-governance.js +458 -24
- package/dist/providers/stripe-billing.js +14 -4
- package/dist/providers/stripe-projects.d.ts +4 -1
- package/dist/providers/stripe-projects.js +123 -12
- package/dist/providers/supermemory.d.ts +28 -5
- package/dist/providers/supermemory.js +183 -55
- package/dist/sdk.d.ts +167 -1
- package/dist/sdk.js +113 -2
- package/dist/server.js +258 -40
- package/dist/store.d.ts +26 -1
- package/dist/store.js +255 -6
- package/dist/types.d.ts +86 -0
- package/dist/ui/console-html.d.ts +16 -0
- package/dist/ui/console-html.js +2427 -2206
- package/dist/ui/design-tokens.d.ts +177 -0
- package/dist/ui/design-tokens.js +210 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +2 -2
- package/plugins/muxo/.app.json +1 -1
- package/plugins/muxo/.claude-plugin/plugin.json +2 -2
- package/plugins/muxo/.codex-plugin/plugin.json +7 -5
- package/plugins/muxo/.mcp.json +1 -33
- package/plugins/muxo/assets/logo.png +0 -0
- package/plugins/muxo/hooks/session-start.sh +1 -1
- package/plugins/muxo/plugin.json +63 -6
- package/plugins/muxo/skills/muxo/SKILL.md +92 -14
- package/plugins/muxo/skills/muxo/agents/openai.yaml +12 -0
- package/plugins/muxo/skills/muxo/references/cli.md +4 -2
- package/plugins/muxo/skills/muxo/references/mcp.md +15 -9
- package/plugins/muxo/skills/setup/SKILL.md +8 -2
- package/plugins/muxo/skills/setup/agents/openai.yaml +12 -0
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import Supermemory from "supermemory";
|
|
3
|
+
// Profile buckets can hold plain strings or memory objects depending on API version.
|
|
4
|
+
function toFactTexts(items) {
|
|
5
|
+
if (!Array.isArray(items))
|
|
6
|
+
return [];
|
|
7
|
+
return items
|
|
8
|
+
.map((item) => {
|
|
9
|
+
if (item == null)
|
|
10
|
+
return "";
|
|
11
|
+
if (typeof item !== "object")
|
|
12
|
+
return String(item);
|
|
13
|
+
const o = item;
|
|
14
|
+
const text = o.memory ?? o.content ?? o.text ?? o.fact ?? o.value ?? o.summary ?? o.title;
|
|
15
|
+
return typeof text === "string" ? text : JSON.stringify(item);
|
|
16
|
+
})
|
|
17
|
+
.map((s) => s.trim())
|
|
18
|
+
.filter(Boolean);
|
|
19
|
+
}
|
|
3
20
|
/**
|
|
4
21
|
* Supermemory v5 Contextual Brain & Context-Aware Tool Call Adapter.
|
|
5
22
|
* Uses deterministic per-workspace namespaces (`/ns/muxo-v5-<hash>/...`)
|
|
@@ -8,21 +25,71 @@ import Supermemory from "supermemory";
|
|
|
8
25
|
export class SupermemoryAdapter {
|
|
9
26
|
config;
|
|
10
27
|
client;
|
|
28
|
+
byokClients = new Map();
|
|
29
|
+
unavailableUntil = 0;
|
|
11
30
|
constructor(config) {
|
|
12
31
|
this.config = config;
|
|
13
32
|
if (config.supermemoryApiKey) {
|
|
14
33
|
this.client = new Supermemory({
|
|
15
34
|
apiKey: config.supermemoryApiKey,
|
|
16
35
|
baseUrl: config.supermemoryBaseUrl,
|
|
17
|
-
maxRetries:
|
|
36
|
+
maxRetries: 0,
|
|
37
|
+
timeoutInSeconds: 2,
|
|
18
38
|
});
|
|
19
39
|
}
|
|
20
40
|
else {
|
|
21
41
|
this.client = null;
|
|
22
42
|
}
|
|
23
43
|
}
|
|
24
|
-
|
|
25
|
-
|
|
44
|
+
resolveClient(apiKeyOverride) {
|
|
45
|
+
const trimmedByok = String(apiKeyOverride || "").trim();
|
|
46
|
+
if (trimmedByok) {
|
|
47
|
+
let byokClient = this.byokClients.get(trimmedByok);
|
|
48
|
+
if (!byokClient) {
|
|
49
|
+
byokClient = new Supermemory({
|
|
50
|
+
apiKey: trimmedByok,
|
|
51
|
+
baseUrl: this.config.supermemoryBaseUrl,
|
|
52
|
+
maxRetries: 0,
|
|
53
|
+
timeoutInSeconds: 2,
|
|
54
|
+
});
|
|
55
|
+
this.byokClients.set(trimmedByok, byokClient);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
client: byokClient,
|
|
59
|
+
fundingSource: "customer_byok_supermemory",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
if (this.client) {
|
|
63
|
+
return {
|
|
64
|
+
client: this.client,
|
|
65
|
+
fundingSource: "muxo_funded",
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
client: null,
|
|
70
|
+
fundingSource: "local_fallback",
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
withTimeout(fn, ms = 1000) {
|
|
74
|
+
if (Date.now() < this.unavailableUntil) {
|
|
75
|
+
return Promise.resolve(null);
|
|
76
|
+
}
|
|
77
|
+
return Promise.race([
|
|
78
|
+
fn(),
|
|
79
|
+
new Promise((resolve) => {
|
|
80
|
+
const t = setTimeout(() => {
|
|
81
|
+
this.unavailableUntil = Date.now() + 30_000;
|
|
82
|
+
resolve(null);
|
|
83
|
+
}, ms);
|
|
84
|
+
t.unref?.();
|
|
85
|
+
}),
|
|
86
|
+
]).catch(() => {
|
|
87
|
+
this.unavailableUntil = Date.now() + 30_000;
|
|
88
|
+
return null;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
isEnabled(apiKeyOverride) {
|
|
92
|
+
return Boolean(this.resolveClient(apiKeyOverride).client);
|
|
26
93
|
}
|
|
27
94
|
/**
|
|
28
95
|
* Derives a strict Supermemory v5 namespace (`^[a-zA-Z0-9_:-]+$`) scoped to a workspace.
|
|
@@ -50,21 +117,29 @@ export class SupermemoryAdapter {
|
|
|
50
117
|
}
|
|
51
118
|
/**
|
|
52
119
|
* Fetches the workspace's static + dynamic profile and optionally semantic search results
|
|
53
|
-
* in a single fail-open call.
|
|
120
|
+
* in a single fail-open call. Supports customer BYOK `supermemory` keys via `apiKeyOverride`.
|
|
54
121
|
*/
|
|
55
|
-
async getContextForWorkspace(workspaceIdOrParams, optionalQuery) {
|
|
122
|
+
async getContextForWorkspace(workspaceIdOrParams, optionalQuery, optionalApiKeyOverride) {
|
|
56
123
|
const params = typeof workspaceIdOrParams === "string"
|
|
57
|
-
? {
|
|
124
|
+
? {
|
|
125
|
+
workspaceId: workspaceIdOrParams,
|
|
126
|
+
query: optionalQuery,
|
|
127
|
+
limit: 5,
|
|
128
|
+
apiKeyOverride: optionalApiKeyOverride,
|
|
129
|
+
}
|
|
58
130
|
: workspaceIdOrParams;
|
|
59
131
|
const namespace = this.namespaceForWorkspace(params.workspaceId);
|
|
60
|
-
|
|
132
|
+
const { client, fundingSource } = this.resolveClient(params.apiKeyOverride);
|
|
133
|
+
if (!client) {
|
|
61
134
|
return {
|
|
62
135
|
enabled: false,
|
|
63
136
|
namespace,
|
|
137
|
+
fundingSource,
|
|
64
138
|
staticFacts: [],
|
|
65
139
|
dynamicContext: [],
|
|
66
140
|
recalledMemories: [],
|
|
67
141
|
formattedPromptContext: "Supermemory v5 disabled (no API key configured).",
|
|
142
|
+
profileMarkdown: "",
|
|
68
143
|
profile: { static: [], dynamic: [], preferences: [] },
|
|
69
144
|
relevantMemories: [],
|
|
70
145
|
};
|
|
@@ -74,50 +149,42 @@ export class SupermemoryAdapter {
|
|
|
74
149
|
let dynamicFacts = [];
|
|
75
150
|
let preferences = [];
|
|
76
151
|
const relevantMemories = [];
|
|
77
|
-
|
|
78
|
-
|
|
152
|
+
const [profileOutcome, searchOutcome] = await Promise.allSettled([
|
|
153
|
+
this.withTimeout(() => client.profile(namespace, {
|
|
79
154
|
...(params.query ? { q: params.query } : {}),
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
?
|
|
83
|
-
: [];
|
|
84
|
-
dynamicFacts = Array.isArray(profileRes?.profile?.dynamic)
|
|
85
|
-
? profileRes.profile.dynamic.map(String)
|
|
86
|
-
: [];
|
|
87
|
-
preferences = Array.isArray(profileRes?.profile?.buckets?.preferences)
|
|
88
|
-
? profileRes.profile.buckets.preferences.map(String)
|
|
89
|
-
: [];
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
// Fail-open: never block tool planning if profile endpoint times out
|
|
93
|
-
}
|
|
94
|
-
if (params.query && params.query.trim().length > 0) {
|
|
95
|
-
try {
|
|
96
|
-
const searchRes = await this.client.search(namespace, {
|
|
155
|
+
}), 1000),
|
|
156
|
+
params.query && params.query.trim().length > 0
|
|
157
|
+
? this.withTimeout(() => client.search(namespace, {
|
|
97
158
|
query: params.query.trim(),
|
|
98
159
|
limit,
|
|
99
160
|
searchMode: "hybrid",
|
|
100
161
|
include: { documents: true, forgotten: false, related: false },
|
|
101
162
|
rewriteQuery: false,
|
|
163
|
+
}), 1000)
|
|
164
|
+
: Promise.resolve(null),
|
|
165
|
+
]);
|
|
166
|
+
if (profileOutcome.status === "fulfilled" && profileOutcome.value) {
|
|
167
|
+
const profileRes = profileOutcome.value;
|
|
168
|
+
staticFacts = toFactTexts(profileRes?.profile?.static);
|
|
169
|
+
dynamicFacts = toFactTexts(profileRes?.profile?.dynamic);
|
|
170
|
+
preferences = toFactTexts(profileRes?.profile?.buckets?.preferences);
|
|
171
|
+
}
|
|
172
|
+
if (searchOutcome.status === "fulfilled" && searchOutcome.value) {
|
|
173
|
+
const searchRes = searchOutcome.value;
|
|
174
|
+
for (const item of (searchRes?.results || []).slice(0, limit)) {
|
|
175
|
+
const doc = item.included?.document;
|
|
176
|
+
const title = String(doc?.metadata?.title ||
|
|
177
|
+
doc?.title ||
|
|
178
|
+
item.memory ||
|
|
179
|
+
item.chunk ||
|
|
180
|
+
"Workspace Memory").slice(0, 120);
|
|
181
|
+
const snippet = String(item.memory || item.chunk || doc?.metadata?.summary || "").slice(0, 300);
|
|
182
|
+
relevantMemories.push({
|
|
183
|
+
documentId: String(doc?.id || item.id || ""),
|
|
184
|
+
title,
|
|
185
|
+
snippet,
|
|
186
|
+
similarity: Number(item.similarity || 0),
|
|
102
187
|
});
|
|
103
|
-
for (const item of (searchRes?.results || []).slice(0, limit)) {
|
|
104
|
-
const doc = item.included?.document;
|
|
105
|
-
const title = String(doc?.metadata?.title ||
|
|
106
|
-
doc?.title ||
|
|
107
|
-
item.memory ||
|
|
108
|
-
item.chunk ||
|
|
109
|
-
"Workspace Memory").slice(0, 120);
|
|
110
|
-
const snippet = String(item.memory || item.chunk || doc?.metadata?.summary || "").slice(0, 300);
|
|
111
|
-
relevantMemories.push({
|
|
112
|
-
documentId: String(doc?.id || item.id || ""),
|
|
113
|
-
title,
|
|
114
|
-
snippet,
|
|
115
|
-
similarity: Number(item.similarity || 0),
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
catch {
|
|
120
|
-
// Fail-open
|
|
121
188
|
}
|
|
122
189
|
}
|
|
123
190
|
const promptLines = [
|
|
@@ -132,13 +199,25 @@ export class SupermemoryAdapter {
|
|
|
132
199
|
if (relevantMemories.length > 0) {
|
|
133
200
|
promptLines.push(`Recalled Memories: ${relevantMemories.map((m) => `${m.title}: ${m.snippet}`).join(" | ")}`);
|
|
134
201
|
}
|
|
202
|
+
const mdLines = [`## Workspace Profile (${namespace})`];
|
|
203
|
+
if (staticFacts.length > 0) {
|
|
204
|
+
mdLines.push("### Static Facts", ...staticFacts.map((f) => `- ${f}`));
|
|
205
|
+
}
|
|
206
|
+
if (dynamicFacts.length > 0) {
|
|
207
|
+
mdLines.push("### Dynamic Context", ...dynamicFacts.map((f) => `- ${f}`));
|
|
208
|
+
}
|
|
209
|
+
if (preferences.length > 0) {
|
|
210
|
+
mdLines.push("### Preferences", ...preferences.map((f) => `- ${f}`));
|
|
211
|
+
}
|
|
135
212
|
return {
|
|
136
213
|
enabled: true,
|
|
137
214
|
namespace,
|
|
215
|
+
fundingSource,
|
|
138
216
|
staticFacts,
|
|
139
217
|
dynamicContext: dynamicFacts,
|
|
140
218
|
recalledMemories: relevantMemories,
|
|
141
219
|
formattedPromptContext: promptLines.join("\n"),
|
|
220
|
+
profileMarkdown: mdLines.join("\n"),
|
|
142
221
|
profile: {
|
|
143
222
|
static: staticFacts,
|
|
144
223
|
dynamic: dynamicFacts,
|
|
@@ -148,36 +227,41 @@ export class SupermemoryAdapter {
|
|
|
148
227
|
};
|
|
149
228
|
}
|
|
150
229
|
/**
|
|
151
|
-
* Stores a governed, secret-sanitized document/memory in the workspace's Supermemory v5 namespace
|
|
230
|
+
* Stores a governed, secret-sanitized document/memory in the workspace's Supermemory v5 namespace
|
|
231
|
+
* with `dreaming: "instant"` so profile facts are synthesized immediately.
|
|
152
232
|
*/
|
|
153
233
|
async addMemory(params) {
|
|
154
234
|
const namespace = this.namespaceForWorkspace(params.workspaceId);
|
|
155
235
|
const sanitizedContent = this.sanitizeContent(params.content);
|
|
156
236
|
const docId = params.documentId || `mem_${crypto.randomBytes(8).toString("hex")}`;
|
|
157
|
-
|
|
237
|
+
const { client, fundingSource } = this.resolveClient(params.apiKeyOverride);
|
|
238
|
+
if (!client) {
|
|
158
239
|
return {
|
|
159
240
|
documentId: docId,
|
|
160
241
|
namespace,
|
|
161
242
|
status: "local_only",
|
|
162
243
|
sanitizedContent,
|
|
244
|
+
fundingSource,
|
|
163
245
|
};
|
|
164
246
|
}
|
|
165
|
-
const res = await this.client.add(namespace, {
|
|
247
|
+
const res = await this.withTimeout(() => client.add(namespace, {
|
|
166
248
|
id: docId,
|
|
167
249
|
content: `${params.title}\n\n${sanitizedContent}`,
|
|
168
250
|
taskType: "memory",
|
|
251
|
+
dreaming: params.dreaming || "instant",
|
|
169
252
|
metadata: {
|
|
170
253
|
title: params.title,
|
|
171
254
|
muxoWorkspaceId: params.workspaceId,
|
|
172
255
|
muxoKind: params.kind,
|
|
173
256
|
...(params.metadata || {}),
|
|
174
257
|
},
|
|
175
|
-
});
|
|
258
|
+
}), 1500);
|
|
176
259
|
return {
|
|
177
|
-
documentId: String(res
|
|
260
|
+
documentId: String(res?.id || docId),
|
|
178
261
|
namespace,
|
|
179
|
-
status: String(res
|
|
262
|
+
status: String(res?.status || "queued"),
|
|
180
263
|
sanitizedContent,
|
|
264
|
+
fundingSource,
|
|
181
265
|
};
|
|
182
266
|
}
|
|
183
267
|
async recordExecutionMemory(params) {
|
|
@@ -187,6 +271,7 @@ export class SupermemoryAdapter {
|
|
|
187
271
|
title: `Execution: ${params.toolSlug} (${params.status})`,
|
|
188
272
|
content: params.summary,
|
|
189
273
|
kind: "execution_outcome",
|
|
274
|
+
apiKeyOverride: params.apiKeyOverride,
|
|
190
275
|
metadata: {
|
|
191
276
|
toolSlug: params.toolSlug,
|
|
192
277
|
lane: params.lane,
|
|
@@ -194,7 +279,7 @@ export class SupermemoryAdapter {
|
|
|
194
279
|
status: params.status,
|
|
195
280
|
},
|
|
196
281
|
});
|
|
197
|
-
return added.documentId;
|
|
282
|
+
return added ? added.documentId : null;
|
|
198
283
|
}
|
|
199
284
|
catch {
|
|
200
285
|
return null;
|
|
@@ -203,15 +288,16 @@ export class SupermemoryAdapter {
|
|
|
203
288
|
/**
|
|
204
289
|
* Deletes/forgets a memory document from the workspace's Supermemory v5 namespace.
|
|
205
290
|
*/
|
|
206
|
-
async deleteMemory(workspaceId, documentId) {
|
|
291
|
+
async deleteMemory(workspaceId, documentId, apiKeyOverride) {
|
|
207
292
|
const namespace = this.namespaceForWorkspace(workspaceId);
|
|
208
|
-
|
|
293
|
+
const { client } = this.resolveClient(apiKeyOverride);
|
|
294
|
+
if (!client) {
|
|
209
295
|
return { deleted: true, namespace };
|
|
210
296
|
}
|
|
211
297
|
try {
|
|
212
|
-
const res = await this.client.documents.delete(namespace, {
|
|
298
|
+
const res = await this.withTimeout(() => client.documents.delete(namespace, {
|
|
213
299
|
ids: [documentId],
|
|
214
|
-
});
|
|
300
|
+
}), 1200);
|
|
215
301
|
return {
|
|
216
302
|
deleted: (res?.count || 0) >= 1,
|
|
217
303
|
namespace,
|
|
@@ -221,4 +307,46 @@ export class SupermemoryAdapter {
|
|
|
221
307
|
return { deleted: false, namespace };
|
|
222
308
|
}
|
|
223
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Semantically searches and forgets/prunes outdated memories in Supermemory v5 matching a query.
|
|
312
|
+
*/
|
|
313
|
+
async forgetMatching(params) {
|
|
314
|
+
const namespace = this.namespaceForWorkspace(params.workspaceId);
|
|
315
|
+
const { client, fundingSource } = this.resolveClient(params.apiKeyOverride);
|
|
316
|
+
if (!client || !params.query.trim()) {
|
|
317
|
+
return {
|
|
318
|
+
namespace,
|
|
319
|
+
deletedRemoteIds: [],
|
|
320
|
+
fundingSource,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
try {
|
|
324
|
+
const searchRes = await this.withTimeout(() => client.search(namespace, {
|
|
325
|
+
query: params.query.trim(),
|
|
326
|
+
limit: Math.min(10, Math.max(1, Number(params.limit || 5))),
|
|
327
|
+
searchMode: "hybrid",
|
|
328
|
+
include: { documents: true, forgotten: false, related: false },
|
|
329
|
+
rewriteQuery: false,
|
|
330
|
+
}), 1200);
|
|
331
|
+
const docIds = Array.from(new Set((searchRes?.results || [])
|
|
332
|
+
.map((r) => String(r.included?.document?.id || r.id || ""))
|
|
333
|
+
.filter(Boolean)));
|
|
334
|
+
if (docIds.length > 0) {
|
|
335
|
+
await this.withTimeout(() => client.documents.delete(namespace, { ids: docIds }), 1200);
|
|
336
|
+
return {
|
|
337
|
+
namespace,
|
|
338
|
+
deletedRemoteIds: docIds,
|
|
339
|
+
fundingSource,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
catch {
|
|
344
|
+
// Fail-open on remote pruning errors
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
namespace,
|
|
348
|
+
deletedRemoteIds: [],
|
|
349
|
+
fundingSource,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
224
352
|
}
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type { ActionPlan, ByokKeyRecord, ConnectionRecord, ExecutionReceipt, ExecutionRun, MuxoTool, ProviderLane, ProvisionedResource, RiskLevel, SupplierSettlementSummary, Workspace, WorkspaceMemoryRecord } from "./types.js";
|
|
1
|
+
import type { ActionPlan, ByokKeyRecord, ConnectionRecord, ExecutionReceipt, ExecutionRun, GovernancePolicy, MuxoTool, ProviderLane, ProvisionedResource, RiskLevel, SupplierSettlementSummary, TemporalGraphFact, Workspace, WorkspaceMemoryRecord } from "./types.js";
|
|
2
|
+
export interface MuxoTrustScore {
|
|
3
|
+
overall: number;
|
|
4
|
+
tier: string;
|
|
5
|
+
reliability?: number;
|
|
6
|
+
consistency?: number;
|
|
7
|
+
}
|
|
2
8
|
export interface MuxoClientOptions {
|
|
3
9
|
baseUrl?: string;
|
|
4
10
|
apiKey?: string | (() => string | Promise<string>);
|
|
@@ -28,6 +34,50 @@ export declare class MuxoClient {
|
|
|
28
34
|
governanceDid: string;
|
|
29
35
|
supermemoryNamespace: string;
|
|
30
36
|
}>;
|
|
37
|
+
static register(params: {
|
|
38
|
+
email: string;
|
|
39
|
+
password: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
workspaceName?: string;
|
|
42
|
+
}, baseUrl?: string): Promise<{
|
|
43
|
+
ok: true;
|
|
44
|
+
user: Record<string, unknown>;
|
|
45
|
+
workspace: Workspace;
|
|
46
|
+
apiKey: string;
|
|
47
|
+
token: string;
|
|
48
|
+
}>;
|
|
49
|
+
static login(params: {
|
|
50
|
+
email: string;
|
|
51
|
+
password: string;
|
|
52
|
+
}, baseUrl?: string): Promise<{
|
|
53
|
+
ok: true;
|
|
54
|
+
user: Record<string, unknown>;
|
|
55
|
+
workspace: Workspace;
|
|
56
|
+
apiKey: string;
|
|
57
|
+
token: string;
|
|
58
|
+
}>;
|
|
59
|
+
register(params: {
|
|
60
|
+
email: string;
|
|
61
|
+
password: string;
|
|
62
|
+
name?: string;
|
|
63
|
+
workspaceName?: string;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
ok: true;
|
|
66
|
+
user: Record<string, unknown>;
|
|
67
|
+
workspace: Workspace;
|
|
68
|
+
apiKey: string;
|
|
69
|
+
token: string;
|
|
70
|
+
}>;
|
|
71
|
+
login(params: {
|
|
72
|
+
email: string;
|
|
73
|
+
password: string;
|
|
74
|
+
}): Promise<{
|
|
75
|
+
ok: true;
|
|
76
|
+
user: Record<string, unknown>;
|
|
77
|
+
workspace: Workspace;
|
|
78
|
+
apiKey: string;
|
|
79
|
+
token: string;
|
|
80
|
+
}>;
|
|
31
81
|
signupAgent(params: {
|
|
32
82
|
agentName?: string;
|
|
33
83
|
harness?: string;
|
|
@@ -65,6 +115,7 @@ export declare class MuxoClient {
|
|
|
65
115
|
toolSlug: string;
|
|
66
116
|
input: Record<string, unknown>;
|
|
67
117
|
reason?: string;
|
|
118
|
+
fundingMode?: "muxo_funded" | "byok";
|
|
68
119
|
}): Promise<{
|
|
69
120
|
ok: true;
|
|
70
121
|
plan: ActionPlan;
|
|
@@ -79,6 +130,10 @@ export declare class MuxoClient {
|
|
|
79
130
|
instructions: string;
|
|
80
131
|
};
|
|
81
132
|
}>;
|
|
133
|
+
getPlan(planId: string): Promise<{
|
|
134
|
+
ok: true;
|
|
135
|
+
plan: ActionPlan;
|
|
136
|
+
}>;
|
|
82
137
|
approvePlan(planId: string): Promise<{
|
|
83
138
|
ok: true;
|
|
84
139
|
plan: ActionPlan;
|
|
@@ -88,9 +143,19 @@ export declare class MuxoClient {
|
|
|
88
143
|
run: ExecutionRun;
|
|
89
144
|
receipt: ExecutionReceipt;
|
|
90
145
|
}>;
|
|
146
|
+
getRun(runId: string): Promise<{
|
|
147
|
+
ok: true;
|
|
148
|
+
run: ExecutionRun;
|
|
149
|
+
}>;
|
|
150
|
+
cancelRun(runId: string, reason?: string): Promise<{
|
|
151
|
+
ok: true;
|
|
152
|
+
run: ExecutionRun;
|
|
153
|
+
receipt: ExecutionReceipt;
|
|
154
|
+
}>;
|
|
91
155
|
exec(toolSlug: string, input?: Record<string, unknown>, options?: {
|
|
92
156
|
reason?: string;
|
|
93
157
|
approve?: boolean;
|
|
158
|
+
fundingMode?: "muxo_funded" | "byok";
|
|
94
159
|
}): Promise<{
|
|
95
160
|
ok: true;
|
|
96
161
|
plan: ActionPlan;
|
|
@@ -152,6 +217,11 @@ export declare class MuxoClient {
|
|
|
152
217
|
}>;
|
|
153
218
|
getBillingStatus(): Promise<{
|
|
154
219
|
ok: true;
|
|
220
|
+
workspace?: Workspace;
|
|
221
|
+
creditsBalance?: number;
|
|
222
|
+
creditBalance?: number;
|
|
223
|
+
tier?: string;
|
|
224
|
+
byokKeys?: ByokKeyRecord[];
|
|
155
225
|
settlementSummary: SupplierSettlementSummary & {
|
|
156
226
|
totalCustomerChargedCredits?: number;
|
|
157
227
|
};
|
|
@@ -173,11 +243,105 @@ export declare class MuxoClient {
|
|
|
173
243
|
ok: true;
|
|
174
244
|
namespace: string;
|
|
175
245
|
records: WorkspaceMemoryRecord[];
|
|
246
|
+
recentMemories?: WorkspaceMemoryRecord[];
|
|
247
|
+
memories?: WorkspaceMemoryRecord[];
|
|
248
|
+
}>;
|
|
249
|
+
addMemory(paramsOrContent: string | {
|
|
250
|
+
title?: string;
|
|
251
|
+
content: string;
|
|
252
|
+
kind?: WorkspaceMemoryRecord["kind"];
|
|
253
|
+
subject?: string;
|
|
254
|
+
predicate?: string;
|
|
255
|
+
object?: string;
|
|
256
|
+
confidence?: number;
|
|
257
|
+
metadata?: Record<string, unknown>;
|
|
258
|
+
}): Promise<{
|
|
259
|
+
ok: true;
|
|
260
|
+
memory: WorkspaceMemoryRecord;
|
|
261
|
+
temporalFacts?: Array<Record<string, unknown>>;
|
|
262
|
+
fundingSource?: string;
|
|
263
|
+
}>;
|
|
264
|
+
deleteMemory(id: string): Promise<{
|
|
265
|
+
ok: true;
|
|
266
|
+
deleted: boolean;
|
|
267
|
+
record: WorkspaceMemoryRecord | null;
|
|
268
|
+
}>;
|
|
269
|
+
getMemoryFacts(options?: boolean | {
|
|
270
|
+
includeHistorical?: boolean;
|
|
271
|
+
query?: string;
|
|
272
|
+
subject?: string;
|
|
273
|
+
predicate?: string;
|
|
274
|
+
limit?: number;
|
|
275
|
+
}): Promise<{
|
|
276
|
+
ok: true;
|
|
277
|
+
activeFacts: TemporalGraphFact[];
|
|
278
|
+
historicalFacts: TemporalGraphFact[];
|
|
279
|
+
facts: TemporalGraphFact[];
|
|
280
|
+
}>;
|
|
281
|
+
listTemporalFacts(options?: Parameters<MuxoClient["getMemoryFacts"]>[0]): Promise<{
|
|
282
|
+
ok: true;
|
|
283
|
+
activeFacts: TemporalGraphFact[];
|
|
284
|
+
historicalFacts: TemporalGraphFact[];
|
|
285
|
+
facts: TemporalGraphFact[];
|
|
286
|
+
}>;
|
|
287
|
+
forgetMemory(queryOrParams: string | {
|
|
288
|
+
query: string;
|
|
289
|
+
}): Promise<{
|
|
290
|
+
ok: true;
|
|
291
|
+
query: string;
|
|
292
|
+
deletedLocalCount: number;
|
|
293
|
+
invalidatedFactsCount: number;
|
|
294
|
+
deletedRemoteIds: string[];
|
|
295
|
+
deletedMemories: WorkspaceMemoryRecord[];
|
|
296
|
+
invalidatedFacts: TemporalGraphFact[];
|
|
297
|
+
}>;
|
|
298
|
+
getGovernanceStatus(): Promise<{
|
|
299
|
+
ok: true;
|
|
300
|
+
governance: Record<string, unknown> & {
|
|
301
|
+
modules?: unknown;
|
|
302
|
+
trustScore?: MuxoTrustScore;
|
|
303
|
+
killSwitch?: Record<string, unknown> | null;
|
|
304
|
+
auditChain?: Record<string, unknown>;
|
|
305
|
+
};
|
|
306
|
+
workspacePolicy: GovernancePolicy;
|
|
307
|
+
}>;
|
|
308
|
+
setKillSwitch(action: "quarantine" | "terminate" | "suspend" | "resume", reason?: string): Promise<{
|
|
309
|
+
ok: true;
|
|
310
|
+
activated?: boolean;
|
|
311
|
+
resumed?: boolean;
|
|
312
|
+
killSwitch?: Record<string, unknown>;
|
|
313
|
+
policy: GovernancePolicy;
|
|
314
|
+
trustScore: MuxoTrustScore;
|
|
315
|
+
}>;
|
|
316
|
+
scanContext(contentOrParams: string | {
|
|
317
|
+
content: string;
|
|
318
|
+
sessionId?: string;
|
|
319
|
+
role?: "user" | "assistant" | "tool" | "system";
|
|
320
|
+
}): Promise<{
|
|
321
|
+
ok: true;
|
|
322
|
+
scan: {
|
|
323
|
+
safe: boolean;
|
|
324
|
+
riskLevel: "none" | "low" | "medium" | "high" | "critical";
|
|
325
|
+
findingsCount: number;
|
|
326
|
+
findings: Array<{
|
|
327
|
+
patternId: string;
|
|
328
|
+
patternName: string;
|
|
329
|
+
severity: string;
|
|
330
|
+
description: string;
|
|
331
|
+
}>;
|
|
332
|
+
integrityValid: boolean;
|
|
333
|
+
};
|
|
334
|
+
}>;
|
|
335
|
+
updatePolicy(policy: Partial<Omit<GovernancePolicy, "killSwitchActive" | "killSwitchReason">>): Promise<{
|
|
336
|
+
ok: true;
|
|
337
|
+
workspace: Workspace;
|
|
176
338
|
}>;
|
|
177
339
|
do(prompt: string, options?: {
|
|
178
340
|
input?: Record<string, unknown>;
|
|
179
341
|
autoApprove?: boolean;
|
|
180
342
|
dryRun?: boolean;
|
|
343
|
+
planOnly?: boolean;
|
|
344
|
+
fundingMode?: "muxo_funded" | "byok";
|
|
181
345
|
}): Promise<{
|
|
182
346
|
ok: boolean;
|
|
183
347
|
executed: boolean;
|
|
@@ -199,6 +363,8 @@ export declare class MuxoClient {
|
|
|
199
363
|
input?: Record<string, unknown>;
|
|
200
364
|
autoApprove?: boolean;
|
|
201
365
|
dryRun?: boolean;
|
|
366
|
+
planOnly?: boolean;
|
|
367
|
+
fundingMode?: "muxo_funded" | "byok";
|
|
202
368
|
}): Promise<{
|
|
203
369
|
ok: boolean;
|
|
204
370
|
executed: boolean;
|