sovr-mcp-server 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.
Potentially problematic release.
This version of sovr-mcp-server might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +341 -0
- package/dist/api/client.d.ts +59 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +162 -0
- package/dist/api/client.js.map +1 -0
- package/dist/auth/apiKey.d.ts +53 -0
- package/dist/auth/apiKey.d.ts.map +1 -0
- package/dist/auth/apiKey.js +146 -0
- package/dist/auth/apiKey.js.map +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +59 -0
- package/dist/cli.js.map +1 -0
- package/dist/crypto/ed25519.d.ts +46 -0
- package/dist/crypto/ed25519.d.ts.map +1 -0
- package/dist/crypto/ed25519.js +144 -0
- package/dist/crypto/ed25519.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +335 -0
- package/dist/index.js.map +1 -0
- package/dist/local/client.d.ts +74 -0
- package/dist/local/client.d.ts.map +1 -0
- package/dist/local/client.js +118 -0
- package/dist/local/client.js.map +1 -0
- package/dist/local/store.d.ts +127 -0
- package/dist/local/store.d.ts.map +1 -0
- package/dist/local/store.js +384 -0
- package/dist/local/store.js.map +1 -0
- package/dist/tools/auditQuery.d.ts +101 -0
- package/dist/tools/auditQuery.d.ts.map +1 -0
- package/dist/tools/auditQuery.js +136 -0
- package/dist/tools/auditQuery.js.map +1 -0
- package/dist/tools/gateCheck.d.ts +61 -0
- package/dist/tools/gateCheck.d.ts.map +1 -0
- package/dist/tools/gateCheck.js +96 -0
- package/dist/tools/gateCheck.js.map +1 -0
- package/dist/tools/grantPermit.d.ts +45 -0
- package/dist/tools/grantPermit.d.ts.map +1 -0
- package/dist/tools/grantPermit.js +121 -0
- package/dist/tools/grantPermit.js.map +1 -0
- package/dist/tools/index.d.ts +163 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/killSwitch.d.ts +52 -0
- package/dist/tools/killSwitch.d.ts.map +1 -0
- package/dist/tools/killSwitch.js +85 -0
- package/dist/tools/killSwitch.js.map +1 -0
- package/dist/tools/policyList.d.ts +68 -0
- package/dist/tools/policyList.d.ts.map +1 -0
- package/dist/tools/policyList.js +96 -0
- package/dist/tools/policyList.js.map +1 -0
- package/dist/tools/requestApproval.d.ts +56 -0
- package/dist/tools/requestApproval.d.ts.map +1 -0
- package/dist/tools/requestApproval.js +97 -0
- package/dist/tools/requestApproval.js.map +1 -0
- package/dist/tools/submitReceipt.d.ts +145 -0
- package/dist/tools/submitReceipt.d.ts.map +1 -0
- package/dist/tools/submitReceipt.js +162 -0
- package/dist/tools/submitReceipt.js.map +1 -0
- package/dist/tools/systemStatus.d.ts +32 -0
- package/dist/tools/systemStatus.d.ts.map +1 -0
- package/dist/tools/systemStatus.js +67 -0
- package/dist/tools/systemStatus.js.map +1 -0
- package/dist/types/index.d.ts +146 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +33 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* audit_query MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Query the audit trail for decisions and receipts.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
// ==========================================================================
|
|
8
|
+
// Input Schema
|
|
9
|
+
// ==========================================================================
|
|
10
|
+
export const auditQueryInputSchema = z.object({
|
|
11
|
+
decision_id: z.string().optional().describe('Filter by specific decision ID'),
|
|
12
|
+
action: z.string().optional().describe('Filter by action type (e.g., "delete_*")'),
|
|
13
|
+
resource: z.string().optional().describe('Filter by resource pattern'),
|
|
14
|
+
status: z.enum(['success', 'failure', 'blocked', 'pending']).optional().describe('Filter by execution status'),
|
|
15
|
+
from_date: z.number().optional().describe('Start timestamp (Unix ms)'),
|
|
16
|
+
to_date: z.number().optional().describe('End timestamp (Unix ms)'),
|
|
17
|
+
limit: z.number().min(1).max(100).optional().default(20).describe('Maximum results to return'),
|
|
18
|
+
offset: z.number().min(0).optional().default(0).describe('Offset for pagination'),
|
|
19
|
+
});
|
|
20
|
+
// ==========================================================================
|
|
21
|
+
// Tool Definition
|
|
22
|
+
// ==========================================================================
|
|
23
|
+
export const auditQueryTool = {
|
|
24
|
+
name: 'audit_query',
|
|
25
|
+
description: `Query the SOVR audit trail for decisions and execution receipts.
|
|
26
|
+
|
|
27
|
+
Use this to:
|
|
28
|
+
- Review past decisions and their outcomes
|
|
29
|
+
- Verify execution evidence
|
|
30
|
+
- Generate compliance reports
|
|
31
|
+
- Debug issues with specific operations
|
|
32
|
+
|
|
33
|
+
Filters:
|
|
34
|
+
- decision_id: Get specific decision and all related records
|
|
35
|
+
- action/resource: Filter by operation type
|
|
36
|
+
- status: Filter by execution outcome
|
|
37
|
+
- from_date/to_date: Time range filter
|
|
38
|
+
|
|
39
|
+
Returns decisions, approvals, permits, and receipts matching the criteria.`,
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
decision_id: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Filter by specific decision ID',
|
|
46
|
+
},
|
|
47
|
+
action: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Filter by action type',
|
|
50
|
+
},
|
|
51
|
+
resource: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'Filter by resource pattern',
|
|
54
|
+
},
|
|
55
|
+
status: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
enum: ['success', 'failure', 'blocked', 'pending'],
|
|
58
|
+
description: 'Filter by execution status',
|
|
59
|
+
},
|
|
60
|
+
from_date: {
|
|
61
|
+
type: 'number',
|
|
62
|
+
description: 'Start timestamp (Unix ms)',
|
|
63
|
+
},
|
|
64
|
+
to_date: {
|
|
65
|
+
type: 'number',
|
|
66
|
+
description: 'End timestamp (Unix ms)',
|
|
67
|
+
},
|
|
68
|
+
limit: {
|
|
69
|
+
type: 'number',
|
|
70
|
+
minimum: 1,
|
|
71
|
+
maximum: 100,
|
|
72
|
+
default: 20,
|
|
73
|
+
description: 'Maximum results to return',
|
|
74
|
+
},
|
|
75
|
+
offset: {
|
|
76
|
+
type: 'number',
|
|
77
|
+
minimum: 0,
|
|
78
|
+
default: 0,
|
|
79
|
+
description: 'Offset for pagination',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
required: [],
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
// ==========================================================================
|
|
86
|
+
// Response Formatter
|
|
87
|
+
// ==========================================================================
|
|
88
|
+
export function formatAuditQueryResponse(result) {
|
|
89
|
+
if (result.records.length === 0) {
|
|
90
|
+
return `📋 Audit Query Results
|
|
91
|
+
|
|
92
|
+
No records found matching the criteria.`;
|
|
93
|
+
}
|
|
94
|
+
let response = `📋 Audit Query Results
|
|
95
|
+
|
|
96
|
+
**Total:** ${result.total} records
|
|
97
|
+
**Showing:** ${result.offset + 1}-${Math.min(result.offset + result.limit, result.total)}
|
|
98
|
+
|
|
99
|
+
`;
|
|
100
|
+
for (const record of result.records) {
|
|
101
|
+
const icon = getRecordIcon(record.type, record.status);
|
|
102
|
+
const timestamp = new Date(record.timestamp).toISOString();
|
|
103
|
+
response += `---
|
|
104
|
+
${icon} **${record.type.toUpperCase()}** \`${record.id}\`
|
|
105
|
+
- Decision: ${record.decision_id}
|
|
106
|
+
- Time: ${timestamp}`;
|
|
107
|
+
if (record.action)
|
|
108
|
+
response += `\n- Action: ${record.action}`;
|
|
109
|
+
if (record.resource)
|
|
110
|
+
response += `\n- Resource: ${record.resource}`;
|
|
111
|
+
if (record.status)
|
|
112
|
+
response += `\n- Status: ${record.status}`;
|
|
113
|
+
response += '\n\n';
|
|
114
|
+
}
|
|
115
|
+
if (result.total > result.offset + result.limit) {
|
|
116
|
+
response += `\n_Use offset: ${result.offset + result.limit} to see more records._`;
|
|
117
|
+
}
|
|
118
|
+
return response;
|
|
119
|
+
}
|
|
120
|
+
function getRecordIcon(type, status) {
|
|
121
|
+
if (type === 'receipt') {
|
|
122
|
+
switch (status) {
|
|
123
|
+
case 'success': return '✅';
|
|
124
|
+
case 'failure': return '❌';
|
|
125
|
+
case 'blocked': return '🚫';
|
|
126
|
+
default: return '📋';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
switch (type) {
|
|
130
|
+
case 'decision': return '🔍';
|
|
131
|
+
case 'approval': return '👤';
|
|
132
|
+
case 'permit': return '🔐';
|
|
133
|
+
default: return '📄';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=auditQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditQuery.js","sourceRoot":"","sources":["../../src/tools/auditQuery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6EAA6E;AAC7E,eAAe;AACf,6EAA6E;AAE7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC7E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;IAClF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACtE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC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C;QAC9D,IAAI,MAAM,CAAC,QAAQ;YAAE,QAAQ,IAAI,iBAAiB,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpE,IAAI,MAAM,CAAC,MAAM;YAAE,QAAQ,IAAI,eAAe,MAAM,CAAC,MAAM,EAAE,CAAC;QAE9D,QAAQ,IAAI,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAChD,QAAQ,IAAI,kBAAkB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,wBAAwB,CAAC;IACrF,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAe;IAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC;YAC3B,KAAK,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC;YAC3B,KAAK,SAAS,CAAC,CAAC,OAAO,IAAI,CAAC;YAC5B,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;IACD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC;QAC7B,KAAK,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC;QAC7B,KAAK,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC;QAC3B,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gate_check MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Evaluates if an irreversible action should be allowed.
|
|
5
|
+
* This is the entry point for all governed operations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import type { GateCheckResult } from '../types/index.js';
|
|
9
|
+
export declare const gateCheckInputSchema: z.ZodObject<{
|
|
10
|
+
action: z.ZodString;
|
|
11
|
+
resource: z.ZodString;
|
|
12
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
13
|
+
tenant_id: z.ZodOptional<z.ZodString>;
|
|
14
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
action: string;
|
|
17
|
+
resource: string;
|
|
18
|
+
context?: Record<string, unknown> | undefined;
|
|
19
|
+
tenant_id?: string | undefined;
|
|
20
|
+
idempotency_key?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
action: string;
|
|
23
|
+
resource: string;
|
|
24
|
+
context?: Record<string, unknown> | undefined;
|
|
25
|
+
tenant_id?: string | undefined;
|
|
26
|
+
idempotency_key?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export type GateCheckInput = z.infer<typeof gateCheckInputSchema>;
|
|
29
|
+
export declare const gateCheckTool: {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object";
|
|
34
|
+
properties: {
|
|
35
|
+
action: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
resource: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
context: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
tenant_id: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
idempotency_key: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
required: string[];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare function handleGateCheck(input: unknown): Promise<GateCheckResult>;
|
|
60
|
+
export declare function formatGateCheckResponse(result: GateCheckResult): string;
|
|
61
|
+
//# sourceMappingURL=gateCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateCheck.d.ts","sourceRoot":"","sources":["../../src/tools/gateCheck.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMzD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAM/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAMlE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCzB,CAAC;AAMF,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAS9E;AAMD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAqBvE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gate_check MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Evaluates if an irreversible action should be allowed.
|
|
5
|
+
* This is the entry point for all governed operations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { getClient } from '../api/client.js';
|
|
9
|
+
// ==========================================================================
|
|
10
|
+
// Input Schema
|
|
11
|
+
// ==========================================================================
|
|
12
|
+
export const gateCheckInputSchema = z.object({
|
|
13
|
+
action: z.string().describe('The action to perform (e.g., "delete_database", "send_email", "deploy_code")'),
|
|
14
|
+
resource: z.string().describe('The target resource identifier'),
|
|
15
|
+
context: z.record(z.unknown()).optional().describe('Additional context for policy evaluation'),
|
|
16
|
+
tenant_id: z.string().optional().describe('Tenant ID for multi-tenant scenarios'),
|
|
17
|
+
idempotency_key: z.string().optional().describe('Unique key to prevent duplicate checks'),
|
|
18
|
+
});
|
|
19
|
+
// ==========================================================================
|
|
20
|
+
// Tool Definition
|
|
21
|
+
// ==========================================================================
|
|
22
|
+
export const gateCheckTool = {
|
|
23
|
+
name: 'gate_check',
|
|
24
|
+
description: `Check if an irreversible action is allowed before execution.
|
|
25
|
+
|
|
26
|
+
This is the first step in the SOVR responsibility flow:
|
|
27
|
+
1. gate_check → Get decision
|
|
28
|
+
2. request_approval (if required)
|
|
29
|
+
3. grant_permit → Get execution permit
|
|
30
|
+
4. Execute action
|
|
31
|
+
5. submit_receipt → Record evidence
|
|
32
|
+
|
|
33
|
+
Returns a decision_id that must be used in subsequent steps.`,
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
properties: {
|
|
37
|
+
action: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: 'The action to perform (e.g., "delete_database", "send_email", "deploy_code")',
|
|
40
|
+
},
|
|
41
|
+
resource: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'The target resource identifier',
|
|
44
|
+
},
|
|
45
|
+
context: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
description: 'Additional context for policy evaluation',
|
|
48
|
+
},
|
|
49
|
+
tenant_id: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
description: 'Tenant ID for multi-tenant scenarios',
|
|
52
|
+
},
|
|
53
|
+
idempotency_key: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: 'Unique key to prevent duplicate checks',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: ['action', 'resource'],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
// ==========================================================================
|
|
62
|
+
// Handler
|
|
63
|
+
// ==========================================================================
|
|
64
|
+
export async function handleGateCheck(input) {
|
|
65
|
+
// Validate input
|
|
66
|
+
const validated = gateCheckInputSchema.parse(input);
|
|
67
|
+
// Call SOVR API
|
|
68
|
+
const client = getClient();
|
|
69
|
+
const result = await client.gateCheck(validated);
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
// ==========================================================================
|
|
73
|
+
// Response Formatter
|
|
74
|
+
// ==========================================================================
|
|
75
|
+
export function formatGateCheckResponse(result) {
|
|
76
|
+
const statusEmoji = result.allowed ? '✅' : '❌';
|
|
77
|
+
const approvalNote = result.requires_approval
|
|
78
|
+
? '\n⚠️ Human approval required before proceeding.'
|
|
79
|
+
: '';
|
|
80
|
+
return `${statusEmoji} Gate Check Result
|
|
81
|
+
|
|
82
|
+
**Decision ID:** ${result.decision_id}
|
|
83
|
+
**Allowed:** ${result.allowed}
|
|
84
|
+
**Reason:** ${result.reason}
|
|
85
|
+
**Risk Score:** ${result.risk_score}/100
|
|
86
|
+
**Value Score:** ${result.value_score}/100
|
|
87
|
+
**Policy Version:** ${result.policy_version}
|
|
88
|
+
${approvalNote}
|
|
89
|
+
|
|
90
|
+
${result.allowed
|
|
91
|
+
? 'Next step: Call grant_permit with this decision_id to get an execution permit.'
|
|
92
|
+
: result.requires_approval
|
|
93
|
+
? 'Next step: Call request_approval with this decision_id to initiate approval workflow.'
|
|
94
|
+
: 'Action blocked. Review the reason and adjust your request.'}`;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=gateCheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateCheck.js","sourceRoot":"","sources":["../../src/tools/gateCheck.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,6EAA6E;AAC7E,eAAe;AACf,6EAA6E;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IAC3G,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CA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CAAC;IAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,6EAA6E;AAC7E,qBAAqB;AACrB,6EAA6E;AAE7E,MAAM,UAAU,uBAAuB,CAAC,MAAuB;IAC7D,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC/C,MAAM,YAAY,GAAG,MAAM,CAAC,iBAAiB;QAC3C,CAAC,CAAC,iDAAiD;QACnD,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,GAAG,WAAW;;mBAEJ,MAAM,CAAC,WAAW;eACtB,MAAM,CAAC,OAAO;cACf,MAAM,CAAC,MAAM;kBACT,MAAM,CAAC,UAAU;mBAChB,MAAM,CAAC,WAAW;sBACf,MAAM,CAAC,cAAc;EACzC,YAAY;;EAEZ,MAAM,CAAC,OAAO;QACd,CAAC,CAAC,gFAAgF;QAClF,CAAC,CAAC,MAAM,CAAC,iBAAiB;YACxB,CAAC,CAAC,uFAAuF;YACzF,CAAC,CAAC,4DAA4D,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grant_permit MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Issues a cryptographically signed execution permit.
|
|
5
|
+
* The permit is a verifiable credential that authorizes action execution.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import type { ExecutionPermit } from '../types/index.js';
|
|
9
|
+
export declare const grantPermitInputSchema: z.ZodObject<{
|
|
10
|
+
decision_id: z.ZodString;
|
|
11
|
+
ttl_seconds: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
decision_id: string;
|
|
14
|
+
ttl_seconds: number;
|
|
15
|
+
}, {
|
|
16
|
+
decision_id: string;
|
|
17
|
+
ttl_seconds?: number | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type GrantPermitInput = z.infer<typeof grantPermitInputSchema>;
|
|
20
|
+
export declare const grantPermitTool: {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object";
|
|
25
|
+
properties: {
|
|
26
|
+
decision_id: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
ttl_seconds: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
minimum: number;
|
|
34
|
+
maximum: number;
|
|
35
|
+
default: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
required: string[];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare function initializeSigningKey(privateKeyHex: string): void;
|
|
42
|
+
export declare function getPublicKey(): string | null;
|
|
43
|
+
export declare function handleGrantPermit(input: unknown): Promise<ExecutionPermit>;
|
|
44
|
+
export declare function formatPermitResponse(permit: ExecutionPermit): string;
|
|
45
|
+
//# sourceMappingURL=grantPermit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grantPermit.d.ts","sourceRoot":"","sources":["../../src/tools/grantPermit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMzD,eAAO,MAAM,sBAAsB;;;;;;;;;EAQjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAMtE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;CAgC3B,CAAC;AAQF,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAEhE;AAED,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAE5C;AAMD,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAkChF;AAMD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAsBpE"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grant_permit MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Issues a cryptographically signed execution permit.
|
|
5
|
+
* The permit is a verifiable credential that authorizes action execution.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { getClient } from '../api/client.js';
|
|
9
|
+
import { signPermit, loadKeyPair, DEFAULT_PERMIT_TTL, MIN_PERMIT_TTL, MAX_PERMIT_TTL } from '../crypto/ed25519.js';
|
|
10
|
+
// ==========================================================================
|
|
11
|
+
// Input Schema
|
|
12
|
+
// ==========================================================================
|
|
13
|
+
export const grantPermitInputSchema = z.object({
|
|
14
|
+
decision_id: z.string().describe('The decision_id from an approved gate_check'),
|
|
15
|
+
ttl_seconds: z.number()
|
|
16
|
+
.min(MIN_PERMIT_TTL)
|
|
17
|
+
.max(MAX_PERMIT_TTL)
|
|
18
|
+
.optional()
|
|
19
|
+
.default(DEFAULT_PERMIT_TTL)
|
|
20
|
+
.describe(`Permit validity duration in seconds (${MIN_PERMIT_TTL}-${MAX_PERMIT_TTL}, default ${DEFAULT_PERMIT_TTL})`),
|
|
21
|
+
});
|
|
22
|
+
// ==========================================================================
|
|
23
|
+
// Tool Definition
|
|
24
|
+
// ==========================================================================
|
|
25
|
+
export const grantPermitTool = {
|
|
26
|
+
name: 'grant_permit',
|
|
27
|
+
description: `Issue a cryptographically signed execution permit.
|
|
28
|
+
|
|
29
|
+
Prerequisites:
|
|
30
|
+
- gate_check must have returned allowed: true, OR
|
|
31
|
+
- request_approval must have been approved
|
|
32
|
+
|
|
33
|
+
The permit:
|
|
34
|
+
- Is signed with Ed25519 for verification
|
|
35
|
+
- Has a configurable TTL (60-900 seconds, default 300)
|
|
36
|
+
- Contains scope, action, and resource constraints
|
|
37
|
+
- Must be used before expiration
|
|
38
|
+
|
|
39
|
+
After execution, call submit_receipt with the permit_id to complete the audit trail.`,
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
decision_id: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'The decision_id from an approved gate_check',
|
|
46
|
+
},
|
|
47
|
+
ttl_seconds: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: `Permit validity duration in seconds (${MIN_PERMIT_TTL}-${MAX_PERMIT_TTL}, default ${DEFAULT_PERMIT_TTL})`,
|
|
50
|
+
minimum: MIN_PERMIT_TTL,
|
|
51
|
+
maximum: MAX_PERMIT_TTL,
|
|
52
|
+
default: DEFAULT_PERMIT_TTL,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: ['decision_id'],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
// ==========================================================================
|
|
59
|
+
// State (in production, this would be from secure key management)
|
|
60
|
+
// ==========================================================================
|
|
61
|
+
let signingKeyPair = null;
|
|
62
|
+
export function initializeSigningKey(privateKeyHex) {
|
|
63
|
+
signingKeyPair = loadKeyPair(privateKeyHex);
|
|
64
|
+
}
|
|
65
|
+
export function getPublicKey() {
|
|
66
|
+
return signingKeyPair?.publicKeyHex ?? null;
|
|
67
|
+
}
|
|
68
|
+
// ==========================================================================
|
|
69
|
+
// Handler
|
|
70
|
+
// ==========================================================================
|
|
71
|
+
export async function handleGrantPermit(input) {
|
|
72
|
+
// Validate input
|
|
73
|
+
const validated = grantPermitInputSchema.parse(input);
|
|
74
|
+
if (!signingKeyPair) {
|
|
75
|
+
throw new Error('Signing key not initialized. Server configuration error.');
|
|
76
|
+
}
|
|
77
|
+
// Verify decision exists and is approved
|
|
78
|
+
const client = getClient();
|
|
79
|
+
const decision = await client.getDecision(validated.decision_id);
|
|
80
|
+
if (!decision.allowed) {
|
|
81
|
+
throw new Error(`Decision ${validated.decision_id} is not allowed. Cannot grant permit.`);
|
|
82
|
+
}
|
|
83
|
+
if (decision.approval && decision.approval.status !== 'approved') {
|
|
84
|
+
throw new Error(`Approval status is ${decision.approval.status}. Cannot grant permit until approved.`);
|
|
85
|
+
}
|
|
86
|
+
// Sign and issue permit
|
|
87
|
+
const permit = await signPermit({
|
|
88
|
+
decision_id: validated.decision_id,
|
|
89
|
+
tenant_id: 'default', // Will be extracted from API key in production
|
|
90
|
+
action: 'execute', // Will be from decision in production
|
|
91
|
+
resource: 'resource', // Will be from decision in production
|
|
92
|
+
scope: ['execute'],
|
|
93
|
+
}, signingKeyPair, validated.ttl_seconds);
|
|
94
|
+
return permit;
|
|
95
|
+
}
|
|
96
|
+
// ==========================================================================
|
|
97
|
+
// Response Formatter
|
|
98
|
+
// ==========================================================================
|
|
99
|
+
export function formatPermitResponse(permit) {
|
|
100
|
+
const expiresIn = Math.max(0, permit.expires_at - Math.floor(Date.now() / 1000));
|
|
101
|
+
return `🔐 Execution Permit Granted
|
|
102
|
+
|
|
103
|
+
**Permit ID:** ${permit.permit_id}
|
|
104
|
+
**Decision ID:** ${permit.decision_id}
|
|
105
|
+
**Valid For:** ${expiresIn} seconds
|
|
106
|
+
**Expires At:** ${new Date(permit.expires_at * 1000).toISOString()}
|
|
107
|
+
|
|
108
|
+
**Scope:** ${permit.scope.join(', ')}
|
|
109
|
+
**Public Key:** ${permit.public_key.slice(0, 16)}...
|
|
110
|
+
|
|
111
|
+
⚠️ This permit is cryptographically signed and time-limited.
|
|
112
|
+
Execute your action now and call submit_receipt immediately after.
|
|
113
|
+
|
|
114
|
+
**Required Receipt Fields:**
|
|
115
|
+
- permit_id: ${permit.permit_id}
|
|
116
|
+
- decision_id: ${permit.decision_id}
|
|
117
|
+
- external_ref: Your execution task ID
|
|
118
|
+
- output_hash: SHA-512 hash of execution output
|
|
119
|
+
- artifact_refs: URLs/keys to logs, screenshots, diffs`;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=grantPermit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grantPermit.js","sourceRoot":"","sources":["../../src/tools/grantPermit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGnH,6EAA6E;AAC7E,eAAe;AACf,6EAA6E;AAE7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAC/E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;SACpB,GAAG,CAAC,cAAc,CAAC;SACnB,GAAG,CAAC,cAAc,CAAC;SACnB,QAAQ,EAAE;SACV,OAAO,CAAC,kBAAkB,CAAC;SAC3B,QAAQ,CAAC,wCAAwC,cAAc,IAAI,cAAc,aAAa,kBAAkB,GAAG,CAAC;CACxH,CAAC,CAAC;AAIH,6EAA6E;AAC7E,kBAAkB;AAClB,6EAA6E;AAE7E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;;;;;qFAYsE;IACnF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wCAAwC,cAAc,IAAI,cAAc,aAAa,kBAAkB,GAAG;gBACvH,OAAO,EAAE,cAAc;g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;QAClC,SAAS,EAAE,SAAS,EAAE,+CAA+C;QACrE,MAAM,EAAE,SAAS,EAAE,sCAAsC;QACzD,QAAQ,EAAE,UAAU,EAAE,sCAAsC;QAC5D,KAAK,EAAE,CAAC,SAAS,CAAC;KACnB,EACD,cAAc,EACd,SAAS,CAAC,WAAW,CACtB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,6EAA6E;AAC7E,qBAAqB;AACrB,6EAA6E;AAE7E,MAAM,UAAU,oBAAoB,CAAC,MAAuB;IAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAEjF,OAAO;;iBAEQ,MAAM,CAAC,SAAS;mBACd,MAAM,CAAC,WAAW;iBACpB,SAAS;kBACR,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE;;aAErD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;kBAClB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;;;;;;eAMjC,MAAM,CAAC,SAAS;iBACd,MAAM,CAAC,WAAW;;;uDAGoB,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SOVR MCP Tools Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all MCP tools and their handlers.
|
|
5
|
+
*/
|
|
6
|
+
export { gateCheckTool, handleGateCheck, formatGateCheckResponse } from './gateCheck.js';
|
|
7
|
+
export { requestApprovalTool, handleRequestApproval, formatApprovalResponse } from './requestApproval.js';
|
|
8
|
+
export { grantPermitTool, handleGrantPermit, formatPermitResponse, initializeSigningKey, getPublicKey } from './grantPermit.js';
|
|
9
|
+
export { submitReceiptTool, handleSubmitReceipt, formatReceiptResponse } from './submitReceipt.js';
|
|
10
|
+
export declare const tools: ({
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: "object";
|
|
15
|
+
properties: {
|
|
16
|
+
action: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
resource: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
context: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
tenant_id: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
idempotency_key: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
required: string[];
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object";
|
|
44
|
+
properties: {
|
|
45
|
+
decision_id: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
justification: {
|
|
50
|
+
type: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
urgency: {
|
|
54
|
+
type: string;
|
|
55
|
+
enum: string[];
|
|
56
|
+
description: string;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
metadata: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
required: string[];
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object";
|
|
71
|
+
properties: {
|
|
72
|
+
decision_id: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
ttl_seconds: {
|
|
77
|
+
type: string;
|
|
78
|
+
description: string;
|
|
79
|
+
minimum: number;
|
|
80
|
+
maximum: number;
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
required: string[];
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: "object";
|
|
91
|
+
properties: {
|
|
92
|
+
decision_id: {
|
|
93
|
+
type: string;
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
permit_id: {
|
|
97
|
+
type: string;
|
|
98
|
+
description: string;
|
|
99
|
+
};
|
|
100
|
+
external_ref: {
|
|
101
|
+
type: string;
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
status: {
|
|
105
|
+
type: string;
|
|
106
|
+
enum: string[];
|
|
107
|
+
description: string;
|
|
108
|
+
};
|
|
109
|
+
started_at: {
|
|
110
|
+
type: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
finished_at: {
|
|
114
|
+
type: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
output_hash: {
|
|
118
|
+
type: string;
|
|
119
|
+
description: string;
|
|
120
|
+
};
|
|
121
|
+
artifact_refs: {
|
|
122
|
+
type: string;
|
|
123
|
+
items: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
minItems: number;
|
|
127
|
+
description: string;
|
|
128
|
+
};
|
|
129
|
+
idempotency_key: {
|
|
130
|
+
type: string;
|
|
131
|
+
description: string;
|
|
132
|
+
};
|
|
133
|
+
error_code: {
|
|
134
|
+
type: string;
|
|
135
|
+
description: string;
|
|
136
|
+
};
|
|
137
|
+
error_message: {
|
|
138
|
+
type: string;
|
|
139
|
+
description: string;
|
|
140
|
+
};
|
|
141
|
+
resource_fingerprint: {
|
|
142
|
+
type: string;
|
|
143
|
+
description: string;
|
|
144
|
+
};
|
|
145
|
+
execution_metrics: {
|
|
146
|
+
type: string;
|
|
147
|
+
properties: {
|
|
148
|
+
duration_ms: {
|
|
149
|
+
type: string;
|
|
150
|
+
};
|
|
151
|
+
retry_count: {
|
|
152
|
+
type: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
description: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
required: string[];
|
|
159
|
+
};
|
|
160
|
+
})[];
|
|
161
|
+
export declare const toolHandlers: Record<string, (input: unknown) => Promise<unknown>>;
|
|
162
|
+
export declare const responseFormatters: Record<string, (result: unknown) => string>;
|
|
163
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChI,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGnG,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKjB,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAK7E,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAK1E,CAAC"}
|