@herbertgao/pi-extensions 2026.11.0 → 2026.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +768 -0
  2. package/README.md +7 -7
  3. package/THIRD_PARTY_NOTICES.md +2 -2
  4. package/extensions/clef.mjs +1 -1
  5. package/node_modules/@herbertgao/pi-agency/CHANGELOG.md +19 -0
  6. package/node_modules/@herbertgao/pi-agency/package.json +4 -2
  7. package/node_modules/@herbertgao/pi-agency/src/index.ts +1 -1
  8. package/node_modules/@herbertgao/pi-bark/CHANGELOG.md +52 -0
  9. package/node_modules/@herbertgao/pi-bark/package.json +2 -1
  10. package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +207 -0
  11. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +7 -5
  12. package/node_modules/@herbertgao/pi-cc-extensions/README.md +10 -7
  13. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +20 -0
  14. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +61 -6
  15. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +11 -16
  16. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/index.ts +60 -11
  17. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +29 -11
  18. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer-layout.ts +54 -6
  19. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +23 -5
  20. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/session-tokens.ts +52 -0
  21. package/node_modules/@herbertgao/pi-cc-extensions/package.json +5 -4
  22. package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +13 -0
  23. package/node_modules/@herbertgao/pi-impeccable/package.json +2 -1
  24. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
  25. package/node_modules/@herbertgao/pi-subagents/README.md +43 -33
  26. package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +1 -1
  27. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +2 -0
  28. package/node_modules/@herbertgao/pi-subagents/package.json +4 -4
  29. package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +9 -8
  30. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +70 -9
  31. package/node_modules/@herbertgao/pi-subagents/src/agent-record-entry.ts +167 -0
  32. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +156 -13
  33. package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +52 -8
  34. package/node_modules/@herbertgao/pi-subagents/src/default-agents.ts +3 -4
  35. package/node_modules/@herbertgao/pi-subagents/src/index.ts +153 -56
  36. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +3 -2
  37. package/node_modules/@herbertgao/pi-subagents/src/status-note.ts +3 -1
  38. package/node_modules/@herbertgao/pi-subagents/src/types.ts +5 -0
  39. package/node_modules/@herbertgao/pi-subagents/src/workflow/host.ts +88 -6
  40. package/node_modules/@herbertgao/pi-subagents/src/workflow/progress.ts +3 -2
  41. package/node_modules/@herbertgao/sol-pi/CHANGELOG.md +84 -0
  42. package/node_modules/@herbertgao/sol-pi/README.md +3 -3
  43. package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +4 -4
  44. package/node_modules/@herbertgao/sol-pi/agents-install.md +3 -3
  45. package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +1 -1
  46. package/node_modules/@herbertgao/sol-pi/package.json +2 -1
  47. package/node_modules/pi-provider-qoder/README.md +40 -0
  48. package/node_modules/pi-provider-qoder/dist/index.js +69 -1
  49. package/node_modules/pi-provider-qoder/package.json +4 -3
  50. package/node_modules/pi-typesafe/README.md +3 -3
  51. package/node_modules/pi-typesafe/dist/auth.d.ts +21 -4
  52. package/node_modules/pi-typesafe/dist/auth.js +32 -7
  53. package/node_modules/pi-typesafe/dist/backends.d.ts +2 -2
  54. package/node_modules/pi-typesafe/dist/backends.js +9 -0
  55. package/node_modules/pi-typesafe/dist/client.js +7 -12
  56. package/node_modules/pi-typesafe/dist/errors.d.ts +3 -2
  57. package/node_modules/pi-typesafe/dist/errors.js +12 -10
  58. package/node_modules/pi-typesafe/dist/extension.js +14 -10
  59. package/node_modules/pi-typesafe/package.json +1 -1
  60. package/package.json +10 -9
@@ -23,20 +23,22 @@ function retryAfterSeconds(error) {
23
23
  return Number.isSafeInteger(seconds) && seconds >= 0 ? seconds : undefined;
24
24
  }
25
25
  /**
26
- * Classify an error into a message safe to display. `backend` names the key variable the 401 advice tells the user
27
- * to check and selects the 402 wording; omitting it keeps the one-argument call and assumes the default TypeSafe key.
26
+ * Classify an error into a message safe to display. The subject of every message is the backend that answered — its
27
+ * `label`, or the caller's endpoint label — falling back to TypeSafe when no backend is passed. `backend` also names
28
+ * the key variable the 401 advice tells the user to check and selects the 402 wording.
28
29
  */
29
30
  export function safeError(error, backend) {
30
31
  if (error instanceof TypeSafeIntegrationError)
31
32
  return error;
33
+ const config = backend === undefined ? undefined : typeof backend === "string" ? backendConfig(backend) : backend;
34
+ const subject = config?.label ?? "TypeSafe";
35
+ const keyEnv = config?.keyEnv ?? TYPESAFE_KEY_ENV;
36
+ const openrouter = config !== undefined && config.host === DECISIONS_BACKENDS.openrouter.host;
32
37
  if (error instanceof APIUserAbortError)
33
- return new TypeSafeIntegrationError("aborted", "TypeSafe request cancelled; an already submitted request may still be billed.");
38
+ return new TypeSafeIntegrationError("aborted", `${subject} request cancelled; an already submitted request may still be billed.`);
34
39
  if (error instanceof APITimeoutError)
35
- return new TypeSafeIntegrationError("timeout", "TypeSafe request timed out; it was not retried and may still be billed.");
40
+ return new TypeSafeIntegrationError("timeout", `${subject} request timed out; it was not retried and may still be billed.`);
36
41
  if (error instanceof APIError) {
37
- const config = backend === undefined ? undefined : typeof backend === "string" ? backendConfig(backend) : backend;
38
- const keyEnv = config?.keyEnv ?? TYPESAFE_KEY_ENV;
39
- const openrouter = config !== undefined && config.host === DECISIONS_BACKENDS.openrouter.host;
40
42
  const retry = error.status === 429 ? retryAfterSeconds(error) : undefined;
41
43
  const advice = error.status === 401 ? `Check ${keyEnv}.`
42
44
  : error.status === 402 ? (openrouter ? "Insufficient credits. Add credits at https://openrouter.ai/credits." : "Check your account balance.")
@@ -44,9 +46,9 @@ export function safeError(error, backend) {
44
46
  : error.status === 429 ? `Check your account quota and try again later.${retry === undefined ? "" : ` Retry after ${retry} seconds.`}`
45
47
  : error.status === 400 || error.status === 422 ? "Check the question format and model limits."
46
48
  : "Try again later or check the service status.";
47
- return new TypeSafeIntegrationError("http", `TypeSafe returned HTTP ${error.status}. ${advice} No automatic retry was made.`, error.status);
49
+ return new TypeSafeIntegrationError("http", `${subject} returned HTTP ${error.status}. ${advice} No automatic retry was made.`, error.status);
48
50
  }
49
51
  if (error instanceof APIConnectionError)
50
- return new TypeSafeIntegrationError("connection", "Could not complete the TypeSafe connection. No automatic retry was made.");
51
- return new TypeSafeIntegrationError("response", "TypeSafe returned an unreadable or unexpected response.");
52
+ return new TypeSafeIntegrationError("connection", `Could not complete the ${subject} connection. No automatic retry was made.`);
53
+ return new TypeSafeIntegrationError("response", `${subject} returned an unreadable or unexpected response.`);
52
54
  }
@@ -1,7 +1,7 @@
1
1
  import { Text } from "@earendil-works/pi-tui";
2
2
  import { BACKEND_ENV, DEFAULT_BACKEND, DECISIONS_BACKENDS, MODEL_ENV, backendFromEnvironment, backendHost, modelFromEnvironment, resolveBackend, sentModelId } from "./backends.js";
3
3
  import { createTypeSafe, DEFAULT_MAX_REQUESTS } from "./client.js";
4
- import { authState, clearAuthState, describeAuth } from "./auth.js";
4
+ import { authState, clearAuthState, describeAuth, isKeyRejection } from "./auth.js";
5
5
  import { clearStoredApiKey, credentialsPath, keySituation, keySourceLabel } from "./credentials.js";
6
6
  import { TypeSafeIntegrationError, safeError } from "./errors.js";
7
7
  import { loginWithPrompt } from "./login.js";
@@ -100,9 +100,9 @@ export default function typesafeExtension(pi) {
100
100
  const auth = describeAuth(authState({ backend }));
101
101
  // A backend name the registry does not know means no judgment can be sent at all, whether or not it is enabled.
102
102
  if (backendError !== undefined)
103
- callOut(ctx, `start:backend`, `${backendError} Judgments are skipped until ${BACKEND_ENV} names a valid backend or is unset.`);
103
+ callOut(ctx, `start:backend`, `${backendError} Judgments will fail until ${BACKEND_ENV} names a valid backend or is unset.`);
104
104
  else if (enabled && auth.level === "error")
105
- callOut(ctx, `start:${auth.level}`, `TypeSafe is enabled but judgments are skipped. ${auth.text}`);
105
+ callOut(ctx, `start:${auth.level}`, `TypeSafe is enabled but judgments will fail. ${auth.text}`);
106
106
  });
107
107
  pi.registerEntryRenderer("typesafe-result", (entry, { expanded }) => new Text(entry.data ? format(entry.data, expanded) : "TypeSafe · no result", 0, 0));
108
108
  pi.registerTool({
@@ -134,11 +134,15 @@ export default function typesafeExtension(pi) {
134
134
  return { content: [{ type: "text", text: JSON.stringify(result) }], details: result };
135
135
  }
136
136
  catch (error) {
137
- const safe = safeError(error);
138
- // Authentication degradation is louder than a single failed call: it means every later judgment is skipped.
139
- const rejected = safe.code === "http" && (safe.status === 401 || safe.status === 403);
140
- if (rejected || safe.code === "configuration") {
141
- callOut(ctx, `run:${safe.code}:${safe.status ?? ""}`, `TypeSafe is not authenticated (${safe.message}) Judgments will fail until the key is fixed.`);
137
+ const safe = safeError(error, backend);
138
+ // A 401 is about the key, so it outlives this call and is called out once; a 403 refuses one request and is
139
+ // only thrown. The client recorded the failure before throwing, so describeAuth describes that failure.
140
+ if (isKeyRejection(safe.status)) {
141
+ const auth = describeAuth(authState({ backend }));
142
+ callOut(ctx, `run:${safe.code}:${safe.status ?? ""}`, `${auth.text} Judgments will fail until the key is fixed.`);
143
+ }
144
+ else if (safe.code === "configuration") {
145
+ callOut(ctx, `run:configuration`, `${safe.message} Judgments will fail until that is fixed.`);
142
146
  }
143
147
  throw safe;
144
148
  }
@@ -205,7 +209,7 @@ export default function typesafeExtension(pi) {
205
209
  // one that names none, otherwise by the consent sentence itself. An unusable name sends nothing, so that
206
210
  // status names no model and quotes no consent.
207
211
  const route = backendError !== undefined
208
- ? `Backend: ${BACKEND_ENV} is invalid — ${backendError} Judgments are skipped.`
212
+ ? `Backend: ${BACKEND_ENV} is invalid — ${backendError} Judgments will fail.`
209
213
  : backendLine(backend);
210
214
  const version = backendError === undefined && !consent.namesModel ? `Model: ${sentModelId(backend, model)}.` : "";
211
215
  report([
@@ -311,7 +315,7 @@ export default function typesafeExtension(pi) {
311
315
  pi.appendEntry("typesafe-result", result);
312
316
  }
313
317
  catch (error) {
314
- report(safeError(error).message, "error");
318
+ report(safeError(error, backend).message, "error");
315
319
  }
316
320
  },
317
321
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-typesafe",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "TypeSafe AI (Jev) decisions for Pi: batched Choice/Score/Noul evaluation tool, terminal playground, and a typed API other extensions build on.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herbertgao/pi-extensions",
3
- "version": "2026.11.0",
3
+ "version": "2026.11.2",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "files": [
23
23
  "README.md",
24
+ "CHANGELOG.md",
24
25
  "LICENSE",
25
26
  "THIRD_PARTY_NOTICES.md",
26
27
  "extensions"
@@ -38,12 +39,12 @@
38
39
  "@ast-grep/cli": "0.51.0",
39
40
  "@ast-grep/napi": "^0.51.0",
40
41
  "@dietrichgebert/ponytail": "5.3.3",
41
- "@herbertgao/pi-agency": "0.1.2",
42
- "@herbertgao/pi-bark": "0.2.1",
43
- "@herbertgao/pi-cc-extensions": "1.0.12-local.1",
44
- "@herbertgao/pi-impeccable": "0.1.0",
45
- "@herbertgao/pi-subagents": "0.22.1-local.1",
46
- "@herbertgao/sol-pi": "0.4.2",
42
+ "@herbertgao/pi-agency": "0.1.3",
43
+ "@herbertgao/pi-bark": "0.2.2",
44
+ "@herbertgao/pi-cc-extensions": "1.0.13-local.1",
45
+ "@herbertgao/pi-impeccable": "0.1.1",
46
+ "@herbertgao/pi-subagents": "0.23.0-local.1",
47
+ "@herbertgao/sol-pi": "0.4.3",
47
48
  "@juicesharp/rpiv-ask-user-question": "2.15.0",
48
49
  "@juicesharp/rpiv-config": "^2.15.0",
49
50
  "@modelcontextprotocol/sdk": "^1.32.1",
@@ -75,8 +76,8 @@
75
76
  "pi-commandcode-provider": "0.7.11",
76
77
  "pi-lens": "4.4.8",
77
78
  "pi-next-cue": "1.0.8",
78
- "pi-provider-qoder": "0.6.8",
79
- "pi-typesafe": "0.13.1",
79
+ "pi-provider-qoder": "0.6.10",
80
+ "pi-typesafe": "0.14.0",
80
81
  "pi-web-access": "0.46.0",
81
82
  "pidusage": "^4.0.1",
82
83
  "promise.try": "^2.0.1",