@livestore/cli 0.4.0 → 0.5.0-dev.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.
Files changed (120) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/__tests__/fixtures/mock-config.d.ts +7 -9
  3. package/dist/__tests__/fixtures/mock-config.d.ts.map +1 -1
  4. package/dist/__tests__/fixtures/mock-config.js +6 -6
  5. package/dist/__tests__/fixtures/mock-config.js.map +1 -1
  6. package/dist/__tests__/sync-operations.test.js +20 -20
  7. package/dist/__tests__/sync-operations.test.js.map +1 -1
  8. package/dist/bin.js +6 -5
  9. package/dist/bin.js.map +1 -1
  10. package/dist/cli.d.ts +2 -23
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +1 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/commands/__fixtures__/mcp-protocol-server.d.ts +2 -0
  15. package/dist/commands/__fixtures__/mcp-protocol-server.d.ts.map +1 -0
  16. package/dist/commands/__fixtures__/mcp-protocol-server.js +10 -0
  17. package/dist/commands/__fixtures__/mcp-protocol-server.js.map +1 -0
  18. package/dist/commands/import-export.d.ts +5 -19
  19. package/dist/commands/import-export.d.ts.map +1 -1
  20. package/dist/commands/import-export.js +12 -12
  21. package/dist/commands/import-export.js.map +1 -1
  22. package/dist/commands/mcp-coach.d.ts +8 -7
  23. package/dist/commands/mcp-coach.d.ts.map +1 -1
  24. package/dist/commands/mcp-coach.js +10 -10
  25. package/dist/commands/mcp-coach.js.map +1 -1
  26. package/dist/commands/mcp-protocols.d.ts +7 -0
  27. package/dist/commands/mcp-protocols.d.ts.map +1 -0
  28. package/dist/commands/mcp-protocols.js +12 -0
  29. package/dist/commands/mcp-protocols.js.map +1 -0
  30. package/dist/commands/mcp-protocols.test.d.ts +2 -0
  31. package/dist/commands/mcp-protocols.test.d.ts.map +1 -0
  32. package/dist/commands/mcp-protocols.test.js +60 -0
  33. package/dist/commands/mcp-protocols.test.js.map +1 -0
  34. package/dist/commands/mcp-stdio.test.d.ts +2 -0
  35. package/dist/commands/mcp-stdio.test.d.ts.map +1 -0
  36. package/dist/commands/mcp-stdio.test.js +79 -0
  37. package/dist/commands/mcp-stdio.test.js.map +1 -0
  38. package/dist/commands/mcp-tool-handlers.d.ts +1 -1
  39. package/dist/commands/mcp-tool-handlers.d.ts.map +1 -1
  40. package/dist/commands/mcp-tool-handlers.js +1 -0
  41. package/dist/commands/mcp-tool-handlers.js.map +1 -1
  42. package/dist/commands/mcp-tools-defs.d.ts +65 -64
  43. package/dist/commands/mcp-tools-defs.d.ts.map +1 -1
  44. package/dist/commands/mcp-tools-defs.js +59 -52
  45. package/dist/commands/mcp-tools-defs.js.map +1 -1
  46. package/dist/commands/mcp-tools-defs.test.d.ts +2 -0
  47. package/dist/commands/mcp-tools-defs.test.d.ts.map +1 -0
  48. package/dist/commands/mcp-tools-defs.test.js +11 -0
  49. package/dist/commands/mcp-tools-defs.test.js.map +1 -0
  50. package/dist/commands/mcp.d.ts +1 -3
  51. package/dist/commands/mcp.d.ts.map +1 -1
  52. package/dist/commands/mcp.js +5 -4
  53. package/dist/commands/mcp.js.map +1 -1
  54. package/dist/commands/new-project.d.ts +19 -27
  55. package/dist/commands/new-project.d.ts.map +1 -1
  56. package/dist/commands/new-project.js +17 -16
  57. package/dist/commands/new-project.js.map +1 -1
  58. package/dist/mcp-content/architecture.d.ts +1 -1
  59. package/dist/mcp-content/architecture.d.ts.map +1 -1
  60. package/dist/mcp-content/architecture.js +3 -3
  61. package/dist/mcp-content/features.d.ts +1 -1
  62. package/dist/mcp-content/features.d.ts.map +1 -1
  63. package/dist/mcp-content/features.js +1 -1
  64. package/dist/mcp-content/getting-started.d.ts +1 -1
  65. package/dist/mcp-content/getting-started.d.ts.map +1 -1
  66. package/dist/mcp-content/getting-started.js +37 -37
  67. package/dist/mcp-content/overview.d.ts +1 -1
  68. package/dist/mcp-content/overview.d.ts.map +1 -1
  69. package/dist/mcp-content/overview.js +6 -6
  70. package/dist/mcp-content/schemas/blog.d.ts +1 -1
  71. package/dist/mcp-content/schemas/blog.d.ts.map +1 -1
  72. package/dist/mcp-content/schemas/blog.js +25 -25
  73. package/dist/mcp-content/schemas/ecommerce.d.ts +1 -1
  74. package/dist/mcp-content/schemas/ecommerce.d.ts.map +1 -1
  75. package/dist/mcp-content/schemas/ecommerce.js +67 -67
  76. package/dist/mcp-content/schemas/social.d.ts +1 -1
  77. package/dist/mcp-content/schemas/social.d.ts.map +1 -1
  78. package/dist/mcp-content/schemas/social.js +48 -48
  79. package/dist/mcp-content/schemas/todo.d.ts +1 -1
  80. package/dist/mcp-content/schemas/todo.d.ts.map +1 -1
  81. package/dist/mcp-content/schemas/todo.js +35 -35
  82. package/dist/mcp-runtime/runtime.d.ts +2 -2
  83. package/dist/mcp-runtime/runtime.d.ts.map +1 -1
  84. package/dist/mcp-runtime/runtime.js +4 -4
  85. package/dist/mcp-runtime/runtime.js.map +1 -1
  86. package/dist/module-loader.d.ts +2 -2
  87. package/dist/module-loader.d.ts.map +1 -1
  88. package/dist/module-loader.js +6 -6
  89. package/dist/module-loader.js.map +1 -1
  90. package/dist/sync-operations.d.ts +24 -30
  91. package/dist/sync-operations.d.ts.map +1 -1
  92. package/dist/sync-operations.js +10 -12
  93. package/dist/sync-operations.js.map +1 -1
  94. package/package.json +30 -44
  95. package/src/__tests__/fixtures/mock-config.ts +8 -8
  96. package/src/__tests__/sync-operations.test.ts +21 -35
  97. package/src/bin.ts +7 -6
  98. package/src/cli.ts +1 -1
  99. package/src/commands/__fixtures__/mcp-protocol-server.ts +12 -0
  100. package/src/commands/import-export.ts +29 -29
  101. package/src/commands/mcp-coach.ts +12 -11
  102. package/src/commands/mcp-protocols.test.ts +76 -0
  103. package/src/commands/mcp-protocols.ts +12 -0
  104. package/src/commands/mcp-stdio.test.ts +93 -0
  105. package/src/commands/mcp-tool-handlers.ts +11 -8
  106. package/src/commands/mcp-tools-defs.test.ts +13 -0
  107. package/src/commands/mcp-tools-defs.ts +53 -51
  108. package/src/commands/mcp.ts +7 -4
  109. package/src/commands/new-project.ts +49 -36
  110. package/src/mcp-content/architecture.ts +3 -3
  111. package/src/mcp-content/features.ts +1 -1
  112. package/src/mcp-content/getting-started.ts +37 -37
  113. package/src/mcp-content/overview.ts +6 -6
  114. package/src/mcp-content/schemas/blog.ts +25 -25
  115. package/src/mcp-content/schemas/ecommerce.ts +67 -67
  116. package/src/mcp-content/schemas/social.ts +48 -48
  117. package/src/mcp-content/schemas/todo.ts +35 -35
  118. package/src/mcp-runtime/runtime.ts +7 -7
  119. package/src/module-loader.ts +10 -10
  120. package/src/sync-operations.ts +16 -16
@@ -1,27 +1,28 @@
1
- import { Schema, Tool, Toolkit } from '@livestore/utils/effect';
1
+ import { Tool, Toolkit } from 'effect/unstable/ai';
2
+ import { Schema } from '@livestore/utils/effect';
2
3
  import { coachTool } from "./mcp-coach.js";
3
4
  export const livestoreToolkit = Toolkit.make(coachTool, Tool.make('livestore_generate_schema', {
4
5
  description: 'Generate a LiveStore schema for a specific use case. Choose from predefined types (todo, blog, social, ecommerce) or request a custom schema by providing a description.',
5
- parameters: {
6
- schemaType: Schema.String.annotations({
6
+ parameters: Schema.Struct({
7
+ schemaType: Schema.String.annotate({
7
8
  description: "Schema type: 'todo', 'blog', 'social', 'ecommerce', or 'custom'",
8
9
  }),
9
- customDescription: Schema.optional(Schema.String.annotations({
10
+ customDescription: Schema.optional(Schema.String.annotate({
10
11
  description: "For custom schemas: describe your data model needs (e.g., 'user management system with roles and permissions')",
11
12
  })),
12
- },
13
+ }),
13
14
  success: Schema.Struct({
14
- schemaCode: Schema.String.annotations({ description: 'The generated LiveStore schema TypeScript code' }),
15
- explanation: Schema.String.annotations({ description: 'Brief explanation of the schema structure' }),
15
+ schemaCode: Schema.String.annotate({ description: 'The generated LiveStore schema TypeScript code' }),
16
+ explanation: Schema.String.annotate({ description: 'Brief explanation of the schema structure' }),
16
17
  }),
17
18
  }), Tool.make('livestore_get_example_schema', {
18
19
  description: 'Get a complete example LiveStore schema with TypeScript code. Returns ready-to-use schema definitions for common application types.',
19
- parameters: {
20
- type: Schema.String.annotations({ description: "Example type: 'todo', 'blog', 'social', or 'ecommerce'" }),
21
- },
20
+ parameters: Schema.Struct({
21
+ type: Schema.String.annotate({ description: "Example type: 'todo', 'blog', 'social', or 'ecommerce'" }),
22
+ }),
22
23
  success: Schema.Struct({
23
- schemaCode: Schema.String.annotations({ description: 'The complete LiveStore schema code' }),
24
- description: Schema.String.annotations({ description: 'Description of what this schema models' }),
24
+ schemaCode: Schema.String.annotate({ description: 'The complete LiveStore schema code' }),
25
+ description: Schema.String.annotate({ description: 'Description of what this schema models' }),
25
26
  }),
26
27
  })
27
28
  .annotate(Tool.Readonly, true)
@@ -72,23 +73,23 @@ Returns on success:
72
73
  "eventNames": ["<event-name-1>", "<event-name-2>", "..."]
73
74
  }
74
75
  }`,
75
- parameters: {
76
- configPath: Schema.String.annotations({
76
+ parameters: Schema.Struct({
77
+ configPath: Schema.String.annotate({
77
78
  description: 'Path to a module that exports named variables: schema and syncBackend',
78
79
  }),
79
- storeId: Schema.String.annotations({ description: 'Required store id for the LiveStore instance.' }),
80
- clientId: Schema.optional(Schema.String.annotations({ description: 'Optional client id for the LiveStore instance.' })),
81
- sessionId: Schema.optional(Schema.String.annotations({ description: 'Optional session id for the LiveStore instance.' })),
82
- },
80
+ storeId: Schema.String.annotate({ description: 'Required store id for the LiveStore instance.' }),
81
+ clientId: Schema.optional(Schema.String.annotate({ description: 'Optional client id for the LiveStore instance.' })),
82
+ sessionId: Schema.optional(Schema.String.annotate({ description: 'Optional session id for the LiveStore instance.' })),
83
+ }),
83
84
  success: Schema.Struct({
84
85
  storeId: Schema.String,
85
86
  clientId: Schema.String,
86
87
  sessionId: Schema.String,
87
88
  schemaInfo: Schema.Struct({
88
- tableNames: Schema.Array(Schema.String).annotations({
89
+ tableNames: Schema.Array(Schema.String).annotate({
89
90
  description: 'Non-system table names in the connected schema',
90
91
  }),
91
- eventNames: Schema.Array(Schema.String).annotations({
92
+ eventNames: Schema.Array(Schema.String).annotate({
92
93
  description: 'Canonical event names defined by the connected schema',
93
94
  }),
94
95
  }),
@@ -117,14 +118,17 @@ Returns on success:
117
118
  "rows": [{ "col": "value" }],
118
119
  "rowCount": 1
119
120
  }`,
120
- parameters: {
121
- sql: Schema.String.annotations({ description: 'The SQL query to execute' }),
122
- bindValues: Schema.Union(Schema.Array(Schema.JsonValue), Schema.Record({ key: Schema.String, value: Schema.JsonValue })).annotations({
121
+ parameters: Schema.Struct({
122
+ sql: Schema.String.annotate({ description: 'The SQL query to execute' }),
123
+ bindValues: Schema.Union([
124
+ Schema.Array(Schema.Json),
125
+ Schema.Record(Schema.String, Schema.Json),
126
+ ]).annotate({
123
127
  description: 'Bind values for the SQL query (array or record). Record keys must not start with $.',
124
128
  }),
125
- },
129
+ }),
126
130
  success: Schema.Struct({
127
- rows: Schema.Array(Schema.Record({ key: Schema.String, value: Schema.JsonValue })),
131
+ rows: Schema.Array(Schema.Record(Schema.String, Schema.Json)),
128
132
  rowCount: Schema.Number,
129
133
  }),
130
134
  }).annotate(Tool.Destructive, false), Tool.make('livestore_instance_commit_events', {
@@ -151,14 +155,14 @@ Example parameters:
151
155
 
152
156
  Returns on success:
153
157
  { "committed": 1 }`,
154
- parameters: {
158
+ parameters: Schema.Struct({
155
159
  events: Schema.Array(Schema.Struct({
156
- name: Schema.String.annotations({ description: 'The name of the event' }),
157
- args: Schema.JsonValue.annotations({
160
+ name: Schema.String.annotate({ description: 'The name of the event' }),
161
+ args: Schema.Json.annotate({
158
162
  description: 'The arguments for the event as a non-stringified JSON value',
159
163
  }),
160
164
  })),
161
- },
165
+ }),
162
166
  success: Schema.Struct({ committed: Schema.Number }),
163
167
  }).annotate(Tool.Destructive, true), Tool.make('livestore_instance_status', {
164
168
  description: `Report the LiveStore runtime status for the current MCP session.
@@ -176,21 +180,24 @@ Returns when not connected:
176
180
  {
177
181
  "_tag": "disconnected"
178
182
  }`,
179
- parameters: {},
180
- success: Schema.Union(Schema.TaggedStruct('connected', {
181
- storeId: Schema.String,
182
- clientId: Schema.String,
183
- sessionId: Schema.String,
184
- tableCounts: Schema.Record({ key: Schema.String, value: Schema.Number }).annotations({
185
- description: 'Tables in the LiveStore instance with their row count',
183
+ parameters: Tool.EmptyParams,
184
+ success: Schema.Union([
185
+ Schema.TaggedStruct('connected', {
186
+ storeId: Schema.String,
187
+ clientId: Schema.String,
188
+ sessionId: Schema.String,
189
+ tableCounts: Schema.Record(Schema.String, Schema.Number).annotate({
190
+ description: 'Tables in the LiveStore instance with their row count',
191
+ }),
186
192
  }),
187
- }), Schema.TaggedStruct('disconnected', {})),
193
+ Schema.TaggedStruct('disconnected', {}),
194
+ ]),
188
195
  }).annotate(Tool.Readonly, true), Tool.make('livestore_instance_disconnect', {
189
196
  description: `Disconnect the current LiveStore instance and release resources.
190
197
 
191
198
  Example success:
192
199
  { "_tag": "disconnected" }`,
193
- parameters: {},
200
+ parameters: Tool.EmptyParams,
194
201
  success: Schema.TaggedStruct('disconnected', {}),
195
202
  }), Tool.make('livestore_sync_export', {
196
203
  description: `Export all events from a sync backend to JSON data.
@@ -217,18 +224,18 @@ Returns on success:
217
224
  "exportedAt": "2024-01-15T10:30:00.000Z",
218
225
  "data": { "version": 1, "storeId": "my-store", ... }
219
226
  }`,
220
- parameters: {
221
- configPath: Schema.String.annotations({
227
+ parameters: Schema.Struct({
228
+ configPath: Schema.String.annotate({
222
229
  description: 'Path to a module that exports schema and syncBackend',
223
230
  }),
224
- storeId: Schema.String.annotations({ description: 'Store identifier' }),
225
- clientId: Schema.optional(Schema.String.annotations({ description: 'Client identifier (default: mcp-export)' })),
226
- },
231
+ storeId: Schema.String.annotate({ description: 'Store identifier' }),
232
+ clientId: Schema.optional(Schema.String.annotate({ description: 'Client identifier (default: mcp-export)' })),
233
+ }),
227
234
  success: Schema.Struct({
228
235
  storeId: Schema.String,
229
236
  eventCount: Schema.Number,
230
237
  exportedAt: Schema.String,
231
- data: Schema.JsonValue.annotations({ description: 'The export file data (can be saved or passed to import)' }),
238
+ data: Schema.Json.annotate({ description: 'The export file data (can be saved or passed to import)' }),
232
239
  }),
233
240
  }).annotate(Tool.Readonly, true), Tool.make('livestore_sync_import', {
234
241
  description: `Import events from export data to a sync backend.
@@ -257,18 +264,18 @@ Returns on success:
257
264
  "eventCount": 127,
258
265
  "dryRun": false
259
266
  }`,
260
- parameters: {
261
- configPath: Schema.String.annotations({
267
+ parameters: Schema.Struct({
268
+ configPath: Schema.String.annotate({
262
269
  description: 'Path to a module that exports schema and syncBackend',
263
270
  }),
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({
271
+ storeId: Schema.String.annotate({ description: 'Store identifier' }),
272
+ clientId: Schema.optional(Schema.String.annotate({ description: 'Client identifier (default: mcp-import)' })),
273
+ data: Schema.Json.annotate({
267
274
  description: 'The export data to import (from livestore_sync_export or a file)',
268
275
  }),
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
- },
276
+ force: Schema.optional(Schema.Boolean.annotate({ description: 'Force import even if store ID does not match' })),
277
+ dryRun: Schema.optional(Schema.Boolean.annotate({ description: 'Validate without actually importing' })),
278
+ }),
272
279
  success: Schema.Struct({
273
280
  storeId: Schema.String,
274
281
  eventCount: Schema.Number,
@@ -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,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC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C,QAAQ,CAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC,CAAC;KACzG,CAAC;IACF,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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp-tools-defs.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tools-defs.test.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tools-defs.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { Tool } from 'effect/unstable/ai';
2
+ import { Vitest } from '@livestore/utils-dev/node-vitest';
3
+ import { livestoreToolkit } from "./mcp-tools-defs.js";
4
+ Vitest.describe('livestoreToolkit', () => {
5
+ Vitest.it('exposes MCP-compatible object parameter schemas', () => {
6
+ for (const tool of Object.values(livestoreToolkit.tools)) {
7
+ Vitest.expect(Tool.getJsonSchema(tool), tool.name).toMatchObject({ type: 'object' });
8
+ }
9
+ });
10
+ });
11
+ //# sourceMappingURL=mcp-tools-defs.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-tools-defs.test.js","sourceRoot":"","sources":["../../src/commands/mcp-tools-defs.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACvC,MAAM,CAAC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QAChE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;YACzD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QACtF,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,5 +1,3 @@
1
1
  import { Cli } from '@livestore/utils/node';
2
- export declare const mcpCommand: Cli.Command.Command<"mcp", never, never, {
3
- readonly subcommand: import("effect/Option").Option<{}>;
4
- }>;
2
+ export declare const mcpCommand: Cli.Command.Command<"mcp", {}, {}, import("effect/Cause").IllegalArgumentError, never>;
5
3
  //# sourceMappingURL=mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAgB,MAAM,uBAAuB,CAAA;AAgGzD,eAAO,MAAM,UAAU;;EAAgF,CAAA"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAgB,MAAM,uBAAuB,CAAA;AAiGzD,eAAO,MAAM,UAAU,wFAAgF,CAAA"}
@@ -1,4 +1,5 @@
1
- import { Effect, Layer, Logger, McpServer } from '@livestore/utils/effect';
1
+ import { McpServer } from 'effect/unstable/ai';
2
+ import { Effect, Layer, Logger } from '@livestore/utils/effect';
2
3
  import { Cli, PlatformNode } from '@livestore/utils/node';
3
4
  import { architectureContent } from "../mcp-content/architecture.js";
4
5
  import { featuresContent } from "../mcp-content/features.js";
@@ -10,6 +11,7 @@ import { ecommerceSchemaContent } from "../mcp-content/schemas/ecommerce.js";
10
11
  import { socialSchemaContent } from "../mcp-content/schemas/social.js";
11
12
  import { todoSchemaContent } from "../mcp-content/schemas/todo.js";
12
13
  import { toolHandlers } from "./mcp-tool-handlers.js";
14
+ import { supportedMcpProtocols } from "./mcp-protocols.js";
13
15
  // Tools imports
14
16
  import { livestoreToolkit } from "./mcp-tools-defs.js";
15
17
  const LivestoreResources = Layer.mergeAll(McpServer.resource({
@@ -60,9 +62,8 @@ const mcpServerCommand = Cli.Command.make('server', {}, Effect.fn(function* () {
60
62
  return yield* McpServer.layerStdio({
61
63
  name: 'livestore-mcp',
62
64
  version: '0.1.0',
63
- stdin: PlatformNode.NodeStream.stdin,
64
- stdout: PlatformNode.NodeSink.stdout,
65
- }).pipe(Layer.provide(LivestoreResources), Layer.provide(LivestoreTools), Layer.provide(Logger.add(Logger.prettyLogger({ stderr: true }))), Layer.launch);
65
+ protocols: supportedMcpProtocols,
66
+ }).pipe(Layer.provide(LivestoreResources), Layer.provide(LivestoreTools), Layer.provide(Logger.layer([Logger.consolePretty({ stderr: true })])), Layer.provide(PlatformNode.NodeStdio.layer), Layer.launch);
66
67
  }));
67
68
  export const mcpCommand = Cli.Command.make('mcp').pipe(Cli.Command.withSubcommands([mcpServerCommand]));
68
69
  //# sourceMappingURL=mcp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,kBAAkB;AAClB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EA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AAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAA"}
@@ -1,41 +1,33 @@
1
- import { HttpClient, Option, Schema } from '@livestore/utils/effect';
1
+ import { ChildProcessSpawner, HttpClient, Option, Schema } from '@livestore/utils/effect';
2
2
  import { Cli } from '@livestore/utils/node';
3
- declare const ExampleNotFoundError_base: Schema.TaggedErrorClass<ExampleNotFoundError, "ExampleNotFoundError", {
4
- readonly _tag: Schema.tag<"ExampleNotFoundError">;
5
- } & {
6
- exampleName: typeof Schema.String;
7
- availableExamples: Schema.Array$<typeof Schema.String>;
8
- message: typeof Schema.String;
9
- }>;
3
+ declare const ExampleNotFoundError_base: Schema.Class<ExampleNotFoundError, Schema.TaggedStruct<"ExampleNotFoundError", {
4
+ readonly exampleName: Schema.String;
5
+ readonly availableExamples: Schema.$Array<Schema.String>;
6
+ readonly message: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
10
8
  export declare class ExampleNotFoundError extends ExampleNotFoundError_base {
11
9
  }
12
- declare const NetworkError_base: Schema.TaggedErrorClass<NetworkError, "NetworkError", {
13
- readonly _tag: Schema.tag<"NetworkError">;
14
- } & {
15
- cause: typeof Schema.Unknown;
16
- message: typeof Schema.String;
17
- }>;
10
+ declare const NetworkError_base: Schema.Class<NetworkError, Schema.TaggedStruct<"NetworkError", {
11
+ readonly cause: Schema.Unknown;
12
+ readonly message: Schema.String;
13
+ }>, import("effect/Cause").YieldableError>;
18
14
  export declare class NetworkError extends NetworkError_base {
19
15
  }
20
- declare const DirectoryExistsError_base: Schema.TaggedErrorClass<DirectoryExistsError, "DirectoryExistsError", {
21
- readonly _tag: Schema.tag<"DirectoryExistsError">;
22
- } & {
23
- path: typeof Schema.String;
24
- message: typeof Schema.String;
25
- }>;
16
+ declare const DirectoryExistsError_base: Schema.Class<DirectoryExistsError, Schema.TaggedStruct<"DirectoryExistsError", {
17
+ readonly path: Schema.String;
18
+ readonly message: Schema.String;
19
+ }>, import("effect/Cause").YieldableError>;
26
20
  export declare class DirectoryExistsError extends DirectoryExistsError_base {
27
21
  }
28
- declare const NoExamplesError_base: Schema.TaggedErrorClass<NoExamplesError, "NoExamplesError", {
29
- readonly _tag: Schema.tag<"NoExamplesError">;
30
- } & {
31
- message: typeof Schema.String;
32
- }>;
22
+ declare const NoExamplesError_base: Schema.Class<NoExamplesError, Schema.TaggedStruct<"NoExamplesError", {
23
+ readonly message: Schema.String;
24
+ }>, import("effect/Cause").YieldableError>;
33
25
  export declare class NoExamplesError extends NoExamplesError_base {
34
26
  }
35
- export declare const createCommand: Cli.Command.Command<"create", HttpClient.HttpClient | Cli.Prompt.Prompt.Environment | import("@effect/platform/CommandExecutor").CommandExecutor, import("@effect/platform/Error").PlatformError | import("@effect/platform/HttpClientError").ResponseError | ExampleNotFoundError | NetworkError | NoExamplesError | import("@effect/platform/Terminal").QuitException, {
27
+ export declare const createCommand: Cli.Command.Command<"create", {
36
28
  readonly example: Option.Option<string>;
37
29
  readonly ref: string;
38
30
  readonly path: Option.Option<string>;
39
- }>;
31
+ }, {}, import("effect/unstable/http/HttpClientError").HttpClientError | ExampleNotFoundError | NetworkError | NoExamplesError | import("effect/Terminal").QuitError | import("effect/PlatformError").PlatformError, HttpClient.HttpClient | ChildProcessSpawner.ChildProcessSpawner | Cli.Prompt.Environment>;
40
32
  export {};
41
33
  //# sourceMappingURL=new-project.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"new-project.d.ts","sourceRoot":"","sources":["../../src/commands/new-project.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,UAAU,EAEV,MAAM,EACN,MAAM,EACP,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AA0B3C,qBAAa,oBAAqB,SAAQ,yBAIxC;CAAG;;;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAGhC;CAAG;;;;;;;AAEL,qBAAa,oBAAqB,SAAQ,yBAGxC;CAAG;;;;;;AAEL,qBAAa,eAAgB,SAAQ,oBAEnC;CAAG;AA2JL,eAAO,MAAM,aAAa;;;;EAuGzB,CAAA"}
1
+ {"version":3,"file":"new-project.d.ts","sourceRoot":"","sources":["../../src/commands/new-project.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,mBAAmB,EAInB,UAAU,EAEV,MAAM,EACN,MAAM,EACP,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;;;;;;AA0B3C,qBAAa,oBAAqB,SAAQ,yBAMxC;CAAG;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAGhC;CAAG;;;;;AAEL,qBAAa,oBAAqB,SAAQ,yBAKxC;CAAG;;;;AAEL,qBAAa,eAAgB,SAAQ,oBAKpC;CAAG;AA6JJ,eAAO,MAAM,aAAa;;;;6SA0GzB,CAAA"}
@@ -1,13 +1,13 @@
1
1
  import * as os from 'node:os';
2
2
  import * as nodePath from 'node:path';
3
3
  import { sluggify } from '@livestore/utils';
4
- import { Command, Console, Effect, FileSystem, HttpClient, HttpClientRequest, Option, Schema, } from '@livestore/utils/effect';
4
+ import { ChildProcess, ChildProcessSpawner, Console, Effect, FileSystem, HttpClient, HttpClientRequest, Option, Schema, } from '@livestore/utils/effect';
5
5
  import { Cli } from '@livestore/utils/node';
6
6
  import { detectPackageManager, pmCommands } from "../package-manager.js";
7
7
  // Schema for GitHub API response
8
8
  const GitHubContentSchema = Schema.Struct({
9
9
  name: Schema.String,
10
- type: Schema.Literal('dir', 'file'),
10
+ type: Schema.Literals(['dir', 'file']),
11
11
  path: Schema.String,
12
12
  download_url: Schema.NullOr(Schema.String),
13
13
  });
@@ -19,7 +19,7 @@ const githubRequest = (url) => {
19
19
  };
20
20
  /** Schema for parsing package.json scripts (dev or start) */
21
21
  const PackageJsonScriptsSchema = Schema.Struct({
22
- scripts: Schema.Union(Schema.Struct({ dev: Schema.String }), Schema.Struct({ start: Schema.String })),
22
+ scripts: Schema.Union([Schema.Struct({ dev: Schema.String }), Schema.Struct({ start: Schema.String })]),
23
23
  });
24
24
  // Error types
25
25
  export class ExampleNotFoundError extends Schema.TaggedError('~@livestore/cli/ExampleNotFoundError')('ExampleNotFoundError', {
@@ -47,12 +47,12 @@ const fetchExamples = (ref) => Effect.gen(function* () {
47
47
  const url = `https://api.github.com/repos/livestorejs/livestore/contents/examples?ref=${ref}`;
48
48
  yield* Effect.log(`Fetching examples from ref: ${ref}`);
49
49
  const request = githubRequest(url);
50
- const response = yield* HttpClient.execute(request).pipe(Effect.scoped, Effect.catchAll((error) => new NetworkError({
50
+ const response = yield* HttpClient.execute(request).pipe(Effect.scoped, Effect.catch((error) => new NetworkError({
51
51
  cause: error,
52
52
  message: `Failed to fetch examples from GitHub: ${String(error)}`,
53
53
  })));
54
54
  const responseText = yield* response.text;
55
- const examples = yield* Schema.decodeUnknown(Schema.parseJson(GitHubContentsResponseSchema))(responseText).pipe(Effect.catchAll((error) => new NetworkError({
55
+ const examples = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(GitHubContentsResponseSchema))(responseText).pipe(Effect.catch((error) => new NetworkError({
56
56
  cause: error,
57
57
  message: `Failed to parse GitHub API response: ${String(error)}`,
58
58
  })));
@@ -81,12 +81,13 @@ const selectExample = (examples) => Effect.gen(function* () {
81
81
  // Download and extract example using tiged approach
82
82
  const downloadExample = (exampleName, ref, destinationPath) => Effect.gen(function* () {
83
83
  yield* Console.log(`📥 Downloading example "${exampleName}" from ref "${ref}"...`);
84
+ const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
84
85
  const tempDir = yield* Effect.sync(() => os.tmpdir());
85
86
  const tarballPath = nodePath.join(tempDir, `livestore-${sluggify(ref)}-${Date.now()}.tar.gz`);
86
87
  const tarballUrl = `https://api.github.com/repos/livestorejs/livestore/tarball/${ref}`;
87
88
  // Download tarball directly
88
89
  const request = githubRequest(tarballUrl);
89
- const response = yield* HttpClient.execute(request).pipe(Effect.scoped, Effect.catchAll((error) => new NetworkError({
90
+ const response = yield* HttpClient.execute(request).pipe(Effect.scoped, Effect.catch((error) => new NetworkError({
90
91
  cause: error,
91
92
  message: `Failed to download tarball: ${String(error)}`,
92
93
  })));
@@ -99,8 +100,8 @@ const downloadExample = (exampleName, ref, destinationPath) => Effect.gen(functi
99
100
  // Extract the tarball to a temporary directory first
100
101
  const extractDir = nodePath.join(tempDir, `extract-${Date.now()}`);
101
102
  yield* fs.makeDirectory(extractDir, { recursive: true });
102
- // Extract tarball using Effect Command
103
- yield* Command.make('tar', '-xzf', tarballPath, '-C', extractDir).pipe(Command.exitCode, Effect.catchAll((error) => new NetworkError({
103
+ // Extract tarball using a child process
104
+ yield* spawner.exitCode(ChildProcess.make('tar', ['-xzf', tarballPath, '-C', extractDir])).pipe(Effect.catch((error) => new NetworkError({
104
105
  cause: error,
105
106
  message: `Failed to extract tarball: ${String(error)}`,
106
107
  })));
@@ -123,21 +124,21 @@ const downloadExample = (exampleName, ref, destinationPath) => Effect.gen(functi
123
124
  message: `Example "${exampleName}" not found in the extracted repository`,
124
125
  });
125
126
  }
126
- // Copy the example directory contents to the destination using Effect Command
127
- yield* Command.make('cp', '-r', `${exampleSourcePath}/.`, destinationPath).pipe(Command.exitCode, Effect.catchAll((error) => new NetworkError({
127
+ // Copy the example directory contents to the destination using a child process
128
+ yield* spawner.exitCode(ChildProcess.make('cp', ['-r', `${exampleSourcePath}/.`, destinationPath])).pipe(Effect.catch((error) => new NetworkError({
128
129
  cause: error,
129
130
  message: `Failed to copy example files: ${String(error)}`,
130
131
  })));
131
132
  // Clean up extract directory
132
- yield* fs.remove(extractDir, { recursive: true }).pipe(Effect.catchAll(() => Effect.void));
133
+ yield* fs.remove(extractDir, { recursive: true }).pipe(Effect.catch(() => Effect.void));
133
134
  // Clean up tarball
134
- yield* fs.remove(tarballPath).pipe(Effect.catchAll(() => Effect.void));
135
+ yield* fs.remove(tarballPath).pipe(Effect.catch(() => Effect.void));
135
136
  yield* Console.log(`✅ Example "${exampleName}" created successfully at: ${destinationPath}`);
136
137
  });
137
138
  export const createCommand = Cli.Command.make('create', {
138
- example: Cli.Options.text('example').pipe(Cli.Options.optional, Cli.Options.withDescription('Example name to create (bypasses interactive selection)')),
139
- ref: Cli.Options.text('ref').pipe(Cli.Options.withAlias('commit'), Cli.Options.withAlias('branch'), Cli.Options.withAlias('tag'), Cli.Options.withDefault('main'), Cli.Options.withDescription('The name of the commit/branch/tag to fetch examples from. Pull requests refs must be fully-formed (e.g., `refs/pull/123/merge`).')),
140
- path: Cli.Args.text({ name: 'path' }).pipe(Cli.Args.optional, Cli.Args.withDescription('Destination path for the new project')),
139
+ example: Cli.Flag.string('example').pipe(Cli.Flag.optional, Cli.Flag.withDescription('Example name to create (bypasses interactive selection)')),
140
+ ref: Cli.Flag.string('ref').pipe(Cli.Flag.withAlias('commit'), Cli.Flag.withAlias('branch'), Cli.Flag.withAlias('tag'), Cli.Flag.withDefault('main'), Cli.Flag.withDescription('The name of the commit/branch/tag to fetch examples from. Pull requests refs must be fully-formed (e.g., `refs/pull/123/merge`).')),
141
+ path: Cli.Argument.string('path').pipe(Cli.Argument.optional, Cli.Argument.withDescription('Destination path for the new project')),
141
142
  }, Effect.fn(function* ({ example, ref, path, }) {
142
143
  yield* Effect.log('🚀 Creating new LiveStore project...');
143
144
  // Fetch available examples
@@ -172,7 +173,7 @@ export const createCommand = Cli.Command.make('create', {
172
173
  const fs = yield* FileSystem.FileSystem;
173
174
  const packageJsonPath = nodePath.join(destinationPath, 'package.json');
174
175
  const packageJsonContent = yield* fs.readFileString(packageJsonPath);
175
- const runScript = yield* Schema.decodeUnknown(Schema.parseJson(PackageJsonScriptsSchema))(packageJsonContent).pipe(Effect.map((pkg) => ('dev' in pkg.scripts ? 'dev' : 'start')), Effect.orElseSucceed(() => undefined));
176
+ const runScript = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(PackageJsonScriptsSchema))(packageJsonContent).pipe(Effect.map((pkg) => ('dev' in pkg.scripts ? 'dev' : 'start')), Effect.orElseSucceed(() => undefined));
176
177
  // Detect which package manager was used to invoke the CLI (via npm_config_user_agent).
177
178
  // This ensures the "next steps" instructions match how the user ran the create command.
178
179
  const pmResult = detectPackageManager();
@@ -1 +1 @@
1
- {"version":3,"file":"new-project.js","sourceRoot":"","sources":["../../src/commands/new-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,GACP,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAE3C,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAExE,iCAAiC;AACjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;CAC3C,CAAC,CAAA;AAEF,MAAM,4BAA4B,GAAG,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;AAEtE,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,EAAE;IACpC,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC,CAAA;IACrH,MAAM,KAAK,GAAG,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AoC,CAAC,CAAA;QAC7F,CAAC;IACH,CAAC;IACD,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAA;AAC1F,CAAC,CAAC,CACH,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare const architectureContent = "# LiveStore Architecture: Local-First Data Management\n\nLiveStore implements distributed systems principles from Martin Kleppmann's research on local-first software, ensuring data consistency, availability, and partition tolerance in collaborative applications.\n\n## Core Architectural Principles\n\n### 1. Local-First Data Storage\n- **Immediate Response**: All operations execute against local SQLite database first\n- **Offline Capability**: Full application functionality without network connectivity\n- **Data Ownership**: Users maintain complete control over their data\n- **Performance**: Sub-millisecond query responses from local storage\n\n### 2. Event Sourcing & CRDT-Inspired Conflict Resolution\n- **Immutable Event Log**: All changes recorded as immutable events\n- **Deterministic Replay**: State reconstruction from event sequence\n- **Conflict-Free Operations**: Events designed for commutative application\n- **Causal Ordering**: Lamport timestamps ensure causally consistent ordering\n\n### 3. Eventually Consistent Synchronization\n- **Asynchronous Replication**: Events sync when network available\n- **Convergence Guarantee**: All replicas converge to same state\n- **Conflict Resolution**: Last-write-wins with semantic merging strategies\n- **Incremental Sync**: Only transmit events since last synchronization\n\n## System Components\n\n### \uD83D\uDDC4\uFE0F State Layer (SQLite + Materializers)\n```typescript\n// Materialized views from event log\nconst materializers = State.SQLite.materializers(events, {\n 'TodoCreated': ({ id, text, createdAt }) => \n tables.todos.insert({ id, text, completed: false, createdAt }),\n 'TodoCompleted': ({ id }) => \n tables.todos.update({ completed: true }).where({ id })\n})\n```\n\n**Responsibilities:**\n- Maintain denormalized query-optimized state\n- Apply events to update materialized views\n- Support efficient reactive queries\n- Handle schema migrations\n\n### \uD83D\uDCDD Event System (Append-Only Log)\n```typescript\nconst events = {\n todoCompleted: Events.synced({\n name: 'v1.TodoCompleted',\n schema: Schema.Struct({ \n id: Schema.String,\n completedAt: Schema.Date // For conflict resolution\n })\n })\n}\n```\n\n**Characteristics:**\n- Immutable event log (append-only)\n- Cryptographically signed events for integrity\n- Causal dependencies tracked via vector clocks\n- Schema versioning for backward compatibility\n\n### \uD83D\uDD04 Synchronization Engine\n```typescript\n// Conflict resolution during sync\nconst mergeResult = SyncState.merge({\n syncState: currentState,\n payload: incomingEvents,\n isEqualEvent: (a, b) => a.id === b.id && a.type === b.type\n})\n```\n\n**Merge Strategies:**\n- **Advance**: New events extend current state\n- **Rebase**: Rollback conflicting events, apply remote, replay local\n- **Reject**: Ignore events that violate invariants\n\n### \uD83C\uDF10 Network Layer & Adapters\n```typescript\n// Platform-specific sync adapters\nexport const WebAdapter = {\n storage: OPFSSQLiteStorage, // Origin Private File System\n transport: WebSocketSync,\n worker: SharedWorker // Cross-tab synchronization\n}\n```\n\n**Adapter Implementations:**\n- **Web**: OPFS storage, SharedWorker coordination, WebSocket sync\n- **Node**: File system storage, cluster coordination, HTTP/WebSocket\n- **Mobile**: Native SQLite, background sync, push notifications\n\n## Distributed Systems Properties\n\n### CAP Theorem Considerations\n- **Consistency**: Eventually consistent (not strongly consistent)\n- **Availability**: Always available for reads/writes (local-first)\n- **Partition Tolerance**: Continues operation during network partitions\n\n*Trade-off: Chooses Availability + Partition Tolerance over strong Consistency*\n\n### ACID Properties (Local Transactions)\n- **Atomicity**: Event application is atomic within SQLite transaction\n- **Consistency**: Materializers maintain data integrity constraints\n- **Isolation**: Concurrent operations isolated via SQLite WAL mode\n- **Durability**: Events persisted to disk before acknowledgment\n\n### Conflict Resolution Strategies\n\n1. **Semantic Conflict Resolution**\n - Application-specific merge logic\n - E.g., text editing uses operational transforms\n\n2. **Last-Write-Wins (LWW)**\n - Timestamps determine winner\n - Simple but can lose data\n\n3. **Multi-Value Registers**\n - Preserve all conflicting values\n - User or application resolves\n\n4. **Commutative Operations**\n - Operations designed to commute\n - E.g., increment/decrement counters\n\n## Performance & Scalability\n\n### Query Performance\n- **Reactive Queries**: Automatically update UI on data changes\n- **Indexed Access**: SQLite B-tree indexes for fast lookups\n- **Prepared Statements**: Query compilation cached for reuse\n- **Batch Operations**: Multiple events applied in single transaction\n\n### Memory Management\n- **Incremental Loading**: Large datasets loaded on-demand\n- **Query Result Caching**: Expensive query results cached\n- **Event Log Compaction**: Periodic snapshotting and log truncation\n- **Connection Pooling**: Database connections reused across operations\n\n### Network Optimization\n- **Delta Synchronization**: Only sync events since last checkpoint\n- **Compression**: Event payloads compressed for network transfer\n- **Batching**: Multiple events transmitted in single round-trip\n- **Exponential Backoff**: Retry failed sync with increasing delays\n\n## Security Model\n\n### Data Integrity\n- **Event Signatures**: Cryptographic signatures prevent tampering\n- **Merkle Trees**: Efficient verification of event log integrity\n- **Schema Validation**: All events validated against defined schemas\n\n### Access Control\n- **Client-Side Authorization**: Fine-grained permissions in local database\n- **Sync Filtering**: Server filters events based on user permissions\n- **Encryption**: End-to-end encryption for sensitive data\n\n## Observability\n\n### Distributed Tracing\n- **Event Causality**: Trace event propagation across replicas\n- **Sync Performance**: Monitor replication lag and throughput\n- **Conflict Metrics**: Track merge conflicts and resolution strategies\n\n### Health Monitoring\n- **Storage Usage**: Local database size and growth rate\n- **Network Health**: Connection quality and sync success rates\n- **Error Tracking**: Failed operations and their root causes\n\nThis architecture enables applications that work seamlessly offline, sync reliably when online, and provide immediate feedback to users while maintaining data consistency across all replicas.";
1
+ export declare const architectureContent = "# LiveStore Architecture: Local-First Data Management\n\nLiveStore implements distributed systems principles from Martin Kleppmann's research on local-first software, ensuring data consistency, availability, and partition tolerance in collaborative applications.\n\n## Core Architectural Principles\n\n### 1. Local-First Data Storage\n- **Immediate Response**: All operations execute against local SQLite database first\n- **Offline Capability**: Full application functionality without network connectivity\n- **Data Ownership**: Users maintain complete control over their data\n- **Performance**: Sub-millisecond query responses from local storage\n\n### 2. Event Sourcing & CRDT-Inspired Conflict Resolution\n- **Immutable Event Log**: All changes recorded as immutable events\n- **Deterministic Replay**: State reconstruction from event sequence\n- **Conflict-Free Operations**: Events designed for commutative application\n- **Causal Ordering**: Lamport timestamps ensure causally consistent ordering\n\n### 3. Eventually Consistent Synchronization\n- **Asynchronous Replication**: Events sync when network available\n- **Convergence Guarantee**: All replicas converge to same state\n- **Conflict Resolution**: Last-write-wins with semantic merging strategies\n- **Incremental Sync**: Only transmit events since last synchronization\n\n## System Components\n\n### \uD83D\uDDC4\uFE0F State Layer (SQLite + Materializers)\n```typescript\n// Materialized views from event log\nconst materializers = State.SQLite.materializers(events, {\n 'TodoCreated': ({ id, text, createdAt }) =>\n tables.todos.insert({ id, text, completed: false, createdAt }),\n 'TodoCompleted': ({ id }) =>\n tables.todos.update({ completed: true }).where({ id })\n})\n```\n\n**Responsibilities:**\n- Maintain denormalized query-optimized state\n- Apply events to update materialized views\n- Support efficient reactive queries\n- Handle schema migrations\n\n### \uD83D\uDCDD Event System (Append-Only Log)\n```typescript\nconst events = {\n todoCompleted: Events.synced({\n name: 'v1.TodoCompleted',\n schema: Schema.Struct({\n id: Schema.String,\n completedAt: Schema.Date // For conflict resolution\n })\n })\n}\n```\n\n**Characteristics:**\n- Immutable event log (append-only)\n- Cryptographically signed events for integrity\n- Causal dependencies tracked via vector clocks\n- Schema versioning for backward compatibility\n\n### \uD83D\uDD04 Synchronization Engine\n```typescript\n// Conflict resolution during sync\nconst mergeResult = SyncState.merge({\n syncState: currentState,\n payload: incomingEvents,\n isEqualEvent: (a, b) => a.id === b.id && a.type === b.type\n})\n```\n\n**Merge Strategies:**\n- **Advance**: New events extend current state\n- **Rebase**: Rollback conflicting events, apply remote, replay local\n- **Reject**: Ignore events that violate invariants\n\n### \uD83C\uDF10 Network Layer & Adapters\n```typescript\n// Platform-specific sync adapters\nexport const WebAdapter = {\n storage: OPFSSQLiteStorage, // Origin Private File System\n transport: WebSocketSync,\n worker: SharedWorker // Cross-tab synchronization\n}\n```\n\n**Adapter Implementations:**\n- **Web**: OPFS storage, SharedWorker coordination, WebSocket sync\n- **Node**: File system storage, cluster coordination, HTTP/WebSocket\n- **Mobile**: Native SQLite, background sync, push notifications\n\n## Distributed Systems Properties\n\n### CAP Theorem Considerations\n- **Consistency**: Eventually consistent (not strongly consistent)\n- **Availability**: Always available for reads/writes (local-first)\n- **Partition Tolerance**: Continues operation during network partitions\n\n*Trade-off: Chooses Availability + Partition Tolerance over strong Consistency*\n\n### ACID Properties (Local Transactions)\n- **Atomicity**: Event application is atomic within SQLite transaction\n- **Consistency**: Materializers maintain data integrity constraints\n- **Isolation**: Concurrent operations isolated via SQLite WAL mode\n- **Durability**: Events persisted to disk before acknowledgment\n\n### Conflict Resolution Strategies\n\n1. **Semantic Conflict Resolution**\n - Application-specific merge logic\n - E.g., text editing uses operational transforms\n\n2. **Last-Write-Wins (LWW)**\n - Timestamps determine winner\n - Simple but can lose data\n\n3. **Multi-Value Registers**\n - Preserve all conflicting values\n - User or application resolves\n\n4. **Commutative Operations**\n - Operations designed to commute\n - E.g., increment/decrement counters\n\n## Performance & Scalability\n\n### Query Performance\n- **Reactive Queries**: Automatically update UI on data changes\n- **Indexed Access**: SQLite B-tree indexes for fast lookups\n- **Prepared Statements**: Query compilation cached for reuse\n- **Batch Operations**: Multiple events applied in single transaction\n\n### Memory Management\n- **Incremental Loading**: Large datasets loaded on-demand\n- **Query Result Caching**: Expensive query results cached\n- **Event Log Compaction**: Periodic snapshotting and log truncation\n- **Connection Pooling**: Database connections reused across operations\n\n### Network Optimization\n- **Delta Synchronization**: Only sync events since last checkpoint\n- **Compression**: Event payloads compressed for network transfer\n- **Batching**: Multiple events transmitted in single round-trip\n- **Exponential Backoff**: Retry failed sync with increasing delays\n\n## Security Model\n\n### Data Integrity\n- **Event Signatures**: Cryptographic signatures prevent tampering\n- **Merkle Trees**: Efficient verification of event log integrity\n- **Schema Validation**: All events validated against defined schemas\n\n### Access Control\n- **Client-Side Authorization**: Fine-grained permissions in local database\n- **Sync Filtering**: Server filters events based on user permissions\n- **Encryption**: End-to-end encryption for sensitive data\n\n## Observability\n\n### Distributed Tracing\n- **Event Causality**: Trace event propagation across replicas\n- **Sync Performance**: Monitor replication lag and throughput\n- **Conflict Metrics**: Track merge conflicts and resolution strategies\n\n### Health Monitoring\n- **Storage Usage**: Local database size and growth rate\n- **Network Health**: Connection quality and sync success rates\n- **Error Tracking**: Failed operations and their root causes\n\nThis architecture enables applications that work seamlessly offline, sync reliably when online, and provide immediate feedback to users while maintaining data consistency across all replicas.";
2
2
  //# sourceMappingURL=architecture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../src/mcp-content/architecture.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,29MAyKgK,CAAA"}
1
+ {"version":3,"file":"architecture.d.ts","sourceRoot":"","sources":["../../src/mcp-content/architecture.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,w9MAyKgK,CAAA"}
@@ -28,9 +28,9 @@ LiveStore implements distributed systems principles from Martin Kleppmann's rese
28
28
  \`\`\`typescript
29
29
  // Materialized views from event log
30
30
  const materializers = State.SQLite.materializers(events, {
31
- 'TodoCreated': ({ id, text, createdAt }) =>
31
+ 'TodoCreated': ({ id, text, createdAt }) =>
32
32
  tables.todos.insert({ id, text, completed: false, createdAt }),
33
- 'TodoCompleted': ({ id }) =>
33
+ 'TodoCompleted': ({ id }) =>
34
34
  tables.todos.update({ completed: true }).where({ id })
35
35
  })
36
36
  \`\`\`
@@ -46,7 +46,7 @@ const materializers = State.SQLite.materializers(events, {
46
46
  const events = {
47
47
  todoCompleted: Events.synced({
48
48
  name: 'v1.TodoCompleted',
49
- schema: Schema.Struct({
49
+ schema: Schema.Struct({
50
50
  id: Schema.String,
51
51
  completedAt: Schema.Date // For conflict resolution
52
52
  })