@oomol-lab/open-connector 1.9.0 → 1.9.1
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/assets/open-connector/catalog/apps/agentearth.json +441 -0
- package/assets/open-connector/catalog/apps/appgrowing_mcp.json +863 -0
- package/assets/open-connector/catalog/apps/arcmira.json +610 -0
- package/assets/open-connector/catalog/apps/bainiu.json +654 -0
- package/assets/open-connector/catalog/apps/chaport.json +331 -0
- package/assets/open-connector/catalog/apps/cnb.json +1408 -0
- package/assets/open-connector/catalog/apps/crtsh.json +123 -0
- package/assets/open-connector/catalog/apps/eastmoney_miaoxiang.json +406 -0
- package/assets/open-connector/catalog/apps/fastmoss_mcp.json +876 -876
- package/assets/open-connector/catalog/apps/ftshare.json +1162 -0
- package/assets/open-connector/catalog/apps/fusion-api.json +143 -0
- package/assets/open-connector/catalog/apps/fxbaogao.json +308 -0
- package/assets/open-connector/catalog/apps/github.json +38 -3
- package/assets/open-connector/catalog/apps/hrmos_kintai.json +7519 -0
- package/assets/open-connector/catalog/apps/humor_api.json +351 -0
- package/assets/open-connector/catalog/apps/kaonavi.json +1723 -0
- package/assets/open-connector/catalog/apps/linear_mcp.json +882 -22
- package/assets/open-connector/catalog/apps/listinggood.json +362 -0
- package/assets/open-connector/catalog/apps/notion_mcp.json +338 -1
- package/assets/open-connector/catalog/apps/outlook.json +414 -0
- package/assets/open-connector/catalog/apps/porteden.json +1258 -0
- package/assets/open-connector/catalog/apps/qiuxiaoce.json +915 -0
- package/assets/open-connector/catalog/apps/qqmusic.json +1834 -0
- package/assets/open-connector/catalog/apps/rakuraku_seisan.json +217 -0
- package/assets/open-connector/catalog/apps/redfox.json +9661 -897
- package/assets/open-connector/catalog/apps/salesforce.json +4907 -0
- package/assets/open-connector/catalog/apps/sansan.json +4594 -0
- package/assets/open-connector/catalog/apps/smarthr.json +8071 -0
- package/assets/open-connector/catalog/apps/smooth.json +914 -0
- package/assets/open-connector/catalog/apps/tapd.json +727 -0
- package/assets/open-connector/catalog/apps/tencent_meeting_mcp.json +1301 -0
- package/assets/open-connector/catalog/apps/threatfox.json +203 -0
- package/assets/open-connector/catalog/apps/tradebee.json +915 -0
- package/assets/open-connector/catalog/apps/twittrapi.json +4914 -0
- package/assets/open-connector/catalog/apps/urlhaus.json +246 -0
- package/assets/open-connector/catalog/apps/weread.json +1514 -0
- package/assets/open-connector/catalog/apps/whatsapp.json +12 -0
- package/assets/open-connector/catalog/apps/zhiliaobiaoxun.json +812 -0
- package/assets/open-connector/catalog/apps-index.json +1 -1
- package/package.json +2 -1
- package/src/connection-service.js +55 -11
- package/src/core/provider-error-codes.d.ts +9 -0
- package/src/core/provider-error-codes.js +13 -0
- package/src/core/request.d.ts +2 -0
- package/src/core/request.js +11 -2
- package/src/mail/imap-smtp/protocol.js +4 -3
- package/src/oauth/oauth-flow-service.js +1 -0
- package/src/oauth/oauth-token.d.ts +2 -0
- package/src/providers/17track/runtime.js +17 -20
- package/src/providers/action-contracts.generated.d.ts +36 -6
- package/src/providers/agentearth/actions.d.ts +2 -0
- package/src/providers/agentearth/actions.js +100 -0
- package/src/providers/agentearth/executors.d.ts +4 -0
- package/src/providers/agentearth/executors.js +109 -0
- package/src/providers/appgrowing_mcp/actions.d.ts +2 -0
- package/src/providers/appgrowing_mcp/actions.js +175 -0
- package/src/providers/appgrowing_mcp/executors.d.ts +4 -0
- package/src/providers/appgrowing_mcp/executors.js +66 -0
- package/src/providers/arcmira/executors.d.ts +3 -0
- package/src/providers/arcmira/executors.js +8 -0
- package/src/providers/arcmira/runtime.d.ts +6 -0
- package/src/providers/arcmira/runtime.js +41 -0
- package/src/providers/bainiu/actions.d.ts +2 -0
- package/src/providers/bainiu/actions.js +108 -0
- package/src/providers/bainiu/executors.d.ts +4 -0
- package/src/providers/bainiu/executors.js +113 -0
- package/src/providers/baixiao/executors.js +1 -1
- package/src/providers/bing_webmaster/executors.js +1 -1
- package/src/providers/chaport/actions.d.ts +2 -0
- package/src/providers/chaport/actions.js +70 -0
- package/src/providers/chaport/executors.d.ts +4 -0
- package/src/providers/chaport/executors.js +128 -0
- package/src/providers/clickup/runtime.js +49 -52
- package/src/providers/cnb/actions.d.ts +2 -0
- package/src/providers/cnb/actions.js +341 -0
- package/src/providers/cnb/executors.d.ts +4 -0
- package/src/providers/cnb/executors.js +135 -0
- package/src/providers/coupontools/runtime.js +11 -14
- package/src/providers/crtsh/executors.d.ts +3 -0
- package/src/providers/crtsh/executors.js +19 -0
- package/src/providers/crtsh/runtime.d.ts +17 -0
- package/src/providers/crtsh/runtime.js +84 -0
- package/src/providers/eastmoney_miaoxiang/actions.d.ts +2 -0
- package/src/providers/eastmoney_miaoxiang/actions.js +95 -0
- package/src/providers/eastmoney_miaoxiang/executors.d.ts +4 -0
- package/src/providers/eastmoney_miaoxiang/executors.js +81 -0
- package/src/providers/fastmoss_mcp/actions-content.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-content.js +140 -0
- package/src/providers/fastmoss_mcp/actions-creator.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-creator.js +154 -0
- package/src/providers/fastmoss_mcp/actions-product.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-product.js +167 -0
- package/src/providers/fastmoss_mcp/actions-research.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-research.js +174 -0
- package/src/providers/fastmoss_mcp/actions-shop.d.ts +2 -0
- package/src/providers/fastmoss_mcp/actions-shop.js +142 -0
- package/src/providers/fastmoss_mcp/actions.js +11 -12
- package/src/providers/fastmoss_mcp/schemas.d.ts +51 -0
- package/src/providers/fastmoss_mcp/schemas.js +52 -0
- package/src/providers/ftshare/actions.d.ts +2 -0
- package/src/providers/ftshare/actions.js +124 -0
- package/src/providers/ftshare/executors.d.ts +4 -0
- package/src/providers/ftshare/executors.js +102 -0
- package/src/providers/fusion-api/operations.js +37 -0
- package/src/providers/fxbaogao/actions.d.ts +2 -0
- package/src/providers/fxbaogao/actions.js +74 -0
- package/src/providers/fxbaogao/executors.d.ts +4 -0
- package/src/providers/fxbaogao/executors.js +155 -0
- package/src/providers/github/app-installation.d.ts +37 -0
- package/src/providers/github/app-installation.js +233 -0
- package/src/providers/github/executors.js +93 -15
- package/src/providers/github/runtime-repository.js +21 -1
- package/src/providers/github/runtime-shared.d.ts +2 -0
- package/src/providers/github/runtime-shared.js +1 -0
- package/src/providers/googledrive/runtime-request.js +3 -3
- package/src/providers/hrmos_kintai/actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/actions.js +139 -0
- package/src/providers/hrmos_kintai/attendance-actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/attendance-actions.js +276 -0
- package/src/providers/hrmos_kintai/business-actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/business-actions.js +143 -0
- package/src/providers/hrmos_kintai/business-schemas.d.ts +4 -0
- package/src/providers/hrmos_kintai/business-schemas.js +320 -0
- package/src/providers/hrmos_kintai/executors.d.ts +4 -0
- package/src/providers/hrmos_kintai/executors.js +61 -0
- package/src/providers/hrmos_kintai/export-actions.d.ts +2 -0
- package/src/providers/hrmos_kintai/export-actions.js +58 -0
- package/src/providers/hrmos_kintai/operations.d.ts +9 -0
- package/src/providers/hrmos_kintai/operations.js +278 -0
- package/src/providers/hrmos_kintai/runtime.d.ts +10 -0
- package/src/providers/hrmos_kintai/runtime.js +217 -0
- package/src/providers/hrmos_kintai/schemas.d.ts +10 -0
- package/src/providers/hrmos_kintai/schemas.js +70 -0
- package/src/providers/humor_api/actions.d.ts +2 -0
- package/src/providers/humor_api/actions.js +96 -0
- package/src/providers/humor_api/executors.d.ts +4 -0
- package/src/providers/humor_api/executors.js +76 -0
- package/src/providers/kaonavi/actions.d.ts +4 -0
- package/src/providers/kaonavi/actions.js +144 -0
- package/src/providers/kaonavi/additional-actions.d.ts +10 -0
- package/src/providers/kaonavi/additional-actions.js +203 -0
- package/src/providers/kaonavi/executors.d.ts +4 -0
- package/src/providers/kaonavi/executors.js +69 -0
- package/src/providers/kaonavi/runtime.d.ts +4 -0
- package/src/providers/kaonavi/runtime.js +69 -0
- package/src/providers/linear_mcp/actions.d.ts +14 -0
- package/src/providers/linear_mcp/actions.js +134 -0
- package/src/providers/linear_mcp/runtime-mcp.d.ts +7 -1
- package/src/providers/linear_mcp/runtime-mcp.js +140 -28
- package/src/providers/linkfox/runtime.js +48 -51
- package/src/providers/listinggood/actions.d.ts +2 -0
- package/src/providers/listinggood/actions.js +95 -0
- package/src/providers/listinggood/executors.d.ts +4 -0
- package/src/providers/listinggood/executors.js +99 -0
- package/src/providers/mcp-tools.d.ts +3 -0
- package/src/providers/mcp-tools.js +5 -4
- package/src/providers/notion_mcp/executors.js +53 -24
- package/src/providers/notion_mcp/mcp-response.d.ts +26 -0
- package/src/providers/notion_mcp/mcp-response.js +95 -0
- package/src/providers/omise/executors.js +1 -1
- package/src/providers/outlook/executors.js +35 -2
- package/src/providers/porteden/actions.d.ts +2 -0
- package/src/providers/porteden/actions.js +162 -0
- package/src/providers/porteden/executors.d.ts +4 -0
- package/src/providers/porteden/executors.js +140 -0
- package/src/providers/provider-runtime.d.ts +3 -2
- package/src/providers/pushover/runtime.js +28 -31
- package/src/providers/qianfan/runtime.js +16 -19
- package/src/providers/qiuxiaoce/actions.d.ts +2 -0
- package/src/providers/qiuxiaoce/actions.js +248 -0
- package/src/providers/qiuxiaoce/executors.d.ts +4 -0
- package/src/providers/qiuxiaoce/executors.js +76 -0
- package/src/providers/qiuxiaoce/routes.d.ts +1 -0
- package/src/providers/qiuxiaoce/routes.js +20 -0
- package/src/providers/qqmusic/actions.d.ts +2 -0
- package/src/providers/qqmusic/actions.js +229 -0
- package/src/providers/qqmusic/executors.d.ts +4 -0
- package/src/providers/qqmusic/executors.js +92 -0
- package/src/providers/qqmusic/report-schema.d.ts +4 -0
- package/src/providers/qqmusic/report-schema.js +119 -0
- package/src/providers/rakuraku_seisan/actions.d.ts +2 -0
- package/src/providers/rakuraku_seisan/actions.js +50 -0
- package/src/providers/rakuraku_seisan/executors.d.ts +4 -0
- package/src/providers/rakuraku_seisan/executors.js +40 -0
- package/src/providers/rakuraku_seisan/runtime.d.ts +8 -0
- package/src/providers/rakuraku_seisan/runtime.js +251 -0
- package/src/providers/redfox/actions-account.d.ts +2 -0
- package/src/providers/redfox/actions-account.js +24 -0
- package/src/providers/redfox/actions-autohome.d.ts +2 -0
- package/src/providers/redfox/actions-autohome.js +51 -0
- package/src/providers/redfox/actions-baijiahao.d.ts +2 -0
- package/src/providers/redfox/actions-baijiahao.js +58 -0
- package/src/providers/redfox/actions-bilibili.d.ts +2 -0
- package/src/providers/redfox/actions-bilibili.js +67 -0
- package/src/providers/redfox/actions-dongchedi.d.ts +2 -0
- package/src/providers/redfox/actions-dongchedi.js +49 -0
- package/src/providers/redfox/actions-douyin.d.ts +2 -0
- package/src/providers/redfox/actions-douyin.js +297 -0
- package/src/providers/redfox/actions-generation.d.ts +2 -0
- package/src/providers/redfox/actions-generation.js +293 -0
- package/src/providers/redfox/actions-instagram.d.ts +2 -0
- package/src/providers/redfox/actions-instagram.js +49 -0
- package/src/providers/redfox/actions-kuaishou.d.ts +2 -0
- package/src/providers/redfox/actions-kuaishou.js +53 -0
- package/src/providers/redfox/actions-search.d.ts +2 -0
- package/src/providers/redfox/actions-search.js +125 -0
- package/src/providers/redfox/actions-tiktok.d.ts +2 -0
- package/src/providers/redfox/actions-tiktok.js +136 -0
- package/src/providers/redfox/actions-tools.d.ts +2 -0
- package/src/providers/redfox/actions-tools.js +151 -0
- package/src/providers/redfox/actions-toutiao.d.ts +2 -0
- package/src/providers/redfox/actions-toutiao.js +68 -0
- package/src/providers/redfox/actions-transcription.d.ts +2 -0
- package/src/providers/redfox/actions-transcription.js +165 -0
- package/src/providers/redfox/actions-wechat-channel.d.ts +2 -0
- package/src/providers/redfox/actions-wechat-channel.js +63 -0
- package/src/providers/redfox/actions-wechat.d.ts +2 -0
- package/src/providers/redfox/actions-wechat.js +302 -0
- package/src/providers/redfox/actions-weibo.d.ts +2 -0
- package/src/providers/redfox/actions-weibo.js +61 -0
- package/src/providers/redfox/actions-x.d.ts +2 -0
- package/src/providers/redfox/actions-x.js +126 -0
- package/src/providers/redfox/actions-xiaohongshu.d.ts +2 -0
- package/src/providers/redfox/actions-xiaohongshu.js +244 -0
- package/src/providers/redfox/actions-yiche.d.ts +2 -0
- package/src/providers/redfox/actions-yiche.js +59 -0
- package/src/providers/redfox/actions-youtube.d.ts +2 -0
- package/src/providers/redfox/actions-youtube.js +64 -0
- package/src/providers/redfox/actions-zhihu.d.ts +2 -0
- package/src/providers/redfox/actions-zhihu.js +26 -0
- package/src/providers/redfox/actions.d.ts +2 -0
- package/src/providers/redfox/actions.js +49 -0
- package/src/providers/redfox/executors.d.ts +2 -14
- package/src/providers/redfox/executors.js +28 -551
- package/src/providers/redfox/routes.d.ts +11 -0
- package/src/providers/redfox/routes.js +329 -0
- package/src/providers/redfox/runtime.d.ts +6 -0
- package/src/providers/redfox/runtime.js +151 -0
- package/src/providers/redfox/schemas.d.ts +9 -0
- package/src/providers/redfox/schemas.js +40 -0
- package/src/providers/registry.generated.js +30 -0
- package/src/providers/salesforce/context.d.ts +16 -0
- package/src/providers/salesforce/context.js +58 -0
- package/src/providers/salesforce/executors.d.ts +5 -0
- package/src/providers/salesforce/executors.js +54 -0
- package/src/providers/salesforce/media.d.ts +9 -0
- package/src/providers/salesforce/media.js +66 -0
- package/src/providers/salesforce/oauth.d.ts +2 -0
- package/src/providers/salesforce/oauth.js +89 -0
- package/src/providers/salesforce/runtime-analytics.d.ts +2 -0
- package/src/providers/salesforce/runtime-analytics.js +60 -0
- package/src/providers/salesforce/runtime-automation.d.ts +2 -0
- package/src/providers/salesforce/runtime-automation.js +64 -0
- package/src/providers/salesforce/runtime-base.d.ts +2 -0
- package/src/providers/salesforce/runtime-base.js +51 -0
- package/src/providers/salesforce/runtime-bulk.d.ts +2 -0
- package/src/providers/salesforce/runtime-bulk.js +98 -0
- package/src/providers/salesforce/runtime-data.d.ts +2 -0
- package/src/providers/salesforce/runtime-data.js +207 -0
- package/src/providers/salesforce/runtime-files.d.ts +2 -0
- package/src/providers/salesforce/runtime-files.js +108 -0
- package/src/providers/salesforce/transport.d.ts +9 -0
- package/src/providers/salesforce/transport.js +65 -0
- package/src/providers/sansan/actions.d.ts +2 -0
- package/src/providers/sansan/actions.js +165 -0
- package/src/providers/sansan/admin-actions.d.ts +2 -0
- package/src/providers/sansan/admin-actions.js +181 -0
- package/src/providers/sansan/admin.d.ts +2 -0
- package/src/providers/sansan/admin.js +42 -0
- package/src/providers/sansan/business-actions.d.ts +2 -0
- package/src/providers/sansan/business-actions.js +160 -0
- package/src/providers/sansan/business.d.ts +2 -0
- package/src/providers/sansan/business.js +51 -0
- package/src/providers/sansan/executors.d.ts +4 -0
- package/src/providers/sansan/executors.js +59 -0
- package/src/providers/sansan/file-schema.d.ts +2 -0
- package/src/providers/sansan/file-schema.js +8 -0
- package/src/providers/sansan/files.d.ts +11 -0
- package/src/providers/sansan/files.js +49 -0
- package/src/providers/sansan/organization-actions.d.ts +2 -0
- package/src/providers/sansan/organization-actions.js +198 -0
- package/src/providers/sansan/organization-columns.d.ts +2 -0
- package/src/providers/sansan/organization-columns.js +33 -0
- package/src/providers/sansan/organization.d.ts +2 -0
- package/src/providers/sansan/organization.js +88 -0
- package/src/providers/sansan/read.d.ts +2 -0
- package/src/providers/sansan/read.js +25 -0
- package/src/providers/sansan/request.d.ts +22 -0
- package/src/providers/sansan/request.js +94 -0
- package/src/providers/sansan/schemas.d.ts +7 -0
- package/src/providers/sansan/schemas.js +72 -0
- package/src/providers/shopee/runtime.d.ts +33 -29
- package/src/providers/shopee/runtime.js +166 -169
- package/src/providers/smarthr/actions.d.ts +2 -0
- package/src/providers/smarthr/actions.js +286 -0
- package/src/providers/smarthr/employee-runtime.d.ts +1 -0
- package/src/providers/smarthr/employee-runtime.js +63 -0
- package/src/providers/smarthr/employee-schema.d.ts +3 -0
- package/src/providers/smarthr/employee-schema.js +222 -0
- package/src/providers/smarthr/executors.d.ts +4 -0
- package/src/providers/smarthr/executors.js +35 -0
- package/src/providers/smarthr/pagination.d.ts +1 -0
- package/src/providers/smarthr/pagination.js +84 -0
- package/src/providers/smarthr/resource-routes.d.ts +16 -0
- package/src/providers/smarthr/resource-routes.js +163 -0
- package/src/providers/smarthr/runtime.d.ts +13 -0
- package/src/providers/smarthr/runtime.js +242 -0
- package/src/providers/smarthr/supplemental-actions.d.ts +2 -0
- package/src/providers/smarthr/supplemental-actions.js +541 -0
- package/src/providers/smooth/actions.d.ts +2 -0
- package/src/providers/smooth/actions.js +138 -0
- package/src/providers/smooth/executors.d.ts +4 -0
- package/src/providers/smooth/executors.js +102 -0
- package/src/providers/tapd/actions.d.ts +8 -0
- package/src/providers/tapd/actions.js +89 -0
- package/src/providers/tapd/executors.d.ts +4 -0
- package/src/providers/tapd/executors.js +137 -0
- package/src/providers/teable/runtime.js +12 -15
- package/src/providers/tencent_meeting_mcp/actions.d.ts +2 -0
- package/src/providers/tencent_meeting_mcp/actions.js +420 -0
- package/src/providers/tencent_meeting_mcp/executors.d.ts +4 -0
- package/src/providers/tencent_meeting_mcp/executors.js +117 -0
- package/src/providers/threatfox/executors.d.ts +4 -0
- package/src/providers/threatfox/executors.js +40 -0
- package/src/providers/threatfox/runtime.d.ts +15 -0
- package/src/providers/threatfox/runtime.js +128 -0
- package/src/providers/ticket_tailor/runtime.js +1 -1
- package/src/providers/ticketmaster/runtime.js +3 -6
- package/src/providers/timelinesai/runtime.js +13 -16
- package/src/providers/tradebee/actions.d.ts +2 -0
- package/src/providers/tradebee/actions.js +176 -0
- package/src/providers/tradebee/executors.d.ts +4 -0
- package/src/providers/tradebee/executors.js +83 -0
- package/src/providers/twittrapi/executors.d.ts +4 -0
- package/src/providers/twittrapi/executors.js +17 -0
- package/src/providers/twittrapi/runtime.d.ts +12 -0
- package/src/providers/twittrapi/runtime.js +203 -0
- package/src/providers/urlhaus/executors.d.ts +4 -0
- package/src/providers/urlhaus/executors.js +40 -0
- package/src/providers/urlhaus/runtime.d.ts +15 -0
- package/src/providers/urlhaus/runtime.js +142 -0
- package/src/providers/wangdian/runtime.js +16 -19
- package/src/providers/weread/actions.d.ts +2 -0
- package/src/providers/weread/actions.js +424 -0
- package/src/providers/weread/executors.d.ts +4 -0
- package/src/providers/weread/executors.js +98 -0
- package/src/providers/whatsapp/runtime.js +6 -1
- package/src/providers/workast/runtime.js +12 -17
- package/src/providers/youzan/runtime.js +21 -24
- package/src/providers/zenkit/runtime.js +13 -19
- package/src/providers/zhiliaobiaoxun/actions.d.ts +2 -0
- package/src/providers/zhiliaobiaoxun/actions.js +138 -0
- package/src/providers/zhiliaobiaoxun/executors.d.ts +4 -0
- package/src/providers/zhiliaobiaoxun/executors.js +78 -0
- package/src/server/api/auth.d.ts +2 -0
- package/src/server/api/auth.js +2 -1
- package/src/server/api/console-catalog-routes.d.ts +17 -0
- package/src/server/api/console-catalog-routes.js +88 -0
- package/src/server/api/console-oauth-routes.d.ts +18 -0
- package/src/server/api/console-oauth-routes.js +298 -0
- package/src/server/api/docs-routes.d.ts +12 -0
- package/src/server/api/docs-routes.js +38 -0
- package/src/server/api/http-utils.d.ts +1 -0
- package/src/server/api/http-utils.js +8 -0
- package/src/server/api/marketplace-routes.d.ts +7 -0
- package/src/server/api/marketplace-routes.js +62 -0
- package/src/server/api/mcp-routes.d.ts +18 -0
- package/src/server/api/mcp-routes.js +37 -0
- package/src/server/api/policy-routes.d.ts +13 -0
- package/src/server/api/policy-routes.js +50 -0
- package/src/server/api/policy-snapshot.d.ts +14 -0
- package/src/server/api/policy-snapshot.js +30 -0
- package/src/server/api/run-log-routes.d.ts +7 -0
- package/src/server/api/run-log-routes.js +70 -0
- package/src/server/api/runtime-api.d.ts +0 -7
- package/src/server/api/runtime-api.js +0 -13
- package/src/server/api/runtime-app-routes.d.ts +10 -0
- package/src/server/api/runtime-app-routes.js +72 -0
- package/src/server/api/runtime-catalog-routes.d.ts +37 -0
- package/src/server/api/runtime-catalog-routes.js +133 -0
- package/src/server/api/runtime-execution-routes.d.ts +16 -0
- package/src/server/api/runtime-execution-routes.js +198 -0
- package/src/server/api/saas-oauth-routes.d.ts +9 -0
- package/src/server/api/saas-oauth-routes.js +27 -0
- package/src/server/api/saas-project-routes.d.ts +7 -0
- package/src/server/api/saas-project-routes.js +16 -0
- package/src/server/api/transit-file-routes.d.ts +9 -0
- package/src/server/api/transit-file-routes.js +49 -0
- package/src/server/api/trigger-routes.d.ts +15 -0
- package/src/server/api/trigger-routes.js +48 -0
- package/src/server/connect-app.d.ts +1 -0
- package/src/server/connect-app.js +3 -1
- package/src/server/connect-server.d.ts +3 -54
- package/src/server/connect-server.js +95 -1148
- package/src/providers/fastmoss_mcp/official-tools.json +0 -2922
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
import { defineProviderAction } from "../../core/provider-definition.js";
|
|
3
|
+
export const wereadActions = [
|
|
4
|
+
defineProviderAction("weread", {
|
|
5
|
+
name: "search",
|
|
6
|
+
operationType: "read",
|
|
7
|
+
requiredScopes: [],
|
|
8
|
+
description: "Search WeRead. Choose scope explicitly; use the last searchIdx as maxIdx for the next page. Response group scope may differ from request scope.",
|
|
9
|
+
inputSchema: s.object("Parameters for search.", {
|
|
10
|
+
keyword: s.string("Search keywords.", { minLength: 1 }),
|
|
11
|
+
scope: {
|
|
12
|
+
...s.integer("Search type: 0 all, 10 ebooks, 16 web novels, 14 audio, 6 authors, 12 full text, 13 book lists, 2 public accounts, 4 articles."),
|
|
13
|
+
enum: [0, 10, 16, 14, 6, 12, 13, 2, 4],
|
|
14
|
+
},
|
|
15
|
+
maxIdx: s.integer("Pagination offset from the previous page; initially 0.", { minimum: 0 }),
|
|
16
|
+
count: s.integer("Page size; omit to use the upstream default.", { minimum: 1 }),
|
|
17
|
+
}, { required: ["keyword", "scope"] }),
|
|
18
|
+
outputSchema: s.looseObject("Search response.", {
|
|
19
|
+
sid: s.string("Search session ID."),
|
|
20
|
+
hasMore: s.integer("Whether another page exists: 1 means yes, 0 means no."),
|
|
21
|
+
results: s.array("Result groups; do not filter groups by the requested scope.", s.looseObject("A search result group.", {
|
|
22
|
+
scope: s.integer("Response group type; ebook groups can use 17."),
|
|
23
|
+
books: s.array("Results in this group.", s.looseObject("A search result.", {
|
|
24
|
+
searchIdx: s.integer("Pagination offset from the previous page; initially 0.", {
|
|
25
|
+
minimum: 0,
|
|
26
|
+
}),
|
|
27
|
+
bookInfo: s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
28
|
+
bookId: s.string("The book ID returned by search or the shelf.", {
|
|
29
|
+
minLength: 1,
|
|
30
|
+
}),
|
|
31
|
+
title: s.string("Book title."),
|
|
32
|
+
author: s.string("Book author."),
|
|
33
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
34
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
35
|
+
}),
|
|
36
|
+
})),
|
|
37
|
+
})),
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
defineProviderAction("weread", {
|
|
41
|
+
name: "get_book",
|
|
42
|
+
operationType: "read",
|
|
43
|
+
requiredScopes: [],
|
|
44
|
+
description: "Get book details by ID.",
|
|
45
|
+
inputSchema: s.object("Parameters for get_book.", { bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }) }, { required: ["bookId"] }),
|
|
46
|
+
outputSchema: s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
47
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
48
|
+
title: s.string("Book title."),
|
|
49
|
+
author: s.string("Book author."),
|
|
50
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
51
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
52
|
+
}),
|
|
53
|
+
}),
|
|
54
|
+
defineProviderAction("weread", {
|
|
55
|
+
name: "list_chapters",
|
|
56
|
+
operationType: "read",
|
|
57
|
+
requiredScopes: [],
|
|
58
|
+
description: "List a book's chapter table of contents.",
|
|
59
|
+
inputSchema: s.object("Parameters for list_chapters.", { bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }) }, { required: ["bookId"] }),
|
|
60
|
+
outputSchema: s.looseObject("Chapter listing.", {
|
|
61
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
62
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
63
|
+
chapters: s.array("Chapters in the book.", s.looseObject("Chapter details.", {
|
|
64
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
65
|
+
title: s.string("Chapter title."),
|
|
66
|
+
chapterIdx: s.integer("Chapter order."),
|
|
67
|
+
level: s.integer("Heading level, starting at 1."),
|
|
68
|
+
})),
|
|
69
|
+
}),
|
|
70
|
+
}),
|
|
71
|
+
defineProviderAction("weread", {
|
|
72
|
+
name: "get_reading_progress",
|
|
73
|
+
operationType: "read",
|
|
74
|
+
requiredScopes: [],
|
|
75
|
+
description: "Get reading progress. Progress 1 means 1%; completion requires progress 100 and finishTime.",
|
|
76
|
+
inputSchema: s.object("Parameters for get_reading_progress.", { bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }) }, { required: ["bookId"] }),
|
|
77
|
+
outputSchema: s.looseObject("Reading progress response.", {
|
|
78
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
79
|
+
book: s.looseObject("Reading progress and timestamps.", {
|
|
80
|
+
progress: s.integer("Reading percentage from 0 to 100, not a fraction."),
|
|
81
|
+
recordReadingTime: s.number("Accumulated reading time in seconds."),
|
|
82
|
+
finishTime: s.integer("Completion Unix timestamp, present only after finishing."),
|
|
83
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
84
|
+
}),
|
|
85
|
+
}),
|
|
86
|
+
}),
|
|
87
|
+
defineProviderAction("weread", {
|
|
88
|
+
name: "get_shelf",
|
|
89
|
+
operationType: "read",
|
|
90
|
+
requiredScopes: [],
|
|
91
|
+
description: "Read the shelf. Visible entries equal books.length + albums.length + 1 when mp is nonempty; bookCount excludes audio and mp.",
|
|
92
|
+
inputSchema: s.object("Parameters for get_shelf.", {}, { required: [] }),
|
|
93
|
+
outputSchema: s.looseObject("Shelf response.", {
|
|
94
|
+
books: s.array("Ebooks and imported books, excluding audio albums and the mp entry.", s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
95
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
96
|
+
title: s.string("Book title."),
|
|
97
|
+
author: s.string("Book author."),
|
|
98
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
99
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
100
|
+
})),
|
|
101
|
+
albums: s.array("Audiobook albums, which also count as shelf entries.", s.looseObject("Audio album metadata and listening state.", {})),
|
|
102
|
+
mp: s.looseObject("Article collection entry; a nonempty object counts as one private shelf entry.", {}),
|
|
103
|
+
archive: s.array("Book list folders.", s.looseObject("Folder name and book IDs.", {})),
|
|
104
|
+
bookCount: s.integer("Ebook count only; not the total shelf count."),
|
|
105
|
+
}),
|
|
106
|
+
}),
|
|
107
|
+
defineProviderAction("weread", {
|
|
108
|
+
name: "list_notebooks",
|
|
109
|
+
operationType: "read",
|
|
110
|
+
requiredScopes: [],
|
|
111
|
+
description: "List notebook summaries. Next lastSort is the final book's sort. Total notes include reviewCount + noteCount + bookmarkCount.",
|
|
112
|
+
inputSchema: s.object("Parameters for list_notebooks.", {
|
|
113
|
+
count: s.integer("Page size; omit to use the upstream default.", { minimum: 1 }),
|
|
114
|
+
lastSort: s.integer("The last book's sort value from the previous page; omit on the first page."),
|
|
115
|
+
}, { required: [] }),
|
|
116
|
+
outputSchema: s.looseObject("Notebook summaries and pagination.", {
|
|
117
|
+
totalBookCount: s.integer("Total number of books with notes."),
|
|
118
|
+
totalNoteCount: s.integer("Total highlights, personal reviews and bookmarks combined."),
|
|
119
|
+
hasMore: s.integer("Whether another page exists: 1 means yes, 0 means no."),
|
|
120
|
+
books: s.array("Books with notes.", s.looseObject("A notebook summary.", {
|
|
121
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
122
|
+
book: s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
123
|
+
bookId: s.string("The book ID returned by search or the shelf.", {
|
|
124
|
+
minLength: 1,
|
|
125
|
+
}),
|
|
126
|
+
title: s.string("Book title."),
|
|
127
|
+
author: s.string("Book author."),
|
|
128
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
129
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
130
|
+
}),
|
|
131
|
+
sort: s.integer("Cursor for the next lastSort request."),
|
|
132
|
+
noteCount: s.integer("Highlight count only, not the total note count."),
|
|
133
|
+
reviewCount: s.integer("Personal thoughts and reviews combined; do not count reviews twice."),
|
|
134
|
+
bookmarkCount: s.integer("Reading-position bookmark count; bookmark content cannot be exported."),
|
|
135
|
+
})),
|
|
136
|
+
}),
|
|
137
|
+
}),
|
|
138
|
+
defineProviderAction("weread", {
|
|
139
|
+
name: "list_highlights",
|
|
140
|
+
operationType: "read",
|
|
141
|
+
requiredScopes: [],
|
|
142
|
+
description: "List personal highlights in a book, excluding reading-position bookmarks. Query list_my_reviews as well to retrieve all exportable note content.",
|
|
143
|
+
inputSchema: s.object("Parameters for list_highlights.", { bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }) }, { required: ["bookId"] }),
|
|
144
|
+
outputSchema: s.looseObject("Personal highlight content.", {
|
|
145
|
+
updated: s.array("Highlights only; upstream filters out type 0 bookmarks.", s.looseObject("A personal highlight.", {
|
|
146
|
+
bookmarkId: s.string("Highlight ID."),
|
|
147
|
+
markText: s.string("Highlighted source text."),
|
|
148
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
149
|
+
createTime: s.integer("Creation Unix timestamp in seconds."),
|
|
150
|
+
})),
|
|
151
|
+
chapters: s.array("Chapter information used to locate highlights.", s.looseObject("Chapter metadata.", {})),
|
|
152
|
+
book: s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
153
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
154
|
+
title: s.string("Book title."),
|
|
155
|
+
author: s.string("Book author."),
|
|
156
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
157
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
158
|
+
}),
|
|
159
|
+
}),
|
|
160
|
+
}),
|
|
161
|
+
defineProviderAction("weread", {
|
|
162
|
+
name: "list_my_reviews",
|
|
163
|
+
operationType: "read",
|
|
164
|
+
requiredScopes: [],
|
|
165
|
+
description: "List personal thoughts, chapter comments and book reviews. Continue with the returned synckey while hasMore is 1.",
|
|
166
|
+
inputSchema: s.object("Parameters for list_my_reviews.", {
|
|
167
|
+
bookid: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
168
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
169
|
+
count: s.integer("Page size; omit to use the upstream default.", { minimum: 1 }),
|
|
170
|
+
}, { required: ["bookid"] }),
|
|
171
|
+
outputSchema: s.looseObject("Personal reviews and pagination.", {
|
|
172
|
+
reviews: s.array("Personal review entries.", s.looseObject("Personal review wrapper.", {
|
|
173
|
+
review: s.looseObject("Review details, including conditional abstract, range, content and author fields.", {
|
|
174
|
+
content: s.string("Review text."),
|
|
175
|
+
abstract: s.string("Highlighted source text, when this review refers to a passage."),
|
|
176
|
+
range: s.string("Position range of the source passage, when available."),
|
|
177
|
+
}),
|
|
178
|
+
})),
|
|
179
|
+
totalCount: s.integer("Total personal review count."),
|
|
180
|
+
hasMore: s.integer("Whether another page exists: 1 means yes, 0 means no."),
|
|
181
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
182
|
+
}),
|
|
183
|
+
}),
|
|
184
|
+
defineProviderAction("weread", {
|
|
185
|
+
name: "get_underline_stats",
|
|
186
|
+
operationType: "read",
|
|
187
|
+
requiredScopes: [],
|
|
188
|
+
description: "Get chapter highlight popularity statistics without source text.",
|
|
189
|
+
inputSchema: s.object("Parameters for get_underline_stats.", {
|
|
190
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
191
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
192
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
193
|
+
}, { required: ["bookId", "chapterUid"] }),
|
|
194
|
+
outputSchema: s.looseObject("Chapter highlight statistics.", {
|
|
195
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
196
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
197
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
198
|
+
underlines: s.array("Highlight counts and scores, without text.", s.looseObject("Highlight range, count, score and type.", {})),
|
|
199
|
+
}),
|
|
200
|
+
}),
|
|
201
|
+
defineProviderAction("weread", {
|
|
202
|
+
name: "list_popular_highlights",
|
|
203
|
+
operationType: "read",
|
|
204
|
+
requiredScopes: [],
|
|
205
|
+
description: "Get up to 20 popular highlights with source text. The upstream result is fixed-size and does not support pagination.",
|
|
206
|
+
inputSchema: s.object("Parameters for list_popular_highlights.", {
|
|
207
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
208
|
+
chapterUid: s.integer("Chapter UID; 0 means all chapters and is the default."),
|
|
209
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
210
|
+
}, { required: ["bookId"] }),
|
|
211
|
+
outputSchema: s.looseObject("Popular highlights.", {
|
|
212
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
213
|
+
totalCount: s.integer("Total popular highlight count, possibly larger than this fixed-size result."),
|
|
214
|
+
items: s.array("Popular highlight entries.", s.looseObject("A popular highlight.", {
|
|
215
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
216
|
+
range: s.string("Highlight position range for list_highlight_reviews."),
|
|
217
|
+
markText: s.string("Highlighted source text."),
|
|
218
|
+
totalCount: s.integer("Number of readers highlighting this passage."),
|
|
219
|
+
})),
|
|
220
|
+
chapters: s.array("Chapter information used to locate highlights.", s.looseObject("Chapter metadata.", {})),
|
|
221
|
+
}),
|
|
222
|
+
}),
|
|
223
|
+
defineProviderAction("weread", {
|
|
224
|
+
name: "list_highlight_reviews",
|
|
225
|
+
operationType: "read",
|
|
226
|
+
requiredScopes: [],
|
|
227
|
+
description: "List thoughts on specified highlight ranges, preserving per-range pagination.",
|
|
228
|
+
inputSchema: s.object("Parameters for list_highlight_reviews.", {
|
|
229
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
230
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
231
|
+
reviews: s.array("Highlight ranges and their independent page cursors.", s.object("A highlight range query.", {
|
|
232
|
+
range: s.string("Position range returned by list_popular_highlights.", {
|
|
233
|
+
minLength: 1,
|
|
234
|
+
}),
|
|
235
|
+
maxIdx: s.integer("Pagination offset from the previous page; initially 0.", {
|
|
236
|
+
minimum: 0,
|
|
237
|
+
}),
|
|
238
|
+
count: s.integer("Page size; values above 20 are truncated by the upstream service.", { minimum: 1 }),
|
|
239
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
240
|
+
}, { required: ["range"] })),
|
|
241
|
+
}, { required: ["bookId", "chapterUid", "reviews"] }),
|
|
242
|
+
outputSchema: s.looseObject("Thoughts for each requested range.", {
|
|
243
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
244
|
+
chapterUid: s.integer("The chapter UID returned by list_chapters."),
|
|
245
|
+
reviews: s.array("Per-range results and cursors.", s.looseObject("A range result.", {
|
|
246
|
+
range: s.string("Highlight position range."),
|
|
247
|
+
hasMore: s.integer("Whether another page exists: 1 means yes, 0 means no."),
|
|
248
|
+
maxIdx: s.integer("Pagination offset from the previous page; initially 0.", {
|
|
249
|
+
minimum: 0,
|
|
250
|
+
}),
|
|
251
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
252
|
+
totalCount: s.integer("Total thoughts for this range."),
|
|
253
|
+
pageReviews: s.array("Thoughts on this page.", s.looseObject("Thought wrapper.", {
|
|
254
|
+
review: s.looseObject("Review details, including conditional abstract, range, content and author fields.", {
|
|
255
|
+
content: s.string("Review text."),
|
|
256
|
+
abstract: s.string("Highlighted source text, when this review refers to a passage."),
|
|
257
|
+
range: s.string("Position range of the source passage, when available."),
|
|
258
|
+
}),
|
|
259
|
+
})),
|
|
260
|
+
})),
|
|
261
|
+
}),
|
|
262
|
+
}),
|
|
263
|
+
defineProviderAction("weread", {
|
|
264
|
+
name: "get_review",
|
|
265
|
+
operationType: "read",
|
|
266
|
+
requiredScopes: [],
|
|
267
|
+
description: "Get a single thought or review with optional comments and likes.",
|
|
268
|
+
inputSchema: s.object("Parameters for get_review.", {
|
|
269
|
+
reviewId: s.string("Thought or review ID.", { minLength: 1 }),
|
|
270
|
+
commentsCount: s.integer("Number of comments to fetch; default 10.", { minimum: 0 }),
|
|
271
|
+
commentsDirection: {
|
|
272
|
+
...s.integer("Comment order: 0 descending, 1 ascending."),
|
|
273
|
+
enum: [0, 1],
|
|
274
|
+
},
|
|
275
|
+
likesCount: s.integer("Number of likes to fetch; default 10.", { minimum: 0 }),
|
|
276
|
+
likesDirection: {
|
|
277
|
+
...s.integer("Like order; only 0 (descending) is documented."),
|
|
278
|
+
enum: [0],
|
|
279
|
+
},
|
|
280
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
281
|
+
}, { required: ["reviewId"] }),
|
|
282
|
+
outputSchema: s.looseObject("Thought or review details.", {
|
|
283
|
+
reviewId: s.string("Thought or review ID."),
|
|
284
|
+
review: s.looseObject("Review details, including conditional abstract, range, content and author fields.", {
|
|
285
|
+
content: s.string("Review text."),
|
|
286
|
+
abstract: s.string("Highlighted source text, when this review refers to a passage."),
|
|
287
|
+
range: s.string("Position range of the source passage, when available."),
|
|
288
|
+
}),
|
|
289
|
+
htmlContent: s.string("Upstream rich-text HTML."),
|
|
290
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
291
|
+
}),
|
|
292
|
+
}),
|
|
293
|
+
defineProviderAction("weread", {
|
|
294
|
+
name: "get_reading_stats",
|
|
295
|
+
operationType: "read",
|
|
296
|
+
requiredScopes: [],
|
|
297
|
+
description: "Get reading statistics for one period. Durations are seconds; annual mode covers only the selected calendar year.",
|
|
298
|
+
inputSchema: s.object("Parameters for get_reading_stats.", {
|
|
299
|
+
mode: s.stringEnum("Period: weekly, monthly (default), annually or overall.", [
|
|
300
|
+
"weekly",
|
|
301
|
+
"monthly",
|
|
302
|
+
"annually",
|
|
303
|
+
"overall",
|
|
304
|
+
]),
|
|
305
|
+
baseTime: s.integer("Unix timestamp in the desired period; 0 selects the current period. Overall always uses 0."),
|
|
306
|
+
}, { required: [] }),
|
|
307
|
+
outputSchema: s.looseObject("Reading statistics; fields vary with mode and available data.", {
|
|
308
|
+
baseTime: s.integer("Normalized period start Unix timestamp; 0 for overall."),
|
|
309
|
+
totalReadTime: s.number("Total reading and listening time in seconds for this period; prefer this over summing buckets."),
|
|
310
|
+
dayAverageReadTime: s.number("Average seconds per calendar day, not per active reading day."),
|
|
311
|
+
readDays: s.integer("Effective reading days, currently days with at least one minute of reading."),
|
|
312
|
+
readTimes: s.record("Bucket start timestamps mapped to reading seconds.", s.number("Reading seconds in this bucket.")),
|
|
313
|
+
dailyReadTimes: s.record("Optional daily timestamp-to-seconds map in annual mode.", s.number("Reading seconds on this day.")),
|
|
314
|
+
preferTime: s.array("Hourly reading seconds ordered from 06:00 through 05:00 the next day.", s.number("Reading seconds in this hour.")),
|
|
315
|
+
preferAuthor: s.array("Preferred authors.", s.looseObject("Author preference.", {
|
|
316
|
+
name: s.string("Author name."),
|
|
317
|
+
readTime: s.string("Formatted duration text, not a number of seconds."),
|
|
318
|
+
})),
|
|
319
|
+
readLongest: s.array("Top books or audio albums by reading time, up to 10 entries.", s.looseObject("A reading-time ranking entry.", {
|
|
320
|
+
book: s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
321
|
+
bookId: s.string("The book ID returned by search or the shelf.", {
|
|
322
|
+
minLength: 1,
|
|
323
|
+
}),
|
|
324
|
+
title: s.string("Book title."),
|
|
325
|
+
author: s.string("Book author."),
|
|
326
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
327
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
328
|
+
}),
|
|
329
|
+
albumInfo: s.looseObject("Audio album metadata when this is audio content.", {}),
|
|
330
|
+
readTime: s.number("Reading or listening time in seconds for this period."),
|
|
331
|
+
})),
|
|
332
|
+
readStat: s.array("Upstream reading summary labels and formatted counts.", s.looseObject("Summary stat, counts and optional scheme.", {})),
|
|
333
|
+
}),
|
|
334
|
+
}),
|
|
335
|
+
defineProviderAction("weread", {
|
|
336
|
+
name: "list_book_reviews",
|
|
337
|
+
operationType: "read",
|
|
338
|
+
requiredScopes: [],
|
|
339
|
+
description: "List public book reviews. Continue with the last idx and returned synckey. Content is nested at reviews[].review.review.",
|
|
340
|
+
inputSchema: s.object("Parameters for list_book_reviews.", {
|
|
341
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
342
|
+
reviewListType: {
|
|
343
|
+
...s.integer("Filter: 0 all, 1 recommended, 2 negative, 3 newest, 4 average."),
|
|
344
|
+
enum: [0, 1, 2, 3, 4],
|
|
345
|
+
},
|
|
346
|
+
count: s.integer("Page size; omit to use the upstream default.", { minimum: 1 }),
|
|
347
|
+
maxIdx: s.integer("Pagination offset from the previous page; initially 0.", { minimum: 0 }),
|
|
348
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
349
|
+
}, { required: ["bookId"] }),
|
|
350
|
+
outputSchema: s.looseObject("Public reviews and pagination.", {
|
|
351
|
+
synckey: s.integer("The sync or pagination key returned by the previous response; initially 0."),
|
|
352
|
+
reviewsCnt: s.integer("Total public review count."),
|
|
353
|
+
reviewsHasMore: s.integer("Whether another page exists: 1 means yes, 0 means no."),
|
|
354
|
+
reviews: s.array("Public review entries with two review wrappers.", s.looseObject("Public review list entry.", {
|
|
355
|
+
idx: s.integer("Pagination offset from the previous page; initially 0.", {
|
|
356
|
+
minimum: 0,
|
|
357
|
+
}),
|
|
358
|
+
review: s.looseObject("Public review wrapper.", {
|
|
359
|
+
reviewId: s.string("Review ID."),
|
|
360
|
+
review: s.looseObject("Public review body.", {
|
|
361
|
+
content: s.string("Review text."),
|
|
362
|
+
star: s.integer("Rating: 20, 40, 60, 80 and 100 correspond to one through five stars."),
|
|
363
|
+
}),
|
|
364
|
+
}),
|
|
365
|
+
})),
|
|
366
|
+
}),
|
|
367
|
+
}),
|
|
368
|
+
defineProviderAction("weread", {
|
|
369
|
+
name: "list_recommendations",
|
|
370
|
+
operationType: "read",
|
|
371
|
+
requiredScopes: [],
|
|
372
|
+
description: "List personalized book recommendations. Continue with the last book's searchIdx as maxIdx.",
|
|
373
|
+
inputSchema: s.object("Parameters for list_recommendations.", {
|
|
374
|
+
count: s.integer("Page size; omit to use the upstream default.", { minimum: 1 }),
|
|
375
|
+
maxIdx: s.integer("Pagination offset from the previous page; initially 0.", { minimum: 0 }),
|
|
376
|
+
}, { required: [] }),
|
|
377
|
+
outputSchema: s.looseObject("Personalized recommendations.", {
|
|
378
|
+
books: s.array("Recommended books.", s.looseObject("A recommended book.", {
|
|
379
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
380
|
+
title: s.string("Book title."),
|
|
381
|
+
author: s.string("Book author."),
|
|
382
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
383
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
384
|
+
searchIdx: s.integer("Pagination offset from the previous page; initially 0.", {
|
|
385
|
+
minimum: 0,
|
|
386
|
+
}),
|
|
387
|
+
reason: s.string("Recommendation reason."),
|
|
388
|
+
})),
|
|
389
|
+
}),
|
|
390
|
+
}),
|
|
391
|
+
defineProviderAction("weread", {
|
|
392
|
+
name: "list_similar_books",
|
|
393
|
+
operationType: "read",
|
|
394
|
+
requiredScopes: [],
|
|
395
|
+
description: "List similar books. Defaults to count 12 and maxIdx 0; continue with the last idx and returned sessionId.",
|
|
396
|
+
inputSchema: s.object("Parameters for list_similar_books.", {
|
|
397
|
+
bookId: s.string("The book ID returned by search or the shelf.", { minLength: 1 }),
|
|
398
|
+
count: s.integer("Page size; omit to use the upstream default.", { minimum: 1 }),
|
|
399
|
+
maxIdx: s.integer("Pagination offset from the previous page; initially 0.", { minimum: 0 }),
|
|
400
|
+
sessionId: s.string("Session ID from the previous page; omit on the first page."),
|
|
401
|
+
}, { required: ["bookId"] }),
|
|
402
|
+
outputSchema: s.looseObject("Similar book recommendations.", {
|
|
403
|
+
booksimilar: s.looseObject("Similar books and their session.", {
|
|
404
|
+
sessionId: s.string("Session ID to send with the next page."),
|
|
405
|
+
books: s.array("Similar book entries.", s.looseObject("A similar book result.", {
|
|
406
|
+
idx: s.integer("Pagination offset from the previous page; initially 0.", {
|
|
407
|
+
minimum: 0,
|
|
408
|
+
}),
|
|
409
|
+
book: s.looseObject("Book result wrapper.", {
|
|
410
|
+
bookInfo: s.looseObject("Book metadata, including any upstream links and additional fields.", {
|
|
411
|
+
bookId: s.string("The book ID returned by search or the shelf.", {
|
|
412
|
+
minLength: 1,
|
|
413
|
+
}),
|
|
414
|
+
title: s.string("Book title."),
|
|
415
|
+
author: s.string("Book author."),
|
|
416
|
+
readerLink: s.string("Use this upstream reader URL to open the book; do not construct a URL."),
|
|
417
|
+
deepLink: s.string("Book details link; use when readerLink is absent."),
|
|
418
|
+
}),
|
|
419
|
+
}),
|
|
420
|
+
})),
|
|
421
|
+
}),
|
|
422
|
+
}),
|
|
423
|
+
}),
|
|
424
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CredentialValidators, ProviderExecutors, ProviderProxyExecutor } from "../../core/types.ts";
|
|
2
|
+
export declare const executors: ProviderExecutors;
|
|
3
|
+
export declare const credentialValidators: CredentialValidators;
|
|
4
|
+
export declare const proxy: ProviderProxyExecutor;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { optionalRecord, optionalRawString } from "../../core/cast.js";
|
|
2
|
+
import { requiredInputString, requiredResponseRecord, ProviderRequestError, runProviderRequest, defineApiKeyProviderExecutors, defineProviderProxy, mapProviderActionHandlers, readProviderProxyErrorMessage, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
3
|
+
import { wereadActions } from "./actions.js";
|
|
4
|
+
const baseUrl = "https://i.weread.qq.com";
|
|
5
|
+
const skillVersion = "1.0.5";
|
|
6
|
+
const defaultHeaders = { accept: "application/json", "content-type": "application/json" };
|
|
7
|
+
const routes = {
|
|
8
|
+
search: "/store/search",
|
|
9
|
+
get_book: "/book/info",
|
|
10
|
+
list_chapters: "/book/chapterinfo",
|
|
11
|
+
get_reading_progress: "/book/getprogress",
|
|
12
|
+
get_shelf: "/shelf/sync",
|
|
13
|
+
list_notebooks: "/user/notebooks",
|
|
14
|
+
list_highlights: "/book/bookmarklist",
|
|
15
|
+
list_my_reviews: "/review/list/mine",
|
|
16
|
+
get_underline_stats: "/book/underlines",
|
|
17
|
+
list_popular_highlights: "/book/bestbookmarks",
|
|
18
|
+
list_highlight_reviews: "/book/readreviews",
|
|
19
|
+
get_review: "/review/single",
|
|
20
|
+
get_reading_stats: "/readdata/detail",
|
|
21
|
+
list_book_reviews: "/review/list",
|
|
22
|
+
list_recommendations: "/book/recommend",
|
|
23
|
+
list_similar_books: "/book/similar",
|
|
24
|
+
};
|
|
25
|
+
async function request({ apiName, fields, apiKey, fetcher, parentSignal }) {
|
|
26
|
+
return runProviderRequest({ signal: parentSignal, label: "WeRead" }, async (signal) => {
|
|
27
|
+
const response = await fetcher(`${baseUrl}/api/agent/gateway`, {
|
|
28
|
+
method: "POST",
|
|
29
|
+
signal,
|
|
30
|
+
headers: { ...defaultHeaders, authorization: `Bearer ${apiKey}` },
|
|
31
|
+
body: JSON.stringify({ ...fields, api_name: apiName, skill_version: skillVersion }),
|
|
32
|
+
});
|
|
33
|
+
const text = await response.text();
|
|
34
|
+
let payload;
|
|
35
|
+
try {
|
|
36
|
+
payload = JSON.parse(text);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
payload = undefined;
|
|
40
|
+
}
|
|
41
|
+
const record = optionalRecord(payload);
|
|
42
|
+
const code = record?.errcode;
|
|
43
|
+
if (!response.ok || (code !== undefined && code !== 0 && code !== "0")) {
|
|
44
|
+
const detail = optionalRawString(record?.errmsg) || optionalRawString(record?.message) || optionalRawString(record?.error);
|
|
45
|
+
const message = `WeRead request failed${code === undefined ? "" : ` (errcode ${String(code)})`}: ${detail || (record ? `HTTP ${response.status}` : text) || `HTTP ${response.status}`}`;
|
|
46
|
+
throw new ProviderRequestError(response.ok ? 502 : response.status, message.split(apiKey).join("[REDACTED]"), undefined, response.status === 429 ? "rate_limited" : "provider_error");
|
|
47
|
+
}
|
|
48
|
+
const result = requiredResponseRecord(payload, "WeRead response");
|
|
49
|
+
if (result.upgrade_info != null) {
|
|
50
|
+
const message = optionalRawString(optionalRecord(result.upgrade_info)?.message);
|
|
51
|
+
throw new ProviderRequestError(502, `WeRead integration version ${skillVersion} requires an update${message ? `: ${message.split(apiKey).join("[REDACTED]")}` : ""}`, undefined, "provider_error");
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const handlers = mapProviderActionHandlers("weread", wereadActions, (action) => async (dataInput, context) => {
|
|
57
|
+
const route = routes[action.name];
|
|
58
|
+
const fields = dataInput;
|
|
59
|
+
const body = action.name === "list_similar_books"
|
|
60
|
+
? { ...fields, count: fields.count ?? 12, maxIdx: fields.maxIdx ?? 0 }
|
|
61
|
+
: fields;
|
|
62
|
+
return request({
|
|
63
|
+
apiName: route,
|
|
64
|
+
fields: body,
|
|
65
|
+
apiKey: context.apiKey,
|
|
66
|
+
fetcher: context.fetcher,
|
|
67
|
+
parentSignal: context.signal,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
export const executors = defineApiKeyProviderExecutors("weread", handlers, {
|
|
71
|
+
skipDnsValidation: true,
|
|
72
|
+
});
|
|
73
|
+
export const credentialValidators = {
|
|
74
|
+
async apiKey(input, { fetcher, signal }) {
|
|
75
|
+
await request({
|
|
76
|
+
apiName: "/_list",
|
|
77
|
+
fields: {},
|
|
78
|
+
apiKey: requiredInputString(input.apiKey, "API Key"),
|
|
79
|
+
fetcher: fetcher,
|
|
80
|
+
parentSignal: signal,
|
|
81
|
+
});
|
|
82
|
+
return { profile: { displayName: "WeRead API Key" }, grantedScopes: [], metadata: { apiBaseUrl: baseUrl } };
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
export const proxy = defineProviderProxy({
|
|
86
|
+
service: "weread",
|
|
87
|
+
baseUrl,
|
|
88
|
+
auth: { type: "api_key_authorization", prefix: "Bearer " },
|
|
89
|
+
skipDnsValidation: true,
|
|
90
|
+
customizeRequest({ headers }) {
|
|
91
|
+
for (const [name, value] of Object.entries({ accept: "application/json", "content-type": "application/json" }))
|
|
92
|
+
if (!headers.has(name))
|
|
93
|
+
headers.set(name, value);
|
|
94
|
+
},
|
|
95
|
+
async readError(response) {
|
|
96
|
+
return new ProviderRequestError(response.status, await readProviderProxyErrorMessage(response, "Provider request failed"), withRetryAfterSeconds(response), response.status === 429 ? "rate_limited" : "provider_error");
|
|
97
|
+
},
|
|
98
|
+
});
|
|
@@ -762,10 +762,15 @@ function normalizePaging(value) {
|
|
|
762
762
|
after: readString(cursorsRecord.after),
|
|
763
763
|
})
|
|
764
764
|
: undefined;
|
|
765
|
+
const next = readString(record.next);
|
|
765
766
|
return compactObject({
|
|
766
767
|
cursors,
|
|
767
768
|
previous: readString(record.previous),
|
|
768
|
-
next
|
|
769
|
+
next,
|
|
770
|
+
// Meta keeps `cursors.after` on the final page and signals the end by
|
|
771
|
+
// omitting `next`; a caller walking `after` alone cannot tell the last
|
|
772
|
+
// page from a middle one, so the end is spelled out as a boolean.
|
|
773
|
+
hasMore: next !== undefined,
|
|
769
774
|
});
|
|
770
775
|
}
|
|
771
776
|
function requireWabaId(input, context, actionName) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compactObject, optionalBoolean, optionalInteger, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
|
|
2
|
+
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, providerInputError, providerResponseError, } from "../provider-runtime.js";
|
|
3
3
|
export const workastApiBaseUrl = "https://api.todobot.io";
|
|
4
4
|
const taskWriteKeys = ["text", "description", "startDate", "dueDate", "dueDateTimezone", "dueDateTime"];
|
|
5
5
|
export const workastActionHandlers = {
|
|
@@ -89,7 +89,7 @@ export const workastActionHandlers = {
|
|
|
89
89
|
const taskId = requireString(input.taskId, "taskId");
|
|
90
90
|
const body = compactObject(pickTaskWriteFields(input));
|
|
91
91
|
if (Object.keys(body).length == 0) {
|
|
92
|
-
throw
|
|
92
|
+
throw providerInputError("update_task requires at least one field to update");
|
|
93
93
|
}
|
|
94
94
|
const task = await requestWorkastJson({
|
|
95
95
|
apiKey: context.apiKey,
|
|
@@ -164,17 +164,14 @@ async function requestWorkastJson(options) {
|
|
|
164
164
|
if (error instanceof ProviderRequestError)
|
|
165
165
|
throw error;
|
|
166
166
|
if (timeout.didTimeout() || isAbortLikeError(error)) {
|
|
167
|
-
throw
|
|
167
|
+
throw new ProviderRequestError(504, "Workast request timed out");
|
|
168
168
|
}
|
|
169
|
-
throw
|
|
169
|
+
throw providerResponseError(error instanceof Error ? `Workast request failed: ${error.message}` : "Workast request failed");
|
|
170
170
|
}
|
|
171
171
|
finally {
|
|
172
172
|
timeout.cleanup();
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function providerError(_code, message, status) {
|
|
176
|
-
return new ProviderRequestError(status, message);
|
|
177
|
-
}
|
|
178
175
|
function appendQuery(url, query) {
|
|
179
176
|
for (const [name, value] of Object.entries(query ?? {})) {
|
|
180
177
|
if (value !== undefined)
|
|
@@ -189,22 +186,20 @@ async function readResponsePayload(response) {
|
|
|
189
186
|
return JSON.parse(text);
|
|
190
187
|
}
|
|
191
188
|
catch {
|
|
192
|
-
throw
|
|
189
|
+
throw providerResponseError("Workast returned invalid JSON");
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
192
|
function mapWorkastError(status, payload, phase) {
|
|
196
193
|
const message = readErrorMessage(payload) ?? `Workast API request failed with status ${status}`;
|
|
197
194
|
if (status == 401 || status == 403) {
|
|
198
|
-
return phase == "validate"
|
|
199
|
-
? providerError("invalid_input", message, 400)
|
|
200
|
-
: providerError("credential_expired", message, 401);
|
|
195
|
+
return phase == "validate" ? providerInputError(message) : new ProviderRequestError(401, message);
|
|
201
196
|
}
|
|
202
197
|
if (status == 429)
|
|
203
|
-
return
|
|
198
|
+
return new ProviderRequestError(429, message);
|
|
204
199
|
if (status == 400 || status == 404 || status == 409 || status == 422) {
|
|
205
|
-
return
|
|
200
|
+
return providerInputError(message);
|
|
206
201
|
}
|
|
207
|
-
return
|
|
202
|
+
return providerResponseError(message);
|
|
208
203
|
}
|
|
209
204
|
function readErrorMessage(payload) {
|
|
210
205
|
const record = optionalRecord(payload);
|
|
@@ -213,7 +208,7 @@ function readErrorMessage(payload) {
|
|
|
213
208
|
function requireArrayPayload(payload, fieldName) {
|
|
214
209
|
const candidate = Array.isArray(payload) ? payload : optionalRecord(payload)?.[fieldName];
|
|
215
210
|
if (!Array.isArray(candidate)) {
|
|
216
|
-
throw
|
|
211
|
+
throw providerResponseError(`Workast returned an invalid ${fieldName} payload`);
|
|
217
212
|
}
|
|
218
213
|
return candidate.map((item) => requireObjectPayload(item, fieldName));
|
|
219
214
|
}
|
|
@@ -222,13 +217,13 @@ function requireObjectPayload(payload, fieldName) {
|
|
|
222
217
|
const nested = optionalRecord(record?.[fieldName]);
|
|
223
218
|
const candidate = nested ?? record;
|
|
224
219
|
if (!candidate) {
|
|
225
|
-
throw
|
|
220
|
+
throw providerResponseError(`Workast returned an invalid ${fieldName} payload`);
|
|
226
221
|
}
|
|
227
222
|
return candidate;
|
|
228
223
|
}
|
|
229
224
|
function requireString(value, fieldName) {
|
|
230
225
|
if (typeof value != "string" || value.trim() == "") {
|
|
231
|
-
throw
|
|
226
|
+
throw providerInputError(`${fieldName} must be a non-empty string`);
|
|
232
227
|
}
|
|
233
228
|
return value;
|
|
234
229
|
}
|