@oneie/sdk 0.17.3 → 0.17.5
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 +4 -0
- package/dist/.build-fingerprint +1 -0
- package/dist/age.d.ts +96 -0
- package/dist/age.d.ts.map +1 -0
- package/dist/age.js +487 -0
- package/dist/age.js.map +1 -0
- package/dist/blocks.d.ts +8 -4
- package/dist/blocks.d.ts.map +1 -1
- package/dist/blocks.js +17 -5
- package/dist/blocks.js.map +1 -1
- package/dist/edge/solve.d.ts +38 -0
- package/dist/edge/solve.d.ts.map +1 -0
- package/dist/edge/solve.js +334 -0
- package/dist/edge/solve.js.map +1 -0
- package/dist/edge/types.d.ts +216 -0
- package/dist/edge/types.d.ts.map +1 -0
- package/dist/edge/types.js +21 -0
- package/dist/edge/types.js.map +1 -0
- package/dist/edge/validate.d.ts +19 -0
- package/dist/edge/validate.d.ts.map +1 -0
- package/dist/edge/validate.js +89 -0
- package/dist/edge/validate.js.map +1 -0
- package/dist/edge.d.ts +9 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/edge.js +8 -0
- package/dist/edge.js.map +1 -0
- package/dist/fn-allowlist.d.ts +1 -1
- package/dist/fn-allowlist.d.ts.map +1 -1
- package/dist/fn-allowlist.js +14 -0
- package/dist/fn-allowlist.js.map +1 -1
- package/dist/gateway.d.ts +18 -1
- package/dist/gateway.d.ts.map +1 -1
- package/dist/gateway.js +77 -3
- package/dist/gateway.js.map +1 -1
- package/dist/generated/fn-map.d.ts +2 -2
- package/dist/generated/fn-map.d.ts.map +1 -1
- package/dist/generated/fn-map.js +114 -13
- package/dist/generated/fn-map.js.map +1 -1
- package/dist/generated/schemas.d.ts +56 -14
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +32 -1
- package/dist/generated/schemas.js.map +1 -1
- package/dist/market.d.ts.map +1 -1
- package/dist/market.js +6 -0
- package/dist/market.js.map +1 -1
- package/dist/message-key.d.ts +20 -0
- package/dist/message-key.d.ts.map +1 -0
- package/dist/message-key.js +46 -0
- package/dist/message-key.js.map +1 -0
- package/dist/message-lock.d.ts +56 -0
- package/dist/message-lock.d.ts.map +1 -0
- package/dist/message-lock.js +157 -0
- package/dist/message-lock.js.map +1 -0
- package/dist/receiver-layers.d.ts +1 -1
- package/dist/receiver-layers.d.ts.map +1 -1
- package/dist/receiver-layers.js +36 -0
- package/dist/receiver-layers.js.map +1 -1
- package/dist/receivers.d.ts +1397 -50
- package/dist/receivers.d.ts.map +1 -1
- package/dist/receivers.js +1423 -62
- package/dist/receivers.js.map +1 -1
- package/dist/secrets-give.d.ts +120 -0
- package/dist/secrets-give.d.ts.map +1 -0
- package/dist/secrets-give.js +160 -0
- package/dist/secrets-give.js.map +1 -0
- package/dist/secrets-grant.d.ts +52 -0
- package/dist/secrets-grant.d.ts.map +1 -0
- package/dist/secrets-grant.js +55 -0
- package/dist/secrets-grant.js.map +1 -0
- package/dist/secrets-key.d.ts +20 -0
- package/dist/secrets-key.d.ts.map +1 -0
- package/dist/secrets-key.js +47 -0
- package/dist/secrets-key.js.map +1 -0
- package/dist/secrets-one-vault.d.ts +21 -0
- package/dist/secrets-one-vault.d.ts.map +1 -0
- package/dist/secrets-one-vault.js +38 -0
- package/dist/secrets-one-vault.js.map +1 -0
- package/dist/secrets.d.ts +195 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +377 -0
- package/dist/secrets.js.map +1 -0
- package/dist/templates.js +6 -6
- package/dist/templates.js.map +1 -1
- package/dist/work-contract-grammar.json +41 -0
- package/package.json +37 -2
- package/src/generated/funs.json +1 -0
package/dist/receivers.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { AgentActionResponseSchema, AgentStatusResponseSchema, CapabilityItemSchema, PayResponseSchema, RegisterResponseSchema, StatsSchema, StepKind, WorkflowDiffSchema, } from "./schemas.js";
|
|
3
3
|
import { FieldSchema, ResourceTypeSchema } from "./types.js";
|
|
4
4
|
import { GroupEntitySchema } from "./generated/schemas/index.js";
|
|
5
|
+
import { PROVIDER_NAMES, REFUSALS, USED_REFUSALS } from "./secrets.js";
|
|
5
6
|
/**
|
|
6
7
|
* Declare a receiver contract. Identity at runtime — its only job is to pin the
|
|
7
8
|
* `Req`/`Res` generics so the catalog infers payload + outcome types.
|
|
@@ -60,6 +61,23 @@ const CARD_STEP_RESPONSE = z.object({
|
|
|
60
61
|
step: z.string().optional(),
|
|
61
62
|
error: z.string().optional(),
|
|
62
63
|
});
|
|
64
|
+
/**
|
|
65
|
+
* The fields tasks:mine and tasks:everywhere answer beside `tasks` since they read the
|
|
66
|
+
* queue from RAM (tql-edge C10, text/tql-edge-todo.md § C10). Declared here because a
|
|
67
|
+
* receiver that pages, caps or reads a snapshot names its window in the response, every
|
|
68
|
+
* time — and `reason` had three readers branching on it while the contract denied it.
|
|
69
|
+
*/
|
|
70
|
+
const QUEUE_READ_FIELDS = {
|
|
71
|
+
total: z.number().optional().describe("Rows matching BEFORE `limit`. A FLOOR, not a count, whenever `truncatedTypes` is present"),
|
|
72
|
+
truncated: z.boolean().optional().describe("true = the answer is short: more rows than returned (raise limit, or use tasks:board) OR graph.json marks a type this read touched as cut (`truncatedTypes`)"),
|
|
73
|
+
truncatedTypes: z.array(z.string()).optional().describe("Graph types the RAM snapshot marks cut that this read touched (contract #13: the snapshot's `truncated` ∩ the funs' types). Absent = nothing was cut"),
|
|
74
|
+
asOf: z.string().optional().describe("When the task scan this answer reads was taken from TypeDB (ISO) — shared by every caller for up to 60 s (KV), so up to a minute behind a write. Never read-modify-write a row through this receiver: read it with tasks:board {tid, fresh:true}. `claimable` is a prediction as of this instant; tasks:claim decides"),
|
|
75
|
+
prose: z.literal("unavailable").optional().describe("notes/contextDocs could not be hydrated for this page (they are not in the RAM graph — one keyed read fetches them). Present = every `notes`/`contextDocs` here is MISSING, not empty"),
|
|
76
|
+
reason: z.enum(["no_subscriptions", "no_workspace_membership"]).optional().describe("Why an ok:true queue may be empty: `no_subscriptions` (tasks:mine — subscribe, or read the board directly) · `no_workspace_membership` (tasks:everywhere — the caller belongs to no workspace)"),
|
|
77
|
+
error: z.string().optional().describe("On ok:false: `upstream_unavailable` (no graph — `detail` says why) · `edge_fun_missing` (funs.json lacks a queue fun — `missing` names each) · `edge_ir_mismatch` · `budget` · `edge_solve_failed`. Never an empty queue in place of a reason"),
|
|
78
|
+
detail: z.string().optional(),
|
|
79
|
+
missing: z.array(z.object({ fun: z.string(), reason: z.string() })).optional().describe("edge_fun_missing: each fun the edge cannot solve and codegen's reason (e.g. not on prod)"),
|
|
80
|
+
};
|
|
63
81
|
/**
|
|
64
82
|
* The receiver catalog — one source of truth for capability. Object-literal keys
|
|
65
83
|
* are always literal, so `keyof typeof RECEIVERS` yields the declared receiver
|
|
@@ -68,6 +86,45 @@ const CARD_STEP_RESPONSE = z.object({
|
|
|
68
86
|
* Populated incrementally: C2 = spine + 21 `world:*` + `grant-capability`;
|
|
69
87
|
* C4 = remaining families with metadata; C5 = the `meta:` family.
|
|
70
88
|
*/
|
|
89
|
+
/** The page settings `pages:edit` may write into `data.root.props` — the same
|
|
90
|
+
* keys Puck's root panel edits (one.ie/web/src/lib/puck/config.tsx ROOT_FIELDS).
|
|
91
|
+
* `""` clears a key. Closed on purpose: root also carries `theme`, which has
|
|
92
|
+
* its own door. */
|
|
93
|
+
// What `pages:create` / `pages:edit` say about the page they just wrote: the
|
|
94
|
+
// template-strength checks (lib/puck/template-strength.ts), so a meh page comes
|
|
95
|
+
// back with the fixes named in the same turn instead of looking like success.
|
|
96
|
+
const PAGE_QUALITY = z.object({
|
|
97
|
+
score: z.number(), max: z.number(),
|
|
98
|
+
missing: z.array(z.string()).describe("Checks the page fails — each has a line in `fix`"),
|
|
99
|
+
fix: z.record(z.string(), z.string()).describe("check → how to fix it"),
|
|
100
|
+
why: z.record(z.string(), z.array(z.string())).describe("check → the offending block ids and values (at most 5 per check)"),
|
|
101
|
+
factTokens: z.array(z.string()).optional().describe("`{{ns.key}}` / `[Fact]` tokens still in the copy. Each fills from the workspace's business facts at render; one with no fact DROPS its sentence. Write the real value where you know it."),
|
|
102
|
+
}).describe("Template-strength verdict on the stored page. Fix what `missing` names before calling it done.");
|
|
103
|
+
const PAGE_ROOT_PATCH = z.object({
|
|
104
|
+
description: z.string().max(500),
|
|
105
|
+
socialTitle: z.string().max(200),
|
|
106
|
+
ogImage: z.string().max(2000),
|
|
107
|
+
canonical: z.string().max(2000),
|
|
108
|
+
search: z.enum(["listed", "hidden", ""]),
|
|
109
|
+
chat: z.enum(["auto", "show", "panel", "hide", ""]),
|
|
110
|
+
dock: z.enum(["auto", "show", "hide", ""]),
|
|
111
|
+
siteHeader: z.enum(["auto", "hide", ""]),
|
|
112
|
+
siteFooter: z.enum(["auto", "hide", ""]),
|
|
113
|
+
}).partial().strict();
|
|
114
|
+
// One storefront price as products:create and products:update accept it. Every field
|
|
115
|
+
// the studio's ProductBuilder sends is declared, because the edge returns zod's PARSED
|
|
116
|
+
// output and strips the rest. `interval` is nullable: the editor loads a one-time price
|
|
117
|
+
// as `interval: null` and sends it back. `compare_at_amount` is the was-price (0255);
|
|
118
|
+
// commerce.ts compareAtColumn refuses one that is not above unit_amount.
|
|
119
|
+
const productPriceInput = z.object({
|
|
120
|
+
unit_amount: z.number(),
|
|
121
|
+
currency: z.string().optional(),
|
|
122
|
+
price_type: z.string().optional(),
|
|
123
|
+
interval: z.string().nullable().optional(),
|
|
124
|
+
nickname: z.string().optional(),
|
|
125
|
+
is_default: z.boolean().optional(),
|
|
126
|
+
compare_at_amount: z.number().nullable().optional(),
|
|
127
|
+
});
|
|
71
128
|
export const RECEIVERS = {
|
|
72
129
|
// ── Spine (non-world) — contracts only this cycle; route-wiring lands in C4 ──
|
|
73
130
|
"agent:enroll": receiver({
|
|
@@ -480,6 +537,13 @@ export const RECEIVERS = {
|
|
|
480
537
|
receiver: "visitor:identify",
|
|
481
538
|
summary: "Every surface's front door to identify a visitor — mines free text, enriches by email, climbs the ladder, merges tenant-walled candidates, upserts the vCard.",
|
|
482
539
|
request: () => z.object({
|
|
540
|
+
// The workspace the visitor arrived at. Channels (a service caller) names
|
|
541
|
+
// it here, and the ask route reads the service principal's workspace from
|
|
542
|
+
// the PARSED payload — undeclared, it was stripped, the caller had no
|
|
543
|
+
// workspace, and every email typed into a chat was refused before the
|
|
544
|
+
// resolver ran. A session caller's own slug still wins over this field.
|
|
545
|
+
slug: z.string().optional(),
|
|
546
|
+
group: z.string().optional(),
|
|
483
547
|
email: z.string().optional(),
|
|
484
548
|
phone: z.string().optional(),
|
|
485
549
|
name: z.string().optional(),
|
|
@@ -487,6 +551,11 @@ export const RECEIVERS = {
|
|
|
487
551
|
channel: z.string().optional(),
|
|
488
552
|
sender: z.string().optional(),
|
|
489
553
|
visitorHash: z.string().optional(),
|
|
554
|
+
// web's signature over exactly (visitorHash, slug) — one.ie/web
|
|
555
|
+
// lib/visitor-attest.ts. On the gateway lane and in a workflow step the
|
|
556
|
+
// workspace is a nominated value, so a visitorHash binds only behind this;
|
|
557
|
+
// undeclared, the edge would strip it and no chat browser would ever bind.
|
|
558
|
+
visitorAttest: z.string().optional(),
|
|
490
559
|
freeText: z.string().optional(),
|
|
491
560
|
source: z.enum(["door", "chat", "asked", "event"]),
|
|
492
561
|
}),
|
|
@@ -538,6 +607,46 @@ export const RECEIVERS = {
|
|
|
538
607
|
idempotent: true,
|
|
539
608
|
examples: [{ aid: "person:anna", source: "clearbit", fields: { company: "Byrne Dental", role: "Dentist", location: "Dublin" } }],
|
|
540
609
|
}),
|
|
610
|
+
// crm card 20 (text/crm.md § 20). The override is the TEACHING signal, not a
|
|
611
|
+
// second stage writer: entity:tag (source:'human') moves the stage, this door
|
|
612
|
+
// tells the classifier the rule was wrong for this group. The rule key and the
|
|
613
|
+
// stage keys are built ONLY in one.ie/web/src/lib/lifecycle/rules.ts
|
|
614
|
+
// (overrideLesson), so one function says what a rule is called.
|
|
615
|
+
"actor:override": receiver({
|
|
616
|
+
receiver: "actor:override",
|
|
617
|
+
summary: "Override a stage a lifecycle RULE chose, and teach the classifier this group's meaning: warns rule→the stage the rule picked, marks rule→the stage a person picked. Only a stage a rule actually moved the contact into can be overridden; a hand move has no rule to unlearn. Does not move the stage — entity:tag (source:'human') does that.",
|
|
618
|
+
request: () => z.object({
|
|
619
|
+
id: z.string().describe("The contact (inbox entity id) whose stage the rule set. Must be one of the caller's own contacts — the wall is the attested caller, never this body."),
|
|
620
|
+
lifecycle: z.string().describe("The lifecycle def id the rule moved them in, e.g. `sales`."),
|
|
621
|
+
from: z.string().describe("The stage the RULE put them in. Its `enter_when` is the rule being overridden; the move must be in the stage_transition log as source:'rule'."),
|
|
622
|
+
to: z.string().describe("The stage a person says is right. Must be a stage of the same def, and not `from`."),
|
|
623
|
+
}),
|
|
624
|
+
response: () => z.object({
|
|
625
|
+
ok: z.boolean(),
|
|
626
|
+
id: z.string().optional(),
|
|
627
|
+
lifecycle: z.string().optional(),
|
|
628
|
+
from: z.string().optional(),
|
|
629
|
+
to: z.string().optional(),
|
|
630
|
+
rule: z.string().optional().describe("The enter_when of the overridden stage — the rule that fired."),
|
|
631
|
+
taught: z
|
|
632
|
+
.object({
|
|
633
|
+
warned: z.object({ source: z.string(), target: z.string() }),
|
|
634
|
+
marked: z.object({ source: z.string(), target: z.string() }),
|
|
635
|
+
})
|
|
636
|
+
.optional()
|
|
637
|
+
.describe("The two paths the override moved: rule:<group>:<lifecycle>:<rule> → stage:<group>:<lifecycle>:<stage>."),
|
|
638
|
+
error: z
|
|
639
|
+
.string()
|
|
640
|
+
.optional()
|
|
641
|
+
.describe("unauthenticated · id_required · lifecycle_required · from_required · to_required · no_db · not_your_contact · unknown_lifecycle · unknown_stage · same_stage · no_rule · no_rule_move · store_unavailable"),
|
|
642
|
+
}),
|
|
643
|
+
effect: "ask",
|
|
644
|
+
auth: "manage_lifecycle",
|
|
645
|
+
roleAction: "manage_lifecycle",
|
|
646
|
+
cost: "free",
|
|
647
|
+
idempotent: false,
|
|
648
|
+
examples: [{ id: "person:anna", lifecycle: "sales", from: "won", to: "lead" }],
|
|
649
|
+
}),
|
|
541
650
|
"world:update-contact": receiver({
|
|
542
651
|
receiver: "world:update-contact",
|
|
543
652
|
summary: "Update an actor's contact/profile attributes — identity, contact details, professional, personal, CRM metrics",
|
|
@@ -1053,7 +1162,13 @@ export const RECEIVERS = {
|
|
|
1053
1162
|
receiver: "tools:composio",
|
|
1054
1163
|
summary: "Execute one connected Composio tool from a workflow `tool` step (config.composio)",
|
|
1055
1164
|
request: () => z.object({ workspace: z.string().optional().describe("Workspace slug; defaults to the attested caller's"), tool: z.string().describe("Composio tool slug to execute"), args: z.record(z.string(), z.unknown()).optional().describe("Arguments passed to the tool") }),
|
|
1056
|
-
response: () => z.object({
|
|
1165
|
+
response: () => z.object({
|
|
1166
|
+
ok: z.boolean(), tool: z.string().optional(), result: z.unknown().optional(), error: z.string().optional(),
|
|
1167
|
+
reason: z.string().optional().describe("Why a call was refused: approval_required, over_limit, meter_unavailable"),
|
|
1168
|
+
write: z.boolean().optional().describe("The tool was classed a write (fail closed: anything not a clear read verb); from an API key a write answers approval_required"),
|
|
1169
|
+
withheld: z.array(z.string()).optional().describe("Paths of credential fields (access_token, refresh_token, client_secret, …) replaced with \"[withheld]\" before the result left the worker"),
|
|
1170
|
+
used: z.object({ today: z.number().optional(), perDay: z.number().optional() }).passthrough().optional().describe("The workspace's interim daily execute meter, UTC"),
|
|
1171
|
+
}),
|
|
1057
1172
|
effect: "ask", auth: "manage_integrations", reversible: false, idempotent: false,
|
|
1058
1173
|
examples: [{ workspace: "acme", tool: "GMAIL_SEND_EMAIL", args: { to: "x@y.com" } }],
|
|
1059
1174
|
}),
|
|
@@ -1076,14 +1191,14 @@ export const RECEIVERS = {
|
|
|
1076
1191
|
"endpoint:register": receiver({
|
|
1077
1192
|
receiver: "endpoint:register",
|
|
1078
1193
|
surfaces: { mcp: true },
|
|
1079
|
-
summary: "Register (or update) one of the workspace's own https endpoints under a handle a workflow step can name. The url is SSRF-checked here and again on every call; a secret is sealed under the worker's envelope key
|
|
1194
|
+
summary: "Register (or update) one of the workspace's own https endpoints under a handle a workflow step can name. The url is SSRF-checked here and again on every call; a secret goes to THE OPENER (secrets/), which seals it to ONE's lock bound to this workspace, name and url — the web app keeps only a ref, never returns it, and cannot open it. A new url needs the secret again. Until the opener is deployed (no OPENER binding), a secret is sealed under the worker's envelope key exactly as before.",
|
|
1080
1195
|
request: () => z.object({
|
|
1081
1196
|
workspace: z.string().optional().describe("Group slug. Omit for your own. A scope REQUEST — refused when the authority walk says no, never swapped for your own."),
|
|
1082
1197
|
name: z.string().describe("The handle a workflow step names. Lowercase letters, digits, `-` and `_`, 1–48 chars. Unique per workspace; re-registering the same name updates it in place so a live workflow keeps working."),
|
|
1083
1198
|
url: z.string().describe("A public https address. Refused BY NAME — https_required · ip_literal · private_hostname · dns_unresolved · blocked_address — so a retry is informed."),
|
|
1084
1199
|
method: z.enum(["GET", "POST", "PUT", "PATCH"]).optional().describe("Default POST. GET folds `input` into the query string; the others send it as a JSON body."),
|
|
1085
|
-
authHeader: z.string().optional().describe("The header NAME the secret travels in, e.g. `Authorization` or `X-Api-Key`. The VALUE is `secret
|
|
1086
|
-
secret: z.string().optional().describe("Your endpoint's own credential.
|
|
1200
|
+
authHeader: z.string().optional().describe("The header NAME the secret travels in, e.g. `Authorization` or `X-Api-Key`. The VALUE is `secret`, held by the opener. Changing it on a re-register needs the secret again."),
|
|
1201
|
+
secret: z.string().optional().describe("Your endpoint's own credential. Handed to the opener, which seals it to ONE's lock bound to this workspace, name and url, opens it only to send a call to THAT url, and scrubs it from the answer; never logged, never returned. Requires `authHeader`. Omitting it on a re-register KEEPS the existing secret when the url and authHeader are unchanged; a new url (or authHeader) without it is refused `bad_request: a new url needs the secret again` — the opener never re-points a key."),
|
|
1087
1202
|
returnMode: z.enum(["json", "url", "bytes"]).optional().describe("What the endpoint answers. `json` = the answer itself. `url` = a small JSON body naming a url, which is fetched under the SAME guard and filed to the media library. `bytes` = the asset itself, filed the same way. Default json."),
|
|
1088
1203
|
timeoutMs: z.number().optional().describe("Per-call AbortSignal timeout. Default 20000, clamped to 1000–120000."),
|
|
1089
1204
|
maxBytes: z.number().optional().describe("Response byte ceiling, enforced while reading — `content-length` is a claim and is not read. Default 5 MiB, clamped to 10 MiB."),
|
|
@@ -2031,7 +2146,7 @@ export const RECEIVERS = {
|
|
|
2031
2146
|
"tasks:mine": receiver({
|
|
2032
2147
|
receiver: "tasks:mine",
|
|
2033
2148
|
surfaces: { mcp: true },
|
|
2034
|
-
summary: "My work queue: the open tasks whose words match what I subscribed to, ranked by learned weight (
|
|
2149
|
+
summary: "My work queue: the open tasks whose words match what I subscribed to, ranked by learned weight (the tag-node lane), not static priority. Read from RAM as of `asOf`",
|
|
2035
2150
|
// `workspace` is not decoration — /api/ask reads a SERVICE caller's nominated slug off
|
|
2036
2151
|
// validation.payload.slug|workspace, and zod .object() STRIPS unknown keys. Omitting the
|
|
2037
2152
|
// field here meant a service call could never name a workspace: ctx.ownerSlug stayed
|
|
@@ -2055,7 +2170,9 @@ export const RECEIVERS = {
|
|
|
2055
2170
|
// before running /do <slug>. Empty until the task is enriched (seed/backfill).
|
|
2056
2171
|
notes: z.string().optional(),
|
|
2057
2172
|
contextDocs: z.array(z.string()).optional(),
|
|
2173
|
+
priority: z.number().optional().describe("Task priority; the fallback behind `weight` when no followed word carries learned strength"),
|
|
2058
2174
|
})),
|
|
2175
|
+
...QUEUE_READ_FIELDS,
|
|
2059
2176
|
}),
|
|
2060
2177
|
effect: "ask", idempotent: true,
|
|
2061
2178
|
}),
|
|
@@ -2093,11 +2210,12 @@ export const RECEIVERS = {
|
|
|
2093
2210
|
claimable: z.boolean(),
|
|
2094
2211
|
offeredByMe: z.boolean(),
|
|
2095
2212
|
closedAt: z.string().optional(),
|
|
2213
|
+
// Shipped since 2026-09-17 and undeclared until tql-edge C10.
|
|
2214
|
+
blockedBy: z.array(z.string()).optional().describe("Tids blocking this row (the `blocks` edges). Absent = no blockers at all — absent is not `false`"),
|
|
2215
|
+
openBlockers: z.number().optional().describe("How many of `blockedBy` the CLAIM DOOR would still count (done/verified clear; an unknown blocker counts — fail closed). Present only with `blockedBy`"),
|
|
2096
2216
|
})),
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
total: z.number().optional().describe("Visible rows before the limit was applied"),
|
|
2100
|
-
truncated: z.boolean().optional().describe("true = more rows exist than were returned; raise limit or use tasks:board"),
|
|
2217
|
+
...QUEUE_READ_FIELDS,
|
|
2218
|
+
edgesTruncated: z.literal(true).optional().describe("The `blocks` edge sweep was cut or failed: every `claimable:true` in this body is a best effort, not a promise"),
|
|
2101
2219
|
}),
|
|
2102
2220
|
effect: "ask", idempotent: true,
|
|
2103
2221
|
}),
|
|
@@ -3887,17 +4005,27 @@ export const RECEIVERS = {
|
|
|
3887
4005
|
}),
|
|
3888
4006
|
"meta:reputation": receiver({
|
|
3889
4007
|
receiver: "meta:reputation",
|
|
3890
|
-
summary: "Read an actor's reputation score —
|
|
4008
|
+
summary: "Read an actor's reputation score — the net of the claw_paths rows routing ranks by, plus vote counts from reputation_votes. The score and the counts go to every caller. Each row's payer identity, strength and resistance are disclosed by the workspace the payment was SETTLED TO, written on the row at payment time by wallet:send (never looked up by the uid, which any registry can be squatted under): a controller of that workspace reads the row (the spend walk from the attested caller), and so does a member of it when that workspace's C10 visibility is Members (the membership snapshot). Every other row is counted and withheld; `withheld` says how many, and `disclosure` names the highest rung that opened one. A row with no recorded workspace — written before the field existed, paid into two workspaces, or paid to a slug nobody owned yet — opens to nobody, ever. A walk or snapshot that cannot answer opens nothing",
|
|
3891
4009
|
request: () => z.object({ uid: z.string().describe("The actor's slug or aid to look up") }),
|
|
3892
4010
|
response: () => z.object({
|
|
3893
4011
|
uid: z.string(),
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
4012
|
+
disclosure: z.enum(["public", "members", "controller"]).optional().describe("The highest rung by which a row opened to this caller: controller (the spend walk admits the caller over a row's settled-to workspace), members (a confirmed member of a Members workspace a row settled to), public (no row opened — counts only). Absent only beside `error`"),
|
|
4013
|
+
error: z.string().optional().describe("uid_required only. A payee the caller may not read answers counts, never a 404 and never a hint either way"),
|
|
4014
|
+
score: z.number().optional().describe("Net strength - resistance over the claw_paths rows routing ranks by (readActorReputation) - the same number for every caller"),
|
|
4015
|
+
ratio: z.number().optional().describe("Normalised 0–1 float: strength / (strength + resistance)"),
|
|
4016
|
+
evidence: z.object({
|
|
4017
|
+
payers: z.number().describe("How many payers' settled money is in the score — every row, open or withheld"),
|
|
4018
|
+
stakes: z.number().describe("How many burned stakes are in the score — every row, open or withheld"),
|
|
4019
|
+
sources: z.array(z.string()).optional().describe("Payer slugs of the rows that opened to this caller. Absent when none did"),
|
|
4020
|
+
rows: z.array(z.object({ source: z.string(), strength: z.number(), resistance: z.number(), settledTo: z.string().nullable() })).optional().describe("The rows that opened to this caller, each with the workspace its payments settled to. Absent when none did"),
|
|
4021
|
+
}).optional().describe("The counts behind the score, and of the rows exactly those this caller may read"),
|
|
4022
|
+
withheld: z.number().optional().describe("How many of the payer and stake rows behind the score this caller may NOT read — the short answer says it is short. 0 when every row opened, or there are none"),
|
|
4023
|
+
commend_count: z.number().optional(),
|
|
4024
|
+
flag_count: z.number().optional(),
|
|
4025
|
+
strength: z.number().optional(),
|
|
4026
|
+
resistance: z.number().optional(),
|
|
4027
|
+
why: z.array(z.string()).optional().describe("Plain-English summary of the score"),
|
|
4028
|
+
howToRaise: z.array(z.string()).optional().describe("Actionable hints for improving score"),
|
|
3901
4029
|
}),
|
|
3902
4030
|
effect: "ask", cost: "free", idempotent: true,
|
|
3903
4031
|
}),
|
|
@@ -4641,16 +4769,14 @@ export const RECEIVERS = {
|
|
|
4641
4769
|
request: () => z.object({
|
|
4642
4770
|
slug: z.string(),
|
|
4643
4771
|
name: z.string(),
|
|
4644
|
-
prices: z.array(
|
|
4645
|
-
unit_amount: z.number(),
|
|
4646
|
-
currency: z.string().optional(),
|
|
4647
|
-
price_type: z.string().optional(),
|
|
4648
|
-
interval: z.string().optional(),
|
|
4649
|
-
})),
|
|
4772
|
+
prices: z.array(productPriceInput),
|
|
4650
4773
|
description: z.string().optional(),
|
|
4651
4774
|
images: z.array(z.string()).optional(),
|
|
4652
4775
|
product_type: z.string().optional(), // default 'one_time'
|
|
4653
4776
|
collection: z.string().optional(),
|
|
4777
|
+
// Search tags, stored in the product's metadata JSON (no column). Lower-cased, de-duplicated and
|
|
4778
|
+
// capped at eight by the resolver; undeclared here, zod would strip them at the HTTP edge.
|
|
4779
|
+
tags: z.array(z.string()).optional(),
|
|
4654
4780
|
// Same stripped-at-the-edge trap as the two artifact fields below, and it
|
|
4655
4781
|
// cost more: resolvers/commerce.ts has read `data.status` since it shipped,
|
|
4656
4782
|
// but the key was never declared here, so zod dropped it and EVERY product
|
|
@@ -4676,10 +4802,42 @@ export const RECEIVERS = {
|
|
|
4676
4802
|
// `status` carries the same history as on products:create — the resolver has
|
|
4677
4803
|
// always read it, the declaration never listed it, so zod stripped it and a
|
|
4678
4804
|
// draft product could not be published through this receiver either.
|
|
4679
|
-
|
|
4805
|
+
// `prices` was undeclared, so zod stripped it at the edge and a price edit in the
|
|
4806
|
+
// studio's ProductBuilder saved everything except the price. A submitted price
|
|
4807
|
+
// whose charged terms match a live row keeps its ppid (commerce.ts planPriceUpdate).
|
|
4808
|
+
request: () => z.object({ slug: z.string(), pid: z.string(), name: z.string().optional(), description: z.string().optional(), images: z.array(z.string()).optional(), collection: z.string().optional(), tags: z.array(z.string()).optional(), status: z.enum(["draft", "active", "archived"]).optional(), product_kind: z.enum(["artifact", "physical", "one_time"]).optional(), delivery_r2_key: z.string().optional(), prices: z.array(productPriceInput).optional() }),
|
|
4680
4809
|
response: () => z.object({ pid: z.string().optional(), workspace: z.string().optional(), error: z.string().optional() }),
|
|
4681
4810
|
effect: "ask", cost: "free", reversible: false, idempotent: true, auth: "member",
|
|
4682
4811
|
}),
|
|
4812
|
+
"products:generate": receiver({
|
|
4813
|
+
receiver: "products:generate",
|
|
4814
|
+
summary: "Draft a product listing from what the seller has so far — description, tags, a collection (an existing one or a new name) and variant titles. Returns a PATCH for the editor and writes nothing; the pressed `focus` field is rewritten and every other field only filled when empty",
|
|
4815
|
+
request: () => z.object({
|
|
4816
|
+
slug: z.string().describe("The workspace whose shop this is — its collections are read and its credits pay for the one model turn"),
|
|
4817
|
+
name: z.string().describe("The product name — required, every other field is optional context"),
|
|
4818
|
+
focus: z.enum(["description", "tags", "collection", "variants", "all"]).optional().describe("Which Generate button was pressed; that field is rewritten, the others are only filled when empty. Default all"),
|
|
4819
|
+
description: z.string().optional().describe("What the seller has written so far; improved, never contradicted"),
|
|
4820
|
+
tags: z.array(z.string()).optional(),
|
|
4821
|
+
collection: z.string().optional(),
|
|
4822
|
+
price: z.number().optional().describe("Major units (dollars). Used to price generated variants"),
|
|
4823
|
+
ships: z.boolean().optional().describe("True for a physical parcel; false for a download, course or service"),
|
|
4824
|
+
variants: z.array(z.object({ title: z.string(), sku: z.string().optional(), price: z.string().optional(), stock: z.string().optional() })).optional(),
|
|
4825
|
+
}),
|
|
4826
|
+
response: () => z.object({
|
|
4827
|
+
patch: z.object({
|
|
4828
|
+
description: z.string().optional(),
|
|
4829
|
+
tags: z.array(z.string()).optional(),
|
|
4830
|
+
collection: z.string().optional(),
|
|
4831
|
+
variants: z.array(z.object({ title: z.string(), sku: z.string(), price: z.string(), stock: z.string() })).optional(),
|
|
4832
|
+
}).optional(),
|
|
4833
|
+
collections: z.array(z.string()).optional().describe("The shop's existing collections, for the editor's drop-down"),
|
|
4834
|
+
error: z.string().optional(),
|
|
4835
|
+
balance: z.number().optional(),
|
|
4836
|
+
needed: z.number().optional(),
|
|
4837
|
+
topupUrl: z.string().optional(),
|
|
4838
|
+
}),
|
|
4839
|
+
effect: "ask", cost: "variable", reversible: true, idempotent: false, auth: "member",
|
|
4840
|
+
}),
|
|
4683
4841
|
"products:list": receiver({
|
|
4684
4842
|
receiver: "products:list",
|
|
4685
4843
|
surfaces: { mcp: true },
|
|
@@ -5152,6 +5310,79 @@ export const RECEIVERS = {
|
|
|
5152
5310
|
effect: "ask", cost: "free", reversible: false, idempotent: false, settles: "none", auth: "manage_things",
|
|
5153
5311
|
examples: [{ oid: "ord_1", session_id: "cs_test_1" }, { oid: "ord_1", workspace: "elitemoversca" }],
|
|
5154
5312
|
}),
|
|
5313
|
+
// ── book:chapter / book:edit-passage — the writing room's chat (handler: resolvers/books.ts) ──
|
|
5314
|
+
// A PERSON edits a book: the viewer channels vouched for (X-One-Actor), a world key's actor, or
|
|
5315
|
+
// staff on a session — never the service key's nominated workspace alone — and only an author of
|
|
5316
|
+
// the book's workspace. Writes go to a DRAFT (the editor's own door, lib/books/chapter-store.ts),
|
|
5317
|
+
// one passage at a time, never the published book and never a whole chapter.
|
|
5318
|
+
"book:chapter": receiver({
|
|
5319
|
+
receiver: "book:chapter",
|
|
5320
|
+
summary: "Read one chapter of a book as its author has it now (the draft if there is one) — markdown, for the writing room's chat",
|
|
5321
|
+
request: () => z.object({
|
|
5322
|
+
book: z.string().min(1).describe("The book's slug, e.g. 100-million-years-ahead."),
|
|
5323
|
+
chapter: z.string().min(1).describe("The chapter: its number (\"3\"), slug, file or title."),
|
|
5324
|
+
slug: z.string().optional().describe("The workspace the call is made in (channels nominates it; it is not who may edit)."),
|
|
5325
|
+
}),
|
|
5326
|
+
response: () => z.object({
|
|
5327
|
+
ok: z.boolean(),
|
|
5328
|
+
book: z.string().optional(),
|
|
5329
|
+
chapter: z.object({ file: z.string(), slug: z.string(), number: z.number().nullable(), title: z.string() }).optional(),
|
|
5330
|
+
draft: z.object({ savedAt: z.string() }).nullable().optional(),
|
|
5331
|
+
words: z.number().optional(),
|
|
5332
|
+
body: z.string().optional().describe("The chapter's markdown (its title block is not part of it). At most 60,000 characters; `truncated` says when it was cut."),
|
|
5333
|
+
truncated: z.boolean().optional(),
|
|
5334
|
+
error: z.string().optional().describe("Named refusal: not_found · forbidden (no person, or not an author) · unavailable (roles or storage could not answer; retry)."),
|
|
5335
|
+
}),
|
|
5336
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, settles: "none", auth: "manage_things",
|
|
5337
|
+
}),
|
|
5338
|
+
"book:edit-passage": receiver({
|
|
5339
|
+
receiver: "book:edit-passage",
|
|
5340
|
+
summary: "Change ONE passage of a book chapter's draft — replace it, or insert a new paragraph after/before the paragraph holding it",
|
|
5341
|
+
request: () => z.object({
|
|
5342
|
+
book: z.string().min(1).describe("The book's slug."),
|
|
5343
|
+
chapter: z.string().min(1).describe("The chapter: its number, slug, file or title."),
|
|
5344
|
+
find: z.string().min(1).max(4000).describe("An exact passage from the chapter as book:chapter returned it — it must occur exactly once. Quotes, dashes and spacing are matched loosely."),
|
|
5345
|
+
text: z.string().describe("The new text (markdown). For replace: what replaces `find` (empty deletes it). For insert_*: the paragraph(s) to add."),
|
|
5346
|
+
mode: z.enum(["replace", "insert_after", "insert_before"]).optional().describe("replace (default) · insert_after / insert_before the paragraph that holds `find`."),
|
|
5347
|
+
slug: z.string().optional().describe("The workspace the call is made in (channels nominates it; it is not who may edit)."),
|
|
5348
|
+
}),
|
|
5349
|
+
response: () => z.object({
|
|
5350
|
+
ok: z.boolean(),
|
|
5351
|
+
book: z.string().optional(),
|
|
5352
|
+
chapter: z.object({ file: z.string(), slug: z.string(), number: z.number().nullable(), title: z.string() }).optional(),
|
|
5353
|
+
mode: z.string().optional(),
|
|
5354
|
+
savedAt: z.string().nullable().optional().describe("The draft's new savedAt; null when the edit made the chapter its published text again (the draft is cleared)."),
|
|
5355
|
+
words: z.number().optional(),
|
|
5356
|
+
removed: z.string().optional(),
|
|
5357
|
+
added: z.string().optional(),
|
|
5358
|
+
url: z.string().optional().describe("The writing room, open on this chapter."),
|
|
5359
|
+
error: z.string().optional().describe("Named refusal: not_found · forbidden · unavailable · bad_request · not_applied (the passage is not in the chapter, or occurs more than once — read it again) · conflict (the author saved meanwhile — read it again) · cannot_typeset (the press could not print the result)."),
|
|
5360
|
+
}),
|
|
5361
|
+
effect: "ask", cost: "free", reversible: true, idempotent: false, settles: "none", auth: "manage_things",
|
|
5362
|
+
}),
|
|
5363
|
+
// ── book:claim — "Save to my library" (handler: resolvers/book-claim.ts) ──
|
|
5364
|
+
// The sibling of order:claim for a BOOK: same bearer proof (the Stripe
|
|
5365
|
+
// Checkout session_id the success page holds), but the result is a durable
|
|
5366
|
+
// entitlement `book:<slug>` in the CALLER's own workspace, so it is tenant-
|
|
5367
|
+
// class: the library it writes is ctx.ownerSlug's, never a body field. Card
|
|
5368
|
+
// rail only — a crypto order's session_id is a public tx hash, and a durable
|
|
5369
|
+
// grant keyed on a public value could be front-run. One session is spent once.
|
|
5370
|
+
"book:claim": receiver({
|
|
5371
|
+
receiver: "book:claim",
|
|
5372
|
+
summary: "Save a paid book to the signed-in caller's library — proves the purchase with the Stripe Checkout session_id and grants book:<slug>",
|
|
5373
|
+
request: () => z.object({
|
|
5374
|
+
session_id: z.string().min(1).describe("The Stripe Checkout session id from the success page URL (?session_id=cs_…) — the same receipt order:claim accepts. Card rail only; a crypto tx hash is refused as rail_not_claimable."),
|
|
5375
|
+
}),
|
|
5376
|
+
response: () => z.object({
|
|
5377
|
+
ok: z.boolean(),
|
|
5378
|
+
books: z.array(z.string()).optional().describe("Book slugs now in the caller's library (feature book:<slug>)."),
|
|
5379
|
+
already: z.boolean().optional().describe("True when the caller already held every book in this order; the session is spent either way."),
|
|
5380
|
+
error: z.string().optional().describe("Named refusal: session_id_required · forbidden · agent_not_claimable (an agent world key; a library is a signed-in reader's) · not_found (no order sold by one under this session — the webhook may not have landed yet; retry) · not_a_book (no line on the order is a book) · not_paid · refunded · test_mode · rail_not_claimable · already_claimed (another library already holds this session) · unavailable (D1 failed; retry) · no_db."),
|
|
5381
|
+
httpStatus: z.literal(503).optional().describe("Present only with unavailable / no_db: the door answers HTTP 503 so the refusal is retried, never cached as a 200 idempotent result."),
|
|
5382
|
+
}),
|
|
5383
|
+
effect: "ask", cost: "free", reversible: false, idempotent: true, settles: "none", auth: "manage_things",
|
|
5384
|
+
examples: [{ session_id: "cs_live_a1b2c3" }],
|
|
5385
|
+
}),
|
|
5155
5386
|
// ── wallet:create — register RECEIVING ADDRESSES only (handler: resolvers/wallet.ts) ──
|
|
5156
5387
|
// Custody invariant: `addresses` carries public addresses and nothing else. No
|
|
5157
5388
|
// field here accepts a private key or a mnemonic, and none is emitted back.
|
|
@@ -5175,7 +5406,10 @@ export const RECEIVERS = {
|
|
|
5175
5406
|
}).optional(),
|
|
5176
5407
|
// An AGENT's addresses are written only with proof of control: the token
|
|
5177
5408
|
// wallet:challenge issued, and one signature per address over
|
|
5178
|
-
// addressProofMessage (@oneie/sdk/address-proof). Public bytes only.
|
|
5409
|
+
// addressProofMessage (@oneie/sdk/address-proof). Public bytes only. A HUMAN
|
|
5410
|
+
// row may carry the same proof (C11): a verified one is recorded in
|
|
5411
|
+
// wallet_address_proofs, which is what lets wallet:send prove who paid and
|
|
5412
|
+
// who was paid; without it the row is the body's word and proves nothing.
|
|
5179
5413
|
challenge: z.string().optional(),
|
|
5180
5414
|
proofs: z.object({
|
|
5181
5415
|
sui: z.object({ publicKey: z.string().optional(), signature: z.string() }).optional(),
|
|
@@ -5197,12 +5431,88 @@ export const RECEIVERS = {
|
|
|
5197
5431
|
btc: z.string().nullable().optional(),
|
|
5198
5432
|
asi: z.string().nullable().optional(),
|
|
5199
5433
|
}).optional(),
|
|
5434
|
+
proven: z.array(z.string()).optional().describe("Human row only: the chains whose address arrived with a verified proof and were recorded in wallet_address_proofs. Absent when no proof was offered"),
|
|
5200
5435
|
error: z.string().optional(),
|
|
5201
5436
|
field: z.string().optional(),
|
|
5202
5437
|
}),
|
|
5203
5438
|
effect: "ask", cost: "free", reversible: false, idempotent: true, settles: "none", auth: "member",
|
|
5204
5439
|
examples: [{ workspace: "acme", kind: "human", addresses: { sui: "0xabc", evm: "0xdef" } }],
|
|
5205
5440
|
}),
|
|
5441
|
+
"wallet:lock-publish": receiver({
|
|
5442
|
+
receiver: "wallet:lock-publish",
|
|
5443
|
+
summary: "Publish the caller's message lock (age1…) under their own name, proven by a Sui signature. The holder signs the exact text \"ONE message lock v1\\n<slug>\\n<lock>\" with the Sui key their account registered; the server rebuilds that text, checks the signature and that the signer IS the registered Sui address, then stores lock + signer + signature. The name is the attested session's, never the body's. An AGENT publishes its own lock with `agent` set to its id (the Bearer key's attested actor — a person, even the owner, is refused `not_the_agent`): the text is \"ONE message lock v1\\n<workspace>/<agent>\\n<lock>\" and the signer must be the Sui address on the agent's own wallet row. Refusals: unauthorized · forbidden · bad_slug · bad_lock · bad_agent · not_the_agent · no_sui_address · bad_signature · wrong_signer",
|
|
5444
|
+
request: () => z.object({
|
|
5445
|
+
lock: z.string().describe("The lock: age1 followed by 58 bech32 characters, as shown on /keys"),
|
|
5446
|
+
signature: z.string().describe("Sui personal-message signature (base64) over lockMessage(slug, lock), or agentLockMessage(workspace, agent, lock) for an agent — see lib/key/lock-lookup.ts"),
|
|
5447
|
+
agent: z.string().optional().describe("Agent form only: the agent's own id. Must equal the attested caller (ctx.actorId); never chooses whose lock is written"),
|
|
5448
|
+
workspace: z.string().optional().describe("Agent form: the workspace of the agent's wallet row (defaults to the agent's id; selects a row, grants nothing). Workspace form (no `agent`, C16): the workspace whose TREASURY lock and card to publish, as the (ws, ws) row — refused `forbidden` unless the caller controls it, and `wrong_signer` unless the workspace key's registered Sui account signed"),
|
|
5449
|
+
card: z.string().optional().describe("The pay card (text/wallets.md § 3), as text: \"ONE pay card v1\" + name · lock · id · ecdh · scan · spend — PUBLIC keys only. Stored beside the lock (0332 + 0333); refused `bad_card` unless it verifies for this name and this lock under the identity key it names AND is bound by the registered Sui key (`cardBind`). All three card fields or none. Sent without any card field, a publish KEEPS the card already stored for an unchanged lock"),
|
|
5450
|
+
cardSignature: z.string().optional().describe("The identity child's Sui personal-message signature (base64) over the exact card text — never the funded wallet key (D8)"),
|
|
5451
|
+
cardBind: z.string().optional().describe("The REGISTERED Sui key's personal-message signature (base64) over the exact card text — the same key that signed the lock. This is what binds the card to the page: without it any writer of the row could replay the public lock signature beside a card of their own"),
|
|
5452
|
+
}),
|
|
5453
|
+
response: () => z.object({
|
|
5454
|
+
ok: z.boolean(),
|
|
5455
|
+
lock: z.string().optional(),
|
|
5456
|
+
suiAddress: z.string().optional(),
|
|
5457
|
+
publishedAt: z.string().optional(),
|
|
5458
|
+
error: z.string().optional(),
|
|
5459
|
+
}),
|
|
5460
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, settles: "none", auth: "member",
|
|
5461
|
+
examples: [{ lock: "age1…", signature: "AB…" }],
|
|
5462
|
+
}),
|
|
5463
|
+
"wallet:lock-get": receiver({
|
|
5464
|
+
receiver: "wallet:lock-get",
|
|
5465
|
+
summary: "Public read: the lock a name has published, with everything needed to re-verify it offline (lock, Sui signer, signature, the exact signed text, publishedAt). `published:false` when none, or when the signer is no longer the account's registered Sui address (after wallet:rotate). Also served as GET /api/lock/<slug>, and /api/lock/<slug>/<agent-id> for an agent's own lock",
|
|
5466
|
+
request: () => z.object({
|
|
5467
|
+
slug: z.string().describe("The name (workspace slug) whose lock to look up"),
|
|
5468
|
+
agent: z.string().optional().describe("An agent id in that workspace: answers the agent's own lock, never the workspace's person lock"),
|
|
5469
|
+
// F8 — the pay card is practice money (testnet): served only to a request that names the practice network
|
|
5470
|
+
// (GET /api/lock/<slug>?net=testnet) or an agent caller; otherwise `withheld: 'practice_net_only'`. Narrows only.
|
|
5471
|
+
net: z.string().optional().describe("Practice network ask ('testnet'): without it the pay card is withheld"),
|
|
5472
|
+
}),
|
|
5473
|
+
response: () => z.object({
|
|
5474
|
+
ok: z.boolean(),
|
|
5475
|
+
published: z.boolean().optional(),
|
|
5476
|
+
lock: z.string().optional(),
|
|
5477
|
+
suiAddress: z.string().optional(),
|
|
5478
|
+
signature: z.string().optional(),
|
|
5479
|
+
message: z.string().optional(),
|
|
5480
|
+
publishedAt: z.string().optional(),
|
|
5481
|
+
card: z.string().optional().describe("The pay card text, when the page published one bound (all three card fields are present together or absent together)"),
|
|
5482
|
+
cardSignature: z.string().optional().describe("The identity child's signature over the card text"),
|
|
5483
|
+
cardBind: z.string().optional().describe("The registered Sui key's signature over the card text — a reader checks it against the lock's verified signer"),
|
|
5484
|
+
withheld: z.string().optional().describe("Why the card is not here: 'practice_net_only' (no practice ask, F8) or 'agent_has_vault' (paid into its vault, C18d)"),
|
|
5485
|
+
error: z.string().optional(),
|
|
5486
|
+
}),
|
|
5487
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, settles: "none", auth: "public",
|
|
5488
|
+
examples: [{ slug: "tony" }],
|
|
5489
|
+
}),
|
|
5490
|
+
"wallet:rotate": receiver({
|
|
5491
|
+
receiver: "wallet:rotate",
|
|
5492
|
+
summary: "Give up a HUMAN wallet row's registered addresses so a NEW key can register its own — the old set is written to the event log first, then every address column is cleared. Refuses an agent row (its addresses are proven, never typed) and a caller the authority walk does not place over the workspace",
|
|
5493
|
+
request: () => z.object({
|
|
5494
|
+
workspace: z.string().optional().describe("The workspace whose row rotates. Defaults to the attested caller"),
|
|
5495
|
+
actor: z.string().optional().describe("The row's actor. Defaults to the workspace — the human's own row"),
|
|
5496
|
+
reason: z.string().max(200).optional().describe("Why — kept in the audit event beside the cleared addresses"),
|
|
5497
|
+
}),
|
|
5498
|
+
response: () => z.object({
|
|
5499
|
+
ok: z.boolean().optional(),
|
|
5500
|
+
workspace: z.string().optional(),
|
|
5501
|
+
actor: z.string().optional(),
|
|
5502
|
+
cleared: z.object({
|
|
5503
|
+
sui: z.string().nullable().optional(),
|
|
5504
|
+
evm: z.string().nullable().optional(),
|
|
5505
|
+
solana: z.string().nullable().optional(),
|
|
5506
|
+
btc: z.string().nullable().optional(),
|
|
5507
|
+
asi: z.string().nullable().optional(),
|
|
5508
|
+
}).optional().describe("The addresses the rotate cleared, read inside the clearing batch — every one is also kept in wallet_rotated_addresses"),
|
|
5509
|
+
closed: z.enum(["mark", "warn"]).optional(),
|
|
5510
|
+
error: z.string().optional().describe("unauthorized · approval_required (a bare API key — needs a human session or a verified service caller) · forbidden · no_row · agent_row · no_db · history_unwritten (the cleared addresses could not be recorded in wallet_rotated_addresses, so nothing was cleared)"),
|
|
5511
|
+
detail: z.string().optional(),
|
|
5512
|
+
}),
|
|
5513
|
+
effect: "ask", cost: "free", reversible: false, idempotent: false, settles: "none", auth: "owner",
|
|
5514
|
+
examples: [{ workspace: "acme", reason: "new key" }],
|
|
5515
|
+
}),
|
|
5206
5516
|
"wallet:challenge": receiver({
|
|
5207
5517
|
receiver: "wallet:challenge",
|
|
5208
5518
|
summary: "Issue a fresh, single-use challenge an agent signs to prove it holds the keys behind the addresses it registers with wallet:create",
|
|
@@ -5288,6 +5598,10 @@ export const RECEIVERS = {
|
|
|
5288
5598
|
request: () => z.object({
|
|
5289
5599
|
workspace: z.string().optional().describe("Defaults to the attested caller's workspace"),
|
|
5290
5600
|
actor: z.string().optional().describe("Actor whose spend ceiling is read; defaults to the workspace"),
|
|
5601
|
+
// C13 repair 2 — the network the VAULT PROJECTION is read on (the /w `?net=` door);
|
|
5602
|
+
// defaults to the deploy's NETWORK. It moves the D1 read only: chain balances stay
|
|
5603
|
+
// on the deploy's endpoints. Each row's `vault.net` says which network it answered.
|
|
5604
|
+
net: z.enum(["mainnet", "testnet"]).optional().describe("Network whose vault projection the wallet rows read; defaults to the deploy's"),
|
|
5291
5605
|
}),
|
|
5292
5606
|
response: () => z.object({
|
|
5293
5607
|
workspace: z.string().optional(),
|
|
@@ -5409,6 +5723,16 @@ export const RECEIVERS = {
|
|
|
5409
5723
|
verdict: z.string().optional().describe("On a stage 'authority' refusal: mismatch | unknown. 'unknown' FAILS CLOSED — an unresolvable read is never 'no objection'"),
|
|
5410
5724
|
detail: z.string().optional().describe("On a stage 'authority' refusal: what was refused, and plainly that this refuses to RECORD the transfer — it cannot prevent or reverse an on-chain transfer the caller already signed and broadcast client-side"),
|
|
5411
5725
|
cause: z.string().optional().describe("On a stage 'authority' refusal, which read decided it: no_attested_caller | no_snapshot_binding | wallet_read_failed | human_unresolvable (the agent has no claimed human with a Sui address) | ceiling_unresolvable | owners_disagree | ceiling_revoked. A public identifier, never a value"),
|
|
5726
|
+
// C11 — a recorded payment marks payer -> payee. Both keys ride the success path.
|
|
5727
|
+
verifiedUsd: z.number().optional().describe("The dollar value pay.one.ie verified on chain at claim — the only figure the reputation mark weighs. Absent when pay returned none"),
|
|
5728
|
+
reputation: z.object({
|
|
5729
|
+
marked: z.boolean().describe("true = payer -> payee was marked by the weighted mark of verifiedUsd"),
|
|
5730
|
+
payer: z.string().optional(),
|
|
5731
|
+
payee: z.string().optional().describe("The actor whose wallets row owns the paid address — never the body's say-so"),
|
|
5732
|
+
strength: z.number().optional().describe("The weighted mark applied"),
|
|
5733
|
+
settledTo: z.string().nullable().optional().describe("The workspace this payment settled to, recorded on the payer -> payee row at payment time — the payee's proven row's workspace, and the one fact meta:reputation discloses the row by. null when nothing was recorded: the address is proven under two workspaces, the workspace has no owners row yet, or the row already carried a different workspace (then it carries none, for good)"),
|
|
5734
|
+
reason: z.string().optional().describe("Why nobody was marked: payer_unproven | no_payee_actor | payee_mismatch | payee_ambiguous | own_wallet (the spend walk admits a holder of authority over the payer over the payee, or the payee over the payer — a wash trade buys no reputation) | authority_unreadable (the authority walk could not be read; nobody was marked) | amount_unverified | below_mark_floor | tx_already_marked | mark_unrecorded (the mark ledger write failed; the transfer still settled)"),
|
|
5735
|
+
}).optional().describe("Whether this payment raised the payee's score, and if not, why"),
|
|
5412
5736
|
error: z.string().optional(),
|
|
5413
5737
|
}),
|
|
5414
5738
|
effect: "ask", cost: "variable", reversible: false, idempotent: false, settles: "onchain", auth: "manage_workspace",
|
|
@@ -5523,37 +5847,138 @@ export const RECEIVERS = {
|
|
|
5523
5847
|
summary: "The agent's current owner offers it to another person — a signed 'ONE agent handover' statement by the owner's proven address",
|
|
5524
5848
|
request: () => z.object({
|
|
5525
5849
|
agent: z.string().describe("The agent's actor id (actor_owners.agent_id)"),
|
|
5526
|
-
to: z.string().describe("The person's slug the agent is offered to — never an agent"),
|
|
5850
|
+
to: z.string().optional().describe("The person's slug the agent is offered to — never an agent. Omitted (or 'invite') by an agent that owns itself: the offer mints the handover link and answers to: invite:<id>"),
|
|
5527
5851
|
chain: z.enum(["sui", "evm", "solana", "btc"]).optional().describe("Which proven address signs; default sui"),
|
|
5528
|
-
nonce: z.unknown().describe("16–128 of [A-Za-z0-9_-]; single use"),
|
|
5529
|
-
expiresAt: z.unknown().describe("unix ms, at most 15 minutes out"),
|
|
5530
|
-
signature: z.unknown().describe("{ publicKey, signature } (hex) by the owner's proven address over the handover statement"),
|
|
5852
|
+
nonce: z.unknown().optional().describe("16–128 of [A-Za-z0-9_-]; single use. Required person-to-person; minted when an agent sends the link"),
|
|
5853
|
+
expiresAt: z.unknown().optional().describe("unix ms, at most 15 minutes out. Required person-to-person"),
|
|
5854
|
+
signature: z.unknown().optional().describe("{ publicKey, signature } (hex) by the owner's proven address over the handover statement. Required person-to-person"),
|
|
5855
|
+
vault: z.string().optional().describe("The handover link (agent that owns itself): the vault object id (0x…) the redeemer will own"),
|
|
5856
|
+
workspace: z.string().optional().describe("The handover link: the workspace whose owner seat the link carries; default the agent's own. The agent must already hold that seat"),
|
|
5531
5857
|
}),
|
|
5532
5858
|
response: () => z.object({
|
|
5533
5859
|
ok: z.boolean(), offered: z.boolean().optional(), agent: z.string().optional(), from: z.string().optional(), to: z.string().optional(),
|
|
5534
5860
|
nonce: z.string().optional(), expiresAt: z.number().optional(),
|
|
5861
|
+
vault: z.string().optional(), link: z.string().optional().describe("The handover link's short path (/i/<code>) — never the token behind it"),
|
|
5535
5862
|
closed: z.enum(["mark", "warn", "dissolve"]).optional(),
|
|
5536
|
-
error: z.string().optional().describe("agent_and_to_required | unsupported_chain | unclaimed | agent_owns_itself | not_owner | human_presence_required | handover_to_self | handover_to_agent | target_is_agent | offer_invalid | offer_expired | offer_expiry_too_far | owner_address_unproven | offer_signature_invalid | offer_replayed"),
|
|
5863
|
+
error: z.string().optional().describe("agent_and_to_required | unsupported_chain | unclaimed | agent_owns_itself | not_owner | human_presence_required | handover_to_self | handover_to_agent | target_is_agent | offer_invalid | offer_expired | offer_expiry_too_far | owner_address_unproven | offer_signature_invalid | offer_replayed | vault_required | vault_not_held | vault_unreadable | offer_open | no_invite_secret | cannot_invite_higher_role"),
|
|
5537
5864
|
}),
|
|
5538
5865
|
effect: "ask", cost: "free", reversible: true, idempotent: false, settles: "none", auth: "owner",
|
|
5539
5866
|
examples: [{ agent: "scout", to: "dana", chain: "sui", nonce: "<nonce>", expiresAt: 1790000000000, signature: { publicKey: "<hex>", signature: "<hex>" } }],
|
|
5540
5867
|
}),
|
|
5541
5868
|
"agent:handover-accept": receiver({
|
|
5542
5869
|
receiver: "agent:handover-accept",
|
|
5543
|
-
summary: "The person an agent was offered to accepts it, in their own session or human key — a compare-and-set on the agent's ownership",
|
|
5870
|
+
summary: "The person an agent was offered to accepts it, in their own session or human key — a compare-and-set on the agent's ownership; the Own press re-proves the link (owner · seat · vault) and lands seat → owner → chain, reverting on any refusal",
|
|
5544
5871
|
request: () => z.object({
|
|
5545
|
-
agent: z.string().describe("The agent's actor id"),
|
|
5872
|
+
agent: z.string().optional().describe("The agent's actor id. Required person-to-person; the Own press (/get-key?own=<offer>) knows only the offer, which names its agent"),
|
|
5546
5873
|
nonce: z.unknown().describe("The offer's nonce"),
|
|
5874
|
+
address: z.string().optional().describe("The Own press: the Sui address of the key the redeemer kept"),
|
|
5875
|
+
signature: z.unknown().optional().describe("The Own press: { publicKey, signature } (hex) by that key over the 'ONE vault handover' statement"),
|
|
5547
5876
|
}),
|
|
5548
5877
|
response: () => z.object({
|
|
5549
5878
|
ok: z.boolean(), accepted: z.boolean().optional(), agent: z.string().optional(), owner: z.string().optional(),
|
|
5550
5879
|
previousOwner: z.string().optional(), next: z.string().optional(),
|
|
5880
|
+
vault: z.string().optional(), address: z.string().optional(),
|
|
5881
|
+
chain: z.unknown().optional().describe("The vault facade's answer to transferOwner: { digest } or { error } — never a claimed digest. { owner, confirmedBy: 'read' } when the transfer's answer was lost — or when the AGENT signed it in its own runtime — and the vault read back names the new owner. { error: 'agent_signs', vault, to, net } on a published vault: the server holds no key, the agent signs transfer_owner(vault, to) itself (round 7 repair 1)"),
|
|
5882
|
+
workspace: z.object({
|
|
5883
|
+
gid: z.string(), role: z.string(),
|
|
5884
|
+
landed: z.literal(true).describe("Always true on an ok answer: the Own press lands seat → owner → chain or reverts every write — an ok answer cannot carry a seat that did not land"),
|
|
5885
|
+
verdict: z.string(),
|
|
5886
|
+
}).optional().describe("The workspace owner seat the link carried, granted on the Own press before the owner and the chain moved"),
|
|
5887
|
+
undo: z.unknown().optional().describe("On a refusal only: a revert that itself did not land, named — { owner?: 'failed', seat?: <verdict>, offer?: 'failed', seatPending?: string[], residual: ('owner_revert_failed' | 'seat_revoke_failed' | 'seat_unproven' | 'seat_pending' | 'offer_unreserve_failed' | 'saga_unrecorded')[] }. Absent, nothing moved: every half was read back absent and every recorded seat attempt has settled. offer_unreserve_failed: the offer stayed spent, so the same redeemer cannot press again — the agent mints a new link (nothing else moved only when it is the sole residual). seat_revoke_failed: the seat is recorded on the offer row and the next press takes it back. seat_unproven: a seat write was not answered and the read-back ran too soon to prove it absent (a write the gateway aborts may still commit and take ~0.5s to become readable) — the attempt is APPENDED to the offer row's attempts with the time the write was sent and the time it answered or aborted, never overwritten by a later press; every later refusal reads every attempt back by its own times and drops it only once settled absent or taken back, and a press that lands clears them all. seat_pending: a recorded seat is on a gid (named in seatPending) where ANOTHER press of this agent is reserved and not yet landed — that press may hold the seat or still be refused, so the record is kept, never dropped and never reverted, and a later press settles it by the read-back once that press lands (explained, dropped), lapses or is refused (read back and reverted). saga_unrecorded: the row could not be written, so the next press cannot see the residual; a press held at the chain this way is found by the next press from the owner record and resumed. The agent has been warned"),
|
|
5888
|
+
pending: z.boolean().optional().describe("chain_pending: the chain was asked and could not be read back — seat and owner stay, the offer stays reserved, the row records the target; the redeemer's next press resolves it (finishes, retries, or reverts). agent_signs: the vault is published and the server never signs — the agent signs transfer_owner to the recorded address in its own runtime; seat and owner are NOT held moved while it waits, the offer stays reserved for the redeemer, and the next press lands both halves once the chain names the kept key (round 7 repair 1)"),
|
|
5889
|
+
cause: z.string().optional().describe("On reserve_failed | link_unreadable | seat_failed | owner_failed | vault_unreachable | chain_pending: the message of the call that threw, so the press names what it could not do"),
|
|
5551
5890
|
closed: z.enum(["mark", "warn", "dissolve"]).optional(),
|
|
5552
|
-
error: z.string().optional().describe("offer_invalid | human_presence_required | offer_not_found | not_offered_to_you | offer_already_accepted | offer_expired | offer_stale"),
|
|
5891
|
+
error: z.string().optional().describe("offer_invalid | human_presence_required | offer_not_found | not_offered_to_you | offer_already_accepted | offer_expired | offer_stale | invite_not_redeemed | redeemer_unresolved | owner_proof_invalid | reserve_failed | seat_lost | seat_unreadable | seat_failed | vault_not_held | vault_unreadable | vault_refused | agent_signs | link_unreadable | owner_failed | vault_unreachable | chain_pending — every refusal after the reservation reverted what had landed and gave the offer back (an unanswered write is read back first, never counted 'did not land'; one that answered ok with zero rows did not land); undo names a revert that did not; chain_pending is the one named pending state, resolved by the next press; redeemer_unresolved: the link was opened by an account that has no slug yet"),
|
|
5553
5892
|
}),
|
|
5554
5893
|
effect: "ask", cost: "free", reversible: false, idempotent: false, settles: "none", auth: "owner",
|
|
5555
5894
|
examples: [{ agent: "scout", nonce: "<nonce>" }],
|
|
5556
5895
|
}),
|
|
5896
|
+
// identity-seal deliverable 6. The owner is the ATTESTED caller (session, or the owner's own
|
|
5897
|
+
// human key) — never a body field; zod strips any owner the body names. The delete is a
|
|
5898
|
+
// compare-and-set on the owner read, so a row that changed hands is never removed.
|
|
5899
|
+
"agent:release": receiver({
|
|
5900
|
+
receiver: "agent:release",
|
|
5901
|
+
summary: "The agent's owner gives it up — ends the actor_owners claim, the owner's owner/admin seats on the agent's group and their world_actors rung (not world keys, and not the agent's home workspace, which keeps operational authority) (compare-and-set on the owner) and writes a custom:agent-released event; refused (vault_owned) while ANY vault is bound to, created by or filed for the agent, its own included, because D1 cannot prove which recorded addresses are really the agent's; a fresh claim is then possible",
|
|
5902
|
+
request: () => z.object({
|
|
5903
|
+
agent: z.string().describe("The agent's actor id (actor_owners.agent_id). The owner is read from the signed-in caller, never from the body"),
|
|
5904
|
+
}),
|
|
5905
|
+
response: () => z.object({
|
|
5906
|
+
ok: z.boolean(), released: z.boolean().optional(), agent: z.string().optional(),
|
|
5907
|
+
previousOwner: z.string().optional().describe("Who owned the agent until this call — the caller"),
|
|
5908
|
+
seatsRemoved: z.number().optional().describe("Owner/admin seats the caller held on the agent's own group (TypeDB) that were removed"),
|
|
5909
|
+
rungDemoted: z.boolean().optional().describe("The caller's owner/admin rung on the agent's own group in world_actors was demoted to member (the person's row is never deleted)"),
|
|
5910
|
+
homeWorkspaceKept: z.boolean().optional().describe("true when the agent is homed in a workspace: release does NOT re-home it and does NOT revoke its world keys, so that workspace still holds operational authority over it (key minting is decided by the home)"),
|
|
5911
|
+
homeGroup: z.string().optional().describe("The agent's home group id when homeWorkspaceKept is true"),
|
|
5912
|
+
noKnownAddress: z.boolean().optional().describe("true when no address is recorded for the agent anywhere: no vault could be matched by address, so only the agent-id checks (handover offers, training vaults) ran"),
|
|
5913
|
+
homeUnread: z.boolean().optional().describe("true when the agent's home record could not be read, so homeWorkspaceKept is unknown"),
|
|
5914
|
+
eventLanded: z.boolean().optional().describe("false when the custom:agent-released event could not be written — the release still stands"),
|
|
5915
|
+
next: z.string().optional().describe("On a refusal: what to do instead (vault_owned, vault_unverified, release_half_done)"),
|
|
5916
|
+
left: z.string().optional().describe("release_half_done only: the state left behind (seat_removed_owner_kept — the owner row stands but the seats named in `seats` were removed and could not be restored)"),
|
|
5917
|
+
refusedFor: z.string().optional().describe("release_half_done only: the refusal the release was undoing when the restore failed"),
|
|
5918
|
+
seats: z.array(z.string()).optional().describe("release_half_done only: the group ids whose seat could not be restored"),
|
|
5919
|
+
closed: z.enum(["mark", "warn", "dissolve"]).optional(),
|
|
5920
|
+
error: z.string().optional().describe("agent_required | no_db | human_presence_required | owner_unreadable | not_owner | unclaimed | agent_owns_itself | vault_owned | vault_unverified | seat_unreadable | seat_revoke_failed | release_failed | release_half_done | owner_changed — vault_owned: a vault is bound to, created by or filed for the agent (whoever owns it, the agent included — D1 cannot prove which addresses are really the agent's), the server cannot move a vault owner back, hand the agent over instead; vault_unverified: the vault records could not be read; seat_unreadable: the agent's group or the caller's seat could not be read; release_failed: the D1 write failed and the seats were put back; release_half_done: a seat was removed and could not be restored; owner_changed: the row changed hands between the read and the delete, and nothing was removed"),
|
|
5921
|
+
}),
|
|
5922
|
+
effect: "ask", cost: "free", reversible: false, idempotent: false, settles: "none", auth: "owner",
|
|
5923
|
+
examples: [{ agent: "scout" }],
|
|
5924
|
+
}),
|
|
5925
|
+
// C22 — the testnet training ground. One call per step a roster agent takes. The agent is the
|
|
5926
|
+
// ATTESTED caller (its own API key), never a body field; the body names no agent, network or
|
|
5927
|
+
// package, and zod strips any that are sent. The STEP decides who observes it: a chain step needs
|
|
5928
|
+
// a digest the server re-reads on Sui testnet, and it counts only as the agent's proven address
|
|
5929
|
+
// calling its filed vault for the pinned amount and payee; a harness step is the harness's word and
|
|
5930
|
+
// is never weighed. The expectation comes from lib/training/scenarios.ts, never the body, and the
|
|
5931
|
+
// verdict is computed here, closed on `training:<agent>` → `training:referee:<workspace>`, a path
|
|
5932
|
+
// no reputation reader counts.
|
|
5933
|
+
"training:record": receiver({
|
|
5934
|
+
receiver: "training:record",
|
|
5935
|
+
summary: "Record one step of a testnet training run: the step decides whether the chain (by digest) or the harness observes, the server decides the verdict and closes it on the namespaced training path",
|
|
5936
|
+
request: () => z.object({
|
|
5937
|
+
run: z.string().min(1).max(64).describe("The run id the harness minted for this run"),
|
|
5938
|
+
scenario: z.string().max(32).describe("One of the seven pinned scenario ids (lib/training/scenarios.ts)"),
|
|
5939
|
+
step: z.string().max(32).describe("A pinned step id of that scenario, or turn-1…turn-8 for a free turn in agent mode"),
|
|
5940
|
+
rule: z.string().max(32).describe("The scenario's rule, a bare word; must match the pin"),
|
|
5941
|
+
mode: z.enum(["scripted", "agent"]).describe("scripted (drill, fixed actions) or agent (a model chose the tool)"),
|
|
5942
|
+
tool: z.string().max(32).describe("The tool the agent chose (the closed list) or the harness move the step names"),
|
|
5943
|
+
payee: z.string().max(64).optional().describe("Who the money went to (a roster name or 'ground'), for the side-door read; anything else is bad_step"),
|
|
5944
|
+
expected: z.string().max(96).describe("What the rule predicts — must equal the pinned expectation, or the step is bad_step"),
|
|
5945
|
+
digest: z.string().max(44).optional().describe("A chain step's testnet transaction digest — REQUIRED on a chain step, re-read on Sui testnet"),
|
|
5946
|
+
refusal: z.string().max(96).optional().describe("A harness step's word (a ONE door's answer or a read); on a chain step it is digest_required"),
|
|
5947
|
+
}),
|
|
5948
|
+
response: () => z.object({
|
|
5949
|
+
ok: z.boolean(),
|
|
5950
|
+
verdict: z.enum(["kept", "rule_silent", "wrong_refusal", "side_door", "deploy_fenced", "needs_person"]).optional(),
|
|
5951
|
+
observed: z.string().optional(),
|
|
5952
|
+
observed_by: z.enum(["chain", "harness"]).optional(),
|
|
5953
|
+
closed: z.enum(["mark", "warn", "dissolve"]).optional(),
|
|
5954
|
+
error: z.enum(["digest_not_on_testnet", "digest_required", "tx_not_this_step", "not_a_roster_agent", "bad_step"]).optional(),
|
|
5955
|
+
}),
|
|
5956
|
+
effect: "ask", auth: "agent_key", cost: "free", reversible: false, idempotent: false, settles: "none",
|
|
5957
|
+
examples: [{ run: "run-01", scenario: "ceiling", step: "over-tx", rule: "ceiling", mode: "scripted", tool: "vault_spend", payee: "referee", expected: "E_CEILING", digest: "<testnet digest>" }],
|
|
5958
|
+
}),
|
|
5959
|
+
// C22 (c22 review B3) — the vault object a roster agent's chain steps must spend from. Filed ONLY by
|
|
5960
|
+
// the training workspace's own identity (the attested caller is the workspace, never an agent), and
|
|
5961
|
+
// only for an object the testnet node reads as a Vault of the pinned package. A run's own vault
|
|
5962
|
+
// (run + scenario) wins over the agent's standing one. training:record counts no spend from any other
|
|
5963
|
+
// object — the agent's own look-alike vault of the same package included.
|
|
5964
|
+
"training:vault": receiver({
|
|
5965
|
+
receiver: "training:vault",
|
|
5966
|
+
summary: "File the vault object a training agent's chain steps must spend from — the workspace owner only, a pinned-package Vault only",
|
|
5967
|
+
request: () => z.object({
|
|
5968
|
+
agent: z.string().min(1).max(128).describe("The roster agent's aid"),
|
|
5969
|
+
vault: z.string().min(3).max(66).describe("The vault object id on Sui testnet"),
|
|
5970
|
+
run: z.string().max(64).optional().describe("The run a fresh vault was born for (with scenario); absent for the standing vault"),
|
|
5971
|
+
scenario: z.string().max(32).optional().describe("The scenario a fresh vault was born for (with run)"),
|
|
5972
|
+
transferTo: z.string().max(66).optional().describe("handover: the address transfer_owner must name"),
|
|
5973
|
+
}),
|
|
5974
|
+
response: () => z.object({
|
|
5975
|
+
ok: z.boolean(),
|
|
5976
|
+
closed: z.enum(["dissolve"]).optional(),
|
|
5977
|
+
error: z.enum(["not_the_owner", "not_a_roster_agent", "not_a_vault", "bad_vault"]).optional(),
|
|
5978
|
+
}),
|
|
5979
|
+
effect: "ask", auth: "owner", cost: "free", reversible: true, idempotent: true, settles: "none",
|
|
5980
|
+
examples: [{ agent: "<aid>", vault: "<testnet vault id>" }],
|
|
5981
|
+
}),
|
|
5557
5982
|
// A pending, attributed `settlements` row is written before a cent moves —
|
|
5558
5983
|
// INSERT OR IGNORE keyed on the pay link id, so a retry with the same link is a
|
|
5559
5984
|
// no-op. An unpayable actor is a clean refusal: no link minted, no row written.
|
|
@@ -5563,28 +5988,87 @@ export const RECEIVERS = {
|
|
|
5563
5988
|
summary: "Hand a payable actor a working payment link, with the money attributed to it before a cent moves",
|
|
5564
5989
|
request: () => z.object({
|
|
5565
5990
|
actor: z.string().describe("The actor being paid — attributed here even when custody is via-treasury"),
|
|
5566
|
-
amountCents: z.number().describe("Must be > 0"),
|
|
5991
|
+
amountCents: z.number().optional().describe("Must be > 0 — except with railOnly, which takes none (rail_only_takes_no_amount)"),
|
|
5992
|
+
// C16 — ask WHICH RAIL a payer would be given, and tell ONE no sum. A treasury whose private branch
|
|
5993
|
+
// applies answers { custody: 'private', workspace, asset, chain, gasSui, payTo } with no amountCents;
|
|
5994
|
+
// anything else answers { rail: 'fixed', why? } and mints nothing. The amount rides a second call.
|
|
5995
|
+
railOnly: z.boolean().optional().describe("Ask the rail only: send no amountCents; nothing is minted or written"),
|
|
5567
5996
|
workspace: z.string().optional().describe("Defaults to the attested caller's workspace"),
|
|
5568
5997
|
currency: z.string().optional().describe("Defaults to usd"),
|
|
5998
|
+
// F8 — the PRACTICE-NETWORK ask. The fresh-address rail and a stranger's vault deposit instruction
|
|
5999
|
+
// exist on testnet only, so they answer ONLY a request that names the practice network ('testnet')
|
|
6000
|
+
// — or an agent caller. An open string, never an enum: any other word is simply no ask and
|
|
6001
|
+
// the ordinary rail answers. It only ever NARROWS: the worker ANDs it with the network it runs on.
|
|
6002
|
+
net: z.string().optional().describe("Practice network ask ('testnet'). Absent = the ordinary rail; never widens"),
|
|
5569
6003
|
}),
|
|
5570
6004
|
response: () => z.object({
|
|
5571
6005
|
url: z.string().optional(),
|
|
6006
|
+
// railOnly: 'fixed' — today's path applies, so ask again WITH the amount.
|
|
6007
|
+
rail: z.string().optional(),
|
|
5572
6008
|
linkId: z.string().optional(),
|
|
6009
|
+
// 'off' (a link) · 'on' (an escrow address) · 'scoped' (a deposit into the payee's
|
|
6010
|
+
// vault object, C13) — what the answer below IS.
|
|
6011
|
+
custody: z.string().optional(),
|
|
6012
|
+
// C13 (text/wallets-todo.md ruling 5) — a 'scoped' payee's answer: pay INTO the vault.
|
|
6013
|
+
// `amount` is the coin's BASE UNITS as a decimal string (USDC: 6 decimals; cents x
|
|
6014
|
+
// 10_000), the figure the facade's `deposit` puts on chain; `network` is the VAULT's
|
|
6015
|
+
// own network (the one whose pinned USDC it holds — repair 2, finding 2) and
|
|
6016
|
+
// `package` the vault package pinned there. An instruction is never handed out
|
|
6017
|
+
// without a package: a vault on a network with none is refused by name
|
|
6018
|
+
// (`scoped_deposit_unbuilt`). No link, no settlement row: the vault is the attribution.
|
|
6019
|
+
// C18e — a caller who does not control the workspace is never told the amount back:
|
|
6020
|
+
// its instruction carries the public facts only, and `amount` is absent.
|
|
6021
|
+
deposit: z.object({
|
|
6022
|
+
vault: z.string(),
|
|
6023
|
+
coinType: z.string(),
|
|
6024
|
+
amount: z.string().optional(),
|
|
6025
|
+
network: z.string(),
|
|
6026
|
+
package: z.string(),
|
|
6027
|
+
}).optional(),
|
|
5573
6028
|
payTo: z.object({
|
|
5574
|
-
// An OPEN string, never an enum. 'self' | 'via-treasury' | 'none'
|
|
5575
|
-
//
|
|
5576
|
-
//
|
|
5577
|
-
//
|
|
5578
|
-
//
|
|
5579
|
-
// never a silent fallback to 'self' or to the SUI rail.
|
|
6029
|
+
// An OPEN string, never an enum. 'self' | 'via-treasury' | 'none' | 'scoped'
|
|
6030
|
+
// (C13: payee = a vault object id, `vault` below, no address). An UNKNOWN value
|
|
6031
|
+
// is refused BY NAME at payee resolution (`unsupported_custody:<value>`,
|
|
6032
|
+
// resolvers/wallet.ts) — never a crash, never a silent fallback to 'self' or to
|
|
6033
|
+
// the SUI rail.
|
|
5580
6034
|
custody: z.string(),
|
|
5581
6035
|
chain: z.string().optional(),
|
|
5582
6036
|
address: z.string().optional(),
|
|
6037
|
+
vault: z.string().optional(),
|
|
5583
6038
|
attributeTo: z.string().optional(),
|
|
5584
6039
|
}).optional(),
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
6040
|
+
// C16 (the treasury's card) — custody 'private': money that lands at the TREASURY is paid
|
|
6041
|
+
// to a fresh one-time address the PAYER derives from the treasury's public card (served at
|
|
6042
|
+
// /api/lock/<workspace>, re-verified in the payer's browser). The answer names no address:
|
|
6043
|
+
// `workspace` whose card to read, the `asset` and `chain` the tweak names (testnet USDC),
|
|
6044
|
+
// `amountCents` (absent on a railOnly answer: ONE is never told the sum), and `gasSui` — the few
|
|
6045
|
+
// cents of SUI the payer adds for the sale's later move (the sale is HELD at its own address until
|
|
6046
|
+
// the owner's device moves it; a move links that payer to the treasury).
|
|
6047
|
+
// Custody 'on' keeps the treasury's fixed sweep destination, card or no card: the sweep
|
|
6048
|
+
// sends USDC and no SUI, so a one-time address could not pay the gas to move it on
|
|
6049
|
+
// (`why: 'sweep_no_gas'`). `why` rides beside today's link or escrow when the card does not
|
|
6050
|
+
// apply: `no_card` · `show_addresses` · `not_testnet` · `agent_attribution` · `sweep_no_gas`.
|
|
6051
|
+
workspace: z.string().optional(),
|
|
6052
|
+
asset: z.string().optional(),
|
|
6053
|
+
chain: z.string().optional(),
|
|
6054
|
+
amountCents: z.number().optional(),
|
|
6055
|
+
gasSui: z.string().optional(),
|
|
6056
|
+
why: z.string().optional(),
|
|
6057
|
+
// Refusals by name (resolvers/wallet.ts): `vault_on_other_network:<net>` — the agent
|
|
6058
|
+
// owns a vault, on the network the suffix names, not this worker's (C13 repair 3:
|
|
6059
|
+
// never a silent self / via-treasury link for an agent that owns a vault);
|
|
6060
|
+
// `amountCents_over_u64` — an integer past MAX_CENTS (u64 / 10_000);
|
|
6061
|
+
// `scoped_deposit_unbuilt` — a vault on a network with no package pinned;
|
|
6062
|
+
// `treasury_card_unreadable` (C16) — the card could not be read; nothing minted;
|
|
6063
|
+
// `not_payable` (C18e) — what a caller who does not control the workspace hears for every
|
|
6064
|
+
// reason a visible agent's vault deposit cannot be offered (the names are the controller's).
|
|
6065
|
+
error: z.string().optional(),
|
|
6066
|
+
}),
|
|
6067
|
+
// C18e ruling 1 — `public` at the edge so a visitor reaches the ONE branch it may: an agent with an
|
|
6068
|
+
// active vault on this worker's network answers the scoped deposit instruction (public facts on
|
|
6069
|
+
// chain) to any caller. Every other answer is still the workspace's controller only, and never a
|
|
6070
|
+
// sessionless agent key — the resolver carries the rule this label used to (resolvers/wallet.ts).
|
|
6071
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, settles: "none", auth: "public",
|
|
5588
6072
|
examples: [
|
|
5589
6073
|
{ actor: "agent:scout", amountCents: 2500 },
|
|
5590
6074
|
{ workspace: "acme", actor: "agent:scout", amountCents: 2500, currency: "usd" },
|
|
@@ -5625,14 +6109,179 @@ export const RECEIVERS = {
|
|
|
5625
6109
|
"storefront:enable": receiver({
|
|
5626
6110
|
receiver: "storefront:enable",
|
|
5627
6111
|
summary: "Open (or close) a workspace's storefront — the gate every checkout mint reads",
|
|
5628
|
-
request: () => z.object({
|
|
5629
|
-
|
|
6112
|
+
request: () => z.object({
|
|
6113
|
+
slug: z.string().optional(),
|
|
6114
|
+
enabled: z.boolean().optional(),
|
|
6115
|
+
cart: z.boolean().optional().describe("Also switch the native grid's Add to basket on (true) or off (false) — owners.storefront_cart_enabled. Absent leaves it unchanged."),
|
|
6116
|
+
testMode: z.boolean().optional().describe("Test mode (owners.storefront_test_mode): true = the store takes test money — Stripe test card, TESTNET crypto escrow — and every buyer page shows a test-mode banner. A call naming only testMode leaves the store's open/closed state alone."),
|
|
6117
|
+
}),
|
|
6118
|
+
response: () => z.object({ ok: z.boolean().optional(), slug: z.string().optional(), enabled: z.boolean().optional(), cart: z.boolean().optional(), testMode: z.boolean().optional(), error: z.string().optional() }),
|
|
5630
6119
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
5631
|
-
examples: [{ slug: "acme" }, { slug: "acme", enabled: false }],
|
|
6120
|
+
examples: [{ slug: "acme" }, { slug: "acme", enabled: false }, { slug: "acme", cart: true }, { slug: "acme", testMode: true }],
|
|
6121
|
+
}),
|
|
6122
|
+
// A Stripe account that takes cards, and a test card payment on it, with no form —
|
|
6123
|
+
// for an owner pressing one button or their agent calling one door (text/cards.md).
|
|
6124
|
+
// TEST MODE ONLY: the account is platform-collected and filled with Stripe's test
|
|
6125
|
+
// identity values, so a live key is refused before Stripe is asked anything.
|
|
6126
|
+
// Body: resolvers/storefront/test-cards.ts; work: lib/stripe-test-seller.ts.
|
|
6127
|
+
"storefront:test-cards": receiver({
|
|
6128
|
+
receiver: "storefront:test-cards",
|
|
6129
|
+
summary: "Set up test card payments for a workspace in one call: creates (or reuses) a test-mode Stripe account ONE fills with Stripe's test values, waits a few seconds for Stripe to switch cards on, then takes a €10 test card payment on it. Answers stage 'checking' if Stripe is still switching it on — call again. Refuses on a live key (test_mode_only). Owner-only.",
|
|
6130
|
+
request: () => z.object({
|
|
6131
|
+
workspace: z.string().optional().describe("Which store. NOT an authority claim — the attested caller must control it (callerControlsWorkspace). Absent = the caller's own."),
|
|
6132
|
+
slug: z.string().optional().describe("Alias of `workspace`."),
|
|
6133
|
+
country: z.string().optional().describe("Two-letter country for the test account. Only IE is run end to end today; anything else refuses with country_not_supported. Absent = IE."),
|
|
6134
|
+
pay: z.boolean().optional().describe("false = set the account up but take no test payment. Absent = pay once the account can take cards."),
|
|
6135
|
+
}),
|
|
6136
|
+
response: () => z.object({
|
|
6137
|
+
ok: z.boolean(),
|
|
6138
|
+
workspace: z.string().optional(),
|
|
6139
|
+
stage: z.enum(["checking", "live", "paid"]).optional().describe("checking = Stripe is still switching cards on, call again · live = can take cards · paid = a test payment went through"),
|
|
6140
|
+
accountId: z.string().optional(),
|
|
6141
|
+
created: z.boolean().optional().describe("A new test account was made on this call."),
|
|
6142
|
+
replaced: z.string().nullable().optional().describe("The unfinished account this one replaced, if any."),
|
|
6143
|
+
payment: z.object({ id: z.string(), charge: z.string().nullable(), amount: z.number().int(), currency: z.string() }).optional(),
|
|
6144
|
+
error: z.string().optional().describe("forbidden · test_mode_only · country_not_supported · stripe_refused · not_live_yet · workspace_not_found · stripe_not_configured · no_db"),
|
|
6145
|
+
detail: z.string().optional(),
|
|
6146
|
+
}),
|
|
6147
|
+
effect: "ask", cost: "free", reversible: false, idempotent: false, auth: "owner",
|
|
6148
|
+
surfaces: { mcp: true },
|
|
6149
|
+
examples: [{}, { workspace: "acme" }, { workspace: "acme", pay: false }],
|
|
6150
|
+
}),
|
|
6151
|
+
// The one live switch (C7b): owners.live_at flips card AND crypto to live money
|
|
6152
|
+
// together, and goLive writes it only when every gap is closed — refusing by name
|
|
6153
|
+
// otherwise. Body: resolvers/storefront/shop-live.ts; switch: lib/stripe-mode.ts.
|
|
6154
|
+
"shop:go-live": receiver({
|
|
6155
|
+
receiver: "shop:go-live",
|
|
6156
|
+
summary: "Switch a store to LIVE money on card and crypto together. Refuses, writing nothing, until every gap is closed — live_connect (a Stripe Connect account the live key confirms can charge), mainnet_treasury (a well-formed payout address), confirmed_prices (the owner confirmed every active price), live_keys (the platform's live Stripe pair) — and names each one still open. Owner-only.",
|
|
6157
|
+
request: () => z.object({
|
|
6158
|
+
workspace: z.string().optional().describe("Which store. NOT an authority claim — the attested caller must control it (callerControlsWorkspace). Absent = the caller's own."),
|
|
6159
|
+
slug: z.string().optional().describe("Alias of `workspace`."),
|
|
6160
|
+
}),
|
|
6161
|
+
response: () => z.object({
|
|
6162
|
+
ok: z.boolean().describe("TRUE when the store is live (now, or already)."),
|
|
6163
|
+
workspace: z.string().optional(),
|
|
6164
|
+
live_at: z.number().int().optional().describe("Unix seconds the store went live."),
|
|
6165
|
+
already: z.boolean().optional().describe("The store was already live; nothing was written."),
|
|
6166
|
+
error: z.string().optional().describe("`forbidden` · `no_db` · `no_store` · `not_ready` (a gap is open) · `changed` (the store moved while switching; nothing was written)."),
|
|
6167
|
+
missing: z.array(z.enum(["live_connect", "mainnet_treasury", "confirmed_prices", "live_keys"])).optional().describe("Every gap still open, by name."),
|
|
6168
|
+
detail: z.string().optional().describe("One line naming each gap and what is missing — never a key, never an address."),
|
|
6169
|
+
}),
|
|
6170
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "owner",
|
|
6171
|
+
examples: [{ workspace: "kiln" }],
|
|
6172
|
+
}),
|
|
6173
|
+
"shop:stop-live": receiver({
|
|
6174
|
+
receiver: "shop:stop-live",
|
|
6175
|
+
summary: "Switch a store back to TEST money on card and crypto together (clears live_at, turns test mode on). Always allowed for the owner — it is the safe direction. Owner-only.",
|
|
6176
|
+
request: () => z.object({
|
|
6177
|
+
workspace: z.string().optional().describe("Which store. NOT an authority claim — the attested caller must control it. Absent = the caller's own."),
|
|
6178
|
+
slug: z.string().optional().describe("Alias of `workspace`."),
|
|
6179
|
+
}),
|
|
6180
|
+
response: () => z.object({
|
|
6181
|
+
ok: z.boolean(),
|
|
6182
|
+
workspace: z.string().optional(),
|
|
6183
|
+
error: z.string().optional().describe("`forbidden` · `no_db` · `no_store`."),
|
|
6184
|
+
}),
|
|
6185
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "owner",
|
|
6186
|
+
examples: [{ workspace: "kiln" }],
|
|
6187
|
+
}),
|
|
6188
|
+
// ONE command, a complete store. Composes storefront:enable, products:create,
|
|
6189
|
+
// variants:create, media:generate and the three pages:* shop-pack doors in the
|
|
6190
|
+
// caller's ctx; idempotent by read-back (a second call writes nothing).
|
|
6191
|
+
// Body: resolvers/storefront/shop-build.ts.
|
|
6192
|
+
"shop:build": receiver({
|
|
6193
|
+
receiver: "shop:build",
|
|
6194
|
+
summary: "Build a complete store in one call: storefront on in test mode with the basket, 6–12 products with copy, prices, an image and a stocked variant each, grouped into 3–4 collections, and the twelve shop pages filled and published with no bracket left. Never invents a founder, year, address or policy — those come back in factsToAdd. A second call creates nothing and answers the same receipt.",
|
|
6195
|
+
request: () => z.object({
|
|
6196
|
+
workspace: z.string().optional().describe("Which workspace to build. NOT an authority claim — the attested caller must control it (callerControlsWorkspace). Absent = the caller's own."),
|
|
6197
|
+
slug: z.string().optional().describe("Alias of `workspace`, for callers that speak the storefront receivers' field name."),
|
|
6198
|
+
description: z.string().min(1).describe("Plain English: what the business is and what it sells. The model writes the catalogue from this and nothing else."),
|
|
6199
|
+
products: z
|
|
6200
|
+
.array(z.object({
|
|
6201
|
+
name: z.string(),
|
|
6202
|
+
price: z.number().optional().describe("MINOR units of `currency` (2400 = 24.00) — the same unit as products:create's unit_amount."),
|
|
6203
|
+
description: z.string().optional().describe("Kept verbatim; the model writes one only when this is absent."),
|
|
6204
|
+
}))
|
|
6205
|
+
.optional()
|
|
6206
|
+
.describe("Products the owner already knows. Used first; the model only fills the gap to six-plus. A product without a price is reported, never priced by guess."),
|
|
6207
|
+
heroPrompt: z.string().optional().describe("The seller's own prompt for the hero image. Drawn from verbatim when the home page has a hero slot to fill; absent = a lifestyle shot of what the shop sells. A hero image already in facts.identity.heroImage wins over both."),
|
|
6208
|
+
currency: z.string().optional().describe("ISO 4217, default USD."),
|
|
6209
|
+
brand: z
|
|
6210
|
+
.object({ name: z.string().optional(), tagline: z.string().optional() })
|
|
6211
|
+
.optional()
|
|
6212
|
+
.describe("The shop's name (else the workspace's display name) and an optional tagline."),
|
|
6213
|
+
facts: z
|
|
6214
|
+
.record(z.string(), z.unknown())
|
|
6215
|
+
.optional()
|
|
6216
|
+
.describe("Optional ShopBusinessFacts (lib/puck/fill-shop-pack.ts) the owner typed — contact, policies, founder. Passed through to pages:fill-shop-pack and validated there."),
|
|
6217
|
+
publish: z
|
|
6218
|
+
.boolean()
|
|
6219
|
+
.optional()
|
|
6220
|
+
.describe("FALSE = build everything and open nothing: the storefront stays off and the twelve pages stay drafts, for a person to review first (the store-builder workflow opens and publishes after its approval). Absent = go live in test mode, as before."),
|
|
6221
|
+
acceptPartial: z
|
|
6222
|
+
.boolean()
|
|
6223
|
+
.optional()
|
|
6224
|
+
.describe("TRUE = `ok` means the store is READY (six-plus products and twelve published pages with no bracket), not that every step verified — a missing product photo or a live card key is still named in `steps` and `complete` stays false. For a build a person reviews next (the store-builder workflow), where one failed image must not fail the whole run. Absent = the strict verdict."),
|
|
6225
|
+
}),
|
|
6226
|
+
response: () => z.object({
|
|
6227
|
+
ok: z.boolean().describe("TRUE only when every step verified from the rows: twelve pages published with no bracket, six-plus products each with a price, an image and a stocked variant, the storefront and basket on, card rail in test mode. With `acceptPartial`, TRUE when the store is ready (catalogue + verify) — see `complete`."),
|
|
6228
|
+
complete: z.boolean().optional().describe("Every step verified — the strict verdict, whatever `acceptPartial` said."),
|
|
6229
|
+
error: z.string().optional().describe("A refusal before any step ran: `forbidden` · `no_db` · `missing description`."),
|
|
6230
|
+
workspace: z.string().optional(),
|
|
6231
|
+
storeUrl: z.string().optional(),
|
|
6232
|
+
mode: z.enum(["test", "live"]).optional().describe("The card rail as MEASURED for the store's page (resolveStripeForPage), not as intended."),
|
|
6233
|
+
cryptoNetwork: z.string().optional().describe("The crypto rail as measured (resolveOneNetwork): mainnet | testnet."),
|
|
6234
|
+
businessName: z.string().optional(),
|
|
6235
|
+
heroImage: z.string().nullable().optional(),
|
|
6236
|
+
productIds: z.array(z.string()).optional(),
|
|
6237
|
+
products: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
6238
|
+
collections: z.array(z.string()).optional(),
|
|
6239
|
+
pages: z.array(z.object({ role: z.string(), slug: z.string(), title: z.string(), status: z.string(), url: z.string() })).optional(),
|
|
6240
|
+
factsToAdd: z.array(z.object({ fact: z.string().nullable(), token: z.string() })).optional().describe("Facts only the owner can give. Each one's sentence was left off the published pages rather than invented."),
|
|
6241
|
+
steps: z
|
|
6242
|
+
.array(z.object({ step: z.string(), ok: z.boolean(), reason: z.string().optional(), detail: z.record(z.string(), z.unknown()).optional() }))
|
|
6243
|
+
.optional()
|
|
6244
|
+
.describe("storefront · catalogue · images · variants · pages · hero · fill · publish · chat · verify — each ok or failed with a reason. Nothing is skipped silently. `chat` writes the shop assistant (the page chat pack) onto every role page that has none."),
|
|
6245
|
+
created: z.record(z.string(), z.number()).optional().describe("What THIS call wrote. All zero on a repeat call."),
|
|
6246
|
+
}),
|
|
6247
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: true, auth: "member",
|
|
6248
|
+
examples: [{ workspace: "tea-test", description: "A small loose-leaf tea shop in Galway selling single-origin teas, blends and teaware." }],
|
|
6249
|
+
}),
|
|
6250
|
+
// Is this store ready to sell? Six lines read from the rows — S1 role pages ·
|
|
6251
|
+
// S2 products · S3 chat packs · S4 lifecycle · S5 starter workflows · CARD —
|
|
6252
|
+
// each closed with a mark (pass) or a warn (fail) on its own path.
|
|
6253
|
+
// Body: resolvers/storefront/shop-readiness.ts.
|
|
6254
|
+
"shop:readiness": receiver({
|
|
6255
|
+
receiver: "shop:readiness",
|
|
6256
|
+
summary: "Is this store ready to sell? Answers six lines read from the store's own rows — S1 twelve role pages with no bracket and no link to #, S2 live products whose buy links all resolve, S3 a chat pack on twelve role pages, S4 an active lifecycle, S5 a live starter workflow, CARD the store page charges a real card — each pass or fail with its evidence. A fact that could not be read is a failing line that says 'unknown', never a zero. Owner-only.",
|
|
6257
|
+
request: () => z.object({
|
|
6258
|
+
workspace: z.string().optional().describe("Which store to check. NOT an authority claim — the attested caller must control it (callerControlsWorkspace). Absent = the caller's own."),
|
|
6259
|
+
slug: z.string().optional().describe("Alias of `workspace`, for callers that speak the storefront receivers' field name."),
|
|
6260
|
+
quiet: z.boolean().optional().describe("A READ for a screen: answer the lines without closing them with a mark/warn per line, so a page view does not pile weight on the paths. A refusal still warns the caller."),
|
|
6261
|
+
}),
|
|
6262
|
+
response: () => z.object({
|
|
6263
|
+
ok: z.boolean().describe("TRUE when the list was answered — not that the store is ready; that is `green`."),
|
|
6264
|
+
error: z.string().optional().describe("A refusal: `forbidden` (no attested caller, or one who does not control the store) · `no_db`."),
|
|
6265
|
+
workspace: z.string().optional(),
|
|
6266
|
+
lines: z
|
|
6267
|
+
.array(z.object({
|
|
6268
|
+
code: z.enum(["S1", "S2", "S3", "S4", "S5", "CARD"]),
|
|
6269
|
+
pass: z.boolean(),
|
|
6270
|
+
evidence: z.string().describe("The measured numbers behind the verdict, or `unknown: … was not read`."),
|
|
6271
|
+
closed: z.enum(["mark", "warn"]).describe("How this line closed its loop: mark on a pass, warn on a fail."),
|
|
6272
|
+
}))
|
|
6273
|
+
.optional()
|
|
6274
|
+
.describe("Always six, always in the order S1 S2 S3 S4 S5 CARD."),
|
|
6275
|
+
green: z.boolean().optional().describe("Every line passes."),
|
|
6276
|
+
passed: z.number().int().optional(),
|
|
6277
|
+
total: z.number().int().optional(),
|
|
6278
|
+
}),
|
|
6279
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "owner",
|
|
6280
|
+
examples: [{ workspace: "tea-test" }],
|
|
5632
6281
|
}),
|
|
5633
6282
|
"storefront:stats": receiver({
|
|
5634
6283
|
receiver: "storefront:stats",
|
|
5635
|
-
summary: "Storefront funnel stats — views, checkouts, purchases, revenue, per-product breakdown",
|
|
6284
|
+
summary: "Storefront funnel stats — views, checkouts, purchases, revenue (free to the owner), plus the per-product breakdown and funnel (the 'shop' plugin)",
|
|
5636
6285
|
request: () => z.object({ slug: z.string().optional() }),
|
|
5637
6286
|
response: () => z.object({
|
|
5638
6287
|
views: z.number().optional(),
|
|
@@ -5640,6 +6289,8 @@ export const RECEIVERS = {
|
|
|
5640
6289
|
purchases: z.number().optional(),
|
|
5641
6290
|
revenue_cents: z.number().optional(),
|
|
5642
6291
|
byProduct: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
6292
|
+
locked: z.array(z.string()).optional().describe("Fields withheld because the store lacks the 'shop' plugin — absent, never empty. The four totals are always answered to the owner"),
|
|
6293
|
+
unlock: z.string().optional().describe("The plugin that unlocks `locked`"),
|
|
5643
6294
|
error: z.string().optional(),
|
|
5644
6295
|
}),
|
|
5645
6296
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
@@ -5902,19 +6553,75 @@ export const RECEIVERS = {
|
|
|
5902
6553
|
"pages:create": receiver({
|
|
5903
6554
|
receiver: "pages:create",
|
|
5904
6555
|
surfaces: { mcp: true },
|
|
5905
|
-
summary: "Create a workspace page (draft) from a
|
|
5906
|
-
request: () => z.object({
|
|
6556
|
+
summary: "Create a workspace page (draft) — from a page template, from any registry blocks, or from legacy CRO sections",
|
|
6557
|
+
request: () => z.object({
|
|
6558
|
+
slug: z.string(), title: z.string(),
|
|
6559
|
+
sections: z.array(z.object({ component: z.string(), props: z.record(z.string(), z.unknown()) })).optional(),
|
|
6560
|
+
puckData: z.object({ content: z.array(z.record(z.string(), z.unknown())), root: z.record(z.string(), z.unknown()).optional() }).passthrough().optional()
|
|
6561
|
+
.describe("Puck data: `content[]` of `{ type, props }`, any registry block. Each top-level block's props are normalised onto the member its variant renders and given a `props.id` when missing. With `template`, these blocks are APPENDED after the template's."),
|
|
6562
|
+
template: z.string().optional().describe("A page-template id from `pages:templates`. The page starts as a copy of that template — its blocks, images, links and anchors — and `edits` / `remove` / `puckData` are applied on top. A pack template (it has a `pageCount`) is refused: it seeds many pages through its own receiver."),
|
|
6563
|
+
edits: z.array(z.object({
|
|
6564
|
+
blockId: z.string().describe("A template block's `props.id`, as `pages:templates {id}` lists it"),
|
|
6565
|
+
props: z.record(z.string(), z.unknown()).describe("Props merged into that block — usually its copy rewritten for the brief"),
|
|
6566
|
+
})).optional().describe("Only with `template`. An unknown blockId is reported in `unknownEdits`, never silently dropped."),
|
|
6567
|
+
remove: z.array(z.string()).optional().describe("Only with `template`: template block ids to leave out."),
|
|
6568
|
+
pageSlug: z.string().optional(),
|
|
6569
|
+
}),
|
|
5907
6570
|
response: () => z.object({
|
|
5908
6571
|
ok: z.boolean(), slug: z.string().optional(), title: z.string().optional(), url: z.string().optional(), status: z.string().optional(), error: z.string().optional(),
|
|
5909
6572
|
unknownBlocks: z.array(z.string()).optional().describe("Block names in this page that the renderer CANNOT DRAW, in your own spelling. The page was still created — the names are stored and will paint nothing. PRESENT ⟺ at least one name was unknown; absent means every name resolved (absent is not an empty array). A retired or collapsed family member name (HeroCentered, Wallet) is NOT listed: the render path rewrites it. Repair with `pages:update-block`, and read `blocks:list` / `blocks:schema` for the names that exist."),
|
|
6573
|
+
unknownEdits: z.array(z.string()).optional().describe("`edits[].blockId` values the template does not hold — those edits were NOT applied. Absent ⟺ every edit addressed a real block."),
|
|
6574
|
+
unlandedEdits: z.array(z.object({ blockId: z.string(), fields: z.array(z.string()), renders: z.array(z.string()) })).optional()
|
|
6575
|
+
.describe("Edit keys no field of that block's rendering member took — stored, invisible, and the sample copy they meant to replace is still showing. `renders` names the fields that do render. Re-send with those names."),
|
|
6576
|
+
sampleCopyLeft: z.array(z.object({ blockId: z.string(), type: z.string(), fields: z.array(z.string()) })).optional()
|
|
6577
|
+
.describe("With `template`: blocks whose listed props still hold the TEMPLATE'S sample copy — another business's words on this page. The page is not done until this is absent: rewrite each (`pages:update-block`) or remove the block."),
|
|
6578
|
+
sampleImagesLeft: z.array(z.object({ blockId: z.string(), fields: z.array(z.string()) })).optional()
|
|
6579
|
+
.describe("With `template`: props still showing the template's sample photos. Replace with the business's own images where you have them."),
|
|
6580
|
+
quality: PAGE_QUALITY.optional(),
|
|
5910
6581
|
}),
|
|
5911
6582
|
effect: "ask", cost: "free", reversible: true, idempotent: false, auth: "member",
|
|
5912
6583
|
}),
|
|
6584
|
+
"pages:templates": receiver({
|
|
6585
|
+
receiver: "pages:templates",
|
|
6586
|
+
surfaces: { mcp: true },
|
|
6587
|
+
summary: "Browse the page templates (store, sales, webinar, course, about, …) — list them with their block line-up, or read one template's full blocks to start a page from",
|
|
6588
|
+
request: () => z.object({
|
|
6589
|
+
id: z.string().optional().describe("A template id. Present → that template's full blocks (`{ id, type, props }`) and its rewrite guidance. Absent → the list."),
|
|
6590
|
+
search: z.string().optional().describe("List mode: case-insensitive substring over id, name and description."),
|
|
6591
|
+
}),
|
|
6592
|
+
response: () => z.object({
|
|
6593
|
+
ok: z.boolean(),
|
|
6594
|
+
templates: z.array(z.object({
|
|
6595
|
+
id: z.string(), name: z.string(), description: z.string(),
|
|
6596
|
+
blocks: z.array(z.string()).describe("The template's top-level blocks in order, as `Type` or `Type/variant`"),
|
|
6597
|
+
pageCount: z.number().optional().describe("Present ⟺ a PACK: it seeds this many pages through `seedReceiver`, and `pages:create {template}` refuses it"),
|
|
6598
|
+
seedReceiver: z.string().optional(),
|
|
6599
|
+
strength: z.object({ score: z.number(), max: z.number() }).optional().describe("How many of the template-strength checks it passes (lib/puck/template-strength.ts)"),
|
|
6600
|
+
})).optional().describe("List mode. Every template — the list is small (tens) and never paged."),
|
|
6601
|
+
template: z.object({
|
|
6602
|
+
id: z.string(), name: z.string(), description: z.string(),
|
|
6603
|
+
guidance: z.string().describe("How to rewrite this template for a real business"),
|
|
6604
|
+
root: z.record(z.string(), z.unknown()).optional(),
|
|
6605
|
+
blocks: z.array(z.object({ id: z.string(), type: z.string(), props: z.record(z.string(), z.unknown()) })),
|
|
6606
|
+
pageCount: z.number().optional(),
|
|
6607
|
+
seedReceiver: z.string().optional(),
|
|
6608
|
+
}).optional().describe("Read mode."),
|
|
6609
|
+
error: z.string().optional(),
|
|
6610
|
+
}),
|
|
6611
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true,
|
|
6612
|
+
examples: [{ search: "store" }, { id: "storefront-home" }],
|
|
6613
|
+
}),
|
|
5913
6614
|
"pages:edit": receiver({
|
|
5914
6615
|
receiver: "pages:edit",
|
|
5915
6616
|
summary: "Edit a workspace page's title or sections",
|
|
5916
|
-
request: () => z.object({
|
|
5917
|
-
|
|
6617
|
+
request: () => z.object({
|
|
6618
|
+
slug: z.string(), page: z.string(), title: z.string().optional(),
|
|
6619
|
+
sections: z.array(z.object({ component: z.string(), props: z.record(z.string(), z.unknown()) })).optional(),
|
|
6620
|
+
puckData: z.object({ content: z.array(z.record(z.string(), z.unknown())), root: z.record(z.string(), z.unknown()).optional() }).passthrough().optional()
|
|
6621
|
+
.describe("Full replacement Puck data — any registry block. Top-level props are normalised and ids stamped exactly as `pages:create` does. Refused beside `sections`."),
|
|
6622
|
+
root: PAGE_ROOT_PATCH.optional().describe("PAGE SETTINGS — merged into the stored `data.root.props` (what Layout reads for the page's head, chat, dock and chrome). Only these keys; an empty string CLEARS a key so it falls back to its default. Refused beside `sections`."),
|
|
6623
|
+
}),
|
|
6624
|
+
response: () => z.object({ ok: z.boolean(), slug: z.string().optional(), title: z.string().optional(), url: z.string().optional(), status: z.string().optional(), updatedAt: z.number().optional(), error: z.string().optional(), quality: PAGE_QUALITY.optional() }),
|
|
5918
6625
|
effect: "ask", cost: "free", reversible: true, idempotent: false, auth: "member",
|
|
5919
6626
|
}),
|
|
5920
6627
|
"pages:list": receiver({
|
|
@@ -5958,6 +6665,51 @@ export const RECEIVERS = {
|
|
|
5958
6665
|
}),
|
|
5959
6666
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
5960
6667
|
}),
|
|
6668
|
+
"pages:build-site": receiver({
|
|
6669
|
+
receiver: "pages:build-site",
|
|
6670
|
+
summary: "Write a five-page business site — home, about, services, contact, faq — as DRAFTS from the business's own facts. Drops every proof block the facts cannot back (stats, logos, testimonials, pricing, team, badges, quotes, timelines, sample galleries), rewrites the rest with one model call per page, and cuts any sentence that invents a number, a name or a placeholder. Saves the facts as the workspace's business-facts. Idempotent by read-back: a template already built is reported created:false and left alone. Publishing is pages:publish-pack's job.",
|
|
6671
|
+
request: () => z.object({
|
|
6672
|
+
slug: z
|
|
6673
|
+
.string()
|
|
6674
|
+
.describe("which workspace. NOT an authority claim — the caller is authorized by the attested ctx through the same callerControlsWorkspace walk every pages:* receiver uses. Absent = the caller's own workspace."),
|
|
6675
|
+
facts: z
|
|
6676
|
+
.object({
|
|
6677
|
+
businessName: z.string().describe('the business\'s name — the one required fact; absent, the call is refused as "missing facts"'),
|
|
6678
|
+
whatYouSell: z.string().optional().describe('a 2-5 word noun phrase — "Emergency plumbing"'),
|
|
6679
|
+
summary: z.string().optional().describe("two or three plain sentences on what the business does, in its own words"),
|
|
6680
|
+
tagline: z.string().optional(),
|
|
6681
|
+
founderName: z.string().optional().describe("named on a page only when given"),
|
|
6682
|
+
foundedYear: z.number().optional().describe("a year the business stated; never inferred"),
|
|
6683
|
+
phone: z.string().optional(),
|
|
6684
|
+
email: z.string().optional(),
|
|
6685
|
+
postalAddress: z.string().optional().describe("withheld = no map and no Visit card, never a guessed address"),
|
|
6686
|
+
openingHours: z.string().optional(),
|
|
6687
|
+
city: z.string().optional(),
|
|
6688
|
+
services: z.array(z.string()).optional().describe("what the business offers, as short names"),
|
|
6689
|
+
currency: z.string().optional().describe("ISO 4217, when the business states one"),
|
|
6690
|
+
})
|
|
6691
|
+
.describe("the candidate facts (lib/site-builder/facts.ts BusinessFactsCandidate) — the ONLY source the copy may state; an absent field is absent, never a guess"),
|
|
6692
|
+
description: z
|
|
6693
|
+
.string()
|
|
6694
|
+
.optional()
|
|
6695
|
+
.describe("the visitor's own sentence about the business — extra context for the copy, and a source the number guard accepts"),
|
|
6696
|
+
}),
|
|
6697
|
+
response: () => z.object({
|
|
6698
|
+
ok: z.boolean().describe("all five pages exist (created now or already there)"),
|
|
6699
|
+
error: z.string().optional(),
|
|
6700
|
+
pages: z
|
|
6701
|
+
.array(z.object({ template: z.string(), slug: z.string(), title: z.string(), created: z.boolean() }))
|
|
6702
|
+
.optional()
|
|
6703
|
+
.describe("one row per template, in reading order — passes straight into pages:publish-pack's `pages`"),
|
|
6704
|
+
facts: z.array(z.string()).optional().describe("the business-facts keys now saved for the workspace; empty when the facts column is not migrated"),
|
|
6705
|
+
factsToAdd: z.array(z.string()).optional().describe("labels of public facts the pages name that nobody has given — the lines they hide until the owner adds them"),
|
|
6706
|
+
steps: z
|
|
6707
|
+
.array(z.object({ step: z.string(), ok: z.boolean(), reason: z.string().optional() }))
|
|
6708
|
+
.optional()
|
|
6709
|
+
.describe('facts, then page:<template> — a page whose copy fell back to the facts-only page says `copy_fallback:<why>`'),
|
|
6710
|
+
}),
|
|
6711
|
+
effect: "ask", cost: "variable", reversible: true, idempotent: true, auth: "member",
|
|
6712
|
+
}),
|
|
5961
6713
|
// WHY THIS IS DECLARED. `pages:delete` shipped as a resolver with no registry
|
|
5962
6714
|
// row, so it reached the handler only through the undeclared-receiver escape
|
|
5963
6715
|
// hatch — no edge zod parsing, no auth floor. Its two live callers send
|
|
@@ -6101,11 +6853,16 @@ export const RECEIVERS = {
|
|
|
6101
6853
|
source: z.object({ url: z.string().optional() }).optional().describe("where the facts came from, when they were extracted rather than typed"),
|
|
6102
6854
|
})
|
|
6103
6855
|
.describe("ShopBusinessFacts — lib/puck/fill-shop-pack.ts is the type of record"),
|
|
6856
|
+
stripPlaceholders: z
|
|
6857
|
+
.boolean()
|
|
6858
|
+
.optional()
|
|
6859
|
+
.describe("Go-live mode (shop:build): after the fill, a bracket still unanswered is REMOVED — its sentence dropped, an image or link prop set to '' — never left visible and never invented. The removed tokens come back in `stripped`."),
|
|
6104
6860
|
}),
|
|
6105
6861
|
response: () => z.object({
|
|
6106
6862
|
ok: z.boolean(),
|
|
6107
6863
|
filled: z.number().optional().describe("how many role pages were rewritten"),
|
|
6108
6864
|
roles: z.array(z.string()).optional().describe("which shop_role each rewritten page holds"),
|
|
6865
|
+
stripped: z.array(z.object({ role: z.string(), tokens: z.array(z.string()) })).optional().describe("with stripPlaceholders: the unanswered tokens removed, per role page"),
|
|
6109
6866
|
error: z.string().optional().describe("`not_seeded` = no page carries a shop_role yet; call pages:instantiate-shop-pack first"),
|
|
6110
6867
|
}),
|
|
6111
6868
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
@@ -6180,11 +6937,24 @@ export const RECEIVERS = {
|
|
|
6180
6937
|
}),
|
|
6181
6938
|
"movers:funnel-provision": receiver({
|
|
6182
6939
|
receiver: "movers:funnel-provision",
|
|
6183
|
-
summary: "Open, sponsored no-account provision — takes a
|
|
6184
|
-
request: () => z.object({
|
|
6940
|
+
summary: "Open, sponsored no-account provision — takes a contact name plus a URL or description, provisions a capped child workspace, and builds one of three things: a moving-company site + quote desk (movers, under moverchat), a store with products, photos and twelve pages in test mode (store), or a five-page business site with a front desk (site). Each vertical has its own sponsor budget, per-visitor rate limit and daily ceiling, and refuses past any wall. Ends on a preview token. The single writer behind the site-builder intake block's doors and the chat tool.",
|
|
6941
|
+
request: () => z.object({
|
|
6942
|
+
builds: z.enum(["movers", "store", "site"]).optional().describe("What to build. Absent = movers (every caller before the store and site verticals). Chooses the builder AND the sponsor budget; never names a workspace."),
|
|
6943
|
+
flow: z.enum(["vertical", "url-to-client"]).optional().describe("`url-to-client` = the URL block's door: every vertical, movers included, runs the one url-to-client workflow (soul → build → review → publish), and a name is optional. Absent = each vertical's own workflow."),
|
|
6944
|
+
fields: z.record(z.string(), z.string()).optional().describe("The URL block's operator-defined extra questions, answered — `{ label: answer }`, at most 12, each one line. Read into the extract and the chatbot's soul; never printed on a page as a fact."),
|
|
6945
|
+
name: z.string(),
|
|
6946
|
+
url: z.string().optional(),
|
|
6947
|
+
describe: z.string().optional(),
|
|
6948
|
+
phone: z.string().optional(),
|
|
6949
|
+
email: z.string().optional(),
|
|
6950
|
+
visitorHash: z.string(),
|
|
6951
|
+
}),
|
|
6185
6952
|
response: () => z.object({ ok: z.boolean(), previewToken: z.string().optional(), slug: z.string().optional(), error: z.string().optional() }),
|
|
6186
6953
|
effect: "ask", cost: "variable", reversible: false, idempotent: false, auth: "public",
|
|
6187
|
-
examples: [
|
|
6954
|
+
examples: [
|
|
6955
|
+
{ name: "Summit Movers", url: "https://summitmovers.example.com", visitorHash: "chat:web:conv-123" },
|
|
6956
|
+
{ builds: "store", name: "Ada", describe: "Fernhill Coffee, a small-batch roaster in Cork selling single-origin beans and brewing gear.", visitorHash: "chat:web:conv-456" },
|
|
6957
|
+
],
|
|
6188
6958
|
surfaces: { chat: true },
|
|
6189
6959
|
}),
|
|
6190
6960
|
"pages:versions": receiver({
|
|
@@ -6380,12 +7150,49 @@ export const RECEIVERS = {
|
|
|
6380
7150
|
ok: z.boolean(),
|
|
6381
7151
|
slug: z.string().optional(), title: z.string().optional(), url: z.string().optional(), status: z.string().optional(),
|
|
6382
7152
|
updatedAt: z.number().optional(),
|
|
7153
|
+
root: z.record(z.string(), z.unknown()).optional().describe("The page's settings — stored `data.root.props` (description, socialTitle, ogImage, search, canonical, chat, dock, siteHeader, siteFooter). `pages:edit` with `root` writes them."),
|
|
6383
7154
|
blocks: z.array(z.object({ id: z.string(), type: z.string(), props: z.record(z.string(), z.unknown()) })).optional().describe("THE LOSSLESS READ — every block on the page including the types the CRO `sections` schema cannot carry. `id` is what `pages:update-block` / `remove-block` / `move-block` target."),
|
|
6384
7155
|
sections: z.array(z.object({ component: z.string(), props: z.record(z.string(), z.unknown()) })).optional().describe("The legacy CRO-subset view, derived from the canonical blob. LOSSY by design — a non-CRO block is absent here and present in `blocks[]`. Never edit from this."),
|
|
6385
7156
|
error: z.string().optional(),
|
|
6386
7157
|
}),
|
|
6387
7158
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "member",
|
|
6388
7159
|
}),
|
|
7160
|
+
"copy:get": receiver({
|
|
7161
|
+
receiver: "copy:get",
|
|
7162
|
+
summary: "The live text layer's edits for one of one.ie's own code-written pages (not /u/… — those are page-builder pages): every stored edit as {key, original, text}, and whether THIS caller may edit them (staff, or control of the platform workspace).",
|
|
7163
|
+
request: () => z.object({
|
|
7164
|
+
path: z.string().describe("The page path, e.g. `/pricing`. Query and trailing slash are ignored."),
|
|
7165
|
+
}),
|
|
7166
|
+
response: () => z.object({
|
|
7167
|
+
ok: z.boolean(),
|
|
7168
|
+
path: z.string().optional(),
|
|
7169
|
+
entries: z.array(z.object({ key: z.string(), original: z.string(), text: z.string() })).optional().describe("`key` = the original wording, whitespace-normalised, plus `#n` for its nth repeat on the page."),
|
|
7170
|
+
canEdit: z.boolean().optional(),
|
|
7171
|
+
error: z.string().optional(),
|
|
7172
|
+
}),
|
|
7173
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "public",
|
|
7174
|
+
}),
|
|
7175
|
+
"copy:save": receiver({
|
|
7176
|
+
receiver: "copy:save",
|
|
7177
|
+
summary: "Save inline text edits on one of one.ie's own code-written pages — live on the next load, no deploy. An entry whose text is the original wording (or empty) removes that edit. Staff or controllers of the platform workspace only.",
|
|
7178
|
+
request: () => z.object({
|
|
7179
|
+
path: z.string().describe("The page path, e.g. `/pricing`."),
|
|
7180
|
+
entries: z.array(z.object({
|
|
7181
|
+
key: z.string().describe("The original wording (normalised), plus `#n` for its nth repeat — must belong to `original`."),
|
|
7182
|
+
original: z.string(),
|
|
7183
|
+
text: z.string().describe("The new wording; the original or empty removes the edit."),
|
|
7184
|
+
})).max(200),
|
|
7185
|
+
}),
|
|
7186
|
+
response: () => z.object({
|
|
7187
|
+
ok: z.boolean(),
|
|
7188
|
+
path: z.string().optional(),
|
|
7189
|
+
saved: z.number().optional(),
|
|
7190
|
+
removed: z.number().optional(),
|
|
7191
|
+
entries: z.array(z.object({ key: z.string(), original: z.string(), text: z.string() })).optional(),
|
|
7192
|
+
error: z.string().optional(),
|
|
7193
|
+
}),
|
|
7194
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "session",
|
|
7195
|
+
}),
|
|
6389
7196
|
"pages:children": receiver({
|
|
6390
7197
|
receiver: "pages:children",
|
|
6391
7198
|
summary: "Walk a page's own block tree and return every ChildPageBlock's target slug. ONE LEVEL ONLY — never transitive into the embedded page's own tree.",
|
|
@@ -6755,9 +7562,16 @@ export const RECEIVERS = {
|
|
|
6755
7562
|
// ── social + crawl — handlers in resolvers/social.ts ───────────────────────────
|
|
6756
7563
|
"social:publish": receiver({
|
|
6757
7564
|
receiver: "social:publish",
|
|
6758
|
-
summary: "
|
|
7565
|
+
summary: "Report what a master social post has queued: how many Facebook post variants the publisher cron will really post (live, nextAt), how many sit as drafts on networks with no live connection, and how many are skip-only formats. Leaves the master post untouched; answers ok:false when nothing is publishable. The posting itself is the social-variant cron, one Facebook post per workspace per five-minute tick.",
|
|
6759
7566
|
request: () => z.object({ slug: z.string(), actorId: z.string(), id: z.string() }),
|
|
6760
|
-
response: () => z.object({
|
|
7567
|
+
response: () => z.object({
|
|
7568
|
+
ok: z.boolean(), id: z.string().optional(), status: z.string().optional(), reason: z.string().optional(),
|
|
7569
|
+
live: z.number().optional().describe("Facebook post variants the cron will post."),
|
|
7570
|
+
nextAt: z.number().nullable().optional().describe("Earliest slot among them, unix seconds."),
|
|
7571
|
+
drafts: z.number().optional().describe("Scheduled variants on networks with no live connection."),
|
|
7572
|
+
skipOnly: z.number().optional().describe("Facebook reel/story/video variants: no API path, skipped."),
|
|
7573
|
+
note: z.string().optional(),
|
|
7574
|
+
}),
|
|
6761
7575
|
effect: "ask", cost: "variable", reversible: false, idempotent: false, auth: "update_group",
|
|
6762
7576
|
}),
|
|
6763
7577
|
"social:news-to-drafts": receiver({
|
|
@@ -6778,6 +7592,7 @@ export const RECEIVERS = {
|
|
|
6778
7592
|
name: z.string().optional(),
|
|
6779
7593
|
description: z.string().optional(),
|
|
6780
7594
|
text: z.string().optional(),
|
|
7595
|
+
image: z.string().nullable().optional().describe("The page's og:image, else twitter:image, as an absolute https URL — null when it names none. The news desk uses it as a story's own picture before it generates one"),
|
|
6781
7596
|
error: z.string().optional().describe("NAMED, never a single catch-all. invalid_url · https_required · dns_unresolved · blocked_host · redirect_no_location · redirect_invalid_url · redirect_blocked:<ssrf reason> · too_many_redirects · fetch_failed:<status> · not_html · timeout · fetch_error. Until 2026-09-15 every network cause collapsed into `fetch_error`, so a 301 apex->www and an origin refusing the fetch outright were indistinguishable — read `detail` beside this."),
|
|
6782
7597
|
detail: z.string().optional().describe("The underlying cause in words, ≤200 chars — the exception class and message, the blocked hop, or the content-type that was refused. Present on most errors, never on success."),
|
|
6783
7598
|
redirects: z.number().optional().describe("Hops followed before the answer. Redirects are followed MANUALLY, at most 4, and the SSRF guard re-runs on every hop — a public URL that redirects to a private address is refused at that hop with redirect_blocked."),
|
|
@@ -7265,6 +8080,9 @@ export const RECEIVERS = {
|
|
|
7265
8080
|
slug: z.string().optional().describe("Workspace whose workflow to run; honoured only if you control it. Omit for your own. Refused (forbidden), never swapped for your own."),
|
|
7266
8081
|
triggerPayload: z.record(z.string(), z.unknown()).optional(),
|
|
7267
8082
|
idempotencyKey: z.string().optional(),
|
|
8083
|
+
// Undeclared until 2026-10-11, zod STRIPPED this at /api/ask and the canvas
|
|
8084
|
+
// Test button minted a LIVE run that deposited pheromone on every edge.
|
|
8085
|
+
test: z.boolean().optional().describe("Test run: is_test=1, bypasses trigger match + flow gates, deposits zero pheromone. Steps still execute for real — not a dry run."),
|
|
7268
8086
|
}),
|
|
7269
8087
|
response: () => z.object({ runId: z.string(), status: z.string().describe("open | done | paused | failed — never `open` for a run whose executor refused to start it"), error: z.string().optional() }),
|
|
7270
8088
|
effect: "ask", cost: "variable", reversible: false, idempotent: true, simulatable: false, settles: "none",
|
|
@@ -7307,8 +8125,17 @@ export const RECEIVERS = {
|
|
|
7307
8125
|
// it re-walks the tapper's authority. Without it, slug is ignored.
|
|
7308
8126
|
slug: z.string().optional(),
|
|
7309
8127
|
attestation: z.string().optional(),
|
|
8128
|
+
// A step whose config carries a `proposal` approves ONLY with this: a WebAuthn
|
|
8129
|
+
// assertion (Face ID / Touch ID, user verification required) over
|
|
8130
|
+
// hash(proposal), verified once by verifyPasskeyAssertion. The server rebuilds
|
|
8131
|
+
// the proposal from the step config and the run — never from this request.
|
|
8132
|
+
assertion: z.record(z.string(), z.unknown()).optional(),
|
|
8133
|
+
}),
|
|
8134
|
+
response: () => z.object({
|
|
8135
|
+
ok: z.boolean(), status: z.string().optional(), error: z.string().optional(),
|
|
8136
|
+
// On passkey_required / passkey_not_verified: the ask to show and sign.
|
|
8137
|
+
proposal: z.record(z.string(), z.unknown()).optional(),
|
|
7310
8138
|
}),
|
|
7311
|
-
response: () => z.object({ ok: z.boolean(), status: z.string().optional(), error: z.string().optional() }),
|
|
7312
8139
|
effect: "ask", cost: "free", idempotent: true, simulatable: false, auth: "manage_workflows",
|
|
7313
8140
|
examples: [{ runId: "run_1", stepId: "s2", decision: "approved" }],
|
|
7314
8141
|
}),
|
|
@@ -7356,6 +8183,9 @@ export const RECEIVERS = {
|
|
|
7356
8183
|
stepName: z.string().optional(),
|
|
7357
8184
|
workflowName: z.string().optional(),
|
|
7358
8185
|
group: z.string().optional(), // conversation group; falls back to the run's started_by
|
|
8186
|
+
// An agent's ask, filled from the run ({ what, to, amount, asset, why, runId, stepId }).
|
|
8187
|
+
// Recorded on the `human:asked` event; the card shows it and Face ID signs its hash.
|
|
8188
|
+
proposal: z.record(z.string(), z.unknown()).optional(),
|
|
7359
8189
|
}),
|
|
7360
8190
|
response: () => z.object({ ok: z.boolean(), group: z.string().optional(), error: z.string().optional() }),
|
|
7361
8191
|
effect: "signal", cost: "free", idempotent: true, simulatable: false, auth: "manage_workflows",
|
|
@@ -7833,6 +8663,156 @@ export const RECEIVERS = {
|
|
|
7833
8663
|
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "manage_clients",
|
|
7834
8664
|
examples: [{}],
|
|
7835
8665
|
}),
|
|
8666
|
+
// ── News desk (text/magazine.md) — follow, fetch once, rank per group, publish an issue ──
|
|
8667
|
+
// Fetch is shared (a feed is public); everything private is keyed by the group. Handlers in
|
|
8668
|
+
// resolvers/news.ts. Every one refuses BY NAME: forbidden · not_found · bad_request ·
|
|
8669
|
+
// source_refused:<ssrf reason> · over_plan_cap · held:<reason>.
|
|
8670
|
+
"news:desk": receiver({
|
|
8671
|
+
receiver: "news:desk",
|
|
8672
|
+
surfaces: { chat: true, mcp: true },
|
|
8673
|
+
summary: "Read or change a group's news desk: what it follows, how much each topic matters, when it runs, the voice. `op` picks the action — get · set · add-source · remove-source · suggest · setup · clone · logos · source-stories. `setup` turns a few topics into a working desk (sources picked from the 50-source catalogue, the daily-magazine workflow armed) in one call",
|
|
8674
|
+
request: () => z.object({
|
|
8675
|
+
workspace: z.string().optional().describe("Group slug. Omit for your own. Honoured only if you control it."),
|
|
8676
|
+
op: z.enum(["get", "set", "add-source", "remove-source", "suggest", "setup", "clone", "logos", "source-stories"]).optional().describe("Default `get`. `logos` collects missing source logos (a few per call; `remaining` says how many are left). `source-stories` lists a followed source's newest stories (`url`)."),
|
|
8677
|
+
topics: z.union([z.array(z.string()), z.record(z.string(), z.number())]).optional().describe("`set`: {topic: weight 0–1}. `suggest` and `setup`: a list of topic words, e.g. [\"crypto\",\"sui\"]."),
|
|
8678
|
+
hour: z.number().int().min(0).max(23).optional().describe("UTC hour the issue is drafted and goes out."),
|
|
8679
|
+
cadence: z.enum(["daily", "weekdays"]).optional().describe("`set`: every day, or weekdays only, at `hour`."),
|
|
8680
|
+
refresh_hourly: z.boolean().optional().describe("`set`: true = re-draft the coming issue every hour with the latest news until it goes out (never publishes; spends credits inside the daily cap)."),
|
|
8681
|
+
voice: z.string().max(1000).optional().describe("One paragraph on how the takes should sound."),
|
|
8682
|
+
channels: z.array(z.enum(["page", "email", "social"])).optional(),
|
|
8683
|
+
grid_size: z.number().int().min(2).max(16).optional(),
|
|
8684
|
+
approve_after: z.number().int().min(1).max(30).optional().describe("Clean issues before the approval gate opens itself."),
|
|
8685
|
+
auto_publish: z.boolean().optional().describe("`set`: true = this is automated news, publish each issue on its own with no approval click. A story that fails its grounding check is dropped, never published. false = back to the trust ladder (approve_after)."),
|
|
8686
|
+
url: z.string().optional().describe("`add-source` / `remove-source`: the feed URL. A private address, an http URL or a slow host is refused by name."),
|
|
8687
|
+
name: z.string().optional(),
|
|
8688
|
+
source_topics: z.array(z.string()).optional().describe("`add-source`: the topics this source covers."),
|
|
8689
|
+
weight: z.number().min(0).max(3).optional().describe("`add-source`: how strongly this source pulls the ranking. Default 1."),
|
|
8690
|
+
from: z.string().optional().describe("`clone`: the group whose desk to copy. You must control both groups."),
|
|
8691
|
+
limit: z.number().int().min(1).max(25).optional().describe("`suggest` and `setup`: how many catalogue sources. Default 12."),
|
|
8692
|
+
}),
|
|
8693
|
+
response: () => z.object({
|
|
8694
|
+
ok: z.boolean(),
|
|
8695
|
+
desk: z.record(z.string(), z.unknown()).optional(),
|
|
8696
|
+
sources: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
8697
|
+
view: z.record(z.string(), z.unknown()).optional().describe("`get`: the desk with feed states, the last issues and their cost."),
|
|
8698
|
+
suggestions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
8699
|
+
workflowId: z.string().optional().describe("`setup`: the armed daily-magazine workflow."),
|
|
8700
|
+
collected: z.number().optional().describe("`logos`: logos stored this call."),
|
|
8701
|
+
remaining: z.number().optional().describe("`logos`: sources still to try."),
|
|
8702
|
+
stories: z.array(z.record(z.string(), z.unknown())).optional().describe("`source-stories`: {url, title, excerpt, at, picked} newest first; picked = the issue date it ran in."),
|
|
8703
|
+
skipped: z.array(z.object({ url: z.string(), error: z.string() })).optional().describe("Sources that were refused or over the plan cap, each with the reason."),
|
|
8704
|
+
error: z.string().optional(),
|
|
8705
|
+
}),
|
|
8706
|
+
effect: "ask", cost: "free", reversible: true, idempotent: false, auth: "manage_workspace",
|
|
8707
|
+
examples: [{ workspace: "acme", op: "setup", topics: ["crypto", "sui"] }],
|
|
8708
|
+
}),
|
|
8709
|
+
"news:ingest": receiver({
|
|
8710
|
+
receiver: "news:ingest",
|
|
8711
|
+
summary: "Fetch the feeds that are due — once each, for every group that follows them. Conditional GET, size and time caps, every URL and redirect hop through the SSRF guard. Run by the platform clock; not a per-group call",
|
|
8712
|
+
request: () => z.object({ limit: z.number().int().min(1).max(50).optional() }),
|
|
8713
|
+
response: () => z.object({
|
|
8714
|
+
ok: z.boolean(),
|
|
8715
|
+
feeds_due: z.number().optional(), fetched: z.number().optional(), not_modified: z.number().optional(),
|
|
8716
|
+
failed: z.number().optional(), items_new: z.number().optional(),
|
|
8717
|
+
truncated: z.number().optional().describe("Feeds larger than the 1 MB read cap: read from their head (newest items), not refused."),
|
|
8718
|
+
capped: z.boolean().optional().describe("True when more feeds were due than this tick would fetch."),
|
|
8719
|
+
refused: z.record(z.string(), z.number()).optional(),
|
|
8720
|
+
error: z.string().optional(),
|
|
8721
|
+
}),
|
|
8722
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: true, auth: "platform",
|
|
8723
|
+
}),
|
|
8724
|
+
"news:digest": receiver({
|
|
8725
|
+
receiver: "news:digest",
|
|
8726
|
+
surfaces: { chat: true, mcp: true },
|
|
8727
|
+
summary: "Pick and rank the day's stories for one group, write each take from the article only, find a picture, and store them as today's draft issue. Returns the issue id and honest counts — fetched · eligible · folded · kept · capped (with the budget that bit) · skipped by reason. Re-running the same day replaces the picks and keeps the issue",
|
|
8728
|
+
request: () => z.object({ workspace: z.string().optional().describe("Group slug. Omit for your own."), refresh: z.boolean().optional().describe("Set by the hourly refresh workflow: only narrows — refused once the day's run has begun (the desk's hour on the issue's day), so an issue a person may be reviewing is never rebuilt.") }),
|
|
8729
|
+
response: () => z.object({
|
|
8730
|
+
ok: z.boolean(), issueId: z.string().optional(),
|
|
8731
|
+
counts: z.record(z.string(), z.unknown()).optional(),
|
|
8732
|
+
held: z.string().optional().describe("Why the issue is held (e.g. `ungrounded`): a person must fix or drop a story before it can publish."),
|
|
8733
|
+
cost_credits: z.number().optional(),
|
|
8734
|
+
error: z.string().optional(),
|
|
8735
|
+
}),
|
|
8736
|
+
effect: "ask", cost: "variable", reversible: true, idempotent: false, auth: "manage_workspace",
|
|
8737
|
+
}),
|
|
8738
|
+
"news:issue": receiver({
|
|
8739
|
+
receiver: "news:issue",
|
|
8740
|
+
surfaces: { chat: true, mcp: true },
|
|
8741
|
+
summary: "Build the issue from its picks: one editable page (lead, grid, source strip) that the email and the post drafts are both made from. Rebuilding replaces the page's content and keeps its address",
|
|
8742
|
+
request: () => z.object({
|
|
8743
|
+
refresh: z.boolean().optional().describe("Set by the hourly refresh workflow: only narrows — refused once the day's run has begun (the desk's hour on the issue's day), so an issue a person may be reviewing is never rebuilt."),
|
|
8744
|
+
workspace: z.string().optional().describe("Group slug. Omit for your own."),
|
|
8745
|
+
issueId: z.string().optional().describe("Default: today's draft issue."),
|
|
8746
|
+
}),
|
|
8747
|
+
response: () => z.object({
|
|
8748
|
+
ok: z.boolean(), issueId: z.string().optional(), pageSlug: z.string().optional(), url: z.string().optional(),
|
|
8749
|
+
drafts: z.number().optional().describe("Social drafts queued, awaiting approval in /in/social."),
|
|
8750
|
+
gate_open: z.boolean().optional().describe("True when the desk has run enough clean issues that publishing needs no person. The workflow's `trusted?` condition reads this."),
|
|
8751
|
+
error: z.string().optional(),
|
|
8752
|
+
}),
|
|
8753
|
+
effect: "ask", cost: "variable", reversible: true, idempotent: true, auth: "manage_workspace",
|
|
8754
|
+
}),
|
|
8755
|
+
"news:publish": receiver({
|
|
8756
|
+
receiver: "news:publish",
|
|
8757
|
+
surfaces: { chat: true, mcp: true },
|
|
8758
|
+
summary: "Publish the issue: the page goes live, the email is scheduled to confirmed subscribers (suppression and unsubscribe unchanged) and the post drafts are queued. Reads the PAGE at publish time, so an edit is what goes out. A held issue is refused by name. Needs a person unless the desk's gate has opened itself: a closed gate opens only for a signed-in person or a workflow run a person approved, never for a flag in the request",
|
|
8759
|
+
request: () => z.object({
|
|
8760
|
+
workspace: z.string().optional().describe("Group slug. Omit for your own."),
|
|
8761
|
+
issueId: z.string().optional().describe("Default: today's issue."),
|
|
8762
|
+
approve: z.boolean().optional().describe("A signed-in person's intent to publish. On its own it opens nothing: a closed gate answers `held:needs_approval` unless the caller is a signed-in person or a workflow run whose approval step a person resolved."),
|
|
8763
|
+
}),
|
|
8764
|
+
response: () => z.object({
|
|
8765
|
+
ok: z.boolean(), status: z.string().optional(), broadcastId: z.string().optional(), url: z.string().optional(),
|
|
8766
|
+
edited_ratio: z.number().optional(), gate_open: z.boolean().optional(),
|
|
8767
|
+
error: z.string().optional(),
|
|
8768
|
+
}),
|
|
8769
|
+
effect: "signal", cost: "variable", reversible: false, idempotent: false, auth: "manage_workspace",
|
|
8770
|
+
}),
|
|
8771
|
+
"news:react": receiver({
|
|
8772
|
+
receiver: "news:react",
|
|
8773
|
+
surfaces: { chat: true, mcp: true },
|
|
8774
|
+
summary: "More or less of a story: strengthens or resists the desk's paths to that source and its topics, so tomorrow's order changes. One reaction of a kind per person per story counts",
|
|
8775
|
+
request: () => z.object({
|
|
8776
|
+
workspace: z.string().optional().describe("Group slug. Omit for your own."),
|
|
8777
|
+
issueId: z.string(), itemUrl: z.string().describe("The story's article URL, as on the issue."),
|
|
8778
|
+
reaction: z.enum(["more", "less", "tap", "skip"]),
|
|
8779
|
+
}),
|
|
8780
|
+
response: () => z.object({ ok: z.boolean(), deduped: z.boolean().optional(), error: z.string().optional() }),
|
|
8781
|
+
effect: "signal", cost: "free", reversible: false, idempotent: true, auth: "member",
|
|
8782
|
+
}),
|
|
8783
|
+
"news:assist": receiver({
|
|
8784
|
+
receiver: "news:assist",
|
|
8785
|
+
summary: "A story's quick actions — summarise, expand, research, article in the group's voice, or related stories. Asked once, kept for everyone: a cached answer comes back instantly; a miss runs the model the route's paths favour (assist:<kind>: → model:<id>), falls to the next on failure, and stores the answer. Anyone reads cached answers of published stories; a signed-in person may start one (20 a day per group); owners may force a fresh one. A verdict marks or warns the model that wrote the answer",
|
|
8786
|
+
request: () => z.object({
|
|
8787
|
+
workspace: z.string().describe("The magazine's group slug."),
|
|
8788
|
+
itemUrl: z.string().describe("The story's article URL, as on the issue."),
|
|
8789
|
+
kind: z.enum(["summarise", "expand", "research", "article", "related", "journey"]).describe("What to do with the story. related and journey need no model: stories sharing its tags; the story's path from its feed to its posts."),
|
|
8790
|
+
fresh: z.boolean().optional().describe("Owners only: run the model again even though an answer is stored."),
|
|
8791
|
+
verdict: z.enum(["up", "down"]).optional().describe("Judge the stored answer instead: marks or warns the model that wrote it."),
|
|
8792
|
+
}),
|
|
8793
|
+
response: () => z.object({
|
|
8794
|
+
ok: z.boolean(), kind: z.string().optional(), text: z.string().optional(), model: z.string().optional(), cached: z.boolean().optional(), ms: z.number().optional(),
|
|
8795
|
+
related: z.array(z.object({ title: z.string(), url: z.string(), source: z.string(), date: z.string(), shared: z.array(z.string()) })).optional(),
|
|
8796
|
+
journey: z.array(z.object({ step: z.string(), at: z.number().nullable(), label: z.string(), detail: z.string().optional(), href: z.string().optional() })).optional(),
|
|
8797
|
+
judged: z.string().optional(), error: z.string().optional(),
|
|
8798
|
+
}),
|
|
8799
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: true, auth: "public",
|
|
8800
|
+
}),
|
|
8801
|
+
"news:edit": receiver({
|
|
8802
|
+
receiver: "news:edit",
|
|
8803
|
+
summary: "A person edits an issue by hand: rate a story 1 to 10 (10 leads the issue, 1 sinks it), rewrite its headline or take inline, or remove it (undoable). The page is rebuilt in the new order, a published issue's page included — the email already sent is not. A rating teaches two kinds of path by its change from the last: the desk's (tomorrow's issue) and the person's own (reader:<slug>: → source / tag)",
|
|
8804
|
+
request: () => z.object({
|
|
8805
|
+
workspace: z.string().optional().describe("Group slug. Omit for your own; a named group must be one you control."),
|
|
8806
|
+
issueId: z.string().describe("The issue the story is on."),
|
|
8807
|
+
itemUrl: z.string().describe("The story's article URL, as on the issue."),
|
|
8808
|
+
action: z.enum(["rate", "remove", "restore", "text"]).describe("rate sets the story's score; remove takes it off the issue; restore puts it back; text saves a rewritten headline and/or take."),
|
|
8809
|
+
value: z.number().int().min(0).max(10).optional().describe("rate: 1 to 10; 0 clears the rating."),
|
|
8810
|
+
headline: z.string().max(300).optional().describe("text: the new headline; empty returns the article's own."),
|
|
8811
|
+
take: z.string().max(1200).optional().describe("text: the new take (counts as checked — a person wrote it)."),
|
|
8812
|
+
}),
|
|
8813
|
+
response: () => z.object({ ok: z.boolean(), rating: z.number().optional(), removed: z.boolean().optional(), learned: z.number().optional(), error: z.string().optional() }),
|
|
8814
|
+
effect: "ask", cost: "free", reversible: true, idempotent: false, auth: "manage_workspace",
|
|
8815
|
+
}),
|
|
7836
8816
|
// ── Broadcast (newsletter) ────────────────────────────────────────────────
|
|
7837
8817
|
"broadcast:create": receiver({
|
|
7838
8818
|
receiver: "broadcast:create",
|
|
@@ -8009,6 +8989,28 @@ export const RECEIVERS = {
|
|
|
8009
8989
|
response: () => z.object({ ok: z.boolean() }),
|
|
8010
8990
|
effect: "ask", cost: "free", reversible: false, idempotent: true, auth: "public",
|
|
8011
8991
|
}),
|
|
8992
|
+
// audience:consent — the signed-in PERSON grants or withdraws their own consent. The
|
|
8993
|
+
// actor is the attested session, never a body field; operators, staff, agent keys and
|
|
8994
|
+
// workflow steps are refused (`consent_is_the_persons`). Ruling: Tony, 2026-10-08.
|
|
8995
|
+
"audience:consent": receiver({
|
|
8996
|
+
receiver: "audience:consent",
|
|
8997
|
+
summary: "The signed-in person grants or withdraws their OWN consent for one channel (email, sms, push, call, ads) in one group — recorded with source `self` and the time; nobody else can write it",
|
|
8998
|
+
request: () => z.object({
|
|
8999
|
+
workspace: z.string().describe("The group the consent is given to. Ads consent lands on the person's own row there, `actor:<uid>`, where the ad audience gate reads it; email lands on their verified address, where the send gate reads it."),
|
|
9000
|
+
channel: z.enum(["email", "sms", "push", "call", "ads"]),
|
|
9001
|
+
state: z.enum(["granted", "withdrawn"]),
|
|
9002
|
+
actorId: z.string().optional().describe("Optional, and only ever checked: it must be the caller themselves. The actor is the attested session; naming anyone else is refused."),
|
|
9003
|
+
}),
|
|
9004
|
+
response: () => z.object({
|
|
9005
|
+
ok: z.boolean(),
|
|
9006
|
+
channel: z.string().optional(),
|
|
9007
|
+
state: z.string().optional(),
|
|
9008
|
+
source: z.literal("self").optional(),
|
|
9009
|
+
at: z.number().optional().describe("Epoch ms the decision was recorded"),
|
|
9010
|
+
error: z.string().optional().describe("no_attested_address — sms, call and push (and email without a verified address) have no address the send gate reads, so nothing is written"),
|
|
9011
|
+
}),
|
|
9012
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "write",
|
|
9013
|
+
}),
|
|
8012
9014
|
// ── Winback batch ─────────────────────────────────────────────────────────
|
|
8013
9015
|
"audience:winback": receiver({
|
|
8014
9016
|
receiver: "audience:winback",
|
|
@@ -8255,12 +9257,23 @@ export const RECEIVERS = {
|
|
|
8255
9257
|
fn: z.string().describe("Function name from FN_MAP (e.g. 'optimal_route', 'actionable_hypotheses')"),
|
|
8256
9258
|
args: z.record(z.string(), z.unknown()).optional().describe("Named arguments matching the function's param list"),
|
|
8257
9259
|
workspace: z.string().optional().describe("Workspace slug for authority context"),
|
|
9260
|
+
// tql-edge contract #12: read the DO itself instead of the 30 s isolate memo —
|
|
9261
|
+
// exact for a write patched through /brain/patch, never a sub-50 ms read.
|
|
9262
|
+
// Declared here or the /api/ask edge strips it before the resolver sees it.
|
|
9263
|
+
fresh: z.boolean().optional().describe("Bypass the edge memo and read the graph from BrainDO (slower, exact)"),
|
|
8258
9264
|
}),
|
|
8259
9265
|
response: () => z.object({
|
|
8260
9266
|
ok: z.boolean(),
|
|
8261
9267
|
fn: z.string(),
|
|
8262
9268
|
rows: z.array(z.record(z.string(), z.unknown())),
|
|
8263
9269
|
error: z.string().optional(),
|
|
9270
|
+
// tql-edge C6: the answer is solved over the graph in RAM (@oneie/sdk/edge).
|
|
9271
|
+
// `edge` says whether it was; `asOf` is the graph's own timestamp (a memo read
|
|
9272
|
+
// is never exact — contract #12); `truncated` appears ONLY when a type the fun
|
|
9273
|
+
// touched was cut from the snapshot (contract #13).
|
|
9274
|
+
edge: z.boolean().optional(),
|
|
9275
|
+
asOf: z.string().optional(),
|
|
9276
|
+
truncated: z.array(z.string()).optional(),
|
|
8264
9277
|
}),
|
|
8265
9278
|
effect: "ask", cost: "variable", reversible: false, idempotent: true, auth: "member",
|
|
8266
9279
|
examples: [{ fn: "optimal_route", args: { $from: "actor-123", $skill: "writing" }, workspace: "acme" }],
|
|
@@ -8769,6 +9782,62 @@ export const RECEIVERS = {
|
|
|
8769
9782
|
{ prefix: "ads", limit: 1000 },
|
|
8770
9783
|
],
|
|
8771
9784
|
}),
|
|
9785
|
+
// media:films — the films the site plays, with this group's stars and tags (text/library.md).
|
|
9786
|
+
//
|
|
9787
|
+
// The catalog is code (`one.ie/web/src/lib/film/catalog.ts`): every entry plays from
|
|
9788
|
+
// public/film/ through the FilmPlayer block with exactly `props`, and `backgrounds` are the
|
|
9789
|
+
// bgEffect keys that put it behind any block. Stars and tags are the group's own — entity_tags
|
|
9790
|
+
// rows keyed `film:<id>`, written by `entity:tag` (a star is the tag `star`). So "the films
|
|
9791
|
+
// tagged hero" is one call here, and placing one is `pages:add-block` with
|
|
9792
|
+
// `{component:"FilmPlayer", props}` or a block's `bgEffect`. Resolver: resolvers/media.ts.
|
|
9793
|
+
"media:films": receiver({
|
|
9794
|
+
receiver: "media:films",
|
|
9795
|
+
surfaces: { mcp: true, chat: true },
|
|
9796
|
+
summary: "The films the site plays — the key ad, the told story, the playbook, the Hook film, the home film and each of its fifteen scenes, the Hook workshop — each with its poster, the FilmPlayer props that play it, the bgEffect keys that put it behind a block, and this group's stars and tags. Filter by `tag` or `starred`. To place one: pages:add-block {component:\"FilmPlayer\", props}; to put one behind a block: set its bgEffect to a `backgrounds` key. To star or tag: entity:tag {id:\"film:<id>\", add:[\"star\"|tag]}. With a tag, `reel` is that tag's home-film scenes played as one film — a video made from a tag, placed the same way.",
|
|
9797
|
+
request: () => z.object({
|
|
9798
|
+
workspace: z.string().optional().describe("Group slug whose stars and tags to read. Omit for your own. Honoured only if you may read it."),
|
|
9799
|
+
tag: z.string().optional().describe("Only films carrying this tag in this group, e.g. \"hero\" or \"home\". `star` is the starred ones."),
|
|
9800
|
+
starred: z.boolean().optional().describe("true = only starred films (the same as tag:\"star\")."),
|
|
9801
|
+
kind: z.enum(["film", "scene"]).optional().describe("film = a whole film; scene = one scene of the home film, played on its own."),
|
|
9802
|
+
}),
|
|
9803
|
+
response: () => z.object({
|
|
9804
|
+
ok: z.boolean(),
|
|
9805
|
+
workspace: z.string().optional(),
|
|
9806
|
+
items: z.array(z.object({
|
|
9807
|
+
id: z.string().describe("Catalog id; its stars and tags live under entity id `film:<id>`."),
|
|
9808
|
+
name: z.string(),
|
|
9809
|
+
desc: z.string(),
|
|
9810
|
+
kind: z.enum(["film", "scene"]),
|
|
9811
|
+
parent: z.string().optional().describe("For a scene, the film it belongs to."),
|
|
9812
|
+
poster: z.string().describe("Site path of the poster JPEG."),
|
|
9813
|
+
play: z.string().describe("Site path that plays it on its own page — shareable."),
|
|
9814
|
+
component: z.literal("FilmPlayer").describe("The Puck block that places it."),
|
|
9815
|
+
props: z.record(z.string(), z.unknown()).describe("The FilmPlayer props — pass verbatim to pages:add-block."),
|
|
9816
|
+
shapes: z.array(z.string()).describe("Aspect values the film plays in: 1x1 · 4x5 · 9x16 · 16x9."),
|
|
9817
|
+
backgrounds: z.array(z.string()).describe("bgEffect keys that put this film behind any block. Empty = not offered as a background."),
|
|
9818
|
+
tags: z.array(z.string()).describe("This group's tags on it, `star` included."),
|
|
9819
|
+
starred: z.boolean(),
|
|
9820
|
+
})).optional(),
|
|
9821
|
+
total: z.number().optional().describe("Items in this answer, after filtering. The catalog is small and never paged — this is exact."),
|
|
9822
|
+
tags: z.record(z.string(), z.number()).optional().describe("Every tag this group has put on any film, with how many films carry it — the filter list."),
|
|
9823
|
+
reel: z.object({
|
|
9824
|
+
name: z.string(),
|
|
9825
|
+
scenes: z.array(z.string()).describe("Home-film scene keys, in film order."),
|
|
9826
|
+
duration: z.number().describe("Seconds — the windows added up."),
|
|
9827
|
+
play: z.string().describe("Site path that plays the reel on its own page."),
|
|
9828
|
+
component: z.literal("FilmPlayer"),
|
|
9829
|
+
props: z.record(z.string(), z.unknown()).describe("Pass verbatim to pages:add-block — `scenes` is the reel."),
|
|
9830
|
+
}).optional().describe("With `tag` or `starred`: the home-film scenes that carry it, as ONE film played back to back. ABSENT when fewer than two scenes carry it. Whole films in the tag are not in the reel (a reel is windows on one master)."),
|
|
9831
|
+
error: z.string().optional(),
|
|
9832
|
+
}),
|
|
9833
|
+
effect: "ask", cost: "free", idempotent: true, reversible: true, settles: "none", auth: "member",
|
|
9834
|
+
examples: [
|
|
9835
|
+
{},
|
|
9836
|
+
{ starred: true },
|
|
9837
|
+
{ tag: "hero" },
|
|
9838
|
+
{ kind: "scene" },
|
|
9839
|
+
],
|
|
9840
|
+
}),
|
|
8772
9841
|
// media:upload — bytes in, one key out, under `{workspace}/media/`.
|
|
8773
9842
|
//
|
|
8774
9843
|
// TWO SHAPES BECAUSE AN AGENT HAS NEITHER A FILE PICKER NOR A MULTIPART BODY. The
|
|
@@ -8890,11 +9959,14 @@ export const RECEIVERS = {
|
|
|
8890
9959
|
"calendar:schedule-meeting": receiver({
|
|
8891
9960
|
receiver: "calendar:schedule-meeting",
|
|
8892
9961
|
summary: "Sends a scheduling email to a contact and returns status",
|
|
8893
|
-
|
|
9962
|
+
// workspace: the TARGET group (a child an ancestor schedules for); defaults to the caller's.
|
|
9963
|
+
request: () => z.object({ amountLabel: z.unknown().optional(), email: z.unknown().optional(), name: z.unknown().optional(), stepName: z.unknown().optional(), workspace: z.unknown().optional() }).passthrough(),
|
|
8894
9964
|
// bookUrl is the PLAIN public booking page (/u/<slug>/book) — never a key, so it
|
|
8895
9965
|
// grants no membership. error "forbidden": no caller, or a group the caller does
|
|
8896
|
-
// not control. reason: the consent refusal (a declined or suppressed address),
|
|
8897
|
-
// "email_failed" when the provider refused the send (ok:true, bookUrl still returned)
|
|
9966
|
+
// not control. reason: the consent refusal (a declined or suppressed address),
|
|
9967
|
+
// "email_failed" when the provider refused the send (ok:true, bookUrl still returned),
|
|
9968
|
+
// "one_address_per_call" when `email` names more than one address (a list is refused,
|
|
9969
|
+
// never split), or "rate_limited" past `limit` sends per caller per `window`.
|
|
8898
9970
|
response: () => z.object({
|
|
8899
9971
|
ok: z.boolean(),
|
|
8900
9972
|
emailed: z.boolean().optional(),
|
|
@@ -8902,6 +9974,8 @@ export const RECEIVERS = {
|
|
|
8902
9974
|
bookUrl: z.string().optional(),
|
|
8903
9975
|
error: z.enum(["forbidden"]).optional(),
|
|
8904
9976
|
reason: z.string().optional(),
|
|
9977
|
+
limit: z.number().optional(),
|
|
9978
|
+
window: z.enum(["day"]).optional(),
|
|
8905
9979
|
}),
|
|
8906
9980
|
effect: "signal", auth: "session", reversible: false,
|
|
8907
9981
|
}),
|
|
@@ -8912,6 +9986,13 @@ export const RECEIVERS = {
|
|
|
8912
9986
|
response: () => z.unknown(),
|
|
8913
9987
|
effect: "ask", auth: "member", reversible: false,
|
|
8914
9988
|
}),
|
|
9989
|
+
"campaign:rebuild": receiver({
|
|
9990
|
+
receiver: "campaign:rebuild",
|
|
9991
|
+
summary: "Runs the ELEVATE build again for a campaign that is stuck or failed; brief defaults to the campaign name",
|
|
9992
|
+
request: () => z.object({ campaignId: z.unknown().optional(), brief: z.unknown().optional() }).passthrough(),
|
|
9993
|
+
response: () => z.unknown(),
|
|
9994
|
+
effect: "ask", auth: "member", reversible: false,
|
|
9995
|
+
}),
|
|
8915
9996
|
"campaign:update": receiver({
|
|
8916
9997
|
receiver: "campaign:update",
|
|
8917
9998
|
summary: "Updates a campaign's name or a specific section's content, and returns the updated campaign info",
|
|
@@ -8968,6 +10049,123 @@ export const RECEIVERS = {
|
|
|
8968
10049
|
response: () => z.unknown(),
|
|
8969
10050
|
effect: "ask", auth: "owner", reversible: false,
|
|
8970
10051
|
}),
|
|
10052
|
+
// ── content everywhere — handlers in resolvers/content.ts (text/content-everywhere.md) ──
|
|
10053
|
+
// One source + one campaign → a draft for every format it fits, as things. Nothing
|
|
10054
|
+
// publishes here: every variant lands 'draft' and waits for a person.
|
|
10055
|
+
"content:everywhere": receiver({
|
|
10056
|
+
receiver: "content:everywhere",
|
|
10057
|
+
summary: "Put one piece of content everywhere: one video or image + one campaign → a native draft for every social format and every ad format it fits, written from the campaign's playbook stage, filed under the campaign as content things, with every misfit derived or named impossible. Counts what was made, failed, derived and skipped; nothing publishes — the reply links to the campaign page where a person approves each draft.",
|
|
10058
|
+
request: () => z.object({
|
|
10059
|
+
workspace: z.string().optional().describe("Group slug. Omit for the attested workspace. A scope REQUEST — refused (forbidden) when the authority walk says no, never swapped for your own."),
|
|
10060
|
+
campaignId: z.string().describe("The campaign's gid (world_groups.gid tagged `campaign`) in this workspace — the campaign the drafts are filed under."),
|
|
10061
|
+
mediaUrl: z.string().describe("The source video or image url — an attachment in the conversation, or an item from media:list."),
|
|
10062
|
+
mediaType: z.enum(["image", "video"]).describe("What the source is."),
|
|
10063
|
+
text: z.string().min(1).describe("The message every format is written from — the person's words."),
|
|
10064
|
+
stageKey: z.string().optional().describe("The ELEVATE stage (0–10, or the campaign's own section key) that briefs every draft. Change the stage, the words change."),
|
|
10065
|
+
width: z.number().optional().describe("Source width in px, when known — decides which aspect formats fit as-is."),
|
|
10066
|
+
height: z.number().optional().describe("Source height in px, when known."),
|
|
10067
|
+
durationS: z.number().optional().describe("Source duration in seconds, for a video."),
|
|
10068
|
+
origin: z.string().optional().describe("Absolute origin to resolve a relative mediaUrl for the render service (the route passes url.origin)."),
|
|
10069
|
+
}),
|
|
10070
|
+
response: () => z.object({
|
|
10071
|
+
ok: z.boolean(),
|
|
10072
|
+
error: z.string().optional().describe("Named: forbidden · bad_request · campaign_not_found · no_db."),
|
|
10073
|
+
postId: z.string().optional().describe("The master social_posts row the variants hang off."),
|
|
10074
|
+
sourceTid: z.string().optional().describe("The source content thing (world_things type 'content', kind:source)."),
|
|
10075
|
+
campaign: z.object({ gid: z.string(), name: z.string(), url: z.string() }).optional(),
|
|
10076
|
+
campaignId: z.string().optional(),
|
|
10077
|
+
stage: z.string().nullable().optional(),
|
|
10078
|
+
source: z.object({ kind: z.string(), aspect: z.string(), durationS: z.number().optional() }).optional(),
|
|
10079
|
+
formats: z.object({ total: z.number(), accounted: z.number(), unaccounted: z.array(z.string()) }).optional().describe("Every catalog format is in exactly one of social, ads, derived, impossible or skipped; `unaccounted` is empty or the answer is wrong."),
|
|
10080
|
+
counts: z.record(z.string(), z.number()).optional().describe("drafted · failed · ads · adsFailed · derived · derivedMade · derivedFailed · impossible · skipped."),
|
|
10081
|
+
variants: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
10082
|
+
errors: z.array(z.string()).optional(),
|
|
10083
|
+
ads: z.object({ drafts: z.array(z.record(z.string(), z.unknown())), error: z.string().nullable() }).optional(),
|
|
10084
|
+
derived: z.object({ made: z.array(z.record(z.string(), z.unknown())), failed: z.array(z.record(z.string(), z.unknown())) }).optional(),
|
|
10085
|
+
impossible: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
10086
|
+
skipped: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
10087
|
+
published: z.number().optional().describe("Always 0 — this door never publishes."),
|
|
10088
|
+
link: z.string().optional().describe("The campaign page: /u/<slug>/marketing/campaigns/<campaign slug or gid>."),
|
|
10089
|
+
reply: z.string().optional().describe("One sentence for the conversation, carrying the link."),
|
|
10090
|
+
}),
|
|
10091
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: false, auth: "manage_things",
|
|
10092
|
+
surfaces: { chat: true },
|
|
10093
|
+
examples: [{ campaignId: "01a04decf44a2caf7353139c", mediaUrl: "https://one.ie/api/product-image/one/media/clip.mp4", mediaType: "video", text: "One video becomes every post.", stageKey: "1" }],
|
|
10094
|
+
}),
|
|
10095
|
+
"content:derive": receiver({
|
|
10096
|
+
receiver: "content:derive",
|
|
10097
|
+
summary: "Derive every format a source does not fit as-is — reframe (9:16 · 1:1 · 4:5 · 16:9), stills, slides, PDF pages, text-only — from one source content thing, recording each derived asset as a thing. Idempotent: what was already derived is reported `already`, never made twice. Wraps deriveForPlan (lib/content-derive.ts).",
|
|
10098
|
+
request: () => z.object({
|
|
10099
|
+
workspace: z.string().optional().describe("Group slug. Omit for the attested workspace; refused when not yours."),
|
|
10100
|
+
sourceTid: z.string().describe("The source content thing's tid (content:everywhere answers it as `sourceTid`)."),
|
|
10101
|
+
}),
|
|
10102
|
+
response: () => z.object({
|
|
10103
|
+
ok: z.boolean(),
|
|
10104
|
+
error: z.string().optional().describe("Named: forbidden · bad_request · source_not_found · no_db."),
|
|
10105
|
+
sourceTid: z.string().optional(),
|
|
10106
|
+
campaignId: z.string().optional(),
|
|
10107
|
+
postId: z.string().optional().describe("The master social_posts row the source thing points at ('' when it points at none)."),
|
|
10108
|
+
digest: z.string().optional().describe("What the brand guardian reads: one line per variant and per ad creative of this post (`id | what | text`), cut fairly to fit agent:run's 16,000-char sealed-input guard. Lines that were cut end in `[cut: N of M chars shown]`."),
|
|
10109
|
+
review: z.record(z.string(), z.unknown()).optional().describe("About the digest: total · shown · omitted (ids with no room) · truncated · truncatedIds · budget · jsonChars · items[{id,kind,platform,format,chars,shown,truncated}] · error."),
|
|
10110
|
+
made: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
10111
|
+
failed: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
10112
|
+
impossible: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
10113
|
+
already: z.number().optional().describe("Derivations skipped because a derived thing for that format already exists."),
|
|
10114
|
+
counts: z.record(z.string(), z.number()).optional().describe("planned · made · failed · impossible · already."),
|
|
10115
|
+
}),
|
|
10116
|
+
effect: "ask", cost: "variable", reversible: false, idempotent: true, auth: "manage_things",
|
|
10117
|
+
}),
|
|
10118
|
+
"content:schedule": receiver({
|
|
10119
|
+
receiver: "content:schedule",
|
|
10120
|
+
summary: "Spread a post's approved variants across the calendar: one per network per day starting tomorrow 09:00, writing social_post_variants.scheduled_at + status 'scheduled'. Facebook is the only network with a live connection; every other network and every ad is scheduled as a draft and says so in its note (Instagram and the ad pushers answered 404 on 2026-10-12; Meta Ads is not connected).",
|
|
10121
|
+
request: () => z.object({
|
|
10122
|
+
workspace: z.string().optional().describe("Group slug. Omit for the attested workspace; refused when not yours."),
|
|
10123
|
+
postId: z.string().optional().describe("The master social_posts row whose variants to schedule. Required unless `variantId` is given."),
|
|
10124
|
+
variantId: z.string().optional().describe("Move exactly ONE variant of this workspace to `at` instead of re-slotting a post. Only a 'scheduled' or 'approved' row moves; a published, failed or skipped one is refused. A bare world key is refused (moving a slot to now arms a real publish)."),
|
|
10125
|
+
at: z.number().optional().describe("Unix seconds (an integer) for `variantId`. Required with `variantId`; ignored without it."),
|
|
10126
|
+
all: z.boolean().optional().describe("true when a person approved the whole run (a workflow's human step): schedules 'draft' variants as well as 'approved' ones."),
|
|
10127
|
+
timezone: z.string().optional().describe("IANA zone for the 09:00 slot. Default UTC — a workspace carries no timezone setting today."),
|
|
10128
|
+
}),
|
|
10129
|
+
response: () => z.object({
|
|
10130
|
+
ok: z.boolean(),
|
|
10131
|
+
error: z.string().optional().describe("Named: forbidden · bad_request · post_not_found · no_db."),
|
|
10132
|
+
postId: z.string().optional(),
|
|
10133
|
+
campaignId: z.string().nullable().optional(),
|
|
10134
|
+
scheduled: z.array(z.object({ id: z.string(), platform: z.string(), format: z.string(), at: z.number(), live: z.boolean(), note: z.string().optional() })).optional(),
|
|
10135
|
+
skipped: z.array(z.object({ id: z.string(), platform: z.string(), format: z.string(), reason: z.string() })).optional().describe("Variants held back because the brand guardian's verdict (meta.verdict, written by content:verdicts) is 'revise'; each names the reason. No verdict behaves as before."),
|
|
10136
|
+
failed: z.array(z.object({ id: z.string(), platform: z.string(), format: z.string(), error: z.string() })).optional(),
|
|
10137
|
+
ads: z.number().optional().describe("Ad creatives under this post noted as drafts (no live connection)."),
|
|
10138
|
+
counts: z.record(z.string(), z.number()).optional(),
|
|
10139
|
+
timezone: z.string().optional(),
|
|
10140
|
+
summary: z.string().optional().describe("One line per network for the board."),
|
|
10141
|
+
variantId: z.string().optional().describe("Set when `variantId` was given: the variant that moved."),
|
|
10142
|
+
platform: z.string().optional(),
|
|
10143
|
+
format: z.string().optional(),
|
|
10144
|
+
at: z.number().optional().describe("The slot the variant now holds (unix seconds)."),
|
|
10145
|
+
live: z.boolean().optional().describe("Single-variant answer: true when the network has a live connection."),
|
|
10146
|
+
note: z.string().optional(),
|
|
10147
|
+
}),
|
|
10148
|
+
effect: "ask", cost: "free", reversible: true, idempotent: true, auth: "manage_things",
|
|
10149
|
+
}),
|
|
10150
|
+
"content:verdicts": receiver({
|
|
10151
|
+
receiver: "content:verdicts",
|
|
10152
|
+
summary: "Write the brand guardian's verdict on EACH draft and ad creative of a post. Parses one line per item (`<id>: approve|revise - reason`) from the review step's text and saves meta.verdict + verdict_reason on every social_post_variants row and every creative-asset thing; an item the reviewer never mentioned is saved as 'no-verdict', never as approval. Marks content:review -> <platform>:<format> on approve, warns on revise and on no-verdict. Ids are recomputed from the workspace's own rows, never taken from the caller. Does not change any status — the human approve step is still the gate.",
|
|
10153
|
+
request: () => z.object({
|
|
10154
|
+
workspace: z.string().optional().describe("Group slug. Omit for the attested workspace; refused when not yours."),
|
|
10155
|
+
postId: z.string().describe("The master social_posts row whose variants and ad creatives were reviewed (content:derive answers it as `postId`)."),
|
|
10156
|
+
text: z.string().describe("The reviewer's reply: one line per item id, `<id>: approve - reason` or `<id>: revise - reason`."),
|
|
10157
|
+
}),
|
|
10158
|
+
response: () => z.object({
|
|
10159
|
+
ok: z.boolean(),
|
|
10160
|
+
error: z.string().optional().describe("Named: forbidden · bad_request · post_not_found · no_db."),
|
|
10161
|
+
postId: z.string().optional(),
|
|
10162
|
+
counts: z.record(z.string(), z.number()).optional().describe("items · approve · revise · noVerdict · failed (verdict could not be saved) · unknown (ids in the reply that are not items)."),
|
|
10163
|
+
verdicts: z.array(z.record(z.string(), z.unknown())).optional().describe("One per item: id · kind (variant|ad) · platform · format · verdict (approve|revise|no-verdict) · reason · written."),
|
|
10164
|
+
unknownIds: z.array(z.string()).optional(),
|
|
10165
|
+
summary: z.string().optional().describe("One line for the board."),
|
|
10166
|
+
}),
|
|
10167
|
+
effect: "ask", cost: "free", reversible: false, idempotent: true, auth: "manage_things",
|
|
10168
|
+
}),
|
|
8971
10169
|
"conversation:autonomy": receiver({
|
|
8972
10170
|
receiver: "conversation:autonomy",
|
|
8973
10171
|
summary: "Read a conversation's autonomy level from tags, defaulting to 'auto' when missing, for the channels worker to decide send vs draft",
|
|
@@ -9094,6 +10292,13 @@ export const RECEIVERS = {
|
|
|
9094
10292
|
response: () => z.unknown(),
|
|
9095
10293
|
effect: "ask", auth: "owner", reversible: false,
|
|
9096
10294
|
}),
|
|
10295
|
+
"movers:funnel-event": receiver({
|
|
10296
|
+
receiver: "movers:funnel-event",
|
|
10297
|
+
summary: "Records a preview-only movers-funnel edge (previewed, tried, owner) for the workspace behind a preview token",
|
|
10298
|
+
request: () => z.object({ token: z.string(), event: z.enum(["previewed", "tried", "owner"]) }).passthrough(),
|
|
10299
|
+
response: () => z.unknown(),
|
|
10300
|
+
effect: "ask", auth: "public", reversible: false,
|
|
10301
|
+
}),
|
|
9097
10302
|
"movers:funnel-claim": receiver({
|
|
9098
10303
|
receiver: "movers:funnel-claim",
|
|
9099
10304
|
summary: "Claims a sponsored preview workspace for the signed-in user, binding them as owner",
|
|
@@ -9117,8 +10322,8 @@ export const RECEIVERS = {
|
|
|
9117
10322
|
}),
|
|
9118
10323
|
"payout:set": receiver({
|
|
9119
10324
|
receiver: "payout:set",
|
|
9120
|
-
summary: "Set a merchant's crypto payout treasury addresses (sui/evm) after workspace ownership check and human presence confirmation",
|
|
9121
|
-
request: () => z.object({ confirm: z.unknown().optional(), treasury_evm: z.unknown().optional(), treasury_sui: z.unknown().optional(), workspace: z.unknown().optional() }).passthrough(),
|
|
10325
|
+
summary: "Set a merchant's crypto payout treasury addresses (sui/evm) and its custody switch (off | on) after workspace ownership check and human presence confirmation",
|
|
10326
|
+
request: () => z.object({ confirm: z.unknown().optional(), custody: z.unknown().optional(), treasury_evm: z.unknown().optional(), treasury_sui: z.unknown().optional(), workspace: z.unknown().optional() }).passthrough(),
|
|
9122
10327
|
response: () => z.unknown(),
|
|
9123
10328
|
effect: "ask", auth: "owner", reversible: false,
|
|
9124
10329
|
}),
|
|
@@ -9192,6 +10397,162 @@ export const RECEIVERS = {
|
|
|
9192
10397
|
response: () => z.unknown(),
|
|
9193
10398
|
effect: "ask", auth: "update_group", reversible: false,
|
|
9194
10399
|
}),
|
|
10400
|
+
// ── secrets:* — the opener (text/secrets.md deliverable 7; text/secrets-plan.md § Signals).
|
|
10401
|
+
// A key given to ONE is used for a caller who never holds it: `secrets/` is a worker of
|
|
10402
|
+
// its own, reached over the `OPENER` service binding. call + used land here with C6's
|
|
10403
|
+
// resolver (one.ie/web/src/lib/resolvers/secrets.ts), `secrets:give` with C8's, `secrets:grant` +
|
|
10404
|
+
// `secrets:revoke` with C12's; list lands with its own (C15 — Interface Contract #2). There is NO `secrets:refused`: a
|
|
10405
|
+
// refusal is `secrets:used` with `refused` set, closed with a warn.
|
|
10406
|
+
"secrets:call": receiver({
|
|
10407
|
+
receiver: "secrets:call",
|
|
10408
|
+
summary: "Use a key somebody lent you, without ever holding it. The opener finds your grant, checks its signature against the vault's grant-signers, counts the call BEFORE it is made, opens the key in memory, sends ONE request to the provider's fixed host and header on an allow-listed path (no redirect followed), scrubs the key from the answer and drops it. The caller is the session or attested agent — a body field never names it.",
|
|
10409
|
+
request: () => z.object({
|
|
10410
|
+
provider: z.enum(PROVIDER_NAMES).describe("A row of secrets/src/providers.ts — the one host and header a key may be sent to. Anything else refuses unknown_provider."),
|
|
10411
|
+
secret: z.string().optional().describe("`<vault>/<NAME>` of one lent secret, when you hold grants on several keys for this provider. Omitted: the first grant to you for this provider."),
|
|
10412
|
+
request: z.object({
|
|
10413
|
+
method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]),
|
|
10414
|
+
path: z.string().describe("The provider path, e.g. `/v1/chat/completions`. Every provider row is an allow-catalogue (plan D17): the method AND the decoded, normalised path must match one entry exactly, and every query key must be one that entry names — else path_not_allowed. The grant's for.paths names entries (ids or exact templates) and can never add one; absent, the row's default set."),
|
|
10415
|
+
body: z.unknown().optional().describe("Sent as JSON (a string is sent as-is). Ignored on GET. When the grant carries for.models, a model-taking entry needs a JSON body in which EVERY field named `model`, at any depth, is on that list."),
|
|
10416
|
+
}),
|
|
10417
|
+
}),
|
|
10418
|
+
response: () => z.object({
|
|
10419
|
+
ok: z.boolean(),
|
|
10420
|
+
status: z.number().optional().describe("The provider's status; 0 when the request failed or timed out — still counted (plan D6)."),
|
|
10421
|
+
body: z.unknown().optional().describe("The provider's answer, JSON when it was JSON, with the key's value and its last 12 characters scrubbed. Headers are never returned."),
|
|
10422
|
+
used: z.object({ secret: z.string(), grant: z.string(), today: z.number(), perDay: z.number() }).optional().describe("The meter after this call — the owner's desk shows the same numbers."),
|
|
10423
|
+
refused: z.enum(REFUSALS).optional().describe("The closed set of @oneie/sdk/secrets REFUSALS. bad_key: the sealed value cannot be sent as-is (counted, nothing sent)."),
|
|
10424
|
+
detail: z.string().optional().describe("The numbers behind a refusal (`49/50`), the expiry, or the check that bit."),
|
|
10425
|
+
error: z.string().optional().describe("unauthorized · not_in_workflow (a workflow step inherits the runner's session and never spends a lent grant) · opener_unbound · opener_unreachable — the web side refused before the opener, or could not reach it."),
|
|
10426
|
+
}),
|
|
10427
|
+
effect: "ask", auth: "authenticated", cost: "variable", reversible: false, idempotent: false,
|
|
10428
|
+
examples: [{ provider: "openai", request: { method: "POST", path: "/v1/chat/completions", body: { model: "gpt-4o-mini", messages: [{ role: "user", content: "hi" }] } } }],
|
|
10429
|
+
}),
|
|
10430
|
+
"secrets:used": receiver({
|
|
10431
|
+
receiver: "secrets:used",
|
|
10432
|
+
summary: "Close the loop on one use of a lent key: `mark` on the path `actor → provider:<name>`, or `warn` on it when `refused` is set. Written by whoever made the call (the web resolver, channels) — the opener keeps the meter and writes no signal (plan D9).",
|
|
10433
|
+
request: () => z.object({
|
|
10434
|
+
provider: z.enum(PROVIDER_NAMES).describe("The provider row the call went to — the same closed set secrets:call takes; a path `actor → provider:<name>` is only ever written for a real row."),
|
|
10435
|
+
secret: z.string().optional().describe("`<vault>/<NAME>` that was used."),
|
|
10436
|
+
grant: z.string().optional().describe("The grant id the call ran on."),
|
|
10437
|
+
today: z.number().optional().describe("Calls on that grant today, after this one."),
|
|
10438
|
+
perDay: z.number().optional(),
|
|
10439
|
+
refused: z.enum(USED_REFUSALS).optional().describe("Set when the call was refused — the loop closes with a warn instead of a mark. The opener's REFUSALS, then the web side's own: not_in_workflow · opener_unbound · opener_unreachable · vault_not_yours."),
|
|
10440
|
+
}),
|
|
10441
|
+
response: () => z.object({ ok: z.boolean(), closed: z.enum(["mark", "warn"]).optional(), actor: z.string().optional(), provider: z.string().optional(), error: z.string().optional() }),
|
|
10442
|
+
effect: "signal", auth: "authenticated", cost: "free", reversible: false, idempotent: false,
|
|
10443
|
+
examples: [{ provider: "openai", secret: "0xv/OPENAI", grant: "g1", today: 12, perDay: 500 }],
|
|
10444
|
+
}),
|
|
10445
|
+
"secrets:give": receiver({
|
|
10446
|
+
receiver: "secrets:give",
|
|
10447
|
+
summary: "Give a key to ONE. The value arrives sealed on the giver's side to ONE's lock alone (read from ONE's vault, never a constant) and signed by a key on the vault's grant-signers; the opener checks the signature, opens the key in memory, refuses a signed subject that is not the attested caller and a sealed plaintext that does not name this give's vault, name and provider, makes ONE cheap Check it call to the provider row's check entry, flags a key that can make other keys (or whose scopes cannot be read), and stores the sealed key keyed `<vault>/<name>` — by compare-and-set on the record it replaces — with the row's host, header and entries as they are now. Afterwards only the last four characters show. The giver is the session or attested agent — a body field never names it. Closes with a mark on `actor → provider:<name>`, a warn on any refusal.",
|
|
10448
|
+
request: () => z.object({
|
|
10449
|
+
signer: z.object({
|
|
10450
|
+
kind: z.enum(["person", "agent"]).describe("agent: its own ed25519 Sui key (the CLI's --signer-key, the SDK's giveData). person: a passkey touch made on the seal page (C9) — the master-derived key never signs."),
|
|
10451
|
+
sig: z.string().describe("The signature over the payload's canonical bytes (keys sorted, @oneie/sdk/secrets) — a Sui personal-message signature (agent) or the WebAuthn assertion JSON (person)."),
|
|
10452
|
+
signer: z.string().describe("Who signed: the agent's Sui address, or `p256:<point>` for a passkey. It must be on payload.vault's grant-signers, read from the chain."),
|
|
10453
|
+
}),
|
|
10454
|
+
payload: z.object({
|
|
10455
|
+
type: z.literal("give"),
|
|
10456
|
+
vault: z.string().describe("The giver's Sui vault, `0x` + 64 lower-case hex. Its grant-signers decide who may give; the key is stored as `<vault>/<name>` and nobody listed on another vault can change it."),
|
|
10457
|
+
body: z.object({
|
|
10458
|
+
name: z.string().describe("The .env name, e.g. OPENAI_API_KEY — letters, digits and `_`."),
|
|
10459
|
+
provider: z.enum(PROVIDER_NAMES).describe("A row of secrets/src/providers.ts; anything else refuses unknown_provider before the chain is read."),
|
|
10460
|
+
sealed: z.string().describe("Sealed to ONE's lock and no other reader (`age:<base64>`, the @oneie/sdk/secrets-give sealForOne form) over the canonical plaintext `{\"name\",\"provider\",\"v\":1,\"value\",\"vault\"}` naming this give's vault, name and provider — any other is seal_mismatch. Never the value."),
|
|
10461
|
+
mode: z.enum(["give", "check"]).describe("check: verify, open and Check it, answer, and store nothing."),
|
|
10462
|
+
allowFlagged: z.boolean().optional().describe("Signed with the rest: store a key Check it flagged — admin_key · full_secret_key · admin_scope · key_scope (a key that can make other keys or reach admin), or scopes_unknown (a GitHub token whose scopes cannot be read)."),
|
|
10463
|
+
replaces: z.string().regex(/^[0-9a-f]{64}$/).nullable().describe("Signed with the rest: the sigHash of the record this give replaces (`given.sigHash` of the last give, or a stale refusal's detail), null for a first give. Anything else refuses stale — a captured give re-sent after a rotate never rolls it back."),
|
|
10464
|
+
subject: z.object({ kind: z.literal("actor"), id: z.string() }).describe("Signed with the rest: the giver's own actor — the caller this request is attested as (session, world key or attested agent). Any other refuses subject_mismatch, so a captured give resent under another session is never theirs."),
|
|
10465
|
+
}),
|
|
10466
|
+
}),
|
|
10467
|
+
group: z.string().optional().describe("C13: give the key to a group — a bare slug (one `group:` prefix is accepted as a spelling). Only a caller the group's roles allow (owner or admin, mayGiveForGroup, D26) may; anyone else is refused `not_allowed` and the opener is never called. The key is recorded under the group, on its members' walk, and payload.vault must be the group treasury's vault."),
|
|
10468
|
+
}),
|
|
10469
|
+
response: () => z.object({
|
|
10470
|
+
ok: z.boolean(),
|
|
10471
|
+
stored: z.boolean().optional().describe("false on mode check — nothing was written."),
|
|
10472
|
+
given: z.object({ vault: z.string(), name: z.string(), provider: z.string(), last4: z.string(), flagged: z.string().nullable(), check: z.object({ ok: z.boolean(), status: z.number() }), sigHash: z.string() }).optional().describe("What ONE kept: the last four characters (empty for a value shorter than 12), the flag word if any, Check it's status, and the give's sigHash — what a rotate signs as `replaces`."),
|
|
10473
|
+
refused: z.string().optional().describe("The opener's refusal: malformed · unknown_provider · bad_signature · cannot_verify · subject_mismatch · busy (10 gives a minute per caller, then per vault) · stale · not_sealed_to_one · seal_mismatch · bad_key · check_failed · flagged."),
|
|
10474
|
+
detail: z.string().optional().describe("The check that bit — never the value or its length. On stale: the sigHash of the record ONE holds (`none` when there is none)."),
|
|
10475
|
+
error: z.string().optional().describe("The web side: unauthorized · not_in_workflow (a workflow step never gives a key in the runner's name) · bad_request · not_allowed (group set and the caller does not control that group) · vault_not_yours (payload.vault is not the subject's own vault — the session actor's, or with group the group treasury's) · opener_unbound · opener_unreachable."),
|
|
10476
|
+
}),
|
|
10477
|
+
effect: "ask", auth: "authenticated", cost: "free", reversible: false, idempotent: false,
|
|
10478
|
+
examples: [{ signer: { kind: "agent", sig: "<base64>", signer: "0x…" }, payload: { type: "give", vault: "0x…", body: { name: "OPENAI_API_KEY", provider: "openai", sealed: "age:…", mode: "give", replaces: null, subject: { kind: "actor", id: "<your actor id>" } } } }],
|
|
10479
|
+
}),
|
|
10480
|
+
"secrets:grant": receiver({
|
|
10481
|
+
receiver: "secrets:grant",
|
|
10482
|
+
summary: "Lend a key you gave to ONE, or accept one lent to you. LEND: a signed grant — who may use the key (a person, an agent, or a group), which calls (catalogue entries of the provider row), how many a day, until when — checked against the grant-signers of the vault the key was given under (never the vault the document names), and stored only once its signature verifies (an id is never reused on a vault). The borrower gets a card linking one.ie/keys?lent=<ref>; their calls run on the key once they accept, and they never see it. ACCEPT: `accept` names the grant's ref; `confirm: false` shows it in words and writes nothing, `confirm: true` records the acceptance. Only a person's own session accepts — for themselves, or with `group` / `agent` for a group or an agent they control — never an agent, and never from a body field. Closes with a mark on `actor → provider:<name>`, a warn on a refusal once the provider is known.",
|
|
10483
|
+
request: () => z.object({
|
|
10484
|
+
signer: z.object({
|
|
10485
|
+
kind: z.enum(["person", "agent"]).describe("person: a passkey touch on the seal page, in a window of its own (a framed grant is refused). agent: its own ed25519 Sui key (the SDK's grantData)."),
|
|
10486
|
+
sig: z.string().describe("The signature over the payload's canonical bytes (keys sorted, @oneie/sdk/secrets)."),
|
|
10487
|
+
signer: z.string().describe("Who signed: `p256:<point>` for a passkey, the agent's Sui address. It must be on the key's vault's grant-signers, read from the chain."),
|
|
10488
|
+
}).optional().describe("LEND form only."),
|
|
10489
|
+
payload: z.object({
|
|
10490
|
+
type: z.literal("grant"),
|
|
10491
|
+
vault: z.string().describe("The vault the key was given under, `0x` + 64 lower-case hex — the same as body.vault."),
|
|
10492
|
+
body: z.object({
|
|
10493
|
+
id: z.string().describe("8–64 of [A-Za-z0-9_-]; mint 16 random bytes as hex (grantData does). Never reused on a vault: a second grant naming a seen id is refused id_used, so a Stop is permanent."),
|
|
10494
|
+
secret: z.string().describe("`<vault>/<NAME>` — the key as it was given. A secret never given is refused no_key before anything reaches the chain."),
|
|
10495
|
+
vault: z.string(),
|
|
10496
|
+
to: z.object({
|
|
10497
|
+
kind: z.enum(["actor", "group"]),
|
|
10498
|
+
id: z.string().describe("An actor id, or a group's bare slug (never `group:`-prefixed)."),
|
|
10499
|
+
agents: z.array(z.string()).optional().describe("Only on a grant to a person: the agents of theirs it also covers. A grant to a person covers their agents only when it names them."),
|
|
10500
|
+
}),
|
|
10501
|
+
for: z.object({
|
|
10502
|
+
paths: z.array(z.string()).optional().describe("Catalogue entry ids of the key's provider row, bare or `<id>@/concrete/path` (one repo, one issue). Absent: the row's default reads. []: nothing. Any other item refuses bad_template."),
|
|
10503
|
+
models: z.array(z.string()).optional(),
|
|
10504
|
+
tools: z.array(z.string()).optional().describe("Composio tool slugs — only on a key whose stored provider is composio, never a COMPOSIO_ meta-tool."),
|
|
10505
|
+
}),
|
|
10506
|
+
perDay: z.number().int().min(1).describe("Calls a day, counted before each call."),
|
|
10507
|
+
until: z.string().describe("ISO-8601 UTC ending Z, in the future. No upper cap: the provider's own budget is the honest one."),
|
|
10508
|
+
}),
|
|
10509
|
+
}).optional().describe("LEND form only."),
|
|
10510
|
+
accept: z.string().regex(/^[0-9a-f]{64}$/).optional().describe("ACCEPT form: the grant's ref (from the card's link)."),
|
|
10511
|
+
confirm: z.boolean().optional().describe("ACCEPT form: false shows the grant in words and writes nothing; true records the acceptance (once)."),
|
|
10512
|
+
group: z.string().optional().describe("ACCEPT form: accept for a group you control (owner or admin)."),
|
|
10513
|
+
agent: z.string().optional().describe("ACCEPT form: accept for an agent whose home group you control. An agent never accepts for itself."),
|
|
10514
|
+
}),
|
|
10515
|
+
response: () => z.object({
|
|
10516
|
+
ok: z.boolean(),
|
|
10517
|
+
grant: z.object({ ref: z.string(), id: z.string(), secret: z.string(), provider: z.string(), to: z.unknown(), perDay: z.number(), until: z.string() }).optional().describe("LEND: what was stored. `ref` is sha256 of the signed bytes — the card links it."),
|
|
10518
|
+
existing: z.boolean().optional().describe("The identical grant (or acceptance) was already there — nothing new was written and no second card sent."),
|
|
10519
|
+
accepted: z.boolean().optional(),
|
|
10520
|
+
offer: z.object({ ref: z.string(), provider: z.string(), name: z.string(), perDay: z.number(), until: z.string(), to: z.unknown(), paths: z.array(z.string()).optional(), models: z.array(z.string()).optional(), tools: z.array(z.string()).optional(), from: z.string().nullable() }).optional().describe("ACCEPT with confirm false: the grant in words — never the key, the sealed blob or a signature."),
|
|
10521
|
+
provider: z.string().optional(),
|
|
10522
|
+
refused: z.string().optional().describe("The opener's: malformed · expired · no_key · bad_template · bad_signature · cannot_verify · busy · id_used · no_grant · not_addressee."),
|
|
10523
|
+
detail: z.string().optional(),
|
|
10524
|
+
error: z.string().optional().describe("The web side: unauthorized · not_in_workflow · not_allowed (an accept not made by a person's own session, or for a group or agent the caller does not control) · bad_request · opener_unbound · opener_unreachable."),
|
|
10525
|
+
}),
|
|
10526
|
+
effect: "ask", auth: "authenticated", cost: "free", reversible: false, idempotent: true,
|
|
10527
|
+
examples: [{ accept: "<64 hex ref from the card>", confirm: false }],
|
|
10528
|
+
}),
|
|
10529
|
+
"secrets:revoke": receiver({
|
|
10530
|
+
receiver: "secrets:revoke",
|
|
10531
|
+
summary: "Stop a grant for good. The owner's signed Stop — checked against the grant-signers of the vault the lent key was given under — is stored once and never rewritten; the next call on that grant is refused `stopped`, and its meter does not move again. There is no un-stop: grant ids are never reused on a vault. Closes with a mark on `actor → provider:<name>`.",
|
|
10532
|
+
request: () => z.object({
|
|
10533
|
+
signer: z.object({
|
|
10534
|
+
kind: z.enum(["person", "agent"]).describe("person: a passkey touch on the seal page, in its own window. agent: its own ed25519 key (the SDK's stopData)."),
|
|
10535
|
+
sig: z.string(),
|
|
10536
|
+
signer: z.string().describe("`p256:<point>` for a passkey, the agent's Sui address — on the vault's grant-signers."),
|
|
10537
|
+
}),
|
|
10538
|
+
payload: z.object({
|
|
10539
|
+
type: z.literal("stop"),
|
|
10540
|
+
vault: z.string().describe("The vault the grant was signed on."),
|
|
10541
|
+
body: z.object({ grantId: z.string().describe("The grant's id on that vault."), at: z.string().describe("ISO-8601 UTC ending Z.") }),
|
|
10542
|
+
}),
|
|
10543
|
+
}),
|
|
10544
|
+
response: () => z.object({
|
|
10545
|
+
ok: z.boolean(),
|
|
10546
|
+
stopped: z.object({ grantId: z.string(), vault: z.string(), at: z.string(), ref: z.string() }).optional(),
|
|
10547
|
+
existing: z.boolean().optional().describe("This Stop was already stored — nothing rewritten."),
|
|
10548
|
+
provider: z.string().optional(),
|
|
10549
|
+
refused: z.string().optional().describe("malformed · no_grant (a grant never made: nothing stored, no chain read) · bad_signature · cannot_verify."),
|
|
10550
|
+
detail: z.string().optional(),
|
|
10551
|
+
error: z.string().optional().describe("unauthorized · not_in_workflow · bad_request · opener_unbound · opener_unreachable."),
|
|
10552
|
+
}),
|
|
10553
|
+
effect: "ask", auth: "authenticated", cost: "free", reversible: false, idempotent: true,
|
|
10554
|
+
examples: [{ signer: { kind: "agent", sig: "<base64>", signer: "0x…" }, payload: { type: "stop", vault: "0x…", body: { grantId: "<id>", at: "2026-10-27T12:00:00Z" } } }],
|
|
10555
|
+
}),
|
|
9195
10556
|
"ssr:calibrate": receiver({
|
|
9196
10557
|
receiver: "ssr:calibrate",
|
|
9197
10558
|
summary: "Compare strategy PMFs against a human fixture, mark/warn paths, write hypothesis if KS-sim >= 0.85. FINDING: falls back to data.slug when the caller is unattested",
|