@paigy/harness 0.3.47 → 0.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +144 -28
- package/dist/main.js +144 -28
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -28826,11 +28826,11 @@ var CompleteChangeSchema = CompletionSchema.omit({ causedBy: true, shipped: true
|
|
|
28826
28826
|
var ASKING_RULES = `HOW TO ASK:
|
|
28827
28827
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
28828
28828
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
28829
|
-
3.
|
|
28829
|
+
3. They asked you to call? \`userExplicitlyRequested:"call"\`; \`workItBlocks\` rings when blocked.
|
|
28830
28830
|
4. No while-loops. While any Call is open, even one your question joined from their items, keep receiving through empty windows; otherwise stop at one: the answer reaches you on the Goal. Yield only with a listener or wakeup.
|
|
28831
28831
|
5. One question, one row: never re-send one still waiting; take back one that no longer matters with \`withdrawQuestionIds\`.
|
|
28832
28832
|
6. Read the Goal before asking; never re-ask what was answered or shipped. \`replied\` means they chose no option: it is still yours to settle.
|
|
28833
|
-
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
28833
|
+
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
28834
28834
|
8. A diagnosis says when, why and how it happens, then proposes one fix.
|
|
28835
28835
|
9. Give a report its \`reply\`: one line in THEIR voice for THAT report, so you learn whether they verified it or only received it. Required when it is delivered or its Goal is done.`;
|
|
28836
28836
|
function draft2020(node) {
|
|
@@ -28872,7 +28872,7 @@ var reason = external_exports.string().trim().min(1).max(500).describe("Why, as
|
|
|
28872
28872
|
var actionFits = (b) => b.blocked.type === "goal" === (b.action !== "answer");
|
|
28873
28873
|
var ACTION_FITS = "a goal is blocked from start or complete; a question from answer";
|
|
28874
28874
|
var userExplicitlyRequested = external_exports.enum(["any", "call"]).optional().describe(
|
|
28875
|
-
|
|
28875
|
+
'What the person asked for about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal\'s progress unless the person needs it. ALSO "any" whenever this message directly answers a question they asked you, wherever they asked it -- on a call, in a reply, in passing: their question is the request, so it is delivered every time, even with no pending question of theirs on file and even if they never said to send it. A correction of something you or another agent told them is such an answer. Never set it to make a message louder. This is the field that rings a phone: "call" here is how you call them when they asked you to, and `help` has the whole mechanism.'
|
|
28876
28876
|
);
|
|
28877
28877
|
var units = external_exports.array(UnitInputSchema).optional().describe(
|
|
28878
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.`
|
|
@@ -29092,19 +29092,20 @@ LENGTH: the question, message or answer is the one point, at most ${ASK_MAX} cha
|
|
|
29092
29092
|
UPDATES ask nothing. One reaches the person only when they asked for it, it answers something they said, or its Goal is done; else it is kept as progress. One that reaches them joins an open report card or a live call.
|
|
29093
29093
|
|
|
29094
29094
|
RECEIVING: contact({}) waits ~45 s; contact({wait:false}) returns \`events\` at once. Confirm the ones you handled with contact({ackEventIds}).`;
|
|
29095
|
-
var HELP_TOPICS = ["pairing", "listening", "receiving", "asking", "updates", "goals", "calls"];
|
|
29095
|
+
var HELP_TOPICS = ["pairing", "listening", "receiving", "asking", "updates", "goals", "organize", "calls"];
|
|
29096
29096
|
var unknownTopic = (topic) => `unknown_topic: ${JSON.stringify(topic)} is not a section of the guide. Topics: ${HELP_TOPICS.join(", ")}; or omit topic for the whole guide.`;
|
|
29097
29097
|
var HelpSchema = external_exports.object({
|
|
29098
29098
|
topic: external_exports.enum(HELP_TOPICS, { errorMap: (_issue, ctx) => ({ message: unknownTopic(ctx.data) }) }).optional().describe("One section of the guide. Omit it for the whole guide.")
|
|
29099
29099
|
}).strict();
|
|
29100
|
-
var HELP_DESCRIPTION = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
29100
|
+
var HELP_DESCRIPTION = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals, organizing work, and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
29101
29101
|
var AGENT_PROMPTS = [
|
|
29102
29102
|
{
|
|
29103
29103
|
name: "help",
|
|
29104
29104
|
description: "How to use Paigy: the whole guide, or one topic of it.",
|
|
29105
29105
|
arguments: [{ name: "topic", description: `One section: ${HELP_TOPICS.join(", ")}. Omit it for the whole guide.`, required: false }]
|
|
29106
29106
|
},
|
|
29107
|
-
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." }
|
|
29107
|
+
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." },
|
|
29108
|
+
{ name: "organize", description: "Set up the person's work as a board: areas, projects and steps, proposed on a card before anything is built." }
|
|
29108
29109
|
];
|
|
29109
29110
|
var CreateGoalSchema = external_exports.object({
|
|
29110
29111
|
outcome: external_exports.string().trim().min(1).max(1e4),
|
|
@@ -29153,7 +29154,7 @@ var CreateChange = external_exports.object({
|
|
|
29153
29154
|
title: goalTitle,
|
|
29154
29155
|
outcome: goalOutcome,
|
|
29155
29156
|
ownerId: external_exports.string().trim().min(1).optional().describe("Who owns the work: an agent's participant (as check_activity shows it) or the person's. Omitted: you."),
|
|
29156
|
-
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root."),
|
|
29157
|
+
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root. A project with several parts: create it, then one child per step under it; the person's Work tab counts a project's progress in those steps."),
|
|
29157
29158
|
sourceEntryIds: external_exports.array(external_exports.string().uuid()).max(20).optional().describe("The whole Entries the work came from, ones you can read.")
|
|
29158
29159
|
}).strict();
|
|
29159
29160
|
var EditChange = external_exports.object({ kind: external_exports.literal("edit"), goalId: changedGoal, title: goalTitle.optional(), outcome: goalOutcome.optional() }).strict();
|
|
@@ -29198,7 +29199,7 @@ var ManageGoalsSchema = external_exports.object({
|
|
|
29198
29199
|
var ManageGoalsToolSchema = external_exports.object({
|
|
29199
29200
|
changes: external_exports.array(external_exports.discriminatedUnion("kind", [CreateChange, CompleteChangeSchema, EditChange, StateChange, AssignChange, DeferChange, MoveChange, DependencyChange])).min(1).max(50).describe("The changes, applied in order, each on its own.")
|
|
29200
29201
|
}).strict().superRefine((v, ctx) => editNames(v.changes, ctx));
|
|
29201
|
-
var MANAGE_GOALS_DESCRIPTION = "Create, edit, assign, organize or close work. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
29202
|
+
var MANAGE_GOALS_DESCRIPTION = "Create, edit, assign, organize or close work. SHAPE IT AS PROJECTS WITH STEPS: create a project under its area (parentGoalId; a top-level Goal with children is an area), then each part as its child Goal, so the person sees N of M steps. Move a flat or orphaned Goal of yours into that shape when you touch it; a flat Goal is valid. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
29202
29203
|
var GetGoalsSchema = external_exports.object({
|
|
29203
29204
|
goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals to read, in order; one to ten IDs."),
|
|
29204
29205
|
/** Every entry in full. Without it the read carries the person's words, open questions and your
|
|
@@ -29346,6 +29347,10 @@ var BrainMessageSchema = external_exports.union([
|
|
|
29346
29347
|
// WHAT IT ASKS THE AGENT, IN UNDER TEN WORDS (owner, 2026-10-15: "Yes, add the summary"): the talker's own, stored
|
|
29347
29348
|
// as the sent Entry's summary, which the recap's "Sent to <agent>: …" row shows. Absent on results written before it.
|
|
29348
29349
|
summary: external_exports.string().optional(),
|
|
29350
|
+
// THE PERSON'S LINES IT CARRIES, IN THEIR WORDS (owner, 2026-11-05: "just deliver my exact words to the agent"): the
|
|
29351
|
+
// `entries` keys of those lines, each relayed whole on the agent's Delivery (`context = false`), where the rest of
|
|
29352
|
+
// `entryKeys` ride as context. Absent on results written before it, and on a message that carries none.
|
|
29353
|
+
carries: external_exports.array(key).optional(),
|
|
29349
29354
|
// THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
|
|
29350
29355
|
// the call, and its next contact about it rings them (`public.callbacks`).
|
|
29351
29356
|
callback: external_exports.literal(true).optional()
|
|
@@ -29409,8 +29414,11 @@ var TalkerReplySchema = external_exports.object({
|
|
|
29409
29414
|
* "Yes, add the summary"), which the recap's "Sent to <agent>: …" row shows; `about` names
|
|
29410
29415
|
* handles; `blocks` is the item a question to an agent must be answered before ("" for none);
|
|
29411
29416
|
* `callback` is true on a message to the agent doing work the person asked to be called back about
|
|
29412
|
-
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0).
|
|
29413
|
-
|
|
29417
|
+
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0). `lines` are the
|
|
29418
|
+
* person's line handles a message to an agent carries ([] for none): the agent receives those lines, in their
|
|
29419
|
+
* words, and `text` is then only what the talker adds beyond them (owner, 2026-11-05: "just deliver my exact
|
|
29420
|
+
* words to the agent, keeping the summary as a way for me to navigate them more easily"). */
|
|
29421
|
+
messages: external_exports.array(external_exports.object({ key: str3, to: str3, sentences: strs2, text: str3, summary: str3, about: strs2, blocks: str3, callback: external_exports.boolean(), lines: strs2.optional() }).strict()),
|
|
29414
29422
|
/** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
|
|
29415
29423
|
then: external_exports.enum(["listen", "hold", "end"]),
|
|
29416
29424
|
/** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
|
|
@@ -29428,9 +29436,14 @@ var TalkerReplySchema = external_exports.object({
|
|
|
29428
29436
|
/** The handle of the item to explain ("" for none). */
|
|
29429
29437
|
explain: str3
|
|
29430
29438
|
}).strict();
|
|
29431
|
-
var TALKER_REPLY_JSON_SCHEMA = (({ $schema: _, ...rest }) => rest)(
|
|
29439
|
+
var TALKER_REPLY_JSON_SCHEMA = withEveryMessageField((({ $schema: _, ...rest }) => rest)(
|
|
29432
29440
|
zodToJsonSchema(TalkerReplySchema, { $refStrategy: "none" })
|
|
29433
|
-
);
|
|
29441
|
+
));
|
|
29442
|
+
function withEveryMessageField(schema) {
|
|
29443
|
+
const item = schema.properties?.messages?.items;
|
|
29444
|
+
if (item?.properties) item.required = Object.keys(item.properties);
|
|
29445
|
+
return schema;
|
|
29446
|
+
}
|
|
29434
29447
|
var str4 = external_exports.string();
|
|
29435
29448
|
var strs3 = external_exports.array(external_exports.string());
|
|
29436
29449
|
var FilerReplySchema = external_exports.object({
|
|
@@ -30133,11 +30146,41 @@ var InboxItemSchema = external_exports.object({
|
|
|
30133
30146
|
rev: external_exports.string().optional()
|
|
30134
30147
|
});
|
|
30135
30148
|
var APNS_TOKEN_RE = /^[0-9a-fA-F]{64}$/;
|
|
30149
|
+
var PushDeviceIdSchema = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,200}$/, "not an install id");
|
|
30150
|
+
var PushDeviceSchema = external_exports.object({
|
|
30151
|
+
deviceId: external_exports.string(),
|
|
30152
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
30153
|
+
label: external_exports.string().nullable(),
|
|
30154
|
+
model: external_exports.string().nullable(),
|
|
30155
|
+
/** Calls and banners go here. */
|
|
30156
|
+
rings: external_exports.boolean(),
|
|
30157
|
+
/** It has a token a call can ring. */
|
|
30158
|
+
ringable: external_exports.boolean(),
|
|
30159
|
+
chosenAt: external_exports.string().nullable(),
|
|
30160
|
+
updatedAt: external_exports.string()
|
|
30161
|
+
});
|
|
30162
|
+
var PushTokenDeviceSchema = external_exports.object({
|
|
30163
|
+
deviceId: external_exports.string(),
|
|
30164
|
+
rings: external_exports.boolean(),
|
|
30165
|
+
ask: external_exports.boolean(),
|
|
30166
|
+
ringsOn: external_exports.object({ deviceId: external_exports.string().nullable(), label: external_exports.string().nullable() }).nullable()
|
|
30167
|
+
});
|
|
30168
|
+
var PushRingsSchema = external_exports.object({ rings: external_exports.boolean() });
|
|
30136
30169
|
var PushTokenSchema = external_exports.object({
|
|
30137
30170
|
voipToken: external_exports.string().min(1).optional(),
|
|
30138
30171
|
alertToken: external_exports.string().min(1).optional(),
|
|
30139
30172
|
fcmToken: external_exports.string().min(1).optional(),
|
|
30140
|
-
platform: external_exports.enum(["ios", "android"])
|
|
30173
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
30174
|
+
/** WHICH INSTALL POSTED IT (owner, 2026-11-05: "Ask on each new device"). Absent from every
|
|
30175
|
+
* build before it, and then the post is exactly what it always was: the one row per account.
|
|
30176
|
+
* With it, the install has its own row and calls ring only where the person chose. */
|
|
30177
|
+
deviceId: PushDeviceIdSchema.optional(),
|
|
30178
|
+
/** The install's name as the person knows it ("iPhone", "iPad"), and its model. */
|
|
30179
|
+
label: external_exports.string().trim().min(1).max(80).optional(),
|
|
30180
|
+
model: external_exports.string().trim().min(1).max(80).optional(),
|
|
30181
|
+
/** The person's choice, when the post carries it; absent, the install keeps what it has (and
|
|
30182
|
+
* its first ring token decides once: it rings unless another install already does). */
|
|
30183
|
+
rings: external_exports.boolean().optional()
|
|
30141
30184
|
}).superRefine((v, ctx) => {
|
|
30142
30185
|
if (v.platform !== "ios") return;
|
|
30143
30186
|
for (const field of ["voipToken", "alertToken"]) {
|
|
@@ -30247,7 +30290,11 @@ var GoalLatestSchema = external_exports.object({
|
|
|
30247
30290
|
titles: external_exports.array(external_exports.string()).optional(),
|
|
30248
30291
|
/** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
|
|
30249
30292
|
* update's own line, before its units; the row caps it at 200. Absent on anything else. */
|
|
30250
|
-
line: external_exports.string().optional()
|
|
30293
|
+
line: external_exports.string().optional(),
|
|
30294
|
+
/** THE PERSON'S ENTRIES IT CARRIED TO AN AGENT, IN THEIR WORDS (owner, 2026-11-05: "paraphrasing shouldn't change
|
|
30295
|
+
* attribution in the UI"): on a message Paigy sent an agent, the person's Entries its Delivery relays whole. A row
|
|
30296
|
+
* draws it as theirs. Absent on anything else, and from a door older than it. */
|
|
30297
|
+
carries: external_exports.array(external_exports.string()).optional()
|
|
30251
30298
|
});
|
|
30252
30299
|
var HistoryWorkSchema = external_exports.object({
|
|
30253
30300
|
id: external_exports.string(),
|
|
@@ -30516,6 +30563,11 @@ var QueueItemSchema = external_exports.object({
|
|
|
30516
30563
|
* and a door older than 20261013045542 need not spell them. */
|
|
30517
30564
|
yours: GoalLatestSchema.nullable().optional(),
|
|
30518
30565
|
theirs: GoalLatestSchema.nullable().optional(),
|
|
30566
|
+
/** ITS STEPS, COUNTED IN THE DATABASE (owner, 2026-11-04: "Count on the server, and agents make steps"): its
|
|
30567
|
+
* direct children that were not cancelled, and how many of them are done. The queue holds only a recent
|
|
30568
|
+
* slice of finished work, so counting `childGoalIds` read "0 of 1" for a project with five done. Absent
|
|
30569
|
+
* from a door older than this field, or when the count failed: the app then counts what it holds. */
|
|
30570
|
+
steps: external_exports.object({ total: external_exports.number().int().nonnegative(), done: external_exports.number().int().nonnegative() }).nullable().optional(),
|
|
30519
30571
|
/** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
|
|
30520
30572
|
* by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
|
|
30521
30573
|
* incremental read knows a row has not moved: the phone echoes back the revs it holds
|
|
@@ -30871,6 +30923,12 @@ var CallRecapSchema = external_exports.object({
|
|
|
30871
30923
|
* summary (Brain, 2026-10-14). Optional: absent from an API before it. */
|
|
30872
30924
|
filedOn: external_exports.array(external_exports.object({ goalId: external_exports.string().uuid(), title: external_exports.string() })).optional(),
|
|
30873
30925
|
recorded: external_exports.boolean().optional(),
|
|
30926
|
+
/** On a `said` row: the agents the call SENT those words to, from the sending action's own
|
|
30927
|
+
* `about.agents` (20261106220220). The review's receipt is drawn from this and from the row's
|
|
30928
|
+
* own `requestId`, never from the asker of a question the words happened to sit under: on call
|
|
30929
|
+
* f9670f67 that asker was Interface while the send named Comms. `[]` or absent means nothing
|
|
30930
|
+
* was sent for that row, which is why the receipt is positive-only. */
|
|
30931
|
+
sentTo: external_exports.array(external_exports.object({ id: external_exports.string().nullable(), name: external_exports.string() })).optional(),
|
|
30874
30932
|
settled: external_exports.object({ requestId: external_exports.string(), answer: external_exports.string() }).nullable().optional(),
|
|
30875
30933
|
acknowledged: external_exports.boolean().optional(),
|
|
30876
30934
|
/** On a `put` row: still waiting for the person's answer (not settled, not answered, not put off).
|
|
@@ -33402,11 +33460,11 @@ var CompleteChangeSchema2 = CompletionSchema2.omit({ causedBy: true, shipped: tr
|
|
|
33402
33460
|
var ASKING_RULES2 = `HOW TO ASK:
|
|
33403
33461
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
33404
33462
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
33405
|
-
3.
|
|
33463
|
+
3. They asked you to call? \`userExplicitlyRequested:"call"\`; \`workItBlocks\` rings when blocked.
|
|
33406
33464
|
4. No while-loops. While any Call is open, even one your question joined from their items, keep receiving through empty windows; otherwise stop at one: the answer reaches you on the Goal. Yield only with a listener or wakeup.
|
|
33407
33465
|
5. One question, one row: never re-send one still waiting; take back one that no longer matters with \`withdrawQuestionIds\`.
|
|
33408
33466
|
6. Read the Goal before asking; never re-ask what was answered or shipped. \`replied\` means they chose no option: it is still yours to settle.
|
|
33409
|
-
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
33467
|
+
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
33410
33468
|
8. A diagnosis says when, why and how it happens, then proposes one fix.
|
|
33411
33469
|
9. Give a report its \`reply\`: one line in THEIR voice for THAT report, so you learn whether they verified it or only received it. Required when it is delivered or its Goal is done.`;
|
|
33412
33470
|
function draft20202(node) {
|
|
@@ -33448,7 +33506,7 @@ var reason2 = external_exports.string().trim().min(1).max(500).describe("Why, as
|
|
|
33448
33506
|
var actionFits2 = (b) => b.blocked.type === "goal" === (b.action !== "answer");
|
|
33449
33507
|
var ACTION_FITS2 = "a goal is blocked from start or complete; a question from answer";
|
|
33450
33508
|
var userExplicitlyRequested2 = external_exports.enum(["any", "call"]).optional().describe(
|
|
33451
|
-
|
|
33509
|
+
'What the person asked for about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal\'s progress unless the person needs it. ALSO "any" whenever this message directly answers a question they asked you, wherever they asked it -- on a call, in a reply, in passing: their question is the request, so it is delivered every time, even with no pending question of theirs on file and even if they never said to send it. A correction of something you or another agent told them is such an answer. Never set it to make a message louder. This is the field that rings a phone: "call" here is how you call them when they asked you to, and `help` has the whole mechanism.'
|
|
33452
33510
|
);
|
|
33453
33511
|
var units2 = external_exports.array(UnitInputSchema2).optional().describe(
|
|
33454
33512
|
`The context this message needs, as up to ${UNITS_MAX2} units in reading order, each {title, body}: a title of at most ${UNIT_TITLE_MAX2} characters and a body of at most ${UNIT_BODY_MAX2}. One idea per unit: context they may open, never something they must hear. Leave it out when the main text says it all. Over a cap is refused by name (ask_too_long, too_many_units, unit_title_too_long, unit_body_too_long) and nothing is sent.`
|
|
@@ -33668,19 +33726,20 @@ LENGTH: the question, message or answer is the one point, at most ${ASK_MAX2} ch
|
|
|
33668
33726
|
UPDATES ask nothing. One reaches the person only when they asked for it, it answers something they said, or its Goal is done; else it is kept as progress. One that reaches them joins an open report card or a live call.
|
|
33669
33727
|
|
|
33670
33728
|
RECEIVING: contact({}) waits ~45 s; contact({wait:false}) returns \`events\` at once. Confirm the ones you handled with contact({ackEventIds}).`;
|
|
33671
|
-
var HELP_TOPICS2 = ["pairing", "listening", "receiving", "asking", "updates", "goals", "calls"];
|
|
33729
|
+
var HELP_TOPICS2 = ["pairing", "listening", "receiving", "asking", "updates", "goals", "organize", "calls"];
|
|
33672
33730
|
var unknownTopic2 = (topic) => `unknown_topic: ${JSON.stringify(topic)} is not a section of the guide. Topics: ${HELP_TOPICS2.join(", ")}; or omit topic for the whole guide.`;
|
|
33673
33731
|
var HelpSchema2 = external_exports.object({
|
|
33674
33732
|
topic: external_exports.enum(HELP_TOPICS2, { errorMap: (_issue, ctx) => ({ message: unknownTopic2(ctx.data) }) }).optional().describe("One section of the guide. Omit it for the whole guide.")
|
|
33675
33733
|
}).strict();
|
|
33676
|
-
var HELP_DESCRIPTION2 = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
33734
|
+
var HELP_DESCRIPTION2 = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals, organizing work, and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
33677
33735
|
var AGENT_PROMPTS2 = [
|
|
33678
33736
|
{
|
|
33679
33737
|
name: "help",
|
|
33680
33738
|
description: "How to use Paigy: the whole guide, or one topic of it.",
|
|
33681
33739
|
arguments: [{ name: "topic", description: `One section: ${HELP_TOPICS2.join(", ")}. Omit it for the whole guide.`, required: false }]
|
|
33682
33740
|
},
|
|
33683
|
-
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." }
|
|
33741
|
+
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." },
|
|
33742
|
+
{ name: "organize", description: "Set up the person's work as a board: areas, projects and steps, proposed on a card before anything is built." }
|
|
33684
33743
|
];
|
|
33685
33744
|
var CreateGoalSchema2 = external_exports.object({
|
|
33686
33745
|
outcome: external_exports.string().trim().min(1).max(1e4),
|
|
@@ -33729,7 +33788,7 @@ var CreateChange2 = external_exports.object({
|
|
|
33729
33788
|
title: goalTitle2,
|
|
33730
33789
|
outcome: goalOutcome2,
|
|
33731
33790
|
ownerId: external_exports.string().trim().min(1).optional().describe("Who owns the work: an agent's participant (as check_activity shows it) or the person's. Omitted: you."),
|
|
33732
|
-
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root."),
|
|
33791
|
+
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root. A project with several parts: create it, then one child per step under it; the person's Work tab counts a project's progress in those steps."),
|
|
33733
33792
|
sourceEntryIds: external_exports.array(external_exports.string().uuid()).max(20).optional().describe("The whole Entries the work came from, ones you can read.")
|
|
33734
33793
|
}).strict();
|
|
33735
33794
|
var EditChange2 = external_exports.object({ kind: external_exports.literal("edit"), goalId: changedGoal2, title: goalTitle2.optional(), outcome: goalOutcome2.optional() }).strict();
|
|
@@ -33774,7 +33833,7 @@ var ManageGoalsSchema2 = external_exports.object({
|
|
|
33774
33833
|
var ManageGoalsToolSchema2 = external_exports.object({
|
|
33775
33834
|
changes: external_exports.array(external_exports.discriminatedUnion("kind", [CreateChange2, CompleteChangeSchema2, EditChange2, StateChange2, AssignChange2, DeferChange2, MoveChange2, DependencyChange2])).min(1).max(50).describe("The changes, applied in order, each on its own.")
|
|
33776
33835
|
}).strict().superRefine((v, ctx) => editNames2(v.changes, ctx));
|
|
33777
|
-
var MANAGE_GOALS_DESCRIPTION2 = "Create, edit, assign, organize or close work. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
33836
|
+
var MANAGE_GOALS_DESCRIPTION2 = "Create, edit, assign, organize or close work. SHAPE IT AS PROJECTS WITH STEPS: create a project under its area (parentGoalId; a top-level Goal with children is an area), then each part as its child Goal, so the person sees N of M steps. Move a flat or orphaned Goal of yours into that shape when you touch it; a flat Goal is valid. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
33778
33837
|
var GetGoalsSchema2 = external_exports.object({
|
|
33779
33838
|
goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals to read, in order; one to ten IDs."),
|
|
33780
33839
|
/** Every entry in full. Without it the read carries the person's words, open questions and your
|
|
@@ -33922,6 +33981,10 @@ var BrainMessageSchema2 = external_exports.union([
|
|
|
33922
33981
|
// WHAT IT ASKS THE AGENT, IN UNDER TEN WORDS (owner, 2026-10-15: "Yes, add the summary"): the talker's own, stored
|
|
33923
33982
|
// as the sent Entry's summary, which the recap's "Sent to <agent>: …" row shows. Absent on results written before it.
|
|
33924
33983
|
summary: external_exports.string().optional(),
|
|
33984
|
+
// THE PERSON'S LINES IT CARRIES, IN THEIR WORDS (owner, 2026-11-05: "just deliver my exact words to the agent"): the
|
|
33985
|
+
// `entries` keys of those lines, each relayed whole on the agent's Delivery (`context = false`), where the rest of
|
|
33986
|
+
// `entryKeys` ride as context. Absent on results written before it, and on a message that carries none.
|
|
33987
|
+
carries: external_exports.array(key2).optional(),
|
|
33925
33988
|
// THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
|
|
33926
33989
|
// the call, and its next contact about it rings them (`public.callbacks`).
|
|
33927
33990
|
callback: external_exports.literal(true).optional()
|
|
@@ -33985,8 +34048,11 @@ var TalkerReplySchema2 = external_exports.object({
|
|
|
33985
34048
|
* "Yes, add the summary"), which the recap's "Sent to <agent>: …" row shows; `about` names
|
|
33986
34049
|
* handles; `blocks` is the item a question to an agent must be answered before ("" for none);
|
|
33987
34050
|
* `callback` is true on a message to the agent doing work the person asked to be called back about
|
|
33988
|
-
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0).
|
|
33989
|
-
|
|
34051
|
+
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0). `lines` are the
|
|
34052
|
+
* person's line handles a message to an agent carries ([] for none): the agent receives those lines, in their
|
|
34053
|
+
* words, and `text` is then only what the talker adds beyond them (owner, 2026-11-05: "just deliver my exact
|
|
34054
|
+
* words to the agent, keeping the summary as a way for me to navigate them more easily"). */
|
|
34055
|
+
messages: external_exports.array(external_exports.object({ key: str32, to: str32, sentences: strs22, text: str32, summary: str32, about: strs22, blocks: str32, callback: external_exports.boolean(), lines: strs22.optional() }).strict()),
|
|
33990
34056
|
/** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
|
|
33991
34057
|
then: external_exports.enum(["listen", "hold", "end"]),
|
|
33992
34058
|
/** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
|
|
@@ -34004,9 +34070,14 @@ var TalkerReplySchema2 = external_exports.object({
|
|
|
34004
34070
|
/** The handle of the item to explain ("" for none). */
|
|
34005
34071
|
explain: str32
|
|
34006
34072
|
}).strict();
|
|
34007
|
-
var TALKER_REPLY_JSON_SCHEMA2 = (({ $schema: _, ...rest }) => rest)(
|
|
34073
|
+
var TALKER_REPLY_JSON_SCHEMA2 = withEveryMessageField2((({ $schema: _, ...rest }) => rest)(
|
|
34008
34074
|
zodToJsonSchema2(TalkerReplySchema2, { $refStrategy: "none" })
|
|
34009
|
-
);
|
|
34075
|
+
));
|
|
34076
|
+
function withEveryMessageField2(schema) {
|
|
34077
|
+
const item = schema.properties?.messages?.items;
|
|
34078
|
+
if (item?.properties) item.required = Object.keys(item.properties);
|
|
34079
|
+
return schema;
|
|
34080
|
+
}
|
|
34010
34081
|
var str42 = external_exports.string();
|
|
34011
34082
|
var strs32 = external_exports.array(external_exports.string());
|
|
34012
34083
|
var FilerReplySchema2 = external_exports.object({
|
|
@@ -34720,11 +34791,41 @@ var InboxItemSchema2 = external_exports.object({
|
|
|
34720
34791
|
rev: external_exports.string().optional()
|
|
34721
34792
|
});
|
|
34722
34793
|
var APNS_TOKEN_RE2 = /^[0-9a-fA-F]{64}$/;
|
|
34794
|
+
var PushDeviceIdSchema2 = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,200}$/, "not an install id");
|
|
34795
|
+
var PushDeviceSchema2 = external_exports.object({
|
|
34796
|
+
deviceId: external_exports.string(),
|
|
34797
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
34798
|
+
label: external_exports.string().nullable(),
|
|
34799
|
+
model: external_exports.string().nullable(),
|
|
34800
|
+
/** Calls and banners go here. */
|
|
34801
|
+
rings: external_exports.boolean(),
|
|
34802
|
+
/** It has a token a call can ring. */
|
|
34803
|
+
ringable: external_exports.boolean(),
|
|
34804
|
+
chosenAt: external_exports.string().nullable(),
|
|
34805
|
+
updatedAt: external_exports.string()
|
|
34806
|
+
});
|
|
34807
|
+
var PushTokenDeviceSchema2 = external_exports.object({
|
|
34808
|
+
deviceId: external_exports.string(),
|
|
34809
|
+
rings: external_exports.boolean(),
|
|
34810
|
+
ask: external_exports.boolean(),
|
|
34811
|
+
ringsOn: external_exports.object({ deviceId: external_exports.string().nullable(), label: external_exports.string().nullable() }).nullable()
|
|
34812
|
+
});
|
|
34813
|
+
var PushRingsSchema2 = external_exports.object({ rings: external_exports.boolean() });
|
|
34723
34814
|
var PushTokenSchema2 = external_exports.object({
|
|
34724
34815
|
voipToken: external_exports.string().min(1).optional(),
|
|
34725
34816
|
alertToken: external_exports.string().min(1).optional(),
|
|
34726
34817
|
fcmToken: external_exports.string().min(1).optional(),
|
|
34727
|
-
platform: external_exports.enum(["ios", "android"])
|
|
34818
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
34819
|
+
/** WHICH INSTALL POSTED IT (owner, 2026-11-05: "Ask on each new device"). Absent from every
|
|
34820
|
+
* build before it, and then the post is exactly what it always was: the one row per account.
|
|
34821
|
+
* With it, the install has its own row and calls ring only where the person chose. */
|
|
34822
|
+
deviceId: PushDeviceIdSchema2.optional(),
|
|
34823
|
+
/** The install's name as the person knows it ("iPhone", "iPad"), and its model. */
|
|
34824
|
+
label: external_exports.string().trim().min(1).max(80).optional(),
|
|
34825
|
+
model: external_exports.string().trim().min(1).max(80).optional(),
|
|
34826
|
+
/** The person's choice, when the post carries it; absent, the install keeps what it has (and
|
|
34827
|
+
* its first ring token decides once: it rings unless another install already does). */
|
|
34828
|
+
rings: external_exports.boolean().optional()
|
|
34728
34829
|
}).superRefine((v, ctx) => {
|
|
34729
34830
|
if (v.platform !== "ios") return;
|
|
34730
34831
|
for (const field of ["voipToken", "alertToken"]) {
|
|
@@ -34834,7 +34935,11 @@ var GoalLatestSchema2 = external_exports.object({
|
|
|
34834
34935
|
titles: external_exports.array(external_exports.string()).optional(),
|
|
34835
34936
|
/** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
|
|
34836
34937
|
* update's own line, before its units; the row caps it at 200. Absent on anything else. */
|
|
34837
|
-
line: external_exports.string().optional()
|
|
34938
|
+
line: external_exports.string().optional(),
|
|
34939
|
+
/** THE PERSON'S ENTRIES IT CARRIED TO AN AGENT, IN THEIR WORDS (owner, 2026-11-05: "paraphrasing shouldn't change
|
|
34940
|
+
* attribution in the UI"): on a message Paigy sent an agent, the person's Entries its Delivery relays whole. A row
|
|
34941
|
+
* draws it as theirs. Absent on anything else, and from a door older than it. */
|
|
34942
|
+
carries: external_exports.array(external_exports.string()).optional()
|
|
34838
34943
|
});
|
|
34839
34944
|
var HistoryWorkSchema2 = external_exports.object({
|
|
34840
34945
|
id: external_exports.string(),
|
|
@@ -35103,6 +35208,11 @@ var QueueItemSchema2 = external_exports.object({
|
|
|
35103
35208
|
* and a door older than 20261013045542 need not spell them. */
|
|
35104
35209
|
yours: GoalLatestSchema2.nullable().optional(),
|
|
35105
35210
|
theirs: GoalLatestSchema2.nullable().optional(),
|
|
35211
|
+
/** ITS STEPS, COUNTED IN THE DATABASE (owner, 2026-11-04: "Count on the server, and agents make steps"): its
|
|
35212
|
+
* direct children that were not cancelled, and how many of them are done. The queue holds only a recent
|
|
35213
|
+
* slice of finished work, so counting `childGoalIds` read "0 of 1" for a project with five done. Absent
|
|
35214
|
+
* from a door older than this field, or when the count failed: the app then counts what it holds. */
|
|
35215
|
+
steps: external_exports.object({ total: external_exports.number().int().nonnegative(), done: external_exports.number().int().nonnegative() }).nullable().optional(),
|
|
35106
35216
|
/** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
|
|
35107
35217
|
* by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
|
|
35108
35218
|
* incremental read knows a row has not moved: the phone echoes back the revs it holds
|
|
@@ -35456,6 +35566,12 @@ var CallRecapSchema2 = external_exports.object({
|
|
|
35456
35566
|
* summary (Brain, 2026-10-14). Optional: absent from an API before it. */
|
|
35457
35567
|
filedOn: external_exports.array(external_exports.object({ goalId: external_exports.string().uuid(), title: external_exports.string() })).optional(),
|
|
35458
35568
|
recorded: external_exports.boolean().optional(),
|
|
35569
|
+
/** On a `said` row: the agents the call SENT those words to, from the sending action's own
|
|
35570
|
+
* `about.agents` (20261106220220). The review's receipt is drawn from this and from the row's
|
|
35571
|
+
* own `requestId`, never from the asker of a question the words happened to sit under: on call
|
|
35572
|
+
* f9670f67 that asker was Interface while the send named Comms. `[]` or absent means nothing
|
|
35573
|
+
* was sent for that row, which is why the receipt is positive-only. */
|
|
35574
|
+
sentTo: external_exports.array(external_exports.object({ id: external_exports.string().nullable(), name: external_exports.string() })).optional(),
|
|
35459
35575
|
settled: external_exports.object({ requestId: external_exports.string(), answer: external_exports.string() }).nullable().optional(),
|
|
35460
35576
|
acknowledged: external_exports.boolean().optional(),
|
|
35461
35577
|
/** On a `put` row: still waiting for the person's answer (not settled, not answered, not put off).
|
package/dist/main.js
CHANGED
|
@@ -10087,11 +10087,11 @@ var CompleteChangeSchema = CompletionSchema.omit({ causedBy: true, shipped: true
|
|
|
10087
10087
|
var ASKING_RULES = `HOW TO ASK:
|
|
10088
10088
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
10089
10089
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
10090
|
-
3.
|
|
10090
|
+
3. They asked you to call? \`userExplicitlyRequested:"call"\`; \`workItBlocks\` rings when blocked.
|
|
10091
10091
|
4. No while-loops. While any Call is open, even one your question joined from their items, keep receiving through empty windows; otherwise stop at one: the answer reaches you on the Goal. Yield only with a listener or wakeup.
|
|
10092
10092
|
5. One question, one row: never re-send one still waiting; take back one that no longer matters with \`withdrawQuestionIds\`.
|
|
10093
10093
|
6. Read the Goal before asking; never re-ask what was answered or shipped. \`replied\` means they chose no option: it is still yours to settle.
|
|
10094
|
-
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
10094
|
+
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
10095
10095
|
8. A diagnosis says when, why and how it happens, then proposes one fix.
|
|
10096
10096
|
9. Give a report its \`reply\`: one line in THEIR voice for THAT report, so you learn whether they verified it or only received it. Required when it is delivered or its Goal is done.`;
|
|
10097
10097
|
function draft2020(node) {
|
|
@@ -10133,7 +10133,7 @@ var reason = external_exports.string().trim().min(1).max(500).describe("Why, as
|
|
|
10133
10133
|
var actionFits = (b) => b.blocked.type === "goal" === (b.action !== "answer");
|
|
10134
10134
|
var ACTION_FITS = "a goal is blocked from start or complete; a question from answer";
|
|
10135
10135
|
var userExplicitlyRequested = external_exports.enum(["any", "call"]).optional().describe(
|
|
10136
|
-
|
|
10136
|
+
'What the person asked for about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal\'s progress unless the person needs it. ALSO "any" whenever this message directly answers a question they asked you, wherever they asked it -- on a call, in a reply, in passing: their question is the request, so it is delivered every time, even with no pending question of theirs on file and even if they never said to send it. A correction of something you or another agent told them is such an answer. Never set it to make a message louder. This is the field that rings a phone: "call" here is how you call them when they asked you to, and `help` has the whole mechanism.'
|
|
10137
10137
|
);
|
|
10138
10138
|
var units = external_exports.array(UnitInputSchema).optional().describe(
|
|
10139
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.`
|
|
@@ -10353,19 +10353,20 @@ LENGTH: the question, message or answer is the one point, at most ${ASK_MAX} cha
|
|
|
10353
10353
|
UPDATES ask nothing. One reaches the person only when they asked for it, it answers something they said, or its Goal is done; else it is kept as progress. One that reaches them joins an open report card or a live call.
|
|
10354
10354
|
|
|
10355
10355
|
RECEIVING: contact({}) waits ~45 s; contact({wait:false}) returns \`events\` at once. Confirm the ones you handled with contact({ackEventIds}).`;
|
|
10356
|
-
var HELP_TOPICS = ["pairing", "listening", "receiving", "asking", "updates", "goals", "calls"];
|
|
10356
|
+
var HELP_TOPICS = ["pairing", "listening", "receiving", "asking", "updates", "goals", "organize", "calls"];
|
|
10357
10357
|
var unknownTopic = (topic) => `unknown_topic: ${JSON.stringify(topic)} is not a section of the guide. Topics: ${HELP_TOPICS.join(", ")}; or omit topic for the whole guide.`;
|
|
10358
10358
|
var HelpSchema = external_exports.object({
|
|
10359
10359
|
topic: external_exports.enum(HELP_TOPICS, { errorMap: (_issue, ctx) => ({ message: unknownTopic(ctx.data) }) }).optional().describe("One section of the guide. Omit it for the whole guide.")
|
|
10360
10360
|
}).strict();
|
|
10361
|
-
var HELP_DESCRIPTION = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
10361
|
+
var HELP_DESCRIPTION = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals, organizing work, and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
10362
10362
|
var AGENT_PROMPTS = [
|
|
10363
10363
|
{
|
|
10364
10364
|
name: "help",
|
|
10365
10365
|
description: "How to use Paigy: the whole guide, or one topic of it.",
|
|
10366
10366
|
arguments: [{ name: "topic", description: `One section: ${HELP_TOPICS.join(", ")}. Omit it for the whole guide.`, required: false }]
|
|
10367
10367
|
},
|
|
10368
|
-
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." }
|
|
10368
|
+
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." },
|
|
10369
|
+
{ name: "organize", description: "Set up the person's work as a board: areas, projects and steps, proposed on a card before anything is built." }
|
|
10369
10370
|
];
|
|
10370
10371
|
var CreateGoalSchema = external_exports.object({
|
|
10371
10372
|
outcome: external_exports.string().trim().min(1).max(1e4),
|
|
@@ -10414,7 +10415,7 @@ var CreateChange = external_exports.object({
|
|
|
10414
10415
|
title: goalTitle,
|
|
10415
10416
|
outcome: goalOutcome,
|
|
10416
10417
|
ownerId: external_exports.string().trim().min(1).optional().describe("Who owns the work: an agent's participant (as check_activity shows it) or the person's. Omitted: you."),
|
|
10417
|
-
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root."),
|
|
10418
|
+
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root. A project with several parts: create it, then one child per step under it; the person's Work tab counts a project's progress in those steps."),
|
|
10418
10419
|
sourceEntryIds: external_exports.array(external_exports.string().uuid()).max(20).optional().describe("The whole Entries the work came from, ones you can read.")
|
|
10419
10420
|
}).strict();
|
|
10420
10421
|
var EditChange = external_exports.object({ kind: external_exports.literal("edit"), goalId: changedGoal, title: goalTitle.optional(), outcome: goalOutcome.optional() }).strict();
|
|
@@ -10459,7 +10460,7 @@ var ManageGoalsSchema = external_exports.object({
|
|
|
10459
10460
|
var ManageGoalsToolSchema = external_exports.object({
|
|
10460
10461
|
changes: external_exports.array(external_exports.discriminatedUnion("kind", [CreateChange, CompleteChangeSchema, EditChange, StateChange, AssignChange, DeferChange, MoveChange, DependencyChange])).min(1).max(50).describe("The changes, applied in order, each on its own.")
|
|
10461
10462
|
}).strict().superRefine((v, ctx) => editNames(v.changes, ctx));
|
|
10462
|
-
var MANAGE_GOALS_DESCRIPTION = "Create, edit, assign, organize or close work. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
10463
|
+
var MANAGE_GOALS_DESCRIPTION = "Create, edit, assign, organize or close work. SHAPE IT AS PROJECTS WITH STEPS: create a project under its area (parentGoalId; a top-level Goal with children is an area), then each part as its child Goal, so the person sees N of M steps. Move a flat or orphaned Goal of yours into that shape when you touch it; a flat Goal is valid. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
10463
10464
|
var GetGoalsSchema = external_exports.object({
|
|
10464
10465
|
goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals to read, in order; one to ten IDs."),
|
|
10465
10466
|
/** Every entry in full. Without it the read carries the person's words, open questions and your
|
|
@@ -10607,6 +10608,10 @@ var BrainMessageSchema = external_exports.union([
|
|
|
10607
10608
|
// WHAT IT ASKS THE AGENT, IN UNDER TEN WORDS (owner, 2026-10-15: "Yes, add the summary"): the talker's own, stored
|
|
10608
10609
|
// as the sent Entry's summary, which the recap's "Sent to <agent>: …" row shows. Absent on results written before it.
|
|
10609
10610
|
summary: external_exports.string().optional(),
|
|
10611
|
+
// THE PERSON'S LINES IT CARRIES, IN THEIR WORDS (owner, 2026-11-05: "just deliver my exact words to the agent"): the
|
|
10612
|
+
// `entries` keys of those lines, each relayed whole on the agent's Delivery (`context = false`), where the rest of
|
|
10613
|
+
// `entryKeys` ride as context. Absent on results written before it, and on a message that carries none.
|
|
10614
|
+
carries: external_exports.array(key).optional(),
|
|
10610
10615
|
// THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
|
|
10611
10616
|
// the call, and its next contact about it rings them (`public.callbacks`).
|
|
10612
10617
|
callback: external_exports.literal(true).optional()
|
|
@@ -10670,8 +10675,11 @@ var TalkerReplySchema = external_exports.object({
|
|
|
10670
10675
|
* "Yes, add the summary"), which the recap's "Sent to <agent>: …" row shows; `about` names
|
|
10671
10676
|
* handles; `blocks` is the item a question to an agent must be answered before ("" for none);
|
|
10672
10677
|
* `callback` is true on a message to the agent doing work the person asked to be called back about
|
|
10673
|
-
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0).
|
|
10674
|
-
|
|
10678
|
+
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0). `lines` are the
|
|
10679
|
+
* person's line handles a message to an agent carries ([] for none): the agent receives those lines, in their
|
|
10680
|
+
* words, and `text` is then only what the talker adds beyond them (owner, 2026-11-05: "just deliver my exact
|
|
10681
|
+
* words to the agent, keeping the summary as a way for me to navigate them more easily"). */
|
|
10682
|
+
messages: external_exports.array(external_exports.object({ key: str3, to: str3, sentences: strs2, text: str3, summary: str3, about: strs2, blocks: str3, callback: external_exports.boolean(), lines: strs2.optional() }).strict()),
|
|
10675
10683
|
/** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
|
|
10676
10684
|
then: external_exports.enum(["listen", "hold", "end"]),
|
|
10677
10685
|
/** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
|
|
@@ -10689,9 +10697,14 @@ var TalkerReplySchema = external_exports.object({
|
|
|
10689
10697
|
/** The handle of the item to explain ("" for none). */
|
|
10690
10698
|
explain: str3
|
|
10691
10699
|
}).strict();
|
|
10692
|
-
var TALKER_REPLY_JSON_SCHEMA = (({ $schema: _, ...rest }) => rest)(
|
|
10700
|
+
var TALKER_REPLY_JSON_SCHEMA = withEveryMessageField((({ $schema: _, ...rest }) => rest)(
|
|
10693
10701
|
zodToJsonSchema(TalkerReplySchema, { $refStrategy: "none" })
|
|
10694
|
-
);
|
|
10702
|
+
));
|
|
10703
|
+
function withEveryMessageField(schema) {
|
|
10704
|
+
const item = schema.properties?.messages?.items;
|
|
10705
|
+
if (item?.properties) item.required = Object.keys(item.properties);
|
|
10706
|
+
return schema;
|
|
10707
|
+
}
|
|
10695
10708
|
var str4 = external_exports.string();
|
|
10696
10709
|
var strs3 = external_exports.array(external_exports.string());
|
|
10697
10710
|
var FilerReplySchema = external_exports.object({
|
|
@@ -11394,11 +11407,41 @@ var InboxItemSchema = external_exports.object({
|
|
|
11394
11407
|
rev: external_exports.string().optional()
|
|
11395
11408
|
});
|
|
11396
11409
|
var APNS_TOKEN_RE = /^[0-9a-fA-F]{64}$/;
|
|
11410
|
+
var PushDeviceIdSchema = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,200}$/, "not an install id");
|
|
11411
|
+
var PushDeviceSchema = external_exports.object({
|
|
11412
|
+
deviceId: external_exports.string(),
|
|
11413
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
11414
|
+
label: external_exports.string().nullable(),
|
|
11415
|
+
model: external_exports.string().nullable(),
|
|
11416
|
+
/** Calls and banners go here. */
|
|
11417
|
+
rings: external_exports.boolean(),
|
|
11418
|
+
/** It has a token a call can ring. */
|
|
11419
|
+
ringable: external_exports.boolean(),
|
|
11420
|
+
chosenAt: external_exports.string().nullable(),
|
|
11421
|
+
updatedAt: external_exports.string()
|
|
11422
|
+
});
|
|
11423
|
+
var PushTokenDeviceSchema = external_exports.object({
|
|
11424
|
+
deviceId: external_exports.string(),
|
|
11425
|
+
rings: external_exports.boolean(),
|
|
11426
|
+
ask: external_exports.boolean(),
|
|
11427
|
+
ringsOn: external_exports.object({ deviceId: external_exports.string().nullable(), label: external_exports.string().nullable() }).nullable()
|
|
11428
|
+
});
|
|
11429
|
+
var PushRingsSchema = external_exports.object({ rings: external_exports.boolean() });
|
|
11397
11430
|
var PushTokenSchema = external_exports.object({
|
|
11398
11431
|
voipToken: external_exports.string().min(1).optional(),
|
|
11399
11432
|
alertToken: external_exports.string().min(1).optional(),
|
|
11400
11433
|
fcmToken: external_exports.string().min(1).optional(),
|
|
11401
|
-
platform: external_exports.enum(["ios", "android"])
|
|
11434
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
11435
|
+
/** WHICH INSTALL POSTED IT (owner, 2026-11-05: "Ask on each new device"). Absent from every
|
|
11436
|
+
* build before it, and then the post is exactly what it always was: the one row per account.
|
|
11437
|
+
* With it, the install has its own row and calls ring only where the person chose. */
|
|
11438
|
+
deviceId: PushDeviceIdSchema.optional(),
|
|
11439
|
+
/** The install's name as the person knows it ("iPhone", "iPad"), and its model. */
|
|
11440
|
+
label: external_exports.string().trim().min(1).max(80).optional(),
|
|
11441
|
+
model: external_exports.string().trim().min(1).max(80).optional(),
|
|
11442
|
+
/** The person's choice, when the post carries it; absent, the install keeps what it has (and
|
|
11443
|
+
* its first ring token decides once: it rings unless another install already does). */
|
|
11444
|
+
rings: external_exports.boolean().optional()
|
|
11402
11445
|
}).superRefine((v, ctx) => {
|
|
11403
11446
|
if (v.platform !== "ios") return;
|
|
11404
11447
|
for (const field of ["voipToken", "alertToken"]) {
|
|
@@ -11508,7 +11551,11 @@ var GoalLatestSchema = external_exports.object({
|
|
|
11508
11551
|
titles: external_exports.array(external_exports.string()).optional(),
|
|
11509
11552
|
/** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
|
|
11510
11553
|
* update's own line, before its units; the row caps it at 200. Absent on anything else. */
|
|
11511
|
-
line: external_exports.string().optional()
|
|
11554
|
+
line: external_exports.string().optional(),
|
|
11555
|
+
/** THE PERSON'S ENTRIES IT CARRIED TO AN AGENT, IN THEIR WORDS (owner, 2026-11-05: "paraphrasing shouldn't change
|
|
11556
|
+
* attribution in the UI"): on a message Paigy sent an agent, the person's Entries its Delivery relays whole. A row
|
|
11557
|
+
* draws it as theirs. Absent on anything else, and from a door older than it. */
|
|
11558
|
+
carries: external_exports.array(external_exports.string()).optional()
|
|
11512
11559
|
});
|
|
11513
11560
|
var HistoryWorkSchema = external_exports.object({
|
|
11514
11561
|
id: external_exports.string(),
|
|
@@ -11777,6 +11824,11 @@ var QueueItemSchema = external_exports.object({
|
|
|
11777
11824
|
* and a door older than 20261013045542 need not spell them. */
|
|
11778
11825
|
yours: GoalLatestSchema.nullable().optional(),
|
|
11779
11826
|
theirs: GoalLatestSchema.nullable().optional(),
|
|
11827
|
+
/** ITS STEPS, COUNTED IN THE DATABASE (owner, 2026-11-04: "Count on the server, and agents make steps"): its
|
|
11828
|
+
* direct children that were not cancelled, and how many of them are done. The queue holds only a recent
|
|
11829
|
+
* slice of finished work, so counting `childGoalIds` read "0 of 1" for a project with five done. Absent
|
|
11830
|
+
* from a door older than this field, or when the count failed: the app then counts what it holds. */
|
|
11831
|
+
steps: external_exports.object({ total: external_exports.number().int().nonnegative(), done: external_exports.number().int().nonnegative() }).nullable().optional(),
|
|
11780
11832
|
/** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
|
|
11781
11833
|
* by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
|
|
11782
11834
|
* incremental read knows a row has not moved: the phone echoes back the revs it holds
|
|
@@ -12132,6 +12184,12 @@ var CallRecapSchema = external_exports.object({
|
|
|
12132
12184
|
* summary (Brain, 2026-10-14). Optional: absent from an API before it. */
|
|
12133
12185
|
filedOn: external_exports.array(external_exports.object({ goalId: external_exports.string().uuid(), title: external_exports.string() })).optional(),
|
|
12134
12186
|
recorded: external_exports.boolean().optional(),
|
|
12187
|
+
/** On a `said` row: the agents the call SENT those words to, from the sending action's own
|
|
12188
|
+
* `about.agents` (20261106220220). The review's receipt is drawn from this and from the row's
|
|
12189
|
+
* own `requestId`, never from the asker of a question the words happened to sit under: on call
|
|
12190
|
+
* f9670f67 that asker was Interface while the send named Comms. `[]` or absent means nothing
|
|
12191
|
+
* was sent for that row, which is why the receipt is positive-only. */
|
|
12192
|
+
sentTo: external_exports.array(external_exports.object({ id: external_exports.string().nullable(), name: external_exports.string() })).optional(),
|
|
12135
12193
|
settled: external_exports.object({ requestId: external_exports.string(), answer: external_exports.string() }).nullable().optional(),
|
|
12136
12194
|
acknowledged: external_exports.boolean().optional(),
|
|
12137
12195
|
/** On a `put` row: still waiting for the person's answer (not settled, not answered, not put off).
|
|
@@ -14179,11 +14237,11 @@ var CompleteChangeSchema2 = CompletionSchema2.omit({ causedBy: true, shipped: tr
|
|
|
14179
14237
|
var ASKING_RULES2 = `HOW TO ASK:
|
|
14180
14238
|
1. One question per object in \`questions\`, so each is answered on its own.
|
|
14181
14239
|
2. \`goalId\` names the existing Goal it is about (create one with manage_goals first); the answer comes back there.
|
|
14182
|
-
3.
|
|
14240
|
+
3. They asked you to call? \`userExplicitlyRequested:"call"\`; \`workItBlocks\` rings when blocked.
|
|
14183
14241
|
4. No while-loops. While any Call is open, even one your question joined from their items, keep receiving through empty windows; otherwise stop at one: the answer reaches you on the Goal. Yield only with a listener or wakeup.
|
|
14184
14242
|
5. One question, one row: never re-send one still waiting; take back one that no longer matters with \`withdrawQuestionIds\`.
|
|
14185
14243
|
6. Read the Goal before asking; never re-ask what was answered or shipped. \`replied\` means they chose no option: it is still yours to settle.
|
|
14186
|
-
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
14244
|
+
7. Give options when you have them. Each label names its choice in full (never "Option 2"); never add "Other".
|
|
14187
14245
|
8. A diagnosis says when, why and how it happens, then proposes one fix.
|
|
14188
14246
|
9. Give a report its \`reply\`: one line in THEIR voice for THAT report, so you learn whether they verified it or only received it. Required when it is delivered or its Goal is done.`;
|
|
14189
14247
|
function draft20202(node) {
|
|
@@ -14225,7 +14283,7 @@ var reason2 = external_exports.string().trim().min(1).max(500).describe("Why, as
|
|
|
14225
14283
|
var actionFits2 = (b) => b.blocked.type === "goal" === (b.action !== "answer");
|
|
14226
14284
|
var ACTION_FITS2 = "a goal is blocked from start or complete; a question from answer";
|
|
14227
14285
|
var userExplicitlyRequested2 = external_exports.enum(["any", "call"]).optional().describe(
|
|
14228
|
-
|
|
14286
|
+
'What the person asked for about THIS message, in so many words: "any" when they asked you to send it to them ("send it to my phone", "message me the result"), "call" when they asked to be called about it. It is then delivered (a call rings for the whole contact, and carries everything waiting on them); omitted, an update is only recorded as the Goal\'s progress unless the person needs it. ALSO "any" whenever this message directly answers a question they asked you, wherever they asked it -- on a call, in a reply, in passing: their question is the request, so it is delivered every time, even with no pending question of theirs on file and even if they never said to send it. A correction of something you or another agent told them is such an answer. Never set it to make a message louder. This is the field that rings a phone: "call" here is how you call them when they asked you to, and `help` has the whole mechanism.'
|
|
14229
14287
|
);
|
|
14230
14288
|
var units2 = external_exports.array(UnitInputSchema2).optional().describe(
|
|
14231
14289
|
`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.`
|
|
@@ -14445,19 +14503,20 @@ LENGTH: the question, message or answer is the one point, at most ${ASK_MAX2} ch
|
|
|
14445
14503
|
UPDATES ask nothing. One reaches the person only when they asked for it, it answers something they said, or its Goal is done; else it is kept as progress. One that reaches them joins an open report card or a live call.
|
|
14446
14504
|
|
|
14447
14505
|
RECEIVING: contact({}) waits ~45 s; contact({wait:false}) returns \`events\` at once. Confirm the ones you handled with contact({ackEventIds}).`;
|
|
14448
|
-
var HELP_TOPICS2 = ["pairing", "listening", "receiving", "asking", "updates", "goals", "calls"];
|
|
14506
|
+
var HELP_TOPICS2 = ["pairing", "listening", "receiving", "asking", "updates", "goals", "organize", "calls"];
|
|
14449
14507
|
var unknownTopic2 = (topic) => `unknown_topic: ${JSON.stringify(topic)} is not a section of the guide. Topics: ${HELP_TOPICS2.join(", ")}; or omit topic for the whole guide.`;
|
|
14450
14508
|
var HelpSchema2 = external_exports.object({
|
|
14451
14509
|
topic: external_exports.enum(HELP_TOPICS2, { errorMap: (_issue, ctx) => ({ message: unknownTopic2(ctx.data) }) }).optional().describe("One section of the guide. Omit it for the whole guide.")
|
|
14452
14510
|
}).strict();
|
|
14453
|
-
var HELP_DESCRIPTION2 = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
14511
|
+
var HELP_DESCRIPTION2 = "Start here: how to use Paigy, in full \u2014 pairing, listening, receiving, asking, updates and completions, Goals, organizing work, and calls. Pass a topic for one section. Read-only; needs no setup.";
|
|
14454
14512
|
var AGENT_PROMPTS2 = [
|
|
14455
14513
|
{
|
|
14456
14514
|
name: "help",
|
|
14457
14515
|
description: "How to use Paigy: the whole guide, or one topic of it.",
|
|
14458
14516
|
arguments: [{ name: "topic", description: `One section: ${HELP_TOPICS2.join(", ")}. Omit it for the whole guide.`, required: false }]
|
|
14459
14517
|
},
|
|
14460
|
-
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." }
|
|
14518
|
+
{ name: "welcome", description: "Start here: who you are on Paigy, then listen and collect your open work." },
|
|
14519
|
+
{ name: "organize", description: "Set up the person's work as a board: areas, projects and steps, proposed on a card before anything is built." }
|
|
14461
14520
|
];
|
|
14462
14521
|
var CreateGoalSchema2 = external_exports.object({
|
|
14463
14522
|
outcome: external_exports.string().trim().min(1).max(1e4),
|
|
@@ -14506,7 +14565,7 @@ var CreateChange2 = external_exports.object({
|
|
|
14506
14565
|
title: goalTitle2,
|
|
14507
14566
|
outcome: goalOutcome2,
|
|
14508
14567
|
ownerId: external_exports.string().trim().min(1).optional().describe("Who owns the work: an agent's participant (as check_activity shows it) or the person's. Omitted: you."),
|
|
14509
|
-
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root."),
|
|
14568
|
+
parentGoalId: external_exports.string().uuid().optional().describe("The Goal it belongs under. Omitted: a root. A project with several parts: create it, then one child per step under it; the person's Work tab counts a project's progress in those steps."),
|
|
14510
14569
|
sourceEntryIds: external_exports.array(external_exports.string().uuid()).max(20).optional().describe("The whole Entries the work came from, ones you can read.")
|
|
14511
14570
|
}).strict();
|
|
14512
14571
|
var EditChange2 = external_exports.object({ kind: external_exports.literal("edit"), goalId: changedGoal2, title: goalTitle2.optional(), outcome: goalOutcome2.optional() }).strict();
|
|
@@ -14551,7 +14610,7 @@ var ManageGoalsSchema2 = external_exports.object({
|
|
|
14551
14610
|
var ManageGoalsToolSchema2 = external_exports.object({
|
|
14552
14611
|
changes: external_exports.array(external_exports.discriminatedUnion("kind", [CreateChange2, CompleteChangeSchema2, EditChange2, StateChange2, AssignChange2, DeferChange2, MoveChange2, DependencyChange2])).min(1).max(50).describe("The changes, applied in order, each on its own.")
|
|
14553
14612
|
}).strict().superRefine((v, ctx) => editNames2(v.changes, ctx));
|
|
14554
|
-
var MANAGE_GOALS_DESCRIPTION2 = "Create, edit, assign, organize or close work. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
14613
|
+
var MANAGE_GOALS_DESCRIPTION2 = "Create, edit, assign, organize or close work. SHAPE IT AS PROJECTS WITH STEPS: create a project under its area (parentGoalId; a top-level Goal with children is an area), then each part as its child Goal, so the person sees N of M steps. Move a flat or orphaned Goal of yours into that shape when you touch it; a flat Goal is valid. Every change here changes Goals; answering, withdrawing or asking Questions stays in contact. Each change applies independently: a refused one names why (`results[i].error`, e.g. goal_revision_conflict, goal_children_open, goal_not_found) and the rest still apply, so read every result: a partial result is never a complete success. Kinds: complete (goalId, message capped at 50 characters, units, reply, optional next-step options {label, hint}) closes and reports atomically, exactly as contact.completions; create (title, outcome, ownerId, parentGoalId, sourceEntryIds) returns the new Goal's id in `results[i].goalId`, in the order requested, to use in later calls (an outcome is one paragraph, at most 500 characters: split more into child Goals with parentGoalId); edit (title and/or outcome); state (open, completed, canceled); assign (ownerId); defer (until: the Goal waits until then and its owner is woken when it passes; null takes it back); move (parentGoalId, or null for a root: only this Goal moves); dependency (add or remove: goalId waits on dependsOnGoalId to start or to complete). A Goal cannot be completed while its required children or dependencies remain open: finish or move them first. Finishing the children does not prove the parent's own work is done. An edit applies at the version you last read: if someone changed the Goal since, it is refused as goal_revision_conflict, so read it again (get_goals) and reconsider. You may change any Goal of your person; a change puts you on it. Returns `ok` (every change applied), `results` per change (applied or failed), and `goals`, each changed Goal's id, state, title, outcome and revision.";
|
|
14555
14614
|
var GetGoalsSchema2 = external_exports.object({
|
|
14556
14615
|
goalIds: external_exports.array(external_exports.string().uuid()).min(1).max(10).describe("The Goals to read, in order; one to ten IDs."),
|
|
14557
14616
|
/** Every entry in full. Without it the read carries the person's words, open questions and your
|
|
@@ -14699,6 +14758,10 @@ var BrainMessageSchema2 = external_exports.union([
|
|
|
14699
14758
|
// WHAT IT ASKS THE AGENT, IN UNDER TEN WORDS (owner, 2026-10-15: "Yes, add the summary"): the talker's own, stored
|
|
14700
14759
|
// as the sent Entry's summary, which the recap's "Sent to <agent>: …" row shows. Absent on results written before it.
|
|
14701
14760
|
summary: external_exports.string().optional(),
|
|
14761
|
+
// THE PERSON'S LINES IT CARRIES, IN THEIR WORDS (owner, 2026-11-05: "just deliver my exact words to the agent"): the
|
|
14762
|
+
// `entries` keys of those lines, each relayed whole on the agent's Delivery (`context = false`), where the rest of
|
|
14763
|
+
// `entryKeys` ride as context. Absent on results written before it, and on a message that carries none.
|
|
14764
|
+
carries: external_exports.array(key2).optional(),
|
|
14702
14765
|
// THE PERSON ASKED TO BE CALLED BACK ONCE THIS AGENT'S WORK IS DONE (turns.md, step 0): the agent owes
|
|
14703
14766
|
// the call, and its next contact about it rings them (`public.callbacks`).
|
|
14704
14767
|
callback: external_exports.literal(true).optional()
|
|
@@ -14762,8 +14825,11 @@ var TalkerReplySchema2 = external_exports.object({
|
|
|
14762
14825
|
* "Yes, add the summary"), which the recap's "Sent to <agent>: …" row shows; `about` names
|
|
14763
14826
|
* handles; `blocks` is the item a question to an agent must be answered before ("" for none);
|
|
14764
14827
|
* `callback` is true on a message to the agent doing work the person asked to be called back about
|
|
14765
|
-
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0).
|
|
14766
|
-
|
|
14828
|
+
* once it is done (false otherwise): that agent then owes the call (turns.md, step 0). `lines` are the
|
|
14829
|
+
* person's line handles a message to an agent carries ([] for none): the agent receives those lines, in their
|
|
14830
|
+
* words, and `text` is then only what the talker adds beyond them (owner, 2026-11-05: "just deliver my exact
|
|
14831
|
+
* words to the agent, keeping the summary as a way for me to navigate them more easily"). */
|
|
14832
|
+
messages: external_exports.array(external_exports.object({ key: str32, to: str32, sentences: strs22, text: str32, summary: str32, about: strs22, blocks: str32, callback: external_exports.boolean(), lines: strs22.optional() }).strict()),
|
|
14767
14833
|
/** What the call does next: listen, hold (the person asked for a moment) or end (they asked to). */
|
|
14768
14834
|
then: external_exports.enum(["listen", "hold", "end"]),
|
|
14769
14835
|
/** The person's replies to items (replies, owner 2026-10-07): the item's handle, the chosen option
|
|
@@ -14781,9 +14847,14 @@ var TalkerReplySchema2 = external_exports.object({
|
|
|
14781
14847
|
/** The handle of the item to explain ("" for none). */
|
|
14782
14848
|
explain: str32
|
|
14783
14849
|
}).strict();
|
|
14784
|
-
var TALKER_REPLY_JSON_SCHEMA2 = (({ $schema: _, ...rest }) => rest)(
|
|
14850
|
+
var TALKER_REPLY_JSON_SCHEMA2 = withEveryMessageField2((({ $schema: _, ...rest }) => rest)(
|
|
14785
14851
|
zodToJsonSchema2(TalkerReplySchema2, { $refStrategy: "none" })
|
|
14786
|
-
);
|
|
14852
|
+
));
|
|
14853
|
+
function withEveryMessageField2(schema) {
|
|
14854
|
+
const item = schema.properties?.messages?.items;
|
|
14855
|
+
if (item?.properties) item.required = Object.keys(item.properties);
|
|
14856
|
+
return schema;
|
|
14857
|
+
}
|
|
14787
14858
|
var str42 = external_exports.string();
|
|
14788
14859
|
var strs32 = external_exports.array(external_exports.string());
|
|
14789
14860
|
var FilerReplySchema2 = external_exports.object({
|
|
@@ -15497,11 +15568,41 @@ var InboxItemSchema2 = external_exports.object({
|
|
|
15497
15568
|
rev: external_exports.string().optional()
|
|
15498
15569
|
});
|
|
15499
15570
|
var APNS_TOKEN_RE2 = /^[0-9a-fA-F]{64}$/;
|
|
15571
|
+
var PushDeviceIdSchema2 = external_exports.string().regex(/^[A-Za-z0-9._:-]{1,200}$/, "not an install id");
|
|
15572
|
+
var PushDeviceSchema2 = external_exports.object({
|
|
15573
|
+
deviceId: external_exports.string(),
|
|
15574
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
15575
|
+
label: external_exports.string().nullable(),
|
|
15576
|
+
model: external_exports.string().nullable(),
|
|
15577
|
+
/** Calls and banners go here. */
|
|
15578
|
+
rings: external_exports.boolean(),
|
|
15579
|
+
/** It has a token a call can ring. */
|
|
15580
|
+
ringable: external_exports.boolean(),
|
|
15581
|
+
chosenAt: external_exports.string().nullable(),
|
|
15582
|
+
updatedAt: external_exports.string()
|
|
15583
|
+
});
|
|
15584
|
+
var PushTokenDeviceSchema2 = external_exports.object({
|
|
15585
|
+
deviceId: external_exports.string(),
|
|
15586
|
+
rings: external_exports.boolean(),
|
|
15587
|
+
ask: external_exports.boolean(),
|
|
15588
|
+
ringsOn: external_exports.object({ deviceId: external_exports.string().nullable(), label: external_exports.string().nullable() }).nullable()
|
|
15589
|
+
});
|
|
15590
|
+
var PushRingsSchema2 = external_exports.object({ rings: external_exports.boolean() });
|
|
15500
15591
|
var PushTokenSchema2 = external_exports.object({
|
|
15501
15592
|
voipToken: external_exports.string().min(1).optional(),
|
|
15502
15593
|
alertToken: external_exports.string().min(1).optional(),
|
|
15503
15594
|
fcmToken: external_exports.string().min(1).optional(),
|
|
15504
|
-
platform: external_exports.enum(["ios", "android"])
|
|
15595
|
+
platform: external_exports.enum(["ios", "android"]),
|
|
15596
|
+
/** WHICH INSTALL POSTED IT (owner, 2026-11-05: "Ask on each new device"). Absent from every
|
|
15597
|
+
* build before it, and then the post is exactly what it always was: the one row per account.
|
|
15598
|
+
* With it, the install has its own row and calls ring only where the person chose. */
|
|
15599
|
+
deviceId: PushDeviceIdSchema2.optional(),
|
|
15600
|
+
/** The install's name as the person knows it ("iPhone", "iPad"), and its model. */
|
|
15601
|
+
label: external_exports.string().trim().min(1).max(80).optional(),
|
|
15602
|
+
model: external_exports.string().trim().min(1).max(80).optional(),
|
|
15603
|
+
/** The person's choice, when the post carries it; absent, the install keeps what it has (and
|
|
15604
|
+
* its first ring token decides once: it rings unless another install already does). */
|
|
15605
|
+
rings: external_exports.boolean().optional()
|
|
15505
15606
|
}).superRefine((v, ctx) => {
|
|
15506
15607
|
if (v.platform !== "ios") return;
|
|
15507
15608
|
for (const field of ["voipToken", "alertToken"]) {
|
|
@@ -15611,7 +15712,11 @@ var GoalLatestSchema2 = external_exports.object({
|
|
|
15611
15712
|
titles: external_exports.array(external_exports.string()).optional(),
|
|
15612
15713
|
/** A PROGRESS NOTE'S ONE POINT ("An agent's progress note -> maybe let's cap it at 200 chars"): the
|
|
15613
15714
|
* update's own line, before its units; the row caps it at 200. Absent on anything else. */
|
|
15614
|
-
line: external_exports.string().optional()
|
|
15715
|
+
line: external_exports.string().optional(),
|
|
15716
|
+
/** THE PERSON'S ENTRIES IT CARRIED TO AN AGENT, IN THEIR WORDS (owner, 2026-11-05: "paraphrasing shouldn't change
|
|
15717
|
+
* attribution in the UI"): on a message Paigy sent an agent, the person's Entries its Delivery relays whole. A row
|
|
15718
|
+
* draws it as theirs. Absent on anything else, and from a door older than it. */
|
|
15719
|
+
carries: external_exports.array(external_exports.string()).optional()
|
|
15615
15720
|
});
|
|
15616
15721
|
var HistoryWorkSchema2 = external_exports.object({
|
|
15617
15722
|
id: external_exports.string(),
|
|
@@ -15880,6 +15985,11 @@ var QueueItemSchema2 = external_exports.object({
|
|
|
15880
15985
|
* and a door older than 20261013045542 need not spell them. */
|
|
15881
15986
|
yours: GoalLatestSchema2.nullable().optional(),
|
|
15882
15987
|
theirs: GoalLatestSchema2.nullable().optional(),
|
|
15988
|
+
/** ITS STEPS, COUNTED IN THE DATABASE (owner, 2026-11-04: "Count on the server, and agents make steps"): its
|
|
15989
|
+
* direct children that were not cancelled, and how many of them are done. The queue holds only a recent
|
|
15990
|
+
* slice of finished work, so counting `childGoalIds` read "0 of 1" for a project with five done. Absent
|
|
15991
|
+
* from a door older than this field, or when the count failed: the app then counts what it holds. */
|
|
15992
|
+
steps: external_exports.object({ total: external_exports.number().int().nonnegative(), done: external_exports.number().int().nonnegative() }).nullable().optional(),
|
|
15883
15993
|
/** WHAT THIS ROW IS, IN TWELVE CHARACTERS (#2928) — the hash of every other field on it, stamped
|
|
15884
15994
|
* by the one projection that builds the row (`apps/api/src/goal/queue.ts`). It is how the
|
|
15885
15995
|
* incremental read knows a row has not moved: the phone echoes back the revs it holds
|
|
@@ -16233,6 +16343,12 @@ var CallRecapSchema2 = external_exports.object({
|
|
|
16233
16343
|
* summary (Brain, 2026-10-14). Optional: absent from an API before it. */
|
|
16234
16344
|
filedOn: external_exports.array(external_exports.object({ goalId: external_exports.string().uuid(), title: external_exports.string() })).optional(),
|
|
16235
16345
|
recorded: external_exports.boolean().optional(),
|
|
16346
|
+
/** On a `said` row: the agents the call SENT those words to, from the sending action's own
|
|
16347
|
+
* `about.agents` (20261106220220). The review's receipt is drawn from this and from the row's
|
|
16348
|
+
* own `requestId`, never from the asker of a question the words happened to sit under: on call
|
|
16349
|
+
* f9670f67 that asker was Interface while the send named Comms. `[]` or absent means nothing
|
|
16350
|
+
* was sent for that row, which is why the receipt is positive-only. */
|
|
16351
|
+
sentTo: external_exports.array(external_exports.object({ id: external_exports.string().nullable(), name: external_exports.string() })).optional(),
|
|
16236
16352
|
settled: external_exports.object({ requestId: external_exports.string(), answer: external_exports.string() }).nullable().optional(),
|
|
16237
16353
|
acknowledged: external_exports.boolean().optional(),
|
|
16238
16354
|
/** On a `put` row: still waiting for the person's answer (not settled, not answered, not put off).
|