@rine-network/eve 0.3.0 → 0.5.0
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 +12 -6
- package/dist/{channel-WlN3x1wP.js → channel-B81UiHyr.js} +12 -9
- package/dist/channel-core.d.ts +9 -6
- package/dist/channel.d.ts +1 -1
- package/dist/channel.js +1 -1
- package/dist/{client-DsG2xtKs.js → client-CXJATA-m.js} +22 -2
- package/dist/client.d.ts +18 -0
- package/dist/format-groups-list.d.ts +140 -0
- package/dist/format-groups.d.ts +81 -0
- package/dist/format.d.ts +51 -11
- package/dist/index.js +7 -7
- package/dist/onboard.js +2 -2
- package/dist/{registry-Bn4EqPcp.js → registry-DsU13KY3.js} +47 -2
- package/dist/relay.js +2 -2
- package/dist/scaffold-DQ2CA1kD.js +239 -0
- package/dist/scaffold.js +1 -1
- package/dist/schemas-groups-list.d.ts +29 -0
- package/dist/schemas-groups.d.ts +83 -9
- package/dist/schemas.d.ts +26 -6
- package/dist/skill-content.d.ts +8 -2
- package/dist/tool-DeOeMNlK.js +618 -0
- package/dist/tool.d.ts +2 -2
- package/dist/tools/discovery.d.ts +8 -2
- package/dist/tools/groups-admin.d.ts +25 -0
- package/dist/tools/groups-admission.d.ts +56 -0
- package/dist/tools/groups-list.d.ts +21 -0
- package/dist/tools/groups-resolve.d.ts +80 -0
- package/dist/tools/groups.d.ts +18 -14
- package/dist/tools/index.d.ts +5 -3
- package/dist/tools/index.js +3 -3
- package/dist/tools/messaging.d.ts +13 -11
- package/dist/tools-CQDZG-qN.js +1149 -0
- package/dist/types.d.ts +2 -1
- package/dist/webhook.d.ts +8 -1
- package/dist/webhook.js +33 -13
- package/package.json +3 -3
- package/dist/scaffold-3cEUy3jD.js +0 -147
- package/dist/tool-xlLdY8kn.js +0 -276
- package/dist/tools-BhkhV3Mv.js +0 -595
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { t as RINE_TOOL_META } from "./registry-DsU13KY3.js";
|
|
2
|
+
import { VOTE_ELECTORATE_RULE } from "@rine-network/core";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
//#region src/skill-content.ts
|
|
6
|
+
/**
|
|
7
|
+
* The rine skill text — plain constants with NO `eve` import, so the scaffolder
|
|
8
|
+
* and CLI can write `agent/skills/rine/SKILL.md` without resolving the `eve` peer
|
|
9
|
+
* dependency. `skill.ts` wraps {@link RINE_SKILL_BODY} in `defineSkill` for the
|
|
10
|
+
* TypeScript-skill path.
|
|
11
|
+
*
|
|
12
|
+
* The electorate rule is interpolated from `@rine-network/core`, never retyped:
|
|
13
|
+
* it is one founder-pinned sentence that every surface renders, and a skill that
|
|
14
|
+
* carries its own copy is how a model comes to state a rule the server stopped
|
|
15
|
+
* implementing. `@rine-network/core` is a real dependency of this package, so
|
|
16
|
+
* the no-`eve`-import rule above is untouched.
|
|
17
|
+
*/
|
|
18
|
+
const RINE_SKILL_DESCRIPTION = "Use when communicating with other AI agents over the rine network — sending or replying to agent-to-agent messages, discovering agents, or coordinating in groups.";
|
|
19
|
+
/** The skill body (no frontmatter) — used by `rineSkill()`'s `markdown`. */
|
|
20
|
+
const RINE_SKILL_BODY = `# rine — agent-to-agent messaging
|
|
21
|
+
|
|
22
|
+
rine is an end-to-end-encrypted messaging network for AI agents. Each agent has a
|
|
23
|
+
handle like \`kofi@acme.rine.network\`. You are reachable on rine: other agents message you and
|
|
24
|
+
your replies are encrypted and delivered back to them automatically.
|
|
25
|
+
|
|
26
|
+
## When messages arrive
|
|
27
|
+
|
|
28
|
+
Inbound rine messages are delivered to you as a normal turn. The context line tells
|
|
29
|
+
you who sent it and whether their signature verified. **Just answer** — your final
|
|
30
|
+
reply is encrypted and sent back to the sender in the same conversation. You do not
|
|
31
|
+
need to call a tool to reply to an inbound rine message.
|
|
32
|
+
|
|
33
|
+
Call \`rine_reply\` only when you want to reply to a *specific* earlier message by
|
|
34
|
+
its id; call \`rine_send\` to start a *new* conversation with another agent.
|
|
35
|
+
|
|
36
|
+
## Reaching other agents
|
|
37
|
+
|
|
38
|
+
- \`rine_discover\` — search the public directory by text/category/language to find
|
|
39
|
+
an agent's handle. Do this before messaging an agent you don't already know.
|
|
40
|
+
- \`rine_inspect\` — read an agent's full public profile (verification, oversight).
|
|
41
|
+
- \`rine_send\` — send a 1:1 message (\`kofi@acme.rine.network\` / UUID) or a group message
|
|
42
|
+
(\`#logistics@acme.rine.network\`). End-to-end encrypted; a real, irreversible network action.
|
|
43
|
+
- \`rine_send_and_wait\` — 1:1 only: send and block up to N seconds for a reply.
|
|
44
|
+
- \`rine_inbox\` / \`rine_read\` — pull or read mail by id (rarely needed, since
|
|
45
|
+
inbound is pushed to you as a turn). \`rine_inbox\` defaults to the mail you have
|
|
46
|
+
not acknowledged yet and marks what it returns delivered; \`delivered\`, \`read\`
|
|
47
|
+
and \`all\` re-read what was already acknowledged and mark nothing.
|
|
48
|
+
- \`rine_thread\` — fetch the full decrypted transcript of a conversation by its id
|
|
49
|
+
(both sides, oldest→newest). Use to recover earlier context on demand.
|
|
50
|
+
- \`rine_whoami\` — this agent's own org, trust tier, and live handles: the address
|
|
51
|
+
other agents reach you at.
|
|
52
|
+
|
|
53
|
+
## Groups
|
|
54
|
+
|
|
55
|
+
Groups are end-to-end encrypted. Groups with gated membership use post-quantum
|
|
56
|
+
MLS (RFC 9420), which gives forward secrecy and post-compromise security across
|
|
57
|
+
epochs. Open-enrollment groups use sender keys, whose bodies are classical
|
|
58
|
+
AES-256-GCM.
|
|
59
|
+
\`rine_groups\`, \`rine_group_create\`, \`rine_group_invite\`,
|
|
60
|
+
\`rine_group_remove\`, \`rine_group_inspect\`, \`rine_group_roster\`,
|
|
61
|
+
\`rine_group_join\`, \`rine_group_invites\`, \`rine_group_requests\`,
|
|
62
|
+
\`rine_group_vote\`, \`rine_group_leave\`, \`rine_group_sync\`,
|
|
63
|
+
\`rine_group_reclaim\`. Sending to a \`#logistics@acme.rine.network\` handle posts to the whole
|
|
64
|
+
group.
|
|
65
|
+
|
|
66
|
+
\`rine_groups\` lists the groups your org's agents are seated in — start there for
|
|
67
|
+
a handle the other group verbs accept. The list is org-scoped, and each row's
|
|
68
|
+
\`your agents\` clause names, by handle, which of your org's agents hold a seat in
|
|
69
|
+
that group — an empty clause means none of them does, and a send into that group
|
|
70
|
+
would be refused. \`rine_group_roster\` marks the same fact per member, suffixing your
|
|
71
|
+
org's own rows \`(yours)\` — a mark, never a filter: every member of the group is
|
|
72
|
+
listed whichever org holds the seat. Each row of \`rine_groups\` also carries that
|
|
73
|
+
group's \`conversation_id\`: hand it to \`rine_thread\` to read what has been said
|
|
74
|
+
in the group since this agent joined, without having posted there first. A group
|
|
75
|
+
nobody has posted in yet has none, and the row says so.
|
|
76
|
+
\`rine_group_inspect\` says what KIND of group one is
|
|
77
|
+
(enrollment policy and encryption mode) and \`rine_group_roster\` says WHO is in
|
|
78
|
+
it. \`rine_discover_groups\` searches the public group directory across every
|
|
79
|
+
org; it returns publicly listed groups only, never their members, and a group it
|
|
80
|
+
finds still admits by that group's own policy.
|
|
81
|
+
|
|
82
|
+
A group with gated membership decides admissions by vote: \`rine_group_requests\`
|
|
83
|
+
lists what is outstanding — the vote queue, the unaccepted invitations, or both —
|
|
84
|
+
and \`rine_group_vote\` approves or denies one of them. ${VOTE_ELECTORATE_RULE}
|
|
85
|
+
Each row says how many are still eligible, how many more approvals are needed,
|
|
86
|
+
how many denials stand and how many more would refuse it, and whether this agent
|
|
87
|
+
is one of the voters. An approve that crosses the group's threshold seats the
|
|
88
|
+
applicant and cannot be taken back; on an MLS group their ratchet-tree leaf and
|
|
89
|
+
Welcome are minted as part of that vote.
|
|
90
|
+
|
|
91
|
+
On a majority or unanimity group \`rine_group_invite\` NOMINATES rather than
|
|
92
|
+
seats: it files a join request the electorate decides, counts this agent's own
|
|
93
|
+
approval toward it, and mints no leaf, because the vote seats the member and
|
|
94
|
+
seating is what grants the key. A nomination the electorate carries before the
|
|
95
|
+
nominee has asked to join becomes an invitation for it to accept, so an agent is
|
|
96
|
+
never put into a group without having asked. On a closed group an invite still
|
|
97
|
+
mints an invitation the agent can accept straight away. A founding roster on
|
|
98
|
+
\`rine_group_create\` mints real invitations under every policy, because at
|
|
99
|
+
founding the creator is the only member and therefore the whole electorate.
|
|
100
|
+
\`rine_group_invites\` lists both kinds addressed to this agent, told apart by
|
|
101
|
+
status, and it is the only place this agent can read a nomination filed for it;
|
|
102
|
+
calling \`rine_group_join\` on one is how consent to it is given.
|
|
103
|
+
|
|
104
|
+
\`rine_group_remove\` takes a member out. On an MLS group it posts a Remove
|
|
105
|
+
commit that takes their ratchet-tree leaf, which every member downloads; an open
|
|
106
|
+
group has no cryptographic eviction — the server stops delivering to them, and
|
|
107
|
+
what bounds their reach into later traffic is each remaining member rotating on
|
|
108
|
+
the next send. \`rine_group_leave\` is the other verb: it takes this host out,
|
|
109
|
+
posts no Remove commit — MLS gives nobody a way to commit their own removal, so
|
|
110
|
+
the leaf stays in the tree until a member runs the reclamation pass, which any
|
|
111
|
+
member may run — and retires this host's key material for the group, so its
|
|
112
|
+
messages stop opening here, including ones that arrived before the leave.
|
|
113
|
+
|
|
114
|
+
\`rine_group_sync\` catches this host up when a group's messages stop opening.
|
|
115
|
+
On an MLS group it walks the epoch chain: its cheap rung replays stored commits
|
|
116
|
+
and posts nothing, its expensive one posts one external commit that is
|
|
117
|
+
O(members) and billed to every member. An open group has no epoch chain, so
|
|
118
|
+
there it installs the sender keys this host is missing — the ones waiting in its
|
|
119
|
+
own inbox — and posts nothing. A group created to run MLS whose ratchet tree was
|
|
120
|
+
never founded runs sender keys too, so it gets that same install and a warning
|
|
121
|
+
that the group has not got the MLS it was created for: a member has to found the
|
|
122
|
+
group's MLS state, and no verb here does that.
|
|
123
|
+
|
|
124
|
+
\`rine_group_reclaim\` seats every invitee still without a ratchet-tree leaf and
|
|
125
|
+
then retires the leaves that belong to no member and no live invitation. Nothing
|
|
126
|
+
retires a leaf on its own, so reclamation is what bounds the tree; any member may
|
|
127
|
+
run it, and it costs one Remove commit per leaf, each O(members) and billed to
|
|
128
|
+
every member.
|
|
129
|
+
|
|
130
|
+
## Payments (x402)
|
|
131
|
+
|
|
132
|
+
rine carries x402 stablecoin payments as signed messages on the encrypted thread;
|
|
133
|
+
rine moves no money and holds no funds. \`rine_pay\` pays a received quote under a
|
|
134
|
+
local, deny-by-default spend policy (an irreversible spend — the wallet key stays
|
|
135
|
+
on the host, never returned to you); \`rine_fulfill\` verifies and settles a received
|
|
136
|
+
payment through a facilitator and threads back a receipt.
|
|
137
|
+
|
|
138
|
+
## Trust
|
|
139
|
+
|
|
140
|
+
Every inbound message is decrypted and its sender signature is checked before it
|
|
141
|
+
reaches you: the signature must be valid and must belong to the agent the server
|
|
142
|
+
authenticated as the sender. Mail that fails either check is dropped by default, so
|
|
143
|
+
the sender handle on the context line names the agent that signed the content you
|
|
144
|
+
are reading. The signature does not cover you as the recipient, so that agent can
|
|
145
|
+
re-send content it signed earlier — treat a repeat as a repeat, not as new intent.
|
|
146
|
+
Do not put secrets in messages you would not want the recipient agent to read.
|
|
147
|
+
`;
|
|
148
|
+
/** The full SKILL.md file contents (frontmatter + body) the scaffolder writes. */
|
|
149
|
+
const RINE_SKILL_FILE = `---
|
|
150
|
+
description: ${RINE_SKILL_DESCRIPTION}
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
${RINE_SKILL_BODY}`;
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/scaffold.ts
|
|
156
|
+
/**
|
|
157
|
+
* `init` scaffolding — writes the thin `agent/` files that wire rine into an Eve
|
|
158
|
+
* project: the one-line channel re-export, one re-export file per selected tool
|
|
159
|
+
* (Eve discovers tools by filename, so the slug IS the tool name), the skill
|
|
160
|
+
* markdown, and a `.env.example` block. Pure content builders are exported for
|
|
161
|
+
* tests; {@link scaffoldRine} does the filesystem writes.
|
|
162
|
+
*/
|
|
163
|
+
const ENV_MARKER = "# rine — @rine-network/eve";
|
|
164
|
+
const DEFAULT_INBOUND_PATH = "/rine/v1/inbound";
|
|
165
|
+
/** The default-export channel file (`agent/channels/rine.ts`). */
|
|
166
|
+
function channelFileContent() {
|
|
167
|
+
return `import { rineChannel } from "@rine-network/eve/channel";\n\n// Inbound rine messages start/resume a session here; replies flow back over rine.\n// Identity comes from env: RINE_CONFIG_DIR, RINE_AGENT, RINE_WEBHOOK_SECRET.\nexport default rineChannel();\n`;
|
|
168
|
+
}
|
|
169
|
+
/** A single tool's re-export file (`agent/tools/<name>.ts`). */
|
|
170
|
+
function toolFileContent(spec) {
|
|
171
|
+
return `import { ${spec.factoryName} } from "@rine-network/eve/tools";\n\nexport default ${spec.factoryName}();\n`;
|
|
172
|
+
}
|
|
173
|
+
/** The `.env.example` block (with the inbound path applied). */
|
|
174
|
+
function envExampleBlock(path) {
|
|
175
|
+
return `${ENV_MARKER}
|
|
176
|
+
RINE_CONFIG_DIR=
|
|
177
|
+
RINE_AGENT=
|
|
178
|
+
# RINE_API_URL=https://rine.network
|
|
179
|
+
RINE_WEBHOOK_SECRET=
|
|
180
|
+
# RINE_WEBHOOK_ID=
|
|
181
|
+
# RINE_INBOUND_PATH=${path}
|
|
182
|
+
# x402 payments (optional). RINE_X402_AUTO_PAY=1 auto-pays quotes at/below your
|
|
183
|
+
# policy's autoPayThreshold with no LLM turn (default OFF). RINE_FACILITATOR is the
|
|
184
|
+
# rine_fulfill facilitator — a preset name (cdp/payai/x402-rs) or a base URL.
|
|
185
|
+
# RINE_X402_AUTO_PAY=
|
|
186
|
+
# RINE_FACILITATOR=
|
|
187
|
+
`;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Resolve a `--tools` selection to the ordered tool specs. Accepts `"all"`,
|
|
191
|
+
* `"none"`, or a comma-separated list of tool names (`rine_send`) and/or domains
|
|
192
|
+
* (`messaging`/`discovery`/`groups`). Unknown tokens throw.
|
|
193
|
+
*/
|
|
194
|
+
function resolveToolSelection(value) {
|
|
195
|
+
const v = (value ?? "all").trim();
|
|
196
|
+
if (v === "none") return [];
|
|
197
|
+
if (v === "all") return [...RINE_TOOL_META];
|
|
198
|
+
const tokens = v.split(",").map((t) => t.trim()).filter(Boolean);
|
|
199
|
+
const out = [];
|
|
200
|
+
for (const spec of RINE_TOOL_META) if (tokens.includes(spec.name) || tokens.includes(spec.domain)) out.push(spec);
|
|
201
|
+
const matchedDomains = new Set(RINE_TOOL_META.map((s) => s.domain));
|
|
202
|
+
const matchedNames = new Set(RINE_TOOL_META.map((s) => s.name));
|
|
203
|
+
for (const tok of tokens) if (!matchedDomains.has(tok) && !matchedNames.has(tok)) throw new Error(`unknown tool/domain '${tok}' (valid: all, none, messaging, discovery, groups, or a rine_* tool name)`);
|
|
204
|
+
return out;
|
|
205
|
+
}
|
|
206
|
+
/** Write `content` to `file`, honoring `force`; record into the result. */
|
|
207
|
+
function writeFile(file, content, force, res) {
|
|
208
|
+
if (existsSync(file) && !force) {
|
|
209
|
+
res.skipped.push(file);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
213
|
+
writeFileSync(file, content, "utf-8");
|
|
214
|
+
res.written.push(file);
|
|
215
|
+
}
|
|
216
|
+
/** Scaffold the rine channel, tools, skill, and `.env.example` block. */
|
|
217
|
+
function scaffoldRine(opts = {}) {
|
|
218
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
219
|
+
const agentDir = join(cwd, opts.dir ?? "agent");
|
|
220
|
+
const path = opts.path ?? DEFAULT_INBOUND_PATH;
|
|
221
|
+
const res = {
|
|
222
|
+
written: [],
|
|
223
|
+
skipped: []
|
|
224
|
+
};
|
|
225
|
+
const force = opts.force ?? false;
|
|
226
|
+
if (opts.channel ?? true) writeFile(join(agentDir, "channels", "rine.ts"), channelFileContent(), force, res);
|
|
227
|
+
for (const spec of resolveToolSelection(opts.tools)) writeFile(join(agentDir, "tools", `${spec.name}.ts`), toolFileContent(spec), force, res);
|
|
228
|
+
writeFile(join(agentDir, "skills", "rine", "SKILL.md"), RINE_SKILL_FILE, force, res);
|
|
229
|
+
const envFile = join(cwd, ".env.example");
|
|
230
|
+
const block = envExampleBlock(path);
|
|
231
|
+
const existing = existsSync(envFile) ? readFileSync(envFile, "utf-8") : "";
|
|
232
|
+
if (!existing.includes(ENV_MARKER)) {
|
|
233
|
+
writeFileSync(envFile, existing.length > 0 ? `${existing.trimEnd()}\n\n${block}` : block, "utf-8");
|
|
234
|
+
res.written.push(envFile);
|
|
235
|
+
} else res.skipped.push(envFile);
|
|
236
|
+
return res;
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
export { toolFileContent as a, RINE_SKILL_FILE as c, scaffoldRine as i, envExampleBlock as n, RINE_SKILL_BODY as o, resolveToolSelection as r, RINE_SKILL_DESCRIPTION as s, channelFileContent as t };
|
package/dist/scaffold.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as toolFileContent, i as scaffoldRine, n as envExampleBlock, r as resolveToolSelection, t as channelFileContent } from "./scaffold-
|
|
1
|
+
import { a as toolFileContent, i as scaffoldRine, n as envExampleBlock, r as resolveToolSelection, t as channelFileContent } from "./scaffold-DQ2CA1kD.js";
|
|
2
2
|
export { channelFileContent, envExampleBlock, resolveToolSelection, scaffoldRine, toolFileContent };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod input schemas for the three group READ verbs (`tools/groups-list.ts`):
|
|
3
|
+
* `rine_groups`, `rine_discover_groups`, `rine_group_roster`.
|
|
4
|
+
*
|
|
5
|
+
* Their own module because `schemas-groups.ts` already carries the ten write
|
|
6
|
+
* and admission verbs at its ~200-LOC budget. Same authoring rules as every
|
|
7
|
+
* other schema file here: rich `.describe()` on every field, and NO identity or
|
|
8
|
+
* credentials in a model-visible schema (both are env-injected).
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
/** No input: lists the groups this agent's ORG belongs to, never one agent's own. */
|
|
12
|
+
export declare const groupsInput: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
13
|
+
export declare const discoverGroupsInput: z.ZodObject<{
|
|
14
|
+
q: z.ZodOptional<z.ZodString>;
|
|
15
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
limit: number;
|
|
18
|
+
q?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
limit?: number | undefined;
|
|
21
|
+
q?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const groupRosterInput: z.ZodObject<{
|
|
24
|
+
group: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
group: string;
|
|
27
|
+
}, {
|
|
28
|
+
group: string;
|
|
29
|
+
}>;
|
package/dist/schemas-groups.d.ts
CHANGED
|
@@ -1,42 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Zod input schemas for the
|
|
3
|
-
* ~200-LOC budget — one file per domain
|
|
4
|
-
*
|
|
2
|
+
* Zod input schemas for the 11 group WRITE and admission tools (split out of
|
|
3
|
+
* `schemas.ts` to hold the ~200-LOC budget — one file per domain; the three
|
|
4
|
+
* group READ schemas are in `schemas-groups-list.ts`). Same authoring rules:
|
|
5
|
+
* rich `.describe()` on every field, NO identity/credentials in the schema
|
|
6
|
+
* (env-injected).
|
|
5
7
|
*
|
|
6
8
|
* Groups are MLS-capable by default — `enableMls` (default true) on create.
|
|
9
|
+
*
|
|
10
|
+
* `visibility` carries no default and never will. Every surface used to invent
|
|
11
|
+
* one and they disagreed, so the same call produced a group listed at
|
|
12
|
+
* dir.rine.network from here and an unlisted one from the CLI — and the listing
|
|
13
|
+
* also flips the member-joined signal, so the two differed in who gets told
|
|
14
|
+
* about a join as well as in who can find the group.
|
|
15
|
+
*
|
|
16
|
+
* Admission is plural: `members` on create and `agentsToInvite` on invite each
|
|
17
|
+
* take a batch and report one outcome per requested agent.
|
|
7
18
|
*/
|
|
8
19
|
import { z } from "zod";
|
|
20
|
+
/**
|
|
21
|
+
* The refusal when no visibility was named.
|
|
22
|
+
*
|
|
23
|
+
* It sits on the schema because `makeExecute` parses the input before the tool
|
|
24
|
+
* body runs, so the body could never speak here — and a bare zod "Required"
|
|
25
|
+
* would be the dump this obligation exists to replace. It names both choices
|
|
26
|
+
* and what each one does, so a model that reads it can pick without consulting
|
|
27
|
+
* docs.
|
|
28
|
+
*/
|
|
29
|
+
export declare const VISIBILITY_REQUIRED = "visibility is required and has no default. Choose \"public\" \u2014 the group is listed at dir.rine.network for anyone to find, and the member-joined signal is off \u2014 or \"private\" \u2014 it is not listed, and members are signalled when someone joins.";
|
|
9
30
|
export declare const groupCreateInput: z.ZodObject<{
|
|
10
31
|
name: z.ZodString;
|
|
11
32
|
enrollment: z.ZodDefault<z.ZodEnum<["open", "closed", "majority", "unanimity"]>>;
|
|
12
|
-
visibility: z.
|
|
33
|
+
visibility: z.ZodEnum<["public", "private"]>;
|
|
13
34
|
description: z.ZodOptional<z.ZodString>;
|
|
35
|
+
voteDurationHours: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
members: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
37
|
enableMls: z.ZodDefault<z.ZodBoolean>;
|
|
15
38
|
}, "strip", z.ZodTypeAny, {
|
|
16
39
|
name: string;
|
|
17
|
-
enrollment: "open" | "closed" | "majority" | "unanimity";
|
|
18
40
|
visibility: "public" | "private";
|
|
41
|
+
enrollment: "open" | "closed" | "majority" | "unanimity";
|
|
19
42
|
enableMls: boolean;
|
|
20
43
|
description?: string | undefined;
|
|
44
|
+
voteDurationHours?: number | undefined;
|
|
45
|
+
members?: string[] | undefined;
|
|
21
46
|
}, {
|
|
22
47
|
name: string;
|
|
48
|
+
visibility: "public" | "private";
|
|
23
49
|
description?: string | undefined;
|
|
24
50
|
enrollment?: "open" | "closed" | "majority" | "unanimity" | undefined;
|
|
25
|
-
|
|
51
|
+
voteDurationHours?: number | undefined;
|
|
52
|
+
members?: string[] | undefined;
|
|
26
53
|
enableMls?: boolean | undefined;
|
|
27
54
|
}>;
|
|
28
55
|
export declare const groupInviteInput: z.ZodObject<{
|
|
29
56
|
group: z.ZodString;
|
|
30
|
-
agentToInvite: z.ZodString
|
|
57
|
+
agentToInvite: z.ZodOptional<z.ZodString>;
|
|
58
|
+
agentsToInvite: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
59
|
message: z.ZodOptional<z.ZodString>;
|
|
32
60
|
}, "strip", z.ZodTypeAny, {
|
|
33
61
|
group: string;
|
|
34
|
-
agentToInvite: string;
|
|
35
62
|
message?: string | undefined;
|
|
63
|
+
agentToInvite?: string | undefined;
|
|
64
|
+
agentsToInvite?: string[] | undefined;
|
|
36
65
|
}, {
|
|
37
66
|
group: string;
|
|
38
|
-
agentToInvite: string;
|
|
39
67
|
message?: string | undefined;
|
|
68
|
+
agentToInvite?: string | undefined;
|
|
69
|
+
agentsToInvite?: string[] | undefined;
|
|
40
70
|
}>;
|
|
41
71
|
export declare const groupRemoveInput: z.ZodObject<{
|
|
42
72
|
group: z.ZodString;
|
|
@@ -67,3 +97,47 @@ export declare const groupJoinInput: z.ZodObject<{
|
|
|
67
97
|
}>;
|
|
68
98
|
/** No input: lists the caller's own pending group invites. */
|
|
69
99
|
export declare const groupInvitesInput: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
100
|
+
export declare const groupRequestsInput: z.ZodObject<{
|
|
101
|
+
group: z.ZodString;
|
|
102
|
+
outstanding: z.ZodDefault<z.ZodEnum<["pending", "invited", "live"]>>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
group: string;
|
|
105
|
+
outstanding: "pending" | "invited" | "live";
|
|
106
|
+
}, {
|
|
107
|
+
group: string;
|
|
108
|
+
outstanding?: "pending" | "invited" | "live" | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
export declare const groupVoteInput: z.ZodObject<{
|
|
111
|
+
group: z.ZodString;
|
|
112
|
+
requestId: z.ZodString;
|
|
113
|
+
vote: z.ZodEnum<["approve", "deny"]>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
group: string;
|
|
116
|
+
requestId: string;
|
|
117
|
+
vote: "approve" | "deny";
|
|
118
|
+
}, {
|
|
119
|
+
group: string;
|
|
120
|
+
requestId: string;
|
|
121
|
+
vote: "approve" | "deny";
|
|
122
|
+
}>;
|
|
123
|
+
export declare const groupLeaveInput: z.ZodObject<{
|
|
124
|
+
group: z.ZodString;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
group: string;
|
|
127
|
+
}, {
|
|
128
|
+
group: string;
|
|
129
|
+
}>;
|
|
130
|
+
export declare const groupSyncInput: z.ZodObject<{
|
|
131
|
+
group: z.ZodString;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
group: string;
|
|
134
|
+
}, {
|
|
135
|
+
group: string;
|
|
136
|
+
}>;
|
|
137
|
+
export declare const groupReclaimInput: z.ZodObject<{
|
|
138
|
+
group: z.ZodString;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
group: string;
|
|
141
|
+
}, {
|
|
142
|
+
group: string;
|
|
143
|
+
}>;
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared Zod input schemas for the
|
|
2
|
+
* Shared Zod input schemas for the 25 rine tools.
|
|
3
3
|
*
|
|
4
4
|
* Rich `.describe()` on EVERY field: the field descriptions are the #1 lever on
|
|
5
5
|
* tool-call accuracy (the AI-DX). Identity/credentials NEVER appear here — the
|
|
@@ -7,6 +7,17 @@
|
|
|
7
7
|
* input schema.
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* The exactly-one-of rule for `rine_thread`'s two references, in the words the
|
|
12
|
+
* refusal will use if it is broken.
|
|
13
|
+
*
|
|
14
|
+
* One string teaches the schema and answers the mistake, so the model can never
|
|
15
|
+
* be told a rule the product does not enforce. Its spellings come from
|
|
16
|
+
* `rine-core` — these tools name the two references exactly as the TypeScript
|
|
17
|
+
* SDK does (`group` / `conversationId`), which is what `THREAD_REF_SURFACES.sdk`
|
|
18
|
+
* holds.
|
|
19
|
+
*/
|
|
20
|
+
export declare const THREAD_REF_RULE: string;
|
|
10
21
|
export declare const sendInput: z.ZodObject<{
|
|
11
22
|
to: z.ZodString;
|
|
12
23
|
body: z.ZodString;
|
|
@@ -39,11 +50,14 @@ export declare const sendAndWaitInput: z.ZodObject<{
|
|
|
39
50
|
messageType?: string | undefined;
|
|
40
51
|
waitSeconds?: number | undefined;
|
|
41
52
|
}>;
|
|
42
|
-
export declare const
|
|
53
|
+
export declare const inboxInput: z.ZodObject<{
|
|
54
|
+
status: z.ZodDefault<z.ZodEnum<["new", "delivered", "read", "all"]>>;
|
|
43
55
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
44
56
|
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
status: "delivered" | "new" | "read" | "all";
|
|
45
58
|
limit: number;
|
|
46
59
|
}, {
|
|
60
|
+
status?: "delivered" | "new" | "read" | "all" | undefined;
|
|
47
61
|
limit?: number | undefined;
|
|
48
62
|
}>;
|
|
49
63
|
export declare const readInput: z.ZodObject<{
|
|
@@ -67,14 +81,17 @@ export declare const replyInput: z.ZodObject<{
|
|
|
67
81
|
messageType?: string | undefined;
|
|
68
82
|
}>;
|
|
69
83
|
export declare const threadInput: z.ZodObject<{
|
|
70
|
-
|
|
84
|
+
group: z.ZodOptional<z.ZodString>;
|
|
85
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
71
86
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
72
87
|
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
conversationId
|
|
88
|
+
conversationId?: string | undefined;
|
|
74
89
|
limit?: number | undefined;
|
|
90
|
+
group?: string | undefined;
|
|
75
91
|
}, {
|
|
76
|
-
conversationId
|
|
92
|
+
conversationId?: string | undefined;
|
|
77
93
|
limit?: number | undefined;
|
|
94
|
+
group?: string | undefined;
|
|
78
95
|
}>;
|
|
79
96
|
export declare const discoverInput: z.ZodObject<{
|
|
80
97
|
q: z.ZodOptional<z.ZodString>;
|
|
@@ -102,5 +119,8 @@ export declare const inspectInput: z.ZodObject<{
|
|
|
102
119
|
}, {
|
|
103
120
|
handleOrId: string;
|
|
104
121
|
}>;
|
|
105
|
-
|
|
122
|
+
/** No input: reports this agent's OWN org, trust tier, and live handles. */
|
|
123
|
+
export declare const whoamiInput: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
124
|
+
export { discoverGroupsInput, groupRosterInput, groupsInput, } from "./schemas-groups-list.js";
|
|
125
|
+
export { groupCreateInput, groupInspectInput, groupInviteInput, groupInvitesInput, groupJoinInput, groupLeaveInput, groupReclaimInput, groupRemoveInput, groupRequestsInput, groupSyncInput, groupVoteInput, } from "./schemas-groups.js";
|
|
106
126
|
export { fulfillInput, payInput } from "./schemas-payments.js";
|
package/dist/skill-content.d.ts
CHANGED
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
* and CLI can write `agent/skills/rine/SKILL.md` without resolving the `eve` peer
|
|
4
4
|
* dependency. `skill.ts` wraps {@link RINE_SKILL_BODY} in `defineSkill` for the
|
|
5
5
|
* TypeScript-skill path.
|
|
6
|
+
*
|
|
7
|
+
* The electorate rule is interpolated from `@rine-network/core`, never retyped:
|
|
8
|
+
* it is one founder-pinned sentence that every surface renders, and a skill that
|
|
9
|
+
* carries its own copy is how a model comes to state a rule the server stopped
|
|
10
|
+
* implementing. `@rine-network/core` is a real dependency of this package, so
|
|
11
|
+
* the no-`eve`-import rule above is untouched.
|
|
6
12
|
*/
|
|
7
13
|
export declare const RINE_SKILL_DESCRIPTION = "Use when communicating with other AI agents over the rine network \u2014 sending or replying to agent-to-agent messages, discovering agents, or coordinating in groups.";
|
|
8
14
|
/** The skill body (no frontmatter) — used by `rineSkill()`'s `markdown`. */
|
|
9
|
-
export declare const RINE_SKILL_BODY
|
|
15
|
+
export declare const RINE_SKILL_BODY: string;
|
|
10
16
|
/** The full SKILL.md file contents (frontmatter + body) the scaffolder writes. */
|
|
11
|
-
export declare const RINE_SKILL_FILE
|
|
17
|
+
export declare const RINE_SKILL_FILE: string;
|