@paigy/mcp 0.40.37 → 0.40.39

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.
@@ -1,5 +1,5 @@
1
1
  // ../../packages/schema/dist/index.js
2
- import { z as z12 } from "zod";
2
+ import { z as z11 } from "zod";
3
3
  import { z } from "zod";
4
4
  import { z as z3 } from "zod";
5
5
  import { z as z2 } from "zod";
@@ -16,7 +16,6 @@ import { z as z9 } from "zod";
16
16
  import { zodToJsonSchema as zodToJsonSchema5 } from "zod-to-json-schema";
17
17
  import { z as z10 } from "zod";
18
18
  import { zodToJsonSchema as zodToJsonSchema6 } from "zod-to-json-schema";
19
- import { z as z11 } from "zod";
20
19
  var OPTIONS_MIN = 2;
21
20
  var OPTIONS_MAX = 6;
22
21
  var OPTION_LABEL_MAX = 50;
@@ -518,11 +517,17 @@ var messageBase = {
518
517
  obligationIds: z6.array(id)
519
518
  };
520
519
  var BrainMessageSchema = z6.union([
521
- z6.object({ ...messageBase, to: z6.object({ kind: z6.literal("user") }).strict() }).strict(),
520
+ // A MESSAGE TO THE PERSON KEEPS ITS SENTENCES (turns.md): the talker writes them one by one, and each is
521
+ // its own unit of speech (`<cycle>:<key>:<n>`). `text` is the same words joined, for every reader of a
522
+ // message's words. Absent on results written before sentences.
523
+ z6.object({ ...messageBase, to: z6.object({ kind: z6.literal("user") }).strict(), sentences: z6.array(z6.string().min(1)).min(1).optional() }).strict(),
522
524
  z6.object({
523
525
  ...messageBase,
524
526
  to: z6.object({ kind: z6.literal("agent"), agentId: z6.string().regex(/^agent:(?!paigy$)\S+$/) }).strict(),
525
- call: z6.object({ callId: id, listen: z6.literal(true) }).strict().optional()
527
+ call: z6.object({ callId: id, listen: z6.literal(true) }).strict().optional(),
528
+ // THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
529
+ // the call, and its next contact about it rings them (`public.callbacks`).
530
+ callback: z6.literal(true).optional()
526
531
  }).strict()
527
532
  ]);
528
533
  var BrainSearchSchema = z6.object({
@@ -577,9 +582,12 @@ var str2 = z7.string();
577
582
  var strs2 = z7.array(z7.string());
578
583
  var TalkerReplySchema = z7.object({
579
584
  /** What to say and send, messages to the person first: spoken in the order written. `to` is "user"
580
- * or an agent's handle; `about` names handles; `blocks` is the item a question to an agent must be
581
- * answered before ("" for none). */
582
- messages: z7.array(z7.object({ key: str2, to: str2, text: str2, about: strs2, blocks: str2 }).strict()),
585
+ * or an agent's handle; `sentences` is what a message to the person says, one short sentence each
586
+ * ([] to an agent); `text` is what a message to an agent says ("" to the person); `about` names
587
+ * handles; `blocks` is the item a question to an agent must be answered before ("" for none);
588
+ * `callback` is true on a message to the agent doing work the person asked to be called back about
589
+ * once it is done (false otherwise): that agent then owes the call (turns.md, step 0). */
590
+ messages: z7.array(z7.object({ key: str2, to: str2, sentences: strs2, text: str2, about: strs2, blocks: str2, callback: z7.boolean() }).strict()),
583
591
  /** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
584
592
  then: z7.enum(["listen", "hold", "end"]),
585
593
  /** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
@@ -720,56 +728,20 @@ var LIVE_MS = 3 * 6e4;
720
728
  var WORKING_MS = 60 * 6e4;
721
729
  var WORKING_TIER_MS = 2 * 60 * 6e4;
722
730
  var RECENT_TIER_MS = 24 * 60 * 6e4;
723
- var json = z11.lazy(() => z11.union([
724
- z11.string(),
725
- z11.number().finite(),
726
- z11.boolean(),
727
- z11.null(),
728
- z11.array(json),
729
- z11.record(json)
730
- ]));
731
- var clock = z11.number().int().nonnegative().safe();
732
- var HeardEventSchema = z11.object({
733
- eventId: z11.string().uuid(),
734
- source: z11.enum(["phone", "bot"]),
735
- sequence: clock,
736
- kind: z11.string().min(1),
737
- phoneAtMs: clock.optional(),
738
- botAtMs: clock.optional(),
739
- payload: z11.record(json)
740
- }).strict();
741
- var HeardCursorSchema = HeardEventSchema.pick({ source: true, sequence: true, eventId: true });
742
- var HeardPageSchema = z11.object({
743
- events: z11.array(HeardEventSchema).max(200),
744
- next: HeardCursorSchema.nullable()
745
- }).strict();
746
- var MAX_EVENTS = 50;
747
- var MAX_BYTES = 8e4;
748
- var batchBytes = (events) => {
749
- let bytes = 0;
750
- for (const char of JSON.stringify({ events })) {
751
- const point = char.codePointAt(0);
752
- bytes += point < 128 ? 1 : point < 2048 ? 2 : point < 65536 ? 3 : 4;
753
- }
754
- return bytes;
755
- };
756
- var HeardBatchSchema = z11.object({
757
- events: z11.array(HeardEventSchema).min(1).max(MAX_EVENTS)
758
- }).strict().refine((value) => batchBytes(value.events) <= MAX_BYTES, "heard_batch_too_large");
759
- var ContextSchema = z12.object({
760
- title: z12.string().min(1).describe("One-line headline of what you need (required, non-empty)."),
761
- description: z12.array(z12.string().min(1)).describe(
731
+ var ContextSchema = z11.object({
732
+ title: z11.string().min(1).describe("One-line headline of what you need (required, non-empty)."),
733
+ description: z11.array(z11.string().min(1)).describe(
762
734
  "Semantic chunks of detail (each a standalone, non-empty piece). The user can select chunks to ask you to expand. MAY BE EMPTY: a claim whose whole content is its heading \u2014 a single sentence \u2014 has no body, and saying so beats repeating the heading underneath itself. That repeat is what `min(1)` used to force, at 2x the storage, with every reader subtracting it back out at render time."
763
735
  ),
764
736
  /** THE ASK'S UNITS (3c): its context as titled units, in order. The app lists the titles and opens
765
737
  * a body on a tap. Absent on an ask sent without units, which renders as before. */
766
- units: z12.array(z12.object({ title: z12.string(), body: z12.string() })).optional()
738
+ units: z11.array(z11.object({ title: z11.string(), body: z11.string() })).optional()
767
739
  });
768
- var ParticipantSchema = z12.object({
769
- kind: z12.enum(["human", "agent"]),
770
- id: z12.string()
740
+ var ParticipantSchema = z11.object({
741
+ kind: z11.enum(["human", "agent"]),
742
+ id: z11.string()
771
743
  });
772
- var TransformSchema = z12.enum([
744
+ var TransformSchema = z11.enum([
773
745
  "structure",
774
746
  // shape intent into an answer contract; pick channel/urgency — broker `ask`, `select` shapes, `points`
775
747
  "request_more",
@@ -785,13 +757,13 @@ var TransformSchema = z12.enum([
785
757
  "summarize"
786
758
  // reduce volume, keep decision value — 30-turn cap, spoken briefing
787
759
  ]);
788
- var VisualSchema = z12.object({
789
- url: z12.string().url(),
790
- label: z12.string().optional()
760
+ var VisualSchema = z11.object({
761
+ url: z11.string().url(),
762
+ label: z11.string().optional()
791
763
  });
792
- var NotifyLevelSchema = z12.enum(["inbox", "push", "banner", "call"]);
793
- var SelectShapeSchema = z12.enum(["one", "many", "rank", "confirm", "text"]);
794
- var ReceiptEventSchema = z12.enum([
764
+ var NotifyLevelSchema = z11.enum(["inbox", "push", "banner", "call"]);
765
+ var SelectShapeSchema = z11.enum(["one", "many", "rank", "confirm", "text"]);
766
+ var ReceiptEventSchema = z11.enum([
795
767
  "delivered",
796
768
  // the bundle reached the recipient at some level
797
769
  "seen",
@@ -821,47 +793,47 @@ var ReceiptEventSchema = z12.enum([
821
793
  // be rewound by a writer that forgot to advance it.
822
794
  "restarted"
823
795
  ]);
824
- var AttentionSchema = z12.object({
796
+ var AttentionSchema = z11.object({
825
797
  urgency: NotifyLevelSchema,
826
798
  /** The required answer shape, or null for a plain notify that asks nothing back. */
827
799
  select: SelectShapeSchema.nullable(),
828
800
  /** Coverage contract (#396) — points the answer must address; null = none declared. */
829
- points: z12.array(z12.string()).nullable(),
801
+ points: z11.array(z11.string()).nullable(),
830
802
  /** Whether the ask blocks the sender — what lets arbitration escalate it on silence. */
831
- blocking: z12.boolean(),
803
+ blocking: z11.boolean(),
832
804
  /** Reserved (docs/model/model.md lists it): a response deadline. No row column yet — a later Phase 2
833
805
  * slice wires it; optional so today's rows/callers project cleanly. */
834
- deadline: z12.string().datetime().nullable().optional()
806
+ deadline: z11.string().datetime().nullable().optional()
835
807
  });
836
- var NotifyRequestFields = z12.object({
808
+ var NotifyRequestFields = z11.object({
837
809
  /** Plaintext message content. Present on the plaintext path (today's shape);
838
810
  * ABSENT on the E2EE path, where the sealed `envelope` below carries it. The
839
811
  * superRefine at the bottom enforces exactly one of the two. */
840
812
  context: ContextSchema.optional(),
841
- options: z12.array(OptionSchema.omit({ id: true }).extend({ label: z12.string().trim().min(1).max(1e3) }).strict()).min(OPTIONS_MIN).max(OPTIONS_MAX).optional().describe(
813
+ options: z11.array(OptionSchema.omit({ id: true }).extend({ label: z11.string().trim().min(1).max(1e3) }).strict()).min(OPTIONS_MIN).max(OPTIONS_MAX).optional().describe(
842
814
  "The choices, in order \u2014 required when select is 'one'/'many'/'rank', omitted otherwise. Ids are assigned automatically by position ('1', '2', \u2026); the user's answer references them as optionId(s)."
843
815
  ),
844
- points: z12.array(z12.string().min(1)).optional().describe(
816
+ points: z11.array(z11.string().min(1)).optional().describe(
845
817
  "The distinct things you need answered, each a short phrase \u2014 on a call the broker keeps the conversation going until each is addressed, and the reply reports which were covered, so a half-answer is never silently returned as final. Omit for single-part asks."
846
818
  ),
847
- visuals: z12.array(VisualSchema).optional().describe(
819
+ visuals: z11.array(VisualSchema).optional().describe(
848
820
  "Images attached to the message itself \u2014 context for the whole question (a screenshot, a chart). For a preview on one selectable choice, use that option's `html`/`image` instead."
849
821
  ),
850
822
  /** Git repo the agent is working in ("owner/name"). Local MCP fills this from the checkout — omit unless overriding. */
851
- repo: z12.string().optional(),
823
+ repo: z11.string().optional(),
852
824
  /** Git branch the agent is on. Local MCP fills this from the checkout — omit unless overriding. */
853
- branch: z12.string().optional(),
825
+ branch: z11.string().optional(),
854
826
  /** Continue an existing conversation — the id of any notification in it (its root
855
827
  * is the conversation's identity). Omitted = start a new conversation. Renamed
856
828
  * from `parentId` (2026-08-03): one linkage system, the parent; the API edge
857
829
  * still accepts the old name from older clients. */
858
- parentId: z12.string().uuid().optional(),
830
+ parentId: z11.string().uuid().optional(),
859
831
  /** The durable outcome this contact advances. Optional during the notification-to-Work
860
832
  * migration; when present, a blocking ask creates a DecisionNeed for this Work. */
861
- workId: z12.string().uuid().optional(),
833
+ workId: z11.string().uuid().optional(),
862
834
  /** Target Goal scope. During staged migration this is accepted by the shared contract but
863
835
  * target delivery activation remains model-gated; workId and goalId are mutually exclusive. */
864
- goalId: z12.string().uuid().optional(),
836
+ goalId: z11.string().uuid().optional(),
865
837
  urgency: NotifyLevelSchema.default("inbox").describe(
866
838
  "The level you're requesting \u2014 the user's account permissions + session mode can lower it. 'inbox' (default) = sits silently in the inbox for the user to get to. 'push' = a quiet passive push (lands in Notification Center, no sound) \u2014 a gentle heads-up. 'banner' = a time-sensitive banner/lock-screen push with sound (a 'paige') they tap to open \u2014 use when you need them soon-ish but it's not worth ringing them. 'call' = rings the user's phone now (a CallKit voice call) \u2014 use only when you genuinely need them in the moment (blocked and waiting, time-sensitive). context.title is what they see on the banner/ring, so make it specific."
867
839
  ),
@@ -869,7 +841,7 @@ var NotifyRequestFields = z12.object({
869
841
  * visible and marks it needs_input. Renamed from the old `parentId` (2026-08-03)
870
842
  * when `parentId` became the conversation handle: `parentId` says WHERE, this
871
843
  * says HOW. */
872
- clarifies: z12.string().optional(),
844
+ clarifies: z11.string().optional(),
873
845
  select: SelectShapeSchema.optional().describe(
874
846
  "How the user answers \u2014 required on the fully-shaped form, pick the shape that fits the question: 'one' = pick one option, 'many' = pick several, 'rank' = pick & order (each needs `options`); 'confirm' = yes/no or approve/deny; 'text' = free-form reply only (status updates, open questions). 'confirm' and 'text' take no options. Omit only when sending the simplified `ask` form \u2014 the broker picks the shape."
875
847
  ),
@@ -883,20 +855,20 @@ var NotifyRequestFields = z12.object({
883
855
  // (docs/brain/broker/agenda-design.md) — not by a wire cap the agent has to pre-summarize under.
884
856
  // Owner, 2026-07-28: "our actual limitation on how long something is to the user should
885
857
  // come from the broker splitting and summarizing." The cap that remains is a size guard.
886
- ask: z12.string().min(1).max(1e4).optional().describe(
858
+ ask: z11.string().min(1).max(1e4).optional().describe(
887
859
  'SIMPLIFIED FORM \u2014 state in plain prose what you need to learn from the user and why it matters now (e.g. "I need to know whether to deploy the auth fix \u2014 tests are green, staging verified"). Write as much as the situation needs (up to 10k characters) \u2014 Paigy breaks it into topics and reads it back a few sentences at a time; do NOT pre-summarize it into one line. Paigy derives the title, answer shape, options, and delivery channel for you. Mutually exclusive with context/select/options \u2014 send one form or the other.'
888
860
  ),
889
- needs: z12.array(z12.string().min(1)).optional().describe(
861
+ needs: z11.array(z11.string().min(1)).optional().describe(
890
862
  "With `ask` only: the distinct things you need answered when the ask is multi-part \u2014 becomes the coverage contract (`points`), so a half-answer is never silently final."
891
863
  ),
892
- urgencyHint: z12.enum(["whenever", "soon", "now"]).optional().describe(
864
+ urgencyHint: z11.enum(["whenever", "soon", "now"]).optional().describe(
893
865
  "With `ask` only: how urgently you need the answer \u2014 'whenever' (inbox), 'soon' (worth a heads-up), 'now' (you're blocked this minute). A hint, not a command: the user's settings still have the final word."
894
866
  ),
895
867
  /** #575: the ONE self-report that replaces urgencyHint + blocking — what happens
896
868
  * to the agent's work while it waits. Normalized server-side into those two
897
869
  * fields (normalizeWaiting) so everything downstream is untouched; explicit
898
870
  * urgencyHint/blocking win when both are sent. */
899
- waiting: z12.enum(["none", "soft", "hard"]).optional().describe(
871
+ waiting: z11.enum(["none", "soft", "hard"]).optional().describe(
900
872
  "With `ask`: what happens to your work while you wait. 'none' = you're just informing the user. 'soft' = you'd like an answer but can keep working. 'hard' = you are stopped until they answer (reaches them urgently and escalates to a real phone call if unanswered). Replaces urgencyHint + blocking \u2014 send this one field."
901
873
  ),
902
874
  /** Δ9b (#895): HOLD this claim so the sender can correct the plan before anyone is
@@ -904,98 +876,98 @@ var NotifyRequestFields = z12.object({
904
876
  * holding by default would charge every quiet claim that minute before any agent could
905
877
  * correct anything. Ignored for `waiting: 'hard'`: a blocking ask rings on what we have,
906
878
  * and the enrichment can still land mid-call (#781 re-plans the unspoken tail). */
907
- confirm: z12.boolean().optional().describe(
879
+ confirm: z11.boolean().optional().describe(
908
880
  "Hold this one so you can correct the plan before the user is interrupted. The response comes back with `held: true` and the plan; POST the confirm route to release it (with options/visuals/urgency corrections, or nothing at all). If you never do, it is announced anyway a couple of minutes later. Ignored when waiting is 'hard'."
909
881
  ),
910
882
  /** #575: a RELAY of the user's explicitly stated preference, never the agent's
911
883
  * choice. Outranks waiting in both directions: 'call' rings even for a
912
884
  * waiting:'none' "call me when it's done"; 'message' never rings even for
913
885
  * waiting:'hard'. */
914
- channel: z12.enum(["call", "message"]).optional().describe(
886
+ channel: z11.enum(["call", "message"]).optional().describe(
915
887
  "Only if the user explicitly said how to reach them \u2014 'call me' \u2192 'call', 'just message/text me' \u2192 'message'. Omit otherwise; Paigy picks."
916
888
  ),
917
- confirmStyle: z12.enum(["yesno", "approve"]).default("yesno").describe(
889
+ confirmStyle: z11.enum(["yesno", "approve"]).default("yesno").describe(
918
890
  "Labels for a select:'confirm' paige \u2014 'yesno' (Yes/No) or 'approve' (Approve/Deny). Ignored unless select is 'confirm'."
919
891
  ),
920
- blocking: z12.boolean().default(false).describe(
892
+ blocking: z11.boolean().default(false).describe(
921
893
  "Set true when real downstream work is stuck behind this specific decision \u2014 you can't make meaningful progress until it's answered. This is the real signal for how urgently the user should be reached; it's what the premier use case (an agent that stays unblocked instead of going idle) depends on. Independent of `urgency`: a `banner`-level question can still be `blocking` (something IS stuck, just not time-critical enough to ring for immediately) \u2014 if it goes unanswered a while, Paigy escalates it to a real call using this flag rather than guessing from how many other things happen to be pending. Leave false for anything you could work around, defer, or where other useful work exists meanwhile."
922
894
  )
923
895
  });
924
896
  var NotifyRequestSchema = NotifyRequestFields.superRefine((r, ctx) => {
925
- if (r.workId && r.goalId) ctx.addIssue({ code: z12.ZodIssueCode.custom, path: ["goalId"], message: "pass goalId or workId, not both" });
897
+ if (r.workId && r.goalId) ctx.addIssue({ code: z11.ZodIssueCode.custom, path: ["goalId"], message: "pass goalId or workId, not both" });
926
898
  if (r.ask !== void 0) {
927
899
  for (const f of ["context", "select", "points"]) {
928
900
  if (r[f] !== void 0)
929
- ctx.addIssue({ code: z12.ZodIssueCode.custom, path: [f], message: `the simplified \`ask\` form takes no ${f} \u2014 the broker derives the answer shape from your prose. Drop ${f} and say it in \`ask\` instead ("should I\u2026" for approve/deny, "which of these\u2026" for a pick), passing \`options\` when you're offering concrete alternatives.` });
901
+ ctx.addIssue({ code: z11.ZodIssueCode.custom, path: [f], message: `the simplified \`ask\` form takes no ${f} \u2014 the broker derives the answer shape from your prose. Drop ${f} and say it in \`ask\` instead ("should I\u2026" for approve/deny, "which of these\u2026" for a pick), passing \`options\` when you're offering concrete alternatives.` });
930
902
  }
931
903
  return;
932
904
  }
933
905
  if (r.needs !== void 0 || r.urgencyHint !== void 0)
934
- ctx.addIssue({ code: z12.ZodIssueCode.custom, path: ["needs"], message: "needs/urgencyHint belong to the simplified `ask` form \u2014 with a shaped request use points/urgency" });
906
+ ctx.addIssue({ code: z11.ZodIssueCode.custom, path: ["needs"], message: "needs/urgencyHint belong to the simplified `ask` form \u2014 with a shaped request use points/urgency" });
935
907
  if (!r.context)
936
- ctx.addIssue({ code: z12.ZodIssueCode.custom, path: ["context"], message: "context is required (plaintext path)" });
908
+ ctx.addIssue({ code: z11.ZodIssueCode.custom, path: ["context"], message: "context is required (plaintext path)" });
937
909
  if (!r.select)
938
- ctx.addIssue({ code: z12.ZodIssueCode.custom, path: ["select"], message: "select is required on the shaped form" });
910
+ ctx.addIssue({ code: z11.ZodIssueCode.custom, path: ["select"], message: "select is required on the shaped form" });
939
911
  const needsOptions = r.select === "one" || r.select === "many" || r.select === "rank";
940
912
  if (needsOptions && !r.options?.length)
941
- ctx.addIssue({ code: z12.ZodIssueCode.custom, path: ["options"], message: `select:'${r.select}' requires options` });
913
+ ctx.addIssue({ code: z11.ZodIssueCode.custom, path: ["options"], message: `select:'${r.select}' requires options` });
942
914
  if (!needsOptions && r.options?.length)
943
- ctx.addIssue({ code: z12.ZodIssueCode.custom, path: ["options"], message: `select:'${r.select}' takes no options` });
915
+ ctx.addIssue({ code: z11.ZodIssueCode.custom, path: ["options"], message: `select:'${r.select}' takes no options` });
944
916
  });
945
- var NotifyStatusSchema = z12.enum(["pending", "answered", "ignored"]);
946
- var AgentStateSchema = z12.enum(["idle", "in_progress", "completed", "needs_input"]);
947
- var TurnSchema = z12.object({
948
- prompt: z12.string(),
949
- reply: z12.string()
917
+ var NotifyStatusSchema = z11.enum(["pending", "answered", "ignored"]);
918
+ var AgentStateSchema = z11.enum(["idle", "in_progress", "completed", "needs_input"]);
919
+ var TurnSchema = z11.object({
920
+ prompt: z11.string(),
921
+ reply: z11.string()
950
922
  });
951
- var UserAnswerSchema = z12.discriminatedUnion("kind", [
952
- z12.object({ kind: z12.literal("option"), optionId: z12.string(), label: z12.string().optional() }),
953
- z12.object({ kind: z12.literal("text"), text: z12.string() }),
954
- z12.object({ kind: z12.literal("ignored") }),
955
- z12.object({ kind: z12.literal("multi"), optionIds: z12.array(z12.string()), labels: z12.array(z12.string()).optional() }),
956
- z12.object({ kind: z12.literal("ranked"), optionIds: z12.array(z12.string()), labels: z12.array(z12.string()).optional() }),
957
- z12.object({ kind: z12.literal("clarify"), chunks: z12.array(z12.string()).min(1) }),
958
- z12.object({ kind: z12.literal("confirm"), approved: z12.boolean() }),
959
- z12.object({ kind: z12.literal("turns"), turns: z12.array(TurnSchema).min(1) }),
923
+ var UserAnswerSchema = z11.discriminatedUnion("kind", [
924
+ z11.object({ kind: z11.literal("option"), optionId: z11.string(), label: z11.string().optional() }),
925
+ z11.object({ kind: z11.literal("text"), text: z11.string() }),
926
+ z11.object({ kind: z11.literal("ignored") }),
927
+ z11.object({ kind: z11.literal("multi"), optionIds: z11.array(z11.string()), labels: z11.array(z11.string()).optional() }),
928
+ z11.object({ kind: z11.literal("ranked"), optionIds: z11.array(z11.string()), labels: z11.array(z11.string()).optional() }),
929
+ z11.object({ kind: z11.literal("clarify"), chunks: z11.array(z11.string()).min(1) }),
930
+ z11.object({ kind: z11.literal("confirm"), approved: z11.boolean() }),
931
+ z11.object({ kind: z11.literal("turns"), turns: z11.array(TurnSchema).min(1) }),
960
932
  /** An auto-answer derived from the user's PAST decisions (docs/brain/broker/precedent-design.md §2):
961
933
  * delivered through the same settle/await path as a human answer, carrying the judge's
962
934
  * derivation and the precedent ids it grew from. Always paired with a visible trail
963
935
  * card the user can reply to — the broker never overrides the user. */
964
- z12.object({ kind: z12.literal("precedent"), answer: z12.string(), derivation: z12.string(), sources: z12.array(z12.string()).min(1) })
936
+ z11.object({ kind: z11.literal("precedent"), answer: z11.string(), derivation: z11.string(), sources: z11.array(z11.string()).min(1) })
965
937
  ]);
966
- var IntentSchema = z12.object({
938
+ var IntentSchema = z11.object({
967
939
  // The full vocabulary the bot's mapper emits (mapper.INTENT_KINDS) — the schema lagged
968
940
  // it by two ("detail", "feedback"), and because the settle handler parsed the array
969
941
  // all-or-nothing, ONE feedback act silently dropped EVERY intent on the call,
970
942
  // questions included. Found auditing five calls' stored feedback, 2026-08-01.
971
- kind: z12.enum(["defer", "delegate", "channel", "question", "detail", "feedback", "command", "control"]),
972
- detail: z12.string(),
943
+ kind: z11.enum(["defer", "delegate", "channel", "question", "detail", "feedback", "command", "control"]),
944
+ detail: z11.string(),
973
945
  /** Defer only: seconds until the callback the caller asked for, when something upstream
974
946
  * already read the time. Nothing sets it today (#397 documented an MCP parser that was
975
947
  * never written) — the API reads the defer's `detail` itself with `notes/when.ts`
976
948
  * (`parseDelay`, #1292), and a value here simply wins over that reading. */
977
- dueInSeconds: z12.number().int().positive().optional(),
949
+ dueInSeconds: z11.number().int().positive().optional(),
978
950
  /** Feedback only (#812): WHICH failure the complaint names — typed by the mapper that
979
951
  * already read the utterance, so `signals.kind` stops defaulting to
980
952
  * 'other' on every row. A table that records that something was wrong and nothing
981
953
  * about what cannot answer "is the bot looping less this week?". */
982
- fault: z12.enum(["loop", "unanswered", "overridden", "misheard", "slow", "other"]).optional()
954
+ fault: z11.enum(["loop", "unanswered", "overridden", "misheard", "slow", "other"]).optional()
983
955
  });
984
- var RideAlongSchema = z12.object({
956
+ var RideAlongSchema = z11.object({
985
957
  /** The note this came from — assign/clarify/close it through /api/notes/:id. */
986
- noteId: z12.string(),
958
+ noteId: z11.string(),
987
959
  /** What to do, in the owner's own words (the note's headline). Never model-rewritten. */
988
- text: z12.string(),
960
+ text: z11.string(),
989
961
  /** The thread to report back on, when the note was dispatched over the request rail. */
990
- parentId: z12.string().nullable()
962
+ parentId: z11.string().nullable()
991
963
  });
992
- var AwaitItemSchema = z12.discriminatedUnion("type", [
993
- z12.object({
994
- type: z12.literal("reply"),
995
- parentId: z12.string(),
996
- notificationId: z12.string(),
997
- workId: z12.string().uuid().optional(),
998
- decisionId: z12.string().uuid().optional(),
964
+ var AwaitItemSchema = z11.discriminatedUnion("type", [
965
+ z11.object({
966
+ type: z11.literal("reply"),
967
+ parentId: z11.string(),
968
+ notificationId: z11.string(),
969
+ workId: z11.string().uuid().optional(),
970
+ decisionId: z11.string().uuid().optional(),
999
971
  answer: UserAnswerSchema,
1000
972
  /** WHAT THE AGENT CANNOT KNOW FROM THE FIELDS BESIDE IT (owner, 2026-09-04, issue
1001
973
  * #1537). One line, built from the record: the ask and the caller's reply VERBATIM,
@@ -1005,107 +977,111 @@ var AwaitItemSchema = z12.discriminatedUnion("type", [
1005
977
  * "call me back after you merge" in their own words decides for itself what to do,
1006
978
  * and now knows exactly which call to make. Absent when either half is missing —
1007
979
  * a sentence with a hole in it is worse than no sentence. */
1008
- note: z12.string().optional(),
980
+ note: z11.string().optional(),
1009
981
  /** The call record rendered for THIS agent (`docs/brain/voice/record-design.md`): the words the
1010
982
  * shaped answer was mapped from, filtered to its own claims. There is no second list
1011
983
  * of labels beside it — the acts went 2026-09-04 and `intents` went with them (owner,
1012
984
  * 2026-09-04): the agent reads the sentence and decides. */
1013
- transcript: z12.string().optional(),
985
+ transcript: z11.string().optional(),
1014
986
  /** Coverage report (#396), when the ask declared `points`: which of them this
1015
987
  * answer addressed. Missing points = re-ask or proceed knowingly partial. */
1016
- covered: z12.array(z12.string()).optional(),
988
+ covered: z11.array(z11.string()).optional(),
1017
989
  /** Ride-alongs (RideAlongSchema) — pending work for you, attached to the moment you
1018
990
  * became free. Only `reply` and `idle` carry it: those are the two outcomes that
1019
991
  * END a wait. `remind`, `superseded` and `turn` are mid-flight, and handing an
1020
992
  * agent a side-quest while it is still holding the line is how the main thing gets
1021
993
  * dropped. Absent/empty = nothing owed. */
1022
- also: z12.array(RideAlongSchema).optional()
994
+ also: z11.array(RideAlongSchema).optional()
1023
995
  }),
1024
- z12.object({
1025
- type: z12.literal("remind"),
1026
- parentId: z12.string(),
1027
- notificationId: z12.string(),
1028
- remindAt: z12.string().datetime({ offset: true }),
996
+ z11.object({
997
+ type: z11.literal("remind"),
998
+ parentId: z11.string(),
999
+ notificationId: z11.string(),
1000
+ remindAt: z11.string().datetime({ offset: true }),
1029
1001
  /** Seconds until remindAt, server-computed — pass straight to ScheduleWakeup. */
1030
- remindInSeconds: z12.number()
1002
+ remindInSeconds: z11.number()
1031
1003
  }),
1032
1004
  /** The awaited ask was REPLACED by a newer notification on its thread (e.g. a
1033
1005
  * post-feedback revision, #633) — the user will never answer this id. Stop
1034
1006
  * awaiting it; the live ask is the thread's newest turn (await that one, or
1035
1007
  * re-orient via contact({})). */
1036
- z12.object({
1037
- type: z12.literal("superseded"),
1038
- parentId: z12.string(),
1039
- notificationId: z12.string()
1008
+ z11.object({
1009
+ type: z11.literal("superseded"),
1010
+ parentId: z11.string(),
1011
+ notificationId: z11.string()
1040
1012
  }),
1041
1013
  /** A LIVE call's turn, streamed as it lands (#783). PROVISIONAL: the user can still
1042
1014
  * revise any of these until the final reply arrives — partial = intelligence,
1043
1015
  * settled = authorization. Use it to PREPARE (fetch, draft, warm), never to act
1044
1016
  * irreversibly. If `acts` carries a question aimed at you and you know the answer,
1045
1017
  * contact on the same thread right away — the caller hears it on the same call. */
1046
- z12.object({
1047
- type: z12.literal("partial"),
1048
- notificationId: z12.string(),
1049
- inFlight: z12.literal(true),
1050
- turn: z12.object({
1051
- idx: z12.number(),
1052
- prompt: z12.string(),
1053
- reply: z12.string(),
1054
- acts: z12.array(IntentSchema).nullable().optional()
1018
+ z11.object({
1019
+ type: z11.literal("partial"),
1020
+ notificationId: z11.string(),
1021
+ inFlight: z11.literal(true),
1022
+ turn: z11.object({
1023
+ idx: z11.number(),
1024
+ prompt: z11.string(),
1025
+ reply: z11.string(),
1026
+ acts: z11.array(IntentSchema).nullable().optional()
1055
1027
  })
1056
1028
  }),
1057
- z12.object({
1058
- type: z12.literal("idle"),
1059
- also: z12.array(RideAlongSchema).optional(),
1029
+ z11.object({
1030
+ type: z11.literal("idle"),
1031
+ also: z11.array(RideAlongSchema).optional(),
1060
1032
  /** Is a call live for this agent's user right now? The SDK polls the partial stream
1061
1033
  * (#783) between idle ticks ONLY while this is not `false` — a partial can only exist
1062
1034
  * during a live call, and polling for one on a banner/message was a wasted HTTP call +
1063
1035
  * 3 queries on every idle tick of every waiting agent (~80% of all traffic at scale).
1064
1036
  * Absent = an older API → the SDK keeps polling, exactly as before. */
1065
- inFlight: z12.boolean().optional()
1037
+ inFlight: z11.boolean().optional()
1066
1038
  })
1067
1039
  ]);
1068
- var VoiceKeySchema = z12.enum(["rachel", "george", "jessica", "brian", "lily"]);
1069
- var AgendaTurnSchema = z12.object({
1040
+ var VoiceKeySchema = z11.enum(["rachel", "george", "jessica", "brian", "lily"]);
1041
+ var AgendaTurnSchema = z11.object({
1070
1042
  /** THE TURN'S IDENTITY (the first-sentence stream, 2026-09-09): the brain call that wrote
1071
1043
  * it and its place in that reply — `<brainCallId>:<index>`, with `:p` on the first
1072
1044
  * sentence a re-plan publishes ahead of the rest. A turn is spoken once, by this id: the
1073
1045
  * completion of a streamed re-plan carries the published sentence again, and the walk
1074
1046
  * drops what it already said by identity, never by the API's guess of what was polled.
1075
1047
  * Absent on plans nothing streams (a ring plan, a floor). */
1076
- id: z12.string().optional(),
1048
+ id: z11.string().optional(),
1077
1049
  /** Twin coverage (#1089): sibling claim ids this asking turn's answer ALSO settles —
1078
1050
  * the planner declares duplicates instead of asking them twice. */
1079
- coveredIds: z12.array(z12.string()).optional(),
1051
+ coveredIds: z11.array(z11.string()).optional(),
1080
1052
  /** The spoken sentences of the turn, in order. No count: how long a turn is is the brain's call
1081
1053
  * (owner, 2026-09-25), and a count here refused whole plans. */
1082
- info: z12.array(z12.string().min(1)).default([]),
1083
- question: z12.string().min(1).nullable(),
1054
+ info: z11.array(z11.string().min(1)).default([]),
1055
+ /** THE ID OF EACH SENTENCE, when the plan names them (turns.md): a talker message's sentences are its
1056
+ * `info`, one piece each, and `units[i]` is the id the bot's line receipt carries for `info[i]`
1057
+ * (`<cycle>:<key>:<n>`), so what was heard is known per sentence. Absent on every other turn. */
1058
+ units: z11.array(z11.string().min(1)).optional(),
1059
+ question: z11.string().min(1).nullable(),
1084
1060
  /** True on the one turn carrying the agent's own declared question. */
1085
- asks: z12.boolean().optional(),
1061
+ asks: z11.boolean().optional(),
1086
1062
  /** The claim this turn belongs to (#781) — the RETURN identity: answers route by it.
1087
1063
  * Absent on a single-claim plan (the session's own claim) and on shared context turns,
1088
1064
  * which route nothing. */
1089
- claimId: z12.string().optional(),
1065
+ claimId: z11.string().optional(),
1090
1066
  /** The claim's voice key (#462) — the OUTBOUND identity, audible who-is-asking. */
1091
- voice: z12.string().optional(),
1067
+ voice: z11.string().optional(),
1092
1068
  /** The claim's AGENT NAME (#838) — the spoken identity. A voice alone doesn't say
1093
1069
  * whose request this is: an item that folded in from another agent arrived as a bare
1094
1070
  * non-sequitur ("First real production sign-in is yours to make whenever you want.")
1095
1071
  * and the owner answered "What?". The bot names the agent before its first turn. */
1096
- agent: z12.string().optional(),
1072
+ agent: z11.string().optional(),
1097
1073
  /** The claim's agent by ID — the pairing's connection id (`notifications.token_id`), the
1098
1074
  * same id a face is minted from. A name is not an identity: two pairings may be called
1099
1075
  * "Claude", and a name cannot be joined on. The record's entries carry it (`agent_id`)
1100
1076
  * so "who said that" survives the call, and it rides PER TURN because a coalesced call
1101
1077
  * speaks for several agents — the turn is the only place that knows which. */
1102
- agentId: z12.string().optional(),
1078
+ agentId: z11.string().optional(),
1103
1079
  /** ITS QUESTION IS ON THE TABLE (#3292): a talker line about a question the person owes. The walk tells
1104
1080
  * the phone (`asking`, so the agenda goes gold and its options show) without treating the line as a
1105
1081
  * question turn — the talker owns re-asking and the waits, so `question` stays null. */
1106
- onTable: z12.boolean().optional(),
1082
+ onTable: z11.boolean().optional(),
1107
1083
  select: SelectShapeSchema.optional(),
1108
- options: z12.array(OptionSchema.omit({ id: true })).optional(),
1084
+ options: z11.array(OptionSchema.omit({ id: true })).optional(),
1109
1085
  /* `pace` STOOD HERE (#826). A turn could carry seconds and the model chose them. The walk
1110
1086
  paces itself now — a short beat between the sentences of a turn, the longer one at its end
1111
1087
  (owner, 2026-09-30: "remove the bot deciding pace") — and it does that where the words are
@@ -1114,58 +1090,58 @@ var AgendaTurnSchema = z12.object({
1114
1090
  /** Whether the walk WAITS for an answer before moving on. Absent = derived as today
1115
1091
  * (a question blocks, context flows). blocking:false on a question = ask and move
1116
1092
  * on, the claim stays pending; blocking:true on context = hold for a reply. */
1117
- blocking: z12.boolean().optional(),
1093
+ blocking: z11.boolean().optional(),
1118
1094
  /** SPOKEN ONLY IF THEY SAY NOTHING (owner, 2026-10-01, call 812de935: "you're gonna re-ask, but it
1119
1095
  * shouldn't be the same words … more like, hey, are you still there, or are you able to answer, or
1120
1096
  * would you need more information"). The walk holds this turn out of its queue; at the queue's end it
1121
1097
  * listens for the last word, and only if that listen is silent is this turn said and asked. If they
1122
1098
  * speak, it is dropped and their words are taken like any reply. */
1123
- ifSilent: z12.boolean().optional()
1099
+ ifSilent: z11.boolean().optional()
1124
1100
  });
1125
1101
  var CLAIM_STALE_MS = 30 * 6e4;
1126
- var CallQuestionSchema = z12.object({
1127
- id: z12.string(),
1128
- entryId: z12.string(),
1129
- title: z12.string(),
1130
- state: z12.enum(["open", "answered"]),
1131
- answer: z12.string().nullable(),
1102
+ var CallQuestionSchema = z11.object({
1103
+ id: z11.string(),
1104
+ entryId: z11.string(),
1105
+ title: z11.string(),
1106
+ state: z11.enum(["open", "answered"]),
1107
+ answer: z11.string().nullable(),
1132
1108
  /** WHO ASKED IT (owner, 2026-09-23, Goal a345e906: each agenda row wears its agent's face) — the
1133
1109
  * request Entry's author, as the same three facts the item's own `tokenId`/`name`/`voice`
1134
1110
  * carry for the call's one agent, so the phone draws it with the same seed. Absent when the
1135
1111
  * author is not an agent this account holds (unpaired since, or a person). */
1136
- agent: z12.object({ tokenId: z12.string(), name: z12.string(), voice: VoiceKeySchema.optional() }).optional(),
1112
+ agent: z11.object({ tokenId: z11.string(), name: z11.string(), voice: VoiceKeySchema.optional() }).optional(),
1137
1113
  /** ITS OPTIONS, WHEN THERE IS SOMETHING TO SEE (owner, 2026-09-25: "Yes, add it"): the options
1138
1114
  * its need offers, exactly as its own card carries them, present only when one of them has a
1139
1115
  * preview (`html` or `image`). The call screen opens them from the agenda row, so a preview is
1140
1116
  * never re-sent as a second card to be seen mid-call. Words-only options are `choices`. */
1141
- options: z12.array(OptionSchema).optional(),
1117
+ options: z11.array(OptionSchema).optional(),
1142
1118
  /** ITS OPTIONS WHEN THEY ARE WORDS (owner, 2026-10-02, on a call: "whenever there are pre-made
1143
1119
  * options … now for a checklist, we should also show them on the screen"; design C, 2026-10-08):
1144
1120
  * numbered chips above the call's controls, so a checklist is never only something read aloud. A
1145
1121
  * field of its own so `options` keeps meaning "previews": a phone on an older bundle opens the
1146
1122
  * preview layout for any `options`, and must see exactly what it did. */
1147
- choices: z12.array(OptionSchema).optional(),
1123
+ choices: z11.array(OptionSchema).optional(),
1148
1124
  /** HOW MANY MAY BE PICKED, beside its `choices`: one, any (`many`) or an order (`rank`). */
1149
- select: z12.enum(["one", "many", "rank"]).optional()
1125
+ select: z11.enum(["one", "many", "rank"]).optional()
1150
1126
  });
1151
- var InboxItemSchema = z12.object({
1152
- id: z12.string(),
1153
- tokenId: z12.string().optional(),
1127
+ var InboxItemSchema = z11.object({
1128
+ id: z11.string(),
1129
+ tokenId: z11.string().optional(),
1154
1130
  status: NotifyStatusSchema,
1155
1131
  context: ContextSchema,
1156
- options: z12.array(OptionSchema).optional(),
1132
+ options: z11.array(OptionSchema).optional(),
1157
1133
  /** The ask's declared coverage points (#396), when the agent sent them. */
1158
- points: z12.array(z12.string()).optional(),
1134
+ points: z11.array(z11.string()).optional(),
1159
1135
  /** Does this claim want an ANSWER, or is it telling you something? Written per row from
1160
1136
  * `requestAsks` — the agent's own declaration, not a guess. `false` is what earns a card
1161
1137
  * its acknowledge affordance: without it a status update offers a text box and a dismiss,
1162
1138
  * and neither of those is "got it" (owner, 2026-08-10). */
1163
- asks: z12.boolean().optional(),
1139
+ asks: z11.boolean().optional(),
1164
1140
  /** When a live process last pulsed for this row's agent — the liveness input for
1165
1141
  * "working requires a pulse" (#928): the list said "Working…" from agent_state alone
1166
1142
  * while the party called the same dead claim stalled. Absent = no token/no data,
1167
1143
  * which must never CLAIM stalled. */
1168
- lastSeenAt: z12.string().optional(),
1144
+ lastSeenAt: z11.string().optional(),
1169
1145
  /** WHEN THE AGENT LAST SAID ANYTHING ABOUT THIS CLAIM — the newest `agent_state` row in
1170
1146
  * the `notification_events` ledger (trigger-written since 20260621010000, so every row a
1171
1147
  * user can see has one). The age input for `CLAIM_STALE_MS`, and it has to be this rather
@@ -1175,7 +1151,7 @@ var InboxItemSchema = z12.object({
1175
1151
  * work. Reading the row's birth as the claim's age brands that "No update in 8h" the
1176
1152
  * instant the agent picks it up (#997). Absent = pre-trigger row; fall back to
1177
1153
  * `createdAt`. */
1178
- agentStateAt: z12.string().datetime().optional(),
1154
+ agentStateAt: z11.string().datetime().optional(),
1179
1155
  /** THE QUESTIONS A CALL CARRIES — the call screen's agenda spine (docs/clients/app/walk/design.md §11, owner
1180
1156
  * 2026-09-22). One per DecisionNeed on the Call, in the Call's order, answered or open (a
1181
1157
  * superseded or cancelled need is no longer a question anyone is asked). Present only on a
@@ -1189,40 +1165,40 @@ var InboxItemSchema = z12.object({
1189
1165
  * `turn` topic (`asking`, `settled`), because the bot never sees a DecisionNeed id. `title` is
1190
1166
  * the card's own concise heading; `answer` the accepted answer in words, null while open. It
1191
1167
  * REPLACED `agenda` (turns), which nothing ever filled. */
1192
- questions: z12.array(CallQuestionSchema).optional(),
1168
+ questions: z11.array(CallQuestionSchema).optional(),
1193
1169
  /** The same call carrying order, including request Entries with no DecisionNeed as reports.
1194
1170
  * Additive: questions stays decision-only for every other surface and older bundles. */
1195
- callItems: z12.array(CallQuestionSchema.extend({ state: z12.enum(["open", "answered", "report"]) })).optional(),
1196
- visuals: z12.array(VisualSchema).optional(),
1171
+ callItems: z11.array(CallQuestionSchema.extend({ state: z11.enum(["open", "answered", "report"]) })).optional(),
1172
+ visuals: z11.array(VisualSchema).optional(),
1197
1173
  /** The connected agent's name (the single pairing name — user-typed, or the
1198
1174
  * agent's suggestion, or a default silly name). */
1199
- name: z12.string(),
1175
+ name: z11.string(),
1200
1176
  /** The pairing's assigned voice (#462); absent = the default voice. */
1201
1177
  voice: VoiceKeySchema.optional(),
1202
- repo: z12.string().optional(),
1203
- branch: z12.string().optional(),
1204
- createdAt: z12.string().datetime(),
1205
- snoozedUntil: z12.string().datetime().optional(),
1178
+ repo: z11.string().optional(),
1179
+ branch: z11.string().optional(),
1180
+ createdAt: z11.string().datetime(),
1181
+ snoozedUntil: z11.string().datetime().optional(),
1206
1182
  agentState: AgentStateSchema.default("idle"),
1207
1183
  /** Whose action the item is waiting on: "you" = an agent asked you (the default,
1208
1184
  * every agent→user notification); "agent" = you sent a request and it's awaiting the
1209
1185
  * agent (held in the inbox until the agent replies on the thread). */
1210
- turn: z12.enum(["you", "agent"]).default("you"),
1186
+ turn: z11.enum(["you", "agent"]).default("you"),
1211
1187
  /** Hard error reason on an awaiting request (turn="agent") — the wake failed to reach
1212
1188
  * the agent (provider-agnostic; set server-side). Absent = no hard error. Drives the inbox
1213
1189
  * error badge + Retry. */
1214
- error: z12.string().optional(),
1190
+ error: z11.string().optional(),
1215
1191
  /** WHEN THIS AGENT WORK WENT QUIET (turn="agent"), by the one rule (`coldSince`: three days
1216
1192
  * with nothing said), or absent while it is not stalled. The inbox's stalled badge reads
1217
1193
  * this and nothing else (2026-09-23: a 3-minute age rule badged every live Goal stalled,
1218
1194
  * and "dismiss the stalled ones" cancelled 37 pieces of live work). */
1219
- cold: z12.string().datetime().optional(),
1220
- clarifies: z12.string().optional(),
1195
+ cold: z11.string().datetime().optional(),
1196
+ clarifies: z11.string().optional(),
1221
1197
  /** THIS CARD'S QUESTION IS ON A LIVE CALL (owner, 2026-09-24: "Mark it while the call is
1222
1198
  * live"). Present only while an open Call Delivery carries the card's request Entry — read
1223
1199
  * off the same open list the card came from, so it clears when the Call does. A card is the
1224
1200
  * backup for a call not taken; while the call has it, the call is where it is answered. */
1225
- onCall: z12.literal(true).optional(),
1201
+ onCall: z11.literal(true).optional(),
1226
1202
  /** THE RING, ON THE ITEM (docs/clients/app/walk/design.md §12 §17, #2251): the last ring on this card was
1227
1203
  * declined, and what the ladder will do next — read off the cron's own row, never computed
1228
1204
  * on the phone. Present only while a `declined` receipt stands on the card's last Call.
@@ -1232,31 +1208,31 @@ var InboxItemSchema = z12.object({
1232
1208
  * It replaced `gaveUp` (deleted 2026-09-22): "the ladder spent" was a boolean the projection
1233
1209
  * never set, and it is `nextRingAt === null` here — the party's *Missed you* (`party/dress.ts`)
1234
1210
  * and the roster's `unreached` read `declinedAt`, and stand while it does. */
1235
- ring: z12.object({
1236
- declinedAt: z12.string().datetime(),
1237
- anchorAt: z12.string().datetime(),
1238
- nextRingAt: z12.string().datetime().nullable(),
1239
- step: z12.number().int()
1211
+ ring: z11.object({
1212
+ declinedAt: z11.string().datetime(),
1213
+ anchorAt: z11.string().datetime(),
1214
+ nextRingAt: z11.string().datetime().nullable(),
1215
+ step: z11.number().int()
1240
1216
  }).optional(),
1241
1217
  /** Why this arrived the way it did, read back off the delivery receipt (`notify/why.ts`).
1242
1218
  * Absent for anything never delivered through a push, and for older rows written before
1243
1219
  * the reason was recorded. Deliberately a debug affordance, shown small (owner,
1244
1220
  * 2026-08-07) — its real job is to give "this didn't need a call" something to be
1245
1221
  * feedback ABOUT. */
1246
- why: z12.object({
1222
+ why: z11.object({
1247
1223
  asked: NotifyLevelSchema,
1248
1224
  got: NotifyLevelSchema,
1249
- because: z12.enum(["unresponsive", "dismissed", "not_permitted", "silent", "coalesced", "agent_capped", "unplanned", "learned_raise"]).optional(),
1250
- line: z12.string()
1225
+ because: z11.enum(["unresponsive", "dismissed", "not_permitted", "silent", "coalesced", "agent_capped", "unplanned", "learned_raise"]).optional(),
1226
+ line: z11.string()
1251
1227
  }).optional(),
1252
- select: z12.enum(["one", "many", "rank", "confirm", "text"]).default("one"),
1253
- confirmStyle: z12.enum(["yesno", "approve"]).default("yesno").describe(
1228
+ select: z11.enum(["one", "many", "rank", "confirm", "text"]).default("one"),
1229
+ confirmStyle: z11.enum(["yesno", "approve"]).default("yesno").describe(
1254
1230
  "Labels for a select:'confirm' paige \u2014 'yesno' (Yes/No) or 'approve' (Approve/Deny). Ignored unless select is 'confirm'."
1255
1231
  ),
1256
1232
  /** Real downstream work is stuck behind this one — set by the agent, independent of
1257
1233
  * urgency (see the main README's "premier use case" + docs/delivery/notify/states.md). Drives the
1258
1234
  * inbox's blocking badge and the extra confirm step before dismissing it. */
1259
- blocking: z12.boolean().default(false),
1235
+ blocking: z11.boolean().default(false),
1260
1236
  /** The user's locked-in answer; present only for replied items (GET /api/replied/:id). */
1261
1237
  answer: UserAnswerSchema.optional(),
1262
1238
  /** THE TARGET FACTS A CARD RENDERS (#1796 point 5, 2026-09-11): the Delivery it is a view of,
@@ -1264,17 +1240,17 @@ var InboxItemSchema = z12.object({
1264
1240
  * for a request that asks nothing), whether its content is sealed, and that Goal's state. The
1265
1241
  * answer writer (`POST /api/entries`) and the disposition (`close_delivery`) take their ids from
1266
1242
  * here. The server projects it (`apps/api/src/inbox/project.ts`); a client never builds it. */
1267
- communication: z12.object({
1268
- deliveryId: z12.string(),
1269
- kind: z12.enum(["notification", "call"]),
1270
- entryId: z12.string(),
1271
- goalIds: z12.array(z12.string()),
1272
- decisionNeedId: z12.string().optional(),
1273
- sealed: z12.boolean(),
1274
- goalState: z12.string().optional(),
1243
+ communication: z11.object({
1244
+ deliveryId: z11.string(),
1245
+ kind: z11.enum(["notification", "call"]),
1246
+ entryId: z11.string(),
1247
+ goalIds: z11.array(z11.string()),
1248
+ decisionNeedId: z11.string().optional(),
1249
+ sealed: z11.boolean(),
1250
+ goalState: z11.string().optional(),
1275
1251
  /** THAT GOAL'S NAME (#2416) — what Activity's row is headed by, since a row there is one Goal
1276
1252
  * and the cards it holds sit behind it. Stamped by the same read as `goalState`. */
1277
- goalTitle: z12.string().optional()
1253
+ goalTitle: z11.string().optional()
1278
1254
  }).optional(),
1279
1255
  /** WHAT THIS CARD IS, IN TWELVE CHARACTERS (#3019) — the hash of every other field on it, stamped
1280
1256
  * by the one read that serves the open list (`apps/api/src/inbox/project.ts` `inboxFor`). It is
@@ -1286,27 +1262,27 @@ var InboxItemSchema = z12.object({
1286
1262
  * own moves (its Goal's state and name, how cold the work behind it has gone, whether a ring is
1287
1263
  * live). Optional, so a fixture, the demo and the archive lens need not spell one, and a card
1288
1264
  * with no rev is simply always re-sent. */
1289
- rev: z12.string().optional()
1265
+ rev: z11.string().optional()
1290
1266
  });
1291
1267
  var APNS_TOKEN_RE = /^[0-9a-fA-F]{64}$/;
1292
- var PushTokenSchema = z12.object({
1293
- voipToken: z12.string().min(1).optional(),
1294
- alertToken: z12.string().min(1).optional(),
1295
- fcmToken: z12.string().min(1).optional(),
1296
- platform: z12.enum(["ios", "android"])
1268
+ var PushTokenSchema = z11.object({
1269
+ voipToken: z11.string().min(1).optional(),
1270
+ alertToken: z11.string().min(1).optional(),
1271
+ fcmToken: z11.string().min(1).optional(),
1272
+ platform: z11.enum(["ios", "android"])
1297
1273
  }).superRefine((v, ctx) => {
1298
1274
  if (v.platform !== "ios") return;
1299
1275
  for (const field of ["voipToken", "alertToken"]) {
1300
1276
  const token = v[field];
1301
1277
  if (token === void 0 || APNS_TOKEN_RE.test(token)) continue;
1302
1278
  ctx.addIssue({
1303
- code: z12.ZodIssueCode.custom,
1279
+ code: z11.ZodIssueCode.custom,
1304
1280
  path: [field],
1305
1281
  message: `not an APNs device token (want 64 hex chars, got ${token.length})`
1306
1282
  });
1307
1283
  }
1308
1284
  });
1309
- var MissedCallSchema = z12.enum([
1285
+ var MissedCallSchema = z11.enum([
1310
1286
  "retry_10m",
1311
1287
  "retry_30m",
1312
1288
  "retry_60m",
@@ -1316,33 +1292,33 @@ var MissedCallSchema = z12.enum([
1316
1292
  "inbox",
1317
1293
  "dismiss"
1318
1294
  ]);
1319
- var clock2 = (h) => h === 0 ? "midnight" : h === 12 ? "noon" : h < 12 ? `${h} am` : `${h - 12} pm`;
1320
- var QUIET = ` Nothing rings from ${clock2(NIGHT.from)} to ${clock2(NIGHT.to)} your time; the count waits for morning.`;
1321
- var BrokerTuningSchema = z12.object({
1295
+ var clock = (h) => h === 0 ? "midnight" : h === 12 ? "noon" : h < 12 ? `${h} am` : `${h - 12} pm`;
1296
+ var QUIET = ` Nothing rings from ${clock(NIGHT.from)} to ${clock(NIGHT.to)} your time; the count waits for morning.`;
1297
+ var BrokerTuningSchema = z11.object({
1322
1298
  /** 'none' = skip the spoken ack after a mapped answer (power users find it slow). */
1323
- ackVerbosity: z12.enum(["normal", "none"]).optional(),
1299
+ ackVerbosity: z11.enum(["normal", "none"]).optional(),
1324
1300
  /** How readily the mapper asks its one clarification: 'low' = only when truly
1325
1301
  * uninterpretable, 'high' = whenever not fully certain. */
1326
- clarifyEagerness: z12.enum(["low", "normal", "high"]).optional(),
1302
+ clarifyEagerness: z11.enum(["low", "normal", "high"]).optional(),
1327
1303
  /** The user's own shorthand: when they say `say`, they mean `mean`. */
1328
- phrasebook: z12.array(z12.object({ say: z12.string().min(1).max(60), mean: z12.string().min(1).max(120) })).max(24).optional(),
1304
+ phrasebook: z11.array(z11.object({ say: z11.string().min(1).max(60), mean: z11.string().min(1).max(120) })).max(24).optional(),
1329
1305
  /** The language calls are PLANNED in, when the account has chosen one (#1272). Absent —
1330
1306
  * which is every account today — means the agent's own words decide, per ask: a call
1331
1307
  * about an English ask opens in English. This is the only thing that overrides that,
1332
1308
  * and a live caller who switches language mid-call still outranks it (broker/lang.ts).
1333
1309
  * Set per user (no UI yet), like `voiceTuning`. */
1334
- language: z12.enum(["en", "es"]).optional()
1310
+ language: z11.enum(["en", "es"]).optional()
1335
1311
  });
1336
- var UserSettingsSchema = z12.object({
1337
- permissions: z12.object({
1338
- call: z12.boolean(),
1339
- banner: z12.boolean(),
1340
- push: z12.boolean()
1312
+ var UserSettingsSchema = z11.object({
1313
+ permissions: z11.object({
1314
+ call: z11.boolean(),
1315
+ banner: z11.boolean(),
1316
+ push: z11.boolean()
1341
1317
  }),
1342
1318
  /** LockedIn / Default / DateNight on screen; the stored words are unchanged on purpose —
1343
1319
  * they are an enum on a live column across every account, and the rename is a rename of
1344
1320
  * what people read (owner, 2026-09-30). */
1345
- sessionMode: z12.enum(["default", "all_calls", "silent"]),
1321
+ sessionMode: z11.enum(["default", "all_calls", "silent"]),
1346
1322
  /** `silentPush` lived here until #2813 and is now GONE, field and column both. It was kept as an
1347
1323
  * optional long after DateNight stopped reading it, on the theory that a phone on an older
1348
1324
  * bundle PATCHing the whole settings object would be REFUSED for sending a key we had stopped
@@ -1351,7 +1327,7 @@ var UserSettingsSchema = z12.object({
1351
1327
  * an old bundle's `silentPush` is accepted and ignored. Worth remembering before keeping the
1352
1328
  * next dead field for the same reason. */
1353
1329
  /** Opt-in (default false) to using your content to improve Paigy and train models. */
1354
- improveConsent: z12.boolean(),
1330
+ improveConsent: z11.boolean(),
1355
1331
  missedCall: MissedCallSchema.default("backoff_standard"),
1356
1332
  /** Where voice audio is processed. 'hosted' (default) = Paigy's voice services
1357
1333
  * (ElevenLabs TTS, faster-whisper STT, the call bot); 'on_device' = the phone
@@ -1359,17 +1335,17 @@ var UserSettingsSchema = z12.object({
1359
1335
  * Optional, NOT defaulted: a stale client PATCHing the full settings object
1360
1336
  * must not silently reset this privacy choice. Absent = leave unchanged on
1361
1337
  * write, 'hosted' on read (see store.ts). */
1362
- voiceMode: z12.enum(["hosted", "on_device"]).optional(),
1338
+ voiceMode: z11.enum(["hosted", "on_device"]).optional(),
1363
1339
  /** Talk — after you answer, the next step is read aloud (docs/clients/app/walk/design.md §6). ALWAYS ON until
1364
1340
  * turned off (owner, 2026-09-18, #2249): a setting, not a per-walk toggle. Optional, NOT
1365
1341
  * defaulted, for the same reason `voiceMode` is: a stale client PATCHing the full settings
1366
1342
  * object must not silently turn it back on. Absent = leave unchanged on write, true on
1367
1343
  * read (see store.ts). */
1368
- talk: z12.boolean().optional(),
1344
+ talk: z11.boolean().optional(),
1369
1345
  /** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
1370
1346
  * load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
1371
1347
  * newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
1372
- callDiagnostics: z12.boolean().optional(),
1348
+ callDiagnostics: z11.boolean().optional(),
1373
1349
  /** Per-user ring budget (#603): calls per rolling day before further calls
1374
1350
  * degrade to banner. Absent = the global default (25). A number, never a
1375
1351
  * bypass — every account keeps a ceiling. No UI; set per user for testing. */
@@ -1377,7 +1353,7 @@ var UserSettingsSchema = z12.object({
1377
1353
  * payload['tuning'] (e.g. { silence_s: 3.5 } — a longer pause window for a
1378
1354
  * slower speaker). No API-side semantics; the bot resolves each key with its
1379
1355
  * own defaults. Set per user (no UI yet); absent = bot defaults. */
1380
- voiceTuning: z12.record(z12.string(), z12.union([z12.number(), z12.string()])).optional(),
1356
+ voiceTuning: z11.record(z11.string(), z11.union([z11.number(), z11.string()])).optional(),
1381
1357
  /** The user's IANA timezone (e.g. "America/Bogota"), recorded by the app — it is the
1382
1358
  * only party that knows it. REMINDERS are why it exists: "remind me at ten" becomes
1383
1359
  * an absolute `due_at` only if we know whose ten. Optional and never defaulted, for
@@ -1386,70 +1362,70 @@ var UserSettingsSchema = z12.object({
1386
1362
  * that failure reads as the reminder rail being unreliable rather than as a missing
1387
1363
  * setting. Absent = a spoken time can't be landed, so the reminder rides the next
1388
1364
  * call — honest about what we know. */
1389
- timezone: z12.string().min(1).max(64).optional(),
1365
+ timezone: z11.string().min(1).max(64).optional(),
1390
1366
  /** Rung-2 broker tuning (#381). Optional and NOT defaulted, same stale-client
1391
1367
  * clobber guard as voiceMode: absent = leave unchanged on write. */
1392
1368
  broker: BrokerTuningSchema.optional()
1393
1369
  });
1394
- var GoalLatestSchema = z12.object({
1395
- from: z12.enum(["person", "agent"]),
1396
- said: z12.string(),
1397
- at: z12.string(),
1398
- entryId: z12.string(),
1370
+ var GoalLatestSchema = z11.object({
1371
+ from: z11.enum(["person", "agent"]),
1372
+ said: z11.string(),
1373
+ at: z11.string(),
1374
+ entryId: z11.string(),
1399
1375
  /** ITS SUMMARY IN AT MOST TEN WORDS (owner, 2026-10-08: "the same switch to the more summarized sources
1400
1376
  * at the work tab top level screen too"): what the talker or filer wrote on the Entry; absent when
1401
1377
  * none was. The Work row reads it before `said`. */
1402
- summary: z12.string().optional(),
1378
+ summary: z11.string().optional(),
1403
1379
  /** AN AGENT'S UPDATE OR QUESTION AS ITS UNITS' TITLES (owner, 2026-10-08: "send the 50 chars from the title
1404
1380
  * of each unit"): each at most 50 characters, in order; absent when it has none. */
1405
- titles: z12.array(z12.string()).optional(),
1381
+ titles: z11.array(z11.string()).optional(),
1406
1382
  /** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
1407
1383
  * update's own line, before its units; the row caps it at 200. Absent on anything else. */
1408
- line: z12.string().optional()
1384
+ line: z11.string().optional()
1409
1385
  });
1410
- var HistoryWorkSchema = z12.object({
1411
- id: z12.string(),
1412
- title: z12.string(),
1413
- state: z12.enum(["done", "cancelled"]),
1386
+ var HistoryWorkSchema = z11.object({
1387
+ id: z11.string(),
1388
+ title: z11.string(),
1389
+ state: z11.enum(["done", "cancelled"]),
1414
1390
  /** Who held it (`agent:<tokenId>` or `human:<userId>`). */
1415
- assignee: z12.string(),
1391
+ assignee: z11.string(),
1416
1392
  latest: GoalLatestSchema.nullable().optional()
1417
1393
  });
1418
- var HistoryEntrySchema = z12.union([
1419
- z12.object({ at: z12.string(), card: InboxItemSchema }),
1420
- z12.object({ at: z12.string(), work: HistoryWorkSchema })
1394
+ var HistoryEntrySchema = z11.union([
1395
+ z11.object({ at: z11.string(), card: InboxItemSchema }),
1396
+ z11.object({ at: z11.string(), work: HistoryWorkSchema })
1421
1397
  ]);
1422
- var HistoryPageSchema = z12.object({
1423
- entries: z12.array(HistoryEntrySchema),
1424
- next: z12.string().nullable()
1398
+ var HistoryPageSchema = z11.object({
1399
+ entries: z11.array(HistoryEntrySchema),
1400
+ next: z11.string().nullable()
1425
1401
  });
1426
1402
  var ACTIVITY_LINES = 2;
1427
1403
  var ACTIVITY_LINE_MAX = 80;
1428
- var AgentActivitySchema = z12.object({
1404
+ var AgentActivitySchema = z11.object({
1429
1405
  /** Oldest first, so the newest line is last — the one that replaces in place. */
1430
- lines: z12.array(z12.string().max(ACTIVITY_LINE_MAX)).max(ACTIVITY_LINES),
1406
+ lines: z11.array(z11.string().max(ACTIVITY_LINE_MAX)).max(ACTIVITY_LINES),
1431
1407
  /** When the harness observed this tail. Its own timestamp, not the heartbeat's: a beat
1432
1408
  * that carries an UNCHANGED tail must not make a stalled agent look like it just moved. */
1433
- at: z12.string().datetime()
1409
+ at: z11.string().datetime()
1434
1410
  });
1435
- var ConnectionSummarySchema = z12.object({
1411
+ var ConnectionSummarySchema = z11.object({
1436
1412
  /** The connection = the agent's token id (used to address a request). */
1437
- id: z12.string(),
1413
+ id: z11.string(),
1438
1414
  /** The credential kind: "device" = a paired machine (mint-only — it hosts and mints, it
1439
1415
  * never talks); "agent" = an identity that sends. The roster and devices surfaces split
1440
1416
  * on this. Optional/absent reads as "agent" (a row predating the kind column). See
1441
1417
  * docs/server/tokens/devices-vs-agents-design.md. */
1442
- kind: z12.enum(["device", "agent"]).optional(),
1418
+ kind: z11.enum(["device", "agent"]).optional(),
1443
1419
  /** For an agent, the token id of the DEVICE that minted it — so agents group under their
1444
1420
  * machine, and revoking a device cascades to them. Null on devices, and on unlinked
1445
1421
  * agents (phone-launched, provider-managed, or minted before the link existed). */
1446
- mintedByDevice: z12.string().nullable().optional(),
1447
- device: z12.string().nullable(),
1422
+ mintedByDevice: z11.string().nullable().optional(),
1423
+ device: z11.string().nullable(),
1448
1424
  /** The agent's display name (the single pairing name). */
1449
- name: z12.string(),
1425
+ name: z11.string(),
1450
1426
  /** For a managed connection, the provider key (e.g. "cma") that agentOrigin maps to a
1451
1427
  * label; null for a local connection. Sourced from the token's provider, not the name. */
1452
- provider: z12.string().nullable(),
1428
+ provider: z11.string().nullable(),
1453
1429
  /** The pairing's assigned voice (#462); null = the default voice. */
1454
1430
  voice: VoiceKeySchema.nullable(),
1455
1431
  /** The LOUDEST this agent may ever reach you — a ceiling on `NOTIFY_LADDER`, set by the
@@ -1460,34 +1436,34 @@ var ConnectionSummarySchema = z12.object({
1460
1436
  * every surface at once and outranks even `sessionMode: all_calls` — a mode the user
1461
1437
  * set once must not overrule a rule they set about one agent. */
1462
1438
  reach: NotifyLevelSchema.nullable().optional(),
1463
- createdAt: z12.string().datetime(),
1439
+ createdAt: z11.string().datetime(),
1464
1440
  /** Most recent notification on this connection, either direction. Null = no contact yet.
1465
1441
  * Drives the agents-page recency grouping (Today / This week / …). */
1466
- lastContactAt: z12.string().datetime().nullable(),
1442
+ lastContactAt: z11.string().datetime().nullable(),
1467
1443
  /** Last presence heartbeat from a running agent process (POST /api/presence) — the
1468
1444
  * desktop app while open. Null = never seen; stale = offline. */
1469
- lastSeenAt: z12.string().datetime().nullable().optional(),
1445
+ lastSeenAt: z11.string().datetime().nullable().optional(),
1470
1446
  /** WORKING, NOT JUST CONNECTED (owner, 2026-09-30): the last time the agent itself acted on one of
1471
1447
  * its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
1472
1448
  * `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
1473
- lastWorkedAt: z12.string().datetime().nullable().optional(),
1449
+ lastWorkedAt: z11.string().datetime().nullable().optional(),
1474
1450
  /** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
1475
1451
  * With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
1476
- oldestReadyAt: z12.string().datetime().nullable().optional(),
1452
+ oldestReadyAt: z11.string().datetime().nullable().optional(),
1477
1453
  /** What a live desktop can run (docs/clients/desktop/companion.md §2.2), advertised on its heartbeat:
1478
1454
  * harness availabilities + granted workspaces — the option set the phone's
1479
1455
  * "new session" sheet offers. Absent for ordinary MCP agents. */
1480
- runtime: z12.object({
1456
+ runtime: z11.object({
1481
1457
  /** The @paigy/harness this host is running — a machine the self-update has not reached
1482
1458
  * shows its age here (`apps/desktop/src/update.ts`). */
1483
- version: z12.string().optional(),
1484
- harnesses: z12.array(z12.object({ name: z12.string(), label: z12.string(), status: z12.string(), models: z12.array(z12.string()).optional() })).optional(),
1485
- workspaces: z12.array(z12.string()).optional(),
1459
+ version: z11.string().optional(),
1460
+ harnesses: z11.array(z11.object({ name: z11.string(), label: z11.string(), status: z11.string(), models: z11.array(z11.string()).optional() })).optional(),
1461
+ workspaces: z11.array(z11.string()).optional(),
1486
1462
  /** THE GIT REPOS IN THOSE FOLDERS (2026-10-01, Goal 26982211): each granted folder that is a
1487
1463
  * repo, and each repo directly inside one, with its `origin` remote. A session started for
1488
1464
  * work on `mauurda/paigy` opens in that repo rather than the folder above it, where the repo's
1489
1465
  * own AGENTS.md is never read (`workspaceForRepo`). Absent on hosts that predate it. */
1490
- repos: z12.array(z12.object({ path: z12.string(), remote: z12.string() })).optional()
1466
+ repos: z11.array(z11.object({ path: z11.string(), remote: z11.string() })).optional()
1491
1467
  }).optional(),
1492
1468
  /** The tail of this agent's working log, when a harness is driving it — the agent page's
1493
1469
  * live strip. Absent for anything the desktop harness isn't running (a hatched identity
@@ -1496,145 +1472,145 @@ var ConnectionSummarySchema = z12.object({
1496
1472
  activity: AgentActivitySchema.optional(),
1497
1473
  /** True = a provider-managed agent running in the provider's cloud (e.g. Anthropic CMA);
1498
1474
  * false = a local MCP connection running on the user's computer (Claude Code/Codex/…). */
1499
- managed: z12.boolean()
1475
+ managed: z11.boolean()
1500
1476
  });
1501
- var LedgerItemSchema = z12.object({ id: z12.string(), parentId: z12.string(), title: z12.string(), createdAt: z12.string() });
1502
- var AgentLedgerSchema = z12.object({
1477
+ var LedgerItemSchema = z11.object({ id: z11.string(), parentId: z11.string(), title: z11.string(), createdAt: z11.string() });
1478
+ var AgentLedgerSchema = z11.object({
1503
1479
  /** Null when the agent has not named itself yet — never a placeholder (owner, 2026-10-01). */
1504
- agent: z12.object({ id: z12.string(), name: z12.string().nullable(), revokedAt: z12.string().nullable() }),
1480
+ agent: z11.object({ id: z11.string(), name: z11.string().nullable(), revokedAt: z11.string().nullable() }),
1505
1481
  /** Its own questions you have not answered. */
1506
- asks: z12.array(LedgerItemSchema),
1482
+ asks: z11.array(LedgerItemSchema),
1507
1483
  /** Its questions you answered that nobody acted on — still owed to somebody. */
1508
- answered: z12.array(LedgerItemSchema),
1484
+ answered: z11.array(LedgerItemSchema),
1509
1485
  /** Requests you sent it that it never took. */
1510
- requests: z12.array(LedgerItemSchema),
1511
- goals: z12.array(z12.object({ id: z12.string(), outcome: z12.string(), state: z12.string() })),
1512
- callbacks: z12.array(z12.object({ id: z12.string(), parentId: z12.string(), trigger: z12.string(), note: z12.string(), dueAt: z12.string().nullable() }))
1486
+ requests: z11.array(LedgerItemSchema),
1487
+ goals: z11.array(z11.object({ id: z11.string(), outcome: z11.string(), state: z11.string() })),
1488
+ callbacks: z11.array(z11.object({ id: z11.string(), parentId: z11.string(), trigger: z11.string(), note: z11.string(), dueAt: z11.string().nullable() }))
1513
1489
  });
1514
- var ReassignResultSchema = z12.object({
1515
- moved: z12.object({ asks: z12.number(), answered: z12.number(), requests: z12.number(), goals: z12.number(), callbacks: z12.number() }),
1516
- parentId: z12.string().nullable()
1490
+ var ReassignResultSchema = z11.object({
1491
+ moved: z11.object({ asks: z11.number(), answered: z11.number(), requests: z11.number(), goals: z11.number(), callbacks: z11.number() }),
1492
+ parentId: z11.string().nullable()
1517
1493
  });
1518
- var LessonStateSchema = z12.enum(["active", "proposed", "retired"]);
1519
- var LessonViewSchema = z12.object({
1520
- id: z12.string(),
1521
- text: z12.string(),
1494
+ var LessonStateSchema = z11.enum(["active", "proposed", "retired"]);
1495
+ var LessonViewSchema = z11.object({
1496
+ id: z11.string(),
1497
+ text: z11.string(),
1522
1498
  state: LessonStateSchema,
1523
1499
  /** The Goal it is scoped to; null = the whole account. */
1524
- scopeGoalId: z12.string().nullable(),
1525
- goalTitle: z12.string().nullable(),
1526
- version: z12.number(),
1527
- pinned: z12.boolean(),
1500
+ scopeGoalId: z11.string().nullable(),
1501
+ goalTitle: z11.string().nullable(),
1502
+ version: z11.number(),
1503
+ pinned: z11.boolean(),
1528
1504
  /** When the person last wrote its text themselves. */
1529
- editedAt: z12.string().nullable(),
1530
- createdAt: z12.string(),
1531
- updatedAt: z12.string(),
1505
+ editedAt: z11.string().nullable(),
1506
+ createdAt: z11.string(),
1507
+ updatedAt: z11.string(),
1532
1508
  /** The Entries it came from, oldest first; `words` is null when an Entry has none to show (sealed). */
1533
- sources: z12.array(z12.object({ entryId: z12.string(), words: z12.string().nullable(), at: z12.string() }))
1509
+ sources: z11.array(z11.object({ entryId: z11.string(), words: z11.string().nullable(), at: z11.string() }))
1534
1510
  });
1535
- var QueueQuestionSchema = z12.object({
1511
+ var QueueQuestionSchema = z11.object({
1536
1512
  /** The decision need's id — what an answer is accepted against. */
1537
- id: z12.string(),
1513
+ id: z11.string(),
1538
1514
  /** The words that were asked, from the request Entry that asked them. */
1539
- question: z12.string(),
1515
+ question: z11.string(),
1540
1516
  /** Where it was asked — which is where the ruling goes (`POST /api/entries`). Null only
1541
1517
  * for a need whose request Entry is carried by no interactive Delivery, which nothing
1542
1518
  * can answer. */
1543
- deliveryId: z12.string().nullable().default(null),
1519
+ deliveryId: z11.string().nullable().default(null),
1544
1520
  /** The Entry the ruling is about. */
1545
- aboutId: z12.string().nullable().default(null),
1521
+ aboutId: z11.string().nullable().default(null),
1546
1522
  /** Empty for a free-text question. */
1547
- options: z12.array(OptionSchema).default([]),
1548
- select: z12.enum(["one", "many", "rank", "confirm", "text"]).default("text"),
1549
- askedAt: z12.string(),
1523
+ options: z11.array(OptionSchema).default([]),
1524
+ select: z11.enum(["one", "many", "rank", "confirm", "text"]).default("text"),
1525
+ askedAt: z11.string(),
1550
1526
  /** Null while the question is open — which is how the page tells the two apart. */
1551
- answeredAt: z12.string().nullable().default(null),
1527
+ answeredAt: z11.string().nullable().default(null),
1552
1528
  /** The ruling in the person's own words, from the contribution that replied — not the
1553
1529
  * option id, which is not something anyone reads back. Null while it is open, and null
1554
1530
  * for a settled question whose reply carried nothing readable. */
1555
- answer: z12.string().nullable().default(null),
1531
+ answer: z11.string().nullable().default(null),
1556
1532
  /** The Goal this question belongs to — a step knows its Goal on its own, not only through
1557
1533
  * an `InboxItem`'s `communication.goalIds[0]` (docs/clients/app/walk/design.md §12 item 3).
1558
1534
  * READ BY `apps/client/src/walk/order.ts`, which stamps it onto every `WalkStep`: the walk's
1559
1535
  * order, its route, home's trees and the list of steps all take a step's Goal from here, so
1560
1536
  * this is the field they agree through rather than each re-deriving it from the row it
1561
1537
  * arrived under. Required because the API projects it on every need it sends. */
1562
- goalId: z12.string(),
1538
+ goalId: z11.string(),
1563
1539
  /** True only while an unmet START gate holds the Goal — a Goal that merely waits to
1564
1540
  * *finish* does not stop a person from answering (owner, 2026-09-16: "per need gate from
1565
1541
  * the API"; §4's dashed node). Not the same fact as `QueueItem.blocked`, which counts any
1566
1542
  * gate at all. */
1567
- blocked: z12.boolean().default(false)
1543
+ blocked: z11.boolean().default(false)
1568
1544
  });
1569
- var QueueReplySchema = z12.object({
1545
+ var QueueReplySchema = z11.object({
1570
1546
  /** The card this note was (`deliveryId:requestEntryId`, minted by the server like every card
1571
1547
  * id) — so the phone can tell a reply it just sent from one the queue already carries, and the
1572
1548
  * walk can name it in its zoom. */
1573
- id: z12.string(),
1549
+ id: z11.string(),
1574
1550
  /** The Goal the note is on. */
1575
- goalId: z12.string(),
1551
+ goalId: z11.string(),
1576
1552
  /** What the note said. */
1577
- note: z12.string(),
1553
+ note: z11.string(),
1578
1554
  /** Where it was carried — where a second reply goes (`POST /api/entries`, #2252). */
1579
- deliveryId: z12.string(),
1580
- requestEntryId: z12.string(),
1581
- askedAt: z12.string(),
1555
+ deliveryId: z11.string(),
1556
+ requestEntryId: z11.string(),
1557
+ askedAt: z11.string(),
1582
1558
  /** When the person last replied — the window's start. */
1583
- repliedAt: z12.string(),
1559
+ repliedAt: z11.string(),
1584
1560
  /** The person's latest words about it; null when there is nothing readable in them. */
1585
- reply: z12.string().nullable()
1561
+ reply: z11.string().nullable()
1586
1562
  });
1587
- var QueueItemSchema = z12.object({
1588
- id: z12.string(),
1563
+ var QueueItemSchema = z11.object({
1564
+ id: z11.string(),
1589
1565
  /** One-line headline — the first sentence of the outcome. */
1590
- title: z12.string(),
1566
+ title: z11.string(),
1591
1567
  /** The outcome in full, verbatim: the person's own words are what an assignee sees. */
1592
- intent: z12.string(),
1568
+ intent: z11.string(),
1593
1569
  /** `ready` | `active` | `waiting` | `done` | `cancelled`, straight off the Goal. */
1594
- state: z12.string(),
1570
+ state: z11.string(),
1595
1571
  /** Who holds it (a participant ref); null when nobody does yet. */
1596
- assignee: z12.string().nullable().default(null),
1572
+ assignee: z11.string().nullable().default(null),
1597
1573
  /** What the agent last said it was doing; null if it has said nothing. */
1598
- progress: z12.string().nullable().default(null),
1574
+ progress: z11.string().nullable().default(null),
1599
1575
  /** HOME'S LINE FOR THAT NOTE (owner, 2026-09-23): a few plain words one read wrote from `progress`,
1600
1576
  * served only while it was written for the current note. Null means show the Goal's name. */
1601
- progressLine: z12.string().nullable().optional(),
1602
- reviewPending: z12.boolean().default(false),
1603
- dueAt: z12.string().nullable().default(null),
1577
+ progressLine: z11.string().nullable().optional(),
1578
+ reviewPending: z11.boolean().default(false),
1579
+ dueAt: z11.string().nullable().default(null),
1604
1580
  /** WHEN ITS OWNER SAID DONE WHILE CHILDREN WERE OPEN (#2704): its own work is finished and it closes
1605
1581
  * with its last open child. Null otherwise; optional, so hand-built queues need not spell it. */
1606
- finishedAt: z12.string().nullable().optional(),
1582
+ finishedAt: z11.string().nullable().optional(),
1607
1583
  /** The Goal this one was opened under; null at the root. */
1608
- parentGoalId: z12.string().nullable().default(null),
1584
+ parentGoalId: z11.string().nullable().default(null),
1609
1585
  /** Goals opened under this one — only those the same list holds. */
1610
- childGoalIds: z12.array(z12.string()).default([]),
1586
+ childGoalIds: z11.array(z11.string()).default([]),
1611
1587
  /** Goals this one waits on (start or finish gates). */
1612
- dependencyGoalIds: z12.array(z12.string()).default([]),
1588
+ dependencyGoalIds: z11.array(z11.string()).default([]),
1613
1589
  /** True while any gate is on a Goal that is not done — the walk draws it dashed. */
1614
- blocked: z12.boolean().default(false),
1590
+ blocked: z11.boolean().default(false),
1615
1591
  /** Its questions: every OPEN one, and at most ten settled, newest settled first
1616
1592
  * (20260929133308) — the page decides which of them to show. NOT the whole set: `asked` and
1617
1593
  * `answered` are, and a settled one's words are a line (280 characters), its body read when the
1618
1594
  * question is opened. */
1619
- questions: z12.array(QueueQuestionSchema).default([]),
1595
+ questions: z11.array(QueueQuestionSchema).default([]),
1620
1596
  /** HOW MANY QUESTIONS THIS WORK HAS ASKED, and how many are answered — the Goal's own totals,
1621
1597
  * bounded at 100 server-side. A tally counted off `questions` is a wrong number that looks
1622
1598
  * right once the cap bites (`walk/trees.ts` `tallyOf`). Optional, and defaulted from the array
1623
1599
  * by the projection, so hand-built queues (fixtures, the demo) need not spell them. */
1624
- asked: z12.number().optional(),
1625
- answered: z12.number().optional(),
1600
+ asked: z11.number().optional(),
1601
+ answered: z11.number().optional(),
1626
1602
  /** Every note on it the person replied to (`QueueReplySchema`) — the page decides which to show.
1627
1603
  * Optional, not defaulted: absent is none, and every hand-built queue (fixtures, the demo) need
1628
1604
  * not spell an empty list. */
1629
- replies: z12.array(QueueReplySchema).optional(),
1605
+ replies: z11.array(QueueReplySchema).optional(),
1630
1606
  /** The repository or project identifier this Goal belongs to (#2280), null if untracked. */
1631
- repo: z12.string().nullable().optional(),
1632
- createdAt: z12.string(),
1633
- updatedAt: z12.string().nullable().default(null),
1607
+ repo: z11.string().nullable().optional(),
1608
+ createdAt: z11.string(),
1609
+ updatedAt: z11.string().nullable().default(null),
1634
1610
  /** When its owner last SAID something about it (the newest `progress` Entry: a contact update kept
1635
1611
  * as progress). `updatedAt` moves for reasons nobody chose — a
1636
1612
  * state recomputed, a review flag — so it cannot tell work in hand from work gone quiet. */
1637
- lastProgressAt: z12.string().nullable().optional(),
1613
+ lastProgressAt: z11.string().nullable().optional(),
1638
1614
  /** THE GOAL'S NEWEST WORD, FROM EITHER SIDE (owner, 2026-09-27): the newest Entry on it, of any
1639
1615
  * kind — what the person added ("Add to this"), their reply, the agent's ask or its progress
1640
1616
  * note. A progress note is an Entry, so this is already the newer of the two: the person's note
@@ -1653,7 +1629,14 @@ var QueueItemSchema = z12.object({
1653
1629
  * minute after the person speaks erases their instant from it, and the durable traces the client
1654
1630
  * can see (`replies`, `questions[].answeredAt`) miss a spontaneous note entirely — a `request`
1655
1631
  * Entry with no `about_id` is in neither. */
1656
- lastPersonAt: z12.string().nullable().optional(),
1632
+ lastPersonAt: z11.string().nullable().optional(),
1633
+ /** EACH SIDE'S NEWEST WORD IN THE LAST DAY (owner, 2026-10-13, the Work tab's order): the person's
1634
+ * (`yours`) and the agents' (`theirs`), each null when that side wrote nothing on it in 24 hours.
1635
+ * `latest` holds one Entry, so whichever side wrote first is hidden there; Work orders a Goal by
1636
+ * these two and draws the side it was placed by under its title. Optional, so hand-built queues
1637
+ * and a door older than 20261013045542 need not spell them. */
1638
+ yours: GoalLatestSchema.nullable().optional(),
1639
+ theirs: GoalLatestSchema.nullable().optional(),
1657
1640
  /** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
1658
1641
  * by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
1659
1642
  * incremental read knows a row has not moved: the phone echoes back the revs it holds
@@ -1664,40 +1647,40 @@ var QueueItemSchema = z12.object({
1664
1647
  * the row shows that no `updated_at` moves for (`active` lapsing, a dependency's state, a
1665
1648
  * sibling appearing in `childGoalIds`) cannot go unnoticed. Optional because a hand-built
1666
1649
  * queue (a fixture, the demo) spells none, and a row with no rev is simply always re-sent. */
1667
- rev: z12.string().optional()
1650
+ rev: z11.string().optional()
1668
1651
  });
1669
- var QueueDeltaSchema = z12.object({
1670
- ids: z12.array(z12.string()),
1671
- items: z12.array(QueueItemSchema)
1652
+ var QueueDeltaSchema = z11.object({
1653
+ ids: z11.array(z11.string()),
1654
+ items: z11.array(QueueItemSchema)
1672
1655
  });
1673
1656
  var COLD_AFTER_MS = 3 * 24 * 60 * 60 * 1e3;
1674
- var NoteSourceSchema = z12.enum(["app", "call"]);
1675
- var NoteStatusSchema = z12.enum(["open", "assigned", "in_progress", "done"]);
1676
- var NoteRepeatSchema = z12.enum(["once", "until_done"]);
1677
- var DecisionSchema = z12.object({
1678
- id: z12.string(),
1657
+ var NoteSourceSchema = z11.enum(["app", "call"]);
1658
+ var NoteStatusSchema = z11.enum(["open", "assigned", "in_progress", "done"]);
1659
+ var NoteRepeatSchema = z11.enum(["once", "until_done"]);
1660
+ var DecisionSchema = z11.object({
1661
+ id: z11.string(),
1679
1662
  /** The note this decision refines; null = recorded on a bare thread (the
1680
1663
  * extensibility seam — any conversation can accrue decisions). */
1681
- noteId: z12.string().nullable(),
1664
+ noteId: z11.string().nullable(),
1682
1665
  /** What was ambiguous — the broker's (or the user's own) question. */
1683
- question: z12.string(),
1666
+ question: z11.string(),
1684
1667
  /** The user's ruling; null while the question is open. */
1685
- answer: z12.string().nullable(),
1686
- decidedAt: z12.string().nullable(),
1687
- createdAt: z12.string()
1668
+ answer: z11.string().nullable(),
1669
+ decidedAt: z11.string().nullable(),
1670
+ createdAt: z11.string()
1688
1671
  });
1689
- var NoteSchema = z12.object({
1690
- id: z12.string(),
1672
+ var NoteSchema = z11.object({
1673
+ id: z11.string(),
1691
1674
  /** One-line headline (broker-titled; deterministic floor). */
1692
- title: z12.string(),
1675
+ title: z11.string(),
1693
1676
  /** The original intent, verbatim — assignees always see the user's own words. */
1694
- intent: z12.string(),
1677
+ intent: z11.string(),
1695
1678
  source: NoteSourceSchema,
1696
1679
  status: NoteStatusSchema,
1697
1680
  /** Who it was assigned to (a participant ref, 'agent:<tokenId>'); null = unassigned. */
1698
- assignee: z12.string().nullable(),
1681
+ assignee: z11.string().nullable(),
1699
1682
  /** The request thread minted at assignment; null until assigned. */
1700
- parentId: z12.string().nullable(),
1683
+ parentId: z11.string().nullable(),
1701
1684
  /** REMINDERS (docs/model/notes/reminders-design.md): the NOT-BEFORE this becomes eligible to ride a
1702
1685
  * call — never a deadline. It only ever comes from the user's own words, so when it
1703
1686
  * passes Paigy rings ONCE (#1293, owner 2026-08-26: a time said out loud is consent to
@@ -1706,100 +1689,100 @@ var NoteSchema = z12.object({
1706
1689
  // Defaulted, not required: a Note from an API deploy older than the reminders
1707
1690
  // migration has none of these, and the defaults ARE what it means — no not-before,
1708
1691
  // one ride, never ridden. Parsing must not fail across a rolling deploy.
1709
- dueAt: z12.string().nullable().default(null),
1692
+ dueAt: z11.string().nullable().default(null),
1710
1693
  repeat: NoteRepeatSchema.default("once"),
1711
1694
  /** How many calls have already carried it — the fatigue cap counts rides, not days. */
1712
- rides: z12.number().int().default(0),
1713
- lastRideAt: z12.string().nullable().default(null),
1714
- createdAt: z12.string()
1695
+ rides: z11.number().int().default(0),
1696
+ lastRideAt: z11.string().nullable().default(null),
1697
+ createdAt: z11.string()
1715
1698
  });
1716
- var DeliveryModeSchema = z12.enum(["poll", "self_hosted"]);
1717
- var RegisterDeliverySchema = z12.object({ mode: DeliveryModeSchema });
1718
- var OAuthStartSchema = z12.object({
1719
- provider: z12.enum(["cma"]),
1720
- returnTo: z12.string().min(1)
1699
+ var DeliveryModeSchema = z11.enum(["poll", "self_hosted"]);
1700
+ var RegisterDeliverySchema = z11.object({ mode: DeliveryModeSchema });
1701
+ var OAuthStartSchema = z11.object({
1702
+ provider: z11.enum(["cma"]),
1703
+ returnTo: z11.string().min(1)
1721
1704
  });
1722
- var DeliveryConfigSchema = z12.object({
1723
- tokenId: z12.string(),
1705
+ var DeliveryConfigSchema = z11.object({
1706
+ tokenId: z11.string(),
1724
1707
  mode: DeliveryModeSchema,
1725
1708
  /** null when the deployment has no anon key configured. `self_hosted` is then REFUSED
1726
1709
  * (503 `self_hosted_unavailable`) rather than registered, so a self_hosted config always
1727
1710
  * carries credentials; only a `poll` registration can come back with null here. */
1728
- realtime: z12.object({ url: z12.string(), anonKey: z12.string() }).nullable()
1711
+ realtime: z11.object({ url: z11.string(), anonKey: z11.string() }).nullable()
1729
1712
  });
1730
- var HostDecisionSchema = z12.object({
1713
+ var HostDecisionSchema = z11.object({
1731
1714
  /** The agent's token id: the row's `recipient`. */
1732
- agent: z12.string().uuid(),
1733
- decision: z12.enum(["stood_back", "took_over"]),
1715
+ agent: z11.string().uuid(),
1716
+ decision: z11.enum(["stood_back", "took_over"]),
1734
1717
  /** The work it was about: the Goal waiting on that agent next (`claimable` on its `contact({})` read). */
1735
- goalId: z12.string().uuid().nullable().optional(),
1718
+ goalId: z11.string().uuid().nullable().optional(),
1736
1719
  /** When the server last heard from the agent, as the host read it: the presence it stood back for. */
1737
- seenAt: z12.string().datetime().nullable().optional(),
1720
+ seenAt: z11.string().datetime().nullable().optional(),
1738
1721
  /** When that work last moved (`claimable.since` on an agent's `contact({})` read), the fact the bound is judged on. */
1739
- since: z12.string().datetime().nullable().optional(),
1722
+ since: z11.string().datetime().nullable().optional(),
1740
1723
  /** What the host said, in its log's own words: why it stood back, or what the take-over did. */
1741
- said: z12.string().max(300).optional()
1724
+ said: z11.string().max(300).optional()
1742
1725
  });
1743
- var WakeNudgeSchema = z12.object({
1744
- kind: z12.enum(["reply", "request", "callback"]),
1745
- notificationId: z12.string().optional(),
1746
- parentId: z12.string()
1726
+ var WakeNudgeSchema = z11.object({
1727
+ kind: z11.enum(["reply", "request", "callback"]),
1728
+ notificationId: z11.string().optional(),
1729
+ parentId: z11.string()
1747
1730
  });
1748
- var PairingStatusSchema = z12.enum(["pending", "approved", "denied", "expired"]);
1749
- var DeviceCodeSchema = z12.object({
1750
- device_code: z12.string(),
1751
- user_code: z12.string(),
1752
- verification_uri: z12.string().url(),
1753
- verification_uri_complete: z12.string().url(),
1754
- interval: z12.number(),
1755
- expires_in: z12.number()
1731
+ var PairingStatusSchema = z11.enum(["pending", "approved", "denied", "expired"]);
1732
+ var DeviceCodeSchema = z11.object({
1733
+ device_code: z11.string(),
1734
+ user_code: z11.string(),
1735
+ verification_uri: z11.string().url(),
1736
+ verification_uri_complete: z11.string().url(),
1737
+ interval: z11.number(),
1738
+ expires_in: z11.number()
1756
1739
  });
1757
- var DeviceInfoSchema = z12.object({
1758
- code: z12.string(),
1740
+ var DeviceInfoSchema = z11.object({
1741
+ code: z11.string(),
1759
1742
  /** The agent's suggested name (from /device/code) — shown on the approval screen,
1760
1743
  * pre-filling the name field the human can edit. */
1761
- name: z12.string(),
1744
+ name: z11.string(),
1762
1745
  /** @deprecated Legacy alias of `name` for the pre-#531 embedded bundle in App Store
1763
1746
  * build 35, whose DeviceFlow renders `info.agent.slice(0, 2)` — without this a FRESH
1764
1747
  * install crashes on the pairing screen on first launch, before the OTA lands
1765
1748
  * (seen live: PAIGY-5T, 2026-07-21). Remove once a newer binary is the floor. */
1766
- agent: z12.string().optional(),
1767
- device: z12.string().nullable(),
1749
+ agent: z11.string().optional(),
1750
+ device: z11.string().nullable(),
1768
1751
  status: PairingStatusSchema
1769
1752
  });
1770
- var DeviceTokenSchema = z12.object({
1771
- access_token: z12.string(),
1753
+ var DeviceTokenSchema = z11.object({
1754
+ access_token: z11.string(),
1772
1755
  /** The pairing's single name (user-typed at approval, the agent's suggestion, or
1773
1756
  * a default silly name). */
1774
- name: z12.string(),
1775
- device: z12.string().nullable(),
1757
+ name: z11.string(),
1758
+ device: z11.string().nullable(),
1776
1759
  /** The pairing's assigned voice, cached so the desktop can seed the SAME face the phone
1777
1760
  * draws — voice is the third ingredient of a hatchling's build (party/traits.ts). */
1778
- voice: z12.string().nullable().optional(),
1761
+ voice: z11.string().nullable().optional(),
1779
1762
  /** The token's server-side id — the face's COLOUR anchor, and the only seed ingredient
1780
1763
  * that survives a rename. Cached by the host's identity beat. */
1781
- token_id: z12.string().nullable().optional(),
1764
+ token_id: z11.string().nullable().optional(),
1782
1765
  /** WHERE this identity works — the folder a wake should land it in. Written by the host
1783
1766
  * at spawn and by `paigy-harness handoff` from a live terminal. Without it every wake
1784
1767
  * landed in the FIRST granted workspace and the agent rediscovered its own repo from
1785
1768
  * the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
1786
- workspace: z12.string().nullable().optional(),
1769
+ workspace: z11.string().nullable().optional(),
1787
1770
  /** Local host recovery must preserve the launch's runtime and Paigy identity. */
1788
- harness: z12.enum(["claude", "codex", "agy"]).optional(),
1789
- session_id: z12.string().uuid().optional(),
1771
+ harness: z11.enum(["claude", "codex", "agy"]).optional(),
1772
+ session_id: z11.string().uuid().optional(),
1790
1773
  /** A conversation the host must not resume: its context is full, so every turn fails
1791
1774
  * ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
1792
1775
  * whose resumable session is this one, so its Goals reach the dead-agent handoff instead of a
1793
1776
  * copy that types the person's words into a turn that cannot run (Calls, 2026-10-06). */
1794
- full_session: z12.string().optional(),
1795
- uik_pub: z12.string().nullable().optional()
1777
+ full_session: z11.string().optional(),
1778
+ uik_pub: z11.string().nullable().optional()
1796
1779
  });
1797
- var SupportRequestSchema = z12.object({
1798
- email: z12.string().email().max(320),
1799
- message: z12.string().trim().min(1).max(5e3),
1800
- name: z12.string().trim().max(120).optional()
1780
+ var SupportRequestSchema = z11.object({
1781
+ email: z11.string().email().max(320),
1782
+ message: z11.string().trim().min(1).max(5e3),
1783
+ name: z11.string().trim().max(120).optional()
1801
1784
  });
1802
- var NotificationFeedbackKindSchema = z12.enum([
1785
+ var NotificationFeedbackKindSchema = z11.enum([
1803
1786
  "break_down",
1804
1787
  // "This should be more than one ask — break it down."
1805
1788
  "regenerate_options",
@@ -1814,121 +1797,131 @@ var NotificationFeedbackKindSchema = z12.enum([
1814
1797
  // anything else — the note carries it.
1815
1798
  ]);
1816
1799
  var SlimOptionSchema = OptionSchema.omit({ html: true });
1817
- var QuestionRowSchema = z12.object({
1800
+ var QuestionRowSchema = z11.object({
1818
1801
  /** The card's id (`deliveryId:needId`, or `deliveryId:entryId` for an update), as the inbox mints it. */
1819
- id: z12.string(),
1820
- deliveryId: z12.string(),
1821
- entryId: z12.string(),
1802
+ id: z11.string(),
1803
+ deliveryId: z11.string(),
1804
+ entryId: z11.string(),
1822
1805
  /** The decision it waits on; null for an update, which asks nothing. */
1823
- needId: z12.string().nullable(),
1824
- goalIds: z12.array(z12.string()),
1806
+ needId: z11.string().nullable(),
1807
+ goalIds: z11.array(z11.string()),
1825
1808
  /** The name of the work it is about, when the read could word it. */
1826
- goalTitle: z12.string().optional(),
1827
- tokenId: z12.string().optional(),
1828
- name: z12.string(),
1829
- title: z12.string(),
1830
- body: z12.string(),
1831
- select: z12.enum(["one", "many", "rank", "confirm", "text"]),
1832
- options: z12.array(SlimOptionSchema),
1833
- hasPreview: z12.boolean(),
1834
- blocking: z12.boolean(),
1835
- askedAt: z12.string().datetime(),
1809
+ goalTitle: z11.string().optional(),
1810
+ tokenId: z11.string().optional(),
1811
+ name: z11.string(),
1812
+ title: z11.string(),
1813
+ body: z11.string(),
1814
+ select: z11.enum(["one", "many", "rank", "confirm", "text"]),
1815
+ options: z11.array(SlimOptionSchema),
1816
+ hasPreview: z11.boolean(),
1817
+ blocking: z11.boolean(),
1818
+ askedAt: z11.string().datetime(),
1836
1819
  ring: InboxItemSchema.shape.ring,
1837
- onCall: z12.literal(true).optional(),
1838
- sealed: z12.boolean()
1820
+ onCall: z11.literal(true).optional(),
1821
+ sealed: z11.boolean()
1839
1822
  });
1840
- var WorkStateSchema = z12.enum(["ready", "active", "waiting", "done", "cancelled"]);
1841
- var WorkRowSchema = z12.object({
1842
- id: z12.string(),
1843
- parentId: z12.string().nullable(),
1844
- title: z12.string(),
1823
+ var WorkStateSchema = z11.enum(["ready", "active", "waiting", "done", "cancelled"]);
1824
+ var WorkRowSchema = z11.object({
1825
+ id: z11.string(),
1826
+ parentId: z11.string().nullable(),
1827
+ title: z11.string(),
1845
1828
  /** Straight off the Goal. */
1846
1829
  state: WorkStateSchema,
1847
- owner: z12.string().nullable(),
1848
- revision: z12.number().int(),
1830
+ owner: z11.string().nullable(),
1831
+ revision: z11.number().int(),
1849
1832
  /** Open questions on it, counted to 100. */
1850
- waiting: z12.number().int(),
1833
+ waiting: z11.number().int(),
1851
1834
  /** Held by a gate on work that is not done. */
1852
- blocked: z12.boolean(),
1853
- lastProgressAt: z12.string().datetime().nullable(),
1835
+ blocked: z11.boolean(),
1836
+ lastProgressAt: z11.string().datetime().nullable(),
1854
1837
  /** The line written for its newest progress note, else that note's first words. */
1855
- line: z12.string().nullable(),
1838
+ line: z11.string().nullable(),
1856
1839
  /** Work directly under it, counted to 100; the list carries up to 12 of them. */
1857
- children: z12.number().int(),
1858
- createdAt: z12.string().datetime(),
1859
- updatedAt: z12.string().datetime(),
1840
+ children: z11.number().int(),
1841
+ createdAt: z11.string().datetime(),
1842
+ updatedAt: z11.string().datetime(),
1860
1843
  /** When anything at or under it last moved — the order the list is in. */
1861
- activeAt: z12.string().datetime(),
1844
+ activeAt: z11.string().datetime(),
1862
1845
  /** A sealed outcome has no title here; the work's page opens it. */
1863
- sealed: z12.boolean()
1846
+ sealed: z11.boolean()
1864
1847
  });
1865
1848
  var ComputerRowSchema = ConnectionSummarySchema.omit({ activity: true });
1866
1849
  var AgentRowSchema = ComputerRowSchema.extend({
1867
1850
  /** Open questions it is asking the person, over every open card; null when that read failed. */
1868
- asking: z12.number().int().nullable(),
1869
- oldestAskAt: z12.string().datetime().nullable(),
1851
+ asking: z11.number().int().nullable(),
1852
+ oldestAskAt: z11.string().datetime().nullable(),
1870
1853
  /** Up to three of the live Goals it holds, oldest first (the order it picks them up), and how
1871
1854
  * many in all among the account's 200 most recently active agent-held live Goals
1872
1855
  * (`agent_holds`); null when that read failed. */
1873
- holds: z12.array(z12.object({ id: z12.string(), title: z12.string() })).nullable(),
1874
- held: z12.number().int().nullable(),
1856
+ holds: z11.array(z11.object({ id: z11.string(), title: z11.string() })).nullable(),
1857
+ held: z11.number().int().nullable(),
1875
1858
  /** The earliest instant any Goal it holds went quiet, by the one rule (`coldSince`); null
1876
1859
  * while none has, or when that read failed. */
1877
- cold: z12.string().datetime().nullable(),
1860
+ cold: z11.string().datetime().nullable(),
1878
1861
  /** The newest line of its working log, and when the harness saw it. */
1879
- line: z12.string().nullable(),
1880
- lineAt: z12.string().datetime().nullable()
1862
+ line: z11.string().nullable(),
1863
+ lineAt: z11.string().datetime().nullable()
1881
1864
  });
1882
- var SnapshotSchema = z12.object({
1865
+ var SnapshotSchema = z11.object({
1883
1866
  /** The API's clock, taken before the first read: what a later delta will start from. */
1884
- at: z12.string().datetime(),
1885
- questions: z12.object({
1867
+ at: z11.string().datetime(),
1868
+ questions: z11.object({
1886
1869
  /** The newest 30 open cards, questions before updates. */
1887
- items: z12.array(QuestionRowSchema),
1870
+ items: z11.array(QuestionRowSchema),
1888
1871
  /** Every open question, and apart from them every update, and what was put off. */
1889
- total: z12.number().int(),
1890
- updates: z12.number().int(),
1891
- putOff: z12.number().int()
1872
+ total: z11.number().int(),
1873
+ updates: z11.number().int(),
1874
+ putOff: z11.number().int()
1892
1875
  }).nullable(),
1893
- agents: z12.object({
1876
+ agents: z11.object({
1894
1877
  /** Up to 60, most recently seen first. */
1895
- items: z12.array(AgentRowSchema),
1896
- more: z12.boolean()
1878
+ items: z11.array(AgentRowSchema),
1879
+ more: z11.boolean()
1897
1880
  }).nullable(),
1898
- work: z12.object({
1881
+ work: z11.object({
1899
1882
  /** The 60 most recently active roots, each followed by up to 12 children; 240 rows at most. */
1900
- items: z12.array(WorkRowSchema),
1883
+ items: z11.array(WorkRowSchema),
1901
1884
  /** How much work is behind each of the Work tab's four filters, each counted to 100, read with
1902
1885
  * the rows. `work_list` (20260928023533) owns the predicates: Live is `ready`, `active` or
1903
1886
  * `waiting`; Waiting on you is live work with an open question or an unmet gate; Not started
1904
1887
  * is `ready`; Done is `done` or `cancelled`. */
1905
- counts: z12.object({ live: z12.number().int(), waiting: z12.number().int(), notStarted: z12.number().int(), done: z12.number().int() })
1888
+ counts: z11.object({ live: z11.number().int(), waiting: z11.number().int(), notStarted: z11.number().int(), done: z11.number().int() })
1906
1889
  }).nullable(),
1907
- you: z12.object({
1890
+ you: z11.object({
1908
1891
  settings: UserSettingsSchema,
1909
- callable: z12.boolean(),
1892
+ callable: z11.boolean(),
1910
1893
  /** Up to 20 paired computers; null when the roster read failed. */
1911
- computers: z12.array(ComputerRowSchema).nullable()
1894
+ computers: z11.array(ComputerRowSchema).nullable()
1912
1895
  }).nullable()
1913
1896
  });
1914
- var CallRecapSchema = z12.object({
1915
- call: z12.object({
1916
- status: z12.string(),
1917
- startedAt: z12.string(),
1918
- durationMs: z12.number().nullable(),
1897
+ var CallRecapSchema = z11.object({
1898
+ call: z11.object({
1899
+ status: z11.string(),
1900
+ startedAt: z11.string(),
1901
+ durationMs: z11.number().nullable(),
1919
1902
  /** Bot-clock pickup offset; absent before the timestamp release, null before its report lands. */
1920
- pickupMs: z12.number().nullable().optional(),
1921
- agents: z12.array(z12.object({ id: z12.string(), name: z12.string().nullable() }))
1903
+ pickupMs: z11.number().nullable().optional(),
1904
+ agents: z11.array(z11.object({ id: z11.string(), name: z11.string().nullable() }))
1922
1905
  }),
1923
- topics: z12.array(z12.object({
1924
- goalId: z12.string().uuid(),
1925
- title: z12.string(),
1926
- owner: z12.string(),
1927
- state: z12.string(),
1906
+ topics: z11.array(z11.object({
1907
+ goalId: z11.string().uuid(),
1908
+ title: z11.string(),
1909
+ owner: z11.string(),
1910
+ state: z11.string(),
1911
+ /** Presented Entry content and its author, separately from the current Goal owner. */
1912
+ items: z11.array(z11.object({ entryId: z11.string(), author: z11.string(), text: z11.string(), summary: z11.string().nullable() })).optional(),
1928
1913
  /** Whether the call put it to the person. An item it carried and never said has no row on the
1929
1914
  * review (owner, 2026-10-08: "why do we get the third one when it didn't happen in the call?"). */
1930
- presented: z12.boolean(),
1931
- questions: z12.array(z12.object({ id: z12.string().uuid(), state: z12.string(), title: z12.string() })),
1915
+ presented: z11.boolean(),
1916
+ /** Whether THIS call created it — the third way a call touches work, beside carrying a request
1917
+ * there and filing words there (owner, 2026-10-08, Goal `5b4b1a0a`: "Show the new work, keep my
1918
+ * words under it"). Created work is never carried, so it is never `presented`; without this the
1919
+ * row is dropped by the "only what happened on the call" filter. False on a database before
1920
+ * 20261013080133. */
1921
+ created: z11.boolean(),
1922
+ /** `request` is the Entry that asked it — what a line's `about` names when the line answered or put
1923
+ * it off. Optional: an older API sent none. */
1924
+ questions: z11.array(z11.object({ id: z11.string().uuid(), state: z11.string(), title: z11.string(), request: z11.string().optional() })),
1932
1925
  /** `words` is always what they SAID, verbatim — the record, never replaced. `summary` is what
1933
1926
  * the line says in ten words (owner, 2026-10-07): the filer's, or the talker's for the answer it
1934
1927
  * gave, so the row scans like a chosen option and their own words stay under it. Absent when
@@ -1938,33 +1931,33 @@ var CallRecapSchema = z12.object({
1938
1931
  /** `reply` is the reply the line makes up (an answer, an ok, a deferral), so one reply is one row
1939
1932
  * however many lines it cites; `at` is the call lines it came from, so a filed line an answer already
1940
1933
  * said is not drawn again (owner, 2026-10-07: "fix them all"); `replyKind` says which replies are answers. */
1941
- lines: z12.array(z12.object({
1942
- entryId: z12.string().uuid(),
1943
- words: z12.string(),
1944
- summary: z12.string().optional(),
1945
- about: z12.string().nullable().optional(),
1946
- reply: z12.string().nullable().optional(),
1947
- replyKind: z12.string().nullable().optional(),
1948
- at: z12.array(z12.number()).optional()
1934
+ lines: z11.array(z11.object({
1935
+ entryId: z11.string().uuid(),
1936
+ words: z11.string(),
1937
+ summary: z11.string().optional(),
1938
+ about: z11.string().nullable().optional(),
1939
+ reply: z11.string().nullable().optional(),
1940
+ replyKind: z11.string().nullable().optional(),
1941
+ at: z11.array(z11.number()).optional()
1949
1942
  }))
1950
1943
  })),
1951
- unfiled: z12.array(z12.object({ lineId: z12.string().uuid(), words: z12.string(), atMs: z12.number() })),
1944
+ unfiled: z11.array(z11.object({ lineId: z11.string().uuid(), words: z11.string(), atMs: z11.number() })),
1952
1945
  /** THE PUBLIC TRANSCRIPT — every line said on the call, in the order it was said, and WHO SAID IT
1953
1946
  * (owner, 2026-10-08: "the public view should only have the lines and who said them, and that's
1954
1947
  * it"; `docs/brain/phase-three/modular.md` build step 3). `speaker` is the role: "user" is the
1955
1948
  * person, "agent" an agent speaking, named in `agent`. The timeline's action lines are ours, not
1956
1949
  * theirs, and are not here; nor is a sealed line, which the server has no words for. It stands
1957
1950
  * BESIDE `topics` and `unfiled` — what the call did with the words — never instead of them. */
1958
- said: z12.array(z12.object({
1959
- lineId: z12.string().uuid(),
1960
- speaker: z12.enum(["user", "agent"]),
1961
- agent: z12.object({ id: z12.string().nullable(), name: z12.string().nullable() }).nullable(),
1962
- words: z12.string(),
1963
- atMs: z12.number()
1951
+ said: z11.array(z11.object({
1952
+ lineId: z11.string().uuid(),
1953
+ speaker: z11.enum(["user", "agent"]),
1954
+ agent: z11.object({ id: z11.string().nullable(), name: z11.string().nullable() }).nullable(),
1955
+ words: z11.string(),
1956
+ atMs: z11.number()
1964
1957
  })),
1965
- more: z12.object({ lines: z12.number(), entries: z12.number(), topics: z12.number() }),
1958
+ more: z11.object({ lines: z11.number(), entries: z11.number(), topics: z11.number() }),
1966
1959
  /** Last stored position on this page when another exists; absent before paging shipped. */
1967
- next: z12.number().int().nonnegative().nullable().optional()
1960
+ next: z11.number().int().nonnegative().nullable().optional()
1968
1961
  });
1969
1962
 
1970
1963
  // src/listening.ts