cortico-world-bottle 1.0.0 → 1.0.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.0.1 · 信箱提示更清楚
4
+
5
+ **2026-11-19**
6
+
7
+ - 信箱上的「这一趟,谁来?」改成「这次怎么开始?」。按钮写清楚了哪些是给桌宠的邀请,哪些是直接请它起草或自己去捞。写信按钮也会提示,写好的信先放在信箱,寄不寄由你决定。
8
+ - 桌宠查看信箱时,回信旁会显示「已共读 X 次」;没有共读记录则显示「尚未共读」,方便认出哪些已经一起看过。普通模式和聊天里处理信件都适用,查看目录不会增加次数,也不会带出正文。
9
+
3
10
  ## 1.0.0 · 把信好好留下,安静地等回音
4
11
 
5
12
  **2026-11-16**
package/README.md CHANGED
@@ -61,7 +61,7 @@ Coo 写一封不超过 120 字的信。**寄不寄,由你决定**。普通模
61
61
 
62
62
  - **Windows**:原生卡片右下角出现,`Esc` 或 `×` 收起,默认 10 秒后自动收起,可在 World 配置中调整,设为 0 则保持显示。写信、读信、回信、收到回复各一张卡片。0.9.3 草稿卡片新增「完整预览」,打开对应网页全文与排版;版本变化时要重新审阅。
63
63
  - **本机信箱页**:其实是一本手写信册,也是卡片起不来时的兜底。可从扩展页最前面的「信箱」页签点击「打开信箱」。按钮由扩展自带的面板提供,不要求更新 Coopanion;地址使用实际启动端口,只绑 `127.0.0.1`。
64
- - 行动按钮上方可选「让 Coo 来吧/让我来吧」,每次进入默认由 Coo 自主选择。Coo 模式的按钮立即发出邀请,写信和打捞各冷却 1 分钟(服务端也会检查,重启不会清空)。人模式的「请 Coo 写一封信」仍由它起草;「去海边打捞」直接把信放进信箱,不发事件、不把正文交给 Coo,也没有邀请冷却;自己捞起后直接放回海里也不会通知 Coo,桌宠捞起的仍保留原来的归还提示。普通模式需你点「一起读」或「写回信」,才将署名、原信标题和正文作为外来信件递给它;共读不自动起草回信。开启聊天处理时按该模式的阅读权限处理,无需为聊天回信再去网页授权。
64
+ - 在「这次怎么开始?」可选「交给 Coo 决定」或「我来发起」。默认模式下,写信和打捞按钮立即发出邀请,写不写、捞不捞由 Coo 决定,两类邀请各有 1 分钟冷却,重启不会清空。「我来发起」下可直接请 Coo 起草,也可自己去捞一封。自己捞到的信直接放进信箱,不发事件、不把正文交给 Coo,也没有邀请冷却。自己捞起后直接放回海里不会通知 Coo,桌宠捞起的仍保留归还提示。普通模式需你点「一起读」或「写回信」,才将署名、原信标题和正文作为外来信件递给它。共读不自动起草回信。开启聊天处理时按该模式的阅读权限处理,无需为聊天回信再去网页授权。
65
65
  - **回信计时**:共读沿用捞起时服务端给出的原期限,不会重新计时,具体时长以该信回执为准。人从网页/卡片请求写回信且有效草稿经支持的服务端确认后,开始两小时自动寄出倒计时;也可提前寄出、重写或放弃。断网或 World 关闭时无法寄出;两小时到点后最多再有 24 小时补寄保护,不会永久占信。不支持保护的旧服务端只支持手动寄回信,页面会说明。聊天和 Controller 新回信为手动稿,沿用原期限;0.9.3 中两类回信失效后都保留正文与装饰。主动新信与小纸条仍由人确认寄出。
66
66
  - 信箱分为「来客来信」「海边邮局」「收到的回信」「寄出的信」。参与漂流瓶往来的人称为「海上来客」;邮局寄来的群岛故事仍单独标明来源,可以珍藏,不收回信。邮局来信的来源行显示作者署名;寄出记录折叠时也显示状态,收到回信用绿色,还在漂用蓝色,被捡起用赭色,海啸用红色,裂瓶用灰紫色。各分区按日期归档,可筛选某一天,不按时分排列。
67
67
  - 信稿单独显示信题,「尚未寄出」只作为状态。只有主动写信带标题,无标题旧信稿显示「无题信」。回信只写正文,原信标题仅在折叠的原信中显示。
package/describe.json CHANGED
@@ -599,7 +599,7 @@
599
599
  },
600
600
  {
601
601
  "name": "bottle_mailbox",
602
- "description": "查手中来信、收信、寄信与回信目录,仅化名和状态,无正文;内部 ID 用于工具,不向伙伴念出。",
602
+ "description": "查来信、寄信与回信目录,含回信共读次数,无正文;尚未共读指无共读记录,不是新的到信。内部 ID 不向伙伴念出。",
603
603
  "parameters": {
604
604
  "type": "object",
605
605
  "additionalProperties": false,
@@ -609,8 +609,8 @@
609
609
  "read"
610
610
  ],
611
611
  "summary": {
612
- "zh": "看一眼信箱:手里待回的信、别人回给我的信。只有化名和状态,没有正文。",
613
- "en": "Lists held letters and answered letters by pseudonym and state, without any text."
612
+ "zh": "查看信箱目录,回信显示已共读次数或尚未共读;只列元信息,不含正文,查看不增加次数。",
613
+ "en": "Lists mailbox metadata and recorded shared-reading counts for replies, without bodies or changing the counts."
614
614
  }
615
615
  },
616
616
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-bottle",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "桌宠起草漂流瓶与小纸条,伙伴确认寄出;共读、回信与星笺记忆分别授权。",
6
6
  "keywords": [
@@ -32,8 +32,8 @@ export const BOTTLE: WorldDefinition<BottleConfigSection> = {
32
32
  en: 'Records a choice not to write, catch, or remind; honors partner refusal and persistent pauses.',
33
33
  },
34
34
  bottle_mailbox: {
35
- zh: '看一眼信箱:手里待回的信、别人回给我的信。只有化名和状态,没有正文。',
36
- en: 'Lists held letters and answered letters by pseudonym and state, without any text.',
35
+ zh: '查看信箱目录,回信显示已共读次数或尚未共读;只列元信息,不含正文,查看不增加次数。',
36
+ en: 'Lists mailbox metadata and recorded shared-reading counts for replies, without bodies or changing the counts.',
37
37
  },
38
38
  }),
39
39
  events: Object.entries(BOTTLE_EVENTS).map(([type,spec])=>({type,...spec})),
@@ -523,7 +523,8 @@ export const pageStyles = `
523
523
  .actor-caption { flex:0 0 auto; font-size:11px; letter-spacing:.16em; color:var(--muted); }
524
524
  #actor-hint { flex:0 0 100%; min-width:0; min-height:0; font-size:11px; line-height:1.7; }
525
525
  .actor-switch { display:inline-flex; flex:0 1 auto; min-width:0; max-width:100%; padding:3px; border-radius:9px; background:var(--soft); border-color:var(--line); }
526
- .actor-switch button { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:7px 13px; border-radius:6px; font-size:12px; color:var(--muted); }
526
+ .actor-switch button { min-width:0; white-space:normal; overflow-wrap:anywhere; padding:7px 13px; border-radius:6px; font-size:12px; color:var(--muted); }
527
+ #actor-human { flex-shrink:0; }
527
528
  .toolbar .actions { grid-area:actions; display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:0; width:auto; }
528
529
  .action-main { display:grid; grid-template-columns:auto minmax(0,1fr); grid-template-rows:auto auto; align-items:center; column-gap:14px; row-gap:2px; padding:18px 20px; min-height:0; border-radius:10px; box-shadow:none; border:1px solid transparent; letter-spacing:.04em; }
529
530
  .action-main .icon { grid-row:1 / span 2; width:26px; height:26px; }
@@ -644,6 +645,7 @@ export const pageStyles = `
644
645
  .opening { padding-top:26px; }
645
646
  .toolbar { padding:22px 16px 20px; gap:14px; }
646
647
  .toolbar .actions { grid-template-columns:1fr; gap:10px; }
648
+ .actor-switch button { padding-inline:8px; }
647
649
  .action-main { padding:15px 16px; }
648
650
  details.invitation-settings { padding:0 16px 2px; }
649
651
  .desk { grid-template-columns:1fr; padding-top:26px; }
@@ -88,13 +88,13 @@ ${readerHtml}
88
88
  </section>
89
89
  <div class="toolbar">
90
90
  <div class="launch-heading"><svg class="icon" aria-hidden="true"><use href="#i-mail"/></svg><span>留给海的一点心事</span></div>
91
- <div class="actor-choice" role="group" aria-label="选择行动主体"><span class="actor-caption">这一趟,谁来?</span><div class="actor-switch"><button id="actor-bot" type="button" aria-pressed="true">让 Coo 来吧</button><button id="actor-human" type="button" aria-pressed="false">让我来吧</button></div><small id="actor-hint">递一份邀请,去不去由 Coo 决定。</small></div>
91
+ <div class="actor-choice" role="group" aria-labelledby="actor-caption"><span class="actor-caption" id="actor-caption">这次怎么开始?</span><div class="actor-switch"><button id="actor-bot" type="button" aria-pressed="true">交给 Coo 决定</button><button id="actor-human" type="button" aria-pressed="false">我来发起</button></div><small id="actor-hint">递一份邀请,写不写、捞不捞,由 Coo 决定。</small></div>
92
92
  <div class="actions">
93
- <button class="action-main" id="write-button" type="button"><svg class="icon" aria-hidden="true"><use href="#i-pen"/></svg><strong id="write-label">写一封信</strong><small>把此刻的心事寄给远方</small></button>
94
- <button class="action-main catch" id="catch-button" type="button"><svg class="icon" aria-hidden="true"><use href="#i-bottle"/></svg><strong id="catch-label">去海边打捞</strong><small>捞起海上来客的一封信</small></button>
93
+ <button class="action-main" id="write-button" type="button"><svg class="icon" aria-hidden="true"><use href="#i-pen"/></svg><strong id="write-label">邀请 Coo 写一封信</strong><small>写好了就放在信箱,寄不寄由你。</small></button>
94
+ <button class="action-main catch" id="catch-button" type="button"><svg class="icon" aria-hidden="true"><use href="#i-bottle"/></svg><strong id="catch-label">邀请 Coo 去打捞</strong><small>捞起海上来客的一封信</small></button>
95
95
  </div>
96
96
  <div class="invitation-outcome" role="status" aria-live="polite"><span class="invitation-outcome-label">邀请回音</span><p id="wake-outcome">还没有新的邀请。</p></div>
97
- <p id="action-note" role="status">信写好后,寄不寄由你决定。</p>
97
+ <p id="action-note" role="status">写信和打捞邀请各有一分钟间隔。</p>
98
98
  </div>
99
99
  </div>
100
100
  <details class="invitation-settings"><summary>海边的邀请 · 间隔与次数</summary>
@@ -705,18 +705,23 @@ var wakePolicies = ${JSON.stringify(WAKE_POLICIES)};
705
705
  var cooldowns = state.cooldowns || {};
706
706
  var writeSeconds = isBot ? Math.max(0, Math.ceil(((cooldowns.write || 0) - Date.now()) / 1000)) : 0;
707
707
  var catchSeconds = isBot ? Math.max(0, Math.ceil(((cooldowns.catch || 0) - Date.now()) / 1000)) : 0;
708
- document.getElementById('actor-bot').textContent = '让' + botName() + '来吧';
708
+ var name = botName();
709
+ document.getElementById('actor-bot').textContent = '交给 ' + name + ' 决定';
709
710
  document.getElementById('actor-bot').setAttribute('aria-pressed', String(isBot));
710
711
  document.getElementById('actor-human').setAttribute('aria-pressed', String(!isBot));
711
- document.getElementById('actor-hint').textContent = isBot ? '递一份邀请,写不写、捞不捞都由' + botName() + '决定。' : '你来打捞,信只给你看;点回信后才交给' + botName() + '。';
712
- document.getElementById('write-label').textContent = (isBot ? '写一封信' : '请' + botName() + '写一封信') + (writeSeconds ? ' · ' + writeSeconds + '秒' : '');
713
- document.getElementById('catch-label').textContent = '去海边打捞' + (catchSeconds ? ' · ' + catchSeconds + '秒' : '');
712
+ document.getElementById('actor-hint').textContent = isBot
713
+ ? '递一份邀请,写不写、捞不捞,由 ' + name + ' 决定。'
714
+ : '你可以自己捞瓶子,也可以请 ' + name + ' 起草。';
715
+ document.getElementById('write-label').textContent = (isBot ? '邀请 ' + name + ' 写一封信' : '请 ' + name + ' 起草一封信')
716
+ + (writeSeconds ? ' · ' + writeSeconds + '秒' : '');
717
+ document.getElementById('catch-label').textContent = (isBot ? '邀请 ' + name + ' 去打捞' : '我去海边捞一封')
718
+ + (catchSeconds ? ' · ' + catchSeconds + '秒' : '');
714
719
  var active = state.wake && state.wake.active;
715
720
  document.getElementById('write-button').disabled = busy || !!state.pendingAction || !!letterDraft || writeSeconds > 0 || (isBot && (!!active || !!state.held || !!state.replyDraft && !state.replyDraft.sendFailure));
716
721
  document.getElementById('catch-button').disabled = busy || !!state.pendingAction || !!state.held || catchSeconds > 0 || (isBot && (!!active || !!letterDraft || !!state.replyDraft && !state.replyDraft.sendFailure));
717
722
  document.getElementById('action-note').textContent = state.pendingAction
718
- ? '已请' + botName() + '写信,等候落笔…'
719
- : isBot ? '邀请后各等一分钟。信写好后,寄不寄由你。' : '打捞不通知' + botName() + ',寄不寄由你。';
723
+ ? '已请' + name + '写信,等候落笔…'
724
+ : isBot ? '写信和打捞邀请各有一分钟间隔。' : '你捞到的信先给你看,等你邀请后再交给 ' + name + '。';
720
725
  renderWakeControls();
721
726
  document.getElementById('hero-note').textContent = '你与' + botName() + '的海边信箱。留一封信给海,也等一封信靠岸。';
722
727
  var replies = (state.sent || []).filter(function (item) { return item.reply; }).length;
package/world/tools.ts CHANGED
@@ -137,7 +137,7 @@ export const BOTTLE_TOOL_DECLS: ReadonlyArray<Omit<ToolDef, 'handler'>> = [
137
137
  name: 'bottle_mailbox',
138
138
  tags: ['read'],
139
139
  description:
140
- "查手中来信、收信、寄信与回信目录,仅化名和状态,无正文;内部 ID 用于工具,不向伙伴念出。",
140
+ "查来信、寄信与回信目录,含回信共读次数,无正文;尚未共读指无共读记录,不是新的到信。内部 ID 不向伙伴念出。",
141
141
  parameters: { type: 'object', additionalProperties: false, properties: {} },
142
142
  },
143
143
  ];
package/world/world.ts CHANGED
@@ -1808,6 +1808,10 @@ export class BottleWorld implements World {
1808
1808
 
1809
1809
  await this.refreshMailbox();
1810
1810
 
1811
+ const replyReadLabel = (reply: LocalReply): string => {
1812
+ const count = readingCount(reply.readCount);
1813
+ return count > 0 ? `(已共读${count}次)` : '(尚未共读)';
1814
+ };
1811
1815
  const lines: string[] = [];
1812
1816
  const held = this.store.held;
1813
1817
  if (held) {
@@ -1818,13 +1822,16 @@ export class BottleWorld implements World {
1818
1822
  );
1819
1823
  }
1820
1824
  for (const reply of this.store.replies) {
1821
- lines.push(`· ${reply.from} — 你寄出的信,对方回了`);
1825
+ lines.push(`· ${reply.from} — 你寄出的信,对方回了${replyReadLabel(reply)}`);
1822
1826
  }
1823
1827
  if (this.ctx.cfg.headlessEnabled === true) {
1824
1828
  return ['信箱目录(不含正文):', ...(held ? [`ID: ${held.letterId},当前手中信,来自 ${held.from}`] : []),
1825
1829
  ...this.store.received.filter(r => r.letterId !== held?.letterId).map(r => `ID: ${r.letterId},已存来信,来自 ${r.from}`),
1826
- ...this.store.sent.map(r => `ID: ${r.letterId},已寄信${this.store.replies.some(a => a.letterId === r.letterId) ? ',有回信' : ''}`),
1827
- ...this.store.replies.filter(r => !this.store.sent.some(a => a.letterId === r.letterId)).map(r => `ID: ${r.letterId},已收回信,来自 ${r.from}`)].join('\n');
1830
+ ...this.store.sent.map(r => {
1831
+ const reply = this.store.replies.find(a => a.letterId === r.letterId);
1832
+ return `ID: ${r.letterId},已寄信${reply ? ',有回信' + replyReadLabel(reply) : ''}`;
1833
+ }),
1834
+ ...this.store.replies.filter(r => !this.store.sent.some(a => a.letterId === r.letterId)).map(r => `ID: ${r.letterId},已收回信,来自 ${r.from}${replyReadLabel(r)}`)].join('\n');
1828
1835
  }
1829
1836
  if (lines.length === 0) return '信箱是空的。';
1830
1837
  return `信箱里有 ${lines.length} 封\n${lines.join('\n')}\n(正文只在伙伴的信箱页上。)`;