@tribeunal/mcp-server 1.13.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/CHANGELOG.md +287 -0
- package/LICENSE +21 -0
- package/README.md +196 -0
- package/dist/auth/auth.d.ts +8 -0
- package/dist/auth/auth.d.ts.map +1 -0
- package/dist/auth/auth.js +14 -0
- package/dist/auth/auth.js.map +1 -0
- package/dist/client/api-client.d.ts +216 -0
- package/dist/client/api-client.d.ts.map +1 -0
- package/dist/client/api-client.js +325 -0
- package/dist/client/api-client.js.map +1 -0
- package/dist/client/from-env.d.ts +17 -0
- package/dist/client/from-env.d.ts.map +1 -0
- package/dist/client/from-env.js +25 -0
- package/dist/client/from-env.js.map +1 -0
- package/dist/core/instructions.d.ts +14 -0
- package/dist/core/instructions.d.ts.map +1 -0
- package/dist/core/instructions.js +21 -0
- package/dist/core/instructions.js.map +1 -0
- package/dist/core/stdio-register.d.ts +14 -0
- package/dist/core/stdio-register.d.ts.map +1 -0
- package/dist/core/stdio-register.js +39 -0
- package/dist/core/stdio-register.js.map +1 -0
- package/dist/core/tools.d.ts +1072 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +1041 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +19 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/activity.d.ts +98 -0
- package/dist/tools/activity.d.ts.map +1 -0
- package/dist/tools/activity.js +167 -0
- package/dist/tools/activity.js.map +1 -0
- package/dist/tools/cases.d.ts +154 -0
- package/dist/tools/cases.d.ts.map +1 -0
- package/dist/tools/cases.js +91 -0
- package/dist/tools/cases.js.map +1 -0
- package/dist/tools/comments.d.ts +29 -0
- package/dist/tools/comments.d.ts.map +1 -0
- package/dist/tools/comments.js +17 -0
- package/dist/tools/comments.js.map +1 -0
- package/dist/tools/decisions.d.ts +297 -0
- package/dist/tools/decisions.d.ts.map +1 -0
- package/dist/tools/decisions.js +102 -0
- package/dist/tools/decisions.js.map +1 -0
- package/dist/tools/jury-duty.d.ts +56 -0
- package/dist/tools/jury-duty.d.ts.map +1 -0
- package/dist/tools/jury-duty.js +39 -0
- package/dist/tools/jury-duty.js.map +1 -0
- package/dist/tools/sides.d.ts +15 -0
- package/dist/tools/sides.d.ts.map +1 -0
- package/dist/tools/sides.js +11 -0
- package/dist/tools/sides.js.map +1 -0
- package/dist/tools/trials.d.ts +78 -0
- package/dist/tools/trials.d.ts.map +1 -0
- package/dist/tools/trials.js +29 -0
- package/dist/tools/trials.js.map +1 -0
- package/dist/tools/tribes.d.ts +75 -0
- package/dist/tools/tribes.d.ts.map +1 -0
- package/dist/tools/tribes.js +47 -0
- package/dist/tools/tribes.js.map +1 -0
- package/dist/tools/users.d.ts +9 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +6 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/tools/uuid.d.ts +35 -0
- package/dist/tools/uuid.d.ts.map +1 -0
- package/dist/tools/uuid.js +77 -0
- package/dist/tools/uuid.js.map +1 -0
- package/dist/tools/votes.d.ts +45 -0
- package/dist/tools/votes.d.ts.map +1 -0
- package/dist/tools/votes.js +22 -0
- package/dist/tools/votes.js.map +1 -0
- package/dist/tools/webhooks.d.ts +26 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +39 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/utils/format.d.ts +4 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +24 -0
- package/dist/utils/format.js.map +1 -0
- package/llms-install.md +81 -0
- package/package.json +73 -0
- package/skills/README.md +43 -0
- package/skills/acting-on-verdicts/SKILL.md +103 -0
- package/skills/arbitrating-a-dispute/SKILL.md +107 -0
- package/skills/convening-a-team-jury/SKILL.md +94 -0
- package/skills/deciding-with-a-jury/SKILL.md +120 -0
- package/skills/serving-jury-duty/SKILL.md +90 -0
- package/skills/using-tribeunal/SKILL.md +56 -0
- package/skills/using-tribeunal/references/errors.md +54 -0
- package/skills/using-tribeunal/references/tools.md +53 -0
- package/skills/weighing-evidence/SKILL.md +94 -0
- package/skills/wiring-webhooks/SKILL.md +107 -0
- package/skills/wiring-webhooks/references/events.md +52 -0
- package/skills/wiring-webhooks/scripts/verify-signature.js +72 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-level guidance returned in the `initialize` result.
|
|
3
|
+
*
|
|
4
|
+
* The MCP spec lets a server ship a short prose brief that clients place in
|
|
5
|
+
* the model's context before any tool is called. This is the only place where
|
|
6
|
+
* cross-tool facts fit: a tool `description` is per-tool and cannot say "check
|
|
7
|
+
* timeLeft, not state" or "verdicts are asynchronous".
|
|
8
|
+
*
|
|
9
|
+
* Deliberately tiny. Anything longer than a handful of lines belongs in the
|
|
10
|
+
* Agent Skills shipped from `skills/` — this string's job is to name the facts
|
|
11
|
+
* that make an agent fail silently, and then point at them.
|
|
12
|
+
*/
|
|
13
|
+
export const SERVER_INSTRUCTIONS = `Tribeunal turns a question into a jury's verdict. Facts that span every tool here:
|
|
14
|
+
|
|
15
|
+
- Case, side, tribe and webhook ids are UUIDs. A numeric id or a slug will not resolve — look a case up with tribeunal_search_cases.
|
|
16
|
+
- A case stays "open" past its deadline until the close job runs. Check timeLeft before voting, not state.
|
|
17
|
+
- Verdicts are asynchronous: tribeunal_close_case answers decision_pending, and tribeunal_await_verdict long-polls for the ruling.
|
|
18
|
+
- A private case's url 404s for everyone but its owner and admins. Share the shareUrl it answers with instead.
|
|
19
|
+
- Workflows, settings recipes and error handling live in the Tribeunal Agent Skills — start with using-tribeunal.
|
|
20
|
+
In Claude Code: /plugin marketplace add tribeunal/mcp-server then /plugin install tribeunal`;
|
|
21
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/core/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;8FAO2D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import type { TribeunalAPIClient } from '../client/api-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Register the 38 Tribeunal tools on a low-level MCP `Server` (the stdio
|
|
5
|
+
* transport) using an injected API client.
|
|
6
|
+
*
|
|
7
|
+
* This file is the ONLY core module that imports the low-level `Server` from
|
|
8
|
+
* `@modelcontextprotocol/sdk`. It is used exclusively by the stdio entry point
|
|
9
|
+
* (`src/index.ts`). The Cloudflare worker registers the same TOOL_DEFINITIONS
|
|
10
|
+
* through its own agent (see worker/src/mcp-agent.ts) so the 39 tools stay
|
|
11
|
+
* byte-identical across both transports.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerTools(server: Server, apiClient: TribeunalAPIClient): void;
|
|
14
|
+
//# sourceMappingURL=stdio-register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-register.d.ts","sourceRoot":"","sources":["../../src/core/stdio-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAKnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAoCjF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { TOOL_DEFINITIONS, dispatchToolCall } from './tools.js';
|
|
3
|
+
/**
|
|
4
|
+
* Register the 38 Tribeunal tools on a low-level MCP `Server` (the stdio
|
|
5
|
+
* transport) using an injected API client.
|
|
6
|
+
*
|
|
7
|
+
* This file is the ONLY core module that imports the low-level `Server` from
|
|
8
|
+
* `@modelcontextprotocol/sdk`. It is used exclusively by the stdio entry point
|
|
9
|
+
* (`src/index.ts`). The Cloudflare worker registers the same TOOL_DEFINITIONS
|
|
10
|
+
* through its own agent (see worker/src/mcp-agent.ts) so the 39 tools stay
|
|
11
|
+
* byte-identical across both transports.
|
|
12
|
+
*/
|
|
13
|
+
export function registerTools(server, apiClient) {
|
|
14
|
+
// tools/list — advertise the shared tool definitions verbatim.
|
|
15
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
16
|
+
tools: TOOL_DEFINITIONS,
|
|
17
|
+
}));
|
|
18
|
+
// tools/call — route through the injected client. The long-poll await tools
|
|
19
|
+
// get a ctx so progress streams to the client (progressToken) and client
|
|
20
|
+
// cancellation aborts the wait (extra.signal); other tools ignore it.
|
|
21
|
+
server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
22
|
+
const { name, arguments: args } = request.params;
|
|
23
|
+
const progressToken = request.params._meta?.progressToken;
|
|
24
|
+
const ctx = {
|
|
25
|
+
signal: extra.signal,
|
|
26
|
+
reportProgress: progressToken === undefined
|
|
27
|
+
? undefined
|
|
28
|
+
: async (elapsedS, timeoutS, message) => {
|
|
29
|
+
await extra.sendNotification({
|
|
30
|
+
method: 'notifications/progress',
|
|
31
|
+
params: { progressToken, progress: elapsedS, total: timeoutS, message },
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
return dispatchToolCall(apiClient, name, args, ctx);
|
|
36
|
+
});
|
|
37
|
+
console.error('All tools registered successfully');
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=stdio-register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdio-register.js","sourceRoot":"","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