dsh-plugin-dev-kb 1.0.0
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/LICENSE +21 -0
- package/README.md +56 -0
- package/cordis.patch.yml +12 -0
- package/kb/INDEX.md +210 -0
- package/kb/README.md +69 -0
- package/kb/extra/AGENTS.md +75 -0
- package/kb/extra/api-gateway.md +164 -0
- package/kb/extra/api-gateway.zh.md +164 -0
- package/kb/extra/cookbook/adding-a-vendored-package.md +59 -0
- package/kb/extra/cookbook/adding-a-vendored-package.zh.md +59 -0
- package/kb/extra/cookbook/maintaining-dsh-code-review.md +64 -0
- package/kb/extra/cookbook/maintaining-dsh-code-review.zh.md +64 -0
- package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
- package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
- package/kb/extra/defensive-patterns.md +33 -0
- package/kb/extra/defensive-patterns.zh.md +33 -0
- package/kb/extra/development.md +171 -0
- package/kb/extra/development.zh.md +171 -0
- package/kb/extra/event-producer-consumer.md +76 -0
- package/kb/extra/event-producer-consumer.zh.md +78 -0
- package/kb/extra/glossary.md +45 -0
- package/kb/extra/glossary.zh.md +45 -0
- package/kb/extra/graph-atlas.md +24 -0
- package/kb/extra/graph-atlas.zh.md +26 -0
- package/kb/extra/i18n/README.md +60 -0
- package/kb/extra/i18n/README.zh.md +60 -0
- package/kb/extra/i18n/style-samples.md +87 -0
- package/kb/extra/i18n/terminology.md +214 -0
- package/kb/extra/i18n/translation-prompt.md +263 -0
- package/kb/extra/i18n/translation-rules.md +69 -0
- package/kb/extra/i18n/translation-rules.zh.md +69 -0
- package/kb/extra/module-graph.md +1641 -0
- package/kb/extra/module-graph.zh.md +1643 -0
- package/kb/extra/postmortem/0001-acp-default-export-drops-inject.md +113 -0
- package/kb/extra/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
- package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
- package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
- package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
- package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
- package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
- package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
- package/kb/extra/postmortem/README.md +18 -0
- package/kb/extra/postmortem/README.zh.md +18 -0
- package/kb/extra/rescope.md +53 -0
- package/kb/extra/rescope.zh.md +53 -0
- package/kb/extra/subsystems/attachment.md +125 -0
- package/kb/extra/subsystems/attachment.zh.md +125 -0
- package/kb/extra/subsystems/extensions.md +364 -0
- package/kb/extra/subsystems/extensions.zh.md +364 -0
- package/kb/extra/subsystems/feedback.md +266 -0
- package/kb/extra/subsystems/feedback.zh.md +266 -0
- package/kb/extra/testing.md +49 -0
- package/kb/extra/testing.zh.md +49 -0
- package/kb/extra/web-styling.md +25 -0
- package/kb/extra/web-styling.zh.md +25 -0
- package/kb/meta/search-index.json +1328 -0
- package/kb/meta/site-pages.txt +168 -0
- package/kb/meta/source.json +13 -0
- package/kb/meta/topics.md +75 -0
- package/kb/site/develop/basic/config.md +108 -0
- package/kb/site/develop/basic/index.md +146 -0
- package/kb/site/develop/basic/publish.md +185 -0
- package/kb/site/develop/basic/tool.md +54 -0
- package/kb/site/develop/cordis-tutorial/01-first-plugin.md +95 -0
- package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/kb/site/develop/cordis-tutorial/03-services.md +98 -0
- package/kb/site/develop/cordis-tutorial/04-events.md +144 -0
- package/kb/site/develop/cordis-tutorial/05-config.md +84 -0
- package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +107 -0
- package/kb/site/develop/cordis-tutorial/index.md +62 -0
- package/kb/site/develop/framework/events.md +145 -0
- package/kb/site/develop/framework/index.md +139 -0
- package/kb/site/develop/framework/service.md +152 -0
- package/kb/site/develop/practice/index.md +157 -0
- package/kb/site/develop/practice/llm-adapter.md +190 -0
- package/kb/site/en/develop/basic/config.md +108 -0
- package/kb/site/en/develop/basic/index.md +146 -0
- package/kb/site/en/develop/basic/publish.md +185 -0
- package/kb/site/en/develop/basic/tool.md +54 -0
- package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +95 -0
- package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/kb/site/en/develop/cordis-tutorial/03-services.md +98 -0
- package/kb/site/en/develop/cordis-tutorial/04-events.md +144 -0
- package/kb/site/en/develop/cordis-tutorial/05-config.md +84 -0
- package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +107 -0
- package/kb/site/en/develop/cordis-tutorial/index.md +60 -0
- package/kb/site/en/develop/framework/events.md +145 -0
- package/kb/site/en/develop/framework/index.md +139 -0
- package/kb/site/en/develop/framework/service.md +150 -0
- package/kb/site/en/develop/practice/index.md +157 -0
- package/kb/site/en/develop/practice/llm-adapter.md +190 -0
- package/kb/site/en/guide/providers-custom-form.png +0 -0
- package/kb/site/en/guide/providers-models-page.png +0 -0
- package/kb/site/en/guide/providers.md +100 -0
- package/kb/site/en/guide/python-sdk.md +106 -0
- package/kb/site/en/guide/quickstart.md +32 -0
- package/kb/site/en/index.md +8 -0
- package/kb/site/en/reference/agent-lifecycle.md +86 -0
- package/kb/site/en/reference/capability-seams.md +475 -0
- package/kb/site/en/reference/config-catalog.md +3155 -0
- package/kb/site/en/reference/cookbook/adding-a-conversation-node.md +235 -0
- package/kb/site/en/reference/cookbook/adding-a-package.md +120 -0
- package/kb/site/en/reference/cookbook/adding-a-settings-card.md +102 -0
- package/kb/site/en/reference/cookbook/adding-a-tool.md +96 -0
- package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +45 -0
- package/kb/site/en/reference/cookbook/extension-cookbook.md +131 -0
- package/kb/site/en/reference/cordis-api/context.md +368 -0
- package/kb/site/en/reference/cordis-api/events.md +211 -0
- package/kb/site/en/reference/cordis-api/fiber.md +379 -0
- package/kb/site/en/reference/cordis-api/inherited.md +43 -0
- package/kb/site/en/reference/cordis-api/registry.md +156 -0
- package/kb/site/en/reference/cordis-api/service.md +106 -0
- package/kb/site/en/reference/cordis-primer.md +46 -0
- package/kb/site/en/reference/index.md +131 -0
- package/kb/site/en/reference/persistence-catalog.md +949 -0
- package/kb/site/en/reference/subsystems/approval.md +173 -0
- package/kb/site/en/reference/subsystems/client-modules.md +121 -0
- package/kb/site/en/reference/subsystems/code-runtime.md +194 -0
- package/kb/site/en/reference/subsystems/commands.md +190 -0
- package/kb/site/en/reference/subsystems/compaction.md +241 -0
- package/kb/site/en/reference/subsystems/core.md +1073 -0
- package/kb/site/en/reference/subsystems/credentials.md +136 -0
- package/kb/site/en/reference/subsystems/filesystem.md +498 -0
- package/kb/site/en/reference/subsystems/goal.md +280 -0
- package/kb/site/en/reference/subsystems/index.md +58 -0
- package/kb/site/en/reference/subsystems/invariants.md +91 -0
- package/kb/site/en/reference/subsystems/jobs.md +293 -0
- package/kb/site/en/reference/subsystems/llm-streaming.md +920 -0
- package/kb/site/en/reference/subsystems/lsp.md +205 -0
- package/kb/site/en/reference/subsystems/permission-presets.md +134 -0
- package/kb/site/en/reference/subsystems/persistence.md +388 -0
- package/kb/site/en/reference/subsystems/plan.md +90 -0
- package/kb/site/en/reference/subsystems/sandbox.md +221 -0
- package/kb/site/en/reference/subsystems/schedule.md +189 -0
- package/kb/site/en/reference/subsystems/scope.md +62 -0
- package/kb/site/en/reference/subsystems/session-projection.md +265 -0
- package/kb/site/en/reference/subsystems/session-query.md +498 -0
- package/kb/site/en/reference/subsystems/session-reference.md +111 -0
- package/kb/site/en/reference/subsystems/session-telemetry.md +197 -0
- package/kb/site/en/reference/subsystems/session-title.md +207 -0
- package/kb/site/en/reference/subsystems/session.md +852 -0
- package/kb/site/en/reference/subsystems/settings.md +313 -0
- package/kb/site/en/reference/subsystems/shell.md +306 -0
- package/kb/site/en/reference/subsystems/skills.md +334 -0
- package/kb/site/en/reference/subsystems/spill.md +120 -0
- package/kb/site/en/reference/subsystems/storage.md +232 -0
- package/kb/site/en/reference/subsystems/subagent.md +737 -0
- package/kb/site/en/reference/subsystems/subprocess.md +327 -0
- package/kb/site/en/reference/subsystems/system-prompt.md +210 -0
- package/kb/site/en/reference/subsystems/terminal.md +187 -0
- package/kb/site/en/reference/subsystems/token-meter.md +93 -0
- package/kb/site/en/reference/subsystems/tools.md +723 -0
- package/kb/site/en/reference/subsystems/typert.md +339 -0
- package/kb/site/en/reference/subsystems/user-questions.md +181 -0
- package/kb/site/en/reference/subsystems/web-server.md +111 -0
- package/kb/site/en/reference/subsystems/web.md +202 -0
- package/kb/site/en/reference/subsystems/workflow.md +281 -0
- package/kb/site/en/reference/subsystems/workspace.md +231 -0
- package/kb/site/en/reference/tool-catalog.md +1877 -0
- package/kb/site/en/reference/tool-execution-pipeline.md +66 -0
- package/kb/site/guide/providers-custom-form.zh.png +0 -0
- package/kb/site/guide/providers-models-page.zh.png +0 -0
- package/kb/site/guide/providers.md +100 -0
- package/kb/site/guide/python-sdk.md +106 -0
- package/kb/site/guide/quickstart.md +32 -0
- package/kb/site/index.md +8 -0
- package/kb/site/reference/agent-lifecycle.md +86 -0
- package/kb/site/reference/capability-seams.md +475 -0
- package/kb/site/reference/config-catalog.md +3154 -0
- package/kb/site/reference/cookbook/adding-a-conversation-node.md +235 -0
- package/kb/site/reference/cookbook/adding-a-package.md +120 -0
- package/kb/site/reference/cookbook/adding-a-settings-card.md +102 -0
- package/kb/site/reference/cookbook/adding-a-tool.md +98 -0
- package/kb/site/reference/cookbook/adding-an-llm-adapter.md +45 -0
- package/kb/site/reference/cookbook/extension-cookbook.md +133 -0
- package/kb/site/reference/cordis-api/context.md +368 -0
- package/kb/site/reference/cordis-api/events.md +211 -0
- package/kb/site/reference/cordis-api/fiber.md +379 -0
- package/kb/site/reference/cordis-api/inherited.md +43 -0
- package/kb/site/reference/cordis-api/registry.md +156 -0
- package/kb/site/reference/cordis-api/service.md +106 -0
- package/kb/site/reference/cordis-primer.md +52 -0
- package/kb/site/reference/index.md +135 -0
- package/kb/site/reference/persistence-catalog.md +949 -0
- package/kb/site/reference/subsystems/approval.md +173 -0
- package/kb/site/reference/subsystems/client-modules.md +121 -0
- package/kb/site/reference/subsystems/code-runtime.md +194 -0
- package/kb/site/reference/subsystems/commands.md +190 -0
- package/kb/site/reference/subsystems/compaction.md +241 -0
- package/kb/site/reference/subsystems/core.md +1081 -0
- package/kb/site/reference/subsystems/credentials.md +136 -0
- package/kb/site/reference/subsystems/filesystem.md +498 -0
- package/kb/site/reference/subsystems/goal.md +280 -0
- package/kb/site/reference/subsystems/index.md +58 -0
- package/kb/site/reference/subsystems/invariants.md +91 -0
- package/kb/site/reference/subsystems/jobs.md +293 -0
- package/kb/site/reference/subsystems/llm-streaming.md +926 -0
- package/kb/site/reference/subsystems/lsp.md +205 -0
- package/kb/site/reference/subsystems/permission-presets.md +134 -0
- package/kb/site/reference/subsystems/persistence.md +388 -0
- package/kb/site/reference/subsystems/plan.md +90 -0
- package/kb/site/reference/subsystems/sandbox.md +221 -0
- package/kb/site/reference/subsystems/schedule.md +189 -0
- package/kb/site/reference/subsystems/scope.md +62 -0
- package/kb/site/reference/subsystems/session-projection.md +265 -0
- package/kb/site/reference/subsystems/session-query.md +498 -0
- package/kb/site/reference/subsystems/session-reference.md +111 -0
- package/kb/site/reference/subsystems/session-telemetry.md +197 -0
- package/kb/site/reference/subsystems/session-title.md +207 -0
- package/kb/site/reference/subsystems/session.md +854 -0
- package/kb/site/reference/subsystems/settings.md +313 -0
- package/kb/site/reference/subsystems/shell.md +306 -0
- package/kb/site/reference/subsystems/skills.md +334 -0
- package/kb/site/reference/subsystems/spill.md +120 -0
- package/kb/site/reference/subsystems/storage.md +232 -0
- package/kb/site/reference/subsystems/subagent.md +739 -0
- package/kb/site/reference/subsystems/subprocess.md +327 -0
- package/kb/site/reference/subsystems/system-prompt.md +210 -0
- package/kb/site/reference/subsystems/terminal.md +187 -0
- package/kb/site/reference/subsystems/token-meter.md +93 -0
- package/kb/site/reference/subsystems/tools.md +723 -0
- package/kb/site/reference/subsystems/typert.md +339 -0
- package/kb/site/reference/subsystems/user-questions.md +181 -0
- package/kb/site/reference/subsystems/web-server.md +111 -0
- package/kb/site/reference/subsystems/web.md +202 -0
- package/kb/site/reference/subsystems/workflow.md +281 -0
- package/kb/site/reference/subsystems/workspace.md +231 -0
- package/kb/site/reference/tool-catalog.md +1880 -0
- package/kb/site/reference/tool-execution-pipeline.md +66 -0
- package/package.json +40 -0
- package/scripts/rebuild-index.mjs +88 -0
- package/skills/dsh-plugin-dev-kb.md +66 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/cordis-api/registry.zh.md"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<!-- 英文源文件由 scripts/gen-cordis-catalog.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
|
|
6
|
+
更新时先运行 `pnpm run gen-cordis-catalog` 更新英文,再更新本文件并运行 `pnpm run verify-translation-pairing --write docs/cordis-api/registry.md` 重新记录配对。 -->
|
|
7
|
+
|
|
8
|
+
# 注册表
|
|
9
|
+
|
|
10
|
+
插件加载与依赖注入。
|
|
11
|
+
|
|
12
|
+
### ctx.inject(deps, callback)
|
|
13
|
+
|
|
14
|
+
```ts cordis-catalog
|
|
15
|
+
/**
|
|
16
|
+
* Run a callback once the requested services are available.
|
|
17
|
+
*
|
|
18
|
+
* Shorthand for `ctx.plugin({ inject, apply: callback })`: the callback
|
|
19
|
+
* is unloaded and re-run whenever a required service changes.
|
|
20
|
+
*
|
|
21
|
+
* @param deps — required services, as an array or a name → config map.
|
|
22
|
+
* @param callback — plugin body called with `(ctx, config)`.
|
|
23
|
+
* @returns the fiber; awaiting it settles once loading finished.
|
|
24
|
+
*/
|
|
25
|
+
inject(deps: Inject, callback: Plugin.Function<void>): Fiber & PromiseLike<Fiber>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
请求的服务可用后,运行回调。
|
|
29
|
+
|
|
30
|
+
这是 `ctx.plugin({ inject, apply: callback })` 的简写形式:每当某个必需服务发生变化时,系统都会卸载并重新运行该回调。
|
|
31
|
+
|
|
32
|
+
- `deps`:必需服务,形式可以是数组,也可以是从名称到配置的映射。
|
|
33
|
+
- `callback`:以 `(ctx, config)` 调用的插件主体。
|
|
34
|
+
|
|
35
|
+
**返回** fiber;对其执行 await 会在加载完成后结束等待。
|
|
36
|
+
|
|
37
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/registry.ts#L176)
|
|
38
|
+
|
|
39
|
+
### ctx.plugin(plugin, ...args)
|
|
40
|
+
|
|
41
|
+
```ts cordis-catalog
|
|
42
|
+
/**
|
|
43
|
+
* Load a plugin in the current context.
|
|
44
|
+
*
|
|
45
|
+
* @param plugin — a function, class, or `{ apply }` object plugin.
|
|
46
|
+
* @param args — the plugin config, validated against its `Config` schema.
|
|
47
|
+
* @returns the fiber; awaiting it settles once loading finished
|
|
48
|
+
* (rejecting on config or startup errors).
|
|
49
|
+
*/
|
|
50
|
+
plugin<P extends Plugin>(plugin: P, ...args: Spread<GetPluginConfig<P>>): Fiber & PromiseLike<Fiber>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
在当前上下文中加载插件。
|
|
54
|
+
|
|
55
|
+
- `plugin`:函数、类或 `{ apply }` 对象形式的插件。
|
|
56
|
+
- `args`:插件配置,会根据其 `Config` schema 进行校验。
|
|
57
|
+
|
|
58
|
+
**返回** fiber;对其执行 await 会在加载完成后结束等待(如果发生配置错误或启动错误,则会被拒绝)。
|
|
59
|
+
|
|
60
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/registry.ts#L185)
|
|
61
|
+
|
|
62
|
+
## Plugin
|
|
63
|
+
|
|
64
|
+
支持的插件入口点形式。
|
|
65
|
+
|
|
66
|
+
```ts cordis-catalog
|
|
67
|
+
/** Supported plugin entrypoint shapes. */
|
|
68
|
+
type Plugin<T = any> =
|
|
69
|
+
| Plugin.Function<T>
|
|
70
|
+
| Plugin.Constructor<T>
|
|
71
|
+
| Plugin.Object<T>
|
|
72
|
+
|
|
73
|
+
/** Types associated with plugin entrypoints and runtime records. */
|
|
74
|
+
namespace Plugin {
|
|
75
|
+
/** Shared metadata understood by the plugin registry and related tooling. */
|
|
76
|
+
export interface Base<T = any> {
|
|
77
|
+
/** Display name used for fiber diagnostics and logger names. */
|
|
78
|
+
name?: string
|
|
79
|
+
/** Standard-schema validator applied to config before the plugin starts. */
|
|
80
|
+
Config?: StandardSchemaV1<any, T>
|
|
81
|
+
/** Services the plugin requires; it only loads while all are available. */
|
|
82
|
+
inject?: Inject
|
|
83
|
+
/** Service name(s) the plugin provides (read by `Service` and by loaders). */
|
|
84
|
+
provide?: string | string[]
|
|
85
|
+
/** Service names whose intercept config the plugin declares it consumes. */
|
|
86
|
+
intercept?: Dict<boolean>
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Transform<S, T> {
|
|
90
|
+
/** Marks the transform object as a schema/config transform. */
|
|
91
|
+
schema?: true
|
|
92
|
+
/** Convert user-facing config to runtime config. */
|
|
93
|
+
Config: (config: S) => T
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Function plugin called with `(ctx, config)`. */
|
|
97
|
+
export interface Function<T = any> extends Base<T> {
|
|
98
|
+
(ctx: Context, config: T): any
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Class plugin constructed with `(ctx, config)`. */
|
|
102
|
+
export interface Constructor<T = any> extends Base<T> {
|
|
103
|
+
new (ctx: Context, config: T): any
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Object plugin with an `apply(ctx, config)` method. */
|
|
107
|
+
export interface Object<T = any> extends Base<T> {
|
|
108
|
+
apply(ctx: Context, config: T): any
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Mutable registry record shared by all fibers of one plugin callback. */
|
|
112
|
+
export interface Runtime {
|
|
113
|
+
/** Display name copied from the first registered plugin shape. */
|
|
114
|
+
name?: string
|
|
115
|
+
/** Every live fiber of this plugin (one per `ctx.plugin()` call). */
|
|
116
|
+
fibers: DisposableList<Fiber>
|
|
117
|
+
/** The executable entrypoint all fibers share (registry identity key). */
|
|
118
|
+
callback: globalThis.Function
|
|
119
|
+
/** Standard-schema validator applied to each fiber's config. */
|
|
120
|
+
Config?: StandardSchemaV1
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/registry.ts#L92)
|
|
126
|
+
|
|
127
|
+
## Inject
|
|
128
|
+
|
|
129
|
+
插件和 `@Inject` 装饰器接受的服务依赖声明。
|
|
130
|
+
|
|
131
|
+
数组形式请求不带拦截配置的服务。对象形式将每个服务名称映射到插件上下文中可选的拦截配置。
|
|
132
|
+
|
|
133
|
+
```ts cordis-catalog
|
|
134
|
+
/**
|
|
135
|
+
* Service dependency declaration accepted by plugins and the `@Inject`
|
|
136
|
+
* decorator.
|
|
137
|
+
*
|
|
138
|
+
* Array form requests services without intercept config. Object form maps each
|
|
139
|
+
* service name to optional intercept config for the plugin context.
|
|
140
|
+
*/
|
|
141
|
+
type Inject<M = Dict> = (keyof M)[] | { [K in keyof M]?: M[K] }
|
|
142
|
+
|
|
143
|
+
/** Utilities for normalizing plugin dependency declarations. */
|
|
144
|
+
namespace Inject {
|
|
145
|
+
/**
|
|
146
|
+
* Convert array/object/class-inherited inject metadata into a plain map.
|
|
147
|
+
*
|
|
148
|
+
* @param inject — the declaration to normalize; `null`/`undefined` add nothing.
|
|
149
|
+
* @param result — the map to fill (service name → intercept config or `null`).
|
|
150
|
+
* @returns `result`.
|
|
151
|
+
*/
|
|
152
|
+
export function resolve(inject: Inject | null | undefined, result: Dict = Object.create(null))
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/registry.ts#L19)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/cordis-api/service.zh.md"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<!-- 英文源文件由 scripts/gen-cordis-catalog.ts 生成;本中文文件是通过双语配对维护的经评审对侧。
|
|
6
|
+
更新时先运行 `pnpm run gen-cordis-catalog` 更新英文,再更新本文件并运行 `pnpm run verify-translation-pairing --write docs/cordis-api/service.md` 重新记录配对。 -->
|
|
7
|
+
|
|
8
|
+
# Service
|
|
9
|
+
|
|
10
|
+
上下文服务的基类。以插件形式加载的子类会将自身注册为 `ctx.<name>`。
|
|
11
|
+
|
|
12
|
+
用于在 `ctx` 上公开具名 API 的服务基类。
|
|
13
|
+
|
|
14
|
+
子类在构造函数中调用 `super(ctx, name)`。服务会立即注册,并随所属 fiber 自动移除。
|
|
15
|
+
|
|
16
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L11)
|
|
17
|
+
|
|
18
|
+
### service.name
|
|
19
|
+
|
|
20
|
+
```ts cordis-catalog
|
|
21
|
+
/** The service name this instance is registered under. */
|
|
22
|
+
public name!: string
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
此实例注册时使用的服务名称。
|
|
26
|
+
|
|
27
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L30)
|
|
28
|
+
|
|
29
|
+
## 静态成员
|
|
30
|
+
|
|
31
|
+
### Service.init
|
|
32
|
+
|
|
33
|
+
```ts cordis-catalog
|
|
34
|
+
/** Symbol key of an instance method run after construction (class plugins). */
|
|
35
|
+
static readonly init: unique symbol
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
构造完成后运行的实例方法所使用的符号键(类插件)。
|
|
39
|
+
|
|
40
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L13)
|
|
41
|
+
|
|
42
|
+
### Service.check
|
|
43
|
+
|
|
44
|
+
```ts cordis-catalog
|
|
45
|
+
/** Symbol key of the availability predicate passed to `ctx.provide()`. */
|
|
46
|
+
static readonly check: unique symbol
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
传给 `ctx.provide()` 的可用性谓词所使用的符号键。
|
|
50
|
+
|
|
51
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L15)
|
|
52
|
+
|
|
53
|
+
### Service.config
|
|
54
|
+
|
|
55
|
+
```ts cordis-catalog
|
|
56
|
+
/** Symbol key of the phantom intercept-config type parameter. */
|
|
57
|
+
static readonly config: unique symbol
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
虚设拦截配置类型参数所使用的符号键。
|
|
61
|
+
|
|
62
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L17)
|
|
63
|
+
|
|
64
|
+
### Service.invoke
|
|
65
|
+
|
|
66
|
+
```ts cordis-catalog
|
|
67
|
+
/** Symbol key of the call body making a service callable (e.g. `ctx.logger()`). */
|
|
68
|
+
static readonly invoke: unique symbol
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
使服务可被调用的调用体所使用的符号键(例如 `ctx.logger()`)。
|
|
72
|
+
|
|
73
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L19)
|
|
74
|
+
|
|
75
|
+
### Service.extend
|
|
76
|
+
|
|
77
|
+
```ts cordis-catalog
|
|
78
|
+
/** Symbol key of the helper deriving an extended service instance. */
|
|
79
|
+
static readonly extend: unique symbol
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
用于派生扩展服务实例的辅助方法所使用的符号键。
|
|
83
|
+
|
|
84
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L21)
|
|
85
|
+
|
|
86
|
+
### Service.tracker
|
|
87
|
+
|
|
88
|
+
```ts cordis-catalog
|
|
89
|
+
/** Symbol key of the tracker metadata used for context tracing. */
|
|
90
|
+
static readonly tracker: unique symbol
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
上下文追踪所用跟踪器元数据的符号键。
|
|
94
|
+
|
|
95
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L23)
|
|
96
|
+
|
|
97
|
+
### Service.resolveConfig
|
|
98
|
+
|
|
99
|
+
```ts cordis-catalog
|
|
100
|
+
/** Symbol key of the intercept-config resolution helper below. */
|
|
101
|
+
static readonly resolveConfig: unique symbol
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
下述拦截配置解析辅助方法所使用的符号键。
|
|
105
|
+
|
|
106
|
+
[源码](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/cordis/src/service.ts#L25)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/cordis-primer.zh.md"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Cordis 入门
|
|
6
|
+
|
|
7
|
+
Cordis 是 DeepSeek Harness 底层以 vendor 方式引入的插件框架。本文介绍 harness 插件作者在阅读[子系统页面](./subsystems/core.md)上生成的服务/事件参考之前需要了解的 Cordis 核心概念;[Cordis 教程](../develop/cordis-tutorial/index.md)则通过实践逐一讲解这些概念。vendor 源码与同步流程见 [vendor/README.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/vendor/README.md)。
|
|
8
|
+
|
|
9
|
+
## 五个核心概念
|
|
10
|
+
|
|
11
|
+
- **插件是实现 Service 的对象。** 它可以是一个带有可选 `inject` 和 `apply(ctx)` 字段的函数,也可以是一个 `Service` 子类,其生命周期由 Cordis 挂载到当前上下文中。
|
|
12
|
+
- **上下文是服务的容器。** 一个服务占据一个稳定的 `ctx.<key>`(如 `ctx.tools`、`ctx.llm`、`ctx.sessions`);其他插件通过 key 查找服务,而非导入具体实现。
|
|
13
|
+
- **通过 `inject` 声明服务依赖。** 插件声明所需的服务后,会等待这些服务就绪才启动;加载顺序通过服务依赖表达,而非手动编排启动序列。
|
|
14
|
+
- **类型化事件用于通信。** 服务通过 TypeScript 声明合并注册事件名,然后以 `emit`、`waterfall`(瀑布式事件)、`parallel` 或 `serial` 方式分发,分别对应监听者观察、包装、并行扇出或按序执行。
|
|
15
|
+
- **注册是可逆的副作用。** 提示词片段、工具 schema、适配器、提供方和监听器通过 `ctx.effect()` 或 `ctx.on()` 安装,reload 和 teardown 时会按预期撤销。
|
|
16
|
+
|
|
17
|
+
<a id="dispatch-modes"></a>
|
|
18
|
+
|
|
19
|
+
## 分发模式
|
|
20
|
+
|
|
21
|
+
每个事件具有以下分发模式之一,且只能通过对应方法分发。
|
|
22
|
+
|
|
23
|
+
| 模式 | 是否 await? | 分发顺序 | 是否有返回值? |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| `emit` | 否 | 监听器按注册顺序观察 | 否 |
|
|
26
|
+
| `waterfall` | 否 | 监听器按注册顺序观察 | 是 |
|
|
27
|
+
| `parallel` | 是 | 所有监听器并行观察事件 | 否 |
|
|
28
|
+
| `serial` | 是 | 监听器按注册顺序观察 | 是 |
|
|
29
|
+
|
|
30
|
+
分发模式是事件公开约定的一部分。新的 harness 事件通过 `@mode` 标签记录模式,以便生成的目录可以将声明与分发调用点做交叉校验。
|
|
31
|
+
|
|
32
|
+
<a id="cordis-waterfall-semantics"></a>
|
|
33
|
+
|
|
34
|
+
## Cordis Waterfall 语义
|
|
35
|
+
|
|
36
|
+
`ctx.waterfall` 是环绕中间件。监听器接收 `(...args, next)`。调用 `next()` 会执行下游监听器;下游返回值通过 `next()` 返回当前包装层,可由该层包装后继续向外返回。不调用 `next()` 直接返回则短路。
|
|
37
|
+
|
|
38
|
+
协作式监听器通常修改一个共享的请求或决策对象,然后委托。监听器也可以选择完全替换结果,下游监听器将只看到替换后的结果。仅当监听器必须在普通注册之前运行时才使用 `prepend: true`。
|
|
39
|
+
|
|
40
|
+
对于单决策事件,短路是设计意图。策略监听器在拥有决策权时可以不调用 `next()` 直接返回,而仅做标注或观察的监听器则必须委托。
|
|
41
|
+
|
|
42
|
+
<a id="loader-configuration"></a>
|
|
43
|
+
|
|
44
|
+
## Loader 配置
|
|
45
|
+
|
|
46
|
+
`@deepseek-ai/cordis-plugin-include` 将 `!!js` 解析为表达式节点。Loader 在声明的注入激活后,基于该插件上下文(`ctx.serviceName`)插值条目的 `config`,并在每次挂载决策时基于 loader 上下文插值其 `disabled` 字段;Include 会保留嵌套行表达式,直到目标行激活。其余条目元数据保持字面值。由环境选择插件时,请使用 overlay。
|
|
47
|
+
|
|
48
|
+
## 实践规则
|
|
49
|
+
|
|
50
|
+
将行为封装为插件:工具流水线事件属于 `ctx.tools`,模型流式输出属于 `ctx.llm`,实时 agent(智能体)协调属于 `ctx.agents`。拦截和策略优先使用事件;直接能力调用优先使用服务方法。
|
|
51
|
+
|
|
52
|
+
每个注册都应有对应的 disposer(资源释放函数):要么从 `ctx.effect()` 返回一个,要么使用 Cordis 提供的辅助方法自动处理。如果 teardown 顺序有要求,请将相关工作放在同一个 effect 中,以确保资源按预期顺序释放。
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/architecture.zh.md"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# DeepSeek Harness 架构
|
|
6
|
+
|
|
7
|
+
改动 `packages/` 下的任何内容之前,请先阅读本文。本文假定你已了解 Cordis;如果尚未了解,请先阅读[入门](./cordis-primer.md)或[教程](../develop/cordis-tutorial/index.md)。
|
|
8
|
+
|
|
9
|
+
建议使用 agent(智能体)探索代码库并理解其架构。
|
|
10
|
+
|
|
11
|
+
## Cordis
|
|
12
|
+
|
|
13
|
+
[Cordis](./cordis-primer.md) 是 dsh 底层的框架:插件向共享上下文贡献服务、类型化事件和可逆的副作用。产品的每一部分都是插件,包括模型适配器、工具注册表、会话日志,以及 agent loop(智能体循环)本身,因此每一部分都可以从配置替换。
|
|
14
|
+
|
|
15
|
+
不存在需要打补丁的特权内核:扩展 dsh 的方式是把插件挂载到其他插件旁边,而各项注册都是副作用,会在其插件卸载时撤销。
|
|
16
|
+
|
|
17
|
+
## Profile 与组合包
|
|
18
|
+
|
|
19
|
+
运行中的 `dsh` 是一棵插件树,由启动时按序叠加的各层组合而成。
|
|
20
|
+
|
|
21
|
+
**profile** 是存放在 Harness home 中的具名组装。它列出自己叠放的组合包,存放自己安装的树外插件,并保存用户自己的 `cordis.patch.yml`。`web` 和 `headless` 作为模板随发行版交付。
|
|
22
|
+
|
|
23
|
+
**组合包**是 Cordis 配置项及其挂载代码的分发格式,因此它插入的内容始终可被其上各层 patch。
|
|
24
|
+
|
|
25
|
+
两者都在各自的 `package.json` 中通过 `dsh` 字段声明自己:`dsh.profile` 列出一个 profile 的组合包,`dsh.bundle` 指向一个组合包的 patch 文件。
|
|
26
|
+
|
|
27
|
+
[`dsh-base`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/bundle/base/README.md) 是每个 profile 的第一层:模型适配器、工具、持久化、沙箱与审批策略、设置、凭据、遥测。[`dsh-web-app`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/bundle/web-app/README.md) 增加浏览器应用;[`dsh-headless`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/bundle/headless/README.md) 增加一次性运行器,且完全不带服务器。
|
|
28
|
+
|
|
29
|
+
各层按此顺序应用在空条目列表之上:先按 profile 列出的顺序应用每个组合包,然后是 profile 的 `cordis.patch.yml`,然后是 home 级的那份,最后是任意 `--patch` overlay。一条 patch 按 id 定位某个条目并替换其整个 config,或插入新条目。
|
|
30
|
+
|
|
31
|
+
要查看你的机器实际启动的配置树:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
dsh --profile web --dump-config
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
它打印出的任何条目,都可以由你自己的 patch 替换。
|
|
38
|
+
|
|
39
|
+
组装机制见 [app-boot](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/boot/app-boot/README.md#profiles);配置字段见生成的[配置目录](./config-catalog.md)。
|
|
40
|
+
|
|
41
|
+
## 核心包
|
|
42
|
+
|
|
43
|
+
以下是向 Cordis 树贡献内容的部分核心包。
|
|
44
|
+
|
|
45
|
+
| 包 | 职责 | `ctx` 键 |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| [`core/session`](./subsystems/session.md) | 仅追加的 `SessionEvent` 日志和内存存储 | `ctx.sessions` |
|
|
48
|
+
| [`core/system-prompt`](./subsystems/system-prompt.md) | 提示词片段与工具 schema 的组装 | `ctx.systemPrompt` |
|
|
49
|
+
| [`core/tools`](./subsystems/tools.md) | 作用域化的工具注册表和带把关的执行流水线 | `ctx.tools` |
|
|
50
|
+
| [`core/agent`](./subsystems/core.md) | `Agent` 接口、活跃 agent 注册表和 `agent/*` 事件 | `ctx.agents` |
|
|
51
|
+
| [`core/agent-loop`](./subsystems/core.md) | 实现该接口的默认驱动器 | `ctx.agentLoop` |
|
|
52
|
+
| [`core/scope`](./subsystems/scope.md) | 按 agent 划分作用域的注册原语 | 库,无 ctx 键 |
|
|
53
|
+
| [`llm/llm`](./subsystems/llm-streaming.md) | 消息与流式词汇表,以及适配器 seam | `ctx.llm` |
|
|
54
|
+
|
|
55
|
+
<a id="events"></a>
|
|
56
|
+
|
|
57
|
+
## 事件
|
|
58
|
+
|
|
59
|
+
事件就是扩展点,而选对事件域是大多数改动的第一个决定。
|
|
60
|
+
|
|
61
|
+
- **会话事件**是追加到日志并通过 `session/event` 广播的持久事实。当某个事实必须在重新加载后仍然存在时,使用它。
|
|
62
|
+
- **Agent 事件**(`agent/*`)携带活跃 `Agent`:inbox、步骤、状态、请求、验证、续跑。要观察或拦截进行中的工作时,使用它。
|
|
63
|
+
- **能力事件**无需导入循环即可向某个 seam(`fs/*`、`tools/*`、`telemetry/*`)附加策略和适配器。
|
|
64
|
+
|
|
65
|
+
[事件映射](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/event-producer-consumer.md)列出每个事件的生产方与消费方。
|
|
66
|
+
|
|
67
|
+
<a id="turn-flow"></a>
|
|
68
|
+
|
|
69
|
+
## 轮次流程
|
|
70
|
+
|
|
71
|
+
一个**步骤**是一次模型请求加上它调用的工具。一个**轮次**包含零个或多个步骤:它在领取首条输入之前打开,并在不再欠下任何工作时关闭。
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
turn/start
|
|
75
|
+
claim next-step input plus one queued message
|
|
76
|
+
assemble prompt sections + tool schemas
|
|
77
|
+
-> agent/pre-step reject | enter(messages)
|
|
78
|
+
reject, or a first enter rewritten empty -> close the turn with no step
|
|
79
|
+
step/start
|
|
80
|
+
append entered messages as user/message
|
|
81
|
+
derive model history from the log
|
|
82
|
+
agent/request -> llm/stream -> assistant/chunk* -> assistant/message
|
|
83
|
+
tool/call* -> tools/pre-execute -> tools/execute -> tools/post-execute -> tool/result*
|
|
84
|
+
step/end
|
|
85
|
+
tools owe another request, or next-step input arrived -> claim -> next step
|
|
86
|
+
-> agent/turn-stopping
|
|
87
|
+
turn/end
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`turn/*`、`step/*`、`user/message`、`assistant/*` 和 `tool/*` 是持久会话事件;其余是分属三个事件域的实时扩展点。`agent/pre-step`、`agent/request`、`llm/stream` 和三个 `tools/*` 事件是 waterfall(瀑布式事件),其监听器必须调用 `next()` 才能委托下去;`agent/turn-stopping` 是 serial 事件,没有 `next()`。
|
|
91
|
+
|
|
92
|
+
输入通过同一个 inbox 到达驱动器。有些消息会立即唤醒它;注入的上下文会留在 inbox 中,直到另一条消息将其唤醒。
|
|
93
|
+
|
|
94
|
+
`agent/pre-step` 决定模型看到什么。监听器可以改写已领取的消息,也可以直接拒绝它们;首次领取被拒绝或被改写为空时,仍会关闭一个不含步骤的持久轮次,因此日志会记录这次尝试。每个步骤读取插件注册的提示词片段和工具 schema。
|
|
95
|
+
|
|
96
|
+
详情见[时序图](./agent-lifecycle.md)、[工具流水线](./tool-execution-pipeline.md)和[取消与错误恢复](./subsystems/core.md#the-agent-handle)。
|
|
97
|
+
|
|
98
|
+
## 会话日志
|
|
99
|
+
|
|
100
|
+
会话日志是模型所见上下文的来源。`deriveMessages()` 从中投影出模型历史,原始 `assistant/chunk` 事件则保证回放和 UI 保真。fork、恢复、transcript(文本记录)、遥测和持久化都派生自该事件流。
|
|
101
|
+
|
|
102
|
+
**模型可见即已记录。** 抵达模型请求的一切都必须能从日志重建,并由一项运行时不变量断言这一点。因此,新增一项模型可见输入就需要新增一个会话事件:扩展 `SessionEventMap` 并从日志渲染。
|
|
103
|
+
|
|
104
|
+
## 能力 seam
|
|
105
|
+
|
|
106
|
+
一个 **seam** 是一项可替换能力,包含三种角色:声明接口的 **Service Definition**、实现它的 **Service Provider**,以及使用它的 **Consumer**(通常是面向模型的工具)。一个包可以合并承担多个角色,但单一角色本身不是 seam;添加一项能力意味着把三者一并设计([能力图](./capability-seams.md))。
|
|
107
|
+
|
|
108
|
+
seam 正是替换一个提供方就能改变整个产品的原因。文件系统与进程提供方共享同一个执行世界,因此把它们指向远程沙箱,也就把 Bash、PTY 和 LSP 一并搬了过去,无需提供方专用 fork。[subagent 提供方](./subsystems/subagent.md)在同一个接口之后同样千差万别,从新建一个子 agent,到把一个轮次委派给另一个产品。
|
|
109
|
+
|
|
110
|
+
## 新行为的归属位置
|
|
111
|
+
|
|
112
|
+
新行为附加到已有文档记录的扩展点。改动循环本身时,本映射随之更新。
|
|
113
|
+
|
|
114
|
+
| 目标 | 机制 |
|
|
115
|
+
|---|---|
|
|
116
|
+
| 添加模型提供方 | 在 `ctx.llm` 上注册其适配器 |
|
|
117
|
+
| 添加面向模型的能力 | 在 `ctx.tools` 上注册;其 schema 加入提示词组装 |
|
|
118
|
+
| 让某个会话拥有不同的能力集合 | 组装一个 agent preset;其中的服务行需要 `isolate` realm |
|
|
119
|
+
| 添加 shell 执行 | 注册 `ctx.shell` 后端;本地后端通过 `ctx.subprocess` spawn 进程 |
|
|
120
|
+
| 添加持久化终端执行 | 注册 `ctx.terminals` 后端和 `dsh-tool-terminal` |
|
|
121
|
+
| 添加用户命令 | 在 `ctx.commands` 上注册;它无需模型轮次即可分派 |
|
|
122
|
+
| 添加后台工作 | 在 `ctx.jobs` 上注册;`job_*` 工具负责收集或停止 |
|
|
123
|
+
| 添加文件系统访问或策略 | 注册 `ctx.fs` 提供方,或监听 `fs/*` 事件 |
|
|
124
|
+
| 限制所启动的进程 | 使用 `ctx.sandbox` 后端;消费方在启动进程前包装 argv |
|
|
125
|
+
| 拦截请求、工具或轮次 | 使用相应的 `agent/*` 或 `tools/*` 事件;`agent/turn-stopping` 会停止轮次 |
|
|
126
|
+
| 添加模型可见上下文 | 调用 `agent.inject()`;它会落到下一次获准的请求中 |
|
|
127
|
+
| 添加 UI 或编辑器集成 | 驱动 `ctx.agents` 并从 `session/event` 渲染 |
|
|
128
|
+
| 添加 Web Client Chat 节点 | 注册 `ConversationNodeDefinition` + keyed renderer |
|
|
129
|
+
| 添加持久会话状态 | 扩展 `SessionEventMap`;从日志渲染和回放 |
|
|
130
|
+
| 生成会话标题 | 注册唯一的 `ctx.sessionTitle` 提供方 |
|
|
131
|
+
| 管理同会话目标 | 使用 `ctx.goals`;通过 `agent/*` 续跑 |
|
|
132
|
+
| fork 活跃会话 | `ctx.sessions.fork(source, boundary?, childSessionId?)` |
|
|
133
|
+
| 将注册项限定到单个 agent | 使用该 agent 的 `agent.ctx` |
|
|
134
|
+
|
|
135
|
+
[扩展实操手册](./cookbook/extension-cookbook.md)将功能映射到能力,并索引[包](./cookbook/adding-a-package.md)、[工具](./cookbook/adding-a-tool.md)、[LLM(大语言模型)适配器](./cookbook/adding-an-llm-adapter.md)、[Chat 节点](./cookbook/adding-a-conversation-node.md)和[设置卡片](./cookbook/adding-a-settings-card.md)的分步指南。
|