@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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# bun build / Bun.build() in 1.4
|
|
2
|
+
|
|
3
|
+
## Built-in React Compiler [v1.4.0]
|
|
4
|
+
|
|
5
|
+
Blog: [#built-in-react-compiler](https://bun.com/blog/bun-v1.4#built-in-react-compiler)
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
await Bun.build({ entrypoints: ["./src/index.tsx"], outdir: "./dist", reactCompiler: true });
|
|
9
|
+
// or: bun build --react-compiler
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
React's auto-memoization compiler runs inside Bun's parser — no Babel/SWC round-trip. On ~860 components: +71ms build cost, ~20x faster than the Babel plugin (9.15s); full `--compile` build 3.6x faster.
|
|
13
|
+
|
|
14
|
+
## Barrel import optimization [v1.3.10]
|
|
15
|
+
|
|
16
|
+
Blog: [#barrel-import-optimization](https://bun.com/blog/bun-v1.4#barrel-import-optimization)
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
await Bun.build({ entrypoints: ["./src/index.tsx"], optimizeImports: ["antd", "@mui/material"] });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`import { Button } from "antd"` skips the hundreds of files behind names you didn't import. Automatic for packages with `"sideEffects": false`; opt others in with `optimizeImports`.
|
|
23
|
+
|
|
24
|
+
## Compile-time feature flags: bun:bundle [v1.3.5]
|
|
25
|
+
|
|
26
|
+
Blog: [#compile-time-feature-flags-with-bun-bundle](https://bun.com/blog/bun-v1.4#compile-time-feature-flags-with-bun-bundle)
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { feature } from "bun:bundle";
|
|
30
|
+
if (feature("SUPER_SECRET")) { console.log("enabled"); }
|
|
31
|
+
// bun build --feature=SUPER_SECRET index.ts (also works in bun run and bun test)
|
|
32
|
+
// Bun.build({ features: ["SUPER_SECRET"] })
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Becomes `true`/`false` at build time; dead branch removed.
|
|
36
|
+
|
|
37
|
+
## In-memory files [v1.3.6]
|
|
38
|
+
|
|
39
|
+
Blog: [#in-memory-files-in-bun-build](https://bun.com/blog/bun-v1.4#in-memory-files-in-bun-build)
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
await Bun.build({
|
|
43
|
+
entrypoints: ["/app/index.ts"],
|
|
44
|
+
files: {
|
|
45
|
+
"/app/index.ts": `import { greet } from "./greet.ts"; console.log(greet("World"));`,
|
|
46
|
+
"/app/greet.ts": `export function greet(n: string) { return "Hello, " + n; }`,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Strings, Blobs, or TypedArrays; virtual paths override disk. Ideal for codegen and stubbing modules in tests.
|
|
52
|
+
|
|
53
|
+
## Single-file HTML [v1.3.10]
|
|
54
|
+
|
|
55
|
+
Blog: [#single-file-html-with-compile-target-browser](https://bun.com/blog/bun-v1.4#single-file-html-with-compile-target-browser)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
bun build ./index.html --compile --target=browser --outdir=dist
|
|
59
|
+
# → dist/index.html — every script/stylesheet/asset inlined, opens from file://
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## --asset: embed files/dirs into executables [v1.4.0]
|
|
63
|
+
|
|
64
|
+
Blog: [#asset](https://bun.com/blog/bun-v1.4#asset)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
bun build ./build/index.js --compile \
|
|
68
|
+
--asset ./build/client --asset ./build/prerendered \
|
|
69
|
+
--outfile server
|
|
70
|
+
./server # every route + static asset served from the binary
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Keeps original filenames; `path.join(import.meta.dir, ...)` works. `node:fs` treats `/$bunfs/` as a real tree (`existsSync`, `readdirSync` recursive/withFileTypes, ...), so static-file servers run unmodified inside the binary.
|
|
74
|
+
|
|
75
|
+
## Bytecode for ES modules [v1.3.9]
|
|
76
|
+
|
|
77
|
+
Blog: [#bytecode-compilation-for-es-modules](https://bun.com/blog/bun-v1.4#bytecode-compilation-for-es-modules)
|
|
78
|
+
|
|
79
|
+
`--bytecode --format=esm` (requires `--compile`) enables top-level await, `import.meta`, dynamic imports, and code splitting in bytecode-compiled binaries (previously CJS-only).
|
|
80
|
+
|
|
81
|
+
## metafile: true and --metafile-md [v1.3.6 / v1.3.8]
|
|
82
|
+
|
|
83
|
+
Blog: [#metafile-true](https://bun.com/blog/bun-v1.4#metafile-true), [#metafile-md](https://bun.com/blog/bun-v1.4#metafile-md)
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
const result = await Bun.build({ entrypoints: ["./index.js"], metafile: true });
|
|
87
|
+
result.metafile.inputs; result.metafile.outputs; // esbuild metafile format — works with esbuild.github.io/analyze
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
bun build entry.js --metafile-md=analysis.md --outdir=dist # Markdown bundle report: largest modules,
|
|
92
|
+
# per-entry breakdowns, dependency chains — grep it or hand to an LLM
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Standard TC39 decorators [v1.3.10]
|
|
96
|
+
|
|
97
|
+
Blog: [#standard-tc39-decorators](https://bun.com/blog/bun-v1.4#standard-tc39-decorators)
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
function logged(value, { kind, name }) {
|
|
101
|
+
if (kind === "method") return function (...args) { console.log(`calling ${name}`); return value.call(this, ...args); };
|
|
102
|
+
}
|
|
103
|
+
class C { @logged greet() {} }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Active when `experimentalDecorators` is off in tsconfig. Classes, methods, fields, accessors, private members; passes esbuild's decorator test suite.
|
|
107
|
+
|
|
108
|
+
## Code splitting: 14x faster on huge graphs [v1.4.0]
|
|
109
|
+
|
|
110
|
+
Reachability walk is now BFS O(V+E); a 20,000-module DAG links in 320ms (was 4.65s). Tree-shaking/TLA/CSS-order passes use explicit stacks, so linear chains of thousands of modules link without stack growth.
|
|
111
|
+
|
|
112
|
+
## Compile gotcha (v1.3.4 change)
|
|
113
|
+
|
|
114
|
+
`bun build --compile` binaries no longer auto-load `tsconfig.json` / `package.json` from the runtime cwd. Opt back in with `--compile-autoload-tsconfig` / `--compile-autoload-package-json`. `.env` and `bunfig.toml` still auto-load.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Bun 1.4 Dev Tooling & Observability
|
|
2
|
+
|
|
3
|
+
Blog: [#dev-tooling](https://bun.com/blog/bun-v1.4#dev-tooling), [#observability](https://bun.com/blog/bun-v1.4#observability)
|
|
4
|
+
|
|
5
|
+
## Markdown profilers — built for terminals and LLMs
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun --cpu-prof-md ./app.ts # CPU profile as Markdown: hot functions by self time,
|
|
9
|
+
# call tree, who-calls-whom. grep it, paste into a bug or an LLM.
|
|
10
|
+
bun --heap-prof-md ./app.ts # heap profile as Markdown: total size, types by retained size,
|
|
11
|
+
# largest objects, retention chains. Includes grep recipes in the header.
|
|
12
|
+
bun build ./src/index.ts --outdir ./dist --metafile-md=./dist/meta.md # bundle-size analysis as Markdown
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- `bun --cpu-prof` / `--heap-prof` still write `.cpuprofile` / V8-compatible `.heapsnapshot` for Chrome DevTools / VS Code.
|
|
16
|
+
- `BUN_CPU_PROFILE=1` turns on the CPU profiler for a process you cannot pass flags to (e.g. a framework-spawned worker).
|
|
17
|
+
- **Agent workflow: when a Bun process is slow or leaking, run the `-md` variants and read the report directly — no DevTools round-trip.**
|
|
18
|
+
|
|
19
|
+
## Async stack traces [v1.4.0]
|
|
20
|
+
|
|
21
|
+
Errors from async native APIs (`fs.promises`, `Bun.file()`, S3, DNS, crypto, `fetch`) point at the `await` in your code, not native frames.
|
|
22
|
+
|
|
23
|
+
## Process lifetime & env flags
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun --no-orphans app.ts # exit when parent dies; SIGKILL every descendant on exit (Linux/macOS/Windows)
|
|
27
|
+
bun --no-env-file app.ts # skip automatic .env loading (or env = false in bunfig.toml) — use in prod/CI
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## APM / tracing works now
|
|
31
|
+
|
|
32
|
+
- **`node:inspector`**: a `Session` can start/stop CPU profiles while the app runs (`Profiler.start`/`Profiler.stop`).
|
|
33
|
+
- **Datadog**: `dd-trace` traces requests; `@datadog/pprof` profiles continuously (required V8 C++ APIs implemented).
|
|
34
|
+
- **OpenTelemetry**: `@opentelemetry/instrumentation-http` and `-fs` export spans; `shimmer` and `require-in-the-middle` can patch bundled code.
|
package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/http-networking.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Bun 1.4 HTTP & Networking
|
|
2
|
+
|
|
3
|
+
## Serve files & folders (replaces express.static, serve-static, sirv) [v1.4.0]
|
|
4
|
+
|
|
5
|
+
Docs: <https://bun.com/docs/runtime/http/routing> · Blog: [#serve-files-folders](https://bun.com/blog/bun-v1.4#serve-files-folders)
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
Bun.serve({
|
|
9
|
+
routes: {
|
|
10
|
+
"/static/*": { dir: "./public" },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- Files stream with `sendfile`; `Content-Type`, `ETag`, `Last-Modified`, `304`, and `Range` handled automatically; `index.html` served for directories.
|
|
16
|
+
- Path traversal is blocked: paths normalized, and on Linux files open with `openat2` + `O_RESOLVE_BENEATH` so symlinks can't escape the directory.
|
|
17
|
+
|
|
18
|
+
## Range and conditional requests [v1.3.13, improved v1.4.0]
|
|
19
|
+
|
|
20
|
+
Blog: [#range-and-conditional-requests](https://bun.com/blog/bun-v1.4#range-and-conditional-requests)
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
Bun.serve({
|
|
24
|
+
routes: { "/video.mp4": new Response(Bun.file("./video.mp4")) },
|
|
25
|
+
});
|
|
26
|
+
// curl -H 'Range: bytes=0-1023' → 206 Partial Content
|
|
27
|
+
// curl -H 'If-None-Match: "..."' → 304 Not Modified
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Static routes and `Bun.file()` bodies handle `Range` (206), `If-None-Match`/`If-Modified-Since` (304), `If-Match`/`If-Unmodified-Since` (412). Video seeking and resumable downloads work out of the box.
|
|
31
|
+
|
|
32
|
+
## HTTP/3 in Bun.serve() — EXPERIMENTAL [v1.3.14, improved v1.4.0]
|
|
33
|
+
|
|
34
|
+
Docs: <https://bun.com/docs/runtime/http/server> · Blog: [#http-3-in-bun-serve-experimental](https://bun.com/blog/bun-v1.4#http-3-in-bun-serve-experimental)
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
Bun.serve({
|
|
38
|
+
port: 443,
|
|
39
|
+
tls: { /* cert, key */ },
|
|
40
|
+
http3: true, // also listen on UDP/443
|
|
41
|
+
// h1: false, // optional: HTTP/3 only
|
|
42
|
+
fetch(req) { return new Response("hi"); },
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- HTTP/1.1 keeps working over TCP; `Alt-Svc` header advertises H3 so browsers upgrade themselves. 2.7x faster than HTTPS/1.1 on static routes.
|
|
47
|
+
- **Do not ship `http3: true` to production yet**: 0-RTT resumption disabled, `server.upgrade()` returns `false` over H3, `unix:` sockets skip the H3 listener.
|
|
48
|
+
|
|
49
|
+
## HTTP/2 & HTTP/3 in fetch() — EXPERIMENTAL [v1.3.14, improved v1.4.0]
|
|
50
|
+
|
|
51
|
+
Blog: [#http-2-http-3-in-fetch-experimental](https://bun.com/blog/bun-v1.4#http-2-http-3-in-fetch-experimental)
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const [a, b] = await Promise.all([
|
|
55
|
+
fetch(url1, { protocol: "http2" }), // concurrent same-origin requests share one connection
|
|
56
|
+
fetch(url2, { protocol: "http2" }),
|
|
57
|
+
]);
|
|
58
|
+
const res = await fetch(url3, { protocol: "http3" });
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- Redirects, decompression, streaming behave as over HTTP/1.1.
|
|
62
|
+
- Global opt-in: `BUN_FEATURE_FLAG_EXPERIMENTAL_HTTP2_CLIENT=1` or `--experimental-http3-fetch` (Bun remembers per-origin H3 support).
|
|
63
|
+
|
|
64
|
+
## fetch() request compression [v1.4.0]
|
|
65
|
+
|
|
66
|
+
Blog: [#fetch-request-compression](https://bun.com/blog/bun-v1.4#fetch-request-compression)
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
await fetch(url, {
|
|
70
|
+
method: "POST",
|
|
71
|
+
body: largeJsonString,
|
|
72
|
+
compress: "gzip", // or true, "deflate", "br", "zstd", { encoding, level }
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Buffered bodies (string, ArrayBuffer, TypedArray, Blob) are compressed and `Content-Encoding`/`Content-Length` set automatically; streaming bodies pass through unchanged.
|
|
77
|
+
|
|
78
|
+
## fetch() proxy headers [v1.3.4]
|
|
79
|
+
|
|
80
|
+
Blog: [#fetch-proxy-headers](https://bun.com/blog/bun-v1.4#fetch-proxy-headers)
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
await fetch(url, {
|
|
84
|
+
proxy: {
|
|
85
|
+
url: "http://proxy.example.com:8080",
|
|
86
|
+
headers: { "Proxy-Authorization": "Bearer token" },
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## TLS session resumption + connection reuse [v1.3.10-v1.4.0]
|
|
92
|
+
|
|
93
|
+
Blog: [#tls-session-resumption](https://bun.com/blog/bun-v1.4#tls-session-resumption), [#connection-reuse](https://bun.com/blog/bun-v1.4#connection-reuse)
|
|
94
|
+
|
|
95
|
+
- Second cold connection to an origin resumes at 1 RTT (32-entry per-origin LRU of BoringSSL client sessions).
|
|
96
|
+
- `fetch()` reuses connections through HTTPS proxies and for requests with custom TLS options (client cert, custom CA). No code change needed.
|
|
97
|
+
|
|
98
|
+
## HTML routes: sourcemaps off in production [v1.4.0]
|
|
99
|
+
|
|
100
|
+
Blog: [#html-routes-sourcemaps-disabled-in-production](https://bun.com/blog/bun-v1.4#html-routes-sourcemaps-disabled-in-production)
|
|
101
|
+
|
|
102
|
+
Production `Bun.serve` no longer serves sourcemaps for HTML routes (dev mode still does). Override in `bunfig.toml`:
|
|
103
|
+
|
|
104
|
+
```toml
|
|
105
|
+
[serve.static]
|
|
106
|
+
sourcemap = "linked"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Server lifecycle changes worth knowing (v1.4)
|
|
110
|
+
|
|
111
|
+
- `server.stop()` now closes idle keep-alive connections immediately, waits for in-flight responses, and resolves when the last connection closes. `server.stop(true)` force-closes stalled ones.
|
|
112
|
+
- `server.publish()` / `ws.publish()` return `0` (dropped/no subscribers) or `-1` (backpressure) instead of always the byte count.
|
|
113
|
+
- Per-method route objects (`{ GET }`) answer `HEAD` with the GET handler automatically.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# bun install & package management in 1.4
|
|
2
|
+
|
|
3
|
+
## Global virtual store: up to 7x faster installs [v1.3.14]
|
|
4
|
+
|
|
5
|
+
Blog: [#global-virtual-store-up-to-7x-faster-installs](https://bun.com/blog/bun-v1.4#global-virtual-store-up-to-7x-faster-installs)
|
|
6
|
+
|
|
7
|
+
```toml
|
|
8
|
+
# bunfig.toml
|
|
9
|
+
[install]
|
|
10
|
+
linker = "isolated"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
With the isolated linker, packages extract once into Bun's global cache and are symlinked into `node_modules/.bun/` (one `symlink()` per package instead of one `clonefileat()`). Warm-cache CI installs of 1,400 packages: 7x faster. Opt-in for existing projects; **new monorepos default to isolated** (see below).
|
|
14
|
+
|
|
15
|
+
## New subcommands [v1.4.0]
|
|
16
|
+
|
|
17
|
+
Blog anchors: [#bun-pm-diff](https://bun.com/blog/bun-v1.4#bun-pm-diff), [#bun-audit-fix](https://bun.com/blog/bun-v1.4#bun-audit-fix), [#bun-dedupe](https://bun.com/blog/bun-v1.4#bun-dedupe), [#bun-prune](https://bun.com/blog/bun-v1.4#bun-prune), [#bun-pm-licenses](https://bun.com/blog/bun-v1.4#bun-pm-licenses)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun pm diff react # lockfile version → latest; un-minifies before diffing;
|
|
21
|
+
bun pm diff react@18.2.0 19.0.0 # summary flags new install scripts + new child_process/fs/net/vm imports
|
|
22
|
+
bun pm diff ./vendored-pkg pkg@2.1.0
|
|
23
|
+
|
|
24
|
+
bun audit fix # upgrade vulnerable packages to safe versions; --latest allows majors; --dry-run
|
|
25
|
+
bun dedupe # collapse duplicate versions in bun.lock; --check fails CI on dupes
|
|
26
|
+
bun prune --production # delete node_modules entries not in bun.lock; --production drops devDeps
|
|
27
|
+
bun pm licenses --prod --json # dependency license inventory
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Docker pattern: build with devDeps, ship without:
|
|
31
|
+
|
|
32
|
+
```dockerfile
|
|
33
|
+
RUN bun install --frozen-lockfile
|
|
34
|
+
COPY . .
|
|
35
|
+
RUN bun run build
|
|
36
|
+
RUN bun prune --production
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## bun update: transitive + patterns [v1.4.0]
|
|
40
|
+
|
|
41
|
+
Blog: [#bun-update-updates-transitive-dependencies](https://bun.com/blog/bun-v1.4#bun-update-updates-transitive-dependencies)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bun update # now updates deps-of-deps too
|
|
45
|
+
bun update zod # updates zod everywhere it appears
|
|
46
|
+
bun update '@types/*' --latest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`bun update <name>` errors (exit 1) if nothing depends on it (no longer silently adds).
|
|
50
|
+
|
|
51
|
+
## Monorepo: --filter and --catalog [v1.4.0]
|
|
52
|
+
|
|
53
|
+
Blog: [#bun-add-filter](https://bun.com/blog/bun-v1.4#bun-add-filter), [#bun-add-catalog](https://bun.com/blog/bun-v1.4#bun-add-catalog)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
bun add zod --filter api # add to one workspace from the repo root
|
|
57
|
+
bun run --filter 'web...' build # web + its dependencies; '...web' = its dependents
|
|
58
|
+
bun add react --catalog # add to root catalog, write "catalog:" in the workspace
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Plain `bun add x` in a workspace whose default catalog lists `x` writes `catalog:` automatically.
|
|
62
|
+
|
|
63
|
+
## Nested overrides [v1.4.0]
|
|
64
|
+
|
|
65
|
+
Blog: [#nested-overrides](https://bun.com/blog/bun-v1.4#nested-overrides)
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"overrides": {
|
|
70
|
+
"express": { "qs": "6.13.0" },
|
|
71
|
+
"lodash@<4.17.21": "4.17.21"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
npm nested form, yarn `a/b`, pnpm `a>b` all work; overrides can be version-scoped. Lockfiles using these become `lockfileVersion: 3` (older Bun can't read them).
|
|
77
|
+
|
|
78
|
+
## Supply-chain hardening
|
|
79
|
+
|
|
80
|
+
- **Lockfile integrity** [v1.3.10]: `bun.lock` records SHA-512 for GitHub and tarball deps, like npm packages.
|
|
81
|
+
- **`trustedDependencies` auto-trust is npm-registry-only** [v1.3.5]: a `git:`/`github:`/`file:` package named `esbuild` gets NO trust from the default list — list it yourself. Names match exactly (not by hash).
|
|
82
|
+
- **`nativeDependencies`** [v1.3.2]: for packages shipping prebuilt binaries as per-platform optionalDependencies, Bun links the right binary directly instead of running postinstall. **`ignoreScripts`** skips a package's lifecycle scripts even if trusted.
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{ "nativeDependencies": ["esbuild"], "ignoreScripts": ["sharp"] }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Defaults changed in 1.4 (see also breaking-changes.md)
|
|
89
|
+
|
|
90
|
+
- New monorepos default to `linker: "isolated"` (`configVersion: 1` in bun.lock). Existing lockfiles keep hoisted. Pin `linker = "hoisted"` to opt out.
|
|
91
|
+
- `bun.lock` is `lockfileVersion: 2`: out-of-registry tarballs need integrity hashes; git entries validated against path traversal. Run `bun install` to migrate.
|
|
92
|
+
- A project's `bunfig.toml` now overrides `.npmrc` for the same key.
|
|
93
|
+
- `bun init` writes `typescript ^7`; non-TTY `bun init` behaves as `-y`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Node.js Compatibility & Platforms (Bun 1.4)
|
|
2
|
+
|
|
3
|
+
Blog: [#node-js-compatibility](https://bun.com/blog/bun-v1.4#node-js-compatibility), [#platforms](https://bun.com/blog/bun-v1.4#platforms) · Live tracker: <https://bun.com/node-test-suite>
|
|
4
|
+
|
|
5
|
+
Bun 1.4 reports **Node.js 26** (`process.versions.modules` = 147). 3,743 Node test-suite files pass (+1,517 since 1.3). `node:http`, `node:fs`, `node:cluster`, `node:timers`, `node:zlib`, `node:vm`, `node:stream` pass 97% of Node's own tests; `node:quic` 99%; `node:events`, `node:trace_events`, `node:sqlite` 100%.
|
|
6
|
+
|
|
7
|
+
## Big frameworks/tools that now run on Bun
|
|
8
|
+
|
|
9
|
+
- **Playwright** [v1.4.0]: `connectOverCDP()`, `playwright test` with config, `--ui`, Chromium on Windows.
|
|
10
|
+
- **Next.js 16** [v1.3.2]: `bun --bun next build` works on 16.3 with Turbopack + React Compiler.
|
|
11
|
+
- **vitest** [v1.4.0]: runs under Bun including `--coverage`, threads and forks pools.
|
|
12
|
+
- **OpenTelemetry** [v1.4.0]: http/fs instrumentation export spans; shimmer + require-in-the-middle patch bundled code.
|
|
13
|
+
- **dd-trace** [v1.4.0]: traces + `@datadog/pprof` continuous profiling (V8 C++ APIs implemented).
|
|
14
|
+
|
|
15
|
+
## Newly working packages
|
|
16
|
+
|
|
17
|
+
Nuxt (`nuxt dev` HMR + DevTools), testcontainers/dockerode (`container.exec()`), https-proxy-agent / socks-proxy-agent, crawlee (proxy-chain), @grpc/grpc-js + ConnectRPC (behind Envoy/ALB), amqplib (RabbitMQ), @aws-sdk/client-s3 streaming uploads, TypeORM (tsconfig decorator settings), nock, Fastify `inject()` / light-my-request, happy-dom, piscina.
|
|
18
|
+
|
|
19
|
+
## New Node.js APIs in Bun
|
|
20
|
+
|
|
21
|
+
- `worker_threads`: `resourceLimits`, `stdout`, `stderr`, `eval` options.
|
|
22
|
+
- ws: `'upgrade'` and `'unexpected-response'` events.
|
|
23
|
+
- `socket.upgradeTLS({ isServer: true })`: server-side STARTTLS.
|
|
24
|
+
- `node:cluster` shares listening sockets between workers.
|
|
25
|
+
- `node:repl`, `node:trace_events`, `node:domain`: implemented.
|
|
26
|
+
|
|
27
|
+
## Platforms
|
|
28
|
+
|
|
29
|
+
| Platform | Status |
|
|
30
|
+
|---|---|
|
|
31
|
+
| FreeBSD x86_64/aarch64 [v1.3.14] | Official native builds; full runtime on stock FreeBSD 14.3+ (native port, not Linux compat layer) |
|
|
32
|
+
| Windows ARM64 [v1.3.7] | Native builds (Surface, Snapdragon X, Ampere) |
|
|
33
|
+
| Android aarch64/x64 [v1.4.0] | Experimental builds with every release |
|
|
34
|
+
| Linux glibc 2.17 [v1.3.13] | Minimum dropped from 2.26 — RHEL/CentOS 7, Amazon Linux 1 work; kernel minimum 3.10 (`memfd_create` fallback) |
|
|
35
|
+
| Windows | Sub-15ms timers (no 15.6ms tick rounding); runs in AppContainer; read-only directories OK |
|
|
36
|
+
| TypeScript 7 | `bun init` templates + `@types/bun` are TS7-ready; `bun init` writes `typescript ^7` |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Bun 1.4 Performance
|
|
2
|
+
|
|
3
|
+
Blog: [#production](https://bun.com/blog/bun-v1.4#production), [#faster](https://bun.com/blog/bun-v1.4#faster)
|
|
4
|
+
|
|
5
|
+
All of this is free — no code changes. Use these numbers when justifying a Bun 1.4 upgrade.
|
|
6
|
+
|
|
7
|
+
## Production footprint
|
|
8
|
+
|
|
9
|
+
- **Allocator unified**: JavaScriptCore now uses mimalloc (extended with partial page clearing, an idle-time scavenger thread, lazy zeroing).
|
|
10
|
+
- **CPU**: Claude Code production CPU dropped 2x (p99 24%→10%, p50 5.8%→2.5%); hello-world idle CPU 5x lower.
|
|
11
|
+
- **Memory under load** (1M requests): fastify −48% (120MB), Express −46% (92MB), node:http −40% (81MB), Elysia −40%, Next.js −28%, Bun.serve −20% (36MB). Next.js App Router SSR that grew unbounded in 1.3 settles at 238MB (Node: 410MB).
|
|
12
|
+
- **Startup**: Windows 15.5ms (2.5x faster, was 39ms; Node 40ms); Linux 5.1ms (2x faster; Node 27.2ms) with peak memory 14.6MB vs Node 44.5MB.
|
|
13
|
+
- **Binary size**: Linux/Windows ~17% smaller (77MB Linux x64).
|
|
14
|
+
|
|
15
|
+
## Runtime speedups (WebKit pin bumped 39 times = ~8 months of JSC work)
|
|
16
|
+
|
|
17
|
+
| What | Improvement |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `new URL()` | up to 4.6x faster (75ns vs Node 232ns); `url.href` 5ns |
|
|
20
|
+
| RegExp (JSC-vs-V8 gap fixed) | `marked.parse()` 138x faster (912ms→6ms on 80KB); `isbot` 200x faster |
|
|
21
|
+
| `node:zlib` → zlib-ng | decompression ~20% faster across the board; peak memory 25-35MB lower; runtime CPU dispatch |
|
|
22
|
+
| `Buffer.from(str, "hex")` | 8x faster (SIMD); `"base64url"` 46x faster |
|
|
23
|
+
| Source map decoding | 3.1x faster (SIMD); 24x faster than Node on a 9.5MB map |
|
|
24
|
+
| Promises (JSC rewrite) | 1.5-2.4x faster; `await` resolved 84ns; 1M pending promises: 251MB peak (was 668MB), settle 12.5ms (was 39ms) |
|
|
25
|
+
|
|
26
|
+
## Streams, bodies, backpressure
|
|
27
|
+
|
|
28
|
+
The Production section of the blog also covers stream/body handling and backpressure improvements in `Bun.serve` — notably `server.publish()`/`ws.publish()` now report drops (`0`) and backpressure (`-1`) honestly; see [http-networking](http-networking.md).
|
|
29
|
+
|
|
30
|
+
## Windows-specific
|
|
31
|
+
|
|
32
|
+
- Timers no longer round to the 15.6ms system tick: `setTimeout(fn, 1)` fires in ~1.4ms.
|
|
33
|
+
- Startup 2.5x faster; runs inside an AppContainer sandbox; works on read-only directories/shares.
|
package/node_modules/@code-yeongyu/senpi-codemode/src/skill/bun-1-4/references/runtime-apis.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Bun 1.4 Runtime Builtins
|
|
2
|
+
|
|
3
|
+
Every API here ships inside the Bun binary: no install step, no native build, no lockfile entry. Version tags mark the minimum Bun version.
|
|
4
|
+
|
|
5
|
+
## Bun.Image — image processing (replaces sharp) [v1.3.14]
|
|
6
|
+
|
|
7
|
+
Docs: <https://bun.com/docs/runtime/image> · Blog: [#bun-image](https://bun.com/blog/bun-v1.4#bun-image)
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
await Bun.file("photo.jpg")
|
|
11
|
+
.image()
|
|
12
|
+
.resize(1024, 1024, { fit: "inside" })
|
|
13
|
+
.rotate(90)
|
|
14
|
+
.webp({ quality: 85 })
|
|
15
|
+
.write("thumb.webp");
|
|
16
|
+
|
|
17
|
+
// Stream straight into a Response
|
|
18
|
+
return new Response(new Bun.Image(upload).resize(200).jpeg());
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- Decode/resize/rotate/encode JPEG, PNG, WebP, GIF, BMP everywhere; HEIC, AVIF, TIFF on macOS and Windows.
|
|
22
|
+
- API mirrors sharp; 1.19-1.38x faster than sharp; ICC profiles (Display P3) survive transcoding.
|
|
23
|
+
|
|
24
|
+
## Bun.WebView — headless browser (replaces puppeteer for scraping/screenshots) [v1.3.12, improved v1.4.0]
|
|
25
|
+
|
|
26
|
+
Docs: <https://bun.com/docs/runtime/webview> · Blog: [#bun-webview](https://bun.com/blog/bun-v1.4#bun-webview)
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
await using view = new Bun.WebView({ width: 800, height: 600 });
|
|
30
|
+
await view.navigate("https://bun.sh");
|
|
31
|
+
await view.click("a[href='/docs']");
|
|
32
|
+
const title = await view.evaluate("document.title");
|
|
33
|
+
await Bun.write("page.png", await view.screenshot());
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- macOS: system WebKit, nothing to install. macOS/Linux/Windows: can drive installed Chrome/Chromium/Edge.
|
|
37
|
+
- Clicks/scrolls are trusted user input (`event.isTrusted === true`).
|
|
38
|
+
- Extends `EventTarget`; screenshots are `Blob`s; `.cdp(method, params?)` escape hatch for raw Chrome DevTools Protocol.
|
|
39
|
+
|
|
40
|
+
## Bun.markdown — Markdown parser (replaces marked) [v1.3.8, improved v1.4.0]
|
|
41
|
+
|
|
42
|
+
Docs: <https://bun.com/docs/runtime/markdown> · Blog: [#bun-markdown](https://bun.com/blog/bun-v1.4#bun-markdown)
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const html = Bun.markdown.html("# Hello **world**"); // HTML string
|
|
46
|
+
const el = Bun.markdown.react(readme); // React elements; swap components per tag
|
|
47
|
+
const ansi = Bun.markdown.render("# Hi\n\n**bold**", { // callback per element (terminal output etc.)
|
|
48
|
+
heading: (children) => `\x1b[1;4m${children}\x1b[0m\n`,
|
|
49
|
+
paragraph: (children) => children + "\n",
|
|
50
|
+
strong: (children) => `\x1b[1m${children}\x1b[22m`,
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- GFM tables, strikethrough, task lists, autolinks. `.md` is a bundler loader. Linear time on adversarial input.
|
|
55
|
+
- **HTML output is NOT sanitized** — raw HTML, event handlers, `javascript:` hrefs pass through. Sanitize before serving user content.
|
|
56
|
+
- Bonus: `bun ./README.md` renders Markdown to the terminal (replaces glow).
|
|
57
|
+
|
|
58
|
+
## Bun.cron() — scheduled jobs (replaces node-cron) [v1.3.11, improved v1.4.0]
|
|
59
|
+
|
|
60
|
+
Docs: <https://bun.com/docs/runtime/cron> · Blog: [#bun-cron](https://bun.com/blog/bun-v1.4#bun-cron)
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// OS-level job: crontab (Linux), launchd (macOS), Task Scheduler (Windows)
|
|
64
|
+
await Bun.cron("./worker.ts", "30 2 * * MON", "weekly-report");
|
|
65
|
+
// worker.ts exports: export default { async scheduled(controller) { ... } } // Cloudflare Workers shape
|
|
66
|
+
|
|
67
|
+
// In-process job on the event loop, no system cron
|
|
68
|
+
using job = Bun.cron("*/5 * * * *", async () => { await cleanupTempFiles(); });
|
|
69
|
+
job.unref(); job.stop(); // or let `using` dispose
|
|
70
|
+
|
|
71
|
+
Bun.cron.parse("*/15 * * * *"); // → next matching Date
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- 5-field syntax incl. named days and `@daily`. Jobs never overlap.
|
|
75
|
+
- **v1.4 change:** `parse()` and in-process schedules use LOCAL time (was UTC). Pass `{ tz: "UTC" }` to keep UTC.
|
|
76
|
+
|
|
77
|
+
## Bun.Terminal — native PTY (replaces node-pty) [v1.3.5, improved v1.4.0]
|
|
78
|
+
|
|
79
|
+
Docs: <https://bun.com/docs/runtime/child-process#terminal-pty-support> · Blog: [#bun-terminal](https://bun.com/blog/bun-v1.4#bun-terminal)
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const proc = Bun.spawn(["bash"], {
|
|
83
|
+
terminal: {
|
|
84
|
+
cols: 80, rows: 24,
|
|
85
|
+
data(term, data) { process.stdout.write(data); },
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
proc.terminal.write("echo Hello from PTY!\n");
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- Drive bash/vim/htop with colored output; resize; works on Linux, macOS, Windows.
|
|
92
|
+
- `write()` returns full input length (whole input buffered); `drain` fires on POSIX.
|
|
93
|
+
|
|
94
|
+
## bun run --parallel — concurrent scripts (replaces concurrently, npm-run-all) [v1.3.9, improved v1.4.0]
|
|
95
|
+
|
|
96
|
+
Blog: [#bun-run-parallel](https://bun.com/blog/bun-v1.4#bun-run-parallel)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bun run --parallel build test # named scripts concurrently
|
|
100
|
+
bun run --parallel "build:*" # glob-matched
|
|
101
|
+
bun run --parallel --filter '*' build # every workspace package
|
|
102
|
+
bun run --parallel --no-exit-on-error --filter '*' test # keep going past failures
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- Output lines prefixed with script name (`package:script` under `--filter`); pre/post hooks stay ordered; `--sequential` for one-at-a-time with same prefixing.
|
|
106
|
+
|
|
107
|
+
## bun:ffi — 3x faster, engine-native [v1.4.0]
|
|
108
|
+
|
|
109
|
+
Docs: <https://bun.com/docs/runtime/ffi> · Blog: [#3x-faster-bun-ffi](https://bun.com/blog/bun-v1.4#3x-faster-bun-ffi)
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { dlopen } from "bun:ffi";
|
|
113
|
+
const { symbols } = dlopen("libhash.so", {
|
|
114
|
+
hash: { args: ["buffer", "buffer_length"], returns: "cstring" },
|
|
115
|
+
});
|
|
116
|
+
const digest = symbols.hash(data, data); // typeof digest === "string"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- FFI is built into JavaScriptCore (TinyCC removed): no-op call 0.70ns (3x), `CString` 3.8x faster. Hot call sites JIT into direct C calls.
|
|
120
|
+
- New `buffer_length` arg type passes a TypedArray's length with its pointer.
|
|
121
|
+
- **Breaking:** `cstring` returns are plain strings (`NULL` → `null`); `new CString(ptr)` has no `.ptr` anymore — keep the original pointer to free it. See [breaking-changes](breaking-changes.md).
|
|
122
|
+
|
|
123
|
+
## Data format parsers
|
|
124
|
+
|
|
125
|
+
Blog: [#also-built-in](https://bun.com/blog/bun-v1.4#also-built-in)
|
|
126
|
+
|
|
127
|
+
| API | Replaces | Notes |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `Bun.JSON5.parse()/stringify()` | json5 | `.json5` files importable directly |
|
|
130
|
+
| `Bun.JSONL.parse()` / streaming `parseChunk()` | ndjson | newline-delimited JSON |
|
|
131
|
+
| `Bun.JSONC.parse()` | jsonc-parser | comments + trailing commas (the tsconfig parser); throws `SyntaxError` on invalid input |
|
|
132
|
+
| `Bun.XML.parse()/stringify()` | fast-xml-parser, xml2js | SIMD; `.xml` files importable (v1.4: import returns parsed doc, not path) |
|
|
133
|
+
| `Bun.TOML.parse()/stringify()` | @iarna/toml | TOML v1.1.0, 708/708 toml-test; v1.4 is strict — unquoted strings throw `SyntaxError` |
|
|
134
|
+
| `Bun.YAML.parse()` | — | YAML 1.2: `yes/no/on/off` are strings, not booleans |
|
|
135
|
+
| `Bun.Archive` | tar | create/extract tarballs off the main thread — docs <https://bun.com/docs/runtime/archive> |
|
|
136
|
+
|
|
137
|
+
## Terminal text utilities (replaces string-width, slice-ansi, cli-truncate, wrap-ansi)
|
|
138
|
+
|
|
139
|
+
Docs: <https://bun.com/docs/runtime/utils>
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
Bun.stringWidth("\x1b[32mgreen\x1b[0m e\u0301"); // terminal columns, ANSI + grapheme aware
|
|
143
|
+
Bun.sliceAnsi(str, 0, 20); // slice by columns, preserving ANSI codes
|
|
144
|
+
Bun.wrapAnsi(str, 80); // wrap by columns
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Everything else new in the runtime
|
|
148
|
+
|
|
149
|
+
- **`URLPattern`**: the Web API, 408 WPT passing. Replaces path-to-regexp.
|
|
150
|
+
- **`CompressionStream` / `DecompressionStream`**: gzip, deflate, deflate-raw + brotli and zstd.
|
|
151
|
+
- **`Response.textStream()`**: `ReadableStream<string>` of the body decoded as UTF-8.
|
|
152
|
+
- **`process.on("memoryPressure")`**: OS low-memory notification on macOS/Linux/Windows.
|
|
153
|
+
- **ML-DSA and ML-KEM**: NIST post-quantum signatures/KEM in `crypto.subtle` and `node:crypto`.
|
|
154
|
+
- **`Bun.spawn({ cgroup })`**: place a child in a cgroup before it starts (Linux). Docs: <https://bun.com/docs/runtime/child-process#resource-limits-with-cgroups-linux>
|
|
155
|
+
- **`bun repl`** [native]: highlighting, history, tab completion, `-e`/`-p`. Docs: <https://bun.com/docs/runtime/repl>
|
|
156
|
+
- **`Temporal`** is defined by default (JSC implementation). `BUN_JSC_useTemporal=0` disables.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Bun 1.4 Security Tightening
|
|
2
|
+
|
|
3
|
+
Blog: [#security](https://bun.com/blog/bun-v1.4#security)
|
|
4
|
+
|
|
5
|
+
1.4 tightened TLS/parsing defaults. **A connection that worked on 1.3 can now fail with a verification error — that is usually the fix working, not a bug.** Diagnose before loosening.
|
|
6
|
+
|
|
7
|
+
## checkServerIdentity runs BEFORE fetch() sends [v1.4.0]
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
await fetch("https://api.example.com/upload", {
|
|
11
|
+
method: "POST",
|
|
12
|
+
body: secretPayload,
|
|
13
|
+
tls: {
|
|
14
|
+
checkServerIdentity(hostname, cert) {
|
|
15
|
+
if (cert.fingerprint256 !== PINNED) return new Error("pin mismatch");
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
// nothing is sent until the callback returns undefined; re-runs on each redirect hop
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you pin a cert and the URL redirects through another host, the callback sees that cert too — accept every hop or use `redirect: "manual"`.
|
|
23
|
+
|
|
24
|
+
## tls.connect defaults servername to host [v1.3.13]
|
|
25
|
+
|
|
26
|
+
`tls.connect({ host, port })` without `servername` uses `host` for SNI + identity check (matches Node). Connecting by IP or `localhost` to a cert issued for another name now fails with `ERR_TLS_CERT_ALTNAME_INVALID` — including through drivers like `pg`/`ioredis`. Fix: pass the cert's name as `servername`, or `checkServerIdentity: () => undefined` if trusting by CA alone.
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
tls.connect({ host: "10.0.0.12", port: 5432, ca, servername: "db.internal" });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Bun.connect / Bun.listen enforce rejectUnauthorized [v1.4.0]
|
|
33
|
+
|
|
34
|
+
`Bun.connect({ tls })`, `socket.upgradeTLS()`, and `Bun.listen()` with `requestCert: true` default to `rejectUnauthorized: true`. A self-signed dev server with no `ca` does NOT throw — the `handshake` handler runs with `socket.authorized === false`, writes return `-1`, and the socket closes without data. Pass the CA in `tls`, or `rejectUnauthorized: false` (`NODE_TLS_REJECT_UNAUTHORIZED=0` honored).
|
|
35
|
+
|
|
36
|
+
## RedisClient verifies TLS hostname [v1.3.14]
|
|
37
|
+
|
|
38
|
+
`rediss://` checks the server cert against the URL host; first command rejects with `ERR_TLS_CERT_ALTNAME_INVALID` on mismatch. Connect by the certificate's name, or pass `tls: { rejectUnauthorized: false }`.
|
|
39
|
+
|
|
40
|
+
## HTTP request parsing hardening in Bun.serve [v1.3.4]
|
|
41
|
+
|
|
42
|
+
More malformed `Content-Length` / `Transfer-Encoding` / chunked bodies get `400` + connection close, without calling your `fetch` handler or logging. Browsers/curl/proxies never send these; if a hand-written client starts seeing 400s, fix its framing headers.
|
|
43
|
+
|
|
44
|
+
## Tarball extraction hardening [v1.3.6]
|
|
45
|
+
|
|
46
|
+
`github:`/URL dependencies and `bun create` templates skip tar entries that would land outside the package directory. A post-upgrade `Cannot find module` for such a package usually means the repo has a symlink pointing outside the package — replace it with a real file or relative link.
|
|
47
|
+
|
|
48
|
+
## Also
|
|
49
|
+
|
|
50
|
+
- Registry credentials stay scoped to their configured host: never sent cross-origin, never downgraded to `http://`, never printed in errors/verbose output.
|
|
51
|
+
- `tls.createServer({ requestCert: true })` now rejects unverified client certs by default; only a literal `rejectUnauthorized: false` disables verification (`null` no longer counts).
|
|
52
|
+
- Full list: [Security hardening](https://bun.com/blog/bun-v1.4#security-hardening) in the changelog; advisories at <https://github.com/oven-sh/bun/security/advisories>.
|