@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.
Files changed (102) hide show
  1. package/CHANGELOG.md +287 -0
  2. package/LICENSE +21 -0
  3. package/README.md +196 -0
  4. package/dist/auth/auth.d.ts +8 -0
  5. package/dist/auth/auth.d.ts.map +1 -0
  6. package/dist/auth/auth.js +14 -0
  7. package/dist/auth/auth.js.map +1 -0
  8. package/dist/client/api-client.d.ts +216 -0
  9. package/dist/client/api-client.d.ts.map +1 -0
  10. package/dist/client/api-client.js +325 -0
  11. package/dist/client/api-client.js.map +1 -0
  12. package/dist/client/from-env.d.ts +17 -0
  13. package/dist/client/from-env.d.ts.map +1 -0
  14. package/dist/client/from-env.js +25 -0
  15. package/dist/client/from-env.js.map +1 -0
  16. package/dist/core/instructions.d.ts +14 -0
  17. package/dist/core/instructions.d.ts.map +1 -0
  18. package/dist/core/instructions.js +21 -0
  19. package/dist/core/instructions.js.map +1 -0
  20. package/dist/core/stdio-register.d.ts +14 -0
  21. package/dist/core/stdio-register.d.ts.map +1 -0
  22. package/dist/core/stdio-register.js +39 -0
  23. package/dist/core/stdio-register.js.map +1 -0
  24. package/dist/core/tools.d.ts +1072 -0
  25. package/dist/core/tools.d.ts.map +1 -0
  26. package/dist/core/tools.js +1041 -0
  27. package/dist/core/tools.js.map +1 -0
  28. package/dist/index.d.ts +3 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +40 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/server.d.ts +15 -0
  33. package/dist/server.d.ts.map +1 -0
  34. package/dist/server.js +19 -0
  35. package/dist/server.js.map +1 -0
  36. package/dist/tools/activity.d.ts +98 -0
  37. package/dist/tools/activity.d.ts.map +1 -0
  38. package/dist/tools/activity.js +167 -0
  39. package/dist/tools/activity.js.map +1 -0
  40. package/dist/tools/cases.d.ts +154 -0
  41. package/dist/tools/cases.d.ts.map +1 -0
  42. package/dist/tools/cases.js +91 -0
  43. package/dist/tools/cases.js.map +1 -0
  44. package/dist/tools/comments.d.ts +29 -0
  45. package/dist/tools/comments.d.ts.map +1 -0
  46. package/dist/tools/comments.js +17 -0
  47. package/dist/tools/comments.js.map +1 -0
  48. package/dist/tools/decisions.d.ts +297 -0
  49. package/dist/tools/decisions.d.ts.map +1 -0
  50. package/dist/tools/decisions.js +102 -0
  51. package/dist/tools/decisions.js.map +1 -0
  52. package/dist/tools/jury-duty.d.ts +56 -0
  53. package/dist/tools/jury-duty.d.ts.map +1 -0
  54. package/dist/tools/jury-duty.js +39 -0
  55. package/dist/tools/jury-duty.js.map +1 -0
  56. package/dist/tools/sides.d.ts +15 -0
  57. package/dist/tools/sides.d.ts.map +1 -0
  58. package/dist/tools/sides.js +11 -0
  59. package/dist/tools/sides.js.map +1 -0
  60. package/dist/tools/trials.d.ts +78 -0
  61. package/dist/tools/trials.d.ts.map +1 -0
  62. package/dist/tools/trials.js +29 -0
  63. package/dist/tools/trials.js.map +1 -0
  64. package/dist/tools/tribes.d.ts +75 -0
  65. package/dist/tools/tribes.d.ts.map +1 -0
  66. package/dist/tools/tribes.js +47 -0
  67. package/dist/tools/tribes.js.map +1 -0
  68. package/dist/tools/users.d.ts +9 -0
  69. package/dist/tools/users.d.ts.map +1 -0
  70. package/dist/tools/users.js +6 -0
  71. package/dist/tools/users.js.map +1 -0
  72. package/dist/tools/uuid.d.ts +35 -0
  73. package/dist/tools/uuid.d.ts.map +1 -0
  74. package/dist/tools/uuid.js +77 -0
  75. package/dist/tools/uuid.js.map +1 -0
  76. package/dist/tools/votes.d.ts +45 -0
  77. package/dist/tools/votes.d.ts.map +1 -0
  78. package/dist/tools/votes.js +22 -0
  79. package/dist/tools/votes.js.map +1 -0
  80. package/dist/tools/webhooks.d.ts +26 -0
  81. package/dist/tools/webhooks.d.ts.map +1 -0
  82. package/dist/tools/webhooks.js +39 -0
  83. package/dist/tools/webhooks.js.map +1 -0
  84. package/dist/utils/format.d.ts +4 -0
  85. package/dist/utils/format.d.ts.map +1 -0
  86. package/dist/utils/format.js +24 -0
  87. package/dist/utils/format.js.map +1 -0
  88. package/llms-install.md +81 -0
  89. package/package.json +73 -0
  90. package/skills/README.md +43 -0
  91. package/skills/acting-on-verdicts/SKILL.md +103 -0
  92. package/skills/arbitrating-a-dispute/SKILL.md +107 -0
  93. package/skills/convening-a-team-jury/SKILL.md +94 -0
  94. package/skills/deciding-with-a-jury/SKILL.md +120 -0
  95. package/skills/serving-jury-duty/SKILL.md +90 -0
  96. package/skills/using-tribeunal/SKILL.md +56 -0
  97. package/skills/using-tribeunal/references/errors.md +54 -0
  98. package/skills/using-tribeunal/references/tools.md +53 -0
  99. package/skills/weighing-evidence/SKILL.md +94 -0
  100. package/skills/wiring-webhooks/SKILL.md +107 -0
  101. package/skills/wiring-webhooks/references/events.md +52 -0
  102. package/skills/wiring-webhooks/scripts/verify-signature.js +72 -0
@@ -0,0 +1,91 @@
1
+ import { z } from 'zod';
2
+ import { caseUuid } from './uuid.js';
3
+ // Case schemas — the single, canonical vocabulary advertised by the server.
4
+ // Case identifiers are UUIDs only (see ./uuid.ts): a numeric id or slug is
5
+ // rejected here rather than 500-ing backend-side.
6
+ export const SearchCasesSchema = z.object({
7
+ query: z.string().optional().describe('Search cases by title or description'),
8
+ status: z.enum(['init', 'jury_selection', 'open', 'closed', 'expired', 'suspended']).optional().describe('Filter by case status (open = accepting votes, jury_selection = still assembling its jury)'),
9
+ type: z.enum(['case', 'advice', 'poll']).optional().describe('Filter by case type — case (binding jury decision), advice (input for the creator), poll (opinion gathering)'),
10
+ tags: z.array(z.string()).optional().describe('Filter by tags'),
11
+ page: z.number().min(1).default(1).describe('Page number for pagination'),
12
+ limit: z.number().min(1).max(100).default(20).describe('Number of cases to return per page'),
13
+ });
14
+ export const GetCaseSchema = z.object({
15
+ id: caseUuid('Case UUID (the case\'s `uuid` field)'),
16
+ });
17
+ export const CreateCaseSchema = z.object({
18
+ title: z.string().min(3).max(200).describe('Case title — the question or statement to be decided'),
19
+ description: z.string().min(10).describe('Context, background, and criteria for the case'),
20
+ type: z.enum(['case', 'advice', 'poll']).describe('Case type — case (binding jury decision), advice (input for the creator), or poll (opinion gathering)'),
21
+ juryType: z.enum(['public', 'invited']).default('public').describe('Who can participate — public (anyone) or invited only'),
22
+ visibility: z.enum(['public', 'private']).default('public').describe('Case visibility — public (anyone can find and read it) or private (only you, your invited jurors and admins). A private case must use an invited jury; omit juryType and it is set to invited automatically. One exception: set allowsGuestVotes on a private case and it becomes a link-poll — still absent from every listing, search and feed, but readable and votable by anyone you send the link to — which takes a public jury instead.'),
23
+ sides: z.array(z.object({
24
+ name: z.string().describe('Option/choice name'),
25
+ description: z.string().optional().describe('Optional description for this choice'),
26
+ image: z.string().url().refine((u) => u.startsWith('https://'), { message: 'Side image URL must use https.' }).optional().describe('Optional https image URL for this choice — fetched and re-encoded server-side (png/jpeg/webp, <= 5 MB). Shown on the choice\'s vote card.'),
27
+ })).min(2).max(10).describe('The choices/options voters pick between (2-10)'),
28
+ caseLength: z.number().min(60).max(2592000).default(86400).describe('Voting duration in seconds (min: 1 minute, max: 30 days, default: 1 day)'),
29
+ maxAiJurorPercentage: z.number().int().min(0).max(100).optional().describe('Maximum percentage of jurors that may be AI personas (0 = none allowed, 100 = all; default 50)'),
30
+ jurorCount: z.number().int().min(2).max(100).optional().describe('Number of jurors the case asks for (2-100, default 12). It gates opening only when openImmediately is false, where the case waits until this many jurors have joined. For a small invited panel, set this to the number of people you invite.'),
31
+ openImmediately: z.boolean().optional().describe('Open the case for voting straight away (default true). Invited jurors are still invited and can view, join and vote while it is already open. Set false to hold the case in jury selection until jurorCount jurors have joined, and only then open it.'),
32
+ allowsGuestVotes: z.boolean().optional().describe('Let visitors without a Tribeunal account vote on this case (default false). Guest votes count in full — they enter the tallies, percentages and the verdict exactly like a registered juror\'s. Requires a public jury; visibility may be either, and pairing it with visibility "private" makes a link-poll: unlisted everywhere, but votable by whoever holds the link. Guests are deduplicated per browser, so a returning visitor changes their vote rather than adding one, but someone determined can still vote again from another browser — enable it where reach matters more than strict one-person-one-vote.'),
33
+ arbitrationMode: z.boolean().optional().describe('Bind this case to arbitration rules, for a verdict someone outside the case has to rely on (default false). You cannot vote on, join the jury of, or close early a case you created in this mode — an admin closes it, or it closes at its deadline; evidence marks freeze once it closes so the record it was decided on stops moving; and the early-vote and decisive-vote reward multipliers are switched off, so timing your vote no longer multiplies your payout. Requires minVotes of at least 2 (omit it and 3 is used) and cannot be combined with allowsGuestVotes. Use it when the case settles something with stakes — a dispute, a payout, a contract term — rather than gathering opinion.'),
34
+ decisionRequirement: z.enum(['any', 'simple', 'qualified', 'unanimous']).optional().describe('The weakest outcome this case will accept as a verdict (default "any"). "any" takes whatever the tally gives, down to a plurality. "simple" needs at least half, "qualified" at least 66%, "unanimous" every vote on one side. A case that reaches a stronger result than required still reports the stronger one. On any value other than "any", missing the requirement closes the case with a Void verdict carrying voidReason "requirement_not_met"; an "any" case that merely ties stays Undecided.'),
35
+ minVotes: z.number().int().min(0).max(100).optional().describe('Fewest votes this case needs before it can reach a verdict (0-100, default 0 = no minimum). Close it with fewer and it ends with a Void verdict carrying voidReason "quorum_not_met" rather than deciding on a turnout of one or two.'),
36
+ tags: z.array(z.string()).max(4).optional().describe('Up to 4 tags for categorization'),
37
+ }).superRefine((data, ctx) => {
38
+ // A private case is normally visible only to its owner, invited jurors and admins, so
39
+ // it must run an invited jury. The exception is the link-poll: a private case that
40
+ // allows anonymous voting is deliberately open to whoever holds its link, and that
41
+ // audience needs a public jury to vote at all. The handler pre-coerces an omitted
42
+ // juryType, so reaching here with a mismatch means the caller asked for it explicitly.
43
+ const isLinkPoll = data.visibility === 'private'
44
+ && data.allowsGuestVotes === true
45
+ && data.juryType === 'public';
46
+ if (data.visibility === 'private' && data.juryType !== 'invited' && !isLinkPoll) {
47
+ ctx.addIssue({
48
+ code: z.ZodIssueCode.custom,
49
+ path: ['juryType'],
50
+ message: 'A private case must use an invited jury (set juryType to "invited"), unless it allows anonymous voting — set allowsGuestVotes to make it a link-poll with a public jury.',
51
+ });
52
+ }
53
+ // Anonymous voting needs a jury anyone can join; a guest holds no seat on an invited
54
+ // panel. Visibility is deliberately not part of this rule. Caught here so the caller
55
+ // gets a named parameter and a reason instead of a bare 400 from the backend, which
56
+ // enforces the same rule in an entity constraint and a DB CHECK.
57
+ if (data.allowsGuestVotes === true && data.juryType !== 'public') {
58
+ ctx.addIssue({
59
+ code: z.ZodIssueCode.custom,
60
+ path: ['allowsGuestVotes'],
61
+ message: 'Anonymous voting requires a public jury.',
62
+ });
63
+ }
64
+ // A verdict an outside party is meant to rely on cannot rest on voters nobody can hold
65
+ // to account, nor on a turnout of one. Caught here so the caller gets a named parameter
66
+ // and a reason instead of a bare 400 from the backend, which enforces the same two rules
67
+ // in an entity constraint and a DB CHECK.
68
+ if (data.arbitrationMode === true) {
69
+ if (data.allowsGuestVotes === true) {
70
+ ctx.addIssue({
71
+ code: z.ZodIssueCode.custom,
72
+ path: ['allowsGuestVotes'],
73
+ message: 'An arbitration case cannot allow anonymous voting — its voters must be accountable.',
74
+ });
75
+ }
76
+ if (data.minVotes !== undefined && data.minVotes < 2) {
77
+ ctx.addIssue({
78
+ code: z.ZodIssueCode.custom,
79
+ path: ['minVotes'],
80
+ message: 'An arbitration case requires a quorum of at least 2 votes; omit minVotes to use 3.',
81
+ });
82
+ }
83
+ }
84
+ });
85
+ export const ListEvidenceSchema = z.object({
86
+ caseId: caseUuid('Case UUID to get evidence for'),
87
+ });
88
+ export const CloseCaseSchema = z.object({
89
+ caseId: caseUuid('Case UUID of the open or jury_selection case to close early (you must be the case owner, or an admin)'),
90
+ });
91
+ //# sourceMappingURL=cases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cases.js","sourceRoot":"","sources":["../../src/tools/cases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAA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,qFAAqF;aAC/F,CAAC,CAAC;QACL,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;YACrD,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,OAAO,EAAE,oFAAoF;aAC9F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,QAAQ,CAAC,+BAA+B,CAAC;CAClD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,QAAQ,CAAC,uGAAuG,CAAC;CAC1H,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const PostCommentSchema: z.ZodObject<{
3
+ caseId: z.ZodString;
4
+ text: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ text: string;
7
+ caseId: string;
8
+ }, {
9
+ text: string;
10
+ caseId: string;
11
+ }>;
12
+ export declare const ListCommentsSchema: z.ZodObject<{
13
+ caseId: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ caseId: string;
16
+ }, {
17
+ caseId: string;
18
+ }>;
19
+ export declare const MarkEvidenceSchema: z.ZodObject<{
20
+ kind: z.ZodEnum<["comment", "file"]>;
21
+ id: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ id: string;
24
+ kind: "comment" | "file";
25
+ }, {
26
+ id: string;
27
+ kind: "comment" | "file";
28
+ }>;
29
+ //# sourceMappingURL=comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { caseUuid } from './uuid.js';
3
+ // Comment & evidence-mark schemas. Evidence is no longer submitted directly:
4
+ // users post comments, and the case owner / jury members MARK a comment or a
5
+ // case file as evidence. Case identifiers are UUIDs only (see ./uuid.ts).
6
+ export const PostCommentSchema = z.object({
7
+ caseId: caseUuid('Case UUID to comment on'),
8
+ text: z.string().min(1).max(5000).describe('Comment text (1-5000 chars) — e.g. your analysis of the case, in your own voice'),
9
+ });
10
+ export const ListCommentsSchema = z.object({
11
+ caseId: caseUuid('Case UUID to list comments for'),
12
+ });
13
+ export const MarkEvidenceSchema = z.object({
14
+ kind: z.enum(['comment', 'file']).describe("What to (un)mark: 'comment' (a case comment) or 'file' (a case file)"),
15
+ id: z.string().describe('UUID of the comment or case file'),
16
+ });
17
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/tools/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,6EAA6E;AAC7E,6EAA6E;AAC7E,0EAA0E;AAE1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,iFAAiF,CAAC;CAC9H,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,QAAQ,CAAC,gCAAgC,CAAC;CACnD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,sEAAsE,CAAC;IAClH,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;CAC5D,CAAC,CAAC"}
@@ -0,0 +1,297 @@
1
+ import { z } from 'zod';
2
+ export declare const QuickYesNoSchema: z.ZodObject<{
3
+ question: z.ZodString;
4
+ context: z.ZodOptional<z.ZodString>;
5
+ urgency: z.ZodDefault<z.ZodEnum<["low", "medium", "high", "critical"]>>;
6
+ stakeholders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ question: string;
10
+ urgency: "low" | "medium" | "high" | "critical";
11
+ categories?: string[] | undefined;
12
+ stakeholders?: string[] | undefined;
13
+ context?: string | undefined;
14
+ }, {
15
+ question: string;
16
+ categories?: string[] | undefined;
17
+ stakeholders?: string[] | undefined;
18
+ context?: string | undefined;
19
+ urgency?: "low" | "medium" | "high" | "critical" | undefined;
20
+ }>;
21
+ export declare const CompareOptionsSchema: z.ZodObject<{
22
+ decision: z.ZodString;
23
+ options: z.ZodArray<z.ZodObject<{
24
+ name: z.ZodString;
25
+ description: z.ZodString;
26
+ pros: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
27
+ cons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ description: string;
30
+ name: string;
31
+ pros?: string[] | undefined;
32
+ cons?: string[] | undefined;
33
+ }, {
34
+ description: string;
35
+ name: string;
36
+ pros?: string[] | undefined;
37
+ cons?: string[] | undefined;
38
+ }>, "many">;
39
+ criteria: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ timeframe: z.ZodDefault<z.ZodNumber>;
41
+ stakeholders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ options: {
44
+ description: string;
45
+ name: string;
46
+ pros?: string[] | undefined;
47
+ cons?: string[] | undefined;
48
+ }[];
49
+ timeframe: number;
50
+ decision: string;
51
+ stakeholders?: string[] | undefined;
52
+ criteria?: string[] | undefined;
53
+ }, {
54
+ options: {
55
+ description: string;
56
+ name: string;
57
+ pros?: string[] | undefined;
58
+ cons?: string[] | undefined;
59
+ }[];
60
+ decision: string;
61
+ timeframe?: number | undefined;
62
+ stakeholders?: string[] | undefined;
63
+ criteria?: string[] | undefined;
64
+ }>;
65
+ export declare const SeekExpertOpinionSchema: z.ZodObject<{
66
+ topic: z.ZodString;
67
+ question: z.ZodString;
68
+ context: z.ZodString;
69
+ expertiseAreas: z.ZodArray<z.ZodString, "many">;
70
+ urgency: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ question: string;
73
+ context: string;
74
+ urgency: "low" | "medium" | "high";
75
+ topic: string;
76
+ expertiseAreas: string[];
77
+ }, {
78
+ question: string;
79
+ context: string;
80
+ topic: string;
81
+ expertiseAreas: string[];
82
+ urgency?: "low" | "medium" | "high" | undefined;
83
+ }>;
84
+ export declare const PollStakeholdersSchema: z.ZodObject<{
85
+ topic: z.ZodString;
86
+ question: z.ZodString;
87
+ stakeholderGroups: z.ZodArray<z.ZodString, "many">;
88
+ options: z.ZodArray<z.ZodObject<{
89
+ name: z.ZodString;
90
+ description: z.ZodOptional<z.ZodString>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ name: string;
93
+ description?: string | undefined;
94
+ }, {
95
+ name: string;
96
+ description?: string | undefined;
97
+ }>, "many">;
98
+ anonymous: z.ZodDefault<z.ZodBoolean>;
99
+ deadline: z.ZodDefault<z.ZodNumber>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ options: {
102
+ name: string;
103
+ description?: string | undefined;
104
+ }[];
105
+ question: string;
106
+ topic: string;
107
+ stakeholderGroups: string[];
108
+ anonymous: boolean;
109
+ deadline: number;
110
+ }, {
111
+ options: {
112
+ name: string;
113
+ description?: string | undefined;
114
+ }[];
115
+ question: string;
116
+ topic: string;
117
+ stakeholderGroups: string[];
118
+ anonymous?: boolean | undefined;
119
+ deadline?: number | undefined;
120
+ }>;
121
+ export declare const ConsensusBuilderSchema: z.ZodObject<{
122
+ initiative: z.ZodString;
123
+ description: z.ZodString;
124
+ stakeholderGroups: z.ZodArray<z.ZodString, "many">;
125
+ consensusThreshold: z.ZodDefault<z.ZodEnum<["simple_majority", "qualified_majority", "unanimous"]>>;
126
+ phases: z.ZodOptional<z.ZodArray<z.ZodObject<{
127
+ name: z.ZodString;
128
+ description: z.ZodString;
129
+ duration: z.ZodNumber;
130
+ }, "strip", z.ZodTypeAny, {
131
+ description: string;
132
+ name: string;
133
+ duration: number;
134
+ }, {
135
+ description: string;
136
+ name: string;
137
+ duration: number;
138
+ }>, "many">>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ description: string;
141
+ stakeholderGroups: string[];
142
+ initiative: string;
143
+ consensusThreshold: "simple_majority" | "qualified_majority" | "unanimous";
144
+ phases?: {
145
+ description: string;
146
+ name: string;
147
+ duration: number;
148
+ }[] | undefined;
149
+ }, {
150
+ description: string;
151
+ stakeholderGroups: string[];
152
+ initiative: string;
153
+ consensusThreshold?: "simple_majority" | "qualified_majority" | "unanimous" | undefined;
154
+ phases?: {
155
+ description: string;
156
+ name: string;
157
+ duration: number;
158
+ }[] | undefined;
159
+ }>;
160
+ export declare const AnalyzeReadinessSchema: z.ZodObject<{
161
+ decisionId: z.ZodString;
162
+ criteria: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ decisionId: string;
165
+ criteria?: string[] | undefined;
166
+ }, {
167
+ decisionId: string;
168
+ criteria?: string[] | undefined;
169
+ }>;
170
+ export declare const PredictOutcomeSchema: z.ZodObject<{
171
+ decisionId: z.ZodString;
172
+ includeConfidence: z.ZodDefault<z.ZodBoolean>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ decisionId: string;
175
+ includeConfidence: boolean;
176
+ }, {
177
+ decisionId: string;
178
+ includeConfidence?: boolean | undefined;
179
+ }>;
180
+ export declare const IdentifyBiasSchema: z.ZodObject<{
181
+ decisionId: z.ZodString;
182
+ biasTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<["selection", "confirmation", "availability", "anchoring", "participation"]>, "many">>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ decisionId: string;
185
+ biasTypes?: ("selection" | "confirmation" | "availability" | "anchoring" | "participation")[] | undefined;
186
+ }, {
187
+ decisionId: string;
188
+ biasTypes?: ("selection" | "confirmation" | "availability" | "anchoring" | "participation")[] | undefined;
189
+ }>;
190
+ export declare const FindSimilarDecisionsSchema: z.ZodObject<{
191
+ topic: z.ZodString;
192
+ decisionType: z.ZodOptional<z.ZodEnum<["case", "advice", "poll"]>>;
193
+ timeframe: z.ZodDefault<z.ZodEnum<["week", "month", "quarter", "year", "all"]>>;
194
+ includeOutcomes: z.ZodDefault<z.ZodBoolean>;
195
+ }, "strip", z.ZodTypeAny, {
196
+ timeframe: "week" | "month" | "quarter" | "year" | "all";
197
+ topic: string;
198
+ includeOutcomes: boolean;
199
+ decisionType?: "case" | "advice" | "poll" | undefined;
200
+ }, {
201
+ topic: string;
202
+ decisionType?: "case" | "advice" | "poll" | undefined;
203
+ timeframe?: "week" | "month" | "quarter" | "year" | "all" | undefined;
204
+ includeOutcomes?: boolean | undefined;
205
+ }>;
206
+ export declare const CalculateConfidenceSchema: z.ZodObject<{
207
+ decisionId: z.ZodString;
208
+ factors: z.ZodOptional<z.ZodArray<z.ZodEnum<["participation_rate", "evidence_quality", "expert_involvement", "consensus_level", "time_adequacy"]>, "many">>;
209
+ }, "strip", z.ZodTypeAny, {
210
+ decisionId: string;
211
+ factors?: ("participation_rate" | "evidence_quality" | "expert_involvement" | "consensus_level" | "time_adequacy")[] | undefined;
212
+ }, {
213
+ decisionId: string;
214
+ factors?: ("participation_rate" | "evidence_quality" | "expert_involvement" | "consensus_level" | "time_adequacy")[] | undefined;
215
+ }>;
216
+ export declare const ScheduleReminderSchema: z.ZodObject<{
217
+ decisionId: z.ZodString;
218
+ reminderType: z.ZodEnum<["deadline_approaching", "low_participation", "consensus_reached", "custom"]>;
219
+ timing: z.ZodNumber;
220
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
221
+ message: z.ZodOptional<z.ZodString>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ decisionId: string;
224
+ reminderType: "custom" | "deadline_approaching" | "low_participation" | "consensus_reached";
225
+ timing: number;
226
+ message?: string | undefined;
227
+ recipients?: string[] | undefined;
228
+ }, {
229
+ decisionId: string;
230
+ reminderType: "custom" | "deadline_approaching" | "low_participation" | "consensus_reached";
231
+ timing: number;
232
+ message?: string | undefined;
233
+ recipients?: string[] | undefined;
234
+ }>;
235
+ export declare const EscalateDeadlockSchema: z.ZodObject<{
236
+ decisionId: z.ZodString;
237
+ reason: z.ZodString;
238
+ escalationType: z.ZodEnum<["expert_review", "extended_timeline", "stakeholder_expansion", "mediation"]>;
239
+ newStakeholders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ decisionId: string;
242
+ reason: string;
243
+ escalationType: "expert_review" | "extended_timeline" | "stakeholder_expansion" | "mediation";
244
+ newStakeholders?: string[] | undefined;
245
+ }, {
246
+ decisionId: string;
247
+ reason: string;
248
+ escalationType: "expert_review" | "extended_timeline" | "stakeholder_expansion" | "mediation";
249
+ newStakeholders?: string[] | undefined;
250
+ }>;
251
+ export declare const ImplementOutcomeSchema: z.ZodObject<{
252
+ decisionId: z.ZodString;
253
+ actionItems: z.ZodArray<z.ZodObject<{
254
+ task: z.ZodString;
255
+ assignee: z.ZodOptional<z.ZodString>;
256
+ deadline: z.ZodOptional<z.ZodNumber>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ task: string;
259
+ deadline?: number | undefined;
260
+ assignee?: string | undefined;
261
+ }, {
262
+ task: string;
263
+ deadline?: number | undefined;
264
+ assignee?: string | undefined;
265
+ }>, "many">;
266
+ trackingMethod: z.ZodDefault<z.ZodEnum<["manual", "automated", "milestone"]>>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ decisionId: string;
269
+ actionItems: {
270
+ task: string;
271
+ deadline?: number | undefined;
272
+ assignee?: string | undefined;
273
+ }[];
274
+ trackingMethod: "manual" | "automated" | "milestone";
275
+ }, {
276
+ decisionId: string;
277
+ actionItems: {
278
+ task: string;
279
+ deadline?: number | undefined;
280
+ assignee?: string | undefined;
281
+ }[];
282
+ trackingMethod?: "manual" | "automated" | "milestone" | undefined;
283
+ }>;
284
+ export declare const TrackImplementationSchema: z.ZodObject<{
285
+ decisionId: z.ZodString;
286
+ includeProgress: z.ZodDefault<z.ZodBoolean>;
287
+ includeBlockers: z.ZodDefault<z.ZodBoolean>;
288
+ }, "strip", z.ZodTypeAny, {
289
+ decisionId: string;
290
+ includeProgress: boolean;
291
+ includeBlockers: boolean;
292
+ }, {
293
+ decisionId: string;
294
+ includeProgress?: boolean | undefined;
295
+ includeBlockers?: boolean | undefined;
296
+ }>;
297
+ //# sourceMappingURL=decisions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../../src/tools/decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAM3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW/B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAKrC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;EAMjC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAKjC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { z } from 'zod';
2
+ // High-level decision workflow schemas
3
+ export const QuickYesNoSchema = z.object({
4
+ question: z.string().min(10).describe('Clear yes/no question for quick community input'),
5
+ context: z.string().optional().describe('Background context to help decision makers understand the situation'),
6
+ urgency: z.enum(['low', 'medium', 'high', 'critical']).default('medium').describe('Urgency level affecting timeline and notifications'),
7
+ stakeholders: z.array(z.string()).optional().describe('Specific people to notify about this decision (emails or usernames)'),
8
+ categories: z.array(z.string()).optional().describe('Categories for organization'),
9
+ });
10
+ export const CompareOptionsSchema = z.object({
11
+ decision: z.string().min(10).describe('What decision needs to be made'),
12
+ options: z.array(z.object({
13
+ name: z.string().describe('Option name'),
14
+ description: z.string().describe('Detailed description of this option'),
15
+ pros: z.array(z.string()).optional().describe('Advantages of this option'),
16
+ cons: z.array(z.string()).optional().describe('Disadvantages of this option'),
17
+ })).min(2).max(5).describe('Options to compare (2-5 options recommended for clear comparison)'),
18
+ criteria: z.array(z.string()).optional().describe('Evaluation criteria for comparing options (e.g., cost, time, risk)'),
19
+ timeframe: z.number().default(172800).describe('Decision timeframe in seconds (default: 2 days for thorough comparison)'),
20
+ stakeholders: z.array(z.string()).optional().describe('Key stakeholders to involve in comparison'),
21
+ });
22
+ export const SeekExpertOpinionSchema = z.object({
23
+ topic: z.string().describe('Topic or domain requiring expert input'),
24
+ question: z.string().describe('Specific question for experts to address'),
25
+ context: z.string().describe('Background information and why expert opinion is needed'),
26
+ expertiseAreas: z.array(z.string()).describe('Required areas of expertise or knowledge'),
27
+ urgency: z.enum(['low', 'medium', 'high']).default('medium').describe('How quickly expert input is needed'),
28
+ });
29
+ export const PollStakeholdersSchema = z.object({
30
+ topic: z.string().describe('Topic or issue to poll stakeholders about'),
31
+ question: z.string().describe('Specific question or decision point'),
32
+ stakeholderGroups: z.array(z.string()).describe('Specific groups or individuals to poll (emails, usernames, or group names)'),
33
+ options: z.array(z.object({
34
+ name: z.string().describe('Option name'),
35
+ description: z.string().optional().describe('Option details'),
36
+ })).min(2).describe('Available response options'),
37
+ anonymous: z.boolean().default(false).describe('Whether responses should be anonymous'),
38
+ deadline: z.number().default(259200).describe('Response deadline in seconds (default: 3 days)'),
39
+ });
40
+ export const ConsensusBuilderSchema = z.object({
41
+ initiative: z.string().describe('Initiative or change requiring consensus'),
42
+ description: z.string().describe('Detailed description of what consensus is needed for'),
43
+ stakeholderGroups: z.array(z.string()).describe('Groups that need to agree'),
44
+ consensusThreshold: z.enum(['simple_majority', 'qualified_majority', 'unanimous']).default('qualified_majority').describe('Level of agreement required'),
45
+ phases: z.array(z.object({
46
+ name: z.string().describe('Phase name'),
47
+ description: z.string().describe('What happens in this phase'),
48
+ duration: z.number().describe('Phase duration in seconds'),
49
+ })).optional().describe('Optional: break consensus building into phases'),
50
+ });
51
+ // Decision analysis schemas
52
+ export const AnalyzeReadinessSchema = z.object({
53
+ decisionId: z.string().describe('Decision ID to analyze for readiness'),
54
+ criteria: z.array(z.string()).optional().describe('Specific readiness criteria to check'),
55
+ });
56
+ export const PredictOutcomeSchema = z.object({
57
+ decisionId: z.string().describe('Decision ID to predict likely outcome based on current data'),
58
+ includeConfidence: z.boolean().default(true).describe('Include confidence level in prediction'),
59
+ });
60
+ export const IdentifyBiasSchema = z.object({
61
+ decisionId: z.string().describe('Decision ID to analyze for potential bias in evidence or participation'),
62
+ biasTypes: z.array(z.enum(['selection', 'confirmation', 'availability', 'anchoring', 'participation'])).optional().describe('Specific bias types to check for'),
63
+ });
64
+ export const FindSimilarDecisionsSchema = z.object({
65
+ topic: z.string().describe('Topic or keywords to find similar past decisions'),
66
+ decisionType: z.enum(['case', 'advice', 'poll']).optional().describe('Filter by decision type'),
67
+ timeframe: z.enum(['week', 'month', 'quarter', 'year', 'all']).default('year').describe('How far back to search'),
68
+ includeOutcomes: z.boolean().default(true).describe('Include decision outcomes and effectiveness'),
69
+ });
70
+ export const CalculateConfidenceSchema = z.object({
71
+ decisionId: z.string().describe('Decision ID to calculate confidence score for'),
72
+ factors: z.array(z.enum(['participation_rate', 'evidence_quality', 'expert_involvement', 'consensus_level', 'time_adequacy'])).optional().describe('Specific confidence factors to evaluate'),
73
+ });
74
+ // Workflow automation schemas
75
+ export const ScheduleReminderSchema = z.object({
76
+ decisionId: z.string().describe('Decision ID to set reminders for'),
77
+ reminderType: z.enum(['deadline_approaching', 'low_participation', 'consensus_reached', 'custom']).describe('Type of reminder to schedule'),
78
+ timing: z.number().describe('When to send reminder (seconds before deadline or absolute timestamp)'),
79
+ recipients: z.array(z.string()).optional().describe('Specific recipients for reminder (if not all stakeholders)'),
80
+ message: z.string().optional().describe('Custom reminder message'),
81
+ });
82
+ export const EscalateDeadlockSchema = z.object({
83
+ decisionId: z.string().describe('Stalled decision ID to escalate'),
84
+ reason: z.string().describe('Why escalation is needed (deadlock, low participation, etc.)'),
85
+ escalationType: z.enum(['expert_review', 'extended_timeline', 'stakeholder_expansion', 'mediation']).describe('Type of escalation to apply'),
86
+ newStakeholders: z.array(z.string()).optional().describe('Additional stakeholders to involve in escalation'),
87
+ });
88
+ export const ImplementOutcomeSchema = z.object({
89
+ decisionId: z.string().describe('Completed decision ID to implement'),
90
+ actionItems: z.array(z.object({
91
+ task: z.string().describe('Specific action to take'),
92
+ assignee: z.string().optional().describe('Who is responsible'),
93
+ deadline: z.number().optional().describe('Completion deadline timestamp'),
94
+ })).describe('Action items to implement the decision'),
95
+ trackingMethod: z.enum(['manual', 'automated', 'milestone']).default('manual').describe('How to track implementation progress'),
96
+ });
97
+ export const TrackImplementationSchema = z.object({
98
+ decisionId: z.string().describe('Decision ID to track implementation for'),
99
+ includeProgress: z.boolean().default(true).describe('Include progress details and completion status'),
100
+ includeBlockers: z.boolean().default(true).describe('Include any implementation blockers or issues'),
101
+ });
102
+ //# sourceMappingURL=decisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decisions.js","sourceRoot":"","sources":["../../src/tools/decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACxF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qEAAqE,CAAC;IAC9G,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IACvI,YAA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I,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAC1E,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACrG,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;CACrG,CAAC,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+ export declare const JuryDutyStatusSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3
+ export declare const JuryDutyAllowanceSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
4
+ export declare const JuryDutyDashboardSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
5
+ export declare const JuryDutyStartSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
6
+ export declare const JuryDutyCancelSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
7
+ export declare const JuryDutyAcceptSchema: z.ZodObject<{
8
+ memberId: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ memberId: string;
11
+ }, {
12
+ memberId: string;
13
+ }>;
14
+ export declare const JuryDutyRejectSchema: z.ZodObject<{
15
+ memberId: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ memberId: string;
18
+ }, {
19
+ memberId: string;
20
+ }>;
21
+ export declare const JuryDutyHistorySchema: z.ZodObject<{
22
+ days: z.ZodDefault<z.ZodNumber>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ days: number;
25
+ }, {
26
+ days?: number | undefined;
27
+ }>;
28
+ export declare const JoinJurySchema: z.ZodObject<{
29
+ caseId: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ caseId: string;
32
+ }, {
33
+ caseId: string;
34
+ }>;
35
+ export declare const InviteJurorsSchema: z.ZodEffects<z.ZodObject<{
36
+ caseId: z.ZodString;
37
+ invitees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
+ tribeId: z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ caseId: string;
41
+ invitees?: string[] | undefined;
42
+ tribeId?: string | undefined;
43
+ }, {
44
+ caseId: string;
45
+ invitees?: string[] | undefined;
46
+ tribeId?: string | undefined;
47
+ }>, {
48
+ caseId: string;
49
+ invitees?: string[] | undefined;
50
+ tribeId?: string | undefined;
51
+ }, {
52
+ caseId: string;
53
+ invitees?: string[] | undefined;
54
+ tribeId?: string | undefined;
55
+ }>;
56
+ //# sourceMappingURL=jury-duty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jury-duty.d.ts","sourceRoot":"","sources":["../../src/tools/jury-duty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB,gDAAe,CAAC;AACjD,eAAO,MAAM,uBAAuB,gDAAe,CAAC;AACpD,eAAO,MAAM,uBAAuB,gDAAe,CAAC;AAGpD,eAAO,MAAM,mBAAmB,gDAAe,CAAC;AAChD,eAAO,MAAM,oBAAoB,gDAAe,CAAC;AAGjD,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAGH,eAAO,MAAM,qBAAqB;;;;;;EAGhC,CAAC;AAIH,eAAO,MAAM,cAAc;;;;;;EAEzB,CAAC;AAMH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;EAO7B,CAAC"}