@struktoai/mirage-node 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.
- package/README.md +230 -0
- package/dist/box-4P7DCJH7.js +8 -0
- package/dist/box-4P7DCJH7.js.map +1 -0
- package/dist/chunk-35PVZRWU.js +24 -0
- package/dist/chunk-35PVZRWU.js.map +1 -0
- package/dist/chunk-3PBSL7BS.js +93 -0
- package/dist/chunk-3PBSL7BS.js.map +1 -0
- package/dist/chunk-3Y625AUP.js +24 -0
- package/dist/chunk-3Y625AUP.js.map +1 -0
- package/dist/chunk-5E6BULAK.js +92 -0
- package/dist/chunk-5E6BULAK.js.map +1 -0
- package/dist/chunk-5ITBZN55.js +24 -0
- package/dist/chunk-5ITBZN55.js.map +1 -0
- package/dist/chunk-6M2NL363.js +94 -0
- package/dist/chunk-6M2NL363.js.map +1 -0
- package/dist/chunk-6M3QVVOH.js +32 -0
- package/dist/chunk-6M3QVVOH.js.map +1 -0
- package/dist/chunk-6VKNSO6U.js +56 -0
- package/dist/chunk-6VKNSO6U.js.map +1 -0
- package/dist/chunk-6Y6GWMFF.js +24 -0
- package/dist/chunk-6Y6GWMFF.js.map +1 -0
- package/dist/chunk-7QXJ4KWQ.js +132 -0
- package/dist/chunk-7QXJ4KWQ.js.map +1 -0
- package/dist/chunk-ALAMUIGJ.js +57 -0
- package/dist/chunk-ALAMUIGJ.js.map +1 -0
- package/dist/chunk-DCJQ2PIX.js +100 -0
- package/dist/chunk-DCJQ2PIX.js.map +1 -0
- package/dist/chunk-EKPH4MMD.js +27 -0
- package/dist/chunk-EKPH4MMD.js.map +1 -0
- package/dist/chunk-FZ2GJ4BJ.js +29 -0
- package/dist/chunk-FZ2GJ4BJ.js.map +1 -0
- package/dist/chunk-G7O6DAWU.js +178 -0
- package/dist/chunk-G7O6DAWU.js.map +1 -0
- package/dist/chunk-GCB4JUF7.js +94 -0
- package/dist/chunk-GCB4JUF7.js.map +1 -0
- package/dist/chunk-GKQNMLQU.js +7757 -0
- package/dist/chunk-GKQNMLQU.js.map +1 -0
- package/dist/chunk-GO67AOYK.js +24 -0
- package/dist/chunk-GO67AOYK.js.map +1 -0
- package/dist/chunk-GPF66TH2.js +24 -0
- package/dist/chunk-GPF66TH2.js.map +1 -0
- package/dist/chunk-H3JR7MN3.js +45 -0
- package/dist/chunk-H3JR7MN3.js.map +1 -0
- package/dist/chunk-H74QYTN7.js +50 -0
- package/dist/chunk-H74QYTN7.js.map +1 -0
- package/dist/chunk-HEQL3LPK.js +66 -0
- package/dist/chunk-HEQL3LPK.js.map +1 -0
- package/dist/chunk-HXWGG4K7.js +66 -0
- package/dist/chunk-HXWGG4K7.js.map +1 -0
- package/dist/chunk-I4RRGZGB.js +24 -0
- package/dist/chunk-I4RRGZGB.js.map +1 -0
- package/dist/chunk-ICSS5ETT.js +67 -0
- package/dist/chunk-ICSS5ETT.js.map +1 -0
- package/dist/chunk-KINMBZHC.js +18 -0
- package/dist/chunk-KINMBZHC.js.map +1 -0
- package/dist/chunk-LBBM3LKK.js +99 -0
- package/dist/chunk-LBBM3LKK.js.map +1 -0
- package/dist/chunk-LPMPTQYP.js +36 -0
- package/dist/chunk-LPMPTQYP.js.map +1 -0
- package/dist/chunk-M42JTWPR.js +2794 -0
- package/dist/chunk-M42JTWPR.js.map +1 -0
- package/dist/chunk-MVE5VVMQ.js +91 -0
- package/dist/chunk-MVE5VVMQ.js.map +1 -0
- package/dist/chunk-MY3NUJJD.js +67 -0
- package/dist/chunk-MY3NUJJD.js.map +1 -0
- package/dist/chunk-NOZZFJEB.js +93 -0
- package/dist/chunk-NOZZFJEB.js.map +1 -0
- package/dist/chunk-OYJXYJTE.js +2358 -0
- package/dist/chunk-OYJXYJTE.js.map +1 -0
- package/dist/chunk-PEZYBKZH.js +124 -0
- package/dist/chunk-PEZYBKZH.js.map +1 -0
- package/dist/chunk-QWWOBAYU.js +26 -0
- package/dist/chunk-QWWOBAYU.js.map +1 -0
- package/dist/chunk-RQYYYBQG.js +24 -0
- package/dist/chunk-RQYYYBQG.js.map +1 -0
- package/dist/chunk-T2WWAEKH.js +7591 -0
- package/dist/chunk-T2WWAEKH.js.map +1 -0
- package/dist/chunk-U6QSXTUS.js +7 -0
- package/dist/chunk-U6QSXTUS.js.map +1 -0
- package/dist/chunk-UWMOTOXA.js +93 -0
- package/dist/chunk-UWMOTOXA.js.map +1 -0
- package/dist/chunk-UZZD4MRJ.js +95 -0
- package/dist/chunk-UZZD4MRJ.js.map +1 -0
- package/dist/chunk-V5OLWE7F.js +88 -0
- package/dist/chunk-V5OLWE7F.js.map +1 -0
- package/dist/chunk-VCLMTMSO.js +23 -0
- package/dist/chunk-VCLMTMSO.js.map +1 -0
- package/dist/chunk-WSDQ2MRG.js +102 -0
- package/dist/chunk-WSDQ2MRG.js.map +1 -0
- package/dist/chunk-XDEEOTVK.js +93 -0
- package/dist/chunk-XDEEOTVK.js.map +1 -0
- package/dist/chunk-XQUQSNCA.js +117 -0
- package/dist/chunk-XQUQSNCA.js.map +1 -0
- package/dist/chunk-XVYZO2FG.js +14 -0
- package/dist/chunk-XVYZO2FG.js.map +1 -0
- package/dist/chunk-ZC4KNEOQ.js +50 -0
- package/dist/chunk-ZC4KNEOQ.js.map +1 -0
- package/dist/config-5ZPGISS6.js +13 -0
- package/dist/config-5ZPGISS6.js.map +1 -0
- package/dist/config-6HWSKHEU.js +9 -0
- package/dist/config-6HWSKHEU.js.map +1 -0
- package/dist/config-6TNFPYZF.js +9 -0
- package/dist/config-6TNFPYZF.js.map +1 -0
- package/dist/config-BHLXQ3OL.js +9 -0
- package/dist/config-BHLXQ3OL.js.map +1 -0
- package/dist/config-E7UOEWEP.js +9 -0
- package/dist/config-E7UOEWEP.js.map +1 -0
- package/dist/config-FNR6LJ5H.js +11 -0
- package/dist/config-FNR6LJ5H.js.map +1 -0
- package/dist/config-HIZHA5VD.js +13 -0
- package/dist/config-HIZHA5VD.js.map +1 -0
- package/dist/config-HNSDNQZH.js +9 -0
- package/dist/config-HNSDNQZH.js.map +1 -0
- package/dist/config-IXLFUSMQ.js +9 -0
- package/dist/config-IXLFUSMQ.js.map +1 -0
- package/dist/config-J3TM7NIS.js +9 -0
- package/dist/config-J3TM7NIS.js.map +1 -0
- package/dist/config-JXLZ4XEW.js +9 -0
- package/dist/config-JXLZ4XEW.js.map +1 -0
- package/dist/config-KQCEMLNZ.js +9 -0
- package/dist/config-KQCEMLNZ.js.map +1 -0
- package/dist/config-MOLWOSRG.js +9 -0
- package/dist/config-MOLWOSRG.js.map +1 -0
- package/dist/config-R3XJ5OW4.js +9 -0
- package/dist/config-R3XJ5OW4.js.map +1 -0
- package/dist/config-S47UDVRZ.js +13 -0
- package/dist/config-S47UDVRZ.js.map +1 -0
- package/dist/config-UKZ72IDO.js +13 -0
- package/dist/config-UKZ72IDO.js.map +1 -0
- package/dist/config-V7XI5UTG.js +9 -0
- package/dist/config-V7XI5UTG.js.map +1 -0
- package/dist/config-YLIX3ZBT.js +9 -0
- package/dist/config-YLIX3ZBT.js.map +1 -0
- package/dist/config-Z5JGDOKE.js +9 -0
- package/dist/config-Z5JGDOKE.js.map +1 -0
- package/dist/config-ZCZZAH5W.js +9 -0
- package/dist/config-ZCZZAH5W.js.map +1 -0
- package/dist/config-ZZGIWDUC.js +9 -0
- package/dist/config-ZZGIWDUC.js.map +1 -0
- package/dist/discord-2PWP2MGX.js +8 -0
- package/dist/discord-2PWP2MGX.js.map +1 -0
- package/dist/disk-C7TJNU2B.js +8 -0
- package/dist/disk-C7TJNU2B.js.map +1 -0
- package/dist/dropbox-L5DPYGKR.js +8 -0
- package/dist/dropbox-L5DPYGKR.js.map +1 -0
- package/dist/email-HASRFBKC.js +8 -0
- package/dist/email-HASRFBKC.js.map +1 -0
- package/dist/gcs-P5QMKTPR.js +10 -0
- package/dist/gcs-P5QMKTPR.js.map +1 -0
- package/dist/gdocs-IF2I35HZ.js +8 -0
- package/dist/gdocs-IF2I35HZ.js.map +1 -0
- package/dist/gdrive-TAETVCKP.js +8 -0
- package/dist/gdrive-TAETVCKP.js.map +1 -0
- package/dist/github-5E6GSCNZ.js +8 -0
- package/dist/github-5E6GSCNZ.js.map +1 -0
- package/dist/github_ci-2DSZI3Y7.js +8 -0
- package/dist/github_ci-2DSZI3Y7.js.map +1 -0
- package/dist/gmail-F5VYGKOT.js +8 -0
- package/dist/gmail-F5VYGKOT.js.map +1 -0
- package/dist/gsheets-BAO54CQ7.js +8 -0
- package/dist/gsheets-BAO54CQ7.js.map +1 -0
- package/dist/gslides-A62CEEMR.js +8 -0
- package/dist/gslides-A62CEEMR.js.map +1 -0
- package/dist/index.d.ts +1671 -0
- package/dist/index.js +3564 -0
- package/dist/index.js.map +1 -0
- package/dist/langfuse-YKBYRQLU.js +8 -0
- package/dist/langfuse-YKBYRQLU.js.map +1 -0
- package/dist/linear-WJDQ6JDE.js +8 -0
- package/dist/linear-WJDQ6JDE.js.map +1 -0
- package/dist/mongodb-MK4DVSIK.js +7 -0
- package/dist/mongodb-MK4DVSIK.js.map +1 -0
- package/dist/oci-KZ7XFZ2X.js +10 -0
- package/dist/oci-KZ7XFZ2X.js.map +1 -0
- package/dist/postgres-M2N2APFZ.js +7 -0
- package/dist/postgres-M2N2APFZ.js.map +1 -0
- package/dist/r2-X4DDNSAZ.js +10 -0
- package/dist/r2-X4DDNSAZ.js.map +1 -0
- package/dist/redis-NVCXUUIO.js +7 -0
- package/dist/redis-NVCXUUIO.js.map +1 -0
- package/dist/s3-HVAL7ZX3.js +8 -0
- package/dist/s3-HVAL7ZX3.js.map +1 -0
- package/dist/slack-GUQMDGLP.js +8 -0
- package/dist/slack-GUQMDGLP.js.map +1 -0
- package/dist/ssh-LY6WYVVD.js +9 -0
- package/dist/ssh-LY6WYVVD.js.map +1 -0
- package/dist/supabase-H3ZP4Y3W.js +10 -0
- package/dist/supabase-H3ZP4Y3W.js.map +1 -0
- package/dist/trello-WR6TEDYD.js +8 -0
- package/dist/trello-WR6TEDYD.js.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/resource/langfuse/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function redactLangfuseConfig(config) {
|
|
4
|
+
const out = {
|
|
5
|
+
publicKey: config.publicKey,
|
|
6
|
+
secretKey: "<REDACTED>"
|
|
7
|
+
};
|
|
8
|
+
if (config.host !== void 0) out.host = config.host;
|
|
9
|
+
if (config.defaultTraceLimit !== void 0) out.defaultTraceLimit = config.defaultTraceLimit;
|
|
10
|
+
if (config.defaultSearchLimit !== void 0) out.defaultSearchLimit = config.defaultSearchLimit;
|
|
11
|
+
if (config.defaultFromTimestamp !== void 0) {
|
|
12
|
+
out.defaultFromTimestamp = config.defaultFromTimestamp;
|
|
13
|
+
}
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
function normalizeLangfuseConfig(input) {
|
|
17
|
+
return normalizeFields(input, {
|
|
18
|
+
rename: {
|
|
19
|
+
public_key: "publicKey",
|
|
20
|
+
secret_key: "secretKey",
|
|
21
|
+
default_trace_limit: "defaultTraceLimit",
|
|
22
|
+
default_search_limit: "defaultSearchLimit",
|
|
23
|
+
default_from_timestamp: "defaultFromTimestamp"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
redactLangfuseConfig,
|
|
30
|
+
normalizeLangfuseConfig
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-6M3QVVOH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/langfuse/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 LangfuseConfig {\n publicKey: string\n secretKey: string\n host?: string\n defaultTraceLimit?: number\n defaultSearchLimit?: number\n defaultFromTimestamp?: string\n}\n\nexport interface LangfuseConfigRedacted {\n publicKey: string\n secretKey: '<REDACTED>'\n host?: string\n defaultTraceLimit?: number\n defaultSearchLimit?: number\n defaultFromTimestamp?: string\n}\n\nexport function redactLangfuseConfig(config: LangfuseConfig): LangfuseConfigRedacted {\n const out: LangfuseConfigRedacted = {\n publicKey: config.publicKey,\n secretKey: '<REDACTED>',\n }\n if (config.host !== undefined) out.host = config.host\n if (config.defaultTraceLimit !== undefined) out.defaultTraceLimit = config.defaultTraceLimit\n if (config.defaultSearchLimit !== undefined) out.defaultSearchLimit = config.defaultSearchLimit\n if (config.defaultFromTimestamp !== undefined) {\n out.defaultFromTimestamp = config.defaultFromTimestamp\n }\n return out\n}\n\nexport function normalizeLangfuseConfig(input: Record<string, unknown>): LangfuseConfig {\n return normalizeFields(input, {\n rename: {\n public_key: 'publicKey',\n secret_key: 'secretKey',\n default_trace_limit: 'defaultTraceLimit',\n default_search_limit: 'defaultSearchLimit',\n default_from_timestamp: 'defaultFromTimestamp',\n },\n }) as unknown as LangfuseConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAoBzB,SAAS,qBAAqB,QAAgD;AACnF,QAAM,MAA8B;AAAA,IAClC,WAAW,OAAO;AAAA,IAClB,WAAW;AAAA,EACb;AACA,MAAI,OAAO,SAAS,OAAW,KAAI,OAAO,OAAO;AACjD,MAAI,OAAO,sBAAsB,OAAW,KAAI,oBAAoB,OAAO;AAC3E,MAAI,OAAO,uBAAuB,OAAW,KAAI,qBAAqB,OAAO;AAC7E,MAAI,OAAO,yBAAyB,QAAW;AAC7C,QAAI,uBAAuB,OAAO;AAAA,EACpC;AACA,SAAO;AACT;AAEO,SAAS,wBAAwB,OAAgD;AACtF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,qBAAqB;AAAA,MACrB,sBAAsB;AAAA,MACtB,wBAAwB;AAAA,IAC1B;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/resource/r2/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function resolvedR2Endpoint(config) {
|
|
4
|
+
if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
|
|
5
|
+
if (config.accountId !== void 0 && config.accountId !== "") {
|
|
6
|
+
return `https://${config.accountId}.r2.cloudflarestorage.com`;
|
|
7
|
+
}
|
|
8
|
+
throw new Error("R2Config requires accountId or endpoint");
|
|
9
|
+
}
|
|
10
|
+
function r2ToS3Config(config) {
|
|
11
|
+
return {
|
|
12
|
+
bucket: config.bucket,
|
|
13
|
+
region: config.region ?? "auto",
|
|
14
|
+
endpoint: resolvedR2Endpoint(config),
|
|
15
|
+
accessKeyId: config.accessKeyId,
|
|
16
|
+
secretAccessKey: config.secretAccessKey,
|
|
17
|
+
...config.profile !== void 0 ? { profile: config.profile } : {},
|
|
18
|
+
...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function redactR2Config(config) {
|
|
22
|
+
return {
|
|
23
|
+
bucket: config.bucket,
|
|
24
|
+
accessKeyId: "<REDACTED>",
|
|
25
|
+
secretAccessKey: "<REDACTED>",
|
|
26
|
+
...config.accountId !== void 0 ? { accountId: config.accountId } : {},
|
|
27
|
+
endpoint: resolvedR2Endpoint(config),
|
|
28
|
+
region: config.region ?? "auto",
|
|
29
|
+
...config.profile !== void 0 ? { profile: config.profile } : {},
|
|
30
|
+
...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function normalizeR2Config(input) {
|
|
34
|
+
return normalizeFields(input, {
|
|
35
|
+
rename: {
|
|
36
|
+
account_id: "accountId",
|
|
37
|
+
access_key_id: "accessKeyId",
|
|
38
|
+
secret_access_key: "secretAccessKey",
|
|
39
|
+
aws_profile: "profile",
|
|
40
|
+
endpoint_url: "endpoint",
|
|
41
|
+
timeout: "timeoutMs"
|
|
42
|
+
},
|
|
43
|
+
transform: {
|
|
44
|
+
timeout: (v) => typeof v === "number" ? v * 1e3 : v
|
|
45
|
+
},
|
|
46
|
+
drop: ["proxy"]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
resolvedR2Endpoint,
|
|
52
|
+
r2ToS3Config,
|
|
53
|
+
redactR2Config,
|
|
54
|
+
normalizeR2Config
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=chunk-6VKNSO6U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/r2/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'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface R2Config {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n accountId?: string\n endpoint?: string\n region?: string\n profile?: string\n timeoutMs?: number\n}\n\nexport interface R2ConfigRedacted {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n accountId?: string\n endpoint: string\n region: string\n profile?: string\n timeoutMs?: number\n}\n\nexport function resolvedR2Endpoint(config: R2Config): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.accountId !== undefined && config.accountId !== '') {\n return `https://${config.accountId}.r2.cloudflarestorage.com`\n }\n throw new Error('R2Config requires accountId or endpoint')\n}\n\nexport function r2ToS3Config(config: R2Config): S3Config {\n return {\n bucket: config.bucket,\n region: config.region ?? 'auto',\n endpoint: resolvedR2Endpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n ...(config.profile !== undefined ? { profile: config.profile } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactR2Config(config: R2Config): R2ConfigRedacted {\n return {\n bucket: config.bucket,\n accessKeyId: '<REDACTED>',\n secretAccessKey: '<REDACTED>',\n ...(config.accountId !== undefined ? { accountId: config.accountId } : {}),\n endpoint: resolvedR2Endpoint(config),\n region: config.region ?? 'auto',\n ...(config.profile !== undefined ? { profile: config.profile } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function normalizeR2Config(input: Record<string, unknown>): R2Config {\n return normalizeFields(input, {\n rename: {\n account_id: 'accountId',\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n aws_profile: 'profile',\n endpoint_url: 'endpoint',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as R2Config\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAyBzB,SAAS,mBAAmB,QAA0B;AAC3D,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,cAAc,UAAa,OAAO,cAAc,IAAI;AAC7D,WAAO,WAAW,OAAO,SAAS;AAAA,EACpC;AACA,QAAM,IAAI,MAAM,yCAAyC;AAC3D;AAEO,SAAS,aAAa,QAA4B;AACvD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO,UAAU;AAAA,IACzB,UAAU,mBAAmB,MAAM;AAAA,IACnC,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,IACxB,GAAI,OAAO,YAAY,SAAY,EAAE,SAAS,OAAO,QAAQ,IAAI,CAAC;AAAA,IAClE,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,eAAe,QAAoC;AACjE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,IACxE,UAAU,mBAAmB,MAAM;AAAA,IACnC,QAAQ,OAAO,UAAU;AAAA,IACzB,GAAI,OAAO,YAAY,SAAY,EAAE,SAAS,OAAO,QAAQ,IAAI,CAAC;AAAA,IAClE,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,kBAAkB,OAA0C;AAC1E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,aAAa;AAAA,MACb,cAAc;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS,CAAC,MAAgB,OAAO,MAAM,WAAW,IAAI,MAAO;AAAA,IAC/D;AAAA,IACA,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/resource/linear/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function redactLinearConfig(config) {
|
|
4
|
+
const out = { apiKey: "<REDACTED>" };
|
|
5
|
+
if (config.workspace !== void 0) out.workspace = config.workspace;
|
|
6
|
+
if (config.teamIds !== void 0) out.teamIds = config.teamIds;
|
|
7
|
+
if (config.baseUrl !== void 0) out.baseUrl = config.baseUrl;
|
|
8
|
+
return out;
|
|
9
|
+
}
|
|
10
|
+
function normalizeLinearConfig(input) {
|
|
11
|
+
return normalizeFields(input, {
|
|
12
|
+
rename: {
|
|
13
|
+
api_key: "apiKey",
|
|
14
|
+
team_ids: "teamIds",
|
|
15
|
+
base_url: "baseUrl"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
redactLinearConfig,
|
|
22
|
+
normalizeLinearConfig
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-6Y6GWMFF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/linear/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields } from '@struktoai/mirage-core'\n\nexport interface LinearConfig {\n apiKey: string\n workspace?: string\n teamIds?: readonly string[]\n baseUrl?: string\n}\n\nexport interface LinearConfigRedacted {\n apiKey: '<REDACTED>'\n workspace?: string\n teamIds?: readonly string[]\n baseUrl?: string\n}\n\nexport function redactLinearConfig(config: LinearConfig): LinearConfigRedacted {\n const out: LinearConfigRedacted = { apiKey: '<REDACTED>' }\n if (config.workspace !== undefined) out.workspace = config.workspace\n if (config.teamIds !== undefined) out.teamIds = config.teamIds\n if (config.baseUrl !== undefined) out.baseUrl = config.baseUrl\n return out\n}\n\nexport function normalizeLinearConfig(input: Record<string, unknown>): LinearConfig {\n return normalizeFields(input, {\n rename: {\n api_key: 'apiKey',\n team_ids: 'teamIds',\n base_url: 'baseUrl',\n },\n }) as unknown as LinearConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAgBzB,SAAS,mBAAmB,QAA4C;AAC7E,QAAM,MAA4B,EAAE,QAAQ,aAAa;AACzD,MAAI,OAAO,cAAc,OAAW,KAAI,YAAY,OAAO;AAC3D,MAAI,OAAO,YAAY,OAAW,KAAI,UAAU,OAAO;AACvD,MAAI,OAAO,YAAY,OAAW,KAAI,UAAU,OAAO;AACvD,SAAO;AACT;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IACZ;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// src/resource/mongodb/mongodb.ts
|
|
2
|
+
import {
|
|
3
|
+
detectMongoScope,
|
|
4
|
+
MONGODB_COMMANDS,
|
|
5
|
+
MONGODB_OPS,
|
|
6
|
+
MONGODB_PROMPT,
|
|
7
|
+
MongoDBAccessor,
|
|
8
|
+
mongoRead,
|
|
9
|
+
mongoReaddir,
|
|
10
|
+
mongoStat,
|
|
11
|
+
PathSpec,
|
|
12
|
+
RAMIndexCacheStore,
|
|
13
|
+
resolveMongoGlob,
|
|
14
|
+
ResourceName,
|
|
15
|
+
resolveMongoDBConfig
|
|
16
|
+
} from "@struktoai/mirage-core";
|
|
17
|
+
|
|
18
|
+
// src/resource/mongodb/store.ts
|
|
19
|
+
import { loadOptionalPeer } from "@struktoai/mirage-core";
|
|
20
|
+
var MongoDBStore = class {
|
|
21
|
+
uri;
|
|
22
|
+
clientPromise = null;
|
|
23
|
+
constructor(uri) {
|
|
24
|
+
this.uri = uri;
|
|
25
|
+
}
|
|
26
|
+
async listDatabases() {
|
|
27
|
+
const c = await this._client();
|
|
28
|
+
const r = await c.db().admin().listDatabases();
|
|
29
|
+
return r.databases.map((d) => d.name);
|
|
30
|
+
}
|
|
31
|
+
async listCollections(database) {
|
|
32
|
+
const c = await this._client();
|
|
33
|
+
const cols = await c.db(database).listCollections().toArray();
|
|
34
|
+
return cols.map((col) => col.name);
|
|
35
|
+
}
|
|
36
|
+
async findDocuments(database, collection, filter = {}, options = {}) {
|
|
37
|
+
const c = await this._client();
|
|
38
|
+
let cursor = c.db(database).collection(collection).find(filter, {
|
|
39
|
+
...options.projection !== void 0 ? { projection: options.projection } : {}
|
|
40
|
+
});
|
|
41
|
+
if (options.sort !== void 0) cursor = cursor.sort(options.sort);
|
|
42
|
+
if (options.skip !== void 0) cursor = cursor.skip(options.skip);
|
|
43
|
+
if (options.limit !== void 0) cursor = cursor.limit(options.limit);
|
|
44
|
+
return await cursor.toArray();
|
|
45
|
+
}
|
|
46
|
+
async countDocuments(database, collection, filter = {}) {
|
|
47
|
+
const c = await this._client();
|
|
48
|
+
return c.db(database).collection(collection).countDocuments(filter);
|
|
49
|
+
}
|
|
50
|
+
async listIndexes(database, collection) {
|
|
51
|
+
const c = await this._client();
|
|
52
|
+
return c.db(database).collection(collection).listIndexes().toArray();
|
|
53
|
+
}
|
|
54
|
+
async close() {
|
|
55
|
+
if (this.clientPromise === null) return;
|
|
56
|
+
const c = await this.clientPromise;
|
|
57
|
+
this.clientPromise = null;
|
|
58
|
+
await c.close();
|
|
59
|
+
}
|
|
60
|
+
async _client() {
|
|
61
|
+
this.clientPromise ??= this._connect();
|
|
62
|
+
return this.clientPromise;
|
|
63
|
+
}
|
|
64
|
+
async _connect() {
|
|
65
|
+
const mod = await loadOptionalPeer(() => import("mongodb"), {
|
|
66
|
+
feature: "MongoDBResource",
|
|
67
|
+
packageName: "mongodb"
|
|
68
|
+
});
|
|
69
|
+
const c = new mod.MongoClient(this.uri);
|
|
70
|
+
await c.connect();
|
|
71
|
+
return c;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// src/resource/mongodb/mongodb.ts
|
|
76
|
+
var MongoDBResource = class {
|
|
77
|
+
kind = ResourceName.MONGODB;
|
|
78
|
+
isRemote = true;
|
|
79
|
+
indexTtl = 0;
|
|
80
|
+
prompt;
|
|
81
|
+
config;
|
|
82
|
+
store;
|
|
83
|
+
accessor;
|
|
84
|
+
index;
|
|
85
|
+
constructor(options) {
|
|
86
|
+
const { config, prefix } = "config" in options ? options : { config: options, prefix: void 0 };
|
|
87
|
+
this.config = resolveMongoDBConfig(config);
|
|
88
|
+
this.store = new MongoDBStore(this.config.uri);
|
|
89
|
+
this.accessor = new MongoDBAccessor(this.store, this.config);
|
|
90
|
+
this.index = new RAMIndexCacheStore({ ttl: this.indexTtl });
|
|
91
|
+
this.prompt = MONGODB_PROMPT.replace("{prefix}", prefix ?? "");
|
|
92
|
+
}
|
|
93
|
+
open() {
|
|
94
|
+
return Promise.resolve();
|
|
95
|
+
}
|
|
96
|
+
async close() {
|
|
97
|
+
await this.store.close();
|
|
98
|
+
}
|
|
99
|
+
ops() {
|
|
100
|
+
return MONGODB_OPS;
|
|
101
|
+
}
|
|
102
|
+
commands() {
|
|
103
|
+
return MONGODB_COMMANDS;
|
|
104
|
+
}
|
|
105
|
+
readFile(p) {
|
|
106
|
+
return mongoRead(this.accessor, p, this.index);
|
|
107
|
+
}
|
|
108
|
+
readdir(p) {
|
|
109
|
+
return mongoReaddir(this.accessor, p, this.index);
|
|
110
|
+
}
|
|
111
|
+
stat(p) {
|
|
112
|
+
return mongoStat(this.accessor, p, this.index);
|
|
113
|
+
}
|
|
114
|
+
glob(paths, prefix = "") {
|
|
115
|
+
const effective = prefix !== "" ? paths.map(
|
|
116
|
+
(p) => p.prefix !== "" ? p : new PathSpec({
|
|
117
|
+
original: p.original,
|
|
118
|
+
directory: p.directory,
|
|
119
|
+
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
120
|
+
resolved: p.resolved,
|
|
121
|
+
prefix
|
|
122
|
+
})
|
|
123
|
+
) : paths;
|
|
124
|
+
return resolveMongoGlob(this.accessor, effective, this.index);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
MongoDBStore,
|
|
130
|
+
MongoDBResource
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=chunk-7QXJ4KWQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/mongodb/mongodb.ts","../src/resource/mongodb/store.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 detectMongoScope,\n type FileStat,\n type IndexCacheStore,\n MONGODB_COMMANDS,\n MONGODB_OPS,\n MONGODB_PROMPT,\n MongoDBAccessor,\n type MongoDBConfig,\n type MongoDBConfigResolved,\n mongoRead,\n mongoReaddir,\n mongoStat,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n resolveMongoGlob,\n ResourceName,\n resolveMongoDBConfig,\n} from '@struktoai/mirage-core'\nimport { MongoDBStore } from './store.ts'\n\nvoid detectMongoScope\n\nexport interface MongoDBResourceOptions {\n config: MongoDBConfig\n prefix?: string\n}\n\nexport class MongoDBResource implements Resource {\n readonly kind: string = ResourceName.MONGODB\n readonly isRemote: boolean = true\n readonly indexTtl: number = 0\n readonly prompt: string\n readonly config: MongoDBConfigResolved\n readonly store: MongoDBStore\n readonly accessor: MongoDBAccessor\n readonly index: IndexCacheStore\n\n constructor(options: MongoDBResourceOptions | MongoDBConfig) {\n const { config, prefix } =\n 'config' in options ? options : { config: options, prefix: undefined }\n this.config = resolveMongoDBConfig(config)\n this.store = new MongoDBStore(this.config.uri)\n this.accessor = new MongoDBAccessor(this.store, this.config)\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n this.prompt = MONGODB_PROMPT.replace('{prefix}', prefix ?? '')\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n async close(): Promise<void> {\n await this.store.close()\n }\n\n ops(): readonly RegisteredOp[] {\n return MONGODB_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return MONGODB_COMMANDS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return mongoRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return mongoReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return mongoStat(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 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 resolveMongoGlob(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 { loadOptionalPeer, type MongoDriver, type MongoFindOptions } from '@struktoai/mirage-core'\n\ninterface MongoCollectionLike {\n find: (\n filter: Record<string, unknown>,\n options?: { projection?: Record<string, unknown> },\n ) => {\n sort: (sort: Record<string, 1 | -1>) => MongoCursorLike\n skip: (n: number) => MongoCursorLike\n limit: (n: number) => MongoCursorLike\n toArray: () => Promise<Record<string, unknown>[]>\n }\n countDocuments: (filter?: Record<string, unknown>) => Promise<number>\n listIndexes: () => { toArray: () => Promise<Record<string, unknown>[]> }\n}\n\ninterface MongoCursorLike {\n sort: (sort: Record<string, 1 | -1>) => MongoCursorLike\n skip: (n: number) => MongoCursorLike\n limit: (n: number) => MongoCursorLike\n toArray: () => Promise<Record<string, unknown>[]>\n}\n\ninterface MongoDbLike {\n listCollections: () => { toArray: () => Promise<{ name: string }[]> }\n collection: (name: string) => MongoCollectionLike\n admin: () => { listDatabases: () => Promise<{ databases: { name: string }[] }> }\n}\n\ninterface MongoClientLike {\n connect: () => Promise<MongoClientLike>\n db: (name?: string) => MongoDbLike\n close: () => Promise<void>\n}\n\ninterface MongoModule {\n MongoClient: new (uri: string) => MongoClientLike\n}\n\nexport class MongoDBStore implements MongoDriver {\n readonly uri: string\n private clientPromise: Promise<MongoClientLike> | null = null\n\n constructor(uri: string) {\n this.uri = uri\n }\n\n async listDatabases(): Promise<string[]> {\n const c = await this._client()\n const r = await c.db().admin().listDatabases()\n return r.databases.map((d) => d.name)\n }\n\n async listCollections(database: string): Promise<string[]> {\n const c = await this._client()\n const cols = await c.db(database).listCollections().toArray()\n return cols.map((col) => col.name)\n }\n\n async findDocuments<T = Record<string, unknown>>(\n database: string,\n collection: string,\n filter: Record<string, unknown> = {},\n options: MongoFindOptions = {},\n ): Promise<T[]> {\n const c = await this._client()\n let cursor = c\n .db(database)\n .collection(collection)\n .find(filter, {\n ...(options.projection !== undefined ? { projection: options.projection } : {}),\n }) as MongoCursorLike\n if (options.sort !== undefined) cursor = cursor.sort(options.sort)\n if (options.skip !== undefined) cursor = cursor.skip(options.skip)\n if (options.limit !== undefined) cursor = cursor.limit(options.limit)\n return (await cursor.toArray()) as T[]\n }\n\n async countDocuments(\n database: string,\n collection: string,\n filter: Record<string, unknown> = {},\n ): Promise<number> {\n const c = await this._client()\n return c.db(database).collection(collection).countDocuments(filter)\n }\n\n async listIndexes(database: string, collection: string): Promise<Record<string, unknown>[]> {\n const c = await this._client()\n return c.db(database).collection(collection).listIndexes().toArray()\n }\n\n async close(): Promise<void> {\n if (this.clientPromise === null) return\n const c = await this.clientPromise\n this.clientPromise = null\n await c.close()\n }\n\n private async _client(): Promise<MongoClientLike> {\n this.clientPromise ??= this._connect()\n return this.clientPromise\n }\n\n protected async _connect(): Promise<MongoClientLike> {\n const mod = await loadOptionalPeer(() => import('mongodb') as unknown as Promise<MongoModule>, {\n feature: 'MongoDBResource',\n packageName: 'mongodb',\n })\n const c = new mod.MongoClient(this.uri)\n await c.connect()\n return c\n }\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/resource/supabase/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function resolvedSupabaseEndpoint(config) {
|
|
4
|
+
if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
|
|
5
|
+
if (config.projectRef !== void 0 && config.projectRef !== "") {
|
|
6
|
+
return `https://${config.projectRef}.storage.supabase.co/storage/v1/s3`;
|
|
7
|
+
}
|
|
8
|
+
throw new Error("SupabaseConfig requires projectRef or endpoint");
|
|
9
|
+
}
|
|
10
|
+
function supabaseToS3Config(config) {
|
|
11
|
+
return {
|
|
12
|
+
bucket: config.bucket,
|
|
13
|
+
region: config.region,
|
|
14
|
+
endpoint: resolvedSupabaseEndpoint(config),
|
|
15
|
+
accessKeyId: config.accessKeyId,
|
|
16
|
+
secretAccessKey: config.secretAccessKey,
|
|
17
|
+
forcePathStyle: true,
|
|
18
|
+
...config.sessionToken !== void 0 ? { sessionToken: config.sessionToken } : {},
|
|
19
|
+
...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function redactSupabaseConfig(config) {
|
|
23
|
+
return {
|
|
24
|
+
bucket: config.bucket,
|
|
25
|
+
region: config.region,
|
|
26
|
+
...config.projectRef !== void 0 ? { projectRef: config.projectRef } : {},
|
|
27
|
+
endpoint: resolvedSupabaseEndpoint(config),
|
|
28
|
+
accessKeyId: "<REDACTED>",
|
|
29
|
+
secretAccessKey: "<REDACTED>",
|
|
30
|
+
...config.sessionToken !== void 0 ? { sessionToken: "<REDACTED>" } : {},
|
|
31
|
+
...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function normalizeSupabaseConfig(input) {
|
|
35
|
+
return normalizeFields(input, {
|
|
36
|
+
rename: {
|
|
37
|
+
project_ref: "projectRef",
|
|
38
|
+
access_key_id: "accessKeyId",
|
|
39
|
+
secret_access_key: "secretAccessKey",
|
|
40
|
+
session_token: "sessionToken",
|
|
41
|
+
endpoint_url: "endpoint",
|
|
42
|
+
timeout: "timeoutMs"
|
|
43
|
+
},
|
|
44
|
+
transform: {
|
|
45
|
+
timeout: (v) => typeof v === "number" ? v * 1e3 : v
|
|
46
|
+
},
|
|
47
|
+
drop: ["proxy"]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
resolvedSupabaseEndpoint,
|
|
53
|
+
supabaseToS3Config,
|
|
54
|
+
redactSupabaseConfig,
|
|
55
|
+
normalizeSupabaseConfig
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=chunk-ALAMUIGJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/supabase/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'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface SupabaseConfig {\n bucket: string\n region: string\n accessKeyId: string\n secretAccessKey: string\n projectRef?: string\n endpoint?: string\n sessionToken?: string\n timeoutMs?: number\n}\n\nexport interface SupabaseConfigRedacted {\n bucket: string\n region: string\n projectRef?: string\n endpoint: string\n accessKeyId: string\n secretAccessKey: string\n sessionToken?: string\n timeoutMs?: number\n}\n\nexport function resolvedSupabaseEndpoint(config: SupabaseConfig): string {\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 throw new Error('SupabaseConfig requires projectRef or endpoint')\n}\n\nexport function supabaseToS3Config(config: SupabaseConfig): S3Config {\n return {\n bucket: config.bucket,\n region: config.region,\n endpoint: resolvedSupabaseEndpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n forcePathStyle: true,\n ...(config.sessionToken !== undefined ? { sessionToken: config.sessionToken } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactSupabaseConfig(config: SupabaseConfig): SupabaseConfigRedacted {\n return {\n bucket: config.bucket,\n region: config.region,\n ...(config.projectRef !== undefined ? { projectRef: config.projectRef } : {}),\n endpoint: resolvedSupabaseEndpoint(config),\n accessKeyId: '<REDACTED>',\n secretAccessKey: '<REDACTED>',\n ...(config.sessionToken !== undefined ? { sessionToken: '<REDACTED>' } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function normalizeSupabaseConfig(input: Record<string, unknown>): SupabaseConfig {\n return normalizeFields(input, {\n rename: {\n project_ref: 'projectRef',\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n session_token: 'sessionToken',\n endpoint_url: 'endpoint',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as SupabaseConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAyBzB,SAAS,yBAAyB,QAAgC;AACvE,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,eAAe,UAAa,OAAO,eAAe,IAAI;AAC/D,WAAO,WAAW,OAAO,UAAU;AAAA,EACrC;AACA,QAAM,IAAI,MAAM,gDAAgD;AAClE;AAEO,SAAS,mBAAmB,QAAkC;AACnE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,UAAU,yBAAyB,MAAM;AAAA,IACzC,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,IACxB,gBAAgB;AAAA,IAChB,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,OAAO,aAAa,IAAI,CAAC;AAAA,IACjF,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,qBAAqB,QAAgD;AACnF,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,GAAI,OAAO,eAAe,SAAY,EAAE,YAAY,OAAO,WAAW,IAAI,CAAC;AAAA,IAC3E,UAAU,yBAAyB,MAAM;AAAA,IACzC,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,GAAI,OAAO,iBAAiB,SAAY,EAAE,cAAc,aAAa,IAAI,CAAC;AAAA,IAC1E,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,wBAAwB,OAAgD;AACtF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,aAAa;AAAA,MACb,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,eAAe;AAAA,MACf,cAAc;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS,CAAC,MAAgB,OAAO,MAAM,WAAW,IAAI,MAAO;AAAA,IAC/D;AAAA,IACA,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
redactLangfuseConfig
|
|
3
|
+
} from "./chunk-6M3QVVOH.js";
|
|
4
|
+
|
|
5
|
+
// src/resource/langfuse/langfuse.ts
|
|
6
|
+
import {
|
|
7
|
+
HttpLangfuseTransport,
|
|
8
|
+
LANGFUSE_COMMANDS,
|
|
9
|
+
LANGFUSE_PROMPT,
|
|
10
|
+
LANGFUSE_VFS_OPS,
|
|
11
|
+
LangfuseAccessor,
|
|
12
|
+
langfuseRead,
|
|
13
|
+
langfuseReaddir,
|
|
14
|
+
langfuseStat,
|
|
15
|
+
PathSpec,
|
|
16
|
+
RAMIndexCacheStore,
|
|
17
|
+
ResourceName,
|
|
18
|
+
resolveLangfuseGlob
|
|
19
|
+
} from "@struktoai/mirage-core";
|
|
20
|
+
var LangfuseResource = class {
|
|
21
|
+
kind = ResourceName.LANGFUSE;
|
|
22
|
+
isRemote = true;
|
|
23
|
+
indexTtl = 600;
|
|
24
|
+
prompt = LANGFUSE_PROMPT;
|
|
25
|
+
config;
|
|
26
|
+
accessor;
|
|
27
|
+
index;
|
|
28
|
+
constructor(config) {
|
|
29
|
+
this.config = config;
|
|
30
|
+
const transportOpts = {
|
|
31
|
+
publicKey: config.publicKey,
|
|
32
|
+
secretKey: config.secretKey
|
|
33
|
+
};
|
|
34
|
+
if (config.host !== void 0) transportOpts.host = config.host;
|
|
35
|
+
const accessorConfig = {};
|
|
36
|
+
if (config.defaultTraceLimit !== void 0) {
|
|
37
|
+
accessorConfig.defaultTraceLimit = config.defaultTraceLimit;
|
|
38
|
+
}
|
|
39
|
+
if (config.defaultSearchLimit !== void 0) {
|
|
40
|
+
accessorConfig.defaultSearchLimit = config.defaultSearchLimit;
|
|
41
|
+
}
|
|
42
|
+
if (config.defaultFromTimestamp !== void 0) {
|
|
43
|
+
accessorConfig.defaultFromTimestamp = config.defaultFromTimestamp;
|
|
44
|
+
}
|
|
45
|
+
this.accessor = new LangfuseAccessor(new HttpLangfuseTransport(transportOpts), accessorConfig);
|
|
46
|
+
this.index = new RAMIndexCacheStore({ ttl: this.indexTtl });
|
|
47
|
+
}
|
|
48
|
+
open() {
|
|
49
|
+
return Promise.resolve();
|
|
50
|
+
}
|
|
51
|
+
close() {
|
|
52
|
+
return Promise.resolve();
|
|
53
|
+
}
|
|
54
|
+
commands() {
|
|
55
|
+
return LANGFUSE_COMMANDS;
|
|
56
|
+
}
|
|
57
|
+
ops() {
|
|
58
|
+
return LANGFUSE_VFS_OPS;
|
|
59
|
+
}
|
|
60
|
+
readFile(p) {
|
|
61
|
+
return langfuseRead(this.accessor, p, this.index);
|
|
62
|
+
}
|
|
63
|
+
readdir(p) {
|
|
64
|
+
return langfuseReaddir(this.accessor, p, this.index);
|
|
65
|
+
}
|
|
66
|
+
stat(p) {
|
|
67
|
+
return langfuseStat(this.accessor, p, this.index);
|
|
68
|
+
}
|
|
69
|
+
fingerprint(_p) {
|
|
70
|
+
return Promise.resolve(null);
|
|
71
|
+
}
|
|
72
|
+
glob(paths, prefix = "") {
|
|
73
|
+
const effective = prefix !== "" ? paths.map(
|
|
74
|
+
(p) => p.prefix !== "" ? p : new PathSpec({
|
|
75
|
+
original: p.original,
|
|
76
|
+
directory: p.directory,
|
|
77
|
+
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
78
|
+
resolved: p.resolved,
|
|
79
|
+
prefix
|
|
80
|
+
})
|
|
81
|
+
) : paths;
|
|
82
|
+
return resolveLangfuseGlob(this.accessor, effective, this.index);
|
|
83
|
+
}
|
|
84
|
+
getState() {
|
|
85
|
+
return Promise.resolve({
|
|
86
|
+
type: this.kind,
|
|
87
|
+
needsOverride: true,
|
|
88
|
+
redactedFields: ["secretKey"],
|
|
89
|
+
config: redactLangfuseConfig(this.config)
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
loadState(_state) {
|
|
93
|
+
return Promise.resolve();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
LangfuseResource
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=chunk-DCJQ2PIX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/langfuse/langfuse.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 HttpLangfuseTransport,\n type IndexCacheStore,\n LANGFUSE_COMMANDS,\n LANGFUSE_PROMPT,\n LANGFUSE_VFS_OPS,\n LangfuseAccessor,\n langfuseRead,\n langfuseReaddir,\n langfuseStat,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveLangfuseGlob,\n} from '@struktoai/mirage-core'\nimport { redactLangfuseConfig, type LangfuseConfig, type LangfuseConfigRedacted } from './config.ts'\n\nexport interface LangfuseResourceState {\n type: string\n needsOverride: boolean\n redactedFields: readonly string[]\n config: LangfuseConfigRedacted\n}\n\nexport class LangfuseResource implements Resource {\n readonly kind: string = ResourceName.LANGFUSE\n readonly isRemote: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = LANGFUSE_PROMPT\n readonly config: LangfuseConfig\n readonly accessor: LangfuseAccessor\n readonly index: IndexCacheStore\n\n constructor(config: LangfuseConfig) {\n this.config = config\n const transportOpts: { publicKey: string; secretKey: string; host?: string } = {\n publicKey: config.publicKey,\n secretKey: config.secretKey,\n }\n if (config.host !== undefined) transportOpts.host = config.host\n const accessorConfig: {\n defaultTraceLimit?: number\n defaultSearchLimit?: number\n defaultFromTimestamp?: string\n } = {}\n if (config.defaultTraceLimit !== undefined) {\n accessorConfig.defaultTraceLimit = config.defaultTraceLimit\n }\n if (config.defaultSearchLimit !== undefined) {\n accessorConfig.defaultSearchLimit = config.defaultSearchLimit\n }\n if (config.defaultFromTimestamp !== undefined) {\n accessorConfig.defaultFromTimestamp = config.defaultFromTimestamp\n }\n this.accessor = new LangfuseAccessor(new HttpLangfuseTransport(transportOpts), accessorConfig)\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 LANGFUSE_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return LANGFUSE_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return langfuseRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return langfuseReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return langfuseStat(this.accessor, p, this.index)\n }\n\n fingerprint(_p: PathSpec): Promise<string | null> {\n return Promise.resolve(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 resolveLangfuseGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<LangfuseResourceState> {\n return Promise.resolve({\n type: this.kind,\n needsOverride: true,\n redactedFields: ['secretKey'],\n config: redactLangfuseConfig(this.config),\n })\n }\n\n loadState(_state: LangfuseResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,OACK;AAUA,IAAM,mBAAN,MAA2C;AAAA,EACvC,OAAe,aAAa;AAAA,EAC5B,WAAoB;AAAA,EACpB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAwB;AAClC,SAAK,SAAS;AACd,UAAM,gBAAyE;AAAA,MAC7E,WAAW,OAAO;AAAA,MAClB,WAAW,OAAO;AAAA,IACpB;AACA,QAAI,OAAO,SAAS,OAAW,eAAc,OAAO,OAAO;AAC3D,UAAM,iBAIF,CAAC;AACL,QAAI,OAAO,sBAAsB,QAAW;AAC1C,qBAAe,oBAAoB,OAAO;AAAA,IAC5C;AACA,QAAI,OAAO,uBAAuB,QAAW;AAC3C,qBAAe,qBAAqB,OAAO;AAAA,IAC7C;AACA,QAAI,OAAO,yBAAyB,QAAW;AAC7C,qBAAe,uBAAuB,OAAO;AAAA,IAC/C;AACA,SAAK,WAAW,IAAI,iBAAiB,IAAI,sBAAsB,aAAa,GAAG,cAAc;AAC7F,SAAK,QAAQ,IAAI,mBAAmB,EAAE,KAAK,KAAK,SAAS,CAAC;AAAA,EAC5D;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,YAAY,IAAsC;AAChD,WAAO,QAAQ,QAAQ,IAAI;AAAA,EAC7B;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,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,eAAe;AAAA,MACf,gBAAgB,CAAC,WAAW;AAAA,MAC5B,QAAQ,qBAAqB,KAAK,MAAM;AAAA,IAC1C,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA8C;AACtD,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-EKPH4MMD.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 // Box developer token from https://app.box.com/developers/console (60-min\n // lifetime). When set, the resource skips the OAuth refresh flow and uses\n // this token directly. Useful for first-run / quick exploration.\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;AAuBzB,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,29 @@
|
|
|
1
|
+
// src/resource/ssh/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function redactSshConfig(config) {
|
|
4
|
+
const out = { host: config.host };
|
|
5
|
+
if (config.hostname !== void 0) out.hostname = config.hostname;
|
|
6
|
+
if (config.port !== void 0) out.port = config.port;
|
|
7
|
+
if (config.username !== void 0) out.username = config.username;
|
|
8
|
+
if (config.password !== void 0) out.password = "<REDACTED>";
|
|
9
|
+
if (config.identityFile !== void 0) out.identityFile = config.identityFile;
|
|
10
|
+
if (config.passphrase !== void 0) out.passphrase = "<REDACTED>";
|
|
11
|
+
if (config.root !== void 0) out.root = config.root;
|
|
12
|
+
if (config.timeout !== void 0) out.timeout = config.timeout;
|
|
13
|
+
if (config.knownHosts !== void 0) out.knownHosts = config.knownHosts;
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
function normalizeSshConfig(input) {
|
|
17
|
+
return normalizeFields(input, {
|
|
18
|
+
rename: {
|
|
19
|
+
identity_file: "identityFile",
|
|
20
|
+
known_hosts: "knownHosts"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
redactSshConfig,
|
|
27
|
+
normalizeSshConfig
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-FZ2GJ4BJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/ssh/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 SSHConfig {\n host: string\n hostname?: string\n port?: number\n username?: string\n password?: string\n identityFile?: string\n passphrase?: string\n root?: string\n timeout?: number\n knownHosts?: string\n}\n\nexport interface SSHConfigRedacted {\n host: string\n hostname?: string\n port?: number\n username?: string\n password?: '<REDACTED>'\n identityFile?: string\n passphrase?: '<REDACTED>'\n root?: string\n timeout?: number\n knownHosts?: string\n}\n\nexport function redactSshConfig(config: SSHConfig): SSHConfigRedacted {\n const out: SSHConfigRedacted = { host: config.host }\n if (config.hostname !== undefined) out.hostname = config.hostname\n if (config.port !== undefined) out.port = config.port\n if (config.username !== undefined) out.username = config.username\n if (config.password !== undefined) out.password = '<REDACTED>'\n if (config.identityFile !== undefined) out.identityFile = config.identityFile\n if (config.passphrase !== undefined) out.passphrase = '<REDACTED>'\n if (config.root !== undefined) out.root = config.root\n if (config.timeout !== undefined) out.timeout = config.timeout\n if (config.knownHosts !== undefined) out.knownHosts = config.knownHosts\n return out\n}\n\nexport function normalizeSshConfig(input: Record<string, unknown>): SSHConfig {\n return normalizeFields(input, {\n rename: {\n identity_file: 'identityFile',\n known_hosts: 'knownHosts',\n },\n }) as unknown as SSHConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AA4BzB,SAAS,gBAAgB,QAAsC;AACpE,QAAM,MAAyB,EAAE,MAAM,OAAO,KAAK;AACnD,MAAI,OAAO,aAAa,OAAW,KAAI,WAAW,OAAO;AACzD,MAAI,OAAO,SAAS,OAAW,KAAI,OAAO,OAAO;AACjD,MAAI,OAAO,aAAa,OAAW,KAAI,WAAW,OAAO;AACzD,MAAI,OAAO,aAAa,OAAW,KAAI,WAAW;AAClD,MAAI,OAAO,iBAAiB,OAAW,KAAI,eAAe,OAAO;AACjE,MAAI,OAAO,eAAe,OAAW,KAAI,aAAa;AACtD,MAAI,OAAO,SAAS,OAAW,KAAI,OAAO,OAAO;AACjD,MAAI,OAAO,YAAY,OAAW,KAAI,UAAU,OAAO;AACvD,MAAI,OAAO,eAAe,OAAW,KAAI,aAAa,OAAO;AAC7D,SAAO;AACT;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,eAAe;AAAA,MACf,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AACH;","names":[]}
|