@quillmark/wasm 0.69.1 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundler/wasm.d.ts CHANGED
@@ -102,10 +102,9 @@ export interface QuillCardUi {
102
102
  /** Schema entry for a single field declared in a quill's `Quill.yaml`. */
103
103
  export interface QuillFieldSchema {
104
104
  type: "string" | "number" | "integer" | "boolean" | "array" | "object" | "date" | "datetime" | "markdown";
105
- title?: string;
106
105
  description?: string;
107
106
  default?: unknown;
108
- examples?: unknown;
107
+ example?: unknown;
109
108
  required?: boolean;
110
109
  enum?: string[];
111
110
  ui?: QuillFieldUi;
@@ -115,37 +114,33 @@ export interface QuillFieldSchema {
115
114
 
116
115
  /** Schema entry for the main card or a named card type. */
117
116
  export interface QuillCardSchema {
118
- title?: string;
119
117
  description?: string;
120
118
  fields: Record<string, QuillFieldSchema>;
121
119
  ui?: QuillCardUi;
122
120
  }
123
121
 
124
122
  /**
125
- * Public schema contract returned as `QuillMetadata.schema`.
123
+ * Document schema. Returned by both `Quill.schema` (no ui hints) and
124
+ * `Quill.formSchema` (with ui hints) — same shape, optional `ui` keys.
126
125
  *
127
- * Identical to `QuillConfig::public_schema()` on the Rust side.
126
+ * `main.fields.QUILL` and `card_types[name].fields.CARD` are required
127
+ * sentinels with `const` values telling consumers what to write.
128
128
  */
129
129
  export interface QuillSchema {
130
- name: string;
131
130
  main: QuillCardSchema;
132
131
  /** Present only when the quill declares at least one named card type. */
133
132
  card_types?: Record<string, QuillCardSchema>;
134
- /** The quill's bundled example document, if declared. */
135
- example?: string;
136
133
  }
137
134
 
138
135
  /**
139
- * Read-only snapshot of the loaded quill's engine info and declared schema.
140
- * Returned by `Quill.metadata`.
141
- *
142
- * Well-known keys are strongly typed; any additional keys declared under
143
- * `quill:` in `Quill.yaml` appear as `unknown`.
136
+ * Identity snapshot mirroring the `quill:` section of `Quill.yaml`.
137
+ * Schemas live on `Quill.schema` / `Quill.formSchema`; the example on
138
+ * `Quill.example`. Extra `quill:` keys appear as `unknown`.
144
139
  */
145
140
  export interface QuillMetadata {
146
- schema: QuillSchema;
147
- backend: string;
141
+ name: string;
148
142
  version: string;
143
+ backend: string;
149
144
  author: string;
150
145
  description: string;
151
146
  supportedFormats: OutputFormat[];
@@ -233,7 +228,7 @@ export interface RenderResult {
233
228
  renderTimeMs: number;
234
229
  }
235
230
 
236
- export type FrontmatterItem = { kind: "field"; key: string; value: unknown; fill?: boolean } | { kind: "comment"; text: string };
231
+ export type FrontmatterItem = { kind: "field"; key: string; value: unknown; fill?: boolean } | { kind: "comment"; text: string; inline?: boolean };
237
232
 
238
233
  export type OutputFormat = "pdf" | "svg" | "txt" | "png";
239
234
 
@@ -508,23 +503,20 @@ export class Quill {
508
503
  */
509
504
  readonly backendId: string;
510
505
  /**
511
- * Read-only snapshot of the loaded quill's engine info and declared schema.
512
- *
513
- * Returns a plain JS object with:
514
- * - `schema` — the quill's public schema contract, identical to
515
- * `QuillConfig::public_schema()`. Top-level keys: `name`, `main`,
516
- * optional `card_types` (map keyed by card name, omitted when empty),
517
- * optional `example`. `main` and each card under `card_types` share
518
- * the same shape: `fields` (map keyed by field name), optional
519
- * `title`, `description`, `ui`.
520
- * - `backend`, `version`, `author`, `description` — quill identity
521
- * declared in `Quill.yaml`'s `quill:` section. `description` describes
522
- * the quill itself; if the author also declared `main.description` (the
523
- * schema description of the entry-point card), it lives at
524
- * `schema.main.description` and is independent.
525
- * - `supportedFormats` — output formats the backend produces, as
526
- * lowercase strings.
527
- * - Any additional unstructured keys declared under `quill:`.
506
+ * Auto-generated annotated Markdown blueprint for LLM consumers.
507
+ */
508
+ readonly blueprint: string;
509
+ /**
510
+ * Bundled example document, or `undefined` if none was declared.
511
+ */
512
+ readonly example: string | undefined;
513
+ /**
514
+ * Document schema with `ui` hints — for form builders.
515
+ */
516
+ readonly formSchema: QuillSchema;
517
+ /**
518
+ * Identity snapshot of the `quill:` section of `Quill.yaml`, plus
519
+ * `supportedFormats` and any custom `quill:` keys.
528
520
  *
529
521
  * Consumers that need validation run their own validator against
530
522
  * `metadata.schema`.
@@ -533,6 +525,10 @@ export class Quill {
533
525
  * immutable once constructed.
534
526
  */
535
527
  readonly metadata: QuillMetadata;
528
+ /**
529
+ * Document schema with `ui` hints stripped — for LLM/MCP consumers.
530
+ */
531
+ readonly schema: QuillSchema;
536
532
  /**
537
533
  * Whether this quill's backend supports canvas preview.
538
534
  *
@@ -575,6 +575,46 @@ export class Quill {
575
575
  wasm.__wbindgen_add_to_stack_pointer(16);
576
576
  }
577
577
  }
578
+ /**
579
+ * Auto-generated annotated Markdown blueprint for LLM consumers.
580
+ * @returns {string}
581
+ */
582
+ get blueprint() {
583
+ let deferred1_0;
584
+ let deferred1_1;
585
+ try {
586
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
587
+ wasm.quill_blueprint(retptr, this.__wbg_ptr);
588
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
589
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
590
+ deferred1_0 = r0;
591
+ deferred1_1 = r1;
592
+ return getStringFromWasm0(r0, r1);
593
+ } finally {
594
+ wasm.__wbindgen_add_to_stack_pointer(16);
595
+ wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
596
+ }
597
+ }
598
+ /**
599
+ * Bundled example document, or `undefined` if none was declared.
600
+ * @returns {string | undefined}
601
+ */
602
+ get example() {
603
+ try {
604
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
605
+ wasm.quill_example(retptr, this.__wbg_ptr);
606
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
607
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
608
+ let v1;
609
+ if (r0 !== 0) {
610
+ v1 = getStringFromWasm0(r0, r1).slice();
611
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
612
+ }
613
+ return v1;
614
+ } finally {
615
+ wasm.__wbindgen_add_to_stack_pointer(16);
616
+ }
617
+ }
578
618
  /**
579
619
  * The schema-aware form view of `doc`.
580
620
  *
@@ -613,23 +653,16 @@ export class Quill {
613
653
  }
614
654
  }
615
655
  /**
616
- * Read-only snapshot of the loaded quill's engine info and declared schema.
617
- *
618
- * Returns a plain JS object with:
619
- * - `schema` — the quill's public schema contract, identical to
620
- * `QuillConfig::public_schema()`. Top-level keys: `name`, `main`,
621
- * optional `card_types` (map keyed by card name, omitted when empty),
622
- * optional `example`. `main` and each card under `card_types` share
623
- * the same shape: `fields` (map keyed by field name), optional
624
- * `title`, `description`, `ui`.
625
- * - `backend`, `version`, `author`, `description` quill identity
626
- * declared in `Quill.yaml`'s `quill:` section. `description` describes
627
- * the quill itself; if the author also declared `main.description` (the
628
- * schema description of the entry-point card), it lives at
629
- * `schema.main.description` and is independent.
630
- * - `supportedFormats` — output formats the backend produces, as
631
- * lowercase strings.
632
- * - Any additional unstructured keys declared under `quill:`.
656
+ * Document schema with `ui` hints for form builders.
657
+ * @returns {QuillSchema}
658
+ */
659
+ get formSchema() {
660
+ const ret = wasm.quill_formSchema(this.__wbg_ptr);
661
+ return takeObject(ret);
662
+ }
663
+ /**
664
+ * Identity snapshot of the `quill:` section of `Quill.yaml`, plus
665
+ * `supportedFormats` and any custom `quill:` keys.
633
666
  *
634
667
  * Consumers that need validation run their own validator against
635
668
  * `metadata.schema`.
@@ -685,6 +718,14 @@ export class Quill {
685
718
  wasm.__wbindgen_add_to_stack_pointer(16);
686
719
  }
687
720
  }
721
+ /**
722
+ * Document schema with `ui` hints stripped — for LLM/MCP consumers.
723
+ * @returns {QuillSchema}
724
+ */
725
+ get schema() {
726
+ const ret = wasm.quill_schema(this.__wbg_ptr);
727
+ return takeObject(ret);
728
+ }
688
729
  /**
689
730
  * Whether this quill's backend supports canvas preview.
690
731
  *
Binary file
@@ -31,10 +31,14 @@ export const init: () => void;
31
31
  export const quill_backendId: (a: number, b: number) => void;
32
32
  export const quill_blankCard: (a: number, b: number, c: number, d: number) => void;
33
33
  export const quill_blankMain: (a: number, b: number) => void;
34
+ export const quill_blueprint: (a: number, b: number) => void;
35
+ export const quill_example: (a: number, b: number) => void;
34
36
  export const quill_form: (a: number, b: number, c: number) => void;
37
+ export const quill_formSchema: (a: number) => number;
35
38
  export const quill_metadata: (a: number) => number;
36
39
  export const quill_open: (a: number, b: number, c: number) => void;
37
40
  export const quill_render: (a: number, b: number, c: number, d: number) => void;
41
+ export const quill_schema: (a: number) => number;
38
42
  export const quill_supportsCanvas: (a: number) => number;
39
43
  export const quillmark_new: () => number;
40
44
  export const quillmark_quill: (a: number, b: number, c: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillmark/wasm",
3
- "version": "0.69.1",
3
+ "version": "0.71.0",
4
4
  "description": "WebAssembly bindings for quillmark",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",