@savestate/cli 0.5.0 → 0.6.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/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/mcp/server.d.ts +26 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +371 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/migrate/capabilities.d.ts +23 -0
- package/dist/migrate/capabilities.d.ts.map +1 -0
- package/dist/migrate/capabilities.js +80 -0
- package/dist/migrate/capabilities.js.map +1 -0
- package/dist/migrate/extractors/registry.d.ts +24 -0
- package/dist/migrate/extractors/registry.d.ts.map +1 -0
- package/dist/migrate/extractors/registry.js +38 -0
- package/dist/migrate/extractors/registry.js.map +1 -0
- package/dist/migrate/index.d.ts +13 -0
- package/dist/migrate/index.d.ts.map +1 -0
- package/dist/migrate/index.js +15 -0
- package/dist/migrate/index.js.map +1 -0
- package/dist/migrate/loaders/registry.d.ts +24 -0
- package/dist/migrate/loaders/registry.d.ts.map +1 -0
- package/dist/migrate/loaders/registry.js +38 -0
- package/dist/migrate/loaders/registry.js.map +1 -0
- package/dist/migrate/orchestrator.d.ts +77 -0
- package/dist/migrate/orchestrator.d.ts.map +1 -0
- package/dist/migrate/orchestrator.js +322 -0
- package/dist/migrate/orchestrator.js.map +1 -0
- package/dist/migrate/transformers/registry.d.ts +27 -0
- package/dist/migrate/transformers/registry.d.ts.map +1 -0
- package/dist/migrate/transformers/registry.js +47 -0
- package/dist/migrate/transformers/registry.js.map +1 -0
- package/dist/migrate/types.d.ts +350 -0
- package/dist/migrate/types.d.ts.map +1 -0
- package/dist/migrate/types.js +8 -0
- package/dist/migrate/types.js.map +1 -0
- package/package.json +4 -2
package/dist/cli.js
CHANGED
|
@@ -122,6 +122,14 @@ program
|
|
|
122
122
|
.option('--all', 'Process all snapshots')
|
|
123
123
|
.option('-f, --force', 'Overwrite existing files')
|
|
124
124
|
.action(cloudCommand);
|
|
125
|
+
// ─── savestate mcp ───────────────────────────────────────────
|
|
126
|
+
program
|
|
127
|
+
.command('mcp')
|
|
128
|
+
.description('Start MCP server for Claude Code integration')
|
|
129
|
+
.action(async () => {
|
|
130
|
+
// Dynamic import to avoid loading MCP deps for regular CLI usage
|
|
131
|
+
await import('./mcp/server.js');
|
|
132
|
+
});
|
|
125
133
|
// ─── Parse & run ─────────────────────────────────────────────
|
|
126
134
|
program.parse();
|
|
127
135
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,gCAAgC;AAChC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,qEAAqE,CAAC;KAClF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,gEAAgE;AAEhE,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,+CAA+C,CAAC;KAC5D,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvB,gEAAgE;AAEhE,OAAO;KACJ,OAAO,CAAC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AAE3B,gEAAgE;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,gEAAgE,CAAC;KAC7E,MAAM,CAAC,uBAAuB,EAAE,iCAAiC,CAAC;KAClE,MAAM,CAAC,qBAAqB,EAAE,+BAA+B,CAAC;KAC9D,MAAM,CAAC,qBAAqB,EAAE,mDAAmD,CAAC;KAClF,MAAM,CAAC,WAAW,EAAE,4CAA4C,CAAC;KACjE,MAAM,CAAC,YAAY,EAAE,iDAAiD,CAAC;KACvE,MAAM,CAAC,cAAc,CAAC,CAAC;AAE1B,gEAAgE;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO;KACJ,OAAO,CAAC,oBAAoB,CAAC;KAC7B,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,WAAW,EAAE,sBAAsB,CAAC;KAC3C,MAAM,CAAC,OAAO,EAAE,uBAAuB,CAAC;KACxC,MAAM,CAAC,aAAa,EAAE,0BAA0B,CAAC;KACjD,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,gEAAgE;AAEhE,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,WAAW,CAAC,8CAA8C,CAAC;KAC3D,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,iEAAiE;IACjE,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC;AAEL,gEAAgE;AAEhE,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SaveState MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Exposes SaveState functionality as MCP tools for Claude Code integration.
|
|
6
|
+
* Uses stdio transport for seamless Claude Code integration.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - savestate_snapshot: Create a new snapshot of the current workspace
|
|
10
|
+
* - savestate_restore: Restore from a snapshot
|
|
11
|
+
* - savestate_list: List available snapshots
|
|
12
|
+
* - savestate_diff: Compare two snapshots
|
|
13
|
+
*
|
|
14
|
+
* Usage in Claude Code:
|
|
15
|
+
* Add to ~/.claude/settings.json:
|
|
16
|
+
* {
|
|
17
|
+
* "mcpServers": {
|
|
18
|
+
* "savestate": {
|
|
19
|
+
* "command": "npx",
|
|
20
|
+
* "args": ["@savestate/cli", "mcp"]
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SaveState MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Exposes SaveState functionality as MCP tools for Claude Code integration.
|
|
6
|
+
* Uses stdio transport for seamless Claude Code integration.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - savestate_snapshot: Create a new snapshot of the current workspace
|
|
10
|
+
* - savestate_restore: Restore from a snapshot
|
|
11
|
+
* - savestate_list: List available snapshots
|
|
12
|
+
* - savestate_diff: Compare two snapshots
|
|
13
|
+
*
|
|
14
|
+
* Usage in Claude Code:
|
|
15
|
+
* Add to ~/.claude/settings.json:
|
|
16
|
+
* {
|
|
17
|
+
* "mcpServers": {
|
|
18
|
+
* "savestate": {
|
|
19
|
+
* "command": "npx",
|
|
20
|
+
* "args": ["@savestate/cli", "mcp"]
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
*/
|
|
25
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
26
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
27
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
28
|
+
import { z } from 'zod';
|
|
29
|
+
import { isInitialized, loadConfig } from '../config.js';
|
|
30
|
+
import { detectAdapter, getAdapter } from '../adapters/registry.js';
|
|
31
|
+
import { createSnapshot } from '../snapshot.js';
|
|
32
|
+
import { restoreSnapshot } from '../restore.js';
|
|
33
|
+
import { resolveStorage } from '../storage/resolve.js';
|
|
34
|
+
import { loadIndex } from '../index-file.js';
|
|
35
|
+
// ─── Tool Definitions ────────────────────────────────────────
|
|
36
|
+
const tools = [
|
|
37
|
+
{
|
|
38
|
+
name: 'savestate_snapshot',
|
|
39
|
+
description: 'Create a new encrypted snapshot of the current AI agent state. ' +
|
|
40
|
+
'Captures CLAUDE.md files, memory, settings, and project structure. ' +
|
|
41
|
+
'Returns snapshot ID and stats.',
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: {
|
|
45
|
+
label: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'Optional human-readable label for this snapshot',
|
|
48
|
+
},
|
|
49
|
+
tags: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
items: { type: 'string' },
|
|
52
|
+
description: 'Optional tags for organizing snapshots',
|
|
53
|
+
},
|
|
54
|
+
adapter: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Adapter to use (claude-code, clawdbot, etc.). Auto-detected if not specified.',
|
|
57
|
+
},
|
|
58
|
+
full: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
description: 'Force a full snapshot instead of incremental',
|
|
61
|
+
},
|
|
62
|
+
passphrase: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'Encryption passphrase. Required for snapshot creation.',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
required: ['passphrase'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'savestate_restore',
|
|
72
|
+
description: 'Restore AI agent state from a snapshot. ' +
|
|
73
|
+
'Use "latest" as snapshotId to restore the most recent snapshot. ' +
|
|
74
|
+
'Returns details about what was restored.',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
snapshotId: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Snapshot ID to restore, or "latest" for most recent',
|
|
81
|
+
},
|
|
82
|
+
adapter: {
|
|
83
|
+
type: 'string',
|
|
84
|
+
description: 'Adapter to use for restore. Auto-detected if not specified.',
|
|
85
|
+
},
|
|
86
|
+
dryRun: {
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
description: 'Preview what would be restored without making changes',
|
|
89
|
+
},
|
|
90
|
+
passphrase: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
description: 'Decryption passphrase. Required for restore.',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ['snapshotId', 'passphrase'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'savestate_list',
|
|
100
|
+
description: 'List available snapshots with their metadata. ' +
|
|
101
|
+
'Shows ID, timestamp, platform, label, and size.',
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
limit: {
|
|
106
|
+
type: 'number',
|
|
107
|
+
description: 'Maximum number of snapshots to return (default: 10)',
|
|
108
|
+
},
|
|
109
|
+
platform: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
description: 'Filter by platform (claude-code, clawdbot, etc.)',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'savestate_status',
|
|
118
|
+
description: 'Check SaveState initialization status and detected adapter. ' +
|
|
119
|
+
'Returns whether SaveState is configured and which adapter would be used.',
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
properties: {},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
// ─── Tool Input Schemas (Zod) ────────────────────────────────
|
|
127
|
+
const SnapshotInputSchema = z.object({
|
|
128
|
+
label: z.string().optional(),
|
|
129
|
+
tags: z.array(z.string()).optional(),
|
|
130
|
+
adapter: z.string().optional(),
|
|
131
|
+
full: z.boolean().optional(),
|
|
132
|
+
passphrase: z.string(),
|
|
133
|
+
});
|
|
134
|
+
const RestoreInputSchema = z.object({
|
|
135
|
+
snapshotId: z.string(),
|
|
136
|
+
adapter: z.string().optional(),
|
|
137
|
+
dryRun: z.boolean().optional(),
|
|
138
|
+
passphrase: z.string(),
|
|
139
|
+
});
|
|
140
|
+
const ListInputSchema = z.object({
|
|
141
|
+
limit: z.number().optional(),
|
|
142
|
+
platform: z.string().optional(),
|
|
143
|
+
});
|
|
144
|
+
// ─── Tool Handlers ───────────────────────────────────────────
|
|
145
|
+
async function handleSnapshot(input) {
|
|
146
|
+
if (!isInitialized()) {
|
|
147
|
+
return 'Error: SaveState not initialized. Run `savestate init` first.';
|
|
148
|
+
}
|
|
149
|
+
const config = await loadConfig();
|
|
150
|
+
// Resolve adapter
|
|
151
|
+
let adapter;
|
|
152
|
+
if (input.adapter) {
|
|
153
|
+
adapter = getAdapter(input.adapter);
|
|
154
|
+
if (!adapter) {
|
|
155
|
+
return `Error: Unknown adapter: ${input.adapter}`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else if (config.defaultAdapter) {
|
|
159
|
+
adapter = getAdapter(config.defaultAdapter);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
adapter = await detectAdapter();
|
|
163
|
+
}
|
|
164
|
+
if (!adapter) {
|
|
165
|
+
return 'Error: No adapter detected. Specify one with the adapter parameter.';
|
|
166
|
+
}
|
|
167
|
+
const storage = resolveStorage(config);
|
|
168
|
+
try {
|
|
169
|
+
const result = await createSnapshot(adapter, storage, input.passphrase, {
|
|
170
|
+
label: input.label,
|
|
171
|
+
tags: input.tags,
|
|
172
|
+
full: input.full,
|
|
173
|
+
});
|
|
174
|
+
const lines = [
|
|
175
|
+
`✓ Snapshot created successfully!`,
|
|
176
|
+
``,
|
|
177
|
+
`ID: ${result.snapshot.manifest.id}`,
|
|
178
|
+
`Adapter: ${adapter.name}`,
|
|
179
|
+
`Type: ${result.incremental ? 'incremental' : 'full'}`,
|
|
180
|
+
];
|
|
181
|
+
if (input.label) {
|
|
182
|
+
lines.push(`Label: ${input.label}`);
|
|
183
|
+
}
|
|
184
|
+
if (result.incremental && result.delta) {
|
|
185
|
+
lines.push(`Changes: +${result.delta.added} added, ~${result.delta.modified} modified, -${result.delta.removed} removed`);
|
|
186
|
+
lines.push(`Chain depth: ${result.delta.chainDepth}`);
|
|
187
|
+
}
|
|
188
|
+
lines.push(`Files: ${result.fileCount}`);
|
|
189
|
+
lines.push(`Archive size: ${formatBytes(result.archiveSize)}`);
|
|
190
|
+
lines.push(`Encrypted size: ${formatBytes(result.encryptedSize)}`);
|
|
191
|
+
lines.push(`Storage: ${config.storage.type}`);
|
|
192
|
+
return lines.join('\n');
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
return `Error creating snapshot: ${err instanceof Error ? err.message : String(err)}`;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async function handleRestore(input) {
|
|
199
|
+
if (!isInitialized()) {
|
|
200
|
+
return 'Error: SaveState not initialized. Run `savestate init` first.';
|
|
201
|
+
}
|
|
202
|
+
const config = await loadConfig();
|
|
203
|
+
// Resolve adapter
|
|
204
|
+
let adapter;
|
|
205
|
+
if (input.adapter) {
|
|
206
|
+
adapter = getAdapter(input.adapter);
|
|
207
|
+
if (!adapter) {
|
|
208
|
+
return `Error: Unknown adapter: ${input.adapter}`;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else if (config.defaultAdapter) {
|
|
212
|
+
adapter = getAdapter(config.defaultAdapter);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
adapter = await detectAdapter();
|
|
216
|
+
}
|
|
217
|
+
if (!adapter) {
|
|
218
|
+
return 'Error: No adapter detected. Specify one with the adapter parameter.';
|
|
219
|
+
}
|
|
220
|
+
const storage = resolveStorage(config);
|
|
221
|
+
try {
|
|
222
|
+
const result = await restoreSnapshot(input.snapshotId, adapter, storage, input.passphrase, { dryRun: input.dryRun });
|
|
223
|
+
const lines = [
|
|
224
|
+
input.dryRun ? '✓ Dry run complete (no changes made)' : '✓ Restore complete!',
|
|
225
|
+
``,
|
|
226
|
+
`Snapshot: ${result.snapshotId}`,
|
|
227
|
+
`Timestamp: ${result.timestamp}`,
|
|
228
|
+
`Platform: ${result.platform}`,
|
|
229
|
+
`Adapter: ${result.adapter}`,
|
|
230
|
+
];
|
|
231
|
+
if (result.label) {
|
|
232
|
+
lines.push(`Label: ${result.label}`);
|
|
233
|
+
}
|
|
234
|
+
lines.push(`Identity: ${result.hasIdentity ? 'restored' : 'none'}`);
|
|
235
|
+
lines.push(`Memory entries: ${result.memoryCount}`);
|
|
236
|
+
lines.push(`Conversations: ${result.conversationCount}`);
|
|
237
|
+
return lines.join('\n');
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
return `Error restoring snapshot: ${err instanceof Error ? err.message : String(err)}`;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
async function handleList(input) {
|
|
244
|
+
if (!isInitialized()) {
|
|
245
|
+
return 'Error: SaveState not initialized. Run `savestate init` first.';
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
const index = await loadIndex();
|
|
249
|
+
let entries = index.snapshots;
|
|
250
|
+
// Filter by platform if specified
|
|
251
|
+
if (input.platform) {
|
|
252
|
+
entries = entries.filter((e) => e.platform === input.platform);
|
|
253
|
+
}
|
|
254
|
+
// Sort by timestamp (newest first)
|
|
255
|
+
entries.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
256
|
+
// Limit results
|
|
257
|
+
const limit = input.limit ?? 10;
|
|
258
|
+
entries = entries.slice(0, limit);
|
|
259
|
+
if (entries.length === 0) {
|
|
260
|
+
return 'No snapshots found.';
|
|
261
|
+
}
|
|
262
|
+
const lines = [`Found ${entries.length} snapshot(s):`, ``];
|
|
263
|
+
for (const entry of entries) {
|
|
264
|
+
const date = new Date(entry.timestamp).toLocaleString();
|
|
265
|
+
const labelPart = entry.label ? ` "${entry.label}"` : '';
|
|
266
|
+
const sizePart = entry.size ? ` (${formatBytes(entry.size)})` : '';
|
|
267
|
+
lines.push(`• ${entry.id}${labelPart}`);
|
|
268
|
+
lines.push(` ${date} | ${entry.platform}${sizePart}`);
|
|
269
|
+
}
|
|
270
|
+
return lines.join('\n');
|
|
271
|
+
}
|
|
272
|
+
catch (err) {
|
|
273
|
+
return `Error listing snapshots: ${err instanceof Error ? err.message : String(err)}`;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async function handleStatus() {
|
|
277
|
+
const initialized = isInitialized();
|
|
278
|
+
if (!initialized) {
|
|
279
|
+
return [
|
|
280
|
+
'SaveState Status: Not initialized',
|
|
281
|
+
'',
|
|
282
|
+
'Run `savestate init` to set up SaveState in this directory.',
|
|
283
|
+
].join('\n');
|
|
284
|
+
}
|
|
285
|
+
const config = await loadConfig();
|
|
286
|
+
const adapter = await detectAdapter();
|
|
287
|
+
const lines = [
|
|
288
|
+
'SaveState Status: Initialized ✓',
|
|
289
|
+
'',
|
|
290
|
+
`Storage: ${config.storage.type}`,
|
|
291
|
+
`Default adapter: ${config.defaultAdapter ?? 'auto-detect'}`,
|
|
292
|
+
`Detected adapter: ${adapter ? adapter.name : 'none'}`,
|
|
293
|
+
];
|
|
294
|
+
if (adapter) {
|
|
295
|
+
lines.push(`Adapter version: ${adapter.version}`);
|
|
296
|
+
}
|
|
297
|
+
return lines.join('\n');
|
|
298
|
+
}
|
|
299
|
+
// ─── Utilities ───────────────────────────────────────────────
|
|
300
|
+
function formatBytes(bytes) {
|
|
301
|
+
if (bytes < 1024)
|
|
302
|
+
return `${bytes} B`;
|
|
303
|
+
if (bytes < 1024 * 1024)
|
|
304
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
305
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
306
|
+
}
|
|
307
|
+
// ─── Server Setup ────────────────────────────────────────────
|
|
308
|
+
async function main() {
|
|
309
|
+
const server = new Server({
|
|
310
|
+
name: 'savestate',
|
|
311
|
+
version: '0.5.0',
|
|
312
|
+
}, {
|
|
313
|
+
capabilities: {
|
|
314
|
+
tools: {},
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
// Handle tool listing
|
|
318
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
319
|
+
return { tools };
|
|
320
|
+
});
|
|
321
|
+
// Handle tool calls
|
|
322
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
323
|
+
const { name, arguments: args } = request.params;
|
|
324
|
+
try {
|
|
325
|
+
let result;
|
|
326
|
+
switch (name) {
|
|
327
|
+
case 'savestate_snapshot': {
|
|
328
|
+
const input = SnapshotInputSchema.parse(args);
|
|
329
|
+
result = await handleSnapshot(input);
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
case 'savestate_restore': {
|
|
333
|
+
const input = RestoreInputSchema.parse(args);
|
|
334
|
+
result = await handleRestore(input);
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
case 'savestate_list': {
|
|
338
|
+
const input = ListInputSchema.parse(args);
|
|
339
|
+
result = await handleList(input);
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
case 'savestate_status': {
|
|
343
|
+
result = await handleStatus();
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
default:
|
|
347
|
+
result = `Unknown tool: ${name}`;
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
content: [{ type: 'text', text: result }],
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
catch (err) {
|
|
354
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
355
|
+
return {
|
|
356
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
357
|
+
isError: true,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
// Start server with stdio transport
|
|
362
|
+
const transport = new StdioServerTransport();
|
|
363
|
+
await server.connect(transport);
|
|
364
|
+
// Log to stderr (stdout is for MCP protocol)
|
|
365
|
+
console.error('SaveState MCP server running on stdio');
|
|
366
|
+
}
|
|
367
|
+
main().catch((err) => {
|
|
368
|
+
console.error('Fatal error:', err);
|
|
369
|
+
process.exit(1);
|
|
370
|
+
});
|
|
371
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAA2B,MAAM,kBAAkB,CAAC;AAEtE,gEAAgE;AAEhE,MAAM,KAAK,G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AAC;YACjE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBACtD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,oCAAoC;IACpC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,6CAA6C;IAC7C,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACzD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Capabilities
|
|
3
|
+
*
|
|
4
|
+
* Defines what each platform supports for compatibility checking.
|
|
5
|
+
*/
|
|
6
|
+
import type { Platform, PlatformCapabilities } from './types.js';
|
|
7
|
+
export declare const PLATFORM_CAPABILITIES: Record<Platform, PlatformCapabilities>;
|
|
8
|
+
/**
|
|
9
|
+
* Get capabilities for a platform.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getPlatformCapabilities(platform: Platform): PlatformCapabilities;
|
|
12
|
+
/**
|
|
13
|
+
* Check if a migration path is supported.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isMigrationSupported(source: Platform, target: Platform): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Get all supported migration paths.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSupportedMigrations(): Array<{
|
|
20
|
+
source: Platform;
|
|
21
|
+
target: Platform;
|
|
22
|
+
}>;
|
|
23
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/migrate/capabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEjE,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,QAAQ,EAAE,oBAAoB,CA+CxE,CAAC;AAEF;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,oBAAoB,CAEhF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAQhF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,KAAK,CAAC;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC,CAKtF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Capabilities
|
|
3
|
+
*
|
|
4
|
+
* Defines what each platform supports for compatibility checking.
|
|
5
|
+
*/
|
|
6
|
+
export const PLATFORM_CAPABILITIES = {
|
|
7
|
+
chatgpt: {
|
|
8
|
+
id: 'chatgpt',
|
|
9
|
+
name: 'ChatGPT',
|
|
10
|
+
instructionLimit: 1500,
|
|
11
|
+
hasMemory: true,
|
|
12
|
+
memoryLimit: 100,
|
|
13
|
+
hasFiles: true,
|
|
14
|
+
fileSizeLimit: 512 * 1024 * 1024, // 512MB
|
|
15
|
+
hasProjects: false,
|
|
16
|
+
hasConversations: true,
|
|
17
|
+
hasCustomBots: true,
|
|
18
|
+
},
|
|
19
|
+
claude: {
|
|
20
|
+
id: 'claude',
|
|
21
|
+
name: 'Claude',
|
|
22
|
+
instructionLimit: 8000, // System prompt can be much longer
|
|
23
|
+
hasMemory: false, // Claude uses project knowledge instead
|
|
24
|
+
hasFiles: true,
|
|
25
|
+
fileSizeLimit: 32 * 1024 * 1024, // 32MB per file
|
|
26
|
+
hasProjects: true,
|
|
27
|
+
hasConversations: true,
|
|
28
|
+
hasCustomBots: false, // Projects serve this role
|
|
29
|
+
},
|
|
30
|
+
gemini: {
|
|
31
|
+
id: 'gemini',
|
|
32
|
+
name: 'Gemini',
|
|
33
|
+
instructionLimit: 4000,
|
|
34
|
+
hasMemory: true,
|
|
35
|
+
memoryLimit: 50,
|
|
36
|
+
hasFiles: true,
|
|
37
|
+
fileSizeLimit: 20 * 1024 * 1024, // 20MB
|
|
38
|
+
hasProjects: false,
|
|
39
|
+
hasConversations: true,
|
|
40
|
+
hasCustomBots: false,
|
|
41
|
+
},
|
|
42
|
+
copilot: {
|
|
43
|
+
id: 'copilot',
|
|
44
|
+
name: 'Microsoft Copilot',
|
|
45
|
+
instructionLimit: 2000,
|
|
46
|
+
hasMemory: true,
|
|
47
|
+
hasFiles: true,
|
|
48
|
+
fileSizeLimit: 10 * 1024 * 1024, // 10MB
|
|
49
|
+
hasProjects: false,
|
|
50
|
+
hasConversations: true,
|
|
51
|
+
hasCustomBots: false,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Get capabilities for a platform.
|
|
56
|
+
*/
|
|
57
|
+
export function getPlatformCapabilities(platform) {
|
|
58
|
+
return PLATFORM_CAPABILITIES[platform];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Check if a migration path is supported.
|
|
62
|
+
*/
|
|
63
|
+
export function isMigrationSupported(source, target) {
|
|
64
|
+
// Currently supported paths
|
|
65
|
+
const supported = [
|
|
66
|
+
['chatgpt', 'claude'],
|
|
67
|
+
['claude', 'chatgpt'],
|
|
68
|
+
];
|
|
69
|
+
return supported.some(([s, t]) => s === source && t === target);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get all supported migration paths.
|
|
73
|
+
*/
|
|
74
|
+
export function getSupportedMigrations() {
|
|
75
|
+
return [
|
|
76
|
+
{ source: 'chatgpt', target: 'claude' },
|
|
77
|
+
{ source: 'claude', target: 'chatgpt' },
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/migrate/capabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAA2C;IAC3E,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,GAAG;QAChB,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,EAAE,QAAQ;QAC1C,WAAW,EAAE,KAAK;QAClB,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,IAAI;KACpB;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,IAAI,EAAE,mCAAmC;QAC3D,SAAS,EAAE,KAAK,EAAE,wCAAwC;QAC1D,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,gBAAgB;QACjD,WAAW,EAAE,IAAI;QACjB,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,KAAK,EAAE,2BAA2B;KAClD;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,EAAE;QACf,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO;QACxC,WAAW,EAAE,KAAK;QAClB,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,KAAK;KACrB;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,mBAAmB;QACzB,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO;QACxC,WAAW,EAAE,KAAK;QAClB,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,KAAK;KACrB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAkB;IACxD,OAAO,qBAAqB,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAgB,EAAE,MAAgB;IACrE,4BAA4B;IAC5B,MAAM,SAAS,GAAG;QAChB,CAAC,SAAS,EAAE,QAAQ,CAAC;QACrB,CAAC,QAAQ,EAAE,SAAS,CAAC;KACtB,CAAC;IAEF,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,MAAM,CAAC,CAAC;AAClE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE;QACvC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;KACxC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extractor Registry
|
|
3
|
+
*
|
|
4
|
+
* Manages available extractors for different platforms.
|
|
5
|
+
* New extractors are registered here.
|
|
6
|
+
*/
|
|
7
|
+
import type { Platform, Extractor } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Register an extractor for a platform.
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerExtractor(platform: Platform, factory: () => Extractor): void;
|
|
12
|
+
/**
|
|
13
|
+
* Get an extractor for a platform.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getExtractor(platform: Platform): Extractor | null;
|
|
16
|
+
/**
|
|
17
|
+
* List all registered extractors.
|
|
18
|
+
*/
|
|
19
|
+
export declare function listExtractors(): Platform[];
|
|
20
|
+
/**
|
|
21
|
+
* Check if an extractor exists for a platform.
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasExtractor(platform: Platform): boolean;
|
|
24
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/migrate/extractors/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIvD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,IAAI,CAEpF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAGjE;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,QAAQ,EAAE,CAE3C;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAExD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extractor Registry
|
|
3
|
+
*
|
|
4
|
+
* Manages available extractors for different platforms.
|
|
5
|
+
* New extractors are registered here.
|
|
6
|
+
*/
|
|
7
|
+
const extractors = new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Register an extractor for a platform.
|
|
10
|
+
*/
|
|
11
|
+
export function registerExtractor(platform, factory) {
|
|
12
|
+
extractors.set(platform, factory);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get an extractor for a platform.
|
|
16
|
+
*/
|
|
17
|
+
export function getExtractor(platform) {
|
|
18
|
+
const factory = extractors.get(platform);
|
|
19
|
+
return factory ? factory() : null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* List all registered extractors.
|
|
23
|
+
*/
|
|
24
|
+
export function listExtractors() {
|
|
25
|
+
return [...extractors.keys()];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if an extractor exists for a platform.
|
|
29
|
+
*/
|
|
30
|
+
export function hasExtractor(platform) {
|
|
31
|
+
return extractors.has(platform);
|
|
32
|
+
}
|
|
33
|
+
// ─── Register Built-in Extractors ────────────────────────────
|
|
34
|
+
// ChatGPT extractor will be registered in #24
|
|
35
|
+
// registerExtractor('chatgpt', () => new ChatGPTExtractor());
|
|
36
|
+
// Claude extractor will be registered in #29
|
|
37
|
+
// registerExtractor('claude', () => new ClaudeExtractor());
|
|
38
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/migrate/extractors/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,GAAG,IAAI,GAAG,EAA6B,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkB,EAAE,OAAwB;IAC5E,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAkB;IAC7C,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzC,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAkB;IAC7C,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,gEAAgE;AAEhE,8CAA8C;AAC9C,8DAA8D;AAE9D,6CAA6C;AAC7C,4DAA4D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration Wizard
|
|
3
|
+
*
|
|
4
|
+
* Platform-to-platform AI identity migration.
|
|
5
|
+
* Extract → Transform → Load
|
|
6
|
+
*/
|
|
7
|
+
export type { Platform, PlatformCapabilities, MigrationBundle, MigrationContents, MigrationState, MigrationPhase, MigrationOptions, MigrationCheckpoint, CompatibilityReport, CompatibilityItem, CompatibilityStatus, Extractor, ExtractOptions, Transformer, TransformOptions, Loader, LoadOptions, LoadResult, } from './types.js';
|
|
8
|
+
export { MigrationOrchestrator, type MigrationEvent, type MigrationEventHandler } from './orchestrator.js';
|
|
9
|
+
export { getExtractor, registerExtractor, listExtractors, hasExtractor } from './extractors/registry.js';
|
|
10
|
+
export { getTransformer, registerTransformer, listTransformers, hasTransformer } from './transformers/registry.js';
|
|
11
|
+
export { getLoader, registerLoader, listLoaders, hasLoader } from './loaders/registry.js';
|
|
12
|
+
export { getPlatformCapabilities, PLATFORM_CAPABILITIES } from './capabilities.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,WAAW,EACX,UAAU,GACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,qBAAqB,EAAE,KAAK,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG3G,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG1F,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
|