@wcstack/eyedropper 4.14.0 → 4.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auto.min.js CHANGED
@@ -1,2 +1,2 @@
1
- const e={tagNames:{eyedropper:"wcs-eyedropper"}};var t="@wcstack/eyedropper",i="4.14.0";class r{laneKey;policy;_ownerGeneration=0;_latestEpoch=0;_nextOperationId=1;_activeOperationId=void 0;_activeOperationIds=new Set;_queue=[];_inFlightCount=0;_terminal=new Map;_claimedOutcome=new Map;_controllers=new Map;_attempts=new Map;_withSignal;_trace;constructor(e,t,i={}){this.laneKey=e,this.policy=t,this._withSignal=i.withSignal??!1,this._trace=i.trace}get ownerGeneration(){return this._ownerGeneration}get inFlightCount(){return this._inFlightCount}get latestEpoch(){return this._latestEpoch}get activeOperationId(){return this._activeOperationId}begin(){let e;switch(this.policy){case"latest":e=++this._latestEpoch,void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);break;case"exhaust":if(void 0!==this._activeOperationId)return null}const t=this._nextOperationId++,i={operationId:t,ownerGeneration:this._ownerGeneration,laneKey:this.laneKey,policy:this.policy,supersedeEpoch:e};switch(this.policy){case"latest":case"exhaust":this._activeOperationId=t;break;case"queue":this._queue.push(i),void 0===this._activeOperationId&&(this._activeOperationId=t);break;case"overlap":this._activeOperationIds.add(t)}this._inFlightCount+=1,this._attempts.set(t,1);const r=this._makeAttempt(t,1);return void 0!==this._trace&&this._trace({type:"io:operation-started",operationId:t,laneKey:this.laneKey,policy:this.policy}),{ticket:i,attempt:r}}retry(e){if(e.ownerGeneration!==this._ownerGeneration)return null;if(this._terminal.has(e.operationId))return null;const t=this._attempts.get(e.operationId);if(void 0===t)return null;const i=t+1;this._attempts.set(e.operationId,i),this._releaseController(e.operationId);const r=this._makeAttempt(e.operationId,i);return void 0!==this._trace&&this._trace({type:"io:operation-retried",operationId:e.operationId,laneKey:this.laneKey,attempt:i}),r}canCommit(e){if(e.ownerGeneration!==this._ownerGeneration)return!1;const t=this._terminal.get(e.operationId);return(void 0===t||"committing"===t)&&this._isEligible(e)}claimTerminal(e,t){return e.ownerGeneration===this._ownerGeneration&&(!this._terminal.has(e.operationId)&&(!!this._isEligible(e)&&(this._terminal.set(e.operationId,"committing"),this._claimedOutcome.set(e.operationId,t),!0)))}claimedOutcome(e){return this._claimedOutcome.get(e.operationId)}finalize(e){const t=e.operationId,i=this._terminal.get(t);if(void 0!==i&&"committing"!==i)return;let r;r="committing"===i?this._claimedOutcome.get(t)??"stale":"stale",this._terminal.set(t,r),this._claimedOutcome.delete(t),this._releaseController(t),this._attempts.delete(t),this._inFlightCount>0&&(this._inFlightCount-=1),this._advanceBookkeeping(t),void 0!==this._trace&&("stale"===r?this._trace({type:"io:stale-dropped",operationId:t,laneKey:this.laneKey}):this._trace({type:"io:operation-settled",operationId:t,laneKey:this.laneKey,outcome:r}))}signalOf(e){return this._controllers.get(e.operationId)?.signal}abort(e){this._abortController(e.operationId)}abortActive(){void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);for(const e of this._activeOperationIds)this._abortController(e)}disposeOwner(){this._ownerGeneration+=1;for(const e of Array.from(this._controllers.keys()))this._abortController(e),this._releaseController(e);for(const e of Array.from(this._attempts.keys()))this._terminal.has(e)||this._terminal.set(e,"stale"),this._claimedOutcome.delete(e),this._attempts.delete(e),void 0!==this._trace&&this._trace({type:"io:stale-dropped",operationId:e,laneKey:this.laneKey});this._activeOperationId=void 0,this._activeOperationIds.clear(),this._queue.length=0,this._inFlightCount=0}_makeAttempt(e,t){let i;if(this._withSignal&&"function"==typeof AbortController){const t=new AbortController;this._controllers.set(e,t),i=t.signal}return{operationId:e,attempt:t,signal:i}}_isEligible(e){switch(this.policy){case"latest":return e.supersedeEpoch===this._latestEpoch;case"queue":case"exhaust":return this._activeOperationId===e.operationId;case"overlap":return this._activeOperationIds.has(e.operationId)}}_advanceBookkeeping(e){switch(this.policy){case"latest":case"exhaust":this._activeOperationId===e&&(this._activeOperationId=void 0);break;case"queue":{const t=this._queue.filter(t=>t.operationId!==e);this._queue.length=0,this._queue.push(...t),this._activeOperationId=this._queue.length>0?this._queue[0].operationId:void 0;break}case"overlap":this._activeOperationIds.delete(e)}}_abortController(e){const t=this._controllers.get(e);void 0===t||t.signal.aborted||t.abort()}_releaseController(e){this._controllers.delete(e)}}function o(e,t){const i=new Map,r=t=>{const i=e.get(t);return void 0===i?"unknown":i.probe()?"available":"missing"};let o=!0;for(const e of t.required){const t=r(e);i.set(e,t),"available"!==t&&(o=!1)}let n=!0;for(const e of t.optional??[]){const t=r(e);i.set(e,t),"available"!==t&&(n=!1)}const s=o?n?"ready":"degraded":"idle",a=[...t.required,...t.optional??[]],l=a.some(t=>!0===e.get(t)?.requiresSecureContext),c=a.some(t=>!0===e.get(t)?.requiresUserActivation),h=l?!0===globalThis.isSecureContext?"satisfied":"required":"not-applicable",d=c?"required":"not-applicable";return{availability:i,permission:t.permission??"not-applicable",readiness:s,activity:t.activity??"inactive",preconditions:{secureContext:h,userActivation:d},epoch:t.epoch??0,lastError:t.lastError}}function n(e,t){return t.every(t=>"available"===e.availability.get(t))}const s="capability-missing",a="pick-failed",l=new Map([["web.eyedropper",{probe:()=>"function"==typeof globalThis.EyeDropper,compatKey:"api.EyeDropper"}]]);class c extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"value",event:"wcs-eyedropper:complete",semantics:"state",getter:e=>e.detail.value},{name:"loading",event:"wcs-eyedropper:loading-changed",semantics:"state"},{name:"error",event:"wcs-eyedropper:error",semantics:"state"},{name:"cancelled",event:"wcs-eyedropper:cancelled-changed",semantics:"state"},{name:"errorInfo",event:"wcs-eyedropper:error-info-changed",semantics:"state"}],commands:[{name:"open",async:!0},{name:"abort"}]};static REQUIRED_CAPABILITIES=["web.eyedropper"];_target;_value=null;_loading=!1;_error=null;_cancelled=!1;_errorInfo=null;_lane=new r("eyedropper","latest",{withSignal:!0});_ready=Promise.resolve();constructor(e){super(),this._target=e??this}get ready(){return this._ready}get value(){return this._value}get loading(){return this._loading}get error(){return this._error}get cancelled(){return this._cancelled}get errorInfo(){return this._errorInfo}get supported(){return n(this.platformAssessment,c.REQUIRED_CAPABILITIES)}get platformAssessment(){return o(l,{required:c.REQUIRED_CAPABILITIES,activity:this._loading?"active":"inactive",lastError:this._errorInfo??void 0})}observe(){return this._ready}dispose(){this._lane.disposeOwner(),this._setLoading(!1)}_commitStep(e,t){this._lane.canCommit(e)&&t()}_setLoading(e){this._loading!==e&&(this._loading=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:loading-changed",{detail:e,bubbles:!0})))}_setValue(e){this._value!==e&&(this._value=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:complete",{detail:{value:e},bubbles:!0})))}_setError(e){this._error!==e&&(this._error=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:error",{detail:e,bubbles:!0})))}_setCancelled(e){this._cancelled!==e&&(this._cancelled=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:cancelled-changed",{detail:e,bubbles:!0})))}_setErrorInfo(e,t,i,r,o){this._commitErrorInfo({code:e,phase:t,recoverable:i,message:r,...void 0===o?{}:{capabilityId:o}})}_commitErrorInfo(e){this._errorInfo!==e&&(this._errorInfo=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:error-info-changed",{detail:e,bubbles:!0})))}abort(){this._lane.abortActive()}async open(){const e=this.platformAssessment;if(!n(e,c.REQUIRED_CAPABILITIES)){const t=c.REQUIRED_CAPABILITIES.find(t=>"available"!==e.availability.get(t)),i="EyeDropper API is not supported in this browser.";return this._setErrorInfo(s,"start",!1,i,t),this._setError({message:i}),null}const t=this._lane.begin(),{ticket:i,attempt:r}=t,o=r.signal,l=globalThis.EyeDropper;this._commitStep(i,()=>this._setLoading(!0)),this._commitStep(i,()=>{this._commitErrorInfo(null),this._setError(null),this._setCancelled(!1)});try{const e=await(new l).open({signal:o});return this._lane.claimTerminal(i,"success")?(this._commitStep(i,()=>this._setValue(e)),this._commitStep(i,()=>this._setLoading(!1)),this._lane.finalize(i),e):null}catch(e){const t="AbortError"===e?.name;return this._lane.claimTerminal(i,t?"aborted":"error")?(this._commitStep(i,()=>{if(t)this._setCancelled(!0);else{const t=String(e?.message??"Color pick failed.");this._setErrorInfo(a,"execute",!0,t),this._setError(e??{message:t})}}),this._commitStep(i,()=>this._setLoading(!1)),this._lane.finalize(i),null):null}}}function h(e,t){let i=Object.getPrototypeOf(e);for(;null!==i;){const e=Object.getOwnPropertyDescriptor(i,t);if(void 0!==e)return"function"==typeof e.get||"function"==typeof e.set;i=Object.getPrototypeOf(i)}return!1}const d=new WeakSet;function p(e,t,i){if(d.has(e))return;d.add(e);const r=e.localName??"element";console.warn(`[wcs/input-as-attribute] <${r}> has the attribute ${t}="${i}": an object was written as an attribute, so the element did not receive it. A framework does that when the property is set before the element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, or assign the property through a ref (Vue: .prop). (Said once per element.)`,e)}class _ extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...c.wcBindable,inputs:[],commands:c.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new c(this),this._internals=this._initInternals(),this._wireStates({"wcs-eyedropper:loading-changed":e=>({loading:!0===e}),"wcs-eyedropper:cancelled-changed":e=>({cancelled:!0===e}),"wcs-eyedropper:error":e=>({error:null!=e})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const e=this.attachInternals();return e.states.add("wcs-probe"),e.states.delete("wcs-probe"),e}catch{return null}}_wireStates(e){if(null===this._internals)return;const t=this._internals.states;for(const[i,r]of Object.entries(e))this.addEventListener(i,e=>{const i=this.hasAttribute("debug-states");for(const[o,n]of Object.entries(r(e.detail))){try{n?t.add(o):t.delete(o)}catch{}i&&this.toggleAttribute(`data-wcs-state-${o}`,n)}})}get value(){return this._core.value}get loading(){return this._core.loading}get error(){return this._core.error}get cancelled(){return this._core.cancelled}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}open(){return this._core.open()}abort(){this._core.abort()}connectedCallback(){!function(e){const t=e.constructor?.wcBindable,i=t?.inputs;if(void 0===i)return;const r=e.getAttribute;for(const t of i){const i=t.name,o="function"==typeof r?r.call(e,i.toLowerCase()):null;if(null!==o&&o.startsWith("[object ")&&p(e,i,o),!Object.prototype.hasOwnProperty.call(e,i))continue;if(!h(e,i))continue;const n=e,s=n[i];delete n[i],n[i]=s}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}const u=Symbol.for("wcstack.package"),m=new WeakSet;function g(e,t){Object.defineProperty(e,u,{value:t,configurable:!0})}function v(e,t,i,r,o){if(void 0!==r&&(i===r||i.prototype instanceof r))return;const n=i[u];if(n===o||m.has(e))return;m.add(e);const s=o.slice(0,o.lastIndexOf("@"));console.warn(`[${s}] [wcs/package-twice] <${t}> is already defined by ${n??`another copy of ${s} that does not name its version`}; this copy, ${o}, does nothing. Load each package once.`)}function b(r=customElements){!function(e,t,i){for(const[r,o]of i){const i=e.get(r);void 0===i?(g(o,t),e.define(r,o)):v(e,r,i,o,t)}}(r,`${t}@${i}`,[[e.tagNames.eyedropper,_]])}var f;b(f);
1
+ const e={tagNames:{eyedropper:"wcs-eyedropper"}};var t="@wcstack/eyedropper",r="4.16.0";class i{laneKey;policy;_ownerGeneration=0;_latestEpoch=0;_nextOperationId=1;_activeOperationId=void 0;_activeOperationIds=new Set;_queue=[];_claimedOutcome=new Map;_controllers=new Map;_attempts=new Map;_withSignal;_trace;constructor(e,t,r={}){this.laneKey=e,this.policy=t,this._withSignal=r.withSignal??!1,this._trace=r.trace}get ownerGeneration(){return this._ownerGeneration}get inFlightCount(){return this._attempts.size}get latestEpoch(){return this._latestEpoch}get activeOperationId(){return this._activeOperationId}begin(){let e;switch(this.policy){case"latest":e=++this._latestEpoch,void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);break;case"exhaust":if(void 0!==this._activeOperationId)return null}const t=this._nextOperationId++,r={operationId:t,ownerGeneration:this._ownerGeneration,laneKey:this.laneKey,policy:this.policy,supersedeEpoch:e};switch(this.policy){case"latest":case"exhaust":this._activeOperationId=t;break;case"queue":this._queue.push(r),void 0===this._activeOperationId&&(this._activeOperationId=t);break;case"overlap":this._activeOperationIds.add(t)}this._attempts.set(t,1);const i=this._makeAttempt(t,1);return void 0!==this._trace&&this._trace({type:"io:operation-started",operationId:t,laneKey:this.laneKey,policy:this.policy}),{ticket:r,attempt:i}}retry(e){if(e.ownerGeneration!==this._ownerGeneration)return null;const t=this._attempts.get(e.operationId);if(void 0===t||this._claimedOutcome.has(e.operationId))return null;if(!this._isEligible(e))return null;const r=t+1;this._attempts.set(e.operationId,r),this._releaseController(e.operationId);const i=this._makeAttempt(e.operationId,r);return void 0!==this._trace&&this._trace({type:"io:operation-retried",operationId:e.operationId,laneKey:this.laneKey,attempt:r}),i}canCommit(e){return e.ownerGeneration===this._ownerGeneration&&(!!this._attempts.has(e.operationId)&&this._isEligible(e))}claimTerminal(e,t){return e.ownerGeneration===this._ownerGeneration&&(!(!this._attempts.has(e.operationId)||this._claimedOutcome.has(e.operationId))&&(!!this._isEligible(e)&&(this._claimedOutcome.set(e.operationId,t),!0)))}claimedOutcome(e){return this._claimedOutcome.get(e.operationId)}finalize(e){const t=e.operationId;if(!this._attempts.has(t))return;const r=this._claimedOutcome.get(t)??"stale";this._claimedOutcome.delete(t),this._releaseController(t),this._attempts.delete(t),this._advanceBookkeeping(t),void 0!==this._trace&&("stale"===r?this._trace({type:"io:stale-dropped",operationId:t,laneKey:this.laneKey}):this._trace({type:"io:operation-settled",operationId:t,laneKey:this.laneKey,outcome:r}))}signalOf(e){return this._controllers.get(e.operationId)?.signal}abort(e){this._abortController(e.operationId)}abortActive(){void 0!==this._activeOperationId&&this._abortController(this._activeOperationId);for(const e of this._activeOperationIds)this._abortController(e)}disposeOwner(){this._ownerGeneration+=1;for(const e of Array.from(this._controllers.keys()))this._abortController(e),this._releaseController(e);if(void 0!==this._trace)for(const e of this._attempts.keys())this._trace({type:"io:stale-dropped",operationId:e,laneKey:this.laneKey});this._attempts.clear(),this._claimedOutcome.clear(),this._activeOperationId=void 0,this._activeOperationIds.clear(),this._queue.length=0}_makeAttempt(e,t){let r;if(this._withSignal&&"function"==typeof AbortController){const t=new AbortController;this._controllers.set(e,t),r=t.signal}return{operationId:e,attempt:t,signal:r}}_isEligible(e){switch(this.policy){case"latest":return e.supersedeEpoch===this._latestEpoch;case"queue":case"exhaust":return this._activeOperationId===e.operationId;case"overlap":return this._activeOperationIds.has(e.operationId)}}_advanceBookkeeping(e){switch(this.policy){case"latest":case"exhaust":this._activeOperationId===e&&(this._activeOperationId=void 0);break;case"queue":{const t=this._queue.filter(t=>t.operationId!==e);this._queue.length=0,this._queue.push(...t),this._activeOperationId=this._queue.length>0?this._queue[0].operationId:void 0;break}case"overlap":this._activeOperationIds.delete(e)}}_abortController(e){const t=this._controllers.get(e);void 0===t||t.signal.aborted||t.abort()}_releaseController(e){this._controllers.delete(e)}}function o(e,t){const r=new Map,i=t=>{const r=e.get(t);return void 0===r?"unknown":r.probe()?"available":"missing"};let o=!0;for(const e of t.required){const t=i(e);r.set(e,t),"available"!==t&&(o=!1)}let s=!0;for(const e of t.optional??[]){const t=i(e);r.set(e,t),"available"!==t&&(s=!1)}const n=o?s?"ready":"degraded":"idle",a=[...t.required,...t.optional??[]],c=a.some(t=>!0===e.get(t)?.requiresSecureContext),l=a.some(t=>!0===e.get(t)?.requiresUserActivation),h=c?!0===globalThis.isSecureContext?"satisfied":"required":"not-applicable",d=l?"required":"not-applicable";return{availability:r,permission:t.permission??"not-applicable",readiness:n,activity:t.activity??"inactive",preconditions:{secureContext:h,userActivation:d},epoch:t.epoch??0,lastError:t.lastError}}function s(e,t){return t.every(t=>"available"===e.availability.get(t))}const n="capability-missing",a="pick-failed",c=new Map([["web.eyedropper",{probe:()=>"function"==typeof globalThis.EyeDropper,compatKey:"api.EyeDropper"}]]);class l extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"value",event:"wcs-eyedropper:complete",semantics:"state",getter:e=>e.detail.value},{name:"loading",event:"wcs-eyedropper:loading-changed",semantics:"state"},{name:"error",event:"wcs-eyedropper:error",semantics:"state"},{name:"cancelled",event:"wcs-eyedropper:cancelled-changed",semantics:"state"},{name:"errorInfo",event:"wcs-eyedropper:error-info-changed",semantics:"state"}],commands:[{name:"open",async:!0},{name:"abort"}]};static REQUIRED_CAPABILITIES=["web.eyedropper"];_target;_value=null;_loading=!1;_error=null;_cancelled=!1;_errorInfo=null;_lane=new i("eyedropper","latest",{withSignal:!0});_ready=Promise.resolve();constructor(e){super(),this._target=e??this}get ready(){return this._ready}get value(){return this._value}get loading(){return this._loading}get error(){return this._error}get cancelled(){return this._cancelled}get errorInfo(){return this._errorInfo}get supported(){return s(this.platformAssessment,l.REQUIRED_CAPABILITIES)}get platformAssessment(){return o(c,{required:l.REQUIRED_CAPABILITIES,activity:this._loading?"active":"inactive",lastError:this._errorInfo??void 0})}observe(){return this._ready}dispose(){this._lane.disposeOwner(),this._setLoading(!1)}_commitStep(e,t){this._lane.canCommit(e)&&t()}_setLoading(e){this._loading!==e&&(this._loading=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:loading-changed",{detail:e,bubbles:!0})))}_setValue(e){this._value!==e&&(this._value=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:complete",{detail:{value:e},bubbles:!0})))}_setError(e){this._error!==e&&(this._error=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:error",{detail:e,bubbles:!0})))}_setCancelled(e){this._cancelled!==e&&(this._cancelled=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:cancelled-changed",{detail:e,bubbles:!0})))}_setErrorInfo(e,t,r,i,o){this._commitErrorInfo({code:e,phase:t,recoverable:r,message:i,...void 0===o?{}:{capabilityId:o}})}_commitErrorInfo(e){this._errorInfo!==e&&(this._errorInfo=e,this._target.dispatchEvent(new CustomEvent("wcs-eyedropper:error-info-changed",{detail:e,bubbles:!0})))}abort(){this._lane.abortActive()}async open(){const e=this.platformAssessment;if(!s(e,l.REQUIRED_CAPABILITIES)){const t=l.REQUIRED_CAPABILITIES.find(t=>"available"!==e.availability.get(t)),r="EyeDropper API is not supported in this browser.";return this._setErrorInfo(n,"start",!1,r,t),this._setError({message:r}),null}const t=this._lane.begin(),{ticket:r,attempt:i}=t,o=i.signal,c=globalThis.EyeDropper;this._commitStep(r,()=>this._setLoading(!0)),this._commitStep(r,()=>{this._commitErrorInfo(null),this._setError(null),this._setCancelled(!1)});try{const e=await(new c).open({signal:o});return this._lane.claimTerminal(r,"success")?(this._commitStep(r,()=>this._setValue(e)),this._commitStep(r,()=>this._setLoading(!1)),this._lane.finalize(r),e):null}catch(e){const t="AbortError"===e?.name;return this._lane.claimTerminal(r,t?"aborted":"error")?(this._commitStep(r,()=>{if(t)this._setCancelled(!0);else{const t=String(e?.message??"Color pick failed.");this._setErrorInfo(a,"execute",!0,t),this._setError(e??{message:t})}}),this._commitStep(r,()=>this._setLoading(!1)),this._lane.finalize(r),null):null}}}function h(e,t){let r=Object.getPrototypeOf(e);for(;null!==r;){const e=Object.getOwnPropertyDescriptor(r,t);if(void 0!==e)return"function"==typeof e.get||"function"==typeof e.set;r=Object.getPrototypeOf(r)}return!1}const d=new WeakSet;function p(e,t,r){if(d.has(e))return;d.add(e);const i=e.localName??"element";console.warn(`[wcs/input-as-attribute] <${i}> has the attribute ${t}="${r}": an object was written as an attribute, so the element did not receive it. A framework does that when the property is set before the element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, or assign the property through a ref (Vue: .prop). (Said once per element.)`,e)}class _ extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...l.wcBindable,inputs:[],commands:l.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new l(this),this._internals=this._initInternals(),this._wireStates({"wcs-eyedropper:loading-changed":e=>({loading:!0===e}),"wcs-eyedropper:cancelled-changed":e=>({cancelled:!0===e}),"wcs-eyedropper:error":e=>({error:null!=e})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const e=this.attachInternals();return e.states.add("wcs-probe"),e.states.delete("wcs-probe"),e}catch{return null}}_wireStates(e){if(null===this._internals)return;const t=this._internals.states;for(const[r,i]of Object.entries(e))this.addEventListener(r,e=>{const r=this.hasAttribute("debug-states");for(const[o,s]of Object.entries(i(e.detail))){try{s?t.add(o):t.delete(o)}catch{}r&&this.toggleAttribute(`data-wcs-state-${o}`,s)}})}get value(){return this._core.value}get loading(){return this._core.loading}get error(){return this._core.error}get cancelled(){return this._core.cancelled}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}open(){return this._core.open()}abort(){this._core.abort()}connectedCallback(){!function(e){const t=e.constructor?.wcBindable,r=t?.inputs;if(void 0===r)return;const i=e.getAttribute;for(const t of r){const r=t.name,o="function"==typeof i?i.call(e,r.toLowerCase()):null;if(null!==o&&o.startsWith("[object ")&&p(e,r,o),!Object.prototype.hasOwnProperty.call(e,r))continue;if(!h(e,r))continue;const s=e,n=s[r];delete s[r],s[r]=n}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}const u=Symbol.for("wcstack.package"),m=new WeakSet;function g(e,t){Object.defineProperty(e,u,{value:t,configurable:!0})}function b(e,t,r,i,o){if(void 0!==i&&(r===i||r.prototype instanceof i))return;const s=r[u];if(s===o||m.has(e))return;m.add(e);const n=o.slice(0,o.lastIndexOf("@"));console.warn(`[${n}] [wcs/package-twice] <${t}> is already defined by ${s??`another copy of ${n} that does not name its version`}; this copy, ${o}, does nothing. Load each package once.`)}function v(i=customElements){!function(e,t,r){for(const[i,o]of r){const r=e.get(i);void 0===r?(g(o,t),e.define(i,o)):b(e,i,r,o,t)}}(i,`${t}@${r}`,[[e.tagNames.eyedropper,_]])}var f;v(f);
2
2
  //# sourceMappingURL=auto.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto.min.js","sources":["../../src/config.ts","../../src/core/operationLane.ts","../../src/core/platformCapability.ts","../../src/core/eyedropperCapabilities.ts","../../src/core/EyedropperCore.ts","../../src/protocol/upgradeProperties.ts","../../src/components/Eyedropper.ts","../../src/protocol/defineElement.ts","../../src/registerComponents.ts","../../src/bootstrapEyedropper.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n eyedropper: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n eyedropper: \"wcs-eyedropper\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\n// Note: this is the live, mutable internal config. It is not part of the public\n// package exports (see exports.ts) — only `getConfig()` (a frozen snapshot) is\n// surfaced. `setConfig()` is applied internally via `bootstrapEyedropper()` and\n// is not re-exported from the package root, though a deep path import\n// (`.../src/config.js`) can still reach and mutate it. Accepted as-is for\n// cross-package consistency: every @wcstack package follows this same shape.\n// Use `getConfig()` for a frozen, safe read.\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\n/** A misspelt option would otherwise do nothing: `bootstrapEyedropper` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/eyedropper] bootstrapEyedropper: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/operation-lane.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * operationLane.ts\n *\n * Phase 4 (docs/architecture-hardening/09-remediation-design.md §5, §5.1) の\n * OperationTicket / CommitGuard / terminal CAS を型付き実装した lane プリミティブ。\n * docs/async-execution-model.md §5 が既に規範化した排他モード\n * (latest / queue / exhaust / overlap) を、`AbortController` だけでは防げない\n * 「取消不能な Promise・abort と同時に完了した結果の commit」から守るための\n * 実行時ガードとして具体化する。\n *\n * 配置方針 (§5): 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * 初期 PoC は fetch の `latest` policy から開始した。現在は4 policy 全てを\n * `operationLane.test.ts` が直接検証し、生成コピーを fetch / upload / share /\n * contacts / credential / eyedropper が利用する。lane 自体は promise を実行せず、\n * bookkeeping と guard の状態機械に徹する — 実際の非同期処理は Core が駆動し\n * lane に照合する。\n */\n\n/** §5: 排他モードの語彙。async-execution-model.md §5 の 4 モードに対応 (parallel は予約語・スコープ外)。 */\nexport type LanePolicy = \"latest\" | \"queue\" | \"exhaust\" | \"overlap\";\n\n/** §5: 各 operation の一回限りの終端結果。 */\nexport type TerminalOutcome = \"success\" | \"error\" | \"timeout\" | \"aborted\" | \"stale\";\n\n/** §5: 論理操作 1 件の identity。retry は同じ operationId を再利用する。 */\nexport interface OperationTicket {\n readonly operationId: number;\n /** 発行時に捕捉した I/O Core の observe / reconnect / dispose lifecycle 世代。 */\n readonly ownerGeneration: number;\n readonly laneKey: string;\n readonly policy: LanePolicy;\n /** supersede bookkeeping に使う epoch (latest policy のみ)。 */\n readonly supersedeEpoch?: number;\n}\n\n/** §5: operation の 1 回の試行。retry で attempt++ と resource signal だけ差し替える。 */\nexport interface OperationAttempt {\n readonly operationId: number;\n readonly attempt: number;\n readonly signal?: AbortSignal;\n}\n\n/** §6: DevTools 側 channel へ流す trace(fetch では既定 off・zero-cost)。 */\nexport type OperationTraceEvent =\n | { readonly type: \"io:operation-started\"; readonly operationId: number; readonly laneKey: string; readonly policy: LanePolicy }\n | { readonly type: \"io:operation-retried\"; readonly operationId: number; readonly laneKey: string; readonly attempt: number }\n | { readonly type: \"io:operation-settled\"; readonly operationId: number; readonly laneKey: string; readonly outcome: TerminalOutcome }\n | { readonly type: \"io:stale-dropped\"; readonly operationId: number; readonly laneKey: string };\n\nexport interface OperationLaneOptions {\n /** attempt ごとに AbortController を発行し signal を渡す (fetch/upload 系)。 */\n readonly withSignal?: boolean;\n /**\n * trace subscriber。undefined なら trace record を一切生成しない\n * (§10.3 hook-off zero allocation の gate)。\n */\n readonly trace?: (event: OperationTraceEvent) => void;\n}\n\n/** 内部の終端状態。absence = pending。'committing' は multi-setter commit 中の中間状態。 */\ntype TerminalStatus = \"committing\" | TerminalOutcome;\n\n/**\n * 1 レーン = 独立した排他単位。Core が 1 つ以上所有する (module singleton にしない —\n * 複数 <wcs-fetch> 間で漏れるため)。\n */\nexport class OperationLane {\n readonly laneKey: string;\n readonly policy: LanePolicy;\n\n private _ownerGeneration = 0;\n private _latestEpoch = 0;\n private _nextOperationId = 1;\n // latest / queue / exhaust の単一 active。queue は head を指す。\n private _activeOperationId: number | undefined = undefined;\n // overlap の active set (§5: 内部 bookkeeping のみ・observable 公開はしない)。\n private readonly _activeOperationIds = new Set<number>();\n // queue policy の FIFO。\n private readonly _queue: OperationTicket[] = [];\n private _inFlightCount = 0;\n // opId → 終端状態 (absence = pending)。\n private readonly _terminal = new Map<number, TerminalStatus>();\n // claimTerminal で確定した outcome (finalize が 'committing' を最終値へ移す)。\n private readonly _claimedOutcome = new Map<number, TerminalOutcome>();\n // opId → AbortController (identity は opId が保証。cross-op clobber は構造上起きない)。\n private readonly _controllers = new Map<number, AbortController>();\n // opId → attempt 数。\n private readonly _attempts = new Map<number, number>();\n private readonly _withSignal: boolean;\n private readonly _trace?: (event: OperationTraceEvent) => void;\n\n constructor(laneKey: string, policy: LanePolicy, options: OperationLaneOptions = {}) {\n this.laneKey = laneKey;\n this.policy = policy;\n this._withSignal = options.withSignal ?? false;\n this._trace = options.trace;\n }\n\n get ownerGeneration(): number {\n return this._ownerGeneration;\n }\n\n get inFlightCount(): number {\n return this._inFlightCount;\n }\n\n get latestEpoch(): number {\n return this._latestEpoch;\n }\n\n get activeOperationId(): number | undefined {\n return this._activeOperationId;\n }\n\n /**\n * 新しい要求の到着。arrival policy を適用し ticket + 最初の attempt を発行する。\n * exhaust で実行中の場合だけ null を返す (新要求を ticket 化せず拒否 = 冪等 no-op)。\n */\n begin(): { ticket: OperationTicket; attempt: OperationAttempt } | null {\n let supersedeEpoch: number | undefined;\n switch (this.policy) {\n case \"latest\": {\n // latestEpoch を進め、旧 active を abort (可能なら)。旧 ticket は settle 時に\n // eligibility 不一致で stale となる。\n supersedeEpoch = ++this._latestEpoch;\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n break;\n }\n case \"exhaust\": {\n // 実行中なら新要求を拒否 (呼び出し側は既存結果へ合流)。\n if (this._activeOperationId !== undefined) {\n return null;\n }\n break;\n }\n case \"queue\":\n case \"overlap\":\n break;\n }\n\n const operationId = this._nextOperationId++;\n const ticket: OperationTicket = {\n operationId,\n ownerGeneration: this._ownerGeneration,\n laneKey: this.laneKey,\n policy: this.policy,\n supersedeEpoch,\n };\n\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n this._activeOperationId = operationId;\n break;\n case \"queue\":\n this._queue.push(ticket);\n // 先頭だけを active にする (先行が完了するまで待つ)。\n if (this._activeOperationId === undefined) {\n this._activeOperationId = operationId;\n }\n break;\n case \"overlap\":\n this._activeOperationIds.add(operationId);\n break;\n }\n\n this._inFlightCount += 1;\n this._attempts.set(operationId, 1);\n const attempt = this._makeAttempt(operationId, 1);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-started\", operationId, laneKey: this.laneKey, policy: this.policy });\n }\n return { ticket, attempt };\n }\n\n /**\n * retry: 同じ operationId に新しい attempt を作る。attempt number と resource signal\n * だけを更新する (§5)。既に終端した operation には作れない (null)。\n */\n retry(ticket: OperationTicket): OperationAttempt | null {\n if (ticket.ownerGeneration !== this._ownerGeneration) return null;\n if (this._terminal.has(ticket.operationId)) return null;\n const previous = this._attempts.get(ticket.operationId);\n if (previous === undefined) return null;\n const attemptNo = previous + 1;\n this._attempts.set(ticket.operationId, attemptNo);\n // 前の attempt の signal は破棄し、新しい controller を張る。\n this._releaseController(ticket.operationId);\n const attempt = this._makeAttempt(ticket.operationId, attemptNo);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-retried\", operationId: ticket.operationId, laneKey: this.laneKey, attempt: attemptNo });\n }\n return attempt;\n }\n\n /**\n * CommitGuard (§5.1)。外部可視の setter / event dispatch の直前に呼ぶ。\n * (1) owner lifecycle generation 一致 (2) terminal settle 前 (3) policy eligibility。\n */\n canCommit(ticket: OperationTicket): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n const status = this._terminal.get(ticket.operationId);\n // absence = pending / 'committing' = multi-setter commit 中。どちらも settle 前。\n if (status !== undefined && status !== \"committing\") return false;\n return this._isEligible(ticket);\n }\n\n /**\n * terminal CAS (§5.1): pending → committing を claim する。勝者だけが true。\n * eligibility / owner gen を満たさない場合も false。claim 後は commit 中となり、\n * canCommit は各 setter の直前で再検査する (setter が同期 supersede しても取りこぼさない)。\n */\n claimTerminal(ticket: OperationTicket, outcome: TerminalOutcome): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n if (this._terminal.has(ticket.operationId)) return false; // 既に committing / 終端\n if (!this._isEligible(ticket)) return false;\n this._terminal.set(ticket.operationId, \"committing\");\n this._claimedOutcome.set(ticket.operationId, outcome);\n return true;\n }\n\n /** claim 済み outcome (timer が claim → catch が読む等)。未 claim なら undefined。 */\n claimedOutcome(ticket: OperationTicket): TerminalOutcome | undefined {\n return this._claimedOutcome.get(ticket.operationId);\n }\n\n /**\n * operation の後始末。claim 済みなら outcome を確定し、未 claim なら stale-drop。\n * controller を解放し in-flight を減らし、policy の bookkeeping を進める。冪等。\n */\n finalize(ticket: OperationTicket): void {\n const operationId = ticket.operationId;\n const status = this._terminal.get(operationId);\n if (status !== undefined && status !== \"committing\") {\n // 既に確定済み。冪等に return。\n return;\n }\n let outcome: TerminalOutcome;\n if (status === \"committing\") {\n outcome = this._claimedOutcome.get(operationId) ?? \"stale\";\n } else {\n // 一度も claim されなかった (supersede / dispose で eligibility を失った)。\n outcome = \"stale\";\n }\n this._terminal.set(operationId, outcome);\n this._claimedOutcome.delete(operationId);\n this._releaseController(operationId);\n this._attempts.delete(operationId);\n if (this._inFlightCount > 0) this._inFlightCount -= 1;\n this._advanceBookkeeping(operationId);\n if (this._trace !== undefined) {\n if (outcome === \"stale\") {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n } else {\n this._trace({ type: \"io:operation-settled\", operationId, laneKey: this.laneKey, outcome });\n }\n }\n }\n\n /** operation の signal (resource 解放用)。withSignal でなければ undefined。 */\n signalOf(ticket: OperationTicket): AbortSignal | undefined {\n return this._controllers.get(ticket.operationId)?.signal;\n }\n\n /** best-effort な resource 中断。正しさは owner gen / eligibility / terminal CAS が担う。 */\n abort(ticket: OperationTicket): void {\n this._abortController(ticket.operationId);\n }\n\n /**\n * 現在 active な operation を中断する (利用者による明示キャンセル)。epoch は進めない —\n * 中断された operation は eligibility を保ったまま 'aborted' を claim できる\n * (loading をクリアしつつ in-flight 状態を残す)。\n */\n abortActive(): void {\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n for (const operationId of this._activeOperationIds) {\n this._abortController(operationId);\n }\n }\n\n /**\n * dispose (§4.1 world generation)。owner generation を bump して全 ticket を無効化し、\n * 生きている controller を全て abort する。dispose 後に settle した operation は\n * owner gen 不一致で外部 commit しない。retention gate (§10.3) のため live な\n * 全 operation を即時に stale として finalize し、controller / attempt を解放する。\n */\n disposeOwner(): void {\n this._ownerGeneration += 1;\n for (const operationId of Array.from(this._controllers.keys())) {\n this._abortController(operationId);\n // finalize は dispose 後 (terminal='stale') に early-return するため controller を\n // 解放しない。retention gate (§10.3) を満たすためここで明示的に解放する。\n this._releaseController(operationId);\n }\n for (const operationId of Array.from(this._attempts.keys())) {\n if (!this._terminal.has(operationId)) {\n this._terminal.set(operationId, \"stale\");\n }\n this._claimedOutcome.delete(operationId);\n this._attempts.delete(operationId);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n }\n }\n this._activeOperationId = undefined;\n this._activeOperationIds.clear();\n this._queue.length = 0;\n this._inFlightCount = 0;\n }\n\n // --- internal ---\n\n private _makeAttempt(operationId: number, attemptNo: number): OperationAttempt {\n let signal: AbortSignal | undefined;\n // AbortController 不在環境(古い runtime / 一部 SSR)では degraded: signal なしで進む。\n // 正しさは owner generation / eligibility / terminal CAS が担うため、native 中断が\n // 無くても supersede / dispose は機能する(best-effort resource 中断が省かれるだけ)。\n if (this._withSignal && typeof AbortController === \"function\") {\n const controller = new AbortController();\n this._controllers.set(operationId, controller);\n signal = controller.signal;\n }\n return { operationId, attempt: attemptNo, signal };\n }\n\n private _isEligible(ticket: OperationTicket): boolean {\n switch (this.policy) {\n case \"latest\":\n return ticket.supersedeEpoch === this._latestEpoch;\n case \"queue\":\n case \"exhaust\":\n return this._activeOperationId === ticket.operationId;\n case \"overlap\":\n return this._activeOperationIds.has(ticket.operationId);\n }\n }\n\n private _advanceBookkeeping(operationId: number): void {\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n if (this._activeOperationId === operationId) {\n this._activeOperationId = undefined;\n }\n break;\n case \"queue\": {\n // 完了した ticket を FIFO から取り除き、次の先頭を active にする。filter で\n // 「先頭 / 非先頭 / 不在」を一様に扱う (finalize は冪等ガードを通った op のみ到達)。\n const remaining = this._queue.filter((t) => t.operationId !== operationId);\n this._queue.length = 0;\n this._queue.push(...remaining);\n this._activeOperationId = this._queue.length > 0 ? this._queue[0].operationId : undefined;\n break;\n }\n case \"overlap\":\n this._activeOperationIds.delete(operationId);\n break;\n }\n }\n\n private _abortController(operationId: number): void {\n const controller = this._controllers.get(operationId);\n if (controller !== undefined && !controller.signal.aborted) {\n controller.abort();\n }\n }\n\n private _releaseController(operationId: number): void {\n this._controllers.delete(operationId);\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/platform-capability.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * platform-capability.ts\n *\n * Phase 6(docs/architecture-hardening/09-remediation-design.md §7.2 /\n * 07-browser-capability-variance.md)の browser capability 判定と error taxonomy の\n * 汎用プリミティブ。node 固有の capability registry / error code は各パッケージが\n * 別ファイルで宣言し、この汎用層(型 + assess 機構)を import する。\n *\n * 原則:\n * - feature detection は境界(利用直前)で行う。module 評価時に browser global を\n * 参照しない(SSR / worker で import が失敗しない)。\n * - capability ID(`web.fetch` 等)は文字列を global property path として eval せず、\n * registry が ID ごとに副作用のない presence probe を対応付ける。\n * - availability / permission / readiness / activity / operation error を 1 つの\n * `ready / unsupported / error` enum に畳まない。required 欠如は開始しない、\n * optional 欠如は宣言済み fallback で readiness を `degraded` にする。\n *\n * 配置: 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * pure(module 評価時に browser global 非参照)。\n */\n\nexport type Availability = \"available\" | \"missing\" | \"unknown\";\nexport type PermissionState = \"granted\" | \"denied\" | \"prompt\" | \"not-applicable\" | \"unknown\";\nexport type Readiness = \"idle\" | \"ready\" | \"degraded\";\nexport type Activity = \"inactive\" | \"active\";\nexport type PreconditionState = \"satisfied\" | \"required\" | \"not-applicable\";\n\n/** operation error の phase(taxonomy)。 */\nexport type WcsIoErrorPhase = \"probe\" | \"start\" | \"execute\" | \"decode\" | \"commit\" | \"dispose\";\n\n/** serializable な error info(non-cloneable な cause とは分離。DevTools / remote へは info のみ)。 */\nexport interface WcsIoErrorInfo {\n readonly code: string;\n readonly phase: WcsIoErrorPhase;\n readonly recoverable: boolean;\n readonly capabilityId?: string;\n readonly message: string;\n}\n\nexport interface PlatformAssessment {\n readonly availability: ReadonlyMap<string, Availability>;\n readonly permission: PermissionState;\n readonly readiness: Readiness;\n readonly activity: Activity;\n readonly preconditions: {\n readonly secureContext: PreconditionState;\n readonly userActivation: PreconditionState;\n };\n readonly epoch: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\n/** capability 1 件の仕様。probe は副作用なく presence を返す(利用直前に呼ぶ)。 */\nexport interface CapabilitySpec {\n readonly probe: () => boolean;\n readonly requiresSecureContext?: boolean;\n readonly requiresUserActivation?: boolean;\n /** browser compatibility dataset のキー(任意・診断用)。 */\n readonly compatKey?: string;\n}\n\nexport type CapabilityRegistry = ReadonlyMap<string, CapabilitySpec>;\n\nexport interface AssessOptions {\n readonly required: readonly string[];\n readonly optional?: readonly string[];\n readonly permission?: PermissionState;\n readonly activity?: Activity;\n readonly epoch?: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\nfunction isSecureContext(): boolean {\n return (globalThis as { isSecureContext?: unknown }).isSecureContext === true;\n}\n\n/**\n * capability を利用直前に評価して PlatformAssessment を作る。\n * required が 1 つでも欠ければ readiness は \"idle\"(開始不可)、\n * required 揃い + optional 欠けは \"degraded\"、全揃いは \"ready\"。\n */\nexport function assessCapabilities(registry: CapabilityRegistry, options: AssessOptions): PlatformAssessment {\n const availability = new Map<string, Availability>();\n const evaluate = (id: string): Availability => {\n const spec = registry.get(id);\n if (spec === undefined) return \"unknown\";\n return spec.probe() ? \"available\" : \"missing\";\n };\n\n let requiredAllAvailable = true;\n for (const id of options.required) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") requiredAllAvailable = false;\n }\n let optionalAllAvailable = true;\n for (const id of options.optional ?? []) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") optionalAllAvailable = false;\n }\n\n const readiness: Readiness = !requiredAllAvailable ? \"idle\" : (optionalAllAvailable ? \"ready\" : \"degraded\");\n\n // preconditions: 対象 capability のいずれかが要求する場合だけ評価する。\n const allIds = [...options.required, ...(options.optional ?? [])];\n const needsSecure = allIds.some((id) => registry.get(id)?.requiresSecureContext === true);\n const needsActivation = allIds.some((id) => registry.get(id)?.requiresUserActivation === true);\n const secureContext: PreconditionState = needsSecure ? (isSecureContext() ? \"satisfied\" : \"required\") : \"not-applicable\";\n const userActivation: PreconditionState = needsActivation ? \"required\" : \"not-applicable\";\n\n return {\n availability,\n permission: options.permission ?? \"not-applicable\",\n readiness,\n activity: options.activity ?? \"inactive\",\n preconditions: { secureContext, userActivation },\n epoch: options.epoch ?? 0,\n lastError: options.lastError,\n };\n}\n\n/** availability から「required がすべて available か」を判定するヘルパ(supported の最低条件)。 */\nexport function requiredCapabilitiesAvailable(assessment: PlatformAssessment, required: readonly string[]): boolean {\n return required.every((id) => assessment.availability.get(id) === \"available\");\n}\n\n/**\n * このページで機能が使えない理由(使える、または分からないなら null)。利用直前に読む。\n *\n * - `\"insecure-context\"`: 安全なコンテキストではない(`isSecureContext === false`)。\n * Permissions API が扱う機能はどれも安全なコンテキストを要る。\n * - `\"policy-blocked\"`: Permissions-Policy(サーバーのヘッダ、または `allow` の無い\n * `<iframe>`)がその機能を切っている。\n *\n * どちらも Permissions API は教えない: Chromium はポリシーで切られた文書でも\n * `granted` を、安全でない origin では `denied` を返す。利用者の拒否と区別するため、\n * 見張り役(`<wcs-permission>`)も取りに行く側も `unsupported` を報告する\n * (docs/v4-direction-2026-10.md の決定、state-field-report)。\n * `isSecureContext` が無い環境(SSR・テスト)は判断しない。\n */\nexport type FeatureUnavailableReason = \"insecure-context\" | \"policy-blocked\";\n\n/** Permissions-Policy が制御する機能(permission 名と同じ文字列)。 */\nconst POLICY_CONTROLLED = new Set([\n \"camera\", \"microphone\", \"geolocation\", \"midi\", \"clipboard-read\", \"clipboard-write\",\n \"screen-wake-lock\", \"idle-detection\", \"accelerometer\", \"gyroscope\", \"magnetometer\",\n \"ambient-light-sensor\", \"display-capture\",\n]);\n\ninterface PolicyLike { allowsFeature(feature: string): boolean }\n\nexport function featureUnavailable(feature: string): FeatureUnavailableReason | null {\n const g = globalThis as { isSecureContext?: unknown; document?: { permissionsPolicy?: PolicyLike; featurePolicy?: PolicyLike } };\n if (g.isSecureContext === false) return \"insecure-context\";\n if (!POLICY_CONTROLLED.has(feature)) return null;\n const policy = g.document?.permissionsPolicy ?? g.document?.featurePolicy;\n if (policy === undefined || typeof policy.allowsFeature !== \"function\") return null;\n try {\n return policy.allowsFeature(feature) ? null : \"policy-blocked\";\n } catch {\n return null;\n }\n}\n\n/** `featureUnavailable` の理由を、作者が直し方を読める文にする。`what` は文頭(「The camera」など)。 */\nexport function featureUnavailableMessage(what: string, feature: string, reason: FeatureUnavailableReason): string {\n return reason === \"insecure-context\"\n ? `${what} needs a secure context (https:, or http://localhost), and this page is not one.`\n : `${what} is turned off for this page by a Permissions-Policy: the server's Permissions-Policy header, ` +\n `or an <iframe> without allow=\"${feature}\". The browser's site settings cannot change that.`;\n}\n","/**\n * eyedropperCapabilities.ts\n *\n * EyeDropper node 固有の capability registry と error code。汎用の assess 機構・型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。node 固有の宣言はこのハンドライトファイルに置き、生成コピーとは分離する。\n */\n\nimport { CapabilityRegistry, CapabilitySpec } from \"./platformCapability.js\";\n\n/** 安定した eyedropper error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_EYEDROPPER_ERROR_CODE = {\n CapabilityMissing: \"capability-missing\",\n PickFailed: \"pick-failed\",\n} as const;\n\n/** eyedropper node の capability registry。文字列 ID を eval せず明示 probe を持つ。 */\nexport const EYEDROPPER_CAPABILITIES: CapabilityRegistry = new Map<string, CapabilitySpec>([\n [\"web.eyedropper\", { probe: () => typeof (globalThis as { EyeDropper?: unknown }).EyeDropper === \"function\", compatKey: \"api.EyeDropper\" }],\n]);\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { OperationLane, OperationTicket } from \"./operationLane.js\";\nimport {\n PlatformAssessment,\n WcsIoErrorInfo,\n WcsIoErrorPhase,\n assessCapabilities,\n requiredCapabilitiesAvailable,\n} from \"./platformCapability.js\";\nimport { EYEDROPPER_CAPABILITIES, WCS_EYEDROPPER_ERROR_CODE } from \"./eyedropperCapabilities.js\";\n\n/**\n * Headless EyeDropper primitive. A thin, framework-agnostic wrapper around\n * `new EyeDropper().open(options)` exposed through the wc-bindable protocol.\n *\n * Concurrency is owned by the shared `OperationLane` (io-core) with the `latest`\n * policy: `EyeDropper.open()` accepts a `{signal}`, so — unlike Web Share / Contact\n * Picker (exhaust) — a caller has a real platform mechanism to cancel an in-flight\n * pick. A new `open()` supersedes the previous one (the lane aborts its\n * AbortController and the superseded completion fails the terminal CAS), and the\n * `abort()` command aborts the active pick. This replaces the ad-hoc `_gen` +\n * `_abortController` + finally-block identity check with the same lane FetchCore\n * uses; the lane owns the per-attempt AbortController and the commit guard.\n *\n * Both the user dismissing the picker with Escape and the caller invoking\n * `abort()` reject `open()` with the same `AbortError` — both land on `cancelled`\n * without distinction (docs/eyedropper-tag-design.md §2).\n */\nexport class EyedropperCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"value\", event: \"wcs-eyedropper:complete\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.value },\n { name: \"loading\", event: \"wcs-eyedropper:loading-changed\", semantics: \"state\" },\n { name: \"error\", event: \"wcs-eyedropper:error\", semantics: \"state\" },\n { name: \"cancelled\", event: \"wcs-eyedropper:cancelled-changed\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output; the existing `error` property/event are unchanged.\n // Fires its own `wcs-eyedropper:error-info-changed` event; no getter, so the\n // bound value is the event detail (mirrors `error` / `loading` / `cancelled`).\n { name: \"errorInfo\", event: \"wcs-eyedropper:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"open\", async: true },\n { name: \"abort\" },\n ],\n };\n\n // Required capability (probed at call time, never at module eval).\n private static readonly REQUIRED_CAPABILITIES = [\"web.eyedropper\"] as const;\n\n private _target: EventTarget;\n private _value: WcsEyedropperData | null = null;\n private _loading: boolean = false;\n private _error: any = null;\n private _cancelled: boolean = false;\n private _errorInfo: WcsIoErrorInfo | null = null;\n // Concurrency lane (io-core). `latest`: a new open() supersedes + aborts the\n // in-flight one (switchMap). `withSignal: true`: the lane owns the per-attempt\n // AbortController whose signal is passed to EyeDropper.open(). dispose() bumps\n // the owner generation and aborts.\n private _lane = new OperationLane(\"eyedropper\", \"latest\", { withSignal: true });\n // SSR (§3.8): no asynchronous probe to await, so readiness is immediate.\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get value(): WcsEyedropperData | null {\n return this._value;\n }\n\n get loading(): boolean {\n return this._loading;\n }\n\n get error(): any {\n return this._error;\n }\n\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable` / `capabilityId`), or null. Exposed as an additive wc-bindable\n * property (event `wcs-eyedropper:error-info-changed`); the existing `error`\n * property/event are unchanged. Note user/abort cancellation is `cancelled`, not\n * `errorInfo`.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Whether the required platform capability (`web.eyedropper`) is available right\n * now — decided by call-time feature detection, not User-Agent. Core-only,\n * additive.\n */\n get supported(): boolean {\n return requiredCapabilitiesAvailable(this.platformAssessment, EyedropperCore.REQUIRED_CAPABILITIES);\n }\n\n /**\n * Full platform assessment (availability / readiness / preconditions), probed at\n * call time. Core-only opt-in dev / sidecar view.\n */\n get platformAssessment(): PlatformAssessment {\n return assessCapabilities(EYEDROPPER_CAPABILITIES, {\n required: EyedropperCore.REQUIRED_CAPABILITIES,\n activity: this._loading ? \"active\" : \"inactive\",\n lastError: this._errorInfo ?? undefined,\n });\n }\n\n // Lifecycle (§3.5). EyeDropper is command-driven with no subscription to\n // establish, so observe() is an idempotent no-op that resolves once ready;\n // dispose() bumps the lane's owner generation (invalidating any in-flight open())\n // and aborts its AbortController.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this._lane.disposeOwner();\n // The operation the lane drops settles nothing any more, so its end is published\n // here (timing-and-firing-contract §22): a route the element leaves keeps its\n // nodes — bindings included — for the next entry, and state would keep `loading`.\n this._setLoading(false);\n }\n\n // CommitGuard (§5.1): external setters / event dispatch only run if the ticket\n // still holds owner generation, is pre-terminal, and is the lane's latest epoch\n // (a superseding open() can invalidate a ticket mid-commit).\n private _commitStep(ticket: OperationTicket, step: () => void): void {\n if (this._lane.canCommit(ticket)) {\n step();\n }\n }\n\n private _setLoading(loading: boolean): void {\n if (this._loading === loading) return;\n this._loading = loading;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:loading-changed\", {\n detail: loading,\n bubbles: true,\n }));\n }\n\n private _setValue(value: WcsEyedropperData | null): void {\n if (this._value === value) return;\n this._value = value;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:complete\", {\n detail: { value },\n bubbles: true,\n }));\n }\n\n private _setError(error: any): void {\n if (this._error === error) return;\n this._error = error;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n private _setCancelled(cancelled: boolean): void {\n if (this._cancelled === cancelled) return;\n this._cancelled = cancelled;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:cancelled-changed\", {\n detail: cancelled,\n bubbles: true,\n }));\n }\n\n // Single mutation point for `errorInfo`, mirroring `_setError`'s same-value guard\n // and event dispatch so the additive `errorInfo` wc-bindable property stays in\n // sync with `error`. Each failure builds a fresh object (reference guard passes);\n // the clear path passes null (suppresses a redundant null→null per open start).\n private _setErrorInfo(code: string, phase: WcsIoErrorPhase, recoverable: boolean, message: string, capabilityId?: string): void {\n this._commitErrorInfo({ code, phase, recoverable, message, ...(capabilityId === undefined ? {} : { capabilityId }) });\n }\n\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n if (this._errorInfo === info) return;\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Cancels an in-flight `open()` call, if any (a no-op otherwise). Aborts the\n * lane's active AbortController — the in-flight open() then rejects with\n * `AbortError` and lands on `cancelled`. The epoch is not advanced, so the\n * aborted operation keeps eligibility to claim the `aborted` terminal.\n */\n abort(): void {\n this._lane.abortActive();\n }\n\n async open(): Promise<WcsEyedropperData | null> {\n // never-throw + unsupported (§4 / §7.2): probe the required capability at call\n // time (non-Chromium browsers lack this API). If `web.eyedropper` is absent, do\n // NOT start — surface a stable `capability-missing` taxonomy and the existing\n // error message shape.\n const assessment = this.platformAssessment;\n if (!requiredCapabilitiesAvailable(assessment, EyedropperCore.REQUIRED_CAPABILITIES)) {\n const missing = EyedropperCore.REQUIRED_CAPABILITIES.find((id) => assessment.availability.get(id) !== \"available\");\n const message = \"EyeDropper API is not supported in this browser.\";\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.CapabilityMissing, \"start\", false, message, missing);\n this._setError({ message });\n return null;\n }\n\n // `latest`: advance the epoch and abort the previous in-flight pick (supersede).\n // begin() never returns null for latest.\n const started = this._lane.begin()!;\n const { ticket, attempt } = started;\n const signal = attempt.signal;\n\n // Capability probed above → EyeDropper is present. Resolve the constructor at\n // call time (never cached, §3.7) so tests can install/remove it freely.\n const EyeDropperCtor = (globalThis as { EyeDropper?: new () => { open(options?: { signal?: AbortSignal }): Promise<WcsEyedropperData> } }).EyeDropper!;\n\n this._commitStep(ticket, () => this._setLoading(true));\n // Reset the previous outcome before starting a new open() so a stale\n // cancelled/error/errorInfo does not linger into this call's result.\n this._commitStep(ticket, () => {\n this._commitErrorInfo(null);\n this._setError(null);\n this._setCancelled(false);\n });\n\n try {\n const result = await new EyeDropperCtor().open({ signal });\n // Terminal CAS: a stale (superseded / dispose-invalidated) completion loses\n // the claim and is dropped without writing state.\n if (!this._lane.claimTerminal(ticket, \"success\")) {\n return null;\n }\n // The platform's own result object ({ sRGBHex }) is used verbatim (§3).\n // Separate commit steps (like FetchCore): if `_setValue`'s event listener\n // synchronously supersedes this op, the following `_setLoading(false)` is\n // stopped by the commit guard rather than clobbering the newer op.\n this._commitStep(ticket, () => this._setValue(result));\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return result;\n } catch (e: any) {\n const cancelled = e?.name === \"AbortError\";\n if (!this._lane.claimTerminal(ticket, cancelled ? \"aborted\" : \"error\")) {\n return null;\n }\n this._commitStep(ticket, () => {\n if (cancelled) {\n // Either the user dismissed the picker with Escape or the caller invoked\n // abort() — a routine cancellation, not a platform failure, and not\n // distinguished (§2). Kept out of `error`/`errorInfo`.\n this._setCancelled(true);\n } else {\n const message = String(e?.message ?? \"Color pick failed.\");\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.PickFailed, \"execute\", true, message);\n this._setError(e ?? { message });\n }\n });\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return null;\n }\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n// 属性になってしまったオブジェクトの入力(`files=\"[object File]\"`)を、要素ごとに 1 回だけ言う。\n// React 19 は定義前の要素にプロパティが無いのでオブジェクトを属性に書き、Vue の `.attr` も\n// 書く。要素はその入力をプロパティでしか読まないので、何も受け取らず、何も言わなかった\n// (docs/seam-apps.md、fw-inventory)。\nconst toldObjectAttribute = new WeakSet<object>();\n\nfunction warnObjectAttribute(element: object, name: string, value: string): void {\n if (toldObjectAttribute.has(element)) return;\n toldObjectAttribute.add(element);\n const tag = (element as { localName?: string }).localName ?? \"element\";\n console.warn(\n `[wcs/input-as-attribute] <${tag}> has the attribute ${name}=\"${value}\": an object was written as an ` +\n `attribute, so the element did not receive it. A framework does that when the property is set before the ` +\n `element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, ` +\n `or assign the property through a ref (Vue: .prop). (Said once per element.)`,\n element,\n );\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n * - 値が `[object …]` の属性(属性に書かれてしまったオブジェクトの入力)は、要素ごとに 1 回警告する。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n const getAttribute = (element as { getAttribute?: (name: string) => string | null }).getAttribute;\n for (const input of inputs) {\n const name = input.name;\n const attribute = typeof getAttribute === \"function\" ? getAttribute.call(element, name.toLowerCase()) : null;\n if (attribute !== null && attribute.startsWith(\"[object \")) warnObjectAttribute(element, name, attribute);\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { EyedropperCore } from \"../core/EyedropperCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-eyedropper>` — declarative EyeDropper API primitive.\n *\n * The smallest command-only Shell in the batch (docs/eyedropper-tag-design.md\n * §5), mirroring `<wcs-share>`: no attributes at all. `open()` takes no\n * per-call argument — the `{signal}` option is supplied internally by the\n * Core's own AbortController, never via the command-token surface.\n */\nexport class WcsEyedropper extends HTMLElement {\n // SSR (§4.4): observe() completes synchronously, but the Shell still exposes\n // connectedCallbackPromise so the state binder can await it uniformly across\n // all IO nodes before snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...EyedropperCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: EyedropperCore.wcBindable.commands,\n };\n\n private _core: EyedropperCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new EyedropperCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-eyedropper:loading-changed\": (d) => ({ loading: d === true }),\n \"wcs-eyedropper:cancelled-changed\": (d) => ({ cancelled: d === true }),\n \"wcs-eyedropper:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (async-io-node-guidelines.md §3.6): attachInternals is absent\n // in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Core delegated getters ---\n\n get value(): WcsEyedropperData | null {\n return this._core.value;\n }\n\n get loading(): boolean {\n return this._core.loading;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get cancelled(): boolean {\n return this._core.cancelled;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands ---\n\n open(): Promise<WcsEyedropperData | null> {\n return this._core.open();\n }\n\n abort(): void {\n this._core.abort();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/define-element.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * One copy of each package on a page (docs/timing-and-firing-contract.md §24). The first copy the\n * page evaluates defines the tags and a second one does nothing, so a copy that finds its tag defined\n * by another copy of the package — not its class, not a subclass of it, not the same version — warns\n * `[wcs/package-twice]` once per registry, naming both versions. The classes it defines carry\n * `\"<package>@<version>\"` under `Symbol.for(\"wcstack.package\")`; a class without it is named\n * \"another copy of <package> that does not name its version\" (an older copy, or one loaded through\n * an entry that does not stamp).\n */\n\n/** The static a class defined through this helper carries: `\"@wcstack/fetch@<version>\"`. */\nexport const PACKAGE_STAMP: unique symbol = Symbol.for(\"wcstack.package\");\n\ntype Stamped = { [PACKAGE_STAMP]?: string };\n\n/** The registries this copy warned about: one warning per package per registry. */\nconst warned = new WeakSet<CustomElementRegistry>();\n\n/**\n * Marks `cls` as defined by `pkg` (`\"@wcstack/fetch@<version>\"`). A subclass inherits the mark, and\n * `defineProperty` writes it even where a parent's mark is read-only.\n */\nexport function stampPackage(cls: CustomElementConstructor, pkg: string): void {\n Object.defineProperty(cls, PACKAGE_STAMP, { value: pkg, configurable: true });\n}\n\n/**\n * Warns when `tag` is defined as `existing` by another copy of the package `pkg` names: `existing`\n * is neither `own` nor a subclass of it (omit `own` when the copy has no class to compare with), and\n * carries another version or none. Once per registry.\n */\nexport function warnIfAnotherCopy(\n registry: CustomElementRegistry,\n tag: string,\n existing: CustomElementConstructor,\n own: CustomElementConstructor | undefined,\n pkg: string,\n): void {\n if (own !== undefined && (existing === own || existing.prototype instanceof own)) return;\n const theirs = (existing as Stamped)[PACKAGE_STAMP];\n if (theirs === pkg || warned.has(registry)) return;\n warned.add(registry);\n const name = pkg.slice(0, pkg.lastIndexOf(\"@\"));\n console.warn(\n `[${name}] [wcs/package-twice] <${tag}> is already defined by ` +\n `${theirs ?? `another copy of ${name} that does not name its version`}; ` +\n `this copy, ${pkg}, does nothing. Load each package once.`,\n );\n}\n\n/**\n * Defines each `[tag, class]` in `registry` unless the tag is already defined, stamping the class\n * with `pkg` (`\"@wcstack/fetch@<version>\"`). A tag another copy of the package defined first is left\n * as it is, with the warning above.\n */\nexport function defineElements(\n registry: CustomElementRegistry,\n pkg: string,\n definitions: readonly (readonly [tag: string, cls: CustomElementConstructor])[],\n): void {\n for (const [tag, cls] of definitions) {\n const existing = registry.get(tag);\n if (existing === undefined) {\n stampPackage(cls, pkg);\n registry.define(tag, cls);\n } else {\n warnIfAnotherCopy(registry, tag, existing, cls, pkg);\n }\n }\n}\n","import pkg from \"../package.json\" with { type: \"json\" };\nimport { WcsEyedropper } from \"./components/Eyedropper.js\";\nimport { config } from \"./config.js\";\nimport { defineElements } from \"./protocol/defineElement.js\";\n\n/**\n * Register this package's tags. Pass a scoped `CustomElementRegistry` to define\n * them for a single shadow tree -- scoped registries do not inherit the global\n * one, so a tree using one needs its own definitions.\n */\nexport function registerComponents(registry: CustomElementRegistry = customElements): void {\n defineElements(registry, `${pkg.name}@${pkg.version}`, [\n [config.tagNames.eyedropper, WcsEyedropper],\n ]);\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapEyedropper(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n"],"names":["config","tagNames","eyedropper","OperationLane","laneKey","policy","_ownerGeneration","_latestEpoch","_nextOperationId","_activeOperationId","undefined","_activeOperationIds","Set","_queue","_inFlightCount","_terminal","Map","_claimedOutcome","_controllers","_attempts","_withSignal","_trace","constructor","options","this","withSignal","trace","ownerGeneration","inFlightCount","latestEpoch","activeOperationId","begin","supersedeEpoch","_abortController","operationId","ticket","push","add","set","attempt","_makeAttempt","type","retry","has","previous","get","attemptNo","_releaseController","canCommit","status","_isEligible","claimTerminal","outcome","claimedOutcome","finalize","delete","_advanceBookkeeping","signalOf","signal","abort","abortActive","disposeOwner","Array","from","keys","clear","length","AbortController","controller","remaining","filter","t","aborted","assessCapabilities","registry","availability","evaluate","id","spec","probe","requiredAllAvailable","required","a","optionalAllAvailable","optional","readiness","allIds","needsSecure","some","requiresSecureContext","needsActivation","requiresUserActivation","secureContext","globalThis","isSecureContext","userActivation","permission","activity","preconditions","epoch","lastError","requiredCapabilitiesAvailable","assessment","every","WCS_EYEDROPPER_ERROR_CODE","EYEDROPPER_CAPABILITIES","EyeDropper","compatKey","EyedropperCore","EventTarget","static","protocol","version","properties","name","event","semantics","getter","e","detail","value","commands","async","_target","_value","_loading","_error","_cancelled","_errorInfo","_lane","_ready","Promise","resolve","target","super","ready","loading","error","cancelled","errorInfo","supported","platformAssessment","REQUIRED_CAPABILITIES","observe","dispose","_setLoading","_commitStep","step","dispatchEvent","CustomEvent","bubbles","_setValue","_setError","_setCancelled","_setErrorInfo","code","phase","recoverable","message","capabilityId","_commitErrorInfo","info","open","missing","find","started","EyeDropperCtor","result","String","hasAccessorOnPrototype","proto","Object","getPrototypeOf","descriptor","getOwnPropertyDescriptor","toldObjectAttribute","WeakSet","warnObjectAttribute","element","tag","localName","console","warn","WcsEyedropper","HTMLElement","wcBindable","inputs","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","d","debugStates","states","attachInternals","internals","map","toStates","entries","addEventListener","debug","hasAttribute","on","toggleAttribute","connectedCallbackPromise","connectedCallback","declaration","getAttribute","input","attribute","call","toLowerCase","startsWith","prototype","hasOwnProperty","record","upgradeProperties","style","display","disconnectedCallback","PACKAGE_STAMP","Symbol","for","warned","stampPackage","cls","pkg","defineProperty","configurable","warnIfAnotherCopy","existing","own","theirs","slice","lastIndexOf","registerComponents","customElements","definitions","define","defineElements"],"mappings":"AAQA,MAiCaA,EAjCoB,CAC/BC,SAAU,CACRC,WAAY,gECmEHC,EACFC,QACAC,OAEDC,iBAAmB,EACnBC,aAAe,EACfC,iBAAmB,EAEnBC,wBAAyCC,EAEhCC,oBAAsB,IAAIC,IAE1BC,OAA4B,GACrCC,eAAiB,EAERC,UAAY,IAAIC,IAEhBC,gBAAkB,IAAID,IAEtBE,aAAe,IAAIF,IAEnBG,UAAY,IAAIH,IAChBI,YACAC,OAEjB,WAAAC,CAAYlB,EAAiBC,EAAoBkB,EAAgC,CAAA,GAC/EC,KAAKpB,QAAUA,EACfoB,KAAKnB,OAASA,EACdmB,KAAKJ,YAAcG,EAAQE,aAAc,EACzCD,KAAKH,OAASE,EAAQG,KACxB,CAEA,mBAAIC,GACF,OAAOH,KAAKlB,gBACd,CAEA,iBAAIsB,GACF,OAAOJ,KAAKV,cACd,CAEA,eAAIe,GACF,OAAOL,KAAKjB,YACd,CAEA,qBAAIuB,GACF,OAAON,KAAKf,kBACd,CAMA,KAAAsB,GACE,IAAIC,EACJ,OAAQR,KAAKnB,QACX,IAAK,SAGH2B,IAAmBR,KAAKjB,kBACQG,IAA5Bc,KAAKf,oBACPe,KAAKS,iBAAiBT,KAAKf,oBAE7B,MAEF,IAAK,UAEH,QAAgCC,IAA5Bc,KAAKf,mBACP,OAAO,KASb,MAAMyB,EAAcV,KAAKhB,mBACnB2B,EAA0B,CAC9BD,cACAP,gBAAiBH,KAAKlB,iBACtBF,QAASoB,KAAKpB,QACdC,OAAQmB,KAAKnB,OACb2B,kBAGF,OAAQR,KAAKnB,QACX,IAAK,SACL,IAAK,UACHmB,KAAKf,mBAAqByB,EAC1B,MACF,IAAK,QACHV,KAAKX,OAAOuB,KAAKD,QAEezB,IAA5Bc,KAAKf,qBACPe,KAAKf,mBAAqByB,GAE5B,MACF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A4D7G,EAIhEkK,EAAmBlK"}
1
+ {"version":3,"file":"auto.min.js","sources":["../../src/config.ts","../../src/core/operationLane.ts","../../src/core/platformCapability.ts","../../src/core/eyedropperCapabilities.ts","../../src/core/EyedropperCore.ts","../../src/protocol/upgradeProperties.ts","../../src/components/Eyedropper.ts","../../src/protocol/defineElement.ts","../../src/registerComponents.ts","../../src/bootstrapEyedropper.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n eyedropper: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n eyedropper: \"wcs-eyedropper\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\n// Note: this is the live, mutable internal config. It is not part of the public\n// package exports (see exports.ts) — only `getConfig()` (a frozen snapshot) is\n// surfaced. `setConfig()` is applied internally via `bootstrapEyedropper()` and\n// is not re-exported from the package root, though a deep path import\n// (`.../src/config.js`) can still reach and mutate it. Accepted as-is for\n// cross-package consistency: every @wcstack package follows this same shape.\n// Use `getConfig()` for a frozen, safe read.\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\n/** A misspelt option would otherwise do nothing: `bootstrapEyedropper` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/eyedropper] bootstrapEyedropper: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/operation-lane.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * operationLane.ts\n *\n * Phase 4 (docs/architecture-hardening/09-remediation-design.md §5, §5.1) の\n * OperationTicket / CommitGuard / terminal CAS を型付き実装した lane プリミティブ。\n * docs/async-execution-model.md §5 が既に規範化した排他モード\n * (latest / queue / exhaust / overlap) を、`AbortController` だけでは防げない\n * 「取消不能な Promise・abort と同時に完了した結果の commit」から守るための\n * 実行時ガードとして具体化する。\n *\n * 配置方針 (§5): 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * 初期 PoC は fetch の `latest` policy から開始した。現在は4 policy 全てを\n * `operationLane.test.ts` が直接検証し、生成コピーを fetch / upload / share /\n * contacts / credential / eyedropper が利用する。lane 自体は promise を実行せず、\n * bookkeeping と guard の状態機械に徹する — 実際の非同期処理は Core が駆動し\n * lane に照合する。\n */\n\n/** §5: 排他モードの語彙。async-execution-model.md §5 の 4 モードに対応 (parallel は予約語・スコープ外)。 */\nexport type LanePolicy = \"latest\" | \"queue\" | \"exhaust\" | \"overlap\";\n\n/** §5: 各 operation の一回限りの終端結果。 */\nexport type TerminalOutcome = \"success\" | \"error\" | \"timeout\" | \"aborted\" | \"stale\";\n\n/** §5: 論理操作 1 件の identity。retry は同じ operationId を再利用する。 */\nexport interface OperationTicket {\n readonly operationId: number;\n /** 発行時に捕捉した I/O Core の observe / reconnect / dispose lifecycle 世代。 */\n readonly ownerGeneration: number;\n readonly laneKey: string;\n readonly policy: LanePolicy;\n /** supersede bookkeeping に使う epoch (latest policy のみ)。 */\n readonly supersedeEpoch?: number;\n}\n\n/** §5: operation の 1 回の試行。retry で attempt++ と resource signal だけ差し替える。 */\nexport interface OperationAttempt {\n readonly operationId: number;\n readonly attempt: number;\n readonly signal?: AbortSignal;\n}\n\n/** §6: DevTools 側 channel へ流す trace(fetch では既定 off・zero-cost)。 */\nexport type OperationTraceEvent =\n | { readonly type: \"io:operation-started\"; readonly operationId: number; readonly laneKey: string; readonly policy: LanePolicy }\n | { readonly type: \"io:operation-retried\"; readonly operationId: number; readonly laneKey: string; readonly attempt: number }\n | { readonly type: \"io:operation-settled\"; readonly operationId: number; readonly laneKey: string; readonly outcome: TerminalOutcome }\n | { readonly type: \"io:stale-dropped\"; readonly operationId: number; readonly laneKey: string };\n\nexport interface OperationLaneOptions {\n /** attempt ごとに AbortController を発行し signal を渡す (fetch/upload 系)。 */\n readonly withSignal?: boolean;\n /**\n * trace subscriber。undefined なら trace record を一切生成しない\n * (§10.3 hook-off zero allocation の gate)。\n */\n readonly trace?: (event: OperationTraceEvent) => void;\n}\n\n/**\n * 1 レーン = 独立した排他単位。Core が 1 つ以上所有する (module singleton にしない —\n * 複数 <wcs-fetch> 間で漏れるため)。\n */\nexport class OperationLane {\n readonly laneKey: string;\n readonly policy: LanePolicy;\n\n private _ownerGeneration = 0;\n private _latestEpoch = 0;\n private _nextOperationId = 1;\n // latest / queue / exhaust の単一 active。queue は head を指す。\n private _activeOperationId: number | undefined = undefined;\n // overlap の active set (§5: 内部 bookkeeping のみ・observable 公開はしない)。\n private readonly _activeOperationIds = new Set<number>();\n // queue policy の FIFO。\n private readonly _queue: OperationTicket[] = [];\n // opId → claimTerminal で確定した outcome。存在 = committing (finalize が確定させる)。\n private readonly _claimedOutcome = new Map<number, TerminalOutcome>();\n // opId → AbortController (identity は opId が保証。cross-op clobber は構造上起きない)。\n private readonly _controllers = new Map<number, AbortController>();\n // opId → attempt 数。存在 = live (begin 済みで finalize / dispose 前) で、in-flight はこの大きさ。\n // 終わった operation は何も残さない — 終端済みの記録を持つと長く開いたページで際限なく増える\n // (docs/formal-methods-study.md §4.1)。\n private readonly _attempts = new Map<number, number>();\n private readonly _withSignal: boolean;\n private readonly _trace?: (event: OperationTraceEvent) => void;\n\n constructor(laneKey: string, policy: LanePolicy, options: OperationLaneOptions = {}) {\n this.laneKey = laneKey;\n this.policy = policy;\n this._withSignal = options.withSignal ?? false;\n this._trace = options.trace;\n }\n\n get ownerGeneration(): number {\n return this._ownerGeneration;\n }\n\n get inFlightCount(): number {\n return this._attempts.size;\n }\n\n get latestEpoch(): number {\n return this._latestEpoch;\n }\n\n get activeOperationId(): number | undefined {\n return this._activeOperationId;\n }\n\n /**\n * 新しい要求の到着。arrival policy を適用し ticket + 最初の attempt を発行する。\n * exhaust で実行中の場合だけ null を返す (新要求を ticket 化せず拒否 = 冪等 no-op)。\n */\n begin(): { ticket: OperationTicket; attempt: OperationAttempt } | null {\n let supersedeEpoch: number | undefined;\n switch (this.policy) {\n case \"latest\": {\n // latestEpoch を進め、旧 active を abort (可能なら)。旧 ticket は settle 時に\n // eligibility 不一致で stale となる。\n supersedeEpoch = ++this._latestEpoch;\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n break;\n }\n case \"exhaust\": {\n // 実行中なら新要求を拒否 (呼び出し側は既存結果へ合流)。\n if (this._activeOperationId !== undefined) {\n return null;\n }\n break;\n }\n case \"queue\":\n case \"overlap\":\n break;\n }\n\n const operationId = this._nextOperationId++;\n const ticket: OperationTicket = {\n operationId,\n ownerGeneration: this._ownerGeneration,\n laneKey: this.laneKey,\n policy: this.policy,\n supersedeEpoch,\n };\n\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n this._activeOperationId = operationId;\n break;\n case \"queue\":\n this._queue.push(ticket);\n // 先頭だけを active にする (先行が完了するまで待つ)。\n if (this._activeOperationId === undefined) {\n this._activeOperationId = operationId;\n }\n break;\n case \"overlap\":\n this._activeOperationIds.add(operationId);\n break;\n }\n\n this._attempts.set(operationId, 1);\n const attempt = this._makeAttempt(operationId, 1);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-started\", operationId, laneKey: this.laneKey, policy: this.policy });\n }\n return { ticket, attempt };\n }\n\n /**\n * retry: 同じ operationId に新しい attempt を作る。attempt number と resource signal\n * だけを更新する (§5)。終端した・claim 済みの operation と、もう commit できない operation\n * (supersede された latest / queue の先頭の後ろで待つもの) には作れない (null) — 結果を\n * 捨てるしかない要求に新しい signal を渡さない (docs/formal-methods-study.md §4.1)。\n */\n retry(ticket: OperationTicket): OperationAttempt | null {\n if (ticket.ownerGeneration !== this._ownerGeneration) return null;\n const previous = this._attempts.get(ticket.operationId);\n if (previous === undefined || this._claimedOutcome.has(ticket.operationId)) return null;\n if (!this._isEligible(ticket)) return null;\n const attemptNo = previous + 1;\n this._attempts.set(ticket.operationId, attemptNo);\n // 前の attempt の signal は破棄し、新しい controller を張る。\n this._releaseController(ticket.operationId);\n const attempt = this._makeAttempt(ticket.operationId, attemptNo);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-retried\", operationId: ticket.operationId, laneKey: this.laneKey, attempt: attemptNo });\n }\n return attempt;\n }\n\n /**\n * CommitGuard (§5.1)。外部可視の setter / event dispatch の直前に呼ぶ。\n * (1) owner lifecycle generation 一致 (2) terminal settle 前 (3) policy eligibility。\n */\n canCommit(ticket: OperationTicket): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n // live でなければ settle 済み。pending と committing (multi-setter commit 中) はどちらも settle 前。\n if (!this._attempts.has(ticket.operationId)) return false;\n return this._isEligible(ticket);\n }\n\n /**\n * terminal CAS (§5.1): pending → committing を claim する。勝者だけが true。\n * eligibility / owner gen を満たさない場合も false。claim 後は commit 中となり、\n * canCommit は各 setter の直前で再検査する (setter が同期 supersede しても取りこぼさない)。\n */\n claimTerminal(ticket: OperationTicket, outcome: TerminalOutcome): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n // 終端済み (live でない) / 既に committing\n if (!this._attempts.has(ticket.operationId) || this._claimedOutcome.has(ticket.operationId)) return false;\n if (!this._isEligible(ticket)) return false;\n this._claimedOutcome.set(ticket.operationId, outcome);\n return true;\n }\n\n /** claim 済み outcome (timer が claim → catch が読む等)。未 claim なら undefined。 */\n claimedOutcome(ticket: OperationTicket): TerminalOutcome | undefined {\n return this._claimedOutcome.get(ticket.operationId);\n }\n\n /**\n * operation の後始末。claim 済みなら outcome を確定し、未 claim なら stale-drop。\n * controller を解放し in-flight を減らし、policy の bookkeeping を進める。冪等。\n */\n finalize(ticket: OperationTicket): void {\n const operationId = ticket.operationId;\n // live でなければ確定済み (finalize 済み、または dispose が stale として確定した)。冪等に return —\n // dispose 前の ticket が先へ進むと、新しい owner の in-flight を数え下げてしまう。\n if (!this._attempts.has(operationId)) return;\n // 一度も claim されなかった (supersede で eligibility を失った) なら stale。\n const outcome = this._claimedOutcome.get(operationId) ?? \"stale\";\n this._claimedOutcome.delete(operationId);\n this._releaseController(operationId);\n this._attempts.delete(operationId);\n this._advanceBookkeeping(operationId);\n if (this._trace !== undefined) {\n if (outcome === \"stale\") {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n } else {\n this._trace({ type: \"io:operation-settled\", operationId, laneKey: this.laneKey, outcome });\n }\n }\n }\n\n /** operation の signal (resource 解放用)。withSignal でなければ undefined。 */\n signalOf(ticket: OperationTicket): AbortSignal | undefined {\n return this._controllers.get(ticket.operationId)?.signal;\n }\n\n /** best-effort な resource 中断。正しさは owner gen / eligibility / terminal CAS が担う。 */\n abort(ticket: OperationTicket): void {\n this._abortController(ticket.operationId);\n }\n\n /**\n * 現在 active な operation を中断する (利用者による明示キャンセル)。epoch は進めない —\n * 中断された operation は eligibility を保ったまま 'aborted' を claim できる\n * (loading をクリアしつつ in-flight 状態を残す)。\n */\n abortActive(): void {\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n for (const operationId of this._activeOperationIds) {\n this._abortController(operationId);\n }\n }\n\n /**\n * dispose (§4.1 world generation)。owner generation を bump して全 ticket を無効化し、\n * 生きている controller を全て abort する。dispose 後に settle した operation は\n * owner gen 不一致で外部 commit しない。retention gate (§10.3) のため live な\n * 全 operation を即時に stale として確定し、controller / attempt を解放する。committing 中の\n * operation も同じ — 残りの setter は owner gen で弾かれ、後の finalize は何もしない (終端の\n * 報告は operation ごとに 1 回、docs/io-node-trace-conformance.md §6.3)。\n */\n disposeOwner(): void {\n this._ownerGeneration += 1;\n for (const operationId of Array.from(this._controllers.keys())) {\n this._abortController(operationId);\n // finalize は dispose 後に early-return するため controller を解放しない。\n // retention gate (§10.3) を満たすためここで明示的に解放する。\n this._releaseController(operationId);\n }\n if (this._trace !== undefined) {\n for (const operationId of this._attempts.keys()) {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n }\n }\n this._attempts.clear();\n this._claimedOutcome.clear();\n this._activeOperationId = undefined;\n this._activeOperationIds.clear();\n this._queue.length = 0;\n }\n\n // --- internal ---\n\n private _makeAttempt(operationId: number, attemptNo: number): OperationAttempt {\n let signal: AbortSignal | undefined;\n // AbortController 不在環境(古い runtime / 一部 SSR)では degraded: signal なしで進む。\n // 正しさは owner generation / eligibility / terminal CAS が担うため、native 中断が\n // 無くても supersede / dispose は機能する(best-effort resource 中断が省かれるだけ)。\n if (this._withSignal && typeof AbortController === \"function\") {\n const controller = new AbortController();\n this._controllers.set(operationId, controller);\n signal = controller.signal;\n }\n return { operationId, attempt: attemptNo, signal };\n }\n\n private _isEligible(ticket: OperationTicket): boolean {\n switch (this.policy) {\n case \"latest\":\n return ticket.supersedeEpoch === this._latestEpoch;\n case \"queue\":\n case \"exhaust\":\n return this._activeOperationId === ticket.operationId;\n case \"overlap\":\n return this._activeOperationIds.has(ticket.operationId);\n }\n }\n\n private _advanceBookkeeping(operationId: number): void {\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n if (this._activeOperationId === operationId) {\n this._activeOperationId = undefined;\n }\n break;\n case \"queue\": {\n // 完了した ticket を FIFO から取り除き、次の先頭を active にする。filter で\n // 「先頭 / 非先頭 / 不在」を一様に扱う (finalize は冪等ガードを通った op のみ到達)。\n const remaining = this._queue.filter((t) => t.operationId !== operationId);\n this._queue.length = 0;\n this._queue.push(...remaining);\n this._activeOperationId = this._queue.length > 0 ? this._queue[0].operationId : undefined;\n break;\n }\n case \"overlap\":\n this._activeOperationIds.delete(operationId);\n break;\n }\n }\n\n private _abortController(operationId: number): void {\n const controller = this._controllers.get(operationId);\n if (controller !== undefined && !controller.signal.aborted) {\n controller.abort();\n }\n }\n\n private _releaseController(operationId: number): void {\n this._controllers.delete(operationId);\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/platform-capability.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * platform-capability.ts\n *\n * Phase 6(docs/architecture-hardening/09-remediation-design.md §7.2 /\n * 07-browser-capability-variance.md)の browser capability 判定と error taxonomy の\n * 汎用プリミティブ。node 固有の capability registry / error code は各パッケージが\n * 別ファイルで宣言し、この汎用層(型 + assess 機構)を import する。\n *\n * 原則:\n * - feature detection は境界(利用直前)で行う。module 評価時に browser global を\n * 参照しない(SSR / worker で import が失敗しない)。\n * - capability ID(`web.fetch` 等)は文字列を global property path として eval せず、\n * registry が ID ごとに副作用のない presence probe を対応付ける。\n * - availability / permission / readiness / activity / operation error を 1 つの\n * `ready / unsupported / error` enum に畳まない。required 欠如は開始しない、\n * optional 欠如は宣言済み fallback で readiness を `degraded` にする。\n *\n * 配置: 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * pure(module 評価時に browser global 非参照)。\n */\n\nexport type Availability = \"available\" | \"missing\" | \"unknown\";\nexport type PermissionState = \"granted\" | \"denied\" | \"prompt\" | \"not-applicable\" | \"unknown\";\nexport type Readiness = \"idle\" | \"ready\" | \"degraded\";\nexport type Activity = \"inactive\" | \"active\";\nexport type PreconditionState = \"satisfied\" | \"required\" | \"not-applicable\";\n\n/** operation error の phase(taxonomy)。 */\nexport type WcsIoErrorPhase = \"probe\" | \"start\" | \"execute\" | \"decode\" | \"commit\" | \"dispose\";\n\n/** serializable な error info(non-cloneable な cause とは分離。DevTools / remote へは info のみ)。 */\nexport interface WcsIoErrorInfo {\n readonly code: string;\n readonly phase: WcsIoErrorPhase;\n readonly recoverable: boolean;\n readonly capabilityId?: string;\n readonly message: string;\n}\n\nexport interface PlatformAssessment {\n readonly availability: ReadonlyMap<string, Availability>;\n readonly permission: PermissionState;\n readonly readiness: Readiness;\n readonly activity: Activity;\n readonly preconditions: {\n readonly secureContext: PreconditionState;\n readonly userActivation: PreconditionState;\n };\n readonly epoch: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\n/** capability 1 件の仕様。probe は副作用なく presence を返す(利用直前に呼ぶ)。 */\nexport interface CapabilitySpec {\n readonly probe: () => boolean;\n readonly requiresSecureContext?: boolean;\n readonly requiresUserActivation?: boolean;\n /** browser compatibility dataset のキー(任意・診断用)。 */\n readonly compatKey?: string;\n}\n\nexport type CapabilityRegistry = ReadonlyMap<string, CapabilitySpec>;\n\nexport interface AssessOptions {\n readonly required: readonly string[];\n readonly optional?: readonly string[];\n readonly permission?: PermissionState;\n readonly activity?: Activity;\n readonly epoch?: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\nfunction isSecureContext(): boolean {\n return (globalThis as { isSecureContext?: unknown }).isSecureContext === true;\n}\n\n/**\n * capability を利用直前に評価して PlatformAssessment を作る。\n * required が 1 つでも欠ければ readiness は \"idle\"(開始不可)、\n * required 揃い + optional 欠けは \"degraded\"、全揃いは \"ready\"。\n */\nexport function assessCapabilities(registry: CapabilityRegistry, options: AssessOptions): PlatformAssessment {\n const availability = new Map<string, Availability>();\n const evaluate = (id: string): Availability => {\n const spec = registry.get(id);\n if (spec === undefined) return \"unknown\";\n return spec.probe() ? \"available\" : \"missing\";\n };\n\n let requiredAllAvailable = true;\n for (const id of options.required) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") requiredAllAvailable = false;\n }\n let optionalAllAvailable = true;\n for (const id of options.optional ?? []) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") optionalAllAvailable = false;\n }\n\n const readiness: Readiness = !requiredAllAvailable ? \"idle\" : (optionalAllAvailable ? \"ready\" : \"degraded\");\n\n // preconditions: 対象 capability のいずれかが要求する場合だけ評価する。\n const allIds = [...options.required, ...(options.optional ?? [])];\n const needsSecure = allIds.some((id) => registry.get(id)?.requiresSecureContext === true);\n const needsActivation = allIds.some((id) => registry.get(id)?.requiresUserActivation === true);\n const secureContext: PreconditionState = needsSecure ? (isSecureContext() ? \"satisfied\" : \"required\") : \"not-applicable\";\n const userActivation: PreconditionState = needsActivation ? \"required\" : \"not-applicable\";\n\n return {\n availability,\n permission: options.permission ?? \"not-applicable\",\n readiness,\n activity: options.activity ?? \"inactive\",\n preconditions: { secureContext, userActivation },\n epoch: options.epoch ?? 0,\n lastError: options.lastError,\n };\n}\n\n/** availability から「required がすべて available か」を判定するヘルパ(supported の最低条件)。 */\nexport function requiredCapabilitiesAvailable(assessment: PlatformAssessment, required: readonly string[]): boolean {\n return required.every((id) => assessment.availability.get(id) === \"available\");\n}\n\n/**\n * このページで機能が使えない理由(使える、または分からないなら null)。利用直前に読む。\n *\n * - `\"insecure-context\"`: 安全なコンテキストではない(`isSecureContext === false`)。\n * Permissions API が扱う機能はどれも安全なコンテキストを要る。\n * - `\"policy-blocked\"`: Permissions-Policy(サーバーのヘッダ、または `allow` の無い\n * `<iframe>`)がその機能を切っている。\n *\n * どちらも Permissions API は教えない: Chromium はポリシーで切られた文書でも\n * `granted` を、安全でない origin では `denied` を返す。利用者の拒否と区別するため、\n * 見張り役(`<wcs-permission>`)も取りに行く側も `unsupported` を報告する\n * (docs/v4-direction-2026-10.md の決定、state-field-report)。\n * `isSecureContext` が無い環境(SSR・テスト)は判断しない。\n */\nexport type FeatureUnavailableReason = \"insecure-context\" | \"policy-blocked\";\n\n/** Permissions-Policy が制御する機能(permission 名と同じ文字列)。 */\nconst POLICY_CONTROLLED = new Set([\n \"camera\", \"microphone\", \"geolocation\", \"midi\", \"clipboard-read\", \"clipboard-write\",\n \"screen-wake-lock\", \"idle-detection\", \"accelerometer\", \"gyroscope\", \"magnetometer\",\n \"ambient-light-sensor\", \"display-capture\",\n]);\n\ninterface PolicyLike { allowsFeature(feature: string): boolean }\n\nexport function featureUnavailable(feature: string): FeatureUnavailableReason | null {\n const g = globalThis as { isSecureContext?: unknown; document?: { permissionsPolicy?: PolicyLike; featurePolicy?: PolicyLike } };\n if (g.isSecureContext === false) return \"insecure-context\";\n if (!POLICY_CONTROLLED.has(feature)) return null;\n const policy = g.document?.permissionsPolicy ?? g.document?.featurePolicy;\n if (policy === undefined || typeof policy.allowsFeature !== \"function\") return null;\n try {\n return policy.allowsFeature(feature) ? null : \"policy-blocked\";\n } catch {\n return null;\n }\n}\n\n/** `featureUnavailable` の理由を、作者が直し方を読める文にする。`what` は文頭(「The camera」など)。 */\nexport function featureUnavailableMessage(what: string, feature: string, reason: FeatureUnavailableReason): string {\n return reason === \"insecure-context\"\n ? `${what} needs a secure context (https:, or http://localhost), and this page is not one.`\n : `${what} is turned off for this page by a Permissions-Policy: the server's Permissions-Policy header, ` +\n `or an <iframe> without allow=\"${feature}\". The browser's site settings cannot change that.`;\n}\n","/**\n * eyedropperCapabilities.ts\n *\n * EyeDropper node 固有の capability registry と error code。汎用の assess 機構・型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。node 固有の宣言はこのハンドライトファイルに置き、生成コピーとは分離する。\n */\n\nimport { CapabilityRegistry, CapabilitySpec } from \"./platformCapability.js\";\n\n/** 安定した eyedropper error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_EYEDROPPER_ERROR_CODE = {\n CapabilityMissing: \"capability-missing\",\n PickFailed: \"pick-failed\",\n} as const;\n\n/** eyedropper node の capability registry。文字列 ID を eval せず明示 probe を持つ。 */\nexport const EYEDROPPER_CAPABILITIES: CapabilityRegistry = new Map<string, CapabilitySpec>([\n [\"web.eyedropper\", { probe: () => typeof (globalThis as { EyeDropper?: unknown }).EyeDropper === \"function\", compatKey: \"api.EyeDropper\" }],\n]);\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { OperationLane, OperationTicket } from \"./operationLane.js\";\nimport {\n PlatformAssessment,\n WcsIoErrorInfo,\n WcsIoErrorPhase,\n assessCapabilities,\n requiredCapabilitiesAvailable,\n} from \"./platformCapability.js\";\nimport { EYEDROPPER_CAPABILITIES, WCS_EYEDROPPER_ERROR_CODE } from \"./eyedropperCapabilities.js\";\n\n/**\n * Headless EyeDropper primitive. A thin, framework-agnostic wrapper around\n * `new EyeDropper().open(options)` exposed through the wc-bindable protocol.\n *\n * Concurrency is owned by the shared `OperationLane` (io-core) with the `latest`\n * policy: `EyeDropper.open()` accepts a `{signal}`, so — unlike Web Share / Contact\n * Picker (exhaust) — a caller has a real platform mechanism to cancel an in-flight\n * pick. A new `open()` supersedes the previous one (the lane aborts its\n * AbortController and the superseded completion fails the terminal CAS), and the\n * `abort()` command aborts the active pick. This replaces the ad-hoc `_gen` +\n * `_abortController` + finally-block identity check with the same lane FetchCore\n * uses; the lane owns the per-attempt AbortController and the commit guard.\n *\n * Both the user dismissing the picker with Escape and the caller invoking\n * `abort()` reject `open()` with the same `AbortError` — both land on `cancelled`\n * without distinction (docs/eyedropper-tag-design.md §2).\n */\nexport class EyedropperCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"value\", event: \"wcs-eyedropper:complete\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.value },\n { name: \"loading\", event: \"wcs-eyedropper:loading-changed\", semantics: \"state\" },\n { name: \"error\", event: \"wcs-eyedropper:error\", semantics: \"state\" },\n { name: \"cancelled\", event: \"wcs-eyedropper:cancelled-changed\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output; the existing `error` property/event are unchanged.\n // Fires its own `wcs-eyedropper:error-info-changed` event; no getter, so the\n // bound value is the event detail (mirrors `error` / `loading` / `cancelled`).\n { name: \"errorInfo\", event: \"wcs-eyedropper:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"open\", async: true },\n { name: \"abort\" },\n ],\n };\n\n // Required capability (probed at call time, never at module eval).\n private static readonly REQUIRED_CAPABILITIES = [\"web.eyedropper\"] as const;\n\n private _target: EventTarget;\n private _value: WcsEyedropperData | null = null;\n private _loading: boolean = false;\n private _error: any = null;\n private _cancelled: boolean = false;\n private _errorInfo: WcsIoErrorInfo | null = null;\n // Concurrency lane (io-core). `latest`: a new open() supersedes + aborts the\n // in-flight one (switchMap). `withSignal: true`: the lane owns the per-attempt\n // AbortController whose signal is passed to EyeDropper.open(). dispose() bumps\n // the owner generation and aborts.\n private _lane = new OperationLane(\"eyedropper\", \"latest\", { withSignal: true });\n // SSR (§3.8): no asynchronous probe to await, so readiness is immediate.\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get value(): WcsEyedropperData | null {\n return this._value;\n }\n\n get loading(): boolean {\n return this._loading;\n }\n\n get error(): any {\n return this._error;\n }\n\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable` / `capabilityId`), or null. Exposed as an additive wc-bindable\n * property (event `wcs-eyedropper:error-info-changed`); the existing `error`\n * property/event are unchanged. Note user/abort cancellation is `cancelled`, not\n * `errorInfo`.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Whether the required platform capability (`web.eyedropper`) is available right\n * now — decided by call-time feature detection, not User-Agent. Core-only,\n * additive.\n */\n get supported(): boolean {\n return requiredCapabilitiesAvailable(this.platformAssessment, EyedropperCore.REQUIRED_CAPABILITIES);\n }\n\n /**\n * Full platform assessment (availability / readiness / preconditions), probed at\n * call time. Core-only opt-in dev / sidecar view.\n */\n get platformAssessment(): PlatformAssessment {\n return assessCapabilities(EYEDROPPER_CAPABILITIES, {\n required: EyedropperCore.REQUIRED_CAPABILITIES,\n activity: this._loading ? \"active\" : \"inactive\",\n lastError: this._errorInfo ?? undefined,\n });\n }\n\n // Lifecycle (§3.5). EyeDropper is command-driven with no subscription to\n // establish, so observe() is an idempotent no-op that resolves once ready;\n // dispose() bumps the lane's owner generation (invalidating any in-flight open())\n // and aborts its AbortController.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this._lane.disposeOwner();\n // The operation the lane drops settles nothing any more, so its end is published\n // here (timing-and-firing-contract §22): a route the element leaves keeps its\n // nodes — bindings included — for the next entry, and state would keep `loading`.\n this._setLoading(false);\n }\n\n // CommitGuard (§5.1): external setters / event dispatch only run if the ticket\n // still holds owner generation, is pre-terminal, and is the lane's latest epoch\n // (a superseding open() can invalidate a ticket mid-commit).\n private _commitStep(ticket: OperationTicket, step: () => void): void {\n if (this._lane.canCommit(ticket)) {\n step();\n }\n }\n\n private _setLoading(loading: boolean): void {\n if (this._loading === loading) return;\n this._loading = loading;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:loading-changed\", {\n detail: loading,\n bubbles: true,\n }));\n }\n\n private _setValue(value: WcsEyedropperData | null): void {\n if (this._value === value) return;\n this._value = value;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:complete\", {\n detail: { value },\n bubbles: true,\n }));\n }\n\n private _setError(error: any): void {\n if (this._error === error) return;\n this._error = error;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n private _setCancelled(cancelled: boolean): void {\n if (this._cancelled === cancelled) return;\n this._cancelled = cancelled;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:cancelled-changed\", {\n detail: cancelled,\n bubbles: true,\n }));\n }\n\n // Single mutation point for `errorInfo`, mirroring `_setError`'s same-value guard\n // and event dispatch so the additive `errorInfo` wc-bindable property stays in\n // sync with `error`. Each failure builds a fresh object (reference guard passes);\n // the clear path passes null (suppresses a redundant null→null per open start).\n private _setErrorInfo(code: string, phase: WcsIoErrorPhase, recoverable: boolean, message: string, capabilityId?: string): void {\n this._commitErrorInfo({ code, phase, recoverable, message, ...(capabilityId === undefined ? {} : { capabilityId }) });\n }\n\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n if (this._errorInfo === info) return;\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Cancels an in-flight `open()` call, if any (a no-op otherwise). Aborts the\n * lane's active AbortController — the in-flight open() then rejects with\n * `AbortError` and lands on `cancelled`. The epoch is not advanced, so the\n * aborted operation keeps eligibility to claim the `aborted` terminal.\n */\n abort(): void {\n this._lane.abortActive();\n }\n\n async open(): Promise<WcsEyedropperData | null> {\n // never-throw + unsupported (§4 / §7.2): probe the required capability at call\n // time (non-Chromium browsers lack this API). If `web.eyedropper` is absent, do\n // NOT start — surface a stable `capability-missing` taxonomy and the existing\n // error message shape.\n const assessment = this.platformAssessment;\n if (!requiredCapabilitiesAvailable(assessment, EyedropperCore.REQUIRED_CAPABILITIES)) {\n const missing = EyedropperCore.REQUIRED_CAPABILITIES.find((id) => assessment.availability.get(id) !== \"available\");\n const message = \"EyeDropper API is not supported in this browser.\";\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.CapabilityMissing, \"start\", false, message, missing);\n this._setError({ message });\n return null;\n }\n\n // `latest`: advance the epoch and abort the previous in-flight pick (supersede).\n // begin() never returns null for latest.\n const started = this._lane.begin()!;\n const { ticket, attempt } = started;\n const signal = attempt.signal;\n\n // Capability probed above → EyeDropper is present. Resolve the constructor at\n // call time (never cached, §3.7) so tests can install/remove it freely.\n const EyeDropperCtor = (globalThis as { EyeDropper?: new () => { open(options?: { signal?: AbortSignal }): Promise<WcsEyedropperData> } }).EyeDropper!;\n\n this._commitStep(ticket, () => this._setLoading(true));\n // Reset the previous outcome before starting a new open() so a stale\n // cancelled/error/errorInfo does not linger into this call's result.\n this._commitStep(ticket, () => {\n this._commitErrorInfo(null);\n this._setError(null);\n this._setCancelled(false);\n });\n\n try {\n const result = await new EyeDropperCtor().open({ signal });\n // Terminal CAS: a stale (superseded / dispose-invalidated) completion loses\n // the claim and is dropped without writing state.\n if (!this._lane.claimTerminal(ticket, \"success\")) {\n return null;\n }\n // The platform's own result object ({ sRGBHex }) is used verbatim (§3).\n // Separate commit steps (like FetchCore): if `_setValue`'s event listener\n // synchronously supersedes this op, the following `_setLoading(false)` is\n // stopped by the commit guard rather than clobbering the newer op.\n this._commitStep(ticket, () => this._setValue(result));\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return result;\n } catch (e: any) {\n const cancelled = e?.name === \"AbortError\";\n if (!this._lane.claimTerminal(ticket, cancelled ? \"aborted\" : \"error\")) {\n return null;\n }\n this._commitStep(ticket, () => {\n if (cancelled) {\n // Either the user dismissed the picker with Escape or the caller invoked\n // abort() — a routine cancellation, not a platform failure, and not\n // distinguished (§2). Kept out of `error`/`errorInfo`.\n this._setCancelled(true);\n } else {\n const message = String(e?.message ?? \"Color pick failed.\");\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.PickFailed, \"execute\", true, message);\n this._setError(e ?? { message });\n }\n });\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return null;\n }\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n// 属性になってしまったオブジェクトの入力(`files=\"[object File]\"`)を、要素ごとに 1 回だけ言う。\n// React 19 は定義前の要素にプロパティが無いのでオブジェクトを属性に書き、Vue の `.attr` も\n// 書く。要素はその入力をプロパティでしか読まないので、何も受け取らず、何も言わなかった\n// (docs/seam-apps.md、fw-inventory)。\nconst toldObjectAttribute = new WeakSet<object>();\n\nfunction warnObjectAttribute(element: object, name: string, value: string): void {\n if (toldObjectAttribute.has(element)) return;\n toldObjectAttribute.add(element);\n const tag = (element as { localName?: string }).localName ?? \"element\";\n console.warn(\n `[wcs/input-as-attribute] <${tag}> has the attribute ${name}=\"${value}\": an object was written as an ` +\n `attribute, so the element did not receive it. A framework does that when the property is set before the ` +\n `element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, ` +\n `or assign the property through a ref (Vue: .prop). (Said once per element.)`,\n element,\n );\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n * - 値が `[object …]` の属性(属性に書かれてしまったオブジェクトの入力)は、要素ごとに 1 回警告する。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n const getAttribute = (element as { getAttribute?: (name: string) => string | null }).getAttribute;\n for (const input of inputs) {\n const name = input.name;\n const attribute = typeof getAttribute === \"function\" ? getAttribute.call(element, name.toLowerCase()) : null;\n if (attribute !== null && attribute.startsWith(\"[object \")) warnObjectAttribute(element, name, attribute);\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { EyedropperCore } from \"../core/EyedropperCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-eyedropper>` — declarative EyeDropper API primitive.\n *\n * The smallest command-only Shell in the batch (docs/eyedropper-tag-design.md\n * §5), mirroring `<wcs-share>`: no attributes at all. `open()` takes no\n * per-call argument — the `{signal}` option is supplied internally by the\n * Core's own AbortController, never via the command-token surface.\n */\nexport class WcsEyedropper extends HTMLElement {\n // SSR (§4.4): observe() completes synchronously, but the Shell still exposes\n // connectedCallbackPromise so the state binder can await it uniformly across\n // all IO nodes before snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...EyedropperCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: EyedropperCore.wcBindable.commands,\n };\n\n private _core: EyedropperCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new EyedropperCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-eyedropper:loading-changed\": (d) => ({ loading: d === true }),\n \"wcs-eyedropper:cancelled-changed\": (d) => ({ cancelled: d === true }),\n \"wcs-eyedropper:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (async-io-node-guidelines.md §3.6): attachInternals is absent\n // in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Core delegated getters ---\n\n get value(): WcsEyedropperData | null {\n return this._core.value;\n }\n\n get loading(): boolean {\n return this._core.loading;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get cancelled(): boolean {\n return this._core.cancelled;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands ---\n\n open(): Promise<WcsEyedropperData | null> {\n return this._core.open();\n }\n\n abort(): void {\n this._core.abort();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/define-element.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * One copy of each package on a page (docs/timing-and-firing-contract.md §24). The first copy the\n * page evaluates defines the tags and a second one does nothing, so a copy that finds its tag defined\n * by another copy of the package — not its class, not a subclass of it, not the same version — warns\n * `[wcs/package-twice]` once per registry, naming both versions. The classes it defines carry\n * `\"<package>@<version>\"` under `Symbol.for(\"wcstack.package\")`; a class without it is named\n * \"another copy of <package> that does not name its version\" (an older copy, or one loaded through\n * an entry that does not stamp).\n */\n\n/** The static a class defined through this helper carries: `\"@wcstack/fetch@<version>\"`. */\nexport const PACKAGE_STAMP: unique symbol = Symbol.for(\"wcstack.package\");\n\ntype Stamped = { [PACKAGE_STAMP]?: string };\n\n/** The registries this copy warned about: one warning per package per registry. */\nconst warned = new WeakSet<CustomElementRegistry>();\n\n/**\n * Marks `cls` as defined by `pkg` (`\"@wcstack/fetch@<version>\"`). A subclass inherits the mark, and\n * `defineProperty` writes it even where a parent's mark is read-only.\n */\nexport function stampPackage(cls: CustomElementConstructor, pkg: string): void {\n Object.defineProperty(cls, PACKAGE_STAMP, { value: pkg, configurable: true });\n}\n\n/**\n * Warns when `tag` is defined as `existing` by another copy of the package `pkg` names: `existing`\n * is neither `own` nor a subclass of it (omit `own` when the copy has no class to compare with), and\n * carries another version or none. Once per registry.\n */\nexport function warnIfAnotherCopy(\n registry: CustomElementRegistry,\n tag: string,\n existing: CustomElementConstructor,\n own: CustomElementConstructor | undefined,\n pkg: string,\n): void {\n if (own !== undefined && (existing === own || existing.prototype instanceof own)) return;\n const theirs = (existing as Stamped)[PACKAGE_STAMP];\n if (theirs === pkg || warned.has(registry)) return;\n warned.add(registry);\n const name = pkg.slice(0, pkg.lastIndexOf(\"@\"));\n console.warn(\n `[${name}] [wcs/package-twice] <${tag}> is already defined by ` +\n `${theirs ?? `another copy of ${name} that does not name its version`}; ` +\n `this copy, ${pkg}, does nothing. Load each package once.`,\n );\n}\n\n/**\n * Defines each `[tag, class]` in `registry` unless the tag is already defined, stamping the class\n * with `pkg` (`\"@wcstack/fetch@<version>\"`). A tag another copy of the package defined first is left\n * as it is, with the warning above.\n */\nexport function defineElements(\n registry: CustomElementRegistry,\n pkg: string,\n definitions: readonly (readonly [tag: string, cls: CustomElementConstructor])[],\n): void {\n for (const [tag, cls] of definitions) {\n const existing = registry.get(tag);\n if (existing === undefined) {\n stampPackage(cls, pkg);\n registry.define(tag, cls);\n } else {\n warnIfAnotherCopy(registry, tag, existing, cls, pkg);\n }\n }\n}\n","import pkg from \"../package.json\" with { type: \"json\" };\nimport { WcsEyedropper } from \"./components/Eyedropper.js\";\nimport { config } from \"./config.js\";\nimport { defineElements } from \"./protocol/defineElement.js\";\n\n/**\n * Register this package's tags. Pass a scoped `CustomElementRegistry` to define\n * them for a single shadow tree -- scoped registries do not inherit the global\n * one, so a tree using one needs its own definitions.\n */\nexport function registerComponents(registry: CustomElementRegistry = customElements): void {\n defineElements(registry, `${pkg.name}@${pkg.version}`, [\n [config.tagNames.eyedropper, WcsEyedropper],\n ]);\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapEyedropper(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n"],"names":["config","tagNames","eyedropper","OperationLane","laneKey","policy","_ownerGeneration","_latestEpoch","_nextOperationId","_activeOperationId","undefined","_activeOperationIds","Set","_queue","_claimedOutcome","Map","_controllers","_attempts","_withSignal","_trace","constructor","options","this","withSignal","trace","ownerGeneration","inFlightCount","size","latestEpoch","activeOperationId","begin","supersedeEpoch","_abortController","operationId","ticket","push","add","set","attempt","_makeAttempt","type","retry","previous","get","has","_isEligible","attemptNo","_releaseController","canCommit","claimTerminal","outcome","claimedOutcome","finalize","delete","_advanceBookkeeping","signalOf","signal","abort","abortActive","disposeOwner","Array","from","keys","clear","length","AbortController","controller","remaining","filter","t","aborted","assessCapabilities","registry","availability","evaluate","id","spec","probe","requiredAllAvailable","required","a","optionalAllAvailable","optional","readiness","allIds","needsSecure","some","requiresSecureContext","needsActivation","requiresUserActivation","secureContext","globalThis","isSecureContext","userActivation","permission","activity","preconditions","epoch","lastError","requiredCapabilitiesAvailable","assessment","every","WCS_EYEDROPPER_ERROR_CODE","EYEDROPPER_CAPABILITIES","EyeDropper","compatKey","EyedropperCore","EventTarget","static","protocol","version","properties","name","event","semantics","getter","e","detail","value","commands","async","_target","_value","_loading","_error","_cancelled","_errorInfo","_lane","_ready","Promise","resolve","target","super","ready","loading","error","cancelled","errorInfo","supported","platformAssessment","REQUIRED_CAPABILITIES","observe","dispose","_setLoading","_commitStep","step","dispatchEvent","CustomEvent","bubbles","_setValue","_setError","_setCancelled","_setErrorInfo","code","phase","recoverable","message","capabilityId","_commitErrorInfo","info","open","missing","find","started","EyeDropperCtor","result","String","hasAccessorOnPrototype","proto","Object","getPrototypeOf","descriptor","getOwnPropertyDescriptor","toldObjectAttribute","WeakSet","warnObjectAttribute","element","tag","localName","console","warn","WcsEyedropper","HTMLElement","wcBindable","inputs","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","d","debugStates","states","attachInternals","internals","map","toStates","entries","addEventListener","debug","hasAttribute","on","toggleAttribute","connectedCallbackPromise","connectedCallback","declaration","getAttribute","input","attribute","call","toLowerCase","startsWith","prototype","hasOwnProperty","record","upgradeProperties","style","display","disconnectedCallback","PACKAGE_STAMP","Symbol","for","warned","stampPackage","cls","pkg","defineProperty","configurable","warnIfAnotherCopy","existing","own","theirs","slice","lastIndexOf","registerCompon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EAAaC,EAA+BC,GAC1DxD,OAAOyD,eAAeF,EAAKL,EAAe,CAAErG,MAAO2G,EAAKE,cAAc,GACxE,CAOM,SAAUC,EACd5J,EACAyG,EACAoD,EACAC,EACAL,GAEA,QAAYvN,IAAR4N,IAAsBD,IAAaC,GAAOD,EAASjB,qBAAqBkB,GAAM,OAClF,MAAMC,EAAUF,EAAqBV,GACrC,GAAIY,IAAWN,GAAOH,EAAOlL,IAAI4B,GAAW,OAC5CsJ,EAAO1L,IAAIoC,GACX,MAAMwC,EAAOiH,EAAIO,MAAM,EAAGP,EAAIQ,YAAY,MAC1CtD,QAAQC,KACN,IAAIpE,2BAA8BiE,4BAC/BsD,GAAU,mBAAmBvH,kDAClBiH,2CAElB,CC5CM,SAAUS,EAAmBlK,EAAkCmK,0BDoDnEnK,EACAyJ,EACAW,GAEA,IAAK,MAAO3D,EAAK+C,KAAQY,EAAa,CACpC,MAAMP,EAAW7J,EAAS7B,IAAIsI,QACbvK,IAAb2N,GACFN,EAAaC,EAAKC,GAClBzJ,EAASqK,OAAO5D,EAAK+C,IAErBI,EAAkB5J,EAAUyG,EAAKoD,EAAUL,EAAKC,EAEpD,CACF,CChEEa,CAAetK,EAAU,GAAGyJ,KAAYA,IAAe,CACrD,CAACjO,EAAOC,SAASC,WAAYmL,IAEjC,CCVM,IAA4D7G,EAIhEkK,EAAmBlK"}
package/dist/index.esm.js CHANGED
@@ -65,7 +65,7 @@ function setConfig(partialConfig) {
65
65
  frozenConfig = null;
66
66
  }
67
67
 
68
- var pkg = {"name":"@wcstack/eyedropper","version":"4.14.0"};
68
+ var pkg = {"name":"@wcstack/eyedropper","version":"4.16.0"};
69
69
 
70
70
  // ===========================================================================
71
71
  // AUTO-GENERATED FILE - DO NOT EDIT.
@@ -88,14 +88,13 @@ class OperationLane {
88
88
  _activeOperationIds = new Set();
89
89
  // queue policy の FIFO。
90
90
  _queue = [];
91
- _inFlightCount = 0;
92
- // opId → 終端状態 (absence = pending)。
93
- _terminal = new Map();
94
- // claimTerminal で確定した outcome (finalize が 'committing' を最終値へ移す)。
91
+ // opId → claimTerminal で確定した outcome。存在 = committing (finalize が確定させる)。
95
92
  _claimedOutcome = new Map();
96
93
  // opId → AbortController (identity は opId が保証。cross-op clobber は構造上起きない)。
97
94
  _controllers = new Map();
98
- // opId → attempt 数。
95
+ // opId → attempt 数。存在 = live (begin 済みで finalize / dispose 前) で、in-flight はこの大きさ。
96
+ // 終わった operation は何も残さない — 終端済みの記録を持つと長く開いたページで際限なく増える
97
+ // (docs/formal-methods-study.md §4.1)。
99
98
  _attempts = new Map();
100
99
  _withSignal;
101
100
  _trace;
@@ -109,7 +108,7 @@ class OperationLane {
109
108
  return this._ownerGeneration;
110
109
  }
111
110
  get inFlightCount() {
112
- return this._inFlightCount;
111
+ return this._attempts.size;
113
112
  }
114
113
  get latestEpoch() {
115
114
  return this._latestEpoch;
@@ -165,7 +164,6 @@ class OperationLane {
165
164
  this._activeOperationIds.add(operationId);
166
165
  break;
167
166
  }
168
- this._inFlightCount += 1;
169
167
  this._attempts.set(operationId, 1);
170
168
  const attempt = this._makeAttempt(operationId, 1);
171
169
  if (this._trace !== undefined) {
@@ -175,15 +173,17 @@ class OperationLane {
175
173
  }
176
174
  /**
177
175
  * retry: 同じ operationId に新しい attempt を作る。attempt number と resource signal
178
- * だけを更新する (§5)。既に終端した operation には作れない (null)。
176
+ * だけを更新する (§5)。終端した・claim 済みの operation と、もう commit できない operation
177
+ * (supersede された latest / queue の先頭の後ろで待つもの) には作れない (null) — 結果を
178
+ * 捨てるしかない要求に新しい signal を渡さない (docs/formal-methods-study.md §4.1)。
179
179
  */
180
180
  retry(ticket) {
181
181
  if (ticket.ownerGeneration !== this._ownerGeneration)
182
182
  return null;
183
- if (this._terminal.has(ticket.operationId))
184
- return null;
185
183
  const previous = this._attempts.get(ticket.operationId);
186
- if (previous === undefined)
184
+ if (previous === undefined || this._claimedOutcome.has(ticket.operationId))
185
+ return null;
186
+ if (!this._isEligible(ticket))
187
187
  return null;
188
188
  const attemptNo = previous + 1;
189
189
  this._attempts.set(ticket.operationId, attemptNo);
@@ -202,9 +202,8 @@ class OperationLane {
202
202
  canCommit(ticket) {
203
203
  if (ticket.ownerGeneration !== this._ownerGeneration)
204
204
  return false;
205
- const status = this._terminal.get(ticket.operationId);
206
- // absence = pending / 'committing' = multi-setter commit 中。どちらも settle 前。
207
- if (status !== undefined && status !== "committing")
205
+ // live でなければ settle 済み。pending と committing (multi-setter commit 中) はどちらも settle 前。
206
+ if (!this._attempts.has(ticket.operationId))
208
207
  return false;
209
208
  return this._isEligible(ticket);
210
209
  }
@@ -216,11 +215,11 @@ class OperationLane {
216
215
  claimTerminal(ticket, outcome) {
217
216
  if (ticket.ownerGeneration !== this._ownerGeneration)
218
217
  return false;
219
- if (this._terminal.has(ticket.operationId))
220
- return false; // 既に committing / 終端
218
+ // 終端済み (live でない) / 既に committing
219
+ if (!this._attempts.has(ticket.operationId) || this._claimedOutcome.has(ticket.operationId))
220
+ return false;
221
221
  if (!this._isEligible(ticket))
222
222
  return false;
223
- this._terminal.set(ticket.operationId, "committing");
224
223
  this._claimedOutcome.set(ticket.operationId, outcome);
225
224
  return true;
226
225
  }
@@ -234,25 +233,15 @@ class OperationLane {
234
233
  */
235
234
  finalize(ticket) {
236
235
  const operationId = ticket.operationId;
237
- const status = this._terminal.get(operationId);
238
- if (status !== undefined && status !== "committing") {
239
- // 既に確定済み。冪等に return。
236
+ // live でなければ確定済み (finalize 済み、または dispose が stale として確定した)。冪等に return —
237
+ // dispose 前の ticket が先へ進むと、新しい owner の in-flight を数え下げてしまう。
238
+ if (!this._attempts.has(operationId))
240
239
  return;
241
- }
242
- let outcome;
243
- if (status === "committing") {
244
- outcome = this._claimedOutcome.get(operationId) ?? "stale";
245
- }
246
- else {
247
- // 一度も claim されなかった (supersede / dispose で eligibility を失った)。
248
- outcome = "stale";
249
- }
250
- this._terminal.set(operationId, outcome);
240
+ // 一度も claim されなかった (supersede で eligibility を失った) なら stale。
241
+ const outcome = this._claimedOutcome.get(operationId) ?? "stale";
251
242
  this._claimedOutcome.delete(operationId);
252
243
  this._releaseController(operationId);
253
244
  this._attempts.delete(operationId);
254
- if (this._inFlightCount > 0)
255
- this._inFlightCount -= 1;
256
245
  this._advanceBookkeeping(operationId);
257
246
  if (this._trace !== undefined) {
258
247
  if (outcome === "stale") {
@@ -288,30 +277,28 @@ class OperationLane {
288
277
  * dispose (§4.1 world generation)。owner generation を bump して全 ticket を無効化し、
289
278
  * 生きている controller を全て abort する。dispose 後に settle した operation は
290
279
  * owner gen 不一致で外部 commit しない。retention gate (§10.3) のため live な
291
- * 全 operation を即時に stale として finalize し、controller / attempt を解放する。
280
+ * 全 operation を即時に stale として確定し、controller / attempt を解放する。committing 中の
281
+ * operation も同じ — 残りの setter は owner gen で弾かれ、後の finalize は何もしない (終端の
282
+ * 報告は operation ごとに 1 回、docs/io-node-trace-conformance.md §6.3)。
292
283
  */
293
284
  disposeOwner() {
294
285
  this._ownerGeneration += 1;
295
286
  for (const operationId of Array.from(this._controllers.keys())) {
296
287
  this._abortController(operationId);
297
- // finalize は dispose 後 (terminal='stale') に early-return するため controller を
298
- // 解放しない。retention gate (§10.3) を満たすためここで明示的に解放する。
288
+ // finalize は dispose 後に early-return するため controller を解放しない。
289
+ // retention gate (§10.3) を満たすためここで明示的に解放する。
299
290
  this._releaseController(operationId);
300
291
  }
301
- for (const operationId of Array.from(this._attempts.keys())) {
302
- if (!this._terminal.has(operationId)) {
303
- this._terminal.set(operationId, "stale");
304
- }
305
- this._claimedOutcome.delete(operationId);
306
- this._attempts.delete(operationId);
307
- if (this._trace !== undefined) {
292
+ if (this._trace !== undefined) {
293
+ for (const operationId of this._attempts.keys()) {
308
294
  this._trace({ type: "io:stale-dropped", operationId, laneKey: this.laneKey });
309
295
  }
310
296
  }
297
+ this._attempts.clear();
298
+ this._claimedOutcome.clear();
311
299
  this._activeOperationId = undefined;
312
300
  this._activeOperationIds.clear();
313
301
  this._queue.length = 0;
314
- this._inFlightCount = 0;
315
302
  }
316
303
  // --- internal ---
317
304
  _makeAttempt(operationId, attemptNo) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../src/config.ts","../../src/core/operationLane.ts","../../src/core/platformCapability.ts","../../src/core/eyedropperCapabilities.ts","../../src/core/EyedropperCore.ts","../../src/protocol/upgradeProperties.ts","../../src/components/Eyedropper.ts","../../src/protocol/defineElement.ts","../../src/registerComponents.ts","../../src/bootstrapEyedropper.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n eyedropper: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n eyedropper: \"wcs-eyedropper\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\n// Note: this is the live, mutable internal config. It is not part of the public\n// package exports (see exports.ts) — only `getConfig()` (a frozen snapshot) is\n// surfaced. `setConfig()` is applied internally via `bootstrapEyedropper()` and\n// is not re-exported from the package root, though a deep path import\n// (`.../src/config.js`) can still reach and mutate it. Accepted as-is for\n// cross-package consistency: every @wcstack package follows this same shape.\n// Use `getConfig()` for a frozen, safe read.\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\n/** A misspelt option would otherwise do nothing: `bootstrapEyedropper` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/eyedropper] bootstrapEyedropper: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/operation-lane.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * operationLane.ts\n *\n * Phase 4 (docs/architecture-hardening/09-remediation-design.md §5, §5.1) の\n * OperationTicket / CommitGuard / terminal CAS を型付き実装した lane プリミティブ。\n * docs/async-execution-model.md §5 が既に規範化した排他モード\n * (latest / queue / exhaust / overlap) を、`AbortController` だけでは防げない\n * 「取消不能な Promise・abort と同時に完了した結果の commit」から守るための\n * 実行時ガードとして具体化する。\n *\n * 配置方針 (§5): 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * 初期 PoC は fetch の `latest` policy から開始した。現在は4 policy 全てを\n * `operationLane.test.ts` が直接検証し、生成コピーを fetch / upload / share /\n * contacts / credential / eyedropper が利用する。lane 自体は promise を実行せず、\n * bookkeeping と guard の状態機械に徹する — 実際の非同期処理は Core が駆動し\n * lane に照合する。\n */\n\n/** §5: 排他モードの語彙。async-execution-model.md §5 の 4 モードに対応 (parallel は予約語・スコープ外)。 */\nexport type LanePolicy = \"latest\" | \"queue\" | \"exhaust\" | \"overlap\";\n\n/** §5: 各 operation の一回限りの終端結果。 */\nexport type TerminalOutcome = \"success\" | \"error\" | \"timeout\" | \"aborted\" | \"stale\";\n\n/** §5: 論理操作 1 件の identity。retry は同じ operationId を再利用する。 */\nexport interface OperationTicket {\n readonly operationId: number;\n /** 発行時に捕捉した I/O Core の observe / reconnect / dispose lifecycle 世代。 */\n readonly ownerGeneration: number;\n readonly laneKey: string;\n readonly policy: LanePolicy;\n /** supersede bookkeeping に使う epoch (latest policy のみ)。 */\n readonly supersedeEpoch?: number;\n}\n\n/** §5: operation の 1 回の試行。retry で attempt++ と resource signal だけ差し替える。 */\nexport interface OperationAttempt {\n readonly operationId: number;\n readonly attempt: number;\n readonly signal?: AbortSignal;\n}\n\n/** §6: DevTools 側 channel へ流す trace(fetch では既定 off・zero-cost)。 */\nexport type OperationTraceEvent =\n | { readonly type: \"io:operation-started\"; readonly operationId: number; readonly laneKey: string; readonly policy: LanePolicy }\n | { readonly type: \"io:operation-retried\"; readonly operationId: number; readonly laneKey: string; readonly attempt: number }\n | { readonly type: \"io:operation-settled\"; readonly operationId: number; readonly laneKey: string; readonly outcome: TerminalOutcome }\n | { readonly type: \"io:stale-dropped\"; readonly operationId: number; readonly laneKey: string };\n\nexport interface OperationLaneOptions {\n /** attempt ごとに AbortController を発行し signal を渡す (fetch/upload 系)。 */\n readonly withSignal?: boolean;\n /**\n * trace subscriber。undefined なら trace record を一切生成しない\n * (§10.3 hook-off zero allocation の gate)。\n */\n readonly trace?: (event: OperationTraceEvent) => void;\n}\n\n/** 内部の終端状態。absence = pending。'committing' は multi-setter commit 中の中間状態。 */\ntype TerminalStatus = \"committing\" | TerminalOutcome;\n\n/**\n * 1 レーン = 独立した排他単位。Core が 1 つ以上所有する (module singleton にしない —\n * 複数 <wcs-fetch> 間で漏れるため)。\n */\nexport class OperationLane {\n readonly laneKey: string;\n readonly policy: LanePolicy;\n\n private _ownerGeneration = 0;\n private _latestEpoch = 0;\n private _nextOperationId = 1;\n // latest / queue / exhaust の単一 active。queue は head を指す。\n private _activeOperationId: number | undefined = undefined;\n // overlap の active set (§5: 内部 bookkeeping のみ・observable 公開はしない)。\n private readonly _activeOperationIds = new Set<number>();\n // queue policy の FIFO。\n private readonly _queue: OperationTicket[] = [];\n private _inFlightCount = 0;\n // opId → 終端状態 (absence = pending)。\n private readonly _terminal = new Map<number, TerminalStatus>();\n // claimTerminal で確定した outcome (finalize が 'committing' を最終値へ移す)。\n private readonly _claimedOutcome = new Map<number, TerminalOutcome>();\n // opId → AbortController (identity は opId が保証。cross-op clobber は構造上起きない)。\n private readonly _controllers = new Map<number, AbortController>();\n // opId → attempt 数。\n private readonly _attempts = new Map<number, number>();\n private readonly _withSignal: boolean;\n private readonly _trace?: (event: OperationTraceEvent) => void;\n\n constructor(laneKey: string, policy: LanePolicy, options: OperationLaneOptions = {}) {\n this.laneKey = laneKey;\n this.policy = policy;\n this._withSignal = options.withSignal ?? false;\n this._trace = options.trace;\n }\n\n get ownerGeneration(): number {\n return this._ownerGeneration;\n }\n\n get inFlightCount(): number {\n return this._inFlightCount;\n }\n\n get latestEpoch(): number {\n return this._latestEpoch;\n }\n\n get activeOperationId(): number | undefined {\n return this._activeOperationId;\n }\n\n /**\n * 新しい要求の到着。arrival policy を適用し ticket + 最初の attempt を発行する。\n * exhaust で実行中の場合だけ null を返す (新要求を ticket 化せず拒否 = 冪等 no-op)。\n */\n begin(): { ticket: OperationTicket; attempt: OperationAttempt } | null {\n let supersedeEpoch: number | undefined;\n switch (this.policy) {\n case \"latest\": {\n // latestEpoch を進め、旧 active を abort (可能なら)。旧 ticket は settle 時に\n // eligibility 不一致で stale となる。\n supersedeEpoch = ++this._latestEpoch;\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n break;\n }\n case \"exhaust\": {\n // 実行中なら新要求を拒否 (呼び出し側は既存結果へ合流)。\n if (this._activeOperationId !== undefined) {\n return null;\n }\n break;\n }\n case \"queue\":\n case \"overlap\":\n break;\n }\n\n const operationId = this._nextOperationId++;\n const ticket: OperationTicket = {\n operationId,\n ownerGeneration: this._ownerGeneration,\n laneKey: this.laneKey,\n policy: this.policy,\n supersedeEpoch,\n };\n\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n this._activeOperationId = operationId;\n break;\n case \"queue\":\n this._queue.push(ticket);\n // 先頭だけを active にする (先行が完了するまで待つ)。\n if (this._activeOperationId === undefined) {\n this._activeOperationId = operationId;\n }\n break;\n case \"overlap\":\n this._activeOperationIds.add(operationId);\n break;\n }\n\n this._inFlightCount += 1;\n this._attempts.set(operationId, 1);\n const attempt = this._makeAttempt(operationId, 1);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-started\", operationId, laneKey: this.laneKey, policy: this.policy });\n }\n return { ticket, attempt };\n }\n\n /**\n * retry: 同じ operationId に新しい attempt を作る。attempt number と resource signal\n * だけを更新する (§5)。既に終端した operation には作れない (null)。\n */\n retry(ticket: OperationTicket): OperationAttempt | null {\n if (ticket.ownerGeneration !== this._ownerGeneration) return null;\n if (this._terminal.has(ticket.operationId)) return null;\n const previous = this._attempts.get(ticket.operationId);\n if (previous === undefined) return null;\n const attemptNo = previous + 1;\n this._attempts.set(ticket.operationId, attemptNo);\n // 前の attempt の signal は破棄し、新しい controller を張る。\n this._releaseController(ticket.operationId);\n const attempt = this._makeAttempt(ticket.operationId, attemptNo);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-retried\", operationId: ticket.operationId, laneKey: this.laneKey, attempt: attemptNo });\n }\n return attempt;\n }\n\n /**\n * CommitGuard (§5.1)。外部可視の setter / event dispatch の直前に呼ぶ。\n * (1) owner lifecycle generation 一致 (2) terminal settle 前 (3) policy eligibility。\n */\n canCommit(ticket: OperationTicket): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n const status = this._terminal.get(ticket.operationId);\n // absence = pending / 'committing' = multi-setter commit 中。どちらも settle 前。\n if (status !== undefined && status !== \"committing\") return false;\n return this._isEligible(ticket);\n }\n\n /**\n * terminal CAS (§5.1): pending → committing を claim する。勝者だけが true。\n * eligibility / owner gen を満たさない場合も false。claim 後は commit 中となり、\n * canCommit は各 setter の直前で再検査する (setter が同期 supersede しても取りこぼさない)。\n */\n claimTerminal(ticket: OperationTicket, outcome: TerminalOutcome): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n if (this._terminal.has(ticket.operationId)) return false; // 既に committing / 終端\n if (!this._isEligible(ticket)) return false;\n this._terminal.set(ticket.operationId, \"committing\");\n this._claimedOutcome.set(ticket.operationId, outcome);\n return true;\n }\n\n /** claim 済み outcome (timer が claim → catch が読む等)。未 claim なら undefined。 */\n claimedOutcome(ticket: OperationTicket): TerminalOutcome | undefined {\n return this._claimedOutcome.get(ticket.operationId);\n }\n\n /**\n * operation の後始末。claim 済みなら outcome を確定し、未 claim なら stale-drop。\n * controller を解放し in-flight を減らし、policy の bookkeeping を進める。冪等。\n */\n finalize(ticket: OperationTicket): void {\n const operationId = ticket.operationId;\n const status = this._terminal.get(operationId);\n if (status !== undefined && status !== \"committing\") {\n // 既に確定済み。冪等に return。\n return;\n }\n let outcome: TerminalOutcome;\n if (status === \"committing\") {\n outcome = this._claimedOutcome.get(operationId) ?? \"stale\";\n } else {\n // 一度も claim されなかった (supersede / dispose で eligibility を失った)。\n outcome = \"stale\";\n }\n this._terminal.set(operationId, outcome);\n this._claimedOutcome.delete(operationId);\n this._releaseController(operationId);\n this._attempts.delete(operationId);\n if (this._inFlightCount > 0) this._inFlightCount -= 1;\n this._advanceBookkeeping(operationId);\n if (this._trace !== undefined) {\n if (outcome === \"stale\") {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n } else {\n this._trace({ type: \"io:operation-settled\", operationId, laneKey: this.laneKey, outcome });\n }\n }\n }\n\n /** operation の signal (resource 解放用)。withSignal でなければ undefined。 */\n signalOf(ticket: OperationTicket): AbortSignal | undefined {\n return this._controllers.get(ticket.operationId)?.signal;\n }\n\n /** best-effort な resource 中断。正しさは owner gen / eligibility / terminal CAS が担う。 */\n abort(ticket: OperationTicket): void {\n this._abortController(ticket.operationId);\n }\n\n /**\n * 現在 active な operation を中断する (利用者による明示キャンセル)。epoch は進めない —\n * 中断された operation は eligibility を保ったまま 'aborted' を claim できる\n * (loading をクリアしつつ in-flight 状態を残す)。\n */\n abortActive(): void {\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n for (const operationId of this._activeOperationIds) {\n this._abortController(operationId);\n }\n }\n\n /**\n * dispose (§4.1 world generation)。owner generation を bump して全 ticket を無効化し、\n * 生きている controller を全て abort する。dispose 後に settle した operation は\n * owner gen 不一致で外部 commit しない。retention gate (§10.3) のため live な\n * 全 operation を即時に stale として finalize し、controller / attempt を解放する。\n */\n disposeOwner(): void {\n this._ownerGeneration += 1;\n for (const operationId of Array.from(this._controllers.keys())) {\n this._abortController(operationId);\n // finalize は dispose 後 (terminal='stale') に early-return するため controller を\n // 解放しない。retention gate (§10.3) を満たすためここで明示的に解放する。\n this._releaseController(operationId);\n }\n for (const operationId of Array.from(this._attempts.keys())) {\n if (!this._terminal.has(operationId)) {\n this._terminal.set(operationId, \"stale\");\n }\n this._claimedOutcome.delete(operationId);\n this._attempts.delete(operationId);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n }\n }\n this._activeOperationId = undefined;\n this._activeOperationIds.clear();\n this._queue.length = 0;\n this._inFlightCount = 0;\n }\n\n // --- internal ---\n\n private _makeAttempt(operationId: number, attemptNo: number): OperationAttempt {\n let signal: AbortSignal | undefined;\n // AbortController 不在環境(古い runtime / 一部 SSR)では degraded: signal なしで進む。\n // 正しさは owner generation / eligibility / terminal CAS が担うため、native 中断が\n // 無くても supersede / dispose は機能する(best-effort resource 中断が省かれるだけ)。\n if (this._withSignal && typeof AbortController === \"function\") {\n const controller = new AbortController();\n this._controllers.set(operationId, controller);\n signal = controller.signal;\n }\n return { operationId, attempt: attemptNo, signal };\n }\n\n private _isEligible(ticket: OperationTicket): boolean {\n switch (this.policy) {\n case \"latest\":\n return ticket.supersedeEpoch === this._latestEpoch;\n case \"queue\":\n case \"exhaust\":\n return this._activeOperationId === ticket.operationId;\n case \"overlap\":\n return this._activeOperationIds.has(ticket.operationId);\n }\n }\n\n private _advanceBookkeeping(operationId: number): void {\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n if (this._activeOperationId === operationId) {\n this._activeOperationId = undefined;\n }\n break;\n case \"queue\": {\n // 完了した ticket を FIFO から取り除き、次の先頭を active にする。filter で\n // 「先頭 / 非先頭 / 不在」を一様に扱う (finalize は冪等ガードを通った op のみ到達)。\n const remaining = this._queue.filter((t) => t.operationId !== operationId);\n this._queue.length = 0;\n this._queue.push(...remaining);\n this._activeOperationId = this._queue.length > 0 ? this._queue[0].operationId : undefined;\n break;\n }\n case \"overlap\":\n this._activeOperationIds.delete(operationId);\n break;\n }\n }\n\n private _abortController(operationId: number): void {\n const controller = this._controllers.get(operationId);\n if (controller !== undefined && !controller.signal.aborted) {\n controller.abort();\n }\n }\n\n private _releaseController(operationId: number): void {\n this._controllers.delete(operationId);\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/platform-capability.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * platform-capability.ts\n *\n * Phase 6(docs/architecture-hardening/09-remediation-design.md §7.2 /\n * 07-browser-capability-variance.md)の browser capability 判定と error taxonomy の\n * 汎用プリミティブ。node 固有の capability registry / error code は各パッケージが\n * 別ファイルで宣言し、この汎用層(型 + assess 機構)を import する。\n *\n * 原則:\n * - feature detection は境界(利用直前)で行う。module 評価時に browser global を\n * 参照しない(SSR / worker で import が失敗しない)。\n * - capability ID(`web.fetch` 等)は文字列を global property path として eval せず、\n * registry が ID ごとに副作用のない presence probe を対応付ける。\n * - availability / permission / readiness / activity / operation error を 1 つの\n * `ready / unsupported / error` enum に畳まない。required 欠如は開始しない、\n * optional 欠如は宣言済み fallback で readiness を `degraded` にする。\n *\n * 配置: 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * pure(module 評価時に browser global 非参照)。\n */\n\nexport type Availability = \"available\" | \"missing\" | \"unknown\";\nexport type PermissionState = \"granted\" | \"denied\" | \"prompt\" | \"not-applicable\" | \"unknown\";\nexport type Readiness = \"idle\" | \"ready\" | \"degraded\";\nexport type Activity = \"inactive\" | \"active\";\nexport type PreconditionState = \"satisfied\" | \"required\" | \"not-applicable\";\n\n/** operation error の phase(taxonomy)。 */\nexport type WcsIoErrorPhase = \"probe\" | \"start\" | \"execute\" | \"decode\" | \"commit\" | \"dispose\";\n\n/** serializable な error info(non-cloneable な cause とは分離。DevTools / remote へは info のみ)。 */\nexport interface WcsIoErrorInfo {\n readonly code: string;\n readonly phase: WcsIoErrorPhase;\n readonly recoverable: boolean;\n readonly capabilityId?: string;\n readonly message: string;\n}\n\nexport interface PlatformAssessment {\n readonly availability: ReadonlyMap<string, Availability>;\n readonly permission: PermissionState;\n readonly readiness: Readiness;\n readonly activity: Activity;\n readonly preconditions: {\n readonly secureContext: PreconditionState;\n readonly userActivation: PreconditionState;\n };\n readonly epoch: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\n/** capability 1 件の仕様。probe は副作用なく presence を返す(利用直前に呼ぶ)。 */\nexport interface CapabilitySpec {\n readonly probe: () => boolean;\n readonly requiresSecureContext?: boolean;\n readonly requiresUserActivation?: boolean;\n /** browser compatibility dataset のキー(任意・診断用)。 */\n readonly compatKey?: string;\n}\n\nexport type CapabilityRegistry = ReadonlyMap<string, CapabilitySpec>;\n\nexport interface AssessOptions {\n readonly required: readonly string[];\n readonly optional?: readonly string[];\n readonly permission?: PermissionState;\n readonly activity?: Activity;\n readonly epoch?: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\nfunction isSecureContext(): boolean {\n return (globalThis as { isSecureContext?: unknown }).isSecureContext === true;\n}\n\n/**\n * capability を利用直前に評価して PlatformAssessment を作る。\n * required が 1 つでも欠ければ readiness は \"idle\"(開始不可)、\n * required 揃い + optional 欠けは \"degraded\"、全揃いは \"ready\"。\n */\nexport function assessCapabilities(registry: CapabilityRegistry, options: AssessOptions): PlatformAssessment {\n const availability = new Map<string, Availability>();\n const evaluate = (id: string): Availability => {\n const spec = registry.get(id);\n if (spec === undefined) return \"unknown\";\n return spec.probe() ? \"available\" : \"missing\";\n };\n\n let requiredAllAvailable = true;\n for (const id of options.required) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") requiredAllAvailable = false;\n }\n let optionalAllAvailable = true;\n for (const id of options.optional ?? []) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") optionalAllAvailable = false;\n }\n\n const readiness: Readiness = !requiredAllAvailable ? \"idle\" : (optionalAllAvailable ? \"ready\" : \"degraded\");\n\n // preconditions: 対象 capability のいずれかが要求する場合だけ評価する。\n const allIds = [...options.required, ...(options.optional ?? [])];\n const needsSecure = allIds.some((id) => registry.get(id)?.requiresSecureContext === true);\n const needsActivation = allIds.some((id) => registry.get(id)?.requiresUserActivation === true);\n const secureContext: PreconditionState = needsSecure ? (isSecureContext() ? \"satisfied\" : \"required\") : \"not-applicable\";\n const userActivation: PreconditionState = needsActivation ? \"required\" : \"not-applicable\";\n\n return {\n availability,\n permission: options.permission ?? \"not-applicable\",\n readiness,\n activity: options.activity ?? \"inactive\",\n preconditions: { secureContext, userActivation },\n epoch: options.epoch ?? 0,\n lastError: options.lastError,\n };\n}\n\n/** availability から「required がすべて available か」を判定するヘルパ(supported の最低条件)。 */\nexport function requiredCapabilitiesAvailable(assessment: PlatformAssessment, required: readonly string[]): boolean {\n return required.every((id) => assessment.availability.get(id) === \"available\");\n}\n\n/**\n * このページで機能が使えない理由(使える、または分からないなら null)。利用直前に読む。\n *\n * - `\"insecure-context\"`: 安全なコンテキストではない(`isSecureContext === false`)。\n * Permissions API が扱う機能はどれも安全なコンテキストを要る。\n * - `\"policy-blocked\"`: Permissions-Policy(サーバーのヘッダ、または `allow` の無い\n * `<iframe>`)がその機能を切っている。\n *\n * どちらも Permissions API は教えない: Chromium はポリシーで切られた文書でも\n * `granted` を、安全でない origin では `denied` を返す。利用者の拒否と区別するため、\n * 見張り役(`<wcs-permission>`)も取りに行く側も `unsupported` を報告する\n * (docs/v4-direction-2026-10.md の決定、state-field-report)。\n * `isSecureContext` が無い環境(SSR・テスト)は判断しない。\n */\nexport type FeatureUnavailableReason = \"insecure-context\" | \"policy-blocked\";\n\n/** Permissions-Policy が制御する機能(permission 名と同じ文字列)。 */\nconst POLICY_CONTROLLED = new Set([\n \"camera\", \"microphone\", \"geolocation\", \"midi\", \"clipboard-read\", \"clipboard-write\",\n \"screen-wake-lock\", \"idle-detection\", \"accelerometer\", \"gyroscope\", \"magnetometer\",\n \"ambient-light-sensor\", \"display-capture\",\n]);\n\ninterface PolicyLike { allowsFeature(feature: string): boolean }\n\nexport function featureUnavailable(feature: string): FeatureUnavailableReason | null {\n const g = globalThis as { isSecureContext?: unknown; document?: { permissionsPolicy?: PolicyLike; featurePolicy?: PolicyLike } };\n if (g.isSecureContext === false) return \"insecure-context\";\n if (!POLICY_CONTROLLED.has(feature)) return null;\n const policy = g.document?.permissionsPolicy ?? g.document?.featurePolicy;\n if (policy === undefined || typeof policy.allowsFeature !== \"function\") return null;\n try {\n return policy.allowsFeature(feature) ? null : \"policy-blocked\";\n } catch {\n return null;\n }\n}\n\n/** `featureUnavailable` の理由を、作者が直し方を読める文にする。`what` は文頭(「The camera」など)。 */\nexport function featureUnavailableMessage(what: string, feature: string, reason: FeatureUnavailableReason): string {\n return reason === \"insecure-context\"\n ? `${what} needs a secure context (https:, or http://localhost), and this page is not one.`\n : `${what} is turned off for this page by a Permissions-Policy: the server's Permissions-Policy header, ` +\n `or an <iframe> without allow=\"${feature}\". The browser's site settings cannot change that.`;\n}\n","/**\n * eyedropperCapabilities.ts\n *\n * EyeDropper node 固有の capability registry と error code。汎用の assess 機構・型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。node 固有の宣言はこのハンドライトファイルに置き、生成コピーとは分離する。\n */\n\nimport { CapabilityRegistry, CapabilitySpec } from \"./platformCapability.js\";\n\n/** 安定した eyedropper error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_EYEDROPPER_ERROR_CODE = {\n CapabilityMissing: \"capability-missing\",\n PickFailed: \"pick-failed\",\n} as const;\n\n/** eyedropper node の capability registry。文字列 ID を eval せず明示 probe を持つ。 */\nexport const EYEDROPPER_CAPABILITIES: CapabilityRegistry = new Map<string, CapabilitySpec>([\n [\"web.eyedropper\", { probe: () => typeof (globalThis as { EyeDropper?: unknown }).EyeDropper === \"function\", compatKey: \"api.EyeDropper\" }],\n]);\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { OperationLane, OperationTicket } from \"./operationLane.js\";\nimport {\n PlatformAssessment,\n WcsIoErrorInfo,\n WcsIoErrorPhase,\n assessCapabilities,\n requiredCapabilitiesAvailable,\n} from \"./platformCapability.js\";\nimport { EYEDROPPER_CAPABILITIES, WCS_EYEDROPPER_ERROR_CODE } from \"./eyedropperCapabilities.js\";\n\n/**\n * Headless EyeDropper primitive. A thin, framework-agnostic wrapper around\n * `new EyeDropper().open(options)` exposed through the wc-bindable protocol.\n *\n * Concurrency is owned by the shared `OperationLane` (io-core) with the `latest`\n * policy: `EyeDropper.open()` accepts a `{signal}`, so — unlike Web Share / Contact\n * Picker (exhaust) — a caller has a real platform mechanism to cancel an in-flight\n * pick. A new `open()` supersedes the previous one (the lane aborts its\n * AbortController and the superseded completion fails the terminal CAS), and the\n * `abort()` command aborts the active pick. This replaces the ad-hoc `_gen` +\n * `_abortController` + finally-block identity check with the same lane FetchCore\n * uses; the lane owns the per-attempt AbortController and the commit guard.\n *\n * Both the user dismissing the picker with Escape and the caller invoking\n * `abort()` reject `open()` with the same `AbortError` — both land on `cancelled`\n * without distinction (docs/eyedropper-tag-design.md §2).\n */\nexport class EyedropperCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"value\", event: \"wcs-eyedropper:complete\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.value },\n { name: \"loading\", event: \"wcs-eyedropper:loading-changed\", semantics: \"state\" },\n { name: \"error\", event: \"wcs-eyedropper:error\", semantics: \"state\" },\n { name: \"cancelled\", event: \"wcs-eyedropper:cancelled-changed\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output; the existing `error` property/event are unchanged.\n // Fires its own `wcs-eyedropper:error-info-changed` event; no getter, so the\n // bound value is the event detail (mirrors `error` / `loading` / `cancelled`).\n { name: \"errorInfo\", event: \"wcs-eyedropper:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"open\", async: true },\n { name: \"abort\" },\n ],\n };\n\n // Required capability (probed at call time, never at module eval).\n private static readonly REQUIRED_CAPABILITIES = [\"web.eyedropper\"] as const;\n\n private _target: EventTarget;\n private _value: WcsEyedropperData | null = null;\n private _loading: boolean = false;\n private _error: any = null;\n private _cancelled: boolean = false;\n private _errorInfo: WcsIoErrorInfo | null = null;\n // Concurrency lane (io-core). `latest`: a new open() supersedes + aborts the\n // in-flight one (switchMap). `withSignal: true`: the lane owns the per-attempt\n // AbortController whose signal is passed to EyeDropper.open(). dispose() bumps\n // the owner generation and aborts.\n private _lane = new OperationLane(\"eyedropper\", \"latest\", { withSignal: true });\n // SSR (§3.8): no asynchronous probe to await, so readiness is immediate.\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get value(): WcsEyedropperData | null {\n return this._value;\n }\n\n get loading(): boolean {\n return this._loading;\n }\n\n get error(): any {\n return this._error;\n }\n\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable` / `capabilityId`), or null. Exposed as an additive wc-bindable\n * property (event `wcs-eyedropper:error-info-changed`); the existing `error`\n * property/event are unchanged. Note user/abort cancellation is `cancelled`, not\n * `errorInfo`.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Whether the required platform capability (`web.eyedropper`) is available right\n * now — decided by call-time feature detection, not User-Agent. Core-only,\n * additive.\n */\n get supported(): boolean {\n return requiredCapabilitiesAvailable(this.platformAssessment, EyedropperCore.REQUIRED_CAPABILITIES);\n }\n\n /**\n * Full platform assessment (availability / readiness / preconditions), probed at\n * call time. Core-only opt-in dev / sidecar view.\n */\n get platformAssessment(): PlatformAssessment {\n return assessCapabilities(EYEDROPPER_CAPABILITIES, {\n required: EyedropperCore.REQUIRED_CAPABILITIES,\n activity: this._loading ? \"active\" : \"inactive\",\n lastError: this._errorInfo ?? undefined,\n });\n }\n\n // Lifecycle (§3.5). EyeDropper is command-driven with no subscription to\n // establish, so observe() is an idempotent no-op that resolves once ready;\n // dispose() bumps the lane's owner generation (invalidating any in-flight open())\n // and aborts its AbortController.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this._lane.disposeOwner();\n // The operation the lane drops settles nothing any more, so its end is published\n // here (timing-and-firing-contract §22): a route the element leaves keeps its\n // nodes — bindings included — for the next entry, and state would keep `loading`.\n this._setLoading(false);\n }\n\n // CommitGuard (§5.1): external setters / event dispatch only run if the ticket\n // still holds owner generation, is pre-terminal, and is the lane's latest epoch\n // (a superseding open() can invalidate a ticket mid-commit).\n private _commitStep(ticket: OperationTicket, step: () => void): void {\n if (this._lane.canCommit(ticket)) {\n step();\n }\n }\n\n private _setLoading(loading: boolean): void {\n if (this._loading === loading) return;\n this._loading = loading;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:loading-changed\", {\n detail: loading,\n bubbles: true,\n }));\n }\n\n private _setValue(value: WcsEyedropperData | null): void {\n if (this._value === value) return;\n this._value = value;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:complete\", {\n detail: { value },\n bubbles: true,\n }));\n }\n\n private _setError(error: any): void {\n if (this._error === error) return;\n this._error = error;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n private _setCancelled(cancelled: boolean): void {\n if (this._cancelled === cancelled) return;\n this._cancelled = cancelled;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:cancelled-changed\", {\n detail: cancelled,\n bubbles: true,\n }));\n }\n\n // Single mutation point for `errorInfo`, mirroring `_setError`'s same-value guard\n // and event dispatch so the additive `errorInfo` wc-bindable property stays in\n // sync with `error`. Each failure builds a fresh object (reference guard passes);\n // the clear path passes null (suppresses a redundant null→null per open start).\n private _setErrorInfo(code: string, phase: WcsIoErrorPhase, recoverable: boolean, message: string, capabilityId?: string): void {\n this._commitErrorInfo({ code, phase, recoverable, message, ...(capabilityId === undefined ? {} : { capabilityId }) });\n }\n\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n if (this._errorInfo === info) return;\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Cancels an in-flight `open()` call, if any (a no-op otherwise). Aborts the\n * lane's active AbortController — the in-flight open() then rejects with\n * `AbortError` and lands on `cancelled`. The epoch is not advanced, so the\n * aborted operation keeps eligibility to claim the `aborted` terminal.\n */\n abort(): void {\n this._lane.abortActive();\n }\n\n async open(): Promise<WcsEyedropperData | null> {\n // never-throw + unsupported (§4 / §7.2): probe the required capability at call\n // time (non-Chromium browsers lack this API). If `web.eyedropper` is absent, do\n // NOT start — surface a stable `capability-missing` taxonomy and the existing\n // error message shape.\n const assessment = this.platformAssessment;\n if (!requiredCapabilitiesAvailable(assessment, EyedropperCore.REQUIRED_CAPABILITIES)) {\n const missing = EyedropperCore.REQUIRED_CAPABILITIES.find((id) => assessment.availability.get(id) !== \"available\");\n const message = \"EyeDropper API is not supported in this browser.\";\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.CapabilityMissing, \"start\", false, message, missing);\n this._setError({ message });\n return null;\n }\n\n // `latest`: advance the epoch and abort the previous in-flight pick (supersede).\n // begin() never returns null for latest.\n const started = this._lane.begin()!;\n const { ticket, attempt } = started;\n const signal = attempt.signal;\n\n // Capability probed above → EyeDropper is present. Resolve the constructor at\n // call time (never cached, §3.7) so tests can install/remove it freely.\n const EyeDropperCtor = (globalThis as { EyeDropper?: new () => { open(options?: { signal?: AbortSignal }): Promise<WcsEyedropperData> } }).EyeDropper!;\n\n this._commitStep(ticket, () => this._setLoading(true));\n // Reset the previous outcome before starting a new open() so a stale\n // cancelled/error/errorInfo does not linger into this call's result.\n this._commitStep(ticket, () => {\n this._commitErrorInfo(null);\n this._setError(null);\n this._setCancelled(false);\n });\n\n try {\n const result = await new EyeDropperCtor().open({ signal });\n // Terminal CAS: a stale (superseded / dispose-invalidated) completion loses\n // the claim and is dropped without writing state.\n if (!this._lane.claimTerminal(ticket, \"success\")) {\n return null;\n }\n // The platform's own result object ({ sRGBHex }) is used verbatim (§3).\n // Separate commit steps (like FetchCore): if `_setValue`'s event listener\n // synchronously supersedes this op, the following `_setLoading(false)` is\n // stopped by the commit guard rather than clobbering the newer op.\n this._commitStep(ticket, () => this._setValue(result));\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return result;\n } catch (e: any) {\n const cancelled = e?.name === \"AbortError\";\n if (!this._lane.claimTerminal(ticket, cancelled ? \"aborted\" : \"error\")) {\n return null;\n }\n this._commitStep(ticket, () => {\n if (cancelled) {\n // Either the user dismissed the picker with Escape or the caller invoked\n // abort() — a routine cancellation, not a platform failure, and not\n // distinguished (§2). Kept out of `error`/`errorInfo`.\n this._setCancelled(true);\n } else {\n const message = String(e?.message ?? \"Color pick failed.\");\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.PickFailed, \"execute\", true, message);\n this._setError(e ?? { message });\n }\n });\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return null;\n }\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n// 属性になってしまったオブジェクトの入力(`files=\"[object File]\"`)を、要素ごとに 1 回だけ言う。\n// React 19 は定義前の要素にプロパティが無いのでオブジェクトを属性に書き、Vue の `.attr` も\n// 書く。要素はその入力をプロパティでしか読まないので、何も受け取らず、何も言わなかった\n// (docs/seam-apps.md、fw-inventory)。\nconst toldObjectAttribute = new WeakSet<object>();\n\nfunction warnObjectAttribute(element: object, name: string, value: string): void {\n if (toldObjectAttribute.has(element)) return;\n toldObjectAttribute.add(element);\n const tag = (element as { localName?: string }).localName ?? \"element\";\n console.warn(\n `[wcs/input-as-attribute] <${tag}> has the attribute ${name}=\"${value}\": an object was written as an ` +\n `attribute, so the element did not receive it. A framework does that when the property is set before the ` +\n `element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, ` +\n `or assign the property through a ref (Vue: .prop). (Said once per element.)`,\n element,\n );\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n * - 値が `[object …]` の属性(属性に書かれてしまったオブジェクトの入力)は、要素ごとに 1 回警告する。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n const getAttribute = (element as { getAttribute?: (name: string) => string | null }).getAttribute;\n for (const input of inputs) {\n const name = input.name;\n const attribute = typeof getAttribute === \"function\" ? getAttribute.call(element, name.toLowerCase()) : null;\n if (attribute !== null && attribute.startsWith(\"[object \")) warnObjectAttribute(element, name, attribute);\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { EyedropperCore } from \"../core/EyedropperCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-eyedropper>` — declarative EyeDropper API primitive.\n *\n * The smallest command-only Shell in the batch (docs/eyedropper-tag-design.md\n * §5), mirroring `<wcs-share>`: no attributes at all. `open()` takes no\n * per-call argument — the `{signal}` option is supplied internally by the\n * Core's own AbortController, never via the command-token surface.\n */\nexport class WcsEyedropper extends HTMLElement {\n // SSR (§4.4): observe() completes synchronously, but the Shell still exposes\n // connectedCallbackPromise so the state binder can await it uniformly across\n // all IO nodes before snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...EyedropperCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: EyedropperCore.wcBindable.commands,\n };\n\n private _core: EyedropperCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new EyedropperCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-eyedropper:loading-changed\": (d) => ({ loading: d === true }),\n \"wcs-eyedropper:cancelled-changed\": (d) => ({ cancelled: d === true }),\n \"wcs-eyedropper:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (async-io-node-guidelines.md §3.6): attachInternals is absent\n // in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Core delegated getters ---\n\n get value(): WcsEyedropperData | null {\n return this._core.value;\n }\n\n get loading(): boolean {\n return this._core.loading;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get cancelled(): boolean {\n return this._core.cancelled;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands ---\n\n open(): Promise<WcsEyedropperData | null> {\n return this._core.open();\n }\n\n abort(): void {\n this._core.abort();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/define-element.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * One copy of each package on a page (docs/timing-and-firing-contract.md §24). The first copy the\n * page evaluates defines the tags and a second one does nothing, so a copy that finds its tag defined\n * by another copy of the package — not its class, not a subclass of it, not the same version — warns\n * `[wcs/package-twice]` once per registry, naming both versions. The classes it defines carry\n * `\"<package>@<version>\"` under `Symbol.for(\"wcstack.package\")`; a class without it is named\n * \"another copy of <package> that does not name its version\" (an older copy, or one loaded through\n * an entry that does not stamp).\n */\n\n/** The static a class defined through this helper carries: `\"@wcstack/fetch@<version>\"`. */\nexport const PACKAGE_STAMP: unique symbol = Symbol.for(\"wcstack.package\");\n\ntype Stamped = { [PACKAGE_STAMP]?: string };\n\n/** The registries this copy warned about: one warning per package per registry. */\nconst warned = new WeakSet<CustomElementRegistry>();\n\n/**\n * Marks `cls` as defined by `pkg` (`\"@wcstack/fetch@<version>\"`). A subclass inherits the mark, and\n * `defineProperty` writes it even where a parent's mark is read-only.\n */\nexport function stampPackage(cls: CustomElementConstructor, pkg: string): void {\n Object.defineProperty(cls, PACKAGE_STAMP, { value: pkg, configurable: true });\n}\n\n/**\n * Warns when `tag` is defined as `existing` by another copy of the package `pkg` names: `existing`\n * is neither `own` nor a subclass of it (omit `own` when the copy has no class to compare with), and\n * carries another version or none. Once per registry.\n */\nexport function warnIfAnotherCopy(\n registry: CustomElementRegistry,\n tag: string,\n existing: CustomElementConstructor,\n own: CustomElementConstructor | undefined,\n pkg: string,\n): void {\n if (own !== undefined && (existing === own || existing.prototype instanceof own)) return;\n const theirs = (existing as Stamped)[PACKAGE_STAMP];\n if (theirs === pkg || warned.has(registry)) return;\n warned.add(registry);\n const name = pkg.slice(0, pkg.lastIndexOf(\"@\"));\n console.warn(\n `[${name}] [wcs/package-twice] <${tag}> is already defined by ` +\n `${theirs ?? `another copy of ${name} that does not name its version`}; ` +\n `this copy, ${pkg}, does nothing. Load each package once.`,\n );\n}\n\n/**\n * Defines each `[tag, class]` in `registry` unless the tag is already defined, stamping the class\n * with `pkg` (`\"@wcstack/fetch@<version>\"`). A tag another copy of the package defined first is left\n * as it is, with the warning above.\n */\nexport function defineElements(\n registry: CustomElementRegistry,\n pkg: string,\n definitions: readonly (readonly [tag: string, cls: CustomElementConstructor])[],\n): void {\n for (const [tag, cls] of definitions) {\n const existing = registry.get(tag);\n if (existing === undefined) {\n stampPackage(cls, pkg);\n registry.define(tag, cls);\n } else {\n warnIfAnotherCopy(registry, tag, existing, cls, pkg);\n }\n }\n}\n","import pkg from \"../package.json\" with { type: \"json\" };\nimport { WcsEyedropper } from \"./components/Eyedropper.js\";\nimport { config } from \"./config.js\";\nimport { defineElements } from \"./protocol/defineElement.js\";\n\n/**\n * Register this package's tags. Pass a scoped `CustomElementRegistry` to define\n * them for a single shadow tree -- scoped registries do not inherit the global\n * one, so a tree using one needs its own definitions.\n */\nexport function registerComponents(registry: CustomElementRegistry = customElements): void {\n defineElements(registry, `${pkg.name}@${pkg.version}`, [\n [config.tagNames.eyedropper, WcsEyedropper],\n ]);\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapEyedropper(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n"],"names":[],"mappings":"AAQA,MAAM,OAAO,GAAoB;AAC/B,IAAA,QAAQ,EAAE;AACR,QAAA,UAAU,EAAE,gBAAgB;AAC7B,KAAA;CACF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AAE,GAAG,CAAC,IAAI,WAAW,EAAE;QACpC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AAClC,QAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,YAAA,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC;AACtB,YAAA,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;QAC3B;aAAO;YACL,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC;QACtD;IACF;AACF;;ACtEA;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,QAAA,GAAkC,cAAc,EAAA;AACjF,IAAA,cAAc,CAAC,QAAQ,EAAE,CAAA,EAAG,GAAG,CAAC,IAAI,CAAA,CAAA,EAAI,GAAG,CAAC,OAAO,CAAA,CAAE,EAAE;AACrD,QAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;AAC5C,KAAA,CAAC;AACJ;;ACVM,SAAU,mBAAmB,CAAC,UAA4B,EAAE,QAAgC,EAAA;IAChG,IAAI,UAAU,EAAE;QACd,SAAS,CAAC,UAAU,CAAC;IACvB;IACA,kBAAkB,CAAC,QAAQ,CAAC;AAC9B;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/config.ts","../../src/core/operationLane.ts","../../src/core/platformCapability.ts","../../src/core/eyedropperCapabilities.ts","../../src/core/EyedropperCore.ts","../../src/protocol/upgradeProperties.ts","../../src/components/Eyedropper.ts","../../src/protocol/defineElement.ts","../../src/registerComponents.ts","../../src/bootstrapEyedropper.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n eyedropper: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n eyedropper: \"wcs-eyedropper\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\n// Note: this is the live, mutable internal config. It is not part of the public\n// package exports (see exports.ts) — only `getConfig()` (a frozen snapshot) is\n// surfaced. `setConfig()` is applied internally via `bootstrapEyedropper()` and\n// is not re-exported from the package root, though a deep path import\n// (`.../src/config.js`) can still reach and mutate it. Accepted as-is for\n// cross-package consistency: every @wcstack package follows this same shape.\n// Use `getConfig()` for a frozen, safe read.\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\n/** A misspelt option would otherwise do nothing: `bootstrapEyedropper` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/eyedropper] bootstrapEyedropper: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/operation-lane.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * operationLane.ts\n *\n * Phase 4 (docs/architecture-hardening/09-remediation-design.md §5, §5.1) の\n * OperationTicket / CommitGuard / terminal CAS を型付き実装した lane プリミティブ。\n * docs/async-execution-model.md §5 が既に規範化した排他モード\n * (latest / queue / exhaust / overlap) を、`AbortController` だけでは防げない\n * 「取消不能な Promise・abort と同時に完了した結果の commit」から守るための\n * 実行時ガードとして具体化する。\n *\n * 配置方針 (§5): 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * 初期 PoC は fetch の `latest` policy から開始した。現在は4 policy 全てを\n * `operationLane.test.ts` が直接検証し、生成コピーを fetch / upload / share /\n * contacts / credential / eyedropper が利用する。lane 自体は promise を実行せず、\n * bookkeeping と guard の状態機械に徹する — 実際の非同期処理は Core が駆動し\n * lane に照合する。\n */\n\n/** §5: 排他モードの語彙。async-execution-model.md §5 の 4 モードに対応 (parallel は予約語・スコープ外)。 */\nexport type LanePolicy = \"latest\" | \"queue\" | \"exhaust\" | \"overlap\";\n\n/** §5: 各 operation の一回限りの終端結果。 */\nexport type TerminalOutcome = \"success\" | \"error\" | \"timeout\" | \"aborted\" | \"stale\";\n\n/** §5: 論理操作 1 件の identity。retry は同じ operationId を再利用する。 */\nexport interface OperationTicket {\n readonly operationId: number;\n /** 発行時に捕捉した I/O Core の observe / reconnect / dispose lifecycle 世代。 */\n readonly ownerGeneration: number;\n readonly laneKey: string;\n readonly policy: LanePolicy;\n /** supersede bookkeeping に使う epoch (latest policy のみ)。 */\n readonly supersedeEpoch?: number;\n}\n\n/** §5: operation の 1 回の試行。retry で attempt++ と resource signal だけ差し替える。 */\nexport interface OperationAttempt {\n readonly operationId: number;\n readonly attempt: number;\n readonly signal?: AbortSignal;\n}\n\n/** §6: DevTools 側 channel へ流す trace(fetch では既定 off・zero-cost)。 */\nexport type OperationTraceEvent =\n | { readonly type: \"io:operation-started\"; readonly operationId: number; readonly laneKey: string; readonly policy: LanePolicy }\n | { readonly type: \"io:operation-retried\"; readonly operationId: number; readonly laneKey: string; readonly attempt: number }\n | { readonly type: \"io:operation-settled\"; readonly operationId: number; readonly laneKey: string; readonly outcome: TerminalOutcome }\n | { readonly type: \"io:stale-dropped\"; readonly operationId: number; readonly laneKey: string };\n\nexport interface OperationLaneOptions {\n /** attempt ごとに AbortController を発行し signal を渡す (fetch/upload 系)。 */\n readonly withSignal?: boolean;\n /**\n * trace subscriber。undefined なら trace record を一切生成しない\n * (§10.3 hook-off zero allocation の gate)。\n */\n readonly trace?: (event: OperationTraceEvent) => void;\n}\n\n/**\n * 1 レーン = 独立した排他単位。Core が 1 つ以上所有する (module singleton にしない —\n * 複数 <wcs-fetch> 間で漏れるため)。\n */\nexport class OperationLane {\n readonly laneKey: string;\n readonly policy: LanePolicy;\n\n private _ownerGeneration = 0;\n private _latestEpoch = 0;\n private _nextOperationId = 1;\n // latest / queue / exhaust の単一 active。queue は head を指す。\n private _activeOperationId: number | undefined = undefined;\n // overlap の active set (§5: 内部 bookkeeping のみ・observable 公開はしない)。\n private readonly _activeOperationIds = new Set<number>();\n // queue policy の FIFO。\n private readonly _queue: OperationTicket[] = [];\n // opId → claimTerminal で確定した outcome。存在 = committing (finalize が確定させる)。\n private readonly _claimedOutcome = new Map<number, TerminalOutcome>();\n // opId → AbortController (identity は opId が保証。cross-op clobber は構造上起きない)。\n private readonly _controllers = new Map<number, AbortController>();\n // opId → attempt 数。存在 = live (begin 済みで finalize / dispose 前) で、in-flight はこの大きさ。\n // 終わった operation は何も残さない — 終端済みの記録を持つと長く開いたページで際限なく増える\n // (docs/formal-methods-study.md §4.1)。\n private readonly _attempts = new Map<number, number>();\n private readonly _withSignal: boolean;\n private readonly _trace?: (event: OperationTraceEvent) => void;\n\n constructor(laneKey: string, policy: LanePolicy, options: OperationLaneOptions = {}) {\n this.laneKey = laneKey;\n this.policy = policy;\n this._withSignal = options.withSignal ?? false;\n this._trace = options.trace;\n }\n\n get ownerGeneration(): number {\n return this._ownerGeneration;\n }\n\n get inFlightCount(): number {\n return this._attempts.size;\n }\n\n get latestEpoch(): number {\n return this._latestEpoch;\n }\n\n get activeOperationId(): number | undefined {\n return this._activeOperationId;\n }\n\n /**\n * 新しい要求の到着。arrival policy を適用し ticket + 最初の attempt を発行する。\n * exhaust で実行中の場合だけ null を返す (新要求を ticket 化せず拒否 = 冪等 no-op)。\n */\n begin(): { ticket: OperationTicket; attempt: OperationAttempt } | null {\n let supersedeEpoch: number | undefined;\n switch (this.policy) {\n case \"latest\": {\n // latestEpoch を進め、旧 active を abort (可能なら)。旧 ticket は settle 時に\n // eligibility 不一致で stale となる。\n supersedeEpoch = ++this._latestEpoch;\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n break;\n }\n case \"exhaust\": {\n // 実行中なら新要求を拒否 (呼び出し側は既存結果へ合流)。\n if (this._activeOperationId !== undefined) {\n return null;\n }\n break;\n }\n case \"queue\":\n case \"overlap\":\n break;\n }\n\n const operationId = this._nextOperationId++;\n const ticket: OperationTicket = {\n operationId,\n ownerGeneration: this._ownerGeneration,\n laneKey: this.laneKey,\n policy: this.policy,\n supersedeEpoch,\n };\n\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n this._activeOperationId = operationId;\n break;\n case \"queue\":\n this._queue.push(ticket);\n // 先頭だけを active にする (先行が完了するまで待つ)。\n if (this._activeOperationId === undefined) {\n this._activeOperationId = operationId;\n }\n break;\n case \"overlap\":\n this._activeOperationIds.add(operationId);\n break;\n }\n\n this._attempts.set(operationId, 1);\n const attempt = this._makeAttempt(operationId, 1);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-started\", operationId, laneKey: this.laneKey, policy: this.policy });\n }\n return { ticket, attempt };\n }\n\n /**\n * retry: 同じ operationId に新しい attempt を作る。attempt number と resource signal\n * だけを更新する (§5)。終端した・claim 済みの operation と、もう commit できない operation\n * (supersede された latest / queue の先頭の後ろで待つもの) には作れない (null) — 結果を\n * 捨てるしかない要求に新しい signal を渡さない (docs/formal-methods-study.md §4.1)。\n */\n retry(ticket: OperationTicket): OperationAttempt | null {\n if (ticket.ownerGeneration !== this._ownerGeneration) return null;\n const previous = this._attempts.get(ticket.operationId);\n if (previous === undefined || this._claimedOutcome.has(ticket.operationId)) return null;\n if (!this._isEligible(ticket)) return null;\n const attemptNo = previous + 1;\n this._attempts.set(ticket.operationId, attemptNo);\n // 前の attempt の signal は破棄し、新しい controller を張る。\n this._releaseController(ticket.operationId);\n const attempt = this._makeAttempt(ticket.operationId, attemptNo);\n if (this._trace !== undefined) {\n this._trace({ type: \"io:operation-retried\", operationId: ticket.operationId, laneKey: this.laneKey, attempt: attemptNo });\n }\n return attempt;\n }\n\n /**\n * CommitGuard (§5.1)。外部可視の setter / event dispatch の直前に呼ぶ。\n * (1) owner lifecycle generation 一致 (2) terminal settle 前 (3) policy eligibility。\n */\n canCommit(ticket: OperationTicket): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n // live でなければ settle 済み。pending と committing (multi-setter commit 中) はどちらも settle 前。\n if (!this._attempts.has(ticket.operationId)) return false;\n return this._isEligible(ticket);\n }\n\n /**\n * terminal CAS (§5.1): pending → committing を claim する。勝者だけが true。\n * eligibility / owner gen を満たさない場合も false。claim 後は commit 中となり、\n * canCommit は各 setter の直前で再検査する (setter が同期 supersede しても取りこぼさない)。\n */\n claimTerminal(ticket: OperationTicket, outcome: TerminalOutcome): boolean {\n if (ticket.ownerGeneration !== this._ownerGeneration) return false;\n // 終端済み (live でない) / 既に committing\n if (!this._attempts.has(ticket.operationId) || this._claimedOutcome.has(ticket.operationId)) return false;\n if (!this._isEligible(ticket)) return false;\n this._claimedOutcome.set(ticket.operationId, outcome);\n return true;\n }\n\n /** claim 済み outcome (timer が claim → catch が読む等)。未 claim なら undefined。 */\n claimedOutcome(ticket: OperationTicket): TerminalOutcome | undefined {\n return this._claimedOutcome.get(ticket.operationId);\n }\n\n /**\n * operation の後始末。claim 済みなら outcome を確定し、未 claim なら stale-drop。\n * controller を解放し in-flight を減らし、policy の bookkeeping を進める。冪等。\n */\n finalize(ticket: OperationTicket): void {\n const operationId = ticket.operationId;\n // live でなければ確定済み (finalize 済み、または dispose が stale として確定した)。冪等に return —\n // dispose 前の ticket が先へ進むと、新しい owner の in-flight を数え下げてしまう。\n if (!this._attempts.has(operationId)) return;\n // 一度も claim されなかった (supersede で eligibility を失った) なら stale。\n const outcome = this._claimedOutcome.get(operationId) ?? \"stale\";\n this._claimedOutcome.delete(operationId);\n this._releaseController(operationId);\n this._attempts.delete(operationId);\n this._advanceBookkeeping(operationId);\n if (this._trace !== undefined) {\n if (outcome === \"stale\") {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n } else {\n this._trace({ type: \"io:operation-settled\", operationId, laneKey: this.laneKey, outcome });\n }\n }\n }\n\n /** operation の signal (resource 解放用)。withSignal でなければ undefined。 */\n signalOf(ticket: OperationTicket): AbortSignal | undefined {\n return this._controllers.get(ticket.operationId)?.signal;\n }\n\n /** best-effort な resource 中断。正しさは owner gen / eligibility / terminal CAS が担う。 */\n abort(ticket: OperationTicket): void {\n this._abortController(ticket.operationId);\n }\n\n /**\n * 現在 active な operation を中断する (利用者による明示キャンセル)。epoch は進めない —\n * 中断された operation は eligibility を保ったまま 'aborted' を claim できる\n * (loading をクリアしつつ in-flight 状態を残す)。\n */\n abortActive(): void {\n if (this._activeOperationId !== undefined) {\n this._abortController(this._activeOperationId);\n }\n for (const operationId of this._activeOperationIds) {\n this._abortController(operationId);\n }\n }\n\n /**\n * dispose (§4.1 world generation)。owner generation を bump して全 ticket を無効化し、\n * 生きている controller を全て abort する。dispose 後に settle した operation は\n * owner gen 不一致で外部 commit しない。retention gate (§10.3) のため live な\n * 全 operation を即時に stale として確定し、controller / attempt を解放する。committing 中の\n * operation も同じ — 残りの setter は owner gen で弾かれ、後の finalize は何もしない (終端の\n * 報告は operation ごとに 1 回、docs/io-node-trace-conformance.md §6.3)。\n */\n disposeOwner(): void {\n this._ownerGeneration += 1;\n for (const operationId of Array.from(this._controllers.keys())) {\n this._abortController(operationId);\n // finalize は dispose 後に early-return するため controller を解放しない。\n // retention gate (§10.3) を満たすためここで明示的に解放する。\n this._releaseController(operationId);\n }\n if (this._trace !== undefined) {\n for (const operationId of this._attempts.keys()) {\n this._trace({ type: \"io:stale-dropped\", operationId, laneKey: this.laneKey });\n }\n }\n this._attempts.clear();\n this._claimedOutcome.clear();\n this._activeOperationId = undefined;\n this._activeOperationIds.clear();\n this._queue.length = 0;\n }\n\n // --- internal ---\n\n private _makeAttempt(operationId: number, attemptNo: number): OperationAttempt {\n let signal: AbortSignal | undefined;\n // AbortController 不在環境(古い runtime / 一部 SSR)では degraded: signal なしで進む。\n // 正しさは owner generation / eligibility / terminal CAS が担うため、native 中断が\n // 無くても supersede / dispose は機能する(best-effort resource 中断が省かれるだけ)。\n if (this._withSignal && typeof AbortController === \"function\") {\n const controller = new AbortController();\n this._controllers.set(operationId, controller);\n signal = controller.signal;\n }\n return { operationId, attempt: attemptNo, signal };\n }\n\n private _isEligible(ticket: OperationTicket): boolean {\n switch (this.policy) {\n case \"latest\":\n return ticket.supersedeEpoch === this._latestEpoch;\n case \"queue\":\n case \"exhaust\":\n return this._activeOperationId === ticket.operationId;\n case \"overlap\":\n return this._activeOperationIds.has(ticket.operationId);\n }\n }\n\n private _advanceBookkeeping(operationId: number): void {\n switch (this.policy) {\n case \"latest\":\n case \"exhaust\":\n if (this._activeOperationId === operationId) {\n this._activeOperationId = undefined;\n }\n break;\n case \"queue\": {\n // 完了した ticket を FIFO から取り除き、次の先頭を active にする。filter で\n // 「先頭 / 非先頭 / 不在」を一様に扱う (finalize は冪等ガードを通った op のみ到達)。\n const remaining = this._queue.filter((t) => t.operationId !== operationId);\n this._queue.length = 0;\n this._queue.push(...remaining);\n this._activeOperationId = this._queue.length > 0 ? this._queue[0].operationId : undefined;\n break;\n }\n case \"overlap\":\n this._activeOperationIds.delete(operationId);\n break;\n }\n }\n\n private _abortController(operationId: number): void {\n const controller = this._controllers.get(operationId);\n if (controller !== undefined && !controller.signal.aborted) {\n controller.abort();\n }\n }\n\n private _releaseController(operationId: number): void {\n this._controllers.delete(operationId);\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /io-core/platform-capability.ts by scripts/sync-io-core.mjs.\n// Run `node scripts/sync-io-core.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * platform-capability.ts\n *\n * Phase 6(docs/architecture-hardening/09-remediation-design.md §7.2 /\n * 07-browser-capability-variance.md)の browser capability 判定と error taxonomy の\n * 汎用プリミティブ。node 固有の capability registry / error code は各パッケージが\n * 別ファイルで宣言し、この汎用層(型 + assess 機構)を import する。\n *\n * 原則:\n * - feature detection は境界(利用直前)で行う。module 評価時に browser global を\n * 参照しない(SSR / worker で import が失敗しない)。\n * - capability ID(`web.fetch` 等)は文字列を global property path として eval せず、\n * registry が ID ごとに副作用のない presence probe を対応付ける。\n * - availability / permission / readiness / activity / operation error を 1 つの\n * `ready / unsupported / error` enum に畳まない。required 欠如は開始しない、\n * optional 欠如は宣言済み fallback で readiness を `degraded` にする。\n *\n * 配置: 本ファイルは /io-core/ の単一正典であり、scripts/sync-io-core.mjs が\n * 各 IO ノードの src/core/ へ生成コピー (AUTO-GENERATED, 編集禁止) を配布する。\n * `protocol/wcBindable.ts` と同じ copy-distribution 方式で、ランタイム依存を導入せず\n * 各パッケージのバンドルへ inline される (zero-runtime-dep / 自己完結 CDN を維持)。\n * 編集はこの正典に対して行い、`node scripts/sync-io-core.mjs` で再配布する。\n *\n * pure(module 評価時に browser global 非参照)。\n */\n\nexport type Availability = \"available\" | \"missing\" | \"unknown\";\nexport type PermissionState = \"granted\" | \"denied\" | \"prompt\" | \"not-applicable\" | \"unknown\";\nexport type Readiness = \"idle\" | \"ready\" | \"degraded\";\nexport type Activity = \"inactive\" | \"active\";\nexport type PreconditionState = \"satisfied\" | \"required\" | \"not-applicable\";\n\n/** operation error の phase(taxonomy)。 */\nexport type WcsIoErrorPhase = \"probe\" | \"start\" | \"execute\" | \"decode\" | \"commit\" | \"dispose\";\n\n/** serializable な error info(non-cloneable な cause とは分離。DevTools / remote へは info のみ)。 */\nexport interface WcsIoErrorInfo {\n readonly code: string;\n readonly phase: WcsIoErrorPhase;\n readonly recoverable: boolean;\n readonly capabilityId?: string;\n readonly message: string;\n}\n\nexport interface PlatformAssessment {\n readonly availability: ReadonlyMap<string, Availability>;\n readonly permission: PermissionState;\n readonly readiness: Readiness;\n readonly activity: Activity;\n readonly preconditions: {\n readonly secureContext: PreconditionState;\n readonly userActivation: PreconditionState;\n };\n readonly epoch: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\n/** capability 1 件の仕様。probe は副作用なく presence を返す(利用直前に呼ぶ)。 */\nexport interface CapabilitySpec {\n readonly probe: () => boolean;\n readonly requiresSecureContext?: boolean;\n readonly requiresUserActivation?: boolean;\n /** browser compatibility dataset のキー(任意・診断用)。 */\n readonly compatKey?: string;\n}\n\nexport type CapabilityRegistry = ReadonlyMap<string, CapabilitySpec>;\n\nexport interface AssessOptions {\n readonly required: readonly string[];\n readonly optional?: readonly string[];\n readonly permission?: PermissionState;\n readonly activity?: Activity;\n readonly epoch?: number;\n readonly lastError?: WcsIoErrorInfo;\n}\n\nfunction isSecureContext(): boolean {\n return (globalThis as { isSecureContext?: unknown }).isSecureContext === true;\n}\n\n/**\n * capability を利用直前に評価して PlatformAssessment を作る。\n * required が 1 つでも欠ければ readiness は \"idle\"(開始不可)、\n * required 揃い + optional 欠けは \"degraded\"、全揃いは \"ready\"。\n */\nexport function assessCapabilities(registry: CapabilityRegistry, options: AssessOptions): PlatformAssessment {\n const availability = new Map<string, Availability>();\n const evaluate = (id: string): Availability => {\n const spec = registry.get(id);\n if (spec === undefined) return \"unknown\";\n return spec.probe() ? \"available\" : \"missing\";\n };\n\n let requiredAllAvailable = true;\n for (const id of options.required) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") requiredAllAvailable = false;\n }\n let optionalAllAvailable = true;\n for (const id of options.optional ?? []) {\n const a = evaluate(id);\n availability.set(id, a);\n if (a !== \"available\") optionalAllAvailable = false;\n }\n\n const readiness: Readiness = !requiredAllAvailable ? \"idle\" : (optionalAllAvailable ? \"ready\" : \"degraded\");\n\n // preconditions: 対象 capability のいずれかが要求する場合だけ評価する。\n const allIds = [...options.required, ...(options.optional ?? [])];\n const needsSecure = allIds.some((id) => registry.get(id)?.requiresSecureContext === true);\n const needsActivation = allIds.some((id) => registry.get(id)?.requiresUserActivation === true);\n const secureContext: PreconditionState = needsSecure ? (isSecureContext() ? \"satisfied\" : \"required\") : \"not-applicable\";\n const userActivation: PreconditionState = needsActivation ? \"required\" : \"not-applicable\";\n\n return {\n availability,\n permission: options.permission ?? \"not-applicable\",\n readiness,\n activity: options.activity ?? \"inactive\",\n preconditions: { secureContext, userActivation },\n epoch: options.epoch ?? 0,\n lastError: options.lastError,\n };\n}\n\n/** availability から「required がすべて available か」を判定するヘルパ(supported の最低条件)。 */\nexport function requiredCapabilitiesAvailable(assessment: PlatformAssessment, required: readonly string[]): boolean {\n return required.every((id) => assessment.availability.get(id) === \"available\");\n}\n\n/**\n * このページで機能が使えない理由(使える、または分からないなら null)。利用直前に読む。\n *\n * - `\"insecure-context\"`: 安全なコンテキストではない(`isSecureContext === false`)。\n * Permissions API が扱う機能はどれも安全なコンテキストを要る。\n * - `\"policy-blocked\"`: Permissions-Policy(サーバーのヘッダ、または `allow` の無い\n * `<iframe>`)がその機能を切っている。\n *\n * どちらも Permissions API は教えない: Chromium はポリシーで切られた文書でも\n * `granted` を、安全でない origin では `denied` を返す。利用者の拒否と区別するため、\n * 見張り役(`<wcs-permission>`)も取りに行く側も `unsupported` を報告する\n * (docs/v4-direction-2026-10.md の決定、state-field-report)。\n * `isSecureContext` が無い環境(SSR・テスト)は判断しない。\n */\nexport type FeatureUnavailableReason = \"insecure-context\" | \"policy-blocked\";\n\n/** Permissions-Policy が制御する機能(permission 名と同じ文字列)。 */\nconst POLICY_CONTROLLED = new Set([\n \"camera\", \"microphone\", \"geolocation\", \"midi\", \"clipboard-read\", \"clipboard-write\",\n \"screen-wake-lock\", \"idle-detection\", \"accelerometer\", \"gyroscope\", \"magnetometer\",\n \"ambient-light-sensor\", \"display-capture\",\n]);\n\ninterface PolicyLike { allowsFeature(feature: string): boolean }\n\nexport function featureUnavailable(feature: string): FeatureUnavailableReason | null {\n const g = globalThis as { isSecureContext?: unknown; document?: { permissionsPolicy?: PolicyLike; featurePolicy?: PolicyLike } };\n if (g.isSecureContext === false) return \"insecure-context\";\n if (!POLICY_CONTROLLED.has(feature)) return null;\n const policy = g.document?.permissionsPolicy ?? g.document?.featurePolicy;\n if (policy === undefined || typeof policy.allowsFeature !== \"function\") return null;\n try {\n return policy.allowsFeature(feature) ? null : \"policy-blocked\";\n } catch {\n return null;\n }\n}\n\n/** `featureUnavailable` の理由を、作者が直し方を読める文にする。`what` は文頭(「The camera」など)。 */\nexport function featureUnavailableMessage(what: string, feature: string, reason: FeatureUnavailableReason): string {\n return reason === \"insecure-context\"\n ? `${what} needs a secure context (https:, or http://localhost), and this page is not one.`\n : `${what} is turned off for this page by a Permissions-Policy: the server's Permissions-Policy header, ` +\n `or an <iframe> without allow=\"${feature}\". The browser's site settings cannot change that.`;\n}\n","/**\n * eyedropperCapabilities.ts\n *\n * EyeDropper node 固有の capability registry と error code。汎用の assess 機構・型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。node 固有の宣言はこのハンドライトファイルに置き、生成コピーとは分離する。\n */\n\nimport { CapabilityRegistry, CapabilitySpec } from \"./platformCapability.js\";\n\n/** 安定した eyedropper error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_EYEDROPPER_ERROR_CODE = {\n CapabilityMissing: \"capability-missing\",\n PickFailed: \"pick-failed\",\n} as const;\n\n/** eyedropper node の capability registry。文字列 ID を eval せず明示 probe を持つ。 */\nexport const EYEDROPPER_CAPABILITIES: CapabilityRegistry = new Map<string, CapabilitySpec>([\n [\"web.eyedropper\", { probe: () => typeof (globalThis as { EyeDropper?: unknown }).EyeDropper === \"function\", compatKey: \"api.EyeDropper\" }],\n]);\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { OperationLane, OperationTicket } from \"./operationLane.js\";\nimport {\n PlatformAssessment,\n WcsIoErrorInfo,\n WcsIoErrorPhase,\n assessCapabilities,\n requiredCapabilitiesAvailable,\n} from \"./platformCapability.js\";\nimport { EYEDROPPER_CAPABILITIES, WCS_EYEDROPPER_ERROR_CODE } from \"./eyedropperCapabilities.js\";\n\n/**\n * Headless EyeDropper primitive. A thin, framework-agnostic wrapper around\n * `new EyeDropper().open(options)` exposed through the wc-bindable protocol.\n *\n * Concurrency is owned by the shared `OperationLane` (io-core) with the `latest`\n * policy: `EyeDropper.open()` accepts a `{signal}`, so — unlike Web Share / Contact\n * Picker (exhaust) — a caller has a real platform mechanism to cancel an in-flight\n * pick. A new `open()` supersedes the previous one (the lane aborts its\n * AbortController and the superseded completion fails the terminal CAS), and the\n * `abort()` command aborts the active pick. This replaces the ad-hoc `_gen` +\n * `_abortController` + finally-block identity check with the same lane FetchCore\n * uses; the lane owns the per-attempt AbortController and the commit guard.\n *\n * Both the user dismissing the picker with Escape and the caller invoking\n * `abort()` reject `open()` with the same `AbortError` — both land on `cancelled`\n * without distinction (docs/eyedropper-tag-design.md §2).\n */\nexport class EyedropperCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"value\", event: \"wcs-eyedropper:complete\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.value },\n { name: \"loading\", event: \"wcs-eyedropper:loading-changed\", semantics: \"state\" },\n { name: \"error\", event: \"wcs-eyedropper:error\", semantics: \"state\" },\n { name: \"cancelled\", event: \"wcs-eyedropper:cancelled-changed\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output; the existing `error` property/event are unchanged.\n // Fires its own `wcs-eyedropper:error-info-changed` event; no getter, so the\n // bound value is the event detail (mirrors `error` / `loading` / `cancelled`).\n { name: \"errorInfo\", event: \"wcs-eyedropper:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"open\", async: true },\n { name: \"abort\" },\n ],\n };\n\n // Required capability (probed at call time, never at module eval).\n private static readonly REQUIRED_CAPABILITIES = [\"web.eyedropper\"] as const;\n\n private _target: EventTarget;\n private _value: WcsEyedropperData | null = null;\n private _loading: boolean = false;\n private _error: any = null;\n private _cancelled: boolean = false;\n private _errorInfo: WcsIoErrorInfo | null = null;\n // Concurrency lane (io-core). `latest`: a new open() supersedes + aborts the\n // in-flight one (switchMap). `withSignal: true`: the lane owns the per-attempt\n // AbortController whose signal is passed to EyeDropper.open(). dispose() bumps\n // the owner generation and aborts.\n private _lane = new OperationLane(\"eyedropper\", \"latest\", { withSignal: true });\n // SSR (§3.8): no asynchronous probe to await, so readiness is immediate.\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get value(): WcsEyedropperData | null {\n return this._value;\n }\n\n get loading(): boolean {\n return this._loading;\n }\n\n get error(): any {\n return this._error;\n }\n\n get cancelled(): boolean {\n return this._cancelled;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable` / `capabilityId`), or null. Exposed as an additive wc-bindable\n * property (event `wcs-eyedropper:error-info-changed`); the existing `error`\n * property/event are unchanged. Note user/abort cancellation is `cancelled`, not\n * `errorInfo`.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Whether the required platform capability (`web.eyedropper`) is available right\n * now — decided by call-time feature detection, not User-Agent. Core-only,\n * additive.\n */\n get supported(): boolean {\n return requiredCapabilitiesAvailable(this.platformAssessment, EyedropperCore.REQUIRED_CAPABILITIES);\n }\n\n /**\n * Full platform assessment (availability / readiness / preconditions), probed at\n * call time. Core-only opt-in dev / sidecar view.\n */\n get platformAssessment(): PlatformAssessment {\n return assessCapabilities(EYEDROPPER_CAPABILITIES, {\n required: EyedropperCore.REQUIRED_CAPABILITIES,\n activity: this._loading ? \"active\" : \"inactive\",\n lastError: this._errorInfo ?? undefined,\n });\n }\n\n // Lifecycle (§3.5). EyeDropper is command-driven with no subscription to\n // establish, so observe() is an idempotent no-op that resolves once ready;\n // dispose() bumps the lane's owner generation (invalidating any in-flight open())\n // and aborts its AbortController.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this._lane.disposeOwner();\n // The operation the lane drops settles nothing any more, so its end is published\n // here (timing-and-firing-contract §22): a route the element leaves keeps its\n // nodes — bindings included — for the next entry, and state would keep `loading`.\n this._setLoading(false);\n }\n\n // CommitGuard (§5.1): external setters / event dispatch only run if the ticket\n // still holds owner generation, is pre-terminal, and is the lane's latest epoch\n // (a superseding open() can invalidate a ticket mid-commit).\n private _commitStep(ticket: OperationTicket, step: () => void): void {\n if (this._lane.canCommit(ticket)) {\n step();\n }\n }\n\n private _setLoading(loading: boolean): void {\n if (this._loading === loading) return;\n this._loading = loading;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:loading-changed\", {\n detail: loading,\n bubbles: true,\n }));\n }\n\n private _setValue(value: WcsEyedropperData | null): void {\n if (this._value === value) return;\n this._value = value;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:complete\", {\n detail: { value },\n bubbles: true,\n }));\n }\n\n private _setError(error: any): void {\n if (this._error === error) return;\n this._error = error;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n private _setCancelled(cancelled: boolean): void {\n if (this._cancelled === cancelled) return;\n this._cancelled = cancelled;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:cancelled-changed\", {\n detail: cancelled,\n bubbles: true,\n }));\n }\n\n // Single mutation point for `errorInfo`, mirroring `_setError`'s same-value guard\n // and event dispatch so the additive `errorInfo` wc-bindable property stays in\n // sync with `error`. Each failure builds a fresh object (reference guard passes);\n // the clear path passes null (suppresses a redundant null→null per open start).\n private _setErrorInfo(code: string, phase: WcsIoErrorPhase, recoverable: boolean, message: string, capabilityId?: string): void {\n this._commitErrorInfo({ code, phase, recoverable, message, ...(capabilityId === undefined ? {} : { capabilityId }) });\n }\n\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n if (this._errorInfo === info) return;\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-eyedropper:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Cancels an in-flight `open()` call, if any (a no-op otherwise). Aborts the\n * lane's active AbortController — the in-flight open() then rejects with\n * `AbortError` and lands on `cancelled`. The epoch is not advanced, so the\n * aborted operation keeps eligibility to claim the `aborted` terminal.\n */\n abort(): void {\n this._lane.abortActive();\n }\n\n async open(): Promise<WcsEyedropperData | null> {\n // never-throw + unsupported (§4 / §7.2): probe the required capability at call\n // time (non-Chromium browsers lack this API). If `web.eyedropper` is absent, do\n // NOT start — surface a stable `capability-missing` taxonomy and the existing\n // error message shape.\n const assessment = this.platformAssessment;\n if (!requiredCapabilitiesAvailable(assessment, EyedropperCore.REQUIRED_CAPABILITIES)) {\n const missing = EyedropperCore.REQUIRED_CAPABILITIES.find((id) => assessment.availability.get(id) !== \"available\");\n const message = \"EyeDropper API is not supported in this browser.\";\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.CapabilityMissing, \"start\", false, message, missing);\n this._setError({ message });\n return null;\n }\n\n // `latest`: advance the epoch and abort the previous in-flight pick (supersede).\n // begin() never returns null for latest.\n const started = this._lane.begin()!;\n const { ticket, attempt } = started;\n const signal = attempt.signal;\n\n // Capability probed above → EyeDropper is present. Resolve the constructor at\n // call time (never cached, §3.7) so tests can install/remove it freely.\n const EyeDropperCtor = (globalThis as { EyeDropper?: new () => { open(options?: { signal?: AbortSignal }): Promise<WcsEyedropperData> } }).EyeDropper!;\n\n this._commitStep(ticket, () => this._setLoading(true));\n // Reset the previous outcome before starting a new open() so a stale\n // cancelled/error/errorInfo does not linger into this call's result.\n this._commitStep(ticket, () => {\n this._commitErrorInfo(null);\n this._setError(null);\n this._setCancelled(false);\n });\n\n try {\n const result = await new EyeDropperCtor().open({ signal });\n // Terminal CAS: a stale (superseded / dispose-invalidated) completion loses\n // the claim and is dropped without writing state.\n if (!this._lane.claimTerminal(ticket, \"success\")) {\n return null;\n }\n // The platform's own result object ({ sRGBHex }) is used verbatim (§3).\n // Separate commit steps (like FetchCore): if `_setValue`'s event listener\n // synchronously supersedes this op, the following `_setLoading(false)` is\n // stopped by the commit guard rather than clobbering the newer op.\n this._commitStep(ticket, () => this._setValue(result));\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return result;\n } catch (e: any) {\n const cancelled = e?.name === \"AbortError\";\n if (!this._lane.claimTerminal(ticket, cancelled ? \"aborted\" : \"error\")) {\n return null;\n }\n this._commitStep(ticket, () => {\n if (cancelled) {\n // Either the user dismissed the picker with Escape or the caller invoked\n // abort() — a routine cancellation, not a platform failure, and not\n // distinguished (§2). Kept out of `error`/`errorInfo`.\n this._setCancelled(true);\n } else {\n const message = String(e?.message ?? \"Color pick failed.\");\n this._setErrorInfo(WCS_EYEDROPPER_ERROR_CODE.PickFailed, \"execute\", true, message);\n this._setError(e ?? { message });\n }\n });\n this._commitStep(ticket, () => this._setLoading(false));\n this._lane.finalize(ticket);\n return null;\n }\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n// 属性になってしまったオブジェクトの入力(`files=\"[object File]\"`)を、要素ごとに 1 回だけ言う。\n// React 19 は定義前の要素にプロパティが無いのでオブジェクトを属性に書き、Vue の `.attr` も\n// 書く。要素はその入力をプロパティでしか読まないので、何も受け取らず、何も言わなかった\n// (docs/seam-apps.md、fw-inventory)。\nconst toldObjectAttribute = new WeakSet<object>();\n\nfunction warnObjectAttribute(element: object, name: string, value: string): void {\n if (toldObjectAttribute.has(element)) return;\n toldObjectAttribute.add(element);\n const tag = (element as { localName?: string }).localName ?? \"element\";\n console.warn(\n `[wcs/input-as-attribute] <${tag}> has the attribute ${name}=\"${value}\": an object was written as an ` +\n `attribute, so the element did not receive it. A framework does that when the property is set before the ` +\n `element's definition loads (React 19), or when told to (Vue's .attr). Load the definition before rendering, ` +\n `or assign the property through a ref (Vue: .prop). (Said once per element.)`,\n element,\n );\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n * - 値が `[object …]` の属性(属性に書かれてしまったオブジェクトの入力)は、要素ごとに 1 回警告する。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n const getAttribute = (element as { getAttribute?: (name: string) => string | null }).getAttribute;\n for (const input of inputs) {\n const name = input.name;\n const attribute = typeof getAttribute === \"function\" ? getAttribute.call(element, name.toLowerCase()) : null;\n if (attribute !== null && attribute.startsWith(\"[object \")) warnObjectAttribute(element, name, attribute);\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IWcBindable, WcsEyedropperData } from \"../types.js\";\nimport { EyedropperCore } from \"../core/EyedropperCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-eyedropper>` — declarative EyeDropper API primitive.\n *\n * The smallest command-only Shell in the batch (docs/eyedropper-tag-design.md\n * §5), mirroring `<wcs-share>`: no attributes at all. `open()` takes no\n * per-call argument — the `{signal}` option is supplied internally by the\n * Core's own AbortController, never via the command-token surface.\n */\nexport class WcsEyedropper extends HTMLElement {\n // SSR (§4.4): observe() completes synchronously, but the Shell still exposes\n // connectedCallbackPromise so the state binder can await it uniformly across\n // all IO nodes before snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...EyedropperCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: EyedropperCore.wcBindable.commands,\n };\n\n private _core: EyedropperCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new EyedropperCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-eyedropper:loading-changed\": (d) => ({ loading: d === true }),\n \"wcs-eyedropper:cancelled-changed\": (d) => ({ cancelled: d === true }),\n \"wcs-eyedropper:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (async-io-node-guidelines.md §3.6): attachInternals is absent\n // in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Core delegated getters ---\n\n get value(): WcsEyedropperData | null {\n return this._core.value;\n }\n\n get loading(): boolean {\n return this._core.loading;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get cancelled(): boolean {\n return this._core.cancelled;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands ---\n\n open(): Promise<WcsEyedropperData | null> {\n return this._core.open();\n }\n\n abort(): void {\n this._core.abort();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/define-element.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n/**\n * One copy of each package on a page (docs/timing-and-firing-contract.md §24). The first copy the\n * page evaluates defines the tags and a second one does nothing, so a copy that finds its tag defined\n * by another copy of the package — not its class, not a subclass of it, not the same version — warns\n * `[wcs/package-twice]` once per registry, naming both versions. The classes it defines carry\n * `\"<package>@<version>\"` under `Symbol.for(\"wcstack.package\")`; a class without it is named\n * \"another copy of <package> that does not name its version\" (an older copy, or one loaded through\n * an entry that does not stamp).\n */\n\n/** The static a class defined through this helper carries: `\"@wcstack/fetch@<version>\"`. */\nexport const PACKAGE_STAMP: unique symbol = Symbol.for(\"wcstack.package\");\n\ntype Stamped = { [PACKAGE_STAMP]?: string };\n\n/** The registries this copy warned about: one warning per package per registry. */\nconst warned = new WeakSet<CustomElementRegistry>();\n\n/**\n * Marks `cls` as defined by `pkg` (`\"@wcstack/fetch@<version>\"`). A subclass inherits the mark, and\n * `defineProperty` writes it even where a parent's mark is read-only.\n */\nexport function stampPackage(cls: CustomElementConstructor, pkg: string): void {\n Object.defineProperty(cls, PACKAGE_STAMP, { value: pkg, configurable: true });\n}\n\n/**\n * Warns when `tag` is defined as `existing` by another copy of the package `pkg` names: `existing`\n * is neither `own` nor a subclass of it (omit `own` when the copy has no class to compare with), and\n * carries another version or none. Once per registry.\n */\nexport function warnIfAnotherCopy(\n registry: CustomElementRegistry,\n tag: string,\n existing: CustomElementConstructor,\n own: CustomElementConstructor | undefined,\n pkg: string,\n): void {\n if (own !== undefined && (existing === own || existing.prototype instanceof own)) return;\n const theirs = (existing as Stamped)[PACKAGE_STAMP];\n if (theirs === pkg || warned.has(registry)) return;\n warned.add(registry);\n const name = pkg.slice(0, pkg.lastIndexOf(\"@\"));\n console.warn(\n `[${name}] [wcs/package-twice] <${tag}> is already defined by ` +\n `${theirs ?? `another copy of ${name} that does not name its version`}; ` +\n `this copy, ${pkg}, does nothing. Load each package once.`,\n );\n}\n\n/**\n * Defines each `[tag, class]` in `registry` unless the tag is already defined, stamping the class\n * with `pkg` (`\"@wcstack/fetch@<version>\"`). A tag another copy of the package defined first is left\n * as it is, with the warning above.\n */\nexport function defineElements(\n registry: CustomElementRegistry,\n pkg: string,\n definitions: readonly (readonly [tag: string, cls: CustomElementConstructor])[],\n): void {\n for (const [tag, cls] of definitions) {\n const existing = registry.get(tag);\n if (existing === undefined) {\n stampPackage(cls, pkg);\n registry.define(tag, cls);\n } else {\n warnIfAnotherCopy(registry, tag, existing, cls, pkg);\n }\n }\n}\n","import pkg from \"../package.json\" with { type: \"json\" };\nimport { WcsEyedropper } from \"./components/Eyedropper.js\";\nimport { config } from \"./config.js\";\nimport { defineElements } from \"./protocol/defineElement.js\";\n\n/**\n * Register this package's tags. Pass a scoped `CustomElementRegistry` to define\n * them for a single shadow tree -- scoped registries do not inherit the global\n * one, so a tree using one needs its own definitions.\n */\nexport function registerComponents(registry: CustomElementRegistry = customElements): void {\n defineElements(registry, `${pkg.name}@${pkg.version}`, [\n [config.tagNames.eyedropper, WcsEyedropper],\n ]);\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapEyedropper(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n"],"names":[],"mappings":"AAQA,MAAM,OAAO,GAAoB;AAC/B,IAAA,QAAQ,EAAE;AACR,QAAA,UAAU,EAAE,gBAAgB;AAC7B,KAAA;CACF;AAED,SAAS,UAAU,CAAI,GAAM,EAAA;AAC3B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;AACvD,IAAA,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAClB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAClC,QAAA,UAAU,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC;IACnD;AACA,IAAA,OAAO,GAAG;AACZ;AAEA,SAAS,SAAS,CAAI,GAAM,EAAA;AAC1B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;IACvD,MAAM,KAAK,GAA4B,EAAE;IACzC,KAA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W,EACX,WAA+E,EAAA;IAE/E,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,WAAW,EAAE;QACpC,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;AAClC,QAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,YAAA,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC;AACtB,YAAA,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;QAC3B;aAAO;YACL,iBAAiB,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC;QACtD;IACF;AACF;;ACtEA;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,QAAA,GAAkC,cAAc,EAAA;AACjF,IAAA,cAAc,CAAC,QAAQ,EAAE,CAAA,EAAG,GAAG,CAAC,IAAI,CAAA,CAAA,EAAI,GAAG,CAAC,OAAO,CAAA,CAAE,EAAE;AACrD,QAAA,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;AAC5C,KAAA,CAAC;AACJ;;ACVM,SAAU,mBAAmB,CAAC,UAA4B,EAAE,QAAgC,EAAA;IAChG,IAAI,UAAU,EAAE;QACd,SAAS,CAAC,UAAU,CAAC;IACvB;IACA,kBAAkB,CAAC,QAAQ,CAAC;AAC9B;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wcstack/eyedropper",
3
- "version": "4.14.0",
3
+ "version": "4.16.0",
4
4
  "description": "Declarative EyeDropper component for Web Components. Framework-agnostic EyeDropper.open() primitive via wc-bindable-protocol.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.esm.js",