@deepmaid/maid-gestures 0.0.0-stage → 0.1.0-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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kenyonxu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ # 空 patch 层:本包挂载在 preset 声明树(Q3 拍板,2026-10-28 规格 §2);bundle 层仅承载包身份与面板元数据,toggle 对本包为无操作。
2
+ # 空层以顶层 `[]` 承载(修复轮 2 勘正):comment-only 会 parse 为 null,dsh-app-boot parsePatchList 即 throw,整包进 skippedBundles。
3
+ []
package/lib/index.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ //#region src/config.d.ts
2
+ /**
3
+ * maid-gestures 配置解析(纯函数,任务 2):per-maid gestures.yml 的规范化产物。
4
+ * 风格照 maid-emotion config.ts——yml 键 snake_case 映射到消费面 camelCase;坏条目 warn
5
+ * 跳过整条;id 语法违规跳过;fullness 阈值 0<uneasy<full 违规只跳 fullness 节(手势保留)。
6
+ *
7
+ * 数值护栏(规格 §3,2026-10-09 计划裁定落地差异):本层**只解析数值,不判维度合法性**——
8
+ * deep 维/未声明维由 maid-emotion applyDeltas 的声明维过滤剔除(未声明自然不落账,全被
9
+ * 剔除 → false 零落账 =「数值降级为零」);「不把 deep 维写进 gestures.yml」是配置文档
10
+ * 约定(doris gestures.yml 与女仆诞生清单写明),不建单独 tier 查询面。
11
+ */
12
+ /** 过饱档(可选节):uneasy/full 是 per-session 计数阈值,阈值文案池各一 */
13
+ interface GestureFullnessConfig {
14
+ uneasy: number;
15
+ uneasyFeedback: readonly string[];
16
+ full: number;
17
+ fullFeedback: readonly string[];
18
+ }
19
+ /** 单个签名手势:一个手势 = 一条斜杠命令(name = id)+ 数值增量 + 反馈文案池 */
20
+ interface GestureConfig {
21
+ id: string;
22
+ label: string;
23
+ deltas: Record<string, number>;
24
+ feedback: readonly string[];
25
+ say?: string;
26
+ fullness?: GestureFullnessConfig;
27
+ }
28
+ /** say 注入失败文案缺省(规格 §4 错误处理表;gestures.yml 顶层 say_busy 可覆写) */
29
+ declare const DEFAULT_SAY_BUSY = "她现在正忙着,这句没递进去";
30
+ type Warn = (message: string) => void;
31
+ /**
32
+ * gestures.yml 根文档解析:根非 mapping / gestures 非列表 → warn 后空;未知顶层键 warn
33
+ * (fail-open 但不静默);重复 id 后者 warn 跳过(commands.register 同名二义不进)。
34
+ */
35
+ declare function parseGesturesConfig(raw: unknown, warn: Warn): GestureConfig[];
36
+ /** 顶层 say_busy(say 注入失败文案):缺省 undefined(消费面回退 DEFAULT_SAY_BUSY);坏类型 warn 后 undefined */
37
+ declare function sayBusyOf(raw: unknown, warn: Warn): string | undefined;
38
+ //#endregion
39
+ //#region src/index.d.ts
40
+ declare const name = "maid-gestures";
41
+ /**
42
+ * maid-gestures(签名手势,/feedrice 首实例):per-maid gestures.yml 装配期一次解析,每个手势
43
+ * 注册为一条斜杠命令(name = gesture.id)。preset 行挂载——per-agent 限定由 agent-preset
44
+ * registry 挂 agent scope 承担(任务 3 装配),插件本体只经 ctx.commands.register 注册。
45
+ *
46
+ * 全 fail-open(规格 §4):手势绝不炸会话——maidEmotion 不在/maid 未解析/applyDeltas false
47
+ * → 命令与文案照常,数值跳过 + one-shot warn;say 注入抛错 → error 文案 say_busy(可配,
48
+ * 缺省「她现在正忙着,这句没递进去」)+ 数值不回滚(落账先行,followup 失败不补偿)。
49
+ *
50
+ * 数值护栏(规格 §3,计划裁定落地差异):deltas 原样透传 maidEmotion.applyDeltas——未声明维
51
+ * 由其声明维过滤自然剔除(全剔 → false = 数值降级零);「不写 deep 维」是 gestures.yml 侧
52
+ * 文档约定,不建 tier 查询面(服务面 stateOf 不暴露 tier,任务 1 第四例已锁 deep 维放行)。
53
+ *
54
+ * 缓存纪律(铁律 3):命令 schema 装配期静态;反馈是 CommandResult 本地渲染,零 system prompt
55
+ * 接触;say 注入是普通 user 消息(goal 命令 followup 同款),与主人手打同构。
56
+ */
57
+ interface MaidGesturesConfig {
58
+ /**
59
+ * gestures.yml 路径:绝对直达;相对 → ctx.baseUrl(preset 组合目录,cordis-plugin-include
60
+ * 设定)优先,无 baseUrl 回退 cwd;缺省 'gestures.yml' 同规则(≈ <presetDir>/gestures.yml)。
61
+ */
62
+ gesturesPath?: string;
63
+ }
64
+ declare const apply: (ctx: any, config: MaidGesturesConfig) => (() => void);
65
+ //#endregion
66
+ export { DEFAULT_SAY_BUSY, type GestureConfig, type GestureFullnessConfig, MaidGesturesConfig, apply, name, parseGesturesConfig, sayBusyOf };