@livestore/cli 0.0.0-snapshot-7fec227f317fc3d47465077490fa0d09a16d739b → 0.0.0-snapshot-29b38715366635e2fffea5f896089d326087c0f2
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.d.ts +15 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/import-export.d.ts +34 -0
- package/dist/commands/import-export.d.ts.map +1 -0
- package/dist/commands/import-export.js +123 -0
- package/dist/commands/import-export.js.map +1 -0
- package/dist/commands/mcp-tool-handlers.d.ts +5 -1
- package/dist/commands/mcp-tool-handlers.d.ts.map +1 -1
- package/dist/commands/mcp-tool-handlers.js +37 -4
- package/dist/commands/mcp-tool-handlers.js.map +1 -1
- package/dist/commands/mcp-tools-defs.d.ts +31 -1
- package/dist/commands/mcp-tools-defs.d.ts.map +1 -1
- package/dist/commands/mcp-tools-defs.js +87 -5
- package/dist/commands/mcp-tools-defs.js.map +1 -1
- package/dist/commands/new-project.d.ts +1 -1
- package/dist/mcp-runtime/runtime.d.ts +4 -3
- package/dist/mcp-runtime/runtime.d.ts.map +1 -1
- package/dist/mcp-runtime/runtime.js +19 -53
- package/dist/mcp-runtime/runtime.js.map +1 -1
- package/dist/module-loader.d.ts +22 -0
- package/dist/module-loader.d.ts.map +1 -0
- package/dist/module-loader.js +75 -0
- package/dist/module-loader.js.map +1 -0
- package/dist/sync-operations.d.ts +118 -0
- package/dist/sync-operations.d.ts.map +1 -0
- package/dist/sync-operations.js +164 -0
- package/dist/sync-operations.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/cli.ts +2 -1
- package/src/commands/import-export.ts +262 -0
- package/src/commands/mcp-tool-handlers.ts +44 -5
- package/src/commands/mcp-tools-defs.ts +92 -4
- package/src/mcp-runtime/runtime.ts +32 -65
- package/src/module-loader.ts +93 -0
- package/src/sync-operations.ts +326 -0
package/dist/cli.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { Cli } from '@livestore/utils/node';
|
|
2
|
-
export declare const command: Cli.Command.Command<"livestore", import("@effect/platform/HttpClient").HttpClient | Cli.Prompt.Prompt.Environment | import("@effect/platform/CommandExecutor").CommandExecutor, Error | import("@effect/platform/
|
|
2
|
+
export declare const command: Cli.Command.Command<"livestore", import("@effect/platform/HttpClient").HttpClient | Cli.Prompt.Prompt.Environment | import("@effect/platform/CommandExecutor").CommandExecutor, Error | import("@effect/platform/Error").PlatformError | import("@effect/platform/HttpClientError").ResponseError, {
|
|
3
3
|
readonly verbose: boolean;
|
|
4
4
|
readonly subcommand: import("effect/Option").Option<{
|
|
5
|
+
readonly subcommand: import("effect/Option").Option<{
|
|
6
|
+
readonly config: string;
|
|
7
|
+
readonly storeId: string;
|
|
8
|
+
readonly clientId: string;
|
|
9
|
+
readonly output: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly config: string;
|
|
12
|
+
readonly storeId: string;
|
|
13
|
+
readonly clientId: string;
|
|
14
|
+
readonly force: boolean;
|
|
15
|
+
readonly dryRun: boolean;
|
|
16
|
+
readonly input: string;
|
|
17
|
+
}>;
|
|
18
|
+
} | {
|
|
5
19
|
readonly subcommand: import("effect/Option").Option<{}>;
|
|
6
20
|
} | {
|
|
7
21
|
readonly example: import("effect/Option").Option<string>;
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAK3C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;EAE0D,CAAA"}
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Cli } from '@livestore/utils/node';
|
|
2
|
+
import { syncCommand } from "./commands/import-export.js";
|
|
2
3
|
import { mcpCommand } from "./commands/mcp.js";
|
|
3
4
|
import { createCommand } from "./commands/new-project.js";
|
|
4
5
|
export const command = Cli.Command.make('livestore', {
|
|
5
6
|
verbose: Cli.Options.boolean('verbose').pipe(Cli.Options.withDefault(false)),
|
|
6
|
-
}).pipe(Cli.Command.withSubcommands([mcpCommand, createCommand]));
|
|
7
|
+
}).pipe(Cli.Command.withSubcommands([mcpCommand, createCommand, syncCommand]));
|
|
7
8
|
//# 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":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;IACnD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;CAC7E,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;IACnD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;CAC7E,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { UnknownError } from '@livestore/common';
|
|
2
|
+
import { FileSystem, type HttpClient } from '@livestore/utils/effect';
|
|
3
|
+
import { Cli } from '@livestore/utils/node';
|
|
4
|
+
import * as SyncOps from '../sync-operations.ts';
|
|
5
|
+
export declare const exportCommand: Cli.Command.Command<"export", FileSystem.FileSystem | HttpClient.HttpClient, UnknownError | SyncOps.ConnectionError | SyncOps.ExportError, {
|
|
6
|
+
readonly config: string;
|
|
7
|
+
readonly storeId: string;
|
|
8
|
+
readonly clientId: string;
|
|
9
|
+
readonly output: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const importCommand: Cli.Command.Command<"import", FileSystem.FileSystem | HttpClient.HttpClient, UnknownError | SyncOps.ConnectionError | SyncOps.ImportError, {
|
|
12
|
+
readonly config: string;
|
|
13
|
+
readonly storeId: string;
|
|
14
|
+
readonly clientId: string;
|
|
15
|
+
readonly force: boolean;
|
|
16
|
+
readonly dryRun: boolean;
|
|
17
|
+
readonly input: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const syncCommand: Cli.Command.Command<"sync", FileSystem.FileSystem | HttpClient.HttpClient, UnknownError | SyncOps.ConnectionError | SyncOps.ExportError | SyncOps.ImportError, {
|
|
20
|
+
readonly subcommand: import("effect/Option").Option<{
|
|
21
|
+
readonly config: string;
|
|
22
|
+
readonly storeId: string;
|
|
23
|
+
readonly clientId: string;
|
|
24
|
+
readonly output: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly config: string;
|
|
27
|
+
readonly storeId: string;
|
|
28
|
+
readonly clientId: string;
|
|
29
|
+
readonly force: boolean;
|
|
30
|
+
readonly dryRun: boolean;
|
|
31
|
+
readonly input: string;
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=import-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-export.d.ts","sourceRoot":"","sources":["../../src/commands/import-export.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAmB,UAAU,EAAE,KAAK,UAAU,EAAc,MAAM,yBAAyB,CAAA;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAiJhD,eAAO,MAAM,aAAa;;;;;EA6CzB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;EA4DzB,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EAGvB,CAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { Console, Effect, FileSystem } from '@livestore/utils/effect';
|
|
3
|
+
import { Cli } from '@livestore/utils/node';
|
|
4
|
+
import * as SyncOps from "../sync-operations.js";
|
|
5
|
+
/**
|
|
6
|
+
* Export events from the sync backend to a JSON file.
|
|
7
|
+
*/
|
|
8
|
+
const exportEvents = ({ configPath, storeId, clientId, outputPath, }) => Effect.gen(function* () {
|
|
9
|
+
yield* Console.log(`Connecting to sync backend...`);
|
|
10
|
+
const result = yield* SyncOps.pullEventsFromSyncBackend({ configPath, storeId, clientId });
|
|
11
|
+
yield* Console.log(`✓ Connected to sync backend`);
|
|
12
|
+
yield* Console.log(`Pulled ${result.eventCount} events`);
|
|
13
|
+
const fs = yield* FileSystem.FileSystem;
|
|
14
|
+
const absOutputPath = path.isAbsolute(outputPath) ? outputPath : path.resolve(process.cwd(), outputPath);
|
|
15
|
+
yield* fs.writeFileString(absOutputPath, JSON.stringify(result.data, null, 2)).pipe(Effect.mapError((cause) => new SyncOps.ExportError({
|
|
16
|
+
cause,
|
|
17
|
+
note: `Failed to write export file: ${cause}`,
|
|
18
|
+
})));
|
|
19
|
+
yield* Console.log(`Exported ${result.eventCount} events to ${absOutputPath}`);
|
|
20
|
+
}).pipe(Effect.withSpan('cli:export'));
|
|
21
|
+
/**
|
|
22
|
+
* Import events from a JSON file to the sync backend.
|
|
23
|
+
*/
|
|
24
|
+
const importEvents = ({ configPath, storeId, clientId, inputPath, force, dryRun, }) => Effect.gen(function* () {
|
|
25
|
+
const fs = yield* FileSystem.FileSystem;
|
|
26
|
+
const absInputPath = path.isAbsolute(inputPath) ? inputPath : path.resolve(process.cwd(), inputPath);
|
|
27
|
+
const exists = yield* fs.exists(absInputPath).pipe(Effect.mapError((cause) => new SyncOps.ImportError({
|
|
28
|
+
cause,
|
|
29
|
+
note: `Failed to check file existence: ${cause}`,
|
|
30
|
+
})));
|
|
31
|
+
if (!exists) {
|
|
32
|
+
return yield* new SyncOps.ImportError({
|
|
33
|
+
cause: new Error(`File not found: ${absInputPath}`),
|
|
34
|
+
note: `Import file does not exist at ${absInputPath}`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
yield* Console.log(`Reading import file...`);
|
|
38
|
+
const fileContent = yield* fs.readFileString(absInputPath).pipe(Effect.mapError((cause) => new SyncOps.ImportError({
|
|
39
|
+
cause,
|
|
40
|
+
note: `Failed to read import file: ${cause}`,
|
|
41
|
+
})));
|
|
42
|
+
const parsedContent = yield* Effect.try({
|
|
43
|
+
try: () => JSON.parse(fileContent),
|
|
44
|
+
catch: (error) => new SyncOps.ImportError({
|
|
45
|
+
cause: new Error(`Failed to parse JSON: ${error instanceof Error ? error.message : String(error)}`),
|
|
46
|
+
note: `Invalid JSON in import file: ${error instanceof Error ? error.message : String(error)}`,
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
/** Validate export file format before proceeding */
|
|
50
|
+
const validation = yield* SyncOps.validateExportData({ data: parsedContent, targetStoreId: storeId });
|
|
51
|
+
if (validation.storeIdMismatch) {
|
|
52
|
+
if (!force) {
|
|
53
|
+
return yield* new SyncOps.ImportError({
|
|
54
|
+
cause: new Error(`Store ID mismatch: file has '${validation.sourceStoreId}', expected '${storeId}'`),
|
|
55
|
+
note: `The export file was created for a different store. Use --force to import anyway.`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
yield* Console.log(`Store ID mismatch: file has '${validation.sourceStoreId}', importing to '${storeId}' (--force)`);
|
|
59
|
+
}
|
|
60
|
+
yield* Console.log(`Found ${validation.eventCount} events in export file`);
|
|
61
|
+
if (dryRun) {
|
|
62
|
+
yield* Console.log(`Dry run - validating import file...`);
|
|
63
|
+
yield* Console.log(`Dry run complete. ${validation.eventCount} events would be imported.`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
yield* Console.log(`Connecting to sync backend...`);
|
|
67
|
+
const result = yield* SyncOps.pushEventsToSyncBackend({
|
|
68
|
+
configPath,
|
|
69
|
+
storeId,
|
|
70
|
+
clientId,
|
|
71
|
+
data: parsedContent,
|
|
72
|
+
force,
|
|
73
|
+
dryRun: false,
|
|
74
|
+
});
|
|
75
|
+
yield* Console.log(`✓ Connected to sync backend`);
|
|
76
|
+
yield* Console.log(`Successfully imported ${result.eventCount} events`);
|
|
77
|
+
}).pipe(Effect.withSpan('cli:import'));
|
|
78
|
+
export const exportCommand = Cli.Command.make('export', {
|
|
79
|
+
config: Cli.Options.text('config').pipe(Cli.Options.withAlias('c'), Cli.Options.withDescription('Path to the config module that exports schema and syncBackend')),
|
|
80
|
+
storeId: Cli.Options.text('store-id').pipe(Cli.Options.withAlias('i'), Cli.Options.withDescription('Store identifier')),
|
|
81
|
+
clientId: Cli.Options.text('client-id').pipe(Cli.Options.withDefault('cli-export'), Cli.Options.withDescription('Client identifier for the sync connection')),
|
|
82
|
+
output: Cli.Args.text({ name: 'file' }).pipe(Cli.Args.withDescription('Output JSON file path')),
|
|
83
|
+
}, Effect.fn(function* ({ config, storeId, clientId, output, }) {
|
|
84
|
+
yield* Console.log(`Exporting events from LiveStore...`);
|
|
85
|
+
yield* Console.log(` Config: ${config}`);
|
|
86
|
+
yield* Console.log(` Store ID: ${storeId}`);
|
|
87
|
+
yield* Console.log(` Output: ${output}`);
|
|
88
|
+
yield* Console.log('');
|
|
89
|
+
yield* exportEvents({
|
|
90
|
+
configPath: config,
|
|
91
|
+
storeId,
|
|
92
|
+
clientId,
|
|
93
|
+
outputPath: output,
|
|
94
|
+
}).pipe(Effect.scoped);
|
|
95
|
+
})).pipe(Cli.Command.withDescription('Export all events from the sync backend to a JSON file. Useful for backup and migration.'));
|
|
96
|
+
export const importCommand = Cli.Command.make('import', {
|
|
97
|
+
config: Cli.Options.text('config').pipe(Cli.Options.withAlias('c'), Cli.Options.withDescription('Path to the config module that exports schema and syncBackend')),
|
|
98
|
+
storeId: Cli.Options.text('store-id').pipe(Cli.Options.withAlias('i'), Cli.Options.withDescription('Store identifier')),
|
|
99
|
+
clientId: Cli.Options.text('client-id').pipe(Cli.Options.withDefault('cli-import'), Cli.Options.withDescription('Client identifier for the sync connection')),
|
|
100
|
+
force: Cli.Options.boolean('force').pipe(Cli.Options.withAlias('f'), Cli.Options.withDefault(false), Cli.Options.withDescription('Force import even if store ID does not match')),
|
|
101
|
+
dryRun: Cli.Options.boolean('dry-run').pipe(Cli.Options.withDefault(false), Cli.Options.withDescription('Validate the import file without actually importing')),
|
|
102
|
+
input: Cli.Args.text({ name: 'file' }).pipe(Cli.Args.withDescription('Input JSON file to import')),
|
|
103
|
+
}, Effect.fn(function* ({ config, storeId, clientId, force, dryRun, input, }) {
|
|
104
|
+
yield* Console.log(`Importing events to LiveStore...`);
|
|
105
|
+
yield* Console.log(` Config: ${config}`);
|
|
106
|
+
yield* Console.log(` Store ID: ${storeId}`);
|
|
107
|
+
yield* Console.log(` Input: ${input}`);
|
|
108
|
+
if (force)
|
|
109
|
+
yield* Console.log(` Force: enabled`);
|
|
110
|
+
if (dryRun)
|
|
111
|
+
yield* Console.log(` Dry run: enabled`);
|
|
112
|
+
yield* Console.log('');
|
|
113
|
+
yield* importEvents({
|
|
114
|
+
configPath: config,
|
|
115
|
+
storeId,
|
|
116
|
+
clientId,
|
|
117
|
+
inputPath: input,
|
|
118
|
+
force,
|
|
119
|
+
dryRun,
|
|
120
|
+
}).pipe(Effect.scoped);
|
|
121
|
+
})).pipe(Cli.Command.withDescription('Import events from a JSON file to the sync backend. The sync backend must be empty.'));
|
|
122
|
+
export const syncCommand = Cli.Command.make('sync').pipe(Cli.Command.withSubcommands([exportCommand, importCommand]), Cli.Command.withDescription('Import and export events from the sync backend'));
|
|
123
|
+
//# sourceMappingURL=import-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-export.js","sourceRoot":"","sources":["../../src/commands/import-export.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAA+B,MAAM,yBAAyB,CAAA;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAEhD;;GAEG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,GAMX,EAIC,EAAE,CACF,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAA;IAEnD,MAAM,MAAM,G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,KAAK,EAAE,CAAC,CAAA;IACxC,IAAI,KAAK;QAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAClD,IAAI,MAAM;QAAE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;IACrD,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAEtB,KAAK,CAAC,CAAC,YAAY,CAAC;QAClB,UAAU,EAAE,MAAM;QAClB,OAAO;QACP,QAAQ;QACR,SAAS,EAAE,KAAK;QAChB,KAAK;QACL,MAAM;KACP,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AACxB,CAAC,CAAC,CACH,CAAC,IAAI,CACJ,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,qFAAqF,CAAC,CACnH,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CACtD,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,EAC3D,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,gDAAgD,CAAC,CAC9E,CAAA"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { type Toolkit } from '@livestore/utils/effect';
|
|
2
|
+
import { livestoreToolkit } from './mcp-tools-defs.ts';
|
|
3
|
+
type LivestoreToolHandlers = Toolkit.HandlersFrom<Toolkit.Tools<typeof livestoreToolkit>>;
|
|
4
|
+
export declare const toolHandlers: LivestoreToolHandlers;
|
|
5
|
+
export {};
|
|
2
6
|
//# sourceMappingURL=mcp-tool-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tool-handlers.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tool-handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-tool-handlers.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tool-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAStF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAKtD,KAAK,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAA;AAEzF,eAAO,MAAM,YAAY,EAAE,qBAqLzB,CAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { Effect } from '@livestore/utils/effect';
|
|
1
|
+
import { Effect, FetchHttpClient, Layer } from '@livestore/utils/effect';
|
|
2
|
+
import { PlatformNode } from '@livestore/utils/node';
|
|
2
3
|
import { blogSchemaContent } from "../mcp-content/schemas/blog.js";
|
|
3
4
|
import { ecommerceSchemaContent } from "../mcp-content/schemas/ecommerce.js";
|
|
4
5
|
import { socialSchemaContent } from "../mcp-content/schemas/social.js";
|
|
5
6
|
import { todoSchemaContent } from "../mcp-content/schemas/todo.js";
|
|
6
7
|
import * as Runtime from "../mcp-runtime/runtime.js";
|
|
8
|
+
import * as SyncOps from "../sync-operations.js";
|
|
7
9
|
import { coachToolHandler } from "./mcp-coach.js";
|
|
8
10
|
import { livestoreToolkit } from "./mcp-tools-defs.js";
|
|
9
|
-
|
|
11
|
+
/** Layer providing FileSystem and HttpClient for sync operations */
|
|
12
|
+
const SyncOpsLayer = Layer.mergeAll(PlatformNode.NodeFileSystem.layer, FetchHttpClient.layer);
|
|
10
13
|
export const toolHandlers = livestoreToolkit.of({
|
|
11
14
|
livestore_coach: coachToolHandler,
|
|
12
15
|
livestore_generate_schema: Effect.fnUntraced(function* ({ schemaType, customDescription }) {
|
|
@@ -110,8 +113,13 @@ export const schema = Schema.create({
|
|
|
110
113
|
return { schemaCode, description };
|
|
111
114
|
}),
|
|
112
115
|
// Connect the single in-process LiveStore instance from user module
|
|
113
|
-
livestore_instance_connect: Effect.fnUntraced(function* ({
|
|
114
|
-
const store = yield* Runtime.init({
|
|
116
|
+
livestore_instance_connect: Effect.fnUntraced(function* ({ configPath, storeId, clientId, sessionId }) {
|
|
117
|
+
const store = yield* Runtime.init({
|
|
118
|
+
configPath,
|
|
119
|
+
storeId,
|
|
120
|
+
...(clientId !== undefined ? { clientId } : {}),
|
|
121
|
+
...(sessionId !== undefined ? { sessionId } : {}),
|
|
122
|
+
}).pipe(Effect.orDie);
|
|
115
123
|
const eventNames = Array.from(store.schema.eventsDefsMap.keys());
|
|
116
124
|
const tableNames = Array.from(store.schema.state.sqlite.tables.keys());
|
|
117
125
|
return {
|
|
@@ -140,5 +148,30 @@ export const schema = Schema.create({
|
|
|
140
148
|
livestore_instance_disconnect: Effect.fnUntraced(function* () {
|
|
141
149
|
return yield* Runtime.disconnect;
|
|
142
150
|
}),
|
|
151
|
+
// Sync export - pull all events from sync backend
|
|
152
|
+
livestore_sync_export: Effect.fnUntraced(function* ({ configPath, storeId, clientId }) {
|
|
153
|
+
const result = yield* SyncOps.pullEventsFromSyncBackend({
|
|
154
|
+
configPath,
|
|
155
|
+
storeId,
|
|
156
|
+
clientId: clientId ?? 'mcp-export',
|
|
157
|
+
}).pipe(Effect.scoped, Effect.provide(SyncOpsLayer), Effect.orDie);
|
|
158
|
+
return {
|
|
159
|
+
storeId: result.storeId,
|
|
160
|
+
eventCount: result.eventCount,
|
|
161
|
+
exportedAt: result.exportedAt,
|
|
162
|
+
data: result.data,
|
|
163
|
+
};
|
|
164
|
+
}),
|
|
165
|
+
// Sync import - push events to sync backend
|
|
166
|
+
livestore_sync_import: Effect.fnUntraced(function* ({ configPath, storeId, clientId, data, force, dryRun }) {
|
|
167
|
+
return yield* SyncOps.pushEventsToSyncBackend({
|
|
168
|
+
configPath,
|
|
169
|
+
storeId,
|
|
170
|
+
clientId: clientId ?? 'mcp-import',
|
|
171
|
+
data,
|
|
172
|
+
force: force ?? false,
|
|
173
|
+
dryRun: dryRun ?? false,
|
|
174
|
+
}).pipe(Effect.scoped, Effect.provide(SyncOpsLayer), Effect.orDie);
|
|
175
|
+
}),
|
|
143
176
|
});
|
|
144
177
|
//# sourceMappingURL=mcp-tool-handlers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tool-handlers.js","sourceRoot":"","sources":["../../src/commands/mcp-tool-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp-tool-handlers.js","sourceRoot":"","sources":["../../src/commands/mcp-tool-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAgB,MAAM,yBAAyB,CAAA;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAA;AACpD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,oEAAoE;AACpE,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,CAAA;AAI7F,MAAM,CAAC,MAAM,YAAY,GAA0B,gBAAgB,CAAC,EAAE,CAAC;IACrE,eAAe,EAAE,gBAAgB;IAEjC,yBAAyB,EAAE,MAAM,CAAC,UA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B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IACpE,CAAC,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -35,7 +35,7 @@ export declare const livestoreToolkit: Toolkit.Toolkit<{
|
|
|
35
35
|
}, never>;
|
|
36
36
|
readonly livestore_instance_connect: Tool.Tool<"livestore_instance_connect", {
|
|
37
37
|
readonly parameters: Schema.Struct<{
|
|
38
|
-
|
|
38
|
+
configPath: Schema.SchemaClass<string, string, never>;
|
|
39
39
|
storeId: Schema.SchemaClass<string, string, never>;
|
|
40
40
|
clientId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
41
41
|
sessionId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
@@ -89,5 +89,35 @@ export declare const livestoreToolkit: Toolkit.Toolkit<{
|
|
|
89
89
|
readonly success: Schema.TaggedStruct<"disconnected", {}>;
|
|
90
90
|
readonly failure: typeof Schema.Never;
|
|
91
91
|
}, never>;
|
|
92
|
+
readonly livestore_sync_export: Tool.Tool<"livestore_sync_export", {
|
|
93
|
+
readonly parameters: Schema.Struct<{
|
|
94
|
+
configPath: Schema.SchemaClass<string, string, never>;
|
|
95
|
+
storeId: Schema.SchemaClass<string, string, never>;
|
|
96
|
+
clientId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
97
|
+
}>;
|
|
98
|
+
readonly success: Schema.Struct<{
|
|
99
|
+
storeId: typeof Schema.String;
|
|
100
|
+
eventCount: typeof Schema.Number;
|
|
101
|
+
exportedAt: typeof Schema.String;
|
|
102
|
+
data: Schema.Schema<Schema.JsonValue, Schema.JsonValue, never>;
|
|
103
|
+
}>;
|
|
104
|
+
readonly failure: typeof Schema.Never;
|
|
105
|
+
}, never>;
|
|
106
|
+
readonly livestore_sync_import: Tool.Tool<"livestore_sync_import", {
|
|
107
|
+
readonly parameters: Schema.Struct<{
|
|
108
|
+
configPath: Schema.SchemaClass<string, string, never>;
|
|
109
|
+
storeId: Schema.SchemaClass<string, string, never>;
|
|
110
|
+
clientId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
111
|
+
data: Schema.Schema<Schema.JsonValue, Schema.JsonValue, never>;
|
|
112
|
+
force: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
113
|
+
dryRun: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
114
|
+
}>;
|
|
115
|
+
readonly success: Schema.Struct<{
|
|
116
|
+
storeId: typeof Schema.String;
|
|
117
|
+
eventCount: typeof Schema.Number;
|
|
118
|
+
dryRun: typeof Schema.Boolean;
|
|
119
|
+
}>;
|
|
120
|
+
readonly failure: typeof Schema.Never;
|
|
121
|
+
}, never>;
|
|
92
122
|
}>;
|
|
93
123
|
//# sourceMappingURL=mcp-tools-defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tools-defs.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tools-defs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAG/D,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"mcp-tools-defs.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tools-defs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAG/D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyT5B,CAAA"}
|
|
@@ -30,7 +30,7 @@ export const livestoreToolkit = Toolkit.make(coachTool, Tool.make('livestore_gen
|
|
|
30
30
|
Notes:
|
|
31
31
|
- Only one instance can be active at a time; calling connect again shuts down and replaces the previous instance.
|
|
32
32
|
- Reconnecting creates a fresh, in-memory client database. The state visible to queries is populated by your backend's initial sync behavior; depending on configuration, you may briefly observe empty or partial data until sync completes.
|
|
33
|
-
- \`
|
|
33
|
+
- \`configPath\` is resolved relative to the current working directory.
|
|
34
34
|
- \`syncBackend\` must be a function (factory) that returns a backend; \`syncPayload\` must be JSON-serializable.
|
|
35
35
|
|
|
36
36
|
Module contract (generic example):
|
|
@@ -50,13 +50,13 @@ export const syncPayload = { authToken: process.env.LIVESTORE_SYNC_AUTH_TOKEN ??
|
|
|
50
50
|
|
|
51
51
|
Connect parameters:
|
|
52
52
|
{
|
|
53
|
-
"
|
|
53
|
+
"configPath": "livestore-cli.config.ts",
|
|
54
54
|
"storeId": "<store-id>"
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
Optional identifiers to group client state on the server:
|
|
58
58
|
{
|
|
59
|
-
"
|
|
59
|
+
"configPath": "livestore-cli.config.ts",
|
|
60
60
|
"storeId": "<store-id>",
|
|
61
61
|
"clientId": "<client-id>",
|
|
62
62
|
"sessionId": "<session-id>"
|
|
@@ -73,7 +73,7 @@ Returns on success:
|
|
|
73
73
|
}
|
|
74
74
|
}`,
|
|
75
75
|
parameters: {
|
|
76
|
-
|
|
76
|
+
configPath: Schema.String.annotations({
|
|
77
77
|
description: 'Path to a module that exports named variables: schema and syncBackend',
|
|
78
78
|
}),
|
|
79
79
|
storeId: Schema.String.annotations({ description: 'Required store id for the LiveStore instance.' }),
|
|
@@ -192,5 +192,87 @@ Example success:
|
|
|
192
192
|
{ "_tag": "disconnected" }`,
|
|
193
193
|
parameters: {},
|
|
194
194
|
success: Schema.TaggedStruct('disconnected', {}),
|
|
195
|
-
})
|
|
195
|
+
}), Tool.make('livestore_sync_export', {
|
|
196
|
+
description: `Export all events from a sync backend to JSON data.
|
|
197
|
+
|
|
198
|
+
This tool connects directly to the sync backend (without creating a full LiveStore instance) and pulls all events. Useful for backup, migration, and debugging.
|
|
199
|
+
|
|
200
|
+
Module contract (same as livestore_instance_connect):
|
|
201
|
+
\`\`\`ts
|
|
202
|
+
export { schema } from './src/livestore/schema.ts'
|
|
203
|
+
export const syncBackend = makeWsSync({ url: process.env.LIVESTORE_SYNC_URL ?? 'ws://localhost:8787' })
|
|
204
|
+
export const syncPayload = { authToken: process.env.LIVESTORE_SYNC_AUTH_TOKEN }
|
|
205
|
+
\`\`\`
|
|
206
|
+
|
|
207
|
+
Example parameters:
|
|
208
|
+
{
|
|
209
|
+
"configPath": "livestore-cli.config.ts",
|
|
210
|
+
"storeId": "my-store"
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
Returns on success:
|
|
214
|
+
{
|
|
215
|
+
"storeId": "my-store",
|
|
216
|
+
"eventCount": 127,
|
|
217
|
+
"exportedAt": "2024-01-15T10:30:00.000Z",
|
|
218
|
+
"data": { "version": 1, "storeId": "my-store", ... }
|
|
219
|
+
}`,
|
|
220
|
+
parameters: {
|
|
221
|
+
configPath: Schema.String.annotations({
|
|
222
|
+
description: 'Path to a module that exports schema and syncBackend',
|
|
223
|
+
}),
|
|
224
|
+
storeId: Schema.String.annotations({ description: 'Store identifier' }),
|
|
225
|
+
clientId: Schema.optional(Schema.String.annotations({ description: 'Client identifier (default: mcp-export)' })),
|
|
226
|
+
},
|
|
227
|
+
success: Schema.Struct({
|
|
228
|
+
storeId: Schema.String,
|
|
229
|
+
eventCount: Schema.Number,
|
|
230
|
+
exportedAt: Schema.String,
|
|
231
|
+
data: Schema.JsonValue.annotations({ description: 'The export file data (can be saved or passed to import)' }),
|
|
232
|
+
}),
|
|
233
|
+
}).annotate(Tool.Readonly, true), Tool.make('livestore_sync_import', {
|
|
234
|
+
description: `Import events from export data to a sync backend.
|
|
235
|
+
|
|
236
|
+
This tool connects directly to the sync backend and pushes events. The sync backend must be empty.
|
|
237
|
+
|
|
238
|
+
Example parameters:
|
|
239
|
+
{
|
|
240
|
+
"configPath": "livestore-cli.config.ts",
|
|
241
|
+
"storeId": "my-store",
|
|
242
|
+
"data": { "version": 1, "storeId": "my-store", "events": [...] }
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
With options:
|
|
246
|
+
{
|
|
247
|
+
"configPath": "livestore-cli.config.ts",
|
|
248
|
+
"storeId": "my-store",
|
|
249
|
+
"data": { ... },
|
|
250
|
+
"force": true, // Import even if store ID doesn't match
|
|
251
|
+
"dryRun": true // Validate without importing
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
Returns on success:
|
|
255
|
+
{
|
|
256
|
+
"storeId": "my-store",
|
|
257
|
+
"eventCount": 127,
|
|
258
|
+
"dryRun": false
|
|
259
|
+
}`,
|
|
260
|
+
parameters: {
|
|
261
|
+
configPath: Schema.String.annotations({
|
|
262
|
+
description: 'Path to a module that exports schema and syncBackend',
|
|
263
|
+
}),
|
|
264
|
+
storeId: Schema.String.annotations({ description: 'Store identifier' }),
|
|
265
|
+
clientId: Schema.optional(Schema.String.annotations({ description: 'Client identifier (default: mcp-import)' })),
|
|
266
|
+
data: Schema.JsonValue.annotations({
|
|
267
|
+
description: 'The export data to import (from livestore_sync_export or a file)',
|
|
268
|
+
}),
|
|
269
|
+
force: Schema.optional(Schema.Boolean.annotations({ description: 'Force import even if store ID does not match' })),
|
|
270
|
+
dryRun: Schema.optional(Schema.Boolean.annotations({ description: 'Validate without actually importing' })),
|
|
271
|
+
},
|
|
272
|
+
success: Schema.Struct({
|
|
273
|
+
storeId: Schema.String,
|
|
274
|
+
eventCount: Schema.Number,
|
|
275
|
+
dryRun: Schema.Boolean,
|
|
276
|
+
}),
|
|
277
|
+
}).annotate(Tool.Destructive, true));
|
|
196
278
|
//# sourceMappingURL=mcp-tools-defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tools-defs.js","sourceRoot":"","sources":["../../src/commands/mcp-tools-defs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,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CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC,CAAC;KAC5G;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC,MAAM;QACtB,UAAU,EAAE,MAAM,CAAC,MAAM;QACzB,MAAM,EAAE,MAAM,CAAC,OAAO;KACvB,CAAC;CACH,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CACpC,CAAA"}
|
|
@@ -25,7 +25,7 @@ declare const DirectoryExistsError_base: Schema.TaggedErrorClass<DirectoryExists
|
|
|
25
25
|
}>;
|
|
26
26
|
export declare class DirectoryExistsError extends DirectoryExistsError_base {
|
|
27
27
|
}
|
|
28
|
-
export declare const createCommand: Cli.Command.Command<"create", HttpClient.HttpClient | Cli.Prompt.Prompt.Environment | import("@effect/platform/CommandExecutor").CommandExecutor, Error | import("@effect/platform/
|
|
28
|
+
export declare const createCommand: Cli.Command.Command<"create", HttpClient.HttpClient | Cli.Prompt.Prompt.Environment | import("@effect/platform/CommandExecutor").CommandExecutor, Error | import("@effect/platform/Error").PlatformError | import("@effect/platform/HttpClientError").ResponseError, {
|
|
29
29
|
readonly example: Option.Option<string>;
|
|
30
30
|
readonly ref: string;
|
|
31
31
|
readonly path: Option.Option<string>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type { UnknownError } from '@livestore/common';
|
|
1
2
|
import type { Store } from '@livestore/livestore';
|
|
2
3
|
import { Effect, Option, Schema } from '@livestore/utils/effect';
|
|
3
4
|
/**
|
|
4
5
|
* Dynamically imports a module that exports a `makeStore({ storeId }): Promise<Store>` function,
|
|
5
6
|
* calls it with the provided storeId, and caches the Store instance for subsequent tool calls.
|
|
6
7
|
*/
|
|
7
|
-
export declare const init: ({
|
|
8
|
-
|
|
8
|
+
export declare const init: ({ configPath, storeId, clientId, sessionId, }: {
|
|
9
|
+
configPath: string;
|
|
9
10
|
storeId: string;
|
|
10
11
|
clientId?: string;
|
|
11
12
|
sessionId?: string;
|
|
12
|
-
}) => Effect.Effect<Store<any
|
|
13
|
+
}) => Effect.Effect<Store<any>, UnknownError>;
|
|
13
14
|
export declare const getStore: Effect.Effect<Option.Option<Store<any, {}>>, never, never>;
|
|
14
15
|
export declare const status: Effect.Effect<{
|
|
15
16
|
_tag: "disconnected";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/mcp-runtime/runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/mcp-runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,MAAM,EAA0B,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWxF;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,+CAKlB;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,YAAY,CA2CuC,CAAA;AAEjF,eAAO,MAAM,QAAQ,4DAAgD,CAAA;AAErE,eAAO,MAAM,MAAM;;;;;;;;;;;;gBAyB2B,CAAA;AAE9C,eAAO,MAAM,KAAK,GAAI,qBAAqB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE;;;;;gBAWlE,CAAA;AAE/C,eAAO,MAAM,MAAM,GAAI,YAAY;IAAE,MAAM,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAA;KAAE,CAAC,CAAA;CAAE;;gBAWtD,CAAA;AAEhD,eAAO,MAAM,UAAU;;gBAQ2B,CAAA"}
|