@pixelzx/genesis 2026.6.20 → 2026.6.22
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 +17 -0
- package/dist/.buildstamp +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-startup-metadata.json +1 -1
- package/dist/{command-registry-ClBXx6rA.js → command-registry-DPhQ-gYY.js} +2 -2
- package/dist/{command-registry-bijZPq36.js → command-registry-DtvwURJ_.js} +2 -2
- package/dist/{command-registry-core-Bf_MZZiA.js → command-registry-core-DllgASdD.js} +2 -2
- package/dist/{completion-cli-DV02VPia.js → completion-cli-CMRi4kQZ.js} +2 -2
- package/dist/{config-cli-DAOeCcCk.js → config-cli-ByTCIigq.js} +1 -1
- package/dist/control-ui/assets/{agents-CdobtTOW.js → agents-QDr5B3Ho.js} +393 -324
- package/dist/control-ui/assets/canvas-DcQV5mjQ.js +274 -0
- package/dist/control-ui/assets/channels-DTjwzddp.js +140 -0
- package/dist/control-ui/assets/cron-BL9vNTgH.js +78 -0
- package/dist/control-ui/assets/{de-ChvNzaWx.js → de-hbyceFeJ.js} +1 -1
- package/dist/control-ui/assets/{debug-B8lJz0xl.js → debug-BjvJPprv.js} +8 -8
- package/dist/control-ui/assets/{es-CrSDgcQ5.js → es-1Cx1cu-Y.js} +1 -1
- package/dist/control-ui/assets/{fr-BRwXxDjE.js → fr-VgMPipri.js} +1 -1
- package/dist/control-ui/assets/{i18n-Dr_ijwId.js → i18n-DLwqUqi0.js} +2 -2
- package/dist/control-ui/assets/{id-D6SwOJ8N.js → id-BjXuhykW.js} +1 -1
- package/dist/control-ui/assets/index-BTDvMe6P.css +1 -0
- package/dist/control-ui/assets/index-Chv-rDKB.js +5900 -0
- package/dist/control-ui/assets/{instances-DRlIDzRt.js → instances-M2ru9deN.js} +19 -19
- package/dist/control-ui/assets/{ja-JP-COtC4IfH.js → ja-JP-DWb-BMAl.js} +1 -1
- package/dist/control-ui/assets/{ko-BzeSxEM4.js → ko-Dp3UE5m2.js} +1 -1
- package/dist/control-ui/assets/{logs-BYrqUHTd.js → logs-l_Xtj11_.js} +6 -6
- package/dist/control-ui/assets/mcp-CCow5u67.js +380 -0
- package/dist/control-ui/assets/{memory-Dk8DVFlc.js → memory-DEvlXa9C.js} +11 -11
- package/dist/control-ui/assets/{models-WJk_luH_.js → models-Tc34Yl09.js} +26 -26
- package/dist/control-ui/assets/{nodes-SWmxABM8.js → nodes-CHIr0hLe.js} +89 -89
- package/dist/control-ui/assets/{pl-BFGaZC1a.js → pl-UrfXg6LL.js} +1 -1
- package/dist/control-ui/assets/plugins-CRSFM6pi.js +259 -0
- package/dist/control-ui/assets/presenter-DQKXVTz4.js +2 -0
- package/dist/control-ui/assets/{preview-yS9kUAt_.js → preview-DP8t6eAW.js} +1 -1
- package/dist/control-ui/assets/{pt-BR-B2QYSEq3.js → pt-BR-Cqsb5BcT.js} +1 -1
- package/dist/control-ui/assets/sessions-Xg8c67jk.js +56 -0
- package/dist/control-ui/assets/skills-CB5pgqaj.js +294 -0
- package/dist/control-ui/assets/skills-shared-DoedL_zw.js +11 -0
- package/dist/control-ui/assets/{th-CB7L1SFv.js → th-C_U0alhW.js} +1 -1
- package/dist/control-ui/assets/{tr-jlhb5DaE.js → tr-BHgpQnZM.js} +1 -1
- package/dist/control-ui/assets/{uk-BrLj30-c.js → uk-C_GhiUmQ.js} +1 -1
- package/dist/control-ui/assets/wallet-C_ySxHYg.js +302 -0
- package/dist/control-ui/assets/{zh-CN-BvMSlZSV.js → zh-CN-BNYbiW4p.js} +1 -1
- package/dist/control-ui/assets/{zh-TW-DvNvr4gT.js → zh-TW-DJ7rxwhV.js} +1 -1
- package/dist/control-ui/index.html +3 -4
- package/dist/entry.js +1 -1
- package/dist/{gateway-cli-BFiZ-zEO.js → gateway-cli-BNFp7cLD.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/postinstall-inventory.json +50 -51
- package/dist/{program-BpFNiyL3.js → program-C3s7d86C.js} +1 -1
- package/dist/{register.subclis-CHijsAFO.js → register.subclis-C2UfM0nV.js} +1 -1
- package/dist/{register.subclis-CpLtsILI.js → register.subclis-ClL1mC0C.js} +2 -2
- package/dist/{register.subclis-core-DeVwcUrh.js → register.subclis-core-x3Cm5RAM.js} +1 -1
- package/dist/{run-main-DYiUnyJr.js → run-main-Cg3U0WGv.js} +4 -4
- package/dist/{runtime-schema-DREgFqvJ.js → runtime-schema-m8uk8t3n.js} +1 -1
- package/dist/{server-WzFFYZ9M.js → server-Cdq-naBB.js} +1 -1
- package/dist/{server-plugin-bootstrap-BKn4Ukfx.js → server-plugin-bootstrap-CM8EErso.js} +1 -1
- package/dist/{server-plugin-bootstrap-Bkvb9v45.js → server-plugin-bootstrap-DQo6bnks.js} +1 -1
- package/dist/{server.impl-DJz2wbse.js → server.impl-CZEASk_e.js} +2 -2
- package/package.json +1 -1
- package/dist/control-ui/assets/canvas-Cy2AiGPQ.js +0 -269
- package/dist/control-ui/assets/channel-config-extras-BmGwfDPL.js +0 -2
- package/dist/control-ui/assets/channels-DdgVKbNz.js +0 -463
- package/dist/control-ui/assets/cron-CCNOjNyY.js +0 -933
- package/dist/control-ui/assets/format-BOO4MheD.js +0 -9
- package/dist/control-ui/assets/index-DTwo_TE_.js +0 -6247
- package/dist/control-ui/assets/index-u5Z0R_Xd.css +0 -1
- package/dist/control-ui/assets/mcp-C7ry874X.js +0 -373
- package/dist/control-ui/assets/plugins-bulpMEFW.js +0 -273
- package/dist/control-ui/assets/sessions-bCilYtM1.js +0 -306
- package/dist/control-ui/assets/skills-C1LNGjhW.js +0 -323
- package/dist/control-ui/assets/skills-shared-BHZ4ntcf.js +0 -11
- package/dist/control-ui/assets/wallet-BwqvP_oc.js +0 -285
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e,d as t,l as n,r}from"./i18n-DLwqUqi0.js";import{t as i}from"./string-coerce-LCfkQHEZ.js";import{C as a,D as o,M as s,S as c,T as l,_ as u,a as d,b as f,d as p,f as m,g as h,h as g,m as _,o as v,p as y,s as b,v as ee,w as te,x,y as ne}from"./index-Chv-rDKB.js";import{a as S,n as C,r as w,t as T}from"./presenter-DQKXVTz4.js";import{n as E,r as D,t as O}from"./skills-shared-DoedL_zw.js";function re(e){let{agent:i,configForm:a,agentFilesList:o,configLoading:s,configSaving:c,configDirty:l,onConfigReload:d,onConfigSave:p,onModelChange:g,onModelFallbacksChange:_,onSelectPanel:v}=e,y=ee(a,i.id),b=i.model,te=(o&&o.agentId===i.id?o.workspace:null)||y.entry?.workspace||y.defaults?.workspace||i.workspace||`default`,S=y.entry?.model?f(y.entry?.model):y.defaults?.model?f(y.defaults?.model):f(b),C=f(y.defaults?.model??b),w=x(y.entry?.model),T=x(y.defaults?.model)||(C===`-`?null:h(C))||(a?null:x(b)),E=w??T??null,D=ne(y.entry?.model)??ne(y.defaults?.model)??(a?null:ne(b))??[],O=Array.isArray(y.entry?.skills)?y.entry?.skills:null,re=O?.length??null,k=!!(e.defaultId&&i.id===e.defaultId),A=!a||s||c,j=e=>{let t=D.filter((t,n)=>n!==e);_(i.id,t)};return t`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="card-title">Overview</div>
|
|
4
4
|
<div class="card-sub">Workspace paths and identity metadata.</div>
|
|
@@ -10,10 +10,10 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
10
10
|
<button
|
|
11
11
|
type="button"
|
|
12
12
|
class="workspace-link mono"
|
|
13
|
-
@click=${()=>
|
|
13
|
+
@click=${()=>v(`files`)}
|
|
14
14
|
title="Open Files tab"
|
|
15
15
|
>
|
|
16
|
-
${
|
|
16
|
+
${te}
|
|
17
17
|
</button>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -27,11 +27,11 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
|
-
${
|
|
30
|
+
${l?t`
|
|
31
31
|
<div class="callout warn" style="margin-top: 16px">
|
|
32
32
|
You have unsaved config changes.
|
|
33
33
|
</div>
|
|
34
|
-
`:
|
|
34
|
+
`:n}
|
|
35
35
|
|
|
36
36
|
<div class="agent-model-select" style="margin-top: 20px;">
|
|
37
37
|
<div class="label">Model Selection</div>
|
|
@@ -41,14 +41,14 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
41
41
|
<select
|
|
42
42
|
.value=${k?E??``:w??``}
|
|
43
43
|
?disabled=${A}
|
|
44
|
-
@change=${e=>
|
|
44
|
+
@change=${e=>g(i.id,e.target.value||null)}
|
|
45
45
|
>
|
|
46
|
-
${k?
|
|
46
|
+
${k?t` <option value="">Not set</option> `:t`
|
|
47
47
|
<option value="">
|
|
48
48
|
${T?`Inherit default (${T})`:`Inherit default`}
|
|
49
49
|
</option>
|
|
50
50
|
`}
|
|
51
|
-
${
|
|
51
|
+
${m(a,E??void 0,e.modelCatalog)}
|
|
52
52
|
</select>
|
|
53
53
|
</label>
|
|
54
54
|
<div class="field">
|
|
@@ -57,14 +57,14 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
57
57
|
class="agent-chip-input"
|
|
58
58
|
@click=${e=>{let t=e.currentTarget.querySelector(`input`);t&&t.focus()}}
|
|
59
59
|
>
|
|
60
|
-
${D.map((
|
|
60
|
+
${D.map((e,n)=>t`
|
|
61
61
|
<span class="chip">
|
|
62
|
-
${
|
|
62
|
+
${e}
|
|
63
63
|
<button
|
|
64
64
|
type="button"
|
|
65
65
|
class="chip-remove"
|
|
66
66
|
?disabled=${A}
|
|
67
|
-
@click=${()=>
|
|
67
|
+
@click=${()=>j(n)}
|
|
68
68
|
>
|
|
69
69
|
×
|
|
70
70
|
</button>
|
|
@@ -73,8 +73,8 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
73
73
|
<input
|
|
74
74
|
?disabled=${A}
|
|
75
75
|
placeholder=${D.length===0?`provider/model`:``}
|
|
76
|
-
@keydown=${e=>{let t=e.target;if(e.key===`Enter`||e.key===`,`){e.preventDefault();let n=
|
|
77
|
-
@blur=${e=>{let t=e.target,n=
|
|
76
|
+
@keydown=${e=>{let t=e.target;if(e.key===`Enter`||e.key===`,`){e.preventDefault();let n=u(t.value);n.length>0&&(_(i.id,[...D,...n]),t.value=``)}}}
|
|
77
|
+
@blur=${e=>{let t=e.target,n=u(t.value);n.length>0&&(_(i.id,[...D,...n]),t.value=``)}}
|
|
78
78
|
/>
|
|
79
79
|
</div>
|
|
80
80
|
</div>
|
|
@@ -83,32 +83,32 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
83
83
|
<button
|
|
84
84
|
type="button"
|
|
85
85
|
class="btn btn--sm"
|
|
86
|
-
?disabled=${!
|
|
87
|
-
@click=${
|
|
86
|
+
?disabled=${!e.connected||e.modelProviderWizardBusy}
|
|
87
|
+
@click=${e.onModelProviderWizardStart}
|
|
88
88
|
>
|
|
89
|
-
${
|
|
89
|
+
${e.modelProviderWizardBusy?`Connecting...`:`Connect provider`}
|
|
90
90
|
</button>
|
|
91
91
|
<button
|
|
92
92
|
type="button"
|
|
93
93
|
class="btn btn--sm"
|
|
94
|
-
?disabled=${
|
|
95
|
-
@click=${
|
|
94
|
+
?disabled=${s}
|
|
95
|
+
@click=${d}
|
|
96
96
|
>
|
|
97
|
-
${
|
|
97
|
+
${r(`common.reloadConfig`)}
|
|
98
98
|
</button>
|
|
99
99
|
<button
|
|
100
100
|
type="button"
|
|
101
101
|
class="btn btn--sm primary"
|
|
102
|
-
?disabled=${
|
|
103
|
-
@click=${
|
|
102
|
+
?disabled=${c||!l}
|
|
103
|
+
@click=${p}
|
|
104
104
|
>
|
|
105
|
-
${
|
|
105
|
+
${c?`Saving…`:`Save`}
|
|
106
106
|
</button>
|
|
107
107
|
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</section>
|
|
110
|
-
${
|
|
111
|
-
`}function
|
|
110
|
+
${ie(e)}
|
|
111
|
+
`}function ie(e){let i=e.modelProviderWizardStep,a=!!(e.modelProviderWizardError||e.modelProviderWizardMessage);if(!i&&!e.modelProviderWizardBusy&&!a)return n;let o=i?.title||(e.modelProviderWizardError?`Model provider setup failed`:e.modelProviderWizardMessage?`Model provider connected`:`Connect model provider`),s=i?.message??e.modelProviderWizardError??e.modelProviderWizardMessage??``,c=!!i&&!e.modelProviderWizardBusy;return t`
|
|
112
112
|
<div class="exec-approval-overlay" role="dialog" aria-modal="true" aria-live="polite">
|
|
113
113
|
<div class="exec-approval-card channel-wizard-card">
|
|
114
114
|
<div class="exec-approval-header">
|
|
@@ -117,115 +117,115 @@ import{f as e,o as t,r as n,u as r}from"./i18n-Dr_ijwId.js";import{t as i}from".
|
|
|
117
117
|
<div class="exec-approval-sub">Provider credentials are saved on the Gateway.</div>
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
|
-
${s?
|
|
121
|
-
${i?
|
|
122
|
-
${
|
|
120
|
+
${s?t`<div class="channel-wizard-message">${k(s)}</div>`:n}
|
|
121
|
+
${i?ae(e,i):n}
|
|
122
|
+
${e.modelProviderWizardError?t`<div class="exec-approval-error">${e.modelProviderWizardError}</div>`:n}
|
|
123
123
|
<div class="exec-approval-actions">
|
|
124
|
-
${i?
|
|
124
|
+
${i?t`
|
|
125
125
|
<button
|
|
126
126
|
class="btn primary"
|
|
127
127
|
?disabled=${!c}
|
|
128
|
-
@click=${
|
|
128
|
+
@click=${e.onModelProviderWizardSubmit}
|
|
129
129
|
>
|
|
130
|
-
${
|
|
130
|
+
${e.modelProviderWizardBusy?r(`common.working`):`Continue`}
|
|
131
131
|
</button>
|
|
132
132
|
<button
|
|
133
133
|
class="btn"
|
|
134
|
-
?disabled=${
|
|
135
|
-
@click=${
|
|
134
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
135
|
+
@click=${e.onModelProviderWizardCancel}
|
|
136
136
|
>
|
|
137
|
-
${
|
|
137
|
+
${r(`common.cancel`)}
|
|
138
138
|
</button>
|
|
139
|
-
`:
|
|
139
|
+
`:t`
|
|
140
140
|
<button
|
|
141
141
|
class="btn primary"
|
|
142
|
-
?disabled=${
|
|
143
|
-
@click=${
|
|
142
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
143
|
+
@click=${e.onModelProviderWizardClose}
|
|
144
144
|
>
|
|
145
|
-
${
|
|
145
|
+
${r(`common.ok`)}
|
|
146
146
|
</button>
|
|
147
147
|
`}
|
|
148
148
|
</div>
|
|
149
149
|
</div>
|
|
150
150
|
</div>
|
|
151
|
-
`}function
|
|
152
|
-
`).map(e=>e.trimEnd()).map((
|
|
151
|
+
`}function k(e){return e.split(`
|
|
152
|
+
`).map(e=>e.trimEnd()).map((e,r)=>t`${r>0?t`<br />`:n}${e}`)}function A(e){if(typeof e==`string`)return`string:${e}`;try{return`json:${JSON.stringify(e)}`}catch{return String(e)}}function j(e,t){return A(e)===A(t)}function ae(e,i){if(i.type===`select`)return t`
|
|
153
153
|
<div class="channel-wizard-options">
|
|
154
|
-
${(i.options??[]).map(
|
|
154
|
+
${(i.options??[]).map(r=>t`
|
|
155
155
|
<button
|
|
156
|
-
class=${
|
|
157
|
-
?disabled=${
|
|
158
|
-
@click=${()=>
|
|
156
|
+
class=${j(e.modelProviderWizardInput,r.value)?`channel-wizard-option selected`:`channel-wizard-option`}
|
|
157
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
158
|
+
@click=${()=>e.onModelProviderWizardInput(r.value)}
|
|
159
159
|
>
|
|
160
|
-
<span>${
|
|
161
|
-
${
|
|
160
|
+
<span>${r.label}</span>
|
|
161
|
+
${r.hint?t`<small>${r.hint}</small>`:n}
|
|
162
162
|
</button>
|
|
163
163
|
`)}
|
|
164
164
|
</div>
|
|
165
|
-
`;if(i.type===`multiselect`){let
|
|
165
|
+
`;if(i.type===`multiselect`){let r=Array.isArray(e.modelProviderWizardInput)?e.modelProviderWizardInput:[];return t`
|
|
166
166
|
<div class="channel-wizard-options">
|
|
167
|
-
${(i.options??[]).map(i=>{let a=
|
|
167
|
+
${(i.options??[]).map(i=>{let a=r.some(e=>j(e,i.value)),o=a?r.filter(e=>!j(e,i.value)):[...r,i.value];return t`
|
|
168
168
|
<button
|
|
169
169
|
class=${a?`channel-wizard-option selected`:`channel-wizard-option`}
|
|
170
|
-
?disabled=${
|
|
171
|
-
@click=${()=>
|
|
170
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
171
|
+
@click=${()=>e.onModelProviderWizardInput(o)}
|
|
172
172
|
>
|
|
173
173
|
<span>${i.label}</span>
|
|
174
|
-
${i.hint?
|
|
174
|
+
${i.hint?t`<small>${i.hint}</small>`:n}
|
|
175
175
|
</button>
|
|
176
176
|
`})}
|
|
177
177
|
</div>
|
|
178
|
-
`}if(i.type===`confirm`)return
|
|
178
|
+
`}if(i.type===`confirm`)return t`
|
|
179
179
|
<div class="channel-wizard-confirm">
|
|
180
180
|
<button
|
|
181
|
-
class=${
|
|
182
|
-
?disabled=${
|
|
183
|
-
@click=${()=>
|
|
181
|
+
class=${e.modelProviderWizardInput===!0?`btn primary`:`btn`}
|
|
182
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
183
|
+
@click=${()=>e.onModelProviderWizardInput(!0)}
|
|
184
184
|
>
|
|
185
|
-
${
|
|
185
|
+
${r(`common.yes`)}
|
|
186
186
|
</button>
|
|
187
187
|
<button
|
|
188
|
-
class=${
|
|
189
|
-
?disabled=${
|
|
190
|
-
@click=${()=>
|
|
188
|
+
class=${e.modelProviderWizardInput===!1?`btn primary`:`btn`}
|
|
189
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
190
|
+
@click=${()=>e.onModelProviderWizardInput(!1)}
|
|
191
191
|
>
|
|
192
|
-
${
|
|
192
|
+
${r(`common.no`)}
|
|
193
193
|
</button>
|
|
194
194
|
</div>
|
|
195
|
-
`;if(i.type===`text`){let n=typeof
|
|
195
|
+
`;if(i.type===`text`){let n=typeof e.modelProviderWizardInput==`string`?e.modelProviderWizardInput:``;return t`
|
|
196
196
|
<input
|
|
197
197
|
class="input channel-wizard-text"
|
|
198
198
|
type=${i.sensitive?`password`:`text`}
|
|
199
199
|
autocomplete=${i.sensitive?`off`:`on`}
|
|
200
200
|
.value=${n}
|
|
201
201
|
placeholder=${i.placeholder??``}
|
|
202
|
-
?disabled=${
|
|
203
|
-
@input=${e
|
|
202
|
+
?disabled=${e.modelProviderWizardBusy}
|
|
203
|
+
@input=${t=>e.onModelProviderWizardInput(t.currentTarget.value)}
|
|
204
204
|
/>
|
|
205
|
-
`}return
|
|
206
|
-
`)}</div>`;return a=
|
|
207
|
-
${e.children.map(e=>`<li>${
|
|
205
|
+
`}return n}var oe=Object.defineProperty,se=(e,t,n)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t,n)=>se(e,typeof t==`symbol`?t:t+``,n),ce={classPrefix:`cm-`,theme:`github`,linkTarget:`_blank`,sanitize:!1,plugins:[],customRenderers:{}};function le(e){return{...ce,...e,plugins:e?.plugins??[],customRenderers:e?.customRenderers??{}}}function ue(e,t){return typeof t==`function`?t(e):e}function de(e,t){let n=le(t),r=n.classPrefix,i=e;for(let e of n.plugins)e.transformBlock&&(i=i.map(e.transformBlock));let a=`<div class="${r}preview">${i.map(e=>{for(let t of n.plugins)if(t.renderBlock){let r=t.renderBlock(e,()=>pe(e,n));if(r!==null)return r}let t=n.customRenderers[e.type];return t?t(e):pe(e,n)}).join(`
|
|
206
|
+
`)}</div>`;return a=ue(a,n.sanitize),a}async function fe(e,t){let n=le(t);for(let e of n.plugins)e.init&&await e.init();let r=de(e,t);for(let e of n.plugins)e.postProcess&&(r=await e.postProcess(r));return r}function pe(e,t){let n=t.classPrefix;switch(e.type){case`paragraph`:return`<p class="${n}paragraph">${N(e.content,t)}</p>`;case`heading`:return me(e,t);case`bulletList`:return he(e,t);case`numberedList`:return ge(e,t);case`checkList`:return _e(e,t);case`codeBlock`:return ve(e,t);case`blockquote`:return`<blockquote class="${n}blockquote">${N(e.content,t)}</blockquote>`;case`table`:return ye(e,t);case`image`:return be(e,t);case`divider`:return`<hr class="${n}divider" />`;case`callout`:return xe(e,t);default:return`<div class="${n}unknown">${N(e.content,t)}</div>`}}function me(e,t){let n=t.classPrefix,r=e.props.level,i=`h${r}`;return`<${i} class="${n}heading ${n}h${r}">${N(e.content,t)}</${i}>`}function he(e,t){return`<ul class="${t.classPrefix}bullet-list">
|
|
207
|
+
${e.children.map(e=>`<li>${N(e.content,t)}</li>`).join(`
|
|
208
208
|
`)}
|
|
209
|
-
</ul>`}function
|
|
210
|
-
${e.children.map(e=>`<li>${
|
|
209
|
+
</ul>`}function ge(e,t){return`<ol class="${t.classPrefix}numbered-list">
|
|
210
|
+
${e.children.map(e=>`<li>${N(e.content,t)}</li>`).join(`
|
|
211
211
|
`)}
|
|
212
|
-
</ol>`}function
|
|
212
|
+
</ol>`}function _e(e,t){let n=t.classPrefix,r=e.props.checked;return`
|
|
213
213
|
<div class="${n}checklist-item">
|
|
214
214
|
<input type="checkbox" ${r?`checked disabled`:`disabled`} />
|
|
215
|
-
<span class="${r?`${n}checked`:``}">${
|
|
216
|
-
</div>`.trim()}function
|
|
217
|
-
${r.length>0?`<thead><tr>${r.map((e,t)=>`<th${o(t)}>${
|
|
215
|
+
<span class="${r?`${n}checked`:``}">${N(e.content,t)}</span>
|
|
216
|
+
</div>`.trim()}function ve(e,t){let n=t.classPrefix,r=e.content.map(e=>e.text).join(``),i=e.props.language||``,a=P(r),o=i?` language-${i}`:``;return`<pre class="${n}code-block"${i?` data-language="${i}"`:``}><code class="${n}code${o}">${a}</code></pre>`}function ye(e,t){let n=t.classPrefix,{headers:r,rows:i,alignments:a}=e.props,o=e=>{let t=a?.[e];return t?` style="text-align: ${t}"`:``};return`<table class="${n}table">
|
|
217
|
+
${r.length>0?`<thead><tr>${r.map((e,t)=>`<th${o(t)}>${P(e)}</th>`).join(``)}</tr></thead>`:``}
|
|
218
218
|
<tbody>
|
|
219
|
-
${i.map(e=>`<tr>${e.map((e,t)=>`<td${o(t)}>${
|
|
219
|
+
${i.map(e=>`<tr>${e.map((e,t)=>`<td${o(t)}>${P(e)}</td>`).join(``)}</tr>`).join(`
|
|
220
220
|
`)}
|
|
221
221
|
</tbody>
|
|
222
|
-
</table>`}function
|
|
222
|
+
</table>`}function be(e,t){let n=t.classPrefix,{url:r,alt:i,title:a,width:o,height:s}=e.props,c=i?` alt="${P(i)}"`:` alt=""`,l=a?` title="${P(a)}"`:``,u=o?` width="${o}"`:``,d=s?` height="${s}"`:``;return`<figure class="${n}image">${`<img src="${P(r)}"${c}${l}${u}${d} />`}${i?`<figcaption>${P(i)}</figcaption>`:``}</figure>`}function xe(e,t){let n=t.classPrefix,r=e.props.type;return`
|
|
223
223
|
<div class="${n}callout ${n}callout-${r}" role="alert">
|
|
224
224
|
<strong class="${n}callout-title">${r}</strong>
|
|
225
|
-
<div class="${n}callout-content">${
|
|
226
|
-
</div>`.trim()}function
|
|
225
|
+
<div class="${n}callout-content">${N(e.content,t)}</div>
|
|
226
|
+
</div>`.trim()}function N(e,t){return e.map(e=>Se(e,t)).join(``)}function Se(e,t){let n=P(e.text),r=e.styles;if(r.code&&(n=`<code>${n}</code>`),r.highlight&&(n=`<mark>${n}</mark>`),r.strikethrough&&(n=`<del>${n}</del>`),r.underline&&(n=`<u>${n}</u>`),r.italic&&(n=`<em>${n}</em>`),r.bold&&(n=`<strong>${n}</strong>`),r.link){let e=t.linkTarget===`_blank`?` target="_blank" rel="noopener noreferrer"`:``,i=r.link.title?` title="${P(r.link.title)}"`:``;n=`<a href="${P(r.link.url)}"${i}${e}>${n}</a>`}return n}function P(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function Ce(e){return[...[1,2,3,4,5,6].map(t=>({tag:`h${t}`,classes:[`${e}heading`,`${e}h${t}`]})),{tag:`p`,classes:[`${e}paragraph`]},{tag:`ul`,classes:[`${e}bullet-list`]},{tag:`ol`,classes:[`${e}numbered-list`]},{tag:`pre`,classes:[`${e}code-block`]},{tag:`blockquote`,classes:[`${e}blockquote`]},{tag:`hr`,classes:[`${e}divider`]},{tag:`table`,classes:[`${e}table`]},{tag:`figure`,classes:[`${e}image`]}]}function we(e,t){let n=t.join(` `),r=/\bclass\s*=\s*"([^"]*)"/i,i=e.match(r);return i?e.replace(r,`class="${n} ${i[1]}"`):e.endsWith(`/>`)?e.slice(0,-2)+` class="${n}" />`:e.slice(0,-1)+` class="${n}">`}function Te(e,t){return e.replace(/(?<!<figure[^>]*>\s*)(<img\s[^>]*\/?>)(?!\s*<\/figure>)/gi,`<figure class="${t}image">$1</figure>`)}function Ee(e,t){let n=t?.classPrefix??`cm-`,r=t?.wrapperClass??`${n}preview`,i=Ce(n),a=e;for(let{tag:e,classes:t}of i){let n=RegExp(`<${e}(\\s[^>]*)?>|<${e}\\s*\\/?>`,`gi`);a=a.replace(n,e=>we(e,t))}return a=Te(a,n),a=`<div class="${r}">${a}</div>`,typeof t?.sanitize==`function`&&(a=t.sanitize(a)),a}async function De(t){try{return(await e(()=>import(`./preview-DP8t6eAW.js`),[],import.meta.url)).parse(t)}catch{throw Error(`@create-markdown/core is required to parse markdown in <markdown-preview>. Install it, or provide pre-parsed blocks via the blocks attribute / setBlocks().`)}}M(class extends HTMLElement{constructor(){super(),M(this,`_shadow`,null),M(this,`plugins`,[]),M(this,`defaultTheme`,`github`),M(this,`styleElement`),M(this,`contentElement`);let e=this.constructor._shadowMode;e!==`none`&&(this._shadow=this.attachShadow({mode:e})),this.styleElement=document.createElement(`style`),this.renderRoot.appendChild(this.styleElement),this.contentElement=document.createElement(`div`),this.contentElement.className=`markdown-preview-content`,this.renderRoot.appendChild(this.contentElement),this.updateStyles()}static get observedAttributes(){return[`theme`,`link-target`,`async`]}get renderRoot(){return this._shadow??this}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){this.render()}setPlugins(e){this.plugins=e,this.render()}setDefaultTheme(e){this.defaultTheme=e,this.render()}getMarkdown(){let e=this.getAttribute(`blocks`);if(e)try{return JSON.parse(e).map(e=>e.content.map(e=>e.text).join(``)).join(`
|
|
227
227
|
|
|
228
|
-
`)}catch{return``}return this.textContent||``}setMarkdown(e){this.textContent=e,this.render()}setBlocks(e){this.setAttribute(`blocks`,JSON.stringify(e)),this.render()}getOptions(){return{theme:this.getAttribute(`theme`)||this.defaultTheme,linkTarget:this.getAttribute(`link-target`)||`_blank`,plugins:this.plugins}}async getBlocks(){let e=this.getAttribute(`blocks`);if(e)try{return JSON.parse(e)}catch{return console.warn(`Invalid blocks JSON in markdown-preview element`),[]}return
|
|
228
|
+
`)}catch{return``}return this.textContent||``}setMarkdown(e){this.textContent=e,this.render()}setBlocks(e){this.setAttribute(`blocks`,JSON.stringify(e)),this.render()}getOptions(){return{theme:this.getAttribute(`theme`)||this.defaultTheme,linkTarget:this.getAttribute(`link-target`)||`_blank`,plugins:this.plugins}}async getBlocks(){let e=this.getAttribute(`blocks`);if(e)try{return JSON.parse(e)}catch{return console.warn(`Invalid blocks JSON in markdown-preview element`),[]}return De(this.textContent||``)}async render(){let e=await this.getBlocks(),t=this.getOptions(),n=this.hasAttribute(`async`)||this.plugins.length>0;try{let r;r=n?await fe(e,t):de(e,t),this.contentElement.innerHTML=r}catch(e){console.error(`Error rendering markdown preview:`,e),this.contentElement.innerHTML=`<div class="error">Error rendering content</div>`}}updateStyles(){let e=this.plugins.filter(e=>e.getCSS).map(e=>e.getCSS()).join(`
|
|
229
229
|
|
|
230
230
|
`),t=this._shadow?`:host { display: block; }`:`markdown-preview { display: block; }`;this.styleElement.textContent=`
|
|
231
231
|
${t}
|
|
@@ -244,12 +244,12 @@ ${t}
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
${e}
|
|
247
|
-
`.trim()}},`_shadowMode`,`open`);function
|
|
248
|
-
]`).replace(`lheading`,
|
|
249
|
-
`),n=t.length-1;for(;n>=0&&
|
|
250
|
-
`)}function
|
|
247
|
+
`.trim()}},`_shadowMode`,`open`);function Oe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=Oe();function ke(e){F=e}var I={exec:()=>null};function L(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(R.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ae=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},je=/^(?:[ \t]*(?:\n|$))+/,Me=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ne=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,z=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ie=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Le=L(Ie).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Re=L(Ie).replace(/bull/g,Fe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ze=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Be=/^[^\n]+/,Ve=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,He=L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ve).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ue=L(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fe).getRegex(),B=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,We=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ge=L(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,We).replace(`tag`,B).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ke=L(ze).replace(`hr`,z).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,B).getRegex(),qe={blockquote:L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Ke).getRegex(),code:Me,def:He,fences:Ne,heading:Pe,hr:z,html:Ge,lheading:Le,list:Ue,newline:je,paragraph:Ke,table:I,text:Be},Je=L(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,z).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,B).getRegex(),Ye={...qe,lheading:Re,table:Je,paragraph:L(ze).replace(`hr`,z).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Je).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,B).getRegex()},Xe={...qe,html:L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,We).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:I,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L(ze).replace(`hr`,z).replace(`heading`,` *#{1,6} *[^
|
|
248
|
+
]`).replace(`lheading`,Le).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Qe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$e=/^( {2,}|\\)\n(?!\s*$)/,et=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,V=/[\p{P}\p{S}]/u,H=/[\s\p{P}\p{S}]/u,tt=/[^\s\p{P}\p{S}]/u,nt=L(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,H).getRegex(),rt=/(?!~)[\p{P}\p{S}]/u,it=/(?!~)[\s\p{P}\p{S}]/u,at=/(?:[^\s\p{P}\p{S}]|~)/u,ot=L(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ae?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),st=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ct=L(st,`u`).replace(/punct/g,V).getRegex(),lt=L(st,`u`).replace(/punct/g,rt).getRegex(),ut=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,dt=L(ut,`gu`).replace(/notPunctSpace/g,tt).replace(/punctSpace/g,H).replace(/punct/g,V).getRegex(),ft=L(ut,`gu`).replace(/notPunctSpace/g,at).replace(/punctSpace/g,it).replace(/punct/g,rt).getRegex(),pt=L(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,tt).replace(/punctSpace/g,H).replace(/punct/g,V).getRegex(),mt=L(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,V).getRegex(),ht=L(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,tt).replace(/punctSpace/g,H).replace(/punct/g,V).getRegex(),gt=L(/\\(punct)/,`gu`).replace(/punct/g,V).getRegex(),_t=L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vt=L(We).replace(`(?:-->|$)`,`-->`).getRegex(),yt=L(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,vt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),U=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,bt=L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,U).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xt=L(/^!?\[(label)\]\[(ref)\]/).replace(`label`,U).replace(`ref`,Ve).getRegex(),St=L(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ve).getRegex(),Ct=L(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,xt).replace(`nolink`,St).getRegex(),wt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Tt={_backpedal:I,anyPunctuation:gt,autolink:_t,blockSkip:ot,br:$e,code:Qe,del:I,delLDelim:I,delRDelim:I,emStrongLDelim:ct,emStrongRDelimAst:dt,emStrongRDelimUnd:pt,escape:Ze,link:bt,nolink:St,punctuation:nt,reflink:xt,reflinkSearch:Ct,tag:yt,text:et,url:I},Et={...Tt,link:L(/^!?\[(label)\]\((.*?)\)/).replace(`label`,U).getRegex(),reflink:L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,U).getRegex()},Dt={...Tt,emStrongRDelimAst:ft,emStrongLDelim:lt,delLDelim:mt,delRDelim:ht,url:L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,wt).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,wt).getRegex()},Ot={...Dt,br:L($e).replace(`{2,}`,`*`).getRegex(),text:L(Dt.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},kt={normal:qe,gfm:Ye,pedantic:Xe},W={normal:Tt,gfm:Dt,breaks:Ot,pedantic:Et},At={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},jt=e=>At[e];function G(e,t){if(t){if(R.escapeTest.test(e))return e.replace(R.escapeReplace,jt)}else if(R.escapeTestNoEncode.test(e))return e.replace(R.escapeReplaceNoEncode,jt);return e}function Mt(e){try{e=encodeURI(e).replace(R.percentDecode,`%`)}catch{return null}return e}function Nt(e,t){let n=e.replace(R.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(R.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(R.slashPipe,`|`);return n}function K(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Pt(e){let t=e.split(`
|
|
249
|
+
`),n=t.length-1;for(;n>=0&&R.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
250
|
+
`)}function Ft(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function It(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Lt(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Rt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
251
251
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
252
|
-
`)}var
|
|
252
|
+
`)}var zt=class{options;rules;lexer;constructor(e){this.options=e||F}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Pt(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Rt(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=K(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:K(t[0],`
|
|
253
253
|
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:K(t[0],`
|
|
254
254
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],`
|
|
255
255
|
`).split(`
|
|
@@ -262,20 +262,20 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
262
262
|
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
263
263
|
`+e.join(`
|
|
264
264
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
265
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=
|
|
265
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=It(t[2].split(`
|
|
266
266
|
`,1)[0],t[1].length),l=e.split(`
|
|
267
267
|
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
268
268
|
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
269
269
|
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
270
270
|
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
271
271
|
`+l}u=!l.trim(),r+=p+`
|
|
272
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=
|
|
273
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
272
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Pt(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:K(t[0],`
|
|
273
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Nt(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
274
274
|
`):[],a={type:`table`,raw:K(t[0],`
|
|
275
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
275
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Nt(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:K(t[0],`
|
|
276
276
|
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
277
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=K(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=
|
|
278
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(
|
|
277
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=K(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ft(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Lt(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Lt(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},q=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||F,this.options.tokenizer=this.options.tokenizer||new zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:R,block:kt.normal,inline:W.normal};this.options.pedantic?(t.block=kt.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=kt.gfm,this.options.breaks?t.inline=W.breaks:t.inline=W.gfm),this.tokenizer.rules=t}static get rules(){return{block:kt,inline:W}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(R.carriageReturn,`
|
|
278
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(R.tabCharGlobal,` `).replace(R.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
279
279
|
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
280
280
|
`)?``:`
|
|
281
281
|
`)+i.raw,n.text+=`
|
|
@@ -288,7 +288,7 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
288
288
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
289
289
|
`)?``:`
|
|
290
290
|
`)+i.raw,n.text+=`
|
|
291
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},
|
|
291
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Bt=class{options;parser;constructor(e){this.options=e||F}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(R.notSpaceStart)?.[0],i=e.replace(R.endingNewline,``)+`
|
|
292
292
|
`;return r?`<pre><code class="language-`+G(r)+`">`+(n?i:G(i,!0))+`</code></pre>
|
|
293
293
|
`:`<pre><code>`+(n?i:G(i,!0))+`</code></pre>
|
|
294
294
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -306,8 +306,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
306
306
|
`}tablerow({text:e}){return`<tr>
|
|
307
307
|
${e}</tr>
|
|
308
308
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
309
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${G(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=
|
|
310
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function
|
|
309
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${G(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Mt(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+G(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Mt(e);if(i===null)return G(n);e=i;let a=`<img src="${e}" alt="${G(n)}"`;return t&&(a+=` title="${G(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:G(e.text)}},Vt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},J=class e{options;renderer;textRenderer;constructor(e){this.options=e||F,this.options.renderer=this.options.renderer||new Bt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vt}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Y=class{options;block;constructor(e){this.options=e||F}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?q.lex:q.lexInline}provideParser(e=this.block){return e?J.parse:J.parseInline}},X=new class{defaults=Oe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=J;Renderer=Bt;TextRenderer=Vt;Lexer=q;Tokenizer=zt;Hooks=Y;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Bt(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new zt(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Y;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Y.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Y.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q.lex(e,t??this.defaults)}parser(e,t){return J.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?q.lex:q.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?J.parse:J.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?q.lex:q.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?J.parse:J.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
310
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Z(e,t){return X.parse(e,t)}Z.options=Z.setOptions=function(e){return X.setOptions(e),Z.defaults=X.defaults,ke(Z.defaults),Z},Z.getDefaults=Oe,Z.defaults=F,Z.use=function(...e){return X.use(...e),Z.defaults=X.defaults,ke(Z.defaults),Z},Z.walkTokens=function(e,t){return X.walkTokens(e,t)},Z.parseInline=X.parseInline,Z.Parser=J,Z.parser=J.parse,Z.Renderer=Bt,Z.TextRenderer=Vt,Z.Lexer=q,Z.lexer=q.lex,Z.Tokenizer=zt,Z.Hooks=Y,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,J.parse,q.lex;function Ht(e,t){if(!e)return null;let n=(e.channels??{})[t];if(n&&typeof n==`object`)return n;let r=e[t];return r&&typeof r==`object`?r:null}function Ut(e){if(e==null)return r(`common.na`);if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return r(`common.na`)}}function Wt(e){let t=Ht(e.configForm,e.channelId);return t?e.fields.flatMap(e=>e in t?[{label:e,value:Ut(t[e])}]:[]):[]}function Gt(e,n,r){return t`
|
|
311
311
|
<section class="card">
|
|
312
312
|
<div class="card-title">Agent Context</div>
|
|
313
313
|
<div class="card-sub">${n}</div>
|
|
@@ -321,65 +321,65 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
321
321
|
@click=${()=>r(`files`)}
|
|
322
322
|
title="Open Files tab"
|
|
323
323
|
>
|
|
324
|
-
${
|
|
324
|
+
${e.workspace}
|
|
325
325
|
</button>
|
|
326
326
|
</div>
|
|
327
327
|
</div>
|
|
328
328
|
<div class="agent-kv">
|
|
329
329
|
<div class="label">Primary Model</div>
|
|
330
|
-
<div class="mono">${
|
|
330
|
+
<div class="mono">${e.model}</div>
|
|
331
331
|
</div>
|
|
332
332
|
<div class="agent-kv">
|
|
333
333
|
<div class="label">Identity Name</div>
|
|
334
|
-
<div>${
|
|
334
|
+
<div>${e.identityName}</div>
|
|
335
335
|
</div>
|
|
336
336
|
<div class="agent-kv">
|
|
337
337
|
<div class="label">Identity Avatar</div>
|
|
338
|
-
<div>${
|
|
338
|
+
<div>${e.identityAvatar}</div>
|
|
339
339
|
</div>
|
|
340
340
|
<div class="agent-kv">
|
|
341
341
|
<div class="label">Skills Filter</div>
|
|
342
|
-
<div>${
|
|
342
|
+
<div>${e.skillsLabel}</div>
|
|
343
343
|
</div>
|
|
344
344
|
<div class="agent-kv">
|
|
345
345
|
<div class="label">Default</div>
|
|
346
|
-
<div>${
|
|
346
|
+
<div>${e.isDefault?`yes`:`no`}</div>
|
|
347
347
|
</div>
|
|
348
348
|
</div>
|
|
349
349
|
</section>
|
|
350
|
-
`}function
|
|
350
|
+
`}function Kt(e,t){let n=e.channelMeta?.find(e=>e.id===t);return n?.label?n.label:e.channelLabels?.[t]??t}function qt(e){if(!e)return[];let t=new Set;for(let n of e.channelOrder??[])t.add(n);for(let n of e.channelMeta??[])t.add(n.id);for(let n of Object.keys(e.channelAccounts??{}))t.add(n);let n=[],r=e.channelOrder?.length?e.channelOrder:Array.from(t);for(let e of r)t.has(e)&&(n.push(e),t.delete(e));for(let e of t)n.push(e);return n.map(t=>({id:t,label:Kt(e,t),accounts:e.channelAccounts?.[t]??[]}))}var Jt=[`groupPolicy`,`streamMode`,`dmPolicy`];function Yt(e){let t=0,n=0,r=0;for(let i of e){let e=i.probe&&typeof i.probe==`object`&&`ok`in i.probe?!!i.probe.ok:!1;(i.connected===!0||i.running===!0||e)&&(t+=1),i.configured&&(n+=1),i.enabled&&(r+=1)}return{total:e.length,connected:t,configured:n,enabled:r}}function Xt(e){let i=qt(e.snapshot),a=e.lastSuccess?s(e.lastSuccess):`never`;return t`
|
|
351
351
|
<section class="grid grid-cols-2">
|
|
352
|
-
${
|
|
352
|
+
${Gt(e.context,`Workspace, identity, and model configuration.`,e.onSelectPanel)}
|
|
353
353
|
<section class="card">
|
|
354
354
|
<div class="row" style="justify-content: space-between;">
|
|
355
355
|
<div>
|
|
356
356
|
<div class="card-title">Channels</div>
|
|
357
357
|
<div class="card-sub">Gateway-wide channel status snapshot.</div>
|
|
358
358
|
</div>
|
|
359
|
-
<button class="btn btn--sm" ?disabled=${
|
|
360
|
-
${
|
|
359
|
+
<button class="btn btn--sm" ?disabled=${e.loading} @click=${e.onRefresh}>
|
|
360
|
+
${e.loading?r(`common.refreshing`):r(`common.refresh`)}
|
|
361
361
|
</button>
|
|
362
362
|
</div>
|
|
363
|
-
<div class="muted" style="margin-top: 8px;">Last refresh: ${
|
|
364
|
-
${
|
|
365
|
-
${
|
|
363
|
+
<div class="muted" style="margin-top: 8px;">Last refresh: ${a}</div>
|
|
364
|
+
${e.error?t`<div class="callout danger" style="margin-top: 12px;">${e.error}</div>`:n}
|
|
365
|
+
${e.snapshot?n:t`
|
|
366
366
|
<div class="callout info" style="margin-top: 12px">
|
|
367
367
|
Load channels to see live status.
|
|
368
368
|
</div>
|
|
369
369
|
`}
|
|
370
|
-
${i.length===0?
|
|
370
|
+
${i.length===0?t` <div class="muted" style="margin-top: 16px">No channels found.</div> `:t`
|
|
371
371
|
<div class="list" style="margin-top: 16px;">
|
|
372
|
-
${i.map(
|
|
372
|
+
${i.map(r=>{let i=Yt(r.accounts),a=i.total?`${i.connected}/${i.total} connected`:`no accounts`,o=i.configured?`${i.configured} configured`:`not configured`,s=i.total?`${i.enabled} enabled`:`disabled`,c=Wt({configForm:e.configForm,channelId:r.id,fields:Jt});return t`
|
|
373
373
|
<div class="list-item">
|
|
374
374
|
<div class="list-main">
|
|
375
|
-
<div class="list-title">${
|
|
376
|
-
<div class="list-sub mono">${
|
|
375
|
+
<div class="list-title">${r.label}</div>
|
|
376
|
+
<div class="list-sub mono">${r.id}</div>
|
|
377
377
|
</div>
|
|
378
378
|
<div class="list-meta">
|
|
379
379
|
<div>${a}</div>
|
|
380
380
|
<div>${o}</div>
|
|
381
381
|
<div>${s}</div>
|
|
382
|
-
${i.configured===0?
|
|
382
|
+
${i.configured===0?t`
|
|
383
383
|
<div>
|
|
384
384
|
<a
|
|
385
385
|
href="https://genesis.pixelzx.com/docs/channels"
|
|
@@ -389,8 +389,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
389
389
|
>Setup guide</a
|
|
390
390
|
>
|
|
391
391
|
</div>
|
|
392
|
-
`:
|
|
393
|
-
${c.length>0?c.map(t
|
|
392
|
+
`:n}
|
|
393
|
+
${c.length>0?c.map(e=>t`<div>${e.label}: ${e.value}</div>`):n}
|
|
394
394
|
</div>
|
|
395
395
|
</div>
|
|
396
396
|
`})}
|
|
@@ -398,64 +398,64 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
398
398
|
`}
|
|
399
399
|
</section>
|
|
400
400
|
</section>
|
|
401
|
-
`}function
|
|
401
|
+
`}function Zt(e){let i=e.jobs.filter(t=>t.agentId===e.agentId);return t`
|
|
402
402
|
<section class="grid grid-cols-2">
|
|
403
|
-
${
|
|
403
|
+
${Gt(e.context,`Workspace and scheduling targets.`,e.onSelectPanel)}
|
|
404
404
|
<section class="card">
|
|
405
405
|
<div class="row" style="justify-content: space-between;">
|
|
406
406
|
<div>
|
|
407
407
|
<div class="card-title">Scheduler</div>
|
|
408
408
|
<div class="card-sub">Gateway cron status.</div>
|
|
409
409
|
</div>
|
|
410
|
-
<button class="btn btn--sm" ?disabled=${
|
|
411
|
-
${
|
|
410
|
+
<button class="btn btn--sm" ?disabled=${e.loading} @click=${e.onRefresh}>
|
|
411
|
+
${e.loading?r(`common.refreshing`):r(`common.refresh`)}
|
|
412
412
|
</button>
|
|
413
413
|
</div>
|
|
414
414
|
<div class="stat-grid" style="margin-top: 16px;">
|
|
415
415
|
<div class="stat">
|
|
416
|
-
<div class="stat-label">${
|
|
416
|
+
<div class="stat-label">${r(`common.enabled`)}</div>
|
|
417
417
|
<div class="stat-value">
|
|
418
|
-
${
|
|
418
|
+
${e.status?e.status.enabled?r(`common.yes`):r(`common.no`):r(`common.na`)}
|
|
419
419
|
</div>
|
|
420
420
|
</div>
|
|
421
421
|
<div class="stat">
|
|
422
422
|
<div class="stat-label">Jobs</div>
|
|
423
|
-
<div class="stat-value">${
|
|
423
|
+
<div class="stat-value">${e.status?.jobs??r(`common.na`)}</div>
|
|
424
424
|
</div>
|
|
425
425
|
<div class="stat">
|
|
426
426
|
<div class="stat-label">Next wake</div>
|
|
427
|
-
<div class="stat-value">${
|
|
427
|
+
<div class="stat-value">${S(e.status?.nextWakeAtMs??null)}</div>
|
|
428
428
|
</div>
|
|
429
429
|
</div>
|
|
430
|
-
${
|
|
430
|
+
${e.error?t`<div class="callout danger" style="margin-top: 12px;">${e.error}</div>`:n}
|
|
431
431
|
</section>
|
|
432
432
|
</section>
|
|
433
433
|
<section class="card">
|
|
434
434
|
<div class="card-title">Agent Cron Jobs</div>
|
|
435
435
|
<div class="card-sub">Scheduled jobs targeting this agent.</div>
|
|
436
|
-
${i.length===0?
|
|
436
|
+
${i.length===0?t` <div class="muted" style="margin-top: 16px">No jobs assigned.</div> `:t`
|
|
437
437
|
<div class="list" style="margin-top: 16px;">
|
|
438
|
-
${i.map(
|
|
438
|
+
${i.map(r=>t`
|
|
439
439
|
<div class="list-item">
|
|
440
440
|
<div class="list-main">
|
|
441
|
-
<div class="list-title">${
|
|
442
|
-
${
|
|
441
|
+
<div class="list-title">${r.name}</div>
|
|
442
|
+
${r.description?t`<div class="list-sub">${r.description}</div>`:n}
|
|
443
443
|
<div class="chip-row" style="margin-top: 6px;">
|
|
444
|
-
<span class="chip">${
|
|
445
|
-
<span class="chip ${
|
|
446
|
-
${
|
|
444
|
+
<span class="chip">${C(r)}</span>
|
|
445
|
+
<span class="chip ${r.enabled?`chip-ok`:`chip-warn`}">
|
|
446
|
+
${r.enabled?`enabled`:`disabled`}
|
|
447
447
|
</span>
|
|
448
|
-
<span class="chip">${
|
|
448
|
+
<span class="chip">${r.sessionTarget}</span>
|
|
449
449
|
</div>
|
|
450
450
|
</div>
|
|
451
451
|
<div class="list-meta">
|
|
452
|
-
<div class="mono">${
|
|
453
|
-
<div class="muted">${
|
|
452
|
+
<div class="mono">${w(r)}</div>
|
|
453
|
+
<div class="muted">${T(r)}</div>
|
|
454
454
|
<button
|
|
455
455
|
class="btn btn--sm"
|
|
456
456
|
style="margin-top: 6px;"
|
|
457
|
-
?disabled=${!
|
|
458
|
-
@click=${()=>
|
|
457
|
+
?disabled=${!r.enabled}
|
|
458
|
+
@click=${()=>e.onRunNow(r.id)}
|
|
459
459
|
>
|
|
460
460
|
Run Now
|
|
461
461
|
</button>
|
|
@@ -465,7 +465,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
465
465
|
</div>
|
|
466
466
|
`}
|
|
467
467
|
</section>
|
|
468
|
-
`}function
|
|
468
|
+
`}function Qt(e){let i=e.agentFilesList?.agentId===e.agentId?e.agentFilesList:null,a=i?.files??[],o=e.agentFileActive??null,s=o?a.find(e=>e.name===o)??null:null,c=o?e.agentFileContents[o]??``:``,l=o?e.agentFileDrafts[o]??c:``,u=o?l!==c:!1;return t`
|
|
469
469
|
<section class="card">
|
|
470
470
|
<div class="row" style="justify-content: space-between;">
|
|
471
471
|
<div>
|
|
@@ -474,30 +474,30 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
474
474
|
</div>
|
|
475
475
|
<button
|
|
476
476
|
class="btn btn--sm"
|
|
477
|
-
?disabled=${
|
|
478
|
-
@click=${()=>
|
|
477
|
+
?disabled=${e.agentFilesLoading}
|
|
478
|
+
@click=${()=>e.onLoadFiles(e.agentId)}
|
|
479
479
|
>
|
|
480
|
-
${
|
|
480
|
+
${e.agentFilesLoading?r(`common.loading`):r(`common.refresh`)}
|
|
481
481
|
</button>
|
|
482
482
|
</div>
|
|
483
|
-
${i?
|
|
483
|
+
${i?t`<div class="muted mono" style="margin-top: 8px;">
|
|
484
484
|
Workspace: <span>${i.workspace}</span>
|
|
485
|
-
</div>`:
|
|
486
|
-
${
|
|
487
|
-
${
|
|
488
|
-
</div>`:
|
|
489
|
-
${i?a.length===0?
|
|
485
|
+
</div>`:n}
|
|
486
|
+
${e.agentFilesError?t`<div class="callout danger" style="margin-top: 12px;">
|
|
487
|
+
${e.agentFilesError}
|
|
488
|
+
</div>`:n}
|
|
489
|
+
${i?a.length===0?t` <div class="muted" style="margin-top: 16px">No files found.</div> `:t`
|
|
490
490
|
<div class="agent-tabs" style="margin-top: 14px;">
|
|
491
|
-
${a.map(
|
|
491
|
+
${a.map(r=>{let i=o===r.name,a=r.name.replace(/\.md$/i,``);return t`
|
|
492
492
|
<button
|
|
493
|
-
class="agent-tab ${i?`active`:``} ${
|
|
494
|
-
@click=${()=>
|
|
493
|
+
class="agent-tab ${i?`active`:``} ${r.missing?`agent-tab--missing`:``}"
|
|
494
|
+
@click=${()=>e.onSelectFile(r.name)}
|
|
495
495
|
>
|
|
496
|
-
${a}${
|
|
496
|
+
${a}${r.missing?t` <span class="agent-tab-badge">missing</span> `:n}
|
|
497
497
|
</button>
|
|
498
498
|
`})}
|
|
499
499
|
</div>
|
|
500
|
-
${s?
|
|
500
|
+
${s?t`
|
|
501
501
|
<div class="agent-file-header" style="margin-top: 14px;">
|
|
502
502
|
<div>
|
|
503
503
|
<div class="agent-file-sub mono">${s.path}</div>
|
|
@@ -508,35 +508,35 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
508
508
|
title="Preview rendered markdown"
|
|
509
509
|
@click=${e=>{let t=e.currentTarget.closest(`.card`)?.querySelector(`dialog`);t&&t.showModal()}}
|
|
510
510
|
>
|
|
511
|
-
${
|
|
511
|
+
${b.eye} Preview
|
|
512
512
|
</button>
|
|
513
513
|
<button
|
|
514
514
|
class="btn btn--sm"
|
|
515
515
|
?disabled=${!u}
|
|
516
|
-
@click=${()=>
|
|
516
|
+
@click=${()=>e.onFileReset(s.name)}
|
|
517
517
|
>
|
|
518
518
|
Reset
|
|
519
519
|
</button>
|
|
520
520
|
<button
|
|
521
521
|
class="btn btn--sm primary"
|
|
522
|
-
?disabled=${
|
|
523
|
-
@click=${()=>
|
|
522
|
+
?disabled=${e.agentFileSaving||!u}
|
|
523
|
+
@click=${()=>e.onFileSave(s.name)}
|
|
524
524
|
>
|
|
525
|
-
${
|
|
525
|
+
${e.agentFileSaving?`Saving…`:`Save`}
|
|
526
526
|
</button>
|
|
527
527
|
</div>
|
|
528
528
|
</div>
|
|
529
|
-
${s.missing?
|
|
529
|
+
${s.missing?t`
|
|
530
530
|
<div class="callout info" style="margin-top: 10px">
|
|
531
531
|
This file is missing. Saving will create it in the agent workspace.
|
|
532
532
|
</div>
|
|
533
|
-
`:
|
|
533
|
+
`:n}
|
|
534
534
|
<label class="field agent-file-field" style="margin-top: 12px;">
|
|
535
535
|
<span>Content</span>
|
|
536
536
|
<textarea
|
|
537
537
|
class="agent-file-textarea"
|
|
538
538
|
.value=${l}
|
|
539
|
-
@input=${e
|
|
539
|
+
@input=${t=>e.onFileDraftChange(s.name,t.target.value)}
|
|
540
540
|
></textarea>
|
|
541
541
|
</label>
|
|
542
542
|
<dialog
|
|
@@ -553,99 +553,99 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
553
553
|
title="Toggle fullscreen"
|
|
554
554
|
@click=${e=>{let t=e.currentTarget,n=t.closest(`.md-preview-dialog__panel`);if(!n)return;let r=n.classList.toggle(`fullscreen`);t.classList.toggle(`is-fullscreen`,r)}}
|
|
555
555
|
>
|
|
556
|
-
<span class="when-normal">${
|
|
557
|
-
><span class="when-fullscreen">${
|
|
556
|
+
<span class="when-normal">${b.maximize} Expand</span
|
|
557
|
+
><span class="when-fullscreen">${b.minimize} Collapse</span>
|
|
558
558
|
</button>
|
|
559
559
|
<button
|
|
560
560
|
class="btn btn--sm"
|
|
561
561
|
title="Edit file"
|
|
562
562
|
@click=${e=>{e.currentTarget.closest(`dialog`)?.close(),document.querySelector(`.agent-file-textarea`)?.focus()}}
|
|
563
563
|
>
|
|
564
|
-
${
|
|
564
|
+
${b.edit} Editor
|
|
565
565
|
</button>
|
|
566
566
|
<button
|
|
567
567
|
class="btn btn--sm"
|
|
568
568
|
@click=${e=>{e.currentTarget.closest(`dialog`)?.close()}}
|
|
569
569
|
>
|
|
570
|
-
${
|
|
570
|
+
${b.x} Close
|
|
571
571
|
</button>
|
|
572
572
|
</div>
|
|
573
573
|
</div>
|
|
574
574
|
<div class="md-preview-dialog__body">
|
|
575
|
-
${v(
|
|
575
|
+
${v(Ee(Z.parse(l,{gfm:!0,breaks:!0}),{sanitize:e=>d.sanitize(e)}))}
|
|
576
576
|
</div>
|
|
577
577
|
</div>
|
|
578
578
|
</dialog>
|
|
579
|
-
`:
|
|
580
|
-
`:
|
|
579
|
+
`:t` <div class="muted" style="margin-top: 16px">Select a file to edit.</div> `}
|
|
580
|
+
`:t`
|
|
581
581
|
<div class="callout info" style="margin-top: 12px">
|
|
582
582
|
Load the agent workspace files to edit core instructions.
|
|
583
583
|
</div>
|
|
584
584
|
`}
|
|
585
585
|
</section>
|
|
586
|
-
`}function
|
|
586
|
+
`}var Q=[{id:`workspace`,label:`Workspace Skills`,sources:[`genesis-workspace`]},{id:`built-in`,label:`Built-in Skills`,sources:[`genesis-bundled`]},{id:`installed`,label:`Installed Skills`,sources:[`genesis-managed`]},{id:`extra`,label:`Extra Skills`,sources:[`genesis-extra`]}];function $t(e){let t=new Map;for(let e of Q)t.set(e.id,{id:e.id,label:e.label,skills:[]});let n=Q.find(e=>e.id===`built-in`),r={id:`other`,label:`Other Skills`,skills:[]};for(let i of e){let e=i.bundled?n:Q.find(e=>e.sources.includes(i.source));e?t.get(e.id)?.skills.push(i):r.skills.push(i)}let i=Q.map(e=>t.get(e.id)).filter(e=>!!(e&&e.skills.length>0));return r.skills.length>0&&i.push(r),i}function en(e){return e.length===0?n:t`
|
|
587
587
|
<div class="agent-tool-badges">
|
|
588
|
-
${
|
|
588
|
+
${e.map(e=>t`<span class="agent-pill">${e}</span>`)}
|
|
589
589
|
</div>
|
|
590
|
-
`}function
|
|
590
|
+
`}function tn(e,t){let n=t.source??e.source,r=t.pluginId??e.pluginId,i=[];return n===`plugin`&&r?i.push(`Plugin: ${r}`):n===`core`&&i.push(`Built-In`),t.optional&&i.push(`Optional`),i}function nn(e){let t=tn(e.section,e.tool);return e.activeEntry&&t.unshift(`Live Now`),t}function rn(e){return e.denied?`Disabled by agent override.`:e.allowed&&e.baseAllowed?`Enabled by the current profile.`:e.allowed?`Enabled by agent override.`:`Not included in the current profile.`}function an(e,t){let n=t.source??e.source,r=t.pluginId??e.pluginId;return n===`plugin`&&r?`Plugin: ${r}`:`Built-In`}function on(e){return e.denied?`Override Off`:e.allowed&&e.baseAllowed?`Enabled`:e.allowed?`Override On`:`Profile Off`}function sn(e){return e.activeEntry?`Live Now`:e.runtimeSessionMatchesSelectedAgent?`Not Live`:`Other Agent`}function cn(e){return`agent-tool-${l(e).replace(/[^a-z0-9_-]+/g,`-`)}`}function ln(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function un(e){return(e??[]).flatMap(e=>e.tools)}var dn=12;function fn(e){let t=e.currentTarget;if(!(!(t instanceof HTMLDetailsElement)||t.open))for(let e of t.querySelectorAll(`.agent-tool-card[open]`))e.open=!1}function pn(e,t){let n=document.getElementById(t);if(!(n instanceof HTMLDetailsElement))return;e.preventDefault();let r=n.closest(`.agent-tools-group`);r&&(r.open=!0),n.open=!0;let i=new URL(window.location.href);i.hash=t,window.history.replaceState(null,``,i),requestAnimationFrame(()=>{let e=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;n.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`}),n.querySelector(`summary`)?.focus()})}function mn(e){return e.source===`plugin`?e.pluginId?r(`agentTools.connectedSource`,{id:e.pluginId}):r(`agentTools.connected`):e.source===`channel`?e.channelId?r(`agentTools.channelSource`,{id:e.channelId}):r(`agentTools.channel`):r(`agentTools.builtIn`)}function hn(e){let i=ee(e.configForm,e.agentId),s=i.entry?.tools??{},u=i.globalTools??{},d=s.profile??u.profile??`full`,f=a(e.toolsCatalogResult),p=te(e.toolsCatalogResult),m=s.profile?`agent override`:u.profile?`global default`:`default`,h=Array.isArray(s.allow)&&s.allow.length>0,g=Array.isArray(u.allow)&&u.allow.length>0,v=!!e.configForm&&!e.configLoading&&!e.configSaving&&!h&&!(e.toolsCatalogLoading&&!e.toolsCatalogResult&&!e.toolsCatalogError),b=h?[]:Array.isArray(s.alsoAllow)?s.alsoAllow:[],x=h?[]:Array.isArray(s.deny)?s.deny:[],ne=h?{allow:s.allow??[],deny:s.deny??[]}:c(d)??void 0,S=p.flatMap(e=>e.tools.map(e=>e.id)),C=e=>{let t=y(e,ne),n=_(e,b),r=_(e,x);return{allowed:(t||n)&&!r,baseAllowed:t,denied:r}},w=S.filter(e=>C(e).allowed).length,T=e.runtimeSessionMatchesSelectedAgent&&!e.toolsEffectiveError?un(e.toolsEffectiveResult?.groups):[],E=Array.from(new Map(T.map(e=>[l(e.id),e])).values()),D=E.slice(0,dn),O=Math.max(0,E.length-D.length),re=E.length,ie=new Map(T.map(e=>[l(e.id),e])),k=new Set(ie.keys()),A=e=>o(e,(e,t)=>{let n=l(e.id),r=l(t.id),i=+!!k.has(n),a=+!!k.has(r);if(i!==a)return a-i;let o=+!!C(e.id).allowed,s=+!!C(t.id).allowed;return o===s?e.label.localeCompare(t.label):s-o}),j=(t,n)=>{let r=new Set(b.map(e=>l(e)).filter(e=>e.length>0)),i=new Set(x.map(e=>l(e)).filter(e=>e.length>0)),a=C(t).baseAllowed,o=l(t);n?(i.delete(o),a||r.add(o)):(r.delete(o),i.add(o)),e.onOverridesChange(e.agentId,[...r],[...i])},ae=t=>{let n=new Set(b.map(e=>l(e)).filter(e=>e.length>0)),r=new Set(x.map(e=>l(e)).filter(e=>e.length>0));for(let e of S){let i=C(e).baseAllowed,a=l(e);t?(r.delete(a),i||n.add(a)):(n.delete(a),r.add(a))}e.onOverridesChange(e.agentId,[...n],[...r])};return t`
|
|
591
591
|
<section class="card">
|
|
592
592
|
<div class="agent-tools-header">
|
|
593
593
|
<div class="agent-tools-header__intro">
|
|
594
594
|
<div class="card-title">Tool Access</div>
|
|
595
595
|
<div class="card-sub">
|
|
596
596
|
Profile + per-tool overrides for this agent.
|
|
597
|
-
<span class="mono">${
|
|
597
|
+
<span class="mono">${w}/${S.length}</span> enabled.
|
|
598
598
|
</div>
|
|
599
599
|
</div>
|
|
600
600
|
<div class="agent-tools-header__actions">
|
|
601
|
-
<button class="btn btn--sm" ?disabled=${!
|
|
601
|
+
<button class="btn btn--sm" ?disabled=${!v} @click=${()=>ae(!0)}>
|
|
602
602
|
Enable All
|
|
603
603
|
</button>
|
|
604
|
-
<button class="btn btn--sm" ?disabled=${!
|
|
604
|
+
<button class="btn btn--sm" ?disabled=${!v} @click=${()=>ae(!1)}>
|
|
605
605
|
Disable All
|
|
606
606
|
</button>
|
|
607
607
|
<button
|
|
608
608
|
class="btn btn--sm"
|
|
609
|
-
?disabled=${
|
|
610
|
-
@click=${
|
|
609
|
+
?disabled=${e.configLoading}
|
|
610
|
+
@click=${e.onConfigReload}
|
|
611
611
|
>
|
|
612
|
-
${
|
|
612
|
+
${r(`common.reloadConfig`)}
|
|
613
613
|
</button>
|
|
614
614
|
<button
|
|
615
615
|
class="btn btn--sm primary"
|
|
616
|
-
?disabled=${
|
|
617
|
-
@click=${
|
|
616
|
+
?disabled=${e.configSaving||!e.configDirty}
|
|
617
|
+
@click=${e.onConfigSave}
|
|
618
618
|
>
|
|
619
|
-
${
|
|
619
|
+
${e.configSaving?`Saving…`:`Save`}
|
|
620
620
|
</button>
|
|
621
621
|
</div>
|
|
622
622
|
</div>
|
|
623
623
|
|
|
624
|
-
${
|
|
624
|
+
${e.configForm?n:t`
|
|
625
625
|
<div class="callout info" style="margin-top: 12px">
|
|
626
626
|
Load the gateway config to adjust tool profiles.
|
|
627
627
|
</div>
|
|
628
628
|
`}
|
|
629
|
-
${
|
|
629
|
+
${h?t`
|
|
630
630
|
<div class="callout info" style="margin-top: 12px">
|
|
631
631
|
This agent is using an explicit allowlist in config. Tool overrides are managed in the
|
|
632
632
|
Config tab.
|
|
633
633
|
</div>
|
|
634
|
-
`:
|
|
635
|
-
${
|
|
634
|
+
`:n}
|
|
635
|
+
${g?t`
|
|
636
636
|
<div class="callout info" style="margin-top: 12px">
|
|
637
637
|
Global tools.allow is set. Agent overrides cannot enable tools that are globally
|
|
638
638
|
blocked.
|
|
639
639
|
</div>
|
|
640
|
-
`:
|
|
641
|
-
${
|
|
640
|
+
`:n}
|
|
641
|
+
${e.toolsCatalogLoading&&!e.toolsCatalogResult&&!e.toolsCatalogError?t`
|
|
642
642
|
<div class="callout info" style="margin-top: 12px">Loading runtime tool catalog…</div>
|
|
643
|
-
`:
|
|
644
|
-
${
|
|
643
|
+
`:n}
|
|
644
|
+
${e.toolsCatalogError?t`
|
|
645
645
|
<div class="callout info" style="margin-top: 12px">
|
|
646
646
|
Could not load runtime tool catalog. Showing built-in fallback list instead.
|
|
647
647
|
</div>
|
|
648
|
-
`:
|
|
648
|
+
`:n}
|
|
649
649
|
|
|
650
650
|
<div class="agent-tools-overview">
|
|
651
651
|
<div class="agent-tools-overview__primary">
|
|
@@ -653,44 +653,44 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
653
653
|
<div class="label">Available Right Now</div>
|
|
654
654
|
<div class="card-sub">
|
|
655
655
|
What this agent can use in the current chat session.
|
|
656
|
-
<span class="mono">${
|
|
656
|
+
<span class="mono">${e.runtimeSessionKey||`no session`}</span>
|
|
657
657
|
</div>
|
|
658
|
-
${
|
|
658
|
+
${e.runtimeSessionMatchesSelectedAgent?e.toolsEffectiveLoading&&!e.toolsEffectiveResult&&!e.toolsEffectiveError?t`
|
|
659
659
|
<div class="callout info" style="margin-top: 12px">
|
|
660
660
|
Loading available tools…
|
|
661
661
|
</div>
|
|
662
|
-
`:
|
|
662
|
+
`:e.toolsEffectiveError?t`
|
|
663
663
|
<div class="callout info" style="margin-top: 12px">
|
|
664
664
|
Could not load available tools for this session.
|
|
665
665
|
</div>
|
|
666
|
-
`:(
|
|
666
|
+
`:(e.toolsEffectiveResult?.groups?.length??0)===0?t`
|
|
667
667
|
<div class="callout info" style="margin-top: 12px">
|
|
668
668
|
No tools are available for this session right now.
|
|
669
669
|
</div>
|
|
670
|
-
`:
|
|
670
|
+
`:t`
|
|
671
671
|
<div class="agent-tools-runtime">
|
|
672
|
-
${D.map(
|
|
672
|
+
${D.map(e=>{let n=cn(e.id);return t`
|
|
673
673
|
<a
|
|
674
674
|
class="agent-tools-runtime-chip"
|
|
675
675
|
href="#${n}"
|
|
676
|
-
@click=${e=>
|
|
676
|
+
@click=${e=>pn(e,n)}
|
|
677
677
|
>
|
|
678
|
-
<span class="mono" translate="no">${
|
|
678
|
+
<span class="mono" translate="no">${e.label}</span>
|
|
679
679
|
<span class="agent-tools-runtime-chip__meta"
|
|
680
|
-
>${
|
|
680
|
+
>${mn(e)}</span
|
|
681
681
|
>
|
|
682
682
|
</a>
|
|
683
683
|
`})}
|
|
684
|
-
${O>0?
|
|
684
|
+
${O>0?t`
|
|
685
685
|
<span
|
|
686
686
|
class="agent-tools-runtime-chip agent-tools-runtime-chip--more"
|
|
687
687
|
title=${`${O} more live tools are available in the groups below.`}
|
|
688
688
|
>
|
|
689
689
|
+${O} more live tools
|
|
690
690
|
</span>
|
|
691
|
-
`:
|
|
691
|
+
`:n}
|
|
692
692
|
</div>
|
|
693
|
-
`:
|
|
693
|
+
`:t`
|
|
694
694
|
<div class="callout info" style="margin-top: 12px">
|
|
695
695
|
Switch chat to this agent to view its live runtime tools.
|
|
696
696
|
</div>
|
|
@@ -700,19 +700,19 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
700
700
|
<div class="agent-tools-pane">
|
|
701
701
|
<div class="label">Quick Presets</div>
|
|
702
702
|
<div class="agent-tools-buttons">
|
|
703
|
-
${
|
|
703
|
+
${f.map(n=>t`
|
|
704
704
|
<button
|
|
705
|
-
class="btn btn--sm ${
|
|
706
|
-
?disabled=${!
|
|
707
|
-
@click=${()=>
|
|
705
|
+
class="btn btn--sm ${d===n.id?`active`:``}"
|
|
706
|
+
?disabled=${!v}
|
|
707
|
+
@click=${()=>e.onProfileChange(e.agentId,n.id,!0)}
|
|
708
708
|
>
|
|
709
709
|
${n.label}
|
|
710
710
|
</button>
|
|
711
711
|
`)}
|
|
712
712
|
<button
|
|
713
713
|
class="btn btn--sm"
|
|
714
|
-
?disabled=${!
|
|
715
|
-
@click=${()=>
|
|
714
|
+
?disabled=${!v}
|
|
715
|
+
@click=${()=>e.onProfileChange(e.agentId,null,!1)}
|
|
716
716
|
>
|
|
717
717
|
Inherit
|
|
718
718
|
</button>
|
|
@@ -723,15 +723,15 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
723
723
|
<div class="agent-tools-facts">
|
|
724
724
|
<div class="agent-tools-fact">
|
|
725
725
|
<div class="label">Profile</div>
|
|
726
|
-
<div class="mono">${
|
|
726
|
+
<div class="mono">${d}</div>
|
|
727
727
|
</div>
|
|
728
728
|
<div class="agent-tools-fact">
|
|
729
729
|
<div class="label">Source</div>
|
|
730
|
-
<div>${
|
|
730
|
+
<div>${m}</div>
|
|
731
731
|
</div>
|
|
732
732
|
<div class="agent-tools-fact">
|
|
733
733
|
<div class="label">Enabled</div>
|
|
734
|
-
<div class="mono">${
|
|
734
|
+
<div class="mono">${w}/${S.length}</div>
|
|
735
735
|
</div>
|
|
736
736
|
<div class="agent-tools-fact">
|
|
737
737
|
<div class="label">Live</div>
|
|
@@ -740,36 +740,36 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
740
740
|
<div class="agent-tools-fact">
|
|
741
741
|
<div class="label">Status</div>
|
|
742
742
|
<div class="mono">
|
|
743
|
-
${
|
|
743
|
+
${e.configSaving?`saving…`:e.configDirty?`unsaved`:`saved`}
|
|
744
744
|
</div>
|
|
745
745
|
</div>
|
|
746
746
|
</div>
|
|
747
747
|
</div>
|
|
748
748
|
|
|
749
749
|
<div class="agent-tools-grid">
|
|
750
|
-
${
|
|
751
|
-
<details class="agent-tools-group" @toggle=${
|
|
750
|
+
${p.map(r=>{let i=A(r.tools),a=r.tools.filter(e=>C(e.id).allowed).length,o=r.tools.filter(e=>k.has(l(e.id))).length,s=i.slice(0,4),c=Math.max(0,i.length-s.length);return t`
|
|
751
|
+
<details class="agent-tools-group" @toggle=${fn}>
|
|
752
752
|
<summary class="agent-tools-group__summary">
|
|
753
753
|
<span class="agent-tools-group__summary-main">
|
|
754
754
|
<span class="agent-tools-group__title">
|
|
755
|
-
${
|
|
756
|
-
${
|
|
755
|
+
${r.label}
|
|
756
|
+
${r.source===`plugin`&&r.pluginId?t`<span class="agent-pill">Plugin: ${r.pluginId}</span>`:n}
|
|
757
757
|
</span>
|
|
758
758
|
<span class="agent-tools-group__preview" aria-label="Tool preview">
|
|
759
|
-
${s.map(t
|
|
760
|
-
>${
|
|
759
|
+
${s.map(e=>t`<span class="mono" translate="no" title=${e.label}
|
|
760
|
+
>${e.label}</span
|
|
761
761
|
>`)}
|
|
762
|
-
${c>0?
|
|
762
|
+
${c>0?t`<span>+${c} more</span>`:n}
|
|
763
763
|
</span>
|
|
764
764
|
</span>
|
|
765
765
|
<span class="agent-tools-group__counts">
|
|
766
|
-
<span>${
|
|
767
|
-
<span>${
|
|
768
|
-
${o>0?
|
|
766
|
+
<span>${ln(r.tools.length,`Tool`)}</span>
|
|
767
|
+
<span>${ln(a,`Enabled Tool`)}</span>
|
|
768
|
+
${o>0?t`<span>${ln(o,`Live Tool`)}</span>`:n}
|
|
769
769
|
</span>
|
|
770
770
|
</summary>
|
|
771
771
|
<div class="agent-tools-list agent-tools-list--stacked">
|
|
772
|
-
${i.map(i=>{let a=
|
|
772
|
+
${i.map(i=>{let a=cn(i.id),o=C(i.id),s=ie.get(l(i.id))??null,c=i.defaultProfiles??[],u=nn({section:r,tool:i,activeEntry:s}),d=on(o),f=sn({activeEntry:s,runtimeSessionMatchesSelectedAgent:e.runtimeSessionMatchesSelectedAgent});return t`
|
|
773
773
|
<details class="agent-tool-card" id=${a}>
|
|
774
774
|
<summary class="agent-tool-summary">
|
|
775
775
|
<div class="agent-tool-summary__main">
|
|
@@ -789,7 +789,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
789
789
|
</div>
|
|
790
790
|
</dl>
|
|
791
791
|
<div class="agent-tool-summary__badges">
|
|
792
|
-
${
|
|
792
|
+
${en(u)}
|
|
793
793
|
</div>
|
|
794
794
|
<label
|
|
795
795
|
class="cfg-toggle agent-tool-toggle"
|
|
@@ -799,9 +799,9 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
799
799
|
<input
|
|
800
800
|
type="checkbox"
|
|
801
801
|
.checked=${o.allowed}
|
|
802
|
-
?disabled=${!
|
|
802
|
+
?disabled=${!v}
|
|
803
803
|
aria-label=${`${o.allowed?`Disable`:`Enable`} ${i.label}`}
|
|
804
|
-
@change=${e=>
|
|
804
|
+
@change=${e=>j(i.id,e.target.checked)}
|
|
805
805
|
/>
|
|
806
806
|
<span class="cfg-toggle__track"></span>
|
|
807
807
|
</label>
|
|
@@ -810,24 +810,24 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
810
810
|
<div class="agent-tool-details-strip">
|
|
811
811
|
<div class="agent-tool-detail agent-tool-detail--inline">
|
|
812
812
|
<div class="label">Access</div>
|
|
813
|
-
<div>${
|
|
813
|
+
<div>${rn(o)}</div>
|
|
814
814
|
</div>
|
|
815
815
|
<div class="agent-tool-detail agent-tool-detail--inline">
|
|
816
816
|
<div class="label">Source</div>
|
|
817
|
-
<div>${
|
|
817
|
+
<div>${an(r,i)}</div>
|
|
818
818
|
</div>
|
|
819
|
-
${c.length>0?
|
|
819
|
+
${c.length>0?t`
|
|
820
820
|
<div class="agent-tool-detail agent-tool-detail--inline">
|
|
821
821
|
<div class="label">Default Presets</div>
|
|
822
822
|
<div class="agent-tool-badges">
|
|
823
|
-
${c.map(t
|
|
823
|
+
${c.map(e=>t`<span class="agent-pill">${e}</span>`)}
|
|
824
824
|
</div>
|
|
825
825
|
</div>
|
|
826
|
-
`:
|
|
826
|
+
`:n}
|
|
827
827
|
<div class="agent-tool-detail agent-tool-detail--inline">
|
|
828
828
|
<div class="label">Current Session</div>
|
|
829
829
|
<div>
|
|
830
|
-
${s?`Available now via ${
|
|
830
|
+
${s?`Available now via ${mn(s)}.`:e.runtimeSessionMatchesSelectedAgent?`Not available in this chat session right now.`:`Switch chat to this agent to inspect live availability.`}
|
|
831
831
|
</div>
|
|
832
832
|
</div>
|
|
833
833
|
<a class="agent-tool-jump" href="#${a}"> Link to This Tool </a>
|
|
@@ -840,14 +840,14 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
840
840
|
`})}
|
|
841
841
|
</div>
|
|
842
842
|
</section>
|
|
843
|
-
`}function
|
|
843
|
+
`}function gn(e){let a=!!e.configForm&&!e.configLoading&&!e.configSaving,o=ee(e.configForm,e.agentId),s=Array.isArray(o.entry?.skills)?o.entry?.skills:void 0,c=new Set((s??[]).map(e=>e.trim()).filter(Boolean)),l=s!==void 0,u=!!(e.report&&e.activeAgentId===e.agentId),d=u?e.report?.skills??[]:[],f=i(e.filter),p=f?d.filter(e=>i([e.name,e.description,e.source].join(` `)).includes(f)):d,m=$t(p),h=l?d.filter(e=>c.has(e.name)).length:d.length,g=d.length;return t`
|
|
844
844
|
<section class="card">
|
|
845
845
|
<div class="row" style="justify-content: space-between; flex-wrap: wrap;">
|
|
846
846
|
<div style="min-width: 0;">
|
|
847
847
|
<div class="card-title">Skills</div>
|
|
848
848
|
<div class="card-sub">
|
|
849
849
|
Per-agent skill allowlist and workspace skills.
|
|
850
|
-
${
|
|
850
|
+
${g>0?t`<span class="mono">${h}/${g}</span>`:n}
|
|
851
851
|
</div>
|
|
852
852
|
</div>
|
|
853
853
|
<div class="row" style="gap: 8px; flex-wrap: wrap;">
|
|
@@ -858,21 +858,21 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
858
858
|
<button
|
|
859
859
|
class="btn btn--sm"
|
|
860
860
|
?disabled=${!a}
|
|
861
|
-
@click=${()=>
|
|
861
|
+
@click=${()=>e.onClear(e.agentId)}
|
|
862
862
|
>
|
|
863
863
|
Enable All
|
|
864
864
|
</button>
|
|
865
865
|
<button
|
|
866
866
|
class="btn btn--sm"
|
|
867
867
|
?disabled=${!a}
|
|
868
|
-
@click=${()=>
|
|
868
|
+
@click=${()=>e.onDisableAll(e.agentId)}
|
|
869
869
|
>
|
|
870
870
|
Disable All
|
|
871
871
|
</button>
|
|
872
872
|
<button
|
|
873
873
|
class="btn btn--sm"
|
|
874
874
|
?disabled=${!a||!l}
|
|
875
|
-
@click=${()=>
|
|
875
|
+
@click=${()=>e.onClear(e.agentId)}
|
|
876
876
|
title="Remove per-agent allowlist and use all skills"
|
|
877
877
|
>
|
|
878
878
|
Reset
|
|
@@ -880,51 +880,51 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
880
880
|
</div>
|
|
881
881
|
<button
|
|
882
882
|
class="btn btn--sm"
|
|
883
|
-
?disabled=${
|
|
884
|
-
@click=${
|
|
883
|
+
?disabled=${e.configLoading}
|
|
884
|
+
@click=${e.onConfigReload}
|
|
885
885
|
>
|
|
886
|
-
${
|
|
886
|
+
${r(`common.reloadConfig`)}
|
|
887
887
|
</button>
|
|
888
|
-
<button class="btn btn--sm" ?disabled=${
|
|
889
|
-
${
|
|
888
|
+
<button class="btn btn--sm" ?disabled=${e.loading} @click=${e.onRefresh}>
|
|
889
|
+
${e.loading?r(`common.loading`):r(`common.refresh`)}
|
|
890
890
|
</button>
|
|
891
891
|
<button
|
|
892
892
|
class="btn btn--sm primary"
|
|
893
|
-
?disabled=${
|
|
894
|
-
@click=${
|
|
893
|
+
?disabled=${e.configSaving||!e.configDirty}
|
|
894
|
+
@click=${e.onConfigSave}
|
|
895
895
|
>
|
|
896
|
-
${
|
|
896
|
+
${e.configSaving?`Saving…`:`Save`}
|
|
897
897
|
</button>
|
|
898
898
|
</div>
|
|
899
899
|
</div>
|
|
900
900
|
|
|
901
|
-
${
|
|
901
|
+
${e.configForm?n:t`
|
|
902
902
|
<div class="callout info" style="margin-top: 12px">
|
|
903
903
|
Load the gateway config to set per-agent skills.
|
|
904
904
|
</div>
|
|
905
905
|
`}
|
|
906
|
-
${l?
|
|
906
|
+
${l?t`
|
|
907
907
|
<div class="callout info" style="margin-top: 12px">
|
|
908
908
|
This agent uses a custom skill allowlist.
|
|
909
909
|
</div>
|
|
910
|
-
`:
|
|
910
|
+
`:t`
|
|
911
911
|
<div class="callout info" style="margin-top: 12px">
|
|
912
912
|
All skills are enabled. Disabling any skill will create a per-agent allowlist.
|
|
913
913
|
</div>
|
|
914
914
|
`}
|
|
915
|
-
${!u&&!
|
|
915
|
+
${!u&&!e.loading?t`
|
|
916
916
|
<div class="callout info" style="margin-top: 12px">
|
|
917
917
|
Load skills for this agent to view workspace-specific entries.
|
|
918
918
|
</div>
|
|
919
|
-
`:
|
|
920
|
-
${
|
|
919
|
+
`:n}
|
|
920
|
+
${e.error?t`<div class="callout danger" style="margin-top: 12px;">${e.error}</div>`:n}
|
|
921
921
|
|
|
922
922
|
<div class="filters" style="margin-top: 14px;">
|
|
923
923
|
<label class="field" style="flex: 1;">
|
|
924
924
|
<span>Filter</span>
|
|
925
925
|
<input
|
|
926
|
-
.value=${
|
|
927
|
-
@input=${e
|
|
926
|
+
.value=${e.filter}
|
|
927
|
+
@input=${t=>e.onFilterChange(t.target.value)}
|
|
928
928
|
placeholder="Search skills"
|
|
929
929
|
autocomplete="off"
|
|
930
930
|
name="agent-skills-filter"
|
|
@@ -933,120 +933,189 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
933
933
|
<div class="muted">${p.length} shown</div>
|
|
934
934
|
</div>
|
|
935
935
|
|
|
936
|
-
${p.length===0?
|
|
936
|
+
${p.length===0?t` <div class="muted" style="margin-top: 16px">No skills found.</div> `:t`
|
|
937
937
|
<div class="agent-skills-groups" style="margin-top: 16px;">
|
|
938
|
-
${
|
|
938
|
+
${m.map(t=>_n(t,{agentId:e.agentId,allowSet:c,usingAllowlist:l,editable:a,onToggle:e.onToggle}))}
|
|
939
939
|
</div>
|
|
940
940
|
`}
|
|
941
941
|
</section>
|
|
942
|
-
`}function
|
|
943
|
-
<details class="agent-skills-group" ?open=${!(
|
|
942
|
+
`}function _n(e,n){return t`
|
|
943
|
+
<details class="agent-skills-group" ?open=${!(e.id===`workspace`||e.id===`built-in`)}>
|
|
944
944
|
<summary class="agent-skills-header">
|
|
945
|
-
<span>${
|
|
946
|
-
<span class="muted">${
|
|
945
|
+
<span>${e.label}</span>
|
|
946
|
+
<span class="muted">${e.skills.length}</span>
|
|
947
947
|
</summary>
|
|
948
948
|
<div class="list skills-grid">
|
|
949
|
-
${
|
|
949
|
+
${e.skills.map(e=>vn(e,{agentId:n.agentId,allowSet:n.allowSet,usingAllowlist:n.usingAllowlist,editable:n.editable,onToggle:n.onToggle}))}
|
|
950
950
|
</div>
|
|
951
951
|
</details>
|
|
952
|
-
`}function
|
|
952
|
+
`}function vn(e,r){let i=r.usingAllowlist?r.allowSet.has(e.name):!0,a=O(e),o=E(e);return t`
|
|
953
953
|
<div class="list-item agent-skill-row">
|
|
954
954
|
<div class="list-main">
|
|
955
|
-
<div class="list-title">${
|
|
956
|
-
<div class="list-sub">${
|
|
957
|
-
${
|
|
958
|
-
${a.length>0?
|
|
959
|
-
${o.length>0?
|
|
955
|
+
<div class="list-title">${e.emoji?`${e.emoji} `:``}${e.name}</div>
|
|
956
|
+
<div class="list-sub">${e.description}</div>
|
|
957
|
+
${D({skill:e})}
|
|
958
|
+
${a.length>0?t`<div class="muted" style="margin-top: 6px;">Missing: ${a.join(`, `)}</div>`:n}
|
|
959
|
+
${o.length>0?t`<div class="muted" style="margin-top: 6px;">Reason: ${o.join(`, `)}</div>`:n}
|
|
960
960
|
</div>
|
|
961
961
|
<div class="list-meta">
|
|
962
962
|
<label class="cfg-toggle">
|
|
963
963
|
<input
|
|
964
964
|
type="checkbox"
|
|
965
965
|
.checked=${i}
|
|
966
|
-
?disabled=${!
|
|
967
|
-
@change=${
|
|
966
|
+
?disabled=${!r.editable}
|
|
967
|
+
@change=${t=>r.onToggle(r.agentId,e.name,t.target.checked)}
|
|
968
968
|
/>
|
|
969
969
|
<span class="cfg-toggle__track"></span>
|
|
970
970
|
</label>
|
|
971
971
|
</div>
|
|
972
972
|
</div>
|
|
973
|
-
`}
|
|
973
|
+
`}var yn=`grid-template-columns: 1.6fr 1.2fr 0.8fr 1.4fr;`;function $(e,n,r=!1){return t`
|
|
974
|
+
<div
|
|
975
|
+
style="display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; flex: 1; min-width: 0; ${r?``:`border-right: 1px solid var(--border);`}"
|
|
976
|
+
>
|
|
977
|
+
<div
|
|
978
|
+
style="font-family: var(--mono); font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--text); overflow: hidden; text-overflow: ellipsis;"
|
|
979
|
+
>
|
|
980
|
+
${e}
|
|
981
|
+
</div>
|
|
982
|
+
<div class="muted" style="font-size: 13px;">${n}</div>
|
|
983
|
+
</div>
|
|
984
|
+
`}function bn(e,r,i,a){let o=i!=null&&e.id===i,s=a===e.id,c=e.model?.primary??`—`,l=e.model?.fallbacks?.length??0,u=e.workspace??`—`;return t`
|
|
985
|
+
<div
|
|
986
|
+
class="table-row"
|
|
987
|
+
style="cursor: pointer; ${s?`background: var(--bg-elevated);`:``} ${yn}"
|
|
988
|
+
@click=${()=>r.onSelectAgent(e.id)}
|
|
989
|
+
>
|
|
990
|
+
<span style="color: var(--text); display: flex; align-items: center; gap: 8px;">
|
|
991
|
+
<span class="status-dot ${o?`status-dot--ok`:`status-dot--idle`}"></span>
|
|
992
|
+
${g(e)}
|
|
993
|
+
${o?t`<span class="muted" style="font-size: 12px;">· default</span>`:n}
|
|
994
|
+
</span>
|
|
995
|
+
<span class="muted" style="font-family: var(--mono);">${c}</span>
|
|
996
|
+
<span class="muted">${l>0?l:`—`}</span>
|
|
997
|
+
<span
|
|
998
|
+
class="muted"
|
|
999
|
+
style="font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"
|
|
1000
|
+
>${u}</span
|
|
1001
|
+
>
|
|
1002
|
+
</div>
|
|
1003
|
+
`}function xn(e){let i=e.agentsList?.agents??[],a=e.agentsList?.defaultId??null,o=e.selectedAgentId??null,s=o?i.find(e=>e.id===o)??null:null,c=o&&e.agentSkills.agentId===o?e.agentSkills.report?.skills?.length??null:null,l=e.channels.snapshot?Object.keys(e.channels.snapshot.channelAccounts??{}).length:null,u=o?e.cron.jobs.filter(e=>e.agentId===o).length:null,d={files:e.agentFiles.list?.files?.length??null,skills:c,channels:l,cron:u||null};return t`
|
|
974
1004
|
<div class="agents-layout">
|
|
975
|
-
<section
|
|
976
|
-
<div
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
>
|
|
984
|
-
${i.length===0?e` <option value="">No agents</option> `:i.map(t=>e`
|
|
985
|
-
<option value=${t.id} ?selected=${t.id===o}>
|
|
986
|
-
${h(t)}${ne(t.id,a)?` (${ne(t.id,a)})`:``}
|
|
987
|
-
</option>
|
|
988
|
-
`)}
|
|
989
|
-
</select>
|
|
1005
|
+
<section>
|
|
1006
|
+
<div
|
|
1007
|
+
class="row"
|
|
1008
|
+
style="justify-content: space-between; align-items: flex-start; gap: 16px;"
|
|
1009
|
+
>
|
|
1010
|
+
<div>
|
|
1011
|
+
<div class="view-title">${r(`tabs.agents`)}</div>
|
|
1012
|
+
<div class="view-sub">${i.length} ${i.length===1?`agent`:`agents`}</div>
|
|
990
1013
|
</div>
|
|
991
|
-
<div class="
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
type="button"
|
|
995
|
-
class="btn btn--sm btn--ghost"
|
|
996
|
-
@click=${()=>void navigator.clipboard.writeText(s.id)}
|
|
997
|
-
title="Copy agent ID to clipboard"
|
|
998
|
-
>
|
|
999
|
-
Copy ID
|
|
1000
|
-
</button>
|
|
1001
|
-
<button
|
|
1002
|
-
type="button"
|
|
1003
|
-
class="btn btn--sm btn--ghost"
|
|
1004
|
-
?disabled=${!!(a&&s.id===a)}
|
|
1005
|
-
@click=${()=>t.onSetDefault(s.id)}
|
|
1006
|
-
title=${a&&s.id===a?`Already the default agent`:`Set as the default agent`}
|
|
1007
|
-
>
|
|
1008
|
-
${a&&s.id===a?`Default`:`Set Default`}
|
|
1009
|
-
</button>
|
|
1010
|
-
`:r}
|
|
1011
|
-
<button
|
|
1012
|
-
class="btn btn--sm agents-refresh-btn"
|
|
1013
|
-
?disabled=${t.loading}
|
|
1014
|
-
@click=${t.onRefresh}
|
|
1015
|
-
>
|
|
1016
|
-
${t.loading?n(`common.loading`):n(`common.refresh`)}
|
|
1014
|
+
<div class="row" style="gap: 8px; flex: none;">
|
|
1015
|
+
<button class="btn" ?disabled=${e.loading} @click=${e.onRefresh}>
|
|
1016
|
+
${e.loading?r(`common.loading`):r(`common.refresh`)}
|
|
1017
1017
|
</button>
|
|
1018
1018
|
</div>
|
|
1019
1019
|
</div>
|
|
1020
|
-
${
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
${
|
|
1031
|
-
|
|
1032
|
-
<div class="
|
|
1033
|
-
<div class="
|
|
1034
|
-
|
|
1020
|
+
${e.error?t`<div class="callout danger" style="margin-top: 12px;">${e.error}</div>`:n}
|
|
1021
|
+
|
|
1022
|
+
<div class="card" style="display: flex; padding: 0; margin-top: 24px; overflow: hidden;">
|
|
1023
|
+
${$(String(i.length),`Agents`)}
|
|
1024
|
+
${$(a??r(`common.na`),`Default`)}
|
|
1025
|
+
${$(String(l??0),`Channels`)}
|
|
1026
|
+
${$(String(e.cron.jobs.length),`Cron jobs`,!0)}
|
|
1027
|
+
</div>
|
|
1028
|
+
|
|
1029
|
+
${i.length===0?t`<div class="muted" style="padding: 16px;">
|
|
1030
|
+
${e.loading?r(`common.loading`):r(`common.na`)}
|
|
1031
|
+
</div>`:t`
|
|
1032
|
+
<div class="table" style="margin-top: 24px;">
|
|
1033
|
+
<div class="table-head" style=${yn}>
|
|
1034
|
+
<span>AGENT</span>
|
|
1035
|
+
<span>MODEL</span>
|
|
1036
|
+
<span>FALLBACKS</span>
|
|
1037
|
+
<span>WORKSPACE</span>
|
|
1038
|
+
</div>
|
|
1039
|
+
${i.map(t=>bn(t,e,a,o))}
|
|
1035
1040
|
</div>
|
|
1036
1041
|
`}
|
|
1037
1042
|
</section>
|
|
1043
|
+
${s?t`
|
|
1044
|
+
<div
|
|
1045
|
+
class="exec-approval-overlay"
|
|
1046
|
+
role="dialog"
|
|
1047
|
+
aria-modal="true"
|
|
1048
|
+
@click=${t=>{t.target===t.currentTarget&&e.onCloseInspector?.()}}
|
|
1049
|
+
>
|
|
1050
|
+
<div
|
|
1051
|
+
class="exec-approval-card agents-inspector-modal"
|
|
1052
|
+
style="width: min(980px, 94vw); max-height: 88vh; overflow: auto; padding: 0;"
|
|
1053
|
+
>
|
|
1054
|
+
<div
|
|
1055
|
+
class="row"
|
|
1056
|
+
style="justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1;"
|
|
1057
|
+
>
|
|
1058
|
+
<div style="display: flex; align-items: center; gap: 8px; min-width: 0;">
|
|
1059
|
+
<span
|
|
1060
|
+
class="status-dot ${s.id===a?`status-dot--ok`:`status-dot--idle`}"
|
|
1061
|
+
></span>
|
|
1062
|
+
<span class="view-title" style="font-size: 18px;"
|
|
1063
|
+
>${g(s)}</span
|
|
1064
|
+
>
|
|
1065
|
+
${s.id===a?t`<span class="muted" style="font-size: 12px;">· default</span>`:n}
|
|
1066
|
+
</div>
|
|
1067
|
+
<div class="row" style="gap: 8px; flex: none;">
|
|
1068
|
+
<button
|
|
1069
|
+
type="button"
|
|
1070
|
+
class="btn"
|
|
1071
|
+
@click=${()=>void navigator.clipboard.writeText(s.id)}
|
|
1072
|
+
title="Copy agent ID to clipboard"
|
|
1073
|
+
>
|
|
1074
|
+
Copy ID
|
|
1075
|
+
</button>
|
|
1076
|
+
<button
|
|
1077
|
+
type="button"
|
|
1078
|
+
class="btn"
|
|
1079
|
+
?disabled=${!!(a&&s.id===a)}
|
|
1080
|
+
@click=${()=>e.onSetDefault(s.id)}
|
|
1081
|
+
>
|
|
1082
|
+
${a&&s.id===a?`Default`:`Set Default`}
|
|
1083
|
+
</button>
|
|
1084
|
+
<button
|
|
1085
|
+
type="button"
|
|
1086
|
+
class="btn"
|
|
1087
|
+
aria-label="Close"
|
|
1088
|
+
title="Close"
|
|
1089
|
+
@click=${()=>e.onCloseInspector?.()}
|
|
1090
|
+
>
|
|
1091
|
+
✕
|
|
1092
|
+
</button>
|
|
1093
|
+
</div>
|
|
1094
|
+
</div>
|
|
1095
|
+
<div style="padding: 20px;">
|
|
1096
|
+
${Sn(e.activePanel,t=>e.onSelectPanel(t),d)}
|
|
1097
|
+
${e.activePanel===`overview`?re({agent:s,basePath:e.basePath,defaultId:a,configForm:e.config.form,agentFilesList:e.agentFiles.list,agentIdentity:e.agentIdentityById[s.id]??null,agentIdentityError:e.agentIdentityError,agentIdentityLoading:e.agentIdentityLoading,configLoading:e.config.loading,configSaving:e.config.saving,configDirty:e.config.dirty,connected:e.connected,modelCatalog:e.modelCatalog,modelProviderWizardStep:e.modelProviderWizardStep,modelProviderWizardInput:e.modelProviderWizardInput,modelProviderWizardBusy:e.modelProviderWizardBusy,modelProviderWizardError:e.modelProviderWizardError,modelProviderWizardMessage:e.modelProviderWizardMessage,onConfigReload:e.onConfigReload,onConfigSave:e.onConfigSave,onModelChange:e.onModelChange,onModelFallbacksChange:e.onModelFallbacksChange,onModelProviderWizardStart:e.onModelProviderWizardStart,onModelProviderWizardSubmit:e.onModelProviderWizardSubmit,onModelProviderWizardCancel:e.onModelProviderWizardCancel,onModelProviderWizardInput:e.onModelProviderWizardInput,onModelProviderWizardClose:e.onModelProviderWizardClose,onSelectPanel:e.onSelectPanel}):n}
|
|
1098
|
+
${e.activePanel===`files`?Qt({agentId:s.id,agentFilesList:e.agentFiles.list,agentFilesLoading:e.agentFiles.loading,agentFilesError:e.agentFiles.error,agentFileActive:e.agentFiles.active,agentFileContents:e.agentFiles.contents,agentFileDrafts:e.agentFiles.drafts,agentFileSaving:e.agentFiles.saving,onLoadFiles:e.onLoadFiles,onSelectFile:e.onSelectFile,onFileDraftChange:e.onFileDraftChange,onFileReset:e.onFileReset,onFileSave:e.onFileSave}):n}
|
|
1099
|
+
${e.activePanel===`tools`?hn({agentId:s.id,configForm:e.config.form,configLoading:e.config.loading,configSaving:e.config.saving,configDirty:e.config.dirty,toolsCatalogLoading:e.toolsCatalog.loading,toolsCatalogError:e.toolsCatalog.error,toolsCatalogResult:e.toolsCatalog.result,toolsEffectiveLoading:e.toolsEffective.loading,toolsEffectiveError:e.toolsEffective.error,toolsEffectiveResult:e.toolsEffective.result,runtimeSessionKey:e.runtimeSessionKey,runtimeSessionMatchesSelectedAgent:e.runtimeSessionMatchesSelectedAgent,onProfileChange:e.onToolsProfileChange,onOverridesChange:e.onToolsOverridesChange,onConfigReload:e.onConfigReload,onConfigSave:e.onConfigSave}):n}
|
|
1100
|
+
${e.activePanel===`skills`?gn({agentId:s.id,report:e.agentSkills.report,loading:e.agentSkills.loading,error:e.agentSkills.error,activeAgentId:e.agentSkills.agentId,configForm:e.config.form,configLoading:e.config.loading,configSaving:e.config.saving,configDirty:e.config.dirty,filter:e.agentSkills.filter,onFilterChange:e.onSkillsFilterChange,onRefresh:e.onSkillsRefresh,onToggle:e.onAgentSkillToggle,onClear:e.onAgentSkillsClear,onDisableAll:e.onAgentSkillsDisableAll,onConfigReload:e.onConfigReload,onConfigSave:e.onConfigSave}):n}
|
|
1101
|
+
${e.activePanel===`channels`?Xt({context:p(s,e.config.form,e.agentFiles.list,a,e.agentIdentityById[s.id]??null),configForm:e.config.form,snapshot:e.channels.snapshot,loading:e.channels.loading,error:e.channels.error,lastSuccess:e.channels.lastSuccess,onRefresh:e.onChannelsRefresh,onSelectPanel:e.onSelectPanel}):n}
|
|
1102
|
+
${e.activePanel===`cron`?Zt({context:p(s,e.config.form,e.agentFiles.list,a,e.agentIdentityById[s.id]??null),agentId:s.id,jobs:e.cron.jobs,status:e.cron.status,loading:e.cron.loading,error:e.cron.error,onRefresh:e.onCronRefresh,onRunNow:e.onCronRunNow,onSelectPanel:e.onSelectPanel}):n}
|
|
1103
|
+
</div>
|
|
1104
|
+
</div>
|
|
1105
|
+
</div>
|
|
1106
|
+
`:n}
|
|
1038
1107
|
</div>
|
|
1039
|
-
`}function
|
|
1108
|
+
`}function Sn(e,r,i){return t`
|
|
1040
1109
|
<div class="agent-tabs">
|
|
1041
|
-
${[{id:`overview`,label:`Overview`},{id:`files`,label:`Files`},{id:`tools`,label:`Tools`},{id:`skills`,label:`Skills`},{id:`channels`,label:`Channels`},{id:`cron`,label:`Cron Jobs`}].map(a=>
|
|
1110
|
+
${[{id:`overview`,label:`Overview`},{id:`files`,label:`Files`},{id:`tools`,label:`Tools`},{id:`skills`,label:`Skills`},{id:`channels`,label:`Channels`},{id:`cron`,label:`Cron Jobs`}].map(a=>t`
|
|
1042
1111
|
<button
|
|
1043
|
-
class="agent-tab ${
|
|
1112
|
+
class="agent-tab ${e===a.id?`active`:``}"
|
|
1044
1113
|
type="button"
|
|
1045
|
-
@click=${()=>
|
|
1114
|
+
@click=${()=>r(a.id)}
|
|
1046
1115
|
>
|
|
1047
|
-
${a.label}${i[a.id]==null?
|
|
1116
|
+
${a.label}${i[a.id]==null?n:t`<span class="agent-tab-count">${i[a.id]}</span>`}
|
|
1048
1117
|
</button>
|
|
1049
1118
|
`)}
|
|
1050
1119
|
</div>
|
|
1051
|
-
`}export{
|
|
1052
|
-
//# sourceMappingURL=agents-
|
|
1120
|
+
`}export{xn as renderAgents};
|
|
1121
|
+
//# sourceMappingURL=agents-QDr5B3Ho.js.map
|