@mossbear/protocol 0.1.0-alpha.76 → 0.1.0-alpha.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schemas.d.ts CHANGED
@@ -1203,6 +1203,12 @@ export declare const GitSourceSchema: v.ObjectSchema<{
1203
1203
  }, undefined>;
1204
1204
  export declare const ContextItemSchema: v.ObjectSchema<{
1205
1205
  readonly id: v.StringSchema<undefined>;
1206
+ /**
1207
+ * The id every artifact route addresses: the body file's id for a guide
1208
+ * (null only for a guide with no body yet), the item's own id otherwise.
1209
+ * Optional so a client tolerates a server that predates it.
1210
+ */
1211
+ readonly artifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1206
1212
  readonly type: v.PicklistSchema<string[], undefined>;
1207
1213
  readonly name: v.StringSchema<undefined>;
1208
1214
  /**
@@ -1459,6 +1465,12 @@ export declare const ContextItemSchema: v.ObjectSchema<{
1459
1465
  export declare const ContextItemsResponseSchema: v.ObjectSchema<{
1460
1466
  readonly items: v.ArraySchema<v.ObjectSchema<{
1461
1467
  readonly id: v.StringSchema<undefined>;
1468
+ /**
1469
+ * The id every artifact route addresses: the body file's id for a guide
1470
+ * (null only for a guide with no body yet), the item's own id otherwise.
1471
+ * Optional so a client tolerates a server that predates it.
1472
+ */
1473
+ readonly artifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1462
1474
  readonly type: v.PicklistSchema<string[], undefined>;
1463
1475
  readonly name: v.StringSchema<undefined>;
1464
1476
  /**
@@ -2358,6 +2370,12 @@ export declare const PushContextRequestSchema: v.ObjectSchema<{
2358
2370
  export declare const PushContextResponseSchema: v.ObjectSchema<{
2359
2371
  readonly item: v.ObjectSchema<{
2360
2372
  readonly id: v.StringSchema<undefined>;
2373
+ /**
2374
+ * The id every artifact route addresses: the body file's id for a guide
2375
+ * (null only for a guide with no body yet), the item's own id otherwise.
2376
+ * Optional so a client tolerates a server that predates it.
2377
+ */
2378
+ readonly artifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2361
2379
  readonly type: v.PicklistSchema<string[], undefined>;
2362
2380
  readonly name: v.StringSchema<undefined>;
2363
2381
  /**
@@ -2703,6 +2721,12 @@ export declare const UpdateContextItemRequestSchema: v.ObjectSchema<{
2703
2721
  export declare const UpdateContextItemResponseSchema: v.ObjectSchema<{
2704
2722
  readonly item: v.ObjectSchema<{
2705
2723
  readonly id: v.StringSchema<undefined>;
2724
+ /**
2725
+ * The id every artifact route addresses: the body file's id for a guide
2726
+ * (null only for a guide with no body yet), the item's own id otherwise.
2727
+ * Optional so a client tolerates a server that predates it.
2728
+ */
2729
+ readonly artifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
2706
2730
  readonly type: v.PicklistSchema<string[], undefined>;
2707
2731
  readonly name: v.StringSchema<undefined>;
2708
2732
  /**
@@ -3044,7 +3068,7 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3044
3068
  * is two answers to one question and the route refuses it rather than picking.
3045
3069
  */
3046
3070
  readonly removed: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
3047
- }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
3071
+ }, undefined>, "entries" | "~types" | "~run" | "~standard"> & {
3048
3072
  readonly entries: Omit<{
3049
3073
  readonly itemId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3050
3074
  readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
@@ -3133,11 +3157,11 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3133
3157
  readonly removed: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
3134
3158
  }, "itemId">;
3135
3159
  readonly "~standard": v.StandardProps<{
3136
- name?: string | undefined;
3137
3160
  content?: string | undefined;
3138
3161
  path?: string | null | undefined;
3139
3162
  expectedVersion?: number | undefined;
3140
3163
  projectId?: string | undefined;
3164
+ name?: string | undefined;
3141
3165
  gitSource?: {
3142
3166
  projectId: string;
3143
3167
  commitSha: string;
@@ -3146,11 +3170,11 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3146
3170
  removed?: true | undefined;
3147
3171
  sourceItemIds?: string[] | undefined;
3148
3172
  }, {
3149
- name?: string | undefined;
3150
3173
  content?: string | undefined;
3151
3174
  path?: string | null | undefined;
3152
3175
  expectedVersion?: number | undefined;
3153
3176
  projectId?: string | undefined;
3177
+ name?: string | undefined;
3154
3178
  gitSource?: {
3155
3179
  projectId: string;
3156
3180
  commitSha: string;
@@ -3160,11 +3184,11 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3160
3184
  sourceItemIds?: string[] | undefined;
3161
3185
  }>;
3162
3186
  readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
3163
- name?: string | undefined;
3164
3187
  content?: string | undefined;
3165
3188
  path?: string | null | undefined;
3166
3189
  expectedVersion?: number | undefined;
3167
3190
  projectId?: string | undefined;
3191
+ name?: string | undefined;
3168
3192
  gitSource?: {
3169
3193
  projectId: string;
3170
3194
  commitSha: string;
@@ -3172,14 +3196,14 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3172
3196
  } | undefined;
3173
3197
  removed?: true | undefined;
3174
3198
  sourceItemIds?: string[] | undefined;
3175
- }, v.ObjectIssue | v.StringIssue | v.MinLengthIssue<string, 1> | v.NumberIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.RegexIssue<string> | v.CheckIssue<string> | v.MaxLengthIssue<string, 512> | v.ArrayIssue | v.MaxLengthIssue<string, 128> | v.MaxLengthIssue<string, 200> | v.MaxLengthIssue<string, 255> | v.LiteralIssue | v.MaxLengthIssue<string[], 100>>;
3199
+ }, v.StringIssue | v.MinLengthIssue<string, 1> | v.RegexIssue<string> | v.CheckIssue<string> | v.MaxLengthIssue<string, 512> | v.NumberIssue | v.IntegerIssue<number> | v.ArrayIssue | v.ObjectIssue | v.MinValueIssue<number, 1> | v.MaxLengthIssue<string, 128> | v.MaxLengthIssue<string, 200> | v.MaxLengthIssue<string, 255> | v.LiteralIssue | v.MaxLengthIssue<string[], 100>>;
3176
3200
  readonly "~types"?: {
3177
3201
  readonly input: {
3178
- name?: string | undefined;
3179
3202
  content?: string | undefined;
3180
3203
  path?: string | null | undefined;
3181
3204
  expectedVersion?: number | undefined;
3182
3205
  projectId?: string | undefined;
3206
+ name?: string | undefined;
3183
3207
  gitSource?: {
3184
3208
  projectId: string;
3185
3209
  commitSha: string;
@@ -3189,11 +3213,11 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3189
3213
  sourceItemIds?: string[] | undefined;
3190
3214
  };
3191
3215
  readonly output: {
3192
- name?: string | undefined;
3193
3216
  content?: string | undefined;
3194
3217
  path?: string | null | undefined;
3195
3218
  expectedVersion?: number | undefined;
3196
3219
  projectId?: string | undefined;
3220
+ name?: string | undefined;
3197
3221
  gitSource?: {
3198
3222
  projectId: string;
3199
3223
  commitSha: string;
@@ -3202,13 +3226,19 @@ export declare const UpdateContextItemBodySchema: Omit<v.ObjectSchema<{
3202
3226
  removed?: true | undefined;
3203
3227
  sourceItemIds?: string[] | undefined;
3204
3228
  };
3205
- readonly issue: v.ObjectIssue | v.StringIssue | v.MinLengthIssue<string, 1> | v.NumberIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.RegexIssue<string> | v.CheckIssue<string> | v.MaxLengthIssue<string, 512> | v.ArrayIssue | v.MaxLengthIssue<string, 128> | v.MaxLengthIssue<string, 200> | v.MaxLengthIssue<string, 255> | v.LiteralIssue | v.MaxLengthIssue<string[], 100>;
3229
+ readonly issue: v.StringIssue | v.MinLengthIssue<string, 1> | v.RegexIssue<string> | v.CheckIssue<string> | v.MaxLengthIssue<string, 512> | v.NumberIssue | v.IntegerIssue<number> | v.ArrayIssue | v.ObjectIssue | v.MinValueIssue<number, 1> | v.MaxLengthIssue<string, 128> | v.MaxLengthIssue<string, 200> | v.MaxLengthIssue<string, 255> | v.LiteralIssue | v.MaxLengthIssue<string[], 100>;
3206
3230
  } | undefined;
3207
3231
  };
3208
3232
  /** A single canonical item, for the item-scoped read route. */
3209
3233
  export declare const ContextItemResponseSchema: v.ObjectSchema<{
3210
3234
  readonly item: v.ObjectSchema<{
3211
3235
  readonly id: v.StringSchema<undefined>;
3236
+ /**
3237
+ * The id every artifact route addresses: the body file's id for a guide
3238
+ * (null only for a guide with no body yet), the item's own id otherwise.
3239
+ * Optional so a client tolerates a server that predates it.
3240
+ */
3241
+ readonly artifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3212
3242
  readonly type: v.PicklistSchema<string[], undefined>;
3213
3243
  readonly name: v.StringSchema<undefined>;
3214
3244
  /**
@@ -3467,6 +3497,12 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
3467
3497
  readonly archived: v.BooleanSchema<undefined>;
3468
3498
  readonly item: v.ObjectSchema<{
3469
3499
  readonly id: v.StringSchema<undefined>;
3500
+ /**
3501
+ * The id every artifact route addresses: the body file's id for a guide
3502
+ * (null only for a guide with no body yet), the item's own id otherwise.
3503
+ * Optional so a client tolerates a server that predates it.
3504
+ */
3505
+ readonly artifactId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3470
3506
  readonly type: v.PicklistSchema<string[], undefined>;
3471
3507
  readonly name: v.StringSchema<undefined>;
3472
3508
  /**
@@ -3487,40 +3523,1176 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
3487
3523
  readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3488
3524
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3489
3525
  readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3490
- readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3491
- /**
3492
- * The guide a **derived** item belongs to — its evaluation criteria, or a
3493
- * skill's member files (`subscription-delivery-target-plan.md` → slice 4).
3494
- *
3495
- * Absent on everything else, including a guide itself: a guide member is
3496
- * addressed by the guide's own id, so `id` already answers this for it.
3497
- *
3498
- * It exists because derived items have no bundle membership and no id of their
3499
- * guide's — they are `guide_files` rows attached by `guide_id` — so a rule
3500
- * expressed over guide ids (a subscriber's mute) cannot reach them from the
3501
- * item alone. Muting a skill and still delivering its `scripts/` would leave a
3502
- * broken half-skill on disk, which is worse than not muting at all.
3503
- */
3504
- readonly guideId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3526
+ readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3527
+ /**
3528
+ * The guide a **derived** item belongs to — its evaluation criteria, or a
3529
+ * skill's member files (`subscription-delivery-target-plan.md` → slice 4).
3530
+ *
3531
+ * Absent on everything else, including a guide itself: a guide member is
3532
+ * addressed by the guide's own id, so `id` already answers this for it.
3533
+ *
3534
+ * It exists because derived items have no bundle membership and no id of their
3535
+ * guide's — they are `guide_files` rows attached by `guide_id` — so a rule
3536
+ * expressed over guide ids (a subscriber's mute) cannot reach them from the
3537
+ * item alone. Muting a skill and still delivering its `scripts/` would leave a
3538
+ * broken half-skill on disk, which is worse than not muting at all.
3539
+ */
3540
+ readonly guideId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3541
+ readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
3542
+ 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>;
3543
+ readonly projectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3544
+ /**
3545
+ * The repo a **document's** declared `path` is placed in — its home — as the
3546
+ * `project.id` of the checkout that last set the path. Documents only.
3547
+ *
3548
+ * Deliberately not `projectId` above: a reader takes a mismatch there as "this
3549
+ * item belongs to another repo, do not materialize it", so a home echoed on it
3550
+ * would stop every other subscriber receiving the document at all. A home says
3551
+ * only *where* the path is literal. Only the repo whose `project.id` matches
3552
+ * writes the document at `path`; every other repo mirrors it under the
3553
+ * bundle folder (`bundleMirrorPath` in `@mossbear/projections`).
3554
+ *
3555
+ * Absent and null read the same — **no home**, so no repo takes the path
3556
+ * literally for a new placement. A server predating the field says the same,
3557
+ * which is the safe direction: the file lands inside the bundle folder
3558
+ * instead of at a repo path it may not belong in.
3559
+ */
3560
+ readonly pathProjectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3561
+ readonly aliases: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
3562
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
3563
+ 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">]>;
3564
+ }, undefined>, undefined>, v.MaxLengthAction<{
3565
+ root: "project" | "global";
3566
+ path: string;
3567
+ }[], 8, undefined>]>, undefined>;
3568
+ /**
3569
+ * Open comments a person left about this item, newest first.
3570
+ *
3571
+ * Optional, and absent rather than empty when there are none — the same rule
3572
+ * `aliases` and `projectId` follow above, and for the same reason: an older
3573
+ * reader against a newer server ignores the key, and a newer reader against
3574
+ * an older server reads "no comments" instead of failing.
3575
+ *
3576
+ * **Absence is not a verdict.** No comments here means none were served on this
3577
+ * item in this response — not that nobody has anything to say about it.
3578
+ */
3579
+ readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
3580
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3581
+ readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
3582
+ /** Current source location of an anchored passage, or its lost quote. */
3583
+ readonly passage: v.OptionalSchema<v.ObjectSchema<{
3584
+ readonly quote: v.StringSchema<undefined>;
3585
+ readonly status: v.PicklistSchema<["located", "changed", "orphaned"], undefined>;
3586
+ readonly lines: v.NullableSchema<v.ObjectSchema<{
3587
+ readonly start: v.NumberSchema<undefined>;
3588
+ readonly end: v.NumberSchema<undefined>;
3589
+ }, undefined>, undefined>;
3590
+ }, undefined>, undefined>;
3591
+ /** The comment's text, already wrapped in the response's untrusted markers. */
3592
+ readonly body: v.StringSchema<undefined>;
3593
+ /**
3594
+ * A suggested edit: the replacement for the passage at `passage.lines`,
3595
+ * already wrapped in the response's untrusted markers like `body`. An
3596
+ * insertion is the passage plus its new lines and an empty replacement is a
3597
+ * deletion, so every edit is one replace. Absent on an ordinary comment.
3598
+ */
3599
+ readonly suggestion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3600
+ /**
3601
+ * What a comment Mossbear wrote is: a finding about the item, never an edit.
3602
+ * Present only on a Mossbear comment. The comment's `body` begins with the
3603
+ * claim (what goes wrong); this carries what the claim rests on.
3604
+ */
3605
+ readonly finding: v.OptionalSchema<v.ObjectSchema<{
3606
+ readonly tier: v.PicklistSchema<["observed", "usage", "practice"], undefined>;
3607
+ /** How the finding is known, in one line: "Seen in 3 sessions (2026-09-15 – 2026-10-03)". */
3608
+ readonly tierLine: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
3609
+ /** What the drafter did not read, fixed per tier. */
3610
+ readonly blindSpot: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
3611
+ /** What should change in later sessions if the finding is fixed, wrapped in the untrusted markers. */
3612
+ readonly prediction: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3613
+ }, undefined>, undefined>;
3614
+ /**
3615
+ * Whether the person approved a comment Mossbear drafted. Present on every
3616
+ * Mossbear comment and absent on a person's or an agent's, which are
3617
+ * requests as written. `false` is a draft nobody has read yet: a reader shows
3618
+ * it to the user and acts only on their go-ahead. Only a client that reports
3619
+ * a version able to mark drafts is ever listed one, so an older reader that
3620
+ * strips this field never receives a draft it would print as a request.
3621
+ */
3622
+ readonly approved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
3623
+ /** The author's display name as the workspace shows it, or null. Never an email. */
3624
+ readonly authorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3625
+ /** ISO timestamp, machine format. */
3626
+ readonly createdAt: v.StringSchema<undefined>;
3627
+ /** The item's content version the comment was written against. */
3628
+ readonly itemVersion: v.NumberSchema<undefined>;
3629
+ /** True when the item's current version is greater than `itemVersion`. */
3630
+ readonly itemChangedSince: v.BooleanSchema<undefined>;
3631
+ /**
3632
+ * How many agent reads were handed this comment **before** this one — so a
3633
+ * comment reaching an agent for the first time reports `0`.
3634
+ *
3635
+ * It is the stored count as it read at the moment the response was built;
3636
+ * the serve this response *is* has not been counted yet. Excluded rather
3637
+ * than included because the count is recorded best-effort: a response that
3638
+ * claimed to include itself would be wrong whenever that record failed, and
3639
+ * a number that is sometimes off by one is worse than one that is
3640
+ * consistently the prior total.
3641
+ *
3642
+ * So `deliveredCount > 0` means an earlier read was handed this comment, and
3643
+ * `0` means this read is the first. Neither says a model took it in — only
3644
+ * that the server handed it over.
3645
+ */
3646
+ readonly deliveredCount: v.NumberSchema<undefined>;
3647
+ /**
3648
+ * This comment's thread root — its own id for every delivered root. Resolution
3649
+ * replies remain on the dashboard thread and are not delivered to agents.
3650
+ * It is on the wire from the first response
3651
+ * because the wire contract is consumed by installed CLI versions: reshaping
3652
+ * a flat `comments` array into threads-of-comments later would be a breaking
3653
+ * change, while a field today's readers ignore costs them nothing.
3654
+ */
3655
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3656
+ /**
3657
+ * Always `null` for a delivered root. Present so an older reader meeting a
3658
+ * future response that carries real replies degrades to
3659
+ * "a flat list of comments" rather than failing to parse.
3660
+ */
3661
+ readonly replyToId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
3662
+ }, undefined>, undefined>, v.MaxLengthAction<{
3663
+ id: string;
3664
+ state?: "open" | "resolved" | undefined;
3665
+ passage?: {
3666
+ quote: string;
3667
+ status: "located" | "changed" | "orphaned";
3668
+ lines: {
3669
+ start: number;
3670
+ end: number;
3671
+ } | null;
3672
+ } | undefined;
3673
+ body: string;
3674
+ suggestion?: string | undefined;
3675
+ finding?: {
3676
+ tier: "observed" | "usage" | "practice";
3677
+ tierLine: string;
3678
+ blindSpot: string;
3679
+ prediction: string | null;
3680
+ } | undefined;
3681
+ approved?: boolean | undefined;
3682
+ authorName: string | null;
3683
+ createdAt: string;
3684
+ itemVersion: number;
3685
+ itemChangedSince: boolean;
3686
+ deliveredCount: number;
3687
+ threadId: string;
3688
+ replyToId: string | null;
3689
+ }[], 20, undefined>]>, undefined>;
3690
+ readonly updatedAt: v.StringSchema<undefined>;
3691
+ /**
3692
+ * Present iff this artifact is owned by git. Absent means Mossbear owns it
3693
+ * and it is editable in the dashboard.
3694
+ *
3695
+ * **Optional, and absence is not yet a verdict.** Nothing writes this before
3696
+ * `publish` ships, so today every item omits it, and the existing bundle-home
3697
+ * rule — a bundle may name one repo as its only writer, and the server
3698
+ * refuses every other writer by name — is what still protects items a repo
3699
+ * already owns. A reader must not treat an absent `gitSource` as permission
3700
+ * to publish back.
3701
+ *
3702
+ * **Optional *and* nullable, like every other late-added column on this item.**
3703
+ * A serializer that maps the columns straight through emits `null` for a
3704
+ * Mossbear-owned row, and a key that only accepted `undefined` would throw on
3705
+ * the whole response rather than on the one item — `parseContextItemsResponse`
3706
+ * parses a pull as a batch. Both spellings read the same way: no git source.
3707
+ *
3708
+ * **`path` is the third required member of the subset and is not re-checked
3709
+ * here.** The database holds that invariant
3710
+ * (`guide_files_git_source_subset`), and a wire rule that looked identical
3711
+ * would in fact be stricter: `path` is serialized through a scope helper that
3712
+ * emits `null` for a path this schema cannot parse, so a single such row would
3713
+ * fail every other item in the same pull. A git-owned item that arrives
3714
+ * without a usable path is a broken item, not a broken response.
3715
+ */
3716
+ readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3717
+ /**
3718
+ * The committed `project.id` of the source repository — the same id space as
3719
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
3720
+ * says which repo an item is materialized into and is stamped onto
3721
+ * Mossbear-owned rows too, this one says who may edit it.
3722
+ */
3723
+ readonly projectId: 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">]>;
3724
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
3725
+ /**
3726
+ * The branch the publishing commit was on. **The one optional member**:
3727
+ * publication is not restricted by branch, so this is recorded so a subscriber
3728
+ * can see what they got, and a detached HEAD has none to record.
3729
+ */
3730
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
3731
+ }, undefined>, undefined>, undefined>;
3732
+ /**
3733
+ * This artifact is a **tombstone**: the repository that publishes it deleted
3734
+ * the file, so what the item still carries is the last revision rather than a
3735
+ * current one (`artifact-ownership-and-delivery-plan.md` → D28).
3736
+ *
3737
+ * **It is still delivered, and that is deliberate.** Dropping the item from
3738
+ * the response would say the same thing more quietly and cost two things
3739
+ * worth more than the byte: the publishing repo would lose the id it needs to
3740
+ * republish the path in place — re-adding a deleted file would create a
3741
+ * second artifact at the same path rather than a new revision of the one
3742
+ * that is there — and a reader would be left unable to tell a removal from
3743
+ * a bundle it has stopped being able to see. What the flag asks of a client
3744
+ * is one thing: do not materialize it. A file left at a discovery root keeps
3745
+ * feeding deleted guidance into every agent that reads that repo, which is
3746
+ * the failure the decision exists to stop.
3747
+ *
3748
+ * **Optional, and absent means an ordinary artifact.** A client that has
3749
+ * never heard of it behaves as it always did — it keeps the last published
3750
+ * revision on disk, which is the retain behaviour this replaces rather than a
3751
+ * new failure. That is what makes the server safe to ship first.
3752
+ *
3753
+ * `literal(true)` rather than a boolean: `removed: false` would be a second
3754
+ * spelling of absence, and an artifact that came back is content again rather
3755
+ * than a tombstone that says no.
3756
+ */
3757
+ readonly removed: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
3758
+ }, undefined>;
3759
+ }, undefined>;
3760
+ export declare const CaptureIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 8, "id must be at least 8 characters">, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must contain only letters, digits, underscore, dot or hyphen">]>;
3761
+ export declare const InboxCaptureRequestSchema: v.ObjectSchema<{
3762
+ /**
3763
+ * Optional, and it stays optional.
3764
+ *
3765
+ * This is a token-authenticated `v1` endpoint, so its callers are not only
3766
+ * the ones in this repo — adding a *required* field to it breaks every
3767
+ * external one for a field only the offline outbox needs. A caller that
3768
+ * sends an id is asking for idempotency; a caller that does not is asking
3769
+ * for a new note every time, which is the behaviour it already has.
3770
+ *
3771
+ * (An earlier version of this comment claimed the CLI and MCP server were
3772
+ * among those callers. They are not: both only read the inbox and archive
3773
+ * from it. The one in-repo caller is the dashboard composer.)
3774
+ */
3775
+ readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 8, "id must be at least 8 characters">, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must contain only letters, digits, underscore, dot or hyphen">]>, undefined>;
3776
+ readonly bundleId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3777
+ readonly contentType: v.PicklistSchema<("content" | "asset")[], undefined>;
3778
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
3779
+ readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3780
+ readonly source: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3781
+ }, undefined>;
3782
+ export declare const InboxItemSchema: v.ObjectSchema<{
3783
+ readonly id: v.StringSchema<undefined>;
3784
+ readonly type: v.PicklistSchema<string[], undefined>;
3785
+ readonly name: v.StringSchema<undefined>;
3786
+ /** The stored pair, as {@link ContextItemSchema} carries it. */
3787
+ readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3788
+ readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3789
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3790
+ readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3791
+ readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3792
+ readonly capturedAt: v.StringSchema<undefined>;
3793
+ readonly updatedAt: v.StringSchema<undefined>;
3794
+ }, undefined>;
3795
+ export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
3796
+ readonly item: v.ObjectSchema<{
3797
+ readonly id: v.StringSchema<undefined>;
3798
+ readonly type: v.PicklistSchema<string[], undefined>;
3799
+ readonly name: v.StringSchema<undefined>;
3800
+ /** The stored pair, as {@link ContextItemSchema} carries it. */
3801
+ readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3802
+ readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3803
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3804
+ readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3805
+ readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3806
+ readonly capturedAt: v.StringSchema<undefined>;
3807
+ readonly updatedAt: v.StringSchema<undefined>;
3808
+ }, undefined>;
3809
+ }, undefined>;
3810
+ export declare const InboxListResponseSchema: v.ObjectSchema<{
3811
+ readonly items: v.ArraySchema<v.ObjectSchema<{
3812
+ readonly id: v.StringSchema<undefined>;
3813
+ readonly type: v.PicklistSchema<string[], undefined>;
3814
+ readonly name: v.StringSchema<undefined>;
3815
+ /** The stored pair, as {@link ContextItemSchema} carries it. */
3816
+ readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3817
+ readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3818
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3819
+ readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3820
+ readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3821
+ readonly capturedAt: v.StringSchema<undefined>;
3822
+ readonly updatedAt: v.StringSchema<undefined>;
3823
+ }, undefined>, undefined>;
3824
+ }, undefined>;
3825
+ /** Max number of ids accepted in a single `POST /api/v1/context/inbox/archive` request. */
3826
+ export declare const MAX_INBOX_ARCHIVE_BATCH = 500;
3827
+ export declare const InboxArchiveRequestSchema: v.ObjectSchema<{
3828
+ 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>]>;
3829
+ }, undefined>;
3830
+ export declare const InboxArchiveResponseSchema: v.ObjectSchema<{
3831
+ readonly archived: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3832
+ }, undefined>;
3833
+ export declare const ContextItemVersionSchema: v.ObjectSchema<{
3834
+ readonly id: v.StringSchema<undefined>;
3835
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3836
+ readonly contentHash: v.StringSchema<undefined>;
3837
+ readonly authorType: v.StringSchema<undefined>;
3838
+ readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3839
+ readonly createdAt: v.StringSchema<undefined>;
3840
+ }, undefined>;
3841
+ export declare const ContextItemVersionDetailSchema: v.ObjectSchema<{
3842
+ readonly id: v.StringSchema<undefined>;
3843
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3844
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3845
+ readonly contentHash: v.StringSchema<undefined>;
3846
+ readonly authorType: v.StringSchema<undefined>;
3847
+ readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3848
+ readonly createdAt: v.StringSchema<undefined>;
3849
+ }, undefined>;
3850
+ export declare const ContextItemVersionsResponseSchema: v.ObjectSchema<{
3851
+ readonly versions: v.ArraySchema<v.ObjectSchema<{
3852
+ readonly id: v.StringSchema<undefined>;
3853
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3854
+ readonly contentHash: v.StringSchema<undefined>;
3855
+ readonly authorType: v.StringSchema<undefined>;
3856
+ readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3857
+ readonly createdAt: v.StringSchema<undefined>;
3858
+ }, undefined>, undefined>;
3859
+ readonly nextCursor: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
3860
+ }, undefined>;
3861
+ export declare const ContextItemVersionResponseSchema: v.ObjectSchema<{
3862
+ readonly version: v.ObjectSchema<{
3863
+ readonly id: v.StringSchema<undefined>;
3864
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3865
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3866
+ readonly contentHash: v.StringSchema<undefined>;
3867
+ readonly authorType: v.StringSchema<undefined>;
3868
+ readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3869
+ readonly createdAt: v.StringSchema<undefined>;
3870
+ }, undefined>;
3871
+ }, undefined>;
3872
+ /** Default and max page size for the version-history list endpoint. */
3873
+ export declare const DEFAULT_VERSIONS_LIMIT = 50;
3874
+ export declare const MAX_VERSIONS_LIMIT = 200;
3875
+ /**
3876
+ * What part an artifact plays. The stored `role` vocabulary, enumerated.
3877
+ *
3878
+ * Unlike the older item schema, which leaves role a bare string so an old client
3879
+ * survives a new value, the artifact contract names the set: a client that
3880
+ * meets a role it has never heard of should fail loudly on the parse rather than
3881
+ * guess at what it may do with the bytes. Adding a role is a deliberate wire
3882
+ * change.
3883
+ */
3884
+ export declare const ArtifactRoleSchema: v.PicklistSchema<["guidance", "criteria", "content"], undefined>;
3885
+ /**
3886
+ * What shape an artifact's bytes are. Not {@link GuideFileFormatSchema}, which
3887
+ * names agent-instruction file layouts; this is the stored content format.
3888
+ */
3889
+ export declare const ArtifactFormatSchema: v.PicklistSchema<["markdown", "html", "binary", "code"], undefined>;
3890
+ /**
3891
+ * The formats a caller may create, derived from the content-kind table so a
3892
+ * kind that is not pushable cannot become creatable here. Binary is excluded:
3893
+ * a create stores text `content`, and a binary artifact reads back with
3894
+ * `content: null`, so it could not round-trip. Creation is always
3895
+ * `role: 'content'`; guidance and criteria arrive through import.
3896
+ */
3897
+ export declare const CreatableArtifactFormatSchema: v.PicklistSchema<("markdown" | "binary")[], undefined>;
3898
+ /** Largest version an artifact can carry: the version column is a 32-bit integer. */
3899
+ export declare const MAX_ARTIFACT_VERSION = 2147483647;
3900
+ /**
3901
+ * Lifecycle state of an artifact. `removed` is a tombstone: the publishing
3902
+ * repository deleted the file, and the artifact still reports its last revision.
3903
+ * Aliases and anything else that is not content are not artifacts and never
3904
+ * appear here.
3905
+ */
3906
+ export declare const ArtifactStateSchema: v.PicklistSchema<["live", "archived", "removed"], undefined>;
3907
+ /** Most source references one saved revision may pin. */
3908
+ export declare const MAX_ARTIFACT_SOURCE_REFS = 50;
3909
+ /**
3910
+ * A byte range inside a pinned source revision, `[start, end)` over the UTF-8
3911
+ * bytes the revision's content hash covers. Resolved against the pinned bytes,
3912
+ * never the source's current head.
3913
+ */
3914
+ export declare const ArtifactPassageSelectorSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
3915
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3916
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3917
+ }, undefined>, v.CheckAction<{
3918
+ start: number;
3919
+ end: number;
3920
+ }, "passage end must be greater than start">]>;
3921
+ export declare const ArtifactSourceRefSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
3922
+ artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3923
+ version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
3924
+ contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
3925
+ passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3926
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3927
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3928
+ }, undefined>, v.CheckAction<{
3929
+ start: number;
3930
+ end: number;
3931
+ }, "passage end must be greater than start">]>, undefined>;
3932
+ gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
3933
+ }, undefined>, v.CheckAction<{
3934
+ artifactId: string;
3935
+ version?: number | undefined;
3936
+ contentHash?: string | undefined;
3937
+ passage?: {
3938
+ start: number;
3939
+ end: number;
3940
+ } | undefined;
3941
+ gitCommit?: string | undefined;
3942
+ }, "a passage requires version: it selects bytes of a pinned revision">]>;
3943
+ /** The bounded source list a write may attach to the revision it creates. */
3944
+ export declare const ArtifactSourceRefsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3945
+ artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3946
+ version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
3947
+ contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
3948
+ passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3949
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3950
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3951
+ }, undefined>, v.CheckAction<{
3952
+ start: number;
3953
+ end: number;
3954
+ }, "passage end must be greater than start">]>, undefined>;
3955
+ gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
3956
+ }, undefined>, v.CheckAction<{
3957
+ artifactId: string;
3958
+ version?: number | undefined;
3959
+ contentHash?: string | undefined;
3960
+ passage?: {
3961
+ start: number;
3962
+ end: number;
3963
+ } | undefined;
3964
+ gitCommit?: string | undefined;
3965
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
3966
+ artifactId: string;
3967
+ version?: number | undefined;
3968
+ contentHash?: string | undefined;
3969
+ passage?: {
3970
+ start: number;
3971
+ end: number;
3972
+ } | undefined;
3973
+ gitCommit?: string | undefined;
3974
+ }[], 50, undefined>]>;
3975
+ /**
3976
+ * A source reference as a saved revision reports it: the writer's reference plus
3977
+ * the `basis` the server recorded. `verified` means the writer pinned a revision
3978
+ * and a hash and both matched the server's copy; `asserted` is everything else.
3979
+ * Output only: request schemas do not accept `basis`, so a client cannot claim it.
3980
+ */
3981
+ export declare const ArtifactRecordedSourceRefSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
3982
+ readonly basis: v.PicklistSchema<["verified", "asserted"], undefined>;
3983
+ readonly artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3984
+ readonly version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
3985
+ readonly contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
3986
+ readonly passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
3987
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3988
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3989
+ }, undefined>, v.CheckAction<{
3990
+ start: number;
3991
+ end: number;
3992
+ }, "passage end must be greater than start">]>, undefined>;
3993
+ readonly gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
3994
+ }, undefined>, v.CheckAction<{
3995
+ basis: "verified" | "asserted";
3996
+ artifactId: string;
3997
+ version?: number | undefined;
3998
+ contentHash?: string | undefined;
3999
+ passage?: {
4000
+ start: number;
4001
+ end: number;
4002
+ } | undefined;
4003
+ gitCommit?: string | undefined;
4004
+ }, "a passage requires version: it selects bytes of a pinned revision">]>;
4005
+ export declare const ArtifactRecordedSourceRefsSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4006
+ readonly basis: v.PicklistSchema<["verified", "asserted"], undefined>;
4007
+ readonly artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4008
+ readonly version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4009
+ readonly contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4010
+ readonly passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4011
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4012
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4013
+ }, undefined>, v.CheckAction<{
4014
+ start: number;
4015
+ end: number;
4016
+ }, "passage end must be greater than start">]>, undefined>;
4017
+ readonly gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
4018
+ }, undefined>, v.CheckAction<{
4019
+ basis: "verified" | "asserted";
4020
+ artifactId: string;
4021
+ version?: number | undefined;
4022
+ contentHash?: string | undefined;
4023
+ passage?: {
4024
+ start: number;
4025
+ end: number;
4026
+ } | undefined;
4027
+ gitCommit?: string | undefined;
4028
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
4029
+ basis: "verified" | "asserted";
4030
+ artifactId: string;
4031
+ version?: number | undefined;
4032
+ contentHash?: string | undefined;
4033
+ passage?: {
4034
+ start: number;
4035
+ end: number;
4036
+ } | undefined;
4037
+ gitCommit?: string | undefined;
4038
+ }[], 50, undefined>]>;
4039
+ /**
4040
+ * The common description of an artifact, whatever it is called in prose.
4041
+ *
4042
+ * `id` is the id of the content row itself, for a guide the body-file id, so a
4043
+ * read, an update, a comment and a history call all address the same thing and
4044
+ * no caller translates one id into another. `role` and `format` are real values
4045
+ * for every artifact, guides included.
4046
+ */
4047
+ export declare const ArtifactSchema: v.ObjectSchema<{
4048
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4049
+ readonly name: v.StringSchema<undefined>;
4050
+ readonly role: v.PicklistSchema<["guidance", "criteria", "content"], undefined>;
4051
+ readonly format: v.PicklistSchema<["markdown", "html", "binary", "code"], undefined>;
4052
+ /** Monotonic content version; echo it back as `expectedVersion` to update. */
4053
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4054
+ readonly state: v.PicklistSchema<["live", "archived", "removed"], undefined>;
4055
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4056
+ /** True for a deliberate capture (Inbox). Not derivable from filing state. */
4057
+ readonly capture: v.BooleanSchema<undefined>;
4058
+ /** Null for binary content, which is not served inline. */
4059
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4060
+ readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4061
+ readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
4062
+ 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>;
4063
+ readonly projectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4064
+ readonly pathProjectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4065
+ readonly aliases: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4066
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
4067
+ 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">]>;
4068
+ }, undefined>, undefined>, v.MaxLengthAction<{
4069
+ root: "project" | "global";
4070
+ path: string;
4071
+ }[], 8, undefined>]>, undefined>;
4072
+ /** Present iff git owns this artifact. */
4073
+ readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
4074
+ /**
4075
+ * The committed `project.id` of the source repository — the same id space as
4076
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4077
+ * says which repo an item is materialized into and is stamped onto
4078
+ * Mossbear-owned rows too, this one says who may edit it.
4079
+ */
4080
+ readonly projectId: 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">]>;
4081
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4082
+ /**
4083
+ * The branch the publishing commit was on. **The one optional member**:
4084
+ * publication is not restricted by branch, so this is recorded so a subscriber
4085
+ * can see what they got, and a detached HEAD has none to record.
4086
+ */
4087
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4088
+ }, undefined>, undefined>, undefined>;
4089
+ /** Absent, not empty, when there are none. Absence is not a verdict. */
4090
+ readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4091
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4092
+ readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
4093
+ /** Current source location of an anchored passage, or its lost quote. */
4094
+ readonly passage: v.OptionalSchema<v.ObjectSchema<{
4095
+ readonly quote: v.StringSchema<undefined>;
4096
+ readonly status: v.PicklistSchema<["located", "changed", "orphaned"], undefined>;
4097
+ readonly lines: v.NullableSchema<v.ObjectSchema<{
4098
+ readonly start: v.NumberSchema<undefined>;
4099
+ readonly end: v.NumberSchema<undefined>;
4100
+ }, undefined>, undefined>;
4101
+ }, undefined>, undefined>;
4102
+ /** The comment's text, already wrapped in the response's untrusted markers. */
4103
+ readonly body: v.StringSchema<undefined>;
4104
+ /**
4105
+ * A suggested edit: the replacement for the passage at `passage.lines`,
4106
+ * already wrapped in the response's untrusted markers like `body`. An
4107
+ * insertion is the passage plus its new lines and an empty replacement is a
4108
+ * deletion, so every edit is one replace. Absent on an ordinary comment.
4109
+ */
4110
+ readonly suggestion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4111
+ /**
4112
+ * What a comment Mossbear wrote is: a finding about the item, never an edit.
4113
+ * Present only on a Mossbear comment. The comment's `body` begins with the
4114
+ * claim (what goes wrong); this carries what the claim rests on.
4115
+ */
4116
+ readonly finding: v.OptionalSchema<v.ObjectSchema<{
4117
+ readonly tier: v.PicklistSchema<["observed", "usage", "practice"], undefined>;
4118
+ /** How the finding is known, in one line: "Seen in 3 sessions (2026-09-15 – 2026-10-03)". */
4119
+ readonly tierLine: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4120
+ /** What the drafter did not read, fixed per tier. */
4121
+ readonly blindSpot: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4122
+ /** What should change in later sessions if the finding is fixed, wrapped in the untrusted markers. */
4123
+ readonly prediction: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4124
+ }, undefined>, undefined>;
4125
+ /**
4126
+ * Whether the person approved a comment Mossbear drafted. Present on every
4127
+ * Mossbear comment and absent on a person's or an agent's, which are
4128
+ * requests as written. `false` is a draft nobody has read yet: a reader shows
4129
+ * it to the user and acts only on their go-ahead. Only a client that reports
4130
+ * a version able to mark drafts is ever listed one, so an older reader that
4131
+ * strips this field never receives a draft it would print as a request.
4132
+ */
4133
+ readonly approved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
4134
+ /** The author's display name as the workspace shows it, or null. Never an email. */
4135
+ readonly authorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4136
+ /** ISO timestamp, machine format. */
4137
+ readonly createdAt: v.StringSchema<undefined>;
4138
+ /** The item's content version the comment was written against. */
4139
+ readonly itemVersion: v.NumberSchema<undefined>;
4140
+ /** True when the item's current version is greater than `itemVersion`. */
4141
+ readonly itemChangedSince: v.BooleanSchema<undefined>;
4142
+ /**
4143
+ * How many agent reads were handed this comment **before** this one — so a
4144
+ * comment reaching an agent for the first time reports `0`.
4145
+ *
4146
+ * It is the stored count as it read at the moment the response was built;
4147
+ * the serve this response *is* has not been counted yet. Excluded rather
4148
+ * than included because the count is recorded best-effort: a response that
4149
+ * claimed to include itself would be wrong whenever that record failed, and
4150
+ * a number that is sometimes off by one is worse than one that is
4151
+ * consistently the prior total.
4152
+ *
4153
+ * So `deliveredCount > 0` means an earlier read was handed this comment, and
4154
+ * `0` means this read is the first. Neither says a model took it in — only
4155
+ * that the server handed it over.
4156
+ */
4157
+ readonly deliveredCount: v.NumberSchema<undefined>;
4158
+ /**
4159
+ * This comment's thread root — its own id for every delivered root. Resolution
4160
+ * replies remain on the dashboard thread and are not delivered to agents.
4161
+ * It is on the wire from the first response
4162
+ * because the wire contract is consumed by installed CLI versions: reshaping
4163
+ * a flat `comments` array into threads-of-comments later would be a breaking
4164
+ * change, while a field today's readers ignore costs them nothing.
4165
+ */
4166
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4167
+ /**
4168
+ * Always `null` for a delivered root. Present so an older reader meeting a
4169
+ * future response that carries real replies degrades to
4170
+ * "a flat list of comments" rather than failing to parse.
4171
+ */
4172
+ readonly replyToId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4173
+ }, undefined>, undefined>, v.MaxLengthAction<{
4174
+ id: string;
4175
+ state?: "open" | "resolved" | undefined;
4176
+ passage?: {
4177
+ quote: string;
4178
+ status: "located" | "changed" | "orphaned";
4179
+ lines: {
4180
+ start: number;
4181
+ end: number;
4182
+ } | null;
4183
+ } | undefined;
4184
+ body: string;
4185
+ suggestion?: string | undefined;
4186
+ finding?: {
4187
+ tier: "observed" | "usage" | "practice";
4188
+ tierLine: string;
4189
+ blindSpot: string;
4190
+ prediction: string | null;
4191
+ } | undefined;
4192
+ approved?: boolean | undefined;
4193
+ authorName: string | null;
4194
+ createdAt: string;
4195
+ itemVersion: number;
4196
+ itemChangedSince: boolean;
4197
+ deliveredCount: number;
4198
+ threadId: string;
4199
+ replyToId: string | null;
4200
+ }[], 20, undefined>]>, undefined>;
4201
+ readonly updatedAt: v.StringSchema<undefined>;
4202
+ }, undefined>;
4203
+ /**
4204
+ * Create an artifact. Always a create: it takes no id, and an update is a
4205
+ * separate request. `bundle` is optional for an unrestricted caller, who files
4206
+ * later; a scoped credential must name a bundle it may write, and the server
4207
+ * refuses a scoped create without one.
4208
+ */
4209
+ export declare const CreateArtifactRequestSchema: v.StrictObjectSchema<{
4210
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
4211
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
4212
+ /** Defaults to markdown. Creation is always `role: 'content'`. */
4213
+ readonly format: v.OptionalSchema<v.PicklistSchema<("markdown" | "binary")[], undefined>, undefined>;
4214
+ /** Destination bundle slug. */
4215
+ readonly bundle: v.OptionalSchema<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">]>, undefined>;
4216
+ readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4217
+ /** Sources pinned on the first revision. */
4218
+ readonly sources: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4219
+ artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4220
+ version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4221
+ contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4222
+ passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4223
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4224
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4225
+ }, undefined>, v.CheckAction<{
4226
+ start: number;
4227
+ end: number;
4228
+ }, "passage end must be greater than start">]>, undefined>;
4229
+ gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
4230
+ }, undefined>, v.CheckAction<{
4231
+ artifactId: string;
4232
+ version?: number | undefined;
4233
+ contentHash?: string | undefined;
4234
+ passage?: {
4235
+ start: number;
4236
+ end: number;
4237
+ } | undefined;
4238
+ gitCommit?: string | undefined;
4239
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
4240
+ artifactId: string;
4241
+ version?: number | undefined;
4242
+ contentHash?: string | undefined;
4243
+ passage?: {
4244
+ start: number;
4245
+ end: number;
4246
+ } | undefined;
4247
+ gitCommit?: string | undefined;
4248
+ }[], 50, undefined>]>, undefined>;
4249
+ }, undefined>;
4250
+ /**
4251
+ * Update an existing artifact's content. The id is in the route. The version the
4252
+ * caller read is required: there is no last-write-wins update. `sources`
4253
+ * describe the revision this write creates and are not inherited, so omitting
4254
+ * them records none.
4255
+ */
4256
+ export declare const UpdateArtifactRequestSchema: v.StrictObjectSchema<{
4257
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 524288 bytes">]>;
4258
+ readonly expectedVersion: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4259
+ readonly sources: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4260
+ artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4261
+ version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4262
+ contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4263
+ passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4264
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4265
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4266
+ }, undefined>, v.CheckAction<{
4267
+ start: number;
4268
+ end: number;
4269
+ }, "passage end must be greater than start">]>, undefined>;
4270
+ gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
4271
+ }, undefined>, v.CheckAction<{
4272
+ artifactId: string;
4273
+ version?: number | undefined;
4274
+ contentHash?: string | undefined;
4275
+ passage?: {
4276
+ start: number;
4277
+ end: number;
4278
+ } | undefined;
4279
+ gitCommit?: string | undefined;
4280
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
4281
+ artifactId: string;
4282
+ version?: number | undefined;
4283
+ contentHash?: string | undefined;
4284
+ passage?: {
4285
+ start: number;
4286
+ end: number;
4287
+ } | undefined;
4288
+ gitCommit?: string | undefined;
4289
+ }[], 50, undefined>]>, undefined>;
4290
+ /**
4291
+ * The writer's checkout, as the `project.id` it commits. Declaring it grants
4292
+ * nothing; it says which checkout this write comes from, so the home
4293
+ * repository of a git-owned artifact or home-claiming bundle is not refused.
4294
+ * Same meaning and parsing as `UpdateContextItemRequestSchema.projectId`.
4295
+ */
4296
+ readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4297
+ /**
4298
+ * The commit the new content was read from, for a git-owned artifact. Same
4299
+ * shape and meaning as `UpdateContextItemRequestSchema.gitSource`: it advances
4300
+ * the artifact's recorded provenance with its content. A git-owned artifact
4301
+ * updated without one is refused (409); for any other artifact it is ignored.
4302
+ */
4303
+ readonly gitSource: v.OptionalSchema<v.ObjectSchema<{
4304
+ /**
4305
+ * The committed `project.id` of the source repository — the same id space as
4306
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4307
+ * says which repo an item is materialized into and is stamped onto
4308
+ * Mossbear-owned rows too, this one says who may edit it.
4309
+ */
4310
+ readonly projectId: 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">]>;
4311
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4312
+ /**
4313
+ * The branch the publishing commit was on. **The one optional member**:
4314
+ * publication is not restricted by branch, so this is recorded so a subscriber
4315
+ * can see what they got, and a detached HEAD has none to record.
4316
+ */
4317
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4318
+ }, undefined>, undefined>;
4319
+ }, undefined>;
4320
+ /** Archive an artifact. The body is optional; `projectId` is the same checkout claim as on update. */
4321
+ export declare const ArchiveArtifactRequestSchema: v.StrictObjectSchema<{
4322
+ readonly projectId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4323
+ }, undefined>;
4324
+ /**
4325
+ * `GET .../history` query. Integer strings only: `2abc` is not 2. `limit` is
4326
+ * bounded and `before` is a positive safe integer version cursor.
4327
+ */
4328
+ export declare const ArtifactHistoryQuerySchema: v.ObjectSchema<{
4329
+ readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "limit must be a positive integer">, v.TransformAction<any, number>, v.MaxValueAction<number, 200, undefined>]>, undefined>;
4330
+ readonly before: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "before must be a positive integer">, v.TransformAction<any, number>, v.SafeIntegerAction<number, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4331
+ }, undefined>;
4332
+ /**
4333
+ * Optional revision selector for a read (`?version=n`). Omitted reads the
4334
+ * current content. When given, the response `artifact.content` is that saved
4335
+ * revision's bytes while `artifact.version` stays the current version, so the
4336
+ * value to send back as `expectedVersion` never depends on what was selected.
4337
+ * A version that was never saved is a 404, not the nearest one.
4338
+ */
4339
+ export declare const ReadArtifactQuerySchema: v.ObjectSchema<{
4340
+ readonly version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4341
+ }, undefined>;
4342
+ /** Which revision the content in a read response is. */
4343
+ export declare const ArtifactSelectedRevisionSchema: v.ObjectSchema<{
4344
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4345
+ /** True when this is the current version. */
4346
+ readonly current: v.BooleanSchema<undefined>;
4347
+ readonly contentHash: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4348
+ }, undefined>;
4349
+ export declare const ReadArtifactResponseSchema: v.ObjectSchema<{
4350
+ readonly artifact: v.ObjectSchema<{
4351
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4352
+ readonly name: v.StringSchema<undefined>;
4353
+ readonly role: v.PicklistSchema<["guidance", "criteria", "content"], undefined>;
4354
+ readonly format: v.PicklistSchema<["markdown", "html", "binary", "code"], undefined>;
4355
+ /** Monotonic content version; echo it back as `expectedVersion` to update. */
4356
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4357
+ readonly state: v.PicklistSchema<["live", "archived", "removed"], undefined>;
4358
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4359
+ /** True for a deliberate capture (Inbox). Not derivable from filing state. */
4360
+ readonly capture: v.BooleanSchema<undefined>;
4361
+ /** Null for binary content, which is not served inline. */
4362
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4363
+ readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4364
+ readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
4365
+ 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>;
4366
+ readonly projectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4367
+ readonly pathProjectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4368
+ readonly aliases: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4369
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
4370
+ 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">]>;
4371
+ }, undefined>, undefined>, v.MaxLengthAction<{
4372
+ root: "project" | "global";
4373
+ path: string;
4374
+ }[], 8, undefined>]>, undefined>;
4375
+ /** Present iff git owns this artifact. */
4376
+ readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
4377
+ /**
4378
+ * The committed `project.id` of the source repository — the same id space as
4379
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4380
+ * says which repo an item is materialized into and is stamped onto
4381
+ * Mossbear-owned rows too, this one says who may edit it.
4382
+ */
4383
+ readonly projectId: 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">]>;
4384
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4385
+ /**
4386
+ * The branch the publishing commit was on. **The one optional member**:
4387
+ * publication is not restricted by branch, so this is recorded so a subscriber
4388
+ * can see what they got, and a detached HEAD has none to record.
4389
+ */
4390
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4391
+ }, undefined>, undefined>, undefined>;
4392
+ /** Absent, not empty, when there are none. Absence is not a verdict. */
4393
+ readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4394
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4395
+ readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
4396
+ /** Current source location of an anchored passage, or its lost quote. */
4397
+ readonly passage: v.OptionalSchema<v.ObjectSchema<{
4398
+ readonly quote: v.StringSchema<undefined>;
4399
+ readonly status: v.PicklistSchema<["located", "changed", "orphaned"], undefined>;
4400
+ readonly lines: v.NullableSchema<v.ObjectSchema<{
4401
+ readonly start: v.NumberSchema<undefined>;
4402
+ readonly end: v.NumberSchema<undefined>;
4403
+ }, undefined>, undefined>;
4404
+ }, undefined>, undefined>;
4405
+ /** The comment's text, already wrapped in the response's untrusted markers. */
4406
+ readonly body: v.StringSchema<undefined>;
4407
+ /**
4408
+ * A suggested edit: the replacement for the passage at `passage.lines`,
4409
+ * already wrapped in the response's untrusted markers like `body`. An
4410
+ * insertion is the passage plus its new lines and an empty replacement is a
4411
+ * deletion, so every edit is one replace. Absent on an ordinary comment.
4412
+ */
4413
+ readonly suggestion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4414
+ /**
4415
+ * What a comment Mossbear wrote is: a finding about the item, never an edit.
4416
+ * Present only on a Mossbear comment. The comment's `body` begins with the
4417
+ * claim (what goes wrong); this carries what the claim rests on.
4418
+ */
4419
+ readonly finding: v.OptionalSchema<v.ObjectSchema<{
4420
+ readonly tier: v.PicklistSchema<["observed", "usage", "practice"], undefined>;
4421
+ /** How the finding is known, in one line: "Seen in 3 sessions (2026-09-15 – 2026-10-03)". */
4422
+ readonly tierLine: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4423
+ /** What the drafter did not read, fixed per tier. */
4424
+ readonly blindSpot: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4425
+ /** What should change in later sessions if the finding is fixed, wrapped in the untrusted markers. */
4426
+ readonly prediction: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4427
+ }, undefined>, undefined>;
4428
+ /**
4429
+ * Whether the person approved a comment Mossbear drafted. Present on every
4430
+ * Mossbear comment and absent on a person's or an agent's, which are
4431
+ * requests as written. `false` is a draft nobody has read yet: a reader shows
4432
+ * it to the user and acts only on their go-ahead. Only a client that reports
4433
+ * a version able to mark drafts is ever listed one, so an older reader that
4434
+ * strips this field never receives a draft it would print as a request.
4435
+ */
4436
+ readonly approved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
4437
+ /** The author's display name as the workspace shows it, or null. Never an email. */
4438
+ readonly authorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4439
+ /** ISO timestamp, machine format. */
4440
+ readonly createdAt: v.StringSchema<undefined>;
4441
+ /** The item's content version the comment was written against. */
4442
+ readonly itemVersion: v.NumberSchema<undefined>;
4443
+ /** True when the item's current version is greater than `itemVersion`. */
4444
+ readonly itemChangedSince: v.BooleanSchema<undefined>;
4445
+ /**
4446
+ * How many agent reads were handed this comment **before** this one — so a
4447
+ * comment reaching an agent for the first time reports `0`.
4448
+ *
4449
+ * It is the stored count as it read at the moment the response was built;
4450
+ * the serve this response *is* has not been counted yet. Excluded rather
4451
+ * than included because the count is recorded best-effort: a response that
4452
+ * claimed to include itself would be wrong whenever that record failed, and
4453
+ * a number that is sometimes off by one is worse than one that is
4454
+ * consistently the prior total.
4455
+ *
4456
+ * So `deliveredCount > 0` means an earlier read was handed this comment, and
4457
+ * `0` means this read is the first. Neither says a model took it in — only
4458
+ * that the server handed it over.
4459
+ */
4460
+ readonly deliveredCount: v.NumberSchema<undefined>;
4461
+ /**
4462
+ * This comment's thread root — its own id for every delivered root. Resolution
4463
+ * replies remain on the dashboard thread and are not delivered to agents.
4464
+ * It is on the wire from the first response
4465
+ * because the wire contract is consumed by installed CLI versions: reshaping
4466
+ * a flat `comments` array into threads-of-comments later would be a breaking
4467
+ * change, while a field today's readers ignore costs them nothing.
4468
+ */
4469
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4470
+ /**
4471
+ * Always `null` for a delivered root. Present so an older reader meeting a
4472
+ * future response that carries real replies degrades to
4473
+ * "a flat list of comments" rather than failing to parse.
4474
+ */
4475
+ readonly replyToId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4476
+ }, undefined>, undefined>, v.MaxLengthAction<{
4477
+ id: string;
4478
+ state?: "open" | "resolved" | undefined;
4479
+ passage?: {
4480
+ quote: string;
4481
+ status: "located" | "changed" | "orphaned";
4482
+ lines: {
4483
+ start: number;
4484
+ end: number;
4485
+ } | null;
4486
+ } | undefined;
4487
+ body: string;
4488
+ suggestion?: string | undefined;
4489
+ finding?: {
4490
+ tier: "observed" | "usage" | "practice";
4491
+ tierLine: string;
4492
+ blindSpot: string;
4493
+ prediction: string | null;
4494
+ } | undefined;
4495
+ approved?: boolean | undefined;
4496
+ authorName: string | null;
4497
+ createdAt: string;
4498
+ itemVersion: number;
4499
+ itemChangedSince: boolean;
4500
+ deliveredCount: number;
4501
+ threadId: string;
4502
+ replyToId: string | null;
4503
+ }[], 20, undefined>]>, undefined>;
4504
+ readonly updatedAt: v.StringSchema<undefined>;
4505
+ }, undefined>;
4506
+ readonly revision: v.ObjectSchema<{
4507
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4508
+ /** True when this is the current version. */
4509
+ readonly current: v.BooleanSchema<undefined>;
4510
+ readonly contentHash: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4511
+ }, undefined>;
4512
+ /** Delimiters for comment bodies, present when any comment is returned. */
4513
+ readonly untrusted: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
4514
+ readonly token: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4515
+ readonly startMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4516
+ readonly endMarker: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4517
+ readonly note: v.StringSchema<undefined>;
4518
+ }, undefined>, undefined>, undefined>;
4519
+ }, undefined>;
4520
+ export declare const CreateArtifactResponseSchema: v.ObjectSchema<{
4521
+ readonly artifact: v.ObjectSchema<{
4522
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4523
+ readonly name: v.StringSchema<undefined>;
4524
+ readonly role: v.PicklistSchema<["guidance", "criteria", "content"], undefined>;
4525
+ readonly format: v.PicklistSchema<["markdown", "html", "binary", "code"], undefined>;
4526
+ /** Monotonic content version; echo it back as `expectedVersion` to update. */
4527
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4528
+ readonly state: v.PicklistSchema<["live", "archived", "removed"], undefined>;
4529
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4530
+ /** True for a deliberate capture (Inbox). Not derivable from filing state. */
4531
+ readonly capture: v.BooleanSchema<undefined>;
4532
+ /** Null for binary content, which is not served inline. */
4533
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4534
+ readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4535
+ readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
4536
+ 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>;
4537
+ readonly projectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4538
+ readonly pathProjectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
4539
+ readonly aliases: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4540
+ readonly root: v.PicklistSchema<["project", "global"], undefined>;
4541
+ 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">]>;
4542
+ }, undefined>, undefined>, v.MaxLengthAction<{
4543
+ root: "project" | "global";
4544
+ path: string;
4545
+ }[], 8, undefined>]>, undefined>;
4546
+ /** Present iff git owns this artifact. */
4547
+ readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
4548
+ /**
4549
+ * The committed `project.id` of the source repository — the same id space as
4550
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4551
+ * says which repo an item is materialized into and is stamped onto
4552
+ * Mossbear-owned rows too, this one says who may edit it.
4553
+ */
4554
+ readonly projectId: 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">]>;
4555
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4556
+ /**
4557
+ * The branch the publishing commit was on. **The one optional member**:
4558
+ * publication is not restricted by branch, so this is recorded so a subscriber
4559
+ * can see what they got, and a detached HEAD has none to record.
4560
+ */
4561
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4562
+ }, undefined>, undefined>, undefined>;
4563
+ /** Absent, not empty, when there are none. Absence is not a verdict. */
4564
+ readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
4565
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4566
+ readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
4567
+ /** Current source location of an anchored passage, or its lost quote. */
4568
+ readonly passage: v.OptionalSchema<v.ObjectSchema<{
4569
+ readonly quote: v.StringSchema<undefined>;
4570
+ readonly status: v.PicklistSchema<["located", "changed", "orphaned"], undefined>;
4571
+ readonly lines: v.NullableSchema<v.ObjectSchema<{
4572
+ readonly start: v.NumberSchema<undefined>;
4573
+ readonly end: v.NumberSchema<undefined>;
4574
+ }, undefined>, undefined>;
4575
+ }, undefined>, undefined>;
4576
+ /** The comment's text, already wrapped in the response's untrusted markers. */
4577
+ readonly body: v.StringSchema<undefined>;
4578
+ /**
4579
+ * A suggested edit: the replacement for the passage at `passage.lines`,
4580
+ * already wrapped in the response's untrusted markers like `body`. An
4581
+ * insertion is the passage plus its new lines and an empty replacement is a
4582
+ * deletion, so every edit is one replace. Absent on an ordinary comment.
4583
+ */
4584
+ readonly suggestion: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4585
+ /**
4586
+ * What a comment Mossbear wrote is: a finding about the item, never an edit.
4587
+ * Present only on a Mossbear comment. The comment's `body` begins with the
4588
+ * claim (what goes wrong); this carries what the claim rests on.
4589
+ */
4590
+ readonly finding: v.OptionalSchema<v.ObjectSchema<{
4591
+ readonly tier: v.PicklistSchema<["observed", "usage", "practice"], undefined>;
4592
+ /** How the finding is known, in one line: "Seen in 3 sessions (2026-09-15 – 2026-10-03)". */
4593
+ readonly tierLine: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4594
+ /** What the drafter did not read, fixed per tier. */
4595
+ readonly blindSpot: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 300, undefined>]>;
4596
+ /** What should change in later sessions if the finding is fixed, wrapped in the untrusted markers. */
4597
+ readonly prediction: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4598
+ }, undefined>, undefined>;
4599
+ /**
4600
+ * Whether the person approved a comment Mossbear drafted. Present on every
4601
+ * Mossbear comment and absent on a person's or an agent's, which are
4602
+ * requests as written. `false` is a draft nobody has read yet: a reader shows
4603
+ * it to the user and acts only on their go-ahead. Only a client that reports
4604
+ * a version able to mark drafts is ever listed one, so an older reader that
4605
+ * strips this field never receives a draft it would print as a request.
4606
+ */
4607
+ readonly approved: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
4608
+ /** The author's display name as the workspace shows it, or null. Never an email. */
4609
+ readonly authorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4610
+ /** ISO timestamp, machine format. */
4611
+ readonly createdAt: v.StringSchema<undefined>;
4612
+ /** The item's content version the comment was written against. */
4613
+ readonly itemVersion: v.NumberSchema<undefined>;
4614
+ /** True when the item's current version is greater than `itemVersion`. */
4615
+ readonly itemChangedSince: v.BooleanSchema<undefined>;
4616
+ /**
4617
+ * How many agent reads were handed this comment **before** this one — so a
4618
+ * comment reaching an agent for the first time reports `0`.
4619
+ *
4620
+ * It is the stored count as it read at the moment the response was built;
4621
+ * the serve this response *is* has not been counted yet. Excluded rather
4622
+ * than included because the count is recorded best-effort: a response that
4623
+ * claimed to include itself would be wrong whenever that record failed, and
4624
+ * a number that is sometimes off by one is worse than one that is
4625
+ * consistently the prior total.
4626
+ *
4627
+ * So `deliveredCount > 0` means an earlier read was handed this comment, and
4628
+ * `0` means this read is the first. Neither says a model took it in — only
4629
+ * that the server handed it over.
4630
+ */
4631
+ readonly deliveredCount: v.NumberSchema<undefined>;
4632
+ /**
4633
+ * This comment's thread root — its own id for every delivered root. Resolution
4634
+ * replies remain on the dashboard thread and are not delivered to agents.
4635
+ * It is on the wire from the first response
4636
+ * because the wire contract is consumed by installed CLI versions: reshaping
4637
+ * a flat `comments` array into threads-of-comments later would be a breaking
4638
+ * change, while a field today's readers ignore costs them nothing.
4639
+ */
4640
+ readonly threadId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4641
+ /**
4642
+ * Always `null` for a delivered root. Present so an older reader meeting a
4643
+ * future response that carries real replies degrades to
4644
+ * "a flat list of comments" rather than failing to parse.
4645
+ */
4646
+ readonly replyToId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
4647
+ }, undefined>, undefined>, v.MaxLengthAction<{
4648
+ id: string;
4649
+ state?: "open" | "resolved" | undefined;
4650
+ passage?: {
4651
+ quote: string;
4652
+ status: "located" | "changed" | "orphaned";
4653
+ lines: {
4654
+ start: number;
4655
+ end: number;
4656
+ } | null;
4657
+ } | undefined;
4658
+ body: string;
4659
+ suggestion?: string | undefined;
4660
+ finding?: {
4661
+ tier: "observed" | "usage" | "practice";
4662
+ tierLine: string;
4663
+ blindSpot: string;
4664
+ prediction: string | null;
4665
+ } | undefined;
4666
+ approved?: boolean | undefined;
4667
+ authorName: string | null;
4668
+ createdAt: string;
4669
+ itemVersion: number;
4670
+ itemChangedSince: boolean;
4671
+ deliveredCount: number;
4672
+ threadId: string;
4673
+ replyToId: string | null;
4674
+ }[], 20, undefined>]>, undefined>;
4675
+ readonly updatedAt: v.StringSchema<undefined>;
4676
+ }, undefined>;
4677
+ }, undefined>;
4678
+ export declare const UpdateArtifactResponseSchema: v.ObjectSchema<{
4679
+ readonly artifact: v.ObjectSchema<{
4680
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4681
+ readonly name: v.StringSchema<undefined>;
4682
+ readonly role: v.PicklistSchema<["guidance", "criteria", "content"], undefined>;
4683
+ readonly format: v.PicklistSchema<["markdown", "html", "binary", "code"], undefined>;
4684
+ /** Monotonic content version; echo it back as `expectedVersion` to update. */
4685
+ readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4686
+ readonly state: v.PicklistSchema<["live", "archived", "removed"], undefined>;
4687
+ readonly workspaceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4688
+ /** True for a deliberate capture (Inbox). Not derivable from filing state. */
4689
+ readonly capture: v.BooleanSchema<undefined>;
4690
+ /** Null for binary content, which is not served inline. */
4691
+ readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
4692
+ readonly origin: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3505
4693
  readonly root: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["project", "global"], undefined>, undefined>, undefined>;
3506
4694
  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>;
3507
4695
  readonly projectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3508
- /**
3509
- * The repo a **document's** declared `path` is placed in — its home — as the
3510
- * `project.id` of the checkout that last set the path. Documents only.
3511
- *
3512
- * Deliberately not `projectId` above: a reader takes a mismatch there as "this
3513
- * item belongs to another repo, do not materialize it", so a home echoed on it
3514
- * would stop every other subscriber receiving the document at all. A home says
3515
- * only *where* the path is literal. Only the repo whose `project.id` matches
3516
- * writes the document at `path`; every other repo mirrors it under the
3517
- * bundle folder (`bundleMirrorPath` in `@mossbear/projections`).
3518
- *
3519
- * Absent and null read the same — **no home**, so no repo takes the path
3520
- * literally for a new placement. A server predating the field says the same,
3521
- * which is the safe direction: the file lands inside the bundle folder
3522
- * instead of at a repo path it may not belong in.
3523
- */
3524
4696
  readonly pathProjectId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3525
4697
  readonly aliases: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
3526
4698
  readonly root: v.PicklistSchema<["project", "global"], undefined>;
@@ -3529,17 +4701,24 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
3529
4701
  root: "project" | "global";
3530
4702
  path: string;
3531
4703
  }[], 8, undefined>]>, undefined>;
3532
- /**
3533
- * Open comments a person left about this item, newest first.
3534
- *
3535
- * Optional, and absent rather than empty when there are none — the same rule
3536
- * `aliases` and `projectId` follow above, and for the same reason: an older
3537
- * reader against a newer server ignores the key, and a newer reader against
3538
- * an older server reads "no comments" instead of failing.
3539
- *
3540
- * **Absence is not a verdict.** No comments here means none were served on this
3541
- * item in this response — not that nobody has anything to say about it.
3542
- */
4704
+ /** Present iff git owns this artifact. */
4705
+ readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
4706
+ /**
4707
+ * The committed `project.id` of the source repository — the same id space as
4708
+ * an item's delivery-scoping `projectId` below, but a different fact: that one
4709
+ * says which repo an item is materialized into and is stamped onto
4710
+ * Mossbear-owned rows too, this one says who may edit it.
4711
+ */
4712
+ readonly projectId: 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">]>;
4713
+ readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
4714
+ /**
4715
+ * The branch the publishing commit was on. **The one optional member**:
4716
+ * publication is not restricted by branch, so this is recorded so a subscriber
4717
+ * can see what they got, and a detached HEAD has none to record.
4718
+ */
4719
+ readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
4720
+ }, undefined>, undefined>, undefined>;
4721
+ /** Absent, not empty, when there are none. Absence is not a verdict. */
3543
4722
  readonly comments: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
3544
4723
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
3545
4724
  readonly state: v.OptionalSchema<v.PicklistSchema<["open", "resolved"], undefined>, undefined>;
@@ -3652,149 +4831,47 @@ export declare const ArchiveContextItemResponseSchema: v.ObjectSchema<{
3652
4831
  replyToId: string | null;
3653
4832
  }[], 20, undefined>]>, undefined>;
3654
4833
  readonly updatedAt: v.StringSchema<undefined>;
3655
- /**
3656
- * Present iff this artifact is owned by git. Absent means Mossbear owns it
3657
- * and it is editable in the dashboard.
3658
- *
3659
- * **Optional, and absence is not yet a verdict.** Nothing writes this before
3660
- * `publish` ships, so today every item omits it, and the existing bundle-home
3661
- * rule — a bundle may name one repo as its only writer, and the server
3662
- * refuses every other writer by name — is what still protects items a repo
3663
- * already owns. A reader must not treat an absent `gitSource` as permission
3664
- * to publish back.
3665
- *
3666
- * **Optional *and* nullable, like every other late-added column on this item.**
3667
- * A serializer that maps the columns straight through emits `null` for a
3668
- * Mossbear-owned row, and a key that only accepted `undefined` would throw on
3669
- * the whole response rather than on the one item — `parseContextItemsResponse`
3670
- * parses a pull as a batch. Both spellings read the same way: no git source.
3671
- *
3672
- * **`path` is the third required member of the subset and is not re-checked
3673
- * here.** The database holds that invariant
3674
- * (`guide_files_git_source_subset`), and a wire rule that looked identical
3675
- * would in fact be stricter: `path` is serialized through a scope helper that
3676
- * emits `null` for a path this schema cannot parse, so a single such row would
3677
- * fail every other item in the same pull. A git-owned item that arrives
3678
- * without a usable path is a broken item, not a broken response.
3679
- */
3680
- readonly gitSource: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
3681
- /**
3682
- * The committed `project.id` of the source repository — the same id space as
3683
- * an item's delivery-scoping `projectId` below, but a different fact: that one
3684
- * says which repo an item is materialized into and is stamped onto
3685
- * Mossbear-owned rows too, this one says who may edit it.
3686
- */
3687
- readonly projectId: 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">]>;
3688
- readonly commitSha: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>;
3689
- /**
3690
- * The branch the publishing commit was on. **The one optional member**:
3691
- * publication is not restricted by branch, so this is recorded so a subscriber
3692
- * can see what they got, and a detached HEAD has none to record.
3693
- */
3694
- readonly branch: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
3695
- }, undefined>, undefined>, undefined>;
3696
- /**
3697
- * This artifact is a **tombstone**: the repository that publishes it deleted
3698
- * the file, so what the item still carries is the last revision rather than a
3699
- * current one (`artifact-ownership-and-delivery-plan.md` → D28).
3700
- *
3701
- * **It is still delivered, and that is deliberate.** Dropping the item from
3702
- * the response would say the same thing more quietly and cost two things
3703
- * worth more than the byte: the publishing repo would lose the id it needs to
3704
- * republish the path in place — re-adding a deleted file would create a
3705
- * second artifact at the same path rather than a new revision of the one
3706
- * that is there — and a reader would be left unable to tell a removal from
3707
- * a bundle it has stopped being able to see. What the flag asks of a client
3708
- * is one thing: do not materialize it. A file left at a discovery root keeps
3709
- * feeding deleted guidance into every agent that reads that repo, which is
3710
- * the failure the decision exists to stop.
3711
- *
3712
- * **Optional, and absent means an ordinary artifact.** A client that has
3713
- * never heard of it behaves as it always did — it keeps the last published
3714
- * revision on disk, which is the retain behaviour this replaces rather than a
3715
- * new failure. That is what makes the server safe to ship first.
3716
- *
3717
- * `literal(true)` rather than a boolean: `removed: false` would be a second
3718
- * spelling of absence, and an artifact that came back is content again rather
3719
- * than a tombstone that says no.
3720
- */
3721
- readonly removed: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
3722
- }, undefined>;
3723
- }, undefined>;
3724
- export declare const CaptureIdSchema: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 8, "id must be at least 8 characters">, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must contain only letters, digits, underscore, dot or hyphen">]>;
3725
- export declare const InboxCaptureRequestSchema: v.ObjectSchema<{
3726
- /**
3727
- * Optional, and it stays optional.
3728
- *
3729
- * This is a token-authenticated `v1` endpoint, so its callers are not only
3730
- * the ones in this repo — adding a *required* field to it breaks every
3731
- * external one for a field only the offline outbox needs. A caller that
3732
- * sends an id is asking for idempotency; a caller that does not is asking
3733
- * for a new note every time, which is the behaviour it already has.
3734
- *
3735
- * (An earlier version of this comment claimed the CLI and MCP server were
3736
- * among those callers. They are not: both only read the inbox and archive
3737
- * from it. The one in-repo caller is the dashboard composer.)
3738
- */
3739
- readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 8, "id must be at least 8 characters">, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "id must contain only letters, digits, underscore, dot or hyphen">]>, undefined>;
3740
- readonly bundleId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3741
- readonly contentType: v.PicklistSchema<("content" | "asset")[], undefined>;
3742
- readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "content must be at most 262144 bytes">]>;
3743
- readonly name: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>, undefined>;
3744
- readonly source: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3745
- }, undefined>;
3746
- export declare const InboxItemSchema: v.ObjectSchema<{
3747
- readonly id: v.StringSchema<undefined>;
3748
- readonly type: v.PicklistSchema<string[], undefined>;
3749
- readonly name: v.StringSchema<undefined>;
3750
- /** The stored pair, as {@link ContextItemSchema} carries it. */
3751
- readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3752
- readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3753
- readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3754
- readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3755
- readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3756
- readonly capturedAt: v.StringSchema<undefined>;
3757
- readonly updatedAt: v.StringSchema<undefined>;
3758
- }, undefined>;
3759
- export declare const InboxCaptureResponseSchema: v.ObjectSchema<{
3760
- readonly item: v.ObjectSchema<{
3761
- readonly id: v.StringSchema<undefined>;
3762
- readonly type: v.PicklistSchema<string[], undefined>;
3763
- readonly name: v.StringSchema<undefined>;
3764
- /** The stored pair, as {@link ContextItemSchema} carries it. */
3765
- readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3766
- readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3767
- readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3768
- readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3769
- readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3770
- readonly capturedAt: v.StringSchema<undefined>;
3771
- readonly updatedAt: v.StringSchema<undefined>;
3772
4834
  }, undefined>;
3773
4835
  }, undefined>;
3774
- export declare const InboxListResponseSchema: v.ObjectSchema<{
3775
- readonly items: v.ArraySchema<v.ObjectSchema<{
3776
- readonly id: v.StringSchema<undefined>;
3777
- readonly type: v.PicklistSchema<string[], undefined>;
3778
- readonly name: v.StringSchema<undefined>;
3779
- /** The stored pair, as {@link ContextItemSchema} carries it. */
3780
- readonly role: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3781
- readonly format: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3782
- readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3783
- readonly source: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
3784
- readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
3785
- readonly capturedAt: v.StringSchema<undefined>;
3786
- readonly updatedAt: v.StringSchema<undefined>;
3787
- }, undefined>, undefined>;
3788
- }, undefined>;
3789
- /** Max number of ids accepted in a single `POST /api/v1/context/inbox/archive` request. */
3790
- export declare const MAX_INBOX_ARCHIVE_BATCH = 500;
3791
- export declare const InboxArchiveRequestSchema: v.ObjectSchema<{
3792
- 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>]>;
3793
- }, undefined>;
3794
- export declare const InboxArchiveResponseSchema: v.ObjectSchema<{
3795
- readonly archived: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3796
- }, undefined>;
3797
- export declare const ContextItemVersionSchema: v.ObjectSchema<{
4836
+ /**
4837
+ * A saved revision: the shared version summary plus the sources it was derived
4838
+ * from, when any were recorded.
4839
+ */
4840
+ export declare const ArtifactRevisionSchema: v.ObjectSchema<{
4841
+ readonly sources: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4842
+ readonly basis: v.PicklistSchema<["verified", "asserted"], undefined>;
4843
+ readonly artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4844
+ readonly version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4845
+ readonly contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4846
+ readonly passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4847
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4848
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4849
+ }, undefined>, v.CheckAction<{
4850
+ start: number;
4851
+ end: number;
4852
+ }, "passage end must be greater than start">]>, undefined>;
4853
+ readonly gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
4854
+ }, undefined>, v.CheckAction<{
4855
+ basis: "verified" | "asserted";
4856
+ artifactId: string;
4857
+ version?: number | undefined;
4858
+ contentHash?: string | undefined;
4859
+ passage?: {
4860
+ start: number;
4861
+ end: number;
4862
+ } | undefined;
4863
+ gitCommit?: string | undefined;
4864
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
4865
+ basis: "verified" | "asserted";
4866
+ artifactId: string;
4867
+ version?: number | undefined;
4868
+ contentHash?: string | undefined;
4869
+ passage?: {
4870
+ start: number;
4871
+ end: number;
4872
+ } | undefined;
4873
+ gitCommit?: string | undefined;
4874
+ }[], 50, undefined>]>, undefined>;
3798
4875
  readonly id: v.StringSchema<undefined>;
3799
4876
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3800
4877
  readonly contentHash: v.StringSchema<undefined>;
@@ -3802,7 +4879,41 @@ export declare const ContextItemVersionSchema: v.ObjectSchema<{
3802
4879
  readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3803
4880
  readonly createdAt: v.StringSchema<undefined>;
3804
4881
  }, undefined>;
3805
- export declare const ContextItemVersionDetailSchema: v.ObjectSchema<{
4882
+ export declare const ArtifactRevisionDetailSchema: v.ObjectSchema<{
4883
+ readonly sources: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4884
+ readonly basis: v.PicklistSchema<["verified", "asserted"], undefined>;
4885
+ readonly artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4886
+ readonly version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4887
+ readonly contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4888
+ readonly passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4889
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4890
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4891
+ }, undefined>, v.CheckAction<{
4892
+ start: number;
4893
+ end: number;
4894
+ }, "passage end must be greater than start">]>, undefined>;
4895
+ readonly gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
4896
+ }, undefined>, v.CheckAction<{
4897
+ basis: "verified" | "asserted";
4898
+ artifactId: string;
4899
+ version?: number | undefined;
4900
+ contentHash?: string | undefined;
4901
+ passage?: {
4902
+ start: number;
4903
+ end: number;
4904
+ } | undefined;
4905
+ gitCommit?: string | undefined;
4906
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
4907
+ basis: "verified" | "asserted";
4908
+ artifactId: string;
4909
+ version?: number | undefined;
4910
+ contentHash?: string | undefined;
4911
+ passage?: {
4912
+ start: number;
4913
+ end: number;
4914
+ } | undefined;
4915
+ gitCommit?: string | undefined;
4916
+ }[], 50, undefined>]>, undefined>;
3806
4917
  readonly id: v.StringSchema<undefined>;
3807
4918
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3808
4919
  readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
@@ -3811,8 +4922,43 @@ export declare const ContextItemVersionDetailSchema: v.ObjectSchema<{
3811
4922
  readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3812
4923
  readonly createdAt: v.StringSchema<undefined>;
3813
4924
  }, undefined>;
3814
- export declare const ContextItemVersionsResponseSchema: v.ObjectSchema<{
4925
+ /** Newest-first page of saved revisions; `nextCursor` as in the older history. */
4926
+ export declare const ArtifactHistoryResponseSchema: v.ObjectSchema<{
3815
4927
  readonly versions: v.ArraySchema<v.ObjectSchema<{
4928
+ readonly sources: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4929
+ readonly basis: v.PicklistSchema<["verified", "asserted"], undefined>;
4930
+ readonly artifactId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4931
+ readonly version: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 2147483647, undefined>]>, undefined>;
4932
+ readonly contentHash: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
4933
+ readonly passage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
4934
+ readonly start: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
4935
+ readonly end: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4936
+ }, undefined>, v.CheckAction<{
4937
+ start: number;
4938
+ end: number;
4939
+ }, "passage end must be greater than start">]>, undefined>;
4940
+ readonly gitCommit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "commitSha must be 40 or 64 lowercase hex characters">]>, undefined>;
4941
+ }, undefined>, v.CheckAction<{
4942
+ basis: "verified" | "asserted";
4943
+ artifactId: string;
4944
+ version?: number | undefined;
4945
+ contentHash?: string | undefined;
4946
+ passage?: {
4947
+ start: number;
4948
+ end: number;
4949
+ } | undefined;
4950
+ gitCommit?: string | undefined;
4951
+ }, "a passage requires version: it selects bytes of a pinned revision">]>, undefined>, v.MaxLengthAction<{
4952
+ basis: "verified" | "asserted";
4953
+ artifactId: string;
4954
+ version?: number | undefined;
4955
+ contentHash?: string | undefined;
4956
+ passage?: {
4957
+ start: number;
4958
+ end: number;
4959
+ } | undefined;
4960
+ gitCommit?: string | undefined;
4961
+ }[], 50, undefined>]>, undefined>;
3816
4962
  readonly id: v.StringSchema<undefined>;
3817
4963
  readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3818
4964
  readonly contentHash: v.StringSchema<undefined>;
@@ -3822,20 +4968,18 @@ export declare const ContextItemVersionsResponseSchema: v.ObjectSchema<{
3822
4968
  }, undefined>, undefined>;
3823
4969
  readonly nextCursor: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
3824
4970
  }, undefined>;
3825
- export declare const ContextItemVersionResponseSchema: v.ObjectSchema<{
3826
- readonly version: v.ObjectSchema<{
3827
- readonly id: v.StringSchema<undefined>;
3828
- readonly version: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
3829
- readonly content: v.NullableSchema<v.StringSchema<undefined>, undefined>;
3830
- readonly contentHash: v.StringSchema<undefined>;
3831
- readonly authorType: v.StringSchema<undefined>;
3832
- readonly metadata: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, undefined>;
3833
- readonly createdAt: v.StringSchema<undefined>;
3834
- }, undefined>;
4971
+ /**
4972
+ * The one refused-stale-write shape, for a direct update and a bundle-scoped one
4973
+ * alike. The `code` is what separates a retryable conflict from the other 409s
4974
+ * (a read-only artifact is permanent). Nothing was written.
4975
+ */
4976
+ export declare const ArtifactVersionConflictSchema: v.ObjectSchema<{
4977
+ readonly error: v.StringSchema<undefined>;
4978
+ readonly code: v.LiteralSchema<"version-conflict", undefined>;
4979
+ readonly currentVersion: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4980
+ readonly expectedVersion: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
4981
+ readonly requestId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3835
4982
  }, undefined>;
3836
- /** Default and max page size for the version-history list endpoint. */
3837
- export declare const DEFAULT_VERSIONS_LIMIT = 50;
3838
- export declare const MAX_VERSIONS_LIMIT = 200;
3839
4983
  export declare const ProposalCitationSchema: v.ObjectSchema<{
3840
4984
  readonly agentSessionId: v.StringSchema<undefined>;
3841
4985
  readonly timestamp: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -6785,6 +7929,7 @@ export declare function parseDeleteBundleResponse(data: unknown): {
6785
7929
  };
6786
7930
  export declare function parseContextItem(data: unknown): {
6787
7931
  id: string;
7932
+ artifactId?: string | null | undefined;
6788
7933
  type: string;
6789
7934
  name: string;
6790
7935
  role: string | null;
@@ -6840,6 +7985,7 @@ export declare function parseContextItem(data: unknown): {
6840
7985
  export declare function parseContextItemsResponse(data: unknown): {
6841
7986
  items: {
6842
7987
  id: string;
7988
+ artifactId?: string | null | undefined;
6843
7989
  type: string;
6844
7990
  name: string;
6845
7991
  role: string | null;
@@ -6917,6 +8063,7 @@ export declare function parsePushContextRequest(data: unknown): {
6917
8063
  export declare function parsePushContextResponse(data: unknown): {
6918
8064
  item: {
6919
8065
  id: string;
8066
+ artifactId?: string | null | undefined;
6920
8067
  type: string;
6921
8068
  name: string;
6922
8069
  role: string | null;
@@ -6989,6 +8136,7 @@ export declare function parseUpdateContextItemRequest(data: unknown): {
6989
8136
  export declare function parseUpdateContextItemResponse(data: unknown): {
6990
8137
  item: {
6991
8138
  id: string;
8139
+ artifactId?: string | null | undefined;
6992
8140
  type: string;
6993
8141
  name: string;
6994
8142
  role: string | null;
@@ -7044,11 +8192,11 @@ export declare function parseUpdateContextItemResponse(data: unknown): {
7044
8192
  updated: boolean;
7045
8193
  };
7046
8194
  export declare function parseUpdateContextItemBody(data: unknown): {
7047
- name?: string | undefined;
7048
8195
  content?: string | undefined;
7049
8196
  path?: string | null | undefined;
7050
8197
  expectedVersion?: number | undefined;
7051
8198
  projectId?: string | undefined;
8199
+ name?: string | undefined;
7052
8200
  gitSource?: {
7053
8201
  projectId: string;
7054
8202
  commitSha: string;
@@ -7060,6 +8208,7 @@ export declare function parseUpdateContextItemBody(data: unknown): {
7060
8208
  export declare function parseContextItemResponse(data: unknown): {
7061
8209
  item: {
7062
8210
  id: string;
8211
+ artifactId?: string | null | undefined;
7063
8212
  type: string;
7064
8213
  name: string;
7065
8214
  role: string | null;
@@ -7117,6 +8266,7 @@ export declare function parseArchiveContextItemResponse(data: unknown): {
7117
8266
  archived: boolean;
7118
8267
  item: {
7119
8268
  id: string;
8269
+ artifactId?: string | null | undefined;
7120
8270
  type: string;
7121
8271
  name: string;
7122
8272
  role: string | null;
@@ -7441,7 +8591,7 @@ export declare function parseGuideHistoryResponse(data: unknown): {
7441
8591
  oldestAt: string | null;
7442
8592
  };
7443
8593
  alignmentRateDelta: number | null;
7444
- suppressedBy: "since" | "before" | "both" | null;
8594
+ suppressedBy: "before" | "since" | "both" | null;
7445
8595
  direction: "improved" | "regressed" | "unchanged" | null;
7446
8596
  isWindowed: boolean;
7447
8597
  windowSize: number;