arcane-os 0.2.1 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-os",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Arcane OS JavaScript SDK, project-local CLI, browser runtime, and repository-portable application packager.",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "builder": "arcane-sdk-runtime-v1",
4
- "sdkVersion": "0.2.1",
4
+ "sdkVersion": "0.2.2",
5
5
  "source": {
6
6
  "authority": "sdk-canonical",
7
7
  "repository": "https://github.com/TheWizardNexus/arcane-os-sdk.git",
@@ -14,8 +14,8 @@
14
14
  }
15
15
  },
16
16
  "fileCount": 160,
17
- "totalBytes": 3605154,
18
- "contentSha256": "5b921d50b6a0cf36a13f7a7dedf96cd3a68104a322e5139136fd4197aa1ca7cb",
17
+ "totalBytes": 3643083,
18
+ "contentSha256": "0b09b1fd548152416f583d5e117197c7886b5a9e63071e43493577b4090e4a8c",
19
19
  "files": [
20
20
  {
21
21
  "path": "arcane/components/app-bar.html",
@@ -39,8 +39,8 @@
39
39
  },
40
40
  {
41
41
  "path": "arcane/components/chat.html",
42
- "bytes": 61650,
43
- "sha256": "d644848fbc3ccc85d491db7ada75231f393a371dd3a0ccd92f223c172571e47b"
42
+ "bytes": 60478,
43
+ "sha256": "2f3a7f454c1e3da64c9eaeedb0869d49f04636b20ff59e5116a671e0d0a17973"
44
44
  },
45
45
  {
46
46
  "path": "arcane/components/conversation-view.html",
@@ -159,8 +159,8 @@
159
159
  },
160
160
  {
161
161
  "path": "arcane/components/speech.html",
162
- "bytes": 38217,
163
- "sha256": "61786685b7f4f257da77db2cbbe8230b379c56292ad635081f5b0763d5f48e1e"
162
+ "bytes": 49596,
163
+ "sha256": "2a8b2929d28699ab9011f358b09b5fd2d53a0703542b2fee5cda8334261c6c86"
164
164
  },
165
165
  {
166
166
  "path": "arcane/components/summary-strip.html",
@@ -374,8 +374,8 @@
374
374
  },
375
375
  {
376
376
  "path": "arcane/modules/AI.js",
377
- "bytes": 103733,
378
- "sha256": "3a051d67b1e895b7c6f14af36a34daf1d92fe70e02c95c1c4ffd80cc7c622561"
377
+ "bytes": 120607,
378
+ "sha256": "703a5342ed0c0758cccdfd8469fbae6d86e91de8c43ec01c893619daf97c2d34"
379
379
  },
380
380
  {
381
381
  "path": "arcane/modules/AIPreferenceRuntime.js",
@@ -389,8 +389,8 @@
389
389
  },
390
390
  {
391
391
  "path": "arcane/modules/AIProviderRuntime.js",
392
- "bytes": 83261,
393
- "sha256": "32aa65b464ea9a9317d47f382063fc052e1f47e63e6c65c28e58898e0ab4911a"
392
+ "bytes": 93507,
393
+ "sha256": "d1b33f678431128cefe6f43daabe177794e758c770394098871cf4ac726926b8"
394
394
  },
395
395
  {
396
396
  "path": "arcane/modules/AIResponseLength.js",
@@ -404,8 +404,8 @@
404
404
  },
405
405
  {
406
406
  "path": "arcane/modules/AIRuntimeState.js",
407
- "bytes": 24783,
408
- "sha256": "8b9bfaf208eb44455b581d8e700cec785044f81595dcf839dcdfa3e06ed0f5fa"
407
+ "bytes": 25379,
408
+ "sha256": "492162cec5e6a8b9e9b437833172905b2cb4e352ca1ef30104c65ec29cf3fa29"
409
409
  },
410
410
  {
411
411
  "path": "arcane/modules/AnsiText.js",
@@ -599,8 +599,8 @@
599
599
  },
600
600
  {
601
601
  "path": "arcane/modules/LocalAIReadinessController.js",
602
- "bytes": 4334,
603
- "sha256": "32d4ce2639557b89a283754a67435226777b56df696ce7a76231ec6c0274b25c"
602
+ "bytes": 4340,
603
+ "sha256": "f80d51d0ad499664f265b4f2d52a46ede521a78d56714fecb0e13b939b261007"
604
604
  },
605
605
  {
606
606
  "path": "arcane/modules/MD.js",
@@ -719,8 +719,7 @@
719
719
  ?speech.initialMuted
720
720
  :true;
721
721
  let initialSpeechMuteListenerInstalled=false;
722
- let pendingSpeechAvailability=null;
723
- let speechAvailabilityListenerInstalled=false;
722
+ let latestAIRuntimeRoles=null;
724
723
  const hostSubmissionBarrier=new ConversationSubmissionBarrier();
725
724
  const aiRuntimeStateAbortController=new AbortController();
726
725
  let programmaticSubmissionQueue=Promise.resolve(true);
@@ -910,36 +909,32 @@
910
909
  }
911
910
 
912
911
  function setAIAvailability(input={}){
913
- const explicitSpeechAvailability={};
914
912
  const availability={
915
- llm:Object.prototype.hasOwnProperty.call(input,'llm')
913
+ llm:hasSelectedAIRuntimeRole('llm')
914
+ ?latestAIRuntimeRoles.llm.state==='ready'
915
+ :Object.prototype.hasOwnProperty.call(input,'llm')
916
916
  ?Boolean(input.llm)
917
917
  :host.aiAvailability.llm,
918
- stt:Object.prototype.hasOwnProperty.call(input,'stt')
919
- ?Boolean(input.stt)
918
+ stt:latestAIRuntimeRoles
919
+ ?latestAIRuntimeRoles.stt.state==='ready'
920
920
  :host.aiAvailability.stt,
921
- tts:Object.prototype.hasOwnProperty.call(input,'tts')
922
- ?Boolean(input.tts)
921
+ tts:latestAIRuntimeRoles
922
+ ?latestAIRuntimeRoles.tts.state==='ready'
923
923
  :host.aiAvailability.tts
924
924
  };
925
925
 
926
- if(Object.prototype.hasOwnProperty.call(input,'stt')){
927
- explicitSpeechAvailability.stt=availability.stt;
928
- }
929
- if(Object.prototype.hasOwnProperty.call(input,'tts')){
930
- explicitSpeechAvailability.tts=availability.tts;
931
- }
932
926
  applyAIAvailability(availability);
933
- if(Object.keys(explicitSpeechAvailability).length){
934
- pendingSpeechAvailability={
935
- ...(pendingSpeechAvailability||{}),
936
- ...explicitSpeechAvailability
937
- };
938
- synchronizeSpeechCompatibilityAvailability();
939
- }
940
927
  return {...availability};
941
928
  }
942
929
 
930
+ function hasSelectedAIRuntimeRole(role){
931
+ const record=latestAIRuntimeRoles?.[role];
932
+ return typeof record?.providerId==='string'
933
+ &&record.providerId.length>0
934
+ &&typeof record?.modelId==='string'
935
+ &&record.modelId.length>0;
936
+ }
937
+
943
938
  function applyAIAvailability(availability){
944
939
  host.aiAvailability={...availability};
945
940
  send.disabled=host.conversationComplete||!availability.llm;
@@ -1131,6 +1126,7 @@
1131
1126
  }
1132
1127
 
1133
1128
  function synchronizeAIRuntimeState(snapshot){
1129
+ latestAIRuntimeRoles=snapshot.roles;
1134
1130
  aiActivationController.synchronize(snapshot.roles.llm);
1135
1131
  applyAIAvailability({
1136
1132
  llm:snapshot.roles.llm.state==='ready',
@@ -1139,37 +1135,6 @@
1139
1135
  });
1140
1136
  }
1141
1137
 
1142
- function synchronizeSpeechCompatibilityAvailability(){
1143
- if(!pendingSpeechAvailability){
1144
- return;
1145
- }
1146
- if(speech.componentReady){
1147
- const availability=pendingSpeechAvailability;
1148
- pendingSpeechAvailability=null;
1149
- speech.setAvailability?.({...availability});
1150
- return;
1151
- }
1152
- if(speechAvailabilityListenerInstalled){
1153
- return;
1154
- }
1155
-
1156
- speechAvailabilityListenerInstalled=true;
1157
- speech.addEventListener(
1158
- 'speech-ready',
1159
- applyPendingSpeechAvailability,
1160
- {once:true}
1161
- );
1162
- }
1163
-
1164
- function applyPendingSpeechAvailability(){
1165
- speechAvailabilityListenerInstalled=false;
1166
- if(pendingSpeechAvailability){
1167
- const availability=pendingSpeechAvailability;
1168
- pendingSpeechAvailability=null;
1169
- speech.setAvailability?.({...availability});
1170
- }
1171
- }
1172
-
1173
1138
  function formatConversationTime(milliseconds=0){
1174
1139
  const totalSeconds=Math.max(0,Math.floor(milliseconds/1000));
1175
1140
  const hours=Math.floor(totalSeconds/3600);