studio: agent window, a chat with a model that edits the scene
Deploy web Studio / deploy (push) Successful in 3m3s
Deploy web Studio / deploy (push) Successful in 3m3s
✦ Agent in the Studio's top bar opens a floating chat window. The model (any OpenAI-compatible endpoint with tool calling; default B4L's inference server, https://inference.p0.contact/v1) gets the 15 MCP tools plus two page tools (select_object, set_view) and the Studio's state (selection, level, rotation) in its system prompt. Answers and reasoning stream in; tool calls show as rows with arguments and results; object ids link to the object; Stop ends a turn; Undo takes the agent's edits back. The window moves by its title bar and resizes at its top-left corner. - studio/agent.js: shared by both front ends (waits for studio.js's isokit:studio event); MCP over /mcp or isokit.mcp in the web Studio - isokit studio: /api/agent/{config,models,chat} relay the calls on their own threads (ureq, chunked and flushed per read), so the key stays on the machine and the endpoint needs no CORS; settings from ISOKIT_LLM_URL / _KEY / _MODEL or agent.json in the user's config folder - web Studio: calls the endpoint from the page with a key kept in the browser; build_web.py --agent-url names a same-site relay as default; the deploy builds with /llm/v1, which deploy/Caddyfile forwards to the inference server (its nginx refuses the CORS preflight) - tools/mock_llm.py + tools/agent_checks.py: the agent window checks in both check_studio.py and check_web.py
This commit is contained in:
1 parent
c647f39059
commit
1a1b62d475
21 files changed
+1690
-25
No files matched your search
@@ -83,6 +83,73 @@ input[type=checkbox] { accent-color: var(--accent); }
|
||||
.st-dialog th { text-align: left; padding: 3px 12px 3px 0; color: var(--mute); font-weight: 500; vertical-align: top; }
|
||||
.st-dialog form { text-align: right; margin-top: 10px; }
|
||||
|
||||
/* agent window (agent.js): floats over the map, moves by its title, resizes at the top-left corner */
|
||||
[hidden] { display: none !important; }
|
||||
.ag-open[aria-pressed=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
|
||||
.ag-win { position: absolute; right: 12px; bottom: 40px; width: 400px; height: 540px; z-index: 6; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--stroke); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); overflow: hidden; }
|
||||
.ag-head { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-bottom: 1px solid var(--stroke); background: var(--panel2); cursor: move; user-select: none; touch-action: none; }
|
||||
.ag-head button { padding: 2px 8px; }
|
||||
.ag-logo { white-space: nowrap; }
|
||||
.ag-logo, .ag-open { color: var(--fg); }
|
||||
.ag-who { background: none; border: 0; padding: 0 2px !important; color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; align-items: center; gap: 5px; }
|
||||
.ag-who:hover { color: var(--fg); }
|
||||
.ag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); flex: 0 0 auto; }
|
||||
.ag-dot.ag-on { background: var(--accent); }
|
||||
.ag-dot.ag-off { background: var(--danger); }
|
||||
.ag-set { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 5px 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--stroke); font-size: 12px; }
|
||||
.ag-set > label { color: var(--mute); }
|
||||
.ag-set input:not([type=checkbox]), .ag-set select { width: 100%; }
|
||||
.ag-row { display: flex; gap: 4px; align-items: center; min-width: 0; }
|
||||
.ag-row > input, .ag-row > select { flex: 1 1 auto; }
|
||||
.ag-row button { padding: 2px 8px; }
|
||||
.ag-check { color: var(--fg); display: flex; align-items: center; gap: 5px; }
|
||||
.ag-check small { color: var(--mute); }
|
||||
.ag-fnote { grid-column: 1 / -1; margin: 0; color: var(--mute); }
|
||||
.ag-fnote code { font-size: 11px; word-break: break-all; }
|
||||
.ag-end { grid-column: 1 / -1; justify-content: flex-end; }
|
||||
.ag-smsg { flex: 1 1 auto; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.ag-badtext { color: var(--danger); white-space: normal; }
|
||||
.ag-log { flex: 1 1 auto; overflow: auto; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
|
||||
.ag-empty { color: var(--mute); margin: auto 0 0; }
|
||||
.ag-empty p { margin: 0 0 8px; }
|
||||
.ag-sugs { display: flex; flex-wrap: wrap; gap: 5px; }
|
||||
.ag-sug { white-space: normal; text-align: left; font-size: 12px; padding: 4px 9px; border-radius: 14px; }
|
||||
.ag-user { align-self: flex-end; max-width: 88%; background: color-mix(in srgb, var(--accent) 16%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--stroke)); border-radius: 10px 10px 2px 10px; padding: 5px 10px; overflow-wrap: anywhere; }
|
||||
.ag-bot { overflow-wrap: anywhere; }
|
||||
.ag-bot p { margin: 0 0 6px; }
|
||||
.ag-bot p:last-child { margin-bottom: 0; }
|
||||
.ag-bot ul, .ag-bot ol { margin: 0 0 6px; padding-left: 20px; }
|
||||
.ag-bot pre, .ag-tool pre { background: var(--panel2); border: 1px solid var(--stroke); border-radius: 4px; padding: 5px 7px; margin: 4px 0; font-size: 11.5px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
|
||||
.ag-bot code, .ag-tool code { background: var(--panel2); border-radius: 3px; padding: 0 3px; font-size: 12px; }
|
||||
.ag-live .ag-text:empty::after, .ag-live .ag-text > :last-child::after { content: "\258D"; color: var(--accent); animation: ag-blink 1s steps(2) infinite; }
|
||||
.ag-live .ag-think:not([hidden]) + .ag-text:empty::after { content: none; }
|
||||
@keyframes ag-blink { 50% { opacity: 0; } }
|
||||
.ag-think { color: var(--mute); font-size: 12px; margin-bottom: 4px; }
|
||||
.ag-think summary { cursor: pointer; }
|
||||
.ag-live .ag-think summary { animation: ag-pulse 1.4s ease-in-out infinite; }
|
||||
@keyframes ag-pulse { 50% { opacity: .45; } }
|
||||
.ag-think div { white-space: pre-wrap; border-left: 2px solid var(--stroke); padding: 2px 0 2px 8px; margin: 4px 0; max-height: 180px; overflow: auto; }
|
||||
.ag-tool { font-size: 12px; }
|
||||
.ag-tool summary { cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--mute); list-style: none; padding: 2px 6px; border: 1px solid var(--stroke); border-radius: 5px; background: var(--panel2); }
|
||||
.ag-tool summary::-webkit-details-marker { display: none; }
|
||||
.ag-tool summary::before { content: "\2699"; }
|
||||
.ag-tool summary b { color: var(--fg); font-weight: 600; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
|
||||
.ag-tool summary span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.ag-tool summary em { font-style: normal; }
|
||||
.ag-tool.ag-ok summary em { color: var(--accent); }
|
||||
.ag-tool.ag-bad summary { border-color: color-mix(in srgb, var(--danger) 50%, var(--stroke)); }
|
||||
.ag-tool.ag-bad summary em { color: var(--danger); }
|
||||
.ag-obj { cursor: pointer; color: var(--accent); text-decoration: underline dotted; }
|
||||
.ag-note { color: var(--mute); font-size: 12px; font-style: italic; }
|
||||
.ag-err { color: var(--danger); font-size: 12px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--stroke)); border-radius: 5px; padding: 5px 8px; overflow-wrap: anywhere; }
|
||||
.ag-link { background: none; border: 0; padding: 0 2px; color: var(--fg); text-decoration: underline; font-size: 12px; }
|
||||
.ag-in { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--stroke); align-items: flex-end; }
|
||||
.ag-in textarea { flex: 1 1 auto; resize: none; min-height: 38px; max-height: 140px; line-height: 1.35; }
|
||||
.ag-in button { align-self: stretch; min-width: 62px; }
|
||||
.ag-in .ag-stop { border-color: var(--danger); color: var(--danger); }
|
||||
.ag-grip { position: absolute; left: 0; top: 0; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, var(--mute) 0 2px, transparent 2px 4px, var(--mute) 4px 5px, transparent 5px); opacity: .5; border-top-left-radius: 8px; }
|
||||
.ag-grip:hover { opacity: 1; }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.st-main { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 40vh; }
|
||||
.st-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--stroke); }
|
||||
|
||||
Reference in new issue
Block a user