@puckeditor/plugin-ai 0.1.0-canary.3c29c6ea → 0.1.0-canary.471d06a1

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/index.d.mts CHANGED
@@ -1,5 +1,103 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
+ type _JSONSchema = boolean | JSONSchema;
4
+ type JSONSchema = {
5
+ [k: string]: unknown;
6
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
7
+ $id?: string;
8
+ $anchor?: string;
9
+ $ref?: string;
10
+ $dynamicRef?: string;
11
+ $dynamicAnchor?: string;
12
+ $vocabulary?: Record<string, boolean>;
13
+ $comment?: string;
14
+ $defs?: Record<string, JSONSchema>;
15
+ type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
16
+ additionalItems?: _JSONSchema;
17
+ unevaluatedItems?: _JSONSchema;
18
+ prefixItems?: _JSONSchema[];
19
+ items?: _JSONSchema | _JSONSchema[];
20
+ contains?: _JSONSchema;
21
+ additionalProperties?: _JSONSchema;
22
+ unevaluatedProperties?: _JSONSchema;
23
+ properties?: Record<string, _JSONSchema>;
24
+ patternProperties?: Record<string, _JSONSchema>;
25
+ dependentSchemas?: Record<string, _JSONSchema>;
26
+ propertyNames?: _JSONSchema;
27
+ if?: _JSONSchema;
28
+ then?: _JSONSchema;
29
+ else?: _JSONSchema;
30
+ allOf?: JSONSchema[];
31
+ anyOf?: JSONSchema[];
32
+ oneOf?: JSONSchema[];
33
+ not?: _JSONSchema;
34
+ multipleOf?: number;
35
+ maximum?: number;
36
+ exclusiveMaximum?: number | boolean;
37
+ minimum?: number;
38
+ exclusiveMinimum?: number | boolean;
39
+ maxLength?: number;
40
+ minLength?: number;
41
+ pattern?: string;
42
+ maxItems?: number;
43
+ minItems?: number;
44
+ uniqueItems?: boolean;
45
+ maxContains?: number;
46
+ minContains?: number;
47
+ maxProperties?: number;
48
+ minProperties?: number;
49
+ required?: string[];
50
+ dependentRequired?: Record<string, string[]>;
51
+ enum?: Array<string | number | boolean | null>;
52
+ const?: string | number | boolean | null;
53
+ id?: string;
54
+ title?: string;
55
+ description?: string;
56
+ default?: unknown;
57
+ deprecated?: boolean;
58
+ readOnly?: boolean;
59
+ writeOnly?: boolean;
60
+ nullable?: boolean;
61
+ examples?: unknown[];
62
+ format?: string;
63
+ contentMediaType?: string;
64
+ contentEncoding?: string;
65
+ contentSchema?: JSONSchema;
66
+ _prefault?: unknown;
67
+ };
68
+
69
+ type ComponentAiParams = {
70
+ instructions?: string;
71
+ schema?: JSONSchema;
72
+ defaultZone?: { allow?: string[]; disallow?: string[]; disabled?: boolean };
73
+ };
74
+
75
+ type FieldAiParams = {
76
+ instructions?: string;
77
+ exclude?: boolean;
78
+ required?: boolean;
79
+ stream?: boolean;
80
+ schema?: JSONSchema;
81
+ };
82
+
83
+ declare module "@measured/puck" {
84
+ export interface ComponentMetadata {
85
+ ai?: ComponentAiParams;
86
+ }
87
+
88
+ export interface ComponentConfigExtensions {
89
+ ai?: ComponentAiParams;
90
+ }
91
+
92
+ export interface FieldMetadata {
93
+ ai?: FieldAiParams;
94
+ }
95
+
96
+ export interface BaseField {
97
+ ai?: FieldAiParams;
98
+ }
99
+ }
100
+
3
101
  type AiPluginProps = {
4
102
  host?: string;
5
103
  chat?: {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,103 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
+ type _JSONSchema = boolean | JSONSchema;
4
+ type JSONSchema = {
5
+ [k: string]: unknown;
6
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
7
+ $id?: string;
8
+ $anchor?: string;
9
+ $ref?: string;
10
+ $dynamicRef?: string;
11
+ $dynamicAnchor?: string;
12
+ $vocabulary?: Record<string, boolean>;
13
+ $comment?: string;
14
+ $defs?: Record<string, JSONSchema>;
15
+ type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
16
+ additionalItems?: _JSONSchema;
17
+ unevaluatedItems?: _JSONSchema;
18
+ prefixItems?: _JSONSchema[];
19
+ items?: _JSONSchema | _JSONSchema[];
20
+ contains?: _JSONSchema;
21
+ additionalProperties?: _JSONSchema;
22
+ unevaluatedProperties?: _JSONSchema;
23
+ properties?: Record<string, _JSONSchema>;
24
+ patternProperties?: Record<string, _JSONSchema>;
25
+ dependentSchemas?: Record<string, _JSONSchema>;
26
+ propertyNames?: _JSONSchema;
27
+ if?: _JSONSchema;
28
+ then?: _JSONSchema;
29
+ else?: _JSONSchema;
30
+ allOf?: JSONSchema[];
31
+ anyOf?: JSONSchema[];
32
+ oneOf?: JSONSchema[];
33
+ not?: _JSONSchema;
34
+ multipleOf?: number;
35
+ maximum?: number;
36
+ exclusiveMaximum?: number | boolean;
37
+ minimum?: number;
38
+ exclusiveMinimum?: number | boolean;
39
+ maxLength?: number;
40
+ minLength?: number;
41
+ pattern?: string;
42
+ maxItems?: number;
43
+ minItems?: number;
44
+ uniqueItems?: boolean;
45
+ maxContains?: number;
46
+ minContains?: number;
47
+ maxProperties?: number;
48
+ minProperties?: number;
49
+ required?: string[];
50
+ dependentRequired?: Record<string, string[]>;
51
+ enum?: Array<string | number | boolean | null>;
52
+ const?: string | number | boolean | null;
53
+ id?: string;
54
+ title?: string;
55
+ description?: string;
56
+ default?: unknown;
57
+ deprecated?: boolean;
58
+ readOnly?: boolean;
59
+ writeOnly?: boolean;
60
+ nullable?: boolean;
61
+ examples?: unknown[];
62
+ format?: string;
63
+ contentMediaType?: string;
64
+ contentEncoding?: string;
65
+ contentSchema?: JSONSchema;
66
+ _prefault?: unknown;
67
+ };
68
+
69
+ type ComponentAiParams = {
70
+ instructions?: string;
71
+ schema?: JSONSchema;
72
+ defaultZone?: { allow?: string[]; disallow?: string[]; disabled?: boolean };
73
+ };
74
+
75
+ type FieldAiParams = {
76
+ instructions?: string;
77
+ exclude?: boolean;
78
+ required?: boolean;
79
+ stream?: boolean;
80
+ schema?: JSONSchema;
81
+ };
82
+
83
+ declare module "@measured/puck" {
84
+ export interface ComponentMetadata {
85
+ ai?: ComponentAiParams;
86
+ }
87
+
88
+ export interface ComponentConfigExtensions {
89
+ ai?: ComponentAiParams;
90
+ }
91
+
92
+ export interface FieldMetadata {
93
+ ai?: FieldAiParams;
94
+ }
95
+
96
+ export interface BaseField {
97
+ ai?: FieldAiParams;
98
+ }
99
+ }
100
+
3
101
  type AiPluginProps = {
4
102
  host?: string;
5
103
  chat?: {
package/dist/index.js CHANGED
@@ -193,7 +193,9 @@ __export(index_exports, {
193
193
  });
194
194
  module.exports = __toCommonJS(index_exports);
195
195
  init_react_import();
196
- var import_ai_types = require("@puckeditor/ai-types");
196
+
197
+ // ../ai-types/index.js
198
+ init_react_import();
197
199
 
198
200
  // src/index.tsx
199
201
  init_react_import();
@@ -338,11 +340,14 @@ var TriangleAlert = createLucideIcon("TriangleAlert", [
338
340
  // src/components/Chat/index.tsx
339
341
  init_react_import();
340
342
 
341
- // ../../node_modules/.pnpm/@ai-sdk+react@2.0.44_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
343
+ // ../../node_modules/.pnpm/@ai-sdk+react@2.0.29_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
342
344
  init_react_import();
343
345
  var import_react4 = require("react");
344
346
 
345
- // ../../node_modules/.pnpm/ai@5.0.44_zod@4.1.12/node_modules/ai/dist/index.mjs
347
+ // ../../node_modules/.pnpm/ai@5.0.29_zod@4.1.12/node_modules/ai/dist/index.mjs
348
+ init_react_import();
349
+
350
+ // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.7_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
346
351
  init_react_import();
347
352
 
348
353
  // ../../node_modules/.pnpm/@ai-sdk+provider@2.0.0/node_modules/@ai-sdk/provider/dist/index.mjs
@@ -523,9 +528,6 @@ var symbol14 = Symbol.for(marker14);
523
528
  var _a14;
524
529
  _a14 = symbol14;
525
530
 
526
- // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.9_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
527
- init_react_import();
528
-
529
531
  // ../../node_modules/.pnpm/eventsource-parser@3.0.5/node_modules/eventsource-parser/dist/stream.js
530
532
  init_react_import();
531
533
 
@@ -17190,7 +17192,7 @@ var nullableType = ZodNullable2.create;
17190
17192
  var preprocessType = ZodEffects.createWithPreprocess;
17191
17193
  var pipelineType = ZodPipeline.create;
17192
17194
 
17193
- // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.9_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
17195
+ // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.7_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
17194
17196
  var createIdGenerator = ({
17195
17197
  prefix,
17196
17198
  size = 16,
@@ -18503,7 +18505,7 @@ function asSchema(schema) {
18503
18505
  }
18504
18506
  var { btoa: btoa2, atob: atob2 } = globalThis;
18505
18507
 
18506
- // ../../node_modules/.pnpm/ai@5.0.44_zod@4.1.12/node_modules/ai/dist/index.mjs
18508
+ // ../../node_modules/.pnpm/ai@5.0.29_zod@4.1.12/node_modules/ai/dist/index.mjs
18507
18509
  var __defProp2 = Object.defineProperty;
18508
18510
  var __export2 = (target, all) => {
18509
18511
  for (var name17 in all)
@@ -20556,7 +20558,6 @@ var toolUIPartSchemas = [
20556
20558
  type: external_exports.string().startsWith("tool-"),
20557
20559
  toolCallId: external_exports.string(),
20558
20560
  state: external_exports.literal("input-streaming"),
20559
- providerExecuted: external_exports.boolean().optional(),
20560
20561
  input: external_exports.unknown().optional(),
20561
20562
  output: external_exports.never().optional(),
20562
20563
  errorText: external_exports.never().optional()
@@ -20565,7 +20566,6 @@ var toolUIPartSchemas = [
20565
20566
  type: external_exports.string().startsWith("tool-"),
20566
20567
  toolCallId: external_exports.string(),
20567
20568
  state: external_exports.literal("input-available"),
20568
- providerExecuted: external_exports.boolean().optional(),
20569
20569
  input: external_exports.unknown(),
20570
20570
  output: external_exports.never().optional(),
20571
20571
  errorText: external_exports.never().optional(),
@@ -20575,7 +20575,6 @@ var toolUIPartSchemas = [
20575
20575
  type: external_exports.string().startsWith("tool-"),
20576
20576
  toolCallId: external_exports.string(),
20577
20577
  state: external_exports.literal("output-available"),
20578
- providerExecuted: external_exports.boolean().optional(),
20579
20578
  input: external_exports.unknown(),
20580
20579
  output: external_exports.unknown(),
20581
20580
  errorText: external_exports.never().optional(),
@@ -20586,7 +20585,6 @@ var toolUIPartSchemas = [
20586
20585
  type: external_exports.string().startsWith("tool-"),
20587
20586
  toolCallId: external_exports.string(),
20588
20587
  state: external_exports.literal("output-error"),
20589
- providerExecuted: external_exports.boolean().optional(),
20590
20588
  input: external_exports.unknown(),
20591
20589
  output: external_exports.never().optional(),
20592
20590
  errorText: external_exports.string(),
@@ -20612,7 +20610,7 @@ var uiMessageSchema = external_exports.object({
20612
20610
  )
20613
20611
  });
20614
20612
 
20615
- // ../../node_modules/.pnpm/@ai-sdk+react@2.0.44_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
20613
+ // ../../node_modules/.pnpm/@ai-sdk+react@2.0.29_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
20616
20614
  var import_throttleit = __toESM(require_throttleit(), 1);
20617
20615
  var import_react5 = require("react");
20618
20616
  var import_react6 = require("react");
package/dist/index.mjs CHANGED
@@ -185,7 +185,9 @@ var require_classnames = __commonJS({
185
185
 
186
186
  // index.ts
187
187
  init_react_import();
188
- import "@puckeditor/ai-types";
188
+
189
+ // ../ai-types/index.js
190
+ init_react_import();
189
191
 
190
192
  // src/index.tsx
191
193
  init_react_import();
@@ -330,11 +332,14 @@ var TriangleAlert = createLucideIcon("TriangleAlert", [
330
332
  // src/components/Chat/index.tsx
331
333
  init_react_import();
332
334
 
333
- // ../../node_modules/.pnpm/@ai-sdk+react@2.0.44_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
335
+ // ../../node_modules/.pnpm/@ai-sdk+react@2.0.29_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
334
336
  init_react_import();
335
337
  import { useCallback, useEffect, useRef, useSyncExternalStore } from "react";
336
338
 
337
- // ../../node_modules/.pnpm/ai@5.0.44_zod@4.1.12/node_modules/ai/dist/index.mjs
339
+ // ../../node_modules/.pnpm/ai@5.0.29_zod@4.1.12/node_modules/ai/dist/index.mjs
340
+ init_react_import();
341
+
342
+ // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.7_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
338
343
  init_react_import();
339
344
 
340
345
  // ../../node_modules/.pnpm/@ai-sdk+provider@2.0.0/node_modules/@ai-sdk/provider/dist/index.mjs
@@ -515,9 +520,6 @@ var symbol14 = Symbol.for(marker14);
515
520
  var _a14;
516
521
  _a14 = symbol14;
517
522
 
518
- // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.9_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
519
- init_react_import();
520
-
521
523
  // ../../node_modules/.pnpm/eventsource-parser@3.0.5/node_modules/eventsource-parser/dist/stream.js
522
524
  init_react_import();
523
525
 
@@ -17182,7 +17184,7 @@ var nullableType = ZodNullable2.create;
17182
17184
  var preprocessType = ZodEffects.createWithPreprocess;
17183
17185
  var pipelineType = ZodPipeline.create;
17184
17186
 
17185
- // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.9_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
17187
+ // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.7_zod@4.1.12/node_modules/@ai-sdk/provider-utils/dist/index.mjs
17186
17188
  var createIdGenerator = ({
17187
17189
  prefix,
17188
17190
  size = 16,
@@ -18495,7 +18497,7 @@ function asSchema(schema) {
18495
18497
  }
18496
18498
  var { btoa: btoa2, atob: atob2 } = globalThis;
18497
18499
 
18498
- // ../../node_modules/.pnpm/ai@5.0.44_zod@4.1.12/node_modules/ai/dist/index.mjs
18500
+ // ../../node_modules/.pnpm/ai@5.0.29_zod@4.1.12/node_modules/ai/dist/index.mjs
18499
18501
  var __defProp2 = Object.defineProperty;
18500
18502
  var __export2 = (target, all) => {
18501
18503
  for (var name17 in all)
@@ -20548,7 +20550,6 @@ var toolUIPartSchemas = [
20548
20550
  type: external_exports.string().startsWith("tool-"),
20549
20551
  toolCallId: external_exports.string(),
20550
20552
  state: external_exports.literal("input-streaming"),
20551
- providerExecuted: external_exports.boolean().optional(),
20552
20553
  input: external_exports.unknown().optional(),
20553
20554
  output: external_exports.never().optional(),
20554
20555
  errorText: external_exports.never().optional()
@@ -20557,7 +20558,6 @@ var toolUIPartSchemas = [
20557
20558
  type: external_exports.string().startsWith("tool-"),
20558
20559
  toolCallId: external_exports.string(),
20559
20560
  state: external_exports.literal("input-available"),
20560
- providerExecuted: external_exports.boolean().optional(),
20561
20561
  input: external_exports.unknown(),
20562
20562
  output: external_exports.never().optional(),
20563
20563
  errorText: external_exports.never().optional(),
@@ -20567,7 +20567,6 @@ var toolUIPartSchemas = [
20567
20567
  type: external_exports.string().startsWith("tool-"),
20568
20568
  toolCallId: external_exports.string(),
20569
20569
  state: external_exports.literal("output-available"),
20570
- providerExecuted: external_exports.boolean().optional(),
20571
20570
  input: external_exports.unknown(),
20572
20571
  output: external_exports.unknown(),
20573
20572
  errorText: external_exports.never().optional(),
@@ -20578,7 +20577,6 @@ var toolUIPartSchemas = [
20578
20577
  type: external_exports.string().startsWith("tool-"),
20579
20578
  toolCallId: external_exports.string(),
20580
20579
  state: external_exports.literal("output-error"),
20581
- providerExecuted: external_exports.boolean().optional(),
20582
20580
  input: external_exports.unknown(),
20583
20581
  output: external_exports.never().optional(),
20584
20582
  errorText: external_exports.string(),
@@ -20604,7 +20602,7 @@ var uiMessageSchema = external_exports.object({
20604
20602
  )
20605
20603
  });
20606
20604
 
20607
- // ../../node_modules/.pnpm/@ai-sdk+react@2.0.44_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
20605
+ // ../../node_modules/.pnpm/@ai-sdk+react@2.0.29_react@19.1.1_zod@4.1.12/node_modules/@ai-sdk/react/dist/index.mjs
20608
20606
  var import_throttleit = __toESM(require_throttleit(), 1);
20609
20607
  import { useCallback as useCallback2, useEffect as useEffect2, useId, useRef as useRef2, useState } from "react";
20610
20608
  import { useCallback as useCallback3, useId as useId2, useRef as useRef3, useState as useState2 } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-ai",
3
- "version": "0.1.0-canary.3c29c6ea",
3
+ "version": "0.1.0-canary.471d06a1",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",
@@ -23,9 +23,6 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "@puckeditor/ai-types": "workspace:*",
27
- "html2canvas-pro": "^1.5.11",
28
- "jsonrepair": "^3.12.0",
29
26
  "qler": "^0.6.2",
30
27
  "react-markdown": "^10.1.0",
31
28
  "react-textarea-autosize": "^8.5.9",
@@ -35,6 +32,7 @@
35
32
  "devDependencies": {
36
33
  "@ai-sdk/react": "^2.0.29",
37
34
  "@measured/puck": "0.21.0-canary.e9d5c0ea",
35
+ "@puckeditor/ai-types": "workspace:*",
38
36
  "@puckeditor/platform-types": "workspace:*",
39
37
  "@types/jest": "^30.0.0",
40
38
  "@types/node": "^24.3.0",