@shgroup/dsh-serenity-hooks 1.34.0 → 1.34.2
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 +1 -0
- package/dsh.plugin.json +1 -1
- package/lib/acp-core.d.ts +2 -22
- package/lib/acp-http.d.ts +8 -0
- package/lib/api.d.ts +12 -4
- package/lib/autopilot-chain.d.ts +76 -0
- package/lib/autopilot-core-DCRkiWEe.js +229 -0
- package/lib/autopilot-core.d.ts +132 -0
- package/lib/autopilot-ops.d.ts +48 -0
- package/lib/autopilot-trajectory-D9Znxo75.js +782 -0
- package/lib/autopilot-trajectory.d.ts +64 -97
- package/lib/ccc-roots-Bd_SjEs7.js +152 -0
- package/lib/ccc-roots.d.ts +105 -0
- package/lib/ccc.d.ts +3 -6
- package/lib/client.js +2 -2
- package/lib/clock-runtime.d.ts +197 -0
- package/lib/config-ops.d.ts +9 -14
- package/lib/constants.d.ts +0 -2
- package/lib/container-status.d.ts +183 -0
- package/lib/diag-ops.d.ts +25 -10
- package/lib/face-host.d.ts +110 -0
- package/lib/fs-ops.d.ts +3 -2
- package/lib/gateway-auth.d.ts +2 -5
- package/lib/gateway.d.ts +0 -34
- package/lib/git-ops.d.ts +3 -2
- package/lib/handyman-ops.d.ts +3 -2
- package/lib/handyman-preset-inherit.d.ts +2 -1
- package/lib/host/access.d.ts +8 -7
- package/lib/host/contract.d.ts +29 -6
- package/lib/host/type-contract.d.ts +1 -2
- package/lib/im-bridge.d.ts +6 -5
- package/lib/index.js +8336 -5607
- package/lib/invariant.d.ts +0 -15
- package/lib/invariant.js +1 -1
- package/lib/kit-ops.d.ts +11 -31
- package/lib/localstore-ops.d.ts +3 -17
- package/lib/msm-ops.d.ts +34 -52
- package/lib/opencode-provider.d.ts +4 -5
- package/lib/output-guard-seam.d.ts +0 -3
- package/lib/output-guard.d.ts +12 -3
- package/lib/ports.d.ts +59 -0
- package/lib/rebuild.d.ts +1 -1
- package/lib/seams/bootstrap.d.ts +4 -3
- package/lib/seams/compact.d.ts +2 -1
- package/lib/seams/context.d.ts +2 -4
- package/lib/seams/env.d.ts +2 -1
- package/lib/seams/guards.d.ts +4 -43
- package/lib/seams/keeper.d.ts +1 -1
- package/lib/seams/system-prompt.d.ts +1 -5
- package/lib/session-cleanup.d.ts +3 -2
- package/lib/{settings-section-BuPGQv_H.js → settings-section-DTYZjwUs.js} +65 -9
- package/lib/settings-section.d.ts +3 -31
- package/lib/skiff-core.d.ts +4 -9
- package/lib/skiff-debug.d.ts +15 -21
- package/lib/skiff-registry-FTjoWQTQ.js +25 -0
- package/lib/skiff-registry.d.ts +2 -1
- package/lib/{skiff-role-DAfPb6YQ.js → skiff-role-CEHL5cek.js} +1 -1
- package/lib/skiff-role.d.ts +2 -2
- package/lib/skills/opencode-scan.d.ts +3 -2
- package/lib/skills-discovery.d.ts +15 -2
- package/lib/status.d.ts +2 -1
- package/lib/tools/cce.d.ts +1 -2
- package/lib/tools/container-admin.d.ts +7 -3
- package/lib/tools/eap.d.ts +2 -3
- package/lib/tools/handyman.d.ts +0 -29
- package/lib/tools/msm.d.ts +0 -4
- package/lib/tools/neat.d.ts +1 -2
- package/lib/tools/praxis.d.ts +0 -1
- package/lib/tools/skiff-admin.d.ts +2 -2
- package/lib/tools/trajectory.d.ts +7 -15
- package/lib/totp.d.ts +0 -4
- package/lib/trajectory-assistant.d.ts +2 -1
- package/lib/trajectory-bound-Cax1p9ut.js +190 -0
- package/lib/trajectory-bound.d.ts +3 -4
- package/lib/{trajectory-bound-C8DUxi6_.js → trajectory-ops-mrXK0H0I.js} +2 -159
- package/lib/trajectory-ops.d.ts +4 -9
- package/lib/trajectory-skills.d.ts +71 -0
- package/lib/{wake-registry-D0Vj0WXb.js → wake-registry-CYxIb484.js} +7 -20
- package/lib/wake-registry.d.ts +3 -11
- package/lib/wake-scheduler.d.ts +13 -49
- package/lib/web-fetch-provider.d.ts +0 -21
- package/lib/{weixin-api-PjEhmjlZ.js → weixin-api-CtFYm53S.js} +3 -9
- package/lib/weixin-api.d.ts +6 -37
- package/lib/weixin-bridge.d.ts +5 -24
- package/lib/weixin-hook.d.ts +6 -12
- package/lib/weixin-output-guard.d.ts +2 -1
- package/lib/{weixin-route-D1ND823E.js → weixin-route-B2ajFypI.js} +4 -5
- package/lib/weixin-route.d.ts +0 -2
- package/lib/weixin-send-api.d.ts +15 -6
- package/package.json +2 -4
- package/experiments/autopilot-trajectory/SKILL.md +0 -115
- package/experiments/autopilot-trajectory/scripts/autopilot-trajectory.ts +0 -546
- package/lib/autopilot-script.d.ts +0 -40
- package/lib/skiff-debug-D83-Njy7.js +0 -2867
- package/lib/{ccc-eu_IPF94.js → ccc-NlLr_sxy.js} +1 -1
- package/lib/{session-cleanup-CMT4mHWt.js → session-cleanup-B6IHZgww.js} +1 -1
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
27
27
|
import type { Context } from 'cordis';
|
|
28
|
-
/** 读取 persona 彩蛋配置(plugin 全局;未配置 → mode='' 彩蛋关闭) */
|
|
29
|
-
export declare function readPersonaSettings(): {
|
|
30
|
-
mode: string;
|
|
31
|
-
overrideText: string;
|
|
32
|
-
};
|
|
33
28
|
/** 1) 身份块:ACC 身份 + CCC 名 + 平台工具说明(需求③ S142:工具清单移出为独立 toolsBlock 放装配末尾——身份先行、工具参考殿后) */
|
|
34
29
|
export declare function identityBlock(root: string): string;
|
|
35
30
|
/**
|
|
@@ -130,3 +125,4 @@ export declare function codeModeAdaptationLine(ctx: Context, scope?: unknown): s
|
|
|
130
125
|
*/
|
|
131
126
|
export declare function registerEntrySkillSectionGlobal(ctx: Context): void;
|
|
132
127
|
export declare function registerEntrySkillSection(agent: Agent, root: string): boolean;
|
|
128
|
+
export declare function registerTrajectorySkillSection(agent: Agent, root: string): boolean;
|
package/lib/session-cleanup.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/** DSH 会话 root:env DSH_HOME → ~/.dsh(config-ops globalConfigPath 同款推导) */
|
|
20
20
|
export declare function sessionsRootDir(): string;
|
|
21
21
|
/** 一个候选会话(删除前预览信息) */
|
|
22
|
-
|
|
22
|
+
interface CandidateSession {
|
|
23
23
|
/** 会话 id(目录名) */
|
|
24
24
|
id: string;
|
|
25
25
|
/** 项目目录(父目录名,如 --home-yh-home-home-serenity--) */
|
|
@@ -55,7 +55,7 @@ export declare function sessionLogArtifacts(sessionDirPath: string): Array<{
|
|
|
55
55
|
*/
|
|
56
56
|
export declare function findSessionLog(sessionDirPath: string): string | null;
|
|
57
57
|
/** 删除执行结果 */
|
|
58
|
-
|
|
58
|
+
interface CleanupResult {
|
|
59
59
|
deleted: string[];
|
|
60
60
|
/** 尝试删除但失败的会话目录(权限/竞态) */
|
|
61
61
|
errors: Array<{
|
|
@@ -75,3 +75,4 @@ export declare function performCleanup(root: string, cutoffMs: number, liveIds?:
|
|
|
75
75
|
};
|
|
76
76
|
/** 便捷:默认 N 天前为 cutoff(供 API/调用方) */
|
|
77
77
|
export declare function cutoffDaysAgo(days: number, nowMs?: number): number;
|
|
78
|
+
export {};
|
|
@@ -1,14 +1,70 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { a as hostSettings } from "./access-fiehjxV6.js";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
|
+
//#region src/ports.ts
|
|
5
|
+
/**
|
|
6
|
+
* 集中端口表。
|
|
7
|
+
* A=宿主主面(插件不监听)/ B=网关(可配,默认关)/ C=微信发送(默认开,仅 loopback)
|
|
8
|
+
* / D=Skiff 调试(默认关)/ E=ACP+问答(默认关)。
|
|
9
|
+
*/
|
|
10
|
+
const FACE_PORTS = {
|
|
11
|
+
main: {
|
|
12
|
+
port: 3080,
|
|
13
|
+
host: null,
|
|
14
|
+
defaultEnabled: true,
|
|
15
|
+
meaning: "宿主 DSH 主 WebUI + 插件 /serenity/* 路由面(**插件不起此 listener**,端口自宿主读)"
|
|
16
|
+
},
|
|
17
|
+
gateway: {
|
|
18
|
+
port: 3081,
|
|
19
|
+
host: "0.0.0.0",
|
|
20
|
+
defaultEnabled: false,
|
|
21
|
+
meaning: "双端口网关(外部登录 + 全量反代宿主主面;host/port 走 plugin 全局配置)"
|
|
22
|
+
},
|
|
23
|
+
weixinSend: {
|
|
24
|
+
port: 3082,
|
|
25
|
+
host: "127.0.0.1",
|
|
26
|
+
defaultEnabled: true,
|
|
27
|
+
meaning: "微信主动发送面(容器外进程 → POST /send;与 3080 显式解耦,不经网关)"
|
|
28
|
+
},
|
|
29
|
+
skiffDebug: {
|
|
30
|
+
port: 3099,
|
|
31
|
+
host: "127.0.0.1",
|
|
32
|
+
defaultEnabled: false,
|
|
33
|
+
meaning: "Skiff 调试问答面(人工调试子角色;无认证,仅靠 loopback)"
|
|
34
|
+
},
|
|
35
|
+
acpHttp: {
|
|
36
|
+
port: 3100,
|
|
37
|
+
host: "127.0.0.1",
|
|
38
|
+
defaultEnabled: false,
|
|
39
|
+
meaning: "ACP JSON-RPC + 对外问答面(外部程序 + key 认证的问答页共用一 listener)"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** 宿主主 WebUI 端口(面 A:插件**不监听**,只读取;`readWebPort` 的回退值) */
|
|
43
|
+
const MAIN_WEB_PORT = FACE_PORTS.main.port;
|
|
44
|
+
/** 网关端口默认值(面 B) */
|
|
45
|
+
const GATEWAY_PORT = FACE_PORTS.gateway.port;
|
|
46
|
+
/** 微信主动发送端口默认值(面 C) */
|
|
47
|
+
const WEIXIN_SEND_PORT = FACE_PORTS.weixinSend.port;
|
|
48
|
+
/** Skiff 调试页端口默认值(面 D) */
|
|
49
|
+
const SKIFF_DEBUG_PORT = FACE_PORTS.skiffDebug.port;
|
|
50
|
+
/** ACP / 对外问答端口默认值(面 E) */
|
|
51
|
+
const ACP_HTTP_PORT = FACE_PORTS.acpHttp.port;
|
|
52
|
+
/**
|
|
53
|
+
* **机制端口**词表(output-guard 用:agent 在**用户可见输出**里提及内部端口即打回)。
|
|
54
|
+
*
|
|
55
|
+
* 由 {@link FACE_PORTS} 机械派生 ⇒ 与面清单**永不漂移**。
|
|
56
|
+
* ⚠️ 修复记录(C4 块 B,2026-09-15):旧常量硬写 `['3080','3081','3099','3100']`
|
|
57
|
+
* ——**漏 3082**(微信发送面,默认开)⇒ 守卫拦不住"3082"这类提及。现由表派生,五面齐全。
|
|
58
|
+
*/
|
|
59
|
+
const MECHANISM_PORTS = Object.keys(FACE_PORTS).map((id) => String(FACE_PORTS[id].port));
|
|
60
|
+
//#endregion
|
|
4
61
|
//#region src/settings-section.ts
|
|
5
62
|
var settings_section_exports = /* @__PURE__ */ __exportAll({
|
|
6
63
|
SERENITY_SETTINGS_NS: () => SERENITY_SETTINGS_NS,
|
|
7
64
|
defaultSimpleSettings: () => defaultSimpleSettings,
|
|
8
65
|
entryDefaults: () => entryDefaults,
|
|
9
66
|
readSimpleSettings: () => readSimpleSettings,
|
|
10
|
-
registerSettingsSection: () => registerSettingsSection
|
|
11
|
-
simpleSettingsSchema: () => simpleSettingsSchema
|
|
67
|
+
registerSettingsSection: () => registerSettingsSection
|
|
12
68
|
});
|
|
13
69
|
/** 简单配置命名空间(dsh 设置面板的 section id / settings.yaml section) */
|
|
14
70
|
const SERENITY_SETTINGS_NS = "serenity-hooks";
|
|
@@ -18,9 +74,9 @@ const simpleSettingsSchema = z.object({
|
|
|
18
74
|
rebuildEnabled: z.boolean().default(true),
|
|
19
75
|
rebuildThresholdK: z.number().min(50).max(4e3).default(400),
|
|
20
76
|
skiffEnabled: z.boolean().default(false),
|
|
21
|
-
skiffDebugPort: z.number().min(1024).max(65535).default(
|
|
77
|
+
skiffDebugPort: z.number().min(1024).max(65535).default(SKIFF_DEBUG_PORT),
|
|
22
78
|
acpEnabled: z.boolean().default(false),
|
|
23
|
-
acpHttpPort: z.number().min(1024).max(65535).default(
|
|
79
|
+
acpHttpPort: z.number().min(1024).max(65535).default(ACP_HTTP_PORT),
|
|
24
80
|
publicAskEnabled: z.boolean().default(false),
|
|
25
81
|
autopilotWakeEnabled: z.boolean().required(false),
|
|
26
82
|
autopilotEnabled: z.boolean().required(false),
|
|
@@ -33,9 +89,9 @@ function entryDefaults(config) {
|
|
|
33
89
|
rebuildEnabled: config.rebuild?.enabled ?? true,
|
|
34
90
|
rebuildThresholdK: config.rebuild?.thresholdK ?? 400,
|
|
35
91
|
skiffEnabled: config.skiff?.enabled ?? false,
|
|
36
|
-
skiffDebugPort: config.skiff?.debugPort ??
|
|
92
|
+
skiffDebugPort: config.skiff?.debugPort ?? SKIFF_DEBUG_PORT,
|
|
37
93
|
acpEnabled: config.acp?.enabled ?? false,
|
|
38
|
-
acpHttpPort: config.acp?.httpPort ??
|
|
94
|
+
acpHttpPort: config.acp?.httpPort ?? ACP_HTTP_PORT,
|
|
39
95
|
publicAskEnabled: config.publicAsk?.enabled ?? false,
|
|
40
96
|
wakeSchedulerEnabled: true
|
|
41
97
|
};
|
|
@@ -51,9 +107,9 @@ function defaultSimpleSettings() {
|
|
|
51
107
|
rebuildEnabled: true,
|
|
52
108
|
rebuildThresholdK: 400,
|
|
53
109
|
skiffEnabled: false,
|
|
54
|
-
skiffDebugPort:
|
|
110
|
+
skiffDebugPort: SKIFF_DEBUG_PORT,
|
|
55
111
|
acpEnabled: false,
|
|
56
|
-
acpHttpPort:
|
|
112
|
+
acpHttpPort: ACP_HTTP_PORT,
|
|
57
113
|
publicAskEnabled: false,
|
|
58
114
|
wakeSchedulerEnabled: true
|
|
59
115
|
};
|
|
@@ -97,4 +153,4 @@ function registerSettingsSection(ctx, config) {
|
|
|
97
153
|
hooks.onChange();
|
|
98
154
|
}
|
|
99
155
|
//#endregion
|
|
100
|
-
export { registerSettingsSection as n, settings_section_exports as r, readSimpleSettings as t };
|
|
156
|
+
export { FACE_PORTS as a, MECHANISM_PORTS as c, ACP_HTTP_PORT as i, SKIFF_DEBUG_PORT as l, registerSettingsSection as n, GATEWAY_PORT as o, settings_section_exports as r, MAIN_WEB_PORT as s, readSimpleSettings as t, WEIXIN_SEND_PORT as u };
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
* 则显示降级提示(引导去宁静号面板),在则渲染 schema 表单。零配置自动适配。
|
|
17
17
|
*/
|
|
18
18
|
import type { Context } from 'cordis';
|
|
19
|
-
import z from '@deepseek-ai/schemastery';
|
|
20
19
|
/** 插件 Config 的简单配置片段(index.ts Config 组合;settings entry base) */
|
|
21
|
-
|
|
20
|
+
interface SimpleConfigFragment {
|
|
22
21
|
gateway?: {
|
|
23
22
|
enabled?: boolean;
|
|
24
23
|
};
|
|
@@ -47,7 +46,7 @@ export declare const SERENITY_SETTINGS_NS = "serenity-hooks";
|
|
|
47
46
|
* 简单配置 schema(schemastery):三功能总开关 + F2 阈值 + F4 Skiff 启停。
|
|
48
47
|
* 与 DSH settings 的 schema 语义一致(z.object 布尔/数字)。
|
|
49
48
|
*/
|
|
50
|
-
|
|
49
|
+
interface SerenitySimpleSettings {
|
|
51
50
|
/** F1 双端口网关总开关 */
|
|
52
51
|
gatewayEnabled: boolean;
|
|
53
52
|
/** F2 超限重建总开关 */
|
|
@@ -76,36 +75,8 @@ export interface SerenitySimpleSettings {
|
|
|
76
75
|
* ——用户 2026-09-15 裁决:「auto-trajectory 的开关只关闭 auto-trajectory 唤醒」。 */
|
|
77
76
|
wakeSchedulerEnabled: boolean;
|
|
78
77
|
}
|
|
79
|
-
/** schemastery schema(与 DSH 各插件 Config 同款) */
|
|
80
|
-
export declare const simpleSettingsSchema: z<Schemastery.ObjectS<{
|
|
81
|
-
gatewayEnabled: z<boolean, boolean>;
|
|
82
|
-
rebuildEnabled: z<boolean, boolean>;
|
|
83
|
-
rebuildThresholdK: z<number, number>;
|
|
84
|
-
skiffEnabled: z<boolean, boolean>;
|
|
85
|
-
skiffDebugPort: z<number, number>;
|
|
86
|
-
acpEnabled: z<boolean, boolean>;
|
|
87
|
-
acpHttpPort: z<number, number>;
|
|
88
|
-
publicAskEnabled: z<boolean, boolean>;
|
|
89
|
-
autopilotWakeEnabled: z<boolean, boolean>;
|
|
90
|
-
autopilotEnabled: z<boolean, boolean>;
|
|
91
|
-
wakeSchedulerEnabled: z<boolean, boolean>;
|
|
92
|
-
}>, Schemastery.ObjectT<{
|
|
93
|
-
gatewayEnabled: z<boolean, boolean>;
|
|
94
|
-
rebuildEnabled: z<boolean, boolean>;
|
|
95
|
-
rebuildThresholdK: z<number, number>;
|
|
96
|
-
skiffEnabled: z<boolean, boolean>;
|
|
97
|
-
skiffDebugPort: z<number, number>;
|
|
98
|
-
acpEnabled: z<boolean, boolean>;
|
|
99
|
-
acpHttpPort: z<number, number>;
|
|
100
|
-
publicAskEnabled: z<boolean, boolean>;
|
|
101
|
-
autopilotWakeEnabled: z<boolean, boolean>;
|
|
102
|
-
autopilotEnabled: z<boolean, boolean>;
|
|
103
|
-
wakeSchedulerEnabled: z<boolean, boolean>;
|
|
104
|
-
}>>;
|
|
105
78
|
/** 从插件 Config 提取 entry 默认(settings base 层) */
|
|
106
79
|
export declare function entryDefaults(config: SimpleConfigFragment): SerenitySimpleSettings;
|
|
107
|
-
/** 测试辅助:重置"缺 settings provider"告警去重(生产零调用) */
|
|
108
|
-
export declare function __resetSettingsWarningsForTest(): void;
|
|
109
80
|
/** 进程级默认(无 settings 服务时的兜底) */
|
|
110
81
|
export declare function defaultSimpleSettings(): SerenitySimpleSettings;
|
|
111
82
|
/**
|
|
@@ -127,3 +98,4 @@ export declare function __setSimpleSourceForTest(source: (() => SerenitySimpleSe
|
|
|
127
98
|
* (owner = consumer 插件 ctx;ns 直接字符串)。
|
|
128
99
|
*/
|
|
129
100
|
export declare function registerSettingsSection(ctx: Context, config: SimpleConfigFragment): void;
|
|
101
|
+
export {};
|
package/lib/skiff-core.d.ts
CHANGED
|
@@ -81,13 +81,7 @@ export declare function ensureWorkspacePromptSection(agent: Agent, scope: string
|
|
|
81
81
|
* @returns 绑定后的 SESSION.md 绝对路径(供提示词注入);不适用/失败 → null
|
|
82
82
|
*/
|
|
83
83
|
export declare function ensureSkiffSession(root: string, agent: Agent, roleName: string, role: SkiffRoleConfig, persistent?: boolean): string | null;
|
|
84
|
-
|
|
85
|
-
export declare function skiffSessionActiveFor(sessionId: string): {
|
|
86
|
-
sessionId: string;
|
|
87
|
-
dirName: string;
|
|
88
|
-
mdPath: string;
|
|
89
|
-
} | null;
|
|
90
|
-
export interface SkiffAgentRef {
|
|
84
|
+
interface SkiffAgentRef {
|
|
91
85
|
handle: AgentHandle;
|
|
92
86
|
agent: Agent;
|
|
93
87
|
sessionId: string;
|
|
@@ -114,7 +108,7 @@ export interface SkiffTrajectoryEntry {
|
|
|
114
108
|
/** assistant 的工具调用名(有则填) */
|
|
115
109
|
tool?: string;
|
|
116
110
|
}
|
|
117
|
-
|
|
111
|
+
interface SkiffAskResult {
|
|
118
112
|
answer: string;
|
|
119
113
|
sessionId: string;
|
|
120
114
|
trajectory: SkiffTrajectoryEntry[];
|
|
@@ -135,7 +129,7 @@ export declare function askSkiff(ctx: Context, agent: Agent, question: string, e
|
|
|
135
129
|
* 注册表缺失(进程重启遗留等)→ 保守旁路(false,完全独立)。
|
|
136
130
|
*/
|
|
137
131
|
export declare function skiffTrajectoryEnabled(root: string, sessionId: string | undefined, key: 'session' | 'keeper' | 'rebuild'): boolean;
|
|
138
|
-
|
|
132
|
+
interface SkiffMsmGate {
|
|
139
133
|
/** 拒绝原因(有则拒绝执行) */
|
|
140
134
|
reject?: string;
|
|
141
135
|
/** list 显示白名单(msms);仅 action==='list' 时有值 */
|
|
@@ -147,3 +141,4 @@ export interface SkiffMsmGate {
|
|
|
147
141
|
* list 白名单过滤、check/guide/ccc-config 只读放行。
|
|
148
142
|
*/
|
|
149
143
|
export declare function skiffMsmGate(root: string, sessionId: string | undefined, action: string, name?: string): SkiffMsmGate;
|
|
144
|
+
export {};
|
package/lib/skiff-debug.d.ts
CHANGED
|
@@ -18,30 +18,19 @@
|
|
|
18
18
|
* 实验性质:未开启时零资源占用(无监听、无 agent 创建)。
|
|
19
19
|
*/
|
|
20
20
|
import type { Context } from 'cordis';
|
|
21
|
-
import { type
|
|
21
|
+
import { type CccEntry } from './ccc-roots.js';
|
|
22
|
+
import { type FaceSpec } from './face-host.js';
|
|
22
23
|
export declare function skiffDebugActive(): boolean;
|
|
23
24
|
export declare function skiffDebugPort(): number | null;
|
|
24
|
-
/** 候选 CCC 条目(调试页 CCC 切换器数据) */
|
|
25
|
-
export interface SkiffCccEntry {
|
|
26
|
-
/** CCC 根(绝对路径) */
|
|
27
|
-
root: string;
|
|
28
|
-
/** 目录名(展示用) */
|
|
29
|
-
name: string;
|
|
30
|
-
/** 该 CCC 的 skiff 角色名列表(实时读取) */
|
|
31
|
-
roles: string[];
|
|
32
|
-
}
|
|
33
25
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* 用户实测 workspaceRegistry 拉取仍空时兜底)
|
|
39
|
-
* ③ live 会话兜底
|
|
40
|
-
* ④ 默认绑定 root 兜底(不在列表时放首位)
|
|
26
|
+
* 候选 CCC 条目(调试页 CCC 切换器数据)。
|
|
27
|
+
*
|
|
28
|
+
* C2:定义已迁至 `ccc-roots.ts`(L2 枚举的唯一真相源)——此处只在**类型层**转出
|
|
29
|
+
* (零运行时重导出,避免把 `ccc-roots` 拉进本模块的运行时静态链)。
|
|
41
30
|
*/
|
|
42
|
-
export
|
|
31
|
+
export type { CccEntry };
|
|
43
32
|
/** 问答页 HTML:CCC 切换器 + 角色下拉 + 输入 + 答案区 + 轨迹区(JS 渲染)+ WebUI 链接 */
|
|
44
|
-
export declare function skiffDebugPage(cccs:
|
|
33
|
+
export declare function skiffDebugPage(cccs: CccEntry[], defaultRoot: string, webPort: number): string;
|
|
45
34
|
/**
|
|
46
35
|
* JSC (Safari/iOS) JSON.parse 快速路径正则兼容化(v1.26.9,S142 调研定稿)。
|
|
47
36
|
*
|
|
@@ -76,6 +65,11 @@ export declare function renderSkiffMarkdown(raw: string, hideThink?: boolean): s
|
|
|
76
65
|
* 未闭合 think 优雅截断。适用于纯文本输出面(微信等不支持 think 折叠的通道)。
|
|
77
66
|
*/
|
|
78
67
|
export declare function stripThink(raw: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* 本面的规格(C4 块 A/④:**只提供** name/port/host/enabled/handler)。
|
|
70
|
+
* 路由/鉴权/HTML 全部仍归本模块的 {@link handle}(面宿主不介入面语义)。
|
|
71
|
+
*/
|
|
72
|
+
export declare function skiffDebugSpec(ctx: Context, root: string, port: number, webPort: number): FaceSpec;
|
|
79
73
|
/**
|
|
80
74
|
* 启动调试问答服务(单实例;重复启动幂等返回既有实例)。
|
|
81
75
|
*
|
|
@@ -83,11 +77,11 @@ export declare function stripThink(raw: string): string;
|
|
|
83
77
|
* 解析:live 会话中**含 skiff.roles 的 CCC 优先**);v1.25.4 起页面可**手工切换**到
|
|
84
78
|
* 其它候选 CCC(live 会话发现的全部 CCC);角色配置**每次请求实时读取**(不缓存快照)。
|
|
85
79
|
*
|
|
80
|
+
* C4 块 A:listener 的创建/监听/错误/端口占用/关闭归 `face-host`(本函数只提供规格 + 记日志)。
|
|
81
|
+
*
|
|
86
82
|
* @param root 默认绑定的 CCC 根(首次加载选中;角色配置读取 + skiff agent cwd)
|
|
87
83
|
* @param port 调试端口(仅 127.0.0.1)
|
|
88
84
|
* @param webPort 主 WebUI 端口(WebUI 链接)
|
|
89
85
|
*/
|
|
90
86
|
export declare function startSkiffDebugServer(ctx: Context, root: string, port: number, webPort: number): Promise<void>;
|
|
91
87
|
export declare function stopSkiffDebugServer(): void;
|
|
92
|
-
/** 导出类型引用(测试断言轨迹结构) */
|
|
93
|
-
export type { SkiffTrajectoryEntry };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/skiff-registry.ts
|
|
2
|
+
const skiffSessions = /* @__PURE__ */ new Map();
|
|
3
|
+
/** 查 sessionId 的 Skiff 角色名(无 → null)——向后兼容(guards/seams 依赖) */
|
|
4
|
+
function skiffRoleFor(sessionId) {
|
|
5
|
+
return skiffSessions.get(sessionId)?.role ?? null;
|
|
6
|
+
}
|
|
7
|
+
/** 查 sessionId 的完整绑定(role + ccc;无 → null)——v1.25.10 会话追问校验 */
|
|
8
|
+
function skiffSessionInfo(sessionId) {
|
|
9
|
+
return skiffSessions.get(sessionId) ?? null;
|
|
10
|
+
}
|
|
11
|
+
function registerSkiffSession(sessionId, role, ccc) {
|
|
12
|
+
skiffSessions.set(sessionId, {
|
|
13
|
+
role,
|
|
14
|
+
ccc
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function unregisterSkiffSession(sessionId) {
|
|
18
|
+
skiffSessions.delete(sessionId);
|
|
19
|
+
}
|
|
20
|
+
/** 测试/调试:注册表快照(sessionId → {role, ccc}) */
|
|
21
|
+
function skiffSessionSnapshot() {
|
|
22
|
+
return new Map(skiffSessions);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { unregisterSkiffSession as a, skiffSessionSnapshot as i, skiffRoleFor as n, skiffSessionInfo as r, registerSkiffSession as t };
|
package/lib/skiff-registry.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* 生命周期:进程内存态;连接/页面关闭时 unregister;进程重启自然清空(skiff 会话不复存在)。
|
|
12
12
|
*/
|
|
13
13
|
/** 注册表值:会话绑定的角色 + CCC 根(追问延续校验用) */
|
|
14
|
-
|
|
14
|
+
interface SkiffSessionBinding {
|
|
15
15
|
role: string;
|
|
16
16
|
ccc: string;
|
|
17
17
|
}
|
|
@@ -23,3 +23,4 @@ export declare function registerSkiffSession(sessionId: string, role: string, cc
|
|
|
23
23
|
export declare function unregisterSkiffSession(sessionId: string): void;
|
|
24
24
|
/** 测试/调试:注册表快照(sessionId → {role, ccc}) */
|
|
25
25
|
export declare function skiffSessionSnapshot(): ReadonlyMap<string, SkiffSessionBinding>;
|
|
26
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { h as resolveInside, m as readUtf8, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-
|
|
2
|
+
import { h as resolveInside, m as readUtf8, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS } from "./ccc-NlLr_sxy.js";
|
|
3
3
|
import { existsSync, statSync } from "node:fs";
|
|
4
4
|
//#region src/skiff-role.ts
|
|
5
5
|
/**
|
package/lib/skiff-role.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare function isSkiffSessionId(sessionId: string | undefined): boolean
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function readSkiffRoles(root: string, paths?: string[]): Map<string, SkiffRoleConfig>;
|
|
22
22
|
/** 某角色的轨迹纪律子集(缺省全 false = 完全独立) */
|
|
23
|
-
|
|
23
|
+
interface SkiffTrajectorySubset {
|
|
24
24
|
session: boolean;
|
|
25
25
|
keeper: boolean;
|
|
26
26
|
rebuild: boolean;
|
|
@@ -49,7 +49,7 @@ export declare function systemPromptSource(role: SkiffRoleConfig | undefined): '
|
|
|
49
49
|
* - 缺省 = 隐式推断:调用方给出**稳定 sessionId** → persistent;否则 temporary
|
|
50
50
|
* (存量配置零迁移;微信桥传固定会话 id → persistent,ACP/调试页随机 id → temporary)
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
type SkiffKind = 'temporary' | 'persistent';
|
|
53
53
|
export declare function resolveSkiffKind(role: SkiffRoleConfig | undefined, hasStableId: boolean): SkiffKind;
|
|
54
54
|
/**
|
|
55
55
|
* 角色提示词**读取器**(v1.30.15,方案 A:长期型热更新)。
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* 兼容 opencode 的 skill 标准:`.opencode/skills/<name>/SKILL.md`
|
|
5
5
|
* (frontmatter: name/description/whenToUse;结构含 references/、scripts/)。
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface OpencodeSkillMeta {
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
10
10
|
whenToUse?: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface OpencodeSkill {
|
|
13
13
|
name: string;
|
|
14
14
|
dir: string;
|
|
15
15
|
meta: OpencodeSkillMeta;
|
|
@@ -25,3 +25,4 @@ export declare function parseFrontmatter(raw: string): {
|
|
|
25
25
|
export declare function listOpencodeSkillDirs(root: string): string[];
|
|
26
26
|
/** 加载一个 opencode skill(frontmatter 解析 + 正文);读失败(EPERM/占用等)返回 null,单目录容错 */
|
|
27
27
|
export declare function loadOpencodeSkill(skillDir: string): OpencodeSkill | null;
|
|
28
|
+
export {};
|
|
@@ -12,14 +12,27 @@
|
|
|
12
12
|
*
|
|
13
13
|
* 任何 CCC 都能自动注入其顶层入口 skill 全文(不硬编码名字)。
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
type EntrySkillSource = 'serenity-marker' | 'pointer' | 'opencode' | 'dsh';
|
|
16
|
+
interface EntrySkill {
|
|
17
17
|
name: string;
|
|
18
18
|
content: string;
|
|
19
19
|
source: EntrySkillSource;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* 防穿越:skill 名必须是简单目录名(拒绝分隔符与 `..`/`.` 路径段)。
|
|
23
|
+
* v1.34.1:导出——轨迹 skill 声明(CCC 数据)的名字也要**先过这一关**才能用于拼路径
|
|
24
|
+
* (规格 `docs/trajectory-skill-injection.md` §3「名字安全(必做)」)。
|
|
25
|
+
*/
|
|
26
|
+
export declare function isSafeSkillName(name: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 按名在两个 skills 根下定位 SKILL.md(`.dsh/skills` 优先,其次 `.opencode/skills`)。
|
|
29
|
+
* v1.34.1:导出——轨迹 skill 注入复用本函数(不新造发现逻辑);不安全名在此**先行拒绝**
|
|
30
|
+
* (返回 null,且不发生任何以该名拼出的 fs 访问)。
|
|
31
|
+
*/
|
|
32
|
+
export declare function findSkillMd(root: string, name: string): string | null;
|
|
21
33
|
/** 发现全部入口技能(原文全量,不截断) */
|
|
22
34
|
export declare function findEntrySkills(root: string): EntrySkill[];
|
|
23
35
|
/** 兼容旧接口:第一个入口(或 null) */
|
|
24
36
|
export declare function findEntrySkill(root: string): EntrySkill | null;
|
|
25
37
|
export declare function truncateContent(content: string, maxChars: number): string;
|
|
38
|
+
export {};
|
package/lib/status.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 依次尝试 npm_config_prefix / APPDATA\npm / ~/.npm-global。
|
|
11
11
|
*/
|
|
12
12
|
export declare function readDshVersion(): string | null;
|
|
13
|
-
|
|
13
|
+
interface SerenityStatus {
|
|
14
14
|
root: string | null;
|
|
15
15
|
accVersion: string;
|
|
16
16
|
dshVersion: string | null;
|
|
@@ -36,3 +36,4 @@ export declare function getStatus(cwd: string, configPaths?: string[]): Serenity
|
|
|
36
36
|
export declare function setSafeMode(root: string, on: boolean): {
|
|
37
37
|
on: boolean;
|
|
38
38
|
};
|
|
39
|
+
export {};
|
package/lib/tools/cce.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* cce.ts — CCE
|
|
2
|
+
* cce.ts — CCE 内容源(认知连续性工程;v1.30 三工具合并为 praxis 后只保留内容常量)
|
|
3
3
|
*
|
|
4
4
|
* 内容:认知连续性工程(Cognitive Continuity Engineering)——在有限资源与
|
|
5
5
|
* 不可逆不确定性约束下,维持认知实体身份、可达性与演化能力的工程学科。
|
|
6
6
|
* 来源:home-serenity `.opencode/skills/cce/SKILL.md` + CCE 理论。
|
|
7
7
|
*/
|
|
8
8
|
export declare const CCE_CONTENT = "# CCE \u2014 Cognitive Continuity Engineering\n\n> **Cognitive Continuity Engineering is the engineering discipline of maintaining a cognitive entity's identity, accessibility, and capacity to evolve under the constraints of bounded resources and irreversible uncertainty.**\n> CCE does not optimize cognition. It preserves the conditions under which cognition can continue. \u2014 Persistence Engineering, not performance engineering\n\n## Core Propositions\n- **Continuity belongs to the container, not to any individual participant** \u2014 agents come and go, but the CCC's cognitive trajectory persists\n- **Organization must at minimum keep pace with accumulation** \u2014 otherwise operational cognitive entropy (H_op) grows unboundedly and accessibility is lost\n- **Reconstruction over preservation** \u2014 an artifact's value is determined by its ability to let future agents rebuild the original reasoning\n\n## Cognitive Container\nA bounded cognitive space in which cognition can accumulate, reorganize, and evolve. 5 defining properties:\n| Property | Function |\n|----------|----------|\n| Identity | Distinguishes this cognitive system from others |\n| Boundaries | Define what is inside/outside the cognitive space |\n| Persistent Memory | Retains accumulated cognition across time |\n| Operational Constraints | Define which operations are allowed inside the container |\n| Evolutionary History | Records the trajectory of cognitive change, making reconstruction possible |\n\n## Operational Cognitive Entropy (H_op)\nDoes not measure total entropy (not operational); it measures only the **excess cognitive cost** for agents to complete tasks inside the container:\n> H_op(C, t) = cost(task | C, t) \u2212 cost(task | ideal)\nContinuity condition: **H_op(C, t) \u2264 H_critical** \u2014 agents can still complete tasks at reasonable cost\n\n## Continuity Maintenance Condition\n> **\u0394H_org \u2265 \u0394H_in** \u2014 organization must at minimum keep pace with accumulation\n\n## Six-Phase Lifecycle\nExperience \u2192 Accumulation \u2192 Organization \u2192 Abstraction \u2192 Reconstruction \u2192 Evolution \u2192\uFF08loop\uFF09\n| Phase | Engineering Concern |\n|-------|---------------------|\n| Experience | Does input carry enough structure |\n| Accumulation | Is information stored losslessly |\n| Organization | Entropy management \u2014 \u0394H_org offsets \u0394H_in |\n| Abstraction | Is abstraction explicitly encoded |\n| Reconstruction | Can reasoning structure be recovered from artifacts |\n| Evolution | Does evolution stay coherent or introduce drift |\n\n## Relationship with EAP\nEAP answers \"how a piece of knowledge should be structured\" (explicitness E\u2191 / reconstructability R\u2193 / stability S\u2191);\nCCE answers \"how structured knowledge should keep evolving across time without losing coherence\". They complement each other: EAP is static quality, CCE is dynamic persistence.\n\n## Relationship with Serenity\nSerenity's session system, session tracking, and entropy management mechanisms (SQC quality loop) are all engineering implementations of CCE;\nthe behavioral constraints embedded in CCC system prompts come from CCE.";
|
|
9
|
-
export declare const cceTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
* 类比 The Manifest(清单维护——工具注册表)+ Crew(角色管理)+ 机务(配置/手册)。
|
|
12
12
|
*
|
|
13
13
|
* 参数极简(LLM 直觉):domain(管理域)+ action(该域子命令)+ 少量业务参数。
|
|
14
|
+
*
|
|
15
|
+
* v1.34.1(⑥ C6a):由 `export const containerAdminTool` 改为**工厂**
|
|
16
|
+
* `createContainerAdminTool(ctx)`——autopilot 域搬进进程内后,`status` 必须读只有进程内
|
|
17
|
+
* 能看到的事实(全局闸 / live 会话 / agent 可解析性,见 `../autopilot-ops.js`)。
|
|
18
|
+
* 这是本轮唯一为"取 ctx"而做的形态改动(其余域不依赖 ctx,行为不变)。
|
|
14
19
|
*/
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export declare const containerAdminTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
20
|
+
import type { Context } from 'cordis';
|
|
21
|
+
export declare function createContainerAdminTool(ctx: Context): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
package/lib/tools/eap.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* eap.ts — EAP
|
|
2
|
+
* eap.ts — EAP 内容源(认知质量框架;v1.30 三工具合并为 praxis 后只保留内容常量)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 内嵌框架内容(自包含,不依赖已安装技能)。
|
|
5
5
|
*/
|
|
6
6
|
export declare const EAP_CONTENT = "# EAP Cognitive Quality Framework (Explicit Abstraction Principle)\n\n> \"The functional value of a thought is proportional to its external reconstructability.\"\n\n## Three Variables\n| Variable | Meaning | How to improve |\n|----------|---------|----------------|\n| E\u2191 Explicitness | Degree to which variables/entities/relations are clearly defined | Define variables, state relationship direction & cardinality, draw boundaries |\n| R\u2193 Reconstructability | Cost of rebuilding the original reasoning later | Record decision rationale, context, constraints, alternatives |\n| S\u2191 Stability | Degree to which the same input repeatedly produces consistent output | Fix structures, protocolize, avoid relying on implicit context |\n\n## Pre-Output Self-Check Checklist\n- [ ] Variables/entities clearly defined (E\u2191)\n- [ ] Relationships state direction/cardinality (E\u2191)\n- [ ] Boundaries drawn \u2014 what is in scope / what is not (E\u2191)\n- [ ] No ambiguous words: \"handle\" \"optimize\" \"problem\" \u2192 be specific (E\u2191)\n- [ ] Key decisions record rationale and alternatives (R\u2193)\n- [ ] No level-skipping \u2014 align the upper layer before descending (R\u2193)\n- [ ] Structures can be regenerated repeatably (S\u2191)\n\n## Relationship with ACC\nACC (plugin/template) encodes structure as code (E\u2191); generating a CCC from ACC is deterministic (R\u2193); consistent across multiple CCCs (S\u2191).\nCCC (home-serenity etc.) encodes cognitive content as skills/SESSIONs/design docs. Use this checklist to self-check outputs.\n\n## Reference\nhttps://github.com/tellmewhattodo/theory-eap";
|
|
7
|
-
export declare const eapTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
|
package/lib/tools/handyman.d.ts
CHANGED
|
@@ -20,34 +20,5 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
22
22
|
import type { Context } from 'cordis';
|
|
23
|
-
/** 非正常停止时重启 agent 的次数上限(防死循环保险阀):对话轮次有上限,重启有上限 */
|
|
24
|
-
export declare const HANDYMAN_MAX_RESTARTS = 100;
|
|
25
|
-
/** 对话轮次上限(对齐 osp loop-runner 的 round>=100 强制 done 保险阀) */
|
|
26
|
-
export declare const HANDYMAN_MAX_ROUNDS = 100;
|
|
27
|
-
export interface HandymanJob {
|
|
28
|
-
task: string;
|
|
29
|
-
label: string;
|
|
30
|
-
model?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface HandymanJobResult {
|
|
33
|
-
label: string;
|
|
34
|
-
done: boolean;
|
|
35
|
-
rounds: number;
|
|
36
|
-
finishReason: 'done' | 'max_rounds' | 'restart_exceeded';
|
|
37
|
-
restarts: number;
|
|
38
|
-
model: string;
|
|
39
|
-
lastResponse: string;
|
|
40
|
-
progressFile: string;
|
|
41
|
-
}
|
|
42
|
-
/** foreground 模式结果(一次调用一次结果;无循环、无进度文件) */
|
|
43
|
-
export interface HandymanForegroundResult {
|
|
44
|
-
mode: 'foreground';
|
|
45
|
-
done: boolean;
|
|
46
|
-
model: string;
|
|
47
|
-
stopReason: string;
|
|
48
|
-
output: string;
|
|
49
|
-
childId?: string;
|
|
50
|
-
diagnostic?: string;
|
|
51
|
-
}
|
|
52
23
|
/** 创建 handyman 工具(闭包捕获插件 ctx → 可访问 ctx.agents) */
|
|
53
24
|
export declare function createHandymanTool(ctx: Context): ToolDefinition;
|
package/lib/tools/msm.d.ts
CHANGED
|
@@ -15,8 +15,4 @@
|
|
|
15
15
|
* 管理面(register/deregister/check/guide/catalog/ccc-config)已移入 container_admin。
|
|
16
16
|
* 底层 runMsmAsync/prepareExec 全复用;未命中候选为新增 findSuggestions。
|
|
17
17
|
*/
|
|
18
|
-
/** 精简目录(无参调用返回;替代全量 list 的巨输出)——按 skill 分组统计 + 顶部指引 */
|
|
19
|
-
export declare function buildMsmIndex(root: string): string;
|
|
20
|
-
/** 模糊候选:name/description 子串匹配(未精确命中时返回 top-K,供 LLM 下轮选对) */
|
|
21
|
-
export declare function suggestMsm(root: string, query: string, limit?: number): string;
|
|
22
18
|
export declare const msmTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
|
package/lib/tools/neat.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* neat.ts — Neat
|
|
2
|
+
* neat.ts — Neat 内容源(设计协作协议;v1.30 三工具合并为 praxis 后只保留内容常量)
|
|
3
3
|
*/
|
|
4
4
|
export declare const NEAT_CONTENT = "# Neat Design Collaboration Protocol\n\n> Complex design is not thought up at once \u2014 it is walked out in small aligned steps.\n\n## Four Iron Rules\n| Rule | Meaning | Anti-example |\n|------|---------|--------------|\n| Small-step alignment | Advance one decision at a time; confirm before the next step | Presenting 10 options at once |\n| Explicit decisions | Every choice records rationale and alternatives | \"I feel this is good\" (no rationale) |\n| Document-driven | Conclusions land in named files (<subject>-<scope>-<type>.md) | Conclusions exist only in conversation |\n| No level-skipping | Advance strictly through the layers | Writing implementation before requirements are aligned |\n\n## Five-Layer Progression (no skipping)\nRequirements \u2192 Scope \u2192 Solution \u2192 Interface \u2192 Implementation\n| Layer | Artifact | Question |\n|-------|----------|----------|\n| Requirements | Requirements description | \"What problem are we solving?\" |\n| Scope | Scope list (in/out) | \"What is in, explicitly what is out?\" |\n| Solution | Solution comparison + selection | \"How? Which one? Why?\" |\n| Interface | Interface/protocol definition | \"How do the boundaries interact?\" |\n| Implementation | Code/docs | \"Land it layer by layer\" |\n\n## Collaboration Rhythm\n1. Raise one decision point of the current layer (with context + suggestion + rationale)\n2. Wait for confirmation or correction (small step)\n3. After confirmation, record the decision (into session SESSION.md or a design doc)\n4. Move to the next decision point";
|
|
5
|
-
export declare const neatTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
|
package/lib/tools/praxis.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* section 参数渐进披露:不传 = 返回精简目录;传 = 返回对应框架全文/章节。
|
|
10
10
|
*/
|
|
11
|
-
export type PraxisSection = 'eap' | 'neat' | 'cce';
|
|
12
11
|
/** 框架清单(无参调用时返回的精简目录) */
|
|
13
12
|
export declare const PRAXIS_INDEX = "praxis \u2014 \u53EF\u5B9E\u8DF5\u7406\u8BBA\u6CE8\u5165\uFF08\u8BA4\u77E5\u6846\u67B6\uFF0C\u6309\u9700\u52A0\u8F7D\uFF09\n\u9009\u62E9\u6846\u67B6\uFF1Apraxis eap\uFF08\u8BA4\u77E5\u8D28\u91CF\u2014\u2014E\u2191/R\u2193/S\u2191 \u4E09\u53D8\u91CF + \u8F93\u51FA\u524D\u81EA\u68C0\uFF09\n praxis neat\uFF08Neat \u534F\u4F5C\u534F\u8BAE\u2014\u2014\u5C0F\u6B65\u5BF9\u9F50/\u663E\u5F0F\u51B3\u7B56/\u6587\u6863\u9A71\u52A8\uFF09\n praxis cce\uFF08\u8BA4\u77E5\u8FDE\u7EED\u6027\u5DE5\u7A0B\u2014\u2014\u5BB9\u5668 5 \u884C\u4E3A\u7EA6\u675F + H_op \u64CD\u4F5C\u71B5\uFF09\n\u65E0\u53C2\u8FD4\u56DE\u672C\u76EE\u5F55\uFF1B\u8BE6\u60C5\u4EE5\u5BF9\u5E94\u6846\u67B6\u539F\u6587\u4E3A\u51C6\uFF08\u5355\u4E00\u771F\u76F8\u6E90\uFF09\u3002\n";
|
|
14
13
|
export declare const praxisTool: import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* skiff-admin.ts — Skiff 角色逻辑层(v1.30:skiff_admin 工具已并入 container_admin role 域)
|
|
3
3
|
*
|
|
4
|
-
* 教 CCC 如何定义 Skiff
|
|
5
|
-
*
|
|
4
|
+
* 教 CCC 如何定义 Skiff 角色(用户拍板 2026-08-28 的三动作分工:
|
|
5
|
+
* guide 定义教程 / validate 配置校验 / list 角色摘要)。
|
|
6
6
|
*
|
|
7
7
|
* 归属:ACC 机制(教会 + 校验),角色内容仍归 CCC 配置(.opencode/serenity.json skiff.roles)。
|
|
8
8
|
* 公开入口 = container_admin(domain: role → guide/validate/apply/list);本文件保留纯逻辑。
|
|
@@ -12,18 +12,19 @@
|
|
|
12
12
|
* ⇒ 只把**不依赖模板**的两项并入 `use`:空壳 / 长期无活动(**提示,不阻断**)
|
|
13
13
|
* · `close`/`archive` → 删:`completed` 本就由 SESSION.md 的 `[x]` 推导(不靠 close 写);
|
|
14
14
|
* 归档能力由 `container_fs mv → _archived/` 承担
|
|
15
|
-
* · `hook-develop-guide` →
|
|
15
|
+
* · `hook-develop-guide` → **淘汰**(v1.34.1:SEP 整体废除——「能落 harness 已有原语,
|
|
16
|
+
* 就不要自造协议 + 脚本管道」;轨迹挂哪些 skill 改由 SESSION.md frontmatter 声明 +
|
|
17
|
+
* `systemPrompt.section` 注入,见 `docs/trajectory-skill-injection.md`)
|
|
16
18
|
* · autopilot 面(all/init/random/diag/doc/check/status/guide)→ `container_admin` 的 autopilot 域
|
|
17
19
|
* · `wake-add`/`wake-list`/`wake-rm` → **`wake-later`**(一次登记;**不可回收、无面板**——用户明示接受)
|
|
18
20
|
*
|
|
19
|
-
* 保留 osp 对齐语义的部分:create 的 `--desc`/`--issue` 二选一、use 激活即重命名 dsh 会话标题(F3
|
|
20
|
-
*
|
|
21
|
-
* + 从 events 恢复(S134)。
|
|
21
|
+
* 保留 osp 对齐语义的部分:create 的 `--desc`/`--issue` 二选一、use 激活即重命名 dsh 会话标题(F3)。
|
|
22
|
+
* 活跃会话跟踪:内存 Map(按 dsh 会话 id 隔离)+ 从 events 恢复(S134)。
|
|
22
23
|
*/
|
|
23
24
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
24
25
|
import type { Context } from 'cordis';
|
|
25
26
|
import { type ActiveSessionInfo, type CreateSessionResult } from '../trajectory-ops.js';
|
|
26
|
-
|
|
27
|
+
interface RenameOnUseDeps {
|
|
27
28
|
/** sessionTitle 服务可用性 */
|
|
28
29
|
sessionTitleAvailable: boolean;
|
|
29
30
|
}
|
|
@@ -92,18 +93,9 @@ export declare function renameDshSessionForActive(ctx: Context, exec: {
|
|
|
92
93
|
session?: unknown;
|
|
93
94
|
};
|
|
94
95
|
}, info: ActiveSessionInfo, summary?: string): void;
|
|
95
|
-
/**
|
|
96
|
-
* SEP(Session Extension Protocol)开发者指南(原 `hook-develop-guide` 动作的内容)。
|
|
97
|
-
*
|
|
98
|
-
* v1.33(用户裁决"选 A"):该动作**不再作为 trajectory 的动作**,内容**并进
|
|
99
|
-
* `container_admin msm guide`**(理由:SEP 的本质就是"注册一个 session-tool MSM",
|
|
100
|
-
* 天然属于 MSM 开发手册)。⇒ 这里保留为**唯一文本源**,由 container-admin 引用,
|
|
101
|
-
* 避免两份会漂移的说明(单真相源)。
|
|
102
|
-
* @param hasSessionTool 本 CCC 是否已注册 session-tool MSM(决定了尾部的提示行)
|
|
103
|
-
*/
|
|
104
|
-
export declare function buildSepGuide(hasSessionTool: boolean): string;
|
|
105
96
|
/**
|
|
106
97
|
* 创建 trajectory 工具(原 logbook;v1.33 S142 §32 更名 + 动作收敛)。
|
|
107
98
|
* 闭包捕获插件 ctx → use 后可调 ctx.sessionTitle.rename。
|
|
108
99
|
*/
|
|
109
100
|
export declare function createTrajectoryTool(ctx: Context): ReturnType<typeof defineTool>;
|
|
101
|
+
export {};
|
package/lib/totp.d.ts
CHANGED
|
@@ -11,10 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
/** 时步(秒)——RFC 6238 默认 30 */
|
|
13
13
|
export declare const TOTP_STEP_SECONDS = 30;
|
|
14
|
-
/** 验证窗口:当前时步 ± 1(容忍时钟漂移/生成延迟) */
|
|
15
|
-
export declare const TOTP_WINDOW = 1;
|
|
16
|
-
/** 输出位数(标准 6 位) */
|
|
17
|
-
export declare const TOTP_DIGITS = 6;
|
|
18
14
|
/** 字节 → base32(无填充)。secret 显示/otpauth URI 用。 */
|
|
19
15
|
export declare function base32Encode(bytes: Uint8Array): string;
|
|
20
16
|
/** base32(无填充,大小写不敏感)→ 字节;非法字符抛错。 */
|