@elizaos/ui 2.0.0-alpha.526 → 2.0.0-alpha.528
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/apps/app-elizamaker/src/index.d.ts +2 -0
- package/apps/app-elizamaker/src/index.d.ts.map +1 -1
- package/apps/app-elizamaker/src/index.js +2 -0
- package/apps/app-elizamaker/src/init-registry-services.d.ts +18 -0
- package/apps/app-elizamaker/src/init-registry-services.d.ts.map +1 -0
- package/apps/app-elizamaker/src/init-registry-services.js +63 -0
- package/apps/app-elizamaker/src/plugin.d.ts.map +1 -1
- package/apps/app-elizamaker/src/plugin.js +7 -0
- package/apps/app-elizamaker/src/registry-service-registry.d.ts +4 -0
- package/apps/app-elizamaker/src/registry-service-registry.d.ts.map +1 -0
- package/apps/app-elizamaker/src/registry-service-registry.js +7 -0
- package/apps/app-lifeops/src/automation-node-contributor.d.ts +2 -0
- package/apps/app-lifeops/src/automation-node-contributor.d.ts.map +1 -0
- package/apps/app-lifeops/src/automation-node-contributor.js +93 -0
- package/apps/app-lifeops/src/public.d.ts.map +1 -1
- package/apps/app-lifeops/src/public.js +2 -0
- package/apps/app-training/src/services/training-service-registry.d.ts +4 -0
- package/apps/app-training/src/services/training-service-registry.d.ts.map +1 -0
- package/apps/app-training/src/services/training-service-registry.js +7 -0
- package/package.json +1 -1
- package/packages/agent/src/api/agent-status-routes.d.ts +3 -23
- package/packages/agent/src/api/agent-status-routes.d.ts.map +1 -1
- package/packages/agent/src/api/agent-status-routes.js +7 -40
- package/packages/agent/src/api/coordinator-wiring.d.ts.map +1 -0
- package/packages/agent/src/api/misc-routes.d.ts.map +1 -1
- package/packages/agent/src/api/misc-routes.js +3 -37
- package/packages/agent/src/api/nfa-routes.d.ts.map +1 -1
- package/packages/agent/src/api/nfa-routes.js +1 -9
- package/packages/agent/src/api/provider-switch-routes.d.ts +8 -7
- package/packages/agent/src/api/provider-switch-routes.d.ts.map +1 -1
- package/packages/agent/src/api/provider-switch-routes.js +41 -26
- package/packages/agent/src/api/server-types.d.ts +0 -6
- package/packages/agent/src/api/server-types.d.ts.map +1 -1
- package/packages/agent/src/api/server.d.ts.map +1 -1
- package/packages/agent/src/api/server.js +31 -138
- package/packages/agent/src/api/stream-routes.d.ts.map +1 -1
- package/packages/agent/src/api/stream-routes.js +6 -8
- package/packages/agent/src/api/wallet-trading-profile.d.ts.map +1 -1
- package/packages/agent/src/api/wallet-trading-profile.js +2 -23
- package/packages/agent/src/auth/account-storage.d.ts.map +1 -1
- package/packages/agent/src/auth/account-storage.js +4 -15
- package/packages/agent/src/runtime/eliza.d.ts.map +1 -1
- package/packages/agent/src/runtime/eliza.js +2 -6
- package/packages/agent/src/runtime/first-time-setup.d.ts.map +1 -1
- package/packages/agent/src/runtime/first-time-setup.js +1 -7
- package/packages/agent/src/runtime/operations/cold-strategy.d.ts +4 -4
- package/packages/agent/src/runtime/operations/cold-strategy.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/cold-strategy.js +13 -46
- package/packages/agent/src/runtime/operations/health-checks.d.ts +1 -0
- package/packages/agent/src/runtime/operations/health-checks.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/health-checks.js +1 -1
- package/packages/agent/src/runtime/operations/health.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/health.js +1 -13
- package/packages/agent/src/runtime/operations/index.d.ts +1 -0
- package/packages/agent/src/runtime/operations/index.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/index.js +1 -0
- package/packages/agent/src/runtime/operations/manager.d.ts +2 -0
- package/packages/agent/src/runtime/operations/manager.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/manager.js +27 -7
- package/packages/agent/src/runtime/operations/reload-hot.d.ts +4 -1
- package/packages/agent/src/runtime/operations/reload-hot.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/reload-hot.js +46 -41
- package/packages/agent/src/runtime/operations/repository.d.ts +30 -8
- package/packages/agent/src/runtime/operations/repository.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/repository.js +140 -54
- package/packages/agent/src/runtime/operations/types.d.ts +26 -24
- package/packages/agent/src/runtime/operations/types.d.ts.map +1 -1
- package/packages/agent/src/runtime/operations/types.js +8 -20
- package/packages/agent/src/runtime/operations/vault-bridge.d.ts +60 -0
- package/packages/agent/src/runtime/operations/vault-bridge.d.ts.map +1 -0
- package/packages/agent/src/runtime/operations/vault-bridge.js +80 -0
- package/packages/agent/src/runtime/plugin-resolver.d.ts.map +1 -1
- package/packages/agent/src/runtime/plugin-resolver.js +1 -3
- package/packages/agent/src/runtime/plugin-types.d.ts.map +1 -1
- package/packages/agent/src/runtime/plugin-types.js +1 -3
- package/packages/agent/src/services/app-package-modules.d.ts.map +1 -1
- package/packages/agent/src/services/app-package-modules.js +1 -8
- package/packages/agent/src/services/app-run-store.d.ts.map +1 -1
- package/packages/agent/src/services/app-run-store.js +2 -23
- package/packages/agent/src/services/registry-client-local.d.ts.map +1 -1
- package/packages/agent/src/services/registry-client-local.js +1 -9
- package/packages/agent/src/utils/atomic-json.d.ts +37 -0
- package/packages/agent/src/utils/atomic-json.d.ts.map +1 -0
- package/packages/agent/src/utils/atomic-json.js +98 -0
- package/packages/app-core/src/api/automation-node-contributors.d.ts +14 -0
- package/packages/app-core/src/api/automation-node-contributors.d.ts.map +1 -0
- package/packages/app-core/src/api/automation-node-contributors.js +14 -0
- package/packages/app-core/src/api/client-agent.d.ts +627 -0
- package/packages/app-core/src/api/client-agent.d.ts.map +1 -0
- package/packages/app-core/src/api/client-agent.js +1442 -0
- package/packages/app-core/src/api/client-automations.d.ts +8 -0
- package/packages/app-core/src/api/client-automations.d.ts.map +1 -0
- package/packages/app-core/src/api/client-automations.js +7 -0
- package/packages/app-core/src/api/client-base.d.ts +82 -0
- package/packages/app-core/src/api/client-base.d.ts.map +1 -0
- package/packages/app-core/src/api/client-base.js +729 -0
- package/packages/app-core/src/api/client-browser-workspace.d.ts +25 -0
- package/packages/app-core/src/api/client-browser-workspace.d.ts.map +1 -0
- package/packages/app-core/src/api/client-browser-workspace.js +98 -0
- package/packages/app-core/src/api/client-chat.d.ts +355 -0
- package/packages/app-core/src/api/client-chat.d.ts.map +1 -0
- package/packages/app-core/src/api/client-chat.js +582 -0
- package/packages/app-core/src/api/client-cloud.d.ts +286 -0
- package/packages/app-core/src/api/client-cloud.d.ts.map +1 -0
- package/packages/app-core/src/api/client-cloud.js +410 -0
- package/packages/app-core/src/api/client-computeruse.d.ts +32 -0
- package/packages/app-core/src/api/client-computeruse.d.ts.map +1 -0
- package/packages/app-core/src/api/client-computeruse.js +16 -0
- package/packages/app-core/src/api/client-imessage.d.ts +68 -0
- package/packages/app-core/src/api/client-imessage.d.ts.map +1 -0
- package/packages/app-core/src/api/client-imessage.js +74 -0
- package/packages/app-core/src/api/client-local-inference.d.ts +62 -0
- package/packages/app-core/src/api/client-local-inference.d.ts.map +1 -0
- package/packages/app-core/src/api/client-local-inference.js +87 -0
- package/packages/app-core/src/api/client-n8n.d.ts +27 -0
- package/packages/app-core/src/api/client-n8n.d.ts.map +1 -0
- package/packages/app-core/src/api/client-n8n.js +61 -0
- package/packages/app-core/src/api/client-skills.d.ts +475 -0
- package/packages/app-core/src/api/client-skills.d.ts.map +1 -0
- package/packages/app-core/src/api/client-skills.js +608 -0
- package/packages/app-core/src/api/client-types-babylon.d.ts +254 -0
- package/packages/app-core/src/api/client-types-babylon.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-babylon.js +2 -0
- package/packages/app-core/src/api/client-types-character.d.ts +39 -0
- package/packages/app-core/src/api/client-types-character.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-character.js +1 -0
- package/packages/app-core/src/api/client-types-chat.d.ts +428 -0
- package/packages/app-core/src/api/client-types-chat.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-chat.js +9 -0
- package/packages/app-core/src/api/client-types-config.d.ts +587 -0
- package/packages/app-core/src/api/client-types-config.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-config.js +5 -0
- package/packages/app-core/src/api/client-types-experience.d.ts +97 -0
- package/packages/app-core/src/api/client-types-experience.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-experience.js +1 -0
- package/packages/app-core/src/api/client-types-relationships.d.ts +181 -0
- package/packages/app-core/src/api/client-types-relationships.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-relationships.js +1 -0
- package/packages/app-core/src/api/client-types-steward.d.ts +85 -0
- package/packages/app-core/src/api/client-types-steward.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types-steward.js +9 -0
- package/packages/app-core/src/api/client-types.d.ts +9 -0
- package/packages/app-core/src/api/client-types.d.ts.map +1 -0
- package/packages/app-core/src/api/client-types.js +12 -0
- package/packages/app-core/src/api/client-wallet.d.ts +130 -0
- package/packages/app-core/src/api/client-wallet.d.ts.map +1 -0
- package/packages/app-core/src/api/client-wallet.js +228 -0
- package/packages/app-core/src/api/client.d.ts +36 -0
- package/packages/app-core/src/api/client.d.ts.map +1 -0
- package/packages/app-core/src/api/client.js +36 -0
- package/packages/app-core/src/api/index.d.ts +2 -0
- package/packages/app-core/src/api/index.d.ts.map +1 -0
- package/packages/app-core/src/api/index.js +1 -0
- package/packages/app-core/src/bridge/electrobun-rpc.d.ts +57 -0
- package/packages/app-core/src/bridge/electrobun-rpc.d.ts.map +1 -0
- package/packages/app-core/src/bridge/electrobun-rpc.js +87 -0
- package/packages/app-core/src/bridge/electrobun-runtime.d.ts +3 -0
- package/packages/app-core/src/bridge/electrobun-runtime.d.ts.map +1 -0
- package/packages/app-core/src/bridge/electrobun-runtime.js +34 -0
- package/packages/app-core/src/bridge/native-plugins.d.ts +504 -0
- package/packages/app-core/src/bridge/native-plugins.d.ts.map +1 -0
- package/packages/app-core/src/bridge/native-plugins.js +67 -0
- package/packages/app-core/src/chat/coding-agent-session-state.d.ts +16 -0
- package/packages/app-core/src/chat/coding-agent-session-state.d.ts.map +1 -0
- package/packages/app-core/src/chat/coding-agent-session-state.js +27 -0
- package/packages/app-core/src/components/pages/browser-workspace-wallet.d.ts +80 -0
- package/packages/app-core/src/components/pages/browser-workspace-wallet.d.ts.map +1 -0
- package/packages/app-core/src/components/pages/browser-workspace-wallet.js +135 -0
- package/packages/app-core/src/services/account-pool.d.ts +98 -0
- package/packages/app-core/src/services/account-pool.d.ts.map +1 -0
- package/packages/app-core/src/services/account-pool.js +506 -0
- package/packages/app-core/src/services/account-usage.d.ts +75 -0
- package/packages/app-core/src/services/account-usage.d.ts.map +1 -0
- package/packages/app-core/src/services/account-usage.js +179 -0
- package/packages/app-core/src/services/local-inference/active-model.d.ts +59 -0
- package/packages/app-core/src/services/local-inference/active-model.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/active-model.js +120 -0
- package/packages/app-core/src/services/local-inference/device-bridge.d.ts +131 -0
- package/packages/app-core/src/services/local-inference/device-bridge.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/device-bridge.js +748 -0
- package/packages/app-core/src/services/local-inference/engine.d.ts +52 -0
- package/packages/app-core/src/services/local-inference/engine.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/engine.js +138 -0
- package/packages/app-core/src/services/local-inference/external-scanner.d.ts +17 -0
- package/packages/app-core/src/services/local-inference/external-scanner.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/external-scanner.js +261 -0
- package/packages/app-core/src/services/local-inference/handler-registry.d.ts +72 -0
- package/packages/app-core/src/services/local-inference/handler-registry.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/handler-registry.js +160 -0
- package/packages/app-core/src/services/local-inference/paths.d.ts +24 -0
- package/packages/app-core/src/services/local-inference/paths.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/paths.js +41 -0
- package/packages/app-core/src/services/local-inference/providers.d.ts +61 -0
- package/packages/app-core/src/services/local-inference/providers.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/providers.js +277 -0
- package/packages/app-core/src/services/local-inference/registry.d.ts +35 -0
- package/packages/app-core/src/services/local-inference/registry.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/registry.js +108 -0
- package/packages/app-core/src/services/local-inference/routing-preferences.d.ts +31 -0
- package/packages/app-core/src/services/local-inference/routing-preferences.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/routing-preferences.js +72 -0
- package/packages/app-core/src/services/local-inference/types.d.ts +121 -0
- package/packages/app-core/src/services/local-inference/types.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/types.js +14 -0
- package/packages/app-core/src/services/local-inference/verify.d.ts +39 -0
- package/packages/app-core/src/services/local-inference/verify.d.ts.map +1 -0
- package/packages/app-core/src/services/local-inference/verify.js +104 -0
- package/packages/app-core/src/types/index.d.ts +658 -0
- package/packages/app-core/src/types/index.d.ts.map +1 -0
- package/packages/app-core/src/types/index.js +4 -0
- package/packages/app-core/src/utils/assistant-text.d.ts +2 -0
- package/packages/app-core/src/utils/assistant-text.d.ts.map +1 -0
- package/packages/app-core/src/utils/assistant-text.js +167 -0
- package/packages/app-core/src/utils/eliza-globals.d.ts +15 -0
- package/packages/app-core/src/utils/eliza-globals.d.ts.map +1 -0
- package/packages/app-core/src/utils/eliza-globals.js +50 -0
- package/packages/app-core/src/utils/streaming-text.d.ts +9 -0
- package/packages/app-core/src/utils/streaming-text.d.ts.map +1 -0
- package/packages/app-core/src/utils/streaming-text.js +112 -0
- package/packages/shared/src/format-error.d.ts +14 -0
- package/packages/shared/src/format-error.d.ts.map +1 -0
- package/packages/shared/src/format-error.js +17 -0
- package/packages/shared/src/index.d.ts +1 -0
- package/packages/shared/src/index.d.ts.map +1 -1
- package/packages/shared/src/index.js +1 -0
- package/packages/typescript/src/runtime.d.ts +14 -0
- package/packages/typescript/src/runtime.d.ts.map +1 -1
- package/packages/typescript/src/runtime.js +42 -0
- package/packages/typescript/src/services/message.d.ts +8 -0
- package/packages/typescript/src/services/message.d.ts.map +1 -1
- package/packages/typescript/src/services/message.js +51 -0
- package/packages/typescript/src/services/task.d.ts +1 -0
- package/packages/typescript/src/services/task.d.ts.map +1 -1
- package/packages/typescript/src/services/task.js +26 -3
- package/apps/app-task-coordinator/src/api/coordinator-wiring.d.ts.map +0 -1
- /package/{apps/app-task-coordinator → packages/agent}/src/api/coordinator-wiring.d.ts +0 -0
- /package/{apps/app-task-coordinator → packages/agent}/src/api/coordinator-wiring.js +0 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud domain methods — cloud billing, compat agents, sandbox,
|
|
3
|
+
* export/import, direct cloud auth, bug reports.
|
|
4
|
+
*/
|
|
5
|
+
import { ElizaClient } from "./client-base";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Module-level constants
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
const AGENT_TRANSFER_MIN_PASSWORD_LENGTH = 4;
|
|
10
|
+
function isCloudRouteNotFound(error) {
|
|
11
|
+
return (error instanceof Error &&
|
|
12
|
+
"status" in error &&
|
|
13
|
+
error.status === 404);
|
|
14
|
+
}
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Prototype augmentation
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
ElizaClient.prototype.getCloudStatus = async function () {
|
|
19
|
+
return this.fetch("/api/cloud/status");
|
|
20
|
+
};
|
|
21
|
+
ElizaClient.prototype.getCloudCredits = async function () {
|
|
22
|
+
return this.fetch("/api/cloud/credits");
|
|
23
|
+
};
|
|
24
|
+
ElizaClient.prototype.getCloudBillingSummary = async function () {
|
|
25
|
+
return this.fetch("/api/cloud/billing/summary");
|
|
26
|
+
};
|
|
27
|
+
ElizaClient.prototype.getCloudBillingSettings = async function () {
|
|
28
|
+
return this.fetch("/api/cloud/billing/settings");
|
|
29
|
+
};
|
|
30
|
+
ElizaClient.prototype.updateCloudBillingSettings = async function (request) {
|
|
31
|
+
return this.fetch("/api/cloud/billing/settings", {
|
|
32
|
+
method: "PUT",
|
|
33
|
+
body: JSON.stringify(request),
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
ElizaClient.prototype.getCloudBillingPaymentMethods = async function () {
|
|
37
|
+
return this.fetch("/api/cloud/billing/payment-methods");
|
|
38
|
+
};
|
|
39
|
+
ElizaClient.prototype.getCloudBillingHistory = async function () {
|
|
40
|
+
return this.fetch("/api/cloud/billing/history");
|
|
41
|
+
};
|
|
42
|
+
ElizaClient.prototype.createCloudBillingCheckout = async function (request) {
|
|
43
|
+
return this.fetch("/api/cloud/billing/checkout", {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body: JSON.stringify(request),
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
ElizaClient.prototype.createCloudBillingCryptoQuote = async function (request) {
|
|
49
|
+
return this.fetch("/api/cloud/billing/crypto/quote", {
|
|
50
|
+
method: "POST",
|
|
51
|
+
body: JSON.stringify(request),
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
ElizaClient.prototype.cloudLogin = async function () {
|
|
55
|
+
return this.fetch("/api/cloud/login", { method: "POST" });
|
|
56
|
+
};
|
|
57
|
+
ElizaClient.prototype.cloudLoginPoll = async function (sessionId) {
|
|
58
|
+
return this.fetch(`/api/cloud/login/status?sessionId=${encodeURIComponent(sessionId)}`);
|
|
59
|
+
};
|
|
60
|
+
ElizaClient.prototype.cloudLoginPersist = async function (apiKey, identity) {
|
|
61
|
+
return this.fetch("/api/cloud/login/persist", {
|
|
62
|
+
method: "POST",
|
|
63
|
+
body: JSON.stringify({
|
|
64
|
+
apiKey,
|
|
65
|
+
...(identity?.organizationId
|
|
66
|
+
? { organizationId: identity.organizationId }
|
|
67
|
+
: {}),
|
|
68
|
+
...(identity?.userId ? { userId: identity.userId } : {}),
|
|
69
|
+
}),
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
ElizaClient.prototype.cloudDisconnect = async function () {
|
|
73
|
+
return this.fetch("/api/cloud/disconnect", { method: "POST" });
|
|
74
|
+
};
|
|
75
|
+
ElizaClient.prototype.getCloudCompatAgents = async function () {
|
|
76
|
+
return this.fetch("/api/cloud/compat/agents");
|
|
77
|
+
};
|
|
78
|
+
ElizaClient.prototype.createCloudCompatAgent = async function (opts) {
|
|
79
|
+
return this.fetch("/api/cloud/compat/agents", {
|
|
80
|
+
method: "POST",
|
|
81
|
+
body: JSON.stringify(opts),
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
ElizaClient.prototype.ensureCloudCompatManagedDiscordAgent = async function () {
|
|
85
|
+
return this.fetch("/api/cloud/v1/app/discord/gateway-agent", {
|
|
86
|
+
method: "POST",
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
ElizaClient.prototype.provisionCloudCompatAgent = async function (agentId) {
|
|
90
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/provision`, { method: "POST" }, { allowNonOk: true });
|
|
91
|
+
};
|
|
92
|
+
ElizaClient.prototype.getCloudCompatAgent = async function (agentId) {
|
|
93
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}`);
|
|
94
|
+
};
|
|
95
|
+
ElizaClient.prototype.getCloudCompatAgentManagedDiscord = async function (agentId) {
|
|
96
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/discord`);
|
|
97
|
+
};
|
|
98
|
+
ElizaClient.prototype.createCloudCompatAgentManagedDiscordOauth =
|
|
99
|
+
async function (agentId, request = {}) {
|
|
100
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/discord/oauth`, {
|
|
101
|
+
method: "POST",
|
|
102
|
+
body: JSON.stringify(request),
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
ElizaClient.prototype.disconnectCloudCompatAgentManagedDiscord =
|
|
106
|
+
async function (agentId) {
|
|
107
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/discord`, {
|
|
108
|
+
method: "DELETE",
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
ElizaClient.prototype.getCloudCompatAgentDiscordConfig = async function (agentId) {
|
|
112
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/discord/config`);
|
|
113
|
+
};
|
|
114
|
+
ElizaClient.prototype.updateCloudCompatAgentDiscordConfig = async function (agentId, config) {
|
|
115
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/discord/config`, {
|
|
116
|
+
method: "PATCH",
|
|
117
|
+
body: JSON.stringify(config),
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
ElizaClient.prototype.getCloudCompatAgentManagedGithub = async function (agentId) {
|
|
121
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/github`);
|
|
122
|
+
};
|
|
123
|
+
ElizaClient.prototype.createCloudCompatAgentManagedGithubOauth =
|
|
124
|
+
async function (agentId, request = {}) {
|
|
125
|
+
try {
|
|
126
|
+
return await this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/github/oauth`, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
body: JSON.stringify(request),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
if (!isCloudRouteNotFound(error)) {
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
const params = new URLSearchParams({
|
|
136
|
+
target: "agent",
|
|
137
|
+
agent_id: agentId,
|
|
138
|
+
});
|
|
139
|
+
if (request.postMessage) {
|
|
140
|
+
params.set("post_message", "1");
|
|
141
|
+
}
|
|
142
|
+
if (request.returnUrl) {
|
|
143
|
+
params.set("return_url", request.returnUrl);
|
|
144
|
+
}
|
|
145
|
+
const fallback = await this.initiateCloudOauth("github", {
|
|
146
|
+
redirectUrl: `/api/v1/milady/lifeops/github-complete?${params.toString()}`,
|
|
147
|
+
connectionRole: "agent",
|
|
148
|
+
scopes: request.scopes,
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
success: true,
|
|
152
|
+
data: {
|
|
153
|
+
authorizeUrl: fallback.authUrl,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
ElizaClient.prototype.linkCloudCompatAgentManagedGithub = async function (agentId, connectionId) {
|
|
159
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/github/link`, {
|
|
160
|
+
method: "POST",
|
|
161
|
+
body: JSON.stringify({ connectionId }),
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
ElizaClient.prototype.disconnectCloudCompatAgentManagedGithub = async function (agentId) {
|
|
165
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/github`, {
|
|
166
|
+
method: "DELETE",
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
ElizaClient.prototype.listCloudOauthConnections = async function (args) {
|
|
170
|
+
const params = new URLSearchParams();
|
|
171
|
+
if (args?.platform) {
|
|
172
|
+
params.set("platform", args.platform);
|
|
173
|
+
}
|
|
174
|
+
if (args?.connectionRole) {
|
|
175
|
+
params.set("connectionRole", args.connectionRole);
|
|
176
|
+
}
|
|
177
|
+
const query = params.toString();
|
|
178
|
+
return this.fetch(`/api/cloud/v1/oauth/connections${query ? `?${query}` : ""}`);
|
|
179
|
+
};
|
|
180
|
+
ElizaClient.prototype.initiateCloudOauth = async function (platform, request) {
|
|
181
|
+
try {
|
|
182
|
+
return await this.fetch(`/api/cloud/v1/oauth/${encodeURIComponent(platform)}/initiate`, {
|
|
183
|
+
method: "POST",
|
|
184
|
+
body: JSON.stringify(request ?? {}),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
if (!isCloudRouteNotFound(error)) {
|
|
189
|
+
throw error;
|
|
190
|
+
}
|
|
191
|
+
return this.fetch(`/api/cloud/v1/oauth/initiate?provider=${encodeURIComponent(platform)}`, {
|
|
192
|
+
method: "POST",
|
|
193
|
+
body: JSON.stringify(request ?? {}),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
ElizaClient.prototype.disconnectCloudOauthConnection = async function (connectionId) {
|
|
198
|
+
return this.fetch(`/api/cloud/v1/oauth/connections/${encodeURIComponent(connectionId)}`, {
|
|
199
|
+
method: "DELETE",
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
ElizaClient.prototype.getCloudCompatAgentGithubToken = async function (agentId) {
|
|
203
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/github/token`);
|
|
204
|
+
};
|
|
205
|
+
ElizaClient.prototype.deleteCloudCompatAgent = async function (agentId) {
|
|
206
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}`, {
|
|
207
|
+
method: "DELETE",
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
ElizaClient.prototype.getCloudCompatAgentStatus = async function (agentId) {
|
|
211
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/status`);
|
|
212
|
+
};
|
|
213
|
+
ElizaClient.prototype.getCloudCompatAgentLogs = async function (agentId, tail = 100) {
|
|
214
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/logs?tail=${tail}`);
|
|
215
|
+
};
|
|
216
|
+
ElizaClient.prototype.restartCloudCompatAgent = async function (agentId) {
|
|
217
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/restart`, { method: "POST" });
|
|
218
|
+
};
|
|
219
|
+
ElizaClient.prototype.suspendCloudCompatAgent = async function (agentId) {
|
|
220
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/suspend`, { method: "POST" });
|
|
221
|
+
};
|
|
222
|
+
ElizaClient.prototype.resumeCloudCompatAgent = async function (agentId) {
|
|
223
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/resume`, { method: "POST" });
|
|
224
|
+
};
|
|
225
|
+
ElizaClient.prototype.launchCloudCompatAgent = async function (agentId) {
|
|
226
|
+
return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/launch`, { method: "POST" });
|
|
227
|
+
};
|
|
228
|
+
ElizaClient.prototype.getCloudCompatPairingToken = async function (agentId) {
|
|
229
|
+
return this.fetch(`/api/cloud/v1/app/agents/${encodeURIComponent(agentId)}/pairing-token`, { method: "POST" });
|
|
230
|
+
};
|
|
231
|
+
ElizaClient.prototype.getCloudCompatAvailability = async function () {
|
|
232
|
+
return this.fetch("/api/cloud/compat/availability");
|
|
233
|
+
};
|
|
234
|
+
ElizaClient.prototype.getCloudCompatJobStatus = async function (jobId) {
|
|
235
|
+
return this.fetch(`/api/cloud/compat/jobs/${encodeURIComponent(jobId)}`);
|
|
236
|
+
};
|
|
237
|
+
ElizaClient.prototype.exportAgent = async function (password, includeLogs = false) {
|
|
238
|
+
if (password.length < AGENT_TRANSFER_MIN_PASSWORD_LENGTH) {
|
|
239
|
+
throw new Error(`Password must be at least ${AGENT_TRANSFER_MIN_PASSWORD_LENGTH} characters.`);
|
|
240
|
+
}
|
|
241
|
+
return this.rawRequest("/api/agent/export", {
|
|
242
|
+
method: "POST",
|
|
243
|
+
headers: {
|
|
244
|
+
"Content-Type": "application/json",
|
|
245
|
+
},
|
|
246
|
+
body: JSON.stringify({ password, includeLogs }),
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
ElizaClient.prototype.getExportEstimate = async function () {
|
|
250
|
+
return this.fetch("/api/agent/export/estimate");
|
|
251
|
+
};
|
|
252
|
+
ElizaClient.prototype.importAgent = async function (password, fileBuffer) {
|
|
253
|
+
if (password.length < AGENT_TRANSFER_MIN_PASSWORD_LENGTH) {
|
|
254
|
+
throw new Error(`Password must be at least ${AGENT_TRANSFER_MIN_PASSWORD_LENGTH} characters.`);
|
|
255
|
+
}
|
|
256
|
+
const passwordBytes = new TextEncoder().encode(password);
|
|
257
|
+
const envelope = new Uint8Array(4 + passwordBytes.length + fileBuffer.byteLength);
|
|
258
|
+
const view = new DataView(envelope.buffer);
|
|
259
|
+
view.setUint32(0, passwordBytes.length, false);
|
|
260
|
+
envelope.set(passwordBytes, 4);
|
|
261
|
+
envelope.set(new Uint8Array(fileBuffer), 4 + passwordBytes.length);
|
|
262
|
+
const res = await this.rawRequest("/api/agent/import", {
|
|
263
|
+
method: "POST",
|
|
264
|
+
headers: {
|
|
265
|
+
"Content-Type": "application/octet-stream",
|
|
266
|
+
},
|
|
267
|
+
body: envelope,
|
|
268
|
+
});
|
|
269
|
+
const data = (await res.json());
|
|
270
|
+
if (!data.success) {
|
|
271
|
+
throw new Error(data.error ?? `Import failed (${res.status})`);
|
|
272
|
+
}
|
|
273
|
+
return data;
|
|
274
|
+
};
|
|
275
|
+
ElizaClient.prototype.getSandboxPlatform = async function () {
|
|
276
|
+
return this.fetch("/api/sandbox/platform");
|
|
277
|
+
};
|
|
278
|
+
ElizaClient.prototype.getSandboxBrowser = async function () {
|
|
279
|
+
return this.fetch("/api/sandbox/browser");
|
|
280
|
+
};
|
|
281
|
+
ElizaClient.prototype.getSandboxScreenshot = async function (region) {
|
|
282
|
+
if (!region) {
|
|
283
|
+
return this.fetch("/api/sandbox/screen/screenshot", {
|
|
284
|
+
method: "POST",
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return this.fetch("/api/sandbox/screen/screenshot", {
|
|
288
|
+
method: "POST",
|
|
289
|
+
headers: { "Content-Type": "application/json" },
|
|
290
|
+
body: JSON.stringify(region),
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
ElizaClient.prototype.getSandboxWindows = async function () {
|
|
294
|
+
return this.fetch("/api/sandbox/screen/windows");
|
|
295
|
+
};
|
|
296
|
+
ElizaClient.prototype.startDocker = async function () {
|
|
297
|
+
return this.fetch("/api/sandbox/docker/start", { method: "POST" });
|
|
298
|
+
};
|
|
299
|
+
ElizaClient.prototype.cloudLoginDirect = async function (cloudApiBase) {
|
|
300
|
+
const sessionId = globalThis.crypto.randomUUID();
|
|
301
|
+
try {
|
|
302
|
+
const res = await fetch(`${cloudApiBase}/api/auth/cli-session`, {
|
|
303
|
+
method: "POST",
|
|
304
|
+
headers: { "Content-Type": "application/json" },
|
|
305
|
+
body: JSON.stringify({ sessionId }),
|
|
306
|
+
});
|
|
307
|
+
if (!res.ok) {
|
|
308
|
+
return { ok: false, error: `Login failed (${res.status})` };
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
ok: true,
|
|
312
|
+
sessionId,
|
|
313
|
+
browserUrl: `${cloudApiBase}/auth/cli-login?session=${encodeURIComponent(sessionId)}`,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
return {
|
|
318
|
+
ok: false,
|
|
319
|
+
error: `Failed to reach Eliza Cloud: ${err instanceof Error ? err.message : String(err)}`,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
ElizaClient.prototype.cloudLoginPollDirect = async function (cloudApiBase, sessionId) {
|
|
324
|
+
try {
|
|
325
|
+
const res = await fetch(`${cloudApiBase}/api/auth/cli-session/${encodeURIComponent(sessionId)}`);
|
|
326
|
+
if (!res.ok) {
|
|
327
|
+
if (res.status === 404) {
|
|
328
|
+
return {
|
|
329
|
+
status: "expired",
|
|
330
|
+
error: "Auth session expired or not found",
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
status: "error",
|
|
335
|
+
error: `Poll failed (${res.status})`,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const data = await res.json();
|
|
339
|
+
if (data.status === "authenticated" && data.apiKey) {
|
|
340
|
+
return {
|
|
341
|
+
status: "authenticated",
|
|
342
|
+
organizationId: data.organizationId,
|
|
343
|
+
token: data.apiKey,
|
|
344
|
+
userId: data.userId,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
return { status: data.status ?? "pending" };
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
return { status: "error", error: "Poll request failed" };
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
ElizaClient.prototype.provisionCloudSandbox = async function (options) {
|
|
354
|
+
const { cloudApiBase, authToken, name, bio, onProgress } = options;
|
|
355
|
+
const headers = {
|
|
356
|
+
"Content-Type": "application/json",
|
|
357
|
+
Authorization: `Bearer ${authToken}`,
|
|
358
|
+
};
|
|
359
|
+
onProgress?.("creating", "Creating agent...");
|
|
360
|
+
// Step 1: Create agent
|
|
361
|
+
const createRes = await fetch(`${cloudApiBase}/api/v1/app/agents`, {
|
|
362
|
+
method: "POST",
|
|
363
|
+
headers,
|
|
364
|
+
body: JSON.stringify({ name, bio }),
|
|
365
|
+
});
|
|
366
|
+
if (!createRes.ok) {
|
|
367
|
+
const err = await createRes.text().catch(() => "Unknown error");
|
|
368
|
+
throw new Error(`Failed to create cloud agent: ${err}`);
|
|
369
|
+
}
|
|
370
|
+
const createData = (await createRes.json());
|
|
371
|
+
const agentId = createData.id;
|
|
372
|
+
onProgress?.("provisioning", "Provisioning sandbox environment...");
|
|
373
|
+
// Step 2: Start provisioning
|
|
374
|
+
const provisionRes = await fetch(`${cloudApiBase}/api/v1/app/agents/${agentId}/provision`, { method: "POST", headers });
|
|
375
|
+
if (!provisionRes.ok) {
|
|
376
|
+
const err = await provisionRes.text().catch(() => "Unknown error");
|
|
377
|
+
throw new Error(`Failed to start provisioning: ${err}`);
|
|
378
|
+
}
|
|
379
|
+
const provisionData = (await provisionRes.json());
|
|
380
|
+
const jobId = provisionData.jobId;
|
|
381
|
+
// Step 3: Poll job status
|
|
382
|
+
const deadline = Date.now() + 120_000;
|
|
383
|
+
while (Date.now() < deadline) {
|
|
384
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
385
|
+
const jobRes = await fetch(`${cloudApiBase}/api/v1/jobs/${jobId}`, {
|
|
386
|
+
headers,
|
|
387
|
+
});
|
|
388
|
+
if (!jobRes.ok)
|
|
389
|
+
continue;
|
|
390
|
+
const jobData = (await jobRes.json());
|
|
391
|
+
if (jobData.status === "completed" && jobData.result?.bridgeUrl) {
|
|
392
|
+
onProgress?.("ready", "Sandbox ready!");
|
|
393
|
+
return { bridgeUrl: jobData.result.bridgeUrl, agentId };
|
|
394
|
+
}
|
|
395
|
+
if (jobData.status === "failed") {
|
|
396
|
+
throw new Error(`Provisioning failed: ${jobData.error ?? "Unknown error"}`);
|
|
397
|
+
}
|
|
398
|
+
onProgress?.("provisioning", `Status: ${jobData.status}...`);
|
|
399
|
+
}
|
|
400
|
+
throw new Error("Provisioning timed out after 2 minutes");
|
|
401
|
+
};
|
|
402
|
+
ElizaClient.prototype.checkBugReportInfo = async function () {
|
|
403
|
+
return this.fetch("/api/bug-report/info");
|
|
404
|
+
};
|
|
405
|
+
ElizaClient.prototype.submitBugReport = async function (report) {
|
|
406
|
+
return this.fetch("/api/bug-report", {
|
|
407
|
+
method: "POST",
|
|
408
|
+
body: JSON.stringify(report),
|
|
409
|
+
});
|
|
410
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type ComputerUseApprovalMode = "full_control" | "smart_approve" | "approve_all" | "off";
|
|
2
|
+
export interface ComputerUsePendingApproval {
|
|
3
|
+
id: string;
|
|
4
|
+
command: string;
|
|
5
|
+
parameters: Record<string, unknown>;
|
|
6
|
+
requestedAt: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ComputerUseApprovalSnapshot {
|
|
9
|
+
mode: ComputerUseApprovalMode;
|
|
10
|
+
pendingCount: number;
|
|
11
|
+
pendingApprovals: ComputerUsePendingApproval[];
|
|
12
|
+
}
|
|
13
|
+
export interface ComputerUseApprovalResolution {
|
|
14
|
+
id: string;
|
|
15
|
+
command: string;
|
|
16
|
+
approved: boolean;
|
|
17
|
+
cancelled: boolean;
|
|
18
|
+
mode: ComputerUseApprovalMode;
|
|
19
|
+
requestedAt: string;
|
|
20
|
+
resolvedAt: string;
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
declare module "./client-base" {
|
|
24
|
+
interface ElizaClient {
|
|
25
|
+
getComputerUseApprovals(): Promise<ComputerUseApprovalSnapshot>;
|
|
26
|
+
respondToComputerUseApproval(id: string, approved: boolean, reason?: string): Promise<ComputerUseApprovalResolution>;
|
|
27
|
+
setComputerUseApprovalMode(mode: ComputerUseApprovalMode): Promise<{
|
|
28
|
+
mode: ComputerUseApprovalMode;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=client-computeruse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-computeruse.d.ts","sourceRoot":"","sources":["../../../../../../app-core/src/api/client-computeruse.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAC/B,cAAc,GACd,eAAe,GACf,aAAa,GACb,KAAK,CAAC;AAEV,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,uBAAuB,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,0BAA0B,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,WAAW;QACnB,uBAAuB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAAC;QAChE,4BAA4B,CAC1B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,6BAA6B,CAAC,CAAC;QAC1C,0BAA0B,CACxB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC;YAAE,IAAI,EAAE,uBAAuB,CAAA;SAAE,CAAC,CAAC;KAC/C;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ElizaClient } from "./client-base";
|
|
2
|
+
ElizaClient.prototype.getComputerUseApprovals = async function () {
|
|
3
|
+
return this.fetch("/api/computer-use/approvals");
|
|
4
|
+
};
|
|
5
|
+
ElizaClient.prototype.respondToComputerUseApproval = async function (id, approved, reason) {
|
|
6
|
+
return this.fetch(`/api/computer-use/approvals/${encodeURIComponent(id)}`, {
|
|
7
|
+
method: "POST",
|
|
8
|
+
body: JSON.stringify({ approved, reason }),
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
ElizaClient.prototype.setComputerUseApprovalMode = async function (mode) {
|
|
12
|
+
return this.fetch("/api/computer-use/approval-mode", {
|
|
13
|
+
method: "POST",
|
|
14
|
+
body: JSON.stringify({ mode }),
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export interface IMessageApiStatus {
|
|
2
|
+
available: boolean;
|
|
3
|
+
connected: boolean;
|
|
4
|
+
bridgeType?: "native" | "imsg" | "bluebubbles" | "none";
|
|
5
|
+
hostPlatform?: "darwin" | "linux" | "win32" | "unknown";
|
|
6
|
+
diagnostics?: string[];
|
|
7
|
+
error?: string | null;
|
|
8
|
+
chatDbAvailable?: boolean;
|
|
9
|
+
sendOnly?: boolean;
|
|
10
|
+
chatDbPath?: string;
|
|
11
|
+
reason?: string | null;
|
|
12
|
+
permissionAction?: {
|
|
13
|
+
type: "full_disk_access";
|
|
14
|
+
label: string;
|
|
15
|
+
url: string;
|
|
16
|
+
instructions: string[];
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
export interface IMessageApiMessage {
|
|
20
|
+
id: string;
|
|
21
|
+
text: string;
|
|
22
|
+
handle: string;
|
|
23
|
+
chatId: string;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
isFromMe: boolean;
|
|
26
|
+
hasAttachments: boolean;
|
|
27
|
+
attachmentPaths?: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface IMessageApiChat {
|
|
30
|
+
chatId: string;
|
|
31
|
+
chatType: "direct" | "group";
|
|
32
|
+
displayName?: string;
|
|
33
|
+
participants: Array<{
|
|
34
|
+
handle: string;
|
|
35
|
+
isPhoneNumber: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export interface GetIMessageMessagesOptions {
|
|
39
|
+
chatId?: string;
|
|
40
|
+
limit?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface SendIMessageRequest {
|
|
43
|
+
to: string;
|
|
44
|
+
text: string;
|
|
45
|
+
attachmentPaths?: string[];
|
|
46
|
+
mediaUrl?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SendIMessageResponse {
|
|
49
|
+
success: boolean;
|
|
50
|
+
messageId?: string;
|
|
51
|
+
chatId?: string;
|
|
52
|
+
error?: string;
|
|
53
|
+
}
|
|
54
|
+
declare module "./client-base" {
|
|
55
|
+
interface ElizaClient {
|
|
56
|
+
getIMessageStatus(): Promise<IMessageApiStatus>;
|
|
57
|
+
getIMessageMessages(options?: GetIMessageMessagesOptions): Promise<{
|
|
58
|
+
messages: IMessageApiMessage[];
|
|
59
|
+
count: number;
|
|
60
|
+
}>;
|
|
61
|
+
listIMessageChats(): Promise<{
|
|
62
|
+
chats: IMessageApiChat[];
|
|
63
|
+
count: number;
|
|
64
|
+
}>;
|
|
65
|
+
sendIMessage(request: SendIMessageRequest): Promise<SendIMessageResponse>;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=client-imessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-imessage.d.ts","sourceRoot":"","sources":["../../../../../../app-core/src/api/client-imessage.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,MAAM,CAAC;IACxD,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gBAAgB,CAAC,EAAE;QACjB,IAAI,EAAE,kBAAkB,CAAC;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,MAAM,EAAE,CAAC;KACxB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8BD,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,WAAW;QACnB,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAChD,mBAAmB,CACjB,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC;YAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC9D,iBAAiB,IAAI,OAAO,CAAC;YAAE,KAAK,EAAE,eAAe,EAAE,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC1E,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;KAC3E;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ElizaClient } from "./client-base";
|
|
2
|
+
function buildQuery(params) {
|
|
3
|
+
const query = params.toString();
|
|
4
|
+
return query.length > 0 ? `?${query}` : "";
|
|
5
|
+
}
|
|
6
|
+
ElizaClient.prototype.getIMessageStatus = async function () {
|
|
7
|
+
return this.fetch("/api/lifeops/connectors/imessage/status");
|
|
8
|
+
};
|
|
9
|
+
function normalizeLifeOpsMessage(message) {
|
|
10
|
+
const attachmentPaths = message.attachments
|
|
11
|
+
?.map((attachment) => attachment.path)
|
|
12
|
+
.filter((path) => typeof path === "string") ?? [];
|
|
13
|
+
return {
|
|
14
|
+
id: message.id,
|
|
15
|
+
text: message.text,
|
|
16
|
+
handle: message.isFromMe
|
|
17
|
+
? (message.toHandles[0] ?? "")
|
|
18
|
+
: message.fromHandle,
|
|
19
|
+
chatId: message.chatId ?? "",
|
|
20
|
+
timestamp: Date.parse(message.sentAt) || 0,
|
|
21
|
+
isFromMe: message.isFromMe,
|
|
22
|
+
hasAttachments: attachmentPaths.length > 0,
|
|
23
|
+
...(attachmentPaths.length > 0 ? { attachmentPaths } : {}),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function normalizeLifeOpsChat(chat) {
|
|
27
|
+
return {
|
|
28
|
+
chatId: chat.id,
|
|
29
|
+
chatType: chat.participants.length > 1 ? "group" : "direct",
|
|
30
|
+
displayName: chat.name,
|
|
31
|
+
participants: chat.participants.map((handle) => ({
|
|
32
|
+
handle,
|
|
33
|
+
isPhoneNumber: /^\+?[0-9()\s.-]+$/.test(handle),
|
|
34
|
+
})),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
ElizaClient.prototype.getIMessageMessages = async function (options = {}) {
|
|
38
|
+
const params = new URLSearchParams();
|
|
39
|
+
if (options.chatId?.trim()) {
|
|
40
|
+
params.set("chatId", options.chatId.trim());
|
|
41
|
+
}
|
|
42
|
+
if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
|
|
43
|
+
params.set("limit", String(options.limit));
|
|
44
|
+
}
|
|
45
|
+
const result = await this.fetch(`/api/lifeops/connectors/imessage/messages${buildQuery(params)}`);
|
|
46
|
+
return {
|
|
47
|
+
messages: result.messages.map(normalizeLifeOpsMessage),
|
|
48
|
+
count: result.count,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
ElizaClient.prototype.listIMessageChats = async function () {
|
|
52
|
+
const result = await this.fetch("/api/lifeops/connectors/imessage/chats");
|
|
53
|
+
return {
|
|
54
|
+
chats: result.chats.map(normalizeLifeOpsChat),
|
|
55
|
+
count: result.count,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
ElizaClient.prototype.sendIMessage = async function (request) {
|
|
59
|
+
const attachmentPaths = request.attachmentPaths ??
|
|
60
|
+
(request.mediaUrl ? [request.mediaUrl] : undefined);
|
|
61
|
+
const body = {
|
|
62
|
+
to: request.to,
|
|
63
|
+
text: request.text,
|
|
64
|
+
...(attachmentPaths ? { attachmentPaths } : {}),
|
|
65
|
+
};
|
|
66
|
+
const result = await this.fetch("/api/lifeops/connectors/imessage/send", {
|
|
67
|
+
method: "POST",
|
|
68
|
+
body: JSON.stringify(body),
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
success: result.ok,
|
|
72
|
+
messageId: result.messageId,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side helpers for the local-inference endpoints. Mirrors the
|
|
3
|
+
* structure used by `client-computeruse.ts`: augments `ElizaClient` via
|
|
4
|
+
* declaration merging so callers get typed methods without reaching into
|
|
5
|
+
* raw `fetch` from UI code.
|
|
6
|
+
*/
|
|
7
|
+
import type { DeviceBridgeStatus } from "../services/local-inference/device-bridge";
|
|
8
|
+
import type { PublicRegistration } from "../services/local-inference/handler-registry";
|
|
9
|
+
import type { ProviderStatus } from "../services/local-inference/providers";
|
|
10
|
+
import type { RoutingPolicy, RoutingPreferences } from "../services/local-inference/routing-preferences";
|
|
11
|
+
import type { ActiveModelState, AgentModelSlot, CatalogModel, DownloadJob, HardwareProbe, InstalledModel, ModelAssignments, ModelBucket, ModelHubSnapshot } from "../services/local-inference/types";
|
|
12
|
+
import type { VerifyResult } from "../services/local-inference/verify";
|
|
13
|
+
export type { ActiveModelState, AgentModelSlot, CatalogModel, DeviceBridgeStatus, DownloadJob, HardwareProbe, InstalledModel, ModelAssignments, ModelBucket, ModelHubSnapshot, ProviderStatus, PublicRegistration, RoutingPolicy, RoutingPreferences, VerifyResult, };
|
|
14
|
+
declare module "./client-base" {
|
|
15
|
+
interface ElizaClient {
|
|
16
|
+
getLocalInferenceHub(): Promise<ModelHubSnapshot>;
|
|
17
|
+
getLocalInferenceHardware(): Promise<HardwareProbe>;
|
|
18
|
+
getLocalInferenceCatalog(): Promise<{
|
|
19
|
+
models: CatalogModel[];
|
|
20
|
+
}>;
|
|
21
|
+
getLocalInferenceInstalled(): Promise<{
|
|
22
|
+
models: InstalledModel[];
|
|
23
|
+
}>;
|
|
24
|
+
startLocalInferenceDownload(modelIdOrSpec: string | CatalogModel): Promise<{
|
|
25
|
+
job: DownloadJob;
|
|
26
|
+
}>;
|
|
27
|
+
searchHuggingFaceGguf(query: string, limit?: number): Promise<{
|
|
28
|
+
models: CatalogModel[];
|
|
29
|
+
}>;
|
|
30
|
+
cancelLocalInferenceDownload(modelId: string): Promise<{
|
|
31
|
+
cancelled: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
getLocalInferenceActive(): Promise<ActiveModelState>;
|
|
34
|
+
setLocalInferenceActive(modelId: string): Promise<ActiveModelState>;
|
|
35
|
+
clearLocalInferenceActive(): Promise<ActiveModelState>;
|
|
36
|
+
uninstallLocalInferenceModel(id: string): Promise<{
|
|
37
|
+
removed: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
getLocalInferenceDeviceStatus(): Promise<DeviceBridgeStatus>;
|
|
40
|
+
getLocalInferenceProviders(): Promise<{
|
|
41
|
+
providers: ProviderStatus[];
|
|
42
|
+
}>;
|
|
43
|
+
getLocalInferenceAssignments(): Promise<{
|
|
44
|
+
assignments: ModelAssignments;
|
|
45
|
+
}>;
|
|
46
|
+
setLocalInferenceAssignment(slot: AgentModelSlot, modelId: string | null): Promise<{
|
|
47
|
+
assignments: ModelAssignments;
|
|
48
|
+
}>;
|
|
49
|
+
verifyLocalInferenceModel(id: string): Promise<VerifyResult>;
|
|
50
|
+
getLocalInferenceRouting(): Promise<{
|
|
51
|
+
registrations: PublicRegistration[];
|
|
52
|
+
preferences: RoutingPreferences;
|
|
53
|
+
}>;
|
|
54
|
+
setLocalInferencePreferredProvider(slot: AgentModelSlot, provider: string | null): Promise<{
|
|
55
|
+
preferences: RoutingPreferences;
|
|
56
|
+
}>;
|
|
57
|
+
setLocalInferencePolicy(slot: AgentModelSlot, policy: RoutingPolicy | null): Promise<{
|
|
58
|
+
preferences: RoutingPreferences;
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=client-local-inference.d.ts.map
|