arcane-os 0.5.17 → 0.5.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +9 -9
- package/bin/arcane-test.mjs +16 -13
- package/browser-runtime/ai/browser-speech-artifacts.mjs +41 -38
- package/browser-runtime/ai/browser-speech-providers.mjs +46 -43
- package/browser-runtime/ai/browser-wasm-llm-provider.mjs +127 -124
- package/browser-runtime/ai/browser-wasm.mjs +6 -3
- package/browser-runtime/ai/browser-wllama-runtime.mjs +26 -23
- package/browser-runtime/ai/model-controller.mjs +94 -91
- package/browser-runtime/ai/speech-worker-client.mjs +12 -9
- package/browser-runtime/ai/speech-worker-runtime.mjs +56 -53
- package/browser-runtime/dependencies/strong-type/index.js +207 -82
- package/browser-runtime/dependencies/strong-type/package.json +15 -6
- package/browser-runtime/dom-event-instrumentation.mjs +24 -20
- package/browser-runtime/event-manager.mjs +111 -108
- package/browser-runtime/speech-text.mjs +5 -1
- package/docs/reference/ai/browser-speech.md +198 -5
- package/docs/reference/availability-and-normalization.md +40 -0
- package/docs/reference/inventory/package-api.json +1 -1
- package/docs/reference/inventory/runtime-components.json +1 -1
- package/docs/reference/inventory/runtime-modules.json +20 -24
- package/docs/reference/protocols.md +1 -1
- package/docs/reference/runtime-modules.md +125 -35
- package/docs/reference/sdk-api.md +23 -7
- package/examples/wasm-ai-demo/index.html +1 -0
- package/node_modules/event-pubsub/node_modules/strong-type/README.md +408 -0
- package/node_modules/event-pubsub/node_modules/strong-type/assets/strong-type-header.png +0 -0
- package/node_modules/event-pubsub/node_modules/strong-type/index.js +1151 -0
- package/node_modules/event-pubsub/node_modules/strong-type/licence +21 -0
- package/node_modules/event-pubsub/node_modules/strong-type/node.js +125 -0
- package/node_modules/event-pubsub/node_modules/strong-type/package.json +61 -0
- package/node_modules/strong-type/README.md +42 -24
- package/node_modules/strong-type/benchmark/core.js +324 -0
- package/node_modules/strong-type/index.js +207 -82
- package/node_modules/strong-type/package.json +14 -6
- package/package.json +3 -3
- package/runtime/arcane/components/app-bar.html +5 -2
- package/runtime/arcane/components/assistant-panel.html +5 -2
- package/runtime/arcane/components/chart.html +15 -12
- package/runtime/arcane/components/chat.html +117 -138
- package/runtime/arcane/components/dashboard-config.html +6 -3
- package/runtime/arcane/components/data-view.html +4 -1
- package/runtime/arcane/components/directory-picker.html +5 -2
- package/runtime/arcane/components/document-inspector.html +6 -3
- package/runtime/arcane/components/file-drop.html +5 -2
- package/runtime/arcane/components/file-inspector.html +9 -6
- package/runtime/arcane/components/file-manager.html +16 -13
- package/runtime/arcane/components/local-ai-status.html +5 -2
- package/runtime/arcane/components/markdown-document.html +14 -11
- package/runtime/arcane/components/markdown-editor.html +4 -1
- package/runtime/arcane/components/modal.html +4 -1
- package/runtime/arcane/components/output-panel.html +6 -3
- package/runtime/arcane/components/preferences-form.html +4 -1
- package/runtime/arcane/components/record-timeline.html +8 -5
- package/runtime/arcane/components/relationship-board.html +9 -6
- package/runtime/arcane/components/source-code-viewer.html +12 -9
- package/runtime/arcane/components/source-explanation.html +8 -5
- package/runtime/arcane/components/speech.html +24 -21
- package/runtime/arcane/components/summary-strip.html +4 -1
- package/runtime/arcane/components/task-progress.html +6 -3
- package/runtime/arcane/components/terminal-workspace.html +4 -1
- package/runtime/arcane/components/voice-transcription.html +11 -8
- package/runtime/arcane/components/web-navigator.html +5 -2
- package/runtime/arcane/entities/ApiModelRecord.js +5 -2
- package/runtime/arcane/entities/Calculation.js +5 -2
- package/runtime/arcane/entities/Chat.js +33 -33
- package/runtime/arcane/entities/CommunicationMessage.js +4 -1
- package/runtime/arcane/entities/CommunicationThread.js +4 -1
- package/runtime/arcane/entities/File.js +1 -1
- package/runtime/arcane/entities/Image.js +8 -5
- package/runtime/arcane/entities/IntentEnvelope.js +20 -17
- package/runtime/arcane/entities/Preference.js +9 -6
- package/runtime/arcane/entities/Theme.js +5 -2
- package/runtime/arcane/entities/User.js +11 -11
- package/runtime/arcane/entities/Weather.js +5 -2
- package/runtime/arcane/modules/AI.js +491 -165
- package/runtime/arcane/modules/AIPreferenceRuntime.js +5 -2
- package/runtime/arcane/modules/AIPreferenceTuple.js +9 -6
- package/runtime/arcane/modules/AIProviderRuntime.js +88 -85
- package/runtime/arcane/modules/AIResponseURLPolicy.js +148 -62
- package/runtime/arcane/modules/AIRuntimeState.js +29 -26
- package/runtime/arcane/modules/AnsiText.js +4 -1
- package/runtime/arcane/modules/ApiModelDatabase.js +22 -19
- package/runtime/arcane/modules/AppDataScope.js +8 -5
- package/runtime/arcane/modules/ArcaneCommunicationBridge.js +4 -1
- package/runtime/arcane/modules/ArcaneNavigationPolicy.js +8 -5
- package/runtime/arcane/modules/ArcaneNetworkPolicy.js +18 -15
- package/runtime/arcane/modules/AsyncBoundary.js +13 -10
- package/runtime/arcane/modules/BrowserTestSuite.js +19 -16
- package/runtime/arcane/modules/CalculatorEngine.js +5 -2
- package/runtime/arcane/modules/ChatRecords.js +18 -15
- package/runtime/arcane/modules/CommunicationAppController.js +9 -6
- package/runtime/arcane/modules/CommunicationHub.js +9 -6
- package/runtime/arcane/modules/CommunicationPreferences.js +4 -1
- package/runtime/arcane/modules/CommunicationProviderRegistry.js +4 -1
- package/runtime/arcane/modules/ComponentContracts.js +56 -53
- package/runtime/arcane/modules/ConfiguredAIChatSession.js +30 -27
- package/runtime/arcane/modules/ConversationActionItems.js +15 -12
- package/runtime/arcane/modules/ConversationClosingReport.js +11 -8
- package/runtime/arcane/modules/ConversationTimebox.js +28 -25
- package/runtime/arcane/modules/CoreLocalModelCatalog.js +17 -14
- package/runtime/arcane/modules/DBLS.js +7 -4
- package/runtime/arcane/modules/DBOPFS.js +7 -7
- package/runtime/arcane/modules/DBOPFSDocumentLibrary.js +34 -31
- package/runtime/arcane/modules/DevelopmentWorkspace.js +4 -1
- package/runtime/arcane/modules/DirectoryPicker.js +8 -5
- package/runtime/arcane/modules/DocumentLexicalSearch.js +11 -8
- package/runtime/arcane/modules/DocumentNavigation.js +7 -4
- package/runtime/arcane/modules/Errors.js +28 -25
- package/runtime/arcane/modules/HTMLImport.js +7 -4
- package/runtime/arcane/modules/IsolatedModelQuestionRunner.js +15 -12
- package/runtime/arcane/modules/LocalAIReadiness.js +21 -18
- package/runtime/arcane/modules/LocalAIReadinessController.js +6 -3
- package/runtime/arcane/modules/MD.js +1 -1
- package/runtime/arcane/modules/Mail.js +46 -43
- package/runtime/arcane/modules/MailOutbox.mjs +48 -45
- package/runtime/arcane/modules/MailTransport.mjs +29 -26
- package/runtime/arcane/modules/MemoryRecords.js +7 -4
- package/runtime/arcane/modules/MessageAdvisory.js +6 -3
- package/runtime/arcane/modules/ModelDefinition.js +7 -4
- package/runtime/arcane/modules/Ollama.js +6 -3
- package/runtime/arcane/modules/OllamaModelIdentifier.js +4 -1
- package/runtime/arcane/modules/OpenMeteoWeatherProvider.js +18 -15
- package/runtime/arcane/modules/PersistentAIChatSession.js +33 -30
- package/runtime/arcane/modules/PreferenceStore.js +20 -17
- package/runtime/arcane/modules/PreparedSpeech.js +485 -0
- package/runtime/arcane/modules/Questionnaire.js +6 -3
- package/runtime/arcane/modules/RecordLinkIndex.js +4 -1
- package/runtime/arcane/modules/RecordPassageIndex.js +9 -6
- package/runtime/arcane/modules/RecordReviewStore.js +12 -9
- package/runtime/arcane/modules/RiskSignalAnalyzer.js +4 -1
- package/runtime/arcane/modules/ScopedOPFSCache.js +6 -3
- package/runtime/arcane/modules/ScreenCapture.js +20 -17
- package/runtime/arcane/modules/SpeechPlayback.js +29 -26
- package/runtime/arcane/modules/StaticDocumentCatalog.js +33 -30
- package/runtime/arcane/modules/SystemAppearance.js +5 -2
- package/runtime/arcane/modules/SystemToolRegistry.js +6 -3
- package/runtime/arcane/modules/TerminalClient.js +14 -11
- package/runtime/arcane/modules/TerminalCommandRegistry.js +4 -1
- package/runtime/arcane/modules/ThemeBootstrap.js +9 -6
- package/runtime/arcane/modules/ThemeManager.js +5 -2
- package/runtime/arcane/modules/TimeGuard.js +1 -1
- package/runtime/arcane/modules/ToolCallRouter.js +11 -8
- package/runtime/arcane/modules/WaitForComponent.js +19 -16
- package/runtime/arcane/modules/YouTubeMedia.js +4 -1
- package/runtime/strong-type/index.js +1276 -352
- package/runtime/strong-type/package.json +69 -45
- package/src/app-descriptor.mjs +17 -14
- package/src/application-tests.mjs +4 -1
- package/src/cli/main.mjs +8 -5
- package/src/constants.mjs +4 -1
- package/src/dev-server.mjs +8 -5
- package/src/doctor.mjs +5 -2
- package/src/dom-event-instrumentation.mjs +24 -20
- package/src/errors.mjs +7 -3
- package/src/event-manager.mjs +111 -108
- package/src/event-queue.mjs +8 -5
- package/src/events.mjs +12 -9
- package/src/import-map.mjs +35 -27
- package/src/installed-sdk-runtime.mjs +4 -1
- package/src/integrated-provider-loader.mjs +9 -6
- package/src/mail-credentials.mjs +16 -13
- package/src/mail-server.mjs +53 -50
- package/src/mail.mjs +18 -15
- package/src/native-plan.mjs +12 -9
- package/src/native-provider-loader.mjs +7 -4
- package/src/packager/core.mjs +18 -15
- package/src/process.mjs +6 -3
- package/src/release-bundle.mjs +14 -11
- package/src/runtime.mjs +4 -1
- package/src/scaffold.mjs +9 -6
- package/src/sdk-browser-runtime.mjs +4 -1
- package/src/source-server.mjs +17 -14
- package/src/targets/index.mjs +5 -2
- package/src/templates/workspace-template.mjs +13 -6
- package/src/testing-loader.mjs +7 -4
- package/src/testing.mjs +10 -7
- package/src/toolchain.mjs +13 -10
- package/src/update-check.mjs +9 -6
- package/src/workspace-operation-lock.mjs +14 -11
- package/src/workspace-runtime.mjs +4 -1
- package/src/workspace.mjs +17 -14
- package/runtime/arcane/modules/AIResponseLength.js +0 -32
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import Is from './dependencies/strong-type/index.js';
|
|
2
|
+
|
|
3
|
+
const is=new Is(false);
|
|
4
|
+
|
|
1
5
|
export const DOM_INTERACTION_EVENT='arcane.dom.interaction';
|
|
2
6
|
export const DOM_MUTATION_EVENT='arcane.dom.mutation';
|
|
3
7
|
export const DOM_OBSERVATION_STARTED_EVENT='arcane.dom.observation.started';
|
|
@@ -25,13 +29,13 @@ function capturedString(value){
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
function cssEscape(value){
|
|
28
|
-
if(
|
|
32
|
+
if(is.function(globalThis.CSS?.escape))return globalThis.CSS.escape(value);
|
|
29
33
|
return String(value).replaceAll(/[^a-zA-Z0-9_-]/gu,character=>`\\${character.codePointAt(0).toString(16)} `);
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
function readAttribute(target,name){
|
|
33
37
|
try{
|
|
34
|
-
return
|
|
38
|
+
return is.function(target?.getAttribute)?target.getAttribute(name):null;
|
|
35
39
|
}catch{
|
|
36
40
|
return null;
|
|
37
41
|
}
|
|
@@ -67,7 +71,7 @@ function selectorSegment(target){
|
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
export function domSelector(target,root){
|
|
70
|
-
if(!target
|
|
74
|
+
if(!target||!is.object(target))return null;
|
|
71
75
|
if(target.nodeType===9)return ':document';
|
|
72
76
|
if(target.nodeType===11)return ':shadow-root';
|
|
73
77
|
if(target.nodeType===3)return domSelector(target.parentElement??target.parentNode,root);
|
|
@@ -111,7 +115,7 @@ export function domSelector(target,root){
|
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
export function describeDOMTarget(target,root){
|
|
114
|
-
if(!target
|
|
118
|
+
if(!target||!is.object(target))return null;
|
|
115
119
|
if(target.nodeType===9){
|
|
116
120
|
return {kind:'document',selector:':document'};
|
|
117
121
|
}
|
|
@@ -145,7 +149,7 @@ export function describeDOMTarget(target,root){
|
|
|
145
149
|
}
|
|
146
150
|
|
|
147
151
|
function targetValue(target){
|
|
148
|
-
if(!target
|
|
152
|
+
if(!target||!is.object(target))return undefined;
|
|
149
153
|
const type=String(target.type??'').toLowerCase();
|
|
150
154
|
if(type==='checkbox'||type==='radio')return Boolean(target.checked);
|
|
151
155
|
if(type==='file'){
|
|
@@ -156,24 +160,24 @@ function targetValue(target){
|
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
function safeEventDetail(value){
|
|
159
|
-
if(
|
|
160
|
-
if(value===null||
|
|
163
|
+
if(is.string(value))return capturedString(value);
|
|
164
|
+
if(value===null||is.number(value)||is.boolean(value))return value;
|
|
161
165
|
return value;
|
|
162
166
|
}
|
|
163
167
|
|
|
164
168
|
function interactionRecord(event,root){
|
|
165
|
-
const path=
|
|
166
|
-
const target=path.find(item=>item&&
|
|
169
|
+
const path=is.function(event?.composedPath)?event.composedPath():[event?.target];
|
|
170
|
+
const target=path.find(item=>item&&is.object(item))??event?.target??null;
|
|
167
171
|
const eventType=String(event?.type??'');
|
|
168
172
|
const details={};
|
|
169
173
|
const fields=new Set([
|
|
170
174
|
...EVENT_FIELDS,
|
|
171
|
-
...Reflect.ownKeys(event??{}).filter(field=>
|
|
175
|
+
...Reflect.ownKeys(event??{}).filter(field=>is.string(field))
|
|
172
176
|
]);
|
|
173
177
|
for(const field of fields){
|
|
174
178
|
let value;
|
|
175
179
|
try{value=event?.[field];}catch{continue;}
|
|
176
|
-
if(value!==undefined
|
|
180
|
+
if(value!==undefined&&!is.function(value)){
|
|
177
181
|
details[field]=safeEventDetail(value);
|
|
178
182
|
}
|
|
179
183
|
}
|
|
@@ -254,7 +258,7 @@ function collectOpenShadowRoots(root){
|
|
|
254
258
|
const roots=[];
|
|
255
259
|
const candidates=[];
|
|
256
260
|
try{
|
|
257
|
-
if(
|
|
261
|
+
if(is.function(root?.querySelectorAll))candidates.push(...root.querySelectorAll('*'));
|
|
258
262
|
}catch{}
|
|
259
263
|
for(const candidate of candidates){
|
|
260
264
|
if(candidate?.shadowRoot)roots.push(candidate.shadowRoot,...collectOpenShadowRoots(candidate.shadowRoot));
|
|
@@ -270,18 +274,18 @@ export function createDOMInstrumentation({
|
|
|
270
274
|
captureMutations=true,
|
|
271
275
|
observeOpenShadowRoots=true
|
|
272
276
|
}={}){
|
|
273
|
-
if(!eventManager
|
|
277
|
+
if(!eventManager||!is.function(eventManager.emit)){
|
|
274
278
|
throw new TypeError('DOM instrumentation requires an event manager.');
|
|
275
279
|
}
|
|
276
|
-
if(!root
|
|
280
|
+
if(!root||!is.function(root.addEventListener)||!is.function(root.removeEventListener)){
|
|
277
281
|
throw new TypeError('DOM instrumentation requires an EventTarget-compatible root.');
|
|
278
282
|
}
|
|
279
|
-
if(!
|
|
283
|
+
if(!is.array(eventTypes)||eventTypes.some(type=>!is.string(type)||!type)){
|
|
280
284
|
throw new TypeError('DOM event types must be non-empty strings.');
|
|
281
285
|
}
|
|
282
286
|
eventTypes=[...new Set(eventTypes)];
|
|
283
287
|
for(const [name,value] of Object.entries({captureMutations,observeOpenShadowRoots})){
|
|
284
|
-
if(
|
|
288
|
+
if(!is.boolean(value))throw new TypeError(`${name} must be boolean.`);
|
|
285
289
|
}
|
|
286
290
|
const observedRoots=new Set();
|
|
287
291
|
const listenerRegistrations=new Map();
|
|
@@ -351,7 +355,7 @@ export function createDOMInstrumentation({
|
|
|
351
355
|
|
|
352
356
|
const publish=(type,payload,metadata)=>{
|
|
353
357
|
const before=Number(eventManager.eventCount??0);
|
|
354
|
-
if(
|
|
358
|
+
if(is.function(eventManager.instrument)){
|
|
355
359
|
eventManager.instrument(type,payload,{source:'dom',...metadata});
|
|
356
360
|
}else{
|
|
357
361
|
eventManager.emit(type,payload);
|
|
@@ -365,7 +369,7 @@ export function createDOMInstrumentation({
|
|
|
365
369
|
const interaction=(event,observedRoot)=>{
|
|
366
370
|
let path=[];
|
|
367
371
|
try{
|
|
368
|
-
if(
|
|
372
|
+
if(is.function(event?.composedPath))path=event.composedPath();
|
|
369
373
|
}catch{}
|
|
370
374
|
const outermostObservedRoot=path.reduce(
|
|
371
375
|
(selected,item)=>observedRoots.has(item)?item:selected,
|
|
@@ -446,7 +450,7 @@ export function createDOMInstrumentation({
|
|
|
446
450
|
if(active)return api;
|
|
447
451
|
try{
|
|
448
452
|
if(captureMutations){
|
|
449
|
-
if(
|
|
453
|
+
if(!is.function(MutationObserverImpl)){
|
|
450
454
|
throw new TypeError('MutationObserver is required when DOM mutation capture is enabled.');
|
|
451
455
|
}
|
|
452
456
|
observer=new MutationObserverImpl(mutations);
|
|
@@ -473,7 +477,7 @@ export function createDOMInstrumentation({
|
|
|
473
477
|
}
|
|
474
478
|
|
|
475
479
|
function stop({emitLifecycle=true}={}){
|
|
476
|
-
if(
|
|
480
|
+
if(!is.boolean(emitLifecycle))throw new TypeError('emitLifecycle must be boolean.');
|
|
477
481
|
if(!active)return api;
|
|
478
482
|
const shouldEmitLifecycle=emitLifecycle&&lifecycleStarted;
|
|
479
483
|
if(!emitLifecycle)lifecycleStarted=false;
|