@code-yeongyu/senpi 2026.10.8 → 2026.10.9

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 (45) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/bundle/chunks/{app-server-command-MJOYE5ZS.js → app-server-command-2HNDZGTR.js} +1 -1
  3. package/dist/bundle/chunks/{chunk-4GUQVY4Z.js → chunk-3YXB7Z7O.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-5MG76BCM.js → chunk-DERNLWDS.js} +38 -38
  5. package/dist/bundle/chunks/{chunk-K4AZKFRB.js → chunk-J5MUMVWB.js} +2 -2
  6. package/dist/bundle/chunks/{chunk-V2VQ4BHG.js → chunk-M2IHGL3M.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-X6UDRO7J.js → chunk-M3BQ2PAQ.js} +2 -2
  8. package/dist/bundle/chunks/{chunk-BTYFICUC.js → chunk-SB22X6ZR.js} +1 -1
  9. package/dist/bundle/chunks/{cli-main-GWVLFOIP.js → cli-main-VMDAGZCA.js} +1 -1
  10. package/dist/bundle/chunks/{interactive-mode-YLM2U7IX.js → interactive-mode-U7IH4VMJ.js} +1 -1
  11. package/dist/bundle/chunks/{list-tips-JQDZPB6C.js → list-tips-IIRFXBTO.js} +1 -1
  12. package/dist/bundle/chunks/{multi-session-host-KMCBBPTV.js → multi-session-host-HHIC6N7C.js} +1 -1
  13. package/dist/bundle/chunks/{package-manager-cli-3UIJ4RXY.js → package-manager-cli-2FXWPM2U.js} +1 -1
  14. package/dist/bundle/chunks/{rpc-mode-PUYBZG27.js → rpc-mode-K5YGBGQO.js} +1 -1
  15. package/dist/bundle/chunks/{session-picker-N463VCDI.js → session-picker-R5N2EKUS.js} +1 -1
  16. package/dist/bundle/chunks/session-worker.js +39 -39
  17. package/dist/bundle/cli.js +1 -1
  18. package/dist/bundle/index.js +1 -1
  19. package/dist/bundle/rpc-entry.js +1 -1
  20. package/dist/bundle/runtime-manifest.json +1 -1
  21. package/dist/core/dynamic-prompt/handoff.js +3 -3
  22. package/dist/core/dynamic-prompt/intent-gate.js +1 -1
  23. package/dist/core/dynamic-prompt/style.js +1 -1
  24. package/dist/core/extensions/builtin/permission-system/index.js +4 -0
  25. package/dist/core/extensions/builtin/permission-system/prompt.js +10 -2
  26. package/dist/core/extensions/builtin/permission-system/types.d.ts +3 -1
  27. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +2 -2
  28. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -2
  29. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5-5.js +2 -2
  30. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -2
  31. package/dist/core/extensions/builtin/prompt-preset/claude-sonnet-5-5.js +2 -2
  32. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +3 -3
  33. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +3 -3
  34. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +2 -2
  35. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +4 -4
  36. package/dist/core/extensions/builtin/prompt-preset/gpt-surface.js +2 -2
  37. package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +2 -2
  38. package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js +1 -1
  39. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +1 -1
  40. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +2 -2
  41. package/dist/core/extensions/types.d.ts +4 -0
  42. package/dist/modes/rpc/connection-handler.js +11 -2
  43. package/dist/modes/rpc/rpc-types.d.ts +5 -0
  44. package/docs/rpc.md +13 -0
  45. package/package.json +6 -6
@@ -47,6 +47,15 @@ import { buildRpcSessionState } from "./rpc-session-state.js";
47
47
  import { RPC_ERROR_MEDIA_NOT_FOUND } from "./rpc-types.js";
48
48
  import { SessionExtensionUiRequests } from "./session-extension-ui-requests.js";
49
49
  export { buildRpcSessionState } from "./rpc-session-state.js";
50
+ /** The tool call a dialog is about, as wire fields (absent when the dialog is not a permission request). */
51
+ function dialogCall(opts) {
52
+ if (opts?.toolCallId === undefined)
53
+ return {};
54
+ return {
55
+ toolCallId: opts.toolCallId,
56
+ ...(opts.parentToolCallId === undefined ? {} : { parentToolCallId: opts.parentToolCallId }),
57
+ };
58
+ }
50
59
  function loadedExtensionName(path) {
51
60
  const synthetic = /^<(?:builtin|inline):([^>]+)>$/.exec(path);
52
61
  if (synthetic)
@@ -292,9 +301,9 @@ export function createRpcConnectionHandler(runtimeHost, sink, options = {}) {
292
301
  question: (request, opts) => clientCapabilities?.includes(QUESTION_CAPABILITY)
293
302
  ? questions.ask(request, opts)
294
303
  : degradeQuestion(createExtensionUIContext(), request, opts),
295
- select: (title, options, opts) => createDialogPromise(opts, undefined, { method: "select", title, options, timeout: opts?.timeout }, (r) => "cancelled" in r && r.cancelled ? undefined : "value" in r ? r.value : undefined),
304
+ select: (title, options, opts) => createDialogPromise(opts, undefined, { method: "select", title, options, timeout: opts?.timeout, ...dialogCall(opts) }, (r) => ("cancelled" in r && r.cancelled ? undefined : "value" in r ? r.value : undefined)),
296
305
  confirm: (title, message, opts) => createDialogPromise(opts, false, { method: "confirm", title, message, timeout: opts?.timeout }, (r) => "cancelled" in r && r.cancelled ? false : "confirmed" in r ? r.confirmed : false),
297
- input: (title, placeholder, opts) => createDialogPromise(opts, undefined, { method: "input", title, placeholder, timeout: opts?.timeout }, (r) => "cancelled" in r && r.cancelled ? undefined : "value" in r ? r.value : undefined),
306
+ input: (title, placeholder, opts) => createDialogPromise(opts, undefined, { method: "input", title, placeholder, timeout: opts?.timeout, ...dialogCall(opts) }, (r) => ("cancelled" in r && r.cancelled ? undefined : "value" in r ? r.value : undefined)),
298
307
  notify(message, type) {
299
308
  // Fire and forget - no response needed
300
309
  output({
@@ -1319,6 +1319,9 @@ export type RpcExtensionUIRequest = {
1319
1319
  title: string;
1320
1320
  options: string[];
1321
1321
  timeout?: number;
1322
+ /** The tool call this dialog approves, when it is a permission request. */
1323
+ toolCallId?: string;
1324
+ parentToolCallId?: string;
1322
1325
  } | {
1323
1326
  type: "extension_ui_request";
1324
1327
  id: string;
@@ -1333,6 +1336,8 @@ export type RpcExtensionUIRequest = {
1333
1336
  title: string;
1334
1337
  placeholder?: string;
1335
1338
  timeout?: number;
1339
+ toolCallId?: string;
1340
+ parentToolCallId?: string;
1336
1341
  } | {
1337
1342
  type: "extension_ui_request";
1338
1343
  id: string;
package/docs/rpc.md CHANGED
@@ -3562,6 +3562,19 @@ Prompt the user to choose from a list. Dialog methods with a `timeout` field inc
3562
3562
 
3563
3563
  Expected response: `extension_ui_response` with `value` (the selected option string) or `cancelled: true`.
3564
3564
 
3565
+ A permission prompt (title `Permission required: <permission>`) also carries `toolCallId`, the id of the tool call it approves, and `parentToolCallId` when another tool (for example a codemode script) issued that call. Clients bind the prompt to that call by id: the engine raises the prompts for every call of a message before any of them runs, so the order of `tool_execution_start` events does not say which call a prompt belongs to. The `input` that follows a "Deny with feedback" choice carries the same fields.
3566
+
3567
+ ```json
3568
+ {
3569
+ "type": "extension_ui_request",
3570
+ "id": "uuid-3",
3571
+ "method": "select",
3572
+ "title": "Permission required: read\n\nPath: /project/a.txt\n\nPatterns:\n - /project/a.txt",
3573
+ "options": ["Allow once", "Allow always", "Deny", "Deny with feedback"],
3574
+ "toolCallId": "call-a"
3575
+ }
3576
+ ```
3577
+
3565
3578
  #### confirm
3566
3579
 
3567
3580
  Prompt the user for yes/no confirmation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi",
3
- "version": "2026.10.8",
3
+ "version": "2026.10.9",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@earendil-works/chord": "0.99.1",
60
- "@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.10.8",
61
- "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.8",
62
- "@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.10.8",
60
+ "@earendil-works/pi-agent-core": "npm:@code-yeongyu/senpi-agent-core@2026.10.9",
61
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.9",
62
+ "@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.10.9",
63
63
  "@silvia-odwyer/photon-node": "0.3.4",
64
64
  "chalk": "6.0.0",
65
65
  "cross-spawn": "7.0.6",
@@ -78,8 +78,8 @@
78
78
  "yaml": "2.9.1",
79
79
  "@anthropic-ai/claude-agent-sdk": "0.3.289",
80
80
  "@anthropic-ai/sdk": "0.127.0",
81
- "@code-yeongyu/senpi-codemode": "2026.10.8",
82
- "@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.10.8",
81
+ "@code-yeongyu/senpi-codemode": "2026.10.9",
82
+ "@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.10.9",
83
83
  "@modelcontextprotocol/sdk": "1.30.0",
84
84
  "@mozilla/readability": "0.6.0",
85
85
  "linkedom": "0.18.13",