dsh-better-ask-user 0.3.8-alpha.1 → 0.3.9-alpha.1
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 -3
- package/lib/index.js +12 -1
- package/lib/index.js.map +1 -1
- package/package.json +31 -31
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<a href="https://www.npmjs.com/package/dsh-better-ask-user"><img src="https://img.shields.io/npm/v/dsh-better-ask-user.svg" alt="npm 版本"></a>
|
|
14
14
|
<a href="LICENSE"><img alt="Apache-2.0" src="https://img.shields.io/github/license/omdsh-dev/dsh-better-ask-user?color=blue"></a>
|
|
15
|
-
<a href="package.json"><img alt="DSH 0.2.3-alpha.
|
|
15
|
+
<a href="package.json"><img alt="DSH 0.2.3-alpha.3" src="https://img.shields.io/badge/DSH-0.2.3--alpha.2-4B32C3"></a>
|
|
16
16
|
<a href="https://github.com/omdsh-dev/dsh-better-dsh"><img alt="Part of Better DSH" src="https://img.shields.io/badge/part%20of-dsh--better--dsh-2F80B7"></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
44
|
# 只安装这个插件
|
|
45
|
-
dsh plugin --profile <profile> add dsh-better-ask-user@0.3.
|
|
45
|
+
dsh plugin --profile <profile> add dsh-better-ask-user@0.3.9-alpha.1 dsh-better-ptc@0.2.4-alpha.1
|
|
46
46
|
|
|
47
47
|
# 或安装 Better DSH(会自动带上所有独立插件)
|
|
48
48
|
dsh plugin --profile <profile> add dsh-better-dsh@0.11.7
|
|
@@ -63,7 +63,7 @@ dsh plugin --profile <profile> add dsh-better-dsh@0.11.7
|
|
|
63
63
|
| 稳定行 id | `dsh-better-ask-user` |
|
|
64
64
|
| 入口 / 工具 | `ask_user_question` · 问题卡片 / 等待时间线 · 提问设置页 |
|
|
65
65
|
| 设置 | 等待时长、输入续期、普通 / Goal 超时行为 |
|
|
66
|
-
| npm 包 | `dsh-better-ask-user@0.3.
|
|
66
|
+
| npm 包 | `dsh-better-ask-user@0.3.9-alpha.1` |
|
|
67
67
|
| 仓库 | https://github.com/omdsh-dev/dsh-better-ask-user |
|
|
68
68
|
|
|
69
69
|
## 设置
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToolRegistryUnavailableError } from '@deepseek-ai/dsh-tools';
|
|
1
2
|
import { Config, readConfig as snapshotConfig } from './config.js';
|
|
2
3
|
import { createBetterAskTool } from './ask-tool.js';
|
|
3
4
|
import { mountPtcExemption } from './ptc.js';
|
|
@@ -13,7 +14,17 @@ export function apply(ctx, config = {}) {
|
|
|
13
14
|
const states = new Map();
|
|
14
15
|
function register(state) {
|
|
15
16
|
const tools = state.actor.get('tools');
|
|
16
|
-
|
|
17
|
+
let base;
|
|
18
|
+
try {
|
|
19
|
+
base = tools.get('ask_user_question', state.agent);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
// alpha.3 reads through the selected tool root. A composition without a
|
|
23
|
+
// root (or before one loads) offers no host tool to shadow.
|
|
24
|
+
if (error instanceof ToolRegistryUnavailableError)
|
|
25
|
+
return;
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
17
28
|
if (base === undefined)
|
|
18
29
|
return;
|
|
19
30
|
state.askDispose = tools.register(createBetterAskTool(ctx, base, readConfig));
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,M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AAG,SAAS,CAAA;IAC9B,CAAC;IAED,GAAG,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,EAAa,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;IACnE,GAAG,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC/B,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,CAAC,KAAK,CAAC,CAAA;QACvC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC,CAAC,CAAA;IACF,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IACnD,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE;QACpB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,OAAO,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,CAAC,KAAK,EAAE,CAAA;IAChB,CAAC,EAAE,qCAAqC,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["/** dsh-better-ask-user host row: ask_user_question shadow, settings, PTC exemption. */\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { Agent } from '@deepseek-ai/dsh-agent'\nimport { ToolRegistryUnavailableError } from '@deepseek-ai/dsh-tools'\nimport { Config, readConfig as snapshotConfig } from './config.js'\nimport { createBetterAskTool } from './ask-tool.js'\nimport { mountPtcExemption } from './ptc.js'\nimport { mountLegacyMigration, mountSettings } from './settings.js'\n\nexport { Config }\nexport const name = 'dsh-better-ask-user'\nexport const inject = ['agents', 'tools', 'userQuestions']\n\ninterface AgentState {\n agent: Agent\n actor: Context\n askDispose: (() => void) | undefined\n}\n\nexport function apply(ctx: Context, config: unknown = {}) {\n const readConfig = () => snapshotConfig(config)\n mountSettings(ctx)\n mountLegacyMigration(ctx)\n mountPtcExemption(ctx)\n\n const states = new Map<Agent, AgentState>()\n\n function register(state: AgentState) {\n const tools = state.actor.get('tools')!\n let base\n try {\n base = tools.get('ask_user_question', state.agent)\n } catch (error) {\n // alpha.3 reads through the selected tool root. A composition without a\n // root (or before one loads) offers no host tool to shadow.\n if (error instanceof ToolRegistryUnavailableError) return\n throw error\n }\n if (base === undefined) return\n state.askDispose = tools.register(createBetterAskTool(ctx, base, readConfig))\n }\n\n function setup(agent: Agent) {\n if (states.has(agent)) return states.get(agent)\n const state: AgentState = { agent, actor: agent.ctx, askDispose: undefined }\n states.set(agent, state)\n register(state)\n return state\n }\n\n function cleanup(state: AgentState) {\n state.askDispose?.()\n state.askDispose = undefined\n }\n\n ctx.on('agent/created', ({ agent }): undefined => { setup(agent) })\n ctx.on('agent/disposed', ({ agent }) => {\n const state = states.get(agent)\n if (state !== undefined) cleanup(state)\n states.delete(agent)\n })\n for (const agent of ctx.agents.list()) setup(agent)\n ctx.effect(() => () => {\n for (const state of states.values()) cleanup(state)\n states.clear()\n }, 'better-ask-user: per-agent controls')\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-better-ask-user",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9-alpha.1",
|
|
4
4
|
"description": "Independent ask_user_question plugin: configurable wait, input-extended countdown, markdown/mobile card, native or default timeout behavior, and PTC deadline exemption.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": "^24.22.3 || >=26.13.1",
|
|
23
|
-
"dsh": ">=0.2.3-alpha.
|
|
23
|
+
"dsh": ">=0.2.3-alpha.3 <0.3.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc -p tsconfig.build.json && node scripts/build-client.mjs",
|
|
@@ -30,40 +30,40 @@
|
|
|
30
30
|
"prepare": "npm run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@deepseek-ai/schemastery": "~3.20.0-alpha.
|
|
34
|
-
"dsh-better-ptc": "0.2.
|
|
33
|
+
"@deepseek-ai/schemastery": "~3.20.0-alpha.2",
|
|
34
|
+
"dsh-better-ptc": "0.2.4-alpha.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@deepseek-ai/cordis": "~4.2.0-alpha.
|
|
38
|
-
"@deepseek-ai/dsh-agent": ">=0.2.3-alpha.
|
|
39
|
-
"@deepseek-ai/dsh-llm": ">=0.2.3-alpha.
|
|
40
|
-
"@deepseek-ai/dsh-session": ">=0.2.3-alpha.
|
|
41
|
-
"@deepseek-ai/dsh-system-prompt": ">=0.2.3-alpha.
|
|
42
|
-
"@deepseek-ai/dsh-tools": ">=0.2.3-alpha.
|
|
43
|
-
"@deepseek-ai/dsh-user-questions": ">=0.2.3-alpha.
|
|
37
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.2",
|
|
38
|
+
"@deepseek-ai/dsh-agent": ">=0.2.3-alpha.3 <0.3.0",
|
|
39
|
+
"@deepseek-ai/dsh-llm": ">=0.2.3-alpha.3 <0.3.0",
|
|
40
|
+
"@deepseek-ai/dsh-session": ">=0.2.3-alpha.3 <0.3.0",
|
|
41
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.2.3-alpha.3 <0.3.0",
|
|
42
|
+
"@deepseek-ai/dsh-tools": ">=0.2.3-alpha.3 <0.3.0",
|
|
43
|
+
"@deepseek-ai/dsh-user-questions": ">=0.2.3-alpha.3 <0.3.0",
|
|
44
44
|
"react": "^18.2.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@deepseek-ai/cordis": "4.2.0-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-agent": "0.2.3-alpha.
|
|
49
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.
|
|
50
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.3-alpha.
|
|
51
|
-
"@deepseek-ai/dsh-brand": "0.2.3-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-client-locale": "0.2.3-alpha.
|
|
53
|
-
"@deepseek-ai/dsh-client-store": "0.2.3-alpha.
|
|
54
|
-
"@deepseek-ai/dsh-client-ui-chat": "0.2.3-alpha.
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.3-alpha.
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.3-alpha.
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.3-alpha.
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.
|
|
60
|
-
"@deepseek-ai/dsh-client-ui-tool": "0.2.3-alpha.
|
|
61
|
-
"@deepseek-ai/dsh-llm": "0.2.3-alpha.
|
|
62
|
-
"@deepseek-ai/dsh-session": "0.2.3-alpha.
|
|
63
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.
|
|
64
|
-
"@deepseek-ai/dsh-tools": "0.2.3-alpha.
|
|
65
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.3-alpha.
|
|
66
|
-
"@deepseek-ai/dsh-user-questions": "0.2.3-alpha.
|
|
47
|
+
"@deepseek-ai/cordis": "4.2.0-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.3",
|
|
49
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.3",
|
|
50
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.3-alpha.3",
|
|
51
|
+
"@deepseek-ai/dsh-brand": "0.2.3-alpha.3",
|
|
52
|
+
"@deepseek-ai/dsh-client-locale": "0.2.3-alpha.3",
|
|
53
|
+
"@deepseek-ai/dsh-client-store": "0.2.3-alpha.3",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-chat": "0.2.3-alpha.3",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.3-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.3-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.3",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.3-alpha.3",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.3",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-tool": "0.2.3-alpha.3",
|
|
61
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.3",
|
|
62
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.3",
|
|
63
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.3",
|
|
64
|
+
"@deepseek-ai/dsh-tools": "0.2.3-alpha.3",
|
|
65
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.3-alpha.3",
|
|
66
|
+
"@deepseek-ai/dsh-user-questions": "0.2.3-alpha.3",
|
|
67
67
|
"@types/node": "24.19.2",
|
|
68
68
|
"@types/react": "18.3.31",
|
|
69
69
|
"clsx": "^2.1.1",
|