pinokiod 8.3.13 → 8.3.15
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/kernel/agent_instructions.js +0 -1
- package/kernel/api/index.js +76 -12
- package/kernel/environment.js +1 -1
- package/kernel/index.js +15 -2
- package/kernel/plugin_sources.js +1 -1
- package/kernel/prototype.js +1 -1
- package/kernel/request_file.js +5 -14
- package/kernel/shell.js +12 -0
- package/kernel/shells.js +13 -1
- package/package.json +1 -1
- package/server/index.js +10 -5
- package/server/lib/agent_jobs.js +198 -0
- package/server/lib/agent_sessions.js +131 -0
- package/server/lib/brain.js +161 -91
- package/server/lib/content_validation.js +1 -1
- package/server/public/agent-bar-app.js +28 -6
- package/server/public/agent-bar-compose.css +675 -0
- package/server/public/agent-bar-compose.js +658 -0
- package/server/public/agent-bar-panel.css +2 -0
- package/server/public/agent-bar-panel.js +22 -7
- package/server/public/agent-bar-shell.css +38 -0
- package/server/public/agent-bar-shell.js +128 -34
- package/server/public/agent-bar.css +7 -1
- package/server/public/agent-bar.js +10 -1
- package/server/public/terminal_input_utils.js +4 -0
- package/server/views/app.ejs +5 -1
- package/server/views/partials/main_sidebar.ejs +2 -0
- package/system/plugin/antigravity-cli-auto/pinokio.js +44 -6
- package/system/plugin/claude/pinokio.js +43 -1
- package/system/plugin/claude-auto/pinokio.js +43 -1
- package/system/plugin/codex/pinokio.js +42 -1
- package/system/plugin/codex-auto/pinokio.js +42 -1
- package/system/plugin/grok/pinokio.js +1 -1
- package/system/plugin/grok-auto/pinokio.js +37 -10
- package/system/plugin/opencode/pinokio.js +24 -0
- package/system/plugin/opencode-auto/pinokio.js +82 -10
- package/test/agent-bar-compose.test.js +544 -0
- package/test/agent-bar-shell.test.js +149 -0
- package/test/agent-instructions.test.js +0 -2
- package/test/agent-jobs.test.js +534 -0
- package/test/agent-sessions.test.js +130 -0
- package/test/antigravity-cli-plugin.test.js +63 -18
- package/test/anywhere-api.test.js +1 -1
- package/test/anywhere-onboarding.test.js +1 -2
- package/test/brain.test.js +116 -69
- package/test/grok-plugin.test.js +2 -1
- package/test/opencode-plugin.test.js +7 -4
- package/test/plugin-action-functions.test.js +423 -0
- package/test/request-file.test.js +1 -12
- package/test/shell-log-path.test.js +64 -0
- package/test/shell-stop-while-starting.test.js +70 -0
- package/test/shells-live-error.test.js +66 -2
- package/test/terminal-mouse-input.test.js +12 -0
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
// page to page, each window where and how big you left it.
|
|
21
21
|
// - The window's header is the same for every kind of session:
|
|
22
22
|
// [Open app | Open plugin | Open folder] [Stop] [more] | [minimise] [dock to the side / float] [close]
|
|
23
|
-
// more: Refresh, Open in a new tab, Terminal appearance
|
|
23
|
+
// more: Refresh, Open in a new tab, Terminal appearance
|
|
24
24
|
// Minimise keeps the tab. Close removes the tab; the session keeps running and
|
|
25
25
|
// stays in the bar's list. Stop ends it (asked twice), the way the session's
|
|
26
26
|
// own page does.
|
|
@@ -340,6 +340,9 @@
|
|
|
340
340
|
pruneTabs();
|
|
341
341
|
renderChip();
|
|
342
342
|
if (menuOpen) renderMenu();
|
|
343
|
+
// an app page's bar keeps its own count of the app's sessions: it is
|
|
344
|
+
// handed the list that was just read
|
|
345
|
+
window.dispatchEvent(new window.CustomEvent('pinokio:sessions-changed', { detail: { shells } }));
|
|
343
346
|
}
|
|
344
347
|
return true;
|
|
345
348
|
})
|
|
@@ -537,7 +540,7 @@
|
|
|
537
540
|
text.append(part.title, part.sub);
|
|
538
541
|
// One header for every kind of session.
|
|
539
542
|
// [Open app | Open plugin | Open folder] [Stop] [more] | [minimise] [dock to the side / float] [close]
|
|
540
|
-
// more: Refresh, Open in a new tab,
|
|
543
|
+
// more: Refresh, Open in a new tab, Terminal appearance
|
|
541
544
|
const goWhere = () => {
|
|
542
545
|
const place = win.session && where(win.session);
|
|
543
546
|
if (place) place.run();
|
|
@@ -569,9 +572,9 @@
|
|
|
569
572
|
const url = session && (session.tabUrl || session.fullUrl || session.url);
|
|
570
573
|
if (url) whenRunning(session, () => window.open(url, '_blank', 'noopener'));
|
|
571
574
|
});
|
|
572
|
-
// the session page's own
|
|
575
|
+
// the session page's own appearance button, pressed from here (see embed below). Its
|
|
576
|
+
// "sync size" button has no row: Refresh reloads the page, which sends the size too.
|
|
573
577
|
part.termLook = moreRow('Terminal appearance', 'fa-solid fa-sliders', () => pressInPage(win, '.terminal-config-button'));
|
|
574
|
-
part.termSync = moreRow('Sync terminal size', 'fa-solid fa-ruler-combined', () => pressInPage(win, '.terminal-resize-button'));
|
|
575
578
|
// always in the header, between the window's other two controls, where a window's
|
|
576
579
|
// maximise / restore button usually is
|
|
577
580
|
part.wide = iconButton('Dock to the side', 'fa-solid fa-table-columns', () => toggleDocked(win));
|
|
@@ -939,7 +942,7 @@
|
|
|
939
942
|
// The page (terminal.ejs, shell.ejs) has a row of its own above the terminal:
|
|
940
943
|
// Run/Stop, Save task, a status line and two terminal buttons. Inside the window
|
|
941
944
|
// the header already has Stop, so that row is folded away and the terminal fills
|
|
942
|
-
// the window. The
|
|
945
|
+
// the window. The appearance button is pressed from the more menu, and its
|
|
943
946
|
// "Terminal appearance" menu opens at the top right of the page as it always did.
|
|
944
947
|
// The page itself is not changed: this is styling added to its document while
|
|
945
948
|
// it is shown here. Its full page ("Open in a new tab") looks as before.
|
|
@@ -1161,7 +1164,6 @@
|
|
|
1161
1164
|
if (open) {
|
|
1162
1165
|
const doc = embed(win);
|
|
1163
1166
|
part.termLook.hidden = !(doc && doc.querySelector('.terminal-config-button'));
|
|
1164
|
-
part.termSync.hidden = !(doc && doc.querySelector('.terminal-resize-button'));
|
|
1165
1167
|
}
|
|
1166
1168
|
part.moreMenu.hidden = !open;
|
|
1167
1169
|
part.more.classList.toggle('is-open', Boolean(open));
|
|
@@ -1232,7 +1234,7 @@
|
|
|
1232
1234
|
if (!session) return false;
|
|
1233
1235
|
const address = `${url.pathname}${url.search}`;
|
|
1234
1236
|
// What the session is listed by is the user's words (`said`), not the line
|
|
1235
|
-
// the agent is started with
|
|
1237
|
+
// the agent is started with.
|
|
1236
1238
|
const said = typeof settings.said === 'string' ? settings.said.trim() : prompt;
|
|
1237
1239
|
if (said) {
|
|
1238
1240
|
asked[session.key] = said;
|
|
@@ -1882,6 +1884,19 @@
|
|
|
1882
1884
|
fitRow();
|
|
1883
1885
|
tile();
|
|
1884
1886
|
});
|
|
1887
|
+
// A phone's on-screen keyboard covers the bottom of the screen without making
|
|
1888
|
+
// the page shorter. The window ends where the keyboard begins (see the
|
|
1889
|
+
// styles), so the line being typed on stays in view.
|
|
1890
|
+
const vv = window.visualViewport;
|
|
1891
|
+
if (vv) {
|
|
1892
|
+
const syncKeyboard = () => {
|
|
1893
|
+
const covered = Math.max(0, Math.round(window.innerHeight - vv.height - vv.offsetTop));
|
|
1894
|
+
root.style.setProperty('--agent-dock-keyboard', `${covered}px`);
|
|
1895
|
+
};
|
|
1896
|
+
vv.addEventListener('resize', syncKeyboard);
|
|
1897
|
+
vv.addEventListener('scroll', syncKeyboard);
|
|
1898
|
+
syncKeyboard();
|
|
1899
|
+
}
|
|
1885
1900
|
// Reads what is running. Until that has worked once (with the agents known),
|
|
1886
1901
|
// the tabs are left exactly as they were saved; then the windows come back.
|
|
1887
1902
|
const look = () => {
|
|
@@ -126,3 +126,41 @@ header.navheader.agent-bar-shell-raised {
|
|
|
126
126
|
font-size: 12px;
|
|
127
127
|
color: var(--agent-bar-shell-muted);
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
/* ---- phones: the "Open a shell" row at the end of the app's slide-in menu ----
|
|
131
|
+
The app page's phone layout hides the top bar, and the button with it. The
|
|
132
|
+
row and the shells under it are the page's own menu rows (see the script), so
|
|
133
|
+
only what is particular to them is set here. Not shown anywhere else. */
|
|
134
|
+
.agent-bar-shell-row {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
html.agent-bar-app-phone .agent-bar-shell-row {
|
|
138
|
+
display: flex;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
gap: 2px;
|
|
141
|
+
}
|
|
142
|
+
.agent-bar-shell-row [hidden] {
|
|
143
|
+
display: none !important;
|
|
144
|
+
}
|
|
145
|
+
.agent-bar-shell-row__list {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
gap: 2px;
|
|
149
|
+
padding-left: 24px;
|
|
150
|
+
}
|
|
151
|
+
.agent-bar-shell-row__note {
|
|
152
|
+
flex: 1 1 0;
|
|
153
|
+
min-width: 0;
|
|
154
|
+
text-align: left;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
text-overflow: ellipsis;
|
|
158
|
+
font-size: 11px;
|
|
159
|
+
font-weight: 400;
|
|
160
|
+
opacity: 0.72;
|
|
161
|
+
}
|
|
162
|
+
.agent-bar-shell-row__empty {
|
|
163
|
+
padding: 6px 9px;
|
|
164
|
+
font-size: 12px;
|
|
165
|
+
opacity: 0.72;
|
|
166
|
+
}
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
// pick one (Dev) -> the same message the Plugins page sends when a
|
|
15
15
|
// "Project Shell" row is clicked: { launch: { name, href, label } }
|
|
16
16
|
//
|
|
17
|
+
// On a phone the app page hides its top bar, and the button with it. There the
|
|
18
|
+
// same list is behind an "Open a shell" row at the end of the slide-in menu's
|
|
19
|
+
// list: a tap shows the app's shells under the row, and picking one closes the
|
|
20
|
+
// menu and opens the shell the same way.
|
|
21
|
+
//
|
|
17
22
|
// Nothing else on the page is changed.
|
|
18
23
|
(function (window, document) {
|
|
19
24
|
'use strict';
|
|
@@ -78,6 +83,45 @@
|
|
|
78
83
|
}).filter(Boolean);
|
|
79
84
|
}
|
|
80
85
|
|
|
86
|
+
// This app's shells, read once per page for both ways in. A failed read is
|
|
87
|
+
// tried again the next time it is asked for.
|
|
88
|
+
let shellsRead = null;
|
|
89
|
+
function readAppShells() {
|
|
90
|
+
if (shellsRead) return shellsRead;
|
|
91
|
+
const folder = appFolder();
|
|
92
|
+
if (!folder) return Promise.reject(new Error('No app folder.'));
|
|
93
|
+
shellsRead = fetch(`/api/plugin/menu?workspace=${encodeURIComponent(folder)}`)
|
|
94
|
+
.then((res) => {
|
|
95
|
+
if (!res.ok) throw new Error('Failed to load shells.');
|
|
96
|
+
return res.json();
|
|
97
|
+
})
|
|
98
|
+
.then(readShells);
|
|
99
|
+
shellsRead.catch(() => { shellsRead = null; });
|
|
100
|
+
return shellsRead;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function openShell(shell) {
|
|
104
|
+
const isRun = Boolean(document.getElementById('ask-ai-tab') || document.getElementById('ask-ai-drawer'));
|
|
105
|
+
const drawer = isRun ? (window.PinokioAgentDock || window.PinokioAskAiDrawer || null) : null;
|
|
106
|
+
if (drawer && typeof drawer.openShellTool === 'function') {
|
|
107
|
+
// Run: the docked window, with a session of its own
|
|
108
|
+
Promise.resolve(drawer.openShellTool(shell)).then(() => {
|
|
109
|
+
// the agent bar's "N running" count reads the running list again
|
|
110
|
+
window.dispatchEvent(new CustomEvent('pinokio:shell-opened'));
|
|
111
|
+
});
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// Dev: what the Plugins page sends for a "Project Shell" row
|
|
115
|
+
const session = newSession();
|
|
116
|
+
window.postMessage({
|
|
117
|
+
launch: {
|
|
118
|
+
name: withSession(shell.target, session),
|
|
119
|
+
href: withSession(shell.href, session),
|
|
120
|
+
label: shell.label,
|
|
121
|
+
},
|
|
122
|
+
}, window.location.origin);
|
|
123
|
+
}
|
|
124
|
+
|
|
81
125
|
function build(anchor) {
|
|
82
126
|
const root = el('div', 'agent-bar-shell');
|
|
83
127
|
const button = el('button', 'btn2 agent-bar-shell__trigger');
|
|
@@ -134,25 +178,14 @@
|
|
|
134
178
|
}
|
|
135
179
|
}
|
|
136
180
|
|
|
137
|
-
//
|
|
138
|
-
// the next time the menu opens.
|
|
181
|
+
// A failed read is tried again the next time the menu opens.
|
|
139
182
|
let loading = null;
|
|
140
183
|
function load() {
|
|
141
184
|
if (loading) return loading;
|
|
142
|
-
const folder = appFolder();
|
|
143
|
-
if (!folder) {
|
|
144
|
-
state.failed = true;
|
|
145
|
-
render();
|
|
146
|
-
return Promise.resolve();
|
|
147
|
-
}
|
|
148
185
|
state.failed = false;
|
|
149
|
-
loading =
|
|
150
|
-
.then((
|
|
151
|
-
|
|
152
|
-
return res.json();
|
|
153
|
-
})
|
|
154
|
-
.then((payload) => {
|
|
155
|
-
state.shells = readShells(payload);
|
|
186
|
+
loading = readAppShells()
|
|
187
|
+
.then((shells) => {
|
|
188
|
+
state.shells = shells;
|
|
156
189
|
render();
|
|
157
190
|
})
|
|
158
191
|
.catch(() => {
|
|
@@ -171,25 +204,7 @@
|
|
|
171
204
|
|
|
172
205
|
function open(shell) {
|
|
173
206
|
close();
|
|
174
|
-
|
|
175
|
-
const drawer = isRun ? (window.PinokioAgentDock || window.PinokioAskAiDrawer || null) : null;
|
|
176
|
-
if (drawer && typeof drawer.openShellTool === 'function') {
|
|
177
|
-
// Run: the docked window, with a session of its own
|
|
178
|
-
Promise.resolve(drawer.openShellTool(shell)).then(() => {
|
|
179
|
-
// the agent bar's "N running" count reads the running list again
|
|
180
|
-
window.dispatchEvent(new CustomEvent('pinokio:shell-opened'));
|
|
181
|
-
});
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
// Dev: what the Plugins page sends for a "Project Shell" row
|
|
185
|
-
const session = newSession();
|
|
186
|
-
window.postMessage({
|
|
187
|
-
launch: {
|
|
188
|
-
name: withSession(shell.target, session),
|
|
189
|
-
href: withSession(shell.href, session),
|
|
190
|
-
label: shell.label,
|
|
191
|
-
},
|
|
192
|
-
}, window.location.origin);
|
|
207
|
+
openShell(shell);
|
|
193
208
|
}
|
|
194
209
|
|
|
195
210
|
button.addEventListener('click', (event) => {
|
|
@@ -224,6 +239,73 @@
|
|
|
224
239
|
return root;
|
|
225
240
|
}
|
|
226
241
|
|
|
242
|
+
// The phone menu's row. It is built from the page's own row markup (.btn >
|
|
243
|
+
// .tab > icon + .display), so the page's styles for the menu's rows apply.
|
|
244
|
+
function menuRow(iconClass, label, note) {
|
|
245
|
+
const row = el('button', 'btn header-item agent-bar-shell-row__item');
|
|
246
|
+
row.type = 'button';
|
|
247
|
+
const tab = el('div', 'tab');
|
|
248
|
+
const icon = el('i', iconClass);
|
|
249
|
+
icon.setAttribute('aria-hidden', 'true');
|
|
250
|
+
tab.append(icon, el('div', 'display', label));
|
|
251
|
+
// what the shell is, in the room left after its name
|
|
252
|
+
tab.appendChild(note ? el('div', 'agent-bar-shell-row__note', note) : el('div', 'flexible'));
|
|
253
|
+
row.appendChild(tab);
|
|
254
|
+
return row;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function buildRow(scroller) {
|
|
258
|
+
const root = el('div', 'agent-bar-shell-row');
|
|
259
|
+
const toggle = menuRow('fa-solid fa-terminal', 'Open a shell');
|
|
260
|
+
toggle.classList.add('agent-bar-shell-row__toggle');
|
|
261
|
+
toggle.setAttribute('aria-expanded', 'false');
|
|
262
|
+
const list = el('div', 'agent-bar-shell-row__list');
|
|
263
|
+
list.hidden = true;
|
|
264
|
+
root.append(toggle, list);
|
|
265
|
+
scroller.appendChild(root);
|
|
266
|
+
|
|
267
|
+
const state = { open: false, shells: null, failed: false };
|
|
268
|
+
|
|
269
|
+
function render() {
|
|
270
|
+
toggle.setAttribute('aria-expanded', state.open ? 'true' : 'false');
|
|
271
|
+
list.hidden = !state.open;
|
|
272
|
+
list.textContent = '';
|
|
273
|
+
if (!state.open) return;
|
|
274
|
+
if (state.failed) {
|
|
275
|
+
list.appendChild(el('div', 'agent-bar-shell-row__empty', "Couldn't read this app's shells."));
|
|
276
|
+
} else if (!state.shells) {
|
|
277
|
+
list.appendChild(el('div', 'agent-bar-shell-row__empty', 'Loading…'));
|
|
278
|
+
} else if (!state.shells.length) {
|
|
279
|
+
list.appendChild(el('div', 'agent-bar-shell-row__empty', 'This app has no shells.'));
|
|
280
|
+
} else {
|
|
281
|
+
state.shells.forEach((shell) => {
|
|
282
|
+
const row = menuRow(shell.iconClass, shell.label, shell.description);
|
|
283
|
+
row.addEventListener('click', () => {
|
|
284
|
+
state.open = false;
|
|
285
|
+
render();
|
|
286
|
+
// the menu goes away the way a tap beside it sends it away
|
|
287
|
+
const backdrop = document.querySelector('[data-mobile-menu-backdrop]');
|
|
288
|
+
if (backdrop && document.body.classList.contains('mobile-menu-open')) backdrop.click();
|
|
289
|
+
openShell(shell);
|
|
290
|
+
});
|
|
291
|
+
list.appendChild(row);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
toggle.addEventListener('click', () => {
|
|
297
|
+
state.open = !state.open;
|
|
298
|
+
render();
|
|
299
|
+
if (!state.open) return;
|
|
300
|
+
state.failed = false;
|
|
301
|
+
readAppShells()
|
|
302
|
+
.then((shells) => { state.shells = shells; })
|
|
303
|
+
.catch(() => { state.failed = true; })
|
|
304
|
+
.then(render);
|
|
305
|
+
});
|
|
306
|
+
return root;
|
|
307
|
+
}
|
|
308
|
+
|
|
227
309
|
// The Home Server button is in the top bar's markup; the button is put in as
|
|
228
310
|
// soon as that markup exists, so the top bar is drawn with it the first time.
|
|
229
311
|
function mount() {
|
|
@@ -234,8 +316,20 @@
|
|
|
234
316
|
return true;
|
|
235
317
|
}
|
|
236
318
|
|
|
319
|
+
// The row goes at the end of the menu's list, after the part the page redraws.
|
|
320
|
+
// Not before the page is read to its end: put in earlier, the rest of the
|
|
321
|
+
// list would be added after it.
|
|
322
|
+
function mountRow() {
|
|
323
|
+
if (document.querySelector('.agent-bar-shell-row')) return;
|
|
324
|
+
const scroller = document.querySelector('.appcanvas > aside .menu-scroller');
|
|
325
|
+
if (scroller) buildRow(scroller);
|
|
326
|
+
}
|
|
327
|
+
|
|
237
328
|
window.PinokioShellButton = { mount };
|
|
238
329
|
|
|
330
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', mountRow, { once: true });
|
|
331
|
+
else mountRow();
|
|
332
|
+
|
|
239
333
|
if (!mount()) {
|
|
240
334
|
const watcher = new MutationObserver(() => {
|
|
241
335
|
if (mount()) watcher.disconnect();
|
|
@@ -447,10 +447,16 @@ body.dark .agent-bar__note[data-kind="error"] {
|
|
|
447
447
|
font-size: 13px;
|
|
448
448
|
text-align: left;
|
|
449
449
|
}
|
|
450
|
-
.agent-bar__row:hover,
|
|
451
450
|
.agent-bar__row.is-current {
|
|
452
451
|
background: var(--agent-bar-chip);
|
|
453
452
|
}
|
|
453
|
+
/* A finger has no hover: on a touch screen the row it last touched would stay
|
|
454
|
+
lit and look like the chosen one. */
|
|
455
|
+
@media (hover: hover) {
|
|
456
|
+
.agent-bar__row:hover {
|
|
457
|
+
background: var(--agent-bar-chip);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
454
460
|
.agent-bar__row-img {
|
|
455
461
|
flex: none;
|
|
456
462
|
width: 18px;
|
|
@@ -299,8 +299,12 @@
|
|
|
299
299
|
// "Outside" means outside the box and its menus. The bar's own box is wider
|
|
300
300
|
// than that (it fills the top bar's flexible middle and centers the field in
|
|
301
301
|
// it), so the empty space left and right of the field is outside too.
|
|
302
|
+
// Inside the box, a press on anything but the open menu or a button puts the
|
|
303
|
+
// menu away. On a phone the box is the whole screen, so there is no outside.
|
|
302
304
|
document.addEventListener('pointerdown', (event) => {
|
|
303
|
-
|
|
305
|
+
const at = event.target;
|
|
306
|
+
if (!inner.contains(at)) bar.leave();
|
|
307
|
+
else if (bar.hasMenu() && !(at.closest && at.closest('.agent-bar__menu, button'))) bar.closeMenu();
|
|
304
308
|
}, true);
|
|
305
309
|
// A click inside a frame on this page (an app's own page, a side panel) never
|
|
306
310
|
// reaches this document, so the check above does not see it. What does happen
|
|
@@ -977,6 +981,11 @@
|
|
|
977
981
|
state.menu = null;
|
|
978
982
|
render();
|
|
979
983
|
};
|
|
984
|
+
// for the compose view (agent-bar-compose.js): leave the bar; the chosen agent;
|
|
985
|
+
// what the empty text says at rest
|
|
986
|
+
api.leave = leave;
|
|
987
|
+
api.tool = selectedTool;
|
|
988
|
+
api.hint = () => ITEMS[state.item].placeholder;
|
|
980
989
|
|
|
981
990
|
function toggleMenu(which) {
|
|
982
991
|
if (state.busy) return;
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
if (!data || typeof data !== 'string' || !handlers || scrollInput.test(data)) {
|
|
8
8
|
return
|
|
9
9
|
}
|
|
10
|
+
// xterm wraps a bracketed paste in two six-byte markers. Omit them from the preview.
|
|
11
|
+
if (data.startsWith('\x1b[200~') && data.endsWith('\x1b[201~')) {
|
|
12
|
+
data = data.slice(6, -6)
|
|
13
|
+
}
|
|
10
14
|
const capture = typeof handlers.capture === 'function' ? handlers.capture : function () {}
|
|
11
15
|
const handleBackspace = typeof handlers.backspace === 'function' ? handlers.backspace : function () {}
|
|
12
16
|
const resetBuffer = typeof handlers.reset === 'function' ? handlers.reset : function () {}
|
package/server/views/app.ejs
CHANGED
|
@@ -8382,6 +8382,8 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8382
8382
|
<script src="/agent-bar-panel.js" data-agent-bar-panel="true"></script>
|
|
8383
8383
|
<link rel="stylesheet" href="/agent-bar-attach.css">
|
|
8384
8384
|
<script src="/agent-bar-attach.js" data-agent-bar-attach="true"></script>
|
|
8385
|
+
<link rel="stylesheet" href="/agent-bar-compose.css">
|
|
8386
|
+
<script src="/agent-bar-compose.js" data-agent-bar-compose="true"></script>
|
|
8385
8387
|
<link rel="stylesheet" href="/agent-bar-shell.css">
|
|
8386
8388
|
<script src="/agent-bar-shell.js" data-agent-bar-shell="true"></script>
|
|
8387
8389
|
</head>
|
|
@@ -11896,7 +11898,9 @@ const rerenderMenuSection = (container, html) => {
|
|
|
11896
11898
|
launchUrl.searchParams.set(key, value)
|
|
11897
11899
|
consumedKeys.push(key)
|
|
11898
11900
|
})
|
|
11899
|
-
launchUrl.searchParams.
|
|
11901
|
+
if (!launchUrl.searchParams.has("session")) {
|
|
11902
|
+
launchUrl.searchParams.set("session", createLaunchSession())
|
|
11903
|
+
}
|
|
11900
11904
|
const relativeHref = `${launchUrl.pathname}${launchUrl.search}${launchUrl.hash}`
|
|
11901
11905
|
return {
|
|
11902
11906
|
launch: {
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
<script src="/agent-bar-panel.js" data-agent-bar-panel="true"></script>
|
|
9
9
|
<link rel="stylesheet" href="/agent-bar-attach.css">
|
|
10
10
|
<script src="/agent-bar-attach.js" data-agent-bar-attach="true"></script>
|
|
11
|
+
<link rel="stylesheet" href="/agent-bar-compose.css">
|
|
12
|
+
<script src="/agent-bar-compose.js" data-agent-bar-compose="true"></script>
|
|
11
13
|
<button type="button" class="main-sidebar-mobile-toggle" data-main-sidebar-toggle aria-label="Open navigation" aria-expanded="false">
|
|
12
14
|
<i class="fa-solid fa-bars" aria-hidden="true"></i>
|
|
13
15
|
</button>
|
|
@@ -1,13 +1,51 @@
|
|
|
1
|
-
const
|
|
1
|
+
const runtime = "plugin/antigravity-cli-auto/runtime"
|
|
2
|
+
const dir = `{{kernel.path('${runtime}')}}`
|
|
3
|
+
const agy = `{{kernel.path('${runtime}', platform === 'win32' ? 'agy.exe' : 'agy')}}`
|
|
4
|
+
const conda = { skip: true }
|
|
2
5
|
|
|
3
6
|
module.exports = {
|
|
4
7
|
title: "Antigravity CLI Auto",
|
|
5
8
|
icon: "antigravity.png",
|
|
6
9
|
description: "Antigravity CLI with tool permission prompts skipped.",
|
|
7
10
|
link: "https://antigravity.google/product/antigravity-cli",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
installed: (kernel) => kernel.exists(runtime, kernel.platform === "win32" ? "agy.exe" : "agy"),
|
|
12
|
+
install: [{
|
|
13
|
+
when: "{{platform !== 'win32'}}",
|
|
14
|
+
method: "shell.run",
|
|
15
|
+
params: {
|
|
16
|
+
path: dir,
|
|
17
|
+
conda,
|
|
18
|
+
env: { HOME: dir, ZDOTDIR: dir },
|
|
19
|
+
message: { _: ["bash", "-o", "pipefail", "-c",
|
|
20
|
+
'curl -fsSL https://antigravity.google/cli/install.sh | bash -s -- --dir "$PWD" || { printf "Error%s\\n" ": Antigravity install failed" >&2; exit 1; }'
|
|
21
|
+
] }
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
when: "{{platform === 'win32'}}",
|
|
25
|
+
method: "shell.run",
|
|
26
|
+
params: {
|
|
27
|
+
path: dir,
|
|
28
|
+
conda,
|
|
29
|
+
env: { LOCALAPPDATA: dir },
|
|
30
|
+
message: { _: ["powershell.exe", "-NoProfile", "-NonInteractive", "-Command",
|
|
31
|
+
"$ErrorActionPreference = 'Stop'\ntry { & ([ScriptBlock]::Create((Invoke-RestMethod 'https://antigravity.google/cli/install.ps1'))) '--dir' $PWD.Path '--skip-path' '--skip-aliases' } catch { Write-Host ('Error' + ': Antigravity install failed'); throw }"
|
|
32
|
+
] }
|
|
33
|
+
}
|
|
34
|
+
}],
|
|
35
|
+
update: [{ method: "shell.run", params: { path: dir, conda, message: { _: [agy, "update"] } } }],
|
|
36
|
+
uninstall: [{ method: "fs.rm", params: { path: dir } }],
|
|
37
|
+
run: [{
|
|
38
|
+
id: "run",
|
|
39
|
+
method: "shell.run",
|
|
40
|
+
params: {
|
|
41
|
+
conda,
|
|
42
|
+
message: {
|
|
43
|
+
_: [agy, "--dangerously-skip-permissions"],
|
|
44
|
+
"prompt-interactive": "{{args.prompt || input?.prompt || undefined}}"
|
|
45
|
+
},
|
|
46
|
+
path: "{{args.cwd || kernel.path('home')}}",
|
|
47
|
+
buffer: 1024,
|
|
48
|
+
input: true
|
|
49
|
+
}
|
|
50
|
+
}]
|
|
13
51
|
}
|
|
@@ -7,7 +7,7 @@ module.exports = {
|
|
|
7
7
|
id: "run",
|
|
8
8
|
method: "shell.run",
|
|
9
9
|
params: {
|
|
10
|
-
shell: "
|
|
10
|
+
shell: "bash",
|
|
11
11
|
conda: {
|
|
12
12
|
skip: true
|
|
13
13
|
},
|
|
@@ -43,5 +43,47 @@ module.exports = {
|
|
|
43
43
|
input: true,
|
|
44
44
|
buffer: 1024
|
|
45
45
|
}
|
|
46
|
+
}],
|
|
47
|
+
// The same agent's one-off command: it does the request, prints its answer and
|
|
48
|
+
// ends. It is started with permission to act, since nobody is there to give it.
|
|
49
|
+
job: [{
|
|
50
|
+
when: "{{platform === 'win32'}}",
|
|
51
|
+
method: "shell.run",
|
|
52
|
+
params: {
|
|
53
|
+
shell: "bash",
|
|
54
|
+
conda: {
|
|
55
|
+
skip: true
|
|
56
|
+
},
|
|
57
|
+
env: {
|
|
58
|
+
CLAUDE_CODE_GIT_BASH_PATH: "{{kernel.path('bin/miniforge/Library/bin/bash.exe')}}"
|
|
59
|
+
},
|
|
60
|
+
message: {
|
|
61
|
+
_: [
|
|
62
|
+
"npx",
|
|
63
|
+
"-y",
|
|
64
|
+
"@anthropic-ai/claude-code@latest",
|
|
65
|
+
"-p",
|
|
66
|
+
"--dangerously-skip-permissions",
|
|
67
|
+
"{{args.prompt}}"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
path: "{{args.cwd}}"
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
when: "{{platform !== 'win32'}}",
|
|
74
|
+
method: "shell.run",
|
|
75
|
+
params: {
|
|
76
|
+
message: {
|
|
77
|
+
_: [
|
|
78
|
+
"npx",
|
|
79
|
+
"-y",
|
|
80
|
+
"@anthropic-ai/claude-code@latest",
|
|
81
|
+
"-p",
|
|
82
|
+
"--dangerously-skip-permissions",
|
|
83
|
+
"{{args.prompt}}"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
path: "{{args.cwd}}"
|
|
87
|
+
}
|
|
46
88
|
}]
|
|
47
89
|
}
|
|
@@ -8,7 +8,7 @@ module.exports = {
|
|
|
8
8
|
id: "run",
|
|
9
9
|
method: "shell.run",
|
|
10
10
|
params: {
|
|
11
|
-
shell: "
|
|
11
|
+
shell: "bash",
|
|
12
12
|
conda: {
|
|
13
13
|
skip: true
|
|
14
14
|
},
|
|
@@ -54,5 +54,47 @@ module.exports = {
|
|
|
54
54
|
input: true,
|
|
55
55
|
buffer: 1024
|
|
56
56
|
}
|
|
57
|
+
}],
|
|
58
|
+
// The same agent's one-off command: it does the request, prints its answer and
|
|
59
|
+
// ends. It is started with permission to act, since nobody is there to give it.
|
|
60
|
+
job: [{
|
|
61
|
+
when: "{{platform === 'win32'}}",
|
|
62
|
+
method: "shell.run",
|
|
63
|
+
params: {
|
|
64
|
+
shell: "bash",
|
|
65
|
+
conda: {
|
|
66
|
+
skip: true
|
|
67
|
+
},
|
|
68
|
+
env: {
|
|
69
|
+
CLAUDE_CODE_GIT_BASH_PATH: "{{kernel.path('bin/miniforge/Library/bin/bash.exe')}}"
|
|
70
|
+
},
|
|
71
|
+
message: {
|
|
72
|
+
_: [
|
|
73
|
+
"npx",
|
|
74
|
+
"-y",
|
|
75
|
+
"@anthropic-ai/claude-code@latest",
|
|
76
|
+
"-p",
|
|
77
|
+
"--dangerously-skip-permissions",
|
|
78
|
+
"{{args.prompt}}"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
path: "{{args.cwd}}"
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
when: "{{platform !== 'win32'}}",
|
|
85
|
+
method: "shell.run",
|
|
86
|
+
params: {
|
|
87
|
+
message: {
|
|
88
|
+
_: [
|
|
89
|
+
"npx",
|
|
90
|
+
"-y",
|
|
91
|
+
"@anthropic-ai/claude-code@latest",
|
|
92
|
+
"-p",
|
|
93
|
+
"--dangerously-skip-permissions",
|
|
94
|
+
"{{args.prompt}}"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
path: "{{args.cwd}}"
|
|
98
|
+
}
|
|
57
99
|
}]
|
|
58
100
|
}
|
|
@@ -7,7 +7,7 @@ module.exports = {
|
|
|
7
7
|
id: "run",
|
|
8
8
|
method: "shell.run",
|
|
9
9
|
params: {
|
|
10
|
-
shell: "
|
|
10
|
+
shell: "bash",
|
|
11
11
|
conda: {
|
|
12
12
|
skip: true
|
|
13
13
|
},
|
|
@@ -38,5 +38,46 @@ module.exports = {
|
|
|
38
38
|
path: "{{args.cwd}}",
|
|
39
39
|
input: true
|
|
40
40
|
}
|
|
41
|
+
}],
|
|
42
|
+
// The same agent's one-off command: it does the request, prints its answer and
|
|
43
|
+
// ends. It is started with permission to act, since nobody is there to give it.
|
|
44
|
+
job: [{
|
|
45
|
+
when: "{{platform === 'win32'}}",
|
|
46
|
+
method: "shell.run",
|
|
47
|
+
params: {
|
|
48
|
+
shell: "bash",
|
|
49
|
+
conda: {
|
|
50
|
+
skip: true
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
_: [
|
|
54
|
+
"npx",
|
|
55
|
+
"-y",
|
|
56
|
+
"@openai/codex@latest",
|
|
57
|
+
"exec",
|
|
58
|
+
"--skip-git-repo-check",
|
|
59
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
60
|
+
"{{args.prompt}}"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
path: "{{args.cwd}}"
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
when: "{{platform !== 'win32'}}",
|
|
67
|
+
method: "shell.run",
|
|
68
|
+
params: {
|
|
69
|
+
message: {
|
|
70
|
+
_: [
|
|
71
|
+
"npx",
|
|
72
|
+
"-y",
|
|
73
|
+
"@openai/codex@latest",
|
|
74
|
+
"exec",
|
|
75
|
+
"--skip-git-repo-check",
|
|
76
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
77
|
+
"{{args.prompt}}"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
path: "{{args.cwd}}"
|
|
81
|
+
}
|
|
41
82
|
}]
|
|
42
83
|
}
|