@m6d/cortex-cli 0.8.0 → 0.8.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* The boundary on a Vega-Lite spec the model wrote, shared by the widget
|
|
3
|
-
* (which draws it live) and
|
|
3
|
+
* (which draws it live) and the server (which describes it to the model):
|
|
4
4
|
* inline data only, no fetches, no interactivity, bounded work.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -18,6 +18,9 @@ const EXPANDING_TRANSFORMS = new Set([
|
|
|
18
18
|
"sample",
|
|
19
19
|
]);
|
|
20
20
|
|
|
21
|
+
/** The boundary as the model reads it in its system prompt, so it writes specs this file accepts. */
|
|
22
|
+
export const CHART_SPEC_GUIDE = `Use Vega-Lite JSON with inline \`data.values\` only, at most ${MAX_CHART_ROWS} rows, and no \`url\` anywhere. Compute folds, trend lines and densities yourself. For several series, write one row per series and x value, or keep one row per x value and draw a layer per series (color by \`datum\`) when that would exceed the row limit. These keys are refused anywhere in the spec: ${[...EXPANDING_TRANSFORMS, "params", "selection"].join(", ")}. Expressions in \`calculate\`, \`filter\` and \`labelExpr\` may use only datum fields, literals, operators and simple math or date-part functions (no format or timeFormat), so put formatted values in the rows or use an axis \`format\`.`;
|
|
23
|
+
|
|
21
24
|
/** What a single key or value in a chart spec may not be; undefined when it is fine on its own. */
|
|
22
25
|
function chartNodeViolation(key: string, value: unknown) {
|
|
23
26
|
if (key === "url") return "Charts may only use inline data and no URLs.";
|
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
|
|
21
21
|
export const MESSAGE_TRIGGER_NAME = "message";
|
|
22
22
|
|
|
23
|
+
/** The tool a trigger run with an output schema answers through; no other tool may take its name. */
|
|
24
|
+
export const TRIGGER_ANSWER_TOOL_NAME = "submitAnswer";
|
|
25
|
+
|
|
23
26
|
/**
|
|
24
27
|
* The first characters of a fire bearer say what it is: the secret callers
|
|
25
28
|
* hold, or a one-shot test token the console minted. A test token is a JWT
|
|
@@ -98,9 +101,10 @@ export const triggerDeclarationSchema = z.object({
|
|
|
98
101
|
input: z.record(z.string(), z.unknown()),
|
|
99
102
|
/**
|
|
100
103
|
* JSON Schema the run's answer must match, or null for a free-text run.
|
|
101
|
-
* The
|
|
102
|
-
* and stores it as the firing's `output`; a run
|
|
103
|
-
*
|
|
104
|
+
* The run submits it through an answer tool whose input is this schema,
|
|
105
|
+
* and the server stores it as the firing's `output`; a run that never
|
|
106
|
+
* submits fails with `no_output`, one whose answers the schema refused
|
|
107
|
+
* with `invalid_output`.
|
|
104
108
|
*/
|
|
105
109
|
output: z.record(z.string(), z.unknown()).nullable(),
|
|
106
110
|
/**
|
package/src/scaffold/files.ts
CHANGED
|
@@ -27,7 +27,7 @@ export type Database = "postgres" | "mssql";
|
|
|
27
27
|
// sync (scripts/sync-package-versions.ts) restamps it and files.test.ts holds
|
|
28
28
|
// them to that.
|
|
29
29
|
export const DEPENDENCIES = {
|
|
30
|
-
"@m6d/cortex-server": "~0.8.
|
|
30
|
+
"@m6d/cortex-server": "~0.8.1",
|
|
31
31
|
"@tanstack/ai": "^0.55.0",
|
|
32
32
|
"@tanstack/ai-openai": "^0.22.8",
|
|
33
33
|
hono: "^4.12.3",
|