whale-code 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/bin/swag-agent.js +9 -0
- package/bin/swagmanager-mcp.js +321 -0
- package/dist/cli/app.d.ts +26 -0
- package/dist/cli/app.js +64 -0
- package/dist/cli/chat/AgentSelector.d.ts +14 -0
- package/dist/cli/chat/AgentSelector.js +14 -0
- package/dist/cli/chat/ChatApp.d.ts +9 -0
- package/dist/cli/chat/ChatApp.js +267 -0
- package/dist/cli/chat/ChatInput.d.ts +39 -0
- package/dist/cli/chat/ChatInput.js +509 -0
- package/dist/cli/chat/MarkdownText.d.ts +10 -0
- package/dist/cli/chat/MarkdownText.js +20 -0
- package/dist/cli/chat/MessageList.d.ts +37 -0
- package/dist/cli/chat/MessageList.js +80 -0
- package/dist/cli/chat/ModelSelector.d.ts +20 -0
- package/dist/cli/chat/ModelSelector.js +73 -0
- package/dist/cli/chat/RewindViewer.d.ts +26 -0
- package/dist/cli/chat/RewindViewer.js +185 -0
- package/dist/cli/chat/StoreSelector.d.ts +14 -0
- package/dist/cli/chat/StoreSelector.js +24 -0
- package/dist/cli/chat/StreamingText.d.ts +12 -0
- package/dist/cli/chat/StreamingText.js +12 -0
- package/dist/cli/chat/SubagentPanel.d.ts +45 -0
- package/dist/cli/chat/SubagentPanel.js +110 -0
- package/dist/cli/chat/TeamPanel.d.ts +21 -0
- package/dist/cli/chat/TeamPanel.js +42 -0
- package/dist/cli/chat/ToolIndicator.d.ts +25 -0
- package/dist/cli/chat/ToolIndicator.js +436 -0
- package/dist/cli/chat/hooks/useAgentLoop.d.ts +39 -0
- package/dist/cli/chat/hooks/useAgentLoop.js +382 -0
- package/dist/cli/chat/hooks/useSlashCommands.d.ts +37 -0
- package/dist/cli/chat/hooks/useSlashCommands.js +387 -0
- package/dist/cli/commands/config-cmd.d.ts +10 -0
- package/dist/cli/commands/config-cmd.js +99 -0
- package/dist/cli/commands/doctor.d.ts +14 -0
- package/dist/cli/commands/doctor.js +172 -0
- package/dist/cli/commands/init.d.ts +16 -0
- package/dist/cli/commands/init.js +278 -0
- package/dist/cli/commands/mcp.d.ts +12 -0
- package/dist/cli/commands/mcp.js +162 -0
- package/dist/cli/login/LoginApp.d.ts +7 -0
- package/dist/cli/login/LoginApp.js +157 -0
- package/dist/cli/print-mode.d.ts +31 -0
- package/dist/cli/print-mode.js +202 -0
- package/dist/cli/serve-mode.d.ts +37 -0
- package/dist/cli/serve-mode.js +636 -0
- package/dist/cli/services/agent-definitions.d.ts +25 -0
- package/dist/cli/services/agent-definitions.js +91 -0
- package/dist/cli/services/agent-events.d.ts +178 -0
- package/dist/cli/services/agent-events.js +175 -0
- package/dist/cli/services/agent-loop.d.ts +90 -0
- package/dist/cli/services/agent-loop.js +762 -0
- package/dist/cli/services/agent-worker-base.d.ts +97 -0
- package/dist/cli/services/agent-worker-base.js +220 -0
- package/dist/cli/services/auth-service.d.ts +30 -0
- package/dist/cli/services/auth-service.js +160 -0
- package/dist/cli/services/background-processes.d.ts +126 -0
- package/dist/cli/services/background-processes.js +318 -0
- package/dist/cli/services/browser-auth.d.ts +24 -0
- package/dist/cli/services/browser-auth.js +180 -0
- package/dist/cli/services/claude-md-loader.d.ts +16 -0
- package/dist/cli/services/claude-md-loader.js +58 -0
- package/dist/cli/services/config-store.d.ts +47 -0
- package/dist/cli/services/config-store.js +79 -0
- package/dist/cli/services/debug-log.d.ts +10 -0
- package/dist/cli/services/debug-log.js +52 -0
- package/dist/cli/services/error-logger.d.ts +58 -0
- package/dist/cli/services/error-logger.js +269 -0
- package/dist/cli/services/file-history.d.ts +21 -0
- package/dist/cli/services/file-history.js +83 -0
- package/dist/cli/services/format-server-response.d.ts +16 -0
- package/dist/cli/services/format-server-response.js +440 -0
- package/dist/cli/services/git-context.d.ts +11 -0
- package/dist/cli/services/git-context.js +66 -0
- package/dist/cli/services/hooks.d.ts +85 -0
- package/dist/cli/services/hooks.js +258 -0
- package/dist/cli/services/interactive-tools.d.ts +125 -0
- package/dist/cli/services/interactive-tools.js +260 -0
- package/dist/cli/services/keybinding-manager.d.ts +52 -0
- package/dist/cli/services/keybinding-manager.js +115 -0
- package/dist/cli/services/local-tools.d.ts +22 -0
- package/dist/cli/services/local-tools.js +697 -0
- package/dist/cli/services/lsp-manager.d.ts +18 -0
- package/dist/cli/services/lsp-manager.js +717 -0
- package/dist/cli/services/mcp-client.d.ts +48 -0
- package/dist/cli/services/mcp-client.js +157 -0
- package/dist/cli/services/memory-manager.d.ts +16 -0
- package/dist/cli/services/memory-manager.js +57 -0
- package/dist/cli/services/model-manager.d.ts +18 -0
- package/dist/cli/services/model-manager.js +71 -0
- package/dist/cli/services/model-router.d.ts +26 -0
- package/dist/cli/services/model-router.js +149 -0
- package/dist/cli/services/permission-modes.d.ts +13 -0
- package/dist/cli/services/permission-modes.js +43 -0
- package/dist/cli/services/rewind.d.ts +84 -0
- package/dist/cli/services/rewind.js +194 -0
- package/dist/cli/services/ripgrep.d.ts +28 -0
- package/dist/cli/services/ripgrep.js +138 -0
- package/dist/cli/services/sandbox.d.ts +29 -0
- package/dist/cli/services/sandbox.js +97 -0
- package/dist/cli/services/server-tools.d.ts +61 -0
- package/dist/cli/services/server-tools.js +543 -0
- package/dist/cli/services/session-persistence.d.ts +23 -0
- package/dist/cli/services/session-persistence.js +99 -0
- package/dist/cli/services/subagent-worker.d.ts +19 -0
- package/dist/cli/services/subagent-worker.js +41 -0
- package/dist/cli/services/subagent.d.ts +47 -0
- package/dist/cli/services/subagent.js +647 -0
- package/dist/cli/services/system-prompt.d.ts +7 -0
- package/dist/cli/services/system-prompt.js +198 -0
- package/dist/cli/services/team-lead.d.ts +73 -0
- package/dist/cli/services/team-lead.js +512 -0
- package/dist/cli/services/team-state.d.ts +77 -0
- package/dist/cli/services/team-state.js +398 -0
- package/dist/cli/services/teammate.d.ts +31 -0
- package/dist/cli/services/teammate.js +689 -0
- package/dist/cli/services/telemetry.d.ts +61 -0
- package/dist/cli/services/telemetry.js +209 -0
- package/dist/cli/services/tools/agent-tools.d.ts +14 -0
- package/dist/cli/services/tools/agent-tools.js +347 -0
- package/dist/cli/services/tools/file-ops.d.ts +15 -0
- package/dist/cli/services/tools/file-ops.js +487 -0
- package/dist/cli/services/tools/search-tools.d.ts +8 -0
- package/dist/cli/services/tools/search-tools.js +186 -0
- package/dist/cli/services/tools/shell-exec.d.ts +10 -0
- package/dist/cli/services/tools/shell-exec.js +168 -0
- package/dist/cli/services/tools/task-manager.d.ts +28 -0
- package/dist/cli/services/tools/task-manager.js +209 -0
- package/dist/cli/services/tools/web-tools.d.ts +11 -0
- package/dist/cli/services/tools/web-tools.js +395 -0
- package/dist/cli/setup/SetupApp.d.ts +9 -0
- package/dist/cli/setup/SetupApp.js +191 -0
- package/dist/cli/shared/MatrixIntro.d.ts +4 -0
- package/dist/cli/shared/MatrixIntro.js +83 -0
- package/dist/cli/shared/Theme.d.ts +74 -0
- package/dist/cli/shared/Theme.js +127 -0
- package/dist/cli/shared/WhaleBanner.d.ts +10 -0
- package/dist/cli/shared/WhaleBanner.js +12 -0
- package/dist/cli/shared/markdown.d.ts +21 -0
- package/dist/cli/shared/markdown.js +756 -0
- package/dist/cli/status/StatusApp.d.ts +4 -0
- package/dist/cli/status/StatusApp.js +105 -0
- package/dist/cli/stores/StoreApp.d.ts +7 -0
- package/dist/cli/stores/StoreApp.js +81 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +538 -0
- package/dist/local-agent/connection.d.ts +48 -0
- package/dist/local-agent/connection.js +332 -0
- package/dist/local-agent/discovery.d.ts +18 -0
- package/dist/local-agent/discovery.js +146 -0
- package/dist/local-agent/executor.d.ts +34 -0
- package/dist/local-agent/executor.js +241 -0
- package/dist/local-agent/index.d.ts +14 -0
- package/dist/local-agent/index.js +198 -0
- package/dist/node/adapters/base.d.ts +35 -0
- package/dist/node/adapters/base.js +10 -0
- package/dist/node/adapters/discord.d.ts +29 -0
- package/dist/node/adapters/discord.js +299 -0
- package/dist/node/adapters/email.d.ts +23 -0
- package/dist/node/adapters/email.js +218 -0
- package/dist/node/adapters/imessage.d.ts +17 -0
- package/dist/node/adapters/imessage.js +118 -0
- package/dist/node/adapters/slack.d.ts +26 -0
- package/dist/node/adapters/slack.js +259 -0
- package/dist/node/adapters/sms.d.ts +23 -0
- package/dist/node/adapters/sms.js +161 -0
- package/dist/node/adapters/telegram.d.ts +17 -0
- package/dist/node/adapters/telegram.js +101 -0
- package/dist/node/adapters/webchat.d.ts +27 -0
- package/dist/node/adapters/webchat.js +160 -0
- package/dist/node/adapters/whatsapp.d.ts +28 -0
- package/dist/node/adapters/whatsapp.js +230 -0
- package/dist/node/cli.d.ts +2 -0
- package/dist/node/cli.js +325 -0
- package/dist/node/config.d.ts +17 -0
- package/dist/node/config.js +31 -0
- package/dist/node/runtime.d.ts +50 -0
- package/dist/node/runtime.js +351 -0
- package/dist/server/handlers/__test-utils__/mock-supabase.d.ts +11 -0
- package/dist/server/handlers/__test-utils__/mock-supabase.js +393 -0
- package/dist/server/handlers/analytics.d.ts +17 -0
- package/dist/server/handlers/analytics.js +266 -0
- package/dist/server/handlers/api-keys.d.ts +6 -0
- package/dist/server/handlers/api-keys.js +221 -0
- package/dist/server/handlers/billing.d.ts +33 -0
- package/dist/server/handlers/billing.js +272 -0
- package/dist/server/handlers/browser.d.ts +10 -0
- package/dist/server/handlers/browser.js +517 -0
- package/dist/server/handlers/catalog.d.ts +99 -0
- package/dist/server/handlers/catalog.js +976 -0
- package/dist/server/handlers/comms.d.ts +254 -0
- package/dist/server/handlers/comms.js +588 -0
- package/dist/server/handlers/creations.d.ts +6 -0
- package/dist/server/handlers/creations.js +479 -0
- package/dist/server/handlers/crm.d.ts +89 -0
- package/dist/server/handlers/crm.js +538 -0
- package/dist/server/handlers/discovery.d.ts +6 -0
- package/dist/server/handlers/discovery.js +288 -0
- package/dist/server/handlers/embeddings.d.ts +92 -0
- package/dist/server/handlers/embeddings.js +197 -0
- package/dist/server/handlers/enrichment.d.ts +8 -0
- package/dist/server/handlers/enrichment.js +768 -0
- package/dist/server/handlers/image-gen.d.ts +6 -0
- package/dist/server/handlers/image-gen.js +409 -0
- package/dist/server/handlers/inventory.d.ts +319 -0
- package/dist/server/handlers/inventory.js +447 -0
- package/dist/server/handlers/kali.d.ts +10 -0
- package/dist/server/handlers/kali.js +210 -0
- package/dist/server/handlers/llm-providers.d.ts +6 -0
- package/dist/server/handlers/llm-providers.js +673 -0
- package/dist/server/handlers/local-agent.d.ts +6 -0
- package/dist/server/handlers/local-agent.js +118 -0
- package/dist/server/handlers/meta-ads.d.ts +111 -0
- package/dist/server/handlers/meta-ads.js +2279 -0
- package/dist/server/handlers/nodes.d.ts +33 -0
- package/dist/server/handlers/nodes.js +699 -0
- package/dist/server/handlers/operations.d.ts +138 -0
- package/dist/server/handlers/operations.js +131 -0
- package/dist/server/handlers/platform.d.ts +23 -0
- package/dist/server/handlers/platform.js +227 -0
- package/dist/server/handlers/supply-chain.d.ts +19 -0
- package/dist/server/handlers/supply-chain.js +327 -0
- package/dist/server/handlers/transcription.d.ts +17 -0
- package/dist/server/handlers/transcription.js +121 -0
- package/dist/server/handlers/video-gen.d.ts +6 -0
- package/dist/server/handlers/video-gen.js +466 -0
- package/dist/server/handlers/voice.d.ts +8 -0
- package/dist/server/handlers/voice.js +1146 -0
- package/dist/server/handlers/workflow-steps.d.ts +86 -0
- package/dist/server/handlers/workflow-steps.js +2349 -0
- package/dist/server/handlers/workflows.d.ts +7 -0
- package/dist/server/handlers/workflows.js +989 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +2427 -0
- package/dist/server/lib/batch-client.d.ts +80 -0
- package/dist/server/lib/batch-client.js +467 -0
- package/dist/server/lib/code-worker-pool.d.ts +31 -0
- package/dist/server/lib/code-worker-pool.js +224 -0
- package/dist/server/lib/code-worker.d.ts +1 -0
- package/dist/server/lib/code-worker.js +188 -0
- package/dist/server/lib/compaction-service.d.ts +32 -0
- package/dist/server/lib/compaction-service.js +162 -0
- package/dist/server/lib/logger.d.ts +19 -0
- package/dist/server/lib/logger.js +46 -0
- package/dist/server/lib/otel.d.ts +38 -0
- package/dist/server/lib/otel.js +126 -0
- package/dist/server/lib/pg-rate-limiter.d.ts +21 -0
- package/dist/server/lib/pg-rate-limiter.js +86 -0
- package/dist/server/lib/prompt-sanitizer.d.ts +37 -0
- package/dist/server/lib/prompt-sanitizer.js +177 -0
- package/dist/server/lib/provider-capabilities.d.ts +85 -0
- package/dist/server/lib/provider-capabilities.js +190 -0
- package/dist/server/lib/provider-failover.d.ts +74 -0
- package/dist/server/lib/provider-failover.js +210 -0
- package/dist/server/lib/rate-limiter.d.ts +39 -0
- package/dist/server/lib/rate-limiter.js +147 -0
- package/dist/server/lib/server-agent-loop.d.ts +107 -0
- package/dist/server/lib/server-agent-loop.js +667 -0
- package/dist/server/lib/server-subagent.d.ts +78 -0
- package/dist/server/lib/server-subagent.js +203 -0
- package/dist/server/lib/session-checkpoint.d.ts +51 -0
- package/dist/server/lib/session-checkpoint.js +145 -0
- package/dist/server/lib/ssrf-guard.d.ts +13 -0
- package/dist/server/lib/ssrf-guard.js +240 -0
- package/dist/server/lib/supabase-client.d.ts +7 -0
- package/dist/server/lib/supabase-client.js +78 -0
- package/dist/server/lib/template-resolver.d.ts +31 -0
- package/dist/server/lib/template-resolver.js +215 -0
- package/dist/server/lib/utils.d.ts +16 -0
- package/dist/server/lib/utils.js +147 -0
- package/dist/server/local-agent-gateway.d.ts +82 -0
- package/dist/server/local-agent-gateway.js +426 -0
- package/dist/server/providers/anthropic.d.ts +20 -0
- package/dist/server/providers/anthropic.js +199 -0
- package/dist/server/providers/bedrock.d.ts +20 -0
- package/dist/server/providers/bedrock.js +194 -0
- package/dist/server/providers/gemini.d.ts +24 -0
- package/dist/server/providers/gemini.js +486 -0
- package/dist/server/providers/openai.d.ts +24 -0
- package/dist/server/providers/openai.js +522 -0
- package/dist/server/providers/registry.d.ts +32 -0
- package/dist/server/providers/registry.js +58 -0
- package/dist/server/providers/shared.d.ts +32 -0
- package/dist/server/providers/shared.js +124 -0
- package/dist/server/providers/types.d.ts +92 -0
- package/dist/server/providers/types.js +12 -0
- package/dist/server/proxy-handlers.d.ts +6 -0
- package/dist/server/proxy-handlers.js +89 -0
- package/dist/server/tool-router.d.ts +149 -0
- package/dist/server/tool-router.js +803 -0
- package/dist/server/validation.d.ts +24 -0
- package/dist/server/validation.js +301 -0
- package/dist/server/worker.d.ts +19 -0
- package/dist/server/worker.js +201 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.js +181 -0
- package/dist/shared/agent-core.d.ts +157 -0
- package/dist/shared/agent-core.js +534 -0
- package/dist/shared/anthropic-types.d.ts +105 -0
- package/dist/shared/anthropic-types.js +7 -0
- package/dist/shared/api-client.d.ts +90 -0
- package/dist/shared/api-client.js +379 -0
- package/dist/shared/constants.d.ts +33 -0
- package/dist/shared/constants.js +80 -0
- package/dist/shared/sse-parser.d.ts +26 -0
- package/dist/shared/sse-parser.js +259 -0
- package/dist/shared/tool-dispatch.d.ts +52 -0
- package/dist/shared/tool-dispatch.js +191 -0
- package/dist/shared/types.d.ts +72 -0
- package/dist/shared/types.js +7 -0
- package/dist/updater.d.ts +25 -0
- package/dist/updater.js +140 -0
- package/dist/webchat/widget.d.ts +0 -0
- package/dist/webchat/widget.js +397 -0
- package/package.json +95 -0
- package/src/cli/services/builtin-skills/commit.md +19 -0
- package/src/cli/services/builtin-skills/review-pr.md +21 -0
- package/src/cli/services/builtin-skills/review.md +18 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Shared Utilities — credential resolution, SSE helpers, error emission.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from proxy-handlers.ts. Used by all provider adapters.
|
|
5
|
+
*/
|
|
6
|
+
import { createClient } from "@supabase/supabase-js";
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// JSON + SSE HELPERS
|
|
9
|
+
// ============================================================================
|
|
10
|
+
export function jsonResponse(res, status, data, corsHeaders) {
|
|
11
|
+
res.writeHead(status, { "Content-Type": "application/json", ...corsHeaders });
|
|
12
|
+
res.end(JSON.stringify(data));
|
|
13
|
+
}
|
|
14
|
+
export function writeSSEHeaders(res, corsHeaders) {
|
|
15
|
+
res.writeHead(200, {
|
|
16
|
+
"Content-Type": "text/event-stream",
|
|
17
|
+
"Cache-Control": "no-cache",
|
|
18
|
+
Connection: "keep-alive",
|
|
19
|
+
"X-Accel-Buffering": "no",
|
|
20
|
+
...corsHeaders,
|
|
21
|
+
});
|
|
22
|
+
res.flushHeaders();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Emit an error — as SSE if headers already sent, otherwise as JSON response.
|
|
26
|
+
* Always emits message_delta + message_stop so clients don't hang.
|
|
27
|
+
*/
|
|
28
|
+
export function emitError(res, err, corsHeaders, sanitize, opts) {
|
|
29
|
+
const errMsg = err?.message || String(err);
|
|
30
|
+
const provider = opts?.provider || "proxy";
|
|
31
|
+
console.error(`[${provider}-proxy] Error:`, errMsg);
|
|
32
|
+
if (res.headersSent) {
|
|
33
|
+
res.write(`data: ${JSON.stringify({ type: "error", error: sanitize(err) })}\n\n`);
|
|
34
|
+
const usage = {
|
|
35
|
+
input_tokens: opts?.inputTokens || 0,
|
|
36
|
+
output_tokens: opts?.outputTokens || 0,
|
|
37
|
+
};
|
|
38
|
+
if (opts?.thinkingTokens && opts.thinkingTokens > 0)
|
|
39
|
+
usage.thinking_tokens = opts.thinkingTokens;
|
|
40
|
+
if (opts?.cacheReadTokens && opts.cacheReadTokens > 0)
|
|
41
|
+
usage.cache_read_input_tokens = opts.cacheReadTokens;
|
|
42
|
+
res.write(`data: ${JSON.stringify({
|
|
43
|
+
type: "message_delta",
|
|
44
|
+
delta: { stop_reason: "error", stop_sequence: null },
|
|
45
|
+
usage,
|
|
46
|
+
})}\n\n`);
|
|
47
|
+
res.write(`data: ${JSON.stringify({ type: "message_stop" })}\n\n`);
|
|
48
|
+
res.write("data: [DONE]\n\n");
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
jsonResponse(res, 502, { error: `${provider} error: ${sanitize(err)}` }, corsHeaders);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// ============================================================================
|
|
55
|
+
// CREDENTIAL RESOLUTION
|
|
56
|
+
// ============================================================================
|
|
57
|
+
/** Credential cache — keyed by provider+store_id, 5-minute TTL, LRU capped at 50 */
|
|
58
|
+
const providerCredCacheMap = new Map();
|
|
59
|
+
export async function resolveProviderCredentials(provider, storeId) {
|
|
60
|
+
const cacheKey = `${provider}:${storeId || "__default__"}`;
|
|
61
|
+
const cached = providerCredCacheMap.get(cacheKey);
|
|
62
|
+
if (cached && Date.now() - cached.fetchedAt < 300_000) {
|
|
63
|
+
return cached;
|
|
64
|
+
}
|
|
65
|
+
const SUPABASE_URL = process.env.SUPABASE_URL;
|
|
66
|
+
const SUPABASE_SERVICE_ROLE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY;
|
|
67
|
+
const sb = createClient(SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY);
|
|
68
|
+
const result = { fetchedAt: Date.now() };
|
|
69
|
+
if (provider === "google") {
|
|
70
|
+
try {
|
|
71
|
+
const { data, error } = await sb.rpc("decrypt_secret", { p_name: "GOOGLE_AI_API_KEY", p_store_id: storeId || null });
|
|
72
|
+
if (error)
|
|
73
|
+
console.error(`[cred-resolve] Google key lookup failed for store=${storeId}:`, error.message);
|
|
74
|
+
if (data)
|
|
75
|
+
result.google = { apiKey: data };
|
|
76
|
+
else
|
|
77
|
+
console.error(`[cred-resolve] No Google key found for store=${storeId}`);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
console.error(`[cred-resolve] Google key RPC error for store=${storeId}:`, err?.message);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (provider === "bedrock") {
|
|
84
|
+
try {
|
|
85
|
+
const [akRes, skRes, rgRes] = await Promise.all([
|
|
86
|
+
sb.rpc("decrypt_secret", { p_name: "AWS_ACCESS_KEY_ID", p_store_id: storeId || null }),
|
|
87
|
+
sb.rpc("decrypt_secret", { p_name: "AWS_SECRET_ACCESS_KEY", p_store_id: storeId || null }),
|
|
88
|
+
sb.rpc("decrypt_secret", { p_name: "AWS_REGION", p_store_id: storeId || null }),
|
|
89
|
+
]);
|
|
90
|
+
if (akRes.data && skRes.data) {
|
|
91
|
+
result.bedrock = {
|
|
92
|
+
accessKeyId: akRes.data,
|
|
93
|
+
secretAccessKey: skRes.data,
|
|
94
|
+
region: rgRes.data || "us-east-1",
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
console.error(`[cred-resolve] Bedrock key RPC error for store=${storeId}:`, err?.message);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (provider === "openai") {
|
|
103
|
+
try {
|
|
104
|
+
const { data, error } = await sb.rpc("decrypt_secret", { p_name: "OPENAI_API_KEY", p_store_id: storeId || null });
|
|
105
|
+
if (error)
|
|
106
|
+
console.error(`[cred-resolve] OpenAI key lookup failed for store=${storeId}:`, error.message);
|
|
107
|
+
if (data)
|
|
108
|
+
result.openai = { apiKey: data };
|
|
109
|
+
else
|
|
110
|
+
console.error(`[cred-resolve] No OpenAI key found for store=${storeId}`);
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
console.error(`[cred-resolve] OpenAI key RPC error for store=${storeId}:`, err?.message);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
providerCredCacheMap.set(cacheKey, result);
|
|
117
|
+
// LRU: cap cache at 50 stores
|
|
118
|
+
if (providerCredCacheMap.size > 50) {
|
|
119
|
+
const firstKey = providerCredCacheMap.keys().next().value;
|
|
120
|
+
if (firstKey)
|
|
121
|
+
providerCredCacheMap.delete(firstKey);
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Adapter Pattern — shared types for multi-provider proxy handlers.
|
|
3
|
+
*
|
|
4
|
+
* Phase 7.1: Unified ProviderAdapter interface so each provider encapsulates
|
|
5
|
+
* its own message formatting, streaming normalization, tool schema adaptation,
|
|
6
|
+
* thinking config, context management, and output token limits.
|
|
7
|
+
*
|
|
8
|
+
* Config types (ThinkingConfig, ContextManagementConfig, CompactionConfig) are
|
|
9
|
+
* defined in shared/agent-core.ts and re-exported here so adapters can import
|
|
10
|
+
* from a single location without creating shared→server circular dependencies.
|
|
11
|
+
*/
|
|
12
|
+
import type http from "node:http";
|
|
13
|
+
import type { ProviderCapabilities } from "../lib/provider-capabilities.js";
|
|
14
|
+
export type { ThinkingConfig, ContextManagementConfig, CompactionConfig, ToolChoice, } from "../../shared/agent-core.js";
|
|
15
|
+
export type { ProviderCapabilities } from "../lib/provider-capabilities.js";
|
|
16
|
+
export interface NormalizedStreamEvent {
|
|
17
|
+
type: "text" | "tool_use_start" | "tool_use_delta" | "tool_use_end" | "thinking" | "usage" | "done" | "error";
|
|
18
|
+
/** Text delta content */
|
|
19
|
+
text?: string;
|
|
20
|
+
/** Tool use fields */
|
|
21
|
+
toolId?: string;
|
|
22
|
+
toolName?: string;
|
|
23
|
+
toolInput?: string;
|
|
24
|
+
/** Usage data */
|
|
25
|
+
usage?: {
|
|
26
|
+
inputTokens: number;
|
|
27
|
+
outputTokens: number;
|
|
28
|
+
cacheReadTokens: number;
|
|
29
|
+
cacheCreationTokens: number;
|
|
30
|
+
};
|
|
31
|
+
/** Error message */
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ProviderStreamConfig {
|
|
35
|
+
model: string;
|
|
36
|
+
messages: any[];
|
|
37
|
+
system: any;
|
|
38
|
+
tools?: any[];
|
|
39
|
+
max_tokens: number;
|
|
40
|
+
temperature?: number;
|
|
41
|
+
stream?: boolean;
|
|
42
|
+
betas?: string[];
|
|
43
|
+
context_management?: any;
|
|
44
|
+
thinking?: any;
|
|
45
|
+
tool_choice?: import("../../shared/agent-core.js").ToolChoice;
|
|
46
|
+
storeId?: string;
|
|
47
|
+
/** Source documents for Anthropic Citations API — enables cite content blocks in responses */
|
|
48
|
+
documents?: any[];
|
|
49
|
+
}
|
|
50
|
+
export interface ThinkingConfigResult {
|
|
51
|
+
thinking: import("../../shared/agent-core.js").ThinkingConfig;
|
|
52
|
+
beta: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ProviderAdapter {
|
|
55
|
+
/** Provider identifier: "anthropic" | "bedrock" | "gemini" | "openai" */
|
|
56
|
+
name: string;
|
|
57
|
+
/**
|
|
58
|
+
* Handle streaming (or non-streaming) proxy request.
|
|
59
|
+
* Writes SSE events to res, converting from native provider format
|
|
60
|
+
* to Anthropic-compatible SSE where applicable.
|
|
61
|
+
*/
|
|
62
|
+
handleStream(res: http.ServerResponse, config: ProviderStreamConfig, corsHeaders: Record<string, string>): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Returns thinking configuration for the given model.
|
|
65
|
+
* Each provider handles thinking differently:
|
|
66
|
+
* - Anthropic: adaptive/enabled with beta strings
|
|
67
|
+
* - Gemini: always-on for 2.5+/3.x
|
|
68
|
+
* - OpenAI: reasoning models have built-in reasoning
|
|
69
|
+
* - Bedrock: same as Anthropic
|
|
70
|
+
*/
|
|
71
|
+
getThinkingConfig(model: string, enabled: boolean): ThinkingConfigResult;
|
|
72
|
+
/**
|
|
73
|
+
* Returns max output tokens for the given model.
|
|
74
|
+
* If agentMax is provided, it's capped at the model's maximum.
|
|
75
|
+
*/
|
|
76
|
+
getMaxOutputTokens(model: string, agentMax?: number): number;
|
|
77
|
+
/**
|
|
78
|
+
* Returns context management configuration (betas + edits) for the given model.
|
|
79
|
+
* Non-Anthropic providers return empty config.
|
|
80
|
+
*/
|
|
81
|
+
getContextManagement(model: string): import("../../shared/agent-core.js").ContextManagementConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Returns compaction configuration for the provider.
|
|
84
|
+
* Controls when/how context compaction is triggered.
|
|
85
|
+
*/
|
|
86
|
+
getCompactionConfig(model: string): import("../../shared/agent-core.js").CompactionConfig;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the static capability matrix for this provider.
|
|
89
|
+
* Used for pre-flight checks and capability-aware routing/failover.
|
|
90
|
+
*/
|
|
91
|
+
getCapabilities(): ProviderCapabilities;
|
|
92
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Adapter Pattern — shared types for multi-provider proxy handlers.
|
|
3
|
+
*
|
|
4
|
+
* Phase 7.1: Unified ProviderAdapter interface so each provider encapsulates
|
|
5
|
+
* its own message formatting, streaming normalization, tool schema adaptation,
|
|
6
|
+
* thinking config, context management, and output token limits.
|
|
7
|
+
*
|
|
8
|
+
* Config types (ThinkingConfig, ContextManagementConfig, CompactionConfig) are
|
|
9
|
+
* defined in shared/agent-core.ts and re-exported here so adapters can import
|
|
10
|
+
* from a single location without creating shared→server circular dependencies.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type http from "node:http";
|
|
2
|
+
import "./providers/anthropic.js";
|
|
3
|
+
import "./providers/bedrock.js";
|
|
4
|
+
import "./providers/gemini.js";
|
|
5
|
+
import "./providers/openai.js";
|
|
6
|
+
export declare function handleProxy(res: http.ServerResponse, body: any, corsHeaders: Record<string, string>): Promise<void>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// server/proxy-handlers.ts — Multi-provider API proxy router
|
|
2
|
+
// Thin dispatcher that delegates to provider adapters via the registry.
|
|
3
|
+
//
|
|
4
|
+
// Phase 7.1: Uses getProviderAdapter() from the registry instead of
|
|
5
|
+
// maintaining its own adapter map. Provider adapters self-register on import.
|
|
6
|
+
import { ALLOWED_MODELS, MODELS, MODEL_MAP, getProvider, isOpenAIReasoningModel } from "../shared/constants.js";
|
|
7
|
+
import { getProviderAdapter } from "./providers/registry.js";
|
|
8
|
+
import { jsonResponse } from "./providers/shared.js";
|
|
9
|
+
import { canProviderHandleRequest, getBestProviderForRequest } from "./lib/provider-capabilities.js";
|
|
10
|
+
// Import adapters to trigger self-registration via registerProvider()
|
|
11
|
+
import "./providers/anthropic.js";
|
|
12
|
+
import "./providers/bedrock.js";
|
|
13
|
+
import "./providers/gemini.js";
|
|
14
|
+
import "./providers/openai.js";
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// MAX TOKEN LIMITS (per provider — used for proxy request clamping)
|
|
17
|
+
// ============================================================================
|
|
18
|
+
const ANTHROPIC_MAX_TOKENS = 128000;
|
|
19
|
+
const GEMINI_MAX_TOKENS = 65536;
|
|
20
|
+
const OPENAI_MAX_TOKENS = 128000;
|
|
21
|
+
const OPENAI_REASONING_MAX_TOKENS = 100000;
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// MAIN PROXY DISPATCHER
|
|
24
|
+
// ============================================================================
|
|
25
|
+
export async function handleProxy(res, body, corsHeaders) {
|
|
26
|
+
const { messages, system, tools, model: requestedModel = MODELS.SONNET, max_tokens: requestedMaxTokens = 4096, temperature, stream = true, betas, context_management, thinking, store_id: storeId, tool_choice: rawToolChoice, documents, } = body;
|
|
27
|
+
if (!messages || !Array.isArray(messages)) {
|
|
28
|
+
jsonResponse(res, 400, { error: "messages array required" }, corsHeaders);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// Resolve aliases (e.g. "whale/agent" → "claude-opus-4-6", "opus" → "claude-opus-4-6")
|
|
32
|
+
const resolved = MODEL_MAP[requestedModel] || requestedModel;
|
|
33
|
+
const model = ALLOWED_MODELS.includes(resolved) ? resolved : MODELS.SONNET;
|
|
34
|
+
let provider = getProvider(model);
|
|
35
|
+
// Detect request capabilities from message content
|
|
36
|
+
const requirements = detectRequestCapabilities(messages, { hasCitations: !!documents?.length });
|
|
37
|
+
// If the selected provider can't handle the request, re-route to a capable one
|
|
38
|
+
if (!canProviderHandleRequest(provider, requirements)) {
|
|
39
|
+
const betterProvider = getBestProviderForRequest(requirements);
|
|
40
|
+
console.log(`[proxy] ${provider} lacks capabilities for this request, re-routing to ${betterProvider}`);
|
|
41
|
+
provider = betterProvider;
|
|
42
|
+
}
|
|
43
|
+
const maxTokensLimit = provider === "gemini" ? GEMINI_MAX_TOKENS
|
|
44
|
+
: provider === "openai" ? (isOpenAIReasoningModel(model) ? OPENAI_REASONING_MAX_TOKENS : OPENAI_MAX_TOKENS)
|
|
45
|
+
: ANTHROPIC_MAX_TOKENS;
|
|
46
|
+
const max_tokens = Math.min(Math.max(1, Number(requestedMaxTokens) || 4096), maxTokensLimit);
|
|
47
|
+
// Delegate to provider adapter via registry
|
|
48
|
+
const adapter = getProviderAdapter(provider);
|
|
49
|
+
// Normalize tool_choice: accept string or object from client
|
|
50
|
+
const tool_choice = rawToolChoice;
|
|
51
|
+
await adapter.handleStream(res, {
|
|
52
|
+
model, messages, system, tools, max_tokens,
|
|
53
|
+
temperature, stream, betas, context_management, thinking, tool_choice, storeId, documents,
|
|
54
|
+
}, corsHeaders);
|
|
55
|
+
}
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// REQUEST CAPABILITY DETECTION
|
|
58
|
+
// ============================================================================
|
|
59
|
+
/**
|
|
60
|
+
* Scan messages to detect what capabilities the request requires.
|
|
61
|
+
* Looks for image blocks, PDF content types, computer_use tools, etc.
|
|
62
|
+
*/
|
|
63
|
+
function detectRequestCapabilities(messages, hints) {
|
|
64
|
+
const requirements = {};
|
|
65
|
+
if (hints?.hasCitations) {
|
|
66
|
+
requirements.needsCitations = true;
|
|
67
|
+
}
|
|
68
|
+
for (const msg of messages) {
|
|
69
|
+
if (!Array.isArray(msg.content))
|
|
70
|
+
continue;
|
|
71
|
+
for (const block of msg.content) {
|
|
72
|
+
// Image detection: Anthropic image blocks
|
|
73
|
+
if (block.type === "image" && block.source) {
|
|
74
|
+
requirements.hasImages = true;
|
|
75
|
+
}
|
|
76
|
+
// PDF detection: document blocks with PDF media type
|
|
77
|
+
if (block.type === "document" ||
|
|
78
|
+
(block.source?.media_type && block.source.media_type === "application/pdf")) {
|
|
79
|
+
requirements.hasPdf = true;
|
|
80
|
+
}
|
|
81
|
+
// Computer use detection: tool_use with computer_use-related tools
|
|
82
|
+
if (block.type === "tool_use" &&
|
|
83
|
+
(block.name === "computer" || block.name === "computer_use")) {
|
|
84
|
+
requirements.needsComputerUse = true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return requirements;
|
|
89
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Router — unified tool registry, dispatch, and execution.
|
|
3
|
+
*
|
|
4
|
+
* SINGLE SOURCE OF TRUTH for all AI systems (MCP server, HTTP agent, workflows, CLI).
|
|
5
|
+
*
|
|
6
|
+
* Architecture:
|
|
7
|
+
* - ai_tool_registry (DB): tool definitions (name, description, schema) — queried by ALL clients
|
|
8
|
+
* - TOOL_HANDLERS (code): name → handler function mapping — the only place handler routing lives
|
|
9
|
+
* - user_tools (DB): per-store custom tools — additive, never filtered from built-ins
|
|
10
|
+
* - getToolsForAgent(): consistent tool set — all registry tools always available
|
|
11
|
+
* - executeTool(): unified dispatch — handler lookup + timeout + audit logging
|
|
12
|
+
*
|
|
13
|
+
* To add a new tool:
|
|
14
|
+
* 1. Add handler in src/server/handlers/
|
|
15
|
+
* 2. Import and register in TOOL_HANDLERS below
|
|
16
|
+
* 3. Add row to ai_tool_registry table (defines schema for all clients)
|
|
17
|
+
* That's it — MCP, WhaleChat, workflows, CLI all pick it up automatically.
|
|
18
|
+
*/
|
|
19
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
20
|
+
export declare function flushAuditLogs(supabase: SupabaseClient): Promise<void>;
|
|
21
|
+
export declare function getToolMetrics(): Record<string, {
|
|
22
|
+
invocations: number;
|
|
23
|
+
errors: number;
|
|
24
|
+
avgMs: number;
|
|
25
|
+
lastMs: number;
|
|
26
|
+
}>;
|
|
27
|
+
export interface ToolDef {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
input_schema: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface UserToolRow {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
display_name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
input_schema: Record<string, unknown>;
|
|
38
|
+
execution_type: "rpc" | "http" | "sql";
|
|
39
|
+
is_read_only: boolean;
|
|
40
|
+
requires_approval: boolean;
|
|
41
|
+
http_config: Record<string, unknown> | null;
|
|
42
|
+
rpc_function: string | null;
|
|
43
|
+
sql_template: string | null;
|
|
44
|
+
allowed_tables: string[] | null;
|
|
45
|
+
max_execution_time_ms: number;
|
|
46
|
+
}
|
|
47
|
+
export interface AgentConfig {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
system_prompt: string;
|
|
52
|
+
model: string;
|
|
53
|
+
max_tokens: number;
|
|
54
|
+
max_tool_calls: number;
|
|
55
|
+
temperature: number;
|
|
56
|
+
enabled_tools: string[];
|
|
57
|
+
can_query: boolean;
|
|
58
|
+
can_send: boolean;
|
|
59
|
+
can_modify: boolean;
|
|
60
|
+
tone: string;
|
|
61
|
+
verbosity: string;
|
|
62
|
+
api_key: string | null;
|
|
63
|
+
store_id: string | null;
|
|
64
|
+
context_config: {
|
|
65
|
+
includeLocations?: boolean;
|
|
66
|
+
locationIds?: string[];
|
|
67
|
+
includeCustomers?: boolean;
|
|
68
|
+
customerSegments?: string[];
|
|
69
|
+
max_history_chars?: number;
|
|
70
|
+
max_tool_result_chars?: number;
|
|
71
|
+
max_message_chars?: number;
|
|
72
|
+
} | null;
|
|
73
|
+
}
|
|
74
|
+
export interface ToolLoadResult {
|
|
75
|
+
/** Core tools — always sent to the model (auto_load=true + discover_tools) */
|
|
76
|
+
core: ToolDef[];
|
|
77
|
+
/** Extended tools — only name+description sent; full schema loaded on demand */
|
|
78
|
+
extended: ToolDef[];
|
|
79
|
+
/** All tools combined (backward compat for callers that don't need the split) */
|
|
80
|
+
all: ToolDef[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Load tools from ai_tool_registry, split into core (auto_load=true) and extended.
|
|
84
|
+
* The `discover_tools` meta-tool is always injected into core.
|
|
85
|
+
* Descriptions are truncated to 150 chars at load time.
|
|
86
|
+
*/
|
|
87
|
+
export declare function loadTools(supabase: SupabaseClient, forceRefresh?: boolean): Promise<ToolLoadResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Get pre-computed API-ready tool definitions. Returns frozen objects keyed by name
|
|
90
|
+
* so the agent loop can look up defs without re-mapping every turn.
|
|
91
|
+
* Falls back to building from a ToolDef[] if cache not yet populated.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getCachedToolDefs(tools: ToolDef[]): Array<{
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
input_schema: Record<string, unknown>;
|
|
97
|
+
}>;
|
|
98
|
+
export declare function loadUserTools(supabase: SupabaseClient, storeId: string): Promise<{
|
|
99
|
+
rows: UserToolRow[];
|
|
100
|
+
defs: ToolDef[];
|
|
101
|
+
}>;
|
|
102
|
+
export declare function getUserToolByPrefixedName(rows: UserToolRow[], prefixedName: string): UserToolRow | undefined;
|
|
103
|
+
export declare function getToolsForAgent(agent: AgentConfig, coreTools: ToolDef[], userToolDefs?: ToolDef[]): ToolDef[];
|
|
104
|
+
export type ToolProgressCallback = (toolName: string, progress: unknown) => void;
|
|
105
|
+
type ToolHandler = (sb: SupabaseClient, args: Record<string, unknown>, storeId?: string, onToolProgress?: (progress: unknown) => void) => Promise<{
|
|
106
|
+
success: boolean;
|
|
107
|
+
data?: unknown;
|
|
108
|
+
error?: string;
|
|
109
|
+
}>;
|
|
110
|
+
interface ToolHandlerEntry {
|
|
111
|
+
handler: ToolHandler;
|
|
112
|
+
timeout: number;
|
|
113
|
+
requiresStore: boolean;
|
|
114
|
+
supportsProgress?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Every built-in tool MUST be registered here. This map is the single source
|
|
118
|
+
* of truth for handler routing, timeouts, and store requirements.
|
|
119
|
+
* Adding a tool to ai_tool_registry without an entry here → "Unknown tool" error.
|
|
120
|
+
*/
|
|
121
|
+
export declare const TOOL_HANDLERS: Record<string, ToolHandlerEntry>;
|
|
122
|
+
/** Get all registered built-in tool names */
|
|
123
|
+
export declare function getRegisteredToolNames(): string[];
|
|
124
|
+
/** Called by index.ts after loadTools() to populate the discover_tools cache.
|
|
125
|
+
* Stores full schemas for on-demand loading, plus a lightweight index for the system prompt. */
|
|
126
|
+
export declare function setExtendedToolsCache(tools: ToolDef[]): void;
|
|
127
|
+
/** Get full extended tools with schemas (for discover_tools handler) */
|
|
128
|
+
export declare function getExtendedToolsCache(): ToolDef[];
|
|
129
|
+
/** Get lightweight extended tools index — name + short description only (for system prompt).
|
|
130
|
+
* Avoids serializing full schemas into the prompt. */
|
|
131
|
+
export declare function getExtendedToolsIndex(): Array<{
|
|
132
|
+
name: string;
|
|
133
|
+
description: string;
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Get full tool schemas for specific tool names from the extended tools cache.
|
|
137
|
+
* Used by the agent loop to inject discovered tool schemas into the active tool set.
|
|
138
|
+
* Returns only tools that exist in the cache; unknown names are silently skipped.
|
|
139
|
+
*/
|
|
140
|
+
export declare function getFullToolSchemas(toolNames: string[]): ToolDef[];
|
|
141
|
+
export declare function executeTool(supabase: SupabaseClient, toolName: string, args: Record<string, unknown>, storeId?: string, traceId?: string, userId?: string | null, userEmail?: string | null, source?: string, conversationId?: string, userToolRows?: UserToolRow[], agentId?: string, onToolProgress?: ToolProgressCallback,
|
|
142
|
+
/** Skip per-tool audit when called within a conversation — persistAgentTurn handles it */
|
|
143
|
+
skipAudit?: boolean): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
data?: unknown;
|
|
146
|
+
error?: string;
|
|
147
|
+
}>;
|
|
148
|
+
export declare function loadAgentConfig(supabase: SupabaseClient, agentId: string, storeId?: string): Promise<AgentConfig | null>;
|
|
149
|
+
export {};
|