@paigy/harness 0.3.46 → 0.3.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -23125,12 +23125,23 @@ var CATALOG = [
23125
23125
  loginHint: "Install and set up Antigravity (`agy`).",
23126
23126
  installCli: "curl -fsSL https://antigravity.dev/install.sh | bash",
23127
23127
  models: ["gemini-1.5-pro", "gemini-1.5-flash", "gemini-2.0-pro-exp"]
23128
+ },
23129
+ {
23130
+ name: "grok",
23131
+ label: "Grok",
23132
+ cli: "grok",
23133
+ // `grok agent stdio` speaks ACP itself. A separate adapter would be a second binary
23134
+ // to miss, and detection would report adapter-missing on a machine that can already launch.
23135
+ authProbe: ["sh", "-c", 'test -s "$HOME/.grok/auth.json"'],
23136
+ loginHint: "Run `grok` once in a terminal and sign in.",
23137
+ installCli: "curl -fsSL https://x.ai/cli/install.sh | bash"
23128
23138
  }
23129
23139
  ];
23130
23140
  function probeDirs(home = homedir()) {
23131
23141
  return [
23132
23142
  dirname(process.execPath),
23133
23143
  join(home, ".local", "bin"),
23144
+ join(home, ".grok", "bin"),
23134
23145
  "/usr/local/bin",
23135
23146
  "/opt/homebrew/bin",
23136
23147
  join(home, ".npm-global", "bin")
@@ -27222,7 +27233,7 @@ var coerce = {
27222
27233
  var NEVER = INVALID;
27223
27234
 
27224
27235
  // src/cli-args.ts
27225
- var USAGE = "usage: paigy-harness setup | pair | host [--grant DIR]\u2026 | service | enable-tools [--scope user|project] | hatch NAME [--voice KEY] [--slot SLOT] | launch NAME [--under GOAL] [--voice KEY] [--harness \u2026] [--mode \u2026] [--cwd DIR] BRIEF\u2026 | handoff | [--harness claude|codex|agy] [--mode bypass|ask] [--cwd DIR] [--grace SECONDS] [--doctor] PROMPT\u2026";
27236
+ var USAGE = "usage: paigy-harness setup | pair | host [--grant DIR]\u2026 | service | enable-tools [--scope user|project] | hatch NAME [--voice KEY] [--slot SLOT] | launch NAME [--under GOAL] [--voice KEY] [--harness \u2026] [--mode \u2026] [--cwd DIR] BRIEF\u2026 | handoff | [--harness claude|codex|agy|grok] [--mode bypass|ask] [--cwd DIR] [--grace SECONDS] [--doctor] PROMPT\u2026";
27226
27237
  function parseArgs(argv) {
27227
27238
  const args = { harness: "claude", mode: "bypass", cwd: process.cwd(), doctor: false, help: false, host: false, pair: false, service: false, setup: false, enableTools: false, scope: "user", grant: [], hatch: null, voice: null, slot: null, launch: null, under: null, graceSeconds: 90, prompt: "", handoff: false };
27228
27239
  const words = [];
@@ -27234,7 +27245,7 @@ function parseArgs(argv) {
27234
27245
  const next = () => argv[++i];
27235
27246
  if (arg === "--harness") {
27236
27247
  const v = next();
27237
- if (v !== "claude" && v !== "codex" && v !== "agy") return { error: `--harness must be claude, codex, or agy, got ${v ?? "nothing"}` };
27248
+ if (v !== "claude" && v !== "codex" && v !== "agy" && v !== "grok") return { error: `--harness must be claude, codex, agy, or grok, got ${v ?? "nothing"}` };
27238
27249
  args.harness = v;
27239
27250
  } else if (arg === "--mode") {
27240
27251
  const v = next();
@@ -27312,7 +27323,11 @@ var MCP_WIRES = [
27312
27323
  // written, codex sees a half-table and rejects it ("invalid transport"), and nothing at
27313
27324
  // all gets wired — which the old silent catch below hid entirely (found by QA 2026-09-06).
27314
27325
  { cli: "codex", name: "Codex", wire: "codex mcp add paigy -- npx -y @paigy/mcp@latest" },
27315
- { cli: "agy", name: "Antigravity", wire: "agy mcp list | grep -q '^paigy ' || agy mcp add paigy -- npx -y @paigy/mcp@latest" }
27326
+ { cli: "agy", name: "Antigravity", wire: "agy mcp list | grep -q '^paigy ' || agy mcp add paigy -- npx -y @paigy/mcp@latest" },
27327
+ // `grok mcp add` replaces, the same way `agy mcp add` does. List first. No PAIGY_AGENT:
27328
+ // a fixed name would glue every Grok chat into one slot. GROK_SESSION_ID is already
27329
+ // in the server's environment; sessionId() reads it.
27330
+ { cli: "grok", name: "Grok", wire: "grok mcp list | grep -q '^paigy' || grok mcp add paigy -- npx -y @paigy/mcp@latest" }
27316
27331
  ];
27317
27332
  var ENABLE_TOOLS_COMMAND = "npx -y -p @paigy/mcp@latest paigy-enable-tools";
27318
27333
  function onEnter(input, onLine) {
@@ -27465,7 +27480,7 @@ function parseSessionRecord(text) {
27465
27480
  return void 0;
27466
27481
  }
27467
27482
  function sessionId() {
27468
- return envSession("PAIGY_SESSION_ID") ?? claudeConversation() ?? envSession("CLAUDE_CODE_SESSION_ID") ?? envSession("CODEX_THREAD_ID") ?? envSession("CODEX_SESSION_ID") ?? // A Codex thread that was handed no id is its own agent, not the folder's (`underCodex`).
27483
+ return envSession("PAIGY_SESSION_ID") ?? claudeConversation() ?? envSession("CLAUDE_CODE_SESSION_ID") ?? envSession("GROK_SESSION_ID") ?? envSession("CODEX_THREAD_ID") ?? envSession("CODEX_SESSION_ID") ?? // A Codex thread that was handed no id is its own agent, not the folder's (`underCodex`).
27469
27484
  (underCodex() ? INSTANCE_ID : WORKSPACE_ID);
27470
27485
  }
27471
27486
  async function reach(url, init) {
@@ -28779,10 +28794,22 @@ function capRefusals(text, units22, field) {
28779
28794
  function refuseOverCaps(text, units22, field, ctx) {
28780
28795
  for (const { path, message, ...params } of capRefusals(text, units22, field)) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path, message, params });
28781
28796
  }
28797
+ var SHIPPED = ["phone", "calls", "server", "store", "agents"];
28798
+ var CAUSES_MAX = 10;
28799
+ var shipped = external_exports.enum(SHIPPED, {
28800
+ errorMap: () => ({ message: `shipped_unknown: one of ${SHIPPED.join(", ")}.` })
28801
+ }).optional().describe(
28802
+ "Only when this reports a result that LANDED somewhere the person can see it: phone (an app update reached their phone), calls (the voice bot), server, store (the App Store) or agents (the MCP or SDK). Leave it out for work in progress."
28803
+ );
28804
+ var causedBy = external_exports.array(
28805
+ external_exports.string().trim().regex(/^[0-9a-fA-F-]{8,36}$/, "cause_not_found: an Entry id, or the short id get_goals prints for the person's words.")
28806
+ ).min(1).max(CAUSES_MAX, `too_many_causes: at most ${CAUSES_MAX}.`).optional().describe(
28807
+ `The person's own words this acts on: the ids (or the short ids get_goals prints) of their answers or notes that led to it, at most ${CAUSES_MAX}. Their app shows each result under the words that caused it, so name every one this follows from. An id that is not their words is refused by name (cause_not_found, cause_ambiguous) and nothing is written.`
28808
+ );
28782
28809
  var COMPLETION_MESSAGE_MAX = 50;
28783
28810
  var CompletionSchema = external_exports.object({
28784
28811
  goalId: external_exports.string().uuid().describe("The existing Goal to complete."),
28785
- message: external_exports.string().trim().min(1).max(COMPLETION_MESSAGE_MAX, "completion_message_too_long: at most 50 characters; put detail in units.").describe("Completion headline, at most 50 characters."),
28812
+ message: external_exports.string().trim().min(1).max(COMPLETION_MESSAGE_MAX, "completion_message_too_long: at most 50 characters; put detail in units.").describe("Completion headline, at most 50 characters: the one thing that would go wrong or stay unclear later if they missed it."),
28786
28813
  units: external_exports.array(UnitInputSchema.extend({
28787
28814
  title: external_exports.string().trim().min(1).max(UNIT_TITLE_MAX),
28788
28815
  body: external_exports.string().trim().min(1).max(UNIT_BODY_MAX)
@@ -28791,17 +28818,19 @@ var CompletionSchema = external_exports.object({
28791
28818
  options: external_exports.array(external_exports.object({
28792
28819
  label: external_exports.string().trim().min(1).max(OPTION_LABEL_MAX),
28793
28820
  hint: external_exports.string().trim().min(1).max(OPTION_HINT_MAX)
28794
- }).strict()).max(5).optional().describe("Optional next steps the person may initiate: label (50 characters) and consequence in hint (200). Selecting one acknowledges the report and requests that step from its author; it never reopens this Goal.")
28821
+ }).strict()).max(5).optional().describe("Optional next steps the person may initiate: label (50 characters) and consequence in hint (200). Selecting one acknowledges the report and requests that step from its author; it never reopens this Goal."),
28822
+ causedBy,
28823
+ shipped
28795
28824
  }).strict();
28796
- var CompleteChangeSchema = CompletionSchema.extend({ kind: external_exports.literal("complete") });
28825
+ var CompleteChangeSchema = CompletionSchema.omit({ causedBy: true, shipped: true }).extend({ kind: external_exports.literal("complete") });
28797
28826
  var ASKING_RULES = `HOW TO ASK:
28798
28827
  1. One question per object in \`questions\`, so each is answered on its own.
28799
28828
  2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
28800
- 3. \`workItBlocks\` only when you are truly blocked: it asks for a call.
28829
+ 3. They asked you to call? \`userExplicitlyRequested:"call"\`; \`workItBlocks\` rings when blocked.
28801
28830
  4. No while-loops. While any Call is open, even one your question joined from their items, keep receiving through empty windows; otherwise stop at one: the answer reaches you on the Goal. Yield only with a listener or wakeup.
28802
28831
  5. One question, one row: never re-send one still waiting; take back one that no longer matters with \`withdrawQuestionIds\`.
28803
28832
  6. Read the Goal before asking; never re-ask what was answered or shipped. \`replied\` means they chose no option: it is still yours to settle.
28804
- 7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other". \`pickMode\`: one (default), many, rank.
28833
+ 7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
28805
28834
  8. A diagnosis says when, why and how it happens, then proposes one fix.
28806
28835
  9. Give a report its \`reply\`: one line in THEIR voice for THAT report, so you learn whether they verified it or only received it. Required when it is delivered or its Goal is done.`;
28807
28836
  function draft2020(node) {
@@ -28843,15 +28872,58 @@ var reason = external_exports.string().trim().min(1).max(500).describe("Why, as
28843
28872
  var actionFits = (b) => b.blocked.type === "goal" === (b.action !== "answer");
28844
28873
  var ACTION_FITS = "a goal is blocked from start or complete; a question from answer";
28845
28874
  var userExplicitlyRequested = external_exports.enum(["any", "call"]).optional().describe(
28846
- `Only what the person said about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal's progress unless the person needs it. Never set it to make a message louder.`
28875
+ 'What the person asked for about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal\'s progress unless the person needs it. ALSO "any" whenever this message directly answers a question they asked you, wherever they asked it -- on a call, in a reply, in passing: their question is the request, so it is delivered every time, even with no pending question of theirs on file and even if they never said to send it. A correction of something you or another agent told them is such an answer. Never set it to make a message louder. This is the field that rings a phone: "call" here is how you call them when they asked you to, and `help` has the whole mechanism.'
28847
28876
  );
28848
28877
  var units = external_exports.array(UnitInputSchema).optional().describe(
28849
- `The context this message needs, as up to ${UNITS_MAX} units in reading order, each {title, body}: a title of at most ${UNIT_TITLE_MAX} characters and a body of at most ${UNIT_BODY_MAX}. One idea per unit. Leave it out when the main text says it all. Over a cap is refused by name (ask_too_long, too_many_units, unit_title_too_long, unit_body_too_long) and nothing is sent.`
28878
+ `The context this message needs, as up to ${UNITS_MAX} units in reading order, each {title, body}: a title of at most ${UNIT_TITLE_MAX} characters and a body of at most ${UNIT_BODY_MAX}. One idea per unit: context they may open, never something they must hear. Leave it out when the main text says it all. Over a cap is refused by name (ask_too_long, too_many_units, unit_title_too_long, unit_body_too_long) and nothing is sent.`
28850
28879
  );
28880
+ var KIND_IDS = { "handing": "none", "replaced-by": "goal", "blocked-by": "node", "asking": "none", "found": "none" };
28881
+ var KIND_GRAMMAR = "handing, replaced-by <goalId>, blocked-by <goalId|questionId>, asking, found";
28882
+ var uuid = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
28883
+ var handle = /^[0-9a-fA-F-]{8,36}$/;
28884
+ function refuseKind(u, ctx) {
28885
+ if (!u.kind) return;
28886
+ const refuse = (refusal, kind, message) => ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kind"], params: { refusal, kind }, message });
28887
+ const [name, ...rest] = u.kind.trim().split(/\s+/);
28888
+ const shape = KIND_IDS[name];
28889
+ if (!shape) {
28890
+ refuse("kind_unknown", name, `kind_unknown: "${name}" is not a kind. One of: ${KIND_GRAMMAR}.`);
28891
+ return;
28892
+ }
28893
+ const id22 = rest.join(" ");
28894
+ if (shape === "none" && id22) {
28895
+ refuse("kind_takes_no_id", name, `kind_takes_no_id: "${name}" is the whole kind, so drop the "${id22}" after it.`);
28896
+ }
28897
+ if (shape !== "none" && !(shape === "goal" ? uuid.test(id22) : handle.test(id22))) {
28898
+ refuse("kind_needs_id", name, shape === "goal" ? `kind_needs_id: "${name}" names the Goal it is about, as "${name} <goalId>".` : `kind_needs_id: "${name}" names the Goal or Question it is about, as "${name} <goalId|questionId>".`);
28899
+ }
28900
+ if (name === "asking") {
28901
+ refuse("kind_is_a_question", name, 'kind_is_a_question: "asking" owes them an answer, so send it in `questions`, where it opens one.');
28902
+ }
28903
+ if (u.userExplicitlyRequested) {
28904
+ refuse("kind_not_for_the_person", name, `kind_not_for_the_person: "${name}" is written for the other agents on the Goal, and userExplicitlyRequested delivers these words to the person. Split it: one message for them, one for the agent.`);
28905
+ }
28906
+ }
28851
28907
  var UpdateInputSchema = external_exports.object({
28852
- message: external_exports.string().trim().min(1).describe(`The one point, at most ${ASK_MAX} characters; the context goes in units.`),
28908
+ // ONE LOAD-BEARING POINT PER REPORT (owner, 2026-10-27 14:10 on call, Goal 1b1750e9, settling
28909
+ // #3633's pacing: "one point at a time is better, but make sure that it's [load-]bearing ... if
28910
+ // there is a lot of key points that I need to be aware of ... meaning something bad would happen
28911
+ // if I didn't know them or I wouldn't be able to understand something in the future ... They
28912
+ // should go separately. Basically, it should be like one load-bearing thing per report").
28913
+ //
28914
+ // The call's half of that ruling shipped in #3771: the talker settles an item only once the
28915
+ // transcript shows he heard its load-bearing point. This is the author's half, and without it the
28916
+ // talker has to guess which of a report's parts was load-bearing. Measured 2026-11-01 on prod:
28917
+ // 458 of 866 reports in 21 days carried two or more units, and since the pacing shipped on 10-23
28918
+ // only 18 of 72 units that reached a call were ever said -- so a point written as a unit has about
28919
+ // a one-in-four chance of being heard, and one ok after the headline settles the whole report.
28920
+ // Hence the wording, not a `mustHear` flag (the-heard-record.md P3): he asked for less mechanism
28921
+ // and more judgment from the agent, so a point he must not miss is simply its own report.
28922
+ message: external_exports.string().trim().min(1).describe(`The one point, at most ${ASK_MAX} characters: the one thing that would go wrong or stay unclear later if they missed it, said as what changed for them, in their words ("The screen reader speaks Spanish too", not "Merged #3896"). A second point like that is its own update; the rest goes in units.`),
28853
28923
  goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals it is about, each one that exists: the one it is mainly about first."),
28854
28924
  units,
28925
+ causedBy,
28926
+ shipped,
28855
28927
  // A REPORT KEEPS ITS TAP (#2799, #3260; owner, 2026-10-08, settling #2776: "keep the reports open
28856
28928
  // until the user acknowledges them"). A report asks nothing, so it opens no Question -- but it
28857
28929
  // still waits to be acknowledged, and it carries the ONE tap that closes it. Never a decision: the
@@ -28875,6 +28947,12 @@ var UpdateInputSchema = external_exports.object({
28875
28947
  reply: external_exports.string().trim().min(1).describe(
28876
28948
  `What this report's button says instead of "Got it", at most ${OPTION_LABEL_MAX} characters, written in THEIR voice for THIS report ("Sounds good, I'll test later") -- the care you give a question's options, so what they tap tells you whether they verified your work or only received it. One tap sends exactly these words back to you. Words that would CHANGE what happens next are a question, not a reply to a report: it still asks nothing and still owes you no answer. The reply is required for requested delivery and completed Goals; ordinary progress may omit it.`
28877
28949
  ).optional(),
28950
+ // THE KIND, WHICH WAS THE FIRST LINE OF THE MESSAGE UNTIL NOW (`KIND_IDS` above). Optional on
28951
+ // purpose: every agent writing updates today sends none, and a door that refused them would turn a
28952
+ // convention nobody was obliged to follow into a 400 on live traffic.
28953
+ kind: external_exports.string().trim().min(1).optional().describe(
28954
+ `What an agent writing on ANOTHER agent's Goal expects of its reader, as one token: ${KIND_GRAMMAR}. \`handing\` the work is yours now, nothing is asked; \`replaced-by <goalId>\` this Goal is dead and that one carries its work; \`blocked-by <goalId|questionId>\` I cannot go on until that moves, no action unless you own it; \`found\` evidence on your Goal, nothing is asked and nothing has changed. \`asking\` is a question, so it belongs in \`questions\`, not here. It is written for the other agents on the Goal, never the person, so it does not go with userExplicitlyRequested; leave it out for your own progress. Refused by name (kind_unknown, kind_needs_id, kind_takes_no_id, kind_is_a_question, kind_not_for_the_person).`
28955
+ ),
28878
28956
  userExplicitlyRequested
28879
28957
  }).strict().superRefine((u, ctx) => {
28880
28958
  if (u.userExplicitlyRequested && !u.reply) {
@@ -28886,6 +28964,7 @@ var UpdateInputSchema = external_exports.object({
28886
28964
  });
28887
28965
  }
28888
28966
  refuseOverCaps(u.message, u.units, "message", ctx);
28967
+ refuseKind(u, ctx);
28889
28968
  if (u.reply && u.reply.length > OPTION_LABEL_MAX) {
28890
28969
  ctx.addIssue({
28891
28970
  code: external_exports.ZodIssueCode.custom,
@@ -28975,7 +29054,7 @@ var sendFields = {
28975
29054
  "COMPLETIONS close and report in one operation, the same contract as manage_goals kind:complete: closure and the report commit together or neither does. Required children and dependencies must already be finished. options suggest next steps: a tap acknowledges the report and requests that step, and never reopens the Goal (follow-up work needs a new one). No reviewer rejudges it: say only what your evidence supports. Ordinary updates never close a Goal."
28976
29055
  ),
28977
29056
  updates: external_exports.array(UpdateInputSchema).min(1).max(20).optional().describe(
28978
- "News: progress, findings, a result. An update asks nothing. It reaches the person only when they asked for it (userExplicitlyRequested), when it answers something they said, or once its Goal is done; otherwise it is recorded as the Goal's progress, which the person is not told. Every update reaches the other agents that wrote on its Goal in the last hour: to tell another agent something, write it as an update on that agent's Goal."
29057
+ "News: progress, findings, a result. An update asks nothing. It reaches the person only when they asked for it (userExplicitlyRequested), when it answers something they said, or once its Goal is done; otherwise it is recorded as the Goal's progress, which the person is not told. Every update reaches the other agents that wrote on its Goal in the last hour: to tell another agent something, write it as an update on that agent's Goal, with its `kind`.\n\nONE LOAD-BEARING POINT PER REPORT: the message is the point they must not miss; a second point that would go wrong or stay unclear later if they missed it is its own update, never a unit."
28979
29058
  ),
28980
29059
  answers: external_exports.array(AnswerInputSchema).min(1).max(20).optional().describe("Answers to Questions addressed to you."),
28981
29060
  withdrawQuestionIds: external_exports.array(questionHandle).min(1).max(10).optional().describe(
@@ -29013,19 +29092,20 @@ LENGTH: the question, message or answer is the one point, at most ${ASK_MAX} cha
29013
29092
  UPDATES ask nothing. One reaches the person only when they asked for it, it answers something they said, or its Goal is done; else it is kept as progress. One that reaches them joins an open report card or a live call.
29014
29093
 
29015
29094
  RECEIVING: contact({}) waits ~45 s; contact({wait:false}) returns \`events\` at once. Confirm the ones you handled with contact({ackEventIds}).`;
29016
- var HELP_TOPICS = ["pairing", "listening", "receiving", "asking", "updates", "goals", "calls"];
29095
+ var HELP_TOPICS = ["pairing", "listening", "receiving", "asking", "updates", "goals", "organize", "calls"];
29017
29096
  var unknownTopic = (topic) => `unknown_topic: ${JSON.stringify(topic)} is not a section of the guide. Topics: ${HELP_TOPICS.join(", ")}; or omit topic for the whole guide.`;
29018
29097
  var HelpSchema = external_exports.object({
29019
29098
  topic: external_exports.enum(HELP_TOPICS, { errorMap: (_issue, ctx) => ({ message: unknownTopic(ctx.data) }) }).optional().describe("One section of the guide. Omit it for the whole guide.")
29020
29099
  }).strict();
29021
- var HELP_DESCRIPTION = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals and calls. Pass a topic for one section. Read-only; needs no setup.";
29100
+ var HELP_DESCRIPTION = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals, organizing work, and calls. Pass a topic for one section. Read-only; needs no setup.";
29022
29101
  var AGENT_PROMPTS = [
29023
29102
  {
29024
29103
  name: "help",
29025
29104
  description: "How to use Paigy: the whole guide, or one topic of it.",
29026
29105
  arguments: [{ name: "topic", description: `One section: ${HELP_TOPICS.join(", ")}. Omit it for the whole guide.`, required: false }]
29027
29106
  },
29028
- { name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." }
29107
+ { name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." },
29108
+ { name: "organize", description: "Set up the person's work as a board: areas, projects and steps, proposed on a card before anything is built." }
29029
29109
  ];
29030
29110
  var CreateGoalSchema = external_exports.object({
29031
29111
  outcome: external_exports.string().trim().min(1).max(1e4),
@@ -29074,7 +29154,7 @@ var CreateChange = external_exports.object({
29074
29154
  title: goalTitle,
29075
29155
  outcome: goalOutcome,
29076
29156
  ownerId: external_exports.string().trim().min(1).optional().describe("Who owns the work: an agent's participant (as check_activity shows it) or the person's. Omitted: you."),
29077
- parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root."),
29157
+ parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root. A project with several parts: create it, then one child per step under it; the person's Work tab counts a project's progress in those steps."),
29078
29158
  sourceEntryIds: external_exports.array(external_exports.string().uuid()).max(20).optional().describe("The whole Entries the work came from, ones you can read.")
29079
29159
  }).strict();
29080
29160
  var EditChange = external_exports.object({ kind: external_exports.literal("edit"), goalId: changedGoal, title: goalTitle.optional(), outcome: goalOutcome.optional() }).strict();
@@ -29119,7 +29199,7 @@ var ManageGoalsSchema = external_exports.object({
29119
29199
  var ManageGoalsToolSchema = external_exports.object({
29120
29200
  changes: external_exports.array(external_exports.discriminatedUnion("kind", [CreateChange, CompleteChangeSchema, EditChange, StateChange, AssignChange, DeferChange, MoveChange, DependencyChange])).min(1).max(50).describe("The changes, applied in order, each on its own.")
29121
29201
  }).strict().superRefine((v, ctx) => editNames(v.changes, ctx));
29122
- var MANAGE_GOALS_DESCRIPTION = "Create, edit, assign, organize or close work. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
29202
+ var MANAGE_GOALS_DESCRIPTION = "Create, edit, assign, organize or close work. SHAPE IT AS PROJECTS WITH STEPS: create a project under its area (parentGoalId; a top-level Goal with children is an area), then each part as its child Goal, so the person sees N of M steps. Move a flat or orphaned Goal of yours into that shape when you touch it; a flat Goal is valid. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
29123
29203
  var GetGoalsSchema = external_exports.object({
29124
29204
  goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals to read, in order; one to ten IDs."),
29125
29205
  /** Every entry in full. Without it the read carries the person's words, open questions and your
@@ -29141,6 +29221,8 @@ var SearchToolSchema = external_exports.object({
29141
29221
  limit: external_exports.number().int().min(1).max(20).optional()
29142
29222
  }).strict();
29143
29223
  var SEARCH_DESCRIPTION = "Search your person's history across all of their agents: Entries (what anyone said or wrote, typed or spoken on a call), Goals (by title and outcome) and replies -- the person's answers, acknowledgements and deferrals (type answer; found by their summary, by the question or report they reply to, or by the words that gave them). query is words to look for; records sharing more of its words rank first, and exact names work. types narrows it to entry, goal and/or answer (default: all three). goalId searches under one Goal: its Entries, the replies to its items, and it and its immediate children. limit is matches per type, 1 to 20 (default 8). Read-only. Each match carries its whole saved words, its ID and its links (a reply carries its kind -- answered, acknowledged or deferred -- whether it is closed (a deferral is not), its summary in under ten words, its question or report, the choice made and the Entries that support it); `omitted` counts what matched but was left out, so narrow the words or add a goalId to see it. Nothing found is not proof that nothing exists; a refused search says why. Sealed (encrypted) content is never searched or returned.";
29224
+ var READS = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
29225
+ var SENDS = { readOnlyHint: false, destructiveHint: true, openWorldHint: false };
29144
29226
  var ConfigureIdentitySchema = external_exports.object({}).strict();
29145
29227
  var CONFIGURE_IDENTITY_DESCRIPTION = "Read this authenticated agent\u2019s current name, voice and token ID. Read-only; no arguments. Pairing, renaming and logout are available only through the local configure driver.";
29146
29228
  var CheckActivitySchema = external_exports.object({}).strict();
@@ -29152,16 +29234,16 @@ var SendFeedbackSchema = external_exports.object({
29152
29234
  }).strict();
29153
29235
  var SEND_FEEDBACK_DESCRIPTION = "Send feedback about Paigy itself (a bug report, an idea) straight to the Paigy team. Send it only when the person asked you to, or agreed when you offered: it goes to Paigy, never to the person, and nobody answers it here. Not for your work or a question for the person: use contact for those. Returns whether it was stored.";
29154
29236
  var AGENT_TOOLS = [
29155
- { name: "configure", description: CONFIGURE_IDENTITY_DESCRIPTION, inputSchema: mcpInputSchema(ConfigureIdentitySchema) },
29156
- { name: "contact", description: CONTACT_DESCRIPTION, inputSchema: CONTACT_SCHEMA },
29157
- { name: "manage_goals", description: MANAGE_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(ManageGoalsToolSchema) },
29158
- { name: "get_delivery", description: GET_DELIVERY_DESCRIPTION, inputSchema: mcpInputSchema(GetDeliverySchema) },
29159
- { name: "get_goals", description: GET_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(GetGoalsSchema) },
29160
- { name: "search", description: SEARCH_DESCRIPTION, inputSchema: mcpInputSchema(SearchToolSchema) },
29161
- { name: "check_activity", description: "Read your person's agents that contributed in the last 24 hours, newest first: at most 30 agents and their five most recently touched Goals, with their latest entry headline and time. Use get_goals to read a Goal and its other contributors before starting overlapping work. Read-only; no arguments.", inputSchema: mcpInputSchema(CheckActivitySchema) },
29162
- { name: "send_feedback", description: SEND_FEEDBACK_DESCRIPTION, inputSchema: mcpInputSchema(SendFeedbackSchema) },
29237
+ { name: "configure", title: "Who am I", annotations: READS, description: CONFIGURE_IDENTITY_DESCRIPTION, inputSchema: mcpInputSchema(ConfigureIdentitySchema) },
29238
+ { name: "contact", title: "Contact the person", annotations: SENDS, description: CONTACT_DESCRIPTION, inputSchema: CONTACT_SCHEMA },
29239
+ { name: "manage_goals", title: "Manage Goals", annotations: SENDS, description: MANAGE_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(ManageGoalsToolSchema) },
29240
+ { name: "get_delivery", title: "Read a delivery", annotations: READS, description: GET_DELIVERY_DESCRIPTION, inputSchema: mcpInputSchema(GetDeliverySchema) },
29241
+ { name: "get_goals", title: "Read Goals", annotations: READS, description: GET_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(GetGoalsSchema) },
29242
+ { name: "search", title: "Search history", annotations: READS, description: SEARCH_DESCRIPTION, inputSchema: mcpInputSchema(SearchToolSchema) },
29243
+ { name: "check_activity", title: "Recent agent activity", annotations: READS, description: "Read your person's agents that contributed in the last 24 hours, newest first: at most 30 agents and their five most recently touched Goals, with their latest entry headline and time. Use get_goals to read a Goal and its other contributors before starting overlapping work. Read-only; no arguments.", inputSchema: mcpInputSchema(CheckActivitySchema) },
29244
+ { name: "send_feedback", title: "Send feedback to Paigy", annotations: SENDS, description: SEND_FEEDBACK_DESCRIPTION, inputSchema: mcpInputSchema(SendFeedbackSchema) },
29163
29245
  // THE GUIDE FROM INSIDE THE MCP (owner, 2026-10-27): the skill's text, needing no identity (`help.ts`).
29164
- { name: "help", description: HELP_DESCRIPTION, inputSchema: mcpInputSchema(HelpSchema) }
29246
+ { name: "help", title: "Paigy guide", annotations: READS, description: HELP_DESCRIPTION, inputSchema: mcpInputSchema(HelpSchema) }
29165
29247
  ];
29166
29248
  var AGENT_TOOL_NAMES = AGENT_TOOLS.map((t) => t.name);
29167
29249
  var id = external_exports.string().uuid();
@@ -29265,6 +29347,10 @@ var BrainMessageSchema = external_exports.union([
29265
29347
  // WHAT IT ASKS THE AGENT, IN UNDER TEN WORDS (owner, 2026-10-15: "Yes, add the summary"): the talker's own, stored
29266
29348
  // as the sent Entry's summary, which the recap's "Sent to <agent>: …" row shows. Absent on results written before it.
29267
29349
  summary: external_exports.string().optional(),
29350
+ // THE PERSON'S LINES IT CARRIES, IN THEIR WORDS (owner, 2026-11-05: "just deliver my exact words to the agent"): the
29351
+ // `entries` keys of those lines, each relayed whole on the agent's Delivery (`context = false`), where the rest of
29352
+ // `entryKeys` ride as context. Absent on results written before it, and on a message that carries none.
29353
+ carries: external_exports.array(key).optional(),
29268
29354
  // THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
29269
29355
  // the call, and its next contact about it rings them (`public.callbacks`).
29270
29356
  callback: external_exports.literal(true).optional()
@@ -29328,8 +29414,11 @@ var TalkerReplySchema = external_exports.object({
29328
29414
  * "Yes, add the summary"), which the recap's "Sent to <agent>: …" row shows; `about` names
29329
29415
  * handles; `blocks` is the item a question to an agent must be answered before ("" for none);
29330
29416
  * `callback` is true on a message to the agent doing work the person asked to be called back about
29331
- * once it is done (false otherwise): that agent then owes the call (turns.md, step 0). */
29332
- messages: external_exports.array(external_exports.object({ key: str3, to: str3, sentences: strs2, text: str3, summary: str3, about: strs2, blocks: str3, callback: external_exports.boolean() }).strict()),
29417
+ * once it is done (false otherwise): that agent then owes the call (turns.md, step 0). `lines` are the
29418
+ * person's line handles a message to an agent carries ([] for none): the agent receives those lines, in their
29419
+ * words, and `text` is then only what the talker adds beyond them (owner, 2026-11-05: "just deliver my exact
29420
+ * words to the agent, keeping the summary as a way for me to navigate them more easily"). */
29421
+ messages: external_exports.array(external_exports.object({ key: str3, to: str3, sentences: strs2, text: str3, summary: str3, about: strs2, blocks: str3, callback: external_exports.boolean(), lines: strs2.optional() }).strict()),
29333
29422
  /** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
29334
29423
  then: external_exports.enum(["listen", "hold", "end"]),
29335
29424
  /** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
@@ -29347,9 +29436,14 @@ var TalkerReplySchema = external_exports.object({
29347
29436
  /** The handle of the item to explain ("" for none). */
29348
29437
  explain: str3
29349
29438
  }).strict();
29350
- var TALKER_REPLY_JSON_SCHEMA = (({ $schema: _, ...rest }) => rest)(
29439
+ var TALKER_REPLY_JSON_SCHEMA = withEveryMessageField((({ $schema: _, ...rest }) => rest)(
29351
29440
  zodToJsonSchema(TalkerReplySchema, { $refStrategy: "none" })
29352
- );
29441
+ ));
29442
+ function withEveryMessageField(schema) {
29443
+ const item = schema.properties?.messages?.items;
29444
+ if (item?.properties) item.required = Object.keys(item.properties);
29445
+ return schema;
29446
+ }
29353
29447
  var str4 = external_exports.string();
29354
29448
  var strs3 = external_exports.array(external_exports.string());
29355
29449
  var FilerReplySchema = external_exports.object({
@@ -29941,6 +30035,10 @@ var InboxItemSchema = external_exports.object({
29941
30035
  branch: external_exports.string().optional(),
29942
30036
  createdAt: external_exports.string().datetime(),
29943
30037
  snoozedUntil: external_exports.string().datetime().optional(),
30038
+ /** A past card the person dismissed that Restore can take back (#2699): its newest close is their
30039
+ * dismissal, with what it withdrew recorded (`private.restore_delivery`). Absent on everything else —
30040
+ * a put-off, a card an ended Goal or a settled question closed, and every open card. */
30041
+ restorable: external_exports.boolean().optional(),
29944
30042
  agentState: AgentStateSchema.default("idle"),
29945
30043
  /** Whose action the item is waiting on: "you" = an agent asked you (the default,
29946
30044
  * every agent→user notification); "agent" = you sent a request and it's awaiting the
@@ -30048,11 +30146,41 @@ var InboxItemSchema = external_exports.object({
30048
30146
  rev: external_exports.string().optional()
30049
30147
  });
30050
30148
  var APNS_TOKEN_RE = /^[0-9a-fA-F]{64}$/;
30149
+ var PushDeviceIdSchema = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,200}$/, "not an install id");
30150
+ var PushDeviceSchema = external_exports.object({
30151
+ deviceId: external_exports.string(),
30152
+ platform: external_exports.enum(["ios", "android"]),
30153
+ label: external_exports.string().nullable(),
30154
+ model: external_exports.string().nullable(),
30155
+ /** Calls and banners go here. */
30156
+ rings: external_exports.boolean(),
30157
+ /** It has a token a call can ring. */
30158
+ ringable: external_exports.boolean(),
30159
+ chosenAt: external_exports.string().nullable(),
30160
+ updatedAt: external_exports.string()
30161
+ });
30162
+ var PushTokenDeviceSchema = external_exports.object({
30163
+ deviceId: external_exports.string(),
30164
+ rings: external_exports.boolean(),
30165
+ ask: external_exports.boolean(),
30166
+ ringsOn: external_exports.object({ deviceId: external_exports.string().nullable(), label: external_exports.string().nullable() }).nullable()
30167
+ });
30168
+ var PushRingsSchema = external_exports.object({ rings: external_exports.boolean() });
30051
30169
  var PushTokenSchema = external_exports.object({
30052
30170
  voipToken: external_exports.string().min(1).optional(),
30053
30171
  alertToken: external_exports.string().min(1).optional(),
30054
30172
  fcmToken: external_exports.string().min(1).optional(),
30055
- platform: external_exports.enum(["ios", "android"])
30173
+ platform: external_exports.enum(["ios", "android"]),
30174
+ /** WHICH INSTALL POSTED IT (owner, 2026-11-05: "Ask on each new device"). Absent from every
30175
+ * build before it, and then the post is exactly what it always was: the one row per account.
30176
+ * With it, the install has its own row and calls ring only where the person chose. */
30177
+ deviceId: PushDeviceIdSchema.optional(),
30178
+ /** The install's name as the person knows it ("iPhone", "iPad"), and its model. */
30179
+ label: external_exports.string().trim().min(1).max(80).optional(),
30180
+ model: external_exports.string().trim().min(1).max(80).optional(),
30181
+ /** The person's choice, when the post carries it; absent, the install keeps what it has (and
30182
+ * its first ring token decides once: it rings unless another install already does). */
30183
+ rings: external_exports.boolean().optional()
30056
30184
  }).superRefine((v, ctx) => {
30057
30185
  if (v.platform !== "ios") return;
30058
30186
  for (const field of ["voipToken", "alertToken"]) {
@@ -30121,8 +30249,8 @@ var UserSettingsSchema = external_exports.object({
30121
30249
  * write, 'hosted' on read (see store.ts). */
30122
30250
  voiceMode: external_exports.enum(["hosted", "on_device"]).optional(),
30123
30251
  /** `talk` lived here until #2373: it gated auto-play, which went in #2374. An older bundle's
30124
- * `talk` is stripped like `silentPush` was; the `user_settings.talk` column outlives it until
30125
- * its own drop migration (#2373, step two). */
30252
+ * `talk` is stripped like `silentPush` was, and the `user_settings.talk` column went in
30253
+ * 20261028142255. */
30126
30254
  /** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
30127
30255
  * load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
30128
30256
  * newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
@@ -30162,7 +30290,11 @@ var GoalLatestSchema = external_exports.object({
30162
30290
  titles: external_exports.array(external_exports.string()).optional(),
30163
30291
  /** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
30164
30292
  * update's own line, before its units; the row caps it at 200. Absent on anything else. */
30165
- line: external_exports.string().optional()
30293
+ line: external_exports.string().optional(),
30294
+ /** THE PERSON'S ENTRIES IT CARRIED TO AN AGENT, IN THEIR WORDS (owner, 2026-11-05: "paraphrasing shouldn't change
30295
+ * attribution in the UI"): on a message Paigy sent an agent, the person's Entries its Delivery relays whole. A row
30296
+ * draws it as theirs. Absent on anything else, and from a door older than it. */
30297
+ carries: external_exports.array(external_exports.string()).optional()
30166
30298
  });
30167
30299
  var HistoryWorkSchema = external_exports.object({
30168
30300
  id: external_exports.string(),
@@ -30229,6 +30361,12 @@ var ConnectionSummarySchema = external_exports.object({
30229
30361
  * its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
30230
30362
  * `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
30231
30363
  lastWorkedAt: external_exports.string().datetime().nullable().optional(),
30364
+ /** A TERMINAL SESSION'S ONLY PULSE (`tokens.listened_at`): `paigy-listen` stamps it on every sweep
30365
+ * (90 s). It is deliberately NOT presence — `last_seen_at` is the desktop host's beat, and a
30366
+ * listener orphaned from a dead conversation must not light the live dot — but it is the one fact
30367
+ * that says a terminal session's process is UP, which is why the wake already reads it
30368
+ * (`wake.ts`, `listener`). Null = no listener sweeping. */
30369
+ listenedAt: external_exports.string().datetime().nullable().optional(),
30232
30370
  /** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
30233
30371
  * With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
30234
30372
  oldestReadyAt: external_exports.string().datetime().nullable().optional(),
@@ -30425,6 +30563,11 @@ var QueueItemSchema = external_exports.object({
30425
30563
  * and a door older than 20261013045542 need not spell them. */
30426
30564
  yours: GoalLatestSchema.nullable().optional(),
30427
30565
  theirs: GoalLatestSchema.nullable().optional(),
30566
+ /** ITS STEPS, COUNTED IN THE DATABASE (owner, 2026-11-04: "Count on the server, and agents make steps"): its
30567
+ * direct children that were not cancelled, and how many of them are done. The queue holds only a recent
30568
+ * slice of finished work, so counting `childGoalIds` read "0 of 1" for a project with five done. Absent
30569
+ * from a door older than this field, or when the count failed: the app then counts what it holds. */
30570
+ steps: external_exports.object({ total: external_exports.number().int().nonnegative(), done: external_exports.number().int().nonnegative() }).nullable().optional(),
30428
30571
  /** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
30429
30572
  * by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
30430
30573
  * incremental read knows a row has not moved: the phone echoes back the revs it holds
@@ -30558,7 +30701,7 @@ var DeviceTokenSchema = external_exports.object({
30558
30701
  * the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
30559
30702
  workspace: external_exports.string().nullable().optional(),
30560
30703
  /** Local host recovery must preserve the launch's runtime and Paigy identity. */
30561
- harness: external_exports.enum(["claude", "codex", "agy"]).optional(),
30704
+ harness: external_exports.enum(["claude", "codex", "agy", "grok"]).optional(),
30562
30705
  session_id: external_exports.string().uuid().optional(),
30563
30706
  /** A conversation the host must not resume: its context is full, so every turn fails
30564
30707
  * ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
@@ -30780,6 +30923,12 @@ var CallRecapSchema = external_exports.object({
30780
30923
  * summary (Brain, 2026-10-14). Optional: absent from an API before it. */
30781
30924
  filedOn: external_exports.array(external_exports.object({ goalId: external_exports.string().uuid(), title: external_exports.string() })).optional(),
30782
30925
  recorded: external_exports.boolean().optional(),
30926
+ /** On a `said` row: the agents the call SENT those words to, from the sending action's own
30927
+ * `about.agents` (20261106220220). The review's receipt is drawn from this and from the row's
30928
+ * own `requestId`, never from the asker of a question the words happened to sit under: on call
30929
+ * f9670f67 that asker was Interface while the send named Comms. `[]` or absent means nothing
30930
+ * was sent for that row, which is why the receipt is positive-only. */
30931
+ sentTo: external_exports.array(external_exports.object({ id: external_exports.string().nullable(), name: external_exports.string() })).optional(),
30783
30932
  settled: external_exports.object({ requestId: external_exports.string(), answer: external_exports.string() }).nullable().optional(),
30784
30933
  acknowledged: external_exports.boolean().optional(),
30785
30934
  /** On a `put` row: still waiting for the person's answer (not settled, not answered, not put off).
@@ -31078,6 +31227,10 @@ async function listConnections(opts = {}) {
31078
31227
  var NOT_SENT = `Recorded as the Goal's progress, not sent to the person; the other agents that wrote on the Goal in the last hour are told. The person is told only a question, an answer to one they asked you, and what you say once the Goal is done. To close the work, send contact.completions or manage_goals kind:complete with the shared completion report, closing and reporting together. If the person asked you, in so many words, to send them this, send it again with userExplicitlyRequested: "any" on that update.`;
31079
31228
  var APPLIED = "Applied; nothing was sent to the person.";
31080
31229
  var DEMOTED = "Delivered as a card, not a call: the person's settings do not allow a call right now (silent, quiet hours, or a mode). It has reached them; do not send it again.";
31230
+ function citeOf(receipt) {
31231
+ if (!receipt.uncited?.length) return {};
31232
+ return { uncited: receipt.uncited, ...receipt.cite ? { cite: receipt.cite } : {} };
31233
+ }
31081
31234
  async function readDelivery(deliveryId, opts = {}) {
31082
31235
  const query = opts.transcript ? `?transcript=1${opts.after ? `&after=${encodeURIComponent(opts.after)}` : ""}` : "";
31083
31236
  const res = await ensureAuthed(await (opts.reach ?? reach)(`${BACKEND_URL}/api/deliveries/${encodeURIComponent(deliveryId)}${query}`, {
@@ -31119,7 +31272,7 @@ async function contact(input, opts = {}) {
31119
31272
  const demoted = askedCall && receipt.channel && receipt.channel !== "call" ? DEMOTED : void 0;
31120
31273
  const acked = acknowledged ? { acknowledged } : {};
31121
31274
  if (!deliveries.length) {
31122
- return { sent: false, ok, results, ...recorded.length ? { recorded } : {}, message: recorded.length ? NOT_SENT : APPLIED, waitOutcome: "not_waited", ...acked };
31275
+ return { sent: false, ok, results, ...recorded.length ? { recorded } : {}, message: recorded.length ? NOT_SENT : APPLIED, waitOutcome: "not_waited", ...acked, ...citeOf(receipt) };
31123
31276
  }
31124
31277
  const lead = deliveries.find((d) => d.kind === "question") ?? deliveries[0];
31125
31278
  const read3 = async (signal2) => {
@@ -31136,7 +31289,8 @@ async function contact(input, opts = {}) {
31136
31289
  ...demoted ? { demoted } : {},
31137
31290
  ...acked,
31138
31291
  ...receipt.ringPolicy ? { ringPolicy: receipt.ringPolicy, ...receipt.message ? { ringHeld: receipt.message } : {} } : {},
31139
- ...receipt.recheckAt ? { recheckAt: receipt.recheckAt } : {}
31292
+ ...receipt.recheckAt ? { recheckAt: receipt.recheckAt } : {},
31293
+ ...citeOf(receipt)
31140
31294
  };
31141
31295
  };
31142
31296
  const settled = (d) => d.state === "closed" || d.answers.length > 0 || d.entries.some((e) => e.kind === "contribution" && !entryUnit(e));
@@ -31382,6 +31536,11 @@ import { resolve, delimiter as delimiter2, join as join5 } from "path";
31382
31536
  // src/harness/acp.ts
31383
31537
  var none = { events: [], writes: [] };
31384
31538
  var NOTHING_TO_RESUME = /* @__PURE__ */ new Set([-32002, -32601]);
31539
+ function nothingToResume(error) {
31540
+ if (!error || error.code === void 0) return false;
31541
+ if (NOTHING_TO_RESUME.has(error.code)) return true;
31542
+ return error.code === -32603 && (error.data?.code === "FS_NOT_FOUND" || /^Path not found\b/.test(error.message ?? ""));
31543
+ }
31385
31544
  function optionFor(options, decision) {
31386
31545
  const want = decision.allow ? "allow_once" : "reject_once";
31387
31546
  return options.find((o) => o.kind === want)?.optionId ?? null;
@@ -31518,11 +31677,11 @@ var AcpDriver = class {
31518
31677
  if (msg.id === this.sessionNewId) {
31519
31678
  this.sessionNewId = void 0;
31520
31679
  const resuming = this.resume !== void 0;
31521
- if (resuming && msg.error?.code !== void 0 && NOTHING_TO_RESUME.has(msg.error.code)) {
31680
+ if (resuming && nothingToResume(msg.error)) {
31522
31681
  this.resume = void 0;
31523
31682
  this.sessionNewId = this.nextId++;
31524
31683
  return {
31525
- events: [{ kind: "error", message: `session/resume found nothing to resume (${msg.error.message}) \u2014 opening a new conversation` }],
31684
+ events: [{ kind: "error", message: `session/resume found nothing to resume (${msg.error.message ?? "no message"}) \u2014 opening a new conversation` }],
31526
31685
  writes: [frame2(this.opening(this.sessionNewId))]
31527
31686
  };
31528
31687
  }
@@ -31722,8 +31881,16 @@ function inboxFor(root = INBOX_ROOT) {
31722
31881
  var ADAPTER_BIN = {
31723
31882
  claude: "claude-agent-acp",
31724
31883
  codex: "codex-acp",
31725
- agy: "paigy-agy-acp"
31884
+ agy: "paigy-agy-acp",
31885
+ grok: "grok"
31726
31886
  };
31887
+ function grokArgs(opts) {
31888
+ const args = ["agent"];
31889
+ if (opts.mode === "bypass") args.push("--always-approve");
31890
+ if (opts.model) args.push("--model", opts.model);
31891
+ args.push("stdio");
31892
+ return args;
31893
+ }
31727
31894
  var CLAUDE_ONE_WAY_IN = {
31728
31895
  env: { CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1" },
31729
31896
  disallowedTools: ["Monitor", "ScheduleWakeup", "CronCreate", "Workflow"]
@@ -31764,7 +31931,7 @@ function startSession(opts) {
31764
31931
  const inherited = [...savedVars.matchAll(/["']([A-Za-z_][A-Za-z0-9_]*)["']/g)].map((match) => match[1]);
31765
31932
  codexConfig[key3] = [.../* @__PURE__ */ new Set([...inherited, ...codexConfig[key3] ?? codexConfig.mcp_servers?.paigy?.env_vars ?? [], ...CODEX_ENV])];
31766
31933
  }
31767
- const child = (opts.spawnFn ?? spawn)(opts.bin ?? ADAPTER_BIN[opts.harness], [], {
31934
+ const child = (opts.spawnFn ?? spawn)(opts.bin ?? ADAPTER_BIN[opts.harness], opts.harness === "grok" ? grokArgs(opts) : [], {
31768
31935
  cwd,
31769
31936
  // The adapter shells out to its vendor CLI (`claude`, `codex`), and a GUI- or
31770
31937
  // launchd-launched process's PATH won't have it — probe dirs plus the RUNNING
@@ -33261,10 +33428,22 @@ function capRefusals2(text, units22, field) {
33261
33428
  function refuseOverCaps2(text, units22, field, ctx) {
33262
33429
  for (const { path, message, ...params } of capRefusals2(text, units22, field)) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path, message, params });
33263
33430
  }
33431
+ var SHIPPED2 = ["phone", "calls", "server", "store", "agents"];
33432
+ var CAUSES_MAX2 = 10;
33433
+ var shipped2 = external_exports.enum(SHIPPED2, {
33434
+ errorMap: () => ({ message: `shipped_unknown: one of ${SHIPPED2.join(", ")}.` })
33435
+ }).optional().describe(
33436
+ "Only when this reports a result that LANDED somewhere the person can see it: phone (an app update reached their phone), calls (the voice bot), server, store (the App Store) or agents (the MCP or SDK). Leave it out for work in progress."
33437
+ );
33438
+ var causedBy2 = external_exports.array(
33439
+ external_exports.string().trim().regex(/^[0-9a-fA-F-]{8,36}$/, "cause_not_found: an Entry id, or the short id get_goals prints for the person's words.")
33440
+ ).min(1).max(CAUSES_MAX2, `too_many_causes: at most ${CAUSES_MAX2}.`).optional().describe(
33441
+ `The person's own words this acts on: the ids (or the short ids get_goals prints) of their answers or notes that led to it, at most ${CAUSES_MAX2}. Their app shows each result under the words that caused it, so name every one this follows from. An id that is not their words is refused by name (cause_not_found, cause_ambiguous) and nothing is written.`
33442
+ );
33264
33443
  var COMPLETION_MESSAGE_MAX2 = 50;
33265
33444
  var CompletionSchema2 = external_exports.object({
33266
33445
  goalId: external_exports.string().uuid().describe("The existing Goal to complete."),
33267
- message: external_exports.string().trim().min(1).max(COMPLETION_MESSAGE_MAX2, "completion_message_too_long: at most 50 characters; put detail in units.").describe("Completion headline, at most 50 characters."),
33446
+ message: external_exports.string().trim().min(1).max(COMPLETION_MESSAGE_MAX2, "completion_message_too_long: at most 50 characters; put detail in units.").describe("Completion headline, at most 50 characters: the one thing that would go wrong or stay unclear later if they missed it."),
33268
33447
  units: external_exports.array(UnitInputSchema2.extend({
33269
33448
  title: external_exports.string().trim().min(1).max(UNIT_TITLE_MAX2),
33270
33449
  body: external_exports.string().trim().min(1).max(UNIT_BODY_MAX2)
@@ -33273,17 +33452,19 @@ var CompletionSchema2 = external_exports.object({
33273
33452
  options: external_exports.array(external_exports.object({
33274
33453
  label: external_exports.string().trim().min(1).max(OPTION_LABEL_MAX2),
33275
33454
  hint: external_exports.string().trim().min(1).max(OPTION_HINT_MAX2)
33276
- }).strict()).max(5).optional().describe("Optional next steps the person may initiate: label (50 characters) and consequence in hint (200). Selecting one acknowledges the report and requests that step from its author; it never reopens this Goal.")
33455
+ }).strict()).max(5).optional().describe("Optional next steps the person may initiate: label (50 characters) and consequence in hint (200). Selecting one acknowledges the report and requests that step from its author; it never reopens this Goal."),
33456
+ causedBy: causedBy2,
33457
+ shipped: shipped2
33277
33458
  }).strict();
33278
- var CompleteChangeSchema2 = CompletionSchema2.extend({ kind: external_exports.literal("complete") });
33459
+ var CompleteChangeSchema2 = CompletionSchema2.omit({ causedBy: true, shipped: true }).extend({ kind: external_exports.literal("complete") });
33279
33460
  var ASKING_RULES2 = `HOW TO ASK:
33280
33461
  1. One question per object in \`questions\`, so each is answered on its own.
33281
33462
  2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
33282
- 3. \`workItBlocks\` only when you are truly blocked: it asks for a call.
33463
+ 3. They asked you to call? \`userExplicitlyRequested:"call"\`; \`workItBlocks\` rings when blocked.
33283
33464
  4. No while-loops. While any Call is open, even one your question joined from their items, keep receiving through empty windows; otherwise stop at one: the answer reaches you on the Goal. Yield only with a listener or wakeup.
33284
33465
  5. One question, one row: never re-send one still waiting; take back one that no longer matters with \`withdrawQuestionIds\`.
33285
33466
  6. Read the Goal before asking; never re-ask what was answered or shipped. \`replied\` means they chose no option: it is still yours to settle.
33286
- 7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other". \`pickMode\`: one (default), many, rank.
33467
+ 7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
33287
33468
  8. A diagnosis says when, why and how it happens, then proposes one fix.
33288
33469
  9. Give a report its \`reply\`: one line in THEIR voice for THAT report, so you learn whether they verified it or only received it. Required when it is delivered or its Goal is done.`;
33289
33470
  function draft20202(node) {
@@ -33325,15 +33506,58 @@ var reason2 = external_exports.string().trim().min(1).max(500).describe("Why, as
33325
33506
  var actionFits2 = (b) => b.blocked.type === "goal" === (b.action !== "answer");
33326
33507
  var ACTION_FITS2 = "a goal is blocked from start or complete; a question from answer";
33327
33508
  var userExplicitlyRequested2 = external_exports.enum(["any", "call"]).optional().describe(
33328
- `Only what the person said about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal's progress unless the person needs it. Never set it to make a message louder.`
33509
+ 'What the person asked for about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal\'s progress unless the person needs it. ALSO "any" whenever this message directly answers a question they asked you, wherever they asked it -- on a call, in a reply, in passing: their question is the request, so it is delivered every time, even with no pending question of theirs on file and even if they never said to send it. A correction of something you or another agent told them is such an answer. Never set it to make a message louder. This is the field that rings a phone: "call" here is how you call them when they asked you to, and `help` has the whole mechanism.'
33329
33510
  );
33330
33511
  var units2 = external_exports.array(UnitInputSchema2).optional().describe(
33331
- `The context this message needs, as up to ${UNITS_MAX2} units in reading order, each {title, body}: a title of at most ${UNIT_TITLE_MAX2} characters and a body of at most ${UNIT_BODY_MAX2}. One idea per unit. Leave it out when the main text says it all. Over a cap is refused by name (ask_too_long, too_many_units, unit_title_too_long, unit_body_too_long) and nothing is sent.`
33512
+ `The context this message needs, as up to ${UNITS_MAX2} units in reading order, each {title, body}: a title of at most ${UNIT_TITLE_MAX2} characters and a body of at most ${UNIT_BODY_MAX2}. One idea per unit: context they may open, never something they must hear. Leave it out when the main text says it all. Over a cap is refused by name (ask_too_long, too_many_units, unit_title_too_long, unit_body_too_long) and nothing is sent.`
33332
33513
  );
33514
+ var KIND_IDS2 = { "handing": "none", "replaced-by": "goal", "blocked-by": "node", "asking": "none", "found": "none" };
33515
+ var KIND_GRAMMAR2 = "handing, replaced-by <goalId>, blocked-by <goalId|questionId>, asking, found";
33516
+ var uuid2 = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
33517
+ var handle2 = /^[0-9a-fA-F-]{8,36}$/;
33518
+ function refuseKind2(u, ctx) {
33519
+ if (!u.kind) return;
33520
+ const refuse = (refusal, kind, message) => ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kind"], params: { refusal, kind }, message });
33521
+ const [name, ...rest] = u.kind.trim().split(/\s+/);
33522
+ const shape = KIND_IDS2[name];
33523
+ if (!shape) {
33524
+ refuse("kind_unknown", name, `kind_unknown: "${name}" is not a kind. One of: ${KIND_GRAMMAR2}.`);
33525
+ return;
33526
+ }
33527
+ const id22 = rest.join(" ");
33528
+ if (shape === "none" && id22) {
33529
+ refuse("kind_takes_no_id", name, `kind_takes_no_id: "${name}" is the whole kind, so drop the "${id22}" after it.`);
33530
+ }
33531
+ if (shape !== "none" && !(shape === "goal" ? uuid2.test(id22) : handle2.test(id22))) {
33532
+ refuse("kind_needs_id", name, shape === "goal" ? `kind_needs_id: "${name}" names the Goal it is about, as "${name} <goalId>".` : `kind_needs_id: "${name}" names the Goal or Question it is about, as "${name} <goalId|questionId>".`);
33533
+ }
33534
+ if (name === "asking") {
33535
+ refuse("kind_is_a_question", name, 'kind_is_a_question: "asking" owes them an answer, so send it in `questions`, where it opens one.');
33536
+ }
33537
+ if (u.userExplicitlyRequested) {
33538
+ refuse("kind_not_for_the_person", name, `kind_not_for_the_person: "${name}" is written for the other agents on the Goal, and userExplicitlyRequested delivers these words to the person. Split it: one message for them, one for the agent.`);
33539
+ }
33540
+ }
33333
33541
  var UpdateInputSchema2 = external_exports.object({
33334
- message: external_exports.string().trim().min(1).describe(`The one point, at most ${ASK_MAX2} characters; the context goes in units.`),
33542
+ // ONE LOAD-BEARING POINT PER REPORT (owner, 2026-10-27 14:10 on call, Goal 1b1750e9, settling
33543
+ // #3633's pacing: "one point at a time is better, but make sure that it's [load-]bearing ... if
33544
+ // there is a lot of key points that I need to be aware of ... meaning something bad would happen
33545
+ // if I didn't know them or I wouldn't be able to understand something in the future ... They
33546
+ // should go separately. Basically, it should be like one load-bearing thing per report").
33547
+ //
33548
+ // The call's half of that ruling shipped in #3771: the talker settles an item only once the
33549
+ // transcript shows he heard its load-bearing point. This is the author's half, and without it the
33550
+ // talker has to guess which of a report's parts was load-bearing. Measured 2026-11-01 on prod:
33551
+ // 458 of 866 reports in 21 days carried two or more units, and since the pacing shipped on 10-23
33552
+ // only 18 of 72 units that reached a call were ever said -- so a point written as a unit has about
33553
+ // a one-in-four chance of being heard, and one ok after the headline settles the whole report.
33554
+ // Hence the wording, not a `mustHear` flag (the-heard-record.md P3): he asked for less mechanism
33555
+ // and more judgment from the agent, so a point he must not miss is simply its own report.
33556
+ message: external_exports.string().trim().min(1).describe(`The one point, at most ${ASK_MAX2} characters: the one thing that would go wrong or stay unclear later if they missed it, said as what changed for them, in their words ("The screen reader speaks Spanish too", not "Merged #3896"). A second point like that is its own update; the rest goes in units.`),
33335
33557
  goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals it is about, each one that exists: the one it is mainly about first."),
33336
33558
  units: units2,
33559
+ causedBy: causedBy2,
33560
+ shipped: shipped2,
33337
33561
  // A REPORT KEEPS ITS TAP (#2799, #3260; owner, 2026-10-08, settling #2776: "keep the reports open
33338
33562
  // until the user acknowledges them"). A report asks nothing, so it opens no Question -- but it
33339
33563
  // still waits to be acknowledged, and it carries the ONE tap that closes it. Never a decision: the
@@ -33357,6 +33581,12 @@ var UpdateInputSchema2 = external_exports.object({
33357
33581
  reply: external_exports.string().trim().min(1).describe(
33358
33582
  `What this report's button says instead of "Got it", at most ${OPTION_LABEL_MAX2} characters, written in THEIR voice for THIS report ("Sounds good, I'll test later") -- the care you give a question's options, so what they tap tells you whether they verified your work or only received it. One tap sends exactly these words back to you. Words that would CHANGE what happens next are a question, not a reply to a report: it still asks nothing and still owes you no answer. The reply is required for requested delivery and completed Goals; ordinary progress may omit it.`
33359
33583
  ).optional(),
33584
+ // THE KIND, WHICH WAS THE FIRST LINE OF THE MESSAGE UNTIL NOW (`KIND_IDS` above). Optional on
33585
+ // purpose: every agent writing updates today sends none, and a door that refused them would turn a
33586
+ // convention nobody was obliged to follow into a 400 on live traffic.
33587
+ kind: external_exports.string().trim().min(1).optional().describe(
33588
+ `What an agent writing on ANOTHER agent's Goal expects of its reader, as one token: ${KIND_GRAMMAR2}. \`handing\` the work is yours now, nothing is asked; \`replaced-by <goalId>\` this Goal is dead and that one carries its work; \`blocked-by <goalId|questionId>\` I cannot go on until that moves, no action unless you own it; \`found\` evidence on your Goal, nothing is asked and nothing has changed. \`asking\` is a question, so it belongs in \`questions\`, not here. It is written for the other agents on the Goal, never the person, so it does not go with userExplicitlyRequested; leave it out for your own progress. Refused by name (kind_unknown, kind_needs_id, kind_takes_no_id, kind_is_a_question, kind_not_for_the_person).`
33589
+ ),
33360
33590
  userExplicitlyRequested: userExplicitlyRequested2
33361
33591
  }).strict().superRefine((u, ctx) => {
33362
33592
  if (u.userExplicitlyRequested && !u.reply) {
@@ -33368,6 +33598,7 @@ var UpdateInputSchema2 = external_exports.object({
33368
33598
  });
33369
33599
  }
33370
33600
  refuseOverCaps2(u.message, u.units, "message", ctx);
33601
+ refuseKind2(u, ctx);
33371
33602
  if (u.reply && u.reply.length > OPTION_LABEL_MAX2) {
33372
33603
  ctx.addIssue({
33373
33604
  code: external_exports.ZodIssueCode.custom,
@@ -33457,7 +33688,7 @@ var sendFields2 = {
33457
33688
  "COMPLETIONS close and report in one operation, the same contract as manage_goals kind:complete: closure and the report commit together or neither does. Required children and dependencies must already be finished. options suggest next steps: a tap acknowledges the report and requests that step, and never reopens the Goal (follow-up work needs a new one). No reviewer rejudges it: say only what your evidence supports. Ordinary updates never close a Goal."
33458
33689
  ),
33459
33690
  updates: external_exports.array(UpdateInputSchema2).min(1).max(20).optional().describe(
33460
- "News: progress, findings, a result. An update asks nothing. It reaches the person only when they asked for it (userExplicitlyRequested), when it answers something they said, or once its Goal is done; otherwise it is recorded as the Goal's progress, which the person is not told. Every update reaches the other agents that wrote on its Goal in the last hour: to tell another agent something, write it as an update on that agent's Goal."
33691
+ "News: progress, findings, a result. An update asks nothing. It reaches the person only when they asked for it (userExplicitlyRequested), when it answers something they said, or once its Goal is done; otherwise it is recorded as the Goal's progress, which the person is not told. Every update reaches the other agents that wrote on its Goal in the last hour: to tell another agent something, write it as an update on that agent's Goal, with its `kind`.\n\nONE LOAD-BEARING POINT PER REPORT: the message is the point they must not miss; a second point that would go wrong or stay unclear later if they missed it is its own update, never a unit."
33461
33692
  ),
33462
33693
  answers: external_exports.array(AnswerInputSchema2).min(1).max(20).optional().describe("Answers to Questions addressed to you."),
33463
33694
  withdrawQuestionIds: external_exports.array(questionHandle2).min(1).max(10).optional().describe(
@@ -33495,19 +33726,20 @@ LENGTH: the question, message or answer is the one point, at most ${ASK_MAX2} ch
33495
33726
  UPDATES ask nothing. One reaches the person only when they asked for it, it answers something they said, or its Goal is done; else it is kept as progress. One that reaches them joins an open report card or a live call.
33496
33727
 
33497
33728
  RECEIVING: contact({}) waits ~45 s; contact({wait:false}) returns \`events\` at once. Confirm the ones you handled with contact({ackEventIds}).`;
33498
- var HELP_TOPICS2 = ["pairing", "listening", "receiving", "asking", "updates", "goals", "calls"];
33729
+ var HELP_TOPICS2 = ["pairing", "listening", "receiving", "asking", "updates", "goals", "organize", "calls"];
33499
33730
  var unknownTopic2 = (topic) => `unknown_topic: ${JSON.stringify(topic)} is not a section of the guide. Topics: ${HELP_TOPICS2.join(", ")}; or omit topic for the whole guide.`;
33500
33731
  var HelpSchema2 = external_exports.object({
33501
33732
  topic: external_exports.enum(HELP_TOPICS2, { errorMap: (_issue, ctx) => ({ message: unknownTopic2(ctx.data) }) }).optional().describe("One section of the guide. Omit it for the whole guide.")
33502
33733
  }).strict();
33503
- var HELP_DESCRIPTION2 = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals and calls. Pass a topic for one section. Read-only; needs no setup.";
33734
+ var HELP_DESCRIPTION2 = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals, organizing work, and calls. Pass a topic for one section. Read-only; needs no setup.";
33504
33735
  var AGENT_PROMPTS2 = [
33505
33736
  {
33506
33737
  name: "help",
33507
33738
  description: "How to use Paigy: the whole guide, or one topic of it.",
33508
33739
  arguments: [{ name: "topic", description: `One section: ${HELP_TOPICS2.join(", ")}. Omit it for the whole guide.`, required: false }]
33509
33740
  },
33510
- { name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." }
33741
+ { name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." },
33742
+ { name: "organize", description: "Set up the person's work as a board: areas, projects and steps, proposed on a card before anything is built." }
33511
33743
  ];
33512
33744
  var CreateGoalSchema2 = external_exports.object({
33513
33745
  outcome: external_exports.string().trim().min(1).max(1e4),
@@ -33556,7 +33788,7 @@ var CreateChange2 = external_exports.object({
33556
33788
  title: goalTitle2,
33557
33789
  outcome: goalOutcome2,
33558
33790
  ownerId: external_exports.string().trim().min(1).optional().describe("Who owns the work: an agent's participant (as check_activity shows it) or the person's. Omitted: you."),
33559
- parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root."),
33791
+ parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root. A project with several parts: create it, then one child per step under it; the person's Work tab counts a project's progress in those steps."),
33560
33792
  sourceEntryIds: external_exports.array(external_exports.string().uuid()).max(20).optional().describe("The whole Entries the work came from, ones you can read.")
33561
33793
  }).strict();
33562
33794
  var EditChange2 = external_exports.object({ kind: external_exports.literal("edit"), goalId: changedGoal2, title: goalTitle2.optional(), outcome: goalOutcome2.optional() }).strict();
@@ -33601,7 +33833,7 @@ var ManageGoalsSchema2 = external_exports.object({
33601
33833
  var ManageGoalsToolSchema2 = external_exports.object({
33602
33834
  changes: external_exports.array(external_exports.discriminatedUnion("kind", [CreateChange2, CompleteChangeSchema2, EditChange2, StateChange2, AssignChange2, DeferChange2, MoveChange2, DependencyChange2])).min(1).max(50).describe("The changes, applied in order, each on its own.")
33603
33835
  }).strict().superRefine((v, ctx) => editNames2(v.changes, ctx));
33604
- var MANAGE_GOALS_DESCRIPTION2 = "Create, edit, assign, organize or close work. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
33836
+ var MANAGE_GOALS_DESCRIPTION2 = "Create, edit, assign, organize or close work. SHAPE IT AS PROJECTS WITH STEPS: create a project under its area (parentGoalId; a top-level Goal with children is an area), then each part as its child Goal, so the person sees N of M steps. Move a flat or orphaned Goal of yours into that shape when you touch it; a flat Goal is valid. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
33605
33837
  var GetGoalsSchema2 = external_exports.object({
33606
33838
  goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals to read, in order; one to ten IDs."),
33607
33839
  /** Every entry in full. Without it the read carries the person's words, open questions and your
@@ -33623,6 +33855,8 @@ var SearchToolSchema2 = external_exports.object({
33623
33855
  limit: external_exports.number().int().min(1).max(20).optional()
33624
33856
  }).strict();
33625
33857
  var SEARCH_DESCRIPTION2 = "Search your person's history across all of their agents: Entries (what anyone said or wrote, typed or spoken on a call), Goals (by title and outcome) and replies -- the person's answers, acknowledgements and deferrals (type answer; found by their summary, by the question or report they reply to, or by the words that gave them). query is words to look for; records sharing more of its words rank first, and exact names work. types narrows it to entry, goal and/or answer (default: all three). goalId searches under one Goal: its Entries, the replies to its items, and it and its immediate children. limit is matches per type, 1 to 20 (default 8). Read-only. Each match carries its whole saved words, its ID and its links (a reply carries its kind -- answered, acknowledged or deferred -- whether it is closed (a deferral is not), its summary in under ten words, its question or report, the choice made and the Entries that support it); `omitted` counts what matched but was left out, so narrow the words or add a goalId to see it. Nothing found is not proof that nothing exists; a refused search says why. Sealed (encrypted) content is never searched or returned.";
33858
+ var READS2 = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
33859
+ var SENDS2 = { readOnlyHint: false, destructiveHint: true, openWorldHint: false };
33626
33860
  var ConfigureIdentitySchema2 = external_exports.object({}).strict();
33627
33861
  var CONFIGURE_IDENTITY_DESCRIPTION2 = "Read this authenticated agent\u2019s current name, voice and token ID. Read-only; no arguments. Pairing, renaming and logout are available only through the local configure driver.";
33628
33862
  var CheckActivitySchema2 = external_exports.object({}).strict();
@@ -33634,16 +33868,16 @@ var SendFeedbackSchema2 = external_exports.object({
33634
33868
  }).strict();
33635
33869
  var SEND_FEEDBACK_DESCRIPTION2 = "Send feedback about Paigy itself (a bug report, an idea) straight to the Paigy team. Send it only when the person asked you to, or agreed when you offered: it goes to Paigy, never to the person, and nobody answers it here. Not for your work or a question for the person: use contact for those. Returns whether it was stored.";
33636
33870
  var AGENT_TOOLS2 = [
33637
- { name: "configure", description: CONFIGURE_IDENTITY_DESCRIPTION2, inputSchema: mcpInputSchema2(ConfigureIdentitySchema2) },
33638
- { name: "contact", description: CONTACT_DESCRIPTION2, inputSchema: CONTACT_SCHEMA2 },
33639
- { name: "manage_goals", description: MANAGE_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(ManageGoalsToolSchema2) },
33640
- { name: "get_delivery", description: GET_DELIVERY_DESCRIPTION2, inputSchema: mcpInputSchema2(GetDeliverySchema2) },
33641
- { name: "get_goals", description: GET_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(GetGoalsSchema2) },
33642
- { name: "search", description: SEARCH_DESCRIPTION2, inputSchema: mcpInputSchema2(SearchToolSchema2) },
33643
- { name: "check_activity", description: "Read your person's agents that contributed in the last 24 hours, newest first: at most 30 agents and their five most recently touched Goals, with their latest entry headline and time. Use get_goals to read a Goal and its other contributors before starting overlapping work. Read-only; no arguments.", inputSchema: mcpInputSchema2(CheckActivitySchema2) },
33644
- { name: "send_feedback", description: SEND_FEEDBACK_DESCRIPTION2, inputSchema: mcpInputSchema2(SendFeedbackSchema2) },
33871
+ { name: "configure", title: "Who am I", annotations: READS2, description: CONFIGURE_IDENTITY_DESCRIPTION2, inputSchema: mcpInputSchema2(ConfigureIdentitySchema2) },
33872
+ { name: "contact", title: "Contact the person", annotations: SENDS2, description: CONTACT_DESCRIPTION2, inputSchema: CONTACT_SCHEMA2 },
33873
+ { name: "manage_goals", title: "Manage Goals", annotations: SENDS2, description: MANAGE_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(ManageGoalsToolSchema2) },
33874
+ { name: "get_delivery", title: "Read a delivery", annotations: READS2, description: GET_DELIVERY_DESCRIPTION2, inputSchema: mcpInputSchema2(GetDeliverySchema2) },
33875
+ { name: "get_goals", title: "Read Goals", annotations: READS2, description: GET_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(GetGoalsSchema2) },
33876
+ { name: "search", title: "Search history", annotations: READS2, description: SEARCH_DESCRIPTION2, inputSchema: mcpInputSchema2(SearchToolSchema2) },
33877
+ { name: "check_activity", title: "Recent agent activity", annotations: READS2, description: "Read your person's agents that contributed in the last 24 hours, newest first: at most 30 agents and their five most recently touched Goals, with their latest entry headline and time. Use get_goals to read a Goal and its other contributors before starting overlapping work. Read-only; no arguments.", inputSchema: mcpInputSchema2(CheckActivitySchema2) },
33878
+ { name: "send_feedback", title: "Send feedback to Paigy", annotations: SENDS2, description: SEND_FEEDBACK_DESCRIPTION2, inputSchema: mcpInputSchema2(SendFeedbackSchema2) },
33645
33879
  // THE GUIDE FROM INSIDE THE MCP (owner, 2026-10-27): the skill's text, needing no identity (`help.ts`).
33646
- { name: "help", description: HELP_DESCRIPTION2, inputSchema: mcpInputSchema2(HelpSchema2) }
33880
+ { name: "help", title: "Paigy guide", annotations: READS2, description: HELP_DESCRIPTION2, inputSchema: mcpInputSchema2(HelpSchema2) }
33647
33881
  ];
33648
33882
  var AGENT_TOOL_NAMES2 = AGENT_TOOLS2.map((t) => t.name);
33649
33883
  var id2 = external_exports.string().uuid();
@@ -33747,6 +33981,10 @@ var BrainMessageSchema2 = external_exports.union([
33747
33981
  // WHAT IT ASKS THE AGENT, IN UNDER TEN WORDS (owner, 2026-10-15: "Yes, add the summary"): the talker's own, stored
33748
33982
  // as the sent Entry's summary, which the recap's "Sent to <agent>: …" row shows. Absent on results written before it.
33749
33983
  summary: external_exports.string().optional(),
33984
+ // THE PERSON'S LINES IT CARRIES, IN THEIR WORDS (owner, 2026-11-05: "just deliver my exact words to the agent"): the
33985
+ // `entries` keys of those lines, each relayed whole on the agent's Delivery (`context = false`), where the rest of
33986
+ // `entryKeys` ride as context. Absent on results written before it, and on a message that carries none.
33987
+ carries: external_exports.array(key2).optional(),
33750
33988
  // THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
33751
33989
  // the call, and its next contact about it rings them (`public.callbacks`).
33752
33990
  callback: external_exports.literal(true).optional()
@@ -33810,8 +34048,11 @@ var TalkerReplySchema2 = external_exports.object({
33810
34048
  * "Yes, add the summary"), which the recap's "Sent to <agent>: …" row shows; `about` names
33811
34049
  * handles; `blocks` is the item a question to an agent must be answered before ("" for none);
33812
34050
  * `callback` is true on a message to the agent doing work the person asked to be called back about
33813
- * once it is done (false otherwise): that agent then owes the call (turns.md, step 0). */
33814
- messages: external_exports.array(external_exports.object({ key: str32, to: str32, sentences: strs22, text: str32, summary: str32, about: strs22, blocks: str32, callback: external_exports.boolean() }).strict()),
34051
+ * once it is done (false otherwise): that agent then owes the call (turns.md, step 0). `lines` are the
34052
+ * person's line handles a message to an agent carries ([] for none): the agent receives those lines, in their
34053
+ * words, and `text` is then only what the talker adds beyond them (owner, 2026-11-05: "just deliver my exact
34054
+ * words to the agent, keeping the summary as a way for me to navigate them more easily"). */
34055
+ messages: external_exports.array(external_exports.object({ key: str32, to: str32, sentences: strs22, text: str32, summary: str32, about: strs22, blocks: str32, callback: external_exports.boolean(), lines: strs22.optional() }).strict()),
33815
34056
  /** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
33816
34057
  then: external_exports.enum(["listen", "hold", "end"]),
33817
34058
  /** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
@@ -33829,9 +34070,14 @@ var TalkerReplySchema2 = external_exports.object({
33829
34070
  /** The handle of the item to explain ("" for none). */
33830
34071
  explain: str32
33831
34072
  }).strict();
33832
- var TALKER_REPLY_JSON_SCHEMA2 = (({ $schema: _, ...rest }) => rest)(
34073
+ var TALKER_REPLY_JSON_SCHEMA2 = withEveryMessageField2((({ $schema: _, ...rest }) => rest)(
33833
34074
  zodToJsonSchema2(TalkerReplySchema2, { $refStrategy: "none" })
33834
- );
34075
+ ));
34076
+ function withEveryMessageField2(schema) {
34077
+ const item = schema.properties?.messages?.items;
34078
+ if (item?.properties) item.required = Object.keys(item.properties);
34079
+ return schema;
34080
+ }
33835
34081
  var str42 = external_exports.string();
33836
34082
  var strs32 = external_exports.array(external_exports.string());
33837
34083
  var FilerReplySchema2 = external_exports.object({
@@ -34434,6 +34680,10 @@ var InboxItemSchema2 = external_exports.object({
34434
34680
  branch: external_exports.string().optional(),
34435
34681
  createdAt: external_exports.string().datetime(),
34436
34682
  snoozedUntil: external_exports.string().datetime().optional(),
34683
+ /** A past card the person dismissed that Restore can take back (#2699): its newest close is their
34684
+ * dismissal, with what it withdrew recorded (`private.restore_delivery`). Absent on everything else —
34685
+ * a put-off, a card an ended Goal or a settled question closed, and every open card. */
34686
+ restorable: external_exports.boolean().optional(),
34437
34687
  agentState: AgentStateSchema2.default("idle"),
34438
34688
  /** Whose action the item is waiting on: "you" = an agent asked you (the default,
34439
34689
  * every agent→user notification); "agent" = you sent a request and it's awaiting the
@@ -34541,11 +34791,41 @@ var InboxItemSchema2 = external_exports.object({
34541
34791
  rev: external_exports.string().optional()
34542
34792
  });
34543
34793
  var APNS_TOKEN_RE2 = /^[0-9a-fA-F]{64}$/;
34794
+ var PushDeviceIdSchema2 = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,200}$/, "not an install id");
34795
+ var PushDeviceSchema2 = external_exports.object({
34796
+ deviceId: external_exports.string(),
34797
+ platform: external_exports.enum(["ios", "android"]),
34798
+ label: external_exports.string().nullable(),
34799
+ model: external_exports.string().nullable(),
34800
+ /** Calls and banners go here. */
34801
+ rings: external_exports.boolean(),
34802
+ /** It has a token a call can ring. */
34803
+ ringable: external_exports.boolean(),
34804
+ chosenAt: external_exports.string().nullable(),
34805
+ updatedAt: external_exports.string()
34806
+ });
34807
+ var PushTokenDeviceSchema2 = external_exports.object({
34808
+ deviceId: external_exports.string(),
34809
+ rings: external_exports.boolean(),
34810
+ ask: external_exports.boolean(),
34811
+ ringsOn: external_exports.object({ deviceId: external_exports.string().nullable(), label: external_exports.string().nullable() }).nullable()
34812
+ });
34813
+ var PushRingsSchema2 = external_exports.object({ rings: external_exports.boolean() });
34544
34814
  var PushTokenSchema2 = external_exports.object({
34545
34815
  voipToken: external_exports.string().min(1).optional(),
34546
34816
  alertToken: external_exports.string().min(1).optional(),
34547
34817
  fcmToken: external_exports.string().min(1).optional(),
34548
- platform: external_exports.enum(["ios", "android"])
34818
+ platform: external_exports.enum(["ios", "android"]),
34819
+ /** WHICH INSTALL POSTED IT (owner, 2026-11-05: "Ask on each new device"). Absent from every
34820
+ * build before it, and then the post is exactly what it always was: the one row per account.
34821
+ * With it, the install has its own row and calls ring only where the person chose. */
34822
+ deviceId: PushDeviceIdSchema2.optional(),
34823
+ /** The install's name as the person knows it ("iPhone", "iPad"), and its model. */
34824
+ label: external_exports.string().trim().min(1).max(80).optional(),
34825
+ model: external_exports.string().trim().min(1).max(80).optional(),
34826
+ /** The person's choice, when the post carries it; absent, the install keeps what it has (and
34827
+ * its first ring token decides once: it rings unless another install already does). */
34828
+ rings: external_exports.boolean().optional()
34549
34829
  }).superRefine((v, ctx) => {
34550
34830
  if (v.platform !== "ios") return;
34551
34831
  for (const field of ["voipToken", "alertToken"]) {
@@ -34614,8 +34894,8 @@ var UserSettingsSchema2 = external_exports.object({
34614
34894
  * write, 'hosted' on read (see store.ts). */
34615
34895
  voiceMode: external_exports.enum(["hosted", "on_device"]).optional(),
34616
34896
  /** `talk` lived here until #2373: it gated auto-play, which went in #2374. An older bundle's
34617
- * `talk` is stripped like `silentPush` was; the `user_settings.talk` column outlives it until
34618
- * its own drop migration (#2373, step two). */
34897
+ * `talk` is stripped like `silentPush` was, and the `user_settings.talk` column went in
34898
+ * 20261028142255. */
34619
34899
  /** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
34620
34900
  * load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
34621
34901
  * newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
@@ -34655,7 +34935,11 @@ var GoalLatestSchema2 = external_exports.object({
34655
34935
  titles: external_exports.array(external_exports.string()).optional(),
34656
34936
  /** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
34657
34937
  * update's own line, before its units; the row caps it at 200. Absent on anything else. */
34658
- line: external_exports.string().optional()
34938
+ line: external_exports.string().optional(),
34939
+ /** THE PERSON'S ENTRIES IT CARRIED TO AN AGENT, IN THEIR WORDS (owner, 2026-11-05: "paraphrasing shouldn't change
34940
+ * attribution in the UI"): on a message Paigy sent an agent, the person's Entries its Delivery relays whole. A row
34941
+ * draws it as theirs. Absent on anything else, and from a door older than it. */
34942
+ carries: external_exports.array(external_exports.string()).optional()
34659
34943
  });
34660
34944
  var HistoryWorkSchema2 = external_exports.object({
34661
34945
  id: external_exports.string(),
@@ -34722,6 +35006,12 @@ var ConnectionSummarySchema2 = external_exports.object({
34722
35006
  * its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
34723
35007
  * `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
34724
35008
  lastWorkedAt: external_exports.string().datetime().nullable().optional(),
35009
+ /** A TERMINAL SESSION'S ONLY PULSE (`tokens.listened_at`): `paigy-listen` stamps it on every sweep
35010
+ * (90 s). It is deliberately NOT presence — `last_seen_at` is the desktop host's beat, and a
35011
+ * listener orphaned from a dead conversation must not light the live dot — but it is the one fact
35012
+ * that says a terminal session's process is UP, which is why the wake already reads it
35013
+ * (`wake.ts`, `listener`). Null = no listener sweeping. */
35014
+ listenedAt: external_exports.string().datetime().nullable().optional(),
34725
35015
  /** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
34726
35016
  * With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
34727
35017
  oldestReadyAt: external_exports.string().datetime().nullable().optional(),
@@ -34918,6 +35208,11 @@ var QueueItemSchema2 = external_exports.object({
34918
35208
  * and a door older than 20261013045542 need not spell them. */
34919
35209
  yours: GoalLatestSchema2.nullable().optional(),
34920
35210
  theirs: GoalLatestSchema2.nullable().optional(),
35211
+ /** ITS STEPS, COUNTED IN THE DATABASE (owner, 2026-11-04: "Count on the server, and agents make steps"): its
35212
+ * direct children that were not cancelled, and how many of them are done. The queue holds only a recent
35213
+ * slice of finished work, so counting `childGoalIds` read "0 of 1" for a project with five done. Absent
35214
+ * from a door older than this field, or when the count failed: the app then counts what it holds. */
35215
+ steps: external_exports.object({ total: external_exports.number().int().nonnegative(), done: external_exports.number().int().nonnegative() }).nullable().optional(),
34921
35216
  /** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
34922
35217
  * by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
34923
35218
  * incremental read knows a row has not moved: the phone echoes back the revs it holds
@@ -35049,7 +35344,7 @@ var DeviceTokenSchema2 = external_exports.object({
35049
35344
  * the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
35050
35345
  workspace: external_exports.string().nullable().optional(),
35051
35346
  /** Local host recovery must preserve the launch's runtime and Paigy identity. */
35052
- harness: external_exports.enum(["claude", "codex", "agy"]).optional(),
35347
+ harness: external_exports.enum(["claude", "codex", "agy", "grok"]).optional(),
35053
35348
  session_id: external_exports.string().uuid().optional(),
35054
35349
  /** A conversation the host must not resume: its context is full, so every turn fails
35055
35350
  * ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
@@ -35271,6 +35566,12 @@ var CallRecapSchema2 = external_exports.object({
35271
35566
  * summary (Brain, 2026-10-14). Optional: absent from an API before it. */
35272
35567
  filedOn: external_exports.array(external_exports.object({ goalId: external_exports.string().uuid(), title: external_exports.string() })).optional(),
35273
35568
  recorded: external_exports.boolean().optional(),
35569
+ /** On a `said` row: the agents the call SENT those words to, from the sending action's own
35570
+ * `about.agents` (20261106220220). The review's receipt is drawn from this and from the row's
35571
+ * own `requestId`, never from the asker of a question the words happened to sit under: on call
35572
+ * f9670f67 that asker was Interface while the send named Comms. `[]` or absent means nothing
35573
+ * was sent for that row, which is why the receipt is positive-only. */
35574
+ sentTo: external_exports.array(external_exports.object({ id: external_exports.string().nullable(), name: external_exports.string() })).optional(),
35274
35575
  settled: external_exports.object({ requestId: external_exports.string(), answer: external_exports.string() }).nullable().optional(),
35275
35576
  acknowledged: external_exports.boolean().optional(),
35276
35577
  /** On a `put` row: still waiting for the person's answer (not settled, not answered, not put off).
@@ -36083,7 +36384,7 @@ function runHarness(opts) {
36083
36384
  opts.log("\u25B6 running again after the limit");
36084
36385
  LIMITS.running(name, (text) => callForResume(text, state, rail), opts.log);
36085
36386
  }
36086
- async function handle(event) {
36387
+ async function handle3(event) {
36087
36388
  if (event.kind === "error") {
36088
36389
  opts.log(`\u26A0 ${event.message}`);
36089
36390
  if (event.fatal && running) {
@@ -36142,7 +36443,7 @@ ${event.message}`, state, rail, { log: opts.log });
36142
36443
  inbox?.close();
36143
36444
  opts.onExit?.();
36144
36445
  },
36145
- onEvent: (event) => void handle(event).catch((err) => opts.log(`\u26A0 ${err.message}`))
36446
+ onEvent: (event) => void handle3(event).catch((err) => opts.log(`\u26A0 ${err.message}`))
36146
36447
  });
36147
36448
  void pump(session, state, rail, { onIdle: () => running, beat: clock4, initialPrompt: opts.prompt, log: opts.log, ...inbox ? { inbox } : {} }).catch(
36148
36449
  (e) => opts.log(`\u26A0 conversation loop stopped: ${e.message}`)
@@ -36576,7 +36877,7 @@ function selfUpdater(deps) {
36576
36877
  var HOST_FILE = join10(homedir8(), ".paigy", "host.json");
36577
36878
  function wakeHarness(slot, saved, claudeTranscript) {
36578
36879
  if (slot === "Desktop") return void 0;
36579
- if (saved !== null) return saved === "agy" || saved === "codex" || saved === "claude" ? saved : void 0;
36880
+ if (saved !== null) return saved === "agy" || saved === "codex" || saved === "claude" || saved === "grok" ? saved : void 0;
36580
36881
  if (claudeTranscript) return "claude";
36581
36882
  if (slot === "mcp-agent" || slot === "Claude Code") return "claude";
36582
36883
  if (slot === "codex") return "codex";
@@ -37277,10 +37578,11 @@ async function main() {
37277
37578
  console.log(`\u26A0 could not wire ${t.cli} (${e.message.split("\n")[0]}) \u2014 its agents cannot reach you until it is: ${t.wire}`);
37278
37579
  }
37279
37580
  }
37280
- if (which("claude")) {
37581
+ if (which("claude") || which("grok")) {
37281
37582
  try {
37282
37583
  execSync2(ENABLE_TOOLS_COMMAND, { stdio: "ignore", shell: "/bin/sh" });
37283
- console.log("\u2713 Paigy's tools allowlisted in Claude Code (they won't prompt each time)");
37584
+ if (which("claude")) console.log("\u2713 Paigy's tools allowlisted in Claude Code (they won't prompt each time)");
37585
+ if (which("grok")) console.log("\u2713 Grok will be told to listen, and reminded when a turn stalls");
37284
37586
  } catch {
37285
37587
  console.log(` allowlist it later with: paigy-harness enable-tools`);
37286
37588
  }