@deepseek-harness-tui/dsh-tui 0.8.1 → 0.8.2
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 +22 -13
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -0
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -0
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -0
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -0
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -0
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -0
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -0
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -0
- package/dsh-ecosystem-spec/registry/README.md +14 -0
- package/dsh-ecosystem-spec/registry/contracts/scene-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/settings-section-v1alpha1.json +13 -0
- package/dsh-ecosystem-spec/registry/contracts/tui-channel-v1alpha1.json +30 -0
- package/dsh-ecosystem-spec/registry/contracts/workspace-provider-v1alpha1.json +6 -0
- package/{ecosystem-spec → dsh-ecosystem-spec}/registry/permissions-0.1.json +1 -1
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -0
- package/lib/types/command-trees.d.ts +2 -1
- package/lib/types/command-trees.d.ts.map +1 -1
- package/lib/types/command-trees.js +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts +10 -5
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LoadedContextPanel.js +18 -7
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +16 -7
- package/lib/types/components/Markdown.d.ts +13 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +15 -1
- package/lib/types/components/MessageList.d.ts +3 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +90 -9
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +26 -12
- package/lib/types/components/StreamingMarkdown.d.ts +2 -8
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +51 -9
- package/lib/types/components/activityFrames.d.ts +1 -1
- package/lib/types/components/activityFrames.d.ts.map +1 -1
- package/lib/types/components/activityFrames.js +4 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +5 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +26 -3
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +12 -1
- package/lib/types/dsh-adapter/channel.d.ts +31 -4
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +267 -102
- package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
- package/lib/types/dsh-adapter/childStderr.js +10 -0
- package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -1
- package/lib/types/dsh-adapter/command-attribution.js +2 -2
- package/lib/types/dsh-adapter/command-trees.d.ts +7 -1
- package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -1
- package/lib/types/dsh-adapter/command-trees.js +70 -20
- package/lib/types/dsh-adapter/component-identity.d.ts +5 -0
- package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -1
- package/lib/types/dsh-adapter/component-identity.js +14 -14
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/decision-guard.js +10 -16
- package/lib/types/dsh-adapter/dialogs.d.ts +2 -3
- package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/dialogs.js +114 -60
- package/lib/types/dsh-adapter/effect-ledger.d.ts +0 -8
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +73 -53
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/extension-events.js +39 -1
- package/lib/types/dsh-adapter/grants.d.ts.map +1 -1
- package/lib/types/dsh-adapter/grants.js +43 -14
- package/lib/types/dsh-adapter/host-access.d.ts +37 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-access.js +652 -0
- package/lib/types/dsh-adapter/host-descriptor.d.ts +2 -2
- package/lib/types/dsh-adapter/host-descriptor.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-descriptor.js +31 -8
- package/lib/types/dsh-adapter/index.d.ts +4 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +1 -0
- package/lib/types/dsh-adapter/message-observer.d.ts +10 -15
- package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -1
- package/lib/types/dsh-adapter/message-observer.js +114 -70
- package/lib/types/dsh-adapter/plugin-host.d.ts +39 -6
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-host.js +139 -44
- package/lib/types/dsh-adapter/plugin-storage.d.ts +0 -5
- package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-storage.js +48 -36
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +80 -16
- package/lib/types/dsh-adapter/promptDebug.d.ts +0 -6
- package/lib/types/dsh-adapter/promptDebug.d.ts.map +1 -1
- package/lib/types/dsh-adapter/promptDebug.js +13 -4
- package/lib/types/dsh-adapter/renderers.d.ts +6 -14
- package/lib/types/dsh-adapter/renderers.d.ts.map +1 -1
- package/lib/types/dsh-adapter/renderers.js +81 -46
- package/lib/types/dsh-adapter/scenes.d.ts +8 -4
- package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/scenes.js +136 -37
- package/lib/types/dsh-adapter/settings-sections.d.ts +7 -3
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +106 -26
- package/lib/types/dsh-adapter/shortcuts.d.ts +8 -10
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
- package/lib/types/dsh-adapter/shortcuts.js +108 -36
- package/lib/types/dsh-adapter/status.d.ts +6 -7
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +88 -22
- package/lib/types/dsh-adapter/workspaces.d.ts +16 -5
- package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
- package/lib/types/dsh-adapter/workspaces.js +287 -170
- package/lib/types/extensions.d.ts +10 -5
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/extensions.js +11 -5
- package/lib/types/force-production-react.d.ts +1 -0
- package/lib/types/force-production-react.d.ts.map +1 -0
- package/lib/types/force-production-react.js +12 -0
- package/lib/types/i18n.d.ts +14 -6
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +4 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/ink/components/App.d.ts +2 -0
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +4 -0
- package/lib/types/ink/ink.d.ts +20 -3
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +57 -5
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +128 -9
- package/lib/types/ink/output.d.ts +28 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +158 -12
- package/lib/types/ink/screen.d.ts +39 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +117 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +10 -2
- package/lib/types/ink/wrapAnsi.d.ts +1 -1
- package/lib/types/ink/wrapAnsi.d.ts.map +1 -1
- package/lib/types/ink/wrapAnsi.js +29 -2
- package/lib/types/plugin-host.d.ts +13 -11
- package/lib/types/plugin-host.d.ts.map +1 -1
- package/lib/types/plugin-host.js +16 -16
- package/lib/types/plugin-spec/registry.d.ts +2 -2
- package/lib/types/plugin-spec/registry.d.ts.map +1 -1
- package/lib/types/plugin-spec/registry.js +113 -18
- package/lib/types/plugin-spec/tui-extension.d.ts.map +1 -1
- package/lib/types/plugin-spec/tui-extension.js +2 -0
- package/lib/types/plugin-spec/validate.d.ts.map +1 -1
- package/lib/types/plugin-spec/validate.js +20 -1
- package/lib/types/scenes.d.ts +2 -1
- package/lib/types/scenes.d.ts.map +1 -1
- package/lib/types/scenes.js +1 -1
- package/lib/types/screens/Chat.d.ts +3 -3
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +38 -17
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +10 -3
- package/lib/types/sessions/view.d.ts +3 -2
- package/lib/types/sessions/view.d.ts.map +1 -1
- package/lib/types/sessions/view.js +18 -0
- package/lib/types/settings-sections.d.ts +2 -1
- package/lib/types/settings-sections.d.ts.map +1 -1
- package/lib/types/settings-sections.js +1 -1
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
- package/lib/types/utils/execFileNoThrow.js +3 -0
- package/lib/types/workspaces.d.ts +2 -1
- package/lib/types/workspaces.d.ts.map +1 -1
- package/lib/types/workspaces.js +1 -1
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/command/package.json +1 -1
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/connection/lib/memory.d.ts +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.js +1 -0
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/node_modules/@dsh-std/connection/package.json +1 -1
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/core/package.json +1 -1
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
- package/node_modules/@dsh-std/manifest/package.json +1 -1
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/messages/package.json +1 -1
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
- package/node_modules/@dsh-std/presentation/README.md +2 -1
- package/node_modules/@dsh-std/presentation/README.zh.md +2 -1
- package/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/index.d.ts +44 -1
- package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -1
- package/node_modules/@dsh-std/presentation/lib/index.js +6 -3
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/presentation/package.json +7 -3
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -0
- package/node_modules/@dsh-std/storage/package.json +1 -1
- package/package.json +10 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +2 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +2 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js +179 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +44 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +6 -3
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +7 -3
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +1 -1
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +1 -1
- package/ecosystem-spec/registry/registry-0.15.json +0 -57
- /package/{ecosystem-spec → dsh-ecosystem-spec}/registry/contracts/decision-events-v1alpha1.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/registry/host-descriptor.tui.example.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/schemas/conformance-claim.schema.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/schemas/effect-ledger-record.schema.json +0 -0
- /package/{ecosystem-spec → dsh-ecosystem-spec}/schemas/host-descriptor.schema.json +0 -0
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { Service } from '@deepseek-ai/cordis';
|
|
23
23
|
import { cleanScalarText } from './sanitize.js';
|
|
24
|
+
import { activationFiber, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
24
25
|
const NAMED_KEYS = {
|
|
25
26
|
enter: 'return',
|
|
26
27
|
return: 'return',
|
|
@@ -180,12 +181,29 @@ export function matchShortcut(combo, input, key) {
|
|
|
180
181
|
}
|
|
181
182
|
/** `ctx.tuiShortcuts` — plugin keyboard shortcut registry. */
|
|
182
183
|
export class TuiShortcutRuntime extends Service {
|
|
183
|
-
shortcuts = new Map();
|
|
184
|
-
/** Handler invocation errors are surfaced through this hook — the chat
|
|
185
|
-
* screen wires it to its notification toast. */
|
|
186
|
-
onError;
|
|
187
184
|
constructor(ctx) {
|
|
188
185
|
super(ctx, 'tuiShortcuts');
|
|
186
|
+
compositionRoot(ctx);
|
|
187
|
+
const runtime = this;
|
|
188
|
+
const state = {
|
|
189
|
+
shortcuts: new Map(),
|
|
190
|
+
owners: new Map(),
|
|
191
|
+
onError: undefined,
|
|
192
|
+
host: undefined,
|
|
193
|
+
logger: ctx.logger,
|
|
194
|
+
};
|
|
195
|
+
const host = Object.freeze({
|
|
196
|
+
dispatch: (input, key) => dispatchShortcut(runtime, input, key),
|
|
197
|
+
setErrorHandler: (handler) => {
|
|
198
|
+
state.onError = handler;
|
|
199
|
+
return () => {
|
|
200
|
+
if (state.onError === handler)
|
|
201
|
+
state.onError = undefined;
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
state.host = host;
|
|
206
|
+
hostShortcuts.set(runtime, state);
|
|
189
207
|
}
|
|
190
208
|
/**
|
|
191
209
|
* Bind `combo` to `handler`. Invalid, modifier-less, reserved, or
|
|
@@ -201,9 +219,30 @@ export class TuiShortcutRuntime extends Service {
|
|
|
201
219
|
* effect ledger's pluginId — omitting it records `undeclared` (C-060).
|
|
202
220
|
*/
|
|
203
221
|
register(combo, options, identity) {
|
|
204
|
-
|
|
222
|
+
let caller;
|
|
223
|
+
try {
|
|
224
|
+
caller = requirePluginCaller(this.ctx, 'tuiShortcuts.register', this);
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
this.ctx.logger.warn('dsh-tui: tuiShortcuts.register requires a live non-root plugin activation');
|
|
228
|
+
return () => { };
|
|
229
|
+
}
|
|
230
|
+
const state = shortcutStateFor(this);
|
|
231
|
+
const owner = activationFiber(caller);
|
|
232
|
+
if (owner === undefined) {
|
|
233
|
+
this.ctx.logger.warn('dsh-tui: tuiShortcuts.register requires a live activation');
|
|
234
|
+
return () => { };
|
|
235
|
+
}
|
|
236
|
+
let parsed;
|
|
237
|
+
try {
|
|
238
|
+
parsed = parseShortcutCombo(combo);
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
this.ctx.logger.warn('dsh-tui: tuiShortcuts.register rejected an uncoercible combo');
|
|
242
|
+
return () => { };
|
|
243
|
+
}
|
|
205
244
|
if (parsed === undefined) {
|
|
206
|
-
this.ctx.logger.warn(
|
|
245
|
+
this.ctx.logger.warn('dsh-tui: tuiShortcuts.register rejected an invalid combo — need ctrl/alt plus one key (e.g. "ctrl+shift+p")');
|
|
207
246
|
return () => { };
|
|
208
247
|
}
|
|
209
248
|
const key = comboKey(parsed);
|
|
@@ -213,11 +252,11 @@ export class TuiShortcutRuntime extends Service {
|
|
|
213
252
|
// still checked for combos reserved WITH shift (ctrl+shift+return).
|
|
214
253
|
const shiftlessKey = comboKey({ ...parsed, shift: false });
|
|
215
254
|
if (RESERVED_CANONICAL.has(key) || RESERVED_CANONICAL.has(shiftlessKey)) {
|
|
216
|
-
this.ctx.logger.warn(`dsh-tui: tuiShortcuts.register rejected "${
|
|
255
|
+
this.ctx.logger.warn(`dsh-tui: tuiShortcuts.register rejected "${parsed.raw}" — reserved by a built-in binding`);
|
|
217
256
|
return () => { };
|
|
218
257
|
}
|
|
219
|
-
if (
|
|
220
|
-
this.ctx.logger.warn(`dsh-tui: tuiShortcuts.register rejected "${
|
|
258
|
+
if (state.shortcuts.has(key)) {
|
|
259
|
+
this.ctx.logger.warn(`dsh-tui: tuiShortcuts.register rejected "${parsed.raw}" — already registered`);
|
|
221
260
|
this.ctx.get('tuiEffectLedger')?.record({
|
|
222
261
|
operation: 'bind',
|
|
223
262
|
resource: { kind: 'shortcut', id: key },
|
|
@@ -226,43 +265,76 @@ export class TuiShortcutRuntime extends Service {
|
|
|
226
265
|
}, identity);
|
|
227
266
|
return () => { };
|
|
228
267
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
268
|
+
let description;
|
|
269
|
+
let handler;
|
|
270
|
+
try {
|
|
271
|
+
description = cleanScalarText(options?.description, 120);
|
|
272
|
+
handler = options?.handler;
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
this.ctx.logger.warn(`dsh-tui: tuiShortcuts.register rejected "${parsed.raw}" — malformed options`);
|
|
276
|
+
return () => { };
|
|
277
|
+
}
|
|
278
|
+
if (typeof handler !== 'function' || description === '') {
|
|
279
|
+
this.ctx.logger.warn(`dsh-tui: tuiShortcuts.register rejected "${parsed.raw}" — needs a description and a handler`);
|
|
232
280
|
return () => { };
|
|
233
281
|
}
|
|
234
|
-
const entry = { combo: parsed, description, handler
|
|
235
|
-
|
|
282
|
+
const entry = { combo: parsed, description, handler };
|
|
283
|
+
state.shortcuts.set(key, entry);
|
|
284
|
+
state.owners.set(key, owner);
|
|
236
285
|
this.ctx.get('tuiEffectLedger')?.record({ operation: 'bind', resource: { kind: 'shortcut', id: key }, result: 'applied' }, identity);
|
|
237
|
-
|
|
238
|
-
if (
|
|
286
|
+
const dispose = () => {
|
|
287
|
+
if (state.shortcuts.get(key) !== entry)
|
|
239
288
|
return;
|
|
240
|
-
|
|
289
|
+
state.shortcuts.delete(key);
|
|
290
|
+
state.owners.delete(key);
|
|
241
291
|
this.ctx.get('tuiEffectLedger')?.record({ operation: 'release', resource: { kind: 'shortcut', id: key }, result: 'applied' }, identity);
|
|
242
292
|
};
|
|
293
|
+
bindCallerEffect(caller, dispose);
|
|
294
|
+
return dispose;
|
|
243
295
|
}
|
|
244
296
|
/** Registered combos with descriptions (diagnostics / future /help). */
|
|
245
297
|
list() {
|
|
246
|
-
|
|
298
|
+
const caller = requirePluginCaller(this.ctx, 'tuiShortcuts.list', this);
|
|
299
|
+
const owner = activationFiber(caller);
|
|
300
|
+
if (owner === undefined)
|
|
301
|
+
return [];
|
|
302
|
+
const state = shortcutStateFor(this);
|
|
303
|
+
return [...state.shortcuts.entries()]
|
|
304
|
+
.filter(([key]) => state.owners.get(key) === owner)
|
|
305
|
+
.map(([, entry]) => ({ combo: entry.combo.raw, description: entry.description }));
|
|
247
306
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
307
|
+
}
|
|
308
|
+
const hostShortcuts = new WeakMap();
|
|
309
|
+
function shortcutStateFor(runtime) {
|
|
310
|
+
const state = hostShortcuts.get(concreteService(runtime));
|
|
311
|
+
if (state === undefined)
|
|
312
|
+
throw new Error('tuiShortcuts host state is unavailable');
|
|
313
|
+
return state;
|
|
314
|
+
}
|
|
315
|
+
function dispatchShortcut(runtime, input, key) {
|
|
316
|
+
const state = shortcutStateFor(runtime);
|
|
317
|
+
for (const entry of state.shortcuts.values()) {
|
|
318
|
+
if (!matchShortcut(entry.combo, input, key))
|
|
319
|
+
continue;
|
|
320
|
+
Promise.resolve()
|
|
321
|
+
.then(() => entry.handler())
|
|
322
|
+
.catch((error) => {
|
|
323
|
+
state.onError?.(entry.combo.raw, error);
|
|
324
|
+
state.logger.warn(`dsh-tui: shortcut "${entry.combo.raw}" handler failed: %o`, error);
|
|
325
|
+
});
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
export function getHostShortcuts(runtime) {
|
|
331
|
+
if (runtime === undefined)
|
|
332
|
+
return undefined;
|
|
333
|
+
try {
|
|
334
|
+
return hostShortcuts.get(concreteService(runtime))?.host;
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
return undefined;
|
|
266
338
|
}
|
|
267
339
|
}
|
|
268
340
|
export default TuiShortcutRuntime;
|
|
@@ -20,13 +20,16 @@ export declare class TuiStatusStore {
|
|
|
20
20
|
private readonly entries;
|
|
21
21
|
private snapshot;
|
|
22
22
|
/** Set or clear (undefined/empty) one key. */
|
|
23
|
-
set(key: string, text: string | undefined, token?: number): void;
|
|
23
|
+
set(key: string, text: string | undefined, token?: number, owner?: object): void;
|
|
24
24
|
/** Current contributions, first-set first (stable between changes). */
|
|
25
25
|
getSnapshot(): readonly TuiStatusEntry[];
|
|
26
|
+
/** Host runtime uses this to enforce that one activation cannot rewrite or
|
|
27
|
+
* clear another activation's keyed contribution. */
|
|
28
|
+
ownerOf(key: string): object | undefined;
|
|
26
29
|
/** Clear `key` only while it still holds the write tagged `token` — a
|
|
27
30
|
* stale disposer must not wipe a newer contribution (even one with
|
|
28
31
|
* identical text). Returns true when this call actually cleared. */
|
|
29
|
-
clearIf(key: string, token: number): boolean;
|
|
32
|
+
clearIf(key: string, token: number, owner?: object): boolean;
|
|
30
33
|
/** Drop everything (teardown). */
|
|
31
34
|
clear(): void;
|
|
32
35
|
subscribe(listener: () => void): () => void;
|
|
@@ -43,11 +46,6 @@ declare module '@deepseek-ai/cordis' {
|
|
|
43
46
|
* a status line must never take the TUI down.
|
|
44
47
|
*/
|
|
45
48
|
export declare class TuiStatusRuntime extends Service {
|
|
46
|
-
/** The store the chat screen renders. Exposed for the host, not plugins. */
|
|
47
|
-
readonly store: TuiStatusStore;
|
|
48
|
-
/** Monotonic per-write token; a disposer only clears ITS write (see the
|
|
49
|
-
* store's token comment for the same-value ABA this prevents). */
|
|
50
|
-
private nextToken;
|
|
51
49
|
constructor(ctx: Context);
|
|
52
50
|
/**
|
|
53
51
|
* Set (or clear with `undefined`) the contribution for `key`. Keys are
|
|
@@ -71,5 +69,6 @@ export declare class TuiStatusRuntime extends Service {
|
|
|
71
69
|
*/
|
|
72
70
|
set(key: string, text: string | number | boolean | undefined, identity?: Context): () => void;
|
|
73
71
|
}
|
|
72
|
+
export declare function getHostStatusStore(runtime: TuiStatusRuntime | undefined): TuiStatusStore | undefined;
|
|
74
73
|
export default TuiStatusRuntime;
|
|
75
74
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":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SAAQ,OAAO;gBAC/B,GAAG,EAAE,OAAO;IAUxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,IAAI;CAwF9F;AAgBD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAOpG;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { Service } from '@deepseek-ai/cordis';
|
|
11
11
|
import { cleanScalarText } from './sanitize.js';
|
|
12
|
+
import { activationFiber, assertCallerContext, bindCallerEffect, compositionRoot, concreteService, requirePluginCaller } from './host-access.js';
|
|
13
|
+
import { componentIdentityOf } from './component-identity.js';
|
|
12
14
|
// Colon-separated segments are the documented namespacing convention
|
|
13
15
|
// (`plugin:sub-item`); each segment stays a lowercase slug.
|
|
14
16
|
const KEY_PATTERN = /^[a-z][a-z0-9_-]*(:[a-z][a-z0-9_-]*)*$/u;
|
|
15
17
|
const TEXT_CELLS = 200;
|
|
16
18
|
const MAX_ENTRIES = 20;
|
|
19
|
+
const HOST_STATUS_OWNER = Object.freeze({ kind: 'host-status-owner' });
|
|
17
20
|
/** Cordis-free keyed-text store. Render order is first-set order (Map
|
|
18
21
|
* insertion order), so a plugin's line never jumps around on updates. */
|
|
19
22
|
export class TuiStatusStore {
|
|
@@ -27,7 +30,7 @@ export class TuiStatusStore {
|
|
|
27
30
|
// emits — a fresh array per call would re-render in an infinite loop.
|
|
28
31
|
snapshot = [];
|
|
29
32
|
/** Set or clear (undefined/empty) one key. */
|
|
30
|
-
set(key, text, token = 0) {
|
|
33
|
+
set(key, text, token = 0, owner = HOST_STATUS_OWNER) {
|
|
31
34
|
const had = this.entries.has(key);
|
|
32
35
|
if (text === undefined || text === '') {
|
|
33
36
|
if (!had)
|
|
@@ -42,7 +45,7 @@ export class TuiStatusStore {
|
|
|
42
45
|
existing.token = token;
|
|
43
46
|
return;
|
|
44
47
|
}
|
|
45
|
-
this.entries.set(key, { text, token });
|
|
48
|
+
this.entries.set(key, { text, token, owner });
|
|
46
49
|
}
|
|
47
50
|
this.snapshot = [...this.entries].map(([entryKey, entry]) => ({ key: entryKey, text: entry.text }));
|
|
48
51
|
this.emit();
|
|
@@ -51,10 +54,17 @@ export class TuiStatusStore {
|
|
|
51
54
|
getSnapshot() {
|
|
52
55
|
return this.snapshot;
|
|
53
56
|
}
|
|
57
|
+
/** Host runtime uses this to enforce that one activation cannot rewrite or
|
|
58
|
+
* clear another activation's keyed contribution. */
|
|
59
|
+
ownerOf(key) {
|
|
60
|
+
return this.entries.get(key)?.owner;
|
|
61
|
+
}
|
|
54
62
|
/** Clear `key` only while it still holds the write tagged `token` — a
|
|
55
63
|
* stale disposer must not wipe a newer contribution (even one with
|
|
56
64
|
* identical text). Returns true when this call actually cleared. */
|
|
57
|
-
clearIf(key, token) {
|
|
65
|
+
clearIf(key, token, owner) {
|
|
66
|
+
if (owner !== undefined && this.entries.get(key)?.owner !== owner)
|
|
67
|
+
return false;
|
|
58
68
|
if (this.entries.get(key)?.token !== token)
|
|
59
69
|
return false;
|
|
60
70
|
this.entries.delete(key);
|
|
@@ -87,14 +97,14 @@ export class TuiStatusStore {
|
|
|
87
97
|
* a status line must never take the TUI down.
|
|
88
98
|
*/
|
|
89
99
|
export class TuiStatusRuntime extends Service {
|
|
90
|
-
/** The store the chat screen renders. Exposed for the host, not plugins. */
|
|
91
|
-
store = new TuiStatusStore();
|
|
92
|
-
/** Monotonic per-write token; a disposer only clears ITS write (see the
|
|
93
|
-
* store's token comment for the same-value ABA this prevents). */
|
|
94
|
-
nextToken = 1;
|
|
95
100
|
constructor(ctx) {
|
|
96
101
|
super(ctx, 'tuiStatus');
|
|
97
|
-
ctx
|
|
102
|
+
compositionRoot(ctx);
|
|
103
|
+
// Keep host state out of the traceable service object. A WeakMap also
|
|
104
|
+
// works with Cordis's caller-bound method proxy (unlike `#private`).
|
|
105
|
+
const state = { store: new TuiStatusStore(), nextToken: 1 };
|
|
106
|
+
hostStatusStores.set(this, state);
|
|
107
|
+
ctx.effect(() => () => state.store.clear());
|
|
98
108
|
}
|
|
99
109
|
/**
|
|
100
110
|
* Set (or clear with `undefined`) the contribution for `key`. Keys are
|
|
@@ -118,16 +128,49 @@ export class TuiStatusRuntime extends Service {
|
|
|
118
128
|
*/
|
|
119
129
|
set(key, text, identity) {
|
|
120
130
|
const noop = () => { };
|
|
121
|
-
|
|
131
|
+
let caller;
|
|
132
|
+
try {
|
|
133
|
+
caller = requirePluginCaller(this.ctx, 'tuiStatus.set', this);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
this.ctx.logger.warn('dsh-tui: tuiStatus.set requires a live non-root plugin activation');
|
|
137
|
+
return noop;
|
|
138
|
+
}
|
|
139
|
+
const state = statusStateFor(this);
|
|
140
|
+
const store = state.store;
|
|
141
|
+
const callerIdentity = componentIdentityOf(caller);
|
|
142
|
+
const suppliedIdentity = identity === undefined ? callerIdentity : componentIdentityOf(identity);
|
|
143
|
+
if (identity !== undefined) {
|
|
144
|
+
try {
|
|
145
|
+
assertCallerContext(caller, identity, 'tuiStatus.set');
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
caller.logger.warn('dsh-tui: tuiStatus.set rejected an identity belonging to another activation');
|
|
149
|
+
return noop;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const owner = activationFiber(caller);
|
|
153
|
+
if (owner === undefined) {
|
|
154
|
+
caller.logger.warn('dsh-tui: tuiStatus.set requires a live activation owner');
|
|
155
|
+
return noop;
|
|
156
|
+
}
|
|
157
|
+
let normalized;
|
|
158
|
+
try {
|
|
159
|
+
normalized = String(key ?? '').trim().toLowerCase();
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
caller.logger.warn('dsh-tui: tuiStatus.set rejected an uncoercible key');
|
|
163
|
+
return noop;
|
|
164
|
+
}
|
|
122
165
|
if (!KEY_PATTERN.test(normalized)) {
|
|
123
|
-
|
|
166
|
+
caller.logger.warn('dsh-tui: tuiStatus.set rejected an invalid key');
|
|
124
167
|
return noop;
|
|
125
168
|
}
|
|
126
|
-
if (text !== undefined && !
|
|
169
|
+
if (text !== undefined && !store.getSnapshot().some(e => e.key === normalized)) {
|
|
127
170
|
// New key beyond the cap: the line is one row of terminal — an
|
|
128
171
|
// unbounded count would push the prompt off screen.
|
|
129
|
-
if (
|
|
130
|
-
|
|
172
|
+
if (store.getSnapshot().length >= MAX_ENTRIES) {
|
|
173
|
+
caller.logger.warn(`dsh-tui: tuiStatus.set rejected "${normalized}": ${MAX_ENTRIES} contributions already shown`);
|
|
131
174
|
return noop;
|
|
132
175
|
}
|
|
133
176
|
}
|
|
@@ -137,15 +180,19 @@ export class TuiStatusRuntime extends Service {
|
|
|
137
180
|
// object would otherwise render as "[object Object]") is REFUSED with
|
|
138
181
|
// a warning — it must not silently become a clear, either.
|
|
139
182
|
if (typeof text !== 'string' && typeof text !== 'number' && typeof text !== 'boolean') {
|
|
140
|
-
|
|
183
|
+
caller.logger.warn(`dsh-tui: tuiStatus.set rejected non-scalar text for "${normalized}"`);
|
|
141
184
|
return noop;
|
|
142
185
|
}
|
|
143
186
|
cleaned = cleanScalarText(text, TEXT_CELLS);
|
|
144
187
|
}
|
|
145
|
-
const token =
|
|
146
|
-
const had =
|
|
147
|
-
|
|
148
|
-
|
|
188
|
+
const token = state.nextToken++;
|
|
189
|
+
const had = store.getSnapshot().some(entry => entry.key === normalized);
|
|
190
|
+
if (store.ownerOf(normalized) !== undefined && store.ownerOf(normalized) !== owner) {
|
|
191
|
+
caller.logger.warn(`dsh-tui: tuiStatus.set rejected "${normalized}" — the contribution belongs to another activation`);
|
|
192
|
+
return noop;
|
|
193
|
+
}
|
|
194
|
+
store.set(normalized, cleaned, token, owner);
|
|
195
|
+
const ledger = caller.get('tuiEffectLedger');
|
|
149
196
|
if (cleaned === undefined) {
|
|
150
197
|
if (had)
|
|
151
198
|
ledger?.record({ operation: 'release', resource: { kind: 'status', id: normalized }, result: 'applied' }, identity);
|
|
@@ -158,11 +205,30 @@ export class TuiStatusRuntime extends Service {
|
|
|
158
205
|
...(had ? { replaces: { resourceId: normalized } } : {}),
|
|
159
206
|
}, identity);
|
|
160
207
|
}
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
|
|
208
|
+
const dispose = () => {
|
|
209
|
+
if (store.clearIf(normalized, token, owner)) {
|
|
210
|
+
caller.get('tuiEffectLedger')?.record({ operation: 'release', resource: { kind: 'status', id: normalized }, result: 'applied' }, identity);
|
|
164
211
|
}
|
|
165
212
|
};
|
|
213
|
+
bindCallerEffect(caller, dispose);
|
|
214
|
+
return dispose;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const hostStatusStores = new WeakMap();
|
|
218
|
+
function statusStateFor(runtime) {
|
|
219
|
+
const store = hostStatusStores.get(concreteService(runtime));
|
|
220
|
+
if (store === undefined)
|
|
221
|
+
throw new Error('tuiStatus host store is unavailable');
|
|
222
|
+
return store;
|
|
223
|
+
}
|
|
224
|
+
export function getHostStatusStore(runtime) {
|
|
225
|
+
if (runtime === undefined)
|
|
226
|
+
return undefined;
|
|
227
|
+
try {
|
|
228
|
+
return hostStatusStores.get(concreteService(runtime))?.store;
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return undefined;
|
|
166
232
|
}
|
|
167
233
|
}
|
|
168
234
|
export default TuiStatusRuntime;
|
|
@@ -83,16 +83,28 @@ export interface TuiWorkspaceProvider {
|
|
|
83
83
|
/** Provider-owned `/workspace <command>` extensions. */
|
|
84
84
|
commands?: readonly TuiWorkspaceCommand[];
|
|
85
85
|
}
|
|
86
|
+
/** Host-only workspace controls used by the TUI front door. Plugin-facing
|
|
87
|
+
* service methods below are intentionally scoped to their calling activation;
|
|
88
|
+
* the channel must use this facade to enumerate and route all providers. */
|
|
89
|
+
export interface TuiWorkspaceHost {
|
|
90
|
+
list(currentCwd: string, signal?: AbortSignal): Promise<readonly TuiWorkspaceTarget[]>;
|
|
91
|
+
resolve(request: string, currentCwd?: string, signal?: AbortSignal): Promise<TuiWorkspaceTarget | undefined>;
|
|
92
|
+
describe(cwd: string): TuiWorkspaceTarget;
|
|
93
|
+
commandShell(cwd: string): Promise<TuiCommandShell | undefined>;
|
|
94
|
+
rename(cwd: string, title: string): Promise<TuiWorkspaceTarget>;
|
|
95
|
+
commands(): readonly Pick<TuiWorkspaceCommand, 'name' | 'aliases' | 'description'>[];
|
|
96
|
+
runCommand(name: string, input: string, cwd: string, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult | undefined>;
|
|
97
|
+
}
|
|
86
98
|
declare module '@deepseek-ai/cordis' {
|
|
87
99
|
interface Context {
|
|
88
100
|
tuiWorkspaces: TuiWorkspaceRuntime;
|
|
89
101
|
}
|
|
90
102
|
}
|
|
91
103
|
export declare const name = "dsh-tui-workspaces";
|
|
104
|
+
/** Bound every provider promise so one plugin cannot park workspace flows. */
|
|
105
|
+
export declare const WORKSPACE_PROVIDER_TIMEOUT_MS = 2000;
|
|
92
106
|
/** Registry and local fallback shared by the TUI and workspace plugins. */
|
|
93
107
|
export declare class TuiWorkspaceRuntime extends Service {
|
|
94
|
-
private readonly providers;
|
|
95
|
-
private readonly providerWaiters;
|
|
96
108
|
constructor(ctx: Context);
|
|
97
109
|
register(provider: TuiWorkspaceProvider): () => void;
|
|
98
110
|
list(currentCwd: string, signal?: AbortSignal): Promise<readonly TuiWorkspaceTarget[]>;
|
|
@@ -103,11 +115,10 @@ export declare class TuiWorkspaceRuntime extends Service {
|
|
|
103
115
|
rename(cwd: string, title: string): Promise<TuiWorkspaceTarget>;
|
|
104
116
|
commands(): readonly Pick<TuiWorkspaceCommand, 'name' | 'aliases' | 'description'>[];
|
|
105
117
|
runCommand(name: string, input: string, cwd: string, signal?: AbortSignal): Promise<TuiWorkspaceCommandResult | undefined>;
|
|
106
|
-
private workspaceRegistry;
|
|
107
|
-
private withStoredTitle;
|
|
108
118
|
private notifyProviderWaiters;
|
|
109
|
-
private waitForProvider;
|
|
110
119
|
}
|
|
120
|
+
/** Resolve the host-only facade for channel/plugin bootstrap code. */
|
|
121
|
+
export declare function getHostWorkspaceRuntime(runtime: TuiWorkspaceRuntime | undefined): TuiWorkspaceHost | undefined;
|
|
111
122
|
/** Local-only fallback for direct embedders that call createChannel() without
|
|
112
123
|
* mounting the optional workspace registry/provider service. */
|
|
113
124
|
export declare function createLocalWorkspaceRuntime(): Pick<TuiWorkspaceRuntime, 'list' | 'resolve' | 'describe' | 'commandShell' | 'rename' | 'commands' | 'runCommand'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/workspaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/workspaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGtD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,UAAU,CAAA;AAEnD,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAA;IACX,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,gBAAgB,CAAA;IACtB,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MA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