@mossbear/protocol 0.1.0-alpha.115 → 0.1.0-alpha.116

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 (45) hide show
  1. package/dist/bundles.d.ts +662 -0
  2. package/dist/bundles.d.ts.map +1 -0
  3. package/dist/bundles.js +454 -0
  4. package/dist/bundles.js.map +1 -0
  5. package/dist/bundles.test.d.ts +2 -0
  6. package/dist/bundles.test.d.ts.map +1 -0
  7. package/dist/bundles.test.js +61 -0
  8. package/dist/bundles.test.js.map +1 -0
  9. package/dist/guideHistory.d.ts +643 -0
  10. package/dist/guideHistory.d.ts.map +1 -0
  11. package/dist/guideHistory.js +343 -0
  12. package/dist/guideHistory.js.map +1 -0
  13. package/dist/guideHistory.test.d.ts +2 -0
  14. package/dist/guideHistory.test.d.ts.map +1 -0
  15. package/dist/guideHistory.test.js +35 -0
  16. package/dist/guideHistory.test.js.map +1 -0
  17. package/dist/guideImport.d.ts +398 -0
  18. package/dist/guideImport.d.ts.map +1 -0
  19. package/dist/guideImport.js +350 -0
  20. package/dist/guideImport.js.map +1 -0
  21. package/dist/guideImport.test.d.ts +2 -0
  22. package/dist/guideImport.test.d.ts.map +1 -0
  23. package/dist/guideImport.test.js +62 -0
  24. package/dist/guideImport.test.js.map +1 -0
  25. package/dist/guideSnapshot.d.ts +105 -0
  26. package/dist/guideSnapshot.d.ts.map +1 -0
  27. package/dist/guideSnapshot.js +101 -0
  28. package/dist/guideSnapshot.js.map +1 -0
  29. package/dist/guideSnapshot.test.d.ts +2 -0
  30. package/dist/guideSnapshot.test.d.ts.map +1 -0
  31. package/dist/guideSnapshot.test.js +49 -0
  32. package/dist/guideSnapshot.test.js.map +1 -0
  33. package/dist/pairing.d.ts +1 -1
  34. package/dist/schemas.d.ts +14 -2042
  35. package/dist/schemas.d.ts.map +1 -1
  36. package/dist/schemas.js +13 -1358
  37. package/dist/schemas.js.map +1 -1
  38. package/dist/types.d.ts +4 -27
  39. package/dist/types.d.ts.map +1 -1
  40. package/dist/types.js.map +1 -1
  41. package/dist/wirePrimitives.d.ts +87 -0
  42. package/dist/wirePrimitives.d.ts.map +1 -1
  43. package/dist/wirePrimitives.js +121 -0
  44. package/dist/wirePrimitives.js.map +1 -1
  45. package/package.json +1 -1
package/dist/schemas.d.ts CHANGED
@@ -9,8 +9,14 @@
9
9
  */
10
10
  import * as v from 'valibot';
11
11
  import { MAX_ARTIFACT_DESCRIPTION_CHARS, MAX_ARTIFACT_NAME_CHARS, MAX_CONTEXT_CONTENT_BYTES, MAX_RAW_GUIDE_CONTENT_BYTES } from './limits.js';
12
- export { HarnessIdSchema, MAX_REPOSITORY_NAME_LENGTH, RepositoryNameSchema, ProjectIdSchema, MAX_ARTIFACT_FEEDBACK_BATCH, CommentAuthorKindSchema, GuideHistoryUntrustedSchema, SESSION_GUIDE_VERDICTS, SessionGuideVerdictValueSchema, } from './wirePrimitives.js';
12
+ export { GuideDiscoveryRootSchema, SafeRelativePosixPathSchema, PATH_ISSUE_MESSAGES, HarnessIdSchema, MAX_REPOSITORY_NAME_LENGTH, RepositoryNameSchema, ProjectIdSchema, MAX_ARTIFACT_FEEDBACK_BATCH, CommentAuthorKindSchema, GuideHistoryUntrustedSchema, SESSION_GUIDE_VERDICTS, SessionGuideVerdictValueSchema, } from './wirePrimitives.js';
13
13
  export type { HarnessId, CommentAuthorKind, GuideHistoryUntrusted, SessionGuideVerdictValue, } from './wirePrimitives.js';
14
+ export { RepoIdSchema, WorkspaceIdSchema } from './wirePrimitives.js';
15
+ export { ArtifactDescriptionSchema, displayNameSchema, DISPLAY_NAME_CONTROL_CHARACTER_MESSAGE, } from './wirePrimitives.js';
16
+ export * from './bundles.js';
17
+ export * from './guideImport.js';
18
+ export * from './guideSnapshot.js';
19
+ export * from './guideHistory.js';
14
20
  export * from './comments.js';
15
21
  export * from './search.js';
16
22
  export { SessionGradeRequestSchema, SessionGradeStateSchema, SessionGradeGuideSchema, SessionGradeSchema, GradedSessionSchema, SessionGradeResponseSchema, parseRunGradeRequest, parseSessionGradeResponse, } from './sessionGrade.js';
@@ -42,167 +48,7 @@ export declare const PlatformKindSchema: v.PicklistSchema<["claude_code", "codex
42
48
  */
43
49
  export declare const SessionEnvironmentSchema: v.PicklistSchema<["cloud"], undefined>;
44
50
  export type SessionEnvironment = v.InferOutput<typeof SessionEnvironmentSchema>;
45
- export declare const GuideFileFormatSchema: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
46
51
  export { MAX_ARTIFACT_DESCRIPTION_CHARS, MAX_ARTIFACT_NAME_CHARS, MAX_RAW_GUIDE_CONTENT_BYTES, };
47
- /** Max member files a single skill-md payload may carry. */
48
- export declare const MAX_SKILL_MEMBER_FILES = 64;
49
- export declare const PATH_ISSUE_MESSAGES: {
50
- readonly backslash: "path must use forward slashes";
51
- readonly absolute: "path must be relative";
52
- readonly control: "path must not contain control characters";
53
- readonly segments: "path must not contain empty, \".\" or \"..\" segments";
54
- readonly skillMd: "path must not shadow the skill’s own SKILL.md";
55
- };
56
- export declare const SafeRelativePosixPathSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
57
- export declare const SkillMemberPathSchema: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, v.CheckAction<string, "path must not shadow the skill’s own SKILL.md">]>;
58
- export declare const RawSkillMemberFileSchema: v.ObjectSchema<{
59
- readonly path: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, v.CheckAction<string, "path must not shadow the skill’s own SKILL.md">]>;
60
- readonly rawContent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
61
- readonly lastModified: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
62
- readonly content_hash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
63
- /**
64
- * Whether the file is executable (`100755` in git), so delivery writes it
65
- * `0o755` or `0o644`. A boolean rather than a mode because git records only
66
- * those two for a blob, and a numeric mode would be a channel for bits
67
- * nothing here should set. **Absent is not `false`**: a CLI that predates the
68
- * field sends none, and the server then keeps whatever it already holds.
69
- */
70
- readonly executable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
71
- }, undefined>;
72
- /** Max skipped-member paths a skill-md payload may report alongside `members`. */
73
- export declare const MAX_SKILL_SKIPPED_MEMBER_PATHS = 256;
74
- /**
75
- * Which root a discovered guide file's `path` is relative to: the repo checkout
76
- * (`project`) or the user's homedir (`global`, e.g. `.claude/CLAUDE.md`).
77
- * Part of the import resolution key — see `RawGuideFilePayloadSchema.root`.
78
- */
79
- export declare const GuideDiscoveryRootSchema: v.PicklistSchema<["project", "global"], undefined>;
80
- export declare const GuideSnapshotSchema: v.ObjectSchema<{
81
- readonly id: v.StringSchema<undefined>;
82
- readonly title: v.StringSchema<undefined>;
83
- readonly content: v.StringSchema<undefined>;
84
- readonly enabled: v.BooleanSchema<undefined>;
85
- readonly updatedAt: v.StringSchema<undefined>;
86
- readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
87
- readonly contentHash: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, undefined>;
88
- readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
89
- readonly path: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>, undefined>;
90
- }, undefined>;
91
- export declare const GuideBundleResponseSchema: v.ObjectSchema<{
92
- readonly guides: v.ArraySchema<v.ObjectSchema<{
93
- readonly id: v.StringSchema<undefined>;
94
- readonly title: v.StringSchema<undefined>;
95
- readonly content: v.StringSchema<undefined>;
96
- readonly enabled: v.BooleanSchema<undefined>;
97
- readonly updatedAt: v.StringSchema<undefined>;
98
- readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
99
- readonly contentHash: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, undefined>;
100
- readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
101
- readonly path: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>, undefined>;
102
- }, undefined>, undefined>;
103
- readonly pulledAt: v.StringSchema<undefined>;
104
- }, undefined>;
105
- export declare const RawGuideFilePayloadSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
106
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
107
- readonly root: v.OptionalSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
108
- readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
109
- readonly rawContent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
110
- readonly lastModified: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
111
- readonly content_hash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
112
- readonly members: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
113
- readonly path: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, v.CheckAction<string, "path must not shadow the skill’s own SKILL.md">]>;
114
- readonly rawContent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
115
- readonly lastModified: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
116
- readonly content_hash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
117
- /**
118
- * Whether the file is executable (`100755` in git), so delivery writes it
119
- * `0o755` or `0o644`. A boolean rather than a mode because git records only
120
- * those two for a blob, and a numeric mode would be a channel for bits
121
- * nothing here should set. **Absent is not `false`**: a CLI that predates the
122
- * field sends none, and the server then keeps whatever it already holds.
123
- */
124
- readonly executable: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
125
- }, undefined>, undefined>, v.MaxLengthAction<{
126
- path: string;
127
- rawContent: string;
128
- lastModified: number;
129
- content_hash: string;
130
- executable?: boolean | undefined;
131
- }[], 64, undefined>]>, undefined>;
132
- /**
133
- * The body-item version this machine last agreed with the server about for
134
- * this `(scope, root, path)` — the machine-local baseline
135
- * (`guide-versioned-identity-plan.md` → slice 2b-B, D10 in
136
- * `context-bundle-authoring-plan.md`).
137
- *
138
- * It is the *client* half of the reconcile precondition, and it exists to
139
- * answer a question the server cannot: whether the bytes on this disk were
140
- * edited **from** the version the server currently holds, or from an older
141
- * one. The server-only guard shipped in 2b-A can see that a dashboard edit
142
- * exists, never that this machine has already seen it — so a guide the
143
- * dashboard edited and the user then re-synced to disk forks forever.
144
- *
145
- * **Optional, and its absence is not an error.** A CLI predating the
146
- * baseline store, a fresh machine, or a deleted `~/.mossbear/state/` sends
147
- * none, and the payload falls back to the server-only guard exactly as it
148
- * behaves today. Absence therefore degrades to "decline and fork", never to
149
- * an overwrite; a *stale* value degrades to a reported conflict.
150
- */
151
- readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
152
- readonly skippedMemberPaths: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>, undefined>, v.MaxLengthAction<string[], 256, undefined>]>, undefined>;
153
- }, undefined>, v.CheckAction<{
154
- path: string;
155
- root?: "project" | "global" | undefined;
156
- format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
157
- rawContent: string;
158
- lastModified: number;
159
- content_hash: string;
160
- members?: {
161
- path: string;
162
- rawContent: string;
163
- lastModified: number;
164
- content_hash: string;
165
- executable?: boolean | undefined;
166
- }[] | undefined;
167
- expectedVersion?: number | undefined;
168
- skippedMemberPaths?: string[] | undefined;
169
- }, "members are only supported on skill-md payloads">, v.CheckAction<{
170
- path: string;
171
- root?: "project" | "global" | undefined;
172
- format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
173
- rawContent: string;
174
- lastModified: number;
175
- content_hash: string;
176
- members?: {
177
- path: string;
178
- rawContent: string;
179
- lastModified: number;
180
- content_hash: string;
181
- executable?: boolean | undefined;
182
- }[] | undefined;
183
- expectedVersion?: number | undefined;
184
- skippedMemberPaths?: string[] | undefined;
185
- }, "skippedMemberPaths requires members">, v.CheckAction<{
186
- path: string;
187
- root?: "project" | "global" | undefined;
188
- format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
189
- rawContent: string;
190
- lastModified: number;
191
- content_hash: string;
192
- members?: {
193
- path: string;
194
- rawContent: string;
195
- lastModified: number;
196
- content_hash: string;
197
- executable?: boolean | undefined;
198
- }[] | undefined;
199
- expectedVersion?: number | undefined;
200
- skippedMemberPaths?: string[] | undefined;
201
- }, "member paths must be unique (case-insensitive)">]>;
202
- /** Max number of rules accepted in a single `POST /api/rules/import` request. */
203
- export declare const MAX_RULES_IMPORT_BATCH = 100;
204
- /** Opaque checkout digest shared by run logs, manifests, and `runs.repo_id`. */
205
- export declare const RepoIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>;
206
52
  /**
207
53
  * A checkout's committed `project.id` as a context write declares it: trimmed
208
54
  * and non-empty, exactly the rule the CLI's config reader applies — and no
@@ -215,401 +61,6 @@ export declare const RepoIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<und
215
61
  * on it would read as foreign in every repo.
216
62
  */
217
63
  export declare const DeclaredProjectIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
218
- /**
219
- * The workspace a repo declares its project-scoped guidance belongs to. See
220
- * `RulesImportRequestSchema.workspaceId`.
221
- *
222
- * Same shape as {@link ProjectIdSchema}, and for the same reason: the id is
223
- * minted by the server (`nanoid()`, whose alphabet this character class covers)
224
- * but it reaches us out of a **committed, hand-editable** file, so it is
225
- * constrained only as far as it must be to serve as a lookup key — no
226
- * whitespace, no path separators, no control characters, bounded length.
227
- * Whether it names a workspace this caller may reach is a membership question,
228
- * answered against the database, not a question a regex can answer.
229
- */
230
- export declare const WorkspaceIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "workspaceId must contain only letters, digits, underscore, dot or hyphen">]>;
231
- export declare const RulesImportRequestSchema: v.ObjectSchema<{
232
- readonly rules: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnknownSchema, undefined>, v.MaxLengthAction<unknown[], 100, undefined>]>;
233
- /**
234
- * Which checkout these files came from — the same opaque digest the hook and
235
- * the rule manifest already carry (`packages/cli/src/repo-id.ts`,
236
- * `RuleManifestSchema.repoId`). Envelope-level, not per-file: every file in
237
- * one import comes from one repo, and the per-file payload stays lean (the
238
- * "Import endpoint payload" resolved decision).
239
- *
240
- * It is what lets the server reconcile an edited file back onto the guide it
241
- * already created instead of inserting a second one. `origin` alone cannot:
242
- * it is `file:{format}:{path}` with no repo component, so two checkouts
243
- * sharing `.agents/code-style.md` would collide.
244
- *
245
- * **Optional, and its absence is not an error.** A CLI predating this field
246
- * sends none, and the server falls back to the content-hash dedupe it always
247
- * used. Never send a repo id derived anywhere but `repoIdFromRoot` — the
248
- * digest is keyed by a machine-local secret precisely so the server never
249
- * learns a path.
250
- *
251
- * Shaped by the canonical `RepoIdSchema` (shared with run logs and manifests)
252
- * rather than a looser local check: a row storing anything but
253
- * a real digest could never match one, so a malformed identity has to be
254
- * rejected at the boundary instead of persisted as a permanent orphan.
255
- */
256
- readonly repoId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>, undefined>;
257
- /**
258
- * The repo's **portable** identity — `project.id` from the committed
259
- * `<repo>/.mossbear/config.json` (`guide-write-side-identity` slice 1, shipped in
260
- * #540). This is what makes `(scope, path)` reconciliation portable, and it is
261
- * the field `unified-item-sync` slice 2 exists to put on the wire.
262
- *
263
- * **Why `repoId` is not enough, even though it is already here.**
264
- * `repoIdFromRoot` is an HMAC keyed by a machine-local secret
265
- * (`packages/cli/src/repo-id.ts`), so the same checkout on two machines — or
266
- * one teammate's clone versus another's — produces two different digests. A
267
- * guide reconciled on it therefore forks the moment anyone else edits the
268
- * file, which is the one-way trip this item is closing. `projectId` is
269
- * declared in a committed file, so every clone agrees on it.
270
- *
271
- * **Optional, and its absence is not an error.** A CLI predating this field
272
- * sends none and the server falls back to `repoId` scoping, which is exactly
273
- * the behaviour those clients already have. A repo that has never run
274
- * `mossbear init` also has no declaration, and must keep importing.
275
- *
276
- * Deliberately looser than `RepoIdSchema`: a generated id is
277
- * `proj_`+hex, but a *declared* one is whatever a human committed —
278
- * `readRepoProjectId` accepts any non-empty trimmed string
279
- * (`packages/cli/src/artifacts/repo-config.ts`), and rejecting those here would
280
- * break a shipped contract. Constrained only as far as it must be to serve as
281
- * a storage key: no whitespace, no path separators, no control characters,
282
- * bounded length.
283
- */
284
- readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "projectId must contain only letters, digits, underscore, dot or hyphen">]>, undefined>;
285
- /**
286
- * The workspace this repo declares its project-scoped guidance belongs to —
287
- * `workspace.id` from the committed `<repo>/.mossbear/config.json`
288
- * (`workspace-declaration` slice 1).
289
- *
290
- * **What it changes: which of the caller's workspaces a project path resolves
291
- * in.** Import identity is already scoped by workspace *membership* rather
292
- * than authorship, so a caller in several workspaces has several candidate
293
- * rows at one `(project, root, path)` and the resolver picked between them by
294
- * row age. The declaration is the narrower lookup that removes the guess, and
295
- * it is committed so every clone of the repo narrows the same way.
296
- *
297
- * **Membership stays the boundary; this only narrows inside it.** The
298
- * declaration cannot widen what a caller may reach: a workspace they are not a
299
- * member of is refused by name rather than resolved, and never quietly
300
- * replaced by their personal one — falling back would recreate the fork the
301
- * declaration exists to close.
302
- *
303
- * **Envelope-level, and never sent on a global batch.** It is the *repo's*
304
- * declaration, so it travels with the same batch that carries `repoId` and
305
- * `projectId`; a `root: 'global'` file belongs to no checkout and to no
306
- * project, and by the same rule to no repo-declared workspace.
307
- *
308
- * **Optional, and its absence is not an error.** A CLI predating this field
309
- * sends none, and a repo that has never declared one has none to send; both
310
- * keep the resolution they have today.
311
- */
312
- readonly workspaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "workspaceId must contain only letters, digits, underscore, dot or hyphen">]>, undefined>;
313
- }, undefined>;
314
- /**
315
- * What the server did with one payload, reported per file so the CLI can update
316
- * its machine-local baseline (`guide-versioned-identity-plan.md` → slice 2b-B).
317
- *
318
- * The distinction that matters is not "did something change" but **do disk and
319
- * server now agree**: `imported`, `updated` and `skipped` all mean they do, and
320
- * only those license recording a new baseline. `conflict` means the disk bytes
321
- * did *not* land — recording the server's version for one would hand the next
322
- * import a matching `expectedVersion` and turn a refused overwrite into an
323
- * automatic one on the following run, which is the failure this whole precondition
324
- * exists to prevent.
325
- */
326
- export declare const GuideImportOutcomeSchema: v.PicklistSchema<["imported", "updated", "skipped", "conflict"], undefined>;
327
- /**
328
- * Per-payload import outcome, addressed by the same `(root, path)` pair the
329
- * server reconciles on so the CLI can key its baseline identically without
330
- * re-deriving anything.
331
- *
332
- * `version` is the body item's version **as the server holds it after this
333
- * request** — the value a later import should send as `expectedVersion` once
334
- * disk and server agree. It is reported for a `conflict` too, deliberately: the
335
- * conflict report needs it to offer explicit resolution, and reporting it is not
336
- * the same as recording it.
337
- *
338
- * Entries are omitted for a payload the server could not address at all (no
339
- * `root`, or a pre-R0 row): there is no identity to key a baseline on, and
340
- * inventing one would let a later import claim a precondition it never observed.
341
- */
342
- export declare const GuideImportResultSchema: v.ObjectSchema<{
343
- /** Canonical guide identity for review links; absent on older servers. */
344
- readonly guideId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
345
- readonly root: v.PicklistSchema<["project", "global"], undefined>;
346
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
347
- readonly outcome: v.PicklistSchema<["imported", "updated", "skipped", "conflict"], undefined>;
348
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
349
- }, undefined>;
350
- export type GuideImportResult = v.InferOutput<typeof GuideImportResultSchema>;
351
- /** Max alias sets one import response reports as divergent. */
352
- export declare const MAX_GUIDE_IMPORT_DIVERGENCES = 64;
353
- /**
354
- * An alias set the server found in one import but **did not** collapse, because
355
- * the files do not hold the same rules
356
- * (`alias-instruction-file-identity-plan.md` → second addendum,
357
- * 2026-09-03).
358
- *
359
- * Reporting rather than refusing is the whole point. An identical
360
- * `AGENTS.md`/`.cursorrules` pair becomes one guide; a divergent one imports as
361
- * two guides exactly as it does today, and this names the paths so the user can
362
- * see the drift the product would otherwise have kept silent. Nothing about the
363
- * import fails, and nothing the user does today stops working.
364
- *
365
- * `paths` carries every path in the set this request saw, in the order the
366
- * server ranks them — so the first is the one that would have kept the body had
367
- * they matched.
368
- */
369
- export declare const GuideImportDivergenceSchema: v.ObjectSchema<{
370
- readonly root: v.PicklistSchema<["project", "global"], undefined>;
371
- readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>, v.MinLengthAction<string[], 2, undefined>]>;
372
- }, undefined>;
373
- export type GuideImportDivergence = v.InferOutput<typeof GuideImportDivergenceSchema>;
374
- /**
375
- * An alias pair one import left as **two guides**, because a guide was already
376
- * stored at the incoming file's alias partner path and the pair could not be
377
- * collapsed onto it (`skill-alias-collapse-managed-file-plan.md` →
378
- * *Reporting*).
379
- *
380
- * Distinct from {@link GuideImportDivergenceSchema}, which says the files
381
- * differ. This one says only that the fork happened — the reasons are several
382
- * (the bodies differ, the skill directories around them could not be proven to
383
- * match, the partner path already answers to a second guide) and the import
384
- * cannot always tell them apart, so it names the pair and leaves the reading to
385
- * whoever wrote the files. Reported only when a guide was *created* at the
386
- * incoming path, so a repo re-importing a pair that forked long ago stays
387
- * quiet.
388
- *
389
- * `paths` is the incoming file first, then the partner already stored.
390
- */
391
- export declare const GuideImportAliasForkSchema: v.ObjectSchema<{
392
- readonly root: v.PicklistSchema<["project", "global"], undefined>;
393
- readonly paths: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>, v.MinLengthAction<string[], 2, undefined>]>;
394
- }, undefined>;
395
- export type GuideImportAliasFork = v.InferOutput<typeof GuideImportAliasForkSchema>;
396
- /**
397
- * One guide to stop delivering, addressed the way the **import** route already
398
- * resolves an existing guide: `(root, path)` plus the envelope's checkout and
399
- * project identity.
400
- *
401
- * **Deliberately not `origin`.** `file:{format}:{path}` is not unique — every
402
- * repo has an `AGENTS.md`, so an origin-keyed request disables the matching
403
- * guide in every repo in the workspace. That is the defect that sank the first
404
- * implementation of this verb. `(root, path)` scoped by `repoId`/`projectId`
405
- * is the key the import route reconciles on, so unlink addresses exactly the
406
- * row link created and no other.
407
- */
408
- export declare const RawGuideUnlinkSchema: v.ObjectSchema<{
409
- readonly root: v.PicklistSchema<["project", "global"], undefined>;
410
- /**
411
- * The canonical guide-path validator, not a fresh `v.string()`: it already
412
- * rejects absolute paths, control characters and `..` traversal, and a second
413
- * hand-rolled constraint here would be a place for the two to disagree.
414
- */
415
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
416
- }, undefined>;
417
- export type RawGuideUnlink = v.InferOutput<typeof RawGuideUnlinkSchema>;
418
- /** Max guides accepted in a single `POST /api/rules/unlink` request. */
419
- export declare const MAX_RULE_UNLINK_BATCH = 500;
420
- export declare const RuleUnlinkRequestSchema: v.ObjectSchema<{
421
- readonly unlinks: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
422
- readonly root: v.PicklistSchema<["project", "global"], undefined>;
423
- /**
424
- * The canonical guide-path validator, not a fresh `v.string()`: it already
425
- * rejects absolute paths, control characters and `..` traversal, and a second
426
- * hand-rolled constraint here would be a place for the two to disagree.
427
- */
428
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
429
- }, undefined>, undefined>, v.MaxLengthAction<{
430
- root: "project" | "global";
431
- path: string;
432
- }[], 500, undefined>]>;
433
- /** Same envelope identity the import route carries, and for the same reason. */
434
- readonly repoId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
435
- readonly projectId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
436
- }, undefined>;
437
- export type RuleUnlinkRequest = v.InferOutput<typeof RuleUnlinkRequestSchema>;
438
- /**
439
- * `unlinked` counts guides removed from the default bundle; `skipped` counts
440
- * requested paths that resolved to nothing, or were already out of it.
441
- *
442
- * `stillDelivered` names guides that remain in *other* bundles the caller can
443
- * reach — including a teammate's, since a bundle shared into a workspace they
444
- * belong to keeps arriving whoever owns it. Unlink is the exact inverse of what
445
- * link does — it removes the default-bundle membership link created — so a
446
- * guide someone deliberately added to a curated bundle stays there, and saying
447
- * so is the difference between a true report and a reassuring one.
448
- *
449
- * `released` names the requested paths whose guide is now in **no** bundle the
450
- * caller can reach, so nothing delivers it any more. It exists because the
451
- * caller holds a fact the server does not: the local placement record that
452
- * marks a path as managed by a bundle. A path taken out of every bundle and
453
- * still recorded as bundle-managed is two answers to one question, and only the
454
- * server can tell which paths genuinely stopped being delivered. Note this is
455
- * not on its own enough to make a re-link restore delivery — the import route
456
- * enrols only the guide rows its insert creates — so a caller acting on this
457
- * should not report the path as re-adoptable.
458
- *
459
- * Optional with an empty default, so a client on this version still parses a
460
- * response from a deployment that predates the field.
461
- */
462
- export declare const RuleUnlinkResponseSchema: v.ObjectSchema<{
463
- readonly unlinked: v.NumberSchema<undefined>;
464
- readonly skipped: v.NumberSchema<undefined>;
465
- readonly stillDelivered: v.ArraySchema<v.StringSchema<undefined>, undefined>;
466
- readonly released: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
467
- readonly root: v.PicklistSchema<["project", "global"], undefined>;
468
- /**
469
- * The canonical guide-path validator, not a fresh `v.string()`: it already
470
- * rejects absolute paths, control characters and `..` traversal, and a second
471
- * hand-rolled constraint here would be a place for the two to disagree.
472
- */
473
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>;
474
- }, undefined>, undefined>, readonly []>;
475
- }, undefined>;
476
- export type RuleUnlinkResponse = v.InferOutput<typeof RuleUnlinkResponseSchema>;
477
- export declare function parseRuleUnlinkRequest(data: unknown): {
478
- unlinks: {
479
- root: "project" | "global";
480
- path: string;
481
- }[];
482
- repoId?: string | undefined;
483
- projectId?: string | undefined;
484
- };
485
- /**
486
- * The sentence a caller gets back when a display name carries a character that
487
- * cannot be seen. It is written for the person who typed the name, not for the
488
- * developer reading the schema. This repo's error-message rules put the
489
- * reader first, keep the blame off them, and ask a refusal to leave them
490
- * something to do — so the action leads and "control character",
491
- * which is not a phrase most people can act on, never appears.
492
- *
493
- * "often" is doing real work in the second clause. This branch cannot tell a
494
- * pasted name from a typed one, so it does not claim to; it names
495
- * where such characters usually come from, which is what makes the advice
496
- * actionable without overclaiming.
497
- */
498
- export declare const DISPLAY_NAME_CONTROL_CHARACTER_MESSAGE = "Remove the invisible characters from this name \u2014 copying text from another app often brings them along.";
499
- /**
500
- * A user-typed display name that is safe to print into a terminal line.
501
- *
502
- * Refuses every character in {@link DISPLAY_NAME_REFUSED_CHARACTERS}
503
- * (`bundleSlug.ts`, where the class is defined once and explained): the control
504
- * characters, where ESC and CR live — a CR can overwrite the line a user is
505
- * reading, which in a tool whose job is reporting what reached their agents
506
- * means the sentence on screen can be made to say something other than what
507
- * happened — and the explicit bidi controls, which reorder a rendered line
508
- * without changing a byte of it. The rest of `\p{Cf}` is admitted: the
509
- * zero-width joiners Persian, Hindi and Bengali need, the join inside a
510
- * multi-person emoji, a soft hyphen. Sharing the class with `displayable` is
511
- * what keeps the boundary and the derivation saying the same thing.
512
- *
513
- * **Refuse, never strip.** A user typing a name is present and can be told;
514
- * rewriting their input silently is what those same rules argue against. The
515
- * one strip in the codebase — `displayable`, reached through
516
- * `defaultGuidesBundleFor` in `bundleSlug.ts` — is a *derivation* with no user
517
- * to report to, which is the exception that fixes the rule rather than a
518
- * precedent for a second one.
519
- *
520
- * **Then requires one character outside `\p{Cf}`.** Admitting the joiners
521
- * admits a name made of nothing but them, which `v.trim()` cannot see and
522
- * `minLength(1)` counts. Such a name is refused as empty, with the same
523
- * sentence — to the person typing it, it is a name of invisible characters
524
- * either way.
525
- *
526
- * **A factory, because the max length is per-field** (64 for a workspace name,
527
- * 200 for a bundle name) while the character rule is not. Exported rather than
528
- * inlined so a fourth display-name field meets the rule while reading its
529
- * neighbours — nothing enforces that it is called.
530
- */
531
- export declare function displayNameSchema(maxLength: number): v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>, v.CheckAction<string, "Remove the invisible characters from this name — copying text from another app often brings them along.">, v.RegexAction<string, "Remove the invisible characters from this name — copying text from another app often brings them along.">]>;
532
- /** A bundle's display name. Bundles are addressed by slug; this is the label. */
533
- export declare const BUNDLE_NAME_MAX_LENGTH = 200;
534
- export declare const BundleSlugSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
535
- /**
536
- * A publisher's lowercase handle: the prefix of a published bundle's address,
537
- * `<handle>/<slug>` (`mossbear/guides`). Slugs are unique per workspace, so a
538
- * bare slug names one of the caller's own bundles and a published bundle is
539
- * named through its publisher.
540
- */
541
- export declare const PUBLISHER_HANDLE_PATTERN: RegExp;
542
- export declare const PublisherHandleSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
543
- /** The longest publisher name a reader is shown. */
544
- export declare const PUBLISHER_NAME_MAX_LENGTH = 100;
545
- /**
546
- * Who publishes a bundle, as a reader sees it. Present only on a bundle that is
547
- * published; absent is the ordinary case, a bundle of the caller's own.
548
- */
549
- export declare const BundlePublisherSchema: v.ObjectSchema<{
550
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
551
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
552
- }, undefined>;
553
- /** A published bundle's address, `<handle>/<slug>`. */
554
- export declare const PublishedBundleAddressSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 104, undefined>, v.CheckAction<string, "address must be <publisher handle>/<bundle slug>">]>;
555
- /**
556
- * An artifact's description as a writer sends it: one paragraph of plain text,
557
- * with no line breaks or other control characters, so it saves on Enter like a
558
- * title, prints safely in a terminal, and stays a plain YAML
559
- * scalar in a Markdown artifact's frontmatter. Blank text is refused rather than
560
- * stored: `null` is how a description is cleared, so "none" has one shape.
561
- */
562
- export declare const ArtifactDescriptionSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "description must not be blank">, v.MaxLengthAction<string, 1000, "description must be at most 1000 characters">, v.CheckAction<string, "description must be one line of text, with no control characters">]>;
563
- export declare const BundleSchema: v.ObjectSchema<{
564
- /**
565
- * The project id of the repo that owns this bundle's items, when one claims it
566
- * (`subscription-delivery-target-plan.md` → slice 3). Absent is the ordinary
567
- * case: a bundle with no home is edited wherever its owner likes.
568
- *
569
- * A home makes the named checkout the only writer — a PR there is the review
570
- * — and every other writer, the dashboard included, is refused by name.
571
- *
572
- * Optional rather than nullable so a CLI built before this field parses a new
573
- * server's listing unchanged.
574
- */
575
- readonly home: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
576
- readonly publisher: v.OptionalSchema<v.ObjectSchema<{
577
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
578
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
579
- }, undefined>, undefined>;
580
- readonly readOnly: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
581
- readonly id: v.StringSchema<undefined>;
582
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
583
- readonly name: v.StringSchema<undefined>;
584
- readonly createdAt: v.StringSchema<undefined>;
585
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
586
- }, undefined>;
587
- export declare const BundleListResponseSchema: v.ObjectSchema<{
588
- readonly bundles: v.ArraySchema<v.ObjectSchema<{
589
- /**
590
- * The project id of the repo that owns this bundle's items, when one claims it
591
- * (`subscription-delivery-target-plan.md` → slice 3). Absent is the ordinary
592
- * case: a bundle with no home is edited wherever its owner likes.
593
- *
594
- * A home makes the named checkout the only writer — a PR there is the review
595
- * — and every other writer, the dashboard included, is refused by name.
596
- *
597
- * Optional rather than nullable so a CLI built before this field parses a new
598
- * server's listing unchanged.
599
- */
600
- readonly home: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
601
- readonly publisher: v.OptionalSchema<v.ObjectSchema<{
602
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
603
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
604
- }, undefined>, undefined>;
605
- readonly readOnly: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
606
- readonly id: v.StringSchema<undefined>;
607
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
608
- readonly name: v.StringSchema<undefined>;
609
- readonly createdAt: v.StringSchema<undefined>;
610
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
611
- }, undefined>, undefined>;
612
- }, undefined>;
613
64
  /**
614
65
  * One workspace the caller belongs to, as `GET /api/v1/workspaces` returns it.
615
66
  *
@@ -637,340 +88,6 @@ export declare const WorkspaceListResponseSchema: v.ObjectSchema<{
637
88
  }, undefined>;
638
89
  export type WorkspaceSummary = v.InferOutput<typeof WorkspaceSummarySchema>;
639
90
  export type WorkspaceListResponse = v.InferOutput<typeof WorkspaceListResponseSchema>;
640
- /**
641
- * How a bundle reaches a repo. Two scopes and no third:
642
- *
643
- * - `repo` — named by the committed `.mossbear/config.json`, shared with
644
- * teammates by `git clone`.
645
- * - `user` — recorded against the account, private, and on every machine.
646
- *
647
- * A bundle both scopes name carries **both** labels. An earlier shape reported a
648
- * single winning `scope`, which made `status` and `doctor` — both of which count
649
- * the account's subscriptions by filtering for `user` — report zero for a bundle
650
- * that is genuinely subscribed at the account level and will keep delivering to
651
- * every other repo. The scopes are not mutually exclusive, so the wire shape
652
- * must not say they are. Raised by Codex on #735.
653
- */
654
- export declare const SubscriptionScopeSchema: v.PicklistSchema<["repo", "user"], undefined>;
655
- /**
656
- * Where a subscription's items are delivered, independent of where their source
657
- * lives (`subscription-delivery-target-plan.md` → slice 2).
658
- *
659
- * - `repo` — land at the item's path in the checkout doing the sync, under the
660
- * same git-owned write rule every project item obeys.
661
- * - `global` — land in the machine-global namespace, unattended.
662
- *
663
- * **Absent is not a third value.** A subscription that names no target routes on
664
- * the item's own `root`, which is what every subscription meant before this
665
- * field existed — so the column and the config key are both nullable and the
666
- * default bundle keeps behaving exactly as it does today.
667
- */
668
- export declare const DeliverTargetSchema: v.PicklistSchema<["repo", "global"], undefined>;
669
- export declare const ResolvedSubscriptionSchema: v.ObjectSchema<{
670
- /**
671
- * The address this bundle was resolved from, when the caller named it as
672
- * `<handle>/<slug>` in `repoBundleAddresses` rather than by id. Lets the
673
- * caller pair each committed address with the id it stands for.
674
- */
675
- readonly address: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 104, undefined>, v.CheckAction<string, "address must be <publisher handle>/<bundle slug>">]>, undefined>;
676
- readonly publisher: v.OptionalSchema<v.ObjectSchema<{
677
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
678
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
679
- }, undefined>, undefined>;
680
- readonly readOnly: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
681
- readonly id: v.StringSchema<undefined>;
682
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
683
- readonly name: v.StringSchema<undefined>;
684
- /** Every scope that names this bundle. Never empty; may hold both. */
685
- readonly scopes: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["repo", "user"], undefined>, undefined>, v.MinLengthAction<("repo" | "user")[], 1, undefined>]>;
686
- /**
687
- * The **account** subscription's delivery target, when there is an account
688
- * subscription and it names one.
689
- *
690
- * Only the account side, and deliberately so: the repo side's target lives in
691
- * the committed `.mossbear/config.json` on the caller's own disk, which the
692
- * server cannot read — the same asymmetry that makes this endpoint a round
693
- * trip at all. Echoing a value the caller just sent would make the server look
694
- * like the authority on a fact it does not hold. The caller pairs this with
695
- * its own committed `deliver` to build the per-scope target set
696
- * (`packages/cli/src/artifacts/delivery.ts` → `deliveryBundles`).
697
- *
698
- * Optional rather than nullable so a CLI built before this field parses a new
699
- * server's response unchanged, and a new CLI reads an old server's response as
700
- * "names no target" — which is the absent-field default either way.
701
- */
702
- readonly deliver: v.OptionalSchema<v.PicklistSchema<["repo", "global"], undefined>, undefined>;
703
- /**
704
- * The bundle's home repo, when one claims it. Sent on every resolved
705
- * subscription regardless of scope, because it is a property of the *bundle*
706
- * rather than of either subscription — unlike `deliver`, which each scope
707
- * answers for itself.
708
- */
709
- readonly home: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
710
- /**
711
- * Ids this account has switched off for the asking machine, on a bundle that
712
- * reaches it through the account subscription alone. An item whose own id or
713
- * `guideId` is listed is not delivered.
714
- *
715
- * The server computes it per machine: artifacts switched off everywhere or
716
- * on this machine that this bundle can deliver, plus every member when the
717
- * bundle itself is switched off. Account-scoped and nowhere else: a repo
718
- * subscription is a committed file shared by everyone who clones it, so a
719
- * mute there would be one member deciding for the team. A muted guide leaves
720
- * the desired delivery list, and the global namespace prunes it once no repo
721
- * still refers to it — repo by repo, as each syncs, because the referrer
722
- * record is machine-local repo ids.
723
- */
724
- readonly muted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
725
- /**
726
- * The same set as `muted`, sent instead of it when the calling repo's
727
- * committed config also subscribes this bundle. It applies to the account
728
- * target only: the repo's own subscription still delivers into the checkout,
729
- * because an off removes only what reaches the machine through the account.
730
- *
731
- * A separate key rather than `muted`, because a CLI that predates it applies
732
- * `muted` before either target is planned and would drop the repo delivery
733
- * too. That CLI ignores this key and delivers to both targets, which fails
734
- * toward the agent having the content.
735
- */
736
- readonly accountMuted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
737
- }, undefined>;
738
- /**
739
- * The ids a repo's committed config names. Sent rather than looked up, because
740
- * the committed file is on the caller's disk and the server has no way to read
741
- * it — that asymmetry is the whole reason delivery used to be written back into
742
- * the repo.
743
- */
744
- /**
745
- * Capped, like the other batch endpoints. The route expands this into
746
- * `inArray(bundles.id, …)`, one Postgres bind parameter per id, and the wire
747
- * protocol tops out at 65,535 of them — so an uncapped array lets a body well
748
- * under the request-size limit reach the database and fail as a 500 rather than
749
- * being refused as bad input. Raised by Codex on #735.
750
- */
751
- export declare const MAX_REPO_BUNDLE_IDS = 500;
752
- /** Capped for the reason `MAX_REPO_BUNDLE_IDS` gives. */
753
- export declare const MAX_REPO_BUNDLE_ADDRESSES = 64;
754
- export declare const ResolveSubscriptionsRequestSchema: v.ObjectSchema<{
755
- readonly repoBundleIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MaxLengthAction<string[], 500, undefined>]>;
756
- /**
757
- * Published bundles the committed config names by address,
758
- * `<handle>/<slug>`, rather than by id. Optional, so a CLI that sends only
759
- * ids is answered as before.
760
- */
761
- readonly repoBundleAddresses: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 104, undefined>, v.CheckAction<string, "address must be <publisher handle>/<bundle slug>">]>, undefined>, v.MaxLengthAction<string[], 64, undefined>]>, undefined>;
762
- /**
763
- * The calling machine's stable id (`MachineIdSchema`). Optional, so an older
764
- * CLI is answered as before; the server records it for the calling key only
765
- * when that key has none yet.
766
- */
767
- readonly machineId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "not a machine id">]>, undefined>;
768
- }, undefined>;
769
- export declare const ResolveSubscriptionsResponseSchema: v.ObjectSchema<{
770
- /** The effective delivery set, de-duplicated by bundle id. */
771
- readonly bundles: v.ArraySchema<v.ObjectSchema<{
772
- /**
773
- * The address this bundle was resolved from, when the caller named it as
774
- * `<handle>/<slug>` in `repoBundleAddresses` rather than by id. Lets the
775
- * caller pair each committed address with the id it stands for.
776
- */
777
- readonly address: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 104, undefined>, v.CheckAction<string, "address must be <publisher handle>/<bundle slug>">]>, undefined>;
778
- readonly publisher: v.OptionalSchema<v.ObjectSchema<{
779
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
780
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
781
- }, undefined>, undefined>;
782
- readonly readOnly: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
783
- readonly id: v.StringSchema<undefined>;
784
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
785
- readonly name: v.StringSchema<undefined>;
786
- /** Every scope that names this bundle. Never empty; may hold both. */
787
- readonly scopes: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["repo", "user"], undefined>, undefined>, v.MinLengthAction<("repo" | "user")[], 1, undefined>]>;
788
- /**
789
- * The **account** subscription's delivery target, when there is an account
790
- * subscription and it names one.
791
- *
792
- * Only the account side, and deliberately so: the repo side's target lives in
793
- * the committed `.mossbear/config.json` on the caller's own disk, which the
794
- * server cannot read — the same asymmetry that makes this endpoint a round
795
- * trip at all. Echoing a value the caller just sent would make the server look
796
- * like the authority on a fact it does not hold. The caller pairs this with
797
- * its own committed `deliver` to build the per-scope target set
798
- * (`packages/cli/src/artifacts/delivery.ts` → `deliveryBundles`).
799
- *
800
- * Optional rather than nullable so a CLI built before this field parses a new
801
- * server's response unchanged, and a new CLI reads an old server's response as
802
- * "names no target" — which is the absent-field default either way.
803
- */
804
- readonly deliver: v.OptionalSchema<v.PicklistSchema<["repo", "global"], undefined>, undefined>;
805
- /**
806
- * The bundle's home repo, when one claims it. Sent on every resolved
807
- * subscription regardless of scope, because it is a property of the *bundle*
808
- * rather than of either subscription — unlike `deliver`, which each scope
809
- * answers for itself.
810
- */
811
- readonly home: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
812
- /**
813
- * Ids this account has switched off for the asking machine, on a bundle that
814
- * reaches it through the account subscription alone. An item whose own id or
815
- * `guideId` is listed is not delivered.
816
- *
817
- * The server computes it per machine: artifacts switched off everywhere or
818
- * on this machine that this bundle can deliver, plus every member when the
819
- * bundle itself is switched off. Account-scoped and nowhere else: a repo
820
- * subscription is a committed file shared by everyone who clones it, so a
821
- * mute there would be one member deciding for the team. A muted guide leaves
822
- * the desired delivery list, and the global namespace prunes it once no repo
823
- * still refers to it — repo by repo, as each syncs, because the referrer
824
- * record is machine-local repo ids.
825
- */
826
- readonly muted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
827
- /**
828
- * The same set as `muted`, sent instead of it when the calling repo's
829
- * committed config also subscribes this bundle. It applies to the account
830
- * target only: the repo's own subscription still delivers into the checkout,
831
- * because an off removes only what reaches the machine through the account.
832
- *
833
- * A separate key rather than `muted`, because a CLI that predates it applies
834
- * `muted` before either target is planned and would drop the repo delivery
835
- * too. That CLI ignores this key and delivers to both targets, which fails
836
- * toward the agent having the content.
837
- */
838
- readonly accountMuted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
839
- }, undefined>, undefined>;
840
- /**
841
- * Committed ids the caller cannot see. **Reported, never dropped** — the line
842
- * was put in the config deliberately by whoever owns the repo, so a non-member
843
- * gets a named failure rather than deletion advice.
844
- *
845
- * It also names the caller's **account** subscriptions whose bundle they can
846
- * no longer read: one unpublished, or in a workspace they left. The row is
847
- * still theirs, so a sync must hold retirement for it as for a repo id it
848
- * cannot see, rather than read its absence as an empty bundle.
849
- */
850
- readonly unresolved: v.ArraySchema<v.ObjectSchema<{
851
- readonly id: v.StringSchema<undefined>;
852
- }, undefined>, undefined>;
853
- /**
854
- * Committed addresses (`repoBundleAddresses`) that name no published bundle.
855
- * Kept apart from `unresolved`, whose entries are ids, so a CLI that reads
856
- * `id` off every entry is never handed one without it. Absent when the
857
- * request named no address.
858
- */
859
- readonly unresolvedAddresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
860
- readonly address: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 104, undefined>, v.CheckAction<string, "address must be <publisher handle>/<bundle slug>">]>;
861
- }, undefined>, undefined>, undefined>;
862
- /**
863
- * Account-level settings the sync needs, carried on the response every sync
864
- * already fetches rather than on a request of their own.
865
- *
866
- * `deliverGlobalSkills` is the account's "Deliver my global skills" switch:
867
- * whether guides scoped to every repo may be written to the global skills
868
- * directories of every machine and cloud session this account syncs. Only a
869
- * signed-in browser session can change it; it is reported here, never
870
- * accepted. **Optional**, so a response from a server that predates it parses,
871
- * and the CLI reads its absence as "the server did not say", which delivers
872
- * nothing and removes nothing.
873
- */
874
- readonly account: v.OptionalSchema<v.ObjectSchema<{
875
- readonly deliverGlobalSkills: v.BooleanSchema<undefined>;
876
- }, undefined>, undefined>;
877
- /**
878
- * True when the caller's token is limited to certain bundles. Such a token
879
- * resolves only what it was granted, so an id in `unresolved` may be a bundle
880
- * the account can reach and the token cannot. Said once for the response,
881
- * never per id, so it confirms nothing about any one bundle. Optional: absent
882
- * means an ordinary token, and a server that predates it never sends it.
883
- */
884
- readonly limitedToken: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
885
- }, undefined>;
886
- /**
887
- * Subscribe the calling account to a bundle it can see, or change the delivery
888
- * target of a subscription it already has.
889
- *
890
- * **The product path to a non-default bundle** (`subscription-delivery-target-plan.md`
891
- * → slice 2). Before this, the only insert into `user_bundle_subscriptions` was
892
- * the one that mints an account's own capture bundle, so an account could not
893
- * subscribe to anything else without a hand-written row.
894
- *
895
- * Idempotent by the table's composite key: subscribing twice is one
896
- * subscription, and a second call carrying a different `deliver` updates it
897
- * rather than failing.
898
- */
899
- /** No account should be able to make one sync unboundedly expensive. */
900
- export declare const MAX_MUTED_GUIDE_IDS = 1000;
901
- export declare const SubscribeBundleRequestSchema: v.ObjectSchema<{
902
- readonly bundleId: v.StringSchema<undefined>;
903
- /**
904
- * Where this account's subscription delivers. **Three states, and all three
905
- * are reachable**: a value sets the target, an explicit `null` clears it back
906
- * to "route on the item's root", and omitting the field leaves whatever is
907
- * stored.
908
- *
909
- * The first shipped version made omission clear the target, so that "route on
910
- * the item's root" would stay reachable. It made a bare re-subscribe — the
911
- * commonest call there is — silently reset routing the caller never mentioned:
912
- * `mossbear pull <bundle> --account` a second time would wipe a target set the
913
- * first time, and print a success line saying nothing about it. Found by the
914
- * automated reviewer on #1246. A nullable field reaches the same state without
915
- * making silence mean a write.
916
- */
917
- readonly deliver: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["repo", "global"], undefined>, undefined>, undefined>;
918
- /**
919
- * The ids to have switched off on every machine, as far as this bundle can
920
- * deliver them — the whole set, replacing what is stored. `[]` switches them
921
- * all back on, and omitting the field leaves the stored set alone.
922
- *
923
- * An id switched off here is off for the account, through every bundle that
924
- * carries it. Switching one back on (an id this bundle delivers that is off
925
- * now and absent here) needs a dashboard session: a CLI key is refused with
926
- * 403, because an agent may narrow what it receives but never widen it.
927
- *
928
- * The same three states as `deliver` above, reached the same way: an explicit
929
- * empty clears, and silence never means a write. So changing a delivery target
930
- * cannot unmute anything, and muting cannot move a target.
931
- */
932
- readonly muted: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MaxLengthAction<string[], 1000, undefined>]>, undefined>;
933
- }, undefined>;
934
- export declare const SubscribeBundleResponseSchema: v.ObjectSchema<{
935
- readonly bundleId: v.StringSchema<undefined>;
936
- /** False when the subscription was already there and only its target moved. */
937
- readonly created: v.BooleanSchema<undefined>;
938
- readonly deliver: v.OptionalSchema<v.PicklistSchema<["repo", "global"], undefined>, undefined>;
939
- /** The stored mute set after this write. Omitted when nothing is muted. */
940
- readonly muted: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
941
- }, undefined>;
942
- export declare const CreateBundleRequestSchema: v.ObjectSchema<{
943
- readonly description: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "description must not be blank">, v.MaxLengthAction<string, 1000, "description must be at most 1000 characters">, v.CheckAction<string, "description must be one line of text, with no control characters">]>, undefined>, undefined>;
944
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
945
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>, v.CheckAction<string, "Remove the invisible characters from this name — copying text from another app often brings them along.">, v.RegexAction<string, "Remove the invisible characters from this name — copying text from another app often brings them along.">]>;
946
- readonly workspaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
947
- }, undefined>;
948
- export declare const CreateBundleResponseSchema: v.ObjectSchema<{
949
- readonly bundle: v.ObjectSchema<{
950
- /**
951
- * The project id of the repo that owns this bundle's items, when one claims it
952
- * (`subscription-delivery-target-plan.md` → slice 3). Absent is the ordinary
953
- * case: a bundle with no home is edited wherever its owner likes.
954
- *
955
- * A home makes the named checkout the only writer — a PR there is the review
956
- * — and every other writer, the dashboard included, is refused by name.
957
- *
958
- * Optional rather than nullable so a CLI built before this field parses a new
959
- * server's listing unchanged.
960
- */
961
- readonly home: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
962
- readonly publisher: v.OptionalSchema<v.ObjectSchema<{
963
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
964
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
965
- }, undefined>, undefined>;
966
- readonly readOnly: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
967
- readonly id: v.StringSchema<undefined>;
968
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
969
- readonly name: v.StringSchema<undefined>;
970
- readonly createdAt: v.StringSchema<undefined>;
971
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
972
- }, undefined>;
973
- }, undefined>;
974
91
  export declare const SCOPED_TOKEN_MAX_GRANTS = 200;
975
92
  export declare const SCOPED_TOKEN_LABEL_MAX_LENGTH = 32;
976
93
  export declare const SCOPED_TOKEN_MAX_PER_ACCOUNT = 50;
@@ -1035,120 +152,6 @@ export declare const ListScopedTokensResponseSchema: v.ObjectSchema<{
1035
152
  export declare const RevokeScopedTokenRequestSchema: v.ObjectSchema<{
1036
153
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1037
154
  }, undefined>;
1038
- /**
1039
- * The member to attach, by its artifact id. `itemId` is the name a CLI from before
1040
- * release step 2 sends; both are read, and the parsed value is always `artifactId`.
1041
- * Drop `itemId` once no such CLI is left to send it.
1042
- */
1043
- /** The most artifacts one attach request may name. */
1044
- export declare const MAX_BUNDLE_MEMBERS_PER_ATTACH = 200;
1045
- export declare const AttachBundleMemberRequestSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1046
- readonly artifactId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
1047
- readonly itemId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
1048
- readonly artifactIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.TransformAction<string[], string[]>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 200, undefined>]>, undefined>;
1049
- }, undefined>, v.CheckAction<{
1050
- artifactId?: string | undefined;
1051
- itemId?: string | undefined;
1052
- artifactIds?: string[] | undefined;
1053
- }, "A member needs an artifactId, or a list of artifactIds on its own.">, v.TransformAction<{
1054
- artifactId?: string | undefined;
1055
- itemId?: string | undefined;
1056
- artifactIds?: string[] | undefined;
1057
- }, {
1058
- artifactId: string;
1059
- } | {
1060
- artifactIds: string[];
1061
- }>]>;
1062
- export declare const AttachBundleMemberResponseSchema: v.ObjectSchema<{
1063
- readonly attached: v.BooleanSchema<undefined>;
1064
- }, undefined>;
1065
- /**
1066
- * One id's outcome in a list attach. `unavailable` is every refusal that is not
1067
- * a path collision, and reads the same whether the artifact is missing, not the
1068
- * caller's to file or in another workspace, so a list cannot probe which ids
1069
- * exist.
1070
- */
1071
- export declare const AttachBundleMembersResultSchema: v.ObjectSchema<{
1072
- readonly artifactId: v.StringSchema<undefined>;
1073
- readonly status: v.PicklistSchema<["added", "already_there", "unavailable", "path_taken"], undefined>;
1074
- }, undefined>;
1075
- export declare const AttachBundleMembersResponseSchema: v.ObjectSchema<{
1076
- readonly results: v.ArraySchema<v.ObjectSchema<{
1077
- readonly artifactId: v.StringSchema<undefined>;
1078
- readonly status: v.PicklistSchema<["added", "already_there", "unavailable", "path_taken"], undefined>;
1079
- }, undefined>, undefined>;
1080
- }, undefined>;
1081
- export declare const DetachBundleMemberResponseSchema: v.ObjectSchema<{
1082
- readonly detached: v.BooleanSchema<undefined>;
1083
- }, undefined>;
1084
- /**
1085
- * The most field keys a bundle's shared column list may hold, and the longest
1086
- * one. A key is a frontmatter key as written, so the bound is on what a
1087
- * dashboard could ever show as a column rather than on any real key's length;
1088
- * both are generous enough that a refusal means a client bug.
1089
- */
1090
- export declare const BUNDLE_COLUMNS_MAX_COUNT = 100;
1091
- export declare const BUNDLE_COLUMN_KEY_MAX_LENGTH = 200;
1092
- /**
1093
- * A bundle's shared column list: field keys in display order, no key twice.
1094
- * An array that repeats a key is refused rather than deduplicated, since the
1095
- * order is the content and a client that sent one has lost track of its own
1096
- * list.
1097
- */
1098
- export declare const BundleColumnsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>, v.CheckAction<string[], "columns must not repeat a key">]>;
1099
- /**
1100
- * What `PATCH /api/v1/context/bundles/:id` may change: the display name, the
1101
- * home repo, the shared column list, or any of them. The slug stays immutable
1102
- * — repos address a bundle by id and name it by slug, so a slug change would
1103
- * rename a folder in every subscriber's checkout.
1104
- *
1105
- * Every field optional, with a check that at least one is present: a body that
1106
- * changes nothing is a request the caller did not mean to send, and answering it
1107
- * 200 would hide a client bug. `home: null` clears the claim, which is how a
1108
- * repo hands a bundle back — distinct from omitting the field, which leaves it.
1109
- * `columns: null` is the same for the column list: it returns the bundle to
1110
- * "not chosen", where every shared field shows.
1111
- */
1112
- export declare const UpdateBundleRequestSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
1113
- readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, number, undefined>, v.CheckAction<string, "Remove the invisible characters from this name — copying text from another app often brings them along.">, v.RegexAction<string, "Remove the invisible characters from this name — copying text from another app often brings them along.">]>, undefined>;
1114
- readonly home: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, undefined>;
1115
- readonly columns: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>, v.CheckAction<string[], "columns must not repeat a key">]>, undefined>, undefined>;
1116
- readonly description: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "description must not be blank">, v.MaxLengthAction<string, 1000, "description must be at most 1000 characters">, v.CheckAction<string, "description must be one line of text, with no control characters">]>, undefined>, undefined>;
1117
- }, undefined>, v.CheckAction<{
1118
- name?: string | undefined;
1119
- home?: string | null | undefined;
1120
- columns?: string[] | null | undefined;
1121
- description?: string | null | undefined;
1122
- }, "name, home, columns or description is required">]>;
1123
- export declare const UpdateBundleResponseSchema: v.ObjectSchema<{
1124
- readonly bundle: v.ObjectSchema<{
1125
- /**
1126
- * The project id of the repo that owns this bundle's items, when one claims it
1127
- * (`subscription-delivery-target-plan.md` → slice 3). Absent is the ordinary
1128
- * case: a bundle with no home is edited wherever its owner likes.
1129
- *
1130
- * A home makes the named checkout the only writer — a PR there is the review
1131
- * — and every other writer, the dashboard included, is refused by name.
1132
- *
1133
- * Optional rather than nullable so a CLI built before this field parses a new
1134
- * server's listing unchanged.
1135
- */
1136
- readonly home: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1137
- readonly publisher: v.OptionalSchema<v.ObjectSchema<{
1138
- readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 100, undefined>]>;
1139
- readonly handle: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "handle must be lowercase alphanumeric with hyphens">]>;
1140
- }, undefined>, undefined>;
1141
- readonly readOnly: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
1142
- readonly id: v.StringSchema<undefined>;
1143
- readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "slug must be lowercase alphanumeric with hyphens, at most 64 characters">]>;
1144
- readonly name: v.StringSchema<undefined>;
1145
- readonly createdAt: v.StringSchema<undefined>;
1146
- readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1147
- }, undefined>;
1148
- }, undefined>;
1149
- export declare const DeleteBundleResponseSchema: v.ObjectSchema<{
1150
- readonly deleted: v.BooleanSchema<undefined>;
1151
- }, undefined>;
1152
155
  export declare const ContextItemTypeSchema: v.PicklistSchema<string[], undefined>;
1153
156
  /**
1154
157
  * What a `?types=` filter parses.
@@ -5404,7 +4407,7 @@ export declare const ArtifactBodyBatchResultSchema: v.VariantSchema<"status", [v
5404
4407
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>;
5405
4408
  }, undefined>, ...v.StrictObjectSchema<{
5406
4409
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
5407
- readonly status: v.LiteralSchema<"changed" | "unavailable" | "deferred" | "oversized", undefined>;
4410
+ readonly status: v.LiteralSchema<"unavailable" | "changed" | "deferred" | "oversized", undefined>;
5408
4411
  }, undefined>[]], undefined>;
5409
4412
  export type ArtifactBodyBatchResult = v.InferOutput<typeof ArtifactBodyBatchResultSchema>;
5410
4413
  export declare const ArtifactBodyBatchResponseSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
@@ -5421,7 +4424,7 @@ export declare const ArtifactBodyBatchResponseSchema: v.SchemaWithPipe<readonly
5421
4424
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>;
5422
4425
  }, undefined>, ...v.StrictObjectSchema<{
5423
4426
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
5424
- readonly status: v.LiteralSchema<"changed" | "unavailable" | "deferred" | "oversized", undefined>;
4427
+ readonly status: v.LiteralSchema<"unavailable" | "changed" | "deferred" | "oversized", undefined>;
5425
4428
  }, undefined>[]], undefined>, undefined>, v.MinLengthAction<({
5426
4429
  status: "ok";
5427
4430
  content: string | null;
@@ -5430,7 +4433,7 @@ export declare const ArtifactBodyBatchResponseSchema: v.SchemaWithPipe<readonly
5430
4433
  version: number;
5431
4434
  } | {
5432
4435
  id: string;
5433
- status: "changed" | "unavailable" | "deferred" | "oversized";
4436
+ status: "unavailable" | "changed" | "deferred" | "oversized";
5434
4437
  })[], 1, undefined>, v.MaxLengthAction<({
5435
4438
  status: "ok";
5436
4439
  content: string | null;
@@ -5439,7 +4442,7 @@ export declare const ArtifactBodyBatchResponseSchema: v.SchemaWithPipe<readonly
5439
4442
  version: number;
5440
4443
  } | {
5441
4444
  id: string;
5442
- status: "changed" | "unavailable" | "deferred" | "oversized";
4445
+ status: "unavailable" | "changed" | "deferred" | "oversized";
5443
4446
  })[], 50, undefined>, v.CheckAction<({
5444
4447
  status: "ok";
5445
4448
  content: string | null;
@@ -5448,7 +4451,7 @@ export declare const ArtifactBodyBatchResponseSchema: v.SchemaWithPipe<readonly
5448
4451
  version: number;
5449
4452
  } | {
5450
4453
  id: string;
5451
- status: "changed" | "unavailable" | "deferred" | "oversized";
4454
+ status: "unavailable" | "changed" | "deferred" | "oversized";
5452
4455
  })[], "Duplicate artifact IDs">]>;
5453
4456
  }, undefined>, v.CheckAction<{
5454
4457
  scope: {
@@ -5464,7 +4467,7 @@ export declare const ArtifactBodyBatchResponseSchema: v.SchemaWithPipe<readonly
5464
4467
  version: number;
5465
4468
  } | {
5466
4469
  id: string;
5467
- status: "changed" | "unavailable" | "deferred" | "oversized";
4470
+ status: "unavailable" | "changed" | "deferred" | "oversized";
5468
4471
  })[];
5469
4472
  }, "Body batch content budget exceeded">]>;
5470
4473
  export type ArtifactBodyBatchResponse = v.InferOutput<typeof ArtifactBodyBatchResponseSchema>;
@@ -6680,65 +5683,6 @@ export declare const DashboardGuideSuggestionSchema: v.ObjectSchema<{
6680
5683
  export declare const MAX_SYNC_ACTIONS_BATCH = 500;
6681
5684
  /** Max number of guideSuggestions/runUsage entries per sync request. */
6682
5685
  export declare const MAX_SYNC_AUX_BATCH = 100;
6683
- /**
6684
- * Max rule files one delivery manifest enumerates. Well above what a real repo
6685
- * carries (this one: ~20), and bounded because the manifest rides every
6686
- * action-carrying batch: an unbounded list would multiply across a chunked
6687
- * sync. Overflow sets `truncated` rather than being dropped silently.
6688
- */
6689
- export declare const MAX_RULE_MANIFEST_FILES = 500;
6690
- /**
6691
- * A rule file observed on disk in the repo `mossbear report` ran from.
6692
- *
6693
- * `path` is relative to that repo root, in exactly the form `payloadPath`
6694
- * takes at import time (`packages/cli/src/guides/discover.ts`), so
6695
- * `file:{format}:{path}` reconstructs the `origin` the dashboard stored for
6696
- * the guide this file produced. That reconstruction is the whole join; nothing
6697
- * else about the file is needed and nothing else is sent.
6698
- *
6699
- * **Never any content.** `contentHash` is the same sha256 the import payload
6700
- * carries, present so a later slice can tell "delivered" from "delivered but
6701
- * edited since import" without shipping the bytes again.
6702
- */
6703
- export declare const RuleManifestFileSchema: v.ObjectSchema<{
6704
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
6705
- readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
6706
- readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
6707
- }, undefined>;
6708
- /**
6709
- * Which rule files were actually on disk in the repo this sync ran from —
6710
- * observed delivery, replacing the assumption that every non-skill active
6711
- * guide reached the agent. Without it, an account with several repos, or a
6712
- * dashboard-authored guide never exported anywhere, is graded against
6713
- * instructions the agent never received.
6714
- *
6715
- * `repoId` is an opaque, machine-local digest — deliberately not a path, a
6716
- * remote URL, or a repo name. Its only job is to keep two checkouts on the
6717
- * same account distinguishable, which is the half of review finding 5 that
6718
- * repo-root-relative origins cannot express: two repos each holding
6719
- * `.claude/skills/review` produce byte-identical origins by construction. See
6720
- * `repoIdFromRoot` (`packages/cli/src/guides/manifest.ts`) for how it is
6721
- * derived and why that derivation is privacy-safe.
6722
- */
6723
- export declare const RuleFileManifestSchema: v.ObjectSchema<{
6724
- readonly repoId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>;
6725
- readonly files: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
6726
- readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
6727
- readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
6728
- readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
6729
- }, undefined>, undefined>, v.MaxLengthAction<{
6730
- path: string;
6731
- format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
6732
- contentHash: string;
6733
- }[], 500, undefined>]>;
6734
- /**
6735
- * The repo held more rule files than the cap, so `files` is a prefix. Set
6736
- * rather than silently trimmed: a manifest read as complete would mark the
6737
- * omitted files' guides undelivered, which is the exact wrong-verdict
6738
- * failure this field exists to prevent.
6739
- */
6740
- readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
6741
- }, undefined>;
6742
5686
  /**
6743
5687
  * Where the checkout stood when a run closed — the git head the `SessionEnd`
6744
5688
  * hook observed, and the branch it was on.
@@ -7117,13 +6061,7 @@ export declare const DashboardSyncRequestSchema: v.ObjectSchema<{
7117
6061
  path: string;
7118
6062
  format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
7119
6063
  contentHash: string;
7120
- }[], 500, undefined>]>;
7121
- /**
7122
- * The repo held more rule files than the cap, so `files` is a prefix. Set
7123
- * rather than silently trimmed: a manifest read as complete would mark the
7124
- * omitted files' guides undelivered, which is the exact wrong-verdict
7125
- * failure this field exists to prevent.
7126
- */
6064
+ }[], 500, undefined>]>;
7127
6065
  readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
7128
6066
  }, undefined>, undefined>;
7129
6067
  /**
@@ -7406,546 +6344,6 @@ declare const KNOWN_ACTION_TYPES: readonly ["file_edit", "file_read", "shell_com
7406
6344
  export type KnownActionType = (typeof KNOWN_ACTION_TYPES)[number];
7407
6345
  /** True when `value` is one of the action types the CLI produces on purpose. */
7408
6346
  export declare function isKnownActionType(value: string): value is KnownActionType;
7409
- /**
7410
- * The read an agent makes of a guide's own grading record, so the improvement
7411
- * loop the user already runs in-conversation ("what could be improved in this
7412
- * skill?") has the evidence Mossbear holds and the agent does not.
7413
- *
7414
- * **Evidence out, never instructions out.** Nothing in this contract carries a
7415
- * directive to change anything, and nothing on the server writes as a result of
7416
- * it. It is a read, and the decision stays in the user's conversation.
7417
- */
7418
- /**
7419
- * How the agent names the guide.
7420
- *
7421
- * Either a repo-relative path exactly as the guide file declares it
7422
- * (`.claude/skills/reviewer/SKILL.md`, `AGENTS.md`), or the bare name of a
7423
- * skill (`reviewer`), which the server expands to the skill layouts it knows.
7424
- * Both resolve through the `(root, path)` identity import already reconciles
7425
- * on, rather than a second one invented here.
7426
- *
7427
- * Bounded and shape-checked at the boundary rather than at the query string: it
7428
- * reaches a SQL predicate, and an identifier is not free text.
7429
- */
7430
- export declare const GuideHistoryIdentifierSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "guide must not contain control characters">]>;
7431
- /**
7432
- * The request an agent sends.
7433
- *
7434
- * `root` is optional and is the disambiguator, not decoration: `.claude/skills`
7435
- * is scanned under **both** discovery roots
7436
- * (`packages/cli/src/guides/discover.ts`), so a project skill and its
7437
- * `~/.claude/skills` twin declare the same path string. When the identifier
7438
- * reaches guides under more than one root and no root was given, the server
7439
- * refuses and names both rather than picking one — answering a question about
7440
- * the wrong file's history is worse than not answering it.
7441
- */
7442
- export declare const GuideHistoryRequestSchema: v.ObjectSchema<{
7443
- readonly guide: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "guide must not contain control characters">]>;
7444
- readonly root: v.OptionalSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
7445
- /**
7446
- * Which repo's copy — **the axis import itself reconciles on**, and the one
7447
- * that actually resolves the common collision.
7448
- *
7449
- * `root` alone does not, and assuming it did was the first version's defect:
7450
- * import's resolution key is `(userId, repoId, root, path)` and two files at
7451
- * one path under different repos deliberately stay two rows. So any
7452
- * user with two repos has two guides at `(project, AGENTS.md)`, and a refusal
7453
- * telling them to pass `root` names the one field that cannot separate those.
7454
- *
7455
- * `projectId` is the portable identity a repo commits and every clone agrees
7456
- * on; `repoId` is the machine-local digest. Both are optional and both are
7457
- * what the caller already sends at import time, so an agent running inside a
7458
- * repo supplies them without being asked.
7459
- */
7460
- readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
7461
- readonly repoId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
7462
- /**
7463
- * The exact guide, when the caller has already been shown the candidates.
7464
- *
7465
- * The escape hatch that makes the refusal always satisfiable: two repos can
7466
- * be indistinguishable to a caller that knows neither id (a guide imported
7467
- * before repo identity was recorded carries neither), and an error whose
7468
- * remedy cannot be carried out is worse than no remedy at all. The 409 names
7469
- * this id for every candidate.
7470
- */
7471
- readonly guideId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
7472
- }, undefined>;
7473
- export type GuideHistoryRequest = v.InferOutput<typeof GuideHistoryRequestSchema>;
7474
- /**
7475
- * One revision of a guide's wording: the body file and the version it stood at.
7476
- *
7477
- * The pair, never a bare version number — `guide_files.version` restarts at 1
7478
- * per row, so a number alone compares equal across two different files.
7479
- */
7480
- export declare const GuideHistoryRevisionSchema: v.ObjectSchema<{
7481
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7482
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7483
- }, undefined>;
7484
- export type GuideHistoryRevision = v.InferOutput<typeof GuideHistoryRevisionSchema>;
7485
- /**
7486
- * Which of three states the guide's record is in — a required field rather than
7487
- * something a reader infers from empty arrays.
7488
- *
7489
- * The distinction is the whole point of returning it: `unevaluated` means no
7490
- * graded run has ever produced a verdict, while `awaiting_current_revision`
7491
- * means the guide has a real record that is entirely about wording the user has
7492
- * since rewritten. Collapsing those two onto "no data" is exactly the claim the
7493
- * dashboard stopped making with its awaiting-current-revision check, and an
7494
- * agent reading an absence as a verdict is the same error one screen further
7495
- * out.
7496
- */
7497
- export declare const GuideHistoryStateSchema: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
7498
- export type GuideHistoryState = v.InferOutput<typeof GuideHistoryStateSchema>;
7499
- /**
7500
- * The verdict window, scoped to the revision named beside it.
7501
- *
7502
- * Both denominators travel: `applicable` is the rate's own denominator
7503
- * (`aligned + misaligned`), `total` is the window's row count including the runs
7504
- * that never engaged the guide. Rendering one as the other is the defect
7505
- * `alignment-rate-sample-disclosure` was filed for, and a payload carrying only
7506
- * one of them would hand an agent the same mistake.
7507
- */
7508
- export declare const GuideHistoryWindowSchema: v.ObjectSchema<{
7509
- /** Rows summarized, after the revision narrow. */
7510
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7511
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7512
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7513
- /** In context, never engaged. Neither a pass nor a failure. */
7514
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7515
- /** `aligned + misaligned` — the rate's own denominator. */
7516
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7517
- /** `aligned / applicable`, or **null when no run engaged the guide**. */
7518
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7519
- /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
7520
- readonly isWindowed: v.BooleanSchema<undefined>;
7521
- /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
7522
- readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7523
- /**
7524
- * Verdicts fetched and then dropped by the revision narrow — about wording
7525
- * that is no longer current, or citing no revision at all. A **floor** rather
7526
- * than a total whenever `isWindowed`, because rows past the cap were never
7527
- * fetched.
7528
- */
7529
- readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7530
- /**
7531
- * `applicable` is too small for the percentage to mean anything — threshold
7532
- * `applicable < 3` (founder, 2026-08-22). Read the counts, not the rate.
7533
- */
7534
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7535
- }, undefined>;
7536
- export type GuideHistoryWindow = v.InferOutput<typeof GuideHistoryWindowSchema>;
7537
- /**
7538
- * One side of a guide edit's before/after pair — the wording, and what the runs
7539
- * that engaged it did.
7540
- *
7541
- * Structurally a window like `GuideHistoryWindow` and deliberately not that
7542
- * schema: these two sides are bounded **per revision** by a different
7543
- * server-side query, so `isSaturated` is
7544
- * the server's own measurement of its partition rather than the client-side
7545
- * `isWindowed` inference, and the span each side covers is part of what makes
7546
- * the pair readable.
7547
- *
7548
- * Both denominators travel here for the same reason they travel on the window:
7549
- * a delta between two undisclosed denominators is worse than no number at all.
7550
- */
7551
- export declare const GuideHistoryChangeSideSchema: v.ObjectSchema<{
7552
- /** The wording this side judges. */
7553
- readonly revision: v.ObjectSchema<{
7554
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7555
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7556
- }, undefined>;
7557
- /** Rows in this side's window, including the runs that never engaged it. */
7558
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7559
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7560
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7561
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7562
- /** `aligned + misaligned` — this side's own denominator. */
7563
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7564
- /** `aligned / applicable`, or null when no run engaged this wording. */
7565
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7566
- /** This side is below the sample floor, so read its counts and not its rate. */
7567
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7568
- /**
7569
- * This side is a bounded sample of its revision rather than the whole record.
7570
- * A saturated side beside an unsaturated one is two different kinds of
7571
- * number, and comparing them without saying so is the defect the flag exists
7572
- * to stop.
7573
- */
7574
- readonly isSaturated: v.BooleanSchema<undefined>;
7575
- /** The span this side covers, ISO. Both null on a side with no rows. */
7576
- readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7577
- readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7578
- }, undefined>;
7579
- export type GuideHistoryChangeSide = v.InferOutput<typeof GuideHistoryChangeSideSchema>;
7580
- /**
7581
- * Which side is too thin for a delta to mean anything.
7582
- *
7583
- * Named rather than a boolean because the two take different sentences: too few
7584
- * runs *since* the change is the ordinary state right after an edit, while too
7585
- * few *before* it means there was never a baseline to compare against.
7586
- */
7587
- export declare const GuideHistoryChangeSuppressionSchema: v.PicklistSchema<["since", "before", "both"], undefined>;
7588
- /**
7589
- * Which way the pair points, or null while the delta is withheld.
7590
- *
7591
- * A reading of a *set* of runs, never a verdict on one — the vocabulary
7592
- * `aligned | misaligned | not_applicable` is untouched, and nothing derived
7593
- * here is written back to a row.
7594
- */
7595
- export declare const GuideHistoryChangeDirectionSchema: v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>;
7596
- /**
7597
- * The guide's last edit, read as two windows
7598
- * (`insight-to-proven-change` §A, surfaced by `guide-history-for-agents`
7599
- * deliverable 3).
7600
- *
7601
- * > Changed 12 Aug. Before: misaligned in 6 of 8 runs that engaged it.
7602
- * > Since: 0 of 11.
7603
- *
7604
- * **Null on the response is a state, not a missing field.** It means this guide
7605
- * has no earlier wording that produced evidence — a guide on its first
7606
- * revision, which is the normal state and not an error.
7607
- *
7608
- * **Paired, never merged**, and **never causal**: this states two windows and
7609
- * their denominators and stops. The model changed, the task mix changed and the
7610
- * codebase changed too, so "since" is the strongest word the evidence supports.
7611
- */
7612
- export declare const GuideHistoryChangeSchema: v.ObjectSchema<{
7613
- /** The revision that preceded the change. */
7614
- readonly before: v.ObjectSchema<{
7615
- /** The wording this side judges. */
7616
- readonly revision: v.ObjectSchema<{
7617
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7618
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7619
- }, undefined>;
7620
- /** Rows in this side's window, including the runs that never engaged it. */
7621
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7622
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7623
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7624
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7625
- /** `aligned + misaligned` — this side's own denominator. */
7626
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7627
- /** `aligned / applicable`, or null when no run engaged this wording. */
7628
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7629
- /** This side is below the sample floor, so read its counts and not its rate. */
7630
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7631
- /**
7632
- * This side is a bounded sample of its revision rather than the whole record.
7633
- * A saturated side beside an unsaturated one is two different kinds of
7634
- * number, and comparing them without saying so is the defect the flag exists
7635
- * to stop.
7636
- */
7637
- readonly isSaturated: v.BooleanSchema<undefined>;
7638
- /** The span this side covers, ISO. Both null on a side with no rows. */
7639
- readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7640
- readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7641
- }, undefined>;
7642
- /** The wording the guide stands at now. */
7643
- readonly since: v.ObjectSchema<{
7644
- /** The wording this side judges. */
7645
- readonly revision: v.ObjectSchema<{
7646
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7647
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7648
- }, undefined>;
7649
- /** Rows in this side's window, including the runs that never engaged it. */
7650
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7651
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7652
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7653
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7654
- /** `aligned + misaligned` — this side's own denominator. */
7655
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7656
- /** `aligned / applicable`, or null when no run engaged this wording. */
7657
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7658
- /** This side is below the sample floor, so read its counts and not its rate. */
7659
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7660
- /**
7661
- * This side is a bounded sample of its revision rather than the whole record.
7662
- * A saturated side beside an unsaturated one is two different kinds of
7663
- * number, and comparing them without saying so is the defect the flag exists
7664
- * to stop.
7665
- */
7666
- readonly isSaturated: v.BooleanSchema<undefined>;
7667
- /** The span this side covers, ISO. Both null on a side with no rows. */
7668
- readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7669
- readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7670
- }, undefined>;
7671
- /**
7672
- * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
7673
- * suppressed** or either side never engaged the guide. Null is not zero: one
7674
- * says the evidence does not support a number, the other would be a claim.
7675
- */
7676
- readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7677
- /**
7678
- * Which side is below the sample floor, or null when neither is and the delta
7679
- * stands. `'since'` is the ordinary post-edit state — *not enough runs since
7680
- * this change* — and is reported rather than omitted.
7681
- */
7682
- readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
7683
- /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
7684
- readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
7685
- /** Either side is a bounded sample, so neither is a lifetime total. */
7686
- readonly isWindowed: v.BooleanSchema<undefined>;
7687
- /** The per-revision cap each side was bounded by, so "sample" has a size. */
7688
- readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7689
- /**
7690
- * When the current wording was recorded, ISO — the boundary between the two
7691
- * windows, and null when no version row carries it.
7692
- *
7693
- * A date, never an attribution: it says when the window opened, not that the
7694
- * edit caused what happened inside it.
7695
- */
7696
- readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7697
- }, undefined>;
7698
- export type GuideHistoryChange = v.InferOutput<typeof GuideHistoryChangeSchema>;
7699
- /** Findings returned per response, and the character bound on each reasoning. */
7700
- export declare const MAX_GUIDE_HISTORY_FINDINGS = 5;
7701
- export declare const MAX_GUIDE_HISTORY_REASONING_CHARS = 1200;
7702
- /**
7703
- * One recorded finding: a run that judged this guide misaligned, and why.
7704
- *
7705
- * `reasoning` arrives **already wrapped in the response's untrusted markers**
7706
- * rather than raw. It is model-authored text derived from a transcript, so the
7707
- * discipline the run grader applies to such text on the way in applies on the
7708
- * way out; wrapping it at the source is what makes the boundary
7709
- * unforgeable, since a consumer handed raw text plus separate markers can
7710
- * simply not use them.
7711
- *
7712
- * `isCurrentRevision` is not optional detail. A payload that scopes its *rate*
7713
- * to the current wording and then hands over reasoning about deleted sentences,
7714
- * unlabelled, reproduces inside one response the conflation
7715
- * `pattern-evidence-guide-revision` removed from the dashboard.
7716
- */
7717
- export declare const GuideHistoryFindingSchema: v.ObjectSchema<{
7718
- readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7719
- readonly occurredAt: v.StringSchema<undefined>;
7720
- readonly revision: v.NullableSchema<v.ObjectSchema<{
7721
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7722
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7723
- }, undefined>, undefined>;
7724
- readonly isCurrentRevision: v.BooleanSchema<undefined>;
7725
- readonly reasoning: v.StringSchema<undefined>;
7726
- }, undefined>;
7727
- export type GuideHistoryFinding = v.InferOutput<typeof GuideHistoryFindingSchema>;
7728
- /** The guide the identifier resolved to, echoed so the agent can check itself. */
7729
- export declare const GuideHistoryGuideSchema: v.ObjectSchema<{
7730
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7731
- readonly title: v.StringSchema<undefined>;
7732
- readonly path: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>;
7733
- readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
7734
- }, undefined>;
7735
- /**
7736
- * The caller's newest stored failure-pattern analysis of the guide
7737
- * (`drafted-guide-suggestions` slice 7), served through artifact feedback.
7738
- *
7739
- * **The caller's own analysis only.** An analysis reads the caller's verdicts,
7740
- * so a workspace-mate's is never returned, the same rule the verdicts follow.
7741
- *
7742
- * **Staleness is derived on read**: the
7743
- * guide's wording changed since (`revision_changed`), or failures of the same
7744
- * wording arrived that it has not read (`new_failures`, with how many). A stale
7745
- * analysis is still what it found; it is reported, never withheld.
7746
- *
7747
- * `summary` arrives wrapped in the response's untrusted markers. It is
7748
- * model-authored text derived from session transcripts. On `no_pattern` it may
7749
- * be empty between them, because the dashboard supplies that sentence itself.
7750
- */
7751
- export declare const GuideHistoryAnalysisSchema: v.ObjectSchema<{
7752
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7753
- /** When it was written, ISO. */
7754
- readonly createdAt: v.StringSchema<undefined>;
7755
- readonly outcome: v.PicklistSchema<["pattern", "no_pattern"], undefined>;
7756
- readonly summary: v.StringSchema<undefined>;
7757
- /** Failed sessions the analysis read. */
7758
- readonly sessionsAnalysed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7759
- /** Failed sessions it left out to stay within its prompt's cap. */
7760
- readonly sessionsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7761
- readonly stale: v.BooleanSchema<undefined>;
7762
- /** Why it is out of date, or null while it is current. */
7763
- readonly staleReason: v.NullableSchema<v.PicklistSchema<["revision_changed", "new_failures"], undefined>, undefined>;
7764
- /** Failures it has not read, when `staleReason` is `new_failures`; else null. */
7765
- readonly newFailures: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
7766
- }, undefined>;
7767
- export type GuideHistoryAnalysis = v.InferOutput<typeof GuideHistoryAnalysisSchema>;
7768
- export declare const GuideHistoryResponseSchema: v.ObjectSchema<{
7769
- readonly guide: v.ObjectSchema<{
7770
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7771
- readonly title: v.StringSchema<undefined>;
7772
- readonly path: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>;
7773
- readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
7774
- }, undefined>;
7775
- /** The wording the window is about, or null when the guide has no revision identity. */
7776
- readonly currentRevision: v.NullableSchema<v.ObjectSchema<{
7777
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7778
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7779
- }, undefined>, undefined>;
7780
- readonly state: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
7781
- readonly window: v.ObjectSchema<{
7782
- /** Rows summarized, after the revision narrow. */
7783
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7784
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7785
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7786
- /** In context, never engaged. Neither a pass nor a failure. */
7787
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7788
- /** `aligned + misaligned` — the rate's own denominator. */
7789
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7790
- /** `aligned / applicable`, or **null when no run engaged the guide**. */
7791
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7792
- /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
7793
- readonly isWindowed: v.BooleanSchema<undefined>;
7794
- /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
7795
- readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7796
- /**
7797
- * Verdicts fetched and then dropped by the revision narrow — about wording
7798
- * that is no longer current, or citing no revision at all. A **floor** rather
7799
- * than a total whenever `isWindowed`, because rows past the cap were never
7800
- * fetched.
7801
- */
7802
- readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7803
- /**
7804
- * `applicable` is too small for the percentage to mean anything — threshold
7805
- * `applicable < 3` (founder, 2026-08-22). Read the counts, not the rate.
7806
- */
7807
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7808
- }, undefined>;
7809
- /**
7810
- * The last edit's two windows, or **null when there is no earlier wording to
7811
- * compare against**.
7812
- *
7813
- * Present-and-null rather than omitted: a guide on its first revision has no
7814
- * delta, and that is an answer. An absent key would leave a reader unable to
7815
- * tell "no edit to measure" from "this server does not report deltas".
7816
- */
7817
- readonly change: v.NullableSchema<v.ObjectSchema<{
7818
- /** The revision that preceded the change. */
7819
- readonly before: v.ObjectSchema<{
7820
- /** The wording this side judges. */
7821
- readonly revision: v.ObjectSchema<{
7822
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7823
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7824
- }, undefined>;
7825
- /** Rows in this side's window, including the runs that never engaged it. */
7826
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7827
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7828
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7829
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7830
- /** `aligned + misaligned` — this side's own denominator. */
7831
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7832
- /** `aligned / applicable`, or null when no run engaged this wording. */
7833
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7834
- /** This side is below the sample floor, so read its counts and not its rate. */
7835
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7836
- /**
7837
- * This side is a bounded sample of its revision rather than the whole record.
7838
- * A saturated side beside an unsaturated one is two different kinds of
7839
- * number, and comparing them without saying so is the defect the flag exists
7840
- * to stop.
7841
- */
7842
- readonly isSaturated: v.BooleanSchema<undefined>;
7843
- /** The span this side covers, ISO. Both null on a side with no rows. */
7844
- readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7845
- readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7846
- }, undefined>;
7847
- /** The wording the guide stands at now. */
7848
- readonly since: v.ObjectSchema<{
7849
- /** The wording this side judges. */
7850
- readonly revision: v.ObjectSchema<{
7851
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7852
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7853
- }, undefined>;
7854
- /** Rows in this side's window, including the runs that never engaged it. */
7855
- readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7856
- readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7857
- readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7858
- readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7859
- /** `aligned + misaligned` — this side's own denominator. */
7860
- readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7861
- /** `aligned / applicable`, or null when no run engaged this wording. */
7862
- readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7863
- /** This side is below the sample floor, so read its counts and not its rate. */
7864
- readonly isLowConfidence: v.BooleanSchema<undefined>;
7865
- /**
7866
- * This side is a bounded sample of its revision rather than the whole record.
7867
- * A saturated side beside an unsaturated one is two different kinds of
7868
- * number, and comparing them without saying so is the defect the flag exists
7869
- * to stop.
7870
- */
7871
- readonly isSaturated: v.BooleanSchema<undefined>;
7872
- /** The span this side covers, ISO. Both null on a side with no rows. */
7873
- readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7874
- readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7875
- }, undefined>;
7876
- /**
7877
- * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
7878
- * suppressed** or either side never engaged the guide. Null is not zero: one
7879
- * says the evidence does not support a number, the other would be a claim.
7880
- */
7881
- readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
7882
- /**
7883
- * Which side is below the sample floor, or null when neither is and the delta
7884
- * stands. `'since'` is the ordinary post-edit state — *not enough runs since
7885
- * this change* — and is reported rather than omitted.
7886
- */
7887
- readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
7888
- /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
7889
- readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
7890
- /** Either side is a bounded sample, so neither is a lifetime total. */
7891
- readonly isWindowed: v.BooleanSchema<undefined>;
7892
- /** The per-revision cap each side was bounded by, so "sample" has a size. */
7893
- readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7894
- /**
7895
- * When the current wording was recorded, ISO — the boundary between the two
7896
- * windows, and null when no version row carries it.
7897
- *
7898
- * A date, never an attribution: it says when the window opened, not that the
7899
- * edit caused what happened inside it.
7900
- */
7901
- readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7902
- }, undefined>, undefined>;
7903
- readonly findings: v.ArraySchema<v.ObjectSchema<{
7904
- readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7905
- readonly occurredAt: v.StringSchema<undefined>;
7906
- readonly revision: v.NullableSchema<v.ObjectSchema<{
7907
- readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7908
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7909
- }, undefined>, undefined>;
7910
- readonly isCurrentRevision: v.BooleanSchema<undefined>;
7911
- readonly reasoning: v.StringSchema<undefined>;
7912
- }, undefined>, undefined>;
7913
- /**
7914
- * Misaligned rows in the window beyond the `MAX_GUIDE_HISTORY_FINDINGS`
7915
- * returned. Reported rather than silently truncated: a caller reading five
7916
- * findings has no other way to know it is reading five of forty.
7917
- */
7918
- readonly findingsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7919
- /**
7920
- * The caller's newest stored failure-pattern analysis of this guide, or
7921
- * **null when they have never asked for one**. Optional because a server
7922
- * that predates it sends no key; a reader must not take absence for "never
7923
- * analysed".
7924
- */
7925
- readonly analysis: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
7926
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7927
- /** When it was written, ISO. */
7928
- readonly createdAt: v.StringSchema<undefined>;
7929
- readonly outcome: v.PicklistSchema<["pattern", "no_pattern"], undefined>;
7930
- readonly summary: v.StringSchema<undefined>;
7931
- /** Failed sessions the analysis read. */
7932
- readonly sessionsAnalysed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7933
- /** Failed sessions it left out to stay within its prompt's cap. */
7934
- readonly sessionsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
7935
- readonly stale: v.BooleanSchema<undefined>;
7936
- /** Why it is out of date, or null while it is current. */
7937
- readonly staleReason: v.NullableSchema<v.PicklistSchema<["revision_changed", "new_failures"], undefined>, undefined>;
7938
- /** Failures it has not read, when `staleReason` is `new_failures`; else null. */
7939
- readonly newFailures: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
7940
- }, undefined>, undefined>, undefined>;
7941
- readonly untrusted: v.ObjectSchema<{
7942
- readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7943
- readonly startMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7944
- readonly endMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7945
- readonly note: v.StringSchema<undefined>;
7946
- }, undefined>;
7947
- }, undefined>;
7948
- export type GuideHistoryResponse = v.InferOutput<typeof GuideHistoryResponseSchema>;
7949
6347
  /**
7950
6348
  * `GET .../feedback` query. `cursor` is the `nextCursor` of the previous page,
7951
6349
  * opaque to callers; a malformed one is a 400, never a restart from page one.
@@ -8049,132 +6447,61 @@ export declare const ArtifactFeedbackResponseSchema: v.ObjectSchema<{
8049
6447
  readonly path: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>;
8050
6448
  readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
8051
6449
  }, undefined>;
8052
- /** The wording the window is about, or null when the guide has no revision identity. */
8053
6450
  readonly currentRevision: v.NullableSchema<v.ObjectSchema<{
8054
6451
  readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8055
6452
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8056
6453
  }, undefined>, undefined>;
8057
6454
  readonly state: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
8058
6455
  readonly window: v.ObjectSchema<{
8059
- /** Rows summarized, after the revision narrow. */
8060
6456
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8061
6457
  readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8062
6458
  readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8063
- /** In context, never engaged. Neither a pass nor a failure. */
8064
6459
  readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8065
- /** `aligned + misaligned` — the rate's own denominator. */
8066
6460
  readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8067
- /** `aligned / applicable`, or **null when no run engaged the guide**. */
8068
6461
  readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8069
- /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
8070
6462
  readonly isWindowed: v.BooleanSchema<undefined>;
8071
- /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
8072
6463
  readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8073
- /**
8074
- * Verdicts fetched and then dropped by the revision narrow — about wording
8075
- * that is no longer current, or citing no revision at all. A **floor** rather
8076
- * than a total whenever `isWindowed`, because rows past the cap were never
8077
- * fetched.
8078
- */
8079
6464
  readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8080
- /**
8081
- * `applicable` is too small for the percentage to mean anything — threshold
8082
- * `applicable < 3` (founder, 2026-08-22). Read the counts, not the rate.
8083
- */
8084
6465
  readonly isLowConfidence: v.BooleanSchema<undefined>;
8085
6466
  }, undefined>;
8086
- /**
8087
- * The last edit's two windows, or **null when there is no earlier wording to
8088
- * compare against**.
8089
- *
8090
- * Present-and-null rather than omitted: a guide on its first revision has no
8091
- * delta, and that is an answer. An absent key would leave a reader unable to
8092
- * tell "no edit to measure" from "this server does not report deltas".
8093
- */
8094
6467
  readonly change: v.NullableSchema<v.ObjectSchema<{
8095
- /** The revision that preceded the change. */
8096
6468
  readonly before: v.ObjectSchema<{
8097
- /** The wording this side judges. */
8098
6469
  readonly revision: v.ObjectSchema<{
8099
6470
  readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8100
6471
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8101
6472
  }, undefined>;
8102
- /** Rows in this side's window, including the runs that never engaged it. */
8103
6473
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8104
6474
  readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8105
6475
  readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8106
6476
  readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8107
- /** `aligned + misaligned` — this side's own denominator. */
8108
6477
  readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8109
- /** `aligned / applicable`, or null when no run engaged this wording. */
8110
6478
  readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8111
- /** This side is below the sample floor, so read its counts and not its rate. */
8112
6479
  readonly isLowConfidence: v.BooleanSchema<undefined>;
8113
- /**
8114
- * This side is a bounded sample of its revision rather than the whole record.
8115
- * A saturated side beside an unsaturated one is two different kinds of
8116
- * number, and comparing them without saying so is the defect the flag exists
8117
- * to stop.
8118
- */
8119
6480
  readonly isSaturated: v.BooleanSchema<undefined>;
8120
- /** The span this side covers, ISO. Both null on a side with no rows. */
8121
6481
  readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8122
6482
  readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8123
6483
  }, undefined>;
8124
- /** The wording the guide stands at now. */
8125
6484
  readonly since: v.ObjectSchema<{
8126
- /** The wording this side judges. */
8127
6485
  readonly revision: v.ObjectSchema<{
8128
6486
  readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8129
6487
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8130
6488
  }, undefined>;
8131
- /** Rows in this side's window, including the runs that never engaged it. */
8132
6489
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8133
6490
  readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8134
6491
  readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8135
6492
  readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8136
- /** `aligned + misaligned` — this side's own denominator. */
8137
6493
  readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8138
- /** `aligned / applicable`, or null when no run engaged this wording. */
8139
6494
  readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8140
- /** This side is below the sample floor, so read its counts and not its rate. */
8141
6495
  readonly isLowConfidence: v.BooleanSchema<undefined>;
8142
- /**
8143
- * This side is a bounded sample of its revision rather than the whole record.
8144
- * A saturated side beside an unsaturated one is two different kinds of
8145
- * number, and comparing them without saying so is the defect the flag exists
8146
- * to stop.
8147
- */
8148
6496
  readonly isSaturated: v.BooleanSchema<undefined>;
8149
- /** The span this side covers, ISO. Both null on a side with no rows. */
8150
6497
  readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8151
6498
  readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8152
6499
  }, undefined>;
8153
- /**
8154
- * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
8155
- * suppressed** or either side never engaged the guide. Null is not zero: one
8156
- * says the evidence does not support a number, the other would be a claim.
8157
- */
8158
6500
  readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8159
- /**
8160
- * Which side is below the sample floor, or null when neither is and the delta
8161
- * stands. `'since'` is the ordinary post-edit state — *not enough runs since
8162
- * this change* — and is reported rather than omitted.
8163
- */
8164
6501
  readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
8165
- /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
8166
6502
  readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
8167
- /** Either side is a bounded sample, so neither is a lifetime total. */
8168
6503
  readonly isWindowed: v.BooleanSchema<undefined>;
8169
- /** The per-revision cap each side was bounded by, so "sample" has a size. */
8170
6504
  readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8171
- /**
8172
- * When the current wording was recorded, ISO — the boundary between the two
8173
- * windows, and null when no version row carries it.
8174
- *
8175
- * A date, never an attribution: it says when the window opened, not that the
8176
- * edit caused what happened inside it.
8177
- */
8178
6505
  readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8179
6506
  }, undefined>, undefined>;
8180
6507
  readonly findings: v.ArraySchema<v.ObjectSchema<{
@@ -8187,32 +6514,16 @@ export declare const ArtifactFeedbackResponseSchema: v.ObjectSchema<{
8187
6514
  readonly isCurrentRevision: v.BooleanSchema<undefined>;
8188
6515
  readonly reasoning: v.StringSchema<undefined>;
8189
6516
  }, undefined>, undefined>;
8190
- /**
8191
- * Misaligned rows in the window beyond the `MAX_GUIDE_HISTORY_FINDINGS`
8192
- * returned. Reported rather than silently truncated: a caller reading five
8193
- * findings has no other way to know it is reading five of forty.
8194
- */
8195
6517
  readonly findingsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8196
- /**
8197
- * The caller's newest stored failure-pattern analysis of this guide, or
8198
- * **null when they have never asked for one**. Optional because a server
8199
- * that predates it sends no key; a reader must not take absence for "never
8200
- * analysed".
8201
- */
8202
6518
  readonly analysis: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
8203
6519
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8204
- /** When it was written, ISO. */
8205
6520
  readonly createdAt: v.StringSchema<undefined>;
8206
6521
  readonly outcome: v.PicklistSchema<["pattern", "no_pattern"], undefined>;
8207
6522
  readonly summary: v.StringSchema<undefined>;
8208
- /** Failed sessions the analysis read. */
8209
6523
  readonly sessionsAnalysed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8210
- /** Failed sessions it left out to stay within its prompt's cap. */
8211
6524
  readonly sessionsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8212
6525
  readonly stale: v.BooleanSchema<undefined>;
8213
- /** Why it is out of date, or null while it is current. */
8214
6526
  readonly staleReason: v.NullableSchema<v.PicklistSchema<["revision_changed", "new_failures"], undefined>, undefined>;
8215
- /** Failures it has not read, when `staleReason` is `new_failures`; else null. */
8216
6527
  readonly newFailures: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
8217
6528
  }, undefined>, undefined>, undefined>;
8218
6529
  readonly untrusted: v.ObjectSchema<{
@@ -8321,132 +6632,61 @@ export declare const ArtifactFeedbackBatchResponseSchema: v.ObjectSchema<{
8321
6632
  readonly path: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>, v.CheckAction<string, "path must use forward slashes">, v.CheckAction<string, "path must be relative">, v.CheckAction<string, "path must not contain control characters">, v.CheckAction<string, "path must not contain empty, \".\" or \"..\" segments">]>, undefined>;
8322
6633
  readonly root: v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
8323
6634
  }, undefined>;
8324
- /** The wording the window is about, or null when the guide has no revision identity. */
8325
6635
  readonly currentRevision: v.NullableSchema<v.ObjectSchema<{
8326
6636
  readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8327
6637
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8328
6638
  }, undefined>, undefined>;
8329
6639
  readonly state: v.PicklistSchema<["evaluated", "awaiting_current_revision", "unevaluated"], undefined>;
8330
6640
  readonly window: v.ObjectSchema<{
8331
- /** Rows summarized, after the revision narrow. */
8332
6641
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8333
6642
  readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8334
6643
  readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8335
- /** In context, never engaged. Neither a pass nor a failure. */
8336
6644
  readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8337
- /** `aligned + misaligned` — the rate's own denominator. */
8338
6645
  readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8339
- /** `aligned / applicable`, or **null when no run engaged the guide**. */
8340
6646
  readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8341
- /** The rows hit the per-guide cap: a bounded window, never a lifetime total. */
8342
6647
  readonly isWindowed: v.BooleanSchema<undefined>;
8343
- /** The cap the rows were fetched under, so a reader can say what "windowed" means. */
8344
6648
  readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8345
- /**
8346
- * Verdicts fetched and then dropped by the revision narrow — about wording
8347
- * that is no longer current, or citing no revision at all. A **floor** rather
8348
- * than a total whenever `isWindowed`, because rows past the cap were never
8349
- * fetched.
8350
- */
8351
6649
  readonly olderRevisionRows: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8352
- /**
8353
- * `applicable` is too small for the percentage to mean anything — threshold
8354
- * `applicable < 3` (founder, 2026-08-22). Read the counts, not the rate.
8355
- */
8356
6650
  readonly isLowConfidence: v.BooleanSchema<undefined>;
8357
6651
  }, undefined>;
8358
- /**
8359
- * The last edit's two windows, or **null when there is no earlier wording to
8360
- * compare against**.
8361
- *
8362
- * Present-and-null rather than omitted: a guide on its first revision has no
8363
- * delta, and that is an answer. An absent key would leave a reader unable to
8364
- * tell "no edit to measure" from "this server does not report deltas".
8365
- */
8366
6652
  readonly change: v.NullableSchema<v.ObjectSchema<{
8367
- /** The revision that preceded the change. */
8368
6653
  readonly before: v.ObjectSchema<{
8369
- /** The wording this side judges. */
8370
6654
  readonly revision: v.ObjectSchema<{
8371
6655
  readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8372
6656
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8373
6657
  }, undefined>;
8374
- /** Rows in this side's window, including the runs that never engaged it. */
8375
6658
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8376
6659
  readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8377
6660
  readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8378
6661
  readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8379
- /** `aligned + misaligned` — this side's own denominator. */
8380
6662
  readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8381
- /** `aligned / applicable`, or null when no run engaged this wording. */
8382
6663
  readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8383
- /** This side is below the sample floor, so read its counts and not its rate. */
8384
6664
  readonly isLowConfidence: v.BooleanSchema<undefined>;
8385
- /**
8386
- * This side is a bounded sample of its revision rather than the whole record.
8387
- * A saturated side beside an unsaturated one is two different kinds of
8388
- * number, and comparing them without saying so is the defect the flag exists
8389
- * to stop.
8390
- */
8391
6665
  readonly isSaturated: v.BooleanSchema<undefined>;
8392
- /** The span this side covers, ISO. Both null on a side with no rows. */
8393
6666
  readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8394
6667
  readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8395
6668
  }, undefined>;
8396
- /** The wording the guide stands at now. */
8397
6669
  readonly since: v.ObjectSchema<{
8398
- /** The wording this side judges. */
8399
6670
  readonly revision: v.ObjectSchema<{
8400
6671
  readonly bodyItemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8401
6672
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8402
6673
  }, undefined>;
8403
- /** Rows in this side's window, including the runs that never engaged it. */
8404
6674
  readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8405
6675
  readonly aligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8406
6676
  readonly misaligned: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8407
6677
  readonly notApplicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8408
- /** `aligned + misaligned` — this side's own denominator. */
8409
6678
  readonly applicable: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8410
- /** `aligned / applicable`, or null when no run engaged this wording. */
8411
6679
  readonly alignmentRate: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8412
- /** This side is below the sample floor, so read its counts and not its rate. */
8413
6680
  readonly isLowConfidence: v.BooleanSchema<undefined>;
8414
- /**
8415
- * This side is a bounded sample of its revision rather than the whole record.
8416
- * A saturated side beside an unsaturated one is two different kinds of
8417
- * number, and comparing them without saying so is the defect the flag exists
8418
- * to stop.
8419
- */
8420
6681
  readonly isSaturated: v.BooleanSchema<undefined>;
8421
- /** The span this side covers, ISO. Both null on a side with no rows. */
8422
6682
  readonly newestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8423
6683
  readonly oldestAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8424
6684
  }, undefined>;
8425
- /**
8426
- * `since` minus `before`, in `[-1, 1]`, or **null whenever the pair is
8427
- * suppressed** or either side never engaged the guide. Null is not zero: one
8428
- * says the evidence does not support a number, the other would be a claim.
8429
- */
8430
6685
  readonly alignmentRateDelta: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
8431
- /**
8432
- * Which side is below the sample floor, or null when neither is and the delta
8433
- * stands. `'since'` is the ordinary post-edit state — *not enough runs since
8434
- * this change* — and is reported rather than omitted.
8435
- */
8436
6686
  readonly suppressedBy: v.NullableSchema<v.PicklistSchema<["since", "before", "both"], undefined>, undefined>;
8437
- /** The delta's sign, or null while it is withheld. `unchanged` is exactly zero. */
8438
6687
  readonly direction: v.NullableSchema<v.PicklistSchema<["improved", "regressed", "unchanged"], undefined>, undefined>;
8439
- /** Either side is a bounded sample, so neither is a lifetime total. */
8440
6688
  readonly isWindowed: v.BooleanSchema<undefined>;
8441
- /** The per-revision cap each side was bounded by, so "sample" has a size. */
8442
6689
  readonly windowSize: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8443
- /**
8444
- * When the current wording was recorded, ISO — the boundary between the two
8445
- * windows, and null when no version row carries it.
8446
- *
8447
- * A date, never an attribution: it says when the window opened, not that the
8448
- * edit caused what happened inside it.
8449
- */
8450
6690
  readonly changedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
8451
6691
  }, undefined>, undefined>;
8452
6692
  readonly findings: v.ArraySchema<v.ObjectSchema<{
@@ -8459,32 +6699,16 @@ export declare const ArtifactFeedbackBatchResponseSchema: v.ObjectSchema<{
8459
6699
  readonly isCurrentRevision: v.BooleanSchema<undefined>;
8460
6700
  readonly reasoning: v.StringSchema<undefined>;
8461
6701
  }, undefined>, undefined>;
8462
- /**
8463
- * Misaligned rows in the window beyond the `MAX_GUIDE_HISTORY_FINDINGS`
8464
- * returned. Reported rather than silently truncated: a caller reading five
8465
- * findings has no other way to know it is reading five of forty.
8466
- */
8467
6702
  readonly findingsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8468
- /**
8469
- * The caller's newest stored failure-pattern analysis of this guide, or
8470
- * **null when they have never asked for one**. Optional because a server
8471
- * that predates it sends no key; a reader must not take absence for "never
8472
- * analysed".
8473
- */
8474
6703
  readonly analysis: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
8475
6704
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8476
- /** When it was written, ISO. */
8477
6705
  readonly createdAt: v.StringSchema<undefined>;
8478
6706
  readonly outcome: v.PicklistSchema<["pattern", "no_pattern"], undefined>;
8479
6707
  readonly summary: v.StringSchema<undefined>;
8480
- /** Failed sessions the analysis read. */
8481
6708
  readonly sessionsAnalysed: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8482
- /** Failed sessions it left out to stay within its prompt's cap. */
8483
6709
  readonly sessionsOmitted: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>;
8484
6710
  readonly stale: v.BooleanSchema<undefined>;
8485
- /** Why it is out of date, or null while it is current. */
8486
6711
  readonly staleReason: v.NullableSchema<v.PicklistSchema<["revision_changed", "new_failures"], undefined>, undefined>;
8487
- /** Failures it has not read, when `staleReason` is `new_failures`; else null. */
8488
6712
  readonly newFailures: v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>]>, undefined>;
8489
6713
  }, undefined>, undefined>, undefined>;
8490
6714
  readonly untrusted: v.ObjectSchema<{
@@ -8505,52 +6729,6 @@ export declare const ArtifactFeedbackBatchResponseSchema: v.ObjectSchema<{
8505
6729
  }, undefined>, undefined>;
8506
6730
  }, undefined>;
8507
6731
  export type ArtifactFeedbackBatchResponse = v.InferOutput<typeof ArtifactFeedbackBatchResponseSchema>;
8508
- export declare function parseGuideBundleResponse(data: unknown): {
8509
- guides: {
8510
- id: string;
8511
- title: string;
8512
- content: string;
8513
- enabled: boolean;
8514
- updatedAt: string;
8515
- origin?: string | null | undefined;
8516
- contentHash?: string | null | undefined;
8517
- root?: "project" | "global" | null | undefined;
8518
- path?: string | null | undefined;
8519
- }[];
8520
- pulledAt: string;
8521
- };
8522
- export declare function parseRawGuideFilePayload(data: unknown): {
8523
- path: string;
8524
- root?: "project" | "global" | undefined;
8525
- format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
8526
- rawContent: string;
8527
- lastModified: number;
8528
- content_hash: string;
8529
- members?: {
8530
- path: string;
8531
- rawContent: string;
8532
- lastModified: number;
8533
- content_hash: string;
8534
- executable?: boolean | undefined;
8535
- }[] | undefined;
8536
- expectedVersion?: number | undefined;
8537
- skippedMemberPaths?: string[] | undefined;
8538
- };
8539
- export declare function parseBundleListResponse(data: unknown): {
8540
- bundles: {
8541
- home?: string | undefined;
8542
- publisher?: {
8543
- name: string;
8544
- handle: string;
8545
- } | undefined;
8546
- readOnly?: true | undefined;
8547
- id: string;
8548
- slug: string;
8549
- name: string;
8550
- createdAt: string;
8551
- description?: string | null | undefined;
8552
- }[];
8553
- };
8554
6732
  export declare function parseWorkspaceListResponse(data: unknown): {
8555
6733
  workspaces: {
8556
6734
  id: string;
@@ -8570,112 +6748,6 @@ export declare function parseCreateScopedTokenRequest(data: unknown): {
8570
6748
  export declare function parseRevokeScopedTokenRequest(data: unknown): {
8571
6749
  id: string;
8572
6750
  };
8573
- export declare function parseCreateBundleRequest(data: unknown): {
8574
- description?: string | null | undefined;
8575
- slug: string;
8576
- name: string;
8577
- workspaceId?: string | undefined;
8578
- };
8579
- export declare function parseCreateBundleResponse(data: unknown): {
8580
- bundle: {
8581
- home?: string | undefined;
8582
- publisher?: {
8583
- name: string;
8584
- handle: string;
8585
- } | undefined;
8586
- readOnly?: true | undefined;
8587
- id: string;
8588
- slug: string;
8589
- name: string;
8590
- createdAt: string;
8591
- description?: string | null | undefined;
8592
- };
8593
- };
8594
- export declare function parseAttachBundleMemberRequest(data: unknown): {
8595
- artifactId: string;
8596
- } | {
8597
- artifactIds: string[];
8598
- };
8599
- export declare function parseAttachBundleMemberResponse(data: unknown): {
8600
- attached: boolean;
8601
- };
8602
- export declare function parseAttachBundleMembersResponse(data: unknown): {
8603
- results: {
8604
- artifactId: string;
8605
- status: "added" | "already_there" | "unavailable" | "path_taken";
8606
- }[];
8607
- };
8608
- export declare function parseDetachBundleMemberResponse(data: unknown): {
8609
- detached: boolean;
8610
- };
8611
- export declare function parseSubscribeBundleRequest(data: unknown): {
8612
- bundleId: string;
8613
- deliver?: "global" | "repo" | null | undefined;
8614
- muted?: string[] | undefined;
8615
- };
8616
- export declare function parseSubscribeBundleResponse(data: unknown): {
8617
- bundleId: string;
8618
- created: boolean;
8619
- deliver?: "global" | "repo" | undefined;
8620
- muted?: string[] | undefined;
8621
- };
8622
- export declare function parseResolveSubscriptionsRequest(data: unknown): {
8623
- repoBundleIds: string[];
8624
- repoBundleAddresses?: string[] | undefined;
8625
- machineId?: string | undefined;
8626
- };
8627
- export declare function parseResolveSubscriptionsResponse(data: unknown): {
8628
- bundles: {
8629
- address?: string | undefined;
8630
- publisher?: {
8631
- name: string;
8632
- handle: string;
8633
- } | undefined;
8634
- readOnly?: true | undefined;
8635
- id: string;
8636
- slug: string;
8637
- name: string;
8638
- scopes: ("repo" | "user")[];
8639
- deliver?: "global" | "repo" | undefined;
8640
- home?: string | undefined;
8641
- muted?: string[] | undefined;
8642
- accountMuted?: string[] | undefined;
8643
- }[];
8644
- unresolved: {
8645
- id: string;
8646
- }[];
8647
- unresolvedAddresses?: {
8648
- address: string;
8649
- }[] | undefined;
8650
- account?: {
8651
- deliverGlobalSkills: boolean;
8652
- } | undefined;
8653
- limitedToken?: boolean | undefined;
8654
- };
8655
- export declare function parseUpdateBundleRequest(data: unknown): {
8656
- name?: string | undefined;
8657
- home?: string | null | undefined;
8658
- columns?: string[] | null | undefined;
8659
- description?: string | null | undefined;
8660
- };
8661
- export declare function parseUpdateBundleResponse(data: unknown): {
8662
- bundle: {
8663
- home?: string | undefined;
8664
- publisher?: {
8665
- name: string;
8666
- handle: string;
8667
- } | undefined;
8668
- readOnly?: true | undefined;
8669
- id: string;
8670
- slug: string;
8671
- name: string;
8672
- createdAt: string;
8673
- description?: string | null | undefined;
8674
- };
8675
- };
8676
- export declare function parseDeleteBundleResponse(data: unknown): {
8677
- deleted: boolean;
8678
- };
8679
6751
  export declare function parseContextItemsResponse(data: unknown): {
8680
6752
  items: {
8681
6753
  type: string;
@@ -9065,104 +7137,4 @@ export declare function parseActionEntry(data: unknown): {
9065
7137
  exitCode?: number | undefined;
9066
7138
  } | undefined;
9067
7139
  };
9068
- export declare function parseGuideHistoryRequest(data: unknown): {
9069
- guide: string;
9070
- root?: "project" | "global" | undefined;
9071
- projectId?: string | undefined;
9072
- repoId?: string | undefined;
9073
- guideId?: string | undefined;
9074
- };
9075
- export declare function parseGuideHistoryResponse(data: unknown): {
9076
- guide: {
9077
- id: string;
9078
- title: string;
9079
- path: string | null;
9080
- root: "project" | "global" | null;
9081
- };
9082
- currentRevision: {
9083
- bodyItemId: string;
9084
- version: number;
9085
- } | null;
9086
- state: "evaluated" | "awaiting_current_revision" | "unevaluated";
9087
- window: {
9088
- total: number;
9089
- aligned: number;
9090
- misaligned: number;
9091
- notApplicable: number;
9092
- applicable: number;
9093
- alignmentRate: number | null;
9094
- isWindowed: boolean;
9095
- windowSize: number;
9096
- olderRevisionRows: number;
9097
- isLowConfidence: boolean;
9098
- };
9099
- change: {
9100
- before: {
9101
- revision: {
9102
- bodyItemId: string;
9103
- version: number;
9104
- };
9105
- total: number;
9106
- aligned: number;
9107
- misaligned: number;
9108
- notApplicable: number;
9109
- applicable: number;
9110
- alignmentRate: number | null;
9111
- isLowConfidence: boolean;
9112
- isSaturated: boolean;
9113
- newestAt: string | null;
9114
- oldestAt: string | null;
9115
- };
9116
- since: {
9117
- revision: {
9118
- bodyItemId: string;
9119
- version: number;
9120
- };
9121
- total: number;
9122
- aligned: number;
9123
- misaligned: number;
9124
- notApplicable: number;
9125
- applicable: number;
9126
- alignmentRate: number | null;
9127
- isLowConfidence: boolean;
9128
- isSaturated: boolean;
9129
- newestAt: string | null;
9130
- oldestAt: string | null;
9131
- };
9132
- alignmentRateDelta: number | null;
9133
- suppressedBy: "before" | "since" | "both" | null;
9134
- direction: "improved" | "regressed" | "unchanged" | null;
9135
- isWindowed: boolean;
9136
- windowSize: number;
9137
- changedAt: string | null;
9138
- } | null;
9139
- findings: {
9140
- sessionId: string;
9141
- occurredAt: string;
9142
- revision: {
9143
- bodyItemId: string;
9144
- version: number;
9145
- } | null;
9146
- isCurrentRevision: boolean;
9147
- reasoning: string;
9148
- }[];
9149
- findingsOmitted: number;
9150
- analysis?: {
9151
- id: string;
9152
- createdAt: string;
9153
- outcome: "pattern" | "no_pattern";
9154
- summary: string;
9155
- sessionsAnalysed: number;
9156
- sessionsOmitted: number;
9157
- stale: boolean;
9158
- staleReason: "revision_changed" | "new_failures" | null;
9159
- newFailures: number | null;
9160
- } | null | undefined;
9161
- untrusted: {
9162
- token: string;
9163
- startMarker: string;
9164
- endMarker: string;
9165
- note: string;
9166
- };
9167
- };
9168
7140
  //# sourceMappingURL=schemas.d.ts.map