@guardion/guardion 0.2.0 → 0.3.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/config.yaml.example +72 -14
- package/dist/cli.js +112 -103
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +119 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +72 -25
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +8 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +18 -8
- package/dist/constants.js.map +1 -1
- package/dist/installer.d.ts +2 -1
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +84 -31
- package/dist/installer.js.map +1 -1
- package/dist/keychain.d.ts.map +1 -1
- package/dist/keychain.js +53 -15
- package/dist/keychain.js.map +1 -1
- package/dist/mock-server.d.ts.map +1 -1
- package/dist/mock-server.js +19 -4
- package/dist/mock-server.js.map +1 -1
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js.map +1 -1
- package/hooks/guardion-hook.cjs +105 -74
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,28 +1,143 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
declare const GatewaySchema: z.ZodObject<{
|
|
3
|
+
/** Base URL of the Guardion gateway container / cloud endpoint */
|
|
4
|
+
url: z.ZodDefault<z.ZodString>;
|
|
5
|
+
/** MCP proxy base URL */
|
|
6
|
+
mcp_url: z.ZodDefault<z.ZodString>;
|
|
7
|
+
/** LLM provider the gateway will forward to */
|
|
8
|
+
provider: z.ZodDefault<z.ZodEnum<["anthropic", "vertex-ai", "bedrock", "openai"]>>;
|
|
9
|
+
/** Vertex AI only */
|
|
10
|
+
vertex_project_id: z.ZodDefault<z.ZodString>;
|
|
11
|
+
vertex_region: z.ZodDefault<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
url: string;
|
|
14
|
+
mcp_url: string;
|
|
15
|
+
provider: "anthropic" | "vertex-ai" | "bedrock" | "openai";
|
|
16
|
+
vertex_project_id: string;
|
|
17
|
+
vertex_region: string;
|
|
18
|
+
}, {
|
|
19
|
+
url?: string | undefined;
|
|
20
|
+
mcp_url?: string | undefined;
|
|
21
|
+
provider?: "anthropic" | "vertex-ai" | "bedrock" | "openai" | undefined;
|
|
22
|
+
vertex_project_id?: string | undefined;
|
|
23
|
+
vertex_region?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
declare const HooksConfigSchema: z.ZodObject<{
|
|
26
|
+
/**
|
|
27
|
+
* Subset of Claude Code hook events to register.
|
|
28
|
+
* Defaults to all supported events when omitted.
|
|
29
|
+
* Security teams can narrow this list via MDM config.
|
|
30
|
+
*/
|
|
31
|
+
events: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
/** Milliseconds to wait for Guard API before giving up (fire-and-forget) */
|
|
33
|
+
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
events: string[];
|
|
36
|
+
timeout_ms: number;
|
|
37
|
+
}, {
|
|
38
|
+
events?: string[] | undefined;
|
|
39
|
+
timeout_ms?: number | undefined;
|
|
40
|
+
}>;
|
|
2
41
|
declare const ConfigSchema: z.ZodObject<{
|
|
3
42
|
version: z.ZodLiteral<1>;
|
|
4
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Deployment tier:
|
|
45
|
+
* hooks — fire-and-forget hook events to Guard API, no LLM proxy
|
|
46
|
+
* full — route all LLM traffic through Guardion gateway + hook events
|
|
47
|
+
*/
|
|
48
|
+
tier: z.ZodEnum<["hooks", "full"]>;
|
|
49
|
+
/** Guard API base URL */
|
|
5
50
|
api_url: z.ZodString;
|
|
51
|
+
/** Policy slug to evaluate hook events against */
|
|
6
52
|
policy: z.ZodString;
|
|
53
|
+
/** Application label attached to every event in the console */
|
|
7
54
|
application: z.ZodString;
|
|
55
|
+
/** Gateway proxy settings (full tier only) */
|
|
56
|
+
gateway: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
/** Base URL of the Guardion gateway container / cloud endpoint */
|
|
58
|
+
url: z.ZodDefault<z.ZodString>;
|
|
59
|
+
/** MCP proxy base URL */
|
|
60
|
+
mcp_url: z.ZodDefault<z.ZodString>;
|
|
61
|
+
/** LLM provider the gateway will forward to */
|
|
62
|
+
provider: z.ZodDefault<z.ZodEnum<["anthropic", "vertex-ai", "bedrock", "openai"]>>;
|
|
63
|
+
/** Vertex AI only */
|
|
64
|
+
vertex_project_id: z.ZodDefault<z.ZodString>;
|
|
65
|
+
vertex_region: z.ZodDefault<z.ZodString>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
url: string;
|
|
68
|
+
mcp_url: string;
|
|
69
|
+
provider: "anthropic" | "vertex-ai" | "bedrock" | "openai";
|
|
70
|
+
vertex_project_id: string;
|
|
71
|
+
vertex_region: string;
|
|
72
|
+
}, {
|
|
73
|
+
url?: string | undefined;
|
|
74
|
+
mcp_url?: string | undefined;
|
|
75
|
+
provider?: "anthropic" | "vertex-ai" | "bedrock" | "openai" | undefined;
|
|
76
|
+
vertex_project_id?: string | undefined;
|
|
77
|
+
vertex_region?: string | undefined;
|
|
78
|
+
}>>;
|
|
79
|
+
/** Hook event configuration */
|
|
80
|
+
hooks: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
/**
|
|
82
|
+
* Subset of Claude Code hook events to register.
|
|
83
|
+
* Defaults to all supported events when omitted.
|
|
84
|
+
* Security teams can narrow this list via MDM config.
|
|
85
|
+
*/
|
|
86
|
+
events: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
87
|
+
/** Milliseconds to wait for Guard API before giving up (fire-and-forget) */
|
|
88
|
+
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
events: string[];
|
|
91
|
+
timeout_ms: number;
|
|
92
|
+
}, {
|
|
93
|
+
events?: string[] | undefined;
|
|
94
|
+
timeout_ms?: number | undefined;
|
|
95
|
+
}>>;
|
|
8
96
|
}, "strip", z.ZodTypeAny, {
|
|
9
97
|
version: 1;
|
|
10
|
-
tier: "hooks";
|
|
98
|
+
tier: "hooks" | "full";
|
|
11
99
|
api_url: string;
|
|
12
100
|
policy: string;
|
|
13
101
|
application: string;
|
|
102
|
+
hooks?: {
|
|
103
|
+
events: string[];
|
|
104
|
+
timeout_ms: number;
|
|
105
|
+
} | undefined;
|
|
106
|
+
gateway?: {
|
|
107
|
+
url: string;
|
|
108
|
+
mcp_url: string;
|
|
109
|
+
provider: "anthropic" | "vertex-ai" | "bedrock" | "openai";
|
|
110
|
+
vertex_project_id: string;
|
|
111
|
+
vertex_region: string;
|
|
112
|
+
} | undefined;
|
|
14
113
|
}, {
|
|
15
114
|
version: 1;
|
|
16
|
-
tier: "hooks";
|
|
115
|
+
tier: "hooks" | "full";
|
|
17
116
|
api_url: string;
|
|
18
117
|
policy: string;
|
|
19
118
|
application: string;
|
|
119
|
+
hooks?: {
|
|
120
|
+
events?: string[] | undefined;
|
|
121
|
+
timeout_ms?: number | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
gateway?: {
|
|
124
|
+
url?: string | undefined;
|
|
125
|
+
mcp_url?: string | undefined;
|
|
126
|
+
provider?: "anthropic" | "vertex-ai" | "bedrock" | "openai" | undefined;
|
|
127
|
+
vertex_project_id?: string | undefined;
|
|
128
|
+
vertex_region?: string | undefined;
|
|
129
|
+
} | undefined;
|
|
20
130
|
}>;
|
|
21
131
|
export type GuardionConfig = z.infer<typeof ConfigSchema>;
|
|
132
|
+
export type GatewayConfig = z.infer<typeof GatewaySchema>;
|
|
133
|
+
export type HooksConfig = z.infer<typeof HooksConfigSchema>;
|
|
134
|
+
export declare const DEFAULT_GATEWAY: GatewayConfig;
|
|
135
|
+
export declare const DEFAULT_HOOKS_CONFIG: HooksConfig;
|
|
22
136
|
export declare const DEFAULT_CONFIG: GuardionConfig;
|
|
137
|
+
/** Resolved hooks events — falls back to all events when not configured */
|
|
138
|
+
export declare function resolvedHookEvents(cfg: GuardionConfig): readonly string[];
|
|
23
139
|
export declare function readConfig(): GuardionConfig | null;
|
|
24
140
|
export declare function readConfigOrDefault(): GuardionConfig;
|
|
25
141
|
export declare function writeConfig(cfg: GuardionConfig): void;
|
|
26
|
-
export declare function devConfig(overrides?: Partial<GuardionConfig>): GuardionConfig;
|
|
27
142
|
export {};
|
|
28
143
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,QAAA,MAAM,aAAa;IACjB,kEAAkE;;IAElE,yBAAyB;;IAEzB,+CAA+C;;IAE/C,qBAAqB;;;;;;;;;;;;;;;EAGrB,CAAC;AAEH,QAAA,MAAM,iBAAiB;IACrB;;;;OAIG;;IAEH,4EAA4E;;;;;;;;EAE5E,CAAC;AAIH,QAAA,MAAM,YAAY;;IAEhB;;;;OAIG;;IAEH,yBAAyB;;IAEzB,kDAAkD;;IAElD,+DAA+D;;IAE/D,8CAA8C;;QAtC9C,kEAAkE;;QAElE,yBAAyB;;QAEzB,+CAA+C;;QAE/C,qBAAqB;;;;;;;;;;;;;;;;IAkCrB,+BAA+B;;QA5B/B;;;;WAIG;;QAEH,4EAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB5E,CAAC;AAEH,MAAM,MAAM,cAAc,GAAK,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAM,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAIjE,eAAO,MAAM,eAAe,EAAE,aAM7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAGlC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAM5B,CAAC;AAEF,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,SAAS,MAAM,EAAE,CAKzE;AAID,wBAAgB,UAAU,IAAI,cAAc,GAAG,IAAI,CASlD;AAED,wBAAgB,mBAAmB,IAAI,cAAc,CAEpD;AAID,wBAAgB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CAerD"}
|
package/dist/config.js
CHANGED
|
@@ -1,15 +1,61 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import yaml from 'js-yaml';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { GUARDION_DIR, CONFIG_YAML_PATH, CONFIG_JSON_PATH, DEFAULT_API_URL, } from './constants.js';
|
|
5
|
-
// ──
|
|
4
|
+
import { GUARDION_DIR, CONFIG_YAML_PATH, CONFIG_JSON_PATH, DEFAULT_API_URL, DEFAULT_GATEWAY_URL, DEFAULT_MCP_URL, ALL_HOOK_EVENTS, } from './constants.js';
|
|
5
|
+
// ── Sub-schemas ───────────────────────────────────────────────────────────────
|
|
6
|
+
const GatewaySchema = z.object({
|
|
7
|
+
/** Base URL of the Guardion gateway container / cloud endpoint */
|
|
8
|
+
url: z.string().url().default(DEFAULT_GATEWAY_URL),
|
|
9
|
+
/** MCP proxy base URL */
|
|
10
|
+
mcp_url: z.string().url().default(DEFAULT_MCP_URL),
|
|
11
|
+
/** LLM provider the gateway will forward to */
|
|
12
|
+
provider: z.enum(['anthropic', 'vertex-ai', 'bedrock', 'openai']).default('anthropic'),
|
|
13
|
+
/** Vertex AI only */
|
|
14
|
+
vertex_project_id: z.string().default(''),
|
|
15
|
+
vertex_region: z.string().default(''),
|
|
16
|
+
});
|
|
17
|
+
const HooksConfigSchema = z.object({
|
|
18
|
+
/**
|
|
19
|
+
* Subset of Claude Code hook events to register.
|
|
20
|
+
* Defaults to all supported events when omitted.
|
|
21
|
+
* Security teams can narrow this list via MDM config.
|
|
22
|
+
*/
|
|
23
|
+
events: z.array(z.string()).default([...ALL_HOOK_EVENTS]),
|
|
24
|
+
/** Milliseconds to wait for Guard API before giving up (fire-and-forget) */
|
|
25
|
+
timeout_ms: z.number().int().positive().default(3000),
|
|
26
|
+
});
|
|
27
|
+
// ── Root schema ───────────────────────────────────────────────────────────────
|
|
6
28
|
const ConfigSchema = z.object({
|
|
7
29
|
version: z.literal(1),
|
|
8
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Deployment tier:
|
|
32
|
+
* hooks — fire-and-forget hook events to Guard API, no LLM proxy
|
|
33
|
+
* full — route all LLM traffic through Guardion gateway + hook events
|
|
34
|
+
*/
|
|
35
|
+
tier: z.enum(['hooks', 'full']),
|
|
36
|
+
/** Guard API base URL */
|
|
9
37
|
api_url: z.string().url(),
|
|
38
|
+
/** Policy slug to evaluate hook events against */
|
|
10
39
|
policy: z.string().min(1),
|
|
40
|
+
/** Application label attached to every event in the console */
|
|
11
41
|
application: z.string().min(1),
|
|
42
|
+
/** Gateway proxy settings (full tier only) */
|
|
43
|
+
gateway: GatewaySchema.optional(),
|
|
44
|
+
/** Hook event configuration */
|
|
45
|
+
hooks: HooksConfigSchema.optional(),
|
|
12
46
|
});
|
|
47
|
+
// ── Defaults ──────────────────────────────────────────────────────────────────
|
|
48
|
+
export const DEFAULT_GATEWAY = {
|
|
49
|
+
url: DEFAULT_GATEWAY_URL,
|
|
50
|
+
mcp_url: DEFAULT_MCP_URL,
|
|
51
|
+
provider: 'anthropic',
|
|
52
|
+
vertex_project_id: '',
|
|
53
|
+
vertex_region: '',
|
|
54
|
+
};
|
|
55
|
+
export const DEFAULT_HOOKS_CONFIG = {
|
|
56
|
+
events: [...ALL_HOOK_EVENTS],
|
|
57
|
+
timeout_ms: 3000,
|
|
58
|
+
};
|
|
13
59
|
export const DEFAULT_CONFIG = {
|
|
14
60
|
version: 1,
|
|
15
61
|
tier: 'hooks',
|
|
@@ -17,16 +63,25 @@ export const DEFAULT_CONFIG = {
|
|
|
17
63
|
policy: 'prompt-defense',
|
|
18
64
|
application: 'claude-code',
|
|
19
65
|
};
|
|
66
|
+
/** Resolved hooks events — falls back to all events when not configured */
|
|
67
|
+
export function resolvedHookEvents(cfg) {
|
|
68
|
+
const events = cfg.hooks?.events;
|
|
69
|
+
if (!events || events.length === 0)
|
|
70
|
+
return ALL_HOOK_EVENTS;
|
|
71
|
+
// Filter to only known events to prevent config injection
|
|
72
|
+
return events.filter(e => ALL_HOOK_EVENTS.includes(e));
|
|
73
|
+
}
|
|
20
74
|
// ── Read ──────────────────────────────────────────────────────────────────────
|
|
21
75
|
export function readConfig() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
76
|
+
for (const p of [CONFIG_YAML_PATH, CONFIG_YAML_PATH.replace('.yaml', '.json')]) {
|
|
77
|
+
try {
|
|
78
|
+
const raw = fs.readFileSync(p, 'utf-8');
|
|
79
|
+
const parsed = p.endsWith('.json') ? JSON.parse(raw) : yaml.load(raw);
|
|
80
|
+
return ConfigSchema.parse(parsed);
|
|
81
|
+
}
|
|
82
|
+
catch { /* try next */ }
|
|
29
83
|
}
|
|
84
|
+
return null;
|
|
30
85
|
}
|
|
31
86
|
export function readConfigOrDefault() {
|
|
32
87
|
return readConfig() ?? DEFAULT_CONFIG;
|
|
@@ -35,25 +90,17 @@ export function readConfigOrDefault() {
|
|
|
35
90
|
export function writeConfig(cfg) {
|
|
36
91
|
const validated = ConfigSchema.parse(cfg);
|
|
37
92
|
fs.mkdirSync(GUARDION_DIR, { recursive: true });
|
|
38
|
-
//
|
|
39
|
-
const
|
|
40
|
-
'# Guardion config — generated by `npx guardion init`',
|
|
41
|
-
|
|
93
|
+
// Human-editable YAML
|
|
94
|
+
const header = [
|
|
95
|
+
'# Guardion config — edit freely, generated by `npx guardion init`',
|
|
96
|
+
'# Token is stored in your OS keychain, not here.',
|
|
97
|
+
'# Docs: https://guardion.ai/docs/claude-code',
|
|
42
98
|
'',
|
|
43
|
-
yaml.dump(validated, { indent: 2 }),
|
|
44
99
|
].join('\n');
|
|
45
|
-
writeAtomic(CONFIG_YAML_PATH,
|
|
46
|
-
//
|
|
100
|
+
writeAtomic(CONFIG_YAML_PATH, header + yaml.dump(validated, { indent: 2 }));
|
|
101
|
+
// JSON for the CJS hook (zero-dep, no YAML parser)
|
|
47
102
|
writeAtomic(CONFIG_JSON_PATH, JSON.stringify(validated, null, 2) + '\n');
|
|
48
103
|
}
|
|
49
|
-
// ── Dev helper ────────────────────────────────────────────────────────────────
|
|
50
|
-
export function devConfig(overrides = {}) {
|
|
51
|
-
return {
|
|
52
|
-
...DEFAULT_CONFIG,
|
|
53
|
-
api_url: 'http://localhost:8082',
|
|
54
|
-
...overrides,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
104
|
// ── Atomic write ──────────────────────────────────────────────────────────────
|
|
58
105
|
function writeAtomic(filePath, content) {
|
|
59
106
|
const tmp = filePath + '.tmp';
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAQ,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAQ,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAO,SAAS,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,eA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;AAEjF,SAAS,WAAW,CAAC,QAAgB,EAAE,OAAe;IACpD,MAAM,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9B,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACxC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const GUARDION_VERSION = "0.
|
|
1
|
+
export declare const GUARDION_VERSION = "0.3.0";
|
|
2
2
|
export declare const TOKEN_PREFIX = "grd_";
|
|
3
3
|
export declare const BACKUP_KEEP = 5;
|
|
4
4
|
export declare const DEFAULT_API_URL = "https://api.guardion.ai";
|
|
@@ -21,6 +21,11 @@ export declare const CLAUDE_SETTINGS_PATH: string;
|
|
|
21
21
|
export declare const BACKUP_SUFFIX = ".guardion";
|
|
22
22
|
export declare const KEYCHAIN_SERVICE = "guardion";
|
|
23
23
|
export declare const KEYCHAIN_ACCOUNT = "token";
|
|
24
|
-
export declare const
|
|
25
|
-
export type HookEvent = (typeof
|
|
24
|
+
export declare const ALL_HOOK_EVENTS: readonly ["SessionStart", "SessionEnd", "UserPromptSubmit", "PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "SubagentStart", "SubagentStop", "Stop", "StopFailure", "PermissionDenied"];
|
|
25
|
+
export type HookEvent = (typeof ALL_HOOK_EVENTS)[number];
|
|
26
|
+
export declare const HEADER_API_KEY = "x-guardion-api-key";
|
|
27
|
+
export declare const HEADER_PROVIDER = "x-guardion-provider";
|
|
28
|
+
export declare const HEADER_POLICY = "x-guardion-policy";
|
|
29
|
+
export declare const HEADER_TRACE_ID = "x-guardion-trace-id";
|
|
30
|
+
export declare const HEADER_METADATA = "x-guardion-metadata";
|
|
26
31
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,YAAY,SAAa,CAAC;AACvC,eAAO,MAAM,WAAW,IAAS,CAAC;AAGlC,eAAO,MAAM,eAAe,4BAAgC,CAAC;AAC7D,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,4BAAgC,CAAC;AAG7D,eAAO,MAAM,WAAW,0BAA8B,CAAC;AACvD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AACvD,eAAO,MAAM,WAAW,8BAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,YAAY,SAAa,CAAC;AACvC,eAAO,MAAM,WAAW,IAAS,CAAC;AAGlC,eAAO,MAAM,eAAe,4BAAgC,CAAC;AAC7D,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AACjE,eAAO,MAAM,eAAe,4BAAgC,CAAC;AAG7D,eAAO,MAAM,WAAW,0BAA8B,CAAC;AACvD,eAAO,MAAM,eAAe,0BAA0B,CAAC;AACvD,eAAO,MAAM,WAAW,8BAAkC,CAAC;AAG3D,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,WAAW,YAAiB,CAAC;AAG1C,eAAO,MAAM,QAAQ,QAA2B,CAAC;AACjD,eAAO,MAAM,YAAY,QAA2C,CAAC;AACrE,eAAO,MAAM,gBAAgB,QAA6C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAA6C,CAAC;AAC3E,eAAO,MAAM,eAAe,QAAwC,CAAC;AACrE,eAAO,MAAM,kBAAkB,8BAAgC,CAAC;AAChE,eAAO,MAAM,iBAAiB,wBAA2B,CAAC;AAE1D,eAAO,MAAM,UAAU,QAA2C,CAAC;AACnE,eAAO,MAAM,oBAAoB,QAAyC,CAAC;AAC3E,eAAO,MAAM,aAAa,cAAqB,CAAC;AAGhD,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAC3C,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAKxC,eAAO,MAAM,eAAe,6MAalB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAGzD,eAAO,MAAM,cAAc,uBAAyB,CAAC;AACrD,eAAO,MAAM,eAAe,wBAAyB,CAAC;AACtD,eAAO,MAAM,aAAa,sBAAyB,CAAC;AACpD,eAAO,MAAM,eAAe,wBAAyB,CAAC;AACtD,eAAO,MAAM,eAAe,wBAAyB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import os from 'node:os';
|
|
3
|
-
export const GUARDION_VERSION = '0.
|
|
3
|
+
export const GUARDION_VERSION = '0.3.0';
|
|
4
4
|
export const TOKEN_PREFIX = 'grd_';
|
|
5
5
|
export const BACKUP_KEEP = 5;
|
|
6
|
-
// Production URLs
|
|
6
|
+
// ── Production URLs ───────────────────────────────────────────────────────────
|
|
7
7
|
export const DEFAULT_API_URL = 'https://api.guardion.ai';
|
|
8
8
|
export const DEFAULT_GATEWAY_URL = 'https://gateway.guardion.ai';
|
|
9
9
|
export const DEFAULT_MCP_URL = 'https://mcp.guardion.ai';
|
|
10
|
-
// Local dev (
|
|
11
|
-
export const DEV_API_URL = 'http://localhost:8082';
|
|
12
|
-
export const DEV_GATEWAY_URL = 'http://localhost:8788';
|
|
10
|
+
// ── Local dev (Docker stack) ──────────────────────────────────────────────────
|
|
11
|
+
export const DEV_API_URL = 'http://localhost:8082'; // guardion-guard
|
|
12
|
+
export const DEV_GATEWAY_URL = 'http://localhost:8788'; // guardion-gateway
|
|
13
13
|
export const DEV_MCP_URL = 'http://localhost:8082/mcp';
|
|
14
|
+
// ── Endpoint paths ────────────────────────────────────────────────────────────
|
|
14
15
|
export const HOOK_EVENTS_PATH = '/v1/hooks/events';
|
|
15
16
|
export const HEALTH_PATH = '/health';
|
|
16
|
-
// Filesystem paths
|
|
17
|
+
// ── Filesystem paths ──────────────────────────────────────────────────────────
|
|
17
18
|
export const HOME_DIR = os.homedir();
|
|
18
19
|
export const GUARDION_DIR = path.join(HOME_DIR, '.guardion');
|
|
19
20
|
export const CONFIG_YAML_PATH = path.join(GUARDION_DIR, 'config.yaml');
|
|
@@ -24,10 +25,13 @@ export const SYSTEM_TOKEN_PATH = '/etc/guardion/token';
|
|
|
24
25
|
export const CLAUDE_DIR = path.join(HOME_DIR, '.claude');
|
|
25
26
|
export const CLAUDE_SETTINGS_PATH = path.join(CLAUDE_DIR, 'settings.json');
|
|
26
27
|
export const BACKUP_SUFFIX = '.guardion';
|
|
28
|
+
// ── Keychain ──────────────────────────────────────────────────────────────────
|
|
27
29
|
export const KEYCHAIN_SERVICE = 'guardion';
|
|
28
30
|
export const KEYCHAIN_ACCOUNT = 'token';
|
|
29
|
-
// Hook events
|
|
30
|
-
|
|
31
|
+
// ── Hook events ───────────────────────────────────────────────────────────────
|
|
32
|
+
// Complete list of Claude Code hook events Guardion can register.
|
|
33
|
+
// The active subset is controlled by config.yaml hooks.events.
|
|
34
|
+
export const ALL_HOOK_EVENTS = [
|
|
31
35
|
'SessionStart',
|
|
32
36
|
'SessionEnd',
|
|
33
37
|
'UserPromptSubmit',
|
|
@@ -41,4 +45,10 @@ export const HOOK_EVENTS = [
|
|
|
41
45
|
'StopFailure',
|
|
42
46
|
'PermissionDenied',
|
|
43
47
|
];
|
|
48
|
+
// ── Gateway header names ──────────────────────────────────────────────────────
|
|
49
|
+
export const HEADER_API_KEY = 'x-guardion-api-key';
|
|
50
|
+
export const HEADER_PROVIDER = 'x-guardion-provider';
|
|
51
|
+
export const HEADER_POLICY = 'x-guardion-policy';
|
|
52
|
+
export const HEADER_TRACE_ID = 'x-guardion-trace-id';
|
|
53
|
+
export const HEADER_METADATA = 'x-guardion-metadata';
|
|
44
54
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAQ,SAAS,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAO,MAAM,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAQ,CAAC,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAQ,SAAS,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAO,MAAM,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAQ,CAAC,CAAC;AAElC,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAO,yBAAyB,CAAC;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AACjE,MAAM,CAAC,MAAM,eAAe,GAAO,yBAAyB,CAAC;AAE7D,iFAAiF;AACjF,MAAM,CAAC,MAAM,WAAW,GAAO,uBAAuB,CAAC,CAAG,iBAAiB;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAAC,CAAG,mBAAmB;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAO,2BAA2B,CAAC;AAE3D,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,WAAW,GAAQ,SAAS,CAAC;AAE1C,iF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,GAAI,qBAAqB,CAAC;AACtD,MAAM,CAAC,MAAM,aAAa,GAAM,mBAAmB,CAAC;AACpD,MAAM,CAAC,MAAM,eAAe,GAAI,qBAAqB,CAAC;AACtD,MAAM,CAAC,MAAM,eAAe,GAAI,qBAAqB,CAAC"}
|
package/dist/installer.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ClaudeSettings, ScanResult } from './scanner.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type GuardionConfig } from './config.js';
|
|
3
3
|
export interface PatchOptions {
|
|
4
4
|
config: GuardionConfig;
|
|
5
|
+
token: string;
|
|
5
6
|
dev?: boolean;
|
|
6
7
|
dryRun?: boolean;
|
|
7
8
|
}
|
package/dist/installer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,aAAa,CAAC;AAwGrB,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAG,cAAc,CAAC;IACxB,KAAK,EAAI,MAAM,CAAC;IAChB,GAAG,CAAC,EAAK,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,GAAG,cAAc,CAmB1E;AAID,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAM9E;AAID,wBAAgB,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO1D;AAmBD,wBAAgB,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgB3D;AAID,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAmC9E"}
|
package/dist/installer.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { BACKUP_SUFFIX, BACKUP_KEEP,
|
|
5
|
-
|
|
4
|
+
import { BACKUP_SUFFIX, BACKUP_KEEP, HEADER_API_KEY, HEADER_PROVIDER, HEADER_POLICY, } from './constants.js';
|
|
5
|
+
import { DEFAULT_GATEWAY, resolvedHookEvents, } from './config.js';
|
|
6
|
+
// Production hook command — scoped npm package, works everywhere
|
|
6
7
|
const HOOK_COMMAND_NPX = 'npx --yes @guardion/guardion hook';
|
|
7
|
-
// Resolve
|
|
8
|
-
// Works from both src/ (tsx) and dist/ (compiled) layouts.
|
|
8
|
+
// Resolve absolute path to the CJS hook for local dev (no npm needed)
|
|
9
9
|
function resolveLocalHookPath() {
|
|
10
10
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
const candidates = [
|
|
@@ -18,36 +18,83 @@ function resolveLocalHookPath() {
|
|
|
18
18
|
}
|
|
19
19
|
return candidates[0];
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
for (const event of
|
|
29
|
-
|
|
30
|
-
matcher: '',
|
|
31
|
-
hooks: [{ type: 'command', command }],
|
|
32
|
-
}];
|
|
21
|
+
function hookCommand(dev) {
|
|
22
|
+
return dev ? `node ${resolveLocalHookPath()}` : HOOK_COMMAND_NPX;
|
|
23
|
+
}
|
|
24
|
+
function buildHooks(cfg, dev) {
|
|
25
|
+
const command = hookCommand(dev);
|
|
26
|
+
const events = resolvedHookEvents(cfg);
|
|
27
|
+
const result = {};
|
|
28
|
+
for (const event of events) {
|
|
29
|
+
result[event] = [{ matcher: '', hooks: [{ type: 'command', command }] }];
|
|
33
30
|
}
|
|
34
|
-
return
|
|
31
|
+
return result;
|
|
35
32
|
}
|
|
36
|
-
// ── Env block
|
|
37
|
-
function buildEnv(cfg) {
|
|
38
|
-
|
|
33
|
+
// ── Env block ─────────────────────────────────────────────────────────────────
|
|
34
|
+
function buildEnv(cfg, token) {
|
|
35
|
+
const base = {
|
|
39
36
|
GUARDION_TIER: cfg.tier,
|
|
40
37
|
GUARDION_API_URL: cfg.api_url,
|
|
41
38
|
GUARDION_POLICY: cfg.policy,
|
|
42
39
|
GUARDION_APPLICATION: cfg.application,
|
|
43
40
|
};
|
|
41
|
+
if (cfg.tier === 'full') {
|
|
42
|
+
const gw = { ...DEFAULT_GATEWAY, ...cfg.gateway };
|
|
43
|
+
const provider = gw.provider;
|
|
44
|
+
// Custom headers sent on every LLM request through the gateway.
|
|
45
|
+
// Lines are newline-separated "Key: value" pairs.
|
|
46
|
+
const customHeaders = [
|
|
47
|
+
`${HEADER_API_KEY}: ${token}`,
|
|
48
|
+
`${HEADER_PROVIDER}: ${provider}`,
|
|
49
|
+
`${HEADER_POLICY}: ${cfg.policy}`,
|
|
50
|
+
];
|
|
51
|
+
if (provider === 'vertex-ai') {
|
|
52
|
+
if (gw.vertex_project_id)
|
|
53
|
+
customHeaders.push(`x-guardion-vertex-project-id: ${gw.vertex_project_id}`);
|
|
54
|
+
if (gw.vertex_region)
|
|
55
|
+
customHeaders.push(`x-guardion-vertex-region: ${gw.vertex_region}`);
|
|
56
|
+
}
|
|
57
|
+
base.ANTHROPIC_BASE_URL = gw.url;
|
|
58
|
+
base.ANTHROPIC_CUSTOM_HEADERS = customHeaders.join('\n');
|
|
59
|
+
base.GUARDION_GATEWAY_URL = gw.url;
|
|
60
|
+
base.GUARDION_MCP_URL = gw.mcp_url;
|
|
61
|
+
}
|
|
62
|
+
return base;
|
|
63
|
+
}
|
|
64
|
+
// ── MCP rewriting (full tier only) ───────────────────────────────────────────
|
|
65
|
+
// Existing MCP servers are proxied through the Guardion MCP gateway so that
|
|
66
|
+
// tool call traffic is also evaluated for policy violations.
|
|
67
|
+
function rewriteMcpServers(servers, mcpBaseUrl) {
|
|
68
|
+
const out = {};
|
|
69
|
+
for (const [name, cfg] of Object.entries(servers)) {
|
|
70
|
+
// Skip servers that are already pointing at a Guardion endpoint
|
|
71
|
+
if (typeof cfg.url === 'string' && cfg.url.includes('guardion')) {
|
|
72
|
+
out[name] = cfg;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
out[name] = {
|
|
76
|
+
type: 'http',
|
|
77
|
+
url: `${mcpBaseUrl}/${name}/mcp`,
|
|
78
|
+
headers: { Authorization: 'Bearer $GUARDION_TOKEN' },
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
44
82
|
}
|
|
45
83
|
export function patch(scan, opts) {
|
|
46
84
|
const base = scan.settings
|
|
47
|
-
? JSON.parse(JSON.stringify(scan.settings))
|
|
85
|
+
? JSON.parse(JSON.stringify(scan.settings))
|
|
48
86
|
: {};
|
|
49
|
-
base.env = { ...(base.env ?? {}), ...buildEnv(opts.config) };
|
|
50
|
-
base.hooks = { ...(base.hooks ?? {}), ...buildHooks(opts.dev ?? false) };
|
|
87
|
+
base.env = { ...(base.env ?? {}), ...buildEnv(opts.config, opts.token) };
|
|
88
|
+
base.hooks = { ...(base.hooks ?? {}), ...buildHooks(opts.config, opts.dev ?? false) };
|
|
89
|
+
// Full tier: proxy MCP servers through the Guardion MCP gateway
|
|
90
|
+
if (opts.config.tier === 'full' && Object.keys(scan.mcpServers).length > 0) {
|
|
91
|
+
const mcpUrl = opts.config.gateway?.mcp_url
|
|
92
|
+
?? (opts.dev ? 'http://localhost:8082/mcp' : DEFAULT_GATEWAY.mcp_url);
|
|
93
|
+
base.mcpServers = {
|
|
94
|
+
...(base.mcpServers ?? {}),
|
|
95
|
+
...rewriteMcpServers(scan.mcpServers, mcpUrl),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
51
98
|
return base;
|
|
52
99
|
}
|
|
53
100
|
// ── Write ─────────────────────────────────────────────────────────────────────
|
|
@@ -91,8 +138,7 @@ export function restore(settingsPath) {
|
|
|
91
138
|
try {
|
|
92
139
|
const backups = fs.readdirSync(dir)
|
|
93
140
|
.filter(f => f.startsWith(prefix) && f.endsWith('.bak'))
|
|
94
|
-
.sort()
|
|
95
|
-
.reverse();
|
|
141
|
+
.sort().reverse();
|
|
96
142
|
if (backups.length === 0)
|
|
97
143
|
return null;
|
|
98
144
|
const latest = path.join(dir, backups[0]);
|
|
@@ -104,24 +150,31 @@ export function restore(settingsPath) {
|
|
|
104
150
|
return null;
|
|
105
151
|
}
|
|
106
152
|
}
|
|
107
|
-
// ── Remove Guardion entries
|
|
153
|
+
// ── Remove Guardion entries ───────────────────────────────────────────────────
|
|
108
154
|
export function removeGuardionEntries(settings) {
|
|
109
155
|
const cleaned = JSON.parse(JSON.stringify(settings));
|
|
110
|
-
// Remove Guardion env keys
|
|
111
156
|
if (cleaned.env) {
|
|
112
157
|
for (const key of Object.keys(cleaned.env)) {
|
|
113
|
-
if (key.startsWith('GUARDION_'))
|
|
158
|
+
if (key.startsWith('GUARDION_') || key === 'ANTHROPIC_BASE_URL') {
|
|
114
159
|
delete cleaned.env[key];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// Remove Guardion-injected custom headers but preserve ANTHROPIC_CUSTOM_HEADERS
|
|
163
|
+
// if the user had their own headers before Guardion was installed
|
|
164
|
+
if (cleaned.env.ANTHROPIC_CUSTOM_HEADERS) {
|
|
165
|
+
const lines = cleaned.env.ANTHROPIC_CUSTOM_HEADERS.split('\n')
|
|
166
|
+
.filter((l) => !l.startsWith('x-guardion-'));
|
|
167
|
+
if (lines.length === 0)
|
|
168
|
+
delete cleaned.env.ANTHROPIC_CUSTOM_HEADERS;
|
|
169
|
+
else
|
|
170
|
+
cleaned.env.ANTHROPIC_CUSTOM_HEADERS = lines.join('\n');
|
|
115
171
|
}
|
|
116
172
|
}
|
|
117
|
-
// Remove Guardion hooks — entries whose nested hooks array contains a guardion command
|
|
118
173
|
if (cleaned.hooks) {
|
|
119
174
|
for (const [event, hookList] of Object.entries(cleaned.hooks)) {
|
|
120
175
|
const filtered = hookList.filter(entry => {
|
|
121
|
-
// settings.json format: { matcher, hooks: [{ command }] }
|
|
122
176
|
if (entry.hooks)
|
|
123
177
|
return !entry.hooks.some(h => h.command?.includes('guardion'));
|
|
124
|
-
// legacy flat format: { type, command }
|
|
125
178
|
return !entry.command?.includes('guardion');
|
|
126
179
|
});
|
|
127
180
|
if (filtered.length === 0)
|
package/dist/installer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAQ,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,aAAa,EACb,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAQ,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,eAAe,EACf,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,iEAAiE;AACjE,MAAM,gBAAgB,GAAG,mCAAmC,CAAC;AAE7D,sEAAsE;AACtE,SAAS,oBAAoB;IAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAA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version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../src/keychain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../src/keychain.ts"],"names":[],"mappings":"AAaA,wBAAgB,QAAQ,IAAI,MAAM,CAiCjC;AAID,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAsB5C;AAED,wBAAgB,UAAU,IAAI,IAAI,CAwBjC"}
|