@rine-network/mastra 0.3.0 → 0.6.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/dist/index.d.ts CHANGED
@@ -11,29 +11,31 @@
11
11
  * (client builder, error formatter, renderers, schemas) is exported now so
12
12
  * tests and downstream stages can consume it.
13
13
  *
14
- * Import is side-effect-free (I-1): nothing here constructs a client, reads a
14
+ * Import is side-effect-free: nothing here constructs a client, reads a
15
15
  * credential, or opens a socket at module load.
16
16
  */
17
17
  export { getRineClient } from "./client.js";
18
18
  export type { RineClientOpts } from "./client.js";
19
19
  export { formatError } from "./errors.js";
20
20
  export type { RinePaymentToolOpts, RineToolOpts } from "./tool.js";
21
- export { createRineCheckInboxTool, createRineReadTool, createRineReplyTool, createRineSendAndWaitTool, createRineSendTool, createRineThreadTool, } from "./messaging.js";
22
- export { createRineDiscoverTool, createRineInspectTool, } from "./discovery.js";
23
- export { createRineGroupCreateTool, createRineGroupInspectTool, createRineGroupInviteTool, createRineGroupRemoveTool, } from "./groups.js";
24
- export { createRineFulfillTool, createRinePayTool, } from "./payments.js";
21
+ export { createRineInboxTool, createRineReadTool, createRineReplyTool, createRineSendAndWaitTool, createRineSendTool, createRineThreadTool, } from "./messaging.js";
22
+ export { createRineDiscoverTool, createRineInspectTool, createRineWhoamiTool, } from "./discovery.js";
23
+ export { createRineDiscoverGroupsTool, createRineGroupRosterTool, createRineGroupsTool, } from "./groups-list.js";
24
+ export { createRineGroupCreateTool, createRineGroupInspectTool, createRineGroupInviteTool, createRineGroupInvitesTool, createRineGroupJoinTool, createRineGroupRemoveTool, } from "./groups.js";
25
+ export { createRineGroupLeaveTool, createRineGroupReclaimTool, createRineGroupRequestsTool, createRineGroupSyncTool, createRineGroupVoteTool, } from "./groups-admin.js";
26
+ export { createRineFulfillTool, createRinePayTool } from "./payments.js";
25
27
  export { rineToolkit } from "./tools.js";
26
28
  export type { RinePaymentsConfig, RineToolDomain, RineToolkitOptions, } from "./tools.js";
27
29
  export { rineLifecycle } from "./lifecycle.js";
28
30
  export type { RineLifecycleCallbacks, RineLifecycleEvent, RineLifecycleOptions, } from "./lifecycle.js";
29
31
  export { RineThreadResumer } from "./inbound.js";
30
32
  export type { ResumableRun, ResumableWorkflow, ResumeData, ResumeOutcome, RineThreadResumerOptions, WorkflowSnapshot, } from "./inbound.js";
31
- export { InMemoryThreadMap, SqliteThreadMap, } from "./threadmap.js";
32
- export type { SqliteThreadMapOptions, ThreadMapStore, } from "./threadmap.js";
33
+ export { InMemoryThreadMap, SqliteThreadMap } from "./threadmap.js";
34
+ export type { SqliteThreadMapOptions, ThreadMapStore } from "./threadmap.js";
33
35
  export { makeWebhookHandler, PollDriver } from "./drivers.js";
34
36
  export type { PollDriverOptions, WebhookHandler, WebhookHandlerOptions, } from "./drivers.js";
35
37
  export { parseOnboardArgs, runOnboard } from "./onboard.js";
36
38
  export type { OnboardArgs, OnboardIO, OnboardOptions } from "./onboard.js";
37
- export { RINE_ACTING_AGENT, RINE_API_URL, RINE_CONFIG_DIR, } from "./context.js";
39
+ export { RINE_ACTING_AGENT, RINE_API_URL, RINE_CONFIG_DIR } from "./context.js";
38
40
  export type { RineToolContext } from "./context.js";
39
- export type { AgentProfile, AgentSummary, DecryptedMessage, GroupRead, InviteResult, MessageRead, } from "./types.js";
41
+ export type { AgentProfile, AgentSummary, DecryptedMessage, GroupRead, InviteResult, JoinRequestRead, MessageRead, } from "./types.js";
package/dist/index.js CHANGED
Binary file
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Outbound lifecycle bridge `rineLifecycle` (SPEC §8 + PHASE0_CONTRACT P0-7).
2
+ * Outbound lifecycle bridge `rineLifecycle`.
3
3
  *
4
4
  * Mastra has NO callback-handler object class. The faithful 1:1 of the Python
5
5
  * `RineCallbackHandler` is a FACTORY returning the top-level callbacks
6
6
  * `agent.stream(...)` / `agent.generate(...)` accept — verified identical across
7
- * both methods (P0-7). Spread the result into either:
7
+ * both methods. Spread the result into either:
8
8
  * const cb = rineLifecycle({ to: "ops@acme", on: ["finish", "error"] });
9
9
  * await agent.stream(input, { ...cb }); // or .generate(input, { ...cb })
10
10
  *
@@ -14,21 +14,22 @@
14
14
  * step → onStepFinish ({toolCalls,…}) → "step: {toolName}"
15
15
  *
16
16
  * Invariants:
17
- * - I-1: opt-in by instantiation; the `AsyncRineClient` is built lazily on the
18
- * FIRST fired callback (never at module load or in this factory body).
19
- * - I-2: only the model-visible `text` / tool name / error message is summarized
17
+ * - Opt-in by instantiation; the `AsyncRineClient` is built lazily on the
18
+ * FIRST fired callback (never at module load or in this factory body), so
19
+ * importing the package stays side-effect-free.
20
+ * - Only the model-visible `text` / tool name / error message is summarized
20
21
  * into the notify body — never ciphertext (these callbacks never see an
21
22
  * envelope).
22
- * - Best-effort: each fired callback attempts EXACTLY ONE `client.send` (AC-13);
23
+ * - Best-effort: each fired callback attempts EXACTLY ONE `client.send`;
23
24
  * a send failure is swallowed + debug-logged and never thrown out of the
24
- * callback (AC-14) — a notify failure must not crash the agent run.
25
+ * callback — a notify failure must not crash the agent run.
25
26
  */
26
27
  import { type RineClientOpts } from "./client.js";
27
28
  /** The lifecycle selectors a caller can opt into. */
28
29
  export type RineLifecycleEvent = "finish" | "error" | "step";
29
30
  /** Options for {@link rineLifecycle}. */
30
31
  export interface RineLifecycleOptions extends RineClientOpts {
31
- /** Recipient handle/UUID every notify is sent to (`name@org`, `#group@org`). */
32
+ /** Recipient handle/UUID every notify is sent to (`name@org`, `#logistics@acme.rine.network`). */
32
33
  to: string;
33
34
  /** Which lifecycle events fire a notify. Defaults to `["finish", "error"]`. */
34
35
  on?: readonly RineLifecycleEvent[];
@@ -42,6 +43,7 @@ export interface RineLifecycleCallbacks {
42
43
  /**
43
44
  * Build the opt-in outbound lifecycle bridge. Returns ONLY the callbacks for the
44
45
  * selected events (so `{ ...cb }` never installs a no-op for an unselected one).
45
- * The client is resolved lazily on the first fired callback (I-1).
46
+ * The client is resolved lazily on the first fired callback — this factory
47
+ * builds nothing.
46
48
  */
47
49
  export declare function rineLifecycle(opts: RineLifecycleOptions): RineLifecycleCallbacks;
@@ -1,29 +1,31 @@
1
1
  /**
2
- * The 5 messaging tools: `rine_send`, `rine_send_and_wait`, `rine_check_inbox`,
3
- * `rine_read`, `rine_reply` (SPEC §6 messaging table). Each is a thin
2
+ * The 6 messaging tools: `rine_send`, `rine_send_and_wait`, `rine_inbox`,
3
+ * `rine_read`, `rine_thread`, `rine_reply`. Each is a thin
4
4
  * `createTool` adapter: one `AsyncRineClient` call rendered to a string, wrapped
5
5
  * by `makeExecute` (lazy client + formatError). Identity comes from
6
6
  * `ctx.requestContext`, never the model-visible `inputSchema`.
7
7
  *
8
- * I-2 holds throughout: renderers read only plaintext/decrypt_error/verification
9
- * (`format.ts`), never the ciphertext envelope. `rine_check_inbox` is the
10
- * Track-0 poll+ack receive primitive (Tier-1).
8
+ * Ciphertext never reaches the model through any of them: renderers read only
9
+ * plaintext/decrypt_error/verification (`format.ts`), never the ciphertext
10
+ * envelope. `rine_inbox` on its default
11
+ * `new` status is the Track-0 poll+ack receive primitive (Tier-1).
11
12
  */
12
13
  import { type RineToolOpts } from "./tool.js";
13
- /** `rine_send` — send a 1:1 or `#`-group message (the SDK auto-routes groups). */
14
+ /** `rine_send` — send a 1:1 or group message (the SDK auto-routes groups). */
14
15
  export declare function createRineSendTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_send", unknown>;
15
16
  /** `rine_send_and_wait` — 1:1 send that blocks for a reply (Tier-2, ms timeout). */
16
17
  export declare function createRineSendAndWaitTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_send_and_wait", unknown>;
17
18
  /**
18
- * `rine_check_inbox` — poll the newest new messages, decrypt them, then
19
- * best-effort `markDelivered` the decryptable ids so a later check returns only
20
- * newer mail (Track-0 poll+ack, Tier-1). On ack failure: warn + note the
21
- * messages "may reappear" but still return the reads (AC-5).
19
+ * `rine_inbox` — poll the inbox under one status filter, decrypt what it
20
+ * returns, and on the `new` path best-effort `markDelivered` the decryptable
21
+ * ids so a later check returns only newer mail (Track-0 poll+ack, Tier-1). On
22
+ * ack failure: warn + note the messages "may reappear" but still return the
23
+ * reads.
22
24
  */
23
- export declare function createRineCheckInboxTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_check_inbox", unknown>;
25
+ export declare function createRineInboxTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_inbox", unknown>;
24
26
  /** `rine_read` — fetch + decrypt one message by id. */
25
27
  export declare function createRineReadTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_read", unknown>;
26
- /** `rine_thread` — fetch the both-sided, decrypted transcript of a conversation. */
28
+ /** `rine_thread` — fetch the both-sided, decrypted transcript of a conversation or a group. */
27
29
  export declare function createRineThreadTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_thread", unknown>;
28
30
  /** `rine_reply` — reply to a message, threading into the same conversation. */
29
31
  export declare function createRineReplyTool(opts?: RineToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_reply", unknown>;
package/dist/onboard.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
- * Setup helper — `npx @rine-network/mastra onboard` (SPEC §11, D-not-tools).
2
+ * Setup helper — `npx @rine-network/mastra onboard`.
3
3
  *
4
4
  * Runs the SDK's RSA time-lock proof-of-work to register a fresh org, then
5
5
  * creates the first agent and prints its handle + verification words. This is
6
6
  * NEVER a `createTool` — a ~30–60 s PoW does not belong in an LLM turn; it is an
7
7
  * out-of-band CLI a human runs once.
8
8
  *
9
- * I-1: no client is built at module load — `runOnboard` constructs the client
9
+ * No client is built at module load — `runOnboard` constructs the client
10
10
  * lazily, only when invoked. The PoW + credential write are delegated wholesale
11
11
  * to the SDK's `register(opts)` (over rine-core `performRegistration`); the agent
12
12
  * keypair is generated + persisted by `client.createAgent(name)`.
13
13
  *
14
- * Config resolution is explicit (D-config-resolve): `register` REQUIRES concrete
14
+ * Config resolution is explicit: `register` REQUIRES concrete
15
15
  * `apiUrl`/`configDir` strings, so we resolve them via rine-core unless the caller
16
16
  * passed overrides (the SDK never resolves them itself).
17
17
  */
package/dist/onboard.js CHANGED
@@ -1,20 +1,20 @@
1
- import { resolveApiUrl, resolveConfigDir } from "@rine-network/core";
1
+ import { compareVerificationWordsForAgent, resolveApiUrl, resolveConfigDir, verificationWordsLines } from "@rine-network/core";
2
2
  import { AsyncRineClient, register } from "@rine-network/sdk";
3
3
  //#region src/onboard.ts
4
4
  /**
5
- * Setup helper — `npx @rine-network/mastra onboard` (SPEC §11, D-not-tools).
5
+ * Setup helper — `npx @rine-network/mastra onboard`.
6
6
  *
7
7
  * Runs the SDK's RSA time-lock proof-of-work to register a fresh org, then
8
8
  * creates the first agent and prints its handle + verification words. This is
9
9
  * NEVER a `createTool` — a ~30–60 s PoW does not belong in an LLM turn; it is an
10
10
  * out-of-band CLI a human runs once.
11
11
  *
12
- * I-1: no client is built at module load — `runOnboard` constructs the client
12
+ * No client is built at module load — `runOnboard` constructs the client
13
13
  * lazily, only when invoked. The PoW + credential write are delegated wholesale
14
14
  * to the SDK's `register(opts)` (over rine-core `performRegistration`); the agent
15
15
  * keypair is generated + persisted by `client.createAgent(name)`.
16
16
  *
17
- * Config resolution is explicit (D-config-resolve): `register` REQUIRES concrete
17
+ * Config resolution is explicit: `register` REQUIRES concrete
18
18
  * `apiUrl`/`configDir` strings, so we resolve them via rine-core unless the caller
19
19
  * passed overrides (the SDK never resolves them itself).
20
20
  */
@@ -62,7 +62,7 @@ async function runOnboard(opts, io = stdoutIO) {
62
62
  const agent = await client.createAgent(agentName);
63
63
  io.log("");
64
64
  io.log(`Agent ready: ${agent.handle}`);
65
- if (agent.verification_words) io.log(`Verification words: ${agent.verification_words}`);
65
+ for (const line of verificationWordsLines(compareVerificationWordsForAgent(configDir, agent.id, agent.verification_words))) io.log(line);
66
66
  io.log(`Config dir: ${configDir}`);
67
67
  io.log("Set RINE_CONFIG_DIR to this path (or RINE_CLIENT_ID/RINE_CLIENT_SECRET) so your Mastra tools authenticate.");
68
68
  return agent.handle;
@@ -2,7 +2,7 @@
2
2
  * The 2 x402 payment tools: `rine_pay` (payer) and `rine_fulfill` (payee). Each
3
3
  * is a thin `createTool` adapter over the ts-sdk `client.payments` facade — the
4
4
  * SAME single implementation the CLI/MCP payer and the ts-sdk payee use, so no
5
- * signing / policy / journal / facilitator logic is reimplemented here (I-14).
5
+ * signing / policy / journal / facilitator logic is reimplemented here.
6
6
  *
7
7
  * `rine_pay` consumes a received `rine.v1.x402_payment_required` and returns the
8
8
  * `rine_pay` 7-status vocabulary VERBATIM (parity with MCP `rine_pay` and the
@@ -23,7 +23,7 @@ import { type RinePaymentToolOpts } from "./tool.js";
23
23
  /**
24
24
  * `rine_pay` — pay a received x402 quote in-thread (payer). Mode T: an explicit
25
25
  * tool call is the authorization, hard-bounded by the spend caps. The toolkit's
26
- * `payments.autoPay` config (D2, default OFF) sets the default of the `autoPay`
26
+ * `payments.autoPay` config (default OFF) sets the default of the `autoPay`
27
27
  * input; when on, only quotes at/below the policy's `autoPayThreshold` are paid.
28
28
  */
29
29
  export declare function createRinePayTool(opts?: RinePaymentToolOpts): import("@mastra/core/tools").Tool<any, any, any, any, import("@mastra/core/tools").ToolExecutionContext<any, any, unknown>, "rine_pay", unknown>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Zod input schemas for the three discovery tools (`rine_discover`,
3
+ * `rine_inspect`, `rine_whoami`).
4
+ *
5
+ * One file per domain (mirrors `schemas-groups.ts` and `schemas-payments.ts`)
6
+ * to keep `schemas.ts` within the ~200-LOC budget; re-exported from
7
+ * `schemas.ts` so the schema entry point stays single. Authored with the HOST
8
+ * `zod` (`import { z } from "zod"`) — the one hoisted instance Mastra
9
+ * validates against. Identity/credentials NEVER appear here — an input schema
10
+ * is model-visible and model-controllable, so the acting agent + config dir
11
+ * come from `ctx.requestContext` instead.
12
+ *
13
+ * `rine_discover` and `rine_discover_groups` are unauthenticated reads of the
14
+ * public directory; `rine_inspect` and `rine_whoami` are not, and the split is
15
+ * by tool DOMAIN, not by auth. The group-directory schema lives beside the
16
+ * other group reads in `schemas-groups-list.ts`.
17
+ */
18
+ import { z } from "zod";
19
+ export declare const discoverInput: z.ZodObject<{
20
+ q: z.ZodOptional<z.ZodString>;
21
+ category: z.ZodOptional<z.ZodString>;
22
+ language: z.ZodOptional<z.ZodString>;
23
+ verified: z.ZodOptional<z.ZodBoolean>;
24
+ limit: z.ZodDefault<z.ZodNumber>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ limit: number;
27
+ verified?: boolean | undefined;
28
+ q?: string | undefined;
29
+ category?: string | undefined;
30
+ language?: string | undefined;
31
+ }, {
32
+ verified?: boolean | undefined;
33
+ q?: string | undefined;
34
+ category?: string | undefined;
35
+ language?: string | undefined;
36
+ limit?: number | undefined;
37
+ }>;
38
+ export declare const inspectInput: z.ZodObject<{
39
+ handleOrId: z.ZodString;
40
+ }, "strip", z.ZodTypeAny, {
41
+ handleOrId: string;
42
+ }, {
43
+ handleOrId: string;
44
+ }>;
45
+ /** No input: reports this agent's OWN org, trust tier, and live handles. */
46
+ export declare const whoamiInput: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Zod input schemas for the three group READ 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 the rest:
7
+ * the HOST `zod`, rich `.describe()` on every field, and NO identity or
8
+ * credentials in a model-visible schema (both come from `ctx.requestContext`).
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
+ q?: string | undefined;
21
+ limit?: number | 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
+ }>;
@@ -1,44 +1,74 @@
1
1
  /**
2
- * Zod input schemas for the 4 group tools (split out of `schemas.ts` to hold the
3
- * ~200-LOC budget — the schema concentration the SPEC §4 endorses, one file per
4
- * domain). Same authoring rules: HOST `zod`, rich `.describe()` on every field,
5
- * NO identity/credentials in the schema (host-injected via `ctx.requestContext`).
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
+ * HOST `zod`, rich `.describe()` on every field, NO identity/credentials in the
6
+ * schema (host-injected via `ctx.requestContext`).
6
7
  *
7
- * Groups are MLS-capable by default — `enableMls` (default true) on create is the
8
- * headline inversion vs the Python siblings (D-mls).
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. The description states
15
+ * both choices and that coupling, so a model picks at the point of choice
16
+ * rather than after being refused.
17
+ *
18
+ * Admission is plural: `members` on create and `agentsToInvite` on invite each
19
+ * take a batch and report one outcome per requested agent.
9
20
  */
10
21
  import { z } from "zod";
22
+ /**
23
+ * The refusal when no visibility was named.
24
+ *
25
+ * It sits on the schema rather than in the handler because Mastra validates
26
+ * `inputSchema` before `execute` ever runs, so the handler could never speak
27
+ * here — and a bare zod "Required" would be the dump this obligation exists to
28
+ * replace. It names both choices and what each one does, so a model that reads
29
+ * it can pick without consulting docs.
30
+ */
31
+ 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.";
11
32
  export declare const groupCreateInput: z.ZodObject<{
12
33
  name: z.ZodString;
13
34
  enrollment: z.ZodDefault<z.ZodEnum<["open", "closed", "majority", "unanimity"]>>;
14
- visibility: z.ZodDefault<z.ZodEnum<["public", "private"]>>;
35
+ visibility: z.ZodEnum<["public", "private"]>;
15
36
  description: z.ZodOptional<z.ZodString>;
37
+ voteDurationHours: z.ZodOptional<z.ZodNumber>;
38
+ members: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
39
  enableMls: z.ZodDefault<z.ZodBoolean>;
17
40
  }, "strip", z.ZodTypeAny, {
18
41
  name: string;
19
- enrollment: "open" | "closed" | "majority" | "unanimity";
20
42
  visibility: "public" | "private";
43
+ enrollment: "open" | "closed" | "majority" | "unanimity";
21
44
  enableMls: boolean;
22
45
  description?: string | undefined;
46
+ voteDurationHours?: number | undefined;
47
+ members?: string[] | undefined;
23
48
  }, {
24
49
  name: string;
50
+ visibility: "public" | "private";
25
51
  enrollment?: "open" | "closed" | "majority" | "unanimity" | undefined;
26
- visibility?: "public" | "private" | undefined;
27
52
  description?: string | undefined;
53
+ voteDurationHours?: number | undefined;
54
+ members?: string[] | undefined;
28
55
  enableMls?: boolean | undefined;
29
56
  }>;
30
57
  export declare const groupInviteInput: z.ZodObject<{
31
58
  group: z.ZodString;
32
- agentToInvite: z.ZodString;
59
+ agentToInvite: z.ZodOptional<z.ZodString>;
60
+ agentsToInvite: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
33
61
  message: z.ZodOptional<z.ZodString>;
34
62
  }, "strip", z.ZodTypeAny, {
35
63
  group: string;
36
- agentToInvite: string;
37
64
  message?: string | undefined;
65
+ agentToInvite?: string | undefined;
66
+ agentsToInvite?: string[] | undefined;
38
67
  }, {
39
68
  group: string;
40
- agentToInvite: string;
41
69
  message?: string | undefined;
70
+ agentToInvite?: string | undefined;
71
+ agentsToInvite?: string[] | undefined;
42
72
  }>;
43
73
  export declare const groupRemoveInput: z.ZodObject<{
44
74
  group: z.ZodString;
@@ -57,3 +87,59 @@ export declare const groupInspectInput: z.ZodObject<{
57
87
  }, {
58
88
  group: string;
59
89
  }>;
90
+ export declare const groupJoinInput: z.ZodObject<{
91
+ group: z.ZodString;
92
+ message: z.ZodOptional<z.ZodString>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ group: string;
95
+ message?: string | undefined;
96
+ }, {
97
+ group: string;
98
+ message?: string | undefined;
99
+ }>;
100
+ /** `rine_group_invites` takes no input — it lists the caller's own pending invites. */
101
+ export declare const groupInvitesInput: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
102
+ export declare const groupRequestsInput: z.ZodObject<{
103
+ group: z.ZodString;
104
+ outstanding: z.ZodDefault<z.ZodEnum<["pending", "invited", "live"]>>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ group: string;
107
+ outstanding: "pending" | "invited" | "live";
108
+ }, {
109
+ group: string;
110
+ outstanding?: "pending" | "invited" | "live" | undefined;
111
+ }>;
112
+ export declare const groupVoteInput: z.ZodObject<{
113
+ group: z.ZodString;
114
+ requestId: z.ZodString;
115
+ vote: z.ZodEnum<["approve", "deny"]>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ group: string;
118
+ requestId: string;
119
+ vote: "approve" | "deny";
120
+ }, {
121
+ group: string;
122
+ requestId: string;
123
+ vote: "approve" | "deny";
124
+ }>;
125
+ export declare const groupLeaveInput: z.ZodObject<{
126
+ group: z.ZodString;
127
+ }, "strip", z.ZodTypeAny, {
128
+ group: string;
129
+ }, {
130
+ group: string;
131
+ }>;
132
+ export declare const groupSyncInput: z.ZodObject<{
133
+ group: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ group: string;
136
+ }, {
137
+ group: string;
138
+ }>;
139
+ export declare const groupReclaimInput: z.ZodObject<{
140
+ group: z.ZodString;
141
+ }, "strip", z.ZodTypeAny, {
142
+ group: string;
143
+ }, {
144
+ group: string;
145
+ }>;
@@ -5,7 +5,8 @@
5
5
  * the ~200-LOC budget; re-exported from `schemas.ts` so the schema entry point
6
6
  * stays single. Authored with the HOST `zod` (`import { z } from "zod"`) — the
7
7
  * one hoisted instance Mastra validates against. Identity/credentials NEVER
8
- * appear here (I-2): the acting agent + config dir come from `ctx.requestContext`.
8
+ * appear here an input schema is model-visible and model-controllable, so the
9
+ * acting agent + config dir come from `ctx.requestContext` instead.
9
10
  *
10
11
  * The wallet key, spend policy, caps, and facilitator auth are NEVER model
11
12
  * inputs — they live on disk / in the toolkit config. A tool input can name a
package/dist/schemas.d.ts CHANGED
@@ -1,27 +1,42 @@
1
1
  /**
2
- * Shared Zod input schemas for the 12 rine tools.
2
+ * Shared Zod input schemas for the 25 rine tools.
3
3
  *
4
4
  * Authored with the HOST `zod` (`import { z } from "zod"`) — the single hoisted
5
5
  * instance Mastra validates against — NOT the SDK's re-exported `z`. Rich
6
6
  * `.describe()` on EVERY field: the field descriptions are the #1 lever on
7
7
  * tool-call accuracy (the AI-DX). Identity/credentials NEVER appear here — the
8
8
  * acting agent + config dir are read from `ctx.requestContext`, never the model-
9
- * visible input schema (I-2 / Mastra's own security rule).
9
+ * visible input schema, which the model both sees and controls (also Mastra's
10
+ * own security rule).
10
11
  *
11
12
  * `messageType`/`idempotencyKey`/etc. ports drop the Python `tag`/`jurisdiction`/
12
13
  * `pricingModel` discover fields (the TS `DiscoveryFilters` lacks them) and add
13
- * `enableMls` (default true) on group_create — the headline inversion (D-mls).
14
+ * `enableMls` (default true) on group_create — the headline inversion.
14
15
  */
15
16
  import { z } from "zod";
17
+ /**
18
+ * The exactly-one-of rule for `rine_thread`'s two references, in the words the
19
+ * refusal will use if it is broken.
20
+ *
21
+ * One string teaches the schema and answers the mistake, so the model can never
22
+ * be told a rule the product does not enforce. Its spellings come from
23
+ * `rine-core` — these tools name the two references exactly as the TypeScript
24
+ * SDK does (`group` / `conversationId`), which is what `THREAD_REF_SURFACES.sdk`
25
+ * holds.
26
+ */
27
+ export declare const THREAD_REF_RULE: string;
16
28
  export declare const threadInput: z.ZodObject<{
17
- conversationId: z.ZodString;
29
+ group: z.ZodOptional<z.ZodString>;
30
+ conversationId: z.ZodOptional<z.ZodString>;
18
31
  limit: z.ZodOptional<z.ZodNumber>;
19
32
  }, "strip", z.ZodTypeAny, {
20
- conversationId: string;
21
33
  limit?: number | undefined;
34
+ group?: string | undefined;
35
+ conversationId?: string | undefined;
22
36
  }, {
23
- conversationId: string;
24
37
  limit?: number | undefined;
38
+ group?: string | undefined;
39
+ conversationId?: string | undefined;
25
40
  }>;
26
41
  export declare const sendInput: z.ZodObject<{
27
42
  to: z.ZodString;
@@ -55,11 +70,14 @@ export declare const sendAndWaitInput: z.ZodObject<{
55
70
  messageType?: string | undefined;
56
71
  waitSeconds?: number | undefined;
57
72
  }>;
58
- export declare const checkInboxInput: z.ZodObject<{
73
+ export declare const inboxInput: z.ZodObject<{
74
+ status: z.ZodDefault<z.ZodEnum<["new", "delivered", "read", "all"]>>;
59
75
  limit: z.ZodDefault<z.ZodNumber>;
60
76
  }, "strip", z.ZodTypeAny, {
77
+ status: "delivered" | "new" | "read" | "all";
61
78
  limit: number;
62
79
  }, {
80
+ status?: "delivered" | "new" | "read" | "all" | undefined;
63
81
  limit?: number | undefined;
64
82
  }>;
65
83
  export declare const readInput: z.ZodObject<{
@@ -82,31 +100,7 @@ export declare const replyInput: z.ZodObject<{
82
100
  body: string;
83
101
  messageType?: string | undefined;
84
102
  }>;
85
- export declare const discoverInput: z.ZodObject<{
86
- q: z.ZodOptional<z.ZodString>;
87
- category: z.ZodOptional<z.ZodString>;
88
- language: z.ZodOptional<z.ZodString>;
89
- verified: z.ZodOptional<z.ZodBoolean>;
90
- limit: z.ZodDefault<z.ZodNumber>;
91
- }, "strip", z.ZodTypeAny, {
92
- limit: number;
93
- verified?: boolean | undefined;
94
- q?: string | undefined;
95
- category?: string | undefined;
96
- language?: string | undefined;
97
- }, {
98
- verified?: boolean | undefined;
99
- limit?: number | undefined;
100
- q?: string | undefined;
101
- category?: string | undefined;
102
- language?: string | undefined;
103
- }>;
104
- export declare const inspectInput: z.ZodObject<{
105
- handleOrId: z.ZodString;
106
- }, "strip", z.ZodTypeAny, {
107
- handleOrId: string;
108
- }, {
109
- handleOrId: string;
110
- }>;
111
- export { groupCreateInput, groupInspectInput, groupInviteInput, groupRemoveInput, } from "./schemas-groups.js";
103
+ export { discoverInput, inspectInput, whoamiInput, } from "./schemas-discovery.js";
104
+ export { discoverGroupsInput, groupRosterInput, groupsInput, } from "./schemas-groups-list.js";
105
+ export { groupCreateInput, groupInspectInput, groupInviteInput, groupInvitesInput, groupJoinInput, groupLeaveInput, groupReclaimInput, groupRemoveInput, groupRequestsInput, groupSyncInput, groupVoteInput, } from "./schemas-groups.js";
112
106
  export { fulfillInput, payInput } from "./schemas-payments.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tier-3 thread map (D-tier3-store): a durable `(handle, conversation_id) →
2
+ * Tier-3 thread map: a durable `(handle, conversation_id) →
3
3
  * runId` map. This is OUR responsibility — the LangGraph `thread_id` analog —
4
4
  * and is SEPARATE from Mastra's own workflow-snapshot storage (`@mastra/libsql`/
5
5
  * `@mastra/pg`). The snapshot is Mastra's; this map tells the resumer WHICH
@@ -10,7 +10,7 @@
10
10
  * - {@link SqliteThreadMap} — the documented production default; libsql-backed
11
11
  * (file URL for durability across restarts, `:memory:` for a throwaway).
12
12
  *
13
- * I-1: building a `SqliteThreadMap` opens a libsql handle, so do it where the
13
+ * Building a `SqliteThreadMap` opens a libsql handle, so do it where the
14
14
  * driver/resumer is wired (a long-lived host start), never at module import.
15
15
  */
16
16
  /**