comisai 1.0.15 → 1.0.17
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/node_modules/@comis/agent/dist/bootstrap/types.d.ts +1 -1
- package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +12 -11
- package/node_modules/@comis/agent/dist/context-engine/constants.d.ts +11 -0
- package/node_modules/@comis/agent/dist/context-engine/constants.js +11 -0
- package/node_modules/@comis/agent/dist/context-engine/index.d.ts +1 -1
- package/node_modules/@comis/agent/dist/context-engine/index.js +1 -1
- package/node_modules/@comis/agent/dist/context-engine/llm-compaction.js +32 -18
- package/node_modules/@comis/agent/dist/executor/cache-break-diff-writer.d.ts +2 -0
- package/node_modules/@comis/agent/dist/executor/cache-break-diff-writer.js +36 -0
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.d.ts +12 -0
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +117 -27
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +1 -0
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +16 -4
- package/node_modules/@comis/agent/dist/executor/executor-stream-setup.js +17 -1
- package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +27 -1
- package/node_modules/@comis/agent/dist/executor/session-snapshot-cleanup.js +3 -1
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/index.d.ts +2 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/index.js +2 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.d.ts +9 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +65 -3
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/stub-filter-injector.d.ts +28 -0
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/stub-filter-injector.js +63 -0
- package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +18 -1
- package/node_modules/@comis/agent/dist/executor/tool-deferral.js +275 -133
- package/node_modules/@comis/agent/dist/executor/ttl-guard.d.ts +6 -0
- package/node_modules/@comis/agent/dist/executor/ttl-guard.js +8 -0
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/dist/shared/typing-controller.d.ts +7 -0
- package/node_modules/@comis/channels/dist/shared/typing-controller.js +33 -0
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/dist/commands/daemon.js +116 -28
- package/node_modules/@comis/cli/dist/wizard/non-interactive.js +1 -0
- package/node_modules/@comis/cli/dist/wizard/steps/01-detect-existing.js +4 -0
- package/node_modules/@comis/cli/dist/wizard/steps/07-gateway.js +9 -0
- package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +2 -0
- package/node_modules/@comis/cli/dist/wizard/steps/12-finish.js +5 -2
- package/node_modules/@comis/cli/dist/wizard/types.d.ts +1 -0
- package/node_modules/@comis/cli/package.json +1 -1
- package/node_modules/@comis/core/dist/config/schema-agent.d.ts +10 -0
- package/node_modules/@comis/core/dist/config/schema-agent.js +8 -0
- package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +17 -2
- package/node_modules/@comis/core/dist/config/schema-gateway.js +11 -0
- package/node_modules/@comis/core/dist/config/schema-skills.d.ts +16 -2
- package/node_modules/@comis/core/dist/config/schema-skills.js +9 -2
- package/node_modules/@comis/core/dist/config/schema.d.ts +66 -60
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +34 -6
- package/node_modules/@comis/daemon/package.json +1 -1
- package/node_modules/@comis/gateway/package.json +1 -1
- package/node_modules/@comis/infra/package.json +1 -1
- package/node_modules/@comis/memory/package.json +1 -1
- package/node_modules/@comis/scheduler/package.json +1 -1
- package/node_modules/@comis/shared/package.json +1 -1
- package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.d.ts +1 -1
- package/node_modules/@comis/skills/package.json +1 -1
- package/node_modules/@comis/web/dist/android-chrome-192x192.png +0 -0
- package/node_modules/@comis/web/dist/android-chrome-512x512.png +0 -0
- package/node_modules/@comis/web/dist/apple-touch-icon.png +0 -0
- package/node_modules/@comis/web/dist/assets/agent-detail-BG9MGWWj.js +615 -0
- package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +2173 -0
- package/node_modules/@comis/web/dist/assets/agent-list-LHCJ4rw2.js +504 -0
- package/node_modules/@comis/web/dist/assets/approvals-q9VH_IKr.js +54 -0
- package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +375 -0
- package/node_modules/@comis/web/dist/assets/channel-detail-CaInesJM.js +681 -0
- package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +323 -0
- package/node_modules/@comis/web/dist/assets/chat-console-CNmzl0JW.js +943 -0
- package/node_modules/@comis/web/dist/assets/config-editor-DX4ITw6y.js +1374 -0
- package/node_modules/@comis/web/dist/assets/context-dag-browser-BwiaF5tf.js +393 -0
- package/node_modules/@comis/web/dist/assets/context-engine-BZ5Am6hA.js +393 -0
- package/node_modules/@comis/web/dist/assets/delivery-view-OfBZof-m.js +392 -0
- package/node_modules/@comis/web/dist/assets/diagnostics-view-YFwCxgr2.js +231 -0
- package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +1 -0
- package/node_modules/@comis/web/dist/assets/extract-variables-BM5qyK-s.js +149 -0
- package/node_modules/@comis/web/dist/assets/ic-array-editor-B7m6x7-S.js +118 -0
- package/node_modules/@comis/web/dist/assets/ic-breadcrumb-CUMpp3BL.js +75 -0
- package/node_modules/@comis/web/dist/assets/ic-budget-segment-bar-BtJ6x5mN.js +64 -0
- package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +352 -0
- package/node_modules/@comis/web/dist/assets/ic-confirm-dialog-CCDbB04e.js +110 -0
- package/node_modules/@comis/web/dist/assets/ic-connection-dot-CnT1b8xr.js +54 -0
- package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +277 -0
- package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +67 -0
- package/node_modules/@comis/web/dist/assets/ic-detail-panel-BF83r-if.js +116 -0
- package/node_modules/@comis/web/dist/assets/ic-empty-state-60l2ePhd.js +52 -0
- package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +359 -0
- package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +33 -0
- package/node_modules/@comis/web/dist/assets/ic-layer-waterfall-COvEYMg5.js +69 -0
- package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +12 -0
- package/node_modules/@comis/web/dist/assets/ic-search-input-CSOxY9g7.js +92 -0
- package/node_modules/@comis/web/dist/assets/ic-select-Ce-Raudx.js +127 -0
- package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +95 -0
- package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +33 -0
- package/node_modules/@comis/web/dist/assets/ic-time-range-picker-CypCT68y.js +93 -0
- package/node_modules/@comis/web/dist/assets/ic-tool-call-7MaXSsCW.js +146 -0
- package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +2830 -0
- package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +1 -0
- package/node_modules/@comis/web/dist/assets/mcp-management-BNZPnpDn.js +582 -0
- package/node_modules/@comis/web/dist/assets/media-config-BBvTYxOX.js +314 -0
- package/node_modules/@comis/web/dist/assets/media-test-BkK3RCRK.js +496 -0
- package/node_modules/@comis/web/dist/assets/memory-inspector-1hDGCGat.js +1139 -0
- package/node_modules/@comis/web/dist/assets/message-center-CXefwsUu.js +785 -0
- package/node_modules/@comis/web/dist/assets/models-C1qcU_j3.js +894 -0
- package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +1 -0
- package/node_modules/@comis/web/dist/assets/observe-view-C0VBhX4C.js +814 -0
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +1496 -0
- package/node_modules/@comis/web/dist/assets/pipeline-history-DkfOQ6SW.js +317 -0
- package/node_modules/@comis/web/dist/assets/pipeline-history-detail-hyHgD0ai.js +287 -0
- package/node_modules/@comis/web/dist/assets/pipeline-list-BPW8hV-q.js +518 -0
- package/node_modules/@comis/web/dist/assets/pipeline-monitor-Bip16T7e.js +972 -0
- package/node_modules/@comis/web/dist/assets/scheduler-BGgwKd06.js +1182 -0
- package/node_modules/@comis/web/dist/assets/security-D15st4xx.js +1224 -0
- package/node_modules/@comis/web/dist/assets/session-detail-SGEYNJ0M.js +632 -0
- package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +1 -0
- package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +231 -0
- package/node_modules/@comis/web/dist/assets/setup-wizard-nT0tz9QP.js +853 -0
- package/node_modules/@comis/web/dist/assets/skills-D8yVfSUy.js +1051 -0
- package/node_modules/@comis/web/dist/assets/subagents-HHXMeHYo.js +193 -0
- package/node_modules/@comis/web/dist/assets/workspace-manager-BQlr10iH.js +785 -0
- package/node_modules/@comis/web/dist/comis-logo.png +0 -0
- package/node_modules/@comis/web/dist/favicon-16x16.png +0 -0
- package/node_modules/@comis/web/dist/favicon-32x32.png +0 -0
- package/node_modules/@comis/web/dist/favicon.ico +0 -0
- package/node_modules/@comis/web/dist/index.html +17 -0
- package/node_modules/@comis/web/package.json +29 -0
- package/package.json +15 -13
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import{A as h,E as j,s as _,f as O,i as C,n as b,r as I,a as k,b as d,t as T,I as D}from"./index-CEcM1R_C.js";import{e as E,i as S,t as H}from"./directive-DoeGSK_T.js";import"./ic-icon-xeGTVhVG.js";class w extends S{constructor(e){if(super(e),this.it=h,e.type!==H.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===h||e==null)return this._t=void 0,this.it=e;if(e===j)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}w.directiveName="unsafeHTML",w.resultType=1;const L=E(w);var B=Object.defineProperty,M=Object.getOwnPropertyDescriptor,y=(i,e,s,n)=>{for(var t=n>1?void 0:n?M(e,s):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(t=(n?a(e,s,t):a(t))||t);return n&&t&&B(e,s,t),t};const P=new Set(["const","let","var","function","return","if","else","for","while","import","export","from","true","false","null","undefined","class","new","this","async","await","throw","try","catch","switch","case","break","continue","default","typeof","instanceof","void","delete","in","of","yield","static","extends","implements","interface","type","enum","abstract","readonly"]);function $(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function R(i,e){if(!e)return $(i);const s=e.toLowerCase();let t=$(i);return t=t.replace(/\/\*[\s\S]*?\*\//g,r=>`<span class="hl-comment">${r}</span>`),t=t.replace(/\/\/[^\n]*/g,r=>r.includes("hl-comment")?r:`<span class="hl-comment">${r}</span>`),(s==="yaml"||s==="yml"||s==="bash"||s==="sh"||s==="python"||s==="py")&&(t=t.replace(new RegExp("(?:^|(?<=\\n))(\\s*#[^\\n]*)","g"),r=>`<span class="hl-comment">${r}</span>`)),t=t.replace(new RegExp('(?<!<span class=")("(?:[^&]|&(?!quot;))*?")',"g"),r=>r.includes("hl-")?r:`<span class="hl-string">${r}</span>`),t=t.replace(new RegExp("(?<![=\\w])('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')","g"),r=>r.includes("hl-")?r:`<span class="hl-string">${r}</span>`),t=t.replace(/\b(\d+(?:\.\d+)?)\b/g,r=>r.includes("hl-")?r:`<span class="hl-number">${r}</span>`),(s==="json"||s==="yaml"||s==="yml")&&(t=t.replace(new RegExp("(?:^|(?<=\\n))(\\s*)("[\\w.-]+")(\\s*:)","gm"),(r,a,c,o)=>`${a}<span class="hl-property">${c}</span>${o}`),(s==="yaml"||s==="yml")&&(t=t.replace(new RegExp("(?:^|(?<=\\n))(\\s*)([\\w.-]+)(\\s*:)","gm"),(r,a,c,o)=>c.includes("hl-")?r:`${a}<span class="hl-property">${c}</span>${o}`))),(s==="javascript"||s==="js"||s==="typescript"||s==="ts"||s==="jsx"||s==="tsx")&&(t=t.replace(/\b([a-z]+)\b/g,r=>P.has(r)?`<span class="hl-keyword">${r}</span>`:r)),t}let m=class extends k{constructor(){super(...arguments),this.code="",this.language="",this.copyable=!0,this._copied=!1,this._copyTimer=null}disconnectedCallback(){super.disconnectedCallback(),this._copyTimer!==null&&(clearTimeout(this._copyTimer),this._copyTimer=null)}async _handleCopy(){try{await navigator.clipboard.writeText(this.code),this._copied=!0,this._copyTimer!==null&&clearTimeout(this._copyTimer),this._copyTimer=setTimeout(()=>{this._copied=!1,this._copyTimer=null},2e3)}catch{}}_renderHeader(){return!this.language&&!this.copyable?h:d`
|
|
2
|
+
<div class="header">
|
|
3
|
+
<span class="language-label">${this.language||""}</span>
|
|
4
|
+
${this.copyable?d`
|
|
5
|
+
<button
|
|
6
|
+
class="copy-btn"
|
|
7
|
+
@click=${this._handleCopy}
|
|
8
|
+
aria-label="Copy code"
|
|
9
|
+
>
|
|
10
|
+
${this._copied?d`<span>Copied!</span>`:d`<ic-icon name="copy" size="14px"></ic-icon><span>Copy</span>`}
|
|
11
|
+
</button>
|
|
12
|
+
`:h}
|
|
13
|
+
</div>
|
|
14
|
+
`}render(){const i=R(this.code,this.language);return d`
|
|
15
|
+
<div class="container" role="region" aria-label="Code block">
|
|
16
|
+
${this._renderHeader()}
|
|
17
|
+
<div class="code-area">
|
|
18
|
+
<pre><code .innerHTML=${i}></code></pre>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
`}};m.styles=[_,O,C`
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.container {
|
|
27
|
+
background: var(--ic-bg);
|
|
28
|
+
border: 1px solid var(--ic-border);
|
|
29
|
+
border-radius: var(--ic-radius-md);
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
background: var(--ic-surface-2);
|
|
38
|
+
padding: var(--ic-space-xs) var(--ic-space-md);
|
|
39
|
+
border-bottom: 1px solid var(--ic-border);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.language-label {
|
|
43
|
+
font-size: var(--ic-text-xs);
|
|
44
|
+
color: var(--ic-text-dim);
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
letter-spacing: 0.04em;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.copy-btn {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 4px;
|
|
54
|
+
background: none;
|
|
55
|
+
border: none;
|
|
56
|
+
color: var(--ic-text-dim);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
padding: 2px 4px;
|
|
59
|
+
border-radius: var(--ic-radius-sm);
|
|
60
|
+
font-size: var(--ic-text-xs);
|
|
61
|
+
font-family: inherit;
|
|
62
|
+
transition: color var(--ic-transition);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.copy-btn:hover {
|
|
66
|
+
color: var(--ic-text);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.code-area {
|
|
70
|
+
max-height: 24rem;
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
overflow-x: auto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
pre {
|
|
76
|
+
margin: 0;
|
|
77
|
+
padding: var(--ic-space-md);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
code {
|
|
81
|
+
font-family: var(--ic-font-mono);
|
|
82
|
+
font-size: var(--ic-text-sm);
|
|
83
|
+
line-height: 1.6;
|
|
84
|
+
color: var(--ic-text);
|
|
85
|
+
white-space: pre;
|
|
86
|
+
tab-size: 2;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Syntax highlighting colors */
|
|
90
|
+
.hl-string { color: #a5d6ff; }
|
|
91
|
+
.hl-number { color: #79c0ff; }
|
|
92
|
+
.hl-keyword { color: #ff7b72; }
|
|
93
|
+
.hl-comment { color: var(--ic-text-dim); font-style: italic; }
|
|
94
|
+
.hl-property { color: #7ee787; }
|
|
95
|
+
`];y([b()],m.prototype,"code",2);y([b()],m.prototype,"language",2);y([b({type:Boolean})],m.prototype,"copyable",2);y([I()],m.prototype,"_copied",2);m=y([T("ic-code-block")],m);var q=Object.defineProperty,A=Object.getOwnPropertyDescriptor,g=(i,e,s,n)=>{for(var t=n>1?void 0:n?A(e,s):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(t=(n?a(e,s,t):a(t))||t);return n&&t&&q(e,s,t),t};function N(i){let e=i;return e=e.replace(/<\/?(?:script|iframe|object|embed|form)\b[^>]*>/gi,""),e=e.replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi,""),e=e.replace(/javascript\s*:/gi,""),e}function f(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function K(i){if(i.length<2)return i.join(`
|
|
96
|
+
`);const e=i.filter(a=>a.trim()!=="");if(e.length<2||!/^\s*\|[\s-:|]+\|\s*$/.test(e[1]))return i.join(`
|
|
97
|
+
`);const s=a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(c=>c.trim()),n=s(e[0]),t=e.slice(2);let r="<table><thead><tr>";for(const a of n)r+=`<th>${a}</th>`;r+="</tr></thead><tbody>";for(const a of t){const c=s(a);r+="<tr>";for(const o of c)r+=`<td>${o}</td>`;r+="</tr>"}return r+="</tbody></table>",r}function U(i,e){try{const{url:s,type:n,fileName:t}=JSON.parse(i),r=e&&s.startsWith("/media/")?`${s}${s.includes("?")?"&":"?"}token=${encodeURIComponent(e)}`:s,a=f(r),c=f(t);switch(n){case"image":return`<img src="${a}" alt="${c}" style="max-width:100%;border-radius:8px;margin:4px 0" loading="lazy" />`;case"audio":return`<audio controls src="${a}" style="width:100%;margin:4px 0"></audio>`;case"video":return`<video controls src="${a}" style="max-width:100%;border-radius:8px;margin:4px 0"></video>`;default:return`<a href="${a}" download="${c}" target="_blank" rel="noopener" class="md-link">${c}</a>`}}catch{return""}}function J(i,e=""){let s=N(i);const n=[];s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(o,p,l)=>{const v=f(l.replace(/\n$/,"")),z=`\0CODE_BLOCK_${n.length}\0`;return n.push(`<ic-code-block language="${f(p)}" code="${v}"></ic-code-block>`),z}),s=s.replace(/`([^`]+)`/g,(o,p)=>`<code class="inline-code">${f(p)}</code>`);const t=s.split(`
|
|
98
|
+
`),r=[];let a=0;for(;a<t.length;){const o=t[a];if(o.includes("\0CODE_BLOCK_")){const l=o.match(/\x00CODE_BLOCK_(\d+)\x00/);if(l){r.push(n[parseInt(l[1],10)]),a++;continue}}if(/^\s*\|/.test(o)){const l=[o];for(a++;a<t.length&&/^\s*\|/.test(t[a]);)l.push(t[a]),a++;r.push(K(l));continue}const p=o.match(/^(#{1,4})\s+(.+)$/);if(p){const l=Math.min(p[1].length+2,6);r.push(`<h${l}>${x(p[2])}</h${l}>`),a++;continue}if(/^\s*[-*]\s+/.test(o)){const l=[];for(;a<t.length&&/^\s*[-*]\s+/.test(t[a]);)l.push(x(t[a].replace(/^\s*[-*]\s+/,""))),a++;r.push(`<ul>${l.map(v=>`<li>${v}</li>`).join("")}</ul>`);continue}if(/^\s*\d+\.\s+/.test(o)){const l=[];for(;a<t.length&&/^\s*\d+\.\s+/.test(t[a]);)l.push(x(t[a].replace(/^\s*\d+\.\s+/,""))),a++;r.push(`<ol>${l.map(v=>`<li>${v}</li>`).join("")}</ol>`);continue}if(o.trim()===""){r.push("<br><br>"),a++;continue}r.push(x(o)),a++}let c=r.join(`
|
|
99
|
+
`);return c=c.replace(/<!-- attachment:(.*?) -->/g,(o,p)=>U(p,e)),c}function x(i){let e=i;return e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(s,n,t)=>`<a href="${f(t)}" target="_blank" rel="noopener noreferrer" class="md-link">${n}</a>`),e=e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),e=e.replace(/__(.+?)__/g,"<strong>$1</strong>"),e=e.replace(new RegExp("(?<!\\w)\\*([^*]+)\\*(?!\\w)","g"),"<em>$1</em>"),e=e.replace(new RegExp("(?<!\\w)_([^_]+)_(?!\\w)","g"),"<em>$1</em>"),e}let u=class extends k{constructor(){super(...arguments),this.role="user",this.content="",this.timestamp=0,this.messageId="",this.showActions=!0,this.mediaToken=""}_handleCopy(){navigator.clipboard.writeText(this.content).then(()=>{D.show("Copied to clipboard","success")}).catch(()=>{})}_handleRetry(){this.dispatchEvent(new CustomEvent("retry",{detail:{messageId:this.messageId},bubbles:!0,composed:!0}))}_handleDelete(){this.dispatchEvent(new CustomEvent("delete",{detail:{messageId:this.messageId},bubbles:!0,composed:!0}))}_formatTime(i){return new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}_renderContent(){if(this.role==="user")return this.content;const i=J(this.content,this.mediaToken);return L(i)}_renderActions(){return!this.showActions||this.role==="system"?h:d`
|
|
100
|
+
<div class="message-actions">
|
|
101
|
+
<button class="action-btn" aria-label="Copy message" @click=${this._handleCopy}>
|
|
102
|
+
<ic-icon name="copy" size="14px"></ic-icon>
|
|
103
|
+
</button>
|
|
104
|
+
${this.role==="assistant"?d`
|
|
105
|
+
<button class="action-btn" aria-label="Retry message" @click=${this._handleRetry}>
|
|
106
|
+
<ic-icon name="retry" size="14px"></ic-icon>
|
|
107
|
+
</button>
|
|
108
|
+
`:h}
|
|
109
|
+
<button class="action-btn" aria-label="Delete message" @click=${this._handleDelete}>
|
|
110
|
+
<ic-icon name="trash" size="14px"></ic-icon>
|
|
111
|
+
</button>
|
|
112
|
+
</div>
|
|
113
|
+
`}render(){const i=`wrapper wrapper--${this.role}`,e=`bubble bubble--${this.role}`;return d`
|
|
114
|
+
<div class=${i} role="article" aria-label="${this.role} message">
|
|
115
|
+
${this._renderActions()}
|
|
116
|
+
<div class=${e}>${this._renderContent()}</div>
|
|
117
|
+
${this.timestamp>0?d`<span class="timestamp">${this._formatTime(this.timestamp)}</span>`:h}
|
|
118
|
+
</div>
|
|
119
|
+
`}};u.styles=[_,C`
|
|
120
|
+
:host {
|
|
121
|
+
display: block;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.wrapper {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
max-width: min(80%, 640px);
|
|
128
|
+
width: fit-content;
|
|
129
|
+
position: relative;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Role-specific alignment */
|
|
133
|
+
.wrapper--user {
|
|
134
|
+
align-self: flex-end;
|
|
135
|
+
margin-left: auto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.wrapper--assistant {
|
|
139
|
+
align-self: flex-start;
|
|
140
|
+
margin-right: auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.wrapper--error {
|
|
144
|
+
align-self: flex-start;
|
|
145
|
+
margin-right: auto;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.wrapper--system {
|
|
149
|
+
align-self: center;
|
|
150
|
+
max-width: 100%;
|
|
151
|
+
text-align: center;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Bubble styles */
|
|
155
|
+
.bubble {
|
|
156
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
157
|
+
border-radius: var(--ic-radius-xl);
|
|
158
|
+
font-size: var(--ic-text-sm);
|
|
159
|
+
line-height: 1.6;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.bubble--user {
|
|
163
|
+
background: var(--ic-accent);
|
|
164
|
+
color: white;
|
|
165
|
+
border-radius: var(--ic-radius-lg);
|
|
166
|
+
border-bottom-right-radius: 4px;
|
|
167
|
+
white-space: pre-wrap;
|
|
168
|
+
word-break: break-word;
|
|
169
|
+
padding: 6px 12px;
|
|
170
|
+
line-height: 1.4;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.bubble--assistant {
|
|
174
|
+
background: var(--ic-surface);
|
|
175
|
+
color: var(--ic-text);
|
|
176
|
+
border-bottom-left-radius: 4px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.bubble--error {
|
|
180
|
+
background: color-mix(in srgb, var(--ic-error) 15%, transparent);
|
|
181
|
+
border: 1px solid var(--ic-error);
|
|
182
|
+
color: var(--ic-text);
|
|
183
|
+
border-bottom-left-radius: 4px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.bubble--system {
|
|
187
|
+
color: var(--ic-text-dim);
|
|
188
|
+
font-size: var(--ic-text-xs);
|
|
189
|
+
font-style: italic;
|
|
190
|
+
padding: var(--ic-space-xs);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Timestamp */
|
|
194
|
+
.timestamp {
|
|
195
|
+
font-size: var(--ic-text-xs);
|
|
196
|
+
color: var(--ic-text-dim);
|
|
197
|
+
margin-top: 2px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.wrapper--user .timestamp {
|
|
201
|
+
text-align: right;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Markdown inline styles */
|
|
205
|
+
.bubble--assistant code.inline-code,
|
|
206
|
+
.bubble--error code.inline-code {
|
|
207
|
+
background: var(--ic-surface-2);
|
|
208
|
+
padding: 0.125em 0.375em;
|
|
209
|
+
border-radius: var(--ic-radius-sm);
|
|
210
|
+
font-family: var(--ic-font-mono);
|
|
211
|
+
font-size: 0.9em;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.bubble--assistant strong,
|
|
215
|
+
.bubble--error strong {
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.bubble--assistant a.md-link,
|
|
220
|
+
.bubble--error a.md-link {
|
|
221
|
+
color: var(--ic-accent);
|
|
222
|
+
text-decoration: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.bubble--assistant a.md-link:hover,
|
|
226
|
+
.bubble--error a.md-link:hover {
|
|
227
|
+
text-decoration: underline;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.bubble--assistant h3,
|
|
231
|
+
.bubble--assistant h4,
|
|
232
|
+
.bubble--assistant h5,
|
|
233
|
+
.bubble--assistant h6,
|
|
234
|
+
.bubble--error h3,
|
|
235
|
+
.bubble--error h4,
|
|
236
|
+
.bubble--error h5,
|
|
237
|
+
.bubble--error h6 {
|
|
238
|
+
margin: var(--ic-space-sm) 0;
|
|
239
|
+
font-weight: 600;
|
|
240
|
+
line-height: 1.3;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.bubble--assistant h3,
|
|
244
|
+
.bubble--error h3 { font-size: 1.1em; }
|
|
245
|
+
.bubble--assistant h4,
|
|
246
|
+
.bubble--error h4 { font-size: 1.05em; }
|
|
247
|
+
|
|
248
|
+
.bubble--assistant ul,
|
|
249
|
+
.bubble--error ul {
|
|
250
|
+
list-style: disc;
|
|
251
|
+
padding-left: 1.5em;
|
|
252
|
+
margin: var(--ic-space-xs) 0;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.bubble--assistant ol,
|
|
256
|
+
.bubble--error ol {
|
|
257
|
+
list-style: decimal;
|
|
258
|
+
padding-left: 1.5em;
|
|
259
|
+
margin: var(--ic-space-xs) 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.bubble--assistant table,
|
|
263
|
+
.bubble--error table {
|
|
264
|
+
border-collapse: collapse;
|
|
265
|
+
border: 1px solid var(--ic-border);
|
|
266
|
+
margin: var(--ic-space-xs) 0;
|
|
267
|
+
width: 100%;
|
|
268
|
+
font-size: var(--ic-text-xs);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.bubble--assistant th,
|
|
272
|
+
.bubble--assistant td,
|
|
273
|
+
.bubble--error th,
|
|
274
|
+
.bubble--error td {
|
|
275
|
+
padding: var(--ic-space-xs) var(--ic-space-sm);
|
|
276
|
+
border: 1px solid var(--ic-border);
|
|
277
|
+
text-align: left;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.bubble--assistant th,
|
|
281
|
+
.bubble--error th {
|
|
282
|
+
background: var(--ic-surface-2);
|
|
283
|
+
font-weight: 600;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* Inline attachment media */
|
|
287
|
+
.bubble--assistant img {
|
|
288
|
+
max-width: 100%;
|
|
289
|
+
border-radius: var(--ic-radius-lg);
|
|
290
|
+
margin: var(--ic-space-xs) 0;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.bubble--assistant audio,
|
|
294
|
+
.bubble--assistant video {
|
|
295
|
+
max-width: 100%;
|
|
296
|
+
margin: var(--ic-space-xs) 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* Code blocks inside messages */
|
|
300
|
+
.bubble--assistant ic-code-block,
|
|
301
|
+
.bubble--error ic-code-block {
|
|
302
|
+
margin: var(--ic-space-xs) 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* Message action buttons */
|
|
306
|
+
.message-actions {
|
|
307
|
+
position: absolute;
|
|
308
|
+
top: -0.5rem;
|
|
309
|
+
display: flex;
|
|
310
|
+
gap: 2px;
|
|
311
|
+
background: var(--ic-surface-2);
|
|
312
|
+
border: 1px solid var(--ic-border);
|
|
313
|
+
border-radius: var(--ic-radius-sm);
|
|
314
|
+
padding: 2px;
|
|
315
|
+
box-shadow: var(--ic-shadow-sm);
|
|
316
|
+
opacity: 0;
|
|
317
|
+
transition: opacity var(--ic-transition);
|
|
318
|
+
pointer-events: none;
|
|
319
|
+
z-index: 1;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.wrapper--user .message-actions {
|
|
323
|
+
right: 0;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.wrapper--assistant .message-actions,
|
|
327
|
+
.wrapper--error .message-actions {
|
|
328
|
+
left: 0;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.wrapper:hover .message-actions {
|
|
332
|
+
opacity: 1;
|
|
333
|
+
pointer-events: auto;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.action-btn {
|
|
337
|
+
background: transparent;
|
|
338
|
+
border: none;
|
|
339
|
+
color: var(--ic-text-dim);
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
padding: 4px;
|
|
342
|
+
border-radius: var(--ic-radius-sm);
|
|
343
|
+
display: inline-flex;
|
|
344
|
+
align-items: center;
|
|
345
|
+
justify-content: center;
|
|
346
|
+
transition: color var(--ic-transition);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.action-btn:hover {
|
|
350
|
+
color: var(--ic-text);
|
|
351
|
+
}
|
|
352
|
+
`];g([b()],u.prototype,"role",2);g([b()],u.prototype,"content",2);g([b({type:Number})],u.prototype,"timestamp",2);g([b()],u.prototype,"messageId",2);g([b({type:Boolean})],u.prototype,"showActions",2);g([b()],u.prototype,"mediaToken",2);u=g([T("ic-chat-message")],u);export{L as o,J as r};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import{s as d,f,i as p,n,a as v,A as b,b as h,t as u}from"./index-CEcM1R_C.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(t,e,c,a)=>{for(var i=a>1?void 0:a?g(e,c):e,s=t.length-1,l;s>=0;s--)(l=t[s])&&(i=(a?l(e,c,i):l(i))||i);return a&&i&&m(e,c,i),i};let r=class extends v{constructor(){super(...arguments),this.open=!1,this.title="Confirm",this.message="",this.confirmLabel="Confirm",this.cancelLabel="Cancel",this.variant="default"}updated(t){t.has("open")&&this.open&&this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".cancel-btn")?.focus()})}_onBackdropClick(t){t.target.classList.contains("backdrop")&&this._fireCancel()}_onKeyDown(t){if(t.key==="Escape"&&(t.preventDefault(),this._fireCancel()),t.key==="Tab"){const e=this.shadowRoot?.querySelectorAll("button:not([disabled])");if(!e||e.length===0)return;const c=e[0],a=e[e.length-1];t.shiftKey&&document.activeElement===this?this.shadowRoot?.activeElement===c&&(t.preventDefault(),a.focus()):t.shiftKey||this.shadowRoot?.activeElement===a&&(t.preventDefault(),c.focus())}}_fireConfirm(){this.dispatchEvent(new CustomEvent("confirm"))}_fireCancel(){this.dispatchEvent(new CustomEvent("cancel"))}render(){if(!this.open)return b;const t=this.variant==="danger"?"confirm-btn confirm-btn--danger":"confirm-btn";return h`
|
|
2
|
+
<div
|
|
3
|
+
class="backdrop"
|
|
4
|
+
@click=${this._onBackdropClick}
|
|
5
|
+
@keydown=${this._onKeyDown}
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="dialog"
|
|
9
|
+
role="dialog"
|
|
10
|
+
aria-modal="true"
|
|
11
|
+
aria-labelledby="dialog-title"
|
|
12
|
+
>
|
|
13
|
+
<h2 class="title" id="dialog-title">${this.title}</h2>
|
|
14
|
+
<p class="message">${this.message}</p>
|
|
15
|
+
<div class="buttons">
|
|
16
|
+
<button class="cancel-btn" @click=${this._fireCancel}>
|
|
17
|
+
${this.cancelLabel}
|
|
18
|
+
</button>
|
|
19
|
+
<button class=${t} @click=${this._fireConfirm}>
|
|
20
|
+
${this.confirmLabel}
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
`}};r.styles=[d,f,p`
|
|
26
|
+
:host {
|
|
27
|
+
display: contents;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.backdrop {
|
|
31
|
+
position: fixed;
|
|
32
|
+
inset: 0;
|
|
33
|
+
background: rgba(0, 0, 0, 0.6);
|
|
34
|
+
z-index: 9999;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dialog {
|
|
41
|
+
max-width: 28rem;
|
|
42
|
+
width: calc(100% - var(--ic-space-lg) * 2);
|
|
43
|
+
background: var(--ic-surface);
|
|
44
|
+
border: 1px solid var(--ic-border);
|
|
45
|
+
border-radius: var(--ic-radius-lg);
|
|
46
|
+
padding: var(--ic-space-lg);
|
|
47
|
+
box-shadow: var(--ic-shadow-lg);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.title {
|
|
51
|
+
font-size: var(--ic-text-lg);
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
color: var(--ic-text);
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.message {
|
|
58
|
+
font-size: var(--ic-text-sm);
|
|
59
|
+
color: var(--ic-text-muted);
|
|
60
|
+
margin-top: var(--ic-space-md);
|
|
61
|
+
line-height: 1.5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.buttons {
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: flex-end;
|
|
67
|
+
gap: var(--ic-space-sm);
|
|
68
|
+
margin-top: var(--ic-space-lg);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
button {
|
|
72
|
+
padding: var(--ic-space-sm) var(--ic-space-md);
|
|
73
|
+
border-radius: var(--ic-radius-md);
|
|
74
|
+
font-size: var(--ic-text-sm);
|
|
75
|
+
font-family: inherit;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
transition: background var(--ic-transition), border-color var(--ic-transition);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.cancel-btn {
|
|
81
|
+
background: transparent;
|
|
82
|
+
border: 1px solid var(--ic-border);
|
|
83
|
+
color: var(--ic-text-muted);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cancel-btn:hover {
|
|
87
|
+
border-color: var(--ic-text-dim);
|
|
88
|
+
color: var(--ic-text);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.confirm-btn {
|
|
92
|
+
background: var(--ic-accent);
|
|
93
|
+
border: 1px solid var(--ic-accent);
|
|
94
|
+
color: #fff;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.confirm-btn:hover {
|
|
98
|
+
background: var(--ic-accent-hover);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.confirm-btn--danger {
|
|
102
|
+
background: var(--ic-error);
|
|
103
|
+
border-color: var(--ic-error);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.confirm-btn--danger:hover {
|
|
107
|
+
background: #dc2626;
|
|
108
|
+
border-color: #dc2626;
|
|
109
|
+
}
|
|
110
|
+
`];o([n({type:Boolean,reflect:!0})],r.prototype,"open",2);o([n()],r.prototype,"title",2);o([n()],r.prototype,"message",2);o([n()],r.prototype,"confirmLabel",2);o([n()],r.prototype,"cancelLabel",2);o([n()],r.prototype,"variant",2);r=o([u("ic-confirm-dialog")],r);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{s as u,i as d,n as p,a as h,g as f,b as c,t as b}from"./index-CEcM1R_C.js";import"./ic-icon-xeGTVhVG.js";var m=Object.defineProperty,y=Object.getOwnPropertyDescriptor,o=(e,i,n,a)=>{for(var s=a>1?void 0:a?y(i,n):i,l=e.length-1,r;l>=0;l--)(r=e[l])&&(s=(a?r(i,n,s):r(s))||s);return a&&s&&m(i,n,s),s};let t=class extends h{constructor(){super(...arguments),this.status="disconnected",this.size="8px",this.showLabel=!0}render(){const e=f(this.status);return c`
|
|
2
|
+
<span
|
|
3
|
+
class="dot ${e.pulse?"dot--pulse":""}"
|
|
4
|
+
style="width: ${this.size}; height: ${this.size}; background-color: ${e.color};"
|
|
5
|
+
role="status"
|
|
6
|
+
aria-label="Connection status: ${e.label}"
|
|
7
|
+
></span>
|
|
8
|
+
<span class="status-icon" aria-hidden="true">
|
|
9
|
+
<ic-icon name=${e.icon} size="12px" color=${e.color}></ic-icon>
|
|
10
|
+
</span>
|
|
11
|
+
${this.showLabel?c`<span class="label">${e.label}</span>`:c``}
|
|
12
|
+
`}};t.styles=[u,d`
|
|
13
|
+
:host {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: var(--ic-space-xs);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.dot {
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.dot--pulse {
|
|
25
|
+
animation: pulse 2s ease-in-out infinite;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@keyframes pulse {
|
|
29
|
+
0%,
|
|
30
|
+
100% {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
50% {
|
|
34
|
+
opacity: 0.4;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (prefers-reduced-motion: reduce) {
|
|
39
|
+
.dot--pulse {
|
|
40
|
+
animation: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.status-icon {
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.label {
|
|
51
|
+
color: var(--ic-text-dim);
|
|
52
|
+
font-size: var(--ic-text-xs);
|
|
53
|
+
}
|
|
54
|
+
`];o([p()],t.prototype,"status",2);o([p()],t.prototype,"size",2);o([p({type:Boolean})],t.prototype,"showLabel",2);t=o([b("ic-connection-dot")],t);
|