thorbit-deposition-mcp 0.1.1 → 0.1.2

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.
@@ -104,9 +104,15 @@ var ThorbitDepositionListInputSchema = {
104
104
  limit: import_zod.z.number().int().min(1).max(100).default(25).describe("Maximum runs to return."),
105
105
  offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset.")
106
106
  };
107
+ var ThorbitDepositionSearchInputSchema = {
108
+ query: import_zod.z.string().min(1).max(300).describe("Text to search across run company, category, and playbook content."),
109
+ projectPublicId: import_zod.z.string().min(1).optional().describe("Optional project filter."),
110
+ limit: import_zod.z.number().int().min(1).max(50).default(15).describe("Maximum matches to return."),
111
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset.")
112
+ };
107
113
 
108
114
  // src/deposition-mcp-server.ts
109
- var VERSION = "0.1.1";
115
+ var VERSION = "0.1.2";
110
116
  function readOnlyAnnotations(title) {
111
117
  return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
112
118
  }
@@ -168,6 +174,12 @@ function buildThorbitDepositionMcpServer(client) {
168
174
  inputSchema: ThorbitDepositionListInputSchema,
169
175
  annotations: readOnlyAnnotations("List Depositioning Runs")
170
176
  });
177
+ registerTool("thorbit_deposition_search", {
178
+ title: "Search Depositioning Runs",
179
+ description: 'Full-text search across past Depositioning runs \u2014 matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. "pricing opacity", "rehab", "switching cost"), not just by company name.',
180
+ inputSchema: ThorbitDepositionSearchInputSchema,
181
+ annotations: readOnlyAnnotations("Search Depositioning Runs")
182
+ });
171
183
  return server;
172
184
  }
173
185
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../bin/thorbit-deposition-mcp.ts","../../src/deposition-api-client.ts","../../src/deposition-mcp-env.ts","../../src/deposition-mcp-server.ts","../../src/deposition-mcp-response-formatters.ts","../../src/deposition-mcp-tool-schemas.ts"],"sourcesContent":["import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { ThorbitDepositionApiClient } from '../src/deposition-api-client.js'\nimport { resolveThorbitDepositionMcpEnv } from '../src/deposition-mcp-env.js'\nimport { buildThorbitDepositionMcpServer } from '../src/deposition-mcp-server.js'\n\nasync function main() {\n const env = resolveThorbitDepositionMcpEnv()\n const client = new ThorbitDepositionApiClient(env)\n const server = buildThorbitDepositionMcpServer(client)\n await server.connect(new StdioServerTransport())\n}\n\nmain().catch(error => {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exit(1)\n})\n","import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.1'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n}\n"],"mappings":";;;;AAAA,mBAAqC;;;ACmB9B,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAAA,IAClC,CAAC;AAED,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,IAAI;AACnD,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,KAAM,QAAO;AAE7D,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,MAAM,SAAS,KAAK,qBAAqB,QAAQ,SAAS,MAAM;AAAA,QAChE,SAAS,SAAS,KAAK,6CAA6C,wCAAwC,SAAS,MAAM;AAAA,MAC7H;AAAA,IACF;AAAA,EACF;AACF;;;AClDA,qBAA6B;AAC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mC;AAAA,IAC9C,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,6BAA6B;AAAA,EAChE,CAAC;AAED,eAAa,oCAAoC;AAAA,IAC/C,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,6BAA6B;AAAA,EAChE,CAAC;AAED,eAAa,2BAA2B;AAAA,IACtC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,yBAAyB;AAAA,EAC5D,CAAC;AAED,SAAO;AACT;;;AH7FA,eAAe,OAAO;AACpB,QAAM,MAAM,+BAA+B;AAC3C,QAAM,SAAS,IAAI,2BAA2B,GAAG;AACjD,QAAM,SAAS,gCAAgC,MAAM;AACrD,QAAM,OAAO,QAAQ,IAAI,kCAAqB,CAAC;AACjD;AAEA,KAAK,EAAE,MAAM,WAAS;AACpB,UAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAClF,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../bin/thorbit-deposition-mcp.ts","../../src/deposition-api-client.ts","../../src/deposition-mcp-env.ts","../../src/deposition-mcp-server.ts","../../src/deposition-mcp-response-formatters.ts","../../src/deposition-mcp-tool-schemas.ts"],"sourcesContent":["import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { ThorbitDepositionApiClient } from '../src/deposition-api-client.js'\nimport { resolveThorbitDepositionMcpEnv } from '../src/deposition-mcp-env.js'\nimport { buildThorbitDepositionMcpServer } from '../src/deposition-mcp-server.js'\n\nasync function main() {\n const env = resolveThorbitDepositionMcpEnv()\n const client = new ThorbitDepositionApiClient(env)\n const server = buildThorbitDepositionMcpServer(client)\n await server.connect(new StdioServerTransport())\n}\n\nmain().catch(error => {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exit(1)\n})\n","import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n ThorbitDepositionSearchInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.2'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n registerTool('thorbit_deposition_search', {\n title: 'Search Depositioning Runs',\n description: 'Full-text search across past Depositioning runs — matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. \"pricing opacity\", \"rehab\", \"switching cost\"), not just by company name.',\n inputSchema: ThorbitDepositionSearchInputSchema,\n annotations: readOnlyAnnotations('Search Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionSearchInputSchema = {\n query: z.string().min(1).max(300).describe('Text to search across run company, category, and playbook content.'),\n projectPublicId: z.string().min(1).optional().describe('Optional project filter.'),\n limit: z.number().int().min(1).max(50).default(15).describe('Maximum matches to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n thorbit_deposition_search: ThorbitDepositionSearchInputSchema,\n}\n"],"mappings":";;;;AAAA,mBAAqC;;;ACmB9B,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAAA,IAClC,CAAC;AAED,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,IAAI;AACnD,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,KAAM,QAAO;AAE7D,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,MAAM,SAAS,KAAK,qBAAqB,QAAQ,SAAS,M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,WAAS;AACpB,UAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAClF,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
@@ -103,9 +103,15 @@ var ThorbitDepositionListInputSchema = {
103
103
  limit: z.number().int().min(1).max(100).default(25).describe("Maximum runs to return."),
104
104
  offset: z.number().int().min(0).default(0).describe("Pagination offset.")
105
105
  };
106
+ var ThorbitDepositionSearchInputSchema = {
107
+ query: z.string().min(1).max(300).describe("Text to search across run company, category, and playbook content."),
108
+ projectPublicId: z.string().min(1).optional().describe("Optional project filter."),
109
+ limit: z.number().int().min(1).max(50).default(15).describe("Maximum matches to return."),
110
+ offset: z.number().int().min(0).default(0).describe("Pagination offset.")
111
+ };
106
112
 
107
113
  // src/deposition-mcp-server.ts
108
- var VERSION = "0.1.1";
114
+ var VERSION = "0.1.2";
109
115
  function readOnlyAnnotations(title) {
110
116
  return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
111
117
  }
@@ -167,6 +173,12 @@ function buildThorbitDepositionMcpServer(client) {
167
173
  inputSchema: ThorbitDepositionListInputSchema,
168
174
  annotations: readOnlyAnnotations("List Depositioning Runs")
169
175
  });
176
+ registerTool("thorbit_deposition_search", {
177
+ title: "Search Depositioning Runs",
178
+ description: 'Full-text search across past Depositioning runs \u2014 matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. "pricing opacity", "rehab", "switching cost"), not just by company name.',
179
+ inputSchema: ThorbitDepositionSearchInputSchema,
180
+ annotations: readOnlyAnnotations("Search Depositioning Runs")
181
+ });
170
182
  return server;
171
183
  }
172
184
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../bin/thorbit-deposition-mcp.ts","../../src/deposition-api-client.ts","../../src/deposition-mcp-env.ts","../../src/deposition-mcp-server.ts","../../src/deposition-mcp-response-formatters.ts","../../src/deposition-mcp-tool-schemas.ts"],"sourcesContent":["import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { ThorbitDepositionApiClient } from '../src/deposition-api-client.js'\nimport { resolveThorbitDepositionMcpEnv } from '../src/deposition-mcp-env.js'\nimport { buildThorbitDepositionMcpServer } from '../src/deposition-mcp-server.js'\n\nasync function main() {\n const env = resolveThorbitDepositionMcpEnv()\n const client = new ThorbitDepositionApiClient(env)\n const server = buildThorbitDepositionMcpServer(client)\n await server.connect(new StdioServerTransport())\n}\n\nmain().catch(error => {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exit(1)\n})\n","import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.1'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n}\n"],"mappings":";;;AAAA,SAAS,4BAA4B;;;ACmB9B,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAAA,IAClC,CAAC;AAED,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,IAAI;AACnD,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,KAAM,QAAO;AAE7D,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,MAAM,SAAS,KAAK,qBAAqB,QAAQ,SAAS,MAAM;AAAA,QAChE,SAAS,SAAS,KAAK,6CAA6C,wCAAwC,SAAS,MAAM;AAAA,MAC7H;AAAA,IACF;AAAA,EACF;AACF;;;AClDA,SAAS,oBAAoB;AA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,eAAa,mCAAmC;AAAA,IAC9C,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,6BAA6B;AAAA,EAChE,CAAC;AAED,eAAa,oCAAoC;AAAA,IAC/C,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,6BAA6B;AAAA,EAChE,CAAC;AAED,eAAa,2BAA2B;AAAA,IACtC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,yBAAyB;AAAA,EAC5D,CAAC;AAED,SAAO;AACT;;;AH7FA,eAAe,OAAO;AACpB,QAAM,MAAM,+BAA+B;AAC3C,QAAM,SAAS,IAAI,2BAA2B,GAAG;AACjD,QAAM,SAAS,gCAAgC,MAAM;AACrD,QAAM,OAAO,QAAQ,IAAI,qBAAqB,CAAC;AACjD;AAEA,KAAK,EAAE,MAAM,WAAS;AACpB,UAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAClF,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../bin/thorbit-deposition-mcp.ts","../../src/deposition-api-client.ts","../../src/deposition-mcp-env.ts","../../src/deposition-mcp-server.ts","../../src/deposition-mcp-response-formatters.ts","../../src/deposition-mcp-tool-schemas.ts"],"sourcesContent":["import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { ThorbitDepositionApiClient } from '../src/deposition-api-client.js'\nimport { resolveThorbitDepositionMcpEnv } from '../src/deposition-mcp-env.js'\nimport { buildThorbitDepositionMcpServer } from '../src/deposition-mcp-server.js'\n\nasync function main() {\n const env = resolveThorbitDepositionMcpEnv()\n const client = new ThorbitDepositionApiClient(env)\n const server = buildThorbitDepositionMcpServer(client)\n await server.connect(new StdioServerTransport())\n}\n\nmain().catch(error => {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exit(1)\n})\n","import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n ThorbitDepositionSearchInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.2'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n registerTool('thorbit_deposition_search', {\n title: 'Search Depositioning Runs',\n description: 'Full-text search across past Depositioning runs — matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. \"pricing opacity\", \"rehab\", \"switching cost\"), not just by company name.',\n inputSchema: ThorbitDepositionSearchInputSchema,\n annotations: readOnlyAnnotations('Search Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionSearchInputSchema = {\n query: z.string().min(1).max(300).describe('Text to search across run company, category, and playbook content.'),\n projectPublicId: z.string().min(1).optional().describe('Optional project filter.'),\n limit: z.number().int().min(1).max(50).default(15).describe('Maximum matches to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n thorbit_deposition_search: ThorbitDepositionSearchInputSchema,\n}\n"],"mappings":";;;AAAA,SAAS,4BAA4B;;;ACmB9B,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAAA,IAClC,CAAC;AAED,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,IAAI;AACnD,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,KAAM,QAAO;AAE7D,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,MAAM,SAAS,KAAK,qBAAq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AAC;AACjD;AAEA,KAAK,EAAE,MAAM,WAAS;AACpB,UAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAClF,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
package/dist/index.cjs CHANGED
@@ -101,9 +101,15 @@ var ThorbitDepositionListInputSchema = {
101
101
  limit: import_zod.z.number().int().min(1).max(100).default(25).describe("Maximum runs to return."),
102
102
  offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset.")
103
103
  };
104
+ var ThorbitDepositionSearchInputSchema = {
105
+ query: import_zod.z.string().min(1).max(300).describe("Text to search across run company, category, and playbook content."),
106
+ projectPublicId: import_zod.z.string().min(1).optional().describe("Optional project filter."),
107
+ limit: import_zod.z.number().int().min(1).max(50).default(15).describe("Maximum matches to return."),
108
+ offset: import_zod.z.number().int().min(0).default(0).describe("Pagination offset.")
109
+ };
104
110
 
105
111
  // src/deposition-mcp-server.ts
106
- var VERSION = "0.1.1";
112
+ var VERSION = "0.1.2";
107
113
  function readOnlyAnnotations(title) {
108
114
  return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
109
115
  }
@@ -165,6 +171,12 @@ function buildThorbitDepositionMcpServer(client) {
165
171
  inputSchema: ThorbitDepositionListInputSchema,
166
172
  annotations: readOnlyAnnotations("List Depositioning Runs")
167
173
  });
174
+ registerTool("thorbit_deposition_search", {
175
+ title: "Search Depositioning Runs",
176
+ description: 'Full-text search across past Depositioning runs \u2014 matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. "pricing opacity", "rehab", "switching cost"), not just by company name.',
177
+ inputSchema: ThorbitDepositionSearchInputSchema,
178
+ annotations: readOnlyAnnotations("Search Depositioning Runs")
179
+ });
168
180
  return server;
169
181
  }
170
182
 
@@ -202,7 +214,8 @@ var ThorbitDepositionMcpToolNames = [
202
214
  "thorbit_deposition_get",
203
215
  "thorbit_deposition_get_playbook",
204
216
  "thorbit_deposition_artifact_read",
205
- "thorbit_deposition_list"
217
+ "thorbit_deposition_list",
218
+ "thorbit_deposition_search"
206
219
  ];
207
220
  // Annotate the CommonJS export names for ESM import in node:
208
221
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/deposition-api-client.ts","../src/deposition-mcp-server.ts","../src/deposition-mcp-response-formatters.ts","../src/deposition-mcp-tool-schemas.ts","../src/deposition-mcp-env.ts","../src/deposition-mcp-tool-names.ts"],"sourcesContent":["export { ThorbitDepositionApiClient } from './deposition-api-client.js'\nexport { buildThorbitDepositionMcpServer, SERVER_INSTRUCTIONS } from './deposition-mcp-server.js'\nexport { resolveThorbitDepositionMcpEnv } from './deposition-mcp-env.js'\nexport { ThorbitDepositionMcpToolNames } from './deposition-mcp-tool-names.js'\n","import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.1'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","export const ThorbitDepositionMcpToolNames = [\n 'thorbit_deposition_start',\n 'thorbit_deposition_get',\n 'thorbit_deposition_get_playbook',\n 'thorbit_deposition_artifact_read',\n 'thorbit_deposition_list',\n] as const\n\nexport type ThorbitDepositionMcpToolName = typeof ThorbitDepositionMcpToolNames[number]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CA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IACb,aAAa;AAAA,IACb,aAAa,oBAAoB,yBAAyB;AAAA,EAC5D,CAAC;AAED,SAAO;AACT;;;AGlGA,qBAA6B;AAC7B,qBAAwB;AACxB,uBAAqB;AAOrB,SAAS,iBAAqC;AAC5C,QAAM,eAAe,QAAQ,IAAI,iCAAiC,KAAK;AACvE,QAAM,QAAQ,CAAC,kBAAc,2BAAK,wBAAQ,GAAG,6BAA6B,CAAC,EAAE,OAAO,OAAO;AAC3F,aAAW,QAAQ,OAAO;AACxB,QAAI;AACF,YAAM,YAAQ,6BAAa,MAAM,MAAM,EAAE,KAAK;AAC9C,UAAI,MAAO,QAAO;AAAA,IACpB,QAAQ;AACN;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,iCAA0D;AACxE,QAAM,UACJ,QAAQ,IAAI,mBACZ,QAAQ,IAAI,uBACZ,QAAQ,IAAI,kCACZ,eAAe,IACd,KAAK;AAER,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,oFAAoF;AAAA,EACtG;AAEA,SAAO;AAAA,IACL;AAAA,IACA,UAAU,QAAQ,IAAI,oBAAoB,QAAQ,IAAI,mCAAmC,sBAAsB,KAAK;AAAA,EACtH;AACF;;;ACvCO,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/deposition-api-client.ts","../src/deposition-mcp-server.ts","../src/deposition-mcp-response-formatters.ts","../src/deposition-mcp-tool-schemas.ts","../src/deposition-mcp-env.ts","../src/deposition-mcp-tool-names.ts"],"sourcesContent":["export { ThorbitDepositionApiClient } from './deposition-api-client.js'\nexport { buildThorbitDepositionMcpServer, SERVER_INSTRUCTIONS } from './deposition-mcp-server.js'\nexport { resolveThorbitDepositionMcpEnv } from './deposition-mcp-env.js'\nexport { ThorbitDepositionMcpToolNames } from './deposition-mcp-tool-names.js'\n","import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n ThorbitDepositionSearchInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.2'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n registerTool('thorbit_deposition_search', {\n title: 'Search Depositioning Runs',\n description: 'Full-text search across past Depositioning runs — matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. \"pricing opacity\", \"rehab\", \"switching cost\"), not just by company name.',\n inputSchema: ThorbitDepositionSearchInputSchema,\n annotations: readOnlyAnnotations('Search Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionSearchInputSchema = {\n query: z.string().min(1).max(300).describe('Text to search across run company, category, and playbook content.'),\n projectPublicId: z.string().min(1).optional().describe('Optional project filter.'),\n limit: z.number().int().min(1).max(50).default(15).describe('Maximum matches to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n thorbit_deposition_search: ThorbitDepositionSearchInputSchema,\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","export const ThorbitDepositionMcpToolNames = [\n 'thorbit_deposition_start',\n 'thorbit_deposition_get',\n 'thorbit_deposition_get_playbook',\n 'thorbit_deposition_artifact_read',\n 'thorbit_deposition_list',\n 'thorbit_deposition_search',\n] as const\n\nexport type ThorbitDepositionMcpToolName = typeof ThorbitDepositionMcpToolNames[number]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAAA,IAClC,CAAC;AAED,UAA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AAsB,KAAK;AAAA,EACtH;AACF;;;ACvCO,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
 
3
- declare const ThorbitDepositionMcpToolNames: readonly ["thorbit_deposition_start", "thorbit_deposition_get", "thorbit_deposition_get_playbook", "thorbit_deposition_artifact_read", "thorbit_deposition_list"];
3
+ declare const ThorbitDepositionMcpToolNames: readonly ["thorbit_deposition_start", "thorbit_deposition_get", "thorbit_deposition_get_playbook", "thorbit_deposition_artifact_read", "thorbit_deposition_list", "thorbit_deposition_search"];
4
4
  type ThorbitDepositionMcpToolName = typeof ThorbitDepositionMcpToolNames[number];
5
5
 
6
6
  type ThorbitDepositionMcpEnvelope = {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
 
3
- declare const ThorbitDepositionMcpToolNames: readonly ["thorbit_deposition_start", "thorbit_deposition_get", "thorbit_deposition_get_playbook", "thorbit_deposition_artifact_read", "thorbit_deposition_list"];
3
+ declare const ThorbitDepositionMcpToolNames: readonly ["thorbit_deposition_start", "thorbit_deposition_get", "thorbit_deposition_get_playbook", "thorbit_deposition_artifact_read", "thorbit_deposition_list", "thorbit_deposition_search"];
4
4
  type ThorbitDepositionMcpToolName = typeof ThorbitDepositionMcpToolNames[number];
5
5
 
6
6
  type ThorbitDepositionMcpEnvelope = {
package/dist/index.js CHANGED
@@ -72,9 +72,15 @@ var ThorbitDepositionListInputSchema = {
72
72
  limit: z.number().int().min(1).max(100).default(25).describe("Maximum runs to return."),
73
73
  offset: z.number().int().min(0).default(0).describe("Pagination offset.")
74
74
  };
75
+ var ThorbitDepositionSearchInputSchema = {
76
+ query: z.string().min(1).max(300).describe("Text to search across run company, category, and playbook content."),
77
+ projectPublicId: z.string().min(1).optional().describe("Optional project filter."),
78
+ limit: z.number().int().min(1).max(50).default(15).describe("Maximum matches to return."),
79
+ offset: z.number().int().min(0).default(0).describe("Pagination offset.")
80
+ };
75
81
 
76
82
  // src/deposition-mcp-server.ts
77
- var VERSION = "0.1.1";
83
+ var VERSION = "0.1.2";
78
84
  function readOnlyAnnotations(title) {
79
85
  return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
80
86
  }
@@ -136,6 +142,12 @@ function buildThorbitDepositionMcpServer(client) {
136
142
  inputSchema: ThorbitDepositionListInputSchema,
137
143
  annotations: readOnlyAnnotations("List Depositioning Runs")
138
144
  });
145
+ registerTool("thorbit_deposition_search", {
146
+ title: "Search Depositioning Runs",
147
+ description: 'Full-text search across past Depositioning runs \u2014 matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. "pricing opacity", "rehab", "switching cost"), not just by company name.',
148
+ inputSchema: ThorbitDepositionSearchInputSchema,
149
+ annotations: readOnlyAnnotations("Search Depositioning Runs")
150
+ });
139
151
  return server;
140
152
  }
141
153
 
@@ -173,7 +185,8 @@ var ThorbitDepositionMcpToolNames = [
173
185
  "thorbit_deposition_get",
174
186
  "thorbit_deposition_get_playbook",
175
187
  "thorbit_deposition_artifact_read",
176
- "thorbit_deposition_list"
188
+ "thorbit_deposition_list",
189
+ "thorbit_deposition_search"
177
190
  ];
178
191
  export {
179
192
  SERVER_INSTRUCTIONS,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/deposition-api-client.ts","../src/deposition-mcp-server.ts","../src/deposition-mcp-response-formatters.ts","../src/deposition-mcp-tool-schemas.ts","../src/deposition-mcp-env.ts","../src/deposition-mcp-tool-names.ts"],"sourcesContent":["import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.1'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","export const ThorbitDepositionMcpToolNames = [\n 'thorbit_deposition_start',\n 'thorbit_deposition_get',\n 'thorbit_deposition_get_playbook',\n 'thorbit_deposition_artifact_read',\n 'thorbit_deposition_list',\n] as const\n\nexport type ThorbitDepositionMcpToolName = typeof ThorbitDepositionMcpToolNames[number]\n"],"mappings":";;;AAmBO,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,UAAwC,OAAuD;AAC5G,UAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,0BAA0B,QAAQ,IAAI;AAAA,MAChF,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,qBAAqB,KAAK;AAAA,QAC1B,gBAAgB;AAAA,MAClB;AAAA,MACA,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAAA,IAClC,CAAC;AAED,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,MAAM,IAAI;AACnD,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,KAAM,QAAO;AAE7D,WAAO;AAAA,MACL,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,OAAO;AAAA,QACL,MAAM,SAAS,KAAK,qBAAqB,QAAQ,SAAS,MAAM;AAAA,QAChE,SAAS,SAAS,KAAK,6CAA6C,wCAAwC,SAAS,MAAM;AAAA,MAC7H;AAAA,IACF;AAAA,EACF;AACF;;;AClDA,SAAS,iBAAiB;;;ACInB,SAAS,qCACd,UACA,UACgB;AAChB,QAAM,OAAO,KAAK,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAC9D,SAAO;AAAA,IACL,SAAS,CAAC,EAAE,MAAM,QAAQ,KAAK,CAAC;AAAA,IAChC,SAAS,CAAC,SAAS;AAAA,EACrB;AACF;;;ACbA,SAAS,SAAS;AAEX,IAAM,oCAAoC;AAAA,EAC/C,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,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,QAAQ,IAAI,mCAAmC,sBAAsB,KAAK;AAAA,EACtH;AACF;;;ACvCO,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/deposition-api-client.ts","../src/deposition-mcp-server.ts","../src/deposition-mcp-response-formatters.ts","../src/deposition-mcp-tool-schemas.ts","../src/deposition-mcp-env.ts","../src/deposition-mcp-tool-names.ts"],"sourcesContent":["import type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport type ThorbitDepositionMcpEnvelope =\n | {\n ok: true\n result: unknown\n warnings?: string[]\n requestId: string\n }\n | {\n ok: false\n error: {\n code: string\n message: string\n details?: unknown\n }\n requestId: string\n }\n\nexport class ThorbitDepositionApiClient {\n private readonly baseUrl: string\n private readonly apiKey: string\n\n constructor(options: { baseUrl: string; apiKey: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/$/, '')\n this.apiKey = options.apiKey\n }\n\n async callTool(toolName: ThorbitDepositionMcpToolName, input: unknown): Promise<ThorbitDepositionMcpEnvelope> {\n const response = await fetch(`${this.baseUrl}/api/v1/mcp/deposition/${toolName}`, {\n method: 'POST',\n headers: {\n 'x-thorbit-api-key': this.apiKey,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(input ?? {}),\n })\n\n const body = await response.json().catch(() => null) as ThorbitDepositionMcpEnvelope | null\n if (body && typeof body === 'object' && 'ok' in body) return body\n\n return {\n ok: false,\n requestId: 'unavailable',\n error: {\n code: response.ok ? 'invalid_response' : `http_${response.status}`,\n message: response.ok ? 'Thorbit returned an invalid MCP response' : `Thorbit API request failed with HTTP ${response.status}`,\n },\n }\n }\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js'\nimport type { ZodRawShape } from 'zod'\nimport type { ThorbitDepositionApiClient } from './deposition-api-client.js'\nimport { formatThorbitDepositionMcpToolResult } from './deposition-mcp-response-formatters.js'\nimport {\n ThorbitDepositionStartInputSchema,\n ThorbitDepositionGetInputSchema,\n ThorbitDepositionGetPlaybookInputSchema,\n ThorbitDepositionArtifactReadInputSchema,\n ThorbitDepositionListInputSchema,\n ThorbitDepositionSearchInputSchema,\n} from './deposition-mcp-tool-schemas.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nconst VERSION = '0.1.2'\n\ntype ThorbitDepositionToolConfig<InputArgs extends ZodRawShape> = {\n title: string\n description: string\n inputSchema: InputArgs\n annotations: ToolAnnotations\n}\n\nfunction readOnlyAnnotations(title: string) {\n return { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }\n}\n\nfunction writeAnnotations(title: string) {\n return { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }\n}\n\nexport const SERVER_INSTRUCTIONS = [\n 'Thorbit Depositioning MCP. Runs the durable Depositioning strategy pipeline on hosted Thorbit (this server is a thin client). It researches competitors + customers, finds the binding vulnerability, classifies mover populations, designs a category class, builds a displacement mechanism, and writes a strategy playbook. All write/analysis tools are metered against your API key.',\n '',\n 'INTAKE (ask the user these BEFORE thorbit_deposition_start, then run):',\n '1. Company / product name being depositioned.',\n '2. Product URL (the challenger homepage).',\n '3. Category name (e.g. \"B2B sales analytics\").',\n '4. Optional: 0-5 competitor URLs (auto-discovered via SERP if fewer than 2).',\n '5. Optional: a customer reviews URL (G2 / Trustpilot / Reddit) and known customer pain points.',\n '',\n 'ASYNC CONTRACT (important):',\n '- thorbit_deposition_start returns quickly with {runPublicId, poll}. Do NOT block — follow result.poll.',\n '- Poll thorbit_deposition_get until status is terminal (complete/failed). It returns a LEAN status (phase, progress, binding state, strategy) with a nextAction.',\n '- When status is complete, call thorbit_deposition_get_playbook to read the finished markdown playbook.',\n '- thorbit_deposition_get also returns an ARTIFACTS manifest (research/own.json, research/competitor-N.json, research/customers.json, research/market.json, vulnerability.json, movers.json, category.json, mechanism.json, playbook.md). Read any one on demand with thorbit_deposition_artifact_read(runPublicId, artifactId) — do NOT pull includePhaseData unless you need the whole raw bundle.',\n '- Use thorbit_deposition_list to find past runs (by company/status) and their runPublicId.',\n].join('\\n')\n\nexport function buildThorbitDepositionMcpServer(client: ThorbitDepositionApiClient): McpServer {\n const server = new McpServer({ name: 'thorbit-deposition-mcp', version: VERSION }, { instructions: SERVER_INSTRUCTIONS })\n\n function registerTool<T extends ThorbitDepositionMcpToolName>(\n toolName: T,\n config: ThorbitDepositionToolConfig<ZodRawShape>,\n ): void {\n server.registerTool(toolName, config, async (input) => {\n const envelope = await client.callTool(toolName, input)\n return formatThorbitDepositionMcpToolResult(toolName, envelope)\n })\n }\n\n registerTool('thorbit_deposition_start', {\n title: 'Start Depositioning Run',\n description: 'Start a durable Depositioning strategy run for a challenger product in a category. Researches competitors and customers, finds the binding vulnerability, classifies movers, designs a category class, builds a displacement mechanism, and writes a playbook. Returns a runPublicId plus a thorbit_deposition_get poll target. Metered.',\n inputSchema: ThorbitDepositionStartInputSchema,\n annotations: writeAnnotations('Start Depositioning Run'),\n })\n\n registerTool('thorbit_deposition_get', {\n title: 'Read Depositioning Run Status',\n description: 'Read a Depositioning run: status, current phase, progress, selected binding state and strategy, primary vulnerability, category class, displacement mechanism, and whether the playbook is ready. Returns a nextAction. Poll until status is complete or failed.',\n inputSchema: ThorbitDepositionGetInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Run Status'),\n })\n\n registerTool('thorbit_deposition_get_playbook', {\n title: 'Read Depositioning Playbook',\n description: 'Return the finished deposition-playbook markdown for a completed run (executive brief, the four elements, activation guide). Returns not_found until the run completes.',\n inputSchema: ThorbitDepositionGetPlaybookInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Playbook'),\n })\n\n registerTool('thorbit_deposition_artifact_read', {\n title: 'Read Depositioning Artifact',\n description: 'Read one artifact from a run\\'s folder by id (e.g. research/own.json, research/competitor-2.json, vulnerability.json, playbook.md). Artifact ids come from the artifacts manifest in thorbit_deposition_get. Byte-capped via maxBytes. Use this instead of pulling the whole run.',\n inputSchema: ThorbitDepositionArtifactReadInputSchema,\n annotations: readOnlyAnnotations('Read Depositioning Artifact'),\n })\n\n registerTool('thorbit_deposition_list', {\n title: 'List Depositioning Runs',\n description: 'List past Depositioning runs (most recent first) with runPublicId, company, category, status, binding state, and strategy. Filter by project, company-name search, or status. Use to find a prior run to read.',\n inputSchema: ThorbitDepositionListInputSchema,\n annotations: readOnlyAnnotations('List Depositioning Runs'),\n })\n\n registerTool('thorbit_deposition_search', {\n title: 'Search Depositioning Runs',\n description: 'Full-text search across past Depositioning runs — matches the query in company, category, and the playbook content, returning each match with its binding state, strategy, vulnerability statement, and a playbook snippet. Use to find prior strategy work by topic (e.g. \"pricing opacity\", \"rehab\", \"switching cost\"), not just by company name.',\n inputSchema: ThorbitDepositionSearchInputSchema,\n annotations: readOnlyAnnotations('Search Depositioning Runs'),\n })\n\n return server\n}\n","import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport type { ThorbitDepositionMcpEnvelope } from './deposition-api-client.js'\nimport type { ThorbitDepositionMcpToolName } from './deposition-mcp-tool-names.js'\n\nexport function formatThorbitDepositionMcpToolResult(\n toolName: ThorbitDepositionMcpToolName,\n envelope: ThorbitDepositionMcpEnvelope,\n): CallToolResult {\n const text = JSON.stringify({ toolName, ...envelope }, null, 2)\n return {\n content: [{ type: 'text', text }],\n isError: !envelope.ok,\n }\n}\n","import { z } from 'zod'\n\nexport const ThorbitDepositionStartInputSchema = {\n companyName: z.string().min(1).max(255).describe('The challenger company or product being depositioned.'),\n productUrl: z.string().url().max(2048).describe('URL of the challenger product homepage.'),\n categoryName: z.string().min(1).max(255).describe('The product category, e.g. \"B2B sales analytics\".'),\n competitorUrls: z.array(z.string().url()).max(5).default([]).describe('0-5 competitor URLs. Auto-discovered via SERP if fewer than 2 are provided.'),\n reviewsUrl: z.string().url().max(2048).optional().describe('Optional customer reviews URL (G2, Trustpilot, Reddit thread).'),\n knownPains: z.array(z.string().min(1)).max(50).optional().describe('Optional known customer pain points to seed the analysis.'),\n projectPublicId: z.string().min(1).optional().describe('Optional Thorbit project to associate the run with.'),\n}\n\nexport const ThorbitDepositionGetInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID returned by thorbit_deposition_start.'),\n includePhaseData: z.boolean().default(false).describe('Include raw per-phase intermediate data in addition to the lean status.'),\n}\n\nexport const ThorbitDepositionGetPlaybookInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID. Returns the markdown playbook once the run is complete.'),\n}\n\nexport const ThorbitDepositionArtifactReadInputSchema = {\n runPublicId: z.string().min(1).describe('Deposition run public ID.'),\n artifactId: z.string().min(1).describe('Artifact id from the run manifest, e.g. \"research/own.json\", \"research/competitor-2.json\", \"vulnerability.json\", \"playbook.md\". Get ids from thorbit_deposition_get.'),\n maxBytes: z.number().int().min(1000).max(1000000).default(200000).describe('Max bytes to return; content is truncated with a flag if larger.'),\n}\n\nexport const ThorbitDepositionListInputSchema = {\n projectPublicId: z.string().min(1).optional().describe('Optional project filter; omit for all org runs.'),\n search: z.string().max(200).optional().describe('Optional company-name substring filter.'),\n status: z.enum(['queued', 'running', 'complete', 'failed']).optional().describe('Optional run status filter.'),\n limit: z.number().int().min(1).max(100).default(25).describe('Maximum runs to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionSearchInputSchema = {\n query: z.string().min(1).max(300).describe('Text to search across run company, category, and playbook content.'),\n projectPublicId: z.string().min(1).optional().describe('Optional project filter.'),\n limit: z.number().int().min(1).max(50).default(15).describe('Maximum matches to return.'),\n offset: z.number().int().min(0).default(0).describe('Pagination offset.'),\n}\n\nexport const ThorbitDepositionMcpToolInputSchemas = {\n thorbit_deposition_start: ThorbitDepositionStartInputSchema,\n thorbit_deposition_get: ThorbitDepositionGetInputSchema,\n thorbit_deposition_get_playbook: ThorbitDepositionGetPlaybookInputSchema,\n thorbit_deposition_artifact_read: ThorbitDepositionArtifactReadInputSchema,\n thorbit_deposition_list: ThorbitDepositionListInputSchema,\n thorbit_deposition_search: ThorbitDepositionSearchInputSchema,\n}\n","import { readFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\n\nexport type ThorbitDepositionMcpEnv = {\n apiKey: string\n baseUrl: string\n}\n\nfunction readApiKeyFile(): string | undefined {\n const explicitPath = process.env.THORBIT_DEPOSITION_MCP_KEY_PATH?.trim()\n const paths = [explicitPath, join(homedir(), '.thorbit-deposition-mcp-key')].filter(Boolean) as string[]\n for (const path of paths) {\n try {\n const value = readFileSync(path, 'utf8').trim()\n if (value) return value\n } catch {\n continue\n }\n }\n return undefined\n}\n\nexport function resolveThorbitDepositionMcpEnv(): ThorbitDepositionMcpEnv {\n const apiKey = (\n process.env.THORBIT_API_KEY ||\n process.env.THORBIT_MCP_API_KEY ||\n process.env.THORBIT_DEPOSITION_MCP_API_KEY ||\n readApiKeyFile()\n )?.trim()\n\n if (!apiKey) {\n throw new Error('THORBIT_API_KEY, THORBIT_MCP_API_KEY, or ~/.thorbit-deposition-mcp-key is required')\n }\n\n return {\n apiKey,\n baseUrl: (process.env.THORBIT_BASE_URL || process.env.THORBIT_DEPOSITION_MCP_BASE_URL || 'https://thorbit.ai').trim(),\n }\n}\n","export const ThorbitDepositionMcpToolNames = [\n 'thorbit_deposition_start',\n 'thorbit_deposition_get',\n 'thorbit_deposition_get_playbook',\n 'thorbit_deposition_artifact_read',\n 'thorbit_deposition_list',\n 'thorbit_deposition_search',\n] as const\n\nexport type ThorbitDepositionMcpToolName = typeof ThorbitDepositionMcpToolNames[number]\n"],"mappings":";;;AAmBO,IAAM,6BAAN,MAAiC;AAAA,EACrB;AAAA,EACA;AAAA,EAEjB,YAAY,SAA8C;AACxD,SAAK,UAAU,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAChD,SAAK,SAAS,QAAQ;AAAA,EACxB;AAAA,EAEA,MAAM,SAAS,U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AAEO,SAAS,iCAA0D;AACxE,QAAM,UACJ,QAAQ,IAAI,mBACZ,QAAQ,IAAI,uBACZ,QAAQ,IAAI,kCACZ,eAAe,IACd,KAAK;AAER,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,oFAAoF;AAAA,EACtG;AAEA,SAAO;AAAA,IACL;AAAA,IACA,UAAU,QAAQ,IAAI,oBAAoB,QAAQ,IAAI,mCAAmC,sBAAsB,KAAK;AAAA,EACtH;AACF;;;ACvCO,IAAM,gCAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thorbit-deposition-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "MCP server for the Thorbit Depositioning strategy pipeline",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",