@vercel/factory 0.0.15 → 0.0.16
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/CHANGELOG.md +356 -0
- package/README.md +49 -261
- package/dist/agent-routes.d.mts +47 -3
- package/dist/agent-routes.mjs +28 -1
- package/dist/agent-routes.mjs.map +1 -1
- package/dist/api-contracts.d.mts +20 -1
- package/dist/api-contracts.mjs +2 -1
- package/dist/api-contracts.mjs.map +1 -1
- package/dist/api.d.mts +45 -2
- package/dist/api.mjs +199 -10
- package/dist/api.mjs.map +1 -1
- package/dist/approval-contracts.d.mts +6 -0
- package/dist/blob/index.d.mts +51 -14
- package/dist/blob/index.mjs +26 -10
- package/dist/blob/index.mjs.map +1 -1
- package/dist/budget.d.mts +7 -0
- package/dist/budget.mjs +6 -0
- package/dist/budget.mjs.map +1 -1
- package/dist/build-factory.d.mts +1 -0
- package/dist/change-verification/dispatch.d.mts +16 -3
- package/dist/change-verification/dispatch.mjs +45 -7
- package/dist/change-verification/dispatch.mjs.map +1 -1
- package/dist/change-verification/eve-tool.d.mts +2 -1
- package/dist/change-verification/eve-tool.mjs +35 -47
- package/dist/change-verification/eve-tool.mjs.map +1 -1
- package/dist/change-verification/result.mjs +130 -0
- package/dist/change-verification/result.mjs.map +1 -0
- package/dist/changes/eve-record-change.d.mts +2 -2
- package/dist/changes/eve-record-change.mjs +43 -9
- package/dist/changes/eve-record-change.mjs.map +1 -1
- package/dist/changes.d.mts +4 -3
- package/dist/changes.mjs +2 -2
- package/dist/changes.mjs.map +1 -1
- package/dist/client-events.d.mts +10 -3
- package/dist/client-events.mjs +6 -2
- package/dist/client-events.mjs.map +1 -1
- package/dist/client-stream.mjs +8 -2
- package/dist/client-stream.mjs.map +1 -1
- package/dist/client-transcript.mjs +5 -1
- package/dist/client-transcript.mjs.map +1 -1
- package/dist/client.d.mts +121 -12
- package/dist/client.mjs +117 -9
- package/dist/client.mjs.map +1 -1
- package/dist/code-review/contracts.d.mts +1 -0
- package/dist/code-review/eve-post-review.d.mts +4 -4
- package/dist/code-review/eve-post-review.mjs +29 -17
- package/dist/code-review/eve-post-review.mjs.map +1 -1
- package/dist/code-review/eve-review-comments.d.mts +13 -2
- package/dist/code-review/eve-review-comments.mjs +45 -11
- package/dist/code-review/eve-review-comments.mjs.map +1 -1
- package/dist/code-review/github-reporter.d.mts +2 -0
- package/dist/code-review/github-reporter.mjs +7 -5
- package/dist/code-review/github-reporter.mjs.map +1 -1
- package/dist/code-review.d.mts +3 -2
- package/dist/deepsec/eve-tool.mjs +3 -1
- package/dist/deepsec/eve-tool.mjs.map +1 -1
- package/dist/dispatch.d.mts +79 -8
- package/dist/dispatch.mjs +68 -9
- package/dist/dispatch.mjs.map +1 -1
- package/dist/eve/index.d.mts +70 -10
- package/dist/eve/index.mjs +93 -22
- package/dist/eve/index.mjs.map +1 -1
- package/dist/eve/invoke.mjs +24 -11
- package/dist/eve/invoke.mjs.map +1 -1
- package/dist/eve/session-client.d.mts +122 -4
- package/dist/eve/session-client.mjs +127 -13
- package/dist/eve/session-client.mjs.map +1 -1
- package/dist/eve/task-execution.d.mts +380 -0
- package/dist/eve/task-execution.mjs +57 -2
- package/dist/eve/task-execution.mjs.map +1 -1
- package/dist/eve/task-session.d.mts +44 -2
- package/dist/eve/task-session.mjs +44 -2
- package/dist/eve/task-session.mjs.map +1 -1
- package/dist/eve/transcript.mjs +5 -1
- package/dist/eve/transcript.mjs.map +1 -1
- package/dist/execution.d.mts +117 -9
- package/dist/execution.mjs +76 -6
- package/dist/execution.mjs.map +1 -1
- package/dist/finding-remediation/admission.d.mts +2 -0
- package/dist/finding-remediation/admission.mjs +4 -1
- package/dist/finding-remediation/admission.mjs.map +1 -1
- package/dist/findings.d.mts +1 -0
- package/dist/github-publication.d.mts +1 -0
- package/dist/github-publication.mjs +97 -84
- package/dist/github-publication.mjs.map +1 -1
- package/dist/github-transfer.d.mts +15 -6
- package/dist/github-transfer.mjs +214 -66
- package/dist/github-transfer.mjs.map +1 -1
- package/dist/github.d.mts +51 -11
- package/dist/github.mjs +126 -24
- package/dist/github.mjs.map +1 -1
- package/dist/inbox-activity.d.mts +53 -0
- package/dist/inbox-activity.mjs +41 -0
- package/dist/inbox-activity.mjs.map +1 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.mjs +3 -2
- package/dist/intake-contracts.d.mts +0 -1
- package/dist/integrations/deepsec.d.mts +1 -0
- package/dist/integrations/github.d.mts +2 -2
- package/dist/integrations/github.mjs +2 -2
- package/dist/integrations/slack.d.mts +3 -1
- package/dist/integrations/slack.mjs +3 -1
- package/dist/integrations/vercel.d.mts +4 -2
- package/dist/integrations/vercel.mjs +3 -2
- package/dist/merge-resolution/eve-tools.d.mts +1 -0
- package/dist/merge-resolution/eve-tools.mjs +7 -2
- package/dist/merge-resolution/eve-tools.mjs.map +1 -1
- package/dist/model-settings.d.mts +41 -0
- package/dist/model-settings.mjs +35 -0
- package/dist/model-settings.mjs.map +1 -0
- package/dist/planning/reconcile.mjs +6 -0
- package/dist/planning/reconcile.mjs.map +1 -1
- package/dist/postgres/index.d.mts +43 -2
- package/dist/postgres/index.mjs +40 -2
- package/dist/postgres/index.mjs.map +1 -1
- package/dist/presets/software-development/dispatch.d.mts +4 -1
- package/dist/presets/software-development/dispatch.mjs +2 -1
- package/dist/presets/software-development/dispatch.mjs.map +1 -1
- package/dist/presets/software-development/task-communication.d.mts +1 -0
- package/dist/presets/software-development/task-communication.mjs +48 -11
- package/dist/presets/software-development/task-communication.mjs.map +1 -1
- package/dist/presets/software-development.d.mts +1 -0
- package/dist/pull-requests/github-publisher.d.mts +15 -1
- package/dist/pull-requests/github-publisher.mjs +61 -1
- package/dist/pull-requests/github-publisher.mjs.map +1 -1
- package/dist/pull-requests.d.mts +1 -0
- package/dist/sandbox/index.d.mts +1 -0
- package/dist/schema/agent-route.d.mts +19 -1
- package/dist/schema/agent-route.mjs +19 -1
- package/dist/schema/agent-route.mjs.map +1 -1
- package/dist/schema/factory-config.d.mts +27 -0
- package/dist/schema/factory-config.mjs +33 -3
- package/dist/schema/factory-config.mjs.map +1 -1
- package/dist/schema/repository.d.mts +4 -0
- package/dist/schema/repository.mjs +5 -1
- package/dist/schema/repository.mjs.map +1 -1
- package/dist/schema/session.d.mts +1 -0
- package/dist/schema/session.mjs +1 -0
- package/dist/schema/session.mjs.map +1 -1
- package/dist/schema/slack-pr-notifications.d.mts +12 -0
- package/dist/schema/slack-pr-notifications.mjs +11 -0
- package/dist/schema/slack-pr-notifications.mjs.map +1 -0
- package/dist/schema/task-graph.d.mts +39 -0
- package/dist/schema/task.d.mts +1 -0
- package/dist/schema/task.mjs +2 -1
- package/dist/schema/task.mjs.map +1 -1
- package/dist/schema/transcript.d.mts +6 -0
- package/dist/schema/transcript.mjs +2 -1
- package/dist/schema/transcript.mjs.map +1 -1
- package/dist/schema/work.d.mts +52 -3
- package/dist/schema/work.mjs.map +1 -1
- package/dist/session-previews.d.mts +76 -0
- package/dist/session-previews.mjs +55 -0
- package/dist/session-previews.mjs.map +1 -0
- package/dist/session-review.d.mts +120 -0
- package/dist/session-review.mjs +79 -0
- package/dist/session-review.mjs.map +1 -0
- package/dist/signal-triage.mjs +1 -1
- package/dist/signals.d.mts +1 -0
- package/dist/stall.d.mts +4 -1
- package/dist/stall.mjs +6 -2
- package/dist/stall.mjs.map +1 -1
- package/dist/store/driver.d.mts +1 -1
- package/dist/store/driver.mjs.map +1 -1
- package/dist/store/engine.d.mts +206 -8
- package/dist/store/engine.mjs +147 -13
- package/dist/store/engine.mjs.map +1 -1
- package/dist/store/memory.d.mts +18 -1
- package/dist/store/memory.mjs +18 -1
- package/dist/store/memory.mjs.map +1 -1
- package/dist/store/slack-pr-notifications.d.mts +44 -0
- package/dist/store/slack-pr-notifications.mjs +121 -0
- package/dist/store/slack-pr-notifications.mjs.map +1 -0
- package/dist/store/task-work.d.mts +121 -6
- package/dist/store/task-work.mjs +7 -4
- package/dist/store/task-work.mjs.map +1 -1
- package/dist/sweep.d.mts +28 -6
- package/dist/sweep.mjs +34 -6
- package/dist/sweep.mjs.map +1 -1
- package/dist/task-graph-view.d.mts +3 -0
- package/dist/tasks.d.mts +3 -3
- package/dist/tasks.mjs +3 -3
- package/dist/vercel-git.d.mts +35 -3
- package/dist/vercel-git.mjs +265 -33
- package/dist/vercel-git.mjs.map +1 -1
- package/dist/vercel-github-api.d.mts +103 -0
- package/dist/vercel-github-api.mjs +363 -0
- package/dist/vercel-github-api.mjs.map +1 -0
- package/dist/vercel.d.mts +3 -2
- package/dist/vercel.mjs +3 -2
- package/dist/vercel.mjs.map +1 -1
- package/dist/work-triage.d.mts +1 -0
- package/dist/workflows.d.mts +102 -4
- package/dist/workflows.mjs +55 -2
- package/dist/workflows.mjs.map +1 -1
- package/dist/workspace-files-git.d.mts +15 -0
- package/dist/workspace-files-git.mjs +61 -0
- package/dist/workspace-files-git.mjs.map +1 -0
- package/dist/workspace-files.d.mts +107 -0
- package/dist/workspace-files.mjs +74 -0
- package/dist/workspace-files.mjs.map +1 -0
- package/docs/getting-started.md +104 -0
- package/docs/index.md +100 -0
- package/docs/recipes/cancellation.md +215 -0
- package/docs/recipes/custom-workflow.md +153 -0
- package/docs/recipes/dependent-tasks.md +207 -0
- package/docs/recipes/eve-agent.md +277 -0
- package/docs/recipes/human-input.md +204 -0
- package/docs/recipes/persistence-recovery.md +268 -0
- package/docs/recipes/retry-recovery.md +241 -0
- package/docs/recipes/task-messaging.md +215 -0
- package/docs/recipes/typed-eve-result.md +161 -0
- package/docs/runtime-integration.md +137 -0
- package/package.json +17 -6
|
@@ -14,7 +14,16 @@ declare const githubConnectorSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
14
14
|
}, z.core.$strict>>;
|
|
15
15
|
declare const slackConnectorSchema: z.ZodReadonly<z.ZodObject<{
|
|
16
16
|
connector: z.ZodString;
|
|
17
|
+
operatorDirectMessages: z.ZodDefault<z.ZodBoolean>;
|
|
17
18
|
approvalChannel: z.ZodOptional<z.ZodString>;
|
|
19
|
+
autonomousPullRequests: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
20
|
+
channelId: z.ZodString;
|
|
21
|
+
mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
22
|
+
}, z.core.$strict>>>;
|
|
23
|
+
autonomousPullRequestsByRepository: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>, z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
24
|
+
channelId: z.ZodString;
|
|
25
|
+
mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
26
|
+
}, z.core.$strict>>>>>>;
|
|
18
27
|
}, z.core.$strict>>;
|
|
19
28
|
/** Validates stall detection and replacement-attempt limits for running Tasks. */
|
|
20
29
|
declare const executionPolicySchema: z.ZodReadonly<z.ZodObject<{
|
|
@@ -39,7 +48,16 @@ declare const factoryConfigSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
39
48
|
}, z.core.$strict>>>>;
|
|
40
49
|
slack: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
41
50
|
connector: z.ZodString;
|
|
51
|
+
operatorDirectMessages: z.ZodDefault<z.ZodBoolean>;
|
|
42
52
|
approvalChannel: z.ZodOptional<z.ZodString>;
|
|
53
|
+
autonomousPullRequests: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
54
|
+
channelId: z.ZodString;
|
|
55
|
+
mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
56
|
+
}, z.core.$strict>>>;
|
|
57
|
+
autonomousPullRequestsByRepository: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>, z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
58
|
+
channelId: z.ZodString;
|
|
59
|
+
mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
60
|
+
}, z.core.$strict>>>>>>;
|
|
43
61
|
}, z.core.$strict>>>>>;
|
|
44
62
|
}, z.core.$strict>>>;
|
|
45
63
|
repositories: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
@@ -48,6 +66,14 @@ declare const factoryConfigSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
48
66
|
dependsOn: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>>>>;
|
|
49
67
|
}, z.core.$strict>>>>;
|
|
50
68
|
operators: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
69
|
+
sandboxGitHubCredentials: z.ZodDefault<z.ZodEnum<{
|
|
70
|
+
connect: "connect";
|
|
71
|
+
vercel: "vercel";
|
|
72
|
+
}>>;
|
|
73
|
+
commitIdentity: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
email: z.ZodString;
|
|
76
|
+
}, z.core.$strict>>>;
|
|
51
77
|
approval: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
52
78
|
source: z.ZodOptional<z.ZodString>;
|
|
53
79
|
kind: z.ZodOptional<z.ZodString>;
|
|
@@ -61,6 +87,7 @@ declare const factoryConfigSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
61
87
|
warningPercent: z.ZodNumber;
|
|
62
88
|
perRepositoryUsd: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>, z.ZodNumber>>>;
|
|
63
89
|
}, z.core.$strict>>>;
|
|
90
|
+
enforceBudget: z.ZodDefault<z.ZodBoolean>;
|
|
64
91
|
execution: z.ZodDefault<z.ZodReadonly<z.ZodObject<{
|
|
65
92
|
maxAttempts: z.ZodNumber;
|
|
66
93
|
stallMinutes: z.ZodNumber;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { repositorySlugSchema } from "./repository.mjs";
|
|
2
2
|
import { budgetLimitsSchema } from "./budget.mjs";
|
|
3
|
-
import { allowByDefaultApprovalPolicy, approvalPolicySchema } from "../approval.mjs";
|
|
4
3
|
import { taskKindSchema } from "./task.mjs";
|
|
4
|
+
import { allowByDefaultApprovalPolicy, approvalPolicySchema } from "../approval.mjs";
|
|
5
|
+
import { slackPrNotificationsSchema } from "./slack-pr-notifications.mjs";
|
|
5
6
|
import { z } from "zod";
|
|
6
7
|
//#region src/schema/factory-config.ts
|
|
7
8
|
/** Validates one repository allowlist entry and its configured dependency ordering. */
|
|
@@ -16,7 +17,17 @@ const githubConnectorSchema = z.strictObject({
|
|
|
16
17
|
}).readonly();
|
|
17
18
|
const slackConnectorSchema = z.strictObject({
|
|
18
19
|
connector: z.string().regex(/^slack\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/).describe("Vercel Connect UID installed for this Slack app."),
|
|
19
|
-
|
|
20
|
+
operatorDirectMessages: z.boolean().default(false).describe("Opt in to operator DMs for human-action requests, digests, and budget alerts. Independent of operator authorization, PR announcements, and replies in the original conversation."),
|
|
21
|
+
approvalChannel: z.string().regex(/^[CDG][A-Z0-9]+$/u).optional().describe("Explicit Slack channel for approval proposals that have no originating Slack thread. Absent disables cross-channel approval notifications."),
|
|
22
|
+
autonomousPullRequests: slackPrNotificationsSchema.optional().describe("Channel announcements for every Factory-produced PR, including human-requested work, in addition to the original conversation reply. Saved Slack settings override this default; resetting restores it. Absent disables announcements unless Slack enables them."),
|
|
23
|
+
autonomousPullRequestsByRepository: z.record(repositorySlugSchema, slackPrNotificationsSchema.nullable()).readonly().optional().describe("Repository-specific PR destinations, taking precedence over the factory-wide default. Null disables announcements for that repository. Saved repository settings override these entries.")
|
|
24
|
+
}).readonly();
|
|
25
|
+
function isSupportedCommitIdentityValue(value, maxBytes) {
|
|
26
|
+
return value.trim() === value && !/[\0\r\n<>]/u.test(value) && new TextEncoder().encode(value).byteLength <= maxBytes;
|
|
27
|
+
}
|
|
28
|
+
const commitIdentitySchema = z.strictObject({
|
|
29
|
+
name: z.string().min(1).refine((value) => isSupportedCommitIdentityValue(value, 256)).describe("Name recorded on Factory-authored commits."),
|
|
30
|
+
email: z.string().email().refine((value) => isSupportedCommitIdentityValue(value, 320)).describe("Email recorded on Factory-authored commits.")
|
|
20
31
|
}).readonly();
|
|
21
32
|
/** Validates stall detection and replacement-attempt limits for running Tasks. */
|
|
22
33
|
const executionPolicySchema = z.strictObject({
|
|
@@ -41,14 +52,33 @@ const factoryConfigSchema = z.strictObject({
|
|
|
41
52
|
}).describe("Provider connections available to this factory."),
|
|
42
53
|
repositories: z.array(factoryConfigRepositorySchema).min(1).readonly().describe("Repositories this factory is allowed to inspect and change."),
|
|
43
54
|
operators: z.array(z.string().min(1)).min(1).readonly().describe("Provider-qualified identities allowed to operate this factory."),
|
|
55
|
+
sandboxGitHubCredentials: z.enum(["connect", "vercel"]).default("connect").describe("Credential source selected for trusted GitHub Sandbox operations."),
|
|
56
|
+
commitIdentity: commitIdentitySchema.default({
|
|
57
|
+
name: "Vercel Factory",
|
|
58
|
+
email: "not+real@example.org"
|
|
59
|
+
}).describe("Replaceable attribution metadata for Factory-authored commits."),
|
|
44
60
|
approval: approvalPolicySchema.default(allowByDefaultApprovalPolicy).describe("Which Tasks wait for a human before they run. First match wins."),
|
|
45
61
|
budget: budgetLimitsSchema.default({
|
|
46
62
|
totalUsd: 500,
|
|
47
63
|
investigationUsd: 100,
|
|
48
64
|
perTaskReservationUsd: 5,
|
|
49
65
|
warningPercent: 80
|
|
50
|
-
}).describe("Monthly
|
|
66
|
+
}).describe("Monthly spending thresholds and per-task accounting reservations."),
|
|
67
|
+
enforceBudget: z.boolean().default(true).describe("Refuse new work above the monthly budget. False keeps cost accounting without spending limits or budget alerts."),
|
|
51
68
|
execution: executionPolicySchema.default(defaultExecutionPolicy).describe("Stall detection and retry limits for running tasks.")
|
|
69
|
+
}).superRefine((config, ctx) => {
|
|
70
|
+
const repositories = new Set(config.repositories.map(({ slug }) => slug));
|
|
71
|
+
for (const [index, connector] of config.connectors.slack.entries()) for (const slug of Object.keys(connector.autonomousPullRequestsByRepository ?? {})) if (!repositories.has(slug)) ctx.addIssue({
|
|
72
|
+
code: "custom",
|
|
73
|
+
path: [
|
|
74
|
+
"connectors",
|
|
75
|
+
"slack",
|
|
76
|
+
index,
|
|
77
|
+
"autonomousPullRequestsByRepository",
|
|
78
|
+
slug
|
|
79
|
+
],
|
|
80
|
+
message: "PR notification destinations must name a configured repository."
|
|
81
|
+
});
|
|
52
82
|
}).readonly();
|
|
53
83
|
/** Validates a Factory configuration and applies its declared defaults. */
|
|
54
84
|
function defineFactory(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory-config.mjs","names":[],"sources":["../../src/schema/factory-config.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { allowByDefaultApprovalPolicy, approvalPolicySchema } from \"../approval\";\nimport { budgetLimitsSchema } from \"./budget\";\nimport { repositorySlugSchema, type RepositorySlug } from \"./repository\";\nimport { taskKindSchema } from \"./task\";\n\n/** Validates one repository allowlist entry and its configured dependency ordering. */\nexport const factoryConfigRepositorySchema = z\n .strictObject({\n slug: repositorySlugSchema.describe(\"Repository this factory may work on.\"),\n defaultBranch: z\n .string()\n .min(1)\n .default(\"main\")\n .describe(\"Branch changes land on, usually main.\"),\n dependsOn: z\n .array(repositorySlugSchema)\n .readonly()\n .default([])\n .describe(\"Repositories that must land changes before this repository.\"),\n })\n .readonly();\n\nconst githubConnectorSchema = z\n .strictObject({\n owner: z\n .string()\n .regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"GitHub user or organization that owns this connector installation.\"),\n connector: z\n .string()\n .regex(/^github\\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"Vercel Connect UID installed for this GitHub owner.\"),\n })\n .readonly();\n\nconst slackConnectorSchema = z\n .strictObject({\n connector: z\n .string()\n .regex(/^slack\\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"Vercel Connect UID installed for this Slack app.\"),\n approvalChannel: z\n .string()\n .regex(/^[CDG][A-Z0-9]+$/u)\n .optional()\n .describe(\n \"Explicit Slack channel for approval proposals that have no originating Slack thread. Absent disables cross-channel approval notifications.\",\n ),\n })\n .readonly();\n\n/** Validates stall detection and replacement-attempt limits for running Tasks. */\nexport const executionPolicySchema = z\n .strictObject({\n maxAttempts: z\n .number()\n .int()\n .min(1)\n .describe(\"Attempts a task may consume before a stall fails it for good.\"),\n stallMinutes: z\n .number()\n .int()\n .min(1)\n .describe(\"Minutes without progress before a running task is marked stalled.\"),\n stallMinutesByKind: z\n .partialRecord(taskKindSchema, z.number().int().min(1))\n .readonly()\n .default({})\n .describe(\"Per-kind stall windows for long single-step work, e.g. security_scan: 300.\"),\n })\n .readonly();\n\n/** Stall detection and retry limits applied to running Tasks. */\nexport type ExecutionPolicy = z.infer<typeof executionPolicySchema>;\n\n/** Conservative default stall window and three-attempt execution policy. */\nexport const defaultExecutionPolicy = executionPolicySchema.parse({\n maxAttempts: 3,\n stallMinutes: 45,\n stallMinutesByKind: {},\n});\n\n/** Validates the repositories, operators, connectors, budget, and policies of a Factory. */\nexport const factoryConfigSchema = z\n .strictObject({\n connectors: z\n .strictObject({\n github: z\n .array(githubConnectorSchema)\n .readonly()\n .refine(\n (connectors) =>\n new Set(connectors.map(({ owner }) => owner)).size === connectors.length,\n \"GitHub connector owners must be unique.\",\n ),\n slack: z\n .array(slackConnectorSchema)\n .max(1, \"A factory may configure one Slack connector.\")\n .readonly()\n .default([]),\n })\n .readonly()\n .default({ github: [], slack: [] })\n .describe(\"Provider connections available to this factory.\"),\n repositories: z\n .array(factoryConfigRepositorySchema)\n .min(1)\n .readonly()\n .describe(\"Repositories this factory is allowed to inspect and change.\"),\n operators: z\n .array(z.string().min(1))\n .min(1)\n .readonly()\n .describe(\"Provider-qualified identities allowed to operate this factory.\"),\n approval: approvalPolicySchema\n .default(allowByDefaultApprovalPolicy)\n .describe(\"Which Tasks wait for a human before they run. First match wins.\"),\n budget: budgetLimitsSchema\n .default({\n totalUsd: 500,\n investigationUsd: 100,\n perTaskReservationUsd: 5,\n warningPercent: 80,\n })\n .describe(\"Monthly spend limits. One non-disableable budget per factory per month.\"),\n execution: executionPolicySchema\n .default(defaultExecutionPolicy)\n .describe(\"Stall detection and retry limits for running tasks.\"),\n })\n .readonly();\n\n/** Fully resolved repository allowlist entry in a Factory configuration. */\nexport type FactoryConfigRepository = z.infer<typeof factoryConfigRepositorySchema>;\n\n/** Fully resolved and validated Factory configuration. */\nexport type FactoryConfig = z.infer<typeof factoryConfigSchema>;\ntype FactoryConfigSchemaInput = z.input<typeof factoryConfigSchema>;\ntype FactoryConfigConnectorsInput = Readonly<{\n github: readonly Readonly<z.input<typeof githubConnectorSchema>>[];\n slack?: readonly Readonly<z.input<typeof slackConnectorSchema>>[];\n}>;\n/** Repository allowlist entry accepted when defining a Factory, before defaults are applied. */\nexport type FactoryConfigRepositoryInput = Readonly<{\n slug: RepositorySlug;\n defaultBranch?: string;\n dependsOn?: readonly RepositorySlug[];\n}>;\n/** Caller input accepted when defining a Factory, before schema defaults are applied. */\nexport type FactoryConfigInput = Readonly<\n Omit<FactoryConfigSchemaInput, \"connectors\" | \"repositories\" | \"operators\"> & {\n connectors?: FactoryConfigConnectorsInput;\n repositories: readonly FactoryConfigRepositoryInput[];\n operators: readonly string[];\n }\n>;\n\n/** Validates a Factory configuration and applies its declared defaults. */\nexport function defineFactory(config: FactoryConfigInput): FactoryConfig {\n return factoryConfigSchema.parse(config);\n}\n"],"mappings":";;;;;;;AAOA,MAAa,gCAAgC,EAC1C,aAAa;CACZ,MAAM,qBAAqB,SAAS,sCAAsC;CAC1E,eAAe,EACZ,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,QAAQ,MAAM,CAAC,CACf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AI,IAAI,WAAW,KAAK,EAAE,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,WAAW,QACpE,yCACF;EACF,OAAO,EACJ,MAAM,oBAAoB,CAAC,CAC3B,IAAI,GAAG,8CAA8C,CAAC,CACtD,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC;CACf,CAAC,CAAC,CACD,SAAS,CAAC,CACV,QAAQ;EAAE,QAAQ,CAAC;EAAG,OAAO,CAAC;CAAE,CAAC,CAAC,CAClC,SAAS,iDAAiD;CAC7D,cAAc,EACX,MAAM,6BAA6B,CAAC,CACpC,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,6DAA6D;CACzE,WAAW,EACR,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,IAAI,CAAC,CAAC,CACN,SAAS,CAAC,CACV,SAAS,gEAAgE;CAC5E,UAAU,qBACP,QAAQ,4BAA4B,CAAC,CACrC,SAAS,iEAAiE;CAC7E,QAAQ,mBACL,QAAQ;EACP,UAAU;EACV,kBAAkB;EAClB,uBAAuB;EACvB,gBAAgB;CAClB,CAAC,CAAC,CACD,SAAS,yEAAyE;CACrF,WAAW,sBACR,QAAQ,sBAAsB,CAAC,CAC/B,SAAS,qDAAqD;AACnE,CAAC,CAAC,CACD,SAAS;;AA4BZ,SAAgB,cAAc,QAA2C;CACvE,OAAO,oBAAoB,MAAM,MAAM;AACzC"}
|
|
1
|
+
{"version":3,"file":"factory-config.mjs","names":[],"sources":["../../src/schema/factory-config.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { allowByDefaultApprovalPolicy, approvalPolicySchema } from \"../approval\";\nimport { budgetLimitsSchema } from \"./budget\";\nimport { repositorySlugSchema, type RepositorySlug } from \"./repository\";\nimport { taskKindSchema } from \"./task\";\nimport { slackPrNotificationsSchema } from \"./slack-pr-notifications\";\n\n/** Validates one repository allowlist entry and its configured dependency ordering. */\nexport const factoryConfigRepositorySchema = z\n .strictObject({\n slug: repositorySlugSchema.describe(\"Repository this factory may work on.\"),\n defaultBranch: z\n .string()\n .min(1)\n .default(\"main\")\n .describe(\"Branch changes land on, usually main.\"),\n dependsOn: z\n .array(repositorySlugSchema)\n .readonly()\n .default([])\n .describe(\"Repositories that must land changes before this repository.\"),\n })\n .readonly();\n\nconst githubConnectorSchema = z\n .strictObject({\n owner: z\n .string()\n .regex(/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"GitHub user or organization that owns this connector installation.\"),\n connector: z\n .string()\n .regex(/^github\\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"Vercel Connect UID installed for this GitHub owner.\"),\n })\n .readonly();\n\nconst slackConnectorSchema = z\n .strictObject({\n connector: z\n .string()\n .regex(/^slack\\/[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/)\n .describe(\"Vercel Connect UID installed for this Slack app.\"),\n operatorDirectMessages: z\n .boolean()\n .default(false)\n .describe(\n \"Opt in to operator DMs for human-action requests, digests, and budget alerts. Independent of operator authorization, PR announcements, and replies in the original conversation.\",\n ),\n approvalChannel: z\n .string()\n .regex(/^[CDG][A-Z0-9]+$/u)\n .optional()\n .describe(\n \"Explicit Slack channel for approval proposals that have no originating Slack thread. Absent disables cross-channel approval notifications.\",\n ),\n autonomousPullRequests: slackPrNotificationsSchema\n .optional()\n .describe(\n \"Channel announcements for every Factory-produced PR, including human-requested work, in addition to the original conversation reply. Saved Slack settings override this default; resetting restores it. Absent disables announcements unless Slack enables them.\",\n ),\n autonomousPullRequestsByRepository: z\n .record(repositorySlugSchema, slackPrNotificationsSchema.nullable())\n .readonly()\n .optional()\n .describe(\n \"Repository-specific PR destinations, taking precedence over the factory-wide default. Null disables announcements for that repository. Saved repository settings override these entries.\",\n ),\n })\n .readonly();\n\nfunction isSupportedCommitIdentityValue(value: string, maxBytes: number): boolean {\n return (\n value.trim() === value &&\n !/[\\0\\r\\n<>]/u.test(value) &&\n new TextEncoder().encode(value).byteLength <= maxBytes\n );\n}\n\nconst commitIdentitySchema = z\n .strictObject({\n name: z\n .string()\n .min(1)\n .refine((value) => isSupportedCommitIdentityValue(value, 256))\n .describe(\"Name recorded on Factory-authored commits.\"),\n email: z\n .string()\n .email()\n .refine((value) => isSupportedCommitIdentityValue(value, 320))\n .describe(\"Email recorded on Factory-authored commits.\"),\n })\n .readonly();\n\n/** Validates stall detection and replacement-attempt limits for running Tasks. */\nexport const executionPolicySchema = z\n .strictObject({\n maxAttempts: z\n .number()\n .int()\n .min(1)\n .describe(\"Attempts a task may consume before a stall fails it for good.\"),\n stallMinutes: z\n .number()\n .int()\n .min(1)\n .describe(\"Minutes without progress before a running task is marked stalled.\"),\n stallMinutesByKind: z\n .partialRecord(taskKindSchema, z.number().int().min(1))\n .readonly()\n .default({})\n .describe(\"Per-kind stall windows for long single-step work, e.g. security_scan: 300.\"),\n })\n .readonly();\n\n/** Stall detection and retry limits applied to running Tasks. */\nexport type ExecutionPolicy = z.infer<typeof executionPolicySchema>;\n\n/** Conservative default stall window and three-attempt execution policy. */\nexport const defaultExecutionPolicy = executionPolicySchema.parse({\n maxAttempts: 3,\n stallMinutes: 45,\n stallMinutesByKind: {},\n});\n\n/** Validates the repositories, operators, connectors, budget, and policies of a Factory. */\nexport const factoryConfigSchema = z\n .strictObject({\n connectors: z\n .strictObject({\n github: z\n .array(githubConnectorSchema)\n .readonly()\n .refine(\n (connectors) =>\n new Set(connectors.map(({ owner }) => owner)).size === connectors.length,\n \"GitHub connector owners must be unique.\",\n ),\n slack: z\n .array(slackConnectorSchema)\n .max(1, \"A factory may configure one Slack connector.\")\n .readonly()\n .default([]),\n })\n .readonly()\n .default({ github: [], slack: [] })\n .describe(\"Provider connections available to this factory.\"),\n repositories: z\n .array(factoryConfigRepositorySchema)\n .min(1)\n .readonly()\n .describe(\"Repositories this factory is allowed to inspect and change.\"),\n operators: z\n .array(z.string().min(1))\n .min(1)\n .readonly()\n .describe(\"Provider-qualified identities allowed to operate this factory.\"),\n sandboxGitHubCredentials: z\n .enum([\"connect\", \"vercel\"])\n .default(\"connect\")\n .describe(\"Credential source selected for trusted GitHub Sandbox operations.\"),\n commitIdentity: commitIdentitySchema\n .default({ name: \"Vercel Factory\", email: \"not+real@example.org\" })\n .describe(\"Replaceable attribution metadata for Factory-authored commits.\"),\n approval: approvalPolicySchema\n .default(allowByDefaultApprovalPolicy)\n .describe(\"Which Tasks wait for a human before they run. First match wins.\"),\n budget: budgetLimitsSchema\n .default({\n totalUsd: 500,\n investigationUsd: 100,\n perTaskReservationUsd: 5,\n warningPercent: 80,\n })\n .describe(\"Monthly spending thresholds and per-task accounting reservations.\"),\n enforceBudget: z\n .boolean()\n .default(true)\n .describe(\n \"Refuse new work above the monthly budget. False keeps cost accounting without spending limits or budget alerts.\",\n ),\n execution: executionPolicySchema\n .default(defaultExecutionPolicy)\n .describe(\"Stall detection and retry limits for running tasks.\"),\n })\n .superRefine((config, ctx) => {\n const repositories = new Set<string>(config.repositories.map(({ slug }) => slug));\n for (const [index, connector] of config.connectors.slack.entries()) {\n for (const slug of Object.keys(connector.autonomousPullRequestsByRepository ?? {})) {\n if (!repositories.has(slug))\n ctx.addIssue({\n code: \"custom\",\n path: [\"connectors\", \"slack\", index, \"autonomousPullRequestsByRepository\", slug],\n message: \"PR notification destinations must name a configured repository.\",\n });\n }\n }\n })\n .readonly();\n\n/** Fully resolved repository allowlist entry in a Factory configuration. */\nexport type FactoryConfigRepository = z.infer<typeof factoryConfigRepositorySchema>;\n\n/** Fully resolved and validated Factory configuration. */\nexport type FactoryConfig = z.infer<typeof factoryConfigSchema>;\ntype FactoryConfigSchemaInput = z.input<typeof factoryConfigSchema>;\ntype FactoryConfigConnectorsInput = Readonly<{\n github: readonly Readonly<z.input<typeof githubConnectorSchema>>[];\n slack?: readonly Readonly<z.input<typeof slackConnectorSchema>>[];\n}>;\n/** Repository allowlist entry accepted when defining a Factory, before defaults are applied. */\nexport type FactoryConfigRepositoryInput = Readonly<{\n slug: RepositorySlug;\n defaultBranch?: string;\n dependsOn?: readonly RepositorySlug[];\n}>;\n/** Caller input accepted when defining a Factory, before schema defaults are applied. */\nexport type FactoryConfigInput = Readonly<\n Omit<FactoryConfigSchemaInput, \"connectors\" | \"repositories\" | \"operators\"> & {\n connectors?: FactoryConfigConnectorsInput;\n repositories: readonly FactoryConfigRepositoryInput[];\n operators: readonly string[];\n }\n>;\n\n/** Validates a Factory configuration and applies its declared defaults. */\nexport function defineFactory(config: FactoryConfigInput): FactoryConfig {\n return factoryConfigSchema.parse(config);\n}\n"],"mappings":";;;;;;;;AAQA,MAAa,gCAAgC,EAC1C,aAAa;CACZ,MAAM,qBAAqB,SAAS,sCAAsC;CAC1E,eAAe,EACZ,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,QAAQ,MAAM,CAAC,CACf,SAAS,uCAAuC;CACnD,WAAW,EACR,MAAM,oBAAoB,CAAC,CAC3B,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,6DAA6D;AAC3E,CAAC,CAAC,CACD,SAAS;AAEZ,MAAM,wBAAwB,EAC3B,aAAa;CACZ,OAAO,EACJ,OAAO,CAAC,CACR,MAAM,mCAAmC,CAAC,CAC1C,SAAS,oEAAoE;CAChF,WAAW,EACR,OAAO,CAAC,CACR,MAAM,2CAA2C,CAAC,CAClD,SAAS,qDAAqD;AACnE,CAAC,CAAC,CACD,SAAS;AAEZ,MAAM,uBAAuB,EAC1B,aAAa;CACZ,WAAW,EACR,OAAO,CAAC,CACR,MAAM,0CAA0C,CAAC,CACjD,SAAS,kDAAkD;CAC9D,wBAAwB,EACrB,QAAQ,CAAC,CACT,QAAQ,KAAK,CAAC,CACd,SACC,kLACF;CACF,iBAAiB,EACd,OAAO,CAAC,CACR,MAAM,mBAAmB,CAAC,CAC1B,SAAS,CAAC,CACV,SACC,4IACF;CACF,wBAAwB,2BACrB,SAAS,CAAC,CACV,SACC,kQACF;CACF,oCAAoC,EACjC,OAAO,sBAAsB,2BAA2B,S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,KAAK,UAAU,sCAAsC,CAAC,CAAC,GAC/E,IAAI,CAAC,aAAa,IAAI,IAAI,GACxB,IAAI,SAAS;EACX,MAAM;EACN,MAAM;GAAC;GAAc;GAAS;GAAO;GAAsC;EAAI;EAC/E,SAAS;CACX,CAAC;AAGT,CAAC,CAAC,CACD,SAAS;;AA4BZ,SAAgB,cAAc,QAA2C;CACvE,OAAO,oBAAoB,MAAM,MAAM;AACzC"}
|
|
@@ -18,6 +18,10 @@ declare const repositorySchema: z.ZodReadonly<z.ZodObject<{
|
|
|
18
18
|
snapshot: z.ZodOptional<z.ZodString>;
|
|
19
19
|
}, z.core.$strict>>>;
|
|
20
20
|
connectedAt: z.ZodISODateTime;
|
|
21
|
+
modelDefaults: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
revision: z.ZodNumber;
|
|
23
|
+
agents: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
21
25
|
}, z.core.$strict>>;
|
|
22
26
|
/** Persisted identity and status of a repository admitted by Factory configuration. */
|
|
23
27
|
type Repository = z.infer<typeof repositorySchema>;
|
|
@@ -17,7 +17,11 @@ const repositorySchema = z.strictObject({
|
|
|
17
17
|
teamId: z.string().min(1),
|
|
18
18
|
snapshot: z.string().min(1).optional().describe("Prebuilt snapshot to boot from.")
|
|
19
19
|
}).readonly().optional().describe("Devbox execution config. Absent when this repository never uses devboxes."),
|
|
20
|
-
connectedAt: isoDateTimeSchema
|
|
20
|
+
connectedAt: isoDateTimeSchema,
|
|
21
|
+
modelDefaults: z.strictObject({
|
|
22
|
+
revision: z.number().int().nonnegative().describe("Revision of saved model preferences."),
|
|
23
|
+
agents: z.record(z.string().regex(/^[a-z][a-z0-9-]{0,31}$/u), z.string().trim().min(1).max(200)).describe("Opaque model overrides by application agent.")
|
|
24
|
+
}).optional().describe("Saved repository model preferences; absent inherits application defaults.")
|
|
21
25
|
}).readonly();
|
|
22
26
|
//#endregion
|
|
23
27
|
export { repositorySchema, repositorySlugSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.mjs","names":[],"sources":["../../src/schema/repository.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema } from \"./common\";\nimport { repositoryIdSchema } from \"./id\";\n\n/** Canonical lowercase `owner/name` repository slug. */\nexport type RepositorySlug = `${string}/${string}`;\n\n/** Validates the canonical lowercase `owner/name` form used for repository scope. */\nexport const repositorySlugSchema = z\n .string()\n .regex(\n /^[a-z0-9]([a-z0-9-]*[a-z0-9])?\\/(?!\\.{1,2}$|\\.git$)[a-z0-9._-]+$/u,\n \"Expected a canonical lowercase owner/name repository slug\",\n )\n .describe(\n \"owner/name, lowercase, e.g. acme/web. Repository names cannot be '.', '..', or '.git'.\",\n ) as z.ZodType<RepositorySlug, string>;\n\n/** Validates the persisted identity and enabled state of a configured repository. */\nexport const repositorySchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n id: repositoryIdSchema,\n slug: repositorySlugSchema,\n defaultBranch: z.string().min(1).describe(\"Branch changes land on, usually main.\"),\n enabled: z.boolean().describe(\"Whether the factory may work on this repository.\"),\n dependsOn: z\n .array(repositorySlugSchema)\n .readonly()\n .describe(\"Slugs of repositories this one consumes, for multi-repo work ordering.\"),\n devbox: z\n .strictObject({\n projectId: z.string().min(1),\n teamId: z.string().min(1),\n snapshot: z.string().min(1).optional().describe(\"Prebuilt snapshot to boot from.\"),\n })\n .readonly()\n .optional()\n .describe(\"Devbox execution config. Absent when this repository never uses devboxes.\"),\n connectedAt: isoDateTimeSchema,\n })\n .readonly();\n\n/** Persisted identity and status of a repository admitted by Factory configuration. */\nexport type Repository = z.infer<typeof repositorySchema>;\n"],"mappings":";;;;;AAQA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MACC,qEACA,2DACF,CAAC,CACA,SACC,wFACF;;AAGF,MAAa,mBAAmB,EAC7B,aAAa;CACZ,eAAe;CACf,IAAI;CACJ,MAAM;CACN,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,uCAAuC;CACjF,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,kDAAkD;CAChF,WAAW,EACR,MAAM,oBAAoB,CAAC,CAC3B,SAAS,CAAC,CACV,SAAS,wEAAwE;CACpF,QAAQ,EACL,aAAa;EACZ,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EAC3B,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EACxB,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;CACnF,CAAC,CAAC,CACD,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,2EAA2E;CACvF,aAAa;
|
|
1
|
+
{"version":3,"file":"repository.mjs","names":[],"sources":["../../src/schema/repository.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isoDateTimeSchema, schemaVersionSchema } from \"./common\";\nimport { repositoryIdSchema } from \"./id\";\n\n/** Canonical lowercase `owner/name` repository slug. */\nexport type RepositorySlug = `${string}/${string}`;\n\n/** Validates the canonical lowercase `owner/name` form used for repository scope. */\nexport const repositorySlugSchema = z\n .string()\n .regex(\n /^[a-z0-9]([a-z0-9-]*[a-z0-9])?\\/(?!\\.{1,2}$|\\.git$)[a-z0-9._-]+$/u,\n \"Expected a canonical lowercase owner/name repository slug\",\n )\n .describe(\n \"owner/name, lowercase, e.g. acme/web. Repository names cannot be '.', '..', or '.git'.\",\n ) as z.ZodType<RepositorySlug, string>;\n\n/** Validates the persisted identity and enabled state of a configured repository. */\nexport const repositorySchema = z\n .strictObject({\n schemaVersion: schemaVersionSchema,\n id: repositoryIdSchema,\n slug: repositorySlugSchema,\n defaultBranch: z.string().min(1).describe(\"Branch changes land on, usually main.\"),\n enabled: z.boolean().describe(\"Whether the factory may work on this repository.\"),\n dependsOn: z\n .array(repositorySlugSchema)\n .readonly()\n .describe(\"Slugs of repositories this one consumes, for multi-repo work ordering.\"),\n devbox: z\n .strictObject({\n projectId: z.string().min(1),\n teamId: z.string().min(1),\n snapshot: z.string().min(1).optional().describe(\"Prebuilt snapshot to boot from.\"),\n })\n .readonly()\n .optional()\n .describe(\"Devbox execution config. Absent when this repository never uses devboxes.\"),\n connectedAt: isoDateTimeSchema,\n modelDefaults: z\n .strictObject({\n revision: z.number().int().nonnegative().describe(\"Revision of saved model preferences.\"),\n agents: z\n .record(z.string().regex(/^[a-z][a-z0-9-]{0,31}$/u), z.string().trim().min(1).max(200))\n .describe(\"Opaque model overrides by application agent.\"),\n })\n .optional()\n .describe(\"Saved repository model preferences; absent inherits application defaults.\"),\n })\n .readonly();\n\n/** Persisted identity and status of a repository admitted by Factory configuration. */\nexport type Repository = z.infer<typeof repositorySchema>;\n"],"mappings":";;;;;AAQA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MACC,qEACA,2DACF,CAAC,CACA,SACC,wFACF;;AAGF,MAAa,mBAAmB,EAC7B,aAAa;CACZ,eAAe;CACf,IAAI;CACJ,MAAM;CACN,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,uCAAuC;CACjF,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,kDAAkD;CAChF,WAAW,EACR,MAAM,oBAAoB,CAAC,CAC3B,SAAS,CAAC,CACV,SAAS,wEAAwE;CACpF,QAAQ,EACL,aAAa;EACZ,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EAC3B,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EACxB,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,iCAAiC;CACnF,CAAC,CAAC,CACD,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,2EAA2E;CACvF,aAAa;CACb,eAAe,EACZ,aAAa;EACZ,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,sCAAsC;EACxF,QAAQ,EACL,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,yBAAyB,GAAG,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CACtF,SAAS,8CAA8C;CAC5D,CAAC,CAAC,CACD,SAAS,CAAC,CACV,SAAS,2EAA2E;AACzF,CAAC,CAAC,CACD,SAAS"}
|
|
@@ -16,6 +16,7 @@ declare const agentSessionBaseSchema: z.ZodObject<{
|
|
|
16
16
|
version: z.ZodNumber;
|
|
17
17
|
}, z.core.$strict>, "AgentRouteBinding", "out">>;
|
|
18
18
|
message: z.ZodString;
|
|
19
|
+
model: z.ZodOptional<z.ZodString>;
|
|
19
20
|
attachments: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
20
21
|
id: z.ZodType<`img_${string}`, string, z.core.$ZodTypeInternals<`img_${string}`, string>>;
|
|
21
22
|
filename: z.ZodString;
|
package/dist/schema/session.mjs
CHANGED
|
@@ -35,6 +35,7 @@ const agentSessionBaseSchema = z.strictObject({
|
|
|
35
35
|
repositoryId: repositoryIdSchema.optional().describe("Configured repository selected for this interaction."),
|
|
36
36
|
route: agentRouteBindingSchema.optional().describe("Exact specialist route selected when this session was admitted."),
|
|
37
37
|
message: agentSessionMessageSchema,
|
|
38
|
+
model: z.string().trim().min(1).max(200).optional().describe("Opaque model selected at admission; unchanged by later repository defaults."),
|
|
38
39
|
attachments: imageAttachmentsSchema.optional().describe("Images accompanying the initial request."),
|
|
39
40
|
changeId: changeIdSchema.optional().describe("Existing change selected for this work."),
|
|
40
41
|
taskId: taskIdSchema.optional().describe("Workflow-owned task and authoritative execution binding."),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.mjs","names":[],"sources":["../../src/schema/session.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { hasMessageContent, imageAttachmentsSchema } from \"../image-input\";\nimport { communicationEventSchema } from \"./communication\";\nimport { isoDateTimeSchema, replyToSchema, schemaVersionSchema } from \"./common\";\nimport { changeIdSchema, repositoryIdSchema, repositoryIdsSchema, taskIdSchema } from \"./id\";\nimport { agentRouteBindingSchema } from \"./agent-route\";\nimport { executionReferenceSchema } from \"./task\";\n\n/** Validates a stable Factory interaction identifier distinct from provider sessions. */\nexport const agentSessionIdSchema = z\n .string()\n .regex(/^ses_[a-z0-9]{6,64}$/u, \"Expected ses_ followed by 6 to 64 lowercase letters or digits\")\n .describe(\"Stable Factory interaction ID; independent of provider session IDs.\") as z.ZodType<\n `ses_${string}`,\n string\n>;\n/** Stable Factory interaction identifier independent of provider session IDs. */\nexport type AgentSessionId = z.infer<typeof agentSessionIdSchema>;\n\n/** Validates the initial human request retained by a Factory session. */\nexport const agentSessionMessageSchema = z\n .string()\n .max(16000)\n .describe(\"Initial request, retained for idempotent admission and recovery.\");\n\nconst continuationSchema = z\n .strictObject({\n operationId: z.string().min(1).max(200).describe(\"Idempotency key for this follow-up.\"),\n taskId: taskIdSchema.describe(\"Budgeted investigation answering this follow-up.\"),\n parentTaskId: taskIdSchema.describe(\"Earlier work being discussed.\"),\n agent: z.string().min(1).describe(\"Conversation agent handling this follow-up.\"),\n message: z.string().max(16000).describe(\"Operator's follow-up request.\"),\n attachments: imageAttachmentsSchema.optional().describe(\"Images accompanying this follow-up.\"),\n contextAttachments: imageAttachmentsSchema\n .optional()\n .describe(\"Earlier images selected with the cached conversation context.\"),\n context: z\n .string()\n .max(80000)\n .optional()\n .describe(\"Bounded conversation context captured before launch and retained for recovery.\"),\n createdAt: isoDateTimeSchema,\n })\n .refine(hasMessageContent, \"Enter a message or attach an image\")\n .readonly();\n\nconst externalConversationSchema = z\n .strictObject({\n replyTo: replyToSchema.describe(\n \"Original external conversation destination; never rewritten by the console.\",\n ),\n repositoryIds: repositoryIdsSchema.describe(\n \"Repositories authorized for this external conversation.\",\n ),\n url: z\n .url({ protocol: /^https$/u })\n .optional()\n .describe(\"HTTPS link to the original conversation.\"),\n })\n .readonly();\n\n/** Base object fields used to decode current and legacy session snapshots. */\nexport const agentSessionBaseSchema = z.strictObject({\n schemaVersion: schemaVersionSchema,\n id: agentSessionIdSchema,\n owner: z.string().min(1).describe(\"Authenticated principal owning this interaction.\"),\n agent: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,31}$/u)\n .describe(\"Selected application agent.\"),\n repositoryId: repositoryIdSchema\n .optional()\n .describe(\"Configured repository selected for this interaction.\"),\n route: agentRouteBindingSchema\n .optional()\n .describe(\"Exact specialist route selected when this session was admitted.\"),\n message: agentSessionMessageSchema,\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Images accompanying the initial request.\"),\n changeId: changeIdSchema.optional().describe(\"Existing change selected for this work.\"),\n taskId: taskIdSchema\n .optional()\n .describe(\"Workflow-owned task and authoritative execution binding.\"),\n attached: z\n .boolean()\n .optional()\n .describe(\n \"Operator view of existing work that preserves its original origin and reply destination.\",\n ),\n continuations: z\n .array(continuationSchema)\n .readonly()\n .optional()\n .describe(\"Ordered immutable follow-up intents, each with separate work and usage.\"),\n execution: executionReferenceSchema\n .optional()\n .describe(\"Provider reference for taskless conversations only.\"),\n external: externalConversationSchema\n .optional()\n .describe(\"Read-only projection of an externally admitted taskless conversation.\"),\n notifications: z\n .array(communicationEventSchema)\n .readonly()\n .default([])\n .describe(\"Durable connector deliveries, deduplicated by eventId.\"),\n createdAt: isoDateTimeSchema,\n});\n\ntype AgentSessionBase = Readonly<z.infer<typeof agentSessionBaseSchema>>;\ntype BindingKeys = \"taskId\" | \"execution\" | \"external\" | \"route\" | \"continuations\";\n\n/** Durable session bound to workflow-owned Task work. */\nexport type TaskAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId: NonNullable<AgentSessionBase[\"taskId\"]>;\n execution?: never;\n external?: never;\n route?: AgentSessionBase[\"route\"];\n continuations?: AgentSessionBase[\"continuations\"];\n }\n>;\n\n/** Durable internal conversation whose provider execution is stored directly. */\nexport type DirectAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId?: never;\n execution?: AgentSessionBase[\"execution\"];\n external?: never;\n route?: AgentSessionBase[\"route\"];\n continuations?: AgentSessionBase[\"continuations\"];\n }\n>;\n\n/** Durable external conversation with a required direct provider execution. */\nexport type ExternalAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId?: never;\n execution: NonNullable<AgentSessionBase[\"execution\"]>;\n external: NonNullable<AgentSessionBase[\"external\"]>;\n route?: never;\n continuations?: never;\n }\n>;\n\n/** Durable interaction whose binding fields identify task, direct, or external ownership. */\nexport type AgentSession = TaskAgentSession | DirectAgentSession | ExternalAgentSession;\n\n/** Validates a persisted session and rejects contradictory task, execution, and external bindings. */\nexport const agentSessionSchema = agentSessionBaseSchema\n .refine(hasMessageContent, \"Enter a message or attach an image\")\n .refine(\n (session) => session.taskId === undefined || session.execution === undefined,\n \"A session binds either a task or a conversation execution\",\n )\n .refine(\n (session) =>\n session.external === undefined ||\n (session.execution !== undefined &&\n session.taskId === undefined &&\n session.continuations === undefined &&\n session.route === undefined),\n \"An external conversation requires an execution and cannot bind a Task, route, or continuations\",\n ) as z.ZodType<AgentSession>;\n"],"mappings":";;;;;;;;;AASA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MAAM,yBAAyB,+DAA+D,CAAC,CAC/F,SAAS,qEAAqE;;AAQjF,MAAa,4BAA4B,EACtC,OAAO,CAAC,CACR,IAAI,IAAK,CAAC,CACV,SAAS,kEAAkE;AAE9E,MAAM,qBAAqB,EACxB,aAAa;CACZ,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,qCAAqC;CACtF,QAAQ,aAAa,SAAS,kDAAkD;CAChF,cAAc,aAAa,SAAS,+BAA+B;CACnE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAA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,SAAS,CAAC,CACV,SAAS,qDAAqD;CACjE,UAAU,2BACP,SAAS,CAAC,CACV,SAAS,uEAAuE;CACnF,eAAe,EACZ,MAAM,wBAAwB,CAAC,CAC/B,SAAS,CAAC,CACV,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,wDAAwD;CACpE,WAAW;AACb,CAAC;;AA0CD,MAAa,qBAAqB,uBAC/B,OAAO,mBAAmB,oCAAoC,CAAC,CAC/D,QACE,YAAY,QAAQ,WAAW,KAAA,KAAa,QAAQ,cAAc,KAAA,GACnE,2DACF,CAAC,CACA,QACE,YACC,QAAQ,aAAa,KAAA,KACpB,QAAQ,cAAc,KAAA,KACrB,QAAQ,WAAW,KAAA,KACnB,QAAQ,kBAAkB,KAAA,KAC1B,QAAQ,UAAU,KAAA,GACtB,gGACF"}
|
|
1
|
+
{"version":3,"file":"session.mjs","names":[],"sources":["../../src/schema/session.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { hasMessageContent, imageAttachmentsSchema } from \"../image-input\";\nimport { communicationEventSchema } from \"./communication\";\nimport { isoDateTimeSchema, replyToSchema, schemaVersionSchema } from \"./common\";\nimport { changeIdSchema, repositoryIdSchema, repositoryIdsSchema, taskIdSchema } from \"./id\";\nimport { agentRouteBindingSchema } from \"./agent-route\";\nimport { executionReferenceSchema } from \"./task\";\n\n/** Validates a stable Factory interaction identifier distinct from provider sessions. */\nexport const agentSessionIdSchema = z\n .string()\n .regex(/^ses_[a-z0-9]{6,64}$/u, \"Expected ses_ followed by 6 to 64 lowercase letters or digits\")\n .describe(\"Stable Factory interaction ID; independent of provider session IDs.\") as z.ZodType<\n `ses_${string}`,\n string\n>;\n/** Stable Factory interaction identifier independent of provider session IDs. */\nexport type AgentSessionId = z.infer<typeof agentSessionIdSchema>;\n\n/** Validates the initial human request retained by a Factory session. */\nexport const agentSessionMessageSchema = z\n .string()\n .max(16000)\n .describe(\"Initial request, retained for idempotent admission and recovery.\");\n\nconst continuationSchema = z\n .strictObject({\n operationId: z.string().min(1).max(200).describe(\"Idempotency key for this follow-up.\"),\n taskId: taskIdSchema.describe(\"Budgeted investigation answering this follow-up.\"),\n parentTaskId: taskIdSchema.describe(\"Earlier work being discussed.\"),\n agent: z.string().min(1).describe(\"Conversation agent handling this follow-up.\"),\n message: z.string().max(16000).describe(\"Operator's follow-up request.\"),\n attachments: imageAttachmentsSchema.optional().describe(\"Images accompanying this follow-up.\"),\n contextAttachments: imageAttachmentsSchema\n .optional()\n .describe(\"Earlier images selected with the cached conversation context.\"),\n context: z\n .string()\n .max(80000)\n .optional()\n .describe(\"Bounded conversation context captured before launch and retained for recovery.\"),\n createdAt: isoDateTimeSchema,\n })\n .refine(hasMessageContent, \"Enter a message or attach an image\")\n .readonly();\n\nconst externalConversationSchema = z\n .strictObject({\n replyTo: replyToSchema.describe(\n \"Original external conversation destination; never rewritten by the console.\",\n ),\n repositoryIds: repositoryIdsSchema.describe(\n \"Repositories authorized for this external conversation.\",\n ),\n url: z\n .url({ protocol: /^https$/u })\n .optional()\n .describe(\"HTTPS link to the original conversation.\"),\n })\n .readonly();\n\n/** Base object fields used to decode current and legacy session snapshots. */\nexport const agentSessionBaseSchema = z.strictObject({\n schemaVersion: schemaVersionSchema,\n id: agentSessionIdSchema,\n owner: z.string().min(1).describe(\"Authenticated principal owning this interaction.\"),\n agent: z\n .string()\n .regex(/^[a-z][a-z0-9-]{0,31}$/u)\n .describe(\"Selected application agent.\"),\n repositoryId: repositoryIdSchema\n .optional()\n .describe(\"Configured repository selected for this interaction.\"),\n route: agentRouteBindingSchema\n .optional()\n .describe(\"Exact specialist route selected when this session was admitted.\"),\n message: agentSessionMessageSchema,\n model: z\n .string()\n .trim()\n .min(1)\n .max(200)\n .optional()\n .describe(\"Opaque model selected at admission; unchanged by later repository defaults.\"),\n attachments: imageAttachmentsSchema\n .optional()\n .describe(\"Images accompanying the initial request.\"),\n changeId: changeIdSchema.optional().describe(\"Existing change selected for this work.\"),\n taskId: taskIdSchema\n .optional()\n .describe(\"Workflow-owned task and authoritative execution binding.\"),\n attached: z\n .boolean()\n .optional()\n .describe(\n \"Operator view of existing work that preserves its original origin and reply destination.\",\n ),\n continuations: z\n .array(continuationSchema)\n .readonly()\n .optional()\n .describe(\"Ordered immutable follow-up intents, each with separate work and usage.\"),\n execution: executionReferenceSchema\n .optional()\n .describe(\"Provider reference for taskless conversations only.\"),\n external: externalConversationSchema\n .optional()\n .describe(\"Read-only projection of an externally admitted taskless conversation.\"),\n notifications: z\n .array(communicationEventSchema)\n .readonly()\n .default([])\n .describe(\"Durable connector deliveries, deduplicated by eventId.\"),\n createdAt: isoDateTimeSchema,\n});\n\ntype AgentSessionBase = Readonly<z.infer<typeof agentSessionBaseSchema>>;\ntype BindingKeys = \"taskId\" | \"execution\" | \"external\" | \"route\" | \"continuations\";\n\n/** Durable session bound to workflow-owned Task work. */\nexport type TaskAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId: NonNullable<AgentSessionBase[\"taskId\"]>;\n execution?: never;\n external?: never;\n route?: AgentSessionBase[\"route\"];\n continuations?: AgentSessionBase[\"continuations\"];\n }\n>;\n\n/** Durable internal conversation whose provider execution is stored directly. */\nexport type DirectAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId?: never;\n execution?: AgentSessionBase[\"execution\"];\n external?: never;\n route?: AgentSessionBase[\"route\"];\n continuations?: AgentSessionBase[\"continuations\"];\n }\n>;\n\n/** Durable external conversation with a required direct provider execution. */\nexport type ExternalAgentSession = Readonly<\n Omit<AgentSessionBase, BindingKeys> & {\n taskId?: never;\n execution: NonNullable<AgentSessionBase[\"execution\"]>;\n external: NonNullable<AgentSessionBase[\"external\"]>;\n route?: never;\n continuations?: never;\n }\n>;\n\n/** Durable interaction whose binding fields identify task, direct, or external ownership. */\nexport type AgentSession = TaskAgentSession | DirectAgentSession | ExternalAgentSession;\n\n/** Validates a persisted session and rejects contradictory task, execution, and external bindings. */\nexport const agentSessionSchema = agentSessionBaseSchema\n .refine(hasMessageContent, \"Enter a message or attach an image\")\n .refine(\n (session) => session.taskId === undefined || session.execution === undefined,\n \"A session binds either a task or a conversation execution\",\n )\n .refine(\n (session) =>\n session.external === undefined ||\n (session.execution !== undefined &&\n session.taskId === undefined &&\n session.continuations === undefined &&\n session.route === undefined),\n \"An external conversation requires an execution and cannot bind a Task, route, or continuations\",\n ) as z.ZodType<AgentSession>;\n"],"mappings":";;;;;;;;;AASA,MAAa,uBAAuB,EACjC,OAAO,CAAC,CACR,MAAM,yBAAyB,+DAA+D,CAAC,CAC/F,SAAS,qEAAqE;;AAQjF,MAAa,4BAA4B,EACtC,OAAO,CAAC,CACR,IAAI,IAAK,CAAC,CACV,SAAS,kEAAkE;AAE9E,MAAM,qBAAqB,EACxB,aAAa;CACZ,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,qCAAqC;CACtF,QAAQ,aAAa,SAAS,kDAAkD;CAChF,cAAc,aAAa,SAAS,+BAA+B;CACnE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,6CAA6C;CAC/E,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,IAAK,CAAC,CAAC,SAAS,+BAA+B;CACvE,aAAa,uBAAuB,SAAS,CAAC,CAAC,SAAS,qCAAqC;CAC7F,oBAAoB,uBACjB,SAAS,CAAC,CACV,SAAS,+DAA+D;CAC3E,SAAS,EACN,OAAO,CAAC,CACR,IAAI,GAAK,CAAC,CACV,SAAS,CAAC,CACV,SAAS,gFAAgF;CAC5F,WAAW;AACb,CAAC,CAAC,CACD,OAAO,mBAAmB,oCAAoC,CAAC,CAC/D,SAAS;AAEZ,MAAM,6BAA6B,EAChC,aAAa;CACZ,SAAS,cAAc,SACrB,6EACF;CACA,eAAe,oBAAoB,SACjC,yDACF;CACA,KAAK,EACF,IAAI,EAAE,UAAU,WAAW,CAAC,CAAC,CAC7B,SAAS,CAAC,CAC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QAAQ,WAAW,KAAA,KACnB,QAAQ,kBAAkB,KAAA,KAC1B,QAAQ,UAAU,KAAA,GACtB,gGACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/slack-pr-notifications.d.ts
|
|
3
|
+
/** Validates the Slack destination and individual mentions for Factory-produced PR announcements. */
|
|
4
|
+
declare const slackPrNotificationsSchema: z.ZodReadonly<z.ZodObject<{
|
|
5
|
+
channelId: z.ZodString;
|
|
6
|
+
mentionUserIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
7
|
+
}, z.core.$strict>>;
|
|
8
|
+
/** Slack destination and individual mentions for Factory-produced PR announcements. */
|
|
9
|
+
type SlackPrNotifications = z.infer<typeof slackPrNotificationsSchema>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SlackPrNotifications, slackPrNotificationsSchema };
|
|
12
|
+
//# sourceMappingURL=slack-pr-notifications.d.mts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema/slack-pr-notifications.ts
|
|
3
|
+
/** Validates the Slack destination and individual mentions for Factory-produced PR announcements. */
|
|
4
|
+
const slackPrNotificationsSchema = z.strictObject({
|
|
5
|
+
channelId: z.string().regex(/^[CG][A-Z0-9]+$/u).describe("Existing Slack channel for PR announcements."),
|
|
6
|
+
mentionUserIds: z.array(z.string().regex(/^[UW][A-Z0-9]+$/u)).min(1).max(10).readonly().refine((ids) => new Set(ids).size === ids.length, "Slack mention users must be unique.").describe("Slack users to mention when the factory opens a PR.")
|
|
7
|
+
}).readonly();
|
|
8
|
+
//#endregion
|
|
9
|
+
export { slackPrNotificationsSchema };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=slack-pr-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-pr-notifications.mjs","names":[],"sources":["../../src/schema/slack-pr-notifications.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/** Validates the Slack destination and individual mentions for Factory-produced PR announcements. */\nexport const slackPrNotificationsSchema = z\n .strictObject({\n channelId: z\n .string()\n .regex(/^[CG][A-Z0-9]+$/u)\n .describe(\"Existing Slack channel for PR announcements.\"),\n mentionUserIds: z\n .array(z.string().regex(/^[UW][A-Z0-9]+$/u))\n .min(1)\n .max(10)\n .readonly()\n .refine((ids) => new Set(ids).size === ids.length, \"Slack mention users must be unique.\")\n .describe(\"Slack users to mention when the factory opens a PR.\"),\n })\n .readonly();\n\n/** Slack destination and individual mentions for Factory-produced PR announcements. */\nexport type SlackPrNotifications = z.infer<typeof slackPrNotificationsSchema>;\n"],"mappings":";;;AAGA,MAAa,6BAA6B,EACvC,aAAa;CACZ,WAAW,EACR,OAAO,CAAC,CACR,MAAM,kBAAkB,CAAC,CACzB,SAAS,8CAA8C;CAC1D,gBAAgB,EACb,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,kBAAkB,CAAC,CAAC,CAC3C,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,SAAS,CAAC,CACV,QAAQ,QAAQ,IAAI,IAAI,GAAG,CAAC,CAAC,SAAS,IAAI,QAAQ,qCAAqC,CAAC,CACxF,SAAS,qDAAqD;AACnE,CAAC,CAAC,CACD,SAAS"}
|
|
@@ -14,6 +14,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
14
14
|
id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
15
15
|
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
16
16
|
kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
|
|
17
|
+
model: z.ZodOptional<z.ZodString>;
|
|
17
18
|
area: z.ZodOptional<z.ZodString>;
|
|
18
19
|
state: z.ZodEnum<{
|
|
19
20
|
queued: "queued";
|
|
@@ -130,6 +131,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
130
131
|
attempt: number;
|
|
131
132
|
createdAt: string;
|
|
132
133
|
updatedAt: string;
|
|
134
|
+
model?: string | undefined;
|
|
133
135
|
area?: string | undefined;
|
|
134
136
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
135
137
|
workResult?: {
|
|
@@ -207,6 +209,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
207
209
|
attempt: number;
|
|
208
210
|
createdAt: string;
|
|
209
211
|
updatedAt: string;
|
|
212
|
+
model?: string | undefined;
|
|
210
213
|
area?: string | undefined;
|
|
211
214
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
212
215
|
workResult?: {
|
|
@@ -264,6 +267,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
264
267
|
updatedAt: string;
|
|
265
268
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
266
269
|
kind: TaskKind;
|
|
270
|
+
model?: string | undefined;
|
|
267
271
|
area?: string | undefined;
|
|
268
272
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
269
273
|
origin: {
|
|
@@ -340,6 +344,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
340
344
|
updatedAt: string;
|
|
341
345
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
342
346
|
kind: TaskKind;
|
|
347
|
+
model?: string | undefined;
|
|
343
348
|
area?: string | undefined;
|
|
344
349
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
345
350
|
origin: {
|
|
@@ -422,6 +427,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
422
427
|
updatedAt: string;
|
|
423
428
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
424
429
|
kind: TaskKind;
|
|
430
|
+
model?: string | undefined;
|
|
425
431
|
area?: string | undefined;
|
|
426
432
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
427
433
|
origin: {
|
|
@@ -504,6 +510,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
504
510
|
updatedAt: string;
|
|
505
511
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
506
512
|
kind: TaskKind;
|
|
513
|
+
model?: string | undefined;
|
|
507
514
|
area?: string | undefined;
|
|
508
515
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
509
516
|
origin: {
|
|
@@ -600,6 +607,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
600
607
|
attempt: number;
|
|
601
608
|
createdAt: string;
|
|
602
609
|
updatedAt: string;
|
|
610
|
+
model?: string | undefined;
|
|
603
611
|
area?: string | undefined;
|
|
604
612
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
605
613
|
workResult?: {
|
|
@@ -657,6 +665,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
657
665
|
updatedAt: string;
|
|
658
666
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
659
667
|
kind: TaskKind;
|
|
668
|
+
model?: string | undefined;
|
|
660
669
|
area?: string | undefined;
|
|
661
670
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
662
671
|
origin: {
|
|
@@ -733,6 +742,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
733
742
|
updatedAt: string;
|
|
734
743
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
735
744
|
kind: TaskKind;
|
|
745
|
+
model?: string | undefined;
|
|
736
746
|
area?: string | undefined;
|
|
737
747
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
738
748
|
origin: {
|
|
@@ -815,6 +825,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
815
825
|
updatedAt: string;
|
|
816
826
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
817
827
|
kind: TaskKind;
|
|
828
|
+
model?: string | undefined;
|
|
818
829
|
area?: string | undefined;
|
|
819
830
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
820
831
|
origin: {
|
|
@@ -897,6 +908,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
897
908
|
updatedAt: string;
|
|
898
909
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
899
910
|
kind: TaskKind;
|
|
911
|
+
model?: string | undefined;
|
|
900
912
|
area?: string | undefined;
|
|
901
913
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
902
914
|
origin: {
|
|
@@ -993,6 +1005,7 @@ declare const taskGraphAdmissionSchema: Omit<z.ZodObject<{
|
|
|
993
1005
|
attempt: number;
|
|
994
1006
|
createdAt: string;
|
|
995
1007
|
updatedAt: string;
|
|
1008
|
+
model?: string | undefined;
|
|
996
1009
|
area?: string | undefined;
|
|
997
1010
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
998
1011
|
workResult?: {
|
|
@@ -1051,6 +1064,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1051
1064
|
id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
1052
1065
|
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
1053
1066
|
kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
|
|
1067
|
+
model: z.ZodOptional<z.ZodString>;
|
|
1054
1068
|
area: z.ZodOptional<z.ZodString>;
|
|
1055
1069
|
state: z.ZodEnum<{
|
|
1056
1070
|
queued: "queued";
|
|
@@ -1167,6 +1181,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1167
1181
|
attempt: number;
|
|
1168
1182
|
createdAt: string;
|
|
1169
1183
|
updatedAt: string;
|
|
1184
|
+
model?: string | undefined;
|
|
1170
1185
|
area?: string | undefined;
|
|
1171
1186
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1172
1187
|
workResult?: {
|
|
@@ -1244,6 +1259,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1244
1259
|
attempt: number;
|
|
1245
1260
|
createdAt: string;
|
|
1246
1261
|
updatedAt: string;
|
|
1262
|
+
model?: string | undefined;
|
|
1247
1263
|
area?: string | undefined;
|
|
1248
1264
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1249
1265
|
workResult?: {
|
|
@@ -1301,6 +1317,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1301
1317
|
updatedAt: string;
|
|
1302
1318
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1303
1319
|
kind: TaskKind;
|
|
1320
|
+
model?: string | undefined;
|
|
1304
1321
|
area?: string | undefined;
|
|
1305
1322
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1306
1323
|
origin: {
|
|
@@ -1377,6 +1394,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1377
1394
|
updatedAt: string;
|
|
1378
1395
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1379
1396
|
kind: TaskKind;
|
|
1397
|
+
model?: string | undefined;
|
|
1380
1398
|
area?: string | undefined;
|
|
1381
1399
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1382
1400
|
origin: {
|
|
@@ -1459,6 +1477,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1459
1477
|
updatedAt: string;
|
|
1460
1478
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1461
1479
|
kind: TaskKind;
|
|
1480
|
+
model?: string | undefined;
|
|
1462
1481
|
area?: string | undefined;
|
|
1463
1482
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1464
1483
|
origin: {
|
|
@@ -1541,6 +1560,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1541
1560
|
updatedAt: string;
|
|
1542
1561
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1543
1562
|
kind: TaskKind;
|
|
1563
|
+
model?: string | undefined;
|
|
1544
1564
|
area?: string | undefined;
|
|
1545
1565
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1546
1566
|
origin: {
|
|
@@ -1637,6 +1657,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1637
1657
|
attempt: number;
|
|
1638
1658
|
createdAt: string;
|
|
1639
1659
|
updatedAt: string;
|
|
1660
|
+
model?: string | undefined;
|
|
1640
1661
|
area?: string | undefined;
|
|
1641
1662
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1642
1663
|
workResult?: {
|
|
@@ -1694,6 +1715,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1694
1715
|
updatedAt: string;
|
|
1695
1716
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1696
1717
|
kind: TaskKind;
|
|
1718
|
+
model?: string | undefined;
|
|
1697
1719
|
area?: string | undefined;
|
|
1698
1720
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1699
1721
|
origin: {
|
|
@@ -1770,6 +1792,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1770
1792
|
updatedAt: string;
|
|
1771
1793
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1772
1794
|
kind: TaskKind;
|
|
1795
|
+
model?: string | undefined;
|
|
1773
1796
|
area?: string | undefined;
|
|
1774
1797
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1775
1798
|
origin: {
|
|
@@ -1852,6 +1875,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1852
1875
|
updatedAt: string;
|
|
1853
1876
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1854
1877
|
kind: TaskKind;
|
|
1878
|
+
model?: string | undefined;
|
|
1855
1879
|
area?: string | undefined;
|
|
1856
1880
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1857
1881
|
origin: {
|
|
@@ -1934,6 +1958,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
1934
1958
|
updatedAt: string;
|
|
1935
1959
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
1936
1960
|
kind: TaskKind;
|
|
1961
|
+
model?: string | undefined;
|
|
1937
1962
|
area?: string | undefined;
|
|
1938
1963
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
1939
1964
|
origin: {
|
|
@@ -2030,6 +2055,7 @@ declare const taskGraphNodeSchema: z.ZodObject<{
|
|
|
2030
2055
|
attempt: number;
|
|
2031
2056
|
createdAt: string;
|
|
2032
2057
|
updatedAt: string;
|
|
2058
|
+
model?: string | undefined;
|
|
2033
2059
|
area?: string | undefined;
|
|
2034
2060
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2035
2061
|
workResult?: {
|
|
@@ -2096,6 +2122,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2096
2122
|
id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
2097
2123
|
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
2098
2124
|
kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
|
|
2125
|
+
model: z.ZodOptional<z.ZodString>;
|
|
2099
2126
|
area: z.ZodOptional<z.ZodString>;
|
|
2100
2127
|
state: z.ZodEnum<{
|
|
2101
2128
|
queued: "queued";
|
|
@@ -2212,6 +2239,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2212
2239
|
attempt: number;
|
|
2213
2240
|
createdAt: string;
|
|
2214
2241
|
updatedAt: string;
|
|
2242
|
+
model?: string | undefined;
|
|
2215
2243
|
area?: string | undefined;
|
|
2216
2244
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2217
2245
|
workResult?: {
|
|
@@ -2289,6 +2317,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2289
2317
|
attempt: number;
|
|
2290
2318
|
createdAt: string;
|
|
2291
2319
|
updatedAt: string;
|
|
2320
|
+
model?: string | undefined;
|
|
2292
2321
|
area?: string | undefined;
|
|
2293
2322
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2294
2323
|
workResult?: {
|
|
@@ -2346,6 +2375,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2346
2375
|
updatedAt: string;
|
|
2347
2376
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2348
2377
|
kind: TaskKind;
|
|
2378
|
+
model?: string | undefined;
|
|
2349
2379
|
area?: string | undefined;
|
|
2350
2380
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2351
2381
|
origin: {
|
|
@@ -2422,6 +2452,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2422
2452
|
updatedAt: string;
|
|
2423
2453
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2424
2454
|
kind: TaskKind;
|
|
2455
|
+
model?: string | undefined;
|
|
2425
2456
|
area?: string | undefined;
|
|
2426
2457
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2427
2458
|
origin: {
|
|
@@ -2504,6 +2535,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2504
2535
|
updatedAt: string;
|
|
2505
2536
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2506
2537
|
kind: TaskKind;
|
|
2538
|
+
model?: string | undefined;
|
|
2507
2539
|
area?: string | undefined;
|
|
2508
2540
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2509
2541
|
origin: {
|
|
@@ -2586,6 +2618,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2586
2618
|
updatedAt: string;
|
|
2587
2619
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2588
2620
|
kind: TaskKind;
|
|
2621
|
+
model?: string | undefined;
|
|
2589
2622
|
area?: string | undefined;
|
|
2590
2623
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2591
2624
|
origin: {
|
|
@@ -2682,6 +2715,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2682
2715
|
attempt: number;
|
|
2683
2716
|
createdAt: string;
|
|
2684
2717
|
updatedAt: string;
|
|
2718
|
+
model?: string | undefined;
|
|
2685
2719
|
area?: string | undefined;
|
|
2686
2720
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2687
2721
|
workResult?: {
|
|
@@ -2739,6 +2773,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2739
2773
|
updatedAt: string;
|
|
2740
2774
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2741
2775
|
kind: TaskKind;
|
|
2776
|
+
model?: string | undefined;
|
|
2742
2777
|
area?: string | undefined;
|
|
2743
2778
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2744
2779
|
origin: {
|
|
@@ -2815,6 +2850,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2815
2850
|
updatedAt: string;
|
|
2816
2851
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2817
2852
|
kind: TaskKind;
|
|
2853
|
+
model?: string | undefined;
|
|
2818
2854
|
area?: string | undefined;
|
|
2819
2855
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2820
2856
|
origin: {
|
|
@@ -2897,6 +2933,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2897
2933
|
updatedAt: string;
|
|
2898
2934
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2899
2935
|
kind: TaskKind;
|
|
2936
|
+
model?: string | undefined;
|
|
2900
2937
|
area?: string | undefined;
|
|
2901
2938
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2902
2939
|
origin: {
|
|
@@ -2979,6 +3016,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
2979
3016
|
updatedAt: string;
|
|
2980
3017
|
repositoryIds: readonly [`repo_${string}`, ...`repo_${string}`[]];
|
|
2981
3018
|
kind: TaskKind;
|
|
3019
|
+
model?: string | undefined;
|
|
2982
3020
|
area?: string | undefined;
|
|
2983
3021
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
2984
3022
|
origin: {
|
|
@@ -3075,6 +3113,7 @@ declare const taskGraphSchema: z.ZodObject<{
|
|
|
3075
3113
|
attempt: number;
|
|
3076
3114
|
createdAt: string;
|
|
3077
3115
|
updatedAt: string;
|
|
3116
|
+
model?: string | undefined;
|
|
3078
3117
|
area?: string | undefined;
|
|
3079
3118
|
approval?: "required" | "granted" | "denied" | undefined;
|
|
3080
3119
|
workResult?: {
|
package/dist/schema/task.d.mts
CHANGED
|
@@ -68,6 +68,7 @@ declare const taskRecordSchema: z.ZodObject<{
|
|
|
68
68
|
id: z.ZodType<`task_${string}`, string, z.core.$ZodTypeInternals<`task_${string}`, string>>;
|
|
69
69
|
repositoryIds: z.ZodReadonly<z.ZodTuple<[z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>], z.ZodType<`repo_${string}`, string, z.core.$ZodTypeInternals<`repo_${string}`, string>>>>;
|
|
70
70
|
kind: z.ZodType<TaskKind, unknown, z.core.$ZodTypeInternals<TaskKind, unknown>>;
|
|
71
|
+
model: z.ZodOptional<z.ZodString>;
|
|
71
72
|
area: z.ZodOptional<z.ZodString>;
|
|
72
73
|
state: z.ZodEnum<{
|
|
73
74
|
queued: "queued";
|