thebird 1.2.26 → 1.2.27

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,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Added
6
+ - `docs/index.html`: GEMINI_API_KEY input + Run Agent button in Terminal tab toolbar for in-browser agent validation
7
+ - `docs/terminal.js`: `window.__debug.runAgent(key, task)` spawns `node agent.js` with env, pipes output to terminal, tracks `{ running, output, exitCode }` in `window.__debug.validation`
8
+
5
9
  ### Fixed
6
10
  - `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
11
 
package/docs/index.html CHANGED
@@ -13,8 +13,7 @@
13
13
  <style>
14
14
  html, body { height: 100%; background: #0f1117; }
15
15
  .tab-active { border-bottom: 2px solid oklch(var(--p)); }
16
- #term-container { height: 100%; }
17
- bird-chat { display: flex; flex-direction: column; height: 100%; }
16
+ bird-chat { display: flex; flex-direction: column; height: 100%; }
18
17
  .msg-bubble { max-width: 680px; white-space: pre-wrap; word-break: break-word; }
19
18
  #msg-list { scroll-behavior: smooth; }
20
19
  </style>
@@ -29,8 +28,12 @@
29
28
  <div id="pane-chat" class="flex-1 overflow-hidden">
30
29
  <bird-chat></bird-chat>
31
30
  </div>
32
- <div id="pane-term" class="flex-1 overflow-hidden hidden p-2 bg-black">
33
- <div id="term-container" style="height:100%"></div>
31
+ <div id="pane-term" class="flex flex-col flex-1 overflow-hidden hidden bg-black">
32
+ <div class="flex gap-2 px-2 py-1 bg-base-200 shrink-0">
33
+ <input id="gemini-key" type="password" class="input input-xs input-bordered flex-1 min-w-0" placeholder="GEMINI_API_KEY" />
34
+ <button class="btn btn-xs btn-primary" onclick="window.__debug.runAgent(document.getElementById('gemini-key').value, 'write a file called validate.txt with content hello from agent, then read it back and print the contents')">Run Agent</button>
35
+ </div>
36
+ <div id="term-container" class="flex-1"></div>
34
37
  </div>
35
38
  <div id="pane-preview" class="flex-1 overflow-hidden hidden">
36
39
  <iframe id="preview-frame" class="w-full h-full border-0" src="about:blank"></iframe>
package/docs/terminal.js CHANGED
@@ -116,6 +116,19 @@ async function boot() {
116
116
  window.__debug.previewUrl = null;
117
117
  window.__debug.shell = shell;
118
118
  window.__debug.srv = srv;
119
+ window.__debug.validation = null;
120
+ window.__debug.runAgent = async (key, task) => {
121
+ if (!key) { window.__debug.validation = { error: 'GEMINI_API_KEY required' }; return; }
122
+ window.__debug.validation = { running: true, output: '', exitCode: null };
123
+ const proc = await container.spawn('node', ['agent.js', task], { env: { GEMINI_API_KEY: key } });
124
+ proc.output.pipeTo(new WritableStream({ write: d => {
125
+ window.__debug.validation.output += d;
126
+ term.write(d);
127
+ }}));
128
+ const code = await proc.exit;
129
+ window.__debug.validation.running = false;
130
+ window.__debug.validation.exitCode = code;
131
+ };
119
132
  }
120
133
 
121
134
  boot().catch(e => console.error('[terminal] boot error:', e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thebird",
3
- "version": "1.2.26",
3
+ "version": "1.2.27",
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",