thebird 1.2.25 → 1.2.26

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 CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Fixed
6
+ - `docs/terminal.js`: build nested WebContainer mount tree from flat path keys (fixes `EIO: invalid file name` for files in subdirectories like `lib/providers/openai.js`); bump IDB_KEY to `thebird_fs_v2` to force re-fetch of defaults.json for users with stale cache
7
+
5
8
  ### Added
6
9
  - `docs/defaults.json`: JSON blob of all thebird lib files + `server.js` + `agent.js` fetched by terminal.js on first boot
7
10
  - `docs/terminal.js`: fetches `defaults.json` instead of hardcoded DEFAULT_FILES; jsh PTY shell with resize; `server-ready` wires iframe src + `window.__debug.previewUrl`; all debug keys registered
package/docs/terminal.js CHANGED
@@ -2,7 +2,7 @@ import { WebContainer } from 'https://esm.sh/@webcontainer/api';
2
2
  import { Terminal } from 'https://esm.sh/@xterm/xterm';
3
3
  import { FitAddon } from 'https://esm.sh/@xterm/addon-fit';
4
4
 
5
- const IDB_KEY = 'thebird_fs';
5
+ const IDB_KEY = 'thebird_fs_v2';
6
6
 
7
7
  async function idbLoad() {
8
8
  return new Promise((res, rej) => {
@@ -59,13 +59,17 @@ async function boot() {
59
59
  files = await r.json();
60
60
  }
61
61
 
62
- const mountTree = Object.fromEntries(
63
- Object.entries(files).map(([p, c]) => {
64
- const parts = p.split('/');
65
- if (parts.length === 1) return [p, { file: { contents: c } }];
66
- return [p, { file: { contents: c } }];
67
- })
68
- );
62
+ const mountTree = {};
63
+ for (const [path, contents] of Object.entries(files)) {
64
+ const parts = path.split('/');
65
+ const name = parts.pop();
66
+ let node = mountTree;
67
+ for (const dir of parts) {
68
+ if (!node[dir]) node[dir] = { directory: {} };
69
+ node = node[dir].directory;
70
+ }
71
+ node[name] = { file: { contents } };
72
+ }
69
73
 
70
74
  term.write('Booting WebContainer...\r\n');
71
75
  let container;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thebird",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "description": "Anthropic SDK to Gemini streaming bridge — drop-in proxy that translates Anthropic message format and tool calls to Google Gemini",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",