@theoremjs/studio 0.3.4-next.528.g44c76f9 → 0.3.4-next.540.g67b727f
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 +4 -1
- package/browser-connection.js +1 -1
- package/compile-workspace.js +26 -7
- package/compile.js +13 -2
- package/{example.d.ts → cookbooks/catalog.d.ts} +35 -5
- package/cookbooks/catalog.js +686 -0
- package/cookbooks/checks.d.ts +10 -0
- package/cookbooks/checks.js +93 -0
- package/cookbooks/exchanges.d.ts +11 -0
- package/cookbooks/exchanges.js +13 -0
- package/cookbooks/fixtures/research.trace.json +4455 -0
- package/cookbooks/mod.d.ts +8 -0
- package/cookbooks/mod.js +5 -0
- package/cookbooks/project.d.ts +66 -0
- package/cookbooks/project.js +195 -0
- package/cookbooks/providers.d.ts +165 -0
- package/cookbooks/providers.js +289 -0
- package/cookbooks/sources.d.ts +10 -0
- package/cookbooks/sources.js +125 -0
- package/cookbooks/tools.d.ts +23 -0
- package/{concierge-demo.js → cookbooks/tools.js} +428 -42
- package/map.js +3 -1
- package/mod.d.ts +3 -3
- package/mod.js +2 -3
- package/package.json +4 -4
- package/page/assets/{Banner-BhKnM-76.js → Banner-BwxDeFY1.js} +2 -2
- package/page/assets/{ConsoleFrame-CnGU8SiE.js → ConsoleFrame-Dewh6VXK.js} +1 -1
- package/page/assets/{ContextMenu-G2oYmfwG.js → ContextMenu-0p_1Utr-.js} +2 -2
- package/page/assets/{ToolResultCharts-DpaHoQFj.js → ToolResultCharts-ei_o_wTg.js} +1 -1
- package/page/assets/{TraceInspector-Bo0PzFVf.js → TraceInspector-DyQAWqOG.js} +1 -1
- package/page/assets/{TraceOverview-CM-sd2zM.js → TraceOverview-BawPHDUZ.js} +1 -1
- package/page/assets/{_virtual_studio-type-sources-DVbxNwnP.js → _virtual_studio-type-sources-C1mRXxbj.js} +29 -250
- package/page/assets/browser-engine-BBhaQ73h.js +11 -0
- package/page/assets/browser-transport-BMGb5bKR.js +47 -0
- package/page/assets/{compile-egress-BRGW9qfO.js → compile-egress-C3etX-3o.js} +1 -1
- package/page/assets/{crypto-BAY2nUlu.js → crypto-Dd6XxhqK.js} +1 -1
- package/page/assets/{encode-files-BSTfq_Gp.js → encode-files-CiyHxnUC.js} +1 -1
- package/page/assets/{export-agent-CtklkKZk.js → export-agent-CIOzkXW7.js} +2 -2
- package/page/assets/{guardrail-tester-BXROlU1L.js → guardrail-tester-Vn3HjOBN.js} +1 -1
- package/page/assets/host-patterns-F-KZIzkF.js +1 -0
- package/page/assets/{index-DbHspDC4.js → index-CQx3WisY.js} +120 -72
- package/page/assets/{live-ingress-qi-y5uvH.js → live-ingress-OuSlQ6q7.js} +1 -1
- package/page/assets/{live-messages-DIf_R-NT.js → live-messages-BNhCuiuF.js} +1 -1
- package/page/assets/reader-BT_YeHdq.js +7 -0
- package/page/assets/shaped-data-DYOBdvLJ.js +20 -0
- package/page/assets/{stub-4m0tKRlG.js → stub-DPcZtI0s.js} +78 -40
- package/page/assets/{studio-code-pane-Dt3MWPBE.js → studio-code-pane-CTaPxpwn.js} +3 -3
- package/page/assets/{studio-console-4PMBDYuu.js → studio-console-D2-0qGXG.js} +1 -1
- package/page/assets/{studio-decision-BiN_FO02.js → studio-decision-DjkIYfPm.js} +1 -1
- package/page/assets/{studio-embedding-C7gIUtxM.js → studio-embedding-IRaxgsCF.js} +1 -1
- package/page/assets/{studio-host-console-DOBHkxDj.js → studio-host-console-CpbWUasd.js} +2 -2
- package/page/assets/{studio-labels-Dh_rsQs7.js → studio-labels-7mSwqgwb.js} +1 -1
- package/page/assets/{studio-live-xPsQmJyQ.js → studio-live-DO8aNuBt.js} +1 -1
- package/page/assets/studio-map-GD9XCa23.js +1 -0
- package/page/assets/studio-trace-replay-Bx2YreVs.js +2 -0
- package/page/assets/{studio-type-checker-CHFs7A7H.js → studio-type-checker-B5DVxAZ0.js} +1 -1
- package/page/assets/tool-schema-CxLtS_Zt.js +17 -0
- package/page/assets/{trace-record-D9wgX8kq.js → trace-record-B2MF8flo.js} +1 -1
- package/page/assets/tree-Bi2FOU_h.js +3 -0
- package/page/assets/{turn-client-BWO4ocVM.js → turn-client-BCi5WnI6.js} +2 -2
- package/page/assets/types-s-3wFTyD.js +1 -0
- package/page/assets/{use-one-call-ApIuuZX3.js → use-one-call-OZH6wzzP.js} +1 -1
- package/page/assets/workspace-BiCkglEt.js +1 -0
- package/page/index.html +17 -17
- package/policy.js +1 -1
- package/registrations.d.ts +7 -1
- package/replay.d.ts +11 -0
- package/replay.js +67 -11
- package/runtime-scope.js +27 -3
- package/server/draft-decide.d.ts +1 -1
- package/source.js +2 -1
- package/stub.js +1 -1
- package/surface.js +6 -3
- package/tools.js +12 -6
- package/types.d.ts +2 -0
- package/ui/lib/studio-examples.d.ts +6 -31
- package/ui/lib/studio-examples.js +30 -15
- package/ui/lib/studio-open.d.ts +4 -1
- package/ui/lib/studio-open.js +6 -5
- package/ui/lib/tree-map-layout.js +9 -1
- package/ui/profile-editor.js +9 -8
- package/ui/studio-screen.js +30 -18
- package/workspace.js +8 -2
- package/concierge-demo.d.ts +0 -17
- package/example.js +0 -363
- package/page/assets/browser-engine-BJYQz5d_.js +0 -11
- package/page/assets/browser-transport-YKpXhacP.js +0 -47
- package/page/assets/host-patterns-cSf1U25G.js +0 -1
- package/page/assets/reader-BkaAkeh0.js +0 -7
- package/page/assets/shaped-data-C4jsvipW.js +0 -20
- package/page/assets/studio-map-Cc4_9fe9.js +0 -1
- package/page/assets/studio-trace-replay-D5JoQXyY.js +0 -2
- package/page/assets/tool-schema-DpbtSZtQ.js +0 -17
- package/page/assets/tree-0OoOeHfS.js +0 -3
- package/page/assets/types-BRZU5tBz.js +0 -1
- package/page/assets/workspace-DJBP4Adw.js +0 -1
package/tools.js
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
* Function tools answer with the builder's sample reply, else the handler the host gives for their
|
|
3
3
|
* name, else a stub shaped by their output schema.
|
|
4
4
|
*/
|
|
5
|
-
import { GOOGLE_BUILTIN_TOOLS } from
|
|
5
|
+
import { GOOGLE_BUILTIN_TOOLS, OPENROUTER_BUILTIN_TOOLS } from "./cookbooks/providers.js";
|
|
6
|
+
import { cookbookToolSources } from "./cookbooks/sources.js";
|
|
6
7
|
import { stubOutputFromSchema } from "./stub.js";
|
|
7
8
|
import { zodFromJsonSchema } from "./tool-schema.js";
|
|
9
|
+
/** Adds the cookbook `sources` hook when `name` cites what it returns. */
|
|
10
|
+
function citing(name, registration) {
|
|
11
|
+
const sources = cookbookToolSources(name);
|
|
12
|
+
return sources ? { ...registration, sources } : registration;
|
|
13
|
+
}
|
|
8
14
|
/** Registers one studio tool, its schemas read as the file Save writes reads them. */
|
|
9
15
|
export function registerCustomTool(tools, tool, handlers = {}) {
|
|
10
16
|
const base = {
|
|
@@ -32,7 +38,7 @@ export function registerCustomTool(tools, tool, handlers = {}) {
|
|
|
32
38
|
output: zodFromJsonSchema(tool.outputSchema),
|
|
33
39
|
};
|
|
34
40
|
if (tool.type === 'http') {
|
|
35
|
-
tools.register({
|
|
41
|
+
tools.register(citing(tool.name, {
|
|
36
42
|
...shared,
|
|
37
43
|
type: 'http',
|
|
38
44
|
endpoint: tool.endpoint,
|
|
@@ -41,11 +47,11 @@ export function registerCustomTool(tools, tool, handlers = {}) {
|
|
|
41
47
|
mapping: tool.mapping,
|
|
42
48
|
auth: tool.auth,
|
|
43
49
|
maxResponseBytes: tool.maxResponseBytes,
|
|
44
|
-
});
|
|
50
|
+
}));
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
47
53
|
if (tool.type === 'mcp') {
|
|
48
|
-
tools.register({
|
|
54
|
+
tools.register(citing(tool.name, {
|
|
49
55
|
...shared,
|
|
50
56
|
type: 'mcp',
|
|
51
57
|
serverUrl: tool.serverUrl,
|
|
@@ -54,7 +60,7 @@ export function registerCustomTool(tools, tool, handlers = {}) {
|
|
|
54
60
|
auth: tool.auth,
|
|
55
61
|
maxResponseBytes: tool.maxResponseBytes,
|
|
56
62
|
session: tool.session,
|
|
57
|
-
});
|
|
63
|
+
}));
|
|
58
64
|
return;
|
|
59
65
|
}
|
|
60
66
|
if (tool.answeredBy === 'page') {
|
|
@@ -79,7 +85,7 @@ export function registerCustomTool(tools, tool, handlers = {}) {
|
|
|
79
85
|
});
|
|
80
86
|
}
|
|
81
87
|
export function registerStudioTools(tools, customTools, handlers) {
|
|
82
|
-
tools.registerMany(GOOGLE_BUILTIN_TOOLS);
|
|
88
|
+
tools.registerMany([...GOOGLE_BUILTIN_TOOLS, ...OPENROUTER_BUILTIN_TOOLS]);
|
|
83
89
|
for (const tool of customTools)
|
|
84
90
|
registerCustomTool(tools, tool, handlers);
|
|
85
91
|
}
|
package/types.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export type StudioToolSpecSeed = {
|
|
|
40
40
|
sessionMax?: number | null;
|
|
41
41
|
/** An agent tool's agent, by its workspace key. */
|
|
42
42
|
agentKey?: string;
|
|
43
|
+
/** A decision or text agent that filters this tool's output at `post_tool`, by its workspace key. */
|
|
44
|
+
stageAgentKey?: string;
|
|
43
45
|
/** An agent tool's calls in one turn of its caller; `null` or absent: no cap but max steps. */
|
|
44
46
|
maxCallsPerTurn?: number | null;
|
|
45
47
|
authType?: StudioAuthType;
|
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly 'live-concierge': {
|
|
8
|
-
readonly label: "Live concierge";
|
|
9
|
-
readonly description: "The concierge as a voice call, with the same tools.";
|
|
10
|
-
};
|
|
11
|
-
readonly architect: {
|
|
12
|
-
readonly label: "Code architect";
|
|
13
|
-
readonly description: "Reads repos and docs. Brings a Narrator it calls for audio.";
|
|
14
|
-
};
|
|
15
|
-
readonly narrator: {
|
|
16
|
-
readonly label: "Narrator";
|
|
17
|
-
readonly description: "Reads a script aloud.";
|
|
18
|
-
};
|
|
19
|
-
readonly console: {
|
|
20
|
-
readonly label: "Tool console";
|
|
21
|
-
readonly description: "No model. Run its tools by hand.";
|
|
22
|
-
};
|
|
23
|
-
readonly decision: {
|
|
24
|
-
readonly label: "Jev decision";
|
|
25
|
-
readonly description: "Asks Jev about a pantry photo: finds things in it and answers questions.";
|
|
26
|
-
};
|
|
27
|
-
readonly 'gemini-embedding-2': {
|
|
28
|
-
readonly label: "Gemini Embeddings 2";
|
|
29
|
-
readonly description: "Multimodal embedding preview with Gemini Embeddings 2.";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
1
|
+
import { type CookbookId } from '../../cookbooks/catalog.ts';
|
|
2
|
+
/** The ready agents and systems "Add agent" offers, projected from `COOKBOOKS`. */
|
|
3
|
+
export declare const STUDIO_EXAMPLES: Readonly<Record<CookbookId, {
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
}>>;
|
|
@@ -1,25 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import { COOKBOOKS } from "../../cookbooks/catalog.js";
|
|
2
|
+
/** The ready agents and systems "Add agent" offers, projected from `COOKBOOKS`. */
|
|
2
3
|
export const STUDIO_EXAMPLES = {
|
|
3
|
-
|
|
4
|
-
label:
|
|
5
|
-
description:
|
|
4
|
+
research: {
|
|
5
|
+
label: COOKBOOKS.research.label,
|
|
6
|
+
description: COOKBOOKS.research.description,
|
|
6
7
|
},
|
|
7
|
-
|
|
8
|
-
label:
|
|
9
|
-
description:
|
|
8
|
+
concierge: {
|
|
9
|
+
label: COOKBOOKS.concierge.label,
|
|
10
|
+
description: COOKBOOKS.concierge.description,
|
|
10
11
|
},
|
|
11
12
|
architect: {
|
|
12
|
-
label:
|
|
13
|
-
description:
|
|
13
|
+
label: COOKBOOKS.architect.label,
|
|
14
|
+
description: COOKBOOKS.architect.description,
|
|
15
|
+
},
|
|
16
|
+
'live-concierge': {
|
|
17
|
+
label: COOKBOOKS['live-concierge'].label,
|
|
18
|
+
description: COOKBOOKS['live-concierge'].description,
|
|
14
19
|
},
|
|
15
|
-
narrator: { label: 'Narrator', description: 'Reads a script aloud.' },
|
|
16
|
-
console: { label: 'Tool console', description: 'No model. Run its tools by hand.' },
|
|
17
20
|
decision: {
|
|
18
|
-
label:
|
|
19
|
-
description:
|
|
21
|
+
label: COOKBOOKS.decision.label,
|
|
22
|
+
description: COOKBOOKS.decision.description,
|
|
23
|
+
},
|
|
24
|
+
'span-decision': {
|
|
25
|
+
label: COOKBOOKS['span-decision'].label,
|
|
26
|
+
description: COOKBOOKS['span-decision'].description,
|
|
20
27
|
},
|
|
21
28
|
'gemini-embedding-2': {
|
|
22
|
-
label: '
|
|
23
|
-
description: '
|
|
29
|
+
label: COOKBOOKS['gemini-embedding-2'].label,
|
|
30
|
+
description: COOKBOOKS['gemini-embedding-2'].description,
|
|
31
|
+
},
|
|
32
|
+
narrator: {
|
|
33
|
+
label: COOKBOOKS.narrator.label,
|
|
34
|
+
description: COOKBOOKS.narrator.description,
|
|
35
|
+
},
|
|
36
|
+
console: {
|
|
37
|
+
label: COOKBOOKS.console.label,
|
|
38
|
+
description: COOKBOOKS.console.description,
|
|
24
39
|
},
|
|
25
40
|
};
|
package/ui/lib/studio-open.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type StudioDraft } from '../../mod.ts';
|
|
1
|
+
import { type StudioDraft, type StudioWorkspace } from '../../mod.ts';
|
|
2
2
|
import type { ReadStep } from '../../read-steps.ts';
|
|
3
3
|
import type { StudioOpened } from '../studio-host.ts';
|
|
4
4
|
import { type ProjectSession } from './studio-project.ts';
|
|
@@ -9,6 +9,9 @@ import { type ProjectSession } from './studio-project.ts';
|
|
|
9
9
|
export declare function openStudio(seed?: {
|
|
10
10
|
draft: StudioDraft;
|
|
11
11
|
question: string | undefined;
|
|
12
|
+
} | {
|
|
13
|
+
workspace: StudioWorkspace;
|
|
14
|
+
question: string | undefined;
|
|
12
15
|
}): StudioOpened;
|
|
13
16
|
/**
|
|
14
17
|
* What the studio opens on when a local server holds a project: the project's workspace, with the
|
package/ui/lib/studio-open.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clearStaleStudioRuns,
|
|
1
|
+
import { clearStaleStudioRuns, createResearchWorkspace, workspaceFromDraft, } from "../../mod.js";
|
|
2
2
|
import { openProject } from "./studio-project.js";
|
|
3
3
|
import { editsAside, restoreProject, restoreStudio } from "./studio-restore.js";
|
|
4
4
|
import { projectKey } from "./studio-session.js";
|
|
@@ -9,13 +9,14 @@ import { projectKey } from "./studio-session.js";
|
|
|
9
9
|
export function openStudio(seed) {
|
|
10
10
|
clearStaleStudioRuns();
|
|
11
11
|
const kept = restoreStudio();
|
|
12
|
-
const
|
|
13
|
-
workspace
|
|
12
|
+
const freshWorkspace = (workspace) => ({
|
|
13
|
+
workspace,
|
|
14
14
|
revision: kept.kind === 'restored' ? kept.value.revision + 1 : 0,
|
|
15
15
|
});
|
|
16
16
|
if (seed) {
|
|
17
|
+
const workspace = 'workspace' in seed ? seed.workspace : workspaceFromDraft(seed.draft);
|
|
17
18
|
return {
|
|
18
|
-
start:
|
|
19
|
+
start: freshWorkspace(workspace),
|
|
19
20
|
question: seed.question,
|
|
20
21
|
displaced: kept.kind === 'restored' ? kept.value.workspace : undefined,
|
|
21
22
|
discarded: kept.kind === 'discarded',
|
|
@@ -24,7 +25,7 @@ export function openStudio(seed) {
|
|
|
24
25
|
if (kept.kind === 'restored')
|
|
25
26
|
return { start: kept.value, question: undefined, displaced: undefined, discarded: false };
|
|
26
27
|
return {
|
|
27
|
-
start:
|
|
28
|
+
start: freshWorkspace(createResearchWorkspace()),
|
|
28
29
|
question: undefined,
|
|
29
30
|
displaced: undefined,
|
|
30
31
|
discarded: kept.kind === 'discarded',
|
|
@@ -1289,7 +1289,15 @@ function makeRoom(layout, runs, width) {
|
|
|
1289
1289
|
at: comes(id) - (layout.anchors.has(id) ? SHOW * MET : 0),
|
|
1290
1290
|
edges: box(id, grownPlace(layout, id)),
|
|
1291
1291
|
}));
|
|
1292
|
-
const groups = Map
|
|
1292
|
+
const groups = new Map();
|
|
1293
|
+
for (const id of runs.gather.keys()) {
|
|
1294
|
+
const key = runs.from.get(id) ?? id;
|
|
1295
|
+
const members = groups.get(key);
|
|
1296
|
+
if (members)
|
|
1297
|
+
members.push(id);
|
|
1298
|
+
else
|
|
1299
|
+
groups.set(key, [id]);
|
|
1300
|
+
}
|
|
1293
1301
|
for (const members of groups.values()) {
|
|
1294
1302
|
const own = Math.min(...members.map(comes));
|
|
1295
1303
|
const before = members.flatMap((id) => {
|
package/ui/profile-editor.js
CHANGED
|
@@ -24,10 +24,10 @@ import { Token } from '@astryxdesign/core/Token';
|
|
|
24
24
|
import { Tooltip } from '@astryxdesign/core/Tooltip';
|
|
25
25
|
import { VStack } from '@astryxdesign/core/VStack';
|
|
26
26
|
import { IconAbc, IconAdjustmentsHorizontal, IconAlertTriangle, IconAlignLeft, IconAntennaBars1, IconAntennaBars2, IconAntennaBars3, IconAntennaBars4, IconAntennaBars5, IconAntennaBarsOff, IconArrowDown, IconArrowLeft, IconArrowUp, IconBan, IconBandage, IconBiohazard, IconBolt, IconBraces, IconBulb, IconBulbOff, IconCertificate, IconCheck, IconChevronRight, IconCircleDashed, IconDatabase, IconDeviceDesktop, IconEraser, IconEye, IconEyeOff, IconFeather, IconFlag, IconFlame, IconFlask, IconGauge, IconHandOff, IconHandStop, IconHeadset, IconHourglass, IconHttpDelete, IconHttpGet, IconHttpPatch, IconHttpPost, IconHttpPut, IconInfoCircle, IconInputAi, IconKey, IconLayersUnion, IconLockOpen, IconMessage, IconMicrophone, IconPackage, IconPaperclip, IconPencil, IconPlayerPause, IconPlayerPlay, IconPlayerStop, IconPlayerTrackNext, IconPlugConnected, IconPlus, IconRefresh, IconRegex, IconSearch, IconSend, IconServer, IconShieldLock, IconShieldOff, IconShieldSearch, IconSquareRoundedNumber0, IconSquareRoundedNumber2, IconTool, IconTrash, IconUser, IconUserCheck, IconWaveSine, IconWriting, IconX, } from '@tabler/icons-react';
|
|
27
|
-
import { ATTACHMENT_ACCEPT_MIMES, CONTINUE_STOP_KINDS, fieldMeta,
|
|
27
|
+
import { ATTACHMENT_ACCEPT_MIMES, CONTINUE_STOP_KINDS, fieldMeta, HTTP_METHODS, IMAGE_ATTACHMENT_ACCEPT_MIMES, LABEL_KEYS, labelDefault, PROFILE_HANDLE_MAX_CHARS, PROFILE_ID_MAX_CHARS, profileGraphFacet, THINKING_LEVELS, VOICE_ACCEPT_MIMES, } from '@theoremjs/agents';
|
|
28
28
|
import { BOUNDARIES, BOUNDARY_META, DETECT_ACTION_META, DETECT_ACTIONS, DETECTOR_BOUNDARIES, DETECTOR_GROUP_META, DETECTOR_GROUPS, DETECTOR_META, DETECTORS, TOOL_BOUNDARIES, TOOL_KINDS, } from '@theoremjs/agents/guardrails';
|
|
29
29
|
import { createContext, lazy, Suspense, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, } from 'react';
|
|
30
|
-
import { acceptSections, agentToolTarget, bindingSlots, COMPACTION_DRAFT_DEFAULTS, defaultEffortRequired, defaultModelRequired, definitionOf, draftAllows, draftKey, expandAccept, INLINE_LABELS, includableFacets, includeFacet, inputLimitsRequired, isGoogleRoute, isOpenRouterRoute, kernelDefinitions, LOCAL_PROVIDER_ID, lentCompression, MODEL_LIMITS, modelBindingNodeId, modelRoute, modelSlots, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newToolSpec, nextAccept, onStudioLocal, optionAt, plantsCanary, protocolOptionFields, removeModelBinding, STUDIO_TRACE_DESTINATION, sampleToolInput, sectionNote, servedProtocols, servesProfileType, setProfileType, studioNetworkNote, studioNodeRef, studioRunsProvider, studioTaintNote, TIMER_MAX_MS, takesContinueInstruction, toolSpecNodeId, updateModelBinding, withOption, writeAsk, } from "../mod.js";
|
|
30
|
+
import { acceptSections, agentToolTarget, bindingSlots, COMPACTION_DRAFT_DEFAULTS, defaultEffortRequired, defaultModelRequired, definitionOf, draftAllows, draftKey, expandAccept, GOOGLE_BUILTIN_TOOLS, GOOGLE_IMAGE_ASPECT_RATIOS, GOOGLE_IMAGE_OUTPUT_MIMES, GOOGLE_IMAGE_RESOLUTIONS, GOOGLE_SPEECH_VOICES, INLINE_LABELS, includableFacets, includeFacet, inputLimitsRequired, isGoogleRoute, isOpenRouterRoute, kernelDefinitions, LOCAL_PROVIDER_ID, lentCompression, MODEL_LIMITS, modelBindingNodeId, modelRoute, modelSlots, newCriteria, newDecisionImage, newDecisionQuestion, newModelBinding, newOwnDetector, newPattern, newToolSpec, nextAccept, onStudioLocal, optionAt, plantsCanary, protocolOptionFields, removeModelBinding, STUDIO_TRACE_DESTINATION, sampleToolInput, sectionNote, servedProtocols, servesProfileType, setProfileType, studioNetworkNote, studioNodeRef, studioRunsProvider, studioTaintNote, TIMER_MAX_MS, takesContinueInstruction, toolSpecNodeId, updateModelBinding, withOption, writeAsk, } from "../mod.js";
|
|
31
31
|
import { AddProviderButton } from "./add-provider.js";
|
|
32
32
|
import { IconGoogle, IconOpenAi, IconOpenRouter, IconTypeSafe } from "./brand-icons.js";
|
|
33
33
|
import { ChoiceRow, InspectorGroupTitle, InspectorRow, InspectorSection, ListRow, NamesRow, NumberRow, OriginLine, SegmentedRow, SetInCode, SliderRow, SwitchRow, TextAreaRow, TextRow, } from "./inspector.js";
|
|
@@ -1971,9 +1971,12 @@ function HttpRequestSection({ tool, set }) {
|
|
|
1971
1971
|
set({ endpoint });
|
|
1972
1972
|
} }), _jsx(SegmentedRow, { label: "Method", path: "registerTool.method", field: "method", value: tool.method ?? HTTP_METHODS[0], segments: METHOD_SEGMENTS, onChange: (method) => {
|
|
1973
1973
|
set({ method });
|
|
1974
|
-
} }), _jsx(HeadersRow, { tool: tool, set: set }), _jsx(
|
|
1975
|
-
|
|
1976
|
-
|
|
1974
|
+
} }), _jsx(HeadersRow, { tool: tool, set: set }), _jsx(MaxResponseRow, { tool: tool, set: set })] }));
|
|
1975
|
+
}
|
|
1976
|
+
function MaxResponseRow({ tool, set }) {
|
|
1977
|
+
return (_jsx(NumberRow, { label: "Max response", path: "registerTool.maxResponseBytes", units: "bytes", field: "maxResponseBytes", value: tool.maxResponseBytes ?? null, min: 1, isIntegerOnly: true, onChange: (maxResponseBytes) => {
|
|
1978
|
+
set({ maxResponseBytes });
|
|
1979
|
+
} }));
|
|
1977
1980
|
}
|
|
1978
1981
|
function HttpMappingSection({ tool, set }) {
|
|
1979
1982
|
return (_jsxs(InspectorSection, { title: "Mapping", path: "registerTool.mapping", children: [_jsx(NamesRow, { label: "Path", path: "registerTool.mapping.pathParams", field: "pathParams", value: tool.pathParams ?? [], placeholder: "Names in {braces}", onChange: (pathParams) => {
|
|
@@ -1999,9 +2002,7 @@ function McpServerSection({ tool, set }) {
|
|
|
1999
2002
|
set({ serverUrl });
|
|
2000
2003
|
} }), _jsx(TextRow, { label: "Remote tool", path: "registerTool.mcpToolName", field: "mcpToolName", isRequired: true, value: tool.mcpToolName ?? '', placeholder: "search_flights", onChange: (mcpToolName) => {
|
|
2001
2004
|
set({ mcpToolName });
|
|
2002
|
-
} }), _jsx(HeadersRow, { tool: tool, set: set }), _jsx(
|
|
2003
|
-
set({ maxResponseBytes });
|
|
2004
|
-
} })] }));
|
|
2005
|
+
} }), _jsx(HeadersRow, { tool: tool, set: set }), _jsx(MaxResponseRow, { tool: tool, set: set })] }));
|
|
2005
2006
|
}
|
|
2006
2007
|
function McpSessionSection({ tool, set }) {
|
|
2007
2008
|
return (_jsxs(InspectorSection, { title: "Session", path: "registerTool.session", children: [_jsx(NumberRow, { label: "Idle", path: "registerTool.session.idleMs", units: "ms", field: "sessionIdleMs", value: tool.sessionIdleMs ?? null, min: 1, isIntegerOnly: true, onChange: (sessionIdleMs) => {
|
package/ui/studio-screen.js
CHANGED
|
@@ -25,7 +25,7 @@ import { IconActivity, IconAdjustmentsHorizontal, IconArrowBarToDown, IconArrowL
|
|
|
25
25
|
import { profileGraphFacet } from '@theoremjs/agents';
|
|
26
26
|
import { InPlace, PaneFailure, RaisedPane, useDisclosureMotion, } from '@theoremjs/react/ui';
|
|
27
27
|
import { canonical } from "../canonical.js";
|
|
28
|
-
import { addAgent, addArchitectExample, addProvider, agentNodeId, compileWorkspace, createBlankDraft, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createStudioRunId, draftFacets, duplicateAgent, editedSince, excludeFacet, includableFacets, includeFacet, libraryDraft, localProviderAddress, mergedWithFiles, modelBindingNodeId, modelRoute, modelSharers, modelSlots, nodeOrigins, onStudioLocal, openOutcome, originLabel, originPlace, originWay, providerIdOf, providerNodeId, providerUse, rebased, removeAgent, removeLibraryTool, removeProvider, renameProvider, reopened, resetAgent, resetAgentNode, resetLibraryTool, resetProvider, sampleToolInput, saveStudioRunPayload, scopedNodeId, setToolAllowed, sharedAsk, sharedAt, sharedEntries, studioNodeRef, studioSource, studioTree, toolSpecKeyOf, withAgentDraft, withFilesChosen, withProvider, workspaceNodeRef, workspaceRunAgent, workspaceTree, writeAsk, } from "../mod.js";
|
|
28
|
+
import { addAgent, addArchitectExample, addProvider, addResearchExample, agentNodeId, compileWorkspace, createBlankDraft, createConsoleExampleDraft, createDecisionExampleDraft, createExampleDraft, createGeminiEmbeddingExampleDraft, createLiveExampleDraft, createNarratorExampleDraft, createSpanExampleDraft, createStudioRunId, draftFacets, duplicateAgent, editedSince, excludeFacet, includableFacets, includeFacet, libraryDraft, localProviderAddress, mergedWithFiles, modelBindingNodeId, modelRoute, modelSharers, modelSlots, nodeOrigins, onStudioLocal, openOutcome, originLabel, originPlace, originWay, providerIdOf, providerNodeId, providerUse, rebased, removeAgent, removeLibraryTool, removeProvider, renameProvider, reopened, resetAgent, resetAgentNode, resetLibraryTool, resetProvider, sampleToolInput, saveStudioRunPayload, scopedNodeId, setToolAllowed, sharedAsk, sharedAt, sharedEntries, studioNodeRef, studioSource, studioTree, toolSpecKeyOf, withAgentDraft, withFilesChosen, withProvider, workspaceNodeRef, workspaceRunAgent, workspaceTree, writeAsk, } from "../mod.js";
|
|
29
29
|
import { studioSurface } from "../surface.js";
|
|
30
30
|
import './studio.css';
|
|
31
31
|
import { createTraceFeed } from '@theoremjs/web/client';
|
|
@@ -319,20 +319,20 @@ const addsDraft = (draft) => async () => {
|
|
|
319
319
|
const made = await draft();
|
|
320
320
|
return (workspace) => addAgent(workspace, made);
|
|
321
321
|
};
|
|
322
|
-
/** The examples, in the order the menu lists them.
|
|
322
|
+
/** The examples, in the order the menu lists them. Research and the architect bring their subagents. */
|
|
323
323
|
const EXAMPLE_AGENTS = [
|
|
324
|
+
{
|
|
325
|
+
id: 'research',
|
|
326
|
+
...STUDIO_EXAMPLES.research,
|
|
327
|
+
icon: PROFILE_TYPE_ICON.text,
|
|
328
|
+
add: () => Promise.resolve(addResearchExample),
|
|
329
|
+
},
|
|
324
330
|
{
|
|
325
331
|
id: 'concierge',
|
|
326
332
|
...STUDIO_EXAMPLES.concierge,
|
|
327
333
|
icon: PROFILE_TYPE_ICON.text,
|
|
328
334
|
add: addsDraft(createExampleDraft),
|
|
329
335
|
},
|
|
330
|
-
{
|
|
331
|
-
id: 'live-concierge',
|
|
332
|
-
...STUDIO_EXAMPLES['live-concierge'],
|
|
333
|
-
icon: PROFILE_TYPE_ICON.live,
|
|
334
|
-
add: addsDraft(createLiveExampleDraft),
|
|
335
|
-
},
|
|
336
336
|
{
|
|
337
337
|
id: 'architect',
|
|
338
338
|
...STUDIO_EXAMPLES.architect,
|
|
@@ -340,16 +340,10 @@ const EXAMPLE_AGENTS = [
|
|
|
340
340
|
add: () => Promise.resolve(addArchitectExample),
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
|
-
id: '
|
|
344
|
-
...STUDIO_EXAMPLES
|
|
345
|
-
icon: PROFILE_TYPE_ICON.
|
|
346
|
-
add: addsDraft(
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
id: 'console',
|
|
350
|
-
...STUDIO_EXAMPLES.console,
|
|
351
|
-
icon: PROFILE_TYPE_ICON.host,
|
|
352
|
-
add: addsDraft(createConsoleExampleDraft),
|
|
343
|
+
id: 'live-concierge',
|
|
344
|
+
...STUDIO_EXAMPLES['live-concierge'],
|
|
345
|
+
icon: PROFILE_TYPE_ICON.live,
|
|
346
|
+
add: addsDraft(createLiveExampleDraft),
|
|
353
347
|
},
|
|
354
348
|
{
|
|
355
349
|
id: 'decision',
|
|
@@ -357,12 +351,30 @@ const EXAMPLE_AGENTS = [
|
|
|
357
351
|
icon: PROFILE_TYPE_ICON.decision,
|
|
358
352
|
add: addsDraft(createDecisionExampleDraft),
|
|
359
353
|
},
|
|
354
|
+
{
|
|
355
|
+
id: 'span-decision',
|
|
356
|
+
...STUDIO_EXAMPLES['span-decision'],
|
|
357
|
+
icon: PROFILE_TYPE_ICON.decision,
|
|
358
|
+
add: addsDraft(createSpanExampleDraft),
|
|
359
|
+
},
|
|
360
360
|
{
|
|
361
361
|
id: 'gemini-embedding-2',
|
|
362
362
|
...STUDIO_EXAMPLES['gemini-embedding-2'],
|
|
363
363
|
icon: PROFILE_TYPE_ICON.embedding,
|
|
364
364
|
add: addsDraft(createGeminiEmbeddingExampleDraft),
|
|
365
365
|
},
|
|
366
|
+
{
|
|
367
|
+
id: 'narrator',
|
|
368
|
+
...STUDIO_EXAMPLES.narrator,
|
|
369
|
+
icon: PROFILE_TYPE_ICON.speech,
|
|
370
|
+
add: addsDraft(createNarratorExampleDraft),
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: 'console',
|
|
374
|
+
...STUDIO_EXAMPLES.console,
|
|
375
|
+
icon: PROFILE_TYPE_ICON.host,
|
|
376
|
+
add: addsDraft(createConsoleExampleDraft),
|
|
377
|
+
},
|
|
366
378
|
];
|
|
367
379
|
/** Adds a blank agent or one of the examples. */
|
|
368
380
|
/** As wide as the row, and no wider: the description does not widen the menu its labels size. */
|
package/workspace.js
CHANGED
|
@@ -264,7 +264,9 @@ export function removeAgent(workspace, key) {
|
|
|
264
264
|
return remembered({
|
|
265
265
|
...workspace,
|
|
266
266
|
agents,
|
|
267
|
-
toolSpecs: workspace.toolSpecs
|
|
267
|
+
toolSpecs: workspace.toolSpecs
|
|
268
|
+
.filter((tool) => !ranIt.has(tool.key))
|
|
269
|
+
.map((tool) => (tool.stageAgentKey === key ? { ...tool, stageAgentKey: undefined } : tool)),
|
|
268
270
|
selected: gone ? agentNodeId(neighbour.key) : workspace.selected,
|
|
269
271
|
chatWith: workspace.chatWith === key ? neighbour.key : workspace.chatWith,
|
|
270
272
|
});
|
|
@@ -769,7 +771,11 @@ function mergedValue(base, mine, theirs, path, tell) {
|
|
|
769
771
|
function sound(workspace) {
|
|
770
772
|
const agentKeys = new Set(workspace.agents.map((agent) => agent.key));
|
|
771
773
|
// An agent tool whose agent is gone has nothing to run.
|
|
772
|
-
const toolSpecs = workspace.toolSpecs
|
|
774
|
+
const toolSpecs = workspace.toolSpecs
|
|
775
|
+
.filter((tool) => tool.toolType !== 'agent' || agentKeys.has(tool.agentKey ?? ''))
|
|
776
|
+
.map((tool) => tool.stageAgentKey && !agentKeys.has(tool.stageAgentKey)
|
|
777
|
+
? { ...tool, stageAgentKey: undefined }
|
|
778
|
+
: tool);
|
|
773
779
|
const library = new Set(toolSpecs.map((tool) => tool.key));
|
|
774
780
|
const agents = workspace.agents.map((agent) => {
|
|
775
781
|
const allow = agent.tools.allow.filter((toolKey) => library.has(toolKey));
|
package/concierge-demo.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { StudioInputsSpec, StudioToolSeed } from './types.ts';
|
|
2
|
-
/** Sample inputs for HTTP demo tools (connection tests and smoke scripts). */
|
|
3
|
-
export declare const DEMO_HTTP_SAMPLE_INPUT: Record<string, Record<string, unknown>>;
|
|
4
|
-
export declare function demoHttpSampleInput(toolName: string): Record<string, unknown> | undefined;
|
|
5
|
-
/** Comma-separated hosts for guardrails.egress allowlist in the demo graph. */
|
|
6
|
-
export declare const DEMO_ALLOWED_HOSTS = "nominatim.openstreetmap.org, geocoding-api.open-meteo.com, api.open-meteo.com, api.frankfurter.dev, api.sunrise-sunset.org, api.zippopotam.us, en.wikipedia.org, archive.org, pokeapi.co, dog.ceo, api.adviceslip.com, catfact.ninja, official-joke-api.appspot.com, mcp.deepwiki.com, mcp.context7.com, learn.microsoft.com, docs.mcp.cloudflare.com, knowledge-mcp.global.api.aws, huggingface.co, mcp.docs.astro.build, mcp.exa.ai, raw.githubusercontent.com, registry.npmjs.org";
|
|
7
|
-
export declare const DEMO_CONCIERGE_SYSTEM = "Role: Elite, charismatic travel concierge.\n\nCommunication Standards:\n- Readable Formatting: Use markdown where it helps the reader: short headings, bullet lists, bold for key names, and tables for side-by-side comparisons.\n- Adaptive Pacing: Deliver high-signal, concise answers. Avoid overwhelming monologues; provide the immediate insight or recommendation first, then offer a natural next step.\n\nTool & Fact Grounding:\n- Absolute Grounding: Ground all dynamic facts (weather, currency conversions, distances, geography, destination research) using available tools before answering. Never invent live data.\n- Silent Execution: Never narrate tool calls, announce function names, or reference underlying APIs. Seamlessly integrate verified findings into your response.\n- Complete Resolution: Execute multi-step tool chains silently to completion before delivering the synthesized answer.\n\nMultimodal Understanding:\n- Immediately extract actionable constraints (dates, flight times, locations, budgets) from provided images, documents, tickets, or audio, and weave them directly into your response.";
|
|
8
|
-
export declare function demoInputsSpec(): StudioInputsSpec;
|
|
9
|
-
/** The tools the travel concierge allows: places, weather, money, trip helpers, and research. */
|
|
10
|
-
export declare const DEMO_CONCIERGE_TOOLS: readonly string[];
|
|
11
|
-
/** The tools the code architect allows: docs, repositories, packages, and research. */
|
|
12
|
-
export declare const DEMO_ARCHITECT_TOOLS: readonly string[];
|
|
13
|
-
/** The tools the tool console serves: one of each kind of result, and the two no agent allows. */
|
|
14
|
-
export declare const DEMO_CONSOLE_TOOLS: readonly string[];
|
|
15
|
-
export declare const DEMO_ARCHITECT_SYSTEM = "Role: Senior software architect who researches before advising.\n\nCommunication Standards:\n- Readable Formatting: Use markdown where it helps the reader: short headings, bullet lists, code blocks for code, and tables for side-by-side comparisons.\n- Answer First: Lead with the recommendation, then the reasons and the trade-offs. Name what you could not confirm.\n\nTool & Fact Grounding:\n- Absolute Grounding: Ground claims about a library, a repository, a package version, or a cloud service in the tools before answering. Never invent an API, a version, or a default.\n- Silent Execution: Never narrate tool calls or announce function names. Work findings into the answer.\n- Complete Resolution: Finish multi-step research before you answer.\n\nAudio briefings:\n- When asked for a podcast, a briefing, or anything to listen to, write a short spoken script of what you found, in plain sentences with no markdown, and pass it to narrate. Then say in one line what the briefing covers.";
|
|
16
|
-
export declare const DEMO_LIVE_CONCIERGE_SYSTEM = "Role: Elite, charismatic travel concierge, on a call.\n\nSpeaking:\n- Speak in short, natural sentences. No lists, no markdown, no reading out of addresses, or codes unless asked.\n- Give the recommendation first, then offer one next step.\n\nTool & Fact Grounding:\n- Ground weather, currency, distances, and places in the tools before you answer. Never invent live data.\n- Never name a tool or say that you are calling one.";
|
|
17
|
-
export declare function demoToolSpecs(): StudioToolSeed[];
|