@musnows/scriverse 0.6.5 → 0.6.7
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 +3 -1
- package/dist/ai.js +11 -5
- package/dist/ai.js.map +1 -1
- package/dist/app.js +3 -0
- package/dist/app.js.map +1 -1
- package/dist/cli-contract.js +6 -5
- package/dist/cli-contract.js.map +1 -1
- package/dist/database.js +28 -1
- package/dist/database.js.map +1 -1
- package/dist/public/app.js +80 -21
- package/dist/public/character-version.js +1 -0
- package/dist/public/index.html +5 -5
- package/dist/public/styles.css +80 -26
- package/dist/public/timeline-view.d.ts +50 -0
- package/dist/public/timeline-view.js +119 -0
- package/dist/security.js +4 -3
- package/dist/security.js.map +1 -1
- package/dist/store.js +33 -22
- package/dist/store.js.map +1 -1
- package/dist/utils.js +8 -0
- package/dist/utils.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,9 +116,11 @@ CLI 会按服务器保存登录凭据。所有连接服务的数据命令都可
|
|
|
116
116
|
| `APP_AUTH_PASSWORD` | 空 | 可选的部署网关密码,至少 12 个字符;必须通过 HTTPS 传输 |
|
|
117
117
|
| `APP_TRUST_PROXY` | `false` | 位于可信反向代理后时设为代理跳数(通常为 `1`)或 `true` |
|
|
118
118
|
| `APP_ALLOW_PRIVATE_AI_ENDPOINTS` | 开发环境 `true`,生产环境 `false` | 是否允许 AI 供应商连接本机或内网地址;链路本地与云元数据地址始终禁止 |
|
|
119
|
-
| `APP_ALLOW_REGISTRATION` | `false` | 仅明确设为 `true` 时开放注册;未设置或其他值均关闭,首次初始化创建管理员也必须显式开启 |
|
|
119
|
+
| `APP_ALLOW_REGISTRATION` | `false` | 仅明确设为 `true` 或 `1` 时开放注册;未设置或其他值均关闭,首次初始化创建管理员也必须显式开启 |
|
|
120
120
|
| `APP_SETUP_TOKEN` | 空 | 开放注册时必填且至少 32 个字符;仅首位管理员注册需要在页面输入 |
|
|
121
121
|
|
|
122
|
+
布尔环境变量统一接受 `true`/`1` 表示开启、`false`/`0` 表示关闭;其他数字不会被解析为布尔值。`APP_TRUST_PROXY` 例外,其 `0`–`10` 数字表示可信代理跳数。
|
|
123
|
+
|
|
122
124
|
自定义示例:
|
|
123
125
|
|
|
124
126
|
```bash
|
package/dist/ai.js
CHANGED
|
@@ -373,7 +373,7 @@ const AGENT_TOOL_DEFINITIONS = {
|
|
|
373
373
|
type: "function",
|
|
374
374
|
function: {
|
|
375
375
|
name: "search_story_entities",
|
|
376
|
-
description: "按短关键词在结构化作品实体中进行元数据、精确全文和拼音混合检索:设定、人物(含 Markdown
|
|
376
|
+
description: "按短关键词在结构化作品实体中进行元数据、精确全文和拼音混合检索:设定、人物(含 Markdown 档案章节)、种族、组织、时间线、关系、大纲和伏笔。人物、种族、组织结果分别包含权威布尔状态 isDead、isExtinct、isDissolved;只有值为 true 才能判定该角色已死亡、该种族已灭绝或该组织已解散,字段为 false 时必须视为仍存活、未灭绝或未解散,禁止根据正文情节自行改判。不是语义问答;请传入实体名、别名、标题、拼音或短关键词,不要传入自然语言整句。结果按综合相关度排序;人物结果含 sectionId 时可再调用 read_character_sections 精读。无匹配时改用更短关键词,或改用 story_index / grep。",
|
|
377
377
|
parameters: { type: "object", properties: { query: { type: "string", minLength: 1, maxLength: 200 }, categories: { type: "array", items: { type: "string", enum: ["setting", "character", "race", "organization", "timeline", "relationship", "outline", "foreshadow"] }, maxItems: 8 }, limit: { type: "integer", minimum: 1, maximum: 30, default: 30 }, cursor: agentToolCursorParameter }, required: ["query"], additionalProperties: false }
|
|
378
378
|
}
|
|
379
379
|
},
|
|
@@ -381,7 +381,7 @@ const AGENT_TOOL_DEFINITIONS = {
|
|
|
381
381
|
type: "function",
|
|
382
382
|
function: {
|
|
383
383
|
name: "read_character_sections",
|
|
384
|
-
description: "读取指定人物 Markdown
|
|
384
|
+
description: "读取指定人物 Markdown 档案章节的摘要或原文,并返回该人物的权威 isDead 状态。只有 isDead=true 才能判定人物已死亡;isDead=false 时必须视为仍存活,禁止根据章节内容自行改判。先通过 search_story_entities 获取 sectionId;每次最多读取 3 个章节。",
|
|
385
385
|
parameters: { type: "object", properties: { sectionIds: { type: "array", items: { type: "string" }, minItems: 1, maxItems: 3 }, include: { type: "string", enum: ["summary", "content", "both"] }, cursor: agentToolCursorParameter }, required: ["sectionIds"], additionalProperties: false }
|
|
386
386
|
}
|
|
387
387
|
},
|
|
@@ -397,7 +397,7 @@ const AGENT_TOOL_DEFINITIONS = {
|
|
|
397
397
|
type: "function",
|
|
398
398
|
function: {
|
|
399
399
|
name: "recall_self",
|
|
400
|
-
description: "
|
|
400
|
+
description: "回忆与当前扮演角色自身有关的资料。角色、种族、组织状态分别以 isDead、isExtinct、isDissolved 为唯一权威标识;只有值为 true 才能判定已死亡、已灭绝或已解散,字段为 false 时必须视为仍存活、未灭绝或未解散,禁止根据回忆、正文或剧情暗示自行改判。只能读取自己的角色卡、人物档案章节,以及自己参与的关系、时间线和正文片段;不能指定或查询其他角色。",
|
|
401
401
|
parameters: { type: "object", properties: { query: { type: "string", maxLength: 200, default: "", description: "可选的回忆关键词;留空时返回角色自身的核心资料。" }, categories: { type: "array", items: { type: "string", enum: ["profile", "sections", "relationships", "timeline", "chapters"] }, maxItems: 5 }, cursor: agentToolCursorParameter }, additionalProperties: false }
|
|
402
402
|
}
|
|
403
403
|
}
|
|
@@ -3315,9 +3315,11 @@ export class AiManager {
|
|
|
3315
3315
|
delete profile.sections;
|
|
3316
3316
|
const roleCard = {
|
|
3317
3317
|
name: character.name,
|
|
3318
|
+
isDead: character.isDead,
|
|
3318
3319
|
code: character.code,
|
|
3319
3320
|
aliases: character.aliases,
|
|
3320
3321
|
species: character.species,
|
|
3322
|
+
race: character.race,
|
|
3321
3323
|
organizations: character.organizations,
|
|
3322
3324
|
attributes: character.attributes,
|
|
3323
3325
|
profile,
|
|
@@ -3461,9 +3463,11 @@ export class AiManager {
|
|
|
3461
3463
|
const record = {
|
|
3462
3464
|
category: "profile",
|
|
3463
3465
|
name: character.name,
|
|
3466
|
+
isDead: character.isDead,
|
|
3464
3467
|
code: character.code,
|
|
3465
3468
|
aliases: character.aliases,
|
|
3466
3469
|
species: character.species,
|
|
3470
|
+
race: character.race,
|
|
3467
3471
|
organizations: character.organizations,
|
|
3468
3472
|
attributes: character.attributes,
|
|
3469
3473
|
profile,
|
|
@@ -3692,6 +3696,7 @@ export class AiManager {
|
|
|
3692
3696
|
sectionId,
|
|
3693
3697
|
characterId: section.characterId,
|
|
3694
3698
|
characterName: character.name,
|
|
3699
|
+
isDead: character.isDead,
|
|
3695
3700
|
title: section.title,
|
|
3696
3701
|
sectionType: section.sectionType,
|
|
3697
3702
|
versionNo: section.versionNo,
|
|
@@ -6423,7 +6428,7 @@ export class AiManager {
|
|
|
6423
6428
|
if (String(item.workId) !== workId)
|
|
6424
6429
|
return null;
|
|
6425
6430
|
return source(`人物档案:${String(item.name)}`, {
|
|
6426
|
-
name: item.name, aliases: item.aliases, code: item.code, species: item.species, race: item.race,
|
|
6431
|
+
name: item.name, isDead: item.isDead, aliases: item.aliases, code: item.code, species: item.species, race: item.race,
|
|
6427
6432
|
organizations: item.organizations, attributes: item.attributes, profile: item.profile,
|
|
6428
6433
|
currentState: item.currentState, lockedFields: item.lockedFields,
|
|
6429
6434
|
profileSections: this.store.listCharacterProfileSections(sourceId).map((section) => ({
|
|
@@ -6440,6 +6445,7 @@ export class AiManager {
|
|
|
6440
6445
|
return null;
|
|
6441
6446
|
return source(`种族设定:${String(item.name)}`, {
|
|
6442
6447
|
name: item.name,
|
|
6448
|
+
isExtinct: item.isExtinct,
|
|
6443
6449
|
description: item.description,
|
|
6444
6450
|
racePath: item.lineage.map((entry) => entry.name).join(" / "),
|
|
6445
6451
|
lineage: item.lineage,
|
|
@@ -6452,7 +6458,7 @@ export class AiManager {
|
|
|
6452
6458
|
if (String(item.workId) !== workId)
|
|
6453
6459
|
return null;
|
|
6454
6460
|
return source(`组织设定:${String(item.name)}`, {
|
|
6455
|
-
name: item.name, description: item.description, settings: item.settings, members: item.members
|
|
6461
|
+
name: item.name, isDissolved: item.isDissolved, description: item.description, settings: item.settings, members: item.members
|
|
6456
6462
|
}, item.versionNo);
|
|
6457
6463
|
}
|
|
6458
6464
|
if (sourceType === "timeline-track") {
|