cortico-world-bottle 0.9.0 → 0.9.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/world/config.ts +1 -1
- package/world/tools.ts +4 -14
- package/world/world.ts +3 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -187,7 +187,7 @@ Windows 卡片的新来信与回信使用不同的提示音,在 World「配置
|
|
|
187
187
|
|
|
188
188
|
旧音效 ID 自动映射到精简后的默认/共用音效,旧资源地址继续可用;自选有效文件、local、off、音量和淡出保留。装饰不占正文 120 字预算;旧海边按能力降级为单图角落样式或纯正文并提示,本机仍保留完整排版。
|
|
189
189
|
|
|
190
|
-
若部署覆盖了 `prompts/worlds/bottle/ENV_PROMPT.md
|
|
190
|
+
若部署覆盖了 `prompts/worlds/bottle/ENV_PROMPT.md`,请手动合并包内提示词的无头规则,保留自己的文风。不会自动覆盖自定义提示词。0.9.1 起无头工具固定注册,权限由实时开关决定;开启后无需另开会话,关闭后立即拒绝新的无头操作。升级后需重启一次桌宠加载新版代码,之后切换开关不需要重启。
|
|
191
191
|
|
|
192
192
|
工具与参数说明用英语,以 you 指导桌宠、用 your partner 指代伙伴;工具说明本身不解析占位符。事件目录的说明统一中文,通知内容可用中文或英语,信件原文、署名和标题保持原样。环境提示词以“你”对桌宠说话,用 `{{bottle.user | 伙伴}}` 指代伙伴。
|
|
193
193
|
|
package/package.json
CHANGED
package/world/config.ts
CHANGED
|
@@ -123,7 +123,7 @@ export const BOTTLE_CONFIG_FIELDS: Record<string, ConfigProperty> = {
|
|
|
123
123
|
},
|
|
124
124
|
'worlds.bottle.headlessEnabled': {
|
|
125
125
|
type: 'boolean', title: '无头模式(高危实验功能)',
|
|
126
|
-
description: '
|
|
126
|
+
description: '默认关闭。开启后立即允许使用无头工具,不需要另开会话;关闭后立即拒绝新的无头操作。桌宠捞信会自动看到正文,先向你分享完整原文和感想;可起草回信,但本轮禁止寄出,等你之后明确确认。也能按聊天指令读信和直接寄出指定草稿,无需网页逐次确认。扩展无法验证指令是否来自你本人;群聊消息、误解或恶意诱导可能让正文发错会话,或把私人信息寄给陌生人。接收方可保存传播,关闭不能撤回已经寄出或泄露的内容。请理解风险后再开启。',
|
|
127
127
|
'x-hot': true,
|
|
128
128
|
},
|
|
129
129
|
'worlds.bottle.bridgeEnabled': {
|
package/world/tools.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 工具。默认由人从信箱寄出;无头开关明确开启后,允许模型按人的聊天指令寄出指定版本。
|
|
3
|
-
*
|
|
3
|
+
* 工具声明固定注册,兼容宿主的会话缓存;无头能力只在实时开关开启时可用。
|
|
4
4
|
*
|
|
5
5
|
* 回执的规矩:写/捞/回都只说「放在了哪」,不念正文。正文的显示通道是页面,不是气泡。
|
|
6
6
|
*/
|
|
@@ -142,7 +142,7 @@ export const BOTTLE_TOOL_DECLS: ReadonlyArray<Omit<ToolDef, 'handler'>> = [
|
|
|
142
142
|
},
|
|
143
143
|
];
|
|
144
144
|
|
|
145
|
-
/**
|
|
145
|
+
/** 无头专用工具固定声明;是否可执行由 World handler 的实时开关判定。 */
|
|
146
146
|
export const BOTTLE_HEADLESS_TOOL_DECLS: ReadonlyArray<Omit<ToolDef, 'handler'>> = [
|
|
147
147
|
{
|
|
148
148
|
name: 'bottle_read_letter',
|
|
@@ -211,7 +211,7 @@ export const BOTTLE_HEADLESS_TOOL_DECLS: ReadonlyArray<Omit<ToolDef, 'handler'>>
|
|
|
211
211
|
|
|
212
212
|
];
|
|
213
213
|
|
|
214
|
-
export function bottleTools(deps: BottleToolDeps
|
|
214
|
+
export function bottleTools(deps: BottleToolDeps): ToolDef[] {
|
|
215
215
|
const handlers: Record<string, ToolDef['handler']> = {
|
|
216
216
|
bottle_query_doodles: () => deps.queryDoodles(),
|
|
217
217
|
bottle_star_memory: args => deps.starMemory(args.index),
|
|
@@ -240,18 +240,8 @@ export function bottleTools(deps: BottleToolDeps, headlessEnabled: boolean = fal
|
|
|
240
240
|
bottle_send_draft: (args) => deps.sendDraft(String(args.draftId ?? ''), typeof args.revision === 'number' ? args.revision : 0),
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
return [...BOTTLE_TOOL_DECLS, ...BOTTLE_HEADLESS_TOOL_DECLS].map((decl) => ({
|
|
244
244
|
...decl,
|
|
245
245
|
handler: handlers[decl.name] ?? (async () => `[not implemented] ${decl.name}`),
|
|
246
246
|
}));
|
|
247
|
-
|
|
248
|
-
if (headlessEnabled) {
|
|
249
|
-
const headlessTools = BOTTLE_HEADLESS_TOOL_DECLS.map((decl) => ({
|
|
250
|
-
...decl,
|
|
251
|
-
handler: handlers[decl.name] ?? (async () => `[not implemented] ${decl.name}`),
|
|
252
|
-
}));
|
|
253
|
-
return [...baseTools, ...headlessTools];
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
return baseTools;
|
|
257
247
|
}
|
package/world/world.ts
CHANGED
|
@@ -278,10 +278,9 @@ export class BottleWorld implements World {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
tools(): ToolDef[] {
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
|
|
284
|
-
return bottleTools(this.toolDeps(), this.ctx.cfg.headlessEnabled === true);
|
|
281
|
+
// 宿主缓存会话工具表,声明必须稳定,才能在热开启后立刻使用草稿工具。
|
|
282
|
+
// 是否能读/发只由 handler 的实时开关、生命周期和读信意图校验决定。
|
|
283
|
+
return bottleTools(this.toolDeps());
|
|
285
284
|
}
|
|
286
285
|
|
|
287
286
|
private quotaIndicators(en: boolean): Array<{ label: string; left: number | undefined }> {
|