@hugex/ai 2.9.1 → 2.9.4

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 (89) hide show
  1. package/dist/chunk-3TXHFKDN.js +1 -0
  2. package/dist/{chunk-TUI5H3ZB.js → chunk-G3SGJ7XJ.js} +1 -1
  3. package/dist/chunk-R6EKV3WR.js +1 -0
  4. package/dist/{chunk-43NDF544.js → chunk-RYHQGPX5.js} +1 -1
  5. package/dist/client/hooks/useAgent.d.ts +31 -0
  6. package/dist/client/states/agent-store.d.ts +95 -0
  7. package/dist/client.d.ts +4 -129
  8. package/dist/client.js +1 -1
  9. package/dist/common/constants/ai-models.d.ts +10 -0
  10. package/dist/common/constants/tools-registry.d.ts +8 -0
  11. package/dist/common/types/agent-types.d.ts +61 -0
  12. package/dist/common/types/ai-models-types.d.ts +94 -0
  13. package/dist/common/types/memory-types.d.ts +28 -0
  14. package/dist/common/types/node-types.d.ts +9 -0
  15. package/dist/common/types/user-types.d.ts +11 -0
  16. package/dist/common/types/var-mapping.d.ts +29 -0
  17. package/dist/common/types/ws-message.d.ts +58 -0
  18. package/dist/common/utils/agent-utils.d.ts +0 -0
  19. package/dist/common/utils/generationParams.d.ts +19 -0
  20. package/dist/common/utils/logc.d.ts +17 -0
  21. package/dist/common/utils/reasoning.d.ts +32 -0
  22. package/dist/common/utils/templateUtils.d.ts +7 -0
  23. package/dist/common.d.ts +12 -362
  24. package/dist/common.js +1 -1
  25. package/dist/{composioTool-EXCSM6F4.js → composioTool-TVURCFXP.js} +1 -1
  26. package/dist/convertTempMessure-5CAGRLBY.js +1 -0
  27. package/dist/{httpTool-EU63HPF5.js → httpTool-NTDDXZZE.js} +1 -1
  28. package/dist/index.d.ts +27 -438
  29. package/dist/index.js +12 -12
  30. package/dist/{oraApi-3JWDQQUE.js → oraApi-YIJGMXX7.js} +1 -1
  31. package/dist/{recall-SD6FENAS.js → recall-IABRCSHY.js} +1 -1
  32. package/dist/server/api/agents.d.ts +1 -0
  33. package/dist/server/api/auth.d.ts +1 -0
  34. package/dist/server/api/commons.d.ts +1 -0
  35. package/dist/server/api/composio.d.ts +1 -0
  36. package/dist/server/api/instances.d.ts +1 -0
  37. package/dist/server/core/AgentDO.d.ts +80 -0
  38. package/dist/server/core/AgentHTTP.d.ts +2 -0
  39. package/dist/server/logic/FlowEngine.d.ts +38 -0
  40. package/dist/server/logic/llm/files.d.ts +2 -0
  41. package/dist/server/logic/llm/images.d.ts +5 -0
  42. package/dist/server/logic/serverMessages.d.ts +13 -0
  43. package/dist/server/runners/answerNodeRunner.d.ts +4 -0
  44. package/dist/server/runners/apiNodeRunner.d.ts +4 -0
  45. package/dist/server/runners/classifierNodeRunner.d.ts +6 -0
  46. package/dist/server/runners/llmNodeRunner.d.ts +6 -0
  47. package/dist/server/runners/memoNodeRunner.d.ts +4 -0
  48. package/dist/server/runners/startNodeRunner.d.ts +4 -0
  49. package/dist/server/sql/agentSQL.d.ts +24 -0
  50. package/dist/server/tools/composioTool.d.ts +4 -0
  51. package/dist/server/tools/convertTempMessure.d.ts +15 -0
  52. package/dist/server/tools/httpTool.d.ts +18 -0
  53. package/dist/server/tools/recall.d.ts +7 -0
  54. package/dist/server/tools/skillTool.d.ts +6 -0
  55. package/dist/server/tools/tempTool.d.ts +4 -0
  56. package/dist/server/tools/twitter.d.ts +5 -0
  57. package/dist/server/tools/vectorize.d.ts +6 -0
  58. package/dist/server/types/node.d.ts +25 -0
  59. package/dist/server/utils/apiUtils.d.ts +14 -0
  60. package/dist/server/utils/auth.d.ts +3 -0
  61. package/dist/server/utils/composio.d.ts +114 -0
  62. package/dist/server/utils/contextMemory.d.ts +25 -0
  63. package/dist/server/utils/cookies.d.ts +1 -0
  64. package/dist/server/utils/coreApi.d.ts +7 -0
  65. package/dist/server/utils/embeddings.d.ts +3 -0
  66. package/dist/server/utils/flowRefresh.d.ts +22 -0
  67. package/dist/server/utils/flowValidation.d.ts +2 -0
  68. package/dist/server/utils/jsonSchemaToZod.d.ts +12 -0
  69. package/dist/server/utils/modelProvider.d.ts +20 -0
  70. package/dist/server/utils/oraApi.d.ts +6 -0
  71. package/dist/server/utils/oraExtract.d.ts +11 -0
  72. package/dist/server/utils/secrets.d.ts +2 -0
  73. package/dist/server/utils/secretsRefs.d.ts +6 -0
  74. package/dist/server/utils/sessionEnvMemory.d.ts +12 -0
  75. package/dist/server/utils/sessionIndex.d.ts +16 -0
  76. package/dist/server/utils/telemetry.d.ts +10 -0
  77. package/dist/server/utils/templateUtils.d.ts +7 -0
  78. package/dist/{skillTool-Y5GZ4ZAR.js → skillTool-BSQFKZGK.js} +1 -1
  79. package/dist/tempTool-2RXAF56M.js +1 -0
  80. package/dist/{twitter-QNCTAE4E.js → twitter-OMDEG7T2.js} +1 -1
  81. package/dist/vectorize-UJXIDL2E.js +1 -0
  82. package/package.json +19 -19
  83. package/dist/chunk-2JN3IX2Y.js +0 -1
  84. package/dist/chunk-6BYZCJPP.js +0 -1
  85. package/dist/convertTempMessure-TT7DIP6C.js +0 -1
  86. package/dist/magic-string.es-S3C7UPCH.js +0 -13
  87. package/dist/skillTool.test-6UDHQARG.js +0 -190
  88. package/dist/tempTool-6Q6C4HEJ.js +0 -1
  89. package/dist/vectorize-SQROWLSU.js +0 -1
File without changes
@@ -0,0 +1,19 @@
1
+ import type { EffectiveParams, GenerationPresetId, ModelEntry, ParamAdjustment, ParamSupport } from '../types/ai-models-types';
2
+ export declare const GENERATION_PARAM_KEYS: readonly ['temperature', 'topP', 'topK', 'frequencyPenalty', 'presencePenalty', 'maxOutputTokens', 'seed', 'stopSequences', 'maxRetries'];
3
+ export type GenerationParamKey = (typeof GENERATION_PARAM_KEYS)[number];
4
+ export declare const PRESET_PARAM_KEYS: readonly ['temperature', 'topP', 'topK', 'frequencyPenalty', 'presencePenalty'];
5
+ export declare const GENERATION_PRESETS: Record<Exclude<GenerationPresetId, 'custom'>, Partial<EffectiveParams>>;
6
+ export declare function deriveParamSupport(entry: Pick<ModelEntry, 'provider' | 'providerModel' | 'contextWindow'>): ParamSupport;
7
+ export declare function resolvePreset(params: Partial<EffectiveParams>, support?: ParamSupport): GenerationPresetId;
8
+ export declare function applyPresetToOverrides(presetId: Exclude<GenerationPresetId, 'custom'>, support?: ParamSupport): Partial<EffectiveParams>;
9
+ export declare function pickNodeOverrides(nodeData: Record<string, unknown> | undefined): EffectiveParams;
10
+ export declare function normalizeEffectiveParams(defaults: EffectiveParams | undefined, overrides: EffectiveParams | undefined, support: ParamSupport): {
11
+ effectiveParams: EffectiveParams;
12
+ adjustments: ParamAdjustment[];
13
+ };
14
+ export declare function toStreamTextSettings(params: EffectiveParams): Record<string, unknown>;
15
+ export declare function openAiStandardParamSupport(contextWindow?: number): ParamSupport;
16
+ export declare function openAiReasoningParamSupport(contextWindow?: number): ParamSupport;
17
+ export declare function xaiParamSupport(contextWindow?: number): ParamSupport;
18
+ export declare function workersAiParamSupport(contextWindow?: number): ParamSupport;
19
+ export declare function stripUnsupportedFromNodeData(nodeData: Record<string, unknown>, support: ParamSupport): Record<string, unknown>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Utility function for logging colored text to the console using ANSI escape sequences.
3
+ *
4
+ * @param text - The text to log (will be converted to string if not already)
5
+ * @param color - The color to use for the text (case-insensitive). Supported colors:
6
+ * - 'red' | 'green' | 'blue' | 'black' | 'white'
7
+ * - Any other color string will fallback to default console.log without color
8
+ *
9
+ * @example
10
+ * // Log with a supported color
11
+ * logc('Hello world', 'red');
12
+ *
13
+ * @example
14
+ * // Log with an unsupported color (falls back to default)
15
+ * logc('Status: Complete', 'purple');
16
+ */
17
+ export declare function logc(text: string, color: 'red' | 'green' | 'blue' | 'black' | 'white' | 'yellow' | 'pink' | string): void;
@@ -0,0 +1,32 @@
1
+ import type { ModelEntry, ReasoningCapability, ReasoningEffortLevel } from '../types/ai-models-types';
2
+ /** The full universe of effort values; for reference/validation, NOT a runtime fallback. */
3
+ export declare const REASONING_EFFORT_LEVELS: ReasoningEffortLevel[];
4
+ /**
5
+ * Resolves a model's reasoning descriptor. The capabilities registry is the SOURCE OF TRUTH:
6
+ * an explicit structured descriptor is returned verbatim — no provider/model heuristics.
7
+ * The legacy boolean is only a thin back-compat shim for un-migrated records.
8
+ */
9
+ export declare function normalizeReasoning(entry: Pick<ModelEntry, 'capabilities'>): ReasoningCapability;
10
+ /**
11
+ * Effort levels a model accepts. The registry is authoritative: a model only has a selectable
12
+ * effort knob if it EXPLICITLY declares `levels`. No declaration → `[]` → no knob is ever sent.
13
+ * (Critical for models like grok-4 that reason but reject `reasoningEffort`.)
14
+ */
15
+ export declare function reasoningEffortLevels(reasoning: ReasoningCapability): ReasoningEffortLevel[];
16
+ /** Whether the model can surface a reasoning trace (tag models always can). */
17
+ export declare function reasoningExposable(reasoning: ReasoningCapability): boolean;
18
+ /**
19
+ * Resolves the effort to use for a call: the requested level if the model supports it,
20
+ * otherwise the model's declared default (or `undefined` to let the provider decide).
21
+ */
22
+ export declare function resolveReasoningEffort(reasoning: ReasoningCapability, requested?: unknown): ReasoningEffortLevel | undefined;
23
+ /**
24
+ * Maps reasoning settings into the `providerOptions` envelope `streamText` expects, per provider.
25
+ * Pure transport: provider key names + the OpenAI `reasoningSummary` knob live here; WHAT a model
26
+ * supports comes from its descriptor. Returns `undefined` when there's nothing to send.
27
+ */
28
+ export declare function buildReasoningProviderOptions(provider: string, opts: {
29
+ effort?: ReasoningEffortLevel;
30
+ exposeReasoning?: boolean;
31
+ maxTokens?: number;
32
+ }): Record<string, Record<string, any>> | undefined;
@@ -0,0 +1,7 @@
1
+ import { NodeType } from '../types/node-types';
2
+ import type { FlowNode, OutVar, ResolveInput, ResolveOptions } from '../types/var-mapping';
3
+ export declare function walkPath(obj: any, path: string): any;
4
+ export declare function getDefaultOutVars(nodeType: NodeType): OutVar[];
5
+ export declare function getEffectiveOutVars(node: FlowNode): OutVar[];
6
+ export declare function resolveOutVarRef(ref: string, input: ResolveInput): unknown | undefined;
7
+ export declare function resolveTemplate(template: string, node: FlowNode, input: ResolveInput, options?: ResolveOptions): string;
package/dist/common.d.ts CHANGED
@@ -1,362 +1,12 @@
1
- interface UserInterface {
2
- id: string;
3
- email: string;
4
- name: string;
5
- first_name: string;
6
- last_name: string;
7
- tenant: string;
8
- roles: string;
9
- db_name: string | null;
10
- user_id: string | null;
11
- }
12
-
13
- declare const messageTypes: {
14
- readonly USER_MESSAGE: "M";
15
- readonly USER_CLEAR_HISTORY: "CH";
16
- readonly USER_AUTH: "AUT";
17
- readonly USER_IDENTITY: "UID";
18
- readonly SERVER_EVENT: "SE";
19
- readonly SERVER_HISTORY: "HIS";
20
- readonly SERVER_ERROR: "ERR";
21
- readonly SERVER_STEP: "STEP";
22
- readonly SERVER_TEXT_STREAM: "TS";
23
- readonly SERVER_TEXT_STREAM_COMPLETE: "TSC";
24
- readonly SERVER_REASONING_STREAM: "RS";
25
- readonly SERVER_REASONING_STREAM_COMPLETE: "RSC";
26
- readonly SERVER_CONFIG: "CFG";
27
- };
28
- type FlowConfig = {
29
- allow_images: boolean;
30
- allow_documents: boolean;
31
- greeting?: string;
32
- };
33
- type Message = {
34
- id?: string;
35
- role: 'user' | 'assistant';
36
- type: 'text' | 'url';
37
- content: any;
38
- images?: {
39
- mimeType: string;
40
- data: string;
41
- }[];
42
- ts: number;
43
- };
44
- type EventItem = {
45
- type: string;
46
- content: any;
47
- [key: string]: any;
48
- };
49
- type TypingMessage = {
50
- id: string;
51
- text: string;
52
- } | null;
53
- type StepInfo = {
54
- tool?: string;
55
- phase?: string;
56
- } | null;
57
- type MessageType = (typeof messageTypes)[keyof typeof messageTypes];
58
- type ChatHistoryItem = {
59
- role: 'user' | 'assistant';
60
- content: string;
61
- };
62
- type ApprovalRequestPayload = {
63
- type: 'tool_approval_request';
64
- toolCallId: string;
65
- toolName: string;
66
- args: any;
67
- description: string;
68
- };
69
- type ToolExecutionResultPayload = {
70
- toolCallId: string;
71
- result: string;
72
- approved: boolean;
73
- };
74
-
75
- declare enum NodeType {
76
- START_NODE = "startNode",
77
- CLASSIFIER_NODE = "classifierNode",
78
- MEMO_NODE = "memoNode",
79
- LLM_NODE = "llmNode",
80
- ANSWER_NODE = "answerNode",
81
- API_NODE = "apiNode"
82
- }
83
- type NODETYPES = NodeType.START_NODE | NodeType.CLASSIFIER_NODE | NodeType.MEMO_NODE | NodeType.LLM_NODE | NodeType.ANSWER_NODE | NodeType.API_NODE;
84
-
85
- type WsServerMessageType = 'chunk' | 'finish' | 'error' | 'complete' | 'history';
86
- type WsClientMessageType = 'message' | 'debug';
87
- interface WsServerMessage {
88
- type: WsServerMessageType;
89
- content: string;
90
- timestamp: number;
91
- }
92
- interface WsHistory extends WsServerMessage {
93
- type: 'history';
94
- messages: any[];
95
- }
96
- interface WsError extends WsServerMessage {
97
- type: 'error';
98
- error: string;
99
- }
100
- interface WsComplete extends WsServerMessage {
101
- type: 'complete';
102
- done: boolean;
103
- }
104
- interface WsClientMessage {
105
- type: WsClientMessageType;
106
- timestamp: number;
107
- }
108
- interface WsMessage extends WsClientMessage {
109
- type: 'message';
110
- role: 'user' | 'assistant' | 'system';
111
- content: string;
112
- }
113
- interface wsDebug extends WsClientMessage {
114
- type: 'debug';
115
- content: string;
116
- }
117
- interface UserMessagePayload {
118
- text: string;
119
- images?: {
120
- mimeType: string;
121
- data: string;
122
- }[];
123
- documents?: {
124
- name: string;
125
- mimeType: string;
126
- data: string;
127
- }[];
128
- }
129
- declare function parseUserMessage(content: string): UserMessagePayload;
130
- interface UserAuthPayload {
131
- name: string;
132
- value: string;
133
- }
134
- /**
135
- * Parse an `AUT` message payload: JSON `{ name, value }`.
136
- * `name` must match the secrets grammar `[A-Z][A-Z0-9_]*` so it aligns with the
137
- * `{{ auth.NAME }}` template namespace. Returns null on any malformed input.
138
- */
139
- declare const MAX_USER_IDENTITY_LENGTH = 256;
140
- /** Trim and cap a client-supplied session identity string. Returns null if empty. */
141
- declare function sanitizeUserIdentity(content: string): string | null;
142
- declare function parseUserAuth(content: string): UserAuthPayload | null;
143
-
144
- type EffectiveParams = {
145
- temperature?: number;
146
- topP?: number;
147
- topK?: number;
148
- frequencyPenalty?: number;
149
- presencePenalty?: number;
150
- maxOutputTokens?: number;
151
- seed?: number;
152
- stopSequences?: string[];
153
- maxRetries?: number;
154
- };
155
- type ParamRange = {
156
- min: number;
157
- max: number;
158
- step?: number;
159
- };
160
- type ParamSupport = {
161
- temperature?: ParamRange | false;
162
- topP?: ParamRange | false;
163
- topK?: ParamRange | false;
164
- frequencyPenalty?: ParamRange | false;
165
- presencePenalty?: ParamRange | false;
166
- maxOutputTokens?: {
167
- max: number;
168
- } | false;
169
- seed?: boolean;
170
- stopSequences?: {
171
- max: number;
172
- } | false;
173
- };
174
- type ReasoningEffortLevel = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
175
- /**
176
- * Describes how a model exposes/controls "reasoning". This is the SOURCE OF TRUTH —
177
- * declared per-model in the capabilities registry, never inferred from the provider at runtime.
178
- *
179
- * - `none` → model does not reason (or reasoning is not surfaced).
180
- * - `effort` → opaque reasoning controlled via a provider `reasoningEffort` knob
181
- * (e.g. OpenAI o-series / gpt-5, xAI grok). `levels` lists the values THIS
182
- * model accepts; `exposesReasoning` marks models that can stream a reasoning
183
- * summary (OpenAI needs `reasoningSummary` for this).
184
- * - `tag` → model "thinks out loud" inside XML-like tags in the text stream
185
- * (e.g. DeepSeek R1); reasoning is extracted via middleware (always exposable).
186
- */
187
- type ReasoningCapability = {
188
- kind: 'none';
189
- } | {
190
- kind: 'effort';
191
- levels?: ReasoningEffortLevel[];
192
- defaultLevel?: ReasoningEffortLevel;
193
- exposesReasoning?: boolean;
194
- } | {
195
- kind: 'tag';
196
- tagName?: string;
197
- startWithReasoning?: boolean;
198
- };
199
- type Capabilities = {
200
- function_calling: boolean;
201
- /** `true`/`false` is the legacy shape; prefer the structured {@link ReasoningCapability}. */
202
- reasoning: boolean | ReasoningCapability;
203
- multimodal: boolean;
204
- params?: ParamSupport;
205
- };
206
- type GenerationPresetId = 'precise' | 'balanced' | 'creative' | 'custom';
207
- type ModelEntry = {
208
- id: string;
209
- label: string;
210
- provider: 'openai' | 'cloudflare' | 'workersai' | string;
211
- providerModel: string;
212
- author: string;
213
- description?: string;
214
- defaultParams?: EffectiveParams;
215
- capabilities?: Capabilities;
216
- tags?: string[];
217
- price?: {
218
- input: number;
219
- output: number;
220
- };
221
- contextWindow?: number;
222
- };
223
- type ModelRegistrySnapshot = Record<string, ModelEntry>;
224
- type ParamAdjustment = {
225
- key: string;
226
- action: 'stripped' | 'clamped';
227
- detail?: string;
228
- };
229
- type ResolvedModel = {
230
- provider: string;
231
- modelHandle: any;
232
- entry: ModelEntry;
233
- effectiveParams: EffectiveParams;
234
- paramAdjustments?: ParamAdjustment[];
235
- /** Normalized reasoning descriptor for this model (never the legacy boolean). */
236
- reasoning: ReasoningCapability;
237
- };
238
-
239
- declare const GENERATION_PARAM_KEYS: readonly ["temperature", "topP", "topK", "frequencyPenalty", "presencePenalty", "maxOutputTokens", "seed", "stopSequences", "maxRetries"];
240
- type GenerationParamKey = (typeof GENERATION_PARAM_KEYS)[number];
241
- declare const PRESET_PARAM_KEYS: readonly ["temperature", "topP", "topK", "frequencyPenalty", "presencePenalty"];
242
- declare const GENERATION_PRESETS: Record<Exclude<GenerationPresetId, 'custom'>, Partial<EffectiveParams>>;
243
- declare function deriveParamSupport(entry: Pick<ModelEntry, 'provider' | 'providerModel' | 'contextWindow'>): ParamSupport;
244
- declare function resolvePreset(params: Partial<EffectiveParams>, support?: ParamSupport): GenerationPresetId;
245
- declare function applyPresetToOverrides(presetId: Exclude<GenerationPresetId, 'custom'>, support?: ParamSupport): Partial<EffectiveParams>;
246
- declare function pickNodeOverrides(nodeData: Record<string, unknown> | undefined): EffectiveParams;
247
- declare function normalizeEffectiveParams(defaults: EffectiveParams | undefined, overrides: EffectiveParams | undefined, support: ParamSupport): {
248
- effectiveParams: EffectiveParams;
249
- adjustments: ParamAdjustment[];
250
- };
251
- declare function toStreamTextSettings(params: EffectiveParams): Record<string, unknown>;
252
- declare function openAiStandardParamSupport(contextWindow?: number): ParamSupport;
253
- declare function openAiReasoningParamSupport(contextWindow?: number): ParamSupport;
254
- declare function xaiParamSupport(contextWindow?: number): ParamSupport;
255
- declare function workersAiParamSupport(contextWindow?: number): ParamSupport;
256
- declare function stripUnsupportedFromNodeData(nodeData: Record<string, unknown>, support: ParamSupport): Record<string, unknown>;
257
-
258
- /** The full universe of effort values; for reference/validation, NOT a runtime fallback. */
259
- declare const REASONING_EFFORT_LEVELS: ReasoningEffortLevel[];
260
- /**
261
- * Resolves a model's reasoning descriptor. The capabilities registry is the SOURCE OF TRUTH:
262
- * an explicit structured descriptor is returned verbatim — no provider/model heuristics.
263
- * The legacy boolean is only a thin back-compat shim for un-migrated records.
264
- */
265
- declare function normalizeReasoning(entry: Pick<ModelEntry, 'capabilities'>): ReasoningCapability;
266
- /**
267
- * Effort levels a model accepts. The registry is authoritative: a model only has a selectable
268
- * effort knob if it EXPLICITLY declares `levels`. No declaration → `[]` → no knob is ever sent.
269
- * (Critical for models like grok-4 that reason but reject `reasoningEffort`.)
270
- */
271
- declare function reasoningEffortLevels(reasoning: ReasoningCapability): ReasoningEffortLevel[];
272
- /** Whether the model can surface a reasoning trace (tag models always can). */
273
- declare function reasoningExposable(reasoning: ReasoningCapability): boolean;
274
- /**
275
- * Resolves the effort to use for a call: the requested level if the model supports it,
276
- * otherwise the model's declared default (or `undefined` to let the provider decide).
277
- */
278
- declare function resolveReasoningEffort(reasoning: ReasoningCapability, requested?: unknown): ReasoningEffortLevel | undefined;
279
- /**
280
- * Maps reasoning settings into the `providerOptions` envelope `streamText` expects, per provider.
281
- * Pure transport: provider key names + the OpenAI `reasoningSummary` knob live here; WHAT a model
282
- * supports comes from its descriptor. Returns `undefined` when there's nothing to send.
283
- */
284
- declare function buildReasoningProviderOptions(provider: string, opts: {
285
- effort?: ReasoningEffortLevel;
286
- exposeReasoning?: boolean;
287
- maxTokens?: number;
288
- }): Record<string, Record<string, any>> | undefined;
289
-
290
- interface ToolEntry {
291
- id: string;
292
- label: string;
293
- description: string;
294
- parameters?: Record<string, any>;
295
- }
296
- declare const TOOL_REGISTRY_SNAPSHOT: Record<string, ToolEntry>;
297
-
298
- /**
299
- * @deprecated Static model registry removed. Runtime resolves models from hx-ora
300
- * (KV/D1 via getOraModel / fetchOraModel). This export is an empty stub.
301
- */
302
- declare const MODEL_REGISTRY_SNAPSHOT: ModelRegistrySnapshot;
303
- /**
304
- * @deprecated Use hx-ora backend model records instead.
305
- */
306
- declare function getModelEntry(_id: string): ModelEntry | undefined;
307
-
308
- /**
309
- * Utility function for logging colored text to the console using ANSI escape sequences.
310
- *
311
- * @param text - The text to log (will be converted to string if not already)
312
- * @param color - The color to use for the text (case-insensitive). Supported colors:
313
- * - 'red' | 'green' | 'blue' | 'black' | 'white'
314
- * - Any other color string will fallback to default console.log without color
315
- *
316
- * @example
317
- * // Log with a supported color
318
- * logc('Hello world', 'red');
319
- *
320
- * @example
321
- * // Log with an unsupported color (falls back to default)
322
- * logc('Status: Complete', 'purple');
323
- */
324
- declare function logc(text: string, color: 'red' | 'green' | 'blue' | 'black' | 'white' | 'yellow' | 'pink' | string): void;
325
-
326
- interface FlowNode {
327
- id: string;
328
- type: string;
329
- data?: any;
330
- }
331
- interface VariableMapping {
332
- var: string;
333
- from: string;
334
- default?: string;
335
- }
336
- interface OutVar {
337
- name: string;
338
- path?: string;
339
- label?: string;
340
- description?: string;
341
- type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'image' | 'file';
342
- source?: 'default' | 'user';
343
- }
344
- interface ResolveInput {
345
- context: Record<string, any>;
346
- results: Record<string, any>;
347
- nodes: FlowNode[];
348
- secrets?: Record<string, string>;
349
- }
350
- interface ResolveOptions {
351
- callerTag?: string;
352
- serializeNonStrings?: boolean;
353
- onError?: (msg: string) => void;
354
- }
355
-
356
- declare function walkPath(obj: any, path: string): any;
357
- declare function getDefaultOutVars(nodeType: NodeType): OutVar[];
358
- declare function getEffectiveOutVars(node: FlowNode): OutVar[];
359
- declare function resolveOutVarRef(ref: string, input: ResolveInput): unknown | undefined;
360
- declare function resolveTemplate(template: string, node: FlowNode, input: ResolveInput, options?: ResolveOptions): string;
361
-
362
- export { type ApprovalRequestPayload, type Capabilities, type ChatHistoryItem, type EffectiveParams, type EventItem, type FlowConfig, type FlowNode, GENERATION_PARAM_KEYS, GENERATION_PRESETS, type GenerationParamKey, type GenerationPresetId, MAX_USER_IDENTITY_LENGTH, MODEL_REGISTRY_SNAPSHOT, type Message, type MessageType, type ModelEntry, type ModelRegistrySnapshot, type NODETYPES, NodeType, type OutVar, PRESET_PARAM_KEYS, type ParamAdjustment, type ParamRange, type ParamSupport, REASONING_EFFORT_LEVELS, type ReasoningCapability, type ReasoningEffortLevel, type ResolveInput, type ResolveOptions, type ResolvedModel, type StepInfo, TOOL_REGISTRY_SNAPSHOT, type ToolExecutionResultPayload, type TypingMessage, type UserAuthPayload, type UserInterface, type UserMessagePayload, type VariableMapping, type WsClientMessage, type WsClientMessageType, type WsComplete, type WsError, type WsHistory, type WsMessage, type WsServerMessage, type WsServerMessageType, applyPresetToOverrides, buildReasoningProviderOptions, deriveParamSupport, getDefaultOutVars, getEffectiveOutVars, getModelEntry, logc, messageTypes, normalizeEffectiveParams, normalizeReasoning, openAiReasoningParamSupport, openAiStandardParamSupport, parseUserAuth, parseUserMessage, pickNodeOverrides, reasoningEffortLevels, reasoningExposable, resolveOutVarRef, resolvePreset, resolveReasoningEffort, resolveTemplate, sanitizeUserIdentity, stripUnsupportedFromNodeData, toStreamTextSettings, walkPath, workersAiParamSupport, type wsDebug, xaiParamSupport };
1
+ export * from './common/types/ws-message';
2
+ export * from './common/types/user-types';
3
+ export * from './common/types/node-types';
4
+ export * from './common/types/agent-types';
5
+ export * from './common/types/ai-models-types';
6
+ export * from './common/utils/generationParams';
7
+ export * from './common/utils/reasoning';
8
+ export * from './common/constants/tools-registry';
9
+ export * from './common/constants/ai-models';
10
+ export * from './common/utils/logc';
11
+ export * from './common/types/var-mapping';
12
+ export * from './common/utils/templateUtils';
package/dist/common.js CHANGED
@@ -1 +1 @@
1
- import{a as b,b as d,c as e,d as f,e as g,f as G,g as H,h as I}from"./chunk-HAYNUZZB.js";import{a as c,b as h,c as i,d as j,e as k,f as l}from"./chunk-OYP6D5VN.js";import{a as m,b as n,c as o,d as p,e as q,f as r,g as s,h as t,i as u,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E,t as F}from"./chunk-GRZ6ZRHM.js";import{a}from"./chunk-U56YWPSI.js";import"./chunk-6BYZCJPP.js";export{m as GENERATION_PARAM_KEYS,o as GENERATION_PRESETS,e as MAX_USER_IDENTITY_LENGTH,H as MODEL_REGISTRY_SNAPSHOT,c as NodeType,n as PRESET_PARAM_KEYS,A as REASONING_EFFORT_LEVELS,G as TOOL_REGISTRY_SNAPSHOT,r as applyPresetToOverrides,F as buildReasoningProviderOptions,p as deriveParamSupport,i as getDefaultOutVars,j as getEffectiveOutVars,I as getModelEntry,a as logc,b as messageTypes,t as normalizeEffectiveParams,B as normalizeReasoning,w as openAiReasoningParamSupport,v as openAiStandardParamSupport,g as parseUserAuth,d as parseUserMessage,s as pickNodeOverrides,C as reasoningEffortLevels,D as reasoningExposable,k as resolveOutVarRef,q as resolvePreset,E as resolveReasoningEffort,l as resolveTemplate,f as sanitizeUserIdentity,z as stripUnsupportedFromNodeData,u as toStreamTextSettings,h as walkPath,y as workersAiParamSupport,x as xaiParamSupport};
1
+ import{a as b,b as d,c as e,d as f,e as g,f as G,g as H,h as I}from"./chunk-HAYNUZZB.js";import{a as c,b as h,c as i,d as j,e as k,f as l}from"./chunk-OYP6D5VN.js";import{a as m,b as n,c as o,d as p,e as q,f as r,g as s,h as t,i as u,j as v,k as w,l as x,m as y,n as z,o as A,p as B,q as C,r as D,s as E,t as F}from"./chunk-GRZ6ZRHM.js";import{a}from"./chunk-U56YWPSI.js";import"./chunk-3TXHFKDN.js";export{m as GENERATION_PARAM_KEYS,o as GENERATION_PRESETS,e as MAX_USER_IDENTITY_LENGTH,H as MODEL_REGISTRY_SNAPSHOT,c as NodeType,n as PRESET_PARAM_KEYS,A as REASONING_EFFORT_LEVELS,G as TOOL_REGISTRY_SNAPSHOT,r as applyPresetToOverrides,F as buildReasoningProviderOptions,p as deriveParamSupport,i as getDefaultOutVars,j as getEffectiveOutVars,I as getModelEntry,a as logc,b as messageTypes,t as normalizeEffectiveParams,B as normalizeReasoning,w as openAiReasoningParamSupport,v as openAiStandardParamSupport,g as parseUserAuth,d as parseUserMessage,s as pickNodeOverrides,C as reasoningEffortLevels,D as reasoningExposable,k as resolveOutVarRef,q as resolvePreset,E as resolveReasoningEffort,l as resolveTemplate,f as sanitizeUserIdentity,z as stripUnsupportedFromNodeData,u as toStreamTextSettings,h as walkPath,y as workersAiParamSupport,x as xaiParamSupport};
@@ -1 +1 @@
1
- import{a}from"./chunk-GOWQA2OT.js";import"./chunk-U56YWPSI.js";import"./chunk-6BYZCJPP.js";export{a as loadComposioTools};
1
+ import{a}from"./chunk-GOWQA2OT.js";import"./chunk-U56YWPSI.js";import"./chunk-3TXHFKDN.js";export{a as loadComposioTools};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-RYHQGPX5.js";import"./chunk-U56YWPSI.js";import"./chunk-3TXHFKDN.js";export{a as convertTempMessure};
@@ -1 +1 @@
1
- import{d as a,e as b}from"./chunk-26SLPOG6.js";import"./chunk-OYP6D5VN.js";import"./chunk-V6JSMX5A.js";import"./chunk-U56YWPSI.js";import"./chunk-6BYZCJPP.js";export{a as customHttpTool,b as default};
1
+ import{d as a,e as b}from"./chunk-26SLPOG6.js";import"./chunk-OYP6D5VN.js";import"./chunk-V6JSMX5A.js";import"./chunk-U56YWPSI.js";import"./chunk-3TXHFKDN.js";export{a as customHttpTool,b as default};