arcane-os 0.5.7 → 0.5.9

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +39 -27
  3. package/browser-runtime/ai/browser-speech-artifacts.mjs +23 -1683
  4. package/browser-runtime/ai/browser-speech-providers.mjs +353 -143
  5. package/browser-runtime/ai/browser-wasm-llm-provider.mjs +32 -324
  6. package/browser-runtime/ai/speech-worker-client.mjs +51 -14
  7. package/browser-runtime/ai/speech-worker-runtime.mjs +45 -1072
  8. package/browser-runtime/dependencies/strong-type/package.json +22 -23
  9. package/browser-runtime/event-manager.mjs +27 -41
  10. package/package.json +2 -3
  11. package/runtime/arcane/components/chat.html +1 -1
  12. package/runtime/arcane/components/speech.html +8 -38
  13. package/runtime/arcane/components/voice-transcription.html +1 -1
  14. package/runtime/arcane/css/theme.css +1 -1
  15. package/runtime/arcane/entities/Chat.js +12 -7
  16. package/runtime/arcane/modules/AI.js +569 -402
  17. package/runtime/arcane/modules/AIPreferenceTuple.js +1 -1
  18. package/runtime/arcane/modules/AIProviderRuntime.js +129 -68
  19. package/runtime/arcane/modules/AIRuntimeState.js +2 -18
  20. package/runtime/arcane/modules/BrowserTestSuite.js +2 -5
  21. package/runtime/arcane/modules/CalculatorEngine.js +0 -4
  22. package/runtime/arcane/modules/ChatRecords.js +169 -1
  23. package/runtime/arcane/modules/CommunicationHub.js +0 -19
  24. package/runtime/arcane/modules/ConfiguredAIChatSession.js +28 -25
  25. package/runtime/arcane/modules/DBOPFSDocumentLibrary.js +4 -5
  26. package/runtime/arcane/modules/DocumentLexicalSearch.js +1 -1
  27. package/runtime/arcane/modules/Errors.js +6 -19
  28. package/runtime/arcane/modules/Mail.js +1 -2
  29. package/runtime/arcane/modules/MailTransport.mjs +1 -3
  30. package/runtime/arcane/modules/OllamaModelIdentifier.js +1 -1
  31. package/runtime/arcane/modules/PersistentAIChatSession.js +5 -5
  32. package/runtime/arcane/modules/ScreenCapture.js +2 -4
  33. package/runtime/arcane/modules/SpeechPlayback.js +0 -27
  34. package/runtime/arcane/modules/WaitForComponent.js +0 -1
  35. package/src/app-descriptor.mjs +1 -1
  36. package/src/doctor.mjs +1 -3
  37. package/src/event-manager.mjs +27 -41
  38. package/src/import-map.mjs +1 -1
  39. package/src/index.mjs +2 -9
  40. package/src/installed-sdk-runtime.mjs +1 -11
  41. package/src/mail-api.mjs +0 -1
  42. package/src/native-provider-loader.mjs +0 -9
  43. package/src/scaffold.mjs +9 -21
  44. package/src/toolchain.mjs +5 -28
  45. package/src/workspace-runtime.mjs +0 -4
  46. package/src/workspace.mjs +2 -23
@@ -1,4 +1,4 @@
1
- import {lstat,readFile,realpath,rm,stat,writeFile} from 'node:fs/promises';
1
+ import {lstat,readFile,realpath,stat,writeFile} from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import {materializeWorkspaceRuntimeContent} from './workspace-runtime.mjs';
4
4
  import {withWorkspaceOperationLock} from './workspace-operation-lock.mjs';
@@ -68,15 +68,6 @@ async function writeWorkspaceLock(lockPath,lock){
68
68
  await writeFile(lockPath,`${JSON.stringify(lock,null,2)}\n`,'utf8');
69
69
  }
70
70
 
71
- async function removeRetiredInstalledRuntimeReceipt(canonicalRoot){
72
- const receiptPath=path.join(
73
- canonicalRoot,
74
- '.arcane',
75
- 'installed-sdk-runtime.json'
76
- );
77
- await rm(receiptPath,{force:true});
78
- }
79
-
80
71
  export async function materializeInstalledSdkRuntime({
81
72
  workspaceRoot,
82
73
  sdkPackageSource,
@@ -94,7 +85,6 @@ export async function materializeInstalledSdkRuntime({
94
85
  workspaceOperationLease
95
86
  },async()=>{
96
87
  const authority=await installedSdkAuthority(canonicalRoot,{sdkPackageSource});
97
- await removeRetiredInstalledRuntimeReceipt(canonicalRoot);
98
88
  const workspaceRuntime=await materializeWorkspaceRuntimeContent({
99
89
  workspaceRoot:canonicalRoot,
100
90
  runtimeRoot:authority.installation.runtimeRoot,
package/src/mail-api.mjs CHANGED
@@ -12,7 +12,6 @@ export {
12
12
  createMailOutbox
13
13
  } from '../runtime/arcane/modules/MailOutbox.mjs';
14
14
  export {
15
- DEFAULT_MAIL_REQUEST_TIMEOUT_MS,
16
15
  MailTransportError,
17
16
  normalizeMailEndpoint,
18
17
  sendMailReport,
@@ -27,8 +27,6 @@ export const ARCANE_NATIVE_PROVIDER_PATHS={
27
27
  'android-arm64':[...FIXED_NATIVE_PROVIDER_PATHS['android-arm64']]
28
28
  };
29
29
 
30
- export const ARCANE_PORTABLE_PROVIDER_PATH=[...ARCANE_NATIVE_PROVIDER_PATHS.portable];
31
-
32
30
  function fail(message,details){
33
31
  throw new ArcaneError(ERROR_CODES.targetUnavailable,message,{details});
34
32
  }
@@ -158,10 +156,3 @@ export async function loadArcaneNativeProvider(options={}){
158
156
  });
159
157
  return pairing;
160
158
  }
161
-
162
- export function loadArcanePortableProvider(options={}){
163
- if(options===null||typeof options!=='object'||Array.isArray(options)){
164
- fail('Arcane portable provider options must be an object.');
165
- }
166
- return loadArcaneNativeProvider({...options,target:'portable'});
167
- }
package/src/scaffold.mjs CHANGED
@@ -386,8 +386,6 @@ export async function initWorkspace({
386
386
  },async workspaceOperationLease=>{
387
387
  const profile=await existingWorkspaceProfile(resolvedRoot);
388
388
  const workspaceMode=profile?.workspaceMode??'external';
389
- const legacyIntegrated=workspaceMode==='integrated'
390
- &&profile.config.browserRuntimeLayout==='integrated-legacy';
391
389
  const existingPackage=workspaceMode==='external'
392
390
  ?await readExistingPackage(resolvedRoot)
393
391
  :null;
@@ -407,7 +405,7 @@ export async function initWorkspace({
407
405
  appId,
408
406
  displayName,
409
407
  appOnly:true,
410
- namedImports:!legacyIntegrated,
408
+ namedImports:true,
411
409
  minimumCoreVersion:await integratedCoreVersion(resolvedRoot),
412
410
  target,
413
411
  appIcon:await scaffoldIcon(target)
@@ -457,24 +455,14 @@ export async function initWorkspace({
457
455
  onEvent
458
456
  })
459
457
  :null;
460
- const importMap=legacyIntegrated
461
- ?{
462
- appId,
463
- skipped:true,
464
- compatibility:'integrated-legacy',
465
- reason:'The canonical integrated Arcane OS root retains its physical two-route browser runtime.'
466
- }
467
- :await generateImportMap({
468
- workspaceRoot:resolvedRoot,
469
- appId,
470
- appRoot:path.join(resolvedRoot,'apps',appId),
471
- workspaceOperationLease,
472
- signal,
473
- onEvent
474
- });
475
- if(legacyIntegrated){
476
- await emit(onEvent,{type:'import-map.compatibility.skipped',...importMap});
477
- }
458
+ const importMap=await generateImportMap({
459
+ workspaceRoot:resolvedRoot,
460
+ appId,
461
+ appRoot:path.join(resolvedRoot,'apps',appId),
462
+ workspaceOperationLease,
463
+ signal,
464
+ onEvent
465
+ });
478
466
  const result={
479
467
  workspaceRoot:resolvedRoot,
480
468
  workspaceMode,
package/src/toolchain.mjs CHANGED
@@ -284,17 +284,6 @@ async function validatePreparedRuntime(prepared,{signal}={}){
284
284
  }
285
285
 
286
286
  async function refreshPreparedImportMap(prepared,{signal,onEvent,workspaceOperationLease}={}){
287
- if(prepared.workspaceMode==='integrated'
288
- &&prepared.validation.config.browserRuntimeLayout==='integrated-legacy'){
289
- const result={
290
- appId:prepared.appId,
291
- skipped:true,
292
- compatibility:'integrated-legacy',
293
- reason:'The canonical integrated Arcane OS root retains its physical two-route browser runtime.'
294
- };
295
- await emit(onEvent,{type:'import-map.compatibility.skipped',...result});
296
- return result;
297
- }
298
287
  const manifest=prepared.validation.app.manifest;
299
288
  const inspected=await inspectPackagedApp({
300
289
  workspaceRoot:prepared.workspaceRoot,
@@ -389,15 +378,11 @@ export async function doctorApplication(options={}){
389
378
 
390
379
  async function runPreparedApplicationTests(prepared,options={}){
391
380
  throwIfAborted(options.signal);
392
- const integratedLegacy=prepared.workspaceMode==='integrated'
393
- &&prepared.validation.config.browserRuntimeLayout==='integrated-legacy';
394
- const managedImportMapContext=integratedLegacy
395
- ?null
396
- :await readApplicationTestImportMapContext({
397
- workspaceRoot:prepared.workspaceRoot,
398
- applicationRoot:prepared.appRoot,
399
- signal:options.signal
400
- });
381
+ const managedImportMapContext=await readApplicationTestImportMapContext({
382
+ workspaceRoot:prepared.workspaceRoot,
383
+ applicationRoot:prepared.appRoot,
384
+ signal:options.signal
385
+ });
401
386
  return runApplicationTests({
402
387
  workspaceRoot:prepared.workspaceRoot,
403
388
  workspaceMode:prepared.workspaceMode,
@@ -701,10 +686,6 @@ export function resolveNativeBuildOutputRoot({target,workspaceMode,workspaceRoot
701
686
  return resolved;
702
687
  }
703
688
 
704
- export function resolvePortableBuildOutputRoot(options={}){
705
- return resolveNativeBuildOutputRoot({...options,target:'portable'});
706
- }
707
-
708
689
  function sameCanonicalPath(left,right){
709
690
  const normalize=value=>{
710
691
  const normalized=path.normalize(path.resolve(value));
@@ -723,10 +704,6 @@ export function assertIntegratedNativeToolchain({workspaceMode,workspaceRoot,too
723
704
  }
724
705
  }
725
706
 
726
- export function assertIntegratedPortableToolchain(options={}){
727
- return assertIntegratedNativeToolchain({...options,target:'portable'});
728
- }
729
-
730
707
  export async function verifyNativeArtifact(options={}){
731
708
  const {target,adapter}=targetSelection(options);
732
709
  const targetDescription=await adapter.describe();
@@ -168,7 +168,3 @@ export async function materializeWorkspaceRuntimeContent({
168
168
  if(!backedUp||promoted)await removeTemporaryTree(backupRoot);
169
169
  }
170
170
  }
171
-
172
- export async function materializeWorkspaceRuntime(options={}){
173
- return materializeWorkspaceRuntimeContent(options);
174
- }
package/src/workspace.mjs CHANGED
@@ -179,18 +179,6 @@ function classifyRootConfig(config){
179
179
  include:['components','css','dependencies','entities','img','modules','sdk','security']
180
180
  }
181
181
  ];
182
- const integratedLegacy=[
183
- {
184
- source:'arcane',
185
- destination:'arcane',
186
- include:['components','css','entities','img','modules','security']
187
- },
188
- {
189
- source:'node_modules/strong-type',
190
- destination:'node_modules/strong-type',
191
- include:['index.js','licence','package.json']
192
- }
193
- ];
194
182
  const matches=(expected,{optionalArcaneSecurity=false}={})=>{
195
183
  if(routes.length!==expected.length)return false;
196
184
  return routes.every(function routeMatches(route,index){
@@ -210,23 +198,17 @@ function classifyRootConfig(config){
210
198
  });
211
199
  };
212
200
  let workspaceMode;
213
- let browserRuntimeLayout;
214
201
  if(matches(external,{optionalArcaneSecurity:true})){
215
202
  workspaceMode='external';
216
- browserRuntimeLayout='physical-v1';
217
203
  }else if(matches(integrated,{optionalArcaneSecurity:true})){
218
204
  workspaceMode='integrated';
219
- browserRuntimeLayout='physical-v1';
220
- }else if(matches(integratedLegacy)){
221
- workspaceMode='integrated';
222
- browserRuntimeLayout='integrated-legacy';
223
205
  }else{
224
206
  fail(`${ROOT_CONFIG_NAME} browser-runtime routes must match the external SDK or integrated Arcane workspace contract.`);
225
207
  }
226
208
  return completeValue({
227
209
  ...validated,
228
210
  workspaceMode,
229
- browserRuntimeLayout,
211
+ browserRuntimeLayout:'physical-v1',
230
212
  ...(workspaceMode==='external'?{sdkPackageSource:externalPackageSource}:{})
231
213
  });
232
214
  }
@@ -577,12 +559,9 @@ export async function validateWorkspace({
577
559
  });
578
560
  }else{
579
561
  await add('workspace-runtime',async()=>{
580
- const strongType=resolved.config.browserRuntimeLayout==='integrated-legacy'
581
- ?path.join('node_modules','strong-type')
582
- :path.join('arcane','dependencies','strong-type');
583
562
  for(const [relative,label] of [
584
563
  ['arcane','Integrated Arcane runtime'],
585
- [strongType,'Integrated strong-type runtime']
564
+ [path.join('arcane','dependencies','strong-type'),'Integrated strong-type runtime']
586
565
  ]){
587
566
  const info=await stat(path.join(resolved.workspaceRoot,relative));
588
567
  if(!info.isDirectory()){