@webmcpui/core 0.0.1
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/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/chunk-ADS4GRIL.js +14 -0
- package/dist/index.d.ts +378 -0
- package/dist/index.js +1002 -0
- package/dist/testing.d.ts +34 -0
- package/dist/testing.js +47 -0
- package/dist/webmcp-DEspBoqq.d.ts +47 -0
- package/dist/webmcpui.global.js +343 -0
- package/package.json +65 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { a as WebMCPToolResult } from './webmcp-DEspBoqq.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fake WebMCP host for tests, demos, and the eventual inspector.
|
|
5
|
+
*
|
|
6
|
+
* No mainstream agent calls WebMCP yet, so this is the only way to exercise
|
|
7
|
+
* tool exposure end to end: install a stub `navigator.modelContext` that
|
|
8
|
+
* records registered tools and lets you invoke them as an agent would.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface RegisteredTool {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inputSchema: Record<string, unknown>;
|
|
15
|
+
execute: (args: Record<string, unknown>) => WebMCPToolResult | Promise<WebMCPToolResult>;
|
|
16
|
+
}
|
|
17
|
+
interface FakeAgent {
|
|
18
|
+
/** All currently-registered tools, in registration order. */
|
|
19
|
+
readonly tools: readonly RegisteredTool[];
|
|
20
|
+
/** Look up a registered tool by name. */
|
|
21
|
+
get(name: string): RegisteredTool | undefined;
|
|
22
|
+
/** Invoke a tool the way an agent would. Throws if the tool is unknown. */
|
|
23
|
+
call(name: string, args?: Record<string, unknown>): Promise<WebMCPToolResult>;
|
|
24
|
+
/** Restore the previous `navigator.modelContext` (or remove the stub). */
|
|
25
|
+
restore(): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Install a fake WebMCP host onto `navigator.modelContext` and return a handle
|
|
29
|
+
* for inspecting and invoking the tools components register. Call `restore()`
|
|
30
|
+
* when done (e.g. in test teardown).
|
|
31
|
+
*/
|
|
32
|
+
declare function installFakeAgent(): FakeAgent;
|
|
33
|
+
|
|
34
|
+
export { type FakeAgent, type RegisteredTool, installFakeAgent };
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "./chunk-ADS4GRIL.js";
|
|
2
|
+
|
|
3
|
+
// src/testing.ts
|
|
4
|
+
function installFakeAgent() {
|
|
5
|
+
const nav = navigator;
|
|
6
|
+
const previous = nav.modelContext;
|
|
7
|
+
const tools = /* @__PURE__ */ new Map();
|
|
8
|
+
nav.modelContext = {
|
|
9
|
+
registerTool(tool) {
|
|
10
|
+
tools.set(tool.name, {
|
|
11
|
+
name: tool.name,
|
|
12
|
+
description: tool.description,
|
|
13
|
+
inputSchema: tool.inputSchema ?? {},
|
|
14
|
+
execute: tool.execute
|
|
15
|
+
});
|
|
16
|
+
return { unregister: () => tools.delete(tool.name) };
|
|
17
|
+
},
|
|
18
|
+
unregisterTool(name) {
|
|
19
|
+
tools.delete(name);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
get tools() {
|
|
24
|
+
return [...tools.values()];
|
|
25
|
+
},
|
|
26
|
+
get(name) {
|
|
27
|
+
return tools.get(name);
|
|
28
|
+
},
|
|
29
|
+
async call(name, args = {}) {
|
|
30
|
+
const tool = tools.get(name);
|
|
31
|
+
if (!tool) {
|
|
32
|
+
throw new Error(`No WebMCP tool registered named "${name}"`);
|
|
33
|
+
}
|
|
34
|
+
return tool.execute(args);
|
|
35
|
+
},
|
|
36
|
+
restore() {
|
|
37
|
+
if (previous === void 0) {
|
|
38
|
+
delete nav.modelContext;
|
|
39
|
+
} else {
|
|
40
|
+
nav.modelContext = previous;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
installFakeAgent
|
|
47
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The imperative WebMCP exposure layer.
|
|
3
|
+
*
|
|
4
|
+
* WebMCP is an imperative API: `document.modelContext.registerTool(...)`. The
|
|
5
|
+
* surface is still churning — `document.modelContext` is canonical as of the
|
|
6
|
+
* Chrome 149+ origin trial, and `navigator.modelContext` is the original
|
|
7
|
+
* location, deprecated in Chrome 150 — so we feature-detect both and prefer
|
|
8
|
+
* `document`. As of mid-2026 it ships only behind the origin trial and is
|
|
9
|
+
* undefined for almost everyone, with no mainstream agent consuming it yet. So
|
|
10
|
+
* everything here is additive and feature-detected: a component must be a
|
|
11
|
+
* perfectly good form control with zero agent present.
|
|
12
|
+
*
|
|
13
|
+
* The API is `[SecureContext]`, so it only exists on HTTPS pages (localhost
|
|
14
|
+
* counts as secure); on plain-HTTP origins detection is a no-op by design.
|
|
15
|
+
*/
|
|
16
|
+
/** A JSON-Schema-ish description of a tool's parameters. */
|
|
17
|
+
type JSONSchema = Record<string, unknown>;
|
|
18
|
+
interface WebMCPToolResultContent {
|
|
19
|
+
type: 'text';
|
|
20
|
+
text: string;
|
|
21
|
+
}
|
|
22
|
+
interface WebMCPToolResult {
|
|
23
|
+
content: WebMCPToolResultContent[];
|
|
24
|
+
isError?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface WebMCPToolDefinition {
|
|
27
|
+
/** Stable, unique tool name (snake_case by convention). */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Natural-language description the agent reads to decide when to call it. */
|
|
30
|
+
description: string;
|
|
31
|
+
/** JSON Schema for the tool's arguments. */
|
|
32
|
+
inputSchema?: JSONSchema;
|
|
33
|
+
/** Invoked when the agent calls the tool. */
|
|
34
|
+
execute: (args: Record<string, unknown>) => WebMCPToolResult | Promise<WebMCPToolResult>;
|
|
35
|
+
}
|
|
36
|
+
/** Disposer returned by {@link exposeTool}; safe to call when nothing was registered. */
|
|
37
|
+
type ToolDisposer = () => void;
|
|
38
|
+
/** True when a WebMCP host is present in this environment. */
|
|
39
|
+
declare function isWebMCPAvailable(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Register a tool with the page's WebMCP host. Returns a disposer that
|
|
42
|
+
* unregisters it. If no host is present (the common case today), this is a
|
|
43
|
+
* no-op and the returned disposer does nothing — callers never need to branch.
|
|
44
|
+
*/
|
|
45
|
+
declare function exposeTool(definition: WebMCPToolDefinition): ToolDisposer;
|
|
46
|
+
|
|
47
|
+
export { type JSONSchema as J, type ToolDisposer as T, type WebMCPToolDefinition as W, type WebMCPToolResult as a, type WebMCPToolResultContent as b, exposeTool as e, isWebMCPAvailable as i };
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";var webmcpui=(()=>{var me=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Bt=Object.prototype.hasOwnProperty;var jt=(i,e)=>{for(var t in e)me(i,t,{get:e[t],enumerable:!0})},zt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Vt(e))!Bt.call(i,s)&&s!==t&&me(i,s,{get:()=>e[s],enumerable:!(r=rt(e,s))||r.enumerable});return i};var qt=i=>zt(me({},"__esModule",{value:!0}),i),v=(i,e,t,r)=>{for(var s=r>1?void 0:r?rt(e,t):e,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(r?n(e,t,s):n(s))||s);return r&&s&&me(e,t,s),s};var ur={};jt(ur,{WmcpCheckbox:()=>G,WmcpFormControl:()=>p,WmcpInput:()=>q,WmcpRadio:()=>X,WmcpRadioGroup:()=>D,WmcpSelect:()=>U,WmcpTextarea:()=>F,defineComponents:()=>Ue,exposeTool:()=>Ne,isStandardSchema:()=>Me,isWebMCPAvailable:()=>Nt,textFieldStyles:()=>k,validateStandard:()=>Pe});var it=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(e){this.ariaActiveDescendantElement=null,this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColIndexText="",this.ariaColSpan="",this.ariaControlsElements=null,this.ariaCurrent="",this.ariaDescribedByElements=null,this.ariaDescription="",this.ariaDetailsElements=null,this.ariaDisabled="",this.ariaErrorMessageElements=null,this.ariaExpanded="",this.ariaFlowToElements=null,this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLabelledByElements=null,this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaOwnsElements=null,this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRelevant="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowIndexText="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=e}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var T=function(i,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},E=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},J,ve,fe,ee,He,te,ge,H,re,N,be,st;var S={__proto__:null};S.enumerable=!0;Object.freeze(S);var We=(N=class{constructor(e,t={}){if(J.set(this,!1),ve.set(this,!1),fe.set(this,!1),ee.set(this,!1),He.set(this,Date.now()),te.set(this,!1),ge.set(this,void 0),H.set(this,void 0),re.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof t!="object"||!t)throw new Error('The "options" argument must be an object');let{bubbles:r,cancelable:s,composed:o}=t;T(this,J,!!s,"f"),T(this,ve,!!r,"f"),T(this,fe,!!o,"f"),T(this,ge,`${e}`,"f"),T(this,H,null,"f"),T(this,re,!1,"f")}initEvent(e,t,r){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){T(this,ee,!0,"f")}get target(){return E(this,H,"f")}get currentTarget(){return E(this,H,"f")}get srcElement(){return E(this,H,"f")}get type(){return E(this,ge,"f")}get cancelable(){return E(this,J,"f")}get defaultPrevented(){return E(this,J,"f")&&E(this,ee,"f")}get timeStamp(){return E(this,He,"f")}composedPath(){return E(this,re,"f")?[E(this,H,"f")]:[]}get returnValue(){return!E(this,J,"f")||!E(this,ee,"f")}get bubbles(){return E(this,ve,"f")}get composed(){return E(this,fe,"f")}get eventPhase(){return E(this,re,"f")?N.AT_TARGET:N.NONE}get cancelBubble(){return E(this,te,"f")}set cancelBubble(e){e&&T(this,te,!0,"f")}stopPropagation(){T(this,te,!0,"f")}get isTrusted(){return!1}},J=new WeakMap,ve=new WeakMap,fe=new WeakMap,ee=new WeakMap,He=new WeakMap,te=new WeakMap,ge=new WeakMap,H=new WeakMap,re=new WeakMap,N.NONE=0,N.CAPTURING_PHASE=1,N.AT_TARGET=2,N.BUBBLING_PHASE=3,N);Object.defineProperties(We.prototype,{initEvent:S,stopImmediatePropagation:S,preventDefault:S,target:S,currentTarget:S,srcElement:S,type:S,cancelable:S,defaultPrevented:S,timeStamp:S,composedPath:S,returnValue:S,bubbles:S,composed:S,eventPhase:S,cancelBubble:S,stopPropagation:S,isTrusted:S});var ot=(st=class extends We{constructor(e,t={}){super(e,t),be.set(this,void 0),T(this,be,t?.detail??null,"f")}initCustomEvent(e,t,r,s){throw new Error("Method not implemented.")}get detail(){return E(this,be,"f")}},be=new WeakMap,st);Object.defineProperties(ot.prototype,{detail:S});var R=We,Ve=ot;var x;var yr=(x=class{constructor(){this.STYLE_RULE=1,this.CHARSET_RULE=2,this.IMPORT_RULE=3,this.MEDIA_RULE=4,this.FONT_FACE_RULE=5,this.PAGE_RULE=6,this.NAMESPACE_RULE=10,this.KEYFRAMES_RULE=7,this.KEYFRAME_RULE=8,this.SUPPORTS_RULE=12,this.COUNTER_STYLE_RULE=11,this.FONT_FEATURE_VALUES_RULE=14,this.MARGIN_RULE=9,this.__parentStyleSheet=null,this.cssText=""}get parentRule(){return null}get parentStyleSheet(){return this.__parentStyleSheet}get type(){return 0}},x.STYLE_RULE=1,x.CHARSET_RULE=2,x.IMPORT_RULE=3,x.MEDIA_RULE=4,x.FONT_FACE_RULE=5,x.PAGE_RULE=6,x.NAMESPACE_RULE=10,x.KEYFRAMES_RULE=7,x.KEYFRAME_RULE=8,x.SUPPORTS_RULE=12,x.COUNTER_STYLE_RULE=11,x.FONT_FEATURE_VALUES_RULE=14,x.MARGIN_RULE=9,x);globalThis.Event??=R;globalThis.CustomEvent??=Ve;var je=Symbol(),nt=i=>typeof i=="boolean"?i:i?.capture??!1,C={__proto__:null};C.enumerable=!0;Object.freeze(C);var _e=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(e,t,r){if(t==null)return;let s=nt(r)?this.__captureEventListeners:this.__eventListeners,o=s.get(e);if(o===void 0)o=new Map,s.set(e,o);else if(o.has(t))return;let n=typeof r=="object"&&r?r:{};n.signal?.addEventListener("abort",()=>this.removeEventListener(e,t,r)),o.set(t,n??{})}removeEventListener(e,t,r){if(t==null)return;let s=nt(r)?this.__captureEventListeners:this.__eventListeners,o=s.get(e);o!==void 0&&(o.delete(t),o.size||s.delete(e))}dispatchEvent(e){let t=this.__resolveFullEventPath();!e.composed&&this.__host&&(t=t.slice(0,t.indexOf(this.__host)));let r=!1,s=!1,o=R.NONE,n=null,l=null,a=null,m=e.stopPropagation,_=e.stopImmediatePropagation;Object.defineProperties(e,{target:{get(){return n??l},...C},srcElement:{get(){return e.target},...C},currentTarget:{get(){return a},...C},eventPhase:{get(){return o},...C},composedPath:{value:()=>t,...C},stopPropagation:{value:()=>{r=!0,m.call(e)},...C},stopImmediatePropagation:{value:()=>{s=!0,_.call(e)},...C}});let c=(g,A,Q)=>{typeof g=="function"?g(e):typeof g?.handleEvent=="function"&&g.handleEvent(e),A.once&&Q.delete(g)},u=()=>(a=null,o=R.NONE,!e.defaultPrevented),d=t.slice().reverse();n=!this.__host||!e.composed?this:null;let y=g=>{for(l=this;l.__host&&g.includes(l.__host);)l=l.__host};for(let g of d){!n&&(!l||l===g.__host)&&y(d.slice(d.indexOf(g))),a=g,o=g===e.target?R.AT_TARGET:R.CAPTURING_PHASE;let A=g.__captureEventListeners.get(e.type);if(A){for(let[Q,De]of A)if(c(Q,De,A),s)return u()}if(r)return u()}let w=e.bubbles?t:[this];l=null;for(let g of w){!n&&(!l||g===l.__host)&&y(w.slice(0,w.indexOf(g)+1)),a=g,o=g===e.target?R.AT_TARGET:R.BUBBLING_PHASE;let A=g.__eventListeners.get(e.type);if(A){for(let[Q,De]of A)if(c(Q,De,A),s)return u()}if(r)return u()}return u()}__resolveFullEventPath(){return this.__eventPathCache?this.__eventPathCache:this.__eventTargetParent?this.__eventPathCache=[this,...this.__eventTargetParent.__resolveFullEventPath()]:this.__eventPathCache=[this,ct,Jt]}};var at=new WeakMap,ie=i=>{let e=at.get(i);return e===void 0&&at.set(i,e=new Map),e},se=class extends _e{getRootNode(e){return e?.composed?Be:this.__host?.__shadowRoot??Be}};var lt=class extends se{get adoptedStyleSheets(){return[]}createTreeWalker(){return{}}createTextNode(){return{}}createElement(){return{}}};var ct=new lt,Be=ct;var ht=class extends se{constructor(e){if(super(),e!==je)throw new TypeError("Illegal constructor");Object.assign(this,globalThis,{CustomElementRegistry:ye,customElements:qe,document:Be,Document:lt,Element:dt,EventTarget:_e,HTMLElement:pt,Node:se,ShadowRoot:ut,window:this,Window:ht})}};var dt=class extends se{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(ie(this)).map(([e,t])=>({name:e,value:t}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(e,t){ie(this).set(e,String(t))}removeAttribute(e){ie(this).delete(e)}toggleAttribute(e,t){if(this.hasAttribute(e)){if(t===void 0||!t)return this.removeAttribute(e),!1}else return t===void 0||t?(this.setAttribute(e,""),!0):!1;return!0}hasAttribute(e){return ie(this).has(e)}attachShadow(e){this.__shadowRootMode=e.mode;let t=new ut(je,e);return t.__eventTargetParent=this,t.__host=this,this.__shadowRoot=t}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let e=new it(this);return this.__internals=e,e}getAttribute(e){return ie(this).get(e)??null}};var pt=class extends dt{},ze=pt;var ut=class extends se{get host(){return this.__host}constructor(e,t){if(super(),e!==e)throw new TypeError("Illegal constructor");this.mode=t.mode}};globalThis.litServerRoot??=Object.defineProperty(new ze,"localName",{get(){return"lit-server-root"}});function Ft(){let i,e;return{promise:new Promise((r,s)=>{i=r,e=s}),resolve:i,reject:e}}var ye=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(e,t){if(this.__definitions.has(e))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${e}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
+
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${e}" has already been used with this registry`);if(this.__reverseDefinitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(t)}`);t.__localName=e,this.__definitions.set(e,{ctor:t,observedAttributes:t.observedAttributes??[]}),this.__reverseDefinitions.set(t,e),this.__pendingWhenDefineds.get(e)?.resolve(t),this.__pendingWhenDefineds.delete(e)}get(e){return this.__definitions.get(e)?.ctor}getName(e){return this.__reverseDefinitions.get(e)??null}initialize(e){throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.")}upgrade(e){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(e){let t=this.__definitions.get(e);if(t)return t.ctor;let r=this.__pendingWhenDefineds.get(e);return r||(r=Ft(),this.__pendingWhenDefineds.set(e,r)),r.promise}},Gt=ye;var qe=new Gt,Jt=new ht(je);var oe=globalThis,Se=oe.ShadowRoot&&(oe.ShadyCSS===void 0||oe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fe=Symbol(),mt=new WeakMap,ne=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Fe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Se&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=mt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&mt.set(t,e))}return e}toString(){return this.cssText}},vt=i=>new ne(typeof i=="string"?i:i+"",void 0,Fe),$=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,s,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new ne(t,i,Fe)},ft=(i,e)=>{if(Se)i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),s=oe.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=t.cssText,i.appendChild(r)}},Ge=Se||oe.CSSStyleSheet===void 0?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return vt(t)})(i):i;var{is:Kt,defineProperty:Yt,getOwnPropertyDescriptor:Zt,getOwnPropertyNames:Xt,getOwnPropertySymbols:Qt,getPrototypeOf:er}=Object,ce=globalThis;ce.customElements??=qe;var gt=ce.trustedTypes,tr=gt?gt.emptyScript:"",rr=ce.reactiveElementPolyfillSupport,ae=(i,e)=>i,le={toAttribute(i,e){switch(e){case Boolean:i=i?tr:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Ee=(i,e)=>!Kt(i,e),bt={attribute:!0,type:String,converter:le,reflect:!1,useDefault:!1,hasChanged:Ee};Symbol.metadata??=Symbol("metadata"),ce.litPropertyMetadata??=new WeakMap;var O=class extends(globalThis.HTMLElement??ze){static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=bt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(e,r,t);s!==void 0&&Yt(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){let{get:s,set:o}=Zt(this.prototype,e)??{get(){return this[t]},set(n){this[t]=n}};return{get:s,set(n){let l=s?.call(this);o?.call(this,n),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??bt}static _$Ei(){if(this.hasOwnProperty(ae("elementProperties")))return;let e=er(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ae("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ae("properties"))){let t=this.properties,r=[...Xt(t),...Qt(t)];for(let s of r)this.createProperty(s,t[s])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,s]of t)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let s=this._$Eu(t,r);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let s of r)t.unshift(Ge(s))}else e!==void 0&&t.push(Ge(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(s!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:le).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,s=r._$Eh.get(e);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:le;this._$Em=s;let l=n.fromAttribute(t,o.type);this[s]=l??this._$Ej?.get(s)??l,this._$Em=null}}requestUpdate(e,t,r,s=!1,o){if(e!==void 0){let n=this.constructor;if(s===!1&&(o=this[e]),r??=n.getPropertyOptions(e),!((r.hasChanged??Ee)(o,t)||r.useDefault&&r.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(n._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:s,wrapped:o},n){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,n??t??this[e]),o!==!0||n!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[s,o]of r){let{wrapped:n}=o,l=this[s];n!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,o,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};O.elementStyles=[],O.shadowRootOptions={mode:"open"},O[ae("elementProperties")]=new Map,O[ae("finalized")]=new Map,rr?.({ReactiveElement:O}),(ce.reactiveElementVersions??=[]).push("2.1.2");var Ce=globalThis,_t=i=>i,xe=Ce.trustedTypes,yt=xe?xe.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ke="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,Ye="?"+P,ir=`<${Ye}>`,B=Ce.document===void 0?{createTreeWalker:()=>({})}:document,de=()=>B.createComment(""),pe=i=>i===null||typeof i!="object"&&typeof i!="function",Ze=Array.isArray,At=i=>Ze(i)||typeof i?.[Symbol.iterator]=="function",Je=`[
|
|
3
|
+
\f\r]`,he=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,St=/-->/g,Et=/>/g,W=RegExp(`>|${Je}(?:([^\\s"'>=/]+)(${Je}*=${Je}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),xt=/'/g,$t=/"/g,Tt=/^(?:script|style|textarea|title)$/i,Xe=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),b=Xe(1),Qr=Xe(2),ei=Xe(3),M=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),wt=new WeakMap,V=B.createTreeWalker(B,129);function Rt(i,e){if(!Ze(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return yt!==void 0?yt.createHTML(e):e}var Ct=(i,e)=>{let t=i.length-1,r=[],s,o=e===2?"<svg>":e===3?"<math>":"",n=he;for(let l=0;l<t;l++){let a=i[l],m,_,c=-1,u=0;for(;u<a.length&&(n.lastIndex=u,_=n.exec(a),_!==null);)u=n.lastIndex,n===he?_[1]==="!--"?n=St:_[1]!==void 0?n=Et:_[2]!==void 0?(Tt.test(_[2])&&(s=RegExp("</"+_[2],"g")),n=W):_[3]!==void 0&&(n=W):n===W?_[0]===">"?(n=s??he,c=-1):_[1]===void 0?c=-2:(c=n.lastIndex-_[2].length,m=_[1],n=_[3]===void 0?W:_[3]==='"'?$t:xt):n===$t||n===xt?n=W:n===St||n===Et?n=he:(n=W,s=void 0);let d=n===W&&i[l+1].startsWith("/>")?" ":"";o+=n===he?a+ir:c>=0?(r.push(m),a.slice(0,c)+Ke+a.slice(c)+P+d):a+P+(c===-2?l:d)}return[Rt(i,o+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ue=class i{constructor({strings:e,_$litType$:t},r){let s;this.parts=[];let o=0,n=0,l=e.length-1,a=this.parts,[m,_]=Ct(e,t);if(this.el=i.createElement(m,r),V.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=V.nextNode())!==null&&a.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(let c of s.getAttributeNames())if(c.endsWith(Ke)){let u=_[n++],d=s.getAttribute(c).split(P),y=/([.?@])?(.*)/.exec(u);a.push({type:1,index:o,name:y[2],strings:d,ctor:y[1]==="."?we:y[1]==="?"?Ae:y[1]==="@"?Te:z}),s.removeAttribute(c)}else c.startsWith(P)&&(a.push({type:6,index:o}),s.removeAttribute(c));if(Tt.test(s.tagName)){let c=s.textContent.split(P),u=c.length-1;if(u>0){s.textContent=xe?xe.emptyScript:"";for(let d=0;d<u;d++)s.append(c[d],de()),V.nextNode(),a.push({type:2,index:++o});s.append(c[u],de())}}}else if(s.nodeType===8)if(s.data===Ye)a.push({type:2,index:o});else{let c=-1;for(;(c=s.data.indexOf(P,c+1))!==-1;)a.push({type:7,index:o}),c+=P.length-1}o++}}static createElement(e,t){let r=B.createElement("template");return r.innerHTML=e,r}};function j(i,e,t=i,r){if(e===M)return e;let s=r!==void 0?t._$Co?.[r]:t._$Cl,o=pe(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=s:t._$Cl=s),s!==void 0&&(e=j(i,s._$AS(i,e.values),s,r)),e}var $e=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,s=(e?.creationScope??B).importNode(t,!0);V.currentNode=s;let o=V.nextNode(),n=0,l=0,a=r[0];for(;a!==void 0;){if(n===a.index){let m;a.type===2?m=new K(o,o.nextSibling,this,e):a.type===1?m=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(m=new Re(o,this,e)),this._$AV.push(m),a=r[++l]}n!==a?.index&&(o=V.nextNode(),n++)}return V.currentNode=B,s}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},K=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,s){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=j(this,e,t),pe(e)?e===h||e==null||e===""?(this._$AH!==h&&this._$AR(),this._$AH=h):e!==this._$AH&&e!==M&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):At(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==h&&pe(this._$AH)?this._$AA.nextSibling.data=e:this.T(B.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,s=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ue.createElement(Rt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(t);else{let o=new $e(s,this),n=o.u(this.options);o.p(t),this.T(n),this._$AH=o}}_$AC(e){let t=wt.get(e.strings);return t===void 0&&wt.set(e.strings,t=new ue(e)),t}k(e){Ze(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,s=0;for(let o of e)s===t.length?t.push(r=new i(this.O(de()),this.O(de()),this,this.options)):r=t[s],r._$AI(o),s++;s<t.length&&(this._$AR(r&&r._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=_t(e).nextSibling;_t(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,s,o){this.type=1,this._$AH=h,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=h}_$AI(e,t=this,r,s){let o=this.strings,n=!1;if(o===void 0)e=j(this,e,t,0),n=!pe(e)||e!==this._$AH&&e!==M,n&&(this._$AH=e);else{let l=e,a,m;for(e=o[0],a=0;a<o.length-1;a++)m=j(this,l[r+a],t,a),m===M&&(m=this._$AH[a]),n||=!pe(m)||m!==this._$AH[a],m===h?e=h:e!==h&&(e+=(m??"")+o[a+1]),this._$AH[a]=m}n&&!s&&this.j(e)}j(e){e===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},we=class extends z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===h?void 0:e}},Ae=class extends z{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==h)}},Te=class extends z{constructor(e,t,r,s,o){super(e,t,r,s,o),this.type=5}_$AI(e,t=this){if((e=j(this,e,t,0)??h)===M)return;let r=this._$AH,s=e===h&&r!==h||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==h&&(r===h||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Re=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){j(this,e)}},Ot={M:Ke,P,A:Ye,C:1,L:Ct,R:$e,D:At,V:j,I:K,H:z,N:Ae,U:Te,B:we,F:Re},sr=Ce.litHtmlPolyfillSupport;sr?.(ue,K),(Ce.litHtmlVersions??=[]).push("3.3.3");var Pt=(i,e,t)=>{let r=t?.renderBefore??e,s=r._$litPart$;if(s===void 0){let o=t?.renderBefore??null;r._$litPart$=s=new K(e.insertBefore(de(),o),o,void 0,t??{})}return s._$AI(i),s};var Qe=globalThis,L=class extends O{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Pt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return M}};L._$litElement$=!0,L.finalized=!0,Qe.litElementHydrateSupport?.({LitElement:L});var or=Qe.litElementPolyfillSupport;or?.({LitElement:L});(Qe.litElementVersions??=[]).push("4.2.2");var nr={attribute:!0,type:String,converter:le,reflect:!1,hasChanged:Ee},ar=(i=nr,e,t)=>{let{kind:r,metadata:s}=t,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),o.set(t.name,i),r==="accessor"){let{name:n}=t;return{set(l){let a=e.get.call(this);e.set.call(this,l),this.requestUpdate(n,a,i,!0,l)},init(l){return l!==void 0&&this.C(n,void 0,i,l),l}}}if(r==="setter"){let{name:n}=t;return function(l){let a=this[n];e.call(this,l),this.requestUpdate(n,a,i,!0,l)}}throw Error("Unsupported decorator location: "+r)};function f(i){return(e,t)=>typeof t=="object"?ar(i,e,t):((r,s,o)=>{let n=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,e,t)}function Y(i){return f({...i,state:!0,attribute:!1})}async function Pe(i,e){let t=await i["~standard"].validate(e);return t.issues?{valid:!1,errors:t.issues.map(r=>r.message)}:{valid:!0,value:t.value,errors:[]}}function Me(i){return typeof i=="object"&&i!==null&&"~standard"in i&&typeof i["~standard"]?.validate=="function"}function Mt(){let i=typeof document<"u"?document.modelContext:void 0,e=typeof navigator<"u"?navigator.modelContext:void 0,t=i??e;return t&&typeof t.registerTool=="function"?t:void 0}function Nt(){return Mt()!==void 0}var lr=globalThis.process?.env?.NODE_ENV!=="production",et=new Set;function Ne(i){let e=Mt();if(!e?.registerTool)return()=>{};let t={name:i.name,description:i.description,inputSchema:i.inputSchema??{type:"object",properties:{}},execute:i.execute};lr&&et.has(t.name)&&console.warn(`[webmcpui] A WebMCP tool named "${t.name}" is already registered on this page. Tool names are page-global, so the host rejects the duplicate and this control won't be agent-callable. Give one control a unique \`name\`, or override it with \`tool-name\`.`),et.add(t.name);let r=typeof AbortController=="function"?new AbortController:void 0,s=e.registerTool(t,r?{signal:r.signal}:void 0),o=!1;return()=>{if(!o){o=!0,et.delete(t.name);try{r?.abort(),s&&typeof s.unregister=="function"?s.unregister():typeof e.unregisterTool=="function"&&e.unregisterTool(i.name)}catch{}}}}var k=$`
|
|
5
|
+
.control {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
width: 100%;
|
|
8
|
+
padding: var(--input-padding-y, 0.5rem) var(--input-padding-x, 0.75rem);
|
|
9
|
+
font-family: inherit;
|
|
10
|
+
font-size: var(--input-font-size, 0.875rem);
|
|
11
|
+
line-height: var(--input-line-height, 1.25rem);
|
|
12
|
+
color: var(--input-text, var(--foreground, oklch(0.145 0 0)));
|
|
13
|
+
background: var(--input-bg, var(--background, oklch(1 0 0)));
|
|
14
|
+
border: var(--input-border-width, 1px) solid
|
|
15
|
+
var(--input-border, var(--input, oklch(0.922 0 0)));
|
|
16
|
+
border-radius: var(--input-radius, var(--radius, 0.625rem));
|
|
17
|
+
transition: border-color var(--input-transition-duration, 150ms)
|
|
18
|
+
var(--input-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
|
|
19
|
+
box-shadow var(--input-transition-duration, 150ms)
|
|
20
|
+
var(--input-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
21
|
+
}
|
|
22
|
+
.control::placeholder {
|
|
23
|
+
color: var(--input-placeholder, var(--muted-foreground, oklch(0.556 0 0)));
|
|
24
|
+
}
|
|
25
|
+
.control:hover:not(:disabled) {
|
|
26
|
+
border-color: var(--input-border-hover, var(--border, oklch(0.922 0 0)));
|
|
27
|
+
}
|
|
28
|
+
.control:focus-visible {
|
|
29
|
+
outline: none;
|
|
30
|
+
border-color: var(--input-border-focus, var(--ring, oklch(0.708 0 0)));
|
|
31
|
+
box-shadow: 0 0 0 var(--ring-width, 3px)
|
|
32
|
+
color-mix(in oklch, var(--ring, oklch(0.708 0 0)) 40%, transparent);
|
|
33
|
+
}
|
|
34
|
+
.control:disabled {
|
|
35
|
+
color: var(--input-text-disabled, var(--muted-foreground, oklch(0.556 0 0)));
|
|
36
|
+
background: var(--input-bg-disabled, var(--muted, oklch(0.97 0 0)));
|
|
37
|
+
cursor: not-allowed;
|
|
38
|
+
}
|
|
39
|
+
:host([invalid]) .control {
|
|
40
|
+
border-color: var(
|
|
41
|
+
--input-border-error,
|
|
42
|
+
var(--destructive, oklch(0.577 0.245 27.325))
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
`,p=class extends L{constructor(){super(...arguments);this.label="";this.name="";this.value="";this.placeholder="";this.required=!1;this.disabled=!1;this.helperText="";this.requiredMessage="";this.expose=!1;this.toolName="";this.toolDescription="";this.error="";this.internals=this.attachInternals();this.toolDisposer=()=>{};this.onInvalid=()=>{this.error=this.internals.validationMessage,this.toggleAttribute("invalid",!0)}}static{this.formAssociated=!0}static{this.styles=$`
|
|
46
|
+
:host {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: var(--input-gap-label, 0.375rem);
|
|
50
|
+
font-family: var(
|
|
51
|
+
--input-font-family,
|
|
52
|
+
ui-sans-serif,
|
|
53
|
+
system-ui,
|
|
54
|
+
sans-serif
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
:host([hidden]) {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
label {
|
|
61
|
+
font-size: var(--input-font-size-label, 0.875rem);
|
|
62
|
+
font-weight: var(--input-font-weight-label, 500);
|
|
63
|
+
color: var(--input-label, var(--foreground, oklch(0.145 0 0)));
|
|
64
|
+
}
|
|
65
|
+
.message {
|
|
66
|
+
font-size: var(--input-font-size-helper, 0.8125rem);
|
|
67
|
+
}
|
|
68
|
+
.helper {
|
|
69
|
+
color: var(--input-helper, var(--muted-foreground, oklch(0.556 0 0)));
|
|
70
|
+
}
|
|
71
|
+
.error {
|
|
72
|
+
color: var(
|
|
73
|
+
--input-error-text,
|
|
74
|
+
var(--destructive, oklch(0.577 0.245 27.325))
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
`}get controlNoun(){return"field"}get control(){return this.renderRoot?.querySelector("input, textarea, select")??null}get describedBy(){return this.error?"wmcp-error":this.helperText?"wmcp-helper":void 0}connectedCallback(){super.connectedCallback(),this.syncFormValue(),this.addEventListener("invalid",this.onInvalid),this.validate(!1),this.expose&&this.registerTool()}getFormValue(){return this.value}syncFormValue(){this.internals.setFormValue(this.getFormValue())}get validationValue(){return this.value}get isEmpty(){return this.value===""}get requiredMessageDefault(){return"This field is required."}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("invalid",this.onInvalid),this.toolDisposer(),this.toolDisposer=()=>{}}updated(t){this.syncFormValue(),this.expose&&(t.has("expose")||t.has("name")||t.has("toolName")||t.has("toolDescription"))&&this.registerTool()}get resolvedToolName(){return this.toolName||`fill_${this.name||this.controlNoun}`}registerTool(){this.toolDisposer();let t=this.label||this.name||this.controlNoun;this.toolDisposer=Ne({name:this.resolvedToolName,description:this.toolDescription||`Set the value of the "${t}" field.`,inputSchema:this.toolInputSchema(),execute:async r=>(await this.applyAgentValue(r),{content:[{type:"text",text:this.error?`Set "${t}" but validation failed: ${this.error}`:`Set "${t}" to "${this.stateDescription()}".`}],isError:!!this.error})})}async applyAgentValue(t){let r=t.value;await this.setValueFromAgent(r==null?"":String(r))}stateDescription(){return this.value}toolInputSchema(){return{type:"object",properties:{value:{type:"string",description:this.label||this.name||"The value to set."}},required:["value"]}}async setValueFromAgent(t){this.value=t,await this.validate(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}async onInput(t){this.value=t.target.value,await this.validate()}async computeValidity(){if(this.required&&this.isEmpty)return{valid:!1,message:this.requiredMessage||this.requiredMessageDefault,flags:{valueMissing:!0}};if(Me(this.schema)){let t=await Pe(this.schema,this.validationValue);if(!t.valid)return{valid:!1,message:t.errors[0]??"Invalid value",flags:{customError:!0}}}return{valid:!0,message:"",flags:{}}}async validate(t=!0){let{valid:r,message:s,flags:o}=await this.computeValidity();return r?this.internals.setValidity({}):this.internals.setValidity(o,s,this.control??void 0),t&&(this.error=r?"":s,this.toggleAttribute("invalid",!r)),r}formResetCallback(){this.value="",this.error="",this.toggleAttribute("invalid",!1),this.validate(!1)}renderMessage(){return this.error?b`<span id="wmcp-error" class="message error" role="alert"
|
|
78
|
+
>${this.error}</span
|
|
79
|
+
>`:this.helperText?b`<span id="wmcp-helper" class="message helper"
|
|
80
|
+
>${this.helperText}</span
|
|
81
|
+
>`:h}render(){return b`
|
|
82
|
+
${this.label?b`<label for="control">${this.label}</label>`:h}
|
|
83
|
+
${this.renderControl()}
|
|
84
|
+
${this.renderMessage()}
|
|
85
|
+
`}};v([f()],p.prototype,"label",2),v([f()],p.prototype,"name",2),v([f()],p.prototype,"value",2),v([f()],p.prototype,"placeholder",2),v([f({type:Boolean,reflect:!0})],p.prototype,"required",2),v([f({type:Boolean,reflect:!0})],p.prototype,"disabled",2),v([f({attribute:"helper-text"})],p.prototype,"helperText",2),v([f({attribute:"required-message"})],p.prototype,"requiredMessage",2),v([f({type:Boolean})],p.prototype,"expose",2),v([f({attribute:"tool-name"})],p.prototype,"toolName",2),v([f({attribute:"tool-description"})],p.prototype,"toolDescription",2),v([f({attribute:!1})],p.prototype,"schema",2),v([Y()],p.prototype,"error",2);var q=class extends p{constructor(){super(...arguments);this.type="text"}static{this.tagName="wmcp-input"}static{this.styles=[p.styles,k,$`
|
|
86
|
+
.control {
|
|
87
|
+
height: var(--input-height-md, 2.25rem);
|
|
88
|
+
}
|
|
89
|
+
`]}get controlNoun(){return"input"}toolInputSchema(){return{type:"object",properties:{value:{type:this.type==="number"?"number":"string",description:this.label||this.name||"The value to set."}},required:["value"]}}renderControl(){return b`
|
|
90
|
+
<input
|
|
91
|
+
id="control"
|
|
92
|
+
class="control"
|
|
93
|
+
part="control"
|
|
94
|
+
.type=${this.type}
|
|
95
|
+
.value=${this.value}
|
|
96
|
+
placeholder=${this.placeholder||h}
|
|
97
|
+
?required=${this.required}
|
|
98
|
+
?disabled=${this.disabled}
|
|
99
|
+
aria-invalid=${this.error?"true":"false"}
|
|
100
|
+
aria-describedby=${this.describedBy??h}
|
|
101
|
+
@input=${this.onInput}
|
|
102
|
+
/>
|
|
103
|
+
`}};v([f()],q.prototype,"type",2);var F=class extends p{constructor(){super(...arguments);this.rows=3}static{this.tagName="wmcp-textarea"}static{this.styles=[p.styles,k,$`
|
|
104
|
+
.control {
|
|
105
|
+
min-height: var(--textarea-min-height, 4.5rem);
|
|
106
|
+
resize: vertical;
|
|
107
|
+
}
|
|
108
|
+
`]}get controlNoun(){return"textarea"}renderControl(){return b`
|
|
109
|
+
<textarea
|
|
110
|
+
id="control"
|
|
111
|
+
class="control"
|
|
112
|
+
part="control"
|
|
113
|
+
rows=${this.rows}
|
|
114
|
+
.value=${this.value}
|
|
115
|
+
placeholder=${this.placeholder||h}
|
|
116
|
+
?required=${this.required}
|
|
117
|
+
?disabled=${this.disabled}
|
|
118
|
+
aria-invalid=${this.error?"true":"false"}
|
|
119
|
+
aria-describedby=${this.describedBy??h}
|
|
120
|
+
@input=${this.onInput}
|
|
121
|
+
></textarea>
|
|
122
|
+
`}};v([f({type:Number})],F.prototype,"rows",2);var Lt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},kt=i=>(...e)=>({_$litDirective$:i,values:e}),Le=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:cr}=Ot,It=i=>i;var Ut=()=>document.createComment(""),Z=(i,e,t)=>{let r=i._$AA.parentNode,s=e===void 0?i._$AB:e._$AA;if(t===void 0){let o=r.insertBefore(Ut(),s),n=r.insertBefore(Ut(),s);t=new cr(o,n,i,i.options)}else{let o=t._$AB.nextSibling,n=t._$AM,l=n!==i;if(l){let a;t._$AQ?.(i),t._$AM=i,t._$AP!==void 0&&(a=i._$AU)!==n._$AU&&t._$AP(a)}if(o!==s||l){let a=t._$AA;for(;a!==o;){let m=It(a).nextSibling;It(r).insertBefore(a,s),a=m}}}return t},I=(i,e,t=i)=>(i._$AI(e,t),i),hr={},Dt=(i,e=hr)=>i._$AH=e,Ht=i=>i._$AH,ke=i=>{i._$AR(),i._$AA.remove()};var Wt=(i,e,t)=>{let r=new Map;for(let s=e;s<=t;s++)r.set(i[s],s);return r},Ie=kt(class extends Le{constructor(i){if(super(i),i.type!==Lt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let s=[],o=[],n=0;for(let l of i)s[n]=r?r(l,n):n,o[n]=t(l,n),n++;return{values:o,keys:s}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){let s=Ht(i),{values:o,keys:n}=this.dt(e,t,r);if(!Array.isArray(s))return this.ut=n,o;let l=this.ut??=[],a=[],m,_,c=0,u=s.length-1,d=0,y=o.length-1;for(;c<=u&&d<=y;)if(s[c]===null)c++;else if(s[u]===null)u--;else if(l[c]===n[d])a[d]=I(s[c],o[d]),c++,d++;else if(l[u]===n[y])a[y]=I(s[u],o[y]),u--,y--;else if(l[c]===n[y])a[y]=I(s[c],o[y]),Z(i,a[y+1],s[c]),c++,y--;else if(l[u]===n[d])a[d]=I(s[u],o[d]),Z(i,s[c],s[u]),u--,d++;else if(m===void 0&&(m=Wt(n,d,y),_=Wt(l,c,u)),m.has(l[c]))if(m.has(l[u])){let w=_.get(n[d]),g=w!==void 0?s[w]:null;if(g===null){let A=Z(i,s[c]);I(A,o[d]),a[d]=A}else a[d]=I(g,o[d]),Z(i,s[c],g),s[w]=null;d++}else ke(s[u]),u--;else ke(s[c]),c++;for(;d<=y;){let w=Z(i,a[y+1]);I(w,o[d]),a[d++]=w}for(;c<=u;){let w=s[c++];w!==null&&ke(w)}return this.ut=n,Dt(i,a),M}});function tt(i){return Array.isArray(i.options)}var U=class extends p{constructor(){super(...arguments);this.options=[];this.resolvedOptions=[]}static{this.tagName="wmcp-select"}static{this.styles=[p.styles,k,$`
|
|
123
|
+
.control {
|
|
124
|
+
height: var(--input-height-md, 2.25rem);
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
.control:disabled {
|
|
128
|
+
cursor: not-allowed;
|
|
129
|
+
}
|
|
130
|
+
`]}get controlNoun(){return"select"}connectedCallback(){this.syncOptions(),super.connectedCallback(),this.optionObserver=new MutationObserver(()=>this.syncOptions()),this.optionObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.optionObserver?.disconnect(),this.optionObserver=void 0}willUpdate(t){t.has("options")&&this.syncOptions()}updated(t){super.updated(t),this.expose&&t.has("resolvedOptions")&&this.registerTool()}syncOptions(){this.resolvedOptions=this.options.length>0?this.options:this.readDeclarativeOptions()}readDeclarativeOptions(){let t=s=>({value:s.value,label:s.textContent?.trim()||s.value,disabled:s.disabled}),r=[];for(let s of Array.from(this.children))s instanceof HTMLOptGroupElement?r.push({label:s.label,options:Array.from(s.querySelectorAll("option")).map(t)}):s instanceof HTMLOptionElement&&r.push(t(s));return r}flatOptions(){return this.resolvedOptions.flatMap(t=>tt(t)?t.options:[t])}toolInputSchema(){return{type:"object",properties:{value:{type:"string",enum:this.flatOptions().map(t=>t.value),description:this.label||this.name||"The option value to select."}},required:["value"]}}renderOption(t){return b`<option
|
|
131
|
+
value=${t.value}
|
|
132
|
+
?disabled=${t.disabled??!1}
|
|
133
|
+
?selected=${t.value===this.value}
|
|
134
|
+
>
|
|
135
|
+
${t.label}
|
|
136
|
+
</option>`}renderControl(){return b`
|
|
137
|
+
<select
|
|
138
|
+
id="control"
|
|
139
|
+
class="control"
|
|
140
|
+
part="control"
|
|
141
|
+
?required=${this.required}
|
|
142
|
+
?disabled=${this.disabled}
|
|
143
|
+
aria-invalid=${this.error?"true":"false"}
|
|
144
|
+
aria-describedby=${this.describedBy??h}
|
|
145
|
+
@change=${this.onInput}
|
|
146
|
+
>
|
|
147
|
+
${this.placeholder?b`<option value="" disabled ?selected=${!this.value}>
|
|
148
|
+
${this.placeholder}
|
|
149
|
+
</option>`:h}
|
|
150
|
+
${Ie(this.resolvedOptions,(t,r)=>tt(t)?`g:${t.label}:${r}`:`o:${t.value}`,t=>tt(t)?b`<optgroup label=${t.label}>
|
|
151
|
+
${t.options.map(r=>this.renderOption(r))}
|
|
152
|
+
</optgroup>`:this.renderOption(t))}
|
|
153
|
+
</select>
|
|
154
|
+
`}};v([f({attribute:!1})],U.prototype,"options",2),v([Y()],U.prototype,"resolvedOptions",2);var G=class extends p{constructor(){super();this.checked=!1;this.defaultChecked=!1;this.value="on"}static{this.tagName="wmcp-checkbox"}static{this.styles=[p.styles,$`
|
|
155
|
+
.row {
|
|
156
|
+
display: inline-flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: var(--input-gap-icon, 0.5rem);
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
font-weight: 400;
|
|
161
|
+
}
|
|
162
|
+
.row:has(.control:disabled) {
|
|
163
|
+
cursor: not-allowed;
|
|
164
|
+
color: var(
|
|
165
|
+
--input-text-disabled,
|
|
166
|
+
var(--muted-foreground, oklch(0.556 0 0))
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
.control {
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
width: var(--checkbox-size, 1.05rem);
|
|
172
|
+
height: var(--checkbox-size, 1.05rem);
|
|
173
|
+
margin: 0;
|
|
174
|
+
accent-color: var(--checkbox-accent, var(--primary, oklch(0.205 0 0)));
|
|
175
|
+
cursor: inherit;
|
|
176
|
+
}
|
|
177
|
+
.control:focus-visible {
|
|
178
|
+
outline: none;
|
|
179
|
+
border-radius: 0.25rem;
|
|
180
|
+
box-shadow: 0 0 0 var(--ring-width, 3px)
|
|
181
|
+
color-mix(in oklch, var(--ring, oklch(0.708 0 0)) 40%, transparent);
|
|
182
|
+
}
|
|
183
|
+
.label-text {
|
|
184
|
+
font-size: var(--input-font-size, 0.875rem);
|
|
185
|
+
color: var(--input-text, var(--foreground, oklch(0.145 0 0)));
|
|
186
|
+
}
|
|
187
|
+
`]}get controlNoun(){return"checkbox"}connectedCallback(){this.defaultChecked=this.checked,super.connectedCallback()}getFormValue(){return this.checked?this.value:null}get validationValue(){return this.checked}get isEmpty(){return!this.checked}get requiredMessageDefault(){return"Please check this box."}toolInputSchema(){return{type:"object",properties:{checked:{type:"boolean",description:this.label||this.name||"Whether the box is checked."}},required:["checked"]}}async applyAgentValue(t){this.checked=!!t.checked,await this.validate(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}stateDescription(){return this.checked?"checked":"unchecked"}formResetCallback(){this.checked=this.defaultChecked,this.error="",this.toggleAttribute("invalid",!1),this.validate(!1)}async onToggle(t){this.checked=t.target.checked,await this.validate()}renderControl(){return b`
|
|
188
|
+
<input
|
|
189
|
+
id="control"
|
|
190
|
+
class="control"
|
|
191
|
+
part="control"
|
|
192
|
+
type="checkbox"
|
|
193
|
+
.checked=${this.checked}
|
|
194
|
+
?required=${this.required}
|
|
195
|
+
?disabled=${this.disabled}
|
|
196
|
+
aria-invalid=${this.error?"true":"false"}
|
|
197
|
+
aria-describedby=${this.describedBy??h}
|
|
198
|
+
@change=${this.onToggle}
|
|
199
|
+
/>
|
|
200
|
+
`}render(){return b`
|
|
201
|
+
<label class="row">
|
|
202
|
+
${this.renderControl()}
|
|
203
|
+
${this.label?b`<span class="label-text">${this.label}</span>`:h}
|
|
204
|
+
</label>
|
|
205
|
+
${this.renderMessage()}
|
|
206
|
+
`}};v([f({type:Boolean,reflect:!0})],G.prototype,"checked",2);var dr=0,X=class extends HTMLElement{static{this.tagName="wmcp-radio"}get value(){return this.getAttribute("value")??""}get label(){return this.getAttribute("label")??this.textContent?.trim()??""}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.style.display="none"}},D=class extends p{constructor(){super(...arguments);this.options=[];this.resolvedOptions=[];this.groupName=`wmcp-radio-${++dr}`}static{this.tagName="wmcp-radio-group"}static{this.styles=[p.styles,$`
|
|
207
|
+
.group-label {
|
|
208
|
+
font-size: var(--input-font-size-label, 0.875rem);
|
|
209
|
+
font-weight: var(--input-font-weight-label, 500);
|
|
210
|
+
color: var(--input-label, var(--foreground, oklch(0.145 0 0)));
|
|
211
|
+
}
|
|
212
|
+
.group {
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: var(--input-gap-label, 0.375rem);
|
|
216
|
+
}
|
|
217
|
+
.row {
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: var(--input-gap-icon, 0.5rem);
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
font-weight: 400;
|
|
223
|
+
}
|
|
224
|
+
.row:has(.control:disabled) {
|
|
225
|
+
cursor: not-allowed;
|
|
226
|
+
color: var(
|
|
227
|
+
--input-text-disabled,
|
|
228
|
+
var(--muted-foreground, oklch(0.556 0 0))
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
.control {
|
|
232
|
+
box-sizing: border-box;
|
|
233
|
+
width: var(--radio-size, 1.05rem);
|
|
234
|
+
height: var(--radio-size, 1.05rem);
|
|
235
|
+
margin: 0;
|
|
236
|
+
accent-color: var(--radio-accent, var(--primary, oklch(0.205 0 0)));
|
|
237
|
+
cursor: inherit;
|
|
238
|
+
}
|
|
239
|
+
.control:focus-visible {
|
|
240
|
+
outline: none;
|
|
241
|
+
border-radius: 50%;
|
|
242
|
+
box-shadow: 0 0 0 var(--ring-width, 3px)
|
|
243
|
+
color-mix(in oklch, var(--ring, oklch(0.708 0 0)) 40%, transparent);
|
|
244
|
+
}
|
|
245
|
+
.label-text {
|
|
246
|
+
font-size: var(--input-font-size, 0.875rem);
|
|
247
|
+
color: var(--input-text, var(--foreground, oklch(0.145 0 0)));
|
|
248
|
+
}
|
|
249
|
+
`]}get controlNoun(){return"radio"}connectedCallback(){this.syncOptions(),super.connectedCallback(),this.optionObserver=new MutationObserver(()=>this.syncOptions()),this.optionObserver.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),this.optionObserver?.disconnect(),this.optionObserver=void 0}willUpdate(t){t.has("options")&&this.syncOptions()}updated(t){super.updated(t),this.expose&&t.has("resolvedOptions")&&this.registerTool()}syncOptions(){this.resolvedOptions=this.options.length>0?this.options:this.readDeclarativeOptions()}readDeclarativeOptions(){return Array.from(this.querySelectorAll(":scope > wmcp-radio")).map(t=>({value:t.getAttribute("value")??"",label:t.getAttribute("label")??t.textContent?.trim()??"",disabled:t.hasAttribute("disabled")}))}toolInputSchema(){return{type:"object",properties:{value:{type:"string",enum:this.resolvedOptions.map(t=>t.value),description:this.label||this.name||"The option value to select."}},required:["value"]}}async onSelect(t){this.value=t.target.value,await this.validate()}renderControl(){return b`
|
|
250
|
+
<div
|
|
251
|
+
class="group"
|
|
252
|
+
role="radiogroup"
|
|
253
|
+
aria-labelledby=${this.label?"group-label":h}
|
|
254
|
+
aria-describedby=${this.describedBy??h}
|
|
255
|
+
aria-invalid=${this.error?"true":"false"}
|
|
256
|
+
>
|
|
257
|
+
${Ie(this.resolvedOptions,t=>t.value,t=>b`
|
|
258
|
+
<label class="row">
|
|
259
|
+
<input
|
|
260
|
+
type="radio"
|
|
261
|
+
class="control"
|
|
262
|
+
part="control"
|
|
263
|
+
name=${this.groupName}
|
|
264
|
+
value=${t.value}
|
|
265
|
+
?disabled=${t.disabled??this.disabled}
|
|
266
|
+
.checked=${t.value===this.value}
|
|
267
|
+
@change=${this.onSelect}
|
|
268
|
+
/>
|
|
269
|
+
<span class="label-text">${t.label}</span>
|
|
270
|
+
</label>
|
|
271
|
+
`)}
|
|
272
|
+
</div>
|
|
273
|
+
`}render(){return b`
|
|
274
|
+
${this.label?b`<span id="group-label" class="group-label">${this.label}</span>`:h}
|
|
275
|
+
${this.renderControl()}
|
|
276
|
+
${this.renderMessage()}
|
|
277
|
+
`}};v([f({attribute:!1})],D.prototype,"options",2),v([Y()],D.prototype,"resolvedOptions",2);var pr=[q,F,U,G,X,D];function Ue(){if(!(typeof customElements>"u"))for(let i of pr)customElements.get(i.tagName)||customElements.define(i.tagName,i)}Ue();return qt(ur);})();
|
|
278
|
+
/*! Bundled license information:
|
|
279
|
+
|
|
280
|
+
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
|
281
|
+
@lit-labs/ssr-dom-shim/lib/events.js:
|
|
282
|
+
(**
|
|
283
|
+
* @license
|
|
284
|
+
* Copyright 2023 Google LLC
|
|
285
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
286
|
+
*)
|
|
287
|
+
|
|
288
|
+
@lit-labs/ssr-dom-shim/lib/css.js:
|
|
289
|
+
@lit-labs/ssr-dom-shim/lib/observers.js:
|
|
290
|
+
(**
|
|
291
|
+
* @license
|
|
292
|
+
* Copyright 2024 Google LLC
|
|
293
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
294
|
+
*)
|
|
295
|
+
|
|
296
|
+
@lit-labs/ssr-dom-shim/index.js:
|
|
297
|
+
@lit/reactive-element/node/css-tag.js:
|
|
298
|
+
(**
|
|
299
|
+
* @license
|
|
300
|
+
* Copyright 2019 Google LLC
|
|
301
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
302
|
+
*)
|
|
303
|
+
|
|
304
|
+
lit-html/node/lit-html.js:
|
|
305
|
+
lit-element/lit-element.js:
|
|
306
|
+
@lit/reactive-element/node/decorators/custom-element.js:
|
|
307
|
+
@lit/reactive-element/node/decorators/property.js:
|
|
308
|
+
@lit/reactive-element/node/decorators/state.js:
|
|
309
|
+
@lit/reactive-element/node/decorators/event-options.js:
|
|
310
|
+
@lit/reactive-element/node/decorators/base.js:
|
|
311
|
+
@lit/reactive-element/node/decorators/query.js:
|
|
312
|
+
@lit/reactive-element/node/decorators/query-all.js:
|
|
313
|
+
@lit/reactive-element/node/decorators/query-async.js:
|
|
314
|
+
@lit/reactive-element/node/decorators/query-assigned-nodes.js:
|
|
315
|
+
lit-html/node/directive.js:
|
|
316
|
+
lit-html/node/directives/repeat.js:
|
|
317
|
+
(**
|
|
318
|
+
* @license
|
|
319
|
+
* Copyright 2017 Google LLC
|
|
320
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
321
|
+
*)
|
|
322
|
+
|
|
323
|
+
lit-html/node/is-server.js:
|
|
324
|
+
(**
|
|
325
|
+
* @license
|
|
326
|
+
* Copyright 2022 Google LLC
|
|
327
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
328
|
+
*)
|
|
329
|
+
|
|
330
|
+
@lit/reactive-element/node/decorators/query-assigned-elements.js:
|
|
331
|
+
(**
|
|
332
|
+
* @license
|
|
333
|
+
* Copyright 2021 Google LLC
|
|
334
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
335
|
+
*)
|
|
336
|
+
|
|
337
|
+
lit-html/node/directive-helpers.js:
|
|
338
|
+
(**
|
|
339
|
+
* @license
|
|
340
|
+
* Copyright 2020 Google LLC
|
|
341
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
342
|
+
*)
|
|
343
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webmcpui/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Framework-agnostic WebMCP-native custom elements. Form primitives with Standard Schema validation and imperative WebMCP tool exposure.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Gary Pfaff (Pfaff Digital)",
|
|
7
|
+
"homepage": "https://webmcpui.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/webmcpui/webmcpui.git",
|
|
11
|
+
"directory": "packages/core"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/webmcpui/webmcpui/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"webmcp",
|
|
18
|
+
"web-components",
|
|
19
|
+
"custom-elements",
|
|
20
|
+
"ai-agents",
|
|
21
|
+
"modelcontext",
|
|
22
|
+
"forms",
|
|
23
|
+
"standard-schema",
|
|
24
|
+
"lit"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./testing": {
|
|
33
|
+
"types": "./dist/testing.d.ts",
|
|
34
|
+
"import": "./dist/testing.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"unpkg": "./dist/webmcpui.global.js",
|
|
38
|
+
"jsdelivr": "./dist/webmcpui.global.js",
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"test": "wtr",
|
|
46
|
+
"test:watch": "wtr --watch",
|
|
47
|
+
"test:smoke": "node scripts/smoke.mjs",
|
|
48
|
+
"clean": "rm -rf dist"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"lit": "^3.2.1"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@open-wc/testing": "^4.0.0",
|
|
58
|
+
"@web/dev-server-esbuild": "^1.0.5",
|
|
59
|
+
"@web/test-runner": "^0.20.2",
|
|
60
|
+
"@web/test-runner-playwright": "^0.11.1",
|
|
61
|
+
"playwright": "^1.60.0",
|
|
62
|
+
"tsup": "^8.3.5",
|
|
63
|
+
"typescript": "^5.7.2"
|
|
64
|
+
}
|
|
65
|
+
}
|