@livestore/cli 0.4.0-dev.7 → 0.4.0-dev.8

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.
@@ -1,12 +1,16 @@
1
- import { AiError, AiTool, Effect, Schema } from '@livestore/utils/effect';
2
- export declare const coachTool: AiTool.AiTool<"livestore_coach", Schema.Struct<{
3
- code: Schema.SchemaClass<string, string, never>;
4
- codeType: Schema.optional<Schema.SchemaClass<string, string, never>>;
5
- }>, Schema.Struct<{
6
- feedback: Schema.SchemaClass<string, string, never>;
7
- score: Schema.optional<Schema.SchemaClass<number, number, never>>;
8
- suggestions: Schema.Array$<Schema.SchemaClass<string, string, never>>;
9
- }>, typeof AiError.AiError, never>;
1
+ import { AiError, Effect, Schema, Tool } from '@livestore/utils/effect';
2
+ export declare const coachTool: Tool.Tool<"livestore_coach", {
3
+ readonly parameters: Schema.Struct<{
4
+ code: Schema.SchemaClass<string, string, never>;
5
+ codeType: Schema.optional<Schema.SchemaClass<string, string, never>>;
6
+ }>;
7
+ readonly success: Schema.Struct<{
8
+ feedback: Schema.SchemaClass<string, string, never>;
9
+ score: Schema.optional<Schema.SchemaClass<number, number, never>>;
10
+ suggestions: Schema.Array$<Schema.SchemaClass<string, string, never>>;
11
+ }>;
12
+ readonly failure: Schema.Union<[typeof AiError.HttpRequestError, typeof AiError.HttpResponseError, typeof AiError.MalformedInput, typeof AiError.MalformedOutput, typeof AiError.UnknownError]>;
13
+ }, never>;
10
14
  export declare const coachToolHandler: (args_0: any) => Effect.Effect<{
11
15
  feedback: string;
12
16
  score: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-coach.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-coach.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAEP,MAAM,EAEN,MAAM,EAGN,MAAM,EACP,MAAM,yBAAyB,CAAA;AAGhC,eAAO,MAAM,SAAS;;;;;;;kCA+BpB,CAAA;AAWF,eAAO,MAAM,gBAAgB;;;;0BAiE5B,CAAA"}
1
+ {"version":3,"file":"mcp-coach.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-coach.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EAEP,MAAM,EAKN,MAAM,EACN,IAAI,EACL,MAAM,yBAAyB,CAAA;AAGhC,eAAO,MAAM,SAAS;;;;;;;;;;;SA+BpB,CAAA;AAWF,eAAO,MAAM,gBAAgB;;;;0BAyE5B,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { OpenAiClient, OpenAiLanguageModel } from '@effect/ai-openai';
2
- import { AiError, AiLanguageModel, AiTool, Config, Effect, FetchHttpClient, Layer, Schema, } from '@livestore/utils/effect';
2
+ import { AiError, Config, Effect, FetchHttpClient, LanguageModel, Layer, Prompt, Schema, Tool, } from '@livestore/utils/effect';
3
3
  // Define the coach tool that analyzes LiveStore usage
4
- export const coachTool = AiTool.make('livestore_coach', {
4
+ export const coachTool = Tool.make('livestore_coach', {
5
5
  description: 'Analyze LiveStore code (schemas, queries, mutations, etc.) and provide AI-powered feedback on best practices, performance, and improvements.',
6
6
  parameters: {
7
7
  code: Schema.String.annotations({
@@ -36,7 +36,10 @@ const OpenAiModel = OpenAiLanguageModel.layer({
36
36
  export const coachToolHandler = Effect.fnUntraced(function* ({ code, codeType }) {
37
37
  // Build the analysis prompt
38
38
  const codeTypeContext = codeType ? `This is ${codeType} code using LiveStore. ` : 'This is LiveStore code. ';
39
- const prompt = `${codeTypeContext}Please review the following code and provide helpful feedback focusing on:
39
+ const prompt = Prompt.makeMessage('user', {
40
+ content: [
41
+ Prompt.makePart('text', {
42
+ text: `${codeTypeContext}Please review the following code and provide helpful feedback focusing on:
40
43
 
41
44
  1. LiveStore best practices and conventions
42
45
  2. Schema design and relationships (if applicable)
@@ -57,11 +60,16 @@ Please provide:
57
60
  3. Best practice recommendations
58
61
  4. Any potential issues or concerns
59
62
 
60
- Format your response as constructive feedback that helps developers improve their LiveStore usage.`;
61
- const systemPrompt = `You are an expert LiveStore developer and code reviewer. Provide constructive, specific, and actionable feedback on LiveStore code. Focus on best practices, performance, and maintainability.`;
63
+ Format your response as constructive feedback that helps developers improve their LiveStore usage.`,
64
+ }),
65
+ ],
66
+ });
67
+ const systemPrompt = Prompt.makeMessage('system', {
68
+ content: `You are an expert LiveStore developer and code reviewer. Provide constructive, specific, and actionable feedback on LiveStore code. Focus on best practices, performance, and maintainability.`,
69
+ });
62
70
  // Get OpenAI client and call the API
63
- const llm = yield* AiLanguageModel.AiLanguageModel;
64
- const completion = yield* llm.generateText({ prompt, system: systemPrompt });
71
+ const llm = yield* LanguageModel.LanguageModel;
72
+ const completion = yield* llm.generateText({ prompt: Prompt.fromMessages([systemPrompt, prompt]) });
65
73
  const feedback = completion.text ?? 'Unable to generate feedback';
66
74
  // Extract suggestions from the feedback (simple approach)
67
75
  const suggestions = feedback
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-coach.js","sourceRoot":"","sources":["../../src/commands/mcp-coach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EACL,OAAO,EACP,eAAe,EACf,MAAM,EACN,MAAM,EACN,MAAM,EACN,eAAe,EACf,KAAK,EACL,MAAM,GACP,MAAM,yBAAyB,CAAA;AAEhC,sDAAsD;AACtD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE;IACtD,WAAW,EACT,8IAA8I;IAChJ,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YAC9B,WAAW,EAAE,uDAAuD;SACrE,CAAC;QACF,QAAQ,EAAE,MAAM,CAAC,QAAQ,CACvB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YACxB,WAAW,EAAE,uFAAuF;SACrG,CAAC,CACH;KACF;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,QAAQ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AAC,EACD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,EAClE,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EACrC,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACrD,CAAA"}
@@ -1,23 +1,39 @@
1
- import { AiTool, AiToolkit, Effect, Schema } from '@livestore/utils/effect';
2
- export declare const livestoreToolkit: AiToolkit.AiToolkit<AiTool.AiTool<"livestore_coach", Schema.Struct<{
3
- code: Schema.SchemaClass<string, string, never>;
4
- codeType: Schema.optional<Schema.SchemaClass<string, string, never>>;
5
- }>, Schema.Struct<{
6
- feedback: Schema.SchemaClass<string, string, never>;
7
- score: Schema.optional<Schema.SchemaClass<number, number, never>>;
8
- suggestions: Schema.Array$<Schema.SchemaClass<string, string, never>>;
9
- }>, typeof import("@effect/ai/AiError").AiError, never> | AiTool.AiTool<"livestore_generate_schema", Schema.Struct<{
10
- schemaType: Schema.SchemaClass<string, string, never>;
11
- customDescription: Schema.optional<Schema.SchemaClass<string, string, never>>;
12
- }>, Schema.Struct<{
13
- schemaCode: Schema.SchemaClass<string, string, never>;
14
- explanation: Schema.SchemaClass<string, string, never>;
15
- }>, typeof Schema.Never, never> | AiTool.AiTool<"livestore_get_example_schema", Schema.Struct<{
16
- type: Schema.SchemaClass<string, string, never>;
17
- }>, Schema.Struct<{
18
- schemaCode: Schema.SchemaClass<string, string, never>;
19
- description: Schema.SchemaClass<string, string, never>;
20
- }>, typeof Schema.Never, never>>;
1
+ import { Effect, Schema, Tool, Toolkit } from '@livestore/utils/effect';
2
+ export declare const livestoreToolkit: Toolkit.Toolkit<{
3
+ readonly livestore_coach: Tool.Tool<"livestore_coach", {
4
+ readonly parameters: Schema.Struct<{
5
+ code: Schema.SchemaClass<string, string, never>;
6
+ codeType: Schema.optional<Schema.SchemaClass<string, string, never>>;
7
+ }>;
8
+ readonly success: Schema.Struct<{
9
+ feedback: Schema.SchemaClass<string, string, never>;
10
+ score: Schema.optional<Schema.SchemaClass<number, number, never>>;
11
+ suggestions: Schema.Array$<Schema.SchemaClass<string, string, never>>;
12
+ }>;
13
+ readonly failure: Schema.Union<[typeof import("@effect/ai/AiError").HttpRequestError, typeof import("@effect/ai/AiError").HttpResponseError, typeof import("@effect/ai/AiError").MalformedInput, typeof import("@effect/ai/AiError").MalformedOutput, typeof import("@effect/ai/AiError").UnknownError]>;
14
+ }, never>;
15
+ readonly livestore_generate_schema: Tool.Tool<"livestore_generate_schema", {
16
+ readonly parameters: Schema.Struct<{
17
+ schemaType: Schema.SchemaClass<string, string, never>;
18
+ customDescription: Schema.optional<Schema.SchemaClass<string, string, never>>;
19
+ }>;
20
+ readonly success: Schema.Struct<{
21
+ schemaCode: Schema.SchemaClass<string, string, never>;
22
+ explanation: Schema.SchemaClass<string, string, never>;
23
+ }>;
24
+ readonly failure: typeof Schema.Never;
25
+ }, never>;
26
+ readonly livestore_get_example_schema: Tool.Tool<"livestore_get_example_schema", {
27
+ readonly parameters: Schema.Struct<{
28
+ type: Schema.SchemaClass<string, string, never>;
29
+ }>;
30
+ readonly success: Schema.Struct<{
31
+ schemaCode: Schema.SchemaClass<string, string, never>;
32
+ description: Schema.SchemaClass<string, string, never>;
33
+ }>;
34
+ readonly failure: typeof Schema.Never;
35
+ }, never>;
36
+ }>;
21
37
  export declare const toolHandlers: {
22
38
  livestore_coach: (args_0: any) => Effect.Effect<{
23
39
  feedback: string;
@@ -26,6 +42,7 @@ export declare const toolHandlers: {
26
42
  }, import("@effect/ai/AiError").AiError, never>;
27
43
  livestore_generate_schema: (args_0: {
28
44
  readonly schemaType: string;
45
+ } & {
29
46
  readonly customDescription?: string | undefined;
30
47
  }) => Effect.Effect<{
31
48
  schemaCode: string;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tools.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAQ3E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;gCA8C5B,CAAA;AAGD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;CA+GvB,CAAA"}
1
+ {"version":3,"file":"mcp-tools.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAQvE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8C5B,CAAA;AAGD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CA+GvB,CAAA"}
@@ -1,11 +1,11 @@
1
- import { AiTool, AiToolkit, Effect, Schema } from '@livestore/utils/effect';
1
+ import { Effect, Schema, Tool, Toolkit } from '@livestore/utils/effect';
2
2
  import { blogSchemaContent } from "../mcp-content/schemas/blog.js";
3
3
  import { ecommerceSchemaContent } from "../mcp-content/schemas/ecommerce.js";
4
4
  import { socialSchemaContent } from "../mcp-content/schemas/social.js";
5
5
  import { todoSchemaContent } from "../mcp-content/schemas/todo.js";
6
6
  import { coachTool, coachToolHandler } from "./mcp-coach.js";
7
7
  // Create toolkit with tools and handlers following Tim Smart's pattern
8
- export const livestoreToolkit = AiToolkit.make(coachTool, AiTool.make('livestore_generate_schema', {
8
+ export const livestoreToolkit = Toolkit.make(coachTool, Tool.make('livestore_generate_schema', {
9
9
  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.',
10
10
  parameters: {
11
11
  schemaType: Schema.String.annotations({
@@ -23,7 +23,7 @@ export const livestoreToolkit = AiToolkit.make(coachTool, AiTool.make('livestore
23
23
  description: 'Brief explanation of the schema structure',
24
24
  }),
25
25
  }),
26
- }), AiTool.make('livestore_get_example_schema', {
26
+ }), Tool.make('livestore_get_example_schema', {
27
27
  description: 'Get a complete example LiveStore schema with TypeScript code. Returns ready-to-use schema definitions for common application types.',
28
28
  parameters: {
29
29
  type: Schema.String.annotations({
@@ -39,8 +39,8 @@ export const livestoreToolkit = AiToolkit.make(coachTool, AiTool.make('livestore
39
39
  }),
40
40
  }),
41
41
  })
42
- .annotate(AiTool.Readonly, true)
43
- .annotate(AiTool.Destructive, false));
42
+ .annotate(Tool.Readonly, true)
43
+ .annotate(Tool.Destructive, false));
44
44
  // Tool handlers using Tim Smart's pattern
45
45
  export const toolHandlers = livestoreToolkit.of({
46
46
  livestore_coach: coachToolHandler,
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tools.js","sourceRoot":"","sources":["../../src/commands/mcp-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAC3E,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,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAE5D,uEAAuE;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC,IAAI,CAC5C,SAAS,EAET,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;IACvC,WAAW,EACT,0KAA0K;IAC5K,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YACpC,WAAW,EAAE,iEAAiE;SAC/E,CAAC;QACF,iBAAiB,EAAE,MAAM,CAAC,QAAQ,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