@theoremjs/studio 0.3.4-next.757.gde44a4d → 0.3.4-next.759.g46e0e27
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/compile.d.ts +3 -3
- package/compile.js +70 -101
- package/cookbooks/catalog.js +14 -28
- package/draft.d.ts +24 -28
- package/draft.js +11 -12
- package/guardrail-probe.js +1 -30
- package/mod.d.ts +2 -2
- package/mod.js +2 -2
- package/package.json +4 -4
- package/page/assets/{ConsoleFrame-D309UtSL.js → ConsoleFrame-IP80BbVy.js} +1 -1
- package/page/assets/{MenuBottomSheet-CVBLnUiO.js → MenuBottomSheet-B90IZU5_.js} +1 -1
- package/page/assets/{SchemaFields-muOTQM8x.js → SchemaFields-BBCNN0DQ.js} +1 -1
- package/page/assets/{ToolResultCharts-Bhesjbc4.js → ToolResultCharts-BA5C4s_d.js} +1 -1
- package/page/assets/{Toolbar-t4I6MDV_.js → Toolbar-cLeL30W1.js} +1 -1
- package/page/assets/{TraceInspector-BqEGN_46.js → TraceInspector-6xElMxMt.js} +1 -1
- package/page/assets/{TraceOverview-DLEqvRF2.js → TraceOverview-BgjbNvh5.js} +1 -1
- package/page/assets/{_virtual_studio-type-sources-Cc4WAdgD.js → _virtual_studio-type-sources-_88V0ngH.js} +37 -44
- package/page/assets/browser-connection-C1_PJcSQ.js +1 -0
- package/page/assets/browser-engine-VzmlJFEv.js +16 -0
- package/page/assets/browser-transport-JN5LOARG.js +45 -0
- package/page/assets/compile-BJuLB_as.js +2 -0
- package/page/assets/{encode-files-CeZxxjYd.js → encode-files-CCet4LKE.js} +1 -1
- package/page/assets/{export-agent-CYZqQ4ll.js → export-agent-BzdhT7lw.js} +8 -8
- package/page/assets/{guardrail-tester-D-_i4Zuj.js → guardrail-tester-M-A7EKhq.js} +1 -1
- package/page/assets/index-BHZr7HfC.js +149 -0
- package/page/assets/index-BYDlXF8Q.css +1 -0
- package/page/assets/live-messages-tG47aB12.js +1 -0
- package/page/assets/{prompt-row-CIxkqX9Q.js → prompt-row-BUe2Ni0Y.js} +2 -2
- package/page/assets/reader-SzTjS7rw.js +5 -0
- package/page/assets/{registry-DP0ArymS.js → registry-BrmnEhgs.js} +1 -1
- package/page/assets/schema-BztznKB7.js +3 -0
- package/page/assets/{shaped-data-DCfLI4gb.js → shaped-data-D15FDUcH.js} +3 -3
- package/page/assets/{stub-REBz-ZC7.js → stub-CJG-5zBe.js} +1 -1
- package/page/assets/studio-code-pane-k8fWxZOU.js +10 -0
- package/page/assets/{studio-console-DHgwXKne.js → studio-console-BANFk07G.js} +1 -1
- package/page/assets/{studio-decision-B_EdxnvG.js → studio-decision-DFj8AA2c.js} +1 -1
- package/page/assets/{studio-embedding-mZIx4qHD.js → studio-embedding-CZy7UHg8.js} +1 -1
- package/page/assets/{studio-host-console-BmB0sSsX.js → studio-host-console-CRxuC6E-.js} +2 -2
- package/page/assets/{studio-labels-BRouZt4M.js → studio-labels-3Sq86Mzp.js} +1 -1
- package/page/assets/studio-live-BcOCiV63.js +5 -0
- package/page/assets/{studio-map-8aIk_pdY.js → studio-map-CCtcfniD.js} +1 -1
- package/page/assets/{studio-trace-replay-BaF2UAqT.js → studio-trace-replay-C5t6OfXY.js} +1 -1
- package/page/assets/{studio-type-checker-JZuu4iVI.js → studio-type-checker-o2Q6t4mP.js} +1 -1
- package/page/assets/{tool-schema-BwaPiLtT.js → tool-schema-D26IAEC3.js} +1 -1
- package/page/assets/trace-record-jocyYEPa.js +1 -0
- package/page/assets/tree-B0fXPCwG.js +3 -0
- package/page/assets/{turn-client-B3jV7UKH.js → turn-client-eM8VIbMd.js} +1 -1
- package/page/assets/{types-BDx4pnrt.js → types-CfC3vRXO.js} +1 -1
- package/page/assets/{use-one-call-BKLi6fk_.js → use-one-call-Drfw4kwV.js} +1 -1
- package/page/assets/{workspace-B6d08n7C.js → workspace-BlOYHATA.js} +1 -1
- package/page/index.html +17 -17
- package/prompt-doc.d.ts +1 -1
- package/prompt-doc.js +2 -2
- package/read-source.js +26 -39
- package/section-notes.d.ts +1 -2
- package/section-notes.js +1 -2
- package/system-markup.d.ts +1 -1
- package/system-markup.js +1 -1
- package/ui/lib/export-agent.js +9 -26
- package/ui/lib/studio-page.d.ts +9 -16
- package/ui/lib/studio-page.js +28 -38
- package/ui/profile-editor.js +46 -93
- package/ui/prompt-editor.d.ts +1 -1
- package/ui/prompt-editor.js +11 -11
- package/ui/prompt-line-node.d.ts +5 -5
- package/ui/prompt-line-node.js +9 -9
- package/ui/prompt-row.d.ts +3 -3
- package/ui/prompt-row.js +3 -3
- package/ui/studio-compare.d.ts +4 -2
- package/ui/studio-compare.js +6 -5
- package/ui/studio-live.d.ts +1 -1
- package/ui/studio-live.js +2 -2
- package/ui/studio-runner.d.ts +4 -3
- package/ui/studio-runner.js +9 -9
- package/ui/studio-screen.js +5 -2
- package/ui/studio.css +3 -3
- package/page/assets/browser-connection-159CdeHX.js +0 -1
- package/page/assets/browser-engine-Fi7MROTb.js +0 -16
- package/page/assets/browser-transport-C_sHZVPa.js +0 -45
- package/page/assets/compile-iB2CAmRL.js +0 -2
- package/page/assets/index-DakRjE8R.css +0 -1
- package/page/assets/index-DuTrjzLN.js +0 -149
- package/page/assets/live-messages-D-SPyR3e.js +0 -1
- package/page/assets/reader-DtOL_I1x.js +0 -5
- package/page/assets/schema-Cv4HAfBT.js +0 -3
- package/page/assets/studio-code-pane-DEBuOivy.js +0 -10
- package/page/assets/studio-live-Cy09vyLv.js +0 -5
- package/page/assets/trace-record--uEnDt_D.js +0 -1
- package/page/assets/tree-CL4ETBd5.js +0 -3
- package/slot-values.d.ts +0 -2
- package/slot-values.js +0 -22
package/compile.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DecisionAsset, type DecisionQuestion, type ImageProfileDefinition, type LiveProfileDefinition, type ProfileGuardrailsSpec, type SpeechProfileDefinition, type TextProfileDefinition, type TranscriptionProfileDefinition } from '@theoremjs/agents';
|
|
2
2
|
import { type DecisionProfileDefinition, type EmbeddingProfileDefinition, type HostProfileDefinition, type ProfileDefinition } from '@theoremjs/agents/kernel';
|
|
3
|
-
import type {
|
|
3
|
+
import type { GuardrailsDraft, OptionDraft, StudioDraft } from './draft.ts';
|
|
4
4
|
import type { StudioRunsOn } from './lent-keys.ts';
|
|
5
5
|
import { type StudioProvider } from './providers.ts';
|
|
6
6
|
import type { StructuredRegistration, ToolRegistration } from './registrations.ts';
|
|
@@ -45,8 +45,8 @@ export type AgentIdOf = (key: string) => string | undefined;
|
|
|
45
45
|
* `undefined` when none has that key or an agent tool can't run it.
|
|
46
46
|
*/
|
|
47
47
|
export type AgentToolInputOf = (key: string) => Record<string, unknown> | undefined;
|
|
48
|
-
/** The
|
|
49
|
-
export declare function
|
|
48
|
+
/** The options a draft declares so far: each one named with a value, the first of a name. */
|
|
49
|
+
export declare function draftOptions(options: readonly OptionDraft[]): OptionDraft[];
|
|
50
50
|
/** What a tool that runs this draft's agent takes, as the kernel derives it from the agent's inputs. */
|
|
51
51
|
export declare function agentToolInputSchema(draft: StudioDraft): Record<string, unknown> | undefined;
|
|
52
52
|
/** Why these headers can't be saved, when one of them looks like a credential. */
|
package/compile.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineProfile, describeError, liveIngressChannelDefault, TheoremError, } from '@theoremjs/agents';
|
|
2
2
|
import { BOUNDARIES, DETECT_DEFAULTS, DETECTOR_META, DETECTORS, detectProblem, hintProblem, patternListProblem, TOOL_BOUNDARIES, validateLabelOverrides, } from '@theoremjs/agents/guardrails';
|
|
3
|
-
import { activityLabelProblem, agentToolInputFor, agentToolOutput, jsonSchemaFromZod, mimeAllowed, outOfScopeFields, systemLinesProblem, } from '@theoremjs/agents/kernel';
|
|
3
|
+
import { activityLabelProblem, agentToolInputFor, agentToolOutput, jsonSchemaFromZod, mimeAllowed, optionsProblem, outOfScopeFields, systemLinesProblem, } from '@theoremjs/agents/kernel';
|
|
4
4
|
import { resolveObservabilityPolicy } from '@theoremjs/agents/observability';
|
|
5
5
|
import { HTTP_METHODS, IMAGE_ATTACHMENT_ACCEPT_MIMES, PROFILE_HANDLE_MAX_CHARS, PROFILE_ID_MAX_CHARS, } from '@theoremjs/agents/schema';
|
|
6
6
|
import { isCredentialName, MASK } from '@theoremjs/agents/surface';
|
|
@@ -289,38 +289,59 @@ const isAny = (_value) => true;
|
|
|
289
289
|
function parseHeaders(raw) {
|
|
290
290
|
return parseRecord(raw, isString);
|
|
291
291
|
}
|
|
292
|
-
/** The
|
|
293
|
-
export function
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
292
|
+
/** The options a draft declares so far: each one named with a value, the first of a name. */
|
|
293
|
+
export function draftOptions(options) {
|
|
294
|
+
const seen = new Set();
|
|
295
|
+
return options.flatMap((option) => {
|
|
296
|
+
const name = option.name.trim();
|
|
297
|
+
if (!name || option.choices.length === 0 || seen.has(name))
|
|
298
|
+
return [];
|
|
299
|
+
seen.add(name);
|
|
300
|
+
return [{ ...option, name }];
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/** A draft's options as a profile declares them. A blank label or description is left out. */
|
|
304
|
+
function compileOptions(options) {
|
|
305
|
+
if (options.length === 0)
|
|
306
|
+
return undefined;
|
|
307
|
+
return Object.fromEntries(options.map(({ name, label, choices }) => [
|
|
308
|
+
name,
|
|
309
|
+
{
|
|
310
|
+
...(label.trim() ? { label: label.trim() } : {}),
|
|
311
|
+
choices: choices.map(({ value, description }) => description.trim() ? { value, description: description.trim() } : { value }),
|
|
312
|
+
},
|
|
313
|
+
]));
|
|
301
314
|
}
|
|
302
|
-
/**
|
|
303
|
-
function
|
|
315
|
+
/** Says which value an option lists twice. */
|
|
316
|
+
function twiceListed({ choices }) {
|
|
317
|
+
const value = choices.find((choice, at) => choices.findIndex((each) => each.value === choice.value) !== at)?.value;
|
|
318
|
+
return value === undefined ? undefined : `${value} is listed twice.`;
|
|
319
|
+
}
|
|
320
|
+
/** What is wrong with each option, reported on its row. Gives whether any was. */
|
|
321
|
+
function reportOptions(options, report) {
|
|
304
322
|
const seen = new Set();
|
|
305
|
-
let
|
|
306
|
-
|
|
307
|
-
const named = name.trim();
|
|
308
|
-
if (!named &&
|
|
323
|
+
let isWrong = false;
|
|
324
|
+
options.forEach((option, at) => {
|
|
325
|
+
const named = option.name.trim();
|
|
326
|
+
if (!named && option.choices.length === 0)
|
|
309
327
|
return;
|
|
328
|
+
const declared = { [named]: { choices: option.choices.map(({ value }) => ({ value })) } };
|
|
310
329
|
const problem = !named
|
|
311
|
-
? 'This
|
|
330
|
+
? 'This option needs a name.'
|
|
312
331
|
: seen.has(named)
|
|
313
|
-
? `Two
|
|
314
|
-
:
|
|
332
|
+
? `Two options are called "${named}".`
|
|
333
|
+
: option.choices.length === 0
|
|
334
|
+
? 'This option needs a value.'
|
|
335
|
+
: (twiceListed(option) ?? optionsProblem(declared, undefined));
|
|
315
336
|
seen.add(named);
|
|
316
337
|
if (!problem)
|
|
317
338
|
return;
|
|
318
|
-
|
|
319
|
-
report('identity', problem, '
|
|
339
|
+
isWrong = true;
|
|
340
|
+
report('identity', problem, 'options', at);
|
|
320
341
|
});
|
|
321
|
-
return
|
|
342
|
+
return isWrong;
|
|
322
343
|
}
|
|
323
|
-
/** The prompt's lines and the
|
|
344
|
+
/** The prompt's lines and the options they read, each problem reported on the identity section. */
|
|
324
345
|
function compilePrompt(draft, report) {
|
|
325
346
|
const parsed = parseSystemMarkup(draft.identity.system);
|
|
326
347
|
if (!parsed.ok)
|
|
@@ -332,19 +353,16 @@ function compilePrompt(draft, report) {
|
|
|
332
353
|
: lines.length === 1 && typeof first === 'string'
|
|
333
354
|
? first
|
|
334
355
|
: lines;
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
const declared = Object.keys(conditions).length > 0 ? conditions : undefined;
|
|
342
|
-
if (system !== undefined && !wrong) {
|
|
343
|
-
const problem = systemLinesProblem(system, declared, slots);
|
|
356
|
+
const isWrong = reportOptions(draft.identity.options, report);
|
|
357
|
+
const declared = draftOptions(draft.identity.options);
|
|
358
|
+
const code = compileOptions(declared.filter((option) => !option.isShownInChat));
|
|
359
|
+
const person = compileOptions(declared.filter((option) => option.isShownInChat));
|
|
360
|
+
if (system !== undefined && !isWrong) {
|
|
361
|
+
const problem = systemLinesProblem(system, code, person);
|
|
344
362
|
if (problem)
|
|
345
363
|
report('identity', problem, 'system');
|
|
346
364
|
}
|
|
347
|
-
return { system,
|
|
365
|
+
return { system, code, person };
|
|
348
366
|
}
|
|
349
367
|
/** A record field's value, reporting `message` on `field` when it doesn't parse. */
|
|
350
368
|
function recordField(raw, isValue, report) {
|
|
@@ -445,7 +463,7 @@ export function agentToolInputSchema(draft) {
|
|
|
445
463
|
if (type !== 'text' && type !== 'image' && type !== 'speech')
|
|
446
464
|
return undefined;
|
|
447
465
|
const inputs = type !== 'speech' && draftFacets(draft).includes('inputs')
|
|
448
|
-
? compileInputs(draft.inputs, type, () => { })
|
|
466
|
+
? compileInputs(draft.inputs, compilePrompt(draft, () => { }).person, type, () => { })
|
|
449
467
|
: undefined;
|
|
450
468
|
return jsonSchemaFromZod(agentToolInputFor({ type, ...(inputs ? { inputs } : {}) }), 'input');
|
|
451
469
|
}
|
|
@@ -672,7 +690,7 @@ function compileTools(draft, withLoader, withParallel, report, agentIdOf, agentI
|
|
|
672
690
|
tools: { allow, ...(t2Loader ? { t2Loader } : {}), ...(parallel ? { parallel } : {}) },
|
|
673
691
|
};
|
|
674
692
|
}
|
|
675
|
-
function compileInputs(inputs, type, report) {
|
|
693
|
+
function compileInputs(inputs, options, type, report) {
|
|
676
694
|
const outside = type === 'image'
|
|
677
695
|
? inputs.attachmentsAccept.filter((rule) => !mimeAllowed(IMAGE_ATTACHMENT_ACCEPT_MIMES, rule))
|
|
678
696
|
: [];
|
|
@@ -698,7 +716,6 @@ function compileInputs(inputs, type, report) {
|
|
|
698
716
|
checkWhole(report, 'inputs', 'maxBytes', 'Max bytes', inputs.maxBytes, 1);
|
|
699
717
|
checkWhole(report, 'inputs', 'maxTurnBytes', 'Max turn bytes', inputs.maxTurnBytes, 1);
|
|
700
718
|
const limitsByMime = compileLimitsByMime(inputs, report);
|
|
701
|
-
const slots = compileSlots(inputs, report);
|
|
702
719
|
const context = compileContext(inputs, report);
|
|
703
720
|
return {
|
|
704
721
|
...(inputs.text ? {} : { text: false }),
|
|
@@ -710,7 +727,7 @@ function compileInputs(inputs, type, report) {
|
|
|
710
727
|
...(inputs.maxBytes !== null ? { maxBytes: inputs.maxBytes } : {}),
|
|
711
728
|
...(inputs.maxTurnBytes !== null ? { maxTurnBytes: inputs.maxTurnBytes } : {}),
|
|
712
729
|
...(limitsByMime ? { limitsByMime } : {}),
|
|
713
|
-
...(
|
|
730
|
+
...(options ? { options } : {}),
|
|
714
731
|
...(context ? { context } : {}),
|
|
715
732
|
};
|
|
716
733
|
}
|
|
@@ -734,64 +751,16 @@ function compileLimitsByMime(inputs, report) {
|
|
|
734
751
|
}
|
|
735
752
|
return entries.length ? { ...inputs.limitsByMime } : undefined;
|
|
736
753
|
}
|
|
737
|
-
/**
|
|
738
|
-
function
|
|
739
|
-
const name = slot.name.trim();
|
|
740
|
-
const problems = [];
|
|
741
|
-
if (!name)
|
|
742
|
-
problems.push('Name this slot.');
|
|
743
|
-
else if (slots.findIndex((other) => other.name.trim() === name) < at) {
|
|
744
|
-
problems.push(`Another slot is called ${name}.`);
|
|
745
|
-
}
|
|
746
|
-
const values = slot.choices.map((choice) => choice.value.trim());
|
|
747
|
-
if (!values.some(Boolean))
|
|
748
|
-
problems.push('Give this slot a choice.');
|
|
749
|
-
if (slot.choices.some((choice, index) => !values[index] && choice.description.trim())) {
|
|
750
|
-
problems.push('Every choice with a description needs a value.');
|
|
751
|
-
}
|
|
752
|
-
const repeated = values.filter((value, index) => value && values.indexOf(value) < index);
|
|
753
|
-
for (const value of new Set(repeated))
|
|
754
|
-
problems.push(`${value} is a choice twice.`);
|
|
755
|
-
return problems;
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Each slot by name. A slot with no label and no descriptions is its list of values; any other
|
|
759
|
-
* is `{ label?, choices }`. A choice left blank is left out.
|
|
760
|
-
*/
|
|
761
|
-
function compileSlots(inputs, report) {
|
|
762
|
-
if (!inputs.slots.length)
|
|
763
|
-
return undefined;
|
|
764
|
-
inputs.slots.forEach((slot, at) => {
|
|
765
|
-
for (const problem of slotProblems(slot, at, inputs.slots)) {
|
|
766
|
-
report('inputs', problem, 'slots', at);
|
|
767
|
-
}
|
|
768
|
-
});
|
|
769
|
-
return Object.fromEntries(inputs.slots.map((slot) => {
|
|
770
|
-
const label = slot.label.trim();
|
|
771
|
-
const choices = slot.choices
|
|
772
|
-
.filter((choice) => choice.value.trim())
|
|
773
|
-
.map((choice) => ({ value: choice.value.trim(), description: choice.description.trim() }));
|
|
774
|
-
const plain = !label && choices.every((choice) => !choice.description);
|
|
775
|
-
const decl = plain
|
|
776
|
-
? choices.map((choice) => choice.value)
|
|
777
|
-
: {
|
|
778
|
-
...(label ? { label } : {}),
|
|
779
|
-
choices: choices.map(({ value, description }) => description ? { value, description } : { value }),
|
|
780
|
-
};
|
|
781
|
-
return [slot.name.trim(), decl];
|
|
782
|
-
}));
|
|
783
|
-
}
|
|
784
|
-
/** A call profile's inputs are its slots and context, and are left out when it has neither. */
|
|
785
|
-
function compileLiveInputs(inputs, report) {
|
|
786
|
-
const slots = compileSlots(inputs, report);
|
|
754
|
+
/** A call profile's inputs are its options and context, and are left out when it has neither. */
|
|
755
|
+
function compileLiveInputs(inputs, options, report) {
|
|
787
756
|
const context = compileContext(inputs, report);
|
|
788
|
-
if (!
|
|
757
|
+
if (!options && !context)
|
|
789
758
|
return {};
|
|
790
|
-
return { inputs: { ...(
|
|
759
|
+
return { inputs: { ...(options ? { options } : {}), ...(context ? { context } : {}) } };
|
|
791
760
|
}
|
|
792
|
-
/** The shapes
|
|
793
|
-
function
|
|
794
|
-
const {
|
|
761
|
+
/** The shapes an option's value picks: its schemas, and what `outputs.structured` writes. */
|
|
762
|
+
function compileOptionShapes(outputs, fallback, report) {
|
|
763
|
+
const { option, shapes } = outputs.byOption ?? { option: '', shapes: [] };
|
|
795
764
|
const also = [];
|
|
796
765
|
const map = {};
|
|
797
766
|
for (const shape of shapes) {
|
|
@@ -803,7 +772,7 @@ function compileSlotShapes(outputs, fallback, report) {
|
|
|
803
772
|
map[shape.choice] = shape.schemaId;
|
|
804
773
|
}
|
|
805
774
|
}
|
|
806
|
-
return also.length ? { also, written: { by:
|
|
775
|
+
return also.length ? { also, written: { by: option, map, fallback } } : undefined;
|
|
807
776
|
}
|
|
808
777
|
/** `shaped`: the type takes a structured reply and its validation (text only). */
|
|
809
778
|
function compileOutputs(outputs, shaped, report) {
|
|
@@ -821,9 +790,9 @@ function compileOutputs(outputs, shaped, report) {
|
|
|
821
790
|
structured = { id, spec: { jsonSchema: schema.schema } };
|
|
822
791
|
}
|
|
823
792
|
}
|
|
824
|
-
const
|
|
825
|
-
if (structured &&
|
|
826
|
-
structured = { ...structured, also:
|
|
793
|
+
const byOption = structured && compileOptionShapes(outputs, structured.id, report);
|
|
794
|
+
if (structured && byOption)
|
|
795
|
+
structured = { ...structured, also: byOption.also };
|
|
827
796
|
if (validationEnabled) {
|
|
828
797
|
checkWhole(report, 'outputs', 'maxRetries', 'Validation max retries', outputs.maxRetries, 0);
|
|
829
798
|
}
|
|
@@ -843,7 +812,7 @@ function compileOutputs(outputs, shaped, report) {
|
|
|
843
812
|
...(outputs.streamThoughts ? {} : { streamThoughts: false }),
|
|
844
813
|
};
|
|
845
814
|
const spec = {
|
|
846
|
-
...(structured ? { structured:
|
|
815
|
+
...(structured ? { structured: byOption?.written ?? structured.id } : {}),
|
|
847
816
|
...(Object.keys(validation).length ? { validation } : {}),
|
|
848
817
|
...(Object.keys(streaming).length ? { streaming } : {}),
|
|
849
818
|
};
|
|
@@ -1672,7 +1641,7 @@ function compileHost(draft, report, agentIdOf, agentInputOf) {
|
|
|
1672
1641
|
function assemble(draft, type, report, on, agentIdOf, agentInputOf) {
|
|
1673
1642
|
const facets = new Set(draftFacets(draft));
|
|
1674
1643
|
const allows = (path) => draftAllows(draft, path);
|
|
1675
|
-
const { system,
|
|
1644
|
+
const { system, code, person } = compilePrompt(draft, report);
|
|
1676
1645
|
const modelFields = compileModels(draft, type, report, agentIdOf);
|
|
1677
1646
|
const { outputs, structured } = facets.has('outputs')
|
|
1678
1647
|
? compileOutputs(draft.outputs, allows('outputs.structured'), report)
|
|
@@ -1691,7 +1660,7 @@ function assemble(draft, type, report, on, agentIdOf, agentInputOf) {
|
|
|
1691
1660
|
id: draft.identity.agentId.trim(),
|
|
1692
1661
|
identity: {
|
|
1693
1662
|
handle: draft.identity.handle.trim(),
|
|
1694
|
-
...(
|
|
1663
|
+
...(code ? { options: code } : {}),
|
|
1695
1664
|
...(system ? { system } : {}),
|
|
1696
1665
|
},
|
|
1697
1666
|
...modelFields,
|
|
@@ -1702,8 +1671,8 @@ function assemble(draft, type, report, on, agentIdOf, agentInputOf) {
|
|
|
1702
1671
|
...(!facets.has('inputs')
|
|
1703
1672
|
? {}
|
|
1704
1673
|
: type === 'live'
|
|
1705
|
-
? compileLiveInputs(draft.inputs, report)
|
|
1706
|
-
: { inputs: compileInputs(draft.inputs, type, report) }),
|
|
1674
|
+
? compileLiveInputs(draft.inputs, person, report)
|
|
1675
|
+
: { inputs: compileInputs(draft.inputs, person, type, report) }),
|
|
1707
1676
|
...(outputs ? { outputs } : {}),
|
|
1708
1677
|
...(turnBehaviour ? { turnBehaviour } : {}),
|
|
1709
1678
|
...(guardrails ? { guardrails } : {}),
|
package/cookbooks/catalog.js
CHANGED
|
@@ -385,7 +385,7 @@ function exampleTextDraft(identity, tools) {
|
|
|
385
385
|
const inputs = demoInputsSpec();
|
|
386
386
|
return {
|
|
387
387
|
...blank,
|
|
388
|
-
identity: { ...identity, profileType: 'text'
|
|
388
|
+
identity: { options: [], ...identity, profileType: 'text' },
|
|
389
389
|
included: ['outputs', 'turnBehaviour', 'guardrails', 'observability', 'labels'],
|
|
390
390
|
models: { defaultModel: 'open', allowModelSelect: true, maxSteps: 12, key: 'gemini' },
|
|
391
391
|
modelBindings: defaultTextModelBindings(),
|
|
@@ -398,7 +398,6 @@ function exampleTextDraft(identity, tools) {
|
|
|
398
398
|
maxBytes: inputs.maxBytes,
|
|
399
399
|
maxTurnBytes: inputs.maxTurnBytes,
|
|
400
400
|
limitsByMime: {},
|
|
401
|
-
slots: [],
|
|
402
401
|
contextFrom: [],
|
|
403
402
|
contextMaxChars: null,
|
|
404
403
|
},
|
|
@@ -520,6 +519,10 @@ export function createResearchScoutDraft() {
|
|
|
520
519
|
agentId: 'research.scout',
|
|
521
520
|
handle: 'scout',
|
|
522
521
|
system: [DEMO_RESEARCH_SYSTEM, ...RESEARCH_READER_LINES].join('\n\n'),
|
|
522
|
+
options: [
|
|
523
|
+
researchOption('focus', 'Focus', [RESEARCH_MODELS_FOCUS, 'arXiv', 'GitHub', 'Anywhere']),
|
|
524
|
+
researchOption('reader', 'Reader', ['anyone', 'reviewer', 'student']),
|
|
525
|
+
],
|
|
523
526
|
}, { tools: { t2Loader: '', parallel: true }, toolSpecs: exampleTools(DEMO_RESEARCH_TOOLS) });
|
|
524
527
|
return {
|
|
525
528
|
...base,
|
|
@@ -531,7 +534,6 @@ export function createResearchScoutDraft() {
|
|
|
531
534
|
maxFiles: null,
|
|
532
535
|
maxBytes: null,
|
|
533
536
|
maxTurnBytes: null,
|
|
534
|
-
slots: [researchFocusSlot(), researchReaderSlot()],
|
|
535
537
|
},
|
|
536
538
|
models: {
|
|
537
539
|
defaultModel: 'open',
|
|
@@ -583,8 +585,8 @@ export function createResearchScoutDraft() {
|
|
|
583
585
|
mode: 'structured',
|
|
584
586
|
schemaId: RESEARCH_REPLY_SCHEMA_ID,
|
|
585
587
|
schemaJson: RESEARCH_REPLY_SCHEMA_JSON,
|
|
586
|
-
|
|
587
|
-
|
|
588
|
+
byOption: {
|
|
589
|
+
option: 'focus',
|
|
588
590
|
shapes: [
|
|
589
591
|
{
|
|
590
592
|
choice: RESEARCH_MODELS_FOCUS,
|
|
@@ -616,30 +618,14 @@ const RESEARCH_READER_LINES = [
|
|
|
616
618
|
];
|
|
617
619
|
/** The focus that answers in `research.models`. */
|
|
618
620
|
const RESEARCH_MODELS_FOCUS = 'Hugging Face Open Research';
|
|
619
|
-
/**
|
|
620
|
-
function
|
|
621
|
-
return {
|
|
622
|
-
key: draftKey('slot'),
|
|
623
|
-
name: 'focus',
|
|
624
|
-
label: 'Focus',
|
|
625
|
-
choices: [RESEARCH_MODELS_FOCUS, 'arXiv', 'GitHub', 'Anywhere'].map((value) => ({
|
|
626
|
-
key: draftKey('choice'),
|
|
627
|
-
value,
|
|
628
|
-
description: '',
|
|
629
|
-
})),
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
/** Who the scout writes for, which picks its lines in `RESEARCH_READER_LINES`. */
|
|
633
|
-
function researchReaderSlot() {
|
|
621
|
+
/** A shown option with these values. */
|
|
622
|
+
function researchOption(name, label, values) {
|
|
634
623
|
return {
|
|
635
|
-
key: draftKey('
|
|
636
|
-
name
|
|
637
|
-
label
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
value,
|
|
641
|
-
description: '',
|
|
642
|
-
})),
|
|
624
|
+
key: draftKey('option'),
|
|
625
|
+
name,
|
|
626
|
+
label,
|
|
627
|
+
isShownInChat: true,
|
|
628
|
+
choices: values.map((value) => ({ key: draftKey('choice'), value, description: '' })),
|
|
643
629
|
};
|
|
644
630
|
}
|
|
645
631
|
/** Flags a page that says its paper was taken back. */
|
package/draft.d.ts
CHANGED
|
@@ -15,11 +15,23 @@ export type StudioProfileType = ProfileType;
|
|
|
15
15
|
/** The types that run a model turn; a decision asks questions, and a host runs its tools. */
|
|
16
16
|
export type StudioTurnProfileType = Exclude<StudioProfileType, 'decision' | 'host'>;
|
|
17
17
|
export declare const STUDIO_PROFILE_TYPES: readonly StudioProfileType[];
|
|
18
|
-
/**
|
|
19
|
-
export interface
|
|
18
|
+
/** One value an option can take, and what the page says about it. */
|
|
19
|
+
export interface OptionChoiceDraft {
|
|
20
|
+
key: string;
|
|
21
|
+
value: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One named option: what lines of the prompt read and print, the page's label for it, and its
|
|
26
|
+
* values. Shown in chat, a person picks it and it compiles to `inputs.options`; otherwise the
|
|
27
|
+
* host's code states it and it compiles to `identity.options`.
|
|
28
|
+
*/
|
|
29
|
+
export interface OptionDraft {
|
|
20
30
|
key: string;
|
|
21
31
|
name: string;
|
|
22
|
-
|
|
32
|
+
label: string;
|
|
33
|
+
isShownInChat: boolean;
|
|
34
|
+
choices: OptionChoiceDraft[];
|
|
23
35
|
}
|
|
24
36
|
export interface IdentityDraft {
|
|
25
37
|
agentId: string;
|
|
@@ -30,7 +42,7 @@ export interface IdentityDraft {
|
|
|
30
42
|
* `{private: …}`. Unused on speech, which has no system channel.
|
|
31
43
|
*/
|
|
32
44
|
system: string;
|
|
33
|
-
|
|
45
|
+
options: OptionDraft[];
|
|
34
46
|
}
|
|
35
47
|
export interface ModelsDraft {
|
|
36
48
|
/** Who holds the conversation a saved state continues; unset is the kernel's default, the host. */
|
|
@@ -155,19 +167,6 @@ export interface ToolsDraft {
|
|
|
155
167
|
export interface ToolSpecDraft extends StudioToolSpecSeed {
|
|
156
168
|
key: string;
|
|
157
169
|
}
|
|
158
|
-
/** One value a slot can take, and what the page says about it. */
|
|
159
|
-
export interface SlotChoiceDraft {
|
|
160
|
-
key: string;
|
|
161
|
-
value: string;
|
|
162
|
-
description: string;
|
|
163
|
-
}
|
|
164
|
-
/** One named choice a turn can make: its `{name}`, the page's label for it, and its values. */
|
|
165
|
-
export interface SlotDraft {
|
|
166
|
-
key: string;
|
|
167
|
-
name: string;
|
|
168
|
-
label: string;
|
|
169
|
-
choices: SlotChoiceDraft[];
|
|
170
|
-
}
|
|
171
170
|
export interface InputsDraft {
|
|
172
171
|
text: boolean;
|
|
173
172
|
attachmentsAccept: string[];
|
|
@@ -177,16 +176,14 @@ export interface InputsDraft {
|
|
|
177
176
|
maxTurnBytes: number | null;
|
|
178
177
|
/** The largest file of each type (or `type/*` family), in bytes, in place of `maxBytes`. */
|
|
179
178
|
limitsByMime: Record<string, number>;
|
|
180
|
-
/** Named choices a turn can make; none omits `inputs.slots`. */
|
|
181
|
-
slots: SlotDraft[];
|
|
182
179
|
/** Who may send the agent context; none omits `inputs.context`. */
|
|
183
180
|
contextFrom: ContextSender[];
|
|
184
181
|
/** The longest context package from each sender, in characters of JSON. */
|
|
185
182
|
contextMaxChars: number | null;
|
|
186
183
|
}
|
|
187
|
-
/** The reply shapes
|
|
188
|
-
export interface
|
|
189
|
-
|
|
184
|
+
/** The reply shapes an option's value picks; any other value takes the outputs' own schema. */
|
|
185
|
+
export interface OptionShapesDraft {
|
|
186
|
+
option: string;
|
|
190
187
|
shapes: {
|
|
191
188
|
choice: string;
|
|
192
189
|
schemaId: string;
|
|
@@ -197,7 +194,7 @@ export interface OutputsDraft {
|
|
|
197
194
|
mode: 'text' | 'structured';
|
|
198
195
|
schemaId: string;
|
|
199
196
|
schemaJson: string;
|
|
200
|
-
|
|
197
|
+
byOption?: OptionShapesDraft;
|
|
201
198
|
/** `''` omits it (kernel default: SSE). */
|
|
202
199
|
streamMode: '' | StreamMode;
|
|
203
200
|
streamThoughts: boolean;
|
|
@@ -422,7 +419,7 @@ export interface StudioDraft {
|
|
|
422
419
|
decision: DecisionDraft;
|
|
423
420
|
labels: LabelsDraft;
|
|
424
421
|
}
|
|
425
|
-
export declare function draftKey(prefix: 'agent' | '
|
|
422
|
+
export declare function draftKey(prefix: 'agent' | 'entry' | 'model' | 'tool' | 'question' | 'criterion' | 'reference' | 'image' | 'option' | 'choice'): string;
|
|
426
423
|
export declare function defaultModelBinding(partial?: Partial<ModelBindingDraft>): ModelBindingDraft;
|
|
427
424
|
export declare function defaultToolSpec(partial?: Partial<ToolSpecDraft>): ToolSpecDraft;
|
|
428
425
|
/**
|
|
@@ -454,10 +451,9 @@ export declare function newDecisionImage(draft: StudioDraft, file: string, image
|
|
|
454
451
|
mimeType: string;
|
|
455
452
|
data: string;
|
|
456
453
|
}): DecisionImageDraft;
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
export declare function
|
|
460
|
-
export declare function newSlotChoice(): SlotChoiceDraft;
|
|
454
|
+
export declare function newOption(): OptionDraft;
|
|
455
|
+
/** One row per value, each keeping the row its value already had. */
|
|
456
|
+
export declare function optionChoices(values: readonly string[], current: readonly OptionChoiceDraft[]): OptionChoiceDraft[];
|
|
461
457
|
/** One blank row: an option, a level, or a criterion. */
|
|
462
458
|
export declare function newCriterion(): DecisionCriterionDraft;
|
|
463
459
|
/** The rows a question of `type` starts with: two options, two levels, or none. */
|
package/draft.js
CHANGED
|
@@ -242,16 +242,16 @@ 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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
245
|
+
export function newOption() {
|
|
246
|
+
return { key: draftKey('option'), name: '', label: '', isShownInChat: false, choices: [] };
|
|
247
|
+
}
|
|
248
|
+
/** One row per value, each keeping the row its value already had. */
|
|
249
|
+
export function optionChoices(values, current) {
|
|
250
|
+
return values.map((value) => current.find((choice) => choice.value === value) ?? {
|
|
251
|
+
key: draftKey('choice'),
|
|
252
|
+
value,
|
|
253
|
+
description: '',
|
|
254
|
+
});
|
|
255
255
|
}
|
|
256
256
|
/** One blank row: an option, a level, or a criterion. */
|
|
257
257
|
export function newCriterion() {
|
|
@@ -283,7 +283,7 @@ export function createBlankDraft() {
|
|
|
283
283
|
profileType: '',
|
|
284
284
|
handle: '',
|
|
285
285
|
system: '',
|
|
286
|
-
|
|
286
|
+
options: [],
|
|
287
287
|
},
|
|
288
288
|
included: ['observability', 'labels'],
|
|
289
289
|
models: { defaultModel: '', allowModelSelect: false, maxSteps: null, key: '' },
|
|
@@ -299,7 +299,6 @@ export function createBlankDraft() {
|
|
|
299
299
|
maxBytes: null,
|
|
300
300
|
maxTurnBytes: null,
|
|
301
301
|
limitsByMime: {},
|
|
302
|
-
slots: [],
|
|
303
302
|
contextFrom: [],
|
|
304
303
|
contextMaxChars: null,
|
|
305
304
|
},
|
package/guardrail-probe.js
CHANGED
|
@@ -12,7 +12,6 @@ import { actionAt, DETECTORS, resolveDetect, sanitizeTurnRequestWithEvents, TOOL
|
|
|
12
12
|
import { ANSWER_TOOL, keySlotsOf, } from '@theoremjs/agents/kernel';
|
|
13
13
|
import { firstServed } from "./policy.js";
|
|
14
14
|
import { agentCallHook, runtimeProvider, writtenScope, } from "./runtime-scope.js";
|
|
15
|
-
import { choiceValues } from "./slot-values.js";
|
|
16
15
|
import { sampleFromJsonSchema } from "./tool-schema.js";
|
|
17
16
|
/** Where a probe's text enters the turn. */
|
|
18
17
|
export const PROBE_BOUNDARIES = [
|
|
@@ -615,43 +614,15 @@ function assertProbeable(profile, probe) {
|
|
|
615
614
|
throw new TheoremError('request', `A probe is at most ${PROBE_TEXT_LIMIT} characters.`); // labels-exempt: builder diagnostic
|
|
616
615
|
}
|
|
617
616
|
}
|
|
618
|
-
/**
|
|
619
|
-
* What a turn of `definition` states, each on its first value, as the studio's page opens them.
|
|
620
|
-
* why: The kernel refuses a turn that leaves a prompt line's condition or slot unset, and a probe
|
|
621
|
-
* has no page to pick them.
|
|
622
|
-
*/
|
|
623
|
-
function statedByFirstValues(definition) {
|
|
624
|
-
const inputs = 'inputs' in definition ? definition.inputs : undefined;
|
|
625
|
-
const declaredSlots = inputs && 'slots' in inputs ? inputs.slots : undefined;
|
|
626
|
-
const slots = Object.entries(declaredSlots ?? {}).flatMap(([name, decl]) => {
|
|
627
|
-
const value = choiceValues(decl)?.[0];
|
|
628
|
-
return value === undefined ? [] : [[name, value]];
|
|
629
|
-
});
|
|
630
|
-
const identity = 'identity' in definition ? definition.identity : undefined;
|
|
631
|
-
const declared = identity && 'conditions' in identity ? identity.conditions : undefined;
|
|
632
|
-
const { path, ...conditions } = Object.fromEntries(Object.entries(declared ?? {}).map(([name, values]) => [name, values[0] ?? '']));
|
|
633
|
-
return {
|
|
634
|
-
slots: Object.fromEntries(slots),
|
|
635
|
-
turn: {
|
|
636
|
-
...(path === undefined ? {} : { path }),
|
|
637
|
-
...(declared ? { conditions } : {}),
|
|
638
|
-
},
|
|
639
|
-
};
|
|
640
|
-
}
|
|
641
617
|
/** Where a probe runs: a host or a live agent calls the tool, any other takes a turn. */
|
|
642
618
|
function probeStream(run) {
|
|
643
619
|
const { scope, profile, probe, signal, onAgentCall, sink } = run;
|
|
644
620
|
if (run.definition.type === 'host' || run.definition.type === 'live') {
|
|
645
621
|
return scope.invokeTool({ profile: profile.id, ...hostCall(probe), signal, onAgentCall }, sink);
|
|
646
622
|
}
|
|
647
|
-
const stated = statedByFirstValues(run.definition);
|
|
648
623
|
return scope.runTurn({
|
|
649
624
|
profile: profile.id,
|
|
650
|
-
input:
|
|
651
|
-
...turnInput(probe),
|
|
652
|
-
...(Object.keys(stated.slots).length ? { slots: stated.slots } : {}),
|
|
653
|
-
},
|
|
654
|
-
...stated.turn,
|
|
625
|
+
input: turnInput(probe),
|
|
655
626
|
...(probe.boundary === 'system' ? { system: probe.text } : {}),
|
|
656
627
|
signal,
|
|
657
628
|
onAgentCall,
|
package/mod.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { KNOWN_GEMINI_EMBEDDING_MODELS, KNOWN_OPENROUTER_EMBEDDING_MODELS, } from './browser-connection.ts';
|
|
2
|
-
export { type CompiledStudio, compileStudio, credentialHeaderProblem, credentialUrlProblem,
|
|
2
|
+
export { type CompiledStudio, compileStudio, credentialHeaderProblem, credentialUrlProblem, draftOptions, type StudioCompileResult, type StudioIssue, type StudioProfileDefinition, type StudioTurnProfileDefinition, } from './compile.ts';
|
|
3
3
|
export { type CompiledWorkspace, compileWorkspace, type WorkspaceCompileResult, workspaceRunAgent, } from './compile-workspace.ts';
|
|
4
4
|
export type { CookbookEntry, CookbookId, CookbookIncludeTag, CookbookTags, GoogleBindingViolation, GoogleFreeTierGrounding, GoogleImageAspectRatio, GoogleImageInputMime, GoogleImageOutputMime, GoogleImagePins, GoogleImageResolution, GoogleLivePins, GoogleSpeechPins, GoogleSpeechVoice, GoogleThinkingLevel, GoogleVoiceInputMime, LocalBindingViolation, ProfileSliceOptions, StitchRecipe, ToolSliceField, ToolSliceOptions, } from './cookbooks/mod.ts';
|
|
5
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.ts';
|
|
6
|
-
export { agentToolTarget, COMPACTION_DRAFT_DEFAULTS,
|
|
6
|
+
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, newCriterion, newDecisionImage, newDecisionQuestion, newModelBinding, newOption, newOwnDetector, newPattern, newToolSpec, type ObservabilityDraft, type OptionChoiceDraft, type OptionDraft, type OutputsDraft, type OwnDetectorDraft, optionChoices, 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';
|
|
7
7
|
export { EXAMPLE_EMBEDDING_FILES } from './example-embedding-files.ts';
|
|
8
8
|
export type { GuardrailProbe, GuardrailProbeAnswer, GuardrailProbeDraft, GuardrailProbeResult, ProbeBoundary, ProbeBoundaryNote, ProbeStatus, } from './guardrail-probe.ts';
|
|
9
9
|
export { PROBE_BOUNDARIES, PROBE_BOUNDARY_NOTES, PROBE_STATUSES, PROBE_TEXT_LIMIT, probeDraft, probeRefusal, runGuardrailProbe, runGuardrailProbes, } from './guardrail-probe.ts';
|
package/mod.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { KNOWN_GEMINI_EMBEDDING_MODELS, KNOWN_OPENROUTER_EMBEDDING_MODELS, } from "./browser-connection.js";
|
|
2
|
-
export { compileStudio, credentialHeaderProblem, credentialUrlProblem,
|
|
2
|
+
export { compileStudio, credentialHeaderProblem, credentialUrlProblem, draftOptions, } from "./compile.js";
|
|
3
3
|
export { compileWorkspace, workspaceRunAgent, } from "./compile-workspace.js";
|
|
4
4
|
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";
|
|
5
|
-
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,
|
|
5
|
+
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, newCriterion, newDecisionImage, newDecisionQuestion, newModelBinding, newOption, newOwnDetector, newPattern, newToolSpec, optionChoices, plantsCanary, removeModelBinding, STUDIO_PROFILE_TYPES, setProfileType, TIMER_MAX_MS, takesContinueInstruction, updateModelBinding, } from "./draft.js";
|
|
6
6
|
export { EXAMPLE_EMBEDDING_FILES } from "./example-embedding-files.js";
|
|
7
7
|
export { PROBE_BOUNDARIES, PROBE_BOUNDARY_NOTES, PROBE_STATUSES, PROBE_TEXT_LIMIT, probeDraft, probeRefusal, runGuardrailProbe, runGuardrailProbes, } from "./guardrail-probe.js";
|
|
8
8
|
export { unheldProblem } from "./held-credentials.js";
|