@oneie/mcp 0.2.1 → 0.4.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/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2024-2026 Tony O'Connell. All rights reserved.
2
+
3
+ This software and associated documentation files (the "Software") are the
4
+ private and confidential property of Tony O'Connell.
5
+
6
+ No part of the Software may be reproduced, distributed, transmitted,
7
+ displayed, published, or broadcast in any form or by any means, without
8
+ the prior written permission of Tony O'Connell.
9
+
10
+ You may not copy, modify, sublicense, or distribute the Software.
11
+ You may not use the Software for any commercial or non-commercial purpose
12
+ without explicit written authorization from Tony O'Connell.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+
18
+ For licensing inquiries, contact Tony O'Connell.
package/README.md CHANGED
@@ -1,9 +1,24 @@
1
1
  # @oneie/mcp
2
2
 
3
- MCP server for the ONE substrate — 12 substrate + 5 lifecycle + 10 commerce + 10 observability + 3 discovery tools = 40 tools.
3
+ MCP server for the ONE substrate — 13 substrate + 13 lifecycle + 8 observability + 3 discovery = 37 tools.
4
4
 
5
5
  Connects Claude Code, Cursor, Windsurf, and any MCP client to a live ONE instance via stdio.
6
6
 
7
+ ## The key insight
8
+
9
+ `signal` and `ask` reach ANY capability by receiver name. You do not need a
10
+ dedicated tool for every action — just use the right receiver:
11
+
12
+ ```
13
+ signal("agents:commend", { uid }) → commend an agent
14
+ signal("groups:join", { gid }) → join a group
15
+ ask("market:hire", { skill, budget }) → hire from marketplace
16
+ ask("stats:current") → substrate stats
17
+ ask("inbox:workspace", { limit: 50 }) → inbox signals
18
+ ```
19
+
20
+ New nanoclaw handlers are automatically reachable without new MCP tools.
21
+
7
22
  ## Install
8
23
 
9
24
  ```bash
@@ -49,54 +64,56 @@ Or point at production:
49
64
 
50
65
  ## Tools
51
66
 
52
- ### Substrate Verbs
53
-
54
- | Tool | Loop | What |
55
- |------|------|------|
56
- | `signal` | L1 | Emit a signal to a unit |
57
- | `ask` | L1 | Signal + wait for outcome (result \| timeout \| dissolved) |
58
- | `mark` | L2 | Strengthen a path edge |
59
- | `warn` | L2 | Raise resistance on a path edge |
60
- | `fade` | L3 | Asymmetric decay of all paths |
61
- | `select` | L1 | Probabilistic next unit (pheromone-weighted) |
62
- | `recall` | L6 | Query hypotheses from the brain |
63
- | `reveal` | L6 | Full memory card for a uid |
64
- | `forget` | | GDPR erasure of all records for a uid |
65
- | `frontier` | L7 | Unexplored tag clusters for a uid |
66
- | `know` | L6 | Promote highways permanent hypotheses |
67
- | `highways` | L2/L6 | Top weighted paths (proven routes) |
68
-
69
- ### Commerce
70
-
71
- | Tool | Loop | What |
72
- |------|------|------|
73
- | `claw` | L1 | Deploy a NanoClaw edge worker for an agent persona |
74
- | `commend` | L2 | Commend an agent; boosts success-rate and strengthens paths |
75
- | `flag` | L2 | Flag an agent; lowers success-rate and adds path resistance |
76
- | `status` | L1 | Set an agent's lifecycle status (active \| inactive) |
77
- | `capabilities_add` | L1 | Add a skill capability to an agent with optional price |
78
- | `capabilities_publish` | L4 | Publish a skill to the marketplace with scope and rubric thresholds |
79
- | `hire` | L4 | Hire an agent for a skill; creates a group and returns chat URL |
80
- | `bounty` | L4 | Post a bounty for a skill with deadline and rubric thresholds |
81
- | `escrow_create` | L4 | Create a Sui on-chain escrow for a task between two units |
82
- | `harden` | L5 | Harden a strong path on-chain; promotes it to a permanent highway |
67
+ ### Substrate (universal — use these for anything not listed below)
68
+
69
+ | Tool | Endpoint | What |
70
+ |------|----------|------|
71
+ | `signal` | `POST /api/signal/:receiver` | Fire-and-forget to any receiver |
72
+ | `ask` | `POST /api/ask/:receiver` | Signal + wait for outcome |
73
+ | `mark` | `POST /api/mark/:edge` | Strengthen a path (`source>target`) |
74
+ | `warn` | `POST /api/warn/:edge` | Raise resistance on a path |
75
+ | `fade` | `POST /api/fade` | Asymmetric decay of all paths |
76
+ | `follow` | `GET /api/follow` | Deterministic path selection |
77
+ | `select` | `GET /api/select` | Probabilistic path selection |
78
+ | `recall` | `GET /api/learning` | Query hypotheses from the brain |
79
+ | `reveal` | `GET /api/pii/reveal/:uid` | Full memory card for a uid |
80
+ | `forget` | `POST /api/forget` | GDPR erasure of a uid |
81
+ | `frontier` | `GET /api/frontiers` | Unexplored tag clusters |
82
+ | `know` | via `signal("learning:know")` | Promote highways hypotheses |
83
+ | `highways` | `GET /api/export/highways` | Top weighted paths |
84
+
85
+ ### Lifecycle
86
+
87
+ | Tool | What |
88
+ |------|------|
89
+ | `auth_agent` | Register or re-authenticate an agent; returns uid, wallet, and one-time API key |
90
+ | `sync_agent` | Sync an agent markdown spec to TypeDB (unit + skills + capabilities) |
91
+ | `publish_agent` | Upload an agent.md to a workspace. Mirrors `oneie agent publish`. |
92
+ | `pull_agent` | Download a published agent.md from the workspace. Mirrors `oneie agent pull`. |
93
+ | `unpublish_agent` | Remove a published agent from the workspace. Idempotent. |
94
+ | `list_agents` | List all published agents for a workspace |
95
+ | `agent_history` | Version history for a published agent |
96
+ | `rollback_agent` | Restore a published agent to a previous version |
97
+ | `discover_skill` | Find agents offering a named skill, ranked by pheromone strength |
98
+ | `register` | Register a unit with capabilities; optionally link a Sui wallet |
99
+ | `pay` | Record a payment between units; deposits pheromone proportional to amount |
100
+ | `list_skills` | List all imported skills for a workspace |
101
+ | `unimport_skill` | Remove an imported skill from a workspace |
83
102
 
84
103
  ### Observability
85
104
 
86
- | Tool | Loop | What |
87
- |------|------|------|
88
- | `stats` | L2 | Aggregate substrate stats: unit counts, highways, revenue totals |
89
- | `health` | L1 | Substrate health: world state, unit count, revenue, top group |
90
- | `revenue` | L4 | Revenue breakdown: GDP, total transactions, top earners by unit |
91
- | `frontiers_global` | L7 | Unexplored frontier hypotheses with expected value >= 0.5 |
92
- | `hypotheses_global` | L6 | All hypotheses; filterable by status (pending\|testing\|confirmed\|rejected) |
93
- | `export_units` | L1 | Export all units as JSON snapshot (uid, name, kind, successRate, generation) |
94
- | `export_highways` | L2 | Export top weighted paths (strength >= 20) with optional context hints |
95
- | `intent_learn` | L6 | Unrecognized queries ranked by frequency; discovers new intent patterns |
96
- | `ingest_event` | L1 | Ingest a pheromone event (email\|stripe\|rating\|analytics) into the substrate |
97
- | `chat_turn` | L1 | Send a chat turn to the substrate LLM; returns streamed text and next-turn tags |
98
-
99
- ### Discovery
105
+ | Tool | What |
106
+ |------|------|
107
+ | `stats` | Aggregate substrate stats: unit counts, highways, revenue totals |
108
+ | `health` | Substrate health: world state, unit count, revenue, top group |
109
+ | `revenue` | Revenue breakdown: GDP, total transactions, top earners by unit |
110
+ | `frontiers_global` | Unexplored frontier hypotheses with expected value >= 0.5 |
111
+ | `export_units` | Export all units as JSON snapshot |
112
+ | `export_highways` | Export top weighted paths (strength >= 20) |
113
+ | `ingest_event` | Ingest a pheromone event (email\|stripe\|rating\|analytics) |
114
+ | `chat_turn` | Send a chat turn to the substrate LLM; returns text and next-turn tags |
115
+
116
+ ### Discovery (local no HTTP)
100
117
 
101
118
  | Tool | What |
102
119
  |------|------|
@@ -104,24 +121,6 @@ Or point at production:
104
121
  | `list_agents` | List all available agent presets |
105
122
  | `get_agent` | Get a preset by name |
106
123
 
107
- ### Pay tools
108
-
109
- - `pay_create_link` — create a shareable payment link for an agent skill. Args: `{ to, amount, rail: "card"|"crypto"|"auto", memo?, sku? }` → `{ linkUrl, qr?, intent? }`. Flows through `persist.signal()` so ADL PEP gates apply.
110
- - `pay_check_status` — check status of a payment by ref. Args: `{ ref: "pi_... | 0x... | sl_..." }` → `{ status, ref, amount?, rail? }`.
111
- - `pay_cancel` — cancel a pending payment. Args: `{ ref }` → null on success.
112
-
113
- See [one/pay-todo.md](../../one/pay-todo.md) and [one/pay-plan.md](../../one/pay-plan.md).
114
-
115
- ### Lifecycle
116
-
117
- | Tool | Loop | What |
118
- |------|------|------|
119
- | `auth_agent` | L1 | Register or re-authenticate an agent; returns uid, wallet, and one-time API key |
120
- | `sync_agent` | L1 | Sync an agent markdown spec to TypeDB (unit + skills + capabilities) |
121
- | `discover_skill` | L2 | Find agents offering a named skill, ranked by pheromone strength |
122
- | `register` | L1 | Register a unit with capabilities; optionally link a Sui wallet |
123
- | `pay` | L4 | Record a payment between units; deposits pheromone proportional to amount |
124
-
125
124
  ## Environment Variables
126
125
 
127
126
  | Variable | Default | Purpose |
@@ -135,7 +134,7 @@ See [one/pay-todo.md](../../one/pay-todo.md) and [one/pay-plan.md](../../one/pay
135
134
  import { createOneRouter, serve } from "@oneie/mcp";
136
135
 
137
136
  const router = createOneRouter();
138
- await serve(router, { name: "oneie", version: "0.2.0" });
137
+ await serve(router, { name: "oneie", version: "0.3.0" });
139
138
  ```
140
139
 
141
140
  Add custom tools:
package/dist/index.d.ts CHANGED
@@ -5,16 +5,17 @@ export type { McpTool, McpRouter } from "./serve.js";
5
5
  export { substrateTools } from "./tools/substrate.js";
6
6
  export { discoveryTools } from "./tools/discovery.js";
7
7
  export { lifecycleTools } from "./tools/lifecycle.js";
8
- export { commerceTools } from "./tools/commerce.js";
9
8
  export { observabilityTools } from "./tools/observability.js";
10
- export { groupTools } from "./tools/groups.js";
9
+ export { videoTools } from "./tools/video.js";
10
+ export { broadcastTools } from "./tools/broadcast.js";
11
11
  export declare const MCP_VERSION = "0.3.0";
12
12
  export declare const MCP_TOOLS: {
13
- substrate: readonly ["signal", "ask", "mark", "warn", "fade", "select", "recall", "reveal", "forget", "frontier", "know", "highways"];
14
- lifecycle: readonly ["auth_agent", "sync_agent", "discover_skill", "register", "pay"];
15
- commerce: readonly ["claw", "commend", "flag", "status", "capabilities_add", "capabilities_publish", "hire", "bounty", "escrow_create", "harden"];
16
- observability: readonly ["stats", "health", "revenue", "frontiers_global", "hypotheses_global", "export_units", "export_highways", "intent_learn", "ingest_event", "chat_turn"];
13
+ substrate: readonly ["signal", "ask", "mark", "warn", "fade", "follow", "select", "recall", "reveal", "forget", "frontier", "know", "highways"];
14
+ lifecycle: readonly ["auth_agent", "sync_agent", "publish_agent", "pull_agent", "unpublish_agent", "list_agents", "agent_history", "rollback_agent", "discover_skill", "register", "pay", "list_skills", "unimport_skill"];
15
+ observability: readonly ["stats", "health", "revenue", "frontiers_global", "export_units", "export_highways", "ingest_event", "chat_turn"];
17
16
  discovery: readonly ["scaffold_agent", "list_agents", "get_agent"];
18
- groups: readonly ["group_create", "group_list", "group_join", "group_invite", "group_bridge"];
17
+ social: readonly ["social_list_posts", "social_create_post", "social_accounts"];
18
+ video: readonly ["create_room", "delete_room", "contact_call", "invite_to_call", "schedule_webinar", "create_session", "quick_call", "start_recording", "start_stream", "video_summary", "get_room_status"];
19
+ broadcast: readonly ["broadcast_create", "broadcast_list", "broadcast_get", "broadcast_send"];
19
20
  };
20
21
  export declare function createOneRouter(): import("./serve.js").McpRouter;
package/dist/index.js CHANGED
@@ -3,29 +3,31 @@ import { createRouter, serve } from "./serve.js";
3
3
  import { substrateTools } from "./tools/substrate.js";
4
4
  import { discoveryTools } from "./tools/discovery.js";
5
5
  import { lifecycleTools } from "./tools/lifecycle.js";
6
- import { commerceTools } from "./tools/commerce.js";
7
6
  import { observabilityTools } from "./tools/observability.js";
8
- import { groupTools } from "./tools/groups.js";
7
+ import { socialTools } from "./tools/social.js";
8
+ import { videoTools } from "./tools/video.js";
9
+ import { broadcastTools } from "./tools/broadcast.js";
9
10
  export { createRouter, serve } from "./serve.js";
10
11
  export { readEnv } from "./env.js";
11
12
  export { substrateTools } from "./tools/substrate.js";
12
13
  export { discoveryTools } from "./tools/discovery.js";
13
14
  export { lifecycleTools } from "./tools/lifecycle.js";
14
- export { commerceTools } from "./tools/commerce.js";
15
15
  export { observabilityTools } from "./tools/observability.js";
16
- export { groupTools } from "./tools/groups.js";
16
+ export { videoTools } from "./tools/video.js";
17
+ export { broadcastTools } from "./tools/broadcast.js";
17
18
  export const MCP_VERSION = "0.3.0";
18
19
  export const MCP_TOOLS = {
19
- substrate: ["signal", "ask", "mark", "warn", "fade", "select", "recall", "reveal", "forget", "frontier", "know", "highways"],
20
- lifecycle: ["auth_agent", "sync_agent", "discover_skill", "register", "pay"],
21
- commerce: ["claw", "commend", "flag", "status", "capabilities_add", "capabilities_publish", "hire", "bounty", "escrow_create", "harden"],
22
- observability: ["stats", "health", "revenue", "frontiers_global", "hypotheses_global", "export_units", "export_highways", "intent_learn", "ingest_event", "chat_turn"],
20
+ substrate: ["signal", "ask", "mark", "warn", "fade", "follow", "select", "recall", "reveal", "forget", "frontier", "know", "highways"],
21
+ lifecycle: ["auth_agent", "sync_agent", "publish_agent", "pull_agent", "unpublish_agent", "list_agents", "agent_history", "rollback_agent", "discover_skill", "register", "pay", "list_skills", "unimport_skill"],
22
+ observability: ["stats", "health", "revenue", "frontiers_global", "export_units", "export_highways", "ingest_event", "chat_turn"],
23
23
  discovery: ["scaffold_agent", "list_agents", "get_agent"],
24
- groups: ["group_create", "group_list", "group_join", "group_invite", "group_bridge"],
24
+ social: ["social_list_posts", "social_create_post", "social_accounts"],
25
+ video: ["create_room", "delete_room", "contact_call", "invite_to_call", "schedule_webinar", "create_session", "quick_call", "start_recording", "start_stream", "video_summary", "get_room_status"],
26
+ broadcast: ["broadcast_create", "broadcast_list", "broadcast_get", "broadcast_send"],
25
27
  };
26
28
  export function createOneRouter() {
27
29
  const router = createRouter();
28
- for (const tool of [...substrateTools(), ...lifecycleTools(), ...commerceTools(), ...observabilityTools(), ...discoveryTools(), ...groupTools()]) {
30
+ for (const tool of [...substrateTools(), ...lifecycleTools(), ...observabilityTools(), ...discoveryTools(), ...socialTools(), ...videoTools(), ...broadcastTools()]) {
29
31
  router.register(tool);
30
32
  }
31
33
  return router;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,Y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AE;QACnE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/serve.d.ts CHANGED
@@ -16,3 +16,7 @@ export declare function serve(router: McpRouter, opts?: {
16
16
  name?: string;
17
17
  version?: string;
18
18
  }): Promise<void>;
19
+ export declare function serveMd(agentPath: string, opts?: {
20
+ name?: string;
21
+ version?: string;
22
+ }): Promise<void>;
package/dist/serve.js CHANGED
@@ -46,4 +46,57 @@ export async function serve(router, opts) {
46
46
  const transport = new StdioServerTransport();
47
47
  await server.connect(transport);
48
48
  }
49
+ import { readFileSync } from 'node:fs';
50
+ function parseFrontmatter(md) {
51
+ const m = md.match(/^---\s*\n([\s\S]*?)\n---/);
52
+ if (!m)
53
+ return {};
54
+ const meta = {};
55
+ for (const line of m[1].split('\n')) {
56
+ const i = line.indexOf(':');
57
+ if (i < 0)
58
+ continue;
59
+ const k = line.slice(0, i).trim();
60
+ const v = line.slice(i + 1).trim().replace(/^["']|["']$/g, '');
61
+ if (k === 'skills') {
62
+ meta.skills = v.replace(/[\[\]]/g, '').split(',').map(s => s.trim()).filter(Boolean);
63
+ }
64
+ else {
65
+ meta[k] = v;
66
+ }
67
+ }
68
+ return meta;
69
+ }
70
+ export async function serveMd(agentPath, opts) {
71
+ const md = readFileSync(agentPath, 'utf8');
72
+ const meta = parseFrontmatter(md);
73
+ const router = createRouter();
74
+ router.register({
75
+ name: 'activate_skill',
76
+ description: 'Activate a skill by name with structured input',
77
+ inputSchema: {
78
+ type: 'object',
79
+ required: ['skill', 'input'],
80
+ properties: {
81
+ skill: { type: 'string', description: 'Skill name from the agent\'s skills list' },
82
+ input: { type: 'object', description: 'Skill input matching the skill\'s inputSchema' },
83
+ },
84
+ },
85
+ handler: async (args) => ({
86
+ skill: args.skill,
87
+ input: args.input,
88
+ result: `Skill '${String(args.skill)}' activated — connect to substrate for execution`,
89
+ resources: (meta.skills ?? []).map(s => ({ uri: `skill://${s}`, name: s })),
90
+ }),
91
+ });
92
+ for (const skillName of meta.skills ?? []) {
93
+ router.register({
94
+ name: skillName,
95
+ description: `Skill: ${skillName}`,
96
+ inputSchema: { type: 'object' },
97
+ handler: async (args) => ({ skill: skillName, args, status: 'dispatched' }),
98
+ });
99
+ }
100
+ await serve(router, { name: opts?.name ?? meta.name ?? 'oneie-agent', version: opts?.version });
101
+ }
49
102
  //# sourceMappingURL=serve.js.map
package/dist/serve.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAenC,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;IACzC,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IACtB,OAAO;QACL,KAAK;QACL,QAAQ,CAAC,IAAI;YACX,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI;YACnB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC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6B,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;SACrG,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;AACjG,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpTool } from "../serve.js";
2
+ /** broadcast_* tool group — wraps broadcast:create/list/get/send receivers via ask().
3
+ * Composes the apiCall + ask pattern from substrate.ts; substrate.ts is locked. */
4
+ export declare function broadcastTools(): McpTool[];
@@ -0,0 +1,67 @@
1
+ async function apiCall(baseUrl, apiKey, path, init = {}) {
2
+ const headers = new Headers(init.headers);
3
+ headers.set("Accept", "application/json");
4
+ if (init.body && !headers.has("Content-Type"))
5
+ headers.set("Content-Type", "application/json");
6
+ if (apiKey)
7
+ headers.set("Authorization", `Bearer ${apiKey}`);
8
+ const res = await fetch(`${baseUrl.replace(/\/$/, "")}${path}`, { ...init, headers });
9
+ if (!res.ok)
10
+ throw new Error(`${init.method ?? "GET"} ${path} → ${res.status}`);
11
+ if (res.status === 204)
12
+ return null;
13
+ const ct = res.headers.get("content-type") ?? "";
14
+ return ct.includes("json") ? res.json() : res.text();
15
+ }
16
+ function ask(env, receiver, data) {
17
+ return apiCall(env.baseUrl, env.apiKey, `/api/ask/${encodeURIComponent(receiver)}`, {
18
+ method: "POST",
19
+ body: JSON.stringify({ data }),
20
+ });
21
+ }
22
+ /** broadcast_* tool group — wraps broadcast:create/list/get/send receivers via ask().
23
+ * Composes the apiCall + ask pattern from substrate.ts; substrate.ts is locked. */
24
+ export function broadcastTools() {
25
+ return [
26
+ {
27
+ name: "broadcast_create",
28
+ description: "Create a draft email broadcast (newsletter). Returns { broadcastId }.",
29
+ inputSchema: {
30
+ type: "object",
31
+ properties: {
32
+ subject: { type: "string" },
33
+ body_md: { type: "string" },
34
+ audience_tag: { type: "string", description: "list:<name> tag to send to" },
35
+ },
36
+ },
37
+ handler: async (args, env) => ask(env, "broadcast:create", args),
38
+ },
39
+ {
40
+ name: "broadcast_list",
41
+ description: "List broadcasts for the workspace.",
42
+ inputSchema: { type: "object", properties: { limit: { type: "number" } } },
43
+ handler: async (args, env) => ask(env, "broadcast:list", args),
44
+ },
45
+ {
46
+ name: "broadcast_get",
47
+ description: "Get one broadcast by id. Returns { broadcast }.",
48
+ inputSchema: {
49
+ type: "object",
50
+ properties: { broadcastId: { type: "string" } },
51
+ required: ["broadcastId"],
52
+ },
53
+ handler: async (args, env) => ask(env, "broadcast:get", args),
54
+ },
55
+ {
56
+ name: "broadcast_send",
57
+ description: "Send a broadcast now (inline drain, suppression-checked).",
58
+ inputSchema: {
59
+ type: "object",
60
+ properties: { broadcastId: { type: "string" } },
61
+ required: ["broadcastId"],
62
+ },
63
+ handler: async (args, env) => ask(env, "broadcast:send", args),
64
+ },
65
+ ];
66
+ }
67
+ //# sourceMappingURL=broadcast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../src/tools/broadcast.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,OAAO,CAAC,OAAe,EAAE,MAA0B,EAAE,IAAY,EAAE,OAAoB,EAAE;IACtG,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC1C,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;IAC/F,IAAI,MAAM;QAAE,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,MAAM,EAAE,CAAC,C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