@mossbear/protocol 0.1.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/bundleSlug.d.ts +42 -0
- package/dist/bundleSlug.d.ts.map +1 -0
- package/dist/bundleSlug.js +68 -0
- package/dist/bundleSlug.js.map +1 -0
- package/dist/bundleSlug.test.d.ts +2 -0
- package/dist/bundleSlug.test.d.ts.map +1 -0
- package/dist/bundleSlug.test.js +43 -0
- package/dist/bundleSlug.test.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +1782 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +1422 -0
- package/dist/schemas.js.map +1 -0
- package/dist/schemas.test.d.ts +2 -0
- package/dist/schemas.test.d.ts.map +1 -0
- package/dist/schemas.test.js +1018 -0
- package/dist/schemas.test.js.map +1 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +47 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +125 -0
- package/dist/version.js.map +1 -0
- package/dist/version.test.d.ts +2 -0
- package/dist/version.test.d.ts.map +1 -0
- package/dist/version.test.js +86 -0
- package/dist/version.test.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,1782 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime validation schemas using Valibot.
|
|
3
|
+
*
|
|
4
|
+
* Schemas are the single source of truth — TypeScript types in types.ts are
|
|
5
|
+
* derived from these via `v.InferOutput<typeof Schema>`.
|
|
6
|
+
*
|
|
7
|
+
* Callers can use the exported `parse*` wrappers (throw ValiError on invalid
|
|
8
|
+
* input) or call `v.safeParse(Schema, data)` directly for non-throwing checks.
|
|
9
|
+
*/
|
|
10
|
+
import * as v from 'valibot';
|
|
11
|
+
export declare const VerdictSchema: v.PicklistSchema<["aligned", "unguided", "misaligned"], undefined>;
|
|
12
|
+
export declare const GuidingTierSchema: v.PicklistSchema<["pattern_match", "cached", "llm", "batch"], undefined>;
|
|
13
|
+
export declare const PlatformKindSchema: v.PicklistSchema<["claude_code", "cursor", "copilot", "windsurf", "other"], undefined>;
|
|
14
|
+
export declare const GuideFileFormatSchema: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
|
|
15
|
+
/** Max serialized size (UTF-8 bytes) of an imported guide file's raw content. */
|
|
16
|
+
export declare const MAX_RAW_GUIDE_CONTENT_BYTES: number;
|
|
17
|
+
/** Max member files a single skill-md payload may carry. */
|
|
18
|
+
export declare const MAX_SKILL_MEMBER_FILES = 64;
|
|
19
|
+
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">]>;
|
|
20
|
+
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">]>;
|
|
21
|
+
export declare const RawSkillMemberFileSchema: v.ObjectSchema<{
|
|
22
|
+
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">]>;
|
|
23
|
+
readonly rawContent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
|
|
24
|
+
readonly lastModified: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
25
|
+
readonly content_hash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
26
|
+
}, undefined>;
|
|
27
|
+
/** Max skipped-member paths a skill-md payload may report alongside `members`. */
|
|
28
|
+
export declare const MAX_SKILL_SKIPPED_MEMBER_PATHS = 256;
|
|
29
|
+
/**
|
|
30
|
+
* Which root a discovered guide file's `path` is relative to: the repo checkout
|
|
31
|
+
* (`project`) or the user's homedir (`global`, e.g. `.claude/CLAUDE.md`).
|
|
32
|
+
* Part of the import resolution key — see `RawGuideFilePayloadSchema.root`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const GuideDiscoveryRootSchema: v.PicklistSchema<["project", "global"], undefined>;
|
|
35
|
+
export declare const GuideSnapshotSchema: v.ObjectSchema<{
|
|
36
|
+
readonly id: v.StringSchema<undefined>;
|
|
37
|
+
readonly title: v.StringSchema<undefined>;
|
|
38
|
+
readonly content: v.StringSchema<undefined>;
|
|
39
|
+
readonly enabled: v.BooleanSchema<undefined>;
|
|
40
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
41
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
42
|
+
readonly contentHash: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, undefined>;
|
|
43
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
44
|
+
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>;
|
|
45
|
+
}, undefined>;
|
|
46
|
+
export declare const GuideBundleResponseSchema: v.ObjectSchema<{
|
|
47
|
+
readonly guides: v.ArraySchema<v.ObjectSchema<{
|
|
48
|
+
readonly id: v.StringSchema<undefined>;
|
|
49
|
+
readonly title: v.StringSchema<undefined>;
|
|
50
|
+
readonly content: v.StringSchema<undefined>;
|
|
51
|
+
readonly enabled: v.BooleanSchema<undefined>;
|
|
52
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
53
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
54
|
+
readonly contentHash: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>, undefined>;
|
|
55
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
56
|
+
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>;
|
|
57
|
+
}, undefined>, undefined>;
|
|
58
|
+
readonly pulledAt: v.StringSchema<undefined>;
|
|
59
|
+
}, undefined>;
|
|
60
|
+
export declare const RawGuideFilePayloadSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
61
|
+
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">]>;
|
|
62
|
+
readonly root: v.OptionalSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>;
|
|
63
|
+
readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
|
|
64
|
+
readonly rawContent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
|
|
65
|
+
readonly lastModified: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
66
|
+
readonly content_hash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
67
|
+
readonly members: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
68
|
+
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">]>;
|
|
69
|
+
readonly rawContent: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
|
|
70
|
+
readonly lastModified: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
71
|
+
readonly content_hash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
72
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
73
|
+
path: string;
|
|
74
|
+
rawContent: string;
|
|
75
|
+
lastModified: number;
|
|
76
|
+
content_hash: string;
|
|
77
|
+
}[], 64, undefined>]>, undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* The body-item version this machine last agreed with the server about for
|
|
80
|
+
* this `(scope, root, path)` — the machine-local baseline
|
|
81
|
+
* (`guide-versioned-identity-plan.md` → slice 2b-B, D10 in
|
|
82
|
+
* `context-bundle-authoring-plan.md`).
|
|
83
|
+
*
|
|
84
|
+
* It is the *client* half of the reconcile precondition, and it exists to
|
|
85
|
+
* answer a question the server cannot: whether the bytes on this disk were
|
|
86
|
+
* edited **from** the version the server currently holds, or from an older
|
|
87
|
+
* one. The server-only guard shipped in 2b-A can see that a dashboard edit
|
|
88
|
+
* exists, never that this machine has already seen it — so a guide the
|
|
89
|
+
* dashboard edited and the user then re-synced to disk forks forever.
|
|
90
|
+
*
|
|
91
|
+
* **Optional, and its absence is not an error.** A CLI predating the
|
|
92
|
+
* baseline store, a fresh machine, or a deleted `~/.mossbear/state/` sends
|
|
93
|
+
* none, and the payload falls back to the server-only guard exactly as it
|
|
94
|
+
* behaves today. Absence therefore degrades to "decline and fork", never to
|
|
95
|
+
* an overwrite; a *stale* value degrades to a reported conflict.
|
|
96
|
+
*/
|
|
97
|
+
readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
98
|
+
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>;
|
|
99
|
+
}, undefined>, v.CheckAction<{
|
|
100
|
+
path: string;
|
|
101
|
+
root?: "project" | "global" | undefined;
|
|
102
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
103
|
+
rawContent: string;
|
|
104
|
+
lastModified: number;
|
|
105
|
+
content_hash: string;
|
|
106
|
+
members?: {
|
|
107
|
+
path: string;
|
|
108
|
+
rawContent: string;
|
|
109
|
+
lastModified: number;
|
|
110
|
+
content_hash: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
expectedVersion?: number | undefined;
|
|
113
|
+
skippedMemberPaths?: string[] | undefined;
|
|
114
|
+
}, "members are only supported on skill-md payloads">, v.CheckAction<{
|
|
115
|
+
path: string;
|
|
116
|
+
root?: "project" | "global" | undefined;
|
|
117
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
118
|
+
rawContent: string;
|
|
119
|
+
lastModified: number;
|
|
120
|
+
content_hash: string;
|
|
121
|
+
members?: {
|
|
122
|
+
path: string;
|
|
123
|
+
rawContent: string;
|
|
124
|
+
lastModified: number;
|
|
125
|
+
content_hash: string;
|
|
126
|
+
}[] | undefined;
|
|
127
|
+
expectedVersion?: number | undefined;
|
|
128
|
+
skippedMemberPaths?: string[] | undefined;
|
|
129
|
+
}, "skippedMemberPaths requires members">, v.CheckAction<{
|
|
130
|
+
path: string;
|
|
131
|
+
root?: "project" | "global" | undefined;
|
|
132
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
133
|
+
rawContent: string;
|
|
134
|
+
lastModified: number;
|
|
135
|
+
content_hash: string;
|
|
136
|
+
members?: {
|
|
137
|
+
path: string;
|
|
138
|
+
rawContent: string;
|
|
139
|
+
lastModified: number;
|
|
140
|
+
content_hash: string;
|
|
141
|
+
}[] | undefined;
|
|
142
|
+
expectedVersion?: number | undefined;
|
|
143
|
+
skippedMemberPaths?: string[] | undefined;
|
|
144
|
+
}, "member paths must be unique (case-insensitive)">]>;
|
|
145
|
+
export declare const GuideMemberFileSchema: v.ObjectSchema<{
|
|
146
|
+
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">]>;
|
|
147
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
|
|
148
|
+
readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
149
|
+
}, undefined>;
|
|
150
|
+
export declare const GuideMemberFilesResponseSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
151
|
+
readonly memberFiles: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
152
|
+
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">]>;
|
|
153
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "rawContent must be at most 524288 bytes">]>;
|
|
154
|
+
readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
155
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
156
|
+
path: string;
|
|
157
|
+
content: string;
|
|
158
|
+
contentHash: string;
|
|
159
|
+
}[], 64, undefined>]>;
|
|
160
|
+
}, undefined>, v.CheckAction<{
|
|
161
|
+
memberFiles: {
|
|
162
|
+
path: string;
|
|
163
|
+
content: string;
|
|
164
|
+
contentHash: string;
|
|
165
|
+
}[];
|
|
166
|
+
}, "member file paths must be unique (case-insensitive)">]>;
|
|
167
|
+
/** Max number of rules accepted in a single `POST /api/rules/import` request. */
|
|
168
|
+
export declare const MAX_RULES_IMPORT_BATCH = 100;
|
|
169
|
+
/** Opaque checkout digest shared by run logs, manifests, and `runs.repo_id`. */
|
|
170
|
+
export declare const RepoIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>;
|
|
171
|
+
/**
|
|
172
|
+
* A repo's declared portable identity. See `RulesImportRequestSchema.projectId`
|
|
173
|
+
* for why this is looser than {@link RepoIdSchema} — a declared id is
|
|
174
|
+
* human-authored and predates any prefix rule.
|
|
175
|
+
*/
|
|
176
|
+
export declare const ProjectIdSchema: 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">]>;
|
|
177
|
+
export declare const RulesImportRequestSchema: v.ObjectSchema<{
|
|
178
|
+
readonly rules: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnknownSchema, undefined>, v.MaxLengthAction<unknown[], 100, undefined>]>;
|
|
179
|
+
/**
|
|
180
|
+
* Which checkout these files came from — the same opaque digest the hook and
|
|
181
|
+
* the rule manifest already carry (`packages/cli/src/repo-id.ts`,
|
|
182
|
+
* `RuleManifestSchema.repoId`). Envelope-level, not per-file: every file in
|
|
183
|
+
* one import comes from one repo, and the per-file payload stays lean (the
|
|
184
|
+
* "Import endpoint payload" resolved decision).
|
|
185
|
+
*
|
|
186
|
+
* It is what lets the server reconcile an edited file back onto the guide it
|
|
187
|
+
* already created instead of inserting a second one. `origin` alone cannot:
|
|
188
|
+
* it is `file:{format}:{path}` with no repo component, so two checkouts
|
|
189
|
+
* sharing `.agents/code-style.md` would collide.
|
|
190
|
+
*
|
|
191
|
+
* **Optional, and its absence is not an error.** A CLI predating this field
|
|
192
|
+
* sends none, and the server falls back to the content-hash dedupe it always
|
|
193
|
+
* used. Never send a repo id derived anywhere but `repoIdFromRoot` — the
|
|
194
|
+
* digest is keyed by a machine-local secret precisely so the server never
|
|
195
|
+
* learns a path.
|
|
196
|
+
*
|
|
197
|
+
* Shaped by the canonical `RepoIdSchema` (shared with run logs and manifests)
|
|
198
|
+
* rather than a looser local check: a row storing anything but
|
|
199
|
+
* a real digest could never match one, so a malformed identity has to be
|
|
200
|
+
* rejected at the boundary instead of persisted as a permanent orphan.
|
|
201
|
+
*/
|
|
202
|
+
readonly repoId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>, undefined>;
|
|
203
|
+
/**
|
|
204
|
+
* The repo's **portable** identity — `project.id` from the committed
|
|
205
|
+
* `<repo>/.mossbear/config.json` (`guide-write-side-identity` slice 1, shipped in
|
|
206
|
+
* #540). This is what makes `(scope, path)` reconciliation portable, and it is
|
|
207
|
+
* the field `unified-item-sync` slice 2 exists to put on the wire.
|
|
208
|
+
*
|
|
209
|
+
* **Why `repoId` is not enough, even though it is already here.**
|
|
210
|
+
* `repoIdFromRoot` is an HMAC keyed by a machine-local secret
|
|
211
|
+
* (`packages/cli/src/repo-id.ts`), so the same checkout on two machines — or
|
|
212
|
+
* one teammate's clone versus another's — produces two different digests. A
|
|
213
|
+
* guide reconciled on it therefore forks the moment anyone else edits the
|
|
214
|
+
* file, which is the one-way trip this item is closing. `projectId` is
|
|
215
|
+
* declared in a committed file, so every clone agrees on it.
|
|
216
|
+
*
|
|
217
|
+
* **Optional, and its absence is not an error.** A CLI predating this field
|
|
218
|
+
* sends none and the server falls back to `repoId` scoping, which is exactly
|
|
219
|
+
* the behaviour those clients already have. A repo that has never run
|
|
220
|
+
* `mossbear init` also has no declaration, and must keep importing.
|
|
221
|
+
*
|
|
222
|
+
* Deliberately looser than `RepoIdSchema`: a generated id is
|
|
223
|
+
* `proj_`+hex, but a *declared* one is whatever a human committed —
|
|
224
|
+
* `readRepoProjectId` accepts any non-empty trimmed string
|
|
225
|
+
* (`packages/cli/src/docs/repo-config.ts`), and rejecting those here would
|
|
226
|
+
* break a shipped contract. Constrained only as far as it must be to serve as
|
|
227
|
+
* a storage key: no whitespace, no path separators, no control characters,
|
|
228
|
+
* bounded length.
|
|
229
|
+
*/
|
|
230
|
+
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>;
|
|
231
|
+
}, undefined>;
|
|
232
|
+
/**
|
|
233
|
+
* What the server did with one payload, reported per file so the CLI can update
|
|
234
|
+
* its machine-local baseline (`guide-versioned-identity-plan.md` → slice 2b-B).
|
|
235
|
+
*
|
|
236
|
+
* The distinction that matters is not "did something change" but **do disk and
|
|
237
|
+
* server now agree**: `imported`, `updated` and `skipped` all mean they do, and
|
|
238
|
+
* only those license recording a new baseline. `conflict` means the disk bytes
|
|
239
|
+
* did *not* land — recording the server's version for one would hand the next
|
|
240
|
+
* import a matching `expectedVersion` and turn a refused overwrite into an
|
|
241
|
+
* automatic one on the following run, which is the failure this whole precondition
|
|
242
|
+
* exists to prevent.
|
|
243
|
+
*/
|
|
244
|
+
export declare const GuideImportOutcomeSchema: v.PicklistSchema<["imported", "updated", "skipped", "conflict"], undefined>;
|
|
245
|
+
/**
|
|
246
|
+
* Per-payload import outcome, addressed by the same `(root, path)` pair the
|
|
247
|
+
* server reconciles on so the CLI can key its baseline identically without
|
|
248
|
+
* re-deriving anything.
|
|
249
|
+
*
|
|
250
|
+
* `version` is the body item's version **as the server holds it after this
|
|
251
|
+
* request** — the value a later import should send as `expectedVersion` once
|
|
252
|
+
* disk and server agree. It is reported for a `conflict` too, deliberately: the
|
|
253
|
+
* conflict report needs it to offer explicit resolution, and reporting it is not
|
|
254
|
+
* the same as recording it.
|
|
255
|
+
*
|
|
256
|
+
* Entries are omitted for a payload the server could not address at all (no
|
|
257
|
+
* `root`, or a pre-R0 row): there is no identity to key a baseline on, and
|
|
258
|
+
* inventing one would let a later import claim a precondition it never observed.
|
|
259
|
+
*/
|
|
260
|
+
export declare const GuideImportResultSchema: v.ObjectSchema<{
|
|
261
|
+
readonly root: v.PicklistSchema<["project", "global"], undefined>;
|
|
262
|
+
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">]>;
|
|
263
|
+
readonly outcome: v.PicklistSchema<["imported", "updated", "skipped", "conflict"], undefined>;
|
|
264
|
+
readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
265
|
+
}, undefined>;
|
|
266
|
+
export type GuideImportResult = v.InferOutput<typeof GuideImportResultSchema>;
|
|
267
|
+
export declare const RawGuideFileDeletionSchema: v.ObjectSchema<{
|
|
268
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
269
|
+
readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
|
|
270
|
+
}, undefined>;
|
|
271
|
+
/** Max number of deletions accepted in a single `POST /api/rules/deletions` request. */
|
|
272
|
+
export declare const MAX_RULE_DELETIONS_BATCH = 500;
|
|
273
|
+
export declare const RuleDeletionsRequestSchema: v.ObjectSchema<{
|
|
274
|
+
readonly deletions: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnknownSchema, undefined>, v.MaxLengthAction<unknown[], 500, undefined>]>;
|
|
275
|
+
}, undefined>;
|
|
276
|
+
export declare const BundleSchema: v.ObjectSchema<{
|
|
277
|
+
readonly id: v.StringSchema<undefined>;
|
|
278
|
+
readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
|
|
279
|
+
readonly name: v.StringSchema<undefined>;
|
|
280
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
281
|
+
}, undefined>;
|
|
282
|
+
export declare const BundleListResponseSchema: v.ObjectSchema<{
|
|
283
|
+
readonly bundles: v.ArraySchema<v.ObjectSchema<{
|
|
284
|
+
readonly id: v.StringSchema<undefined>;
|
|
285
|
+
readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
|
|
286
|
+
readonly name: v.StringSchema<undefined>;
|
|
287
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
288
|
+
}, undefined>, undefined>;
|
|
289
|
+
}, undefined>;
|
|
290
|
+
export declare const CreateBundleRequestSchema: v.ObjectSchema<{
|
|
291
|
+
readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
|
|
292
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
293
|
+
}, undefined>;
|
|
294
|
+
export declare const CreateBundleResponseSchema: v.ObjectSchema<{
|
|
295
|
+
readonly bundle: v.ObjectSchema<{
|
|
296
|
+
readonly id: v.StringSchema<undefined>;
|
|
297
|
+
readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
|
|
298
|
+
readonly name: v.StringSchema<undefined>;
|
|
299
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
300
|
+
}, undefined>;
|
|
301
|
+
}, undefined>;
|
|
302
|
+
export declare const BundleMemberTypeSchema: v.PicklistSchema<["guide_file", "guide"], undefined>;
|
|
303
|
+
export declare const AttachBundleMemberRequestSchema: v.ObjectSchema<{
|
|
304
|
+
readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
305
|
+
readonly itemType: v.OptionalSchema<v.PicklistSchema<["guide_file", "guide"], undefined>, undefined>;
|
|
306
|
+
}, undefined>;
|
|
307
|
+
export declare const AttachBundleMemberResponseSchema: v.ObjectSchema<{
|
|
308
|
+
readonly attached: v.BooleanSchema<undefined>;
|
|
309
|
+
}, undefined>;
|
|
310
|
+
export declare const DetachBundleMemberResponseSchema: v.ObjectSchema<{
|
|
311
|
+
readonly detached: v.BooleanSchema<undefined>;
|
|
312
|
+
}, undefined>;
|
|
313
|
+
export declare const RenameBundleRequestSchema: v.ObjectSchema<{
|
|
314
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
315
|
+
}, undefined>;
|
|
316
|
+
export declare const RenameBundleResponseSchema: v.ObjectSchema<{
|
|
317
|
+
readonly bundle: v.ObjectSchema<{
|
|
318
|
+
readonly id: v.StringSchema<undefined>;
|
|
319
|
+
readonly slug: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "slug must be lowercase alphanumeric with hyphens">]>;
|
|
320
|
+
readonly name: v.StringSchema<undefined>;
|
|
321
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
322
|
+
}, undefined>;
|
|
323
|
+
}, undefined>;
|
|
324
|
+
export declare const DeleteBundleResponseSchema: v.ObjectSchema<{
|
|
325
|
+
readonly deleted: v.BooleanSchema<undefined>;
|
|
326
|
+
}, undefined>;
|
|
327
|
+
export declare const ContextItemTypeSchema: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
328
|
+
export declare const PushContentTypeSchema: v.PicklistSchema<["document", "reference", "asset"], undefined>;
|
|
329
|
+
export declare const InboxContentTypeSchema: v.PicklistSchema<["document", "asset"], undefined>;
|
|
330
|
+
/** Max serialized size (UTF-8 bytes) of a pushed or captured item's content. */
|
|
331
|
+
export declare const MAX_CONTEXT_CONTENT_BYTES: number;
|
|
332
|
+
export declare const ContextItemSchema: v.ObjectSchema<{
|
|
333
|
+
readonly id: v.StringSchema<undefined>;
|
|
334
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
335
|
+
readonly name: v.StringSchema<undefined>;
|
|
336
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
337
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
338
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
339
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
340
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
341
|
+
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>;
|
|
342
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
343
|
+
}, undefined>;
|
|
344
|
+
export declare const ContextItemsResponseSchema: v.ObjectSchema<{
|
|
345
|
+
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
346
|
+
readonly id: v.StringSchema<undefined>;
|
|
347
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
348
|
+
readonly name: v.StringSchema<undefined>;
|
|
349
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
350
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
351
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
352
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
353
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
354
|
+
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>;
|
|
355
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
356
|
+
}, undefined>, undefined>;
|
|
357
|
+
}, undefined>;
|
|
358
|
+
/** Max number of context item ids a push may cite as its transform sources. */
|
|
359
|
+
export declare const MAX_TRANSFORM_SOURCE_IDS = 100;
|
|
360
|
+
/**
|
|
361
|
+
* The ids of the caller-owned context items a pushed document was produced
|
|
362
|
+
* from (inbox captures, bundle items — any item the caller owns). Shared
|
|
363
|
+
* between the REST contract and the MCP tool's client-side arg validation so
|
|
364
|
+
* the two can't drift.
|
|
365
|
+
*/
|
|
366
|
+
export declare const SourceItemIdsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 100, undefined>]>;
|
|
367
|
+
export declare const UpdatableSourceItemIdsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>;
|
|
368
|
+
export declare const PushContextRequestSchema: v.ObjectSchema<{
|
|
369
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
370
|
+
readonly contentType: v.PicklistSchema<["document", "reference", "asset"], undefined>;
|
|
371
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
|
|
372
|
+
readonly itemId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
373
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
374
|
+
readonly sourceItemIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
375
|
+
}, undefined>;
|
|
376
|
+
export declare const PushContextResponseSchema: v.ObjectSchema<{
|
|
377
|
+
readonly item: v.ObjectSchema<{
|
|
378
|
+
readonly id: v.StringSchema<undefined>;
|
|
379
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
380
|
+
readonly name: v.StringSchema<undefined>;
|
|
381
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
382
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
383
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
384
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
385
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
386
|
+
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>;
|
|
387
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
388
|
+
}, undefined>;
|
|
389
|
+
readonly created: v.BooleanSchema<undefined>;
|
|
390
|
+
}, undefined>;
|
|
391
|
+
export declare const UpdateContextItemRequestSchema: v.ObjectSchema<{
|
|
392
|
+
readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
393
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
394
|
+
readonly content: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 524288 bytes">]>, undefined>;
|
|
395
|
+
readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
396
|
+
readonly sourceItemIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
397
|
+
}, undefined>;
|
|
398
|
+
export declare const UpdateContextItemResponseSchema: v.ObjectSchema<{
|
|
399
|
+
readonly item: v.ObjectSchema<{
|
|
400
|
+
readonly id: v.StringSchema<undefined>;
|
|
401
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
402
|
+
readonly name: v.StringSchema<undefined>;
|
|
403
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
404
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
405
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
406
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
407
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
408
|
+
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>;
|
|
409
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
410
|
+
}, undefined>;
|
|
411
|
+
readonly updated: v.BooleanSchema<undefined>;
|
|
412
|
+
}, undefined>;
|
|
413
|
+
export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
|
|
414
|
+
readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
415
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
416
|
+
readonly content: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 524288 bytes">]>, undefined>;
|
|
417
|
+
readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
418
|
+
readonly sourceItemIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
419
|
+
}, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
|
|
420
|
+
readonly entries: Omit<{
|
|
421
|
+
readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
422
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
423
|
+
readonly content: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 524288 bytes">]>, undefined>;
|
|
424
|
+
readonly expectedVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
425
|
+
readonly sourceItemIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
426
|
+
}, "itemId">;
|
|
427
|
+
readonly "~standard": v.StandardProps<{
|
|
428
|
+
content?: string | undefined;
|
|
429
|
+
expectedVersion?: number | undefined;
|
|
430
|
+
name?: string | undefined;
|
|
431
|
+
sourceItemIds?: string[] | undefined;
|
|
432
|
+
}, {
|
|
433
|
+
content?: string | undefined;
|
|
434
|
+
expectedVersion?: number | undefined;
|
|
435
|
+
name?: string | undefined;
|
|
436
|
+
sourceItemIds?: string[] | undefined;
|
|
437
|
+
}>;
|
|
438
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
439
|
+
content?: string | undefined;
|
|
440
|
+
expectedVersion?: number | undefined;
|
|
441
|
+
name?: string | undefined;
|
|
442
|
+
sourceItemIds?: string[] | undefined;
|
|
443
|
+
}, v.StringIssue | v.MinLengthIssue<string, 1> | v.CheckIssue<string> | v.NumberIssue | v.IntegerIssue<number> | v.ArrayIssue | v.ObjectIssue | v.MinValueIssue<number, 1> | v.MaxLengthIssue<string, 200> | v.MaxLengthIssue<string[], 100>>;
|
|
444
|
+
readonly "~types"?: {
|
|
445
|
+
readonly input: {
|
|
446
|
+
content?: string | undefined;
|
|
447
|
+
expectedVersion?: number | undefined;
|
|
448
|
+
name?: string | undefined;
|
|
449
|
+
sourceItemIds?: string[] | undefined;
|
|
450
|
+
};
|
|
451
|
+
readonly output: {
|
|
452
|
+
content?: string | undefined;
|
|
453
|
+
expectedVersion?: number | undefined;
|
|
454
|
+
name?: string | undefined;
|
|
455
|
+
sourceItemIds?: string[] | undefined;
|
|
456
|
+
};
|
|
457
|
+
readonly issue: v.StringIssue | v.MinLengthIssue<string, 1> | v.CheckIssue<string> | v.NumberIssue | v.IntegerIssue<number> | v.ArrayIssue | v.ObjectIssue | v.MinValueIssue<number, 1> | v.MaxLengthIssue<string, 200> | v.MaxLengthIssue<string[], 100>;
|
|
458
|
+
} | undefined;
|
|
459
|
+
};
|
|
460
|
+
/** A single canonical item, for the item-scoped read route. */
|
|
461
|
+
export declare const ContextItemResponseSchema: v.ObjectSchema<{
|
|
462
|
+
readonly item: v.ObjectSchema<{
|
|
463
|
+
readonly id: v.StringSchema<undefined>;
|
|
464
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
465
|
+
readonly name: v.StringSchema<undefined>;
|
|
466
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
467
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
468
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
469
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
470
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
471
|
+
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>;
|
|
472
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
473
|
+
}, undefined>;
|
|
474
|
+
}, undefined>;
|
|
475
|
+
export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
|
|
476
|
+
readonly archived: v.BooleanSchema<undefined>;
|
|
477
|
+
readonly item: v.ObjectSchema<{
|
|
478
|
+
readonly id: v.StringSchema<undefined>;
|
|
479
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
480
|
+
readonly name: v.StringSchema<undefined>;
|
|
481
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
482
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
483
|
+
readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
484
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
485
|
+
readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
|
|
486
|
+
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>;
|
|
487
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
488
|
+
}, undefined>;
|
|
489
|
+
}, undefined>;
|
|
490
|
+
export declare const InboxCaptureRequestSchema: v.ObjectSchema<{
|
|
491
|
+
readonly contentType: v.PicklistSchema<["document", "asset"], undefined>;
|
|
492
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
|
|
493
|
+
readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
|
|
494
|
+
readonly source: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
495
|
+
}, undefined>;
|
|
496
|
+
export declare const InboxItemSchema: v.ObjectSchema<{
|
|
497
|
+
readonly id: v.StringSchema<undefined>;
|
|
498
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
499
|
+
readonly name: v.StringSchema<undefined>;
|
|
500
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
501
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
502
|
+
readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
503
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
504
|
+
readonly capturedAt: v.StringSchema<undefined>;
|
|
505
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
506
|
+
}, undefined>;
|
|
507
|
+
export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
|
|
508
|
+
readonly item: v.ObjectSchema<{
|
|
509
|
+
readonly id: v.StringSchema<undefined>;
|
|
510
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
511
|
+
readonly name: v.StringSchema<undefined>;
|
|
512
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
513
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
514
|
+
readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
515
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
516
|
+
readonly capturedAt: v.StringSchema<undefined>;
|
|
517
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
518
|
+
}, undefined>;
|
|
519
|
+
}, undefined>;
|
|
520
|
+
export declare const InboxListResponseSchema: v.ObjectSchema<{
|
|
521
|
+
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
522
|
+
readonly id: v.StringSchema<undefined>;
|
|
523
|
+
readonly type: v.PicklistSchema<["guide", "document", "reference", "asset"], undefined>;
|
|
524
|
+
readonly name: v.StringSchema<undefined>;
|
|
525
|
+
readonly contentType: v.StringSchema<undefined>;
|
|
526
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
527
|
+
readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
528
|
+
readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
529
|
+
readonly capturedAt: v.StringSchema<undefined>;
|
|
530
|
+
readonly updatedAt: v.StringSchema<undefined>;
|
|
531
|
+
}, undefined>, undefined>;
|
|
532
|
+
}, undefined>;
|
|
533
|
+
/** Max number of ids accepted in a single `POST /api/v1/context/inbox/archive` request. */
|
|
534
|
+
export declare const MAX_INBOX_ARCHIVE_BATCH = 500;
|
|
535
|
+
export declare const InboxArchiveRequestSchema: v.ObjectSchema<{
|
|
536
|
+
readonly ids: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>, v.MaxLengthAction<string[], 500, undefined>]>;
|
|
537
|
+
}, undefined>;
|
|
538
|
+
export declare const InboxArchiveResponseSchema: v.ObjectSchema<{
|
|
539
|
+
readonly archived: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
540
|
+
}, undefined>;
|
|
541
|
+
export declare const ContextItemVersionSchema: v.ObjectSchema<{
|
|
542
|
+
readonly id: v.StringSchema<undefined>;
|
|
543
|
+
readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
544
|
+
readonly contentHash: v.StringSchema<undefined>;
|
|
545
|
+
readonly authorType: v.StringSchema<undefined>;
|
|
546
|
+
readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
|
|
547
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
548
|
+
}, undefined>;
|
|
549
|
+
export declare const ContextItemVersionDetailSchema: v.ObjectSchema<{
|
|
550
|
+
readonly id: v.StringSchema<undefined>;
|
|
551
|
+
readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
552
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
553
|
+
readonly contentHash: v.StringSchema<undefined>;
|
|
554
|
+
readonly authorType: v.StringSchema<undefined>;
|
|
555
|
+
readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
|
|
556
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
557
|
+
}, undefined>;
|
|
558
|
+
export declare const ContextItemVersionsResponseSchema: v.ObjectSchema<{
|
|
559
|
+
readonly versions: v.ArraySchema<v.ObjectSchema<{
|
|
560
|
+
readonly id: v.StringSchema<undefined>;
|
|
561
|
+
readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
562
|
+
readonly contentHash: v.StringSchema<undefined>;
|
|
563
|
+
readonly authorType: v.StringSchema<undefined>;
|
|
564
|
+
readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
|
|
565
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
566
|
+
}, undefined>, undefined>;
|
|
567
|
+
readonly nextCursor: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
568
|
+
}, undefined>;
|
|
569
|
+
export declare const ContextItemVersionResponseSchema: v.ObjectSchema<{
|
|
570
|
+
readonly version: v.ObjectSchema<{
|
|
571
|
+
readonly id: v.StringSchema<undefined>;
|
|
572
|
+
readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
573
|
+
readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
574
|
+
readonly contentHash: v.StringSchema<undefined>;
|
|
575
|
+
readonly authorType: v.StringSchema<undefined>;
|
|
576
|
+
readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
|
|
577
|
+
readonly createdAt: v.StringSchema<undefined>;
|
|
578
|
+
}, undefined>;
|
|
579
|
+
}, undefined>;
|
|
580
|
+
/** Default and max page size for the version-history list endpoint. */
|
|
581
|
+
export declare const DEFAULT_VERSIONS_LIMIT = 50;
|
|
582
|
+
export declare const MAX_VERSIONS_LIMIT = 200;
|
|
583
|
+
export declare const ProposalCitationSchema: v.ObjectSchema<{
|
|
584
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
585
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
586
|
+
readonly summary: v.StringSchema<undefined>;
|
|
587
|
+
}, undefined>;
|
|
588
|
+
/** Max serialized size of an action's `metadata` field — bounds storage bloat. */
|
|
589
|
+
export declare const MAX_ACTION_METADATA_BYTES: number;
|
|
590
|
+
/**
|
|
591
|
+
* Identity of the skill an agent loaded, captured by the logger hook from a
|
|
592
|
+
* `Skill` tool call (docs/plans/run-level-grading-plan.md, Slice 0).
|
|
593
|
+
*
|
|
594
|
+
* Two fields because the hook can only ever be sure of one of them:
|
|
595
|
+
*
|
|
596
|
+
* - `name` is `tool_input.skill` verbatim — always present, never qualified.
|
|
597
|
+
* Two skills that share a directory name (`.claude/skills/review` and
|
|
598
|
+
* `.agents/skills/review`) are indistinguishable by it, which is review
|
|
599
|
+
* finding 5 on PR #387.
|
|
600
|
+
* - `path` is the skill's *directory*, relative to the discovery root the
|
|
601
|
+
* guide import walks and in the same posix form its `origin` carries
|
|
602
|
+
* (`.claude/skills/review`). This is the qualified identity: it is exactly
|
|
603
|
+
* `guides.origin`'s path with the trailing `/SKILL.md` removed, so the two
|
|
604
|
+
* sides of the join are the same string rather than two derivations of it.
|
|
605
|
+
* Optional because the hook resolves it by probing the filesystem: a skill
|
|
606
|
+
* that lives somewhere the probe does not look (a plugin skill, a
|
|
607
|
+
* `~/.claude/skills` skill, a session whose cwd is not the repo root) has a
|
|
608
|
+
* name and no path, and matching falls back to the name.
|
|
609
|
+
*/
|
|
610
|
+
export declare const ActionSkillLoadSchema: v.ObjectSchema<{
|
|
611
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
612
|
+
readonly path: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
613
|
+
}, undefined>;
|
|
614
|
+
/**
|
|
615
|
+
* The `actions.action_type` a skill load is stored under.
|
|
616
|
+
*
|
|
617
|
+
* Deliberately **not** a member of `KNOWN_ACTION_TYPES` below, even though the
|
|
618
|
+
* CLI emits it on purpose. A skill load is evidence about what was in the
|
|
619
|
+
* agent's *context*, not a piece of work anyone should grade — it is an input to
|
|
620
|
+
* `inContextGuides`, never a row the grader judges (`gradeableActions.ts`
|
|
621
|
+
* filters it out). Keeping it out of the known-vocabulary list is what stops it
|
|
622
|
+
* being treated as gradeable work by anything that enumerates that list.
|
|
623
|
+
*/
|
|
624
|
+
export declare const SKILL_LOAD_ACTION_TYPE = "skill_load";
|
|
625
|
+
/**
|
|
626
|
+
* A machine-shaped label for *why* a tool call failed — `ENOENT`, `TimeoutError`,
|
|
627
|
+
* `permission_denied`.
|
|
628
|
+
*
|
|
629
|
+
* Deliberately not free text. An error *message* is content: it quotes file
|
|
630
|
+
* contents, stderr and third-party data, which is exactly the class
|
|
631
|
+
* `content-sync-privacy` gates and `sanitizeCommand` cannot redact (it targets
|
|
632
|
+
* shell syntax, not prose). A class is metadata, so it rides the same
|
|
633
|
+
* unblocked path as the exit code. The character set admits identifiers and
|
|
634
|
+
* dotted/namespaced codes and nothing else; anything failing it is dropped
|
|
635
|
+
* rather than truncated, because half an error class is not a smaller fact, it
|
|
636
|
+
* is a different one.
|
|
637
|
+
*/
|
|
638
|
+
export declare const ActionErrorClassSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "errorClass must be 1-32 chars of [A-Za-z0-9_.:-]">]>;
|
|
639
|
+
/**
|
|
640
|
+
* Whether a logged tool call actually succeeded
|
|
641
|
+
* (docs/plans/action-evidence-sync-plan.md — the outcome-metadata slice).
|
|
642
|
+
*
|
|
643
|
+
* The logger hook parsed `tool_input` and dropped the `tool_response` beside
|
|
644
|
+
* it, so every action reached the grader looking like it had happened. A failed
|
|
645
|
+
* edit and a successful one rendered identically, and the run grader has no
|
|
646
|
+
* other way to tell them apart.
|
|
647
|
+
*
|
|
648
|
+
* **Absent means unknown, never success.** The hook emits this only from a
|
|
649
|
+
* response shape it recognizes (`extractActionOutcome`), and agent tool
|
|
650
|
+
* responses vary per tool and per platform; a guess here would be worse than
|
|
651
|
+
* silence, because the grader would weigh it. `status` is therefore the only
|
|
652
|
+
* required field, and the whole object is optional everywhere it appears.
|
|
653
|
+
*/
|
|
654
|
+
export declare const ActionOutcomeSchema: v.ObjectSchema<{
|
|
655
|
+
readonly status: v.PicklistSchema<["ok", "error"], undefined>;
|
|
656
|
+
readonly errorClass: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "errorClass must be 1-32 chars of [A-Za-z0-9_.:-]">]>, undefined>;
|
|
657
|
+
/**
|
|
658
|
+
* Bounded to a signed 16-bit range, which covers every real exit status
|
|
659
|
+
* (0-255, 128+signal, and Node's -1) with room to spare. The bound is a line
|
|
660
|
+
* length bound as much as a validity one: this renders into the grading
|
|
661
|
+
* prompt, where every field is capped.
|
|
662
|
+
*/
|
|
663
|
+
readonly exitCode: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, -32768, undefined>, v.MaxValueAction<number, 32767, undefined>]>, undefined>;
|
|
664
|
+
}, undefined>;
|
|
665
|
+
/**
|
|
666
|
+
* Longest narration field accepted on the wire.
|
|
667
|
+
*
|
|
668
|
+
* Matches `MAX_PROSE_CHARS` in `@mossbear/eval-core`, which is the cap the
|
|
669
|
+
* client-side redactor already applies. Duplicated as a literal rather than
|
|
670
|
+
* imported because the dependency runs the other way — `@mossbear/eval-core`
|
|
671
|
+
* depends on this package — and inverting it to share one constant would make
|
|
672
|
+
* the wire contract depend on the evaluation package. The number is a bound, so
|
|
673
|
+
* a drift between them fails safe in the direction that matters: the server
|
|
674
|
+
* refusing something the client would have sent, never the reverse.
|
|
675
|
+
*/
|
|
676
|
+
export declare const MAX_ACTION_NARRATION_CHARS = 2000;
|
|
677
|
+
/**
|
|
678
|
+
* Transcript evidence attached to an action
|
|
679
|
+
* (docs/plans/transcript-content-classes-plan.md — the founder's class call of
|
|
680
|
+
* 2026-08-13).
|
|
681
|
+
*
|
|
682
|
+
* **Two fields, and the omissions are the specification.** The class table
|
|
683
|
+
* decides that user turns and assistant *prose* sync prose-redacted, assistant
|
|
684
|
+
* code blocks are stripped to a language-and-line-count placeholder, and
|
|
685
|
+
* tool-result bodies **never** sync. There is therefore no field here for a
|
|
686
|
+
* tool result, no field for a code-block body, and no field for a diff.
|
|
687
|
+
*
|
|
688
|
+
* **`strictObject`, so a body that carries one is rejected rather than
|
|
689
|
+
* trimmed.** This is the same decision `StrictActionOutcomeSchema` above makes
|
|
690
|
+
* and for a sharper version of the same reason. A permissive `v.object` strips
|
|
691
|
+
* unknown keys on output, which would turn a client sending
|
|
692
|
+
* `narration.toolResult` into a *silently accepted* request: the sender is told
|
|
693
|
+
* it worked, learns nothing, and keeps sending. Trimming is a policy that fails
|
|
694
|
+
* open — it makes an over-sharing client indistinguishable from a correct one.
|
|
695
|
+
* Rejecting makes the class table enforceable against a client the server does
|
|
696
|
+
* not control, which is the only kind of enforcement worth having here; the
|
|
697
|
+
* CLI's own choke point (`packages/cli/src/transcript/narration.ts`) is the
|
|
698
|
+
* first line, not the last.
|
|
699
|
+
*
|
|
700
|
+
* The forward-compatibility cost is the same as `outcome`'s, and so is the
|
|
701
|
+
* ordering that pays it: widen this schema and deploy the server before any
|
|
702
|
+
* CLI starts sending a new narration field.
|
|
703
|
+
*/
|
|
704
|
+
export declare const ActionNarrationSchema: v.StrictObjectSchema<{
|
|
705
|
+
/**
|
|
706
|
+
* The user turn this action followed — prose-redacted on the user's machine.
|
|
707
|
+
*
|
|
708
|
+
* **Not every message with `role: 'user'`.** A tool result is delivered as a
|
|
709
|
+
* user-role message whose content is a `tool_result` block, so the client
|
|
710
|
+
* selects on content-block type rather than role
|
|
711
|
+
* (`packages/cli/src/transcript/messages.ts`). Nothing on this side can tell
|
|
712
|
+
* the difference after the fact, which is why the client selects
|
|
713
|
+
* structurally and this schema constrains the shape rather than the content.
|
|
714
|
+
*/
|
|
715
|
+
readonly userText: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, undefined>;
|
|
716
|
+
/**
|
|
717
|
+
* Assistant prose adjacent to the tool call — code blocks structurally
|
|
718
|
+
* removed, then prose-redacted, then windowed, all on the user's machine.
|
|
719
|
+
*/
|
|
720
|
+
readonly assistantText: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, undefined>;
|
|
721
|
+
}, undefined>;
|
|
722
|
+
export type ActionNarration = v.InferOutput<typeof ActionNarrationSchema>;
|
|
723
|
+
export declare const TokenUsageSchema: v.ObjectSchema<{
|
|
724
|
+
readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
725
|
+
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
726
|
+
readonly inputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
727
|
+
readonly outputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
728
|
+
readonly cacheReadTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
729
|
+
readonly cacheWriteTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
730
|
+
}, undefined>;
|
|
731
|
+
export declare const DashboardRunUsageSchema: v.ObjectSchema<{
|
|
732
|
+
readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
733
|
+
readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
734
|
+
readonly usage: v.ArraySchema<v.ObjectSchema<{
|
|
735
|
+
readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
736
|
+
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
737
|
+
readonly inputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
738
|
+
readonly outputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
739
|
+
readonly cacheReadTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
740
|
+
readonly cacheWriteTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
741
|
+
}, undefined>, undefined>;
|
|
742
|
+
}, undefined>;
|
|
743
|
+
export declare const SkillUsageEntrySchema: v.ObjectSchema<{
|
|
744
|
+
readonly skillName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
745
|
+
readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
746
|
+
readonly inputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
747
|
+
readonly cacheWriteTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
748
|
+
}, undefined>;
|
|
749
|
+
export declare const DashboardSkillUsageSchema: v.ObjectSchema<{
|
|
750
|
+
readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
751
|
+
readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
752
|
+
readonly usage: v.ArraySchema<v.ObjectSchema<{
|
|
753
|
+
readonly skillName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
754
|
+
readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
755
|
+
readonly inputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
756
|
+
readonly cacheWriteTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
757
|
+
}, undefined>, undefined>;
|
|
758
|
+
}, undefined>;
|
|
759
|
+
export declare const DashboardSyncActionSchema: v.ObjectSchema<{
|
|
760
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must not contain whitespace or control characters">]>, undefined>;
|
|
761
|
+
readonly adapterId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
762
|
+
readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
763
|
+
/**
|
|
764
|
+
* Optional on the wire, but **required to be graded**: runs are the only
|
|
765
|
+
* grading unit, and an action with no session joins no run
|
|
766
|
+
* (docs/plans/run-level-grading-plan.md). The field stays optional because
|
|
767
|
+
* tightening it would 400 a whole batch — a poison pill for any queue file
|
|
768
|
+
* carrying one — and no shipped CLI omits it: the hook always writes a
|
|
769
|
+
* session id, falling back to the literal `'unknown'`
|
|
770
|
+
* (`packages/cli/src/hook-logger.ts:129`), which groups into a run like any
|
|
771
|
+
* other. A direct API caller that omits it gets its actions stored and
|
|
772
|
+
* ungraded, and the server logs `sync.actions_without_session` so the case is
|
|
773
|
+
* visible rather than silent.
|
|
774
|
+
*/
|
|
775
|
+
readonly sessionId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
776
|
+
readonly actionType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
777
|
+
readonly summary: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
|
|
778
|
+
readonly filePaths: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1024, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
779
|
+
readonly verdict: v.OptionalSchema<v.PicklistSchema<["aligned", "unguided", "misaligned"], undefined>, undefined>;
|
|
780
|
+
readonly gradingTier: v.OptionalSchema<v.PicklistSchema<["pattern_match", "cached", "llm", "batch", "unguided"], undefined>, undefined>;
|
|
781
|
+
readonly guideIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
782
|
+
readonly violatedGuideId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
783
|
+
readonly evalReasoning: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
784
|
+
readonly metadata: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, v.CheckAction<{
|
|
785
|
+
[x: string]: unknown;
|
|
786
|
+
}, "metadata must serialize to at most 16384 bytes">, v.CheckAction<{
|
|
787
|
+
[x: string]: unknown;
|
|
788
|
+
}, "metadata.skill must be { name: string, path?: string }">, v.CheckAction<{
|
|
789
|
+
[x: string]: unknown;
|
|
790
|
+
}, "metadata.repoId must be repo_ followed by 32 hex chars">, v.CheckAction<{
|
|
791
|
+
[x: string]: unknown;
|
|
792
|
+
}, "metadata.outcome must be { status: \"ok\" | \"error\", errorClass?: string, exitCode?: number } with no other keys">]>, undefined>, undefined>;
|
|
793
|
+
/**
|
|
794
|
+
* Transcript evidence for this action. See {@link ActionNarrationSchema}.
|
|
795
|
+
*
|
|
796
|
+
* A top-level field rather than a `metadata` key, and that is a decision
|
|
797
|
+
* rather than a style choice (design review, 2026-08-15): `metadata` is an
|
|
798
|
+
* open record holding *metadata* under one shared 16 KB budget, and this is
|
|
799
|
+
* content — the first content an action carries. It lands in its own column
|
|
800
|
+
* server-side for the same reason.
|
|
801
|
+
*
|
|
802
|
+
* **No shipped CLI sends this yet.** Slice 2 builds the extraction and both
|
|
803
|
+
* halves of the enforcement; Slice 3 adds the column and the disclosure
|
|
804
|
+
* surface and is what turns it on, so nothing begins leaving a user's machine
|
|
805
|
+
* a release before the panel describing it.
|
|
806
|
+
*/
|
|
807
|
+
readonly narration: v.OptionalSchema<v.StrictObjectSchema<{
|
|
808
|
+
/**
|
|
809
|
+
* The user turn this action followed — prose-redacted on the user's machine.
|
|
810
|
+
*
|
|
811
|
+
* **Not every message with `role: 'user'`.** A tool result is delivered as a
|
|
812
|
+
* user-role message whose content is a `tool_result` block, so the client
|
|
813
|
+
* selects on content-block type rather than role
|
|
814
|
+
* (`packages/cli/src/transcript/messages.ts`). Nothing on this side can tell
|
|
815
|
+
* the difference after the fact, which is why the client selects
|
|
816
|
+
* structurally and this schema constrains the shape rather than the content.
|
|
817
|
+
*/
|
|
818
|
+
readonly userText: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, undefined>;
|
|
819
|
+
/**
|
|
820
|
+
* Assistant prose adjacent to the tool call — code blocks structurally
|
|
821
|
+
* removed, then prose-redacted, then windowed, all on the user's machine.
|
|
822
|
+
*/
|
|
823
|
+
readonly assistantText: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, undefined>;
|
|
824
|
+
}, undefined>, undefined>;
|
|
825
|
+
/**
|
|
826
|
+
* Version of the CLI that *produced* this action's verdict.
|
|
827
|
+
*
|
|
828
|
+
* **No shipped CLI sends this any more.** Its only writer was `mossbear verdict
|
|
829
|
+
* record`, whose queue files could outlive an upgrade, which is why the
|
|
830
|
+
* per-action version was distinguished from the request-level one at all.
|
|
831
|
+
* That command is gone (docs/plans/cli-local-grading-removal-plan.md) and no
|
|
832
|
+
* client-side verdict exists to attribute.
|
|
833
|
+
*
|
|
834
|
+
* Kept on the wire for one release so an un-upgraded CLI's queued verdicts
|
|
835
|
+
* are not rejected mid-migration; the field and the `actions.cli_version`
|
|
836
|
+
* column it feeds are dropped together (`action-cli-version-column-drop`).
|
|
837
|
+
* For the CLI making the request — which is live, and what
|
|
838
|
+
* `enforceCliVersionFloor` reads — see `DashboardSyncRequestSchema`.
|
|
839
|
+
*/
|
|
840
|
+
readonly cliVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
|
|
841
|
+
}, undefined>;
|
|
842
|
+
export declare const DashboardGuideSuggestionSchema: v.ObjectSchema<{
|
|
843
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
844
|
+
readonly content: v.StringSchema<undefined>;
|
|
845
|
+
readonly reasoning: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
846
|
+
readonly triggerType: v.PicklistSchema<["uncovered", "ambiguous", "performance_pattern", "conversational_feedback"], undefined>;
|
|
847
|
+
readonly sourceActionIds: v.OptionalSchema<v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.ObjectSchema<{
|
|
848
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
849
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
850
|
+
readonly summary: v.StringSchema<undefined>;
|
|
851
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
852
|
+
readonly status: v.OptionalSchema<v.PicklistSchema<["pending", "accepted", "dismissed"], undefined>, undefined>;
|
|
853
|
+
}, undefined>;
|
|
854
|
+
export declare const DashboardFeedbackCandidateSchema: v.ObjectSchema<{
|
|
855
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
856
|
+
readonly signal: v.StringSchema<undefined>;
|
|
857
|
+
readonly signalType: v.PicklistSchema<["correction", "approval", "implied_preference", "stated_preference", "skill_suggestion"], undefined>;
|
|
858
|
+
readonly confidence: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
|
|
859
|
+
readonly occurrences: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
860
|
+
readonly status: v.OptionalSchema<v.PicklistSchema<["inferred", "confirmed", "dismissed"], undefined>, undefined>;
|
|
861
|
+
}, undefined>;
|
|
862
|
+
/** Max number of actions accepted in a single `POST /api/sync` request. */
|
|
863
|
+
export declare const MAX_SYNC_ACTIONS_BATCH = 500;
|
|
864
|
+
/** Max number of guideSuggestions/feedbackCandidates/runUsage entries per sync request. */
|
|
865
|
+
export declare const MAX_SYNC_AUX_BATCH = 100;
|
|
866
|
+
/**
|
|
867
|
+
* Max rule files one delivery manifest enumerates. Well above what a real repo
|
|
868
|
+
* carries (this one: ~20), and bounded because the manifest rides every
|
|
869
|
+
* action-carrying batch: an unbounded list would multiply across a chunked
|
|
870
|
+
* sync. Overflow sets `truncated` rather than being dropped silently.
|
|
871
|
+
*/
|
|
872
|
+
export declare const MAX_RULE_MANIFEST_FILES = 500;
|
|
873
|
+
/**
|
|
874
|
+
* A rule file observed on disk in the repo `mossbear sync` ran from.
|
|
875
|
+
*
|
|
876
|
+
* `path` is relative to that repo root, in exactly the form `payloadPath`
|
|
877
|
+
* takes at import time (`packages/cli/src/rules/discover.ts`), so
|
|
878
|
+
* `file:{format}:{path}` reconstructs the `origin` the dashboard stored for
|
|
879
|
+
* the guide this file produced. That reconstruction is the whole join; nothing
|
|
880
|
+
* else about the file is needed and nothing else is sent.
|
|
881
|
+
*
|
|
882
|
+
* **Never any content.** `contentHash` is the same sha256 the import payload
|
|
883
|
+
* carries, present so a later slice can tell "delivered" from "delivered but
|
|
884
|
+
* edited since import" without shipping the bytes again.
|
|
885
|
+
*/
|
|
886
|
+
export declare const RuleManifestFileSchema: v.ObjectSchema<{
|
|
887
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
|
|
888
|
+
readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
|
|
889
|
+
readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
890
|
+
}, undefined>;
|
|
891
|
+
/**
|
|
892
|
+
* Which rule files were actually on disk in the repo this sync ran from —
|
|
893
|
+
* observed delivery, replacing the assumption that every non-skill active
|
|
894
|
+
* guide reached the agent (docs/plans/run-level-grading-plan.md, review
|
|
895
|
+
* finding 3). Without it, an account with several repos, or a
|
|
896
|
+
* dashboard-authored guide never exported anywhere, is graded against
|
|
897
|
+
* instructions the agent never received.
|
|
898
|
+
*
|
|
899
|
+
* `repoId` is an opaque, machine-local digest — deliberately not a path, a
|
|
900
|
+
* remote URL, or a repo name. Its only job is to keep two checkouts on the
|
|
901
|
+
* same account distinguishable, which is the half of review finding 5 that
|
|
902
|
+
* repo-root-relative origins cannot express: two repos each holding
|
|
903
|
+
* `.claude/skills/review` produce byte-identical origins by construction. See
|
|
904
|
+
* `repoIdFromRoot` (`packages/cli/src/rules/manifest.ts`) for how it is
|
|
905
|
+
* derived and why that derivation is privacy-safe.
|
|
906
|
+
*/
|
|
907
|
+
export declare const RuleFileManifestSchema: v.ObjectSchema<{
|
|
908
|
+
readonly repoId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>;
|
|
909
|
+
readonly files: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
910
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
|
|
911
|
+
readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
|
|
912
|
+
readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
913
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
914
|
+
path: string;
|
|
915
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
916
|
+
contentHash: string;
|
|
917
|
+
}[], 500, undefined>]>;
|
|
918
|
+
/**
|
|
919
|
+
* The repo held more rule files than the cap, so `files` is a prefix. Set
|
|
920
|
+
* rather than silently trimmed: a manifest read as complete would mark the
|
|
921
|
+
* omitted files' guides undelivered, which is the exact wrong-verdict
|
|
922
|
+
* failure this field exists to prevent.
|
|
923
|
+
*/
|
|
924
|
+
readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
925
|
+
}, undefined>;
|
|
926
|
+
export declare const DashboardSyncRequestSchema: v.ObjectSchema<{
|
|
927
|
+
readonly actions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
928
|
+
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must not contain whitespace or control characters">]>, undefined>;
|
|
929
|
+
readonly adapterId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
930
|
+
readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
931
|
+
/**
|
|
932
|
+
* Optional on the wire, but **required to be graded**: runs are the only
|
|
933
|
+
* grading unit, and an action with no session joins no run
|
|
934
|
+
* (docs/plans/run-level-grading-plan.md). The field stays optional because
|
|
935
|
+
* tightening it would 400 a whole batch — a poison pill for any queue file
|
|
936
|
+
* carrying one — and no shipped CLI omits it: the hook always writes a
|
|
937
|
+
* session id, falling back to the literal `'unknown'`
|
|
938
|
+
* (`packages/cli/src/hook-logger.ts:129`), which groups into a run like any
|
|
939
|
+
* other. A direct API caller that omits it gets its actions stored and
|
|
940
|
+
* ungraded, and the server logs `sync.actions_without_session` so the case is
|
|
941
|
+
* visible rather than silent.
|
|
942
|
+
*/
|
|
943
|
+
readonly sessionId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
944
|
+
readonly actionType: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
945
|
+
readonly summary: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
|
|
946
|
+
readonly filePaths: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1024, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
947
|
+
readonly verdict: v.OptionalSchema<v.PicklistSchema<["aligned", "unguided", "misaligned"], undefined>, undefined>;
|
|
948
|
+
readonly gradingTier: v.OptionalSchema<v.PicklistSchema<["pattern_match", "cached", "llm", "batch", "unguided"], undefined>, undefined>;
|
|
949
|
+
readonly guideIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
950
|
+
readonly violatedGuideId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
951
|
+
readonly evalReasoning: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
952
|
+
readonly metadata: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, v.CheckAction<{
|
|
953
|
+
[x: string]: unknown;
|
|
954
|
+
}, "metadata must serialize to at most 16384 bytes">, v.CheckAction<{
|
|
955
|
+
[x: string]: unknown;
|
|
956
|
+
}, "metadata.skill must be { name: string, path?: string }">, v.CheckAction<{
|
|
957
|
+
[x: string]: unknown;
|
|
958
|
+
}, "metadata.repoId must be repo_ followed by 32 hex chars">, v.CheckAction<{
|
|
959
|
+
[x: string]: unknown;
|
|
960
|
+
}, "metadata.outcome must be { status: \"ok\" | \"error\", errorClass?: string, exitCode?: number } with no other keys">]>, undefined>, undefined>;
|
|
961
|
+
/**
|
|
962
|
+
* Transcript evidence for this action. See {@link ActionNarrationSchema}.
|
|
963
|
+
*
|
|
964
|
+
* A top-level field rather than a `metadata` key, and that is a decision
|
|
965
|
+
* rather than a style choice (design review, 2026-08-15): `metadata` is an
|
|
966
|
+
* open record holding *metadata* under one shared 16 KB budget, and this is
|
|
967
|
+
* content — the first content an action carries. It lands in its own column
|
|
968
|
+
* server-side for the same reason.
|
|
969
|
+
*
|
|
970
|
+
* **No shipped CLI sends this yet.** Slice 2 builds the extraction and both
|
|
971
|
+
* halves of the enforcement; Slice 3 adds the column and the disclosure
|
|
972
|
+
* surface and is what turns it on, so nothing begins leaving a user's machine
|
|
973
|
+
* a release before the panel describing it.
|
|
974
|
+
*/
|
|
975
|
+
readonly narration: v.OptionalSchema<v.StrictObjectSchema<{
|
|
976
|
+
/**
|
|
977
|
+
* The user turn this action followed — prose-redacted on the user's machine.
|
|
978
|
+
*
|
|
979
|
+
* **Not every message with `role: 'user'`.** A tool result is delivered as a
|
|
980
|
+
* user-role message whose content is a `tool_result` block, so the client
|
|
981
|
+
* selects on content-block type rather than role
|
|
982
|
+
* (`packages/cli/src/transcript/messages.ts`). Nothing on this side can tell
|
|
983
|
+
* the difference after the fact, which is why the client selects
|
|
984
|
+
* structurally and this schema constrains the shape rather than the content.
|
|
985
|
+
*/
|
|
986
|
+
readonly userText: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, undefined>;
|
|
987
|
+
/**
|
|
988
|
+
* Assistant prose adjacent to the tool call — code blocks structurally
|
|
989
|
+
* removed, then prose-redacted, then windowed, all on the user's machine.
|
|
990
|
+
*/
|
|
991
|
+
readonly assistantText: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2000, undefined>, v.CheckAction<string, "narration must not contain a code block — code is stripped structurally on the client before upload">]>, undefined>;
|
|
992
|
+
}, undefined>, undefined>;
|
|
993
|
+
/**
|
|
994
|
+
* Version of the CLI that *produced* this action's verdict.
|
|
995
|
+
*
|
|
996
|
+
* **No shipped CLI sends this any more.** Its only writer was `mossbear verdict
|
|
997
|
+
* record`, whose queue files could outlive an upgrade, which is why the
|
|
998
|
+
* per-action version was distinguished from the request-level one at all.
|
|
999
|
+
* That command is gone (docs/plans/cli-local-grading-removal-plan.md) and no
|
|
1000
|
+
* client-side verdict exists to attribute.
|
|
1001
|
+
*
|
|
1002
|
+
* Kept on the wire for one release so an un-upgraded CLI's queued verdicts
|
|
1003
|
+
* are not rejected mid-migration; the field and the `actions.cli_version`
|
|
1004
|
+
* column it feeds are dropped together (`action-cli-version-column-drop`).
|
|
1005
|
+
* For the CLI making the request — which is live, and what
|
|
1006
|
+
* `enforceCliVersionFloor` reads — see `DashboardSyncRequestSchema`.
|
|
1007
|
+
*/
|
|
1008
|
+
readonly cliVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
|
|
1009
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1010
|
+
id?: string | undefined;
|
|
1011
|
+
adapterId?: string | undefined;
|
|
1012
|
+
runId?: string | undefined;
|
|
1013
|
+
sessionId?: string | undefined;
|
|
1014
|
+
actionType: string;
|
|
1015
|
+
summary: string;
|
|
1016
|
+
filePaths?: string[] | undefined;
|
|
1017
|
+
verdict?: "aligned" | "unguided" | "misaligned" | undefined;
|
|
1018
|
+
gradingTier?: "unguided" | "pattern_match" | "cached" | "llm" | "batch" | undefined;
|
|
1019
|
+
guideIds?: string[] | undefined;
|
|
1020
|
+
violatedGuideId?: string | null | undefined;
|
|
1021
|
+
evalReasoning?: string | null | undefined;
|
|
1022
|
+
metadata?: {
|
|
1023
|
+
[x: string]: unknown;
|
|
1024
|
+
} | null | undefined;
|
|
1025
|
+
narration?: {
|
|
1026
|
+
userText?: string | undefined;
|
|
1027
|
+
assistantText?: string | undefined;
|
|
1028
|
+
} | undefined;
|
|
1029
|
+
cliVersion?: string | undefined;
|
|
1030
|
+
}[], 500, undefined>]>, undefined>;
|
|
1031
|
+
readonly guideSuggestions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1032
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1033
|
+
readonly content: v.StringSchema<undefined>;
|
|
1034
|
+
readonly reasoning: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1035
|
+
readonly triggerType: v.PicklistSchema<["uncovered", "ambiguous", "performance_pattern", "conversational_feedback"], undefined>;
|
|
1036
|
+
readonly sourceActionIds: v.OptionalSchema<v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.ObjectSchema<{
|
|
1037
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
1038
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1039
|
+
readonly summary: v.StringSchema<undefined>;
|
|
1040
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
1041
|
+
readonly status: v.OptionalSchema<v.PicklistSchema<["pending", "accepted", "dismissed"], undefined>, undefined>;
|
|
1042
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1043
|
+
id?: string | undefined;
|
|
1044
|
+
content: string;
|
|
1045
|
+
reasoning?: string | undefined;
|
|
1046
|
+
triggerType: "uncovered" | "ambiguous" | "performance_pattern" | "conversational_feedback";
|
|
1047
|
+
sourceActionIds?: (string | {
|
|
1048
|
+
sessionId: string;
|
|
1049
|
+
timestamp?: string | undefined;
|
|
1050
|
+
summary: string;
|
|
1051
|
+
})[] | undefined;
|
|
1052
|
+
status?: "pending" | "accepted" | "dismissed" | undefined;
|
|
1053
|
+
}[], 100, undefined>]>, undefined>;
|
|
1054
|
+
readonly feedbackCandidates: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1055
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1056
|
+
readonly signal: v.StringSchema<undefined>;
|
|
1057
|
+
readonly signalType: v.PicklistSchema<["correction", "approval", "implied_preference", "stated_preference", "skill_suggestion"], undefined>;
|
|
1058
|
+
readonly confidence: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
|
|
1059
|
+
readonly occurrences: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
1060
|
+
readonly status: v.OptionalSchema<v.PicklistSchema<["inferred", "confirmed", "dismissed"], undefined>, undefined>;
|
|
1061
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1062
|
+
id?: string | undefined;
|
|
1063
|
+
signal: string;
|
|
1064
|
+
signalType: "correction" | "approval" | "implied_preference" | "stated_preference" | "skill_suggestion";
|
|
1065
|
+
confidence?: number | undefined;
|
|
1066
|
+
occurrences?: number | undefined;
|
|
1067
|
+
status?: "dismissed" | "inferred" | "confirmed" | undefined;
|
|
1068
|
+
}[], 100, undefined>]>, undefined>;
|
|
1069
|
+
readonly runUsage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1070
|
+
readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1071
|
+
readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1072
|
+
readonly usage: v.ArraySchema<v.ObjectSchema<{
|
|
1073
|
+
readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1074
|
+
readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1075
|
+
readonly inputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1076
|
+
readonly outputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1077
|
+
readonly cacheReadTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
1078
|
+
readonly cacheWriteTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
1079
|
+
}, undefined>, undefined>;
|
|
1080
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1081
|
+
runId?: string | undefined;
|
|
1082
|
+
sessionId: string;
|
|
1083
|
+
usage: {
|
|
1084
|
+
model: string;
|
|
1085
|
+
provider?: string | undefined;
|
|
1086
|
+
inputTokens: number;
|
|
1087
|
+
outputTokens: number;
|
|
1088
|
+
cacheReadTokens?: number | undefined;
|
|
1089
|
+
cacheWriteTokens?: number | undefined;
|
|
1090
|
+
}[];
|
|
1091
|
+
}[], 100, undefined>]>, undefined>;
|
|
1092
|
+
readonly skillUsage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1093
|
+
readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1094
|
+
readonly sessionId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1095
|
+
readonly usage: v.ArraySchema<v.ObjectSchema<{
|
|
1096
|
+
readonly skillName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1097
|
+
readonly model: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1098
|
+
readonly inputTokens: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1099
|
+
readonly cacheWriteTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
1100
|
+
}, undefined>, undefined>;
|
|
1101
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1102
|
+
runId?: string | undefined;
|
|
1103
|
+
sessionId: string;
|
|
1104
|
+
usage: {
|
|
1105
|
+
skillName: string;
|
|
1106
|
+
model: string;
|
|
1107
|
+
inputTokens: number;
|
|
1108
|
+
cacheWriteTokens?: number | undefined;
|
|
1109
|
+
}[];
|
|
1110
|
+
}[], 100, undefined>]>, undefined>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Version of the CLI making *this request* — the live one, and the only
|
|
1113
|
+
* `cliVersion` a shipped CLI still sends (the per-action field is a
|
|
1114
|
+
* migration leftover; see `DashboardSyncActionSchema`). It sits on the
|
|
1115
|
+
* envelope because the server reads it before touching any row, to
|
|
1116
|
+
* compare against its version floor and reject an incompatible client with
|
|
1117
|
+
* 426 rather than half-ingesting the batch. Optional: clients predating this
|
|
1118
|
+
* field send none, and are never blocked for it.
|
|
1119
|
+
*/
|
|
1120
|
+
readonly cliVersion: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Sessions whose agent context has ended, named by the CLI's `SessionEnd`
|
|
1123
|
+
* hook (`mossbear sync --session-complete`) — never by its per-turn `Stop` hook.
|
|
1124
|
+
* The server closes those sessions' runs; every other session in the payload
|
|
1125
|
+
* stays open.
|
|
1126
|
+
*
|
|
1127
|
+
* Session-keyed rather than a single envelope-level boolean, because one
|
|
1128
|
+
* `mossbear sync` uploads every session with pending actions and chunks them
|
|
1129
|
+
* across several requests. A boolean would close sessions that merely had a
|
|
1130
|
+
* backlog, and would close a session before the batches carrying the rest of
|
|
1131
|
+
* its actions had arrived. The CLI therefore names a session here only on the
|
|
1132
|
+
* final batch that carries that session's actions.
|
|
1133
|
+
*
|
|
1134
|
+
* Deliberately an assertion, not a fact: `SessionEnd` also fires on
|
|
1135
|
+
* `/clear`, `--resume` and `logout`, and a reclaimed cloud container may fire
|
|
1136
|
+
* nothing at all. Closing is therefore reversible — later actions for a
|
|
1137
|
+
* closed run reopen it — and the server's idle sweep, not this field, is what
|
|
1138
|
+
* runs actually depend on being closed by. See
|
|
1139
|
+
* docs/plans/run-level-grading-plan.md Slice 1.
|
|
1140
|
+
*/
|
|
1141
|
+
readonly completedSessionIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 100, undefined>]>, undefined>;
|
|
1142
|
+
/**
|
|
1143
|
+
* The rule files present in the repo this sync ran from — see
|
|
1144
|
+
* {@link RuleFileManifestSchema}.
|
|
1145
|
+
*
|
|
1146
|
+
* Envelope-level rather than per-action because it describes the machine and
|
|
1147
|
+
* the checkout, not any one tool call; the server attaches it to the runs it
|
|
1148
|
+
* materializes from this request. Present on every batch that carries
|
|
1149
|
+
* actions, so a session chunked across several requests has the manifest
|
|
1150
|
+
* available wherever its run is touched.
|
|
1151
|
+
*
|
|
1152
|
+
* Optional: a CLI predating this sends none, and the server must read its
|
|
1153
|
+
* absence as "delivery unobserved", never as "nothing was delivered".
|
|
1154
|
+
*/
|
|
1155
|
+
readonly ruleManifest: v.OptionalSchema<v.ObjectSchema<{
|
|
1156
|
+
readonly repoId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>;
|
|
1157
|
+
readonly files: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
1158
|
+
readonly path: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
|
|
1159
|
+
readonly format: v.PicklistSchema<["agents-md", "agents-dir", "claude-md", "claude-rules", "cursorrules", "cursor-rules", "skill-md"], undefined>;
|
|
1160
|
+
readonly contentHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>;
|
|
1161
|
+
}, undefined>, undefined>, v.MaxLengthAction<{
|
|
1162
|
+
path: string;
|
|
1163
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
1164
|
+
contentHash: string;
|
|
1165
|
+
}[], 500, undefined>]>;
|
|
1166
|
+
/**
|
|
1167
|
+
* The repo held more rule files than the cap, so `files` is a prefix. Set
|
|
1168
|
+
* rather than silently trimmed: a manifest read as complete would mark the
|
|
1169
|
+
* omitted files' guides undelivered, which is the exact wrong-verdict
|
|
1170
|
+
* failure this field exists to prevent.
|
|
1171
|
+
*/
|
|
1172
|
+
readonly truncated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1173
|
+
}, undefined>, undefined>;
|
|
1174
|
+
}, undefined>;
|
|
1175
|
+
export declare const ExtractedGuideSuggestionSchema: v.ObjectSchema<{
|
|
1176
|
+
readonly id: v.StringSchema<undefined>;
|
|
1177
|
+
readonly content: v.StringSchema<undefined>;
|
|
1178
|
+
readonly reasoning: v.StringSchema<undefined>;
|
|
1179
|
+
readonly triggerType: v.PicklistSchema<["conversational_feedback"], undefined>;
|
|
1180
|
+
readonly confidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
1181
|
+
readonly occurrences: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1182
|
+
readonly citations: v.ArraySchema<v.ObjectSchema<{
|
|
1183
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
1184
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1185
|
+
readonly summary: v.StringSchema<undefined>;
|
|
1186
|
+
}, undefined>, undefined>;
|
|
1187
|
+
readonly source: v.PicklistSchema<["claude_code", "cursor", "copilot", "windsurf", "other"], undefined>;
|
|
1188
|
+
}, undefined>;
|
|
1189
|
+
export declare const ExtractedSkillSuggestionSchema: v.ObjectSchema<{
|
|
1190
|
+
readonly id: v.StringSchema<undefined>;
|
|
1191
|
+
readonly signal: v.StringSchema<undefined>;
|
|
1192
|
+
readonly confidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
1193
|
+
readonly occurrences: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1194
|
+
readonly citations: v.ArraySchema<v.ObjectSchema<{
|
|
1195
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
1196
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1197
|
+
readonly summary: v.StringSchema<undefined>;
|
|
1198
|
+
}, undefined>, undefined>;
|
|
1199
|
+
readonly source: v.PicklistSchema<["claude_code", "cursor", "copilot", "windsurf", "other"], undefined>;
|
|
1200
|
+
}, undefined>;
|
|
1201
|
+
export declare const ExtractedFeedbackBatchSchema: v.ObjectSchema<{
|
|
1202
|
+
readonly guideSuggestions: v.ArraySchema<v.ObjectSchema<{
|
|
1203
|
+
readonly id: v.StringSchema<undefined>;
|
|
1204
|
+
readonly content: v.StringSchema<undefined>;
|
|
1205
|
+
readonly reasoning: v.StringSchema<undefined>;
|
|
1206
|
+
readonly triggerType: v.PicklistSchema<["conversational_feedback"], undefined>;
|
|
1207
|
+
readonly confidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
1208
|
+
readonly occurrences: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1209
|
+
readonly citations: v.ArraySchema<v.ObjectSchema<{
|
|
1210
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
1211
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1212
|
+
readonly summary: v.StringSchema<undefined>;
|
|
1213
|
+
}, undefined>, undefined>;
|
|
1214
|
+
readonly source: v.PicklistSchema<["claude_code", "cursor", "copilot", "windsurf", "other"], undefined>;
|
|
1215
|
+
}, undefined>, undefined>;
|
|
1216
|
+
readonly skillSuggestions: v.ArraySchema<v.ObjectSchema<{
|
|
1217
|
+
readonly id: v.StringSchema<undefined>;
|
|
1218
|
+
readonly signal: v.StringSchema<undefined>;
|
|
1219
|
+
readonly confidence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
|
|
1220
|
+
readonly occurrences: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
|
|
1221
|
+
readonly citations: v.ArraySchema<v.ObjectSchema<{
|
|
1222
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
1223
|
+
readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1224
|
+
readonly summary: v.StringSchema<undefined>;
|
|
1225
|
+
}, undefined>, undefined>;
|
|
1226
|
+
readonly source: v.PicklistSchema<["claude_code", "cursor", "copilot", "windsurf", "other"], undefined>;
|
|
1227
|
+
}, undefined>, undefined>;
|
|
1228
|
+
}, undefined>;
|
|
1229
|
+
export declare const AgentConfigSchema: v.ObjectSchema<{
|
|
1230
|
+
readonly id: v.StringSchema<undefined>;
|
|
1231
|
+
readonly name: v.StringSchema<undefined>;
|
|
1232
|
+
readonly description: v.StringSchema<undefined>;
|
|
1233
|
+
readonly capabilities: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
1234
|
+
readonly meta: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
1235
|
+
}, undefined>;
|
|
1236
|
+
export declare const ActionEntrySchema: v.ObjectSchema<{
|
|
1237
|
+
/**
|
|
1238
|
+
* Stable identity, assigned by the logger hook when the action happens.
|
|
1239
|
+
*
|
|
1240
|
+
* Serves two jobs at once (docs/plans/action-evidence-sync-plan.md): it is
|
|
1241
|
+
* the `actions.id` a sync sends, so re-syncing the same append-only run log
|
|
1242
|
+
* is a no-op against the server's `onConflictDoNothing`; and it is the
|
|
1243
|
+
* correlation key for joining transcript evidence to an action, which
|
|
1244
|
+
* adjacency cannot do once one assistant message emits several tool calls.
|
|
1245
|
+
*
|
|
1246
|
+
* Optional because run logs written before this field existed must stay
|
|
1247
|
+
* readable. Sync derives an id for those from `(sessionId, line index)`; see
|
|
1248
|
+
* `deriveLegacyActionId`.
|
|
1249
|
+
*/
|
|
1250
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1251
|
+
readonly timestamp: v.StringSchema<undefined>;
|
|
1252
|
+
readonly sessionId: v.StringSchema<undefined>;
|
|
1253
|
+
readonly toolName: v.StringSchema<undefined>;
|
|
1254
|
+
readonly filePath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1255
|
+
readonly command: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1256
|
+
/**
|
|
1257
|
+
* Set only for a `Skill` tool call: which skill the agent loaded.
|
|
1258
|
+
*
|
|
1259
|
+
* This is what makes a skill load ride the action stream instead of the
|
|
1260
|
+
* transcript. `skill_usage` — the other place a loaded skill name is
|
|
1261
|
+
* recorded — is populated by `extractRunUsage`, which returns empty unless
|
|
1262
|
+
* `mossbear sync` is given `--transcripts-dir`, and the hook `mossbear init`
|
|
1263
|
+
* installs never passes one. So the transcript path has no data in a normal
|
|
1264
|
+
* session, while an action definitionally syncs.
|
|
1265
|
+
*/
|
|
1266
|
+
readonly skill: v.OptionalSchema<v.ObjectSchema<{
|
|
1267
|
+
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
1268
|
+
readonly path: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
1269
|
+
}, undefined>, undefined>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Where this session's transcript lives on *this machine*, as the agent
|
|
1272
|
+
* itself reported it.
|
|
1273
|
+
*
|
|
1274
|
+
* **Local-only, and it must stay that way.** `toSyncAction`
|
|
1275
|
+
* (`packages/cli/src/action-queue.ts`) builds the wire payload field by
|
|
1276
|
+
* field and does not include this one; transcripts are disclosed as
|
|
1277
|
+
* local-only (`apps/dashboard/src/lib/privacy/whatSyncs.ts`), and a path is
|
|
1278
|
+
* still a fact about the user's filesystem. It exists so `mossbear sync` can
|
|
1279
|
+
* find the transcript for a session it is already uploading without
|
|
1280
|
+
* searching for it (docs/plans/default-transcript-discovery-plan.md →
|
|
1281
|
+
* "Session resolution").
|
|
1282
|
+
*
|
|
1283
|
+
* Optional three times over: run logs written before this field existed must
|
|
1284
|
+
* stay readable, a hook protocol other than Claude Code's may not send it,
|
|
1285
|
+
* and resolution falls back to the `<sessionId>.jsonl` filename convention
|
|
1286
|
+
* when it is absent or stale.
|
|
1287
|
+
*/
|
|
1288
|
+
readonly transcriptPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1289
|
+
/**
|
|
1290
|
+
* Which checkout produced this action — the same digest as
|
|
1291
|
+
* {@link RuleFileManifestSchema}'s `repoId`, stamped by the logger hook from
|
|
1292
|
+
* the event's `cwd` so a sync in repo A does not attach A's manifest to
|
|
1293
|
+
* sessions that ran in repo B (`run-repo-attribution`).
|
|
1294
|
+
*/
|
|
1295
|
+
readonly repoId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "repoId must be repo_ followed by 32 hex chars">]>, undefined>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Whether the tool call succeeded, when the hook could tell.
|
|
1298
|
+
*
|
|
1299
|
+
* Optional twice over: run logs written before this field existed must stay
|
|
1300
|
+
* readable, and a recognized response shape is not guaranteed even now. See
|
|
1301
|
+
* {@link ActionOutcomeSchema} — absent is "unknown", not "fine".
|
|
1302
|
+
*/
|
|
1303
|
+
readonly outcome: v.OptionalSchema<v.ObjectSchema<{
|
|
1304
|
+
readonly status: v.PicklistSchema<["ok", "error"], undefined>;
|
|
1305
|
+
readonly errorClass: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "errorClass must be 1-32 chars of [A-Za-z0-9_.:-]">]>, undefined>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Bounded to a signed 16-bit range, which covers every real exit status
|
|
1308
|
+
* (0-255, 128+signal, and Node's -1) with room to spare. The bound is a line
|
|
1309
|
+
* length bound as much as a validity one: this renders into the grading
|
|
1310
|
+
* prompt, where every field is capped.
|
|
1311
|
+
*/
|
|
1312
|
+
readonly exitCode: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, -32768, undefined>, v.MaxValueAction<number, 32767, undefined>]>, undefined>;
|
|
1313
|
+
}, undefined>, undefined>;
|
|
1314
|
+
}, undefined>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Action types the CLI maps agent tool calls onto.
|
|
1317
|
+
*
|
|
1318
|
+
* Deliberately **not** a closed schema. `DashboardSyncAction.actionType` stays
|
|
1319
|
+
* an open string so a tool the CLI has never seen still syncs as itself
|
|
1320
|
+
* (`packages/cli/src/action-queue.ts` normalizes an unknown tool name rather
|
|
1321
|
+
* than collapsing it into a catch-all) — a closed picklist would silently drop
|
|
1322
|
+
* those. This list is the *known* vocabulary: what the CLI produces on purpose.
|
|
1323
|
+
*
|
|
1324
|
+
* It lives here because it is a contract between two packages that never import
|
|
1325
|
+
* each other. It used to also be the vocabulary the guide-trigger picker
|
|
1326
|
+
* offered; that picker is gone (docs/plans/run-level-grading-plan.md, Slice 4)
|
|
1327
|
+
* and nothing matches against this list any more — relevance is observed from
|
|
1328
|
+
* what was in the agent's context, not asserted against an action type.
|
|
1329
|
+
*
|
|
1330
|
+
* `SKILL_LOAD_ACTION_TYPE` is the one type the CLI emits on purpose that is
|
|
1331
|
+
* deliberately absent here; see its own comment for why.
|
|
1332
|
+
*/
|
|
1333
|
+
declare const KNOWN_ACTION_TYPES: readonly ["file_edit", "file_read", "shell_command", "search", "web_access"];
|
|
1334
|
+
export type KnownActionType = (typeof KNOWN_ACTION_TYPES)[number];
|
|
1335
|
+
/** True when `value` is one of the action types the CLI produces on purpose. */
|
|
1336
|
+
export declare function isKnownActionType(value: string): value is KnownActionType;
|
|
1337
|
+
export declare function parseAgentConfig(data: unknown): {
|
|
1338
|
+
id: string;
|
|
1339
|
+
name: string;
|
|
1340
|
+
description: string;
|
|
1341
|
+
capabilities: string[];
|
|
1342
|
+
meta?: {
|
|
1343
|
+
[x: string]: unknown;
|
|
1344
|
+
} | undefined;
|
|
1345
|
+
};
|
|
1346
|
+
export declare function parseGuideSnapshot(data: unknown): {
|
|
1347
|
+
id: string;
|
|
1348
|
+
title: string;
|
|
1349
|
+
content: string;
|
|
1350
|
+
enabled: boolean;
|
|
1351
|
+
updatedAt: string;
|
|
1352
|
+
origin?: string | null | undefined;
|
|
1353
|
+
contentHash?: string | null | undefined;
|
|
1354
|
+
root?: "project" | "global" | null | undefined;
|
|
1355
|
+
path?: string | null | undefined;
|
|
1356
|
+
};
|
|
1357
|
+
export declare function parseGuideBundleResponse(data: unknown): {
|
|
1358
|
+
guides: {
|
|
1359
|
+
id: string;
|
|
1360
|
+
title: string;
|
|
1361
|
+
content: string;
|
|
1362
|
+
enabled: boolean;
|
|
1363
|
+
updatedAt: string;
|
|
1364
|
+
origin?: string | null | undefined;
|
|
1365
|
+
contentHash?: string | null | undefined;
|
|
1366
|
+
root?: "project" | "global" | null | undefined;
|
|
1367
|
+
path?: string | null | undefined;
|
|
1368
|
+
}[];
|
|
1369
|
+
pulledAt: string;
|
|
1370
|
+
};
|
|
1371
|
+
export declare function parseRawGuideFilePayload(data: unknown): {
|
|
1372
|
+
path: string;
|
|
1373
|
+
root?: "project" | "global" | undefined;
|
|
1374
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
1375
|
+
rawContent: string;
|
|
1376
|
+
lastModified: number;
|
|
1377
|
+
content_hash: string;
|
|
1378
|
+
members?: {
|
|
1379
|
+
path: string;
|
|
1380
|
+
rawContent: string;
|
|
1381
|
+
lastModified: number;
|
|
1382
|
+
content_hash: string;
|
|
1383
|
+
}[] | undefined;
|
|
1384
|
+
expectedVersion?: number | undefined;
|
|
1385
|
+
skippedMemberPaths?: string[] | undefined;
|
|
1386
|
+
};
|
|
1387
|
+
export declare function parseGuideMemberFilesResponse(data: unknown): {
|
|
1388
|
+
memberFiles: {
|
|
1389
|
+
path: string;
|
|
1390
|
+
content: string;
|
|
1391
|
+
contentHash: string;
|
|
1392
|
+
}[];
|
|
1393
|
+
};
|
|
1394
|
+
export declare function parseRawGuideFileDeletion(data: unknown): {
|
|
1395
|
+
path: string;
|
|
1396
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
1397
|
+
};
|
|
1398
|
+
export declare function parseRuleDeletionsRequest(data: unknown): {
|
|
1399
|
+
deletions: unknown[];
|
|
1400
|
+
};
|
|
1401
|
+
export declare function parseRulesImportRequest(data: unknown): {
|
|
1402
|
+
rules: unknown[];
|
|
1403
|
+
repoId?: string | undefined;
|
|
1404
|
+
projectId?: string | undefined;
|
|
1405
|
+
};
|
|
1406
|
+
export declare function parseBundle(data: unknown): {
|
|
1407
|
+
id: string;
|
|
1408
|
+
slug: string;
|
|
1409
|
+
name: string;
|
|
1410
|
+
createdAt: string;
|
|
1411
|
+
};
|
|
1412
|
+
export declare function parseBundleListResponse(data: unknown): {
|
|
1413
|
+
bundles: {
|
|
1414
|
+
id: string;
|
|
1415
|
+
slug: string;
|
|
1416
|
+
name: string;
|
|
1417
|
+
createdAt: string;
|
|
1418
|
+
}[];
|
|
1419
|
+
};
|
|
1420
|
+
export declare function parseCreateBundleRequest(data: unknown): {
|
|
1421
|
+
slug: string;
|
|
1422
|
+
name: string;
|
|
1423
|
+
};
|
|
1424
|
+
export declare function parseCreateBundleResponse(data: unknown): {
|
|
1425
|
+
bundle: {
|
|
1426
|
+
id: string;
|
|
1427
|
+
slug: string;
|
|
1428
|
+
name: string;
|
|
1429
|
+
createdAt: string;
|
|
1430
|
+
};
|
|
1431
|
+
};
|
|
1432
|
+
export declare function parseAttachBundleMemberRequest(data: unknown): {
|
|
1433
|
+
itemId: string;
|
|
1434
|
+
itemType?: "guide_file" | "guide" | undefined;
|
|
1435
|
+
};
|
|
1436
|
+
export declare function parseAttachBundleMemberResponse(data: unknown): {
|
|
1437
|
+
attached: boolean;
|
|
1438
|
+
};
|
|
1439
|
+
export declare function parseDetachBundleMemberResponse(data: unknown): {
|
|
1440
|
+
detached: boolean;
|
|
1441
|
+
};
|
|
1442
|
+
export declare function parseRenameBundleRequest(data: unknown): {
|
|
1443
|
+
name: string;
|
|
1444
|
+
};
|
|
1445
|
+
export declare function parseRenameBundleResponse(data: unknown): {
|
|
1446
|
+
bundle: {
|
|
1447
|
+
id: string;
|
|
1448
|
+
slug: string;
|
|
1449
|
+
name: string;
|
|
1450
|
+
createdAt: string;
|
|
1451
|
+
};
|
|
1452
|
+
};
|
|
1453
|
+
export declare function parseDeleteBundleResponse(data: unknown): {
|
|
1454
|
+
deleted: boolean;
|
|
1455
|
+
};
|
|
1456
|
+
export declare function parseContextItem(data: unknown): {
|
|
1457
|
+
id: string;
|
|
1458
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1459
|
+
name: string;
|
|
1460
|
+
contentType: string;
|
|
1461
|
+
content: string | null;
|
|
1462
|
+
origin?: string | null | undefined;
|
|
1463
|
+
version?: number | undefined;
|
|
1464
|
+
root?: "project" | "global" | null | undefined;
|
|
1465
|
+
path?: string | null | undefined;
|
|
1466
|
+
updatedAt: string;
|
|
1467
|
+
};
|
|
1468
|
+
export declare function parseContextItemsResponse(data: unknown): {
|
|
1469
|
+
items: {
|
|
1470
|
+
id: string;
|
|
1471
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1472
|
+
name: string;
|
|
1473
|
+
contentType: string;
|
|
1474
|
+
content: string | null;
|
|
1475
|
+
origin?: string | null | undefined;
|
|
1476
|
+
version?: number | undefined;
|
|
1477
|
+
root?: "project" | "global" | null | undefined;
|
|
1478
|
+
path?: string | null | undefined;
|
|
1479
|
+
updatedAt: string;
|
|
1480
|
+
}[];
|
|
1481
|
+
};
|
|
1482
|
+
export declare function parsePushContextRequest(data: unknown): {
|
|
1483
|
+
name: string;
|
|
1484
|
+
contentType: "reference" | "document" | "asset";
|
|
1485
|
+
content: string;
|
|
1486
|
+
itemId?: string | undefined;
|
|
1487
|
+
origin?: string | null | undefined;
|
|
1488
|
+
sourceItemIds?: string[] | undefined;
|
|
1489
|
+
};
|
|
1490
|
+
export declare function parsePushContextResponse(data: unknown): {
|
|
1491
|
+
item: {
|
|
1492
|
+
id: string;
|
|
1493
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1494
|
+
name: string;
|
|
1495
|
+
contentType: string;
|
|
1496
|
+
content: string | null;
|
|
1497
|
+
origin?: string | null | undefined;
|
|
1498
|
+
version?: number | undefined;
|
|
1499
|
+
root?: "project" | "global" | null | undefined;
|
|
1500
|
+
path?: string | null | undefined;
|
|
1501
|
+
updatedAt: string;
|
|
1502
|
+
};
|
|
1503
|
+
created: boolean;
|
|
1504
|
+
};
|
|
1505
|
+
export declare function parseUpdateContextItemRequest(data: unknown): {
|
|
1506
|
+
itemId: string;
|
|
1507
|
+
name?: string | undefined;
|
|
1508
|
+
content?: string | undefined;
|
|
1509
|
+
expectedVersion?: number | undefined;
|
|
1510
|
+
sourceItemIds?: string[] | undefined;
|
|
1511
|
+
};
|
|
1512
|
+
export declare function parseUpdateContextItemResponse(data: unknown): {
|
|
1513
|
+
item: {
|
|
1514
|
+
id: string;
|
|
1515
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1516
|
+
name: string;
|
|
1517
|
+
contentType: string;
|
|
1518
|
+
content: string | null;
|
|
1519
|
+
origin?: string | null | undefined;
|
|
1520
|
+
version?: number | undefined;
|
|
1521
|
+
root?: "project" | "global" | null | undefined;
|
|
1522
|
+
path?: string | null | undefined;
|
|
1523
|
+
updatedAt: string;
|
|
1524
|
+
};
|
|
1525
|
+
updated: boolean;
|
|
1526
|
+
};
|
|
1527
|
+
export declare function parseUpdateContextItemBody(data: unknown): {
|
|
1528
|
+
content?: string | undefined;
|
|
1529
|
+
expectedVersion?: number | undefined;
|
|
1530
|
+
name?: string | undefined;
|
|
1531
|
+
sourceItemIds?: string[] | undefined;
|
|
1532
|
+
};
|
|
1533
|
+
export declare function parseContextItemResponse(data: unknown): {
|
|
1534
|
+
item: {
|
|
1535
|
+
id: string;
|
|
1536
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1537
|
+
name: string;
|
|
1538
|
+
contentType: string;
|
|
1539
|
+
content: string | null;
|
|
1540
|
+
origin?: string | null | undefined;
|
|
1541
|
+
version?: number | undefined;
|
|
1542
|
+
root?: "project" | "global" | null | undefined;
|
|
1543
|
+
path?: string | null | undefined;
|
|
1544
|
+
updatedAt: string;
|
|
1545
|
+
};
|
|
1546
|
+
};
|
|
1547
|
+
export declare function parseArchiveContextItemResponse(data: unknown): {
|
|
1548
|
+
archived: boolean;
|
|
1549
|
+
item: {
|
|
1550
|
+
id: string;
|
|
1551
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1552
|
+
name: string;
|
|
1553
|
+
contentType: string;
|
|
1554
|
+
content: string | null;
|
|
1555
|
+
origin?: string | null | undefined;
|
|
1556
|
+
version?: number | undefined;
|
|
1557
|
+
root?: "project" | "global" | null | undefined;
|
|
1558
|
+
path?: string | null | undefined;
|
|
1559
|
+
updatedAt: string;
|
|
1560
|
+
};
|
|
1561
|
+
};
|
|
1562
|
+
export declare function parseInboxCaptureRequest(data: unknown): {
|
|
1563
|
+
contentType: "document" | "asset";
|
|
1564
|
+
content: string;
|
|
1565
|
+
name?: string | undefined;
|
|
1566
|
+
source?: string | undefined;
|
|
1567
|
+
};
|
|
1568
|
+
export declare function parseInboxCaptureResponse(data: unknown): {
|
|
1569
|
+
item: {
|
|
1570
|
+
id: string;
|
|
1571
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1572
|
+
name: string;
|
|
1573
|
+
contentType: string;
|
|
1574
|
+
content: string | null;
|
|
1575
|
+
source?: string | null | undefined;
|
|
1576
|
+
version?: number | undefined;
|
|
1577
|
+
capturedAt: string;
|
|
1578
|
+
updatedAt: string;
|
|
1579
|
+
};
|
|
1580
|
+
};
|
|
1581
|
+
export declare function parseInboxListResponse(data: unknown): {
|
|
1582
|
+
items: {
|
|
1583
|
+
id: string;
|
|
1584
|
+
type: "reference" | "guide" | "document" | "asset";
|
|
1585
|
+
name: string;
|
|
1586
|
+
contentType: string;
|
|
1587
|
+
content: string | null;
|
|
1588
|
+
source?: string | null | undefined;
|
|
1589
|
+
version?: number | undefined;
|
|
1590
|
+
capturedAt: string;
|
|
1591
|
+
updatedAt: string;
|
|
1592
|
+
}[];
|
|
1593
|
+
};
|
|
1594
|
+
export declare function parseContextItemVersionsResponse(data: unknown): {
|
|
1595
|
+
versions: {
|
|
1596
|
+
id: string;
|
|
1597
|
+
version: number;
|
|
1598
|
+
contentHash: string;
|
|
1599
|
+
authorType: string;
|
|
1600
|
+
metadata?: {
|
|
1601
|
+
[x: string]: unknown;
|
|
1602
|
+
} | null | undefined;
|
|
1603
|
+
createdAt: string;
|
|
1604
|
+
}[];
|
|
1605
|
+
nextCursor: number | null;
|
|
1606
|
+
};
|
|
1607
|
+
export declare function parseContextItemVersionResponse(data: unknown): {
|
|
1608
|
+
version: {
|
|
1609
|
+
id: string;
|
|
1610
|
+
version: number;
|
|
1611
|
+
content: string | null;
|
|
1612
|
+
contentHash: string;
|
|
1613
|
+
authorType: string;
|
|
1614
|
+
metadata?: {
|
|
1615
|
+
[x: string]: unknown;
|
|
1616
|
+
} | null | undefined;
|
|
1617
|
+
createdAt: string;
|
|
1618
|
+
};
|
|
1619
|
+
};
|
|
1620
|
+
export declare function parseInboxArchiveRequest(data: unknown): {
|
|
1621
|
+
ids: string[];
|
|
1622
|
+
};
|
|
1623
|
+
export declare function parseInboxArchiveResponse(data: unknown): {
|
|
1624
|
+
archived: number;
|
|
1625
|
+
};
|
|
1626
|
+
export declare function parseDashboardSyncRequest(data: unknown): {
|
|
1627
|
+
actions?: {
|
|
1628
|
+
id?: string | undefined;
|
|
1629
|
+
adapterId?: string | undefined;
|
|
1630
|
+
runId?: string | undefined;
|
|
1631
|
+
sessionId?: string | undefined;
|
|
1632
|
+
actionType: string;
|
|
1633
|
+
summary: string;
|
|
1634
|
+
filePaths?: string[] | undefined;
|
|
1635
|
+
verdict?: "aligned" | "unguided" | "misaligned" | undefined;
|
|
1636
|
+
gradingTier?: "unguided" | "pattern_match" | "cached" | "llm" | "batch" | undefined;
|
|
1637
|
+
guideIds?: string[] | undefined;
|
|
1638
|
+
violatedGuideId?: string | null | undefined;
|
|
1639
|
+
evalReasoning?: string | null | undefined;
|
|
1640
|
+
metadata?: {
|
|
1641
|
+
[x: string]: unknown;
|
|
1642
|
+
} | null | undefined;
|
|
1643
|
+
narration?: {
|
|
1644
|
+
userText?: string | undefined;
|
|
1645
|
+
assistantText?: string | undefined;
|
|
1646
|
+
} | undefined;
|
|
1647
|
+
cliVersion?: string | undefined;
|
|
1648
|
+
}[] | undefined;
|
|
1649
|
+
guideSuggestions?: {
|
|
1650
|
+
id?: string | undefined;
|
|
1651
|
+
content: string;
|
|
1652
|
+
reasoning?: string | undefined;
|
|
1653
|
+
triggerType: "uncovered" | "ambiguous" | "performance_pattern" | "conversational_feedback";
|
|
1654
|
+
sourceActionIds?: (string | {
|
|
1655
|
+
sessionId: string;
|
|
1656
|
+
timestamp?: string | undefined;
|
|
1657
|
+
summary: string;
|
|
1658
|
+
})[] | undefined;
|
|
1659
|
+
status?: "pending" | "accepted" | "dismissed" | undefined;
|
|
1660
|
+
}[] | undefined;
|
|
1661
|
+
feedbackCandidates?: {
|
|
1662
|
+
id?: string | undefined;
|
|
1663
|
+
signal: string;
|
|
1664
|
+
signalType: "correction" | "approval" | "implied_preference" | "stated_preference" | "skill_suggestion";
|
|
1665
|
+
confidence?: number | undefined;
|
|
1666
|
+
occurrences?: number | undefined;
|
|
1667
|
+
status?: "dismissed" | "inferred" | "confirmed" | undefined;
|
|
1668
|
+
}[] | undefined;
|
|
1669
|
+
runUsage?: {
|
|
1670
|
+
runId?: string | undefined;
|
|
1671
|
+
sessionId: string;
|
|
1672
|
+
usage: {
|
|
1673
|
+
model: string;
|
|
1674
|
+
provider?: string | undefined;
|
|
1675
|
+
inputTokens: number;
|
|
1676
|
+
outputTokens: number;
|
|
1677
|
+
cacheReadTokens?: number | undefined;
|
|
1678
|
+
cacheWriteTokens?: number | undefined;
|
|
1679
|
+
}[];
|
|
1680
|
+
}[] | undefined;
|
|
1681
|
+
skillUsage?: {
|
|
1682
|
+
runId?: string | undefined;
|
|
1683
|
+
sessionId: string;
|
|
1684
|
+
usage: {
|
|
1685
|
+
skillName: string;
|
|
1686
|
+
model: string;
|
|
1687
|
+
inputTokens: number;
|
|
1688
|
+
cacheWriteTokens?: number | undefined;
|
|
1689
|
+
}[];
|
|
1690
|
+
}[] | undefined;
|
|
1691
|
+
cliVersion?: string | undefined;
|
|
1692
|
+
completedSessionIds?: string[] | undefined;
|
|
1693
|
+
ruleManifest?: {
|
|
1694
|
+
repoId: string;
|
|
1695
|
+
files: {
|
|
1696
|
+
path: string;
|
|
1697
|
+
format: "agents-md" | "agents-dir" | "claude-md" | "claude-rules" | "cursorrules" | "cursor-rules" | "skill-md";
|
|
1698
|
+
contentHash: string;
|
|
1699
|
+
}[];
|
|
1700
|
+
truncated?: boolean | undefined;
|
|
1701
|
+
} | undefined;
|
|
1702
|
+
};
|
|
1703
|
+
export declare function parseProposalCitation(data: unknown): {
|
|
1704
|
+
sessionId: string;
|
|
1705
|
+
timestamp?: string | undefined;
|
|
1706
|
+
summary: string;
|
|
1707
|
+
};
|
|
1708
|
+
export declare function parseExtractedGuideSuggestion(data: unknown): {
|
|
1709
|
+
id: string;
|
|
1710
|
+
content: string;
|
|
1711
|
+
reasoning: string;
|
|
1712
|
+
triggerType: "conversational_feedback";
|
|
1713
|
+
confidence: number;
|
|
1714
|
+
occurrences: number;
|
|
1715
|
+
citations: {
|
|
1716
|
+
sessionId: string;
|
|
1717
|
+
timestamp?: string | undefined;
|
|
1718
|
+
summary: string;
|
|
1719
|
+
}[];
|
|
1720
|
+
source: "claude_code" | "cursor" | "copilot" | "windsurf" | "other";
|
|
1721
|
+
};
|
|
1722
|
+
export declare function parseExtractedSkillSuggestion(data: unknown): {
|
|
1723
|
+
id: string;
|
|
1724
|
+
signal: string;
|
|
1725
|
+
confidence: number;
|
|
1726
|
+
occurrences: number;
|
|
1727
|
+
citations: {
|
|
1728
|
+
sessionId: string;
|
|
1729
|
+
timestamp?: string | undefined;
|
|
1730
|
+
summary: string;
|
|
1731
|
+
}[];
|
|
1732
|
+
source: "claude_code" | "cursor" | "copilot" | "windsurf" | "other";
|
|
1733
|
+
};
|
|
1734
|
+
export declare function parseExtractedFeedbackBatch(data: unknown): {
|
|
1735
|
+
guideSuggestions: {
|
|
1736
|
+
id: string;
|
|
1737
|
+
content: string;
|
|
1738
|
+
reasoning: string;
|
|
1739
|
+
triggerType: "conversational_feedback";
|
|
1740
|
+
confidence: number;
|
|
1741
|
+
occurrences: number;
|
|
1742
|
+
citations: {
|
|
1743
|
+
sessionId: string;
|
|
1744
|
+
timestamp?: string | undefined;
|
|
1745
|
+
summary: string;
|
|
1746
|
+
}[];
|
|
1747
|
+
source: "claude_code" | "cursor" | "copilot" | "windsurf" | "other";
|
|
1748
|
+
}[];
|
|
1749
|
+
skillSuggestions: {
|
|
1750
|
+
id: string;
|
|
1751
|
+
signal: string;
|
|
1752
|
+
confidence: number;
|
|
1753
|
+
occurrences: number;
|
|
1754
|
+
citations: {
|
|
1755
|
+
sessionId: string;
|
|
1756
|
+
timestamp?: string | undefined;
|
|
1757
|
+
summary: string;
|
|
1758
|
+
}[];
|
|
1759
|
+
source: "claude_code" | "cursor" | "copilot" | "windsurf" | "other";
|
|
1760
|
+
}[];
|
|
1761
|
+
};
|
|
1762
|
+
export declare function parseActionEntry(data: unknown): {
|
|
1763
|
+
id?: string | undefined;
|
|
1764
|
+
timestamp: string;
|
|
1765
|
+
sessionId: string;
|
|
1766
|
+
toolName: string;
|
|
1767
|
+
filePath?: string | undefined;
|
|
1768
|
+
command?: string | undefined;
|
|
1769
|
+
skill?: {
|
|
1770
|
+
name: string;
|
|
1771
|
+
path?: string | undefined;
|
|
1772
|
+
} | undefined;
|
|
1773
|
+
transcriptPath?: string | undefined;
|
|
1774
|
+
repoId?: string | undefined;
|
|
1775
|
+
outcome?: {
|
|
1776
|
+
status: "ok" | "error";
|
|
1777
|
+
errorClass?: string | undefined;
|
|
1778
|
+
exitCode?: number | undefined;
|
|
1779
|
+
} | undefined;
|
|
1780
|
+
};
|
|
1781
|
+
export {};
|
|
1782
|
+
//# sourceMappingURL=schemas.d.ts.map
|