@mosadd/mcp 3.0.0-alpha.47 → 3.0.0-alpha.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for describing the origin of the Work and
141
- reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may accept and charge a
167
- fee for acceptance of support, warranty, indemnity, or other liability
168
- obligations and/or rights consistent with this License. However, in
169
- accepting such obligations, You may act only on Your own behalf and
170
- on Your sole responsibility, not on behalf of any other Contributor,
171
- and only if You agree to indemnify, defend, and hold each Contributor
172
- harmless for any liability incurred by, or claims asserted against,
173
- such Contributor by reason of your accepting any such warranty or
174
- additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright 2026 mosadd contributors
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
@@ -1,13 +0,0 @@
1
- /**
2
- * `mosadd login` / `logout` / `whoami` — session helper.
3
- *
4
- * Removes the "copy a JWT from mosadd.com DevTools" hack: signs in with
5
- * Supabase email+password (BYOK project URL + anon key) and stores the session
6
- * at ~/.mosadd/session.json, which the MCP server reads automatically.
7
- *
8
- * Credentials resolution (first found wins): CLI flags → env → interactive
9
- * prompt. URL/anon also fall back to a previously saved session.
10
- */
11
- declare function runAuthCommand(cmd: string, args: string[]): Promise<void>;
12
-
13
- export { runAuthCommand };
package/dist/bin/mcp.d.ts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node
package/dist/index.d.ts DELETED
@@ -1,310 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { z } from 'zod';
3
- import { DmProvider, VoiceProvider } from '@mosadd/providers';
4
- import { RatchetState, DhRatchetState, SessionRole } from '@mosadd/crypto';
5
-
6
- /**
7
- * mDM end-to-end encryption — session layer (LINEAR-2357).
8
- *
9
- * Sits ABOVE the DmProvider. The provider moves opaque bytes; THIS module
10
- * decides what those bytes are: an X3DH handshake + Double Ratchet ciphertext
11
- * envelope, produced from `@mosadd/crypto` primitives.
12
- *
13
- * Flow (decision "1a" — prekey distribution rides the DmProvider):
14
- * - Each peer publishes a prekey bundle via `dm.publishPrekeyBundle(bytes)`.
15
- * - First contact: sender `dm.fetchPrekeyBundle(peer)` → X3DH (initiator) →
16
- * Double Ratchet. The first ciphertext carries a handshake header
17
- * (initiator IK + EK + consumed one-time-prekey id) so the recipient can
18
- * run X3DH (responder) and derive the SAME root key.
19
- * - Subsequent messages reuse the stored ratchet session (no header).
20
- *
21
- * SCOPE / known follow-ups (tracked on LINEAR-2357, NOT silently hidden):
22
- * - Ratchet is strict in-order (no skipped-message keys) — fine for a single
23
- * ordered thread; out-of-order/lossy transports need skipped-key handling.
24
- * - Signed-prekey signature is carried but NOT yet verified (auth follow-up).
25
- * - Initiator "glare" (both sides open simultaneously) not resolved.
26
- * - Default keystore is in-memory (per-process); file/OS-keychain backing is
27
- * a follow-up. The MdmKeyStore seam makes that a drop-in.
28
- */
29
-
30
- interface X25519Pair {
31
- publicKey: Uint8Array;
32
- privateKey: Uint8Array;
33
- }
34
- /** The local peer's long-term identity + prekeys (private halves included). */
35
- interface OwnPrekeyMaterial {
36
- /** X25519 DH identity — used in X3DH. */
37
- identity: X25519Pair;
38
- /**
39
- * Ed25519 SIGNING identity — the long-term key a peer pins out-of-band
40
- * (the "safety number"). Signs the bundle so a network/radio MITM can't swap
41
- * the signed prekey or DH identity in transit.
42
- */
43
- signingIdentity: {
44
- publicKey: Uint8Array;
45
- privateKey: Uint8Array;
46
- };
47
- signedPrekey: {
48
- id: number;
49
- pair: X25519Pair;
50
- };
51
- oneTimePrekeys: Array<{
52
- id: number;
53
- pair: X25519Pair;
54
- }>;
55
- }
56
- /**
57
- * Persisted per-peer ratchet session. Plain data → trivially serializable.
58
- * A session is either v1 (`ratchet`, symmetric) or v2 (`ratchet2`, DH ratchet /
59
- * PCS). New sessions are v2; an existing v1 session keeps running v1.
60
- */
61
- interface MdmSessionRecord {
62
- ratchet?: RatchetState;
63
- ratchet2?: DhRatchetState;
64
- role: SessionRole;
65
- /** Handshake header still owed to the peer (initiator only, until first send). */
66
- pendingHandshake?: {
67
- ik: Uint8Array;
68
- ek: Uint8Array;
69
- opkId?: number;
70
- };
71
- }
72
- /**
73
- * Local custody of private key material + ratchet sessions. The default impl
74
- * is in-memory; a host may inject a file- or keychain-backed implementation.
75
- */
76
- interface MdmKeyStore {
77
- /** Own identity + prekeys. Generated lazily on first access, then stable. */
78
- getOwnMaterial(): Promise<OwnPrekeyMaterial>;
79
- /** Consume (one-time) a prekey private by id. Returns undefined if unknown. */
80
- takeOneTimePrekey(id: number): Promise<Uint8Array | undefined>;
81
- getSession(peerId: string): Promise<MdmSessionRecord | undefined>;
82
- putSession(peerId: string, record: MdmSessionRecord): Promise<void>;
83
- /**
84
- * OPTIONAL local "sent items" cache. The Double Ratchet is forward-secret and
85
- * asymmetric: once we seal a message for a peer we cannot re-derive its
86
- * plaintext from our own ratchet on read. So mDM_list cannot show the sender
87
- * their OWN outgoing text unless we keep a local copy. These two methods are
88
- * that copy — keyed by the provider-assigned message id.
89
- *
90
- * Honesty note: this is a LOCAL plaintext cache, not synced across devices.
91
- * A second device (or a fresh process) won't have it and will fall back to a
92
- * "<encrypted · sent by you>" marker. Cross-device sent-history sync is a
93
- * tracked follow-up (would need an encrypt-to-self session). Optional so
94
- * existing MdmKeyStore implementations keep compiling.
95
- */
96
- putSentMessage?(messageId: string, plaintext: Uint8Array): Promise<void>;
97
- getSentMessage?(messageId: string): Promise<Uint8Array | undefined>;
98
- }
99
-
100
- /**
101
- * Internal types for the mosadd MCP server.
102
- */
103
-
104
- type Mode = "cloud" | "local" | "self-host";
105
- /**
106
- * Transport backends per channel. The server fills any missing entry with its
107
- * default network adapter; a host (e.g. cymru-os) injects alternatives —
108
- * notably a radio DmProvider — via `MosaddServerOptions.providers`. This is
109
- * the DI seam that keeps mosadd-os transport-agnostic.
110
- *
111
- * `keys` is LOCAL crypto custody (identity + prekeys + ratchet sessions) for
112
- * mDM E2EE — distinct from transport. Defaults to an in-process keystore; a
113
- * host may inject a file/keychain-backed one.
114
- */
115
- interface ProviderRegistry {
116
- dm: DmProvider;
117
- keys: MdmKeyStore;
118
- /**
119
- * mTALK push-to-talk transport. Defaults to the network provider (LiveKit
120
- * media + authoritative floor state). A radio host injects a provider that
121
- * maps the floor onto a physical RF channel.
122
- */
123
- voice: VoiceProvider;
124
- }
125
- interface MosaddServerOptions {
126
- /** API key for hosted mode. Required if mode === "cloud". */
127
- apiKey?: string;
128
- /** Override the default hub URL (https://mcp.mosadd.com). */
129
- hubUrl?: string;
130
- /** Operating mode. Defaults to "cloud" if apiKey is present, else "local". */
131
- mode?: Mode;
132
- /** Log level. */
133
- logLevel?: "debug" | "info" | "warn" | "error";
134
- /**
135
- * Host-injected channel providers. Any omitted channel uses the default
136
- * network adapter. A carrier-aware host supplies e.g. a radio DmProvider here.
137
- */
138
- providers?: Partial<ProviderRegistry>;
139
- /**
140
- * When true, publish this identity's mDM prekey bundle once on startup
141
- * (best-effort, non-fatal) so peers can open an E2EE session without the user
142
- * manually running mDM_publish_keys first. Fixes the cold-start where mDM_send
143
- * fails for every recipient because nobody has published keys. Used by the
144
- * stdio binary; the hosted per-request transport leaves this off (it publishes
145
- * per authenticated session instead).
146
- */
147
- autoPublishKeys?: boolean;
148
- }
149
- interface MosaddToolContext {
150
- options: Required<Pick<MosaddServerOptions, "mode" | "hubUrl">> & MosaddServerOptions;
151
- /** Resolved channel providers (defaults merged with host-injected ones). */
152
- providers: ProviderRegistry;
153
- /** Per-request logger. */
154
- log: (level: "debug" | "info" | "warn" | "error", msg: string, extra?: unknown) => void;
155
- }
156
- /**
157
- * Transport capability a tool requires to function. This is the ONE contract
158
- * string shared with consuming hosts. e.g. cymru-os gates tools by carrier
159
- * availability via this flag (cymru-os RFC 0002 D-Bus "Capability-flag bridge").
160
- * The enum is FINAL and normalized with the cymru-os host; changing these
161
- * values must be coordinated (Linear label `requires:cymru-input`).
162
- *
163
- * - "any" works over any transport, incl. off-grid radio (small,
164
- * packet-friendly payloads). e.g. text DM.
165
- * - "radio" radio-specific path (e.g. Codec2 audio frames). Off-grid OK.
166
- * - "network" needs IP connectivity (server-hosted channels, email, public
167
- * join links, bridges). NOT available off-grid.
168
- */
169
- type CapabilityRequirement = "any" | "radio" | "network";
170
- /**
171
- * MCP tool annotations (spec `ToolAnnotations`, minus `title` which lives on the
172
- * tool itself). Connector UIs — Claude's included — group and gate tools by these
173
- * hints: `readOnlyHint: true` lands the tool in the read-only bucket (bulk-approvable),
174
- * `destructiveHint: true` marks it as destroying/overwriting user data at approval
175
- * time, and tools with NO annotations all fall into one flat "Other tools" bucket —
176
- * which is exactly how the mosADD connector looked until 2026-08-26 (84 tools, one
177
- * undifferentiated list; founder order: fix it).
178
- */
179
- interface MosaddToolAnnotations {
180
- /** Tool does not mutate anything. list/get/search/state/metrics class. */
181
- readOnlyHint?: boolean;
182
- /** Tool destroys or irreversibly overwrites data (delete/ban/revoke/edit-in-place). */
183
- destructiveHint?: boolean;
184
- /** Calling twice with the same args has no additional effect. */
185
- idempotentHint?: boolean;
186
- /** Tool reaches outside the mosADD closed world (e.g. sends external email). */
187
- openWorldHint?: boolean;
188
- }
189
- interface MosaddTool<TInput = unknown, TOutput = unknown> {
190
- /** Tool name. MUST follow the m{MODULE}_{operation} convention. */
191
- name: string;
192
- /**
193
- * Human title for connector UIs (e.g. "Send encrypted DM"). The `name` stays the
194
- * model-facing handle; this is what a PERSON sees in the permissions list.
195
- */
196
- title?: string;
197
- /** Short human-readable description. Shown to the model. */
198
- description: string;
199
- /** MCP annotations; see MosaddToolAnnotations. Every registered tool SHOULD set them. */
200
- annotations?: MosaddToolAnnotations;
201
- /**
202
- * Transport this tool requires. Consuming hosts read this to gate tools by
203
- * available carriers. Every tool MUST declare it explicitly.
204
- */
205
- requires: CapabilityRequirement;
206
- /** Zod schema for input. */
207
- inputSchema: z.ZodType<TInput>;
208
- /** Tool handler. */
209
- handler: (input: TInput, ctx: MosaddToolContext) => Promise<TOutput>;
210
- }
211
-
212
- /**
213
- * Build a McpServer instance with all mosadd tools registered.
214
- */
215
-
216
- /**
217
- * Resolve the channel ProviderRegistry: default network adapters merged with
218
- * anything the host injects. A carrier-aware host (cymru-os) passes its own
219
- * radio DmProvider via `injected.dm`. This is the single place the default
220
- * adapters are named — both `createMosaddServer` and the `@mosadd/ai` adapters
221
- * build their context through it so they stay in lockstep.
222
- */
223
- declare function defaultProviders(injected?: Partial<ProviderRegistry>): ProviderRegistry;
224
- declare function createMosaddServer(options?: MosaddServerOptions): McpServer;
225
-
226
- /**
227
- * Tool registry. Each m* module contributes a set of tools.
228
- *
229
- * User-facing modules (4): mDM, mIRC, mURL, mAYL — the re-arch (LINEAR-3938)
230
- * mAYL replaces the old mp0st name (mp0st_* still registered as back-compat
231
- * aliases via mail-aliases.ts; will be removed in a later alpha).
232
- *
233
- * Capabilities (not modules — cross-cutting agent tooling): mRAG, comms_.
234
- * mTALK = voice tier inside mIRC, still its own tools for now; folding into
235
- * mIRC_voice_* in a follow-up release. threat_* (threat_catalog + threat_classify)
236
- * are REGISTERED (2026-07-15, founder directive + LINEAR-3498): pure/offline
237
- * defensive classification over the threat taxonomy — the surveillance-era
238
- * *marketing* was killed, the classification engine is real and wanted.
239
- *
240
- * 85 callable tools registered — the exact live count is exported as TOOL_COUNT
241
- * (= allTools.length) below; ALWAYS reference that, never re-hard-code a number that drifts.
242
- * Breakdown (2026-09-03, from allTools in this tree; the live tools/list on mcp.mosadd.com catches up
243
- * when the alpha carrying mIRC_invite is published and the gateway redeployed):
244
- * modules mDM 16 · mIRC 25 · mURL 7 · mAYL 16 = 64; capabilities mTALK 6 · mRAG 8 ·
245
- * comms 5 (action_create/action_frame_get/embed_create/capabilities/session_attach) · Irondome/threat 2
246
- * = 21. 64 + 21 = 85. (mIRC 25 = 24 + mIRC_invite added 2026-09-03 (LINEAR-5870): mIRC_join adds the KEY's
247
- * identity while channel posts are signed by the AGENT, so every channel created from the toolkit was mute
248
- * until its agent was added from the app — mIRC_invite wraps channel-members-manage `invite`: own agent →
249
- * auto_joined, anyone else → invite code. mDM 16 = 14 + mDM_send_as_agent/mDM_list_my_agents added 2026-08-17: an MCP key
250
- * is bound to a USER, so an agent runtime wired up with its owner's key spoke AS THE OWNER — these
251
- * let it speak as an agent it OWNS instead, checked server-side. mRAG 8 = 4 search/ingest + 4 mRAG_graph_* traversal tools added 2026-08-11.
252
- * comms_session_attach added 2026-08-14: a live agent session claims the account's reply lane so
253
- * the cloud stand-in defers to it — the front door that used to be a script on one PC.)
254
- * (History of this line drifting: the 2026-07-17 breakdown ended "= 69"
255
- * — wrong twice over, its own terms summed to 71; the 07-30 rewrite said 73 and still had
256
- * mAYL at 12 after mAYL_send_as_agent had been re-registered, so it stayed wrong through the
257
- * four mAYL_agentbox_* tools landing on 08-06. Arithmetic in comments drifts; TOOL_COUNT
258
- * doesn't — and since 08-11 the anti-drift gate checks the PER-MODULE numbers too, not just
259
- * the total, so this comment cannot rot alone any more.)
260
- * (mDM/mIRC each include their 2 attachment tools from attachments.ts.)
261
- * Modules (4): mDM, mIRC, mURL, mAYL. Capabilities: mTALK (voice/PTT), mRAG, comms_, Irondome (threat_*).
262
- * mp0st_* stay as DEPRECATED back-compat aliases for mAYL_* (removed in a later alpha).
263
- * mAYL_send_as_agent + mTALK_ingest_ptt were RE-REGISTERED 2026-07-29: both had been disabled
264
- * on 07-14 notes that had since become false, and both were re-verified on authenticated calls.
265
- * comms_embed_create RE-REGISTERED 2026-07-17 (embed.mosadd.com/v1.js live — P3 of mURL→mIRC).
266
- * mROOM was KILLED (LINEAR-3414, channel re-cut → ephemeral private mIRC): its tools
267
- * live in tools/mroom.ts + mroom-messages.ts but are NOT registered here.
268
- * Plus action links: comms_action_create (agent → user one-link browser action,
269
- * incl. screen_share) + comms_action_frame_get (see the recipient's shared screen).
270
- * mURL is a FULL registered dev module (revived, founder 2026-06-27) — IRC-for-URLs,
271
- * agent-native; backends live (mosadd-edge + murl-channels EF). tools/murl.ts.
272
- * mURL now has full lifecycle: read/post/presence/list_channels (hub-key) PLUS owner-side
273
- * create/claim + update(branding/status) + delete (mURL_create/update/delete → murl-manage
274
- * EF, owner-scoped via user JWT — same auth as mURL_list_channels action='mine').
275
- * mCALL is carrier-pending (no telephony carrier live yet): its tools live in
276
- * tools/mcall.ts but are NOT registered here, so an agent only ever discovers
277
- * tools that actually work. Re-register the one line below when a carrier ships.
278
- */
279
-
280
- declare const allTools: MosaddTool[];
281
- /**
282
- * The exact, live number of callable tools this server registers. Reference THIS
283
- * (import { TOOL_COUNT }) in any code/doc surface that shows a tool count, instead
284
- * of hard-coding a number that silently drifts (the "70+/65/68" inconsistency that
285
- * bit us). Mirrors @mosadd/threat-engine's THREAT_EVENT_COUNT pattern.
286
- */
287
- declare const TOOL_COUNT: number;
288
-
289
- /**
290
- * Supabase provider for the alpha MCP server.
291
- *
292
- * Local BYOK mode: user supplies their own Supabase URL + anon key + user JWT
293
- * via env vars. The MCP server creates a per-request Supabase client and
294
- * invokes the mosadd Edge Functions on the user's behalf.
295
- *
296
- * In Phase 2 this is replaced by the hosted gateway (mcp.mosadd.com) which
297
- * holds keys server-side via the BYOK broker.
298
- */
299
-
300
- interface SupabaseEnv {
301
- url: string;
302
- anonKey: string;
303
- userJwt?: string;
304
- /** Stabilna tożsamość sesji dla bramy hostowanej (per klucz API) — patrz sessionId(). */
305
- sessionKey?: string;
306
- }
307
- /** Run `fn` (and every tool call it triggers) with a per-request Supabase session. */
308
- declare function runWithSupabaseEnv<T>(env: SupabaseEnv, fn: () => T): T;
309
-
310
- export { type MosaddServerOptions, type MosaddTool, type MosaddToolContext, type ProviderRegistry, type SupabaseEnv, TOOL_COUNT, allTools, createMosaddServer, defaultProviders, runWithSupabaseEnv };