@code-yeongyu/senpi 2026.10.8 → 2026.10.10

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 (88) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/bundle/chunks/{app-server-command-MJOYE5ZS.js → app-server-command-SZWKEC36.js} +1 -1
  3. package/dist/bundle/chunks/{chunk-MJGHZT4N.js → chunk-3A3C5VVO.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-4GUQVY4Z.js → chunk-3YXB7Z7O.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-6EH7QXOG.js → chunk-6VVV27W2.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-CB77NQMN.js → chunk-7GVD54RM.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-CM5QTRC2.js → chunk-H67EVDWG.js} +1 -1
  8. package/dist/bundle/chunks/chunk-IZOTKUWG.js +2 -0
  9. package/dist/bundle/chunks/{chunk-K4AZKFRB.js → chunk-J5MUMVWB.js} +2 -2
  10. package/dist/bundle/chunks/{chunk-V2VQ4BHG.js → chunk-M2IHGL3M.js} +1 -1
  11. package/dist/bundle/chunks/chunk-N3QEG537.js +14 -0
  12. package/dist/bundle/chunks/{chunk-LUWWM7GA.js → chunk-RADHRQ4K.js} +3 -3
  13. package/dist/bundle/chunks/{chunk-BTYFICUC.js → chunk-SB22X6ZR.js} +1 -1
  14. package/dist/bundle/chunks/{chunk-5MG76BCM.js → chunk-WQ77WBQW.js} +60 -60
  15. package/dist/bundle/chunks/{cli-main-GWVLFOIP.js → cli-main-C3AS73Q4.js} +1 -1
  16. package/dist/bundle/chunks/{host-command-HTYYQBSG.js → host-command-X64D7PT3.js} +1 -1
  17. package/dist/bundle/chunks/{host-lifecycle-XZF6IKKO.js → host-lifecycle-GC3GIR2N.js} +1 -1
  18. package/dist/bundle/chunks/{interactive-mode-YLM2U7IX.js → interactive-mode-KUP43WXL.js} +1 -1
  19. package/dist/bundle/chunks/{list-tips-JQDZPB6C.js → list-tips-IIRFXBTO.js} +1 -1
  20. package/dist/bundle/chunks/{multi-session-host-KMCBBPTV.js → multi-session-host-EM24ZBGK.js} +1 -1
  21. package/dist/bundle/chunks/{package-manager-cli-3UIJ4RXY.js → package-manager-cli-MGFHGI5O.js} +1 -1
  22. package/dist/bundle/chunks/{rpc-mode-PUYBZG27.js → rpc-mode-2GT75YBZ.js} +1 -1
  23. package/dist/bundle/chunks/{schedule-command-CVAPK2WQ.js → schedule-command-EQ4PQCRP.js} +1 -1
  24. package/dist/bundle/chunks/{session-control-endpoint-THEF3K7M.js → session-control-endpoint-DOIW7IBF.js} +2 -2
  25. package/dist/bundle/chunks/{session-picker-N463VCDI.js → session-picker-R5N2EKUS.js} +1 -1
  26. package/dist/bundle/chunks/session-worker.js +73 -73
  27. package/dist/bundle/cli.js +1 -1
  28. package/dist/bundle/index.js +1 -1
  29. package/dist/bundle/rpc-entry.js +1 -1
  30. package/dist/bundle/runtime-manifest.json +1 -1
  31. package/dist/core/agent-session-runtime.d.ts +9 -0
  32. package/dist/core/agent-session-runtime.js +22 -0
  33. package/dist/core/agent-session.d.ts +12 -1
  34. package/dist/core/agent-session.js +36 -4
  35. package/dist/core/dynamic-prompt/handoff.js +3 -3
  36. package/dist/core/dynamic-prompt/intent-gate.js +1 -1
  37. package/dist/core/dynamic-prompt/style.js +1 -1
  38. package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts +5 -0
  39. package/dist/core/extensions/builtin/compaction/context-pipeline.js +1 -0
  40. package/dist/core/extensions/builtin/compaction/index.js +1 -0
  41. package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +7 -0
  42. package/dist/core/extensions/builtin/compaction/lane-policy.js +28 -15
  43. package/dist/core/extensions/builtin/permission-system/index.js +4 -0
  44. package/dist/core/extensions/builtin/permission-system/prompt.js +10 -2
  45. package/dist/core/extensions/builtin/permission-system/types.d.ts +3 -1
  46. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +2 -2
  47. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -2
  48. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5-5.js +2 -2
  49. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -2
  50. package/dist/core/extensions/builtin/prompt-preset/claude-sonnet-5-5.js +2 -2
  51. package/dist/core/extensions/builtin/prompt-preset/gpt-5.5.js +3 -3
  52. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +3 -3
  53. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +2 -2
  54. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +4 -4
  55. package/dist/core/extensions/builtin/prompt-preset/gpt-surface.js +2 -2
  56. package/dist/core/extensions/builtin/prompt-preset/grok-4.5.js +2 -2
  57. package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js +1 -1
  58. package/dist/core/extensions/builtin/prompt-preset/grok-4.7.js +1 -1
  59. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +2 -2
  60. package/dist/core/extensions/builtin/rules/rules/finder.js +8 -3
  61. package/dist/core/extensions/types.d.ts +4 -0
  62. package/dist/core/sdk.js +7 -3
  63. package/dist/core/thinking-levels.d.ts +23 -1
  64. package/dist/core/thinking-levels.js +37 -0
  65. package/dist/main.js +12 -13
  66. package/dist/modes/interactive/interactive-mode.js +8 -0
  67. package/dist/modes/interactive/session-control-endpoint.js +33 -8
  68. package/dist/modes/interactive/session-control-registry.js +3 -1
  69. package/dist/modes/interactive/session-control-wake.d.ts +11 -5
  70. package/dist/modes/interactive/session-control-wake.js +38 -16
  71. package/dist/modes/rpc/connection-handler.d.ts +5 -0
  72. package/dist/modes/rpc/connection-handler.js +40 -4
  73. package/dist/modes/rpc/custom-capability.d.ts +6 -0
  74. package/dist/modes/rpc/custom-capability.js +6 -0
  75. package/dist/modes/rpc/host-daemon-paths.d.ts +5 -4
  76. package/dist/modes/rpc/host-daemon-paths.js +17 -9
  77. package/dist/modes/rpc/host-daemon-registration.d.ts +6 -1
  78. package/dist/modes/rpc/host-daemon-registration.js +6 -2
  79. package/dist/modes/rpc/host-session-control.js +6 -4
  80. package/dist/modes/rpc/rpc-client.d.ts +5 -0
  81. package/dist/modes/rpc/rpc-client.js +7 -0
  82. package/dist/modes/rpc/rpc-mode.js +1 -1
  83. package/dist/modes/rpc/rpc-types.d.ts +14 -0
  84. package/docs/json.md +3 -0
  85. package/docs/rpc.md +48 -0
  86. package/package.json +6 -6
  87. package/dist/bundle/chunks/chunk-VJJ53ORU.js +0 -2
  88. package/dist/bundle/chunks/chunk-X6UDRO7J.js +0 -14
package/docs/rpc.md CHANGED
@@ -2191,6 +2191,41 @@ Response:
2191
2191
  {"type": "response", "command": "abort_retry", "success": true}
2192
2192
  ```
2193
2193
 
2194
+ #### set_retry_fallback
2195
+
2196
+ A single-session `--mode rpc` process has no `open_session`. A caller that spawns one process per session (e.g. a task
2197
+ child that runs as its own process) gives it its fallback policy with `set_retry_fallback`:
2198
+
2199
+ ```json
2200
+ {"type": "set_retry_fallback", "retryFallback": {"modelFallback": true, "fallbackChains": {"provider/model": ["provider/spare"]}}}
2201
+ ```
2202
+
2203
+ Response:
2204
+ ```json
2205
+ {"type": "response", "command": "set_retry_fallback", "success": true}
2206
+ ```
2207
+
2208
+ The profile is the same shape, with the same limits, as `open_session.retryFallback`, and it has the same effect. It
2209
+ overrides the session's `retry.modelFallback` and `retry.fallbackChains` in memory only, it is never written to a
2210
+ settings file, and the process's later sessions (`new_session`, `switch_session`, `fork`) keep it.
2211
+
2212
+ It is a launch-time setting:
2213
+ - It is accepted only before the session's first turn. It is refused once this connection has asked for a turn
2214
+ (`prompt`, `steer`, `follow_up`, `continue_from_leaf`, `send_custom_message` with `triggerTurn`), even one that has
2215
+ not started yet, while a turn streams (an extension's included), and once the session holds turn history (a resumed
2216
+ session's). So a chain never changes under a provider request or a retry already in flight. Context messages added
2217
+ before the first turn (role `custom`, from an extension on `session_start` or a `send_custom_message` without
2218
+ `triggerTurn`) are not a turn and do not block it.
2219
+ - Send it on its own and await its response: a `set_retry_fallback` pipelined while a `new_session`, `switch_session`
2220
+ or `fork` is still being created can answer success while the session being created runs without it.
2221
+ - A malformed profile is refused with the `open_session` shape message, and nothing is applied.
2222
+ - A multi-session host refuses the command on its session connections; a host session takes its policy from
2223
+ `open_session.retryFallback`.
2224
+
2225
+ Probe `retry_fallback_command` in `get_protocol_info` before sending it. Only a single-session process advertises it.
2226
+ Unlike an environment variable, the profile reaches this process only, never what its tools spawn. Unlike argv, it has
2227
+ no command-line length limit and is not visible in a process listing.
2228
+
2194
2229
  ### Bash
2195
2230
 
2196
2231
  #### bash
@@ -3562,6 +3597,19 @@ Prompt the user to choose from a list. Dialog methods with a `timeout` field inc
3562
3597
 
3563
3598
  Expected response: `extension_ui_response` with `value` (the selected option string) or `cancelled: true`.
3564
3599
 
3600
+ 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.
3601
+
3602
+ ```json
3603
+ {
3604
+ "type": "extension_ui_request",
3605
+ "id": "uuid-3",
3606
+ "method": "select",
3607
+ "title": "Permission required: read\n\nPath: /project/a.txt\n\nPatterns:\n - /project/a.txt",
3608
+ "options": ["Allow once", "Allow always", "Deny", "Deny with feedback"],
3609
+ "toolCallId": "call-a"
3610
+ }
3611
+ ```
3612
+
3565
3613
  #### confirm
3566
3614
 
3567
3615
  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.10",
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.10",
61
+ "@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.10.10",
62
+ "@earendil-works/pi-tui": "npm:@code-yeongyu/senpi-tui@2026.10.10",
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.10",
82
+ "@earendil-works/pi-pty": "npm:@code-yeongyu/senpi-pty@2026.10.10",
83
83
  "@modelcontextprotocol/sdk": "1.30.0",
84
84
  "@mozilla/readability": "0.6.0",
85
85
  "linkedom": "0.18.13",
@@ -1,2 +0,0 @@
1
- import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url); { const __piWorkerThreads = require("node:worker_threads"); if (typeof __piWorkerThreads.markAsUncloneable !== "function") { __piWorkerThreads.markAsUncloneable = () => {}; } }
2
- import{engineBuildIdentity}from"./chunk-ZJHRDQCH.js";import{HOST_GENERATION_ENV,HOST_INSTANCE_ID_ENV}from"./chunk-CIRZTP7W.js";import{parseArgs,resolveSessionRuntime}from"./chunk-MH2BFYGN.js";import*as crypto from"node:crypto";var CUSTOM_UNSUPPORTED_CAPABILITY="custom_unsupported",EXTENSION_EVENTS_CAPABILITY="extension_events",AUTO_TITLE_SESSIONS_CAPABILITY="auto_title_sessions",CONTINUE_FROM_LEAF_CAPABILITY="continue_from_leaf",MEDIA_PLACEHOLDERS_CAPABILITY="media_placeholders",QUESTION_CAPABILITY="question",RETAIN_ON_DISCONNECT_CAPABILITY="retain_on_disconnect",SESSION_CONTEXT_CAPABILITY="session_context",SESSION_KIND_CAPABILITY="session_kind",AUTO_TITLE_PER_SESSION_CAPABILITY="auto_title_per_session",WARM_CAPABILITY="warm",DURABLE_SESSION_ID_CAPABILITY="durable_session_id",PROMPT_SURFACE_CAPABILITY="prompt_surface",BROWSER_ENGINE_CAPABILITY="browser_engine",RETRY_FALLBACK_PROFILE_CAPABILITY="retry_fallback_profile",PROMPT_SURFACE_CHAT_CAPABILITY="prompt_surface_chat",RPC_CLIENT_CAPABILITIES_ENV="SENPI_RPC_CLIENT_CAPABILITIES";function parseClientCapabilities(value){return value?value.split(",").map(part=>part.trim()).filter(part=>part.length>0):[]}var DEFAULT_CUSTOM_EXTENSION_LABEL="custom UI component";function buildCustomUnsupportedRequest(capabilities,extensionName){if(!capabilities?.includes(CUSTOM_UNSUPPORTED_CAPABILITY))return;let name=extensionName.trim()||DEFAULT_CUSTOM_EXTENSION_LABEL;return{type:"extension_ui_request",id:crypto.randomUUID(),method:"custom_unsupported",extensionName:name}}import{createHash,randomUUID as randomUUID2}from"node:crypto";import{resolve}from"node:path";var INSTANCE_ID=resolveInstanceId(process.env[HOST_INSTANCE_ID_ENV]);function resolveInstanceId(value){return value!==void 0&&value.trim()!==""?value:randomUUID2()}function hostInstanceId(){return INSTANCE_ID}var cachedProfile;function hostGeneration(env){let value=env[HOST_GENERATION_ENV];return value!==void 0&&/^\d+$/.test(value)?Number(value):0}function hostLaunchProfile(argv,cwd){let parsed=parseArgs([...argv],{grokNeoEnabled:!1}),core={extensions:[...new Set((parsed.extensions??[]).map(path=>resolve(cwd,path)))].sort(),multi_session:parsed.multiSession===!0,session_runtime:resolveSessionRuntime(parsed)},canonical=JSON.stringify({extensions:core.extensions,multi_session:core.multi_session,session_runtime:core.session_runtime});return{profile_id:createHash("sha256").update(canonical).digest("hex"),core}}function socketHostLaunchProfile(hostArgs,cwd){return hostLaunchProfile(["--mode","rpc","--multi-session","--listen","unix://",...hostArgs],cwd)}function protocolIdentity(){cachedProfile??=hostLaunchProfile(process.argv.slice(2),process.cwd());let build=engineBuildIdentity();return{instanceId:INSTANCE_ID,generation:hostGeneration(process.env),engineVersion:build.text,engineOrdinal:build.ordinal,launch_profile:cachedProfile}}export{CUSTOM_UNSUPPORTED_CAPABILITY,EXTENSION_EVENTS_CAPABILITY,AUTO_TITLE_SESSIONS_CAPABILITY,CONTINUE_FROM_LEAF_CAPABILITY,MEDIA_PLACEHOLDERS_CAPABILITY,QUESTION_CAPABILITY,RETAIN_ON_DISCONNECT_CAPABILITY,SESSION_CONTEXT_CAPABILITY,SESSION_KIND_CAPABILITY,AUTO_TITLE_PER_SESSION_CAPABILITY,WARM_CAPABILITY,DURABLE_SESSION_ID_CAPABILITY,PROMPT_SURFACE_CAPABILITY,BROWSER_ENGINE_CAPABILITY,RETRY_FALLBACK_PROFILE_CAPABILITY,PROMPT_SURFACE_CHAT_CAPABILITY,RPC_CLIENT_CAPABILITIES_ENV,parseClientCapabilities,DEFAULT_CUSTOM_EXTENSION_LABEL,buildCustomUnsupportedRequest,hostInstanceId,hostGeneration,hostLaunchProfile,socketHostLaunchProfile,protocolIdentity};