@re-cinq/floor-pipeline 0.6.2 → 0.7.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 +4 -1
- package/dist/collection/agents.d.ts +2 -0
- package/dist/collection/collection-settings.d.ts +12 -0
- package/dist/collection/collection-settings.js +27 -0
- package/dist/collection/collection.d.ts +1 -1
- package/dist/collection/collection.js +3 -1
- package/dist/collection/group-precedence.d.ts +3 -0
- package/dist/collection/group-precedence.js +20 -0
- package/dist/collection/line-layout.d.ts +11 -0
- package/dist/collection/line-layout.js +46 -0
- package/dist/collection/lint-directory.d.ts +1 -4
- package/dist/collection/lint-directory.js +5 -13
- package/dist/collection/lint-rules.js +3 -3
- package/dist/collection/lint-shape.d.ts +7 -1
- package/dist/collection/lint-shape.js +3 -0
- package/dist/collection/paths.d.ts +12 -1
- package/dist/collection/paths.js +28 -7
- package/dist/collection/pipelines.d.ts +1 -2
- package/dist/collection/pipelines.js +10 -34
- package/dist/collection/unknown-keys.d.ts +3 -0
- package/dist/collection/unknown-keys.js +35 -0
- package/dist/definition-schemas.d.ts +220 -0
- package/dist/definition-schemas.js +141 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5 -2
- package/dist/shape.js +1 -1
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ schedules:
|
|
|
91
91
|
|
|
92
92
|
## A collection
|
|
93
93
|
|
|
94
|
-
A collection is a folder of assembly lines. Each one has its own folder, with its pipeline and its agents. An agent is a markdown file: the frontmatter holds its settings, and the body is its prompt. A file named `<agent>.extra.md` adds to the prompt of an agent the host already ships.
|
|
94
|
+
A collection is a folder of assembly lines. Each one has its own folder, with its pipeline and its agents. A line folder may sit one level down, in a group folder such as `stock/`. The group is in no name, and a line's id is unique in the whole collection. An agent is a markdown file: the frontmatter holds its settings, and the body is its prompt. A file named `<agent>.extra.md` adds to the prompt of an agent the host already ships.
|
|
95
95
|
|
|
96
96
|
```
|
|
97
97
|
code-review/
|
|
@@ -113,10 +113,13 @@ floor-pipeline lint collection/ --host-key execution_mode
|
|
|
113
113
|
|
|
114
114
|
A key that belongs to the host is named in the collection's `floor-collection.yaml` (`host_keys: [execution_mode]`), or with `--host-key`, as often as needed. `lint` and `apply` use both.
|
|
115
115
|
|
|
116
|
+
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
|
+
|
|
116
118
|
`lint` asks the same questions the floor asks of an assembly line, through [`@re-cinq/floor-assembly-lines`](../assembly-lines/README.md). Two of its rules:
|
|
117
119
|
|
|
118
120
|
- `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.
|
|
119
121
|
- `unsupplied-input` is a `{name}` in an agent's prompt that the station does not give.
|
|
122
|
+
- `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.
|
|
120
123
|
|
|
121
124
|
What a station gives a prompt:
|
|
122
125
|
|
|
@@ -14,6 +14,8 @@ export interface CollectionOverlayInput {
|
|
|
14
14
|
env: Environment;
|
|
15
15
|
/** Frontmatter keys that are the host's own: accepted in an agent file, and never in its settings. */
|
|
16
16
|
hostKeys?: readonly string[];
|
|
17
|
+
/** Group folder names, in order: a name held in several of them is read from the one listed last. */
|
|
18
|
+
groups?: readonly string[];
|
|
17
19
|
}
|
|
18
20
|
export type AgentSource = "collection-new" | "replaced" | "extended";
|
|
19
21
|
export interface OverlayAgent {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The file at a collection's root that says what the collection expects of its host. */
|
|
2
|
+
export declare const COLLECTION_SETTINGS_FILE = "floor-collection.yaml";
|
|
3
|
+
export interface CollectionSettings {
|
|
4
|
+
hostKeys: string[];
|
|
5
|
+
groups: string[];
|
|
6
|
+
}
|
|
7
|
+
/** What the text of a `floor-collection.yaml` says: the frontmatter keys its host owns under `host_keys`, and the group folders under `groups`; empty for either left out. */
|
|
8
|
+
export declare function collectionSettingsOf(text: string): CollectionSettings;
|
|
9
|
+
/** The settings in a directory's `floor-collection.yaml`; empty without the file. */
|
|
10
|
+
export declare function collectionSettingsIn(root: string): Promise<CollectionSettings>;
|
|
11
|
+
/** The frontmatter keys the collection's host owns, as its `floor-collection.yaml` names them under `host_keys`; none without the file. */
|
|
12
|
+
export declare function hostKeysIn(root: string): Promise<string[]>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { parse } from "yaml";
|
|
4
|
+
import { enforce } from "./enforce.js";
|
|
5
|
+
/** The file at a collection's root that says what the collection expects of its host. */
|
|
6
|
+
export const COLLECTION_SETTINGS_FILE = "floor-collection.yaml";
|
|
7
|
+
/** What the text of a `floor-collection.yaml` says: the frontmatter keys its host owns under `host_keys`, and the group folders under `groups`; empty for either left out. */
|
|
8
|
+
export function collectionSettingsOf(text) {
|
|
9
|
+
const settings = new Map(Object.entries(parse(text) ?? {}));
|
|
10
|
+
const hostKeys = settings.get("host_keys") ?? [];
|
|
11
|
+
enforce(Array.isArray(hostKeys) && hostKeys.every((key) => typeof key === "string"), `${COLLECTION_SETTINGS_FILE}: host_keys is a list of names`);
|
|
12
|
+
const groups = settings.get("groups") ?? [];
|
|
13
|
+
enforce(isDistinctFolderNames(groups), `${COLLECTION_SETTINGS_FILE}: groups is a list of distinct folder names`);
|
|
14
|
+
return { hostKeys, groups };
|
|
15
|
+
}
|
|
16
|
+
function isDistinctFolderNames(value) {
|
|
17
|
+
return Array.isArray(value) && value.every((name) => typeof name === "string" && !name.includes("/")) && new Set(value).size === value.length;
|
|
18
|
+
}
|
|
19
|
+
/** The settings in a directory's `floor-collection.yaml`; empty without the file. */
|
|
20
|
+
export async function collectionSettingsIn(root) {
|
|
21
|
+
return collectionSettingsOf(await readFile(join(root, COLLECTION_SETTINGS_FILE), "utf8").catch(() => ""));
|
|
22
|
+
}
|
|
23
|
+
/** The frontmatter keys the collection's host owns, as its `floor-collection.yaml` names them under `host_keys`; none without the file. */
|
|
24
|
+
export async function hostKeysIn(root) {
|
|
25
|
+
return (await collectionSettingsIn(root)).hostKeys;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=collection-settings.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { withoutReplacedFiles } from "./group-precedence.js";
|
|
1
2
|
import { agentsOverlay } from "./agents.js";
|
|
2
3
|
import { pipelinesOverlay } from "./pipelines.js";
|
|
3
4
|
import { isReadPath } from "./paths.js";
|
|
4
|
-
export function collectionOverlay(
|
|
5
|
+
export function collectionOverlay(whole) {
|
|
6
|
+
const input = { ...whole, files: withoutReplacedFiles(whole.files, whole.groups ?? []) };
|
|
5
7
|
const agentsSet = agentsOverlay(input);
|
|
6
8
|
const pipelinesSet = pipelinesOverlay(input, agentsSet.agents);
|
|
7
9
|
const { agents } = agentsSet;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type CollectionFile } from "./paths.js";
|
|
2
|
+
/** The collection's files, less each line file and agent file that sits in a listed group when a later listed group holds the same line or agent; the folder of a line is no group. */
|
|
3
|
+
export declare function withoutReplacedFiles(files: readonly CollectionFile[], groups: readonly string[]): CollectionFile[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { agentFileGroupOf, agentFileOf, lineFilePlaceOf } from "./paths.js";
|
|
2
|
+
/** The collection's files, less each line file and agent file that sits in a listed group when a later listed group holds the same line or agent; the folder of a line is no group. */
|
|
3
|
+
export function withoutReplacedFiles(files, groups) {
|
|
4
|
+
const lineFolders = new Set(files.flatMap((file) => lineFilePlaceOf(file.path)?.folderPath ?? []));
|
|
5
|
+
const claims = files.flatMap((file) => claimOf(file, lineFolders));
|
|
6
|
+
const kept = new Set(withoutEarlierGroups(claims, groups).map((claim) => claim.file));
|
|
7
|
+
const claimed = new Set(claims.map((claim) => claim.file));
|
|
8
|
+
return files.filter((file) => kept.has(file) || !claimed.has(file));
|
|
9
|
+
}
|
|
10
|
+
function claimOf(file, lineFolders) {
|
|
11
|
+
const line = lineFilePlaceOf(file.path);
|
|
12
|
+
const agent = agentFileOf(file.path);
|
|
13
|
+
const claim = line ? { name: `line ${line.folder}`, group: line.group } : agent && { name: `agent ${agent.agent}`, group: agentFileGroupOf(file.path) };
|
|
14
|
+
return claim ? [{ file, name: claim.name, group: claim.group && !lineFolders.has(claim.group) ? claim.group : undefined }] : [];
|
|
15
|
+
}
|
|
16
|
+
function withoutEarlierGroups(claims, groups) {
|
|
17
|
+
const rankOf = (group) => (group === undefined ? -1 : groups.indexOf(group));
|
|
18
|
+
return claims.filter((claim) => rankOf(claim.group) < 0 || !claims.some((other) => other.name === claim.name && rankOf(other.group) > rankOf(claim.group)));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=group-precedence.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type CollectionFile, type LineFilePlace } from "./paths.js";
|
|
2
|
+
import { type Refusal } from "./refusal.js";
|
|
3
|
+
/** A line file of a collection, with its place: the line's name and the group folder it may sit in. */
|
|
4
|
+
export type LineFile = CollectionFile & LineFilePlace;
|
|
5
|
+
/** The line files a collection reads, in the order lines are put to the host, and the refusals of the rest. */
|
|
6
|
+
export interface LineLayout {
|
|
7
|
+
read: LineFile[];
|
|
8
|
+
refused: Refusal[];
|
|
9
|
+
}
|
|
10
|
+
/** The line files a collection reads, and the ones its layout refuses, decided from paths alone. */
|
|
11
|
+
export declare function lineLayoutOf(files: readonly CollectionFile[]): LineLayout;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Which line files a collection reads, decided from paths alone: a line held twice in one folder, a line folder used as a group, and a second folder for one line name are refused.
|
|
2
|
+
import { enforce } from "./enforce.js";
|
|
3
|
+
import { FORMER_LINE_FILE, LINE_FILE, lineFilePlaceOf } from "./paths.js";
|
|
4
|
+
import { attempt } from "./refusal.js";
|
|
5
|
+
/** The line files a collection reads, and the ones its layout refuses, decided from paths alone. */
|
|
6
|
+
export function lineLayoutOf(files) {
|
|
7
|
+
const lineFiles = lineFilesOf(files);
|
|
8
|
+
const superseded = supersededBy(lineFiles);
|
|
9
|
+
const lineFolders = new Set(lineFiles.map((file) => file.folderPath));
|
|
10
|
+
const setBy = new Map();
|
|
11
|
+
const read = [];
|
|
12
|
+
const refused = [];
|
|
13
|
+
for (const file of lineFiles) {
|
|
14
|
+
const result = attempt(file.path, () => {
|
|
15
|
+
enforce(!superseded.has(file.path), `the folder ${file.folder} holds its line twice: ${LINE_FILE} is read, so remove ${FORMER_LINE_FILE}`);
|
|
16
|
+
enforce(file.group === undefined || !lineFolders.has(file.group), `the folder ${file.group} holds a line, so it is not a group: move ${file.folder} out of it`);
|
|
17
|
+
enforce(!setBy.has(file.folder), `${file.folder} is already set by ${setBy.get(file.folder)}`);
|
|
18
|
+
setBy.set(file.folder, file.path);
|
|
19
|
+
});
|
|
20
|
+
if ("refusal" in result) {
|
|
21
|
+
refused.push(result.refusal);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
read.push(file);
|
|
25
|
+
}
|
|
26
|
+
return { read, refused };
|
|
27
|
+
}
|
|
28
|
+
// The former name's file, in a folder that holds the line under its name too: two files would be two versions of one line.
|
|
29
|
+
function supersededBy(lineFiles) {
|
|
30
|
+
const named = new Set(lineFiles.filter((file) => file.path.endsWith(`/${LINE_FILE}`)).map((file) => file.folderPath));
|
|
31
|
+
const former = lineFiles.filter((file) => file.path.endsWith(`/${FORMER_LINE_FILE}`) && named.has(file.folderPath));
|
|
32
|
+
return new Set(former.map((file) => file.path));
|
|
33
|
+
}
|
|
34
|
+
function lineFilesOf(files) {
|
|
35
|
+
return files
|
|
36
|
+
.flatMap((file) => {
|
|
37
|
+
const place = lineFilePlaceOf(file.path);
|
|
38
|
+
return place ? [{ ...file, ...place }] : [];
|
|
39
|
+
})
|
|
40
|
+
.sort(byLineNameThenPath);
|
|
41
|
+
}
|
|
42
|
+
// By line name, not path, so a line moved into a group folder keeps its place in the order lines are put to the host; among files of one name, path order decides which is read.
|
|
43
|
+
function byLineNameThenPath(left, right) {
|
|
44
|
+
return left.folder.localeCompare(right.folder) || left.path.localeCompare(right.path);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=line-layout.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ShippedCatalog } from "./agents.js";
|
|
2
2
|
import { type CollectionOverlay } from "./collection.js";
|
|
3
|
+
export { COLLECTION_SETTINGS_FILE, hostKeysIn } from "./collection-settings.js";
|
|
3
4
|
import type { Environment } from "./environment.js";
|
|
4
5
|
import { type CollectionFile } from "./paths.js";
|
|
5
6
|
export declare function lintCollectionDirectory(root: string, hostKeys?: readonly string[], shipped?: ShippedCatalog): Promise<CollectionOverlay>;
|
|
@@ -24,9 +25,5 @@ export declare function lintCommand(given: LintCommand, usage: string, output: {
|
|
|
24
25
|
}): Promise<number>;
|
|
25
26
|
/** Prints the refused files and answers the exit code: 0 clean, 1 refused. */
|
|
26
27
|
export declare function printCollectionLint(root: string, hostKeys: readonly string[], print: (line: string) => void, shipped?: ShippedCatalog): Promise<number>;
|
|
27
|
-
/** The file at a collection's root that says what the collection expects of its host. */
|
|
28
|
-
export declare const COLLECTION_SETTINGS_FILE = "floor-collection.yaml";
|
|
29
|
-
/** The frontmatter keys the collection's host owns, as its `floor-collection.yaml` names them under `host_keys`; none without the file. */
|
|
30
|
-
export declare function hostKeysIn(root: string): Promise<string[]>;
|
|
31
28
|
/** The files of a collection on disk, each with its path from the root: the ones a collection reads or refuses. */
|
|
32
29
|
export declare function collectionFilesIn(root: string): Promise<CollectionFile[]>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// The overlay of a collection on a local directory, and the lines a lint prints about it: no floor, no network.
|
|
2
2
|
import { readdir, readFile } from "node:fs/promises";
|
|
3
3
|
import { join, relative, sep } from "node:path";
|
|
4
|
-
import { parse } from "yaml";
|
|
5
4
|
import { agentsOverlay } from "./agents.js";
|
|
6
5
|
import { collectionOverlay } from "./collection.js";
|
|
6
|
+
import { collectionSettingsIn } from "./collection-settings.js";
|
|
7
|
+
export { COLLECTION_SETTINGS_FILE, hostKeysIn } from "./collection-settings.js";
|
|
7
8
|
import { enforce } from "./enforce.js";
|
|
8
9
|
import { isCollectionFile, pipelineFolderOf } from "./paths.js";
|
|
9
10
|
/** Stands in for the install's environment: whether a variable is set there is not the collection's to know. */
|
|
@@ -15,8 +16,9 @@ export async function lintCollectionDirectory(root, hostKeys = [], shipped = NOT
|
|
|
15
16
|
}
|
|
16
17
|
/** The collection in a directory, with `${NAME}` filled from the environment given, and the host keys given joined by the ones its `floor-collection.yaml` names. Nothing is shipped unless a catalog is given. */
|
|
17
18
|
export async function readCollectionDirectory(root, given) {
|
|
18
|
-
const
|
|
19
|
-
|
|
19
|
+
const settings = await collectionSettingsIn(root);
|
|
20
|
+
const hostKeys = [...given.hostKeys, ...settings.hostKeys];
|
|
21
|
+
return collectionOverlay({ files: await collectionFilesIn(root), ...given, hostKeys, groups: settings.groups, shipped: given.shipped ?? NOTHING_SHIPPED });
|
|
20
22
|
}
|
|
21
23
|
/** The catalog a directory laid out as a collection stands for: the lines and the agents it holds are the ones shipped. */
|
|
22
24
|
export async function shippedCatalogIn(root, hostKeys = []) {
|
|
@@ -45,16 +47,6 @@ export async function printCollectionLint(root, hostKeys, print, shipped = NOTHI
|
|
|
45
47
|
print(`collection ok: ${counts.agents} agents, ${counts.pipelines} pipelines, ${counts.extensions} extensions`);
|
|
46
48
|
return 0;
|
|
47
49
|
}
|
|
48
|
-
/** The file at a collection's root that says what the collection expects of its host. */
|
|
49
|
-
export const COLLECTION_SETTINGS_FILE = "floor-collection.yaml";
|
|
50
|
-
/** The frontmatter keys the collection's host owns, as its `floor-collection.yaml` names them under `host_keys`; none without the file. */
|
|
51
|
-
export async function hostKeysIn(root) {
|
|
52
|
-
const text = await readFile(join(root, COLLECTION_SETTINGS_FILE), "utf8").catch(() => "");
|
|
53
|
-
const settings = new Map(Object.entries(parse(text) ?? {}));
|
|
54
|
-
const hostKeys = settings.get("host_keys") ?? [];
|
|
55
|
-
enforce(Array.isArray(hostKeys) && hostKeys.every((key) => typeof key === "string"), `${COLLECTION_SETTINGS_FILE}: host_keys is a list of names`);
|
|
56
|
-
return hostKeys;
|
|
57
|
-
}
|
|
58
50
|
/** The files of a collection on disk, each with its path from the root: the ones a collection reads or refuses. */
|
|
59
51
|
export async function collectionFilesIn(root) {
|
|
60
52
|
const entries = await readdir(root, { recursive: true, withFileTypes: true });
|
|
@@ -98,11 +98,11 @@ function nodeProblems(supply, position, prompts) {
|
|
|
98
98
|
...unseededNeeds(supply, stationNode),
|
|
99
99
|
];
|
|
100
100
|
}
|
|
101
|
-
// A walk revisiting a node needs iteration_max to bound the loop.
|
|
101
|
+
// A walk revisiting a node needs iteration_max or unattended_max to bound the loop.
|
|
102
102
|
function unboundedRetries(checked) {
|
|
103
103
|
const { edges } = checked.line;
|
|
104
|
-
const backEdges = edges.filter((edge) => edge.from === edge.to && edge.iteration_max === undefined);
|
|
105
|
-
return backEdges.map((edge) => problem(checked, edge.from, "unbounded-retry", `node "${edge.from}" has a back-edge to itself with no iteration_max; the walk would retry without bound`));
|
|
104
|
+
const backEdges = edges.filter((edge) => edge.from === edge.to && edge.iteration_max === undefined && edge.unattended_max === undefined);
|
|
105
|
+
return backEdges.map((edge) => problem(checked, edge.from, "unbounded-retry", `node "${edge.from}" has a back-edge to itself with no iteration_max and no unattended_max; the walk would retry without bound`));
|
|
106
106
|
}
|
|
107
107
|
// conversation_key must name a declared arg so the floor can key the conversation.
|
|
108
108
|
function unresolvableConversationKeys(checked) {
|
|
@@ -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", "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", "undeclared-agent", "undeclared-bag", "outcome-without-edge", "undeclared-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;
|
|
@@ -12,6 +12,7 @@ declare const bagItemSchema: z.ZodObject<{
|
|
|
12
12
|
name: z.ZodOptional<z.ZodString>;
|
|
13
13
|
kind: z.ZodOptional<z.ZodString>;
|
|
14
14
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
15
16
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
16
17
|
}, z.core.$loose>;
|
|
17
18
|
declare const stationSchema: z.ZodObject<{
|
|
@@ -22,12 +23,14 @@ declare const stationSchema: z.ZodObject<{
|
|
|
22
23
|
name: z.ZodOptional<z.ZodString>;
|
|
23
24
|
kind: z.ZodOptional<z.ZodString>;
|
|
24
25
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
25
27
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
26
28
|
}, z.core.$loose>>>;
|
|
27
29
|
produces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
30
|
name: z.ZodOptional<z.ZodString>;
|
|
29
31
|
kind: z.ZodOptional<z.ZodString>;
|
|
30
32
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
31
34
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
32
35
|
}, z.core.$loose>>>;
|
|
33
36
|
conversation: z.ZodOptional<z.ZodString>;
|
|
@@ -55,6 +58,7 @@ declare const pipelineSchema: z.ZodObject<{
|
|
|
55
58
|
to: z.ZodDefault<z.ZodString>;
|
|
56
59
|
on: z.ZodOptional<z.ZodString>;
|
|
57
60
|
iteration_max: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
unattended_max: z.ZodOptional<z.ZodNumber>;
|
|
58
62
|
}, z.core.$loose>>>;
|
|
59
63
|
}, z.core.$loose>;
|
|
60
64
|
stations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -65,12 +69,14 @@ declare const pipelineSchema: z.ZodObject<{
|
|
|
65
69
|
name: z.ZodOptional<z.ZodString>;
|
|
66
70
|
kind: z.ZodOptional<z.ZodString>;
|
|
67
71
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
68
73
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
69
74
|
}, z.core.$loose>>>;
|
|
70
75
|
produces: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
76
|
name: z.ZodOptional<z.ZodString>;
|
|
72
77
|
kind: z.ZodOptional<z.ZodString>;
|
|
73
78
|
optional: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
74
80
|
collect: z.ZodOptional<z.ZodUnknown>;
|
|
75
81
|
}, z.core.$loose>>>;
|
|
76
82
|
conversation: z.ZodOptional<z.ZodString>;
|
|
@@ -13,6 +13,7 @@ export const PIPELINE_RULES = [
|
|
|
13
13
|
"undeclared-outcome",
|
|
14
14
|
"unbounded-retry",
|
|
15
15
|
"unkeyed-line",
|
|
16
|
+
"unknown-key",
|
|
16
17
|
"unreachable",
|
|
17
18
|
"unseeded-need",
|
|
18
19
|
"unsupplied-input",
|
|
@@ -23,6 +24,7 @@ const bagItemSchema = z
|
|
|
23
24
|
name: z.string().optional(),
|
|
24
25
|
kind: z.string().optional(),
|
|
25
26
|
optional: z.boolean().optional(),
|
|
27
|
+
fresh: z.boolean().optional(),
|
|
26
28
|
collect: z.unknown().optional(),
|
|
27
29
|
})
|
|
28
30
|
.loose();
|
|
@@ -73,6 +75,7 @@ const pipelineSchema = z
|
|
|
73
75
|
to: z.string().default(""),
|
|
74
76
|
on: z.string().optional(),
|
|
75
77
|
iteration_max: z.number().optional(),
|
|
78
|
+
unattended_max: z.number().optional(),
|
|
76
79
|
})
|
|
77
80
|
.loose())
|
|
78
81
|
.default([]),
|
|
@@ -7,12 +7,23 @@ export interface CollectionFile {
|
|
|
7
7
|
path: string;
|
|
8
8
|
text: string;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
10
|
+
/** Where a line's file sits: its line folder's name, that folder's path, and the group folder above it, undefined for a top-level line folder. */
|
|
11
|
+
export interface LineFilePlace {
|
|
12
|
+
folder: string;
|
|
13
|
+
folderPath: string;
|
|
14
|
+
group: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare function lineFilePlaceOf(path: string): LineFilePlace | undefined;
|
|
17
|
+
/** The name of the line folder a line's file sits in. */
|
|
11
18
|
export declare function pipelineFolderOf(path: string): string | undefined;
|
|
19
|
+
/** The line folder a line's file sits in, with its group folder if it has one. */
|
|
20
|
+
export declare function lineFolderPathOf(path: string): string | undefined;
|
|
12
21
|
export declare function agentFileOf(path: string): {
|
|
13
22
|
agent: string;
|
|
14
23
|
isExtension: boolean;
|
|
15
24
|
} | undefined;
|
|
25
|
+
/** The group folder an agent file sits in, undefined for a top-level line folder or a path that is no agent file. */
|
|
26
|
+
export declare function agentFileGroupOf(path: string): string | undefined;
|
|
16
27
|
export declare function isCollectionFile(path: string): boolean;
|
|
17
28
|
/** A path a collection reads: a pipeline or an agent file. */
|
|
18
29
|
export declare function isReadPath(path: string): boolean;
|
package/dist/collection/paths.js
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
|
-
// The layout of a collection: `<line>/assembly-line.yaml`, `<line>/agents/<agent>.md` and `<line>/agents/<agent>.extra.md
|
|
1
|
+
// The layout of a collection: `<line>/assembly-line.yaml`, `<line>/agents/<agent>.md` and `<line>/agents/<agent>.extra.md`, where a line folder may sit inside a group folder. A line folder written before the file was renamed holds `pipeline.yaml`, which is read as the same thing.
|
|
2
2
|
/** The host's own top folders: the skills it serves its agents, not lines. */
|
|
3
3
|
const HOST_FOLDERS = ["skills", "agent-skills"];
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
/** A line or group folder: any name but a host folder or one starting with a dot. */
|
|
5
|
+
const FOLDER = String.raw `(?!\.)(?!(?:${HOST_FOLDERS.join("|")})\/)[^/]+`;
|
|
6
|
+
/** A folder that holds lines. One directly above `agents/` is a line folder, never a group, and a top-level `docs/` is never one. */
|
|
7
|
+
function optionalGroup(group) {
|
|
8
|
+
return String.raw `(?:(?!docs\/)${group}\/(?!agents\/))?`;
|
|
9
|
+
}
|
|
10
|
+
const PIPELINE_FILE = new RegExp(String.raw `^(${optionalGroup(`(${FOLDER})`)}(${FOLDER}))\/(assembly-line|pipeline)\.yaml$`);
|
|
6
11
|
/** The name a line's file has. */
|
|
7
12
|
export const LINE_FILE = "assembly-line.yaml";
|
|
8
13
|
/** The name it had, still read. */
|
|
9
14
|
export const FORMER_LINE_FILE = "pipeline.yaml";
|
|
10
|
-
const AGENT_FILE = new RegExp(String.raw `^${FOLDER}\/agents\/([^/]+?)(\.extra)?\.md$`);
|
|
11
|
-
|
|
15
|
+
const AGENT_FILE = new RegExp(String.raw `^${optionalGroup(`(${FOLDER})`)}${FOLDER}\/agents\/([^/]+?)(\.extra)?\.md$`);
|
|
16
|
+
export function lineFilePlaceOf(path) {
|
|
17
|
+
const match = PIPELINE_FILE.exec(path);
|
|
18
|
+
return match ? { folderPath: match[1], group: match[2], folder: match[3] } : undefined;
|
|
19
|
+
}
|
|
20
|
+
/** The name of the line folder a line's file sits in. */
|
|
12
21
|
export function pipelineFolderOf(path) {
|
|
13
|
-
return
|
|
22
|
+
return lineFilePlaceOf(path)?.folder;
|
|
23
|
+
}
|
|
24
|
+
/** The line folder a line's file sits in, with its group folder if it has one. */
|
|
25
|
+
export function lineFolderPathOf(path) {
|
|
26
|
+
return lineFilePlaceOf(path)?.folderPath;
|
|
14
27
|
}
|
|
15
28
|
export function agentFileOf(path) {
|
|
29
|
+
const place = agentFilePlaceOf(path);
|
|
30
|
+
return place && { agent: place.agent, isExtension: place.isExtension };
|
|
31
|
+
}
|
|
32
|
+
/** The group folder an agent file sits in, undefined for a top-level line folder or a path that is no agent file. */
|
|
33
|
+
export function agentFileGroupOf(path) {
|
|
34
|
+
return agentFilePlaceOf(path)?.group;
|
|
35
|
+
}
|
|
36
|
+
function agentFilePlaceOf(path) {
|
|
16
37
|
const match = AGENT_FILE.exec(path);
|
|
17
|
-
return match ? { agent: match[
|
|
38
|
+
return match ? { agent: match[2], isExtension: Boolean(match[3]), group: match[1] } : undefined;
|
|
18
39
|
}
|
|
19
40
|
/** A markdown or YAML file inside a line folder: read, or refused as a path a collection does not read. A file at the top, under `docs/`, under a host folder or under a dot folder is not the collection's. */
|
|
20
41
|
const LINE_FOLDER_FILE = new RegExp(String.raw `^(?!(?:docs|${HOST_FOLDERS.join("|")})\/)[^./][^/]*\/.+\.(md|ya?ml)$`);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { CollectionOverlayInput, OverlayAgent } from "./agents.js";
|
|
2
|
-
import { type Refusal } from "./refusal.js";
|
|
3
2
|
import { type Pipeline } from "../shape.js";
|
|
4
3
|
/** The pipelines the collection sets, its own and its versions of the lines the host ships. Each names its agents only: the agents are put on their own, so a pipeline is imported with no agent definitions of its own. */
|
|
5
4
|
export declare function pipelinesOverlay(input: CollectionOverlayInput, collectionAgents: ReadonlyMap<string, OverlayAgent>): {
|
|
6
5
|
pipelines: Pipeline[];
|
|
7
|
-
refused: Refusal[];
|
|
6
|
+
refused: import("./refusal.js").Refusal[];
|
|
8
7
|
};
|
|
@@ -1,52 +1,28 @@
|
|
|
1
1
|
import { withEnvironment } from "./environment.js";
|
|
2
2
|
import { enforce } from "./enforce.js";
|
|
3
3
|
import { pipelineProblems } from "./lint-rules.js";
|
|
4
|
-
import {
|
|
4
|
+
import { lineLayoutOf } from "./line-layout.js";
|
|
5
5
|
import { attempt } from "./refusal.js";
|
|
6
|
+
import { unknownKeys } from "./unknown-keys.js";
|
|
6
7
|
import { readPipelineFile } from "../file.js";
|
|
7
8
|
import { pipelineOf } from "../shape.js";
|
|
8
9
|
/** The pipelines the collection sets, its own and its versions of the lines the host ships. Each names its agents only: the agents are put on their own, so a pipeline is imported with no agent definitions of its own. */
|
|
9
10
|
export function pipelinesOverlay(input, collectionAgents) {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const result = attempt(file.path, () => {
|
|
16
|
-
enforce(!superseded.has(file.path), `the folder ${file.folder} holds its line twice: ${LINE_FILE} is read, so remove ${FORMER_LINE_FILE}`);
|
|
17
|
-
return pipelineOfFile(file, input, collectionAgents);
|
|
18
|
-
});
|
|
19
|
-
if ("refusal" in result) {
|
|
20
|
-
refused.push(result.refusal);
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
pipelines.push(result.made);
|
|
24
|
-
}
|
|
25
|
-
return { pipelines, refused };
|
|
26
|
-
}
|
|
27
|
-
// The former name's file, in a folder that holds the line under its name too: two files would be two versions of one line.
|
|
28
|
-
function supersededBy(lineFiles) {
|
|
29
|
-
const named = new Set(lineFiles.filter((file) => file.path.endsWith(`/${LINE_FILE}`)).map((file) => file.folder));
|
|
30
|
-
const former = lineFiles.filter((file) => file.path.endsWith(`/${FORMER_LINE_FILE}`) && named.has(file.folder));
|
|
31
|
-
return new Set(former.map((file) => file.path));
|
|
32
|
-
}
|
|
33
|
-
function pipelineFilesOf(files) {
|
|
34
|
-
return files
|
|
35
|
-
.flatMap((file) => {
|
|
36
|
-
const folder = pipelineFolderOf(file.path);
|
|
37
|
-
return folder ? [{ ...file, folder }] : [];
|
|
38
|
-
})
|
|
39
|
-
.sort((left, right) => left.path.localeCompare(right.path));
|
|
11
|
+
const layout = lineLayoutOf(input.files);
|
|
12
|
+
const results = layout.read.map((file) => attempt(file.path, () => pipelineOfFile(file, input, collectionAgents)));
|
|
13
|
+
const pipelines = results.flatMap((result) => ("made" in result ? [result.made] : []));
|
|
14
|
+
const unread = results.flatMap((result) => ("refusal" in result ? [result.refusal] : []));
|
|
15
|
+
return { pipelines, refused: [...layout.refused, ...unread] };
|
|
40
16
|
}
|
|
41
17
|
function pipelineOfFile(file, { shipped, env }, collectionAgents) {
|
|
42
18
|
const filled = withEnvironment(file.text, env);
|
|
43
|
-
enforceNoProblems(filled, promptsOf(shipped.agents, collectionAgents));
|
|
19
|
+
enforceNoProblems(pipelineProblems(filled, promptsOf(shipped.agents, collectionAgents)));
|
|
44
20
|
const pipeline = pipelineOf(readPipelineFile(filled));
|
|
21
|
+
enforceNoProblems(unknownKeys(pipeline));
|
|
45
22
|
enforce(pipeline.line?.id === file.folder, `the folder ${file.folder} must hold the pipeline of that name, and its line is ${pipeline.line?.id}`);
|
|
46
23
|
return pipeline;
|
|
47
24
|
}
|
|
48
|
-
function enforceNoProblems(
|
|
49
|
-
const problems = pipelineProblems(yamlText, prompts);
|
|
25
|
+
function enforceNoProblems(problems) {
|
|
50
26
|
enforce(problems.length === 0, problems.map((problem) => problem.detail).join("; "));
|
|
51
27
|
}
|
|
52
28
|
/** The prompts a pipeline can name: the shipped agents' and the collection's own. */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// The unknown-key lint rule: a key in a body that the floor does not know, read with closed schemas.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { definitionSchemas } from "../definition-schemas.js";
|
|
4
|
+
import { FILE_SPELLING } from "../shape.js";
|
|
5
|
+
const { lineBodySchema, stationBodySchema, agentDefinitionBodySchema, scheduleBodySchema } = definitionSchemas(z.strictObject);
|
|
6
|
+
export function unknownKeys(pipeline) {
|
|
7
|
+
return checkedBodies(pipeline)
|
|
8
|
+
.flatMap(unknownKeysIn)
|
|
9
|
+
.map(({ path, key }) => ({ line: pipeline.line?.id ?? "", rule: "unknown-key", detail: `${path}: unknown key "${key}"` }));
|
|
10
|
+
}
|
|
11
|
+
function checkedBodies(pipeline) {
|
|
12
|
+
return [
|
|
13
|
+
...(pipeline.line ? [{ place: "line", schema: lineBodySchema, body: pipeline.line.body }] : []),
|
|
14
|
+
...bodiesUnder("stations", stationBodySchema, pipeline.stations),
|
|
15
|
+
...bodiesUnder("agent_definitions", agentDefinitionBodySchema, pipeline.agentDefinitions),
|
|
16
|
+
...bodiesUnder("schedules", scheduleBodySchema, pipeline.schedules),
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
function bodiesUnder(fileKey, schema, definitions) {
|
|
20
|
+
return definitions.map(({ id, body }) => ({ place: `${fileKey}.${id}`, schema, body }));
|
|
21
|
+
}
|
|
22
|
+
function unknownKeysIn({ place, schema, body }) {
|
|
23
|
+
const { error } = schema.safeParse(body);
|
|
24
|
+
const issues = error?.issues ?? [];
|
|
25
|
+
return issues
|
|
26
|
+
.filter((issue) => issue.code === "unrecognized_keys")
|
|
27
|
+
.flatMap((issue) => issue.keys.map((key) => ({ path: `${place}${fieldPath(issue.path)}`, key: inFile(key) })));
|
|
28
|
+
}
|
|
29
|
+
function fieldPath(steps) {
|
|
30
|
+
return steps.map((step) => (typeof step === "number" ? `[${step}]` : `.${inFile(String(step))}`)).join("");
|
|
31
|
+
}
|
|
32
|
+
function inFile(field) {
|
|
33
|
+
return FILE_SPELLING[field] ?? field;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=unknown-keys.js.map
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
type ObjectOf = <Shape extends z.core.$ZodLooseShape>(shape: Shape) => z.ZodObject<Shape, z.core.$strip | z.core.$strict>;
|
|
3
|
+
export interface ScheduleChecks {
|
|
4
|
+
isValidCron: (expression: string) => boolean;
|
|
5
|
+
isValidTimezone: (timezone: string) => boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const itemKind: z.ZodEnum<{
|
|
8
|
+
file: "file";
|
|
9
|
+
git: "git";
|
|
10
|
+
value: "value";
|
|
11
|
+
}>;
|
|
12
|
+
export declare function definitionSchemas(object: ObjectOf, scheduleChecks?: ScheduleChecks): {
|
|
13
|
+
lineBodySchema: z.ZodObject<{
|
|
14
|
+
entry: z.ZodString;
|
|
15
|
+
exit: z.ZodString;
|
|
16
|
+
fail: z.ZodOptional<z.ZodString>;
|
|
17
|
+
start: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
on: z.ZodArray<z.ZodString>;
|
|
19
|
+
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
20
|
+
args: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
21
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
22
|
+
args: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
23
|
+
kind: z.ZodEnum<{
|
|
24
|
+
file: "file";
|
|
25
|
+
git: "git";
|
|
26
|
+
value: "value";
|
|
27
|
+
}>;
|
|
28
|
+
subject: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
30
|
+
files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
31
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
station: z.ZodOptional<z.ZodString>;
|
|
34
|
+
start: z.ZodOptional<z.ZodString>;
|
|
35
|
+
bind: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
|
+
reports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
37
|
+
on: z.ZodString;
|
|
38
|
+
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
39
|
+
outcome: z.ZodString;
|
|
40
|
+
}, z.core.$strict | z.core.$strip>>>;
|
|
41
|
+
fanout: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
over: z.ZodString;
|
|
43
|
+
to: z.ZodString;
|
|
44
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
45
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
46
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
47
|
+
from: z.ZodString;
|
|
48
|
+
to: z.ZodString;
|
|
49
|
+
on: z.ZodString;
|
|
50
|
+
iterationMax: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
unattendedMax: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
53
|
+
}, z.core.$strict | z.core.$strip>;
|
|
54
|
+
stationBodySchema: z.ZodObject<{
|
|
55
|
+
kind: z.ZodEnum<{
|
|
56
|
+
agent: "agent";
|
|
57
|
+
human: "human";
|
|
58
|
+
service: "service";
|
|
59
|
+
}>;
|
|
60
|
+
description: z.ZodOptional<z.ZodString>;
|
|
61
|
+
agentDefinition: z.ZodOptional<z.ZodString>;
|
|
62
|
+
conversation: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
continue: "continue";
|
|
64
|
+
new: "new";
|
|
65
|
+
}>>;
|
|
66
|
+
conversationKey: z.ZodOptional<z.ZodString>;
|
|
67
|
+
outcomes: z.ZodArray<z.ZodString>;
|
|
68
|
+
mustChange: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
resultRequired: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
needs: z.ZodArray<z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
kind: z.ZodEnum<{
|
|
73
|
+
file: "file";
|
|
74
|
+
git: "git";
|
|
75
|
+
value: "value";
|
|
76
|
+
}>;
|
|
77
|
+
path: z.ZodOptional<z.ZodString>;
|
|
78
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
read: "read";
|
|
80
|
+
write: "write";
|
|
81
|
+
}>>;
|
|
82
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
fresh: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
collect: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
86
|
+
produces: z.ZodArray<z.ZodObject<{
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
kind: z.ZodEnum<{
|
|
89
|
+
file: "file";
|
|
90
|
+
value: "value";
|
|
91
|
+
}>;
|
|
92
|
+
path: z.ZodOptional<z.ZodString>;
|
|
93
|
+
from: z.ZodOptional<z.ZodLiteral<"output">>;
|
|
94
|
+
}, z.core.$strict | z.core.$strip>>;
|
|
95
|
+
url: z.ZodOptional<z.ZodString>;
|
|
96
|
+
route: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strict | z.core.$strip>;
|
|
98
|
+
agentDefinitionBodySchema: z.ZodObject<{
|
|
99
|
+
settings: z.ZodObject<{
|
|
100
|
+
model: z.ZodOptional<z.ZodString>;
|
|
101
|
+
prompt: z.ZodString;
|
|
102
|
+
image: z.ZodString;
|
|
103
|
+
timeoutMinutes: z.ZodNumber;
|
|
104
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
skills_source: z.ZodOptional<z.ZodURL>;
|
|
108
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
transport: z.ZodEnum<{
|
|
111
|
+
http: "http";
|
|
112
|
+
sse: "sse";
|
|
113
|
+
stdio: "stdio";
|
|
114
|
+
}>;
|
|
115
|
+
command: z.ZodOptional<z.ZodString>;
|
|
116
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
118
|
+
headers_secret: z.ZodOptional<z.ZodString>;
|
|
119
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
ref: z.ZodString;
|
|
122
|
+
}, z.core.$strip>>>;
|
|
123
|
+
env: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
ref: z.ZodString;
|
|
126
|
+
}, z.core.$strip>>>;
|
|
127
|
+
}, z.core.$strip>>>;
|
|
128
|
+
disallowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
130
|
+
permission_mode: z.ZodOptional<z.ZodEnum<{
|
|
131
|
+
auto: "auto";
|
|
132
|
+
bypass: "bypass";
|
|
133
|
+
}>>;
|
|
134
|
+
max_turns: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
model_secret_key: z.ZodOptional<z.ZodString>;
|
|
136
|
+
pod_resources: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
requests: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
cpu: z.ZodOptional<z.ZodString>;
|
|
139
|
+
memory: z.ZodOptional<z.ZodString>;
|
|
140
|
+
"ephemeral-storage": z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$strict>>;
|
|
142
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
cpu: z.ZodOptional<z.ZodString>;
|
|
144
|
+
memory: z.ZodOptional<z.ZodString>;
|
|
145
|
+
"ephemeral-storage": z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>>;
|
|
147
|
+
}, z.core.$strict>>;
|
|
148
|
+
}, z.core.$loose>>;
|
|
149
|
+
prices: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
150
|
+
inputPerMillion: z.ZodNumber;
|
|
151
|
+
outputPerMillion: z.ZodNumber;
|
|
152
|
+
cacheReadPerMillion: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
cacheWritePerMillion: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
}, z.core.$strict | z.core.$strip>>>;
|
|
155
|
+
}, z.core.$strict | z.core.$strip>;
|
|
156
|
+
variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
157
|
+
model: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
158
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
159
|
+
image: z.ZodOptional<z.ZodString>;
|
|
160
|
+
timeoutMinutes: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
162
|
+
config: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
163
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
|
+
skills_source: z.ZodOptional<z.ZodURL>;
|
|
165
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
166
|
+
name: z.ZodString;
|
|
167
|
+
transport: z.ZodEnum<{
|
|
168
|
+
http: "http";
|
|
169
|
+
sse: "sse";
|
|
170
|
+
stdio: "stdio";
|
|
171
|
+
}>;
|
|
172
|
+
command: z.ZodOptional<z.ZodString>;
|
|
173
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
174
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
175
|
+
headers_secret: z.ZodOptional<z.ZodString>;
|
|
176
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
ref: z.ZodString;
|
|
179
|
+
}, z.core.$strip>>>;
|
|
180
|
+
env: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
ref: z.ZodString;
|
|
183
|
+
}, z.core.$strip>>>;
|
|
184
|
+
}, z.core.$strip>>>;
|
|
185
|
+
disallowed_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
186
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
187
|
+
permission_mode: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
auto: "auto";
|
|
189
|
+
bypass: "bypass";
|
|
190
|
+
}>>;
|
|
191
|
+
max_turns: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
model_secret_key: z.ZodOptional<z.ZodString>;
|
|
193
|
+
pod_resources: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
requests: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
cpu: z.ZodOptional<z.ZodString>;
|
|
196
|
+
memory: z.ZodOptional<z.ZodString>;
|
|
197
|
+
"ephemeral-storage": z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
200
|
+
cpu: z.ZodOptional<z.ZodString>;
|
|
201
|
+
memory: z.ZodOptional<z.ZodString>;
|
|
202
|
+
"ephemeral-storage": z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strict>>;
|
|
204
|
+
}, z.core.$strict>>;
|
|
205
|
+
}, z.core.$loose>>>;
|
|
206
|
+
prices: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
207
|
+
inputPerMillion: z.ZodNumber;
|
|
208
|
+
outputPerMillion: z.ZodNumber;
|
|
209
|
+
cacheReadPerMillion: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
cacheWritePerMillion: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
}, z.core.$strict | z.core.$strip>>>>;
|
|
212
|
+
}, z.core.$strict | z.core.$strip>>>;
|
|
213
|
+
}, z.core.$strict | z.core.$strip>;
|
|
214
|
+
scheduleBodySchema: z.ZodObject<{
|
|
215
|
+
cron: z.ZodString;
|
|
216
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
217
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
218
|
+
}, z.core.$strict | z.core.$strip>;
|
|
219
|
+
};
|
|
220
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// The bodies of a line, a station, an agent definition and a schedule, as the floor spells them (the pipeline file specification, website/src/content/docs/specs/pipeline-file.md). One list of keys, built twice: as the floor reads a body, dropping a key it does not know, and closed, for a lint that names that key. Pure zod, so the browser can import it.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { agentConfigSchema } from "./agent-config-schema.js";
|
|
4
|
+
const ANY_SCHEDULE = { isValidCron: () => true, isValidTimezone: () => true };
|
|
5
|
+
const whenValue = z.union([z.string(), z.number(), z.boolean()]);
|
|
6
|
+
const when = z.record(z.string(), whenValue).describe("Payload fields that must equal these values. Each is a top-level field of the event's payload, compared as text. A field the payload lacks does not match.");
|
|
7
|
+
const perMillion = z.number().nonnegative();
|
|
8
|
+
export const itemKind = z.enum(["value", "file", "git"]);
|
|
9
|
+
export function definitionSchemas(object, scheduleChecks = ANY_SCHEDULE) {
|
|
10
|
+
return {
|
|
11
|
+
lineBodySchema: lineBodyOf(object),
|
|
12
|
+
stationBodySchema: stationBodyOf(object),
|
|
13
|
+
agentDefinitionBodySchema: agentDefinitionBodyOf(object),
|
|
14
|
+
scheduleBodySchema: scheduleBodyOf(object, scheduleChecks),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function lineBodyOf(object) {
|
|
18
|
+
return object({
|
|
19
|
+
entry: z.string().describe("The node a run starts at."),
|
|
20
|
+
exit: z.string().describe("The node that ends a run as `success`."),
|
|
21
|
+
fail: z.string().describe("The node that ends a run as `failed`. With none, no node can.").optional(),
|
|
22
|
+
start: lineStartOf(object).describe("The events that start a run of this line, and how their payload fills its arguments. With none, a run starts only by `POST /assembly-lines/{id}/start`.").optional(),
|
|
23
|
+
args: z.record(z.string(), lineArgOf(object)).describe("The arguments a start gives, by name. Each becomes an item of the run's bag under that name."),
|
|
24
|
+
files: z.record(z.string(), z.string()).describe("Files put in the bag of every run at its start, by item name.").optional(),
|
|
25
|
+
nodes: z.array(lineNodeOf(object)).describe("The nodes of the line."),
|
|
26
|
+
edges: z.array(lineEdgeOf(object)).describe("Which node follows which, by outcome."),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function lineStartOf(object) {
|
|
30
|
+
return object({
|
|
31
|
+
on: z.array(z.string()).describe("Names of the events that start a run of this line. A name matches exactly."),
|
|
32
|
+
when: when.optional(),
|
|
33
|
+
args: z.record(z.string(), z.string()).describe("Argument name to a template, filled from the top-level fields of the event's payload, such as `{pr_url}`."),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function lineNodeOf(object) {
|
|
37
|
+
return object({
|
|
38
|
+
id: z.string().describe("The node's name, unique in the line."),
|
|
39
|
+
station: z.string().describe("The station this node runs. A node with no station is a marker and reports `success` at once. `name@hash` pins one version of the station.").optional(),
|
|
40
|
+
start: z.string().describe("Name of the event that opens this node in a run. Defaults to `node.<id>.start`.").optional(),
|
|
41
|
+
bind: z.record(z.string(), z.string()).describe("Need name to bag item name, for a need the bag holds under another name.").optional(),
|
|
42
|
+
reports: z.array(nodeReportOf(object)).describe("Events that answer a visit waiting at this node, in place of a report from the station's worker.").optional(),
|
|
43
|
+
fanout: object({
|
|
44
|
+
over: z.string().describe("The value this node's station produces that holds the list, a JSON array of strings."),
|
|
45
|
+
to: z.string().describe("The node that runs once for each entry of the list, with the entry as its `item` need."),
|
|
46
|
+
})
|
|
47
|
+
.describe("Runs another node once for each entry of a list this node produces. The walk goes on past that node when every branch has reported.")
|
|
48
|
+
.optional(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function nodeReportOf(object) {
|
|
52
|
+
return object({
|
|
53
|
+
on: z.string().describe("Name of the event that answers a visit waiting at this node."),
|
|
54
|
+
when: when.optional(),
|
|
55
|
+
outcome: z.string().describe("The outcome the visit reports when the event arrives."),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function lineEdgeOf(object) {
|
|
59
|
+
return object({
|
|
60
|
+
from: z.string().describe("The node the edge leaves."),
|
|
61
|
+
to: z.string().describe("The node the edge enters."),
|
|
62
|
+
on: z.string().describe("The outcome that takes this edge, or `always` for any outcome. An edge on the exact outcome wins over `always`."),
|
|
63
|
+
iterationMax: z.number().int().positive().describe("How many times one run may take this edge. A run that needs it once more halts.").optional(),
|
|
64
|
+
unattendedMax: z.number().int().positive().describe("How many times a run may take this edge without a person acting. The count starts again when a human station reports, or when a node is started by hand. A run that needs it once more halts.").optional(),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function lineArgOf(object) {
|
|
68
|
+
return object({
|
|
69
|
+
kind: itemKind.describe("The kind of item a start gives for this argument."),
|
|
70
|
+
subject: z.boolean().describe("Marks the argument whose value names what the run is about. One open run exists for a repo and a subject. A second start with the same value joins that run.").optional(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function stationBodyOf(object) {
|
|
74
|
+
return object({
|
|
75
|
+
kind: z.enum(["agent", "service", "human"]).describe("Who does the work. `agent` is a model in a pod, `service` is a worker that claims visits, `human` is a person."),
|
|
76
|
+
description: z.string().describe("What the station does, for a person reading the line. The floor does not act on it, and changing it makes no new version.").optional(),
|
|
77
|
+
agentDefinition: z.string().describe("Agent stations only. The id of the agent definition the station runs.").optional(),
|
|
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
|
+
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
|
+
outcomes: z.array(z.string()).describe("The outcomes the station reports. `failed` can be reported whether it is listed or not."),
|
|
81
|
+
mustChange: z.boolean().describe("Accepted and not acted on.").optional(),
|
|
82
|
+
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
|
+
needs: z.array(needOf(object)).describe("The bag items a visit is given."),
|
|
84
|
+
produces: z.array(produceOf(object)).describe("The bag items a visit writes."),
|
|
85
|
+
url: z.string().describe("Accepted and not acted on.").optional(),
|
|
86
|
+
route: z.string().describe("Human stations only. Kept for the page a person acts through. The floor does not read it.").optional(),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function needOf(object) {
|
|
90
|
+
return object({
|
|
91
|
+
name: z.string().describe("The need's name. The bag item of the same name fills it, unless the node's `bind` names another."),
|
|
92
|
+
kind: itemKind.describe("The kind of item the need takes."),
|
|
93
|
+
path: z.string().describe("Agent stations only. Where the item is put in the pod, relative to `/workspace`.").optional(),
|
|
94
|
+
access: z.enum(["read", "write"]).describe("`git` needs only. `write` lets the visit push to the repository. Defaults to `read`.").optional(),
|
|
95
|
+
optional: z.boolean().describe("The visit opens without the item when the bag does not hold it.").optional(),
|
|
96
|
+
fresh: z.boolean().describe("The need is filled only by an item produced since a person last acted: since a human station reported, or a node was started by hand. An older item counts as not there, so an optional need is left out and a required one refuses the visit.").optional(),
|
|
97
|
+
collect: z.string().describe("`value` needs only. The name of an item the body of a fan-out produces. The need is filled with a JSON array of what each branch produced, in branch order.").optional(),
|
|
98
|
+
}).refine((need) => !(need.fresh && need.collect), { message: "fresh is for a bag item, and takes no collect" });
|
|
99
|
+
}
|
|
100
|
+
function produceOf(object) {
|
|
101
|
+
return object({
|
|
102
|
+
name: z.string().describe("The name of the bag item the station writes."),
|
|
103
|
+
kind: z.enum(["value", "file"]).describe("The kind of item written."),
|
|
104
|
+
path: z.string().describe("Agent stations only. The file the agent writes, relative to `/workspace`.").optional(),
|
|
105
|
+
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
|
+
}).refine((produce) => !produce.from || (produce.kind === "file" && !produce.path), { message: "from: output is for a file, and takes no path" });
|
|
107
|
+
}
|
|
108
|
+
function agentDefinitionBodyOf(object) {
|
|
109
|
+
const agentSettings = agentSettingsOf(object);
|
|
110
|
+
return object({
|
|
111
|
+
settings: agentSettings.describe("The settings of the agent on every repository."),
|
|
112
|
+
variants: z.record(z.string(), agentSettings.partial()).describe("`host/owner/name` to settings laid over `settings` for runs on that repository, by field, by key of `config` and by model of `prices`.").optional(),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function agentSettingsOf(object) {
|
|
116
|
+
return object({
|
|
117
|
+
model: z.string().describe("The model the agent runs on.").optional(),
|
|
118
|
+
prompt: z.string().describe("What the agent is told. `{name}` placeholders are filled when a visit opens."),
|
|
119
|
+
image: z.string().describe("The container image the agent runs in."),
|
|
120
|
+
timeoutMinutes: z.number().int().positive().describe("How long a visit may run, in minutes. A visit past its deadline has `failed`."),
|
|
121
|
+
tags: z.array(z.string()).describe("Which cluster agents may run it. A cluster agent claims a visit only when it offers every tag.").optional(),
|
|
122
|
+
config: agentConfigSchema.describe("Settings for the agent's pod. A key the floor does not know is kept and not acted on.").optional(),
|
|
123
|
+
prices: z.record(z.string(), modelPriceOf(object)).describe("Model name to what it costs, for a model that reports tokens and no cost. The floor holds no price of its own.").optional(),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function modelPriceOf(object) {
|
|
127
|
+
return object({
|
|
128
|
+
inputPerMillion: perMillion.describe("US dollars for a million input tokens."),
|
|
129
|
+
outputPerMillion: perMillion.describe("US dollars for a million output tokens."),
|
|
130
|
+
cacheReadPerMillion: perMillion.describe("US dollars for a million tokens read from the cache. The input price when not stated.").optional(),
|
|
131
|
+
cacheWritePerMillion: perMillion.describe("US dollars for a million tokens written to the cache. The input price when not stated.").optional(),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function scheduleBodyOf(object, { isValidCron, isValidTimezone }) {
|
|
135
|
+
return object({
|
|
136
|
+
cron: z.string().refine(isValidCron, { message: "invalid cron expression" }).describe("When the schedule ticks, as a cron expression."),
|
|
137
|
+
timezone: z.string().refine(isValidTimezone, { message: "invalid timezone" }).describe("The timezone the expression is read in. Defaults to UTC.").optional(),
|
|
138
|
+
payload: z.record(z.string(), z.unknown()).describe("The payload of each `schedule.<name>.tick` event. The floor adds `scheduledFor`."),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=definition-schemas.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,13 @@ export { migrate, type Migrated, type MigrationFile } from "./migrate.js";
|
|
|
7
7
|
export type { Floor } from "./floor.js";
|
|
8
8
|
export { collectionOverlay, type CollectionFile, type CollectionOverlay, type CollectionOverlayInput, type OverlayAgent, type AgentSource, type ShippedCatalog, type Refusal } from "./collection/collection.js";
|
|
9
9
|
export { attempt, type Attempt } from "./collection/refusal.js";
|
|
10
|
+
export { lineLayoutOf, type LineFile, type LineLayout } from "./collection/line-layout.js";
|
|
11
|
+
export { withoutReplacedFiles } from "./collection/group-precedence.js";
|
|
10
12
|
export { applyCollection } from "./collection/apply.js";
|
|
11
|
-
export {
|
|
13
|
+
export { COLLECTION_SETTINGS_FILE, collectionSettingsIn, collectionSettingsOf, hostKeysIn, type CollectionSettings } from "./collection/collection-settings.js";
|
|
14
|
+
export { collectionFilesIn, lintCollectionDirectory, lintCommand, printCollectionLint, readCollectionDirectory, shippedCatalogIn, type LintCommand } from "./collection/lint-directory.js";
|
|
12
15
|
export { agentFrontmatterSchema, readAgentFile, floorSettingsOf, type ParsedAgentFile, type AgentFileSettings, type ShippedAgents, type AgentPrompts } from "./collection/agent-file.js";
|
|
13
16
|
export { placeholdersIn, withEnvironment, settingsWithEnvironment, type Environment } from "./collection/environment.js";
|
|
14
17
|
export { PIPELINE_RULES, pipelineProblems, type PipelineProblem, type PipelineRule } from "./collection/lint-rules.js";
|
|
15
|
-
export { agentFileOf, isCollectionFile, isReadPath, pipelineFolderOf } from "./collection/paths.js";
|
|
18
|
+
export { agentFileOf, isCollectionFile, isReadPath, lineFolderPathOf, pipelineFolderOf } from "./collection/paths.js";
|
|
16
19
|
export { extendedPrompt } from "./collection/agents.js";
|
package/dist/index.js
CHANGED
|
@@ -6,11 +6,14 @@ export { importPipeline } from "./import.js";
|
|
|
6
6
|
export { migrate } from "./migrate.js";
|
|
7
7
|
export { collectionOverlay } from "./collection/collection.js";
|
|
8
8
|
export { attempt } from "./collection/refusal.js";
|
|
9
|
+
export { lineLayoutOf } from "./collection/line-layout.js";
|
|
10
|
+
export { withoutReplacedFiles } from "./collection/group-precedence.js";
|
|
9
11
|
export { applyCollection } from "./collection/apply.js";
|
|
10
|
-
export {
|
|
12
|
+
export { COLLECTION_SETTINGS_FILE, collectionSettingsIn, collectionSettingsOf, hostKeysIn } from "./collection/collection-settings.js";
|
|
13
|
+
export { collectionFilesIn, lintCollectionDirectory, lintCommand, printCollectionLint, readCollectionDirectory, shippedCatalogIn } from "./collection/lint-directory.js";
|
|
11
14
|
export { agentFrontmatterSchema, readAgentFile, floorSettingsOf } from "./collection/agent-file.js";
|
|
12
15
|
export { placeholdersIn, withEnvironment, settingsWithEnvironment } from "./collection/environment.js";
|
|
13
16
|
export { PIPELINE_RULES, pipelineProblems } from "./collection/lint-rules.js";
|
|
14
|
-
export { agentFileOf, isCollectionFile, isReadPath, pipelineFolderOf } from "./collection/paths.js";
|
|
17
|
+
export { agentFileOf, isCollectionFile, isReadPath, lineFolderPathOf, pipelineFolderOf } from "./collection/paths.js";
|
|
15
18
|
export { extendedPrompt } from "./collection/agents.js";
|
|
16
19
|
//# sourceMappingURL=index.js.map
|
package/dist/shape.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const AS_THE_FLOOR_SPELLS = {
|
|
2
|
-
edge: { iteration_max: "iterationMax" },
|
|
2
|
+
edge: { iteration_max: "iterationMax", unattended_max: "unattendedMax" },
|
|
3
3
|
station: { agent_definition: "agentDefinition", conversation_key: "conversationKey", must_change: "mustChange", result_required: "resultRequired" },
|
|
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" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@re-cinq/floor-pipeline",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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": {
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"./agent-config": {
|
|
34
34
|
"types": "./dist/agent-config-schema.d.ts",
|
|
35
35
|
"default": "./dist/agent-config-schema.js"
|
|
36
|
+
},
|
|
37
|
+
"./definition-schemas": {
|
|
38
|
+
"types": "./dist/definition-schemas.d.ts",
|
|
39
|
+
"default": "./dist/definition-schemas.js"
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
"files": [
|
|
@@ -53,9 +57,9 @@
|
|
|
53
57
|
"typecheck": "tsc --noEmit"
|
|
54
58
|
},
|
|
55
59
|
"dependencies": {
|
|
56
|
-
"@re-cinq/floor-assembly-lines": "0.
|
|
57
|
-
"@re-cinq/floor-client": "0.
|
|
58
|
-
"@re-cinq/floor-contracts": "0.
|
|
60
|
+
"@re-cinq/floor-assembly-lines": "0.7.0",
|
|
61
|
+
"@re-cinq/floor-client": "0.7.0",
|
|
62
|
+
"@re-cinq/floor-contracts": "0.7.0",
|
|
59
63
|
"yaml": "^2.7.0",
|
|
60
64
|
"zod": "^4.5.4"
|
|
61
65
|
},
|