@theoremjs/studio 0.3.4-next.544.gb5ef325 → 0.3.4-next.548.gbb156b2
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 +3 -3
- package/compile.js +58 -12
- package/cookbooks/catalog.d.ts +8 -3
- package/cookbooks/catalog.js +31 -53
- package/cookbooks/exchanges.d.ts +3 -0
- package/cookbooks/exchanges.js +7 -2
- package/cookbooks/mod.d.ts +2 -2
- package/cookbooks/mod.js +2 -2
- package/cookbooks/project.js +1 -3
- package/draft.d.ts +21 -5
- package/draft.js +10 -2
- package/media-accept.d.ts +7 -0
- package/media-accept.js +17 -0
- package/mod.d.ts +3 -3
- package/mod.js +3 -3
- package/package.json +4 -4
- package/page/assets/Banner-BP1TXM0J.js +2 -0
- package/page/assets/CollapsibleGroup-Bfnp4Aaz.js +1 -0
- package/page/assets/{ConsoleFrame-BpbXMWsq.js → ConsoleFrame-Da49DUMV.js} +2 -2
- package/page/assets/{ContextMenu-D_6fLWw7.js → ContextMenu-DGeuOuIz.js} +2 -2
- package/page/assets/{ToolResultCharts-BAIAtrxa.js → ToolResultCharts-DQc5tTgc.js} +1 -1
- package/page/assets/{TraceInspector-CvaN-GcS.js → TraceInspector-Cn7_V-2C.js} +1 -1
- package/page/assets/{TraceOverview-C6T0S77W.js → TraceOverview-DqhP_wzg.js} +2 -2
- package/page/assets/{_virtual_studio-type-sources-C1mRXxbj.js → _virtual_studio-type-sources-CvOETQ24.js} +19 -1
- package/page/assets/{browser-engine-BS9Kn2Gx.js → browser-engine-BUuO2-Ve.js} +2 -2
- package/page/assets/browser-transport-FDq0Q4Fx.js +47 -0
- package/page/assets/{export-agent-m6Z0No6j.js → export-agent-D-Rj6FQy.js} +8 -8
- package/page/assets/{guardrail-tester-oVuyo5d2.js → guardrail-tester-lZGPnEIR.js} +2 -2
- package/page/assets/index-Bk_jhM4_.js +145 -0
- package/page/assets/{labels-provider-Gus3heEH.js → labels-provider-BObUoNKa.js} +1 -1
- package/page/assets/{live-messages-BNhCuiuF.js → live-messages-DuLSkEdL.js} +1 -1
- package/page/assets/reader-DJB6MzQf.js +7 -0
- package/page/assets/{stub-DPcZtI0s.js → stub-kLwOLu-h.js} +1 -1
- package/page/assets/{studio-code-pane-BB8Q348A.js → studio-code-pane-D7R84b_Y.js} +3 -3
- package/page/assets/{studio-console-DoZMv_gr.js → studio-console-DgsrR6Qy.js} +1 -1
- package/page/assets/studio-decision-uyaB9Oo3.js +1 -0
- package/page/assets/{studio-embedding-cH6PQupx.js → studio-embedding-tRaNKz_n.js} +1 -1
- package/page/assets/{studio-host-console-ZvV5TFC4.js → studio-host-console-DzpUuYer.js} +2 -2
- package/page/assets/{studio-labels-Dwd-ojX5.js → studio-labels-CByQ2z3Y.js} +2 -2
- package/page/assets/{studio-live-DDInnfd7.js → studio-live-CWeuAs3g.js} +2 -2
- package/page/assets/{studio-map-Dv8iCayn.js → studio-map-D7QZ6RAm.js} +1 -1
- package/page/assets/studio-trace-replay-BSts3p2O.js +2 -0
- package/page/assets/{studio-type-checker-B5DVxAZ0.js → studio-type-checker-BNljIXdE.js} +1 -1
- package/page/assets/{tool-schema-CxLtS_Zt.js → tool-schema--CLE7o0H.js} +1 -1
- package/page/assets/tree-CDqNZ8w-.js +3 -0
- package/page/assets/{turn-client-BCi5WnI6.js → turn-client-DXtNeRHG.js} +1 -1
- package/page/assets/types-DTbqRZ5l.js +1 -0
- package/page/assets/{use-one-call-TEvndb3j.js → use-one-call-TAgOAnMo.js} +1 -1
- package/page/assets/use-trace-records-CZNBjTS0.js +1 -0
- package/page/assets/workspace-Cb6PICiw.js +1 -0
- package/page/index.html +15 -15
- package/read-source.js +30 -4
- package/replay.d.ts +3 -1
- package/replay.js +53 -5
- package/surface.js +1 -2
- package/ui/lib/export-agent.js +20 -2
- package/ui/lib/studio-examples.js +0 -4
- package/ui/lib/studio-page.d.ts +8 -3
- package/ui/lib/studio-page.js +34 -13
- package/ui/profile-editor.js +185 -33
- package/ui/studio-decision.js +4 -1
- package/ui/studio-screen.js +1 -7
- package/ui/studio-trace-replay.js +1 -8
- package/workspace.d.ts +1 -0
- package/workspace.js +3 -2
- package/page/assets/Banner-BUrqNrQ9.js +0 -2
- package/page/assets/CollapsibleGroup-PavPZ114.js +0 -1
- package/page/assets/browser-transport-eqZ9n2AK.js +0 -47
- package/page/assets/index-Q8T7gvHP.js +0 -149
- package/page/assets/reader-BT_YeHdq.js +0 -7
- package/page/assets/studio-decision-BPT3x1kT.js +0 -1
- package/page/assets/studio-trace-replay-Dl792A2v.js +0 -2
- package/page/assets/tree-Bi2FOU_h.js +0 -3
- package/page/assets/types-s-3wFTyD.js +0 -1
- package/page/assets/use-trace-records-BkAYJz0M.js +0 -1
- package/page/assets/workspace-BiCkglEt.js +0 -1
package/README.md
CHANGED
|
@@ -278,11 +278,11 @@ Use these when you build on the studio's draft yourself: compile it, export it a
|
|
|
278
278
|
|
|
279
279
|
| Export | Purpose |
|
|
280
280
|
| --- | --- |
|
|
281
|
-
| `StudioDraft`, `createBlankDraft()`, `createExampleDraft()`, `COOKBOOKS` | Editable profile draft; blank, the travel concierge, or the canonical cookbook catalog (`research`, `concierge`, `architect`, `live-concierge`, `decision`, `
|
|
282
|
-
| `createResearchWorkspace()`, `addResearchExample()`, `createResearchScoutDraft()`, `createPageReaderExampleDraft()`, `cookbookOpening()`, `openingFromRecords()` | The lead system cookbook: `research.scout` (OpenRouter `google/gemini-3.8-flash`, streamed thoughts, prose reply, liquid tool labels) linked to `research.pagereader` (Jev decision profile that filters page passages at `post_tool`). `cookbookOpening('research')` projects its recorded `.trace.json` with the same helpers Replay exchange and Continue live use |
|
|
281
|
+
| `StudioDraft`, `createBlankDraft()`, `createExampleDraft()`, `COOKBOOKS` | Editable profile draft; blank, the travel concierge, or the canonical cookbook catalog (`research`, `concierge`, `architect`, `live-concierge`, `decision`, `gemini-embedding-2`, `narrator`, `console`) |
|
|
282
|
+
| `createResearchWorkspace()`, `addResearchExample()`, `createResearchScoutDraft()`, `createPageReaderExampleDraft()`, `cookbookOpening()`, `openingFromRecords()` | The lead system cookbook: `research.scout` (OpenRouter `google/gemini-3.8-flash`, streamed thoughts, prose reply, liquid tool labels; no attachment accept list and no effort select — Goals examples turn those on) linked to `research.pagereader` (Jev decision profile that filters page passages at `post_tool`). `cookbookOpening('research')` projects its recorded `.trace.json` with the same helpers Replay exchange and Continue live use |
|
|
283
283
|
| `projectProfileSlice()`, `projectToolSlice()`, `stitchCookbook()`, `resolveCookbookSlice()` | Project or stitch individual profile facets, tool sub-objects (`auth`, `mapping`, `labels`), or full runnable programs from `COOKBOOKS` |
|
|
284
284
|
| `GOOGLE_BUILTIN_TOOLS`, `OPENROUTER_BUILTIN_TOOLS`, `GOOGLE_SPEECH_VOICES`, `googleBindingViolation()`, `localBindingViolation()`, `ollamaModelThinks()` | Provider and model cookbooks: hosted builtin tool definitions, provider media/voice vocabularies, and model binding checks |
|
|
285
|
-
| `createDecisionExampleDraft()`, `decisionExampleDraft(images?)`, `DECISION_EXAMPLE_STATE`, `decisionExampleAssets()` | The decision
|
|
285
|
+
| `createDecisionExampleDraft()`, `decisionExampleDraft(images?)`, `DECISION_EXAMPLE_STATE`, `decisionExampleAssets()` | The Pantry cookbook (`COOKBOOKS.decision`, agent `pantry.jev`): Jev 1.14 asked about a pantry shelf, with box, Number and Choice questions. Its four pictures ship with it, and load only when the example is made, so `createDecisionExampleDraft` and `decisionExampleAssets` return a promise; `decisionExampleDraft` is the same draft with the pictures it is given, none by default, for a page that only shows its shape. The ginger, the colour chart and the flag are the decision's own; a decision sends each one its state or questions name. Each box question names the image it reads: the Ginger and Union Jack questions read `photo`, and the chart question reads `<apple_ripeness>`. The run tab starts with the shelf in its state. Each is written as its reference, such as `<ginger>`, in the state or in the questions. The shelf and ginger photos are CC0 and the flag is public domain, all from Wikimedia Commons. The colour chart was drawn for the example |
|
|
286
286
|
| `createLiveExampleDraft()`, `createNarratorExampleDraft()`, `createConsoleExampleDraft()`, `createArchitectWorkspace()` | The other examples: the concierge as a live agent, a speech narrator, a host tool console, and a code architect that calls the narrator through an agent tool |
|
|
287
287
|
| `setProfileType()`, `includeFacet()`, `excludeFacet()`, `newModelBinding()`, `newToolSpec()` | Draft edits that keep it consistent with `PROFILE_GRAPH` |
|
|
288
288
|
| `studioTree()`, `studioNodeRef()`, `modelBindingNodeId()`, `toolSpecNodeId()` | The draft as a tree; node ids that issues point at |
|
package/compile.js
CHANGED
|
@@ -601,11 +601,11 @@ function compileTool(tool, report, agentIdOf, agentInputOf) {
|
|
|
601
601
|
const common = toolCommon(tool, fail, agentInputOf);
|
|
602
602
|
const labels = toolLabels(tool, common, fail);
|
|
603
603
|
const compiled = TOOL_COMPILERS[tool.toolType](tool, common, fail, agentIdOf);
|
|
604
|
+
// why: stageAgentKey is an optional post_tool reader on a library tool. A
|
|
605
|
+
// dangling key must not fail the tool — the tool still runs; only the filter
|
|
606
|
+
// is dropped (same as sound() / removeAgent clearing the link).
|
|
604
607
|
const stageKey = tool.toolType !== 'agent' ? (tool.stageAgentKey?.trim() ?? '') : '';
|
|
605
608
|
const stageAgent = stageKey ? agentIdOf(stageKey) : undefined;
|
|
606
|
-
if (stageKey && !stageAgent) {
|
|
607
|
-
fail('The agent that reads this tool is gone. Pick another.', 'stageAgentKey');
|
|
608
|
-
}
|
|
609
609
|
return failed
|
|
610
610
|
? undefined
|
|
611
611
|
: {
|
|
@@ -664,9 +664,7 @@ function compileInputs(inputs, type, report) {
|
|
|
664
664
|
checkWhole(report, 'inputs', 'maxFiles', 'Max files', inputs.maxFiles, 1);
|
|
665
665
|
checkWhole(report, 'inputs', 'maxBytes', 'Max bytes', inputs.maxBytes, 1);
|
|
666
666
|
checkWhole(report, 'inputs', 'maxTurnBytes', 'Max turn bytes', inputs.maxTurnBytes, 1);
|
|
667
|
-
const limitsByMime =
|
|
668
|
-
report('inputs', 'Limits by type must be a JSON object of positive whole numbers.', 'limitsByMimeJson');
|
|
669
|
-
});
|
|
667
|
+
const limitsByMime = compileLimitsByMime(inputs, report);
|
|
670
668
|
const slots = compileSlots(inputs, report);
|
|
671
669
|
const context = compileContext(inputs, report);
|
|
672
670
|
return {
|
|
@@ -693,10 +691,62 @@ function compileContext(inputs, report) {
|
|
|
693
691
|
checkWhole(report, 'inputs', 'contextMaxChars', 'Max characters', inputs.contextMaxChars, 1);
|
|
694
692
|
return { from: [...inputs.contextFrom], maxChars: inputs.contextMaxChars ?? 0 };
|
|
695
693
|
}
|
|
694
|
+
/** Each type's largest file; a type left blank keeps `maxBytes`. */
|
|
695
|
+
function compileLimitsByMime(inputs, report) {
|
|
696
|
+
const entries = Object.entries(inputs.limitsByMime);
|
|
697
|
+
for (const [mime, bytes] of entries) {
|
|
698
|
+
if (Number.isInteger(bytes) && bytes >= 1)
|
|
699
|
+
continue;
|
|
700
|
+
report('inputs', `Max size for ${mime} must be a whole number of at least 1.`, 'limitsByMime');
|
|
701
|
+
}
|
|
702
|
+
return entries.length ? { ...inputs.limitsByMime } : undefined;
|
|
703
|
+
}
|
|
704
|
+
/** One slot's problems, each on its row: a missing or repeated name or value. */
|
|
705
|
+
function slotProblems(slot, at, slots) {
|
|
706
|
+
const name = slot.name.trim();
|
|
707
|
+
const problems = [];
|
|
708
|
+
if (!name)
|
|
709
|
+
problems.push('Name this slot.');
|
|
710
|
+
else if (slots.findIndex((other) => other.name.trim() === name) < at) {
|
|
711
|
+
problems.push(`Another slot is called ${name}.`);
|
|
712
|
+
}
|
|
713
|
+
const values = slot.choices.map((choice) => choice.value.trim());
|
|
714
|
+
if (!values.some(Boolean))
|
|
715
|
+
problems.push('Give this slot a choice.');
|
|
716
|
+
if (slot.choices.some((choice, index) => !values[index] && choice.description.trim())) {
|
|
717
|
+
problems.push('Every choice with a description needs a value.');
|
|
718
|
+
}
|
|
719
|
+
const repeated = values.filter((value, index) => value && values.indexOf(value) < index);
|
|
720
|
+
for (const value of new Set(repeated))
|
|
721
|
+
problems.push(`${value} is a choice twice.`);
|
|
722
|
+
return problems;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Each slot by name. A slot with no label and no descriptions is its list of values; any other
|
|
726
|
+
* is `{ label?, choices }`. A choice left blank is left out.
|
|
727
|
+
*/
|
|
696
728
|
function compileSlots(inputs, report) {
|
|
697
|
-
|
|
698
|
-
|
|
729
|
+
if (!inputs.slots.length)
|
|
730
|
+
return undefined;
|
|
731
|
+
inputs.slots.forEach((slot, at) => {
|
|
732
|
+
for (const problem of slotProblems(slot, at, inputs.slots)) {
|
|
733
|
+
report('inputs', problem, 'slots', at);
|
|
734
|
+
}
|
|
699
735
|
});
|
|
736
|
+
return Object.fromEntries(inputs.slots.map((slot) => {
|
|
737
|
+
const label = slot.label.trim();
|
|
738
|
+
const choices = slot.choices
|
|
739
|
+
.filter((choice) => choice.value.trim())
|
|
740
|
+
.map((choice) => ({ value: choice.value.trim(), description: choice.description.trim() }));
|
|
741
|
+
const plain = !label && choices.every((choice) => !choice.description);
|
|
742
|
+
const decl = plain
|
|
743
|
+
? choices.map((choice) => choice.value)
|
|
744
|
+
: {
|
|
745
|
+
...(label ? { label } : {}),
|
|
746
|
+
choices: choices.map(({ value, description }) => description ? { value, description } : { value }),
|
|
747
|
+
};
|
|
748
|
+
return [slot.name.trim(), decl];
|
|
749
|
+
}));
|
|
700
750
|
}
|
|
701
751
|
/** A call profile's inputs are its slots and context, and are left out when it has neither. */
|
|
702
752
|
function compileLiveInputs(inputs, report) {
|
|
@@ -706,10 +756,6 @@ function compileLiveInputs(inputs, report) {
|
|
|
706
756
|
return {};
|
|
707
757
|
return { inputs: { ...(slots ? { slots } : {}), ...(context ? { context } : {}) } };
|
|
708
758
|
}
|
|
709
|
-
const isPositiveWhole = (value) => typeof value === 'number' && Number.isInteger(value) && value > 0;
|
|
710
|
-
const isValueList = (value) => Array.isArray(value) &&
|
|
711
|
-
value.length > 0 &&
|
|
712
|
-
value.every((item) => typeof item === 'string' && item.trim() !== '');
|
|
713
759
|
/** `shaped`: the type takes a structured reply and its validation (text only). */
|
|
714
760
|
function compileOutputs(outputs, shaped, report) {
|
|
715
761
|
let structured;
|
package/cookbooks/catalog.d.ts
CHANGED
|
@@ -26,12 +26,17 @@ export declare function decisionExampleAssets(): Promise<{
|
|
|
26
26
|
export declare function createDecisionExampleDraft(): Promise<StudioDraft>;
|
|
27
27
|
/** The decision example with the pictures given: none for a page that only shows its shape. */
|
|
28
28
|
export declare function decisionExampleDraft(images?: DecisionImageDraft[]): StudioDraft;
|
|
29
|
-
/** A tool-call safety decision using the free Span model and its Number question shape. */
|
|
30
|
-
export declare function createSpanExampleDraft(): StudioDraft;
|
|
31
29
|
/** A multimodal embedding profile using Gemini Embeddings 2's free preview model, taking every file type it does. */
|
|
32
30
|
export declare function createGeminiEmbeddingExampleDraft(): StudioDraft;
|
|
33
31
|
/** The demo tools named, in the library's order. */
|
|
34
32
|
export declare function exampleTools(names: readonly string[]): ToolSpecDraft[];
|
|
33
|
+
/** The agent id the research page-reader opens under. */
|
|
34
|
+
export declare const RESEARCH_PAGE_READER_AGENT_ID = "research.pagereader";
|
|
35
|
+
/**
|
|
36
|
+
* What the page-reader's questions are asked about: a research `question` and a
|
|
37
|
+
* `passage` cut from a tool result — not the blank decision's tool-call stub.
|
|
38
|
+
*/
|
|
39
|
+
export declare const RESEARCH_PAGE_READER_STATE: string;
|
|
35
40
|
/** The decision page-reader (`research.pagereader`) that filters passages for `research.scout` at `post_tool`. */
|
|
36
41
|
export declare function createPageReaderExampleDraft(): StudioDraft;
|
|
37
42
|
/** The research scout on its own: searches papers, models, datasets, repos, and docs. */
|
|
@@ -52,7 +57,7 @@ export declare function createConsoleExampleDraft(): StudioDraft;
|
|
|
52
57
|
export declare function addArchitectExample(workspace: StudioWorkspace): StudioWorkspace;
|
|
53
58
|
/** A workspace of the code architect and its narrator, with the architect in the chat. */
|
|
54
59
|
export declare function createArchitectWorkspace(): StudioWorkspace;
|
|
55
|
-
export type CookbookId = 'research' | 'concierge' | 'architect' | 'live-concierge' | 'decision' | '
|
|
60
|
+
export type CookbookId = 'research' | 'concierge' | 'architect' | 'live-concierge' | 'decision' | 'gemini-embedding-2' | 'narrator' | 'console';
|
|
56
61
|
export interface CookbookEntry {
|
|
57
62
|
id: CookbookId;
|
|
58
63
|
kind: 'agent' | 'system';
|
package/cookbooks/catalog.js
CHANGED
|
@@ -198,7 +198,7 @@ export function decisionExampleDraft(images = []) {
|
|
|
198
198
|
const binding = draft.modelBindings[0];
|
|
199
199
|
return {
|
|
200
200
|
...draft,
|
|
201
|
-
identity: { ...draft.identity, agentId: DECISION_EXAMPLE_AGENT_ID, handle: '
|
|
201
|
+
identity: { ...draft.identity, agentId: DECISION_EXAMPLE_AGENT_ID, handle: 'pantry' },
|
|
202
202
|
modelBindings: binding ? [{ ...binding, apiId: 'jev-1.14.0', options: { images: true } }] : [],
|
|
203
203
|
decision: {
|
|
204
204
|
...draft.decision,
|
|
@@ -226,44 +226,6 @@ export function decisionExampleDraft(images = []) {
|
|
|
226
226
|
},
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
/** A tool-call safety decision using the free Span model and its Number question shape. */
|
|
230
|
-
export function createSpanExampleDraft() {
|
|
231
|
-
const draft = setProfileType(createBlankDraft(), 'decision', EXAMPLE_PICKS);
|
|
232
|
-
return {
|
|
233
|
-
...draft,
|
|
234
|
-
identity: { ...draft.identity, agentId: 'guardrails.tool_call.span', handle: 'span' },
|
|
235
|
-
modelBindings: [
|
|
236
|
-
{
|
|
237
|
-
...draft.modelBindings[0],
|
|
238
|
-
...firstServed('openrouter', 'decision'),
|
|
239
|
-
apiId: 'respan/span-01-lite:free',
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
decision: {
|
|
243
|
-
...draft.decision,
|
|
244
|
-
questions: [
|
|
245
|
-
{
|
|
246
|
-
key: draftKey('question'),
|
|
247
|
-
id: 'verdict',
|
|
248
|
-
type: 'noul',
|
|
249
|
-
instructions: 'Is this tool call unsafe or beyond what the user asked for?',
|
|
250
|
-
criteria: [
|
|
251
|
-
{
|
|
252
|
-
key: draftKey('criterion'),
|
|
253
|
-
label: 'true',
|
|
254
|
-
text: 'The call is unsafe or beyond the user request.',
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
key: draftKey('criterion'),
|
|
258
|
-
label: 'false',
|
|
259
|
-
text: 'The call is safe and within the user request.',
|
|
260
|
-
},
|
|
261
|
-
],
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
229
|
const GEMINI_EMBEDDING = {
|
|
268
230
|
protocol: firstServed('gemini', 'embedding').protocol,
|
|
269
231
|
apiId: 'gemini-embedding-2-preview',
|
|
@@ -403,8 +365,8 @@ function exampleTextDraft(identity, tools) {
|
|
|
403
365
|
maxFiles: inputs.maxFiles,
|
|
404
366
|
maxBytes: inputs.maxBytes,
|
|
405
367
|
maxTurnBytes: inputs.maxTurnBytes,
|
|
406
|
-
|
|
407
|
-
|
|
368
|
+
limitsByMime: {},
|
|
369
|
+
slots: [],
|
|
408
370
|
contextFrom: [],
|
|
409
371
|
contextMaxChars: null,
|
|
410
372
|
},
|
|
@@ -416,13 +378,28 @@ function exampleTextDraft(identity, tools) {
|
|
|
416
378
|
},
|
|
417
379
|
};
|
|
418
380
|
}
|
|
381
|
+
/** The agent id the research page-reader opens under. */
|
|
382
|
+
export const RESEARCH_PAGE_READER_AGENT_ID = 'research.pagereader';
|
|
383
|
+
/**
|
|
384
|
+
* What the page-reader's questions are asked about: a research `question` and a
|
|
385
|
+
* `passage` cut from a tool result — not the blank decision's tool-call stub.
|
|
386
|
+
*/
|
|
387
|
+
export const RESEARCH_PAGE_READER_STATE = JSON.stringify({
|
|
388
|
+
question: 'What write path do recent systems use to store episodic memory for language-model agents?',
|
|
389
|
+
passage: 'MemGPT (Packer et al.) pages conversational history into an external store and reloads ' +
|
|
390
|
+
'relevant spans on later turns, treating context as a virtual memory hierarchy rather than a single prompt window.',
|
|
391
|
+
}, null, 2);
|
|
419
392
|
/** The decision page-reader (`research.pagereader`) that filters passages for `research.scout` at `post_tool`. */
|
|
420
393
|
export function createPageReaderExampleDraft() {
|
|
421
394
|
const draft = setProfileType(createBlankDraft(), 'decision', EXAMPLE_PICKS);
|
|
422
395
|
const binding = draft.modelBindings[0];
|
|
423
396
|
return {
|
|
424
397
|
...draft,
|
|
425
|
-
identity: {
|
|
398
|
+
identity: {
|
|
399
|
+
...draft.identity,
|
|
400
|
+
agentId: RESEARCH_PAGE_READER_AGENT_ID,
|
|
401
|
+
handle: 'pagereader',
|
|
402
|
+
},
|
|
426
403
|
modelBindings: binding ? [{ ...binding, apiId: 'jev-latest' }] : [],
|
|
427
404
|
decision: {
|
|
428
405
|
...draft.decision,
|
|
@@ -445,6 +422,15 @@ export function createResearchScoutDraft() {
|
|
|
445
422
|
const base = exampleTextDraft({ agentId: 'research.scout', handle: 'scout', system: DEMO_RESEARCH_SYSTEM }, { tools: { t2Loader: '', parallel: true }, toolSpecs: exampleTools(DEMO_RESEARCH_TOOLS) });
|
|
446
423
|
return {
|
|
447
424
|
...base,
|
|
425
|
+
// Goals starts here: leave attachments and effort select off so examples earn them.
|
|
426
|
+
inputs: {
|
|
427
|
+
...base.inputs,
|
|
428
|
+
attachmentsAccept: [],
|
|
429
|
+
voiceAccept: [],
|
|
430
|
+
maxFiles: null,
|
|
431
|
+
maxBytes: null,
|
|
432
|
+
maxTurnBytes: null,
|
|
433
|
+
},
|
|
448
434
|
models: {
|
|
449
435
|
defaultModel: 'gemini',
|
|
450
436
|
allowModelSelect: false,
|
|
@@ -462,7 +448,7 @@ export function createResearchScoutDraft() {
|
|
|
462
448
|
{ alias: 'deep', level: 'high' },
|
|
463
449
|
],
|
|
464
450
|
defaultEffort: 'normal',
|
|
465
|
-
allowEffortSelect:
|
|
451
|
+
allowEffortSelect: false,
|
|
466
452
|
summaries: true,
|
|
467
453
|
}),
|
|
468
454
|
],
|
|
@@ -645,19 +631,11 @@ export const COOKBOOKS = {
|
|
|
645
631
|
decision: {
|
|
646
632
|
id: 'decision',
|
|
647
633
|
kind: 'agent',
|
|
648
|
-
label: '
|
|
649
|
-
description: '
|
|
634
|
+
label: 'Pantry',
|
|
635
|
+
description: 'Jev looks at a pantry shelf photo: finds things in it (boxes) and answers questions about brunch.',
|
|
650
636
|
createWorkspace: workspaceOf(createDecisionExampleDraft),
|
|
651
637
|
addToWorkspace: addsDraft(createDecisionExampleDraft),
|
|
652
638
|
},
|
|
653
|
-
'span-decision': {
|
|
654
|
-
id: 'span-decision',
|
|
655
|
-
kind: 'agent',
|
|
656
|
-
label: 'Span guardrail',
|
|
657
|
-
description: 'Checks whether a proposed tool call is safe on the free Span decision model.',
|
|
658
|
-
createWorkspace: workspaceOf(createSpanExampleDraft),
|
|
659
|
-
addToWorkspace: addsDraft(createSpanExampleDraft),
|
|
660
|
-
},
|
|
661
639
|
'gemini-embedding-2': {
|
|
662
640
|
id: 'gemini-embedding-2',
|
|
663
641
|
kind: 'agent',
|
package/cookbooks/exchanges.d.ts
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* Cookbook opening exchanges: Studio `.trace.json` recordings projected with the same helpers
|
|
3
3
|
* Replay exchange and Continue live use. One truth — the file is the exchange.
|
|
4
4
|
*/
|
|
5
|
+
import type { TraceRecord } from '@theoremjs/agents';
|
|
5
6
|
import type { TranscriptBlock } from '@theoremjs/agents/interface';
|
|
6
7
|
import type { CookbookId } from './catalog.ts';
|
|
8
|
+
/** The cookbook's recorded trace records, when it has a `.trace.json`. */
|
|
9
|
+
export declare function cookbookTraceRecords(id: CookbookId): TraceRecord[] | undefined;
|
|
7
10
|
/**
|
|
8
11
|
* The conversation a cookbook opens as history, from its recorded `.trace.json`. Undefined when
|
|
9
12
|
* the cookbook has no recording yet.
|
package/cookbooks/exchanges.js
CHANGED
|
@@ -3,11 +3,16 @@ import researchTrace from './fixtures/research.trace.json' with { type: 'json' }
|
|
|
3
3
|
const OPENINGS = {
|
|
4
4
|
research: researchTrace,
|
|
5
5
|
};
|
|
6
|
+
/** The cookbook's recorded trace records, when it has a `.trace.json`. */
|
|
7
|
+
export function cookbookTraceRecords(id) {
|
|
8
|
+
const value = OPENINGS[id];
|
|
9
|
+
return value === undefined ? undefined : parseTraceRecords(value);
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
12
|
* The conversation a cookbook opens as history, from its recorded `.trace.json`. Undefined when
|
|
8
13
|
* the cookbook has no recording yet.
|
|
9
14
|
*/
|
|
10
15
|
export function cookbookOpening(id) {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
16
|
+
const records = cookbookTraceRecords(id);
|
|
17
|
+
return records === undefined ? undefined : openingFromRecords(records);
|
|
13
18
|
}
|
package/cookbooks/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { CookbookEntry, CookbookId, } from './catalog.ts';
|
|
2
|
-
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace,
|
|
3
|
-
export { cookbookOpening } from './exchanges.ts';
|
|
2
|
+
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace, DECISION_EXAMPLE_AGENT_ID, DECISION_EXAMPLE_STATE, DEMO_ARCHITECT_SYSTEM, DEMO_CONCIERGE_SYSTEM, DEMO_LIVE_CONCIERGE_SYSTEM, DEMO_RESEARCH_SYSTEM, decisionExampleAssets, decisionExampleDraft, exampleTools, RESEARCH_FIRST_TURN_PROMPT, RESEARCH_PAGE_READER_AGENT_ID, RESEARCH_PAGE_READER_STATE, RESEARCH_REPLY_SCHEMA_ID, RESEARCH_REPLY_SCHEMA_JSON, } from './catalog.ts';
|
|
3
|
+
export { cookbookOpening, cookbookTraceRecords } from './exchanges.ts';
|
|
4
4
|
export type { ProfileSliceOptions, StitchRecipe, ToolSliceField, ToolSliceOptions, } from './project.ts';
|
|
5
5
|
export { projectProfileSlice, projectToolSlice, resolveCookbookSlice, stitchCookbook, } from './project.ts';
|
|
6
6
|
export type { GoogleBindingViolation, GoogleFreeTierGrounding, GoogleImageAspectRatio, GoogleImageInputMime, GoogleImageOutputMime, GoogleImagePins, GoogleImageResolution, GoogleLivePins, GoogleSpeechPins, GoogleSpeechVoice, GoogleThinkingLevel, GoogleVoiceInputMime, LocalBindingViolation, } from './providers.ts';
|
package/cookbooks/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace,
|
|
2
|
-
export { cookbookOpening } from "./exchanges.js";
|
|
1
|
+
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace, DECISION_EXAMPLE_AGENT_ID, DECISION_EXAMPLE_STATE, DEMO_ARCHITECT_SYSTEM, DEMO_CONCIERGE_SYSTEM, DEMO_LIVE_CONCIERGE_SYSTEM, DEMO_RESEARCH_SYSTEM, decisionExampleAssets, decisionExampleDraft, exampleTools, RESEARCH_FIRST_TURN_PROMPT, RESEARCH_PAGE_READER_AGENT_ID, RESEARCH_PAGE_READER_STATE, RESEARCH_REPLY_SCHEMA_ID, RESEARCH_REPLY_SCHEMA_JSON, } from "./catalog.js";
|
|
2
|
+
export { cookbookOpening, cookbookTraceRecords } from "./exchanges.js";
|
|
3
3
|
export { projectProfileSlice, projectToolSlice, resolveCookbookSlice, stitchCookbook, } from "./project.js";
|
|
4
4
|
export { GEMINI_MODELS_URL, GOOGLE_BUILTIN_TOOLS, GOOGLE_FREE_TIER_GROUNDING, GOOGLE_IMAGE_ASPECT_RATIOS, GOOGLE_IMAGE_INPUT_MIMES, GOOGLE_IMAGE_OUTPUT_MIMES, GOOGLE_IMAGE_RESOLUTIONS, GOOGLE_NO_EFFORT_API_IDS, GOOGLE_NO_THINKING_API_IDS, GOOGLE_SINGLE_TURN_API_IDS, GOOGLE_SPEECH_FORMATS, GOOGLE_SPEECH_VOICES, GOOGLE_THINKING_LEVELS, GOOGLE_THINKING_REQUIRED_API_IDS, GOOGLE_VOICE_INPUT_MIMES, googleBindingViolation, googleEfforts, googleFreeTierBuiltins, localBindingViolation, OPENROUTER_BUILTIN_TOOLS, OPENROUTER_IMAGES_IGNORED_INPUTS, OPENROUTER_IMAGES_INPUT_MIMES, ollamaModelThinks, } from "./providers.js";
|
|
5
5
|
export { COOKBOOK_TOOL_HANDLERS, DEMO_ALLOWED_HOSTS, DEMO_ARCHITECT_TOOLS, DEMO_CONCIERGE_TOOLS, DEMO_CONSOLE_TOOLS, DEMO_HTTP_SAMPLE_INPUT, DEMO_RESEARCH_STAGE_READ_TOOLS, DEMO_RESEARCH_TOOLS, DISCOVER_LOADED, demoHttpSampleInput, demoInputsSpec, demoToolSpecs, RESEARCH_ALLOWED_HOSTS, } from "./tools.js";
|
package/cookbooks/project.js
CHANGED
|
@@ -10,7 +10,7 @@ import { ON_OWN_KEYS } from "../lent-keys.js";
|
|
|
10
10
|
import { studioSource, valueSource } from "../source.js";
|
|
11
11
|
import { keySource, quoteSource } from "../tool-schema.js";
|
|
12
12
|
import { agentDraft, withAgentDraft, workspaceFromDraft, } from "../workspace.js";
|
|
13
|
-
import { COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createResearchWorkspace,
|
|
13
|
+
import { COOKBOOKS, createArchitectWorkspace, createConsoleExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createResearchWorkspace, decisionExampleDraft, } from "./catalog.js";
|
|
14
14
|
const SLICE_STYLE = { unit: ' ', base: '', template: false };
|
|
15
15
|
function syncWorkspace(cookbookId) {
|
|
16
16
|
switch (cookbookId) {
|
|
@@ -24,8 +24,6 @@ function syncWorkspace(cookbookId) {
|
|
|
24
24
|
return workspaceFromDraft(createLiveExampleDraft());
|
|
25
25
|
case 'decision':
|
|
26
26
|
return workspaceFromDraft(decisionExampleDraft());
|
|
27
|
-
case 'span-decision':
|
|
28
|
-
return workspaceFromDraft(createSpanExampleDraft());
|
|
29
27
|
case 'gemini-embedding-2':
|
|
30
28
|
return workspaceFromDraft(createGeminiEmbeddingExampleDraft());
|
|
31
29
|
case 'narrator':
|
package/draft.d.ts
CHANGED
|
@@ -146,6 +146,19 @@ export interface ToolsDraft {
|
|
|
146
146
|
export interface ToolSpecDraft extends StudioToolSpecSeed {
|
|
147
147
|
key: string;
|
|
148
148
|
}
|
|
149
|
+
/** One value a slot can take, and what the page says about it. */
|
|
150
|
+
export interface SlotChoiceDraft {
|
|
151
|
+
key: string;
|
|
152
|
+
value: string;
|
|
153
|
+
description: string;
|
|
154
|
+
}
|
|
155
|
+
/** One named choice a turn can make: its `{name}`, the page's label for it, and its values. */
|
|
156
|
+
export interface SlotDraft {
|
|
157
|
+
key: string;
|
|
158
|
+
name: string;
|
|
159
|
+
label: string;
|
|
160
|
+
choices: SlotChoiceDraft[];
|
|
161
|
+
}
|
|
149
162
|
export interface InputsDraft {
|
|
150
163
|
text: boolean;
|
|
151
164
|
attachmentsAccept: string[];
|
|
@@ -153,10 +166,10 @@ export interface InputsDraft {
|
|
|
153
166
|
maxFiles: number | null;
|
|
154
167
|
maxBytes: number | null;
|
|
155
168
|
maxTurnBytes: number | null;
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
/** Named choices a turn can make
|
|
159
|
-
|
|
169
|
+
/** The largest file of each type (or `type/*` family), in bytes, in place of `maxBytes`. */
|
|
170
|
+
limitsByMime: Record<string, number>;
|
|
171
|
+
/** Named choices a turn can make; none omits `inputs.slots`. */
|
|
172
|
+
slots: SlotDraft[];
|
|
160
173
|
/** Who may send the agent context; none omits `inputs.context`. */
|
|
161
174
|
contextFrom: ContextSender[];
|
|
162
175
|
/** The longest context package from each sender, in characters of JSON. */
|
|
@@ -388,7 +401,7 @@ export interface StudioDraft {
|
|
|
388
401
|
decision: DecisionDraft;
|
|
389
402
|
labels: LabelsDraft;
|
|
390
403
|
}
|
|
391
|
-
export declare function draftKey(prefix: 'agent' | 'model' | 'tool' | 'question' | 'criterion' | 'reference' | 'image'): string;
|
|
404
|
+
export declare function draftKey(prefix: 'agent' | 'model' | 'tool' | 'question' | 'criterion' | 'reference' | 'image' | 'slot' | 'choice'): string;
|
|
392
405
|
export declare function defaultModelBinding(partial?: Partial<ModelBindingDraft>): ModelBindingDraft;
|
|
393
406
|
export declare function defaultToolSpec(partial?: Partial<ToolSpecDraft>): ToolSpecDraft;
|
|
394
407
|
/**
|
|
@@ -420,6 +433,9 @@ export declare function newDecisionImage(draft: StudioDraft, file: string, image
|
|
|
420
433
|
mimeType: string;
|
|
421
434
|
data: string;
|
|
422
435
|
}): DecisionImageDraft;
|
|
436
|
+
/** A new slot, with a name the draft doesn't use yet and two blank choices. */
|
|
437
|
+
export declare function newSlot(slots: readonly SlotDraft[]): SlotDraft;
|
|
438
|
+
export declare function newSlotChoice(): SlotChoiceDraft;
|
|
423
439
|
/** The rows a question of `type` starts with: two options, two levels, or none. */
|
|
424
440
|
export declare function newCriteria(type: DecisionQuestionType): DecisionCriterionDraft[];
|
|
425
441
|
/**
|
package/draft.js
CHANGED
|
@@ -242,6 +242,14 @@ export function newDecisionImage(draft, file, image) {
|
|
|
242
242
|
const name = freeName(base, taken, (n) => `${base}_${n}`);
|
|
243
243
|
return { key: draftKey('image'), name, ...image };
|
|
244
244
|
}
|
|
245
|
+
/** A new slot, with a name the draft doesn't use yet and two blank choices. */
|
|
246
|
+
export function newSlot(slots) {
|
|
247
|
+
const name = freeName('slot', slots.map((slot) => slot.name), (n) => `slot_${String(n)}`);
|
|
248
|
+
return { key: draftKey('slot'), name, label: '', choices: [newSlotChoice(), newSlotChoice()] };
|
|
249
|
+
}
|
|
250
|
+
export function newSlotChoice() {
|
|
251
|
+
return { key: draftKey('choice'), value: '', description: '' };
|
|
252
|
+
}
|
|
245
253
|
/** The rows a question of `type` starts with: two options, two levels, or none. */
|
|
246
254
|
export function newCriteria(type) {
|
|
247
255
|
if (type === 'noul' || type === 'box')
|
|
@@ -277,8 +285,8 @@ export function createBlankDraft() {
|
|
|
277
285
|
maxFiles: null,
|
|
278
286
|
maxBytes: null,
|
|
279
287
|
maxTurnBytes: null,
|
|
280
|
-
|
|
281
|
-
|
|
288
|
+
limitsByMime: {},
|
|
289
|
+
slots: [],
|
|
282
290
|
contextFrom: [],
|
|
283
291
|
contextMaxChars: null,
|
|
284
292
|
},
|
package/media-accept.d.ts
CHANGED
|
@@ -17,3 +17,10 @@ export declare function expandAccept(accept: readonly string[], sections: readon
|
|
|
17
17
|
* type under a wildcard keeps the rest; picking every type of a kind collapses to its wildcard.
|
|
18
18
|
*/
|
|
19
19
|
export declare function nextAccept(previous: readonly string[], selected: readonly string[], sections: readonly AcceptSection[]): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Whether a type can take a size of its own: a type when it is taken, a family when any type in it
|
|
22
|
+
* is, and a type no section lists always.
|
|
23
|
+
*/
|
|
24
|
+
export declare function canSize(mime: string, accept: readonly string[], sections: readonly AcceptSection[]): boolean;
|
|
25
|
+
/** The sizes left once the types taken change: a size stays where it can still apply. */
|
|
26
|
+
export declare function keptLimits(limits: Record<string, number>, accept: readonly string[], sections: readonly AcceptSection[]): Record<string, number>;
|
package/media-accept.js
CHANGED
|
@@ -56,6 +56,23 @@ export function nextAccept(previous, selected, sections) {
|
|
|
56
56
|
const known = new Set(sections.flatMap(({ wildcard, mimes }) => (wildcard ? [wildcard, ...mimes] : mimes)));
|
|
57
57
|
return [...next, ...selected.filter((mime) => !known.has(mime))];
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Whether a type can take a size of its own: a type when it is taken, a family when any type in it
|
|
61
|
+
* is, and a type no section lists always.
|
|
62
|
+
*/
|
|
63
|
+
export function canSize(mime, accept, sections) {
|
|
64
|
+
const section = sections.find((each) => each.wildcard === mime || each.mimes.includes(mime));
|
|
65
|
+
if (!section)
|
|
66
|
+
return true;
|
|
67
|
+
const taken = expandAccept(accept, sections);
|
|
68
|
+
if (mime !== section.wildcard)
|
|
69
|
+
return taken.includes(mime);
|
|
70
|
+
return section.mimes.some((each) => taken.includes(each));
|
|
71
|
+
}
|
|
72
|
+
/** The sizes left once the types taken change: a size stays where it can still apply. */
|
|
73
|
+
export function keptLimits(limits, accept, sections) {
|
|
74
|
+
return Object.fromEntries(Object.entries(limits).filter(([mime]) => canSize(mime, accept, sections)));
|
|
75
|
+
}
|
|
59
76
|
function wildcardKind(mime) {
|
|
60
77
|
if (!mime.endsWith('/*'))
|
|
61
78
|
return undefined;
|
package/mod.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { KNOWN_GEMINI_EMBEDDING_MODELS, KNOWN_OPENROUTER_EMBEDDING_MODELS, } fro
|
|
|
3
3
|
export { type CompiledStudio, compileStudio, credentialHeaderProblem, credentialUrlProblem, type StudioCompileResult, type StudioIssue, type StudioProfileDefinition, type StudioTurnProfileDefinition, } from './compile.ts';
|
|
4
4
|
export { type CompiledWorkspace, compileWorkspace, type WorkspaceCompileResult, workspaceRunAgent, } from './compile-workspace.ts';
|
|
5
5
|
export type { CookbookEntry, CookbookId, GoogleBindingViolation, GoogleFreeTierGrounding, GoogleImageAspectRatio, GoogleImageInputMime, GoogleImageOutputMime, GoogleImagePins, GoogleImageResolution, GoogleLivePins, GoogleSpeechPins, GoogleSpeechVoice, GoogleThinkingLevel, GoogleVoiceInputMime, LocalBindingViolation, ProfileSliceOptions, StitchRecipe, ToolSliceField, ToolSliceOptions, } from './cookbooks/mod.ts';
|
|
6
|
-
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOK_TOOL_HANDLERS, COOKBOOKS, cookbookOpening, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace,
|
|
7
|
-
export { agentToolTarget, COMPACTION_DRAFT_DEFAULTS, createBlankDraft, type DecisionCriterionDraft, type DecisionDraft, type DecisionImageDraft, type DecisionQuestionDraft, type DecisionQuestionType, defaultModelBinding, defaultToolSpec, draftAllows, draftFacets, draftKey, type EffortDraft, EXAMPLE_DECISION_STATE, EXAMPLE_EMBEDDING_QUERY, EXAMPLE_EMBEDDING_TEXT, EXAMPLE_SPAN_DECISION_STATE, exampleDecisionDraft, excludeFacet, type GuardrailsDraft, type IdentityDraft, type ImageDraft, type ImageReferenceDraft, INLINE_LABELS, type InputsDraft, type ItemRuleOnFail, includableFacets, includeFacet, type LabelsDraft, type LiveDraft, MODEL_LIMITS, type ModelBindingDraft, type ModelsDraft, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newToolSpec, type ObservabilityDraft, type OutputsDraft, type OwnDetectorDraft, type PatternDraft, type PatternSourceDraft, plantsCanary, removeModelBinding, type SpeechDraft, STUDIO_PROFILE_TYPES, type StudioDraft, type StudioProfileType, type StudioTurnProfileType, setProfileType, TIMER_MAX_MS, type ToolSpecDraft, type ToolsDraft, type TurnBehaviourDraft, takesContinueInstruction, updateModelBinding, } from './draft.ts';
|
|
6
|
+
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOK_TOOL_HANDLERS, COOKBOOKS, cookbookOpening, cookbookTraceRecords, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace, DECISION_EXAMPLE_AGENT_ID, DECISION_EXAMPLE_STATE, DEMO_ALLOWED_HOSTS, DEMO_ARCHITECT_SYSTEM, DEMO_ARCHITECT_TOOLS, DEMO_CONCIERGE_SYSTEM, DEMO_CONCIERGE_TOOLS, DEMO_CONSOLE_TOOLS, DEMO_HTTP_SAMPLE_INPUT, DEMO_LIVE_CONCIERGE_SYSTEM, DEMO_RESEARCH_STAGE_READ_TOOLS, DEMO_RESEARCH_SYSTEM, DEMO_RESEARCH_TOOLS, DISCOVER_LOADED, decisionExampleAssets, decisionExampleDraft, demoHttpSampleInput, demoInputsSpec, demoToolSpecs, exampleTools, GEMINI_MODELS_URL, GOOGLE_BUILTIN_TOOLS, GOOGLE_FREE_TIER_GROUNDING, GOOGLE_IMAGE_ASPECT_RATIOS, GOOGLE_IMAGE_INPUT_MIMES, GOOGLE_IMAGE_OUTPUT_MIMES, GOOGLE_IMAGE_RESOLUTIONS, GOOGLE_NO_EFFORT_API_IDS, GOOGLE_NO_THINKING_API_IDS, GOOGLE_SINGLE_TURN_API_IDS, GOOGLE_SPEECH_FORMATS, GOOGLE_SPEECH_VOICES, GOOGLE_THINKING_LEVELS, GOOGLE_THINKING_REQUIRED_API_IDS, GOOGLE_VOICE_INPUT_MIMES, googleBindingViolation, googleEfforts, googleFreeTierBuiltins, localBindingViolation, OPENROUTER_BUILTIN_TOOLS, OPENROUTER_IMAGES_IGNORED_INPUTS, OPENROUTER_IMAGES_INPUT_MIMES, ollamaModelThinks, projectProfileSlice, projectToolSlice, RESEARCH_ALLOWED_HOSTS, RESEARCH_FIRST_TURN_PROMPT, RESEARCH_PAGE_READER_AGENT_ID, RESEARCH_PAGE_READER_STATE, RESEARCH_REPLY_SCHEMA_ID, RESEARCH_REPLY_SCHEMA_JSON, resolveCookbookSlice, stitchCookbook, } from './cookbooks/mod.ts';
|
|
7
|
+
export { agentToolTarget, COMPACTION_DRAFT_DEFAULTS, createBlankDraft, type DecisionCriterionDraft, type DecisionDraft, type DecisionImageDraft, type DecisionQuestionDraft, type DecisionQuestionType, defaultModelBinding, defaultToolSpec, draftAllows, draftFacets, draftKey, type EffortDraft, EXAMPLE_DECISION_STATE, EXAMPLE_EMBEDDING_QUERY, EXAMPLE_EMBEDDING_TEXT, EXAMPLE_SPAN_DECISION_STATE, exampleDecisionDraft, excludeFacet, type GuardrailsDraft, type IdentityDraft, type ImageDraft, type ImageReferenceDraft, INLINE_LABELS, type InputsDraft, type ItemRuleOnFail, includableFacets, includeFacet, type LabelsDraft, type LiveDraft, MODEL_LIMITS, type ModelBindingDraft, type ModelsDraft, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newSlot, newSlotChoice, newToolSpec, type ObservabilityDraft, type OutputsDraft, type OwnDetectorDraft, type PatternDraft, type PatternSourceDraft, plantsCanary, removeModelBinding, type SlotChoiceDraft, type SlotDraft, type SpeechDraft, STUDIO_PROFILE_TYPES, type StudioDraft, type StudioProfileType, type StudioTurnProfileType, setProfileType, TIMER_MAX_MS, type ToolSpecDraft, type ToolsDraft, type TurnBehaviourDraft, takesContinueInstruction, updateModelBinding, } from './draft.ts';
|
|
8
8
|
export { EXAMPLE_EMBEDDING_FILES } from './example-embedding-files.ts';
|
|
9
9
|
export type { GuardrailProbe, GuardrailProbeAnswer, GuardrailProbeDraft, GuardrailProbeResult, ProbeBoundary, ProbeBoundaryNote, ProbeStatus, } from './guardrail-probe.ts';
|
|
10
10
|
export { PROBE_BOUNDARIES, PROBE_BOUNDARY_NOTES, PROBE_STATUSES, PROBE_TEXT_LIMIT, probeDraft, probeRefusal, runGuardrailProbe, runGuardrailProbes, } from './guardrail-probe.ts';
|
|
@@ -14,7 +14,7 @@ export { type DiffLine, lineDiff } from './line-diff.ts';
|
|
|
14
14
|
export type { StudioLiveDraftMessage } from './live-connection.ts';
|
|
15
15
|
export { studioLiveConnection, studioPageTools } from './live-connection.ts';
|
|
16
16
|
export { type MapGroup, type MapLayout, type MapLine, type MapLink, type MapLinkKind, type MapNode, type MapNodeKind, type MapPlace, type MapRow, type MapSizes, type MapView, mapFamily, mapFound, mapLayout, mapLinkEnds, mapLinkWords, mapNeighbours, mapNoteLines, type WorkspaceMap, workspaceMap, } from './map.ts';
|
|
17
|
-
export { type AcceptSection, acceptSections, expandAccept, nextAccept } from './media-accept.ts';
|
|
17
|
+
export { type AcceptSection, acceptSections, canSize, expandAccept, keptLimits, nextAccept, } from './media-accept.ts';
|
|
18
18
|
export { type NodeOrigins, nodeOrigins, openOutcome, originLabel, originPlace, originShortLabel, originWay, rowOrigin, } from './origins.ts';
|
|
19
19
|
export { firstServed, isGoogleRoute, isOpenRouterRoute, isProviderBuiltinId, modelBindingViolation, STUDIO_TRACE_DESTINATION, type StudioConnectionMode, startingBinding, studioRunsProvider, } from './policy.ts';
|
|
20
20
|
export { PROBE_BATTERY, type ProbeBatteryCase } from './probe-battery.ts';
|
package/mod.js
CHANGED
|
@@ -2,8 +2,8 @@ export { writeAsk, writeAskLine } from "./asks.js";
|
|
|
2
2
|
export { KNOWN_GEMINI_EMBEDDING_MODELS, KNOWN_OPENROUTER_EMBEDDING_MODELS, } from "./browser-connection.js";
|
|
3
3
|
export { compileStudio, credentialHeaderProblem, credentialUrlProblem, } from "./compile.js";
|
|
4
4
|
export { compileWorkspace, workspaceRunAgent, } from "./compile-workspace.js";
|
|
5
|
-
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOK_TOOL_HANDLERS, COOKBOOKS, cookbookOpening, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace,
|
|
6
|
-
export { agentToolTarget, COMPACTION_DRAFT_DEFAULTS, createBlankDraft, defaultModelBinding, defaultToolSpec, draftAllows, draftFacets, draftKey, EXAMPLE_DECISION_STATE, EXAMPLE_EMBEDDING_QUERY, EXAMPLE_EMBEDDING_TEXT, EXAMPLE_SPAN_DECISION_STATE, exampleDecisionDraft, excludeFacet, INLINE_LABELS, includableFacets, includeFacet, MODEL_LIMITS, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newToolSpec, plantsCanary, removeModelBinding, STUDIO_PROFILE_TYPES, setProfileType, TIMER_MAX_MS, takesContinueInstruction, updateModelBinding, } from "./draft.js";
|
|
5
|
+
export { addArchitectExample, addResearchExample, COOKBOOK_IDS, COOKBOOK_TOOL_HANDLERS, COOKBOOKS, cookbookOpening, cookbookTraceRecords, createArchitectWorkspace, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createPageReaderExampleDraft, createResearchScoutDraft, createResearchWorkspace, DECISION_EXAMPLE_AGENT_ID, DECISION_EXAMPLE_STATE, DEMO_ALLOWED_HOSTS, DEMO_ARCHITECT_SYSTEM, DEMO_ARCHITECT_TOOLS, DEMO_CONCIERGE_SYSTEM, DEMO_CONCIERGE_TOOLS, DEMO_CONSOLE_TOOLS, DEMO_HTTP_SAMPLE_INPUT, DEMO_LIVE_CONCIERGE_SYSTEM, DEMO_RESEARCH_STAGE_READ_TOOLS, DEMO_RESEARCH_SYSTEM, DEMO_RESEARCH_TOOLS, DISCOVER_LOADED, decisionExampleAssets, decisionExampleDraft, demoHttpSampleInput, demoInputsSpec, demoToolSpecs, exampleTools, GEMINI_MODELS_URL, GOOGLE_BUILTIN_TOOLS, GOOGLE_FREE_TIER_GROUNDING, GOOGLE_IMAGE_ASPECT_RATIOS, GOOGLE_IMAGE_INPUT_MIMES, GOOGLE_IMAGE_OUTPUT_MIMES, GOOGLE_IMAGE_RESOLUTIONS, GOOGLE_NO_EFFORT_API_IDS, GOOGLE_NO_THINKING_API_IDS, GOOGLE_SINGLE_TURN_API_IDS, GOOGLE_SPEECH_FORMATS, GOOGLE_SPEECH_VOICES, GOOGLE_THINKING_LEVELS, GOOGLE_THINKING_REQUIRED_API_IDS, GOOGLE_VOICE_INPUT_MIMES, googleBindingViolation, googleEfforts, googleFreeTierBuiltins, localBindingViolation, OPENROUTER_BUILTIN_TOOLS, OPENROUTER_IMAGES_IGNORED_INPUTS, OPENROUTER_IMAGES_INPUT_MIMES, ollamaModelThinks, projectProfileSlice, projectToolSlice, RESEARCH_ALLOWED_HOSTS, RESEARCH_FIRST_TURN_PROMPT, RESEARCH_PAGE_READER_AGENT_ID, RESEARCH_PAGE_READER_STATE, RESEARCH_REPLY_SCHEMA_ID, RESEARCH_REPLY_SCHEMA_JSON, resolveCookbookSlice, stitchCookbook, } from "./cookbooks/mod.js";
|
|
6
|
+
export { agentToolTarget, COMPACTION_DRAFT_DEFAULTS, createBlankDraft, defaultModelBinding, defaultToolSpec, draftAllows, draftFacets, draftKey, EXAMPLE_DECISION_STATE, EXAMPLE_EMBEDDING_QUERY, EXAMPLE_EMBEDDING_TEXT, EXAMPLE_SPAN_DECISION_STATE, exampleDecisionDraft, excludeFacet, INLINE_LABELS, includableFacets, includeFacet, MODEL_LIMITS, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newSlot, newSlotChoice, newToolSpec, plantsCanary, removeModelBinding, STUDIO_PROFILE_TYPES, setProfileType, TIMER_MAX_MS, takesContinueInstruction, updateModelBinding, } from "./draft.js";
|
|
7
7
|
export { EXAMPLE_EMBEDDING_FILES } from "./example-embedding-files.js";
|
|
8
8
|
export { PROBE_BOUNDARIES, PROBE_BOUNDARY_NOTES, PROBE_STATUSES, PROBE_TEXT_LIMIT, probeDraft, probeRefusal, runGuardrailProbe, runGuardrailProbes, } from "./guardrail-probe.js";
|
|
9
9
|
export { unheldProblem } from "./held-credentials.js";
|
|
@@ -11,7 +11,7 @@ export { lentCompression, ON_OWN_KEYS, studioNetworkNote, studioTaintNote, } fro
|
|
|
11
11
|
export { lineDiff } from "./line-diff.js";
|
|
12
12
|
export { studioLiveConnection, studioPageTools } from "./live-connection.js";
|
|
13
13
|
export { mapFamily, mapFound, mapLayout, mapLinkEnds, mapLinkWords, mapNeighbours, mapNoteLines, workspaceMap, } from "./map.js";
|
|
14
|
-
export { acceptSections, expandAccept, nextAccept } from "./media-accept.js";
|
|
14
|
+
export { acceptSections, canSize, expandAccept, keptLimits, nextAccept, } from "./media-accept.js";
|
|
15
15
|
export { nodeOrigins, openOutcome, originLabel, originPlace, originShortLabel, originWay, rowOrigin, } from "./origins.js";
|
|
16
16
|
export { firstServed, isGoogleRoute, isOpenRouterRoute, isProviderBuiltinId, modelBindingViolation, STUDIO_TRACE_DESTINATION, startingBinding, studioRunsProvider, } from "./policy.js";
|
|
17
17
|
export { PROBE_BATTERY } from "./probe-battery.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/studio",
|
|
3
|
-
"version": "0.3.4-next.
|
|
3
|
+
"version": "0.3.4-next.548.gbb156b2",
|
|
4
4
|
"description": "Theorem Studio: open a project's agents in a local studio on Deno, edit and run them, and save back to its files; or show the studio screen in a Vite app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"zod": "^4.6.5",
|
|
80
|
-
"@theoremjs/agents": "0.3.4-next.
|
|
81
|
-
"@theoremjs/web": "0.3.4-next.
|
|
82
|
-
"@theoremjs/react": "0.3.4-next.
|
|
80
|
+
"@theoremjs/agents": "0.3.4-next.548.gbb156b2",
|
|
81
|
+
"@theoremjs/web": "0.3.4-next.548.gbb156b2",
|
|
82
|
+
"@theoremjs/react": "0.3.4-next.548.gbb156b2"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
85
85
|
"@theoremjs/react": {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TraceInspector-Cn7_V-2C.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-3IqahpCr.js","assets/tokens.stylex-DkHf0P9C.js","assets/SegmentedControlItem-BLuJOusN.js","assets/padding.stylex-B76907Zf.js","assets/VStack-CkVMcNiK.js","assets/mergeProps-ptS-gIMz.js","assets/StackItem-CQviqAfM.js","assets/useLayerDismissal-BAnTRYTt.js","assets/fieldParts-Cs6Amprh.js","assets/Icon-ZfFwTt8n.js","assets/devWarning-DxuplmRl.js","assets/Text-BsiAsowd.js","assets/sharedResizeObserver-4U9Xq5Oq.js","assets/preload-helper-DpV6A1kQ.js","assets/useMediaQuery-BCT0NUeZ.js","assets/focusOutline.stylex-BT0kfa4t.js","assets/IconButton-CG5klqF1.js","assets/useTooltip-rxACYEAC.js","assets/useDevWarning-Cna3kqg1.js","assets/Tooltip-CTEuMRLe.js","assets/createReactComponent-CZwsv6DD.js","assets/isRtlElement-BG33-k_H.js","assets/CodeBlock-Kjgv83A6.js","assets/useClipboard-B1amtN2V.js","assets/useScrollableArea-vxuztwym.js","assets/DateInput-BJt-UTCy.js","assets/focusReturn-CTppP2k0.js","assets/Card-Ghe4ozhC.js","assets/container.stylex-BmOi-8DQ.js","assets/ScrollableArea-C8AVuqnt.js","assets/BottomSheet-BQPskY35.js","assets/useScrollLock-Dyf6PHJt.js","assets/chainEventHandlers-C6ttXGfW.js","assets/use-trace-records-CZNBjTS0.js","assets/CheckboxInput-C9kbVyhK.js","assets/IconAlertTriangle-BqAEqqdU.js","assets/arrive-DvbqpeRS.js","assets/IconShield-DDOh7Gr5.js","assets/shaped-data-DYOBdvLJ.js","assets/host-patterns-F-KZIzkF.js","assets/trace-record-B2MF8flo.js","assets/TraceOverview-DqhP_wzg.js","assets/labels-provider-BObUoNKa.js","assets/index-Bk_jhM4_.js","assets/browser-transport-FDq0Q4Fx.js","assets/Center-nHS1JSux.js","assets/IconSearch-BTx66a40.js","assets/schemas-BQ9Jydzb.js","assets/tool-schema--CLE7o0H.js","assets/reader-DJB6MzQf.js","assets/live-ingress-OuSlQ6q7.js","assets/trace-schema-9CdEyG6Q.js","assets/stub-kLwOLu-h.js","assets/tree-CDqNZ8w-.js","assets/types-DTbqRZ5l.js","assets/useContainerReveal-BFy8N_QU.js","assets/Dialog-BDUExlk_.js","assets/HoverCard-C6thuzrf.js","assets/IconEye-BB5aY-wQ.js","assets/studio-labels-CByQ2z3Y.js","assets/turn-client-DXtNeRHG.js","assets/encode-files-CiyHxnUC.js","assets/CollapsibleGroup-Bfnp4Aaz.js","assets/crypto-Dd6XxhqK.js","assets/workspace-Cb6PICiw.js","assets/lent-keys-C32ems-I.js","assets/editors-BJX_S59A.js","assets/studio-session-yEqFQo5o.js","assets/EmptyState-C8W4JKBZ.js","assets/use-second-ticker-VX91zrxj.js","assets/use-second-ticker-CnxaP3LD.css","assets/ContextMenu-DGeuOuIz.js","assets/useAdaptivePresentation-BY_zvjIp.js","assets/Section-DJ97F7QE.js","assets/index-C9rhrCGT.css","assets/trace-patterns-CS99kExN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{h as a}from"./tokens.stylex-DkHf0P9C.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{E as s,T as c}from"./fieldParts-Cs6Amprh.js";import{t as l,x as u}from"./Icon-ZfFwTt8n.js";import{p as d,r as f,t as p}from"./IconButton-CG5klqF1.js";import{b as m,d as h,f as g,g as _,h as v,l as y,n as b,p as x,t as S,u as C}from"./use-trace-records-CZNBjTS0.js";import{t as w}from"./preload-helper-DpV6A1kQ.js";import{n as T,t as E}from"./labels-provider-BObUoNKa.js";import{t as D}from"./createReactComponent-CZwsv6DD.js";import{a as O}from"./ScrollableArea-C8AVuqnt.js";var k=D(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]),A=D(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),j=D(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),M=e(i(),1),N=t(),P=(0,M.lazy)(()=>w(()=>import(`./TraceInspector-Cn7_V-2C.js`).then(e=>({default:e.TraceGuardrailsBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]))),F=(0,M.lazy)(()=>w(()=>import(`./TraceInspector-Cn7_V-2C.js`).then(e=>({default:e.TraceFeedBody})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]))),I=(0,M.createContext)(`replace`);function L({value:e,children:t}){return(0,N.jsx)(I,{value:e,children:t})}function R({id:e,header:t,traces:n}){return(0,N.jsx)(y,{id:e,header:t,children:e=>(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(F,{traces:n,isWide:e})})})}function z(e,t,n){let r=T(),i=(0,M.useId)(),[a,o]=(0,M.useState)(!1),s=(0,M.use)(I),c={name:r(`@theorem.panel.trace.name`),show:r(`@theorem.panel.trace.show`),hide:r(`@theorem.panel.trace.hide`),resize:r(`@theorem.panel.trace.resize`)};if(e.observability?.record!==!0)return{toggle:null,view:null,labels:c,offered:!1};let u=n??a,d=n===void 0?(0,N.jsx)(g,{labels:c,icon:(0,N.jsx)(l,{icon:O}),panelId:i,open:u,onToggle:()=>o(e=>!e)}):null;return{toggle:d,view:u?B(s===`panel`,i,t,d):null,labels:c,offered:!0}}function B(e,t,n,r){let i=(0,N.jsxs)(h,{floating:!0,children:[(0,N.jsx)(U,{traces:n}),r]});return e?(0,N.jsx)(V,{id:t,header:i,traces:n}):(0,N.jsx)(R,{id:t,header:i,traces:n})}function V({id:e,header:t,traces:n}){let{ref:r,width:i}=_();return(0,N.jsxs)(`div`,{id:e,ref:r,style:{height:`100%`,position:`relative`},children:[t,(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(F,{traces:n,isWide:x(i)})})]})}function H(e){for(let t of e)for(let e of t.spans){let t=e.attributes[`gen_ai.agent.name`];if(typeof t==`string`&&t)return t}return`trace`}function U({traces:e}){let t=T(),n=S(e);if(n.length===0)return null;let r=t(`@theorem.panel.trace.download`);return(0,N.jsx)(p,{label:r,variant:`ghost`,tooltip:r,icon:(0,N.jsx)(l,{icon:j,size:`sm`}),onClick:()=>{let e=new Date().toISOString().replaceAll(`:`,`-`).slice(0,19),t=new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=`${H(n)}-${e}.trace.json`,i.click(),URL.revokeObjectURL(r)}})}function W({inspector:e,children:t}){let n=(0,M.useRef)(null),r=v(n,!1),i=(0,M.useRef)(void 0),a=(0,M.useCallback)(e=>{n.current=e;let t=i.current;typeof t==`function`?t(e):t!=null&&(t.current=e)},[]);if(!(0,M.isValidElement)(t))return(0,N.jsx)(b,{view:e.view,children:t});i.current=t.props.ref;let o=e.view!=null;return(0,M.cloneElement)(t,{ref:a,end:(0,N.jsx)(C,{labels:e.labels,resizable:r.resizable,open:o,children:e.view})})}function G({inspector:e,children:t}){return(0,M.use)(I)===`panel`&&e.offered?(0,N.jsx)(W,{inspector:e,children:t}):(0,N.jsx)(b,{view:e.view,children:t})}function K({records:e,head:t}){return(0,N.jsx)(E,{children:(0,N.jsx)(M.Suspense,{fallback:null,children:(0,N.jsx)(P,{records:e,head:t})})})}var q={info:`info`,warning:`warning`,error:`error`,success:`success`},ee={info:`accent`,warning:`warning`,error:`error`,success:`success`},J={root:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kMv6JI:`xjb2p0i`,$$css:!0},rootElevatedCard:{kaIpWk:`x1vf2byn`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x1cy8zhl`,kwnvtZ:`x1a02dak`,k1C7PZ:`xak3so`,khm7nJ:`x4olc9o`,k8WAf4:`x8o8v82`,kg3NbH:`x1pzlopt`,$$css:!0},headerCardStandalone:{kaIpWk:`x1vf2byn`,$$css:!0},headerCardWithContent:{krdFHd:`xwxb7qi`,kfmiAY:`x13nour3`,kVL7Gh:`xbiv7yw`,kT0f0o:`x16uus16`,$$css:!0},headerCentered:{kGNEyG:`x6s0dn4`,$$css:!0},endArea:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kwnvtZ:`x1a02dak`,kjj79g:`x13a6bvl`,kOIVth:`x1txdalj`,kmuXW:`x2lah0s`,ks0D6T:`x193iq5w`,keTefX:`xvc5jky`,kqGvvJ:`x81ka23`,$$css:!0},chevron:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},chevronExpanded:{k3aq6I:`x19jd1h0`,$$css:!0}},Y={info:{kWkggS:`xgcxg3y`,$$css:!0},warning:{kWkggS:`x24i8r5`,$$css:!0},error:{kWkggS:`x1pritpl`,$$css:!0},success:{kWkggS:`xu13z74`,$$css:!0}};function te(e){return Object.prototype.hasOwnProperty.call(Y,e)}var ne={none:{kGVxlE:`x1gnnqk1`,$$css:!0},low:{kGVxlE:`x1i5ehqx`,$$css:!0},med:{kGVxlE:`x14hfi27`,$$css:!0},high:{kGVxlE:`x1kcpxr7`,$$css:!0}};function X({status:e,title:t,description:i,icon:p,isDismissable:h=!1,onDismiss:g,dismissLabel:_,endContent:v,container:y=`card`,elevation:b=`none`,collapsible:x=!0,children:S,xstyle:C,className:w,style:T,ref:E,onFocusCapture:D,onPointerDownCapture:O,...k}){let A=u(),[j,P]=(0,M.useState)(!1),F=typeof x==`object`&&x?x:{},{isEnabled:I,isOpen:L,toggle:R}=m({isCollapsible:x!==!1&&{...F,defaultIsOpen:F.defaultIsOpen??!1}}),z=(0,M.useRef)(null),B=(0,M.useId)(),V=q[e],H=ee[e],U=c(S),W=A(`@astryx.banner.dismiss`),G=_??W,K=_??(typeof t==`string`?A(`@astryx.banner.dismissTitled`,{dismiss:W,title:t}):W);if(j)return null;let X=(e,t)=>{e instanceof HTMLElement&&e!==document.body&&!t.contains(e)&&(z.current=e)},re=e=>{X(e.relatedTarget,e.currentTarget)},ie=e=>{X(document.activeElement,e.currentTarget)},ae=()=>{let e=z.current;P(!0),g?.(),e?.isConnected&&e.focus()},Z=I&&U,oe=c(v)||h||Z,se=c(v)||h,ce=!c(i)&&se,Q=U&&(!I||L),$=y===`card`;return(0,N.jsxs)(`div`,{ref:E,onFocusCapture:s(D,re),onPointerDownCapture:s(O,ie),...o(r(`banner-frame`,{container:y,elevation:b}),n(J.root,ne[b],$&&b!==`none`&&J.rootElevatedCard,C),w,T),...k,children:[(0,N.jsxs)(`div`,{...o(r(`banner`,{container:y,status:e}),n(J.header,ce&&J.headerCentered,te(e)&&Y[e],$&&(Q?J.headerCardWithContent:J.headerCardStandalone))),children:[(0,N.jsx)(`div`,{...c(p)?o(r(`banner-icon`,{status:e}),{className:`x78zum5 x6s0dn4 x2lah0s`}):{className:`x78zum5 x6s0dn4 x2lah0s`},"aria-hidden":`true`,children:c(p)?p:V==null?null:(0,N.jsx)(l,{icon:V,size:`md`,color:H,...r(`banner-icon`,{status:e})})}),(0,N.jsxs)(`div`,{...{0:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli`},1:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli xgualba`}}[!!c(v)|0],children:[(0,N.jsx)(`div`,{className:`x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0 xj0a0fe`,children:t}),c(i)&&(0,N.jsx)(`div`,{...o(r(`banner-description`),{className:`x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4 xj0a0fe`}),children:i})]}),oe&&(0,N.jsxs)(`div`,{...n(J.endArea,d.inset(a[`--spacing-2`])),children:[v,Z&&(0,N.jsx)(f,{variant:`ghost`,size:`sm`,label:A(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),tooltip:A(L?`@astryx.banner.collapse`:`@astryx.banner.expand`),icon:(0,N.jsx)(l,{icon:`chevronDown`,size:`sm`,color:`inherit`,xstyle:[J.chevron,L&&J.chevronExpanded]}),onClick:R,"aria-expanded":L,"aria-controls":Q?B:void 0,isIconOnly:!0}),h&&(0,N.jsx)(f,{variant:`ghost`,size:`sm`,label:K,tooltip:G,icon:(0,N.jsx)(l,{icon:`close`,size:`sm`,color:`inherit`}),onClick:ae,isIconOnly:!0})]})]}),Q&&(0,N.jsx)(`div`,{id:Z?B:void 0,...o(r(`banner-content`,{container:y,status:e}),{0:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh`},1:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x1k5g1gk x1eprgri`}}[!!$|0]),children:S})]})}X.displayName=`Banner`;export{z as a,G as i,K as n,A as o,L as r,k as s,X as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n,n as r,u as i}from"./themeProps-3IqahpCr.js";import{t as a}from"./mergeProps-ptS-gIMz.js";import{c as o,s}from"./useLayerDismissal-BAnTRYTt.js";import{t as c}from"./Icon-ZfFwTt8n.js";import{r as l}from"./focusOutline.stylex-BT0kfa4t.js";import{h as u,i as d}from"./IconButton-CG5klqF1.js";import{S as f,b as p,x as m}from"./use-trace-records-CZNBjTS0.js";var h=t(),g={base:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kOIVth:`xzye2dw`,kZKoxP:`x1grt7ep`,k8WAf4:`xt970qd`,kg3NbH:`xf314gf`,kaIpWk:`xjspbzw`,kMv6JI:`xjb2p0i`,kGuDYH:`x141an7d`,kLWn49:`x1ltkj2j`,k63SB2:`x1e4wzip`,khDVqt:`xuxw1ft`,ks0D6T:`x193iq5w`,k7Eaqz:`xeuugli`,$$css:!0}},_={neutral:{kWkggS:`x17x4s8c`,kMwMTN:`x1tgivj0`,$$css:!0},info:{kWkggS:`x1ewilqj`,kMwMTN:`x17wrial`,$$css:!0},success:{kWkggS:`xdsz4j9`,kMwMTN:`xri61p4`,$$css:!0},warning:{kWkggS:`x1q8g9m5`,kMwMTN:`xrebv38`,$$css:!0},error:{kWkggS:`x1pjz0fi`,kMwMTN:`x1m024r3`,$$css:!0},blue:{kWkggS:`x1o0wnni`,kMwMTN:`x1vvqiwl`,$$css:!0},cyan:{kWkggS:`x1rgj867`,kMwMTN:`x1txnczv`,$$css:!0},green:{kWkggS:`x1sqjeoo`,kMwMTN:`xltfdvo`,$$css:!0},orange:{kWkggS:`x1e9xt6e`,kMwMTN:`xm47u9q`,$$css:!0},pink:{kWkggS:`xnpoty2`,kMwMTN:`xiuofww`,$$css:!0},purple:{kWkggS:`x16i6n6f`,kMwMTN:`x1m9wyeb`,$$css:!0},red:{kWkggS:`x1cibrc5`,kMwMTN:`x1joocv1`,$$css:!0},teal:{kWkggS:`x1jtji5o`,kMwMTN:`x9x0lbs`,$$css:!0},yellow:{kWkggS:`x1bo7t0x`,kMwMTN:`xdhq94a`,$$css:!0}};function v({variant:e=`neutral`,label:t,icon:i,xstyle:o,className:s,style:c,ref:l,...u}){let d=typeof t==`number`?String(t):typeof t==`string`&&t.length>0?t:void 0;return(0,h.jsxs)(`span`,{ref:l,...a(r(`badge`,{variant:e}),n(g.base,_[e],o),s,c),title:d,...u,children:[i,(0,h.jsx)(`span`,{className:`xb3r6kr xlyipyv xeuugli`,children:t})]})}v.displayName=`Badge`;var y=e(i(),1);function b(){let[e,t]=(0,y.useState)(!1);o();let n=(0,y.useCallback)(()=>{t(s()===`pointer`)},[]),r=(0,y.useCallback)(()=>{t(!1)},[]);return{isFocusRingSuppressed:e,onFocusReturnTargetFocus:(0,y.useCallback)(()=>{s()===`keyboard`&&t(!1)},[]),prepareFocusReturn:n,resetFocusReturn:r}}var x={root:{kzqmXN:`xh8yej3`,$$css:!0},trigger:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kzqmXN:`xh8yej3`,kkrTdU:`x1ypdohk x16khyan`,kMv6JI:`x9ynric`,kGuDYH:`x18juvz8`,k63SB2:`x2mo6ok`,kMwMTN:`x1tgivj0`,k9WMMc:`x1yc453h`,k8WAf4:`xt970qd`,$$css:!0},triggerDisabled:{kkrTdU:`xt0e3qv`,kSiTet:`xbyyjgo`,$$css:!0},chevron:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmuXW:`x2lah0s`,kzqmXN:`xta46cu`,kZKoxP:`x1seg80s`,kGuDYH:`x18juvz8`,k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,$$css:!0},chevronOpen:{k3aq6I:`x19jd1h0`,$$css:!0},chevronClosed:{k3aq6I:`x7p49u4`,$$css:!0},chevronStart:{k71WvV:`x1pezmd8`,$$css:!0},chevronStartOpen:{k3aq6I:`x1iffjtl x1nxqau`,$$css:!0},chevronStartClosed:{k3aq6I:`x7p49u4 xaafvuh`,$$css:!0},contentHidden:{k1xSpc:`x1s85apg`,$$css:!0},content:{kLKAdn:`xfsso4q`,kMv6JI:`x9ynric`,kGuDYH:`xjm74w1`,k63SB2:`xxovm9e`,kLWn49:`xw6l6zx`,kMwMTN:`x1tgivj0`,$$css:!0},divided:{kEafiO:`x11xkdxz x1g31smg`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,$$css:!0}},S={triggerCompact:{k8WAf4:`xu0wf1k`,$$css:!0},triggerBalanced:{k8WAf4:`xce4md1`,$$css:!0},triggerSpacious:{k8WAf4:`x8o8v82`,$$css:!0},contentCompact:{kGO01o:`xy143xn`,$$css:!0},contentBalanced:{kGO01o:`x1wesfrj`,$$css:!0},contentSpacious:{kGO01o:`xvmdzux`,$$css:!0}},C={compact:S.triggerCompact,balanced:S.triggerBalanced,spacious:S.triggerSpacious},w={compact:S.contentCompact,balanced:S.contentBalanced,spacious:S.contentSpacious};function T({trigger:e,children:t,defaultIsOpen:i,isOpen:o,isDisabled:s=!1,onOpenChange:m,chevronPosition:g,value:_,ref:v,xstyle:b,className:S,style:T,...E}){let D=d(),{isOpen:O,toggle:k}=p({isCollapsible:o===void 0?{defaultIsOpen:i??!0,onOpenChange:m}:{isOpen:o,onOpenChange:m},value:_}),A=()=>{s||k()},j=(0,y.use)(f),M=j?.hasDividers??!1,N=j?.density??null,P=g??j?.chevronPosition??`end`,F=P===`start`,I=(0,y.useId)(),L=(0,h.jsx)(c,{icon:F?`chevronRight`:`chevronDown`,size:`sm`,color:`secondary`,xstyle:[x.chevron,F&&x.chevronStart,F?O?x.chevronStartOpen:x.chevronStartClosed:O?x.chevronOpen:x.chevronClosed]});return(0,h.jsxs)(`div`,{ref:v,...a(r(`collapsible`,{density:N??void 0,divided:M?`divided`:null}),n(x.root,M&&x.divided,b),S,T),...E,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:A,"aria-disabled":s||void 0,"aria-expanded":O,"aria-controls":I,tabIndex:s?-1:void 0,...s?void 0:D,...a(r(`collapsible-trigger`,{density:N??void 0,chevronPosition:P,open:O?`open`:null,disabled:s?`disabled`:null}),l.focusVisible(x.trigger,N!=null&&C[N],!s&&u.pressedBackgroundColor,s&&x.triggerDisabled)),children:[F&&L,(0,h.jsx)(`span`,{className:`x1b2iylo xwgcxoh x1iyjqo2`,children:e}),!F&&L]}),(0,h.jsx)(`div`,{id:I,...a(r(`collapsible-content`,{density:N??void 0,open:O?`open`:null}),n(x.content,N!=null&&w[N],!O&&x.contentHidden)),children:j==null?t:(0,h.jsx)(f,{value:null,children:t})})]})}T.displayName=`Collapsible`;var E={wrapper:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,$$css:!0}};function D(e){return e==null?[]:Array.isArray(e)?e:[e]}function O({type:e=`single`,defaultValue:t,value:i,onChange:o,hasDividers:s=!1,density:c,chevronPosition:l,children:u,ref:d,xstyle:p,className:g,style:_,...v}){let b=i!==void 0,[x,S]=(0,y.useState)(()=>D(t)),C=(0,y.useMemo)(()=>b?D(i):x,[i,x,b]),w=(0,y.useCallback)(e=>C.includes(e),[C]),T=(0,y.useCallback)(t=>{let n;n=e===`single`?C.includes(t)?[]:[t]:C.includes(t)?C.filter(e=>e!==t):[...C,t],b||S(n),o&&o(e===`single`?n[0]??``:n)},[e,C,b,o]),O=(0,y.useMemo)(()=>({isOpen:w,toggle:T}),[w,T]),k=c??(s?`balanced`:null),A=(0,y.useMemo)(()=>({hasDividers:s,density:k,chevronPosition:l??null}),[s,k,l]),j=s?(0,h.jsx)(`div`,{ref:d,...a(r(`collapsible-group`,{density:k??void 0}),n(E.wrapper,p),g,_),...v,children:u}):u;return(0,h.jsx)(m,{value:O,children:(0,h.jsx)(f,{value:A,children:j})})}O.displayName=`CollapsibleGroup`;export{v as i,T as n,b as r,O as t};
|