@valerypopoff/rivet2-core 2.1.1 → 2.1.3

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.
Files changed (53) hide show
  1. package/dist/cjs/bundle.cjs +925 -433
  2. package/dist/cjs/bundle.cjs.map +4 -4
  3. package/dist/esm/api/processSettings.js +11 -1
  4. package/dist/esm/exports.js +2 -0
  5. package/dist/esm/model/GraphProcessor.js +24 -45
  6. package/dist/esm/model/GraphRunLifecycle.js +67 -0
  7. package/dist/esm/model/MarkdownSanitizationPolicy.js +38 -0
  8. package/dist/esm/model/UiGraph.js +57 -0
  9. package/dist/esm/model/UiGraphRendererStyles.js +82 -0
  10. package/dist/esm/model/UiGraphRuntimeModel.js +71 -0
  11. package/dist/esm/model/chat-v2/aiSdkBridge.js +1 -1
  12. package/dist/esm/model/chat-v2/chatV2EditorCache.js +2 -2
  13. package/dist/esm/model/chat-v2/chatV2Pipeline.js +35 -48
  14. package/dist/esm/model/chat-v2/chatV2ProviderProfile.js +98 -0
  15. package/dist/esm/model/chat-v2/chatV2RequestPlan.js +64 -0
  16. package/dist/esm/model/chat-v2/chatV2RuntimeOptions.js +13 -36
  17. package/dist/esm/model/chat-v2/index.js +2 -0
  18. package/dist/esm/model/chat-v2/llmChatV2NodeData.js +1 -0
  19. package/dist/esm/model/chat-v2/llmChatV2NodeEditors.js +31 -11
  20. package/dist/esm/model/chat-v2/llmChatV2NodeRuntime.js +21 -9
  21. package/dist/esm/model/chat-v2/providerOptions.js +12 -38
  22. package/dist/esm/model/nodes/LLMChatV2Node.js +3 -3
  23. package/dist/esm/plugins/autoevals/AutoEvalsNode.js +3 -1
  24. package/dist/esm/plugins/gentrace/gentraceSdk.js +8 -0
  25. package/dist/esm/plugins/gentrace/plugin.js +5 -4
  26. package/dist/esm/plugins/google/google.js +9 -7
  27. package/dist/esm/utils/getPluginConfig.js +15 -3
  28. package/dist/esm/utils/pQueueCompat.js +1 -1
  29. package/dist/esm/utils/serialization/serializationUtils.js +35 -0
  30. package/dist/esm/utils/serialization/serialization_v4.js +5 -4
  31. package/dist/esm/webAppRuntime.js +2 -0
  32. package/dist/types/api/createProcessor.d.ts +1 -1
  33. package/dist/types/api/processSettings.d.ts +3 -4
  34. package/dist/types/exports.d.ts +2 -0
  35. package/dist/types/model/GraphRunLifecycle.d.ts +22 -0
  36. package/dist/types/model/MarkdownSanitizationPolicy.d.ts +9 -0
  37. package/dist/types/model/ProcessContext.d.ts +2 -2
  38. package/dist/types/model/Settings.d.ts +5 -0
  39. package/dist/types/model/UiGraph.d.ts +12 -0
  40. package/dist/types/model/UiGraphRendererStyles.d.ts +1 -1
  41. package/dist/types/model/UiGraphRuntimeModel.d.ts +52 -0
  42. package/dist/types/model/chat-v2/chatV2ProviderProfile.d.ts +46 -0
  43. package/dist/types/model/chat-v2/chatV2RequestPlan.d.ts +42 -0
  44. package/dist/types/model/chat-v2/chatV2Types.d.ts +1 -0
  45. package/dist/types/model/chat-v2/index.d.ts +2 -0
  46. package/dist/types/model/chat-v2/llmChatV2NodeData.d.ts +1 -0
  47. package/dist/types/model/chat-v2/llmChatV2NodeRuntime.d.ts +2 -0
  48. package/dist/types/model/chat-v2/providerOptions.d.ts +2 -2
  49. package/dist/types/plugins/gentrace/gentraceSdk.d.ts +5 -0
  50. package/dist/types/plugins/gentrace/plugin.d.ts +1 -1
  51. package/dist/types/utils/pQueueCompat.d.ts +1 -1
  52. package/dist/types/webAppRuntime.d.ts +4 -0
  53. package/package.json +15 -9
@@ -0,0 +1,42 @@
1
+ import type { ChatV2MessageList, ChatV2Provider, ChatV2ToolSet, RunChatV2PipelineOptions, StreamChatV2Options } from './chatV2Types.js';
2
+ export type ChatV2TransportMode = 'stream' | 'generate';
3
+ export type ChatV2RequestPlan = {
4
+ provider: ChatV2Provider;
5
+ modelId: string;
6
+ transportMode: ChatV2TransportMode;
7
+ retry: {
8
+ enabled: boolean;
9
+ repeatTimes: number;
10
+ cooldownMs: number;
11
+ };
12
+ request: Omit<StreamChatV2Options, 'abortSignal' | 'executeStream' | 'executeGenerate' | 'onPartialOutput'>;
13
+ output: Pick<RunChatV2PipelineOptions, 'outputUsage' | 'outputReasoning' | 'outputRequestStatus' | 'includeFunctionCalls' | 'functionCallMode'>;
14
+ };
15
+ type BuildChatV2RequestPlanOptions = Pick<RunChatV2PipelineOptions, 'provider' | 'model' | 'modelId' | 'maxTokens' | 'temperature' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'stopSequences' | 'seed' | 'responseOutput' | 'responseFormat' | 'providerOptions' | 'toolChoice' | 'retryOnNon200' | 'retryOnNon200RepeatTimes' | 'retryOnNon200CooldownMs' | 'outputUsage' | 'outputReasoning' | 'outputRequestStatus' | 'includeFunctionCalls' | 'emitPartialOutputs' | 'functionCallMode'> & {
16
+ messages: ChatV2MessageList;
17
+ tools?: ChatV2ToolSet | undefined;
18
+ };
19
+ export type ChatV2RequestPlanSummary = {
20
+ provider: ChatV2Provider;
21
+ modelId: string;
22
+ transportMode: ChatV2TransportMode;
23
+ sdkMaxRetries: 0;
24
+ retry: ChatV2RequestPlan['retry'];
25
+ messageCount: number;
26
+ toolNames: string[];
27
+ responseFormat: RunChatV2PipelineOptions['responseFormat'];
28
+ generation: {
29
+ maxTokens?: number | undefined;
30
+ temperature?: number | undefined;
31
+ topP?: number | undefined;
32
+ topK?: number | undefined;
33
+ presencePenalty?: number | undefined;
34
+ frequencyPenalty?: number | undefined;
35
+ stopSequences?: string[] | undefined;
36
+ seed?: number | undefined;
37
+ };
38
+ output: ChatV2RequestPlan['output'];
39
+ };
40
+ export declare function buildChatV2RequestPlan(options: BuildChatV2RequestPlanOptions): ChatV2RequestPlan;
41
+ export declare function summarizeChatV2RequestPlan(plan: ChatV2RequestPlan): ChatV2RequestPlanSummary;
42
+ export {};
@@ -56,6 +56,7 @@ export type ChatV2GenerateExecutor = (args: GenerateTextArgs) => ChatV2GenerateH
56
56
  export type StreamChatV2Options = {
57
57
  model: ChatV2Model;
58
58
  messages: ChatV2MessageList;
59
+ maxRetries?: 0 | undefined;
59
60
  tools?: ChatV2ToolSet | undefined;
60
61
  maxTokens?: number | undefined;
61
62
  temperature?: number | undefined;
@@ -1,6 +1,8 @@
1
1
  export * from './aiSdkBridge.js';
2
2
  export * from './chatV2FeatureCompatibility.js';
3
3
  export * from './chatV2Pipeline.js';
4
+ export * from './chatV2ProviderProfile.js';
5
+ export * from './chatV2RequestPlan.js';
4
6
  export * from './chatV2ResponseFormat.js';
5
7
  export * from './chatV2Shared.js';
6
8
  export * from './chatV2Types.js';
@@ -7,6 +7,7 @@ export type LLMChatV2ApiKeySource = 'environment' | 'input';
7
7
  export type LLMChatV2NodeConfigData = ChatV2CommonNodeData & {
8
8
  provider: ChatV2Provider;
9
9
  apiKeySource?: LLMChatV2ApiKeySource;
10
+ customProviderApiKeyProgrammaticName?: string;
10
11
  customProviderApiKeyEnvVarName?: string;
11
12
  customProviderBaseURL: string;
12
13
  useCustomProviderBaseURLInput: boolean;
@@ -1,12 +1,14 @@
1
1
  import type { GptFunction } from '../DataValue.js';
2
2
  import type { Inputs, Outputs } from '../GraphProcessor.js';
3
3
  import type { InternalProcessContext } from '../ProcessContext.js';
4
+ import type { ChatV2ProviderProfile } from './chatV2ProviderProfile.js';
4
5
  import type { RunChatV2PipelineOptions } from './chatV2Types.js';
5
6
  import { buildLLMChatV2EditorCacheKey, cloneLLMChatV2EditorCacheOutputs } from './chatV2EditorCache.js';
6
7
  import { type LLMChatV2EditorCacheKeyParts, type LLMChatV2NodeData } from './llmChatV2NodeData.js';
7
8
  export { buildLLMChatV2EditorCacheKey, cloneLLMChatV2EditorCacheOutputs };
8
9
  export { resolveLLMChatV2RuntimeProviderOptions } from './chatV2RuntimeOptions.js';
9
10
  export type LLMChatV2RuntimeConfig = {
11
+ providerProfile: ChatV2ProviderProfile;
10
12
  runOptions: RunChatV2PipelineOptions;
11
13
  functions: GptFunction[] | undefined;
12
14
  cacheKey: string | undefined;
@@ -50,11 +50,11 @@ export type CreateChatV2ModelOptions = {
50
50
  headers?: Record<string, string> | undefined;
51
51
  onRequestBody?: ((body: unknown) => void) | undefined;
52
52
  };
53
- export type ResolveChatV2ProviderConfigContext = Pick<InternalProcessContext, 'getChatNodeEndpoint' | 'getPluginConfig' | 'settings'>;
53
+ export type ResolveChatV2ProviderConfigContext = Pick<InternalProcessContext, 'getPluginConfig' | 'settings'>;
54
54
  export type ResolvedChatV2ProviderConfig = {
55
55
  baseURL?: string | undefined;
56
56
  headers?: Record<string, string> | undefined;
57
57
  };
58
58
  export declare function openAICompatibleEndpointToBaseURL(endpoint: string): string;
59
- export declare function resolveChatV2ProviderConfig(provider: ChatV2Provider, modelId: string, context: ResolveChatV2ProviderConfigContext, options?: CreateChatV2ModelOptions): Promise<ResolvedChatV2ProviderConfig>;
59
+ export declare function resolveChatV2ProviderConfig(provider: ChatV2Provider, _modelId: string, context: ResolveChatV2ProviderConfigContext, options?: CreateChatV2ModelOptions): Promise<ResolvedChatV2ProviderConfig>;
60
60
  export declare function createChatV2Model(provider: ChatV2Provider, modelId: string, context: Pick<InternalProcessContext, 'settings' | 'getPluginConfig'>, options?: CreateChatV2ModelOptions): ChatV2Model;
@@ -0,0 +1,5 @@
1
+ export { init } from '@gentrace/core/dist/providers/init.mjs';
2
+ export { getPipelines } from '@gentrace/core/dist/providers/pipeline-methods.mjs';
3
+ export { Pipeline } from '@gentrace/core/dist/providers/pipeline.mjs';
4
+ export { runTest } from '@gentrace/core/dist/providers/run-test.mjs';
5
+ export { StepRun } from '@gentrace/core/dist/providers/step-run.mjs';
@@ -7,5 +7,5 @@ import type { Settings } from '../../model/Settings.js';
7
7
  import type { DataValue } from '../../model/DataValue.js';
8
8
  export declare const runGentraceTests: (gentracePipelineSlug: string, settings: Settings, project: Omit<Project, "data">, graph: NodeGraph, nativeApi: NativeApi, contextValues?: Record<string, DataValue>) => Promise<import("@gentrace/core").TestResultPost200Response>;
9
9
  export declare const runRemoteGentraceTests: (gentracePipelineSlug: string, settings: Settings, project: Omit<Project, "data">, graph: NodeGraph, runAndRecord: (testCase: Record<string, any>) => Promise<Recording>) => Promise<import("@gentrace/core").TestResultPost200Response>;
10
- export declare const getGentracePipelines: (gentraceApiKey: string) => Promise<import("@gentrace/core/dist/models/pipelines-get200-response-pipelines-inner.js").PipelinesGet200ResponsePipelinesInner[]>;
10
+ export declare const getGentracePipelines: (gentraceApiKey: string) => Promise<import("@gentrace/core/dist/models/v1-pipelines-get200-response-pipelines-inner.js").V1PipelinesGet200ResponsePipelinesInner[]>;
11
11
  export declare const gentracePlugin: RivetPlugin;
@@ -1,6 +1,6 @@
1
1
  import PQueueImport from 'p-queue';
2
2
  /**
3
- * p-queue v7+ is ESM-only. The CJS bundle (built by bundle.esbuild.ts) aliases
3
+ * p-queue v7+ is ESM-only. The CJS bundle (built by bundle.esbuild.cjs) aliases
4
4
  * `p-queue` to `p-queue-6` (a CJS-compatible older version). That version wraps
5
5
  * the default export so that `import PQueue from 'p-queue'` resolves to
6
6
  * `{ default: PQueue }` instead of the class directly. This module normalizes
@@ -0,0 +1,4 @@
1
+ export type { UiComponentId, UiGraph, UiGraphComponent } from './model/UiGraph.js';
2
+ export type { RivetMarkdownSanitizerPolicy } from './model/MarkdownSanitizationPolicy.js';
3
+ export { getUiGraphActionState } from './model/UiGraph.js';
4
+ export { applyUiGraphStatePatch, getUiGraphComponentRenderModel, getUiGraphJsonOutputFilename, } from './model/UiGraphRuntimeModel.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerypopoff/rivet2-core",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "license": "MIT",
5
5
  "main": "dist/cjs/bundle.cjs",
6
6
  "module": "dist/esm/index.js",
@@ -23,6 +23,11 @@
23
23
  "import": "./dist/esm/index.js",
24
24
  "require": "./dist/cjs/bundle.cjs"
25
25
  }
26
+ },
27
+ "./web-app-runtime": {
28
+ "types": "./dist/types/webAppRuntime.d.ts",
29
+ "import": "./dist/esm/webAppRuntime.js",
30
+ "require": "./dist/cjs/bundle.cjs"
26
31
  }
27
32
  },
28
33
  "files": [
@@ -42,25 +47,26 @@
42
47
  "@ai-sdk/google": "3.0.43",
43
48
  "@ai-sdk/openai": "3.0.41",
44
49
  "@ai-sdk/openai-compatible": "1.0.17",
45
- "@gentrace/core": "^2.2.5",
46
- "@google-cloud/vertexai": "^0.1.3",
47
- "@google/genai": "^0.12.0",
50
+ "@gentrace/core": "^3.5.12",
51
+ "@google-cloud/vertexai": "^1.12.0",
52
+ "@google/genai": "^1.52.0",
48
53
  "@huggingface/inference": "^2.6.4",
49
54
  "acorn": "^8.14.0",
50
55
  "ai": "6.0.116",
51
56
  "assemblyai": "^4.6.0",
52
- "autoevals": "^0.0.26",
57
+ "autoevals": "^0.3.0",
53
58
  "cron-parser": "^4.9.0",
54
59
  "crypto-js": "^4.2.0",
55
60
  "emittery": "^1.0.1",
56
61
  "emittery-0-13": "npm:emittery@^0.13.1",
57
62
  "gpt-tokenizer": "^2.1.2",
58
63
  "json-stream-es": "^1.2.1",
59
- "jsonpath-plus": "^10.2.0",
60
- "lodash-es": "^4.17.21",
64
+ "jsonpath-plus": "^10.4.0",
65
+ "lodash-es": "^4.18.1",
61
66
  "mdast-util-gfm-table": "^2.0.0",
62
67
  "mdast-util-to-markdown": "^2.1.2",
63
- "minimatch": "^9.0.3",
68
+ "minimatch": "^10.2.5",
69
+ "mustache": "^4.2.0",
64
70
  "nanoid": "^3.3.6",
65
71
  "openai": "^4.28.4",
66
72
  "p-queue": "^7.4.1",
@@ -71,7 +77,7 @@
71
77
  "ts-dedent": "^2.2.0",
72
78
  "ts-pattern": "^5.6.2",
73
79
  "type-fest": "^4.34.1",
74
- "yaml": "^2.3.3",
80
+ "yaml": "^2.9.0",
75
81
  "zod": "^4.3.6"
76
82
  }
77
83
  }