@commandable/mcp 0.3.0 → 0.4.0
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{S2P9sd4n.js → CBR-0oRi.js} +1 -1
- package/.output/public/_nuxt/CYsCQznM.js +59 -0
- package/.output/public/_nuxt/{B04gGCnx.js → Ctwv5nxD.js} +3 -3
- package/.output/public/_nuxt/{BvFUCPqA.js → DKO0MviJ.js} +1 -1
- package/.output/public/_nuxt/{d2XTSFt9.js → DOIzs5t4.js} +1 -1
- package/.output/public/_nuxt/KqToXREt.js +1 -0
- package/.output/public/_nuxt/{Dm_hd4at.js → Sdkz9rYy.js} +1 -1
- package/.output/public/_nuxt/_id_.DhlLK-mY.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/dd3dc5d0-c600-485d-b098-2f5b9facdf63.json +1 -0
- package/.output/server/chunks/build/IntegrationCredentials-styles.COcCfJmp.mjs +8 -0
- package/.output/server/chunks/build/IntegrationCredentials-styles.COcCfJmp.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-Bnxenh08.mjs → _id_-Co8jGxsD.mjs} +160 -38
- package/.output/server/chunks/build/{_id_-Bnxenh08.mjs.map → _id_-Co8jGxsD.mjs.map} +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{error-404-D2QibUBT.mjs → error-404-D1k2kWid.mjs} +13 -8
- package/.output/server/chunks/build/error-404-D1k2kWid.mjs.map +1 -0
- package/.output/server/chunks/build/{error-500-DYvawybF.mjs → error-500-D2K2rAfl.mjs} +13 -8
- package/.output/server/chunks/build/error-500-D2K2rAfl.mjs.map +1 -0
- package/.output/server/chunks/build/{fetch-BmYZnj75.mjs → fetch-aDh21opM.mjs} +114 -13
- package/.output/server/chunks/build/fetch-aDh21opM.mjs.map +1 -0
- package/.output/server/chunks/build/{index-CL-Gkd-Y.mjs → index-BxsJPthj.mjs} +24 -15
- package/.output/server/chunks/build/index-BxsJPthj.mjs.map +1 -0
- package/.output/server/chunks/build/{index-5H-nmhph.mjs → index-ycGPozML.mjs} +13 -8
- package/.output/server/chunks/build/index-ycGPozML.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +17 -12
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/nitro/nitro.mjs +12894 -770
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/_commandable/status.get.mjs +15 -8
- package/.output/server/chunks/routes/api/_commandable/status.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/catalog/_type/tools.get.mjs +13 -8
- package/.output/server/chunks/routes/api/catalog/_type/tools.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/catalog/_type/toolsets.get.mjs +13 -8
- package/.output/server/chunks/routes/api/catalog/_type/toolsets.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/catalog.get.mjs +12 -7
- package/.output/server/chunks/routes/api/catalog.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +13 -8
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +12 -7
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/credentials-config.get.mjs +15 -12
- package/.output/server/chunks/routes/api/integrations/_id/credentials-config.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/credentials-status.get.mjs +15 -12
- package/.output/server/chunks/routes/api/integrations/_id/credentials-status.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/credentials.delete.mjs +18 -15
- package/.output/server/chunks/routes/api/integrations/_id/credentials.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/credentials.post.mjs +28 -24
- package/.output/server/chunks/routes/api/integrations/_id/credentials.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/permissions.post.mjs +13 -8
- package/.output/server/chunks/routes/api/integrations/_id/permissions.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/tools.delete.mjs +13 -8
- package/.output/server/chunks/routes/api/integrations/_id/tools.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/tools.get.mjs +27 -10
- package/.output/server/chunks/routes/api/integrations/_id/tools.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/toolsets.get.mjs +13 -8
- package/.output/server/chunks/routes/api/integrations/_id/toolsets.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/toolsets.post.mjs +13 -8
- package/.output/server/chunks/routes/api/integrations/_id/toolsets.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/integrations/_id_.delete.mjs +13 -8
- package/.output/server/chunks/routes/api/integrations/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/health.get.mjs +12 -7
- package/.output/server/chunks/routes/health.get.mjs.map +1 -1
- package/.output/server/chunks/routes/mcp/create.mjs +13 -8
- package/.output/server/chunks/routes/mcp/create.mjs.map +1 -1
- package/.output/server/chunks/routes/mcp/static.mjs +13 -8
- package/.output/server/chunks/routes/mcp/static.mjs.map +1 -1
- package/.output/server/chunks/routes/mcp.mjs +13 -8
- package/.output/server/chunks/routes/mcp.mjs.map +1 -1
- package/.output/server/index.mjs +12 -7
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/README.md +9 -0
- package/bin/cli.mjs +29 -13
- package/package.json +15 -14
- package/.output/public/_nuxt/B2dAlp_u.js +0 -59
- package/.output/public/_nuxt/Ba0BY0O0.js +0 -1
- package/.output/public/_nuxt/_id_.BKAjWkoP.css +0 -1
- package/.output/public/_nuxt/builds/meta/51e7fb48-64de-429f-9375-7d1b1e5b5f80.json +0 -1
- package/.output/server/chunks/build/IntegrationCredentials-styles.CULcCK6_.mjs +0 -8
- package/.output/server/chunks/build/IntegrationCredentials-styles.CULcCK6_.mjs.map +0 -1
- package/.output/server/chunks/build/error-404-D2QibUBT.mjs.map +0 -1
- package/.output/server/chunks/build/error-500-DYvawybF.mjs.map +0 -1
- package/.output/server/chunks/build/fetch-BmYZnj75.mjs.map +0 -1
- package/.output/server/chunks/build/index-5H-nmhph.mjs.map +0 -1
- package/.output/server/chunks/build/index-CL-Gkd-Y.mjs.map +0 -1
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import { d as defineEventHandler,
|
|
2
|
-
import '
|
|
1
|
+
import { d as defineEventHandler, s as readBody, z as handleMcpHttp, A as setResponseStatus } from '../nitro/nitro.mjs';
|
|
2
|
+
import 'node:crypto';
|
|
3
3
|
import '@modelcontextprotocol/sdk/server/index.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
5
|
-
import '
|
|
5
|
+
import '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import 'fastest-levenshtein';
|
|
7
|
-
import 'node:fs';
|
|
8
|
-
import 'node:path';
|
|
9
7
|
import 'node:url';
|
|
10
8
|
import 'node:vm';
|
|
11
9
|
import 'turndown';
|
|
12
10
|
import 'marked';
|
|
11
|
+
import 'node:util';
|
|
12
|
+
import 'node:child_process';
|
|
13
|
+
import 'node:fs/promises';
|
|
14
|
+
import 'node:path';
|
|
15
|
+
import 'node:os';
|
|
16
|
+
import 'node:fs';
|
|
13
17
|
import 'drizzle-orm';
|
|
14
18
|
import 'node:buffer';
|
|
15
19
|
import 'google-auth-library';
|
|
16
20
|
import 'node:http';
|
|
17
21
|
import 'node:https';
|
|
18
22
|
import 'node:events';
|
|
19
|
-
import 'node:os';
|
|
20
23
|
import 'better-sqlite3';
|
|
21
24
|
import 'drizzle-orm/better-sqlite3';
|
|
22
25
|
import 'drizzle-orm/node-postgres';
|
|
23
26
|
import 'pg';
|
|
27
|
+
import 'drizzle-orm/better-sqlite3/migrator';
|
|
28
|
+
import 'drizzle-orm/node-postgres/migrator';
|
|
29
|
+
import 'drizzle-orm/sqlite-core';
|
|
30
|
+
import 'drizzle-orm/pg-core';
|
|
24
31
|
import 'node:process';
|
|
25
32
|
import 'js-yaml';
|
|
26
33
|
import 'zod';
|
|
27
|
-
import 'drizzle-orm/sqlite-core';
|
|
28
|
-
import 'drizzle-orm/pg-core';
|
|
29
34
|
import '@iconify/utils';
|
|
30
35
|
import 'consola';
|
|
31
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","sources":["../../../../server/routes/mcp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp.mjs","sources":["../../../../server/routes/mcp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,YAAe,kBAAA,CAAmB,OAAO,KAAA,KAAU;AAHnD,EAAA,IAAA,EAAA,EAAA,EAAA;AAIE,EAAA,MAAM,MAAA,GAAS,KAAA,CAAM,IAAA,CAAK,GAAA,CAAI,MAAA,IAAU,KAAA;AACxC,EAAA,MAAM,OAAO,MAAA,KAAW,MAAA,GAAS,MAAM,QAAA,CAAS,KAAK,CAAA,GAAI,MAAA;AAEzD,EAAA,MAAM,MAAA,GAAS,MAAM,aAAA,CAAc;AAAA,IACjC,OAAA,EAAS,MAAM,IAAA,CAAK,GAAA;AAAA,IACpB,OAAA,EAAS,MAAM,IAAA,CAAK,GAAA;AAAA,IACpB,IAAA;AAAA,IACA,QAAA,EAAU,SAAA;AAAA,IACV,eAAc,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAd,IAAA,GAAA,MAAA,GAAA,EAAA,CAAoB,aAApB,IAAA,GAAA,EAAA,GAAgC;AAAA,GAC/C,CAAA;AAED,EAAA,IAAI,MAAA,CAAO,SAAS,SAAA,EAAW;AAC7B,IAAA,KAAA,CAAM,QAAA,GAAW,IAAA;AACjB,IAAA;AAAA,EACF;AAEA,EAAA,iBAAA,CAAkB,KAAA,EAAO,OAAO,UAAU,CAAA;AAC1C,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA;AAAA,IACT,OAAO,EAAE,IAAA,EAAM,KAAA,EAAQ,OAAA,EAAS,OAAO,OAAA,EAAQ;AAAA,IAC/C,EAAA,EAAI;AAAA,GACN;AACF,CAAC,CAAA;;;;"}
|
package/.output/server/index.mjs
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import 'node:http';
|
|
2
2
|
import 'node:https';
|
|
3
3
|
export { a7 as default } from './chunks/nitro/nitro.mjs';
|
|
4
|
-
import '
|
|
4
|
+
import 'node:crypto';
|
|
5
5
|
import '@modelcontextprotocol/sdk/server/index.js';
|
|
6
6
|
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
7
|
-
import '
|
|
7
|
+
import '@modelcontextprotocol/sdk/types.js';
|
|
8
8
|
import 'fastest-levenshtein';
|
|
9
|
-
import 'node:fs';
|
|
10
|
-
import 'node:path';
|
|
11
9
|
import 'node:url';
|
|
12
10
|
import 'node:vm';
|
|
13
11
|
import 'turndown';
|
|
14
12
|
import 'marked';
|
|
13
|
+
import 'node:util';
|
|
14
|
+
import 'node:child_process';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import 'node:os';
|
|
18
|
+
import 'node:fs';
|
|
15
19
|
import 'drizzle-orm';
|
|
16
20
|
import 'node:buffer';
|
|
17
21
|
import 'google-auth-library';
|
|
18
22
|
import 'node:events';
|
|
19
|
-
import 'node:os';
|
|
20
23
|
import 'better-sqlite3';
|
|
21
24
|
import 'drizzle-orm/better-sqlite3';
|
|
22
25
|
import 'drizzle-orm/node-postgres';
|
|
23
26
|
import 'pg';
|
|
27
|
+
import 'drizzle-orm/better-sqlite3/migrator';
|
|
28
|
+
import 'drizzle-orm/node-postgres/migrator';
|
|
29
|
+
import 'drizzle-orm/sqlite-core';
|
|
30
|
+
import 'drizzle-orm/pg-core';
|
|
24
31
|
import 'node:process';
|
|
25
32
|
import 'js-yaml';
|
|
26
33
|
import 'zod';
|
|
27
|
-
import 'drizzle-orm/sqlite-core';
|
|
28
|
-
import 'drizzle-orm/pg-core';
|
|
29
34
|
import '@iconify/utils';
|
|
30
35
|
import 'consola';
|
|
31
36
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/README.md
CHANGED
|
@@ -30,6 +30,14 @@ yarn install
|
|
|
30
30
|
yarn workspace @commandable/mcp dev
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
If you are testing file-processing tools locally, install the extractor dependency on the host first:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip3 install -r packages/core/src/file-extractor/requirements.txt
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Without that dependency, the app still boots normally but file-processing-backed tools stay hidden and the status/doctor surfaces report file processing as disabled. The Docker image already includes the required runtime.
|
|
40
|
+
|
|
33
41
|
For the full local product flow, prefer the root scripts:
|
|
34
42
|
|
|
35
43
|
```bash
|
|
@@ -57,3 +65,4 @@ Recommended URLs:
|
|
|
57
65
|
|
|
58
66
|
- The old embedded-bundle-in-another-package model is gone.
|
|
59
67
|
- This package now publishes and runs the built Nuxt app directly.
|
|
68
|
+
- `/_commandable/status` includes a `fileProcessing` block so hosts can verify whether extraction-backed tools are enabled.
|
package/bin/cli.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import crypto from 'node:crypto'
|
|
2
1
|
import { spawn, spawnSync } from 'node:child_process'
|
|
2
|
+
import crypto from 'node:crypto'
|
|
3
3
|
import { existsSync, mkdirSync, openSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs'
|
|
4
|
+
import { createRequire } from 'node:module'
|
|
4
5
|
import { resolve } from 'node:path'
|
|
5
6
|
import { fileURLToPath } from 'node:url'
|
|
6
|
-
import { createRequire } from 'node:module'
|
|
7
7
|
import { isCancel, note, select } from '@clack/prompts'
|
|
8
|
-
import picocolors from 'picocolors'
|
|
9
8
|
import {
|
|
10
|
-
SqlCredentialStore,
|
|
11
9
|
applyConfig,
|
|
12
10
|
createApiKey,
|
|
13
11
|
createDbFromEnv,
|
|
@@ -16,13 +14,20 @@ import {
|
|
|
16
14
|
getCommandableDir,
|
|
17
15
|
getOrCreateEncryptionSecret,
|
|
18
16
|
loadConfig,
|
|
17
|
+
SqlCredentialStore,
|
|
19
18
|
} from '@commandable/mcp-core'
|
|
19
|
+
import picocolors from 'picocolors'
|
|
20
20
|
|
|
21
21
|
const require = createRequire(import.meta.url)
|
|
22
22
|
const pkg = require('../package.json')
|
|
23
|
+
|
|
23
24
|
const COMMANDABLE_VERSION = String(pkg.version || '0.0.0')
|
|
24
25
|
const packageRoot = resolve(fileURLToPath(new URL('..', import.meta.url)))
|
|
25
26
|
const serverEntry = resolve(packageRoot, '.output', 'server', 'index.mjs')
|
|
27
|
+
const DIGITS_ONLY_RE = /^\d+$/
|
|
28
|
+
const PID_LINE_RE = /^\d+$/
|
|
29
|
+
const SAFE_SHELL_ARG_RE = /^[\w./:=@-]+$/
|
|
30
|
+
const SINGLE_QUOTE_RE = /'/g
|
|
26
31
|
const CLAUDE_CODE_STDIO_ENV_KEYS = [
|
|
27
32
|
'COMMANDABLE_SPACE_ID',
|
|
28
33
|
'COMMANDABLE_DATA_DIR',
|
|
@@ -49,7 +54,7 @@ function getFlagValue(flag) {
|
|
|
49
54
|
|
|
50
55
|
function getUiPort() {
|
|
51
56
|
const raw = process.env.COMMANDABLE_UI_PORT
|
|
52
|
-
return raw &&
|
|
57
|
+
return raw && DIGITS_ONLY_RE.test(raw) ? Number(raw) : 23432
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
function getBaseUrl() {
|
|
@@ -75,7 +80,7 @@ function readDaemonPid() {
|
|
|
75
80
|
try {
|
|
76
81
|
const raw = readFileSync(daemonPidPath(), 'utf8')
|
|
77
82
|
const lines = raw.split('\n').map(line => line.trim()).filter(Boolean)
|
|
78
|
-
const pid = lines[0] &&
|
|
83
|
+
const pid = lines[0] && PID_LINE_RE.test(lines[0]) ? Number(lines[0]) : null
|
|
79
84
|
const version = lines[1] || null
|
|
80
85
|
return pid ? { pid, version } : null
|
|
81
86
|
}
|
|
@@ -100,12 +105,16 @@ function stopDaemonProcess() {
|
|
|
100
105
|
try {
|
|
101
106
|
process.kill(info.pid, 'SIGTERM')
|
|
102
107
|
}
|
|
103
|
-
catch {
|
|
108
|
+
catch {
|
|
109
|
+
// Ignore if process already exited.
|
|
110
|
+
}
|
|
104
111
|
}
|
|
105
112
|
try {
|
|
106
113
|
unlinkSync(daemonPidPath())
|
|
107
114
|
}
|
|
108
|
-
catch {
|
|
115
|
+
catch {
|
|
116
|
+
// Ignore missing pid file.
|
|
117
|
+
}
|
|
109
118
|
return { stopped: !!info?.pid, pid: info?.pid ?? null }
|
|
110
119
|
}
|
|
111
120
|
|
|
@@ -119,7 +128,9 @@ async function fetchJsonWithTimeout(url, timeoutMs) {
|
|
|
119
128
|
try {
|
|
120
129
|
json = text ? JSON.parse(text) : null
|
|
121
130
|
}
|
|
122
|
-
catch {
|
|
131
|
+
catch {
|
|
132
|
+
// Ignore invalid JSON payloads.
|
|
133
|
+
}
|
|
123
134
|
return { ok: response.ok, status: response.status, json }
|
|
124
135
|
}
|
|
125
136
|
finally {
|
|
@@ -166,9 +177,9 @@ function getClaudeCodeEnvEntries() {
|
|
|
166
177
|
}
|
|
167
178
|
|
|
168
179
|
function quoteShellArg(value) {
|
|
169
|
-
if (
|
|
180
|
+
if (SAFE_SHELL_ARG_RE.test(value))
|
|
170
181
|
return value
|
|
171
|
-
return `'${value.replace(
|
|
182
|
+
return `'${value.replace(SINGLE_QUOTE_RE, `'"'"'`)}'`
|
|
172
183
|
}
|
|
173
184
|
|
|
174
185
|
function makeReadModeConfig() {
|
|
@@ -265,11 +276,15 @@ async function startManagementUi({ restart }) {
|
|
|
265
276
|
try {
|
|
266
277
|
process.kill(child.pid, 'SIGTERM')
|
|
267
278
|
}
|
|
268
|
-
catch {
|
|
279
|
+
catch {
|
|
280
|
+
// Ignore if process already exited.
|
|
281
|
+
}
|
|
269
282
|
try {
|
|
270
283
|
unlinkSync(daemonPidPath())
|
|
271
284
|
}
|
|
272
|
-
catch {
|
|
285
|
+
catch {
|
|
286
|
+
// Ignore missing pid file.
|
|
287
|
+
}
|
|
273
288
|
console.error(`Commandable management UI failed to start at ${baseUrl}`)
|
|
274
289
|
console.error(`Check the daemon log at ${logPath}`)
|
|
275
290
|
process.exit(1)
|
|
@@ -402,6 +417,7 @@ async function runDoctor() {
|
|
|
402
417
|
versionMatch: !!runningVersion && runningVersion === COMMANDABLE_VERSION,
|
|
403
418
|
status: probe?.json ?? null,
|
|
404
419
|
},
|
|
420
|
+
fileProcessing: probe?.json?.fileProcessing ?? null,
|
|
405
421
|
}, null, 2))
|
|
406
422
|
}
|
|
407
423
|
|
package/package.json
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commandable/mcp",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"packageManager": "yarn@4.12.0",
|
|
4
6
|
"description": "Commandable app/server package for local management UI, HTTP endpoints, and human-facing CLI flows.",
|
|
5
7
|
"license": "AGPL-3.0-only",
|
|
8
|
+
"homepage": "https://github.com/commandable/commandable-mcp#readme",
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "git+https://github.com/commandable/commandable-mcp.git",
|
|
9
12
|
"directory": "app"
|
|
10
13
|
},
|
|
11
|
-
"homepage": "https://github.com/commandable/commandable-mcp#readme",
|
|
12
14
|
"bugs": {
|
|
13
15
|
"url": "https://github.com/commandable/commandable-mcp/issues"
|
|
14
16
|
},
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=18"
|
|
17
|
-
},
|
|
18
|
-
"type": "module",
|
|
19
17
|
"bin": {
|
|
20
18
|
"commandable-mcp": "./bin/commandable-mcp.mjs"
|
|
21
19
|
},
|
|
22
20
|
"publishConfig": {
|
|
23
21
|
"access": "public"
|
|
24
22
|
},
|
|
23
|
+
"files": [
|
|
24
|
+
".output",
|
|
25
|
+
"README.md",
|
|
26
|
+
"bin"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
25
31
|
"scripts": {
|
|
26
32
|
"build": "nuxt build",
|
|
27
33
|
"dev": "nuxt dev",
|
|
@@ -34,7 +40,7 @@
|
|
|
34
40
|
},
|
|
35
41
|
"dependencies": {
|
|
36
42
|
"@clack/prompts": "^1.0.1",
|
|
37
|
-
"@commandable/mcp-core": "0.
|
|
43
|
+
"@commandable/mcp-core": "0.8.0",
|
|
38
44
|
"@iconify-json/lucide": "^1.2.90",
|
|
39
45
|
"@iconify-json/simple-icons": "^1.2.70",
|
|
40
46
|
"@nuxt/ui": "^4.4.0",
|
|
@@ -44,15 +50,10 @@
|
|
|
44
50
|
"tailwindcss": "^4.1.18"
|
|
45
51
|
},
|
|
46
52
|
"devDependencies": {
|
|
53
|
+
"@antfu/eslint-config": "^7.7.3",
|
|
47
54
|
"@nuxt/eslint": "^1.15.1",
|
|
48
55
|
"eslint": "^10.0.0",
|
|
49
56
|
"typescript": "^5.9.3",
|
|
50
57
|
"vue-tsc": "^3.2.4"
|
|
51
|
-
}
|
|
52
|
-
"files": [
|
|
53
|
-
".output",
|
|
54
|
-
"bin",
|
|
55
|
-
"README.md"
|
|
56
|
-
],
|
|
57
|
-
"packageManager": "yarn@4.12.0"
|
|
58
|
+
}
|
|
58
59
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import{g as et,h as tt,i as nt,j as st,k as rt,l as lt,m as it,p as at,q as ot,o as _,r as X,w as T,a as y,s as Ce,v as p,x as fe,c as C,y as H,z as oe,A as ct,B as K,P as ut,C as U,D as pt,E as qe,f as De,F as ke,b as z,d as A,G as Oe,H as me,I as xe,J as dt,K as ht,L as q,M as gt,_ as ft,N as kt,O as mt,Q as xt,e as bt,t as ie,n as wt}from"./B04gGCnx.js";import{_ as yt,a as vt,u as $t,b as St,c as _t,d as zt}from"./Ba0BY0O0.js";const Rt={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},Tt=["id","type","value","name","placeholder","disabled","required","autocomplete"],It=Object.assign({inheritAttrs:!1},{__name:"UInput",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},type:{type:null,required:!1,default:"text"},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autocomplete:{type:[String,Object],required:!1,default:"off"},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(s,{expose:e,emit:n}){const r=s,t=n,i=et(),l=tt(r,"modelValue",t,{defaultValue:r.defaultValue}),u=nt(),a=st("input",r),{emitFormBlur:o,emitFormInput:c,emitFormChange:d,size:h,color:x,id:b,name:I,highlight:D,disabled:j,emitFormFocus:Z,ariaAttrs:N}=rt(r,{deferInputValidation:!0}),{orientation:R,size:f}=lt(r),{isLeading:S,isTrailing:F,leadingIconName:k,trailingIconName:g}=it(r),L=U(()=>f.value||h.value),$=U(()=>qe({extend:qe(Rt),...u.ui?.input||{}})({type:r.type,color:x.value,variant:r.variant,size:L?.value,loading:r.loading,highlight:D.value,fixed:r.fixed,leading:S.value||!!r.avatar||!!i.leading,trailing:F.value||!!i.trailing,fieldGroup:R.value})),Q=at("inputRef");function G(v){r.modelModifiers?.trim&&(typeof v=="string"||v===null||v===void 0)&&(v=v?.trim()??null),(r.modelModifiers?.number||r.type==="number")&&(v=pt(v)),r.modelModifiers?.nullable&&(v||=null),r.modelModifiers?.optional&&!r.modelModifiers?.nullable&&v!==null&&(v||=void 0),l.value=v,c()}function E(v){r.modelModifiers?.lazy||G(v.target.value)}function ge(v){const ee=v.target.value;r.modelModifiers?.lazy&&G(ee),r.modelModifiers?.trim&&(v.target.value=ee.trim()),d(),t("change",v)}function B(v){o(),t("blur",v)}function le(){r.autofocus&&Q.value?.focus()}return ot(()=>{setTimeout(()=>{le()},r.autofocusDelay)}),e({inputRef:Q}),(v,ee)=>(_(),X(p(ut),{as:s.as,"data-slot":"root",class:H($.value.root({class:[p(a)?.root,r.class]}))},{default:T(()=>[y("input",Ce({id:p(b),ref_key:"inputRef",ref:Q,type:s.type,value:p(l),name:p(I),placeholder:s.placeholder,"data-slot":"base",class:$.value.base({class:p(a)?.base}),disabled:p(j),required:s.required,autocomplete:s.autocomplete},{...v.$attrs,...p(N)},{onInput:E,onBlur:B,onChange:ge,onFocus:ee[0]||(ee[0]=(...Ye)=>p(Z)&&p(Z)(...Ye))}),null,16,Tt),fe(v.$slots,"default",{ui:$.value}),p(S)||s.avatar||i.leading?(_(),C("span",{key:0,"data-slot":"leading",class:H($.value.leading({class:p(a)?.leading}))},[fe(v.$slots,"leading",{ui:$.value},()=>[p(S)&&p(k)?(_(),X(oe,{key:0,name:p(k),"data-slot":"leadingIcon",class:H($.value.leadingIcon({class:p(a)?.leadingIcon}))},null,8,["name","class"])):s.avatar?(_(),X(ct,Ce({key:1,size:p(a)?.leadingAvatarSize||$.value.leadingAvatarSize()},s.avatar,{"data-slot":"leadingAvatar",class:$.value.leadingAvatar({class:p(a)?.leadingAvatar})}),null,16,["size","class"])):K("",!0)])],2)):K("",!0),p(F)||i.trailing?(_(),C("span",{key:1,"data-slot":"trailing",class:H($.value.trailing({class:p(a)?.trailing}))},[fe(v.$slots,"trailing",{ui:$.value},()=>[p(g)?(_(),X(oe,{key:0,name:p(g),"data-slot":"trailingIcon",class:H($.value.trailingIcon({class:p(a)?.trailingIcon}))},null,8,["name","class"])):K("",!0)])],2)):K("",!0)]),_:3},8,["as","class"]))}});function ve(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Y=ve();function je(s){Y=s}var W={exec:()=>null};function m(s,e=""){let n=typeof s=="string"?s:s.source,r={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(P.caret,"$1"),n=n.replace(t,l),r},getRegex:()=>new RegExp(n,e)};return r}var At=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),P={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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},Ct=/^(?:[ \t]*(?:\n|$))+/,qt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,re=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$e=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ze=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fe=m(Ze).replace(/bull/g,$e).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(),Lt=m(Ze).replace(/bull/g,$e).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(),Se=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Et=/^[^\n]+/,_e=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Mt=m(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_e).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vt=m(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$e).getRegex(),de="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",ze=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dt=m("^ {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",ze).replace("tag",de).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ne=m(Se).replace("hr",re).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",de).getRegex(),Ot=m(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ne).getRegex(),Re={blockquote:Ot,code:qt,def:Mt,fences:Pt,heading:Bt,hr:re,html:Dt,lheading:Fe,list:Vt,newline:Ct,paragraph:Ne,table:W,text:Et},Pe=m("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",re).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",de).getRegex(),jt={...Re,lheading:Lt,table:Pe,paragraph:m(Se).replace("hr",re).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pe).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",de).getRegex()},Zt={...Re,html:m(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ze).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:W,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:m(Se).replace("hr",re).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",Fe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ft=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ue=/^( {2,}|\\)\n(?!\s*$)/,Ut=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,he=/[\p{P}\p{S}]/u,Te=/[\s\p{P}\p{S}]/u,Qe=/[^\s\p{P}\p{S}]/u,Qt=m(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Te).getRegex(),Ge=/(?!~)[\p{P}\p{S}]/u,Gt=/(?!~)[\s\p{P}\p{S}]/u,Ht=/(?:[^\s\p{P}\p{S}]|~)/u,He=/(?![*_])[\p{P}\p{S}]/u,Wt=/(?![*_])[\s\p{P}\p{S}]/u,Xt=/(?:[^\s\p{P}\p{S}]|[*_])/u,Kt=m(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",At?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),We=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Jt=m(We,"u").replace(/punct/g,he).getRegex(),Yt=m(We,"u").replace(/punct/g,Ge).getRegex(),Xe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",en=m(Xe,"gu").replace(/notPunctSpace/g,Qe).replace(/punctSpace/g,Te).replace(/punct/g,he).getRegex(),tn=m(Xe,"gu").replace(/notPunctSpace/g,Ht).replace(/punctSpace/g,Gt).replace(/punct/g,Ge).getRegex(),nn=m("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qe).replace(/punctSpace/g,Te).replace(/punct/g,he).getRegex(),sn=m(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,He).getRegex(),rn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ln=m(rn,"gu").replace(/notPunctSpace/g,Xt).replace(/punctSpace/g,Wt).replace(/punct/g,He).getRegex(),an=m(/\\(punct)/,"gu").replace(/punct/g,he).getRegex(),on=m(/^<(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(),cn=m(ze).replace("(?:-->|$)","-->").getRegex(),un=m("^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",cn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ce=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,pn=m(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ce).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ke=m(/^!?\[(label)\]\[(ref)\]/).replace("label",ce).replace("ref",_e).getRegex(),Je=m(/^!?\[(ref)\](?:\[\])?/).replace("ref",_e).getRegex(),dn=m("reflink|nolink(?!\\()","g").replace("reflink",Ke).replace("nolink",Je).getRegex(),Be=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ie={_backpedal:W,anyPunctuation:an,autolink:on,blockSkip:Kt,br:Ue,code:Nt,del:W,delLDelim:W,delRDelim:W,emStrongLDelim:Jt,emStrongRDelimAst:en,emStrongRDelimUnd:nn,escape:Ft,link:pn,nolink:Je,punctuation:Qt,reflink:Ke,reflinkSearch:dn,tag:un,text:Ut,url:W},hn={...Ie,link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",ce).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce).getRegex()},be={...Ie,emStrongRDelimAst:tn,emStrongLDelim:Yt,delLDelim:sn,delRDelim:ln,url:m(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Be).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:m(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Be).getRegex()},gn={...be,br:m(Ue).replace("{2,}","*").getRegex(),text:m(be.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ae={normal:Re,gfm:jt,pedantic:Zt},te={normal:Ie,gfm:be,breaks:gn,pedantic:hn},fn={"&":"&","<":"<",">":">",'"':""","'":"'"},Le=s=>fn[s];function O(s,e){if(e){if(P.escapeTest.test(s))return s.replace(P.escapeReplace,Le)}else if(P.escapeTestNoEncode.test(s))return s.replace(P.escapeReplaceNoEncode,Le);return s}function Ee(s){try{s=encodeURI(s).replace(P.percentDecode,"%")}catch{return null}return s}function Me(s,e){let n=s.replace(P.findPipe,(i,l,u)=>{let a=!1,o=l;for(;--o>=0&&u[o]==="\\";)a=!a;return a?"|":" |"}),r=n.split(P.splitPipe),t=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;t<r.length;t++)r[t]=r[t].trim().replace(P.slashPipe,"|");return r}function ne(s,e,n){let r=s.length;if(r===0)return"";let t=0;for(;t<r&&s.charAt(r-t-1)===e;)t++;return s.slice(0,r-t)}function kn(s,e){if(s.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<s.length;r++)if(s[r]==="\\")r++;else if(s[r]===e[0])n++;else if(s[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function mn(s,e=0){let n=e,r="";for(let t of s)if(t===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=t,n++;return r}function Ve(s,e,n,r,t){let i=e.href,l=e.title||null,u=s[1].replace(t.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:s[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:l,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,a}function xn(s,e,n){let r=s.match(n.other.indentCodeCompensation);if(r===null)return e;let t=r[1];return e.split(`
|
|
3
|
-
`).map(i=>{let l=i.match(n.other.beginningSpace);if(l===null)return i;let[u]=l;return u.length>=t.length?i.slice(t.length):i}).join(`
|
|
4
|
-
`)}var ue=class{options;rules;lexer;constructor(s){this.options=s||Y}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ne(n,`
|
|
5
|
-
`)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let n=e[0],r=xn(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=ne(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:ne(e[0],`
|
|
6
|
-
`)}}blockquote(s){let e=this.rules.block.blockquote.exec(s);if(e){let n=ne(e[0],`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),r="",t="",i=[];for(;n.length>0;){let l=!1,u=[],a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))u.push(n[a]),l=!0;else if(!l)u.push(n[a]);else break;n=n.slice(a);let o=u.join(`
|
|
9
|
-
`),c=o.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
11
|
-
${o}`:o,t=t?`${t}
|
|
12
|
-
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=d,n.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let x=h,b=x.raw+`
|
|
13
|
-
`+n.join(`
|
|
14
|
-
`),I=this.blockquote(b);i[i.length-1]=I,r=r.substring(0,r.length-x.raw.length)+I.raw,t=t.substring(0,t.length-x.text.length)+I.text;break}else if(h?.type==="list"){let x=h,b=x.raw+`
|
|
15
|
-
`+n.join(`
|
|
16
|
-
`),I=this.list(b);i[i.length-1]=I,r=r.substring(0,r.length-h.raw.length)+I.raw,t=t.substring(0,t.length-x.raw.length)+I.raw,n=b.substring(i.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:t}}}list(s){let e=this.rules.block.list.exec(s);if(e){let n=e[1].trim(),r=n.length>1,t={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 i=this.rules.other.listItemRegex(n),l=!1;for(;s;){let a=!1,o="",c="";if(!(e=i.exec(s))||this.rules.block.hr.test(s))break;o=e[0],s=s.substring(o.length);let d=mn(e[2].split(`
|
|
18
|
-
`,1)[0],e[1].length),h=s.split(`
|
|
19
|
-
`,1)[0],x=!d.trim(),b=0;if(this.options.pedantic?(b=2,c=d.trimStart()):x?b=e[1].length+1:(b=d.search(this.rules.other.nonSpaceChar),b=b>4?1:b,c=d.slice(b),b+=e[1].length),x&&this.rules.other.blankLine.test(h)&&(o+=h+`
|
|
20
|
-
`,s=s.substring(h.length+1),a=!0),!a){let I=this.rules.other.nextBulletRegex(b),D=this.rules.other.hrRegex(b),j=this.rules.other.fencesBeginRegex(b),Z=this.rules.other.headingBeginRegex(b),N=this.rules.other.htmlBeginRegex(b),R=this.rules.other.blockquoteBeginRegex(b);for(;s;){let f=s.split(`
|
|
21
|
-
`,1)[0],S;if(h=f,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),S=h):S=h.replace(this.rules.other.tabCharGlobal," "),j.test(h)||Z.test(h)||N.test(h)||R.test(h)||I.test(h)||D.test(h))break;if(S.search(this.rules.other.nonSpaceChar)>=b||!h.trim())c+=`
|
|
22
|
-
`+S.slice(b);else{if(x||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(d)||Z.test(d)||D.test(d))break;c+=`
|
|
23
|
-
`+h}x=!h.trim(),o+=f+`
|
|
24
|
-
`,s=s.substring(f.length+1),d=S.slice(b)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(l=!0)),t.items.push({type:"list_item",raw:o,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=o}let u=t.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a of t.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let o=this.rules.other.listTaskCheckbox.exec(a.raw);if(o){let c={type:"checkbox",raw:o[0]+" ",checked:o[0]!=="[ ]"};a.checked=c.checked,t.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!t.loose){let o=a.tokens.filter(d=>d.type==="space"),c=o.length>0&&o.some(d=>this.rules.other.anyLine.test(d.raw));t.loose=c}}if(t.loose)for(let a of t.items){a.loose=!0;for(let o of a.tokens)o.type==="text"&&(o.type="paragraph")}return t}}html(s){let e=this.rules.block.html.exec(s);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(s){let e=this.rules.block.def.exec(s);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:t}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Me(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(Me(l,i.header.length).map((u,a)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[a]})));return i}}lheading(s){let e=this.rules.block.lheading.exec(s);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(s){let e=this.rules.block.paragraph.exec(s);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(s){let e=this.rules.block.text.exec(s);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(s){let e=this.rules.inline.escape.exec(s);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(s){let e=this.rules.inline.tag.exec(s);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(s){let e=this.rules.inline.link.exec(s);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=ne(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=kn(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let r=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Ve(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let n;if((n=this.rules.inline.reflink.exec(s))||(n=this.rules.inline.nolink.exec(s))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[r.toLowerCase()];if(!t){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Ve(n,t,n[0],this.lexer,this.rules)}}emStrong(s,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(s);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let t=[...r[0]].length-1,i,l,u=t,a=0,o=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,e=e.slice(-1*s.length+t);(r=o.exec(e))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(l=[...i].length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&t%3&&!((t+l)%3)){a+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+a);let c=[...r[0]][0].length,d=s.slice(0,t+r.index+c+l);if(Math.min(t,l)%2){let x=d.slice(1,-1);return{type:"em",raw:d,text:x,tokens:this.lexer.inlineTokens(x)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),t=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&t&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s,e,n=""){let r=this.rules.inline.delLDelim.exec(s);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let t=[...r[0]].length-1,i,l,u=t,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*s.length+t);(r=a.exec(e))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(l=[...i].length,l!==t))continue;if(r[3]||r[4]){u+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u);let o=[...r[0]][0].length,c=s.slice(0,t+r.index+o+l),d=c.slice(t,-t);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},M=class we{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Y,this.options.tokenizer=this.options.tokenizer||new ue,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 n={other:P,block:ae.normal,inline:te.normal};this.options.pedantic?(n.block=ae.pedantic,n.inline=te.pedantic):this.options.gfm&&(n.block=ae.gfm,this.options.breaks?n.inline=te.breaks:n.inline=te.gfm),this.tokenizer.rules=n}static get rules(){return{block:ae,inline:te}}static lex(e,n){return new we(n).lex(e)}static lexInline(e,n){return new we(n).inlineTokens(e)}lex(e){e=e.replace(P.carriageReturn,`
|
|
27
|
-
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.options.pedantic&&(e=e.replace(P.tabCharGlobal," ").replace(P.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=n.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
|
|
28
|
-
`:n.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
29
|
-
`)?"":`
|
|
30
|
-
`)+t.raw,l.text+=`
|
|
31
|
-
`+t.text,this.inlineQueue.at(-1).src=l.text):n.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
32
|
-
`)?"":`
|
|
33
|
-
`)+t.raw,l.text+=`
|
|
34
|
-
`+t.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},n.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),n.push(t);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0,u=e.slice(1),a;this.options.extensions.startBlock.forEach(o=>{a=o.call({lexer:this},u),typeof a=="number"&&a>=0&&(l=Math.min(l,a))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
35
|
-
`)?"":`
|
|
36
|
-
`)+t.raw,l.text+=`
|
|
37
|
-
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(t),r=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
38
|
-
`)?"":`
|
|
39
|
-
`)+t.raw,l.text+=`
|
|
40
|
-
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,t.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)i=t[2]?t[2].length:0,r=r.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,u="";for(;e;){l||(u=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,r,u)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,r,u)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let o=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),h;this.options.extensions.startInline.forEach(x=>{h=x.call({lexer:this},d),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(o)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(u=a.raw.slice(-1)),l=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}},pe=class{options;parser;constructor(s){this.options=s||Y}space(s){return""}code({text:s,lang:e,escaped:n}){let r=(e||"").match(P.notSpaceStart)?.[0],t=s.replace(P.endingNewline,"")+`
|
|
41
|
-
`;return r?'<pre><code class="language-'+O(r)+'">'+(n?t:O(t,!0))+`</code></pre>
|
|
42
|
-
`:"<pre><code>"+(n?t:O(t,!0))+`</code></pre>
|
|
43
|
-
`}blockquote({tokens:s}){return`<blockquote>
|
|
44
|
-
${this.parser.parse(s)}</blockquote>
|
|
45
|
-
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:e}){return`<h${e}>${this.parser.parseInline(s)}</h${e}>
|
|
46
|
-
`}hr(s){return`<hr>
|
|
47
|
-
`}list(s){let e=s.ordered,n=s.start,r="";for(let l=0;l<s.items.length;l++){let u=s.items[l];r+=this.listitem(u)}let t=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+t+i+`>
|
|
48
|
-
`+r+"</"+t+`>
|
|
49
|
-
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
50
|
-
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
51
|
-
`}table(s){let e="",n="";for(let t=0;t<s.header.length;t++)n+=this.tablecell(s.header[t]);e+=this.tablerow({text:n});let r="";for(let t=0;t<s.rows.length;t++){let i=s.rows[t];n="";for(let l=0;l<i.length;l++)n+=this.tablecell(i[l]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
52
|
-
<thead>
|
|
53
|
-
`+e+`</thead>
|
|
54
|
-
`+r+`</table>
|
|
55
|
-
`}tablerow({text:s}){return`<tr>
|
|
56
|
-
${s}</tr>
|
|
57
|
-
`}tablecell(s){let e=this.parser.parseInline(s.tokens),n=s.header?"th":"td";return(s.align?`<${n} align="${s.align}">`:`<${n}>`)+e+`</${n}>
|
|
58
|
-
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${O(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:n}){let r=this.parser.parseInline(n),t=Ee(s);if(t===null)return r;s=t;let i='<a href="'+s+'"';return e&&(i+=' title="'+O(e)+'"'),i+=">"+r+"</a>",i}image({href:s,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let t=Ee(s);if(t===null)return O(n);s=t;let i=`<img src="${s}" alt="${O(n)}"`;return e&&(i+=` title="${O(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:O(s.text)}},Ae=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},V=class ye{options;renderer;textRenderer;constructor(e){this.options=e||Y,this.options.renderer=this.options.renderer||new pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ae}static parse(e,n){return new ye(n).parse(e)}static parseInline(e,n){return new ye(n).parseInline(e)}parse(e){let n="";for(let r=0;r<e.length;r++){let t=e[r];if(this.options.extensions?.renderers?.[t.type]){let l=t,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";continue}}let i=t;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,n=this.renderer){let r="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=u||"";continue}}let l=i;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},se=class{options;block;constructor(s){this.options=s||Y}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?M.lex:M.lexInline}provideParser(){return this.block?V.parse:V.parseInline}},bn=class{defaults=ve();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=V;Renderer=pe;TextRenderer=Ae;Lexer=M;Tokenizer=ue;Hooks=se;constructor(...s){this.use(...s)}walkTokens(s,e){let n=[];for(let r of s)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let t=r;for(let i of t.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)n=n.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=r;n=n.concat(this.walkTokens(t.items,e));break}default:{let t=r;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);n=n.concat(this.walkTokens(l,e))}):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let u=t.renderer.apply(this,l);return u===!1&&(u=i.apply(this,l)),u}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),r.extensions=e),n.renderer){let t=this.defaults.renderer||new pe(this.defaults);for(let i in n.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,u=n.renderer[l],a=t[l];t[l]=(...o)=>{let c=u.apply(t,o);return c===!1&&(c=a.apply(t,o)),c||""}}r.renderer=t}if(n.tokenizer){let t=this.defaults.tokenizer||new ue(this.defaults);for(let i in n.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,u=n.tokenizer[l],a=t[l];t[l]=(...o)=>{let c=u.apply(t,o);return c===!1&&(c=a.apply(t,o)),c}}r.tokenizer=t}if(n.hooks){let t=this.defaults.hooks||new se;for(let i in n.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,u=n.hooks[l],a=t[l];se.passThroughHooks.has(i)?t[l]=o=>{if(this.defaults.async&&se.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await u.call(t,o);return a.call(t,d)})();let c=u.call(t,o);return a.call(t,c)}:t[l]=(...o)=>{if(this.defaults.async)return(async()=>{let d=await u.apply(t,o);return d===!1&&(d=await a.apply(t,o)),d})();let c=u.apply(t,o);return c===!1&&(c=a.apply(t,o)),c}}r.hooks=t}if(n.walkTokens){let t=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(l){let u=[];return u.push(i.call(this,l)),t&&(u=u.concat(t.call(this,l))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return M.lex(s,e??this.defaults)}parser(s,e){return V.parse(s,e??this.defaults)}parseMarkdown(s){return(e,n)=>{let r={...n},t={...this.defaults,...r},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&r.async===!1)return i(new 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 e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=s),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,u=await(t.hooks?await t.hooks.provideLexer():s?M.lex:M.lexInline)(l,t),a=t.hooks?await t.hooks.processAllTokens(u):u;t.walkTokens&&await Promise.all(this.walkTokens(a,t.walkTokens));let o=await(t.hooks?await t.hooks.provideParser():s?V.parse:V.parseInline)(a,t);return t.hooks?await t.hooks.postprocess(o):o})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer():s?M.lex:M.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let u=(t.hooks?t.hooks.provideParser():s?V.parse:V.parseInline)(l,t);return t.hooks&&(u=t.hooks.postprocess(u)),u}catch(l){return i(l)}}}onError(s,e){return n=>{if(n.message+=`
|
|
59
|
-
Please report this to https://github.com/markedjs/marked.`,s){let r="<p>An error occurred:</p><pre>"+O(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},J=new bn;function w(s,e){return J.parse(s,e)}w.options=w.setOptions=function(s){return J.setOptions(s),w.defaults=J.defaults,je(w.defaults),w};w.getDefaults=ve;w.defaults=Y;w.use=function(...s){return J.use(...s),w.defaults=J.defaults,je(w.defaults),w};w.walkTokens=function(s,e){return J.walkTokens(s,e)};w.parseInline=J.parseInline;w.Parser=V;w.parser=V.parse;w.Renderer=pe;w.TextRenderer=Ae;w.Lexer=M;w.lexer=M.lex;w.Tokenizer=ue;w.Hooks=se;w.parse=w;w.options;w.setOptions;w.use;w.walkTokens;w.parseInline;V.parse;M.lex;const wn={key:0,class:"flex items-center gap-2 text-sm text-muted"},yn={key:1,class:"flex items-center gap-2 text-sm text-muted"},vn={key:2,class:"flex items-center gap-3 flex-wrap"},$n={key:3,class:"flex items-center gap-3 flex-wrap"},Sn={key:4,class:"flex items-center gap-3 flex-wrap"},_n={class:"space-y-4"},zn={key:0,class:"text-sm text-red-600"},Rn=["innerHTML"],Tn={class:"space-y-3"},In={class:"flex items-center justify-end gap-2 w-full"},An=De({__name:"IntegrationCredentials",props:{integrationId:{},integrationType:{},currentVariant:{}},emits:["saved","disconnected"],setup(s,{emit:e}){const n=s,r=e,t=q(null),i=q(!0),l=q(!1),u=q(!1),a=q(null),o=q(void 0),c=gt({}),d=q(!1),h=q(!1),x=q(!1),b=U(()=>(t.value?.variants?.length??0)>1),I=U(()=>(t.value?.variants||[]).map(k=>({label:k.label,value:k.key}))),D=U(()=>t.value?.variants?.find(k=>k.key===o.value)??null),j=U(()=>{const k=D.value?.schema?.properties||{};return Object.entries(k)}),Z=U(()=>{const k=D.value?.hintMarkdown;return k?w.parse(k):""});function N(k){const g=k.toLowerCase();return g.includes("token")||g.includes("key")||g.includes("secret")||g.includes("password")||g.includes("json")}function R(){for(const k of Object.keys(c))delete c[k];x.value=!0}ke(o,()=>{for(const k of Object.keys(c))delete c[k]});async function f(){i.value=!0,l.value=!1;try{const[k,g]=await Promise.all([$fetch(`/api/integrations/${n.integrationId}/credentials-config`),$fetch(`/api/integrations/${n.integrationId}/credentials-status`)]);t.value=k,u.value=!!g?.hasCredentials,a.value=g?.health_status??null,o.value=n.currentVariant||k?.defaultVariant||k?.variants?.[0]?.key||void 0}catch{l.value=!0}finally{i.value=!1}}async function S(){d.value=!0;try{const k={};for(const[L]of j.value){const $=(c[L]||"").trim();$&&(k[L]=$)}o.value&&(k.credentialVariant=o.value);const g=await $fetch(`/api/integrations/${n.integrationId}/credentials`,{method:"POST",body:k});u.value=!0,a.value=g.health_status??"connected",x.value=!1;for(const L of Object.keys(c))delete c[L];r("saved")}finally{d.value=!1}}async function F(){h.value=!0;try{await $fetch(`/api/integrations/${n.integrationId}/credentials`,{method:"DELETE"}),u.value=!1,a.value="disconnected",r("disconnected")}finally{h.value=!1}}return f(),(k,g)=>{const L=oe,$=Oe,Q=vt,G=yt,E=It,ge=ht;return _(),C("div",null,[p(i)?(_(),C("div",wn,[z(L,{name:"i-lucide-loader-2",class:"animate-spin"}),g[3]||(g[3]=A(" Checking connection… ",-1))])):p(t)?.supportsCredentials===!1?(_(),C("div",yn,[z(L,{name:"i-lucide-info"}),g[4]||(g[4]=A(" No credentials required for this integration. ",-1))])):p(a)==="connected"?(_(),C("div",vn,[g[7]||(g[7]=y("div",{class:"flex items-center gap-2 text-sm font-medium text-green-600 dark:text-green-400"},[y("span",{class:"inline-block w-2 h-2 rounded-full bg-green-500"}),A(" Connected ")],-1)),z($,{size:"xs",variant:"soft",color:"neutral",icon:"i-lucide-refresh-cw",onClick:R},{default:T(()=>[...g[5]||(g[5]=[A(" Reconfigure ",-1)])]),_:1}),z($,{size:"xs",variant:"soft",color:"error",icon:"i-lucide-unplug",loading:p(h),onClick:F},{default:T(()=>[...g[6]||(g[6]=[A(" Disconnect ",-1)])]),_:1},8,["loading"])])):p(a)==="invalid_credentials"?(_(),C("div",$n,[g[10]||(g[10]=y("div",{class:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400"},[y("span",{class:"inline-block w-2 h-2 rounded-full bg-red-500"}),A(" Invalid credentials ")],-1)),z($,{size:"sm",icon:"i-lucide-refresh-cw",color:"primary",onClick:R},{default:T(()=>[...g[8]||(g[8]=[A(" Reconfigure ",-1)])]),_:1}),z($,{size:"xs",variant:"soft",color:"error",icon:"i-lucide-unplug",loading:p(h),onClick:F},{default:T(()=>[...g[9]||(g[9]=[A(" Disconnect ",-1)])]),_:1},8,["loading"])])):(_(),C("div",Sn,[g[12]||(g[12]=y("div",{class:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400"},[y("span",{class:"inline-block w-2 h-2 rounded-full bg-red-500"}),A(" Not connected ")],-1)),z($,{size:"sm",icon:"i-lucide-plug",color:"primary",onClick:R},{default:T(()=>[...g[11]||(g[11]=[A(" Connect ",-1)])]),_:1})])),z(ge,{open:p(x),"onUpdate:open":g[2]||(g[2]=B=>xe(x)?x.value=B:null),title:p(u)?"Reconfigure Credentials":"Connect Integration",description:"Enter your credentials to connect this integration."},{body:T(()=>[y("div",_n,[p(l)?(_(),C("div",zn," Failed to load credential schema. Please try again. ")):(_(),C(me,{key:1},[p(b)?(_(),X(G,{key:0,label:"Credential type"},{default:T(()=>[z(Q,{modelValue:p(o),"onUpdate:modelValue":g[0]||(g[0]=B=>xe(o)?o.value=B:null),items:p(I),class:"w-full"},null,8,["modelValue","items"])]),_:1})):K("",!0),p(D)?.hintMarkdown?(_(),C("div",{key:1,class:"hint-markdown text-sm bg-[var(--ui-bg-elevated)] rounded-md px-3 py-2",innerHTML:p(Z)},null,8,Rn)):K("",!0),y("div",Tn,[(_(!0),C(me,null,dt(p(j),([B,le])=>(_(),X(G,{key:B,label:le.title||B,description:le.description},{default:T(()=>[z(E,{modelValue:p(c)[B],"onUpdate:modelValue":v=>p(c)[B]=v,type:N(B)?"password":"text",class:"w-full"},null,8,["modelValue","onUpdate:modelValue","type"])]),_:2},1032,["label","description"]))),128))])],64))])]),footer:T(()=>[y("div",In,[z($,{variant:"ghost",color:"neutral",disabled:p(d),onClick:g[1]||(g[1]=B=>x.value=!1)},{default:T(()=>[...g[13]||(g[13]=[A(" Cancel ",-1)])]),_:1},8,["disabled"]),z($,{loading:p(d),icon:"i-lucide-check",onClick:S},{default:T(()=>[...g[14]||(g[14]=[A(" Save Credentials ",-1)])]),_:1},8,["loading"])])]),_:1},8,["open","title"])])}}}),Cn=Object.assign(ft(An,[["__scopeId","data-v-f235dc98"]]),{__name:"IntegrationCredentials"}),qn={key:0,class:"text-sm text-muted py-8 text-center"},Pn={key:1,class:"py-8 text-center space-y-4"},Bn={class:"flex items-center justify-between gap-4"},Ln={class:"flex items-center gap-3"},En={class:"text-2xl font-semibold"},Mn={class:"text-sm text-muted mt-1"},Vn={class:"border border-[var(--ui-border)] rounded-lg px-4 py-3"},Dn={class:"space-y-3"},On={class:"flex gap-2"},jn={key:0,class:"text-xs text-amber-600 dark:text-amber-400"},Zn={class:"space-y-3"},Fn={class:"sticky bottom-0 py-4 bg-[var(--ui-bg)] border-t border-[var(--ui-border)] -mx-4 px-4 flex items-center justify-between gap-4"},Qn=De({__name:"[id]",async setup(s){let e,n;const t=kt().params.id,{data:i,pending:l,error:u,refresh:a}=([e,n]=mt(()=>$t("/api/integrations","$Dgyl0ZYFMT")),e=await e,n(),e),o=U(()=>i.value?.find(R=>R.id===t)??null),c=q(!0),d=q(null),h=q([]),x=q([]),b=q(null),I=q(!1);function D(){if(!o.value)return;c.value=o.value.enabled!==!1,d.value=o.value.maxScope==="read"?"read":null,x.value=o.value.disabledTools?[...o.value.disabledTools]:[];const R=b.value?.toolsets,f=Array.isArray(R)?R.map(S=>S.key).filter(S=>S!=="__all__"&&S!=="custom"):[];h.value=o.value.enabledToolsets?.length?[...o.value.enabledToolsets]:f}ke(o,()=>D(),{immediate:!0}),ke(()=>b.value?.toolsets,R=>{!o.value||!R?.length||o.value.enabledToolsets?.length||(h.value=R.map(f=>f.key).filter(f=>f!=="__all__"))},{deep:!0});async function j(){if(o.value){I.value=!0;try{const R=o.value.id;await $fetch("/api/integrations",{method:"POST",body:{...o.value,enabled:c.value}});const f=b.value?.toolsets,S=Array.isArray(f)?f.map(k=>k.key).filter(k=>k!=="__all__"&&k!=="custom"):[],F=S.length&&h.value.length<S.length?h.value:[];await $fetch(`/api/integrations/${R}/toolsets`,{method:"POST",body:{enabledToolsets:F}}),await $fetch(`/api/integrations/${R}/permissions`,{method:"POST",body:{maxScope:d.value,disabledTools:x.value.length?x.value:null}}),await a()}finally{I.value=!1}}}async function Z(){o.value&&window.confirm(`Remove "${o.value.label}"? This cannot be undone.`)&&(await $fetch(`/api/integrations/${o.value.id}`,{method:"DELETE"}),wt("/integrations"))}function N(){a()}return(R,f)=>{const S=Oe,F=oe,k=bt,g=St,L=_t,$=Cn,Q=zt,G=xt;return _(),X(G,{class:"py-10 space-y-8 max-w-3xl"},{default:T(()=>[p(l)?(_(),C("div",qn," Loading… ")):p(u)||!p(o)?(_(),C("div",Pn,[f[6]||(f[6]=y("div",{class:"text-sm text-red-600"}," Integration not found. ",-1)),z(S,{to:"/integrations",variant:"soft",color:"neutral",icon:"i-lucide-arrow-left"},{default:T(()=>[...f[5]||(f[5]=[A(" Back to Integrations ",-1)])]),_:1})])):(_(),C(me,{key:2},[y("div",null,[z(k,{to:"/integrations",class:"inline-flex items-center gap-1 text-sm text-muted hover:text-[var(--ui-text)] transition-colors mb-4"},{default:T(()=>[z(F,{name:"i-lucide-arrow-left",class:"w-4 h-4"}),f[7]||(f[7]=A(" Back to Integrations ",-1))]),_:1}),y("div",Bn,[y("div",Ln,[y("h1",En,ie(p(o).label),1),z(g,{size:"sm",color:"neutral",variant:"subtle"},{default:T(()=>[A(ie(p(o).type),1)]),_:1})]),z(L,{modelValue:p(c),"onUpdate:modelValue":f[0]||(f[0]=E=>xe(c)?c.value=E:null),size:"lg"},null,8,["modelValue"])]),y("p",Mn,ie(p(o).type)+" · "+ie(p(o).referenceId),1)]),y("section",null,[f[8]||(f[8]=y("div",{class:"flex items-center justify-between gap-4 mb-1"},[y("h2",{class:"text-lg font-medium"}," Connection ")],-1)),y("div",Vn,[z($,{"integration-id":p(o).id,"integration-type":p(o).type,"current-variant":p(o).credentialVariant,onSaved:N,onDisconnected:N},null,8,["integration-id","integration-type","current-variant"])])]),y("section",Dn,[f[9]||(f[9]=y("h2",{class:"text-lg font-medium"}," Access Level ",-1)),y("div",On,[y("button",{type:"button",class:H(["px-4 py-2 text-sm rounded-lg border transition-colors",p(d)!=="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-[var(--ui-border)] text-muted hover:bg-[var(--ui-bg-elevated)]"]),onClick:f[1]||(f[1]=E=>d.value=null)}," Read + Write ",2),y("button",{type:"button",class:H(["px-4 py-2 text-sm rounded-lg border transition-colors",p(d)==="read"?"border-green-500 bg-green-50 text-green-700 font-medium dark:bg-green-950 dark:text-green-300":"border-[var(--ui-border)] text-muted hover:bg-[var(--ui-bg-elevated)]"]),onClick:f[2]||(f[2]=E=>d.value="read")}," Read-only ",2)]),p(d)==="read"?(_(),C("p",jn," Only read tools will be available. Write and admin tools will be greyed out below. ")):K("",!0)]),y("section",Zn,[f[10]||(f[10]=y("h2",{class:"text-lg font-medium"}," Tools ",-1)),z(Q,{ref_key:"toolsTreeRef",ref:b,"integration-id":p(o).id,"max-scope":p(d),"enabled-toolsets":p(h),"disabled-tools":p(x),"onUpdate:enabledToolsets":f[3]||(f[3]=E=>h.value=E),"onUpdate:disabledTools":f[4]||(f[4]=E=>x.value=E)},null,8,["integration-id","max-scope","enabled-toolsets","disabled-tools"])]),y("div",Fn,[z(S,{loading:p(I),size:"lg",onClick:j},{default:T(()=>[...f[11]||(f[11]=[A(" Save Changes ",-1)])]),_:1},8,["loading"]),z(S,{variant:"soft",color:"error",icon:"i-lucide-trash-2",onClick:Z},{default:T(()=>[...f[12]||(f[12]=[A(" Remove Integration ",-1)])]),_:1})])],64))]),_:1})}}});export{Qn as default};
|