marona 2.15.0 → 2.16.1
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 +8 -0
- package/README.md +70 -14
- package/dist/biosignal.d.ts +142 -0
- package/dist/biosignal.d.ts.map +1 -0
- package/dist/biosignal.js +210 -0
- package/dist/biosignal.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-authoring.d.ts +1 -1
- package/dist/mcp-authoring.js +1 -1
- package/dist/native/darwin-arm64/LICENSE.native +4 -0
- package/dist/native/darwin-arm64/THIRD_PARTY_NOTICES.txt +39062 -0
- package/dist/native/darwin-arm64/libmarona_biosignal.dylib +0 -0
- package/dist/native/darwin-arm64/manifest.json +16 -0
- package/dist/native/darwin-arm64/marona_biosignal.node +0 -0
- package/dist/native/darwin-arm64/sbom.cdx.json +1635 -0
- package/dist/native/linux-x86_64/LICENSE.native +4 -0
- package/dist/native/linux-x86_64/THIRD_PARTY_NOTICES.txt +39519 -0
- package/dist/native/linux-x86_64/libmarona_biosignal.so +0 -0
- package/dist/native/linux-x86_64/manifest.json +16 -0
- package/dist/native/linux-x86_64/marona_biosignal.node +0 -0
- package/dist/native/linux-x86_64/sbom.cdx.json +1646 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 2.16.1
|
|
2
|
+
|
|
3
|
+
Complete Workflow and BioSignal examples now appear inline in this package guide and in the language sections of the Marona Platform documentation. Removed obsolete unreleased notices and links to private repositories. Runtime APIs are unchanged.
|
|
4
|
+
|
|
5
|
+
## 2.16.0
|
|
6
|
+
|
|
7
|
+
Add the native BioSignal client for acquisition, processing, feature extraction and playback.
|
|
8
|
+
|
|
1
9
|
## 2.15.0
|
|
2
10
|
|
|
3
11
|
- Add native workflow execution, persisted task checkpoints and shared control-plane operations.
|
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@ Hub capabilities, streaming, realtime and A2A collaboration.
|
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
|
-
Version **2.
|
|
8
|
+
Version **2.16.1**. [Package registry](https://www.npmjs.com/package/marona/v/2.16.0).
|
|
9
9
|
|
|
10
10
|
Node.js 20+; run this server example with tsx.
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npm install marona@2.
|
|
13
|
+
npm install marona@2.16.1
|
|
14
14
|
npm install --save-dev typescript tsx @types/node
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -579,7 +579,74 @@ checks rather than browser names. API keys stay on the backend. Native and headl
|
|
|
579
579
|
consumers use the same HTTP media resources without browser dependencies. Printing
|
|
580
580
|
a resource URL alone does not play it.
|
|
581
581
|
|
|
582
|
-
|
|
582
|
+
|
|
583
|
+
## Marona Workflows
|
|
584
|
+
|
|
585
|
+
Set MARONA_WORKFLOW_URL=https://workflows.marona.ai and MARONA_WORKFLOW_KEY to your workflow workspace credential. Keep the credential on your backend. The control plane stores execution state; a native worker runs your application code. This complete example registers a deployment, submits a run, executes it with a native worker and retrieves its persisted result. runOnce/run_once handles one run; a long-lived worker calls it in a bounded polling loop.
|
|
586
|
+
|
|
587
|
+
Save as `workflow.mjs` in your application.
|
|
588
|
+
|
|
589
|
+
```typescript
|
|
590
|
+
import {WorkflowClient, WorkflowWorker} from 'marona/workflows';
|
|
591
|
+
|
|
592
|
+
const client = new WorkflowClient(process.env.MARONA_WORKFLOW_URL ?? 'https://workflows.marona.ai', process.env.MARONA_WORKFLOW_KEY);
|
|
593
|
+
const pool = `typescript-${crypto.randomUUID()}`;
|
|
594
|
+
await client.configure('pools', {name:pool, concurrency_limit:1});
|
|
595
|
+
const workflow = await client.register({name:pool, version:'1', language:'typescript', entrypoint:'orders:summary'});
|
|
596
|
+
const deployment = await client.deploy({name:'Order summary', workflow_id:workflow.id, pool});
|
|
597
|
+
const run = await client.run(deployment.id, {amounts:[125.50,90,34.50]});
|
|
598
|
+
const worker = new WorkflowWorker(client, pool);
|
|
599
|
+
worker.register('orders:summary','1',async (context, parameters) => {
|
|
600
|
+
return context.task('total','orders-v1',parameters,async signal => {
|
|
601
|
+
signal.throwIfAborted();
|
|
602
|
+
return {orders:parameters.amounts.length, revenue:parameters.amounts.reduce((a,b)=>a+b,0)};
|
|
603
|
+
});
|
|
604
|
+
});
|
|
605
|
+
const completed=await worker.runOnce();
|
|
606
|
+
if(completed.state!=='completed')throw new Error(JSON.stringify(completed));
|
|
607
|
+
const result=await client.result(run.id);
|
|
608
|
+
if(result.revenue!==250)throw new Error('Unexpected order total');
|
|
609
|
+
console.log(JSON.stringify({language:'typescript',state:completed.state,result}));
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
```bash
|
|
613
|
+
node workflow.mjs
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
## BioSignal
|
|
617
|
+
|
|
618
|
+
This example generates synthetic EEG locally; it does not connect to physical hardware. The package includes the native Rust core for Apple silicon macOS 11+ and x86-64 Linux with glibc 2.36+. Other targets require a compatible native library. Device support depends on an implemented adapter and hardware validation.
|
|
619
|
+
|
|
620
|
+
Save as `biosignal.mjs` in your application.
|
|
621
|
+
|
|
622
|
+
```typescript
|
|
623
|
+
import { BioSignalDevice, SignalProcessor, SignalFeatureExtractor } from 'marona';
|
|
624
|
+
|
|
625
|
+
const device = await new BioSignalDevice('synthetic', {
|
|
626
|
+
parameters: { noise: 0 },
|
|
627
|
+
}).connect();
|
|
628
|
+
|
|
629
|
+
try {
|
|
630
|
+
await device.startStream();
|
|
631
|
+
const data = await device.getData({ duration: 2 });
|
|
632
|
+
const filtered = await SignalProcessor.bandpass(data.select('EEG'), {
|
|
633
|
+
low: 1,
|
|
634
|
+
high: 45,
|
|
635
|
+
sampling_rate: device.samplingRate,
|
|
636
|
+
});
|
|
637
|
+
const features = await SignalFeatureExtractor.bandPowers(filtered, {
|
|
638
|
+
sampling_rate: device.samplingRate,
|
|
639
|
+
});
|
|
640
|
+
console.log({ synthetic: data.synthetic, features });
|
|
641
|
+
} finally {
|
|
642
|
+
await device.disconnect();
|
|
643
|
+
}
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
```bash
|
|
647
|
+
node biosignal.mjs
|
|
648
|
+
```
|
|
649
|
+
|
|
583
650
|
|
|
584
651
|
## Execution and errors
|
|
585
652
|
|
|
@@ -646,14 +713,3 @@ D2A device content and agent responses use `payload.kind: "data"` with the share
|
|
|
646
713
|
D2A adds independent device communication, persistent provider events, schema checked actions, approval and outcome reconciliation. Multiple compatible Agent protocols now coordinate automatically through generic canonical delivery and feedback hooks. Existing B2A and core Agent APIs remain supported.
|
|
647
714
|
|
|
648
715
|
B2A 1.0 uses the same multimodal message envelope in both directions. The source identifies the sender. SDK-managed streaming, resource resolution and encoder return messages are built in. Existing v0.1 runtime sessions remain supported; new SDK connections require a runtime advertising B2A 1.0.
|
|
649
|
-
|
|
650
|
-
## Workflow orchestration
|
|
651
|
-
|
|
652
|
-
See [Marona Workflows](../../docs/workflows.md) for the independent control-plane client and language-specific execution support. Workflow source additions are unreleased until a package version is published.
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
## Marona Workflows
|
|
656
|
-
|
|
657
|
-
Define and execute domain independent BCI, ML and data workflows through the existing Marona package. The Rust control plane handles schedules, leases, state, queues, encrypted configuration and automations. Native workers execute your application code.
|
|
658
|
-
|
|
659
|
-
See [workflow documentation](https://github.com/BlessingNyuwani/edge-node-service/blob/main/docs/workflows.md) and [BCI, ML and data examples](https://github.com/BlessingNyuwani/marona-workflow-examples).
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/** Local biosignals through the Marona native core. Imports remain browser safe. */
|
|
2
|
+
export declare class BioSignalError extends Error {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
constructor(code: string, message: string);
|
|
5
|
+
}
|
|
6
|
+
type Json = Record<string, any>;
|
|
7
|
+
export type BioSignalType = 'EEG' | 'EMG' | 'ECG' | 'ECoG' | 'EOG' | 'PPG' | 'EDA' | 'GSR' | 'fNIRS' | 'LFP' | 'NeuralSpikes' | 'Respiration' | 'Temperature' | 'BloodPressure' | 'SpO2' | 'HeartRate' | 'IMU' | 'Accelerometer' | 'Gyroscope' | 'Magnetometer' | (string & {});
|
|
8
|
+
export interface BioSignalChannel {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
signal_type: BioSignalType;
|
|
12
|
+
unit: string;
|
|
13
|
+
electrode?: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface BioSignalDeviceConfig {
|
|
16
|
+
parameters?: Json;
|
|
17
|
+
bufferSize?: number;
|
|
18
|
+
preset?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class BioSignalData {
|
|
21
|
+
readonly record: Json;
|
|
22
|
+
constructor(record: Json);
|
|
23
|
+
get channels(): BioSignalChannel[];
|
|
24
|
+
get values(): number[][];
|
|
25
|
+
get timestampsNs(): bigint[];
|
|
26
|
+
get samplingRate(): number;
|
|
27
|
+
get synthetic(): boolean;
|
|
28
|
+
select(type: BioSignalType): number[][];
|
|
29
|
+
}
|
|
30
|
+
export declare class BioSignalDevice {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly config: BioSignalDeviceConfig;
|
|
33
|
+
private handle?;
|
|
34
|
+
private descriptor?;
|
|
35
|
+
constructor(id?: string, config?: BioSignalDeviceConfig);
|
|
36
|
+
static availableDevices(): Promise<any>;
|
|
37
|
+
static deviceCatalog(): Promise<any>;
|
|
38
|
+
connect(): Promise<this>;
|
|
39
|
+
private requireHandle;
|
|
40
|
+
get samplingRate(): number;
|
|
41
|
+
startStream(): Promise<void>;
|
|
42
|
+
stopStream(): Promise<void>;
|
|
43
|
+
getData(options?: {
|
|
44
|
+
samples?: number;
|
|
45
|
+
duration?: number;
|
|
46
|
+
timeout?: number;
|
|
47
|
+
consume?: boolean;
|
|
48
|
+
}): Promise<BioSignalData>;
|
|
49
|
+
insertMarker(value: number, label?: string): Promise<void>;
|
|
50
|
+
diagnostics(): Promise<any>;
|
|
51
|
+
stream(window?: number): AsyncGenerator<BioSignalData>;
|
|
52
|
+
disconnect(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
export declare class SignalProcessor {
|
|
55
|
+
static transform(method: string, data: number[] | number[][] | BioSignalData, options?: Json): Promise<any>;
|
|
56
|
+
static bandpass(data: number[] | number[][], options: {
|
|
57
|
+
low: number;
|
|
58
|
+
high: number;
|
|
59
|
+
sampling_rate: number;
|
|
60
|
+
order?: number;
|
|
61
|
+
}): Promise<any>;
|
|
62
|
+
static fft(data: number[], window?: string): Promise<any>;
|
|
63
|
+
static ifft(spectrum: Json): Promise<any>;
|
|
64
|
+
static welch(data: number[], options: {
|
|
65
|
+
sampling_rate: number;
|
|
66
|
+
nfft: number;
|
|
67
|
+
overlap: number;
|
|
68
|
+
}): Promise<any>;
|
|
69
|
+
}
|
|
70
|
+
export declare class SignalFeatureExtractor {
|
|
71
|
+
static statistics(data: number[] | number[][]): Promise<any>;
|
|
72
|
+
static bandPowers(data: number[] | number[][], options: Json): Promise<any>;
|
|
73
|
+
}
|
|
74
|
+
export declare class SignalAnalyzer {
|
|
75
|
+
static peaks(data: number[], options?: Json): Promise<any>;
|
|
76
|
+
static heartRate(data: number[], options: {
|
|
77
|
+
sampling_rate: number;
|
|
78
|
+
threshold: number;
|
|
79
|
+
}): Promise<any>;
|
|
80
|
+
static pca(data: number[][], components: number): Promise<any>;
|
|
81
|
+
}
|
|
82
|
+
export declare class SignalModel {
|
|
83
|
+
readonly model: {
|
|
84
|
+
weights: number[][];
|
|
85
|
+
bias: number[];
|
|
86
|
+
version: string;
|
|
87
|
+
softmax?: boolean;
|
|
88
|
+
};
|
|
89
|
+
private handle?;
|
|
90
|
+
private closed;
|
|
91
|
+
constructor(model: {
|
|
92
|
+
weights: number[][];
|
|
93
|
+
bias: number[];
|
|
94
|
+
version: string;
|
|
95
|
+
softmax?: boolean;
|
|
96
|
+
});
|
|
97
|
+
static fromOnnx(path: string, shape: number[], sha256: string): Promise<SignalModel>;
|
|
98
|
+
predict(data: number[]): Promise<any>;
|
|
99
|
+
close(): Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
export declare class BioSignalRecorder {
|
|
102
|
+
readonly path: string;
|
|
103
|
+
private handle?;
|
|
104
|
+
constructor(path: string);
|
|
105
|
+
open(): Promise<this>;
|
|
106
|
+
write(data: BioSignalData): Promise<void>;
|
|
107
|
+
close(): Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
export declare class BioSignalPlayback {
|
|
110
|
+
readonly path: string;
|
|
111
|
+
constructor(path: string);
|
|
112
|
+
read(): Promise<BioSignalData[]>;
|
|
113
|
+
}
|
|
114
|
+
export declare class BioSignalSimulator extends BioSignalDevice {
|
|
115
|
+
constructor(parameters?: Json);
|
|
116
|
+
}
|
|
117
|
+
export declare class BioSignalStream {
|
|
118
|
+
readonly device: BioSignalDevice;
|
|
119
|
+
readonly window: number;
|
|
120
|
+
constructor(device: BioSignalDevice, window?: number);
|
|
121
|
+
[Symbol.asyncIterator](): AsyncGenerator<BioSignalData, any, any>;
|
|
122
|
+
}
|
|
123
|
+
/** Retains separate native filter state for every channel across chunks. */
|
|
124
|
+
export declare class SignalFilter {
|
|
125
|
+
private handle?;
|
|
126
|
+
private constructor();
|
|
127
|
+
static create(options: {
|
|
128
|
+
channels: number;
|
|
129
|
+
sampling_rate: number;
|
|
130
|
+
kind?: string;
|
|
131
|
+
low?: number;
|
|
132
|
+
high?: number;
|
|
133
|
+
order?: number;
|
|
134
|
+
q?: number;
|
|
135
|
+
}): Promise<SignalFilter>;
|
|
136
|
+
private requireHandle;
|
|
137
|
+
process(data: number[][]): Promise<number[][]>;
|
|
138
|
+
reset(): Promise<void>;
|
|
139
|
+
close(): Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
export {};
|
|
142
|
+
//# sourceMappingURL=biosignal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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1,210 @@
|
|
|
1
|
+
/** Local biosignals through the Marona native core. Imports remain browser safe. */
|
|
2
|
+
export class BioSignalError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
constructor(code, message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.name = 'BioSignalError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
let loaded;
|
|
11
|
+
async function loadNative() {
|
|
12
|
+
if (!loaded)
|
|
13
|
+
loaded = (async () => {
|
|
14
|
+
if (typeof process === 'undefined' || !process.versions?.node)
|
|
15
|
+
throw new BioSignalError('UNSUPPORTED_PLATFORM', 'Native BioSignal requires Node.js; browsers require an explicitly configured acquisition gateway');
|
|
16
|
+
const [{ readFile }, { createHash }, path, { fileURLToPath }, { createRequire }] = await Promise.all([
|
|
17
|
+
import('node:fs/promises'), import('node:crypto'), import('node:path'), import('node:url'), import('node:module'),
|
|
18
|
+
]);
|
|
19
|
+
const systems = { darwin: 'darwin', linux: 'linux', win32: 'windows' };
|
|
20
|
+
const arch = process.arch === 'arm64' ? 'arm64' : process.arch === 'x64' ? 'x86_64' : process.arch;
|
|
21
|
+
const root = path.resolve(process.env.MARONA_BIOSIGNAL_NATIVE_DIR ?? path.join(path.dirname(fileURLToPath(import.meta.url)), 'native', `${systems[process.platform]}-${arch}`));
|
|
22
|
+
let manifest;
|
|
23
|
+
try {
|
|
24
|
+
manifest = JSON.parse(await readFile(path.join(root, 'manifest.json'), 'utf8'));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
throw new BioSignalError('NATIVE_UNAVAILABLE', 'This package does not contain a BioSignal binary for this platform');
|
|
28
|
+
}
|
|
29
|
+
if (manifest.abi !== 1)
|
|
30
|
+
throw new BioSignalError('ABI_MISMATCH', 'Unsupported BioSignal ABI');
|
|
31
|
+
const paths = {};
|
|
32
|
+
for (const kind of ['core', 'node']) {
|
|
33
|
+
const entry = manifest.files[kind];
|
|
34
|
+
const file = path.resolve(root, entry.name);
|
|
35
|
+
if (path.dirname(file) !== root)
|
|
36
|
+
throw new BioSignalError('INVALID_ARTIFACT', 'Invalid native artifact path');
|
|
37
|
+
if (createHash('sha256').update(await readFile(file)).digest('hex') !== entry.sha256)
|
|
38
|
+
throw new BioSignalError('INTEGRITY_FAILURE', 'Native binary checksum mismatch');
|
|
39
|
+
paths[kind] = file;
|
|
40
|
+
}
|
|
41
|
+
return { core: paths.core, bridge: createRequire(import.meta.url)(paths.node) };
|
|
42
|
+
})().catch(error => { loaded = undefined; throw error; });
|
|
43
|
+
return loaded;
|
|
44
|
+
}
|
|
45
|
+
async function call(operation, values = {}) {
|
|
46
|
+
const { core, bridge } = await loadNative();
|
|
47
|
+
const response = JSON.parse(await bridge.nativeRequest(core, JSON.stringify({ operation, ...values })));
|
|
48
|
+
if (!response.ok)
|
|
49
|
+
throw new BioSignalError(response.error.code, response.error.message);
|
|
50
|
+
return response.result;
|
|
51
|
+
}
|
|
52
|
+
export class BioSignalData {
|
|
53
|
+
record;
|
|
54
|
+
constructor(record) {
|
|
55
|
+
this.record = record;
|
|
56
|
+
}
|
|
57
|
+
get channels() { return this.record.channels; }
|
|
58
|
+
get values() { return this.record.values; }
|
|
59
|
+
get timestampsNs() { return this.record.timestamps_ns.map((v) => BigInt(v)); }
|
|
60
|
+
get samplingRate() { return this.record.sampling_rate; }
|
|
61
|
+
get synthetic() { return this.record.synthetic; }
|
|
62
|
+
select(type) {
|
|
63
|
+
const rows = this.channels.flatMap((c, i) => c.signal_type.toLowerCase() === type.toLowerCase() ? [this.values[i].slice()] : []);
|
|
64
|
+
if (!rows.length)
|
|
65
|
+
throw new BioSignalError('UNSUPPORTED', `No ${type} channels`);
|
|
66
|
+
return rows;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export class BioSignalDevice {
|
|
70
|
+
id;
|
|
71
|
+
config;
|
|
72
|
+
handle;
|
|
73
|
+
descriptor;
|
|
74
|
+
constructor(id = 'synthetic', config = {}) {
|
|
75
|
+
this.id = id;
|
|
76
|
+
this.config = config;
|
|
77
|
+
}
|
|
78
|
+
static availableDevices() { return call('devices'); }
|
|
79
|
+
static deviceCatalog() { return call('device.catalog'); }
|
|
80
|
+
async connect() {
|
|
81
|
+
if (this.handle !== undefined)
|
|
82
|
+
throw new BioSignalError('INVALID_STATE', 'Already connected');
|
|
83
|
+
const result = await call('device.open', { device: this.id, config: this.config.parameters ?? {}, capacity: this.config.bufferSize ?? 100000, preset: this.config.preset ?? 0 });
|
|
84
|
+
this.handle = result.handle;
|
|
85
|
+
this.descriptor = result.device;
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
requireHandle() { if (this.handle === undefined)
|
|
89
|
+
throw new BioSignalError('INVALID_STATE', 'Connect first'); return this.handle; }
|
|
90
|
+
get samplingRate() { this.requireHandle(); return this.descriptor.sampling_rate; }
|
|
91
|
+
async startStream() { await call('device.start', { handle: this.requireHandle() }); }
|
|
92
|
+
async stopStream() { if (this.handle !== undefined)
|
|
93
|
+
await call('device.stop', { handle: this.handle }); }
|
|
94
|
+
async getData(options = {}) {
|
|
95
|
+
if (options.samples !== undefined && options.duration !== undefined)
|
|
96
|
+
throw new Error('Pass samples or duration');
|
|
97
|
+
if (options.duration !== undefined && (!Number.isFinite(options.duration) || options.duration <= 0))
|
|
98
|
+
throw new Error('Duration must be positive and finite');
|
|
99
|
+
const samples = options.duration === undefined ? options.samples : Math.ceil(options.duration * this.samplingRate);
|
|
100
|
+
return new BioSignalData(await call('device.read', { handle: this.requireHandle(), maximum: samples ?? this.config.bufferSize ?? 100000, minimum: samples ?? 0, timeout: Math.max(options.timeout ?? 10, (options.duration ?? 0) + 2), consume: options.consume ?? true }));
|
|
101
|
+
}
|
|
102
|
+
async insertMarker(value, label) { await call('device.marker', { handle: this.requireHandle(), value, label }); }
|
|
103
|
+
diagnostics() { return call('device.diagnostics', { handle: this.requireHandle() }); }
|
|
104
|
+
async *stream(window = 1) { while (this.handle !== undefined)
|
|
105
|
+
yield await this.getData({ duration: window }); }
|
|
106
|
+
async disconnect() { if (this.handle !== undefined) {
|
|
107
|
+
const handle = this.handle;
|
|
108
|
+
this.handle = undefined;
|
|
109
|
+
await call('device.close', { handle });
|
|
110
|
+
} }
|
|
111
|
+
}
|
|
112
|
+
export class SignalProcessor {
|
|
113
|
+
static async transform(method, data, options = {}) {
|
|
114
|
+
if (data instanceof BioSignalData)
|
|
115
|
+
return new BioSignalData(await call('data.process', { ...options, method, data: data.record }));
|
|
116
|
+
if (Array.isArray(data[0]))
|
|
117
|
+
return Promise.all(data.map(row => this.transform(method, row, options)));
|
|
118
|
+
return call(options.backend === 'reference' ? 'reference.process' : 'process', { ...options, method, data });
|
|
119
|
+
}
|
|
120
|
+
static bandpass(data, options) { return this.transform('bandpass', data, options); }
|
|
121
|
+
static fft(data, window = 'none') { return this.transform('fft', data, { window }); }
|
|
122
|
+
static ifft(spectrum) { return call('ifft', { spectrum }); }
|
|
123
|
+
static welch(data, options) { return this.transform('welch', data, options); }
|
|
124
|
+
}
|
|
125
|
+
export class SignalFeatureExtractor {
|
|
126
|
+
static statistics(data) { return SignalProcessor.transform('statistics', data); }
|
|
127
|
+
static bandPowers(data, options) { return SignalProcessor.transform('band_powers', data, options); }
|
|
128
|
+
}
|
|
129
|
+
export class SignalAnalyzer {
|
|
130
|
+
static peaks(data, options = {}) { return SignalProcessor.transform('peaks', data, options); }
|
|
131
|
+
static heartRate(data, options) { return SignalProcessor.transform('heart_rate', data, options); }
|
|
132
|
+
static pca(data, components) { return call('pca', { data, components }); }
|
|
133
|
+
}
|
|
134
|
+
export class SignalModel {
|
|
135
|
+
model;
|
|
136
|
+
handle;
|
|
137
|
+
closed = false;
|
|
138
|
+
constructor(model) {
|
|
139
|
+
this.model = model;
|
|
140
|
+
}
|
|
141
|
+
static async fromOnnx(path, shape, sha256) {
|
|
142
|
+
const loaded = await call('model.open', { path, shape, sha256 });
|
|
143
|
+
const model = new SignalModel({ weights: [], bias: [], version: sha256 });
|
|
144
|
+
model.handle = loaded.handle;
|
|
145
|
+
return model;
|
|
146
|
+
}
|
|
147
|
+
predict(data) {
|
|
148
|
+
if (this.closed)
|
|
149
|
+
throw new BioSignalError('INVALID_STATE', 'Model is closed');
|
|
150
|
+
return this.handle === undefined ? call('model.predict', { model: this.model, data }) : call('model.run', { handle: this.handle, data });
|
|
151
|
+
}
|
|
152
|
+
async close() { if (this.handle !== undefined) {
|
|
153
|
+
await call('model.close', { handle: this.handle });
|
|
154
|
+
this.handle = undefined;
|
|
155
|
+
} this.closed = true; }
|
|
156
|
+
}
|
|
157
|
+
export class BioSignalRecorder {
|
|
158
|
+
path;
|
|
159
|
+
handle;
|
|
160
|
+
constructor(path) {
|
|
161
|
+
this.path = path;
|
|
162
|
+
}
|
|
163
|
+
async open() { if (this.handle !== undefined)
|
|
164
|
+
throw new Error('Recorder already open'); this.handle = (await call('recording.open', { path: this.path })).handle; return this; }
|
|
165
|
+
async write(data) { if (this.handle === undefined)
|
|
166
|
+
throw new Error('Open recorder first'); await call('recording.write', { handle: this.handle, data: data.record }); }
|
|
167
|
+
async close() { if (this.handle !== undefined) {
|
|
168
|
+
await call('recording.close', { handle: this.handle });
|
|
169
|
+
this.handle = undefined;
|
|
170
|
+
} }
|
|
171
|
+
}
|
|
172
|
+
export class BioSignalPlayback {
|
|
173
|
+
path;
|
|
174
|
+
constructor(path) {
|
|
175
|
+
this.path = path;
|
|
176
|
+
}
|
|
177
|
+
async read() { return (await call('recording.read', { path: this.path })).map((v) => new BioSignalData(v)); }
|
|
178
|
+
}
|
|
179
|
+
export class BioSignalSimulator extends BioSignalDevice {
|
|
180
|
+
constructor(parameters = {}) { super('synthetic', { parameters }); }
|
|
181
|
+
}
|
|
182
|
+
export class BioSignalStream {
|
|
183
|
+
device;
|
|
184
|
+
window;
|
|
185
|
+
constructor(device, window = 1) {
|
|
186
|
+
this.device = device;
|
|
187
|
+
this.window = window;
|
|
188
|
+
}
|
|
189
|
+
[Symbol.asyncIterator]() { return this.device.stream(this.window); }
|
|
190
|
+
}
|
|
191
|
+
/** Retains separate native filter state for every channel across chunks. */
|
|
192
|
+
export class SignalFilter {
|
|
193
|
+
handle;
|
|
194
|
+
constructor(handle) {
|
|
195
|
+
this.handle = handle;
|
|
196
|
+
}
|
|
197
|
+
static async create(options) {
|
|
198
|
+
return new SignalFilter((await call('filter.open', options)).handle);
|
|
199
|
+
}
|
|
200
|
+
requireHandle() { if (this.handle === undefined)
|
|
201
|
+
throw new BioSignalError('INVALID_STATE', 'Filter is closed'); return this.handle; }
|
|
202
|
+
process(data) { return call('filter.process', { handle: this.requireHandle(), data }); }
|
|
203
|
+
async reset() { await call('filter.reset', { handle: this.requireHandle() }); }
|
|
204
|
+
async close() { if (this.handle !== undefined) {
|
|
205
|
+
const handle = this.handle;
|
|
206
|
+
this.handle = undefined;
|
|
207
|
+
await call('filter.close', { handle });
|
|
208
|
+
} }
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=biosignal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biosignal.js","sourceRoot":"","sources":["../src/biosignal.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,OAAO,cAAe,SAAQ,KAAK;IACX;IAA5B,YAA4B,IAAY,EAAE,OAAe;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAAhD,SAAI,GAAJ,IAAI,CAAQ;QAAqC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAAC,CAAC;CAC7G;AAGD,IAAI,MAAmE,CAAC;AACxE,KAAK,UAAU,UAAU;IACvB,IAAI,CAAC,MAAM;QAAE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YAChC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI;gBAAE,MAAM,IAAI,cAAc,CAAC,sBAAsB,EAAE,kGAAkG,CAAC,CAAC;YACpN,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,UA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;QAAE,MAAM,IAAI,cAAc,CAAC,eAAe,EAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACzI,OAAO,CAAC,IAAgB,IAAyB,OAAO,IAAI,CAAC,gBAAgB,EAAC,EAAC,MAAM,EAAC,IAAI,CAAC,aAAa,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,CAAC;IACpH,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,CAAC,cAAc,EAAC,EAAC,MAAM,EAAC,IAAI,CAAC,aAAa,EAAE,EAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,KAAK,CAAC,KAAK,KAAK,IAAG,IAAI,CAAC,MAAM,KAAG,SAAS,EAAC,CAAC;QAAA,MAAM,MAAM,GAAC,IAAI,CAAC,MAAM,CAAC;QAAA,IAAI,CAAC,MAAM,GAAC,SAAS,CAAC;QAAA,MAAM,IAAI,CAAC,cAAc,EAAC,EAAC,MAAM,EAAC,CAAC,CAAC;IAAA,CAAC,CAAC,CAAC;CACnI"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { type A2ATaskStorage, type A2AEvent } from "./a2a.js";
|
|
|
17
17
|
export { A2ATaskStore, AgentCardResolver, A2AError, A2ADiscoveryError, A2AProtocolError, A2ASecurityError, A2ATaskError } from "./a2a.js";
|
|
18
18
|
export type { A2ATaskStorage, A2AEvent, A2ARequestContext } from "./a2a.js";
|
|
19
19
|
export { A2AServer, type A2AServerOptions } from "./a2a-server.js";
|
|
20
|
-
export declare const packageVersion = "2.
|
|
20
|
+
export declare const packageVersion = "2.16.1";
|
|
21
21
|
export type JsonMap = Record<string, unknown>;
|
|
22
22
|
declare const standardInterfaces: readonly ["api", "web", "mobile_app", "desktop", "whatsapp"];
|
|
23
23
|
type StandardInterfaceName = (typeof standardInterfaces)[number];
|
|
@@ -1036,4 +1036,6 @@ export type { MCPServerInput, AgentAppInput, ToolSpecInput, McpServeOptions, Mcp
|
|
|
1036
1036
|
export { DeveloperPlatformClient } from "./platform-client.js";
|
|
1037
1037
|
export { WorkflowClient, WorkflowContext, WorkflowWorker } from './workflows.js';
|
|
1038
1038
|
export type { WorkflowRun, WorkflowHandler } from './workflows.js';
|
|
1039
|
+
export { BioSignalDevice, BioSignalData, BioSignalRecorder, BioSignalPlayback, BioSignalSimulator, BioSignalStream, SignalProcessor, SignalFilter, SignalFeatureExtractor, SignalAnalyzer, SignalModel, BioSignalError } from './biosignal.js';
|
|
1040
|
+
export type { BioSignalType, BioSignalDeviceConfig, BioSignalChannel } from './biosignal.js';
|
|
1039
1041
|
//# sourceMappingURL=index.d.ts.map
|