@agntn/harnesses 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ const tools = [
27
27
  {
28
28
  name: "harnesses_detect",
29
29
  title: "Harnesses Detect",
30
- description: "List every known AI coding harness with its install state and version, scanned from the binaries on PATH.",
30
+ description: "List every known AI coding harness with its install state and version.",
31
31
  inputSchema: schemas.detect,
32
32
  annotations: READ_ONLY,
33
33
  execute: () => detectHarnesses()
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.mjs","names":["Type","Value.Errors","Value.Check"],"sources":["../../src/mcp.ts"],"sourcesContent":["import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n type CallToolResult,\n type Tool,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { Type, type TSchema } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport {\n detectHarnesses,\n harnessInfo,\n listHarnessModels,\n mcpAdd,\n mcpList,\n mcpRemove,\n mcpSync,\n agentsSync,\n runHarness,\n type McpServerParams,\n type ToolResult,\n} from \"./tool-operations.ts\";\nimport { harnessToolSchemas } from \"./tool-schemas.ts\";\nimport { version } from \"./types.ts\";\n\ninterface ToolDefinition {\n name: string;\n title: string;\n description: string;\n inputSchema: TSchema;\n annotations: Tool[\"annotations\"];\n execute(\n args: Readonly<Record<string, unknown>>,\n signal: AbortSignal,\n ): ToolResult<unknown> | Promise<ToolResult<unknown>>;\n}\n\nconst READ_ONLY: Tool[\"annotations\"] = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n};\n\nconst EXEC_READ: Tool[\"annotations\"] = {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n};\n\nconst CONFIG_WRITE: Tool[\"annotations\"] = {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n openWorldHint: false,\n};\n\nconst schemas = harnessToolSchemas<TSchema, TSchema>(Type);\n\nconst tools: ToolDefinition[] = [\n {\n name: \"harnesses_detect\",\n title: \"Harnesses Detect\",\n description:\n \"List every known AI coding harness with its install state and version, scanned from the binaries on PATH.\",\n inputSchema: schemas.detect,\n annotations: READ_ONLY,\n execute: () => detectHarnesses(),\n },\n {\n name: \"harnesses_info\",\n title: \"Harnesses Info\",\n description:\n \"Full metadata for one or more AI coding harnesses, including supported invocation and model operations, configuration, sessions, instructions, skills, commands, hooks, and resolved paths.\",\n inputSchema: schemas.info,\n annotations: READ_ONLY,\n execute: (args) => harnessInfo(args.id as string | string[]),\n },\n {\n name: \"harnesses_models\",\n title: \"Harnesses Models\",\n description:\n \"List the models currently available to one AI coding harness through its native CLI, normalized across providers. An optional search filter is passed to harnesses that support it. The command may load project configuration and extensions.\",\n inputSchema: schemas.models,\n annotations: EXEC_READ,\n execute: (args, signal) =>\n listHarnessModels(args.id as string, {\n search: args.search as string | undefined,\n cwd: args.cwd as string | undefined,\n timeoutSeconds: args.timeoutSeconds as number | undefined,\n signal,\n }),\n },\n {\n name: \"harnesses_run\",\n title: \"Harnesses Run\",\n description:\n \"Run one prompt through an AI coding harness's normalized non-interactive invocation and return its output. Pass tools=true whenever the task needs harness tools, including Grok native X search. Add readOnly=true to require native read-only tool enforcement. Pass tools=false only for an advisor without tools. Unsupported modes never widen access.\",\n inputSchema: schemas.run,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n execute: (args, signal) =>\n runHarness(args.id as string, args.prompt as string, {\n cwd: args.cwd as string | undefined,\n model: args.model as string | undefined,\n timeoutSeconds: args.timeoutSeconds as number | undefined,\n signal,\n structured: args.structured as boolean | undefined,\n tools: args.tools as boolean | undefined,\n readOnly: args.readOnly as boolean | undefined,\n }),\n },\n {\n name: \"harnesses_mcp_list\",\n title: \"Harnesses MCP List\",\n description:\n \"List the MCP servers configured in each harness's config files, normalized across dialects. Omit id to scan every harness.\",\n inputSchema: schemas.mcpList,\n annotations: READ_ONLY,\n execute: (args) => mcpList(args.id as string | undefined),\n },\n {\n name: \"harnesses_mcp_add\",\n title: \"Harnesses MCP Add\",\n description:\n \"Add or replace one MCP server in a harness config. JSON configs are rewritten; TOML configs get a surgical, comment-preserving edit.\",\n inputSchema: schemas.mcpAdd,\n annotations: CONFIG_WRITE,\n execute: (args) =>\n mcpAdd(\n args.id as string,\n args as unknown as McpServerParams,\n (args.scope as \"user\" | \"project\") ?? \"user\",\n ),\n },\n {\n name: \"harnesses_mcp_sync\",\n title: \"Harnesses MCP Sync\",\n description:\n \"Reset every harness's user-scope MCP config to exactly the master list from ~/.config/agntn/mcp.jsonc: servers are added, replaced, and extras removed. Excluded harnesses keep their own servers, but master-listed names are withdrawn from them.\",\n inputSchema: schemas.mcpSync,\n annotations: CONFIG_WRITE,\n execute: (args) => mcpSync(args.id as string | undefined),\n },\n {\n name: \"harnesses_agents_sync\",\n title: \"Harnesses Agents Sync\",\n description:\n \"Link every harness's global instructions file and declared companions to the master bundle, so edits made through any harness land in one place. Diverged copies are backed up and relinked. Pass check to only report.\",\n inputSchema: schemas.agentsSync,\n annotations: CONFIG_WRITE,\n execute: (args) => agentsSync(args.id as string | undefined, args.check === true),\n },\n {\n name: \"harnesses_mcp_remove\",\n title: \"Harnesses MCP Remove\",\n description:\n \"Remove one MCP server from a harness config. JSON configs are rewritten; TOML configs get a surgical, comment-preserving edit.\",\n inputSchema: schemas.mcpRemove,\n annotations: CONFIG_WRITE,\n execute: (args) =>\n mcpRemove(\n args.id as string,\n args.name as string,\n (args.scope as \"user\" | \"project\") ?? \"user\",\n ),\n },\n];\n\n/**\n * Formats the first TypeBox validation failure for an MCP client.\n *\n * @param schema - Schema that rejected the value.\n * @param value - Rejected input value.\n * @returns {string} A client-facing validation message.\n */\nfunction validationError(schema: TSchema, value: unknown): string {\n const first = Value.Errors(schema, value)[0];\n if (!first) return \"Invalid arguments\";\n return `Invalid arguments at ${first.instancePath || \"/\"}: ${first.message}`;\n}\n\n/**\n * Wraps error text for the MCP client, replacing control bytes with spaces.\n *\n * Every error branch goes through here because parts of these messages echo\n * client-controlled values (a tool name, an argument) or downstream error\n * messages: one raw newline or escape byte would forge extra lines that read\n * as the server's own answer.\n *\n * @param text - Untrusted error text.\n * @returns {CallToolResult} A sanitized MCP error result.\n */\nfunction errorResult(text: string): CallToolResult {\n return {\n content: [{ type: \"text\", text: text.replaceAll(/\\p{Cc}/gu, \" \") }],\n isError: true,\n };\n}\n\n/**\n * Converts a shared tool result to the MCP text-result contract.\n *\n * `details` is dropped and `structuredContent` is never set: clients that see\n * structured output prefer it over `content` and would hide the readable answer.\n *\n * @param result - Shared tool result to adapt.\n * @returns {CallToolResult} The MCP text-result envelope.\n */\nfunction toCallToolResult(result: ToolResult<unknown>): CallToolResult {\n return {\n content: result.content,\n ...(result.isError === undefined ? {} : { isError: result.isError }),\n };\n}\n\n/**\n * Creates an unconnected MCP server exposing the harness registry tools.\n *\n * Built on the low-level `Server` even though the SDK marks it `@deprecated`,\n * because `McpServer.registerTool` accepts Standard Schema (Zod) only. TypeBox 1.x\n * does not implement Standard Schema, and this package's tool schemas are TypeBox,\n * shared with the Pi and OMP extensions. The high-level API would force a second\n * definition of every parameter.\n *\n * @returns {Server} An unconnected MCP server.\n */\nexport function createMcpServer(): Server {\n const toolsByName = new Map(tools.map((tool) => [tool.name, tool]));\n const server = new Server({ name: \"harnesses\", version }, { capabilities: { tools: {} } });\n\n server.setRequestHandler(ListToolsRequestSchema, () => ({\n tools: tools.map((tool): Tool => ({\n name: tool.name,\n title: tool.title,\n description: tool.description,\n inputSchema: tool.inputSchema as Tool[\"inputSchema\"],\n annotations: tool.annotations,\n })),\n }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {\n const tool = toolsByName.get(request.params.name);\n if (!tool) {\n return errorResult(`Unknown harnesses tool: ${JSON.stringify(request.params.name)}`);\n }\n\n const args = request.params.arguments ?? {};\n if (!Value.Check(tool.inputSchema, args)) {\n return errorResult(validationError(tool.inputSchema, args));\n }\n\n try {\n return toCallToolResult(await tool.execute(args, extra.signal));\n } catch (error) {\n return errorResult(\n `${tool.name} failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n });\n\n return server;\n}\n"],"mappings":";;;;;;AAqCA,MAAM,YAAiC;CACrC,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;AACjB;AAEA,MAAM,YAAiC;CACrC,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;AACjB;AAEA,MAAM,eAAoC;CACxC,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;AACjB;AAEA,MAAM,UAAU,mBAAqCA,eAAI;AAEzD,MAAM,QAA0B;CAC9B;EACE,MAAM;EACN,OAAO;EACP,aACE;EACF,aAAa,QAAQ;EACrB,aAAa;EACb,eAAe,gBAAgB;CACjC;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EACF,aAAa,QAAQ;EACrB,aAAa;EACb,UAAU,SAAS,YAAY,KAAK,EAAuB;CAC7D;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EACF,aAAa,QAAQ;EACrB,aAAa;EACb,UAAU,MAAM,WACd,kBAAkB,KAAK,IAAc;GACnC,QAAQ,KAAK;GACb,KAAK,KAAK;GACV,gBAAgB,KAAK;GACrB;EACF,CAAC;CACL;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EACF,aAAa,QAAQ;EACrB,aAAa;GACX,cAAc;GACd,iBAAiB;GACjB,gBAAgB;GAChB,eAAe;EACjB;EACA,UAAU,MAAM,WACd,WAAW,KAAK,IAAc,KAAK,QAAkB;GACnD,KAAK,KAAK;GACV,OAAO,KAAK;GACZ,gBAAgB,KAAK;GACrB;GACA,YAAY,KAAK;GACjB,OAAO,KAAK;GACZ,UAAU,KAAK;EACjB,CAAC;CACL;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EACF,aAAa,QAAQ;E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AA,GAAA;EACF"}
1
+ {"version":3,"file":"mcp.mjs","names":["Type","Value.Errors","Value.Check"],"sources":["../../src/mcp.ts"],"sourcesContent":["import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n type CallToolResult,\n type Tool,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { Type, type TSchema } from \"typebox\";\nimport { Value } from \"typebox/value\";\nimport {\n detectHarnesses,\n harnessInfo,\n listHarnessModels,\n mcpAdd,\n mcpList,\n mcpRemove,\n mcpSync,\n agentsSync,\n runHarness,\n type McpServerParams,\n type ToolResult,\n} from \"./tool-operations.ts\";\nimport { harnessToolSchemas } from \"./tool-schemas.ts\";\nimport { version } from \"./types.ts\";\n\ninterface ToolDefinition {\n name: string;\n title: string;\n description: string;\n inputSchema: TSchema;\n annotations: Tool[\"annotations\"];\n execute(\n args: Readonly<Record<string, unknown>>,\n signal: AbortSignal,\n ): ToolResult<unknown> | Promise<ToolResult<unknown>>;\n}\n\nconst READ_ONLY: Tool[\"annotations\"] = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n};\n\nconst EXEC_READ: Tool[\"annotations\"] = {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n};\n\nconst CONFIG_WRITE: Tool[\"annotations\"] = {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n openWorldHint: false,\n};\n\nconst schemas = harnessToolSchemas<TSchema, TSchema>(Type);\n\nconst tools: ToolDefinition[] = [\n {\n name: \"harnesses_detect\",\n title: \"Harnesses Detect\",\n description: \"List every known AI coding harness with its install state and version.\",\n inputSchema: schemas.detect,\n annotations: READ_ONLY,\n execute: () => detectHarnesses(),\n },\n {\n name: \"harnesses_info\",\n title: \"Harnesses Info\",\n description:\n \"Full metadata for one or more AI coding harnesses, including supported invocation and model operations, configuration, sessions, instructions, skills, commands, hooks, and resolved paths.\",\n inputSchema: schemas.info,\n annotations: READ_ONLY,\n execute: (args) => harnessInfo(args.id as string | string[]),\n },\n {\n name: \"harnesses_models\",\n title: \"Harnesses Models\",\n description:\n \"List the models currently available to one AI coding harness through its native CLI, normalized across providers. An optional search filter is passed to harnesses that support it. The command may load project configuration and extensions.\",\n inputSchema: schemas.models,\n annotations: EXEC_READ,\n execute: (args, signal) =>\n listHarnessModels(args.id as string, {\n search: args.search as string | undefined,\n cwd: args.cwd as string | undefined,\n timeoutSeconds: args.timeoutSeconds as number | undefined,\n signal,\n }),\n },\n {\n name: \"harnesses_run\",\n title: \"Harnesses Run\",\n description:\n \"Run one prompt through an AI coding harness's normalized non-interactive invocation and return its output. Pass tools=true whenever the task needs harness tools, including Grok native X search. Add readOnly=true to require native read-only tool enforcement. Pass tools=false only for an advisor without tools. Unsupported modes never widen access.\",\n inputSchema: schemas.run,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n execute: (args, signal) =>\n runHarness(args.id as string, args.prompt as string, {\n cwd: args.cwd as string | undefined,\n model: args.model as string | undefined,\n timeoutSeconds: args.timeoutSeconds as number | undefined,\n signal,\n structured: args.structured as boolean | undefined,\n tools: args.tools as boolean | undefined,\n readOnly: args.readOnly as boolean | undefined,\n }),\n },\n {\n name: \"harnesses_mcp_list\",\n title: \"Harnesses MCP List\",\n description:\n \"List the MCP servers configured in each harness's config files, normalized across dialects. Omit id to scan every harness.\",\n inputSchema: schemas.mcpList,\n annotations: READ_ONLY,\n execute: (args) => mcpList(args.id as string | undefined),\n },\n {\n name: \"harnesses_mcp_add\",\n title: \"Harnesses MCP Add\",\n description:\n \"Add or replace one MCP server in a harness config. JSON configs are rewritten; TOML configs get a surgical, comment-preserving edit.\",\n inputSchema: schemas.mcpAdd,\n annotations: CONFIG_WRITE,\n execute: (args) =>\n mcpAdd(\n args.id as string,\n args as unknown as McpServerParams,\n (args.scope as \"user\" | \"project\") ?? \"user\",\n ),\n },\n {\n name: \"harnesses_mcp_sync\",\n title: \"Harnesses MCP Sync\",\n description:\n \"Reset every harness's user-scope MCP config to exactly the master list from ~/.config/agntn/mcp.jsonc: servers are added, replaced, and extras removed. Excluded harnesses keep their own servers, but master-listed names are withdrawn from them.\",\n inputSchema: schemas.mcpSync,\n annotations: CONFIG_WRITE,\n execute: (args) => mcpSync(args.id as string | undefined),\n },\n {\n name: \"harnesses_agents_sync\",\n title: \"Harnesses Agents Sync\",\n description:\n \"Link every harness's global instructions file and declared companions to the master bundle, so edits made through any harness land in one place. Diverged copies are backed up and relinked. Pass check to only report.\",\n inputSchema: schemas.agentsSync,\n annotations: CONFIG_WRITE,\n execute: (args) => agentsSync(args.id as string | undefined, args.check === true),\n },\n {\n name: \"harnesses_mcp_remove\",\n title: \"Harnesses MCP Remove\",\n description:\n \"Remove one MCP server from a harness config. JSON configs are rewritten; TOML configs get a surgical, comment-preserving edit.\",\n inputSchema: schemas.mcpRemove,\n annotations: CONFIG_WRITE,\n execute: (args) =>\n mcpRemove(\n args.id as string,\n args.name as string,\n (args.scope as \"user\" | \"project\") ?? \"user\",\n ),\n },\n];\n\n/**\n * Formats the first TypeBox validation failure for an MCP client.\n *\n * @param schema - Schema that rejected the value.\n * @param value - Rejected input value.\n * @returns {string} A client-facing validation message.\n */\nfunction validationError(schema: TSchema, value: unknown): string {\n const first = Value.Errors(schema, value)[0];\n if (!first) return \"Invalid arguments\";\n return `Invalid arguments at ${first.instancePath || \"/\"}: ${first.message}`;\n}\n\n/**\n * Wraps error text for the MCP client, replacing control bytes with spaces.\n *\n * Every error branch goes through here because parts of these messages echo\n * client-controlled values (a tool name, an argument) or downstream error\n * messages: one raw newline or escape byte would forge extra lines that read\n * as the server's own answer.\n *\n * @param text - Untrusted error text.\n * @returns {CallToolResult} A sanitized MCP error result.\n */\nfunction errorResult(text: string): CallToolResult {\n return {\n content: [{ type: \"text\", text: text.replaceAll(/\\p{Cc}/gu, \" \") }],\n isError: true,\n };\n}\n\n/**\n * Converts a shared tool result to the MCP text-result contract.\n *\n * `details` is dropped and `structuredContent` is never set: clients that see\n * structured output prefer it over `content` and would hide the readable answer.\n *\n * @param result - Shared tool result to adapt.\n * @returns {CallToolResult} The MCP text-result envelope.\n */\nfunction toCallToolResult(result: ToolResult<unknown>): CallToolResult {\n return {\n content: result.content,\n ...(result.isError === undefined ? {} : { isError: result.isError }),\n };\n}\n\n/**\n * Creates an unconnected MCP server exposing the harness registry tools.\n *\n * Built on the low-level `Server` even though the SDK marks it `@deprecated`,\n * because `McpServer.registerTool` accepts Standard Schema (Zod) only. TypeBox 1.x\n * does not implement Standard Schema, and this package's tool schemas are TypeBox,\n * shared with the Pi and OMP extensions. The high-level API would force a second\n * definition of every parameter.\n *\n * @returns {Server} An unconnected MCP server.\n */\nexport function createMcpServer(): Server {\n const toolsByName = new Map(tools.map((tool) => [tool.name, tool]));\n const server = new Server({ name: \"harnesses\", version }, { capabilities: { tools: {} } });\n\n server.setRequestHandler(ListToolsRequestSchema, () => ({\n tools: tools.map((tool): Tool => ({\n name: tool.name,\n title: tool.title,\n description: tool.description,\n inputSchema: tool.inputSchema as Tool[\"inputSchema\"],\n annotations: tool.annotations,\n })),\n }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {\n const tool = toolsByName.get(request.params.name);\n if (!tool) {\n return errorResult(`Unknown harnesses tool: ${JSON.stringify(request.params.name)}`);\n }\n\n const args = request.params.arguments ?? {};\n if (!Value.Check(tool.inputSchema, args)) {\n return errorResult(validationError(tool.inputSchema, args));\n }\n\n try {\n return toCallToolResult(await tool.execute(args, extra.signal));\n } catch (error) {\n return errorResult(\n `${tool.name} failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n });\n\n return server;\n}\n"],"mappings":";;;;;;AAqCA,MAAM,YAAiC;CACrC,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;AACjB;AAEA,MAAM,YAAiC;CACrC,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,eAAe;A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Q;EACrB,aAAa;EACb,UAAU,SAAS,WAAW,KAAK,IAA0B,KAAK,UAAU,IAAI;CAClF;CACA;EACE,MAAM;EACN,OAAO;EACP,aACE;EACF,aAAa,QAAQ;EACrB,aAAa;EACb,UAAU,SACR,UACE,KAAK,IACL,KAAK,MACJ,KAAK,SAAgC,MACxC;CACJ;AACF;;;;;;AASA,SAAS,YAAA,MAAgB;CACvB,OAAM;EACN,SAAK,CAAA;GACL,MAAO;GACT,MAAA,KAAA,WAAA,YAAA,GAAA;;;;;;;;;;;AAcE,SAAO,kBAAA;CACL,MAAA,cAAU,IAAA,IAAA,MAAA,KAAA,SAAA,CAAA,KAAA,MAAA,IAAA,CAAA,CAAA;CAAE,MAAA,SAAM,IAAA,OAAA;EAAQ,MAAA;EAAuC;CACjE,GAAA,EAAA,cAAS,EAAA,OAAA,CAAA,EAAA,EAAA,CAAA;CACX,OAAA,kBAAA,+BAAA,EAAA,OAAA,MAAA,KAAA,UAAA;EACF,MAAA,KAAA;;;;;;;;;;EAWA,IAAA,CAAA,MAAS,KAAA,aAAiB,IAA6C,GAAA,OAAA,YAAA,gBAAA,KAAA,aAAA,IAAA,CAAA;EACrE,IAAA;GACE,OAAA,iBAAgB,MAAA,KAAA,QAAA,MAAA,MAAA,MAAA,CAAA;EAChB,SAAI,OAAO;GACb,OAAA,YAAA,GAAA,KAAA,KAAA,WAAA,iBAAA,QAAA,MAAA,UAAA,OAAA,KAAA,GAAA;EACF"}
@@ -10,7 +10,7 @@
10
10
  * returns; OMP's facade accepts its own `AnySchema` while producing schemas
11
11
  * that satisfy the host's stricter `TSchema`.
12
12
  */
13
- interface McpSchemaBuilder<I, S> {
13
+ export interface McpSchemaBuilder<I, S> {
14
14
  Object(properties: Readonly<Record<string, I>>, options?: object): S;
15
15
  String(options?: object): I;
16
16
  Integer(options?: object): I;
@@ -21,15 +21,15 @@ interface McpSchemaBuilder<I, S> {
21
21
  Literal(value: string, options?: object): I;
22
22
  Optional(schema: I): I;
23
23
  }
24
- declare const HARNESS_INFO_MAX_ITEMS = 20;
25
- declare const RUN_TIMEOUT_DEFAULT_SECONDS = 600;
24
+ export declare const HARNESS_INFO_MAX_ITEMS = 20;
25
+ export declare const RUN_TIMEOUT_DEFAULT_SECONDS = 600;
26
26
  /**
27
27
  * Builds the parameter schemas for all harness tools with the host's TypeBox.
28
28
  *
29
29
  * @param Type - Host-provided TypeBox-compatible schema builder.
30
30
  * @returns {Record<string, S>} Schemas keyed by harness tool operation.
31
31
  */
32
- declare function harnessToolSchemas<I, S>(Type: McpSchemaBuilder<I, S>): {
32
+ export declare function harnessToolSchemas<I, S>(Type: McpSchemaBuilder<I, S>): {
33
33
  detect: S;
34
34
  info: S;
35
35
  models: S;
@@ -45,16 +45,16 @@ declare function harnessToolSchemas<I, S>(Type: McpSchemaBuilder<I, S>): {
45
45
  * builders' literal types, so hosts annotate their execute callbacks with
46
46
  * these instead of TypeBox Static inference.
47
47
  */
48
- interface InfoParams {
48
+ export interface InfoParams {
49
49
  id: string | string[];
50
50
  }
51
- interface ModelsParams {
51
+ export interface ModelsParams {
52
52
  id: string;
53
53
  search?: string;
54
54
  cwd?: string;
55
55
  timeoutSeconds?: number;
56
56
  }
57
- interface RunParams {
57
+ export interface RunParams {
58
58
  id: string;
59
59
  prompt: string;
60
60
  cwd?: string;
@@ -64,17 +64,17 @@ interface RunParams {
64
64
  tools: boolean;
65
65
  readOnly?: boolean;
66
66
  }
67
- interface McpListParams {
67
+ export interface McpListParams {
68
68
  id?: string;
69
69
  }
70
- interface McpSyncParams {
70
+ export interface McpSyncParams {
71
71
  id?: string;
72
72
  }
73
- interface AgentsSyncParams {
73
+ export interface AgentsSyncParams {
74
74
  id?: string;
75
75
  check?: boolean;
76
76
  }
77
- interface McpAddParams {
77
+ export interface McpAddParams {
78
78
  id: string;
79
79
  name: string;
80
80
  command?: string;
@@ -85,10 +85,9 @@ interface McpAddParams {
85
85
  headers?: Record<string, string>;
86
86
  scope?: "user" | "project";
87
87
  }
88
- interface McpRemoveParams {
88
+ export interface McpRemoveParams {
89
89
  id: string;
90
90
  name: string;
91
91
  scope?: "user" | "project";
92
92
  }
93
- export { AgentsSyncParams, HARNESS_INFO_MAX_ITEMS, InfoParams, McpAddParams, McpListParams, McpRemoveParams, McpSchemaBuilder, McpSyncParams, ModelsParams, RUN_TIMEOUT_DEFAULT_SECONDS, RunParams, harnessToolSchemas };
94
93
  //# sourceMappingURL=tool-schemas.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-schemas.d.mts","names":[],"sources":["../../src/tool-schemas.ts"],"mappings":"AAaA;;;;;;;;;;;;UAAiB,iBAAiB,GAAG;EACnC,OAAO,YAAY,SAAS,eAAe,KAAK,mBAAmB;EACnE,OAAO,mBAAmB;EAC1B,QAAQ,mBAAmB;EAC3B,QAAQ,mBAAmB;EAC3B,MAAM,MAAM,GAAG,mBAAmB;EAClC,OAAO,KAAK,GAAG,OAAO,GAAG,mBAAmB;EAC5C,MAAM,kBAAkB,KAAK,mBAAmB;EAChD,QAAQ,eAAe,mBAAmB;EAC1C,SAAS,QAAQ,IAAI;;cAGV;cACA;;;;;;;iBAQG,mBAAmB,GAAG,GAAG,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;UA2JlD;EACf;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;;UAGe;EACf;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,MAAM;EACN;EACA;EACA,UAAU;EACV;;UAGe;EACf;EACA;EACA"}
1
+ {"version":3,"file":"tool-schemas.d.mts","names":[],"sources":["../../src/tool-schemas.ts"],"mappings":"AAaA;;;;;;;;;;;;iBAAiB,iBAAiB,GAAG;EACnC,OAAO,YAAY,SAAS,eAAe,KAAK,mBAAmB;EACnE,OAAO,mBAAmB;EAC1B,QAAQ,mBAAmB;EAC3B,QAAQ,mBAAmB;EAC3B,MAAM,MAAM,GAAG,mBAAmB;EAClC,OAAO,KAAK,GAAG,OAAO,GAAG,mBAAmB;EAC5C,MAAM,kBAAkB,KAAK,mBAAmB;EAChD,QAAQ,eAAe,mBAAmB;EAC1C,SAAS,QAAQ,IAAI;;qBAGV;qBACA;;;;;;;wBAQG,mBAAmB,GAAG,GAAG,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;iBA2JlD;EACf;;iBAGe;EACf;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;;iBAGe;EACf;;iBAGe;EACf;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA,MAAM;EACN;EACA;EACA,UAAU;EACV;;iBAGe;EACf;EACA;EACA"}
@@ -1,4 +1,4 @@
1
- const version = "0.1.1";
1
+ const version = "0.2.0";
2
2
  export { version };
3
3
 
4
4
  //# sourceMappingURL=types.mjs.map
package/dist/index.d.mts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { AgentsCompanionTargetResult, AgentsConfig, AgentsSyncAction, AgentsSyncReport, AgentsTargetResult, AvailableModel, EvidenceLevel, Harness, HarnessCapabilities, HarnessConstructor, HarnessDetection, HarnessId, HarnessInvocation, HarnessInvocationModes, HarnessModelListing, InvokeOptions, InvokeResult, ListModelsOptions, ListModelsResult, McpConfigFile, McpConfigListing, McpEnvError, McpServerConfig, PathCandidate, Platform, ResolveOptions, ResolvedPaths, StorageDescriptor, SyncReport, SyncTargetResult, addMcpServer, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, removeMcpServer, syncAgentsFiles, syncMcpServers, version } from "./_chunks/agents-sync.mjs";
2
- declare function registerHarness(HarnessClass: HarnessConstructor): Harness;
3
- declare function getHarness(id: HarnessId): Harness;
4
- declare function listHarnesses(): HarnessId[];
5
- declare function isHarnessId(id: string): id is HarnessId;
6
- declare function getAllHarnesses(): Harness[];
2
+ export declare function registerHarness(HarnessClass: HarnessConstructor): Harness;
3
+ export declare function getHarness(id: HarnessId): Harness;
4
+ export declare function listHarnesses(): HarnessId[];
5
+ export declare function isHarnessId(id: string): id is HarnessId;
6
+ export declare function getAllHarnesses(): Harness[];
7
7
  /**
8
8
  * Detect the active agent from environment variables.
9
9
  * Returns the first match since env detection is unambiguous.
10
10
  *
11
11
  * @returns {Harness | null} The detected harness, or null when none matches.
12
12
  */
13
- declare function detectHarnessFromEnv(): Harness | null;
13
+ export declare function detectHarnessFromEnv(): Harness | null;
14
14
  /**
15
15
  * Detect which agents have project-level markers in the given directory.
16
16
  * Returns all matches (multiple agents can be configured in the same project).
@@ -18,7 +18,7 @@ declare function detectHarnessFromEnv(): Harness | null;
18
18
  * @param cwd - Directory to inspect; defaults to the current working directory.
19
19
  * @returns {Harness[]} Every harness whose project markers match.
20
20
  */
21
- declare function detectProjectHarnesses(cwd?: string): Harness[];
21
+ export declare function detectProjectHarnesses(cwd?: string): Harness[];
22
22
  /**
23
23
  * Detect the most likely active agent. Priority:
24
24
  * 1. Env vars (running inside agent = unambiguous)
@@ -28,8 +28,8 @@ declare function detectProjectHarnesses(cwd?: string): Harness[];
28
28
  * @param cwd - Directory to inspect for project markers.
29
29
  * @returns {Harness | null} The unambiguous active harness, or null.
30
30
  */
31
- declare function detectHarness(cwd?: string): Harness | null;
32
- declare function resolvePathTemplate(template: string, options?: ResolveOptions): string;
31
+ export declare function detectHarness(cwd?: string): Harness | null;
32
+ export declare function resolvePathTemplate(template: string, options?: ResolveOptions): string;
33
33
  interface ClaudeTextBlock {
34
34
  type: "text";
35
35
  text: string;
@@ -295,6 +295,6 @@ interface OpenCodeProject {
295
295
  vcs: string | null;
296
296
  name: string | null;
297
297
  }
298
- declare const harnessIds: readonly HarnessId[];
299
- export { type AgentsCompanionTargetResult, type AgentsConfig, type AgentsSyncAction, type AgentsSyncReport, type AgentsTargetResult, type AvailableModel, type ClaudeAssistantEntry, type ClaudeBaseEntry, type ClaudeContentBlock, type ClaudeHistoryEntry, type ClaudeSessionEntry, type ClaudeSummaryEntry, type ClaudeTextBlock, type ClaudeThinkingBlock, type ClaudeToolResultBlock, type ClaudeToolUseBlock, type ClaudeUsage, type ClaudeUserEntry, type CodexHistoryEntry, type CodexLogEntry, type CodexThread, type EvidenceLevel, type GeminiConversationRecord, type GeminiMessageRecord, type GeminiThought, type GeminiTokensSummary, type GeminiToolCallRecord, Harness, type HarnessCapabilities, type HarnessConstructor, type HarnessDetection, type HarnessId, type HarnessInvocation, type HarnessInvocationModes, type HarnessModelListing, type InvokeOptions, type InvokeResult, type ListModelsOptions, type ListModelsResult, type McpConfigFile, type McpConfigListing, McpEnvError, type McpServerConfig, type OpenCodeAgentPart, type OpenCodeCompactionPart, type OpenCodeFilePart, type OpenCodeMessage, type OpenCodePart, type OpenCodePatchPart, type OpenCodeProject, type OpenCodeReasoningPart, type OpenCodeRetryPart, type OpenCodeSession, type OpenCodeSnapshotPart, type OpenCodeStepFinishPart, type OpenCodeStepStartPart, type OpenCodeSubtaskPart, type OpenCodeTextPart, type OpenCodeTodo, type OpenCodeToolPart, type PathCandidate, type Platform, type ResolveOptions, type ResolvedPaths, type StorageDescriptor, type SyncReport, type SyncTargetResult, addMcpServer, detectHarness, detectHarnessFromEnv, detectProjectHarnesses, getAllHarnesses, getHarness, harnessIds, isHarnessId, listHarnesses, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, registerHarness, removeMcpServer, resolvePathTemplate, syncAgentsFiles, syncMcpServers, version };
298
+ export declare const harnessIds: readonly HarnessId[];
299
+ export { type AgentsCompanionTargetResult, type AgentsConfig, type AgentsSyncAction, type AgentsSyncReport, type AgentsTargetResult, type AvailableModel, type ClaudeAssistantEntry, type ClaudeBaseEntry, type ClaudeContentBlock, type ClaudeHistoryEntry, type ClaudeSessionEntry, type ClaudeSummaryEntry, type ClaudeTextBlock, type ClaudeThinkingBlock, type ClaudeToolResultBlock, type ClaudeToolUseBlock, type ClaudeUsage, type ClaudeUserEntry, type CodexHistoryEntry, type CodexLogEntry, type CodexThread, type EvidenceLevel, type GeminiConversationRecord, type GeminiMessageRecord, type GeminiThought, type GeminiTokensSummary, type GeminiToolCallRecord, Harness, type HarnessCapabilities, type HarnessConstructor, type HarnessDetection, type HarnessId, type HarnessInvocation, type HarnessInvocationModes, type HarnessModelListing, type InvokeOptions, type InvokeResult, type ListModelsOptions, type ListModelsResult, type McpConfigFile, type McpConfigListing, McpEnvError, type McpServerConfig, type OpenCodeAgentPart, type OpenCodeCompactionPart, type OpenCodeFilePart, type OpenCodeMessage, type OpenCodePart, type OpenCodePatchPart, type OpenCodeProject, type OpenCodeReasoningPart, type OpenCodeRetryPart, type OpenCodeSession, type OpenCodeSnapshotPart, type OpenCodeStepFinishPart, type OpenCodeStepStartPart, type OpenCodeSubtaskPart, type OpenCodeTextPart, type OpenCodeTodo, type OpenCodeToolPart, type PathCandidate, type Platform, type ResolveOptions, type ResolvedPaths, type StorageDescriptor, type SyncReport, type SyncTargetResult, addMcpServer, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, removeMcpServer, syncAgentsFiles, syncMcpServers, version };
300
300
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/registry.ts","../src/resolve.ts","../src/schemas/claude.ts","../src/schemas/gemini.ts","../src/schemas/codex.ts","../src/schemas/opencode.ts","../src/index.ts"],"mappings":";iBAiBgB,gBAAgB,cAAc,qBAAqB;iBAMnD,WAAW,IAAI,YAAY;iBAM3B,iBAAiB;iBAIjB,YAAY,aAAa,MAAM;iBAI/B,mBAAmB;;;;;;;iBAUnB,wBAAwB;;;;;;;;iBAcxB,uBAAuB,eAAe;;;;;;;;;;iBAatC,cAAc,eAAe;iBChE7B,oBAAoB,kBAAkB,UAAS;UCV9C;EACf;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;KAGU,qBACR,kBACA,sBACA,qBACA;UAEa;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;IACE;IACA,kBAAkB;;EAEpB;EACA;IACE;IACA;IACA;IACA;;;UAIa,6BAA6B;EAC5C;EACA;EACA;IACE;IACA;IACA;IACA;IACA,SAAS;IACT;IACA;IACA,OAAO;;;UAIM;EACf;EACA;EACA;;KAGU,qBAAqB,kBAAkB,uBAAuB;UAEzD;EACf;EACA;EACA;EACA;EACA,gBAAgB;IAGZ;IACA;IACA;;;UClGW;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX,YAAY;;UAGG;EACf;EACA;EACA;EACA;EACA,UAAU;EACV;EACA;EACA;;UC9Ce;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UC7Be;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;KAGU,eACR,mBACA,wBACA,mBACA,mBACA,sBACA,wBACA,yBACA,uBACA,oBACA,oBACA,oBACA;UAEa;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;cCnCW,qBAAqB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/registry.ts","../src/resolve.ts","../src/schemas/claude.ts","../src/schemas/gemini.ts","../src/schemas/codex.ts","../src/schemas/opencode.ts","../src/index.ts"],"mappings":";wBAiBgB,gBAAgB,cAAc,qBAAqB;wBAMnD,WAAW,IAAI,YAAY;wBAM3B,iBAAiB;wBAIjB,YAAY,aAAa,MAAM;wBAI/B,mBAAmB;;;;;;;wBAUnB,wBAAwB;;;;;;;;wBAcxB,uBAAuB,eAAe;;;;;;;;;;wBAatC,cAAc,eAAe;wBChE7B,oBAAoB,kBAAkB,UAAS;UCV9C;EACf;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;KAGU,qBACR,kBACA,sBACA,qBACA;UAEa;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe,wBAAwB;EACvC;EACA;IACE;IACA,kBAAkB;;EAEpB;EACA;IACE;IACA;IACA;IACA;;;UAIa,6BAA6B;EAC5C;EACA;EACA;IACE;IACA;IACA;IACA;IACA,SAAS;IACT;IACA;IACA,OAAO;;;UAIM;EACf;EACA;EACA;;KAGU,qBAAqB,kBAAkB,uBAAuB;UAEzD;EACf;EACA;EACA;EACA;EACA,gBAAgB;IAGZ;IACA;IACA;;;UClGW;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,WAAW;EACX,YAAY;;UAGG;EACf;EACA;EACA;EACA;EACA,UAAU;EACV;EACA;EACA;;UC9Ce;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UC7Be;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;;KAGU,eACR,mBACA,wBACA,mBACA,mBACA,sBACA,wBACA,yBACA,uBACA,oBACA,oBACA,oBACA;UAEa;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;qBCnCW,qBAAqB"}
package/dist/mcp.d.mts CHANGED
@@ -10,6 +10,5 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
10
10
  *
11
11
  * @returns {Server} An unconnected MCP server.
12
12
  */
13
- declare function createMcpServer(): Server;
14
- export { createMcpServer };
13
+ export declare function createMcpServer(): Server;
15
14
  //# sourceMappingURL=mcp.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.mts","names":[],"sources":["../src/mcp.ts"],"mappings":";;;;;;;;;;;;iBAwOgB,mBAAmB"}
1
+ {"version":3,"file":"mcp.d.mts","names":[],"sources":["../src/mcp.ts"],"mappings":";;;;;;;;;;;;wBAuOgB,mBAAmB"}
@@ -1,7 +1,7 @@
1
1
  import { AgentsSyncReport, AvailableModel, HarnessCapabilities, HarnessDetection, HarnessId, HarnessInvocationModes, McpConfigListing, McpServerConfig, PathCandidate, ResolvedPaths, StorageDescriptor, SyncReport } from "./_chunks/agents-sync.mjs";
2
2
  import { HARNESS_INFO_MAX_ITEMS } from "./_chunks/tool-schemas.mjs";
3
3
  /** Text for the model plus details for the harness, shared by every tool surface. */
4
- interface ToolResult<Details> {
4
+ export interface ToolResult<Details> {
5
5
  content: Array<{
6
6
  type: "text";
7
7
  text: string;
@@ -11,18 +11,18 @@ interface ToolResult<Details> {
11
11
  isError?: boolean;
12
12
  }
13
13
  /** Install state of one harness on this machine. */
14
- interface HarnessStatus {
14
+ export interface HarnessStatus {
15
15
  id: HarnessId;
16
16
  name: string;
17
17
  installed: boolean;
18
18
  version: string | null;
19
19
  }
20
20
  /** Every registered harness with its install state, as scanned by {@link detectHarnesses}. */
21
- interface HarnessListing {
21
+ export interface HarnessListing {
22
22
  harnesses: HarnessStatus[];
23
23
  }
24
24
  /** Full metadata for one harness, including paths resolved for this platform. */
25
- interface HarnessMetadata {
25
+ export interface HarnessMetadata {
26
26
  id: HarnessId;
27
27
  name: string;
28
28
  binaries: string[];
@@ -41,35 +41,35 @@ interface HarnessMetadata {
41
41
  resolved: ResolvedPaths;
42
42
  }
43
43
  /** Returned when the requested harness id is not registered. */
44
- interface UnknownHarness {
44
+ export interface UnknownHarness {
45
45
  error: string;
46
46
  known: HarnessId[];
47
47
  }
48
48
  /** Returned when a direct batch call bypasses the tool schema limits. */
49
- interface HarnessInfoInputError {
49
+ export interface HarnessInfoInputError {
50
50
  error: string;
51
51
  }
52
52
  /** One harness lookup result. */
53
- type HarnessInfoResult = HarnessMetadata | UnknownHarness;
53
+ export type HarnessInfoResult = HarnessMetadata | UnknownHarness;
54
54
  /** Scalar, batch, or rejected batch details from {@link harnessInfo}. */
55
- type HarnessInfoDetails = HarnessInfoResult | HarnessInfoResult[] | HarnessInfoInputError;
55
+ export type HarnessInfoDetails = HarnessInfoResult | HarnessInfoResult[] | HarnessInfoInputError;
56
56
  /** Default wall-clock budget for one harness run, in seconds. */
57
- declare const RUN_DEFAULT_TIMEOUT_SECONDS = 600;
57
+ export declare const RUN_DEFAULT_TIMEOUT_SECONDS = 600;
58
58
  /** The run tool's per-stream cap: harness output is unbounded, model context is not. */
59
- declare const RUN_MAX_OUTPUT_CHARS = 8000;
59
+ export declare const RUN_MAX_OUTPUT_CHARS = 8000;
60
60
  /**
61
61
  * Scans every registered harness for its binaries and version.
62
62
  *
63
63
  * @returns {ToolResult<HarnessListing>} The complete installation listing.
64
64
  */
65
- declare function detectHarnesses(): ToolResult<HarnessListing>;
65
+ export declare function detectHarnesses(): ToolResult<HarnessListing>;
66
66
  /** Full metadata for one harness, with paths resolved for the current platform. */
67
- declare function harnessInfo(id: string): ToolResult<HarnessInfoResult>;
67
+ export declare function harnessInfo(id: string): ToolResult<HarnessInfoResult>;
68
68
  /** Full metadata for several harnesses, preserving input order and errors for each item. */
69
- declare function harnessInfo(ids: readonly string[]): ToolResult<HarnessInfoResult[] | HarnessInfoInputError>;
70
- declare function harnessInfo(input: string | readonly string[]): ToolResult<HarnessInfoDetails>;
69
+ export declare function harnessInfo(ids: readonly string[]): ToolResult<HarnessInfoResult[] | HarnessInfoInputError>;
70
+ export declare function harnessInfo(input: string | readonly string[]): ToolResult<HarnessInfoDetails>;
71
71
  /** Options accepted by {@link listHarnessModels}. */
72
- interface ModelsOptions {
72
+ export interface ModelsOptions {
73
73
  search?: string;
74
74
  cwd?: string;
75
75
  /** Wall-clock budget in seconds; defaults to {@link RUN_DEFAULT_TIMEOUT_SECONDS}. */
@@ -78,7 +78,7 @@ interface ModelsOptions {
78
78
  signal?: AbortSignal;
79
79
  }
80
80
  /** One completed native model-listing query. */
81
- interface ModelsOutcome {
81
+ export interface ModelsOutcome {
82
82
  id: HarnessId;
83
83
  command: string;
84
84
  args: string[];
@@ -96,9 +96,9 @@ interface ModelsOutcome {
96
96
  * @param options - Search, working-directory, and timeout options.
97
97
  * @returns {Promise<ToolResult<ModelsOutcome | RunFailure>>} The model listing or failure.
98
98
  */
99
- declare function listHarnessModels(id: string, options?: ModelsOptions): Promise<ToolResult<ModelsOutcome | RunFailure>>;
99
+ export declare function listHarnessModels(id: string, options?: ModelsOptions): Promise<ToolResult<ModelsOutcome | RunFailure>>;
100
100
  /** Options accepted by {@link runHarness}. */
101
- interface RunOptions {
101
+ export interface RunOptions {
102
102
  cwd?: string;
103
103
  /** Harness-native model id or selector. */
104
104
  model?: string;
@@ -114,7 +114,7 @@ interface RunOptions {
114
114
  readOnly?: boolean;
115
115
  }
116
116
  /** One completed (or failed) harness run, with output capped for the model. */
117
- interface RunOutcome {
117
+ export interface RunOutcome {
118
118
  id: HarnessId;
119
119
  command: string;
120
120
  /** Expanded arguments; the model's text keeps "{prompt}" instead, it wrote the prompt itself. */
@@ -130,7 +130,7 @@ interface RunOutcome {
130
130
  stderr: string;
131
131
  }
132
132
  /** Returned when the harness cannot be run at all. */
133
- interface RunFailure {
133
+ export interface RunFailure {
134
134
  error: string;
135
135
  known?: HarnessId[];
136
136
  /** Modes accepted by the selected harness when invocation mode caused the failure. */
@@ -157,22 +157,22 @@ interface RunFailure {
157
157
  * @param options - Model, mode, working-directory, and timeout options.
158
158
  * @returns {Promise<ToolResult<RunOutcome | RunFailure>>} The capped run outcome or failure.
159
159
  */
160
- declare function runHarness(id: string, prompt: string, options?: RunOptions): Promise<ToolResult<RunOutcome | RunFailure>>;
160
+ export declare function runHarness(id: string, prompt: string, options?: RunOptions): Promise<ToolResult<RunOutcome | RunFailure>>;
161
161
  /** MCP server listings for one harness or all of them. */
162
- interface McpListing {
162
+ export interface McpListing {
163
163
  harnesses: Array<{
164
164
  id: HarnessId;
165
165
  configs: McpConfigListing[];
166
166
  }>;
167
167
  }
168
168
  /** Result of one MCP config mutation. */
169
- interface McpMutation {
169
+ export interface McpMutation {
170
170
  id: HarnessId;
171
171
  path: string;
172
172
  action: "added" | "replaced" | "removed" | "noop";
173
173
  }
174
174
  /** Flat tool parameters describing one MCP server, shared by every surface. */
175
- interface McpServerParams {
175
+ export interface McpServerParams {
176
176
  name: string;
177
177
  transport?: McpServerConfig["transport"];
178
178
  command?: string;
@@ -187,14 +187,14 @@ interface McpServerParams {
187
187
  * @param params - Flat MCP server parameters.
188
188
  * @returns {McpServerConfig} The normalized server configuration.
189
189
  */
190
- declare function toMcpServerConfig(params: McpServerParams): McpServerConfig;
190
+ export declare function toMcpServerConfig(params: McpServerParams): McpServerConfig;
191
191
  /**
192
192
  * Lists configured MCP servers, normalized across harness config dialects.
193
193
  *
194
194
  * @param id - Optional harness id; omission lists every harness.
195
195
  * @returns {ToolResult<McpListing | UnknownHarness>} The normalized listing or id error.
196
196
  */
197
- declare function mcpList(id?: string): ToolResult<McpListing | UnknownHarness>;
197
+ export declare function mcpList(id?: string): ToolResult<McpListing | UnknownHarness>;
198
198
  /**
199
199
  * Adds or replaces one MCP server in a harness's config.
200
200
  *
@@ -203,7 +203,7 @@ declare function mcpList(id?: string): ToolResult<McpListing | UnknownHarness>;
203
203
  * @param scope - User or project config scope.
204
204
  * @returns {ToolResult<McpMutation | RunFailure>} The mutation outcome or failure.
205
205
  */
206
- declare function mcpAdd(id: string, params: McpServerParams, scope?: "user" | "project"): ToolResult<McpMutation | RunFailure>;
206
+ export declare function mcpAdd(id: string, params: McpServerParams, scope?: "user" | "project"): ToolResult<McpMutation | RunFailure>;
207
207
  /**
208
208
  * Removes one MCP server from a harness's config.
209
209
  *
@@ -212,14 +212,14 @@ declare function mcpAdd(id: string, params: McpServerParams, scope?: "user" | "p
212
212
  * @param scope - User or project config scope.
213
213
  * @returns {ToolResult<McpMutation | RunFailure>} The mutation outcome or failure.
214
214
  */
215
- declare function mcpRemove(id: string, name: string, scope?: "user" | "project"): ToolResult<McpMutation | RunFailure>;
215
+ export declare function mcpRemove(id: string, name: string, scope?: "user" | "project"): ToolResult<McpMutation | RunFailure>;
216
216
  /**
217
217
  * Pushes the master MCP list from ~/.config/agntn/mcp.jsonc into harness configs.
218
218
  *
219
219
  * @param id - Optional harness id; omission targets every harness.
220
220
  * @returns {ToolResult<SyncReport | RunFailure>} The sync report or failure.
221
221
  */
222
- declare function mcpSync(id?: string): ToolResult<SyncReport | RunFailure>;
222
+ export declare function mcpSync(id?: string): ToolResult<SyncReport | RunFailure>;
223
223
  /**
224
224
  * Links every harness's global instructions file to the master AGENTS.md.
225
225
  *
@@ -227,6 +227,6 @@ declare function mcpSync(id?: string): ToolResult<SyncReport | RunFailure>;
227
227
  * @param check - Report intended changes without writing them.
228
228
  * @returns {ToolResult<AgentsSyncReport | RunFailure>} The sync report or failure.
229
229
  */
230
- declare function agentsSync(id?: string, check?: boolean): ToolResult<AgentsSyncReport | RunFailure>;
231
- export { type AgentsSyncReport, HARNESS_INFO_MAX_ITEMS, HarnessInfoDetails, HarnessInfoInputError, HarnessInfoResult, type HarnessInvocationModes, HarnessListing, HarnessMetadata, HarnessStatus, McpListing, McpMutation, McpServerParams, ModelsOptions, ModelsOutcome, RUN_DEFAULT_TIMEOUT_SECONDS, RUN_MAX_OUTPUT_CHARS, RunFailure, RunOptions, RunOutcome, type SyncReport, ToolResult, UnknownHarness, agentsSync, detectHarnesses, harnessInfo, listHarnessModels, mcpAdd, mcpList, mcpRemove, mcpSync, runHarness, toMcpServerConfig };
230
+ export declare function agentsSync(id?: string, check?: boolean): ToolResult<AgentsSyncReport | RunFailure>;
231
+ export { type AgentsSyncReport, HARNESS_INFO_MAX_ITEMS, type HarnessInvocationModes, type SyncReport };
232
232
  //# sourceMappingURL=tool-operations.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-operations.d.mts","names":[],"sources":["../src/tool-operations.ts"],"mappings":";;;UAsCiB,WAAW;EAC1B,SAAS;IAAQ;IAAc;;EAC/B,SAAS;;EAET;;;UAIe;EACf,IAAI;EACJ;EACA;EACA;;;UAIe;EACf,WAAW;;;UAII;EACf,IAAI;EACJ;EACA;EACA,cAAc;EACd,iBAAiB;EACjB;EACA;EACA,QAAQ;EACR,UAAU;EACV,cAAc;EACd,QAAQ;EACR,UAAU;EACV,OAAO;EACP,aAAa;EACb,WAAW;EACX,UAAU;;;UAIK;EACf;EACA,OAAO;;;UAIQ;EACf;;;KAIU,oBAAoB,kBAAkB;;KAGtC,qBAAqB,oBAAoB,sBAAsB;;cAM9D;;cAGA;;;;;;iBAqIG,mBAAmB,WAAW;;iBAiF9B,YAAY,aAAa,WAAW;;iBAEpC,YACd,yBACC,WAAW,sBAAsB;iBACpB,YAAY,oCAAoC,WAAW;;UA2B1D;EACf;EACA;;EAEA;;EAEA,SAAS;;;UAIM;EACf,IAAI;EACJ;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;;;;;;;;;iBAUoB,kBACpB,YACA,UAAS,gBACR,QAAQ,WAAW,gBAAgB;;UA4CrB;EACf;;EAEA;;EAEA;;EAEA,SAAS;;EAET;;EAEA;;EAEA;;;UAIe;EACf,IAAI;EACJ;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA,QAAQ;;EAER,kBAAkB;;EAElB;IAAU;IAAmB;;IAAsB;;;;;;;;;;;;;;;;;iBAyB/B,WACpB,YACA,gBACA,UAAS,aACR,QAAQ,WAAW,aAAa;;UAkClB;EACf,WAAW;IAAQ,IAAI;IAAW,SAAS;;;;UAY5B;EACf,IAAI;EACJ;EACA;;;UAIe;EACf;EACA,YAAY;EACZ;EACA;EACA,MAAM;EACN;EACA,UAAU;;;;;;;;iBASI,kBAAkB,QAAQ,kBAAkB;;;;;;;iBAmB5C,QAAQ,cAAc,WAAW,aAAa;;;;;;;;;iBAgD9C,OACd,YACA,QAAQ,iBACR,6BACC,WAAW,cAAc;;;;;;;;;iBAeZ,UACd,YACA,cACA,6BACC,WAAW,cAAc;;;;;;;iBAaZ,QAAQ,cAAc,WAAW,aAAa;;;;;;;;iBA+B9C,WAAW,aAAa,kBAAgB,WAAW,mBAAmB"}
1
+ {"version":3,"file":"tool-operations.d.mts","names":[],"sources":["../src/tool-operations.ts"],"mappings":";;;iBAsCiB,WAAW;EAC1B,SAAS;IAAQ;IAAc;;EAC/B,SAAS;;EAET;;;iBAIe;EACf,IAAI;EACJ;EACA;EACA;;;iBAIe;EACf,WAAW;;;iBAII;EACf,IAAI;EAC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WAAW,aAAa,kBAAgB,WAAW,mBAAmB"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@agntn/harnesses",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Metadata registry for AI coding harnesses: binaries, configs, sessions, and capabilities.",
5
- "homepage": "https://github.com/agntn/harnesses#readme",
5
+ "homepage": "https://harnesses.agntn.dev",
6
6
  "bugs": "https://github.com/agntn/harnesses/issues",
7
7
  "license": "MIT",
8
8
  "author": "oritwoen (https://github.com/oritwoen)",
@@ -42,23 +42,24 @@
42
42
  "citty": "^0.2.2",
43
43
  "consola": "^3.4.2",
44
44
  "smol-toml": "^1.8.0",
45
- "typebox": "^1.3.19"
45
+ "typebox": "^1.3.33"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@agntn/ox": "^0.1.0",
49
- "@earendil-works/pi-coding-agent": "0.84.3",
50
- "@earendil-works/pi-tui": "0.84.3",
51
- "@oh-my-pi/omptype": "18.0.4",
52
- "@oh-my-pi/pi-ai": "18.0.4",
53
- "@oh-my-pi/pi-coding-agent": "18.0.4",
49
+ "@earendil-works/pi-coding-agent": "0.85.1",
50
+ "@earendil-works/pi-tui": "0.85.1",
51
+ "@oh-my-pi/omptype": "18.2.5",
52
+ "@oh-my-pi/pi-ai": "18.2.5",
53
+ "@oh-my-pi/pi-coding-agent": "18.2.5",
54
54
  "@types/node": "latest",
55
55
  "@typescript/native-preview": "latest",
56
56
  "changelogen": "^0.6.2",
57
- "obuild": "^0.4.38",
58
- "oxfmt": "^0.65.0",
59
- "oxlint": "^1.80.0",
60
- "oxlint-tsgolint": "^7.0.2001",
61
- "vitest": "^4.1.11"
57
+ "obuild": "^0.4.40",
58
+ "oxfmt": "^0.68.0",
59
+ "oxlint": "^1.83.0",
60
+ "oxlint-tsgolint": "^7.0.2002",
61
+ "typescript": "6.0.3",
62
+ "vitest": "^5.0.1"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "@earendil-works/pi-coding-agent": ">=0.84.2 <1",
@@ -77,7 +78,7 @@
77
78
  }
78
79
  },
79
80
  "engines": {
80
- "node": ">=22"
81
+ "node": ">=24"
81
82
  },
82
83
  "omp": {
83
84
  "extensions": [
@@ -81,7 +81,9 @@ export default function harnessesExtension(pi: ExtensionAPI): void {
81
81
  label: HARNESS_TOOL_LABELS.harnesses_detect,
82
82
  description: "List every known AI coding harness with its install state and version",
83
83
  promptSnippet: "Use harnesses_detect to see which AI coding harnesses are installed.",
84
- promptGuidelines: ["The scan checks each harness's binaries on PATH and reads their versions."],
84
+ promptGuidelines: [
85
+ "The scan checks binaries on PATH. Versions come from native metadata or the CLI.",
86
+ ],
85
87
  parameters: schemas.detect,
86
88
  ...statusRenderers("harnesses_detect"),
87
89
  async execute(_toolCallId, _params): Promise<AgentToolResult<HarnessTools.HarnessListing>> {