@re-cinq/floor-pipeline 0.8.0 → 0.10.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.
@@ -13,6 +13,10 @@ export declare const agentConfigSchema: z.ZodObject<{
13
13
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
14
  url: z.ZodOptional<z.ZodURL>;
15
15
  headers_secret: z.ZodOptional<z.ZodString>;
16
+ visit_token: z.ZodOptional<z.ZodObject<{
17
+ audience: z.ZodString;
18
+ scopes: z.ZodArray<z.ZodString>;
19
+ }, z.core.$strict>>;
16
20
  headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
17
21
  name: z.ZodString;
18
22
  ref: z.ZodString;
@@ -5,6 +5,12 @@ const secretRef = z.object({
5
5
  name: z.string().min(1).describe("The name of the header or environment variable."),
6
6
  ref: z.string().min(1).describe("The key in `agent-secrets`, the Kubernetes Secret in the agents' namespace, whose value it gets."),
7
7
  });
8
+ const SCOPE = /^\S+$/;
9
+ // A token the floor signs for each visit, for a server that verifies it with the floor's published keys.
10
+ const visitToken = z.strictObject({
11
+ audience: z.string().min(1).describe("Who the token is for: the name the server expects to be called by, which it checks."),
12
+ scopes: z.array(z.string().regex(SCOPE, "a scope is one word, with no space in it")).describe("What the token may do at the server, in the server's own words."),
13
+ });
8
14
  // One of the two ways to reach a server, never neither: a process the pod starts, or an address it calls.
9
15
  const mcpServer = z
10
16
  .object({
@@ -14,11 +20,18 @@ const mcpServer = z
14
20
  args: z.array(z.string()).describe("`stdio` only. The command's arguments.").optional(),
15
21
  url: z.url().describe("`http` and `sse` only, and required there. The server's address.").optional(),
16
22
  headers_secret: z.string().min(1).describe("The key in `agent-secrets`, the Kubernetes Secret in the agents' namespace, holding one whole header line, such as `Authorization: Bearer <token>`.").optional(),
23
+ visit_token: visitToken.describe("`http` and `sse` only, and never beside `headers_secret`. The floor signs a token for each visit, naming the visit, its run and its repository, for the pod to present to the server as `Authorization: Bearer <token>`. The server verifies it with the keys the floor publishes at `/.well-known/jwks.json`.").optional(),
17
24
  headers: z.array(secretRef).describe("`http` and `sse` only. Headers sent to the server, each taking its value from a key in `agent-secrets`.").optional(),
18
25
  env: z.array(secretRef).describe("`stdio` only. Environment variables of the server's process, each taking its value from a key in `agent-secrets`.").optional(),
19
26
  })
20
27
  .refine((server) => (server.transport === "stdio" ? Boolean(server.command) : Boolean(server.url)), {
21
28
  message: "a stdio server needs a command, any other a url",
29
+ })
30
+ .refine((server) => !(server.visit_token && server.headers_secret), {
31
+ message: "visit_token and headers_secret each set the server's authorization: give one",
32
+ })
33
+ .refine((server) => !(server.visit_token && server.transport === "stdio"), {
34
+ message: "visit_token is for an http or sse server",
22
35
  });
23
36
  const KUBERNETES_QUANTITY = /^\d+(\.\d+)?(m|k|M|G|T|Ki|Mi|Gi|Ti)?$/;
24
37
  const quantity = z.string().regex(KUBERNETES_QUANTITY, "a Kubernetes quantity such as 250m, 1, 512Mi or 2Gi");
@@ -116,6 +116,10 @@ export declare function definitionSchemas(object: ObjectOf, scheduleChecks?: Sch
116
116
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
117
  url: z.ZodOptional<z.ZodURL>;
118
118
  headers_secret: z.ZodOptional<z.ZodString>;
119
+ visit_token: z.ZodOptional<z.ZodObject<{
120
+ audience: z.ZodString;
121
+ scopes: z.ZodArray<z.ZodString>;
122
+ }, z.core.$strict>>;
119
123
  headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
124
  name: z.ZodString;
121
125
  ref: z.ZodString;
@@ -173,6 +177,10 @@ export declare function definitionSchemas(object: ObjectOf, scheduleChecks?: Sch
173
177
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
174
178
  url: z.ZodOptional<z.ZodURL>;
175
179
  headers_secret: z.ZodOptional<z.ZodString>;
180
+ visit_token: z.ZodOptional<z.ZodObject<{
181
+ audience: z.ZodString;
182
+ scopes: z.ZodArray<z.ZodString>;
183
+ }, z.core.$strict>>;
176
184
  headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
177
185
  name: z.ZodString;
178
186
  ref: z.ZodString;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Use the Pipeline SDK to move an [assembly line](/floor/concepts/assembly-line/) and the
3
+ * definitions it depends on between a [YAML file](/floor/specs/pipeline-file/) and Floor.
4
+ * Use the CLI to import and export files from a shell. Use the TypeScript library when your
5
+ * program needs to inspect a pipeline or act on the definitions that changed.
6
+ *
7
+ * @packageDocumentation
8
+ */
1
9
  export { pipelineFileSchema, readPipelineFile, writePipelineFile, type PipelineFile } from "./file.js";
2
10
  export { agentConfigSchema, type AgentConfig } from "./agent-config-schema.js";
3
11
  export { FILE_SPELLING, fileOf, pipelineOf, type Pipeline } from "./shape.js";
package/dist/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ // eslint-disable-next-line re-lint/max-comment-lines -- Published as the Pipeline SDK introduction.
2
+ /**
3
+ * Use the Pipeline SDK to move an [assembly line](/floor/concepts/assembly-line/) and the
4
+ * definitions it depends on between a [YAML file](/floor/specs/pipeline-file/) and Floor.
5
+ * Use the CLI to import and export files from a shell. Use the TypeScript library when your
6
+ * program needs to inspect a pipeline or act on the definitions that changed.
7
+ *
8
+ * @packageDocumentation
9
+ */
1
10
  export { pipelineFileSchema, readPipelineFile, writePipelineFile } from "./file.js";
2
11
  export { agentConfigSchema } from "./agent-config-schema.js";
3
12
  export { FILE_SPELLING, fileOf, pipelineOf } from "./shape.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@re-cinq/floor-pipeline",
3
- "version": "0.8.0",
3
+ "version": "0.10.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": {
@@ -57,9 +57,9 @@
57
57
  "typecheck": "tsc --noEmit"
58
58
  },
59
59
  "dependencies": {
60
- "@re-cinq/floor-assembly-lines": "0.8.0",
61
- "@re-cinq/floor-client": "0.8.0",
62
- "@re-cinq/floor-contracts": "0.8.0",
60
+ "@re-cinq/floor-assembly-lines": "0.10.0",
61
+ "@re-cinq/floor-client": "0.10.0",
62
+ "@re-cinq/floor-contracts": "0.10.0",
63
63
  "yaml": "^2.7.0",
64
64
  "zod": "^4.5.4"
65
65
  },