glimmervoid 0.38.2 → 0.40.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.
Files changed (41) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/glimmervoid.js +33 -42
  3. package/dist/chunks/{adapters-CAHxZYT3.js → adapters-B6tbX3Aj.js} +27 -14
  4. package/dist/chunks/{adapters-DDjC7_vG.js → adapters-CXQfLoyj.js} +1 -1
  5. package/dist/chunks/agent-api-cli-BBech5lF.js +1 -0
  6. package/dist/chunks/{agent-api-cli-B5Tm0wXO.js → agent-api-cli-BNHJTmNW.js} +44 -77
  7. package/dist/chunks/agent-api-core-DDrJQEdE.js +304 -0
  8. package/dist/chunks/{agent-setup-cli-DmMfCw5O.js → agent-setup-cli-CeBBwKuL.js} +2 -2
  9. package/dist/chunks/config-store-BZpN2djp.js +1 -0
  10. package/dist/chunks/{config-store-BUNZs4j7.js → config-store-DqMScSdg.js} +82 -268
  11. package/dist/chunks/contracts-CloExMlS.js +680 -0
  12. package/dist/chunks/{contracts-HVCEJfxs.js → control-messages-DpBaniJi.js} +1275 -1021
  13. package/dist/chunks/{git-version-rWZjF2Px.js → git-version-CJQMfxtZ.js} +2 -2
  14. package/dist/chunks/{grok-B6bsCgdd.js → grok-BLzhApwT.js} +7 -8
  15. package/dist/chunks/{guardrails-deps-Cb-ki4EU.js → guardrails-deps-CLxK4J-g.js} +1 -1
  16. package/dist/chunks/{json-file-CIJf0Cel.js → json-file-DFCTvPjj.js} +3 -7
  17. package/dist/chunks/{main-BNSbP-Yk.js → main-DDU8IvFD.js} +28791 -31978
  18. package/dist/chunks/{pair-cli-DNp8i5L4.js → pair-cli-CsOVTQGJ.js} +2 -2
  19. package/dist/chunks/{remote-config-C_s2pnLC.js → remote-config-HlABuLTp.js} +2 -2
  20. package/dist/chunks/{session-BlT68ppa.js → session-BwB43SCa.js} +119 -71
  21. package/dist/chunks/{session-routes-CT1JrjoT.js → session-routes-DNJzsckH.js} +25 -10
  22. package/dist/chunks/{settings-cli-BbzxCyG5.js → settings-cli-DkkbK-dj.js} +30 -156
  23. package/dist/chunks/settings-readout-core-DrXT4aWm.js +201 -0
  24. package/dist/chunks/{ssh-sign-cli-C74BGTQS.js → ssh-sign-cli-CYeKRevK.js} +2 -2
  25. package/dist/client/assets/index-BK9jLR47.js +148 -0
  26. package/dist/client/assets/index-CU_uqJmi.css +2 -0
  27. package/dist/client/assets/xterm-kR64YvZ-.js +79 -0
  28. package/dist/client/assets/zod-BRLv4KqJ.js +55 -0
  29. package/dist/client/index.html +7 -3
  30. package/dist/scripts/postinstall-path-check.js +21 -3
  31. package/dist/server/index.js +1 -1
  32. package/package.json +3 -4
  33. package/dist/chunks/agent-api-cli-BDu1CxZf.js +0 -1
  34. package/dist/chunks/agent-api-core-B_mUSenR.js +0 -341
  35. package/dist/chunks/browser-config-BrBT8269.js +0 -762
  36. package/dist/chunks/config-CjawSOBk.js +0 -219
  37. package/dist/chunks/config-store-MAVQhGMh.js +0 -1
  38. package/dist/chunks/factory-D7ryES9n.js +0 -240
  39. package/dist/chunks/knowledge-graph-cli-ByUJoKw_.js +0 -1354
  40. package/dist/client/assets/index-B5uVtedd.css +0 -1
  41. package/dist/client/assets/index-b13-NGGS.js +0 -275
@@ -1,219 +0,0 @@
1
- import { $ as SessionPrLinks, P as TaskTitle } from "./session-BlT68ppa.js";
2
- import { S as WorkflowsSettingsUpdate, _ as optionalLooseObject, c as GithubSettings, d as PlanReviewSettings, f as TelemetryFileSettings, g as optionalBoolean, h as createBrowserConfig, i as ChangeMapSettings, l as GuardrailsFileSettings, p as TraceSettings, s as FactorySettings, t as BranchGcControlSettings } from "./browser-config-BrBT8269.js";
3
- import path from "node:path";
4
- import { z } from "zod";
5
- //#region shared/contracts/config.ts
6
- var BrowserConfig = createBrowserConfig(path.isAbsolute);
7
- var BROWSER_CONFIG_SHAPE = BrowserConfig.shape;
8
- var ConfigUpdate = z.object({
9
- ...BROWSER_CONFIG_SHAPE,
10
- notifyDebounceMs: z.number({ error: "notifyDebounceMs must be a positive number" }).finite().positive({ error: "notifyDebounceMs must be a positive number" }).optional(),
11
- phoneEscalationMs: z.number({ error: "phoneEscalationMs must be a positive number" }).finite().positive({ error: "phoneEscalationMs must be a positive number" }).optional(),
12
- branchGc: BranchGcControlSettings,
13
- worktreeAutoRebase: optionalBoolean("worktreeAutoRebase"),
14
- worktreeSyncOnStart: optionalBoolean("worktreeSyncOnStart"),
15
- worktreeRerere: optionalBoolean("worktreeRerere"),
16
- workflows: WorkflowsSettingsUpdate.optional()
17
- }).omit({
18
- port: true,
19
- worktreeShare: true
20
- }).strict();
21
- var AGENT_ID_RE = /^[a-z][a-z0-9-]{1,31}$/;
22
- var BUILTIN_AGENT_IDS = Object.freeze([
23
- "claude-code",
24
- "codex",
25
- "grok"
26
- ]);
27
- var AGENT_ID_SHAPE_MESSAGE = "an agent id of 2 to 32 characters of lowercase letters, digits and dashes, starting with a letter";
28
- var AGENT_COMMAND_BASENAME_RE = /^[A-Za-z0-9._+-]+$/;
29
- var AGENT_COMMAND_ABSOLUTE_RE = /^(?:\/|[A-Za-z]:[\\/])[A-Za-z0-9._+\-\\/]*[A-Za-z0-9._+-]$/;
30
- var AGENT_COMMAND_SHAPE_MESSAGE = "a bare command name or an absolute path, built only from letters, digits, dot, underscore, plus, dash and path separators";
31
- function isSpawnableCommand(command) {
32
- if (AGENT_COMMAND_BASENAME_RE.test(command)) return true;
33
- return AGENT_COMMAND_ABSOLUTE_RE.test(command);
34
- }
35
- var GIT_BRANCH_FORBIDDEN_PUNCTUATION_RE = /[~^:?*[\\]/;
36
- var GIT_BRANCH_FORBIDDEN_SEQUENCES = [
37
- "..",
38
- "@{",
39
- "//"
40
- ];
41
- function isControlOrSpaceCharacter(character) {
42
- const codePoint = character.charCodeAt(0);
43
- return codePoint <= 32 || codePoint === 127;
44
- }
45
- function isGitBranchName(name) {
46
- if (name === "" || name === "@" || name === "HEAD") return false;
47
- if (name.startsWith("-") || name.startsWith("/") || name.endsWith("/") || name.endsWith(".")) return false;
48
- if (GIT_BRANCH_FORBIDDEN_SEQUENCES.some((sequence) => name.includes(sequence))) return false;
49
- if (GIT_BRANCH_FORBIDDEN_PUNCTUATION_RE.test(name) || [...name].some(isControlOrSpaceCharacter)) return false;
50
- return name.split("/").every((component) => !component.startsWith(".") && !component.endsWith(".lock"));
51
- }
52
- var CustomAgentDeclaration = z.object({
53
- id: z.string({ error: "customAgents[].id must be a string" }).regex(AGENT_ID_RE, { error: `customAgents[].id must be ${AGENT_ID_SHAPE_MESSAGE}` }),
54
- label: z.string({ error: "customAgents[].label must be a string" }).min(1, { error: "customAgents[].label must not be empty" }).max(60, { error: "customAgents[].label must be at most 60 characters" }),
55
- command: z.string({ error: "customAgents[].command must be a string" }).min(1, { error: "customAgents[].command must not be empty" }).refine((command) => command.trim().length > 0, { error: "customAgents[].command must not be blank" }).refine(isSpawnableCommand, { error: `customAgents[].command must be ${AGENT_COMMAND_SHAPE_MESSAGE}` }),
56
- args: z.array(z.string({ error: "customAgents[].args must be an array of strings" }), { error: "customAgents[].args must be an array of strings" }).default([]),
57
- idleTitle: z.string({ error: "customAgents[].idleTitle must be a string" }).optional(),
58
- busyTitle: z.string({ error: "customAgents[].busyTitle must be a string" }).optional()
59
- }).strict();
60
- var CustomAgentDeclarations = z.array(CustomAgentDeclaration, { error: "customAgents must be an array" }).superRefine((declarations, ctx) => {
61
- const claimedIds = new Set(BUILTIN_AGENT_IDS);
62
- for (const [index, declaration] of declarations.entries()) {
63
- if (!claimedIds.has(declaration.id)) {
64
- claimedIds.add(declaration.id);
65
- continue;
66
- }
67
- const message = BUILTIN_AGENT_IDS.some((builtinAgentId) => builtinAgentId === declaration.id) ? `customAgents[${index}].id "${declaration.id}" collides with the builtin agent of the same id` : `customAgents[${index}].id "${declaration.id}" is declared more than once`;
68
- ctx.addIssue({
69
- code: "custom",
70
- path: [index, "id"],
71
- message
72
- });
73
- }
74
- });
75
- var TaskTitleSources = z.object({
76
- customTitle: TaskTitle.nullable().optional(),
77
- pendingPromptTitle: TaskTitle.nullable().optional(),
78
- refinedTitle: TaskTitle.nullable().optional(),
79
- aiTitle: TaskTitle.nullable().optional(),
80
- oscTitle: TaskTitle.nullable().optional(),
81
- promptTitle: TaskTitle.nullable().optional()
82
- }).strict();
83
- var TASK_TITLE_SOURCE_PRIORITY = [
84
- "customTitle",
85
- "pendingPromptTitle",
86
- "refinedTitle",
87
- "aiTitle",
88
- "oscTitle",
89
- "promptTitle"
90
- ];
91
- var PersistedTaskTitle = z.object({
92
- taskTitle: TaskTitle.min(1),
93
- isCustom: z.boolean(),
94
- sources: TaskTitleSources
95
- }).strict().refine(({ taskTitle, isCustom, sources }) => {
96
- const source = TASK_TITLE_SOURCE_PRIORITY.find((candidate) => sources[candidate]?.trim());
97
- if (!source) return false;
98
- return sources[source]?.replace(/\s+/g, " ").trim() === taskTitle && isCustom === (source === "customTitle");
99
- });
100
- var ProjectConfig = z.object({
101
- id: z.string().optional(),
102
- name: z.string().optional(),
103
- customTitle: TaskTitle.optional(),
104
- taskTitleState: PersistedTaskTitle.optional().catch(void 0),
105
- prLinks: SessionPrLinks.optional().catch(void 0),
106
- path: z.string(),
107
- repos: z.array(z.string()).min(2).optional(),
108
- baseBranch: z.string().refine(isGitBranchName, { error: "projects[].baseBranch must be a git branch name" }).optional(),
109
- agent: z.string({ error: "projects[].agent must be a string" }).regex(AGENT_ID_RE, { error: `projects[].agent must be ${AGENT_ID_SHAPE_MESSAGE}` }).optional(),
110
- codexBypassHookTrust: z.boolean().optional(),
111
- conversationView: z.boolean({ error: "projects[].conversationView must be a boolean" }).optional(),
112
- dangerouslySkipPermissions: z.boolean({ error: "projects[].dangerouslySkipPermissions must be a boolean" }).optional(),
113
- unguarded: z.boolean({ error: "projects[].unguarded must be a boolean" }).optional(),
114
- factoryProfile: FactorySettings.unwrap().unwrap().extend({
115
- focusedTestCommand: z.string().trim().min(1).optional(),
116
- widenableScopes: z.array(z.string().trim().min(1)).optional()
117
- }).optional()
118
- }).passthrough();
119
- var FILE_CONFIG_SHAPE = {
120
- ...BROWSER_CONFIG_SHAPE,
121
- changeMap: ChangeMapSettings,
122
- branchGc: optionalLooseObject("branchGc"),
123
- coder: z.object({ appSlug: z.string().optional() }).loose().optional(),
124
- visions: optionalLooseObject("visions"),
125
- github: GithubSettings,
126
- teamReview: optionalLooseObject("teamReview"),
127
- benchmarks: optionalLooseObject("benchmarks"),
128
- factory: FactorySettings,
129
- knowledgeGraph: optionalLooseObject("knowledgeGraph"),
130
- posthog: optionalLooseObject("posthog"),
131
- usage: optionalLooseObject("usage"),
132
- telegram: optionalLooseObject("telegram"),
133
- ingest: optionalLooseObject("ingest"),
134
- workflows: optionalLooseObject("workflows"),
135
- guardrails: GuardrailsFileSettings,
136
- telemetry: TelemetryFileSettings,
137
- trace: TraceSettings,
138
- planReview: PlanReviewSettings,
139
- customAgents: CustomAgentDeclarations.optional()
140
- };
141
- var Config = z.object({
142
- ...FILE_CONFIG_SHAPE,
143
- detectScheduledWakeups: optionalBoolean("detectScheduledWakeups"),
144
- worktreeAutoRebase: optionalBoolean("worktreeAutoRebase"),
145
- worktreeSyncOnStart: optionalBoolean("worktreeSyncOnStart"),
146
- worktreeRerere: optionalBoolean("worktreeRerere"),
147
- postTurnChecks: z.record(z.string(), z.unknown()).optional(),
148
- hooks: z.unknown().optional(),
149
- remote: z.object({
150
- enabled: z.boolean().optional(),
151
- port: z.number().int().min(1).max(65535).nullable().optional(),
152
- publicHost: z.string().optional(),
153
- allowedOrigins: z.array(z.string()).optional(),
154
- ownerLogin: z.string().optional()
155
- }).passthrough().optional(),
156
- projects: z.array(ProjectConfig)
157
- }).passthrough().superRefine((config, ctx) => {
158
- if (!Array.isArray(config.projects)) return;
159
- const declaredAgentIds = new Set(BUILTIN_AGENT_IDS);
160
- for (const declaration of config.customAgents ?? []) declaredAgentIds.add(declaration.id);
161
- for (const [index, project] of config.projects.entries()) {
162
- const agent = project?.agent;
163
- if (typeof agent !== "string" || !AGENT_ID_RE.test(agent)) continue;
164
- if (declaredAgentIds.has(agent)) continue;
165
- ctx.addIssue({
166
- code: "custom",
167
- path: [
168
- "projects",
169
- index,
170
- "agent"
171
- ],
172
- message: `projects[${index}].agent "${agent}" names no known agent; declare it under customAgents or use one of ${[...declaredAgentIds].join(", ")}`
173
- });
174
- }
175
- });
176
- var CONFIG_BLOCK_KEYS = Object.freeze([
177
- "changeMap",
178
- "taskTitle",
179
- "branchGc",
180
- "postTurnChecks",
181
- "visions",
182
- "github",
183
- "teamReview",
184
- "benchmarks",
185
- "factory",
186
- "knowledgeGraph",
187
- "posthog",
188
- "usage",
189
- "telegram",
190
- "ingest",
191
- "guardrails",
192
- "telemetry",
193
- "workflows",
194
- "coder"
195
- ]);
196
- var CONFIG_SCALAR_KEYS = Object.freeze(Object.keys(BROWSER_CONFIG_SHAPE).filter((key) => {
197
- if (CONFIG_BLOCK_KEYS.includes(key)) return false;
198
- return key !== "port" && key !== "repoRoots" && key !== "worktreeShare";
199
- }));
200
- var RUNTIME_CONFIG_SCALAR_KEYS = Object.freeze([
201
- ...CONFIG_SCALAR_KEYS,
202
- "worktreeAutoRebase",
203
- "worktreeSyncOnStart",
204
- "worktreeRerere"
205
- ]);
206
- Object.freeze([
207
- "detectScheduledWakeups",
208
- "worktreeAutoRebase",
209
- "worktreeSyncOnStart",
210
- "worktreeRerere",
211
- "hooks",
212
- "remote",
213
- "projects"
214
- ]);
215
- function configIssueMessage(error) {
216
- return error.issues[0]?.message || "settings are invalid";
217
- }
218
- //#endregion
219
- export { ConfigUpdate as a, RUNTIME_CONFIG_SCALAR_KEYS as c, Config as i, TASK_TITLE_SOURCE_PRIORITY as l, BUILTIN_AGENT_IDS as n, PersistedTaskTitle as o, BrowserConfig as r, ProjectConfig as s, AGENT_ID_SHAPE_MESSAGE as t, configIssueMessage as u };
@@ -1 +0,0 @@
1
- export { s as loadConfigFile } from "./config-store-BUNZs4j7.js";
@@ -1,240 +0,0 @@
1
- import { A as SessionState } from "./session-BlT68ppa.js";
2
- import { Q as CoherenceRisk, X as CoherenceOrient, Z as CoherenceReadiness, nt as CoherenceWorkState, s as FactorySettings } from "./browser-config-BrBT8269.js";
3
- import { z } from "zod";
4
- //#region shared/contracts/factory.ts
5
- var FactoryConsequences = z.looseObject({ records: z.array(z.looseObject({
6
- from: z.object({
7
- kind: z.string(),
8
- id: z.string()
9
- }),
10
- relation: z.string(),
11
- to: z.object({
12
- kind: z.string(),
13
- id: z.string()
14
- }),
15
- session: z.string().optional(),
16
- evidence: z.string().optional()
17
- })) });
18
- var confirmedFlakes = z.array(z.string().min(1)).max(256);
19
- var FactoryProjectState = z.object({
20
- projectId: z.string(),
21
- projectName: z.string(),
22
- headSha: z.string().nullable(),
23
- paused: z.boolean(),
24
- orchestrator: z.object({
25
- sessionId: z.string(),
26
- intentId: z.string(),
27
- state: SessionState
28
- }).nullable(),
29
- liveWorkers: z.array(z.object({
30
- workId: z.string(),
31
- sessionId: z.string()
32
- })).optional(),
33
- reviewing: z.array(z.string()).optional(),
34
- note: z.string().nullable().optional(),
35
- spentTodayUsd: z.number().finite().nonnegative().optional(),
36
- dailyBudgetUsd: z.number().finite().nonnegative().nullable().optional(),
37
- verifierIntentIds: z.array(z.string()).optional(),
38
- confirmedFlakesByIntent: z.record(z.string().min(1), confirmedFlakes).optional(),
39
- partialIntentIds: z.array(z.string()).optional(),
40
- factoryProfile: FactorySettings.unwrap().unwrap().pick({ checks: true }).extend({
41
- focusedTestCommand: z.string().trim().min(1).optional(),
42
- widenableScopes: z.array(z.string().trim().min(1)).optional()
43
- }).optional(),
44
- error: z.string().nullable(),
45
- heading: z.object({
46
- action: CoherenceOrient.shape.action,
47
- reasons: z.array(z.string())
48
- }),
49
- orders: z.array(z.object({
50
- id: z.string(),
51
- objective: z.string(),
52
- openedAt: z.iso.datetime(),
53
- criteria: z.array(z.string()),
54
- boundary: z.string(),
55
- risk: CoherenceRisk,
56
- state: CoherenceWorkState,
57
- readiness: CoherenceReadiness,
58
- parent: z.string().nullable(),
59
- dependsOn: z.array(z.string()),
60
- writeScopes: z.array(z.string()),
61
- owner: z.string().nullable(),
62
- blockReason: z.string().nullable().optional(),
63
- parked: z.boolean().optional(),
64
- blockCount: z.number().int().nonnegative().optional(),
65
- lastEvent: z.object({
66
- event: z.string(),
67
- at: z.string(),
68
- session: z.string()
69
- }).nullable()
70
- })),
71
- conflicts: z.array(z.object({
72
- left: z.string(),
73
- right: z.string(),
74
- scope: z.string()
75
- })),
76
- unverifiedCompletedWork: z.array(z.string()),
77
- observedRun: z.object({
78
- recordDirectory: z.string(),
79
- outcome: z.string().nullable()
80
- }).optional()
81
- });
82
- var FactoryState = z.object({
83
- type: z.literal("factory-state"),
84
- ts: z.number().finite(),
85
- projects: z.array(FactoryProjectState)
86
- });
87
- var FactoryHarnessStateLine = z.object({
88
- arrivedAt: z.string(),
89
- state: FactoryState
90
- });
91
- var FactoryHarnessVerdict = z.looseObject({
92
- outcome: z.enum([
93
- "pass",
94
- "partial",
95
- "fail"
96
- ]),
97
- failureClass: z.string().nullable().optional()
98
- });
99
- var FACTORY_ERROR_MAX_CHARS = 16384;
100
- function isSingleFactoryPathSegment(value) {
101
- return value !== "." && value !== ".." && !/[/\\]/.test(value);
102
- }
103
- var projectId = z.string().trim().min(1).max(128).refine(isSingleFactoryPathSegment, "Invalid factory project id");
104
- var intentText = z.string().trim().min(1).max(4096);
105
- var scopeText = z.string().trim().min(1).max(1024);
106
- var FACTORY_INTENT_TICKET_LIMIT = 32;
107
- var ticketKey = z.string().trim().min(1).max(64);
108
- var FACTORY_PROTECTED_PATH_FLOOR = [
109
- "**/package.json",
110
- "**/package-lock.json",
111
- "**/npm-shrinkwrap.json",
112
- "**/yarn.lock",
113
- "**/pnpm-lock.yaml",
114
- "**/bun.lock",
115
- "**/bun.lockb",
116
- "**/.npmrc",
117
- "**/.yarnrc",
118
- "**/.yarnrc.yml",
119
- "**/pnpm-workspace.yaml",
120
- "**/.pnpmfile.cjs",
121
- "**/tsconfig*.json",
122
- "**/biome.json",
123
- "**/biome.jsonc",
124
- "**/vite.config.*",
125
- "**/vitest.config.*",
126
- "**/vitest.workspace.*",
127
- "**/jest.config.*",
128
- "**/.mocharc*",
129
- "**/playwright.config.*"
130
- ];
131
- var FactoryFloorAllowance = z.enum(FACTORY_PROTECTED_PATH_FLOOR);
132
- var floorAllowances = z.array(FactoryFloorAllowance).max(FACTORY_PROTECTED_PATH_FLOOR.length);
133
- var FactoryIntentTicket = z.object({
134
- id: ticketKey,
135
- objective: intentText,
136
- criteria: z.array(intentText).min(1).max(12),
137
- dependsOn: z.array(ticketKey).max(FACTORY_INTENT_TICKET_LIMIT),
138
- writeScopes: z.array(scopeText).min(1).max(32)
139
- });
140
- var FactoryQueueIntentRequest = z.object({
141
- projectId,
142
- objective: intentText,
143
- criteria: z.array(intentText).min(1).max(12),
144
- risk: CoherenceRisk,
145
- boundary: intentText,
146
- writeScopes: z.array(scopeText).max(32),
147
- tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT).optional(),
148
- floorAllowances: floorAllowances.optional()
149
- });
150
- var AgentFactoryQueueRequest = FactoryQueueIntentRequest.omit({
151
- projectId: true,
152
- floorAllowances: true
153
- }).strict();
154
- var FactoryQueueIntentResult = z.object({
155
- projectId: z.string().max(128),
156
- ok: z.boolean(),
157
- workId: z.string().min(1).max(128).optional(),
158
- error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
159
- });
160
- var FactoryControlRequest = z.object({
161
- projectId,
162
- action: z.enum([
163
- "pause",
164
- "resume",
165
- "retry-parked",
166
- "rerun-setup"
167
- ]),
168
- intentId: z.string().trim().min(1).max(128).optional()
169
- }).refine((request) => request.action !== "retry-parked" || request.intentId !== void 0, {
170
- message: "Retry parked requires an intentId",
171
- path: ["intentId"]
172
- });
173
- var FactoryControlResult = z.object({
174
- projectId: z.string().max(128),
175
- action: FactoryControlRequest.shape.action,
176
- ok: z.boolean(),
177
- reopenedWorkIds: z.array(z.string().min(1)).optional(),
178
- error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
179
- });
180
- var FactoryReviewVerdict = z.object({
181
- pass: z.boolean(),
182
- findings: z.array(z.string())
183
- }).strict();
184
- var FactoryReviewerOutput = z.object({
185
- type: z.literal("result"),
186
- subtype: z.literal("success"),
187
- is_error: z.literal(false),
188
- structured_output: FactoryReviewVerdict
189
- });
190
- var FactoryUnlandedRecord = z.object({
191
- id: z.string().min(1).max(1024),
192
- path: z.string().min(1).max(4096),
193
- line: z.string().min(1).regex(/^[^\n]*$/)
194
- });
195
- var FactoryLaneState = z.object({
196
- ledgerPath: z.string().min(1).max(4096).nullable(),
197
- ledgerBranch: z.string().min(1).max(1024).nullable(),
198
- paused: z.boolean(),
199
- trustedVerifications: z.array(z.object({
200
- id: z.string().min(1),
201
- sha: z.string().regex(/^[a-f0-9]{40,64}$/)
202
- })).optional(),
203
- trustedIntentCloses: z.array(z.string().min(1)).optional(),
204
- pendingVerifierTrusts: z.array(z.object({
205
- intentId: z.string().min(1),
206
- sha: z.string().regex(/^[a-f0-9]{40,64}$/),
207
- records: z.array(FactoryUnlandedRecord).min(1)
208
- })).optional(),
209
- trustedIntentIds: z.array(z.string().min(1)).optional(),
210
- intentWriteScopes: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
211
- intentFloorAllowances: z.record(z.string().min(1), floorAllowances).optional(),
212
- intentConfirmedFlakes: z.record(z.string().min(1), confirmedFlakes).optional(),
213
- intentScopeNeeds: z.record(z.string().min(1), z.array(z.string().min(1)).max(256)).optional(),
214
- ticketedIntentIds: z.array(z.string().min(1)).optional(),
215
- pendingIntentTickets: z.record(z.string().min(1), z.object({
216
- risk: CoherenceRisk,
217
- boundary: intentText,
218
- tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT)
219
- })).optional(),
220
- intentBaseShas: z.record(z.string().min(1), z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
221
- factoryLandedShas: z.array(z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
222
- unlandedFactoryRecords: z.array(FactoryUnlandedRecord).optional(),
223
- ticketBlockCounts: z.record(z.string().min(1), z.number().int().nonnegative()).optional(),
224
- notifiedIntentOutcomes: z.array(z.string().min(1)).optional()
225
- });
226
- var FactoryWorkerEvent = z.object({
227
- workId: z.string().min(1),
228
- event: z.string().min(1),
229
- sessionId: z.string().optional(),
230
- detail: z.string().optional()
231
- });
232
- z.discriminatedUnion("ok", [z.object({
233
- ok: z.literal(true),
234
- sessionId: z.string()
235
- }), z.object({
236
- ok: z.literal(false),
237
- reason: z.string()
238
- })]);
239
- //#endregion
240
- export { isSingleFactoryPathSegment as _, FactoryControlRequest as a, FactoryHarnessVerdict as c, FactoryQueueIntentRequest as d, FactoryQueueIntentResult as f, FactoryWorkerEvent as g, FactoryState as h, FactoryConsequences as i, FactoryLaneState as l, FactoryReviewerOutput as m, FACTORY_ERROR_MAX_CHARS as n, FactoryControlResult as o, FactoryReviewVerdict as p, FACTORY_PROTECTED_PATH_FLOOR as r, FactoryHarnessStateLine as s, AgentFactoryQueueRequest as t, FactoryProjectState as u };