@code-yeongyu/senpi-codemode 2026.10.31-1 → 2026.11.2-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/package.json +4 -4
  4. package/src/extension/host-facts.ts +81 -3
  5. package/src/extension/skill-contribution.ts +6 -6
  6. package/src/kernels/js/cell-ownership.js +12 -3
  7. package/src/kernels/py/path_identity_windows.py +3 -1
  8. package/src/kernels/shared/subprocess-kernel.ts +4 -1
  9. package/src/kernels/shared/subprocess-process.ts +12 -0
  10. package/src/prompt/eval-prompt-template.ts +1 -1
  11. package/src/prompt/eval-prompt.ts +4 -2
  12. package/src/skill/bun/SKILL.md +53 -0
  13. package/src/skill/{bun-1-4 → bun}/references/breaking-changes.md +26 -4
  14. package/src/skill/{bun-1-4 → bun}/references/build.md +32 -6
  15. package/src/skill/bun/references/dev-tooling.md +67 -0
  16. package/src/skill/bun/references/http-networking.md +157 -0
  17. package/src/skill/bun/references/install.md +137 -0
  18. package/src/skill/{bun-1-4 → bun}/references/node-compat-platforms.md +16 -2
  19. package/src/skill/{bun-1-4 → bun}/references/performance.md +9 -3
  20. package/src/skill/{bun-1-4 → bun}/references/runtime-apis.md +38 -13
  21. package/src/skill/bun/references/security.md +74 -0
  22. package/src/skill/bun/references/session-recipes.md +71 -0
  23. package/src/skill/bun/references/test.md +132 -0
  24. package/src/tool/detached-cell-manager.ts +50 -3
  25. package/src/tool/eval-argument-validator.ts +89 -0
  26. package/src/tool/eval-language-inference.ts +116 -0
  27. package/src/tool/eval-request.ts +34 -13
  28. package/src/tool/eval-tool-options.ts +1 -1
  29. package/src/tool/eval-tool.ts +17 -0
  30. package/src/tool/types.ts +2 -0
  31. package/src/skill/bun-1-4/SKILL.md +0 -45
  32. package/src/skill/bun-1-4/references/dev-tooling.md +0 -34
  33. package/src/skill/bun-1-4/references/http-networking.md +0 -113
  34. package/src/skill/bun-1-4/references/install.md +0 -93
  35. package/src/skill/bun-1-4/references/security.md +0 -52
  36. package/src/skill/bun-1-4/references/test.md +0 -103
@@ -1,113 +0,0 @@
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.
@@ -1,93 +0,0 @@
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`.
@@ -1,52 +0,0 @@
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>.
@@ -1,103 +0,0 @@
1
- # bun test in 1.4
2
-
3
- Composable CI recipe:
4
-
5
- ```bash
6
- bun test --changed=main # only what your branch touches
7
- bun test --parallel --timings=timings.json --update-timings
8
- bun test --parallel --shard=1/3 --timings=timings.json # in CI, per machine
9
- ```
10
-
11
- ## --parallel: worker processes [v1.3.13, improved v1.4.0]
12
-
13
- Blog: [#bun-test-parallel](https://bun.com/blog/bun-v1.4#bun-test-parallel)
14
-
15
- ```bash
16
- bun test --parallel # N = CPU count
17
- bun test --parallel=4
18
- ```
19
-
20
- - Files go to whichever worker frees up next. Coverage and JUnit output merged across workers; `--bail` stops every worker.
21
- - `--parallel` implies `--isolate`; `--no-isolate` opts out.
22
- - Workers expose 1-indexed `JEST_WORKER_ID` / `BUN_TEST_WORKER_ID`, so Jest setups keying DBs/ports off worker id work unchanged.
23
- - Preload scripts with top-level `await` complete before any worker runs tests.
24
-
25
- ## --isolate: fresh global per file [v1.3.13, hardened v1.4.0]
26
-
27
- Blog: [#bun-test-isolate](https://bun.com/blog/bun-v1.4#bun-test-isolate)
28
-
29
- ```bash
30
- bun test --isolate
31
- ```
32
-
33
- Between files, Bun creates a new `globalThis`, clears ESM/CJS module registries, closes leaked servers/sockets/watchers/subprocesses, cancels timers, restores fake timers, and re-runs `--preload`. Transpiled source/bytecode stay cached process-wide, so only top-level code re-runs. This is how Jest/Vitest behave by default — use it to kill "passes alone, fails in the full suite" bugs. v1.4 fixed the 1.3.13 stability issues (fake-timer leaks, module-scope subprocess leaks, `process.chdir` bleed, N-API across files, debugger breakpoints).
34
-
35
- ## --shard: split across CI machines [v1.3.13]
36
-
37
- Blog: [#bun-test-shard](https://bun.com/blog/bun-v1.4#bun-test-shard)
38
-
39
- ```bash
40
- bun test --shard=1/3 # deterministic, round-robin, 1-based (matches Jest/Vitest/Playwright)
41
- ```
42
-
43
- Works with `--changed` and `--randomize`; an empty shard exits 0.
44
-
45
- ## --timings: balance by wall time [v1.4.0]
46
-
47
- Blog: [#bun-test-timings](https://bun.com/blog/bun-v1.4#bun-test-timings)
48
-
49
- ```bash
50
- bun test --timings=timings.json --update-timings # record per-file durations
51
- bun test --shard=1/3 --timings=timings.json # shards cut by equal time, not file count
52
- bun test --parallel --timings=timings.json # workers start slowest file first (LPT scheduling)
53
- ```
54
-
55
- The timings file is written slowest-first, so it doubles as a slow-test report. Files sharing imports stay together (warm module cache).
56
-
57
- ## --changed: only affected tests [v1.3.13]
58
-
59
- Blog: [#bun-test-changed](https://bun.com/blog/bun-v1.4#bun-test-changed)
60
-
61
- ```bash
62
- bun test --changed # uncommitted (unstaged + staged + untracked)
63
- bun test --changed=main # diff against branch/commit/tag
64
- bun test --changed --watch # re-filters on every restart
65
- ```
66
-
67
- Bun scans test imports, asks git what changed, walks the import graph backwards. tsconfig `paths` aliases (`@/*`) work. Vitest-compatible flag.
68
-
69
- ## --retry and repeats [v1.3.3]
70
-
71
- Blog: [#bun-test-retry](https://bun.com/blog/bun-v1.4#bun-test-retry)
72
-
73
- ```ts
74
- test("flaky network call", async () => { await fetch("https://example.com"); }, { retry: 5 });
75
- test("stress", () => { if (Math.random() < 0.1) throw new Error("uh oh!"); }, { repeats: 20 });
76
- ```
77
-
78
- `bun test --retry <N>` sets a suite-wide default. NOTE: prefer fixing the flake; retry is a containment tool.
79
-
80
- ## jest.useFakeTimers() [v1.3.4, improved v1.4.0]
81
-
82
- Blog: [#jest-usefaketimers](https://bun.com/blog/bun-v1.4#jest-usefaketimers)
83
-
84
- ```ts
85
- import { jest, test, expect } from "bun:test";
86
- test("debounce", () => {
87
- jest.useFakeTimers();
88
- let called = 0;
89
- setTimeout(() => called++, 1000);
90
- jest.advanceTimersByTime(1000);
91
- expect(called).toBe(1);
92
- jest.useRealTimers();
93
- });
94
- ```
95
-
96
- - Controls `setTimeout`, `setInterval`, `Date`. `jest.setSystemTime()` works with `advanceTimersByTime()`.
97
- - `@testing-library/react`'s `waitFor` detects fake timers and advances instead of sleeping. `Bun.cron` schedules can be driven by the fake clock.
98
-
99
- ## Behavior changes in 1.4 (test-related)
100
-
101
- - `jest.resetAllMocks()` now drops implementations too (matches Jest); use `clearAllMocks()` for history-only.
102
- - `expect().toContain()` compares with `===` not `Object.is` (`[NaN]` no longer contains `NaN`).
103
- - `toEqual()` compares `Temporal` objects by value.