@deepseek-ai/dsh-client-ui-goal 0.2.1-alpha.1 → 0.2.1-alpha.3
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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/client.js +56 -6
- package/lib/types/client/GoalCommandInputView.d.ts +3 -3
- package/lib/types/client/GoalCommandReference.d.ts +9 -0
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/user-text-rules.d.ts +21 -0
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +21 -20
package/README.i18n.yaml
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
en: 4f6e6353d793a0de
|
|
19
19
|
zh: cde6e470f7dd9057
|
|
20
20
|
/deepseek-ai-dsh-client-ui-goal/use-this-package/the-command-input-bubble:
|
|
21
|
-
en:
|
|
22
|
-
zh:
|
|
21
|
+
en: 05f0360b6c6dd3e9
|
|
22
|
+
zh: d14c3f15dc4cea5b
|
|
23
23
|
/deepseek-ai-dsh-client-ui-goal/use-this-package/failures:
|
|
24
24
|
en: 097bbdd748dc17e5
|
|
25
25
|
zh: 867d341d046ba609
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Mount this plugin alongside `ui-conversation` and the goal domain package; the s
|
|
|
29
29
|
|
|
30
30
|
### The command-input bubble
|
|
31
31
|
|
|
32
|
-
Each durable `/goal` run projects as a right-aligned user-style bubble labeled `Command input` (or `指令输入`), rendered before the generic command result row; the leading `/goal` token renders as a command reference chip in the code face through
|
|
32
|
+
Each durable `/goal` run projects as a right-aligned user-style bubble labeled `Command input` (or `指令输入`), rendered before the generic command result row; the leading `/goal` token renders as a command reference chip in the code face through the shared `conversation.user.text` Factory and the Goal-owned `command` renderer, using the executed token range in `facts.commands`, and the objective stays plain body text. It carries no timestamp, copy, or branch actions, and reloading reconstructs it from the run.
|
|
33
33
|
|
|
34
34
|
### Failures
|
|
35
35
|
|
package/README.zh.md
CHANGED
|
@@ -29,7 +29,7 @@ Web GUI 的 goal 界面同时显示持久 goal 状态及当前的进程本地激
|
|
|
29
29
|
|
|
30
30
|
### 指令输入气泡
|
|
31
31
|
|
|
32
|
-
每条持久的 `/goal` 运行都投影为一个右对齐的用户样式气泡,标签为 `Command input`(或 `指令输入`),渲染在通用命令结果行之前;开头的 `/goal` token
|
|
32
|
+
每条持久的 `/goal` 运行都投影为一个右对齐的用户样式气泡,标签为 `Command input`(或 `指令输入`),渲染在通用命令结果行之前;开头的 `/goal` token 经共享的 `conversation.user.text` Factory 与 Goal 自有的 `command` renderer,使用 `facts.commands` 中的实际执行 token 范围, 以等宽代码字体渲染为指令引用 chip,目标文本保持正文字体。它不含时间戳、复制或分支操作,重新加载时会依据运行记录重建。
|
|
33
33
|
|
|
34
34
|
### 失败
|
|
35
35
|
|
package/lib/client.js
CHANGED
|
@@ -448,17 +448,19 @@ window.__ModuleLoader__.load({
|
|
|
448
448
|
};
|
|
449
449
|
//#endregion
|
|
450
450
|
//#region lib/types/client/GoalCommandInputView.js
|
|
451
|
+
const GOAL_COMMANDS = [{
|
|
452
|
+
start: 0,
|
|
453
|
+
end: 5,
|
|
454
|
+
name: GOAL_COMMAND
|
|
455
|
+
}];
|
|
451
456
|
/**
|
|
452
457
|
* Right-aligned `/goal` input bubble without ordinary message actions. The
|
|
453
458
|
* echoed line decorates its leading `/goal` token as a command chip — the run
|
|
454
459
|
* this Node projects is the fact that that token was a command — and keeps
|
|
455
460
|
* the objective, `/goal` mentions included, as plain text.
|
|
456
461
|
*/
|
|
457
|
-
const GoalCommandInputView = (0, react.memo)(function GoalCommandInputView({ node, t }) {
|
|
462
|
+
const GoalCommandInputView = (0, react.memo)(function GoalCommandInputView({ node, t, renderFactorySlot }) {
|
|
458
463
|
const data = node.data;
|
|
459
|
-
const split = data.text.search(/\s/u);
|
|
460
|
-
const head = split === -1 ? data.text : data.text.slice(0, split);
|
|
461
|
-
const rest = split === -1 ? "" : data.text.slice(split);
|
|
462
464
|
return (0, react_jsx_runtime.jsx)("div", {
|
|
463
465
|
className: GoalCommandInputView_module_css_default.row,
|
|
464
466
|
"data-command-input": "",
|
|
@@ -466,14 +468,56 @@ window.__ModuleLoader__.load({
|
|
|
466
468
|
"aria-label": t("commandInput.aria"),
|
|
467
469
|
children: (0, react_jsx_runtime.jsx)("div", {
|
|
468
470
|
className: GoalCommandInputView_module_css_default.stack,
|
|
469
|
-
children: (0, react_jsx_runtime.
|
|
471
|
+
children: (0, react_jsx_runtime.jsx)("div", {
|
|
470
472
|
className: GoalCommandInputView_module_css_default.bubble,
|
|
471
|
-
children:
|
|
473
|
+
children: renderFactorySlot("conversation.user.text", {
|
|
474
|
+
text: data.text,
|
|
475
|
+
facts: { commands: GOAL_COMMANDS },
|
|
476
|
+
interactive: false
|
|
477
|
+
})
|
|
472
478
|
})
|
|
473
479
|
})
|
|
474
480
|
});
|
|
475
481
|
});
|
|
476
482
|
//#endregion
|
|
483
|
+
//#region lib/types/client/GoalCommandReference.js
|
|
484
|
+
/**
|
|
485
|
+
* Render one confirmed command token without adding an activation action.
|
|
486
|
+
* @param props - resolved command node and its original spelling.
|
|
487
|
+
* @returns a noninteractive inline command chip.
|
|
488
|
+
*/
|
|
489
|
+
function GoalCommandReference({ node, raw }) {
|
|
490
|
+
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.ReferenceChip, {
|
|
491
|
+
appearance: "command",
|
|
492
|
+
label: `/${node.data.name}`,
|
|
493
|
+
title: raw
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region lib/types/client/user-text-rules.js
|
|
498
|
+
/** Return the nearest exact confirmed command, checking boundaries against the original string. */
|
|
499
|
+
const goalCommandReferenceRule = {
|
|
500
|
+
id: "command",
|
|
501
|
+
order: 20,
|
|
502
|
+
match(text, from, context) {
|
|
503
|
+
const slash = /(?<!\S)\//gu;
|
|
504
|
+
slash.lastIndex = from;
|
|
505
|
+
if (!slash.test(text)) return void 0;
|
|
506
|
+
const commands = context.read("commands");
|
|
507
|
+
let best;
|
|
508
|
+
for (const { start, end, name } of commands ?? []) {
|
|
509
|
+
if (start < from || end > text.length || text.slice(start, end) !== `/${name}` || start !== 0 && !/\s/u.test(text.slice(start - 1, start)) || end !== text.length && !/\s/u.test(text.slice(end, end + 1))) continue;
|
|
510
|
+
if (best === void 0 || start < best.start || start === best.start && end > best.end) best = {
|
|
511
|
+
id: "command",
|
|
512
|
+
start,
|
|
513
|
+
end,
|
|
514
|
+
data: { name }
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return best;
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
//#endregion
|
|
477
521
|
//#region lib/types/client/locales.js
|
|
478
522
|
/** `goal` namespace dictionaries. */
|
|
479
523
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
@@ -525,10 +569,16 @@ window.__ModuleLoader__.load({
|
|
|
525
569
|
*/
|
|
526
570
|
function apply(ctx) {
|
|
527
571
|
ctx.uiConversation.events.register(goalCommandInputDefinition);
|
|
572
|
+
ctx.uiConversation.userText.register(goalCommandReferenceRule);
|
|
528
573
|
ctx.effect(() => ctx.locale.register(NS, {
|
|
529
574
|
zh,
|
|
530
575
|
en
|
|
531
576
|
}), "ui-goal: dictionaries");
|
|
577
|
+
ctx.slots.inject("conversation.user.text.node", () => ctx.slots.register({
|
|
578
|
+
name: "conversation.user.text.node",
|
|
579
|
+
key: "command",
|
|
580
|
+
priority: 100
|
|
581
|
+
}, GoalCommandReference));
|
|
532
582
|
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
|
533
583
|
name: "conversation.chat.node",
|
|
534
584
|
key: "command-input",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
-
type GoalCommandInputViewProps = PropsRuntime<'conversation.chat.node', 'command-input'> & PropsLocale<'goal'
|
|
1
|
+
import type { PropsLocale, PropsRenderFactories, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
|
+
type GoalCommandInputViewProps = PropsRuntime<'conversation.chat.node', 'command-input'> & PropsLocale<'goal'> & PropsRenderFactories;
|
|
3
3
|
/**
|
|
4
4
|
* Right-aligned `/goal` input bubble without ordinary message actions. The
|
|
5
5
|
* echoed line decorates its leading `/goal` token as a command chip — the run
|
|
6
6
|
* this Node projects is the fact that that token was a command — and keeps
|
|
7
7
|
* the objective, `/goal` mentions included, as plain text.
|
|
8
8
|
*/
|
|
9
|
-
export declare const GoalCommandInputView: import("react").MemoExoticComponent<({ node, t, }: GoalCommandInputViewProps) => import("react").JSX.Element>;
|
|
9
|
+
export declare const GoalCommandInputView: import("react").MemoExoticComponent<({ node, t, renderFactorySlot, }: GoalCommandInputViewProps) => import("react").JSX.Element>;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=GoalCommandInputView.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Display-only command references; command execution stays with the original command input. */
|
|
2
|
+
import type { UserTextNodeProps } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
/**
|
|
4
|
+
* Render one confirmed command token without adding an activation action.
|
|
5
|
+
* @param props - resolved command node and its original spelling.
|
|
6
|
+
* @returns a noninteractive inline command chip.
|
|
7
|
+
*/
|
|
8
|
+
export declare function GoalCommandReference({ node, raw }: UserTextNodeProps<'command'>): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=GoalCommandReference.d.ts.map
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* This plugin does not create goals; deployments may expose /goal separately.
|
|
10
10
|
*/
|
|
11
11
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
12
|
+
export type {} from './user-text-rules.ts';
|
|
12
13
|
import { type GoalKey } from './locales.ts';
|
|
13
14
|
export { GoalBar, GoalDock } from './GoalBar.tsx';
|
|
14
15
|
export type { GoalActionResult, GoalBarActions, } from './slots.ts';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Original-text command candidates restricted to confirmed execution ranges. */
|
|
2
|
+
import type { UserTextRule } from '@deepseek-ai/dsh-client-ui-conversation/client';
|
|
3
|
+
declare module '@deepseek-ai/dsh-client-ui-conversation/client' {
|
|
4
|
+
interface UserTextDataMap {
|
|
5
|
+
/** The executed command name, without the leading slash. */
|
|
6
|
+
command: {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface UserTextFacts {
|
|
11
|
+
/** Confirmed command ranges; repeated command spelling outside them stays plain text. */
|
|
12
|
+
readonly commands: readonly {
|
|
13
|
+
readonly start: number;
|
|
14
|
+
readonly end: number;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Return the nearest exact confirmed command, checking boundaries against the original string. */
|
|
20
|
+
export declare const goalCommandReferenceRule: UserTextRule<'command'>;
|
|
21
|
+
//# sourceMappingURL=user-text-rules.d.ts.map
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-goal",
|
|
3
3
|
"description": "Session goal surface: GoalBar docked above the composer, read from the goal session projection",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"default": "./lib/client.js"
|
|
24
24
|
},
|
|
25
25
|
"./src/*": "./src/*",
|
|
26
|
-
"./package.json": "./package.json"
|
|
26
|
+
"./package.json": "./package.json",
|
|
27
|
+
"./locale/*.json": "./locale/*.json"
|
|
27
28
|
},
|
|
28
29
|
"dsh": {
|
|
29
30
|
"client": {
|
|
@@ -41,30 +42,30 @@
|
|
|
41
42
|
},
|
|
42
43
|
"license": "MIT",
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
45
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
48
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.3",
|
|
49
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.1-alpha.3",
|
|
50
|
+
"@deepseek-ai/dsh-client-locale": "0.2.1-alpha.3",
|
|
51
|
+
"@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.3",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-chat": "0.2.1-alpha.3",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.3",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.3",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.3",
|
|
58
|
+
"@deepseek-ai/dsh-commands": "0.2.1-alpha.3",
|
|
59
|
+
"@deepseek-ai/dsh-goal": "0.2.1-alpha.3",
|
|
60
|
+
"@testing-library/react": "^16.3.3",
|
|
61
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2",
|
|
49
62
|
"react": "^18.2.0",
|
|
50
63
|
"react-dom": "^18.2.0",
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-client-locale": "0.2.1-alpha.1",
|
|
54
|
-
"@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.1",
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.1-alpha.1",
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.1",
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.1",
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.1",
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.1",
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.1",
|
|
61
|
-
"@deepseek-ai/dsh-commands": "0.2.1-alpha.1",
|
|
62
|
-
"@deepseek-ai/dsh-goal": "0.2.1-alpha.1",
|
|
63
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
64
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.1",
|
|
65
|
-
"@deepseek-ai/dsh-session": "0.2.1-alpha.1"
|
|
64
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.3",
|
|
65
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.3"
|
|
66
66
|
},
|
|
67
67
|
"files": [
|
|
68
|
+
"locale/*.json",
|
|
68
69
|
"lib/index.js",
|
|
69
70
|
"lib/client.js",
|
|
70
71
|
"lib/types/**/*.d.ts"
|