@quillmark/wasm 0.69.1 → 0.70.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
@@ -122,30 +122,27 @@ export interface QuillCardSchema {
122
122
  }
123
123
 
124
124
  /**
125
- * Public schema contract returned as `QuillMetadata.schema`.
125
+ * Document schema. Returned by both `Quill.schema` (no ui hints) and
126
+ * `Quill.formSchema` (with ui hints) — same shape, optional `ui` keys.
126
127
  *
127
- * Identical to `QuillConfig::public_schema()` on the Rust side.
128
+ * `main.fields.QUILL` and `card_types[name].fields.CARD` are required
129
+ * sentinels with `const` values telling consumers what to write.
128
130
  */
129
131
  export interface QuillSchema {
130
- name: string;
131
132
  main: QuillCardSchema;
132
133
  /** Present only when the quill declares at least one named card type. */
133
134
  card_types?: Record<string, QuillCardSchema>;
134
- /** The quill's bundled example document, if declared. */
135
- example?: string;
136
135
  }
137
136
 
138
137
  /**
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`.
138
+ * Identity snapshot mirroring the `quill:` section of `Quill.yaml`.
139
+ * Schemas live on `Quill.schema` / `Quill.formSchema`; the example on
140
+ * `Quill.example`. Extra `quill:` keys appear as `unknown`.
144
141
  */
145
142
  export interface QuillMetadata {
146
- schema: QuillSchema;
147
- backend: string;
143
+ name: string;
148
144
  version: string;
145
+ backend: string;
149
146
  author: string;
150
147
  description: string;
151
148
  supportedFormats: OutputFormat[];
@@ -508,23 +505,16 @@ export class Quill {
508
505
  */
509
506
  readonly backendId: string;
510
507
  /**
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:`.
508
+ * Bundled example document, or `undefined` if none was declared.
509
+ */
510
+ readonly example: string | undefined;
511
+ /**
512
+ * Document schema with `ui` hints — for form builders.
513
+ */
514
+ readonly formSchema: QuillSchema;
515
+ /**
516
+ * Identity snapshot of the `quill:` section of `Quill.yaml`, plus
517
+ * `supportedFormats` and any custom `quill:` keys.
528
518
  *
529
519
  * Consumers that need validation run their own validator against
530
520
  * `metadata.schema`.
@@ -533,6 +523,10 @@ export class Quill {
533
523
  * immutable once constructed.
534
524
  */
535
525
  readonly metadata: QuillMetadata;
526
+ /**
527
+ * Document schema with `ui` hints stripped — for LLM/MCP consumers.
528
+ */
529
+ readonly schema: QuillSchema;
536
530
  /**
537
531
  * Whether this quill's backend supports canvas preview.
538
532
  *
@@ -575,6 +575,26 @@ export class Quill {
575
575
  wasm.__wbindgen_add_to_stack_pointer(16);
576
576
  }
577
577
  }
578
+ /**
579
+ * Bundled example document, or `undefined` if none was declared.
580
+ * @returns {string | undefined}
581
+ */
582
+ get example() {
583
+ try {
584
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
585
+ wasm.quill_example(retptr, this.__wbg_ptr);
586
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
587
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
588
+ let v1;
589
+ if (r0 !== 0) {
590
+ v1 = getStringFromWasm0(r0, r1).slice();
591
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
592
+ }
593
+ return v1;
594
+ } finally {
595
+ wasm.__wbindgen_add_to_stack_pointer(16);
596
+ }
597
+ }
578
598
  /**
579
599
  * The schema-aware form view of `doc`.
580
600
  *
@@ -613,23 +633,16 @@ export class Quill {
613
633
  }
614
634
  }
615
635
  /**
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:`.
636
+ * Document schema with `ui` hints for form builders.
637
+ * @returns {QuillSchema}
638
+ */
639
+ get formSchema() {
640
+ const ret = wasm.quill_formSchema(this.__wbg_ptr);
641
+ return takeObject(ret);
642
+ }
643
+ /**
644
+ * Identity snapshot of the `quill:` section of `Quill.yaml`, plus
645
+ * `supportedFormats` and any custom `quill:` keys.
633
646
  *
634
647
  * Consumers that need validation run their own validator against
635
648
  * `metadata.schema`.
@@ -685,6 +698,14 @@ export class Quill {
685
698
  wasm.__wbindgen_add_to_stack_pointer(16);
686
699
  }
687
700
  }
701
+ /**
702
+ * Document schema with `ui` hints stripped — for LLM/MCP consumers.
703
+ * @returns {QuillSchema}
704
+ */
705
+ get schema() {
706
+ const ret = wasm.quill_schema(this.__wbg_ptr);
707
+ return takeObject(ret);
708
+ }
688
709
  /**
689
710
  * Whether this quill's backend supports canvas preview.
690
711
  *
Binary file
@@ -31,10 +31,13 @@ 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_example: (a: number, b: number) => void;
34
35
  export const quill_form: (a: number, b: number, c: number) => void;
36
+ export const quill_formSchema: (a: number) => number;
35
37
  export const quill_metadata: (a: number) => number;
36
38
  export const quill_open: (a: number, b: number, c: number) => void;
37
39
  export const quill_render: (a: number, b: number, c: number, d: number) => void;
40
+ export const quill_schema: (a: number) => number;
38
41
  export const quill_supportsCanvas: (a: number) => number;
39
42
  export const quillmark_new: () => number;
40
43
  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.70.0",
4
4
  "description": "WebAssembly bindings for quillmark",
5
5
  "type": "module",
6
6
  "license": "MIT OR Apache-2.0",