@theoremjs/studio 0.3.4-next.548.gbb156b2 → 0.3.4-next.550.gf20b9cd
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 +54 -14
- package/agreement.js +22 -7
- package/compile.js +3 -1
- package/cookbooks/catalog.d.ts +18 -0
- package/cookbooks/catalog.js +84 -8
- package/cookbooks/mod.d.ts +1 -1
- package/draft.d.ts +2 -0
- package/mod.d.ts +1 -1
- package/package.json +4 -4
- package/page/assets/Banner-Bvkdyf59.js +2 -0
- package/page/assets/BottomSheet-Dbh6A5Vl.js +1 -0
- package/page/assets/{Card-Ghe4ozhC.js → Card-DruykyeB.js} +1 -1
- package/page/assets/CheckboxInput-CFZ_Wq8-.js +2 -0
- package/page/assets/CodeBlock-CfVOtDeO.js +52 -0
- package/page/assets/CollapsibleGroup-FIawJRo4.js +1 -0
- package/page/assets/ConsoleFrame-BTL67qHr.js +3 -0
- package/page/assets/ContextMenu-BngxR9na.js +2 -0
- package/page/assets/DateInput-B1ICJtHn.js +1 -0
- package/page/assets/{Dialog-BDUExlk_.js → Dialog-Sd04KQS2.js} +1 -1
- package/page/assets/EmptyState-C_uF9Wyj.js +1 -0
- package/page/assets/HoverCard-DMyWUvwP.js +1 -0
- package/page/assets/Icon-BqkS-pIq.js +3 -0
- package/page/assets/IconButton-DVUFx-8p.js +1 -0
- package/page/assets/ListItem-QF7KFt0h.js +1 -0
- package/page/assets/MenuBottomSheet-C4fG_GyZ.js +1 -0
- package/page/assets/MenuBottomSheetActionList-3L0HS4Kf.js +1 -0
- package/page/assets/SchemaFields-BT2XCbid.js +1 -0
- package/page/assets/ScrollableArea-BHfY7sWH.js +1 -0
- package/page/assets/SegmentedControlItem-BBGRPrxp.js +1 -0
- package/page/assets/{Text-BsiAsowd.js → Text-BOqCfzZC.js} +2 -2
- package/page/assets/{TimestampHoverCard-CCnmnVlQ.js → TimestampHoverCard-CDCVpEWM.js} +1 -1
- package/page/assets/{ToolResultCharts-DQc5tTgc.js → ToolResultCharts-rJr0Ksno.js} +1 -1
- package/page/assets/Tooltip-BWs5DLrM.js +1 -0
- package/page/assets/TraceInspector-DQI_wNzL.js +1 -0
- package/page/assets/{TraceOverview-DqhP_wzg.js → TraceOverview-DmfmwSR6.js} +2 -2
- package/page/assets/{_virtual_studio-type-sources-CvOETQ24.js → _virtual_studio-type-sources-CxP3L28S.js} +139 -77
- package/page/assets/browser-engine-B1PxEekk.js +11 -0
- package/page/assets/browser-transport-BOHBmYvp.js +47 -0
- package/page/assets/{embedding-space-view-BU2AjjAx.js → embedding-space-view-CN0VHXXH.js} +1 -1
- package/page/assets/{export-agent-D-Rj6FQy.js → export-agent-BvEVKW_C.js} +1 -1
- package/page/assets/fieldParts-B7DYLgh4.js +1 -0
- package/page/assets/focusableSelector-DXZeMU85.js +1 -0
- package/page/assets/{guardrail-tester-lZGPnEIR.js → guardrail-tester-08T-hMFL.js} +2 -2
- package/page/assets/index-eSb7kilv.js +146 -0
- package/page/assets/isRenderable-DHkzpAoQ.js +1 -0
- package/page/assets/{labels-provider-BObUoNKa.js → labels-provider-DkA22zkP.js} +1 -1
- package/page/assets/{live-messages-DuLSkEdL.js → live-messages-DmTC8qc8.js} +1 -1
- package/page/assets/plainDate-BHiJcj7o.js +1 -0
- package/page/assets/reader-DoTXxl0W.js +7 -0
- package/page/assets/{stub-kLwOLu-h.js → stub-CKo_lxer.js} +1 -1
- package/page/assets/studio-code-pane-CEG07Zk7.js +8 -0
- package/page/assets/{studio-console-DgsrR6Qy.js → studio-console-udt4MmTi.js} +1 -1
- package/page/assets/studio-decision-tocwLzxr.js +1 -0
- package/page/assets/studio-embedding-DQ84xzlj.js +2 -0
- package/page/assets/studio-host-console-BJOUpXHR.js +2 -0
- package/page/assets/studio-labels-Zqd84hcs.js +3 -0
- package/page/assets/studio-live-BmuHpeF4.js +5 -0
- package/page/assets/{studio-map-D7QZ6RAm.js → studio-map-qP_i4hWG.js} +1 -1
- package/page/assets/{studio-trace-replay-BSts3p2O.js → studio-trace-replay-JUMs6EMA.js} +2 -2
- package/page/assets/{studio-type-checker-BNljIXdE.js → studio-type-checker-B_CHmWnf.js} +1 -1
- package/page/assets/{tool-schema--CLE7o0H.js → tool-schema-CWGccblZ.js} +5 -5
- package/page/assets/{trace-patterns-CS99kExN.js → trace-patterns-D6TbkLLr.js} +1 -1
- package/page/assets/tree-B7VVMg1s.js +3 -0
- package/page/assets/{turn-client-DXtNeRHG.js → turn-client-CoLR6hrl.js} +1 -1
- package/page/assets/types-CL44MvsT.js +1 -0
- package/page/assets/{use-one-call-TAgOAnMo.js → use-one-call-BKeMtY5F.js} +1 -1
- package/page/assets/use-second-ticker-GWBt83pd.css +1 -0
- package/page/assets/use-trace-records-B1vrKQmA.js +1 -0
- package/page/assets/useAdaptivePresentation-Bma4-u1a.js +1 -0
- package/page/assets/useAnnounce-DTSHZvjg.js +1 -0
- package/page/assets/useClipboard-CbN9bb4J.js +1 -0
- package/page/assets/useDevWarning-Z9SoixOP.js +1 -0
- package/page/assets/useFocusReturnVisibility-BHKv5Jwr.js +1 -0
- package/page/assets/useMenuPress-DLG1QOiE.js +1 -0
- package/page/assets/useResolvedRequired-DbsOcDqy.js +1 -0
- package/page/assets/useScrollableArea-DuF_pz9m.js +1 -0
- package/page/assets/useTooltip-c097gL_-.js +1 -0
- package/page/assets/{workspace-Cb6PICiw.js → workspace-NGa3jjDc.js} +1 -1
- package/page/index.html +45 -38
- package/read-source.js +5 -4
- package/read-studio.mjs +99 -0
- package/requirements.d.ts +3 -0
- package/requirements.js +10 -0
- package/server/alerts.d.ts +23 -0
- package/server/alerts.js +82 -0
- package/server/draft-handler.d.ts +3 -0
- package/server/draft-handler.js +5 -1
- package/server/events.d.ts +38 -0
- package/server/events.js +95 -0
- package/server/handler.d.ts +11 -3
- package/server/handler.js +64 -8
- package/server/project-source.d.ts +6 -3
- package/server/project-source.js +45 -4
- package/server/project.js +25 -3
- package/server/save-session.d.ts +2 -0
- package/server/save-session.js +7 -1
- package/server/serve.d.ts +1 -1
- package/server/serve.js +174 -18
- package/server/test-key.d.ts +19 -2
- package/server/test-key.js +51 -74
- package/server/watch.d.ts +8 -0
- package/server/watch.js +16 -5
- package/start.mjs +95 -5
- package/ui/built/theme.css +2 -2
- package/ui/built/theme.css.d.ts +2 -2
- package/ui/built/theorem-studio.d.ts +2 -2
- package/ui/built/theorem-studio.js +3 -3
- package/ui/built/theorem-studio.variants.d.ts +2 -2
- package/ui/lib/page-errors.d.ts +13 -0
- package/ui/lib/page-errors.js +31 -0
- package/ui/profile-editor.js +1 -1
- package/ui/studio-runner.d.ts +1 -1
- package/ui/studio-runner.js +7 -3
- package/ui/studio-screen.js +23 -11
- package/page/assets/Banner-BP1TXM0J.js +0 -2
- package/page/assets/BottomSheet-BQPskY35.js +0 -1
- package/page/assets/CheckboxInput-C9kbVyhK.js +0 -2
- package/page/assets/CodeBlock-Kjgv83A6.js +0 -52
- package/page/assets/CollapsibleGroup-Bfnp4Aaz.js +0 -1
- package/page/assets/ConsoleFrame-Da49DUMV.js +0 -3
- package/page/assets/ContextMenu-DGeuOuIz.js +0 -2
- package/page/assets/DateInput-BJt-UTCy.js +0 -1
- package/page/assets/EmptyState-C8W4JKBZ.js +0 -1
- package/page/assets/HoverCard-C6thuzrf.js +0 -1
- package/page/assets/Icon-ZfFwTt8n.js +0 -3
- package/page/assets/IconButton-CG5klqF1.js +0 -1
- package/page/assets/ScrollableArea-C8AVuqnt.js +0 -1
- package/page/assets/Section-DJ97F7QE.js +0 -1
- package/page/assets/SegmentedControlItem-BLuJOusN.js +0 -1
- package/page/assets/Tooltip-CTEuMRLe.js +0 -1
- package/page/assets/TraceInspector-Cn7_V-2C.js +0 -1
- package/page/assets/browser-engine-BUuO2-Ve.js +0 -11
- package/page/assets/browser-transport-FDq0Q4Fx.js +0 -47
- package/page/assets/fieldParts-Cs6Amprh.js +0 -1
- package/page/assets/index-Bk_jhM4_.js +0 -145
- package/page/assets/reader-DJB6MzQf.js +0 -7
- package/page/assets/studio-code-pane-D7R84b_Y.js +0 -8
- package/page/assets/studio-decision-uyaB9Oo3.js +0 -1
- package/page/assets/studio-embedding-tRaNKz_n.js +0 -2
- package/page/assets/studio-host-console-DzpUuYer.js +0 -2
- package/page/assets/studio-labels-CByQ2z3Y.js +0 -3
- package/page/assets/studio-live-CWeuAs3g.js +0 -5
- package/page/assets/tree-CDqNZ8w-.js +0 -3
- package/page/assets/types-DTbqRZ5l.js +0 -1
- package/page/assets/use-second-ticker-CnxaP3LD.css +0 -1
- package/page/assets/use-trace-records-CZNBjTS0.js +0 -1
- package/page/assets/useAdaptivePresentation-BY_zvjIp.js +0 -1
- package/page/assets/useClipboard-B1amtN2V.js +0 -1
- package/page/assets/useDevWarning-Cna3kqg1.js +0 -1
- package/page/assets/useScrollableArea-vxuztwym.js +0 -1
- package/page/assets/useTooltip-rxACYEAC.js +0 -1
- /package/page/assets/{use-second-ticker-VX91zrxj.js → use-second-ticker-DhbZ0Soz.js} +0 -0
package/server/serve.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Starts the studio's local server for one project.
|
|
3
3
|
*
|
|
4
4
|
* deno run -A studio/server/serve.ts <setup-module> [--port 4983] [--page http://localhost:5174]
|
|
5
|
-
* [--deno-config <deno.json>] [--editor <command>]
|
|
5
|
+
* [--deno-config <deno.json>] [--editor <command>] [--no-watch] [--quiet] [--offline] [--verbose]
|
|
6
6
|
*
|
|
7
7
|
* The setup module is the project's: its default export registers the project's
|
|
8
8
|
* tools, profiles, and providers; an optional `host` export gives tool handlers
|
|
@@ -25,11 +25,13 @@ import { stripVTControlCharacters } from 'node:util';
|
|
|
25
25
|
import { newConversationKey } from "../conversation-key.js";
|
|
26
26
|
import { RUNNING_PATH } from '../ports.mjs';
|
|
27
27
|
import { READ_STEPS } from "../read-steps.js";
|
|
28
|
+
import { alertText, keyLine, loadedText } from "./alerts.js";
|
|
28
29
|
import { createEditedSession } from "./edited-session.js";
|
|
29
|
-
import {
|
|
30
|
+
import { createEventLog, watchRun } from "./events.js";
|
|
31
|
+
import { corsHeaders, isForeign, json, KEYS_PATH, STUDIO_BASE, } from "./handler.js";
|
|
30
32
|
import { answerOpen, chosenEditor, defaultEditor } from "./open-editor.js";
|
|
31
33
|
import { PROJECT_READY } from "./project.js";
|
|
32
|
-
import { isInside } from "./project-source.js";
|
|
34
|
+
import { entryOf, isInside } from "./project-source.js";
|
|
33
35
|
import { answerSave, createSaveSession, isSaveRequest } from "./save-session.js";
|
|
34
36
|
import { createWatchFeed, watchFiles } from "./watch.js";
|
|
35
37
|
function flag(name, fallback) {
|
|
@@ -38,7 +40,7 @@ function flag(name, fallback) {
|
|
|
38
40
|
}
|
|
39
41
|
const setupPath = Deno.args.find((arg, i) => !arg.startsWith('--') && !Deno.args[i - 1]?.startsWith('--'));
|
|
40
42
|
if (!setupPath) {
|
|
41
|
-
console.error('usage: studio/server/serve.ts <setup-module> [--port 4983] [--page http://localhost:5174] [--deno-config deno.json] [--editor code] [--no-watch]');
|
|
43
|
+
console.error('usage: studio/server/serve.ts <setup-module> [--port 4983] [--page http://localhost:5174] [--deno-config deno.json] [--editor code] [--no-watch] [--quiet] [--offline] [--verbose]');
|
|
42
44
|
Deno.exit(2);
|
|
43
45
|
}
|
|
44
46
|
const port = Number(flag('port', '4983'));
|
|
@@ -127,10 +129,11 @@ async function stop(loaded) {
|
|
|
127
129
|
}
|
|
128
130
|
await loaded.process.status;
|
|
129
131
|
}
|
|
130
|
-
/** Whether the project type-checks as it is on disk, and what the checker printed. */
|
|
132
|
+
/** Whether the project type-checks as it is on disk, from the setup and the entry it names, and what the checker printed. */
|
|
131
133
|
async function typeChecks() {
|
|
134
|
+
const entry = entryOf(setupFile);
|
|
132
135
|
const { success, stderr, stdout } = await new Deno.Command(Deno.execPath(), {
|
|
133
|
-
args: ['check', ...configArgs, setupFile],
|
|
136
|
+
args: ['check', ...configArgs, setupFile, ...(entry ? [entry] : [])],
|
|
134
137
|
cwd: root,
|
|
135
138
|
env: { NO_COLOR: '1' },
|
|
136
139
|
stdin: 'null',
|
|
@@ -205,26 +208,46 @@ const session = createSaveSession({
|
|
|
205
208
|
},
|
|
206
209
|
stop,
|
|
207
210
|
opened: (loaded) => loaded.description.workspace,
|
|
211
|
+
unopened: (loaded) => loaded.description.problems.map((problem) => problem.profile),
|
|
208
212
|
}, first);
|
|
209
213
|
/** Passes a request on to a load of the project, and its answer back as it streams. */
|
|
210
214
|
async function forward(request, loaded = session.project(), path) {
|
|
211
215
|
const url = new URL(request.url);
|
|
216
|
+
const to = path ?? url.pathname;
|
|
212
217
|
if (request.headers.get('upgrade')?.toLowerCase() === 'websocket') {
|
|
213
|
-
return forwardSocket(request, `${loaded.origin}${
|
|
218
|
+
return forwardSocket(request, `${loaded.origin}${to}${url.search}`);
|
|
214
219
|
}
|
|
215
220
|
const headers = new Headers(request.headers);
|
|
216
221
|
headers.delete('host');
|
|
217
|
-
|
|
222
|
+
let response;
|
|
218
223
|
try {
|
|
219
|
-
|
|
224
|
+
response = await fetch(`${loaded.origin}${to}${url.search}`, {
|
|
220
225
|
method: request.method,
|
|
221
226
|
headers,
|
|
222
|
-
body,
|
|
227
|
+
body: await bodyOf(request),
|
|
223
228
|
});
|
|
224
229
|
}
|
|
225
230
|
catch {
|
|
226
231
|
return json(502, {}, corsHeaders(request, pageOrigins));
|
|
227
232
|
}
|
|
233
|
+
return request.method === 'OPTIONS' ? response : watchedRun(request.method, to, response);
|
|
234
|
+
}
|
|
235
|
+
/** What a request carries on: nothing for a read. */
|
|
236
|
+
async function bodyOf(request) {
|
|
237
|
+
return request.method === 'GET' || request.method === 'HEAD'
|
|
238
|
+
? undefined
|
|
239
|
+
: await request.arrayBuffer();
|
|
240
|
+
}
|
|
241
|
+
/** A run's answer, watched for a failure to tell the terminal of; any other answer as it is. */
|
|
242
|
+
function watchedRun(method, to, response) {
|
|
243
|
+
const profile = to.startsWith(PROFILES)
|
|
244
|
+
? decodeURIComponent(to.slice(PROFILES.length).split('/')[0] ?? '')
|
|
245
|
+
: undefined;
|
|
246
|
+
if (profile === undefined)
|
|
247
|
+
return response;
|
|
248
|
+
if (verbose)
|
|
249
|
+
console.error(`theorem studio: run ${profile} ${method} ${to.slice(PROFILES.length + profile.length) || '/'} → ${response.status}`);
|
|
250
|
+
return watchRun(response, (said) => tell('run', `run ${profile} failed: ${said}`));
|
|
228
251
|
}
|
|
229
252
|
/**
|
|
230
253
|
* Joins the page's socket to the same path of the project: a voice call. What the page sends
|
|
@@ -259,6 +282,10 @@ function forwardSocket(request, to) {
|
|
|
259
282
|
project.addEventListener('error', shut(page));
|
|
260
283
|
return response;
|
|
261
284
|
}
|
|
285
|
+
/** Where the project serves each profile's runs. */
|
|
286
|
+
const PROFILES = `${STUDIO_BASE}/profiles/`;
|
|
287
|
+
const EVENTS = `${STUDIO_BASE}/events`;
|
|
288
|
+
const STATUS = `${STUDIO_BASE}/status`;
|
|
262
289
|
const SAVE = `${STUDIO_BASE}/save`;
|
|
263
290
|
const WATCH = `${STUDIO_BASE}/watch`;
|
|
264
291
|
const OPEN = `${STUDIO_BASE}/open`;
|
|
@@ -312,12 +339,50 @@ const editor = {
|
|
|
312
339
|
*/
|
|
313
340
|
async function described(said) {
|
|
314
341
|
const files = await session.read(said);
|
|
315
|
-
|
|
342
|
+
const description = {
|
|
316
343
|
...session.project().description,
|
|
317
344
|
...files,
|
|
318
345
|
editor: defaultEditor(editor),
|
|
319
346
|
setup: relative(root, setupFile),
|
|
320
347
|
};
|
|
348
|
+
tellTerminal(description);
|
|
349
|
+
return description;
|
|
350
|
+
}
|
|
351
|
+
/** Whether the command was started without printing anything about the project. */
|
|
352
|
+
const quiet = Deno.args.includes('--quiet');
|
|
353
|
+
/** Whether the command also prints each run as it ends, not only the ones that fail. */
|
|
354
|
+
const verbose = Deno.args.includes('--verbose');
|
|
355
|
+
/** Whether the command was started without asking each provider whether its key works. */
|
|
356
|
+
const offline = Deno.args.includes('--offline');
|
|
357
|
+
/** What the key checks said: none until they answer. */
|
|
358
|
+
let keysSaid;
|
|
359
|
+
/** The entry the setup names, from the folder the command ran in. */
|
|
360
|
+
function entryAt() {
|
|
361
|
+
const entry = entryOf(setupFile);
|
|
362
|
+
return entry ? { entry: relative(root, entry) } : {};
|
|
363
|
+
}
|
|
364
|
+
/** What happened that the builder should know of, for `theorem-studio errors` to read. */
|
|
365
|
+
const events = createEventLog();
|
|
366
|
+
/** What was printed last: `null` before the first print, so a clean project still says so. */
|
|
367
|
+
let told = null;
|
|
368
|
+
/** Keeps an event and prints it, unless it repeats the last one or the command is quiet. */
|
|
369
|
+
function tell(kind, text) {
|
|
370
|
+
if (events.add(kind, text) && !quiet)
|
|
371
|
+
console.error(`theorem studio: ${text}`);
|
|
372
|
+
}
|
|
373
|
+
/** Prints what the builder should look at when it is not what was printed last. */
|
|
374
|
+
function tellTerminal(description) {
|
|
375
|
+
const text = alertText(description);
|
|
376
|
+
if (text === told)
|
|
377
|
+
return;
|
|
378
|
+
const first = told === null;
|
|
379
|
+
told = text;
|
|
380
|
+
const said = text ?? `theorem studio: nothing ${first ? '' : 'left '}to look at`;
|
|
381
|
+
// why: a project that opens clean has nothing to keep; one that comes clean later does.
|
|
382
|
+
if (!(first && text === undefined))
|
|
383
|
+
events.add('look', said);
|
|
384
|
+
if (!quiet)
|
|
385
|
+
console.error(said);
|
|
321
386
|
}
|
|
322
387
|
/** Whether the request asks for the project as the page opens it, and whether for the steps of reading it first. */
|
|
323
388
|
function opens(request) {
|
|
@@ -371,6 +436,60 @@ function watching(request) {
|
|
|
371
436
|
const cors = corsHeaders(request, pageOrigins);
|
|
372
437
|
return feed ? feed.subscribe(cors) : new Response(null, { status: 204, headers: cors });
|
|
373
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* `GET <base>/status`: what the command printed when the project opened, as it is now: what
|
|
441
|
+
* loaded, what the keys said, and what to look at. Plain text, for `theorem-studio status`.
|
|
442
|
+
*/
|
|
443
|
+
async function answerStatus(request) {
|
|
444
|
+
if (request.method !== 'GET' || new URL(request.url).pathname !== STATUS)
|
|
445
|
+
return undefined;
|
|
446
|
+
// why: the files are read again, so status agrees with them even when no page has asked since.
|
|
447
|
+
const description = await described();
|
|
448
|
+
const keys = offline ? 'offline' : (keysSaid ?? 'checking');
|
|
449
|
+
const look = alertText(description) ?? 'theorem studio: nothing to look at';
|
|
450
|
+
return new Response(`${loadedText(description, { ...entryAt(), keys })}\n${look}\n`, {
|
|
451
|
+
headers: { 'content-type': 'text/plain; charset=utf-8', ...corsHeaders(request, pageOrigins) },
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
/** The longest error the page may send. */
|
|
455
|
+
const PAGE_ERROR_BYTES = 8000;
|
|
456
|
+
/**
|
|
457
|
+
* The event log: `GET` lists it, `GET ?follow` streams it, and the page `POST`s `{ text }` for an
|
|
458
|
+
* error it met, which the log keeps as the page's.
|
|
459
|
+
*/
|
|
460
|
+
async function answerEvents(request) {
|
|
461
|
+
const url = new URL(request.url);
|
|
462
|
+
if (url.pathname !== EVENTS)
|
|
463
|
+
return undefined;
|
|
464
|
+
const cors = corsHeaders(request, pageOrigins);
|
|
465
|
+
if (request.method === 'OPTIONS')
|
|
466
|
+
return new Response(null, { status: 204, headers: cors });
|
|
467
|
+
if (request.method === 'GET') {
|
|
468
|
+
return url.searchParams.has('follow') ? events.follow(cors) : json(200, events.list(), cors);
|
|
469
|
+
}
|
|
470
|
+
return request.method === 'POST' ? await keepPageError(request, cors) : json(405, {}, cors);
|
|
471
|
+
}
|
|
472
|
+
/** Keeps the error a page `POST`s as `{ text }`. */
|
|
473
|
+
async function keepPageError(request, cors) {
|
|
474
|
+
const sent = await request.text();
|
|
475
|
+
if (sent.length > PAGE_ERROR_BYTES)
|
|
476
|
+
return json(413, {}, cors);
|
|
477
|
+
const text = pageError(sent);
|
|
478
|
+
if (!text)
|
|
479
|
+
return json(400, {}, cors);
|
|
480
|
+
tell('page', `the page: ${text}`);
|
|
481
|
+
return json(200, {}, cors);
|
|
482
|
+
}
|
|
483
|
+
/** The error a page sent as `{ text }`, trimmed; nothing when it sent no text. */
|
|
484
|
+
function pageError(sent) {
|
|
485
|
+
try {
|
|
486
|
+
const { text } = JSON.parse(sent);
|
|
487
|
+
return typeof text === 'string' ? text.trim() || undefined : undefined;
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
return undefined;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
374
493
|
/** The setup this studio is open on, for a second studio command to find it already running. */
|
|
375
494
|
function running(request) {
|
|
376
495
|
if (request.method !== 'GET' || new URL(request.url).pathname !== RUNNING_PATH)
|
|
@@ -387,15 +506,25 @@ async function answered(request) {
|
|
|
387
506
|
const cors = corsHeaders(request, pageOrigins);
|
|
388
507
|
return 'workspace' in answer ? json(200, answer, cors) : json(answer.status, answer.body, cors);
|
|
389
508
|
}
|
|
390
|
-
|
|
509
|
+
/** The studio's own routes, in the order they are asked; a request none answers goes to the project. */
|
|
510
|
+
const ROUTES = [
|
|
511
|
+
running,
|
|
512
|
+
watching,
|
|
513
|
+
openedSaying,
|
|
514
|
+
answerStatus,
|
|
515
|
+
answerEvents,
|
|
516
|
+
answered,
|
|
517
|
+
answerEdited,
|
|
518
|
+
];
|
|
519
|
+
Deno.serve({ hostname: '127.0.0.1', port, onListen: () => { } }, async (request) => {
|
|
391
520
|
if (isForeign(request, gate))
|
|
392
521
|
return json(403, {}, {});
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
522
|
+
for (const route of ROUTES) {
|
|
523
|
+
const response = await route(request);
|
|
524
|
+
if (response)
|
|
525
|
+
return response;
|
|
526
|
+
}
|
|
527
|
+
return forward(request);
|
|
399
528
|
});
|
|
400
529
|
for (const signal of ['SIGINT', 'SIGTERM']) {
|
|
401
530
|
Deno.addSignalListener(signal, () => {
|
|
@@ -411,3 +540,30 @@ for (const signal of ['SIGINT', 'SIGTERM']) {
|
|
|
411
540
|
});
|
|
412
541
|
}
|
|
413
542
|
console.log(`Theorem Studio: open ${pageOrigins[0]}/studio (server on http://127.0.0.1:${port})`);
|
|
543
|
+
if (!quiet) {
|
|
544
|
+
console.error(loadedText({ ...first.description, setup: relative(root, setupFile) }, { ...entryAt(), keys: offline ? 'offline' : 'checking' }));
|
|
545
|
+
}
|
|
546
|
+
// The project is read once now, so what it has to look at reaches the terminal before the page opens.
|
|
547
|
+
await described().catch((error) => console.error(error instanceof Error ? error.message : error));
|
|
548
|
+
// One request for each provider's key, once: the keys are read as the project loads.
|
|
549
|
+
if (!offline) {
|
|
550
|
+
fetch(session.project().origin + KEYS_PATH)
|
|
551
|
+
.then((response) => response.json())
|
|
552
|
+
.then((checks) => {
|
|
553
|
+
keysSaid = checks.map(keyLine);
|
|
554
|
+
for (const [at, check] of checks.entries()) {
|
|
555
|
+
const line = keysSaid[at] ?? '';
|
|
556
|
+
// A key that works is said once, here, and is not kept as something that went wrong.
|
|
557
|
+
if (check.state === 'accepted') {
|
|
558
|
+
if (!quiet)
|
|
559
|
+
console.error(`theorem studio: ${line}`);
|
|
560
|
+
}
|
|
561
|
+
else
|
|
562
|
+
tell('key', line);
|
|
563
|
+
}
|
|
564
|
+
})
|
|
565
|
+
.catch((error) => {
|
|
566
|
+
keysSaid = [`not checked: ${error}`];
|
|
567
|
+
tell('key', `the keys were not checked: ${error}`);
|
|
568
|
+
});
|
|
569
|
+
}
|
package/server/test-key.d.ts
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Asks a key's provider whether it accepts the key, with the check the provider's definition
|
|
3
|
+
* declares, so the builder can tell a bad key from a bad setting. The key is used for this one
|
|
4
|
+
* request: never logged, kept, or echoed back.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { type ResolveHost } from '@theoremjs/agents';
|
|
9
|
+
import { type RegisteredProvider } from '@theoremjs/agents/kernel';
|
|
10
|
+
export interface TestKeyOptions {
|
|
11
|
+
/** A provider the project registers from a definition of its own, by id. */
|
|
12
|
+
projectProvider?: (id: string) => RegisteredProvider | undefined;
|
|
13
|
+
/** Resolves the provider's host, so a check from a shared server reaches public addresses only. */
|
|
14
|
+
resolveHost?: ResolveHost;
|
|
15
|
+
/** The server is the builder's alone: the check reaches whatever the provider names. */
|
|
16
|
+
draftNetwork?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** `POST <base>/test-key` `{ key, provider }`: a `KeyCheck`. */
|
|
19
|
+
export declare function testKey(request: Request, options?: TestKeyOptions): Promise<Response>;
|
package/server/test-key.js
CHANGED
|
@@ -1,83 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Asks a key's provider whether it accepts the key,
|
|
3
|
-
* from a bad setting. The key is used for this one
|
|
2
|
+
* Asks a key's provider whether it accepts the key, with the check the provider's definition
|
|
3
|
+
* declares, so the builder can tell a bad key from a bad setting. The key is used for this one
|
|
4
|
+
* request: never logged, kept, or echoed back.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
4
7
|
*/
|
|
5
|
-
import { z } from '@theoremjs/agents';
|
|
8
|
+
import { checkKey, fetchGuarded, z } from '@theoremjs/agents';
|
|
9
|
+
import { clientError } from '@theoremjs/agents/host';
|
|
10
|
+
import { createProviderRegistry } from '@theoremjs/agents/kernel';
|
|
6
11
|
import { readBody } from '@theoremjs/web/server';
|
|
7
|
-
|
|
12
|
+
import { kernelDefinition, registerStudioProvider } from "../providers.js";
|
|
8
13
|
const MAX_KEY_LENGTH = 512;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const slotName = z.string().min(1).max(128);
|
|
15
|
+
/** What the page sends: the key, and the provider a model reading its slot is served by. */
|
|
16
|
+
const testKeySchema = z
|
|
17
|
+
.object({
|
|
18
|
+
key: z.string().max(MAX_KEY_LENGTH),
|
|
19
|
+
provider: z
|
|
20
|
+
.object({
|
|
21
|
+
id: z.string().min(1).max(128),
|
|
22
|
+
definition: z.string().min(1).max(128),
|
|
23
|
+
connection: z.record(z.string(), z.string().max(2048)).optional(),
|
|
24
|
+
keySlot: slotName.optional(),
|
|
25
|
+
fallbackKeySlot: slotName.optional(),
|
|
26
|
+
})
|
|
27
|
+
.strict(),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
/** `POST <base>/test-key` `{ key, provider }`: a `KeyCheck`. */
|
|
31
|
+
export async function testKey(request, options = {}) {
|
|
32
|
+
let asked;
|
|
28
33
|
try {
|
|
29
|
-
|
|
30
|
-
const error = body?.error;
|
|
31
|
-
const first = Array.isArray(error) ? error[0] : error;
|
|
32
|
-
const message = first?.message;
|
|
33
|
-
if (typeof message !== 'string')
|
|
34
|
-
return undefined;
|
|
35
|
-
return message.replaceAll(key, '[the key]').slice(0, SAID_CAP);
|
|
34
|
+
asked = await readBody(request, testKeySchema);
|
|
36
35
|
}
|
|
37
|
-
catch {
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/** `POST <base>/test-key` `{ key }`. */
|
|
42
|
-
export async function testKey(request) {
|
|
43
|
-
if (request.method !== 'POST')
|
|
44
|
-
return new Response(null, { status: 405 });
|
|
45
|
-
let key = '';
|
|
46
|
-
try {
|
|
47
|
-
const body = await readBody(request, z.unknown());
|
|
48
|
-
const value = body?.key;
|
|
49
|
-
key = typeof value === 'string' ? value.trim() : '';
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return Response.json({ ok: false, error: 'Send { key }.' }, { status: 400 });
|
|
53
|
-
}
|
|
54
|
-
if (!key || key.length > MAX_KEY_LENGTH) {
|
|
55
|
-
return Response.json({ ok: false, error: 'No key to test.' }, {
|
|
56
|
-
status: 400,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
const match = PROVIDERS.find((candidate) => candidate.matches(key));
|
|
60
|
-
if (!match) {
|
|
61
|
-
return Response.json({
|
|
62
|
-
ok: false,
|
|
63
|
-
error: 'Only Google (AIza…) and OpenRouter (sk-or-…) keys can be tested here.',
|
|
64
|
-
});
|
|
36
|
+
catch (error) {
|
|
37
|
+
return Response.json(clientError(error), { status: 400 });
|
|
65
38
|
}
|
|
39
|
+
let provider;
|
|
66
40
|
try {
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
41
|
+
const definition = kernelDefinition(asked.provider.definition);
|
|
42
|
+
provider = definition
|
|
43
|
+
? registerStudioProvider(createProviderRegistry(), asked.provider, definition)
|
|
44
|
+
: options.projectProvider?.(asked.provider.id);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return Response.json(clientError(error), { status: 400 });
|
|
48
|
+
}
|
|
49
|
+
if (!provider)
|
|
50
|
+
return Response.json({ provider: asked.provider.id, state: 'unchecked' });
|
|
51
|
+
const { resolveHost } = options;
|
|
52
|
+
const guarded = (url, init) => fetchGuarded(String(url), { headers: init?.headers, signal: init?.signal }, {
|
|
53
|
+
followRedirects: false,
|
|
54
|
+
...(resolveHost ? { resolveHost } : {}),
|
|
55
|
+
});
|
|
56
|
+
return Response.json(await checkKey(provider, {
|
|
57
|
+
key: asked.key,
|
|
58
|
+
...(options.draftNetwork ? {} : { fetch: guarded }),
|
|
59
|
+
}));
|
|
83
60
|
}
|
package/server/watch.d.ts
CHANGED
|
@@ -21,6 +21,14 @@ export interface FileWatchOptions {
|
|
|
21
21
|
export declare function watchFiles(options: FileWatchOptions): {
|
|
22
22
|
stop(): void;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Subscriptions to a stream of values, as server-sent events: each value a line of JSON. A new
|
|
26
|
+
* subscription is sent `first()` before anything new.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createEventFeed<T>(): {
|
|
29
|
+
tell(value: T): void;
|
|
30
|
+
subscribe(headers: Record<string, string>, first?: readonly T[]): Response;
|
|
31
|
+
};
|
|
24
32
|
/** The page's subscriptions to file changes, as server-sent events. */
|
|
25
33
|
export declare function createWatchFeed(): {
|
|
26
34
|
tell(files: string[]): void;
|
package/server/watch.js
CHANGED
|
@@ -50,8 +50,11 @@ export function watchFiles(options) {
|
|
|
50
50
|
},
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Subscriptions to a stream of values, as server-sent events: each value a line of JSON. A new
|
|
55
|
+
* subscription is sent `first()` before anything new.
|
|
56
|
+
*/
|
|
57
|
+
export function createEventFeed() {
|
|
55
58
|
const encoder = new TextEncoder();
|
|
56
59
|
const pages = new Set();
|
|
57
60
|
const send = (page, text) => {
|
|
@@ -62,12 +65,13 @@ export function createWatchFeed() {
|
|
|
62
65
|
pages.delete(page);
|
|
63
66
|
}
|
|
64
67
|
};
|
|
68
|
+
const line = (value) => `data: ${JSON.stringify(value)}\n\n`;
|
|
65
69
|
return {
|
|
66
|
-
tell: (
|
|
70
|
+
tell: (value) => {
|
|
67
71
|
for (const page of pages)
|
|
68
|
-
send(page,
|
|
72
|
+
send(page, line(value));
|
|
69
73
|
},
|
|
70
|
-
subscribe: (headers) => {
|
|
74
|
+
subscribe: (headers, first = []) => {
|
|
71
75
|
let mine;
|
|
72
76
|
let beat;
|
|
73
77
|
const body = new ReadableStream({
|
|
@@ -75,6 +79,8 @@ export function createWatchFeed() {
|
|
|
75
79
|
mine = controller;
|
|
76
80
|
pages.add(controller);
|
|
77
81
|
send(controller, ': watching\n\n');
|
|
82
|
+
for (const value of first)
|
|
83
|
+
send(controller, line(value));
|
|
78
84
|
// A line now and then keeps a quiet connection open.
|
|
79
85
|
beat = setInterval(() => send(controller, ': still watching\n\n'), 25_000);
|
|
80
86
|
},
|
|
@@ -91,3 +97,8 @@ export function createWatchFeed() {
|
|
|
91
97
|
},
|
|
92
98
|
};
|
|
93
99
|
}
|
|
100
|
+
/** The page's subscriptions to file changes, as server-sent events. */
|
|
101
|
+
export function createWatchFeed() {
|
|
102
|
+
const feed = createEventFeed();
|
|
103
|
+
return { tell: (files) => feed.tell({ files }), subscribe: (headers) => feed.subscribe(headers) };
|
|
104
|
+
}
|
package/start.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
/**
|
|
7
7
|
* Opens the studio on a project, with one command:
|
|
8
8
|
*
|
|
9
|
-
* theorem-studio [setup] [--editor <command>] [--deno-config <file>] [--no-watch]
|
|
9
|
+
* theorem-studio [setup] [--editor <command>] [--deno-config <file>] [--no-watch] [--quiet] [--offline] [--verbose]
|
|
10
10
|
*
|
|
11
11
|
* That is the installed package's command (`npx theorem-studio`); in the repo it is
|
|
12
12
|
* `node studio/start.mjs`.
|
|
@@ -23,29 +23,54 @@ import { fileURLToPath } from 'node:url';
|
|
|
23
23
|
* does not start, the machine's default editor opens the file.
|
|
24
24
|
* The studio watches the files the setup reads and takes in what the builder's editor changes;
|
|
25
25
|
* `--no-watch` turns that off, and the studio then reads them when the builder comes back to it.
|
|
26
|
+
* When the project opens the command prints what it loaded (the setup, its entry, the agents
|
|
27
|
+
* with their providers, the tools), what the project has to look at, as the page flags it, and
|
|
28
|
+
* then whether each provider takes its key: one request to each, which `--offline` leaves out.
|
|
29
|
+
* It prints again when what to look at changes, and a line for each run that fails and each
|
|
30
|
+
* error the page meets. `--verbose` adds a line for every run; `--quiet` turns all of it off.
|
|
26
31
|
* The project loads with its own Deno config: the one `--deno-config` names, else the `deno.json`
|
|
27
32
|
* or `deno.jsonc` in the folder the command ran in, else the studio's.
|
|
28
33
|
* A project already open in a studio is not opened twice: the command says where it is. A second
|
|
29
34
|
* project opens beside the first, on the next free pair of ports.
|
|
35
|
+
*
|
|
36
|
+
* theorem-studio status [setup]
|
|
37
|
+
* theorem-studio errors [setup] [--follow]
|
|
38
|
+
*
|
|
39
|
+
* read a studio that is open on this project, and change nothing: `status` prints what it loaded,
|
|
40
|
+
* what its keys said and what to look at; `errors` prints the last 200 things it told the
|
|
41
|
+
* terminal, and `--follow` then prints each new one until the studio stops.
|
|
30
42
|
* The studio is opt-in, so this checks for its install and never installs it.
|
|
31
43
|
*/
|
|
32
44
|
import { builtPage } from './installed.mjs';
|
|
33
45
|
import { heldPairs, pageAddress, placeFor, serverAddress } from './ports.mjs';
|
|
46
|
+
import { readStudio, studiosOn } from './read-studio.mjs';
|
|
34
47
|
import { chooseSetup, findSetups, setupLines, setupsNamed } from './setups.mjs';
|
|
35
48
|
|
|
36
49
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
37
50
|
|
|
38
|
-
const
|
|
51
|
+
const COMMAND = builtPage ? 'theorem-studio' : 'node studio/start.mjs';
|
|
52
|
+
const USAGE = `usage: ${COMMAND} [setup] [--editor <command>] [--deno-config <file>] [--no-watch] [--quiet] [--offline] [--verbose]
|
|
53
|
+
${COMMAND} status [setup]
|
|
54
|
+
${COMMAND} errors [setup] [--follow]`;
|
|
55
|
+
// The setup module is named from where the command was run, which is also the project's name.
|
|
56
|
+
const from = process.env.INIT_CWD ?? process.cwd();
|
|
57
|
+
const args = process.argv.slice(2);
|
|
58
|
+
if (args[0] === 'status' || args[0] === 'errors') await read(args[0], args.slice(1));
|
|
39
59
|
/** The value after each flag that takes one. A flag with none, a second setup, or anything else, is a mistake. */
|
|
40
60
|
const VALUED = ['--editor', '--deno-config'];
|
|
41
61
|
const given = {};
|
|
42
62
|
let wanted;
|
|
43
63
|
let noWatch = false;
|
|
64
|
+
let quiet = false;
|
|
65
|
+
let offline = false;
|
|
66
|
+
let verbose = false;
|
|
44
67
|
let mistaken = false;
|
|
45
|
-
const args = process.argv.slice(2);
|
|
46
68
|
for (let at = 0; at < args.length; at += 1) {
|
|
47
69
|
const arg = args[at];
|
|
48
70
|
if (arg === '--no-watch') noWatch = true;
|
|
71
|
+
else if (arg === '--quiet') quiet = true;
|
|
72
|
+
else if (arg === '--offline') offline = true;
|
|
73
|
+
else if (arg === '--verbose') verbose = true;
|
|
49
74
|
else if (VALUED.includes(arg)) {
|
|
50
75
|
const value = args[at + 1];
|
|
51
76
|
if (!value || value.startsWith('--')) mistaken = true;
|
|
@@ -60,10 +85,72 @@ if (mistaken) {
|
|
|
60
85
|
}
|
|
61
86
|
const editor = given['--editor'];
|
|
62
87
|
|
|
63
|
-
// The setup module is named from where the command was run, which is also the project's name.
|
|
64
|
-
const from = process.env.INIT_CWD ?? process.cwd();
|
|
65
88
|
const setup = await setupToOpen();
|
|
66
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Reads the studio open on this project's setup, or on the one named, and stops: the setup to read
|
|
92
|
+
* is found as one to open is, except that only one open in a studio counts.
|
|
93
|
+
*/
|
|
94
|
+
async function read(command, rest) {
|
|
95
|
+
const follow = command === 'errors' && rest.includes('--follow');
|
|
96
|
+
const named = rest.filter((arg) => arg !== '--follow' || command !== 'errors');
|
|
97
|
+
if (named.length > 1 || named.some((arg) => arg.startsWith('--'))) stopWith(2, USAGE);
|
|
98
|
+
const [name] = named;
|
|
99
|
+
const studio = await studioToRead(name);
|
|
100
|
+
if (command === 'status') {
|
|
101
|
+
console.log(
|
|
102
|
+
`theorem studio: ${path.relative(from, studio.setup)} on ${pageAddress(studio.pair)}/studio/`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
await readStudio(studio, command, { follow });
|
|
107
|
+
} catch (error) {
|
|
108
|
+
stopWith(1, `theorem studio: ${error instanceof Error ? error.message : String(error)}`);
|
|
109
|
+
}
|
|
110
|
+
process.exit(0);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The setups a read may mean: the file named, else the ones with the name, else all of them. */
|
|
114
|
+
function setupsToRead(name) {
|
|
115
|
+
if (name !== undefined && existsSync(path.resolve(from, name))) return [name];
|
|
116
|
+
const found = findSetups(from);
|
|
117
|
+
return (name === undefined ? found : setupsNamed(found, name)).map((one) => one.file);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** The one studio open on those setups; says why there is none, or more than one, and stops. */
|
|
121
|
+
async function studioToRead(name) {
|
|
122
|
+
const setups = setupsToRead(name);
|
|
123
|
+
if (name !== undefined && setups.length === 0) {
|
|
124
|
+
stopWith(
|
|
125
|
+
2,
|
|
126
|
+
`theorem studio: no setup is named ${name}. This project has:\n\n${setupLines(findSetups(from)).join('\n')}`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
const open = studiosOn(
|
|
130
|
+
await heldPairs(),
|
|
131
|
+
new Set(setups.map((file) => realpathSync(path.resolve(from, file)))),
|
|
132
|
+
);
|
|
133
|
+
if (open.length === 0) {
|
|
134
|
+
stopWith(
|
|
135
|
+
1,
|
|
136
|
+
`theorem studio: no studio is open on ${name ?? from}. Open one: ${COMMAND}${name ? ` ${name}` : ''}`,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
if (open.length > 1) {
|
|
140
|
+
stopWith(
|
|
141
|
+
2,
|
|
142
|
+
`theorem studio: more than one studio is open here. Name the setup:\n\n${open.map((one) => ` ${path.relative(from, one.setup)}`).join('\n')}`,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return open[0];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Says why the command stops, and stops with `code`. */
|
|
149
|
+
function stopWith(code, message) {
|
|
150
|
+
console.error(message);
|
|
151
|
+
process.exit(code);
|
|
152
|
+
}
|
|
153
|
+
|
|
67
154
|
/** Says why no setup opens, and stops. */
|
|
68
155
|
function refuse(message) {
|
|
69
156
|
console.error(`${message}\n\n${USAGE}`);
|
|
@@ -125,6 +212,9 @@ const server = spawn(
|
|
|
125
212
|
projectConfig,
|
|
126
213
|
...(editor ? ['--editor', editor] : []),
|
|
127
214
|
...(noWatch ? ['--no-watch'] : []),
|
|
215
|
+
...(quiet ? ['--quiet'] : []),
|
|
216
|
+
...(offline ? ['--offline'] : []),
|
|
217
|
+
...(verbose ? ['--verbose'] : []),
|
|
128
218
|
],
|
|
129
219
|
{ cwd: from, stdio: ['ignore', 'ignore', 'inherit'] },
|
|
130
220
|
);
|
package/ui/built/theme.css
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @generated by `astryx theme build` — do not edit manually.
|
|
3
3
|
* Source: ui/studio-theme.ts
|
|
4
4
|
* Command: astryx theme build ui/studio-theme.ts --out ui/built/theme.css
|
|
5
|
-
* CLI: @astryxdesign/cli@0.7.
|
|
6
|
-
* Core: @astryxdesign/core@0.7.
|
|
5
|
+
* CLI: @astryxdesign/cli@0.7.4
|
|
6
|
+
* Core: @astryxdesign/core@0.7.4
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
@layer reset, astryx-base, astryx-theme;
|