@clien-ai/mcp 0.2.1 → 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.
@@ -17,6 +17,11 @@
17
17
  * enforced in the handler, not via `.superRefine` (which would yield a
18
18
  * `ZodEffects`, not a `ZodObject`).
19
19
  *
20
+ * Params are snake_case (`project_id`, `persona_id`, `interview_id`) — matching
21
+ * every other tool — and translated to the camelCase the REST API expects at the
22
+ * call site. FUL-233: the pre-migration camelCase spellings stay accepted as
23
+ * deprecated aliases (see `INTERVIEW_PERSONA_ALIASES` and `param-aliases.ts`).
24
+ *
20
25
  * Contract (all bearer-authenticated, ownership derived from the parent project):
21
26
  * - start → POST /api/interviews { projectId, personaId, withFirstMessage:true, ephemeral } → { interview, personaName, firstMessageContent }
22
27
  * - turn → POST /api/interviews/{id}/turn { content } → { reply, message, userMessage, messageCount }
@@ -34,10 +39,17 @@
34
39
  */
35
40
  import { z } from 'zod';
36
41
  import { ToolError } from './errors.js';
42
+ import { deprecatedAlias } from './param-aliases.js';
37
43
  import { apiCall, categorizeFetchError, truncate, } from './research.js';
38
44
  const INTERVIEW_FETCH_TIMEOUT_MS = 60_000;
39
45
  /** Upper bound on a turn's question — matches the server's `MESSAGE_CONTENT_MAX`. */
40
46
  const CONTENT_MAX = 10_000;
47
+ /** FUL-233: legacy camelCase spellings `interview_persona` still accepts. */
48
+ export const INTERVIEW_PERSONA_ALIASES = {
49
+ projectId: 'project_id',
50
+ personaId: 'persona_id',
51
+ interviewId: 'interview_id',
52
+ };
41
53
  export const InterviewPersonaInputSchema = z.object({
42
54
  action: z
43
55
  .enum(['start', 'turn', 'transcript', 'complete', 'reopen'])
@@ -46,24 +58,24 @@ export const InterviewPersonaInputSchema = z.object({
46
58
  'read the persona\'s full reply, decide the next question. `transcript` re-reads the ' +
47
59
  'whole conversation. `complete` closes the interview when you\'ve learned enough ' +
48
60
  '(5-12 turns is typical); `reopen` resumes a completed one.'),
49
- projectId: z
61
+ project_id: z
50
62
  .string()
51
63
  .uuid()
52
64
  .optional()
53
- .describe('action=start: UUID of the project the interview belongs to. Get it from `list_projects` ' +
54
- 'or `create_project`. You are 404\'d if you do not own it.'),
55
- personaId: z
65
+ .describe('action=start (REQUIRED there): UUID of the project the interview belongs to. Get it from ' +
66
+ '`list_projects` or `create_project`. You are 404\'d if you do not own it.'),
67
+ persona_id: z
56
68
  .string()
57
69
  .uuid()
58
70
  .optional()
59
- .describe('action=start: UUID of the persona to interview (must belong to `projectId`). Get it from ' +
60
- '`create_persona` (`_meta.persona.id`).'),
61
- interviewId: z
71
+ .describe('action=start (REQUIRED there): UUID of the persona to interview (must belong to ' +
72
+ '`project_id`). Get it from `list_personas` or `create_persona` (`_meta.persona.id`).'),
73
+ interview_id: z
62
74
  .string()
63
75
  .uuid()
64
76
  .optional()
65
- .describe('action=turn/transcript/complete/reopen: UUID of the interview to act on. Returned by ' +
66
- '`start` in `_meta.interview.id`.'),
77
+ .describe('action=turn/transcript/complete/reopen (REQUIRED there): UUID of the interview to act on. ' +
78
+ 'Returned by `start` in `_meta.interview.id`, or discoverable via `list_interviews`.'),
67
79
  content: z
68
80
  .string()
69
81
  .trim()
@@ -79,6 +91,10 @@ export const InterviewPersonaInputSchema = z.object({
79
91
  .describe('action=start: set true for a scratch/throwaway interview that should NOT count toward the ' +
80
92
  'project\'s aggregate insights (sets include_in_insights=false). Leave false (the default) ' +
81
93
  'for a real interview you want reflected in project-level analysis.'),
94
+ // --- Deprecated camelCase aliases (FUL-233) — rewritten before parse. ---
95
+ projectId: deprecatedAlias('project_id', z.string().uuid()),
96
+ personaId: deprecatedAlias('persona_id', z.string().uuid()),
97
+ interviewId: deprecatedAlias('interview_id', z.string().uuid()),
82
98
  });
83
99
  export class InterviewToolError extends ToolError {
84
100
  }
@@ -94,7 +110,7 @@ function makeCtx(deps) {
94
110
  * 404 means the interview/project isn't owned by the caller; 400 surfaces the
95
111
  * server's validation detail; everything else surfaces a generic HTTP error.
96
112
  */
97
- async function throwForResponse(response, deps, action) {
113
+ async function throwForResponse(response, deps, action, options) {
98
114
  const category = categorizeFetchError(response.status);
99
115
  if (category === 'auth') {
100
116
  if (response.refreshError?.kind !== 'transient')
@@ -102,8 +118,9 @@ async function throwForResponse(response, deps, action) {
102
118
  throw new InterviewToolError('Session expired. Re-run any Clien.ai tool to re-authenticate, then try again.');
103
119
  }
104
120
  if (response.status === 404) {
105
- throw new InterviewToolError(`Could not ${action} — interview or project not found, or you don't own it. ` +
106
- 'Confirm the ids (list_projects / the id from `start`).');
121
+ throw new InterviewToolError(options?.notFound ??
122
+ `Could not ${action} — interview or project not found, or you don't own it. ` +
123
+ 'Confirm the ids (list_projects / the id from `start`).');
107
124
  }
108
125
  const text = await response.text().catch(() => '');
109
126
  let detail = truncate(text, 200);
@@ -151,12 +168,12 @@ function formatTranscript(interview) {
151
168
  return lines.length > 0 ? `${header}\n\n${lines.join('\n\n')}` : header;
152
169
  }
153
170
  async function startInterview(input, ctx, deps) {
154
- if (!input.projectId || !input.personaId) {
155
- throw new InterviewToolError("action 'start' requires projectId and personaId.");
171
+ if (!input.project_id || !input.persona_id) {
172
+ throw new InterviewToolError("action 'start' requires project_id and persona_id.");
156
173
  }
157
174
  const response = await call(ctx, 'POST', '/api/interviews', 'start interview', {
158
- projectId: input.projectId,
159
- personaId: input.personaId,
175
+ projectId: input.project_id,
176
+ personaId: input.persona_id,
160
177
  withFirstMessage: true,
161
178
  ephemeral: input.ephemeral,
162
179
  });
@@ -184,10 +201,10 @@ async function startInterview(input, ctx, deps) {
184
201
  };
185
202
  }
186
203
  async function sendTurn(input, ctx, deps) {
187
- if (!input.interviewId || !input.content) {
188
- throw new InterviewToolError("action 'turn' requires interviewId and content.");
204
+ if (!input.interview_id || !input.content) {
205
+ throw new InterviewToolError("action 'turn' requires interview_id and content.");
189
206
  }
190
- const response = await call(ctx, 'POST', `/api/interviews/${input.interviewId}/turn`, 'send interview turn', { content: input.content });
207
+ const response = await call(ctx, 'POST', `/api/interviews/${input.interview_id}/turn`, 'send interview turn', { content: input.content });
191
208
  if (!response.ok)
192
209
  await throwForResponse(response, deps, 'send interview turn');
193
210
  const json = await readJson(response);
@@ -206,10 +223,10 @@ async function sendTurn(input, ctx, deps) {
206
223
  };
207
224
  }
208
225
  async function fetchTranscript(input, ctx, deps) {
209
- if (!input.interviewId) {
210
- throw new InterviewToolError("action 'transcript' requires interviewId.");
226
+ if (!input.interview_id) {
227
+ throw new InterviewToolError("action 'transcript' requires interview_id.");
211
228
  }
212
- const response = await call(ctx, 'GET', `/api/interviews/${input.interviewId}`, 'fetch transcript');
229
+ const response = await call(ctx, 'GET', `/api/interviews/${input.interview_id}`, 'fetch transcript');
213
230
  if (!response.ok)
214
231
  await throwForResponse(response, deps, 'fetch transcript');
215
232
  const json = await readJson(response);
@@ -224,10 +241,10 @@ async function fetchTranscript(input, ctx, deps) {
224
241
  }
225
242
  async function setStatus(input, ctx, deps, status) {
226
243
  const action = status === 'completed' ? 'complete' : 'reopen';
227
- if (!input.interviewId) {
228
- throw new InterviewToolError(`action '${action}' requires interviewId.`);
244
+ if (!input.interview_id) {
245
+ throw new InterviewToolError(`action '${action}' requires interview_id.`);
229
246
  }
230
- const response = await call(ctx, 'PATCH', `/api/interviews/${input.interviewId}`, `${action} interview`, { status });
247
+ const response = await call(ctx, 'PATCH', `/api/interviews/${input.interview_id}`, `${action} interview`, { status });
231
248
  if (!response.ok)
232
249
  await throwForResponse(response, deps, `${action} interview`);
233
250
  const json = await readJson(response);
@@ -261,4 +278,211 @@ export async function interviewPersona(input, deps) {
261
278
  return setStatus(data, ctx, deps, 'active');
262
279
  }
263
280
  }
281
+ // ---------------------------------------------------------------------------
282
+ // list_interviews + get_interview (FUL-209 / §U3) — read-only transcript recall
283
+ // ---------------------------------------------------------------------------
284
+ //
285
+ // `list_interviews` discovers past interviews in a project (get IDs, previously
286
+ // unrecoverable — `interview_persona action:transcript` needs an interviewId
287
+ // only obtainable from `action:start`); `get_interview` re-reads one full
288
+ // transcript. Both are read-only over the existing bearer endpoints — zero
289
+ // credit cost, zero side effects — mirroring `list_reports`/`get_report` and the
290
+ // `list_personas`/`get_persona` reads.
291
+ //
292
+ // Params are snake_case (`project_id`, `interview_id`) — matching the other read
293
+ // tools (`get_report`→`job_id`, `get_persona`→`persona_id`) — validated as UUIDs
294
+ // before the HTTP call, then mapped to the camelCase (`projectId`) the REST API
295
+ // expects. There is NO server-side `persona_id` filter, so v1 omits one rather
296
+ // than fake a client-side filter that would under-fill a page.
297
+ //
298
+ // ⚠️ THE LIST IS TRANSCRIPT-FREE (FUL-237). `list_interviews` asks for
299
+ // `?fields=summary`, so each entry carries `messageCount` and no `messages`.
300
+ // This closes the residual risk FUL-209 shipped with: the list used to put the
301
+ // full transcript of every interview in the page into `_meta`, which is a lot
302
+ // of context to spend on a call whose job is "which interviews exist?" — and
303
+ // which the tool's own text output never used beyond `messages.length`.
304
+ // `get_interview` is, and remains, the transcript read; an agent that wants the
305
+ // conversation asks for one by id.
306
+ const LIST_INTERVIEWS_TIMEOUT_MS = 30_000;
307
+ const LIST_LIMIT_MAX = 100;
308
+ const LIST_LIMIT_DEFAULT = 20;
309
+ export const ListInterviewsInputSchema = z.object({
310
+ project_id: z
311
+ .string()
312
+ .uuid()
313
+ .describe('UUID of the project whose interviews to list. Get it from `list_projects` ' +
314
+ '(or `create_project`). Rejected with a 404 if you do not own the project. ' +
315
+ 'Lists interviews started from the web app too, so you can discover an ' +
316
+ 'interview id to re-read with `get_interview`.'),
317
+ limit: z
318
+ .number()
319
+ .int()
320
+ .min(1)
321
+ .max(LIST_LIMIT_MAX)
322
+ .optional()
323
+ .default(LIST_LIMIT_DEFAULT)
324
+ .describe(`Maximum number of interviews to return (1-${LIST_LIMIT_MAX}, default ${LIST_LIMIT_DEFAULT}). ` +
325
+ 'Newest interviews come first.'),
326
+ offset: z
327
+ .number()
328
+ .int()
329
+ .min(0)
330
+ .optional()
331
+ .default(0)
332
+ .describe('Number of interviews to skip before returning results (default 0). ' +
333
+ 'Combine with `limit` to page through a large interview list; the total ' +
334
+ 'count is returned in `_meta.pagination.total`.'),
335
+ });
336
+ export const GetInterviewInputSchema = z.object({
337
+ interview_id: z
338
+ .string()
339
+ .uuid()
340
+ .describe('UUID of the interview to fetch. Get it from a `list_interviews` entry (or ' +
341
+ 'an interview\'s `_meta.interview.id` from `interview_persona`). Rejected ' +
342
+ 'with a 404 if you do not own it. Returns the full message transcript.'),
343
+ });
344
+ /**
345
+ * How many messages a listed interview has: the server's own `messageCount`
346
+ * (`?fields=summary`), else the length of an inlined transcript, else `null`
347
+ * for "we genuinely do not know".
348
+ *
349
+ * The transcript fallback is REQUIRED, not defensive padding. This client is
350
+ * published to npm on its own release cycle, so a `fields=summary` request can
351
+ * land on an app deploy whose route never reads the param — it answers with the
352
+ * full `messages` shape. Without the fallback every interview in that pairing
353
+ * would report an unknown count for a number sitting right there in the
354
+ * response.
355
+ *
356
+ * Shared by `list_interviews` and `get_project`'s interview leg so the two
357
+ * cannot disagree about the same interview's count, or about what "unknown"
358
+ * looks like — they previously derived it separately and had already drifted to
359
+ * different absent-value sentinels.
360
+ */
361
+ export function deriveMessageCount(entry) {
362
+ if (typeof entry.messageCount === 'number')
363
+ return entry.messageCount;
364
+ if (Array.isArray(entry.messages))
365
+ return entry.messages.length;
366
+ return null;
367
+ }
368
+ /**
369
+ * Drop a listed interview's transcript and publish its length instead.
370
+ *
371
+ * ⚠️ Strip here rather than trusting the server to have honoured
372
+ * `fields=summary`. `list_interviews` ADVERTISES that its entries carry
373
+ * `messageCount` and not transcripts; passing the server's array through
374
+ * verbatim would make that advert true only against an app deploy new enough to
375
+ * know the param — the exact pairing the fallback above exists because we cannot
376
+ * assume. An advert an agent can rely on has to hold by construction.
377
+ */
378
+ export function toInterviewSummary(interview) {
379
+ const { messages: _transcript, messageCount: _serverCount, ...rest } = interview;
380
+ return { ...rest, messageCount: deriveMessageCount(interview) };
381
+ }
382
+ export async function listInterviews(input, deps) {
383
+ const parsed = ListInterviewsInputSchema.safeParse(input);
384
+ if (!parsed.success) {
385
+ throw new InterviewToolError(`Invalid input — ${formatZodError(parsed.error)}`);
386
+ }
387
+ const { project_id: projectId, limit, offset } = parsed.data;
388
+ const ctx = makeCtx(deps);
389
+ const query = new URLSearchParams({
390
+ projectId,
391
+ limit: String(limit),
392
+ offset: String(offset),
393
+ // FUL-237: counts, not transcripts. An app deploy that predates this param
394
+ // ignores it and answers with the full shape, which the count below still
395
+ // reads correctly.
396
+ fields: 'summary',
397
+ });
398
+ let response;
399
+ try {
400
+ response = await apiCall(ctx, 'GET', `/api/interviews?${query.toString()}`, {
401
+ timeoutMs: LIST_INTERVIEWS_TIMEOUT_MS,
402
+ });
403
+ }
404
+ catch (err) {
405
+ const e = err;
406
+ if (e.name === 'AbortError' || e.name === 'TimeoutError') {
407
+ throw new InterviewToolError(`Listing interviews timed out after ${LIST_INTERVIEWS_TIMEOUT_MS / 1000}s. Try again in a moment.`);
408
+ }
409
+ throw err;
410
+ }
411
+ if (!response.ok) {
412
+ await throwForResponse(response, deps, 'list interviews', {
413
+ notFound: 'Could not list interviews — project not found, or you don\'t own it. ' +
414
+ 'Call list_projects to confirm the project_id.',
415
+ });
416
+ }
417
+ const json = await readJson(response);
418
+ // Summarise ONCE, then use that array for both the text lines and `_meta`, so
419
+ // what this tool renders and what it publishes can never describe different
420
+ // interviews — and so no transcript reaches `_meta` regardless of what the
421
+ // server sent back.
422
+ const interviews = (json?.interviews ?? []).map(toInterviewSummary);
423
+ const total = json?.pagination?.total ?? interviews.length;
424
+ let text;
425
+ if (interviews.length === 0) {
426
+ text =
427
+ offset > 0
428
+ ? `No interviews at offset ${offset} in project ${projectId} (total: ${total}).`
429
+ : `No interviews in project ${projectId}. Start one with interview_persona (action:start).`;
430
+ }
431
+ else {
432
+ const lines = interviews.map((iv) => {
433
+ // `null` means we do not know the count — printing "0 messages" for that
434
+ // reads as "this interview never happened", a worse answer than admitting
435
+ // the gap.
436
+ const count = iv.messageCount;
437
+ const messages = count === null ? 'message count unknown' : `${count} message${count === 1 ? '' : 's'}`;
438
+ const persona = iv.personaId ? ` with persona ${iv.personaId}` : '';
439
+ return `- ${iv.status ?? 'unknown'} interview${persona} — ${messages} (id: ${iv.id ?? 'unknown'})`;
440
+ });
441
+ const shown = offset + interviews.length;
442
+ const more = shown < total ? `\n\n${total - shown} more not shown — page with offset=${shown}.` : '';
443
+ text =
444
+ `Found ${total} interview${total === 1 ? '' : 's'} in project ${projectId}:\n${lines.join('\n')}${more}\n\n` +
445
+ 'Use get_interview with an id to re-read a full transcript.';
446
+ }
447
+ return {
448
+ content: [{ type: 'text', text }],
449
+ _meta: { interviews, pagination: json?.pagination ?? { limit, offset, total } },
450
+ };
451
+ }
452
+ export async function getInterview(input, deps) {
453
+ const parsed = GetInterviewInputSchema.safeParse(input);
454
+ if (!parsed.success) {
455
+ throw new InterviewToolError(`Invalid input — ${formatZodError(parsed.error)}`);
456
+ }
457
+ const { interview_id: interviewId } = parsed.data;
458
+ const ctx = makeCtx(deps);
459
+ let response;
460
+ try {
461
+ response = await apiCall(ctx, 'GET', `/api/interviews/${interviewId}`, {
462
+ timeoutMs: INTERVIEW_FETCH_TIMEOUT_MS,
463
+ });
464
+ }
465
+ catch (err) {
466
+ const e = err;
467
+ if (e.name === 'AbortError' || e.name === 'TimeoutError') {
468
+ throw new InterviewToolError(`Fetching the interview timed out after ${INTERVIEW_FETCH_TIMEOUT_MS / 1000}s. Try again in a moment.`);
469
+ }
470
+ throw err;
471
+ }
472
+ if (!response.ok) {
473
+ await throwForResponse(response, deps, 'get interview', {
474
+ notFound: 'Could not get interview — interview not found, or you don\'t own it. ' +
475
+ 'Confirm the interview_id (e.g. from list_interviews).',
476
+ });
477
+ }
478
+ const json = await readJson(response);
479
+ const interview = json?.interview;
480
+ if (!interview?.id) {
481
+ throw new InterviewToolError('Interview fetch returned no interview; the operation may not have succeeded.');
482
+ }
483
+ return {
484
+ content: [{ type: 'text', text: formatTranscript(interview) }],
485
+ _meta: { interview },
486
+ };
487
+ }
264
488
  //# sourceMappingURL=interview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interview.js","sourceRoot":"","sources":["../../src/tools/interview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,QAAQ,GAGT,MAAM,eAAe,CAAA;AAEtB,MAAM,0BAA0B,GAAG,MAAM,CAAA;AAEzC,qFAAqF;AACrF,MAAM,WAAW,GAAG,MAAM,CAAA;AAE1B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;SAC3D,QAAQ,CACP,kFAAkF;QAChF,uFAAuF;QACvF,sFAAsF;QACtF,kFAAkF;QAClF,4DAA4D,CAC/D;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,0FAA0F;QACxF,2DAA2D,CAC9D;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,2FAA2F;QACzF,wCAAwC,CAC3C;IACH,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,IAAI,EAAE;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,uFAAuF;QACrF,kCAAkC,CACrC;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC;SACnC,GAAG,CAAC,WAAW,EAAE,yBAAyB,WAAW,SAAS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AgB,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9D,KAAK,EAAE,EAAE,SAAS,EAAE;KACrB,CAAA;AACH,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * `outputSchema` declarations (FUL-243) — the SANCTIONED machine-readable channel.
3
+ *
4
+ * MCP 2025-06-18 (the version this server negotiates) introduced `outputSchema`
5
+ * on a tool advert plus `structuredContent` on a tool result. Before FUL-243 we
6
+ * declared `outputSchema` on 0 of 20 tools and shipped every structured payload
7
+ * down `_meta` — a channel a host is not obliged to surface and Claude Code drops
8
+ * outright. These schemas open the supported path.
9
+ *
10
+ * ⚠️ THE CONTRACT IS BINDING. Per spec, if a tool declares an `outputSchema` then
11
+ * its result MUST include `structuredContent` conforming to it. That obligation is
12
+ * met structurally, not by discipline: `defineTool` in `registry.ts` fills
13
+ * `structuredContent` from the handler's `_meta` for exactly the tools that carry a
14
+ * schema here, so declaring one cannot be separated from honouring it. (Error
15
+ * results are exempt per spec, and take the throw path that never reaches the
16
+ * filler.)
17
+ *
18
+ * ⚠️ WHY THESE SCHEMAS ARE PERMISSIVE, AND MUST STAY THAT WAY. Everything in this
19
+ * package parses report and entity payloads LENIENTLY on purpose — `.optional()`,
20
+ * `.catch()`, `.passthrough()` everywhere — so a backend that reshapes or drops a
21
+ * field degrades THAT FIELD rather than the whole response (FUL-183/184). A strict
22
+ * output schema would undo all of it at the last inch: a client validating a
23
+ * required field the backend just stopped sending turns a soft, still-useful
24
+ * degradation into a hard tool failure. That is a strictly worse bug than the
25
+ * invisible-data one this change fixes.
26
+ *
27
+ * So the rule for every schema below: `required` names ONLY what the handler
28
+ * itself guarantees — a field it throws without, or one it computes locally and
29
+ * always sets. Anything sourced from the backend is optional, and every object
30
+ * carries `additionalProperties: true` so a backend that ADDS a field stays valid.
31
+ *
32
+ * These are hand-written JSON Schema rather than generated from Zod, unlike the
33
+ * input adverts: the `_meta` payloads are raw backend shapes (`Persona`,
34
+ * `ReportResponse`, the collection rows), not Zod schemas we own, so there is
35
+ * nothing to generate FROM. `__tests__/agent-visible-output.test.ts`
36
+ * pins the declaration↔`structuredContent` invariant instead (its
37
+ * `outputSchema ↔ structuredContent contract` block).
38
+ */
39
+ /** JSON Schema for an open-ended object we make no promises about. */
40
+ const ANY_OBJECT = { type: 'object', additionalProperties: true };
41
+ /**
42
+ * A value we constrain NOT AT ALL (an empty schema accepts anything).
43
+ *
44
+ * Used for `report_data`, and deliberately not `{ type: ['object','null'] }`.
45
+ * `getReport` keeps the RAW backend payload when Zod rejects it — never drop
46
+ * report data on drift — so a drifted `reportData` that is an array or a string
47
+ * genuinely reaches `structuredContent`. Under a type constraint, a strict client
48
+ * would then reject an otherwise-successful result and the user would lose the
49
+ * report at exactly the moment the fail-soft path was supposed to save it.
50
+ * Constraining the type here would convert this module's stated fail-soft stance
51
+ * into the hard failure it exists to prevent.
52
+ */
53
+ const ANYTHING = {};
54
+ /** An array of open-ended objects — every collection payload we return. */
55
+ const ANY_OBJECT_ARRAY = { type: 'array', items: ANY_OBJECT };
56
+ /**
57
+ * The `{ limit, offset, total }` envelope every paginated list returns.
58
+ *
59
+ * Nothing is `required` AND the three fields carry no `type`. The handlers copy
60
+ * the server's pagination through with `??` (`json?.pagination ?? {limit,offset,total}`,
61
+ * and `resolvePagination` in collections.ts) — a nullish fallback, not a type
62
+ * check — so a backend that answers `{"total": "20"}` produces a perfectly usable
63
+ * result whose `structuredContent` would fail a `type: number` assertion. Every
64
+ * field here is backend-sourced, so by this module's own rule none of it may be
65
+ * constrained. The object shape stays so the field names remain discoverable.
66
+ */
67
+ const PAGINATION = {
68
+ type: 'object',
69
+ properties: {
70
+ limit: {},
71
+ offset: {},
72
+ total: {},
73
+ },
74
+ additionalProperties: true,
75
+ };
76
+ function objectSchema(properties, required) {
77
+ return { type: 'object', properties, required, additionalProperties: true };
78
+ }
79
+ /**
80
+ * A `{ <key>: <rows>, pagination }` list envelope.
81
+ *
82
+ * The collection key is `required` because the handlers guarantee it: each one
83
+ * either maps a rows array or throws. `pagination` is not — `list_reports` has
84
+ * none, and a reshaped envelope must not invalidate a usable list.
85
+ */
86
+ function listSchema(collectionKey, withPagination = true) {
87
+ const properties = { [collectionKey]: ANY_OBJECT_ARRAY };
88
+ if (withPagination)
89
+ properties.pagination = PAGINATION;
90
+ return objectSchema(properties, [collectionKey]);
91
+ }
92
+ /**
93
+ * `get_persona` → `{ persona }`.
94
+ *
95
+ * `persona.id` is `required` because `getPersona` throws when the response has no
96
+ * id — so a successful result always has one. Every other field comes from the
97
+ * app's `toPersona` mapper and is therefore optional here: `@clien-ai/mcp` ships
98
+ * on its own release cycle and a published client routinely meets an app deploy
99
+ * older or newer than itself (the skew FUL-237 already had to design around), so
100
+ * requiring a backend-sourced field would make normal version skew a hard failure.
101
+ */
102
+ export const GET_PERSONA_OUTPUT_SCHEMA = objectSchema({ persona: objectSchema({ id: {} }, ['id']) }, ['persona']);
103
+ /**
104
+ * `get_report` → `{ job_id, status, report_data }`.
105
+ *
106
+ * `job_id` and `status` are `required` because the handler sets both itself
107
+ * (`job_id` is the validated input echoed back; `status` defaults to 'complete').
108
+ * `report_data` is UNCONSTRAINED and NOT required — a job can legitimately carry
109
+ * markdown with no structured payload, and the handler also passes the RAW payload
110
+ * through when Zod rejects it (which can be an array or a string, not just an
111
+ * object). Asserting any shape there would convert exactly the backend drift we
112
+ * deliberately tolerate into a tool failure. `id` on the entity schemas is
113
+ * `required` but untyped for the same reason: the handler guarantees the field is
114
+ * PRESENT (it throws otherwise), not that the backend typed it as a string.
115
+ */
116
+ export const GET_REPORT_OUTPUT_SCHEMA = objectSchema({
117
+ job_id: { type: 'string' },
118
+ status: { type: 'string' },
119
+ report_data: ANYTHING,
120
+ }, ['job_id', 'status']);
121
+ /** `get_interview` → `{ interview }`. `id` guaranteed: the handler throws without it. */
122
+ export const GET_INTERVIEW_OUTPUT_SCHEMA = objectSchema({ interview: objectSchema({ id: {} }, ['id']) }, ['interview']);
123
+ export const LIST_PERSONAS_OUTPUT_SCHEMA = listSchema('personas');
124
+ export const LIST_PROJECTS_OUTPUT_SCHEMA = listSchema('projects');
125
+ export const LIST_INTERVIEWS_OUTPUT_SCHEMA = listSchema('interviews');
126
+ export const LIST_COMPETITORS_OUTPUT_SCHEMA = listSchema('competitors');
127
+ export const LIST_COMMUNITY_SIGNALS_OUTPUT_SCHEMA = listSchema('communitySignals');
128
+ /** `list_reports` returns no pagination envelope — the endpoint takes `limit` only. */
129
+ export const LIST_REPORTS_OUTPUT_SCHEMA = listSchema('jobs', false);
130
+ //# sourceMappingURL=output-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-schemas.js","sourceRoot":"","sources":["../../src/tools/output-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,sEAAsE;AACtE,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAW,CAAA;AAE1E;;;;;;;;;;;GAWG;AACH,MAAM,QAAQ,GAAG,EAAW,CAAA;AAE5B,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAW,CAAA;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;KACV;IACD,oBAAoB,EAAE,IAAI;CAClB,CAAA;AAEV,SAAS,YAAY,CACnB,UAAmC,EACnC,QAAkB;IAElB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAA;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,aAAqB,EAAE,cAAc,GAAG,IAAI;IAC9D,MAAM,UAAU,GAA4B,EAAE,CA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