@valerypopoff/rivet2-core 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bundle.cjs +517 -96
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/cjs/webAppRuntime.cjs +1537 -121
- package/dist/cjs/webAppRuntime.cjs.map +4 -4
- package/dist/esm/api/createProcessor.js +2 -0
- package/dist/esm/exports.js +2 -0
- package/dist/esm/model/AgentResponseTrace.js +16 -0
- package/dist/esm/model/GraphProcessor.js +14 -0
- package/dist/esm/model/NodeExclusionPolicy.js +9 -1
- package/dist/esm/model/ProcessContextBuilder.js +2 -1
- package/dist/esm/model/RecordingPlayer.js +8 -0
- package/dist/esm/model/SubprocessorBridge.js +1 -0
- package/dist/esm/model/UiGraphActionProtocol.js +46 -4
- package/dist/esm/model/UiGraphBrowserRuntime.js +15 -1
- package/dist/esm/model/UiGraphIndexedDbPersistence.js +523 -0
- package/dist/esm/model/UiGraphRendererStyles.js +14 -0
- package/dist/esm/model/WebAppBrowserStorage.js +653 -0
- package/dist/esm/model/WebAppBrowserStorageRpc.js +200 -0
- package/dist/esm/model/chat-v2/chatV2CallObserver.js +1 -0
- package/dist/esm/model/chat-v2/chatV2EditorCache.js +2 -33
- package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +1 -0
- package/dist/esm/model/chat-v2/llmChatV2OutputClone.js +42 -0
- package/dist/esm/model/chat-v2/llmInvocationCoordinator.js +31 -2
- package/dist/esm/model/chat-v2/llmProfile.js +17 -1
- package/dist/esm/model/chat-v2/llmProfileFallback.js +17 -5
- package/dist/esm/model/chat-v2/llmProfileHealthStore.js +2 -0
- package/dist/esm/model/chat-v2/llmProfileNodeRuntime.js +4 -0
- package/dist/esm/model/chat-v2/toolContinuation.js +27 -1
- package/dist/esm/model/nodes/LLMChatV2Node.js +21 -2
- package/dist/esm/recording/ExecutionRecorder.js +1 -0
- package/dist/esm/webAppRuntime.js +5 -2
- package/dist/types/api/createProcessor.d.ts +2 -0
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/model/AgentResponseTrace.d.ts +1 -0
- package/dist/types/model/ExecutorProtocol.d.ts +9 -1
- package/dist/types/model/GraphProcessor.d.ts +3 -1
- package/dist/types/model/NodeExclusionPolicy.d.ts +6 -0
- package/dist/types/model/ProcessContext.d.ts +33 -0
- package/dist/types/model/ProcessContextBuilder.d.ts +2 -1
- package/dist/types/model/UiGraphActionProtocol.d.ts +8 -3
- package/dist/types/model/UiGraphBrowserRuntime.d.ts +6 -0
- package/dist/types/model/UiGraphIndexedDbPersistence.d.ts +50 -0
- package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
- package/dist/types/model/WebAppBrowserStorage.d.ts +90 -0
- package/dist/types/model/WebAppBrowserStorageRpc.d.ts +85 -0
- package/dist/types/model/chat-v2/chatV2Types.d.ts +3 -1
- package/dist/types/model/chat-v2/llmChatV2OutputClone.d.ts +3 -0
- package/dist/types/model/chat-v2/llmInvocationCoordinator.d.ts +5 -1
- package/dist/types/model/chat-v2/llmProfileFallback.d.ts +4 -0
- package/dist/types/model/chat-v2/llmProfileHealthStore.d.ts +10 -0
- package/dist/types/model/chat-v2/llmProfileTypes.d.ts +6 -0
- package/dist/types/model/chat-v2/toolContinuation.d.ts +14 -0
- package/dist/types/recording/RecordedEvents.d.ts +11 -0
- package/dist/types/webAppRuntime.d.ts +8 -2
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type RivetStoredValue } from './StoredValueStore.js';
|
|
2
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_DATABASE = "rivet-web-app-browser-storage";
|
|
3
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_SCHEMA_VERSION = 1;
|
|
4
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_CHUNK_BYTES: number;
|
|
5
|
+
export declare const RIVET_WEB_APP_LEGACY_RETENTION_MS: number;
|
|
6
|
+
export type WebAppBrowserStorageNamespace = 'chat-state' | 'response-traces' | 'stored-values';
|
|
7
|
+
export type WebAppBrowserStorageScope = Readonly<{
|
|
8
|
+
origin: string;
|
|
9
|
+
pathname: string;
|
|
10
|
+
uiGraphId: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type WebAppBrowserStorageStatus = Readonly<{
|
|
13
|
+
durable: boolean;
|
|
14
|
+
reason?: 'indexeddb-unavailable' | 'open-failed' | 'write-failed';
|
|
15
|
+
}>;
|
|
16
|
+
export type WebAppBrowserStorageCommitResult = WebAppBrowserStorageStatus & Readonly<{
|
|
17
|
+
hasMemoryOnlyRecords?: boolean;
|
|
18
|
+
revision: number;
|
|
19
|
+
}>;
|
|
20
|
+
export type WebAppBrowserStorageChange = Readonly<{
|
|
21
|
+
key: string;
|
|
22
|
+
namespace: WebAppBrowserStorageNamespace;
|
|
23
|
+
revision: number;
|
|
24
|
+
}>;
|
|
25
|
+
export type WebAppBrowserStorageBatchChange = Readonly<{
|
|
26
|
+
key: string;
|
|
27
|
+
namespace: WebAppBrowserStorageNamespace;
|
|
28
|
+
value?: RivetStoredValue;
|
|
29
|
+
}>;
|
|
30
|
+
export type WebAppBrowserStorageEstimate = Readonly<{
|
|
31
|
+
quota?: number;
|
|
32
|
+
usage?: number;
|
|
33
|
+
}>;
|
|
34
|
+
export type WebAppBrowserStorageEntry = Readonly<{
|
|
35
|
+
key: string;
|
|
36
|
+
value: RivetStoredValue;
|
|
37
|
+
}>;
|
|
38
|
+
export interface WebAppBrowserStorage {
|
|
39
|
+
initialize(scope: WebAppBrowserStorageScope): Promise<WebAppBrowserStorageStatus>;
|
|
40
|
+
get(namespace: WebAppBrowserStorageNamespace, key: string): Promise<RivetStoredValue | undefined>;
|
|
41
|
+
list(namespace: WebAppBrowserStorageNamespace): Promise<WebAppBrowserStorageEntry[]>;
|
|
42
|
+
set(namespace: WebAppBrowserStorageNamespace, key: string, value: RivetStoredValue): Promise<WebAppBrowserStorageCommitResult>;
|
|
43
|
+
delete(namespace: WebAppBrowserStorageNamespace, key: string): Promise<WebAppBrowserStorageCommitResult>;
|
|
44
|
+
commitBatch(changes: readonly WebAppBrowserStorageBatchChange[]): Promise<WebAppBrowserStorageCommitResult>;
|
|
45
|
+
subscribe(listener: (change: WebAppBrowserStorageChange) => void): () => void;
|
|
46
|
+
estimateUsage(): Promise<WebAppBrowserStorageEstimate>;
|
|
47
|
+
dispose(): void;
|
|
48
|
+
}
|
|
49
|
+
export type WebAppBrowserStorageMigration = Readonly<{
|
|
50
|
+
cleanupAfter: number;
|
|
51
|
+
completedAt: number;
|
|
52
|
+
key: string;
|
|
53
|
+
legacyKey: string;
|
|
54
|
+
namespace: WebAppBrowserStorageNamespace;
|
|
55
|
+
}>;
|
|
56
|
+
export type IndexedDbWebAppBrowserStorageOptions = Readonly<{
|
|
57
|
+
broadcastChannelFactory?: (name: string) => BroadcastChannel;
|
|
58
|
+
databaseName?: string;
|
|
59
|
+
indexedDB?: IDBFactory | null;
|
|
60
|
+
now?: () => number;
|
|
61
|
+
storageManager?: Pick<StorageManager, 'estimate'>;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Browser-local Rivet web-app persistence. Values are chunked to avoid relying
|
|
65
|
+
* on browser-specific maximum IndexedDB record sizes. The memory mirror is
|
|
66
|
+
* updated even when persistence fails so the current page remains usable.
|
|
67
|
+
*/
|
|
68
|
+
export declare class IndexedDbWebAppBrowserStorage implements WebAppBrowserStorage {
|
|
69
|
+
#private;
|
|
70
|
+
constructor(options?: IndexedDbWebAppBrowserStorageOptions);
|
|
71
|
+
initialize(scope: WebAppBrowserStorageScope): Promise<WebAppBrowserStorageStatus>;
|
|
72
|
+
get(namespace: WebAppBrowserStorageNamespace, key: string): Promise<RivetStoredValue | undefined>;
|
|
73
|
+
list(namespace: WebAppBrowserStorageNamespace): Promise<WebAppBrowserStorageEntry[]>;
|
|
74
|
+
set(namespace: WebAppBrowserStorageNamespace, key: string, value: RivetStoredValue): Promise<WebAppBrowserStorageCommitResult>;
|
|
75
|
+
delete(namespace: WebAppBrowserStorageNamespace, key: string): Promise<WebAppBrowserStorageCommitResult>;
|
|
76
|
+
commitBatch(changes: readonly WebAppBrowserStorageBatchChange[]): Promise<WebAppBrowserStorageCommitResult>;
|
|
77
|
+
subscribe(listener: (change: WebAppBrowserStorageChange) => void): () => void;
|
|
78
|
+
hasMemoryOnlyRecord(namespace: WebAppBrowserStorageNamespace, key: string): boolean;
|
|
79
|
+
estimateUsage(): Promise<WebAppBrowserStorageEstimate>;
|
|
80
|
+
dispose(): void;
|
|
81
|
+
getMigration(legacyKey: string): Promise<WebAppBrowserStorageMigration | undefined>;
|
|
82
|
+
recordMigration(migration: WebAppBrowserStorageMigration): Promise<void>;
|
|
83
|
+
listMigrations(): Promise<WebAppBrowserStorageMigration[]>;
|
|
84
|
+
}
|
|
85
|
+
export declare class WebAppBrowserStoragePersistenceError extends Error {
|
|
86
|
+
readonly revision: number;
|
|
87
|
+
constructor(message: string, options: ErrorOptions & {
|
|
88
|
+
revision: number;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type RivetStoredValue, type RivetStoredValueRecord } from './StoredValueStore.js';
|
|
2
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_RPC_CAPABILITY: "browser-storage-rpc-v2";
|
|
3
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_RPC_VERSION: 2;
|
|
4
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_SAFE_FALLBACK_BYTES: number;
|
|
5
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_MAX_VALUE_BYTES: number;
|
|
6
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_MAX_ACTION_BYTES: number;
|
|
7
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_MAX_ACTIVE_BYTES: number;
|
|
8
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_DEFAULT_TRANSFER_TIMEOUT_MS = 60000;
|
|
9
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_TRANSFER_CHUNK_BYTES: number;
|
|
10
|
+
export declare const RIVET_WEB_APP_BROWSER_STORAGE_BINARY_FRAME_HEADER_BYTES = 40;
|
|
11
|
+
export type RivetWebAppBrowserStorageRpcAdvertisedLimits = Readonly<{
|
|
12
|
+
maxActionBytes: number;
|
|
13
|
+
maxValueBytes: number;
|
|
14
|
+
transferTimeoutMs: number;
|
|
15
|
+
}>;
|
|
16
|
+
export type RivetWebAppStorageGetMessage = {
|
|
17
|
+
type: 'storage.get';
|
|
18
|
+
requestId: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
storageSessionId: string;
|
|
21
|
+
storageRequestId: string;
|
|
22
|
+
key: string;
|
|
23
|
+
};
|
|
24
|
+
export type RivetWebAppStorageTransferStartMessage = {
|
|
25
|
+
type: 'storage.transfer.start';
|
|
26
|
+
requestId: string;
|
|
27
|
+
runId: string;
|
|
28
|
+
storageSessionId: string;
|
|
29
|
+
storageRequestId: string;
|
|
30
|
+
transferId: string;
|
|
31
|
+
byteLength: number;
|
|
32
|
+
chunkCount: number;
|
|
33
|
+
found: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type RivetWebAppStorageTransferAckMessage = {
|
|
36
|
+
type: 'storage.transfer.ack';
|
|
37
|
+
requestId: string;
|
|
38
|
+
runId: string;
|
|
39
|
+
storageSessionId: string;
|
|
40
|
+
storageRequestId: string;
|
|
41
|
+
transferId: string;
|
|
42
|
+
};
|
|
43
|
+
export type RivetWebAppStorageCommitStartMessage = {
|
|
44
|
+
type: 'storage.commit.start';
|
|
45
|
+
requestId: string;
|
|
46
|
+
runId: string;
|
|
47
|
+
storageSessionId: string;
|
|
48
|
+
transferId: string;
|
|
49
|
+
byteLength: number;
|
|
50
|
+
chunkCount: number;
|
|
51
|
+
};
|
|
52
|
+
export type RivetWebAppStorageCommitAckMessage = {
|
|
53
|
+
type: 'storage.commit.ack';
|
|
54
|
+
requestId: string;
|
|
55
|
+
runId: string;
|
|
56
|
+
storageSessionId: string;
|
|
57
|
+
transferId: string;
|
|
58
|
+
};
|
|
59
|
+
export type RivetWebAppStorageErrorMessage = {
|
|
60
|
+
type: 'storage.error';
|
|
61
|
+
requestId: string;
|
|
62
|
+
runId: string;
|
|
63
|
+
storageSessionId: string;
|
|
64
|
+
storageRequestId?: string;
|
|
65
|
+
transferId?: string;
|
|
66
|
+
code: 'storage_unavailable' | 'storage_invalid' | 'storage_too_large' | 'storage_capacity';
|
|
67
|
+
error: string;
|
|
68
|
+
retryable: boolean;
|
|
69
|
+
};
|
|
70
|
+
export type RivetWebAppBrowserStorageClientMessage = RivetWebAppStorageTransferStartMessage | RivetWebAppStorageCommitAckMessage | RivetWebAppStorageErrorMessage;
|
|
71
|
+
export type RivetWebAppBrowserStorageServerMessage = RivetWebAppStorageGetMessage | RivetWebAppStorageTransferAckMessage | RivetWebAppStorageCommitStartMessage | RivetWebAppStorageErrorMessage;
|
|
72
|
+
export declare function parseRivetWebAppBrowserStorageClientMessage(value: unknown): RivetWebAppBrowserStorageClientMessage | undefined;
|
|
73
|
+
export declare function parseRivetWebAppBrowserStorageServerMessage(value: unknown): RivetWebAppBrowserStorageServerMessage | undefined;
|
|
74
|
+
export declare function serializeRivetWebAppStoredValue(value: RivetStoredValue): Uint8Array;
|
|
75
|
+
export declare function deserializeRivetWebAppStoredValue(bytes: Uint8Array): RivetStoredValue;
|
|
76
|
+
export declare function serializeRivetWebAppStoredValuePatch(patch: RivetStoredValueRecord): Uint8Array;
|
|
77
|
+
export declare function deserializeRivetWebAppStoredValuePatch(bytes: Uint8Array): RivetStoredValueRecord;
|
|
78
|
+
export declare function splitRivetWebAppStorageTransfer(bytes: Uint8Array): Uint8Array[];
|
|
79
|
+
export declare function encodeRivetWebAppStorageBinaryFrame(storageSessionId: string, transferId: string, chunkIndex: number, bytes: Uint8Array): Uint8Array;
|
|
80
|
+
export declare function decodeRivetWebAppStorageBinaryFrame(frame: ArrayBuffer | ArrayBufferView): {
|
|
81
|
+
storageSessionId: string;
|
|
82
|
+
transferId: string;
|
|
83
|
+
chunkIndex: number;
|
|
84
|
+
bytes: Uint8Array;
|
|
85
|
+
} | undefined;
|
|
@@ -149,6 +149,8 @@ export type RunChatV2PipelineOptions = {
|
|
|
149
149
|
* provider.
|
|
150
150
|
*/
|
|
151
151
|
profileIndex?: number | undefined;
|
|
152
|
+
/** User-facing title from the source LLM Profile node. Never sent to the provider. */
|
|
153
|
+
profileName?: string | undefined;
|
|
152
154
|
profileHealthKey?: string | undefined;
|
|
153
155
|
profileHealthState?: RivetLLMProfileHealthState | undefined;
|
|
154
156
|
roundIndex?: number | undefined;
|
|
@@ -160,7 +162,7 @@ export type RunChatV2PipelineOptions = {
|
|
|
160
162
|
streamInactivityTimeoutMs?: number | undefined;
|
|
161
163
|
onStreamActivity?: (() => void) | undefined;
|
|
162
164
|
onBeforeProviderRetry?: ((cooldownMs: number) => void | Promise<void>) | undefined;
|
|
163
|
-
context: Pick<InternalProcessContext, 'signal' | 'onPartialOutputs'> & Partial<Pick<InternalProcessContext, 'node' | 'onChatV2CallFinished' | 'processId'>>;
|
|
165
|
+
context: Pick<InternalProcessContext, 'signal' | 'onPartialOutputs'> & Partial<Pick<InternalProcessContext, 'node' | 'onChatV2CallFinished' | 'processId' | 'llmProfileHealthExecutionCorrelationId'>>;
|
|
164
166
|
executeStream?: ChatV2StreamExecutor | undefined;
|
|
165
167
|
executeGenerate?: ChatV2GenerateExecutor | undefined;
|
|
166
168
|
};
|
|
@@ -2,6 +2,7 @@ import type { ChatV2PipelineResult } from './chatV2Types.js';
|
|
|
2
2
|
import type { LLMChatV2RuntimeConfig } from './llmChatV2NodeRuntime.js';
|
|
3
3
|
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
4
4
|
import type { ToolCallContinuation } from '../ToolCallContinuation.js';
|
|
5
|
+
import { type LLMChatOutputSnapshotDescriptor } from './toolContinuation.js';
|
|
5
6
|
import type { LLMInvocationJournal } from './llmInvocationJournal.js';
|
|
6
7
|
/**
|
|
7
8
|
* Owns the LLM-level recovery and continuation decision boundary. The node
|
|
@@ -13,4 +14,7 @@ export declare function executeLLMInvocation(params: {
|
|
|
13
14
|
journal: LLMInvocationJournal;
|
|
14
15
|
runtime: LLMChatV2RuntimeConfig;
|
|
15
16
|
toolCallContinuation: ToolCallContinuation | undefined;
|
|
16
|
-
}): Promise<
|
|
17
|
+
}): Promise<{
|
|
18
|
+
result: ChatV2PipelineResult;
|
|
19
|
+
terminalSnapshot?: LLMChatOutputSnapshotDescriptor;
|
|
20
|
+
}>;
|
|
@@ -5,6 +5,8 @@ export type LLMAttempt = {
|
|
|
5
5
|
roundIndex: number;
|
|
6
6
|
/** Present when a From profile candidate produced this attempt. */
|
|
7
7
|
profileIndex?: number;
|
|
8
|
+
/** User-facing title captured from the source LLM Profile node. */
|
|
9
|
+
profileName?: string;
|
|
8
10
|
provider: ChatV2Provider;
|
|
9
11
|
model: string;
|
|
10
12
|
customProviderApi?: CustomProviderApi;
|
|
@@ -29,6 +31,8 @@ export type LLMProfileFallbackHealth = {
|
|
|
29
31
|
export type LLMProfileFallbackCandidate = {
|
|
30
32
|
provider: ChatV2Provider;
|
|
31
33
|
model: string;
|
|
34
|
+
/** User-facing title captured from the source LLM Profile node. */
|
|
35
|
+
profileName?: string;
|
|
32
36
|
customProviderApi?: CustomProviderApi;
|
|
33
37
|
health?: LLMProfileFallbackHealth;
|
|
34
38
|
};
|
|
@@ -29,6 +29,8 @@ export type RivetLLMProfileHealthIdentity = {
|
|
|
29
29
|
key: string;
|
|
30
30
|
projectId?: ProjectId;
|
|
31
31
|
profileNodeId?: NodeId;
|
|
32
|
+
/** Current source-node title used only for operator-facing identification. */
|
|
33
|
+
profileName?: string;
|
|
32
34
|
provider: ChatV2Provider;
|
|
33
35
|
model: string;
|
|
34
36
|
customProviderApi?: CustomProviderApi;
|
|
@@ -41,6 +43,8 @@ export declare function createRivetLLMProfileHealthIdentity(params: {
|
|
|
41
43
|
chatNodeHeaders?: Record<string, string> | undefined;
|
|
42
44
|
projectId?: ProjectId;
|
|
43
45
|
profileNodeId?: NodeId;
|
|
46
|
+
/** Current source-node title. It is intentionally excluded from the key. */
|
|
47
|
+
profileName?: string;
|
|
44
48
|
}): RivetLLMProfileHealthIdentity;
|
|
45
49
|
export type RivetLLMProfileHealthState = 'closed' | 'open' | 'half-open';
|
|
46
50
|
export type RivetLLMProfileHealthSnapshot = {
|
|
@@ -69,6 +73,12 @@ export type RivetLLMProfileHealthFinishRequest = {
|
|
|
69
73
|
policy: RivetLLMProfileCircuitBreakerPolicy;
|
|
70
74
|
permitId: string;
|
|
71
75
|
outcome: RivetLLMProfileHealthOutcome;
|
|
76
|
+
/**
|
|
77
|
+
* Host-owned, privacy-bounded execution correlation. Studio Server uses this
|
|
78
|
+
* only to join an unhealthy profile result to its normal run recording after
|
|
79
|
+
* that recording has finished persisting.
|
|
80
|
+
*/
|
|
81
|
+
executionCorrelationId?: string;
|
|
72
82
|
};
|
|
73
83
|
export type RivetLLMProfileHealthRenewRequest = {
|
|
74
84
|
identity: RivetLLMProfileHealthIdentity;
|
|
@@ -12,6 +12,12 @@ export type LLMProfileValue = {
|
|
|
12
12
|
version: typeof LLM_PROFILE_VALUE_VERSION;
|
|
13
13
|
configuration: LLMChatV2ProfileData;
|
|
14
14
|
credential: ChatV2CredentialResult;
|
|
15
|
+
/**
|
|
16
|
+
* User-facing title captured from the source LLM Profile node. It is
|
|
17
|
+
* diagnostic metadata only: changing a node title must not change provider
|
|
18
|
+
* resolution, caching, or circuit-breaker identity.
|
|
19
|
+
*/
|
|
20
|
+
profileName?: string;
|
|
15
21
|
/** Stable privacy-bounded identity used by optional cross-run health policy. */
|
|
16
22
|
healthIdentity?: RivetLLMProfileHealthIdentity;
|
|
17
23
|
};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { ChatMessageDataValue, GptFunction } from '../DataValue.js';
|
|
2
|
+
import type { Outputs } from '../GraphProcessor.js';
|
|
2
3
|
import type { ChatV2PipelineResult, ChatV2PipelineRoundOptions } from './chatV2Types.js';
|
|
3
4
|
import type { StreamedFunctionCall } from '../chat/streamChatResponse.js';
|
|
4
5
|
import type { DelegatedToolCallRecord } from '../nodes/toolCallDelegation.js';
|
|
6
|
+
import type { LLMChatOutputSnapshotKind, LLMChatOutputSnapshotOutcome } from '../ProcessContext.js';
|
|
7
|
+
export type LLMChatOutputSnapshotDescriptor = {
|
|
8
|
+
entryId: string;
|
|
9
|
+
roundIndex: number;
|
|
10
|
+
kind: LLMChatOutputSnapshotKind;
|
|
11
|
+
outcome: LLMChatOutputSnapshotOutcome;
|
|
12
|
+
};
|
|
5
13
|
export type ToolContinuationOptions = ChatV2PipelineRoundOptions & {
|
|
6
14
|
autoContinue: boolean;
|
|
7
15
|
maxToolRounds: number;
|
|
@@ -9,6 +17,12 @@ export type ToolContinuationOptions = ChatV2PipelineRoundOptions & {
|
|
|
9
17
|
delegateToolCall: (toolCall: StreamedFunctionCall) => Promise<ToolContinuationToolResult>;
|
|
10
18
|
delegateToolCallRound?: (toolCalls: StreamedFunctionCall[], preToolMessage: string) => Promise<ToolContinuationToolResult[]>;
|
|
11
19
|
runPipeline: (options: ChatV2PipelineRoundOptions) => Promise<ChatV2PipelineResult>;
|
|
20
|
+
/** Emits an immutable completed model page before its delegated tools run. */
|
|
21
|
+
onCompletedModelRound?: (snapshot: LLMChatOutputSnapshotDescriptor & {
|
|
22
|
+
outputs: Outputs;
|
|
23
|
+
}) => void;
|
|
24
|
+
/** Describes the terminal page; the node emits it after terminal projection. */
|
|
25
|
+
onTerminalRound?: (snapshot: LLMChatOutputSnapshotDescriptor) => void;
|
|
12
26
|
};
|
|
13
27
|
export type ToolContinuationToolResult = ChatMessageDataValue & {
|
|
14
28
|
delegatedToolCall?: DelegatedToolCallRecord;
|
|
@@ -95,6 +95,17 @@ export type RecordedEventsMap = OverrideProperties<ProcessEvents, {
|
|
|
95
95
|
processId: ProcessId;
|
|
96
96
|
progress: ProcessEvents['progress']['progress'];
|
|
97
97
|
}>;
|
|
98
|
+
/** Display-only output page for one completed logical LLM Chat round. */
|
|
99
|
+
llmChatOutputSnapshot: WithOptionalExecution<{
|
|
100
|
+
nodeId: NodeId;
|
|
101
|
+
processId: ProcessId;
|
|
102
|
+
entryId: string;
|
|
103
|
+
roundIndex: number;
|
|
104
|
+
splitIndex: number;
|
|
105
|
+
kind: ProcessEvents['llmChatOutputSnapshot']['kind'];
|
|
106
|
+
outcome: ProcessEvents['llmChatOutputSnapshot']['outcome'];
|
|
107
|
+
outputs: Outputs;
|
|
108
|
+
}>;
|
|
98
109
|
/** Called when the outputs of a node have been cleared entirely. If processId is present, only the one process() should be cleared. */
|
|
99
110
|
nodeOutputsCleared: WithOptionalExecution<{
|
|
100
111
|
nodeId: NodeId;
|
|
@@ -4,9 +4,15 @@ 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 type { WebAppBrowserStorage, WebAppBrowserStorageBatchChange, WebAppBrowserStorageChange, WebAppBrowserStorageCommitResult, WebAppBrowserStorageEstimate, WebAppBrowserStorageMigration, WebAppBrowserStorageNamespace, WebAppBrowserStorageScope, WebAppBrowserStorageStatus, } from './model/WebAppBrowserStorage.js';
|
|
8
|
+
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
|
+
export type { RivetWebAppBrowserStorageClientMessage, RivetWebAppBrowserStorageRpcAdvertisedLimits, RivetWebAppBrowserStorageServerMessage, RivetWebAppStorageCommitAckMessage, RivetWebAppStorageCommitStartMessage, RivetWebAppStorageErrorMessage, RivetWebAppStorageGetMessage, RivetWebAppStorageTransferAckMessage, RivetWebAppStorageTransferStartMessage, } from './model/WebAppBrowserStorageRpc.js';
|
|
10
|
+
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';
|
|
11
|
+
export type { UiGraphBrowserPersistenceOptions, UiGraphBrowserPersistenceDiagnostic, UiGraphBrowserPersistenceWarning, } from './model/UiGraphIndexedDbPersistence.js';
|
|
12
|
+
export { UiGraphBrowserPersistence } from './model/UiGraphIndexedDbPersistence.js';
|
|
7
13
|
export type { RivetMarkdownSanitizerPolicy } from './model/MarkdownSanitizationPolicy.js';
|
|
8
14
|
export type { UiGraphChatMessagePresentation, UiGraphChatMessagePresentationOptions, UiGraphChatMessageTimestampPresentation, } from './model/UiGraphBrowserRuntime.js';
|
|
9
|
-
export { createUiGraphChatHistoryFlushStatePatch, createUiGraphChatMessageRemovalStatePatch, createUiGraphChatPinStatePatch, createUiGraphChatSubmissionStatePatch, getUiGraphActionState, getUiGraphChatDraftStateKey, getUiGraphChatMessagesStateKey, } from './model/UiGraph.js';
|
|
15
|
+
export { createUiGraphChatHistoryFlushStatePatch, createUiGraphChatMessageRemovalStatePatch, createUiGraphChatPinStatePatch, createUiGraphChatSubmissionStatePatch, getUiGraphActionState, getUiGraphChatDraftStateKey, getUiGraphChatMessagesStateKey, getUiGraphChatPinsStateKey, } from './model/UiGraph.js';
|
|
10
16
|
export { applyUiGraphStatePatch, createUiGraphActionExecutionController, createUiGraphInteractionController, getUiGraphComponentRenderModel, getUiGraphJsonOutputFilename, getUiGraphProgressiveJsonOutputChunks, } from './model/UiGraphRuntimeModel.js';
|
|
11
17
|
export { parseRivetWebAppClientMessage, parseRivetWebAppServerMessage, RIVET_WEB_APP_ACTION_PROTOCOL_VERSION, } from './model/UiGraphActionProtocol.js';
|
|
12
|
-
export { copyUiGraphText, applyUiGraphWebAppStorageActionPatch, applyUiGraphWebAppStoragePatch, clearUiGraphChatSearchMatches, downloadUiGraphJsonOutput, enhanceUiGraphChatJsonCodeBlocks, hasUiGraphChatPersistentStateChanged, getUiGraphChatPersistentState, getUiGraphChatMessagePresentations, getUiGraphChatStorageKey, getUiGraphWebAppStorageKey, highlightUiGraphChatSearchMatches, loadUiGraphChatPersistentState, loadUiGraphWebAppStorage, observeUiGraphOutputResizeBounds, revealUiGraphChatElement, revealUiGraphChatSearchMatch, saveUiGraphChatPersistentState, saveUiGraphResponseTrace, loadUiGraphResponseTrace, pruneUiGraphResponseTraces, } from './model/UiGraphBrowserRuntime.js';
|
|
18
|
+
export { copyUiGraphText, applyUiGraphWebAppStorageActionPatch, applyUiGraphWebAppStorageActionPatchAsync, applyUiGraphWebAppStoragePatch, clearUiGraphChatSearchMatches, downloadUiGraphJsonOutput, enhanceUiGraphChatJsonCodeBlocks, hasUiGraphChatPersistentStateChanged, getUiGraphChatPersistentState, getUiGraphChatMessagePresentations, getUiGraphChatStorageKey, getUiGraphResponseTraceStorageKey, getUiGraphWebAppStorageKey, highlightUiGraphChatSearchMatches, loadUiGraphChatPersistentState, loadUiGraphWebAppStorage, observeUiGraphOutputResizeBounds, revealUiGraphChatElement, revealUiGraphChatSearchMatch, saveUiGraphChatPersistentState, saveUiGraphResponseTrace, loadUiGraphResponseTrace, pruneUiGraphResponseTraces, } from './model/UiGraphBrowserRuntime.js';
|