@nelsonlongxiang/dsh-prompt-templates 0.14.0 → 0.15.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/README.md CHANGED
@@ -45,14 +45,18 @@ Each template (global or session-scoped) carries its own **switch + interval N**
45
45
 
46
46
  - The injected content arrives as one durable `<system-reminder>` user message recorded in the session log (source kind `prompt-template-schedule`), so replays and audits reconstruct exactly what the model saw
47
47
  - A boundary round is never injected twice, even across restarts or step retries
48
- - Config persists in the plugin's SQLite database (schema v5); `injectEnabled: false` in the patch config silences **scheduled injection only** — event reminders (below) have their own independent master switch `eventInject.enabled`
48
+ - Config persists in the plugin's SQLite database (schema v6, including evolution enrollment); `injectEnabled: false` in the patch config silences **scheduled injection only** — event reminders (below) have their own independent master switch `eventInject.enabled`
49
49
  - Each template picks a delivery mode: **silent** (default, model context only) or **visible in chat** (rendered as a normal user message with a ⚙️ scheduled-injection header)
50
50
 
51
+ ## Atelier evolution checkpoint (unreleased)
52
+
53
+ A session-scoped `工坊·演化自评估` template is provisioned once by default and scheduled every 100 user turns. Existing same-name global/session templates and user edits, disabling and deletion are preserved. This is a reminder, not migration execution or authorization. Set `evolutionAssessmentEnabled: false` to opt out. See [the lifecycle, counting and rollback contract](docs/evolution-default.md).
54
+
51
55
  ## Event reminders (off by default)
52
56
 
53
57
  Besides fixed rounds, the plugin can remind the agent **because of what just happened**. It watches final tool results, detects two problems — **repeated preparation** (the same hand-built prefix such as environment variables plus an absolute interpreter path, with different tasks) and **repeated failure** (the same target failing the same way, or failing again after it had succeeded) — and appends one short reminder before the next model decision, including the tool-result steps that scheduled injection skips.
54
58
 
55
- - Two switches in series, both off by default: the deployment master `eventInject.enabled`, then each rule's toggle. The panel's ⚙ dropdown displays the master switch **read-only** and manages rule toggles, threshold/cooldown, and the read-only episode ledger; changing the master switch still requires deployment configuration.
59
+ - Two switches in series: the master switch lives in the plugin database (the panel ⚙ dropdown toggles it, effective immediately without a restart; the deployment `eventInject.enabled` value only seeds it on first read) and each rule keeps its own toggle alongside threshold/cooldown and the read-only episode ledger. Owner ruling 2026-11-18: the master switch moved from deployment-config-only to panel-owned, reversing the 2026-11-14 posture.
56
60
  - Timing: observation happens after a tool result; the reminder is appended before the **next model decision in the same turn**. It cannot block a first violation, and cannot undo side effects or already-issued sibling parallel calls
57
61
  - What is stored: fingerprints (hashes) plus a length-bounded, heuristically redacted summary of the arguments. Raw arguments/output are not stored wholesale, but the summary may still carry argument fragments the redaction did not mask; it is never treated as an instruction or authorization
58
62
  - Failure classification prioritizes `isError` and its error code, then an integer `meta.exitCode` (including zero). Only when metadata has no valid exit code does the `bash` adapter read the exact trailing `[exit code: N]` marker from the last text part. Arbitrary output words such as success or failure do not decide the result. A command can print a lookalike marker, so this fallback can produce a false positive; `ok` means tool-layer completion, not verified task success. See the [failure contract](docs/event-failure-contract.md) for priority, recorded-host limits, and untested cases.
@@ -74,7 +78,7 @@ Placeholders `{{date}}` `{{time}}` `{{datetime}}` `{{weekday}}` `{{session}}` `{
74
78
  ```text
75
79
  src/ TypeScript plugin (host half + browser half)
76
80
  index.ts Host: owns the TS store, exposes the HTTP routes
77
- store.ts Pure-TS store over node:sqlite (database schema v5)
81
+ store.ts Pure-TS store over node:sqlite (database schema v6)
78
82
  inject.ts Host: scheduled auto-injection on the pre-step waterfall
79
83
  invariant.ts Host: registers the package's invariant companion
80
84
  cli/ The sync CLI (export/diff/merge/import) shipped as bin
@@ -89,7 +93,7 @@ The store is pure TS inside the host half; no child process is spawned.
89
93
 
90
94
  ## Security
91
95
 
92
- - Template **content** reaches a model request in exactly two ways: as ordinary user text the user chose to insert, or as scheduled auto-injection of templates where the switch was explicitly enabled — every injection is a durable session event. Event reminders are a separate channel: they carry no template content, and their switch is independent of scheduled injection
96
+ - Template **content** reaches a model request in exactly two ways: as ordinary user text the user chose to insert, or through scheduled auto-injection. User templates follow their saved switches; the unreleased Atelier default is enabled at once-per-session creation unless the deployment opts out, and remains editable/disableable/deletable by the user. Each delivered injection is a durable session event. Event reminders are a separate channel: they carry no template content, and their switch is independent of scheduled injection
93
97
  - The panel talks to the host store over the Host's plugin routes only; no extra listener, no outbound network
94
98
 
95
99
  ## Database sync CLI
package/README_zh.md CHANGED
@@ -45,14 +45,18 @@ dsh plugin --profile web add @nelsonlongxiang/dsh-prompt-templates
45
45
 
46
46
  - 注入内容是一条持久的 `<system-reminder>` 用户消息,记入会话日志(source kind `prompt-template-schedule`),重放与审计可精确还原模型所见
47
47
  - 同一边界轮绝不重复注入——跨重启、跨步骤重试都不例外
48
- - 配置持久化在插件 SQLite 库(schema v5);patch 配置里的 `injectEnabled: false` 只关**定时注入**——事件提醒(见下)有独立总开关 `eventInject.enabled`,互不控制
48
+ - 配置持久化在插件 SQLite 库(schema v6,含演化模板登记);patch 配置里的 `injectEnabled: false` 只关**定时注入**——事件提醒(见下)有独立总开关 `eventInject.enabled`,互不控制
49
49
  - 每条模板可选交付模式:**静默**(默认,只进模型上下文)或**对话流可见**(以普通用户消息渲染,带 ⚙️ 定时注入标记)
50
50
 
51
+ ## Atelier 演化自评估(待发布)
52
+
53
+ 默认按会话补充 `工坊·演化自评估`,每100用户轮次调用 Agent Atelier 指引;已有同名模板、编辑、关闭和删除不被覆盖。仅提醒,不执行迁移或授予权限。可用 `evolutionAssessmentEnabled: false` 停用。首次历史边界不追补、升级/退出/回滚详见 [演化自评估合同](docs/evolution-default.md)。
54
+
51
55
  ## 事件提醒(默认关闭)
52
56
 
53
57
  除了按固定轮次,插件还可以**根据刚发生的行动**提醒 Agent:观察工具的最终结果,识别两类问题——**重复准备**(反复手工带上同一段前缀,比如环境变量加解释器绝对路径,任务部分不同)和**重复失败**(同一目标以相同方式反复失败,或成功后又失败)——然后在下一次模型决策前追加一条短提醒,包括定时注入会跳过的工具结果那一步。
54
58
 
55
- - 两级开关串联,默认全关:部署级总开关 `eventInject.enabled`,加上每条规则自己的开关——面板 ⚙ 下拉可管理规则开关、门槛/冷却与只读问题台账;总开关本体留在部署配置里
59
+ - 两级开关串联:总开关保存在插件数据库中(面板 ⚙ 下拉可直接切换,即时生效、无需重启;部署配置 eventInject.enabled 的值只在首次读取时作为种子)+每条规则自己的开关、门槛/冷却与只读问题台账。属主 2026-11-18 裁定:总开关由仅部署配置改为面板持有,推翻 2026-11-14 的部署专属取向。
56
60
  - 介入时机:工具结果落地之后、**同轮下一次模型决策之前**追加提醒。它拦不住首次违规,也撤销不了已发生的副作用或已并行发出的兄弟调用
57
61
  - 存的是什么:指纹(哈希)加一条长度受限、启发式脱敏的参数摘要。不整存原始参数/输出,但摘要仍可能带上未被掩码的参数片段;摘要永不作为指令或授权
58
62
  - 失败分类优先取 `isError` 及错误码,再取整数 `meta.exitCode`(含零);只有元数据没有有效退出码时,`bash` 适配才读取最后一个文本片段的精确尾行 `[exit code: N]`。输出里的成功/失败等任意措辞不改变分类;命令也能自行打印同形标记,因此回退存在误报可能。`ok` 仅代表工具层完成,不等于任务已验证成功。字段优先级、记录宿主限制与未测项见[失败契约](docs/event-failure-contract.md)。
@@ -74,7 +78,7 @@ dsh plugin --profile web add @nelsonlongxiang/dsh-prompt-templates
74
78
  ```text
75
79
  src/ TypeScript 插件(host 面 + 浏览器面)
76
80
  index.ts Host:持有 TS 存储,暴露 HTTP 路由
77
- store.ts 纯 TS 存储(node:sqlite,数据库 schema v5)
81
+ store.ts 纯 TS 存储(node:sqlite,数据库 schema v6)
78
82
  inject.ts Host:挂在 pre-step waterfall 上的定时注入
79
83
  invariant.ts Host:注册本包的 invariant 伴生插件
80
84
  cli/ 随 bin 发布的同步 CLI(export/diff/merge/import)
@@ -88,7 +92,7 @@ cordis.patch.yml Bundle patch:挂插件行
88
92
 
89
93
  ## 安全
90
94
 
91
- - 模板**内容**进入模型请求只有两条路:用户主动插入的普通用户文本,或开关被显式打开的定时注入模板——每次注入都是一条持久会话事件。事件提醒是独立通道:不携带模板内容,开关也与定时注入互不控制
95
+ - 模板**内容**进入模型请求只有两条路:用户主动插入的普通用户文本,或经定时注入通道。用户模板按已保存的开关执行;本分支未发布的 Atelier 默认项在每会话首次创建时启用,可由部署退出,用户仍可编辑、关闭或删除。每次实际投递均记为持久会话事件。事件提醒是独立通道:不携带模板内容,开关也与定时注入互不控制
92
96
  - 面板仅经 Host 的插件路由访问 host 存储;无额外监听、无外联网络
93
97
 
94
98
  ## 数据同步 CLI
@@ -0,0 +1,46 @@
1
+ # Atelier 演化自评估:默认会话模板 v2(未发布)
2
+
3
+ ## 合同
4
+
5
+ 本插件仅在已有 `agent/pre-step` 轮次注入通道补充提示词,不执行评估、训练模型、迁移目录、授权、安装、部署或 A2A 成员操作。Atelier 负责方法论;A2A Net 负责其角色/身份/规则约束;业务成果、反馈和价值决定是否演变,不是满 100 轮就升级。
6
+
7
+ - 方法论:[演化自评估固定参考](https://github.com/NelsonLongxiang/agent-atelier/blob/6278996da228eccc83843b12b8e93b6c4a13e9c9/references/evolution-self-assessment.md),配套 Atelier #61 已合并。本轮本机已安装 Atelier 5.16.0 中可以读取该参考;文件存在不等于任意宿主已加载技能或模型已执行。
8
+ - 身份治理:[dsh-open-a2a-net](https://github.com/NelsonLongxiang/dsh-open-a2a-net)。仅实际 Super Agent 身份适用其角色规范;角色规则变更遵循 `propose → owner 后续亲自消息确认 → apply`,成员操作按来源及逐操作授权另核,不把规则确认流程泛化到所有成员操作或已授权本地改进。提醒不扩大授权。
9
+ - 实现:`src/evolution-default.ts` / `src/store.ts` / `src/inject.ts`。
10
+
11
+ ## 自动补充与优先级
12
+
13
+ 默认 `evolutionAssessmentEnabled: true`。同时需 `injectEnabled: true`;任一关闭不自动补充。每个会话首次获准的非空 pre-step,事务内检查并补一份可见会话模板 `工坊·演化自评估`,默认每 100 **用户轮次**,非工具调用/模型 step/时间间隔。新会话第 1 轮登记,从第 100 轮注入;已有会话首次遇到第 200 轮只登记,从 300 轮开始,不补发历史检查。可改模板间隔,沿用绝对用户轮数取模,不改成登记后滚动 100 轮。
14
+
15
+ 1. 存在同名全局或当前会话模板时,保留原文、启用状态、间隔,记一次“已有”登记,不再自动补。包括已关闭模板。
16
+ 2. 新建模板后,编辑/改名/关闭/删除均保留;删除后的登记相当于 tombstone,重启、升级或再次开会话不复活。需恢复时由用户在面板手动创建。
17
+ 3. 后增同名全局模板时,自动生成的会话模板停止注入,避免双份;全局开关和周期完全按用户配置执行。删除该全局模板后,原会话模板恢复其配置。并不自动合并/删除任何模板。
18
+ 4. 任意其他名称不以模糊文本猜测同义。已有异名等价模板,请关闭自动功能或关闭生成项,自行取舍。
19
+ 5. 自动项若被用户显式“设为全局”,沿用普通全局轮次规则;`evolutionAssessmentEnabled:false` 仍抑制该自动来源的模板。用户自己创建的模板不受此开关控制,需自身关闭或 `injectEnabled:false`。
20
+ 6. `injectMaxEvery < 100` 时不创建,避免绕过已有部署上限。
21
+
22
+ ## 持久性、升级与证据
23
+
24
+ schema v6 新增 `evolution_defaults(session_id, template_id, source, version, enrolled_turn, disposition)`,不记录任务内容、提示词历史或私密材料。`BEGIN IMMEDIATE` + 会话主键保证多连接补充幂等;模板创建与登记同事务。v1–v5 单事务迁移,原模板不改;初始化或迁移失败会回滚并关闭本次连接,保留原错误,避免失败对象泄漏数据库句柄。CLI 兼容 v6,但模板导出不包含 enrollment/tombstone。
25
+
26
+ 新默认项来源为 `agent-atelier/evolution-self-assessment@2`,写入登记及模板 description;v2 仅缩窄 A2A 角色/授权路由,不改变周期。旧 v1 登记与已有模板内容、启用状态、间隔、模式保持原样;新文案只用于未登记会话,绝不自动覆盖已有模板。日志继续沿用 `prompt-template-schedule` 的模板 ID/名称/间隔与 turn;描述可被用户改写,SQLite 登记才是来源事实。注入日志不是评估完成证据,更不是迁移成功证据。
27
+
28
+ 相同 turn 的耐久日志去重与进程内去重沿用原注入器。**未支持同一 DSH 会话由两个独立宿主并发执行**:本次并发保证针对 SQLite 模板补充,不声称跨宿主注入 exactly-once。技能不可用时提示词要求明确报告缺失,不自动安装或杜撰通过;这属于模型遵守的指令,并非宿主检测器。
29
+
30
+ ## 停用与回滚
31
+
32
+ - 本版本功能回滚:设置 `evolutionAssessmentEnabled:false`,仅停本功能补充/自动来源注入;不删模板,不改事件提醒。全部定时注入关闭用 `injectEnabled:false`。
33
+ - 单会话关闭:面板关闭或删除生成模板,不会再补。
34
+ - 包降级至仅支持 v5 的版本前,需停止写入并使用升级前的一致 SQLite 备份恢复;不得仅改 `user_version` 或删除表冒充回滚。模板 JSON 不是完整运行态备份。回滚/部署均需单独授权,本 PR 不执行。
35
+ - 新宿主/全新数据库有独立登记。CLI JSON 只带模板/类目并保留其中的启用配置;经显式 dry-run/确认后,它能重建已删除模板(含原 ID),但不重置旧库登记,也不把登记复制到新库。在原库恢复相同 ID 后仍受自动来源总开关约束;在新库导入的行是显式用户配置,不因 description 文本变成受管理默认项。它不等于完整回退,也不能据此声称删除意图随 JSON 搬迁。
36
+ - 剪贴板分享导入是另一入口:新增项默认关闭,同名覆盖保留目标开关。不要把它与保留配置的 CLI 快照导入混为一谈。跨机迁移需另核启用策略及授权。
37
+
38
+ ## 验证边界
39
+
40
+ 现有 `tests/evolution-default.test.ts` 使用正式 `tests/temp-dir.mjs` 入口创建项目内独占测试库并收尾;复用默认测试门禁,不另建平行运行器。覆盖两会话隔离、未来边界、编辑/改名/关闭/删除后的重启、同名全局/会话、晚到关闭的全局与删除后恢复、v5迁移、4 worker 并发迁移和补充、来源版本更新不覆盖旧项、登记失败原子回滚、构造失败关闭连接、CLI快照与登记边界、一致SQLite备份恢复登记和删除状态。
41
+
42
+ `tests/host-apply.test.ts` 在真实 Cordis Context 中加载本插件,但 session、消息与日志是合成数据:覆盖拒绝/空步骤/总开关/间隔上限不登记,同轮105次工具step不充作100用户轮,历史边界首次只登记、未来注入、可见消息source、路由编辑/关闭/删除、同数据库插件重载后日志去重与 tombstone、自动来源退出不影响用户自己的定时模板。它不启动实际 DSH 模型循环。
43
+
44
+ 本轮这些 store/CLI 与进程内宿主集成回归可运行;类型检查、完整构建及包门的精确候选结果在 PR #15 按提交记录。主干同步时包内链接门曾因缺少本说明 FAIL,补白名单后 PASS;本说明现在显式进入 npm 包并有安装内容校验。历史草稿的缺依赖状态不再描述当前工程环境。
45
+
46
+ 真实 DSH profile 的持久送达、实际技能加载、模型执行/采纳、真实迁移/恢复、收益、macOS现场与当前头独立OPS:**NOT_RUN/未覆盖**。不能由测试、静态参考存在、注入消息或作者自述推出这些状态为 PASS。保持 Draft,不合并、发布、部署或启用生产模板。
@@ -225,7 +225,7 @@ eventInject:
225
225
 
226
226
  面板只读展示放到后续版本;首版有路由即可审计。
227
227
 
228
- > **现行状态(2026-11-16,#9 已落地)**:模板库面板的 ⚙ 下拉提供规则开关、门槛/冷却编辑、总开关状态横幅与本会话只读问题台账;`GET …/event-policies` 响应带 `config.enabled`。本节其余内容为历史设计。
228
+ > **现行状态(2026-11-16,#9 已落地)**:模板库面板的 ⚙ 下拉提供规则开关、门槛/冷却编辑、总开关可切换横幅(入库持有,即时生效)与本会话只读问题台账;`GET …/event-policies` 响应带 `config.enabled`。本节其余内容为历史设计。
229
229
 
230
230
  ### 4.9 导入导出兼容
231
231
 
@@ -302,7 +302,7 @@ eventInject:
302
302
  | 4.4:交付状态有 `queued` | 没有单独的 `queued`;“可提醒”在 pre-step 时现算,选中即写 `prepared` | 崩溃窗口“检测后、准备前”由持久的 episode 本身覆盖:重启后它仍然到期,照常发送(有测试) |
303
303
  | 4.4:交付失败态 | 增加 `superseded`:未送达的提醒被更新的证据取代时,旧记录标 `superseded`,按新修订号重发一条 | 避免同一问题在一步里出现新旧两条提醒 |
304
304
  | 4.2:观察入口检查 | 部署开关关闭,或没有任何启用的规则时,观察器直接返回、不写库 | 默认零写入 |
305
- | 4.8:面板 | #9 已补:⚙ 下拉规则开关、门槛/冷却、部署总开关只读状态与会话只读台账 | 原“首版仅路由”的计划为历史范围,现行已面板化 |
305
+ | 4.8:面板 | #9 已补:⚙ 下拉规则开关、门槛/冷却、**总开关可切换(2026-11-18 属主改判:总开关入库、面板持有、即时生效;部署 `eventInject.enabled` 仅作首次种子,推翻 2026-11-14 部署专属取向)**与会话只读台账 | 原"首版仅路由"与"部署总开关只读"均为历史范围,现行已面板化并持有总开关 |
306
306
  | 4.2/4.3:失败只取结构化字段 | #16 后优先 `isError` 与整数 `meta.exitCode`;元数据没有有效退出码时,`bash` 读取最后文本片段精确尾标记。元数据零压过冲突标记,任意成功/失败措辞不参与 | 录制的 Windows DSH 0.2.2-rc.3 非零调用未给结构化退出码;文本标记不能认证来源,可能被命令伪造。支持范围与未测项以[失败契约](event-failure-contract.md)为准 |
307
307
  | 4.2:不保留原始参数的绝对表述 | 不整存原始参数/输出;保存哈希、结果字段及长度受限的启发式脱敏参数摘要,未掩码片段仍可能保留 | 隐私边界须如实告知;摘要不得作为新指令或授权,不能承诺绝无敏感信息 |
308
308
 
@@ -5,11 +5,11 @@ import { backup, DatabaseSync } from 'node:sqlite';
5
5
  import { createSnapshot, diffSnapshots } from "./model.js";
6
6
  /**
7
7
  * Database schema versions the CLI reads and writes. The CLI only touches
8
- * `templates` and `categories`, which are identical in v4 and v5 (v5 only
9
- * adds the event-reminder tables, which hold runtime data and are never
10
- * exported or imported).
8
+ * `templates` and `categories`, whose columns are identical across v4-v7.
9
+ * v5 event tables, v6 the stored master switch / evolution enrollment, and
10
+ * v7 the combined migration all hold runtime state that is never exported.
11
11
  */
12
- const SUPPORTED_DB_VERSIONS = [4, 5];
12
+ const SUPPORTED_DB_VERSIONS = [4, 5, 6, 7];
13
13
  /** A valid operation blocked by a safety/business gate (CLI exit 1). */
14
14
  export class ImportBlockedError extends Error {
15
15
  constructor(message) { super(message); this.name = 'ImportBlockedError'; }
@@ -21,7 +21,7 @@ export function exportDatabase(dbPath, filters = {}) {
21
21
  db.exec('PRAGMA query_only=ON');
22
22
  const version = Number(db.prepare('PRAGMA user_version').get().user_version);
23
23
  if (!SUPPORTED_DB_VERSIONS.includes(version))
24
- throw new Error(`${path} has schema version ${version}, expected 4 or 5`);
24
+ throw new Error(`${path} has schema version ${version}, expected 4, 5, 6 or 7`);
25
25
  const clauses = [];
26
26
  const args = [];
27
27
  if (filters.scope !== undefined) {
@@ -116,7 +116,7 @@ export async function importDatabase(dbPath, incoming, options) {
116
116
  db.exec(`PRAGMA busy_timeout=${options.busyTimeoutMs ?? 5000}`);
117
117
  const version = Number(db.prepare('PRAGMA user_version').get().user_version);
118
118
  if (!SUPPORTED_DB_VERSIONS.includes(version))
119
- throw new Error(`${path} has schema version ${version}, expected 4 or 5`);
119
+ throw new Error(`${path} has schema version ${version}, expected 4, 5, 6 or 7`);
120
120
  backupPath = resolve(options.backupOut ?? `${path}.${timestampName()}.bak`);
121
121
  mkdirSync(dirname(backupPath), { recursive: true });
122
122
  await backup(db, backupPath);
@@ -114,7 +114,7 @@ function CategoryForm({ sessionId, createCategory, t, onDone }) {
114
114
  * @param props - target session, shared verbs, locale, optional title-row takeover.
115
115
  */
116
116
  export function TemplateLibrary({ sessionId, face, t, header, headerExtra }) {
117
- const { refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes } = face;
117
+ const { refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes } = face;
118
118
  const [templates, setTemplates] = useState([]);
119
119
  const [categories, setCategories] = useState([]);
120
120
  const [showAdd, setShowAdd] = useState(false);
@@ -174,10 +174,10 @@ export function TemplateLibrary({ sessionId, face, t, header, headerExtra }) {
174
174
  void loadHistory();
175
175
  }, [historyOpen, loadHistory, injected]);
176
176
  useEffect(() => { setHistoryOpen(false); }, [sessionId]);
177
- // Event-reminders dropdown (⚙): the deployment master switch (read-only,
178
- // the deployment config owns it) plus per-rule toggles and tunables, and
179
- // the target session's read-only problem episodes. Loaded on demand so
180
- // closed state costs nothing; a failed load keeps the banner's fallback.
177
+ // Event-reminders dropdown (⚙): the stored master switch (panel-owned,
178
+ // seeded once from deployment config) plus per-rule toggles and tunables,
179
+ // and the target session's read-only problem episodes. Loaded on demand
180
+ // so closed state costs nothing; a failed load keeps the banner's fallback.
181
181
  const [eventsOpen, setEventsOpen] = useState(false);
182
182
  const [policies, setPolicies] = useState(null);
183
183
  const [episodes, setEpisodes] = useState([]);
@@ -198,6 +198,16 @@ export function TemplateLibrary({ sessionId, face, t, header, headerExtra }) {
198
198
  }
199
199
  }, [eventsOpen, loadPolicies, loadEpisodes]);
200
200
  useEffect(() => { setEventsOpen(false); }, [sessionId]);
201
+ // Flip the stored master switch; takes effect immediately, no restart.
202
+ const handleToggleMaster = useCallback(async () => {
203
+ if (policies === null)
204
+ return;
205
+ const result = await setEventMaster(!policies.enabled);
206
+ if (result.ok)
207
+ void loadPolicies();
208
+ else
209
+ setRowError(result.error.message);
210
+ }, [policies, setEventMaster, loadPolicies]);
201
211
  // Flip one rule's enabled switch; the write confirms before the row flips.
202
212
  const handleToggleRule = useCallback(async (rule) => {
203
213
  const result = await updateEventPolicy(rule.rule_id, { enabled: !rule.enabled });
@@ -450,7 +460,7 @@ export function TemplateLibrary({ sessionId, face, t, header, headerExtra }) {
450
460
  shareOpener.current = null;
451
461
  if (opener?.isConnected)
452
462
  opener.focus({ preventScroll: true });
453
- }, children: t('panel.shareDismiss') })] })] })), showImport && (_jsxs("div", { className: css.importForm, "data-prompt-import": true, children: [_jsx("textarea", { className: css.contentInput, rows: 4, value: importText, onChange: (e) => { setImportText(e.target.value); }, placeholder: t('panel.importPlaceholder'), "aria-label": t('panel.import') }), _jsxs("div", { className: css.importActions, children: [_jsx("button", { type: "button", className: css.saveBtn, onClick: () => { void handleImport(); }, disabled: importBusy, children: t('panel.importRun') }), _jsx("button", { type: "button", className: css.cancelBtn, onClick: () => { setShowImport(false); setImportText(''); }, disabled: importBusy, children: t('panel.importCancel') })] })] })), historyOpen && (_jsxs("div", { className: css.injectHistory, "data-prompt-inject-history": true, role: "dialog", "aria-label": t('panel.historyTitle'), children: [_jsx("div", { className: css.injectHistoryTitle, children: t('panel.historyTitle') }), history.length === 0 && _jsx("div", { className: css.injectHistoryEmpty, children: t('panel.historyEmpty') }), history.map(entry => (_jsxs("div", { className: css.injectHistoryItem, children: [_jsxs("div", { className: css.injectHistoryHead, children: ["\u27F3", entry.turn, " \u00B7 ", new Date(entry.at).toLocaleTimeString(), " \u00B7 ", entry.templates.join(', ')] }), _jsx("div", { className: css.injectHistoryContent, children: entry.content })] }, `${entry.turn}-${entry.at}`)))] })), eventsOpen && (_jsxs("div", { className: css.eventsPanel, "data-prompt-events": true, role: "dialog", "aria-label": t('panel.eventsTitle'), children: [_jsx("div", { className: css.eventsHead, children: t('panel.eventsTitle') }), _jsx("div", { className: policies !== null && policies.enabled ? css.eventsBanner : `${css.eventsBanner} ${css.eventsBannerOff}`, children: policies === null ? t('panel.eventsLoadFailed') : policies.enabled ? t('panel.eventsMasterOn') : t('panel.eventsMasterOff') }), (policies?.items ?? []).map(rule => (_jsxs("div", { className: css.eventsRule, children: [_jsxs("label", { className: css.eventsRuleHead, children: [_jsx("input", { type: "checkbox", className: css.eventsToggle, checked: rule.enabled, disabled: policies === null || !policies.enabled, onChange: () => { void handleToggleRule(rule); } }), _jsx("span", { className: css.eventsRuleName, children: t(rule.rule_id === 'repeated-preparation' ? 'panel.eventsRulePrep' : 'panel.eventsRuleFail') })] }), _jsxs("div", { className: css.eventsParams, children: [_jsxs("label", { className: css.eventsParam, children: [t('panel.eventsThreshold'), _jsx("input", { type: "number", min: 1, defaultValue: rule.threshold, disabled: !rule.enabled || policies === null || !policies.enabled, onBlur: (event) => { void handleRuleParam(rule, 'threshold', event.target.value); } })] }), _jsxs("label", { className: css.eventsParam, children: [t('panel.eventsCooldown'), _jsx("input", { type: "number", min: 0, defaultValue: rule.cooldown_turns, disabled: !rule.enabled || policies === null || !policies.enabled, onBlur: (event) => { void handleRuleParam(rule, 'cooldown_turns', event.target.value); } })] })] })] }, rule.rule_id))), _jsx("div", { className: css.eventsEpisodesTitle, children: t('panel.eventsEpisodes') }), episodes.length === 0 && _jsx("div", { className: css.eventsEmpty, children: t('panel.eventsEpisodesEmpty') }), episodes.slice(0, 8).map(episode => (_jsxs("div", { className: css.eventsEpisode, children: [_jsxs("div", { className: css.eventsEpisodeHead, children: [episode.rule_id, " \u00B7 ", episode.state, " \u00B7 \u00D7", episode.notify_count, " \u00B7 ", new Date(episode.updated_at).toLocaleTimeString()] }), _jsx("div", { className: css.eventsEpisodeSummary, children: episode.summary })] }, episode.episode_id)))] })), _jsx("div", { className: css.searchBar, children: _jsx("input", { type: "search", className: css.searchInput, value: query, onChange: (e) => { setQuery(e.target.value); }, placeholder: t('panel.search'), "aria-label": t('panel.search') }) }), _jsxs("div", { className: css.tabsBar, children: [_jsx("button", { type: "button", className: effectiveTab === 'global' ? `${css.tab} ${css.tabActive}` : css.tab, onClick: () => { setActiveTab('global'); }, children: t('panel.global') }), _jsx("button", { type: "button", className: effectiveTab === 'session' ? `${css.tab} ${css.tabActive}` : css.tab, onClick: () => { setActiveTab('session'); }, disabled: sessionId === null, children: t('panel.session') }), visibleCategories.map((cat) => {
463
+ }, children: t('panel.shareDismiss') })] })] })), showImport && (_jsxs("div", { className: css.importForm, "data-prompt-import": true, children: [_jsx("textarea", { className: css.contentInput, rows: 4, value: importText, onChange: (e) => { setImportText(e.target.value); }, placeholder: t('panel.importPlaceholder'), "aria-label": t('panel.import') }), _jsxs("div", { className: css.importActions, children: [_jsx("button", { type: "button", className: css.saveBtn, onClick: () => { void handleImport(); }, disabled: importBusy, children: t('panel.importRun') }), _jsx("button", { type: "button", className: css.cancelBtn, onClick: () => { setShowImport(false); setImportText(''); }, disabled: importBusy, children: t('panel.importCancel') })] })] })), historyOpen && (_jsxs("div", { className: css.injectHistory, "data-prompt-inject-history": true, role: "dialog", "aria-label": t('panel.historyTitle'), children: [_jsx("div", { className: css.injectHistoryTitle, children: t('panel.historyTitle') }), history.length === 0 && _jsx("div", { className: css.injectHistoryEmpty, children: t('panel.historyEmpty') }), history.map(entry => (_jsxs("div", { className: css.injectHistoryItem, children: [_jsxs("div", { className: css.injectHistoryHead, children: ["\u27F3", entry.turn, " \u00B7 ", new Date(entry.at).toLocaleTimeString(), " \u00B7 ", entry.templates.join(', ')] }), _jsx("div", { className: css.injectHistoryContent, children: entry.content })] }, `${entry.turn}-${entry.at}`)))] })), eventsOpen && (_jsxs("div", { className: css.eventsPanel, "data-prompt-events": true, role: "dialog", "aria-label": t('panel.eventsTitle'), children: [_jsx("div", { className: css.eventsHead, children: t('panel.eventsTitle') }), _jsx("div", { className: policies !== null && policies.enabled ? css.eventsBanner : `${css.eventsBanner} ${css.eventsBannerOff}`, children: _jsxs("label", { className: css.eventsRuleHead, children: [_jsx("input", { type: "checkbox", className: css.eventsToggle, checked: policies?.enabled === true, disabled: policies === null, onChange: () => { void handleToggleMaster(); } }), _jsx("span", { children: policies === null ? t('panel.eventsLoadFailed') : policies.enabled ? t('panel.eventsMasterOn') : t('panel.eventsMasterOff') })] }) }), (policies?.items ?? []).map(rule => (_jsxs("div", { className: css.eventsRule, children: [_jsxs("label", { className: css.eventsRuleHead, children: [_jsx("input", { type: "checkbox", className: css.eventsToggle, checked: rule.enabled, disabled: policies === null || !policies.enabled, onChange: () => { void handleToggleRule(rule); } }), _jsx("span", { className: css.eventsRuleName, children: t(rule.rule_id === 'repeated-preparation' ? 'panel.eventsRulePrep' : 'panel.eventsRuleFail') })] }), _jsxs("div", { className: css.eventsParams, children: [_jsxs("label", { className: css.eventsParam, children: [t('panel.eventsThreshold'), _jsx("input", { type: "number", min: 1, defaultValue: rule.threshold, disabled: !rule.enabled || policies === null || !policies.enabled, onBlur: (event) => { void handleRuleParam(rule, 'threshold', event.target.value); } })] }), _jsxs("label", { className: css.eventsParam, children: [t('panel.eventsCooldown'), _jsx("input", { type: "number", min: 0, defaultValue: rule.cooldown_turns, disabled: !rule.enabled || policies === null || !policies.enabled, onBlur: (event) => { void handleRuleParam(rule, 'cooldown_turns', event.target.value); } })] })] })] }, rule.rule_id))), _jsx("div", { className: css.eventsEpisodesTitle, children: t('panel.eventsEpisodes') }), episodes.length === 0 && _jsx("div", { className: css.eventsEmpty, children: t('panel.eventsEpisodesEmpty') }), episodes.slice(0, 8).map(episode => (_jsxs("div", { className: css.eventsEpisode, children: [_jsxs("div", { className: css.eventsEpisodeHead, children: [episode.rule_id, " \u00B7 ", episode.state, " \u00B7 \u00D7", episode.notify_count, " \u00B7 ", new Date(episode.updated_at).toLocaleTimeString()] }), _jsx("div", { className: css.eventsEpisodeSummary, children: episode.summary })] }, episode.episode_id)))] })), _jsx("div", { className: css.searchBar, children: _jsx("input", { type: "search", className: css.searchInput, value: query, onChange: (e) => { setQuery(e.target.value); }, placeholder: t('panel.search'), "aria-label": t('panel.search') }) }), _jsxs("div", { className: css.tabsBar, children: [_jsx("button", { type: "button", className: effectiveTab === 'global' ? `${css.tab} ${css.tabActive}` : css.tab, onClick: () => { setActiveTab('global'); }, children: t('panel.global') }), _jsx("button", { type: "button", className: effectiveTab === 'session' ? `${css.tab} ${css.tabActive}` : css.tab, onClick: () => { setActiveTab('session'); }, disabled: sessionId === null, children: t('panel.session') }), visibleCategories.map((cat) => {
454
464
  const key = `cat:${cat.scope}:${cat.name}`;
455
465
  return (_jsxs("span", { className: effectiveTab === key ? `${css.tab} ${css.tabActive}` : css.tab, children: [_jsx("button", { type: "button", onClick: () => { setActiveTab(key); }, children: cat.name }), _jsx("button", { type: "button", className: css.tabShare, "aria-label": t('panel.shareCategory'), title: t('panel.shareCategory'), onClick: (event) => { void handleShareCategory(cat, event.currentTarget); }, children: _jsx(IconCopyOutlineRegular, { size: 11 }) }), _jsx("button", { type: "button", className: css.tabDelete, "aria-label": t('panel.deleteCategory'), title: t('panel.deleteCategory'), onClick: () => {
456
466
  void (async () => {
@@ -33,7 +33,7 @@ function clampToViewport(position) {
33
33
  * @param props - runtime kit, injected face members, store handle, and locale.
34
34
  */
35
35
  export function PromptPanel(props) {
36
- const { useStore, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes, targetSession, targetVersion, subscribeTarget, panelPosition, savePanelPosition, resetPanelPosition, actions, t, } = props;
36
+ const { useStore, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes, targetSession, targetVersion, subscribeTarget, panelPosition, savePanelPosition, resetPanelPosition, actions, t, } = props;
37
37
  const open = useStore(s => s.open);
38
38
  // Re-render whenever the delivery target changes: the composer entry
39
39
  // attaches its session whenever its composer becomes the visible one, so
@@ -122,7 +122,7 @@ export function PromptPanel(props) {
122
122
  refresh, refreshCategories, createCategory, removeCategory,
123
123
  create, update, remove, makeGlobal,
124
124
  insert, send, interject, injectStatus, injectionHistory,
125
- eventPolicies, updateEventPolicy, eventEpisodes,
125
+ eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes,
126
126
  };
127
127
  return (_jsx("div", { className: css.panel, "data-prompt-panel": true, ref: panelRef, style: placementStyle, children: _jsx(TemplateLibrary, { sessionId: sessionId, face: libraryFace, t: t, header: {
128
128
  onPointerDown: onHeaderPointerDown,
@@ -6,6 +6,6 @@ import css from './Panel.module.css';
6
6
  * @param props - runtime kit (carries sessionId), injected face members, locale.
7
7
  */
8
8
  export function PromptTab(props) {
9
- const { sessionId, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes, t, } = props;
10
- return (_jsx("div", { className: css.tabBody, "data-prompt-tab": true, children: _jsx(TemplateLibrary, { sessionId: sessionId, face: { refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes }, t: t }) }));
9
+ const { sessionId, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes, t, } = props;
10
+ return (_jsx("div", { className: css.tabBody, "data-prompt-tab": true, children: _jsx(TemplateLibrary, { sessionId: sessionId, face: { refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes }, t: t }) }));
11
11
  }
package/lib/client/api.js CHANGED
@@ -72,6 +72,10 @@ export async function eventPolicies() {
72
72
  const body = await response.json();
73
73
  return { items: [...body.items ?? []], enabled: body.config?.enabled === true };
74
74
  }
75
+ /** Flip the stored master switch (panel-owned; deployment config seeds it once). */
76
+ export function setEventMaster(enabled) {
77
+ return mutate('PATCH', '/event-policies/master', { enabled });
78
+ }
75
79
  /** Flip or tune one event rule (partial patch). */
76
80
  export function updateEventPolicy(ruleId, patch) {
77
81
  return mutate('PATCH', `/event-policies/${encodeURIComponent(ruleId)}`, patch);
@@ -1,4 +1,4 @@
1
- import { listTemplates, listCategories, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes, createCategory, deleteCategory, createTemplate, updateTemplate, deleteTemplate, makeTemplateGlobal, } from "./api.js";
1
+ import { listTemplates, listCategories, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes, createCategory, deleteCategory, createTemplate, updateTemplate, deleteTemplate, makeTemplateGlobal, } from "./api.js";
2
2
  import { PromptPanel } from "./Panel.js";
3
3
  import { PanelButton } from "./PanelButton.js";
4
4
  import { PromptTab } from "./PromptTab.js";
@@ -65,6 +65,7 @@ export function apply(ctx) {
65
65
  injectStatus,
66
66
  injectionHistory,
67
67
  eventPolicies,
68
+ setEventMaster,
68
69
  updateEventPolicy,
69
70
  eventEpisodes,
70
71
  };
@@ -60,8 +60,8 @@ export const zh = {
60
60
  'panel.modeVisible': '对话流可见',
61
61
  'panel.modeHint': '静默:只进模型上下文(对话流不显示,基座设计);可见:以用户消息样式显示在对话流中,带"⚙️ 定时注入"标记',
62
62
  'panel.eventsTitle': '事件提醒',
63
- 'panel.eventsMasterOn': '总开关:开',
64
- 'panel.eventsMasterOff': '总开关:关(由部署配置 eventInject.enabled 决定,默认关)',
63
+ 'panel.eventsMasterOn': '总开关:开(取消勾选即停用)',
64
+ 'panel.eventsMasterOff': '总开关:关(勾选即启用,即时生效)',
65
65
  'panel.eventsLoadFailed': '事件提醒状态不可用',
66
66
  'panel.eventsRulePrep': '重复准备',
67
67
  'panel.eventsRuleFail': '重复失败',
@@ -137,8 +137,8 @@ export const en = {
137
137
  'panel.modeVisible': 'Visible in chat',
138
138
  'panel.modeHint': 'Silent: model context only (omitted from the chat transcript by base design); Visible: rendered as a user message in the chat flow, headed by a ⚙️ scheduled-injection marker',
139
139
  'panel.eventsTitle': 'Event reminders',
140
- 'panel.eventsMasterOn': 'Master switch: on',
141
- 'panel.eventsMasterOff': 'Master switch: off (deployment config eventInject.enabled, off by default)',
140
+ 'panel.eventsMasterOn': 'Master switch: on (untick to disable)',
141
+ 'panel.eventsMasterOff': 'Master switch: off (tick to enable, effective immediately)',
142
142
  'panel.eventsLoadFailed': 'Event reminder state unavailable',
143
143
  'panel.eventsRulePrep': 'Repeated preparation',
144
144
  'panel.eventsRuleFail': 'Repeated failure',
package/lib/client.js CHANGED
@@ -76,6 +76,10 @@ window.__ModuleLoader__.load({
76
76
  enabled: body.config?.enabled === true
77
77
  };
78
78
  }
79
+ /** Flip the stored master switch (panel-owned; deployment config seeds it once). */
80
+ function setEventMaster(enabled) {
81
+ return mutate("PATCH", "/event-policies/master", { enabled });
82
+ }
79
83
  /** Flip or tune one event rule (partial patch). */
80
84
  function updateEventPolicy(ruleId, patch) {
81
85
  return mutate("PATCH", `/event-policies/${encodeURIComponent(ruleId)}`, patch);
@@ -325,7 +329,7 @@ window.__ModuleLoader__.load({
325
329
  /** Canonical public source repository for the panel's metadata link. */
326
330
  const GITHUB_REPOSITORY_URL = "https://github.com/NelsonLongXiang/dsh-prompt-templates";
327
331
  /** Build-injected package version; `dev` only exists in unbundled unit tests. */
328
- const PLUGIN_VERSION = "0.14.0";
332
+ const PLUGIN_VERSION = "0.15.0";
329
333
  /** Header count: current-tab size when idle, matched/searchable when searching. */
330
334
  function templateCountLabel(matched, searchable, searching) {
331
335
  return searching ? `${matched}/${searchable}` : String(matched);
@@ -822,7 +826,7 @@ window.__ModuleLoader__.load({
822
826
  * @param props - target session, shared verbs, locale, optional title-row takeover.
823
827
  */
824
828
  function TemplateLibrary({ sessionId, face, t, header, headerExtra }) {
825
- const { refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes } = face;
829
+ const { refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes } = face;
826
830
  const [templates, setTemplates] = (0, react.useState)([]);
827
831
  const [categories, setCategories] = (0, react.useState)([]);
828
832
  const [showAdd, setShowAdd] = (0, react.useState)(false);
@@ -905,6 +909,16 @@ window.__ModuleLoader__.load({
905
909
  (0, react.useEffect)(() => {
906
910
  setEventsOpen(false);
907
911
  }, [sessionId]);
912
+ const handleToggleMaster = (0, react.useCallback)(async () => {
913
+ if (policies === null) return;
914
+ const result = await setEventMaster(!policies.enabled);
915
+ if (result.ok) loadPolicies();
916
+ else setRowError(result.error.message);
917
+ }, [
918
+ policies,
919
+ setEventMaster,
920
+ loadPolicies
921
+ ]);
908
922
  const handleToggleRule = (0, react.useCallback)(async (rule) => {
909
923
  const result = await updateEventPolicy(rule.rule_id, { enabled: !rule.enabled });
910
924
  if (result.ok) loadPolicies();
@@ -1359,7 +1373,18 @@ window.__ModuleLoader__.load({
1359
1373
  }),
1360
1374
  (0, react_jsx_runtime.jsx)("div", {
1361
1375
  className: policies !== null && policies.enabled ? Panel_module_css_default.eventsBanner : `${Panel_module_css_default.eventsBanner} ${Panel_module_css_default.eventsBannerOff}`,
1362
- children: policies === null ? t("panel.eventsLoadFailed") : policies.enabled ? t("panel.eventsMasterOn") : t("panel.eventsMasterOff")
1376
+ children: (0, react_jsx_runtime.jsxs)("label", {
1377
+ className: Panel_module_css_default.eventsRuleHead,
1378
+ children: [(0, react_jsx_runtime.jsx)("input", {
1379
+ type: "checkbox",
1380
+ className: Panel_module_css_default.eventsToggle,
1381
+ checked: policies?.enabled === true,
1382
+ disabled: policies === null,
1383
+ onChange: () => {
1384
+ handleToggleMaster();
1385
+ }
1386
+ }), (0, react_jsx_runtime.jsx)("span", { children: policies === null ? t("panel.eventsLoadFailed") : policies.enabled ? t("panel.eventsMasterOn") : t("panel.eventsMasterOff") })]
1387
+ })
1363
1388
  }),
1364
1389
  (policies?.items ?? []).map((rule) => (0, react_jsx_runtime.jsxs)("div", {
1365
1390
  className: Panel_module_css_default.eventsRule,
@@ -1642,7 +1667,7 @@ window.__ModuleLoader__.load({
1642
1667
  * @param props - runtime kit, injected face members, store handle, and locale.
1643
1668
  */
1644
1669
  function PromptPanel(props) {
1645
- const { useStore, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes, targetSession, targetVersion, subscribeTarget, panelPosition, savePanelPosition, resetPanelPosition, actions, t } = props;
1670
+ const { useStore, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes, targetSession, targetVersion, subscribeTarget, panelPosition, savePanelPosition, resetPanelPosition, actions, t } = props;
1646
1671
  const open = useStore((s) => s.open);
1647
1672
  (0, react.useSyncExternalStore)(subscribeTarget, targetVersion);
1648
1673
  const sessionId = targetSession() ?? null;
@@ -1711,6 +1736,7 @@ window.__ModuleLoader__.load({
1711
1736
  injectStatus,
1712
1737
  injectionHistory,
1713
1738
  eventPolicies,
1739
+ setEventMaster,
1714
1740
  updateEventPolicy,
1715
1741
  eventEpisodes
1716
1742
  };
@@ -1801,7 +1827,7 @@ window.__ModuleLoader__.load({
1801
1827
  * @param props - runtime kit (carries sessionId), injected face members, locale.
1802
1828
  */
1803
1829
  function PromptTab(props) {
1804
- const { sessionId, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, updateEventPolicy, eventEpisodes, t } = props;
1830
+ const { sessionId, refresh, refreshCategories, createCategory, removeCategory, create, update, remove, makeGlobal, insert, send, interject, injectStatus, injectionHistory, eventPolicies, setEventMaster, updateEventPolicy, eventEpisodes, t } = props;
1805
1831
  return (0, react_jsx_runtime.jsx)("div", {
1806
1832
  className: Panel_module_css_default.tabBody,
1807
1833
  "data-prompt-tab": true,
@@ -1822,6 +1848,7 @@ window.__ModuleLoader__.load({
1822
1848
  injectStatus,
1823
1849
  injectionHistory,
1824
1850
  eventPolicies,
1851
+ setEventMaster,
1825
1852
  updateEventPolicy,
1826
1853
  eventEpisodes
1827
1854
  },
@@ -2149,8 +2176,8 @@ window.__ModuleLoader__.load({
2149
2176
  "panel.modeVisible": "对话流可见",
2150
2177
  "panel.modeHint": "静默:只进模型上下文(对话流不显示,基座设计);可见:以用户消息样式显示在对话流中,带\"⚙️ 定时注入\"标记",
2151
2178
  "panel.eventsTitle": "事件提醒",
2152
- "panel.eventsMasterOn": "总开关:开",
2153
- "panel.eventsMasterOff": "总开关:关(由部署配置 eventInject.enabled 决定,默认关)",
2179
+ "panel.eventsMasterOn": "总开关:开(取消勾选即停用)",
2180
+ "panel.eventsMasterOff": "总开关:关(勾选即启用,即时生效)",
2154
2181
  "panel.eventsLoadFailed": "事件提醒状态不可用",
2155
2182
  "panel.eventsRulePrep": "重复准备",
2156
2183
  "panel.eventsRuleFail": "重复失败",
@@ -2226,8 +2253,8 @@ window.__ModuleLoader__.load({
2226
2253
  "panel.modeVisible": "Visible in chat",
2227
2254
  "panel.modeHint": "Silent: model context only (omitted from the chat transcript by base design); Visible: rendered as a user message in the chat flow, headed by a ⚙️ scheduled-injection marker",
2228
2255
  "panel.eventsTitle": "Event reminders",
2229
- "panel.eventsMasterOn": "Master switch: on",
2230
- "panel.eventsMasterOff": "Master switch: off (deployment config eventInject.enabled, off by default)",
2256
+ "panel.eventsMasterOn": "Master switch: on (untick to disable)",
2257
+ "panel.eventsMasterOff": "Master switch: off (tick to enable, effective immediately)",
2231
2258
  "panel.eventsLoadFailed": "Event reminder state unavailable",
2232
2259
  "panel.eventsRulePrep": "Repeated preparation",
2233
2260
  "panel.eventsRuleFail": "Repeated failure",
@@ -2303,6 +2330,7 @@ window.__ModuleLoader__.load({
2303
2330
  injectStatus,
2304
2331
  injectionHistory,
2305
2332
  eventPolicies,
2333
+ setEventMaster,
2306
2334
  updateEventPolicy,
2307
2335
  eventEpisodes
2308
2336
  };