@wukazis/euphony 0.1.45

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.
Files changed (103) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +13 -0
  3. package/README.md +266 -0
  4. package/bin/euphony.js +4 -0
  5. package/dist/apple-touch-icon.png +0 -0
  6. package/dist/assets/harmony-render-5ErAOXX9.js +3285 -0
  7. package/dist/assets/local-data-worker-CHLGzNeW.js +2 -0
  8. package/dist/assets/main-CmldcHcT.js +4047 -0
  9. package/dist/examples/euphony-convo-100.jsonl +8 -0
  10. package/dist/examples/simple-harmony-convos.jsonl +8 -0
  11. package/dist/favicon-48x48.png +0 -0
  12. package/dist/favicon.ico +0 -0
  13. package/dist/favicon.svg +3 -0
  14. package/dist/global.css +38 -0
  15. package/dist/index.html +22 -0
  16. package/dist/web-app-manifest-192x192.png +0 -0
  17. package/dist/web-app-manifest-512x512.png +0 -0
  18. package/lib/chunks/conversation.js +612 -0
  19. package/lib/chunks/css/codex.js +1 -0
  20. package/lib/chunks/css/confirm-dialog.js +1 -0
  21. package/lib/chunks/css/conversation.js +1 -0
  22. package/lib/chunks/css/floating-toolbar.js +1 -0
  23. package/lib/chunks/css/input-dialog.js +1 -0
  24. package/lib/chunks/css/json-viewer.js +1 -0
  25. package/lib/chunks/css/menu.js +1 -0
  26. package/lib/chunks/css/message-code.js +1 -0
  27. package/lib/chunks/css/message-developer-content.js +1 -0
  28. package/lib/chunks/css/message-editor-popover.js +1 -0
  29. package/lib/chunks/css/message-hidden.js +1 -0
  30. package/lib/chunks/css/message-system-content.js +1 -0
  31. package/lib/chunks/css/message-text.js +1 -0
  32. package/lib/chunks/css/message-unsupported.js +1 -0
  33. package/lib/chunks/css/pagination.js +1 -0
  34. package/lib/chunks/css/preference-window.js +1 -0
  35. package/lib/chunks/css/search-window.js +1 -0
  36. package/lib/chunks/css/toast.js +1 -0
  37. package/lib/chunks/css/token-window.js +1 -0
  38. package/lib/chunks/css-inline.js +1 -0
  39. package/lib/chunks/dompurify.js +1 -0
  40. package/lib/chunks/harmony-types.js +1 -0
  41. package/lib/chunks/icon-cross.js +1 -0
  42. package/lib/chunks/icon-play.js +1 -0
  43. package/lib/chunks/marked.js +1 -0
  44. package/lib/chunks/prismjs.js +1 -0
  45. package/lib/chunks/shoelace.js +1131 -0
  46. package/lib/chunks/third-party.js +1 -0
  47. package/lib/chunks/utils.js +16 -0
  48. package/lib/components/app/app.d.ts +192 -0
  49. package/lib/components/app/local-data-worker.d.ts +35 -0
  50. package/lib/components/app/request-worker.d.ts +45 -0
  51. package/lib/components/app/url-manager.d.ts +25 -0
  52. package/lib/components/codex/codex.d.ts +50 -0
  53. package/lib/components/codex/codex.js +36 -0
  54. package/lib/components/confirm-dialog/confirm-dialog.d.ts +42 -0
  55. package/lib/components/confirm-dialog/confirm-dialog.js +41 -0
  56. package/lib/components/conversation/conversation.d.ts +259 -0
  57. package/lib/components/conversation/conversation.js +1 -0
  58. package/lib/components/floating-toolbar/floating-toolbar.d.ts +47 -0
  59. package/lib/components/floating-toolbar/floating-toolbar.js +32 -0
  60. package/lib/components/input-dialog/input-dialog.d.ts +43 -0
  61. package/lib/components/input-dialog/input-dialog.js +51 -0
  62. package/lib/components/json-viewer/json-viewer.d.ts +33 -0
  63. package/lib/components/json-viewer/json-viewer.js +8 -0
  64. package/lib/components/menu/menu.d.ts +38 -0
  65. package/lib/components/menu/menu.js +9 -0
  66. package/lib/components/message-code/message-code.d.ts +20 -0
  67. package/lib/components/message-code/message-code.js +10 -0
  68. package/lib/components/message-developer-content/message-developer-content.d.ts +45 -0
  69. package/lib/components/message-developer-content/message-developer-content.js +72 -0
  70. package/lib/components/message-editor-popover/message-editor-popover.d.ts +36 -0
  71. package/lib/components/message-editor-popover/message-editor-popover.js +85 -0
  72. package/lib/components/message-hidden/message-hidden.d.ts +38 -0
  73. package/lib/components/message-hidden/message-hidden.js +10 -0
  74. package/lib/components/message-system-content/message-system-content.d.ts +52 -0
  75. package/lib/components/message-system-content/message-system-content.js +74 -0
  76. package/lib/components/message-text/message-text.d.ts +36 -0
  77. package/lib/components/message-text/message-text.js +14 -0
  78. package/lib/components/message-unsupported/message-unsupported.d.ts +19 -0
  79. package/lib/components/message-unsupported/message-unsupported.js +26 -0
  80. package/lib/components/pagination/pagination.d.ts +29 -0
  81. package/lib/components/pagination/pagination.js +35 -0
  82. package/lib/components/preference-window/preference-window.d.ts +107 -0
  83. package/lib/components/preference-window/preference-window.js +319 -0
  84. package/lib/components/search-window/search-window.d.ts +44 -0
  85. package/lib/components/search-window/search-window.js +71 -0
  86. package/lib/components/toast/toast.d.ts +34 -0
  87. package/lib/components/toast/toast.js +77 -0
  88. package/lib/components/token-window/token-window.d.ts +96 -0
  89. package/lib/components/token-window/token-window.js +1 -0
  90. package/lib/config/config.d.ts +273 -0
  91. package/lib/euphony.d.ts +11 -0
  92. package/lib/euphony.js +1 -0
  93. package/lib/types/common-types.d.ts +176 -0
  94. package/lib/types/harmony-types.d.ts +72 -0
  95. package/lib/utils/api-manager.d.ts +42 -0
  96. package/lib/utils/codex-session.d.ts +7 -0
  97. package/lib/utils/dompurify-configs.d.ts +2 -0
  98. package/lib/utils/harmony-render.d.ts +4 -0
  99. package/lib/utils/marked-katex-extension.d.ts +22 -0
  100. package/lib/utils/patch-preview.d.ts +2 -0
  101. package/lib/utils/utils.d.ts +80 -0
  102. package/package.json +84 -0
  103. package/server-dist/node-main.js +1273 -0
@@ -0,0 +1,77 @@
1
+ import{b as e,v as t,i,n as s,r as o,a as r,w as n}from"../../chunks/third-party.js";import{c as l}from"../../chunks/css/toast.js";var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,a=(e,t,i,s)=>{for(var o,r=s>1?void 0:s?h(t,i):t,n=e.length-1;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&d(t,i,r),r};const c=e`<svg
2
+ width="100%"
3
+ height="100%"
4
+ viewBox="0 0 80 80"
5
+ version="1.1"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ xmlns:xlink="http://www.w3.org/1999/xlink"
8
+ xml:space="preserve"
9
+ xmlns:serif="http://www.serif.com/"
10
+ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
11
+ >
12
+ <g id="icon-cross-circle-solid">
13
+ <path
14
+ d="M39.904,79.15C18.42,79.15 0.5,61.279 0.5,39.746C0.5,18.213 18.371,0.342 39.855,0.342C61.389,0.342 79.357,18.213 79.357,39.746C79.357,61.279 61.437,79.15 39.904,79.15ZM27.062,56.25C28.088,56.25 29.016,55.908 29.65,55.225L39.904,44.873L50.207,55.225C50.842,55.908 51.77,56.25 52.746,56.25C54.797,56.25 56.408,54.639 56.408,52.588C56.408,51.611 56.066,50.732 55.334,50.049L45.031,39.795L55.383,29.443C56.164,28.711 56.457,27.881 56.457,26.904C56.457,24.902 54.846,23.34 52.844,23.34C51.916,23.34 51.135,23.682 50.402,24.365L39.904,34.766L29.553,24.414C28.869,23.779 28.088,23.438 27.062,23.438C25.109,23.438 23.498,24.951 23.498,27.002C23.498,27.93 23.889,28.809 24.523,29.492L34.826,39.795L24.523,50.098C23.889,50.781 23.498,51.66 23.498,52.588C23.498,54.639 25.109,56.25 27.062,56.25Z"
15
+ />
16
+ </g>
17
+ </svg> `,p=e`<svg
18
+ width="100%"
19
+ height="100%"
20
+ viewBox="0 0 80 80"
21
+ version="1.1"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ xmlns:xlink="http://www.w3.org/1999/xlink"
24
+ xml:space="preserve"
25
+ xmlns:serif="http://www.serif.com/"
26
+ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
27
+ >
28
+ <g id="icon-check-circle-solid">
29
+ <path
30
+ d="M39.618,79.15C18.134,79.15 0.214,61.279 0.214,39.746C0.214,18.213 18.085,0.342 39.569,0.342C61.102,0.342 79.071,18.213 79.071,39.746C79.071,61.279 61.151,79.15 39.618,79.15ZM35.321,58.545C36.786,58.545 38.056,57.861 38.983,56.396L56.366,28.857C56.952,27.978 57.489,26.953 57.489,25.977C57.489,23.877 55.731,22.607 53.778,22.607C52.606,22.607 51.483,23.291 50.702,24.658L35.126,49.854L28.095,40.478C27.02,39.014 26.044,38.623 24.823,38.623C22.772,38.623 21.308,40.234 21.308,42.236C21.308,43.213 21.649,44.189 22.333,45.019L31.415,56.396C32.587,57.959 33.808,58.545 35.321,58.545Z"
31
+ />
32
+ </g>
33
+ </svg> `,w=e`<svg
34
+ width="100%"
35
+ height="100%"
36
+ viewBox="0 0 80 80"
37
+ version="1.1"
38
+ xmlns="http://www.w3.org/2000/svg"
39
+ xmlns:xlink="http://www.w3.org/1999/xlink"
40
+ xml:space="preserve"
41
+ xmlns:serif="http://www.serif.com/"
42
+ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
43
+ >
44
+ <g id="icon-warning-circle-solid">
45
+ <path
46
+ d="M40.391,79.15C18.907,79.15 0.987,61.279 0.987,39.746C0.987,18.213 18.858,0.342 40.343,0.342C61.876,0.342 79.845,18.213 79.845,39.746C79.845,61.279 61.925,79.15 40.391,79.15ZM40.391,46.973C42.589,46.973 43.809,45.752 43.858,43.457L44.444,22.705C44.493,20.41 42.735,18.701 40.343,18.701C37.95,18.701 36.241,20.361 36.29,22.656L36.876,43.457C36.925,45.703 38.145,46.973 40.391,46.973ZM40.391,60.205C42.882,60.205 45.079,58.301 45.079,55.762C45.079,53.223 42.931,51.269 40.391,51.269C37.901,51.269 35.753,53.271 35.753,55.762C35.753,58.252 37.95,60.205 40.391,60.205Z"
47
+ />
48
+ </g>
49
+ </svg>`,C=e`<svg
50
+ width="100%"
51
+ height="100%"
52
+ viewBox="0 0 62 62"
53
+ version="1.1"
54
+ xml:space="preserve"
55
+ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
56
+ >
57
+ <g id="icon-cross">
58
+ <path
59
+ d="M1.299,60.421C2.861,61.935 5.4,61.935 6.914,60.421L30.84,36.447L54.814,60.421C56.279,61.935 58.867,61.935 60.381,60.421C61.894,58.859 61.894,56.32 60.381,54.855L36.406,30.88L60.381,6.955C61.894,5.441 61.943,2.853 60.381,1.339C58.818,-0.125 56.279,-0.125 54.814,1.339L30.84,25.314L6.914,1.339C5.4,-0.125 2.812,-0.174 1.299,1.339C-0.166,2.902 -0.166,5.441 1.299,6.955L25.273,30.88L1.299,54.855C-0.166,56.32 -0.215,58.908 1.299,60.421Z"
60
+ style="fill-rule:nonzero;"
61
+ />
62
+ </g>
63
+ </svg> `;let v=class extends r{constructor(){super(),this.type="error",this.message="Title cannot be empty",this.duration=6e3,this.isHidden=!0,this.timer=null}willUpdate(e){}async initData(){}show(){this.isHidden&&(this.isHidden=!1),this.duration>0&&(null!==this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.hide()},this.duration))}hide(){if(this.isHidden)return;if(null===this.shadowRoot)throw Error("Shadow root is null");const e=this.shadowRoot.querySelector(".toast");if(!e)throw Error("Toast element not found");e.animate({opacity:[1,0]},{duration:200,easing:"ease-in-out"}).onfinish=()=>{this.isHidden=!0}}render(){let t=p;return"warning"===this.type?t=w:"error"===this.type&&(t=c),e`
64
+ <div class="toast" toast-type=${this.type} ?is-hidden=${this.isHidden}>
65
+ <div class="svg-icon">${t}</div>
66
+ <!-- prettier-ignore -->
67
+ <div class="message">${this.message}<slot name="message-content"></slot></div>
68
+ <div
69
+ class="svg-icon cross-icon"
70
+ @click=${()=>{this.hide();const e=new CustomEvent("close-button-clicked",{bubbles:!0,composed:!0});this.dispatchEvent(e)}}
71
+ >
72
+ ${C}
73
+ </div>
74
+ </div>
75
+ `}};v.styles=[i`
76
+ ${t(l)}
77
+ `],a([s({type:String})],v.prototype,"type",2),a([s({type:String})],v.prototype,"message",2),a([s({type:Number})],v.prototype,"duration",2),a([o()],v.prototype,"isHidden",2),v=a([n("nightjar-toast")],v);export{v as NightjarToast};
@@ -0,0 +1,96 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ import { HarmonyRenderResponse } from '../../types/common-types';
3
+ /**
4
+ * Confirm window element.
5
+ *
6
+ */
7
+ export declare class EuphonyTokenWindow extends LitElement {
8
+ conversationString: string | null;
9
+ selectedRenderer: string;
10
+ availableRenderers: string[];
11
+ windowElement: HTMLElement | undefined;
12
+ tabButtons: NodeListOf<HTMLButtonElement>;
13
+ showMessage: boolean;
14
+ message: string | null;
15
+ messageType: 'error' | 'success';
16
+ isOpen: boolean;
17
+ isTokenizing: boolean;
18
+ selectedTab: 'conversation' | 'token' | 'token_id' | 'display_string';
19
+ tokens: number[];
20
+ decodedTokens: string[];
21
+ displayString: string;
22
+ private tabSliderLeft;
23
+ private tabSliderWidth;
24
+ tabOptions: {
25
+ key: EuphonyTokenWindow['selectedTab'];
26
+ label: string;
27
+ }[];
28
+ popperTooltip: HTMLElement | undefined;
29
+ rendererTooltipDebouncer: number | null;
30
+ constructor();
31
+ firstUpdated(): void;
32
+ /**
33
+ * This method is called before new DOM is updated and rendered
34
+ * @param changedProperties Property that has been changed
35
+ */
36
+ willUpdate(changedProperties: PropertyValues<this>): void;
37
+ initData: () => Promise<void>;
38
+ show(conversationString: string): void;
39
+ close(): void;
40
+ tokenizationSucceeded(value: HarmonyRenderResponse): void;
41
+ tokenizationFailed(errorMessage: string): void;
42
+ performHarmonyRender(): void;
43
+ refreshRendererList(): void;
44
+ /**
45
+ * Updates the currently selected tab and drives the slider animation.
46
+ * Using a dedicated handler keeps template bindings lean and readable.
47
+ * @param tabKey - The tab identifier that should be selected.
48
+ */
49
+ tabSelected(tabKey: EuphonyTokenWindow['selectedTab']): void;
50
+ /**
51
+ * Returns the index of the selected tab for positional math.
52
+ * Defaulting to zero keeps the slider predictable even if the array changes.
53
+ */
54
+ getSelectedTabIndex(): number;
55
+ /**
56
+ * Measures the currently selected tab and updates CSS variables that control
57
+ * the sliding highlight width/offset. Runs in rAF to ensure layout has settled.
58
+ */
59
+ updateTabSliderPosition(): void;
60
+ /**
61
+ * Ensure the slider is re-measured whenever relevant state flips (e.g., opening the modal
62
+ * after it was hidden will otherwise report zero widths).
63
+ */
64
+ updated(changedProperties: PropertyValues<this>): void;
65
+ /**
66
+ * Handles clicks on the translucent backdrop to mirror typical modal behavior.
67
+ * Prevents closing while tokenization is in-flight to avoid interrupting active work.
68
+ * @param event - Mouse event emitted when the backdrop is clicked.
69
+ */
70
+ backdropClicked: (event: MouseEvent) => void;
71
+ cancelClicked(e: MouseEvent): void;
72
+ renderButtonClicked(e: MouseEvent): void;
73
+ /**
74
+ * This method is called when the user starts dragging the window
75
+ * @param event The mouse event
76
+ */
77
+ private onDragStart;
78
+ render(): import('lit').TemplateResult<1>;
79
+ /**
80
+ * Handles mouse entering the renderer info icon by showing a delayed tooltip.
81
+ * The delay prevents flickering when users quickly pass over the icon while moving the cursor.
82
+ * @param event - The mouse event fired from the info icon.
83
+ */
84
+ rendererInfoMouseEnter(event: MouseEvent): void;
85
+ /**
86
+ * Hides the renderer tooltip and clears any pending display timers.
87
+ * @param useTransition - Whether the hide action should respect CSS transitions.
88
+ */
89
+ rendererInfoMouseLeave(useTransition?: boolean): void;
90
+ static styles: import('lit').CSSResult[];
91
+ }
92
+ declare global {
93
+ interface HTMLElementTagNameMap {
94
+ 'euphony-token-window': EuphonyTokenWindow;
95
+ }
96
+ }
@@ -0,0 +1 @@
1
+ import"../../chunks/third-party.js";import{a as s}from"../../chunks/conversation.js";import"../../chunks/utils.js";import"../../chunks/css/token-window.js";export{s as EuphonyTokenWindow};
@@ -0,0 +1,273 @@
1
+ export declare const config: {
2
+ colors: {
3
+ 'red-50': string;
4
+ 'red-100': string;
5
+ 'red-200': string;
6
+ 'red-300': string;
7
+ 'red-400': string;
8
+ 'red-500': string;
9
+ 'red-600': string;
10
+ 'red-700': string;
11
+ 'red-800': string;
12
+ 'red-900': string;
13
+ 'red-a100': string;
14
+ 'red-a200': string;
15
+ 'red-a400': string;
16
+ 'red-a700': string;
17
+ 'pink-50': string;
18
+ 'pink-100': string;
19
+ 'pink-200': string;
20
+ 'pink-300': string;
21
+ 'pink-400': string;
22
+ 'pink-500': string;
23
+ 'pink-600': string;
24
+ 'pink-700': string;
25
+ 'pink-800': string;
26
+ 'pink-900': string;
27
+ 'pink-a100': string;
28
+ 'pink-a200': string;
29
+ 'pink-a400': string;
30
+ 'pink-a700': string;
31
+ 'purple-50': string;
32
+ 'purple-100': string;
33
+ 'purple-200': string;
34
+ 'purple-300': string;
35
+ 'purple-400': string;
36
+ 'purple-500': string;
37
+ 'purple-600': string;
38
+ 'purple-700': string;
39
+ 'purple-800': string;
40
+ 'purple-900': string;
41
+ 'purple-a100': string;
42
+ 'purple-a200': string;
43
+ 'purple-a400': string;
44
+ 'purple-a700': string;
45
+ 'deep-purple-50': string;
46
+ 'deep-purple-100': string;
47
+ 'deep-purple-200': string;
48
+ 'deep-purple-300': string;
49
+ 'deep-purple-400': string;
50
+ 'deep-purple-500': string;
51
+ 'deep-purple-600': string;
52
+ 'deep-purple-700': string;
53
+ 'deep-purple-800': string;
54
+ 'deep-purple-900': string;
55
+ 'deep-purple-a100': string;
56
+ 'deep-purple-a200': string;
57
+ 'deep-purple-a400': string;
58
+ 'deep-purple-a700': string;
59
+ 'indigo-50': string;
60
+ 'indigo-100': string;
61
+ 'indigo-200': string;
62
+ 'indigo-300': string;
63
+ 'indigo-400': string;
64
+ 'indigo-500': string;
65
+ 'indigo-600': string;
66
+ 'indigo-700': string;
67
+ 'indigo-800': string;
68
+ 'indigo-900': string;
69
+ 'indigo-a100': string;
70
+ 'indigo-a200': string;
71
+ 'indigo-a400': string;
72
+ 'indigo-a700': string;
73
+ 'blue-50': string;
74
+ 'blue-100': string;
75
+ 'blue-200': string;
76
+ 'blue-300': string;
77
+ 'blue-400': string;
78
+ 'blue-500': string;
79
+ 'blue-600': string;
80
+ 'blue-700': string;
81
+ 'blue-800': string;
82
+ 'blue-900': string;
83
+ 'blue-a100': string;
84
+ 'blue-a200': string;
85
+ 'blue-a400': string;
86
+ 'blue-a700': string;
87
+ 'light-blue-50': string;
88
+ 'light-blue-100': string;
89
+ 'light-blue-200': string;
90
+ 'light-blue-300': string;
91
+ 'light-blue-400': string;
92
+ 'light-blue-500': string;
93
+ 'light-blue-600': string;
94
+ 'light-blue-700': string;
95
+ 'light-blue-800': string;
96
+ 'light-blue-900': string;
97
+ 'light-blue-a100': string;
98
+ 'light-blue-a200': string;
99
+ 'light-blue-a400': string;
100
+ 'light-blue-a700': string;
101
+ 'cyan-50': string;
102
+ 'cyan-100': string;
103
+ 'cyan-200': string;
104
+ 'cyan-300': string;
105
+ 'cyan-400': string;
106
+ 'cyan-500': string;
107
+ 'cyan-600': string;
108
+ 'cyan-700': string;
109
+ 'cyan-800': string;
110
+ 'cyan-900': string;
111
+ 'cyan-a100': string;
112
+ 'cyan-a200': string;
113
+ 'cyan-a400': string;
114
+ 'cyan-a700': string;
115
+ 'teal-50': string;
116
+ 'teal-100': string;
117
+ 'teal-200': string;
118
+ 'teal-300': string;
119
+ 'teal-400': string;
120
+ 'teal-500': string;
121
+ 'teal-600': string;
122
+ 'teal-700': string;
123
+ 'teal-800': string;
124
+ 'teal-900': string;
125
+ 'teal-a100': string;
126
+ 'teal-a200': string;
127
+ 'teal-a400': string;
128
+ 'teal-a700': string;
129
+ 'green-50': string;
130
+ 'green-100': string;
131
+ 'green-200': string;
132
+ 'green-300': string;
133
+ 'green-400': string;
134
+ 'green-500': string;
135
+ 'green-600': string;
136
+ 'green-700': string;
137
+ 'green-800': string;
138
+ 'green-900': string;
139
+ 'green-a100': string;
140
+ 'green-a200': string;
141
+ 'green-a400': string;
142
+ 'green-a700': string;
143
+ 'light-green-50': string;
144
+ 'light-green-100': string;
145
+ 'light-green-200': string;
146
+ 'light-green-300': string;
147
+ 'light-green-400': string;
148
+ 'light-green-500': string;
149
+ 'light-green-600': string;
150
+ 'light-green-700': string;
151
+ 'light-green-800': string;
152
+ 'light-green-900': string;
153
+ 'light-green-a100': string;
154
+ 'light-green-a200': string;
155
+ 'light-green-a400': string;
156
+ 'light-green-a700': string;
157
+ 'lime-50': string;
158
+ 'lime-100': string;
159
+ 'lime-200': string;
160
+ 'lime-300': string;
161
+ 'lime-400': string;
162
+ 'lime-500': string;
163
+ 'lime-600': string;
164
+ 'lime-700': string;
165
+ 'lime-800': string;
166
+ 'lime-900': string;
167
+ 'lime-a100': string;
168
+ 'lime-a200': string;
169
+ 'lime-a400': string;
170
+ 'lime-a700': string;
171
+ 'yellow-50': string;
172
+ 'yellow-100': string;
173
+ 'yellow-200': string;
174
+ 'yellow-300': string;
175
+ 'yellow-400': string;
176
+ 'yellow-500': string;
177
+ 'yellow-600': string;
178
+ 'yellow-700': string;
179
+ 'yellow-800': string;
180
+ 'yellow-900': string;
181
+ 'yellow-a100': string;
182
+ 'yellow-a200': string;
183
+ 'yellow-a400': string;
184
+ 'yellow-a700': string;
185
+ 'amber-50': string;
186
+ 'amber-100': string;
187
+ 'amber-200': string;
188
+ 'amber-300': string;
189
+ 'amber-400': string;
190
+ 'amber-500': string;
191
+ 'amber-600': string;
192
+ 'amber-700': string;
193
+ 'amber-800': string;
194
+ 'amber-900': string;
195
+ 'amber-a100': string;
196
+ 'amber-a200': string;
197
+ 'amber-a400': string;
198
+ 'amber-a700': string;
199
+ 'orange-50': string;
200
+ 'orange-100': string;
201
+ 'orange-200': string;
202
+ 'orange-300': string;
203
+ 'orange-400': string;
204
+ 'orange-500': string;
205
+ 'orange-600': string;
206
+ 'orange-700': string;
207
+ 'orange-800': string;
208
+ 'orange-900': string;
209
+ 'orange-a100': string;
210
+ 'orange-a200': string;
211
+ 'orange-a400': string;
212
+ 'orange-a700': string;
213
+ 'deep-orange-50': string;
214
+ 'deep-orange-100': string;
215
+ 'deep-orange-200': string;
216
+ 'deep-orange-300': string;
217
+ 'deep-orange-400': string;
218
+ 'deep-orange-500': string;
219
+ 'deep-orange-600': string;
220
+ 'deep-orange-700': string;
221
+ 'deep-orange-800': string;
222
+ 'deep-orange-900': string;
223
+ 'deep-orange-a100': string;
224
+ 'deep-orange-a200': string;
225
+ 'deep-orange-a400': string;
226
+ 'deep-orange-a700': string;
227
+ 'brown-50': string;
228
+ 'brown-100': string;
229
+ 'brown-200': string;
230
+ 'brown-300': string;
231
+ 'brown-400': string;
232
+ 'brown-500': string;
233
+ 'brown-600': string;
234
+ 'brown-700': string;
235
+ 'brown-800': string;
236
+ 'brown-900': string;
237
+ 'gray-50': string;
238
+ 'gray-100': string;
239
+ 'gray-200': string;
240
+ 'gray-300': string;
241
+ 'gray-400': string;
242
+ 'gray-500': string;
243
+ 'gray-600': string;
244
+ 'gray-700': string;
245
+ 'gray-800': string;
246
+ 'gray-900': string;
247
+ 'blue-gray-50': string;
248
+ 'blue-gray-100': string;
249
+ 'blue-gray-200': string;
250
+ 'blue-gray-300': string;
251
+ 'blue-gray-400': string;
252
+ 'blue-gray-500': string;
253
+ 'blue-gray-600': string;
254
+ 'blue-gray-700': string;
255
+ 'blue-gray-800': string;
256
+ 'blue-gray-900': string;
257
+ 'blue-gray-1000': string;
258
+ };
259
+ layout: {
260
+ sidebarMenuXOffset: number;
261
+ };
262
+ time: {
263
+ mouseenterDelay: number;
264
+ blobFetchTimeout: number;
265
+ audioTransformTimeout: number;
266
+ };
267
+ customColors: {
268
+ addedColor: string;
269
+ replacedColor: string;
270
+ deletedColor: string;
271
+ };
272
+ debug: boolean;
273
+ };
@@ -0,0 +1,11 @@
1
+ export * from './components/codex/codex';
2
+ export * from './components/conversation/conversation';
3
+ export * from './components/message-code/message-code';
4
+ export * from './components/message-developer-content/message-developer-content';
5
+ export * from './components/message-system-content/message-system-content';
6
+ export * from './components/message-text/message-text';
7
+ export * from './components/message-unsupported/message-unsupported';
8
+ export * from './types/common-types';
9
+ export * from './types/harmony-types';
10
+ export * from './utils/codex-session';
11
+ export * from './utils/utils';
package/lib/euphony.js ADDED
@@ -0,0 +1 @@
1
+ import{EuphonyCodex as s,i as e,p as a}from"./components/codex/codex.js";import{E as o,p as t}from"./chunks/conversation.js";import{EuphonyMessageCode as n}from"./components/message-code/message-code.js";import{EuphonyMessageDeveloperContent as p}from"./components/message-developer-content/message-developer-content.js";import{EuphonyMessageSystemContent as r}from"./components/message-system-content/message-system-content.js";import{EuphonyMessageText as m}from"./components/message-text/message-text.js";import{EuphonyMessageUnsupported as g}from"./components/message-unsupported/message-unsupported.js";import{E as u,b as i,R as d,a as y,g as c,t as C}from"./chunks/harmony-types.js";import{E,f as h,h as l,i as M,j as x,a as S,c as T,g as f,e as j,d as v,s as k,b,u as O}from"./chunks/utils.js";export{u as EUPHONY_MESSAGE_CONTENT_TYPES,s as EuphonyCodex,o as EuphonyConversation,E as EuphonyLitElementWithBlockContents,n as EuphonyMessageCode,p as EuphonyMessageDeveloperContent,r as EuphonyMessageSystemContent,m as EuphonyMessageText,g as EuphonyMessageUnsupported,i as RealAuthor,d as Role,h as arrayToTable,l as blobToBase64,M as createBase64DataURL,x as digestMessage,y as getContentFromContentOrString,c as getContentTypeFromContent,S as getCustomLabelsFromMagicMetadata,T as getDeferredPromise,f as getMarkdownTemplate,e as isCodexSessionJSONL,a as parseCodexSession,t as parseConversationJSONString,j as sharedCollapseBlockContents,v as sharedExpandBlockContents,k as styleToString,C as tryGetContentTypeFromContent,b as updateFloatPosition,O as updatePopperOverlay};
@@ -0,0 +1,176 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { Conversation, DeveloperContentMessageContent, Message, TextMessageContent } from './harmony-types';
3
+ export interface MessageSharingRequest {
4
+ /**
5
+ * The message index in the conversation
6
+ */
7
+ messageIndex: number;
8
+ /**
9
+ * The resolve function to call when the message's sharing URL is fetched
10
+ * The value should be a sharable URL
11
+ */
12
+ resolve: (value: string) => void;
13
+ /**
14
+ * The reject function to call when the message's sharing URL is not fetched
15
+ */
16
+ reject: (reason?: string) => void;
17
+ }
18
+ export interface TranslationRequest {
19
+ /**
20
+ * The text to translate
21
+ */
22
+ text: string;
23
+ /**
24
+ * The resolve function to call when the translation is done
25
+ */
26
+ resolve: (value: TranslateResponse) => void;
27
+ /**
28
+ * The reject function to call when the translation is failed
29
+ */
30
+ reject: (reason?: string) => void;
31
+ }
32
+ interface BlockContentEditInfo {
33
+ location: string;
34
+ index: number | string;
35
+ }
36
+ export interface BlockContent {
37
+ label: string;
38
+ content: TemplateResult | string;
39
+ isContentHTML: boolean;
40
+ isCollapsed: boolean;
41
+ subBlocks?: BlockContent[];
42
+ editInfo?: BlockContentEditInfo;
43
+ editableHTML?: TemplateResult;
44
+ }
45
+ export interface CodexSessionSummary {
46
+ path: string;
47
+ load_url: string;
48
+ first_message: string;
49
+ timestamp: string | null;
50
+ age_seconds: number | null;
51
+ event_count: number;
52
+ }
53
+ export interface BlobJSONLPayload {
54
+ total: number;
55
+ data: string[] | Conversation[] | Record<string, unknown>[] | unknown[][] | CodexSessionSummary[];
56
+ isFiltered: boolean;
57
+ matchedCount: number;
58
+ resolvedURL: string;
59
+ }
60
+ export interface BlobJSONLResponse {
61
+ offset: number;
62
+ limit: number;
63
+ total: number;
64
+ data: string[] | Conversation[] | Record<string, Conversation | string>[] | unknown[][] | CodexSessionSummary[];
65
+ isFiltered: boolean;
66
+ matchedCount: number;
67
+ resolvedURL: string;
68
+ }
69
+ export interface TranslatableConversation extends Conversation {
70
+ /**
71
+ * Translated messages of the original messages
72
+ */
73
+ translatedMessages?: TranslatableMessage[];
74
+ }
75
+ export interface TranslationCompletedEventDetail {
76
+ translatedMessages: TranslatableMessage[];
77
+ }
78
+ export type TranslatableMessage = (Omit<Message, 'content'> & {
79
+ content: TextMessageContent[];
80
+ isTranslated?: boolean;
81
+ }) | (Omit<Message, 'content'> & {
82
+ content: DeveloperContentMessageContent[];
83
+ isTranslated?: boolean;
84
+ });
85
+ export interface TranslateResponse {
86
+ language: string;
87
+ is_translated: boolean;
88
+ translation: string;
89
+ has_command: boolean;
90
+ }
91
+ export interface SimpleEventMessage {
92
+ message: string;
93
+ }
94
+ export type Mutable<Type> = {
95
+ -readonly [Key in keyof Type]: Type[Key];
96
+ };
97
+ export interface Point {
98
+ x: number;
99
+ y: number;
100
+ }
101
+ export interface Rect {
102
+ x: number;
103
+ y: number;
104
+ width: number;
105
+ height: number;
106
+ }
107
+ export interface RectPoint {
108
+ x0: number;
109
+ y0: number;
110
+ x1: number;
111
+ y1: number;
112
+ }
113
+ export interface Padding {
114
+ top: number;
115
+ right: number;
116
+ bottom: number;
117
+ left: number;
118
+ }
119
+ export interface Size {
120
+ width: number;
121
+ height: number;
122
+ }
123
+ export interface PromptModel {
124
+ task: string;
125
+ prompt: string;
126
+ variables: string[];
127
+ temperature: number;
128
+ stopSequences?: string[];
129
+ }
130
+ export type TextGenWorkerMessage = {
131
+ command: 'startTextGen';
132
+ payload: {
133
+ requestID: string;
134
+ apiKey: string;
135
+ prompt: string;
136
+ temperature: number;
137
+ stopSequences?: string[];
138
+ detail?: string;
139
+ };
140
+ } | {
141
+ command: 'finishTextGen';
142
+ payload: {
143
+ requestID: string;
144
+ apiKey: string;
145
+ result: string;
146
+ prompt: string;
147
+ detail: string;
148
+ };
149
+ } | {
150
+ command: 'error';
151
+ payload: {
152
+ requestID: string;
153
+ originalCommand: string;
154
+ message: string;
155
+ };
156
+ };
157
+ export interface RefreshRendererListRequest {
158
+ resolve: (value: string[]) => void;
159
+ reject: (reason?: string) => void;
160
+ }
161
+ export interface RefreshRendererListResponse {
162
+ renderers: string[];
163
+ }
164
+ export interface HarmonyRenderRequest {
165
+ conversation: string;
166
+ renderer: string;
167
+ resolve: (value: HarmonyRenderResponse) => void;
168
+ reject: (reason?: string) => void;
169
+ }
170
+ export interface HarmonyRenderResponse {
171
+ tokens: number[];
172
+ decoded_tokens: string[];
173
+ display_string: string;
174
+ partial_success_error_messages: string[];
175
+ }
176
+ export {};