@theoremjs/studio 0.3.4-next.647.g436b659 → 0.3.4-next.671.gfa09ab2
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 +8 -5
- package/cookbooks/catalog.js +18 -5
- package/cookbooks/tools.js +3 -3
- package/label-areas.d.ts +133 -0
- package/label-areas.js +154 -0
- package/mod.d.ts +4 -3
- package/mod.js +4 -3
- package/package.json +4 -4
- package/page/assets/Banner-DEVAsFER.js +4 -0
- package/page/assets/{ConsoleFrame-B7rArrs0.js → ConsoleFrame-CqUUcrR4.js} +1 -1
- package/page/assets/{MenuBottomSheet-CRiCEOWg.js → MenuBottomSheet-DOa09vl1.js} +1 -1
- package/page/assets/{SchemaFields-BoySuRuC.js → SchemaFields-CMwMU1Px.js} +1 -1
- package/page/assets/{ToolResultCharts-C_qojgbn.js → ToolResultCharts-CW23-D1x.js} +1 -1
- package/page/assets/{TraceInspector-DSLg92wY.js → TraceInspector-h030OQ82.js} +1 -1
- package/page/assets/{TraceOverview-TDZ4GUIz.js → TraceOverview-BsON_uZj.js} +1 -1
- package/page/assets/{_virtual_studio-type-sources-B0cSCDug.js → _virtual_studio-type-sources-BwSqfSwd.js} +23 -4
- package/page/assets/browser-connection-DSUHVCT5.js +3 -0
- package/page/assets/browser-engine-Cf6d-zNH.js +11 -0
- package/page/assets/browser-transport-BK4cbTE_.js +45 -0
- package/page/assets/{crypto-B6qD6nxk.js → crypto-CD14HeXH.js} +1 -1
- package/page/assets/{encode-files-CM9H0Lq5.js → encode-files-DhoC5hWG.js} +1 -1
- package/page/assets/{export-agent-BuZ4GIKx.js → export-agent-CaHsJPsM.js} +1 -1
- package/page/assets/{guardrail-tester-bc9lxU9X.js → guardrail-tester-BDhFLvT5.js} +1 -1
- package/page/assets/index-CqwmMJ4C.js +145 -0
- package/page/assets/{live-messages-CHHEtxno.js → live-messages-CiLmR89m.js} +1 -1
- package/page/assets/reader-DrOfMM8I.js +5 -0
- package/page/assets/shaped-data-H1miOZm2.js +20 -0
- package/page/assets/{stub-CWjTbSMX.js → stub-nxRsh1jo.js} +4 -4
- package/page/assets/{studio-code-pane-DevKnszl.js → studio-code-pane-C1wH63Y2.js} +3 -3
- package/page/assets/{studio-console-kpYOJazO.js → studio-console-DRzo4yTy.js} +1 -1
- package/page/assets/{studio-decision-Dq5LDTrl.js → studio-decision-C7QWMm7Q.js} +1 -1
- package/page/assets/{studio-embedding-Cebwv5_l.js → studio-embedding-D8KroBXY.js} +1 -1
- package/page/assets/{studio-host-console-CaaVHxrN.js → studio-host-console-HkX8BerX.js} +2 -2
- package/page/assets/{studio-labels-BQOD-taS.js → studio-labels-6w1SKC2D.js} +1 -1
- package/page/assets/studio-live-BmVeXAu4.js +5 -0
- package/page/assets/{studio-map-BOaPPVXK.js → studio-map-5ZU1nicW.js} +1 -1
- package/page/assets/studio-session-CjUQSXx0.js +1 -0
- package/page/assets/studio-trace-replay-CSbJSN5e.js +3 -0
- package/page/assets/{studio-type-checker-BQmVytwu.js → studio-type-checker-BbUSqqOS.js} +1 -1
- package/page/assets/tool-schema-BmRYaywn.js +17 -0
- package/page/assets/{trace-record-CtL5_CIg.js → trace-record-DxgSKmYY.js} +1 -1
- package/page/assets/tree-3N-1RPZz.js +3 -0
- package/page/assets/{turn-client-yriGS51g.js → turn-client-DN8PawJr.js} +2 -2
- package/page/assets/{use-one-call-8QTXCYlp.js → use-one-call-Br2IVJLU.js} +1 -1
- package/page/assets/{use-second-ticker-rObooyH6.js → use-second-ticker-CEwOSS-d.js} +1 -1
- package/page/assets/{workspace-WKa0_gWg.js → workspace-CTSW941G.js} +1 -1
- package/page/index.html +16 -16
- package/replay.d.ts +13 -8
- package/replay.js +33 -31
- package/run-payload.d.ts +20 -6
- package/run-payload.js +85 -13
- package/runtime-scope.js +1 -0
- package/runtime.js +1 -0
- package/server/project.js +5 -32
- package/transport.d.ts +1 -3
- package/transport.js +0 -9
- package/ui/inspector.js +11 -5
- package/ui/lib/acting-as.js +1 -6
- package/ui/lib/run-keys.d.ts +15 -5
- package/ui/lib/run-keys.js +80 -16
- package/ui/lib/studio-conversation.d.ts +2 -3
- package/ui/lib/studio-conversation.js +28 -65
- package/ui/lib/studio-keep.d.ts +34 -0
- package/ui/lib/studio-keep.js +202 -0
- package/ui/lib/studio-map-kept.d.ts +2 -2
- package/ui/lib/studio-map-kept.js +5 -10
- package/ui/lib/studio-open.d.ts +1 -1
- package/ui/lib/studio-open.js +5 -5
- package/ui/lib/studio-page.js +1 -7
- package/ui/lib/studio-restore.d.ts +2 -3
- package/ui/lib/studio-restore.js +8 -48
- package/ui/lib/studio-run-open.d.ts +10 -5
- package/ui/lib/studio-run-open.js +18 -9
- package/ui/lib/studio-session.d.ts +38 -5
- package/ui/lib/studio-session.js +133 -3
- package/ui/lib/studio-store.js +8 -30
- package/ui/profile-editor.js +37 -185
- package/ui/studio-compare.js +239 -46
- package/ui/studio-run.js +29 -15
- package/ui/studio-screen.d.ts +1 -1
- package/ui/studio-screen.js +8 -9
- package/ui/studio-trace-replay.js +39 -14
- package/vite.mjs +1 -1
- package/page/assets/Banner-CzP7eU2F.js +0 -4
- package/page/assets/browser-connection-QNf4S7Ff.js +0 -3
- package/page/assets/browser-engine-DpEz1HOI.js +0 -11
- package/page/assets/browser-transport-sRqTLzGF.js +0 -45
- package/page/assets/index-CVYQrx1w.js +0 -145
- package/page/assets/reader-DlrsIIkn.js +0 -5
- package/page/assets/shaped-data-DAdn_XvU.js +0 -20
- package/page/assets/studio-live-Bz8YuQcb.js +0 -5
- package/page/assets/studio-session-yEqFQo5o.js +0 -1
- package/page/assets/studio-trace-replay-Ck0X9hTR.js +0 -3
- package/page/assets/tool-schema-B_EOjDjg.js +0 -17
- package/page/assets/tree-DM7jRXMx.js +0 -3
- package/run-payload-core.d.ts +0 -28
- package/run-payload-core.js +0 -117
package/run-payload-core.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** No package imports; typed wrappers live in `run-payload.ts`. */
|
|
2
|
-
export declare const STUDIO_RUN_PAYLOAD_KEY = "theoremjs.studio.run";
|
|
3
|
-
export declare const STUDIO_RUN_PAYLOAD_KEY_PREFIX = "theoremjs.studio.run.";
|
|
4
|
-
/** Ordered index of saved run ids (newest first). */
|
|
5
|
-
export declare const STUDIO_RUN_INDEX_KEY = "theoremjs.studio.run.index";
|
|
6
|
-
export declare const STUDIO_RUN_PAYLOAD_CAP = 8;
|
|
7
|
-
export type StudioRunIndexEntry = {
|
|
8
|
-
id: string;
|
|
9
|
-
savedAt: number;
|
|
10
|
-
};
|
|
11
|
-
export type StudioRunIndex = {
|
|
12
|
-
entries: StudioRunIndexEntry[];
|
|
13
|
-
};
|
|
14
|
-
export declare function studioRunPayloadKey(runId: string): string;
|
|
15
|
-
export declare function createStudioRunId(): string;
|
|
16
|
-
export declare function readStudioRunIdFromUrl(url?: string | {
|
|
17
|
-
href: string;
|
|
18
|
-
}): string | null;
|
|
19
|
-
export declare function upsertStudioRunIndex(entries: readonly StudioRunIndexEntry[], runId: string, savedAt: number, cap?: number): {
|
|
20
|
-
entries: StudioRunIndexEntry[];
|
|
21
|
-
prunedIds: string[];
|
|
22
|
-
};
|
|
23
|
-
/** Prunes the oldest payloads beyond the cap. */
|
|
24
|
-
export declare function saveStudioRunPayloadRecord(payload: Record<string, unknown>, runId: string, storeOverride?: Storage | null): void;
|
|
25
|
-
export declare function loadStudioRunPayloadRecord(runId: string, storeOverride?: Storage | null): Record<string, unknown> | null;
|
|
26
|
-
/** Every kept run's id, indexed or not. */
|
|
27
|
-
export declare function keptStudioRunIds(storeOverride?: Storage | null): string[];
|
|
28
|
-
export declare function clearStudioRunPayloadRecord(runId: string, storeOverride?: Storage | null): void;
|
package/run-payload-core.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/** No package imports; typed wrappers live in `run-payload.ts`. */
|
|
2
|
-
export const STUDIO_RUN_PAYLOAD_KEY = 'theoremjs.studio.run';
|
|
3
|
-
export const STUDIO_RUN_PAYLOAD_KEY_PREFIX = `${STUDIO_RUN_PAYLOAD_KEY}.`;
|
|
4
|
-
/** Ordered index of saved run ids (newest first). */
|
|
5
|
-
export const STUDIO_RUN_INDEX_KEY = `${STUDIO_RUN_PAYLOAD_KEY}.index`;
|
|
6
|
-
export const STUDIO_RUN_PAYLOAD_CAP = 8;
|
|
7
|
-
export function studioRunPayloadKey(runId) {
|
|
8
|
-
return `${STUDIO_RUN_PAYLOAD_KEY_PREFIX}${runId}`;
|
|
9
|
-
}
|
|
10
|
-
export function createStudioRunId() {
|
|
11
|
-
if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) {
|
|
12
|
-
return crypto.randomUUID();
|
|
13
|
-
}
|
|
14
|
-
return `run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
15
|
-
}
|
|
16
|
-
export function readStudioRunIdFromUrl(url = typeof window !== 'undefined'
|
|
17
|
-
? globalThis.location
|
|
18
|
-
: { href: '' }) {
|
|
19
|
-
const href = typeof url === 'string' ? url : url.href;
|
|
20
|
-
if (!href)
|
|
21
|
-
return null;
|
|
22
|
-
try {
|
|
23
|
-
const parsed = new URL(href, 'http://localhost');
|
|
24
|
-
const run = parsed.searchParams.get('run')?.trim();
|
|
25
|
-
return run && run.length > 0 ? run : null;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export function upsertStudioRunIndex(entries, runId, savedAt, cap = STUDIO_RUN_PAYLOAD_CAP) {
|
|
32
|
-
const without = entries.filter((entry) => entry.id !== runId);
|
|
33
|
-
const next = [{ id: runId, savedAt }, ...without];
|
|
34
|
-
if (next.length <= cap) {
|
|
35
|
-
return { entries: next, prunedIds: [] };
|
|
36
|
-
}
|
|
37
|
-
const kept = next.slice(0, cap);
|
|
38
|
-
const prunedIds = next.slice(cap).map((entry) => entry.id);
|
|
39
|
-
return { entries: kept, prunedIds };
|
|
40
|
-
}
|
|
41
|
-
function resolveStore(store) {
|
|
42
|
-
if (store !== undefined)
|
|
43
|
-
return store;
|
|
44
|
-
if (typeof globalThis === 'undefined' || !('localStorage' in globalThis))
|
|
45
|
-
return null;
|
|
46
|
-
try {
|
|
47
|
-
// Private-mode / blocked storage can throw on access.
|
|
48
|
-
return globalThis.localStorage;
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function readIndex(store) {
|
|
55
|
-
const raw = store.getItem(STUDIO_RUN_INDEX_KEY);
|
|
56
|
-
if (!raw)
|
|
57
|
-
return [];
|
|
58
|
-
try {
|
|
59
|
-
const parsed = JSON.parse(raw);
|
|
60
|
-
return Array.isArray(parsed.entries) ? parsed.entries : [];
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function writeIndex(store, entries) {
|
|
67
|
-
store.setItem(STUDIO_RUN_INDEX_KEY, JSON.stringify({ entries }));
|
|
68
|
-
}
|
|
69
|
-
/** Prunes the oldest payloads beyond the cap. */
|
|
70
|
-
export function saveStudioRunPayloadRecord(payload, runId, storeOverride) {
|
|
71
|
-
const store = resolveStore(storeOverride);
|
|
72
|
-
if (!store || !runId)
|
|
73
|
-
return;
|
|
74
|
-
store.setItem(studioRunPayloadKey(runId), JSON.stringify(payload));
|
|
75
|
-
const { entries, prunedIds } = upsertStudioRunIndex(readIndex(store), runId, Date.now(), STUDIO_RUN_PAYLOAD_CAP);
|
|
76
|
-
for (const id of prunedIds) {
|
|
77
|
-
store.removeItem(studioRunPayloadKey(id));
|
|
78
|
-
}
|
|
79
|
-
writeIndex(store, entries);
|
|
80
|
-
}
|
|
81
|
-
export function loadStudioRunPayloadRecord(runId, storeOverride) {
|
|
82
|
-
const store = resolveStore(storeOverride);
|
|
83
|
-
if (!store || !runId)
|
|
84
|
-
return null;
|
|
85
|
-
const raw = store.getItem(studioRunPayloadKey(runId));
|
|
86
|
-
if (!raw)
|
|
87
|
-
return null;
|
|
88
|
-
try {
|
|
89
|
-
const parsed = JSON.parse(raw);
|
|
90
|
-
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
91
|
-
return null;
|
|
92
|
-
return parsed;
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/** Every kept run's id, indexed or not. */
|
|
99
|
-
export function keptStudioRunIds(storeOverride) {
|
|
100
|
-
const store = resolveStore(storeOverride);
|
|
101
|
-
if (!store)
|
|
102
|
-
return [];
|
|
103
|
-
const ids = [];
|
|
104
|
-
for (let i = 0; i < store.length; i++) {
|
|
105
|
-
const key = store.key(i);
|
|
106
|
-
if (key?.startsWith(STUDIO_RUN_PAYLOAD_KEY_PREFIX) && key !== STUDIO_RUN_INDEX_KEY)
|
|
107
|
-
ids.push(key.slice(STUDIO_RUN_PAYLOAD_KEY_PREFIX.length));
|
|
108
|
-
}
|
|
109
|
-
return ids;
|
|
110
|
-
}
|
|
111
|
-
export function clearStudioRunPayloadRecord(runId, storeOverride) {
|
|
112
|
-
const store = resolveStore(storeOverride);
|
|
113
|
-
if (!store || !runId)
|
|
114
|
-
return;
|
|
115
|
-
store.removeItem(studioRunPayloadKey(runId));
|
|
116
|
-
writeIndex(store, readIndex(store).filter((entry) => entry.id !== runId));
|
|
117
|
-
}
|