@framers/agentos 0.1.74 → 0.1.75
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/orchestration/builders/index.d.ts +1 -1
- package/dist/orchestration/builders/index.d.ts.map +1 -1
- package/dist/orchestration/builders/index.js +1 -1
- package/dist/orchestration/builders/index.js.map +1 -1
- package/dist/orchestration/builders/nodes.d.ts +15 -0
- package/dist/orchestration/builders/nodes.d.ts.map +1 -1
- package/dist/orchestration/builders/nodes.js +33 -0
- package/dist/orchestration/builders/nodes.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { gmiNode, toolNode, humanNode, routerNode, guardrailNode, subgraphNode } from './nodes.js';
|
|
1
|
+
export { gmiNode, toolNode, humanNode, routerNode, guardrailNode, subgraphNode, judgeNode } from './nodes.js';
|
|
2
2
|
export type { NodePolicies } from './nodes.js';
|
|
3
3
|
export { AgentGraph, CompiledAgentGraph } from './AgentGraph.js';
|
|
4
4
|
export { workflow, WorkflowBuilder, CompiledWorkflow } from './WorkflowBuilder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestration/builders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestration/builders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9G,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnF,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { gmiNode, toolNode, humanNode, routerNode, guardrailNode, subgraphNode } from './nodes.js';
|
|
1
|
+
export { gmiNode, toolNode, humanNode, routerNode, guardrailNode, subgraphNode, judgeNode } from './nodes.js';
|
|
2
2
|
export { AgentGraph, CompiledAgentGraph } from './AgentGraph.js';
|
|
3
3
|
export { workflow, WorkflowBuilder, CompiledWorkflow } from './WorkflowBuilder.js';
|
|
4
4
|
export { mission, MissionBuilder, CompiledMission } from './MissionBuilder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestration/builders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestration/builders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE9G,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -29,6 +29,21 @@ export declare function guardrailNode(guardrailIds: string[], config: {
|
|
|
29
29
|
onViolation: 'block' | 'reroute' | 'warn' | 'sanitize';
|
|
30
30
|
rerouteTarget?: string;
|
|
31
31
|
}): GraphNode;
|
|
32
|
+
/**
|
|
33
|
+
* Creates an LLM-as-judge evaluation node with structured rubric output.
|
|
34
|
+
* The judge is a gmiNode that enforces single_turn execution and structured JSON output.
|
|
35
|
+
*
|
|
36
|
+
* @param config.rubric - Evaluation criteria description
|
|
37
|
+
* @param config.schema - Zod schema for structured score output
|
|
38
|
+
* @param config.threshold - Optional minimum passing score per dimension
|
|
39
|
+
* @param config.model - Optional model override for the judge LLM
|
|
40
|
+
*/
|
|
41
|
+
export declare function judgeNode(config: {
|
|
42
|
+
rubric: string;
|
|
43
|
+
schema: any;
|
|
44
|
+
threshold?: number;
|
|
45
|
+
model?: string;
|
|
46
|
+
}, policies?: NodePolicies): GraphNode;
|
|
32
47
|
export declare function subgraphNode(compiledGraph: CompiledExecutionGraph, config?: {
|
|
33
48
|
inputMapping?: Record<string, string>;
|
|
34
49
|
outputMapping?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/orchestration/builders/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/orchestration/builders/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,iBAAiB,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAGpM,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SA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MAAM,CAAC;CACxB,GAAG,SAAS,CAcZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CAwBrC;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,GAAG,SAAS,CAcZ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { lowerZodToJsonSchema } from '../compiler/SchemaLowering.js';
|
|
1
2
|
let nodeCounter = 0;
|
|
2
3
|
function nextId(prefix) {
|
|
3
4
|
return `${prefix}-${++nodeCounter}`;
|
|
@@ -80,6 +81,38 @@ export function guardrailNode(guardrailIds, config) {
|
|
|
80
81
|
checkpoint: 'none',
|
|
81
82
|
};
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates an LLM-as-judge evaluation node with structured rubric output.
|
|
86
|
+
* The judge is a gmiNode that enforces single_turn execution and structured JSON output.
|
|
87
|
+
*
|
|
88
|
+
* @param config.rubric - Evaluation criteria description
|
|
89
|
+
* @param config.schema - Zod schema for structured score output
|
|
90
|
+
* @param config.threshold - Optional minimum passing score per dimension
|
|
91
|
+
* @param config.model - Optional model override for the judge LLM
|
|
92
|
+
*/
|
|
93
|
+
export function judgeNode(config, policies) {
|
|
94
|
+
const instructions = [
|
|
95
|
+
'You are an evaluation judge. Your task is to score content against a rubric.',
|
|
96
|
+
'',
|
|
97
|
+
'## Rubric',
|
|
98
|
+
config.rubric,
|
|
99
|
+
'',
|
|
100
|
+
'## Instructions',
|
|
101
|
+
'1. Read the content in the conversation carefully.',
|
|
102
|
+
'2. Score each dimension in the rubric on a scale of 1-10.',
|
|
103
|
+
'3. Respond with ONLY a JSON object matching the required schema.',
|
|
104
|
+
'4. Do not include any other text, explanation, or commentary.',
|
|
105
|
+
config.threshold
|
|
106
|
+
? `\n## Pass Threshold\nA score of ${config.threshold} or higher on each dimension is required to pass.`
|
|
107
|
+
: '',
|
|
108
|
+
].join('\n');
|
|
109
|
+
const base = gmiNode({ instructions, executionMode: 'single_turn' }, policies);
|
|
110
|
+
return {
|
|
111
|
+
...base,
|
|
112
|
+
id: nextId('judge'),
|
|
113
|
+
outputSchema: lowerZodToJsonSchema(config.schema),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
83
116
|
export function subgraphNode(compiledGraph, config) {
|
|
84
117
|
return {
|
|
85
118
|
id: nextId('subgraph'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../../src/orchestration/builders/nodes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../../src/orchestration/builders/nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAWrE,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,SAAS,MAAM,CAAC,MAAc;IAC5B,OAAO,GAAG,MAAM,IAAI,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,MAOvB,EAAE,QAAuB;IACxB,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,KAAK;QACX,cAAc,EAAE;YACd,IAAI,EAAE,KAAK;YACX,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;YACnD,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,WAAW,EA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