agentlock-shared 0.1.0
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/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-test.log +34 -0
- package/dist/__tests__/content-crypto.test.d.ts +2 -0
- package/dist/__tests__/content-crypto.test.d.ts.map +1 -0
- package/dist/__tests__/content-crypto.test.js +117 -0
- package/dist/__tests__/content-crypto.test.js.map +1 -0
- package/dist/__tests__/crypto.test.d.ts +2 -0
- package/dist/__tests__/crypto.test.d.ts.map +1 -0
- package/dist/__tests__/crypto.test.js +53 -0
- package/dist/__tests__/crypto.test.js.map +1 -0
- package/dist/__tests__/policy.test.d.ts +2 -0
- package/dist/__tests__/policy.test.d.ts.map +1 -0
- package/dist/__tests__/policy.test.js +80 -0
- package/dist/__tests__/policy.test.js.map +1 -0
- package/dist/__tests__/redact.test.d.ts +2 -0
- package/dist/__tests__/redact.test.d.ts.map +1 -0
- package/dist/__tests__/redact.test.js +39 -0
- package/dist/__tests__/redact.test.js.map +1 -0
- package/dist/__tests__/signing.test.d.ts +2 -0
- package/dist/__tests__/signing.test.d.ts.map +1 -0
- package/dist/__tests__/signing.test.js +51 -0
- package/dist/__tests__/signing.test.js.map +1 -0
- package/dist/content-crypto.d.ts +24 -0
- package/dist/content-crypto.d.ts.map +1 -0
- package/dist/content-crypto.js +58 -0
- package/dist/content-crypto.js.map +1 -0
- package/dist/crypto.d.ts +13 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +85 -0
- package/dist/crypto.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-catalog.d.ts +15 -0
- package/dist/mcp-catalog.d.ts.map +1 -0
- package/dist/mcp-catalog.js +160 -0
- package/dist/mcp-catalog.js.map +1 -0
- package/dist/plans.d.ts +24 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +80 -0
- package/dist/plans.js.map +1 -0
- package/dist/policy.d.ts +10 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +168 -0
- package/dist/policy.js.map +1 -0
- package/dist/redact.d.ts +4 -0
- package/dist/redact.d.ts.map +1 -0
- package/dist/redact.js +115 -0
- package/dist/redact.js.map +1 -0
- package/dist/schemas.d.ts +128 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +47 -0
- package/dist/schemas.js.map +1 -0
- package/dist/signing.d.ts +23 -0
- package/dist/signing.d.ts.map +1 -0
- package/dist/signing.js +96 -0
- package/dist/signing.js.map +1 -0
- package/dist/types.d.ts +184 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +29 -0
- package/src/__tests__/policy.test.ts +88 -0
- package/src/__tests__/redact.test.ts +41 -0
- package/src/__tests__/signing.test.ts +55 -0
- package/src/crypto.ts +87 -0
- package/src/index.ts +8 -0
- package/src/mcp-catalog.ts +181 -0
- package/src/plans.ts +96 -0
- package/src/policy.ts +186 -0
- package/src/redact.ts +114 -0
- package/src/schemas.ts +53 -0
- package/src/signing.ts +120 -0
- package/src/types.ts +212 -0
- package/test-gateway.mjs +47 -0
- package/tsconfig.json +10 -0
- package/vitest.config.ts +8 -0
package/dist/crypto.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateKey = generateKey;
|
|
7
|
+
exports.encrypt = encrypt;
|
|
8
|
+
exports.decrypt = decrypt;
|
|
9
|
+
exports.encryptDEK = encryptDEK;
|
|
10
|
+
exports.decryptDEK = decryptDEK;
|
|
11
|
+
exports.getMasterKey = getMasterKey;
|
|
12
|
+
exports.generateMasterKey = generateMasterKey;
|
|
13
|
+
exports.encryptCredential = encryptCredential;
|
|
14
|
+
exports.decryptCredential = decryptCredential;
|
|
15
|
+
const tweetnacl_1 = __importDefault(require("tweetnacl"));
|
|
16
|
+
const tweetnacl_util_1 = require("tweetnacl-util");
|
|
17
|
+
function generateKey() {
|
|
18
|
+
return tweetnacl_1.default.randomBytes(32);
|
|
19
|
+
}
|
|
20
|
+
function encrypt(data, key) {
|
|
21
|
+
const nonce = tweetnacl_1.default.randomBytes(tweetnacl_1.default.secretbox.nonceLength);
|
|
22
|
+
const message = new TextEncoder().encode(data);
|
|
23
|
+
const box = tweetnacl_1.default.secretbox(message, nonce, key);
|
|
24
|
+
const combined = new Uint8Array(nonce.length + box.length);
|
|
25
|
+
combined.set(nonce);
|
|
26
|
+
combined.set(box, nonce.length);
|
|
27
|
+
return (0, tweetnacl_util_1.encodeBase64)(combined);
|
|
28
|
+
}
|
|
29
|
+
function decrypt(encryptedData, key) {
|
|
30
|
+
const combined = (0, tweetnacl_util_1.decodeBase64)(encryptedData);
|
|
31
|
+
const nonce = combined.slice(0, tweetnacl_1.default.secretbox.nonceLength);
|
|
32
|
+
const box = combined.slice(tweetnacl_1.default.secretbox.nonceLength);
|
|
33
|
+
const message = tweetnacl_1.default.secretbox.open(box, nonce, key);
|
|
34
|
+
if (!message) {
|
|
35
|
+
throw new Error('Decryption failed: invalid key or corrupted data');
|
|
36
|
+
}
|
|
37
|
+
return new TextDecoder().decode(message);
|
|
38
|
+
}
|
|
39
|
+
function encryptDEK(dek, masterKey) {
|
|
40
|
+
return encrypt((0, tweetnacl_util_1.encodeBase64)(dek), masterKey);
|
|
41
|
+
}
|
|
42
|
+
function decryptDEK(encryptedDEK, masterKey) {
|
|
43
|
+
const dekBase64 = decrypt(encryptedDEK, masterKey);
|
|
44
|
+
return (0, tweetnacl_util_1.decodeBase64)(dekBase64);
|
|
45
|
+
}
|
|
46
|
+
// Cache the decoded master key to avoid creating multiple copies in memory.
|
|
47
|
+
// A single copy is preferable to many short-lived copies scattered on the heap.
|
|
48
|
+
let _cachedMasterKey = null;
|
|
49
|
+
function getMasterKey() {
|
|
50
|
+
if (_cachedMasterKey)
|
|
51
|
+
return _cachedMasterKey;
|
|
52
|
+
const key = process.env.MASTER_KEY;
|
|
53
|
+
if (!key)
|
|
54
|
+
throw new Error('MASTER_KEY environment variable not set');
|
|
55
|
+
_cachedMasterKey = (0, tweetnacl_util_1.decodeBase64)(key);
|
|
56
|
+
return _cachedMasterKey;
|
|
57
|
+
}
|
|
58
|
+
function generateMasterKey() {
|
|
59
|
+
return (0, tweetnacl_util_1.encodeBase64)(generateKey());
|
|
60
|
+
}
|
|
61
|
+
function encryptCredential(payload, masterKey) {
|
|
62
|
+
const dek = generateKey();
|
|
63
|
+
try {
|
|
64
|
+
const encryptedDEK = encryptDEK(dek, masterKey);
|
|
65
|
+
const encryptedPayload = encrypt(JSON.stringify(payload), dek);
|
|
66
|
+
return { encryptedDEK, encryptedPayload };
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
// Zero DEK from memory after use (defense-in-depth against heap dumps)
|
|
70
|
+
dek.fill(0);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function decryptCredential(encryptedDEK, encryptedPayload, masterKey) {
|
|
74
|
+
const dek = decryptDEK(encryptedDEK, masterKey);
|
|
75
|
+
try {
|
|
76
|
+
const json = decrypt(encryptedPayload, dek);
|
|
77
|
+
return JSON.parse(json);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
// Best-effort: zero DEK from memory to minimize exposure window.
|
|
81
|
+
// Not guaranteed by JS runtime, but reduces risk of heap-dump leaks.
|
|
82
|
+
dek.fill(0);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":";;;;;AAGA,kCAEC;AAED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AE,gBAAgB,EAAE,CAAC;IAC5C,CAAC;YAAS,CAAC;QACT,uEAAuE;QACvE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB,CAC/B,YAAoB,EACpB,gBAAwB,EACxB,SAAqB;IAErB,MAAM,GAAG,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAChD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;YAAS,CAAC;QACT,iEAAiE;QACjE,qEAAqE;QACrE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './crypto.js';
|
|
3
|
+
export * from './signing.js';
|
|
4
|
+
export * from './policy.js';
|
|
5
|
+
export * from './redact.js';
|
|
6
|
+
export * from './schemas.js';
|
|
7
|
+
export * from './plans.js';
|
|
8
|
+
export * from './mcp-catalog.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types.js"), exports);
|
|
18
|
+
__exportStar(require("./crypto.js"), exports);
|
|
19
|
+
__exportStar(require("./signing.js"), exports);
|
|
20
|
+
__exportStar(require("./policy.js"), exports);
|
|
21
|
+
__exportStar(require("./redact.js"), exports);
|
|
22
|
+
__exportStar(require("./schemas.js"), exports);
|
|
23
|
+
__exportStar(require("./plans.js"), exports);
|
|
24
|
+
__exportStar(require("./mcp-catalog.js"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAiC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface McpServerTemplate {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
serverUrl: string;
|
|
6
|
+
authType: 'bearer' | 'none';
|
|
7
|
+
authLabel?: string;
|
|
8
|
+
authPlaceholder?: string;
|
|
9
|
+
authHelpUrl?: string;
|
|
10
|
+
category: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const MCP_CATALOG: McpServerTemplate[];
|
|
13
|
+
export declare const MCP_CATEGORIES: string[];
|
|
14
|
+
export declare function getMcpTemplate(id: string): McpServerTemplate | undefined;
|
|
15
|
+
//# sourceMappingURL=mcp-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-catalog.d.ts","sourceRoot":"","sources":["../src/mcp-catalog.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,EAkK1C,CAAC;AAEF,eAAO,MAAM,cAAc,UAAmD,CAAC;AAE/E,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAExE"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCP_CATEGORIES = exports.MCP_CATALOG = void 0;
|
|
4
|
+
exports.getMcpTemplate = getMcpTemplate;
|
|
5
|
+
exports.MCP_CATALOG = [
|
|
6
|
+
// --- Developer Tools ---
|
|
7
|
+
{
|
|
8
|
+
id: 'github',
|
|
9
|
+
name: 'GitHub',
|
|
10
|
+
description: 'Manage repos, issues, PRs, and code search',
|
|
11
|
+
serverUrl: 'https://api.githubcopilot.com/mcp/',
|
|
12
|
+
authType: 'bearer',
|
|
13
|
+
authLabel: 'Personal Access Token',
|
|
14
|
+
authPlaceholder: 'ghp_...',
|
|
15
|
+
authHelpUrl: 'https://github.com/settings/tokens',
|
|
16
|
+
category: 'Developer Tools',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'gitlab',
|
|
20
|
+
name: 'GitLab',
|
|
21
|
+
description: 'Projects, merge requests, pipelines, and issues',
|
|
22
|
+
serverUrl: 'https://gitlab.com/-/mcp',
|
|
23
|
+
authType: 'bearer',
|
|
24
|
+
authLabel: 'Personal Access Token',
|
|
25
|
+
authPlaceholder: 'glpat-...',
|
|
26
|
+
authHelpUrl: 'https://gitlab.com/-/user_settings/personal_access_tokens',
|
|
27
|
+
category: 'Developer Tools',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'linear',
|
|
31
|
+
name: 'Linear',
|
|
32
|
+
description: 'Issue tracking, projects, and team workflows',
|
|
33
|
+
serverUrl: 'https://mcp.linear.app/sse',
|
|
34
|
+
authType: 'bearer',
|
|
35
|
+
authLabel: 'API Key',
|
|
36
|
+
authPlaceholder: 'lin_api_...',
|
|
37
|
+
authHelpUrl: 'https://linear.app/settings/api',
|
|
38
|
+
category: 'Developer Tools',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'sentry',
|
|
42
|
+
name: 'Sentry',
|
|
43
|
+
description: 'Error tracking, performance monitoring, and alerts',
|
|
44
|
+
serverUrl: 'https://mcp.sentry.dev/sse',
|
|
45
|
+
authType: 'bearer',
|
|
46
|
+
authLabel: 'Auth Token',
|
|
47
|
+
authPlaceholder: 'sntrys_...',
|
|
48
|
+
authHelpUrl: 'https://sentry.io/settings/account/api/auth-tokens/',
|
|
49
|
+
category: 'Developer Tools',
|
|
50
|
+
},
|
|
51
|
+
// --- Cloud & Infrastructure ---
|
|
52
|
+
{
|
|
53
|
+
id: 'cloudflare',
|
|
54
|
+
name: 'Cloudflare',
|
|
55
|
+
description: 'Workers, KV, D1, R2, and DNS management',
|
|
56
|
+
serverUrl: 'https://workers-mcp.cloudflare.com/mcp',
|
|
57
|
+
authType: 'bearer',
|
|
58
|
+
authLabel: 'API Token',
|
|
59
|
+
authPlaceholder: '',
|
|
60
|
+
authHelpUrl: 'https://dash.cloudflare.com/profile/api-tokens',
|
|
61
|
+
category: 'Cloud & Infrastructure',
|
|
62
|
+
},
|
|
63
|
+
// --- Communication ---
|
|
64
|
+
{
|
|
65
|
+
id: 'slack',
|
|
66
|
+
name: 'Slack',
|
|
67
|
+
description: 'Send messages, manage channels, and search conversations',
|
|
68
|
+
serverUrl: 'https://slack.com/api/mcp',
|
|
69
|
+
authType: 'bearer',
|
|
70
|
+
authLabel: 'Bot Token',
|
|
71
|
+
authPlaceholder: 'xoxb-...',
|
|
72
|
+
authHelpUrl: 'https://api.slack.com/apps',
|
|
73
|
+
category: 'Communication',
|
|
74
|
+
},
|
|
75
|
+
// --- Search & Data ---
|
|
76
|
+
{
|
|
77
|
+
id: 'brave-search',
|
|
78
|
+
name: 'Brave Search',
|
|
79
|
+
description: 'Web search, news, and local results',
|
|
80
|
+
serverUrl: 'https://mcp.brave.com/sse',
|
|
81
|
+
authType: 'bearer',
|
|
82
|
+
authLabel: 'API Key',
|
|
83
|
+
authPlaceholder: 'BSA...',
|
|
84
|
+
authHelpUrl: 'https://brave.com/search/api/',
|
|
85
|
+
category: 'Search & Data',
|
|
86
|
+
},
|
|
87
|
+
// --- Productivity ---
|
|
88
|
+
{
|
|
89
|
+
id: 'notion',
|
|
90
|
+
name: 'Notion',
|
|
91
|
+
description: 'Pages, databases, and workspace content',
|
|
92
|
+
serverUrl: 'https://mcp.notion.so/sse',
|
|
93
|
+
authType: 'bearer',
|
|
94
|
+
authLabel: 'Integration Token',
|
|
95
|
+
authPlaceholder: 'ntn_...',
|
|
96
|
+
authHelpUrl: 'https://www.notion.so/my-integrations',
|
|
97
|
+
category: 'Productivity',
|
|
98
|
+
},
|
|
99
|
+
// --- AI & LLMs ---
|
|
100
|
+
{
|
|
101
|
+
id: 'context7',
|
|
102
|
+
name: 'Context7',
|
|
103
|
+
description: 'Up-to-date documentation and code examples for any library',
|
|
104
|
+
serverUrl: 'https://mcp.context7.com/sse',
|
|
105
|
+
authType: 'none',
|
|
106
|
+
category: 'AI & LLMs',
|
|
107
|
+
},
|
|
108
|
+
// --- Databases ---
|
|
109
|
+
{
|
|
110
|
+
id: 'supabase',
|
|
111
|
+
name: 'Supabase',
|
|
112
|
+
description: 'Database queries, auth, storage, and edge functions',
|
|
113
|
+
serverUrl: 'https://mcp.supabase.com/sse',
|
|
114
|
+
authType: 'bearer',
|
|
115
|
+
authLabel: 'Access Token',
|
|
116
|
+
authPlaceholder: 'sbp_...',
|
|
117
|
+
authHelpUrl: 'https://supabase.com/dashboard/account/tokens',
|
|
118
|
+
category: 'Databases',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'neon',
|
|
122
|
+
name: 'Neon',
|
|
123
|
+
description: 'Serverless Postgres — branches, queries, and management',
|
|
124
|
+
serverUrl: 'https://mcp.neon.tech/sse',
|
|
125
|
+
authType: 'bearer',
|
|
126
|
+
authLabel: 'API Key',
|
|
127
|
+
authPlaceholder: '',
|
|
128
|
+
authHelpUrl: 'https://console.neon.tech/app/settings/api-keys',
|
|
129
|
+
category: 'Databases',
|
|
130
|
+
},
|
|
131
|
+
// --- Payments ---
|
|
132
|
+
{
|
|
133
|
+
id: 'stripe',
|
|
134
|
+
name: 'Stripe',
|
|
135
|
+
description: 'Payments, subscriptions, customers, and invoices',
|
|
136
|
+
serverUrl: 'https://mcp.stripe.com/sse',
|
|
137
|
+
authType: 'bearer',
|
|
138
|
+
authLabel: 'Secret Key',
|
|
139
|
+
authPlaceholder: 'sk_...',
|
|
140
|
+
authHelpUrl: 'https://dashboard.stripe.com/apikeys',
|
|
141
|
+
category: 'Payments',
|
|
142
|
+
},
|
|
143
|
+
// --- Monitoring ---
|
|
144
|
+
{
|
|
145
|
+
id: 'grafana',
|
|
146
|
+
name: 'Grafana',
|
|
147
|
+
description: 'Dashboards, alerts, and observability data',
|
|
148
|
+
serverUrl: 'https://mcp.grafana.com/sse',
|
|
149
|
+
authType: 'bearer',
|
|
150
|
+
authLabel: 'Service Account Token',
|
|
151
|
+
authPlaceholder: 'glsa_...',
|
|
152
|
+
authHelpUrl: 'https://grafana.com/docs/grafana/latest/administration/service-accounts/',
|
|
153
|
+
category: 'Monitoring',
|
|
154
|
+
},
|
|
155
|
+
];
|
|
156
|
+
exports.MCP_CATEGORIES = [...new Set(exports.MCP_CATALOG.map((s) => s.category))];
|
|
157
|
+
function getMcpTemplate(id) {
|
|
158
|
+
return exports.MCP_CATALOG.find((s) => s.id === id);
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=mcp-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-catalog.js","sourceRoot":"","sources":["../src/mcp-catalog.ts"],"names":[],"mappings":";;;AAkLA,wCAEC;AAxKY,QAAA,WAAW,GAAwB;IAC9C,0BAA0B;IAC1B;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4CAA4C;QAEzD,SAAS,EAAE,oCAAoC;QAC/C,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,uBAAuB;QAClC,eAAe,EAAE,SAAS;QAC1B,WAAW,EAAE,oCAAoC;QACjD,QAAQ,EAAE,iBAAiB;KAC5B;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,iDAAiD;QAE9D,SAAS,EAAE,0BAA0B;QACrC,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,uBAAuB;QAClC,eAAe,EAAE,WAAW;QAC5B,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,iBAAiB;KAC5B;IACD;QACE,EAAE,EAAE,QAAQ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;QACf,WAAW,EAAE,4CAA4C;QACzD,SAAS,EAAE,6BAA6B;QACxC,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,uBAAuB;QAClC,eAAe,EAAE,UAAU;QAC3B,WAAW,EAAE,0EAA0E;QACvF,QAAQ,EAAE,YAAY;KACvB;CACF,CAAC;AAEW,QAAA,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAE/E,SAAgB,cAAc,CAAC,EAAU;IACvC,OAAO,mBAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/plans.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type PlanId = 'free' | 'pro' | 'team';
|
|
2
|
+
export interface PlanLimits {
|
|
3
|
+
actionsPerMonth: number;
|
|
4
|
+
agents: number;
|
|
5
|
+
credentials: number;
|
|
6
|
+
members: number;
|
|
7
|
+
timelineHistoryDays: number;
|
|
8
|
+
undoEnabled: boolean;
|
|
9
|
+
browserSessions: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PlanDefinition extends PlanLimits {
|
|
12
|
+
id: PlanId;
|
|
13
|
+
name: string;
|
|
14
|
+
monthlyPrice: number;
|
|
15
|
+
yearlyPrice: number;
|
|
16
|
+
stripePriceMonthly: string;
|
|
17
|
+
stripePriceYearly: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const PLANS: Record<PlanId, PlanDefinition>;
|
|
20
|
+
export declare function getPlanLimits(plan: string): PlanLimits;
|
|
21
|
+
export declare function canUndo(plan: string): boolean;
|
|
22
|
+
/** Map a Stripe price ID back to a plan ID */
|
|
23
|
+
export declare function planFromPriceId(priceId: string): PlanId | null;
|
|
24
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA8CvC,CAAC;AAEX,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAYtD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED,8CAA8C;AAC9C,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9D"}
|
package/dist/plans.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PLANS = void 0;
|
|
4
|
+
exports.getPlanLimits = getPlanLimits;
|
|
5
|
+
exports.canUndo = canUndo;
|
|
6
|
+
exports.planFromPriceId = planFromPriceId;
|
|
7
|
+
exports.PLANS = {
|
|
8
|
+
free: {
|
|
9
|
+
id: 'free',
|
|
10
|
+
name: 'Free',
|
|
11
|
+
monthlyPrice: 0,
|
|
12
|
+
yearlyPrice: 0,
|
|
13
|
+
stripePriceMonthly: '',
|
|
14
|
+
stripePriceYearly: '',
|
|
15
|
+
actionsPerMonth: 1000,
|
|
16
|
+
agents: 3,
|
|
17
|
+
credentials: 2,
|
|
18
|
+
members: 1,
|
|
19
|
+
timelineHistoryDays: 14,
|
|
20
|
+
undoEnabled: false,
|
|
21
|
+
browserSessions: 0,
|
|
22
|
+
},
|
|
23
|
+
pro: {
|
|
24
|
+
id: 'pro',
|
|
25
|
+
name: 'Pro',
|
|
26
|
+
monthlyPrice: 900,
|
|
27
|
+
yearlyPrice: 7900,
|
|
28
|
+
stripePriceMonthly: 'price_1T6b3m2NRlIkxMrBZ9bmEDYE',
|
|
29
|
+
stripePriceYearly: 'price_1T6b3m2NRlIkxMrBo2yx01sJ',
|
|
30
|
+
actionsPerMonth: Infinity,
|
|
31
|
+
agents: 10,
|
|
32
|
+
credentials: 25,
|
|
33
|
+
members: 5,
|
|
34
|
+
timelineHistoryDays: 90,
|
|
35
|
+
undoEnabled: true,
|
|
36
|
+
browserSessions: 2,
|
|
37
|
+
},
|
|
38
|
+
team: {
|
|
39
|
+
id: 'team',
|
|
40
|
+
name: 'Team',
|
|
41
|
+
monthlyPrice: 4900,
|
|
42
|
+
yearlyPrice: 41000,
|
|
43
|
+
stripePriceMonthly: 'price_1T6b3n2NRlIkxMrBstkfVECC',
|
|
44
|
+
stripePriceYearly: 'price_1T6b3o2NRlIkxMrBzHoQKPjz',
|
|
45
|
+
actionsPerMonth: Infinity,
|
|
46
|
+
agents: 50,
|
|
47
|
+
credentials: Infinity,
|
|
48
|
+
members: 25,
|
|
49
|
+
timelineHistoryDays: 365,
|
|
50
|
+
undoEnabled: true,
|
|
51
|
+
browserSessions: 5,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
function getPlanLimits(plan) {
|
|
55
|
+
const def = exports.PLANS[plan];
|
|
56
|
+
if (!def)
|
|
57
|
+
return exports.PLANS.free;
|
|
58
|
+
return {
|
|
59
|
+
actionsPerMonth: def.actionsPerMonth,
|
|
60
|
+
agents: def.agents,
|
|
61
|
+
credentials: def.credentials,
|
|
62
|
+
members: def.members,
|
|
63
|
+
timelineHistoryDays: def.timelineHistoryDays,
|
|
64
|
+
undoEnabled: def.undoEnabled,
|
|
65
|
+
browserSessions: def.browserSessions,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function canUndo(plan) {
|
|
69
|
+
return getPlanLimits(plan).undoEnabled;
|
|
70
|
+
}
|
|
71
|
+
/** Map a Stripe price ID back to a plan ID */
|
|
72
|
+
function planFromPriceId(priceId) {
|
|
73
|
+
for (const plan of Object.values(exports.PLANS)) {
|
|
74
|
+
if (plan.stripePriceMonthly === priceId || plan.stripePriceYearly === priceId) {
|
|
75
|
+
return plan.id;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":";;;AAqEA,sCAYC;AAED,0BAEC;AAGD,0CAOC;AA1EY,QAAA,KAAK,GAAmC;IACnD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;QACd,kBAAkB,EAAE,EAAE;QACtB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,IAAI;QACrB,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;QACV,mBAAmB,EAAE,EAAE;QACvB,WAAW,EAAE,KAAK;QAClB,eAAe,EAAE,CAAC;KACnB;IACD,GAAG,EAAE;QACH,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,KAAK;QACX,YAAY,EAAE,GAAG;QACjB,WAAW,EA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,CAAC,aAAK,CAAC,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,kBAAkB,KAAK,OAAO,IAAI,IAAI,CAAC,iBAAiB,KAAK,OAAO,EAAE,CAAC;YAC9E,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/policy.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PolicyRules, AgentActionRequest, PolicyEvaluationResult } from './types.js';
|
|
2
|
+
export declare const DEFAULT_POLICY_RULES: PolicyRules;
|
|
3
|
+
export declare function evaluatePolicy(action: AgentActionRequest, rules: PolicyRules): PolicyEvaluationResult;
|
|
4
|
+
export declare function buildActionPreview(action: AgentActionRequest): {
|
|
5
|
+
summary: string;
|
|
6
|
+
target?: string;
|
|
7
|
+
impact?: string;
|
|
8
|
+
cost_estimate?: number;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EAGvB,MAAM,YAAY,CAAC;AAUpB,eAAO,MAAM,oBAAoB,EAAE,WAgBlC,CAAC;AAEF,wBAAgB,cAAc,CAC5B,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,WAAW,GACjB,sBAAsB,CA+FxB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CA8CA"}
|
package/dist/policy.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_POLICY_RULES = void 0;
|
|
4
|
+
exports.evaluatePolicy = evaluatePolicy;
|
|
5
|
+
exports.buildActionPreview = buildActionPreview;
|
|
6
|
+
const redact_js_1 = require("./redact.js");
|
|
7
|
+
const RISK_MAP = {
|
|
8
|
+
read: 'low',
|
|
9
|
+
write: 'medium',
|
|
10
|
+
financial: 'high',
|
|
11
|
+
admin: 'critical',
|
|
12
|
+
};
|
|
13
|
+
exports.DEFAULT_POLICY_RULES = {
|
|
14
|
+
defaultMode: 'require_approval',
|
|
15
|
+
rules: [
|
|
16
|
+
{ action_type: 'read', decision: 'ALLOW' },
|
|
17
|
+
{ action_type: 'write', decision: 'REQUIRE_APPROVAL' },
|
|
18
|
+
{ action_type: 'financial', decision: 'REQUIRE_APPROVAL' },
|
|
19
|
+
{ action_type: 'admin', decision: 'BLOCK' },
|
|
20
|
+
],
|
|
21
|
+
http: {
|
|
22
|
+
allowedDomains: [],
|
|
23
|
+
allowedMethods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
24
|
+
blockList: [],
|
|
25
|
+
},
|
|
26
|
+
limits: {
|
|
27
|
+
maxActionsPerHour: 100,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
function evaluatePolicy(action, rules) {
|
|
31
|
+
const risk_level = RISK_MAP[action.action_type] ?? 'medium';
|
|
32
|
+
// Browser tools: browser.open always requires approval
|
|
33
|
+
if (action.tool.startsWith('browser.')) {
|
|
34
|
+
if (action.tool === 'browser.open') {
|
|
35
|
+
return {
|
|
36
|
+
decision: 'REQUIRE_APPROVAL',
|
|
37
|
+
risk_level: 'medium',
|
|
38
|
+
reason: 'Browser sessions always require approval to start',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Other browser.* actions with a valid session are handled at the gateway
|
|
42
|
+
// level (auto-approved). If they reach the policy engine without a session,
|
|
43
|
+
// they should be blocked.
|
|
44
|
+
return {
|
|
45
|
+
decision: 'BLOCK',
|
|
46
|
+
risk_level: 'medium',
|
|
47
|
+
reason: 'Browser actions require an active session (use browser.open first)',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// MCP tools: list_tools is a read (low risk), call_tool defers to action_type rules
|
|
51
|
+
if (action.tool === 'mcp.list_tools') {
|
|
52
|
+
return {
|
|
53
|
+
decision: 'ALLOW',
|
|
54
|
+
risk_level: 'low',
|
|
55
|
+
reason: 'MCP tool discovery is read-only',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (action.tool.split('.')[0] === 'http' && rules.http) {
|
|
59
|
+
const url = action.payload.url;
|
|
60
|
+
if (url) {
|
|
61
|
+
try {
|
|
62
|
+
const domain = new URL(url).hostname;
|
|
63
|
+
// Use exact match or proper subdomain match (preceded by a dot)
|
|
64
|
+
// to prevent "not-trusted.com" from matching allowlist entry "trusted.com"
|
|
65
|
+
const matchesDomain = (d, pattern) => d === pattern || d.endsWith('.' + pattern);
|
|
66
|
+
if (rules.http.blockList.some((b) => matchesDomain(domain, b))) {
|
|
67
|
+
return { decision: 'BLOCK', risk_level: 'critical', reason: `Domain ${domain} is in block list` };
|
|
68
|
+
}
|
|
69
|
+
if (rules.http.allowedDomains.length === 0) {
|
|
70
|
+
// No allowlist configured: safe default is REQUIRE_APPROVAL, not ALLOW.
|
|
71
|
+
// This prevents agents from exfiltrating data to arbitrary domains.
|
|
72
|
+
return {
|
|
73
|
+
decision: 'REQUIRE_APPROVAL',
|
|
74
|
+
risk_level,
|
|
75
|
+
reason: 'HTTP allowlist not configured — approval required for all HTTP calls',
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (!rules.http.allowedDomains.some((d) => matchesDomain(domain, d))) {
|
|
79
|
+
return { decision: 'BLOCK', risk_level, reason: `Domain ${domain} not in allowed list` };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return { decision: 'BLOCK', risk_level: 'critical', reason: 'Invalid URL' };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const method = action.payload.method?.toUpperCase();
|
|
87
|
+
if (method && !rules.http.allowedMethods.includes(method)) {
|
|
88
|
+
return { decision: 'BLOCK', risk_level, reason: `HTTP method ${method} not allowed` };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (rules.limits?.maxCostPerAction !== undefined &&
|
|
92
|
+
action.cost_estimate !== undefined &&
|
|
93
|
+
action.cost_estimate > rules.limits.maxCostPerAction) {
|
|
94
|
+
return {
|
|
95
|
+
decision: 'BLOCK',
|
|
96
|
+
risk_level: 'high',
|
|
97
|
+
reason: `Cost estimate ${action.cost_estimate} exceeds limit ${rules.limits.maxCostPerAction}`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// Most specific: tool-specific rule
|
|
101
|
+
let matched = rules.rules.find((r) => r.tool === action.tool);
|
|
102
|
+
// Then action-type rule
|
|
103
|
+
if (!matched)
|
|
104
|
+
matched = rules.rules.find((r) => r.action_type === action.action_type);
|
|
105
|
+
if (matched) {
|
|
106
|
+
return {
|
|
107
|
+
decision: matched.decision,
|
|
108
|
+
risk_level,
|
|
109
|
+
reason: `Matched rule: ${matched.action_type ?? matched.tool}`,
|
|
110
|
+
matched_rule: matched,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const defaultDecision = rules.defaultMode === 'allow' ? 'ALLOW' : rules.defaultMode === 'block' ? 'BLOCK' : 'REQUIRE_APPROVAL';
|
|
114
|
+
return { decision: defaultDecision, risk_level, reason: 'Default policy' };
|
|
115
|
+
}
|
|
116
|
+
function buildActionPreview(action) {
|
|
117
|
+
let summary = `${action.action_type.toUpperCase()} via ${action.tool}`;
|
|
118
|
+
let target;
|
|
119
|
+
if (action.tool.split('.')[0] === 'http') {
|
|
120
|
+
const url = action.payload.url;
|
|
121
|
+
const method = action.payload.method;
|
|
122
|
+
if (url) {
|
|
123
|
+
try {
|
|
124
|
+
target = new URL(url).hostname;
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
target = url;
|
|
128
|
+
}
|
|
129
|
+
summary = `${method?.toUpperCase() ?? 'HTTP'} request to ${target}`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (action.tool === 'browser.open') {
|
|
133
|
+
const url = action.payload.url;
|
|
134
|
+
if (url) {
|
|
135
|
+
try {
|
|
136
|
+
target = new URL(url).hostname;
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
target = url;
|
|
140
|
+
}
|
|
141
|
+
summary = `Open browser session to ${target}`;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
summary = 'Open browser session';
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (action.tool === 'mcp.list_tools') {
|
|
148
|
+
const server = action.payload.server;
|
|
149
|
+
target = server;
|
|
150
|
+
summary = `List available tools on MCP server "${server ?? 'unknown'}"`;
|
|
151
|
+
}
|
|
152
|
+
else if (action.tool === 'mcp.call_tool') {
|
|
153
|
+
const server = action.payload.server;
|
|
154
|
+
const method = action.payload.method;
|
|
155
|
+
target = server;
|
|
156
|
+
summary = `Call "${method ?? 'unknown'}" on MCP server "${server ?? 'unknown'}"`;
|
|
157
|
+
}
|
|
158
|
+
else if (action.tool === 'demo') {
|
|
159
|
+
summary = `Write to demo table: ${JSON.stringify((0, redact_js_1.redact)(action.payload)).slice(0, 80)}`;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
summary,
|
|
163
|
+
target,
|
|
164
|
+
impact: action.action_type === 'write' ? 'Data will be modified' : undefined,
|
|
165
|
+
cost_estimate: action.cost_estimate,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":";;;AAkCA,wCAkGC;AAED,gDAmDC;AAlLD,2CAAqC;AAErC,MAAM,QAAQ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AE,MAAM,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS;QAC5E,aAAa,EAAE,MAAM,CAAC,aAAa;KACpC,CAAC;AACJ,CAAC"}
|
package/dist/redact.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function redact(obj: unknown, depth?: number): unknown;
|
|
2
|
+
export declare function redactHeaders(headers: Record<string, string>): Record<string, string>;
|
|
3
|
+
export declare function sanitizeActionRequest(request: Record<string, unknown>): Record<string, unknown>;
|
|
4
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AAuFA,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,OAAO,CAYvD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMrF;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB"}
|