@struktoai/mirage-browser 0.0.4 → 0.0.5
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/README.md +2 -1
- package/dist/aliyun-DR6KT3H6.js +8 -0
- package/dist/backblaze-XCLZXTES.js +8 -0
- package/dist/box-XBCSU3AA.js +8 -0
- package/dist/ceph-F5S2NMTO.js +8 -0
- package/dist/{chunk-DGP3N4WM.js → chunk-2J35WXX5.js} +7 -2
- package/dist/chunk-2J35WXX5.js.map +1 -0
- package/dist/{chunk-LW56WZDS.js → chunk-2WNXK742.js} +2 -2
- package/dist/{chunk-PSEXJ5S5.js → chunk-2WSKXBSV.js} +11 -2
- package/dist/chunk-2WSKXBSV.js.map +1 -0
- package/dist/{chunk-DKPDXQML.js → chunk-3IYCVC7W.js} +7 -3
- package/dist/chunk-3IYCVC7W.js.map +1 -0
- package/dist/{chunk-NVGB3B7J.js → chunk-46HNNKFR.js} +7 -3
- package/dist/chunk-46HNNKFR.js.map +1 -0
- package/dist/chunk-4IF4TGAI.js +11 -0
- package/dist/chunk-4IF4TGAI.js.map +1 -0
- package/dist/{chunk-AUXZEXCG.js → chunk-5OZJMTYW.js} +7 -3
- package/dist/{chunk-AUXZEXCG.js.map → chunk-5OZJMTYW.js.map} +1 -1
- package/dist/{chunk-6BXVYCIC.js → chunk-5UM6EBVW.js} +10 -2
- package/dist/chunk-5UM6EBVW.js.map +1 -0
- package/dist/{chunk-JV4T5HNB.js → chunk-6HRSCX2U.js} +7 -3
- package/dist/chunk-6HRSCX2U.js.map +1 -0
- package/dist/{chunk-EDS5Q5B7.js → chunk-7HWQAYXR.js} +7 -3
- package/dist/chunk-7HWQAYXR.js.map +1 -0
- package/dist/{chunk-2R7SPBTM.js → chunk-AUZNQ7EI.js} +5 -10
- package/dist/chunk-AUZNQ7EI.js.map +1 -0
- package/dist/{chunk-DC6VA36O.js → chunk-BGA2F226.js} +19 -7
- package/dist/chunk-BGA2F226.js.map +1 -0
- package/dist/{chunk-NYTRDAWX.js → chunk-BV372CUO.js} +6 -11
- package/dist/chunk-BV372CUO.js.map +1 -0
- package/dist/{chunk-HTQ4GBKM.js → chunk-C4THTILY.js} +7 -3
- package/dist/chunk-C4THTILY.js.map +1 -0
- package/dist/{chunk-GENFT46X.js → chunk-D4MEOKNQ.js} +7 -3
- package/dist/chunk-D4MEOKNQ.js.map +1 -0
- package/dist/chunk-D4RAMWYH.js +88 -0
- package/dist/chunk-D4RAMWYH.js.map +1 -0
- package/dist/{chunk-3FZ3GHZO.js → chunk-EHIT6WCY.js} +7 -3
- package/dist/chunk-EHIT6WCY.js.map +1 -0
- package/dist/{chunk-PCC6EZIE.js → chunk-EN6TZYT2.js} +7 -3
- package/dist/chunk-EN6TZYT2.js.map +1 -0
- package/dist/{chunk-MB4TUUJQ.js → chunk-FTDVV7EQ.js} +7 -3
- package/dist/chunk-FTDVV7EQ.js.map +1 -0
- package/dist/{chunk-VASFK7V6.js → chunk-G67Q2Z6I.js} +7 -3
- package/dist/{chunk-VASFK7V6.js.map → chunk-G67Q2Z6I.js.map} +1 -1
- package/dist/{chunk-AAJQ6AQT.js → chunk-GM2QMJAY.js} +5 -10
- package/dist/chunk-GM2QMJAY.js.map +1 -0
- package/dist/{chunk-POJ3IQMQ.js → chunk-HRWLHJX2.js} +5 -11
- package/dist/chunk-HRWLHJX2.js.map +1 -0
- package/dist/{chunk-AUKVYHNZ.js → chunk-INEXV2PN.js} +7 -3
- package/dist/chunk-INEXV2PN.js.map +1 -0
- package/dist/chunk-IZMKMD3O.js +11 -0
- package/dist/chunk-IZMKMD3O.js.map +1 -0
- package/dist/{chunk-N5VRBFRT.js → chunk-JUVMJ5GI.js} +5 -10
- package/dist/{chunk-HPID7BWJ.js.map → chunk-JUVMJ5GI.js.map} +1 -1
- package/dist/{chunk-GQVJTQXU.js → chunk-L64GRKOD.js} +7 -2
- package/dist/chunk-L64GRKOD.js.map +1 -0
- package/dist/chunk-M2UF2JHJ.js +11 -0
- package/dist/chunk-M2UF2JHJ.js.map +1 -0
- package/dist/{chunk-5ZNWDS5I.js → chunk-NVHPJ5CV.js} +11 -2
- package/dist/chunk-NVHPJ5CV.js.map +1 -0
- package/dist/{chunk-MQMUOJZ2.js → chunk-OSTDTTWI.js} +7 -2
- package/dist/chunk-OSTDTTWI.js.map +1 -0
- package/dist/{chunk-GZFNGV55.js → chunk-PQCRGTSA.js} +7 -3
- package/dist/chunk-PQCRGTSA.js.map +1 -0
- package/dist/{chunk-6ETIHSTA.js → chunk-QE7QNA45.js} +6 -2
- package/dist/{chunk-6ETIHSTA.js.map → chunk-QE7QNA45.js.map} +1 -1
- package/dist/{chunk-EHTYPBGX.js → chunk-QG2NUNCY.js} +7 -3
- package/dist/chunk-QG2NUNCY.js.map +1 -0
- package/dist/chunk-UFHBDBZD.js +1212 -0
- package/dist/chunk-UFHBDBZD.js.map +1 -0
- package/dist/{chunk-E77ESWWV.js → chunk-UY22T4AC.js} +11 -3
- package/dist/chunk-UY22T4AC.js.map +1 -0
- package/dist/chunk-XJBC3OYX.js +11 -0
- package/dist/chunk-XJBC3OYX.js.map +1 -0
- package/dist/{chunk-TCFD6YJ5.js → chunk-Y6DYUK6J.js} +7 -3
- package/dist/chunk-Y6DYUK6J.js.map +1 -0
- package/dist/{chunk-HPID7BWJ.js → chunk-YOCTIHQZ.js} +5 -1
- package/dist/chunk-YOCTIHQZ.js.map +1 -0
- package/dist/{chunk-PDZSZ5CB.js → chunk-ZDJPUXYH.js} +6 -2
- package/dist/{chunk-PDZSZ5CB.js.map → chunk-ZDJPUXYH.js.map} +1 -1
- package/dist/{chunk-CQERQTAZ.js → chunk-ZKCOSE3R.js} +6 -9
- package/dist/chunk-ZKCOSE3R.js.map +1 -0
- package/dist/chunk-ZTHVEXIV.js +11 -0
- package/dist/chunk-ZTHVEXIV.js.map +1 -0
- package/dist/{config-MHBKYS53.js → config-2Y6LZKLV.js} +2 -2
- package/dist/config-4GSOMUMF.js +9 -0
- package/dist/config-5YBUWFUP.js +9 -0
- package/dist/{config-PWZXYJOI.js → config-DE5OZ4I7.js} +2 -2
- package/dist/config-ELDOFRJW.js +9 -0
- package/dist/config-FPM3LAW7.js +9 -0
- package/dist/{config-22T7HJBJ.js → config-JY557MA6.js} +2 -2
- package/dist/config-WRACCRPN.js +9 -0
- package/dist/digitalocean-QDHTRS2W.js +8 -0
- package/dist/discord-ERUI7OAQ.js +7 -0
- package/dist/dropbox-3U6D4HLE.js +8 -0
- package/dist/gcal-MTBSDG34.js +8 -0
- package/dist/gcs-KNGRBBET.js +8 -0
- package/dist/gdocs-RUIOIRKP.js +8 -0
- package/dist/gdrive-5JB7ZKEP.js +8 -0
- package/dist/github-CIXBFBVO.js +7 -0
- package/dist/github_ci-HR6YOYAO.js +8 -0
- package/dist/{gmail-HLZIMKQU.js → gmail-JHGWTQU5.js} +2 -2
- package/dist/gsheets-N54JO2RS.js +8 -0
- package/dist/gslides-B4VMNLMB.js +8 -0
- package/dist/index.d.ts +284 -352
- package/dist/index.js +165 -104
- package/dist/index.js.map +1 -1
- package/dist/langfuse-HEUJGDOC.js +7 -0
- package/dist/linear-J4QQ3CA6.js +7 -0
- package/dist/minio-BXWHJ6K5.js +8 -0
- package/dist/notion-I5S5SRLO.js +7 -0
- package/dist/oci-XOPKH4AE.js +8 -0
- package/dist/opfs-36QO72Y5.js +7 -0
- package/dist/qingstor-JKAHLK62.js +8 -0
- package/dist/r2-L3QXQ76M.js +8 -0
- package/dist/{s3-CSFY3PLT.js → s3-LRZJPGHK.js} +2 -2
- package/dist/scaleway-CGNDYNKS.js +8 -0
- package/dist/seaweedfs-BSQWCBIR.js +8 -0
- package/dist/slack-62ECSENR.js +7 -0
- package/dist/supabase-J66NXWAF.js +8 -0
- package/dist/tencent-AC667LV3.js +8 -0
- package/dist/trello-SUPG6VDF.js +7 -0
- package/dist/trello-SUPG6VDF.js.map +1 -0
- package/dist/wasabi-5KKPW6LH.js +8 -0
- package/dist/wasabi-5KKPW6LH.js.map +1 -0
- package/package.json +2 -2
- package/dist/aliyun-YEWHEWCL.js +0 -8
- package/dist/backblaze-LWE2HEDK.js +0 -8
- package/dist/box-GTWWIB6F.js +0 -8
- package/dist/ceph-ATSCSVGU.js +0 -8
- package/dist/chunk-23NO22WD.js +0 -25
- package/dist/chunk-23NO22WD.js.map +0 -1
- package/dist/chunk-2R7SPBTM.js.map +0 -1
- package/dist/chunk-3FZ3GHZO.js.map +0 -1
- package/dist/chunk-4YUYQTRN.js +0 -2334
- package/dist/chunk-4YUYQTRN.js.map +0 -1
- package/dist/chunk-5ZNWDS5I.js.map +0 -1
- package/dist/chunk-6BXVYCIC.js.map +0 -1
- package/dist/chunk-AAJQ6AQT.js.map +0 -1
- package/dist/chunk-AUKVYHNZ.js.map +0 -1
- package/dist/chunk-CQERQTAZ.js.map +0 -1
- package/dist/chunk-DC6VA36O.js.map +0 -1
- package/dist/chunk-DGP3N4WM.js.map +0 -1
- package/dist/chunk-DKPDXQML.js.map +0 -1
- package/dist/chunk-DQK6H5LW.js +0 -25
- package/dist/chunk-DQK6H5LW.js.map +0 -1
- package/dist/chunk-E77ESWWV.js.map +0 -1
- package/dist/chunk-EDS5Q5B7.js.map +0 -1
- package/dist/chunk-EHTYPBGX.js.map +0 -1
- package/dist/chunk-GENFT46X.js.map +0 -1
- package/dist/chunk-GQVJTQXU.js.map +0 -1
- package/dist/chunk-GZFNGV55.js.map +0 -1
- package/dist/chunk-HTQ4GBKM.js.map +0 -1
- package/dist/chunk-JV4T5HNB.js.map +0 -1
- package/dist/chunk-MB4TUUJQ.js.map +0 -1
- package/dist/chunk-MQMUOJZ2.js.map +0 -1
- package/dist/chunk-N5VRBFRT.js.map +0 -1
- package/dist/chunk-NVGB3B7J.js.map +0 -1
- package/dist/chunk-NYTRDAWX.js.map +0 -1
- package/dist/chunk-PCC6EZIE.js.map +0 -1
- package/dist/chunk-POJ3IQMQ.js.map +0 -1
- package/dist/chunk-PSEXJ5S5.js.map +0 -1
- package/dist/chunk-QXJP6TWI.js +0 -27
- package/dist/chunk-QXJP6TWI.js.map +0 -1
- package/dist/chunk-TCFD6YJ5.js.map +0 -1
- package/dist/chunk-ZLHC2CZ6.js +0 -25
- package/dist/chunk-ZLHC2CZ6.js.map +0 -1
- package/dist/config-A56HUM6C.js +0 -9
- package/dist/config-DIWQZBOK.js +0 -9
- package/dist/config-HGJ2MGAC.js +0 -9
- package/dist/config-PAHALM2T.js +0 -9
- package/dist/digitalocean-SQA6MJJQ.js +0 -8
- package/dist/discord-ASNFJP6A.js +0 -7
- package/dist/dropbox-VV2WZE6I.js +0 -8
- package/dist/gcs-2W6DDWM7.js +0 -8
- package/dist/gdocs-QPM7VXXE.js +0 -8
- package/dist/gdrive-KT6R7EVB.js +0 -8
- package/dist/github-3IFZGW6I.js +0 -7
- package/dist/github_ci-CKKF2Y4S.js +0 -8
- package/dist/gsheets-HF4YPIEF.js +0 -8
- package/dist/gslides-EV2JJH7I.js +0 -8
- package/dist/langfuse-74ZCR6QL.js +0 -7
- package/dist/linear-XABGTU6E.js +0 -7
- package/dist/minio-JPNSX2NP.js +0 -8
- package/dist/notion-YJOTGH7J.js +0 -7
- package/dist/oci-R4VYQKGJ.js +0 -8
- package/dist/opfs-4RWMJBCI.js +0 -7
- package/dist/qingstor-ZWWK2ZGV.js +0 -8
- package/dist/r2-PZAN2YFG.js +0 -8
- package/dist/scaleway-BFROPDBB.js +0 -8
- package/dist/seaweedfs-X6THZT26.js +0 -8
- package/dist/slack-O7BTJ4YR.js +0 -7
- package/dist/supabase-PHN3MIXW.js +0 -8
- package/dist/tencent-JGCJEKHV.js +0 -8
- package/dist/trello-QUDOP3M2.js +0 -7
- package/dist/wasabi-5VMNAFOC.js +0 -8
- /package/dist/{aliyun-YEWHEWCL.js.map → aliyun-DR6KT3H6.js.map} +0 -0
- /package/dist/{backblaze-LWE2HEDK.js.map → backblaze-XCLZXTES.js.map} +0 -0
- /package/dist/{box-GTWWIB6F.js.map → box-XBCSU3AA.js.map} +0 -0
- /package/dist/{ceph-ATSCSVGU.js.map → ceph-F5S2NMTO.js.map} +0 -0
- /package/dist/{chunk-LW56WZDS.js.map → chunk-2WNXK742.js.map} +0 -0
- /package/dist/{config-22T7HJBJ.js.map → config-2Y6LZKLV.js.map} +0 -0
- /package/dist/{config-A56HUM6C.js.map → config-4GSOMUMF.js.map} +0 -0
- /package/dist/{config-DIWQZBOK.js.map → config-5YBUWFUP.js.map} +0 -0
- /package/dist/{config-HGJ2MGAC.js.map → config-DE5OZ4I7.js.map} +0 -0
- /package/dist/{config-MHBKYS53.js.map → config-ELDOFRJW.js.map} +0 -0
- /package/dist/{config-PAHALM2T.js.map → config-FPM3LAW7.js.map} +0 -0
- /package/dist/{config-PWZXYJOI.js.map → config-JY557MA6.js.map} +0 -0
- /package/dist/{digitalocean-SQA6MJJQ.js.map → config-WRACCRPN.js.map} +0 -0
- /package/dist/{discord-ASNFJP6A.js.map → digitalocean-QDHTRS2W.js.map} +0 -0
- /package/dist/{dropbox-VV2WZE6I.js.map → discord-ERUI7OAQ.js.map} +0 -0
- /package/dist/{gcs-2W6DDWM7.js.map → dropbox-3U6D4HLE.js.map} +0 -0
- /package/dist/{gdocs-QPM7VXXE.js.map → gcal-MTBSDG34.js.map} +0 -0
- /package/dist/{gdrive-KT6R7EVB.js.map → gcs-KNGRBBET.js.map} +0 -0
- /package/dist/{github-3IFZGW6I.js.map → gdocs-RUIOIRKP.js.map} +0 -0
- /package/dist/{github_ci-CKKF2Y4S.js.map → gdrive-5JB7ZKEP.js.map} +0 -0
- /package/dist/{gmail-HLZIMKQU.js.map → github-CIXBFBVO.js.map} +0 -0
- /package/dist/{gsheets-HF4YPIEF.js.map → github_ci-HR6YOYAO.js.map} +0 -0
- /package/dist/{gslides-EV2JJH7I.js.map → gmail-JHGWTQU5.js.map} +0 -0
- /package/dist/{langfuse-74ZCR6QL.js.map → gsheets-N54JO2RS.js.map} +0 -0
- /package/dist/{linear-XABGTU6E.js.map → gslides-B4VMNLMB.js.map} +0 -0
- /package/dist/{minio-JPNSX2NP.js.map → langfuse-HEUJGDOC.js.map} +0 -0
- /package/dist/{notion-YJOTGH7J.js.map → linear-J4QQ3CA6.js.map} +0 -0
- /package/dist/{oci-R4VYQKGJ.js.map → minio-BXWHJ6K5.js.map} +0 -0
- /package/dist/{opfs-4RWMJBCI.js.map → notion-I5S5SRLO.js.map} +0 -0
- /package/dist/{qingstor-ZWWK2ZGV.js.map → oci-XOPKH4AE.js.map} +0 -0
- /package/dist/{r2-PZAN2YFG.js.map → opfs-36QO72Y5.js.map} +0 -0
- /package/dist/{s3-CSFY3PLT.js.map → qingstor-JKAHLK62.js.map} +0 -0
- /package/dist/{scaleway-BFROPDBB.js.map → r2-L3QXQ76M.js.map} +0 -0
- /package/dist/{seaweedfs-X6THZT26.js.map → s3-LRZJPGHK.js.map} +0 -0
- /package/dist/{slack-O7BTJ4YR.js.map → scaleway-CGNDYNKS.js.map} +0 -0
- /package/dist/{supabase-PHN3MIXW.js.map → seaweedfs-BSQWCBIR.js.map} +0 -0
- /package/dist/{tencent-JGCJEKHV.js.map → slack-62ECSENR.js.map} +0 -0
- /package/dist/{trello-QUDOP3M2.js.map → supabase-J66NXWAF.js.map} +0 -0
- /package/dist/{wasabi-5VMNAFOC.js.map → tencent-AC667LV3.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/slack/slack.ts","../src/resource/slack/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n BrowserSlackTransport,\n type FileStat,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n makeResolveGlob,\n SLACK_COMMANDS,\n SLACK_PROMPT,\n SLACK_OPS,\n SLACK_WRITE_PROMPT,\n SlackAccessor,\n slackRead,\n slackReaddir,\n slackStat,\n} from '@struktoai/mirage-core'\nimport { redactSlackConfig, type SlackConfig, type SlackConfigRedacted } from './config.ts'\n\nconst resolveSlackGlob = makeResolveGlob(slackReaddir)\n\nexport interface SlackResourceState {\n type: string\n config: SlackConfigRedacted\n}\n\nexport class SlackResource implements Resource {\n readonly kind: string = ResourceName.SLACK\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = SLACK_PROMPT\n readonly writePrompt: string = SLACK_WRITE_PROMPT\n readonly config: SlackConfig\n readonly accessor: SlackAccessor\n readonly index: IndexCacheStore\n\n constructor(config: SlackConfig) {\n this.config = config\n this.accessor = new SlackAccessor(\n new BrowserSlackTransport({\n proxyUrl: config.proxyUrl,\n ...(config.getHeaders !== undefined ? { getHeaders: config.getHeaders } : {}),\n }),\n )\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return SLACK_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return SLACK_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return slackRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return slackReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return slackStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return resolveSlackGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<SlackResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactSlackConfig(this.config),\n })\n }\n\n loadState(_state: SlackResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\n\nexport interface SlackConfig {\n proxyUrl: string\n getHeaders?: () => Promise<Record<string, string>> | Record<string, string>\n}\n\nexport interface SlackConfigRedacted {\n proxyUrl: string\n getHeaders?: '<REDACTED>'\n}\n\nconst SlackConfigSchema = z.object({\n proxyUrl: z.string(),\n getHeaders: secretSchema(\n z.custom<SlackConfig['getHeaders']>((value) => typeof value === 'function'),\n ).optional(),\n})\n\nexport function redactSlackConfig(config: SlackConfig): SlackConfigRedacted {\n return redactConfigWithSchema(SlackConfigSchema, config) as unknown as SlackConfigRedacted\n}\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA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KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,cAAc,EAAE,SAAS,EAAE,YAAY,MAAM,KACzC,IACA,IAAI,SAAS;AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,iBAAiB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC9D;AAAA,EAEA,WAAwC;AACtC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,kBAAkB,KAAK,MAAM;AAAA,IACvC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA2C;AACnD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/discord/discord.ts","../src/resource/discord/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n BrowserDiscordTransport,\n DISCORD_COMMANDS,\n DISCORD_PROMPT,\n DISCORD_OPS,\n DISCORD_WRITE_PROMPT,\n DiscordAccessor,\n type FileStat,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n discordRead,\n discordReaddir,\n discordStat,\n makeResolveGlob,\n} from '@struktoai/mirage-core'\nimport { redactDiscordConfig, type DiscordConfig, type DiscordConfigRedacted } from './config.ts'\n\nconst resolveDiscordGlob = makeResolveGlob(discordReaddir)\n\nexport interface DiscordResourceState {\n type: string\n config: DiscordConfigRedacted\n}\n\nexport class DiscordResource implements Resource {\n readonly kind: string = ResourceName.DISCORD\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = DISCORD_PROMPT\n readonly writePrompt: string = DISCORD_WRITE_PROMPT\n readonly config: DiscordConfig\n readonly accessor: DiscordAccessor\n readonly index: IndexCacheStore\n\n constructor(config: DiscordConfig) {\n this.config = config\n this.accessor = new DiscordAccessor(\n new BrowserDiscordTransport({\n proxyUrl: config.proxyUrl,\n ...(config.getHeaders !== undefined ? { getHeaders: config.getHeaders } : {}),\n }),\n )\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return DISCORD_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return DISCORD_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return discordRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return discordReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return discordStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return resolveDiscordGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<DiscordResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDiscordConfig(this.config),\n })\n }\n\n loadState(_state: DiscordResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\n\nexport interface DiscordConfig {\n proxyUrl: string\n getHeaders?: () => Promise<Record<string, string>> | Record<string, string>\n}\n\nexport interface DiscordConfigRedacted {\n proxyUrl: string\n getHeaders?: '<REDACTED>'\n}\n\nconst DiscordConfigSchema = z.object({\n proxyUrl: z.string(),\n getHeaders: secretSchema(\n z.custom<DiscordConfig['getHeaders']>((value) => typeof value === 'function'),\n ).optional(),\n})\n\nexport function redactDiscordConfig(config: DiscordConfig): DiscordConfigRedacted {\n return redactConfigWithSchema(DiscordConfigSchema, config) as unknown as DiscordConfigRedacted\n}\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACpBP,SAAS,wBAAwB,cAAc,SAAS;AAYxD,IAAM,sBAAsB,EA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W,KACP,MAAM;AAAA,MAAI,CAAC,MACT,cAAc,EAAE,SAAS,EAAE,YAAY,MAAM,KACzC,IACA,IAAI,SAAS;AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,mBAAmB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gsheets/gsheets.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n GSHEETS_COMMANDS,\n GSHEETS_PROMPT,\n GSHEETS_OPS,\n GSHEETS_WRITE_PROMPT,\n GSheetsAccessor,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gsheetsRead,\n gsheetsReaddir,\n makeResolveGlob,\n gsheetsStat,\n} from '@struktoai/mirage-core'\nimport { redactGSheetsConfig, type GSheetsConfig, type GSheetsConfigRedacted } from './config.ts'\n\nconst gsheetsResolveGlob = makeResolveGlob(gsheetsReaddir)\n\nexport interface GSheetsResourceState {\n type: string\n config: GSheetsConfigRedacted\n}\n\nexport class GSheetsResource implements Resource {\n readonly kind: string = ResourceName.GSHEETS\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GSHEETS_PROMPT\n readonly writePrompt: string = GSHEETS_WRITE_PROMPT\n readonly config: GSheetsConfig\n readonly accessor: GSheetsAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GSheetsConfig) {\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n ...(config.clientSecret !== undefined ? { clientSecret: config.clientSecret } : {}),\n refreshToken: config.refreshToken,\n ...(config.refreshFn !== undefined ? { refreshFn: config.refreshFn } : {}),\n })\n this.accessor = new GSheetsAccessor({ tokenManager: tm })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GSHEETS_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GSHEETS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gsheetsRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gsheetsReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gsheetsStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gsheetsResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GSheetsResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGSheetsConfig(this.config),\n })\n }\n\n loadState(_state: GSheetsResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,qBAAqB,gBAAgB,cAAc;AAOlD,IAAM,kBAAN,MAA0C;AAAA,EACtC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAuB;AACjC,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa;AAAA,MAC1B,UAAU,OAAO;AAAA,MACjB,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;AAAA,MACjF,cAAc,OAAO;AAAA,MACrB,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,IAC1E,CAAC;AACD,SAAK,WAAW,IAAI,gBAAgB,EAAE,cAAc,GAAG,CAAC;AACxD,SAAK,QAAQ,IAAI,mBAAmB,EAAE,KAAK,MAAO,CAAC;AAAA,EACrD;AAAA,EAEA,OAAsB;AACpB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,QAAuB;AACrB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,WAAyC;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,MAA+B;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,YAAY,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACjD;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,eAAe,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACpD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,YAAY,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACjD;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,cAAc,EAAE,SAAS,EAAE,YAAY,MAAM,KACzC,IACA,IAAI,SAAS;AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,mBAAmB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/wasabi/wasabi.ts","../src/resource/wasabi/config.ts","../src/resource/wasabi/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactWasabiConfig,\n wasabiToS3Config,\n type WasabiConfig,\n type WasabiConfigRedacted,\n} from './config.ts'\nimport { WASABI_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface WasabiResourceState {\n type: string\n config: WasabiConfigRedacted\n}\n\nexport class WasabiResource extends S3Resource {\n override readonly kind: string = ResourceName.WASABI\n override readonly prompt: string = WASABI_BROWSER_PROMPT\n readonly wasabiConfig: WasabiConfig\n private readonly wasabiOps: readonly RegisteredOp[]\n private readonly wasabiCommands: readonly RegisteredCommand[]\n\n constructor(config: WasabiConfig) {\n super(wasabiToS3Config(config))\n this.wasabiConfig = config\n this.wasabiOps = remapOpsResource(super.ops(), ResourceName.WASABI)\n this.wasabiCommands = remapCommandsResource(super.commands(), ResourceName.WASABI)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.wasabiOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.wasabiCommands\n }\n\n override getState(): Promise<WasabiResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactWasabiConfig(this.wasabiConfig),\n })\n }\n\n override loadState(_state: WasabiResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface WasabiConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface WasabiConfigRedacted extends Omit<WasabiConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst WasabiConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedWasabiEndpoint(config: WasabiConfig): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n const region = config.region ?? 'us-east-1'\n return region === 'us-east-1' ? 'https://s3.wasabisys.com' : `https://s3.${region}.wasabisys.com`\n}\n\nexport function wasabiToS3Config(config: WasabiConfig): S3Config {\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n endpoint: resolvedWasabiEndpoint(config),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactWasabiConfig(config: WasabiConfig): WasabiConfigRedacted {\n return redactConfigWithSchema(WasabiConfigSchema, config) as unknown as WasabiConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const WASABI_BROWSER_PROMPT = `{prefix}\n Remote Wasabi bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,uBAAuB,QAA8B;AACnE,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,QAAM,SAAS,OAAO,UAAU;AAChC,SAAO,WAAW,cAAc,6BAA6B,cAAc,MAAM;AACnF;AAEO,SAAS,iBAAiB,QAAgC;AAC/D,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,UAAU,uBAAuB,MAAM;AAAA,IACvC,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB,MAAM;AAC1D;;;AChDO,IAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;;;AFqB9B,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAC3B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAsB;AAChC,UAAM,iBAAiB,MAAM,CAAC;AAC9B,SAAK,eAAe;AACpB,SAAK,YAAY,iBAAiB,MAAM,IAAI,GAAG,aAAa,MAAM;AAClE,SAAK,iBAAiB,sBAAsB,MAAM,SAAS,GAAG,aAAa,MAAM;AAAA,EACnF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,YAAY;AAAA,IAC9C,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA4C;AAC7D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/dropbox/dropbox.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n DROPBOX_COMMANDS,\n DROPBOX_PROMPT,\n DROPBOX_OPS,\n DropboxAccessor,\n DropboxTokenManager,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n dropboxRead,\n dropboxReaddir,\n makeResolveGlob,\n dropboxStat,\n} from '@struktoai/mirage-core'\nimport { redactDropboxConfig, type DropboxConfig, type DropboxConfigRedacted } from './config.ts'\n\nconst dropboxResolveGlob = makeResolveGlob(dropboxReaddir)\n\nexport interface DropboxResourceState {\n type: string\n config: DropboxConfigRedacted\n}\n\nexport class DropboxResource implements Resource {\n readonly kind: string = ResourceName.DROPBOX\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = DROPBOX_PROMPT\n readonly config: DropboxConfig\n readonly accessor: DropboxAccessor\n readonly index: IndexCacheStore\n\n constructor(config: DropboxConfig) {\n this.config = config\n const tm = new DropboxTokenManager({\n clientId: config.clientId,\n ...(config.clientSecret !== undefined ? { clientSecret: config.clientSecret } : {}),\n refreshToken: config.refreshToken,\n ...(config.endpoint !== undefined ? { endpoint: config.endpoint } : {}),\n ...(config.refreshFn !== undefined ? { refreshFn: config.refreshFn } : {}),\n })\n this.accessor = new DropboxAccessor({\n tokenManager: tm,\n ...(config.rootPath !== undefined ? { rootPath: config.rootPath } : {}),\n ...(config.contentSearch !== undefined ? { contentSearch: config.contentSearch } : {}),\n })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return DROPBOX_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return DROPBOX_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return dropboxRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return dropboxReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return dropboxStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return dropboxResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<DropboxResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDropboxConfig(this.config),\n })\n }\n\n loadState(_state: DropboxResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,qBAAqB,gBAAgB,cAAc;AAOlD,IAAM,kBAAN,MAA0C;AAAA,EACtC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAuB;AACjC,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,oBAAoB;AAAA,MACjC,UAAU,OAAO;AAAA,MACjB,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;AAAA,MACjF,cAAc,OAAO;AAAA,MACrB,GAAI,OAAO,a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AAC;AAAA,IACP,IACA;AACN,WAAO,mBAAmB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/s3/s3.ts","../src/resource/s3/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n copy as copyCore,\n create as createCore,\n du as duCore,\n duAll as duAllCore,\n exists as existsCore,\n type FileStat,\n type FindOptions,\n find as findCore,\n type IndexCacheStore,\n makeResolveGlob,\n mkdir as mkdirCore,\n PathSpec,\n RAMIndexCacheStore,\n rangeRead as rangeReadCore,\n S3_COMMANDS,\n read as readCore,\n readdir as readdirCore,\n type RegisteredCommand,\n type RegisteredOp,\n rename as renameCore,\n type Resource,\n ResourceName,\n S3_SCOPE_ERROR,\n rmR as rmRCore,\n rmdir as rmdirCore,\n S3_OPS,\n S3Accessor,\n stat as statCore,\n stream as streamCore,\n truncate as truncateCore,\n unlink as unlinkCore,\n write as writeCore,\n} from '@struktoai/mirage-core'\nimport { redactConfig, type S3Config, type S3ConfigRedacted } from './config.ts'\n\nconst globCore = makeResolveGlob(readdirCore, S3_SCOPE_ERROR)\n\nexport const S3_BROWSER_PROMPT = `{prefix}\n Remote S3 bucket accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n\nexport interface S3ResourceState {\n type: string\n config: S3ConfigRedacted\n}\n\nexport class S3Resource implements Resource {\n readonly supportsSnapshot: boolean = true\n readonly kind: string = ResourceName.S3\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = S3_BROWSER_PROMPT\n readonly config: S3Config\n readonly accessor: S3Accessor\n readonly index: IndexCacheStore\n\n constructor(config: S3Config) {\n this.config = config\n this.accessor = new S3Accessor(this.config)\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return S3_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return S3_OPS\n }\n\n streamPath(p: PathSpec): AsyncIterable<Uint8Array> {\n return streamCore(this.accessor, p)\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return readCore(this.accessor, p)\n }\n\n writeFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return writeCore(this.accessor, p, data)\n }\n\n async appendFile(p: PathSpec, data: Uint8Array): Promise<void> {\n let existing: Uint8Array\n try {\n existing = await readCore(this.accessor, p)\n } catch (err) {\n if ((err as { code?: string } | null)?.code === 'ENOENT') {\n existing = new Uint8Array()\n } else {\n throw err\n }\n }\n const merged = new Uint8Array(existing.byteLength + data.byteLength)\n merged.set(existing, 0)\n merged.set(data, existing.byteLength)\n await writeCore(this.accessor, p, merged)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return readdirCore(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return statCore(this.accessor, p, this.index)\n }\n\n exists(p: PathSpec): Promise<boolean> {\n return existsCore(this.accessor, p)\n }\n\n mkdir(p: PathSpec): Promise<void> {\n return mkdirCore(this.accessor, p)\n }\n\n rmdir(p: PathSpec): Promise<void> {\n return rmdirCore(this.accessor, p)\n }\n\n unlink(p: PathSpec): Promise<void> {\n return unlinkCore(this.accessor, p)\n }\n\n rename(src: PathSpec, dst: PathSpec): Promise<void> {\n return renameCore(this.accessor, src, dst)\n }\n\n truncate(p: PathSpec, length: number): Promise<void> {\n return truncateCore(this.accessor, p, length)\n }\n\n copy(src: PathSpec, dst: PathSpec): Promise<void> {\n return copyCore(this.accessor, src, dst)\n }\n\n rmR(p: PathSpec): Promise<void> {\n return rmRCore(this.accessor, p)\n }\n\n du(p: PathSpec): Promise<number> {\n return duCore(this.accessor, p)\n }\n\n find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n return findCore(this.accessor, p, options)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective = prefix\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath)\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return globCore(this.accessor, effective, this.index)\n }\n\n getState(): Promise<S3ResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactConfig(this.config),\n })\n }\n\n loadState(_state: S3ResourceState): Promise<void> {\n return Promise.resolve()\n }\n\n // Ignored — duAll is not yet on the public Resource interface, but keeping\n // it around matches the node-side S3Resource.opsMap hook for completeness.\n _duAll(p: PathSpec): Promise<[[string, number][], number]> {\n return duAllCore(this.accessor, p)\n }\n\n _rangeRead(p: PathSpec, offset: number, size: number): Promise<Uint8Array> {\n return rangeReadCore(this.accessor, p, offset, size)\n }\n\n _create(p: PathSpec): Promise<void> {\n return createCore(this.accessor, p)\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport {\n redactS3Config as redactConfig,\n type S3BrowserOperation,\n type S3BrowserPresignedUrlProvider,\n type S3BrowserSignOptions,\n type S3Config,\n type S3ConfigRedacted,\n} from '@struktoai/mirage-core'\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EAGV,QAAQ;AAAA,EAER;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,EACR,WAAW;AAAA,EAGX,UAAU;AAAA,EAEV;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,OACJ;;;AClCP;AAAA,EACoB;AAAA,OAMb;;;AD8BP,IAAM,WAAW,gBAAgB,aAAa,cAAc;AAErD,IAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAW1B,IAAM,aAAN,MAAqC;AAAA,EACjC,mBAA4B;AAAA,EAC5B,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAA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QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,eAAa,KAAK,MAAM;AAAA,IAClC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAAwC;AAChD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA;AAAA;AAAA,EAIA,OAAO,GAAoD;AACzD,WAAO,UAAU,KAAK,UAAU,CAAC;AAAA,EACnC;AAAA,EAEA,WAAW,GAAa,QAAgB,MAAmC;AACzE,WAAO,cAAc,KAAK,UAAU,GAAG,QAAQ,IAAI;AAAA,EACrD;AAAA,EAEA,QAAQ,GAA4B;AAClC,WAAO,WAAW,KAAK,UAAU,CAAC;AAAA,EACpC;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/github_ci/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GitHubCIConfig {\n token: string\n owner: string\n repo: string\n days?: number\n baseUrl?: string\n}\n\nexport interface GitHubCIConfigRedacted {\n token: '<REDACTED>'\n owner: string\n repo: string\n days?: number\n baseUrl?: string\n}\n\nconst GitHubCIConfigSchema = z.object({\n token: secretStr(),\n owner: z.string(),\n repo: z.string(),\n days: z.number().optional(),\n baseUrl: z.string().optional(),\n})\n\nexport function redactGitHubCIConfig(config: GitHubCIConfig): GitHubCIConfigRedacted {\n return redactConfigWithSchema(GitHubCIConfigSchema, config) as unknown as GitHubCIConfigRedacted\n}\n\nexport function normalizeGitHubCIConfig(input: Record<string, unknown>): GitHubCIConfig {\n return normalizeFields(input, {\n rename: { base_url: 'baseUrl' },\n }) as unknown as GitHubCIConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAkBtE,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,OAAO,UAAU;AAAA,EACjB,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,SAAS,qBAAqB,QAAgD;AACnF,SAAO,uBAAuB,sBAAsB,MAAM;AAC5D;AAEO,SAAS,wBAAwB,OAAgD;AACtF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ,EAAE,UAAU,UAAU;AAAA,EAChC,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/supabase/supabase.ts","../src/resource/supabase/config.ts","../src/resource/supabase/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactSupabaseConfig,\n supabaseToS3Config,\n type SupabaseConfig,\n type SupabaseConfigRedacted,\n} from './config.ts'\nimport { SUPABASE_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface SupabaseResourceState {\n type: string\n config: SupabaseConfigRedacted\n}\n\nexport class SupabaseResource extends S3Resource {\n override readonly kind: string = ResourceName.SUPABASE\n override readonly prompt: string = SUPABASE_BROWSER_PROMPT\n readonly supabaseConfig: SupabaseConfig\n private readonly supabaseOps: readonly RegisteredOp[]\n private readonly supabaseCommands: readonly RegisteredCommand[]\n\n constructor(config: SupabaseConfig) {\n super(supabaseToS3Config(config))\n this.supabaseConfig = config\n this.supabaseOps = remapOpsResource(super.ops(), ResourceName.SUPABASE)\n this.supabaseCommands = remapCommandsResource(super.commands(), ResourceName.SUPABASE)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.supabaseOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.supabaseCommands\n }\n\n override getState(): Promise<SupabaseResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactSupabaseConfig(this.supabaseConfig),\n })\n }\n\n override loadState(_state: SupabaseResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface SupabaseConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n projectRef?: string\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface SupabaseConfigRedacted extends Omit<SupabaseConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst SupabaseConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n projectRef: z.string().optional(),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedSupabaseEndpoint(config: SupabaseConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.projectRef !== undefined && config.projectRef !== '') {\n return `https://${config.projectRef}.storage.supabase.co/storage/v1/s3`\n }\n return undefined\n}\n\nexport function supabaseToS3Config(config: SupabaseConfig): S3Config {\n const endpoint = resolvedSupabaseEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n forcePathStyle: true,\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactSupabaseConfig(config: SupabaseConfig): SupabaseConfigRedacted {\n return redactConfigWithSchema(SupabaseConfigSchema, config) as unknown as SupabaseConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SUPABASE_BROWSER_PROMPT = `{prefix}\n Remote Supabase Storage bucket accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAiBxD,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,yBAAyB,QAA4C;AACnF,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,eAAe,UAAa,OAAO,eAAe,IAAI;AAC/D,WAAO,WAAW,OAAO,UAAU;AAAA,EACrC;AACA,SAAO;AACT;AAEO,SAAS,mBAAmB,QAAkC;AACnE,QAAM,WAAW,yBAAyB,MAAM;AAChD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,gBAAgB;AAAA,IAChB,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,qBAAqB,QAAgD;AACnF,SAAO,uBAAuB,sBAAsB,MAAM;AAC5D;;;ACtDO,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;;;AFqBhC,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAC7B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAwB;AAClC,UAAM,mBAAmB,MAAM,CAAC;AAChC,SAAK,iBAAiB;AACtB,SAAK,cAAc,iBAAiB,MAAM,IAAI,GAAG,aAAa,QAAQ;AACtE,SAAK,mBAAmB,sBAAsB,MAAM,SAAS,GAAG,aAAa,QAAQ;AAAA,EACvF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA2C;AAClD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,qBAAqB,KAAK,cAAc;AAAA,IAClD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA8C;AAC/D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
package/dist/chunk-DQK6H5LW.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/resource/gdocs/config.ts
|
|
2
|
-
import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
|
|
3
|
-
var GDocsConfigSchema = z.object({
|
|
4
|
-
clientId: z.string(),
|
|
5
|
-
clientSecret: secretStr().optional(),
|
|
6
|
-
refreshToken: secretStr()
|
|
7
|
-
});
|
|
8
|
-
function redactGDocsConfig(config) {
|
|
9
|
-
return redactConfigWithSchema(GDocsConfigSchema, config);
|
|
10
|
-
}
|
|
11
|
-
function normalizeGDocsConfig(input) {
|
|
12
|
-
return normalizeFields(input, {
|
|
13
|
-
rename: {
|
|
14
|
-
client_id: "clientId",
|
|
15
|
-
client_secret: "clientSecret",
|
|
16
|
-
refresh_token: "refreshToken"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
redactGDocsConfig,
|
|
23
|
-
normalizeGDocsConfig
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=chunk-DQK6H5LW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gdocs/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GDocsConfig {\n clientId: string\n clientSecret?: string\n refreshToken: string\n refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; expiresIn: number }>\n}\n\nexport interface GDocsConfigRedacted {\n clientId: string\n clientSecret?: '<REDACTED>'\n refreshToken: '<REDACTED>'\n}\n\nconst GDocsConfigSchema = z.object({\n clientId: z.string(),\n clientSecret: secretStr().optional(),\n refreshToken: secretStr(),\n})\n\nexport function redactGDocsConfig(config: GDocsConfig): GDocsConfigRedacted {\n return redactConfigWithSchema(GDocsConfigSchema, config) as unknown as GDocsConfigRedacted\n}\n\nexport function normalizeGDocsConfig(input: Record<string, unknown>): GDocsConfig {\n return normalizeFields(input, {\n rename: {\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n },\n }) as unknown as GDocsConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAetE,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,UAAU,EAAE,OAAO;AAAA,EACnB,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,cAAc,UAAU;AAC1B,CAAC;AAEM,SAAS,kBAAkB,QAA0C;AAC1E,SAAO,uBAAuB,mBAAmB,MAAM;AACzD;AAEO,SAAS,qBAAqB,OAA6C;AAChF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/linear/linear.ts","../src/resource/linear/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n HttpLinearTransport,\n type IndexCacheStore,\n LINEAR_COMMANDS,\n LINEAR_PROMPT,\n LINEAR_OPS,\n LINEAR_WRITE_PROMPT,\n LinearAccessor,\n type LinearReaddirFilter,\n linearRead,\n linearReaddir,\n linearStat,\n makeResolveGlob,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport { redactLinearConfig, type LinearConfig, type LinearConfigRedacted } from './config.ts'\n\nconst resolveLinearGlob = (\n accessor: LinearAccessor,\n paths: readonly PathSpec[],\n index: IndexCacheStore | undefined,\n filter: LinearReaddirFilter,\n): Promise<PathSpec[]> =>\n makeResolveGlob((a: LinearAccessor, p: PathSpec, i?: IndexCacheStore) =>\n linearReaddir(a, p, i, filter),\n )(accessor, paths, index)\n\nexport interface LinearResourceState {\n type: string\n config: LinearConfigRedacted\n}\n\nexport class LinearResource implements Resource {\n readonly kind: string = ResourceName.LINEAR\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = LINEAR_PROMPT\n readonly writePrompt: string = LINEAR_WRITE_PROMPT\n readonly config: LinearConfig\n readonly accessor: LinearAccessor\n readonly index: IndexCacheStore\n\n constructor(config: LinearConfig) {\n this.config = config\n const transportOpts: { apiKey: string; baseUrl?: string } = { apiKey: config.apiKey }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n this.accessor = new LinearAccessor(new HttpLinearTransport(transportOpts))\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return LINEAR_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return LINEAR_OPS\n }\n\n private filter(): LinearReaddirFilter {\n const out: LinearReaddirFilter = {}\n if (this.config.teamIds !== undefined) out.teamIds = this.config.teamIds\n return out\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return linearRead(this.accessor, p, this.index, this.filter())\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return linearReaddir(this.accessor, p, this.index, this.filter())\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return linearStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return resolveLinearGlob(this.accessor, effective, this.index, this.filter())\n }\n\n getState(): Promise<LinearResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactLinearConfig(this.config),\n })\n }\n\n loadState(_state: LinearResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface LinearConfig {\n apiKey: string\n workspace?: string\n teamIds?: readonly string[]\n baseUrl?: string\n}\n\nexport interface LinearConfigRedacted {\n apiKey: '<REDACTED>'\n workspace?: string\n teamIds?: readonly string[]\n baseUrl?: string\n}\n\nconst LinearConfigSchema = z.object({\n apiKey: secretStr(),\n workspace: z.string().optional(),\n teamIds: z.array(z.string()).optional(),\n baseUrl: z.string().optional(),\n})\n\nexport function redactLinearConfig(config: LinearConfig): LinearConfigRedacted {\n return redactConfigWithSchema(LinearConfigSchema, config) as unknown as LinearConfigRedacted\n}\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,E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,OAAW,KAAI,UAAU,KAAK,OAAO;AACjE,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,WAAW,KAAK,UAAU,GAAG,KAAK,OAAO,KAAK,OAAO,CAAC;AAAA,EAC/D;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,cAAc,KAAK,UAAU,GAAG,KAAK,OAAO,KAAK,OAAO,CAAC;AAAA,EAClE;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,WAAW,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAChD;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,cAAc,EAAE,SAAS,EAAE,YAAY,MAAM,KACzC,IACA,IAAI,SAAS;AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,OAAO,KAAK,OAAO,CAAC;AAAA,EAC9E;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gcs/gcs.ts","../src/resource/gcs/config.ts","../src/resource/gcs/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport { gcsToS3Config, redactGcsConfig, type GCSConfig, type GCSConfigRedacted } from './config.ts'\nimport { GCS_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface GCSResourceState {\n type: string\n config: GCSConfigRedacted\n}\n\nexport class GCSResource extends S3Resource {\n override readonly kind: string = ResourceName.GCS\n override readonly prompt: string = GCS_BROWSER_PROMPT\n readonly gcsConfig: GCSConfig\n private readonly gcsOps: readonly RegisteredOp[]\n private readonly gcsCommands: readonly RegisteredCommand[]\n\n constructor(config: GCSConfig) {\n super(gcsToS3Config(config))\n this.gcsConfig = config\n this.gcsOps = remapOpsResource(super.ops(), ResourceName.GCS)\n this.gcsCommands = remapCommandsResource(super.commands(), ResourceName.GCS)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.gcsOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.gcsCommands\n }\n\n override getState(): Promise<GCSResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGcsConfig(this.gcsConfig),\n })\n }\n\n override loadState(_state: GCSResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface GCSConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface GCSConfigRedacted extends Omit<GCSConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst GCSConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function gcsToS3Config(config: GCSConfig): S3Config {\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : { region: 'auto' }),\n ...(config.endpoint !== undefined\n ? { endpoint: config.endpoint }\n : { endpoint: 'https://storage.googleapis.com' }),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactGcsConfig(config: GCSConfig): GCSConfigRedacted {\n return redactConfigWithSchema(GCSConfigSchema, config) as unknown as GCSConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const GCS_BROWSER_PROMPT = `{prefix}\n Remote Google Cloud Storage bucket accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,cAAc,QAA6B;AACzD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,EAAE,QAAQ,OAAO;AAAA,IAC/E,GAAI,OAAO,aAAa,SACpB,EAAE,UAAU,OAAO,SAAS,IAC5B,EAAE,UAAU,iCAAiC;AAAA,IACjD,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,gBAAgB,QAAsC;AACpE,SAAO,uBAAuB,iBAAiB,MAAM;AACvD;;;AC5CO,IAAM,qBAAqB;AAAA;AAAA;AAAA;AAAA;;;AFgB3B,IAAM,cAAN,cAA0B,WAAW;AAAA,EACxB,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAmB;AAC7B,UAAM,cAAc,MAAM,CAAC;AAC3B,SAAK,YAAY;AACjB,SAAK,SAAS,iBAAiB,MAAM,IAAI,GAAG,aAAa,GAAG;AAC5D,SAAK,cAAc,sBAAsB,MAAM,SAAS,GAAG,aAAa,GAAG;AAAA,EAC7E;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAsC;AAC7C,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,gBAAgB,KAAK,SAAS;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAAyC;AAC1D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/qingstor/qingstor.ts","../src/resource/qingstor/config.ts","../src/resource/qingstor/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n qingStorToS3Config,\n redactQingStorConfig,\n type QingStorConfig,\n type QingStorConfigRedacted,\n} from './config.ts'\nimport { QINGSTOR_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface QingStorResourceState {\n type: string\n config: QingStorConfigRedacted\n}\n\nexport class QingStorResource extends S3Resource {\n override readonly kind: string = ResourceName.QINGSTOR\n override readonly prompt: string = QINGSTOR_BROWSER_PROMPT\n readonly qingStorConfig: QingStorConfig\n private readonly qingStorOps: readonly RegisteredOp[]\n private readonly qingStorCommands: readonly RegisteredCommand[]\n\n constructor(config: QingStorConfig) {\n super(qingStorToS3Config(config))\n this.qingStorConfig = config\n this.qingStorOps = remapOpsResource(super.ops(), ResourceName.QINGSTOR)\n this.qingStorCommands = remapCommandsResource(super.commands(), ResourceName.QINGSTOR)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.qingStorOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.qingStorCommands\n }\n\n override getState(): Promise<QingStorResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactQingStorConfig(this.qingStorConfig),\n })\n }\n\n override loadState(_state: QingStorResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface QingStorConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface QingStorConfigRedacted extends Omit<QingStorConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst QingStorConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedQingStorEndpoint(config: QingStorConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://s3.${region}.qingstor.com`\n }\n return undefined\n}\n\nexport function qingStorToS3Config(config: QingStorConfig): S3Config {\n const endpoint = resolvedQingStorEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactQingStorConfig(config: QingStorConfig): QingStorConfigRedacted {\n return redactConfigWithSchema(QingStorConfigSchema, config) as unknown as QingStorConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const QINGSTOR_BROWSER_PROMPT = `{prefix}\n Remote QingStor bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,yBAAyB,QAA4C;AACnF,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,WAAW,UAAa,OAAO,WAAW,IAAI;AACvD,UAAM,SAAS,OAAO;AACtB,WAAO,cAAc,MAAM;AAAA,EAC7B;AACA,SAAO;AACT;AAEO,SAAS,mBAAmB,QAAkC;AACnE,QAAM,WAAW,yBAAyB,MAAM;AAChD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,qBAAqB,QAAgD;AACnF,SAAO,uBAAuB,sBAAsB,MAAM;AAC5D;;;ACpDO,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;;;AFqBhC,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAC7B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAwB;AAClC,UAAM,mBAAmB,MAAM,CAAC;AAChC,SAAK,iBAAiB;AACtB,SAAK,cAAc,iBAAiB,MAAM,IAAI,GAAG,aAAa,QAAQ;AACtE,SAAK,mBAAmB,sBAAsB,MAAM,SAAS,GAAG,aAAa,QAAQ;AAAA,EACvF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA2C;AAClD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,qBAAqB,KAAK,cAAc;AAAA,IAClD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA8C;AAC/D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/scaleway/scaleway.ts","../src/resource/scaleway/config.ts","../src/resource/scaleway/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactScalewayConfig,\n scalewayToS3Config,\n type ScalewayConfig,\n type ScalewayConfigRedacted,\n} from './config.ts'\nimport { SCALEWAY_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface ScalewayResourceState {\n type: string\n config: ScalewayConfigRedacted\n}\n\nexport class ScalewayResource extends S3Resource {\n override readonly kind: string = ResourceName.SCALEWAY\n override readonly prompt: string = SCALEWAY_BROWSER_PROMPT\n readonly scalewayConfig: ScalewayConfig\n private readonly scalewayOps: readonly RegisteredOp[]\n private readonly scalewayCommands: readonly RegisteredCommand[]\n\n constructor(config: ScalewayConfig) {\n super(scalewayToS3Config(config))\n this.scalewayConfig = config\n this.scalewayOps = remapOpsResource(super.ops(), ResourceName.SCALEWAY)\n this.scalewayCommands = remapCommandsResource(super.commands(), ResourceName.SCALEWAY)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.scalewayOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.scalewayCommands\n }\n\n override getState(): Promise<ScalewayResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactScalewayConfig(this.scalewayConfig),\n })\n }\n\n override loadState(_state: ScalewayResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface ScalewayConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface ScalewayConfigRedacted extends Omit<ScalewayConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst ScalewayConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedScalewayEndpoint(config: ScalewayConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://s3.${region}.scw.cloud`\n }\n return undefined\n}\n\nexport function scalewayToS3Config(config: ScalewayConfig): S3Config {\n const endpoint = resolvedScalewayEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactScalewayConfig(config: ScalewayConfig): ScalewayConfigRedacted {\n return redactConfigWithSchema(ScalewayConfigSchema, config) as unknown as ScalewayConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SCALEWAY_BROWSER_PROMPT = `{prefix}\n Remote Scaleway Object Storage bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,yBAAyB,QAA4C;AACnF,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,WAAW,UAAa,OAAO,WAAW,IAAI;AACvD,UAAM,SAAS,OAAO;AACtB,WAAO,cAAc,MAAM;AAAA,EAC7B;AACA,SAAO;AACT;AAEO,SAAS,mBAAmB,QAAkC;AACnE,QAAM,WAAW,yBAAyB,MAAM;AAChD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,qBAAqB,QAAgD;AACnF,SAAO,uBAAuB,sBAAsB,MAAM;AAC5D;;;ACpDO,IAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;;;AFqBhC,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAC7B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAwB;AAClC,UAAM,mBAAmB,MAAM,CAAC;AAChC,SAAK,iBAAiB;AACtB,SAAK,cAAc,iBAAiB,MAAM,IAAI,GAAG,aAAa,QAAQ;AACtE,SAAK,mBAAmB,sBAAsB,MAAM,SAAS,GAAG,aAAa,QAAQ;AAAA,EACvF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA2C;AAClD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,qBAAqB,KAAK,cAAc;AAAA,IAClD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA8C;AAC/D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/box/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface BoxConfig {\n // API origin override (e.g. an integ fake). Defaults to api.box.com.\n endpoint?: string\n // Box folder id to mount as the workspace root instead of the account\n // root (\"0\"). Folder ids are stable across renames/moves and visible in\n // the Box web URL (box.com/folder/<id>), so a subfolder mount survives\n // reorganization that a path prefix would not.\n rootFolderId?: string\n // Opt in to grep/rg content-search push-down: route recursive literal\n // scans through Box search to narrow the file set before scanning locally.\n // Off by default because Box's search index lags recent writes.\n contentSearch?: boolean\n clientId?: string\n clientSecret?: string\n refreshToken?: string\n accessToken?: string\n refreshFn?: (\n refreshToken: string,\n ) => Promise<{ accessToken: string; refreshToken: string; expiresIn: number }>\n onRefreshTokenRotated?: (newRefreshToken: string) => void | Promise<void>\n}\n\nexport interface BoxConfigRedacted {\n endpoint?: string\n rootFolderId?: string\n clientId?: string\n clientSecret?: '<REDACTED>'\n refreshToken?: '<REDACTED>'\n accessToken?: '<REDACTED>'\n}\n\nconst BoxConfigSchema = z.object({\n endpoint: z.string().optional(),\n rootFolderId: z.string().optional(),\n contentSearch: z.boolean().optional(),\n clientId: z.string().optional(),\n clientSecret: secretStr().optional(),\n refreshToken: secretStr().optional(),\n accessToken: secretStr().optional(),\n})\n\nexport function redactBoxConfig(config: BoxConfig): BoxConfigRedacted {\n return redactConfigWithSchema(BoxConfigSchema, config) as unknown as BoxConfigRedacted\n}\n\nexport function normalizeBoxConfig(input: Record<string, unknown>): BoxConfig {\n return normalizeFields(input, {\n rename: {\n root_folder_id: 'rootFolderId',\n content_search: 'contentSearch',\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n access_token: 'accessToken',\n developer_token: 'accessToken',\n },\n }) as unknown as BoxConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAiCtE,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,aAAa,UAAU,EAAE,SAAS;AACpC,CAAC;AAEM,SAAS,gBAAgB,QAAsC;AACpE,SAAO,uBAAuB,iBAAiB,MAAM;AACvD;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/ceph/ceph.ts","../src/resource/ceph/config.ts","../src/resource/ceph/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n cephToS3Config,\n redactCephConfig,\n type CephConfig,\n type CephConfigRedacted,\n} from './config.ts'\nimport { CEPH_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface CephResourceState {\n type: string\n config: CephConfigRedacted\n}\n\nexport class CephResource extends S3Resource {\n override readonly kind: string = ResourceName.CEPH\n override readonly prompt: string = CEPH_BROWSER_PROMPT\n readonly cephConfig: CephConfig\n private readonly cephOps: readonly RegisteredOp[]\n private readonly cephCommands: readonly RegisteredCommand[]\n\n constructor(config: CephConfig) {\n super(cephToS3Config(config))\n this.cephConfig = config\n this.cephOps = remapOpsResource(super.ops(), ResourceName.CEPH)\n this.cephCommands = remapCommandsResource(super.commands(), ResourceName.CEPH)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.cephOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.cephCommands\n }\n\n override getState(): Promise<CephResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactCephConfig(this.cephConfig),\n })\n }\n\n override loadState(_state: CephResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface CephConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n endpoint?: string\n region?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface CephConfigRedacted extends Omit<CephConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst CephConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n endpoint: z.string().optional(),\n region: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function cephToS3Config(config: CephConfig): S3Config {\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(config.endpoint !== undefined ? { endpoint: config.endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactCephConfig(config: CephConfig): CephConfigRedacted {\n return redactConfigWithSchema(CephConfigSchema, config) as unknown as CephConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const CEPH_BROWSER_PROMPT = `{prefix}\n Remote Ceph Rados Gateway bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;A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AG,aAAa,IAAI;AAAA,EAC/E;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAuC;AAC9C,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,iBAAiB,KAAK,UAAU;AAAA,IAC1C,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA0C;AAC3D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/oci/oci.ts","../src/resource/oci/config.ts","../src/resource/oci/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport { ociToS3Config, redactOciConfig, type OCIConfig, type OCIConfigRedacted } from './config.ts'\nimport { OCI_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface OCIResourceState {\n type: string\n config: OCIConfigRedacted\n}\n\nexport class OCIResource extends S3Resource {\n override readonly kind: string = ResourceName.OCI\n override readonly prompt: string = OCI_BROWSER_PROMPT\n readonly ociConfig: OCIConfig\n private readonly ociOps: readonly RegisteredOp[]\n private readonly ociCommands: readonly RegisteredCommand[]\n\n constructor(config: OCIConfig) {\n super(ociToS3Config(config))\n this.ociConfig = config\n this.ociOps = remapOpsResource(super.ops(), ResourceName.OCI)\n this.ociCommands = remapCommandsResource(super.commands(), ResourceName.OCI)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.ociOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.ociCommands\n }\n\n override getState(): Promise<OCIResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactOciConfig(this.ociConfig),\n })\n }\n\n override loadState(_state: OCIResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface OCIConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n namespace?: string\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface OCIConfigRedacted extends Omit<OCIConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst OCIConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n namespace: z.string().optional(),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedOciEndpoint(config: OCIConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (\n config.namespace !== undefined &&\n config.namespace !== '' &&\n config.region !== undefined &&\n config.region !== ''\n ) {\n return `https://${config.namespace}.compat.objectstorage.${config.region}.oci.customer-oci.com`\n }\n return undefined\n}\n\nexport function ociToS3Config(config: OCIConfig): S3Config {\n const endpoint = resolvedOciEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactOciConfig(config: OCIConfig): OCIConfigRedacted {\n return redactConfigWithSchema(OCIConfigSchema, config) as unknown as OCIConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const OCI_BROWSER_PROMPT = `{prefix}\n Remote Oracle Cloud Object Storage accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAiBxD,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,QAAQ,EAAE,OAAO;A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,YAAY,QAAmB;AAC7B,UAAM,cAAc,MAAM,CAAC;AAC3B,SAAK,YAAY;AACjB,SAAK,SAAS,iBAAiB,MAAM,IAAI,GAAG,aAAa,GAAG;AAC5D,SAAK,cAAc,sBAAsB,MAAM,SAAS,GAAG,aAAa,GAAG;AAAA,EAC7E;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAsC;AAC7C,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,gBAAgB,KAAK,SAAS;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAAyC;AAC1D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/digitalocean/digitalocean.ts","../src/resource/digitalocean/config.ts","../src/resource/digitalocean/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n digitalOceanToS3Config,\n redactDigitalOceanConfig,\n type DigitalOceanConfig,\n type DigitalOceanConfigRedacted,\n} from './config.ts'\nimport { DIGITALOCEAN_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface DigitalOceanResourceState {\n type: string\n config: DigitalOceanConfigRedacted\n}\n\nexport class DigitalOceanResource extends S3Resource {\n override readonly kind: string = ResourceName.DIGITALOCEAN\n override readonly prompt: string = DIGITALOCEAN_BROWSER_PROMPT\n readonly digitalOceanConfig: DigitalOceanConfig\n private readonly digitalOceanOps: readonly RegisteredOp[]\n private readonly digitalOceanCommands: readonly RegisteredCommand[]\n\n constructor(config: DigitalOceanConfig) {\n super(digitalOceanToS3Config(config))\n this.digitalOceanConfig = config\n this.digitalOceanOps = remapOpsResource(super.ops(), ResourceName.DIGITALOCEAN)\n this.digitalOceanCommands = remapCommandsResource(super.commands(), ResourceName.DIGITALOCEAN)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.digitalOceanOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.digitalOceanCommands\n }\n\n override getState(): Promise<DigitalOceanResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDigitalOceanConfig(this.digitalOceanConfig),\n })\n }\n\n override loadState(_state: DigitalOceanResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface DigitalOceanConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface DigitalOceanConfigRedacted extends Omit<\n DigitalOceanConfig,\n 'presignedUrlProvider'\n> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst DigitalOceanConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedDigitalOceanEndpoint(config: DigitalOceanConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://${region}.digitaloceanspaces.com`\n }\n return undefined\n}\n\nexport function digitalOceanToS3Config(config: DigitalOceanConfig): S3Config {\n const endpoint = resolvedDigitalOceanEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactDigitalOceanConfig(config: DigitalOceanConfig): DigitalOceanConfigRedacted {\n return redactConfigWithSchema(\n DigitalOceanConfigSchema,\n config,\n ) as unknown as DigitalOceanConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const DIGITALOCEAN_BROWSER_PROMPT = `{prefix}\n Remote DigitalOcean Spaces bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAmBxD,IAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,6BAA6B,QAAgD;AAC3F,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,WAAW,UAAa,OAAO,WAAW,IAAI;AACvD,UAAM,SAAS,OAAO;AACtB,WAAO,WAAW,MAAM;AAAA,EAC1B;AACA,SAAO;AACT;AAEO,SAAS,uBAAuB,QAAsC;AAC3E,QAAM,WAAW,6BAA6B,MAAM;AACpD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC7C,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,yBAAyB,QAAwD;AAC/F,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;;AC1DO,IAAM,8BAA8B;AAAA;AAAA;AAAA;AAAA;;;AFqBpC,IAAM,uBAAN,cAAmC,WAAW;AAAA,EACjC,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAA4B;AACtC,UAAM,uBAAuB,MAAM,CAAC;AACpC,SAAK,qBAAqB;AAC1B,SAAK,kBAAkB,iBAAiB,MAAM,IAAI,GAAG,aAAa,YAAY;AAC9E,SAAK,uBAAuB,sBAAsB,MAAM,SAAS,GAAG,aAAa,YAAY;AAAA,EAC/F;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA+C;AACtD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,yBAAyB,KAAK,kBAAkB;AAAA,IAC1D,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAAkD;AACnE,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/seaweedfs/seaweedfs.ts","../src/resource/seaweedfs/config.ts","../src/resource/seaweedfs/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n redactSeaweedFSConfig,\n seaweedfsToS3Config,\n type SeaweedFSConfig,\n type SeaweedFSConfigRedacted,\n} from './config.ts'\nimport { SEAWEEDFS_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface SeaweedFSResourceState {\n type: string\n config: SeaweedFSConfigRedacted\n}\n\nexport class SeaweedFSResource extends S3Resource {\n override readonly kind: string = ResourceName.SEAWEEDFS\n override readonly prompt: string = SEAWEEDFS_BROWSER_PROMPT\n readonly seaweedfsConfig: SeaweedFSConfig\n private readonly seaweedfsOps: readonly RegisteredOp[]\n private readonly seaweedfsCommands: readonly RegisteredCommand[]\n\n constructor(config: SeaweedFSConfig) {\n super(seaweedfsToS3Config(config))\n this.seaweedfsConfig = config\n this.seaweedfsOps = remapOpsResource(super.ops(), ResourceName.SEAWEEDFS)\n this.seaweedfsCommands = remapCommandsResource(super.commands(), ResourceName.SEAWEEDFS)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.seaweedfsOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.seaweedfsCommands\n }\n\n override getState(): Promise<SeaweedFSResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactSeaweedFSConfig(this.seaweedfsConfig),\n })\n }\n\n override loadState(_state: SeaweedFSResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface SeaweedFSConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n endpoint?: string\n region?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface SeaweedFSConfigRedacted extends Omit<SeaweedFSConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst SeaweedFSConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n endpoint: z.string().optional(),\n region: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function seaweedfsToS3Config(config: SeaweedFSConfig): S3Config {\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(config.endpoint !== undefined ? { endpoint: config.endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactSeaweedFSConfig(config: SeaweedFSConfig): SeaweedFSConfigRedacted {\n return redactConfigWithSchema(SeaweedFSConfigSchema, config) as unknown as SeaweedFSConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SEAWEEDFS_BROWSER_PROMPT = `{prefix}\n Remote SeaweedFS bucket (S3-compatible gateway) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,wBAAwB,EAAE,OAAO;AAAA,EACrC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,oBAAoB,QAAmC;AACrE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,sBAAsB,OAAO;AAAA,IAC7B,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,IAC/D,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,IACrE,GAAI,OAAO,uBAAuB,SAC9B,EAAE,oBAAoB,OAAO,mBAAmB,IAChD,CAAC;AAAA,IACL,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,sBAAsB,QAAkD;AACtF,SAAO,uBAAuB,uBAAuB,MAAM;AAC7D;;;AC1CO,IAAM,2BAA2B;AAAA;AAAA;AAAA;AAAA;;;AFqBjC,IAAM,oBAAN,cAAgC,WAAW;AAAA,EAC9B,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAyB;AACnC,UAAM,oBAAoB,MAAM,CAAC;AACjC,SAAK,kBAAkB;AACvB,SAAK,eAAe,iBAAiB,MAAM,IAAI,GAAG,aAAa,SAAS;AACxE,SAAK,oBAAoB,sBAAsB,MAAM,SAAS,GAAG,aAAa,SAAS;AAAA,EACzF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA4C;AACnD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,sBAAsB,KAAK,eAAe;AAAA,IACpD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA+C;AAChE,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/dropbox/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface DropboxConfig {\n clientId: string\n clientSecret?: string\n refreshToken: string\n rootPath?: string\n contentSearch?: boolean\n endpoint?: string\n refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; expiresIn: number }>\n}\n\nexport interface DropboxConfigRedacted {\n clientId: string\n clientSecret?: '<REDACTED>'\n refreshToken: '<REDACTED>'\n rootPath?: string\n contentSearch?: boolean\n endpoint?: string\n}\n\nconst DropboxConfigSchema = z.object({\n clientId: z.string(),\n clientSecret: secretStr().optional(),\n refreshToken: secretStr(),\n rootPath: z.string().optional(),\n contentSearch: z.boolean().optional(),\n endpoint: z.string().optional(),\n})\n\nexport function redactDropboxConfig(config: DropboxConfig): DropboxConfigRedacted {\n return redactConfigWithSchema(DropboxConfigSchema, config) as unknown as DropboxConfigRedacted\n}\n\nexport function normalizeDropboxConfig(input: Record<string, unknown>): DropboxConfig {\n return normalizeFields(input, {\n rename: {\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n root_path: 'rootPath',\n content_search: 'contentSearch',\n },\n }) as unknown as DropboxConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAqBtE,IAAM,sBAAsB,EAAE,OAAO;AAAA,EACnC,UAAU,EAAE,OAAO;AAAA,EACnB,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,cAAc,UAAU;AAAA,EACxB,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,UAAU,EAAE,OAAO,EAAE,SAAS;AAChC,CAAC;AAEM,SAAS,oBAAoB,QAA8C;AAChF,SAAO,uBAAuB,qBAAqB,MAAM;AAC3D;AAEO,SAAS,uBAAuB,OAA+C;AACpF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,MACf,WAAW;AAAA,MACX,gBAAgB;AAAA,IAClB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gdocs/gdocs.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n GDOCS_COMMANDS,\n GDOCS_PROMPT,\n GDOCS_OPS,\n GDOCS_WRITE_PROMPT,\n GDocsAccessor,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gdocsRead,\n gdocsReaddir,\n makeResolveGlob,\n gdocsStat,\n} from '@struktoai/mirage-core'\nimport { redactGDocsConfig, type GDocsConfig, type GDocsConfigRedacted } from './config.ts'\n\nconst gdocsResolveGlob = makeResolveGlob(gdocsReaddir)\n\nexport interface GDocsResourceState {\n type: string\n config: GDocsConfigRedacted\n}\n\nexport class GDocsResource implements Resource {\n readonly kind: string = ResourceName.GDOCS\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GDOCS_PROMPT\n readonly writePrompt: string = GDOCS_WRITE_PROMPT\n readonly config: GDocsConfig\n readonly accessor: GDocsAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GDocsConfig) {\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n ...(config.clientSecret !== undefined ? { clientSecret: config.clientSecret } : {}),\n refreshToken: config.refreshToken,\n ...(config.refreshFn !== undefined ? { refreshFn: config.refreshFn } : {}),\n })\n this.accessor = new GDocsAccessor({ tokenManager: tm })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GDOCS_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GDOCS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gdocsRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gdocsReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gdocsStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gdocsResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GDocsResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGDocsConfig(this.config),\n })\n }\n\n loadState(_state: GDocsResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,mBAAmB,gBAAgB,YAAY;AAO9C,IAAM,gBAAN,MAAwC;AAAA,EACpC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AAC/B,SAAK,SAAS;A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WAAW,KAAK,KAAK;AAAA,EAC9D;AAAA,EAEA,WAAwC;AACtC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,kBAAkB,KAAK,MAAM;AAAA,IACvC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA2C;AACnD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/backblaze/backblaze.ts","../src/resource/backblaze/config.ts","../src/resource/backblaze/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n backblazeToS3Config,\n redactBackblazeConfig,\n type BackblazeConfig,\n type BackblazeConfigRedacted,\n} from './config.ts'\nimport { BACKBLAZE_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface BackblazeResourceState {\n type: string\n config: BackblazeConfigRedacted\n}\n\nexport class BackblazeResource extends S3Resource {\n override readonly kind: string = ResourceName.BACKBLAZE\n override readonly prompt: string = BACKBLAZE_BROWSER_PROMPT\n readonly backblazeConfig: BackblazeConfig\n private readonly backblazeOps: readonly RegisteredOp[]\n private readonly backblazeCommands: readonly RegisteredCommand[]\n\n constructor(config: BackblazeConfig) {\n super(backblazeToS3Config(config))\n this.backblazeConfig = config\n this.backblazeOps = remapOpsResource(super.ops(), ResourceName.BACKBLAZE)\n this.backblazeCommands = remapCommandsResource(super.commands(), ResourceName.BACKBLAZE)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.backblazeOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.backblazeCommands\n }\n\n override getState(): Promise<BackblazeResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactBackblazeConfig(this.backblazeConfig),\n })\n }\n\n override loadState(_state: BackblazeResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface BackblazeConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface BackblazeConfigRedacted extends Omit<BackblazeConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst BackblazeConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedBackblazeEndpoint(config: BackblazeConfig): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.region !== undefined && config.region !== '') {\n const region = config.region\n return `https://s3.${region}.backblazeb2.com`\n }\n return undefined\n}\n\nexport function backblazeToS3Config(config: BackblazeConfig): S3Config {\n const endpoint = resolvedBackblazeEndpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactBackblazeConfig(config: BackblazeConfig): BackblazeConfigRedacted {\n return redactConfigWithSchema(BackblazeConfigSchema, config) as unknown as BackblazeConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const BACKBLAZE_BROWSER_PROMPT = `{prefix}\n Remote Backblaze B2 bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,wBAAwB,EAAE,OAAO;AAAA,EACrC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAs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B,MAAM,IAAI,GAAG,aAAa,SAAS;AACxE,SAAK,oBAAoB,sBAAsB,MAAM,SAAS,GAAG,aAAa,SAAS;AAAA,EACzF;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAA4C;AACnD,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,sBAAsB,KAAK,eAAe;AAAA,IACpD,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA+C;AAChE,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/box/box.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n BOX_COMMANDS,\n BOX_PROMPT,\n BOX_OPS,\n BoxAccessor,\n BoxTokenManager,\n type FileStat,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n boxRead,\n boxReaddir,\n makeResolveGlob,\n boxStat,\n} from '@struktoai/mirage-core'\nimport { redactBoxConfig, type BoxConfig, type BoxConfigRedacted } from './config.ts'\n\nconst boxResolveGlob = makeResolveGlob(boxReaddir)\n\nexport interface BoxResourceState {\n type: string\n config: BoxConfigRedacted\n}\n\nexport class BoxResource implements Resource {\n readonly kind: string = ResourceName.BOX\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = BOX_PROMPT\n readonly config: BoxConfig\n readonly accessor: BoxAccessor\n readonly index: IndexCacheStore\n\n constructor(config: BoxConfig) {\n this.config = config\n const tm = new BoxTokenManager({\n ...(config.endpoint !== undefined ? { endpoint: config.endpoint } : {}),\n ...(config.clientId !== undefined ? { clientId: config.clientId } : {}),\n ...(config.clientSecret !== undefined ? { clientSecret: config.clientSecret } : {}),\n ...(config.refreshToken !== undefined ? { refreshToken: config.refreshToken } : {}),\n ...(config.accessToken !== undefined ? { accessToken: config.accessToken } : {}),\n ...(config.refreshFn !== undefined ? { refreshFn: config.refreshFn } : {}),\n ...(config.onRefreshTokenRotated !== undefined\n ? { onRefreshTokenRotated: config.onRefreshTokenRotated }\n : {}),\n })\n this.accessor = new BoxAccessor({\n tokenManager: tm,\n ...(config.rootFolderId !== undefined ? { rootFolderId: config.rootFolderId } : {}),\n ...(config.contentSearch !== undefined ? { contentSearch: config.contentSearch } : {}),\n })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return BOX_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return BOX_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return boxRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return boxReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return boxStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return boxResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<BoxResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactBoxConfig(this.config),\n })\n }\n\n loadState(_state: BoxResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,iBAAiB,gBAAgB,UAAU;AAO1C,IAAM,cAAN,MAAsC;AAAA,EAClC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAmB;AAC7B,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,gBAAgB;AAAA,MAC7B,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,MACrE,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,MACrE,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;AAAA,MACjF,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;AAAA,MACjF,GAAI,OAAO,gBAAgB,SAAY,EAAE,aAAa,OAAO,YAAY,IAAI,CAAC;AAAA,MAC9E,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,MACxE,GAAI,OAAO,0BAA0B,SACjC,EAAE,uBAAuB,OAAO,sBAAsB,IACtD,CAAC;AAAA,IACP,CAAC;AACD,SAAK,WAAW,IAAI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A,MACX,QAAQ,gBAAgB,KAAK,MAAM;AAAA,IACrC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAAyC;AACjD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/r2/r2.ts","../src/resource/r2/config.ts","../src/resource/r2/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport { r2ToS3Config, redactR2Config, type R2Config, type R2ConfigRedacted } from './config.ts'\nimport { R2_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface R2ResourceState {\n type: string\n config: R2ConfigRedacted\n}\n\nexport class R2Resource extends S3Resource {\n override readonly kind: string = ResourceName.R2\n override readonly prompt: string = R2_BROWSER_PROMPT\n readonly r2Config: R2Config\n private readonly r2Ops: readonly RegisteredOp[]\n private readonly r2Commands: readonly RegisteredCommand[]\n\n constructor(config: R2Config) {\n super(r2ToS3Config(config))\n this.r2Config = config\n this.r2Ops = remapOpsResource(super.ops(), ResourceName.R2)\n this.r2Commands = remapCommandsResource(super.commands(), ResourceName.R2)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.r2Ops\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.r2Commands\n }\n\n override getState(): Promise<R2ResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactR2Config(this.r2Config),\n })\n }\n\n override loadState(_state: R2ResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface R2Config {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n accountId?: string\n region?: string\n endpoint?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface R2ConfigRedacted extends Omit<R2Config, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst R2ConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n accountId: z.string().optional(),\n region: z.string().optional(),\n endpoint: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function resolvedR2Endpoint(config: R2Config): string | undefined {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.accountId !== undefined && config.accountId !== '') {\n return `https://${config.accountId}.r2.cloudflarestorage.com`\n }\n return undefined\n}\n\nexport function r2ToS3Config(config: R2Config): S3Config {\n const endpoint = resolvedR2Endpoint(config)\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n region: config.region ?? 'auto',\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactR2Config(config: R2Config): R2ConfigRedacted {\n return redactConfigWithSchema(R2ConfigSchema, config) as unknown as R2ConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const R2_BROWSER_PROMPT = `{prefix}\n Remote Cloudflare R2 bucket accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAiBxD,IAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,oBAAoB,EAAE,OAAO,EAAE,SAAS;AAAA,EACxC,WAAW,EAAE,OAAO,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Q;AAAA,IACtC,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAAwC;AACzD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gdrive/gdrive.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n type FileStat,\n GDRIVE_COMMANDS,\n GDRIVE_PROMPT,\n GDRIVE_OPS,\n GDriveAccessor,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gdriveRead,\n gdriveReaddir,\n makeResolveGlob,\n gdriveStat,\n} from '@struktoai/mirage-core'\nimport { redactGDriveConfig, type GDriveConfig, type GDriveConfigRedacted } from './config.ts'\n\nconst gdriveResolveGlob = makeResolveGlob(gdriveReaddir)\n\nexport interface GDriveResourceState {\n type: string\n config: GDriveConfigRedacted\n}\n\nexport class GDriveResource implements Resource {\n readonly kind: string = ResourceName.GDRIVE\n readonly cachesReads: boolean = true\n readonly supportsSnapshot: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GDRIVE_PROMPT\n readonly config: GDriveConfig\n readonly accessor: GDriveAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GDriveConfig) {\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n ...(config.clientSecret !== undefined ? { clientSecret: config.clientSecret } : {}),\n refreshToken: config.refreshToken,\n ...(config.refreshFn !== undefined ? { refreshFn: config.refreshFn } : {}),\n ...(config.folderId !== undefined ? { folderId: config.folderId } : {}),\n })\n this.accessor = new GDriveAccessor({ tokenManager: tm })\n this.index = new RAMIndexCacheStore({ ttl: 86_400 })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GDRIVE_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GDRIVE_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gdriveRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gdriveReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gdriveStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gdriveResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GDriveResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGDriveConfig(this.config),\n })\n }\n\n loadState(_state: GDriveResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,oBAAoB,gBAAgB,aAAa;AAOhD,IAAM,iBAAN,MAAyC;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AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/github/github.ts","../src/resource/github/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { mountKey, mountPrefixOf } from '@struktoai/mirage-core'\nimport {\n fetchGitHubRepoInfo,\n fetchGitHubTree,\n type FileStat,\n GITHUB_COMMANDS,\n GITHUB_PROMPT,\n GITHUB_OPS,\n GitHubAccessor,\n HttpGitHubTransport,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n githubBuildTreeMap,\n githubPopulateIndex,\n githubRead,\n githubReaddir,\n makeResolveGlob,\n githubStat,\n} from '@struktoai/mirage-core'\nimport { redactGitHubConfig, type GitHubConfig, type GitHubConfigRedacted } from './config.ts'\n\nconst githubResolveGlob = makeResolveGlob(githubReaddir)\n\nexport interface GitHubResourceState {\n type: string\n config: GitHubConfigRedacted\n defaultBranch: string\n truncated: boolean\n}\n\nexport class GitHubResource implements Resource {\n readonly kind: string = ResourceName.GITHUB\n readonly cachesReads: boolean = true\n // Blob shas are stable per-path markers, so cached reads can be\n // probe-verified under ALWAYS and snapshots carry drift fingerprints.\n readonly supportsSnapshot: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GITHUB_PROMPT\n readonly config: GitHubConfig\n readonly accessor: GitHubAccessor\n readonly index: IndexCacheStore\n\n private constructor(config: GitHubConfig, accessor: GitHubAccessor, index: IndexCacheStore) {\n this.config = config\n this.accessor = accessor\n this.index = index\n }\n\n static async create(config: GitHubConfig): Promise<GitHubResource> {\n const transportOpts: { token: string; baseUrl?: string } = { token: config.token }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n const transport = new HttpGitHubTransport(transportOpts)\n const repoInfo = await fetchGitHubRepoInfo(transport, config.owner, config.repo)\n const ref = config.ref ?? repoInfo.default_branch\n const { tree, truncated } = await fetchGitHubTree(transport, config.owner, config.repo, ref)\n const treeMap = githubBuildTreeMap(tree)\n const accessor = new GitHubAccessor({\n transport,\n owner: config.owner,\n repo: config.repo,\n ref,\n defaultBranch: repoInfo.default_branch,\n truncated,\n tree: treeMap,\n })\n const index = new RAMIndexCacheStore({ ttl: 86_400 })\n await githubPopulateIndex(index, tree)\n return new GitHubResource(config, accessor, index)\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GITHUB_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GITHUB_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return githubRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return githubReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return githubStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return githubResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GitHubResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGitHubConfig(this.config),\n defaultBranch: this.accessor.defaultBranch,\n truncated: this.accessor.truncated,\n })\n }\n\n loadState(_state: GitHubResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GitHubConfig {\n token: string\n owner: string\n repo: string\n ref?: string\n baseUrl?: string\n}\n\nexport interface GitHubConfigRedacted {\n token: '<REDACTED>'\n owner: string\n repo: string\n ref?: string\n baseUrl?: string\n}\n\nconst GitHubConfigSchema = z.object({\n token: secretStr(),\n owner: z.string(),\n repo: z.string(),\n ref: z.string().optional(),\n baseUrl: z.string().optional(),\n})\n\nexport function redactGitHubConfig(config: GitHubConfig): GitHubConfigRedacted {\n return redactConfigWithSchema(GitHubConfigSchema, config) as unknown as GitHubConfigRedacted\n}\n\nexport function normalizeGitHubConfig(input: Record<string, unknown>): GitHubConfig {\n return normalizeFields(input, {\n rename: { base_url: 'baseUrl' },\n }) as unknown as GitHubConfig\n}\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACvBP,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAkBtE,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,OAAO,UAAU;AAAA,EACjB,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB,MAAM;AAC1D;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ,EAAE,UAAU,UAAU;AAAA,EAChC,CAAC;AACH;;;ADRA,IAAM,oBAAoB,gBAAgB,aAAa;AAShD,IAAM,iBAAN,MAAM,gBAAmC;AAAA,EACrC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA;AAAA;AAAA,EAGvB,mBAA4B;AAAA,EAC5B,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAED,YAAY,QAAsB,UAA0B,OAAwB;AAC1F,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,aAAa,OAAO,QA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AE,SAAS,EAAE,YAAY,MAAM,KACzC,IACA,IAAI,SAAS;AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,MACtC,eAAe,KAAK,SAAS;AAAA,MAC7B,WAAW,KAAK,SAAS;AAAA,IAC3B,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
package/dist/chunk-QXJP6TWI.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// src/resource/gdrive/config.ts
|
|
2
|
-
import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
|
|
3
|
-
var GDriveConfigSchema = z.object({
|
|
4
|
-
clientId: z.string(),
|
|
5
|
-
clientSecret: secretStr().optional(),
|
|
6
|
-
refreshToken: secretStr(),
|
|
7
|
-
folderId: z.string().optional()
|
|
8
|
-
});
|
|
9
|
-
function redactGDriveConfig(config) {
|
|
10
|
-
return redactConfigWithSchema(GDriveConfigSchema, config);
|
|
11
|
-
}
|
|
12
|
-
function normalizeGDriveConfig(input) {
|
|
13
|
-
return normalizeFields(input, {
|
|
14
|
-
rename: {
|
|
15
|
-
client_id: "clientId",
|
|
16
|
-
client_secret: "clientSecret",
|
|
17
|
-
refresh_token: "refreshToken",
|
|
18
|
-
folder_id: "folderId"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
redactGDriveConfig,
|
|
25
|
-
normalizeGDriveConfig
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=chunk-QXJP6TWI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gdrive/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GDriveConfig {\n clientId: string\n clientSecret?: string\n refreshToken: string\n refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; expiresIn: number }>\n folderId?: string\n}\n\nexport interface GDriveConfigRedacted {\n clientId: string\n clientSecret?: '<REDACTED>'\n refreshToken: '<REDACTED>'\n}\n\nconst GDriveConfigSchema = z.object({\n clientId: z.string(),\n clientSecret: secretStr().optional(),\n refreshToken: secretStr(),\n folderId: z.string().optional(),\n})\n\nexport function redactGDriveConfig(config: GDriveConfig): GDriveConfigRedacted {\n return redactConfigWithSchema(GDriveConfigSchema, config) as unknown as GDriveConfigRedacted\n}\n\nexport function normalizeGDriveConfig(input: Record<string, unknown>): GDriveConfig {\n return normalizeFields(input, {\n rename: {\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n folder_id: 'folderId',\n },\n }) as unknown as GDriveConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAgBtE,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,UAAU,EAAE,OAAO;AAAA,EACnB,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,cAAc,UAAU;AAAA,EACxB,UAAU,EAAE,OAAO,EAAE,SAAS;AAChC,CAAC;AAEM,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB,MAAM;AAC1D;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,MACf,WAAW;AAAA,IACb;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/minio/minio.ts","../src/resource/minio/config.ts","../src/resource/minio/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n minioToS3Config,\n redactMinIOConfig,\n type MinIOConfig,\n type MinIOConfigRedacted,\n} from './config.ts'\nimport { MINIO_BROWSER_PROMPT } from './prompt.ts'\n\nexport interface MinIOResourceState {\n type: string\n config: MinIOConfigRedacted\n}\n\nexport class MinIOResource extends S3Resource {\n override readonly kind: string = ResourceName.MINIO\n override readonly prompt: string = MINIO_BROWSER_PROMPT\n readonly minioConfig: MinIOConfig\n private readonly minioOps: readonly RegisteredOp[]\n private readonly minioCommands: readonly RegisteredCommand[]\n\n constructor(config: MinIOConfig) {\n super(minioToS3Config(config))\n this.minioConfig = config\n this.minioOps = remapOpsResource(super.ops(), ResourceName.MINIO)\n this.minioCommands = remapCommandsResource(super.commands(), ResourceName.MINIO)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.minioOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.minioCommands\n }\n\n override getState(): Promise<MinIOResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactMinIOConfig(this.minioConfig),\n })\n }\n\n override loadState(_state: MinIOResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { redactConfigWithSchema, secretSchema, z } from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\n\nexport interface MinIOConfig {\n bucket: string\n presignedUrlProvider: S3BrowserPresignedUrlProvider\n endpoint?: string\n region?: string\n defaultContentType?: string\n keyPrefix?: string\n}\n\nexport interface MinIOConfigRedacted extends Omit<MinIOConfig, 'presignedUrlProvider'> {\n presignedUrlProvider: '<REDACTED>'\n}\n\nconst MinIOConfigSchema = z.object({\n bucket: z.string(),\n presignedUrlProvider: secretSchema(\n z.custom<S3BrowserPresignedUrlProvider>((value) => typeof value === 'function'),\n ),\n endpoint: z.string().optional(),\n region: z.string().optional(),\n defaultContentType: z.string().optional(),\n keyPrefix: z.string().optional(),\n})\n\nexport function minioToS3Config(config: MinIOConfig): S3Config {\n return {\n bucket: config.bucket,\n presignedUrlProvider: config.presignedUrlProvider,\n ...(config.region !== undefined ? { region: config.region } : {}),\n ...(config.endpoint !== undefined ? { endpoint: config.endpoint } : {}),\n ...(config.defaultContentType !== undefined\n ? { defaultContentType: config.defaultContentType }\n : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n }\n}\n\nexport function redactMinIOConfig(config: MinIOConfig): MinIOConfigRedacted {\n return redactConfigWithSchema(MinIOConfigSchema, config) as unknown as MinIOConfigRedacted\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const MINIO_BROWSER_PROMPT = `{prefix}\n Remote MinIO bucket (S3-compatible) accessed via presigned URLs (browser runtime).\n Supports the full filesystem command set: ls/tree/cat/grep/find/du/cp/mv/rm/etc.\n Listing operations require the presigner to sign LIST/COPY operations in\n addition to GET/PUT/HEAD/DELETE — see S3BrowserPresignedUrlProvider docs.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNP,SAAS,wBAAwB,cAAc,SAAS;AAgBxD,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,QAAQ,EAAE,OAAO;AAAA,EACjB,sBAAsB;AAAA,IACpB,EAAE,OAAsC,CAAC,UAAU,OAAO,UAAU,UAAU;AAAA,EAChF;AAAA,EACA,UAAU,EAAE,OAAO,EAAE,SAAS;AA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