@herbertgao/pi-extensions 2026.9.11 → 2026.9.13

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 (192) hide show
  1. package/README.md +4 -4
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/node_modules/@herbertgao/pi-cc-extensions/package.json +1 -1
  4. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
  5. package/node_modules/@herbertgao/pi-subagents/package.json +1 -1
  6. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +5 -4
  7. package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +39 -16
  8. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
  9. package/node_modules/@narumitw/pi-btw/README.md +21 -4
  10. package/node_modules/@narumitw/pi-btw/dist/index.ts +1668 -958
  11. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +4 -4
  12. package/node_modules/@narumitw/pi-btw/docs/workflows.md +10 -2
  13. package/node_modules/@narumitw/pi-btw/package.json +1 -1
  14. package/node_modules/@narumitw/pi-btw/src/btw.ts +17 -79
  15. package/node_modules/@narumitw/pi-btw/src/conversation-context.ts +74 -0
  16. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +196 -7
  17. package/node_modules/@narumitw/pi-btw/src/main-thread-updates.ts +40 -0
  18. package/node_modules/@narumitw/pi-btw/src/menu.ts +34 -2
  19. package/node_modules/@narumitw/pi-btw/src/settings.ts +49 -0
  20. package/node_modules/@narumitw/pi-btw/src/transcript-pager.ts +9 -1
  21. package/node_modules/@narumitw/pi-btw/src/workspace-layout.ts +559 -0
  22. package/node_modules/pi-mcp-adapter/CHANGELOG.md +62 -0
  23. package/node_modules/pi-mcp-adapter/README.md +75 -7
  24. package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +193 -0
  25. package/node_modules/pi-mcp-adapter/cli.js +56 -5
  26. package/node_modules/pi-mcp-adapter/commands.ts +96 -5
  27. package/node_modules/pi-mcp-adapter/config.ts +73 -6
  28. package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +22 -28
  29. package/node_modules/pi-mcp-adapter/direct-tools.ts +13 -5
  30. package/node_modules/pi-mcp-adapter/dist/abort.d.ts +2 -0
  31. package/node_modules/pi-mcp-adapter/dist/abort.js +36 -0
  32. package/node_modules/pi-mcp-adapter/dist/abort.js.map +1 -0
  33. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +6 -0
  34. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +194 -0
  35. package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +1 -0
  36. package/node_modules/pi-mcp-adapter/dist/config.d.ts +5 -0
  37. package/node_modules/pi-mcp-adapter/dist/config.js +75 -6
  38. package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -1
  39. package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +18 -0
  40. package/node_modules/pi-mcp-adapter/dist/consent-manager.js +88 -0
  41. package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +1 -0
  42. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +17 -0
  43. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +316 -0
  44. package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +1 -0
  45. package/node_modules/pi-mcp-adapter/dist/errors.d.ts +131 -0
  46. package/node_modules/pi-mcp-adapter/dist/errors.js +278 -0
  47. package/node_modules/pi-mcp-adapter/dist/errors.js.map +1 -0
  48. package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +8 -0
  49. package/node_modules/pi-mcp-adapter/dist/http-ca.js +88 -0
  50. package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +1 -0
  51. package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +15 -0
  52. package/node_modules/pi-mcp-adapter/dist/jev-client.js +340 -0
  53. package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +1 -0
  54. package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +77 -0
  55. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +2 -0
  56. package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +1 -0
  57. package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +22 -0
  58. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +85 -0
  59. package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +1 -0
  60. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +2 -0
  61. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +55 -0
  62. package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +1 -0
  63. package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +56 -0
  64. package/node_modules/pi-mcp-adapter/dist/lifecycle.js +410 -0
  65. package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +1 -0
  66. package/node_modules/pi-mcp-adapter/dist/logger.d.ts +51 -0
  67. package/node_modules/pi-mcp-adapter/dist/logger.js +131 -0
  68. package/node_modules/pi-mcp-adapter/dist/logger.js.map +1 -0
  69. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +26 -0
  70. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +103 -0
  71. package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +1 -0
  72. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +118 -0
  73. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +1098 -0
  74. package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +1 -0
  75. package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +168 -0
  76. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +1117 -0
  77. package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +1 -0
  78. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +7 -140
  79. package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +1 -1
  80. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +53 -0
  81. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +441 -0
  82. package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +1 -0
  83. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +148 -0
  84. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +689 -0
  85. package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +1 -0
  86. package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +6 -0
  87. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +166 -0
  88. package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +1 -0
  89. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +102 -0
  90. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +369 -0
  91. package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +1 -0
  92. package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +95 -0
  93. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +242 -0
  94. package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +1 -0
  95. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +2 -11
  96. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +1 -1
  97. package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +6 -0
  98. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +505 -0
  99. package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +1 -0
  100. package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +10 -0
  101. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +312 -0
  102. package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +1 -0
  103. package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +13 -0
  104. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +97 -0
  105. package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +1 -0
  106. package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +17 -0
  107. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +203 -0
  108. package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +1 -0
  109. package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +11 -0
  110. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +172 -0
  111. package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +1 -0
  112. package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +157 -0
  113. package/node_modules/pi-mcp-adapter/dist/server-manager.js +1743 -0
  114. package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +1 -0
  115. package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +34 -0
  116. package/node_modules/pi-mcp-adapter/dist/session-approvals.js +140 -0
  117. package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +1 -0
  118. package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +26 -0
  119. package/node_modules/pi-mcp-adapter/dist/session-recovery.js +142 -0
  120. package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +1 -0
  121. package/node_modules/pi-mcp-adapter/dist/state.d.ts +73 -0
  122. package/node_modules/pi-mcp-adapter/dist/state.js +2 -0
  123. package/node_modules/pi-mcp-adapter/dist/state.js.map +1 -0
  124. package/node_modules/pi-mcp-adapter/dist/types.d.ts +36 -0
  125. package/node_modules/pi-mcp-adapter/dist/types.js +18 -0
  126. package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -1
  127. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +17 -0
  128. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +219 -0
  129. package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +1 -0
  130. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +15 -0
  131. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +85 -0
  132. package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +1 -0
  133. package/node_modules/pi-mcp-adapter/dist/utils.d.ts +1 -0
  134. package/node_modules/pi-mcp-adapter/dist/utils.js +13 -0
  135. package/node_modules/pi-mcp-adapter/dist/utils.js.map +1 -1
  136. package/node_modules/pi-mcp-adapter/elicitation-handler.ts +29 -19
  137. package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +85 -0
  138. package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +34 -0
  139. package/node_modules/pi-mcp-adapter/index.ts +129 -6
  140. package/node_modules/pi-mcp-adapter/init.ts +6 -19
  141. package/node_modules/pi-mcp-adapter/jev-client.ts +273 -0
  142. package/node_modules/pi-mcp-adapter/jev-contracts.ts +53 -0
  143. package/node_modules/pi-mcp-adapter/jev-key-store.ts +79 -0
  144. package/node_modules/pi-mcp-adapter/lifecycle.ts +14 -3
  145. package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +7 -142
  146. package/node_modules/pi-mcp-adapter/mcp-code.ts +119 -11
  147. package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +4 -0
  148. package/node_modules/pi-mcp-adapter/mcp-references.ts +5 -3
  149. package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +5 -0
  150. package/node_modules/pi-mcp-adapter/mcp-tasks.ts +467 -0
  151. package/node_modules/pi-mcp-adapter/metadata-cache.ts +2 -13
  152. package/node_modules/pi-mcp-adapter/namespace-tools.ts +1 -1
  153. package/node_modules/pi-mcp-adapter/package.json +17 -9
  154. package/node_modules/pi-mcp-adapter/proxy-modes.ts +319 -166
  155. package/node_modules/pi-mcp-adapter/request-headers-command.ts +6 -3
  156. package/node_modules/pi-mcp-adapter/search-ranking.ts +38 -7
  157. package/node_modules/pi-mcp-adapter/secure-keyring.ts +170 -0
  158. package/node_modules/pi-mcp-adapter/semantic-search.ts +186 -0
  159. package/node_modules/pi-mcp-adapter/server-manager.ts +293 -50
  160. package/node_modules/pi-mcp-adapter/session-approvals.ts +14 -0
  161. package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +2 -0
  162. package/node_modules/pi-mcp-adapter/state.ts +3 -1
  163. package/node_modules/pi-mcp-adapter/tool-approval.ts +26 -4
  164. package/node_modules/pi-mcp-adapter/tool-metadata.ts +6 -14
  165. package/node_modules/pi-mcp-adapter/tool-registrar.ts +8 -6
  166. package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +4 -1
  167. package/node_modules/pi-mcp-adapter/types.ts +53 -0
  168. package/node_modules/pi-mcp-adapter/ui-server.ts +17 -9
  169. package/node_modules/pi-mcp-adapter/utils.ts +16 -0
  170. package/node_modules/pi-multi-account/CHANGELOG.md +23 -0
  171. package/node_modules/pi-multi-account/README.md +38 -11
  172. package/node_modules/pi-multi-account/index.ts +371 -96
  173. package/node_modules/pi-multi-account/package.json +5 -4
  174. package/node_modules/pi-multi-account/provider-payload-stream.ts +36 -28
  175. package/node_modules/pi-multi-account/usage.ts +31 -2
  176. package/node_modules/pi-typesafe/README.md +3 -1
  177. package/node_modules/pi-typesafe/dist/auth.d.ts +10 -3
  178. package/node_modules/pi-typesafe/dist/auth.js +13 -7
  179. package/node_modules/pi-typesafe/dist/backends.d.ts +31 -0
  180. package/node_modules/pi-typesafe/dist/backends.js +33 -0
  181. package/node_modules/pi-typesafe/dist/client.d.ts +3 -9
  182. package/node_modules/pi-typesafe/dist/client.js +63 -39
  183. package/node_modules/pi-typesafe/dist/credentials.d.ts +11 -5
  184. package/node_modules/pi-typesafe/dist/credentials.js +15 -8
  185. package/node_modules/pi-typesafe/dist/extension.js +4 -1
  186. package/node_modules/pi-typesafe/dist/index.d.ts +1 -1
  187. package/node_modules/pi-typesafe/dist/index.js +1 -1
  188. package/node_modules/pi-typesafe/dist/login.d.ts +13 -7
  189. package/node_modules/pi-typesafe/dist/login.js +17 -8
  190. package/node_modules/pi-typesafe/dist/schema.js +19 -13
  191. package/node_modules/pi-typesafe/package.json +1 -1
  192. package/package.json +11 -10
@@ -1,4 +1,5 @@
1
1
  import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
+ import type { TypeSafeBackend } from "./backends.js";
2
3
  import type { KeySource } from "./credentials.js";
3
4
  export interface LoginResult {
4
5
  /** Where the verified key was saved. */
@@ -7,9 +8,10 @@ export interface LoginResult {
7
8
  models: number;
8
9
  }
9
10
  /**
10
- * Prompt for a key (hidden input), verify it with a model listing, and store it for every pi-typesafe consumer.
11
- * Resolves to undefined when the user cancels. Rejects with TypeSafeIntegrationError for an invalid or unverifiable key.
12
- * Refuses when TYPESAFE_API_KEY is set, because the environment would shadow the stored key.
11
+ * Prompt for a TypeSafe key (hidden input), verify it against api.typesafe.ai with a model listing, and store it for
12
+ * every pi-typesafe consumer. Resolves to undefined when the user cancels. Rejects with TypeSafeIntegrationError for an
13
+ * invalid or unverifiable key. Refuses when TYPESAFE_API_KEY is set, because the environment would shadow the stored
14
+ * key. Other backends have no login: their key is an environment variable only.
13
15
  */
14
16
  export declare function loginWithPrompt(ctx: ExtensionCommandContext): Promise<LoginResult | undefined>;
15
17
  export type EnsureApiKeyResult = {
@@ -20,8 +22,12 @@ export type EnsureApiKeyResult = {
20
22
  login: LoginResult;
21
23
  };
22
24
  /**
23
- * Use the configured key if there is one; otherwise run the login prompt. `undefined` means the user cancelled.
24
- * A store that must not be read throws `configuration` with the reason instead of prompting, so a permissions
25
- * problem stays visible; the result shape is frozen for existing callers.
25
+ * Use the configured key for the backend if there is one; otherwise run the login prompt. `undefined` means the user
26
+ * cancelled. A store that must not be read throws `configuration` with the reason instead of prompting, so a
27
+ * permissions problem stays visible; the result shape is frozen for existing callers. A backend without a login store
28
+ * (every backend except TypeSafe) throws `configuration` naming its environment variable instead of prompting, because
29
+ * the prompt would verify the key against the wrong service and store it where the TypeSafe key lives.
26
30
  */
27
- export declare function ensureApiKey(ctx: ExtensionCommandContext): Promise<EnsureApiKeyResult | undefined>;
31
+ export declare function ensureApiKey(ctx: ExtensionCommandContext, options?: {
32
+ backend?: TypeSafeBackend;
33
+ }): Promise<EnsureApiKeyResult | undefined>;
@@ -1,11 +1,13 @@
1
+ import { DEFAULT_BACKEND, backendConfig, usesTypesafeKey } from "./backends.js";
1
2
  import { createTypeSafe } from "./client.js";
2
3
  import { keySituation, normalizeApiKey, storeApiKey } from "./credentials.js";
3
4
  import { TypeSafeIntegrationError } from "./errors.js";
4
5
  import { promptForApiKey } from "./key-prompt.js";
5
6
  /**
6
- * Prompt for a key (hidden input), verify it with a model listing, and store it for every pi-typesafe consumer.
7
- * Resolves to undefined when the user cancels. Rejects with TypeSafeIntegrationError for an invalid or unverifiable key.
8
- * Refuses when TYPESAFE_API_KEY is set, because the environment would shadow the stored key.
7
+ * Prompt for a TypeSafe key (hidden input), verify it against api.typesafe.ai with a model listing, and store it for
8
+ * every pi-typesafe consumer. Resolves to undefined when the user cancels. Rejects with TypeSafeIntegrationError for an
9
+ * invalid or unverifiable key. Refuses when TYPESAFE_API_KEY is set, because the environment would shadow the stored
10
+ * key. Other backends have no login: their key is an environment variable only.
9
11
  */
10
12
  export async function loginWithPrompt(ctx) {
11
13
  if (process.env.TYPESAFE_API_KEY?.trim()) {
@@ -23,16 +25,23 @@ export async function loginWithPrompt(ctx) {
23
25
  return { path: storeApiKey(key), models: models.length };
24
26
  }
25
27
  /**
26
- * Use the configured key if there is one; otherwise run the login prompt. `undefined` means the user cancelled.
27
- * A store that must not be read throws `configuration` with the reason instead of prompting, so a permissions
28
- * problem stays visible; the result shape is frozen for existing callers.
28
+ * Use the configured key for the backend if there is one; otherwise run the login prompt. `undefined` means the user
29
+ * cancelled. A store that must not be read throws `configuration` with the reason instead of prompting, so a
30
+ * permissions problem stays visible; the result shape is frozen for existing callers. A backend without a login store
31
+ * (every backend except TypeSafe) throws `configuration` naming its environment variable instead of prompting, because
32
+ * the prompt would verify the key against the wrong service and store it where the TypeSafe key lives.
29
33
  */
30
- export async function ensureApiKey(ctx) {
31
- const situation = keySituation();
34
+ export async function ensureApiKey(ctx, options = {}) {
35
+ const backend = options.backend ?? DEFAULT_BACKEND;
36
+ const situation = keySituation(backend);
32
37
  if (situation.kind === "environment" || situation.kind === "stored")
33
38
  return { source: situation.kind };
34
39
  if (situation.kind === "unusable")
35
40
  throw new TypeSafeIntegrationError("configuration", situation.reason);
41
+ const config = backendConfig(backend);
42
+ if (!usesTypesafeKey(config)) {
43
+ throw new TypeSafeIntegrationError("configuration", `No ${config.label} key. Set ${config.keyEnv} in the environment; /typesafe login stores a TypeSafe key only.`);
44
+ }
36
45
  const login = await loginWithPrompt(ctx);
37
46
  return login ? { source: "stored", login } : undefined;
38
47
  }
@@ -5,42 +5,48 @@ import { TypeSafeIntegrationError } from "./errors.js";
5
5
  export const DEFAULT_MAX_INPUT_BYTES = 65_536;
6
6
  /** Questions one request may ask. More than this needs `chunkEvaluationRequest`, which splits and fans out. */
7
7
  export const DEFAULT_MAX_QUESTIONS = 32;
8
- // The API accepts structured descriptions, not only strings.
9
- const entry = Type.Union([
8
+ // The API accepts structured descriptions, not only strings. The schema is the only shape guidance the model gets
9
+ // before its first call, so every field the agent authors says what it means.
10
+ const entry = (description) => Type.Union([
10
11
  Type.String(),
11
12
  Type.Null(),
12
13
  Type.Array(Type.Unknown()),
13
14
  Type.Record(Type.String(), Type.Unknown()),
14
- ]);
15
- const instructions = Type.Optional(entry);
15
+ ], description === undefined ? {} : { description });
16
+ const instructions = Type.Optional(entry("One judgment about the whole state, phrased as a question or a statement."));
16
17
  const question = Type.Union([
17
18
  Type.Object({
18
- type: Type.Literal("noul"),
19
+ type: Type.Literal("noul", { description: "Yes or no: the probability the instructions hold." }),
19
20
  instructions,
20
21
  criteria: Type.Optional(Type.Union([
21
22
  Type.Null(),
22
- Type.Object({ true: Type.Optional(entry), false: Type.Optional(entry) }, { additionalProperties: false }),
23
- ])),
23
+ Type.Object({ true: Type.Optional(entry()), false: Type.Optional(entry()) }, { additionalProperties: false }),
24
+ ], { description: "Optional: what counts as yes and what counts as no, { true, false }." })),
24
25
  }, { additionalProperties: false }),
25
26
  Type.Object({
26
- type: Type.Literal("choice"),
27
+ type: Type.Literal("choice", { description: "Pick one criteria label." }),
27
28
  instructions,
28
- criteria: Type.Record(Type.String({ minLength: 1, maxLength: 200 }), entry, { minProperties: 1, maxProperties: 64 }),
29
+ criteria: Type.Record(Type.String({ minLength: 1, maxLength: 200 }), entry(), {
30
+ minProperties: 1,
31
+ maxProperties: 64,
32
+ description: "The options as a map from label to when it applies: { billing: \"Charges and payments\", other: null }. 1–64 entries.",
33
+ }),
29
34
  }, { additionalProperties: false }),
30
35
  Type.Object({
31
- type: Type.Literal("score"),
36
+ type: Type.Literal("score", { description: "Rate against the ordered criteria levels." }),
32
37
  instructions,
33
- criteria: Type.Array(entry, { minItems: 2, maxItems: 32 }),
38
+ criteria: Type.Array(entry(), { minItems: 2, maxItems: 32, description: "Ordered rubric levels, lowest first: [\"neutral\", \"angry\"]. 2–32 levels." }),
34
39
  }, { additionalProperties: false }),
35
40
  ]);
36
41
  /** The JSON schema used by both the Pi tool and the programmatic interface. */
37
42
  export const evaluationSchema = Type.Object({
38
- state: entry,
43
+ state: entry("What to judge: text, or an object whose fields the questions name."),
39
44
  questions: Type.Record(Type.String({ minLength: 1, maxLength: 100 }), question, {
40
45
  minProperties: 1,
41
46
  maxProperties: DEFAULT_MAX_QUESTIONS,
47
+ description: "Questions keyed by a short id, as an object map, not an array: { \"urgent\": { type: \"noul\", instructions: ... } }.",
42
48
  }),
43
- model: Type.Optional(Type.String({ minLength: 1, maxLength: 100 })),
49
+ model: Type.Optional(Type.String({ minLength: 1, maxLength: 100, description: "Jev model id, e.g. jev-latest. Omit for the default." })),
44
50
  }, { additionalProperties: false });
45
51
  const usage = `Expected { state, questions: { <id>: { type: "choice", instructions, criteria: { label: description|null } } | { type: "score", instructions, criteria: [level0, level1, ...] } | { type: "noul", instructions } } }; 1–${DEFAULT_MAX_QUESTIONS} questions, Choice 1–64 options, Score 2–32 levels.`;
46
52
  /** Paths and messages only; never the submitted values. */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-typesafe",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
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.9.11",
3
+ "version": "2026.9.13",
4
4
  "description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
5
5
  "keywords": [
6
6
  "extensions",
@@ -43,18 +43,19 @@
43
43
  "@earendil-works/pi-tui": "^0.85.1",
44
44
  "@herbertgao/pi-bark": "0.1.2",
45
45
  "@herbertgao/pi-cc-extensions": "0.9.4",
46
- "@herbertgao/pi-subagents": "0.18.1",
46
+ "@herbertgao/pi-subagents": "0.18.2",
47
47
  "@herbertgao/resume-from": "0.2.2",
48
48
  "@herbertgao/sol-pi": "0.3.1",
49
- "@juicesharp/rpiv-ask-user-question": "2.10.1",
50
- "@juicesharp/rpiv-config": "^2.10.1",
49
+ "@juicesharp/rpiv-ask-user-question": "2.11.0",
50
+ "@juicesharp/rpiv-config": "^2.11.0",
51
51
  "@modelcontextprotocol/client": "2.0.0",
52
52
  "@modelcontextprotocol/core": "2.0.0",
53
53
  "@modelcontextprotocol/ext-apps": "^1.2.2",
54
+ "@modelcontextprotocol/ext-tasks": "^0.1.0",
54
55
  "@modelcontextprotocol/sdk": "^1.29.0",
55
56
  "@mozilla/readability": "^0.6.0",
56
57
  "@napi-rs/keyring": "^1.3.0",
57
- "@narumitw/pi-btw": "0.60.3",
58
+ "@narumitw/pi-btw": "0.61.0",
58
59
  "@narumitw/pi-caffeinate": "0.49.8",
59
60
  "@narumitw/pi-tui-kit": "^0.64.0",
60
61
  "@noble/ed25519": "^3.1.0",
@@ -68,7 +69,7 @@
68
69
  "@tifan/pi-preferred-thinking": "1.0.2",
69
70
  "@tifan/pi-recap": "0.4.7",
70
71
  "@tifan/pi-rename": "0.6.0",
71
- "@typesafe-ai/sdk": "^0.6.0",
72
+ "@typesafe-ai/sdk": "0.6.0",
72
73
  "ajv": "^8.17.1",
73
74
  "ajv-formats": "^3.0.1",
74
75
  "chalk": "^6.0.0",
@@ -89,15 +90,15 @@
89
90
  "pi-footer": "0.5.1",
90
91
  "pi-jev-auto-mode": "0.4.1",
91
92
  "pi-lens": "4.2.1",
92
- "pi-mcp-adapter": "2.34.0",
93
- "pi-multi-account": "1.22.0",
94
- "pi-typesafe": "0.6.1",
93
+ "pi-mcp-adapter": "2.36.0",
94
+ "pi-multi-account": "1.23.0",
95
+ "pi-typesafe": "0.7.1",
95
96
  "pi-web-access": "0.30.0",
96
97
  "pidusage": "^4.0.1",
97
98
  "promise.try": "^2.0.1",
98
99
  "proper-lockfile": "4.1.2",
99
100
  "qrcode-terminal": "^0.12.0",
100
- "recheck": "^4.5.0",
101
+ "recheck": "4.6.0-beta.3",
101
102
  "remote-pi": "0.7.0",
102
103
  "smol-toml": "^1.6.1",
103
104
  "strip-json-comments": "^5.0.3",