@yuriai/web 0.2.29-beta.9 → 0.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/assets/{AgentAvatar-BtFNGIgH.js → AgentAvatar-CR6dX_XT.js} +1 -1
- package/dist/assets/{AssistantContactStatus-CxBF6Ay6.js → AssistantContactStatus-diuJawg6.js} +3 -3
- package/dist/assets/{AssistantUnreadBadge--5NJVTuh.js → AssistantUnreadBadge-Bm2v4QFf.js} +1 -1
- package/dist/assets/{AssistantView-BmpLCQuw.js → AssistantView-BfJ7SgWf.js} +1 -1
- package/dist/assets/{DiagramView-CRam7PmL.js → DiagramView-Doy9Dw3w.js} +1 -1
- package/dist/assets/{GuiPluginSurface-Cf4hIlkP.js → GuiPluginSurface-DD2js1dF.js} +1 -1
- package/dist/assets/MarkdownRenderer-DlwJOAKc.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-DShGc2YZ.js → MarkdownRendererImpl-Bcew9khF.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-DYmFf07T.js → MarkstreamRendererImpl-DhcURvX5.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-CjoghpoB.js → MobileDetailNavigation-6ZzfZFN1.js} +1 -1
- package/dist/assets/{MobileShareBridge-Bii25Pjf.js → MobileShareBridge-gejXx1yh.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-C6AI58D-.js → MobileTabPageHeader-DkT6g7Mg.js} +1 -1
- package/dist/assets/{MultiRunWindow-xrwgbnRZ.js → MultiRunWindow-CRgoeY0-.js} +1 -1
- package/dist/assets/{SettingsView-BHBG7CFA.js → SettingsView-Ds6O5lyc.js} +1 -1
- package/dist/assets/{SettingsWindow-D8hn7Jjd.js → SettingsWindow-BWn1_7aJ.js} +1 -1
- package/dist/assets/{SetupTourDialog-B2crxm_w.js → SetupTourDialog-CPIzaGRX.js} +1 -1
- package/dist/assets/{TerminalView-5ki5iNXt.js → TerminalView-c7zh5vLz.js} +1 -1
- package/dist/assets/{ToolOutputDialog-CMhix20T.js → ToolOutputDialog-CDOXuNnT.js} +1 -1
- package/dist/assets/{VoiceSettings-DawvV46L.js → VoiceSettings-C4dUe9aM.js} +1 -1
- package/dist/assets/{appThemeRegistry-D25YM694.js → appThemeRegistry-yYsjzEE3.js} +1 -1
- package/dist/assets/{capgoAdapter-Bas1D6ds.js → capgoAdapter-Bu3WngVl.js} +1 -1
- package/dist/assets/{gitApi-Cs08jIjA.js → gitApi-Qflz9_C8.js} +1 -1
- package/dist/assets/{insertionBoundaries-BoEG12_x.js → insertionBoundaries-BUw7PHl1.js} +1 -1
- package/dist/assets/{main-D00Zz44O.js → main-Bjl7PEcs.js} +4 -4
- package/dist/assets/{main-BGYY-hd1.js → main-D-GaWYGg.js} +2 -2
- package/dist/assets/{mcpQueries-4__hFxuf.js → mcpQueries-DHembIpw.js} +1 -1
- package/dist/assets/{miniChat-DJrq4mIe.js → miniChat-CmBB3uQK.js} +2 -2
- package/dist/assets/{mobile-BOrcaJMH.js → mobile-Dc6ZV3uE.js} +2 -2
- package/dist/assets/{mobileBackNavigation-DfKlarxw.js → mobileBackNavigation-CsrEjMEM.js} +1 -1
- package/dist/assets/{multirun-D35HrOK1.js → multirun-ruXWPXy8.js} +1 -1
- package/dist/assets/{native-config-DF7bq4tk.js → native-config-BcE2v-v8.js} +1 -1
- package/dist/assets/{projectMeta-Bu5flvhx.js → projectMeta-aZbJXiqn.js} +1 -1
- package/dist/assets/{pwa-CWEsl2Ow.js → pwa-BXcwcwBq.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-DZc2cRj7.js → queue-abort-optimistic-p3-XNzC5.js} +1 -1
- package/dist/assets/{readiness-Dl790DNB.js → readiness-CG6k1v_D.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-MI4k81uX.js → renderElectronMiniChatApp-DKbHyoWv.js} +2 -2
- package/dist/assets/{renderMobileApp-ClCiFay4.js → renderMobileApp-ouUhZ7cf.js} +4 -4
- package/dist/assets/{runtimeConfig-BuChFCqQ.js → runtimeConfig-pROQUB9G.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-BHOxCpwZ.js → runtimeEndpointReset-DPIu6oI9.js} +3 -3
- package/dist/assets/{sessionLookup-K6ZLigY7.js → sessionLookup-CNrni3E6.js} +1 -1
- package/dist/assets/{speechSettingsQueries-DusLRL2i.js → speechSettingsQueries-Dz5sTpjO.js} +1 -1
- package/dist/assets/types-DodQbc1N.js +2 -0
- package/dist/assets/{useAppFontEffects-BTwyFf_W.js → useAppFontEffects-DtteQwrV.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-GQRvPTBq.js → useDesktopWindowControlsLayout-BDhl0M6j.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-n0L_esHA.js → useEffectiveDirectory-DcTO2pCq.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-CN9JDH7h.js → useMobileNavigationStore-CWXCC9MY.js} +4 -4
- package/dist/assets/{usePluginsStore-D96HwGZy.js → usePluginsStore-B6vwvN4g.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-Bs1Z-yjv.js → useWorkerHighlightedLines-B9uHlxuS.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/mini-chat.html +5 -5
- package/dist/mobile.html +5 -5
- package/package.json +4 -3
- package/server/lib/assistants/DOCUMENTATION.md +1 -1
- package/server/lib/assistants/contact-tools.js +1 -1
- package/server/lib/assistants/harness.js +3 -3
- package/server/lib/client-auth/pairing.js +4 -1
- package/server/lib/client-auth/pairing.test.js +41 -0
- package/server/lib/client-auth/remote-clients.js +6 -2
- package/server/lib/client-auth/remote-clients.test.js +42 -0
- package/server/lib/llm/DOCUMENTATION.md +14 -1
- package/server/lib/llm/bridge-plugin.bundle.js +13 -1136
- package/server/lib/llm/bridge-plugin.js +4 -4
- package/server/lib/llm/bridge-plugin.test.js +31 -4
- package/server/lib/opencode/core-routes.js +3 -2
- package/server/lib/opencode/core-routes.test.js +12 -2
- package/server/lib/remote-desktop/DOCUMENTATION.md +4 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +2 -0
- package/dist/assets/MarkdownRenderer-D3744fNd.js +0 -2
- package/dist/assets/types-O8iYyCQi.js +0 -2
|
@@ -2,8 +2,8 @@ import { Cause, Context, Effect, Stream } from 'effect';
|
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { HttpClientRequest, HttpClientResponse } from 'effect/http';
|
|
4
4
|
import { AIClient, LLM, LLMRequest, LanguageModel, HttpOptions, Message, Media } from '@opencode/ai/effect';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Service as ModelResolverService } from '@opencode/core/model-resolver';
|
|
6
|
+
import { Service as PluginHooksService } from '@opencode/core/plugin/hooks';
|
|
7
7
|
import { LlmBridge, LLM_BRIDGE_VERSION } from './bridge-contract.js';
|
|
8
8
|
|
|
9
9
|
const sensitiveBodyKeys = ['messages', 'input', 'system', 'instructions', 'tools', 'tool_choice'];
|
|
@@ -38,8 +38,8 @@ const toMessage = (message) => {
|
|
|
38
38
|
|
|
39
39
|
// RPC effects run in the external service's Location context. Never build a parallel runtime.
|
|
40
40
|
const hostRuntime = Effect.context().pipe(Effect.flatMap(context => {
|
|
41
|
-
const resolver = Context.getOption(context,
|
|
42
|
-
const hooks = Context.getOption(context,
|
|
41
|
+
const resolver = Context.getOption(context, ModelResolverService);
|
|
42
|
+
const hooks = Context.getOption(context, PluginHooksService);
|
|
43
43
|
return resolver._tag === 'Some' && typeof resolver.value.resolve === 'function'
|
|
44
44
|
&& hooks._tag === 'Some' && typeof hooks.value.trigger === 'function'
|
|
45
45
|
? Effect.succeed({ resolver: resolver.value, hooks: hooks.value })
|
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
|
-
import {
|
|
2
|
+
import { execFileSync } from 'node:child_process';
|
|
3
|
+
import { copyFile, mkdtemp, rm } from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
+
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
3
8
|
import { Effect } from 'effect';
|
|
4
9
|
import { ModelResolver } from '@opencode/core/model-resolver';
|
|
5
10
|
import { PluginHooks } from '@opencode/core/plugin/hooks';
|
|
6
11
|
import * as compatible from '@opencode/ai/providers/openai-compatible';
|
|
7
|
-
import
|
|
12
|
+
import sourceBridge, { generateBridgeResponse as sourceGenerate } from './bridge-plugin.js';
|
|
8
13
|
|
|
9
14
|
const servers = [];
|
|
15
|
+
let bundled;
|
|
16
|
+
let bundleDirectory;
|
|
17
|
+
beforeAll(async () => {
|
|
18
|
+
const directory = path.dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
execFileSync('bun', ['run', 'build:llm-bridge'], {
|
|
20
|
+
cwd: path.resolve(directory, '../../..'), stdio: 'pipe',
|
|
21
|
+
});
|
|
22
|
+
bundleDirectory = await mkdtemp(path.join(os.tmpdir(), 'yuri-bridge-test-'));
|
|
23
|
+
const target = path.join(bundleDirectory, 'bridge.mjs');
|
|
24
|
+
await copyFile(path.join(directory, 'bridge-plugin.bundle.js'), target);
|
|
25
|
+
// The plugin must also load in the external Bun service without Yuri's node_modules.
|
|
26
|
+
execFileSync('bun', ['-e', `await import(${JSON.stringify(pathToFileURL(target).href)})`], { cwd: bundleDirectory, stdio: 'pipe' });
|
|
27
|
+
bundled = await import(/* @vite-ignore */ pathToFileURL(target).href);
|
|
28
|
+
});
|
|
29
|
+
afterAll(async () => { if (bundleDirectory) await rm(bundleDirectory, { recursive: true, force: true }); });
|
|
10
30
|
afterEach(async () => { for (const server of servers.splice(0)) { server.closeAllConnections(); await new Promise(resolve => server.close(resolve)); } });
|
|
11
31
|
|
|
12
|
-
async function
|
|
32
|
+
async function createFixture(reply, generateBridgeResponse) {
|
|
13
33
|
const requests = [];
|
|
14
34
|
const headers = [];
|
|
15
35
|
const server = http.createServer(async (req, res) => {
|
|
@@ -39,7 +59,14 @@ async function fixture(reply) {
|
|
|
39
59
|
return { input, requests, headers, model, credential, resolve, trigger, run, runEffect };
|
|
40
60
|
}
|
|
41
61
|
|
|
42
|
-
describe('external runtime provider bridge', () => {
|
|
62
|
+
describe.each(['source', 'prebundled'])('external runtime provider bridge (%s)', (mode) => {
|
|
63
|
+
let bridge;
|
|
64
|
+
let generateBridgeResponse;
|
|
65
|
+
beforeAll(() => {
|
|
66
|
+
bridge = mode === 'source' ? sourceBridge : bundled.default;
|
|
67
|
+
generateBridgeResponse = mode === 'source' ? sourceGenerate : bundled.generateBridgeResponse;
|
|
68
|
+
});
|
|
69
|
+
const fixture = reply => createFixture(reply, generateBridgeResponse);
|
|
43
70
|
it('sends only caller context and returns measured usage through the host resolver', async () => {
|
|
44
71
|
const { input, requests, resolve, trigger, run } = await fixture({ role: 'assistant', content: 'summary' });
|
|
45
72
|
expect(await run(input)).toMatchObject({ text: 'summary', toolCalls: [], usage: { inputTokens: 100, outputTokens: 10, cacheReadInputTokens: 80 } });
|
|
@@ -911,12 +911,13 @@ export const registerAuthAndAccessRoutes = (app, dependencies) => {
|
|
|
911
911
|
includeDirect: req.body?.includeDirect !== false,
|
|
912
912
|
relayUrl: requestedRelayUrl,
|
|
913
913
|
});
|
|
914
|
-
const
|
|
914
|
+
const relayCandidate = candidates.find((candidate) => candidate.type === 'relay');
|
|
915
915
|
const result = await clientPairingRuntime.createPairingSession({
|
|
916
916
|
label: req.body?.label,
|
|
917
917
|
allowedClientKinds: req.body?.allowedClientKinds,
|
|
918
918
|
createdByClientId: clientIdFromAuthContext(authContext),
|
|
919
|
-
usesRelay,
|
|
919
|
+
usesRelay: Boolean(relayCandidate),
|
|
920
|
+
relayUrl: relayCandidate?.relayUrl ?? null,
|
|
920
921
|
});
|
|
921
922
|
void reconcileRelay();
|
|
922
923
|
res.setHeader('Cache-Control', 'no-store');
|
|
@@ -777,6 +777,7 @@ describe('core-routes', () => {
|
|
|
777
777
|
allowedClientKinds: ['mobile'],
|
|
778
778
|
createdByClientId: null,
|
|
779
779
|
usesRelay: false,
|
|
780
|
+
relayUrl: null,
|
|
780
781
|
});
|
|
781
782
|
});
|
|
782
783
|
|
|
@@ -802,7 +803,7 @@ describe('core-routes', () => {
|
|
|
802
803
|
hostEncPubJwk: { kty: 'EC', crv: 'P-256', x: 'aaa', y: 'bbb' },
|
|
803
804
|
priority: 30,
|
|
804
805
|
};
|
|
805
|
-
const { app } = createPairingRouteApp({ getRelayPairingCandidate: vi.fn(async () => relayCandidate) });
|
|
806
|
+
const { app, dependencies } = createPairingRouteApp({ getRelayPairingCandidate: vi.fn(async () => relayCandidate) });
|
|
806
807
|
|
|
807
808
|
const response = await request(app)
|
|
808
809
|
.post('/api/client-auth/pairing/sessions')
|
|
@@ -814,6 +815,10 @@ describe('core-routes', () => {
|
|
|
814
815
|
{ type: 'lan', url: 'http://runtime.example', priority: 10 },
|
|
815
816
|
relayCandidate,
|
|
816
817
|
]);
|
|
818
|
+
expect(dependencies.clientPairingRuntime.createPairingSession).toHaveBeenCalledWith(expect.objectContaining({
|
|
819
|
+
usesRelay: true,
|
|
820
|
+
relayUrl: relayCandidate.relayUrl,
|
|
821
|
+
}));
|
|
817
822
|
});
|
|
818
823
|
|
|
819
824
|
it('passes a custom Relay endpoint into relay-only pairing and returns that endpoint in the candidate', async () => {
|
|
@@ -824,7 +829,7 @@ describe('core-routes', () => {
|
|
|
824
829
|
hostEncPubJwk: { kty: 'EC', crv: 'P-256', x: 'aaa', y: 'bbb' },
|
|
825
830
|
priority: 30,
|
|
826
831
|
}));
|
|
827
|
-
const { app } = createPairingRouteApp({ getRelayPairingCandidate });
|
|
832
|
+
const { app, dependencies } = createPairingRouteApp({ getRelayPairingCandidate });
|
|
828
833
|
|
|
829
834
|
const response = await request(app)
|
|
830
835
|
.post('/api/client-auth/pairing/sessions')
|
|
@@ -843,6 +848,10 @@ describe('core-routes', () => {
|
|
|
843
848
|
expect(response.body.server.candidates).toEqual([
|
|
844
849
|
expect.objectContaining({ type: 'relay', relayUrl: 'wss://relay.example/custom' }),
|
|
845
850
|
]);
|
|
851
|
+
expect(dependencies.clientPairingRuntime.createPairingSession).toHaveBeenCalledWith(expect.objectContaining({
|
|
852
|
+
usesRelay: true,
|
|
853
|
+
relayUrl: 'wss://relay.example/custom',
|
|
854
|
+
}));
|
|
846
855
|
});
|
|
847
856
|
|
|
848
857
|
it('rejects an invalid custom Relay endpoint before creating a pairing session', async () => {
|
|
@@ -961,6 +970,7 @@ describe('core-routes', () => {
|
|
|
961
970
|
allowedClientKinds: undefined,
|
|
962
971
|
createdByClientId: 'remote-desktop-1',
|
|
963
972
|
usesRelay: true,
|
|
973
|
+
relayUrl: 'wss://relay.example/ws',
|
|
964
974
|
});
|
|
965
975
|
expect(response.body.server.candidates).toEqual([
|
|
966
976
|
{ type: 'lan', url: 'http://runtime.example', priority: 10 },
|
|
@@ -23,6 +23,8 @@ Runtime generation/transport identity are captured when opening the view. No inp
|
|
|
23
23
|
|
|
24
24
|
Native readiness requires both the capture renderer and input helper. Missing primary-display sources, helper-check execution failures and capture timeouts have distinct retryable codes, not permission guidance. Host suspend/resume and lock/unlock end the old capture so reconnect obtains fresh display/media/input resources; this does not wake a sleeping Mac or unlock it. Capture-renderer startup failure is reported before media fallback can be selected; a compatibility stream must decode its first frame within 15 seconds even when WebRTC previously worked. Native warnings retain only startup stage, failure code and permission flags through the desktop logger, never screen contents, input or credentials. These native fixes require an installer; client recovery requires the updated shared UI, and older backends retain generic retryable `desktop_failed` compatibility.
|
|
25
25
|
|
|
26
|
+
An awake Host with sleeping displays is recoverable without unlocking: after checking enablement and permissions, the native adapter holds a session-owned display-sleep blocker. Empty screen enumeration triggers one bounded macOS display-wake command and up to two seconds of 250ms source rediscovery within the existing 15-second startup budget. A nonempty list that lacks the primary display never falls back to another screen. Cancellation/failure/close releases the power assertion and aborts the wake process/retry timer. A display-wake failure reports retryable `display_unavailable` at stage `display-wake`; it does not request reauthorization. The Host must still be awake enough to receive the authenticated connection; this is not Wake-on-LAN or screen unlocking.
|
|
27
|
+
|
|
26
28
|
## Media and control
|
|
27
29
|
|
|
28
30
|
The isolated file-origin capture window uses Electron's `desktopCapturer` screen identity and Chromium's desktop `getUserMedia`, constrained to 2560×1440 and 30 fps so zoom can request more detail. Normal encoder output remains bounded by the ordinary adaptive tiers below. Chromium owns negotiated video codec and hardware acceleration; H.264 is not forced. A WebRTC offer/answer and trickle ICE pass over the authenticated WS. Media uses WebRTC DTLS-SRTP. Over Relay, the fingerprint-bearing signaling and control are also protected by the existing E2EE tunnel; media does not use Yuri's tunnel encryption format.
|
|
@@ -107,3 +109,5 @@ After removing per-connection confirmation and the sharing window, a Launch Serv
|
|
|
107
109
|
These tests do **not** prove macOS TCC permission inheritance for a release-signed helper, successful password-based unlocking, reliable lock/unlock transitions, iPhone WKWebView playback/gestures, WAN codec negotiation, throughput, battery or latency. Before shipping, verify those on a signed preview installer and a physical phone, including permission denial/regrant, display changes, disconnect while dragging, direct connection, Relay-only fallback and optional TURN. Native main/preload/helper changes require a new desktop installer; UI OTA alone cannot provide them.
|
|
108
110
|
|
|
109
111
|
Recovery verification additionally injected a never-settling screen discovery into the production adapter launched through macOS Launch Services. It rejected with `capture_timeout`, left zero capture windows, and then decoded real desktop JPEGs at 1440×810 in two consecutive fresh captures; an injected `resume` event ended the first capture exactly once before the second started, and final cleanup again left zero windows. No screen images were retained and no input events were injected. This is development-Electron evidence with a simulated lifecycle signal, not an actual sleep/reboot cycle, installed release-signed or physical-phone acceptance. Regression tests cover aborting hung discovery, helper readiness, renderer failure, power/lock lifecycle events, automatic reconnect/backoff, stale callbacks, foreground recovery, cold capability recovery and failed-capture ownership release through the real authenticated Relay dispatcher.
|
|
112
|
+
|
|
113
|
+
Display-sleep verification reproduced `display_unavailable` through three configured public Relay endpoints against the running desktop Host: authentication/capability succeeded on every endpoint while native screen enumeration returned empty despite granted permissions. A one-shot display wake restored real JPEG delivery on all three endpoints. A real Electron probe confirmed a display-sleep blocker alone still returned empty sources for over five seconds. With the updated production adapter launched through Launch Services, three consecutive actual display-sleep/start cycles each began with zero sources and decoded non-black 1440×810 JPEGs in 2199 / 2087 / 2111ms (median 2111ms, max 2199ms), leaving zero capture windows or power blockers after close. No images or input were retained/injected. These are direct development-adapter timings, not physical-phone end-to-end latency; the installed Host/Relay recovery check used a one-shot external wake, and deployment of automatic recovery still requires the new installer. Regression tests bound the cold path to one wake process and at most ten enumerations, preserve the warm path, reject wrong-screen substitution, and cover cancellation, disablement and failed wake cleanup.
|
|
@@ -7,6 +7,8 @@ Trusted-device access has one durable credential model: a remote client bearer t
|
|
|
7
7
|
|
|
8
8
|
Pairing v2 is implemented by `packages/web/server/lib/client-auth/pairing.js`. It stores short-lived one-time pairing sessions with hashed secrets, exposes create/cancel/redeem routes under `/api/client-auth/pairing/*`, and redeems a valid pairing secret into the same remote client token used by password/passkey trusted-device flows.
|
|
9
9
|
|
|
10
|
+
Client deduplication is scoped by device `dedupeKey`, `usesRelay`, and the pairing's canonical `relayUrl`. The create route records the actual advertised Relay candidate (including a default or environment-selected endpoint), and redemption uses this stored scope even when it arrives over LAN. Re-pairing through the same Relay replaces that connection's credential; another Relay or direct-only pairing retains an independent client record, label, credential, and revocation. The endpoint is internal persistence metadata, not a client-supplied redemption override. Legacy records without `relayUrl` remain readable with an unknown Relay scope; new endpoint-specific pairings preserve them rather than guessing which connection to overwrite. No stored credential conversion is needed.
|
|
11
|
+
|
|
10
12
|
## Entrypoints and structure
|
|
11
13
|
|
|
12
14
|
Remote desktop uses the exact `/api/remote-desktop/ws` scoped URL-token path, mirrored in the Relay tunnel allowlist. Its own upgrade gate additionally rejects password-less owner cookies and checks origin even when password auth is disabled; see `../remote-desktop/DOCUMENTATION.md`.
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkstreamRendererImpl-DYmFf07T.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-base-ui-CzHs0bHY.js","assets/useUIStore-CoWJ3ROq.js","assets/runtime-switch-DEZ1K7qW.js","assets/runtime-auth-DBn9yahL.js","assets/vendor-zustand-vDaAPGfl.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/vendor-react-DlzBev0S.js","assets/fileQueries-C2Rs6TPz.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/queryRuntime-2dx7jbt9.js","assets/runtime-fetch-D0YWp3FJ.js","assets/vendor-markstream-react-DfLaSG3W.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/vendor-markstream-core-Cm34iPLL.js","assets/vendor-floating-ui-dom-BHhLtF5l.js","assets/vendor-floating-ui-core-Co1I1lFV.js","assets/vendor-reactuses-core-DWo5Wn6R.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-Cjciq1yh.js","assets/desktop-JwYqThiw.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/store-CKIMMlXR.js","assets/tour-Db44qwfs.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useMobileNavigationStore-CN9JDH7h.js","assets/gitApiHttp-Ddik7PM_.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/persistence-D-rnhgr4.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/runtime-file-resource-BP4P52ry.js","assets/runtime-file-store-BVRgEtI-.js","assets/path-utils-jGozTg9d.js","assets/platform-DFJEtBlo.js","assets/vendor-sonner-BEHGipm5.js","assets/useAssistantUIStore-BI_dAUjx.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/useThemeSystem-CNzUUkFn.js","assets/tooltip-BuZ86ipm.js","assets/url-MRa-FtQa.js","assets/useEffectiveDirectory-n0L_esHA.js","assets/image-loading-DKQOYtti.js","assets/image-loading-D9Z_BASK.css","assets/LoadingImage-Ch5MyA20.js","assets/ImageLoadingPlaceholder-KksxJaKp.js","assets/markdownHeightCache-C7UOJdkN.js","assets/dualLimitLru-D8Sphgua.js","assets/MarkdownRendererImpl-DShGc2YZ.js","assets/vendor-katex-DNVSTX6g.js","assets/themes-BgDJcxRc.js","assets/FadeInOnReveal-CuOJu25b.js","assets/markdownTheme-CHNl6tUv.js","assets/vendor-pierre-diffs-BFiZ3IhI.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-morphdom-BbKiNDAu.js","assets/vendor-dompurify-CeJNOzik.js","assets/vendor-pele-C1WTNWUm.js","assets/vendor-marked-WVekxjAN.js","assets/vendor-remend-C3cXc-tf.js","assets/fileReferenceActions-CvDFcgBH.js","assets/toolHelpers-iEHVHQ9p.js","assets/fileReferenceParser-1HHDBUum.js","assets/MarkstreamRendererImpl-EpBnVy9J.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{a as t}from"./vendor-zustand-vDaAPGfl.js";import{ot as n,st as r}from"./vendor-base-ui-CzHs0bHY.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as i}from"./vendor-react-DlzBev0S.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as o}from"./button-Cjciq1yh.js";import{t as s}from"./useEffectiveDirectory-n0L_esHA.js";import{i as c,n as l,t as u}from"./markdownHeightCache-C7UOJdkN.js";var d=i(),f=e(r(),1),p=`yuri:chunk-import-reload`,m=250,h=3e4,g=[/Importing a module script failed/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/Loading chunk \S+ failed/i,/ChunkLoadError/i];function _(e){if(e instanceof Error)return`${e.name}\n${e.message}\n${e.stack??``}`;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function v(e){let t=_(e);return g.some(e=>e.test(t))}function y(e){return`0.2.29-beta.9:${_(e).slice(0,500)}`}function b(e){if(typeof window>`u`)return;let t=Date.now(),n=y(e),r=null;try{let e=window.sessionStorage.getItem(p);if(e)try{r=JSON.parse(e)}catch{r=null}}catch{return}let i=typeof r?.timestamp==`number`?r.timestamp:0;if(!(r?.signature===n&&t-i<h)){try{window.sessionStorage.setItem(p,JSON.stringify({signature:n,timestamp:t}))}catch{return}console.error(`[refresh-debug] chunk-import-reload`,{error:_(e).slice(0,1e3)}),window.setTimeout(()=>{window.location.reload()},0)}}async function x(e,t={}){let n=t.retries??1,r;for(let t=0;t<=n;t+=1)try{return await e()}catch(e){if(r=e,!v(e)||t>=n)break;await new Promise(e=>setTimeout(e,m*(t+1)))}throw v(r)&&b(r),r}var S=e=>(0,f.lazy)(()=>x(e)),C=(e,t)=>!!t?.toLowerCase().startsWith(`video/`)||/^data:video\//i.test(e)||/\.(?:mp4|m4v|webm|mov|ogv|ogg)(?:[?#]|$)/i.test(e),w=(e,t)=>{try{let n=t??(typeof localStorage>`u`?null:localStorage);return!n||n.getItem(e)!==`0`}catch{return!0}},T=(e,t)=>{try{typeof localStorage<`u`&&localStorage.setItem(e,t?`1`:`0`)}catch{}},E=`yuri:markstream-react`,D=e=>w(E,e),O=t(e=>({markstreamReactEnabled:D(),setMarkstreamReactEnabled:t=>{T(E,t),e({markstreamReactEnabled:t})}})),k=null,A=()=>(k??=a(()=>import(`./MarkstreamRendererImpl-DYmFf07T.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79])).catch(e=>{throw k=null,e}),k),j=()=>{A().catch(()=>void 0)},M=null,N=()=>(M??=a(()=>import(`./MarkdownRendererImpl-DShGc2YZ.js`).then(e=>e.n),__vite__mapDeps([55,1,4,5,24,25,2,3,6,7,8,9,10,11,12,13,14,40,56,20,21,22,23,26,16,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,54,45,57,47,48,49,50,58,53,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78])).catch(e=>{throw M=null,e}),M),P=()=>{N().catch(()=>void 0),D()&&j()},F=class extends f.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.warn(`[markstream-react] falling back to the current Markdown renderer`,e)}render(){return this.state.hasError?this.props.fallback:this.props.children}},I=f.createContext(!0),L=()=>f.useContext(I),R=n(),z=S(()=>N().then(e=>({default:e.MarkdownRenderer}))),B=S(()=>A().then(e=>({default:e.MarkstreamRenderer}))),V=S(()=>N().then(e=>({default:e.SimpleMarkdownRenderer}))),H=e=>e===`tool`?`markdown-content markdown-tool`:e===`reasoning`?`markdown-content markdown-reasoning`:`markdown-content leading-relaxed`,U=e=>{let t=(0,d.c)(15),n=O(K),r=typeof e.content==`string`?e.content:``,i=typeof e.variant==`string`?e.variant:`assistant`,a;t[0]!==r||t[1]!==n||t[2]!==e.reserveMeasuredHeight||t[3]!==i?(a=e.reserveMeasuredHeight?l(u(r,n?`markstream:${i}`:i)):void 0,t[0]=r,t[1]=n,t[2]=e.reserveMeasuredHeight,t[3]=i,t[4]=a):a=t[4];let s=a,f;t[5]!==e.className||t[6]!==e.variant?(f=o(`relative break-words w-full min-w-0`,H(e.variant),typeof e.className==`string`?e.className:void 0),t[5]=e.className,t[6]=e.variant,t[7]=f):f=t[7];let p;t[8]!==r||t[9]!==e.animated||t[10]!==s?(p=(0,R.jsx)(c,{animated:e.animated,content:r,reservedHeight:s}),t[8]=r,t[9]=e.animated,t[10]=s,t[11]=p):p=t[11];let m;return t[12]!==f||t[13]!==p?(m=(0,R.jsx)(`div`,{className:f,"aria-busy":`true`,"data-markdown-hydration":`deferred`,"data-markdown-ready":`false`,children:p}),t[12]=f,t[13]=p,t[14]=m):m=t[14],m},W=e=>{let t=(0,d.c)(13),n=L(),r=O(q);if(!n&&e.isStreaming!==!0){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1,reserveMeasuredHeight:!0}),t[0]=e,t[1]=n),n}let i;t[2]===e?i=t[3]:(i=(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(z,{...e})}),t[2]=e,t[3]=i);let a=i,o;t[4]!==a||t[5]!==r||t[6]!==e?(o=r?(0,R.jsx)(F,{fallback:a,children:(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e,reserveMeasuredHeight:!0}),children:(0,R.jsx)(B,{...e})})}):a,t[4]=a,t[5]=r,t[6]=e,t[7]=o):o=t[7];let c=o,l;t[8]===e?l=t[9]:(l=t=>{if(!e.onShowPopup||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let n=t.target instanceof Element?t.target.closest(`a[href]`):null,r=n?.getAttribute(`href`);if(!r||!C(r))return;t.preventDefault(),t.stopPropagation();let i=n?.textContent?.trim()||r.split(/[/?#]/).filter(Boolean).pop()||r;e.onShowPopup({open:!0,title:i,content:``,video:{url:r,filename:i,directory:s()??``}})},t[8]=e,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,R.jsx)(`div`,{className:`contents`,onClickCapture:l,children:c}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u},G=e=>{let t=(0,d.c)(4);if(!L()){let n;return t[0]===e?n=t[1]:(n=(0,R.jsx)(U,{...e,animated:!1}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,R.jsx)(f.Suspense,{fallback:(0,R.jsx)(U,{...e}),children:(0,R.jsx)(V,{...e})}),t[2]=e,t[3]=n),n};function K(e){return e.markstreamReactEnabled}function q(e){return e.markstreamReactEnabled}export{C as a,P as i,G as n,S as o,I as r,W as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-capacitor-app-B5H_XtmE.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as t}from"./platform-DFJEtBlo.js";var n=async()=>{if(!t())return null;let{App:n}=await e(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])),{id:r}=await n.getInfo();if(typeof r!=`string`||!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(r))throw Error(`Native app identity unavailable`);return r},r=e=>typeof e==`string`&&e.trim().length>0?e.trim():null,i=()=>r(`0.2.29-beta.9`),a=(e,t)=>r(t)||r(e),o=(e,t)=>{let n=r(e);return n?typeof t!=`number`||!Number.isFinite(t)?n:`${n} (${t})`:null},s=async()=>{let n=i();if(!t())return n;try{let{App:t}=await e(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2]));return a((await t.getInfo()).version,n)}catch{return n}},c=async()=>{if(!t())return null;try{let{App:t}=await e(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])),n=await t.getInfo(),r=typeof n.build==`string`?n.build.trim():``;if(r.length===0)return null;let i=Number.parseInt(r,10);return Number.isFinite(i)?i:null}catch{return null}},l=class extends Error{code=`mobile_updates_unsupported`;constructor(e=`Mobile OTA updates are only available in the Capacitor native app`){super(e),this.name=`MobileUpdatesUnsupportedError`}};export{s as a,c as i,o as n,n as r,l as t};
|