@agntn/harnesses 0.3.1 → 0.4.1
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.
- package/README.md +16 -16
- package/dist/_chunks/agents.mjs +1 -1
- package/dist/_chunks/mcp-servers.mjs +1 -1
- package/dist/_chunks/output.mjs +1 -1
- package/dist/_chunks/output.mjs.map +1 -1
- package/dist/_chunks/skills-sync.d.mts +16 -4
- package/dist/_chunks/skills-sync.d.mts.map +1 -1
- package/dist/_chunks/skills-sync.mjs +169 -17
- package/dist/_chunks/skills-sync.mjs.map +1 -1
- package/dist/_chunks/tool-operations.mjs +29 -11
- package/dist/_chunks/tool-operations.mjs.map +1 -1
- package/dist/_chunks/tool-schemas.d.mts +1 -0
- package/dist/_chunks/tool-schemas.d.mts.map +1 -1
- package/dist/_chunks/tool-schemas.mjs +6 -0
- package/dist/_chunks/tool-schemas.mjs.map +1 -1
- package/dist/_chunks/types.mjs +1 -1
- package/dist/_chunks/types.mjs.map +1 -1
- package/dist/cli.mjs +34 -23
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +3 -2
- package/dist/mcp.mjs.map +1 -1
- package/dist/tool-operations.d.mts +14 -4
- package/dist/tool-operations.d.mts.map +1 -1
- package/package.json +2 -2
- package/packages/omp/extensions/harnesses.ts +15 -44
- package/packages/pi/extensions/harnesses.ts +8 -4
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":["toToon"],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { defineCommand, runMain } from \"citty\";\nimport { consola } from \"consola\";\nimport { encode as toToon } from \"@toon-format/toon\";\nimport { version, type AvailableModel, type InvokeResult } from \"./types.ts\";\nimport { getAllHarnesses, getHarness, isHarnessId, listHarnesses } from \"./registry.ts\";\nimport { listHarnessModels, type ModelsOutcome, type RunFailure } from \"./tool-operations.ts\";\nimport { exitOnClosedPipe } from \"./commands/output.ts\";\n\nconst s = {\n cyan: (t: string) => `\\x1B[36m${t}\\x1B[0m`,\n hi: (t: string) => `\\x1B[96m${t}\\x1B[0m`,\n green: (t: string) => `\\x1B[32m${t}\\x1B[0m`,\n red: (t: string) => `\\x1B[31m${t}\\x1B[0m`,\n dim: (t: string) => `\\x1B[90m${t}\\x1B[0m`,\n bold: (t: string) => `\\x1B[1m${t}\\x1B[0m`,\n white: (t: string) => `\\x1B[97m${t}\\x1B[0m`,\n};\n\nfunction header(title: string) {\n return `\\n ${s.bold(s.cyan(title))}`;\n}\n\nfunction section(title: string) {\n return `\\n ${s.cyan(\"▸\")} ${s.white(title)}`;\n}\n\nfunction entry(content: string) {\n return ` ${content}`;\n}\n\nfunction renderPathSection(\n title: string,\n entries: readonly {\n readonly path: string;\n readonly scope: string;\n readonly platforms?: readonly string[];\n readonly note?: string;\n }[],\n) {\n if (!entries.length) return;\n consola.log(section(title));\n for (const e of entries) {\n const tags = [s.dim(e.scope)];\n if (e.platforms) tags.push(s.dim(e.platforms.join(\", \")));\n consola.log(entry(`${s.hi(e.path)} ${tags.join(s.dim(\" · \"))}`));\n if (e.note) consola.log(entry(`${s.dim(` ${e.note}`)}`));\n }\n}\n\nconst formatArgs = {\n json: { type: \"boolean\" as const, description: \"Output as JSON\" },\n toon: { type: \"boolean\" as const, description: \"Output as TOON\" },\n};\n\nconst harnessArg = {\n type: \"positional\" as const,\n description: \"Harness id\",\n required: true,\n};\n\nfunction emit(data: unknown, args: Readonly<{ json?: boolean; toon?: boolean }>) {\n if (args.json) {\n console.log(JSON.stringify(data, null, 2));\n return true;\n }\n if (args.toon) {\n console.log(toToon(data));\n return true;\n }\n return false;\n}\n\nfunction resolveHarness(id: string): ReturnType<typeof getHarness> {\n if (!isHarnessId(id)) {\n consola.error(`Unknown harness: ${id}\\nKnown: ${listHarnesses().join(\", \")}`);\n process.exit(1);\n }\n return getHarness(id);\n}\n\nfunction renderResolvedPathSection(\n title: string,\n entries: readonly { readonly path: string }[],\n): void {\n if (entries.length === 0) return;\n consola.log(section(title));\n for (const item of entries) consola.log(entry(s.hi(item.path)));\n}\n\nfunction parsePositiveTimeout(raw: string | undefined): number | null | undefined {\n if (!raw) return undefined;\n const value = Number(raw);\n return Number.isFinite(value) && value > 0 ? value : null;\n}\n\nfunction modelFailureMessage(details: ModelsOutcome | RunFailure): string {\n return \"error\" in details ? details.error : \"Failed to list models\";\n}\n\nfunction modelDescription(model: Readonly<AvailableModel>): string {\n const parts: string[] = [];\n if (model.default) parts.push(\"default\");\n if (model.contextWindow !== undefined) parts.push(`${model.contextWindow} context`);\n if (model.maxOutputTokens !== undefined) parts.push(`${model.maxOutputTokens} max-out`);\n const features: string[] = [];\n if (model.thinking) features.push(\"thinking\");\n if (model.images) features.push(\"images\");\n if (features.length > 0) parts.push(features.join(\", \"));\n return parts.join(\" · \");\n}\n\nfunction renderModels(details: ModelsOutcome): void {\n const harness = getHarness(details.id);\n consola.log(header(`${details.id} models`));\n consola.log(\"\");\n for (const model of details.models) {\n consola.log(entry(`${s.hi(harness.modelSelector(model))} ${s.dim(modelDescription(model))}`));\n }\n if (details.models.length === 0) consola.log(entry(s.dim(\"No models found\")));\n consola.log(\"\");\n}\n\nfunction finishInvocation(result: InvokeResult, timeoutSeconds: number | undefined): never {\n if (result.stdout) process.stdout.write(result.stdout);\n if (result.stderr) process.stderr.write(result.stderr);\n if (result.timedOut) {\n const idle =\n result.idleMs === undefined\n ? \"\"\n : `; last output ${Math.round(result.idleMs / 1000)}s before`;\n consola.error(`Timed out after ${timeoutSeconds}s${idle}`);\n process.exit(124);\n }\n process.exit(result.exitCode ?? 1);\n}\n\nconst list = defineCommand({\n meta: { description: \"List all known harnesses\" },\n args: { ...formatArgs },\n run({ args }) {\n const harnesses = getAllHarnesses();\n const data = harnesses.map((harness) => ({ id: harness.id, name: harness.name }));\n\n if (emit(data, args)) return;\n\n consola.log(header(\"Harnesses\"));\n consola.log(\"\");\n const maxId = Math.max(...data.map((r) => r.id.length));\n for (const { id, name } of data) {\n consola.log(entry(`${s.hi(id.padEnd(maxId))} ${name}`));\n }\n consola.log(\"\");\n },\n});\n\nconst detect = defineCommand({\n meta: { description: \"Detect installed harnesses and versions\" },\n args: { ...formatArgs },\n run({ args }) {\n const harnesses = getAllHarnesses();\n const results = harnesses.map((harness) => {\n const installed = harness.isInstalled();\n const v = installed ? harness.version : null;\n return { id: harness.id, name: harness.name, installed, version: v };\n });\n\n if (emit(results, args)) return;\n\n consola.log(header(\"System Scan\"));\n consola.log(\"\");\n const maxId = Math.max(...results.map((r) => r.id.length));\n for (const r of results) {\n if (r.installed) {\n const ver = r.version ? ` ${s.dim(`v${r.version}`)}` : \"\";\n consola.log(entry(`${s.green(\"●\")} ${s.hi(r.id.padEnd(maxId))} ${r.name}${ver}`));\n } else {\n consola.log(entry(`${s.dim(\"○\")} ${s.dim(r.id.padEnd(maxId))} ${s.dim(r.name)}`));\n }\n }\n consola.log(\"\");\n },\n});\n\nconst info = defineCommand({\n meta: { description: \"Show metadata for a harness\" },\n args: { id: harnessArg, ...formatArgs },\n run({ args }) {\n const harness = resolveHarness(args.id as string);\n\n if (\n emit(\n {\n id: harness.id,\n name: harness.name,\n binaries: harness.binaries,\n capabilities: harness.capabilities,\n invocationModes: harness.invocationModes,\n modelListing: harness.modelListing !== null,\n modelSelection: harness.invocation?.modelArgs !== undefined,\n config: harness.config,\n sessions: harness.sessions,\n instructions: harness.instructions,\n skills: harness.skills,\n commands: harness.commands,\n promptTemplates: harness.promptTemplates,\n hooks: harness.hooks,\n temp: harness.temp,\n envOverrides: harness.envOverrides,\n persistence: harness.persistence,\n detection: harness.detection,\n },\n args,\n )\n )\n return;\n\n consola.log(header(`${harness.name} ${s.dim(harness.id)}`));\n\n consola.log(section(\"Binaries\"));\n for (const b of harness.binaries) consola.log(entry(s.white(b)));\n\n consola.log(section(\"Capabilities\"));\n const caps = Object.entries(harness.capabilities)\n .map(([k, v]) => (v ? s.green(k) : s.dim(k)))\n .join(s.dim(\" · \"));\n consola.log(entry(caps));\n\n consola.log(section(\"Invocation modes\"));\n const modes = Object.entries(harness.invocationModes)\n .map(([k, v]) => (v ? s.green(k) : s.dim(k)))\n .join(s.dim(\" · \"));\n consola.log(entry(modes));\n\n consola.log(section(\"Models\"));\n const modelFeatures = {\n listing: harness.modelListing !== null,\n selection: harness.invocation?.modelArgs !== undefined,\n };\n consola.log(\n entry(\n Object.entries(modelFeatures)\n .map(([k, v]) => (v ? s.green(k) : s.dim(k)))\n .join(s.dim(\" · \")),\n ),\n );\n\n renderPathSection(\"Config\", harness.config);\n renderPathSection(\"Sessions\", harness.sessions);\n renderPathSection(\"Instructions\", harness.instructions);\n renderPathSection(\"Skills\", harness.skills);\n renderPathSection(\"Commands\", harness.commands);\n renderPathSection(\"Prompt templates\", harness.promptTemplates);\n renderPathSection(\"Hooks\", harness.hooks);\n renderPathSection(\"Temp\", harness.temp);\n renderPathSection(\n \"Env overrides\",\n harness.envOverrides.map((e) => ({\n ...e,\n path: `${e.variable} ${s.dim(`${e.path} → ${e.relocates.join(\", \")}`)}`,\n })),\n );\n\n if (harness.persistence.length) {\n consola.log(section(\"Persistence\"));\n for (const e of harness.persistence) {\n const note = e.note ? ` ${s.dim(e.note)}` : \"\";\n consola.log(entry(`${s.white(e.format)}${note}`));\n }\n }\n\n consola.log(\"\");\n },\n});\n\nconst paths = defineCommand({\n meta: { description: \"Show resolved paths for current platform\" },\n args: { id: harnessArg, ...formatArgs },\n run({ args }) {\n const harness = resolveHarness(args.id as string);\n const resolved = harness.resolve();\n\n if (emit(resolved, args)) return;\n\n consola.log(header(`${harness.name} ${s.dim(process.platform)}`));\n\n renderResolvedPathSection(\"Config\", resolved.config);\n renderResolvedPathSection(\"Sessions\", resolved.sessions);\n renderResolvedPathSection(\"Instructions\", resolved.instructions);\n renderResolvedPathSection(\"Skills\", resolved.skills);\n renderResolvedPathSection(\"Commands\", resolved.commands);\n renderResolvedPathSection(\"Prompt templates\", resolved.promptTemplates);\n renderResolvedPathSection(\"Hooks\", resolved.hooks);\n renderResolvedPathSection(\"Temp\", resolved.temp);\n\n consola.log(\"\");\n },\n});\n\nconst models = defineCommand({\n meta: { description: \"List models available to a harness\" },\n args: {\n id: harnessArg,\n search: {\n type: \"positional\" as const,\n description: \"Optional native model search filter\",\n required: false,\n },\n cwd: {\n type: \"string\" as const,\n description: \"Working directory used while loading harness configuration\",\n },\n timeout: { type: \"string\" as const, description: \"Wall-clock budget in seconds\" },\n ...formatArgs,\n },\n async run({ args }) {\n const timeoutSeconds = parsePositiveTimeout(args.timeout);\n if (timeoutSeconds === null) {\n consola.error(`Invalid timeout: ${args.timeout}`);\n process.exitCode = 1;\n return;\n }\n\n const result = await listHarnessModels(args.id as string, {\n search: args.search as string | undefined,\n cwd: args.cwd,\n timeoutSeconds,\n });\n if (emit(result.details, args)) {\n if (result.isError) process.exitCode = 1;\n return;\n }\n if (result.isError || !(\"models\" in result.details)) {\n consola.error(modelFailureMessage(result.details));\n process.exitCode = 1;\n return;\n }\n\n renderModels(result.details);\n },\n});\n\nconst run = defineCommand({\n meta: { description: \"Run one prompt through a harness's non-interactive mode\" },\n args: {\n id: harnessArg,\n prompt: {\n type: \"positional\" as const,\n description: \"Prompt to send to the harness\",\n required: true,\n },\n cwd: { type: \"string\" as const, description: \"Working directory for the run\" },\n model: { type: \"string\" as const, description: \"Harness-native model id or selector\" },\n timeout: { type: \"string\" as const, description: \"Wall-clock budget in seconds\" },\n json: {\n type: \"boolean\" as const,\n description: \"Use the harness's structured (JSON) output mode\",\n },\n tools: {\n type: \"boolean\" as const,\n description: \"Enable tools; default false uses native advisor without tools mode\",\n },\n \"read-only\": {\n type: \"boolean\" as const,\n description:\n \"Require native read-only tool enforcement; implies --tools, rejected with --no-tools\",\n },\n },\n async run({ args }) {\n const harness = resolveHarness(args.id as string);\n const structured = args.json === true;\n const readOnly = args[\"read-only\"] === true;\n const tools = args.tools ?? readOnly;\n\n const invocationOptions = { model: args.model, structured, tools, readOnly };\n if (!harness.buildInvocation(\"\", invocationOptions)) {\n consola.error(harness.invocationError(invocationOptions) ?? \"Invalid invocation\");\n process.exit(1);\n }\n\n const timeoutSeconds = parsePositiveTimeout(args.timeout);\n if (timeoutSeconds === null) {\n consola.error(`Invalid timeout: ${args.timeout}`);\n process.exit(1);\n }\n\n const result = await harness.invoke(args.prompt as string, {\n cwd: args.cwd,\n model: args.model,\n timeoutMs: timeoutSeconds === undefined ? undefined : timeoutSeconds * 1000,\n structured,\n tools,\n readOnly,\n });\n\n finishInvocation(result, timeoutSeconds);\n },\n});\n\nprocess.stdout.on(\"error\", exitOnClosedPipe);\nprocess.stderr.on(\"error\", exitOnClosedPipe);\n\nconst main = defineCommand({\n meta: {\n name: \"harnesses\",\n version,\n description: \"Metadata toolkit for AI coding harnesses\",\n },\n subCommands: {\n list,\n detect,\n info,\n paths,\n models,\n run,\n \"mcp-servers\": () => import(\"./commands/mcp-servers.ts\").then((m) => m.default),\n agents: () => import(\"./commands/agents.ts\").then((m) => m.default),\n prompts: () => import(\"./commands/prompts.ts\").then((m) => m.default),\n skills: () => import(\"./commands/skills.ts\").then((m) => m.default),\n mcp: () => import(\"./commands/mcp.ts\").then((m) => m.default),\n },\n});\n\nawait runMain(main);\n"],"mappings":";;;;;;;;;AAUA,MAAM,IAAI;CACR,OAAO,MAAc,WAAW,EAAE;CAClC,KAAK,MAAc,WAAW,EAAE;CAChC,QAAQ,MAAc,WAAW,EAAE;CACnC,MAAM,MAAc,WAAW,EAAE;CACjC,MAAM,MAAc,WAAW,EAAE;CACjC,OAAO,MAAc,UAAU,EAAE;CACjC,QAAQ,MAAc,WAAW,EAAE;AACrC;AAEA,SAAS,OAAO,OAAe;CAC7B,OAAO,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC;AACpC;AAEA,SAAS,QAAQ,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"sourcesContent":["#!/usr/bin/env node\n\nimport { defineCommand, runMain } from \"citty\";\nimport { consola } from \"consola\";\nimport { encode as toToon } from \"@toon-format/toon\";\nimport { version, type AvailableModel, type InvokeResult } from \"./types.ts\";\nimport { getAllHarnesses, getHarness, isHarnessId, listHarnesses } from \"./registry.ts\";\nimport {\n detectHarnesses,\n listHarnessModels,\n type HarnessStatus,\n type ModelsOutcome,\n type RunFailure,\n} from \"./tool-operations.ts\";\nimport { exitOnClosedPipe, sanitize } from \"./commands/output.ts\";\n\nconst s = {\n cyan: (t: string) => `\\x1B[36m${t}\\x1B[0m`,\n hi: (t: string) => `\\x1B[96m${t}\\x1B[0m`,\n green: (t: string) => `\\x1B[32m${t}\\x1B[0m`,\n red: (t: string) => `\\x1B[31m${t}\\x1B[0m`,\n dim: (t: string) => `\\x1B[90m${t}\\x1B[0m`,\n bold: (t: string) => `\\x1B[1m${t}\\x1B[0m`,\n white: (t: string) => `\\x1B[97m${t}\\x1B[0m`,\n};\n\nfunction header(title: string) {\n return `\\n ${s.bold(s.cyan(title))}`;\n}\n\nfunction section(title: string) {\n return `\\n ${s.cyan(\"▸\")} ${s.white(title)}`;\n}\n\nfunction entry(content: string) {\n return ` ${content}`;\n}\n\nfunction renderPathSection(\n title: string,\n entries: readonly {\n readonly path: string;\n readonly scope: string;\n readonly platforms?: readonly string[];\n readonly note?: string;\n }[],\n) {\n if (!entries.length) return;\n consola.log(section(title));\n for (const e of entries) {\n const tags = [s.dim(e.scope)];\n if (e.platforms) tags.push(s.dim(e.platforms.join(\", \")));\n consola.log(entry(`${s.hi(e.path)} ${tags.join(s.dim(\" · \"))}`));\n if (e.note) consola.log(entry(`${s.dim(` ${e.note}`)}`));\n }\n}\n\nconst formatArgs = {\n json: { type: \"boolean\" as const, description: \"Output as JSON\" },\n toon: { type: \"boolean\" as const, description: \"Output as TOON\" },\n};\n\nconst harnessArg = {\n type: \"positional\" as const,\n description: \"Harness id\",\n required: true,\n};\n\nfunction emit(data: unknown, args: Readonly<{ json?: boolean; toon?: boolean }>) {\n if (args.json) {\n console.log(JSON.stringify(data, null, 2));\n return true;\n }\n if (args.toon) {\n console.log(toToon(data));\n return true;\n }\n return false;\n}\n\nfunction resolveHarness(id: string): ReturnType<typeof getHarness> {\n if (!isHarnessId(id)) {\n consola.error(`Unknown harness: ${id}\\nKnown: ${listHarnesses().join(\", \")}`);\n process.exit(1);\n }\n return getHarness(id);\n}\n\nfunction renderResolvedPathSection(\n title: string,\n entries: readonly { readonly path: string }[],\n): void {\n if (entries.length === 0) return;\n consola.log(section(title));\n for (const item of entries) consola.log(entry(s.hi(item.path)));\n}\n\nfunction parsePositiveTimeout(raw: string | undefined): number | null | undefined {\n if (!raw) return undefined;\n const value = Number(raw);\n return Number.isFinite(value) && value > 0 ? value : null;\n}\n\nfunction modelFailureMessage(details: ModelsOutcome | RunFailure): string {\n return \"error\" in details ? details.error : \"Failed to list models\";\n}\n\nfunction modelDescription(model: Readonly<AvailableModel>): string {\n const parts: string[] = [];\n if (model.name !== undefined) parts.push(model.name);\n if (model.default) parts.push(\"default\");\n if (model.contextWindow !== undefined) parts.push(`${model.contextWindow} context`);\n if (model.maxOutputTokens !== undefined) parts.push(`${model.maxOutputTokens} max-out`);\n const features: string[] = [];\n if (model.thinking) features.push(\"thinking\");\n if (model.images) features.push(\"images\");\n if (features.length > 0) parts.push(features.join(\", \"));\n return parts.join(\" · \");\n}\n\nfunction runModes(status: Readonly<HarnessStatus>): string[] {\n return ([\"advisor\", \"readOnly\", \"agent\"] as const).filter((mode) => status[mode]);\n}\n\nfunction renderModels(details: ModelsOutcome): void {\n const harness = getHarness(details.id);\n consola.log(header(`${details.id} models`));\n consola.log(\"\");\n for (const model of details.models) {\n consola.log(\n entry(\n `${s.hi(sanitize(harness.modelSelector(model)))} ${s.dim(sanitize(modelDescription(model)))}`,\n ),\n );\n }\n if (details.models.length === 0) consola.log(entry(s.dim(\"No models found\")));\n consola.log(\"\");\n}\n\nfunction finishInvocation(result: InvokeResult, timeoutSeconds: number | undefined): never {\n if (result.stdout) process.stdout.write(result.stdout);\n if (result.stderr) process.stderr.write(result.stderr);\n if (result.timedOut) {\n const idle =\n result.idleMs === undefined\n ? \"\"\n : `; last output ${Math.round(result.idleMs / 1000)}s before`;\n consola.error(`Timed out after ${timeoutSeconds}s${idle}`);\n process.exit(124);\n }\n process.exit(result.exitCode ?? 1);\n}\n\nconst list = defineCommand({\n meta: { description: \"List all known harnesses\" },\n args: { ...formatArgs },\n run({ args }) {\n const harnesses = getAllHarnesses();\n const data = harnesses.map((harness) => ({ id: harness.id, name: harness.name }));\n\n if (emit(data, args)) return;\n\n consola.log(header(\"Harnesses\"));\n consola.log(\"\");\n const maxId = Math.max(...data.map((r) => r.id.length));\n for (const { id, name } of data) {\n consola.log(entry(`${s.hi(id.padEnd(maxId))} ${name}`));\n }\n consola.log(\"\");\n },\n});\n\nconst detect = defineCommand({\n meta: { description: \"Detect installed harnesses, versions and run modes\" },\n args: { ...formatArgs },\n run({ args }) {\n const results = detectHarnesses().details.harnesses;\n\n if (emit(results, args)) return;\n\n consola.log(header(\"System Scan\"));\n consola.log(\"\");\n const maxId = Math.max(...results.map((r) => r.id.length));\n const installed = results.filter((r) => r.installed);\n const maxName = Math.max(...installed.map((r) => r.name.length));\n const maxVersion = Math.max(...installed.map((r) => (r.version ? r.version.length + 1 : 0)));\n for (const r of results) {\n if (r.installed) {\n const ver = (r.version ? `v${r.version}` : \"\").padEnd(maxVersion);\n const modes = runModes(r).join(\" · \") || \"no headless mode\";\n consola.log(\n entry(\n `${s.green(\"●\")} ${s.hi(r.id.padEnd(maxId))} ${r.name.padEnd(maxName)} ${s.dim(ver)} ${s.dim(modes)}`,\n ),\n );\n } else {\n consola.log(entry(`${s.dim(\"○\")} ${s.dim(r.id.padEnd(maxId))} ${s.dim(r.name)}`));\n }\n }\n consola.log(\"\");\n },\n});\n\nconst info = defineCommand({\n meta: { description: \"Show metadata for a harness\" },\n args: { id: harnessArg, ...formatArgs },\n run({ args }) {\n const harness = resolveHarness(args.id as string);\n const modelFeatures = {\n listing: harness.modelListing !== null,\n selection: harness.invocation?.modelArgs !== undefined,\n effort: harness.invocation?.effortArgs !== undefined,\n };\n\n if (\n emit(\n {\n id: harness.id,\n name: harness.name,\n binaries: harness.binaries,\n capabilities: harness.capabilities,\n invocationModes: harness.invocationModes,\n modelListing: modelFeatures.listing,\n modelSelection: modelFeatures.selection,\n effortSelection: modelFeatures.effort,\n config: harness.config,\n sessions: harness.sessions,\n instructions: harness.instructions,\n skills: harness.skills,\n commands: harness.commands,\n promptTemplates: harness.promptTemplates,\n hooks: harness.hooks,\n temp: harness.temp,\n envOverrides: harness.envOverrides,\n persistence: harness.persistence,\n detection: harness.detection,\n },\n args,\n )\n )\n return;\n\n consola.log(header(`${harness.name} ${s.dim(harness.id)}`));\n\n consola.log(section(\"Binaries\"));\n for (const b of harness.binaries) consola.log(entry(s.white(b)));\n\n consola.log(section(\"Capabilities\"));\n const caps = Object.entries(harness.capabilities)\n .map(([k, v]) => (v ? s.green(k) : s.dim(k)))\n .join(s.dim(\" · \"));\n consola.log(entry(caps));\n\n consola.log(section(\"Invocation modes\"));\n const modes = Object.entries(harness.invocationModes)\n .map(([k, v]) => (v ? s.green(k) : s.dim(k)))\n .join(s.dim(\" · \"));\n consola.log(entry(modes));\n\n consola.log(section(\"Models\"));\n consola.log(\n entry(\n Object.entries(modelFeatures)\n .map(([k, v]) => (v ? s.green(k) : s.dim(k)))\n .join(s.dim(\" · \")),\n ),\n );\n\n renderPathSection(\"Config\", harness.config);\n renderPathSection(\"Sessions\", harness.sessions);\n renderPathSection(\"Instructions\", harness.instructions);\n renderPathSection(\"Skills\", harness.skills);\n renderPathSection(\"Commands\", harness.commands);\n renderPathSection(\"Prompt templates\", harness.promptTemplates);\n renderPathSection(\"Hooks\", harness.hooks);\n renderPathSection(\"Temp\", harness.temp);\n renderPathSection(\n \"Env overrides\",\n harness.envOverrides.map((e) => ({\n ...e,\n path: `${e.variable} ${s.dim(`${e.path} → ${e.relocates.join(\", \")}`)}`,\n })),\n );\n\n if (harness.persistence.length) {\n consola.log(section(\"Persistence\"));\n for (const e of harness.persistence) {\n const note = e.note ? ` ${s.dim(e.note)}` : \"\";\n consola.log(entry(`${s.white(e.format)}${note}`));\n }\n }\n\n consola.log(\"\");\n },\n});\n\nconst paths = defineCommand({\n meta: { description: \"Show resolved paths for current platform\" },\n args: { id: harnessArg, ...formatArgs },\n run({ args }) {\n const harness = resolveHarness(args.id as string);\n const resolved = harness.resolve();\n\n if (emit(resolved, args)) return;\n\n consola.log(header(`${harness.name} ${s.dim(process.platform)}`));\n\n renderResolvedPathSection(\"Config\", resolved.config);\n renderResolvedPathSection(\"Sessions\", resolved.sessions);\n renderResolvedPathSection(\"Instructions\", resolved.instructions);\n renderResolvedPathSection(\"Skills\", resolved.skills);\n renderResolvedPathSection(\"Commands\", resolved.commands);\n renderResolvedPathSection(\"Prompt templates\", resolved.promptTemplates);\n renderResolvedPathSection(\"Hooks\", resolved.hooks);\n renderResolvedPathSection(\"Temp\", resolved.temp);\n\n consola.log(\"\");\n },\n});\n\nconst models = defineCommand({\n meta: { description: \"List models available to a harness\" },\n args: {\n id: harnessArg,\n search: {\n type: \"positional\" as const,\n description: \"Optional native model search filter\",\n required: false,\n },\n cwd: {\n type: \"string\" as const,\n description: \"Working directory used while loading harness configuration\",\n },\n timeout: { type: \"string\" as const, description: \"Wall-clock budget in seconds\" },\n ...formatArgs,\n },\n async run({ args }) {\n const timeoutSeconds = parsePositiveTimeout(args.timeout);\n if (timeoutSeconds === null) {\n consola.error(`Invalid timeout: ${args.timeout}`);\n process.exitCode = 1;\n return;\n }\n\n const result = await listHarnessModels(args.id as string, {\n search: args.search as string | undefined,\n cwd: args.cwd,\n timeoutSeconds,\n });\n if (emit(result.details, args)) {\n if (result.isError) process.exitCode = 1;\n return;\n }\n if (result.isError || !(\"models\" in result.details)) {\n consola.error(modelFailureMessage(result.details));\n process.exitCode = 1;\n return;\n }\n\n renderModels(result.details);\n },\n});\n\nconst run = defineCommand({\n meta: { description: \"Run one prompt through a harness's non-interactive mode\" },\n args: {\n id: harnessArg,\n prompt: {\n type: \"positional\" as const,\n description: \"Prompt to send to the harness\",\n required: true,\n },\n cwd: { type: \"string\" as const, description: \"Working directory for the run\" },\n model: { type: \"string\" as const, description: \"Harness-native model id or selector\" },\n effort: {\n type: \"string\" as const,\n description: \"Reasoning effort in the harness's own words (low, high, max)\",\n },\n timeout: { type: \"string\" as const, description: \"Wall-clock budget in seconds\" },\n json: {\n type: \"boolean\" as const,\n description: \"Use the harness's structured (JSON) output mode\",\n },\n tools: {\n type: \"boolean\" as const,\n description: \"Enable tools; default false uses native advisor without tools mode\",\n },\n \"read-only\": {\n type: \"boolean\" as const,\n description:\n \"Require native read-only tool enforcement; implies --tools, rejected with --no-tools\",\n },\n },\n async run({ args }) {\n const harness = resolveHarness(args.id as string);\n const structured = args.json === true;\n const readOnly = args[\"read-only\"] === true;\n const tools = args.tools ?? readOnly;\n\n const invocationOptions = {\n model: args.model,\n effort: args.effort,\n structured,\n tools,\n readOnly,\n };\n if (!harness.buildInvocation(\"\", invocationOptions)) {\n consola.error(harness.invocationError(invocationOptions) ?? \"Invalid invocation\");\n process.exit(1);\n }\n\n const timeoutSeconds = parsePositiveTimeout(args.timeout);\n if (timeoutSeconds === null) {\n consola.error(`Invalid timeout: ${args.timeout}`);\n process.exit(1);\n }\n\n const result = await harness.invoke(args.prompt as string, {\n cwd: args.cwd,\n model: args.model,\n effort: args.effort,\n timeoutMs: timeoutSeconds === undefined ? undefined : timeoutSeconds * 1000,\n structured,\n tools,\n readOnly,\n });\n\n finishInvocation(result, timeoutSeconds);\n },\n});\n\nprocess.stdout.on(\"error\", exitOnClosedPipe);\nprocess.stderr.on(\"error\", exitOnClosedPipe);\n\nconst main = defineCommand({\n meta: {\n name: \"harnesses\",\n version,\n description: \"Metadata toolkit for AI coding harnesses\",\n },\n subCommands: {\n list,\n detect,\n info,\n paths,\n models,\n run,\n \"mcp-servers\": () => import(\"./commands/mcp-servers.ts\").then((m) => m.default),\n agents: () => import(\"./commands/agents.ts\").then((m) => m.default),\n prompts: () => import(\"./commands/prompts.ts\").then((m) => m.default),\n skills: () => import(\"./commands/skills.ts\").then((m) => m.default),\n mcp: () => import(\"./commands/mcp.ts\").then((m) => m.default),\n },\n});\n\nawait runMain(main);\n"],"mappings":";;;;;;;;;AAgBA,MAAM,IAAI;CACR,OAAO,MAAc,WAAW,EAAE;CAClC,KAAK,MAAc,WAAW,EAAE;CAChC,QAAQ,MAAc,WAAW,EAAE;CACnC,MAAM,MAAc,WAAW,EAAE;CACjC,MAAM,MAAc,WAAW,EAAE;CACjC,OAAO,MAAc,UAAU,EAAE;CACjC,QAAQ,MAAc,WAAW,EAAE;AACrC;AAEA,SAAS,OAAO,OAAe;CAC7B,OAAO,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC;AACpC;AAEA,SAAS,QAAQ,OAAe;CAC9B,OAAO,OAAO,EAAE,KAAK,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK;AAC5C;AAEA,SAAS,MAAM,SAAiB;CAC9B,OAAO,OAAO;AAChB;AAEA,SAAS,kBACP,OACA,SAMA;CACA,IAAI,CAAC,QAAQ,QAAQ;CACrB,QAAQ,IAAI,QAAQ,KAAK,CAAC;CAC1B,KAAK,MAAM,KAAK,SAAS;EACvB,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC;EAC5B,IAAI,EAAE,WAAW,KAAK,KAAK,EAAE,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC,CAAC;EACxD,QAAQ,IAAI,MAAM,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC;EAChE,IAAI,EAAE,MAAM,QAAQ,IAAI,MAAM,GAAG,EAAE,IAAI,KAAK,EAAE,MAAM,GAAG,CAAC;CAC1D;AACF;AAEA,MAAM,aAAa;CACjB,M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ACb;GACA;GACA;EACF;EACA,IAAI,CAAC,QAAQ,gBAAgB,IAAI,iBAAiB,GAAG;GACnD,QAAQ,MAAM,QAAQ,gBAAgB,iBAAiB,KAAK,oBAAoB;GAChF,QAAQ,KAAK,CAAC;EAChB;EAEA,MAAM,iBAAiB,qBAAqB,KAAK,OAAO;EACxD,IAAI,mBAAmB,MAAM;GAC3B,QAAQ,MAAM,oBAAoB,KAAK,SAAS;GAChD,QAAQ,KAAK,CAAC;EAChB;EAYA,iBAAiB,MAVI,QAAQ,OAAO,KAAK,QAAkB;GACzD,KAAK,KAAK;GACV,OAAO,KAAK;GACZ,QAAQ,KAAK;GACb,WAAW,mBAAmB,KAAA,IAAY,KAAA,IAAY,iBAAiB;GACvE;GACA;GACA;EACF,CAAC,GAEwB,cAAc;CACzC;AACF,CAAC;AAED,QAAQ,OAAO,GAAG,SAAS,gBAAgB;AAC3C,QAAQ,OAAO,GAAG,SAAS,gBAAgB;AAE3C,MAAM,OAAO,cAAc;CACzB,MAAM;EACJ,MAAM;EACN;EACA,aAAa;CACf;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB,OAAO,4BAA4B,CAAC,MAAM,MAAM,EAAE,OAAO;EAC9E,cAAc,OAAO,uBAAuB,CAAC,MAAM,MAAM,EAAE,OAAO;EAClE,eAAe,OAAO,wBAAwB,CAAC,MAAM,MAAM,EAAE,OAAO;EACpE,cAAc,OAAO,uBAAuB,CAAC,MAAM,MAAM,EAAE,OAAO;EAClE,WAAW,OAAO,oBAAoB,CAAC,MAAM,MAAM,EAAE,OAAO;CAC9D;AACF,CAAC;AAED,MAAM,QAAQ,IAAI"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as StorageDescriptor, A as HarnessConstructor, B as InvokeOptions, C as listMcpServers, D as removeMcpServer, E as readMasterMcpServers, F as HarnessDetection, G as McpServerConfig, H as ListModelsOptions, I as HarnessId, J as Platform, K as PathCandidate, L as HarnessInvocation, M as EnvOverride, N as EvidenceLevel, O as syncMcpServers, P as HarnessCapabilities, Q as SkillsSyncTarget, R as HarnessInvocationModes, S as addMcpServer, T as parseJsonc, U as ListModelsResult, V as InvokeResult, W as McpConfigFile, X as ResolveOptions, Y as PromptTemplateSyncTarget, Z as ResolvedPaths, _ as McpConfigListing, a as PromptSyncAction, b as SyncReport, c as PromptTemplateTargetResult, d as AgentsConfig, et as version, f as AgentsSyncAction, g as syncAgentsFiles, h as readAgentsConfig, i as syncSkills, j as AvailableModel, k as Harness, l as syncPromptTemplates, m as AgentsTargetResult, n as SkillsSyncReport, o as PromptSyncReport, p as AgentsSyncReport, q as PathCategory, r as SkillsSyncTargetResult, s as PromptSyncTargetResult, t as SkillsSyncAction, u as AgentsCompanionTargetResult, v as McpEnvError, w as masterMcpPath, x as SyncTargetResult, y as McpTransportError, z as HarnessModelListing } from "./_chunks/skills-sync.mjs";
|
|
2
2
|
//#region src/registry.d.ts
|
|
3
3
|
export declare function registerHarness(HarnessClass: HarnessConstructor): Harness;
|
|
4
4
|
export declare function getHarness(id: HarnessId): Harness;
|
|
@@ -324,5 +324,5 @@ interface OpenCodeProject {
|
|
|
324
324
|
//#region src/index.d.ts
|
|
325
325
|
export declare const harnessIds: readonly HarnessId[];
|
|
326
326
|
//#endregion
|
|
327
|
-
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 EnvOverride, 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 PathCategory, type Platform, type PromptSyncAction, type PromptSyncReport, type PromptSyncTargetResult, type PromptTemplateSyncTarget, type PromptTemplateTargetResult, type ResolveOptions, type ResolvedPaths, type SkillsSyncAction, type SkillsSyncReport, type SkillsSyncTarget, type SkillsSyncTargetResult, type StorageDescriptor, type SyncReport, type SyncTargetResult, addMcpServer, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, removeMcpServer, syncAgentsFiles, syncMcpServers, syncPromptTemplates, syncSkills, version };
|
|
327
|
+
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 EnvOverride, 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, McpTransportError, 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 PathCategory, type Platform, type PromptSyncAction, type PromptSyncReport, type PromptSyncTargetResult, type PromptTemplateSyncTarget, type PromptTemplateTargetResult, type ResolveOptions, type ResolvedPaths, type SkillsSyncAction, type SkillsSyncReport, type SkillsSyncTarget, type SkillsSyncTargetResult, type StorageDescriptor, type SyncReport, type SyncTargetResult, addMcpServer, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, removeMcpServer, syncAgentsFiles, syncMcpServers, syncPromptTemplates, syncSkills, version };
|
|
328
328
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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":";;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;;;;;;;wBAkB/C,eAAe,UAAS;;;;;;;wBAcxB,aAAa,UAAS;;;UC1CrB;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;;;;
|
|
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;;;;;;;wBAkB/C,eAAe,UAAS;;;;;;;wBAcxB,aAAa,UAAS;;;UC1CrB;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;;;;qBCrBW,qBAAqB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as version } from "./_chunks/types.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { D as resolvePathTemplate, E as agntnDataDir, S as Harness, T as agntnConfigDir, _ as getAllHarnesses, a as McpEnvError, b as listHarnesses, c as listMcpServers, d as readMasterMcpServers, f as removeMcpServer, g as detectProjectHarnesses, h as detectHarnessFromEnv, i as syncAgentsFiles, l as masterMcpPath, m as detectHarness, n as syncPromptTemplates, o as McpTransportError, p as syncMcpServers, r as readAgentsConfig, s as addMcpServer, t as syncSkills, u as parseJsonc, v as getHarness, x as registerHarness, y as isHarnessId } from "./_chunks/skills-sync.mjs";
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
const harnessIds = Object.freeze(listHarnesses());
|
|
5
5
|
//#endregion
|
|
6
|
-
export { Harness, McpEnvError, addMcpServer, agntnConfigDir, agntnDataDir, detectHarness, detectHarnessFromEnv, detectProjectHarnesses, getAllHarnesses, getHarness, harnessIds, isHarnessId, listHarnesses, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, registerHarness, removeMcpServer, resolvePathTemplate, syncAgentsFiles, syncMcpServers, syncPromptTemplates, syncSkills, version };
|
|
6
|
+
export { Harness, McpEnvError, McpTransportError, addMcpServer, agntnConfigDir, agntnDataDir, detectHarness, detectHarnessFromEnv, detectProjectHarnesses, getAllHarnesses, getHarness, harnessIds, isHarnessId, listHarnesses, listMcpServers, masterMcpPath, parseJsonc, readAgentsConfig, readMasterMcpServers, registerHarness, removeMcpServer, resolvePathTemplate, syncAgentsFiles, syncMcpServers, syncPromptTemplates, syncSkills, version };
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export { version } from \"./types.ts\";\nexport type {\n HarnessId,\n EvidenceLevel,\n Platform,\n PathCandidate,\n PathCategory,\n EnvOverride,\n PromptTemplateSyncTarget,\n SkillsSyncTarget,\n StorageDescriptor,\n HarnessCapabilities,\n HarnessDetection,\n HarnessInvocation,\n HarnessInvocationModes,\n HarnessModelListing,\n AvailableModel,\n ListModelsOptions,\n ListModelsResult,\n InvokeOptions,\n InvokeResult,\n McpServerConfig,\n McpConfigFile,\n ResolveOptions,\n ResolvedPaths,\n} from \"./types.ts\";\n\nexport { Harness } from \"./harness.ts\";\nexport type { HarnessConstructor } from \"./harness.ts\";\nexport {\n registerHarness,\n getHarness,\n isHarnessId,\n listHarnesses,\n getAllHarnesses,\n detectHarness,\n detectHarnessFromEnv,\n detectProjectHarnesses,\n} from \"./registry.ts\";\nexport { agntnDataDir, agntnConfigDir, resolvePathTemplate } from \"./resolve.ts\";\nexport {\n listMcpServers,\n addMcpServer,\n removeMcpServer,\n syncMcpServers,\n readMasterMcpServers,\n masterMcpPath,\n parseJsonc,\n McpEnvError,\n} from \"./mcp-servers.ts\";\nexport type { McpConfigListing, SyncReport, SyncTargetResult } from \"./mcp-servers.ts\";\nexport { syncAgentsFiles, readAgentsConfig } from \"./agents-sync.ts\";\nexport type {\n AgentsConfig,\n AgentsSyncAction,\n AgentsCompanionTargetResult,\n AgentsSyncReport,\n AgentsTargetResult,\n} from \"./agents-sync.ts\";\nexport { syncPromptTemplates } from \"./prompt-sync.ts\";\nexport type {\n PromptSyncAction,\n PromptSyncReport,\n PromptSyncTargetResult,\n PromptTemplateTargetResult,\n} from \"./prompt-sync.ts\";\nexport { syncSkills } from \"./skills-sync.ts\";\nexport type { SkillsSyncAction, SkillsSyncReport, SkillsSyncTargetResult } from \"./skills-sync.ts\";\n\nexport type {\n ClaudeContentBlock,\n ClaudeTextBlock,\n ClaudeThinkingBlock,\n ClaudeToolUseBlock,\n ClaudeToolResultBlock,\n ClaudeUsage,\n ClaudeBaseEntry,\n ClaudeUserEntry,\n ClaudeAssistantEntry,\n ClaudeSummaryEntry,\n ClaudeSessionEntry,\n ClaudeHistoryEntry,\n GeminiTokensSummary,\n GeminiToolCallRecord,\n GeminiThought,\n GeminiMessageRecord,\n GeminiConversationRecord,\n CodexHistoryEntry,\n CodexThread,\n CodexLogEntry,\n OpenCodeSession,\n OpenCodeMessage,\n OpenCodeTextPart,\n OpenCodeReasoningPart,\n OpenCodeToolPart,\n OpenCodeFilePart,\n OpenCodeSubtaskPart,\n OpenCodeStepStartPart,\n OpenCodeStepFinishPart,\n OpenCodeSnapshotPart,\n OpenCodePatchPart,\n OpenCodeAgentPart,\n OpenCodeRetryPart,\n OpenCodeCompactionPart,\n OpenCodePart,\n OpenCodeTodo,\n OpenCodeProject,\n} from \"./schemas/index.ts\";\n\nimport type { HarnessId } from \"./types.ts\";\nimport { listHarnesses } from \"./registry.ts\";\n\nexport const harnessIds: readonly HarnessId[] = Object.freeze(listHarnesses());\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["export { version } from \"./types.ts\";\nexport type {\n HarnessId,\n EvidenceLevel,\n Platform,\n PathCandidate,\n PathCategory,\n EnvOverride,\n PromptTemplateSyncTarget,\n SkillsSyncTarget,\n StorageDescriptor,\n HarnessCapabilities,\n HarnessDetection,\n HarnessInvocation,\n HarnessInvocationModes,\n HarnessModelListing,\n AvailableModel,\n ListModelsOptions,\n ListModelsResult,\n InvokeOptions,\n InvokeResult,\n McpServerConfig,\n McpConfigFile,\n ResolveOptions,\n ResolvedPaths,\n} from \"./types.ts\";\n\nexport { Harness } from \"./harness.ts\";\nexport type { HarnessConstructor } from \"./harness.ts\";\nexport {\n registerHarness,\n getHarness,\n isHarnessId,\n listHarnesses,\n getAllHarnesses,\n detectHarness,\n detectHarnessFromEnv,\n detectProjectHarnesses,\n} from \"./registry.ts\";\nexport { agntnDataDir, agntnConfigDir, resolvePathTemplate } from \"./resolve.ts\";\nexport {\n listMcpServers,\n addMcpServer,\n removeMcpServer,\n syncMcpServers,\n readMasterMcpServers,\n masterMcpPath,\n parseJsonc,\n McpEnvError,\n McpTransportError,\n} from \"./mcp-servers.ts\";\nexport type { McpConfigListing, SyncReport, SyncTargetResult } from \"./mcp-servers.ts\";\nexport { syncAgentsFiles, readAgentsConfig } from \"./agents-sync.ts\";\nexport type {\n AgentsConfig,\n AgentsSyncAction,\n AgentsCompanionTargetResult,\n AgentsSyncReport,\n AgentsTargetResult,\n} from \"./agents-sync.ts\";\nexport { syncPromptTemplates } from \"./prompt-sync.ts\";\nexport type {\n PromptSyncAction,\n PromptSyncReport,\n PromptSyncTargetResult,\n PromptTemplateTargetResult,\n} from \"./prompt-sync.ts\";\nexport { syncSkills } from \"./skills-sync.ts\";\nexport type { SkillsSyncAction, SkillsSyncReport, SkillsSyncTargetResult } from \"./skills-sync.ts\";\n\nexport type {\n ClaudeContentBlock,\n ClaudeTextBlock,\n ClaudeThinkingBlock,\n ClaudeToolUseBlock,\n ClaudeToolResultBlock,\n ClaudeUsage,\n ClaudeBaseEntry,\n ClaudeUserEntry,\n ClaudeAssistantEntry,\n ClaudeSummaryEntry,\n ClaudeSessionEntry,\n ClaudeHistoryEntry,\n GeminiTokensSummary,\n GeminiToolCallRecord,\n GeminiThought,\n GeminiMessageRecord,\n GeminiConversationRecord,\n CodexHistoryEntry,\n CodexThread,\n CodexLogEntry,\n OpenCodeSession,\n OpenCodeMessage,\n OpenCodeTextPart,\n OpenCodeReasoningPart,\n OpenCodeToolPart,\n OpenCodeFilePart,\n OpenCodeSubtaskPart,\n OpenCodeStepStartPart,\n OpenCodeStepFinishPart,\n OpenCodeSnapshotPart,\n OpenCodePatchPart,\n OpenCodeAgentPart,\n OpenCodeRetryPart,\n OpenCodeCompactionPart,\n OpenCodePart,\n OpenCodeTodo,\n OpenCodeProject,\n} from \"./schemas/index.ts\";\n\nimport type { HarnessId } from \"./types.ts\";\nimport { listHarnesses } from \"./registry.ts\";\n\nexport const harnessIds: readonly HarnessId[] = Object.freeze(listHarnesses());\n"],"mappings":";;;AAiHA,MAAa,aAAmC,OAAO,OAAO,cAAc,CAAC"}
|
package/dist/mcp.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.mts","names":[],"sources":["../src/mcp.ts"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"mcp.d.mts","names":[],"sources":["../src/mcp.ts"],"mappings":";;;;;;;;;;;;;wBAwPgB,mBAAmB"}
|
package/dist/mcp.mjs
CHANGED
|
@@ -6271,7 +6271,7 @@ const tools = [
|
|
|
6271
6271
|
{
|
|
6272
6272
|
name: "harnesses_detect",
|
|
6273
6273
|
title: "Harnesses Detect",
|
|
6274
|
-
description: "List every known AI coding harness with its install state and
|
|
6274
|
+
description: "List every known AI coding harness with its install state, version and the harnesses_run modes it takes: advisor (tools=false), readOnly (tools=true with readOnly=true) and agent (tools=true).",
|
|
6275
6275
|
inputSchema: schemas.detect,
|
|
6276
6276
|
annotations: READ_ONLY,
|
|
6277
6277
|
execute: ({ detectHarnesses }) => detectHarnesses()
|
|
@@ -6300,7 +6300,7 @@ const tools = [
|
|
|
6300
6300
|
{
|
|
6301
6301
|
name: "harnesses_run",
|
|
6302
6302
|
title: "Harnesses Run",
|
|
6303
|
-
description: "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.",
|
|
6303
|
+
description: "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; harnesses_detect shows which modes each harness takes.",
|
|
6304
6304
|
inputSchema: schemas.run,
|
|
6305
6305
|
annotations: {
|
|
6306
6306
|
readOnlyHint: false,
|
|
@@ -6311,6 +6311,7 @@ const tools = [
|
|
|
6311
6311
|
execute: ({ runHarness }, args, signal) => runHarness(args.id, args.prompt, {
|
|
6312
6312
|
cwd: args.cwd,
|
|
6313
6313
|
model: args.model,
|
|
6314
|
+
effort: args.effort,
|
|
6314
6315
|
timeoutSeconds: args.timeoutSeconds,
|
|
6315
6316
|
signal,
|
|
6316
6317
|
structured: args.structured,
|