@code-yeongyu/senpi 2026.8.30 → 2026.9.2-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.
- package/CHANGELOG.md +234 -4
- package/README.md +3 -0
- package/dist/core/agent-session.d.ts +29 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +168 -18
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction-execution.d.ts +14 -0
- package/dist/core/compaction/compaction-execution.d.ts.map +1 -0
- package/dist/core/compaction/compaction-execution.js +121 -0
- package/dist/core/compaction/compaction-execution.js.map +1 -0
- package/dist/core/compaction/compaction-settings.d.ts +17 -0
- package/dist/core/compaction/compaction-settings.d.ts.map +1 -0
- package/dist/core/compaction/compaction-settings.js +17 -0
- package/dist/core/compaction/compaction-settings.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +13 -26
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +7 -136
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/ideal-compaction-settings.d.ts +9 -0
- package/dist/core/compaction/ideal-compaction-settings.d.ts.map +1 -0
- package/dist/core/compaction/ideal-compaction-settings.js +7 -0
- package/dist/core/compaction/ideal-compaction-settings.js.map +1 -0
- package/dist/core/compaction-settings-access.d.ts +19 -0
- package/dist/core/compaction-settings-access.d.ts.map +1 -0
- package/dist/core/compaction-settings-access.js +10 -0
- package/dist/core/compaction-settings-access.js.map +1 -0
- package/dist/core/compaction-settings-resolver.d.ts +22 -0
- package/dist/core/compaction-settings-resolver.d.ts.map +1 -0
- package/dist/core/compaction-settings-resolver.js +46 -0
- package/dist/core/compaction-settings-resolver.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js +6 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +9 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +10 -3
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +2 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts +24 -0
- package/dist/core/extensions/builtin/compaction/context-pipeline.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/context-pipeline.js +43 -0
- package/dist/core/extensions/builtin/compaction/context-pipeline.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +8 -2
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/emergency-prune.d.ts +17 -0
- package/dist/core/extensions/builtin/compaction/emergency-prune.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/emergency-prune.js +64 -0
- package/dist/core/extensions/builtin/compaction/emergency-prune.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/extension-wiring.d.ts +27 -0
- package/dist/core/extensions/builtin/compaction/extension-wiring.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/extension-wiring.js +84 -0
- package/dist/core/extensions/builtin/compaction/extension-wiring.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/idle-retry.js +1 -1
- package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/idle.d.ts +1 -0
- package/dist/core/extensions/builtin/compaction/idle.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/idle.js +13 -2
- package/dist/core/extensions/builtin/compaction/idle.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +152 -154
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.js +2 -0
- package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/model-selection.d.ts +14 -0
- package/dist/core/extensions/builtin/compaction/model-selection.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/model-selection.js +37 -0
- package/dist/core/extensions/builtin/compaction/model-selection.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts +30 -0
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/model-usability-budget.js +74 -0
- package/dist/core/extensions/builtin/compaction/model-usability-budget.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.d.ts +9 -0
- package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.js +2 -0
- package/dist/core/extensions/builtin/compaction/openai-remote-dependencies.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/openai-remote.d.ts +3 -6
- package/dist/core/extensions/builtin/compaction/openai-remote.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/orchestration.d.ts +46 -0
- package/dist/core/extensions/builtin/compaction/orchestration.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/orchestration.js +103 -0
- package/dist/core/extensions/builtin/compaction/orchestration.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/policy.d.ts +12 -2
- package/dist/core/extensions/builtin/compaction/policy.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/policy.js +52 -26
- package/dist/core/extensions/builtin/compaction/policy.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculation-lead.d.ts +8 -0
- package/dist/core/extensions/builtin/compaction/speculation-lead.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculation-lead.js +17 -0
- package/dist/core/extensions/builtin/compaction/speculation-lead.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative-job.d.ts +22 -0
- package/dist/core/extensions/builtin/compaction/speculative-job.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative-job.js +16 -0
- package/dist/core/extensions/builtin/compaction/speculative-job.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative-summary.d.ts +23 -0
- package/dist/core/extensions/builtin/compaction/speculative-summary.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative-summary.js +132 -0
- package/dist/core/extensions/builtin/compaction/speculative-summary.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative.d.ts +8 -13
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +21 -197
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/token-budget-reminder.d.ts +24 -0
- package/dist/core/extensions/builtin/compaction/token-budget-reminder.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/token-budget-reminder.js +25 -0
- package/dist/core/extensions/builtin/compaction/token-budget-reminder.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/tool-admission.d.ts +27 -0
- package/dist/core/extensions/builtin/compaction/tool-admission.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/tool-admission.js +56 -0
- package/dist/core/extensions/builtin/compaction/tool-admission.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust-state-json.d.ts +5 -0
- package/dist/core/extensions/builtin/hooks/trust-state-json.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust-state-json.js +76 -0
- package/dist/core/extensions/builtin/hooks/trust-state-json.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts +7 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js +60 -8
- package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust.d.ts +1 -2
- package/dist/core/extensions/builtin/hooks/trust.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust.js +1 -72
- package/dist/core/extensions/builtin/hooks/trust.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +110 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts +50 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +66 -0
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +5 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +6 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js +11 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js +11 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k2-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +2 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +18 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.js +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts +11 -0
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.js +18 -2
- package/dist/core/extensions/builtin/terminal/runtime-session.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/index.js +4 -0
- package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/manager.d.ts +2 -0
- package/dist/core/extensions/builtin/ttsr/manager.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/manager.js +28 -1
- package/dist/core/extensions/builtin/ttsr/manager.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +17 -8
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts +14 -0
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +33 -3
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/retry-fallback/log.js +1 -1
- package/dist/core/retry-fallback/log.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +1 -0
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +5 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-activity.d.ts +47 -0
- package/dist/core/session-activity.d.ts.map +1 -0
- package/dist/core/session-activity.js +58 -0
- package/dist/core/session-activity.js.map +1 -0
- package/dist/core/session-manager.d.ts +8 -12
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +118 -7
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-resident-store.d.ts +8 -1
- package/dist/core/session-resident-store.d.ts.map +1 -1
- package/dist/core/session-resident-store.js +12 -5
- package/dist/core/session-resident-store.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -87
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +14 -20
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-public-types.d.ts +11 -0
- package/dist/core/settings-public-types.d.ts.map +1 -0
- package/dist/core/settings-public-types.js +2 -0
- package/dist/core/settings-public-types.js.map +1 -0
- package/dist/core/settings-shapes.d.ts +36 -0
- package/dist/core/settings-shapes.d.ts.map +1 -0
- package/dist/core/settings-shapes.js +2 -0
- package/dist/core/settings-shapes.js.map +1 -0
- package/dist/core/shared-host-policy.d.ts +6 -0
- package/dist/core/shared-host-policy.d.ts.map +1 -0
- package/dist/core/shared-host-policy.js +7 -0
- package/dist/core/shared-host-policy.js.map +1 -0
- package/dist/core/terminal-settings.d.ts +22 -0
- package/dist/core/terminal-settings.d.ts.map +1 -0
- package/dist/core/terminal-settings.js +2 -0
- package/dist/core/terminal-settings.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +4 -4
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +27 -11
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts +13 -2
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js +58 -12
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/daemon.js +65 -7
- package/dist/modes/app-server/daemon.js.map +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/index.js +1 -1
- package/dist/modes/index.js.map +1 -1
- package/dist/modes/interactive/interactive-host-runtime.d.ts +84 -1
- package/dist/modes/interactive/interactive-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-host-runtime.js +435 -112
- package/dist/modes/interactive/interactive-host-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +59 -6
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/ethos-tips.js +1 -1
- package/dist/modes/interactive/tips/catalog/ethos-tips.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts +12 -5
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +180 -25
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/custom-capability.d.ts +2 -0
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +2 -0
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/host-ensure.d.ts +17 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +150 -23
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts +54 -0
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js +259 -69
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/host-watchdog.d.ts +2 -2
- package/dist/modes/rpc/host-watchdog.d.ts.map +1 -1
- package/dist/modes/rpc/host-watchdog.js +89 -21
- package/dist/modes/rpc/host-watchdog.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.d.ts +38 -0
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +149 -61
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/ownership-safe-lock.d.ts +14 -0
- package/dist/modes/rpc/ownership-safe-lock.d.ts.map +1 -0
- package/dist/modes/rpc/ownership-safe-lock.js +87 -0
- package/dist/modes/rpc/ownership-safe-lock.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +13 -2
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +46 -12
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +21 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +1 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-binding.d.ts +2 -1
- package/dist/modes/rpc/session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/session-binding.js +1 -0
- package/dist/modes/rpc/session-binding.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +54 -1
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +180 -3
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +18 -0
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +88 -8
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts +11 -1
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +25 -0
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/socket-transport.d.ts +13 -0
- package/dist/modes/rpc/socket-transport.d.ts.map +1 -0
- package/dist/modes/rpc/socket-transport.js +92 -0
- package/dist/modes/rpc/socket-transport.js.map +1 -0
- package/dist/modes/rpc/widget-line-renderer.d.ts +17 -0
- package/dist/modes/rpc/widget-line-renderer.d.ts.map +1 -0
- package/dist/modes/rpc/widget-line-renderer.js +73 -0
- package/dist/modes/rpc/widget-line-renderer.js.map +1 -0
- package/dist/utils/fs-watch.d.ts.map +1 -1
- package/dist/utils/fs-watch.js +11 -2
- package/dist/utils/fs-watch.js.map +1 -1
- package/docs/app-server.md +2 -2
- package/docs/containerization.md +2 -2
- package/docs/development.md +7 -7
- package/docs/extensions.md +5 -5
- package/docs/grok-neo.md +1 -1
- package/docs/index.md +1 -1
- package/docs/packages.md +2 -2
- package/docs/quickstart.md +4 -4
- package/docs/release-guide.md +21 -21
- package/docs/rpc.md +83 -6
- package/docs/sdk.md +1 -1
- package/docs/settings.md +8 -8
- package/docs/skills.md +2 -2
- package/docs/terminal-tools.md +1 -1
- package/docs/termux.md +1 -1
- package/docs/tui.md +1 -1
- package/examples/AGENTS.md +1 -1
- package/examples/sdk/README.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +85 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +6 -4
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/skill-contribution.ts +105 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +6 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +10 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/SKILL.md +44 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/breaking-changes.md +75 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/build.md +114 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/dev-tooling.md +34 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/http-networking.md +113 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/install.md +93 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/node-compat-platforms.md +36 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/performance.md +33 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md +156 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/security.md +52 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/test.md +103 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +3 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/README.md +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/README.md +6 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +24 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +316 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +20 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/google.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/groq.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/dist/screen-operations.d.ts +42 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-operations.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-operations.js +34 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-operations.js.map +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-text.d.ts +8 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-text.js +51 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen-text.js.map +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen.d.ts +45 -0
- package/node_modules/@earendil-works/pi-pty/dist/screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/screen.js +178 -55
- package/node_modules/@earendil-works/pi-pty/dist/screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/README.md +6 -3
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +5 -4
- package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +2 -2
- package/node_modules/@earendil-works/pi-tui/native/win32/README.md +2 -2
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
package/docs/settings.md
CHANGED
|
@@ -87,7 +87,7 @@ Permission rules are a confirmation policy, not a sandbox. Senpi, extensions, pa
|
|
|
87
87
|
| `modelThinkingLevels` | object | - | Per-model reasoning effort memory (`"provider/id": "level"`) |
|
|
88
88
|
| `modelLastOnThinkingLevels` | object | - | Per-model last non-off reasoning level, used by `/reasoning on` to restore the previous effort |
|
|
89
89
|
| `modelServiceTiers` | object | - | Per-model service tier memory (`"provider/id": "auto" \| "priority"`) |
|
|
90
|
-
| `promptPreset` | string | `"auto"` | Force a system prompt preset: `"auto"`, `"kimi-k2-6"`, `"kimi-k2-7"`, `"kimi-k3"`, `"glm-5.2"`, `"glm-5.3"`, `"grok-4.5"`, `"grok-4.6"`, `"claude-fable-5"`, `"claude-opus-5"`, `"claude-opus-4-5"`, `"claude-opus-4-6"`, `"claude-opus-4-7"`, `"claude-opus-4-8"`, `"deepseek-v4-flash"`, `"deepseek-v4-flash-0731"`, `"deepseek-v4-pro"`, `"gpt-5"`, `"gpt-5.2"`, `"gpt-5.3-codex"`, `"gpt-5.4"`, `"gpt-5.5"`, or `"gpt-5.6"` |
|
|
90
|
+
| `promptPreset` | string | `"auto"` | Force a system prompt preset: `"auto"`, `"kimi-k2-6"`, `"kimi-k2-7"`, `"kimi-k3"`, `"glm-5.2"`, `"glm-5.3"`, `"grok-4.5"`, `"grok-4.6"`, `"claude-fable-5"`, `"claude-fable-5-1"`, `"claude-opus-5"`, `"claude-opus-4-5"`, `"claude-opus-4-6"`, `"claude-opus-4-7"`, `"claude-opus-4-8"`, `"deepseek-v4-flash"`, `"deepseek-v4-flash-0731"`, `"deepseek-v4-pro"`, `"gpt-5"`, `"gpt-5.2"`, `"gpt-5.3-codex"`, `"gpt-5.4"`, `"gpt-5.5"`, or `"gpt-5.6"` |
|
|
91
91
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
|
|
92
92
|
| `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses and compaction or branch-summary usage |
|
|
93
93
|
| `thinkingBudgets` | object | - | Custom token budgets per thinking level. Anthropic, Google, and Bedrock use these natively. OpenAI-compatible models use them when `compat.thinkingTokenBudgetField` (or `supportsThinkingTokenBudget`) is set. |
|
|
@@ -212,14 +212,14 @@ Set `PI_SKIP_VERSION_CHECK=1` to disable the senpi version update check. Use `--
|
|
|
212
212
|
| Setting | Type | Default | Description |
|
|
213
213
|
|---------|------|---------|-------------|
|
|
214
214
|
| `retry.enabled` | boolean | `true` | Enable automatic agent-level retry on transient errors |
|
|
215
|
-
| `retry.maxRetries` | number | `
|
|
215
|
+
| `retry.maxRetries` | number | `5` | Maximum agent-level retry attempts |
|
|
216
216
|
| `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff (2s, 4s, 8s) |
|
|
217
217
|
| `retry.modelFallback` | boolean | `true` | Let eligible retry failures advance through configured per-model fallback chains |
|
|
218
218
|
| `retry.fallbackChains` | `Record<string, string[]>` | `{}` | Ordered exact model-selector to fallback-selector chains |
|
|
219
219
|
| `retry.fallbackRevertPolicy` | `"cooldown-expiry"` \| `"never"` | `"cooldown-expiry"` | Automatic primary-model restoration policy |
|
|
220
220
|
| `retry.abortServerSideFallback` | boolean | `true` | Abort a turn when the provider substitutes a different model after a classifier decline |
|
|
221
221
|
| `retry.provider.timeoutMs` | number | `300000` | Provider/SDK request timeout and stream idle timeout in milliseconds |
|
|
222
|
-
| `retry.provider.streamStartTimeoutMs` | number | `
|
|
222
|
+
| `retry.provider.streamStartTimeoutMs` | number | `300000` | Maximum wait for the first provider stream event; `0` disables |
|
|
223
223
|
| `retry.provider.streamRetryTimeoutMs` | number | `30000` | First-request liveness cap after a known provider stream/transport timeout; `0` disables the cap |
|
|
224
224
|
| `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
|
|
225
225
|
| `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay honored on the same model before the fallback chain engages (60s) |
|
|
@@ -236,11 +236,11 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
236
236
|
{
|
|
237
237
|
"retry": {
|
|
238
238
|
"enabled": true,
|
|
239
|
-
"maxRetries":
|
|
239
|
+
"maxRetries": 5,
|
|
240
240
|
"baseDelayMs": 2000,
|
|
241
241
|
"provider": {
|
|
242
242
|
"timeoutMs": 3600000,
|
|
243
|
-
"streamStartTimeoutMs":
|
|
243
|
+
"streamStartTimeoutMs": 300000,
|
|
244
244
|
"streamRetryTimeoutMs": 30000,
|
|
245
245
|
"maxRetries": 0,
|
|
246
246
|
"maxRetryDelayMs": 60000
|
|
@@ -251,14 +251,14 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
|
|
|
251
251
|
|
|
252
252
|
#### Model fallback chains
|
|
253
253
|
|
|
254
|
-
`retry.fallbackChains` maps a primary-model selector to an ordered list of fallback selectors. A selector is `provider/model` with an optional `:thinking-level` suffix, or a bare `model` id that applies to every provider serving that model family. Bare selectors expand against the models you actually have: providers holding an OAuth credential are preferred, then a fixed precedence order, and OpenRouter is never chosen by expansion. Senpi ships
|
|
254
|
+
`retry.fallbackChains` maps a primary-model selector to an ordered list of fallback selectors. A selector is `provider/model` with an optional `:thinking-level` suffix, or a bare `model` id that applies to every provider serving that model family. Bare selectors expand against the models you actually have: providers holding an OAuth credential are preferred, then a fixed precedence order, and OpenRouter is never chosen by expansion. Senpi ships bare default chains for `claude-fable-5-1` and `claude-fable-5`, so Fable 5.1 and Fable 5 keep a fallback chain whichever provider serves them; set a key to `[]` to opt out entirely, or set one `provider/claude-fable-5-1` key to override just that provider. For example, this switches Fable 5.1 to Kimi K3 at `max` thinking when an eligible failure occurs:
|
|
255
255
|
|
|
256
256
|
```json
|
|
257
257
|
{
|
|
258
258
|
"retry": {
|
|
259
259
|
"modelFallback": true,
|
|
260
260
|
"fallbackChains": {
|
|
261
|
-
"anthropic/claude-fable-5": ["ccapi/kimi-k3:max"]
|
|
261
|
+
"anthropic/claude-fable-5-1": ["ccapi/kimi-k3:max"]
|
|
262
262
|
},
|
|
263
263
|
"fallbackRevertPolicy": "cooldown-expiry"
|
|
264
264
|
}
|
|
@@ -488,7 +488,7 @@ When multiple sources specify a session directory, precedence is `--session-dir`
|
|
|
488
488
|
{
|
|
489
489
|
"modelThinkingLevels": {
|
|
490
490
|
"openai-codex/gpt-5.6-sol": "xhigh",
|
|
491
|
-
"anthropic/claude-fable-5": "high"
|
|
491
|
+
"anthropic/claude-fable-5-1": "high"
|
|
492
492
|
},
|
|
493
493
|
"modelServiceTiers": {
|
|
494
494
|
"openai-codex/gpt-5.6-sol": "priority"
|
package/docs/skills.md
CHANGED
|
@@ -132,7 +132,7 @@ description: What this skill does and when to use it. Be specific.
|
|
|
132
132
|
|
|
133
133
|
Run once before first use:
|
|
134
134
|
```bash
|
|
135
|
-
cd /path/to/skill &&
|
|
135
|
+
cd /path/to/skill && bun install
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
## Usage
|
|
@@ -249,7 +249,7 @@ description: Web search and content extraction via Brave Search API. Use for sea
|
|
|
249
249
|
## Setup
|
|
250
250
|
|
|
251
251
|
```bash
|
|
252
|
-
cd /path/to/brave-search &&
|
|
252
|
+
cd /path/to/brave-search && bun install
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
## Search
|
package/docs/terminal-tools.md
CHANGED
|
@@ -50,7 +50,7 @@ server. Nothing outlives the watch, so no cleanup.
|
|
|
50
50
|
|
|
51
51
|
```js
|
|
52
52
|
monitor({ description: "full test suite",
|
|
53
|
-
command: "if
|
|
53
|
+
command: "if bunx vitest run; then printf 'OK\n'; else code=$?; printf 'FAILED_%s\n' \"$code\"; exit \"$code\"; fi",
|
|
54
54
|
filter: "^(OK|FAILED_)" })
|
|
55
55
|
```
|
|
56
56
|
|
package/docs/termux.md
CHANGED
package/docs/tui.md
CHANGED
|
@@ -472,7 +472,7 @@ interface MyTheme {
|
|
|
472
472
|
Set `PI_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
|
|
473
473
|
|
|
474
474
|
```bash
|
|
475
|
-
PI_TUI_WRITE_LOG=/tmp/tui-ansi.log
|
|
475
|
+
PI_TUI_WRITE_LOG=/tmp/tui-ansi.log bunx tsx packages/tui/test/chat-simple.ts
|
|
476
476
|
```
|
|
477
477
|
|
|
478
478
|
## Performance
|
package/examples/AGENTS.md
CHANGED
|
@@ -48,5 +48,5 @@ Largest examples carry real complexity, not toy scope: `extensions/overlay-qa-te
|
|
|
48
48
|
## VALIDATION
|
|
49
49
|
|
|
50
50
|
- Run the focused tests for the public API demonstrated by the example.
|
|
51
|
-
- Typecheck examples through root `
|
|
51
|
+
- Typecheck examples through root `bun run check`.
|
|
52
52
|
- Interactive examples require real CLI or visual QA when their behavior changes.
|
package/examples/sdk/README.md
CHANGED
|
@@ -12,6 +12,91 @@
|
|
|
12
12
|
|
|
13
13
|
### Removed
|
|
14
14
|
|
|
15
|
+
## [2026.9.2-3] - 2026-09-02
|
|
16
|
+
|
|
17
|
+
### Breaking Changes
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- The eval prompt's JS runtime line is now runtime-aware: on a bun kernel it names `Bun <version>` and
|
|
24
|
+
`Bun.*` builtins, and only while the bundled `bun-1-4` skill is active it adds a MUST READ pointer to
|
|
25
|
+
that skill's absolute path before the first js cell; node kernels keep the Node.js worker wording.
|
|
26
|
+
`activeBunSkillPath()` exposes the same gate the `resources_discover` contribution uses.
|
|
27
|
+
- The bundled `bun-1-4` skill description is rewritten as a fact-framed MUST READ notice with
|
|
28
|
+
English-only copy (Korean trigger words removed; the `Bun.stringWidth` example no longer uses Hangul).
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Compiled binaries now contribute the bundled `bun-1-4` skill by resolving the codemode sidecar shipped next to the executable, and a missing skill is reported on stderr so it can no longer corrupt the RPC protocol stream on stdout.
|
|
33
|
+
|
|
34
|
+
### Removed
|
|
35
|
+
|
|
36
|
+
## [2026.9.2-2] - 2026-09-02
|
|
37
|
+
|
|
38
|
+
### Breaking Changes
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
### Removed
|
|
47
|
+
|
|
48
|
+
## [2026.9.2] - 2026-09-02
|
|
49
|
+
|
|
50
|
+
### Breaking Changes
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
### Removed
|
|
59
|
+
|
|
60
|
+
## [2026.8.31] - 2026-08-31
|
|
61
|
+
|
|
62
|
+
### Breaking Changes
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
|
|
66
|
+
- The codemode extension now bundles the `bun-1-4` skill and contributes it via `resources_discover` only
|
|
67
|
+
when the js eval kernel itself runs bun >= 1.4 (`process.versions.bun`); node-kernel sessions never
|
|
68
|
+
receive the skill, regardless of any bun binary on PATH.
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
|
|
74
|
+
### Removed
|
|
75
|
+
|
|
76
|
+
## [2026.8.30-3] - 2026-08-30
|
|
77
|
+
|
|
78
|
+
### Breaking Changes
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
### Fixed
|
|
85
|
+
|
|
86
|
+
### Removed
|
|
87
|
+
|
|
88
|
+
## [2026.8.30-2] - 2026-08-30
|
|
89
|
+
|
|
90
|
+
### Breaking Changes
|
|
91
|
+
|
|
92
|
+
### Added
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
98
|
+
### Removed
|
|
99
|
+
|
|
15
100
|
## [2026.8.30] - 2026-08-30
|
|
16
101
|
|
|
17
102
|
### Breaking Changes
|
|
@@ -36,7 +36,9 @@ task-tool names are known.
|
|
|
36
36
|
resolves absolute executable paths, and the eval prompt host line names the
|
|
37
37
|
JS runtime (`node`/`bun`).
|
|
38
38
|
- JavaScript import rewriting for supported local modules and package imports
|
|
39
|
-
in the persistent Node.js
|
|
39
|
+
in the persistent JS worker (Bun when senpi runs on bun, Node.js otherwise).
|
|
40
|
+
- On a Bun >= 1.4 kernel the eval prompt names the bundled `bun-1-4` skill as
|
|
41
|
+
MUST READ before the first js cell; node kernels keep the Node.js wording.
|
|
40
42
|
- GPT models receive a terse `eval` prompt dialect that prioritizes composing
|
|
41
43
|
active tools through `tool.<name>(args)` and documents detach-on-timeout.
|
|
42
44
|
|
|
@@ -44,7 +46,7 @@ task-tool names are known.
|
|
|
44
46
|
|
|
45
47
|
| Language | Default | Runtime | Notes |
|
|
46
48
|
| --- | --- | --- | --- |
|
|
47
|
-
| `js` | enabled |
|
|
49
|
+
| `js` | enabled | In-process worker on senpi's own runtime (Bun or Node.js 24+) | Supports top-level `await` and `return`; the eval prompt's runtime line follows the kernel. |
|
|
48
50
|
| `py` | enabled | `python3` or `python` | Optional interpreter detected at session start. |
|
|
49
51
|
| `rb` | disabled | `ruby` | Optional interpreter detected at session start. |
|
|
50
52
|
| `jl` | disabled | `julia` | Optional interpreter detected at session start. |
|
|
@@ -202,10 +204,10 @@ namespace to prevent recursive execution.
|
|
|
202
204
|
|
|
203
205
|
```bash
|
|
204
206
|
cd packages/senpi-codemode
|
|
205
|
-
|
|
207
|
+
bun run test
|
|
206
208
|
|
|
207
209
|
cd ../..
|
|
208
|
-
|
|
210
|
+
bun run check
|
|
209
211
|
```
|
|
210
212
|
|
|
211
213
|
Direct real-surface QA drivers live in `scripts/qa-*.ts`: kernel cells
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.9.2-3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Source-only senpi extension package for codemode evaluation tools",
|
|
6
6
|
"type": "module",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/parser": "8.0.4",
|
|
34
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.
|
|
34
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.9.2-3",
|
|
35
35
|
"typebox": "1.3.18"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@code-yeongyu/senpi": "2026.
|
|
38
|
+
"@code-yeongyu/senpi": "2026.9.2-3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@code-yeongyu/senpi": "2026.
|
|
41
|
+
"@code-yeongyu/senpi": "2026.9.2-3"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"senpi",
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { type CodemodeRuntimeAssetEnvironment, resolveCodemodeRuntimeAsset } from "../kernels/shared/runtime-asset.ts";
|
|
5
|
+
|
|
6
|
+
const BUN_SKILL_BASE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
let loggedMissingBunSkill = false;
|
|
9
|
+
|
|
10
|
+
export const BUN_SKILL_MIN_VERSION = "1.4.0";
|
|
11
|
+
|
|
12
|
+
/** Reads the js eval kernel's bun version; undefined on a node kernel. */
|
|
13
|
+
export type BunKernelVersionSource = () => string | undefined;
|
|
14
|
+
|
|
15
|
+
const kernelBunVersion: BunKernelVersionSource = () => process.versions.bun;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* True when the version is at least `BUN_SKILL_MIN_VERSION`: parses the leading
|
|
19
|
+
* `<major>.<minor>` integers of the string and gates on major > 1 || (major === 1 && minor >= 4).
|
|
20
|
+
* Unparseable or missing versions never enable the skill.
|
|
21
|
+
*/
|
|
22
|
+
export function bunVersionSupportsSkill(version: string | undefined): boolean {
|
|
23
|
+
if (version === undefined) return false;
|
|
24
|
+
const match = /^(\d+)\.(\d+)/.exec(version);
|
|
25
|
+
if (match === null) return false;
|
|
26
|
+
const major = Number.parseInt(match[1]!, 10);
|
|
27
|
+
const minor = Number.parseInt(match[2]!, 10);
|
|
28
|
+
return major > 1 || (major === 1 && minor >= 4);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const BUN_SKILL_PACKAGE_RELATIVE_PATH = join("skill", "bun-1-4", "SKILL.md");
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Absolute path of the bundled bun-1-4 SKILL.md, or undefined (logged once) when it is not shipped.
|
|
35
|
+
*
|
|
36
|
+
* A compiled Bun binary has no readable module-relative asset, so resolution falls back to the
|
|
37
|
+
* codemode sidecar shipped next to the executable, exactly as the Ruby and Julia kernel runners do.
|
|
38
|
+
* The miss is reported on stderr because stdout carries the RPC protocol stream.
|
|
39
|
+
*/
|
|
40
|
+
export function bundledBunSkillPath(
|
|
41
|
+
baseDir: string = BUN_SKILL_BASE_DIR,
|
|
42
|
+
environment: CodemodeRuntimeAssetEnvironment = {},
|
|
43
|
+
): string | undefined {
|
|
44
|
+
const localPath = join(baseDir, "..", "skill", "bun-1-4", "SKILL.md");
|
|
45
|
+
const candidate = resolveCodemodeRuntimeAsset(localPath, BUN_SKILL_PACKAGE_RELATIVE_PATH, environment);
|
|
46
|
+
if (existsSync(candidate)) return candidate;
|
|
47
|
+
if (!loggedMissingBunSkill) {
|
|
48
|
+
loggedMissingBunSkill = true;
|
|
49
|
+
// A compiled binary never has the module-relative asset, so naming only that path
|
|
50
|
+
// would hide the sidecar location an operator actually has to populate.
|
|
51
|
+
const executableDir = dirname(environment.executablePath ?? process.execPath);
|
|
52
|
+
const sidecarPath = join(
|
|
53
|
+
executableDir,
|
|
54
|
+
"node_modules",
|
|
55
|
+
"@code-yeongyu",
|
|
56
|
+
"senpi-codemode",
|
|
57
|
+
"src",
|
|
58
|
+
BUN_SKILL_PACKAGE_RELATIVE_PATH,
|
|
59
|
+
);
|
|
60
|
+
console.error(
|
|
61
|
+
`[senpi-codemode] bundled bun-1-4 skill not found at ${localPath} or ${sidecarPath}; skipping contribution`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Absolute path of the bundled bun-1-4 SKILL.md when it is active for this process:
|
|
69
|
+
* the in-process js eval kernel itself runs bun >= 1.4 (`process.versions.bun`) and the
|
|
70
|
+
* asset is shipped. A node kernel never activates it, regardless of any bun binary on PATH.
|
|
71
|
+
*/
|
|
72
|
+
export function activeBunSkillPath(
|
|
73
|
+
getKernelBunVersion: BunKernelVersionSource = kernelBunVersion,
|
|
74
|
+
baseDir?: string,
|
|
75
|
+
): string | undefined {
|
|
76
|
+
if (!bunVersionSupportsSkill(getKernelBunVersion())) return undefined;
|
|
77
|
+
return bundledBunSkillPath(baseDir);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Builds the `resources_discover` handler that contributes the active bun-1-4 skill, if any. */
|
|
81
|
+
export function createBunSkillDiscoverHandler(
|
|
82
|
+
getKernelBunVersion: BunKernelVersionSource = kernelBunVersion,
|
|
83
|
+
baseDir?: string,
|
|
84
|
+
): () => { skillPaths: string[] } | undefined {
|
|
85
|
+
return () => {
|
|
86
|
+
const skillPath = activeBunSkillPath(getKernelBunVersion, baseDir);
|
|
87
|
+
return skillPath === undefined ? undefined : { skillPaths: [skillPath] };
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function registerBunSkillContribution(
|
|
92
|
+
pi: {
|
|
93
|
+
on(
|
|
94
|
+
event: "resources_discover",
|
|
95
|
+
handler: (
|
|
96
|
+
event: unknown,
|
|
97
|
+
ctx: unknown,
|
|
98
|
+
) => Promise<{ skillPaths?: string[] } | undefined> | { skillPaths?: string[] } | undefined,
|
|
99
|
+
): void;
|
|
100
|
+
},
|
|
101
|
+
getKernelBunVersion?: BunKernelVersionSource,
|
|
102
|
+
baseDir?: string,
|
|
103
|
+
): void {
|
|
104
|
+
pi.on("resources_discover", createBunSkillDiscoverHandler(getKernelBunVersion, baseDir));
|
|
105
|
+
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { jsRuntimeInfo, jsRuntimeLabel } from "./extension/runtime-info.ts";
|
|
17
17
|
import type { CodemodeSessionManager, CreateCodemodeSessionManagerOptions } from "./extension/session-manager.ts";
|
|
18
18
|
import { SessionManagerProxy } from "./extension/session-manager-proxy.ts";
|
|
19
|
+
import { activeBunSkillPath, registerBunSkillContribution } from "./extension/skill-contribution.ts";
|
|
19
20
|
import { WAKE_SOURCE_STATE_EVENT, type WakeSourceState } from "./extension/wake-source-state.ts";
|
|
20
21
|
import { EvalDetachedCellManager, type EvalDetachedCellStatusEntry } from "./tool/detached-cell-manager.ts";
|
|
21
22
|
import {
|
|
@@ -40,7 +41,7 @@ type CodemodeEvent = SessionLifecycleEvent | "model_select";
|
|
|
40
41
|
export interface CodemodeExtensionAPI {
|
|
41
42
|
registerTool(tool: ReturnType<typeof createEvalTool>): void;
|
|
42
43
|
registerRemovedToolHint(name: string, hint: string): void;
|
|
43
|
-
on(event: CodemodeEvent, handler: (event: unknown, ctx: ExtensionContext) =>
|
|
44
|
+
on(event: CodemodeEvent | "resources_discover", handler: (event: unknown, ctx: ExtensionContext) => unknown): void;
|
|
44
45
|
executeTool: AgentExecuteTool;
|
|
45
46
|
getActiveTools(): string[];
|
|
46
47
|
getAllTools(): readonly EvalSchemaToolInfo[];
|
|
@@ -67,6 +68,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
|
|
|
67
68
|
const manager = new SessionManagerProxy();
|
|
68
69
|
const complete = options.complete ?? ((request, ctx) => createCompletionHandler()(ctx)(request));
|
|
69
70
|
const renderers = { renderCall: renderEvalCall, renderResult: renderEvalResult };
|
|
71
|
+
const bunSkillPath = activeBunSkillPath();
|
|
70
72
|
let activeRuntime: SessionRuntime | undefined;
|
|
71
73
|
let activeModelId: string | undefined;
|
|
72
74
|
let activeContext: ExtensionContext | undefined;
|
|
@@ -124,6 +126,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
|
|
|
124
126
|
spawnDefaultAgent: runtime.settings.taskTools.task,
|
|
125
127
|
hostLine: hostLine(),
|
|
126
128
|
runtimes: runtime.runtimes,
|
|
129
|
+
...(bunSkillPath === undefined ? {} : { bunSkillPath }),
|
|
127
130
|
...(modelId === undefined ? {} : { modelId }),
|
|
128
131
|
}),
|
|
129
132
|
);
|
|
@@ -158,6 +161,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
|
|
|
158
161
|
renderers,
|
|
159
162
|
hostLine: hostLine(),
|
|
160
163
|
runtimes: { js: jsRuntimeInfo() },
|
|
164
|
+
...(bunSkillPath === undefined ? {} : { bunSkillPath }),
|
|
161
165
|
}),
|
|
162
166
|
);
|
|
163
167
|
pi.registerRemovedToolHint(
|
|
@@ -168,6 +172,7 @@ export default function senpiCodemode(pi: CodemodeExtensionAPI, options: SenpiCo
|
|
|
168
172
|
"wait",
|
|
169
173
|
'wait was removed; detached eval cells notify when complete. Use eval({ action: "peek"|"stop", cell_id }) to inspect or stop one.',
|
|
170
174
|
);
|
|
175
|
+
registerBunSkillContribution(pi);
|
|
171
176
|
|
|
172
177
|
pi.on("session_start", async (event, ctx) => {
|
|
173
178
|
const previousCells = activeCells;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { EvalRuntimeInfo } from "../tool/types.ts";
|
|
2
|
+
|
|
1
3
|
export interface EnabledLanguages {
|
|
2
4
|
readonly py: boolean;
|
|
3
5
|
readonly js: boolean;
|
|
@@ -18,6 +20,10 @@ export interface EvalPromptOptions {
|
|
|
18
20
|
readonly modelId?: string;
|
|
19
21
|
/** Preformatted host line (e.g. "darwin arm64 · Apple M5 Max · 18 cores"); enables the host-sizing note. */
|
|
20
22
|
readonly hostLine?: string;
|
|
23
|
+
/** Identity of the in-process js kernel; a bun runtime swaps the Node.js worker line for the Bun one. */
|
|
24
|
+
readonly jsRuntime?: EvalRuntimeInfo;
|
|
25
|
+
/** Absolute path of the active bun-1-4 skill; rendered as a MUST READ pointer only on a bun kernel. */
|
|
26
|
+
readonly bunSkillPath?: string;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
/** Prompt dialect for the eval-first batching emphasis. */
|
|
@@ -132,7 +138,7 @@ Fields:
|
|
|
132
138
|
A detached cell keeps its language kernel busy while it finishes; another language can continue. Do not re-run a detached cell: the same-language busy error names its cell id and output tail. Completion arrives as one notification with the final value/error and buffered output. Stopping a cell interrupts its kernel; the stop result states whether kernel state survived or the kernel was restarted and its variables lost.
|
|
133
139
|
|
|
134
140
|
{{#if py}}Live event loop: use top-level \`await\` directly; \`asyncio.run(…)\` raises "cannot be called from a running event loop".{{/if}}
|
|
135
|
-
{{#if js}}JS runs under Node.js worker: top-level \`await\`/\`return\` work; \`fetch\`/\`Buffer\` available.{{/if}}
|
|
141
|
+
{{#if js}}{{#if jsBun}}JS runs in-process on Bun {{jsVersion}}: top-level \`await\`/\`return\` work; \`Bun.*\` builtins available.{{#if bunSkillPath}} MUST READ the bun-1-4 skill at {{bunSkillPath}} before your first js cell — its builtins replace the npm packages you would otherwise install.{{/if}}{{else}}JS runs under Node.js worker: top-level \`await\`/\`return\` work; \`fetch\`/\`Buffer\` available.{{/if}}{{/if}}
|
|
136
142
|
{{#if rb}}Ruby: synchronous; helper options are keyword args{{#if spawns}} (e.g. \`output("id", limit: 2)\`){{/if}}; the last expression auto-displays unless it is \`nil\`, an assignment, or a definition (like IRB).{{/if}}
|
|
137
143
|
{{#if jl}}Julia: synchronous; helper options are standard keyword args{{#if spawns}} (e.g. \`output("id", limit=2)\`){{/if}}; the last expression auto-displays unless it is an assignment or a definition (like the Julia REPL).{{/if}}
|
|
138
144
|
On error, fix and re-run only the failing step. State usually survives a normal error, but a timeout or stop may have restarted the kernel — its message says which. Before rebuilding state, check a sentinel (a variable you defined earlier); only re-establish what is actually gone, since blind re-runs duplicate side effects.
|
|
@@ -212,6 +218,9 @@ export function buildEvalPrompt(
|
|
|
212
218
|
styleKimi: style === "kimi",
|
|
213
219
|
styleDefault: style === "default",
|
|
214
220
|
hostLine: options.hostLine ?? "",
|
|
221
|
+
jsBun: options.jsRuntime?.name === "bun",
|
|
222
|
+
jsVersion: options.jsRuntime?.version ?? "",
|
|
223
|
+
bunSkillPath: options.bunSkillPath ?? "",
|
|
215
224
|
};
|
|
216
225
|
const examples = REUSE_CHAIN_EXAMPLES.filter((example) => enabled[example.language])
|
|
217
226
|
.map((example) => {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bun-1-4
|
|
3
|
+
description: "MUST READ before your first js eval cell: this session's eval js kernel runs Bun 1.4+ (this skill is present only when it does). Also read before any bun -e, script, server, CLI, test, bundle, or package-management work. Bun 1.4 ships builtins that replace 15+ npm deps — check here BEFORE installing sharp, puppeteer/playwright (scraping), marked, node-cron, node-pty, concurrently, serve-static, tar, json5, fast-xml-parser, string-width. Triggers: eval js, bun, Bun.serve, bun test, bun build, bun install, bun run, image resize, headless browser, markdown render, cron, PTY."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bun 1.4 — Use the Builtins First
|
|
7
|
+
|
|
8
|
+
Bun 1.4 (2026) ships builtins that replace most utility npm packages. **Before adding a dependency or writing a workaround, check the capability map below — if Bun ships it, use the builtin.** This skill is loaded because this session's `eval` js kernel runs Bun >= 1.4; on other machines or pinned projects, confirm with `bun --version` ([v1.3.x]/[v1.4.0] tags in the references give exact minimums). Release post: <https://bun.com/blog/bun-v1.4>
|
|
9
|
+
|
|
10
|
+
## Capability map — what you can do now
|
|
11
|
+
|
|
12
|
+
| You want to... | Use | Replaces | Ref = `references/<name>.md` |
|
|
13
|
+
|---|---|---|---|
|
|
14
|
+
| Resize/convert/rotate images | `Bun.file(p).image().resize().webp().write()` | sharp | runtime-apis |
|
|
15
|
+
| Headless browser: navigate, click, screenshot, evaluate, CDP | `new Bun.WebView()` | puppeteer, playwright (scraping) | runtime-apis |
|
|
16
|
+
| Markdown → HTML / React / ANSI | `Bun.markdown.html() / .react() / .render()` | marked, react-markdown | runtime-apis |
|
|
17
|
+
| Schedule cron jobs | `Bun.cron()` | node-cron | runtime-apis |
|
|
18
|
+
| Drive a PTY (bash, vim, TUIs) from JS | `Bun.spawn([...], { terminal })` | node-pty | runtime-apis |
|
|
19
|
+
| Run package scripts concurrently, glob-matched | `bun run --parallel "build:*"` | concurrently, npm-run-all | runtime-apis |
|
|
20
|
+
| Parse JSON5 / JSONL / JSONC / XML / TOML; tarballs | `Bun.JSON5/.JSONL/.JSONC/.XML/.TOML`, `Bun.Archive` | json5, ndjson, jsonc-parser, fast-xml-parser, @iarna/toml, tar | runtime-apis |
|
|
21
|
+
| ANSI-aware terminal text: width, slice, wrap | `Bun.stringWidth()`, `Bun.sliceAnsi()`, `Bun.wrapAnsi()` | string-width, slice-ansi, wrap-ansi | runtime-apis |
|
|
22
|
+
| Call C libraries 3x faster, plain strings back | `bun:ffi` (`buffer_length`, `cstring`) | — | runtime-apis |
|
|
23
|
+
| Serve a static dir (ETag/Range/304 handled) | `Bun.serve({ routes: { "/x/*": { dir } } })` | express.static, serve-static, sirv | http-networking |
|
|
24
|
+
| HTTP/3 server; `fetch` protocol/compress/proxy | `http3: true`, `fetch(url, { protocol, compress, proxy })` | — | http-networking |
|
|
25
|
+
| Tests across CPU workers / CI shards / changed files / flaky retry | `bun test --parallel --shard=1/3 --changed=main --retry` | jest/vitest infra | test |
|
|
26
|
+
| Kill "passes alone, fails in suite" bugs | `bun test --isolate` | vitest default behavior | test |
|
|
27
|
+
| React Compiler auto-memoization | `bun build --react-compiler` | babel-plugin-react-compiler | build |
|
|
28
|
+
| Embed assets/dirs into a single-file executable | `bun build --compile --asset ./public` | pkg hacks | build |
|
|
29
|
+
| Compile-time feature flags, in-memory bundling, metafile | `bun:bundle feature()`, `files:{}`, `metafile: true` | esbuild define/plugins | build |
|
|
30
|
+
| Diff package versions, fix vulns, dedupe/prune, license audit | `bun pm diff`, `bun audit fix`, `bun dedupe`, `bun prune`, `bun pm licenses` | npm-diff, npm audit fix | install |
|
|
31
|
+
| 7x faster CI installs (global virtual store) | `linker = "isolated"` in bunfig.toml | pnpm store | install |
|
|
32
|
+
| Profile CPU/heap/bundle as grep-able Markdown | `bun --cpu-prof-md`, `--heap-prof-md`, `bun build --metafile-md` | Chrome DevTools round-trip | dev-tooling |
|
|
33
|
+
| Native REPL; render Markdown in terminal | `bun repl`, `bun ./README.md` | node repl, glow | runtime-apis |
|
|
34
|
+
| Run Playwright, vitest, Next.js 16, OpenTelemetry, dd-trace | they now just work | Node.js | node-compat-platforms |
|
|
35
|
+
|
|
36
|
+
Free wins (no code change): 2x lower CPU, 13-48% less server memory, 2-2.5x faster startup — full numbers in [performance](references/performance.md).
|
|
37
|
+
|
|
38
|
+
## Operating rules
|
|
39
|
+
|
|
40
|
+
1. **Eval-first.** The `eval` js kernel runs on Bun (that is why this skill is present): call `Bun.*` APIs directly inside js cells. Reach for `bash` or a spawned `bun <file>` / `bun -e` only for CLI surfaces (`bun test`, `bun build`, `bun pm`) or work that needs a separate process.
|
|
41
|
+
2. **Builtin-first.** The Replaces column above is a ban list for new dependencies, in production code, test helpers, and one-off scripts alike.
|
|
42
|
+
3. **Read the matching reference before using an unfamiliar API** — signatures and caveats (e.g. `Bun.markdown` HTML is unsanitized, HTTP/3 is experimental) live there, not here.
|
|
43
|
+
4. **Upgrading a project to 1.4 or debugging behavior that changed?** Read [breaking-changes](references/breaking-changes.md) first — YAML/TOML strictness, `.xml`/`.css` import semantics, `Bun.$` globbing, fetch header combining, and WebSocket close timing all changed.
|
|
44
|
+
5. **TLS errors after upgrade are usually intentional** — 1.4 tightened certificate verification across `fetch`, `tls.connect`, `Bun.connect`, `RedisClient`. See [security](references/security.md) before loosening anything.
|
package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/breaking-changes.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Upgrading to Bun 1.4 — Behavior Changes
|
|
2
|
+
|
|
3
|
+
Blog: [#upgrading-to-1-4](https://bun.com/blog/bun-v1.4#upgrading-to-1-4). Most code is unaffected. Scan the Top 5, then the table for whatever subsystem you touched.
|
|
4
|
+
|
|
5
|
+
## Top 5 most likely to bite
|
|
6
|
+
|
|
7
|
+
1. **Node.js 26**: `NODE_MODULE_VERSION` is 147 (native addons need a 147 build); `res.writeHeader()` removed → use `res.writeHead()`; paused-mode `readable.read()` returns ONE chunk → loop until `null`.
|
|
8
|
+
2. **New monorepos default to the isolated linker** (`configVersion: 1`). Existing lockfiles keep hoisted. Opt out: `linker = "hoisted"` in bunfig.toml.
|
|
9
|
+
3. **Bun invoked as `node`** (`bun --bun`, `bunx --bun`, node symlink) no longer loads `.env` files. Pass `--env-file` to keep them.
|
|
10
|
+
4. **`Bun.YAML` is YAML 1.2**: `yes`/`no`/`on`/`off` are strings. GitHub Actions `on:` parses as `"on"`.
|
|
11
|
+
5. **`Bun.TOML` / `bunfig.toml` are strict**: unquoted strings, missing newlines, ints past `MAX_SAFE_INTEGER` → `SyntaxError` at startup. Quote your values.
|
|
12
|
+
|
|
13
|
+
## Module resolution / loaders
|
|
14
|
+
|
|
15
|
+
| Change | Migration |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `.xml` imports return the parsed document (was: file path) | `--loader .xml:file` to keep the path |
|
|
18
|
+
| `.css` imports at runtime export `{}` (was: absolute path) | — |
|
|
19
|
+
| `import "."` / `".."` resolve as directories (index/main), matching Node | name the sibling file explicitly |
|
|
20
|
+
| `"jsx": "react-jsx"` emits `jsx` (was: `jsxDEV` unless production) | use `"react-jsxdev"` for the dev runtime |
|
|
21
|
+
| `useDefineForClassFields: false` now honored like tsc | remove the option to keep old output |
|
|
22
|
+
|
|
23
|
+
## Bun APIs
|
|
24
|
+
|
|
25
|
+
| Change | Migration |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `Bun.$` globs only patterns written in the template — `${...}` interpolated globs are literal | write the pattern in the template: `` $`echo **/*` `` |
|
|
28
|
+
| `Bun.cron.parse()` / in-process `Bun.cron()` use LOCAL time (was UTC) | pass `{ tz: "UTC" }` |
|
|
29
|
+
| `Bun.Socket#setKeepAlive(true, delay)`: `delay` is milliseconds now | pass ms, not seconds |
|
|
30
|
+
| `Bun.mmap({ offset })`: view starts at `offset` exactly (was page-rounded) | remove `offset % pageSize` compensation |
|
|
31
|
+
| `bun:ffi`: `cstring` values are plain strings; `CString` has no `.ptr` | keep the original pointer to free |
|
|
32
|
+
| `Bun.serve({ inspector })` removed | `bun --inspect` |
|
|
33
|
+
| `server.publish()`/`ws.publish()` return `0` (dropped) / `-1` (backpressure) | treat 0/-1 specially |
|
|
34
|
+
| `server.stop()` waits for in-flight requests, closes idle connections | `stop(true)` to force |
|
|
35
|
+
| `Bun.sql`: MySQL `DATETIME`/`TIMESTAMP` decoded as UTC; MariaDB 10.5+ JSON columns parsed to objects | remove offset corrections and `JSON.parse()` calls |
|
|
36
|
+
| `Bun.randomUUIDv7()`, `Bun.udpSocket()`, `Bun.password`, `Bun.spawn` timeout/killSignal/argv0 | invalid inputs now throw instead of silently clamping |
|
|
37
|
+
|
|
38
|
+
## fetch / WebSocket / HTTP
|
|
39
|
+
|
|
40
|
+
| Change | Migration |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Duplicate headers combined with `, ` per Fetch spec (was: last wins) | parse combined values |
|
|
43
|
+
| `clone()` throws after body read (`Body is disturbed or locked`) | clone BEFORE reading |
|
|
44
|
+
| Network errors are `TypeError` (`.code` still set); failed body read sets `bodyUsed` | retry with a NEW fetch() |
|
|
45
|
+
| `redirect: "error"` rejects only on 301/302/303/307/308 (304 resolves now) | — |
|
|
46
|
+
| global `WebSocket` no longer accepts `agent` (ws module's does) | import from "ws" |
|
|
47
|
+
| `WebSocket#close()` queues the close event — `readyState` is CLOSING when it returns | await the `close` event |
|
|
48
|
+
| `close()`/`ping()`/`pong()` validate codes/reason/payload sizes | shorten/fix values |
|
|
49
|
+
| Handshake fails (1002) when requested subprotocol isn't negotiated | fix server echo or drop `protocols` |
|
|
50
|
+
|
|
51
|
+
## node: modules
|
|
52
|
+
|
|
53
|
+
| Change | Migration |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `fs.rmdir` rejects `{ recursive: true }` | `fs.rm(path, { recursive: true, force: true })` |
|
|
56
|
+
| `dns.lookup()` uses the system resolver (getaddrinfo) on Linux — split-DNS/VPN names now resolve | `Bun.dns.lookup(name, { backend: "c-ares" })` for old behavior |
|
|
57
|
+
| fs/dns/pbkdf2 callback exceptions are `uncaughtException` (was unhandledRejection) | move the handler |
|
|
58
|
+
| `dgram`: second `bind()` and post-`close()` calls throw synchronously | try/catch |
|
|
59
|
+
| `tls.createServer({ requestCert: true })` rejects unverified client certs by default | `rejectUnauthorized: false` to admit them |
|
|
60
|
+
| `X509Certificate` serial/modulus are UPPERCASE hex | normalize case when pinning |
|
|
61
|
+
| `child_process.spawn()` ignores `options.encoding` (always Buffers) | `child.stdout.setEncoding()` |
|
|
62
|
+
| `process.title` defaults to `argv[0]`; warnings print as `(node:PID) [CODE] ...` | — |
|
|
63
|
+
|
|
64
|
+
## bun test
|
|
65
|
+
|
|
66
|
+
- `jest.resetAllMocks()` drops implementations (matches Jest) — use `clearAllMocks()` for history-only.
|
|
67
|
+
- `toContain()` uses `===` (not `Object.is`); `toEqual()` compares Temporal by value.
|
|
68
|
+
|
|
69
|
+
## Misc
|
|
70
|
+
|
|
71
|
+
- x64 builds are baseline-only (no more separate haswell build; `-baseline` URLs still work).
|
|
72
|
+
- `Temporal` defined by default (`BUN_JSC_useTemporal=0` to disable).
|
|
73
|
+
- `bun.lock` is `lockfileVersion: 2`; nested/version-scoped overrides produce v3 (older Bun can't read v3).
|
|
74
|
+
- `bun feedback` removed; `Bun.password.hash()` argon2 requires `memoryCost >= 8`.
|
|
75
|
+
- Full exhaustive list: [Other behavior changes](https://bun.com/blog/bun-v1.4#other-behavior-changes) and the [Changelog](https://bun.com/blog/bun-v1.4#changelog).
|