@linxin666/dsh-remote-web-ui 0.3.6 → 0.3.10

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.
Files changed (238) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +77 -468
  3. package/README.zh.md +83 -113
  4. package/lib/client.js +993 -203
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +1136 -1466
  7. package/lib/types/client/FooterRemoteEntry.d.ts +6 -7
  8. package/lib/types/client/FooterRemoteEntry.d.ts.map +1 -1
  9. package/lib/types/client/FooterRemoteEntry.js +1 -1
  10. package/lib/types/client/RemoteEntry.d.ts +7 -4
  11. package/lib/types/client/RemoteEntry.d.ts.map +1 -1
  12. package/lib/types/client/RemoteEntry.js +7 -10
  13. package/lib/types/client/RemotePanel.d.ts +2 -2
  14. package/lib/types/client/RemotePanel.d.ts.map +1 -1
  15. package/lib/types/client/RemotePanel.js +2 -2
  16. package/lib/types/client/RemoteSettingsCard.d.ts +9 -5
  17. package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
  18. package/lib/types/client/RemoteSettingsCard.js +56 -3
  19. package/lib/types/client/deep-link.d.ts +10 -13
  20. package/lib/types/client/deep-link.d.ts.map +1 -1
  21. package/lib/types/client/deep-link.js +14 -74
  22. package/lib/types/client/index.d.ts +2 -6
  23. package/lib/types/client/index.d.ts.map +1 -1
  24. package/lib/types/client/index.js +79 -39
  25. package/lib/types/client/locales.d.ts +32 -12
  26. package/lib/types/client/locales.d.ts.map +1 -1
  27. package/lib/types/client/locales.js +42 -22
  28. package/lib/types/client/mobile-adapt.d.ts +49 -0
  29. package/lib/types/client/mobile-adapt.d.ts.map +1 -0
  30. package/lib/types/client/mobile-adapt.js +1002 -0
  31. package/lib/types/client/pair-api.d.ts +24 -6
  32. package/lib/types/client/pair-api.d.ts.map +1 -1
  33. package/lib/types/client/pair-api.js +9 -14
  34. package/lib/types/client/remote-channel.d.ts +3 -0
  35. package/lib/types/client/remote-channel.d.ts.map +1 -1
  36. package/lib/types/client/remote-channel.js +35 -3
  37. package/lib/types/client/settings-form.d.ts +35 -43
  38. package/lib/types/client/settings-form.d.ts.map +1 -1
  39. package/lib/types/client/settings-form.js +60 -53
  40. package/lib/types/firewall.d.ts +75 -0
  41. package/lib/types/firewall.d.ts.map +1 -0
  42. package/lib/types/firewall.js +184 -0
  43. package/lib/types/gate.d.ts +11 -5
  44. package/lib/types/gate.d.ts.map +1 -1
  45. package/lib/types/gate.js +11 -5
  46. package/lib/types/index.d.ts +39 -10
  47. package/lib/types/index.d.ts.map +1 -1
  48. package/lib/types/index.js +206 -58
  49. package/lib/types/inner-auth.d.ts +32 -0
  50. package/lib/types/inner-auth.d.ts.map +1 -0
  51. package/lib/types/inner-auth.js +72 -0
  52. package/lib/types/lan-bind-plan.d.ts +55 -0
  53. package/lib/types/lan-bind-plan.d.ts.map +1 -0
  54. package/lib/types/lan-bind-plan.js +60 -0
  55. package/lib/types/lan-bind.d.ts +69 -0
  56. package/lib/types/lan-bind.d.ts.map +1 -0
  57. package/lib/types/lan-bind.js +128 -0
  58. package/lib/types/loopback-proxy.d.ts +9 -2
  59. package/lib/types/loopback-proxy.d.ts.map +1 -1
  60. package/lib/types/loopback-proxy.js +24 -2
  61. package/lib/types/pairing.d.ts +15 -3
  62. package/lib/types/pairing.d.ts.map +1 -1
  63. package/lib/types/pairing.js +20 -6
  64. package/lib/types/remote-api.d.ts +30 -13
  65. package/lib/types/remote-api.d.ts.map +1 -1
  66. package/lib/types/remote-api.js +55 -42
  67. package/lib/types/remote-channel-boot.d.ts +21 -2
  68. package/lib/types/remote-channel-boot.d.ts.map +1 -1
  69. package/lib/types/remote-channel-boot.js +65 -3
  70. package/lib/types/remote-channel-rules.d.ts +8 -0
  71. package/lib/types/remote-channel-rules.d.ts.map +1 -1
  72. package/lib/types/remote-channel-rules.js +9 -2
  73. package/lib/types/remote-methods.d.ts +45 -11
  74. package/lib/types/remote-methods.d.ts.map +1 -1
  75. package/lib/types/remote-methods.js +56 -27
  76. package/lib/types/remote-presence-pet.d.ts +51 -0
  77. package/lib/types/remote-presence-pet.d.ts.map +1 -0
  78. package/lib/types/remote-presence-pet.js +101 -0
  79. package/lib/types/routes.d.ts +76 -4
  80. package/lib/types/routes.d.ts.map +1 -1
  81. package/lib/types/routes.js +336 -19
  82. package/lib/types/tunnel.d.ts.map +1 -1
  83. package/lib/types/tunnel.js +7 -1
  84. package/package.json +20 -18
  85. package/src/client/FooterRemoteEntry.tsx +9 -10
  86. package/src/client/RemoteEntry.tsx +13 -14
  87. package/src/client/RemotePanel.tsx +5 -16
  88. package/src/client/RemoteSettingsCard.tsx +72 -13
  89. package/src/client/deep-link.ts +14 -75
  90. package/src/client/index.ts +82 -39
  91. package/src/client/locales.ts +42 -22
  92. package/src/client/mobile-adapt.ts +954 -0
  93. package/src/client/pair-api.ts +26 -15
  94. package/src/client/remote-channel.ts +31 -3
  95. package/src/client/settings-form.ts +78 -92
  96. package/src/dsh-home.ts +1 -1
  97. package/src/firewall.ts +230 -0
  98. package/src/gate.ts +11 -5
  99. package/src/index.ts +235 -65
  100. package/src/inner-auth.ts +85 -0
  101. package/src/lan-bind-plan.ts +81 -0
  102. package/src/lan-bind.ts +145 -0
  103. package/src/loopback-proxy.ts +34 -0
  104. package/src/pairing.persist.test.ts +1 -1
  105. package/src/pairing.ts +20 -6
  106. package/src/remote-api.ts +67 -45
  107. package/src/remote-channel-boot.ts +70 -3
  108. package/src/remote-channel-rules.ts +17 -2
  109. package/src/remote-methods.ts +58 -27
  110. package/src/remote-presence-pet.ts +129 -0
  111. package/src/routes.ts +358 -19
  112. package/src/tunnel.ts +7 -1
  113. package/assets/apple-touch-icon.png +0 -0
  114. package/assets/mobile-icon-192.png +0 -0
  115. package/assets/mobile-icon-512.png +0 -0
  116. package/assets/mobile-service-worker.js +0 -63
  117. package/lib/mobile.js +0 -17658
  118. package/lib/mobile.js.map +0 -1
  119. package/lib/types/mobile/PairRequiredView.d.ts +0 -7
  120. package/lib/types/mobile/PairRequiredView.d.ts.map +0 -1
  121. package/lib/types/mobile/PairRequiredView.js +0 -28
  122. package/lib/types/mobile/PairRequiredView.test.d.ts +0 -2
  123. package/lib/types/mobile/PairRequiredView.test.d.ts.map +0 -1
  124. package/lib/types/mobile/PairRequiredView.test.js +0 -24
  125. package/lib/types/mobile/api.d.ts +0 -145
  126. package/lib/types/mobile/api.d.ts.map +0 -1
  127. package/lib/types/mobile/api.js +0 -103
  128. package/lib/types/mobile/index.d.ts +0 -10
  129. package/lib/types/mobile/index.d.ts.map +0 -1
  130. package/lib/types/mobile/index.js +0 -38
  131. package/lib/types/mobile/markdown.d.ts +0 -34
  132. package/lib/types/mobile/markdown.d.ts.map +0 -1
  133. package/lib/types/mobile/markdown.js +0 -285
  134. package/lib/types/mobile/markdown.test.d.ts +0 -2
  135. package/lib/types/mobile/markdown.test.d.ts.map +0 -1
  136. package/lib/types/mobile/markdown.test.js +0 -79
  137. package/lib/types/mobile/messages.d.ts +0 -149
  138. package/lib/types/mobile/messages.d.ts.map +0 -1
  139. package/lib/types/mobile/messages.js +0 -561
  140. package/lib/types/mobile/messages.test.d.ts +0 -2
  141. package/lib/types/mobile/messages.test.d.ts.map +0 -1
  142. package/lib/types/mobile/messages.test.js +0 -356
  143. package/lib/types/mobile/mobile-styles.d.ts +0 -6
  144. package/lib/types/mobile/mobile-styles.d.ts.map +0 -1
  145. package/lib/types/mobile/mobile-styles.js +0 -1438
  146. package/lib/types/mobile/mobile-theme.d.ts +0 -22
  147. package/lib/types/mobile/mobile-theme.d.ts.map +0 -1
  148. package/lib/types/mobile/mobile-theme.js +0 -70
  149. package/lib/types/mobile/mobile-theme.test.d.ts +0 -2
  150. package/lib/types/mobile/mobile-theme.test.d.ts.map +0 -1
  151. package/lib/types/mobile/mobile-theme.test.js +0 -71
  152. package/lib/types/mobile/mux.d.ts +0 -128
  153. package/lib/types/mobile/mux.d.ts.map +0 -1
  154. package/lib/types/mobile/mux.js +0 -305
  155. package/lib/types/mobile/mux.test.d.ts +0 -2
  156. package/lib/types/mobile/mux.test.d.ts.map +0 -1
  157. package/lib/types/mobile/mux.test.js +0 -267
  158. package/lib/types/mobile/pairing.d.ts +0 -31
  159. package/lib/types/mobile/pairing.d.ts.map +0 -1
  160. package/lib/types/mobile/pairing.js +0 -62
  161. package/lib/types/mobile/rpc.d.ts +0 -38
  162. package/lib/types/mobile/rpc.d.ts.map +0 -1
  163. package/lib/types/mobile/rpc.js +0 -83
  164. package/lib/types/mobile/theme-toggle.d.ts +0 -12
  165. package/lib/types/mobile/theme-toggle.d.ts.map +0 -1
  166. package/lib/types/mobile/theme-toggle.js +0 -26
  167. package/lib/types/mobile/views/App.d.ts +0 -57
  168. package/lib/types/mobile/views/App.d.ts.map +0 -1
  169. package/lib/types/mobile/views/App.js +0 -150
  170. package/lib/types/mobile/views/App.test.d.ts +0 -2
  171. package/lib/types/mobile/views/App.test.d.ts.map +0 -1
  172. package/lib/types/mobile/views/App.test.js +0 -52
  173. package/lib/types/mobile/views/ChatView.d.ts +0 -63
  174. package/lib/types/mobile/views/ChatView.d.ts.map +0 -1
  175. package/lib/types/mobile/views/ChatView.js +0 -821
  176. package/lib/types/mobile/views/ChatView.stream.test.d.ts +0 -2
  177. package/lib/types/mobile/views/ChatView.stream.test.d.ts.map +0 -1
  178. package/lib/types/mobile/views/ChatView.stream.test.js +0 -236
  179. package/lib/types/mobile/views/ChatView.test.d.ts +0 -2
  180. package/lib/types/mobile/views/ChatView.test.d.ts.map +0 -1
  181. package/lib/types/mobile/views/ChatView.test.js +0 -718
  182. package/lib/types/mobile/views/SessionListView.d.ts +0 -27
  183. package/lib/types/mobile/views/SessionListView.d.ts.map +0 -1
  184. package/lib/types/mobile/views/SessionListView.js +0 -139
  185. package/lib/types/mobile/views/SessionListView.test.d.ts +0 -2
  186. package/lib/types/mobile/views/SessionListView.test.d.ts.map +0 -1
  187. package/lib/types/mobile/views/SessionListView.test.js +0 -167
  188. package/lib/types/mobile/views/WorkspaceView.d.ts +0 -21
  189. package/lib/types/mobile/views/WorkspaceView.d.ts.map +0 -1
  190. package/lib/types/mobile/views/WorkspaceView.js +0 -93
  191. package/lib/types/mobile/views/WorkspaceView.test.d.ts +0 -2
  192. package/lib/types/mobile/views/WorkspaceView.test.d.ts.map +0 -1
  193. package/lib/types/mobile/views/WorkspaceView.test.js +0 -183
  194. package/lib/types/mobile-api.d.ts +0 -65
  195. package/lib/types/mobile-api.d.ts.map +0 -1
  196. package/lib/types/mobile-api.js +0 -404
  197. package/lib/types/mobile-pending.d.ts +0 -38
  198. package/lib/types/mobile-pending.d.ts.map +0 -1
  199. package/lib/types/mobile-pending.js +0 -59
  200. package/lib/types/mobile-pwa.d.ts +0 -6
  201. package/lib/types/mobile-pwa.d.ts.map +0 -1
  202. package/lib/types/mobile-pwa.js +0 -17
  203. package/lib/types/mobile-routes.d.ts +0 -13
  204. package/lib/types/mobile-routes.d.ts.map +0 -1
  205. package/lib/types/mobile-routes.js +0 -217
  206. package/lib/types/paired-model-catalog.d.ts +0 -17
  207. package/lib/types/paired-model-catalog.d.ts.map +0 -1
  208. package/lib/types/paired-model-catalog.js +0 -311
  209. package/src/mobile/PairRequiredView.test.tsx +0 -28
  210. package/src/mobile/PairRequiredView.tsx +0 -58
  211. package/src/mobile/api.ts +0 -229
  212. package/src/mobile/index.tsx +0 -41
  213. package/src/mobile/markdown.test.ts +0 -91
  214. package/src/mobile/markdown.ts +0 -291
  215. package/src/mobile/messages.test.ts +0 -402
  216. package/src/mobile/messages.ts +0 -685
  217. package/src/mobile/mobile-styles.ts +0 -1439
  218. package/src/mobile/mobile-theme.test.ts +0 -84
  219. package/src/mobile/mobile-theme.ts +0 -76
  220. package/src/mobile/mux.test.ts +0 -314
  221. package/src/mobile/mux.ts +0 -336
  222. package/src/mobile/pairing.ts +0 -77
  223. package/src/mobile/rpc.ts +0 -90
  224. package/src/mobile/theme-toggle.tsx +0 -47
  225. package/src/mobile/views/App.test.tsx +0 -62
  226. package/src/mobile/views/App.tsx +0 -213
  227. package/src/mobile/views/ChatView.stream.test.tsx +0 -268
  228. package/src/mobile/views/ChatView.test.tsx +0 -816
  229. package/src/mobile/views/ChatView.tsx +0 -1342
  230. package/src/mobile/views/SessionListView.test.tsx +0 -207
  231. package/src/mobile/views/SessionListView.tsx +0 -244
  232. package/src/mobile/views/WorkspaceView.test.tsx +0 -227
  233. package/src/mobile/views/WorkspaceView.tsx +0 -245
  234. package/src/mobile-api.ts +0 -418
  235. package/src/mobile-pending.ts +0 -88
  236. package/src/mobile-pwa.ts +0 -19
  237. package/src/mobile-routes.ts +0 -231
  238. package/src/paired-model-catalog.ts +0 -272
@@ -1,7 +0,0 @@
1
- export interface PairRequiredViewProps {
2
- initialError?: string;
3
- onPaired(path: string): void;
4
- }
5
- /** Collect a fresh desktop-issued pairing link when this client has no paired cookie. */
6
- export declare function PairRequiredView({ initialError, onPaired }: PairRequiredViewProps): import("react").JSX.Element;
7
- //# sourceMappingURL=PairRequiredView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PairRequiredView.d.ts","sourceRoot":"","sources":["../../../src/mobile/PairRequiredView.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,qBAAqB,+BA+CjF"}
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /** Device-pairing gate for installed mobile web-app contexts with isolated storage. */
3
- import { useState } from 'react';
4
- import { acceptMobilePair, mobilePairPath, parseMobilePairInput } from "./pairing.js";
5
- /** Collect a fresh desktop-issued pairing link when this client has no paired cookie. */
6
- export function PairRequiredView({ initialError, onPaired }) {
7
- const [value, setValue] = useState('');
8
- const [error, setError] = useState(initialError);
9
- const [submitting, setSubmitting] = useState(false);
10
- const submit = async (event) => {
11
- event.preventDefault();
12
- const input = parseMobilePairInput(value);
13
- if (input === undefined) {
14
- setError('请输入有效的配对链接。');
15
- return;
16
- }
17
- setSubmitting(true);
18
- setError(undefined);
19
- const result = await acceptMobilePair(input.token);
20
- setSubmitting(false);
21
- if (!result.ok) {
22
- setError(result.message);
23
- return;
24
- }
25
- onPaired(mobilePairPath(input.workspaceId));
26
- };
27
- return (_jsx("main", { className: "mobile mobile-pair", "aria-labelledby": "mobile-pair-title", children: _jsxs("form", { className: "mobile-pairCard", onSubmit: (event) => { void submit(event); }, children: [_jsx("h1", { id: "mobile-pair-title", className: "mobile-title", children: "\u8BBE\u5907\u914D\u5BF9" }), _jsx("p", { className: "mobile-muted", children: "\u7C98\u8D34\u684C\u9762\u7AEF\u590D\u5236\u7684\u914D\u5BF9\u94FE\u63A5\u4EE5\u8FDE\u63A5\u6B64\u8BBE\u5907\u3002" }), _jsx("label", { className: "mobile-pairLabel", htmlFor: "mobile-pair-link", children: "\u914D\u5BF9\u94FE\u63A5" }), _jsx("input", { id: "mobile-pair-link", className: "mobile-pairInput", value: value, onChange: (event) => { setValue(event.target.value); }, autoComplete: "off", autoCapitalize: "off", spellCheck: false }), error === undefined ? null : _jsx("p", { className: "mobile-error", role: "alert", children: error }), _jsx("button", { className: "mobile-new mobile-pairSubmit", type: "submit", disabled: submitting, children: submitting ? '正在配对' : '配对' })] }) }));
28
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PairRequiredView.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PairRequiredView.test.d.ts","sourceRoot":"","sources":["../../../src/mobile/PairRequiredView.test.tsx"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // @vitest-environment jsdom
3
- import { afterEach, describe, expect, it, vi } from 'vitest';
4
- import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
5
- import { PairRequiredView } from "./PairRequiredView.js";
6
- afterEach(() => {
7
- cleanup();
8
- vi.unstubAllGlobals();
9
- });
10
- describe('PairRequiredView', () => {
11
- it('accepts a pasted link in the installed app context', async () => {
12
- const fetch = vi.fn().mockResolvedValue(new Response(JSON.stringify({ ok: true }), { status: 200 }));
13
- vi.stubGlobal('fetch', fetch);
14
- const onPaired = vi.fn();
15
- render(_jsx(PairRequiredView, { onPaired: onPaired }));
16
- fireEvent.change(screen.getByLabelText('配对链接'), { target: { value: 'https://phone.example/m/?pair=tok-1&workspace=ws-7' } });
17
- fireEvent.click(screen.getByRole('button', { name: '配对' }));
18
- await waitFor(() => expect(onPaired).toHaveBeenCalledWith('/m/?workspace=ws-7'));
19
- });
20
- it('shows an initial QR failure without starting the mobile data channel', () => {
21
- render(_jsx(PairRequiredView, { initialError: "\u914D\u5BF9\u94FE\u63A5\u5DF2\u88AB\u4F7F\u7528\u3002", onPaired: vi.fn() }));
22
- expect(screen.getByRole('alert').textContent).toContain('配对链接已被使用。');
23
- });
24
- });
@@ -1,145 +0,0 @@
1
- /**
2
- * Mobile-surface business API: the handful of host RPC methods the
3
- * simplified surface needs. Types come from the harness apiproxy contract
4
- * (type-only imports; the wire schemas stay in the bundle only through the
5
- * rpc/mux layers).
6
- */
7
- import type { WorkspaceView } from '@deepseek-ai/dsh-host-apiproxy/api/workspace';
8
- import type { AgentPresetEntry } from '@deepseek-ai/dsh-host-apiproxy/api/agent-presets';
9
- import type { SessionSummary, SessionModels, SessionProjectionsBlock } from '@deepseek-ai/dsh-host-apiproxy/api/sessions';
10
- /** One session.list page. */
11
- export interface SessionPage {
12
- items: SessionSummary[];
13
- /** Continuation cursor; undefined once the tail is reached. */
14
- nextCursor?: string;
15
- hasMore: boolean;
16
- }
17
- /** The session.create result (the id is the commit the caller navigates to). */
18
- export interface CreatedSession {
19
- sessionId: string;
20
- /** The composition the new session runs (echoed so the caller can label it). */
21
- agentPreset?: string;
22
- }
23
- /** Agent presets available when composing a new session. */
24
- export interface AgentPresetRoster {
25
- presets: readonly AgentPresetEntry[];
26
- authorable: boolean;
27
- hasDocument: boolean;
28
- }
29
- /** One history page (already bounded to whole messages by the host). */
30
- export interface HistoryPage {
31
- events: import('@deepseek-ai/dsh-host-apiproxy/api/sessions').HistoryEntry[];
32
- hasMore: boolean;
33
- /**
34
- * Projection baseline riding the tail page (permissions select etc.);
35
- * absent when the deployment mounts no projection registry.
36
- */
37
- projections?: SessionProjectionsBlock;
38
- }
39
- /** Read-only display preferences the plugin answers locally on `/m/api`. */
40
- export interface MobilePreferences {
41
- /** Plain Enter sends the drafted prompt (false: Enter inserts a newline). */
42
- mobileEnterToSend: boolean;
43
- }
44
- /** The workspace roster (session ids come back per workspace). */
45
- export declare function listWorkspaces(): Promise<WorkspaceView[]>;
46
- /** Read-only mobile display preferences (answered by the plugin, not the host proxy). */
47
- export declare function fetchMobilePreferences(): Promise<MobilePreferences>;
48
- /** One session.list page; omit the cursor for the first page. */
49
- export declare function listSessions(cursor?: string): Promise<SessionPage>;
50
- /** Read the available agent compositions for a new session. */
51
- export declare function listAgentPresets(): Promise<AgentPresetRoster>;
52
- /**
53
- * Create a blank session (entity birth precedes the first message). Name a
54
- * workspace to attach it there, or a cwd; omitting both uses the host cwd.
55
- */
56
- export declare function createSession(options?: {
57
- workspaceId?: string;
58
- cwd?: string;
59
- agentPreset?: string;
60
- }): Promise<CreatedSession>;
61
- /** One history window; omit beforeSeq for the tail page, pass a signal to abort. */
62
- export declare function history(sessionId: string, beforeSeq?: number, maxMessages?: number, signal?: AbortSignal): Promise<HistoryPage>;
63
- /** Send one text prompt (queued: the agent picks it up in order). */
64
- export declare function prompt(sessionId: string, text: string): Promise<void>;
65
- /** Send one slash command line (e.g. `/permission workspace-write`). */
66
- export declare function sendCommand(sessionId: string, line: string): Promise<unknown>;
67
- /**
68
- * Stop the session's active turn (the mobile stop button). Pending queued
69
- * work is preserved and resumes in FIFO order once cancellation settles.
70
- */
71
- export declare function cancelSession(sessionId: string): Promise<{
72
- accepted: true;
73
- }>;
74
- /** Fresh advisory model directory for one session (current + groups + failures). */
75
- export declare function models(sessionId: string): Promise<SessionModels>;
76
- /** Select the complete model selection (provider/model/reasoning effort) for a session. */
77
- export declare function selectModel(sessionId: string, selection: {
78
- provider: string;
79
- model: string;
80
- reasoningEffort?: string;
81
- }): Promise<{
82
- selected: {
83
- provider: string;
84
- model: string;
85
- reasoningEffort?: string;
86
- };
87
- }>;
88
- /** One pending tool approval awaiting the user's decision. */
89
- export interface PendingApproval {
90
- approvalId: string;
91
- toolName: string;
92
- callId?: string;
93
- reason?: string;
94
- }
95
- /** One pending question group awaiting the user's answer. */
96
- export interface PendingQuestionItem {
97
- id: string;
98
- question: string;
99
- detail?: string;
100
- header?: string;
101
- options?: Array<{
102
- label: string;
103
- description?: string;
104
- }>;
105
- multiSelect?: boolean;
106
- }
107
- /** The pending state for one session. */
108
- export interface PendingState {
109
- approvals: PendingApproval[];
110
- questions: PendingQuestionItem[];
111
- }
112
- /** Fetch pending approvals and questions for one session (polling fallback data source). */
113
- export declare function fetchPending(sessionId: string): Promise<PendingState>;
114
- /** Submit an approval decision (allowed-once or rejected). */
115
- export declare function respondApproval(sessionId: string, approvalId: string, outcome: 'allowed-once' | 'rejected'): Promise<void>;
116
- /** Submit answers to a question group. */
117
- export declare function respondQuestion(sessionId: string, answers: Array<{
118
- id: string;
119
- selected: string[];
120
- custom?: string;
121
- }>): Promise<void>;
122
- /** One entry in a directory listing. */
123
- export interface DirectoryEntry {
124
- name: string;
125
- path: string;
126
- hidden: boolean;
127
- }
128
- /** The host directory listing result (one level, with ancestor breadcrumbs). */
129
- export interface DirectoryListing {
130
- path: string;
131
- home: string;
132
- crumbs: DirectoryEntry[];
133
- entries: DirectoryEntry[];
134
- truncated: boolean;
135
- }
136
- /** The result of creating a workspace from an existing directory. */
137
- export interface WorkspaceCreateResult {
138
- workspace: WorkspaceView;
139
- created: boolean;
140
- }
141
- /** Browse one directory level on the host (defaults to home directory). */
142
- export declare function listDirectory(path?: string): Promise<DirectoryListing>;
143
- /** Create a workspace from an existing host directory (does not mkdir). */
144
- export declare function createWorkspace(path: string): Promise<WorkspaceCreateResult>;
145
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/mobile/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAA;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAA;AAGzH,6BAA6B;AAC7B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACpC,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,6CAA6C,EAAE,YAAY,EAAE,CAAA;IAC5E,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,uBAAuB,CAAA;CACtC;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,iBAAiB,EAAE,OAAO,CAAA;CAC3B;AAED,kEAAkE;AAClE,wBAAsB,cAAc,IAAI,OAAO,CAAC,a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C,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAClE,OAAO,CAAC,IAAI,CAAC,CAMf;AAID,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,aAAa,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,2EAA2E;AAC3E,wBAAsB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAE5E;AAED,2EAA2E;AAC3E,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAElF"}
@@ -1,103 +0,0 @@
1
- /**
2
- * Mobile-surface business API: the handful of host RPC methods the
3
- * simplified surface needs. Types come from the harness apiproxy contract
4
- * (type-only imports; the wire schemas stay in the bundle only through the
5
- * rpc/mux layers).
6
- */
7
- import { callUnary } from "./rpc.js";
8
- /** The workspace roster (session ids come back per workspace). */
9
- export async function listWorkspaces() {
10
- const { items } = await callUnary('workspace.list', {});
11
- return items;
12
- }
13
- /** Read-only mobile display preferences (answered by the plugin, not the host proxy). */
14
- export async function fetchMobilePreferences() {
15
- return await callUnary('mobile.preferences', {});
16
- }
17
- /** One session.list page; omit the cursor for the first page. */
18
- export async function listSessions(cursor) {
19
- return await callUnary('session.list', cursor === undefined ? {} : { cursor });
20
- }
21
- /** Read the available agent compositions for a new session. */
22
- export async function listAgentPresets() {
23
- return await callUnary('agentPreset.list', {});
24
- }
25
- /**
26
- * Create a blank session (entity birth precedes the first message). Name a
27
- * workspace to attach it there, or a cwd; omitting both uses the host cwd.
28
- */
29
- export async function createSession(options = {}) {
30
- return await callUnary('session.create', options);
31
- }
32
- /** One history window; omit beforeSeq for the tail page, pass a signal to abort. */
33
- export async function history(sessionId, beforeSeq, maxMessages = 30, signal) {
34
- return await callUnary('session.history', {
35
- sessionId,
36
- maxMessages,
37
- ...(beforeSeq !== undefined ? { beforeSeq } : {}),
38
- }, signal);
39
- }
40
- /** Send one text prompt (queued: the agent picks it up in order). */
41
- export async function prompt(sessionId, text) {
42
- await callUnary('session.prompt', {
43
- sessionId,
44
- mode: 'queue',
45
- content: [{ type: 'text', text }],
46
- });
47
- }
48
- /** Send one slash command line (e.g. `/permission workspace-write`). */
49
- export async function sendCommand(sessionId, line) {
50
- return await callUnary('mobile.command', {
51
- sessionId,
52
- line,
53
- });
54
- }
55
- /**
56
- * Stop the session's active turn (the mobile stop button). Pending queued
57
- * work is preserved and resumes in FIFO order once cancellation settles.
58
- */
59
- export async function cancelSession(sessionId) {
60
- return await callUnary('session.cancel', { sessionId });
61
- }
62
- /** Fresh advisory model directory for one session (current + groups + failures). */
63
- export async function models(sessionId) {
64
- return await callUnary('session.models', { sessionId });
65
- }
66
- /** Select the complete model selection (provider/model/reasoning effort) for a session. */
67
- export async function selectModel(sessionId, selection) {
68
- return await callUnary('session.selectModel', {
69
- sessionId,
70
- provider: selection.provider,
71
- model: selection.model,
72
- ...(selection.reasoningEffort !== undefined ? { reasoningEffort: selection.reasoningEffort } : {}),
73
- });
74
- }
75
- /** Fetch pending approvals and questions for one session (polling fallback data source). */
76
- export async function fetchPending(sessionId) {
77
- return await callUnary('mobile.pending', { sessionId });
78
- }
79
- /** Submit an approval decision (allowed-once or rejected). */
80
- export async function respondApproval(sessionId, approvalId, outcome) {
81
- await callUnary('mobile.respond', {
82
- sessionId,
83
- type: 'approval',
84
- approvalId,
85
- outcome,
86
- });
87
- }
88
- /** Submit answers to a question group. */
89
- export async function respondQuestion(sessionId, answers) {
90
- await callUnary('mobile.respond', {
91
- sessionId,
92
- type: 'question',
93
- answers,
94
- });
95
- }
96
- /** Browse one directory level on the host (defaults to home directory). */
97
- export async function listDirectory(path) {
98
- return await callUnary('host.listDirectory', path === undefined ? {} : { path });
99
- }
100
- /** Create a workspace from an existing host directory (does not mkdir). */
101
- export async function createWorkspace(path) {
102
- return await callUnary('workspace.create', { path });
103
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * Mobile surface entry: the standalone phone UI served at /m. Boots its own
3
- * React tree (no main-UI module loader), talks to the host over the shared
4
- * /api transport with the paired-device cookie, and renders a deliberately
5
- * thin three-level surface:
6
- * workspaces (landing, no new-session homepage) → sessions (paged) →
7
- * chat (history paged on demand + live mux stream + prompt input).
8
- */
9
- export {};
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobile/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -1,38 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Mobile surface entry: the standalone phone UI served at /m. Boots its own
4
- * React tree (no main-UI module loader), talks to the host over the shared
5
- * /api transport with the paired-device cookie, and renders a deliberately
6
- * thin three-level surface:
7
- * workspaces (landing, no new-session homepage) → sessions (paged) →
8
- * chat (history paged on demand + live mux stream + prompt input).
9
- */
10
- import { createRoot } from 'react-dom/client';
11
- import { App } from "./views/App.js";
12
- import { mobileCss } from "./mobile-styles.js";
13
- import { initMobileTheme } from "./mobile-theme.js";
14
- import { registerMobilePwa } from "../mobile-pwa.js";
15
- import { consumeMobilePairUrl } from "./pairing.js";
16
- // Apply the persisted (or default light) theme before first paint, so the
17
- // page never flashes the wrong palette.
18
- initMobileTheme();
19
- // Inject the standalone stylesheet (the page has no shell to load it for us).
20
- const style = document.createElement('style');
21
- style.dataset.plugin = 'remote-web-ui/mobile';
22
- style.textContent = mobileCss;
23
- document.head.appendChild(style);
24
- const root = document.getElementById('root');
25
- if (root === null)
26
- throw new Error('mobile: #root missing');
27
- void bootMobile(root);
28
- async function bootMobile(mount) {
29
- const pair = await consumeMobilePairUrl(window.location.href);
30
- if (pair.kind === 'accepted') {
31
- window.location.replace(pair.path);
32
- return;
33
- }
34
- if (pair.kind === 'failed')
35
- window.history.replaceState(null, '', pair.path);
36
- void registerMobilePwa();
37
- createRoot(mount).render(_jsx(App, { initialPairError: pair.kind === 'failed' ? pair.message : undefined }));
38
- }
@@ -1,34 +0,0 @@
1
- /**
2
- * A compact GFM-subset markdown renderer for the mobile chat: headings,
3
- * paragraphs, fenced + inline code, bold/italic/strikethrough, links,
4
- * images, lists, blockquotes, hr, and tables. All HTML is escaped before
5
- * transformation — the output only ever contains the renderer's own tags.
6
- * Dependency-free on purpose (the mobile bundle stays at ~456 KB); the
7
- * escape-first + protocol allow-list design mirrors the desktop panel's
8
- * preview renderer (dsh-aionui-panel/src/client/preview/markdown.ts).
9
- * Pure and exported for tests.
10
- * @module dsh-remote-web-ui/mobile/markdown
11
- */
12
- /**
13
- * Escape HTML special characters. One regex pass replaces all five
14
- * characters through the map; the output is identical to five sequential
15
- * passes (each replacement string contains none of the escaped characters),
16
- * and the common no-special-character case scans the string only once
17
- * instead of five times.
18
- */
19
- export declare function escapeHtml(text: string): string;
20
- /**
21
- * Guard a raw link/image target against dangerous protocols. Returns the
22
- * (trimmed) raw string when safe, else null. Only http:, https:, mailto:,
23
- * fragment anchors (#...) and strictly relative paths are allowed; anything
24
- * with another scheme — javascript:, data:, vbscript:, etc. — or a
25
- * protocol-relative //host target (the browser resolves it against the
26
- * current scheme, reaching an arbitrary origin) is rejected so the value
27
- * never reaches dangerouslySetInnerHTML.
28
- */
29
- export declare function safeUrl(raw: string): string | null;
30
- /** Inline pass: code spans, bold, italic, strikethrough, images, links. */
31
- export declare function renderInline(text: string): string;
32
- /** Render a markdown document to HTML (block pass). */
33
- export declare function renderMarkdown(source: string): string;
34
- //# sourceMappingURL=markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/mobile/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASlD;AAgBD,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqFjD;AAED,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA+HrD"}