@voxos-ai/clink-mcp-server 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.
Files changed (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +382 -0
  3. package/dist/client.d.ts +285 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +414 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/index.d.ts +9 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +95 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/tools/add_checkpoint.d.ts +68 -0
  12. package/dist/tools/add_checkpoint.d.ts.map +1 -0
  13. package/dist/tools/add_checkpoint.js +108 -0
  14. package/dist/tools/add_checkpoint.js.map +1 -0
  15. package/dist/tools/archive_project.d.ts +23 -0
  16. package/dist/tools/archive_project.d.ts.map +1 -0
  17. package/dist/tools/archive_project.js +44 -0
  18. package/dist/tools/archive_project.js.map +1 -0
  19. package/dist/tools/cast_vote.d.ts +38 -0
  20. package/dist/tools/cast_vote.d.ts.map +1 -0
  21. package/dist/tools/cast_vote.js +148 -0
  22. package/dist/tools/cast_vote.js.map +1 -0
  23. package/dist/tools/check_inbox.d.ts +39 -0
  24. package/dist/tools/check_inbox.d.ts.map +1 -0
  25. package/dist/tools/check_inbox.js +99 -0
  26. package/dist/tools/check_inbox.js.map +1 -0
  27. package/dist/tools/claim_clink.d.ts +28 -0
  28. package/dist/tools/claim_clink.d.ts.map +1 -0
  29. package/dist/tools/claim_clink.js +51 -0
  30. package/dist/tools/claim_clink.js.map +1 -0
  31. package/dist/tools/complete_checkpoint.d.ts +33 -0
  32. package/dist/tools/complete_checkpoint.d.ts.map +1 -0
  33. package/dist/tools/complete_checkpoint.js +143 -0
  34. package/dist/tools/complete_checkpoint.js.map +1 -0
  35. package/dist/tools/complete_clink.d.ts +28 -0
  36. package/dist/tools/complete_clink.d.ts.map +1 -0
  37. package/dist/tools/complete_clink.js +50 -0
  38. package/dist/tools/complete_clink.js.map +1 -0
  39. package/dist/tools/complete_project.d.ts +23 -0
  40. package/dist/tools/complete_project.d.ts.map +1 -0
  41. package/dist/tools/complete_project.js +44 -0
  42. package/dist/tools/complete_project.js.map +1 -0
  43. package/dist/tools/create_milestone.d.ts +91 -0
  44. package/dist/tools/create_milestone.d.ts.map +1 -0
  45. package/dist/tools/create_milestone.js +114 -0
  46. package/dist/tools/create_milestone.js.map +1 -0
  47. package/dist/tools/create_project.d.ts +43 -0
  48. package/dist/tools/create_project.d.ts.map +1 -0
  49. package/dist/tools/create_project.js +77 -0
  50. package/dist/tools/create_project.js.map +1 -0
  51. package/dist/tools/create_proposal.d.ts +58 -0
  52. package/dist/tools/create_proposal.d.ts.map +1 -0
  53. package/dist/tools/create_proposal.js +102 -0
  54. package/dist/tools/create_proposal.js.map +1 -0
  55. package/dist/tools/delete_checkpoint.d.ts +28 -0
  56. package/dist/tools/delete_checkpoint.d.ts.map +1 -0
  57. package/dist/tools/delete_checkpoint.js +66 -0
  58. package/dist/tools/delete_checkpoint.js.map +1 -0
  59. package/dist/tools/finalize_proposal.d.ts +28 -0
  60. package/dist/tools/finalize_proposal.d.ts.map +1 -0
  61. package/dist/tools/finalize_proposal.js +86 -0
  62. package/dist/tools/finalize_proposal.js.map +1 -0
  63. package/dist/tools/get_clinks.d.ts +43 -0
  64. package/dist/tools/get_clinks.d.ts.map +1 -0
  65. package/dist/tools/get_clinks.js +110 -0
  66. package/dist/tools/get_clinks.js.map +1 -0
  67. package/dist/tools/get_milestone.d.ts +23 -0
  68. package/dist/tools/get_milestone.d.ts.map +1 -0
  69. package/dist/tools/get_milestone.js +77 -0
  70. package/dist/tools/get_milestone.js.map +1 -0
  71. package/dist/tools/get_my_permissions.d.ts +14 -0
  72. package/dist/tools/get_my_permissions.d.ts.map +1 -0
  73. package/dist/tools/get_my_permissions.js +80 -0
  74. package/dist/tools/get_my_permissions.js.map +1 -0
  75. package/dist/tools/get_project.d.ts +23 -0
  76. package/dist/tools/get_project.d.ts.map +1 -0
  77. package/dist/tools/get_project.js +88 -0
  78. package/dist/tools/get_project.js.map +1 -0
  79. package/dist/tools/get_proposal.d.ts +23 -0
  80. package/dist/tools/get_proposal.d.ts.map +1 -0
  81. package/dist/tools/get_proposal.js +102 -0
  82. package/dist/tools/get_proposal.js.map +1 -0
  83. package/dist/tools/index.d.ts +17 -0
  84. package/dist/tools/index.d.ts.map +1 -0
  85. package/dist/tools/index.js +89 -0
  86. package/dist/tools/index.js.map +1 -0
  87. package/dist/tools/list_groups.d.ts +14 -0
  88. package/dist/tools/list_groups.d.ts.map +1 -0
  89. package/dist/tools/list_groups.js +35 -0
  90. package/dist/tools/list_groups.js.map +1 -0
  91. package/dist/tools/list_members.d.ts +23 -0
  92. package/dist/tools/list_members.d.ts.map +1 -0
  93. package/dist/tools/list_members.js +52 -0
  94. package/dist/tools/list_members.js.map +1 -0
  95. package/dist/tools/list_milestones.d.ts +34 -0
  96. package/dist/tools/list_milestones.d.ts.map +1 -0
  97. package/dist/tools/list_milestones.js +78 -0
  98. package/dist/tools/list_milestones.js.map +1 -0
  99. package/dist/tools/list_pending_verifications.d.ts +28 -0
  100. package/dist/tools/list_pending_verifications.d.ts.map +1 -0
  101. package/dist/tools/list_pending_verifications.js +83 -0
  102. package/dist/tools/list_pending_verifications.js.map +1 -0
  103. package/dist/tools/list_projects.d.ts +34 -0
  104. package/dist/tools/list_projects.d.ts.map +1 -0
  105. package/dist/tools/list_projects.js +92 -0
  106. package/dist/tools/list_projects.js.map +1 -0
  107. package/dist/tools/list_proposals.d.ts +34 -0
  108. package/dist/tools/list_proposals.d.ts.map +1 -0
  109. package/dist/tools/list_proposals.js +86 -0
  110. package/dist/tools/list_proposals.js.map +1 -0
  111. package/dist/tools/release_clink.d.ts +23 -0
  112. package/dist/tools/release_clink.d.ts.map +1 -0
  113. package/dist/tools/release_clink.js +42 -0
  114. package/dist/tools/release_clink.js.map +1 -0
  115. package/dist/tools/reopen_milestone.d.ts +23 -0
  116. package/dist/tools/reopen_milestone.d.ts.map +1 -0
  117. package/dist/tools/reopen_milestone.js +54 -0
  118. package/dist/tools/reopen_milestone.js.map +1 -0
  119. package/dist/tools/reopen_project.d.ts +23 -0
  120. package/dist/tools/reopen_project.d.ts.map +1 -0
  121. package/dist/tools/reopen_project.js +44 -0
  122. package/dist/tools/reopen_project.js.map +1 -0
  123. package/dist/tools/send_clink.d.ts +33 -0
  124. package/dist/tools/send_clink.d.ts.map +1 -0
  125. package/dist/tools/send_clink.js +64 -0
  126. package/dist/tools/send_clink.js.map +1 -0
  127. package/dist/tools/submit_feedback.d.ts +38 -0
  128. package/dist/tools/submit_feedback.d.ts.map +1 -0
  129. package/dist/tools/submit_feedback.js +93 -0
  130. package/dist/tools/submit_feedback.js.map +1 -0
  131. package/dist/tools/update_checkpoint.d.ts +63 -0
  132. package/dist/tools/update_checkpoint.d.ts.map +1 -0
  133. package/dist/tools/update_checkpoint.js +105 -0
  134. package/dist/tools/update_checkpoint.js.map +1 -0
  135. package/dist/tools/update_milestone.d.ts +33 -0
  136. package/dist/tools/update_milestone.d.ts.map +1 -0
  137. package/dist/tools/update_milestone.js +62 -0
  138. package/dist/tools/update_milestone.js.map +1 -0
  139. package/dist/tools/update_project.d.ts +43 -0
  140. package/dist/tools/update_project.d.ts.map +1 -0
  141. package/dist/tools/update_project.js +74 -0
  142. package/dist/tools/update_project.js.map +1 -0
  143. package/dist/types.d.ts +236 -0
  144. package/dist/types.d.ts.map +1 -0
  145. package/dist/types.js +24 -0
  146. package/dist/types.js.map +1 -0
  147. package/package.json +49 -0
@@ -0,0 +1,108 @@
1
+ /**
2
+ * add_checkpoint tool - Add a checkpoint to an existing milestone
3
+ */
4
+ import { addCheckpoint } from '../client.js';
5
+ import { ClinkApiError } from '../types.js';
6
+ export const definition = {
7
+ name: 'add_checkpoint',
8
+ description: 'Add a new checkpoint to an existing milestone. Optionally specify a position to insert at, or it will be appended at the end.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ milestone_id: {
13
+ type: 'string',
14
+ description: 'The milestone ID',
15
+ },
16
+ title: {
17
+ type: 'string',
18
+ description: 'Checkpoint title',
19
+ },
20
+ description: {
21
+ type: 'string',
22
+ description: 'Checkpoint description (optional)',
23
+ },
24
+ requires_consensus: {
25
+ type: 'boolean',
26
+ description: 'If true, requires group vote before completion (optional)',
27
+ },
28
+ depends_on: {
29
+ type: 'array',
30
+ items: { oneOf: [{ type: 'number' }, { type: 'string' }] },
31
+ description: 'Dependencies. Use number for same-milestone (e.g., 1), or "milestone_id:order" for cross-milestone (e.g., "ms_abc123:4"). Same-milestone deps must reference earlier checkpoints.',
32
+ },
33
+ position: {
34
+ type: 'number',
35
+ description: 'Position to insert at (1-based). If not provided, appends at end.',
36
+ },
37
+ git_branch_url: {
38
+ type: 'string',
39
+ description: 'Git branch URL (full URL)',
40
+ },
41
+ git_pr_url: {
42
+ type: 'string',
43
+ description: 'Git pull request URL (full URL)',
44
+ },
45
+ git_commit_url: {
46
+ type: 'string',
47
+ description: 'Git commit URL (full URL)',
48
+ },
49
+ },
50
+ required: ['milestone_id', 'title'],
51
+ },
52
+ };
53
+ export async function handler(args) {
54
+ try {
55
+ const { milestone_id, title, description, requires_consensus, depends_on, position, git_branch_url, git_pr_url, git_commit_url } = args;
56
+ if (!milestone_id) {
57
+ return 'Please provide a milestone_id.';
58
+ }
59
+ if (!title) {
60
+ return 'Please provide a checkpoint title.';
61
+ }
62
+ const milestone = await addCheckpoint(milestone_id, {
63
+ title,
64
+ description,
65
+ requires_consensus,
66
+ depends_on,
67
+ position,
68
+ git_branch_url,
69
+ git_pr_url,
70
+ git_commit_url,
71
+ });
72
+ // Find the newly added checkpoint
73
+ const actualPosition = position || milestone.total_checkpoints;
74
+ const newCheckpoint = milestone.checkpoints?.find(cp => cp.order === actualPosition);
75
+ let output = `Checkpoint added at position ${actualPosition}!\n\n`;
76
+ output += `Milestone: ${milestone.title}\n`;
77
+ output += `Progress: ${milestone.progress}\n\n`;
78
+ if (newCheckpoint) {
79
+ output += `New checkpoint:\n`;
80
+ output += ` ${newCheckpoint.order}. ${newCheckpoint.title}`;
81
+ if (newCheckpoint.requires_proposal_id)
82
+ output += ' [requires consensus]';
83
+ if (newCheckpoint.depends_on && newCheckpoint.depends_on.length > 0) {
84
+ output += ` [depends on: ${newCheckpoint.depends_on.join(', ')}]`;
85
+ }
86
+ output += '\n';
87
+ if (newCheckpoint.git_branch_url)
88
+ output += ` Branch: ${newCheckpoint.git_branch_url}\n`;
89
+ if (newCheckpoint.git_pr_url)
90
+ output += ` PR: ${newCheckpoint.git_pr_url}\n`;
91
+ if (newCheckpoint.git_commit_url)
92
+ output += ` Commit: ${newCheckpoint.git_commit_url}\n`;
93
+ }
94
+ output += `\nAll checkpoints:\n`;
95
+ for (const cp of milestone.checkpoints || []) {
96
+ const statusIcon = cp.status === 'completed' ? '[done]' : '[pending]';
97
+ output += ` ${cp.order}. ${cp.title} ${statusIcon}\n`;
98
+ }
99
+ return output;
100
+ }
101
+ catch (error) {
102
+ if (error instanceof ClinkApiError) {
103
+ return `Error: ${error.message}`;
104
+ }
105
+ throw error;
106
+ }
107
+ }
108
+ //# sourceMappingURL=add_checkpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_checkpoint.js","sourceRoot":"","sources":["../../src/tools/add_checkpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,+HAA+H;IAC5I,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kBAAkB;aAChC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd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AAU,GAAG,EAAE,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC;YACtE,MAAM,IAAI,KAAK,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC;QACzD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;YACnC,OAAO,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * archive_project tool - Archive a project
3
+ */
4
+ export declare const definition: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ project_id: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ };
15
+ required: string[];
16
+ };
17
+ };
18
+ interface ArchiveProjectArgs {
19
+ project_id: string;
20
+ }
21
+ export declare function handler(args: ArchiveProjectArgs): Promise<string>;
22
+ export {};
23
+ //# sourceMappingURL=archive_project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive_project.d.ts","sourceRoot":"","sources":["../../src/tools/archive_project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAatB,CAAC;AAEF,UAAU,kBAAkB;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BvE"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * archive_project tool - Archive a project
3
+ */
4
+ import { archiveProject } from '../client.js';
5
+ import { ClinkApiError } from '../types.js';
6
+ export const definition = {
7
+ name: 'archive_project',
8
+ description: 'Archive a project. Archived projects are hidden from default views but can be reopened later. Cannot archive the default project.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ project_id: {
13
+ type: 'string',
14
+ description: 'The project ID',
15
+ },
16
+ },
17
+ required: ['project_id'],
18
+ },
19
+ };
20
+ export async function handler(args) {
21
+ try {
22
+ const { project_id } = args;
23
+ if (!project_id) {
24
+ return 'Please provide a project_id.';
25
+ }
26
+ const project = await archiveProject(project_id);
27
+ let output = `Project archived!\n\n`;
28
+ output += `Title: ${project.title}\n`;
29
+ output += `ID: ${project.project_id}\n`;
30
+ output += `Status: ${project.status}\n`;
31
+ if (project.archived_at) {
32
+ output += `Archived at: ${new Date(project.archived_at).toLocaleString()}\n`;
33
+ }
34
+ output += `\nUse reopen_project to restore this project if needed.`;
35
+ return output;
36
+ }
37
+ catch (error) {
38
+ if (error instanceof ClinkApiError) {
39
+ return `Error: ${error.message}`;
40
+ }
41
+ throw error;
42
+ }
43
+ }
44
+ //# sourceMappingURL=archive_project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive_project.js","sourceRoot":"","sources":["../../src/tools/archive_project.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mIAAmI;IAChJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gBAAgB;aAC9B;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,CAAC;KACzB;CACF,CAAC;AAMF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAwB;IACpD,IAAI,CAAC;QACH,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAE5B,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,8BAA8B,CAAC;QACxC,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,MAAM,GAAG,uBAAuB,CAAC;QACrC,MAAM,IAAI,UAAU,OAAO,CAAC,KAAK,IAAI,CAAC;QACtC,MAAM,IAAI,OAAO,OAAO,CAAC,UAAU,IAAI,CAAC;QACxC,MAAM,IAAI,WAAW,OAAO,CAAC,MAAM,IAAI,CAAC;QACxC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,MAAM,IAAI,gBAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,cAAc,EAAE,IAAI,CAAC;QAC/E,CAAC;QACD,MAAM,IAAI,yDAAyD,CAAC;QAEpE,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;YACnC,OAAO,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * cast_vote tool - Cast a vote on a proposal
3
+ */
4
+ export declare const definition: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ proposal_id: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ vote: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ comment: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ hil_expiry_seconds: {
23
+ type: string;
24
+ description: string;
25
+ };
26
+ };
27
+ required: string[];
28
+ };
29
+ };
30
+ interface CastVoteArgs {
31
+ proposal_id: string;
32
+ vote: string;
33
+ comment?: string;
34
+ hil_expiry_seconds?: number;
35
+ }
36
+ export declare function handler(args: CastVoteArgs): Promise<string>;
37
+ export {};
38
+ //# sourceMappingURL=cast_vote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast_vote.d.ts","sourceRoot":"","sources":["../../src/tools/cast_vote.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;CAyBtB,CAAC;AAEF,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAyHjE"}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * cast_vote tool - Cast a vote on a proposal
3
+ */
4
+ import { castVote, getProposal } from '../client.js';
5
+ import { ClinkApiError, isHILRequired } from '../types.js';
6
+ export const definition = {
7
+ name: 'cast_vote',
8
+ description: 'Cast a vote on a proposal. For yes/no proposals, vote "yes" or "no". For single choice, vote with the option name. Include a comment to explain your reasoning.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ proposal_id: {
13
+ type: 'string',
14
+ description: 'The proposal ID',
15
+ },
16
+ vote: {
17
+ type: 'string',
18
+ description: 'Your vote: "yes" or "no" for yes_no proposals, option name for single choice, comma-separated preferences for ranked',
19
+ },
20
+ comment: {
21
+ type: 'string',
22
+ description: 'Optional comment explaining your vote',
23
+ },
24
+ hil_expiry_seconds: {
25
+ type: 'number',
26
+ description: 'Optional: Custom expiry time for HIL verification email link in seconds (min 60, max 172800 = 48 hours). Default is 300 (5 minutes).',
27
+ },
28
+ },
29
+ required: ['proposal_id', 'vote'],
30
+ },
31
+ };
32
+ export async function handler(args) {
33
+ try {
34
+ const { proposal_id, vote, comment, hil_expiry_seconds } = args;
35
+ if (!proposal_id) {
36
+ return 'Please provide a proposal_id.';
37
+ }
38
+ if (!vote) {
39
+ // Get proposal to show valid options
40
+ try {
41
+ const proposal = await getProposal(proposal_id);
42
+ if (proposal.voting_type === 'yes_no') {
43
+ return 'Please provide your vote: "yes" or "no"';
44
+ }
45
+ else {
46
+ return `Please provide your vote. Options: ${proposal.options?.join(', ')}`;
47
+ }
48
+ }
49
+ catch {
50
+ return 'Please provide your vote.';
51
+ }
52
+ }
53
+ const response = await castVote(proposal_id, { vote, comment, hil_expiry_seconds });
54
+ // Check if HIL verification is required
55
+ if (isHILRequired(response)) {
56
+ const isPending = response.verification_status === 'pending';
57
+ const wasExpired = response.previous_verification_expired;
58
+ let output;
59
+ if (isPending) {
60
+ // Existing verification already in progress
61
+ output = `⏳ Human-in-the-Loop verification already pending.\n\n`;
62
+ output += `A verification email was already sent and is awaiting human approval.\n`;
63
+ output += `No new email was sent.\n\n`;
64
+ output += `Vote: ${vote}\n`;
65
+ if (comment) {
66
+ output += `Comment: ${comment}\n`;
67
+ }
68
+ output += `\nVerification ID: ${response.verification_id}\n`;
69
+ if (response.expires_at) {
70
+ output += `Expires at: ${new Date(response.expires_at).toLocaleString()}\n`;
71
+ }
72
+ }
73
+ else if (wasExpired) {
74
+ // Previous verification expired, new one sent
75
+ output = `⏳ Previous verification expired - new email sent.\n\n`;
76
+ output += `The previous verification link expired without being used.\n`;
77
+ output += `A new verification email has been sent to the designated approver.\n\n`;
78
+ output += `Vote: ${vote}\n`;
79
+ if (comment) {
80
+ output += `Comment: ${comment}\n`;
81
+ }
82
+ output += `\nVerification ID: ${response.verification_id}\n`;
83
+ if (response.expires_in_seconds) {
84
+ output += `Expires in: ${Math.floor(response.expires_in_seconds / 60)} minutes\n`;
85
+ }
86
+ if (response.sent_to && response.sent_to.length > 0) {
87
+ output += `Email sent to: ${response.sent_to.join(', ')}\n`;
88
+ }
89
+ }
90
+ else {
91
+ // New verification created
92
+ output = `⏳ Human-in-the-Loop verification required.\n\n`;
93
+ output += `A verification email has been sent to the designated approver.\n`;
94
+ output += `Your vote will be recorded once they verify via the email link.\n\n`;
95
+ output += `Vote: ${vote}\n`;
96
+ if (comment) {
97
+ output += `Comment: ${comment}\n`;
98
+ }
99
+ output += `\nVerification ID: ${response.verification_id}\n`;
100
+ if (response.expires_in_seconds) {
101
+ output += `Expires in: ${Math.floor(response.expires_in_seconds / 60)} minutes\n`;
102
+ }
103
+ if (response.sent_to && response.sent_to.length > 0) {
104
+ output += `Email sent to: ${response.sent_to.join(', ')}\n`;
105
+ }
106
+ }
107
+ output += `\nUse list_pending_verifications to see all pending HIL verifications.`;
108
+ return output;
109
+ }
110
+ // Normal vote recording - cast to proposal type
111
+ const proposal = response;
112
+ let output = `Vote recorded!\n\n`;
113
+ output += `Proposal: ${proposal.title}\n`;
114
+ output += `Your vote: ${vote}\n`;
115
+ if (comment) {
116
+ output += `Comment: ${comment}\n`;
117
+ }
118
+ // Show current tally
119
+ if (proposal.tally) {
120
+ output += `\nCurrent tally:\n`;
121
+ for (const [option, count] of Object.entries(proposal.tally)) {
122
+ output += ` ${option}: ${count}\n`;
123
+ }
124
+ }
125
+ output += `\nTotal votes: ${proposal.vote_count}`;
126
+ return output;
127
+ }
128
+ catch (error) {
129
+ if (error instanceof ClinkApiError) {
130
+ // Handle specific error cases
131
+ if (error.statusCode === 409) {
132
+ return `Error: You have already voted on this proposal. Each member can only vote once.`;
133
+ }
134
+ if (error.message.includes('finalized')) {
135
+ return 'Error: Voting has closed on this proposal.';
136
+ }
137
+ if (error.message.includes('deadline')) {
138
+ return 'Error: The voting deadline has passed.';
139
+ }
140
+ if (error.message.includes('Invalid vote')) {
141
+ return `Error: ${error.message}`;
142
+ }
143
+ return `Error: ${error.message}`;
144
+ }
145
+ throw error;
146
+ }
147
+ }
148
+ //# sourceMappingURL=cast_vote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast_vote.js","sourceRoot":"","sources":["../../src/tools/cast_vote.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aA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,MAAM,IAAI,YAAY,OAAO,IAAI,CAAC;QACpC,CAAC;QAED,qBAAqB;QACrB,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,oBAAoB,CAAC;YAC/B,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7D,MAAM,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC;YACtC,CAAC;QACH,CAAC;QAED,MAAM,IAAI,kBAAkB,QAAQ,CAAC,UAAU,EAAE,CAAC;QAElD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;YACnC,8BAA8B;YAC9B,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBAC7B,OAAO,iFAAiF,CAAC;YAC3F,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACxC,OAAO,4CAA4C,CAAC;YACtD,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvC,OAAO,wCAAwC,CAAC;YAClD,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC3C,OAAO,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC;YACnC,CAAC;YACD,OAAO,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * check_inbox tool - Check for pending clinks with claim/ack support
3
+ */
4
+ export declare const definition: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ status: {
11
+ type: string;
12
+ enum: string[];
13
+ description: string;
14
+ };
15
+ for_me: {
16
+ type: string;
17
+ description: string;
18
+ };
19
+ claim: {
20
+ type: string;
21
+ description: string;
22
+ };
23
+ limit: {
24
+ type: string;
25
+ description: string;
26
+ };
27
+ };
28
+ required: never[];
29
+ };
30
+ };
31
+ interface CheckInboxArgs {
32
+ status?: 'pending' | 'claimed' | 'completed' | 'all';
33
+ for_me?: boolean;
34
+ claim?: boolean;
35
+ limit?: number;
36
+ }
37
+ export declare function handler(args: CheckInboxArgs): Promise<string>;
38
+ export {};
39
+ //# sourceMappingURL=check_inbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check_inbox.d.ts","sourceRoot":"","sources":["../../src/tools/check_inbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BtB,CAAC;AAEF,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,KAAK,CAAC;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoBD,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA4DnE"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * check_inbox tool - Check for pending clinks with claim/ack support
3
+ */
4
+ import { checkInbox } from '../client.js';
5
+ import { ClinkApiError } from '../types.js';
6
+ export const definition = {
7
+ name: 'check_inbox',
8
+ description: 'Check your inbox for pending clinks. By default shows clinks addressed to you or unaddressed. Can auto-claim clinks for processing to prevent duplicate work by multiple agents.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ status: {
13
+ type: 'string',
14
+ enum: ['pending', 'claimed', 'completed', 'all'],
15
+ description: 'Filter by clink status. Default: pending (actionable items)',
16
+ },
17
+ for_me: {
18
+ type: 'boolean',
19
+ description: 'Only show clinks addressed to you or unaddressed (default: true)',
20
+ },
21
+ claim: {
22
+ type: 'boolean',
23
+ description: 'Auto-claim pending clinks returned. Use this when you intend to process the clinks immediately.',
24
+ },
25
+ limit: {
26
+ type: 'number',
27
+ description: 'Maximum clinks to return (default: 10)',
28
+ },
29
+ },
30
+ required: [],
31
+ },
32
+ };
33
+ function formatClink(clink) {
34
+ const time = new Date(clink.created_at).toLocaleTimeString();
35
+ const group = clink.group_slug || clink.group_name || clink.group_id;
36
+ const preview = clink.content.substring(0, 100) + (clink.content.length > 100 ? '...' : '');
37
+ let line = `[${time}] ${clink.sender_name} in ${group}: ${preview}`;
38
+ if (clink.status === 'claimed') {
39
+ line += ` [CLAIMED by ${clink.claimed_by}]`;
40
+ }
41
+ else if (clink.status === 'completed') {
42
+ line += ` [COMPLETED]`;
43
+ }
44
+ line += `\n ID: ${clink.clink_id}`;
45
+ return line;
46
+ }
47
+ export async function handler(args) {
48
+ try {
49
+ const response = await checkInbox({
50
+ status: args.status || 'pending',
51
+ forMe: args.for_me !== false,
52
+ claim: args.claim || false,
53
+ limit: args.limit || 10,
54
+ });
55
+ const { clinks, count, claimed_count } = response;
56
+ if (count === 0) {
57
+ const statusText = args.status || 'pending';
58
+ if (statusText === 'pending') {
59
+ return 'No pending clinks in your inbox.';
60
+ }
61
+ return `No ${statusText} clinks found.`;
62
+ }
63
+ // Group by sender for summary
64
+ const bySender = new Map();
65
+ const byGroup = new Map();
66
+ for (const clink of clinks) {
67
+ bySender.set(clink.sender_name, (bySender.get(clink.sender_name) || 0) + 1);
68
+ const groupKey = clink.group_slug || clink.group_name || clink.group_id;
69
+ byGroup.set(groupKey, (byGroup.get(groupKey) || 0) + 1);
70
+ }
71
+ const senderSummary = Array.from(bySender.entries())
72
+ .map(([name, c]) => `${name} (${c})`)
73
+ .join(', ');
74
+ const groupSummary = Array.from(byGroup.entries())
75
+ .map(([name, c]) => `${name}: ${c}`)
76
+ .join(', ');
77
+ // Format clinks
78
+ const formattedClinks = clinks.map(formatClink);
79
+ let header = `${count} clink(s)`;
80
+ if (args.claim && claimed_count && claimed_count > 0) {
81
+ header += ` (${claimed_count} claimed for processing)`;
82
+ }
83
+ let output = `${header}\n\nFrom: ${senderSummary}\nIn: ${groupSummary}\n\nClinks:\n${formattedClinks.join('\n\n')}`;
84
+ if (args.claim && claimed_count && claimed_count > 0) {
85
+ output += `\n\nClaimed ${claimed_count} clink(s). Use complete_clink when done processing.`;
86
+ }
87
+ else if (!args.claim && clinks.some(c => c.status === 'pending')) {
88
+ output += '\n\nTip: Use claim=true to claim clinks, or use claim_clink on specific clink IDs.';
89
+ }
90
+ return output;
91
+ }
92
+ catch (error) {
93
+ if (error instanceof ClinkApiError) {
94
+ return `Error: ${error.message}`;
95
+ }
96
+ throw error;
97
+ }
98
+ }
99
+ //# sourceMappingURL=check_inbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check_inbox.js","sourceRoot":"","sources":["../../src/tools/check_inbox.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAS,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,kLAAkL;IAC/L,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC;gBAChD,WAAW,EAAE,6DAA6D;aAC3E;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,kEAAkE;aAChF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iGAAiG;aAC/G;YACD,KAAK,EAAE;gBACL,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CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC;aACnC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,gBAAgB;QAChB,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEhD,IAAI,MAAM,GAAG,GAAG,KAAK,WAAW,CAAC;QACjC,IAAI,IAAI,CAAC,KAAK,IAAI,aAAa,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,aAAa,0BAA0B,CAAC;QACzD,CAAC;QAED,IAAI,MAAM,GAAG,GAAG,MAAM,aAAa,aAAa,SAAS,YAAY,gBAAgB,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAEpH,IAAI,IAAI,CAAC,KAAK,IAAI,aAAa,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,eAAe,aAAa,qDAAqD,CAAC;QAC9F,CAAC;aAAM,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,oFAAoF,CAAC;QACjG,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAa,EAAE,CAAC;YACnC,OAAO,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * claim_clink tool - Claim a clink for processing
3
+ */
4
+ export declare const definition: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: {
10
+ clink_id: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ timeout_seconds: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ };
19
+ required: string[];
20
+ };
21
+ };
22
+ interface ClaimClinkArgs {
23
+ clink_id: string;
24
+ timeout_seconds?: number;
25
+ }
26
+ export declare function handler(args: ClaimClinkArgs): Promise<string>;
27
+ export {};
28
+ //# sourceMappingURL=claim_clink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim_clink.d.ts","sourceRoot":"","sources":["../../src/tools/claim_clink.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAiBtB,CAAC;AAEF,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BnE"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * claim_clink tool - Claim a clink for processing
3
+ */
4
+ import { claimClink } from '../client.js';
5
+ import { ClinkApiError } from '../types.js';
6
+ export const definition = {
7
+ name: 'claim_clink',
8
+ description: 'Claim a clink to indicate you are processing it. This prevents other workers/agents from processing the same clink. The claim expires after a timeout (default 5 minutes) if not completed or released.',
9
+ inputSchema: {
10
+ type: 'object',
11
+ properties: {
12
+ clink_id: {
13
+ type: 'string',
14
+ description: 'The clink ID to claim',
15
+ },
16
+ timeout_seconds: {
17
+ type: 'number',
18
+ description: 'How long to hold the claim in seconds (default: 300 = 5 minutes)',
19
+ },
20
+ },
21
+ required: ['clink_id'],
22
+ },
23
+ };
24
+ export async function handler(args) {
25
+ try {
26
+ const { clink_id, timeout_seconds } = args;
27
+ if (!clink_id) {
28
+ return 'Please provide a clink_id to claim.';
29
+ }
30
+ const clink = await claimClink(clink_id, {
31
+ timeoutSeconds: timeout_seconds,
32
+ });
33
+ const expiresAt = clink.claim_expires_at
34
+ ? new Date(clink.claim_expires_at).toLocaleTimeString()
35
+ : 'unknown';
36
+ return `Clink claimed successfully!\n\nClink ID: ${clink.clink_id}\nStatus: ${clink.status}\nClaim expires at: ${expiresAt}\n\nUse complete_clink when done processing, or release_clink to give up the claim.`;
37
+ }
38
+ catch (error) {
39
+ if (error instanceof ClinkApiError) {
40
+ if (error.statusCode === 409) {
41
+ return `Clink already claimed by another user. Try a different clink or wait for the claim to expire.`;
42
+ }
43
+ if (error.statusCode === 404) {
44
+ return `Clink not found: ${args.clink_id}`;
45
+ }
46
+ return `Error: ${error.message}`;
47
+ }
48
+ throw error;
49
+ }
50
+ }
51
+ //# sourceMappingURL=claim_clink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claim_clink.js","sourceRoot":"","sources":["../../src/tools/claim_clink.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,yMAAyM;IACtN,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uBAAuB;aACrC;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAChF;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;CACF,CAAC;AAOF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAoB;IAChD,IAAI,CAAC;QACH,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;QAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,qCAAqC,CAAC;QAC/C,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,QAAQ,EAAE;YACvC,cAAc,EAAE,eAAe;SAChC,CAAC,CAAC;QAEH,MAAM,S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