@oddessentials/agent-guild 0.32.0 → 0.33.0
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/README.md +37 -2
- package/bin/agent-guild.mjs +8 -3
- package/package.json +1 -1
- package/src/manager/autostart.mjs +492 -0
- package/src/manager/main.mjs +15 -2
- package/src/manager/server.mjs +11 -0
- package/src/manager/session.mjs +27 -2
- package/src/manager/shell-env.mjs +53 -13
- package/src/manager/uninstall.mjs +7 -2
- package/src/manager/usage.mjs +116 -10
- package/web/app.js +87 -6
- package/web/index.html +6 -0
- package/web/layout.js +36 -0
- package/web/styles.css +7 -2
- package/web/terminal-controls.js +7 -25
package/web/terminal-controls.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { bindVisibleViewport } from './layout.js';
|
|
2
|
+
|
|
1
3
|
const ARROWS = { ArrowUp: 'A', ArrowDown: 'B', ArrowRight: 'C', ArrowLeft: 'D' };
|
|
2
4
|
|
|
3
5
|
/** Use the same cursor mode as a physical keyboard, including inside full-screen tools. */
|
|
@@ -102,29 +104,9 @@ export class TerminalControls {
|
|
|
102
104
|
|
|
103
105
|
/** Fit the touch panel to a docked keyboard without changing global page layout. */
|
|
104
106
|
export function bindTerminalViewport(panel, controls) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
panel.style.removeProperty('--terminal-viewport-bottom');
|
|
111
|
-
delete panel.dataset.compact;
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
// Magnification belongs to the browser; it must not resize the shared PTY.
|
|
115
|
-
if (viewport && Math.abs(viewport.scale - 1) > 0.01) return;
|
|
116
|
-
const top = viewport?.offsetTop || 0;
|
|
117
|
-
const height = viewport?.height ?? innerHeight;
|
|
118
|
-
panel.style.setProperty('--terminal-viewport-top', `${top}px`);
|
|
119
|
-
panel.style.setProperty('--terminal-viewport-bottom', `${Math.max(0, innerHeight - top - height)}px`);
|
|
120
|
-
panel.toggleAttribute('data-compact', height < 420);
|
|
121
|
-
};
|
|
122
|
-
const schedule = () => { cancelAnimationFrame(frame); frame = requestAnimationFrame(update); };
|
|
123
|
-
viewport?.addEventListener('resize', schedule);
|
|
124
|
-
viewport?.addEventListener('scroll', schedule);
|
|
125
|
-
addEventListener('resize', schedule);
|
|
126
|
-
addEventListener('pageshow', schedule);
|
|
127
|
-
const observer = new MutationObserver(schedule);
|
|
128
|
-
for (const element of [panel, controls]) observer.observe(element, { attributes: true, attributeFilter: ['hidden'] });
|
|
129
|
-
schedule();
|
|
107
|
+
bindVisibleViewport(panel, 'terminal', {
|
|
108
|
+
shown: () => !panel.hidden && !controls.hidden,
|
|
109
|
+
watch: [panel, controls],
|
|
110
|
+
fitted: (height) => panel.toggleAttribute('data-compact', height !== null && height < 420),
|
|
111
|
+
});
|
|
130
112
|
}
|