@deepseek-ai/dsh-webhook 0.1.5-rc.1 → 0.1.6-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.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/webhook/webhook/README.md
5
- README.md: e19bb7edc26857312c9249294bcfab23942075c1
6
- README.zh.md: 39d17eb6e2d1b20e7f05b811d42804c7b3aa435c
5
+ README.md: 685bf3befa1aee3af336452d771c40c01d42c70d
6
+ README.zh.md: db0801fcbd4aa81a8f24bd706673d1ee4629ed1f
package/README.md CHANGED
@@ -27,7 +27,7 @@ English | [中文](README.zh.md)
27
27
 
28
28
  `WebhookRule<K>` has a branded unique `id`, a provider `kind`, and `run(delivery, signal)`. A callback may execute arbitrary trusted code and returns either `null` or one `WebhookSessionRequest`. Rules of the same kind start independently, and one throw or rejection is logged without starving siblings.
29
29
 
30
- `VerifiedWebhookDelivery` carries provider kind, configured source id, provider delivery id, normalized lossless JSON, and receipt time. The runtime snapshots and freezes the complete value before sharing it. `deliveryId` is provenance only; repeated delivery runs the rules again.
30
+ `VerifiedWebhookDelivery` carries provider kind, configured source id, provider delivery id, normalized lossless JSON, and receipt time. The runtime snapshots and freezes the complete value before sharing it. `deliveryId` records the provider's identifier only; repeated delivery runs the rules again.
31
31
 
32
32
  Registration is an effect. Its awaitable disposer first hides the rule, then aborts and drains active callbacks. Callbacks must observe the supplied signal; same-process code that ignores cancellation cannot be forcibly stopped safely.
33
33
 
@@ -38,7 +38,7 @@ Registration is an effect. Its awaitable disposer first hides the rule, then abo
38
38
 
39
39
  The runtime validates presets before mutation, resolves or creates the canonical Workspace, creates an Agent with that Workspace path as `SessionHeader.cwd`, mounts the agent preset before publication, and attaches the Session before applying permissions, title, and prompt. Failed attachment disposes the unpublished action. A later pre-prompt failure detaches the Workspace and disposes the Agent on a best-effort rollback.
40
40
 
41
- Successful `Agent.followup()` is the webhook operation's commit point. The message uses `source.kind: "webhook"` with provider, source, delivery, and rule provenance. The runtime does not wait for idle, flush specially, inspect the reply, or publish completion state; ordinary Agent and Session behavior owns everything afterward.
41
+ Successful `Agent.followup()` is the webhook operation's commit point. The message uses `source.kind: "webhook"` and records the provider, source, delivery, and rule identifiers. The runtime does not wait for idle, flush specially, inspect the reply, or publish completion state; ordinary Agent and Session behavior owns everything afterward.
42
42
 
43
43
  <a id="composition"></a>
44
44
  ## Composition
package/README.zh.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "面向注册可信外部事件策略并创建 Workspace Session 的维护者,说明 webhook 规则运行时。"
2
+ description: "面向注册可信外部事件策略并创建 Workspace 会话的维护者,说明 webhook 规则运行时。"
3
3
  kind: "package-reference"
4
4
  ---
5
5
 
@@ -9,15 +9,15 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- `dsh-webhook` 提供 Host 侧的 `ctx.webhookRuntime`:它既是受信任程序化 webhook 规则的注册表,也拥有唯一内置动作——在 Web Workspace 中创建普通根 Session。接口只包含 `register(rule)` 和 `dispatch(delivery)`;提供方身份验证属于适配器包。当受信任规则必须把外部事件变成新的 agent Session 时,请使用它。
12
+ `dsh-webhook` 提供 Host 侧的 `ctx.webhookRuntime`:它既是受信任程序化 webhook 规则的注册表,也拥有唯一内置动作——在 Web Workspace 中创建普通根会话。接口只包含 `register(rule)` 和 `dispatch(delivery)`;提供方身份验证属于适配器包。当受信任规则必须把外部事件变成新的 agent(智能体)会话时,请使用它。
13
13
 
14
14
  ## 目录
15
15
 
16
16
  - [规则接口](#rule-interface)
17
- - [Session 请求](#session-request)
17
+ - [会话请求](#session-request)
18
18
  - [组合](#composition)
19
- - [Model Experience](#model-experience)
20
- - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
21
  - [开发备注](#dev-note)
22
22
 
23
23
  -----
@@ -25,54 +25,54 @@ kind: "package-reference"
25
25
  <a id="rule-interface"></a>
26
26
  ## 规则接口
27
27
 
28
- `WebhookRule<K>` 具有带品牌类型的唯一 `id`、提供方 `kind` 与 `run(delivery, signal)`。回调可以执行任意受信任代码,并返回 `null` 或一个 `WebhookSessionRequest`。同类规则彼此独立启动;某个规则抛出或拒绝只会记录日志,不会阻止同级规则。
28
+ `WebhookRule<K>` 具有带 brand 类型的唯一 `id`、提供方 `kind` 与 `run(delivery, signal)`。回调可以执行任意受信任代码,并返回 `null` 或一个 `WebhookSessionRequest`。同类规则彼此独立启动;某个回调抛出异常或其返回的 Promise 被拒绝时,只会记录日志,不会阻止同级规则。
29
29
 
30
- `VerifiedWebhookDelivery` 携带提供方种类、已配置来源 id、提供方交付 id、规范化的无损 JSON 与接收时间。runtime 会在共享前快照并冻结完整值。`deliveryId` 仅是来源信息;重复交付会再次运行规则。
30
+ `VerifiedWebhookDelivery` 携带提供方种类、已配置来源 id、提供方交付 id、规范化的无损 JSON 与接收时间。运行时会在共享前快照并冻结完整值。`deliveryId` 仅是来源信息;重复交付会再次运行规则。
31
31
 
32
32
  注册是一项 effect。它的可等待 disposer 会先隐藏规则,再中止并排空活动回调。回调必须观察所提供的 signal;忽略取消的同进程代码无法被安全强制停止。
33
33
 
34
34
  <a id="session-request"></a>
35
- ## Session 请求
35
+ ## 会话请求
36
36
 
37
- `WebhookSessionRequest` 要求 `workspacePath`、`title`、`prompt`、`agentPreset` 与 `permissionPreset`;可选 `model` 会指定明确的提供方/模型路由与输出 token 上限。明确路由使用其适配器的默认推理强度。省略时会快照包含推理强度的完整当前部署选择,直到首个请求记录持久 header;之后的 Web 模型变更保留普通 Session 行为。
37
+ `WebhookSessionRequest` 要求 `workspacePath`、`title`、`prompt`、`agentPreset` 与 `permissionPreset`;可选 `model` 会指定明确的提供方/模型路由与输出 token 上限。明确路由使用其适配器的默认推理(reasoning)强度。省略时会快照包含推理强度的完整当前部署选择,直到首个请求记录持久 header;之后的 Web 模型变更保留普通会话行为。
38
38
 
39
- runtime 会在变更状态前验证 preset,解析或创建规范 Workspace,以该 Workspace 路径作为 `SessionHeader.cwd` 创建 Agent,在发布前挂载 agent preset,并在应用权限、标题与提示词前附加 Session。附加失败会释放尚未提交动作的 Agent。之后若在提示词前失败,则以尽力而为方式脱离 Workspace 并释放 Agent。
39
+ 运行时会在变更状态前验证 preset,解析或创建规范 Workspace,以该 Workspace 路径作为 `SessionHeader.cwd` 创建 Agent,在发布前挂载 agent preset,并在应用权限、标题与提示词前附加会话。附加失败会对尚未发布的动作执行 dispose(资源释放)。之后若在提示词前失败,则以尽力而为方式脱离 Workspace 并对 Agent 执行 dispose。
40
40
 
41
- 成功的 `Agent.followup()` 是 webhook 操作的提交点。消息使用 `source.kind: "webhook"`,并携带提供方、来源、交付与规则来源信息。runtime 不等待 idle、不执行特殊 flush、不检查回复,也不发布完成状态;之后完全由普通 Agent 与 Session 行为接管。
41
+ 成功的 `Agent.followup()` 是 webhook 操作的提交点。消息使用 `source.kind: "webhook"`,并携带提供方、来源、交付与规则来源信息。运行时不等待 idle、不执行特殊 flush、不检查回复,也不发布完成状态;之后完全由普通 Agent 与会话行为接管。
42
42
 
43
43
  <a id="composition"></a>
44
44
  ## 组合
45
45
 
46
- 在 Web Host plane 上,于 Agents、模型默认值、agent presets、permission presets、标题与 Workspace 注册表之后加载 runtime。用户编写的规则插件注入 `webhookRuntime`,并通过自己的 effect 交出 `register()` 返回的 disposer。
46
+ 在 Web Host plane 上,于 Agents、模型默认值、agent presets、permission presets、标题与 Workspace 注册表之后加载运行时。用户编写的规则插件注入 `webhookRuntime`,并通过自己的 effect 交出 `register()` 返回的 disposer。
47
47
 
48
48
  [GitHub 评审指南](../../../docs/user/guide/github-review.zh.md)展示了规则模块、专用入口端口、密钥设置与 Workspace 路由。
49
49
 
50
50
  <a id="model-experience"></a>
51
- ## Model Experience
51
+ ## 模型体验
52
52
 
53
53
  ### 规则编写的初始提示词
54
54
 
55
- #### What the model sees
55
+ #### 模型看到的内容
56
56
 
57
- 每个匹配规则都会让模型看到 `WebhookSessionRequest.prompt` 返回的非空文本原文。通用 runtime 不增加私有框架;若规则包含外部文本,则由规则负责标明其信任属性。随附 GitHub 示例会把选定 PR 字段标为不受信任的 JSON 元数据。
57
+ 每个匹配规则都会让模型看到 `WebhookSessionRequest.prompt` 返回的非空文本原文。通用运行时不增加私有框架;若规则包含外部文本,则由规则负责标明其信任属性。随附 GitHub 示例会把选定 PR 字段标为不受信任的 JSON 元数据。
58
58
 
59
- #### Token effect
59
+ #### Token 影响
60
60
 
61
- 一条依赖数据的 user-role 消息保留在新 Session 中,并持续贡献 token,直到普通 compaction 替换或移除该历史。
61
+ 一条依赖数据的 user-role 消息保留在新会话中,并持续贡献 token,直到普通压缩(compaction)替换或移除该历史。
62
62
 
63
- #### KV Cache effect
63
+ #### KV Cache 影响
64
64
 
65
- 初始提示词开启一个新 Session,因此它建立而不是使该 Session 的可复用请求前缀失效。
65
+ 初始提示词开启一个新会话,因此它建立而不是使该会话的可复用请求前缀失效。
66
66
 
67
- ## Known Limitations and Deferred Work
67
+ ## 已知限制与延期工作
68
68
 
69
69
  <a id="known-limitations-and-deferred-work"></a>
70
70
 
71
- - **仅限进程内 fire-and-forget** — 崩溃会丢失尚未接纳提示词的规则调用;不存在队列、重放或重试。
72
- - **无内置去重** — 提供方重复交付可能创建重复 Session;需要幂等性的规则自行负责。
71
+ - **仅限进程内 fire-and-forget** — 崩溃会丢失尚未接纳提示词的规则调用;不存在队列、回放或重试。
72
+ - **无内置去重** — 提供方重复交付可能创建重复会话;需要幂等性的规则自行负责。
73
73
  - **无完成结果** — HTTP 接受与规则结算都不报告 Agent 成功、idle 或输出。
74
- - **受信任回调必须配合取消** — runtime teardown 会中止并等待回调,但无法终止任意同进程代码。
75
- - **Workspace 创建可能比失败的 Session 尝试更长寿** — 空 Workspace 会保留,因为另一个并发调用者可能已经使用它。
74
+ - **受信任回调必须配合取消** — 运行时 teardown 会中止并等待回调,但无法终止任意同进程代码。
75
+ - **Workspace 创建可能比失败的会话尝试更长寿** — 空 Workspace 会保留,因为另一个并发调用者可能已经使用它。
76
76
 
77
77
 
78
78
  <a id="dev-note"></a>
package/lib/index.js CHANGED
@@ -82,7 +82,7 @@ function installInitialModelSelection(agentCtx, selection) {
82
82
  * Agent remains lifecycle-owned by `ctx` and follows normal Session behavior.
83
83
  *
84
84
  * @param ctx - untraced runtime context that owns the resulting Agent.
85
- * @param delivery - exact verified provider delivery used for provenance.
85
+ * @param delivery - exact verified provider delivery recorded in the message source.
86
86
  * @param ruleId - rule that returned the request.
87
87
  * @param request - same-process rule result.
88
88
  * @param signal - registration lifetime cancellation through publication.
@@ -148,7 +148,7 @@ async function createWebhookSession(ctx, delivery, ruleId, request, signal) {
148
148
  }
149
149
  //#endregion
150
150
  //#region lib/types/brand.js
151
- /** Opaque webhook identities shared by adapters, rules, and Session provenance. */
151
+ /** Opaque webhook identities shared by adapters, rules, and Session message sources. */
152
152
  /**
153
153
  * Brand a webhook rule id.
154
154
  * @param value - non-empty rule identifier validated at registration.
@@ -1,4 +1,4 @@
1
- /** Opaque webhook identities shared by adapters, rules, and Session provenance. */
1
+ /** Opaque webhook identities shared by adapters, rules, and Session message sources. */
2
2
  import type { Branded } from '@deepseek-ai/dsh-brand';
3
3
  /** Identifies one programmatic webhook rule. */
4
4
  export type WebhookRuleId = Branded<'WebhookRuleId'>;
@@ -1,4 +1,4 @@
1
- /** Opaque webhook identities shared by adapters, rules, and Session provenance. */
1
+ /** Opaque webhook identities shared by adapters, rules, and Session message sources. */
2
2
  /**
3
3
  * Brand a webhook rule id.
4
4
  * @param value - non-empty rule identifier validated at registration.
@@ -8,7 +8,7 @@ import type { VerifiedWebhookDelivery, WebhookSessionRequest } from './types.ts'
8
8
  * Agent remains lifecycle-owned by `ctx` and follows normal Session behavior.
9
9
  *
10
10
  * @param ctx - untraced runtime context that owns the resulting Agent.
11
- * @param delivery - exact verified provider delivery used for provenance.
11
+ * @param delivery - exact verified provider delivery recorded in the message source.
12
12
  * @param ruleId - rule that returned the request.
13
13
  * @param request - same-process rule result.
14
14
  * @param signal - registration lifetime cancellation through publication.
@@ -80,7 +80,7 @@ function installInitialModelSelection(agentCtx, selection) {
80
80
  * Agent remains lifecycle-owned by `ctx` and follows normal Session behavior.
81
81
  *
82
82
  * @param ctx - untraced runtime context that owns the resulting Agent.
83
- * @param delivery - exact verified provider delivery used for provenance.
83
+ * @param delivery - exact verified provider delivery recorded in the message source.
84
84
  * @param ruleId - rule that returned the request.
85
85
  * @param request - same-process rule result.
86
86
  * @param signal - registration lifetime cancellation through publication.
@@ -12,7 +12,7 @@ export interface VerifiedWebhookDelivery<K extends string = string> {
12
12
  readonly kind: K;
13
13
  /** Configured adapter instance such as `primary-github`. */
14
14
  readonly source: WebhookSourceId;
15
- /** Provider identity exposed as provenance, never as built-in deduplication state. */
15
+ /** Provider delivery identifier exposed in message sources, never as built-in deduplication state. */
16
16
  readonly deliveryId: WebhookDeliveryId;
17
17
  /** Provider-normalized lossless JSON. */
18
18
  readonly event: WebhookEventOf<K>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-webhook",
3
3
  "description": "Fire-and-forget webhook rule runtime that creates Workspace-backed DeepSeek Harness Sessions",
4
- "version": "0.1.5-rc.1",
4
+ "version": "0.1.6-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -38,32 +38,32 @@
38
38
  "license": "MIT",
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.2",
41
- "@deepseek-ai/dsh-agent-default-model": "^0.1.5-rc.1",
42
- "@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.1",
43
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.1",
44
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
45
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
46
- "@deepseek-ai/dsh-permission-presets": "^0.1.5-rc.1",
47
- "@deepseek-ai/dsh-session-title": "^0.1.5-rc.1",
48
- "@deepseek-ai/dsh-workspace": "^0.1.5-rc.1",
49
- "@deepseek-ai/dsh-session": "^0.1.5-rc.1"
41
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
42
+ "@deepseek-ai/dsh-agent-default-model": "^0.1.6-alpha.1",
43
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
44
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
45
+ "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.1",
46
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
47
+ "@deepseek-ai/dsh-session-title": "^0.1.6-alpha.1",
48
+ "@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.1",
49
+ "@deepseek-ai/dsh-workspace": "^0.1.6-alpha.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@deepseek-ai/cordis": "^4.0.2",
53
53
  "@deepseek-ai/cordis-plugin-include": "^1.0.7",
54
54
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
55
- "@deepseek-ai/dsh-agent": "^0.1.5-rc.1",
56
- "@deepseek-ai/dsh-agent-default-model": "^0.1.5-rc.1",
57
- "@deepseek-ai/dsh-agent-presets": "^0.1.5-rc.1",
58
- "@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
59
- "@deepseek-ai/dsh-llm": "^0.1.5-rc.1",
60
- "@deepseek-ai/dsh-permission-presets": "^0.1.5-rc.1",
61
- "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
62
- "@deepseek-ai/dsh-session-title": "^0.1.5-rc.1",
63
- "@deepseek-ai/dsh-workspace": "^0.1.5-rc.1"
55
+ "@deepseek-ai/dsh-agent": "^0.1.6-alpha.1",
56
+ "@deepseek-ai/dsh-agent-default-model": "^0.1.6-alpha.1",
57
+ "@deepseek-ai/dsh-agent-presets": "^0.1.6-alpha.1",
58
+ "@deepseek-ai/dsh-invariants": "^0.1.6-alpha.1",
59
+ "@deepseek-ai/dsh-llm": "^0.1.6-alpha.1",
60
+ "@deepseek-ai/dsh-permission-presets": "^0.1.6-alpha.1",
61
+ "@deepseek-ai/dsh-session": "^0.1.6-alpha.1",
62
+ "@deepseek-ai/dsh-session-title": "^0.1.6-alpha.1",
63
+ "@deepseek-ai/dsh-workspace": "^0.1.6-alpha.1"
64
64
  },
65
65
  "dependencies": {
66
- "@deepseek-ai/dsh-util-values": "^0.1.5-rc.1",
67
- "@deepseek-ai/dsh-brand": "^0.1.5-rc.1"
66
+ "@deepseek-ai/dsh-brand": "^0.1.6-alpha.1",
67
+ "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.1"
68
68
  }
69
69
  }