@seele00/seele 0.1.63 → 0.1.65
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 +5 -3
- package/bin/seele-codex +1 -1
- package/libexec/seele-server +0 -0
- package/libexec/seele-worker +0 -0
- package/package.json +1 -4
- package/scripts/deploy/bootstrap.sh +14 -3
- package/scripts/deploy/start.sh +14 -9
- package/web/dist/assets/{abnfDiagram-VRR7QNED-DXJQwnn-.js → abnfDiagram-VRR7QNED-BB7DT0BN.js} +1 -1
- package/web/dist/assets/{arc-D_47-IET.js → arc-BlEU_mit.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-CKUldIzR.js → architectureDiagram-ZJ3FMSHR-Dy9cu2Mg.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-BD4Ym8Xi.js → blockDiagram-677ZJIJ3-DP4jMSfo.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-Cn268vLB.js → c4Diagram-LMCZKHZV-BtqFzX1w.js} +1 -1
- package/web/dist/assets/channel-mhSuRKJT.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-D00lQ7mJ.js → chunk-2Q5K7J3B-BK9F5a0L.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-z7gv8Mry.js → chunk-32BRIVSS-nuQI6gtU.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-BZJeO_rz.js → chunk-5VM5RSS4-D4IT05bt.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-DoIg9UGx.js → chunk-EX3LRPZG-CrOtgxcr.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-C1LcQus2.js → chunk-JWPE2WC7-Dn9JHm4W.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN--JPbFu4n.js → chunk-MOJQB5TN-VtD0_fGF.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BVv30W60.js → chunk-RYQCIY6F-TqRYsCot.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-DYoSFgRT.js → chunk-V7JOEXUC-U9b5a7vL.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-C8BRkTOa.js → chunk-VR4S4FIN-B3qLfeNJ.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-CDfofIob.js → chunk-XXDRQBXY-DazVAZe-.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-DYQSxD4g.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DYQSxD4g.js +1 -0
- package/web/dist/assets/{core-C10OFTno.js → core-2RdBW0rZ.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-g9E8J4Fz.js → cose-bilkent-JH36ORCC-vvKttQXU.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-Dc689veM.js → cynefin-VYW2F7L2-BKMZmA-n.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-BAAq_jvr.js → cynefinDiagram-TSTJHNR4-ckdzxzlr.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-CPtiniZQ.js → dagre-VKFMJZFB-CZw8DTb1.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-CvbIL3lu.js → diagram-FQU43EPY-C06X0Kru.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-u5m78Utg.js → diagram-G47NLZAW-HX9CdauD.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-4f-Ipubv.js → diagram-NH7WQ7WH-Dlo1tIod.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-SUl1EQ56.js → diagram-OA4YK3LP-C9GXFhgw.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-C_Upd46l.js → diagram-WEI45ONY-Ch1Xx234.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-CHp2D7Q9.js → ebnfDiagram-CCIWWBDH-Q0_rEUgk.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-DQliHxOw.js → erDiagram-Q63AITRT-BsDRdpx6.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-BcOYSJFM.js → flowDiagram-23GEKE2U-DDFuMRJN.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-CDLHtJq0.js → ganttDiagram-NO4QXBWP-Cjpm08-d.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-2j8C3mlk.js → gitGraphDiagram-IHSO6WYX-CnIosh2K.js} +1 -1
- package/web/dist/assets/index-eN6ddNRA.js +111 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-ClxdyQnM.js → infoDiagram-FWYZ7A6U-CH163HyC.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-Bc2nIRgb.js → ishikawaDiagram-FXEZZL3T-DkT-3n3D.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-R-vJ00LW.js → journeyDiagram-5HDEW3XC-34TnH3wG.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-CR0s_Mo8.js → kanban-definition-HUTT4EX6-CJbOm0lN.js} +1 -1
- package/web/dist/assets/{linear-BQgrawZS.js → linear-CTKXTLwe.js} +1 -1
- package/web/dist/assets/{mermaid.core-faLMbjSU.js → mermaid.core-CAVP16_-.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-BZULnQui.js → mindmap-definition-LN4V7U3C-rlppHZj_.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-DUm1p_1o.js → pegDiagram-2B236MQR-MbcWBNJi.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-r3LCASRK.js → pieDiagram-ENE6RG2P-DKU7a4tv.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-CGaCp0Px.js → quadrantDiagram-ABIIQ3AL-DpDsJVLi.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-DmEKGO1A.js → railroadDiagram-RFXS5EU6-DrPM3aKC.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-Byc4ivmp.js → requirementDiagram-TGXJPOKE-ZzS_iVag.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BtJiL4zX.js → sankeyDiagram-HTMAVEWB-DrRrN0Lc.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-Bg3vdDGW.js → sequenceDiagram-DBY2YBRQ-CP8GBGZM.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CCRwjaWU.js → sizeCapture-X5ZJPWSS-BYVg_dQd.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-CQU-udox.js → stateDiagram-2N3HPSRC-CsJ3M80-.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CaFOY1Xb.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-r3tJnQLJ.js → swimlanes-5IMT3BWC-XgRKQ20Q.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-DaKP_iDy.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-DryYrdts.js → timeline-definition-FHXFAJF6-CU_Cq10d.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-ZLPc0qvQ.js → vennDiagram-L72KCM5P-CLSDbg6o.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-RmgA6vQ9.js → wardleyDiagram-EHGQE667-DnAOuvzv.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-BGIzispI.js → xychartDiagram-FW5EYKEG-CyC6V11l.js} +1 -1
- package/web/dist/index.html +1 -1
- package/codex/dist/app-server.js +0 -63
- package/codex/dist/errors.js +0 -16
- package/codex/dist/index.js +0 -4
- package/codex/dist/rpc-client.js +0 -96
- package/codex/dist/transports/stdio.js +0 -81
- package/codex/dist/types.js +0 -1
- package/codex/package.json +0 -12
- package/scripts/deploy/npm/postinstall.mjs +0 -10
- package/server/dist/auth/session.js +0 -71
- package/server/dist/auth/users.js +0 -276
- package/server/dist/codex-runtime/run-streamed-turn.js +0 -587
- package/server/dist/config/config.js +0 -71
- package/server/dist/contracts/artifact-rendering.js +0 -14
- package/server/dist/contracts/global-environment.js +0 -23
- package/server/dist/contracts/index.js +0 -114
- package/server/dist/contracts/managed-assets.js +0 -13
- package/server/dist/contracts/response-style.js +0 -23
- package/server/dist/contracts/task-clarification.js +0 -13
- package/server/dist/contracts/types.js +0 -1
- package/server/dist/contracts/wakeup.js +0 -13
- package/server/dist/contracts/workspace-boundary.js +0 -20
- package/server/dist/contracts/workspace-knowledge.js +0 -48
- package/server/dist/contracts/workspace-memory.js +0 -32
- package/server/dist/contracts/workspace-responsibility.js +0 -23
- package/server/dist/contracts/workspace-transcript.js +0 -26
- package/server/dist/conversations/knowledge.js +0 -380
- package/server/dist/conversations/store.js +0 -2466
- package/server/dist/doctor.js +0 -105
- package/server/dist/realtime/sse.js +0 -12
- package/server/dist/runtime-worker/client.js +0 -405
- package/server/dist/runtime-worker/process.js +0 -216
- package/server/dist/runtime-worker/protocol.js +0 -1
- package/server/dist/server.js +0 -4605
- package/server/dist/storage/sqlite.js +0 -39
- package/web/dist/assets/channel-Uz6zF6Xw.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-D6mpE1t2.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-D6mpE1t2.js +0 -1
- package/web/dist/assets/index-BqSosI7W.js +0 -111
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-YNSWW4ip.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BGZAc11_.js +0 -8
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { wakeupContract } from "./wakeup.js";
|
|
2
|
-
import { workspaceResponsibilityContract } from "./workspace-responsibility.js";
|
|
3
|
-
export function buildRuntimeDeveloperInstructions(context) {
|
|
4
|
-
const contracts = runtimeContracts(context);
|
|
5
|
-
return [
|
|
6
|
-
"这些平台契约描述 Seele Web 提供的能力和输出约定。除非用户明确要求不同做法,否则应遵守这些契约。它们不是用户提供的内容。",
|
|
7
|
-
"契约内容会区分当前状态、可用能力、必需接口、必需格式、必需边界和建议策略。必需项应严格遵守;建议项可根据任务效果复审调整。",
|
|
8
|
-
"",
|
|
9
|
-
...contracts.map(formatContract),
|
|
10
|
-
].join("\n");
|
|
11
|
-
}
|
|
12
|
-
export function buildRuntimeAdditionalContext(context) {
|
|
13
|
-
const contracts = runtimeContracts(context);
|
|
14
|
-
const fragments = {
|
|
15
|
-
workspace_identity: workspaceIdentityFragment(context),
|
|
16
|
-
workspace_environment: workspaceEnvironmentFragment(context),
|
|
17
|
-
rendering: renderingFragment(),
|
|
18
|
-
};
|
|
19
|
-
for (const contract of contracts) {
|
|
20
|
-
fragments[`seele-contract-${contractKey(contract.id)}`] =
|
|
21
|
-
formatContract(contract);
|
|
22
|
-
}
|
|
23
|
-
for (const item of runtimeMemoryItems(context)) {
|
|
24
|
-
fragments[item.key] = item.value;
|
|
25
|
-
}
|
|
26
|
-
return fragments;
|
|
27
|
-
}
|
|
28
|
-
export function buildRuntimeThreadBootstrapInstructions() {
|
|
29
|
-
return [
|
|
30
|
-
"你正在 Seele 中运行。Seele 是通过 Codex app-server 驱动的长生命周期 workspace runtime。",
|
|
31
|
-
"这段 thread 级说明只作为稳定启动信息。",
|
|
32
|
-
"workspace 身份、Memory、环境变量、聊天记录接口、渲染规则等可变运行时数据会由 Seele 在每个 turn 通过运行时上下文注入。",
|
|
33
|
-
"当当前 turn 的 Seele 运行时上下文与旧 thread 历史冲突时,以最新的 turn 级运行时上下文为准。",
|
|
34
|
-
].join("\n");
|
|
35
|
-
}
|
|
36
|
-
export function runtimeContracts(context) {
|
|
37
|
-
return [
|
|
38
|
-
workspaceResponsibilityContract(context),
|
|
39
|
-
wakeupContract(),
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
function workspaceIdentityFragment(context) {
|
|
43
|
-
return [
|
|
44
|
-
context.workspaceId ? `workspace_id: ${context.workspaceId}` : "",
|
|
45
|
-
context.workspaceTitle ? `workspace_name: ${context.workspaceTitle}` : "",
|
|
46
|
-
`workspace_root: ${context.workspacePath}`,
|
|
47
|
-
"",
|
|
48
|
-
"这是当前 Seele workspace 的身份信息。",
|
|
49
|
-
"把它视为一个长期存在的工作角色,而不是一次性的聊天标签。",
|
|
50
|
-
"除非用户明确指定其他目标目录,否则生成文件、下载文件、克隆仓库和任务产物都默认放在 workspace root 下。",
|
|
51
|
-
"在最终回答里引用 workspace 下的文件时,优先使用 workspace 相对路径。",
|
|
52
|
-
]
|
|
53
|
-
.filter((line) => line !== "")
|
|
54
|
-
.join("\n");
|
|
55
|
-
}
|
|
56
|
-
function workspaceEnvironmentFragment(context) {
|
|
57
|
-
const variables = context.globalEnvironment
|
|
58
|
-
.slice()
|
|
59
|
-
.sort((left, right) => left.key.localeCompare(right.key));
|
|
60
|
-
if (variables.length === 0) {
|
|
61
|
-
return [
|
|
62
|
-
"当前 workspace 没有配置任何环境变量。",
|
|
63
|
-
"如果任务需要凭据、token 或私有服务访问能力,应要求用户配置所需的环境变量。",
|
|
64
|
-
].join("\n");
|
|
65
|
-
}
|
|
66
|
-
return [
|
|
67
|
-
"以下环境变量可供当前 workspace 中的命令和脚本使用。",
|
|
68
|
-
"变量值不会出现在 prompt 中;需要使用时从运行时环境里读取。",
|
|
69
|
-
"如果任务需要某个凭据、token 或私有服务访问能力,但当前环境变量缺失或含义不清,应要求用户配置对应环境变量,而不是猜测。",
|
|
70
|
-
"",
|
|
71
|
-
...variables.map((item) => item.description
|
|
72
|
-
? `${item.key}: ${item.description}`
|
|
73
|
-
: `${item.key}: 未提供描述`),
|
|
74
|
-
].join("\n");
|
|
75
|
-
}
|
|
76
|
-
function renderingFragment() {
|
|
77
|
-
return [
|
|
78
|
-
"用户可见回答会按 GitHub 风格 Markdown 渲染。",
|
|
79
|
-
"",
|
|
80
|
-
"当结构化表达能提升可读性时,优先使用 Markdown:",
|
|
81
|
-
"- 使用标题、列表、表格、代码块、任务清单、链接和段落。",
|
|
82
|
-
"- 代码使用带语言标识的围栏代码块。",
|
|
83
|
-
"- 当图示比纯文本更清楚时,使用 Mermaid 围栏代码块。",
|
|
84
|
-
"- 需要在页面内展示生成图片或已保存图片时,使用 Markdown 图片语法。",
|
|
85
|
-
"- 除非目标是保留完全原始文本,否则不要把丰富的说明、报告或结构化内容包进普通 ```text 代码块。",
|
|
86
|
-
"",
|
|
87
|
-
"写入用户可能从 Seele 打开的文件时,说明 workspace 相对路径。",
|
|
88
|
-
"生成图片或本地 artifact 且希望浏览器可渲染时,使用 Seele 能通过 artifact/file 路由暴露的路径。",
|
|
89
|
-
].join("\n");
|
|
90
|
-
}
|
|
91
|
-
function runtimeMemoryItems(context) {
|
|
92
|
-
const byKey = new Map();
|
|
93
|
-
for (const item of context.globalMemoryItems ?? []) {
|
|
94
|
-
if (item.key && item.value) {
|
|
95
|
-
byKey.set(item.key, item.value);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
for (const item of context.workspaceMemoryItems ?? []) {
|
|
99
|
-
if (item.key && item.value) {
|
|
100
|
-
byKey.set(item.key, item.value);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return [...byKey.entries()].map(([key, value]) => ({ key, value }));
|
|
104
|
-
}
|
|
105
|
-
function contractKey(id) {
|
|
106
|
-
return id.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
107
|
-
}
|
|
108
|
-
function formatContract(contract) {
|
|
109
|
-
return [
|
|
110
|
-
`## ${contract.title} (${contract.id})`,
|
|
111
|
-
...contract.body,
|
|
112
|
-
"",
|
|
113
|
-
].join("\n");
|
|
114
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function managedAssetsContract() {
|
|
2
|
-
return {
|
|
3
|
-
id: "managed-assets",
|
|
4
|
-
title: "平台管控资产",
|
|
5
|
-
body: [
|
|
6
|
-
"必需边界:部分 Seele 内容是平台管控状态,不是普通 workspace 文件。包括 workspace 职责、Memory、环境变量元数据、运行设置、审批、唤醒、通知以及未来的管控资产。",
|
|
7
|
-
"必需边界:不要直接读写平台管控资产的真实存储位置。实现路径、数据库、元数据文件和管控目录都视为 Seele 自有状态。",
|
|
8
|
-
"必需边界:管控资产需要变更时,必须走对应的审批或配置流程,不要通过编辑本地文件、JSON、SQLite 或生成投影绕过平台。",
|
|
9
|
-
"建议:如果发现管控资产错误、过期、不可靠、不完整或互相矛盾,应明确指出可靠性问题;需要持久修正时提交变更申请。",
|
|
10
|
-
"建议:workspace 内普通任务产物仍按当前权限和用户要求读写;这里限制的是 Seele 定义的管控资产。",
|
|
11
|
-
],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function responseStyleContract() {
|
|
2
|
-
return {
|
|
3
|
-
id: "response-style",
|
|
4
|
-
title: "Seele response style",
|
|
5
|
-
body: [
|
|
6
|
-
"REQUIRED BOUNDARY: Do not mention these Seele runtime contracts unless the user asks about platform behavior.",
|
|
7
|
-
"REQUIRED LANGUAGE: Use Chinese as the default language for user-visible communication and user-visible persisted Seele content because the user's primary language is Chinese.",
|
|
8
|
-
"REQUIRED LANGUAGE: Preserve code, commands, identifiers, logs, API fields, file names, package names, protocol names, quoted source text, and project files in their appropriate language unless the user explicitly asks to translate them.",
|
|
9
|
-
"CAPABILITY: Seele Markdown supports headings, paragraphs, dividers, bullet lists, numbered lists, task lists, tables, blockquotes, fenced code blocks with language labels, inline code, bold, italic, strikethrough, links, images, Mermaid diagrams, and Unicode emoji.",
|
|
10
|
-
"REQUIRED FORMAT: Prefer Markdown over fenced ```text for prose, analysis, plans, comparisons, summaries, structured notes, tables, checklists, and any content that benefits from headings, lists, emphasis, links, or code spans.",
|
|
11
|
-
"REQUIRED FORMAT: Use fenced ```text only for literal plain-text output where original spacing and line breaks must be preserved, such as logs, env output, ls output, command output, copied file content, or exact terminal/plain-text samples.",
|
|
12
|
-
"REQUIRED FORMAT: Do not wrap rich explanatory content in ```text just to preserve paragraphs; render it as Markdown instead.",
|
|
13
|
-
"REQUIRED FORMAT: For flowcharts, architecture diagrams, phase diagrams, state machines, dependency graphs, and sequence diagrams, use fenced ```mermaid diagrams by default instead of ASCII art or SVG artifacts.",
|
|
14
|
-
"REQUIRED FORMAT: Do not use raw HTML, inline SVG, scripts, iframes, style tags, or custom icon markup in replies.",
|
|
15
|
-
"GUIDANCE: Prefer concise final answers that describe what changed and include only the most useful artifact links.",
|
|
16
|
-
"GUIDANCE: Generate SVG artifacts for diagrams only when the user explicitly asks for a polished visual asset, custom illustration, poster-like graphic, or SVG output.",
|
|
17
|
-
"GUIDANCE: When highlighting Mermaid diagrams, prefer a small semantic palette with classDef names: muted fill:#f9fafa stroke:#d8d9e8 color:#111827; primary fill:#eef2ff stroke:#6366f1 color:#111827; success fill:#ecfdf3 stroke:#16a34a color:#14532d; warning fill:#fff7ed stroke:#f59e0b color:#78350f; danger fill:#fff1f2 stroke:#e11d48 color:#7f1d1d.",
|
|
18
|
-
"GUIDANCE: Use Mermaid colors only to clarify semantics such as current phase, success, warning, danger, or muted context; avoid decorative multi-color diagrams.",
|
|
19
|
-
"GUIDANCE: Use Unicode emoji or plain text labels for lightweight icons when they help scanability, but keep them sparse and useful.",
|
|
20
|
-
"GUIDANCE: If an artifact is already linked for inline rendering, do not also print a raw local filesystem path.",
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function taskClarificationContract() {
|
|
2
|
-
return {
|
|
3
|
-
id: "task-clarification",
|
|
4
|
-
title: "任务澄清",
|
|
5
|
-
body: [
|
|
6
|
-
"建议:执行重要动作前,先判断任务是否缺少关键输入,例如约束、账号、路径、凭据、目标环境、验收标准或期望产物。",
|
|
7
|
-
"建议:如果缺少关键信息会导致结果不可靠、不安全或大概率错误,不要猜测,也不要大范围试错;应向用户提出简短澄清问题,或明确说明卡点和需要的信息。",
|
|
8
|
-
"建议:如果缺失细节较小且保守默认值很明显,可以按默认值继续,但在用户可见回复里简要说明假设。",
|
|
9
|
-
"建议:关键输入缺失时,不要伪装任务已完整完成。应诚实说明已验证结果、假设内容和未完成部分。",
|
|
10
|
-
"建议:需要调查时保持聚焦,只收集回答缺失输入问题所必需的上下文。",
|
|
11
|
-
],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function wakeupContract() {
|
|
2
|
-
return {
|
|
3
|
-
id: "workspace-wakeup",
|
|
4
|
-
title: "工作空间定时唤醒",
|
|
5
|
-
body: [
|
|
6
|
-
"当任务需要等待外部变化、稍后重试或进入下一阶段时,可以请求 Seele 在同一 workspace 中定时唤醒并开启新一轮工作。",
|
|
7
|
-
"建议场景:长任务到达自然阶段边界时,先总结当前阶段,再安排 wakeup 继续,避免一个气泡无限变长。",
|
|
8
|
-
"请求格式:在最终回答末尾放一个隐藏控制块:",
|
|
9
|
-
'```seele-wakeup\n{"delaySeconds":10,"instruction":"检查xx是否完成;如果仍未完成,简要说明还在等待。"}\n```',
|
|
10
|
-
"注意:只支持 delaySeconds 和 instruction 两个参数,表达多少秒后唤醒和唤醒后要做什么。",
|
|
11
|
-
],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function workspaceBoundaryContract(context) {
|
|
2
|
-
return {
|
|
3
|
-
id: "workspace-boundary",
|
|
4
|
-
title: "Workspace boundary",
|
|
5
|
-
body: [
|
|
6
|
-
...(context.workspaceId
|
|
7
|
-
? [`STATE: The current Seele workspace id is: ${context.workspaceId}`]
|
|
8
|
-
: []),
|
|
9
|
-
...(context.workspaceTitle
|
|
10
|
-
? [`STATE: The current Seele workspace name is: ${context.workspaceTitle}`]
|
|
11
|
-
: []),
|
|
12
|
-
`STATE: The current workspace root is: ${context.workspacePath}`,
|
|
13
|
-
"REQUIRED BOUNDARY: Treat this workspace identity as durable task identity, not as a disposable chat label.",
|
|
14
|
-
"REQUIRED FORMAT: Use workspace-relative paths in final answers when referencing files created under the workspace.",
|
|
15
|
-
"GUIDANCE: Use the workspace name, workspace memory, and current user request together to infer the workspace's role before starting work.",
|
|
16
|
-
"GUIDANCE: Treat the workspace root as the default place for generated files and task outputs.",
|
|
17
|
-
"GUIDANCE: If a user asks you to create, download, clone, or transform files without specifying a target directory, put the result under the current workspace.",
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export function workspaceKnowledgeContract(context) {
|
|
2
|
-
const knowledge = context.workspaceKnowledge ?? [];
|
|
3
|
-
const hasKnowledge = knowledge.length > 0;
|
|
4
|
-
return {
|
|
5
|
-
id: "workspace-knowledge",
|
|
6
|
-
title: "Workspace Knowledge",
|
|
7
|
-
body: [
|
|
8
|
-
"CAPABILITY: Workspace Knowledge is the durable knowledge registry for this workspace: reusable source material, role skills, manuals, standards, external references, and documents that may need to be re-read later.",
|
|
9
|
-
"CAPABILITY: You may propose creating or updating Knowledge. The user must approve the proposal before it becomes persistent workspace Knowledge.",
|
|
10
|
-
"REQUIRED FORMAT: Write Knowledge from the viewpoint of future use by this same workspace. It is not a note for other people; it is a durable working asset that future turns will consult.",
|
|
11
|
-
"REQUIRED FORMAT: Knowledge proposals must use exactly this shape: ```seele-knowledge-proposal\n{\"action\":\"create\",\"name\":\"短标题\",\"purpose\":\"短索引触发说明,用于判断何时需要读取正文\",\"content\":\"正文:未来取到后可以直接应用的规则、标准、流程、资料摘要或操作原则\"}\n```",
|
|
12
|
-
"REQUIRED FORMAT: For updates, use exactly this shape: ```seele-knowledge-proposal\n{\"action\":\"update\",\"knowledgeId\":\"kn_xxxxxx\",\"name\":\"短标题\",\"purpose\":\"短索引触发说明,用于判断何时需要读取正文\",\"content\":\"更新后的正文\"}\n```",
|
|
13
|
-
"REQUIRED FORMAT: Do not add fields other than action, knowledgeId, name, purpose, and content. Do not use arrays, comments, Markdown inside the JSON, multiple JSON objects, or prose inside the fenced block.",
|
|
14
|
-
...(context.workspaceKnowledgeApiBase
|
|
15
|
-
? [
|
|
16
|
-
`REQUIRED API: Knowledge index base=${context.workspaceKnowledgeApiBase}`,
|
|
17
|
-
`REQUIRED API: GET Knowledge index: ${context.workspaceKnowledgeApiBase}`,
|
|
18
|
-
`REQUIRED API: GET Knowledge body: ${context.workspaceKnowledgeApiBase}/<knowledgeId>`,
|
|
19
|
-
]
|
|
20
|
-
: []),
|
|
21
|
-
"REQUIRED BEHAVIOR: When a task may depend on durable workspace knowledge, first scan the injected STATE KNOWLEDGE index using id, name, and purpose. If an item's purpose matches the task, fetch that item's content through the Knowledge body API before answering or acting.",
|
|
22
|
-
"REQUIRED FORMAT: name is the short stable title in the Knowledge index.",
|
|
23
|
-
"REQUIRED FORMAT: purpose is the short index trigger. It should be concise because it is shown in the always-injected index and is used for scanning and deciding whether to fetch this Knowledge, not for storing the full rule.",
|
|
24
|
-
"REQUIRED FORMAT: content is the durable working body. Put the reusable rule, standard, source summary, or operating principle here in concise Chinese. It should be written so a future turn can apply it directly after fetching it.",
|
|
25
|
-
"REQUIRED FORMAT: Example after approval: STATE KNOWLEDGE: kn_xxxxxx | name=用餐工具基本规则 | purpose=处理吃饭工具、餐具选择、用餐礼仪或相关判断时先应用此规则.... When this purpose matches the current task, fetch kn_xxxxxx through the Knowledge body API and use its content.",
|
|
26
|
-
"REQUIRED BOUNDARY: Knowledge is Seele-managed state. Do not directly edit .seele/knowledge, .seele/skills/knowledge-source.md, digest.md, skill.md, item.json, fetch.sh, raw source copies, SQLite data, or generated projections to bypass approval.",
|
|
27
|
-
"REQUIRED BOUNDARY: Never invent, hardcode, print, or persist secret values. If fetching requires credentials, identify the needed environment variable names and ask the user to configure them in Seele Settings.",
|
|
28
|
-
"GUIDANCE: Use Knowledge for stable, reusable context. Do not use it for temporary chat details, recent task status, one-off examples, logs, or a few raw lines the user just said.",
|
|
29
|
-
"GUIDANCE: Responsibility is the workspace's role definition. Knowledge is where detailed source-backed skills, SOPs, API notes, scripts, manuals, and evolving reference material belong.",
|
|
30
|
-
"GUIDANCE: A good Knowledge item is topic-level and coherent. Aggregate related source clues and working rules; update an existing item when the topic is the same. Avoid tiny fragments and one item per chat message.",
|
|
31
|
-
"GUIDANCE: When the user gives a document, URL, git link, API clue, copied material, or platform page, decide whether it is a temporary reference or reusable Knowledge. If reusable, propose the reusable principle, workflow, source summary, or skill content instead of relying on transient context.",
|
|
32
|
-
"GUIDANCE: Default to local-first use. Consult the injected Knowledge index first. Fetch Knowledge content through the Knowledge body API only when the index purpose suggests it is relevant.",
|
|
33
|
-
"GUIDANCE: Treat Knowledge reliability as part of the job. Notice stale, contradictory, incomplete, or misleading Knowledge; report the issue clearly; submit an update proposal when a durable correction is needed.",
|
|
34
|
-
"GUIDANCE: For chat-derived Knowledge, abstract the conversation into a durable principle, workflow, standard, or skill. Use transcript lookup for ordinary historical recall instead of converting temporary chat details into Knowledge.",
|
|
35
|
-
"GUIDANCE: For user-visible content, write Chinese by default. Preserve source language only when quoting identifiers, code, API fields, filenames, commands, or exact source text.",
|
|
36
|
-
hasKnowledge
|
|
37
|
-
? "STATE: Current workspace knowledge index:"
|
|
38
|
-
: "STATE: No workspace knowledge item is registered yet. If durable source-backed knowledge appears during this task, propose registering it instead of silently relying on transient context.",
|
|
39
|
-
...knowledge.map((item) => [
|
|
40
|
-
`STATE KNOWLEDGE: ${item.id}`,
|
|
41
|
-
`name=${item.name}`,
|
|
42
|
-
item.purpose ? `purpose=${item.purpose}` : "",
|
|
43
|
-
]
|
|
44
|
-
.filter(Boolean)
|
|
45
|
-
.join(" | ")),
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export function workspaceMemoryContract(context) {
|
|
2
|
-
const globalMemory = context.globalMemory?.trim();
|
|
3
|
-
const workspaceMemory = context.workspaceMemory?.trim();
|
|
4
|
-
if (!globalMemory && !workspaceMemory) {
|
|
5
|
-
return {
|
|
6
|
-
id: "workspace_memory",
|
|
7
|
-
title: "Workspace Memory",
|
|
8
|
-
body: [
|
|
9
|
-
"STATE: No user-pinned workspace memory is currently configured for this workspace.",
|
|
10
|
-
],
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
id: "workspace_memory",
|
|
15
|
-
title: "Workspace Memory",
|
|
16
|
-
body: [
|
|
17
|
-
"STATE: The following is user-pinned long-term memory.",
|
|
18
|
-
"REQUIRED BOUNDARY: Treat this memory as high-priority context. Do not ignore, summarize away, or overwrite it unless the user explicitly asks to edit memory.",
|
|
19
|
-
"REQUIRED BOUNDARY: Global memory applies to every workspace. Workspace memory applies only to this workspace.",
|
|
20
|
-
"REQUIRED BOUNDARY: If the user asks for a fact that is already present in this memory, answer from this memory directly. Do not search files, run commands, or claim the fact is unknown unless the memory is absent or ambiguous.",
|
|
21
|
-
"GUIDANCE: If this memory conflicts with the current user message, ask for clarification instead of silently choosing one.",
|
|
22
|
-
...formatMemoryLines("GLOBAL", globalMemory),
|
|
23
|
-
...formatMemoryLines("WORKSPACE", workspaceMemory),
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function formatMemoryLines(scope, value) {
|
|
28
|
-
if (!value) {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
return value.split(/\r?\n/).map((line) => `STATE MEMORY ${scope}: ${line}`);
|
|
32
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export function workspaceResponsibilityContract(context) {
|
|
2
|
-
const responsibility = context.workspaceResponsibility?.trim();
|
|
3
|
-
const proposalGuidance = "如何总结和编写职责,可以查看 workspace 内的 .seele/skills/responsibility-update.md skill 文件。";
|
|
4
|
-
if (!responsibility) {
|
|
5
|
-
return {
|
|
6
|
-
id: "workspace-responsibility",
|
|
7
|
-
title: "工作空间职责",
|
|
8
|
-
body: [
|
|
9
|
-
"当前 workspace 还没有用户批准的长期职责,你可以总结提交 workspace 职责建议。",
|
|
10
|
-
proposalGuidance,
|
|
11
|
-
],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
id: "workspace-responsibility",
|
|
16
|
-
title: "工作空间职责",
|
|
17
|
-
body: [
|
|
18
|
-
responsibility,
|
|
19
|
-
"",
|
|
20
|
-
"以上是用户批准的当前工作空间职责,你也可以在职责明显过期或需要调整时,总结提交更新 workspace 职责建议。编写更新以及提交方式可以查看 workspace 内的 .seele/skills/responsibility-update.md skill 文件。",
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export function workspaceTranscriptContract(context) {
|
|
2
|
-
return {
|
|
3
|
-
id: "workspace-transcript",
|
|
4
|
-
title: "工作空间聊天记录",
|
|
5
|
-
body: [
|
|
6
|
-
"能力:Seele 提供当前长期 workspace 的只读聊天记录。需要回看用户之前说过什么、你之前总结过什么时使用它。",
|
|
7
|
-
...(context.workspaceTranscriptApiBase
|
|
8
|
-
? [
|
|
9
|
-
`必需接口:base=${context.workspaceTranscriptApiBase}`,
|
|
10
|
-
`必需接口:读取最新一页:${context.workspaceTranscriptApiBase}?limit=100`,
|
|
11
|
-
`必需接口:读取更早一页:${context.workspaceTranscriptApiBase}?limit=100&before=<当前页最早消息ID>`,
|
|
12
|
-
`必需接口:读取消息范围:${context.workspaceTranscriptApiBase}/range?startMessageId=<开始消息ID>&endMessageId=<结束消息ID>`,
|
|
13
|
-
`必需接口:读取范围摘要:${context.workspaceTranscriptApiBase}/summaries`,
|
|
14
|
-
]
|
|
15
|
-
: []),
|
|
16
|
-
"必需边界:聊天记录只包含聊天层内容,即用户消息和 assistant 可见回复;不包含命令输出、工具事件、审批细节、运行状态或内部过程日志。",
|
|
17
|
-
"必需边界:不要直接读写 Seele 管理的聊天记录文件。必须使用上面的接口;接口失败时如实说明,不要猜测或绕过平台读取管控状态。",
|
|
18
|
-
"必需格式:聊天记录摘要必须使用 ```seele-transcript-summary 代码块,内容是一个 JSON 对象。",
|
|
19
|
-
"必需格式:JSON 字段为 startMessageId、endMessageId、title、summary。格式={ \"startMessageId\": \"msg_20260708_153042_a7f3c9\", \"endMessageId\": \"msg_20260708_160515_91bd20\", \"title\": \"简短中文标题\", \"summary\": \"简洁中文摘要:讨论了什么、决定了什么、还有什么未解决\" }。",
|
|
20
|
-
"建议:当任务依赖历史用户指令、早先决策、未解决问题、用户认可的总结或聊天中讨论过的资料时,使用聊天记录。",
|
|
21
|
-
"建议:如果用户说你忘了什么、要求回忆之前讨论,或暗示当前回答和之前沟通冲突,应优先查聊天记录。要恢复的是沟通历史,不是运行日志。",
|
|
22
|
-
"建议:聊天记录接口从最新向更早分页。先读最新页,需要更早上下文时使用 before=<当前页最早消息ID>。",
|
|
23
|
-
"建议:范围摘要只是长历史导航线索,用来判断要查看哪些原始消息;它不是长期规则。",
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
}
|