arcane-os 0.64.0 → 0.65.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/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/browser-runtime/core/client.mjs +62 -5
- package/docs/guides/native-whisper-openvino.md +334 -0
- package/docs/reference/README.md +4 -0
- package/docs/reference/arcane-ollama.md +1 -1
- package/docs/reference/codex-app-server.md +269 -0
- package/docs/reference/core-client.md +60 -2
- package/docs/reference/core-development.md +157 -0
- package/docs/reference/core-native-packaging.md +13 -0
- package/docs/reference/core-repositories.md +112 -3
- package/docs/reference/inventory/package-api.json +143 -3
- package/docs/reference/inventory/runtime-modules.json +3 -2
- package/docs/reference/local-ai.md +73 -3
- package/docs/reference/local-image-generation.md +5 -0
- package/docs/reference/local-image-sdxl.md +1 -1
- package/docs/reference/mcp-stdio.md +263 -0
- package/docs/reference/runtime-components.md +18 -1
- package/docs/reference/runtime-modules.md +10 -2
- package/docs/reference/sdk-api.md +251 -1
- package/package.json +6 -2
- package/runtime/arcane/modules/AI.js +156 -13
- package/runtime/arcane/modules/Ollama.js +1 -1
- package/runtime/arcane/modules/OllamaModelIdentifier.js +13 -0
- package/schemas/arcane-app.schema.json +8 -1
- package/schemas/arcane-package.schema.json +8 -1
- package/src/codex/app-server.mjs +845 -0
- package/src/core/development.mjs +457 -0
- package/src/core/repositories.mjs +170 -5
- package/src/core/services/local-ai.mjs +80 -10
- package/src/dev-server.mjs +3 -2
- package/src/index.mjs +1 -0
- package/src/local-ai/dev.mjs +80 -426
- package/src/local-ai/whisper/config.mjs +31 -3
- package/src/local-ai/whisper/index.mjs +62 -5
- package/src/local-ai/whisper/install.mjs +72 -14
- package/src/local-ai/whisper/native/main.cpp +33 -2
- package/src/local-ai/whisper/openvino-build.mjs +138 -0
- package/src/mcp/stdio-server.mjs +579 -0
- package/src/native/portable-layout.mjs +3 -1
- package/src/toolchain.mjs +19 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arcane-os",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
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",
|
|
@@ -59,8 +59,11 @@
|
|
|
59
59
|
"./core/contracts": "./browser-runtime/core/contracts.mjs",
|
|
60
60
|
"./core/classic-source": "./src/core-classic-source.mjs",
|
|
61
61
|
"./core/runtime": "./src/core/runtime.mjs",
|
|
62
|
+
"./core/development": "./src/core/development.mjs",
|
|
62
63
|
"./core/stdio": "./src/core/stdio.mjs",
|
|
63
64
|
"./core/host": "./src/core/host.mjs",
|
|
65
|
+
"./codex/app-server": "./src/codex/app-server.mjs",
|
|
66
|
+
"./mcp/stdio": "./src/mcp/stdio-server.mjs",
|
|
64
67
|
"./core/repositories": "./src/core/repositories.mjs",
|
|
65
68
|
"./core/packaged-web": "./src/core/services/packaged-web.mjs",
|
|
66
69
|
"./core/preferences": "./src/core/services/preferences.mjs",
|
|
@@ -76,6 +79,7 @@
|
|
|
76
79
|
"./local-ai/image": "./src/local-ai/image-runtime.mjs",
|
|
77
80
|
"./local-ai/whisper": "./src/local-ai/whisper/index.mjs",
|
|
78
81
|
"./local-ai/whisper/build": "./src/local-ai/whisper/build.mjs",
|
|
82
|
+
"./local-ai/whisper/openvino-build": "./src/local-ai/whisper/openvino-build.mjs",
|
|
79
83
|
"./integrated-provider": "./src/integrated-provider-loader.mjs",
|
|
80
84
|
"./packager": "./src/packager/core.mjs",
|
|
81
85
|
"./release-bundle": "./src/release-bundle.mjs",
|
|
@@ -117,7 +121,7 @@
|
|
|
117
121
|
"test": "npm run test:unit && npm run test:functional && npm run test:integration && npm run test:regression",
|
|
118
122
|
"test:release": "node ./bin/arcane-test.mjs test/npm-release.test.mjs",
|
|
119
123
|
"test:unit": "node ./bin/arcane-test.mjs test/app-descriptor.test.mjs test/app-schema.test.mjs test/app-selection.test.mjs test/contracts.test.mjs test/conversation-closing-report.test.mjs test/doctor.test.mjs test/mail-credentials.test.mjs test/mail-outbox.test.mjs test/mail-public-api.test.mjs test/mail-send.test.mjs test/mail-transport.test.mjs test/native-windows-icon.test.mjs test/targets.test.mjs test/workspace-operation-lock.test.mjs",
|
|
120
|
-
"test:functional": "node ./bin/arcane-test.mjs test/ai-request-model.test.mjs test/ai-request-retry.test.mjs test/ai-stream-cancellation.test.mjs test/browser-decisions.test.mjs test/browser-speech-providers.test.mjs test/browser-wasm-gpu-notice.test.mjs test/browser-wasm-download-resume.test.mjs test/chat-input.test.mjs test/chat-stream-speech.test.mjs test/chat-transcript-scroll.test.mjs test/chat-transient-retention.test.mjs test/cli.test.mjs test/continuous-voice-capture.test.mjs test/core-classic-source.test.mjs test/core-client.test.mjs test/core-host.test.mjs test/core-packaged-web.test.mjs test/core-runtime.test.mjs test/core-stdio.test.mjs test/dbopfs-document-library.test.mjs test/dbopfs-png.test.mjs test/dbopfs.test.mjs test/dev-server.test.mjs test/dev-pwa.test.mjs test/dom-event-instrumentation.test.mjs test/event-manager.test.mjs test/events.test.mjs test/file-preview.test.mjs test/import-map.test.mjs test/local-image-editing.test.mjs test/mail-cli.test.mjs test/mail-runtime.test.mjs test/mail-server.test.mjs test/markdown-editor.test.mjs test/markdown-media.test.mjs test/markdown-source-map.test.mjs test/modal.test.mjs test/native-module-packaging.test.mjs test/native-module-resource-references.test.mjs test/packaging.test.mjs test/pwa-packaging.test.mjs test/pwa-client.test.mjs test/pwa-install.test.mjs test/pwa-worker.test.mjs test/persistent-ai-chat-session.test.mjs test/reference-completeness.test.mjs test/rendered-print.test.mjs test/runtime-api-behavior.test.mjs test/runtime.test.mjs test/scaffold.test.mjs test/speech-playback.test.mjs test/site.test.mjs test/theme-manager.test.mjs test/twin-cloud-images.test.mjs test/twin-cloud.test.mjs test/websocket-client-import-map.test.mjs test/websocket.test.mjs test/update-check.test.mjs test/user-explicit-updates.test.mjs",
|
|
124
|
+
"test:functional": "node ./bin/arcane-test.mjs test/ai-ollama-readiness.test.mjs test/core-ollama-lifecycle.test.mjs test/ai-request-model.test.mjs test/ai-request-retry.test.mjs test/ai-stream-cancellation.test.mjs test/browser-decisions.test.mjs test/browser-speech-providers.test.mjs test/browser-wasm-gpu-notice.test.mjs test/browser-wasm-download-resume.test.mjs test/chat-input.test.mjs test/chat-stream-speech.test.mjs test/chat-transcript-scroll.test.mjs test/chat-transient-retention.test.mjs test/cli.test.mjs test/continuous-voice-capture.test.mjs test/codex-app-server.test.mjs test/mcp-stdio-server.test.mjs test/core-classic-source.test.mjs test/core-client.test.mjs test/core-client-installation.test.mjs test/core-development.test.mjs test/core-host.test.mjs test/core-packaged-web.test.mjs test/core-runtime.test.mjs test/core-stdio.test.mjs test/dbopfs-document-library.test.mjs test/dbopfs-png.test.mjs test/dbopfs.test.mjs test/dev-server.test.mjs test/dev-pwa.test.mjs test/dom-event-instrumentation.test.mjs test/event-manager.test.mjs test/events.test.mjs test/file-preview.test.mjs test/import-map.test.mjs test/local-image-editing.test.mjs test/mail-cli.test.mjs test/mail-runtime.test.mjs test/mail-server.test.mjs test/markdown-editor.test.mjs test/markdown-media.test.mjs test/markdown-source-map.test.mjs test/modal.test.mjs test/native-module-packaging.test.mjs test/native-module-resource-references.test.mjs test/packaging.test.mjs test/pwa-packaging.test.mjs test/pwa-client.test.mjs test/pwa-install.test.mjs test/pwa-worker.test.mjs test/persistent-ai-chat-session.test.mjs test/reference-completeness.test.mjs test/rendered-print.test.mjs test/runtime-api-behavior.test.mjs test/runtime.test.mjs test/scaffold.test.mjs test/speech-playback.test.mjs test/site.test.mjs test/theme-manager.test.mjs test/twin-cloud-images.test.mjs test/twin-cloud.test.mjs test/websocket-client-import-map.test.mjs test/websocket.test.mjs test/update-check.test.mjs test/user-explicit-updates.test.mjs",
|
|
121
125
|
"test:integration": "node ./bin/arcane-test.mjs test/installed-package-runtime.test.mjs test/root-app-layout.test.mjs test/integrated-shared.test.mjs test/integrated-workspace.test.mjs test/mail-browser.test.mjs test/native-macos-provider.test.mjs test/native-plan.test.mjs test/native-portable-provider.test.mjs test/native-provider-loader.test.mjs test/npm-release.test.mjs test/release-bundle.test.mjs test/release-capability-smoke.test.mjs test/shared-payload-batch.test.mjs test/tarball.test.mjs test/browser-wasm-cpu.test.mjs test/wllama-webgpu-runtime.test.mjs",
|
|
122
126
|
"test:regression": "node ./bin/arcane-test.mjs test/channel-workflows.test.mjs test/html-import-registration.test.mjs test/html-import-packaged-script.test.mjs test/logging-regression.test.mjs test/markdown-speech.test.mjs test/prepared-speech.test.mjs test/native-provider-generation.test.mjs test/speech-queue-regression.test.mjs test/testing.test.mjs test/test-sets.test.mjs",
|
|
123
127
|
"check": "node tools/check-source.mjs && npm test",
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
AI_PROVIDER_PROTOCOL,
|
|
16
16
|
getAIProviderRuntime
|
|
17
17
|
} from './AIProviderRuntime.js';
|
|
18
|
-
import {normalizeOllamaModelIdentifier} from './OllamaModelIdentifier.js';
|
|
18
|
+
import {normalizeOllamaModelIdentifier,sameOllamaModelIdentifier} from './OllamaModelIdentifier.js';
|
|
19
19
|
import {arcaneLogging} from 'arcane-os/logging';
|
|
20
20
|
import {
|
|
21
21
|
fetchHTTPResponse,
|
|
@@ -1371,11 +1371,115 @@ class AI {
|
|
|
1371
1371
|
const localOnly=providerId==='OLLAMA';
|
|
1372
1372
|
let state='unloaded';
|
|
1373
1373
|
let busy=false;
|
|
1374
|
+
let nativeWatch=null;
|
|
1375
|
+
|
|
1376
|
+
function nativeOllamaReady(){
|
|
1377
|
+
if(!nativeWatch
|
|
1378
|
+
||nativeWatch.ollama!==runtime.#nativeOllama()
|
|
1379
|
+
||nativeWatch.modelId!==runtime.model
|
|
1380
|
+
||nativeWatch.error){
|
|
1381
|
+
return false;
|
|
1382
|
+
}
|
|
1383
|
+
const snapshot=nativeWatch.snapshot;
|
|
1384
|
+
return snapshot?.available===true
|
|
1385
|
+
&&(snapshot.models??[]).some(function selectedResident(model){
|
|
1386
|
+
return sameOllamaModelIdentifier(model.id??model.model??model.name,nativeWatch.modelId)
|
|
1387
|
+
&&model.loaded===true;
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
function stopNativeOllamaWatch(){
|
|
1392
|
+
const previous=nativeWatch;
|
|
1393
|
+
nativeWatch=null;
|
|
1394
|
+
previous?.unsubscribe?.();
|
|
1395
|
+
return previous;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
function observeNativeOllama(watch,snapshot,error=null){
|
|
1399
|
+
if(nativeWatch!==watch){
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
watch.snapshot=snapshot;
|
|
1403
|
+
watch.error=error;
|
|
1404
|
+
if(state==='ready'&&!nativeOllamaReady()){
|
|
1405
|
+
state='unloaded';
|
|
1406
|
+
runtime.#retainBuiltInLLMReadiness(
|
|
1407
|
+
runtime.#reconcileBuiltInLLMReadiness()
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
async function inspectNativeOllama(watch,signal){
|
|
1413
|
+
if(signal?.aborted){
|
|
1414
|
+
throw normalizeAIRequestAbort(signal.reason);
|
|
1415
|
+
}
|
|
1416
|
+
const revision=watch.revision;
|
|
1417
|
+
try{
|
|
1418
|
+
const running=await watch.ollama.running({signal});
|
|
1419
|
+
if(signal?.aborted){
|
|
1420
|
+
throw normalizeAIRequestAbort(signal.reason);
|
|
1421
|
+
}
|
|
1422
|
+
if(nativeWatch===watch&&watch.revision===revision){
|
|
1423
|
+
observeNativeOllama(watch,{
|
|
1424
|
+
available:true,
|
|
1425
|
+
models:(running.models??[]).map(function residentModel(model){
|
|
1426
|
+
return {...model,loaded:true};
|
|
1427
|
+
})
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
}catch(error){
|
|
1431
|
+
if(!signal?.aborted&&watch.revision===revision){
|
|
1432
|
+
observeNativeOllama(watch,null,error);
|
|
1433
|
+
}
|
|
1434
|
+
throw error;
|
|
1435
|
+
}
|
|
1436
|
+
if(nativeWatch!==watch||!nativeOllamaReady()){
|
|
1437
|
+
throw watch.error??aiProviderError(
|
|
1438
|
+
'The selected Ollama model is not loaded.',
|
|
1439
|
+
'ARCANE_AI_ROLE_NOT_READY'
|
|
1440
|
+
);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
async function loadNativeOllama(context){
|
|
1445
|
+
stopNativeOllamaWatch();
|
|
1446
|
+
const ollama=runtime.#nativeOllama();
|
|
1447
|
+
if(!is.function(ollama?.generate)||!is.function(ollama?.running)){
|
|
1448
|
+
throw aiProviderError(
|
|
1449
|
+
'The native Ollama API does not expose model loading and resident status.',
|
|
1450
|
+
'AI_NATIVE_LOCAL_REQUIRED'
|
|
1451
|
+
);
|
|
1452
|
+
}
|
|
1453
|
+
const watch={
|
|
1454
|
+
ollama,modelId:context.selection.modelId,
|
|
1455
|
+
snapshot:null,error:null,revision:0,unsubscribe:null
|
|
1456
|
+
};
|
|
1457
|
+
nativeWatch=watch;
|
|
1458
|
+
if(is.function(globalThis.Arcane?.events?.on)){
|
|
1459
|
+
watch.unsubscribe=globalThis.Arcane.events.on(
|
|
1460
|
+
'localai.state',
|
|
1461
|
+
function observeNativeOllamaState(snapshot){
|
|
1462
|
+
watch.revision+=1;
|
|
1463
|
+
const engine=snapshot.ollama??snapshot.runtimes?.find(function ollamaEngine(record){
|
|
1464
|
+
return record.id==='ollama';
|
|
1465
|
+
});
|
|
1466
|
+
observeNativeOllama(watch,engine??null,engine?.error??null);
|
|
1467
|
+
}
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
// Empty generation is Ollama's public preload operation. Residency
|
|
1471
|
+
// is established separately; a successful response alone is insufficient.
|
|
1472
|
+
await ollama.generate(
|
|
1473
|
+
{model:watch.modelId,prompt:'',stream:false},
|
|
1474
|
+
{signal:context.signal}
|
|
1475
|
+
);
|
|
1476
|
+
await inspectNativeOllama(watch,context.signal);
|
|
1477
|
+
}
|
|
1374
1478
|
|
|
1375
1479
|
function statusBuiltInLLMProvider(){
|
|
1376
1480
|
if(state==='ready'
|
|
1377
|
-
&&!
|
|
1378
|
-
|
|
1481
|
+
&&((localOnly&&!nativeOllamaReady())
|
|
1482
|
+
||(!busy&&!runtime.#builtInLLMCapability(providerId)))){
|
|
1379
1483
|
state='unloaded';
|
|
1380
1484
|
}
|
|
1381
1485
|
return completeValue({
|
|
@@ -1423,7 +1527,7 @@ class AI {
|
|
|
1423
1527
|
return runtime.#builtInLLMInspection(providerId,selection);
|
|
1424
1528
|
},
|
|
1425
1529
|
status:statusBuiltInLLMProvider,
|
|
1426
|
-
load:function loadBuiltInLLMProvider(context={}){
|
|
1530
|
+
load:async function loadBuiltInLLMProvider(context={}){
|
|
1427
1531
|
if(context.signal?.aborted){
|
|
1428
1532
|
throw normalizeAIRequestAbort(context.signal.reason);
|
|
1429
1533
|
}
|
|
@@ -1447,7 +1551,7 @@ class AI {
|
|
|
1447
1551
|
const inspection=assertBuiltInLLMSelection(context.selection);
|
|
1448
1552
|
state='loading';
|
|
1449
1553
|
context.progress({
|
|
1450
|
-
phase:'capability',
|
|
1554
|
+
phase:localOnly?'loading':'capability',
|
|
1451
1555
|
completed:0,
|
|
1452
1556
|
total:1,
|
|
1453
1557
|
unit:'items',
|
|
@@ -1457,9 +1561,18 @@ class AI {
|
|
|
1457
1561
|
state='unloaded';
|
|
1458
1562
|
throw normalizeAIRequestAbort(context.signal.reason);
|
|
1459
1563
|
}
|
|
1564
|
+
if(localOnly){
|
|
1565
|
+
try{
|
|
1566
|
+
await loadNativeOllama(context);
|
|
1567
|
+
}catch(error){
|
|
1568
|
+
state='unloaded';
|
|
1569
|
+
stopNativeOllamaWatch();
|
|
1570
|
+
throw error;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1460
1573
|
state='ready';
|
|
1461
1574
|
context.progress({
|
|
1462
|
-
phase:'capability',
|
|
1575
|
+
phase:localOnly?'loading':'capability',
|
|
1463
1576
|
completed:1,
|
|
1464
1577
|
total:1,
|
|
1465
1578
|
unit:'items',
|
|
@@ -1489,24 +1602,39 @@ class AI {
|
|
|
1489
1602
|
);
|
|
1490
1603
|
}
|
|
1491
1604
|
busy=true;
|
|
1605
|
+
const watch=nativeWatch;
|
|
1492
1606
|
if(context.operation==='chat'){
|
|
1493
|
-
return
|
|
1494
|
-
|
|
1607
|
+
return (async function requestLoadedBuiltInLLM(){
|
|
1608
|
+
if(localOnly){
|
|
1609
|
+
await inspectNativeOllama(watch,context.signal);
|
|
1610
|
+
}
|
|
1611
|
+
const result=await runtime.#requestBuiltInLLMChat(
|
|
1495
1612
|
context.payload,
|
|
1496
1613
|
context.signal,
|
|
1497
1614
|
controls.onRetry
|
|
1498
|
-
)
|
|
1499
|
-
|
|
1615
|
+
);
|
|
1616
|
+
if(localOnly){
|
|
1617
|
+
await inspectNativeOllama(watch,context.signal);
|
|
1618
|
+
}
|
|
1619
|
+
return result;
|
|
1620
|
+
})().finally(releaseBuiltInLLMRequest);
|
|
1500
1621
|
}
|
|
1501
1622
|
if(context.operation==='stream'){
|
|
1502
1623
|
const handle=createBuiltInAIStreamBridge(
|
|
1503
|
-
function executeBuiltInLLMProviderStream(bridge){
|
|
1504
|
-
|
|
1624
|
+
async function executeBuiltInLLMProviderStream(bridge){
|
|
1625
|
+
if(localOnly){
|
|
1626
|
+
await inspectNativeOllama(watch,bridge.signal);
|
|
1627
|
+
}
|
|
1628
|
+
const result=await runtime.#requestBuiltInLLMStream(
|
|
1505
1629
|
context.payload,
|
|
1506
1630
|
bridge,
|
|
1507
1631
|
controls.observeToolText,
|
|
1508
1632
|
controls.onRetry
|
|
1509
1633
|
);
|
|
1634
|
+
if(localOnly){
|
|
1635
|
+
await inspectNativeOllama(watch,bridge.signal);
|
|
1636
|
+
}
|
|
1637
|
+
return result;
|
|
1510
1638
|
},
|
|
1511
1639
|
context.signal
|
|
1512
1640
|
);
|
|
@@ -1522,18 +1650,27 @@ class AI {
|
|
|
1522
1650
|
'ARCANE_AI_PROVIDER_RUNTIME_INVALID'
|
|
1523
1651
|
);
|
|
1524
1652
|
},
|
|
1525
|
-
unload:function unloadBuiltInLLMProvider(context={}){
|
|
1653
|
+
unload:async function unloadBuiltInLLMProvider(context={}){
|
|
1526
1654
|
if(context.signal?.aborted){
|
|
1527
1655
|
throw normalizeAIRequestAbort(context.signal.reason);
|
|
1528
1656
|
}
|
|
1657
|
+
const watch=stopNativeOllamaWatch();
|
|
1658
|
+
const release=localOnly&&state==='ready';
|
|
1529
1659
|
state='unloaded';
|
|
1530
1660
|
busy=false;
|
|
1661
|
+
if(release&&watch){
|
|
1662
|
+
await watch.ollama.generate(
|
|
1663
|
+
{model:watch.modelId,prompt:'',keep_alive:0,stream:false},
|
|
1664
|
+
{signal:context.signal}
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1531
1667
|
return statusBuiltInLLMProvider();
|
|
1532
1668
|
},
|
|
1533
1669
|
dispose:function disposeBuiltInLLMProvider(context={}){
|
|
1534
1670
|
if(context.signal?.aborted){
|
|
1535
1671
|
throw normalizeAIRequestAbort(context.signal.reason);
|
|
1536
1672
|
}
|
|
1673
|
+
stopNativeOllamaWatch();
|
|
1537
1674
|
state='disposed';
|
|
1538
1675
|
busy=false;
|
|
1539
1676
|
return statusBuiltInLLMProvider();
|
|
@@ -2110,6 +2247,12 @@ class AI {
|
|
|
2110
2247
|
return Promise.resolve(this.#providerRuntime.status('llm'));
|
|
2111
2248
|
}
|
|
2112
2249
|
const status=this.#providerRuntime.status('llm');
|
|
2250
|
+
const provider=this.#builtInLLMProviders.get(selection.providerId)?.provider;
|
|
2251
|
+
if(selection.providerId==='OLLAMA'
|
|
2252
|
+
&&provider?.status().loaded!==true
|
|
2253
|
+
&&(status.loaded===true||status.busy===true)){
|
|
2254
|
+
return this.#providerRuntime.unload('llm');
|
|
2255
|
+
}
|
|
2113
2256
|
if(this.#builtInLLMCapability(selection.providerId)){
|
|
2114
2257
|
if(status.state==='ready'&&status.loaded===true){
|
|
2115
2258
|
return Promise.resolve(status);
|
|
@@ -40,7 +40,7 @@ export class Ollama{
|
|
|
40
40
|
version(){ return api().version() }
|
|
41
41
|
models(){ return api().models() }
|
|
42
42
|
list(){ return api().models() }
|
|
43
|
-
running(){ return api().running() }
|
|
43
|
+
running(options){ return api().running(options) }
|
|
44
44
|
show(model,options){ return api().show(model,options) }
|
|
45
45
|
generate(request,options){ return api().generate(request,options) }
|
|
46
46
|
chat(request,options){ return api().chat(request,options) }
|
|
@@ -22,3 +22,16 @@ export function normalizeOllamaModelIdentifier(value){
|
|
|
22
22
|
export function isOllamaModelIdentifier(value){
|
|
23
23
|
return normalizeOllamaModelIdentifier(value)!==null;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/** Compare Ollama names with its default host, namespace and tag; never rewrite a request. */
|
|
27
|
+
export function sameOllamaModelIdentifier(left,right){
|
|
28
|
+
if(!is.string(left)||!is.string(right))return false;
|
|
29
|
+
function identity(value){
|
|
30
|
+
const parts=value.replace(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//,'').split('/');
|
|
31
|
+
const model=parts.pop();
|
|
32
|
+
const namespace=parts.pop()??'library';
|
|
33
|
+
const host=parts.join('/')||'registry.ollama.ai';
|
|
34
|
+
return `${host}/${namespace}/${model.includes(':')?model:`${model}:latest`}`.toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
return identity(left)===identity(right);
|
|
37
|
+
}
|
|
@@ -303,6 +303,7 @@
|
|
|
303
303
|
"id": { "const": "whisper.cpp" },
|
|
304
304
|
"version": { "type": "string", "default": "1.9.4" },
|
|
305
305
|
"backend": { "enum": ["auto", "cuda", "metal", "cpu"], "default": "auto" },
|
|
306
|
+
"encoder": { "const": "openvino-npu", "description": "Explicit Intel NPU encoder. Omit for ordinary GPU/CPU encoding. The precompiled Windows x64 runtime supports CUDA-first CPU recovery and requires a compatible installed Intel NPU driver." },
|
|
306
307
|
"helperRoot": { "type": "string", "description": "Complete helper directory copied into the native runtime, including its app-local libraries. Defaults to the directory containing helperExecutable." },
|
|
307
308
|
"helperExecutable": { "type": "string" },
|
|
308
309
|
"helperUrl": { "type": "string" },
|
|
@@ -318,6 +319,7 @@
|
|
|
318
319
|
"required": ["backend"],
|
|
319
320
|
"properties": {
|
|
320
321
|
"backend": { "enum": ["cuda", "metal", "cpu"] },
|
|
322
|
+
"encoder": { "const": "openvino-npu" },
|
|
321
323
|
"root": { "type": "string" },
|
|
322
324
|
"url": { "type": "string" },
|
|
323
325
|
"libraryDirectory": { "type": "string" }
|
|
@@ -337,7 +339,12 @@
|
|
|
337
339
|
"id": { "type": "string" },
|
|
338
340
|
"path": { "type": "string" },
|
|
339
341
|
"url": { "type": "string" },
|
|
340
|
-
"filename": { "type": "string" }
|
|
342
|
+
"filename": { "type": "string" },
|
|
343
|
+
"archiveUrl": { "type": "string", "description": "Complete model archive containing the declared model members." },
|
|
344
|
+
"encoderFilename": { "type": "string", "description": "Matching OpenVINO encoder XML filename in archiveUrl." },
|
|
345
|
+
"encoderDataFilename": { "type": "string", "description": "Matching OpenVINO encoder BIN filename in archiveUrl." },
|
|
346
|
+
"encoderPath": { "type": "string", "description": "Matching local OpenVINO encoder XML file." },
|
|
347
|
+
"encoderDataPath": { "type": "string", "description": "Matching local OpenVINO encoder BIN file." }
|
|
341
348
|
}
|
|
342
349
|
}
|
|
343
350
|
]
|
|
@@ -197,6 +197,7 @@
|
|
|
197
197
|
"id": { "const": "whisper.cpp" },
|
|
198
198
|
"version": { "type": "string", "default": "1.9.4" },
|
|
199
199
|
"backend": { "enum": ["auto", "cuda", "metal", "cpu"], "default": "auto" },
|
|
200
|
+
"encoder": { "const": "openvino-npu", "description": "Explicit Intel NPU encoder. Omit for ordinary GPU/CPU encoding. The precompiled Windows x64 runtime supports CUDA-first CPU recovery and requires a compatible installed Intel NPU driver." },
|
|
200
201
|
"helperRoot": { "type": "string", "description": "Complete helper directory copied into the native runtime, including its app-local libraries. Defaults to the directory containing helperExecutable." },
|
|
201
202
|
"helperExecutable": { "type": "string" },
|
|
202
203
|
"helperUrl": { "type": "string" },
|
|
@@ -212,6 +213,7 @@
|
|
|
212
213
|
"required": ["backend"],
|
|
213
214
|
"properties": {
|
|
214
215
|
"backend": { "enum": ["cuda", "metal", "cpu"] },
|
|
216
|
+
"encoder": { "const": "openvino-npu" },
|
|
215
217
|
"root": { "type": "string" },
|
|
216
218
|
"url": { "type": "string" },
|
|
217
219
|
"libraryDirectory": { "type": "string" }
|
|
@@ -231,7 +233,12 @@
|
|
|
231
233
|
"id": { "type": "string" },
|
|
232
234
|
"path": { "type": "string" },
|
|
233
235
|
"url": { "type": "string" },
|
|
234
|
-
"filename": { "type": "string" }
|
|
236
|
+
"filename": { "type": "string" },
|
|
237
|
+
"archiveUrl": { "type": "string", "description": "Complete model archive containing the declared model members." },
|
|
238
|
+
"encoderFilename": { "type": "string", "description": "Matching OpenVINO encoder XML filename in archiveUrl." },
|
|
239
|
+
"encoderDataFilename": { "type": "string", "description": "Matching OpenVINO encoder BIN filename in archiveUrl." },
|
|
240
|
+
"encoderPath": { "type": "string", "description": "Matching local OpenVINO encoder XML file." },
|
|
241
|
+
"encoderDataPath": { "type": "string", "description": "Matching local OpenVINO encoder BIN file." }
|
|
235
242
|
}
|
|
236
243
|
}
|
|
237
244
|
]
|