glimmervoid 0.38.0 → 0.38.2
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/dist/bin/glimmervoid.js +17 -15
- package/dist/chunks/{adapters-B-IkWl-r.js → adapters-CAHxZYT3.js} +4 -4
- package/dist/chunks/{adapters-Dt3vwxwY.js → adapters-DDjC7_vG.js} +1 -1
- package/dist/chunks/{agent-api-cli-BcZ9DLCF.js → agent-api-cli-B5Tm0wXO.js} +27 -8
- package/dist/chunks/{agent-api-cli-3hryuewm.js → agent-api-cli-BDu1CxZf.js} +1 -1
- package/dist/chunks/{agent-api-core--8WtU1xU.js → agent-api-core-B_mUSenR.js} +36 -4
- package/dist/chunks/{agent-setup-cli-BixDoCkF.js → agent-setup-cli-DmMfCw5O.js} +1 -1
- package/dist/chunks/{config-BHBZsCBc.js → browser-config-BrBT8269.js} +2 -217
- package/dist/chunks/config-CjawSOBk.js +219 -0
- package/dist/chunks/{config-store-DbfMbz4j.js → config-store-BUNZs4j7.js} +4 -3
- package/dist/chunks/config-store-MAVQhGMh.js +1 -0
- package/dist/chunks/{contracts-u40eJhaf.js → contracts-HVCEJfxs.js} +6 -239
- package/dist/chunks/factory-D7ryES9n.js +240 -0
- package/dist/chunks/{git-version-BpnTd8sU.js → git-version-rWZjF2Px.js} +1 -1
- package/dist/chunks/{grok-xFs6zIu4.js → grok-B6bsCgdd.js} +2 -2
- package/dist/chunks/{hook-tools-BkxllUHE.js → hook-tools-Dl7-r2Eb.js} +1 -1
- package/dist/chunks/{knowledge-graph-cli-DcspNqhz.js → knowledge-graph-cli-ByUJoKw_.js} +1 -1
- package/dist/chunks/{main-w01-P1oZ.js → main-BNSbP-Yk.js} +689 -523
- package/dist/chunks/{pair-cli-BdoyrDCr.js → pair-cli-DNp8i5L4.js} +2 -2
- package/dist/chunks/{remote-config-61zJ0hME.js → remote-config-C_s2pnLC.js} +1 -1
- package/dist/chunks/{rtk-hook-core-VrUafGAp.js → rtk-hook-core-B-MpzPin.js} +89 -83
- package/dist/chunks/rtk-resolver-BGE6Hd_L.js +1 -0
- package/dist/chunks/{rtk-resolver-C_micGrL.js → rtk-resolver-BgoPsEhT.js} +1 -1
- package/dist/chunks/{session-8Pv0y1vz.js → session-BlT68ppa.js} +5 -2
- package/dist/chunks/{session-routes-D-GZC-Sy.js → session-routes-CT1JrjoT.js} +1 -1
- package/dist/chunks/{settings-cli-DKJsm3AP.js → settings-cli-BbzxCyG5.js} +3 -3
- package/dist/chunks/{ssh-sign-cli-Dc2gOCwE.js → ssh-sign-cli-C74BGTQS.js} +2 -2
- package/dist/client/assets/index-B5uVtedd.css +1 -0
- package/dist/client/assets/index-b13-NGGS.js +275 -0
- package/dist/client/index.html +3 -2
- package/dist/server/index.js +1 -1
- package/dist/session/hook-tool-relay.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/config-store-DYj3wYgw.js +0 -1
- package/dist/chunks/rtk-resolver-B8BPgN9L.js +0 -1
- package/dist/client/assets/index-BfqmOGgc.js +0 -275
- package/dist/client/assets/index-DxABp5yJ.css +0 -1
|
@@ -0,0 +1,219 @@
|
|
|
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 };
|
|
@@ -2,9 +2,10 @@ import { n as errorLabel, r as errorMessage } from "./text-DoirglWV.js";
|
|
|
2
2
|
import { n as equalsIgnoringCaseOnWindows } from "./paths-Bu4eH1Yd.js";
|
|
3
3
|
import { n as glimmervoidHomeDir$1, t as decideConfigPath } from "./config-path-core-DFt-TemS.js";
|
|
4
4
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
5
|
+
import { A as FLYING_ANIMALS_DURATION_RANGE, B as POSTHOG_TRAFFIC_MIN_USERS_RANGE, D as CHANGE_MAP_NARRATOR_TIMEOUT_RANGE, E as normalizeLegacyConfigNumbers, F as NON_NEGATIVE_NUMBER_RANGE, G as USAGE_INTEGER_RANGES, H as REPLAY_BUFFER_KB_RANGE, I as PORT_RANGE, J as WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE, K as USAGE_RETAIN_DAYS_RANGE, L as POSITIVE_NUMBER_RANGE, M as FLYING_ANIMALS_SCALE_RANGE, N as KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE, O as FACTORY_MAX_LIVE_WORKERS_RANGE, P as MEMORY_RESERVE_MB_RANGE, R as POSTHOG_FIX_TIMEOUT_RANGE, U as TASK_TITLE_TIMEOUT_RANGE, V as POSTHOG_TRAFFIC_MULTIPLIER_RANGE, W as USAGE_BUDGET_RANGE, Y as WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE, a as DEFAULT_FACTORY_CHECKS, j as FLYING_ANIMALS_GAP_RANGE, k as FLYING_ANIMALS_DEFAULTS, m as UPDATE_CHANNELS, n as BranchGcFileSettings, o as DEFAULT_FACTORY_PROTECTED_PATHS, q as USAGE_SCAN_INTERVAL_RANGE, r as CHANGE_MAP_NARRATOR_ENGINES, u as POST_TURN_CHECK_MODES, w as USAGE_COST_MODES, z as POSTHOG_TRAFFIC_BASELINE_RANGE } from "./browser-config-BrBT8269.js";
|
|
5
6
|
import { b as DEFAULT_CHECK_MEMORY_RESERVE_MB, d as writeJsonAtomicSync, f as writeTextAtomic, p as writeTextAtomicSync } from "./json-file-CIJf0Cel.js";
|
|
6
|
-
import {
|
|
7
|
-
import { K as TELEMETRY_KILL_SWITCH_FLAG, U as FeatureFlagsResponse } from "./contracts-
|
|
7
|
+
import { c as RUNTIME_CONFIG_SCALAR_KEYS, i as Config, n as BUILTIN_AGENT_IDS, t as AGENT_ID_SHAPE_MESSAGE, u as configIssueMessage } from "./config-CjawSOBk.js";
|
|
8
|
+
import { K as TELEMETRY_KILL_SWITCH_FLAG, U as FeatureFlagsResponse } from "./contracts-HVCEJfxs.js";
|
|
8
9
|
import fs from "node:fs";
|
|
9
10
|
import path from "node:path";
|
|
10
11
|
import os from "node:os";
|
|
@@ -999,7 +1000,7 @@ var SECTIONS = Object.freeze([
|
|
|
999
1000
|
id: "auto-resume",
|
|
1000
1001
|
path: "autoResume",
|
|
1001
1002
|
title: "Auto-resume sessions on startup",
|
|
1002
|
-
description: "Resume conversations that were live when Glimmervoid last shut down or crashed, and tell sessions that were mid-turn to continue.",
|
|
1003
|
+
description: "Resume conversations that were live when Glimmervoid last shut down or crashed, and tell sessions that were mid-turn, or had a background agent, monitor or scheduled wakeup in flight, to continue.",
|
|
1003
1004
|
control: "toggle",
|
|
1004
1005
|
keywords: ["startup", "conversation"],
|
|
1005
1006
|
defaultValue: true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { s as loadConfigFile } from "./config-store-BUNZs4j7.js";
|
|
@@ -1,238 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { $ as SessionPrLinks, A as SessionState, B as MyPrKeepMergeableResult, F as LinkedPr, Ft as REPO_SLUG_RE, G as MyPrMergeWhenReadyRequest, H as MyPrMergeRequest, K as MyPrMergeWhenReadyResult, Lt as GithubPollingRefreshRequest, O as SessionDoc, Ot as hasRequiredActionHead, P as TaskTitle, Q as MyPrsStatus, Rt as GithubPollingRefreshResult, St as TeamReviewStatus, T as SESSION_DOC_PATH_MAX_CHARS, U as MyPrMergeResult, _ as ConversationApproval, _t as TeamReviewActionRequest, g as ConversationAnswers, k as SessionSnapshot, tt as CommitSha, v as ConversationApprovalDecision, vt as TeamReviewActionResult, x as PendingWakeup, z as MyPrKeepMergeableRequest, zt as githubPollingShape } from "./session-BlT68ppa.js";
|
|
2
|
+
import "./browser-config-BrBT8269.js";
|
|
3
|
+
import { _ as isSingleFactoryPathSegment, a as FactoryControlRequest, d as FactoryQueueIntentRequest, f as FactoryQueueIntentResult, h as FactoryState, o as FactoryControlResult, p as FactoryReviewVerdict } from "./factory-D7ryES9n.js";
|
|
4
|
+
import { n as BUILTIN_AGENT_IDS } from "./config-CjawSOBk.js";
|
|
3
5
|
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 FactoryQueueIntentResult = z.object({
|
|
151
|
-
projectId: z.string().max(128),
|
|
152
|
-
ok: z.boolean(),
|
|
153
|
-
workId: z.string().min(1).max(128).optional(),
|
|
154
|
-
error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
|
|
155
|
-
});
|
|
156
|
-
var FactoryControlRequest = z.object({
|
|
157
|
-
projectId,
|
|
158
|
-
action: z.enum([
|
|
159
|
-
"pause",
|
|
160
|
-
"resume",
|
|
161
|
-
"retry-parked",
|
|
162
|
-
"rerun-setup"
|
|
163
|
-
]),
|
|
164
|
-
intentId: z.string().trim().min(1).max(128).optional()
|
|
165
|
-
}).refine((request) => request.action !== "retry-parked" || request.intentId !== void 0, {
|
|
166
|
-
message: "Retry parked requires an intentId",
|
|
167
|
-
path: ["intentId"]
|
|
168
|
-
});
|
|
169
|
-
var FactoryControlResult = z.object({
|
|
170
|
-
projectId: z.string().max(128),
|
|
171
|
-
action: FactoryControlRequest.shape.action,
|
|
172
|
-
ok: z.boolean(),
|
|
173
|
-
reopenedWorkIds: z.array(z.string().min(1)).optional(),
|
|
174
|
-
error: z.string().max(FACTORY_ERROR_MAX_CHARS).optional()
|
|
175
|
-
});
|
|
176
|
-
var FactoryReviewVerdict = z.object({
|
|
177
|
-
pass: z.boolean(),
|
|
178
|
-
findings: z.array(z.string())
|
|
179
|
-
}).strict();
|
|
180
|
-
var FactoryReviewerOutput = z.object({
|
|
181
|
-
type: z.literal("result"),
|
|
182
|
-
subtype: z.literal("success"),
|
|
183
|
-
is_error: z.literal(false),
|
|
184
|
-
structured_output: FactoryReviewVerdict
|
|
185
|
-
});
|
|
186
|
-
var FactoryUnlandedRecord = z.object({
|
|
187
|
-
id: z.string().min(1).max(1024),
|
|
188
|
-
path: z.string().min(1).max(4096),
|
|
189
|
-
line: z.string().min(1).regex(/^[^\n]*$/)
|
|
190
|
-
});
|
|
191
|
-
var FactoryLaneState = z.object({
|
|
192
|
-
ledgerPath: z.string().min(1).max(4096).nullable(),
|
|
193
|
-
ledgerBranch: z.string().min(1).max(1024).nullable(),
|
|
194
|
-
paused: z.boolean(),
|
|
195
|
-
trustedVerifications: z.array(z.object({
|
|
196
|
-
id: z.string().min(1),
|
|
197
|
-
sha: z.string().regex(/^[a-f0-9]{40,64}$/)
|
|
198
|
-
})).optional(),
|
|
199
|
-
trustedIntentCloses: z.array(z.string().min(1)).optional(),
|
|
200
|
-
pendingVerifierTrusts: z.array(z.object({
|
|
201
|
-
intentId: z.string().min(1),
|
|
202
|
-
sha: z.string().regex(/^[a-f0-9]{40,64}$/),
|
|
203
|
-
records: z.array(FactoryUnlandedRecord).min(1)
|
|
204
|
-
})).optional(),
|
|
205
|
-
trustedIntentIds: z.array(z.string().min(1)).optional(),
|
|
206
|
-
intentWriteScopes: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
|
|
207
|
-
intentFloorAllowances: z.record(z.string().min(1), floorAllowances).optional(),
|
|
208
|
-
intentConfirmedFlakes: z.record(z.string().min(1), confirmedFlakes).optional(),
|
|
209
|
-
intentScopeNeeds: z.record(z.string().min(1), z.array(z.string().min(1)).max(256)).optional(),
|
|
210
|
-
ticketedIntentIds: z.array(z.string().min(1)).optional(),
|
|
211
|
-
pendingIntentTickets: z.record(z.string().min(1), z.object({
|
|
212
|
-
risk: CoherenceRisk,
|
|
213
|
-
boundary: intentText,
|
|
214
|
-
tickets: z.array(FactoryIntentTicket).min(1).max(FACTORY_INTENT_TICKET_LIMIT)
|
|
215
|
-
})).optional(),
|
|
216
|
-
intentBaseShas: z.record(z.string().min(1), z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
|
|
217
|
-
factoryLandedShas: z.array(z.string().regex(/^[a-f0-9]{40,64}$/)).optional(),
|
|
218
|
-
unlandedFactoryRecords: z.array(FactoryUnlandedRecord).optional(),
|
|
219
|
-
ticketBlockCounts: z.record(z.string().min(1), z.number().int().nonnegative()).optional(),
|
|
220
|
-
notifiedIntentOutcomes: z.array(z.string().min(1)).optional()
|
|
221
|
-
});
|
|
222
|
-
var FactoryWorkerEvent = z.object({
|
|
223
|
-
workId: z.string().min(1),
|
|
224
|
-
event: z.string().min(1),
|
|
225
|
-
sessionId: z.string().optional(),
|
|
226
|
-
detail: z.string().optional()
|
|
227
|
-
});
|
|
228
|
-
z.discriminatedUnion("ok", [z.object({
|
|
229
|
-
ok: z.literal(true),
|
|
230
|
-
sessionId: z.string()
|
|
231
|
-
}), z.object({
|
|
232
|
-
ok: z.literal(false),
|
|
233
|
-
reason: z.string()
|
|
234
|
-
})]);
|
|
235
|
-
//#endregion
|
|
236
6
|
//#region shared/contracts/factory-decision-log.ts
|
|
237
7
|
var FACTORY_DECISION_OUTPUT_MAX_BYTES = 16384;
|
|
238
8
|
var FactoryDecisionKind = z.enum([
|
|
@@ -1525,10 +1295,7 @@ var clientVariants = [
|
|
|
1525
1295
|
loose("focus-change", { focused: z.boolean() }),
|
|
1526
1296
|
loose("request-health-snapshot"),
|
|
1527
1297
|
loose("update-check"),
|
|
1528
|
-
loose("update-apply",
|
|
1529
|
-
restartWhenStaged: z.boolean().optional(),
|
|
1530
|
-
confirmedSessionIds: z.array(z.string().min(1)).max(1e3).optional()
|
|
1531
|
-
}),
|
|
1298
|
+
loose("update-apply"),
|
|
1532
1299
|
loose("session-trace", {
|
|
1533
1300
|
id: sessionId,
|
|
1534
1301
|
requestId,
|
|
@@ -2248,4 +2015,4 @@ z.object({
|
|
|
2248
2015
|
projects: z.array(z.string()).optional()
|
|
2249
2016
|
}).passthrough();
|
|
2250
2017
|
//#endregion
|
|
2251
|
-
export {
|
|
2018
|
+
export { ChangeMap as A, MergedPrListing as B, GithubIssuePullRequestsRepository as C, IssuesSearchResponse as D, IssueUpdate as E, BenchmarkJudgement as F, TELEMETRY_EVENT_SCHEMAS as G, PrCheckoutCaseInput as H, BenchmarkRun as I, FACTORY_DECISION_OUTPUT_MAX_BYTES as J, TELEMETRY_KILL_SWITCH_FLAG as K, BenchmarkStatus as L, BenchmarkActionRequest as M, BenchmarkCase as N, IssuesState as O, BenchmarkId as P, BenchmarkSuite as R, planTitle as S, IssueKey as T, FeatureFlagsResponse as U, MinedPrReviewData as V, PendingCrashReport as W, FactoryDecisionLogLine as Y, PLAN_RESULT_HOOK_EVENT as _, parseDataClientMessage as a, PlanRevision as b, DIFF_ANNOTATION_NOTE_MAX_CHARS as c, MAX_RAW_LINE_CHARS as d, TraceCheckpoint as f, PLAN_HOOK_OUTPUT_MAX_CHARS as g, PLAN_HOOK_EVENT as h, parseDataAttachHistory as i, changeMapFactId as j, IssuesStatus as k, InstallFlavor as l, PLAN_BODY_CAP_BYTES as m, HookEnvelope as n, CONTROL_FRAME_MAX_BYTES as o, TraceRecord as p, TelemetryState as q, DEEP_HISTORY_SCROLLBACK_LINES as r, ClientMessage as s, HTTP_URL_RE as t, UpdateJournal as u, PLAN_TOOL_NAME as v, GithubIssueResponse as w, parseExitPlanModeHookPayload as x, PlanDecision as y, CommitComparison as z };
|