@runtypelabs/cli 2.23.0 → 2.23.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/index.js +76 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -20404,6 +20404,41 @@ function validateUpsertRecordSourceShape(flowSteps, buckets) {
20404
20404
  }
20405
20405
  }
20406
20406
  }
20407
+ function validateStoreVectorSource(flowSteps, buckets, declaredFlowInputs) {
20408
+ const declaredVariables = collectDeclaredFlowInputs(flowSteps, declaredFlowInputs);
20409
+ for (const [stepIndex, step] of flowSteps.entries()) {
20410
+ if (step.enabled === false) continue;
20411
+ if (!isObjectRecord(step.config)) continue;
20412
+ const config3 = step.config;
20413
+ if (step.type === "store-vector") {
20414
+ const rawSource = typeof config3.vectorsSource === "string" ? config3.vectorsSource.trim() : "";
20415
+ if (rawSource) {
20416
+ const templateMatch = rawSource.match(/^\s*\{\{\s*([^}]+?)\s*\}\}\s*$/);
20417
+ const reference = (templateMatch?.[1] ?? rawSource).trim();
20418
+ const classification = classifyVariableReference(reference);
20419
+ if (classification.namespace === "plain" || classification.namespace === "flow") {
20420
+ const baseName = classification.baseName;
20421
+ const rootVariable = baseName.split(".")[0] || "";
20422
+ if (rootVariable && !declaredVariables.has(rootVariable) && !declaredVariables.has(baseName)) {
20423
+ addIssue(
20424
+ "warning",
20425
+ {
20426
+ code: "STORE_VECTOR_SOURCE_UNRESOLVED",
20427
+ message: `Vectors source "${rawSource}" references variable "${rootVariable}", but no earlier step declares an output variable "${rootVariable}" (and it is not a flow input). This will fail at runtime with "Could not resolve vectors". Set a prior step's outputVariable to "${rootVariable}" (typically a generate-embedding step), or declare "${rootVariable}" as a flow input.`,
20428
+ path: `flowSteps[${stepIndex}].config.vectorsSource`,
20429
+ step: { index: stepIndex, name: step.name, type: step.type },
20430
+ details: { vectorsSource: rawSource, rootVariable }
20431
+ },
20432
+ buckets
20433
+ );
20434
+ }
20435
+ }
20436
+ }
20437
+ }
20438
+ const outputVar = getStepOutputVariable(step);
20439
+ if (outputVar) declaredVariables.add(outputVar);
20440
+ }
20441
+ }
20407
20442
  function checkConditionExpression(expr, path19, stepRef, buckets) {
20408
20443
  if (typeof expr !== "string" || !expr.includes("{{")) return;
20409
20444
  const match = UNQUOTED_TEMPLATE_BEFORE_OP.exec(expr) || UNQUOTED_TEMPLATE_AFTER_OP.exec(expr);
@@ -21061,6 +21096,7 @@ function collectFlowStructureIssues(flowData, deps, buckets) {
21061
21096
  deps.declaredFlowInputs
21062
21097
  );
21063
21098
  validateUpsertRecordSourceShape(flowData.flowSteps, buckets);
21099
+ validateStoreVectorSource(flowData.flowSteps, buckets, deps.declaredFlowInputs);
21064
21100
  validateConditionExpressions(flowData.flowSteps, buckets, conditionalStepsExceedingDepth);
21065
21101
  return { pendingChecks };
21066
21102
  }
@@ -37587,7 +37623,43 @@ var checkGraderSchema = external_exports.discriminatedUnion("kind", [
37587
37623
  }),
37588
37624
  external_exports.object({ kind: external_exports.literal("latency"), maxMs: external_exports.number().int().positive() }),
37589
37625
  // Today's implicit "success" made explicit: the case produced output without erroring.
37590
- external_exports.object({ kind: external_exports.literal("no_error") })
37626
+ external_exports.object({ kind: external_exports.literal("no_error") }),
37627
+ // -------------------------------------------------------------------------
37628
+ // Trace checks — deterministic, free, pure assertions over the run's
37629
+ // EXECUTION TRACE (which tools/steps ran, in what order, whether it
37630
+ // completed, what it cost) rather than its final output text. Scored by the
37631
+ // same pure `runCheck` engine against `GradingTarget.trace`. These are the
37632
+ // assertions a string/JSON check can't express (planning doc §3.1).
37633
+ // -------------------------------------------------------------------------
37634
+ // At least one tool call named `name` happened. Optional filters narrow the
37635
+ // match: `input`/`output` deep-equal a call's resolved input/result,
37636
+ // `isError` matches a call's error flag, and `times` asserts the matching
37637
+ // count EXACTLY (omit `times` for "at least once").
37638
+ external_exports.object({
37639
+ kind: external_exports.literal("called_tool"),
37640
+ name: external_exports.string().min(1),
37641
+ input: external_exports.unknown().optional(),
37642
+ output: external_exports.unknown().optional(),
37643
+ isError: external_exports.boolean().optional(),
37644
+ times: external_exports.number().int().positive().optional()
37645
+ }),
37646
+ // No tool named `name` was called.
37647
+ external_exports.object({ kind: external_exports.literal("not_called_tool"), name: external_exports.string().min(1) }),
37648
+ // The run made no tool calls at all.
37649
+ external_exports.object({ kind: external_exports.literal("used_no_tools") }),
37650
+ // The run made at most `max` tool calls.
37651
+ external_exports.object({ kind: external_exports.literal("max_tool_calls"), max: external_exports.number().int().nonnegative() }),
37652
+ // `tools` appears as an ordered SUBSEQUENCE of the tool-call names (other
37653
+ // calls may interleave; relative order of the listed tools must hold).
37654
+ external_exports.object({ kind: external_exports.literal("tool_order"), tools: external_exports.array(external_exports.string()).min(1) }),
37655
+ // A step named (or typed) `name` ran.
37656
+ external_exports.object({ kind: external_exports.literal("ran_step"), name: external_exports.string().min(1) }),
37657
+ // `steps` appears as an ordered SUBSEQUENCE of the steps that ran.
37658
+ external_exports.object({ kind: external_exports.literal("step_order"), steps: external_exports.array(external_exports.string()).min(1) }),
37659
+ // The run completed (finished without erroring and was not left paused).
37660
+ external_exports.object({ kind: external_exports.literal("completed") }),
37661
+ // Total run cost was within `maxUsd` (US dollars).
37662
+ external_exports.object({ kind: external_exports.literal("cost"), maxUsd: external_exports.number().positive() })
37591
37663
  ]);
37592
37664
  var aiGraderSchema = external_exports.object({
37593
37665
  kind: external_exports.literal("ai"),
@@ -42043,7 +42115,7 @@ var FLOW_STEP_TYPE_METADATA = {
42043
42115
  configHints: "provider, query, maxResults, outputVariable"
42044
42116
  },
42045
42117
  "generate-embedding": {
42046
- description: "Create a vector embedding from text using an embedding model.",
42118
+ description: "Create a vector embedding from text using an embedding model. Writes { embedding, model, dimensions, textLength, metadata } to outputVariable; feed that variable into a store-vector step via vectorsSource.",
42047
42119
  category: "vector",
42048
42120
  isPrompt: false,
42049
42121
  configHints: "inputSource, text, embeddingModel, outputVariable"
@@ -42055,10 +42127,10 @@ var FLOW_STEP_TYPE_METADATA = {
42055
42127
  configHints: "query, limit, threshold, outputVariable"
42056
42128
  },
42057
42129
  "store-vector": {
42058
- description: "Store vector embeddings in a vector database.",
42130
+ description: "Store vector embeddings in a vector database (pgvector, Weaviate, or Vectorize). vectorsSource accepts a bare variable name, a dot-path, or a {{var}} template, and must resolve to a number[] or an { embedding: number[] } object (the output of a prior generate-embedding step). The vector length must match the target index dimension.",
42059
42131
  category: "vector",
42060
42132
  isPrompt: false,
42061
- configHints: "vectorsSource, destination, outputVariable"
42133
+ configHints: "vectorsSource, destination, idTemplate, outputVariable"
42062
42134
  },
42063
42135
  crawl: {
42064
42136
  description: "Crawl a website and extract content from pages.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.23.0",
3
+ "version": "2.23.1",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "rosie-skills": "0.8.1",
25
25
  "yaml": "^2.9.0",
26
26
  "@runtypelabs/ink-components": "0.3.4",
27
- "@runtypelabs/sdk": "5.4.0",
27
+ "@runtypelabs/sdk": "5.5.0",
28
28
  "@runtypelabs/terminal-animations": "0.2.1"
29
29
  },
30
30
  "devDependencies": {
@@ -39,7 +39,7 @@
39
39
  "tsx": "^4.7.1",
40
40
  "typescript": "^6.0.3",
41
41
  "vitest": "^4.1.0",
42
- "@runtypelabs/shared": "1.42.4"
42
+ "@runtypelabs/shared": "1.42.5"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22.0.0"