@re-cinq/floor-pipeline 0.11.4 → 0.13.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/README.md +5 -1
- package/dist/collection/lint-rules.js +25 -0
- package/dist/collection/lint-shape.d.ts +8 -1
- package/dist/collection/lint-shape.js +4 -0
- package/dist/definition-schemas.d.ts +9 -0
- package/dist/definition-schemas.js +30 -1
- package/dist/shape.d.ts +1 -0
- package/dist/shape.js +3 -3
- package/dist/wire-schemas.d.ts +57 -0
- package/dist/wire-schemas.js +35 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -31,6 +31,8 @@ The tool is a client of a [floor](https://github.com/re-cinq/floor) and nothing
|
|
|
31
31
|
|
|
32
32
|
[`@floor/lore-converter`](https://github.com/re-cinq/floor/blob/main/packages/lore-converter/README.md) brings an assembly line in from lore. This tool moves a whole pipeline between a file and a floor, to review it, to keep it in git, or to put the same one into another floor. It moves definitions only. Assembly runs stay where they happened.
|
|
33
33
|
|
|
34
|
+
The subpaths `@re-cinq/floor-pipeline/definition-schemas` and `@re-cinq/floor-pipeline/wire-schemas` export the zod schemas of the definition bodies and of what a station worker sends the floor, so the floor and Studio's test floor read a request alike.
|
|
35
|
+
|
|
34
36
|
See [the map](https://github.com/re-cinq/floor/blob/main/README.md).
|
|
35
37
|
|
|
36
38
|
## The file
|
|
@@ -115,11 +117,13 @@ A key that belongs to the host is named in the collection's `floor-collection.ya
|
|
|
115
117
|
|
|
116
118
|
The same file may hold `groups`, a list of group folder names. A line or an agent held in several listed groups is read from the group listed last, and the earlier files are left out. A duplicate the list does not settle is refused with `<name> is already set by <path>`. `collectionSettingsOf(text)` reads `{ hostKeys, groups }` from the file's text, and `collectionSettingsIn(directory)` from a directory.
|
|
117
119
|
|
|
118
|
-
`lint` asks the same questions the floor asks of an assembly line, through [`@re-cinq/floor-assembly-lines`](../assembly-lines/README.md).
|
|
120
|
+
`lint` asks the same questions the floor asks of an assembly line, through [`@re-cinq/floor-assembly-lines`](../assembly-lines/README.md). Some of its rules:
|
|
119
121
|
|
|
120
122
|
- `unseeded-need` is a need that is neither a line argument or file nor produced on every path into its node. Its message gives one path that arrives without it.
|
|
121
123
|
- `unsupplied-input` is a `{name}` in an agent's prompt that the station does not give.
|
|
122
124
|
- `unknown-key` is a key the floor does not know and would drop without a word, such as `optional` on a produce or a misspelt `iteration-max`. Its message names the key and where it is.
|
|
125
|
+
- `undescribed-outcome` is a key of a station's `outcome_descriptions` that is neither one of its outcomes nor `failed`.
|
|
126
|
+
- `malformed-enum` is a produce's `enum` that is empty, holds an empty or repeated value, or sits on a `file` item.
|
|
123
127
|
|
|
124
128
|
What a station gives a prompt:
|
|
125
129
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// What a pipeline must hold to run at all, and why each rule.
|
|
2
2
|
import { ambiguousEdges, danglingEdges, deadEnds, undeclaredOutcomes, unreachableNodes, unroutedOutcomes, } from "./graph-rules.js";
|
|
3
|
+
import { enumRefusalOf, undescribableOutcomeOf } from "../definition-schemas.js";
|
|
4
|
+
import { fieldsOf } from "../shape.js";
|
|
3
5
|
import { supplyOf, unseededNeeds, unsuppliedInputs } from "./lint-supply.js";
|
|
4
6
|
import { problem, readPipeline, stationOf, } from "./lint-shape.js";
|
|
5
7
|
export { PIPELINE_RULES } from "./lint-shape.js";
|
|
@@ -11,6 +13,7 @@ export function pipelineProblems(yamlText, prompts) {
|
|
|
11
13
|
return [
|
|
12
14
|
...agentDeclarationProblems(checked, prompts),
|
|
13
15
|
...unkeyedLine(checked),
|
|
16
|
+
...malformedEnums(checked),
|
|
14
17
|
...undeclaredBags(checked),
|
|
15
18
|
...allNodeProblems(checked, prompts),
|
|
16
19
|
...graphRuleProblems(checked),
|
|
@@ -94,10 +97,32 @@ function nodeProblems(supply, position, prompts) {
|
|
|
94
97
|
const definition = station.agent_definition ?? node.station ?? "";
|
|
95
98
|
return [
|
|
96
99
|
...unroutedOutcomes(checked, node, station),
|
|
100
|
+
...undescribedOutcome(checked, node, station),
|
|
97
101
|
...unsuppliedInputs(supply, stationNode, { definition, text: prompts.get(definition) }),
|
|
98
102
|
...unseededNeeds(supply, stationNode),
|
|
99
103
|
];
|
|
100
104
|
}
|
|
105
|
+
function undescribedOutcome(checked, node, station) {
|
|
106
|
+
const name = undescribableOutcomeOf(station.outcomes, Object.keys(fieldsOf(station.outcome_descriptions)));
|
|
107
|
+
return name === undefined
|
|
108
|
+
? []
|
|
109
|
+
: [
|
|
110
|
+
problem(checked, node.id, "undescribed-outcome", `outcome_descriptions names ${name}, which its station does not declare`),
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
function malformedEnums(checked) {
|
|
114
|
+
return Object.entries(checked.stations).flatMap(([id, station]) => (station.produces ?? [])
|
|
115
|
+
.filter(isEnumProduce)
|
|
116
|
+
.map(enumRefusalOf)
|
|
117
|
+
.filter((reason) => reason !== undefined)
|
|
118
|
+
.map((reason) => problem(checked, undefined, "malformed-enum", `station ${id}: ${reason}`)));
|
|
119
|
+
}
|
|
120
|
+
function isEnumProduce(produce) {
|
|
121
|
+
return (typeof produce.name === "string" &&
|
|
122
|
+
typeof produce.kind === "string" &&
|
|
123
|
+
Array.isArray(produce.enum) &&
|
|
124
|
+
produce.enum.every((value) => typeof value === "string"));
|
|
125
|
+
}
|
|
101
126
|
// A walk revisiting a node needs iteration_max or unattended_max to bound the loop.
|
|
102
127
|
function unboundedRetries(checked) {
|
|
103
128
|
const { edges } = checked.line;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/** Every rule a collection's lint has, by the id its specification lists it under. */
|
|
3
|
-
export declare const PIPELINE_RULES: readonly ["agent-settings-in-pipeline", "ambiguous-edge", "dangling-edge", "dead-end", "undeclared-agent", "undeclared-bag", "outcome-without-edge", "undeclared-outcome", "unbounded-retry", "unkeyed-line", "unknown-key", "unreachable", "unseeded-need", "unsupplied-input", "unresolvable-conversation-key"];
|
|
3
|
+
export declare const PIPELINE_RULES: readonly ["agent-settings-in-pipeline", "ambiguous-edge", "dangling-edge", "dead-end", "malformed-enum", "undeclared-agent", "undeclared-bag", "outcome-without-edge", "undeclared-outcome", "undescribed-outcome", "unbounded-retry", "unkeyed-line", "unknown-key", "unreachable", "unseeded-need", "unsupplied-input", "unresolvable-conversation-key"];
|
|
4
4
|
export type PipelineRule = (typeof PIPELINE_RULES)[number];
|
|
5
5
|
export interface PipelineProblem {
|
|
6
6
|
line: string;
|
|
@@ -14,17 +14,20 @@ declare const bagItemSchema: z.ZodObject<{
|
|
|
14
14
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
15
15
|
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
16
16
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
17
|
+
enum: z.ZodOptional<z.ZodUnknown>;
|
|
17
18
|
}, z.core.$loose>;
|
|
18
19
|
declare const stationSchema: z.ZodObject<{
|
|
19
20
|
kind: z.ZodOptional<z.ZodString>;
|
|
20
21
|
agent_definition: z.ZodOptional<z.ZodString>;
|
|
21
22
|
outcomes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
23
|
+
outcome_descriptions: z.ZodOptional<z.ZodUnknown>;
|
|
22
24
|
needs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
23
25
|
name: z.ZodOptional<z.ZodString>;
|
|
24
26
|
kind: z.ZodOptional<z.ZodString>;
|
|
25
27
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
26
28
|
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
27
29
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
enum: z.ZodOptional<z.ZodUnknown>;
|
|
28
31
|
}, z.core.$loose>>>;
|
|
29
32
|
produces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
33
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -32,6 +35,7 @@ declare const stationSchema: z.ZodObject<{
|
|
|
32
35
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
33
36
|
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
34
37
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
38
|
+
enum: z.ZodOptional<z.ZodUnknown>;
|
|
35
39
|
}, z.core.$loose>>>;
|
|
36
40
|
conversation: z.ZodOptional<z.ZodString>;
|
|
37
41
|
conversation_key: z.ZodOptional<z.ZodString>;
|
|
@@ -65,12 +69,14 @@ declare const pipelineSchema: z.ZodObject<{
|
|
|
65
69
|
kind: z.ZodOptional<z.ZodString>;
|
|
66
70
|
agent_definition: z.ZodOptional<z.ZodString>;
|
|
67
71
|
outcomes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
|
+
outcome_descriptions: z.ZodOptional<z.ZodUnknown>;
|
|
68
73
|
needs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
69
74
|
name: z.ZodOptional<z.ZodString>;
|
|
70
75
|
kind: z.ZodOptional<z.ZodString>;
|
|
71
76
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
72
77
|
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
73
78
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
79
|
+
enum: z.ZodOptional<z.ZodUnknown>;
|
|
74
80
|
}, z.core.$loose>>>;
|
|
75
81
|
produces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
82
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -78,6 +84,7 @@ declare const pipelineSchema: z.ZodObject<{
|
|
|
78
84
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
79
85
|
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
80
86
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
87
|
+
enum: z.ZodOptional<z.ZodUnknown>;
|
|
81
88
|
}, z.core.$loose>>>;
|
|
82
89
|
conversation: z.ZodOptional<z.ZodString>;
|
|
83
90
|
conversation_key: z.ZodOptional<z.ZodString>;
|
|
@@ -7,10 +7,12 @@ export const PIPELINE_RULES = [
|
|
|
7
7
|
"ambiguous-edge",
|
|
8
8
|
"dangling-edge",
|
|
9
9
|
"dead-end",
|
|
10
|
+
"malformed-enum",
|
|
10
11
|
"undeclared-agent",
|
|
11
12
|
"undeclared-bag",
|
|
12
13
|
"outcome-without-edge",
|
|
13
14
|
"undeclared-outcome",
|
|
15
|
+
"undescribed-outcome",
|
|
14
16
|
"unbounded-retry",
|
|
15
17
|
"unkeyed-line",
|
|
16
18
|
"unknown-key",
|
|
@@ -26,6 +28,7 @@ const bagItemSchema = z
|
|
|
26
28
|
optional: z.boolean().optional(),
|
|
27
29
|
fresh: z.boolean().optional(),
|
|
28
30
|
collect: z.unknown().optional(),
|
|
31
|
+
enum: z.unknown().optional(),
|
|
29
32
|
})
|
|
30
33
|
.loose();
|
|
31
34
|
const stationSchema = z
|
|
@@ -33,6 +36,7 @@ const stationSchema = z
|
|
|
33
36
|
kind: z.string().optional(),
|
|
34
37
|
agent_definition: z.string().optional(),
|
|
35
38
|
outcomes: z.array(z.string()).default([]),
|
|
39
|
+
outcome_descriptions: z.unknown().optional(),
|
|
36
40
|
needs: z.array(bagItemSchema).optional(),
|
|
37
41
|
produces: z.array(bagItemSchema).optional(),
|
|
38
42
|
conversation: z.string().optional(),
|
|
@@ -65,6 +65,7 @@ export declare function definitionSchemas(object: ObjectOf, scheduleChecks?: Sch
|
|
|
65
65
|
}>>;
|
|
66
66
|
conversationKey: z.ZodOptional<z.ZodString>;
|
|
67
67
|
outcomes: z.ZodArray<z.ZodString>;
|
|
68
|
+
outcomeDescriptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
68
69
|
mustChange: z.ZodOptional<z.ZodBoolean>;
|
|
69
70
|
resultRequired: z.ZodOptional<z.ZodBoolean>;
|
|
70
71
|
needs: z.ZodArray<z.ZodObject<{
|
|
@@ -91,6 +92,8 @@ export declare function definitionSchemas(object: ObjectOf, scheduleChecks?: Sch
|
|
|
91
92
|
}>;
|
|
92
93
|
path: z.ZodOptional<z.ZodString>;
|
|
93
94
|
from: z.ZodOptional<z.ZodLiteral<"output">>;
|
|
95
|
+
description: z.ZodOptional<z.ZodString>;
|
|
96
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
97
|
}, z.core.$strict | z.core.$strip>>;
|
|
95
98
|
url: z.ZodOptional<z.ZodString>;
|
|
96
99
|
route: z.ZodOptional<z.ZodString>;
|
|
@@ -225,4 +228,10 @@ export declare function definitionSchemas(object: ObjectOf, scheduleChecks?: Sch
|
|
|
225
228
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
226
229
|
}, z.core.$strict | z.core.$strip>;
|
|
227
230
|
};
|
|
231
|
+
export declare function undescribableOutcomeOf(outcomes: readonly string[], describedNames: readonly string[]): string | undefined;
|
|
232
|
+
export declare function enumRefusalOf(produce: {
|
|
233
|
+
name: string;
|
|
234
|
+
kind: string;
|
|
235
|
+
enum?: string[];
|
|
236
|
+
}): string | undefined;
|
|
228
237
|
export {};
|
|
@@ -78,14 +78,22 @@ function stationBodyOf(object) {
|
|
|
78
78
|
conversation: z.enum(["new", "continue"]).describe("Agent stations only. `continue` resumes the conversation of this node's last visit in the run that did not fail.").optional(),
|
|
79
79
|
conversationKey: z.string().describe("With `conversation: continue`. The name of a bag item. The conversation resumed is one from a run on the same repo that holds the same value under that name.").optional(),
|
|
80
80
|
outcomes: z.array(z.string()).describe("The outcomes the station reports. `failed` can be reported whether it is listed or not."),
|
|
81
|
+
outcomeDescriptions: z.record(z.string(), z.string()).describe("Outcome to what picking it means, for a person who reports for the station. `failed` may be described whether it is listed or not. The floor does not act on it, and changing it makes no new version.").optional(),
|
|
81
82
|
mustChange: z.boolean().describe("Accepted and not acted on.").optional(),
|
|
82
83
|
resultRequired: z.boolean().describe("Agent stations only. An agent that ends without stating a result has `failed`. Without it, silence is read as `success`.").optional(),
|
|
83
84
|
needs: z.array(needOf(object)).describe("The bag items a visit is given."),
|
|
84
85
|
produces: z.array(produceOf(object)).describe("The bag items a visit writes."),
|
|
85
86
|
url: z.string().describe("Accepted and not acted on.").optional(),
|
|
86
87
|
route: z.string().describe("Human stations only. Kept for the page a person acts through. The floor does not read it.").optional(),
|
|
88
|
+
}).superRefine((station, context) => {
|
|
89
|
+
const name = undescribableOutcomeOf(station.outcomes, Object.keys(station.outcomeDescriptions ?? {}));
|
|
90
|
+
if (name)
|
|
91
|
+
context.addIssue({ code: "custom", path: ["outcomeDescriptions"], message: `names ${name}, which is not one of the station's outcomes` });
|
|
87
92
|
});
|
|
88
93
|
}
|
|
94
|
+
export function undescribableOutcomeOf(outcomes, describedNames) {
|
|
95
|
+
return describedNames.find((name) => name !== "failed" && !outcomes.includes(name));
|
|
96
|
+
}
|
|
89
97
|
function needOf(object) {
|
|
90
98
|
return object({
|
|
91
99
|
name: z.string().describe("The need's name. The bag item of the same name fills it, unless the node's `bind` names another."),
|
|
@@ -103,7 +111,28 @@ function produceOf(object) {
|
|
|
103
111
|
kind: z.enum(["value", "file"]).describe("The kind of item written."),
|
|
104
112
|
path: z.string().describe("Agent stations only. The file the agent writes, relative to `/workspace`.").optional(),
|
|
105
113
|
from: z.literal("output").describe("Agent stations only. The file is everything the agent said last. For kind `file`, and with no `path`.").optional(),
|
|
106
|
-
|
|
114
|
+
description: z.string().describe("What the item holds, for a person who fills it in or reads it. The floor does not act on it, and changing it makes no new version.").optional(),
|
|
115
|
+
enum: z.array(z.string()).describe("`value` items only. The values the item may hold. A report that gives another value is refused.").optional(),
|
|
116
|
+
}).refine((produce) => !produce.from || (produce.kind === "file" && !produce.path), { message: "from: output is for a file, and takes no path" }).superRefine((produce, context) => {
|
|
117
|
+
const refusal = enumRefusalOf(produce);
|
|
118
|
+
if (refusal)
|
|
119
|
+
context.addIssue({ code: "custom", message: refusal });
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export function enumRefusalOf(produce) {
|
|
123
|
+
const { enum: values } = produce;
|
|
124
|
+
if (!values)
|
|
125
|
+
return undefined;
|
|
126
|
+
if (produce.kind !== "value")
|
|
127
|
+
return `produce ${produce.name} is a file and takes no enum`;
|
|
128
|
+
if (values.length === 0)
|
|
129
|
+
return `produce ${produce.name} has an empty enum`;
|
|
130
|
+
if (values.includes(""))
|
|
131
|
+
return `produce ${produce.name} lists an empty value in its enum`;
|
|
132
|
+
const repeated = values.find((value, index) => values.indexOf(value) !== index);
|
|
133
|
+
if (repeated)
|
|
134
|
+
return `produce ${produce.name} lists ${repeated} twice in its enum`;
|
|
135
|
+
return undefined;
|
|
107
136
|
}
|
|
108
137
|
function agentDefinitionBodyOf(object) {
|
|
109
138
|
const agentSettings = agentSettingsOf(object);
|
package/dist/shape.d.ts
CHANGED
|
@@ -25,4 +25,5 @@ export declare const FILE_SPELLING: Spelling;
|
|
|
25
25
|
export declare function pipelineOf(file: PipelineFile): Pipeline;
|
|
26
26
|
/** What is empty is left out: a file says what a pipeline has. */
|
|
27
27
|
export declare function fileOf(pipeline: Pipeline): PipelineFile;
|
|
28
|
+
export declare function fieldsOf(held: unknown): Fields;
|
|
28
29
|
export {};
|
package/dist/shape.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const AS_THE_FLOOR_SPELLS = {
|
|
2
2
|
edge: { iteration_max: "iterationMax", unattended_max: "unattendedMax" },
|
|
3
|
-
station: { agent_definition: "agentDefinition", conversation_key: "conversationKey", must_change: "mustChange", result_required: "resultRequired" },
|
|
3
|
+
station: { agent_definition: "agentDefinition", conversation_key: "conversationKey", must_change: "mustChange", result_required: "resultRequired", outcome_descriptions: "outcomeDescriptions" },
|
|
4
4
|
settings: { timeout_minutes: "timeoutMinutes" },
|
|
5
5
|
price: { input_per_million: "inputPerMillion", output_per_million: "outputPerMillion", cache_read_per_million: "cacheReadPerMillion", cache_write_per_million: "cacheWritePerMillion" },
|
|
6
6
|
};
|
|
@@ -34,7 +34,7 @@ function archiveOf(written) {
|
|
|
34
34
|
/** The order a person reads in: where a line begins before what it is given, a prompt after the model it is for. A floor hands its fields back in the alphabet's. */
|
|
35
35
|
const READ_IN_ORDER = {
|
|
36
36
|
line: ["id", "entry", "exit", "fail", "start", "args", "files", "nodes", "edges"],
|
|
37
|
-
station: ["kind", "description", "agent_definition", "conversation", "conversation_key", "url", "route", "outcomes", "must_change", "result_required", "needs", "produces"],
|
|
37
|
+
station: ["kind", "description", "agent_definition", "conversation", "conversation_key", "url", "route", "outcomes", "outcome_descriptions", "must_change", "result_required", "needs", "produces"],
|
|
38
38
|
settings: ["model", "image", "timeout_minutes", "tags", "prices", "config", "prompt"],
|
|
39
39
|
schedule: ["cron", "timezone", "payload"],
|
|
40
40
|
};
|
|
@@ -97,7 +97,7 @@ function isFilled(held) {
|
|
|
97
97
|
return false;
|
|
98
98
|
return typeof held === "object" && held !== null ? Object.keys(held).length > 0 : true;
|
|
99
99
|
}
|
|
100
|
-
function fieldsOf(held) {
|
|
100
|
+
export function fieldsOf(held) {
|
|
101
101
|
return typeof held === "object" && held !== null && !Array.isArray(held) ? held : {};
|
|
102
102
|
}
|
|
103
103
|
function listOf(held) {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const startRunSchema: z.ZodObject<{
|
|
3
|
+
repo: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | null, string | undefined>>;
|
|
4
|
+
startItems: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5
|
+
kind: z.ZodEnum<{
|
|
6
|
+
file: "file";
|
|
7
|
+
git: "git";
|
|
8
|
+
value: "value";
|
|
9
|
+
}>;
|
|
10
|
+
ref: z.ZodString;
|
|
11
|
+
by: z.ZodString;
|
|
12
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
15
|
+
lineHash: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const enqueueEventSchema: z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
20
|
+
dedupeKey: z.ZodOptional<z.ZodString>;
|
|
21
|
+
availableAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
22
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const claimEventsSchema: z.ZodObject<{
|
|
25
|
+
tags: z.ZodArray<z.ZodString>;
|
|
26
|
+
limit: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const failEventSchema: z.ZodObject<{
|
|
29
|
+
error: z.ZodString;
|
|
30
|
+
permanent: z.ZodBoolean;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const recordKindSchema: z.ZodEnum<{
|
|
33
|
+
llm_call: "llm_call";
|
|
34
|
+
log: "log";
|
|
35
|
+
turn: "turn";
|
|
36
|
+
}>;
|
|
37
|
+
export declare const createRecordsSchema: z.ZodObject<{
|
|
38
|
+
records: z.ZodArray<z.ZodObject<{
|
|
39
|
+
kind: z.ZodEnum<{
|
|
40
|
+
llm_call: "llm_call";
|
|
41
|
+
log: "log";
|
|
42
|
+
turn: "turn";
|
|
43
|
+
}>;
|
|
44
|
+
body: z.ZodUnknown;
|
|
45
|
+
occurredAt: z.ZodCoercedDate<unknown>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export declare const reportedPayloadSchema: z.ZodObject<{
|
|
49
|
+
visitId: z.ZodUUID;
|
|
50
|
+
worker: z.ZodOptional<z.ZodString>;
|
|
51
|
+
report: z.ZodObject<{
|
|
52
|
+
outcome: z.ZodString;
|
|
53
|
+
produced: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
54
|
+
sessionRef: z.ZodOptional<z.ZodString>;
|
|
55
|
+
error: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// What a station worker sends the floor: the request bodies it claims, fails, enqueues, starts and records with, and the payload of its report. The floor and Studio's test floor read them alike.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { itemKind } from "./definition-schemas.js";
|
|
4
|
+
const startItem = z.object({ kind: itemKind, ref: z.string(), by: z.string(), sha: z.string().optional() });
|
|
5
|
+
export const startRunSchema = z.object({
|
|
6
|
+
repo: z.string().min(1).optional().transform((repo) => repo ?? null),
|
|
7
|
+
startItems: z.record(z.string(), startItem),
|
|
8
|
+
entry: z.string().optional(),
|
|
9
|
+
lineHash: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
const coercedDate = z.coerce.date();
|
|
12
|
+
export const enqueueEventSchema = z.object({
|
|
13
|
+
name: z.string(),
|
|
14
|
+
payload: z.record(z.string(), z.unknown()),
|
|
15
|
+
dedupeKey: z.string().optional(),
|
|
16
|
+
availableAt: coercedDate.optional(),
|
|
17
|
+
runId: z.string().optional(),
|
|
18
|
+
});
|
|
19
|
+
export const claimEventsSchema = z.object({ tags: z.array(z.string()), limit: z.number().int().positive() });
|
|
20
|
+
export const failEventSchema = z.object({ error: z.string(), permanent: z.boolean() });
|
|
21
|
+
export const recordKindSchema = z.enum(["log", "turn", "llm_call"]);
|
|
22
|
+
export const createRecordsSchema = z.object({
|
|
23
|
+
records: z.array(z.object({ kind: recordKindSchema, body: z.unknown(), occurredAt: coercedDate })).min(1),
|
|
24
|
+
});
|
|
25
|
+
export const reportedPayloadSchema = z.object({
|
|
26
|
+
visitId: z.uuid(),
|
|
27
|
+
worker: z.string().optional(),
|
|
28
|
+
report: z.object({
|
|
29
|
+
outcome: z.string().min(1),
|
|
30
|
+
produced: z.record(z.string(), z.string()).optional(),
|
|
31
|
+
sessionRef: z.string().optional(),
|
|
32
|
+
error: z.string().optional(),
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=wire-schemas.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@re-cinq/floor-pipeline",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "A floor's pipeline as one YAML file: an assembly line with its stations, its agent definitions and their prompts, its files and its schedules. Exports one from a floor, imports one into a floor, and applies a folder of them in order, each once. It speaks the floor's HTTP API and nothing else.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"./definition-schemas": {
|
|
38
38
|
"types": "./dist/definition-schemas.d.ts",
|
|
39
39
|
"default": "./dist/definition-schemas.js"
|
|
40
|
+
},
|
|
41
|
+
"./wire-schemas": {
|
|
42
|
+
"types": "./dist/wire-schemas.d.ts",
|
|
43
|
+
"default": "./dist/wire-schemas.js"
|
|
40
44
|
}
|
|
41
45
|
},
|
|
42
46
|
"files": [
|
|
@@ -57,9 +61,9 @@
|
|
|
57
61
|
"typecheck": "tsc --noEmit"
|
|
58
62
|
},
|
|
59
63
|
"dependencies": {
|
|
60
|
-
"@re-cinq/floor-assembly-lines": "0.
|
|
61
|
-
"@re-cinq/floor-client": "0.
|
|
62
|
-
"@re-cinq/floor-contracts": "0.
|
|
64
|
+
"@re-cinq/floor-assembly-lines": "0.13.0",
|
|
65
|
+
"@re-cinq/floor-client": "0.13.0",
|
|
66
|
+
"@re-cinq/floor-contracts": "0.13.0",
|
|
63
67
|
"yaml": "^2.7.0",
|
|
64
68
|
"zod": "^4.5.4"
|
|
65
69
|
},
|