@struktoai/mirage-browser 0.0.1-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.
Files changed (129) hide show
  1. package/README.md +230 -0
  2. package/dist/box-Y2SJWAAO.js +8 -0
  3. package/dist/box-Y2SJWAAO.js.map +1 -0
  4. package/dist/chunk-27UVUTJH.js +126 -0
  5. package/dist/chunk-27UVUTJH.js.map +1 -0
  6. package/dist/chunk-33SBWNB4.js +103 -0
  7. package/dist/chunk-33SBWNB4.js.map +1 -0
  8. package/dist/chunk-3PWPFOPS.js +88 -0
  9. package/dist/chunk-3PWPFOPS.js.map +1 -0
  10. package/dist/chunk-5Q5GJUAF.js +88 -0
  11. package/dist/chunk-5Q5GJUAF.js.map +1 -0
  12. package/dist/chunk-7GZXXXAS.js +24 -0
  13. package/dist/chunk-7GZXXXAS.js.map +1 -0
  14. package/dist/chunk-B4SYG2FD.js +24 -0
  15. package/dist/chunk-B4SYG2FD.js.map +1 -0
  16. package/dist/chunk-BIZONEJC.js +24 -0
  17. package/dist/chunk-BIZONEJC.js.map +1 -0
  18. package/dist/chunk-CQJTW45B.js +92 -0
  19. package/dist/chunk-CQJTW45B.js.map +1 -0
  20. package/dist/chunk-CZOTICOC.js +93 -0
  21. package/dist/chunk-CZOTICOC.js.map +1 -0
  22. package/dist/chunk-DDM2Z7YA.js +94 -0
  23. package/dist/chunk-DDM2Z7YA.js.map +1 -0
  24. package/dist/chunk-DPC7QRYO.js +99 -0
  25. package/dist/chunk-DPC7QRYO.js.map +1 -0
  26. package/dist/chunk-FL7YLP7D.js +107 -0
  27. package/dist/chunk-FL7YLP7D.js.map +1 -0
  28. package/dist/chunk-GFWWDQUZ.js +24 -0
  29. package/dist/chunk-GFWWDQUZ.js.map +1 -0
  30. package/dist/chunk-LG6GVNOL.js +94 -0
  31. package/dist/chunk-LG6GVNOL.js.map +1 -0
  32. package/dist/chunk-LSSB3AEW.js +94 -0
  33. package/dist/chunk-LSSB3AEW.js.map +1 -0
  34. package/dist/chunk-LUDXUYIA.js +89 -0
  35. package/dist/chunk-LUDXUYIA.js.map +1 -0
  36. package/dist/chunk-LZRPA2P7.js +99 -0
  37. package/dist/chunk-LZRPA2P7.js.map +1 -0
  38. package/dist/chunk-ML57VOCK.js +7590 -0
  39. package/dist/chunk-ML57VOCK.js.map +1 -0
  40. package/dist/chunk-MSNVGH6T.js +92 -0
  41. package/dist/chunk-MSNVGH6T.js.map +1 -0
  42. package/dist/chunk-NBWTZXH2.js +27 -0
  43. package/dist/chunk-NBWTZXH2.js.map +1 -0
  44. package/dist/chunk-ONQ5JGPR.js +96 -0
  45. package/dist/chunk-ONQ5JGPR.js.map +1 -0
  46. package/dist/chunk-OPROOV6J.js +24 -0
  47. package/dist/chunk-OPROOV6J.js.map +1 -0
  48. package/dist/chunk-QARIHW3I.js +23 -0
  49. package/dist/chunk-QARIHW3I.js.map +1 -0
  50. package/dist/chunk-QYFCHCGX.js +144 -0
  51. package/dist/chunk-QYFCHCGX.js.map +1 -0
  52. package/dist/chunk-SQQI4A6Y.js +94 -0
  53. package/dist/chunk-SQQI4A6Y.js.map +1 -0
  54. package/dist/chunk-UFXEZ56G.js +79 -0
  55. package/dist/chunk-UFXEZ56G.js.map +1 -0
  56. package/dist/chunk-UW3D2AF6.js +94 -0
  57. package/dist/chunk-UW3D2AF6.js.map +1 -0
  58. package/dist/chunk-UZWJ462U.js +93 -0
  59. package/dist/chunk-UZWJ462U.js.map +1 -0
  60. package/dist/chunk-VLFE4FGD.js +178 -0
  61. package/dist/chunk-VLFE4FGD.js.map +1 -0
  62. package/dist/chunk-XIURBEVZ.js +24 -0
  63. package/dist/chunk-XIURBEVZ.js.map +1 -0
  64. package/dist/chunk-ZJ6ROCTP.js +114 -0
  65. package/dist/chunk-ZJ6ROCTP.js.map +1 -0
  66. package/dist/config-4FABMWVK.js +9 -0
  67. package/dist/config-4FABMWVK.js.map +1 -0
  68. package/dist/config-DGIUMGBB.js +9 -0
  69. package/dist/config-DGIUMGBB.js.map +1 -0
  70. package/dist/config-G3TTNXLY.js +9 -0
  71. package/dist/config-G3TTNXLY.js.map +1 -0
  72. package/dist/config-GPCEEKCB.js +9 -0
  73. package/dist/config-GPCEEKCB.js.map +1 -0
  74. package/dist/config-KQ5VR2KZ.js +9 -0
  75. package/dist/config-KQ5VR2KZ.js.map +1 -0
  76. package/dist/config-LPMMVXLS.js +9 -0
  77. package/dist/config-LPMMVXLS.js.map +1 -0
  78. package/dist/config-U4UI4OKA.js +9 -0
  79. package/dist/config-U4UI4OKA.js.map +1 -0
  80. package/dist/config-VZGK63Z5.js +9 -0
  81. package/dist/config-VZGK63Z5.js.map +1 -0
  82. package/dist/discord-RG6URXXS.js +7 -0
  83. package/dist/discord-RG6URXXS.js.map +1 -0
  84. package/dist/dropbox-P7SOL7GN.js +8 -0
  85. package/dist/dropbox-P7SOL7GN.js.map +1 -0
  86. package/dist/gcs-2QHB4CBT.js +8 -0
  87. package/dist/gcs-2QHB4CBT.js.map +1 -0
  88. package/dist/gdocs-JNZTOZ33.js +8 -0
  89. package/dist/gdocs-JNZTOZ33.js.map +1 -0
  90. package/dist/gdrive-6MEIVN2F.js +8 -0
  91. package/dist/gdrive-6MEIVN2F.js.map +1 -0
  92. package/dist/github-M7WODJR2.js +7 -0
  93. package/dist/github-M7WODJR2.js.map +1 -0
  94. package/dist/github_ci-4XELEFSZ.js +8 -0
  95. package/dist/github_ci-4XELEFSZ.js.map +1 -0
  96. package/dist/gmail-AO6A3URH.js +8 -0
  97. package/dist/gmail-AO6A3URH.js.map +1 -0
  98. package/dist/gsheets-RFOKXMOJ.js +8 -0
  99. package/dist/gsheets-RFOKXMOJ.js.map +1 -0
  100. package/dist/gslides-GTVZPLLB.js +8 -0
  101. package/dist/gslides-GTVZPLLB.js.map +1 -0
  102. package/dist/index.d.ts +1127 -0
  103. package/dist/index.js +743 -0
  104. package/dist/index.js.map +1 -0
  105. package/dist/langfuse-CDOLELMB.js +7 -0
  106. package/dist/langfuse-CDOLELMB.js.map +1 -0
  107. package/dist/linear-SXOQGG6B.js +7 -0
  108. package/dist/linear-SXOQGG6B.js.map +1 -0
  109. package/dist/mongodb-HA7FAKDJ.js +7 -0
  110. package/dist/mongodb-HA7FAKDJ.js.map +1 -0
  111. package/dist/notion-ANZNMM3L.js +7 -0
  112. package/dist/notion-ANZNMM3L.js.map +1 -0
  113. package/dist/oci-ML5ZRVZ2.js +8 -0
  114. package/dist/oci-ML5ZRVZ2.js.map +1 -0
  115. package/dist/opfs-57XFMWWE.js +7 -0
  116. package/dist/opfs-57XFMWWE.js.map +1 -0
  117. package/dist/postgres-CK4HWZSL.js +7 -0
  118. package/dist/postgres-CK4HWZSL.js.map +1 -0
  119. package/dist/r2-56O4Q2J4.js +8 -0
  120. package/dist/r2-56O4Q2J4.js.map +1 -0
  121. package/dist/s3-A4XFE6QV.js +9 -0
  122. package/dist/s3-A4XFE6QV.js.map +1 -0
  123. package/dist/slack-QA7H7WLM.js +7 -0
  124. package/dist/slack-QA7H7WLM.js.map +1 -0
  125. package/dist/supabase-NNK2RWG3.js +8 -0
  126. package/dist/supabase-NNK2RWG3.js.map +1 -0
  127. package/dist/trello-H6PZT2IT.js +7 -0
  128. package/dist/trello-H6PZT2IT.js.map +1 -0
  129. package/package.json +74 -0
@@ -0,0 +1,92 @@
1
+ import {
2
+ redactGDriveConfig
3
+ } from "./chunk-XIURBEVZ.js";
4
+
5
+ // src/resource/gdrive/gdrive.ts
6
+ import {
7
+ GDRIVE_COMMANDS,
8
+ GDRIVE_PROMPT,
9
+ GDRIVE_VFS_OPS,
10
+ GDriveAccessor,
11
+ PathSpec,
12
+ RAMIndexCacheStore,
13
+ ResourceName,
14
+ TokenManager,
15
+ gdriveRead,
16
+ gdriveReaddir,
17
+ gdriveResolveGlob,
18
+ gdriveStat
19
+ } from "@struktoai/mirage-core";
20
+ var GDriveResource = class {
21
+ kind = ResourceName.GDRIVE;
22
+ isRemote = true;
23
+ indexTtl = 86400;
24
+ prompt = GDRIVE_PROMPT;
25
+ config;
26
+ accessor;
27
+ index;
28
+ constructor(config) {
29
+ this.config = config;
30
+ const tm = new TokenManager({
31
+ clientId: config.clientId,
32
+ ...config.clientSecret !== void 0 ? { clientSecret: config.clientSecret } : {},
33
+ refreshToken: config.refreshToken,
34
+ ...config.refreshFn !== void 0 ? { refreshFn: config.refreshFn } : {}
35
+ });
36
+ this.accessor = new GDriveAccessor({ tokenManager: tm });
37
+ this.index = new RAMIndexCacheStore({ ttl: 86400 });
38
+ }
39
+ open() {
40
+ return Promise.resolve();
41
+ }
42
+ close() {
43
+ return Promise.resolve();
44
+ }
45
+ commands() {
46
+ return GDRIVE_COMMANDS;
47
+ }
48
+ ops() {
49
+ return GDRIVE_VFS_OPS;
50
+ }
51
+ readFile(p) {
52
+ return gdriveRead(this.accessor, p, this.index);
53
+ }
54
+ readdir(p) {
55
+ return gdriveReaddir(this.accessor, p, this.index);
56
+ }
57
+ stat(p) {
58
+ return gdriveStat(this.accessor, p, this.index);
59
+ }
60
+ async fingerprint(p) {
61
+ const lookup = await this.index.get(p.original);
62
+ return lookup.entry?.remoteTime ?? null;
63
+ }
64
+ glob(paths, prefix = "") {
65
+ const effective = prefix !== "" ? paths.map(
66
+ (p) => p.prefix !== "" ? p : new PathSpec({
67
+ original: p.original,
68
+ directory: p.directory,
69
+ ...p.pattern !== null ? { pattern: p.pattern } : {},
70
+ resolved: p.resolved,
71
+ prefix
72
+ })
73
+ ) : paths;
74
+ return gdriveResolveGlob(this.accessor, effective, this.index);
75
+ }
76
+ getState() {
77
+ return Promise.resolve({
78
+ type: this.kind,
79
+ needsOverride: true,
80
+ redactedFields: ["clientSecret", "refreshToken"],
81
+ config: redactGDriveConfig(this.config)
82
+ });
83
+ }
84
+ loadState(_state) {
85
+ return Promise.resolve();
86
+ }
87
+ };
88
+
89
+ export {
90
+ GDriveResource
91
+ };
92
+ //# sourceMappingURL=chunk-MSNVGH6T.js.map
@@ -0,0 +1 @@
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 {\n type FileStat,\n GDRIVE_COMMANDS,\n GDRIVE_PROMPT,\n GDRIVE_VFS_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 gdriveResolveGlob,\n gdriveStat,\n} from '@struktoai/mirage-core'\nimport { redactGDriveConfig, type GDriveConfig, type GDriveConfigRedacted } from './config.ts'\n\nexport interface GDriveResourceState {\n type: string\n needsOverride: boolean\n redactedFields: readonly string[]\n config: GDriveConfigRedacted\n}\n\nexport class GDriveResource implements Resource {\n readonly kind: string = ResourceName.GDRIVE\n readonly isRemote: 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 })\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_VFS_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 async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n 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 needsOverride: true,\n redactedFields: ['clientSecret', 'refreshToken'],\n config: redactGDriveConfig(this.config),\n })\n }\n\n loadState(_state: GDriveResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;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;AAUA,IAAM,iBAAN,MAAyC;AAAA,EACrC,OAAe,aAAa;AAAA,EAC5B,WAAoB;AAAA,EACpB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa;AAAA,MAC1B,UAAU,OAAO;AAAA,MACjB,GAAI,OAA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W,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,eAAe;AAAA,MACf,gBAAgB,CAAC,gBAAgB,cAAc;AAAA,MAC/C,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -0,0 +1,27 @@
1
+ // src/resource/box/config.ts
2
+ import { normalizeFields } from "@struktoai/mirage-core";
3
+ function redactBoxConfig(config) {
4
+ const out = {};
5
+ if (config.clientId !== void 0) out.clientId = config.clientId;
6
+ if (config.clientSecret !== void 0) out.clientSecret = "<REDACTED>";
7
+ if (config.refreshToken !== void 0) out.refreshToken = "<REDACTED>";
8
+ if (config.accessToken !== void 0) out.accessToken = "<REDACTED>";
9
+ return out;
10
+ }
11
+ function normalizeBoxConfig(input) {
12
+ return normalizeFields(input, {
13
+ rename: {
14
+ client_id: "clientId",
15
+ client_secret: "clientSecret",
16
+ refresh_token: "refreshToken",
17
+ access_token: "accessToken",
18
+ developer_token: "accessToken"
19
+ }
20
+ });
21
+ }
22
+
23
+ export {
24
+ redactBoxConfig,
25
+ normalizeBoxConfig
26
+ };
27
+ //# sourceMappingURL=chunk-NBWTZXH2.js.map
@@ -0,0 +1 @@
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 } from '@struktoai/mirage-core'\n\nexport interface BoxConfig {\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 clientId?: string\n clientSecret?: '<REDACTED>'\n refreshToken?: '<REDACTED>'\n accessToken?: '<REDACTED>'\n}\n\nexport function redactBoxConfig(config: BoxConfig): BoxConfigRedacted {\n const out: BoxConfigRedacted = {}\n if (config.clientId !== undefined) out.clientId = config.clientId\n if (config.clientSecret !== undefined) out.clientSecret = '<REDACTED>'\n if (config.refreshToken !== undefined) out.refreshToken = '<REDACTED>'\n if (config.accessToken !== undefined) out.accessToken = '<REDACTED>'\n return out\n}\n\nexport function normalizeBoxConfig(input: Record<string, unknown>): BoxConfig {\n return normalizeFields(input, {\n rename: {\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,uBAAuB;AAoBzB,SAAS,gBAAgB,QAAsC;AACpE,QAAM,MAAyB,CAAC;AAChC,MAAI,OAAO,aAAa,OAAW,KAAI,WAAW,OAAO;AACzD,MAAI,OAAO,iBAAiB,OAAW,KAAI,eAAe;AAC1D,MAAI,OAAO,iBAAiB,OAAW,KAAI,eAAe;AAC1D,MAAI,OAAO,gBAAgB,OAAW,KAAI,cAAc;AACxD,SAAO;AACT;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -0,0 +1,96 @@
1
+ // src/resource/notion/notion.ts
2
+ import {
3
+ MCPNotionTransport,
4
+ NOTION_COMMANDS,
5
+ NOTION_PROMPT,
6
+ NOTION_VFS_OPS,
7
+ NOTION_WRITE_PROMPT,
8
+ NotionAccessor,
9
+ notionRead,
10
+ notionReaddir,
11
+ notionStat,
12
+ PathSpec,
13
+ RAMIndexCacheStore,
14
+ ResourceName,
15
+ resolveNotionGlob
16
+ } from "@struktoai/mirage-core";
17
+
18
+ // src/resource/notion/config.ts
19
+ function redactNotionConfig(config) {
20
+ const out = { authProvider: "<REDACTED>" };
21
+ if (config.serverUrl !== void 0) out.serverUrl = config.serverUrl;
22
+ return out;
23
+ }
24
+
25
+ // src/resource/notion/notion.ts
26
+ var NotionResource = class {
27
+ kind = ResourceName.NOTION;
28
+ isRemote = true;
29
+ indexTtl = 600;
30
+ prompt = NOTION_PROMPT;
31
+ writePrompt = NOTION_WRITE_PROMPT;
32
+ config;
33
+ accessor;
34
+ index;
35
+ constructor(config) {
36
+ this.config = config;
37
+ const opts = { authProvider: config.authProvider };
38
+ if (config.serverUrl !== void 0) opts.serverUrl = config.serverUrl;
39
+ this.accessor = new NotionAccessor(new MCPNotionTransport(opts));
40
+ this.index = new RAMIndexCacheStore({ ttl: this.indexTtl });
41
+ }
42
+ open() {
43
+ return Promise.resolve();
44
+ }
45
+ close() {
46
+ return Promise.resolve();
47
+ }
48
+ commands() {
49
+ return NOTION_COMMANDS;
50
+ }
51
+ ops() {
52
+ return NOTION_VFS_OPS;
53
+ }
54
+ readFile(p) {
55
+ return notionRead(this.accessor, p, this.index);
56
+ }
57
+ readdir(p) {
58
+ return notionReaddir(this.accessor, p, this.index);
59
+ }
60
+ stat(p) {
61
+ return notionStat(this.accessor, p, this.index);
62
+ }
63
+ async fingerprint(p) {
64
+ const lookup = await this.index.get(p.original);
65
+ return lookup.entry?.remoteTime ?? null;
66
+ }
67
+ glob(paths, prefix = "") {
68
+ const effective = prefix !== "" ? paths.map(
69
+ (p) => p.prefix !== "" ? p : new PathSpec({
70
+ original: p.original,
71
+ directory: p.directory,
72
+ ...p.pattern !== null ? { pattern: p.pattern } : {},
73
+ resolved: p.resolved,
74
+ prefix
75
+ })
76
+ ) : paths;
77
+ return resolveNotionGlob(this.accessor, effective, this.index);
78
+ }
79
+ getState() {
80
+ return Promise.resolve({
81
+ type: this.kind,
82
+ needsOverride: true,
83
+ redactedFields: ["authProvider"],
84
+ config: redactNotionConfig(this.config)
85
+ });
86
+ }
87
+ loadState(_state) {
88
+ return Promise.resolve();
89
+ }
90
+ };
91
+
92
+ export {
93
+ redactNotionConfig,
94
+ NotionResource
95
+ };
96
+ //# sourceMappingURL=chunk-ONQ5JGPR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/notion/notion.ts","../src/resource/notion/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 type FileStat,\n type IndexCacheStore,\n MCPNotionTransport,\n type MCPNotionTransportOptions,\n NOTION_COMMANDS,\n NOTION_PROMPT,\n NOTION_VFS_OPS,\n NOTION_WRITE_PROMPT,\n NotionAccessor,\n notionRead,\n notionReaddir,\n notionStat,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveNotionGlob,\n} from '@struktoai/mirage-core'\nimport { redactNotionConfig, type NotionConfig, type NotionConfigRedacted } from './config.ts'\n\nexport interface NotionResourceState {\n type: string\n needsOverride: boolean\n redactedFields: readonly string[]\n config: NotionConfigRedacted\n}\n\nexport class NotionResource implements Resource {\n readonly kind: string = ResourceName.NOTION\n readonly isRemote: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = NOTION_PROMPT\n readonly writePrompt: string = NOTION_WRITE_PROMPT\n readonly config: NotionConfig\n readonly accessor: NotionAccessor\n readonly index: IndexCacheStore\n\n constructor(config: NotionConfig) {\n this.config = config\n const opts: MCPNotionTransportOptions = { authProvider: config.authProvider }\n if (config.serverUrl !== undefined) opts.serverUrl = config.serverUrl\n this.accessor = new NotionAccessor(new MCPNotionTransport(opts))\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 NOTION_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return NOTION_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return notionRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return notionReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return notionStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveNotionGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<NotionResourceState> {\n return Promise.resolve({\n type: this.kind,\n needsOverride: true,\n redactedFields: ['authProvider'],\n config: redactNotionConfig(this.config),\n })\n }\n\n loadState(_state: NotionResourceState): 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 type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js'\n\nexport interface NotionConfig {\n authProvider: OAuthClientProvider\n serverUrl?: string\n}\n\nexport interface NotionConfigRedacted {\n authProvider: '<REDACTED>'\n serverUrl?: string\n}\n\nexport function redactNotionConfig(config: NotionConfig): NotionConfigRedacted {\n const out: NotionConfigRedacted = { authProvider: '<REDACTED>' }\n if (config.serverUrl !== undefined) out.serverUrl = config.serverUrl\n return out\n}\n"],"mappings":";AAcA;AAAA,EAGE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,OACK;;;ACRA,SAAS,mBAAmB,QAA4C;AAC7E,QAAM,MAA4B,EAAE,cAAc,aAAa;AAC/D,MAAI,OAAO,cAAc,OAAW,KAAI,YAAY,OAAO;AAC3D,SAAO;AACT;;;ADcO,IAAM,iBAAN,MAAyC;AAAA,EACrC,OAAe,aAAa;AAAA,EAC5B,WAAoB;AAAA,EACpB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,SAAK,SAAS;AACd,UAAM,OAAkC,EAAE,cAAc,OAAO,aAAa;AAC5E,QAAI,OAAO,cAAc,OAAW,MAAK,YAAY,OAA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AC/B,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -0,0 +1,24 @@
1
+ // src/resource/gmail/config.ts
2
+ import { normalizeFields } from "@struktoai/mirage-core";
3
+ function redactGmailConfig(config) {
4
+ return {
5
+ clientId: config.clientId,
6
+ ...config.clientSecret !== void 0 ? { clientSecret: "<REDACTED>" } : {},
7
+ refreshToken: "<REDACTED>"
8
+ };
9
+ }
10
+ function normalizeGmailConfig(input) {
11
+ return normalizeFields(input, {
12
+ rename: {
13
+ client_id: "clientId",
14
+ client_secret: "clientSecret",
15
+ refresh_token: "refreshToken"
16
+ }
17
+ });
18
+ }
19
+
20
+ export {
21
+ redactGmailConfig,
22
+ normalizeGmailConfig
23
+ };
24
+ //# sourceMappingURL=chunk-OPROOV6J.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/gmail/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 } from '@struktoai/mirage-core'\n\nexport interface GmailConfig {\n clientId: string\n clientSecret?: string\n refreshToken: string\n refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; expiresIn: number }>\n}\n\nexport interface GmailConfigRedacted {\n clientId: string\n clientSecret?: '<REDACTED>'\n refreshToken: '<REDACTED>'\n}\n\nexport function redactGmailConfig(config: GmailConfig): GmailConfigRedacted {\n return {\n clientId: config.clientId,\n ...(config.clientSecret !== undefined ? { clientSecret: '<REDACTED>' as const } : {}),\n refreshToken: '<REDACTED>',\n }\n}\n\nexport function normalizeGmailConfig(input: Record<string, unknown>): GmailConfig {\n return normalizeFields(input, {\n rename: {\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n },\n }) as unknown as GmailConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAezB,SAAS,kBAAkB,QAA0C;AAC1E,SAAO;AAAA,IACL,UAAU,OAAO;AAAA,IACjB,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,aAAsB,IAAI,CAAC;AAAA,IACnF,cAAc;AAAA,EAChB;AACF;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":[]}
@@ -0,0 +1,23 @@
1
+ // src/resource/github_ci/config.ts
2
+ import { normalizeFields } from "@struktoai/mirage-core";
3
+ function redactGitHubCIConfig(config) {
4
+ const out = {
5
+ token: "<REDACTED>",
6
+ owner: config.owner,
7
+ repo: config.repo
8
+ };
9
+ if (config.days !== void 0) out.days = config.days;
10
+ if (config.baseUrl !== void 0) out.baseUrl = config.baseUrl;
11
+ return out;
12
+ }
13
+ function normalizeGitHubCIConfig(input) {
14
+ return normalizeFields(input, {
15
+ rename: { base_url: "baseUrl" }
16
+ });
17
+ }
18
+
19
+ export {
20
+ redactGitHubCIConfig,
21
+ normalizeGitHubCIConfig
22
+ };
23
+ //# sourceMappingURL=chunk-QARIHW3I.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 { normalizeFields } 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\nexport function redactGitHubCIConfig(config: GitHubCIConfig): GitHubCIConfigRedacted {\n const out: GitHubCIConfigRedacted = {\n token: '<REDACTED>',\n owner: config.owner,\n repo: config.repo,\n }\n if (config.days !== undefined) out.days = config.days\n if (config.baseUrl !== undefined) out.baseUrl = config.baseUrl\n return out\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,uBAAuB;AAkBzB,SAAS,qBAAqB,QAAgD;AACnF,QAAM,MAA8B;AAAA,IAClC,OAAO;AAAA,IACP,OAAO,OAAO;AAAA,IACd,MAAM,OAAO;AAAA,EACf;AACA,MAAI,OAAO,SAAS,OAAW,KAAI,OAAO,OAAO;AACjD,MAAI,OAAO,YAAY,OAAW,KAAI,UAAU,OAAO;AACvD,SAAO;AACT;AAEO,SAAS,wBAAwB,OAAgD;AACtF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ,EAAE,UAAU,UAAU;AAAA,EAChC,CAAC;AACH;","names":[]}
@@ -0,0 +1,144 @@
1
+ // src/resource/github/github.ts
2
+ import {
3
+ fetchGitHubRepoInfo,
4
+ fetchGitHubTree,
5
+ GITHUB_COMMANDS,
6
+ GITHUB_PROMPT,
7
+ GITHUB_VFS_OPS,
8
+ GitHubAccessor,
9
+ HttpGitHubTransport,
10
+ PathSpec,
11
+ RAMIndexCacheStore,
12
+ ResourceName,
13
+ githubIndexEntryFromTree,
14
+ githubMakeTreeEntry,
15
+ githubRead,
16
+ githubReaddir,
17
+ githubResolveGlob,
18
+ githubStat
19
+ } from "@struktoai/mirage-core";
20
+
21
+ // src/resource/github/config.ts
22
+ import { normalizeFields } from "@struktoai/mirage-core";
23
+ function redactGitHubConfig(config) {
24
+ const out = {
25
+ token: "<REDACTED>",
26
+ owner: config.owner,
27
+ repo: config.repo
28
+ };
29
+ if (config.ref !== void 0) out.ref = config.ref;
30
+ if (config.baseUrl !== void 0) out.baseUrl = config.baseUrl;
31
+ return out;
32
+ }
33
+ function normalizeGitHubConfig(input) {
34
+ return normalizeFields(input, {
35
+ rename: { base_url: "baseUrl" }
36
+ });
37
+ }
38
+
39
+ // src/resource/github/github.ts
40
+ var GitHubResource = class _GitHubResource {
41
+ kind = ResourceName.GITHUB;
42
+ isRemote = true;
43
+ indexTtl = 86400;
44
+ prompt = GITHUB_PROMPT;
45
+ config;
46
+ accessor;
47
+ index;
48
+ constructor(config, accessor, index) {
49
+ this.config = config;
50
+ this.accessor = accessor;
51
+ this.index = index;
52
+ }
53
+ static async create(config) {
54
+ const transportOpts = { token: config.token };
55
+ if (config.baseUrl !== void 0) transportOpts.baseUrl = config.baseUrl;
56
+ const transport = new HttpGitHubTransport(transportOpts);
57
+ const repoInfo = await fetchGitHubRepoInfo(transport, config.owner, config.repo);
58
+ const ref = config.ref ?? repoInfo.default_branch;
59
+ const { tree, truncated } = await fetchGitHubTree(transport, config.owner, config.repo, ref);
60
+ const treeMap = {};
61
+ for (const item of tree) treeMap[item.path] = githubMakeTreeEntry(item);
62
+ const accessor = new GitHubAccessor({
63
+ transport,
64
+ owner: config.owner,
65
+ repo: config.repo,
66
+ ref,
67
+ defaultBranch: repoInfo.default_branch,
68
+ truncated,
69
+ tree: treeMap
70
+ });
71
+ const index = new RAMIndexCacheStore({ ttl: 86400 });
72
+ await populateIndex(index, tree);
73
+ return new _GitHubResource(config, accessor, index);
74
+ }
75
+ open() {
76
+ return Promise.resolve();
77
+ }
78
+ close() {
79
+ return Promise.resolve();
80
+ }
81
+ commands() {
82
+ return GITHUB_COMMANDS;
83
+ }
84
+ ops() {
85
+ return GITHUB_VFS_OPS;
86
+ }
87
+ readFile(p) {
88
+ return githubRead(this.accessor, p, this.index);
89
+ }
90
+ readdir(p) {
91
+ return githubReaddir(this.accessor, p, this.index);
92
+ }
93
+ stat(p) {
94
+ return githubStat(this.accessor, p, this.index);
95
+ }
96
+ async fingerprint(p) {
97
+ const lookup = await this.index.get(p.original);
98
+ return lookup.entry?.id ?? null;
99
+ }
100
+ glob(paths, prefix = "") {
101
+ const effective = prefix !== "" ? paths.map(
102
+ (p) => p.prefix !== "" ? p : new PathSpec({
103
+ original: p.original,
104
+ directory: p.directory,
105
+ ...p.pattern !== null ? { pattern: p.pattern } : {},
106
+ resolved: p.resolved,
107
+ prefix
108
+ })
109
+ ) : paths;
110
+ return githubResolveGlob(this.accessor, effective, this.index);
111
+ }
112
+ getState() {
113
+ return Promise.resolve({
114
+ type: this.kind,
115
+ needsOverride: true,
116
+ redactedFields: ["token"],
117
+ config: redactGitHubConfig(this.config),
118
+ defaultBranch: this.accessor.defaultBranch,
119
+ truncated: this.accessor.truncated
120
+ });
121
+ }
122
+ loadState(_state) {
123
+ return Promise.resolve();
124
+ }
125
+ };
126
+ async function populateIndex(index, tree) {
127
+ const dirs = /* @__PURE__ */ new Map();
128
+ for (const item of tree) {
129
+ const parts = item.path.split("/");
130
+ const name = parts[parts.length - 1] ?? item.path;
131
+ const parent = parts.length > 1 ? `/${parts.slice(0, -1).join("/")}` : "/";
132
+ const arr = dirs.get(parent) ?? [];
133
+ arr.push([name, githubIndexEntryFromTree(item)]);
134
+ dirs.set(parent, arr);
135
+ }
136
+ await Promise.all([...dirs].map(([parent, entries]) => index.setDir(parent, entries)));
137
+ }
138
+
139
+ export {
140
+ redactGitHubConfig,
141
+ normalizeGitHubConfig,
142
+ GitHubResource
143
+ };
144
+ //# sourceMappingURL=chunk-QYFCHCGX.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 {\n fetchGitHubRepoInfo,\n fetchGitHubTree,\n type FileStat,\n GITHUB_COMMANDS,\n GITHUB_PROMPT,\n GITHUB_VFS_OPS,\n type GitHubTreeItem,\n GitHubAccessor,\n HttpGitHubTransport,\n type IndexCacheStore,\n type IndexEntry,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n githubIndexEntryFromTree,\n githubMakeTreeEntry,\n githubRead,\n githubReaddir,\n githubResolveGlob,\n githubStat,\n type GitHubTreeEntry,\n} from '@struktoai/mirage-core'\nimport { redactGitHubConfig, type GitHubConfig, type GitHubConfigRedacted } from './config.ts'\n\nexport interface GitHubResourceState {\n type: string\n needsOverride: boolean\n redactedFields: readonly 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 isRemote: 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: Record<string, GitHubTreeEntry> = {}\n for (const item of tree) treeMap[item.path] = githubMakeTreeEntry(item)\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 populateIndex(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_VFS_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 async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.id ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n 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 needsOverride: true,\n redactedFields: ['token'],\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\nasync function populateIndex(index: IndexCacheStore, tree: GitHubTreeItem[]): Promise<void> {\n const dirs = new Map<string, [string, IndexEntry][]>()\n for (const item of tree) {\n const parts = item.path.split('/')\n const name = parts[parts.length - 1] ?? item.path\n const parent = parts.length > 1 ? `/${parts.slice(0, -1).join('/')}` : '/'\n const arr = dirs.get(parent) ?? []\n arr.push([name, githubIndexEntryFromTree(item)])\n dirs.set(parent, arr)\n }\n await Promise.all([...dirs].map(([parent, entries]) => index.setDir(parent, entries)))\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 } 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\nexport function redactGitHubConfig(config: GitHubConfig): GitHubConfigRedacted {\n const out: GitHubConfigRedacted = {\n token: '<REDACTED>',\n owner: config.owner,\n repo: config.repo,\n }\n if (config.ref !== undefined) out.ref = config.ref\n if (config.baseUrl !== undefined) out.baseUrl = config.baseUrl\n return out\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;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;;;ACzBP,SAAS,uBAAuB;AAkBzB,SAAS,mBAAmB,QAA4C;AAC7E,QAAM,MAA4B;AAAA,IAChC,OAAO;AAAA,IACP,OAAO,OAAO;AAAA,IACd,MAAM,OAAO;AAAA,EACf;AACA,MAAI,OAAO,QAAQ,OAAW,KAAI,MAAM,OAAO;AAC/C,MAAI,OAAO,YAAY,OAAW,KAAI,UAAU,OAAO;AACvD,SAAO;AACT;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ,EAAE,UAAU,UAAU;AAAA,EAChC,CAAC;AACH;;;ADIO,IAAM,iBAAN,MAAM,gBAAmC;AAAA,EACrC,OAAe,aAAa;AAAA,EAC5B,WAAoB;AAAA,EACpB,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,QAA+C;AACjE,UAAM,gBAAqD,EAAE,OAAO,OAAO,MAAM;AACjF,QAAI,OAAO,YAAY,OAAW,eAAc,UAAU,OAAO;AACjE,UAAM,YAAY,IAAI,oBAAoB,aAAa;AACvD,UAAM,WAAW,MAAM,oBAAoB,WAAW,OAAO,OAAO,OAAO,IAAI;AAC/E,UAAM,MAAM,OAAO,OAAO,SAAS;AACnC,UAAM,EAAE,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DS,
8
+ GSHEETS_PROMPT,
9
+ GSHEETS_VFS_OPS,
10
+ GSHEETS_WRITE_PROMPT,
11
+ GSheetsAccessor,
12
+ PathSpec,
13
+ RAMIndexCacheStore,
14
+ ResourceName,
15
+ TokenManager,
16
+ gsheetsRead,
17
+ gsheetsReaddir,
18
+ gsheetsResolveGlob,
19
+ gsheetsStat
20
+ } from "@struktoai/mirage-core";
21
+ var GSheetsResource = class {
22
+ kind = ResourceName.GSHEETS;
23
+ isRemote = true;
24
+ indexTtl = 86400;
25
+ prompt = GSHEETS_PROMPT;
26
+ writePrompt = GSHEETS_WRITE_PROMPT;
27
+ config;
28
+ accessor;
29
+ index;
30
+ constructor(config) {
31
+ this.config = config;
32
+ const tm = new TokenManager({
33
+ clientId: config.clientId,
34
+ ...config.clientSecret !== void 0 ? { clientSecret: config.clientSecret } : {},
35
+ refreshToken: config.refreshToken,
36
+ ...config.refreshFn !== void 0 ? { refreshFn: config.refreshFn } : {}
37
+ });
38
+ this.accessor = new GSheetsAccessor({ tokenManager: tm });
39
+ this.index = new RAMIndexCacheStore({ ttl: 86400 });
40
+ }
41
+ open() {
42
+ return Promise.resolve();
43
+ }
44
+ close() {
45
+ return Promise.resolve();
46
+ }
47
+ commands() {
48
+ return GSHEETS_COMMANDS;
49
+ }
50
+ ops() {
51
+ return GSHEETS_VFS_OPS;
52
+ }
53
+ readFile(p) {
54
+ return gsheetsRead(this.accessor, p, this.index);
55
+ }
56
+ readdir(p) {
57
+ return gsheetsReaddir(this.accessor, p, this.index);
58
+ }
59
+ stat(p) {
60
+ return gsheetsStat(this.accessor, p, this.index);
61
+ }
62
+ async fingerprint(p) {
63
+ const lookup = await this.index.get(p.original);
64
+ return lookup.entry?.remoteTime ?? null;
65
+ }
66
+ glob(paths, prefix = "") {
67
+ const effective = prefix !== "" ? paths.map(
68
+ (p) => p.prefix !== "" ? p : new PathSpec({
69
+ original: p.original,
70
+ directory: p.directory,
71
+ ...p.pattern !== null ? { pattern: p.pattern } : {},
72
+ resolved: p.resolved,
73
+ prefix
74
+ })
75
+ ) : paths;
76
+ return gsheetsResolveGlob(this.accessor, effective, this.index);
77
+ }
78
+ getState() {
79
+ return Promise.resolve({
80
+ type: this.kind,
81
+ needsOverride: true,
82
+ redactedFields: ["clientSecret", "refreshToken"],
83
+ config: redactGSheetsConfig(this.config)
84
+ });
85
+ }
86
+ loadState(_state) {
87
+ return Promise.resolve();
88
+ }
89
+ };
90
+
91
+ export {
92
+ GSheetsResource
93
+ };
94
+ //# sourceMappingURL=chunk-SQQI4A6Y.js.map
@@ -0,0 +1 @@
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 {\n type FileStat,\n GSHEETS_COMMANDS,\n GSHEETS_PROMPT,\n GSHEETS_VFS_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 gsheetsResolveGlob,\n gsheetsStat,\n} from '@struktoai/mirage-core'\nimport { redactGSheetsConfig, type GSheetsConfig, type GSheetsConfigRedacted } from './config.ts'\n\nexport interface GSheetsResourceState {\n type: string\n needsOverride: boolean\n redactedFields: readonly string[]\n config: GSheetsConfigRedacted\n}\n\nexport class GSheetsResource implements Resource {\n readonly kind: string = ResourceName.GSHEETS\n readonly isRemote: 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_VFS_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 async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n 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 needsOverride: true,\n redactedFields: ['clientSecret', 'refreshToken'],\n config: redactGSheetsConfig(this.config),\n })\n }\n\n loadState(_state: GSheetsResourceState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