@themoltnet/node-red-contrib-core 0.12.0 → 0.12.1

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 (2) hide show
  1. package/dist/nodes/src.js +72 -17
  2. package/package.json +2 -2
package/dist/nodes/src.js CHANGED
@@ -9406,12 +9406,15 @@ function Evaluate(type, options = {}) {
9406
9406
  * V1 bindings only; Tier-2 (reference_file, mcp_resource, imported_file,
9407
9407
  * tool_response_seed, additional_context_hook) ship in a later slice.
9408
9408
  */
9409
- var ContextBinding = Union([
9410
- Literal("skill"),
9411
- Literal("context_inline"),
9412
- Literal("prompt_prefix"),
9413
- Literal("user_inline")
9414
- ], { $id: "ContextBinding" });
9409
+ var CONTEXT_BINDINGS = [
9410
+ "skill",
9411
+ "context_inline",
9412
+ "prompt_prefix",
9413
+ "user_inline"
9414
+ ];
9415
+ /** Maximum UTF-16 code units accepted in one ContextRef content field. */
9416
+ var CONTEXT_REF_MAX_CONTENT_LENGTH = 65536;
9417
+ var ContextBinding = Unsafe(Union(CONTEXT_BINDINGS.map((binding) => Literal(binding)), { $id: "ContextBinding" }));
9415
9418
  /** Reusable input fragment for any task type. Soft cap at 5 items. */
9416
9419
  var TaskContext = _Array_(_Object_({
9417
9420
  slug: String$1({
@@ -9422,7 +9425,7 @@ var TaskContext = _Array_(_Object_({
9422
9425
  binding: ContextBinding,
9423
9426
  content: String$1({
9424
9427
  minLength: 1,
9425
- maxLength: 65536
9428
+ maxLength: CONTEXT_REF_MAX_CONTENT_LENGTH
9426
9429
  })
9427
9430
  }, {
9428
9431
  $id: "ContextRef",
@@ -10775,6 +10778,27 @@ var JudgeEvalAttemptInput = _Object_({
10775
10778
  $id: "JudgeEvalAttemptInput",
10776
10779
  additionalProperties: false
10777
10780
  });
10781
+ /** Agent-authored part of a judge attempt's output. */
10782
+ var JudgeEvalAttemptSubmission = _Object_({
10783
+ targetTaskId: String$1({ format: "uuid" }),
10784
+ targetAttemptN: Integer({ minimum: 1 }),
10785
+ variantLabel: String$1({
10786
+ minLength: 1,
10787
+ maxLength: 64,
10788
+ pattern: "^(?!.* - ).*$"
10789
+ }),
10790
+ scores: _Array_(JudgePackScore, { minItems: 1 }),
10791
+ composite: Number$1({
10792
+ minimum: 0,
10793
+ maximum: 1
10794
+ }),
10795
+ verdict: String$1({ minLength: 1 }),
10796
+ judgeModel: Optional(String$1({ minLength: 1 }))
10797
+ }, {
10798
+ $id: "JudgeEvalAttemptSubmission",
10799
+ additionalProperties: false
10800
+ });
10801
+ /** Durable output after the executor stamps the claim trace context. */
10778
10802
  var JudgeEvalAttemptOutput = _Object_({
10779
10803
  targetTaskId: String$1({ format: "uuid" }),
10780
10804
  targetAttemptN: Integer({ minimum: 1 }),
@@ -10790,7 +10814,7 @@ var JudgeEvalAttemptOutput = _Object_({
10790
10814
  }),
10791
10815
  verdict: String$1({ minLength: 1 }),
10792
10816
  judgeModel: Optional(String$1({ minLength: 1 })),
10793
- traceparent: String$1({ minLength: 1 })
10817
+ traceparent: Optional(String$1({ minLength: 1 }))
10794
10818
  }, {
10795
10819
  $id: "JudgeEvalAttemptOutput",
10796
10820
  additionalProperties: false
@@ -11082,15 +11106,33 @@ var RunEvalInput = _Object_({
11082
11106
  $id: "RunEvalInput",
11083
11107
  additionalProperties: false
11084
11108
  });
11109
+ var RunEvalArtifact = _Object_({
11110
+ path: String$1({ minLength: 1 }),
11111
+ cid: String$1({ minLength: 1 })
11112
+ }, { additionalProperties: false });
11113
+ /**
11114
+ * Fields the eval agent authors through its submit-output tool. Runtime
11115
+ * telemetry deliberately does not live here: an agent cannot truthfully
11116
+ * measure provider token usage, wall-clock duration, or the claim trace.
11117
+ */
11118
+ var RunEvalSubmission = _Object_({
11119
+ response: String$1({ minLength: 1 }),
11120
+ artifacts: Optional(_Array_(RunEvalArtifact)),
11121
+ verification: Optional(VerificationRecord)
11122
+ }, {
11123
+ $id: "RunEvalSubmission",
11124
+ additionalProperties: false
11125
+ });
11126
+ /**
11127
+ * Durable eval output. The daemon materializes this from RunEvalSubmission
11128
+ * and observed execution metadata before the task service accepts it.
11129
+ */
11085
11130
  var RunEvalOutput = _Object_({
11086
11131
  response: String$1({ minLength: 1 }),
11087
- artifacts: Optional(_Array_(_Object_({
11088
- path: String$1({ minLength: 1 }),
11089
- cid: String$1({ minLength: 1 })
11090
- }, { additionalProperties: false }))),
11132
+ artifacts: Optional(_Array_(RunEvalArtifact)),
11091
11133
  totalTokens: Integer({ minimum: 0 }),
11092
11134
  durationMs: Integer({ minimum: 0 }),
11093
- traceparent: String$1({ minLength: 1 }),
11135
+ traceparent: Optional(String$1({ minLength: 1 })),
11094
11136
  verification: Optional(VerificationRecord)
11095
11137
  }, {
11096
11138
  $id: "RunEvalOutput",
@@ -11235,6 +11277,7 @@ var BUILT_IN_TASK_TYPES = {
11235
11277
  name: RUN_EVAL_TYPE,
11236
11278
  inputSchema: RunEvalInput,
11237
11279
  outputSchema: RunEvalOutput,
11280
+ submissionSchema: RunEvalSubmission,
11238
11281
  outputKind: "artifact",
11239
11282
  resumable: true,
11240
11283
  workspaceScope: "session",
@@ -11247,6 +11290,7 @@ var BUILT_IN_TASK_TYPES = {
11247
11290
  name: JUDGE_EVAL_ATTEMPT_TYPE,
11248
11291
  inputSchema: JudgeEvalAttemptInput,
11249
11292
  outputSchema: JudgeEvalAttemptOutput,
11293
+ submissionSchema: JudgeEvalAttemptSubmission,
11250
11294
  outputKind: "judgment",
11251
11295
  workspaceScope: "attempt",
11252
11296
  sessionScope: "none",
@@ -13823,22 +13867,33 @@ function validateTaskInput(taskType, input) {
13823
13867
  }
13824
13868
  return [];
13825
13869
  }
13826
- function validateTaskOutput(taskType, output, input) {
13870
+ function checkVerificationInputCid(value, runtime) {
13871
+ const verification = value !== null && typeof value === "object" ? value.verification : void 0;
13872
+ if (runtime?.inputCid && verification !== void 0 && verification.inputCid !== runtime.inputCid) return [{
13873
+ field: "output/verification/inputCid",
13874
+ message: "must match the task input CID"
13875
+ }];
13876
+ return [];
13877
+ }
13878
+ function validateTaskResult(taskType, value, input, runtime, submission = false) {
13827
13879
  const entry = getTaskTypeEntry(taskType);
13828
13880
  if (!entry) return [{
13829
13881
  field: "taskType",
13830
13882
  message: `Unknown task type: ${taskType}`
13831
13883
  }];
13832
- const errors = schemaErrors("output", entry.outputSchema, output);
13884
+ const errors = schemaErrors("output", submission ? entry.submissionSchema ?? entry.outputSchema : entry.outputSchema, value);
13833
13885
  if (errors.length > 0) return errors;
13834
13886
  if (entry.validateOutput) {
13835
- const validationError = entry.validateOutput(output, input);
13887
+ const validationError = entry.validateOutput(value, input);
13836
13888
  if (validationError) return [{
13837
13889
  field: "output",
13838
13890
  message: validationError
13839
13891
  }];
13840
13892
  }
13841
- return [];
13893
+ return checkVerificationInputCid(value, runtime);
13894
+ }
13895
+ function validateTaskOutput(taskType, output, input, runtime) {
13896
+ return validateTaskResult(taskType, output, input, runtime);
13842
13897
  }
13843
13898
  /**
13844
13899
  * Resolve the TypeBox output schema registered for `taskType`. Returns
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/node-red-contrib-core",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "description": "Node-RED nodes for the MoltNet API",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "main": "dist/nodes/agent.js",
48
48
  "dependencies": {
49
- "@themoltnet/sdk": "0.120.0"
49
+ "@themoltnet/sdk": "0.121.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.19.0",