@paigy/harness 0.3.46 → 0.3.47
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/README.md +5 -5
- package/dist/cli.js +237 -51
- package/dist/main.js +227 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ other errors, and a failed recovery remain visible failures. Diagnostics name th
|
|
|
11
11
|
recovery attempt, and outcome. This mitigates the vendor stream failure; it does not repair
|
|
12
12
|
Antigravity's internal broadcaster. Keep verbose command output in files and read bounded summaries.
|
|
13
13
|
|
|
14
|
-
Runs Claude Code, Codex and
|
|
14
|
+
Runs Claude Code, Codex, Antigravity and Grok on your machine, mirrors every turn to your Paigy inbox, and
|
|
15
15
|
— when you ask it to — **rings your phone when an agent is blocked** (#804).
|
|
16
16
|
|
|
17
17
|
## Why this exists
|
|
@@ -122,8 +122,8 @@ silently: the CLI prints the harness's hint and exits before any session starts
|
|
|
122
122
|
|
|
123
123
|
## One transport: ACP
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
their adapters: `@agentclientprotocol/claude-agent-acp`, `…/codex-acp`, and `paigy-agy-acp`, which ships inside the harness because Antigravity has no ACP mode (#2176). One driver
|
|
125
|
+
Claude Code, Codex and Antigravity speak **ACP** — the Agent Client Protocol, JSON-RPC over stdio — through
|
|
126
|
+
their adapters: `@agentclientprotocol/claude-agent-acp`, `…/codex-acp`, and `paigy-agy-acp`, which ships inside the harness because Antigravity has no ACP mode (#2176). Grok speaks it on its own binary (`grok agent stdio`); bypass passes `--always-approve`. One driver
|
|
127
127
|
(acp.ts), no parser museum; ACP gave Codex the permission channel `codex exec` never
|
|
128
128
|
had, and it's the door to every other harness that speaks it (Goose, Cursor, Devin…)
|
|
129
129
|
as a catalog entry. The stream-json Claude adapter this replaced lives in git history.
|
|
@@ -205,7 +205,7 @@ curl -fsSL https://paigy.ai/install | sh
|
|
|
205
205
|
Installs the npm CLI (one self-contained file — the workspace libs are bundled) and
|
|
206
206
|
runs `paigy-harness setup`: QR-pairs the machine, hatches each detected agent's
|
|
207
207
|
identity (no codes), registers the Paigy MCP in every harness it runs (`MCP_WIRES` —
|
|
208
|
-
Claude Code, Codex, Antigravity: an agent's only channel to you) + the statusline,
|
|
208
|
+
Claude Code, Codex, Antigravity, Grok: an agent's only channel to you) + the statusline,
|
|
209
209
|
grants a workspace, installs
|
|
210
210
|
the host service. `paigy-harness service` installs a
|
|
211
211
|
macOS launchd agent so hosting survives reboots — the host loop IS the service,
|
|
@@ -237,7 +237,7 @@ The window deliberately has NO run form — launching moved to the phone (docs/c
|
|
|
237
237
|
It shows pairing, the party, the doctor, the workspace
|
|
238
238
|
allow-list, a Stop button, and the log.
|
|
239
239
|
|
|
240
|
-
Headless flags: `--harness claude|codex|agy`, `--mode bypass|ask`, `--cwd DIR`,
|
|
240
|
+
Headless flags: `--harness claude|codex|agy|grok`, `--mode bypass|ask`, `--cwd DIR`,
|
|
241
241
|
`--grace SECONDS`, `--doctor`; subcommands `host [--grant DIR]…`,
|
|
242
242
|
`hatch NAME` and `launch NAME [--under GOAL] BRIEF…`. In ask mode the CLI is TERMINAL-FIRST: a blocked action or open
|
|
243
243
|
question prints in the terminal and waits `--grace` (default 90s); a person at the
|
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
|
|
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,9 +28818,11 @@ 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.
|
|
@@ -28846,12 +28875,55 @@ var userExplicitlyRequested = external_exports.enum(["any", "call"]).optional().
|
|
|
28846
28875
|
`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.`
|
|
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
|
-
|
|
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(
|
|
@@ -29141,6 +29220,8 @@ var SearchToolSchema = external_exports.object({
|
|
|
29141
29220
|
limit: external_exports.number().int().min(1).max(20).optional()
|
|
29142
29221
|
}).strict();
|
|
29143
29222
|
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.";
|
|
29223
|
+
var READS = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
|
|
29224
|
+
var SENDS = { readOnlyHint: false, destructiveHint: true, openWorldHint: false };
|
|
29144
29225
|
var ConfigureIdentitySchema = external_exports.object({}).strict();
|
|
29145
29226
|
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
29227
|
var CheckActivitySchema = external_exports.object({}).strict();
|
|
@@ -29152,16 +29233,16 @@ var SendFeedbackSchema = external_exports.object({
|
|
|
29152
29233
|
}).strict();
|
|
29153
29234
|
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
29235
|
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) },
|
|
29236
|
+
{ name: "configure", title: "Who am I", annotations: READS, description: CONFIGURE_IDENTITY_DESCRIPTION, inputSchema: mcpInputSchema(ConfigureIdentitySchema) },
|
|
29237
|
+
{ name: "contact", title: "Contact the person", annotations: SENDS, description: CONTACT_DESCRIPTION, inputSchema: CONTACT_SCHEMA },
|
|
29238
|
+
{ name: "manage_goals", title: "Manage Goals", annotations: SENDS, description: MANAGE_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(ManageGoalsToolSchema) },
|
|
29239
|
+
{ name: "get_delivery", title: "Read a delivery", annotations: READS, description: GET_DELIVERY_DESCRIPTION, inputSchema: mcpInputSchema(GetDeliverySchema) },
|
|
29240
|
+
{ name: "get_goals", title: "Read Goals", annotations: READS, description: GET_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(GetGoalsSchema) },
|
|
29241
|
+
{ name: "search", title: "Search history", annotations: READS, description: SEARCH_DESCRIPTION, inputSchema: mcpInputSchema(SearchToolSchema) },
|
|
29242
|
+
{ 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) },
|
|
29243
|
+
{ name: "send_feedback", title: "Send feedback to Paigy", annotations: SENDS, description: SEND_FEEDBACK_DESCRIPTION, inputSchema: mcpInputSchema(SendFeedbackSchema) },
|
|
29163
29244
|
// 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) }
|
|
29245
|
+
{ name: "help", title: "Paigy guide", annotations: READS, description: HELP_DESCRIPTION, inputSchema: mcpInputSchema(HelpSchema) }
|
|
29165
29246
|
];
|
|
29166
29247
|
var AGENT_TOOL_NAMES = AGENT_TOOLS.map((t) => t.name);
|
|
29167
29248
|
var id = external_exports.string().uuid();
|
|
@@ -29941,6 +30022,10 @@ var InboxItemSchema = external_exports.object({
|
|
|
29941
30022
|
branch: external_exports.string().optional(),
|
|
29942
30023
|
createdAt: external_exports.string().datetime(),
|
|
29943
30024
|
snoozedUntil: external_exports.string().datetime().optional(),
|
|
30025
|
+
/** A past card the person dismissed that Restore can take back (#2699): its newest close is their
|
|
30026
|
+
* dismissal, with what it withdrew recorded (`private.restore_delivery`). Absent on everything else —
|
|
30027
|
+
* a put-off, a card an ended Goal or a settled question closed, and every open card. */
|
|
30028
|
+
restorable: external_exports.boolean().optional(),
|
|
29944
30029
|
agentState: AgentStateSchema.default("idle"),
|
|
29945
30030
|
/** Whose action the item is waiting on: "you" = an agent asked you (the default,
|
|
29946
30031
|
* every agent→user notification); "agent" = you sent a request and it's awaiting the
|
|
@@ -30121,8 +30206,8 @@ var UserSettingsSchema = external_exports.object({
|
|
|
30121
30206
|
* write, 'hosted' on read (see store.ts). */
|
|
30122
30207
|
voiceMode: external_exports.enum(["hosted", "on_device"]).optional(),
|
|
30123
30208
|
/** `talk` lived here until #2373: it gated auto-play, which went in #2374. An older bundle's
|
|
30124
|
-
* `talk` is stripped like `silentPush` was
|
|
30125
|
-
*
|
|
30209
|
+
* `talk` is stripped like `silentPush` was, and the `user_settings.talk` column went in
|
|
30210
|
+
* 20261028142255. */
|
|
30126
30211
|
/** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
|
|
30127
30212
|
* load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
|
|
30128
30213
|
* newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
|
|
@@ -30229,6 +30314,12 @@ var ConnectionSummarySchema = external_exports.object({
|
|
|
30229
30314
|
* its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
|
|
30230
30315
|
* `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
|
|
30231
30316
|
lastWorkedAt: external_exports.string().datetime().nullable().optional(),
|
|
30317
|
+
/** A TERMINAL SESSION'S ONLY PULSE (`tokens.listened_at`): `paigy-listen` stamps it on every sweep
|
|
30318
|
+
* (90 s). It is deliberately NOT presence — `last_seen_at` is the desktop host's beat, and a
|
|
30319
|
+
* listener orphaned from a dead conversation must not light the live dot — but it is the one fact
|
|
30320
|
+
* that says a terminal session's process is UP, which is why the wake already reads it
|
|
30321
|
+
* (`wake.ts`, `listener`). Null = no listener sweeping. */
|
|
30322
|
+
listenedAt: external_exports.string().datetime().nullable().optional(),
|
|
30232
30323
|
/** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
|
|
30233
30324
|
* With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
|
|
30234
30325
|
oldestReadyAt: external_exports.string().datetime().nullable().optional(),
|
|
@@ -30558,7 +30649,7 @@ var DeviceTokenSchema = external_exports.object({
|
|
|
30558
30649
|
* the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
|
|
30559
30650
|
workspace: external_exports.string().nullable().optional(),
|
|
30560
30651
|
/** Local host recovery must preserve the launch's runtime and Paigy identity. */
|
|
30561
|
-
harness: external_exports.enum(["claude", "codex", "agy"]).optional(),
|
|
30652
|
+
harness: external_exports.enum(["claude", "codex", "agy", "grok"]).optional(),
|
|
30562
30653
|
session_id: external_exports.string().uuid().optional(),
|
|
30563
30654
|
/** A conversation the host must not resume: its context is full, so every turn fails
|
|
30564
30655
|
* ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
|
|
@@ -31078,6 +31169,10 @@ async function listConnections(opts = {}) {
|
|
|
31078
31169
|
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
31170
|
var APPLIED = "Applied; nothing was sent to the person.";
|
|
31080
31171
|
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.";
|
|
31172
|
+
function citeOf(receipt) {
|
|
31173
|
+
if (!receipt.uncited?.length) return {};
|
|
31174
|
+
return { uncited: receipt.uncited, ...receipt.cite ? { cite: receipt.cite } : {} };
|
|
31175
|
+
}
|
|
31081
31176
|
async function readDelivery(deliveryId, opts = {}) {
|
|
31082
31177
|
const query = opts.transcript ? `?transcript=1${opts.after ? `&after=${encodeURIComponent(opts.after)}` : ""}` : "";
|
|
31083
31178
|
const res = await ensureAuthed(await (opts.reach ?? reach)(`${BACKEND_URL}/api/deliveries/${encodeURIComponent(deliveryId)}${query}`, {
|
|
@@ -31119,7 +31214,7 @@ async function contact(input, opts = {}) {
|
|
|
31119
31214
|
const demoted = askedCall && receipt.channel && receipt.channel !== "call" ? DEMOTED : void 0;
|
|
31120
31215
|
const acked = acknowledged ? { acknowledged } : {};
|
|
31121
31216
|
if (!deliveries.length) {
|
|
31122
|
-
return { sent: false, ok, results, ...recorded.length ? { recorded } : {}, message: recorded.length ? NOT_SENT : APPLIED, waitOutcome: "not_waited", ...acked };
|
|
31217
|
+
return { sent: false, ok, results, ...recorded.length ? { recorded } : {}, message: recorded.length ? NOT_SENT : APPLIED, waitOutcome: "not_waited", ...acked, ...citeOf(receipt) };
|
|
31123
31218
|
}
|
|
31124
31219
|
const lead = deliveries.find((d) => d.kind === "question") ?? deliveries[0];
|
|
31125
31220
|
const read3 = async (signal2) => {
|
|
@@ -31136,7 +31231,8 @@ async function contact(input, opts = {}) {
|
|
|
31136
31231
|
...demoted ? { demoted } : {},
|
|
31137
31232
|
...acked,
|
|
31138
31233
|
...receipt.ringPolicy ? { ringPolicy: receipt.ringPolicy, ...receipt.message ? { ringHeld: receipt.message } : {} } : {},
|
|
31139
|
-
...receipt.recheckAt ? { recheckAt: receipt.recheckAt } : {}
|
|
31234
|
+
...receipt.recheckAt ? { recheckAt: receipt.recheckAt } : {},
|
|
31235
|
+
...citeOf(receipt)
|
|
31140
31236
|
};
|
|
31141
31237
|
};
|
|
31142
31238
|
const settled = (d) => d.state === "closed" || d.answers.length > 0 || d.entries.some((e) => e.kind === "contribution" && !entryUnit(e));
|
|
@@ -31382,6 +31478,11 @@ import { resolve, delimiter as delimiter2, join as join5 } from "path";
|
|
|
31382
31478
|
// src/harness/acp.ts
|
|
31383
31479
|
var none = { events: [], writes: [] };
|
|
31384
31480
|
var NOTHING_TO_RESUME = /* @__PURE__ */ new Set([-32002, -32601]);
|
|
31481
|
+
function nothingToResume(error) {
|
|
31482
|
+
if (!error || error.code === void 0) return false;
|
|
31483
|
+
if (NOTHING_TO_RESUME.has(error.code)) return true;
|
|
31484
|
+
return error.code === -32603 && (error.data?.code === "FS_NOT_FOUND" || /^Path not found\b/.test(error.message ?? ""));
|
|
31485
|
+
}
|
|
31385
31486
|
function optionFor(options, decision) {
|
|
31386
31487
|
const want = decision.allow ? "allow_once" : "reject_once";
|
|
31387
31488
|
return options.find((o) => o.kind === want)?.optionId ?? null;
|
|
@@ -31518,11 +31619,11 @@ var AcpDriver = class {
|
|
|
31518
31619
|
if (msg.id === this.sessionNewId) {
|
|
31519
31620
|
this.sessionNewId = void 0;
|
|
31520
31621
|
const resuming = this.resume !== void 0;
|
|
31521
|
-
if (resuming &&
|
|
31622
|
+
if (resuming && nothingToResume(msg.error)) {
|
|
31522
31623
|
this.resume = void 0;
|
|
31523
31624
|
this.sessionNewId = this.nextId++;
|
|
31524
31625
|
return {
|
|
31525
|
-
events: [{ kind: "error", message: `session/resume found nothing to resume (${msg.error.message}) \u2014 opening a new conversation` }],
|
|
31626
|
+
events: [{ kind: "error", message: `session/resume found nothing to resume (${msg.error.message ?? "no message"}) \u2014 opening a new conversation` }],
|
|
31526
31627
|
writes: [frame2(this.opening(this.sessionNewId))]
|
|
31527
31628
|
};
|
|
31528
31629
|
}
|
|
@@ -31722,8 +31823,16 @@ function inboxFor(root = INBOX_ROOT) {
|
|
|
31722
31823
|
var ADAPTER_BIN = {
|
|
31723
31824
|
claude: "claude-agent-acp",
|
|
31724
31825
|
codex: "codex-acp",
|
|
31725
|
-
agy: "paigy-agy-acp"
|
|
31826
|
+
agy: "paigy-agy-acp",
|
|
31827
|
+
grok: "grok"
|
|
31726
31828
|
};
|
|
31829
|
+
function grokArgs(opts) {
|
|
31830
|
+
const args = ["agent"];
|
|
31831
|
+
if (opts.mode === "bypass") args.push("--always-approve");
|
|
31832
|
+
if (opts.model) args.push("--model", opts.model);
|
|
31833
|
+
args.push("stdio");
|
|
31834
|
+
return args;
|
|
31835
|
+
}
|
|
31727
31836
|
var CLAUDE_ONE_WAY_IN = {
|
|
31728
31837
|
env: { CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1" },
|
|
31729
31838
|
disallowedTools: ["Monitor", "ScheduleWakeup", "CronCreate", "Workflow"]
|
|
@@ -31764,7 +31873,7 @@ function startSession(opts) {
|
|
|
31764
31873
|
const inherited = [...savedVars.matchAll(/["']([A-Za-z_][A-Za-z0-9_]*)["']/g)].map((match) => match[1]);
|
|
31765
31874
|
codexConfig[key3] = [.../* @__PURE__ */ new Set([...inherited, ...codexConfig[key3] ?? codexConfig.mcp_servers?.paigy?.env_vars ?? [], ...CODEX_ENV])];
|
|
31766
31875
|
}
|
|
31767
|
-
const child = (opts.spawnFn ?? spawn)(opts.bin ?? ADAPTER_BIN[opts.harness], [], {
|
|
31876
|
+
const child = (opts.spawnFn ?? spawn)(opts.bin ?? ADAPTER_BIN[opts.harness], opts.harness === "grok" ? grokArgs(opts) : [], {
|
|
31768
31877
|
cwd,
|
|
31769
31878
|
// The adapter shells out to its vendor CLI (`claude`, `codex`), and a GUI- or
|
|
31770
31879
|
// launchd-launched process's PATH won't have it — probe dirs plus the RUNNING
|
|
@@ -33261,10 +33370,22 @@ function capRefusals2(text, units22, field) {
|
|
|
33261
33370
|
function refuseOverCaps2(text, units22, field, ctx) {
|
|
33262
33371
|
for (const { path, message, ...params } of capRefusals2(text, units22, field)) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path, message, params });
|
|
33263
33372
|
}
|
|
33373
|
+
var SHIPPED2 = ["phone", "calls", "server", "store", "agents"];
|
|
33374
|
+
var CAUSES_MAX2 = 10;
|
|
33375
|
+
var shipped2 = external_exports.enum(SHIPPED2, {
|
|
33376
|
+
errorMap: () => ({ message: `shipped_unknown: one of ${SHIPPED2.join(", ")}.` })
|
|
33377
|
+
}).optional().describe(
|
|
33378
|
+
"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."
|
|
33379
|
+
);
|
|
33380
|
+
var causedBy2 = external_exports.array(
|
|
33381
|
+
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.")
|
|
33382
|
+
).min(1).max(CAUSES_MAX2, `too_many_causes: at most ${CAUSES_MAX2}.`).optional().describe(
|
|
33383
|
+
`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.`
|
|
33384
|
+
);
|
|
33264
33385
|
var COMPLETION_MESSAGE_MAX2 = 50;
|
|
33265
33386
|
var CompletionSchema2 = external_exports.object({
|
|
33266
33387
|
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."),
|
|
33388
|
+
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
33389
|
units: external_exports.array(UnitInputSchema2.extend({
|
|
33269
33390
|
title: external_exports.string().trim().min(1).max(UNIT_TITLE_MAX2),
|
|
33270
33391
|
body: external_exports.string().trim().min(1).max(UNIT_BODY_MAX2)
|
|
@@ -33273,9 +33394,11 @@ var CompletionSchema2 = external_exports.object({
|
|
|
33273
33394
|
options: external_exports.array(external_exports.object({
|
|
33274
33395
|
label: external_exports.string().trim().min(1).max(OPTION_LABEL_MAX2),
|
|
33275
33396
|
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.")
|
|
33397
|
+
}).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."),
|
|
33398
|
+
causedBy: causedBy2,
|
|
33399
|
+
shipped: shipped2
|
|
33277
33400
|
}).strict();
|
|
33278
|
-
var CompleteChangeSchema2 = CompletionSchema2.extend({ kind: external_exports.literal("complete") });
|
|
33401
|
+
var CompleteChangeSchema2 = CompletionSchema2.omit({ causedBy: true, shipped: true }).extend({ kind: external_exports.literal("complete") });
|
|
33279
33402
|
var ASKING_RULES2 = `HOW TO ASK:
|
|
33280
33403
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
33281
33404
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
@@ -33328,12 +33451,55 @@ var userExplicitlyRequested2 = external_exports.enum(["any", "call"]).optional()
|
|
|
33328
33451
|
`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.`
|
|
33329
33452
|
);
|
|
33330
33453
|
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.`
|
|
33454
|
+
`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
33455
|
);
|
|
33456
|
+
var KIND_IDS2 = { "handing": "none", "replaced-by": "goal", "blocked-by": "node", "asking": "none", "found": "none" };
|
|
33457
|
+
var KIND_GRAMMAR2 = "handing, replaced-by <goalId>, blocked-by <goalId|questionId>, asking, found";
|
|
33458
|
+
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}$/;
|
|
33459
|
+
var handle2 = /^[0-9a-fA-F-]{8,36}$/;
|
|
33460
|
+
function refuseKind2(u, ctx) {
|
|
33461
|
+
if (!u.kind) return;
|
|
33462
|
+
const refuse = (refusal, kind, message) => ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kind"], params: { refusal, kind }, message });
|
|
33463
|
+
const [name, ...rest] = u.kind.trim().split(/\s+/);
|
|
33464
|
+
const shape = KIND_IDS2[name];
|
|
33465
|
+
if (!shape) {
|
|
33466
|
+
refuse("kind_unknown", name, `kind_unknown: "${name}" is not a kind. One of: ${KIND_GRAMMAR2}.`);
|
|
33467
|
+
return;
|
|
33468
|
+
}
|
|
33469
|
+
const id22 = rest.join(" ");
|
|
33470
|
+
if (shape === "none" && id22) {
|
|
33471
|
+
refuse("kind_takes_no_id", name, `kind_takes_no_id: "${name}" is the whole kind, so drop the "${id22}" after it.`);
|
|
33472
|
+
}
|
|
33473
|
+
if (shape !== "none" && !(shape === "goal" ? uuid2.test(id22) : handle2.test(id22))) {
|
|
33474
|
+
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>".`);
|
|
33475
|
+
}
|
|
33476
|
+
if (name === "asking") {
|
|
33477
|
+
refuse("kind_is_a_question", name, 'kind_is_a_question: "asking" owes them an answer, so send it in `questions`, where it opens one.');
|
|
33478
|
+
}
|
|
33479
|
+
if (u.userExplicitlyRequested) {
|
|
33480
|
+
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.`);
|
|
33481
|
+
}
|
|
33482
|
+
}
|
|
33333
33483
|
var UpdateInputSchema2 = external_exports.object({
|
|
33334
|
-
|
|
33484
|
+
// ONE LOAD-BEARING POINT PER REPORT (owner, 2026-10-27 14:10 on call, Goal 1b1750e9, settling
|
|
33485
|
+
// #3633's pacing: "one point at a time is better, but make sure that it's [load-]bearing ... if
|
|
33486
|
+
// there is a lot of key points that I need to be aware of ... meaning something bad would happen
|
|
33487
|
+
// if I didn't know them or I wouldn't be able to understand something in the future ... They
|
|
33488
|
+
// should go separately. Basically, it should be like one load-bearing thing per report").
|
|
33489
|
+
//
|
|
33490
|
+
// The call's half of that ruling shipped in #3771: the talker settles an item only once the
|
|
33491
|
+
// transcript shows he heard its load-bearing point. This is the author's half, and without it the
|
|
33492
|
+
// talker has to guess which of a report's parts was load-bearing. Measured 2026-11-01 on prod:
|
|
33493
|
+
// 458 of 866 reports in 21 days carried two or more units, and since the pacing shipped on 10-23
|
|
33494
|
+
// only 18 of 72 units that reached a call were ever said -- so a point written as a unit has about
|
|
33495
|
+
// a one-in-four chance of being heard, and one ok after the headline settles the whole report.
|
|
33496
|
+
// Hence the wording, not a `mustHear` flag (the-heard-record.md P3): he asked for less mechanism
|
|
33497
|
+
// and more judgment from the agent, so a point he must not miss is simply its own report.
|
|
33498
|
+
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
33499
|
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
33500
|
units: units2,
|
|
33501
|
+
causedBy: causedBy2,
|
|
33502
|
+
shipped: shipped2,
|
|
33337
33503
|
// A REPORT KEEPS ITS TAP (#2799, #3260; owner, 2026-10-08, settling #2776: "keep the reports open
|
|
33338
33504
|
// until the user acknowledges them"). A report asks nothing, so it opens no Question -- but it
|
|
33339
33505
|
// still waits to be acknowledged, and it carries the ONE tap that closes it. Never a decision: the
|
|
@@ -33357,6 +33523,12 @@ var UpdateInputSchema2 = external_exports.object({
|
|
|
33357
33523
|
reply: external_exports.string().trim().min(1).describe(
|
|
33358
33524
|
`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
33525
|
).optional(),
|
|
33526
|
+
// THE KIND, WHICH WAS THE FIRST LINE OF THE MESSAGE UNTIL NOW (`KIND_IDS` above). Optional on
|
|
33527
|
+
// purpose: every agent writing updates today sends none, and a door that refused them would turn a
|
|
33528
|
+
// convention nobody was obliged to follow into a 400 on live traffic.
|
|
33529
|
+
kind: external_exports.string().trim().min(1).optional().describe(
|
|
33530
|
+
`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).`
|
|
33531
|
+
),
|
|
33360
33532
|
userExplicitlyRequested: userExplicitlyRequested2
|
|
33361
33533
|
}).strict().superRefine((u, ctx) => {
|
|
33362
33534
|
if (u.userExplicitlyRequested && !u.reply) {
|
|
@@ -33368,6 +33540,7 @@ var UpdateInputSchema2 = external_exports.object({
|
|
|
33368
33540
|
});
|
|
33369
33541
|
}
|
|
33370
33542
|
refuseOverCaps2(u.message, u.units, "message", ctx);
|
|
33543
|
+
refuseKind2(u, ctx);
|
|
33371
33544
|
if (u.reply && u.reply.length > OPTION_LABEL_MAX2) {
|
|
33372
33545
|
ctx.addIssue({
|
|
33373
33546
|
code: external_exports.ZodIssueCode.custom,
|
|
@@ -33457,7 +33630,7 @@ var sendFields2 = {
|
|
|
33457
33630
|
"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
33631
|
),
|
|
33459
33632
|
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."
|
|
33633
|
+
"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
33634
|
),
|
|
33462
33635
|
answers: external_exports.array(AnswerInputSchema2).min(1).max(20).optional().describe("Answers to Questions addressed to you."),
|
|
33463
33636
|
withdrawQuestionIds: external_exports.array(questionHandle2).min(1).max(10).optional().describe(
|
|
@@ -33623,6 +33796,8 @@ var SearchToolSchema2 = external_exports.object({
|
|
|
33623
33796
|
limit: external_exports.number().int().min(1).max(20).optional()
|
|
33624
33797
|
}).strict();
|
|
33625
33798
|
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.";
|
|
33799
|
+
var READS2 = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
|
|
33800
|
+
var SENDS2 = { readOnlyHint: false, destructiveHint: true, openWorldHint: false };
|
|
33626
33801
|
var ConfigureIdentitySchema2 = external_exports.object({}).strict();
|
|
33627
33802
|
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
33803
|
var CheckActivitySchema2 = external_exports.object({}).strict();
|
|
@@ -33634,16 +33809,16 @@ var SendFeedbackSchema2 = external_exports.object({
|
|
|
33634
33809
|
}).strict();
|
|
33635
33810
|
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
33811
|
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) },
|
|
33812
|
+
{ name: "configure", title: "Who am I", annotations: READS2, description: CONFIGURE_IDENTITY_DESCRIPTION2, inputSchema: mcpInputSchema2(ConfigureIdentitySchema2) },
|
|
33813
|
+
{ name: "contact", title: "Contact the person", annotations: SENDS2, description: CONTACT_DESCRIPTION2, inputSchema: CONTACT_SCHEMA2 },
|
|
33814
|
+
{ name: "manage_goals", title: "Manage Goals", annotations: SENDS2, description: MANAGE_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(ManageGoalsToolSchema2) },
|
|
33815
|
+
{ name: "get_delivery", title: "Read a delivery", annotations: READS2, description: GET_DELIVERY_DESCRIPTION2, inputSchema: mcpInputSchema2(GetDeliverySchema2) },
|
|
33816
|
+
{ name: "get_goals", title: "Read Goals", annotations: READS2, description: GET_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(GetGoalsSchema2) },
|
|
33817
|
+
{ name: "search", title: "Search history", annotations: READS2, description: SEARCH_DESCRIPTION2, inputSchema: mcpInputSchema2(SearchToolSchema2) },
|
|
33818
|
+
{ 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) },
|
|
33819
|
+
{ name: "send_feedback", title: "Send feedback to Paigy", annotations: SENDS2, description: SEND_FEEDBACK_DESCRIPTION2, inputSchema: mcpInputSchema2(SendFeedbackSchema2) },
|
|
33645
33820
|
// 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) }
|
|
33821
|
+
{ name: "help", title: "Paigy guide", annotations: READS2, description: HELP_DESCRIPTION2, inputSchema: mcpInputSchema2(HelpSchema2) }
|
|
33647
33822
|
];
|
|
33648
33823
|
var AGENT_TOOL_NAMES2 = AGENT_TOOLS2.map((t) => t.name);
|
|
33649
33824
|
var id2 = external_exports.string().uuid();
|
|
@@ -34434,6 +34609,10 @@ var InboxItemSchema2 = external_exports.object({
|
|
|
34434
34609
|
branch: external_exports.string().optional(),
|
|
34435
34610
|
createdAt: external_exports.string().datetime(),
|
|
34436
34611
|
snoozedUntil: external_exports.string().datetime().optional(),
|
|
34612
|
+
/** A past card the person dismissed that Restore can take back (#2699): its newest close is their
|
|
34613
|
+
* dismissal, with what it withdrew recorded (`private.restore_delivery`). Absent on everything else —
|
|
34614
|
+
* a put-off, a card an ended Goal or a settled question closed, and every open card. */
|
|
34615
|
+
restorable: external_exports.boolean().optional(),
|
|
34437
34616
|
agentState: AgentStateSchema2.default("idle"),
|
|
34438
34617
|
/** Whose action the item is waiting on: "you" = an agent asked you (the default,
|
|
34439
34618
|
* every agent→user notification); "agent" = you sent a request and it's awaiting the
|
|
@@ -34614,8 +34793,8 @@ var UserSettingsSchema2 = external_exports.object({
|
|
|
34614
34793
|
* write, 'hosted' on read (see store.ts). */
|
|
34615
34794
|
voiceMode: external_exports.enum(["hosted", "on_device"]).optional(),
|
|
34616
34795
|
/** `talk` lived here until #2373: it gated auto-play, which went in #2374. An older bundle's
|
|
34617
|
-
* `talk` is stripped like `silentPush` was
|
|
34618
|
-
*
|
|
34796
|
+
* `talk` is stripped like `silentPush` was, and the `user_settings.talk` column went in
|
|
34797
|
+
* 20261028142255. */
|
|
34619
34798
|
/** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
|
|
34620
34799
|
* load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
|
|
34621
34800
|
* newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
|
|
@@ -34722,6 +34901,12 @@ var ConnectionSummarySchema2 = external_exports.object({
|
|
|
34722
34901
|
* its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
|
|
34723
34902
|
* `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
|
|
34724
34903
|
lastWorkedAt: external_exports.string().datetime().nullable().optional(),
|
|
34904
|
+
/** A TERMINAL SESSION'S ONLY PULSE (`tokens.listened_at`): `paigy-listen` stamps it on every sweep
|
|
34905
|
+
* (90 s). It is deliberately NOT presence — `last_seen_at` is the desktop host's beat, and a
|
|
34906
|
+
* listener orphaned from a dead conversation must not light the live dot — but it is the one fact
|
|
34907
|
+
* that says a terminal session's process is UP, which is why the wake already reads it
|
|
34908
|
+
* (`wake.ts`, `listener`). Null = no listener sweeping. */
|
|
34909
|
+
listenedAt: external_exports.string().datetime().nullable().optional(),
|
|
34725
34910
|
/** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
|
|
34726
34911
|
* With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
|
|
34727
34912
|
oldestReadyAt: external_exports.string().datetime().nullable().optional(),
|
|
@@ -35049,7 +35234,7 @@ var DeviceTokenSchema2 = external_exports.object({
|
|
|
35049
35234
|
* the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
|
|
35050
35235
|
workspace: external_exports.string().nullable().optional(),
|
|
35051
35236
|
/** Local host recovery must preserve the launch's runtime and Paigy identity. */
|
|
35052
|
-
harness: external_exports.enum(["claude", "codex", "agy"]).optional(),
|
|
35237
|
+
harness: external_exports.enum(["claude", "codex", "agy", "grok"]).optional(),
|
|
35053
35238
|
session_id: external_exports.string().uuid().optional(),
|
|
35054
35239
|
/** A conversation the host must not resume: its context is full, so every turn fails
|
|
35055
35240
|
* ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
|
|
@@ -36083,7 +36268,7 @@ function runHarness(opts) {
|
|
|
36083
36268
|
opts.log("\u25B6 running again after the limit");
|
|
36084
36269
|
LIMITS.running(name, (text) => callForResume(text, state, rail), opts.log);
|
|
36085
36270
|
}
|
|
36086
|
-
async function
|
|
36271
|
+
async function handle3(event) {
|
|
36087
36272
|
if (event.kind === "error") {
|
|
36088
36273
|
opts.log(`\u26A0 ${event.message}`);
|
|
36089
36274
|
if (event.fatal && running) {
|
|
@@ -36142,7 +36327,7 @@ ${event.message}`, state, rail, { log: opts.log });
|
|
|
36142
36327
|
inbox?.close();
|
|
36143
36328
|
opts.onExit?.();
|
|
36144
36329
|
},
|
|
36145
|
-
onEvent: (event) => void
|
|
36330
|
+
onEvent: (event) => void handle3(event).catch((err) => opts.log(`\u26A0 ${err.message}`))
|
|
36146
36331
|
});
|
|
36147
36332
|
void pump(session, state, rail, { onIdle: () => running, beat: clock4, initialPrompt: opts.prompt, log: opts.log, ...inbox ? { inbox } : {} }).catch(
|
|
36148
36333
|
(e) => opts.log(`\u26A0 conversation loop stopped: ${e.message}`)
|
|
@@ -36576,7 +36761,7 @@ function selfUpdater(deps) {
|
|
|
36576
36761
|
var HOST_FILE = join10(homedir8(), ".paigy", "host.json");
|
|
36577
36762
|
function wakeHarness(slot, saved, claudeTranscript) {
|
|
36578
36763
|
if (slot === "Desktop") return void 0;
|
|
36579
|
-
if (saved !== null) return saved === "agy" || saved === "codex" || saved === "claude" ? saved : void 0;
|
|
36764
|
+
if (saved !== null) return saved === "agy" || saved === "codex" || saved === "claude" || saved === "grok" ? saved : void 0;
|
|
36580
36765
|
if (claudeTranscript) return "claude";
|
|
36581
36766
|
if (slot === "mcp-agent" || slot === "Claude Code") return "claude";
|
|
36582
36767
|
if (slot === "codex") return "codex";
|
|
@@ -37277,10 +37462,11 @@ async function main() {
|
|
|
37277
37462
|
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
37463
|
}
|
|
37279
37464
|
}
|
|
37280
|
-
if (which("claude")) {
|
|
37465
|
+
if (which("claude") || which("grok")) {
|
|
37281
37466
|
try {
|
|
37282
37467
|
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)");
|
|
37468
|
+
if (which("claude")) console.log("\u2713 Paigy's tools allowlisted in Claude Code (they won't prompt each time)");
|
|
37469
|
+
if (which("grok")) console.log("\u2713 Grok will be told to listen, and reminded when a turn stalls");
|
|
37284
37470
|
} catch {
|
|
37285
37471
|
console.log(` allowlist it later with: paigy-harness enable-tools`);
|
|
37286
37472
|
}
|
package/dist/main.js
CHANGED
|
@@ -8744,7 +8744,7 @@ function parseSessionRecord(text) {
|
|
|
8744
8744
|
return void 0;
|
|
8745
8745
|
}
|
|
8746
8746
|
function sessionId() {
|
|
8747
|
-
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`).
|
|
8747
|
+
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`).
|
|
8748
8748
|
(underCodex() ? INSTANCE_ID : WORKSPACE_ID);
|
|
8749
8749
|
}
|
|
8750
8750
|
async function reach(url, init) {
|
|
@@ -10055,10 +10055,22 @@ function capRefusals(text, units22, field) {
|
|
|
10055
10055
|
function refuseOverCaps(text, units22, field, ctx) {
|
|
10056
10056
|
for (const { path, message, ...params } of capRefusals(text, units22, field)) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path, message, params });
|
|
10057
10057
|
}
|
|
10058
|
+
var SHIPPED = ["phone", "calls", "server", "store", "agents"];
|
|
10059
|
+
var CAUSES_MAX = 10;
|
|
10060
|
+
var shipped = external_exports.enum(SHIPPED, {
|
|
10061
|
+
errorMap: () => ({ message: `shipped_unknown: one of ${SHIPPED.join(", ")}.` })
|
|
10062
|
+
}).optional().describe(
|
|
10063
|
+
"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."
|
|
10064
|
+
);
|
|
10065
|
+
var causedBy = external_exports.array(
|
|
10066
|
+
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.")
|
|
10067
|
+
).min(1).max(CAUSES_MAX, `too_many_causes: at most ${CAUSES_MAX}.`).optional().describe(
|
|
10068
|
+
`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.`
|
|
10069
|
+
);
|
|
10058
10070
|
var COMPLETION_MESSAGE_MAX = 50;
|
|
10059
10071
|
var CompletionSchema = external_exports.object({
|
|
10060
10072
|
goalId: external_exports.string().uuid().describe("The existing Goal to complete."),
|
|
10061
|
-
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."),
|
|
10073
|
+
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."),
|
|
10062
10074
|
units: external_exports.array(UnitInputSchema.extend({
|
|
10063
10075
|
title: external_exports.string().trim().min(1).max(UNIT_TITLE_MAX),
|
|
10064
10076
|
body: external_exports.string().trim().min(1).max(UNIT_BODY_MAX)
|
|
@@ -10067,9 +10079,11 @@ var CompletionSchema = external_exports.object({
|
|
|
10067
10079
|
options: external_exports.array(external_exports.object({
|
|
10068
10080
|
label: external_exports.string().trim().min(1).max(OPTION_LABEL_MAX),
|
|
10069
10081
|
hint: external_exports.string().trim().min(1).max(OPTION_HINT_MAX)
|
|
10070
|
-
}).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.")
|
|
10082
|
+
}).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."),
|
|
10083
|
+
causedBy,
|
|
10084
|
+
shipped
|
|
10071
10085
|
}).strict();
|
|
10072
|
-
var CompleteChangeSchema = CompletionSchema.extend({ kind: external_exports.literal("complete") });
|
|
10086
|
+
var CompleteChangeSchema = CompletionSchema.omit({ causedBy: true, shipped: true }).extend({ kind: external_exports.literal("complete") });
|
|
10073
10087
|
var ASKING_RULES = `HOW TO ASK:
|
|
10074
10088
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
10075
10089
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
@@ -10122,12 +10136,55 @@ var userExplicitlyRequested = external_exports.enum(["any", "call"]).optional().
|
|
|
10122
10136
|
`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.`
|
|
10123
10137
|
);
|
|
10124
10138
|
var units = external_exports.array(UnitInputSchema).optional().describe(
|
|
10125
|
-
`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.`
|
|
10139
|
+
`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.`
|
|
10126
10140
|
);
|
|
10141
|
+
var KIND_IDS = { "handing": "none", "replaced-by": "goal", "blocked-by": "node", "asking": "none", "found": "none" };
|
|
10142
|
+
var KIND_GRAMMAR = "handing, replaced-by <goalId>, blocked-by <goalId|questionId>, asking, found";
|
|
10143
|
+
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}$/;
|
|
10144
|
+
var handle = /^[0-9a-fA-F-]{8,36}$/;
|
|
10145
|
+
function refuseKind(u, ctx) {
|
|
10146
|
+
if (!u.kind) return;
|
|
10147
|
+
const refuse = (refusal, kind, message) => ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kind"], params: { refusal, kind }, message });
|
|
10148
|
+
const [name, ...rest] = u.kind.trim().split(/\s+/);
|
|
10149
|
+
const shape = KIND_IDS[name];
|
|
10150
|
+
if (!shape) {
|
|
10151
|
+
refuse("kind_unknown", name, `kind_unknown: "${name}" is not a kind. One of: ${KIND_GRAMMAR}.`);
|
|
10152
|
+
return;
|
|
10153
|
+
}
|
|
10154
|
+
const id22 = rest.join(" ");
|
|
10155
|
+
if (shape === "none" && id22) {
|
|
10156
|
+
refuse("kind_takes_no_id", name, `kind_takes_no_id: "${name}" is the whole kind, so drop the "${id22}" after it.`);
|
|
10157
|
+
}
|
|
10158
|
+
if (shape !== "none" && !(shape === "goal" ? uuid.test(id22) : handle.test(id22))) {
|
|
10159
|
+
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>".`);
|
|
10160
|
+
}
|
|
10161
|
+
if (name === "asking") {
|
|
10162
|
+
refuse("kind_is_a_question", name, 'kind_is_a_question: "asking" owes them an answer, so send it in `questions`, where it opens one.');
|
|
10163
|
+
}
|
|
10164
|
+
if (u.userExplicitlyRequested) {
|
|
10165
|
+
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.`);
|
|
10166
|
+
}
|
|
10167
|
+
}
|
|
10127
10168
|
var UpdateInputSchema = external_exports.object({
|
|
10128
|
-
|
|
10169
|
+
// ONE LOAD-BEARING POINT PER REPORT (owner, 2026-10-27 14:10 on call, Goal 1b1750e9, settling
|
|
10170
|
+
// #3633's pacing: "one point at a time is better, but make sure that it's [load-]bearing ... if
|
|
10171
|
+
// there is a lot of key points that I need to be aware of ... meaning something bad would happen
|
|
10172
|
+
// if I didn't know them or I wouldn't be able to understand something in the future ... They
|
|
10173
|
+
// should go separately. Basically, it should be like one load-bearing thing per report").
|
|
10174
|
+
//
|
|
10175
|
+
// The call's half of that ruling shipped in #3771: the talker settles an item only once the
|
|
10176
|
+
// transcript shows he heard its load-bearing point. This is the author's half, and without it the
|
|
10177
|
+
// talker has to guess which of a report's parts was load-bearing. Measured 2026-11-01 on prod:
|
|
10178
|
+
// 458 of 866 reports in 21 days carried two or more units, and since the pacing shipped on 10-23
|
|
10179
|
+
// only 18 of 72 units that reached a call were ever said -- so a point written as a unit has about
|
|
10180
|
+
// a one-in-four chance of being heard, and one ok after the headline settles the whole report.
|
|
10181
|
+
// Hence the wording, not a `mustHear` flag (the-heard-record.md P3): he asked for less mechanism
|
|
10182
|
+
// and more judgment from the agent, so a point he must not miss is simply its own report.
|
|
10183
|
+
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.`),
|
|
10129
10184
|
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."),
|
|
10130
10185
|
units,
|
|
10186
|
+
causedBy,
|
|
10187
|
+
shipped,
|
|
10131
10188
|
// A REPORT KEEPS ITS TAP (#2799, #3260; owner, 2026-10-08, settling #2776: "keep the reports open
|
|
10132
10189
|
// until the user acknowledges them"). A report asks nothing, so it opens no Question -- but it
|
|
10133
10190
|
// still waits to be acknowledged, and it carries the ONE tap that closes it. Never a decision: the
|
|
@@ -10151,6 +10208,12 @@ var UpdateInputSchema = external_exports.object({
|
|
|
10151
10208
|
reply: external_exports.string().trim().min(1).describe(
|
|
10152
10209
|
`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.`
|
|
10153
10210
|
).optional(),
|
|
10211
|
+
// THE KIND, WHICH WAS THE FIRST LINE OF THE MESSAGE UNTIL NOW (`KIND_IDS` above). Optional on
|
|
10212
|
+
// purpose: every agent writing updates today sends none, and a door that refused them would turn a
|
|
10213
|
+
// convention nobody was obliged to follow into a 400 on live traffic.
|
|
10214
|
+
kind: external_exports.string().trim().min(1).optional().describe(
|
|
10215
|
+
`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).`
|
|
10216
|
+
),
|
|
10154
10217
|
userExplicitlyRequested
|
|
10155
10218
|
}).strict().superRefine((u, ctx) => {
|
|
10156
10219
|
if (u.userExplicitlyRequested && !u.reply) {
|
|
@@ -10162,6 +10225,7 @@ var UpdateInputSchema = external_exports.object({
|
|
|
10162
10225
|
});
|
|
10163
10226
|
}
|
|
10164
10227
|
refuseOverCaps(u.message, u.units, "message", ctx);
|
|
10228
|
+
refuseKind(u, ctx);
|
|
10165
10229
|
if (u.reply && u.reply.length > OPTION_LABEL_MAX) {
|
|
10166
10230
|
ctx.addIssue({
|
|
10167
10231
|
code: external_exports.ZodIssueCode.custom,
|
|
@@ -10251,7 +10315,7 @@ var sendFields = {
|
|
|
10251
10315
|
"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."
|
|
10252
10316
|
),
|
|
10253
10317
|
updates: external_exports.array(UpdateInputSchema).min(1).max(20).optional().describe(
|
|
10254
|
-
"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."
|
|
10318
|
+
"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."
|
|
10255
10319
|
),
|
|
10256
10320
|
answers: external_exports.array(AnswerInputSchema).min(1).max(20).optional().describe("Answers to Questions addressed to you."),
|
|
10257
10321
|
withdrawQuestionIds: external_exports.array(questionHandle).min(1).max(10).optional().describe(
|
|
@@ -10417,6 +10481,8 @@ var SearchToolSchema = external_exports.object({
|
|
|
10417
10481
|
limit: external_exports.number().int().min(1).max(20).optional()
|
|
10418
10482
|
}).strict();
|
|
10419
10483
|
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.";
|
|
10484
|
+
var READS = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
|
|
10485
|
+
var SENDS = { readOnlyHint: false, destructiveHint: true, openWorldHint: false };
|
|
10420
10486
|
var ConfigureIdentitySchema = external_exports.object({}).strict();
|
|
10421
10487
|
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.";
|
|
10422
10488
|
var CheckActivitySchema = external_exports.object({}).strict();
|
|
@@ -10428,16 +10494,16 @@ var SendFeedbackSchema = external_exports.object({
|
|
|
10428
10494
|
}).strict();
|
|
10429
10495
|
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.";
|
|
10430
10496
|
var AGENT_TOOLS = [
|
|
10431
|
-
{ name: "configure", description: CONFIGURE_IDENTITY_DESCRIPTION, inputSchema: mcpInputSchema(ConfigureIdentitySchema) },
|
|
10432
|
-
{ name: "contact", description: CONTACT_DESCRIPTION, inputSchema: CONTACT_SCHEMA },
|
|
10433
|
-
{ name: "manage_goals", description: MANAGE_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(ManageGoalsToolSchema) },
|
|
10434
|
-
{ name: "get_delivery", description: GET_DELIVERY_DESCRIPTION, inputSchema: mcpInputSchema(GetDeliverySchema) },
|
|
10435
|
-
{ name: "get_goals", description: GET_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(GetGoalsSchema) },
|
|
10436
|
-
{ name: "search", description: SEARCH_DESCRIPTION, inputSchema: mcpInputSchema(SearchToolSchema) },
|
|
10437
|
-
{ 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) },
|
|
10438
|
-
{ name: "send_feedback", description: SEND_FEEDBACK_DESCRIPTION, inputSchema: mcpInputSchema(SendFeedbackSchema) },
|
|
10497
|
+
{ name: "configure", title: "Who am I", annotations: READS, description: CONFIGURE_IDENTITY_DESCRIPTION, inputSchema: mcpInputSchema(ConfigureIdentitySchema) },
|
|
10498
|
+
{ name: "contact", title: "Contact the person", annotations: SENDS, description: CONTACT_DESCRIPTION, inputSchema: CONTACT_SCHEMA },
|
|
10499
|
+
{ name: "manage_goals", title: "Manage Goals", annotations: SENDS, description: MANAGE_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(ManageGoalsToolSchema) },
|
|
10500
|
+
{ name: "get_delivery", title: "Read a delivery", annotations: READS, description: GET_DELIVERY_DESCRIPTION, inputSchema: mcpInputSchema(GetDeliverySchema) },
|
|
10501
|
+
{ name: "get_goals", title: "Read Goals", annotations: READS, description: GET_GOALS_DESCRIPTION, inputSchema: mcpInputSchema(GetGoalsSchema) },
|
|
10502
|
+
{ name: "search", title: "Search history", annotations: READS, description: SEARCH_DESCRIPTION, inputSchema: mcpInputSchema(SearchToolSchema) },
|
|
10503
|
+
{ 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) },
|
|
10504
|
+
{ name: "send_feedback", title: "Send feedback to Paigy", annotations: SENDS, description: SEND_FEEDBACK_DESCRIPTION, inputSchema: mcpInputSchema(SendFeedbackSchema) },
|
|
10439
10505
|
// THE GUIDE FROM INSIDE THE MCP (owner, 2026-10-27): the skill's text, needing no identity (`help.ts`).
|
|
10440
|
-
{ name: "help", description: HELP_DESCRIPTION, inputSchema: mcpInputSchema(HelpSchema) }
|
|
10506
|
+
{ name: "help", title: "Paigy guide", annotations: READS, description: HELP_DESCRIPTION, inputSchema: mcpInputSchema(HelpSchema) }
|
|
10441
10507
|
];
|
|
10442
10508
|
var AGENT_TOOL_NAMES = AGENT_TOOLS.map((t) => t.name);
|
|
10443
10509
|
var id = external_exports.string().uuid();
|
|
@@ -11217,6 +11283,10 @@ var InboxItemSchema = external_exports.object({
|
|
|
11217
11283
|
branch: external_exports.string().optional(),
|
|
11218
11284
|
createdAt: external_exports.string().datetime(),
|
|
11219
11285
|
snoozedUntil: external_exports.string().datetime().optional(),
|
|
11286
|
+
/** A past card the person dismissed that Restore can take back (#2699): its newest close is their
|
|
11287
|
+
* dismissal, with what it withdrew recorded (`private.restore_delivery`). Absent on everything else —
|
|
11288
|
+
* a put-off, a card an ended Goal or a settled question closed, and every open card. */
|
|
11289
|
+
restorable: external_exports.boolean().optional(),
|
|
11220
11290
|
agentState: AgentStateSchema.default("idle"),
|
|
11221
11291
|
/** Whose action the item is waiting on: "you" = an agent asked you (the default,
|
|
11222
11292
|
* every agent→user notification); "agent" = you sent a request and it's awaiting the
|
|
@@ -11397,8 +11467,8 @@ var UserSettingsSchema = external_exports.object({
|
|
|
11397
11467
|
* write, 'hosted' on read (see store.ts). */
|
|
11398
11468
|
voiceMode: external_exports.enum(["hosted", "on_device"]).optional(),
|
|
11399
11469
|
/** `talk` lived here until #2373: it gated auto-play, which went in #2374. An older bundle's
|
|
11400
|
-
* `talk` is stripped like `silentPush` was
|
|
11401
|
-
*
|
|
11470
|
+
* `talk` is stripped like `silentPush` was, and the `user_settings.talk` column went in
|
|
11471
|
+
* 20261028142255. */
|
|
11402
11472
|
/** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
|
|
11403
11473
|
* load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
|
|
11404
11474
|
* newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
|
|
@@ -11505,6 +11575,12 @@ var ConnectionSummarySchema = external_exports.object({
|
|
|
11505
11575
|
* its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
|
|
11506
11576
|
* `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
|
|
11507
11577
|
lastWorkedAt: external_exports.string().datetime().nullable().optional(),
|
|
11578
|
+
/** A TERMINAL SESSION'S ONLY PULSE (`tokens.listened_at`): `paigy-listen` stamps it on every sweep
|
|
11579
|
+
* (90 s). It is deliberately NOT presence — `last_seen_at` is the desktop host's beat, and a
|
|
11580
|
+
* listener orphaned from a dead conversation must not light the live dot — but it is the one fact
|
|
11581
|
+
* that says a terminal session's process is UP, which is why the wake already reads it
|
|
11582
|
+
* (`wake.ts`, `listener`). Null = no listener sweeping. */
|
|
11583
|
+
listenedAt: external_exports.string().datetime().nullable().optional(),
|
|
11508
11584
|
/** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
|
|
11509
11585
|
* With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
|
|
11510
11586
|
oldestReadyAt: external_exports.string().datetime().nullable().optional(),
|
|
@@ -11834,7 +11910,7 @@ var DeviceTokenSchema = external_exports.object({
|
|
|
11834
11910
|
* the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
|
|
11835
11911
|
workspace: external_exports.string().nullable().optional(),
|
|
11836
11912
|
/** Local host recovery must preserve the launch's runtime and Paigy identity. */
|
|
11837
|
-
harness: external_exports.enum(["claude", "codex", "agy"]).optional(),
|
|
11913
|
+
harness: external_exports.enum(["claude", "codex", "agy", "grok"]).optional(),
|
|
11838
11914
|
session_id: external_exports.string().uuid().optional(),
|
|
11839
11915
|
/** A conversation the host must not resume: its context is full, so every turn fails
|
|
11840
11916
|
* ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
|
|
@@ -12334,6 +12410,10 @@ async function listConnections(opts = {}) {
|
|
|
12334
12410
|
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.`;
|
|
12335
12411
|
var APPLIED = "Applied; nothing was sent to the person.";
|
|
12336
12412
|
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.";
|
|
12413
|
+
function citeOf(receipt) {
|
|
12414
|
+
if (!receipt.uncited?.length) return {};
|
|
12415
|
+
return { uncited: receipt.uncited, ...receipt.cite ? { cite: receipt.cite } : {} };
|
|
12416
|
+
}
|
|
12337
12417
|
async function readDelivery(deliveryId, opts = {}) {
|
|
12338
12418
|
const query = opts.transcript ? `?transcript=1${opts.after ? `&after=${encodeURIComponent(opts.after)}` : ""}` : "";
|
|
12339
12419
|
const res = await ensureAuthed(await (opts.reach ?? reach)(`${BACKEND_URL}/api/deliveries/${encodeURIComponent(deliveryId)}${query}`, {
|
|
@@ -12375,7 +12455,7 @@ async function contact(input, opts = {}) {
|
|
|
12375
12455
|
const demoted = askedCall && receipt.channel && receipt.channel !== "call" ? DEMOTED : void 0;
|
|
12376
12456
|
const acked = acknowledged ? { acknowledged } : {};
|
|
12377
12457
|
if (!deliveries.length) {
|
|
12378
|
-
return { sent: false, ok, results, ...recorded.length ? { recorded } : {}, message: recorded.length ? NOT_SENT : APPLIED, waitOutcome: "not_waited", ...acked };
|
|
12458
|
+
return { sent: false, ok, results, ...recorded.length ? { recorded } : {}, message: recorded.length ? NOT_SENT : APPLIED, waitOutcome: "not_waited", ...acked, ...citeOf(receipt) };
|
|
12379
12459
|
}
|
|
12380
12460
|
const lead = deliveries.find((d) => d.kind === "question") ?? deliveries[0];
|
|
12381
12461
|
const read3 = async (signal2) => {
|
|
@@ -12392,7 +12472,8 @@ async function contact(input, opts = {}) {
|
|
|
12392
12472
|
...demoted ? { demoted } : {},
|
|
12393
12473
|
...acked,
|
|
12394
12474
|
...receipt.ringPolicy ? { ringPolicy: receipt.ringPolicy, ...receipt.message ? { ringHeld: receipt.message } : {} } : {},
|
|
12395
|
-
...receipt.recheckAt ? { recheckAt: receipt.recheckAt } : {}
|
|
12475
|
+
...receipt.recheckAt ? { recheckAt: receipt.recheckAt } : {},
|
|
12476
|
+
...citeOf(receipt)
|
|
12396
12477
|
};
|
|
12397
12478
|
};
|
|
12398
12479
|
const settled = (d) => d.state === "closed" || d.answers.length > 0 || d.entries.some((e) => e.kind === "contribution" && !entryUnit(e));
|
|
@@ -12637,12 +12718,23 @@ var CATALOG = [
|
|
|
12637
12718
|
loginHint: "Install and set up Antigravity (`agy`).",
|
|
12638
12719
|
installCli: "curl -fsSL https://antigravity.dev/install.sh | bash",
|
|
12639
12720
|
models: ["gemini-1.5-pro", "gemini-1.5-flash", "gemini-2.0-pro-exp"]
|
|
12721
|
+
},
|
|
12722
|
+
{
|
|
12723
|
+
name: "grok",
|
|
12724
|
+
label: "Grok",
|
|
12725
|
+
cli: "grok",
|
|
12726
|
+
// `grok agent stdio` speaks ACP itself. A separate adapter would be a second binary
|
|
12727
|
+
// to miss, and detection would report adapter-missing on a machine that can already launch.
|
|
12728
|
+
authProbe: ["sh", "-c", 'test -s "$HOME/.grok/auth.json"'],
|
|
12729
|
+
loginHint: "Run `grok` once in a terminal and sign in.",
|
|
12730
|
+
installCli: "curl -fsSL https://x.ai/cli/install.sh | bash"
|
|
12640
12731
|
}
|
|
12641
12732
|
];
|
|
12642
12733
|
function probeDirs(home = homedir3()) {
|
|
12643
12734
|
return [
|
|
12644
12735
|
dirname(process.execPath),
|
|
12645
12736
|
join4(home, ".local", "bin"),
|
|
12737
|
+
join4(home, ".grok", "bin"),
|
|
12646
12738
|
"/usr/local/bin",
|
|
12647
12739
|
"/opt/homebrew/bin",
|
|
12648
12740
|
join4(home, ".npm-global", "bin")
|
|
@@ -14055,10 +14147,22 @@ function capRefusals2(text, units22, field) {
|
|
|
14055
14147
|
function refuseOverCaps2(text, units22, field, ctx) {
|
|
14056
14148
|
for (const { path, message, ...params } of capRefusals2(text, units22, field)) ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path, message, params });
|
|
14057
14149
|
}
|
|
14150
|
+
var SHIPPED2 = ["phone", "calls", "server", "store", "agents"];
|
|
14151
|
+
var CAUSES_MAX2 = 10;
|
|
14152
|
+
var shipped2 = external_exports.enum(SHIPPED2, {
|
|
14153
|
+
errorMap: () => ({ message: `shipped_unknown: one of ${SHIPPED2.join(", ")}.` })
|
|
14154
|
+
}).optional().describe(
|
|
14155
|
+
"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."
|
|
14156
|
+
);
|
|
14157
|
+
var causedBy2 = external_exports.array(
|
|
14158
|
+
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.")
|
|
14159
|
+
).min(1).max(CAUSES_MAX2, `too_many_causes: at most ${CAUSES_MAX2}.`).optional().describe(
|
|
14160
|
+
`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.`
|
|
14161
|
+
);
|
|
14058
14162
|
var COMPLETION_MESSAGE_MAX2 = 50;
|
|
14059
14163
|
var CompletionSchema2 = external_exports.object({
|
|
14060
14164
|
goalId: external_exports.string().uuid().describe("The existing Goal to complete."),
|
|
14061
|
-
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."),
|
|
14165
|
+
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."),
|
|
14062
14166
|
units: external_exports.array(UnitInputSchema2.extend({
|
|
14063
14167
|
title: external_exports.string().trim().min(1).max(UNIT_TITLE_MAX2),
|
|
14064
14168
|
body: external_exports.string().trim().min(1).max(UNIT_BODY_MAX2)
|
|
@@ -14067,9 +14171,11 @@ var CompletionSchema2 = external_exports.object({
|
|
|
14067
14171
|
options: external_exports.array(external_exports.object({
|
|
14068
14172
|
label: external_exports.string().trim().min(1).max(OPTION_LABEL_MAX2),
|
|
14069
14173
|
hint: external_exports.string().trim().min(1).max(OPTION_HINT_MAX2)
|
|
14070
|
-
}).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.")
|
|
14174
|
+
}).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."),
|
|
14175
|
+
causedBy: causedBy2,
|
|
14176
|
+
shipped: shipped2
|
|
14071
14177
|
}).strict();
|
|
14072
|
-
var CompleteChangeSchema2 = CompletionSchema2.extend({ kind: external_exports.literal("complete") });
|
|
14178
|
+
var CompleteChangeSchema2 = CompletionSchema2.omit({ causedBy: true, shipped: true }).extend({ kind: external_exports.literal("complete") });
|
|
14073
14179
|
var ASKING_RULES2 = `HOW TO ASK:
|
|
14074
14180
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
14075
14181
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
@@ -14122,12 +14228,55 @@ var userExplicitlyRequested2 = external_exports.enum(["any", "call"]).optional()
|
|
|
14122
14228
|
`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.`
|
|
14123
14229
|
);
|
|
14124
14230
|
var units2 = external_exports.array(UnitInputSchema2).optional().describe(
|
|
14125
|
-
`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.`
|
|
14231
|
+
`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.`
|
|
14126
14232
|
);
|
|
14233
|
+
var KIND_IDS2 = { "handing": "none", "replaced-by": "goal", "blocked-by": "node", "asking": "none", "found": "none" };
|
|
14234
|
+
var KIND_GRAMMAR2 = "handing, replaced-by <goalId>, blocked-by <goalId|questionId>, asking, found";
|
|
14235
|
+
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}$/;
|
|
14236
|
+
var handle2 = /^[0-9a-fA-F-]{8,36}$/;
|
|
14237
|
+
function refuseKind2(u, ctx) {
|
|
14238
|
+
if (!u.kind) return;
|
|
14239
|
+
const refuse = (refusal, kind, message) => ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["kind"], params: { refusal, kind }, message });
|
|
14240
|
+
const [name, ...rest] = u.kind.trim().split(/\s+/);
|
|
14241
|
+
const shape = KIND_IDS2[name];
|
|
14242
|
+
if (!shape) {
|
|
14243
|
+
refuse("kind_unknown", name, `kind_unknown: "${name}" is not a kind. One of: ${KIND_GRAMMAR2}.`);
|
|
14244
|
+
return;
|
|
14245
|
+
}
|
|
14246
|
+
const id22 = rest.join(" ");
|
|
14247
|
+
if (shape === "none" && id22) {
|
|
14248
|
+
refuse("kind_takes_no_id", name, `kind_takes_no_id: "${name}" is the whole kind, so drop the "${id22}" after it.`);
|
|
14249
|
+
}
|
|
14250
|
+
if (shape !== "none" && !(shape === "goal" ? uuid2.test(id22) : handle2.test(id22))) {
|
|
14251
|
+
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>".`);
|
|
14252
|
+
}
|
|
14253
|
+
if (name === "asking") {
|
|
14254
|
+
refuse("kind_is_a_question", name, 'kind_is_a_question: "asking" owes them an answer, so send it in `questions`, where it opens one.');
|
|
14255
|
+
}
|
|
14256
|
+
if (u.userExplicitlyRequested) {
|
|
14257
|
+
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.`);
|
|
14258
|
+
}
|
|
14259
|
+
}
|
|
14127
14260
|
var UpdateInputSchema2 = external_exports.object({
|
|
14128
|
-
|
|
14261
|
+
// ONE LOAD-BEARING POINT PER REPORT (owner, 2026-10-27 14:10 on call, Goal 1b1750e9, settling
|
|
14262
|
+
// #3633's pacing: "one point at a time is better, but make sure that it's [load-]bearing ... if
|
|
14263
|
+
// there is a lot of key points that I need to be aware of ... meaning something bad would happen
|
|
14264
|
+
// if I didn't know them or I wouldn't be able to understand something in the future ... They
|
|
14265
|
+
// should go separately. Basically, it should be like one load-bearing thing per report").
|
|
14266
|
+
//
|
|
14267
|
+
// The call's half of that ruling shipped in #3771: the talker settles an item only once the
|
|
14268
|
+
// transcript shows he heard its load-bearing point. This is the author's half, and without it the
|
|
14269
|
+
// talker has to guess which of a report's parts was load-bearing. Measured 2026-11-01 on prod:
|
|
14270
|
+
// 458 of 866 reports in 21 days carried two or more units, and since the pacing shipped on 10-23
|
|
14271
|
+
// only 18 of 72 units that reached a call were ever said -- so a point written as a unit has about
|
|
14272
|
+
// a one-in-four chance of being heard, and one ok after the headline settles the whole report.
|
|
14273
|
+
// Hence the wording, not a `mustHear` flag (the-heard-record.md P3): he asked for less mechanism
|
|
14274
|
+
// and more judgment from the agent, so a point he must not miss is simply its own report.
|
|
14275
|
+
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.`),
|
|
14129
14276
|
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."),
|
|
14130
14277
|
units: units2,
|
|
14278
|
+
causedBy: causedBy2,
|
|
14279
|
+
shipped: shipped2,
|
|
14131
14280
|
// A REPORT KEEPS ITS TAP (#2799, #3260; owner, 2026-10-08, settling #2776: "keep the reports open
|
|
14132
14281
|
// until the user acknowledges them"). A report asks nothing, so it opens no Question -- but it
|
|
14133
14282
|
// still waits to be acknowledged, and it carries the ONE tap that closes it. Never a decision: the
|
|
@@ -14151,6 +14300,12 @@ var UpdateInputSchema2 = external_exports.object({
|
|
|
14151
14300
|
reply: external_exports.string().trim().min(1).describe(
|
|
14152
14301
|
`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.`
|
|
14153
14302
|
).optional(),
|
|
14303
|
+
// THE KIND, WHICH WAS THE FIRST LINE OF THE MESSAGE UNTIL NOW (`KIND_IDS` above). Optional on
|
|
14304
|
+
// purpose: every agent writing updates today sends none, and a door that refused them would turn a
|
|
14305
|
+
// convention nobody was obliged to follow into a 400 on live traffic.
|
|
14306
|
+
kind: external_exports.string().trim().min(1).optional().describe(
|
|
14307
|
+
`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).`
|
|
14308
|
+
),
|
|
14154
14309
|
userExplicitlyRequested: userExplicitlyRequested2
|
|
14155
14310
|
}).strict().superRefine((u, ctx) => {
|
|
14156
14311
|
if (u.userExplicitlyRequested && !u.reply) {
|
|
@@ -14162,6 +14317,7 @@ var UpdateInputSchema2 = external_exports.object({
|
|
|
14162
14317
|
});
|
|
14163
14318
|
}
|
|
14164
14319
|
refuseOverCaps2(u.message, u.units, "message", ctx);
|
|
14320
|
+
refuseKind2(u, ctx);
|
|
14165
14321
|
if (u.reply && u.reply.length > OPTION_LABEL_MAX2) {
|
|
14166
14322
|
ctx.addIssue({
|
|
14167
14323
|
code: external_exports.ZodIssueCode.custom,
|
|
@@ -14251,7 +14407,7 @@ var sendFields2 = {
|
|
|
14251
14407
|
"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."
|
|
14252
14408
|
),
|
|
14253
14409
|
updates: external_exports.array(UpdateInputSchema2).min(1).max(20).optional().describe(
|
|
14254
|
-
"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."
|
|
14410
|
+
"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."
|
|
14255
14411
|
),
|
|
14256
14412
|
answers: external_exports.array(AnswerInputSchema2).min(1).max(20).optional().describe("Answers to Questions addressed to you."),
|
|
14257
14413
|
withdrawQuestionIds: external_exports.array(questionHandle2).min(1).max(10).optional().describe(
|
|
@@ -14417,6 +14573,8 @@ var SearchToolSchema2 = external_exports.object({
|
|
|
14417
14573
|
limit: external_exports.number().int().min(1).max(20).optional()
|
|
14418
14574
|
}).strict();
|
|
14419
14575
|
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.";
|
|
14576
|
+
var READS2 = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };
|
|
14577
|
+
var SENDS2 = { readOnlyHint: false, destructiveHint: true, openWorldHint: false };
|
|
14420
14578
|
var ConfigureIdentitySchema2 = external_exports.object({}).strict();
|
|
14421
14579
|
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.";
|
|
14422
14580
|
var CheckActivitySchema2 = external_exports.object({}).strict();
|
|
@@ -14428,16 +14586,16 @@ var SendFeedbackSchema2 = external_exports.object({
|
|
|
14428
14586
|
}).strict();
|
|
14429
14587
|
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.";
|
|
14430
14588
|
var AGENT_TOOLS2 = [
|
|
14431
|
-
{ name: "configure", description: CONFIGURE_IDENTITY_DESCRIPTION2, inputSchema: mcpInputSchema2(ConfigureIdentitySchema2) },
|
|
14432
|
-
{ name: "contact", description: CONTACT_DESCRIPTION2, inputSchema: CONTACT_SCHEMA2 },
|
|
14433
|
-
{ name: "manage_goals", description: MANAGE_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(ManageGoalsToolSchema2) },
|
|
14434
|
-
{ name: "get_delivery", description: GET_DELIVERY_DESCRIPTION2, inputSchema: mcpInputSchema2(GetDeliverySchema2) },
|
|
14435
|
-
{ name: "get_goals", description: GET_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(GetGoalsSchema2) },
|
|
14436
|
-
{ name: "search", description: SEARCH_DESCRIPTION2, inputSchema: mcpInputSchema2(SearchToolSchema2) },
|
|
14437
|
-
{ 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) },
|
|
14438
|
-
{ name: "send_feedback", description: SEND_FEEDBACK_DESCRIPTION2, inputSchema: mcpInputSchema2(SendFeedbackSchema2) },
|
|
14589
|
+
{ name: "configure", title: "Who am I", annotations: READS2, description: CONFIGURE_IDENTITY_DESCRIPTION2, inputSchema: mcpInputSchema2(ConfigureIdentitySchema2) },
|
|
14590
|
+
{ name: "contact", title: "Contact the person", annotations: SENDS2, description: CONTACT_DESCRIPTION2, inputSchema: CONTACT_SCHEMA2 },
|
|
14591
|
+
{ name: "manage_goals", title: "Manage Goals", annotations: SENDS2, description: MANAGE_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(ManageGoalsToolSchema2) },
|
|
14592
|
+
{ name: "get_delivery", title: "Read a delivery", annotations: READS2, description: GET_DELIVERY_DESCRIPTION2, inputSchema: mcpInputSchema2(GetDeliverySchema2) },
|
|
14593
|
+
{ name: "get_goals", title: "Read Goals", annotations: READS2, description: GET_GOALS_DESCRIPTION2, inputSchema: mcpInputSchema2(GetGoalsSchema2) },
|
|
14594
|
+
{ name: "search", title: "Search history", annotations: READS2, description: SEARCH_DESCRIPTION2, inputSchema: mcpInputSchema2(SearchToolSchema2) },
|
|
14595
|
+
{ 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) },
|
|
14596
|
+
{ name: "send_feedback", title: "Send feedback to Paigy", annotations: SENDS2, description: SEND_FEEDBACK_DESCRIPTION2, inputSchema: mcpInputSchema2(SendFeedbackSchema2) },
|
|
14439
14597
|
// THE GUIDE FROM INSIDE THE MCP (owner, 2026-10-27): the skill's text, needing no identity (`help.ts`).
|
|
14440
|
-
{ name: "help", description: HELP_DESCRIPTION2, inputSchema: mcpInputSchema2(HelpSchema2) }
|
|
14598
|
+
{ name: "help", title: "Paigy guide", annotations: READS2, description: HELP_DESCRIPTION2, inputSchema: mcpInputSchema2(HelpSchema2) }
|
|
14441
14599
|
];
|
|
14442
14600
|
var AGENT_TOOL_NAMES2 = AGENT_TOOLS2.map((t) => t.name);
|
|
14443
14601
|
var id2 = external_exports.string().uuid();
|
|
@@ -15228,6 +15386,10 @@ var InboxItemSchema2 = external_exports.object({
|
|
|
15228
15386
|
branch: external_exports.string().optional(),
|
|
15229
15387
|
createdAt: external_exports.string().datetime(),
|
|
15230
15388
|
snoozedUntil: external_exports.string().datetime().optional(),
|
|
15389
|
+
/** A past card the person dismissed that Restore can take back (#2699): its newest close is their
|
|
15390
|
+
* dismissal, with what it withdrew recorded (`private.restore_delivery`). Absent on everything else —
|
|
15391
|
+
* a put-off, a card an ended Goal or a settled question closed, and every open card. */
|
|
15392
|
+
restorable: external_exports.boolean().optional(),
|
|
15231
15393
|
agentState: AgentStateSchema2.default("idle"),
|
|
15232
15394
|
/** Whose action the item is waiting on: "you" = an agent asked you (the default,
|
|
15233
15395
|
* every agent→user notification); "agent" = you sent a request and it's awaiting the
|
|
@@ -15408,8 +15570,8 @@ var UserSettingsSchema2 = external_exports.object({
|
|
|
15408
15570
|
* write, 'hosted' on read (see store.ts). */
|
|
15409
15571
|
voiceMode: external_exports.enum(["hosted", "on_device"]).optional(),
|
|
15410
15572
|
/** `talk` lived here until #2373: it gated auto-play, which went in #2374. An older bundle's
|
|
15411
|
-
* `talk` is stripped like `silentPush` was
|
|
15412
|
-
*
|
|
15573
|
+
* `talk` is stripped like `silentPush` was, and the `user_settings.talk` column went in
|
|
15574
|
+
* 20261028142255. */
|
|
15413
15575
|
/** CALL DIAGNOSTICS (owner, 2026-10-01): the call report carries each listen and the bot's own
|
|
15414
15576
|
* load timings. SERVER-SET, no UI — on for every account that existed on 2026-10-01, off for
|
|
15415
15577
|
* newer ones (migration 20261001132859). Read-only here: the settings PATCH never writes it. */
|
|
@@ -15516,6 +15678,12 @@ var ConnectionSummarySchema2 = external_exports.object({
|
|
|
15516
15678
|
* its Goals — wrote on one or recorded an operation (`tokens.last_worked_at`). Within
|
|
15517
15679
|
* `WORKING_MS` it is working; otherwise it is connected but idle. Null = not seen working yet. */
|
|
15518
15680
|
lastWorkedAt: external_exports.string().datetime().nullable().optional(),
|
|
15681
|
+
/** A TERMINAL SESSION'S ONLY PULSE (`tokens.listened_at`): `paigy-listen` stamps it on every sweep
|
|
15682
|
+
* (90 s). It is deliberately NOT presence — `last_seen_at` is the desktop host's beat, and a
|
|
15683
|
+
* listener orphaned from a dead conversation must not light the live dot — but it is the one fact
|
|
15684
|
+
* that says a terminal session's process is UP, which is why the wake already reads it
|
|
15685
|
+
* (`wake.ts`, `listener`). Null = no listener sweeping. */
|
|
15686
|
+
listenedAt: external_exports.string().datetime().nullable().optional(),
|
|
15519
15687
|
/** The oldest of its Goals that is `ready` for it — work handed to it that nobody has started.
|
|
15520
15688
|
* With no work of its own for `WORKING_MS`, an agent sitting on this is not taking its work. */
|
|
15521
15689
|
oldestReadyAt: external_exports.string().datetime().nullable().optional(),
|
|
@@ -15843,7 +16011,7 @@ var DeviceTokenSchema2 = external_exports.object({
|
|
|
15843
16011
|
* the thread each time (host.ts, live catch 2026-08-06 — prompt-papered until now). */
|
|
15844
16012
|
workspace: external_exports.string().nullable().optional(),
|
|
15845
16013
|
/** Local host recovery must preserve the launch's runtime and Paigy identity. */
|
|
15846
|
-
harness: external_exports.enum(["claude", "codex", "agy"]).optional(),
|
|
16014
|
+
harness: external_exports.enum(["claude", "codex", "agy", "grok"]).optional(),
|
|
15847
16015
|
session_id: external_exports.string().uuid().optional(),
|
|
15848
16016
|
/** A conversation the host must not resume: its context is full, so every turn fails
|
|
15849
16017
|
* ("Prompt is too long"). Written when a run hits it (`run.ts` `onFull`); the host skips a slot
|
|
@@ -16456,6 +16624,11 @@ import { resolve as resolve2, delimiter as delimiter2, join as join9 } from "pat
|
|
|
16456
16624
|
// src/harness/acp.ts
|
|
16457
16625
|
var none = { events: [], writes: [] };
|
|
16458
16626
|
var NOTHING_TO_RESUME = /* @__PURE__ */ new Set([-32002, -32601]);
|
|
16627
|
+
function nothingToResume(error) {
|
|
16628
|
+
if (!error || error.code === void 0) return false;
|
|
16629
|
+
if (NOTHING_TO_RESUME.has(error.code)) return true;
|
|
16630
|
+
return error.code === -32603 && (error.data?.code === "FS_NOT_FOUND" || /^Path not found\b/.test(error.message ?? ""));
|
|
16631
|
+
}
|
|
16459
16632
|
function optionFor(options, decision) {
|
|
16460
16633
|
const want = decision.allow ? "allow_once" : "reject_once";
|
|
16461
16634
|
return options.find((o) => o.kind === want)?.optionId ?? null;
|
|
@@ -16592,11 +16765,11 @@ var AcpDriver = class {
|
|
|
16592
16765
|
if (msg.id === this.sessionNewId) {
|
|
16593
16766
|
this.sessionNewId = void 0;
|
|
16594
16767
|
const resuming = this.resume !== void 0;
|
|
16595
|
-
if (resuming &&
|
|
16768
|
+
if (resuming && nothingToResume(msg.error)) {
|
|
16596
16769
|
this.resume = void 0;
|
|
16597
16770
|
this.sessionNewId = this.nextId++;
|
|
16598
16771
|
return {
|
|
16599
|
-
events: [{ kind: "error", message: `session/resume found nothing to resume (${msg.error.message}) \u2014 opening a new conversation` }],
|
|
16772
|
+
events: [{ kind: "error", message: `session/resume found nothing to resume (${msg.error.message ?? "no message"}) \u2014 opening a new conversation` }],
|
|
16600
16773
|
writes: [frame2(this.opening(this.sessionNewId))]
|
|
16601
16774
|
};
|
|
16602
16775
|
}
|
|
@@ -16796,8 +16969,16 @@ function inboxFor(root = INBOX_ROOT) {
|
|
|
16796
16969
|
var ADAPTER_BIN = {
|
|
16797
16970
|
claude: "claude-agent-acp",
|
|
16798
16971
|
codex: "codex-acp",
|
|
16799
|
-
agy: "paigy-agy-acp"
|
|
16972
|
+
agy: "paigy-agy-acp",
|
|
16973
|
+
grok: "grok"
|
|
16800
16974
|
};
|
|
16975
|
+
function grokArgs(opts) {
|
|
16976
|
+
const args = ["agent"];
|
|
16977
|
+
if (opts.mode === "bypass") args.push("--always-approve");
|
|
16978
|
+
if (opts.model) args.push("--model", opts.model);
|
|
16979
|
+
args.push("stdio");
|
|
16980
|
+
return args;
|
|
16981
|
+
}
|
|
16801
16982
|
var CLAUDE_ONE_WAY_IN = {
|
|
16802
16983
|
env: { CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: "1" },
|
|
16803
16984
|
disallowedTools: ["Monitor", "ScheduleWakeup", "CronCreate", "Workflow"]
|
|
@@ -16838,7 +17019,7 @@ function startSession(opts) {
|
|
|
16838
17019
|
const inherited = [...savedVars.matchAll(/["']([A-Za-z_][A-Za-z0-9_]*)["']/g)].map((match) => match[1]);
|
|
16839
17020
|
codexConfig[key3] = [.../* @__PURE__ */ new Set([...inherited, ...codexConfig[key3] ?? codexConfig.mcp_servers?.paigy?.env_vars ?? [], ...CODEX_ENV])];
|
|
16840
17021
|
}
|
|
16841
|
-
const child = (opts.spawnFn ?? spawn)(opts.bin ?? ADAPTER_BIN[opts.harness], [], {
|
|
17022
|
+
const child = (opts.spawnFn ?? spawn)(opts.bin ?? ADAPTER_BIN[opts.harness], opts.harness === "grok" ? grokArgs(opts) : [], {
|
|
16842
17023
|
cwd,
|
|
16843
17024
|
// The adapter shells out to its vendor CLI (`claude`, `codex`), and a GUI- or
|
|
16844
17025
|
// launchd-launched process's PATH won't have it — probe dirs plus the RUNNING
|
|
@@ -17736,7 +17917,7 @@ function runHarness(opts) {
|
|
|
17736
17917
|
opts.log("\u25B6 running again after the limit");
|
|
17737
17918
|
LIMITS.running(name, (text) => callForResume(text, state, rail), opts.log);
|
|
17738
17919
|
}
|
|
17739
|
-
async function
|
|
17920
|
+
async function handle3(event) {
|
|
17740
17921
|
if (event.kind === "error") {
|
|
17741
17922
|
opts.log(`\u26A0 ${event.message}`);
|
|
17742
17923
|
if (event.fatal && running) {
|
|
@@ -17795,7 +17976,7 @@ ${event.message}`, state, rail, { log: opts.log });
|
|
|
17795
17976
|
inbox?.close();
|
|
17796
17977
|
opts.onExit?.();
|
|
17797
17978
|
},
|
|
17798
|
-
onEvent: (event) => void
|
|
17979
|
+
onEvent: (event) => void handle3(event).catch((err) => opts.log(`\u26A0 ${err.message}`))
|
|
17799
17980
|
});
|
|
17800
17981
|
void pump(session, state, rail, { onIdle: () => running, beat: clock4, initialPrompt: opts.prompt, log: opts.log, ...inbox ? { inbox } : {} }).catch(
|
|
17801
17982
|
(e) => opts.log(`\u26A0 conversation loop stopped: ${e.message}`)
|
|
@@ -17904,7 +18085,7 @@ function selfUpdater(deps) {
|
|
|
17904
18085
|
var HOST_FILE = join11(homedir9(), ".paigy", "host.json");
|
|
17905
18086
|
function wakeHarness(slot, saved, claudeTranscript) {
|
|
17906
18087
|
if (slot === "Desktop") return void 0;
|
|
17907
|
-
if (saved !== null) return saved === "agy" || saved === "codex" || saved === "claude" ? saved : void 0;
|
|
18088
|
+
if (saved !== null) return saved === "agy" || saved === "codex" || saved === "claude" || saved === "grok" ? saved : void 0;
|
|
17908
18089
|
if (claudeTranscript) return "claude";
|
|
17909
18090
|
if (slot === "mcp-agent" || slot === "Claude Code") return "claude";
|
|
17910
18091
|
if (slot === "codex") return "codex";
|