@struktoai/mirage-browser 0.0.3 → 0.0.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-HYUESAQS.js → chunk-2J35WXX5.js} +7 -3
- package/dist/chunk-2J35WXX5.js.map +1 -0
- package/dist/{chunk-CGZGX2GO.js → chunk-2WNXK742.js} +10 -12
- package/dist/chunk-2WNXK742.js.map +1 -0
- package/dist/{chunk-X2CCEHOR.js → chunk-2WSKXBSV.js} +22 -12
- package/dist/chunk-2WSKXBSV.js.map +1 -0
- package/dist/{chunk-SOF74I3T.js → chunk-37WKCB2E.js} +7 -5
- package/dist/chunk-37WKCB2E.js.map +1 -0
- package/dist/{chunk-ROHDW6KT.js → chunk-3IYCVC7W.js} +11 -5
- package/dist/chunk-3IYCVC7W.js.map +1 -0
- package/dist/{chunk-LSURHXZH.js → chunk-46HNNKFR.js} +11 -5
- 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-DA5EW34P.js → chunk-5OZJMTYW.js} +17 -13
- package/dist/chunk-5OZJMTYW.js.map +1 -0
- package/dist/{chunk-PV53AX35.js → chunk-5UM6EBVW.js} +18 -12
- package/dist/chunk-5UM6EBVW.js.map +1 -0
- package/dist/{chunk-NWZNQ3RC.js → chunk-6HRSCX2U.js} +11 -5
- package/dist/chunk-6HRSCX2U.js.map +1 -0
- package/dist/{chunk-F5QWZ7GM.js → chunk-7HWQAYXR.js} +11 -5
- package/dist/chunk-7HWQAYXR.js.map +1 -0
- package/dist/{chunk-OSMEXGRN.js → chunk-AUZNQ7EI.js} +13 -20
- package/dist/chunk-AUZNQ7EI.js.map +1 -0
- package/dist/{chunk-RQ273N5K.js → chunk-BGA2F226.js} +26 -21
- package/dist/chunk-BGA2F226.js.map +1 -0
- package/dist/{chunk-HXQ7HDA6.js → chunk-BV372CUO.js} +18 -20
- package/dist/chunk-BV372CUO.js.map +1 -0
- package/dist/{chunk-57QQAM7V.js → chunk-C4THTILY.js} +11 -5
- package/dist/chunk-C4THTILY.js.map +1 -0
- package/dist/{chunk-DVXOMWD4.js → chunk-D4MEOKNQ.js} +11 -5
- 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-NLBT6TBM.js → chunk-EHIT6WCY.js} +11 -5
- package/dist/chunk-EHIT6WCY.js.map +1 -0
- package/dist/{chunk-CNDGXKMU.js → chunk-EN6TZYT2.js} +11 -5
- package/dist/chunk-EN6TZYT2.js.map +1 -0
- package/dist/{chunk-QLLRQNOJ.js → chunk-FTDVV7EQ.js} +11 -5
- package/dist/chunk-FTDVV7EQ.js.map +1 -0
- package/dist/{chunk-G26SGOFR.js → chunk-G67Q2Z6I.js} +11 -5
- package/dist/chunk-G67Q2Z6I.js.map +1 -0
- package/dist/{chunk-XBOJZZRT.js → chunk-GM2QMJAY.js} +13 -20
- package/dist/chunk-GM2QMJAY.js.map +1 -0
- package/dist/{chunk-XYKNXGPR.js → chunk-HRWLHJX2.js} +14 -20
- package/dist/chunk-HRWLHJX2.js.map +1 -0
- package/dist/{chunk-DHZMC42C.js → chunk-INEXV2PN.js} +11 -5
- 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-4NLXLDMV.js → chunk-JUVMJ5GI.js} +13 -20
- package/dist/chunk-JUVMJ5GI.js.map +1 -0
- package/dist/{chunk-BIIG7ZAQ.js → chunk-KL2VFYUV.js} +7 -5
- package/dist/chunk-KL2VFYUV.js.map +1 -0
- package/dist/{chunk-J54OBIJA.js → chunk-L64GRKOD.js} +12 -3
- package/dist/chunk-L64GRKOD.js.map +1 -0
- package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
- package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
- package/dist/chunk-M2UF2JHJ.js +11 -0
- package/dist/chunk-M2UF2JHJ.js.map +1 -0
- package/dist/{chunk-KNJKYCTA.js → chunk-NVHPJ5CV.js} +19 -12
- package/dist/chunk-NVHPJ5CV.js.map +1 -0
- package/dist/{chunk-O5ONB7QT.js → chunk-OSTDTTWI.js} +14 -5
- package/dist/chunk-OSTDTTWI.js.map +1 -0
- package/dist/{chunk-J7PLA5S3.js → chunk-PQCRGTSA.js} +11 -5
- package/dist/chunk-PQCRGTSA.js.map +1 -0
- package/dist/{chunk-BJHHL4UT.js → chunk-QE7QNA45.js} +14 -11
- package/dist/chunk-QE7QNA45.js.map +1 -0
- package/dist/{chunk-K2S42IR4.js → chunk-QG2NUNCY.js} +11 -5
- 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-KTE5PB2D.js → chunk-UY22T4AC.js} +22 -14
- 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-6YP3B7UK.js → chunk-Y6DYUK6J.js} +11 -5
- package/dist/chunk-Y6DYUK6J.js.map +1 -0
- package/dist/{chunk-DFHFILVF.js → chunk-YOCTIHQZ.js} +14 -12
- package/dist/chunk-YOCTIHQZ.js.map +1 -0
- package/dist/{chunk-TQ6VRUEI.js → chunk-ZDJPUXYH.js} +14 -12
- package/dist/chunk-ZDJPUXYH.js.map +1 -0
- package/dist/{chunk-2AEAISO2.js → chunk-ZKCOSE3R.js} +18 -18
- 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-ET26F632.js → config-2Y6LZKLV.js} +2 -4
- package/dist/config-4GSOMUMF.js +9 -0
- package/dist/config-5YBUWFUP.js +9 -0
- package/dist/config-DE5OZ4I7.js +9 -0
- package/dist/config-ELDOFRJW.js +9 -0
- package/dist/config-FPM3LAW7.js +9 -0
- package/dist/config-JY557MA6.js +9 -0
- package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
- 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-JHGWTQU5.js +8 -0
- package/dist/gsheets-N54JO2RS.js +8 -0
- package/dist/gslides-B4VMNLMB.js +8 -0
- package/dist/index.d.ts +292 -348
- package/dist/index.js +171 -110
- 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/mongodb-YZP643ZU.js +7 -0
- package/dist/notion-I5S5SRLO.js +7 -0
- package/dist/oci-XOPKH4AE.js +8 -0
- package/dist/opfs-36QO72Y5.js +7 -0
- package/dist/postgres-HPOMN2AR.js +7 -0
- package/dist/qingstor-JKAHLK62.js +8 -0
- package/dist/r2-L3QXQ76M.js +8 -0
- package/dist/{s3-GI7SDKGR.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 -3
- package/dist/aliyun-GMNRT7BJ.js +0 -8
- package/dist/backblaze-O6CLR73B.js +0 -8
- package/dist/box-GXWDWZRN.js +0 -8
- package/dist/ceph-SM7MXDAY.js +0 -8
- package/dist/chunk-2AEAISO2.js.map +0 -1
- package/dist/chunk-2H4KUUFP.js +0 -26
- package/dist/chunk-2H4KUUFP.js.map +0 -1
- package/dist/chunk-4NLXLDMV.js.map +0 -1
- package/dist/chunk-57QQAM7V.js.map +0 -1
- package/dist/chunk-6YP3B7UK.js.map +0 -1
- package/dist/chunk-BIIG7ZAQ.js.map +0 -1
- package/dist/chunk-BJHHL4UT.js.map +0 -1
- package/dist/chunk-CGZGX2GO.js.map +0 -1
- package/dist/chunk-CNDGXKMU.js.map +0 -1
- package/dist/chunk-DA5EW34P.js.map +0 -1
- package/dist/chunk-DFHFILVF.js.map +0 -1
- package/dist/chunk-DHZMC42C.js.map +0 -1
- package/dist/chunk-DVXOMWD4.js.map +0 -1
- package/dist/chunk-F5QWZ7GM.js.map +0 -1
- package/dist/chunk-G26SGOFR.js.map +0 -1
- package/dist/chunk-HXQ7HDA6.js.map +0 -1
- package/dist/chunk-HYUESAQS.js.map +0 -1
- package/dist/chunk-J54OBIJA.js.map +0 -1
- package/dist/chunk-J7PLA5S3.js.map +0 -1
- package/dist/chunk-JSAQMYPK.js +0 -26
- package/dist/chunk-JSAQMYPK.js.map +0 -1
- package/dist/chunk-K2S42IR4.js.map +0 -1
- package/dist/chunk-KNJKYCTA.js.map +0 -1
- package/dist/chunk-KTE5PB2D.js.map +0 -1
- package/dist/chunk-KV2DM5H6.js +0 -2116
- package/dist/chunk-KV2DM5H6.js.map +0 -1
- package/dist/chunk-LSURHXZH.js.map +0 -1
- package/dist/chunk-NLBT6TBM.js.map +0 -1
- package/dist/chunk-NMZBJOFW.js +0 -26
- package/dist/chunk-NMZBJOFW.js.map +0 -1
- package/dist/chunk-NWZNQ3RC.js.map +0 -1
- package/dist/chunk-O5ONB7QT.js.map +0 -1
- package/dist/chunk-OSMEXGRN.js.map +0 -1
- package/dist/chunk-PV53AX35.js.map +0 -1
- package/dist/chunk-QLLRQNOJ.js.map +0 -1
- package/dist/chunk-ROHDW6KT.js.map +0 -1
- package/dist/chunk-RQ273N5K.js.map +0 -1
- package/dist/chunk-SOF74I3T.js.map +0 -1
- package/dist/chunk-TQ6VRUEI.js.map +0 -1
- package/dist/chunk-X2CCEHOR.js.map +0 -1
- package/dist/chunk-XBOJZZRT.js.map +0 -1
- package/dist/chunk-XYKNXGPR.js.map +0 -1
- package/dist/chunk-YGRKFONX.js +0 -26
- package/dist/chunk-YGRKFONX.js.map +0 -1
- package/dist/config-7IZCGWKX.js +0 -11
- package/dist/config-AT74FARJ.js +0 -11
- package/dist/config-C2AYHACT.js +0 -11
- package/dist/config-GHJOYNM6.js +0 -11
- package/dist/config-L55UXIF4.js +0 -11
- package/dist/config-V7BLK5WP.js +0 -11
- package/dist/digitalocean-XFH2V2A3.js +0 -8
- package/dist/discord-OQMSHM3L.js +0 -7
- package/dist/dropbox-IAOKM7G5.js +0 -8
- package/dist/gcs-JYZB6CVP.js +0 -8
- package/dist/gdocs-PHKQGLZL.js +0 -8
- package/dist/gdrive-4JQLGOOP.js +0 -8
- package/dist/github-DU7Z4RSU.js +0 -7
- package/dist/github_ci-XSAJDNXC.js +0 -8
- package/dist/gmail-DEQP2M7T.js +0 -8
- package/dist/gsheets-KCIHSMOK.js +0 -8
- package/dist/gslides-2KBUKKM5.js +0 -8
- package/dist/langfuse-FNCMKFSL.js +0 -7
- package/dist/linear-XTFO4WKD.js +0 -7
- package/dist/minio-NGPBAJY3.js +0 -8
- package/dist/mongodb-PGOX6QSY.js +0 -7
- package/dist/notion-HYYNQ7KI.js +0 -7
- package/dist/oci-EGDBSMLM.js +0 -8
- package/dist/opfs-5WGXB5OG.js +0 -7
- package/dist/postgres-5HYED4AC.js +0 -7
- package/dist/qingstor-2T4Y6MEG.js +0 -8
- package/dist/r2-3B45S2KV.js +0 -8
- package/dist/scaleway-ICCXVAY6.js +0 -8
- package/dist/seaweedfs-MF77EC33.js +0 -8
- package/dist/slack-6LGQERIU.js +0 -7
- package/dist/supabase-XTOVMHXU.js +0 -8
- package/dist/tencent-FXFKSOTN.js +0 -8
- package/dist/trello-DZK4NEVY.js +0 -7
- package/dist/wasabi-KVE2B6RB.js +0 -8
- /package/dist/{aliyun-GMNRT7BJ.js.map → aliyun-DR6KT3H6.js.map} +0 -0
- /package/dist/{backblaze-O6CLR73B.js.map → backblaze-XCLZXTES.js.map} +0 -0
- /package/dist/{box-GXWDWZRN.js.map → box-XBCSU3AA.js.map} +0 -0
- /package/dist/{ceph-SM7MXDAY.js.map → ceph-F5S2NMTO.js.map} +0 -0
- /package/dist/{config-7IZCGWKX.js.map → config-2Y6LZKLV.js.map} +0 -0
- /package/dist/{config-AT74FARJ.js.map → config-4GSOMUMF.js.map} +0 -0
- /package/dist/{config-C2AYHACT.js.map → config-5YBUWFUP.js.map} +0 -0
- /package/dist/{config-ET26F632.js.map → config-DE5OZ4I7.js.map} +0 -0
- /package/dist/{config-GHJOYNM6.js.map → config-ELDOFRJW.js.map} +0 -0
- /package/dist/{config-L55UXIF4.js.map → config-FPM3LAW7.js.map} +0 -0
- /package/dist/{config-NV5WXP64.js.map → config-JY557MA6.js.map} +0 -0
- /package/dist/{config-V7BLK5WP.js.map → config-UU27ALAA.js.map} +0 -0
- /package/dist/{digitalocean-XFH2V2A3.js.map → config-WRACCRPN.js.map} +0 -0
- /package/dist/{discord-OQMSHM3L.js.map → digitalocean-QDHTRS2W.js.map} +0 -0
- /package/dist/{dropbox-IAOKM7G5.js.map → discord-ERUI7OAQ.js.map} +0 -0
- /package/dist/{gcs-JYZB6CVP.js.map → dropbox-3U6D4HLE.js.map} +0 -0
- /package/dist/{gdocs-PHKQGLZL.js.map → gcal-MTBSDG34.js.map} +0 -0
- /package/dist/{gdrive-4JQLGOOP.js.map → gcs-KNGRBBET.js.map} +0 -0
- /package/dist/{github-DU7Z4RSU.js.map → gdocs-RUIOIRKP.js.map} +0 -0
- /package/dist/{github_ci-XSAJDNXC.js.map → gdrive-5JB7ZKEP.js.map} +0 -0
- /package/dist/{gmail-DEQP2M7T.js.map → github-CIXBFBVO.js.map} +0 -0
- /package/dist/{gsheets-KCIHSMOK.js.map → github_ci-HR6YOYAO.js.map} +0 -0
- /package/dist/{gslides-2KBUKKM5.js.map → gmail-JHGWTQU5.js.map} +0 -0
- /package/dist/{langfuse-FNCMKFSL.js.map → gsheets-N54JO2RS.js.map} +0 -0
- /package/dist/{linear-XTFO4WKD.js.map → gslides-B4VMNLMB.js.map} +0 -0
- /package/dist/{minio-NGPBAJY3.js.map → langfuse-HEUJGDOC.js.map} +0 -0
- /package/dist/{mongodb-PGOX6QSY.js.map → linear-J4QQ3CA6.js.map} +0 -0
- /package/dist/{notion-HYYNQ7KI.js.map → minio-BXWHJ6K5.js.map} +0 -0
- /package/dist/{oci-EGDBSMLM.js.map → mongodb-YZP643ZU.js.map} +0 -0
- /package/dist/{opfs-5WGXB5OG.js.map → notion-I5S5SRLO.js.map} +0 -0
- /package/dist/{postgres-5HYED4AC.js.map → oci-XOPKH4AE.js.map} +0 -0
- /package/dist/{qingstor-2T4Y6MEG.js.map → opfs-36QO72Y5.js.map} +0 -0
- /package/dist/{r2-3B45S2KV.js.map → postgres-HPOMN2AR.js.map} +0 -0
- /package/dist/{s3-GI7SDKGR.js.map → qingstor-JKAHLK62.js.map} +0 -0
- /package/dist/{scaleway-ICCXVAY6.js.map → r2-L3QXQ76M.js.map} +0 -0
- /package/dist/{seaweedfs-MF77EC33.js.map → s3-LRZJPGHK.js.map} +0 -0
- /package/dist/{slack-6LGQERIU.js.map → scaleway-CGNDYNKS.js.map} +0 -0
- /package/dist/{supabase-XTOVMHXU.js.map → seaweedfs-BSQWCBIR.js.map} +0 -0
- /package/dist/{tencent-FXFKSOTN.js.map → slack-62ECSENR.js.map} +0 -0
- /package/dist/{trello-DZK4NEVY.js.map → supabase-J66NXWAF.js.map} +0 -0
- /package/dist/{wasabi-KVE2B6RB.js.map → tencent-AC667LV3.js.map} +0 -0
package/README.md
CHANGED
|
@@ -46,7 +46,8 @@ await ws.execute('cp /s3/report.csv /data/local.csv')
|
|
|
46
46
|
await ws.execute('wc -l $(find /s3/data -name "*.jsonl")')
|
|
47
47
|
|
|
48
48
|
// Commands are extensible: register new commands, or override one per
|
|
49
|
-
// resource + filetype
|
|
49
|
+
// resource + filetype. Mirage ships no filetype renderers, so a format
|
|
50
|
+
// like Parquet renders however you register it.
|
|
50
51
|
ws.command('summarize', ...)
|
|
51
52
|
ws.command('cat', { resource: 's3', filetype: 'parquet' }, ...)
|
|
52
53
|
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// src/resource/github_ci/config.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
normalizeFields,
|
|
4
|
+
redactConfigWithSchema,
|
|
5
|
+
secretStr,
|
|
6
|
+
z
|
|
7
|
+
} from "@struktoai/mirage-core";
|
|
3
8
|
var GitHubCIConfigSchema = z.object({
|
|
4
9
|
token: secretStr(),
|
|
5
10
|
owner: z.string(),
|
|
@@ -17,8 +22,7 @@ function normalizeGitHubCIConfig(input) {
|
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export {
|
|
20
|
-
GitHubCIConfigSchema,
|
|
21
25
|
redactGitHubCIConfig,
|
|
22
26
|
normalizeGitHubCIConfig
|
|
23
27
|
};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-2J35WXX5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 {\n normalizeFields,\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretStr,\n z,\n} from '@struktoai/mirage-core'\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 type GitHubCIConfig = ConfigOf<typeof GitHubCIConfigSchema>\n\nexport type GitHubCIConfigRedacted = RedactedConfig<GitHubCIConfig, 'token'>\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;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP,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;AAMM,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,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
redactGitHubCIConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2J35WXX5.js";
|
|
4
4
|
|
|
5
5
|
// src/resource/github_ci/github_ci.ts
|
|
6
|
+
import { mountKey, mountPrefixOf } from "@struktoai/mirage-core";
|
|
6
7
|
import {
|
|
7
8
|
GITHUB_CI_COMMANDS,
|
|
8
9
|
GITHUB_CI_PROMPT,
|
|
9
|
-
|
|
10
|
+
GITHUB_CI_OPS,
|
|
10
11
|
GitHubCIAccessor,
|
|
11
12
|
HttpCITransport,
|
|
12
13
|
PathSpec,
|
|
@@ -14,9 +15,10 @@ import {
|
|
|
14
15
|
ResourceName,
|
|
15
16
|
githubCiRead,
|
|
16
17
|
githubCiReaddir,
|
|
17
|
-
|
|
18
|
+
makeResolveGlob,
|
|
18
19
|
githubCiStat
|
|
19
20
|
} from "@struktoai/mirage-core";
|
|
21
|
+
var githubCiResolveGlob = makeResolveGlob(githubCiReaddir);
|
|
20
22
|
var GitHubCIResource = class {
|
|
21
23
|
kind = ResourceName.GITHUB_CI;
|
|
22
24
|
cachesReads = true;
|
|
@@ -47,7 +49,7 @@ var GitHubCIResource = class {
|
|
|
47
49
|
return GITHUB_CI_COMMANDS;
|
|
48
50
|
}
|
|
49
51
|
ops() {
|
|
50
|
-
return
|
|
52
|
+
return GITHUB_CI_OPS;
|
|
51
53
|
}
|
|
52
54
|
readFile(p) {
|
|
53
55
|
return githubCiRead(this.accessor, p, this.index);
|
|
@@ -58,18 +60,14 @@ var GitHubCIResource = class {
|
|
|
58
60
|
stat(p) {
|
|
59
61
|
return githubCiStat(this.accessor, p, this.index);
|
|
60
62
|
}
|
|
61
|
-
async fingerprint(p) {
|
|
62
|
-
const lookup = await this.index.get(p.original);
|
|
63
|
-
return lookup.entry?.remoteTime ?? null;
|
|
64
|
-
}
|
|
65
63
|
glob(paths, prefix = "") {
|
|
66
64
|
const effective = prefix !== "" ? paths.map(
|
|
67
|
-
(p) => p.
|
|
68
|
-
|
|
65
|
+
(p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
|
|
66
|
+
virtual: p.virtual,
|
|
69
67
|
directory: p.directory,
|
|
70
68
|
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
71
69
|
resolved: p.resolved,
|
|
72
|
-
prefix
|
|
70
|
+
resourcePath: mountKey(p.virtual, prefix)
|
|
73
71
|
})
|
|
74
72
|
) : paths;
|
|
75
73
|
return githubCiResolveGlob(this.accessor, effective, this.index);
|
|
@@ -88,4 +86,4 @@ var GitHubCIResource = class {
|
|
|
88
86
|
export {
|
|
89
87
|
GitHubCIResource
|
|
90
88
|
};
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-2WNXK742.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/github_ci/github_ci.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 GITHUB_CI_COMMANDS,\n GITHUB_CI_PROMPT,\n GITHUB_CI_OPS,\n GitHubCIAccessor,\n HttpCITransport,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n githubCiRead,\n githubCiReaddir,\n makeResolveGlob,\n githubCiStat,\n} from '@struktoai/mirage-core'\nimport { redactGitHubCIConfig, type GitHubCIConfig, type GitHubCIConfigRedacted } from './config.ts'\n\nconst githubCiResolveGlob = makeResolveGlob(githubCiReaddir)\n\nexport interface GitHubCIResourceState {\n type: string\n config: GitHubCIConfigRedacted\n}\n\nexport class GitHubCIResource implements Resource {\n readonly kind: string = ResourceName.GITHUB_CI\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GITHUB_CI_PROMPT\n readonly config: GitHubCIConfig\n readonly accessor: GitHubCIAccessor\n readonly index: IndexCacheStore\n\n constructor(config: GitHubCIConfig) {\n this.config = config\n const transportOpts: { token: string; baseUrl?: string } = { token: config.token }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n this.accessor = new GitHubCIAccessor({\n transport: new HttpCITransport(transportOpts),\n owner: config.owner,\n repo: config.repo,\n days: config.days ?? 30,\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 GITHUB_CI_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GITHUB_CI_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return githubCiRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return githubCiReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return githubCiStat(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 githubCiResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GitHubCIResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGitHubCIConfig(this.config),\n })\n }\n\n loadState(_state: GitHubCIResourceState): 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,sBAAsB,gBAAgB,eAAe;AAOpD,IAAM,mBAAN,MAA2C;AAAA,EACvC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAwB;AAClC,SAAK,SAAS;AACd,UAAM,gBAAqD,EAAE,OAAO,OAAO,MAAM;AACjF,QAAI,OAAO,YAAY,OAAW,eAAc,UAAU,OAAO;AACjE,SAAK,WAAW,IAAI,iBAAiB;AAAA,MACnC,WAAW,IAAI,gBAAgB,aAAa;AAAA,MAC5C,OAAO,OAAO;AAAA,MACd,MAAM,OAAO;AAAA,MACb,MAAM,OAAO,QAAQ;AAAA,IACvB,CAAC;AACD,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,aAAa,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAClD;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,gBAAgB,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACrD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,aAAa,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAClD;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,oBAAoB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EACjE;AAAA,EAEA,WAA2C;AACzC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,qBAAqB,KAAK,MAAM;AAAA,IAC1C,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA8C;AACtD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// src/resource/github/github.ts
|
|
2
|
+
import { mountKey, mountPrefixOf } from "@struktoai/mirage-core";
|
|
2
3
|
import {
|
|
3
4
|
fetchGitHubRepoInfo,
|
|
4
5
|
fetchGitHubTree,
|
|
5
6
|
GITHUB_COMMANDS,
|
|
6
7
|
GITHUB_PROMPT,
|
|
7
|
-
|
|
8
|
+
GITHUB_OPS,
|
|
8
9
|
GitHubAccessor,
|
|
9
10
|
HttpGitHubTransport,
|
|
10
11
|
PathSpec,
|
|
@@ -14,12 +15,17 @@ import {
|
|
|
14
15
|
githubPopulateIndex,
|
|
15
16
|
githubRead,
|
|
16
17
|
githubReaddir,
|
|
17
|
-
|
|
18
|
+
makeResolveGlob,
|
|
18
19
|
githubStat
|
|
19
20
|
} from "@struktoai/mirage-core";
|
|
20
21
|
|
|
21
22
|
// src/resource/github/config.ts
|
|
22
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
normalizeFields,
|
|
25
|
+
redactConfigWithSchema,
|
|
26
|
+
secretStr,
|
|
27
|
+
z
|
|
28
|
+
} from "@struktoai/mirage-core";
|
|
23
29
|
var GitHubConfigSchema = z.object({
|
|
24
30
|
token: secretStr(),
|
|
25
31
|
owner: z.string(),
|
|
@@ -37,9 +43,17 @@ function normalizeGitHubConfig(input) {
|
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
// src/resource/github/github.ts
|
|
46
|
+
var githubResolveGlob = makeResolveGlob(githubReaddir);
|
|
40
47
|
var GitHubResource = class _GitHubResource {
|
|
41
48
|
kind = ResourceName.GITHUB;
|
|
42
49
|
cachesReads = true;
|
|
50
|
+
// The git tree API reports the exact blob size for every file; the
|
|
51
|
+
// blob read returns those same bytes, and submodule gitlinks (which
|
|
52
|
+
// have no size and no blob) are excluded from the tree.
|
|
53
|
+
sizesAlwaysKnown = true;
|
|
54
|
+
// Blob shas are stable per-path markers, so cached reads can be
|
|
55
|
+
// probe-verified under ALWAYS and snapshots carry drift fingerprints.
|
|
56
|
+
supportsSnapshot = true;
|
|
43
57
|
indexTtl = 86400;
|
|
44
58
|
prompt = GITHUB_PROMPT;
|
|
45
59
|
config;
|
|
@@ -81,7 +95,7 @@ var GitHubResource = class _GitHubResource {
|
|
|
81
95
|
return GITHUB_COMMANDS;
|
|
82
96
|
}
|
|
83
97
|
ops() {
|
|
84
|
-
return
|
|
98
|
+
return GITHUB_OPS;
|
|
85
99
|
}
|
|
86
100
|
readFile(p) {
|
|
87
101
|
return githubRead(this.accessor, p, this.index);
|
|
@@ -92,18 +106,14 @@ var GitHubResource = class _GitHubResource {
|
|
|
92
106
|
stat(p) {
|
|
93
107
|
return githubStat(this.accessor, p, this.index);
|
|
94
108
|
}
|
|
95
|
-
async fingerprint(p) {
|
|
96
|
-
const lookup = await this.index.get(p.original);
|
|
97
|
-
return lookup.entry?.id ?? null;
|
|
98
|
-
}
|
|
99
109
|
glob(paths, prefix = "") {
|
|
100
110
|
const effective = prefix !== "" ? paths.map(
|
|
101
|
-
(p) => p.
|
|
102
|
-
|
|
111
|
+
(p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
|
|
112
|
+
virtual: p.virtual,
|
|
103
113
|
directory: p.directory,
|
|
104
114
|
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
105
115
|
resolved: p.resolved,
|
|
106
|
-
prefix
|
|
116
|
+
resourcePath: mountKey(p.virtual, prefix)
|
|
107
117
|
})
|
|
108
118
|
) : paths;
|
|
109
119
|
return githubResolveGlob(this.accessor, effective, this.index);
|
|
@@ -126,4 +136,4 @@ export {
|
|
|
126
136
|
normalizeGitHubConfig,
|
|
127
137
|
GitHubResource
|
|
128
138
|
};
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-2WSKXBSV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 // The git tree API reports the exact blob size for every file; the\n // blob read returns those same bytes, and submodule gitlinks (which\n // have no size and no blob) are excluded from the tree.\n readonly sizesAlwaysKnown: 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 {\n normalizeFields,\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretStr,\n z,\n} from '@struktoai/mirage-core'\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 type GitHubConfig = ConfigOf<typeof GitHubConfigSchema>\n\nexport type GitHubConfigRedacted = RedactedConfig<GitHubConfig, 'token'>\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;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP,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;AAMM,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB,MAAM;AAC1D;AAEO,SAAS,sBAAsB,O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PathSpec,
|
|
4
5
|
POSTGRES_COMMANDS,
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
RAMIndexCacheStore,
|
|
12
13
|
ResourceName,
|
|
13
14
|
resolvePostgresConfig,
|
|
14
|
-
|
|
15
|
+
makeResolveGlob
|
|
15
16
|
} from "@struktoai/mirage-core";
|
|
16
17
|
|
|
17
18
|
// src/resource/postgres/neon_driver.ts
|
|
@@ -34,6 +35,7 @@ var NeonPgDriver = class {
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
// src/resource/postgres/postgres.ts
|
|
38
|
+
var resolvePostgresGlob = makeResolveGlob(postgresReaddir);
|
|
37
39
|
var PostgresResource = class {
|
|
38
40
|
kind = ResourceName.POSTGRES;
|
|
39
41
|
cachesReads = false;
|
|
@@ -74,12 +76,12 @@ var PostgresResource = class {
|
|
|
74
76
|
}
|
|
75
77
|
glob(paths, prefix = "") {
|
|
76
78
|
const effective = prefix !== "" ? paths.map(
|
|
77
|
-
(p) => p.
|
|
78
|
-
|
|
79
|
+
(p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
|
|
80
|
+
virtual: p.virtual,
|
|
79
81
|
directory: p.directory,
|
|
80
82
|
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
81
83
|
resolved: p.resolved,
|
|
82
|
-
prefix
|
|
84
|
+
resourcePath: mountKey(p.virtual, prefix)
|
|
83
85
|
})
|
|
84
86
|
) : paths;
|
|
85
87
|
return resolvePostgresGlob(this.accessor, effective, this.index);
|
|
@@ -90,4 +92,4 @@ export {
|
|
|
90
92
|
NeonPgDriver,
|
|
91
93
|
PostgresResource
|
|
92
94
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-37WKCB2E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/postgres/postgres.ts","../src/resource/postgres/neon_driver.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 type IndexCacheStore,\n PathSpec,\n type PgDriver,\n POSTGRES_COMMANDS,\n POSTGRES_OPS,\n POSTGRES_PROMPT,\n PostgresAccessor,\n type PostgresConfig,\n type PostgresConfigResolved,\n postgresRead,\n postgresReaddir,\n postgresStat,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolvePostgresConfig,\n makeResolveGlob,\n} from '@struktoai/mirage-core'\nimport { NeonPgDriver } from './neon_driver.ts'\n\nconst resolvePostgresGlob = makeResolveGlob(postgresReaddir)\n\nexport interface PostgresResourceOptions {\n config: PostgresConfig\n prefix?: string\n driver?: PgDriver\n}\n\nexport class PostgresResource implements Resource {\n readonly kind: string = ResourceName.POSTGRES\n readonly cachesReads: boolean = false\n readonly indexTtl: number = 0\n readonly prompt: string\n readonly config: PostgresConfigResolved\n readonly driver: PgDriver\n readonly accessor: PostgresAccessor\n readonly index: IndexCacheStore\n\n constructor(options: PostgresResourceOptions | PostgresConfig) {\n const { config, prefix, driver } =\n 'config' in options ? options : { config: options, prefix: undefined, driver: undefined }\n this.config = resolvePostgresConfig(config)\n this.driver = driver ?? new NeonPgDriver(this.config.dsn)\n this.accessor = new PostgresAccessor(this.driver, this.config)\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n this.prompt = POSTGRES_PROMPT.replace('{prefix}', prefix ?? '')\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n async close(): Promise<void> {\n await this.driver.close()\n }\n\n ops(): readonly RegisteredOp[] {\n return POSTGRES_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return POSTGRES_COMMANDS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return postgresRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return postgresReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return postgresStat(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 resolvePostgresGlob(this.accessor, effective, this.index)\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 { neon, type NeonQueryFunction } from '@neondatabase/serverless'\nimport type { PgDriver, PgQueryResult } from '@struktoai/mirage-core'\n\ninterface FullResultsRow<R> {\n rows: R[]\n rowCount: number | null\n}\n\nexport class NeonPgDriver implements PgDriver {\n private readonly sql: NeonQueryFunction<false, true>\n\n constructor(dsn: string) {\n this.sql = neon(dsn, { fullResults: true })\n }\n\n async query<R = Record<string, unknown>>(\n text: string,\n params?: readonly unknown[],\n ): Promise<PgQueryResult<R>> {\n const result = (await this.sql.query(\n text,\n params as unknown[] | undefined,\n )) as unknown as FullResultsRow<R>\n return { rows: result.rows, rowCount: result.rowCount ?? result.rows.length }\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAGE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACtBP,SAAS,YAAoC;AAQtC,IAAM,eAAN,MAAuC;AAAA,EAC3B;AAAA,EAEjB,YAAY,KAAa;AACvB,SAAK,MAAM,KAAK,KAAK,EAAE,aAAa,KAAK,CAAC;AAAA,EAC5C;AAAA,EAEA,MAAM,MACJ,MACA,QAC2B;AAC3B,UAAM,SAAU,MAAM,KAAK,IAAI;AAAA,MAC7B;AAAA,MACA;AAAA,IACF;AACA,WAAO,EAAE,MAAM,OAAO,MAAM,UAAU,OAAO,YAAY,OAAO,KAAK,OAAO;AAAA,EAC9E;AAAA,EAEA,QAAuB;AACrB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;;;ADJA,IAAM,sBAAsB,gBAAgB,eAAe;AAQpD,IAAM,mBAAN,MAA2C;AAAA,EACvC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAAmD;AAC7D,UAAM,EAAE,QAAQ,QAAQ,OAAO,IAC7B,YAAY,UAAU,UAAU,EAAE,QAAQ,SAAS,QAAQ,QAAW,QAAQ,OAAU;AAC1F,SAAK,SAAS,sBAAsB,MAAM;AAC1C,SAAK,SAAS,UAAU,IAAI,aAAa,KAAK,OAAO,GAAG;AACxD,SAAK,WAAW,IAAI,iBAAiB,KAAK,QAAQ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
6
6
|
import {
|
|
@@ -10,7 +10,11 @@ import {
|
|
|
10
10
|
} from "@struktoai/mirage-core";
|
|
11
11
|
|
|
12
12
|
// src/resource/supabase/config.ts
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
redactConfigWithSchema,
|
|
15
|
+
secretSchema,
|
|
16
|
+
z
|
|
17
|
+
} from "@struktoai/mirage-core";
|
|
14
18
|
var SupabaseConfigSchema = z.object({
|
|
15
19
|
bucket: z.string(),
|
|
16
20
|
presignedUrlProvider: secretSchema(
|
|
@@ -19,7 +23,8 @@ var SupabaseConfigSchema = z.object({
|
|
|
19
23
|
projectRef: z.string().optional(),
|
|
20
24
|
region: z.string().optional(),
|
|
21
25
|
endpoint: z.string().optional(),
|
|
22
|
-
defaultContentType: z.string().optional()
|
|
26
|
+
defaultContentType: z.string().optional(),
|
|
27
|
+
keyPrefix: z.string().optional()
|
|
23
28
|
});
|
|
24
29
|
function resolvedSupabaseEndpoint(config) {
|
|
25
30
|
if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
|
|
@@ -36,7 +41,8 @@ function supabaseToS3Config(config) {
|
|
|
36
41
|
...config.region !== void 0 ? { region: config.region } : {},
|
|
37
42
|
...endpoint !== void 0 ? { endpoint } : {},
|
|
38
43
|
forcePathStyle: true,
|
|
39
|
-
...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
|
|
44
|
+
...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
|
|
45
|
+
...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
48
|
function redactSupabaseConfig(config) {
|
|
@@ -87,4 +93,4 @@ export {
|
|
|
87
93
|
SUPABASE_BROWSER_PROMPT,
|
|
88
94
|
SupabaseResource
|
|
89
95
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-3IYCVC7W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\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 type SupabaseConfig = ConfigOf<typeof SupabaseConfigSchema>\n\nexport type SupabaseConfigRedacted = RedactedConfig<SupabaseConfig, 'presignedUrlProvider'>\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;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,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;AAC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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,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
S3Resource
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BGA2F226.js";
|
|
4
4
|
|
|
5
5
|
// src/resource/backblaze/backblaze.ts
|
|
6
6
|
import {
|
|
@@ -10,7 +10,11 @@ import {
|
|
|
10
10
|
} from "@struktoai/mirage-core";
|
|
11
11
|
|
|
12
12
|
// src/resource/backblaze/config.ts
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
redactConfigWithSchema,
|
|
15
|
+
secretSchema,
|
|
16
|
+
z
|
|
17
|
+
} from "@struktoai/mirage-core";
|
|
14
18
|
var BackblazeConfigSchema = z.object({
|
|
15
19
|
bucket: z.string(),
|
|
16
20
|
presignedUrlProvider: secretSchema(
|
|
@@ -18,7 +22,8 @@ var BackblazeConfigSchema = z.object({
|
|
|
18
22
|
),
|
|
19
23
|
region: z.string().optional(),
|
|
20
24
|
endpoint: z.string().optional(),
|
|
21
|
-
defaultContentType: z.string().optional()
|
|
25
|
+
defaultContentType: z.string().optional(),
|
|
26
|
+
keyPrefix: z.string().optional()
|
|
22
27
|
});
|
|
23
28
|
function resolvedBackblazeEndpoint(config) {
|
|
24
29
|
if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
|
|
@@ -35,7 +40,8 @@ function backblazeToS3Config(config) {
|
|
|
35
40
|
presignedUrlProvider: config.presignedUrlProvider,
|
|
36
41
|
...config.region !== void 0 ? { region: config.region } : {},
|
|
37
42
|
...endpoint !== void 0 ? { endpoint } : {},
|
|
38
|
-
...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {}
|
|
43
|
+
...config.defaultContentType !== void 0 ? { defaultContentType: config.defaultContentType } : {},
|
|
44
|
+
...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {}
|
|
39
45
|
};
|
|
40
46
|
}
|
|
41
47
|
function redactBackblazeConfig(config) {
|
|
@@ -86,4 +92,4 @@ export {
|
|
|
86
92
|
BACKBLAZE_BROWSER_PROMPT,
|
|
87
93
|
BackblazeResource
|
|
88
94
|
};
|
|
89
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-46HNNKFR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretSchema,\n z,\n} from '@struktoai/mirage-core'\nimport type { S3BrowserPresignedUrlProvider, S3Config } from '../s3/config.ts'\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 type BackblazeConfig = ConfigOf<typeof BackblazeConfigSchema>\n\nexport type BackblazeConfigRedacted = RedactedConfig<BackblazeConfig, 'presignedUrlProvider'>\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;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,wBAAwB,EAAE,OAAO;AAAA,EACrC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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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/gslides/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\nexport {\n normalizeGoogleConfig as normalizeGSlidesConfig,\n redactGoogleConfig as redactGSlidesConfig,\n type GoogleConfig as GSlidesConfig,\n type GoogleConfigRedacted as GSlidesConfigRedacted,\n} from '@struktoai/mirage-core'\n"],"mappings":";AAcA;AAAA,EAC2B;AAAA,EACH;AAAA,OAGjB;","names":[]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// src/resource/trello/trello.ts
|
|
2
|
+
import { mountKey, mountPrefixOf } from "@struktoai/mirage-core";
|
|
2
3
|
import {
|
|
3
4
|
HttpTrelloTransport,
|
|
4
5
|
PathSpec,
|
|
5
6
|
RAMIndexCacheStore,
|
|
6
7
|
ResourceName,
|
|
7
|
-
|
|
8
|
+
makeResolveGlob,
|
|
8
9
|
TRELLO_COMMANDS,
|
|
9
10
|
TRELLO_PROMPT,
|
|
10
|
-
|
|
11
|
+
TRELLO_OPS,
|
|
11
12
|
TRELLO_WRITE_PROMPT,
|
|
12
13
|
TrelloAccessor,
|
|
13
14
|
trelloRead,
|
|
@@ -16,12 +17,16 @@ import {
|
|
|
16
17
|
} from "@struktoai/mirage-core";
|
|
17
18
|
|
|
18
19
|
// src/resource/trello/config.ts
|
|
19
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
redactConfigWithSchema,
|
|
22
|
+
secretStr,
|
|
23
|
+
z
|
|
24
|
+
} from "@struktoai/mirage-core";
|
|
20
25
|
var TrelloConfigSchema = z.object({
|
|
21
26
|
apiKey: secretStr(),
|
|
22
27
|
apiToken: secretStr(),
|
|
23
28
|
workspaceId: z.string().optional(),
|
|
24
|
-
boardIds: z.array(z.string()).optional(),
|
|
29
|
+
boardIds: z.array(z.string()).readonly().optional(),
|
|
25
30
|
baseUrl: z.string().optional()
|
|
26
31
|
});
|
|
27
32
|
function redactTrelloConfig(config) {
|
|
@@ -29,6 +34,9 @@ function redactTrelloConfig(config) {
|
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
// src/resource/trello/trello.ts
|
|
37
|
+
var resolveTrelloGlob = (accessor, paths, index, filter) => makeResolveGlob(
|
|
38
|
+
(a, p, i) => trelloReaddir(a, p, i, filter)
|
|
39
|
+
)(accessor, paths, index);
|
|
32
40
|
var TrelloResource = class {
|
|
33
41
|
kind = ResourceName.TRELLO;
|
|
34
42
|
cachesReads = true;
|
|
@@ -58,7 +66,7 @@ var TrelloResource = class {
|
|
|
58
66
|
return TRELLO_COMMANDS;
|
|
59
67
|
}
|
|
60
68
|
ops() {
|
|
61
|
-
return
|
|
69
|
+
return TRELLO_OPS;
|
|
62
70
|
}
|
|
63
71
|
filter() {
|
|
64
72
|
const out = {};
|
|
@@ -75,18 +83,14 @@ var TrelloResource = class {
|
|
|
75
83
|
stat(p) {
|
|
76
84
|
return trelloStat(this.accessor, p, this.index);
|
|
77
85
|
}
|
|
78
|
-
async fingerprint(p) {
|
|
79
|
-
const lookup = await this.index.get(p.original);
|
|
80
|
-
return lookup.entry?.remoteTime ?? null;
|
|
81
|
-
}
|
|
82
86
|
glob(paths, prefix = "") {
|
|
83
87
|
const effective = prefix !== "" ? paths.map(
|
|
84
|
-
(p) => p.
|
|
85
|
-
|
|
88
|
+
(p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
|
|
89
|
+
virtual: p.virtual,
|
|
86
90
|
directory: p.directory,
|
|
87
91
|
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
88
92
|
resolved: p.resolved,
|
|
89
|
-
prefix
|
|
93
|
+
resourcePath: mountKey(p.virtual, prefix)
|
|
90
94
|
})
|
|
91
95
|
) : paths;
|
|
92
96
|
return resolveTrelloGlob(this.accessor, effective, this.index, this.filter());
|
|
@@ -106,4 +110,4 @@ export {
|
|
|
106
110
|
redactTrelloConfig,
|
|
107
111
|
TrelloResource
|
|
108
112
|
};
|
|
109
|
-
//# sourceMappingURL=chunk-
|
|
113
|
+
//# sourceMappingURL=chunk-5OZJMTYW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/trello/trello.ts","../src/resource/trello/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 HttpTrelloTransport,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n makeResolveGlob,\n TRELLO_COMMANDS,\n TRELLO_PROMPT,\n TRELLO_OPS,\n TRELLO_WRITE_PROMPT,\n TrelloAccessor,\n type TrelloReaddirFilter,\n trelloRead,\n trelloReaddir,\n trelloStat,\n} from '@struktoai/mirage-core'\nimport { redactTrelloConfig, type TrelloConfig, type TrelloConfigRedacted } from './config.ts'\n\nconst resolveTrelloGlob = (\n accessor: TrelloAccessor,\n paths: readonly PathSpec[],\n index: IndexCacheStore | undefined,\n filter: TrelloReaddirFilter,\n): Promise<PathSpec[]> =>\n makeResolveGlob((a: TrelloAccessor, p: PathSpec, i?: IndexCacheStore) =>\n trelloReaddir(a, p, i, filter),\n )(accessor, paths, index)\n\nexport interface TrelloResourceState {\n type: string\n config: TrelloConfigRedacted\n}\n\nexport class TrelloResource implements Resource {\n readonly kind: string = ResourceName.TRELLO\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = TRELLO_PROMPT\n readonly writePrompt: string = TRELLO_WRITE_PROMPT\n readonly config: TrelloConfig\n readonly accessor: TrelloAccessor\n readonly index: IndexCacheStore\n\n constructor(config: TrelloConfig) {\n this.config = config\n const transportOpts: { apiKey: string; apiToken: string; baseUrl?: string } = {\n apiKey: config.apiKey,\n apiToken: config.apiToken,\n }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n this.accessor = new TrelloAccessor(new HttpTrelloTransport(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 TRELLO_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return TRELLO_OPS\n }\n\n private filter(): TrelloReaddirFilter {\n const out: TrelloReaddirFilter = {}\n if (this.config.workspaceId !== undefined) out.workspaceId = this.config.workspaceId\n if (this.config.boardIds !== undefined) out.boardIds = this.config.boardIds\n return out\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return trelloRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return trelloReaddir(this.accessor, p, this.index, this.filter())\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return trelloStat(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 resolveTrelloGlob(this.accessor, effective, this.index, this.filter())\n }\n\n getState(): Promise<TrelloResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactTrelloConfig(this.config),\n })\n }\n\n loadState(_state: TrelloResourceState): 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 {\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretStr,\n z,\n} from '@struktoai/mirage-core'\n\nconst TrelloConfigSchema = z.object({\n apiKey: secretStr(),\n apiToken: secretStr(),\n workspaceId: z.string().optional(),\n boardIds: z.array(z.string()).readonly().optional(),\n baseUrl: z.string().optional(),\n})\n\nexport type TrelloConfig = ConfigOf<typeof TrelloConfigSchema>\n\nexport type TrelloConfigRedacted = RedactedConfig<TrelloConfig, 'apiKey' | 'apiToken'>\n\nexport function redactTrelloConfig(config: TrelloConfig): TrelloConfigRedacted {\n return redactConfigWithSchema(TrelloConfigSchema, config) as unknown as TrelloConfigRedacted\n}\n"],"mappings":";AAcA,SAAS,UAAU,qBAAqB;AACxC;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACrBP;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,QAAQ,UAAU;AAAA,EAClB,UAAU,UAAU;AAAA,EACpB,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAMM,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB,MAAM;AAC1D;;;ADEA,IAAM,oBAAoB,CACxB,UACA,OACA,OACA,WAEA;AAAA,EAAgB,CAAC,GAAmB,GAAa,MAC/C,cAAc,GAAG,GAAG,GAAG,MAAM;AAC/B,EAAE,UAAU,OAAO,KAAK;AAOnB,IAAM,iBAAN,MAAyC;AAAA,EACrC,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,SAAK,SAAS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