@veracity/ai 0.0.15 → 0.0.17

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,4 +1,5 @@
1
+ import { Extension } from "mdast-util-from-markdown";
1
2
  import { PyodideInterface } from "pyodide";
2
- export declare function setElementMarkdown(element: HTMLElement, markdown: string, pyodide: PyodideInterface): void;
3
+ export declare function setElementMarkdown(element: HTMLElement, markdown: string, pyodide: PyodideInterface, mdastExtensions: Extension[]): void;
3
4
  export declare function renderMathAsync(element: HTMLElement, latexCode: string): Promise<void>;
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Markdown/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,QAUnG;AAyXD,wBAAsB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAS5E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Markdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,0BAA0B,CAAC;AAUnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,EACzB,eAAe,EAAE,SAAS,EAAE,QAW7B;AAyXD,wBAAsB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAS5E"}
@@ -1,4 +1,5 @@
1
1
  import { ChatMessageItem } from "../../ChatMessageItem";
2
+ import { Extension } from "mdast-util-from-markdown";
2
3
  export interface AIChatOptions {
3
4
  userId: string;
4
5
  givenName: string;
@@ -26,6 +27,7 @@ export declare class AIChat {
26
27
  readonly frontEndFunctions: {
27
28
  [functionName: string]: (...args: any[]) => any;
28
29
  };
30
+ readonly mdastExtensions: Extension[];
29
31
  pyodide: any;
30
32
  private _initializePyodidePromise;
31
33
  initializePyodideAsync(): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIChat/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOxD,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;CAC7B;AAED,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAM;;CAI3C;AAED,qBAAa,MAAM;IACjB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IACpC,QAAQ,CAAC,QAAQ,aAAoB;IACrC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE;QAAE,CAA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,OAAO,CAAC,oBAAoB,CAAiB;IAE7C,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,qBAAqB,CAAsB;gBAGjC,IAAI,EAAE,MAAM,EAC5B,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,MAAM,EACI,IAAI,EAAE,0BAA0B;IAelD,KAAK,IAAI,cAAc;IAOvB,0BAA0B,CAAC,QAAQ,EAAE,MAAM;IAY3C,wBAAwB;IAQxB,KAAK;IAKL,IAAI;CAGL;AAED,oBAAY,0BAA0B;IACpC,KAAK,IAAA;IACL,MAAM,IAAA;CACP;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,kBASjH"}
@@ -3515,12 +3515,12 @@ function Rs(e) {
3515
3515
  i % 2 === 0 && (n[i] = n[i].replace(r, (a, o) => `$${o}$`).replace(s, (a, o) => `$$${o}$$`));
3516
3516
  return n.join("");
3517
3517
  }
3518
- function qe(e, t, n) {
3519
- const r = ds(Rs(t), {
3518
+ function qe(e, t, n, r) {
3519
+ const s = ds(Rs(t), {
3520
3520
  extensions: [bs(), Ds()],
3521
- mdastExtensions: [ks(), Ns()]
3522
- }), s = {}, i = {};
3523
- xn(r, s, i), ct(r, e, s, i, n);
3521
+ mdastExtensions: [ks(), Ns(), ...r]
3522
+ }), i = {}, a = {};
3523
+ xn(s, i, a), ct(s, e, i, a, n);
3524
3524
  }
3525
3525
  function xn(e, t, n) {
3526
3526
  for (const r of e.children) {
@@ -3987,7 +3987,7 @@ class yn {
3987
3987
  };
3988
3988
  }
3989
3989
  appendAgentMarkdownMessage(t) {
3990
- this._currentMarkdownNode || (this.reset(), this.contentNode.appendChild(this._currentMarkdownNode = /* @__PURE__ */ S("div", { class: "mt-1.5 prose prose-neutral max-w-none" })), this.size === 0 && this._currentMarkdownNode.classList.add("prose-sm")), this._currentMarkdown ? this._currentMarkdown += t : this._currentMarkdown = t, this._latestMarkdown = this._currentMarkdown, qe(this._currentMarkdownNode, this._currentMarkdown, this.chat.pyodide);
3990
+ this._currentMarkdownNode || (this.reset(), this.contentNode.appendChild(this._currentMarkdownNode = /* @__PURE__ */ S("div", { class: "mt-1.5 prose prose-neutral max-w-none" })), this.size === 0 && this._currentMarkdownNode.classList.add("prose-sm")), this._currentMarkdown ? this._currentMarkdown += t : this._currentMarkdown = t, this._latestMarkdown = this._currentMarkdown, qe(this._currentMarkdownNode, this._currentMarkdown, this.chat.pyodide, this.chat.mdastExtensions);
3991
3991
  }
3992
3992
  getOrAppendToolCallGroup() {
3993
3993
  return this._currentToolCallGroup || (this.reset(), this.contentNode.appendChild((this._currentToolCallGroup = new Gs(this.chat)).node)), this._currentToolCallGroup;
@@ -4077,7 +4077,7 @@ class ia {
4077
4077
  C(this, "_iconNode");
4078
4078
  C(this, "_markdown");
4079
4079
  C(this, "_markdownNode");
4080
- this._icon = t, this._markdown = n, this.node = /* @__PURE__ */ S(ft, null, this._iconNode = tn(t), this._markdownNode = /* @__PURE__ */ S("span", null)), qe(this._markdownNode, this._markdown, null);
4080
+ this._icon = t, this._markdown = n, this.node = /* @__PURE__ */ S(ft, null, this._iconNode = tn(t), this._markdownNode = /* @__PURE__ */ S("span", null)), qe(this._markdownNode, this._markdown, null, []);
4081
4081
  }
4082
4082
  get icon() {
4083
4083
  return this._icon;
@@ -4089,7 +4089,7 @@ class ia {
4089
4089
  return this._markdown;
4090
4090
  }
4091
4091
  set markdown(t) {
4092
- t !== this._markdown && (qe(this._markdownNode, this._markdown = t, null), this._markdown = t);
4092
+ t !== this._markdown && (qe(this._markdownNode, this._markdown = t, null, []), this._markdown = t);
4093
4093
  }
4094
4094
  status(t, n, r) {
4095
4095
  this.icon = n, this.markdown = r;
@@ -4424,7 +4424,7 @@ class be {
4424
4424
  i.status(n, r, s);
4425
4425
  }
4426
4426
  setTitle(t) {
4427
- qe(this._titleTextNode, t, null);
4427
+ qe(this._titleTextNode, t, null, []);
4428
4428
  }
4429
4429
  done() {
4430
4430
  if (this.node.getAttribute("data-status") === "error")
@@ -4962,7 +4962,7 @@ function ga(e, t, n) {
4962
4962
  },
4963
4963
  "No, cancel"
4964
4964
  )));
4965
- return qe(i, t, null), a;
4965
+ return qe(i, t, null, []), a;
4966
4966
  }
4967
4967
  });
4968
4968
  }
@@ -5792,6 +5792,7 @@ class Va {
5792
5792
  C(this, "chatBase", new Wa());
5793
5793
  C(this, "statusNode");
5794
5794
  C(this, "frontEndFunctions", {});
5795
+ C(this, "mdastExtensions", []);
5795
5796
  C(this, "pyodide");
5796
5797
  C(this, "_initializePyodidePromise");
5797
5798
  //private _canSubmit = true;