veryfront 0.1.216 → 0.1.217
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/esm/cli/commands/generate/integration-generator-helpers.d.ts +35 -0
- package/esm/cli/commands/generate/integration-generator-helpers.d.ts.map +1 -0
- package/esm/cli/commands/generate/integration-generator-helpers.js +123 -0
- package/esm/cli/commands/generate/integration-generator.d.ts +1 -2
- package/esm/cli/commands/generate/integration-generator.d.ts.map +1 -1
- package/esm/cli/commands/generate/integration-generator.js +1 -123
- package/esm/cli/commands/knowledge/command-helpers.d.ts +48 -0
- package/esm/cli/commands/knowledge/command-helpers.d.ts.map +1 -0
- package/esm/cli/commands/knowledge/command-helpers.js +216 -0
- package/esm/cli/commands/knowledge/command.d.ts +11 -16
- package/esm/cli/commands/knowledge/command.d.ts.map +1 -1
- package/esm/cli/commands/knowledge/command.js +25 -212
- package/esm/cli/mcp/remote-file-tool-helpers.d.ts +5 -0
- package/esm/cli/mcp/remote-file-tool-helpers.d.ts.map +1 -0
- package/esm/cli/mcp/remote-file-tool-helpers.js +22 -0
- package/esm/cli/mcp/remote-file-tools.d.ts.map +1 -1
- package/esm/cli/mcp/remote-file-tools.js +1 -22
- package/esm/cli/templates/integration-loader-helpers.d.ts +8 -0
- package/esm/cli/templates/integration-loader-helpers.d.ts.map +1 -0
- package/esm/cli/templates/integration-loader-helpers.js +29 -0
- package/esm/cli/templates/integration-loader.d.ts.map +1 -1
- package/esm/cli/templates/integration-loader.js +5 -21
- package/esm/cli/templates/manifest.d.ts +1 -0
- package/esm/cli/templates/manifest.js +2 -1
- package/esm/deno.js +2 -2
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +48 -90
- package/esm/src/chat/ag-ui-helpers.d.ts +17 -0
- package/esm/src/chat/ag-ui-helpers.d.ts.map +1 -0
- package/esm/src/chat/ag-ui-helpers.js +111 -0
- package/esm/src/chat/ag-ui.d.ts.map +1 -1
- package/esm/src/chat/ag-ui.js +1 -111
- package/esm/src/config/schemas/config.schema.d.ts +1 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +11 -0
- package/esm/src/config/schemas/index.d.ts +11 -1
- package/esm/src/config/schemas/index.d.ts.map +1 -1
- package/esm/src/errors/error-registry-helpers.d.ts +6 -0
- package/esm/src/errors/error-registry-helpers.d.ts.map +1 -0
- package/esm/src/errors/error-registry-helpers.js +9 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/error-registry.js +4 -3
- package/esm/src/extensions/factory-loader.d.ts +29 -0
- package/esm/src/extensions/factory-loader.d.ts.map +1 -0
- package/esm/src/extensions/factory-loader.js +63 -0
- package/esm/src/extensions/index.d.ts +16 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +16 -0
- package/esm/src/extensions/orchestrate.d.ts +54 -0
- package/esm/src/extensions/orchestrate.d.ts.map +1 -0
- package/esm/src/extensions/orchestrate.js +116 -0
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +23 -0
- package/esm/src/html/styles-builder/tailwind-plugin-allowlist.d.ts +29 -0
- package/esm/src/html/styles-builder/tailwind-plugin-allowlist.d.ts.map +1 -0
- package/esm/src/html/styles-builder/tailwind-plugin-allowlist.js +48 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader-helpers.d.ts +15 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader-helpers.d.ts.map +1 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader-helpers.js +22 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +0 -2
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +4 -24
- package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.d.ts +19 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.d.ts.map +1 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.js +26 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +4 -20
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +1 -0
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +3 -0
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations.js +4 -7
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.d.ts +28 -0
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.d.ts.map +1 -0
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.js +41 -0
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +1 -4
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +7 -40
- package/esm/src/provider/runtime-loader/tool-input-status.d.ts +17 -0
- package/esm/src/provider/runtime-loader/tool-input-status.d.ts.map +1 -0
- package/esm/src/provider/runtime-loader/tool-input-status.js +155 -0
- package/esm/src/provider/runtime-loader.d.ts +2 -3
- package/esm/src/provider/runtime-loader.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader.js +2 -155
- package/esm/src/rendering/orchestrator/pipeline-helpers.d.ts +8 -0
- package/esm/src/rendering/orchestrator/pipeline-helpers.d.ts.map +1 -0
- package/esm/src/rendering/orchestrator/pipeline-helpers.js +20 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts +0 -3
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +4 -22
- package/esm/src/routing/api/module-loader/loader-helpers.d.ts +10 -0
- package/esm/src/routing/api/module-loader/loader-helpers.d.ts.map +1 -0
- package/esm/src/routing/api/module-loader/loader-helpers.js +62 -0
- package/esm/src/routing/api/module-loader/loader.d.ts +1 -1
- package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.js +2 -60
- package/esm/src/server/bootstrap.d.ts +22 -2
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +67 -5
- package/esm/src/server/dev-ui/manifest.d.ts +2 -0
- package/esm/src/server/dev-ui/manifest.js +3 -1
- package/esm/src/server/handlers/request/api/project-discovery.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/project-discovery.js +14 -8
- package/esm/src/server/production-server.js +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
- package/esm/src/tool/index.d.ts +1 -1
- package/esm/src/tool/index.d.ts.map +1 -1
- package/esm/src/tool/types.d.ts +20 -0
- package/esm/src/tool/types.d.ts.map +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/cli/commands/generate/integration-generator-helpers.ts +185 -0
- package/src/cli/commands/generate/integration-generator.ts +12 -168
- package/src/cli/commands/knowledge/command-helpers.ts +295 -0
- package/src/cli/commands/knowledge/command.ts +33 -259
- package/src/cli/mcp/remote-file-tool-helpers.ts +27 -0
- package/src/cli/mcp/remote-file-tools.ts +6 -28
- package/src/cli/templates/integration-loader-helpers.ts +49 -0
- package/src/cli/templates/integration-loader.ts +10 -28
- package/src/cli/templates/manifest.js +2 -1
- package/src/deno.js +2 -2
- package/src/src/agent/runtime/index.ts +77 -94
- package/src/src/chat/ag-ui-helpers.ts +139 -0
- package/src/src/chat/ag-ui.ts +11 -139
- package/src/src/config/schemas/config.schema.ts +11 -0
- package/src/src/config/schemas/index.ts +15 -1
- package/src/src/errors/error-registry-helpers.ts +23 -0
- package/src/src/errors/error-registry.ts +8 -3
- package/src/src/extensions/factory-loader.ts +76 -0
- package/src/src/extensions/index.ts +20 -0
- package/src/src/extensions/orchestrate.ts +184 -0
- package/src/src/html/styles-builder/plugin-loader.ts +32 -0
- package/src/src/html/styles-builder/tailwind-plugin-allowlist.ts +51 -0
- package/src/src/modules/react-loader/ssr-module-loader/loader-helpers.ts +37 -0
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +8 -39
- package/src/src/platform/adapters/fs/veryfront/adapter-helpers.ts +43 -0
- package/src/src/platform/adapters/fs/veryfront/adapter.ts +8 -22
- package/src/src/platform/adapters/fs/veryfront/read-operations-helpers.ts +4 -0
- package/src/src/platform/adapters/fs/veryfront/read-operations.ts +4 -7
- package/src/src/platform/adapters/fs/veryfront/websocket-manager-helpers.ts +73 -0
- package/src/src/platform/adapters/fs/veryfront/websocket-manager.ts +29 -44
- package/src/src/provider/runtime-loader/tool-input-status.ts +210 -0
- package/src/src/provider/runtime-loader.ts +6 -203
- package/src/src/rendering/orchestrator/pipeline-helpers.ts +35 -0
- package/src/src/rendering/orchestrator/pipeline.ts +8 -35
- package/src/src/routing/api/module-loader/loader-helpers.ts +68 -0
- package/src/src/routing/api/module-loader/loader.ts +8 -65
- package/src/src/server/bootstrap.ts +88 -7
- package/src/src/server/dev-ui/manifest.js +3 -1
- package/src/src/server/handlers/request/api/project-discovery.ts +19 -8
- package/src/src/server/production-server.ts +1 -1
- package/src/src/server/services/rsc/endpoints/rsc-bundles.generated.ts +2 -2
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/tool/index.ts +1 -0
- package/src/src/tool/types.ts +21 -0
- package/src/src/utils/version-constant.ts +1 -1
|
@@ -59,6 +59,42 @@ function getSkillActivationRequiredError(toolName) {
|
|
|
59
59
|
return `Tool "${toolName}" cannot run before load-skill succeeds in the same step. ` +
|
|
60
60
|
`Call "${LOAD_SKILL_TOOL_ID}" first to establish the active skill context.`;
|
|
61
61
|
}
|
|
62
|
+
function warnLocalToolSkipping(agentId, modelId) {
|
|
63
|
+
logger.warn(`Agent "${agentId}" has tools configured but is using local model "${modelId}". ` +
|
|
64
|
+
"Local models don't support tool calling — tools will be skipped. " +
|
|
65
|
+
"Set VERYFRONT_API_TOKEN and VERYFRONT_PROJECT_SLUG, or configure " +
|
|
66
|
+
"OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY for full tool support.");
|
|
67
|
+
}
|
|
68
|
+
function createToolResultMessage(toolCallId, toolName, result) {
|
|
69
|
+
return {
|
|
70
|
+
id: `tool_${toolCallId}`,
|
|
71
|
+
role: "tool",
|
|
72
|
+
parts: [
|
|
73
|
+
{
|
|
74
|
+
type: "tool-result",
|
|
75
|
+
toolCallId,
|
|
76
|
+
toolName,
|
|
77
|
+
result,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
timestamp: Date.now(),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function createToolErrorMessage(toolCallId, toolName, error) {
|
|
84
|
+
return {
|
|
85
|
+
id: `tool_error_${toolCallId}`,
|
|
86
|
+
role: "tool",
|
|
87
|
+
parts: [
|
|
88
|
+
{
|
|
89
|
+
type: "tool-result",
|
|
90
|
+
toolCallId,
|
|
91
|
+
toolName,
|
|
92
|
+
result: { error },
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
timestamp: Date.now(),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
62
98
|
export function collectFinalStreamToolResults(state) {
|
|
63
99
|
const finalToolResults = new Map();
|
|
64
100
|
for (const toolResult of state.toolResults) {
|
|
@@ -405,10 +441,7 @@ export class AgentRuntime {
|
|
|
405
441
|
// Local models can't reliably do function calling — skip tools gracefully.
|
|
406
442
|
const isLocal = isLocalModelRuntime(languageModel);
|
|
407
443
|
if (isLocal && this.config.tools) {
|
|
408
|
-
|
|
409
|
-
"Local models don't support tool calling — tools will be skipped. " +
|
|
410
|
-
"Set VERYFRONT_API_TOKEN and VERYFRONT_PROJECT_SLUG, or configure " +
|
|
411
|
-
"OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY for full tool support.");
|
|
444
|
+
warnLocalToolSkipping(this.id, effectiveModel);
|
|
412
445
|
}
|
|
413
446
|
// Request-scoped skill policy (not class-level mutable state)
|
|
414
447
|
let activeSkillPolicy;
|
|
@@ -483,21 +516,9 @@ export class AgentRuntime {
|
|
|
483
516
|
await this.memory.add(assistantMessage);
|
|
484
517
|
const generatedToolResults = collectGeneratedToolResults(response.toolResults);
|
|
485
518
|
const persistGeneratedToolResult = async (generatedToolResult) => {
|
|
486
|
-
const toolResultMessage =
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
parts: [
|
|
490
|
-
{
|
|
491
|
-
type: "tool-result",
|
|
492
|
-
toolCallId: generatedToolResult.toolCallId,
|
|
493
|
-
toolName: generatedToolResult.toolName,
|
|
494
|
-
result: generatedToolResult.isError === true
|
|
495
|
-
? { error: stringifyToolError(generatedToolResult.result) }
|
|
496
|
-
: generatedToolResult.result,
|
|
497
|
-
},
|
|
498
|
-
],
|
|
499
|
-
timestamp: Date.now(),
|
|
500
|
-
};
|
|
519
|
+
const toolResultMessage = createToolResultMessage(generatedToolResult.toolCallId, generatedToolResult.toolName, generatedToolResult.isError === true
|
|
520
|
+
? { error: stringifyToolError(generatedToolResult.result) }
|
|
521
|
+
: generatedToolResult.result);
|
|
501
522
|
currentMessages.push(toolResultMessage);
|
|
502
523
|
await this.memory.add(toolResultMessage);
|
|
503
524
|
};
|
|
@@ -577,19 +598,7 @@ export class AgentRuntime {
|
|
|
577
598
|
activeSkillPolicy = extractSkillPolicy(result);
|
|
578
599
|
mustLoadSkillFirst = false;
|
|
579
600
|
}
|
|
580
|
-
const toolResultMessage =
|
|
581
|
-
id: `tool_${tc.toolCallId}`,
|
|
582
|
-
role: "tool",
|
|
583
|
-
parts: [
|
|
584
|
-
{
|
|
585
|
-
type: "tool-result",
|
|
586
|
-
toolCallId: tc.toolCallId,
|
|
587
|
-
toolName: tc.toolName,
|
|
588
|
-
result,
|
|
589
|
-
},
|
|
590
|
-
],
|
|
591
|
-
timestamp: Date.now(),
|
|
592
|
-
};
|
|
601
|
+
const toolResultMessage = createToolResultMessage(tc.toolCallId, tc.toolName, result);
|
|
593
602
|
currentMessages.push(toolResultMessage);
|
|
594
603
|
await this.memory.add(toolResultMessage);
|
|
595
604
|
}
|
|
@@ -597,19 +606,7 @@ export class AgentRuntime {
|
|
|
597
606
|
toolCall.status = "error";
|
|
598
607
|
toolCall.error = error instanceof Error ? error.message : String(error);
|
|
599
608
|
setSpanAttributes(toolSpan, { error: true, "error.message": toolCall.error });
|
|
600
|
-
const errorMessage =
|
|
601
|
-
id: `tool_error_${tc.toolCallId}`,
|
|
602
|
-
role: "tool",
|
|
603
|
-
parts: [
|
|
604
|
-
{
|
|
605
|
-
type: "tool-result",
|
|
606
|
-
toolCallId: tc.toolCallId,
|
|
607
|
-
toolName: tc.toolName,
|
|
608
|
-
result: { error: toolCall.error },
|
|
609
|
-
},
|
|
610
|
-
],
|
|
611
|
-
timestamp: Date.now(),
|
|
612
|
-
};
|
|
609
|
+
const errorMessage = createToolErrorMessage(tc.toolCallId, tc.toolName, toolCall.error);
|
|
613
610
|
currentMessages.push(errorMessage);
|
|
614
611
|
await this.memory.add(errorMessage);
|
|
615
612
|
}
|
|
@@ -646,10 +643,7 @@ export class AgentRuntime {
|
|
|
646
643
|
// Local models can't reliably do function calling — skip tools gracefully.
|
|
647
644
|
const isLocalStreaming = isLocalModelRuntime(languageModel);
|
|
648
645
|
if (isLocalStreaming && this.config.tools) {
|
|
649
|
-
|
|
650
|
-
"Local models don't support tool calling — tools will be skipped. " +
|
|
651
|
-
"Set VERYFRONT_API_TOKEN and VERYFRONT_PROJECT_SLUG, or configure " +
|
|
652
|
-
"OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY for full tool support.");
|
|
646
|
+
warnLocalToolSkipping(this.id, effectiveModel);
|
|
653
647
|
}
|
|
654
648
|
// Request-scoped skill policy (not class-level mutable state)
|
|
655
649
|
let activeSkillPolicy;
|
|
@@ -746,21 +740,9 @@ export class AgentRuntime {
|
|
|
746
740
|
if (currentStepToolResults.has(toolResult.toolCallId)) {
|
|
747
741
|
return;
|
|
748
742
|
}
|
|
749
|
-
const toolResultMessage =
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
parts: [
|
|
753
|
-
{
|
|
754
|
-
type: "tool-result",
|
|
755
|
-
toolCallId: toolResult.toolCallId,
|
|
756
|
-
toolName: toolResult.toolName,
|
|
757
|
-
result: toolResult.error === undefined
|
|
758
|
-
? toolResult.output
|
|
759
|
-
: { error: stringifyToolError(toolResult.error) },
|
|
760
|
-
},
|
|
761
|
-
],
|
|
762
|
-
timestamp: Date.now(),
|
|
763
|
-
};
|
|
743
|
+
const toolResultMessage = createToolResultMessage(toolResult.toolCallId, toolResult.toolName, toolResult.error === undefined
|
|
744
|
+
? toolResult.output
|
|
745
|
+
: { error: stringifyToolError(toolResult.error) });
|
|
764
746
|
currentMessages.push(toolResultMessage);
|
|
765
747
|
await this.memory.add(toolResultMessage);
|
|
766
748
|
currentStepToolResults.set(toolResult.toolCallId, toolResultMessage.parts[0]);
|
|
@@ -869,19 +851,7 @@ export class AgentRuntime {
|
|
|
869
851
|
output: result,
|
|
870
852
|
...(dynamic ? { dynamic: true } : {}),
|
|
871
853
|
});
|
|
872
|
-
const toolResultMessage =
|
|
873
|
-
id: `tool_${tc.id}`,
|
|
874
|
-
role: "tool",
|
|
875
|
-
parts: [
|
|
876
|
-
{
|
|
877
|
-
type: "tool-result",
|
|
878
|
-
toolCallId: tc.id,
|
|
879
|
-
toolName: tc.name,
|
|
880
|
-
result,
|
|
881
|
-
},
|
|
882
|
-
],
|
|
883
|
-
timestamp: Date.now(),
|
|
884
|
-
};
|
|
854
|
+
const toolResultMessage = createToolResultMessage(tc.id, tc.name, result);
|
|
885
855
|
if (!currentStepToolResults.has(tc.id)) {
|
|
886
856
|
currentMessages.push(toolResultMessage);
|
|
887
857
|
await this.memory.add(toolResultMessage);
|
|
@@ -923,19 +893,7 @@ export class AgentRuntime {
|
|
|
923
893
|
errorText: errorStr,
|
|
924
894
|
...(dynamic ? { dynamic: true } : {}),
|
|
925
895
|
});
|
|
926
|
-
const errorMessage =
|
|
927
|
-
id: `tool_error_${toolCall.id}`,
|
|
928
|
-
role: "tool",
|
|
929
|
-
parts: [
|
|
930
|
-
{
|
|
931
|
-
type: "tool-result",
|
|
932
|
-
toolCallId: toolCall.id,
|
|
933
|
-
toolName: toolCall.name,
|
|
934
|
-
result: { error: errorStr },
|
|
935
|
-
},
|
|
936
|
-
],
|
|
937
|
-
timestamp: Date.now(),
|
|
938
|
-
};
|
|
896
|
+
const errorMessage = createToolErrorMessage(toolCall.id, toolCall.name, errorStr);
|
|
939
897
|
currentMessages.push(errorMessage);
|
|
940
898
|
await this.memory.add(errorMessage);
|
|
941
899
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ChatFinishReason, ChatStreamEvent } from "./protocol.js";
|
|
2
|
+
type ParsedRenderableCustomChunk = Extract<ChatStreamEvent, {
|
|
3
|
+
type: "source-url" | "source-document" | "file";
|
|
4
|
+
}>;
|
|
5
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
6
|
+
export declare function normalizeNewlines(value: string): string;
|
|
7
|
+
export declare function toRenderableCustomChunk(value: unknown): ParsedRenderableCustomChunk | null;
|
|
8
|
+
export declare function parseSerializedToolResult(value: unknown): unknown;
|
|
9
|
+
export declare function formatToolErrorText(result: unknown): string;
|
|
10
|
+
export declare function mapFinishReason(reason: string | undefined): ChatFinishReason | undefined;
|
|
11
|
+
export declare function splitSseFrames(value: string): {
|
|
12
|
+
frames: string[];
|
|
13
|
+
remainder: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function isCommentOnlySseFrame(raw: string): boolean;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ag-ui-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ag-ui-helpers.d.ts","sourceRoot":"","sources":["../../../src/src/chat/ag-ui-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEvE,KAAK,2BAA2B,GAAG,OAAO,CACxC,eAAe,EACf;IAAE,IAAI,EAAE,YAAY,GAAG,iBAAiB,GAAG,MAAM,CAAA;CAAE,CACpD,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,GAAG,IAAI,CA2C1F;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAsBjE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAgB3D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAsBxF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAMrF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAI1D"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export function isRecord(value) {
|
|
2
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
}
|
|
4
|
+
export function normalizeNewlines(value) {
|
|
5
|
+
return value.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
6
|
+
}
|
|
7
|
+
export function toRenderableCustomChunk(value) {
|
|
8
|
+
if (!isRecord(value) || typeof value.type !== "string") {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (value.type === "source-url" && typeof value.url === "string") {
|
|
12
|
+
return {
|
|
13
|
+
type: "source-url",
|
|
14
|
+
sourceId: typeof value.sourceId === "string" && value.sourceId.length > 0
|
|
15
|
+
? value.sourceId
|
|
16
|
+
: value.url,
|
|
17
|
+
url: value.url,
|
|
18
|
+
...(typeof value.title === "string" ? { title: value.title } : {}),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (value.type === "source-document" &&
|
|
22
|
+
typeof value.sourceId === "string" &&
|
|
23
|
+
typeof value.mediaType === "string" &&
|
|
24
|
+
typeof value.title === "string") {
|
|
25
|
+
return {
|
|
26
|
+
type: "source-document",
|
|
27
|
+
sourceId: value.sourceId,
|
|
28
|
+
mediaType: value.mediaType,
|
|
29
|
+
title: value.title,
|
|
30
|
+
...(typeof value.filename === "string" ? { filename: value.filename } : {}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (value.type === "file" && typeof value.url === "string" && typeof value.mediaType === "string") {
|
|
34
|
+
return {
|
|
35
|
+
type: "file",
|
|
36
|
+
url: value.url,
|
|
37
|
+
mediaType: value.mediaType,
|
|
38
|
+
...(typeof value.filename === "string" ? { filename: value.filename } : {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
export function parseSerializedToolResult(value) {
|
|
44
|
+
if (typeof value !== "string") {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
const trimmed = value.trim();
|
|
48
|
+
if (!trimmed.startsWith("{") &&
|
|
49
|
+
!trimmed.startsWith("[") &&
|
|
50
|
+
trimmed !== "null" &&
|
|
51
|
+
trimmed !== "true" &&
|
|
52
|
+
trimmed !== "false" &&
|
|
53
|
+
!/^[-]?\d+(\.\d+)?$/.test(trimmed)) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return JSON.parse(trimmed);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function formatToolErrorText(result) {
|
|
64
|
+
if (typeof result === "string" && result.length > 0) {
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
if (isRecord(result)) {
|
|
68
|
+
if (typeof result.error === "string" && result.error.length > 0) {
|
|
69
|
+
return result.error;
|
|
70
|
+
}
|
|
71
|
+
if (typeof result.message === "string" && result.message.length > 0) {
|
|
72
|
+
return result.message;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return JSON.stringify(result ?? { error: "Tool execution failed" });
|
|
76
|
+
}
|
|
77
|
+
export function mapFinishReason(reason) {
|
|
78
|
+
if (!reason)
|
|
79
|
+
return undefined;
|
|
80
|
+
switch (reason.trim().toLowerCase()) {
|
|
81
|
+
case "stop":
|
|
82
|
+
case "end_turn":
|
|
83
|
+
case "stop_sequence":
|
|
84
|
+
return "stop";
|
|
85
|
+
case "length":
|
|
86
|
+
case "max_tokens":
|
|
87
|
+
return "length";
|
|
88
|
+
case "tool_calls":
|
|
89
|
+
case "tool_use":
|
|
90
|
+
return "tool-calls";
|
|
91
|
+
case "content_filter":
|
|
92
|
+
case "content-filter":
|
|
93
|
+
return "content-filter";
|
|
94
|
+
case "error":
|
|
95
|
+
return "error";
|
|
96
|
+
default:
|
|
97
|
+
return "other";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export function splitSseFrames(value) {
|
|
101
|
+
const blocks = value.split("\n\n");
|
|
102
|
+
return {
|
|
103
|
+
frames: blocks.slice(0, -1),
|
|
104
|
+
remainder: blocks.at(-1) ?? "",
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export function isCommentOnlySseFrame(raw) {
|
|
108
|
+
return raw
|
|
109
|
+
.split("\n")
|
|
110
|
+
.every((line) => line.trim().length === 0 || line.trimStart().startsWith(":"));
|
|
111
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag-ui.d.ts","sourceRoot":"","sources":["../../../src/src/chat/ag-ui.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ag-ui.d.ts","sourceRoot":"","sources":["../../../src/src/chat/ag-ui.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAEhE,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,sBAAsB,EAAE,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CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChF,GACL,yBAAyB,CAU3B;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAE,MAAM,GACZ,gBAAgB,CAuClB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,GAAG,gBAAgB,CAWpF"}
|
package/esm/src/chat/ag-ui.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mergeToolInputDelta, parseToolInputObject } from "../agent/data-stream.js";
|
|
2
|
+
import { formatToolErrorText, isCommentOnlySseFrame, isRecord, mapFinishReason, normalizeNewlines, parseSerializedToolResult, splitSseFrames, toRenderableCustomChunk, } from "./ag-ui-helpers.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
export const AgUiRunFinishedMetadataSchema = z.object({
|
|
4
5
|
provider: z.string().optional(),
|
|
@@ -230,105 +231,6 @@ export const AgUiWireEventSchema = z.discriminatedUnion("eventName", [
|
|
|
230
231
|
}),
|
|
231
232
|
}),
|
|
232
233
|
]);
|
|
233
|
-
function isRecord(value) {
|
|
234
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
235
|
-
}
|
|
236
|
-
function normalizeNewlines(value) {
|
|
237
|
-
return value.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
238
|
-
}
|
|
239
|
-
function toRenderableCustomChunk(value) {
|
|
240
|
-
if (!isRecord(value) || typeof value.type !== "string") {
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
243
|
-
if (value.type === "source-url" && typeof value.url === "string") {
|
|
244
|
-
return {
|
|
245
|
-
type: "source-url",
|
|
246
|
-
sourceId: typeof value.sourceId === "string" && value.sourceId.length > 0
|
|
247
|
-
? value.sourceId
|
|
248
|
-
: value.url,
|
|
249
|
-
url: value.url,
|
|
250
|
-
...(typeof value.title === "string" ? { title: value.title } : {}),
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
if (value.type === "source-document" &&
|
|
254
|
-
typeof value.sourceId === "string" &&
|
|
255
|
-
typeof value.mediaType === "string" &&
|
|
256
|
-
typeof value.title === "string") {
|
|
257
|
-
return {
|
|
258
|
-
type: "source-document",
|
|
259
|
-
sourceId: value.sourceId,
|
|
260
|
-
mediaType: value.mediaType,
|
|
261
|
-
title: value.title,
|
|
262
|
-
...(typeof value.filename === "string" ? { filename: value.filename } : {}),
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
if (value.type === "file" && typeof value.url === "string" && typeof value.mediaType === "string") {
|
|
266
|
-
return {
|
|
267
|
-
type: "file",
|
|
268
|
-
url: value.url,
|
|
269
|
-
mediaType: value.mediaType,
|
|
270
|
-
...(typeof value.filename === "string" ? { filename: value.filename } : {}),
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
return null;
|
|
274
|
-
}
|
|
275
|
-
function parseSerializedToolResult(value) {
|
|
276
|
-
if (typeof value !== "string") {
|
|
277
|
-
return value;
|
|
278
|
-
}
|
|
279
|
-
const trimmed = value.trim();
|
|
280
|
-
if (!trimmed.startsWith("{") &&
|
|
281
|
-
!trimmed.startsWith("[") &&
|
|
282
|
-
trimmed !== "null" &&
|
|
283
|
-
trimmed !== "true" &&
|
|
284
|
-
trimmed !== "false" &&
|
|
285
|
-
!/^[-]?\d+(\.\d+)?$/.test(trimmed)) {
|
|
286
|
-
return value;
|
|
287
|
-
}
|
|
288
|
-
try {
|
|
289
|
-
return JSON.parse(trimmed);
|
|
290
|
-
}
|
|
291
|
-
catch {
|
|
292
|
-
return value;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function formatToolErrorText(result) {
|
|
296
|
-
if (typeof result === "string" && result.length > 0) {
|
|
297
|
-
return result;
|
|
298
|
-
}
|
|
299
|
-
if (isRecord(result)) {
|
|
300
|
-
if (typeof result.error === "string" && result.error.length > 0) {
|
|
301
|
-
return result.error;
|
|
302
|
-
}
|
|
303
|
-
if (typeof result.message === "string" && result.message.length > 0) {
|
|
304
|
-
return result.message;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
return JSON.stringify(result ?? { error: "Tool execution failed" });
|
|
308
|
-
}
|
|
309
|
-
function mapFinishReason(reason) {
|
|
310
|
-
if (!reason)
|
|
311
|
-
return undefined;
|
|
312
|
-
switch (reason.trim().toLowerCase()) {
|
|
313
|
-
case "stop":
|
|
314
|
-
case "end_turn":
|
|
315
|
-
case "stop_sequence":
|
|
316
|
-
return "stop";
|
|
317
|
-
case "length":
|
|
318
|
-
case "max_tokens":
|
|
319
|
-
return "length";
|
|
320
|
-
case "tool_calls":
|
|
321
|
-
case "tool_use":
|
|
322
|
-
return "tool-calls";
|
|
323
|
-
case "content_filter":
|
|
324
|
-
case "content-filter":
|
|
325
|
-
return "content-filter";
|
|
326
|
-
case "error":
|
|
327
|
-
return "error";
|
|
328
|
-
default:
|
|
329
|
-
return "other";
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
234
|
function getReasoningPartId(state, payload, phase) {
|
|
333
235
|
if (typeof payload.id === "string" && payload.id.length > 0) {
|
|
334
236
|
return payload.id;
|
|
@@ -350,18 +252,6 @@ function getReasoningPartId(state, payload, phase) {
|
|
|
350
252
|
}
|
|
351
253
|
return fallbackId;
|
|
352
254
|
}
|
|
353
|
-
function splitSseFrames(value) {
|
|
354
|
-
const blocks = value.split("\n\n");
|
|
355
|
-
return {
|
|
356
|
-
frames: blocks.slice(0, -1),
|
|
357
|
-
remainder: blocks.at(-1) ?? "",
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
function isCommentOnlySseFrame(raw) {
|
|
361
|
-
return raw
|
|
362
|
-
.split("\n")
|
|
363
|
-
.every((line) => line.trim().length === 0 || line.trimStart().startsWith(":"));
|
|
364
|
-
}
|
|
365
255
|
function parseAgUiWireEvent(frame, input) {
|
|
366
256
|
if (frame.data === "[DONE]" || !frame.event || !frame.data) {
|
|
367
257
|
return null;
|
|
@@ -330,6 +330,7 @@ export declare const veryfrontConfigSchema: z.ZodObject<{
|
|
|
330
330
|
perUser: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
331
331
|
tools: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
332
332
|
}, z.core.$strip>>>>>;
|
|
333
|
+
extensions: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnknown>>>;
|
|
333
334
|
openapi: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
334
335
|
enabled: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
335
336
|
docs: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/config/schemas/config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"config.schema.d.ts","sourceRoot":"","sources":["../../../../src/src/config/schemas/config.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwgBtB,CAAC;AAGb,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGzE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAyBvE;AAQD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAEhF"}
|
|
@@ -480,6 +480,17 @@ export const veryfrontConfigSchema = z
|
|
|
480
480
|
.partial()
|
|
481
481
|
.optional())
|
|
482
482
|
.optional(),
|
|
483
|
+
/**
|
|
484
|
+
* Extensions registered for this project.
|
|
485
|
+
*
|
|
486
|
+
* Each entry is either a fully-materialized `Extension` object or a
|
|
487
|
+
* disable directive `{ name, enabled: false }` that vetoes an extension
|
|
488
|
+
* discovered from a lower-priority source. The runtime type is
|
|
489
|
+
* tightened at the `veryfront/extensions` barrel — we keep this as
|
|
490
|
+
* `z.unknown()` here to avoid pulling the extensions module into the
|
|
491
|
+
* config layer (would introduce a circular import).
|
|
492
|
+
*/
|
|
493
|
+
extensions: z.array(z.unknown()).optional(),
|
|
483
494
|
/** OpenAPI documentation configuration */
|
|
484
495
|
openapi: z
|
|
485
496
|
.object({
|
|
@@ -3,5 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module config/schemas
|
|
5
5
|
*/
|
|
6
|
-
export { findUnknownTopLevelKeys, validateVeryfrontConfig, type
|
|
6
|
+
export { findUnknownTopLevelKeys, validateVeryfrontConfig, type VeryfrontConfigInput, veryfrontConfigSchema, } from "./config.schema.js";
|
|
7
|
+
import type { VeryfrontConfig as BaseVeryfrontConfig } from "./config.schema.js";
|
|
8
|
+
import type { ExtensionConfigEntry } from "../../extensions/types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Project configuration. The underlying zod schema stores `extensions` as
|
|
11
|
+
* `unknown[]`; this tightened alias surfaces the expected
|
|
12
|
+
* `ExtensionConfigEntry[]` shape to TypeScript consumers.
|
|
13
|
+
*/
|
|
14
|
+
export type VeryfrontConfig = Omit<BaseVeryfrontConfig, "extensions"> & {
|
|
15
|
+
extensions?: ExtensionConfigEntry[];
|
|
16
|
+
};
|
|
7
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/config/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/config/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,GACvC;IAAE,UAAU,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ErrorCategory, RegisteredError } from "./types.js";
|
|
2
|
+
export type ErrorRegistryMap = Record<string, RegisteredError>;
|
|
3
|
+
export declare function getRegistryEntry<Registry extends ErrorRegistryMap, Slug extends keyof Registry>(registry: Registry, slug: Slug): Registry[Slug];
|
|
4
|
+
export declare function getRegistryEntriesByCategory(registry: ErrorRegistryMap, category: ErrorCategory): RegisteredError[];
|
|
5
|
+
export declare function getRegistrySlugs<Registry extends ErrorRegistryMap>(registry: Registry): Array<keyof Registry>;
|
|
6
|
+
//# sourceMappingURL=error-registry-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-registry-helpers.d.ts","sourceRoot":"","sources":["../../../src/src/errors/error-registry-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE/D,wBAAgB,gBAAgB,CAC9B,QAAQ,SAAS,gBAAgB,EACjC,IAAI,SAAS,MAAM,QAAQ,EAC3B,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAEhD;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,aAAa,GACtB,eAAe,EAAE,CAEnB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,SAAS,gBAAgB,EAChE,QAAQ,EAAE,QAAQ,GACjB,KAAK,CAAC,MAAM,QAAQ,CAAC,CAEvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function getRegistryEntry(registry, slug) {
|
|
2
|
+
return registry[slug];
|
|
3
|
+
}
|
|
4
|
+
export function getRegistryEntriesByCategory(registry, category) {
|
|
5
|
+
return Object.values(registry).filter((error) => error.category === category);
|
|
6
|
+
}
|
|
7
|
+
export function getRegistrySlugs(registry) {
|
|
8
|
+
return Object.keys(registry);
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-registry.d.ts","sourceRoot":"","sources":["../../../src/src/errors/error-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,aAAa,0CAE1D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,SAAS,EAAE,CAEzC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getRegistryEntriesByCategory, getRegistryEntry, getRegistrySlugs, } from "./error-registry-helpers.js";
|
|
1
2
|
import { defineError } from "./types.js";
|
|
2
3
|
// =============================================================================
|
|
3
4
|
// CONFIG - Configuration & environment errors
|
|
@@ -696,17 +697,17 @@ export const ERROR_REGISTRY = {
|
|
|
696
697
|
* Get an error definition by slug
|
|
697
698
|
*/
|
|
698
699
|
export function getErrorBySlug(slug) {
|
|
699
|
-
return ERROR_REGISTRY
|
|
700
|
+
return getRegistryEntry(ERROR_REGISTRY, slug);
|
|
700
701
|
}
|
|
701
702
|
/**
|
|
702
703
|
* Get all errors in a category
|
|
703
704
|
*/
|
|
704
705
|
export function getErrorsByCategory(category) {
|
|
705
|
-
return
|
|
706
|
+
return getRegistryEntriesByCategory(ERROR_REGISTRY, category);
|
|
706
707
|
}
|
|
707
708
|
/**
|
|
708
709
|
* Get all registered slugs
|
|
709
710
|
*/
|
|
710
711
|
export function getAllSlugs() {
|
|
711
|
-
return
|
|
712
|
+
return getRegistrySlugs(ERROR_REGISTRY);
|
|
712
713
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic factory loader.
|
|
3
|
+
*
|
|
4
|
+
* Loads an extension factory from a filesystem path by dynamic import,
|
|
5
|
+
* invokes it, and wraps the result as a `ResolvedExtension`.
|
|
6
|
+
*
|
|
7
|
+
* @module extensions/factory-loader
|
|
8
|
+
*/
|
|
9
|
+
import type { ExtensionSource, ResolvedExtension } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Dynamically import an extension factory from `path` and resolve it.
|
|
12
|
+
*
|
|
13
|
+
* `path` may be either an absolute filesystem path (for project and
|
|
14
|
+
* local-file sources) or a bare module specifier (for `package` source).
|
|
15
|
+
* Absolute paths are converted to `file://` URLs; bare specifiers are
|
|
16
|
+
* passed through so the runtime's module resolver can find them.
|
|
17
|
+
*
|
|
18
|
+
* The module must `export default` an `ExtensionFactory` (a function that
|
|
19
|
+
* returns an `Extension`). On any error — missing default export, default
|
|
20
|
+
* export that is not a function, factory throw, or import failure — this
|
|
21
|
+
* throws `EXTENSION_VALIDATION_ERROR` with a `detail` field that names the
|
|
22
|
+
* path and what went wrong.
|
|
23
|
+
*
|
|
24
|
+
* @param path Absolute filesystem path or bare module specifier.
|
|
25
|
+
* @param source Where the extension was discovered (drives merge priority).
|
|
26
|
+
* @param config Optional config forwarded to the factory.
|
|
27
|
+
*/
|
|
28
|
+
export declare function loadExtensionFactory(path: string, source: ExtensionSource, config?: unknown): Promise<ResolvedExtension>;
|
|
29
|
+
//# sourceMappingURL=factory-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-loader.d.ts","sourceRoot":"","sources":["../../../src/src/extensions/factory-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAA+B,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAElG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,EACvB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,iBAAiB,CAAC,CAwC5B"}
|