@hugex/ai 3.2.0 → 3.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/FlowEngine-UNMMHMN6.js +1 -0
- package/dist/{chunk-V35SRZAO.js → chunk-3D77ZXDC.js} +1 -1
- package/dist/{chunk-6AZ7RATD.js → chunk-AKJFVR6J.js} +1 -1
- package/dist/chunk-EHOK5FW2.js +1 -0
- package/dist/chunk-HJPR76HF.js +1 -0
- package/dist/chunk-J67BCWE3.js +1 -0
- package/dist/chunk-KKJW6HJA.js +3 -0
- package/dist/chunk-V43Y4KSA.js +12 -0
- package/dist/chunk-YXG3ZEUP.js +10 -0
- package/dist/{chunk-ZYIULB2P.js → chunk-Z4CYLB7J.js} +1 -1
- package/dist/client.js +1 -1
- package/dist/common/constants/clef-models.d.ts +48 -0
- package/dist/common/constants/tenant-only-nodes.d.ts +1 -1
- package/dist/common/flow-graph/catalog.d.ts +40 -0
- package/dist/common/flow-graph/classifier.d.ts +2 -0
- package/dist/common/flow-graph/composio.d.ts +2 -0
- package/dist/common/flow-graph/credentials.d.ts +3 -0
- package/dist/common/flow-graph/index.d.ts +11 -0
- package/dist/common/flow-graph/ops.d.ts +21 -0
- package/dist/common/flow-graph/refs.d.ts +18 -0
- package/dist/common/flow-graph/schema.d.ts +570 -0
- package/dist/common/flow-graph/templates.d.ts +2 -0
- package/dist/common/flow-graph/validate.d.ts +77 -0
- package/dist/common/types/classifier-types.d.ts +57 -0
- package/dist/common/types/classifier-validation.d.ts +2 -0
- package/dist/common/utils/clef-prefix.d.ts +16 -0
- package/dist/common/utils/clef.d.ts +49 -0
- package/dist/common.d.ts +5 -0
- package/dist/common.js +1 -1
- package/dist/composioDirectTool-ZCZRW5WU.js +1 -0
- package/dist/composioTool-RKVCX25U.js +1 -0
- package/dist/httpTool-IW4W7CGE.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -6
- package/dist/server/core/agentTurn.d.ts +4 -0
- package/dist/server/runners/classifierNodeRunner.d.ts +1 -1
- package/dist/server/utils/clef.d.ts +1 -0
- package/dist/server/utils/composio.d.ts +2 -0
- package/dist/server/utils/redactSecrets.d.ts +6 -0
- package/package.json +1 -1
- package/dist/FlowEngine-H3QNWZVB.js +0 -1
- package/dist/chunk-6JUKM6LT.js +0 -10
- package/dist/chunk-DEW7U7V7.js +0 -23
- package/dist/chunk-QEZQZG6Z.js +0 -3
- package/dist/chunk-RFWFJGER.js +0 -1
- package/dist/chunk-XXB57DMN.js +0 -1
- package/dist/composioDirectTool-XOKIM5FJ.js +0 -1
- package/dist/composioTool-C4KZMI4Q.js +0 -1
- package/dist/httpTool-RT5CTG4O.js +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ClassifierRoute } from '../types/classifier-types';
|
|
2
|
+
export declare const CLEF_MODELS: {
|
|
3
|
+
readonly 'clef-omni': {
|
|
4
|
+
readonly id: '@cf/cloudflare/clef-omni';
|
|
5
|
+
readonly contextWindow: 65529;
|
|
6
|
+
readonly pricePerMillionInputTokens: 0.15;
|
|
7
|
+
};
|
|
8
|
+
readonly clef: {
|
|
9
|
+
readonly id: '@cf/cloudflare/clef';
|
|
10
|
+
readonly contextWindow: 65536;
|
|
11
|
+
readonly pricePerMillionInputTokens: 0.24;
|
|
12
|
+
};
|
|
13
|
+
readonly 'clef-flash': {
|
|
14
|
+
readonly id: '@cf/cloudflare/clef-flash';
|
|
15
|
+
readonly contextWindow: 24576;
|
|
16
|
+
readonly pricePerMillionInputTokens: 0.038;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const CLASSIFIER_DEFAULTS: {
|
|
20
|
+
readonly model: 'clef-omni';
|
|
21
|
+
readonly question: '';
|
|
22
|
+
readonly options: readonly [{
|
|
23
|
+
readonly id: 'option';
|
|
24
|
+
readonly label: '';
|
|
25
|
+
readonly criteria: '';
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: 'option_2';
|
|
28
|
+
readonly label: '';
|
|
29
|
+
readonly criteria: '';
|
|
30
|
+
}];
|
|
31
|
+
readonly checks: readonly [];
|
|
32
|
+
readonly input: {
|
|
33
|
+
readonly message: 'user_input';
|
|
34
|
+
readonly historyTurns: 3;
|
|
35
|
+
readonly vars: string[];
|
|
36
|
+
};
|
|
37
|
+
readonly confidence: {
|
|
38
|
+
readonly threshold: 0.6;
|
|
39
|
+
readonly margin: 0.15;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const CLASSIFIER_RESERVED_HANDLES: {
|
|
43
|
+
readonly uncertain: 'source-__uncertain';
|
|
44
|
+
readonly blocked: 'source-__blocked';
|
|
45
|
+
readonly error: 'source-__error';
|
|
46
|
+
};
|
|
47
|
+
/** Pass ('class', id) for class ids that also happen to be route names. */
|
|
48
|
+
export declare function classifierHandle(routeOrClassId: ClassifierRoute | string, classId?: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NodeType } from '../types/node-types';
|
|
2
|
-
/** Node types
|
|
2
|
+
/** Node types are available across environments. Retained for existing consumers. */
|
|
3
3
|
export declare const TENANT_ONLY_NODES: Partial<Record<NodeType, readonly string[]>>;
|
|
4
4
|
export declare function isNodeTypeAllowedForTenant(type: string, tenant: string | null | undefined): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { NodeTypeName } from './schema';
|
|
2
|
+
export type ExternalRefKind = 'model' | 'clefModel' | 'tool' | 'composioSlug' | 'memo' | 'worker' | 'secret';
|
|
3
|
+
export interface FieldSpec {
|
|
4
|
+
name: string;
|
|
5
|
+
type: 'string' | 'template' | 'ref' | 'ref[]' | 'number' | 'integer' | 'boolean' | 'enum' | 'object' | 'array';
|
|
6
|
+
required: boolean;
|
|
7
|
+
persisted: boolean;
|
|
8
|
+
default?: unknown;
|
|
9
|
+
enum?: readonly string[];
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
description: string;
|
|
13
|
+
externalRef?: ExternalRefKind;
|
|
14
|
+
}
|
|
15
|
+
export interface NodeSpec {
|
|
16
|
+
type: NodeTypeName;
|
|
17
|
+
label: string;
|
|
18
|
+
idPrefix: string;
|
|
19
|
+
summary: string;
|
|
20
|
+
fields: FieldSpec[];
|
|
21
|
+
outputs: {
|
|
22
|
+
name: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
path: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}[];
|
|
27
|
+
handles: {
|
|
28
|
+
target: boolean;
|
|
29
|
+
source: 'none' | 'single' | 'classifier';
|
|
30
|
+
};
|
|
31
|
+
refFields: {
|
|
32
|
+
templates: string[];
|
|
33
|
+
nestedTemplates: string[];
|
|
34
|
+
directRefs: string[];
|
|
35
|
+
};
|
|
36
|
+
discovery: Partial<Record<ExternalRefKind, string>>;
|
|
37
|
+
example: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export declare const NODE_CATALOG: Readonly<Record<NodeTypeName, NodeSpec>>;
|
|
40
|
+
export declare function defaultNodeData(type: NodeTypeName): Record<string, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './schema';
|
|
2
|
+
export * from './catalog';
|
|
3
|
+
export * from './validate';
|
|
4
|
+
export * from './refs';
|
|
5
|
+
export * from './ops';
|
|
6
|
+
export * from './credentials';
|
|
7
|
+
export * from './templates';
|
|
8
|
+
export * from './composio';
|
|
9
|
+
export * from './classifier';
|
|
10
|
+
export { CLEF_MODELS } from '../constants/clef-models';
|
|
11
|
+
export { TOOL_REGISTRY_SNAPSHOT } from '../constants/tools-registry';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GraphIssue, NodeTypeName, WorkerGraph, WorkerOp } from './schema';
|
|
2
|
+
export interface GraphChanges {
|
|
3
|
+
nodesAdded: string[];
|
|
4
|
+
nodesRemoved: string[];
|
|
5
|
+
nodesChanged: string[];
|
|
6
|
+
edgesAdded: string[];
|
|
7
|
+
edgesRemoved: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function edgeId(source: string, target: string, sourceHandle?: string | null): string;
|
|
10
|
+
export declare function nextNodeId(graph: WorkerGraph, type: NodeTypeName): string;
|
|
11
|
+
/** Stable JSON shape: sorted keys, nodes by id, edges by id. UI keys stay. */
|
|
12
|
+
export declare function canonicalGraph(graph: WorkerGraph): unknown;
|
|
13
|
+
export declare function diffGraphs(before: WorkerGraph, after: WorkerGraph): GraphChanges;
|
|
14
|
+
export declare function applyWorkerOps(graph: WorkerGraph, ops: WorkerOp[]): {
|
|
15
|
+
ok: true;
|
|
16
|
+
graph: WorkerGraph;
|
|
17
|
+
changes: GraphChanges;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
issue: GraphIssue;
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AuthoringNode, WorkerGraph } from './schema';
|
|
2
|
+
import type { ExternalRefKind } from './catalog';
|
|
3
|
+
export interface ExternalRef {
|
|
4
|
+
kind: ExternalRefKind;
|
|
5
|
+
id: string;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
field: string;
|
|
8
|
+
extra?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Template and direct refs the runners actually resolve. jsonPrompt is excluded. */
|
|
11
|
+
export declare function collectNodeRefs(node: AuthoringNode): {
|
|
12
|
+
field: string;
|
|
13
|
+
ref: string;
|
|
14
|
+
}[];
|
|
15
|
+
/** Rewrites ancestor refs, including string leaves of an object or array body. Leaves jsonPrompt, keys, and defaults alone. */
|
|
16
|
+
export declare function rewriteNodeDataRefs(data: Record<string, unknown>, oldId: string, newId: string): Record<string, unknown>;
|
|
17
|
+
export declare function collectExternalRefs(graph: WorkerGraph): ExternalRef[];
|
|
18
|
+
export declare function newExternalRefs(before: WorkerGraph | null, after: WorkerGraph): ExternalRef[];
|