@commandable/mcp 0.1.2 → 0.2.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/{dist/app → .output}/nitro.json +1 -1
- package/{dist/app/public/_nuxt/-tOYwuj2.js → .output/public/_nuxt/B04gGCnx.js} +3 -3
- package/{dist/app/public/_nuxt/D-43HurL.js → .output/public/_nuxt/B2dAlp_u.js} +8 -8
- package/.output/public/_nuxt/Ba0BY0O0.js +1 -0
- package/.output/public/_nuxt/BvFUCPqA.js +1 -0
- package/{dist/app/public/_nuxt/BdctKXor.js → .output/public/_nuxt/Dm_hd4at.js} +1 -1
- package/{dist/app/public/_nuxt/BlP7Uu-5.js → .output/public/_nuxt/S2P9sd4n.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/ee5097c4-b785-4b77-92d6-c16a7396d677.json +1 -0
- package/{dist/app/public/_nuxt/CsbkV5Bd.js → .output/public/_nuxt/d2XTSFt9.js} +1 -1
- package/{dist/app/server/chunks/build/_id_-DBwSV4AY.mjs → .output/server/chunks/build/_id_-Bnxenh08.mjs} +7 -7
- package/{dist/app/server/chunks/build/_id_-DBwSV4AY.mjs.map → .output/server/chunks/build/_id_-Bnxenh08.mjs.map} +1 -1
- package/{dist/app → .output}/server/chunks/build/client.precomputed.mjs +1 -1
- package/{dist/app/server/chunks/build/fetch-ZbqIFhDG.mjs → .output/server/chunks/build/fetch-BmYZnj75.mjs} +58 -6
- package/.output/server/chunks/build/fetch-BmYZnj75.mjs.map +1 -0
- package/{dist/app/server/chunks/build/index-C8flTcKI.mjs → .output/server/chunks/build/index-CL-Gkd-Y.mjs} +4 -4
- package/.output/server/chunks/build/index-CL-Gkd-Y.mjs.map +1 -0
- package/{dist/app → .output}/server/chunks/build/server.mjs +3 -3
- package/{dist/app → .output}/server/chunks/nitro/nitro.mjs +417 -204
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/{dist/app → .output}/server/chunks/routes/api/index.get.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/api/index.post.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-config.get.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-status.get.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.delete.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.post.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/permissions.post.mjs +1 -1
- package/.output/server/chunks/routes/api/integrations/_id/tools.delete.mjs +51 -0
- package/.output/server/chunks/routes/api/integrations/_id/tools.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/integrations/_id/tools.get.mjs +57 -0
- package/.output/server/chunks/routes/api/integrations/_id/tools.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/integrations/_id/toolsets.get.mjs +53 -0
- package/.output/server/chunks/routes/api/integrations/_id/toolsets.get.mjs.map +1 -0
- package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/toolsets.post.mjs +1 -1
- package/.output/server/chunks/routes/api/integrations/_id_.delete.mjs +55 -0
- package/.output/server/chunks/routes/api/integrations/_id_.delete.mjs.map +1 -0
- package/{dist/app → .output}/server/chunks/routes/mcp/create.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/mcp.mjs +1 -1
- package/{dist/app → .output}/server/chunks/routes/renderer.mjs +1 -1
- package/{dist/app → .output}/server/index.mjs +1 -1
- package/{dist/app → .output}/server/package.json +2 -2
- package/LICENSE +17 -6
- package/README.md +32 -32
- package/bin/cli.mjs +552 -0
- package/bin/commandable-mcp.mjs +8 -0
- package/package.json +30 -40
- package/dist/app/public/_nuxt/DU1mG77A.js +0 -1
- package/dist/app/public/_nuxt/builds/latest.json +0 -1
- package/dist/app/public/_nuxt/builds/meta/b13ec2b2-ddd3-4ead-abd4-4fba9dfc0061.json +0 -1
- package/dist/app/public/_nuxt/uS7FY2am.js +0 -1
- package/dist/app/server/chunks/build/fetch-ZbqIFhDG.mjs.map +0 -1
- package/dist/app/server/chunks/build/index-C8flTcKI.mjs.map +0 -1
- package/dist/app/server/chunks/nitro/nitro.mjs.map +0 -1
- package/dist/app/server/chunks/routes/api/integrations/_id_.delete.mjs +0 -44
- package/dist/app/server/chunks/routes/api/integrations/_id_.delete.mjs.map +0 -1
- package/dist/app/server/migrations/pg/0000_initial.sql +0 -74
- package/dist/app/server/migrations/pg/meta/_journal.json +0 -13
- package/dist/app/server/migrations/sqlite/0000_initial.sql +0 -74
- package/dist/app/server/migrations/sqlite/meta/_journal.json +0 -13
- package/dist/cli/bin.d.ts +0 -3
- package/dist/cli/bin.d.ts.map +0 -1
- package/dist/cli/bin.js +0 -7
- package/dist/cli/bin.js.map +0 -1
- package/dist/cli/credentialManager.d.ts +0 -19
- package/dist/cli/credentialManager.d.ts.map +0 -1
- package/dist/cli/credentialManager.js +0 -82
- package/dist/cli/credentialManager.js.map +0 -1
- package/dist/cli/index.d.ts +0 -17
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -818
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/setup.d.ts +0 -3
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js +0 -353
- package/dist/cli/setup.js.map +0 -1
- package/dist/config/configApply.d.ts +0 -16
- package/dist/config/configApply.d.ts.map +0 -1
- package/dist/config/configApply.js +0 -77
- package/dist/config/configApply.js.map +0 -1
- package/dist/config/configLoader.d.ts +0 -9
- package/dist/config/configLoader.d.ts.map +0 -1
- package/dist/config/configLoader.js +0 -75
- package/dist/config/configLoader.js.map +0 -1
- package/dist/config/configSchema.d.ts +0 -45
- package/dist/config/configSchema.d.ts.map +0 -1
- package/dist/config/configSchema.js +0 -23
- package/dist/config/configSchema.js.map +0 -1
- package/dist/crypto/encryption.d.ts +0 -3
- package/dist/crypto/encryption.d.ts.map +0 -1
- package/dist/crypto/encryption.js +0 -29
- package/dist/crypto/encryption.js.map +0 -1
- package/dist/db/client.d.ts +0 -24
- package/dist/db/client.d.ts.map +0 -1
- package/dist/db/client.js +0 -50
- package/dist/db/client.js.map +0 -1
- package/dist/db/credentialStore.d.ts +0 -15
- package/dist/db/credentialStore.d.ts.map +0 -1
- package/dist/db/credentialStore.js +0 -56
- package/dist/db/credentialStore.js.map +0 -1
- package/dist/db/integrationStore.d.ts +0 -12
- package/dist/db/integrationStore.d.ts.map +0 -1
- package/dist/db/integrationStore.js +0 -111
- package/dist/db/integrationStore.js.map +0 -1
- package/dist/db/integrationTypeConfigStore.d.ts +0 -6
- package/dist/db/integrationTypeConfigStore.d.ts.map +0 -1
- package/dist/db/integrationTypeConfigStore.js +0 -94
- package/dist/db/integrationTypeConfigStore.js.map +0 -1
- package/dist/db/migrate.d.ts +0 -3
- package/dist/db/migrate.d.ts.map +0 -1
- package/dist/db/migrate.js +0 -11
- package/dist/db/migrate.js.map +0 -1
- package/dist/db/migrations/pg/0000_initial.sql +0 -74
- package/dist/db/migrations/pg/meta/_journal.json +0 -13
- package/dist/db/migrations/sqlite/0000_initial.sql +0 -74
- package/dist/db/migrations/sqlite/meta/_journal.json +0 -13
- package/dist/db/schema.d.ts +0 -1863
- package/dist/db/schema.d.ts.map +0 -1
- package/dist/db/schema.js +0 -133
- package/dist/db/schema.js.map +0 -1
- package/dist/db/toolDefinitionStore.d.ts +0 -6
- package/dist/db/toolDefinitionStore.d.ts.map +0 -1
- package/dist/db/toolDefinitionStore.js +0 -95
- package/dist/db/toolDefinitionStore.js.map +0 -1
- package/dist/errors/httpError.d.ts +0 -6
- package/dist/errors/httpError.d.ts.map +0 -1
- package/dist/errors/httpError.js +0 -11
- package/dist/errors/httpError.js.map +0 -1
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -32
- package/dist/index.js.map +0 -1
- package/dist/integrations/actionsFactory.d.ts +0 -16
- package/dist/integrations/actionsFactory.d.ts.map +0 -1
- package/dist/integrations/actionsFactory.js +0 -98
- package/dist/integrations/actionsFactory.js.map +0 -1
- package/dist/integrations/catalog.d.ts +0 -8
- package/dist/integrations/catalog.d.ts.map +0 -1
- package/dist/integrations/catalog.js +0 -45
- package/dist/integrations/catalog.js.map +0 -1
- package/dist/integrations/customToolFactory.d.ts +0 -13
- package/dist/integrations/customToolFactory.d.ts.map +0 -1
- package/dist/integrations/customToolFactory.js +0 -31
- package/dist/integrations/customToolFactory.js.map +0 -1
- package/dist/integrations/dataLoader.d.ts +0 -3
- package/dist/integrations/dataLoader.d.ts.map +0 -1
- package/dist/integrations/dataLoader.js +0 -2
- package/dist/integrations/dataLoader.js.map +0 -1
- package/dist/integrations/fileIntegrationTypeConfigStore.d.ts +0 -7
- package/dist/integrations/fileIntegrationTypeConfigStore.d.ts.map +0 -1
- package/dist/integrations/fileIntegrationTypeConfigStore.js +0 -34
- package/dist/integrations/fileIntegrationTypeConfigStore.js.map +0 -1
- package/dist/integrations/getIntegration.d.ts +0 -14
- package/dist/integrations/getIntegration.d.ts.map +0 -1
- package/dist/integrations/getIntegration.js +0 -30
- package/dist/integrations/getIntegration.js.map +0 -1
- package/dist/integrations/googleServiceAccount.d.ts +0 -6
- package/dist/integrations/googleServiceAccount.d.ts.map +0 -1
- package/dist/integrations/googleServiceAccount.js +0 -54
- package/dist/integrations/googleServiceAccount.js.map +0 -1
- package/dist/integrations/health.d.ts +0 -20
- package/dist/integrations/health.d.ts.map +0 -1
- package/dist/integrations/health.js +0 -43
- package/dist/integrations/health.js.map +0 -1
- package/dist/integrations/integrationTypeConfigLookup.d.ts +0 -12
- package/dist/integrations/integrationTypeConfigLookup.d.ts.map +0 -1
- package/dist/integrations/integrationTypeConfigLookup.js +0 -11
- package/dist/integrations/integrationTypeConfigLookup.js.map +0 -1
- package/dist/integrations/providerRegistry.d.ts +0 -2
- package/dist/integrations/providerRegistry.d.ts.map +0 -1
- package/dist/integrations/providerRegistry.js +0 -72
- package/dist/integrations/providerRegistry.js.map +0 -1
- package/dist/integrations/proxy.d.ts +0 -19
- package/dist/integrations/proxy.d.ts.map +0 -1
- package/dist/integrations/proxy.js +0 -377
- package/dist/integrations/proxy.js.map +0 -1
- package/dist/integrations/sandbox.d.ts +0 -8
- package/dist/integrations/sandbox.d.ts.map +0 -1
- package/dist/integrations/sandbox.js +0 -221
- package/dist/integrations/sandbox.js.map +0 -1
- package/dist/integrations/sandboxUtils.d.ts +0 -15
- package/dist/integrations/sandboxUtils.d.ts.map +0 -1
- package/dist/integrations/sandboxUtils.js +0 -489
- package/dist/integrations/sandboxUtils.js.map +0 -1
- package/dist/integrations/tools.d.ts +0 -3
- package/dist/integrations/tools.d.ts.map +0 -1
- package/dist/integrations/tools.js +0 -70
- package/dist/integrations/tools.js.map +0 -1
- package/dist/mcp/abilityCatalog.d.ts +0 -46
- package/dist/mcp/abilityCatalog.d.ts.map +0 -1
- package/dist/mcp/abilityCatalog.js +0 -275
- package/dist/mcp/abilityCatalog.js.map +0 -1
- package/dist/mcp/auth.d.ts +0 -18
- package/dist/mcp/auth.d.ts.map +0 -1
- package/dist/mcp/auth.js +0 -45
- package/dist/mcp/auth.js.map +0 -1
- package/dist/mcp/builder_guide.md +0 -441
- package/dist/mcp/commandable_readme.md +0 -29
- package/dist/mcp/handlers.d.ts +0 -21
- package/dist/mcp/handlers.d.ts.map +0 -1
- package/dist/mcp/handlers.js +0 -86
- package/dist/mcp/handlers.js.map +0 -1
- package/dist/mcp/metaTools.d.ts +0 -77
- package/dist/mcp/metaTools.d.ts.map +0 -1
- package/dist/mcp/metaTools.js +0 -753
- package/dist/mcp/metaTools.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -25
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -14
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/sessionState.d.ts +0 -18
- package/dist/mcp/sessionState.d.ts.map +0 -1
- package/dist/mcp/sessionState.js +0 -65
- package/dist/mcp/sessionState.js.map +0 -1
- package/dist/mcp/toolAdapter.d.ts +0 -34
- package/dist/mcp/toolAdapter.d.ts.map +0 -1
- package/dist/mcp/toolAdapter.js +0 -24
- package/dist/mcp/toolAdapter.js.map +0 -1
- package/dist/types.d.ts +0 -92
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -7
- package/dist/version.js.map +0 -1
- /package/{dist/app → .output}/public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2 +0 -0
- /package/{dist/app → .output}/public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2 +0 -0
- /package/{dist/app → .output}/public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2 +0 -0
- /package/{dist/app → .output}/public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2 +0 -0
- /package/{dist/app → .output}/public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2 +0 -0
- /package/{dist/app → .output}/public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2 +0 -0
- /package/{dist/app → .output}/public/_nuxt/_id_.BKAjWkoP.css +0 -0
- /package/{dist/app → .output}/public/_nuxt/entry.Y3mA4bzA.css +0 -0
- /package/{dist/app → .output}/public/_nuxt/error-404.C7fg894-.css +0 -0
- /package/{dist/app → .output}/public/_nuxt/error-500.DjUK_N2Y.css +0 -0
- /package/{dist/app → .output}/public/favicon.ico +0 -0
- /package/{dist/app → .output}/server/chunks/_/error-500.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/_/error-500.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/_/icons.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/_/icons.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/_/icons2.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/_/icons2.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/IntegrationCredentials-styles.CULcCK6_.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/IntegrationCredentials-styles.CULcCK6_.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/client.precomputed.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-404-D2QibUBT.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-404-D2QibUBT.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-404-styles.Bvxdxqjk.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-404-styles.Bvxdxqjk.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-500-DYvawybF.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-500-DYvawybF.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-500-styles.BnYAAXSg.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/error-500-styles.BnYAAXSg.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/index-5H-nmhph.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/index-5H-nmhph.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/server.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/build/styles.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/build/styles.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/_commandable/status.get.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/_commandable/status.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/tools.get.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/tools.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/toolsets.get.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/catalog/_type/toolsets.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/catalog.get.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/catalog.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/index.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/index.post.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-config.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials-status.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.delete.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/credentials.post.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/permissions.post.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/api/integrations/_id/toolsets.post.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/health.get.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/routes/health.get.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/mcp/create.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/mcp.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/routes/renderer.mjs.map +0 -0
- /package/{dist/app → .output}/server/chunks/virtual/_virtual_spa-template.mjs +0 -0
- /package/{dist/app → .output}/server/chunks/virtual/_virtual_spa-template.mjs.map +0 -0
- /package/{dist/app → .output}/server/index.mjs.map +0 -0
|
@@ -4428,7 +4428,7 @@ function _expandFromEnv(value) {
|
|
|
4428
4428
|
const _inlineRuntimeConfig = {
|
|
4429
4429
|
"app": {
|
|
4430
4430
|
"baseURL": "/",
|
|
4431
|
-
"buildId": "
|
|
4431
|
+
"buildId": "ee5097c4-b785-4b77-92d6-c16a7396d677",
|
|
4432
4432
|
"buildAssetsDir": "/_nuxt/",
|
|
4433
4433
|
"cdnURL": ""
|
|
4434
4434
|
},
|
|
@@ -6570,6 +6570,10 @@ function rowToIntegrationTypeConfig(r) {
|
|
|
6570
6570
|
updatedAt: r.updatedAt instanceof Date ? r.updatedAt : r.updatedAt ? new Date(r.updatedAt) : void 0
|
|
6571
6571
|
};
|
|
6572
6572
|
}
|
|
6573
|
+
async function listIntegrationTypeConfigs(client, spaceId) {
|
|
6574
|
+
const rows = await db$2(client).select().from(t$2(client)).where(eq(t$2(client).spaceId, spaceId));
|
|
6575
|
+
return rows.map(rowToIntegrationTypeConfig);
|
|
6576
|
+
}
|
|
6573
6577
|
async function getIntegrationTypeConfig(client, spaceId, typeSlug) {
|
|
6574
6578
|
const table = t$2(client);
|
|
6575
6579
|
const rows = await db$2(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.typeSlug, typeSlug))).limit(1);
|
|
@@ -6590,7 +6594,7 @@ async function upsertIntegrationTypeConfig(client, cfg) {
|
|
|
6590
6594
|
createdAt: now,
|
|
6591
6595
|
updatedAt: now
|
|
6592
6596
|
}).onConflictDoUpdate({
|
|
6593
|
-
target: table.
|
|
6597
|
+
target: [table.spaceId, table.typeSlug],
|
|
6594
6598
|
set: {
|
|
6595
6599
|
typeSlug: cfg.typeSlug,
|
|
6596
6600
|
label: cfg.label,
|
|
@@ -6600,6 +6604,12 @@ async function upsertIntegrationTypeConfig(client, cfg) {
|
|
|
6600
6604
|
}
|
|
6601
6605
|
});
|
|
6602
6606
|
}
|
|
6607
|
+
async function deleteIntegrationTypeConfig(client, spaceId, typeSlug) {
|
|
6608
|
+
var _a, _b;
|
|
6609
|
+
const table = t$2(client);
|
|
6610
|
+
const result = await db$2(client).delete(table).where(and(eq(table.spaceId, spaceId), eq(table.typeSlug, typeSlug)));
|
|
6611
|
+
return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
|
|
6612
|
+
}
|
|
6603
6613
|
|
|
6604
6614
|
async function checkIntegrationHealth(params) {
|
|
6605
6615
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -6742,33 +6752,39 @@ function parseJson$1(raw) {
|
|
|
6742
6752
|
}
|
|
6743
6753
|
return raw;
|
|
6744
6754
|
}
|
|
6755
|
+
function rowToIntegrationData(r) {
|
|
6756
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6757
|
+
const healthCheckedAt = r.healthCheckedAt ? r.healthCheckedAt instanceof Date ? r.healthCheckedAt : new Date(r.healthCheckedAt) : null;
|
|
6758
|
+
return {
|
|
6759
|
+
id: r.id,
|
|
6760
|
+
spaceId: (_a = r.spaceId) != null ? _a : void 0,
|
|
6761
|
+
type: r.type,
|
|
6762
|
+
referenceId: r.referenceId,
|
|
6763
|
+
label: r.label,
|
|
6764
|
+
enabled: r.enabled === 0 ? false : true,
|
|
6765
|
+
connectionMethod: (_b = r.connectionMethod) != null ? _b : void 0,
|
|
6766
|
+
connectionId: (_c = r.connectionId) != null ? _c : void 0,
|
|
6767
|
+
credentialId: (_d = r.credentialId) != null ? _d : void 0,
|
|
6768
|
+
credentialVariant: (_e = r.credentialVariant) != null ? _e : void 0,
|
|
6769
|
+
enabledToolsets: parseJson$1(r.enabledToolsets),
|
|
6770
|
+
maxScope: (_f = r.maxScope) != null ? _f : void 0,
|
|
6771
|
+
disabledTools: parseJson$1(r.disabledTools),
|
|
6772
|
+
healthStatus: (_g = r.healthStatus) != null ? _g : null,
|
|
6773
|
+
healthCheckedAt
|
|
6774
|
+
};
|
|
6775
|
+
}
|
|
6745
6776
|
async function listIntegrations(client, spaceId) {
|
|
6746
6777
|
const table = t$1(client);
|
|
6747
6778
|
let query = db$1(client).select().from(table);
|
|
6748
6779
|
if (spaceId)
|
|
6749
6780
|
query = query.where(eq(table.spaceId, spaceId));
|
|
6750
6781
|
const rows = await query;
|
|
6751
|
-
return rows.map(
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
type: r.type,
|
|
6758
|
-
referenceId: r.referenceId,
|
|
6759
|
-
label: r.label,
|
|
6760
|
-
enabled: r.enabled === 0 ? false : true,
|
|
6761
|
-
connectionMethod: (_b = r.connectionMethod) != null ? _b : void 0,
|
|
6762
|
-
connectionId: (_c = r.connectionId) != null ? _c : void 0,
|
|
6763
|
-
credentialId: (_d = r.credentialId) != null ? _d : void 0,
|
|
6764
|
-
credentialVariant: (_e = r.credentialVariant) != null ? _e : void 0,
|
|
6765
|
-
enabledToolsets: parseJson$1(r.enabledToolsets),
|
|
6766
|
-
maxScope: (_f = r.maxScope) != null ? _f : void 0,
|
|
6767
|
-
disabledTools: parseJson$1(r.disabledTools),
|
|
6768
|
-
healthStatus: (_g = r.healthStatus) != null ? _g : null,
|
|
6769
|
-
healthCheckedAt
|
|
6770
|
-
};
|
|
6771
|
-
});
|
|
6782
|
+
return rows.map(rowToIntegrationData);
|
|
6783
|
+
}
|
|
6784
|
+
async function getIntegrationById(client, id) {
|
|
6785
|
+
const table = t$1(client);
|
|
6786
|
+
const rows = await db$1(client).select().from(table).where(eq(table.id, id)).limit(1);
|
|
6787
|
+
return rows[0] ? rowToIntegrationData(rows[0]) : null;
|
|
6772
6788
|
}
|
|
6773
6789
|
async function upsertIntegration(client, integration) {
|
|
6774
6790
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
@@ -6808,6 +6824,12 @@ async function upsertIntegration(client, integration) {
|
|
|
6808
6824
|
}
|
|
6809
6825
|
});
|
|
6810
6826
|
}
|
|
6827
|
+
async function deleteIntegrationById(client, id) {
|
|
6828
|
+
var _a, _b;
|
|
6829
|
+
const table = t$1(client);
|
|
6830
|
+
const result = await db$1(client).delete(table).where(eq(table.id, id));
|
|
6831
|
+
return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
|
|
6832
|
+
}
|
|
6811
6833
|
async function updateIntegrationCredentials(client, integrationId, fields) {
|
|
6812
6834
|
var _a, _b, _c;
|
|
6813
6835
|
const table = t$1(client);
|
|
@@ -6822,6 +6844,108 @@ async function updateIntegrationHealth(client, integrationId, healthStatus, chec
|
|
|
6822
6844
|
await db$1(client).update(table).set({ healthStatus, healthCheckedAt: checkedAt != null ? checkedAt : /* @__PURE__ */ new Date() }).where(and(eq(table.id, integrationId)));
|
|
6823
6845
|
}
|
|
6824
6846
|
|
|
6847
|
+
function t(client) {
|
|
6848
|
+
return client.dialect === "sqlite" ? sqliteToolDefinitions : pgToolDefinitions;
|
|
6849
|
+
}
|
|
6850
|
+
function db(client) {
|
|
6851
|
+
return client.db;
|
|
6852
|
+
}
|
|
6853
|
+
function normalizeScope(raw) {
|
|
6854
|
+
const s = String(raw || "").toLowerCase().trim();
|
|
6855
|
+
if (s === "read" || s === "write" || s === "admin")
|
|
6856
|
+
return s;
|
|
6857
|
+
return "write";
|
|
6858
|
+
}
|
|
6859
|
+
function parseJson(raw) {
|
|
6860
|
+
if (raw == null)
|
|
6861
|
+
return null;
|
|
6862
|
+
if (typeof raw === "string") {
|
|
6863
|
+
try {
|
|
6864
|
+
return JSON.parse(raw);
|
|
6865
|
+
} catch {
|
|
6866
|
+
return null;
|
|
6867
|
+
}
|
|
6868
|
+
}
|
|
6869
|
+
return raw;
|
|
6870
|
+
}
|
|
6871
|
+
function rowToToolDefinition(r) {
|
|
6872
|
+
var _a;
|
|
6873
|
+
return {
|
|
6874
|
+
id: r.id,
|
|
6875
|
+
spaceId: r.spaceId,
|
|
6876
|
+
integrationId: r.integrationId,
|
|
6877
|
+
name: r.name,
|
|
6878
|
+
displayName: (_a = r.displayName) != null ? _a : null,
|
|
6879
|
+
description: r.description,
|
|
6880
|
+
scope: normalizeScope(r.scope),
|
|
6881
|
+
inputSchema: parseJson(r.inputSchemaJson) || { type: "object", additionalProperties: true },
|
|
6882
|
+
handlerCode: r.handlerCode,
|
|
6883
|
+
utils: parseJson(r.utilsJson),
|
|
6884
|
+
createdAt: r.createdAt instanceof Date ? r.createdAt : r.createdAt ? new Date(r.createdAt) : void 0,
|
|
6885
|
+
updatedAt: r.updatedAt instanceof Date ? r.updatedAt : r.updatedAt ? new Date(r.updatedAt) : void 0
|
|
6886
|
+
};
|
|
6887
|
+
}
|
|
6888
|
+
async function listToolDefinitions(client, spaceId) {
|
|
6889
|
+
const rows = await db(client).select().from(t(client)).where(eq(t(client).spaceId, spaceId));
|
|
6890
|
+
return rows.map(rowToToolDefinition);
|
|
6891
|
+
}
|
|
6892
|
+
async function listToolDefinitionsForIntegration(client, spaceId, integrationId) {
|
|
6893
|
+
const table = t(client);
|
|
6894
|
+
const rows = await db(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId)));
|
|
6895
|
+
return rows.map(rowToToolDefinition);
|
|
6896
|
+
}
|
|
6897
|
+
async function getToolDefinitionByName(client, spaceId, integrationId, name) {
|
|
6898
|
+
const table = t(client);
|
|
6899
|
+
const rows = await db(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId), eq(table.name, name))).limit(1);
|
|
6900
|
+
return rows[0] ? rowToToolDefinition(rows[0]) : null;
|
|
6901
|
+
}
|
|
6902
|
+
async function upsertToolDefinition(client, tool) {
|
|
6903
|
+
var _a, _b, _c, _d, _e;
|
|
6904
|
+
const table = t(client);
|
|
6905
|
+
const now = /* @__PURE__ */ new Date();
|
|
6906
|
+
const schemaValue = client.dialect === "sqlite" ? JSON.stringify((_a = tool.inputSchema) != null ? _a : {}) : (_b = tool.inputSchema) != null ? _b : {};
|
|
6907
|
+
const utilsValue = ((_c = tool.utils) == null ? void 0 : _c.length) ? client.dialect === "sqlite" ? JSON.stringify(tool.utils) : tool.utils : null;
|
|
6908
|
+
await db(client).insert(table).values({
|
|
6909
|
+
id: tool.id,
|
|
6910
|
+
spaceId: tool.spaceId,
|
|
6911
|
+
integrationId: tool.integrationId,
|
|
6912
|
+
name: tool.name,
|
|
6913
|
+
displayName: (_d = tool.displayName) != null ? _d : null,
|
|
6914
|
+
description: tool.description,
|
|
6915
|
+
scope: tool.scope,
|
|
6916
|
+
inputSchemaJson: schemaValue,
|
|
6917
|
+
handlerCode: tool.handlerCode,
|
|
6918
|
+
utilsJson: utilsValue,
|
|
6919
|
+
createdAt: now,
|
|
6920
|
+
updatedAt: now
|
|
6921
|
+
}).onConflictDoUpdate({
|
|
6922
|
+
target: [table.spaceId, table.integrationId, table.name],
|
|
6923
|
+
set: {
|
|
6924
|
+
integrationId: tool.integrationId,
|
|
6925
|
+
name: tool.name,
|
|
6926
|
+
displayName: (_e = tool.displayName) != null ? _e : null,
|
|
6927
|
+
description: tool.description,
|
|
6928
|
+
scope: tool.scope,
|
|
6929
|
+
inputSchemaJson: schemaValue,
|
|
6930
|
+
handlerCode: tool.handlerCode,
|
|
6931
|
+
utilsJson: utilsValue,
|
|
6932
|
+
updatedAt: now
|
|
6933
|
+
}
|
|
6934
|
+
});
|
|
6935
|
+
}
|
|
6936
|
+
async function deleteToolDefinitionByName(client, spaceId, integrationId, name) {
|
|
6937
|
+
var _a, _b;
|
|
6938
|
+
const table = t(client);
|
|
6939
|
+
const result = await db(client).delete(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId), eq(table.name, name)));
|
|
6940
|
+
return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
|
|
6941
|
+
}
|
|
6942
|
+
async function deleteToolDefinitionsForIntegration(client, spaceId, integrationId) {
|
|
6943
|
+
var _a, _b;
|
|
6944
|
+
const table = t(client);
|
|
6945
|
+
const result = await db(client).delete(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId)));
|
|
6946
|
+
return Number((_b = (_a = result == null ? void 0 : result.rowsAffected) != null ? _a : result == null ? void 0 : result.rowCount) != null ? _b : 0);
|
|
6947
|
+
}
|
|
6948
|
+
|
|
6825
6949
|
function buildMcpToolIndex(params) {
|
|
6826
6950
|
const toolsByIntegration = buildToolsByIntegration(params.spaceId, params.integrations, params.proxy, {
|
|
6827
6951
|
integrationsRef: params.integrationsRef,
|
|
@@ -6862,8 +6986,10 @@ const BUILDER_ABILITY_ID = "commandable__builder";
|
|
|
6862
6986
|
const BUILDER_TOOL_NAMES = [
|
|
6863
6987
|
"commandable_list_prebuilt_integrations",
|
|
6864
6988
|
"commandable_add_prebuilt_integration",
|
|
6865
|
-
"
|
|
6866
|
-
"
|
|
6989
|
+
"commandable_upsert_custom_integration",
|
|
6990
|
+
"commandable_upsert_custom_tool",
|
|
6991
|
+
"commandable_delete_custom_tool",
|
|
6992
|
+
"commandable_delete_custom_integration",
|
|
6867
6993
|
"commandable_test_custom_tool"
|
|
6868
6994
|
];
|
|
6869
6995
|
function makeAbilityId(integ, toolsetKey) {
|
|
@@ -6966,6 +7092,29 @@ class AbilityCatalog {
|
|
|
6966
7092
|
this.byId.set(created.id, created);
|
|
6967
7093
|
return created;
|
|
6968
7094
|
}
|
|
7095
|
+
removeCustomTool(params) {
|
|
7096
|
+
const abilityId = makeAbilityId(params.integration, "custom");
|
|
7097
|
+
const existing = this.byId.get(abilityId);
|
|
7098
|
+
if (!existing)
|
|
7099
|
+
return false;
|
|
7100
|
+
const before = existing.toolNames.length;
|
|
7101
|
+
existing.toolNames = existing.toolNames.filter((name) => name !== params.toolName);
|
|
7102
|
+
if (!existing.toolNames.length) {
|
|
7103
|
+
this.byId.delete(abilityId);
|
|
7104
|
+
this.abilities = this.abilities.filter((a) => a.id !== abilityId);
|
|
7105
|
+
}
|
|
7106
|
+
return existing.toolNames.length !== before;
|
|
7107
|
+
}
|
|
7108
|
+
removeIntegrationAbilities(integration) {
|
|
7109
|
+
const suffix = `__n${shortNodeId(integration.id)}`;
|
|
7110
|
+
const removed = this.abilities.filter((a) => a.id.endsWith(suffix)).map((a) => a.id);
|
|
7111
|
+
if (!removed.length)
|
|
7112
|
+
return 0;
|
|
7113
|
+
for (const id of removed)
|
|
7114
|
+
this.byId.delete(id);
|
|
7115
|
+
this.abilities = this.abilities.filter((a) => !removed.includes(a.id));
|
|
7116
|
+
return removed.length;
|
|
7117
|
+
}
|
|
6969
7118
|
getToolDefinitions(toolNames) {
|
|
6970
7119
|
const out = [];
|
|
6971
7120
|
for (const n of toolNames) {
|
|
@@ -7112,87 +7261,6 @@ class AbilityCatalog {
|
|
|
7112
7261
|
}
|
|
7113
7262
|
}
|
|
7114
7263
|
|
|
7115
|
-
function t(client) {
|
|
7116
|
-
return client.dialect === "sqlite" ? sqliteToolDefinitions : pgToolDefinitions;
|
|
7117
|
-
}
|
|
7118
|
-
function db(client) {
|
|
7119
|
-
return client.db;
|
|
7120
|
-
}
|
|
7121
|
-
function normalizeScope(raw) {
|
|
7122
|
-
const s = String(raw || "").toLowerCase().trim();
|
|
7123
|
-
if (s === "read" || s === "write" || s === "admin")
|
|
7124
|
-
return s;
|
|
7125
|
-
return "write";
|
|
7126
|
-
}
|
|
7127
|
-
function parseJson(raw) {
|
|
7128
|
-
if (raw == null)
|
|
7129
|
-
return null;
|
|
7130
|
-
if (typeof raw === "string") {
|
|
7131
|
-
try {
|
|
7132
|
-
return JSON.parse(raw);
|
|
7133
|
-
} catch {
|
|
7134
|
-
return null;
|
|
7135
|
-
}
|
|
7136
|
-
}
|
|
7137
|
-
return raw;
|
|
7138
|
-
}
|
|
7139
|
-
function rowToToolDefinition(r) {
|
|
7140
|
-
var _a;
|
|
7141
|
-
return {
|
|
7142
|
-
id: r.id,
|
|
7143
|
-
spaceId: r.spaceId,
|
|
7144
|
-
integrationId: r.integrationId,
|
|
7145
|
-
name: r.name,
|
|
7146
|
-
displayName: (_a = r.displayName) != null ? _a : null,
|
|
7147
|
-
description: r.description,
|
|
7148
|
-
scope: normalizeScope(r.scope),
|
|
7149
|
-
inputSchema: parseJson(r.inputSchemaJson) || { type: "object", additionalProperties: true },
|
|
7150
|
-
handlerCode: r.handlerCode,
|
|
7151
|
-
utils: parseJson(r.utilsJson),
|
|
7152
|
-
createdAt: r.createdAt instanceof Date ? r.createdAt : r.createdAt ? new Date(r.createdAt) : void 0,
|
|
7153
|
-
updatedAt: r.updatedAt instanceof Date ? r.updatedAt : r.updatedAt ? new Date(r.updatedAt) : void 0
|
|
7154
|
-
};
|
|
7155
|
-
}
|
|
7156
|
-
async function getToolDefinitionByName(client, spaceId, integrationId, name) {
|
|
7157
|
-
const table = t(client);
|
|
7158
|
-
const rows = await db(client).select().from(table).where(and(eq(table.spaceId, spaceId), eq(table.integrationId, integrationId), eq(table.name, name))).limit(1);
|
|
7159
|
-
return rows[0] ? rowToToolDefinition(rows[0]) : null;
|
|
7160
|
-
}
|
|
7161
|
-
async function upsertToolDefinition(client, tool) {
|
|
7162
|
-
var _a, _b, _c, _d, _e;
|
|
7163
|
-
const table = t(client);
|
|
7164
|
-
const now = /* @__PURE__ */ new Date();
|
|
7165
|
-
const schemaValue = client.dialect === "sqlite" ? JSON.stringify((_a = tool.inputSchema) != null ? _a : {}) : (_b = tool.inputSchema) != null ? _b : {};
|
|
7166
|
-
const utilsValue = ((_c = tool.utils) == null ? void 0 : _c.length) ? client.dialect === "sqlite" ? JSON.stringify(tool.utils) : tool.utils : null;
|
|
7167
|
-
await db(client).insert(table).values({
|
|
7168
|
-
id: tool.id,
|
|
7169
|
-
spaceId: tool.spaceId,
|
|
7170
|
-
integrationId: tool.integrationId,
|
|
7171
|
-
name: tool.name,
|
|
7172
|
-
displayName: (_d = tool.displayName) != null ? _d : null,
|
|
7173
|
-
description: tool.description,
|
|
7174
|
-
scope: tool.scope,
|
|
7175
|
-
inputSchemaJson: schemaValue,
|
|
7176
|
-
handlerCode: tool.handlerCode,
|
|
7177
|
-
utilsJson: utilsValue,
|
|
7178
|
-
createdAt: now,
|
|
7179
|
-
updatedAt: now
|
|
7180
|
-
}).onConflictDoUpdate({
|
|
7181
|
-
target: table.id,
|
|
7182
|
-
set: {
|
|
7183
|
-
integrationId: tool.integrationId,
|
|
7184
|
-
name: tool.name,
|
|
7185
|
-
displayName: (_e = tool.displayName) != null ? _e : null,
|
|
7186
|
-
description: tool.description,
|
|
7187
|
-
scope: tool.scope,
|
|
7188
|
-
inputSchemaJson: schemaValue,
|
|
7189
|
-
handlerCode: tool.handlerCode,
|
|
7190
|
-
utilsJson: utilsValue,
|
|
7191
|
-
updatedAt: now
|
|
7192
|
-
}
|
|
7193
|
-
});
|
|
7194
|
-
}
|
|
7195
|
-
|
|
7196
7264
|
function humanize(s) {
|
|
7197
7265
|
return (s || "").replace(/_/g, " ").split(/\s+/g).filter(Boolean).map((w) => w.length ? `${w[0].toUpperCase()}${w.slice(1).toLowerCase()}` : w).join(" ");
|
|
7198
7266
|
}
|
|
@@ -7227,8 +7295,10 @@ const META_TOOL_NAMES = {
|
|
|
7227
7295
|
disableToolset: "commandable_disable_toolset",
|
|
7228
7296
|
listPrebuiltIntegrations: "commandable_list_prebuilt_integrations",
|
|
7229
7297
|
addPrebuiltIntegration: "commandable_add_prebuilt_integration",
|
|
7230
|
-
|
|
7231
|
-
|
|
7298
|
+
upsertCustomIntegration: "commandable_upsert_custom_integration",
|
|
7299
|
+
upsertCustomTool: "commandable_upsert_custom_tool",
|
|
7300
|
+
deleteCustomIntegration: "commandable_delete_custom_integration",
|
|
7301
|
+
deleteCustomTool: "commandable_delete_custom_tool",
|
|
7232
7302
|
testCustomTool: "commandable_test_custom_tool"
|
|
7233
7303
|
};
|
|
7234
7304
|
function normalizeHintMarkdown(value) {
|
|
@@ -7306,7 +7376,7 @@ function getMetaToolDefinitions() {
|
|
|
7306
7376
|
];
|
|
7307
7377
|
}
|
|
7308
7378
|
async function handleMetaToolCall(params) {
|
|
7309
|
-
var _a, _b, _c, _d, _e;
|
|
7379
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
7310
7380
|
const { name, args, sessionId, catalog, sessionState, ctx } = params;
|
|
7311
7381
|
if (name === META_TOOL_NAMES.readme) {
|
|
7312
7382
|
return { handled: true, listChanged: false, result: { markdown: buildCommandableReadme() } };
|
|
@@ -7554,14 +7624,15 @@ ${lines ? `${lines}
|
|
|
7554
7624
|
}
|
|
7555
7625
|
};
|
|
7556
7626
|
}
|
|
7557
|
-
if (name === META_TOOL_NAMES.
|
|
7558
|
-
requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.
|
|
7627
|
+
if (name === META_TOOL_NAMES.upsertCustomIntegration) {
|
|
7628
|
+
requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.upsertCustomIntegration);
|
|
7559
7629
|
if (!ctx)
|
|
7560
7630
|
throw new Error("Integration management is not available in this server mode.");
|
|
7561
7631
|
if (!ctx.integrationsRef)
|
|
7562
7632
|
throw new Error("integrationsRef is required for builder mode.");
|
|
7563
7633
|
if (!ctx.integrationTypeConfigsRef)
|
|
7564
7634
|
throw new Error("integrationTypeConfigsRef is required for custom integrations.");
|
|
7635
|
+
const typeSlugInput = typeof (args == null ? void 0 : args.type_slug) === "string" ? args.type_slug.trim() : "";
|
|
7565
7636
|
const label = String((args == null ? void 0 : args.label) || "").trim();
|
|
7566
7637
|
const baseUrl = String((args == null ? void 0 : args.base_url) || "").trim();
|
|
7567
7638
|
const authType = (args == null ? void 0 : args.auth_type) === "basic" || (args == null ? void 0 : args.auth_type) === "custom" ? String(args.auth_type) : null;
|
|
@@ -7606,16 +7677,21 @@ ${lines ? `${lines}
|
|
|
7606
7677
|
const toKebab = (s) => (s || "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32) || "integration";
|
|
7607
7678
|
const suffix = () => crypto.randomBytes(2).toString("hex");
|
|
7608
7679
|
const existingSlugs = new Set(ctx.integrationTypeConfigsRef.current.filter((c) => c.spaceId === ctx.spaceId).map((c) => c.typeSlug));
|
|
7609
|
-
let typeSlug =
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7680
|
+
let typeSlug = typeSlugInput;
|
|
7681
|
+
if (!typeSlug) {
|
|
7682
|
+
for (let i = 0; i < 20; i++) {
|
|
7683
|
+
const candidate = `${toKebab(label)}-${suffix()}`;
|
|
7684
|
+
if (!existingSlugs.has(candidate)) {
|
|
7685
|
+
typeSlug = candidate;
|
|
7686
|
+
break;
|
|
7687
|
+
}
|
|
7615
7688
|
}
|
|
7689
|
+
if (!typeSlug)
|
|
7690
|
+
throw new Error("Failed to generate a unique type slug");
|
|
7616
7691
|
}
|
|
7617
|
-
|
|
7618
|
-
|
|
7692
|
+
const existingCfg = typeSlugInput ? await getIntegrationTypeConfig(ctx.db, ctx.spaceId, typeSlugInput) : null;
|
|
7693
|
+
if (typeSlugInput && !existingCfg)
|
|
7694
|
+
throw new Error(`Unknown type_slug: ${typeSlugInput}`);
|
|
7619
7695
|
const schemaProps = {};
|
|
7620
7696
|
const required = [];
|
|
7621
7697
|
for (const f of credentialFields) {
|
|
@@ -7642,7 +7718,7 @@ ${lines ? `${lines}
|
|
|
7642
7718
|
additionalProperties: false
|
|
7643
7719
|
});
|
|
7644
7720
|
const id = crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex");
|
|
7645
|
-
const cfgId = crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex");
|
|
7721
|
+
const cfgId = (existingCfg == null ? void 0 : existingCfg.id) || (crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex"));
|
|
7646
7722
|
const defaultVariantConfig = {
|
|
7647
7723
|
label,
|
|
7648
7724
|
credentialSchema,
|
|
@@ -7660,10 +7736,21 @@ ${lines ? `${lines}
|
|
|
7660
7736
|
variants: { default: defaultVariantConfig }
|
|
7661
7737
|
};
|
|
7662
7738
|
await upsertIntegrationTypeConfig(ctx.db, customCfg);
|
|
7663
|
-
ctx.integrationTypeConfigsRef.current.
|
|
7739
|
+
const cfgIndex = ctx.integrationTypeConfigsRef.current.findIndex((c) => c.spaceId === ctx.spaceId && c.typeSlug === typeSlug);
|
|
7740
|
+
if (cfgIndex >= 0)
|
|
7741
|
+
ctx.integrationTypeConfigsRef.current[cfgIndex] = customCfg;
|
|
7742
|
+
else
|
|
7743
|
+
ctx.integrationTypeConfigsRef.current.push(customCfg);
|
|
7744
|
+
const existingIntegration = ctx.integrationsRef.current.find((i) => i.type === typeSlug);
|
|
7745
|
+
const created = !existingIntegration;
|
|
7664
7746
|
const shortId = id.replace(/[^a-z0-9]/gi, "").slice(0, 8).toLowerCase();
|
|
7665
|
-
const referenceId = `${typeSlug}-${shortId}`;
|
|
7666
|
-
const integration = {
|
|
7747
|
+
const referenceId = (existingIntegration == null ? void 0 : existingIntegration.referenceId) || `${typeSlug}-${shortId}`;
|
|
7748
|
+
const integration = existingIntegration ? {
|
|
7749
|
+
...existingIntegration,
|
|
7750
|
+
spaceId: ctx.spaceId,
|
|
7751
|
+
type: typeSlug,
|
|
7752
|
+
label
|
|
7753
|
+
} : {
|
|
7667
7754
|
spaceId: ctx.spaceId,
|
|
7668
7755
|
id,
|
|
7669
7756
|
type: typeSlug,
|
|
@@ -7680,22 +7767,23 @@ ${lines ? `${lines}
|
|
|
7680
7767
|
}
|
|
7681
7768
|
const base = ctx.credentialSetupBaseUrl ? ctx.credentialSetupBaseUrl.replace(/\/+$/, "") : null;
|
|
7682
7769
|
const managementUrl = base ? `${base}/integrations` : null;
|
|
7683
|
-
const credentialUrl = base ? `${base}/integrations/${encodeURIComponent(id)}` : null;
|
|
7770
|
+
const credentialUrl = base ? `${base}/integrations/${encodeURIComponent(integration.id)}` : null;
|
|
7684
7771
|
return {
|
|
7685
7772
|
handled: true,
|
|
7686
7773
|
listChanged: false,
|
|
7687
7774
|
result: {
|
|
7688
|
-
created: true,
|
|
7689
7775
|
integration: {
|
|
7690
|
-
id,
|
|
7776
|
+
id: integration.id,
|
|
7691
7777
|
type: typeSlug,
|
|
7692
7778
|
label,
|
|
7693
|
-
reference_id: referenceId,
|
|
7779
|
+
reference_id: integration.referenceId,
|
|
7694
7780
|
auth_type: authType
|
|
7695
7781
|
},
|
|
7782
|
+
upserted: true,
|
|
7783
|
+
created,
|
|
7696
7784
|
management_url: managementUrl,
|
|
7697
7785
|
credential_url: credentialUrl,
|
|
7698
|
-
next_steps: credentialUrl ? ["Open credential_url to enter credentials, then create tools with
|
|
7786
|
+
next_steps: credentialUrl ? ["Open credential_url to enter credentials, then create tools with commandable_upsert_custom_tool."] : ["Start the management UI (create mode) to get a credential URL, then create tools with commandable_upsert_custom_tool."]
|
|
7699
7787
|
}
|
|
7700
7788
|
};
|
|
7701
7789
|
}
|
|
@@ -7724,8 +7812,8 @@ ${lines ? `${lines}
|
|
|
7724
7812
|
const res = await safe(testInput);
|
|
7725
7813
|
return { handled: true, listChanged: false, result: res };
|
|
7726
7814
|
}
|
|
7727
|
-
if (name === META_TOOL_NAMES.
|
|
7728
|
-
requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.
|
|
7815
|
+
if (name === META_TOOL_NAMES.upsertCustomTool) {
|
|
7816
|
+
requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.upsertCustomTool);
|
|
7729
7817
|
if (!ctx)
|
|
7730
7818
|
throw new Error("Tool building is not available in this server mode.");
|
|
7731
7819
|
const integrationId = String((args == null ? void 0 : args.integration_id) || "").trim();
|
|
@@ -7750,6 +7838,7 @@ ${lines ? `${lines}
|
|
|
7750
7838
|
if (!integration)
|
|
7751
7839
|
throw new Error(`Unknown integration_id: ${integrationId}`);
|
|
7752
7840
|
const existing = await getToolDefinitionByName(ctx.db, ctx.spaceId, integration.id, toolNameRaw);
|
|
7841
|
+
const created = !existing;
|
|
7753
7842
|
const id = (existing == null ? void 0 : existing.id) || (crypto.randomUUID ? crypto.randomUUID() : crypto.randomBytes(16).toString("hex"));
|
|
7754
7843
|
const inputSchema = sanitizeJsonSchema(inputSchemaObj);
|
|
7755
7844
|
await upsertToolDefinition(ctx.db, {
|
|
@@ -7801,7 +7890,8 @@ ${lines ? `${lines}
|
|
|
7801
7890
|
handled: true,
|
|
7802
7891
|
listChanged: true,
|
|
7803
7892
|
result: {
|
|
7804
|
-
|
|
7893
|
+
upserted: true,
|
|
7894
|
+
created,
|
|
7805
7895
|
tool: {
|
|
7806
7896
|
id,
|
|
7807
7897
|
name: executable.name,
|
|
@@ -7815,6 +7905,101 @@ ${lines ? `${lines}
|
|
|
7815
7905
|
}
|
|
7816
7906
|
};
|
|
7817
7907
|
}
|
|
7908
|
+
if (name === META_TOOL_NAMES.deleteCustomTool) {
|
|
7909
|
+
requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.deleteCustomTool);
|
|
7910
|
+
if (!ctx)
|
|
7911
|
+
throw new Error("Tool building is not available in this server mode.");
|
|
7912
|
+
const integrationId = String((args == null ? void 0 : args.integration_id) || "").trim();
|
|
7913
|
+
const toolNameRaw = String((args == null ? void 0 : args.name) || "").trim();
|
|
7914
|
+
if (!integrationId)
|
|
7915
|
+
throw new Error("integration_id is required");
|
|
7916
|
+
if (!toolNameRaw)
|
|
7917
|
+
throw new Error("name is required");
|
|
7918
|
+
const integration = (_g = (_f = ctx.integrationsRef) == null ? void 0 : _f.current) == null ? void 0 : _g.find((i) => i.id === integrationId || i.referenceId === integrationId);
|
|
7919
|
+
if (!integration)
|
|
7920
|
+
throw new Error(`Unknown integration_id: ${integrationId}`);
|
|
7921
|
+
const existing = await getToolDefinitionByName(ctx.db, ctx.spaceId, integration.id, toolNameRaw);
|
|
7922
|
+
if (!existing) {
|
|
7923
|
+
return {
|
|
7924
|
+
handled: true,
|
|
7925
|
+
listChanged: false,
|
|
7926
|
+
result: { deleted: false, reason: "not_found" }
|
|
7927
|
+
};
|
|
7928
|
+
}
|
|
7929
|
+
const executable = buildExecutableToolFromDefinition({
|
|
7930
|
+
spaceId: ctx.spaceId,
|
|
7931
|
+
integration,
|
|
7932
|
+
tool: existing,
|
|
7933
|
+
proxy: ctx.proxy,
|
|
7934
|
+
integrationsRef: ctx.integrationsRef
|
|
7935
|
+
});
|
|
7936
|
+
await deleteToolDefinitionByName(ctx.db, ctx.spaceId, integration.id, toolNameRaw);
|
|
7937
|
+
if (ctx.toolIndexRef) {
|
|
7938
|
+
ctx.toolIndexRef.byName.delete(executable.name);
|
|
7939
|
+
if (ctx.toolIndexRef.list)
|
|
7940
|
+
ctx.toolIndexRef.list = ctx.toolIndexRef.list.filter((t) => t.name !== executable.name);
|
|
7941
|
+
}
|
|
7942
|
+
if (ctx.catalogRef)
|
|
7943
|
+
ctx.catalogRef.current.removeCustomTool({ integration, toolName: executable.name });
|
|
7944
|
+
sessionState.removeToolFromAllSessions(executable.name);
|
|
7945
|
+
return {
|
|
7946
|
+
handled: true,
|
|
7947
|
+
listChanged: true,
|
|
7948
|
+
result: {
|
|
7949
|
+
deleted: true,
|
|
7950
|
+
tool: {
|
|
7951
|
+
raw_name: toolNameRaw,
|
|
7952
|
+
name: executable.name
|
|
7953
|
+
}
|
|
7954
|
+
}
|
|
7955
|
+
};
|
|
7956
|
+
}
|
|
7957
|
+
if (name === META_TOOL_NAMES.deleteCustomIntegration) {
|
|
7958
|
+
requireBuilderEnabled(sessionState, sessionId, META_TOOL_NAMES.deleteCustomIntegration);
|
|
7959
|
+
if (!ctx)
|
|
7960
|
+
throw new Error("Integration management is not available in this server mode.");
|
|
7961
|
+
if (!ctx.integrationsRef)
|
|
7962
|
+
throw new Error("integrationsRef is required for builder mode.");
|
|
7963
|
+
if (!ctx.integrationTypeConfigsRef)
|
|
7964
|
+
throw new Error("integrationTypeConfigsRef is required for custom integrations.");
|
|
7965
|
+
const integrationId = String((args == null ? void 0 : args.integration_id) || "").trim();
|
|
7966
|
+
if (!integrationId)
|
|
7967
|
+
throw new Error("integration_id is required");
|
|
7968
|
+
const integration = ctx.integrationsRef.current.find((i) => i.id === integrationId || i.referenceId === integrationId);
|
|
7969
|
+
if (!integration)
|
|
7970
|
+
throw new Error(`Unknown integration_id: ${integrationId}`);
|
|
7971
|
+
const materializedToolNames = [...((_h = ctx.toolIndexRef) == null ? void 0 : _h.byName.keys()) || []].filter((toolName) => toolName.endsWith(`__n${integration.id.replace(/[^a-z0-9]/gi, "").slice(0, 8).toLowerCase()}`));
|
|
7972
|
+
for (const toolName of materializedToolNames) {
|
|
7973
|
+
(_i = ctx.toolIndexRef) == null ? void 0 : _i.byName.delete(toolName);
|
|
7974
|
+
sessionState.removeToolFromAllSessions(toolName);
|
|
7975
|
+
}
|
|
7976
|
+
if ((_j = ctx.toolIndexRef) == null ? void 0 : _j.list)
|
|
7977
|
+
ctx.toolIndexRef.list = ctx.toolIndexRef.list.filter((t) => !materializedToolNames.includes(t.name));
|
|
7978
|
+
await deleteToolDefinitionsForIntegration(ctx.db, ctx.spaceId, integration.id);
|
|
7979
|
+
if (integration.connectionMethod === "credentials" && integration.credentialId)
|
|
7980
|
+
await ctx.credentialStore.deleteCredentials(ctx.spaceId, integration.credentialId);
|
|
7981
|
+
await deleteIntegrationById(ctx.db, integration.id);
|
|
7982
|
+
const remainingIntegrations = await listIntegrations(ctx.db, ctx.spaceId);
|
|
7983
|
+
ctx.integrationsRef.current = remainingIntegrations;
|
|
7984
|
+
if (!remainingIntegrations.some((i) => i.type === integration.type)) {
|
|
7985
|
+
await deleteIntegrationTypeConfig(ctx.db, ctx.spaceId, integration.type);
|
|
7986
|
+
ctx.integrationTypeConfigsRef.current = ctx.integrationTypeConfigsRef.current.filter((cfg) => !(cfg.spaceId === ctx.spaceId && cfg.typeSlug === integration.type));
|
|
7987
|
+
}
|
|
7988
|
+
if (ctx.catalogRef)
|
|
7989
|
+
ctx.catalogRef.current.removeIntegrationAbilities(integration);
|
|
7990
|
+
return {
|
|
7991
|
+
handled: true,
|
|
7992
|
+
listChanged: materializedToolNames.length > 0,
|
|
7993
|
+
result: {
|
|
7994
|
+
deleted: true,
|
|
7995
|
+
integration: {
|
|
7996
|
+
id: integration.id,
|
|
7997
|
+
type: integration.type,
|
|
7998
|
+
label: integration.label
|
|
7999
|
+
}
|
|
8000
|
+
}
|
|
8001
|
+
};
|
|
8002
|
+
}
|
|
7818
8003
|
return { handled: false };
|
|
7819
8004
|
}
|
|
7820
8005
|
|
|
@@ -7969,6 +8154,20 @@ const _SessionAbilityState = class _SessionAbilityState {
|
|
|
7969
8154
|
isToolActive(sessionId, toolName) {
|
|
7970
8155
|
return this.getOrCreate(sessionId).activeToolNames.has(toolName);
|
|
7971
8156
|
}
|
|
8157
|
+
removeToolFromAllSessions(toolName) {
|
|
8158
|
+
for (const st of this.sessions.values()) {
|
|
8159
|
+
if (!st.activeToolNames.has(toolName))
|
|
8160
|
+
continue;
|
|
8161
|
+
st.activeToolNames.delete(toolName);
|
|
8162
|
+
for (const [abilityId, names] of st.loadedAbilities.entries()) {
|
|
8163
|
+
const next = names.filter((n) => n !== toolName);
|
|
8164
|
+
if (next.length)
|
|
8165
|
+
st.loadedAbilities.set(abilityId, next);
|
|
8166
|
+
else
|
|
8167
|
+
st.loadedAbilities.delete(abilityId);
|
|
8168
|
+
}
|
|
8169
|
+
}
|
|
8170
|
+
}
|
|
7972
8171
|
cleanup(sessionId) {
|
|
7973
8172
|
const k = this.key(sessionId);
|
|
7974
8173
|
this.sessions.delete(k);
|
|
@@ -8260,142 +8459,142 @@ const assets = {
|
|
|
8260
8459
|
"/favicon.ico": {
|
|
8261
8460
|
"type": "image/vnd.microsoft.icon",
|
|
8262
8461
|
"etag": "\"10be-n8egyE9tcb7sKGr/pYCaQ4uWqxI\"",
|
|
8263
|
-
"mtime": "2026-03-
|
|
8462
|
+
"mtime": "2026-03-08T16:28:20.554Z",
|
|
8264
8463
|
"size": 4286,
|
|
8265
8464
|
"path": "../public/favicon.ico"
|
|
8266
8465
|
},
|
|
8267
8466
|
"/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2": {
|
|
8268
8467
|
"type": "font/woff2",
|
|
8269
8468
|
"etag": "\"4b5c-TAo9mx7r3xQs52+HbHcHJ52z8Qo\"",
|
|
8270
|
-
"mtime": "2026-03-
|
|
8469
|
+
"mtime": "2026-03-08T16:28:20.549Z",
|
|
8271
8470
|
"size": 19292,
|
|
8272
8471
|
"path": "../public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2"
|
|
8273
8472
|
},
|
|
8274
8473
|
"/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2": {
|
|
8275
8474
|
"type": "font/woff2",
|
|
8276
8475
|
"etag": "\"212c-FshXJibFzNhd2HEIMP8C3JR5PYg\"",
|
|
8277
|
-
"mtime": "2026-03-
|
|
8476
|
+
"mtime": "2026-03-08T16:28:20.549Z",
|
|
8278
8477
|
"size": 8492,
|
|
8279
8478
|
"path": "../public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2"
|
|
8280
8479
|
},
|
|
8281
8480
|
"/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2": {
|
|
8282
8481
|
"type": "font/woff2",
|
|
8283
8482
|
"etag": "\"680c-mJtsV33lkTAKSmfq5k3lKHSllcU\"",
|
|
8284
|
-
"mtime": "2026-03-
|
|
8483
|
+
"mtime": "2026-03-08T16:28:20.549Z",
|
|
8285
8484
|
"size": 26636,
|
|
8286
8485
|
"path": "../public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2"
|
|
8287
8486
|
},
|
|
8288
|
-
"/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2": {
|
|
8289
|
-
"type": "font/woff2",
|
|
8290
|
-
"etag": "\"1d98-cDZfMibtk4T04FTTAmlfhWDpkN0\"",
|
|
8291
|
-
"mtime": "2026-03-08T08:18:08.211Z",
|
|
8292
|
-
"size": 7576,
|
|
8293
|
-
"path": "../public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2"
|
|
8294
|
-
},
|
|
8295
8487
|
"/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2": {
|
|
8296
8488
|
"type": "font/woff2",
|
|
8297
8489
|
"etag": "\"6ec4-8OoFFPZKF1grqmfGVjh5JDE6DOU\"",
|
|
8298
|
-
"mtime": "2026-03-
|
|
8490
|
+
"mtime": "2026-03-08T16:28:20.549Z",
|
|
8299
8491
|
"size": 28356,
|
|
8300
8492
|
"path": "../public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2"
|
|
8301
8493
|
},
|
|
8494
|
+
"/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2": {
|
|
8495
|
+
"type": "font/woff2",
|
|
8496
|
+
"etag": "\"1d98-cDZfMibtk4T04FTTAmlfhWDpkN0\"",
|
|
8497
|
+
"mtime": "2026-03-08T16:28:20.550Z",
|
|
8498
|
+
"size": 7576,
|
|
8499
|
+
"path": "../public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2"
|
|
8500
|
+
},
|
|
8302
8501
|
"/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2": {
|
|
8303
8502
|
"type": "font/woff2",
|
|
8304
8503
|
"etag": "\"47c4-5xyngHnzzhetUee74tMx9OTgqNQ\"",
|
|
8305
|
-
"mtime": "2026-03-
|
|
8504
|
+
"mtime": "2026-03-08T16:28:20.550Z",
|
|
8306
8505
|
"size": 18372,
|
|
8307
8506
|
"path": "../public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2"
|
|
8308
8507
|
},
|
|
8309
|
-
"/_nuxt/
|
|
8508
|
+
"/_nuxt/B2dAlp_u.js": {
|
|
8310
8509
|
"type": "text/javascript; charset=utf-8",
|
|
8311
|
-
"etag": "\"
|
|
8312
|
-
"mtime": "2026-03-
|
|
8313
|
-
"size":
|
|
8314
|
-
"path": "../public/_nuxt/
|
|
8510
|
+
"etag": "\"eba0-wf6kssOw4eNs97QyNojAg32DloY\"",
|
|
8511
|
+
"mtime": "2026-03-08T16:28:20.552Z",
|
|
8512
|
+
"size": 60320,
|
|
8513
|
+
"path": "../public/_nuxt/B2dAlp_u.js"
|
|
8315
8514
|
},
|
|
8316
|
-
"/_nuxt/
|
|
8515
|
+
"/_nuxt/BvFUCPqA.js": {
|
|
8317
8516
|
"type": "text/javascript; charset=utf-8",
|
|
8318
|
-
"etag": "\"
|
|
8319
|
-
"mtime": "2026-03-
|
|
8320
|
-
"size":
|
|
8321
|
-
"path": "../public/_nuxt/
|
|
8517
|
+
"etag": "\"1def-GjWsOK4crVgdvsvob4q4AcQU3eE\"",
|
|
8518
|
+
"mtime": "2026-03-08T16:28:20.552Z",
|
|
8519
|
+
"size": 7663,
|
|
8520
|
+
"path": "../public/_nuxt/BvFUCPqA.js"
|
|
8322
8521
|
},
|
|
8323
|
-
"/_nuxt/
|
|
8522
|
+
"/_nuxt/Dm_hd4at.js": {
|
|
8324
8523
|
"type": "text/javascript; charset=utf-8",
|
|
8325
|
-
"etag": "\"
|
|
8326
|
-
"mtime": "2026-03-
|
|
8327
|
-
"size":
|
|
8328
|
-
"path": "../public/_nuxt/
|
|
8524
|
+
"etag": "\"ab-krq+bSQAVNARAnmcr6pb3p09JGM\"",
|
|
8525
|
+
"mtime": "2026-03-08T16:28:20.552Z",
|
|
8526
|
+
"size": 171,
|
|
8527
|
+
"path": "../public/_nuxt/Dm_hd4at.js"
|
|
8329
8528
|
},
|
|
8330
|
-
"/_nuxt/
|
|
8529
|
+
"/_nuxt/S2P9sd4n.js": {
|
|
8331
8530
|
"type": "text/javascript; charset=utf-8",
|
|
8332
|
-
"etag": "\"
|
|
8333
|
-
"mtime": "2026-03-
|
|
8334
|
-
"size":
|
|
8335
|
-
"path": "../public/_nuxt/
|
|
8531
|
+
"etag": "\"e99-6ab7sqCWIEbGMF8iRCoX06GCU6M\"",
|
|
8532
|
+
"mtime": "2026-03-08T16:28:20.552Z",
|
|
8533
|
+
"size": 3737,
|
|
8534
|
+
"path": "../public/_nuxt/S2P9sd4n.js"
|
|
8336
8535
|
},
|
|
8337
8536
|
"/_nuxt/_id_.BKAjWkoP.css": {
|
|
8338
8537
|
"type": "text/css; charset=utf-8",
|
|
8339
8538
|
"etag": "\"2f4-WvSreXC5yG1/cIV/f4qFH6C3ROw\"",
|
|
8340
|
-
"mtime": "2026-03-
|
|
8539
|
+
"mtime": "2026-03-08T16:28:20.553Z",
|
|
8341
8540
|
"size": 756,
|
|
8342
8541
|
"path": "../public/_nuxt/_id_.BKAjWkoP.css"
|
|
8343
8542
|
},
|
|
8344
|
-
"/_nuxt/
|
|
8543
|
+
"/_nuxt/Ba0BY0O0.js": {
|
|
8345
8544
|
"type": "text/javascript; charset=utf-8",
|
|
8346
|
-
"etag": "\"
|
|
8347
|
-
"mtime": "2026-03-
|
|
8348
|
-
"size":
|
|
8349
|
-
"path": "../public/_nuxt/
|
|
8545
|
+
"etag": "\"19215-vDS/v7twXUEHmC7Vwb8hpHtOY10\"",
|
|
8546
|
+
"mtime": "2026-03-08T16:28:20.552Z",
|
|
8547
|
+
"size": 102933,
|
|
8548
|
+
"path": "../public/_nuxt/Ba0BY0O0.js"
|
|
8350
8549
|
},
|
|
8351
|
-
"/_nuxt
|
|
8550
|
+
"/_nuxt/d2XTSFt9.js": {
|
|
8352
8551
|
"type": "text/javascript; charset=utf-8",
|
|
8353
|
-
"etag": "\"
|
|
8354
|
-
"mtime": "2026-03-
|
|
8355
|
-
"size":
|
|
8356
|
-
"path": "../public/_nuxt
|
|
8357
|
-
},
|
|
8358
|
-
"/_nuxt/entry.Y3mA4bzA.css": {
|
|
8359
|
-
"type": "text/css; charset=utf-8",
|
|
8360
|
-
"etag": "\"2d46b-zfrD3Ny9WW6qm4fCXAfX5eIAxPA\"",
|
|
8361
|
-
"mtime": "2026-03-08T08:18:08.217Z",
|
|
8362
|
-
"size": 185451,
|
|
8363
|
-
"path": "../public/_nuxt/entry.Y3mA4bzA.css"
|
|
8552
|
+
"etag": "\"d7b-8ryX9kOW13aLMnbzFyfd6FPpcQQ\"",
|
|
8553
|
+
"mtime": "2026-03-08T16:28:20.553Z",
|
|
8554
|
+
"size": 3451,
|
|
8555
|
+
"path": "../public/_nuxt/d2XTSFt9.js"
|
|
8364
8556
|
},
|
|
8365
8557
|
"/_nuxt/error-404.C7fg894-.css": {
|
|
8366
8558
|
"type": "text/css; charset=utf-8",
|
|
8367
8559
|
"etag": "\"97e-fiQ3o7A11L9BuXRBr0GJldkx0AU\"",
|
|
8368
|
-
"mtime": "2026-03-
|
|
8560
|
+
"mtime": "2026-03-08T16:28:20.553Z",
|
|
8369
8561
|
"size": 2430,
|
|
8370
8562
|
"path": "../public/_nuxt/error-404.C7fg894-.css"
|
|
8371
8563
|
},
|
|
8372
|
-
"/_nuxt/
|
|
8373
|
-
"type": "text/
|
|
8374
|
-
"etag": "\"
|
|
8375
|
-
"mtime": "2026-03-
|
|
8376
|
-
"size":
|
|
8377
|
-
"path": "../public/_nuxt/
|
|
8564
|
+
"/_nuxt/error-500.DjUK_N2Y.css": {
|
|
8565
|
+
"type": "text/css; charset=utf-8",
|
|
8566
|
+
"etag": "\"773-Qf61bSDos4KtmZDaA06FmZyUYNo\"",
|
|
8567
|
+
"mtime": "2026-03-08T16:28:20.553Z",
|
|
8568
|
+
"size": 1907,
|
|
8569
|
+
"path": "../public/_nuxt/error-500.DjUK_N2Y.css"
|
|
8378
8570
|
},
|
|
8379
8571
|
"/_nuxt/builds/latest.json": {
|
|
8380
8572
|
"type": "application/json",
|
|
8381
|
-
"etag": "\"47-
|
|
8382
|
-
"mtime": "2026-03-
|
|
8573
|
+
"etag": "\"47-op9Jfo5oQLm36mD0gRz+ndCW6Io\"",
|
|
8574
|
+
"mtime": "2026-03-08T16:28:20.548Z",
|
|
8383
8575
|
"size": 71,
|
|
8384
8576
|
"path": "../public/_nuxt/builds/latest.json"
|
|
8385
8577
|
},
|
|
8386
|
-
"/_nuxt/builds/meta/
|
|
8578
|
+
"/_nuxt/builds/meta/ee5097c4-b785-4b77-92d6-c16a7396d677.json": {
|
|
8387
8579
|
"type": "application/json",
|
|
8388
|
-
"etag": "\"58-
|
|
8389
|
-
"mtime": "2026-03-
|
|
8580
|
+
"etag": "\"58-C3SJHjRgAe3fjVEO8JR6Pab6zyo\"",
|
|
8581
|
+
"mtime": "2026-03-08T16:28:20.546Z",
|
|
8390
8582
|
"size": 88,
|
|
8391
|
-
"path": "../public/_nuxt/builds/meta/
|
|
8583
|
+
"path": "../public/_nuxt/builds/meta/ee5097c4-b785-4b77-92d6-c16a7396d677.json"
|
|
8392
8584
|
},
|
|
8393
|
-
"/_nuxt/
|
|
8585
|
+
"/_nuxt/B04gGCnx.js": {
|
|
8586
|
+
"type": "text/javascript; charset=utf-8",
|
|
8587
|
+
"etag": "\"66cba-KFKixdFAdkdkbCxucEEHBnimIKw\"",
|
|
8588
|
+
"mtime": "2026-03-08T16:28:20.553Z",
|
|
8589
|
+
"size": 421050,
|
|
8590
|
+
"path": "../public/_nuxt/B04gGCnx.js"
|
|
8591
|
+
},
|
|
8592
|
+
"/_nuxt/entry.Y3mA4bzA.css": {
|
|
8394
8593
|
"type": "text/css; charset=utf-8",
|
|
8395
|
-
"etag": "\"
|
|
8396
|
-
"mtime": "2026-03-
|
|
8397
|
-
"size":
|
|
8398
|
-
"path": "../public/_nuxt/
|
|
8594
|
+
"etag": "\"2d46b-zfrD3Ny9WW6qm4fCXAfX5eIAxPA\"",
|
|
8595
|
+
"mtime": "2026-03-08T16:28:20.553Z",
|
|
8596
|
+
"size": 185451,
|
|
8597
|
+
"path": "../public/_nuxt/entry.Y3mA4bzA.css"
|
|
8399
8598
|
}
|
|
8400
8599
|
};
|
|
8401
8600
|
|
|
@@ -8698,7 +8897,10 @@ function getSpaceId() {
|
|
|
8698
8897
|
return v && v.trim().length ? v.trim() : "local";
|
|
8699
8898
|
}
|
|
8700
8899
|
function getServerInfo() {
|
|
8701
|
-
return {
|
|
8900
|
+
return {
|
|
8901
|
+
name: "commandable",
|
|
8902
|
+
version: (process.env.COMMANDABLE_VERSION || "").trim() || "0.0.0"
|
|
8903
|
+
};
|
|
8702
8904
|
}
|
|
8703
8905
|
function isCreateEndpoint(endpoint) {
|
|
8704
8906
|
return endpoint === "create";
|
|
@@ -8714,12 +8916,16 @@ async function buildState(endpoint) {
|
|
|
8714
8916
|
const credentialStore = new SqlCredentialStore(db, secret);
|
|
8715
8917
|
const spaceId = getSpaceId();
|
|
8716
8918
|
const integrations = await listIntegrations(db, spaceId);
|
|
8919
|
+
const toolDefinitions = await listToolDefinitions(db, spaceId);
|
|
8920
|
+
const integrationTypeConfigs = await listIntegrationTypeConfigs(db, spaceId);
|
|
8717
8921
|
const integrationsRef = { current: integrations };
|
|
8922
|
+
const integrationTypeConfigsRef = { current: integrationTypeConfigs };
|
|
8718
8923
|
const proxy = new IntegrationProxy({
|
|
8719
8924
|
credentialStore,
|
|
8720
|
-
trelloApiKey: process.env.TRELLO_API_KEY
|
|
8925
|
+
trelloApiKey: process.env.TRELLO_API_KEY,
|
|
8926
|
+
integrationTypeConfigsRef
|
|
8721
8927
|
});
|
|
8722
|
-
const index = buildMcpToolIndex({ spaceId, integrations, proxy, integrationsRef });
|
|
8928
|
+
const index = buildMcpToolIndex({ spaceId, integrations, proxy, integrationsRef, toolDefinitions });
|
|
8723
8929
|
const toolIndexRef = { list: index.tools, byName: index.byName };
|
|
8724
8930
|
const port = (process.env.PORT || "").trim() || "23432";
|
|
8725
8931
|
const host = (process.env.HOST || "").trim() || "127.0.0.1";
|
|
@@ -8733,6 +8939,7 @@ async function buildState(endpoint) {
|
|
|
8733
8939
|
proxy,
|
|
8734
8940
|
credentialSetupBaseUrl,
|
|
8735
8941
|
integrationsRef,
|
|
8942
|
+
integrationTypeConfigsRef,
|
|
8736
8943
|
toolIndexRef,
|
|
8737
8944
|
catalogRef
|
|
8738
8945
|
} : void 0;
|
|
@@ -8909,6 +9116,9 @@ const _lazy_sOFl5X = () => import('../routes/api/integrations/_id/credentials-st
|
|
|
8909
9116
|
const _lazy_zXPBbA = () => import('../routes/api/integrations/_id/credentials.delete.mjs');
|
|
8910
9117
|
const _lazy_69ylR_ = () => import('../routes/api/integrations/_id/credentials.post.mjs');
|
|
8911
9118
|
const _lazy_lumeOp = () => import('../routes/api/integrations/_id/permissions.post.mjs');
|
|
9119
|
+
const _lazy_4q0YgG = () => import('../routes/api/integrations/_id/tools.delete.mjs');
|
|
9120
|
+
const _lazy_c2AGl_ = () => import('../routes/api/integrations/_id/tools.get.mjs');
|
|
9121
|
+
const _lazy_CTS1ok = () => import('../routes/api/integrations/_id/toolsets.get.mjs');
|
|
8912
9122
|
const _lazy_1IpV3C = () => import('../routes/api/integrations/_id/toolsets.post.mjs');
|
|
8913
9123
|
const _lazy_lN21pE = () => import('../routes/api/index.get.mjs');
|
|
8914
9124
|
const _lazy_uOi51L = () => import('../routes/api/index.post.mjs');
|
|
@@ -8930,6 +9140,9 @@ const handlers = [
|
|
|
8930
9140
|
{ route: '/api/integrations/:id/credentials', handler: _lazy_zXPBbA, lazy: true, middleware: false, method: "delete" },
|
|
8931
9141
|
{ route: '/api/integrations/:id/credentials', handler: _lazy_69ylR_, lazy: true, middleware: false, method: "post" },
|
|
8932
9142
|
{ route: '/api/integrations/:id/permissions', handler: _lazy_lumeOp, lazy: true, middleware: false, method: "post" },
|
|
9143
|
+
{ route: '/api/integrations/:id/tools', handler: _lazy_4q0YgG, lazy: true, middleware: false, method: "delete" },
|
|
9144
|
+
{ route: '/api/integrations/:id/tools', handler: _lazy_c2AGl_, lazy: true, middleware: false, method: "get" },
|
|
9145
|
+
{ route: '/api/integrations/:id/toolsets', handler: _lazy_CTS1ok, lazy: true, middleware: false, method: "get" },
|
|
8933
9146
|
{ route: '/api/integrations/:id/toolsets', handler: _lazy_1IpV3C, lazy: true, middleware: false, method: "post" },
|
|
8934
9147
|
{ route: '/api/integrations', handler: _lazy_lN21pE, lazy: true, middleware: false, method: "get" },
|
|
8935
9148
|
{ route: '/api/integrations', handler: _lazy_uOi51L, lazy: true, middleware: false, method: "post" },
|
|
@@ -9355,5 +9568,5 @@ trapUnhandledNodeErrors();
|
|
|
9355
9568
|
setupGracefulShutdown(listener, nitroApp);
|
|
9356
9569
|
const nodeServer = {};
|
|
9357
9570
|
|
|
9358
|
-
export {
|
|
9571
|
+
export { getContext as $, setResponseStatus as A, buildAssetsURL as B, useRuntimeConfig as C, getResponseStatusText as D, getResponseStatus as E, defineRenderHandler as F, publicAssetsURL as G, getQuery as H, IntegrationProxy as I, destr as J, getRouteRules as K, joinURL as L, useNitroApp as M, serialize$1 as N, klona as O, defu as P, hasProtocol as Q, isScriptProtocol as R, SqlCredentialStore as S, parseQuery as T, defuFn as U, withQuery as V, sanitizeStatusCode as W, parseURL as X, encodePath as Y, decodePath as Z, isEqual as _, loadIntegrationCredentialConfig as a, withTrailingSlash as a0, withoutTrailingSlash as a1, $fetch$1 as a2, baseURL as a3, createHooks as a4, executeAsync as a5, hash$1 as a6, nodeServer as a7, loadIntegrationToolList as b, createError$1 as c, defineEventHandler as d, loadIntegrationToolsets as e, getDb as f, getRouterParam as g, getIntegrationById as h, deleteToolDefinitionsForIntegration as i, getOrCreateEncryptionSecret as j, deleteIntegrationById as k, listIntegrationCatalog as l, listIntegrations as m, deleteIntegrationTypeConfig as n, findIntegrationTypeConfig as o, pgIntegrations as p, updateIntegrationHealth as q, refreshMcpState as r, sqliteIntegrations as s, readBody as t, updateIntegrationCredentials as u, checkIntegrationHealth as v, upsertIntegration as w, deleteToolDefinitionByName as x, listToolDefinitionsForIntegration as y, handleMcpHttp as z };
|
|
9359
9572
|
//# sourceMappingURL=nitro.mjs.map
|