@adia-ai/web-modules 0.8.37 → 0.8.38
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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/chat/README.md +1 -1
- package/chat/chat-shell/chat-shell.js +2 -2
- package/chat/chat-surfaces/chat-surfaces.js +1 -1
- package/dist/chat/chat-shell.min.js +1 -1
- package/dist/everything.min.js +121 -102
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog — @adia-ai/web-modules
|
|
2
2
|
|
|
3
|
+
## [0.8.38] — 2026-08-15
|
|
4
|
+
|
|
5
|
+
### Maintenance
|
|
6
|
+
- **Lockstep version bump only.** No source changes in this package; bumped to maintain the lockstep version coherence enforced by `scripts/release/check-lockstep.mjs`. Substantive v0.8.38 work shipped in clean-world cut: five-family layout (ADR-0049), tiered-catalog contract phase 1 (ADR-0050), factory MCP server (ADR-0051), drilldown-ui, nav/view-transition/page fixes. See `packages/gen-ui/mcp/CHANGELOG.md#0838--2026-08-15` for details.
|
|
7
|
+
- **`agent-admin/` touched in this release window** (2 file(s), e.g. `admin-settings/admin-settings.examples.html`) — carried by the entries above.
|
|
8
|
+
- **`chat/` touched in this release window** (4 file(s), e.g. `chat/README.md`) — carried by the entries above.
|
|
9
|
+
- **`dist/` bundles rebuilt** in this cut's window (2 file(s)) — regenerated from the source changes described above, not independent edits.
|
|
10
|
+
|
|
3
11
|
## [0.8.37] — 2026-08-14
|
|
4
12
|
|
|
5
13
|
### Fixed
|
package/README.md
CHANGED
|
@@ -349,7 +349,7 @@ web-modules/
|
|
|
349
349
|
└── index.js barrel re-export of every cluster
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
Each element directory carries its `.js`, `.css`, `.yaml`, and `.a2ui.json` files — same shape as `web-components/components/<x>/`. The yaml + a2ui.json contracts feed the gen-UI catalog at `packages/a2ui/corpus/catalog-a2ui_0_9.json`; the build script at `scripts/build/components.mjs` scans both `web-components/components/` and `web-modules/<cluster>/`.
|
|
352
|
+
Each element directory carries its `.js`, `.css`, `.yaml`, and `.a2ui.json` files — same shape as `web-components/components/<x>/`. The yaml + a2ui.json contracts feed the gen-UI catalog at `packages/gen-ui/a2ui/corpus/catalog-a2ui_0_9.json`; the build script at `scripts/build/components.mjs` scans both `web-components/components/` and `web-modules/<cluster>/`.
|
|
353
353
|
|
|
354
354
|
## Behavior contract
|
|
355
355
|
|
package/chat/README.md
CHANGED
|
@@ -12,7 +12,7 @@ streaming vs. external-drive).
|
|
|
12
12
|
|
|
13
13
|
`wireAgentEvents(chatShell, registry, { events, statusEl? })` folds ONE
|
|
14
14
|
`AsyncIterable<AgentEvent>` (`@adia-ai/agent`'s stream contract — see
|
|
15
|
-
[`packages/agent/README.md`](../../agent/README.md#events)) into the thread.
|
|
15
|
+
[`packages/llm/agent/README.md`](../../llm/agent/README.md#events)) into the thread.
|
|
16
16
|
It never touches session state — `reduce(session, event)` is the caller's
|
|
17
17
|
job, the same event object just also flows through this function to paint.
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineIfFree } from '@adia-ai/web-components/core/register';
|
|
2
2
|
import { UIElement } from '@adia-ai/web-components/core/element';
|
|
3
3
|
import { renderMarkdown } from '@adia-ai/web-components/core/markdown';
|
|
4
|
-
// LAZY llm import (gh#541): packages/llm/index.js is a BUILD ARTIFACT
|
|
4
|
+
// LAZY llm import (gh#541): packages/llm/core/index.js is a BUILD ARTIFACT
|
|
5
5
|
// (gitignored; TS source only in a fresh checkout). A static import here
|
|
6
6
|
// rides the everything-barrel, so a missing artifact 500'd EVERY /site
|
|
7
7
|
// route with a full-viewport vite-error-overlay — the freeze-shaped dev
|
|
@@ -309,7 +309,7 @@ class ChatShell extends UIElement {
|
|
|
309
309
|
} catch { /* try next */ }
|
|
310
310
|
}
|
|
311
311
|
if (!streamChat) {
|
|
312
|
-
this.appendMessage({ role: 'error', content: '@adia-ai/llm is not available — in a fresh checkout run the packages/llm build (see gh#527/gh#541).' });
|
|
312
|
+
this.appendMessage({ role: 'error', content: '@adia-ai/llm is not available — in a fresh checkout run the packages/llm/core build (see gh#527/gh#541).' });
|
|
313
313
|
this.#emit('error', { error: new Error('llm build artifact missing') });
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
@@ -186,7 +186,7 @@ export const PROGRESS_LABELS = {
|
|
|
186
186
|
* union already carries `workflow`/`step`/`data`), so no closed-vocabulary
|
|
187
187
|
* `type` amendment is needed to carry this: `workflow: 'plan'` is just a
|
|
188
188
|
* new value inside an already-open string field, the same way
|
|
189
|
-
* `packages/agent/src/workflow.ts`'s own step events use `workflow` for a
|
|
189
|
+
* `packages/llm/agent/src/workflow.ts`'s own step events use `workflow` for a
|
|
190
190
|
* different named workflow.
|
|
191
191
|
*
|
|
192
192
|
* Code-owned text (CHAT-HARNESS law 3's spirit, applied to `step` the way
|
|
@@ -47,4 +47,4 @@ var RS=Object.defineProperty;var ee=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&
|
|
|
47
47
|
`):t}async#f(){if(this.#o||this.#e)return;let e=this.#i,t=Zu(this.language);this.#o=!0;try{let n=await Promise.resolve().then(()=>(Au(),Xu)),r=null;try{r=(await n.importWithTimeout(n.languages[t],`lang-${t}`))?.extension??null}catch(s){this.dispatchEvent(new CustomEvent("language-load-error",{bubbles:!0,detail:{phase:"language",language:t,error:s}}))}if(e!==this.#i||!this.isConnected)return;this.#O(n,r,t)}catch(n){this.dispatchEvent(new CustomEvent("language-load-error",{bubbles:!0,detail:{phase:"core",error:n}})),console.warn("[code-ui] CodeMirror failed to load; staying on static fallback.",n)}finally{this.#o=!1}}#O(e,t,n){let{EditorState:r,EditorView:s,Compartment:o,lineNumbers:l,placeholder:a,syntaxHighlighting:h,history:c,historyKeymap:f,defaultKeymap:u,indentWithTab:d,keymap:O,adiaBaseTheme:m,adiaHighlightStyle:g,lintGutter:b,jsonLinter:S}=e,y=this.querySelector(":scope > pre"),C=y?y.querySelector("code")?.textContent??"":"",x=this.text||C||"";this.#l=x;let k=document.createElement("div");k.setAttribute("data-cm-mount",""),y?y.replaceWith(k):this.appendChild(k);let w=[m,h(g)];this.editable&&w.push(c(),O.of([{key:"Mod-s",run:E=>(this.#g(E),!0)},...u,...f,d]),s.updateListener.of(E=>{if(!E.docChanged)return;let j=E.state.doc.toString();this.#d(j),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,detail:{value:j}}))}),s.domEventHandlers({focus:(E,j)=>(this.#n=j.state.doc.toString(),!1),blur:(E,j)=>{let N=j.state.doc.toString();return this.#n!==null&&N!==this.#n&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:N}})),this.#n=null,!1}})),this.#s=new o,w.push(this.#s.of(this.#u(s,r))),t&&w.push(t),this.lineNumbers&&w.push(l()),this.placeholder&&w.push(a(this.placeholder)),this.editable&&n==="json"&&w.push(S,b()),this.#e=new s({parent:k,state:r.create({doc:x,extensions:w})}),this.editable&&this.#d(x)}#u(e,t){return this.editable&&!this.disabled&&!this.readonly?[]:[e.editable.of(!1),t.readOnly.of(!0)]}async#p(){if(!this.#e||!this.#s)return;let e=await Promise.resolve().then(()=>(Au(),Xu));this.#e.dispatch({effects:this.#s.reconfigure(this.#u(e.EditorView,e.EditorState))})}get form(){return this.internals.form}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}#d(e){this.editable&&(e=e??this.value??"",this.internals.setFormValue(e),this.#m(e))}#m(e){return e=e??"",this.required&&!e.trim()?(this.internals.setValidity({valueMissing:!0},this.getAttribute("data-msg-required")||"This field is required.",this),this.setAttribute("aria-invalid","true"),!1):(this.internals.setValidity({}),this.removeAttribute("aria-invalid"),!0)}formResetCallback(){this.#e?this.#e.dispatch({changes:{from:0,to:this.#e.state.doc.length,insert:this.#l}}):this.text=this.#l}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e,t){typeof e=="string"&&(this.#e?this.#e.dispatch({changes:{from:0,to:this.#e.state.doc.length,insert:e}}):this.text=e)}#g(e){this.dispatchEvent(new CustomEvent("save",{bubbles:!0,cancelable:!0,detail:{value:e.state.doc.toString()}}))}get value(){return this.#e?this.#e.state.doc.toString():this.querySelector(":scope > pre > code")?.textContent??this.text??""}set value(e){this.text=String(e??"")}#b(){let e=this.#e?this.#e.state.doc.toString():this.querySelector(":scope > pre > code")?.textContent??"";e&&navigator.clipboard.writeText(e).then(()=>{let t=this.querySelector(':scope > header [slot="copy"]');if(!t)return;let n=t.textContent;t.textContent="Copied!",this.#r!=null&&clearTimeout(this.#r),this.#r=setTimeout(()=>{this.#r=null,t.textContent=n},1500)})}render(){let e=this.querySelector(':scope > header [slot="label"]');if(e&&this.language&&(e.textContent=this.language),this.#p(),!this.inline&&this.text!=="")if(this.#e){if(this.editable&&this.#e.hasFocus)return;let t=this.#e.state.doc.toString();t!==this.text&&this.#e.dispatch({changes:{from:0,to:t.length,insert:this.text}})}else{let t=this.querySelector(":scope > pre > code");t&&t.textContent!==this.text&&(t.textContent=this.text)}}};is("code-ui",es);function Ru(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var Dv=0,_l=class extends an{static properties={streaming:{type:Boolean,default:!1,reflect:!0},provider:{type:String,default:"",reflect:!0},model:{type:String,default:"",reflect:!0},system:{type:String,default:"",reflect:!0},proxyUrl:{type:String,default:"",attribute:"proxy-url",reflect:!0},thinking:{type:Boolean,default:!1,reflect:!0}};static template=()=>null;#t=[];#r=null;#e=null;#i=null;#o=null;#n=null;#l="";get messages(){return[...this.#t]}get conversation(){return this.#t.filter(e=>e.role==="user"||e.role==="assistant").map(e=>e.html?{role:e.role,content:e.content,html:!0}:{role:e.role,content:e.content})}set conversation(e){this.clear();for(let t of e)this.appendMessage({role:t.role,content:t.content,render:!t.html,html:!!t.html})}set apiKey(e){this.#l=e}connected(){this.#e=this.querySelector("chat-thread"),this.#i=this.querySelector("chat-composer"),this.#o=this.querySelector("chat-empty"),this.#n=this.querySelector("chat-status"),this.#i?.addEventListener("composer-submit",this.#a)}disconnected(){this.#i?.removeEventListener("composer-submit",this.#a),this.abort()}#s(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))}#a=e=>{if(this.streaming)return;let{text:t,model:n}=e.detail||{};t&&(this.#i.clear(),this.#s("submit",{text:t,model:n}),(this.proxyUrl||this.#l)&&this.send(t,n?{model:n}:{}))};appendMessage({role:e,content:t="",render:n=!1,html:r=!1}){let s=`msg_${++Dv}`;this.#t.push({id:s,role:e,content:t,html:r});let o=document.createElement("div");if(o.setAttribute("data-role",e),o.setAttribute("data-id",s),e==="user")o.innerHTML=`<div data-bubble>${Ru(t)}</div>`;else if(e==="assistant"){let l=n||r,a=r?t:n&&t?ql(t):Ru(t);o.innerHTML=`
|
|
48
48
|
<span data-avatar>AI</span>
|
|
49
49
|
<div data-bubble><div data-content>${a}</div>${l?"":"<span data-cursor></span>"}</div>
|
|
50
|
-
`}else e==="error"&&(o.innerHTML=`<icon-ui name="warning"></icon-ui><span>${Ru(t)}</span>`);return this.#e?.appendChild(o),this.#h(),this.#s("message",{id:s,role:e,content:t}),o}appendChunk(e){let t=this.#t[this.#t.length-1];if(!t||t.role!=="assistant")return;t.content+=e;let n=this.#e?.querySelector("[data-role]:last-child [data-content]");n&&n.insertAdjacentText("beforeend",e),this.#h()}setStreamedText(e){let t=this.#t[this.#t.length-1];if(!t||t.role!=="assistant")return;t.content=e;let n=this.#e?.querySelector("[data-role]:last-child [data-content]");n&&(n.textContent=e),this.#h()}deleteMessage(e){let t=this.#t.findIndex(n=>n.id===e);t!==-1&&(this.#t.splice(t,1),this.#e?.querySelector(`[data-id="${e}"]`)?.remove())}clear(){if(this.#t.length=0,this.#e){let e=this.#o;this.#e.innerHTML="",e&&this.#e.appendChild(e)}this.#s("clear")}startStreaming(){this.streaming=!0,this.#i&&(this.#i.disabled=!0),this.#n&&(this.#n.textContent="Typing..."),this.#e?.tagName?.toLowerCase()==="chat-thread"&&(this.#e.streaming=!0)}stopStreaming(){this.streaming=!1,this.#i&&(this.#i.disabled=!1),this.#n&&(this.#n.textContent=""),this.#e?.tagName?.toLowerCase()==="chat-thread"&&(this.#e.streaming=!1),this.#e?.querySelector("[data-role]:last-child [data-cursor]")?.remove();let e=this.#t[this.#t.length-1];if(e?.role==="assistant"&&e.content&&!e.html){let t=this.#e?.querySelector("[data-role]:last-child [data-content]");t&&(t.innerHTML=ql(e.content),this.#c(t))}this.#i?.focus()}abort(){this.#r&&(this.#r.abort(),this.#r=null,this.#s("abort")),this.streaming&&this.stopStreaming()}async send(e,t={}){let n=t.model||this.model||this.#i?.model;if(!n)throw new Error("No model specified");this.appendMessage({role:"user",content:e}),this.appendMessage({role:"assistant",content:""}),this.startStreaming(),this.#r=new AbortController;try{let r={provider:this.provider||void 0,apiKey:this.#l||void 0,model:n,system:this.system||void 0,proxyUrl:this.proxyUrl||void 0,thinking:this.thinking||void 0,messages:this.conversation.slice(0,-1),signal:this.#r.signal,...t},s;for(let o of["../../../llm/index.js","../../llm/index.js"])try{({streamChat:s}=await import(new URL(o,import.meta.url).href));break}catch{}if(!s){this.appendMessage({role:"error",content:"@adia-ai/llm is not available \u2014 in a fresh checkout run the packages/llm build (see gh#527/gh#541)."}),this.#s("error",{error:new Error("llm build artifact missing")});return}for await(let o of s(r))o.type==="text"?(this.appendChunk(o.text),this.#s("chunk",{text:o.text,snapshot:o.snapshot})):o.type==="thinking"?this.#s("thinking",{text:o.text}):o.type==="done"?this.#s("done",{text:o.text,usage:o.usage,stopReason:o.stopReason}):o.type==="error"&&(this.appendMessage({role:"error",content:o.error.message}),this.#s("error",{error:o.error}))}catch(r){r.name!=="AbortError"&&(this.appendMessage({role:"error",content:r.message}),this.#s("error",{error:r}))}this.#r=null,this.stopStreaming()}export(){return{messages:this.#t.map(e=>({role:e.role,content:e.content})),model:this.model,system:this.system}}import(e){e.model&&(this.model=e.model),e.system&&(this.system=e.system),e.messages&&(this.conversation=e.messages)}#h(){let e=this.#e;e&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})}#c(e){for(let t of e.querySelectorAll("pre")){let n=t.querySelector("code");if(!n)continue;let r=n.getAttribute("data-lang")||"",s=document.createElement("code-ui");r&&s.setAttribute("language",r),s.textContent=n.textContent,t.replaceWith(s)}}};is("chat-shell",_l);export{_l as ChatShell};
|
|
50
|
+
`}else e==="error"&&(o.innerHTML=`<icon-ui name="warning"></icon-ui><span>${Ru(t)}</span>`);return this.#e?.appendChild(o),this.#h(),this.#s("message",{id:s,role:e,content:t}),o}appendChunk(e){let t=this.#t[this.#t.length-1];if(!t||t.role!=="assistant")return;t.content+=e;let n=this.#e?.querySelector("[data-role]:last-child [data-content]");n&&n.insertAdjacentText("beforeend",e),this.#h()}setStreamedText(e){let t=this.#t[this.#t.length-1];if(!t||t.role!=="assistant")return;t.content=e;let n=this.#e?.querySelector("[data-role]:last-child [data-content]");n&&(n.textContent=e),this.#h()}deleteMessage(e){let t=this.#t.findIndex(n=>n.id===e);t!==-1&&(this.#t.splice(t,1),this.#e?.querySelector(`[data-id="${e}"]`)?.remove())}clear(){if(this.#t.length=0,this.#e){let e=this.#o;this.#e.innerHTML="",e&&this.#e.appendChild(e)}this.#s("clear")}startStreaming(){this.streaming=!0,this.#i&&(this.#i.disabled=!0),this.#n&&(this.#n.textContent="Typing..."),this.#e?.tagName?.toLowerCase()==="chat-thread"&&(this.#e.streaming=!0)}stopStreaming(){this.streaming=!1,this.#i&&(this.#i.disabled=!1),this.#n&&(this.#n.textContent=""),this.#e?.tagName?.toLowerCase()==="chat-thread"&&(this.#e.streaming=!1),this.#e?.querySelector("[data-role]:last-child [data-cursor]")?.remove();let e=this.#t[this.#t.length-1];if(e?.role==="assistant"&&e.content&&!e.html){let t=this.#e?.querySelector("[data-role]:last-child [data-content]");t&&(t.innerHTML=ql(e.content),this.#c(t))}this.#i?.focus()}abort(){this.#r&&(this.#r.abort(),this.#r=null,this.#s("abort")),this.streaming&&this.stopStreaming()}async send(e,t={}){let n=t.model||this.model||this.#i?.model;if(!n)throw new Error("No model specified");this.appendMessage({role:"user",content:e}),this.appendMessage({role:"assistant",content:""}),this.startStreaming(),this.#r=new AbortController;try{let r={provider:this.provider||void 0,apiKey:this.#l||void 0,model:n,system:this.system||void 0,proxyUrl:this.proxyUrl||void 0,thinking:this.thinking||void 0,messages:this.conversation.slice(0,-1),signal:this.#r.signal,...t},s;for(let o of["../../../llm/index.js","../../llm/index.js"])try{({streamChat:s}=await import(new URL(o,import.meta.url).href));break}catch{}if(!s){this.appendMessage({role:"error",content:"@adia-ai/llm is not available \u2014 in a fresh checkout run the packages/llm/core build (see gh#527/gh#541)."}),this.#s("error",{error:new Error("llm build artifact missing")});return}for await(let o of s(r))o.type==="text"?(this.appendChunk(o.text),this.#s("chunk",{text:o.text,snapshot:o.snapshot})):o.type==="thinking"?this.#s("thinking",{text:o.text}):o.type==="done"?this.#s("done",{text:o.text,usage:o.usage,stopReason:o.stopReason}):o.type==="error"&&(this.appendMessage({role:"error",content:o.error.message}),this.#s("error",{error:o.error}))}catch(r){r.name!=="AbortError"&&(this.appendMessage({role:"error",content:r.message}),this.#s("error",{error:r}))}this.#r=null,this.stopStreaming()}export(){return{messages:this.#t.map(e=>({role:e.role,content:e.content})),model:this.model,system:this.system}}import(e){e.model&&(this.model=e.model),e.system&&(this.system=e.system),e.messages&&(this.conversation=e.messages)}#h(){let e=this.#e;e&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})}#c(e){for(let t of e.querySelectorAll("pre")){let n=t.querySelector("code");if(!n)continue;let r=n.getAttribute("data-lang")||"",s=document.createElement("code-ui");r&&s.setAttribute("language",r),s.textContent=n.textContent,t.replaceWith(s)}}};is("chat-shell",_l);export{_l as ChatShell};
|