castle-web-cli 0.4.69 → 0.4.70
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/dist/ide.d.ts +0 -1
- package/dist/ide.js +0 -10
- package/dist/serve.js +2 -2
- package/package.json +1 -1
package/dist/ide.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Duplex } from "stream";
|
|
|
3
3
|
import { type RawData } from "ws";
|
|
4
4
|
export declare const IDE_ASSET_PREFIX = "/__castle/ide/";
|
|
5
5
|
export declare const PTY_WS_PATH = "/__castle/pty";
|
|
6
|
-
export declare const DECK_FOCUS_SCRIPT: string;
|
|
7
6
|
export declare function rawDataToString(data: RawData): string;
|
|
8
7
|
export interface IdeServer {
|
|
9
8
|
/** Serve the IDE page + its static assets. Returns true if it handled the request. */
|
package/dist/ide.js
CHANGED
|
@@ -62,16 +62,6 @@ function serveShellFile(res, asset) {
|
|
|
62
62
|
// upgrade handler on Vite's HTTP server).
|
|
63
63
|
export const IDE_ASSET_PREFIX = "/__castle/ide/";
|
|
64
64
|
export const PTY_WS_PATH = "/__castle/pty";
|
|
65
|
-
// Injected into every served deck's <head>. When the deck runs embedded in
|
|
66
|
-
// the IDE shell iframe, Ctrl+T moves keyboard focus out to the panel (the
|
|
67
|
-
// chat input or the terminal, whichever view is active) -- but while the
|
|
68
|
-
// iframe holds focus the parent sees no keydowns, so the deck page has to
|
|
69
|
-
// forward Ctrl+T itself. No-op for a standalone deck.
|
|
70
|
-
export const DECK_FOCUS_SCRIPT = `<script>(function(){if(window.parent===window)return;` +
|
|
71
|
-
`document.addEventListener('keydown',function(e){` +
|
|
72
|
-
`if(e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&(e.key==='t'||e.key==='T')){` +
|
|
73
|
-
`e.preventDefault();try{parent.postMessage({type:'castle-ide-toggle-focus'},'*');}catch(_){}}` +
|
|
74
|
-
`},true);})();</script>`;
|
|
75
65
|
function defaultShell() {
|
|
76
66
|
if (process.platform === "win32") {
|
|
77
67
|
return { command: process.env.COMSPEC ?? "cmd.exe", args: [] };
|
package/dist/serve.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|
|
4
4
|
import { spawn } from 'child_process';
|
|
5
5
|
import { createServer } from 'vite';
|
|
6
6
|
import { WebSocketServer, WebSocket } from 'ws';
|
|
7
|
-
import { createIdeServer
|
|
7
|
+
import { createIdeServer } from './ide.js';
|
|
8
8
|
import { createAgentServer } from './agent.js';
|
|
9
9
|
import { sceneFilesPlugin } from './vitePlugins.js';
|
|
10
10
|
import * as config from './config.js';
|
|
@@ -31,7 +31,7 @@ function castlePlugin(wsPort, ideServer, agentServer) {
|
|
|
31
31
|
transformIndexHtml: {
|
|
32
32
|
order: 'pre',
|
|
33
33
|
handler(html) {
|
|
34
|
-
return html.replace(/<head(\s[^>]*)?>/i, (match) => `${match}\n <script>window.CastleEmbed={edit:true,host:'dev'};</script
|
|
34
|
+
return html.replace(/<head(\s[^>]*)?>/i, (match) => `${match}\n <script>window.CastleEmbed={edit:true,host:'dev'};</script>`);
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
configureServer(server) {
|