@valerypopoff/rivet2-core 2.17.0 → 2.19.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/dist/cjs/bundle.cjs +3093 -1440
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/interpolationRuntime.cjs +40 -4
- package/dist/cjs/interpolationRuntime.cjs.map +2 -2
- package/dist/cjs/serialization.cjs +1880 -0
- package/dist/cjs/serialization.cjs.map +7 -0
- package/dist/cjs/webAppRuntime.cjs +168 -6
- package/dist/cjs/webAppRuntime.cjs.map +3 -3
- package/dist/esm/api/processSettings.js +1 -0
- package/dist/esm/exports.js +2 -0
- package/dist/esm/model/AgentResponseTrace.js +99 -34
- package/dist/esm/model/AgentResponseTracePresentation.js +130 -0
- package/dist/esm/model/DataValue.js +11 -2
- package/dist/esm/model/GlobalVariables.js +2 -1
- package/dist/esm/model/GraphBoundaryEffects.js +38 -1
- package/dist/esm/model/GraphExecutionState.js +81 -0
- package/dist/esm/model/GraphProcessor.js +621 -942
- package/dist/esm/model/GraphSchedulerBoundaryState.js +64 -0
- package/dist/esm/model/Nodes.js +5 -0
- package/dist/esm/model/ProjectBundle.js +23 -10
- package/dist/esm/model/ProjectBundleRuntime.js +54 -0
- package/dist/esm/model/SchedulerBoundaryPlanner.js +233 -0
- package/dist/esm/model/SubprocessorBridge.js +125 -87
- package/dist/esm/model/ToolCallContinuationCoordinator.js +1 -1
- package/dist/esm/model/chat-v2/aiSdkBridge.js +15 -12
- package/dist/esm/model/chat-v2/chatV2CallObserver.js +2 -4
- package/dist/esm/model/chat-v2/chatV2CredentialNames.js +5 -1
- package/dist/esm/model/chat-v2/chatV2Outputs.js +2 -2
- package/dist/esm/model/chat-v2/chatV2Pipeline.js +11 -1
- package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +3 -2
- package/dist/esm/model/chat-v2/chatV2ProviderRegistry.js +46 -6
- package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +7 -0
- package/dist/esm/model/chat-v2/chatV2UsageAccounting.js +10 -0
- package/dist/esm/model/chat-v2/llmChatV2Body.js +2 -2
- package/dist/esm/model/chat-v2/llmChatV2CacheBoundary.js +5 -2
- package/dist/esm/model/chat-v2/llmChatV2NodeData.js +1 -0
- package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +18 -8
- package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +10 -2
- package/dist/esm/model/chat-v2/llmInvocationResultProjector.js +17 -0
- package/dist/esm/model/chat-v2/llmModelCandidate.js +2 -1
- package/dist/esm/model/chat-v2/llmProfile.js +2 -1
- package/dist/esm/model/chat-v2/llmProfileBody.js +9 -0
- package/dist/esm/model/chat-v2/llmProfileFallback.js +7 -4
- package/dist/esm/model/chat-v2/llmProfileFieldRegistry.js +1 -0
- package/dist/esm/model/chat-v2/llmProfileHealthStore.js +16 -3
- package/dist/esm/model/chat-v2/messageConverter.js +18 -16
- package/dist/esm/model/chat-v2/modelRegistry.js +14 -4
- package/dist/esm/model/chat-v2/openRouterModel.js +73 -0
- package/dist/esm/model/chat-v2/parallelToolCalls.js +2 -0
- package/dist/esm/model/chat-v2/providerOptions.js +30 -25
- package/dist/esm/model/classifier/credentials.js +13 -3
- package/dist/esm/model/classifier/limits.js +33 -3
- package/dist/esm/model/classifier/perplexity.js +63 -0
- package/dist/esm/model/classifier/profile.js +151 -0
- package/dist/esm/model/classifier/profileExecution.js +294 -0
- package/dist/esm/model/classifier/providers.js +217 -30
- package/dist/esm/model/classifier/state.js +4 -1
- package/dist/esm/model/classifier/types.js +11 -1
- package/dist/esm/model/nodeRunFailure.js +8 -1
- package/dist/esm/model/nodes/CallGraphNode.js +6 -0
- package/dist/esm/model/nodes/ClassifierEvaluateNode.js +250 -59
- package/dist/esm/model/nodes/ClassifierProfileNode.js +133 -0
- package/dist/esm/model/nodes/DelegateFunctionCallNode.js +1 -1
- package/dist/esm/model/nodes/LLMChatV2Node.js +2 -1
- package/dist/esm/model/nodes/SubGraphNode.js +3 -0
- package/dist/esm/model/nodes/toolCallDelegation.js +5 -1
- package/dist/esm/model/profileSuspensionHints.js +8 -0
- package/dist/esm/serialization.js +2 -0
- package/dist/esm/utils/coerceType.js +11 -1
- package/dist/esm/webAppRuntime.js +1 -0
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/model/AgentResponseTrace.d.ts +15 -4
- package/dist/types/model/AgentResponseTracePresentation.d.ts +15 -0
- package/dist/types/model/DataValue.d.ts +12 -8
- package/dist/types/model/ExecutorProtocol.d.ts +7 -0
- package/dist/types/model/GraphBoundaryEffects.d.ts +10 -1
- package/dist/types/model/GraphExecutionState.d.ts +68 -0
- package/dist/types/model/GraphProcessor.d.ts +1 -0
- package/dist/types/model/GraphSchedulerBoundaryState.d.ts +96 -0
- package/dist/types/model/Nodes.d.ts +7 -4
- package/dist/types/model/ProcessContext.d.ts +12 -3
- package/dist/types/model/ProjectBundle.d.ts +9 -4
- package/dist/types/model/ProjectBundleRuntime.d.ts +24 -0
- package/dist/types/model/RivetUIContext.d.ts +1 -1
- package/dist/types/model/SchedulerBoundaryPlanner.d.ts +42 -0
- package/dist/types/model/Settings.d.ts +1 -0
- package/dist/types/model/SubprocessorBridge.d.ts +2 -0
- package/dist/types/model/chat-v2/chatV2CredentialNames.d.ts +4 -0
- package/dist/types/model/chat-v2/chatV2Outputs.d.ts +1 -1
- package/dist/types/model/chat-v2/chatV2ProviderRegistry.d.ts +79 -1
- package/dist/types/model/chat-v2/chatV2ProviderTypes.d.ts +1 -1
- package/dist/types/model/chat-v2/chatV2UsageAccounting.d.ts +2 -0
- package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +2 -1
- package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +2 -0
- package/dist/types/model/chat-v2/llmInvocationResultProjector.d.ts +2 -0
- package/dist/types/model/chat-v2/llmProfileFallback.d.ts +51 -3
- package/dist/types/model/chat-v2/llmProfileFieldRegistry.d.ts +9 -6
- package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +6 -2
- package/dist/types/model/chat-v2/modelRegistry.d.ts +5 -4
- package/dist/types/model/chat-v2/openRouterModel.d.ts +2 -0
- package/dist/types/model/chat-v2/providerOptions.d.ts +2 -13
- package/dist/types/model/classifier/credentials.d.ts +4 -0
- package/dist/types/model/classifier/limits.d.ts +4 -1
- package/dist/types/model/classifier/perplexity.d.ts +7 -0
- package/dist/types/model/classifier/profile.d.ts +46 -0
- package/dist/types/model/classifier/profileExecution.d.ts +32 -0
- package/dist/types/model/classifier/providers.d.ts +32 -1
- package/dist/types/model/classifier/types.d.ts +9 -0
- package/dist/types/model/nodes/ClassifierEvaluateNode.d.ts +14 -12
- package/dist/types/model/nodes/ClassifierProfileNode.d.ts +20 -0
- package/dist/types/model/nodes/toolCallDelegation.d.ts +3 -1
- package/dist/types/model/profileSuspensionHints.d.ts +8 -0
- package/dist/types/serialization.d.ts +2 -0
- package/dist/types/webAppRuntime.d.ts +1 -0
- package/package.json +7 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { isAgentResponseTrace } from './model/AgentResponseTrace.js';
|
|
2
|
+
export { buildAgentProfileAttemptInspectorRows, getClassifierRequestCount, formatClassifierRequestCount, getProfileAttemptOmissionNotice, isClassifierRequest, } from './model/AgentResponseTracePresentation.js';
|
|
2
3
|
export { IndexedDbWebAppBrowserStorage, RIVET_WEB_APP_BROWSER_STORAGE_CHUNK_BYTES, RIVET_WEB_APP_BROWSER_STORAGE_DATABASE, RIVET_WEB_APP_BROWSER_STORAGE_SCHEMA_VERSION, RIVET_WEB_APP_LEGACY_RETENTION_MS, WebAppBrowserStoragePersistenceError, } from './model/WebAppBrowserStorage.js';
|
|
3
4
|
export { decodeRivetWebAppStorageBinaryFrame, deserializeRivetWebAppStoredValue, deserializeRivetWebAppStoredValuePatch, encodeRivetWebAppStorageBinaryFrame, parseRivetWebAppBrowserStorageClientMessage, parseRivetWebAppBrowserStorageServerMessage, RIVET_WEB_APP_BROWSER_STORAGE_BINARY_FRAME_HEADER_BYTES, RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_MAX_ACTION_BYTES, RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_MAX_ACTIVE_BYTES, RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_MAX_VALUE_BYTES, RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_TRANSFER_TIMEOUT_MS, RIVET_WEB_APP_BROWSER_STORAGE_RPC_CAPABILITY, RIVET_WEB_APP_BROWSER_STORAGE_RPC_VERSION, RIVET_WEB_APP_BROWSER_STORAGE_SAFE_FALLBACK_BYTES, RIVET_WEB_APP_BROWSER_STORAGE_TRANSFER_CHUNK_BYTES, serializeRivetWebAppStoredValue, serializeRivetWebAppStoredValuePatch, splitRivetWebAppStorageTransfer, } from './model/WebAppBrowserStorageRpc.js';
|
|
4
5
|
export { UiGraphBrowserPersistence } from './model/UiGraphIndexedDbPersistence.js';
|
package/dist/types/exports.d.ts
CHANGED
|
@@ -32,10 +32,12 @@ export * from './native/NativeApi.js';
|
|
|
32
32
|
export * from './native/BrowserNativeApi.js';
|
|
33
33
|
export * from './model/ProcessContext.js';
|
|
34
34
|
export * from './model/AgentResponseTrace.js';
|
|
35
|
+
export * from './model/AgentResponseTracePresentation.js';
|
|
35
36
|
export * from './model/DebuggerTransportSentinel.js';
|
|
36
37
|
export * from './model/ProjectReferenceLoader.js';
|
|
37
38
|
export * from './model/SubgraphProjectTarget.js';
|
|
38
39
|
export * from './model/ProjectBundle.js';
|
|
40
|
+
export * from './model/ProjectBundleRuntime.js';
|
|
39
41
|
export * from './model/RivetUIContext.js';
|
|
40
42
|
export * from './model/chat-v2/index.js';
|
|
41
43
|
export * from './integrations/integrations.js';
|
|
@@ -46,7 +46,7 @@ export type AgentLLMProfileAttemptTrace = Omit<LLMProfileAttemptTraceEvent, 'eve
|
|
|
46
46
|
export type AgentResponseTrace = {
|
|
47
47
|
schemaVersion: typeof AGENT_RESPONSE_TRACE_SCHEMA_VERSION;
|
|
48
48
|
traceId: RootRunId;
|
|
49
|
-
scope: 'response' | 'llm-invocation';
|
|
49
|
+
scope: 'response' | 'llm-invocation' | 'classifier-invocation';
|
|
50
50
|
rootRunId: RootRunId;
|
|
51
51
|
graphRunId: GraphRunId;
|
|
52
52
|
graphId: GraphId;
|
|
@@ -60,6 +60,8 @@ export type AgentResponseTrace = {
|
|
|
60
60
|
backgroundWorkPending?: boolean;
|
|
61
61
|
summary: {
|
|
62
62
|
modelCallCount: number;
|
|
63
|
+
/** Physical classifier requests, including retries; absent in older traces. */
|
|
64
|
+
classifierRequestCount?: number;
|
|
63
65
|
toolCallCount: number;
|
|
64
66
|
retryCount: number;
|
|
65
67
|
fallbackCount: number;
|
|
@@ -96,7 +98,7 @@ export type BuildAgentResponseTraceOptions = {
|
|
|
96
98
|
events: readonly AgentTraceEvent[];
|
|
97
99
|
nodeId?: NodeId;
|
|
98
100
|
processId?: ProcessId;
|
|
99
|
-
/** Recorded whole-node duration for
|
|
101
|
+
/** Recorded whole-node duration for a model invocation; response traces retain their output-ready duration. */
|
|
100
102
|
invocationDurationMs?: number;
|
|
101
103
|
startedAt?: number;
|
|
102
104
|
responseReadyAt?: number;
|
|
@@ -108,10 +110,19 @@ export declare function buildAgentResponseTrace(options: BuildAgentResponseTrace
|
|
|
108
110
|
export declare function getAgentTraceEventIdentity(event: AgentTraceEvent): string | undefined;
|
|
109
111
|
/**
|
|
110
112
|
* Redelivery is allowed to omit newly added optional observability fields. Keep
|
|
111
|
-
*
|
|
112
|
-
* later legacy-shaped copy erase result navigation.
|
|
113
|
+
* observed profile metadata and exact Delegate result pointers instead of
|
|
114
|
+
* making a later legacy-shaped copy erase diagnostics or result navigation.
|
|
113
115
|
*/
|
|
114
116
|
export declare function mergeAgentTraceEvent(existing: AgentTraceEvent, incoming: AgentTraceEvent): AgentTraceEvent;
|
|
117
|
+
/** Redelivery may omit optional receipts, but supplied pricing remains authoritative. */
|
|
118
|
+
export declare function mergeAgentModelCall<T extends ChatV2CallTraceEvent>(existing: Omit<ChatV2CallTraceEvent, 'callId' | 'provider'> & {
|
|
119
|
+
callId: string;
|
|
120
|
+
provider: string;
|
|
121
|
+
}, incoming: T): T;
|
|
122
|
+
/** Merge one identified attempt, retaining additive metadata omitted by older transports. */
|
|
123
|
+
export declare function mergeAgentProfileAttempt<T extends LLMProfileAttemptTraceEvent>(existing: LLMProfileAttemptTraceEvent, incoming: T): T;
|
|
124
|
+
/** Shared metadata accounting for response inspectors and the bounded activity journal. */
|
|
125
|
+
export declare function summarizeAgentResponseCalls(modelCalls: readonly AgentModelCallTrace[], profileAttempts: readonly AgentLLMProfileAttemptTrace[], toolCalls: readonly AgentToolCallTrace[]): AgentResponseTrace['summary'];
|
|
115
126
|
export declare function isAgentResponseTrace(value: unknown): value is AgentResponseTrace;
|
|
116
127
|
/**
|
|
117
128
|
* Collects privacy-bounded response metadata for one root processor run.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AgentLLMProfileAttemptTrace, AgentResponseTrace } from './AgentResponseTrace.js';
|
|
2
|
+
export type AgentProfileAttemptInspectorRow = Readonly<{
|
|
3
|
+
context: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
eventId: string;
|
|
6
|
+
providerAndModel: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function buildAgentProfileAttemptInspectorRows(attempts: readonly AgentLLMProfileAttemptTrace[]): AgentProfileAttemptInspectorRow[];
|
|
9
|
+
/** Physical classifier requests share profile evidence, not LLM chat-round semantics. */
|
|
10
|
+
export declare function isClassifierRequest(attempt: AgentLLMProfileAttemptTrace): boolean;
|
|
11
|
+
export declare function getClassifierRequestCount(trace: AgentResponseTrace): number | undefined;
|
|
12
|
+
/** Older trace counters inferred from capped rows are lower bounds, not exact totals. */
|
|
13
|
+
export declare function formatClassifierRequestCount(trace: AgentResponseTrace): string | undefined;
|
|
14
|
+
/** One shared cap covers both physical classifier requests and profile decisions. */
|
|
15
|
+
export declare function getProfileAttemptOmissionNotice(trace: AgentResponseTrace): string | undefined;
|
|
@@ -2,6 +2,7 @@ import type { GraphId } from '../index.js';
|
|
|
2
2
|
import type { DataId } from './Project.js';
|
|
3
3
|
import type { RivetKnowledgeDocument, RivetKnowledgeEvidence, RivetKnowledgeSourceReference } from '../integrations/KnowledgeStore.js';
|
|
4
4
|
import { type LLMProfileValue } from './chat-v2/llmProfileTypes.js';
|
|
5
|
+
import type { ClassifierProfileValue } from './classifier/profile.js';
|
|
5
6
|
export type DataValueDef<Type extends string, RuntimeType> = {
|
|
6
7
|
type: Type;
|
|
7
8
|
value: RuntimeType;
|
|
@@ -12,19 +13,19 @@ export type BoolDataValue = DataValueDef<'boolean', boolean>;
|
|
|
12
13
|
export type SystemChatMessage = {
|
|
13
14
|
type: 'system';
|
|
14
15
|
message: ChatMessageMessagePart | ChatMessageMessagePart[];
|
|
15
|
-
/**
|
|
16
|
+
/** Prompt-cache breakpoint for Anthropic or supported OpenRouter endpoints. */
|
|
16
17
|
isCacheBreakpoint?: boolean;
|
|
17
18
|
};
|
|
18
19
|
export type DeveloperChatMessage = {
|
|
19
20
|
type: 'developer';
|
|
20
21
|
message: ChatMessageMessagePart | ChatMessageMessagePart[];
|
|
21
|
-
/**
|
|
22
|
+
/** Prompt-cache breakpoint for Anthropic or supported OpenRouter endpoints. */
|
|
22
23
|
isCacheBreakpoint?: boolean;
|
|
23
24
|
};
|
|
24
25
|
export type UserChatMessage = {
|
|
25
26
|
type: 'user';
|
|
26
27
|
message: ChatMessageMessagePart | ChatMessageMessagePart[];
|
|
27
|
-
/**
|
|
28
|
+
/** Prompt-cache breakpoint for Anthropic or supported OpenRouter endpoints. */
|
|
28
29
|
isCacheBreakpoint?: boolean;
|
|
29
30
|
};
|
|
30
31
|
export type AssistantChatMessageFunctionCall = {
|
|
@@ -40,10 +41,12 @@ export type ParsedAssistantChatMessageFunctionCall = {
|
|
|
40
41
|
export type AssistantChatMessage = {
|
|
41
42
|
type: 'assistant';
|
|
42
43
|
message: ChatMessageMessagePart | ChatMessageMessagePart[];
|
|
44
|
+
/** Provider-returned reasoning continuity, including opaque encrypted blocks; not an API credential. */
|
|
45
|
+
openRouterReasoningDetails?: Record<string, unknown>[];
|
|
43
46
|
/** @deprecated use function_calls instead */
|
|
44
47
|
function_call: AssistantChatMessageFunctionCall | undefined;
|
|
45
48
|
function_calls: AssistantChatMessageFunctionCall[] | undefined;
|
|
46
|
-
/**
|
|
49
|
+
/** Prompt-cache breakpoint for Anthropic or supported OpenRouter endpoints. */
|
|
47
50
|
isCacheBreakpoint?: boolean;
|
|
48
51
|
};
|
|
49
52
|
export type FunctionResponseChatMessage = {
|
|
@@ -51,7 +54,7 @@ export type FunctionResponseChatMessage = {
|
|
|
51
54
|
message: ChatMessageMessagePart | ChatMessageMessagePart[];
|
|
52
55
|
name: string;
|
|
53
56
|
toolName?: string;
|
|
54
|
-
/**
|
|
57
|
+
/** Prompt-cache breakpoint for Anthropic or supported OpenRouter endpoints. */
|
|
55
58
|
isCacheBreakpoint?: boolean;
|
|
56
59
|
};
|
|
57
60
|
export type ChatMessage = SystemChatMessage | DeveloperChatMessage | UserChatMessage | AssistantChatMessage | FunctionResponseChatMessage;
|
|
@@ -96,6 +99,7 @@ export type KnowledgeSourceDataValue = DataValueDef<'knowledge-source', RivetKno
|
|
|
96
99
|
export type KnowledgeDocumentDataValue = DataValueDef<'knowledge-document', RivetKnowledgeDocument>;
|
|
97
100
|
export type KnowledgeEvidenceDataValue = DataValueDef<'knowledge-evidence', RivetKnowledgeEvidence>;
|
|
98
101
|
export type LLMProfileDataValue = DataValueDef<'llm-config', LLMProfileValue>;
|
|
102
|
+
export type ClassifierProfileDataValue = DataValueDef<'classifier-config', ClassifierProfileValue>;
|
|
99
103
|
export type DocumentDataValue = DataValueDef<'document', {
|
|
100
104
|
mediaType: SupportedDocumentMediaTypes;
|
|
101
105
|
data: Uint8Array;
|
|
@@ -116,7 +120,7 @@ export type GptFunction = {
|
|
|
116
120
|
};
|
|
117
121
|
export type GptFunctionDataValue = DataValueDef<'gpt-function', GptFunction>;
|
|
118
122
|
export type ControlFlowExcludedDataValue = DataValueDef<'control-flow-excluded', undefined | 'loop-not-broken'>;
|
|
119
|
-
export type ScalarDataValue = StringDataValue | NumberDataValue | DateDataValue | TimeDataValue | DateTimeDataValue | BoolDataValue | ChatMessageDataValue | ControlFlowExcludedDataValue | AnyDataValue | ObjectDataValue | GptFunctionDataValue | VectorDataValue | ImageDataValue | BinaryDataValue | AudioDataValue | GraphReferenceValue | KnowledgeSourceDataValue | KnowledgeDocumentDataValue | KnowledgeEvidenceDataValue | LLMProfileDataValue | DocumentDataValue;
|
|
123
|
+
export type ScalarDataValue = StringDataValue | NumberDataValue | DateDataValue | TimeDataValue | DateTimeDataValue | BoolDataValue | ChatMessageDataValue | ControlFlowExcludedDataValue | AnyDataValue | ObjectDataValue | GptFunctionDataValue | VectorDataValue | ImageDataValue | BinaryDataValue | AudioDataValue | GraphReferenceValue | KnowledgeSourceDataValue | KnowledgeDocumentDataValue | KnowledgeEvidenceDataValue | LLMProfileDataValue | ClassifierProfileDataValue | DocumentDataValue;
|
|
120
124
|
export type ScalarType = ScalarDataValue['type'];
|
|
121
125
|
export type ArrayDataValue<T extends ScalarDataValue> = DataValueDef<`${T['type']}[]`, T['value'][]>;
|
|
122
126
|
export type FunctionDataValue<T extends ScalarOrArrayDataValue> = DataValueDef<`fn<${T['type']}>`, () => T['value']>;
|
|
@@ -150,8 +154,8 @@ export type GetDataValue<Type extends DataType> = Extract<DataValue, {
|
|
|
150
154
|
export type DataRef = {
|
|
151
155
|
refId: DataId;
|
|
152
156
|
};
|
|
153
|
-
export declare const dataTypes: ["any", "any[]", "boolean", "boolean[]", "string", "string[]", "number", "number[]", "date", "date[]", "time", "time[]", "datetime", "datetime[]", "chat-message", "chat-message[]", "control-flow-excluded", "control-flow-excluded[]", "object", "object[]", "fn<string>", "fn<number>", "fn<boolean>", "fn<date>", "fn<time>", "fn<datetime>", "fn<any>", "fn<object>", "fn<chat-message>", "fn<control-flow-excluded>", "fn<string[]>", "fn<number[]>", "fn<boolean[]>", "fn<date[]>", "fn<time[]>", "fn<datetime[]>", "fn<any[]>", "fn<object[]>", "fn<chat-message[]>", "fn<control-flow-excluded[]>", "gpt-function", "gpt-function[]", "fn<gpt-function[]>", "fn<gpt-function>", "vector", "vector[]", "fn<vector>", "fn<vector[]>", "image", "image[]", "fn<image>", "fn<image[]>", "binary", "binary[]", "fn<binary>", "fn<binary[]>", "audio", "audio[]", "fn<audio>", "fn<audio[]>", "graph-reference", "graph-reference[]", "fn<graph-reference>", "fn<graph-reference[]>", "knowledge-source", "knowledge-source[]", "fn<knowledge-source>", "fn<knowledge-source[]>", "knowledge-document", "knowledge-document[]", "fn<knowledge-document>", "fn<knowledge-document[]>", "knowledge-evidence", "knowledge-evidence[]", "fn<knowledge-evidence>", "fn<knowledge-evidence[]>", "llm-config", "llm-config[]", "fn<llm-config>", "fn<llm-config[]>", "document", "document[]", "fn<document>", "fn<document[]>"];
|
|
154
|
-
export declare const scalarTypes: ["any", "boolean", "string", "number", "date", "time", "datetime", "chat-message", "control-flow-excluded", "object", "gpt-function", "vector", "image", "binary", "audio", "graph-reference", "knowledge-source", "knowledge-document", "knowledge-evidence", "llm-config", "document"];
|
|
157
|
+
export declare const dataTypes: ["any", "any[]", "boolean", "boolean[]", "string", "string[]", "number", "number[]", "date", "date[]", "time", "time[]", "datetime", "datetime[]", "chat-message", "chat-message[]", "control-flow-excluded", "control-flow-excluded[]", "object", "object[]", "fn<string>", "fn<number>", "fn<boolean>", "fn<date>", "fn<time>", "fn<datetime>", "fn<any>", "fn<object>", "fn<chat-message>", "fn<control-flow-excluded>", "fn<string[]>", "fn<number[]>", "fn<boolean[]>", "fn<date[]>", "fn<time[]>", "fn<datetime[]>", "fn<any[]>", "fn<object[]>", "fn<chat-message[]>", "fn<control-flow-excluded[]>", "gpt-function", "gpt-function[]", "fn<gpt-function[]>", "fn<gpt-function>", "vector", "vector[]", "fn<vector>", "fn<vector[]>", "image", "image[]", "fn<image>", "fn<image[]>", "binary", "binary[]", "fn<binary>", "fn<binary[]>", "audio", "audio[]", "fn<audio>", "fn<audio[]>", "graph-reference", "graph-reference[]", "fn<graph-reference>", "fn<graph-reference[]>", "knowledge-source", "knowledge-source[]", "fn<knowledge-source>", "fn<knowledge-source[]>", "knowledge-document", "knowledge-document[]", "fn<knowledge-document>", "fn<knowledge-document[]>", "knowledge-evidence", "knowledge-evidence[]", "fn<knowledge-evidence>", "fn<knowledge-evidence[]>", "llm-config", "llm-config[]", "fn<llm-config>", "fn<llm-config[]>", "classifier-config", "classifier-config[]", "fn<classifier-config>", "fn<classifier-config[]>", "document", "document[]", "fn<document>", "fn<document[]>"];
|
|
158
|
+
export declare const scalarTypes: ["any", "boolean", "string", "number", "date", "time", "datetime", "chat-message", "control-flow-excluded", "object", "gpt-function", "vector", "image", "binary", "audio", "graph-reference", "knowledge-source", "knowledge-document", "knowledge-evidence", "llm-config", "classifier-config", "document"];
|
|
155
159
|
export declare const dataTypeDisplayNames: Record<DataType, string>;
|
|
156
160
|
export declare function isScalarDataValue(value: DataValue | undefined): value is ScalarDataValue;
|
|
157
161
|
export declare function isScalarDataType(type: DataType): type is ScalarDataType;
|
|
@@ -9,6 +9,7 @@ import type { EventOccurrenceTiming, FrozenNodeOutputsByGraph, NodeResultOrigin,
|
|
|
9
9
|
import type { GraphProgress } from './GraphProgress.js';
|
|
10
10
|
import type { StreamingOutputWatchHistorySummary } from './StreamingOutputWatchHistory.js';
|
|
11
11
|
import type { RivetWebAppStorage } from './UiGraphWebAppStorage.js';
|
|
12
|
+
import type { CombinedDataset } from '../utils/index.js';
|
|
12
13
|
export type GraphInputs = Record<string, DataValue>;
|
|
13
14
|
export type GraphOutputs = Record<string, DataValue>;
|
|
14
15
|
export type Inputs = Record<PortId, DataValue | undefined>;
|
|
@@ -251,6 +252,12 @@ export type OutgoingMessageMap = {
|
|
|
251
252
|
contextValues: Record<string, DataValue>;
|
|
252
253
|
inputs?: GraphInputs;
|
|
253
254
|
projectPath?: string | null;
|
|
255
|
+
/** Local desktop executor only. Hosted executors reject client filesystem bundle paths. */
|
|
256
|
+
projectBundle?: {
|
|
257
|
+
manifestPath: string;
|
|
258
|
+
artifactId: string;
|
|
259
|
+
entryDatasets: CombinedDataset[];
|
|
260
|
+
};
|
|
254
261
|
useEditorCache?: boolean;
|
|
255
262
|
captureNodeTimings?: boolean;
|
|
256
263
|
/** Hosted editor setting; only the authenticated Node executor uses it. */
|
|
@@ -19,5 +19,14 @@ export type FrozenGraphBoundaryEffect = FrozenSetGlobalEffect | FrozenSetStoredV
|
|
|
19
19
|
* single boundary rule.
|
|
20
20
|
*/
|
|
21
21
|
export declare function commitGraphOutputValue(graphOutputs: GraphOutputs, outputId: string, value: DataValue): void;
|
|
22
|
-
export
|
|
22
|
+
export type GraphCostBreakdown = {
|
|
23
|
+
llm: number;
|
|
24
|
+
classifier: number;
|
|
25
|
+
other: number;
|
|
26
|
+
};
|
|
27
|
+
/** Safe family totals carried across graph and tool boundaries, separate from node diagnostics. */
|
|
28
|
+
export declare function readGraphCostBreakdown(outputs: Outputs): GraphCostBreakdown | undefined;
|
|
29
|
+
export declare function graphCostBreakdownMatchesCost(breakdown: GraphCostBreakdown, cost: number): boolean;
|
|
30
|
+
export declare function addGraphCostBreakdown(current: GraphCostBreakdown | undefined, addition: GraphCostBreakdown): GraphCostBreakdown;
|
|
31
|
+
export declare function ensureGraphCostOutput(graphOutputs: GraphOutputs, totalCost: number, breakdown?: GraphCostBreakdown): void;
|
|
23
32
|
export declare function applyFrozenGraphBoundaryEffects(graphOutputs: GraphOutputs, node: ChartNode, outputValues: Outputs): FrozenGraphBoundaryEffect | undefined;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { DataValue, StringArrayDataValue, ScalarOrArrayDataValue } from './DataValue.js';
|
|
2
|
+
import type { NodeId } from './NodeBase.js';
|
|
3
|
+
import type { Project, ProjectId } from './Project.js';
|
|
4
|
+
import type { ProcessContext, ProcessId, RootRunId, GraphRunId } from './ProcessContext.js';
|
|
5
|
+
import type { AttachedNodeData, GraphProcessor, GraphInputs, GraphOutputs, NodeResults, Outputs, NodeAbortControllerEntry } from './GraphProcessor.js';
|
|
6
|
+
import type PQueue from '../utils/pQueueCompat.js';
|
|
7
|
+
import type { NodeProcessContextBase } from './ProcessContextBuilder.js';
|
|
8
|
+
import type { GraphOutputSelection } from './GraphOutputSelection.js';
|
|
9
|
+
import type { RivetStoredValueController } from './StoredValueStore.js';
|
|
10
|
+
import type { KnowledgeStoreController } from '../integrations/KnowledgeStoreProvider.js';
|
|
11
|
+
import type { ResolvedSubgraphProject } from './SubgraphProjectTarget.js';
|
|
12
|
+
import type { GraphCostBreakdown } from './GraphBoundaryEffects.js';
|
|
13
|
+
/** Invocation-owned fields; GraphProcessor resets them at the established initialization boundaries. */
|
|
14
|
+
export declare class GraphInvocationState {
|
|
15
|
+
rootRunId: RootRunId;
|
|
16
|
+
graphRunId: GraphRunId;
|
|
17
|
+
parentGraphRunId: GraphRunId | undefined;
|
|
18
|
+
erroredNodes: Map<NodeId, Error | string>;
|
|
19
|
+
failureOutputsByProcessId: Map<ProcessId, Map<number, Outputs>>;
|
|
20
|
+
remainingNodes: Set<NodeId>;
|
|
21
|
+
visitedNodes: Set<NodeId>;
|
|
22
|
+
currentlyProcessing: Set<NodeId>;
|
|
23
|
+
context: ProcessContext;
|
|
24
|
+
nodeResults: NodeResults;
|
|
25
|
+
abortController: AbortController;
|
|
26
|
+
processingQueue: InstanceType<typeof PQueue>;
|
|
27
|
+
graphInputs: GraphInputs;
|
|
28
|
+
graphOutputs: GraphOutputs;
|
|
29
|
+
queuedNodes: Set<NodeId>;
|
|
30
|
+
/** Run To quiescence may defer nodes that a later streaming Stop resumes. */
|
|
31
|
+
deferredRunToIgnoredNodes: Set<NodeId>;
|
|
32
|
+
loopControllersSeen: Set<NodeId>;
|
|
33
|
+
subprocessors: Set<GraphProcessor>;
|
|
34
|
+
attachedNodeData: Map<NodeId, AttachedNodeData>;
|
|
35
|
+
successfulAbortTerminalProcessIds: Set<ProcessId>;
|
|
36
|
+
totalCost: number;
|
|
37
|
+
costBreakdown: GraphCostBreakdown | undefined;
|
|
38
|
+
ignoreNodes: Set<NodeId>;
|
|
39
|
+
hasPreloadedData: boolean;
|
|
40
|
+
loadedProjects: Record<ProjectId, Project>;
|
|
41
|
+
nodeProcessContextBase: NodeProcessContextBase;
|
|
42
|
+
runToRelevantNodeIds: Set<NodeId> | undefined;
|
|
43
|
+
graphOutputSelection: GraphOutputSelection | undefined;
|
|
44
|
+
nodeAbortControllers: Map<NodeId, NodeAbortControllerEntry>;
|
|
45
|
+
graphInputNodeValues: Record<string, DataValue>;
|
|
46
|
+
/** User input nodes awaiting interactive input for this invocation. */
|
|
47
|
+
pendingUserInputs: Record<NodeId, {
|
|
48
|
+
resolve: (values: StringArrayDataValue) => void;
|
|
49
|
+
}>;
|
|
50
|
+
/** Mutate the owner in place: late child cost/events still address this invocation. */
|
|
51
|
+
initialize(options: {
|
|
52
|
+
preloadedNodeResults: NodeResults;
|
|
53
|
+
remainingNodeIds: Iterable<NodeId>;
|
|
54
|
+
processingQueue: InstanceType<typeof PQueue>;
|
|
55
|
+
createAbortController: () => AbortController;
|
|
56
|
+
loadedProjects: Record<ProjectId, Project>;
|
|
57
|
+
sharedOverride?: Pick<GraphInvocationState, 'graphOutputs' | 'attachedNodeData' | 'graphInputNodeValues'>;
|
|
58
|
+
}): void;
|
|
59
|
+
}
|
|
60
|
+
/** Shared by every child kind; retained caches/globals deliberately keep existing reuse semantics. */
|
|
61
|
+
export declare class GraphSharedExecutionState {
|
|
62
|
+
globals: Map<string, ScalarOrArrayDataValue>;
|
|
63
|
+
executionCache: Map<string, unknown>;
|
|
64
|
+
storedValueController: RivetStoredValueController;
|
|
65
|
+
knowledgeStoreController: KnowledgeStoreController;
|
|
66
|
+
subgraphTargetCache: Map<ProjectId, ResolvedSubgraphProject>;
|
|
67
|
+
nextRootRun(): GraphSharedExecutionState;
|
|
68
|
+
}
|
|
@@ -34,6 +34,7 @@ export type EventOccurrenceTiming = {
|
|
|
34
34
|
type WithExecution<T extends object> = T & {
|
|
35
35
|
execution: GraphExecutionMetadata;
|
|
36
36
|
} & ReplayEventTiming & EventOccurrenceTiming;
|
|
37
|
+
export type NodeAbortControllerEntry = AbortController | Set<AbortController>;
|
|
37
38
|
declare const graphProcessorGraphOverride: unique symbol;
|
|
38
39
|
declare const consumedAsyncBranchTriggerOverride: unique symbol;
|
|
39
40
|
declare const asyncBranchInputAnchorsOverride: unique symbol;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { DataType, DataValue } from './DataValue.js';
|
|
2
|
+
import type { ChartNode, NodeId, PortId } from './NodeBase.js';
|
|
3
|
+
import type { NodeGraph } from './NodeGraph.js';
|
|
4
|
+
import type { CatchStreamingChunksNode } from './nodes/CatchStreamingChunksNode.js';
|
|
5
|
+
import type { StreamingOutputWatch } from './StreamingOutputWatch.js';
|
|
6
|
+
import type { StreamingOutputWatchHistory, StreamingOutputWatchHistoryIteration } from './StreamingOutputWatchHistory.js';
|
|
7
|
+
import type { GraphInputStream, GraphInputStreamRelay } from './GraphInputStream.js';
|
|
8
|
+
export type SchedulerBoundaryFailure = {
|
|
9
|
+
error: Error;
|
|
10
|
+
triggerNode: ChartNode;
|
|
11
|
+
nodeErrors: Array<{
|
|
12
|
+
error: Error | string;
|
|
13
|
+
node: ChartNode;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export type StreamingOutputWatchPlan = {
|
|
17
|
+
graph: NodeGraph;
|
|
18
|
+
/** Only retain and snapshot the cumulative history when a branch consumes it. */
|
|
19
|
+
includeAllStreamedOutput: boolean;
|
|
20
|
+
sourceOutputId: PortId;
|
|
21
|
+
/**
|
|
22
|
+
* A Stop boundary is optional. Without one, every snapshot runs the entire
|
|
23
|
+
* contained branch and the watch completes normally with its producer.
|
|
24
|
+
*/
|
|
25
|
+
stopNodeId?: NodeId;
|
|
26
|
+
/**
|
|
27
|
+
* Immutable stream increments observed for this run. Cumulative string
|
|
28
|
+
* snapshots contribute only their new suffix so an LLM response does not
|
|
29
|
+
* retain N copies of its whole prefix.
|
|
30
|
+
*/
|
|
31
|
+
streamedOutput: unknown[];
|
|
32
|
+
previousStreamedValue: unknown;
|
|
33
|
+
watchNode: ChartNode;
|
|
34
|
+
nextUpdateIndex: number;
|
|
35
|
+
history: StreamingOutputWatchHistory;
|
|
36
|
+
historySummaryEmitted: boolean;
|
|
37
|
+
/** True once normal stream exhaustion has excluded the parent Stop boundary. */
|
|
38
|
+
unmatchedStopResolved: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type StreamingOutputCatchPlan = {
|
|
41
|
+
node: CatchStreamingChunksNode;
|
|
42
|
+
sourceOutputId: PortId;
|
|
43
|
+
count: number;
|
|
44
|
+
chunks: DataValue[];
|
|
45
|
+
settled: boolean;
|
|
46
|
+
};
|
|
47
|
+
export type StreamingOutputWatchInvocation = {
|
|
48
|
+
plan: StreamingOutputWatchPlan;
|
|
49
|
+
historyIteration: StreamingOutputWatchHistoryIteration;
|
|
50
|
+
/**
|
|
51
|
+
* Atomically claims the parent Watch's one accepted Stop value. The claim is
|
|
52
|
+
* made before the child's nodeFinish is emitted so that event can identify
|
|
53
|
+
* the actual terminal branch, but its parent-dataflow effects are committed
|
|
54
|
+
* only after that lifecycle event has been published.
|
|
55
|
+
*/
|
|
56
|
+
claimStop: (value: DataValue) => StreamingOutputWatchStopClaim | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Set only by the live Stop node implementation. The output that re-enters
|
|
59
|
+
* the parent is deliberately taken from the completed node result instead:
|
|
60
|
+
* split nodes aggregate their per-item outputs only at that boundary.
|
|
61
|
+
*/
|
|
62
|
+
stopReached: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type StreamingOutputWatchStopClaim = {
|
|
65
|
+
commit: () => void;
|
|
66
|
+
};
|
|
67
|
+
export type GraphOutputPartialBinding = {
|
|
68
|
+
dataType: DataType;
|
|
69
|
+
graphOutputId: string;
|
|
70
|
+
sourceOutputId: PortId;
|
|
71
|
+
};
|
|
72
|
+
/** Invocation-owned boundary resources; no scheduling or event-emission policy. */
|
|
73
|
+
export declare class GraphSchedulerBoundaryState {
|
|
74
|
+
streamingWatchPlansBySourceNodeId: Map<NodeId, StreamingOutputWatchPlan[]>;
|
|
75
|
+
streamingWatchPlansByWatchNodeId: Map<NodeId, StreamingOutputWatchPlan>;
|
|
76
|
+
streamingOutputWatches: Map<NodeId, StreamingOutputWatch>;
|
|
77
|
+
streamingCatchPlansBySourceNodeId: Map<NodeId, StreamingOutputCatchPlan[]>;
|
|
78
|
+
streamingCatchTasks: Set<Promise<void>>;
|
|
79
|
+
graphOutputPartialBindingsBySourceNodeId: Map<NodeId, GraphOutputPartialBinding[]>;
|
|
80
|
+
graphInputStreams: Readonly<Record<string, GraphInputStream>>;
|
|
81
|
+
callerInputStreams: Map<NodeId, Record<string, GraphInputStreamRelay>>;
|
|
82
|
+
inputStreamRoutes: Map<NodeId, {
|
|
83
|
+
port: PortId;
|
|
84
|
+
relay: GraphInputStreamRelay;
|
|
85
|
+
}[]>;
|
|
86
|
+
streamCallerTasks: Set<Promise<unknown>>;
|
|
87
|
+
inputStreamDisposers: Array<() => void>;
|
|
88
|
+
pendingGraphInputFinals: Map<NodeId, import("./NodeIO.js").NodeOutputs>;
|
|
89
|
+
streamingWatchFailures: SchedulerBoundaryFailure[];
|
|
90
|
+
resetTopology(): void;
|
|
91
|
+
/** Called after invocation initialization, before subscriptions can be admitted. */
|
|
92
|
+
initializeInputStreams(streams?: Readonly<Record<string, GraphInputStream>>): void;
|
|
93
|
+
/** Release every subscription/relay, even if one host-provided disposer fails. */
|
|
94
|
+
releaseInputStreams(): void;
|
|
95
|
+
drainCatchTasks(waitForQueue: () => Promise<unknown>): Promise<void>;
|
|
96
|
+
}
|
|
@@ -114,17 +114,20 @@ export * from './nodes/MCPGetPromptNode.js';
|
|
|
114
114
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
115
115
|
export * from './nodes/NodePrefabInstanceNode.js';
|
|
116
116
|
export * from './nodes/ClassifierQuestionNode.js';
|
|
117
|
+
export * from './nodes/ClassifierProfileNode.js';
|
|
118
|
+
export * from './classifier/profile.js';
|
|
119
|
+
export { classifierFailureKinds, type ClassifierFailureKind, type ClassifierAttemptUsage } from './classifier/types.js';
|
|
117
120
|
export * from './nodes/ClassifierEvaluateNode.js';
|
|
118
|
-
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "userInput" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "
|
|
121
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "userInput" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "watchStreamingOutput" | "catchStreamingChunks" | "startBackgroundBranch" | "stopWatchingStreamingOutput" | "chunk" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "matchCase" | "readDirectory" | "readFile" | "ifElse" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "projectName" | "coalesce" | "coalesceNew" | "didRun" | "passthrough" | "dataBus" | "streamValue" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "hash" | "raceInputs" | "toJson" | "toBase64" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance" | "classifierQuestion" | "classifierEvaluate" | "classifierProfile", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/CatchStreamingChunksNode.js").CatchStreamingChunksNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/MatchCaseNode.js").MatchCaseNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/GraphCallPathNode.js").GraphCallPathNode | import("./nodes/ProjectNameNode.js").ProjectNameNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/CoalesceNewNode.js").CoalesceNewNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/WatchStreamingOutputNode.js").WatchStreamingOutputNode | import("./nodes/StopWatchingStreamingOutputNode.js").StopWatchingStreamingOutputNode | import("./nodes/StreamValueNode.js").StreamValueNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/ToBase64Node.js").ToBase64Node | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
119
122
|
type: "mcpDiscovery";
|
|
120
123
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
121
124
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
122
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode | import("./nodes/ClassifierQuestionNode.js").ClassifierQuestionNode | import("./nodes/ClassifierEvaluateNode.js").ClassifierEvaluateNode>;
|
|
123
|
-
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "userInput" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "
|
|
125
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode | import("./nodes/ClassifierQuestionNode.js").ClassifierQuestionNode | import("./nodes/ClassifierEvaluateNode.js").ClassifierEvaluateNode | import("./nodes/ClassifierProfileNode.js").ClassifierProfileNode>;
|
|
126
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "text" | "chat" | "array" | "code" | "context" | "userInput" | "graphInput" | "setGlobal" | "setStoredValue" | "graphOutput" | "delegateFunctionCall" | "graphCallPath" | "raiseEvent" | "reportProgress" | "getGlobal" | "getStoredValue" | "abortGraph" | "prompt" | "llmChatV2" | "watchStreamingOutput" | "catchStreamingChunks" | "startBackgroundBranch" | "stopWatchingStreamingOutput" | "chunk" | "llmProfile" | "extractRegex" | "codeNew" | "expression" | "matchCase" | "readDirectory" | "readFile" | "ifElse" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "extractObjectPath" | "projectName" | "coalesce" | "coalesceNew" | "didRun" | "passthrough" | "dataBus" | "streamValue" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "knowledgeSource" | "knowledgeDocument" | "syncKnowledgeSource" | "getKnowledgeSourceStatus" | "searchKnowledge" | "buildKnowledgeContext" | "hash" | "raceInputs" | "toJson" | "toBase64" | "jsFilter" | "jsMap" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias" | "nodePrefabInstance" | "classifierQuestion" | "classifierEvaluate" | "classifierProfile", import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./chat-v2/llmChatV2NodeData.js").LLMChatV2Node | import("./nodes/CatchStreamingChunksNode.js").CatchStreamingChunksNode | import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/LLMProfileNode.js").LLMProfileNode | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/CodeNewNode.js").CodeNewNode | import("./nodes/ExpressionNode.js").ExpressionNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/MatchCaseNode.js").MatchCaseNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ReportProgressNode.js").ReportProgressNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/GraphCallPathNode.js").GraphCallPathNode | import("./nodes/ProjectNameNode.js").ProjectNameNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/CoalesceNewNode.js").CoalesceNewNode | import("./nodes/DidRunNode.js").DidRunNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/DataBusNode.js").DataBusNode | import("./nodes/StartBackgroundBranchNode.js").StartBackgroundBranchNode | import("./nodes/WatchStreamingOutputNode.js").WatchStreamingOutputNode | import("./nodes/StopWatchingStreamingOutputNode.js").StopWatchingStreamingOutputNode | import("./nodes/StreamValueNode.js").StreamValueNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/SetStoredValueNode.js").SetStoredValueNode | import("./nodes/GetStoredValueNode.js").GetStoredValueNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/ToolNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/KnowledgeSourceNode.js").KnowledgeSourceNode | import("./nodes/KnowledgeDocumentNode.js").KnowledgeDocumentNode | import("./nodes/SyncKnowledgeSourceNode.js").SyncKnowledgeSourceNode | import("./nodes/GetKnowledgeSourceStatusNode.js").GetKnowledgeSourceStatusNode | import("./nodes/SearchKnowledgeNode.js").SearchKnowledgeNode | import("./nodes/BuildKnowledgeContextNode.js").BuildKnowledgeContextNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/ToBase64Node.js").ToBase64Node | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/JSFilterNode.js").JSFilterNode | import("./nodes/JSMapNode.js").JSMapNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
124
127
|
type: "mcpDiscovery";
|
|
125
128
|
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
126
129
|
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
127
|
-
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode | import("./nodes/ClassifierQuestionNode.js").ClassifierQuestionNode | import("./nodes/ClassifierEvaluateNode.js").ClassifierEvaluateNode>;
|
|
130
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode | import("./NodePrefabResolver.js").NodePrefabInstanceNode | import("./nodes/ClassifierQuestionNode.js").ClassifierQuestionNode | import("./nodes/ClassifierEvaluateNode.js").ClassifierEvaluateNode | import("./nodes/ClassifierProfileNode.js").ClassifierProfileNode>;
|
|
128
131
|
export { globalRivetNodeRegistry };
|
|
129
132
|
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
130
133
|
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Opaque } from 'type-fest';
|
|
2
|
+
import type { ClassifierFailureKind, ClassifierAttemptUsage } from './classifier/types.js';
|
|
2
3
|
import { type RuntimeSettings, type NativeApi, type Project, type DataValue, type ExternalFunction, type Outputs, type GraphId, type GraphProcessor, type ScalarOrArrayDataValue, type DatasetProvider, type ChartNode, type NodeId, type PortId, type AttachedNodeData, type AudioProvider, type StringArrayDataValue, type ProjectId, type MCPProvider } from '../index.js';
|
|
3
4
|
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
4
5
|
import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
@@ -115,15 +116,21 @@ export type ChatV2CallTraceEvent = Omit<ChatV2CallFinishedEvent, 'rawUsage'>;
|
|
|
115
116
|
* skipped by an open circuit and health-store fail-open decisions.
|
|
116
117
|
*/
|
|
117
118
|
export type LLMProfileAttemptTraceEvent = {
|
|
119
|
+
family?: 'llm' | 'classifier';
|
|
120
|
+
failureKind?: ClassifierFailureKind;
|
|
121
|
+
skipReason?: 'unreached';
|
|
122
|
+
classifierUsage?: ClassifierAttemptUsage;
|
|
123
|
+
/** Physical classifier request duration, excluding retry waits. */
|
|
124
|
+
durationMs?: number;
|
|
118
125
|
eventId: string;
|
|
119
126
|
roundIndex: number;
|
|
120
127
|
/** Present when this attempt belongs to a From profile fallback candidate. */
|
|
121
128
|
profileIndex?: number;
|
|
122
|
-
/** User-facing title captured from the source
|
|
129
|
+
/** User-facing title captured from the source profile node. */
|
|
123
130
|
profileName?: string;
|
|
124
131
|
nodeId: NodeId;
|
|
125
132
|
processId: ProcessId;
|
|
126
|
-
provider:
|
|
133
|
+
provider: string;
|
|
127
134
|
model: string;
|
|
128
135
|
customProviderApi?: CustomProviderApi;
|
|
129
136
|
stage: 'configuration' | 'request' | 'response-validation' | 'health-gate' | 'health-update';
|
|
@@ -136,7 +143,7 @@ export type LLMProfileAttemptTraceEvent = {
|
|
|
136
143
|
healthDisposition?: 'allow' | 'deny' | 'fail-open';
|
|
137
144
|
healthOutcome?: RivetLLMProfileHealthOutcome;
|
|
138
145
|
retryAt?: number;
|
|
139
|
-
timeoutKind?: 'first-output' | 'stream-inactivity';
|
|
146
|
+
timeoutKind?: 'first-output' | 'stream-inactivity' | 'response';
|
|
140
147
|
};
|
|
141
148
|
export type LLMProfileAttemptObserver = (event: LLMProfileAttemptTraceEvent) => void;
|
|
142
149
|
export type ToolCallFinishedEvent = {
|
|
@@ -243,6 +250,8 @@ export type GraphExecutionMetadata = {
|
|
|
243
250
|
rootRunId: RootRunId;
|
|
244
251
|
graphRunId: GraphRunId;
|
|
245
252
|
graphId: GraphId;
|
|
253
|
+
/** Actual snapshot owner, including legacy referenced-graph execution. */
|
|
254
|
+
projectId?: ProjectId;
|
|
246
255
|
/** Present for a hosted Subgraph call into another saved project. */
|
|
247
256
|
projectScope?: string;
|
|
248
257
|
parentGraphRunId?: GraphRunId;
|
|
@@ -5,11 +5,13 @@ import type { PluginLoadSpec } from './PluginLoadSpec.js';
|
|
|
5
5
|
export declare class ProjectBundleError extends Error {
|
|
6
6
|
constructor(message: string, options?: ErrorOptions);
|
|
7
7
|
}
|
|
8
|
-
/** Portable,
|
|
8
|
+
/** Portable, editable project files. Paths are relative to the manifest. */
|
|
9
9
|
export type ProjectBundleFile = {
|
|
10
10
|
path: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/** Legacy export metadata; not enforced when loading. */
|
|
12
|
+
bytes?: number;
|
|
13
|
+
/** Legacy export metadata; not enforced when loading. */
|
|
14
|
+
sha256?: string;
|
|
13
15
|
};
|
|
14
16
|
export type ProjectBundleArtifact = {
|
|
15
17
|
id: string;
|
|
@@ -23,7 +25,9 @@ export type ProjectBundleArtifact = {
|
|
|
23
25
|
export type ProjectBundleManifest = {
|
|
24
26
|
format: 'rivet-project-bundle';
|
|
25
27
|
schemaVersion: 1;
|
|
26
|
-
requiredLoaderVersion: 1;
|
|
28
|
+
requiredLoaderVersion: 1 | 2 | 3;
|
|
29
|
+
/** Explicit export-wide version selection; one artifact per project. */
|
|
30
|
+
versionPolicy?: 'latest' | 'published';
|
|
27
31
|
exportingRuntimeVersion: string;
|
|
28
32
|
rootArtifact: string;
|
|
29
33
|
artifacts: ProjectBundleArtifact[];
|
|
@@ -40,6 +44,7 @@ export type ProjectBundleManifest = {
|
|
|
40
44
|
};
|
|
41
45
|
export declare const PROJECT_BUNDLE_MANIFEST = "rivet-bundle.json";
|
|
42
46
|
export declare const PROJECT_BUNDLE_MAX_ARTIFACTS = 256;
|
|
47
|
+
export declare const PROJECT_BUNDLE_MAX_MANIFEST_BYTES: number;
|
|
43
48
|
export declare function projectBundleTargetKey(projectId: string, version: string): string;
|
|
44
49
|
export declare function listProjectBundleCalls(project: Project): {
|
|
45
50
|
projectId: string;
|