@tacitai/mcp-server 0.1.1 → 0.3.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 (70) hide show
  1. package/dist/auth.d.ts +32 -0
  2. package/dist/auth.js +64 -0
  3. package/dist/client.d.ts +60 -5
  4. package/dist/client.js +234 -53
  5. package/dist/index.js +130 -106
  6. package/dist/oauth.d.ts +115 -0
  7. package/dist/oauth.js +619 -0
  8. package/dist/prompts.d.ts +2 -0
  9. package/dist/prompts.js +12 -0
  10. package/dist/setup.d.ts +28 -5
  11. package/dist/setup.js +266 -59
  12. package/dist/tools/agents.d.ts +277 -0
  13. package/dist/tools/agents.js +335 -0
  14. package/dist/tools/annotations.d.ts +117 -0
  15. package/dist/tools/annotations.js +130 -0
  16. package/dist/tools/artifacts.d.ts +178 -8
  17. package/dist/tools/artifacts.js +372 -81
  18. package/dist/tools/chronicle.d.ts +3 -0
  19. package/dist/tools/chronicle.js +165 -0
  20. package/dist/tools/connector_write_back.d.ts +3 -0
  21. package/dist/tools/connector_write_back.js +27 -0
  22. package/dist/tools/converse.d.ts +10 -0
  23. package/dist/tools/converse.js +88 -0
  24. package/dist/tools/crews.d.ts +3 -0
  25. package/dist/tools/crews.js +115 -0
  26. package/dist/tools/drafts.d.ts +83 -0
  27. package/dist/tools/drafts.js +86 -0
  28. package/dist/tools/errors.d.ts +15 -0
  29. package/dist/tools/errors.js +21 -0
  30. package/dist/tools/export.d.ts +54 -0
  31. package/dist/tools/export.js +55 -0
  32. package/dist/tools/gm.d.ts +214 -0
  33. package/dist/tools/gm.js +198 -0
  34. package/dist/tools/ingest.d.ts +58 -4
  35. package/dist/tools/ingest.js +109 -76
  36. package/dist/tools/kb.d.ts +544 -0
  37. package/dist/tools/kb.js +687 -0
  38. package/dist/tools/lake-structure.d.ts +3 -0
  39. package/dist/tools/lake-structure.js +126 -0
  40. package/dist/tools/lake.d.ts +932 -0
  41. package/dist/tools/lake.js +1017 -0
  42. package/dist/tools/move.d.ts +200 -0
  43. package/dist/tools/move.js +96 -0
  44. package/dist/tools/outbox.d.ts +274 -0
  45. package/dist/tools/outbox.js +223 -0
  46. package/dist/tools/people.d.ts +3 -0
  47. package/dist/tools/people.js +59 -0
  48. package/dist/tools/pyramid.d.ts +554 -0
  49. package/dist/tools/pyramid.js +758 -0
  50. package/dist/tools/recall.d.ts +2 -0
  51. package/dist/tools/recall.js +28 -17
  52. package/dist/tools/registry.d.ts +17 -0
  53. package/dist/tools/registry.js +199 -0
  54. package/dist/tools/research.d.ts +47 -0
  55. package/dist/tools/research.js +575 -0
  56. package/dist/tools/search.d.ts +9 -0
  57. package/dist/tools/search.js +86 -25
  58. package/dist/tools/sharing.d.ts +63 -0
  59. package/dist/tools/sharing.js +157 -0
  60. package/dist/tools/skills.d.ts +9 -0
  61. package/dist/tools/skills.js +98 -0
  62. package/dist/tools/synthesize.d.ts +54 -2
  63. package/dist/tools/synthesize.js +80 -23
  64. package/dist/tools/web-url.d.ts +57 -0
  65. package/dist/tools/web-url.js +74 -0
  66. package/dist/tools/workspaces.d.ts +3 -0
  67. package/dist/tools/workspaces.js +47 -0
  68. package/dist/transport.d.ts +9 -0
  69. package/dist/transport.js +209 -0
  70. package/package.json +5 -4
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Move tool:
3
+ * tacit_move — PATCH /api/v1/objects/:id/placement
4
+ */
5
+ import { z } from 'zod';
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ import { TacitClient } from '../client.js';
8
+ export interface ToolRequest {
9
+ execute(): Promise<{
10
+ content: Array<{
11
+ type: 'text';
12
+ text: string;
13
+ }>;
14
+ isError?: boolean;
15
+ }>;
16
+ }
17
+ export declare const moveInputSchema: z.ZodObject<{
18
+ artifact_id: z.ZodString;
19
+ placement: z.ZodObject<{
20
+ kb: z.ZodOptional<z.ZodObject<{
21
+ collections: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
22
+ name: z.ZodString;
23
+ slug: z.ZodOptional<z.ZodString>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ name: string;
26
+ slug?: string | undefined;
27
+ }, {
28
+ name: string;
29
+ slug?: string | undefined;
30
+ }>]>, "many">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ collections: (string | {
33
+ name: string;
34
+ slug?: string | undefined;
35
+ })[];
36
+ }, {
37
+ collections: (string | {
38
+ name: string;
39
+ slug?: string | undefined;
40
+ })[];
41
+ }>>;
42
+ pyramid: z.ZodOptional<z.ZodObject<{
43
+ portfolio_id: z.ZodOptional<z.ZodString>;
44
+ program_id: z.ZodOptional<z.ZodString>;
45
+ dossiers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
46
+ name: z.ZodString;
47
+ }, "strip", z.ZodTypeAny, {
48
+ name: string;
49
+ }, {
50
+ name: string;
51
+ }>]>, "many">>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ portfolio_id?: string | undefined;
54
+ program_id?: string | undefined;
55
+ dossiers?: (string | {
56
+ name: string;
57
+ })[] | undefined;
58
+ }, {
59
+ portfolio_id?: string | undefined;
60
+ program_id?: string | undefined;
61
+ dossiers?: (string | {
62
+ name: string;
63
+ })[] | undefined;
64
+ }>>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ kb?: {
67
+ collections: (string | {
68
+ name: string;
69
+ slug?: string | undefined;
70
+ })[];
71
+ } | undefined;
72
+ pyramid?: {
73
+ portfolio_id?: string | undefined;
74
+ program_id?: string | undefined;
75
+ dossiers?: (string | {
76
+ name: string;
77
+ })[] | undefined;
78
+ } | undefined;
79
+ }, {
80
+ kb?: {
81
+ collections: (string | {
82
+ name: string;
83
+ slug?: string | undefined;
84
+ })[];
85
+ } | undefined;
86
+ pyramid?: {
87
+ portfolio_id?: string | undefined;
88
+ program_id?: string | undefined;
89
+ dossiers?: (string | {
90
+ name: string;
91
+ })[] | undefined;
92
+ } | undefined;
93
+ }>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ artifact_id: string;
96
+ placement: {
97
+ kb?: {
98
+ collections: (string | {
99
+ name: string;
100
+ slug?: string | undefined;
101
+ })[];
102
+ } | undefined;
103
+ pyramid?: {
104
+ portfolio_id?: string | undefined;
105
+ program_id?: string | undefined;
106
+ dossiers?: (string | {
107
+ name: string;
108
+ })[] | undefined;
109
+ } | undefined;
110
+ };
111
+ }, {
112
+ artifact_id: string;
113
+ placement: {
114
+ kb?: {
115
+ collections: (string | {
116
+ name: string;
117
+ slug?: string | undefined;
118
+ })[];
119
+ } | undefined;
120
+ pyramid?: {
121
+ portfolio_id?: string | undefined;
122
+ program_id?: string | undefined;
123
+ dossiers?: (string | {
124
+ name: string;
125
+ })[] | undefined;
126
+ } | undefined;
127
+ };
128
+ }>;
129
+ export type MoveInput = z.infer<typeof moveInputSchema>;
130
+ export declare const MOVE_TOOL_DEF: {
131
+ name: "tacit_move";
132
+ description: string;
133
+ inputSchema: {
134
+ type: "object";
135
+ properties: {
136
+ artifact_id: {
137
+ type: string;
138
+ description: string;
139
+ };
140
+ placement: {
141
+ type: string;
142
+ description: string;
143
+ properties: {
144
+ kb: {
145
+ type: string;
146
+ properties: {
147
+ collections: {
148
+ type: string;
149
+ items: {
150
+ oneOf: ({
151
+ type: string;
152
+ properties?: undefined;
153
+ required?: undefined;
154
+ } | {
155
+ type: string;
156
+ properties: {
157
+ name: {
158
+ type: string;
159
+ };
160
+ };
161
+ required: string[];
162
+ })[];
163
+ };
164
+ };
165
+ };
166
+ };
167
+ pyramid: {
168
+ type: string;
169
+ properties: {
170
+ portfolio_id: {
171
+ type: string;
172
+ };
173
+ program_id: {
174
+ type: string;
175
+ };
176
+ dossiers: {
177
+ type: string;
178
+ items: {
179
+ oneOf: {
180
+ type: string;
181
+ }[];
182
+ };
183
+ };
184
+ };
185
+ };
186
+ };
187
+ };
188
+ };
189
+ required: string[];
190
+ };
191
+ };
192
+ export declare function buildMoveRequest(client: TacitClient, input: MoveInput): ToolRequest;
193
+ export declare function handleMove(args: unknown): Promise<{
194
+ content: Array<{
195
+ type: 'text';
196
+ text: string;
197
+ }>;
198
+ isError?: boolean;
199
+ }>;
200
+ export declare function registerMoveTools(server: McpServer, getClientFn: () => Promise<TacitClient>): void;
@@ -0,0 +1,96 @@
1
+ // SPDX-License-Identifier: MIT
2
+ /**
3
+ * Move tool:
4
+ * tacit_move — PATCH /api/v1/objects/:id/placement
5
+ */
6
+ import { z } from 'zod';
7
+ import { getClient } from '../client.js';
8
+ import { apiErrorResult } from './errors.js';
9
+ const placementSchema = z.object({
10
+ kb: z.object({
11
+ collections: z.array(z.union([
12
+ z.string().uuid(),
13
+ z.object({
14
+ name: z.string().min(1),
15
+ slug: z.string().optional(),
16
+ }),
17
+ ])),
18
+ }).optional(),
19
+ pyramid: z.object({
20
+ portfolio_id: z.string().uuid().optional(),
21
+ program_id: z.string().uuid().optional(),
22
+ dossiers: z.array(z.union([
23
+ z.string().uuid(),
24
+ z.object({ name: z.string().min(1) }),
25
+ ])).optional(),
26
+ }).optional(),
27
+ });
28
+ export const moveInputSchema = z.object({
29
+ artifact_id: z.string().min(1).describe('Artifact UUID to move'),
30
+ placement: placementSchema.describe('New placement — kb and/or pyramid'),
31
+ });
32
+ export const MOVE_TOOL_DEF = {
33
+ name: 'tacit_move',
34
+ description: 'Move/re-place content to a different location in the Tacit hierarchy (portfolio, program, dossier, or collection). ' +
35
+ 'Route: PATCH /api/v1/objects/:id/placement.',
36
+ inputSchema: {
37
+ type: 'object',
38
+ properties: {
39
+ artifact_id: { type: 'string', description: 'Artifact UUID' },
40
+ placement: {
41
+ type: 'object',
42
+ description: 'Placement envelope (kb and/or pyramid)',
43
+ properties: {
44
+ kb: {
45
+ type: 'object',
46
+ properties: {
47
+ collections: {
48
+ type: 'array',
49
+ items: { oneOf: [{ type: 'string' }, { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] }] },
50
+ },
51
+ },
52
+ },
53
+ pyramid: {
54
+ type: 'object',
55
+ properties: {
56
+ portfolio_id: { type: 'string' },
57
+ program_id: { type: 'string' },
58
+ dossiers: { type: 'array', items: { oneOf: [{ type: 'string' }, { type: 'object' }] } },
59
+ },
60
+ },
61
+ },
62
+ },
63
+ },
64
+ required: ['artifact_id', 'placement'],
65
+ },
66
+ };
67
+ export function buildMoveRequest(client, input) {
68
+ return {
69
+ async execute() {
70
+ const { artifact_id, placement } = input;
71
+ try {
72
+ const result = await client.patch(`/api/v1/objects/${artifact_id}/placement`, placement);
73
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
74
+ }
75
+ catch (err) {
76
+ return apiErrorResult(err, '/api/v1/objects/:id/placement');
77
+ }
78
+ },
79
+ };
80
+ }
81
+ export async function handleMove(args) {
82
+ const parsed = moveInputSchema.safeParse(args);
83
+ if (!parsed.success) {
84
+ return { content: [{ type: 'text', text: `Invalid input: ${parsed.error.message}` }], isError: true };
85
+ }
86
+ return buildMoveRequest(getClient(), parsed.data).execute();
87
+ }
88
+ export function registerMoveTools(server, getClientFn) {
89
+ server.tool('tacit_move', 'Move/re-place content in the Tacit hierarchy. Route: PATCH /api/v1/objects/:id/placement.', {
90
+ artifact_id: z.string().min(1).describe('Artifact UUID to move'),
91
+ placement: z.record(z.unknown()).describe('New placement — kb and/or pyramid'),
92
+ }, async (args) => {
93
+ const client = await getClientFn();
94
+ return buildMoveRequest(client, args).execute();
95
+ });
96
+ }
@@ -0,0 +1,274 @@
1
+ /**
2
+ * FEAT-111 Wave 2 — Outbox MCP tools:
3
+ * tacit_outbox_write — Write an envelope to the local outbox queue
4
+ * tacit_outbox_flush — Trigger an immediate drain of pending envelopes
5
+ * tacit_outbox_status — Check outbox queue status (pending/delivered/failed counts)
6
+ */
7
+ import { z } from 'zod';
8
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9
+ export declare const outboxWriteInputSchema: z.ZodObject<{
10
+ title: z.ZodString;
11
+ content: z.ZodString;
12
+ placement: z.ZodObject<{
13
+ kb: z.ZodOptional<z.ZodObject<{
14
+ collections: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
15
+ name: z.ZodString;
16
+ slug: z.ZodOptional<z.ZodString>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ name: string;
19
+ slug?: string | undefined;
20
+ }, {
21
+ name: string;
22
+ slug?: string | undefined;
23
+ }>]>, "many">;
24
+ }, "strip", z.ZodTypeAny, {
25
+ collections: (string | {
26
+ name: string;
27
+ slug?: string | undefined;
28
+ })[];
29
+ }, {
30
+ collections: (string | {
31
+ name: string;
32
+ slug?: string | undefined;
33
+ })[];
34
+ }>>;
35
+ pyramid: z.ZodOptional<z.ZodObject<{
36
+ portfolio_id: z.ZodOptional<z.ZodString>;
37
+ program_id: z.ZodOptional<z.ZodString>;
38
+ dossiers: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
39
+ name: z.ZodString;
40
+ }, "strip", z.ZodTypeAny, {
41
+ name: string;
42
+ }, {
43
+ name: string;
44
+ }>]>, "many">>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ portfolio_id?: string | undefined;
47
+ program_id?: string | undefined;
48
+ dossiers?: (string | {
49
+ name: string;
50
+ })[] | undefined;
51
+ }, {
52
+ portfolio_id?: string | undefined;
53
+ program_id?: string | undefined;
54
+ dossiers?: (string | {
55
+ name: string;
56
+ })[] | undefined;
57
+ }>>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ kb?: {
60
+ collections: (string | {
61
+ name: string;
62
+ slug?: string | undefined;
63
+ })[];
64
+ } | undefined;
65
+ pyramid?: {
66
+ portfolio_id?: string | undefined;
67
+ program_id?: string | undefined;
68
+ dossiers?: (string | {
69
+ name: string;
70
+ })[] | undefined;
71
+ } | undefined;
72
+ }, {
73
+ kb?: {
74
+ collections: (string | {
75
+ name: string;
76
+ slug?: string | undefined;
77
+ })[];
78
+ } | undefined;
79
+ pyramid?: {
80
+ portfolio_id?: string | undefined;
81
+ program_id?: string | undefined;
82
+ dossiers?: (string | {
83
+ name: string;
84
+ })[] | undefined;
85
+ } | undefined;
86
+ }>;
87
+ content_origin: z.ZodDefault<z.ZodEnum<["agent", "human", "git_sync"]>>;
88
+ source_agent_id: z.ZodOptional<z.ZodString>;
89
+ autonomy_level: z.ZodOptional<z.ZodEnum<["MENTAT", "TWIN"]>>;
90
+ idempotency_key: z.ZodOptional<z.ZodString>;
91
+ replaces_object_id: z.ZodOptional<z.ZodString>;
92
+ content_format: z.ZodDefault<z.ZodEnum<["MARKDOWN", "HTML", "PLAIN_TEXT"]>>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ content: string;
95
+ title: string;
96
+ placement: {
97
+ kb?: {
98
+ collections: (string | {
99
+ name: string;
100
+ slug?: string | undefined;
101
+ })[];
102
+ } | undefined;
103
+ pyramid?: {
104
+ portfolio_id?: string | undefined;
105
+ program_id?: string | undefined;
106
+ dossiers?: (string | {
107
+ name: string;
108
+ })[] | undefined;
109
+ } | undefined;
110
+ };
111
+ content_origin: "agent" | "human" | "git_sync";
112
+ content_format: "MARKDOWN" | "HTML" | "PLAIN_TEXT";
113
+ source_agent_id?: string | undefined;
114
+ autonomy_level?: "MENTAT" | "TWIN" | undefined;
115
+ idempotency_key?: string | undefined;
116
+ replaces_object_id?: string | undefined;
117
+ }, {
118
+ content: string;
119
+ title: string;
120
+ placement: {
121
+ kb?: {
122
+ collections: (string | {
123
+ name: string;
124
+ slug?: string | undefined;
125
+ })[];
126
+ } | undefined;
127
+ pyramid?: {
128
+ portfolio_id?: string | undefined;
129
+ program_id?: string | undefined;
130
+ dossiers?: (string | {
131
+ name: string;
132
+ })[] | undefined;
133
+ } | undefined;
134
+ };
135
+ content_origin?: "agent" | "human" | "git_sync" | undefined;
136
+ source_agent_id?: string | undefined;
137
+ autonomy_level?: "MENTAT" | "TWIN" | undefined;
138
+ idempotency_key?: string | undefined;
139
+ replaces_object_id?: string | undefined;
140
+ content_format?: "MARKDOWN" | "HTML" | "PLAIN_TEXT" | undefined;
141
+ }>;
142
+ export type OutboxWriteInput = z.infer<typeof outboxWriteInputSchema>;
143
+ export declare const OUTBOX_WRITE_TOOL_DEF: {
144
+ name: "tacit_outbox_write";
145
+ description: string;
146
+ inputSchema: {
147
+ type: "object";
148
+ properties: {
149
+ title: {
150
+ type: string;
151
+ description: string;
152
+ };
153
+ content: {
154
+ type: string;
155
+ description: string;
156
+ };
157
+ placement: {
158
+ type: string;
159
+ description: string;
160
+ properties: {
161
+ kb: {
162
+ type: string;
163
+ properties: {
164
+ collections: {
165
+ type: string;
166
+ items: {
167
+ oneOf: ({
168
+ type: string;
169
+ properties?: undefined;
170
+ required?: undefined;
171
+ } | {
172
+ type: string;
173
+ properties: {
174
+ name: {
175
+ type: string;
176
+ };
177
+ };
178
+ required: string[];
179
+ })[];
180
+ };
181
+ };
182
+ };
183
+ };
184
+ pyramid: {
185
+ type: string;
186
+ properties: {
187
+ portfolio_id: {
188
+ type: string;
189
+ };
190
+ program_id: {
191
+ type: string;
192
+ };
193
+ dossiers: {
194
+ type: string;
195
+ items: {
196
+ oneOf: {
197
+ type: string;
198
+ }[];
199
+ };
200
+ };
201
+ };
202
+ };
203
+ };
204
+ };
205
+ content_origin: {
206
+ type: string;
207
+ enum: string[];
208
+ default: string;
209
+ };
210
+ source_agent_id: {
211
+ type: string;
212
+ description: string;
213
+ };
214
+ autonomy_level: {
215
+ type: string;
216
+ enum: string[];
217
+ };
218
+ idempotency_key: {
219
+ type: string;
220
+ description: string;
221
+ };
222
+ replaces_object_id: {
223
+ type: string;
224
+ description: string;
225
+ };
226
+ content_format: {
227
+ type: string;
228
+ enum: string[];
229
+ default: string;
230
+ };
231
+ };
232
+ required: string[];
233
+ };
234
+ };
235
+ export declare function handleOutboxWrite(args: unknown): Promise<{
236
+ content: Array<{
237
+ type: 'text';
238
+ text: string;
239
+ }>;
240
+ isError?: boolean;
241
+ }>;
242
+ export declare const OUTBOX_FLUSH_TOOL_DEF: {
243
+ name: "tacit_outbox_flush";
244
+ description: string;
245
+ inputSchema: {
246
+ type: "object";
247
+ properties: {};
248
+ required: string[];
249
+ };
250
+ };
251
+ export declare function handleOutboxFlush(_args: unknown): Promise<{
252
+ content: Array<{
253
+ type: 'text';
254
+ text: string;
255
+ }>;
256
+ isError?: boolean;
257
+ }>;
258
+ export declare const OUTBOX_STATUS_TOOL_DEF: {
259
+ name: "tacit_outbox_status";
260
+ description: string;
261
+ inputSchema: {
262
+ type: "object";
263
+ properties: {};
264
+ required: string[];
265
+ };
266
+ };
267
+ export declare function handleOutboxStatus(_args: unknown): Promise<{
268
+ content: Array<{
269
+ type: 'text';
270
+ text: string;
271
+ }>;
272
+ isError?: boolean;
273
+ }>;
274
+ export declare function registerOutboxTools(server: McpServer): void;