@lemoncat7/dsh-partner 2.24.0-rc.9 → 2.25.8
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 +2 -2
- package/docs/releases/2.24.0-rc.10.md +8 -0
- package/docs/releases/2.24.0-rc.11.md +10 -0
- package/docs/releases/2.25.0-rc.1.md +12 -0
- package/docs/releases/2.25.0-rc.11.md +5 -0
- package/docs/releases/2.25.0-rc.2.md +10 -0
- package/docs/releases/2.25.0-rc.3.md +11 -0
- package/docs/releases/2.25.0-rc.4.md +3 -0
- package/docs/releases/2.25.0-rc.5.md +3 -0
- package/docs/releases/2.25.0.md +32 -0
- package/docs/releases/2.25.1.md +11 -0
- package/docs/releases/2.25.2.md +8 -0
- package/docs/releases/2.25.3.md +11 -0
- package/docs/releases/2.25.4.md +10 -0
- package/docs/releases/2.25.5.md +10 -0
- package/docs/releases/2.25.6.md +7 -0
- package/docs/releases/2.25.7.md +9 -0
- package/docs/releases/2.25.8.md +7 -0
- package/lib/agent-runtime.d.ts +2 -1
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +45 -18
- package/lib/agent-runtime.js.map +1 -1
- package/lib/api/features/tts-api.d.ts +4 -0
- package/lib/api/features/tts-api.d.ts.map +1 -0
- package/lib/api/features/tts-api.js +49 -0
- package/lib/api/features/tts-api.js.map +1 -0
- package/lib/api.d.ts +2 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +11 -5
- package/lib/api.js.map +1 -1
- package/lib/attachments/delivery-receipt.d.ts +15 -0
- package/lib/attachments/delivery-receipt.d.ts.map +1 -1
- package/lib/attachments/delivery-receipt.js +23 -0
- package/lib/attachments/delivery-receipt.js.map +1 -1
- package/lib/channels/activity-defaults.d.ts.map +1 -1
- package/lib/channels/activity-defaults.js +5 -0
- package/lib/channels/activity-defaults.js.map +1 -1
- package/lib/channels/direct/transport.d.ts +1 -1
- package/lib/channels/direct/transport.d.ts.map +1 -1
- package/lib/channels/manager.d.ts +3 -0
- package/lib/channels/manager.d.ts.map +1 -1
- package/lib/channels/manager.js +30 -2
- package/lib/channels/manager.js.map +1 -1
- package/lib/channels/outbound-media.d.ts +1 -1
- package/lib/channels/outbound-media.d.ts.map +1 -1
- package/lib/channels/outbound-media.js +3 -2
- package/lib/channels/outbound-media.js.map +1 -1
- package/lib/channels/qq/authority.js +1 -1
- package/lib/channels/qq/authority.js.map +1 -1
- package/lib/channels/qq/reply-tool.d.ts +1 -1
- package/lib/channels/qq/reply-tool.d.ts.map +1 -1
- package/lib/channels/qq/reply-tool.js +14 -7
- package/lib/channels/qq/reply-tool.js.map +1 -1
- package/lib/channels/weixin/api.d.ts +1 -1
- package/lib/channels/weixin/api.d.ts.map +1 -1
- package/lib/channels/weixin/api.js +7 -1
- package/lib/channels/weixin/api.js.map +1 -1
- package/lib/channels/weixin/connect.d.ts +2 -0
- package/lib/channels/weixin/connect.d.ts.map +1 -1
- package/lib/character/activity-journal.d.ts +3 -1
- package/lib/character/activity-journal.d.ts.map +1 -1
- package/lib/character/activity-journal.js +43 -7
- package/lib/character/activity-journal.js.map +1 -1
- package/lib/character/activity-summary.d.ts +23 -0
- package/lib/character/activity-summary.d.ts.map +1 -0
- package/lib/character/activity-summary.js +23 -0
- package/lib/character/activity-summary.js.map +1 -0
- package/lib/character/activity-tool.js +1 -1
- package/lib/character/activity-tool.js.map +1 -1
- package/lib/character/conversation-behavior.d.ts +2 -0
- package/lib/character/conversation-behavior.d.ts.map +1 -1
- package/lib/character/conversation-behavior.js +20 -7
- package/lib/character/conversation-behavior.js.map +1 -1
- package/lib/character/domain.d.ts +1 -0
- package/lib/character/domain.d.ts.map +1 -1
- package/lib/character/domain.js +3 -0
- package/lib/character/domain.js.map +1 -1
- package/lib/character/idle-contact.d.ts +8 -1
- package/lib/character/idle-contact.d.ts.map +1 -1
- package/lib/character/idle-contact.js +64 -10
- package/lib/character/idle-contact.js.map +1 -1
- package/lib/character/thought-budget.d.ts +8 -0
- package/lib/character/thought-budget.d.ts.map +1 -0
- package/lib/character/thought-budget.js +39 -0
- package/lib/character/thought-budget.js.map +1 -0
- package/lib/character/thought-tool.d.ts.map +1 -1
- package/lib/character/thought-tool.js +38 -16
- package/lib/character/thought-tool.js.map +1 -1
- package/lib/character/thoughts.d.ts +3 -1
- package/lib/character/thoughts.d.ts.map +1 -1
- package/lib/character/thoughts.js +20 -16
- package/lib/character/thoughts.js.map +1 -1
- package/lib/chat/conversation.js +1 -1
- package/lib/chat/conversation.js.map +1 -1
- package/lib/chat/live-speech.d.ts +4 -2
- package/lib/chat/live-speech.d.ts.map +1 -1
- package/lib/chat/live-speech.js +43 -33
- package/lib/chat/live-speech.js.map +1 -1
- package/lib/chat/persona-delivery.d.ts +2 -0
- package/lib/chat/persona-delivery.d.ts.map +1 -1
- package/lib/chat/persona-delivery.js +19 -18
- package/lib/chat/persona-delivery.js.map +1 -1
- package/lib/chat/preferred-voice.d.ts +21 -0
- package/lib/chat/preferred-voice.d.ts.map +1 -0
- package/lib/chat/preferred-voice.js +75 -0
- package/lib/chat/preferred-voice.js.map +1 -0
- package/lib/chat/protocol.d.ts +5 -2
- package/lib/chat/protocol.d.ts.map +1 -1
- package/lib/chat/protocol.js +1 -1
- package/lib/chat/protocol.js.map +1 -1
- package/lib/chat/reply-completion.d.ts +3 -1
- package/lib/chat/reply-completion.d.ts.map +1 -1
- package/lib/chat/reply-completion.js +13 -5
- package/lib/chat/reply-completion.js.map +1 -1
- package/lib/chat/task-followup.d.ts +59 -0
- package/lib/chat/task-followup.d.ts.map +1 -0
- package/lib/chat/task-followup.js +111 -0
- package/lib/chat/task-followup.js.map +1 -0
- package/lib/chat/tools.d.ts +2 -1
- package/lib/chat/tools.d.ts.map +1 -1
- package/lib/chat/tools.js +39 -17
- package/lib/chat/tools.js.map +1 -1
- package/lib/client-api.d.ts +7 -0
- package/lib/client-api.d.ts.map +1 -1
- package/lib/client-api.js.map +1 -1
- package/lib/client.activities.js +57 -0
- package/lib/client.js +1169 -1134
- package/lib/client.js.map +4 -4
- package/lib/client.tts.js +7 -0
- package/lib/collaboration/composition.d.ts.map +1 -1
- package/lib/collaboration/composition.js +1 -3
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/collaboration/tool-discovery.d.ts +1 -1
- package/lib/collaboration/tool-discovery.d.ts.map +1 -1
- package/lib/collaboration/tool-discovery.js +12 -7
- package/lib/collaboration/tool-discovery.js.map +1 -1
- package/lib/companions/identity-tool.d.ts +3 -0
- package/lib/companions/identity-tool.d.ts.map +1 -1
- package/lib/companions/identity-tool.js +1 -1
- package/lib/companions/identity-tool.js.map +1 -1
- package/lib/companions/management.d.ts +4 -4
- package/lib/concern-execution-receipt.d.ts +2 -1
- package/lib/concern-execution-receipt.d.ts.map +1 -1
- package/lib/concern-execution-receipt.js +15 -13
- package/lib/concern-execution-receipt.js.map +1 -1
- package/lib/concern-execution.d.ts +3 -1
- package/lib/concern-execution.d.ts.map +1 -1
- package/lib/concern-execution.js +20 -1
- package/lib/concern-execution.js.map +1 -1
- package/lib/concern-recording.d.ts +1 -1
- package/lib/concern-recording.d.ts.map +1 -1
- package/lib/concern-recording.js +14 -5
- package/lib/concern-recording.js.map +1 -1
- package/lib/concern-store.d.ts.map +1 -1
- package/lib/concern-store.js +3 -1
- package/lib/concern-store.js.map +1 -1
- package/lib/conversation-history-recall.d.ts +7 -0
- package/lib/conversation-history-recall.d.ts.map +1 -1
- package/lib/conversation-history-recall.js +15 -7
- package/lib/conversation-history-recall.js.map +1 -1
- package/lib/domain.d.ts +3 -0
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js.map +1 -1
- package/lib/execution/task-preamble.d.ts +3 -0
- package/lib/execution/task-preamble.d.ts.map +1 -1
- package/lib/execution/task-preamble.js +32 -2
- package/lib/execution/task-preamble.js.map +1 -1
- package/lib/execution/work-tool.js +1 -1
- package/lib/execution/work-tool.js.map +1 -1
- package/lib/heartbeat.js +1 -1
- package/lib/heartbeat.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -3
- package/lib/index.js.map +1 -1
- package/lib/memory-store.d.ts +1 -1
- package/lib/observation-loop.d.ts.map +1 -1
- package/lib/observation-loop.js +7 -3
- package/lib/observation-loop.js.map +1 -1
- package/lib/rolling-context.d.ts +1 -1
- package/lib/rolling-context.d.ts.map +1 -1
- package/lib/rolling-context.js +1 -1
- package/lib/rolling-context.js.map +1 -1
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +16 -3
- package/lib/store.js.map +1 -1
- package/lib/ui/channels-panel.d.ts.map +1 -1
- package/lib/ui/channels-panel.js +9 -3
- package/lib/ui/channels-panel.js.map +1 -1
- package/lib/ui/character-editor.js +1 -1
- package/lib/ui/character-editor.js.map +1 -1
- package/lib/ui/identity-editor.js +1 -1
- package/lib/ui/identity-editor.js.map +1 -1
- package/lib/ui/idle-contact-editor.d.ts.map +1 -1
- package/lib/ui/idle-contact-editor.js +2 -3
- package/lib/ui/idle-contact-editor.js.map +1 -1
- package/lib/ui/memory/concern-board.js +1 -1
- package/lib/ui/memory/concern-board.js.map +1 -1
- package/lib/ui/memory/concern-execution-status.d.ts.map +1 -1
- package/lib/ui/memory/concern-execution-status.js +2 -2
- package/lib/ui/memory/concern-execution-status.js.map +1 -1
- package/lib/ui/push-draft.d.ts +2 -2
- package/lib/ui/qq-channel-settings.js +3 -3
- package/lib/ui/qq-channel-settings.js.map +1 -1
- package/lib/ui/thoughts-panel-loader.d.ts +4 -0
- package/lib/ui/thoughts-panel-loader.d.ts.map +1 -0
- package/lib/ui/thoughts-panel-loader.js +23 -0
- package/lib/ui/thoughts-panel-loader.js.map +1 -0
- package/lib/ui/thoughts-panel.d.ts.map +1 -1
- package/lib/ui/thoughts-panel.js +27 -10
- package/lib/ui/thoughts-panel.js.map +1 -1
- package/lib/ui/tts-settings-loader.d.ts +4 -0
- package/lib/ui/tts-settings-loader.d.ts.map +1 -0
- package/lib/ui/tts-settings-loader.js +23 -0
- package/lib/ui/tts-settings-loader.js.map +1 -0
- package/lib/ui/tts-settings.d.ts +11 -0
- package/lib/ui/tts-settings.d.ts.map +1 -0
- package/lib/ui/tts-settings.js +63 -0
- package/lib/ui/tts-settings.js.map +1 -0
- package/lib/voice/audio-tail.d.ts +6 -0
- package/lib/voice/audio-tail.d.ts.map +1 -0
- package/lib/voice/audio-tail.js +72 -0
- package/lib/voice/audio-tail.js.map +1 -0
- package/lib/voice/credentials.d.ts +9 -0
- package/lib/voice/credentials.d.ts.map +1 -0
- package/lib/voice/credentials.js +12 -0
- package/lib/voice/credentials.js.map +1 -0
- package/lib/voice/domain.d.ts +42 -0
- package/lib/voice/domain.d.ts.map +1 -0
- package/lib/voice/domain.js +53 -0
- package/lib/voice/domain.js.map +1 -0
- package/lib/voice/service.d.ts +63 -0
- package/lib/voice/service.d.ts.map +1 -0
- package/lib/voice/service.js +211 -0
- package/lib/voice/service.js.map +1 -0
- package/lib/voice/synthesize.d.ts +12 -0
- package/lib/voice/synthesize.d.ts.map +1 -0
- package/lib/voice/synthesize.js +99 -0
- package/lib/voice/synthesize.js.map +1 -0
- package/lib/voice/tool.d.ts +7 -0
- package/lib/voice/tool.d.ts.map +1 -0
- package/lib/voice/tool.js +75 -0
- package/lib/voice/tool.js.map +1 -0
- package/lib/voice/validation.d.ts +3 -0
- package/lib/voice/validation.d.ts.map +1 -0
- package/lib/voice/validation.js +31 -0
- package/lib/voice/validation.js.map +1 -0
- package/package.json +18 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-partner", chunk: 'client.activities.js', factory: (require) => { var module = { exports: {} }; var exports = module.exports;
|
|
2
|
+
"use strict";var V=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var F=(r,n)=>{for(var a in n)V(r,a,{get:n[a],enumerable:!0})},Q=(r,n,a,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of K(n))!W.call(r,o)&&o!==a&&V(r,o,{get:()=>n[o],enumerable:!(s=U(n,o))||s.enumerable});return r};var Y=r=>Q(V({},"__esModule",{value:!0}),r);var ae={};F(ae,{ThoughtsPanel:()=>ne});module.exports=Y(ae);var j=`/* Autonomous activity: one legible surface, compact rows, details on demand. */
|
|
3
|
+
.dsh-partner-settings-panel > .dsh-partner-character.dsh-partner-autonomy { background:var(--partner-solid-panel); border:1px solid var(--partner-border); border-radius:14px; padding:18px; min-width:0; }
|
|
4
|
+
.dsh-partner-autonomy .dsh-partner-autonomy-settings { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:16px; margin:0 0 16px; padding:0; border:0; }
|
|
5
|
+
.dsh-partner-autonomy-settings select { width:100%; min-width:0; text-overflow:ellipsis; }
|
|
6
|
+
.dsh-partner-activity-board { min-width:0; color:var(--partner-text); }
|
|
7
|
+
.dsh-partner-activity-board p { margin:0; line-height:1.65; overflow-wrap:anywhere; }
|
|
8
|
+
.dsh-partner-activity-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 0; border-top:1px solid var(--partner-border); }
|
|
9
|
+
.dsh-partner-activity-board button { color:var(--partner-text); background:var(--partner-solid-control); border:1px solid var(--partner-border); border-radius:8px; padding:8px 12px; min-height:44px; font:inherit; cursor:pointer; box-shadow:none; }
|
|
10
|
+
.dsh-partner-activity-board button:disabled { opacity:.6; cursor:default; }
|
|
11
|
+
.dsh-partner-activity-board button:hover:not(:disabled) { background:var(--partner-hover); }
|
|
12
|
+
.dsh-partner-activity-board :is(button,summary):focus-visible,.dsh-partner-autonomy-habits>summary:focus-visible { outline:2px solid var(--partner-focus-ring); outline-offset:2px; }
|
|
13
|
+
.dsh-partner-activity-switcher { display:flex; gap:4px; padding:3px; border-radius:10px; background:var(--partner-selected); }
|
|
14
|
+
.dsh-partner-activity-switcher button { display:flex; align-items:center; gap:6px; background:transparent; border-color:transparent; }
|
|
15
|
+
.dsh-partner-activity-switcher button[aria-pressed=true] { background:var(--partner-solid-control); border-color:var(--partner-border); font-weight:600; }
|
|
16
|
+
.dsh-partner-activity-switcher span { color:var(--partner-text-secondary); font-size:12px; font-variant-numeric:tabular-nums; }
|
|
17
|
+
.dsh-partner-activity-board .dsh-partner-activity-refresh { background:transparent; }
|
|
18
|
+
.dsh-partner-activity-overview { display:flex; flex-wrap:wrap; gap:8px 18px; padding:4px 0 14px; color:var(--partner-text-secondary); font-size:13px; }
|
|
19
|
+
.dsh-partner-activity-overview b { color:var(--partner-text); margin-left:4px; font-variant-numeric:tabular-nums; }
|
|
20
|
+
.dsh-partner-activity-overview [data-warning=true],.dsh-partner-activity-warning { color:var(--partner-warning); }
|
|
21
|
+
.dsh-partner-activity-row { border-top:1px solid var(--partner-border); min-width:0; }
|
|
22
|
+
.dsh-partner-activity-row>summary { display:flex; flex-direction:column; gap:6px; position:relative; padding:14px 24px 14px 0; cursor:pointer; list-style:none; min-height:44px; }
|
|
23
|
+
.dsh-partner-activity-row>summary::-webkit-details-marker { display:none; }
|
|
24
|
+
.dsh-partner-activity-row>summary::after { content:'\u203A'; position:absolute; right:4px; top:17px; color:var(--partner-text-secondary); font-size:18px; }
|
|
25
|
+
.dsh-partner-activity-row[open]>summary::after { transform:rotate(90deg); }
|
|
26
|
+
.dsh-partner-activity-row>summary:hover { background:var(--partner-hover); }
|
|
27
|
+
.dsh-partner-activity-copy { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; line-height:1.65; font-size:14px; white-space:normal; overflow-wrap:anywhere; }
|
|
28
|
+
.dsh-partner-activity-row[open] .dsh-partner-activity-copy { display:block; }
|
|
29
|
+
.dsh-partner-activity-meta { display:flex; flex-wrap:wrap; gap:4px 12px; font-size:12px; color:var(--partner-text-secondary); }
|
|
30
|
+
.dsh-partner-activity-board small { color:var(--partner-text-secondary); line-height:1.6; font-size:12px; overflow-wrap:anywhere; }
|
|
31
|
+
.dsh-partner-activity-detail { display:grid; gap:10px; padding:0 0 16px; font-size:13px; }
|
|
32
|
+
.dsh-partner-activity-detail details { padding:0 12px; background:var(--partner-solid-raised); border-radius:8px; }
|
|
33
|
+
.dsh-partner-activity-detail details>summary,.dsh-partner-activity-footnote>summary,.dsh-partner-activity-archive>summary,.dsh-partner-autonomy-habits>summary { cursor:pointer; padding:12px 0; min-height:44px; box-sizing:border-box; color:var(--partner-text-secondary); font-size:13px; }
|
|
34
|
+
.dsh-partner-activity-detail details>p { padding-bottom:12px; }
|
|
35
|
+
.dsh-partner-activity-detail li { overflow-wrap:anywhere; padding:2px 0; }
|
|
36
|
+
.dsh-partner-activity-evidence { white-space:pre-wrap; }
|
|
37
|
+
.dsh-partner-activity-artifact { display:flex; gap:12px; align-items:center; padding:4px 10px; border-radius:8px; background:var(--partner-solid-raised); }
|
|
38
|
+
.dsh-partner-activity-artifact>span { min-width:0; flex:1; overflow-wrap:anywhere; font-size:12px; }
|
|
39
|
+
.dsh-partner-activity-artifact>button { flex-shrink:0; font-size:12px; }
|
|
40
|
+
.dsh-partner-activity-plan { display:grid; gap:4px; border-left:3px solid var(--partner-accent); background:var(--partner-solid-raised); padding:12px; margin:0 0 14px; border-radius:0 8px 8px 0; font-size:13px; }
|
|
41
|
+
.dsh-partner-activity-board .dsh-partner-activity-more { width:100%; margin:8px 0; }
|
|
42
|
+
.dsh-partner-activity-board .dsh-partner-activity-note,.dsh-partner-activity-footnote p { font-size:13px; color:var(--partner-text-secondary); padding:0 0 12px; }
|
|
43
|
+
.dsh-partner-activity-board .dsh-partner-activity-empty { padding:24px 8px; color:var(--partner-text-secondary); text-align:center; font-size:14px; }
|
|
44
|
+
.dsh-partner-activity-archive,.dsh-partner-autonomy-habits { border-top:1px solid var(--partner-border); margin-top:12px; }
|
|
45
|
+
.dsh-partner-activity-copy-status { display:block; font-size:12px; color:var(--partner-text-secondary); }
|
|
46
|
+
@media(max-width:680px) {
|
|
47
|
+
.dsh-partner-settings-panel > .dsh-partner-character.dsh-partner-autonomy { padding:12px; }
|
|
48
|
+
.dsh-partner-autonomy .dsh-partner-autonomy-settings { grid-template-columns:minmax(0,1fr); }
|
|
49
|
+
.dsh-partner-activity-switcher button { padding:8px; }
|
|
50
|
+
.dsh-partner-activity-toolbar { gap:4px; }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.dsh-partner-character.dsh-partner-autonomy .dsh-partner-activity-board p { margin:0; }
|
|
54
|
+
.dsh-partner-autonomy .dsh-partner-autonomy-settings .dsh-partner-field { margin:8px 0; }
|
|
55
|
+
.dsh-partner-autonomy > .dsh-partner-character-hint { margin:0 0 12px; }
|
|
56
|
+
`;var ee=[{name:"\u7F51\u9875\u4E0E B \u7AD9",matches:r=>/^(web_|partner_bilibili)/.test(r)},{name:"\u4F5C\u54C1\u521B\u4F5C",matches:r=>/^(write|edit|generate_image|bash)(:|$)/.test(r)},{name:"\u8868\u60C5\u6536\u85CF",matches:r=>r.startsWith("partner_stickers")},{name:"\u804A\u5929\u4E0E\u5206\u4EAB",matches:r=>/^(partner_chat_|partner_voice_reply|partner_send_attachment)/.test(r)},{name:"QQ \u4E92\u52A8",matches:r=>r.startsWith("partner_qq")}];function D(r){return{total:r.length,confirmed:r.filter(n=>n.sharing==="confirmed").length,pending:r.filter(n=>n.sharing==="pending").length,unknown:r.filter(n=>n.sharing===void 0).length,failed:r.filter(n=>n.tools.some(a=>!a.ok)).length,categories:ee.map(n=>({name:n.name,count:r.filter(a=>a.tools.some(s=>n.matches(s.name))).length})).filter(n=>n.count)}}function H(r){return r.sharing==="confirmed"?"\u5DF2\u786E\u8BA4\u53D1\u9001":r.sharing==="pending"?"\u53D1\u9001\u5F85\u786E\u8BA4":r.sharing==="none"?"\u672A\u53D1\u73B0\u53D1\u9001\u8BB0\u5F55":"\u5386\u53F2\u53D1\u9001\u72B6\u6001\u672A\u6838\u5B9E"}var d=require("react");function q(r,n=3e4){let a,s=0,o=0,c,v=()=>Date.now()<s?a:void 0,k=()=>{o++,a=void 0,s=0,c=void 0},f=()=>{if(c)return c;let g=o,h=r().then(y=>g!==o?f():(a=y,s=Date.now()+n,y)).finally(()=>{c===h&&(c=void 0)});return c=h,h};return{peek:v,load:f,invalidate:k}}var te="/partner-local/v1";async function re(r="",n={}){let a=n.method??"GET";a!=="GET"&&w.invalidate();let s=await fetch(`${te}${r}`,{...n,headers:{Accept:"application/json",...a==="GET"?{}:{"Content-Type":"application/json","X-DSH-Partner-Request":"1"},...n.headers}});if((a!=="GET"||s.status===401||s.status===403)&&w.invalidate(),s.status===204)return;let o=await s.json().catch(()=>({}));if(!s.ok)throw new Error(typeof o.error=="string"?o.error:`HTTP ${s.status}`);return o}var w=q(()=>re("",{signal:AbortSignal.timeout(15e3)})),ue=w.peek;function _(){return w.load()}var E=require("react"),J=require("@deepseek-ai/dsh-client-ui-primitives"),O=require("react/jsx-runtime");function z(r){return r instanceof Error?r.message:String(r)}var e=require("react/jsx-runtime");function ne({companionId:r}){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{children:j}),(0,e.jsx)(ie,{companionId:r},r)]})}function ie({companionId:r}){let[n,a]=(0,d.useState)(),[s,o]=(0,d.useState)(""),[c,v]=(0,d.useState)(!0),[k,f]=(0,d.useState)(0),[g,h]=(0,d.useState)("activities"),[y,$]=(0,d.useState)(6),[R,X]=(0,d.useState)(6),[L,B]=(0,d.useState)("");(0,d.useEffect)(()=>{let t=!0,i=!1,u=async()=>{if(!(i||document.hidden)){i=!0,v(!0);try{let T=await _();t&&(a(T),o(""))}catch(T){t&&o(z(T))}finally{i=!1,t&&v(!1)}}},l=()=>{document.hidden||u()};u();let G=setInterval(()=>void u(),3e4);return document.addEventListener("visibilitychange",l),()=>{t=!1,clearInterval(G),document.removeEventListener("visibilitychange",l)}},[r,k]);let A=n?.companions.find(t=>t.id===r),m=A?.activityPlan,b=[...A?.activityJournal??[]].reverse(),p=D(b),P=[...A?.thoughts??[]].sort((t,i)=>i.updatedAt-t.updatedAt),C=P.filter(t=>t.status==="open"),x=P.filter(t=>t.status!=="open"),I=t=>new Date(t).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),S=t=>{let i=n?.sessions.find(l=>l.id===t);if(!i)return"\u539F\u4F1A\u8BDD\u5DF2\u79FB\u9664";if(i.kind==="local")return"\u7F51\u9875\u4E3B\u4F1A\u8BDD";let u=i.userId.match(/^group:(\d+):/);return u?`\u7FA4 ${u[1]}`:`${n?.channels.find(l=>l.id===i.channelId)?.name??"\u6E20\u9053"} \xB7 ${n?.pairings.find(l=>l.channelId===i.channelId&&l.userId===i.userId)?.displayName??i.userId}`},M=t=>(0,e.jsxs)("details",{className:"dsh-partner-activity-row",children:[(0,e.jsxs)("summary",{children:[(0,e.jsx)("span",{className:"dsh-partner-activity-copy",children:t.text}),(0,e.jsx)("small",{children:t.status==="done"?"\u5DF2\u5B8C\u6210\uFF08\u81EA\u4E3B\u6807\u8BB0\uFF09":t.status==="dismissed"?t.capacityArchivedAt?"\u5BB9\u91CF\u6574\u7406 \xB7 \u5DF2\u653E\u4E0B":"\u5DF2\u653E\u4E0B":"\u60E6\u8BB0\u4E2D"})]}),(0,e.jsxs)("div",{className:"dsh-partner-activity-detail",children:[(0,e.jsx)("p",{children:t.why}),(0,e.jsxs)("small",{children:["\u6765\u81EA ",t.sourceRouteIds.map(S).join("\u3001")," \xB7 ",I(t.sourceAt)]}),(0,e.jsxs)("small",{children:["\u60F3\u53BB ",S(t.targetRouteId),t.lastOutcome?` \xB7 ${{considered:"\u5DF2\u8003\u8651",silent:"\u6682\u65F6\u5B89\u9759",delivered:"\u5DF2\u53D1\u9001",failed:"\u672A\u786E\u8BA4\u9001\u8FBE"}[t.lastOutcome]}`:""]}),t.capacityArchivedAt&&(0,e.jsxs)("p",{children:["\u8FBE\u5230 ",12," \u6761\u4E0A\u9650\u540E\u81EA\u52A8\u653E\u4E0B\uFF0C\u4E0D\u8868\u793A\u5DF2\u7ECF\u5B8C\u6210\u3002"]}),t.result&&(0,e.jsx)("p",{children:t.result}),(0,e.jsxs)("details",{children:[(0,e.jsx)("summary",{children:"\u6765\u6E90\u539F\u6587"}),(0,e.jsx)("p",{className:"dsh-partner-activity-evidence",children:t.evidence})]})]})]},t.id);return(0,e.jsxs)("section",{className:"dsh-partner-activity-board","aria-label":"\u81EA\u4E3B\u6D3B\u52A8\u8BB0\u5F55",children:[(0,e.jsxs)("div",{className:"dsh-partner-activity-toolbar",children:[(0,e.jsxs)("div",{className:"dsh-partner-activity-switcher",role:"group","aria-label":"\u8BB0\u5F55\u7C7B\u578B",children:[(0,e.jsxs)("button",{type:"button","aria-pressed":g==="activities",onClick:()=>h("activities"),children:["\u6700\u8FD1\u6D3B\u52A8",n&&(0,e.jsx)("span",{children:b.length})]}),(0,e.jsxs)("button",{type:"button","aria-pressed":g==="thoughts",onClick:()=>h("thoughts"),children:["\u60E6\u8BB0\u7684\u4E8B",n&&(0,e.jsxs)("span",{children:[C.length,"/",12]})]})]}),(0,e.jsx)("button",{type:"button",className:"dsh-partner-activity-refresh",disabled:c,onClick:()=>f(t=>t+1),children:c?"\u8BFB\u53D6\u4E2D\u2026":"\u5237\u65B0"})]}),s&&(0,e.jsxs)("p",{role:"alert",className:"dsh-partner-inline-error",children:[s,n?"\uFF08\u6682\u65F6\u663E\u793A\u4E0A\u6B21\u8BFB\u53D6\u7684\u8BB0\u5F55\uFF09":""]}),!n&&c&&(0,e.jsx)("p",{role:"status",className:"dsh-partner-activity-empty",children:"\u6B63\u5728\u8BFB\u53D6\u6D3B\u52A8\u8BB0\u5F55\u2026"}),n&&g==="activities"&&(0,e.jsxs)(e.Fragment,{children:[m&&m.status!=="cancelled"&&(0,e.jsxs)("div",{className:"dsh-partner-activity-plan",children:[(0,e.jsxs)("small",{children:["\u4E0B\u4E00\u6B65 \xB7 ",{waiting:"\u7B49\u672C\u8F6E\u7ED3\u675F",pending:"\u7B49\u5F85\u5524\u8D77",claimed:"\u5DF2\u5524\u8D77"}[m.status]]}),(0,e.jsx)("p",{children:m.intention}),(0,e.jsxs)("small",{children:[S(m.targetRouteId),m.status==="pending"?` \xB7 ${I(m.dueAt)}`:""]})]}),(0,e.jsxs)("div",{className:"dsh-partner-activity-overview",children:[(0,e.jsxs)("span",{children:["\u786E\u8BA4\u53D1\u9001 ",(0,e.jsx)("b",{children:p.confirmed})]}),(0,e.jsxs)("span",{children:["\u5F85\u786E\u8BA4 ",(0,e.jsx)("b",{children:p.pending})]}),(0,e.jsxs)("span",{"data-warning":p.failed>0,children:["\u542B\u5931\u8D25\u64CD\u4F5C ",(0,e.jsx)("b",{children:p.failed})]})]}),!b.length&&(0,e.jsx)("p",{className:"dsh-partner-activity-empty",children:"\u8FD8\u6CA1\u6709\u81EA\u4E3B\u6D3B\u52A8\u3002\u5524\u8D77\u540E\u4E5F\u53EF\u4EE5\u9009\u62E9\u5B89\u9759\u5F85\u7740\u3002"}),(0,e.jsx)("div",{"aria-label":"\u6D3B\u52A8\u65F6\u95F4\u7EBF",children:b.slice(0,y).map(t=>(0,e.jsxs)("details",{className:"dsh-partner-activity-row",children:[(0,e.jsxs)("summary",{children:[(0,e.jsxs)("span",{className:"dsh-partner-activity-meta",children:[(0,e.jsx)("time",{dateTime:new Date(t.at).toISOString(),children:I(t.at)}),(0,e.jsx)("span",{children:H(t)}),t.tools.some(i=>!i.ok)&&(0,e.jsx)("span",{className:"dsh-partner-activity-warning",children:"\u6709\u64CD\u4F5C\u5931\u8D25"})]}),(0,e.jsx)("span",{className:"dsh-partner-activity-copy",children:t.summary}),(0,e.jsxs)("small",{children:[t.artifacts.length?`${t.artifacts.length} \u9879\u4F5C\u54C1 \xB7 `:"","\u5C55\u5F00\u8BE6\u60C5"]})]}),(0,e.jsxs)("div",{className:"dsh-partner-activity-detail",children:[t.artifacts.map(i=>(0,e.jsxs)("div",{className:"dsh-partner-activity-artifact",children:[(0,e.jsx)("span",{title:i,children:i}),(0,e.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(i).then(()=>B(i)).catch(()=>o("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u8DEF\u5F84\u590D\u5236"))},children:"\u590D\u5236\u8DEF\u5F84"})]},i)),(0,e.jsxs)("details",{children:[(0,e.jsxs)("summary",{children:["\u6267\u884C\u4F9D\u636E \xB7 ",t.tools.length," \u9879\u64CD\u4F5C"]}),(0,e.jsxs)("p",{children:[t.silent?"\u4EE5\u5B89\u9759\u7ED3\u675F\u6536\u5C3E\uFF1B\u6B64\u524D\u53EF\u80FD\u5DF2\u53D1\u9001\u3002":"\u672C\u8F6E\u5DF2\u7ED3\u675F\u3002","\u53D1\u9001\u72B6\u6001\u4EC5\u4F9D\u636E\u5B9E\u9645\u56DE\u6267\u3002"]}),(0,e.jsx)("ul",{children:t.tools.map((i,u)=>(0,e.jsxs)("li",{children:[i.name," \xB7 ",i.ok?"\u6210\u529F":"\u5931\u8D25"]},u))}),!t.tools.length&&(0,e.jsx)("p",{children:"\u672A\u8BB0\u5F55\u5DE5\u5177\u64CD\u4F5C\u3002"})]})]})]},t.sessionId+":"+t.id))}),y<b.length&&(0,e.jsxs)("button",{type:"button",className:"dsh-partner-activity-more",onClick:()=>$(t=>t+6),children:["\u67E5\u770B\u66F4\u591A\u6D3B\u52A8\uFF08\u8FD8\u6709 ",b.length-y," \u8F6E\uFF09"]}),(0,e.jsxs)("details",{className:"dsh-partner-activity-footnote",children:[(0,e.jsx)("summary",{children:"\u7EDF\u8BA1\u8303\u56F4\u4E0E\u6D3B\u52A8\u7C7B\u578B"}),(0,e.jsxs)("p",{children:["\u4EC5\u7EDF\u8BA1\u6700\u8FD1\u4FDD\u7559\u7684 ",p.total," \u8F6E\uFF1B\u7C7B\u578B\u53EF\u91CD\u53E0\uFF0C\u4E0D\u4EE3\u8868\u5168\u90E8\u5386\u53F2\u3002",p.unknown?`\u5176\u4E2D ${p.unknown} \u8F6E\u7684\u5386\u53F2\u53D1\u9001\u72B6\u6001\u672A\u77E5\u3002`:""]}),(0,e.jsx)("p",{children:p.categories.map(t=>`${t.name} ${t.count}`).join(" \xB7 ")||"\u6682\u65E0\u64CD\u4F5C\u8BB0\u5F55"})]})]}),n&&g==="thoughts"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"dsh-partner-activity-note",children:["\u6700\u591A\u540C\u65F6\u60E6\u8BB0 ",12," \u4EF6\u4E8B\uFF0C\u6240\u6709\u4F1A\u8BDD\u5171\u7528\u3002\u6EE1\u989D\u65F6\u4F18\u5148\u4FDD\u7559\u6B63\u5728\u505A\u3001\u5DF2\u5B89\u6392\u548C\u8F83\u65B0\u7684\u5FF5\u5934\uFF0C\u65E7\u5FF5\u5934\u653E\u4E0B\u540E\u4ECD\u53EF\u67E5\u770B\u8FD1\u671F\u8BB0\u5F55\u3002"]}),!C.length&&(0,e.jsx)("p",{className:"dsh-partner-activity-empty",children:"\u6682\u65F6\u6CA1\u6709\u60E6\u8BB0\u7684\u4E8B\uFF0C\u4E0D\u8981\u6C42\u6BCF\u6B21\u4E92\u52A8\u90FD\u7559\u4E0B\u5FF5\u5934\u3002"}),(0,e.jsx)("div",{"aria-label":"\u5F53\u524D\u5FF5\u5934",children:C.map(M)}),x.length>0&&(0,e.jsxs)("details",{className:"dsh-partner-activity-archive",children:[(0,e.jsxs)("summary",{children:["\u5DF2\u5B8C\u6210\u4E0E\u5DF2\u653E\u4E0B \xB7 ",x.length]}),x.slice(0,R).map(M),R<x.length&&(0,e.jsx)("button",{type:"button",className:"dsh-partner-activity-more",onClick:()=>X(t=>t+6),children:"\u67E5\u770B\u66F4\u591A\u65E7\u5FF5\u5934"}),(0,e.jsx)("p",{className:"dsh-partner-activity-note",children:"\u4EC5\u4FDD\u7559\u8FD1\u671F\u8BB0\u5F55\uFF1B\u653E\u4E0B\u7684\u5FF5\u5934\u4E0D\u518D\u8FDB\u5165\u5F53\u524D\u6D3B\u52A8\u4E0A\u4E0B\u6587\u3002"})]})]}),(0,e.jsx)("span",{className:"dsh-partner-activity-copy-status",role:"status",children:L?"\u8DEF\u5F84\u5DF2\u590D\u5236":""})]})}
|
|
57
|
+
return module.exports; } });
|