pi-better-harness 0.35.2 → 0.35.3

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.
@@ -33,6 +33,7 @@ export interface SubagentConfig extends TimingSettings {
33
33
  /**
34
34
  * Provider → extension package(s) that authenticate it. Model auth is not
35
35
  * tool-shaped: `xai/grok-4.5` needs pi-xai-oauth loaded whatever the tools.
36
+ * A built-in entry covers `ollama-cloud`; an entry here replaces it.
36
37
  */
37
38
  providerExtensions?: Record<string, string | string[]> | null;
38
39
  /**
@@ -512,13 +512,19 @@ so a package that backs no requested tool never loads. With the default
512
512
  allowlist (`read, bash, edit, write, web_search, web_fetch`) exactly one package
513
513
  loads — the web-tools one — and `web_fetch` works normally.
514
514
 
515
- Two maps in `config.json` drive it:
515
+ Two maps in `config.json` drive it, with a built-in default for provider auth:
516
516
 
517
517
  - `toolExtensions` — tool name → package(s) providing it. Built-ins (`read`,
518
518
  `bash`, `edit`, `write`) need no entry.
519
519
  - `providerExtensions` — provider → auth package. Model auth is not tool-shaped:
520
520
  `xai/grok-4.5` needs `pi-xai-oauth` loaded whatever tools it was granted.
521
521
 
522
+ The built-in map loads `pi-ollama-cloud` for `ollama-cloud` models, so a role
523
+ resolved against that provider works without a manual entry. An entry for the
524
+ same provider replaces the built-in one, and an empty list disables it. A mapped
525
+ package that is not installed still fails the launch with the explicit
526
+ missing-extension error rather than starting without provider auth.
527
+
522
528
  Ask for a tool with no mapping and the spawn still succeeds, but says so at
523
529
  launch — the tool simply will not exist in the child.
524
530
 
@@ -38,6 +38,17 @@ export const BUILTIN_TOOLS = ["read", "bash", "edit", "write"];
38
38
  /** Marker spec meaning "this extension's own package" (for allow_nested). */
39
39
  export const SELF_SPEC = "self";
40
40
 
41
+ /**
42
+ * Provider packages Pi does not ship itself. A provider's models exist in a
43
+ * child only when the package registering them is loaded; without this map, a
44
+ * role that resolves e.g. `ollama-cloud/...` in the foreground fails in its
45
+ * isolated child with "model not found". User `providerExtensions` entries
46
+ * replace these per provider (an empty list disables the built-in entry).
47
+ */
48
+ export const BUILTIN_PROVIDER_EXTENSIONS = {
49
+ "ollama-cloud": "npm:pi-ollama-cloud",
50
+ };
51
+
41
52
  /** Split "xai/grok-4.5" -> "xai". Returns undefined when there is no provider. */
42
53
  export function providerOf(model) {
43
54
  if (typeof model !== "string") return undefined;
@@ -116,10 +127,13 @@ export function resolveExtensions(a = {}) {
116
127
  }
117
128
 
118
129
  // Model auth is not tool-shaped: xai/grok needs pi-xai-oauth loaded or the
119
- // child cannot authenticate at all, whatever tools it was granted.
130
+ // child cannot authenticate at all, whatever tools it was granted. A user
131
+ // entry for a provider wins over the built-in one, including an empty list
132
+ // that opts out of loading the provider's package.
133
+ const providerMap = { ...BUILTIN_PROVIDER_EXTENSIONS, ...(cfg.providerExtensions ?? {}) };
120
134
  const provider = providerOf(a.model);
121
135
  if (provider) {
122
- for (const spec of toSpecList((cfg.providerExtensions ?? {})[provider])) {
136
+ for (const spec of toSpecList(providerMap[provider])) {
123
137
  add(spec, `provider:${provider}`);
124
138
  }
125
139
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-subagents",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "Pi extension for detached, sandboxed subagent runs that keep the foreground session free.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.35.2",
3
+ "version": "0.35.3",
4
4
  "description": "Pi extension bundle for a write sandbox, subagents, background tasks, SSH, goals, and Outcome & Todo.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -58,7 +58,7 @@
58
58
  "pi-better-goal": "0.10.4",
59
59
  "pi-better-sandbox": "0.14.0",
60
60
  "pi-better-ssh": "0.1.4",
61
- "pi-better-subagents": "0.23.2",
61
+ "pi-better-subagents": "0.23.3",
62
62
  "proper-lockfile": "^4.1.2",
63
63
  "shell-quote": "1.12.0",
64
64
  "smol-toml": "1.9.0",