@yuriai/web 0.2.32-beta.5 → 0.2.32-beta.7
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 +19 -0
- package/dist/assets/{AgentAvatar-DG1RbFtI.js → AgentAvatar-BPGtFSJl.js} +1 -1
- package/dist/assets/{AssistantContactStatus-CzPxX6kn.js → AssistantContactStatus-BkJX1aHJ.js} +3 -3
- package/dist/assets/{AssistantUnreadBadge-BoimAuZB.js → AssistantUnreadBadge-BLrhZtX4.js} +1 -1
- package/dist/assets/{AssistantView-DRa5_WqV.js → AssistantView-CRNRm9ix.js} +1 -1
- package/dist/assets/{DiagramView-DBNv9eLT.js → DiagramView-IJdm6V-I.js} +1 -1
- package/dist/assets/{FadeInOnReveal-Bmxvkrf4.js → FadeInOnReveal-DoQ1DHcy.js} +1 -1
- package/dist/assets/{GuiPluginSurface-o7Ay34vJ.js → GuiPluginSurface-UzIcyfzu.js} +1 -1
- package/dist/assets/{GuiPluginWindow-CwP_vUoC.js → GuiPluginWindow-CWjwMY19.js} +1 -1
- package/dist/assets/Icon-wD7peplo.js +1 -0
- package/dist/assets/{ImageLoadingPlaceholder-DlosWH_9.js → ImageLoadingPlaceholder-cfSg1uO0.js} +1 -1
- package/dist/assets/{LoadingImage-D9r0ukc0.js → LoadingImage-DTlBKb0t.js} +1 -1
- package/dist/assets/{MarkdownRenderer-Bq8Gj6CE.js → MarkdownRenderer-42mR-hfP.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-CVRLtLB1.js → MarkdownRendererImpl-BrgFhad9.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-BOmhW47N.js → MarkstreamRendererImpl-BwwP423b.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-HZ6caX7w.js → MobileDetailNavigation-BzA3RUQf.js} +1 -1
- package/dist/assets/{MobileResizableSheet-vAenroLZ.js → MobileResizableSheet-3pSxhm6y.js} +1 -1
- package/dist/assets/{MobileShareBridge-DTCxgcOl.js → MobileShareBridge-8D1mAnQX.js} +1 -1
- package/dist/assets/MobileTabPageHeader-2brOJZ7v.js +2 -0
- package/dist/assets/{MultiRunWindow-DgpwdrOT.js → MultiRunWindow-yr2T2JVO.js} +1 -1
- package/dist/assets/{OnboardingScreen-DNlK3zfZ.js → OnboardingScreen-DOcfewzl.js} +1 -1
- package/dist/assets/{OverlayScrollbar-W17unuIx.js → OverlayScrollbar-C1VJiQk-.js} +1 -1
- package/dist/assets/{SettingsView-BCCVFcMo.js → SettingsView-D57_z9Xp.js} +12 -12
- package/dist/assets/{SettingsWindow-J6K3qs_9.js → SettingsWindow-eITkM9xO.js} +1 -1
- package/dist/assets/SetupTourDialog-Da8-sYBw.js +1 -0
- package/dist/assets/SetupTourDialog-DrL_4ODI.css +1 -0
- package/dist/assets/{TerminalView-DvRoa8my.js → TerminalView-DWlRf5cO.js} +1 -1
- package/dist/assets/{ToolOutputDialog-cf_VcwJk.js → ToolOutputDialog-BkNK7SlB.js} +1 -1
- package/dist/assets/{VoiceSettings-Sm4gB-j5.js → VoiceSettings-BvfsAx5q.js} +2 -2
- package/dist/assets/{YuriLogo-XH6UGXtF.js → YuriLogo-kLl6rb2d.js} +1 -1
- package/dist/assets/YuriWordmark-DHYo0FlR.js +1 -0
- package/dist/assets/{appThemeRegistry-zoeqTiCb.js → appThemeRegistry-C5KVFrEF.js} +1 -1
- package/dist/assets/{button-CyJvQsp5.js → button-DSfiaJr4.js} +1 -1
- package/dist/assets/{capgoAdapter-Doqr12Eo.js → capgoAdapter-DjN9N4r_.js} +1 -1
- package/dist/assets/checkbox-cWs92MsM.js +1 -0
- package/dist/assets/{collapsible-CXjDO6DW.js → collapsible-AUQp4jpe.js} +1 -1
- package/dist/assets/{context-menu-BajfnPcW.js → context-menu-DwQvyFO2.js} +1 -1
- package/dist/assets/desktopHosts-BLU1tGSX.js +1 -0
- package/dist/assets/{desktopRelayRestore-DS44uXtb.js → desktopRelayRestore-2BIIs8mZ.js} +1 -1
- package/dist/assets/{diagram-_Js3imTf.js → diagram-BTa5MQro.js} +1 -1
- package/dist/assets/{dialog-Bapd6e10.js → dialog-gWs6IrfL.js} +1 -1
- package/dist/assets/{es-CBhZ80Z7.js → es-mX3KOqnq.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-BqGxOZhB.js → fileMentionTouchSelection-plcnc8He.js} +1 -1
- package/dist/assets/{fr-D9s0sHDF.js → fr-DpWAkfly.js} +1 -1
- package/dist/assets/{gitApi-BZT4-6oC.js → gitApi-kn04hIXc.js} +1 -1
- package/dist/assets/historyImportQueries-C8VK9R5_.js +1 -0
- package/dist/assets/host-z9PU8q1e.js +1 -0
- package/dist/assets/{input-SCAHBeSU.js → input-D2qPeIPD.js} +1 -1
- package/dist/assets/insertionBoundaries-BdWZv7B4.js +1 -0
- package/dist/assets/{ja-BXQ3ox8H.js → ja-BBtK3t8l.js} +1 -1
- package/dist/assets/{ko-DlUti1wK.js → ko-Cwp3wC4W.js} +1 -1
- package/dist/assets/main-ATy6IXYq.js +169 -0
- package/dist/assets/main-Dand3vGy.js +2 -0
- package/dist/assets/{markdownHeightCache-B3MTnGA8.js → markdownHeightCache-Cinxvo8I.js} +1 -1
- package/dist/assets/{mcpQueries-BV_4aVO7.js → mcpQueries-BSIq-bmc.js} +1 -1
- package/dist/assets/miniChat-CbZmjfi9.js +2 -0
- package/dist/assets/mobile-C-QjhwpF.js +2 -0
- package/dist/assets/{mobileBackNavigation-dXm_DT4M.js → mobileBackNavigation-D6Ezv4DB.js} +1 -1
- package/dist/assets/multirun-DPdy1ssR.js +3 -0
- package/dist/assets/{native-config-DPhDkRHe.js → native-config-B7y8szbY.js} +1 -1
- package/dist/assets/{pl-B7LIbV2C.js → pl-Ccedjy5w.js} +1 -1
- package/dist/assets/{projectMeta-DOi5DwXK.js → projectMeta-BsemqAiZ.js} +1 -1
- package/dist/assets/{pt-BR-DyusczdZ.js → pt-BR-M2O45bRx.js} +1 -1
- package/dist/assets/{pwa-CEIk_CAR.js → pwa-PejIrv63.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-m5rVgHjT.js → queue-abort-optimistic-DCcbcwcW.js} +1 -1
- package/dist/assets/react-a6PrrNTm.js +1 -0
- package/dist/assets/{readiness-DcxDHTFv.js → readiness-C3MT55zn.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-DMHtUbjY.js → renderElectronMiniChatApp-B2nWy82v.js} +2 -2
- package/dist/assets/{renderMobileApp-C4tIs0O8.js → renderMobileApp-DsA7NB8t.js} +7 -7
- package/dist/assets/{runtimeConfig-zOTrRG4k.js → runtimeConfig-DcZhB_ik.js} +1 -1
- package/dist/assets/runtimeEndpointReset-DNh8Buqk.js +149 -0
- package/dist/assets/{select-CeddPgN5.js → select-BOlDxL_9.js} +1 -1
- package/dist/assets/sessionLookup-Csi0w1FF.js +1 -0
- package/dist/assets/{sortable-tabs-strip-D474PwS8.js → sortable-tabs-strip-CtkfOIVC.js} +1 -1
- package/dist/assets/{speechSettingsQueries-BnEpSqr1.js → speechSettingsQueries-Q5HncdmE.js} +1 -1
- package/dist/assets/src-C5Lsul_L.css +2 -0
- package/dist/assets/{store-Diaywtmi.js → store-BMijqCTE.js} +3 -3
- package/dist/assets/{textarea-CWQIq-Mn.js → textarea-Cspgldlr.js} +1 -1
- package/dist/assets/{tooltip-D3WmiZ7G.js → tooltip-DBb-UCMU.js} +1 -1
- package/dist/assets/tour-DzjTres6.js +1 -0
- package/dist/assets/{types-C1kMTm4R.js → types-4dZMFk7b.js} +1 -1
- package/dist/assets/{uk-BrwM67Dh.js → uk-skNzlwtr.js} +1 -1
- package/dist/assets/{useAppFontEffects-C_bov7Lj.js → useAppFontEffects-BKeEcImc.js} +54 -54
- package/dist/assets/useDesktopWindowControlsLayout-BIk3m2yD.js +1 -0
- package/dist/assets/{useDictation-C-waWdAq.js → useDictation-CwZ6a6i7.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-53AP8Okc.js → useEffectiveDirectory-DPfMFs3U.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-B2WlZQtk.js → useMobileNavigationStore-Cf5Q0tIq.js} +13 -13
- package/dist/assets/{usePluginsStore-BB0d0oJj.js → usePluginsStore-HsFoS5tV.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-BfnQF-od.js → useWorkerHighlightedLines-DKLFgD2u.js} +1 -1
- package/dist/assets/{zh-CN-D9NAFloZ.js → zh-CN-KsbHpHjS.js} +1 -1
- package/dist/assets/{zh-TW-tuUKOuhs.js → zh-TW-SdNEiQ7a.js} +1 -1
- package/dist/index.html +8 -8
- package/dist/mini-chat.html +8 -8
- package/dist/mobile.html +8 -8
- package/package.json +1 -1
- package/server/index.js +2 -0
- package/server/lib/client-auth/pairing.js +2 -0
- package/server/lib/client-auth/pairing.test.js +29 -0
- package/server/lib/content-search/DOCUMENTATION.md +9 -0
- package/server/lib/content-search/routes.js +18 -1
- package/server/lib/content-search/routes.test.js +21 -0
- package/server/lib/content-search/runtime.js +7 -3
- package/server/lib/content-search/runtime.test.js +26 -0
- package/server/lib/gui-customization/DOCUMENTATION.md +21 -1
- package/server/lib/gui-customization/session-skill.js +2 -2
- package/server/lib/gui-customization/session-skill.test.js +3 -1
- package/server/lib/gui-customization/skill/SKILL.md +5 -1
- package/server/lib/gui-customization/skill/references/global-pages.md +1 -1
- package/server/lib/gui-customization/skill/references/gui-api.md +4 -1
- package/server/lib/gui-customization/skill/references/icons.md +134 -0
- package/server/lib/gui-customization/skill/references/plugin-styles.md +112 -0
- package/server/lib/gui-customization/skill/references/ui-surfaces.md +2 -0
- package/server/lib/gui-customization/skill/references/work-status.md +110 -0
- package/server/lib/history-import/AGENT_CONNECT_LICENSE +21 -0
- package/server/lib/history-import/DOCUMENTATION.md +223 -0
- package/server/lib/history-import/dev-proxy.integration.test.js +56 -0
- package/server/lib/history-import/events.js +322 -0
- package/server/lib/history-import/events.test.js +110 -0
- package/server/lib/history-import/installations.js +39 -0
- package/server/lib/history-import/installations.test.js +24 -0
- package/server/lib/history-import/native.js +49 -0
- package/server/lib/history-import/native.test.js +42 -0
- package/server/lib/history-import/routes.js +48 -0
- package/server/lib/history-import/routes.test.js +55 -0
- package/server/lib/history-import/service.js +374 -0
- package/server/lib/history-import/service.test.js +538 -0
- package/server/lib/history-import/settings.js +146 -0
- package/server/lib/history-import/settings.test.js +88 -0
- package/server/lib/history-import/sources.js +184 -0
- package/server/lib/history-import/sources.test.js +190 -0
- package/server/lib/history-import/sqlite.js +187 -0
- package/server/lib/history-import/store.js +58 -0
- package/server/lib/history-import/store.test.js +84 -0
- package/server/lib/history-import/targets.js +24 -0
- package/server/lib/host-update/DOCUMENTATION.md +6 -0
- package/server/lib/host-update/routes.test.js +1 -1
- package/server/lib/notifications/native-stream.relay.test.js +1 -0
- package/server/lib/opencode/DOCUMENTATION.md +3 -0
- package/server/lib/opencode/core-routes.js +1 -0
- package/server/lib/opencode/feature-routes-runtime.js +11 -1
- package/server/lib/opencode/yuri-routes.js +1 -1
- package/server/lib/relay/DOCUMENTATION.md +1 -1
- package/server/lib/relay/host-client.js +3 -1
- package/server/lib/relay/host-client.test.js +1 -0
- package/server/lib/relay/reasoning-projection.e2e.test.ts +1 -0
- package/server/lib/relay/relay-server.e2e.test.ts +32 -17
- package/server/lib/relay/service.js +2 -0
- package/server/lib/relay/tunnel-host.js +26 -1
- package/server/lib/relay/tunnel-host.test.js +27 -3
- package/server/lib/remote-desktop/runtime.test.js +2 -2
- package/server/lib/ui-auth/DOCUMENTATION.md +3 -0
- package/server/lib/ui-auth/ui-auth.js +27 -0
- package/server/lib/ui-auth/ui-auth.test.js +42 -1
- package/server/plugin-gui-proxy.test.js +1 -1
- package/dist/assets/Icon-BOYrvHyJ.js +0 -1
- package/dist/assets/MobileTabPageHeader-B8ywFvz3.js +0 -2
- package/dist/assets/SetupTourDialog-CUzqT2sw.css +0 -1
- package/dist/assets/SetupTourDialog-D1CePVNG.js +0 -1
- package/dist/assets/YuriWordmark-Cr1vkcue.js +0 -1
- package/dist/assets/desktopHosts-CMglnUdS.js +0 -1
- package/dist/assets/host-CBfSyi4l.js +0 -1
- package/dist/assets/insertionBoundaries-B2xOQ5Hz.js +0 -1
- package/dist/assets/main-CrVkVfn6.js +0 -169
- package/dist/assets/main-DjDRinlx.js +0 -2
- package/dist/assets/miniChat-D4MjHmAR.js +0 -2
- package/dist/assets/mobile-COK8gAf5.js +0 -2
- package/dist/assets/multirun-BZjeyzhb.js +0 -3
- package/dist/assets/react-Bwr5-XPi.js +0 -1
- package/dist/assets/runtimeEndpointReset-Cv_6vk4X.js +0 -149
- package/dist/assets/sessionLookup-SonNO2fE.js +0 -1
- package/dist/assets/src-BmVsUiOI.css +0 -2
- package/dist/assets/tour-DeA0Ksvj.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-3tcqC97e.js +0 -1
|
@@ -21,16 +21,20 @@ export function createContentSearchRuntime({ service, getRuntimeKey, getEventRun
|
|
|
21
21
|
return { ...(state.runtime === runtime ? state : { runtime, phase: 'pending', since: now() - RETENTION, total: 0, completed: 0, failed: 0, updatedAt: null }),
|
|
22
22
|
...coverage, initializationRequired: coverage.indexCompletedAt === null, ...service.stats(runtime) };
|
|
23
23
|
};
|
|
24
|
-
const sync = ({ incremental = false } = {}) => {
|
|
24
|
+
const sync = ({ incremental = false, resume = false } = {}) => {
|
|
25
25
|
if (stopped) return Promise.resolve();
|
|
26
|
-
if (flight)
|
|
26
|
+
if (flight) {
|
|
27
|
+
if (resume) state.phase = 'indexing';
|
|
28
|
+
return flight;
|
|
29
|
+
}
|
|
27
30
|
const runtime = getRuntimeKey();
|
|
28
31
|
controller = new AbortController();
|
|
29
32
|
const signal = controller.signal;
|
|
30
33
|
const current = () => !stopped && runtime === getRuntimeKey() && !signal.aborted;
|
|
31
34
|
if (state.runtime !== runtime) { dirty.clear(); deleted.clear(); }
|
|
32
35
|
const previous = state.runtime === runtime ? state.updatedAt : null;
|
|
33
|
-
|
|
36
|
+
const showProgress = resume || !previous || ['partial', 'error', 'pending'].includes(state.phase);
|
|
37
|
+
state = { runtime, phase: showProgress ? 'indexing' : 'ready', since: now() - RETENTION, total: state.total, completed: 0, failed: 0, updatedAt: previous };
|
|
34
38
|
flight = (async () => {
|
|
35
39
|
if (service.coverage(runtime).indexCompletedAt === null) service.beginInitialization(runtime, now());
|
|
36
40
|
const revisions = new Map(service.pending(runtime).map(({ id, revision }) => [id, revision]));
|
|
@@ -171,6 +171,32 @@ test('persists initialization times only after all thirty-day history is covered
|
|
|
171
171
|
await runtime.stop(); service.close();
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
+
test('explicit resume reports active indexing, merges duplicate flights and skips successful checkpoints', async () => {
|
|
175
|
+
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
176
|
+
let release; let block = false; let fail = true; const reads = [];
|
|
177
|
+
const runtime = createContentSearchRuntime({ service, getRuntimeKey: () => 'host', now: () => 1000,
|
|
178
|
+
listSessions: async () => ({ data: ['a', 'b'].map((id) => ({ id, time: { updated: 999 } })) }),
|
|
179
|
+
listMessages: async ({ sessionID }) => {
|
|
180
|
+
reads.push(sessionID);
|
|
181
|
+
if (block) await new Promise((resolve) => { release = resolve; });
|
|
182
|
+
if (sessionID === 'b' && fail) throw new Error('offline');
|
|
183
|
+
return { data: [] };
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
try {
|
|
187
|
+
await runtime.sync();
|
|
188
|
+
expect(runtime.status().phase).toBe('partial');
|
|
189
|
+
block = true; fail = false;
|
|
190
|
+
const first = runtime.sync({ resume: true });
|
|
191
|
+
expect(runtime.sync({ resume: true })).toBe(first);
|
|
192
|
+
expect(runtime.status().phase).toBe('indexing');
|
|
193
|
+
for (let attempt = 0; attempt < 10 && !release; attempt++) await Promise.resolve();
|
|
194
|
+
expect(reads).toEqual(['a', 'b', 'b']);
|
|
195
|
+
release(); await first;
|
|
196
|
+
expect(runtime.status()).toMatchObject({ phase: 'ready', completed: 2, failed: 0 });
|
|
197
|
+
} finally { await runtime.stop(); service.close(); }
|
|
198
|
+
});
|
|
199
|
+
|
|
174
200
|
test('completed initialization survives incremental refresh, failure, restart and dirty events', async () => {
|
|
175
201
|
const service = createContentSearchService({ dbPath: ':memory:' });
|
|
176
202
|
let clock = 1000;
|
|
@@ -7,12 +7,26 @@ short discovery pointer enters `session.instructions.entry` under
|
|
|
7
7
|
no global OpenCode config, installed user skills, project files or old sessions
|
|
8
8
|
are modified.
|
|
9
9
|
|
|
10
|
-
References are organized by capability: window APIs, appearance, UI surfaces, global pages,
|
|
10
|
+
References are organized by capability: window APIs, appearance, UI surfaces, plugin styles, global pages, work-status widgets, icons,
|
|
11
11
|
file parsing/previews, preview actions/exports, and package workflow. Host contracts
|
|
12
12
|
and verification criteria are separate from illustrative templates and case
|
|
13
13
|
studies. Runmark and Eficy remain integration references; their service protocols,
|
|
14
14
|
renderers and compatibility choices are not requirements for unrelated plugins.
|
|
15
15
|
|
|
16
|
+
`references/plugin-styles.md` inventories existing host CSS variables for plugin-owned
|
|
17
|
+
Solid/DOM content, including colors, typography, geometry, controls and optional
|
|
18
|
+
theme config. The workflow routes every plugin view through this reference. Visual
|
|
19
|
+
consistency is authoring guidance through scoped CSS and SVG, not a React/Solid
|
|
20
|
+
component bridge or a host-provided UI component library. The host's `ctx.ui` remains
|
|
21
|
+
unsupported; plugin markup, layout and behavior remain plugin-owned.
|
|
22
|
+
|
|
23
|
+
`references/icons.md` distinguishes the upstream generated `IconName` union from
|
|
24
|
+
Yuri's actual titlebar/sidebar renderer, lists their verified shared names and
|
|
25
|
+
aliases, and separates entry icons from Settings artwork, file icons and branding.
|
|
26
|
+
It also documents same-document SVG symbol references, common sprite keys and the
|
|
27
|
+
current DOM/version boundary without exposing the React Icon component. Update its
|
|
28
|
+
shared-name list when the renderer or supported SDK catalog changes.
|
|
29
|
+
|
|
16
30
|
`references/ui-surfaces.md` is the shipped structural/style map for plugin authors
|
|
17
31
|
without a source checkout. It covers shell, sidebar, header, transcript, composer,
|
|
18
32
|
preview, Settings, overlays, tokens/cascade and native transparency boundaries.
|
|
@@ -24,6 +38,12 @@ The authoring workflow defaults to directly written `gui-experimental.cjs` with
|
|
|
24
38
|
host-provided modules and inline assets. Local edits use the existing revision
|
|
25
39
|
watcher; compilation is only an optional path for typed/JSX or bundled sources.
|
|
26
40
|
|
|
41
|
+
`references/work-status.md` documents `yuri.work-status`, its displayed-session
|
|
42
|
+
context, registration order, mount cancellation, desktop placements and Git
|
|
43
|
+
snapshot limitations. Its complete CJS example uses the existing Solid runtime,
|
|
44
|
+
CSS variables and SVG symbols; `skill-examples.test.ts` executes it against the
|
|
45
|
+
real host. The reference is included in the immutable staged resource inventory.
|
|
46
|
+
|
|
27
47
|
## Admission ownership
|
|
28
48
|
|
|
29
49
|
- Shared-service sessions: the existing scheduled-task admission route installs
|
|
@@ -2,7 +2,7 @@ import { readFile, mkdir, writeFile, rename, rm } from 'node:fs/promises';
|
|
|
2
2
|
import { createHash, randomUUID } from 'node:crypto';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
|
|
5
|
-
const files = ['SKILL.md', 'references/appearance.md', 'references/ui-surfaces.md', 'references/gui-api.md', 'references/workflow.md', 'references/global-pages.md', 'references/file-previews.md', 'references/preview-exports.md'];
|
|
5
|
+
const files = ['SKILL.md', 'references/appearance.md', 'references/ui-surfaces.md', 'references/plugin-styles.md', 'references/gui-api.md', 'references/workflow.md', 'references/global-pages.md', 'references/work-status.md', 'references/icons.md', 'references/file-previews.md', 'references/preview-exports.md'];
|
|
6
6
|
|
|
7
7
|
/** Stage immutable, shipped instructions; never edit the user's global skills/config. */
|
|
8
8
|
export function createCustomizationSkillInstaller({ yuriDataDir }) {
|
|
@@ -26,7 +26,7 @@ export function createCustomizationSkillInstaller({ yuriDataDir }) {
|
|
|
26
26
|
return async (client, sessionID) => {
|
|
27
27
|
const file = await prepare();
|
|
28
28
|
await client.session.instructions.entry.put({ sessionID, key: 'yuri.customization',
|
|
29
|
-
value: `Yuri customization: for appearance (themes, CSS/layout, Logo, macOS Dock), global pages/tabs, custom file parsing/previews, preview exports, or GUI panels/commands/settings, read ${JSON.stringify(file)} before choosing a plugin API. Its UI structure
|
|
29
|
+
value: `Yuri customization: for appearance (themes, CSS/layout, Logo, macOS Dock), work-status widgets, global pages/tabs, custom file parsing/previews, preview exports, or GUI panels/commands/settings, read ${JSON.stringify(file)} before choosing a plugin API. Its style/icon references guide plugin-owned content; UI structure maps built-in blocks, selectors and transparency layers; capability references cover contracts and runtime limits. Use its workflow for building, installation and rollback. Install or apply changes only when requested.`,
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
}
|
|
@@ -23,7 +23,9 @@ describe('built-in customization instructions', () => {
|
|
|
23
23
|
expect(entry.value.length).toBeLessThan(1500);
|
|
24
24
|
const file = JSON.parse(entry.value.match(/read (".*?") before/)[1]);
|
|
25
25
|
expect(await fs.readFile(file, 'utf8')).toContain('name: yuri-customization');
|
|
26
|
-
for (const name of ['appearance', 'ui-surfaces', 'gui-api', 'workflow', 'global-pages', 'file-previews', 'preview-exports']) expect((await fs.readFile(path.join(path.dirname(file), 'references', `${name}.md`), 'utf8')).length).toBeGreaterThan(500);
|
|
26
|
+
for (const name of ['appearance', 'ui-surfaces', 'plugin-styles', 'gui-api', 'workflow', 'global-pages', 'work-status', 'icons', 'file-previews', 'preview-exports']) expect((await fs.readFile(path.join(path.dirname(file), 'references', `${name}.md`), 'utf8')).length).toBeGreaterThan(500);
|
|
27
|
+
expect(await fs.readFile(file, 'utf8')).toContain('(references/icons.md)');
|
|
28
|
+
expect(await fs.readFile(path.join(path.dirname(file), 'references', 'global-pages.md'), 'utf8')).toContain('(icons.md)');
|
|
27
29
|
expect(await fs.readFile(path.join(path.dirname(file), 'references', 'appearance.md'), 'utf8')).toContain('yuri.branding');
|
|
28
30
|
expect(put.mock.calls[1][0].value).toBe(entry.value);
|
|
29
31
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yuri-customization
|
|
3
|
-
description: Customize Yuri through GUI plugins for appearance, global pages, custom file previews, export actions, panels, commands, and settings.
|
|
3
|
+
description: Customize Yuri through GUI plugins for appearance, work-status widgets, global pages, custom file previews, export actions, panels, commands, and settings.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Yuri customization
|
|
@@ -11,14 +11,18 @@ Use a standard OpenCode GUI plugin to change the running Yuri UI without modifyi
|
|
|
11
11
|
|
|
12
12
|
1. Identify the requested change and target client: Web, Electron, VS Code, hosted mobile, or Capacitor. Separate visual changes from backend behavior. Inspect the user's existing plugin/config before changing it. An explanation request does not authorize installation.
|
|
13
13
|
2. Choose the extension point by the requested capability and read its reference:
|
|
14
|
+
- Every plugin-owned view: [CSS variables and styling](references/plugin-styles.md); use the host's existing tokens in plugin-owned CSS to follow Yuri's appearance.
|
|
14
15
|
- Existing UI blocks, backgrounds/transparency, selectors, spacing and built-in style tokens: [UI structure and styles](references/ui-surfaces.md). Start here for CSS changes before inspecting application bundles.
|
|
15
16
|
- Themes, CSS, logos, Dock icons: [appearance](references/appearance.md).
|
|
16
17
|
- Global main-content tabs and titlebar entries: [global pages](references/global-pages.md).
|
|
18
|
+
- Widgets under Changes in the conversation's status column: [work-status widgets](references/work-status.md).
|
|
19
|
+
- Entry/tab icons or icons inside plugin content: [icons](references/icons.md), including supported names, same-document SVG usage and artwork boundaries.
|
|
17
20
|
- Custom file suffixes, parsers, inline/mobile previews and file icons: [file previews](references/file-previews.md).
|
|
18
21
|
- Preview toolbar placement, PDF/PNG/HTML export and iframe snapshot boundaries: [preview actions and exports](references/preview-exports.md).
|
|
19
22
|
- Panels, commands, settings, files, RPC, lifecycle, runtime support: [GUI API](references/gui-api.md).
|
|
20
23
|
- Every implementation: [direct-CJS package, installation, updates and rollback](references/workflow.md); compilation is an optional branch.
|
|
21
24
|
3. Default to `package.json` plus a directly authored `gui-experimental.cjs`, using host-provided modules and inline CSS/assets. This needs no dependency install or compilation. Implement only the requested capabilities; use the optional build branch when TS/TSX or dependency bundling is actually needed.
|
|
25
|
+
Yuri's React shell owns the container; the plugin owns its Solid/DOM content. Share visual style through CSS variables and icon references, not host React components or a host-provided Solid component library.
|
|
22
26
|
4. Syntax-check the exported CJS file and install within the requested scope, preserving unrelated global OpenCode configuration. A local CJS edit reloads through the existing watcher; project-only configuration does not provide window GUI inventory.
|
|
23
27
|
5. Verify each requested capability in the target client, including its failure and cleanup behavior; use the matching reference's verification criteria. Finish with the plugin directory, changed settings, verified behavior, known limits, and how to undo it.
|
|
24
28
|
|
|
@@ -74,7 +74,7 @@ Those message names, header and navigation rules form Runmark's service protocol
|
|
|
74
74
|
|
|
75
75
|
## Entry icon versus content branding
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Choose `TitlebarItem.icon` from the supported catalog names in [plugin entry icons](icons.md), which covers upstream `IconName`, Yuri's compatible names/aliases and fallback behavior. Set it on the entry itself; `yuri.page.icon` does not configure that entry. Top-level `package.json.icon` supplies artwork in Settings plugin details, not the global navigation entry. Application Logo/Dock branding uses `yuri.branding`; see [appearance](appearance.md).
|
|
78
78
|
|
|
79
79
|
## Verification
|
|
80
80
|
|
|
@@ -5,7 +5,7 @@ The supported contract is OpenCode GUI SDK **2.2.0**. Consult current official d
|
|
|
5
5
|
## Window APIs
|
|
6
6
|
|
|
7
7
|
- `Command`: command palette and plugin management execution; hidden commands can be called by `ctx.commands.run`. No GUI shortcut registration or slash autocomplete yet.
|
|
8
|
-
- `TitlebarItem`: global action/status, independent of a session; reactive label/title/icon/busy/pressed.
|
|
8
|
+
- `TitlebarItem`: global action/status, independent of a session; reactive label/title/icon/busy/pressed. Supported icon names and upstream/Yuri differences: [icons](icons.md).
|
|
9
9
|
- `Panel`: Solid `list/render`, reactive session/tab getters; file panels mount in existing file previews. An independent panel uses a dialog/mobile sheet, not upstream's full draggable workspace layout.
|
|
10
10
|
- `LinkHandler`: match, exists and open file/custom links. Use `ctx.links.open({ href, base, session })` for navigation. Preserve workspace-relative identity; never resolve against a different session's directory.
|
|
11
11
|
- `SettingsPage`: independent plugin settings pages; host `page/section` injection is unsupported.
|
|
@@ -20,11 +20,14 @@ The supported contract is OpenCode GUI SDK **2.2.0**. Consult current official d
|
|
|
20
20
|
|
|
21
21
|
Unsupported registries include upstream `Server`, `ComposerPill`, `Slot`, `FileViewer`, native menu/embeds. Unsupported APIs reject rather than succeeding silently.
|
|
22
22
|
|
|
23
|
+
Plugin renderers own their Solid/DOM content. Yuri does not implement upstream `ctx.ui` or expose its React components to plugins; follow [CSS variables and styling](plugin-styles.md) and [icons](icons.md) for visual consistency.
|
|
24
|
+
|
|
23
25
|
## Yuri supplemental registries and contracts
|
|
24
26
|
|
|
25
27
|
- `yuri.theme`, `yuri.branding`: see [appearance](appearance.md).
|
|
26
28
|
- `yuri.file-icon`: `{ id, extensions: string[], svg, lightSvg? }`; static SVG resources for file extensions, not app/Dock icons.
|
|
27
29
|
- `yuri.page` / `yuri.pages`: global main-content Solid pages, desktop layouts/VS Code only. Exact types, entry points and optional web-app embedding: [global pages](global-pages.md).
|
|
30
|
+
- `yuri.work-status`: inline/popup widgets below Changes in the desktop conversation status column; read-only displayed-session/project/Git context and mount-scoped cancellation. See [work-status widgets](work-status.md).
|
|
28
31
|
- Custom suffix parsing, normalized file identities, `PanelTab.file` and mobile sheets: [file previews](file-previews.md).
|
|
29
32
|
- `yuri.exportPDF`, `yuri.exportLongImage`, `yuri.previewActions`: separate host contracts for client-owned export/preview actions. Exact types, registration lifetime, capture protocol and runtime matrix: [preview actions and exports](preview-exports.md).
|
|
30
33
|
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Plugin icons
|
|
2
|
+
|
|
3
|
+
Use this reference when choosing an entry icon or rendering icons inside plugin-owned Solid/DOM content. Icon names, package artwork, file icons and application branding are separate contracts. Use [plugin styles](plugin-styles.md) for the surrounding text and colors.
|
|
4
|
+
|
|
5
|
+
## Upstream contract
|
|
6
|
+
|
|
7
|
+
OpenCode's `TitlebarItem.icon` is an optional `IconName`, imported as a **type** from `@opencode/plugin/gui`. Its value is a catalog name such as `globe`, not an SVG string, image URL, CSS class or component. The type is erased at runtime; it is not an exported array or an icon renderer.
|
|
8
|
+
|
|
9
|
+
Upstream generates the SDK union from the application's icon catalog:
|
|
10
|
+
|
|
11
|
+
- [`packages/plugin/src/gui/icon-name.ts`](https://github.com/anomalyco/opencode/blob/dev/packages/plugin/src/gui/icon-name.ts): accepted SDK names; editor completion comes from this union.
|
|
12
|
+
- [`packages/ui/src/icons/catalog.ts`](https://github.com/anomalyco/opencode/blob/dev/packages/ui/src/icons/catalog.ts): upstream artwork and catalog.
|
|
13
|
+
- [`packages/plugin/script/icon-name.ts`](https://github.com/anomalyco/opencode/blob/dev/packages/plugin/script/icon-name.ts): generator; the SDK carries the names without requiring `@opencode/ui` in plugin bundles.
|
|
14
|
+
- [Official GUI reference](https://opencode.ai/v2/docs/build/plugins/gui#titlebar-items): contribution syntax.
|
|
15
|
+
|
|
16
|
+
Use the installed SDK's declaration for its exact version. The links above follow upstream development; a name accepted by a newer SDK is not proof that Yuri renders it.
|
|
17
|
+
|
|
18
|
+
## Names supported by both hosts
|
|
19
|
+
|
|
20
|
+
For a plugin targeting OpenCode and Yuri, choose from this verified intersection of the upstream SDK catalog and Yuri's current **TitlebarItem** renderer (including aliases):
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
archive arrow-left arrow-right arrow-up brain check circle-check circle-x
|
|
24
|
+
close code download edit eye flask folder github globe graduation-cap
|
|
25
|
+
keyboard layout-left layout-right lock refresh server shield stop task
|
|
26
|
+
terminal window-analytics
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Common choices:
|
|
30
|
+
|
|
31
|
+
| Purpose | `icon` |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| Web/service page | `globe` |
|
|
34
|
+
| Dashboard/analytics | `window-analytics` |
|
|
35
|
+
| Server/connection | `server` |
|
|
36
|
+
| Files/workspace | `folder` |
|
|
37
|
+
| Code/development | `code` or `terminal` |
|
|
38
|
+
| Tasks | `task` |
|
|
39
|
+
| Experiments | `flask` |
|
|
40
|
+
| Success/failure | `circle-check` / `circle-x` |
|
|
41
|
+
|
|
42
|
+
For the direct-CJS workflow, put the name in the contribution; no icon import or dependency is needed:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
const { Plugin, TitlebarItem } = require('@opencode/plugin/gui')
|
|
46
|
+
|
|
47
|
+
module.exports = Plugin.define({
|
|
48
|
+
setup(ctx) {
|
|
49
|
+
ctx.add(TitlebarItem, {
|
|
50
|
+
id: 'website', label: 'Studio', icon: 'globe',
|
|
51
|
+
run: () => ctx.system.openExternal('https://example.com'),
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For typed reactive contributions, annotate the return type as in the [global-page example](global-pages.md); otherwise TypeScript can widen `icon` to `string`.
|
|
58
|
+
|
|
59
|
+
## Yuri resolution and fallback
|
|
60
|
+
|
|
61
|
+
Yuri resolves `TitlebarItem.icon` through these aliases first, then an exact key in its own sprite:
|
|
62
|
+
|
|
63
|
+
| SDK name | Yuri sprite key |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `globe` | `global` |
|
|
66
|
+
| `server` | `server` |
|
|
67
|
+
| `circle-check` | `checkbox-circle` |
|
|
68
|
+
| `circle-x` | `close-circle` |
|
|
69
|
+
| `window-analytics` | `bar-chart-box` |
|
|
70
|
+
|
|
71
|
+
Yuri's sprite contains additional names, but those are not automatically valid upstream `IconName` values. Use the shared names above for portable SDK contributions rather than casting a Yuri-only name into the SDK type. For an unlisted name, check the installed SDK and target Yuri version before relying on it.
|
|
72
|
+
|
|
73
|
+
- Missing or unknown name: Yuri keeps the entry label. Sidebar placement reserves an empty icon slot; titlebar placement renders text instead of an icon. It does not substitute package artwork or the upstream default download arrow.
|
|
74
|
+
- `busy: true`: a loading spinner replaces the icon and disables an actionable entry.
|
|
75
|
+
- Valid icon: titlebar placement shows the icon with a hover label; sidebar placement shows icon and text. Host styles control size and color.
|
|
76
|
+
- Registering `yuri.page.icon` alone does not create or configure its navigation entry. Register `TitlebarItem` and set its `icon` separately, as in [global pages](global-pages.md).
|
|
77
|
+
|
|
78
|
+
Source owners, matched to the target Yuri tag when available:
|
|
79
|
+
|
|
80
|
+
- [`GuiPluginTitlebarItems.tsx`](https://github.com/yee94/yuri/blob/main/packages/ui/src/components/gui-plugins/GuiPluginTitlebarItems.tsx): aliases, placement and fallback.
|
|
81
|
+
- [`sprite.ts`](https://github.com/yee94/yuri/blob/main/packages/ui/src/components/icon/sprite.ts): complete Yuri runtime catalog (the keys of `iconSpriteData`), not the upstream SDK union.
|
|
82
|
+
|
|
83
|
+
## Icons inside plugin content
|
|
84
|
+
|
|
85
|
+
For same-document content, Yuri's React `Icon` mounts a hidden SVG sprite with id `yuri-icon-sprite-v2`; its symbols use `yuri-<sprite-key>`. A plugin can reference an existing symbol with ordinary SVG, without importing the React component or a Solid wrapper:
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none"
|
|
89
|
+
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
|
|
90
|
+
stroke-linejoin="round" aria-hidden="true" focusable="false"
|
|
91
|
+
style="flex-shrink: 0; --yuri-icon-stroke: 1.5">
|
|
92
|
+
<use href="#yuri-folder"></use>
|
|
93
|
+
</svg>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The same markup works in Solid; direct CJS can create `svg` and `use` with `document.createElementNS('http://www.w3.org/2000/svg', ...)`. Inherit `currentColor` from the surrounding text. Common host sizes are 14px for dense status rows and 16px for controls; the normal stroke is 1.5, with `--yuri-icon-stroke: 2` for stronger small icons. Put accessible text on the containing button when the SVG is decorative.
|
|
97
|
+
|
|
98
|
+
Common **sprite keys**, verified against Yuri's current catalog:
|
|
99
|
+
|
|
100
|
+
| Purpose | Sprite keys |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| Project / branch / worktree / changes | `folder`, `git-branch`, `node-tree`, `changes` |
|
|
103
|
+
| Expand / collapse | `arrow-right-s`, `arrow-down-s` |
|
|
104
|
+
| Success / failure / information | `check`, `checkbox-circle`, `close-circle`, `alert`, `information` |
|
|
105
|
+
| Actions | `file-copy`, `download`, `refresh`, `settings-2`, `external-link`, `close` |
|
|
106
|
+
| Loading | `loader-4` (the symbol itself is static; animation belongs to the plugin) |
|
|
107
|
+
| Web / analytics | `global`, `bar-chart-box` |
|
|
108
|
+
|
|
109
|
+
`<use>` needs the exact sprite key: the entry aliases above do not apply (`global`, not `globe`; `checkbox-circle`, not `circle-check`). The complete source catalog is the linked `sprite.ts`. To inspect an installed host's available names once:
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
Array.from(
|
|
113
|
+
document.querySelectorAll('#yuri-icon-sprite-v2 symbol[id^="yuri-"]'),
|
|
114
|
+
symbol => symbol.id.slice('yuri-'.length),
|
|
115
|
+
)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
These symbol IDs are current DOM implementation hooks, not an SDK icon-renderer API. The sprite is inserted when a host icon renders; check that the chosen symbol exists in the target document. A missing symbol renders no artwork: retain a text label or use plugin-owned inline SVG. Iframes cannot reference the parent document's symbols. The host owns sprite insertion and replacement; plugins only reference it. Standalone artwork should use a 24×24 viewBox, `currentColor` and matching stroke conventions where appropriate.
|
|
119
|
+
|
|
120
|
+
## Artwork boundaries
|
|
121
|
+
|
|
122
|
+
| Surface | Contract |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| Global plugin page/tab navigation entry | `TitlebarItem.icon`: supported catalog name |
|
|
125
|
+
| Plugin artwork in Settings plugin details | Top-level `package.json.icon`: validated image/data resource; not used by the global entry renderer |
|
|
126
|
+
| Custom file extension icon | `yuri.file-icon`: SVG resource; see [file previews](file-previews.md) |
|
|
127
|
+
| Application Logo / running macOS Dock icon | `yuri.branding`; see [appearance](appearance.md) |
|
|
128
|
+
| Artwork inside plugin-owned page content | Render it in the page's own Solid/DOM content |
|
|
129
|
+
|
|
130
|
+
The current entry contract has no custom-SVG/image field. Supplying an image URL as `TitlebarItem.icon`, or setting `package.json.icon`, does not add one.
|
|
131
|
+
|
|
132
|
+
## Verification
|
|
133
|
+
|
|
134
|
+
Check the actual entry in each target placement: selected artwork, visible/hover label, `busy` spinner, missing-name fallback, and withdrawal when the plugin is disabled. SDK typechecking alone does not prove Yuri runtime support.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Styling plugin-owned content
|
|
2
|
+
|
|
3
|
+
Use this reference when rendering a plugin page, panel, preview or settings view. Yuri provides theme CSS variables in the host document; the plugin owns its markup, CSS, layout and interactions. The React shell supplies the mount container and the existing GUI host mounts Solid/DOM content inside it. There is no Yuri GUI component library or implemented `ctx.ui` to import.
|
|
4
|
+
|
|
5
|
+
## Using the host styles
|
|
6
|
+
|
|
7
|
+
1. Put a plugin-specific class or data attribute on the content root and scope the plugin's CSS beneath it. Register that CSS with official `Style` so disabling the plugin removes it.
|
|
8
|
+
2. Use the variables below for colors and typography; let same-document CSS inheritance follow theme changes. Keep inline content transparent when its host already owns the background.
|
|
9
|
+
3. Choose icons from [icons](icons.md). Entry contribution names and SVG symbols inside content have different naming rules.
|
|
10
|
+
4. Verify the mounted view in light/dark mode, narrow width, keyboard focus and disabled/selected states. These references guide appearance; they do not constrain the plugin's business UI or supply its interaction behavior.
|
|
11
|
+
|
|
12
|
+
CSS colors are complete values: `color: var(--foreground)`, not `hsl(var(--foreground))`. Variables resolve at the consuming element, including local surface overrides. Prefer CSS over reading root styles into JavaScript snapshots; a snapshot does not follow theme changes by itself. Plugin bundles are not scanned by Yuri's Tailwind build, so arbitrary utility classes in a plugin are not guaranteed to exist. Write the needed CSS explicitly.
|
|
13
|
+
|
|
14
|
+
## Global color variables
|
|
15
|
+
|
|
16
|
+
The theme generator publishes these in the host document. Use the name whose meaning matches the element rather than selecting a color by how it looks in one theme.
|
|
17
|
+
|
|
18
|
+
| Purpose | Variables |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Canvas and ordinary text | `--background`, `--foreground` |
|
|
21
|
+
| Muted surface and secondary text | `--muted`, `--muted-foreground` |
|
|
22
|
+
| Raised content | `--card`, `--card-foreground` |
|
|
23
|
+
| Popover content | `--popover`, `--popover-foreground` |
|
|
24
|
+
| Secondary surface | `--secondary`, `--secondary-foreground` |
|
|
25
|
+
| Subtle surface | `--accent`, `--accent-foreground` |
|
|
26
|
+
| Borders and focus ring | `--border`, `--input`, `--ring`; `--input` is a border color, not an input fill |
|
|
27
|
+
| Theme accent | `--primary`, `--primary-foreground`; use for links/emphasis, not the default button fill |
|
|
28
|
+
| Destructive feedback | `--destructive`, `--destructive-foreground` |
|
|
29
|
+
| Semantic surfaces | `--surface-background`, `--surface-foreground`, `--surface-muted`, `--surface-muted-foreground`, `--surface-elevated`, `--surface-elevated-foreground`, `--surface-subtle`, `--surface-overlay` |
|
|
30
|
+
| Hover and pressed | `--interactive-hover`, `--interactive-active`; apply to interactive elements |
|
|
31
|
+
| Selected item | `--interactive-selection`, `--interactive-selection-foreground` |
|
|
32
|
+
| Interactive borders | `--interactive-border`, `--interactive-border-hover`, `--interactive-border-focus` |
|
|
33
|
+
| Focus and cursor | `--interactive-focus`, `--interactive-focus-ring`, `--interactive-cursor` |
|
|
34
|
+
| Accent variants | `--primary-base`, `--primary-hover`, `--primary-active`, `--primary-muted`, `--primary-emphasis` |
|
|
35
|
+
| Status | `--status-error`, `--status-warning`, `--status-success`, `--status-info`; each also has `-foreground`, `-background` and `-border` variants |
|
|
36
|
+
| Sidebar | `--sidebar`, `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-primary-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring` |
|
|
37
|
+
| Loading indicator | `--loading-spinner`, `--loading-spinner-track` |
|
|
38
|
+
| Charts | `--chart-1` through `--chart-5` have base styles; further numbered colors depend on the theme's series |
|
|
39
|
+
| Pull-request state | `--pr-open`, `--pr-draft`, `--pr-blocked`, `--pr-merged`, `--pr-closed` |
|
|
40
|
+
| Code | `--syntax-background`, `--syntax-foreground`, `--syntax-comment`, `--syntax-keyword`, `--syntax-string`, `--syntax-number`, `--syntax-function`, `--syntax-variable`, `--syntax-type`, `--syntax-operator` |
|
|
41
|
+
|
|
42
|
+
Semantic variables and short aliases are emitted separately. Reading either is supported; overriding one does not automatically rewrite the other. For changing Yuri itself, use the [cascade and surface map](ui-surfaces.md#token-map-and-cascade), rather than overriding global tokens as part of an ordinary plugin view.
|
|
43
|
+
|
|
44
|
+
## Text, geometry and controls
|
|
45
|
+
|
|
46
|
+
| Purpose | Variables / behavior |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| Font families | `--font-sans`, `--font-mono`; use `font: inherit` for controls that should follow their surrounding text |
|
|
49
|
+
| Font weight | `--ui-regular-font-weight` |
|
|
50
|
+
| Semantic text sizes | `--text-ui-header`, `--text-ui-label`, `--text-meta`, `--text-micro`, `--text-markdown`, `--text-code`; names describe roles, not a guaranteed size ordering |
|
|
51
|
+
| Button typography | `--ui-button-line-height`, `--ui-button-letter-spacing`, `--ui-button-font-weight` |
|
|
52
|
+
| Caption typography | `--ui-caption-line-height`, `--ui-caption-letter-spacing`, `--ui-caption-font-weight` |
|
|
53
|
+
| Base radius | `--radius` |
|
|
54
|
+
| Radius scale | Design-system names `--radius-none`, `--radius-sm`, `--radius-md`, `--radius-lg`, `--radius-xl`, `--radius-full` are declared in Tailwind's theme; use a fallback such as `var(--radius-lg, var(--radius))` if a build does not retain a variable |
|
|
55
|
+
| Spacing density | `--padding-scale` is unitless; e.g. `gap: calc(0.5rem * var(--padding-scale, 1))` |
|
|
56
|
+
| Physical scale | `--dpt` is a length, `--dpt-n` a unitless factor; desktop defaults are `1px` / `1`. `--padding-scale` already includes the physical factor |
|
|
57
|
+
| Form dimensions | `--form-control-height`, `--form-control-radius` |
|
|
58
|
+
| Form colors | `--form-control-background`, `--form-control-border` |
|
|
59
|
+
| Form typography | `--form-control-font-size`, `--form-control-line-height`, `--form-helper-font-size`, `--form-helper-line-height` |
|
|
60
|
+
| Form dividers | `--form-surface-border`, `--form-row-divider` |
|
|
61
|
+
| Optional theme config | `--font-heading`, `--transition-fast`, `--transition-normal`, `--transition-slow` exist when supplied by the theme; provide a fallback |
|
|
62
|
+
|
|
63
|
+
Form tokens can be overridden by Settings ancestors. Settings-only `--yuri-settings-*` variables and popup-specific materials are described in [UI surfaces](ui-surfaces.md); they are not universally available to a plugin mounted elsewhere. Host mobile CSS also applies its minimum touch sizes to ordinary buttons in plugin content.
|
|
64
|
+
|
|
65
|
+
## Small CSS example
|
|
66
|
+
|
|
67
|
+
This is plugin-owned CSS, not a component or a registration of a new extension point. Register it with `ctx.add(Style, css)` and put `class="studio-view"` on the plugin root. Its child markup can be authored with Solid or DOM APIs.
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
.studio-view {
|
|
71
|
+
min-width: 0;
|
|
72
|
+
color: var(--foreground);
|
|
73
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
74
|
+
font-size: var(--text-ui-label);
|
|
75
|
+
font-weight: var(--ui-regular-font-weight, 400);
|
|
76
|
+
}
|
|
77
|
+
.studio-view .studio-row {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
gap: calc(0.5rem * var(--padding-scale, 1));
|
|
82
|
+
}
|
|
83
|
+
.studio-view .studio-detail { color: var(--muted-foreground); }
|
|
84
|
+
.studio-view .studio-success { color: var(--status-success); }
|
|
85
|
+
.studio-view .studio-action {
|
|
86
|
+
font: inherit;
|
|
87
|
+
color: var(--foreground);
|
|
88
|
+
background: var(--surface-muted);
|
|
89
|
+
border: 0;
|
|
90
|
+
border-radius: var(--radius-lg, var(--radius));
|
|
91
|
+
padding: 0.375rem 0.625rem;
|
|
92
|
+
}
|
|
93
|
+
.studio-view .studio-action:hover:not(:disabled) {
|
|
94
|
+
background: color-mix(in srgb, var(--foreground) 6%, var(--surface-muted));
|
|
95
|
+
}
|
|
96
|
+
.studio-view .studio-action:active:not(:disabled) {
|
|
97
|
+
background: color-mix(in srgb, var(--foreground) 12%, var(--surface-muted));
|
|
98
|
+
}
|
|
99
|
+
.studio-view .studio-action:focus-visible {
|
|
100
|
+
outline: 2px solid var(--interactive-focus-ring) !important;
|
|
101
|
+
outline-offset: 2px;
|
|
102
|
+
}
|
|
103
|
+
.studio-view .studio-action:disabled { opacity: 0.5; }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The example uses Yuri's neutral solid action colors. Quiet row actions can use transparent rest / `--interactive-hover` / `--interactive-active`; selected rows use the selection pair. The scoped focus rule is important because host base styles reset non-input focus outlines with `!important`. Use native `button` semantics for actions and keep any additional behavior in the plugin.
|
|
107
|
+
|
|
108
|
+
## Document boundaries
|
|
109
|
+
|
|
110
|
+
Same-document Solid/DOM content inherits these variables without a React-to-Solid component bridge or theme polling. An iframe has a separate document and does not inherit them or the host's SVG symbols; apply its own theming mechanism when using one. CSS and icon guidance do not create new GUI capabilities.
|
|
111
|
+
|
|
112
|
+
Source owners: `packages/ui/src/lib/theme/cssGenerator.ts`, `packages/ui/src/styles/design-system.css`, `packages/ui/src/styles/typography.css`, `packages/ui/src/components/ui/button.tsx`. Check the matching Yuri version when a variable is unavailable.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Read this for changes to existing Yuri blocks: backgrounds, sidebar, header, chat, composer, preview, Settings or overlays. For contribution schemas and activation, use [appearance](appearance.md). This map travels with Yuri so plugin authors can start without a source checkout or unpacking the application.
|
|
4
4
|
|
|
5
|
+
For styling a plugin's own content, start with [CSS variables and styling](plugin-styles.md) and [icons](icons.md). The map below describes existing host surfaces rather than reusable UI components.
|
|
6
|
+
|
|
5
7
|
## Fast path
|
|
6
8
|
|
|
7
9
|
1. Locate the requested block in the table below. Prefer a theme contribution for coordinated colors, or a scoped `Style` rule for one block's material/geometry.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Work-status widgets
|
|
2
|
+
|
|
3
|
+
`Registry.define('yuri.work-status')` contributes plugin-owned Solid/DOM content below Changes and above Todos in the conversation's work-status column. It uses the same GUI package, plugin context and Solid renderer as panels/pages. This is a Yuri supplemental registry, not the upstream `Slot` registry.
|
|
4
|
+
|
|
5
|
+
## Registration and layout
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
interface WorkStatusContribution {
|
|
9
|
+
readonly id: string
|
|
10
|
+
readonly order?: number
|
|
11
|
+
render(props: WorkStatusProps): import('solid-js').JSX.Element
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Register with official `ctx.add`. An accessor returning `undefined` withdraws the widget. IDs are non-empty strings up to 128 characters, unique within this plugin's work-status contributions. `order` defaults to zero and must be finite. Widgets sort by ascending order, then the server's global plugin inventory order, then registration order within that plugin. Keep the render function stable when updating only order or visibility.
|
|
16
|
+
|
|
17
|
+
Content has natural height and shares the column's scrolling. An empty contribution creates no visible placeholder. There is no host title, card or component toolkit. Use [plugin styles](plugin-styles.md) and [icons](icons.md) to follow the surrounding appearance; the plugin owns its markup and interactions. Inline column width is currently 196px; the popup is 264px including its padding. Fit the available container rather than hardcoding a page width.
|
|
18
|
+
|
|
19
|
+
Web desktop and Electron render the widgets in both inline and popup modes, including when connected to a remote/Relay Host. Mobile, Capacitor and VS Code currently have no work-status column and do not mount these contributions. Registration itself remains valid. The slot follows the column's visibility setting and adds no native permissions or startup loading gate.
|
|
20
|
+
|
|
21
|
+
## Injected information
|
|
22
|
+
|
|
23
|
+
`render` runs once per mount. Read reactive properties inside Solid computations instead of destructuring their initial values.
|
|
24
|
+
|
|
25
|
+
| Property | Shape and source |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `session` | Official `MountedSession` reference for **this displayed conversation**, or `undefined` before a draft has a session/directory. Yuri supports `id`, `key`, `directory`, `server`, `tab`, `pending`, `visit`, `location` on this reference; unsupported SDK members reject as elsewhere. |
|
|
28
|
+
| `directory` | Actual displayed working directory, or `null` while unresolved. Never replaced with another selected project's directory. |
|
|
29
|
+
| `runtimeId` | Current host transport identity. Treat as opaque scope information, not a URL or durable cross-transport key. |
|
|
30
|
+
| `project` | Reactive `{ id?: string, name: string, directory: string } \| null`. Same project/worktree resolution as the built-in rows; a directory fallback can have no project ID. |
|
|
31
|
+
| `worktree` | Reactive `{ name: string, directory: string } \| null`. Explicit attached/discovered worktree, when known. |
|
|
32
|
+
| `git` | Reactive read-only summary described below, shared with the built-in Git rows. |
|
|
33
|
+
| `placement` | Reactive `'inline' \| 'popover'`. |
|
|
34
|
+
| `active` | `true` while mounted; changes to `false` before disposal. |
|
|
35
|
+
| `signal` | This mount's `AbortSignal`. Aborts on hiding, scope change, withdrawal, plugin replacement/disable/failure or host disposal. |
|
|
36
|
+
|
|
37
|
+
Git summary fields:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
interface GitSummary {
|
|
41
|
+
readonly state: 'unknown' | 'not-repository' | 'ready'
|
|
42
|
+
readonly loading: boolean
|
|
43
|
+
readonly branch: string | null
|
|
44
|
+
readonly changedFiles: number | null
|
|
45
|
+
readonly additions: number | null
|
|
46
|
+
readonly deletions: number | null
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`unknown` includes unresolved and pending-worktree data. Missing totals are `null`, not zero; a light Git snapshot can have a branch/file count but no line totals. `not-repository` comes from the shared repository check. `ready` describes the last available snapshot, not a successful request on every render. The existing Git store preserves its last snapshot after refresh failure and does not publish error details here; `loading` describes its foreground status load, not silent background requests. The slot adds no Git polling, file-content reads or message-history subscriptions.
|
|
51
|
+
|
|
52
|
+
Theme, locale, plugin options and authenticated client remain on `usePlugin()` / setup `ctx`. `ctx.sessions.current()` still describes the window's primary selection; use the injected session for widget-scoped requests. Existing navigation APIs retain their support boundaries: for example, file navigation for an explicitly different session can be rejected. Do not silently retarget it to the primary conversation.
|
|
53
|
+
|
|
54
|
+
## Lifecycle and updates
|
|
55
|
+
|
|
56
|
+
Changing project/Git metadata or placement updates the existing Solid view; unrelated session/layout/stream updates do not rebuild the widget catalog or remount its DOM. Changing the displayed session ID, directory or host creates a new mount and aborts the previous one. Multiple visible instances have independent props and signals.
|
|
57
|
+
|
|
58
|
+
Use `onCleanup` for listeners and timers, or bind DOM listeners/requests to `props.signal`. Ignore completed asynchronous work after that signal aborts. Registration and rendering exceptions use the existing plugin failure path: affected content disappears, diagnostics remain in plugin settings, and unrelated plugins stay usable. Arbitrary plugin JavaScript still runs on the window's main thread; keep expensive work out of setup/render and stop view-owned work on cleanup.
|
|
59
|
+
|
|
60
|
+
## Complete direct-CJS example
|
|
61
|
+
|
|
62
|
+
Use the package layout in [workflow](workflow.md). This example displays the owning project and branch using inherited colors and a host SVG symbol. It needs no component imports or compilation.
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const { Plugin, Registry, Style } = require('@opencode/plugin/gui')
|
|
66
|
+
const { createEffect } = require('solid-js')
|
|
67
|
+
const WorkStatus = Registry.define('yuri.work-status')
|
|
68
|
+
|
|
69
|
+
module.exports = Plugin.define({
|
|
70
|
+
setup(ctx) {
|
|
71
|
+
ctx.add(Style, `
|
|
72
|
+
.workspace-widget {
|
|
73
|
+
display: flex; align-items: center; min-width: 0;
|
|
74
|
+
gap: calc(0.5rem * var(--padding-scale, 1)); padding: 0.375rem 0.5rem;
|
|
75
|
+
font-family: var(--font-sans, system-ui, sans-serif);
|
|
76
|
+
font-size: var(--text-ui-label); color: var(--muted-foreground);
|
|
77
|
+
}
|
|
78
|
+
.workspace-widget span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
79
|
+
`)
|
|
80
|
+
ctx.add(WorkStatus, {
|
|
81
|
+
id: 'workspace', order: 10,
|
|
82
|
+
render(props) {
|
|
83
|
+
const row = document.createElement('div')
|
|
84
|
+
row.className = 'workspace-widget'
|
|
85
|
+
const ns = 'http://www.w3.org/2000/svg'
|
|
86
|
+
const icon = document.createElementNS(ns, 'svg')
|
|
87
|
+
icon.setAttribute('viewBox', '0 0 24 24')
|
|
88
|
+
icon.setAttribute('width', '14')
|
|
89
|
+
icon.setAttribute('height', '14')
|
|
90
|
+
icon.setAttribute('aria-hidden', 'true')
|
|
91
|
+
icon.style.cssText = 'flex-shrink:0; --yuri-icon-stroke:2'
|
|
92
|
+
const use = document.createElementNS(ns, 'use')
|
|
93
|
+
use.setAttribute('href', '#yuri-git-branch')
|
|
94
|
+
icon.append(use)
|
|
95
|
+
const label = document.createElement('span')
|
|
96
|
+
row.append(icon, label)
|
|
97
|
+
createEffect(() => {
|
|
98
|
+
const name = props.project?.name || props.directory || ''
|
|
99
|
+
const branch = props.git.branch
|
|
100
|
+
label.textContent = branch ? `${name} · ${branch}` : name
|
|
101
|
+
row.title = props.directory || ''
|
|
102
|
+
})
|
|
103
|
+
return row
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Verify the widget under Changes, live field updates without resetting its local inputs, inline/popup width, session and host switches, and cleanup on hiding/disable/reload. Check that slow work observes the mount signal and that failed widgets leave other entries intact.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 1naruto-1
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|