@agntn/harnesses 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,7 +34,7 @@ The rest of it sits on [harnesses.agntn.dev](https://harnesses.agntn.dev).
34
34
  pnpm add @agntn/harnesses
35
35
  ```
36
36
 
37
- Node.js 24 or newer.
37
+ Node.js 26 or newer.
38
38
 
39
39
  ## 🚀 First call
40
40
 
@@ -1,4 +1,4 @@
1
- import { v as isHarnessId, y as listHarnesses } from "./skills-sync.mjs";
1
+ import { b as listHarnesses, y as isHarnessId } from "./skills-sync.mjs";
2
2
  import { r as agentsSync } from "./tool-operations.mjs";
3
3
  import { n as formatArgs, r as report } from "./output.mjs";
4
4
  import { defineCommand } from "citty";
@@ -1,4 +1,4 @@
1
- import { v as isHarnessId, y as listHarnesses } from "./skills-sync.mjs";
1
+ import { b as listHarnesses, y as isHarnessId } from "./skills-sync.mjs";
2
2
  import { c as mcpList, l as mcpRemove, s as mcpAdd, u as mcpSync } from "./tool-operations.mjs";
3
3
  import { n as formatArgs, r as report } from "./output.mjs";
4
4
  import { defineCommand } from "citty";
@@ -175,10 +175,11 @@ interface McpConfigFile extends PathCandidate {
175
175
  key: string[];
176
176
  /**
177
177
  * Shape of individual entries; "standard" is the {command, args, env, url}
178
- * family, "prime" is that family with env values as {"env": "NAME"} references
179
- * and "mastracode" is that family read by its keys alone, type ignored.
178
+ * family, "prime" is that family with env values as {"env": "NAME"} references,
179
+ * "mastracode" is that family read by its keys alone, type ignored, and "pi"
180
+ * is that family without sse that keeps the entry fields it doesn't manage.
180
181
  */
181
- dialect: "standard" | "antigravity" | "mastracode" | "opencode" | "prime" | "vscode";
182
+ dialect: "standard" | "antigravity" | "mastracode" | "opencode" | "pi" | "prime" | "vscode";
182
183
  }
183
184
  interface HarnessDetection {
184
185
  /** Environment variables that indicate running inside this agent. */
@@ -379,6 +380,10 @@ interface McpConfigListing {
379
380
  declare class McpEnvError extends Error {
380
381
  readonly name = "McpEnvError";
381
382
  }
383
+ /** Thrown when the target dialect cannot carry a server's transport. */
384
+ declare class McpTransportError extends Error {
385
+ readonly name = "McpTransportError";
386
+ }
382
387
  /**
383
388
  * Lists the MCP servers a harness has configured, per declared config file.
384
389
  * Missing files come back with `exists: false`; unparsable ones carry `error`.
@@ -608,5 +613,5 @@ interface SkillsSyncReport {
608
613
  */
609
614
  declare function syncSkills(harnesses: readonly Harness[], check?: boolean, options?: ResolveOptions): SkillsSyncReport;
610
615
  //#endregion
611
- export { version as $, AvailableModel as A, InvokeResult as B, masterMcpPath as C, syncMcpServers as D, removeMcpServer as E, HarnessId as F, PathCandidate as G, ListModelsResult as H, HarnessInvocation as I, PromptTemplateSyncTarget as J, PathCategory as K, HarnessInvocationModes as L, EvidenceLevel as M, HarnessCapabilities as N, Harness as O, HarnessDetection as P, StorageDescriptor as Q, HarnessModelListing as R, listMcpServers as S, readMasterMcpServers as T, McpConfigFile as U, ListModelsOptions as V, McpServerConfig as W, ResolvedPaths as X, ResolveOptions as Y, SkillsSyncTarget as Z, McpConfigListing as _, PromptSyncAction as a, SyncTargetResult as b, PromptTemplateTargetResult as c, AgentsConfig as d, AgentsSyncAction as f, syncAgentsFiles as g, readAgentsConfig as h, syncSkills as i, EnvOverride as j, HarnessConstructor as k, syncPromptTemplates as l, AgentsTargetResult as m, SkillsSyncReport as n, PromptSyncReport as o, AgentsSyncReport as p, Platform as q, SkillsSyncTargetResult as r, PromptSyncTargetResult as s, SkillsSyncAction as t, AgentsCompanionTargetResult as u, McpEnvError as v, parseJsonc as w, addMcpServer as x, SyncReport as y, InvokeOptions as z };
616
+ export { StorageDescriptor as $, HarnessConstructor as A, InvokeOptions as B, listMcpServers as C, removeMcpServer as D, readMasterMcpServers as E, HarnessDetection as F, McpServerConfig as G, ListModelsOptions as H, HarnessId as I, Platform as J, PathCandidate as K, HarnessInvocation as L, EnvOverride as M, EvidenceLevel as N, syncMcpServers as O, HarnessCapabilities as P, SkillsSyncTarget as Q, HarnessInvocationModes as R, addMcpServer as S, parseJsonc as T, ListModelsResult as U, InvokeResult as V, McpConfigFile as W, ResolveOptions as X, PromptTemplateSyncTarget as Y, ResolvedPaths as Z, McpConfigListing as _, PromptSyncAction as a, SyncReport as b, PromptTemplateTargetResult as c, AgentsConfig as d, version as et, AgentsSyncAction as f, syncAgentsFiles as g, readAgentsConfig as h, syncSkills as i, AvailableModel as j, Harness as k, syncPromptTemplates as l, AgentsTargetResult as m, SkillsSyncReport as n, PromptSyncReport as o, AgentsSyncReport as p, PathCategory as q, SkillsSyncTargetResult as r, PromptSyncTargetResult as s, SkillsSyncAction as t, AgentsCompanionTargetResult as u, McpEnvError as v, masterMcpPath as w, SyncTargetResult as x, McpTransportError as y, HarnessModelListing as z };
612
617
  //# sourceMappingURL=skills-sync.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skills-sync.d.mts","names":[],"sources":["../../src/types.ts","../../src/harness.ts","../../src/mcp-servers.ts","../../src/agents-sync.ts","../../src/prompt-sync.ts","../../src/directory-link.ts","../../src/skills-sync.ts"],"mappings":";cAEa;KAED;KAcA;KACA;UAEK;EACf;EACA;EACA,OAAO;EACP,YAAY;EACZ;;;KAIU;;;;;UAcK,oBAAoB;EACnC;;EAEA,WAAW;;;UAII,yBAAyB;EACxC;;;UAIe,iCAAiC;EAChD;EACA;;UAGe;EACf;EACA,OAAO;EACP;;UAGe;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;UAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA;EACA,OAAO;EACP;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;;;;;EAKA;EACA,OAAO;EACP;;;UAIe;EACf;EACA;;EAEA;EACA;EACA;EACA;;EAEA;;;UAIe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA,SAAS;;UAGM;EACf;EACA,MAAM;;EAEN;;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ync.d.mts","names":[],"sources":["../../src/types.ts","../../src/harness.ts","../../src/mcp-servers.ts","../../src/agents-sync.ts","../../src/prompt-sync.ts","../../src/directory-link.ts","../../src/skills-sync.ts"],"mappings":";cAEa;KAED;KAcA;KACA;UAEK;EACf;EACA;EACA,OAAO;EACP,YAAY;EACZ;;;KAIU;;;;;UAcK,oBAAoB;EACnC;;EAEA,WAAW;;;UAII,yBAAyB;EACxC;;;UAIe,iCAAiC;EAChD;EACA;;UAGe;EACf;EACA,OAAO;EACP;;UAGe;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;UAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;EAMA;EACA,OAAO;EACP;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;;;;;EAKA;EACA,OAAO;EACP;;;UAIe;EACf;EACA;;EAEA;EACA;EACA;EACA;;EAEA;;;UAIe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA,SAAS;;UAGM;EACf;EACA,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;;EAEA,SAAS;;EAET;;UAGe;EACf;EACA;EACA;EACA;;EAEA;EACA;;EAEA;;EAEA;;;UAIe,yBAAyB;;EAExC,QAAQ;;;UAIO;EACf;EACA;EACA;EACA;;;;;;EAMA,MAAM;EACN;EACA,UAAU;;EAEV;;;UAIe,sBAAsB;EACrC;;EAEA;;;;;;;EAOA;;UAGe;;EAEf;;EAEA;;UAGe;EACf;EACA;EACA,WAAW;;EAEX;;UAGe;EACf,QAAQ;EACR,UAAU;EACV,cAAc;EACd,QAAQ;EACR,kBAAkB;EAClB,UAAU;EACV,iBAAiB;EACjB,0BAA0B;EAC1B,OAAO;;EAEP,MAAM;;;;KC1LH,oBAAoB;EACvB;EACA;EACA;EACA;;uBAoToB;oBACF,IAAI;oBACJ;oBACA;oBACA,QAAQ;oBACR,UAAU;oBACV,aAAa;oBACb,cAAc;oBACd,QAAQ;;W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BAAoB,WACpB,UAAS,iBACR;;;;UCvhCc;;EAEf;;EAEA;;EAEA;;EAEA;;KAGU;;UAGK;WACN;WACA;WACA,QAAQ,QAAQ;;WAEhB;;;UAIM;EACf;EACA;EACA,QAAQ;;EAER;;EAEA,sBAAsB;;;UAIP;EACf;EACA;EACA,SAAS;;;;;;;;iBA2FK,iBAAiB,UAAS,iBAAsB;;;;;;;;;;iBAuNhD,gBACd,oBAAoB,WACpB,iBACA,UAAS,iBACR;;;KCjWS;;UAWK;WACN;WACA;WACA;WACA,QAAQ;;WAER;;;UAIM;WACN;WACA;WACA,SAAS;;WAET,SAAS;;WAET;WACA,oBAAoB;;;UAId;WACN;WACA;WACA;WACA,kBAAkB;;;;;;;;;;;;;;iBA6Sb,oBACd,oBAAoB,WACpB,iBACA,UAAS,iBACR;;;KCtVS;;;KCjBA,mBAAmB;;UAGd;WACN;WACA;WACA,QAAQ;;WAER;;;UAIM;WACN;WACA;;WAEA;WACA,kBAAkB;;;;;;;;;;;;;;iBAiEb,WACd,oBAAoB,WACpB,iBACA,UAAS,iBACR"}
@@ -2036,6 +2036,30 @@ var MastraCode = class extends Harness {
2036
2036
  };
2037
2037
  //#endregion
2038
2038
  //#region src/harnesses/omp.ts
2039
+ function isRecord(value) {
2040
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2041
+ }
2042
+ function parseOmpModels(stdout) {
2043
+ let parsed;
2044
+ try {
2045
+ parsed = JSON.parse(stdout);
2046
+ } catch {
2047
+ throw new Error(`Unexpected OMP model-list output: ${JSON.stringify(stdout.slice(0, 200))}`);
2048
+ }
2049
+ if (!isRecord(parsed) || !Array.isArray(parsed["models"])) throw new Error(`Unexpected OMP model-list output: ${JSON.stringify(stdout.slice(0, 200))}`);
2050
+ return parsed["models"].map((entry) => {
2051
+ if (!isRecord(entry) || typeof entry["provider"] !== "string" || typeof entry["id"] !== "string") throw new Error(`Unexpected OMP model-list entry: ${JSON.stringify(entry)}`);
2052
+ const { contextWindow, maxTokens, reasoning, input } = entry;
2053
+ return {
2054
+ provider: entry["provider"],
2055
+ id: entry["id"],
2056
+ ...typeof contextWindow === "number" ? { contextWindow } : {},
2057
+ ...typeof maxTokens === "number" ? { maxOutputTokens: maxTokens } : {},
2058
+ ...typeof reasoning === "boolean" ? { thinking: reasoning } : {},
2059
+ ...Array.isArray(input) ? { images: input.includes("image") } : {}
2060
+ };
2061
+ });
2062
+ }
2039
2063
  var Omp = class extends Harness {
2040
2064
  id = "omp";
2041
2065
  name = "OMP (oh-my-pi)";
@@ -2225,6 +2249,27 @@ var Omp = class extends Harness {
2225
2249
  level: "official",
2226
2250
  note: "Add --mode json for structured event output. --no-tools disables only OMP's bundled tools, so it cannot provide an advisor mode without tools."
2227
2251
  };
2252
+ modelListing = {
2253
+ args: [
2254
+ "models",
2255
+ "--json",
2256
+ "--kind",
2257
+ "chat",
2258
+ "--no-extensions"
2259
+ ],
2260
+ searchArgs: [
2261
+ "models",
2262
+ "find",
2263
+ "--json",
2264
+ "--kind",
2265
+ "chat",
2266
+ "--no-extensions",
2267
+ "--",
2268
+ "{search}"
2269
+ ],
2270
+ level: "official",
2271
+ note: "Lists chat models with configured provider authentication as JSON; find matches a substring of the provider, id or name, ignoring case. --no-extensions keeps extension load errors out of the run; verified with 18.4.10."
2272
+ };
2228
2273
  mcpConfigs = [{
2229
2274
  path: "~/.omp/agent/mcp.json",
2230
2275
  scope: "user",
@@ -2260,6 +2305,9 @@ var Omp = class extends Harness {
2260
2305
  envVars: ["OMP_PROFILE", "PI_CODING_AGENT_DIR"],
2261
2306
  projectMarkers: [".omp"]
2262
2307
  };
2308
+ parseModelListingOutput(stdout) {
2309
+ return parseOmpModels(stdout);
2310
+ }
2263
2311
  };
2264
2312
  //#endregion
2265
2313
  //#region src/harnesses/opencode.ts
@@ -2619,6 +2667,23 @@ var Pi = class extends Harness {
2619
2667
  level: "official",
2620
2668
  note: "Lists models with configured provider authentication; accepts an optional fuzzy search."
2621
2669
  };
2670
+ mcpConfigs = [{
2671
+ path: "~/.pi/agent/mcp.json",
2672
+ scope: "user",
2673
+ level: "official",
2674
+ format: "json",
2675
+ key: ["mcpServers"],
2676
+ dialect: "pi",
2677
+ note: "Read by the built-in MCP extension, which -builtin:mcp in the extensions setting turns off."
2678
+ }, {
2679
+ path: ".pi/mcp.json",
2680
+ scope: "project",
2681
+ level: "official",
2682
+ format: "json",
2683
+ key: ["mcpServers"],
2684
+ dialect: "pi",
2685
+ note: "Read only after the project is trusted."
2686
+ }];
2622
2687
  envOverrides = [{
2623
2688
  variable: "PI_CODING_AGENT_DIR",
2624
2689
  path: "~/.pi/agent",
@@ -2999,6 +3064,9 @@ const ENV_REFERENCE = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;
2999
3064
  var McpEnvError = class extends Error {
3000
3065
  name = "McpEnvError";
3001
3066
  };
3067
+ var McpTransportError = class extends Error {
3068
+ name = "McpTransportError";
3069
+ };
3002
3070
  function envReference(value) {
3003
3071
  return ENV_REFERENCE.exec(value)?.[1];
3004
3072
  }
@@ -3114,6 +3182,7 @@ function resolveEnvReferences(server, dialect) {
3114
3182
  }
3115
3183
  function shapeForDialect(server, dialect) {
3116
3184
  const shaped = resolveEnvReferences(server, dialect);
3185
+ if (dialect === "pi" && shaped.transport === "sse") throw new McpTransportError(`${server.name}: Pi takes stdio and streamable HTTP servers, not sse; point url at the server's streamable HTTP endpoint`);
3117
3186
  if (dialect !== "mastracode") return shaped;
3118
3187
  return compact({
3119
3188
  ...shaped,
@@ -3128,6 +3197,26 @@ function denormalizeEntry(server, dialect) {
3128
3197
  if (dialect === "prime") return denormalizePrime(server);
3129
3198
  return denormalizeStandard(server);
3130
3199
  }
3200
+ const STANDARD_FIELDS = /* @__PURE__ */ new Set([
3201
+ "type",
3202
+ "command",
3203
+ "args",
3204
+ "env",
3205
+ "url",
3206
+ "httpUrl",
3207
+ "headers",
3208
+ "enabled"
3209
+ ]);
3210
+ function replacementEntry(previous, server, dialect) {
3211
+ const entry = denormalizeEntry(server, dialect);
3212
+ if (dialect !== "pi" || !isObjectRecord(previous)) return entry;
3213
+ if (normalizeStandard(server.name, previous).transport !== server.transport) return entry;
3214
+ const kept = Object.entries(previous).filter(([key]) => !STANDARD_FIELDS.has(key));
3215
+ return {
3216
+ ...entry,
3217
+ ...Object.fromEntries(kept)
3218
+ };
3219
+ }
3131
3220
  function listingBase(entry, path) {
3132
3221
  return compact({
3133
3222
  path,
@@ -3268,7 +3357,7 @@ function addMcpServer(harness, server, scope = "user", options = {}) {
3268
3357
  const map = drill(root, entry.key, "create");
3269
3358
  if (!map) throw new Error(`Config at ${path} has a non-object at ${entry.key.join(".")}`);
3270
3359
  const replaced = Object.hasOwn(map, server.name);
3271
- map[server.name] = denormalizeEntry(resolved, entry.dialect);
3360
+ map[server.name] = replacementEntry(map[server.name], resolved, entry.dialect);
3272
3361
  writeAtomically(path, `${JSON.stringify(root, null, 2)}\n`);
3273
3362
  return {
3274
3363
  path,
@@ -3474,6 +3563,9 @@ function withdrawMasterServersFromExcludedHarness(harness, existing, masterNames
3474
3563
  results
3475
3564
  };
3476
3565
  }
3566
+ function cannotHold(error) {
3567
+ return error instanceof McpEnvError || error instanceof McpTransportError;
3568
+ }
3477
3569
  function syncIncludedHarness(harness, master, existing, masterNames, initialPath, options) {
3478
3570
  const results = [];
3479
3571
  let path = initialPath;
@@ -3494,7 +3586,7 @@ function syncIncludedHarness(harness, master, existing, masterNames, initialPath
3494
3586
  action: written.replaced ? "replaced" : "added"
3495
3587
  });
3496
3588
  } catch (error) {
3497
- if (!(error instanceof McpEnvError)) throw error;
3589
+ if (!cannotHold(error)) throw error;
3498
3590
  results.push({
3499
3591
  name: server.name,
3500
3592
  action: "skipped",
@@ -4149,6 +4241,6 @@ function syncSkills(harnesses, check = false, options = {}) {
4149
4241
  };
4150
4242
  }
4151
4243
  //#endregion
4152
- export { agntnDataDir as C, agntnConfigDir as S, getHarness as _, McpEnvError as a, registerHarness as b, masterMcpPath as c, removeMcpServer as d, syncMcpServers as f, getAllHarnesses as g, detectProjectHarnesses as h, syncAgentsFiles as i, parseJsonc as l, detectHarnessFromEnv as m, syncPromptTemplates as n, addMcpServer as o, detectHarness as p, readAgentsConfig as r, listMcpServers as s, syncSkills as t, readMasterMcpServers as u, isHarnessId as v, resolvePathTemplate as w, Harness as x, listHarnesses as y };
4244
+ export { agntnConfigDir as C, Harness as S, resolvePathTemplate as T, getAllHarnesses as _, McpEnvError as a, listHarnesses as b, listMcpServers as c, readMasterMcpServers as d, removeMcpServer as f, detectProjectHarnesses as g, detectHarnessFromEnv as h, syncAgentsFiles as i, masterMcpPath as l, detectHarness as m, syncPromptTemplates as n, McpTransportError as o, syncMcpServers as p, readAgentsConfig as r, addMcpServer as s, syncSkills as t, parseJsonc as u, getHarness as v, agntnDataDir as w, registerHarness as x, isHarnessId as y };
4153
4245
 
4154
4246
  //# sourceMappingURL=skills-sync.mjs.map