@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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
2
|
+
import type { NodeId } from '../NodeBase.js';
|
|
3
|
+
import { type LLMAttempt } from '../chat-v2/llmProfileFallback.js';
|
|
4
|
+
import { getClassifierProvider, type ClassifierProviderEvaluationResult, type ClassifierProviderEvaluateArgs } from './providers.js';
|
|
5
|
+
import { type ClassifierProfileValue } from './profile.js';
|
|
6
|
+
import type { ClassifierState } from './state.js';
|
|
7
|
+
import type { ClassifierQuestionDefinition } from './types.js';
|
|
8
|
+
export declare function classifierProfileSummary(profiles: readonly ClassifierProfileValue[], attempts: readonly LLMAttempt[]): string;
|
|
9
|
+
export declare class ClassifierProfileExhaustedError extends Error {
|
|
10
|
+
readonly attempts: readonly LLMAttempt[];
|
|
11
|
+
readonly summary: string;
|
|
12
|
+
readonly statusCode?: number | undefined;
|
|
13
|
+
constructor(attempts: readonly LLMAttempt[], summary: string, options?: ErrorOptions, statusCode?: number | undefined);
|
|
14
|
+
}
|
|
15
|
+
export declare function runClassifierProfiles(input: {
|
|
16
|
+
profiles: readonly ClassifierProfileValue[];
|
|
17
|
+
state: ClassifierState;
|
|
18
|
+
questions: ClassifierQuestionDefinition[];
|
|
19
|
+
context: InternalProcessContext;
|
|
20
|
+
nodeId: NodeId;
|
|
21
|
+
deadline: number;
|
|
22
|
+
retryOnNon200?: boolean;
|
|
23
|
+
retryOnNon200RepeatTimes?: number;
|
|
24
|
+
retryOnNon200CooldownMs?: number;
|
|
25
|
+
onAttempt: (attempt: LLMAttempt) => void;
|
|
26
|
+
onRequestBody?: ClassifierProviderEvaluateArgs['onRequestBody'];
|
|
27
|
+
onResponseBody?: ClassifierProviderEvaluateArgs['onResponseBody'];
|
|
28
|
+
}): Promise<{
|
|
29
|
+
result: ClassifierProviderEvaluationResult;
|
|
30
|
+
provider: ReturnType<typeof getClassifierProvider>;
|
|
31
|
+
model: string;
|
|
32
|
+
}>;
|
|
@@ -2,11 +2,13 @@ import type { ClassifierCredentialNames } from './credentials.js';
|
|
|
2
2
|
import type { DataValue } from '../DataValue.js';
|
|
3
3
|
import { type ClassifierStateMessage, type PreparedClassifierState } from './state.js';
|
|
4
4
|
import { validateClassifierEvaluationResponse } from './response.js';
|
|
5
|
-
import type { ClassifierEvaluationResponse, ClassifierQuestionDefinition, PreparedClassifierQuestion } from './types.js';
|
|
5
|
+
import type { ClassifierFailureKind, ClassifierAttemptUsage, ClassifierEvaluationResponse, ClassifierQuestionDefinition, PreparedClassifierQuestion } from './types.js';
|
|
6
6
|
export { validateApiCompatibleClassifierResponse } from './response.js';
|
|
7
7
|
export declare const JEV_SYSTEM_ONE_ENDPOINT = "https://api.typesafe.ai/v1/systemone";
|
|
8
8
|
export declare const LIQUID_SYSTEM_ONE_ENDPOINT = "https://api.liquid.ai/decisions/v1/systemone";
|
|
9
9
|
export declare const OPENAI_DECISIONS_ENDPOINT = "https://api.openai.com/v1/decisions";
|
|
10
|
+
export declare const OPENROUTER_DECISIONS_ENDPOINT = "https://openrouter.ai/api/alpha/decisions";
|
|
11
|
+
export declare const PERPLEXITY_DECISIONS_ENDPOINT = "https://api.perplexity.ai/v1/decisions";
|
|
10
12
|
/** Jev's published USD rates. Keep this Core-owned rather than graph-authored. */
|
|
11
13
|
export declare const JEV_TOKEN_PRICING: {
|
|
12
14
|
readonly inputPerMillionTokens: 0.042;
|
|
@@ -61,6 +63,20 @@ export type ClassifierProviderEvaluationResult = {
|
|
|
61
63
|
responseBody: Record<string, unknown>;
|
|
62
64
|
};
|
|
63
65
|
export type ClassifierProviderEvaluateArgs = {
|
|
66
|
+
/** Privacy-bounded physical-attempt observer; never includes bodies or credentials. */
|
|
67
|
+
onAttempt?: (attempt: {
|
|
68
|
+
attemptIndex: number;
|
|
69
|
+
outcome: 'success' | 'failure' | 'aborted';
|
|
70
|
+
status?: number;
|
|
71
|
+
kind?: ClassifierProviderError['kind'];
|
|
72
|
+
error?: string;
|
|
73
|
+
classifierUsage?: ClassifierAttemptUsage;
|
|
74
|
+
/** Physical request through response validation, excluding retry waits. */
|
|
75
|
+
durationMs?: number;
|
|
76
|
+
}) => void;
|
|
77
|
+
/** Opt-in node diagnostics, separate from privacy-bounded attempt events. */
|
|
78
|
+
onRequestBody?: (getBody: () => Record<string, unknown>) => void;
|
|
79
|
+
onResponseBody?: (body: unknown) => void;
|
|
64
80
|
apiKey: string;
|
|
65
81
|
model: string;
|
|
66
82
|
questions: readonly ClassifierQuestionDefinition[];
|
|
@@ -88,6 +104,7 @@ type ClassifierProviderSpec = Omit<ClassifierProvider, 'evaluate' | 'evaluateInp
|
|
|
88
104
|
buildRequest(args: PreparedClassifierEvaluation): Record<string, unknown>;
|
|
89
105
|
validateResponse: typeof validateClassifierEvaluationResponse;
|
|
90
106
|
checkState?(state: PreparedClassifierState, check: () => void): void;
|
|
107
|
+
checkRequest?(request: PreparedClassifierEvaluation, check: () => void): void;
|
|
91
108
|
};
|
|
92
109
|
export type ApiCompatibleClassifierProviderConfig = {
|
|
93
110
|
id: string;
|
|
@@ -113,12 +130,26 @@ export type ApiCompatibleClassifierProviderConfig = {
|
|
|
113
130
|
export declare function createApiCompatibleClassifierProvider(config: ApiCompatibleClassifierProviderConfig): ClassifierProvider;
|
|
114
131
|
export declare const jevClassifierProvider: ClassifierProvider;
|
|
115
132
|
export declare const liquidClassifierProvider: ClassifierProvider;
|
|
133
|
+
/** Native Decisions API, not chat completions. Microsoft Decision-1 is text-only.
|
|
134
|
+
* https://openrouter.ai/microsoft/microsoft-decision-1
|
|
135
|
+
*/
|
|
136
|
+
export declare const openrouterClassifierProvider: ClassifierProvider;
|
|
116
137
|
/** Decisions-specific rates, not GPT-6 Luna's Chat/Responses cache/output rates.
|
|
117
138
|
* https://developers.openai.com/api/docs/guides/decisions#pricing-and-availability
|
|
118
139
|
*/
|
|
119
140
|
export declare const openaiClassifierProvider: ClassifierProvider;
|
|
141
|
+
/** https://docs.perplexity.ai/docs/decisions/quickstart */
|
|
142
|
+
export declare const perplexityClassifierProvider: ClassifierProvider;
|
|
120
143
|
/** Ordered so adding compatible providers does not alter authored IDs. */
|
|
121
144
|
export declare const classifierProviders: readonly ClassifierProvider[];
|
|
145
|
+
export declare class ClassifierProviderError extends Error {
|
|
146
|
+
readonly kind: 'configuration' | 'capability' | 'timeout' | 'transport' | 'http' | 'response-parsing' | 'response-validation';
|
|
147
|
+
readonly statusCode?: number | undefined;
|
|
148
|
+
constructor(message: string, kind: 'configuration' | 'capability' | 'timeout' | 'transport' | 'http' | 'response-parsing' | 'response-validation', statusCode?: number | undefined, options?: ErrorOptions);
|
|
149
|
+
}
|
|
150
|
+
export declare function classifierFailureKind(kind: ClassifierProviderError['kind'], status?: number): ClassifierFailureKind;
|
|
151
|
+
/** Bounded preparation/provider explanation, without traversing causes or capturing response bodies. */
|
|
152
|
+
export declare function classifierErrorMessage(error: unknown, apiKey?: string): string;
|
|
122
153
|
export declare function getClassifierProvider(id: string | undefined): ClassifierProvider;
|
|
123
154
|
export declare function getClassifierProviderEnvironmentVariableNames(): string[];
|
|
124
155
|
/**
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export type ClassifierQuestionType = 'choice' | 'score' | 'noul';
|
|
2
|
+
/** Secret-free classification used by fallback diagnostics and recording traces. */
|
|
3
|
+
export declare const classifierFailureKinds: readonly ["configuration", "capability", "authentication", "transport", "http", "timeout", "response-parsing", "response-validation"];
|
|
4
|
+
export type ClassifierFailureKind = (typeof classifierFailureKinds)[number];
|
|
5
|
+
/** Safe provider-reported receipt accounting; absent usage/cost is unknown, not zero. */
|
|
6
|
+
export type ClassifierAttemptUsage = {
|
|
7
|
+
inputTokens: number;
|
|
8
|
+
outputTokens: number;
|
|
9
|
+
estimatedCostUsd?: number;
|
|
10
|
+
};
|
|
2
11
|
export type ClassifierEntryEditorType = 'text' | 'lines' | 'object';
|
|
3
12
|
export type ClassifierStructuredValue = string | number | boolean | null | {
|
|
4
13
|
[key: string]: ClassifierStructuredValue;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
1
|
+
import type { EditorDefinition, EditorDefinitionGroup } from '../EditorDefinition.js';
|
|
2
2
|
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
3
3
|
import type { NodeBodySpec } from '../NodeBodySpec.js';
|
|
4
4
|
import type { ChartNode, NodeConnection, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
5
|
-
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
5
|
+
import { NodeImpl, type NodeRunActivityDescriptor, type NodeUIData } from '../NodeImpl.js';
|
|
6
6
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
7
|
-
import { type
|
|
8
|
-
export type ClassifierEvaluateNodeData = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { type ClassifierProfileConfiguration } from '../classifier/profile.js';
|
|
8
|
+
export type ClassifierEvaluateNodeData = ClassifierProfileConfiguration & {
|
|
9
|
+
configurationMode?: 'inline' | 'profile';
|
|
10
|
+
outputClassifierAttempts?: boolean;
|
|
11
|
+
outputClassifierProfileSummary?: boolean;
|
|
12
|
+
profileChainTimeoutMs?: number;
|
|
13
13
|
/** Adds the exact JSON body sent to the provider, excluding its auth header. */
|
|
14
14
|
outputRequestBody?: boolean;
|
|
15
15
|
/** Adds the complete parsed JSON body returned by the provider. */
|
|
@@ -22,10 +22,6 @@ export type ClassifierEvaluateNodeData = {
|
|
|
22
22
|
retryOnNon200RepeatTimes?: number;
|
|
23
23
|
retryOnNon200CooldownMs?: number;
|
|
24
24
|
timeoutMs?: number;
|
|
25
|
-
apiKeySource?: ClassifierApiKeySource;
|
|
26
|
-
apiKeyNamesByProvider?: Record<string, ClassifierCredentialNames | undefined>;
|
|
27
|
-
/** @deprecated Migrated into apiKeyNamesByProvider. */
|
|
28
|
-
apiKeyNames?: ClassifierCredentialNames;
|
|
29
25
|
};
|
|
30
26
|
export type ClassifierEvaluateNode = ChartNode<'classifierEvaluate', ClassifierEvaluateNodeData>;
|
|
31
27
|
export type ClassifierEvaluateBodySection = Readonly<{
|
|
@@ -36,6 +32,7 @@ export type ClassifierEvaluateBodySection = Readonly<{
|
|
|
36
32
|
}>[];
|
|
37
33
|
}>;
|
|
38
34
|
export declare class ClassifierEvaluateNodeImpl extends NodeImpl<ClassifierEvaluateNode> {
|
|
35
|
+
getRunActivityDescriptor(): NodeRunActivityDescriptor;
|
|
39
36
|
static create(): ClassifierEvaluateNode;
|
|
40
37
|
getInputDefinitions(connections: NodeConnection[]): NodeInputDefinition[];
|
|
41
38
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
@@ -44,7 +41,12 @@ export declare class ClassifierEvaluateNodeImpl extends NodeImpl<ClassifierEvalu
|
|
|
44
41
|
static getUIData(): NodeUIData;
|
|
45
42
|
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
46
43
|
private processRun;
|
|
44
|
+
private projectResult;
|
|
45
|
+
private profileEvidence;
|
|
46
|
+
private processProfiles;
|
|
47
47
|
}
|
|
48
|
+
/** Shared settings definition; constructing an unrelated node is unnecessary. */
|
|
49
|
+
export declare function getClassifierModelEditor(data: ClassifierProfileConfiguration): EditorDefinitionGroup<ClassifierEvaluateNode>;
|
|
48
50
|
/** Shared presentation model for the app's Classifier Evaluate card. */
|
|
49
51
|
export declare function getClassifierEvaluateBodySections(data: ClassifierEvaluateNodeData): readonly ClassifierEvaluateBodySection[];
|
|
50
52
|
export declare const classifierEvaluateNode: import("../NodeDefinition.js").NodeDefinition<ClassifierEvaluateNode>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
3
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
4
|
+
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
5
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
6
|
+
import { type ClassifierProfileConfiguration } from '../classifier/profile.js';
|
|
7
|
+
export type ClassifierProfileNode = ChartNode<'classifierProfile', ClassifierProfileConfiguration>;
|
|
8
|
+
export declare class ClassifierProfileNodeImpl extends NodeImpl<ClassifierProfileNode> {
|
|
9
|
+
static create(): ClassifierProfileNode;
|
|
10
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
11
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
12
|
+
getEditors(): EditorDefinition<ClassifierProfileNode>[];
|
|
13
|
+
getBody(): {
|
|
14
|
+
type: "markdown";
|
|
15
|
+
text: string;
|
|
16
|
+
};
|
|
17
|
+
static getUIData(): NodeUIData;
|
|
18
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
19
|
+
}
|
|
20
|
+
export declare const classifierProfileNode: import("../NodeDefinition.js").NodeDefinition<ClassifierProfileNode>;
|
|
@@ -2,6 +2,7 @@ import type { ChatMessage } from '../DataValue.js';
|
|
|
2
2
|
import type { GraphId } from '../NodeGraph.js';
|
|
3
3
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
4
4
|
import type { Outputs } from '../GraphProcessor.js';
|
|
5
|
+
import { type GraphCostBreakdown } from '../GraphBoundaryEffects.js';
|
|
5
6
|
import { normalizeToolCall } from '../chat-v2/toolCallCodec.js';
|
|
6
7
|
import { findAutoDelegateGraphCandidate } from '../chat-v2/toolHandlerResolver.js';
|
|
7
8
|
export type ToolCallDelegationConfig = {
|
|
@@ -20,6 +21,7 @@ export type ToolCallDelegationResult = {
|
|
|
20
21
|
record: DelegatedToolCallRecord;
|
|
21
22
|
/** Cost from this live delegation. Kept out of the replay record so replay cannot charge it again. */
|
|
22
23
|
cost?: number;
|
|
24
|
+
costBreakdown?: GraphCostBreakdown;
|
|
23
25
|
/** Internal trace disposition; never exposed through node ports. */
|
|
24
26
|
traceOutcome?: 'success' | 'passthrough-error';
|
|
25
27
|
};
|
|
@@ -43,7 +45,7 @@ export type DelegatedToolCallRecord = {
|
|
|
43
45
|
*/
|
|
44
46
|
export { findAutoDelegateGraphCandidate };
|
|
45
47
|
export declare function isDelegatedToolCallRecord(input: unknown): input is DelegatedToolCallRecord;
|
|
46
|
-
export declare function buildDelegatedToolCallOutputs(records: DelegatedToolCallRecord[], preToolMessage?: string, cost?: number): Outputs;
|
|
48
|
+
export declare function buildDelegatedToolCallOutputs(records: DelegatedToolCallRecord[], preToolMessage?: string, cost?: number, costBreakdown?: GraphCostBreakdown): Outputs;
|
|
47
49
|
/** @deprecated Use normalizeToolCall from the canonical chat-v2 codec. */
|
|
48
50
|
export declare const normalizeFunctionCallInput: typeof normalizeToolCall;
|
|
49
51
|
export declare function delegateToolCall(rawFunctionCall: unknown, context: InternalProcessContext, config: ToolCallDelegationConfig): Promise<ToolCallDelegationResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Shared inspector wording for LLM and Classifier profile suspension. */
|
|
2
|
+
export declare const profileSuspensionHints: {
|
|
3
|
+
readonly host: "Requires Studio Server or a host with shared profile health. Not available in standalone Rivet.";
|
|
4
|
+
readonly enable: "Suspend this profile after provider failures or timeouts. After suspension, allow one recovery attempt.";
|
|
5
|
+
readonly threshold: "Failures or timeouts within the failure window needed to suspend this profile.";
|
|
6
|
+
readonly window: "Rolling period for counting failures and timeouts.";
|
|
7
|
+
readonly duration: "Time to suspend this profile before one recovery attempt.";
|
|
8
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Lightweight entry point for file preparation without model/provider runtime initialization. */
|
|
2
|
+
export { deserializeProject, deserializeGraph, deserializeDatasets, serializeProject, serializeGraph, serializeDatasets, type CombinedDataset, } from './utils/serialization/serialization.js';
|
|
@@ -4,6 +4,7 @@ export type { RivetWebAppClientMessage, RivetWebAppRunEvent, RivetWebAppServerMe
|
|
|
4
4
|
export type { GraphProgress } from './model/GraphProgress.js';
|
|
5
5
|
export type { AgentResponseTrace } from './model/AgentResponseTrace.js';
|
|
6
6
|
export { isAgentResponseTrace } from './model/AgentResponseTrace.js';
|
|
7
|
+
export { buildAgentProfileAttemptInspectorRows, getClassifierRequestCount, formatClassifierRequestCount, getProfileAttemptOmissionNotice, isClassifierRequest, } from './model/AgentResponseTracePresentation.js';
|
|
7
8
|
export type { WebAppBrowserStorage, WebAppBrowserStorageBatchChange, WebAppBrowserStorageChange, WebAppBrowserStorageCommitResult, WebAppBrowserStorageEstimate, WebAppBrowserStorageMigration, WebAppBrowserStorageNamespace, WebAppBrowserStorageScope, WebAppBrowserStorageStatus, } from './model/WebAppBrowserStorage.js';
|
|
8
9
|
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';
|
|
9
10
|
export type { RivetWebAppBrowserStorageClientMessage, RivetWebAppBrowserStorageRpcAdvertisedLimits, RivetWebAppBrowserStorageServerMessage, RivetWebAppStorageCommitAckMessage, RivetWebAppStorageCommitStartMessage, RivetWebAppStorageErrorMessage, RivetWebAppStorageGetMessage, RivetWebAppStorageTransferAckMessage, RivetWebAppStorageTransferStartMessage, } from './model/WebAppBrowserStorageRpc.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valerypopoff/rivet2-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/cjs/bundle.cjs",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
"require": "./dist/cjs/bundle.cjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
+
"./serialization": {
|
|
28
|
+
"types": "./dist/types/serialization.d.ts",
|
|
29
|
+
"import": "./dist/esm/serialization.js",
|
|
30
|
+
"require": "./dist/cjs/serialization.cjs"
|
|
31
|
+
},
|
|
27
32
|
"./web-app-runtime": {
|
|
28
33
|
"types": "./dist/types/webAppRuntime.d.ts",
|
|
29
34
|
"import": "./dist/esm/webAppRuntime.js",
|
|
@@ -61,6 +66,7 @@
|
|
|
61
66
|
"@google-cloud/vertexai": "^1.12.0",
|
|
62
67
|
"@google/genai": "^1.52.0",
|
|
63
68
|
"@huggingface/inference": "^2.6.4",
|
|
69
|
+
"@openrouter/ai-sdk-provider": "2.10.0",
|
|
64
70
|
"acorn": "^8.14.0",
|
|
65
71
|
"ai": "6.0.116",
|
|
66
72
|
"assemblyai": "^4.6.0",
|