@ohm_studio/sdk 0.1.0 → 0.2.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/README.md CHANGED
@@ -1,8 +1,10 @@
1
- # @ohm_studio/sdk
1
+ # OHM SDK · `@ohm_studio/sdk`
2
+
3
+ > The **short name** is `OHM SDK`. The **full npm name** is `@ohm_studio/sdk` — that's what you install. Both names refer to the same package.
2
4
 
3
5
  OHM Studio SDK for **JavaScript / TypeScript / React** — turn voice into structured clinical JSON, FHIR-ready, multi-language. Works in the browser, Node 18+, and Next.js (server actions, route handlers, edge runtime).
4
6
 
5
- > For React Native, install [`@ohm_studio/sdk-react-native`](https://www.npmjs.com/package/@ohm_studio/sdk-react-native) instead.
7
+ > For React Native, install [`@ohm_studio/sdk-react-native`](https://www.npmjs.com/package/@ohm_studio/sdk-react-native) (**OHM RN SDK**) instead.
6
8
 
7
9
  ## Install
8
10
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { OHMCoreClient } from "@ohm_studio/sdk-core";
2
2
  import type { OHMClientOptions } from "@ohm_studio/sdk-core";
3
3
  export * from "@ohm_studio/sdk-core";
4
+ export { Recorder, isRecordingSupported } from "./recorder";
5
+ export type { RecorderOptions, RecorderState } from "./recorder";
4
6
  /**
5
7
  * OHM Studio SDK for JavaScript / TypeScript.
6
8
  *
@@ -26,6 +28,16 @@ export declare class OHM extends OHMCoreClient {
26
28
  file: any;
27
29
  fields?: Record<string, string>;
28
30
  }): Promise<T>;
31
+ /**
32
+ * Build a browser/Node FormData from one of:
33
+ * - browser File
34
+ * - browser Blob
35
+ * - Node-style `{ buffer, name?, type? }`
36
+ *
37
+ * Used by both `runMultipart` (one-shot) and the streaming path
38
+ * (`audio.extract.stream`).
39
+ */
40
+ protected buildMultipartBody(file: unknown, fields?: Record<string, string>): Promise<FormData>;
29
41
  }
30
42
  export default OHM;
31
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,cAAc,sBAAsB,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,GAAI,SAAQ,aAAa;gBACxB,IAAI,EAAE,gBAAgB;cAIlB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC,GAAG,OAAO,CAAC,CAAC,CAAC;CAuBf;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,GAAI,SAAQ,aAAa;gBACxB,IAAI,EAAE,gBAAgB;cAIlB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACjC,GAAG,OAAO,CAAC,CAAC,CAAC;IAKd;;;;;;;;OAQG;cACa,kBAAkB,CAChC,IAAI,EAAE,OAAO,EACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,QAAQ,CAAC;CAuBrB;AAED,eAAe,GAAG,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { OHMCoreClient } from "@ohm_studio/sdk-core";
2
2
  export * from "@ohm_studio/sdk-core";
3
+ export { Recorder, isRecordingSupported } from "./recorder";
3
4
  /**
4
5
  * OHM Studio SDK for JavaScript / TypeScript.
5
6
  *
@@ -23,28 +24,41 @@ export class OHM extends OHMCoreClient {
23
24
  super(opts);
24
25
  }
25
26
  async runMultipart(opts) {
27
+ const fd = await this.buildMultipartBody(opts.file, opts.fields);
28
+ return this.requestRaw("POST", opts.path, { body: fd });
29
+ }
30
+ /**
31
+ * Build a browser/Node FormData from one of:
32
+ * - browser File
33
+ * - browser Blob
34
+ * - Node-style `{ buffer, name?, type? }`
35
+ *
36
+ * Used by both `runMultipart` (one-shot) and the streaming path
37
+ * (`audio.extract.stream`).
38
+ */
39
+ async buildMultipartBody(file, fields) {
26
40
  const fd = new FormData();
27
- // Browser File / Blob, or a Node Buffer (which the user must wrap as Blob).
28
- if (typeof File !== "undefined" && opts.file instanceof File) {
29
- fd.append("file", opts.file);
41
+ if (typeof File !== "undefined" && file instanceof File) {
42
+ fd.append("file", file);
30
43
  }
31
- else if (typeof Blob !== "undefined" && opts.file instanceof Blob) {
32
- fd.append("file", opts.file, "audio.bin");
44
+ else if (typeof Blob !== "undefined" && file instanceof Blob) {
45
+ fd.append("file", file, "audio.bin");
33
46
  }
34
- else if (opts.file && typeof opts.file === "object" && "buffer" in opts.file) {
47
+ else if (file && typeof file === "object" && "buffer" in file) {
35
48
  // Node-style { buffer, name?, type? }
36
- const blob = new Blob([opts.file.buffer], {
37
- type: opts.file.type || "application/octet-stream",
49
+ const f = file;
50
+ const blob = new Blob([f.buffer], {
51
+ type: f.type || "application/octet-stream",
38
52
  });
39
- fd.append("file", blob, opts.file.name || "audio.bin");
53
+ fd.append("file", blob, f.name || "audio.bin");
40
54
  }
41
55
  else {
42
56
  throw new Error("Unsupported file input — pass a File, Blob, or { buffer, name?, type? }");
43
57
  }
44
- for (const [k, v] of Object.entries(opts.fields || {})) {
58
+ for (const [k, v] of Object.entries(fields || {})) {
45
59
  fd.append(k, v);
46
60
  }
47
- return this.requestRaw("POST", opts.path, { body: fd });
61
+ return fd;
48
62
  }
49
63
  }
50
64
  export default OHM;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,cAAc,sBAAsB,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,GAAI,SAAQ,aAAa;IACpC,YAAY,IAAsB;QAChC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAES,KAAK,CAAC,YAAY,CAAI,IAI/B;QACC,MAAM,EAAE,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC1B,4EAA4E;QAC5E,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;YAC7D,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;aAAM,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;YACpE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC5C,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC/E,sCAAsC;YACtC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAA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plate of permissions,
3
+ * stream tracks, chunk collection, and cleanup so customers can ship a
4
+ * working recorder UI in three lines:
5
+ *
6
+ * const rec = new Recorder();
7
+ * await rec.start();
8
+ * const blob = await rec.stop(); // → ready to pass to ohm.audio.extract
9
+ *
10
+ * Designed for Vite / Next.js / CRA / any modern browser. SSR-safe — the
11
+ * `MediaRecorder` API is only touched inside method bodies, so importing
12
+ * this module doesn't break server bundles.
13
+ */
14
+ export interface RecorderOptions {
15
+ /**
16
+ * MIME type to request from the browser. Default `audio/webm;codecs=opus`
17
+ * which is universally supported and small. Pass another value if your
18
+ * extraction pipeline needs a specific format.
19
+ */
20
+ mimeType?: string;
21
+ /** Audio constraints passed to `getUserMedia`. */
22
+ audioConstraints?: MediaTrackConstraints;
23
+ /** Called whenever recording state changes (idle / recording / stopping). */
24
+ onStateChange?: (state: RecorderState) => void;
25
+ }
26
+ export type RecorderState = "idle" | "recording" | "stopping";
27
+ /** Returns true if the runtime supports recording (browser with MediaRecorder). */
28
+ export declare function isRecordingSupported(): boolean;
29
+ export declare class Recorder {
30
+ private rec;
31
+ private chunks;
32
+ private stream;
33
+ private state;
34
+ private opts;
35
+ constructor(opts?: RecorderOptions);
36
+ /** Current recorder state. */
37
+ get currentState(): RecorderState;
38
+ /**
39
+ * Request microphone access and begin recording. Resolves once the
40
+ * underlying MediaRecorder fires its `start` event. Throws on permission
41
+ * denial or unsupported runtime.
42
+ */
43
+ start(): Promise<void>;
44
+ /**
45
+ * Stop recording and resolve with the assembled Blob. The caller can
46
+ * pass this Blob directly to `ohm.audio.extract({ file: blob, ... })`.
47
+ * Stops all media tracks so the browser's mic indicator clears.
48
+ */
49
+ stop(): Promise<Blob>;
50
+ /** Abort the recording without surfacing the captured audio. */
51
+ cancel(): void;
52
+ private cleanup;
53
+ private setState;
54
+ }
55
+ //# sourceMappingURL=recorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../src/recorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;AAE9D,mFAAmF;AACnF,wBAAgB,oBAAoB,IAAI,OAAO,CAK9C;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,GAAG,CAA8B;IACzC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,IAAI,CAAkB;gBAElB,IAAI,GAAE,eAAoB;IAItC,8BAA8B;IAC9B,IAAI,YAAY,IAAI,aAAa,CAEhC;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA6B5B;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB3B,gEAAgE;IAChE,MAAM,IAAI,IAAI;IAWd,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,QAAQ;CAKjB"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Browser MediaRecorder wrapper. Hides the boilerplate of permissions,
3
+ * stream tracks, chunk collection, and cleanup so customers can ship a
4
+ * working recorder UI in three lines:
5
+ *
6
+ * const rec = new Recorder();
7
+ * await rec.start();
8
+ * const blob = await rec.stop(); // → ready to pass to ohm.audio.extract
9
+ *
10
+ * Designed for Vite / Next.js / CRA / any modern browser. SSR-safe — the
11
+ * `MediaRecorder` API is only touched inside method bodies, so importing
12
+ * this module doesn't break server bundles.
13
+ */
14
+ /** Returns true if the runtime supports recording (browser with MediaRecorder). */
15
+ export function isRecordingSupported() {
16
+ if (typeof window === "undefined")
17
+ return false;
18
+ if (typeof navigator === "undefined" || !navigator.mediaDevices)
19
+ return false;
20
+ if (typeof globalThis.MediaRecorder === "undefined")
21
+ return false;
22
+ return true;
23
+ }
24
+ export class Recorder {
25
+ rec = null;
26
+ chunks = [];
27
+ stream = null;
28
+ state = "idle";
29
+ opts;
30
+ constructor(opts = {}) {
31
+ this.opts = opts;
32
+ }
33
+ /** Current recorder state. */
34
+ get currentState() {
35
+ return this.state;
36
+ }
37
+ /**
38
+ * Request microphone access and begin recording. Resolves once the
39
+ * underlying MediaRecorder fires its `start` event. Throws on permission
40
+ * denial or unsupported runtime.
41
+ */
42
+ async start() {
43
+ if (!isRecordingSupported()) {
44
+ throw new Error("Recording not supported — MediaRecorder is unavailable in this runtime");
45
+ }
46
+ if (this.state !== "idle") {
47
+ throw new Error(`Cannot start recorder while ${this.state}`);
48
+ }
49
+ const mimeType = this.opts.mimeType ?? "audio/webm;codecs=opus";
50
+ this.stream = await navigator.mediaDevices.getUserMedia({
51
+ audio: this.opts.audioConstraints ?? true,
52
+ });
53
+ const rec = new MediaRecorder(this.stream, { mimeType });
54
+ this.chunks = [];
55
+ rec.ondataavailable = (e) => {
56
+ if (e.data && e.data.size > 0)
57
+ this.chunks.push(e.data);
58
+ };
59
+ this.rec = rec;
60
+ return new Promise((resolve, reject) => {
61
+ rec.onstart = () => {
62
+ this.setState("recording");
63
+ resolve();
64
+ };
65
+ rec.onerror = (e) => reject(e?.error || new Error("recorder error"));
66
+ rec.start();
67
+ });
68
+ }
69
+ /**
70
+ * Stop recording and resolve with the assembled Blob. The caller can
71
+ * pass this Blob directly to `ohm.audio.extract({ file: blob, ... })`.
72
+ * Stops all media tracks so the browser's mic indicator clears.
73
+ */
74
+ async stop() {
75
+ if (!this.rec || this.state !== "recording") {
76
+ throw new Error("Recorder is not recording");
77
+ }
78
+ this.setState("stopping");
79
+ return new Promise((resolve, reject) => {
80
+ const rec = this.rec;
81
+ rec.onstop = () => {
82
+ const blob = new Blob(this.chunks, {
83
+ type: rec.mimeType || "audio/webm",
84
+ });
85
+ this.cleanup();
86
+ resolve(blob);
87
+ };
88
+ rec.onerror = (e) => {
89
+ this.cleanup();
90
+ reject(e?.error || new Error("recorder error"));
91
+ };
92
+ rec.stop();
93
+ });
94
+ }
95
+ /** Abort the recording without surfacing the captured audio. */
96
+ cancel() {
97
+ if (this.rec && this.state === "recording") {
98
+ try {
99
+ this.rec.stop();
100
+ }
101
+ catch {
102
+ /* ignore */
103
+ }
104
+ }
105
+ this.cleanup();
106
+ }
107
+ cleanup() {
108
+ this.stream?.getTracks().forEach((t) => t.stop());
109
+ this.stream = null;
110
+ this.rec = null;
111
+ this.chunks = [];
112
+ this.setState("idle");
113
+ }
114
+ setState(next) {
115
+ if (this.state === next)
116
+ return;
117
+ this.state = next;
118
+ this.opts.onStateChange?.(next);
119
+ }
120
+ }
121
+ //# sourceMappingURL=recorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recorder.js","sourceRoot":"","sources":["../src/recorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiBH,mFAAmF;AACnF,MAAM,UAAU,oBAAoB;IAClC,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAChD,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IAC9E,IAAI,OAAQ,UAAkB,CAAC,aAAa,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IAC3E,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,OAAO,QAAQ;IACX,GAAG,GAAyB,IAAI,CAAC;IACjC,MAAM,GAAW,EAAE,CAAC;IACpB,MAAM,GAAuB,IAAI,CAAC;IAClC,KAAK,GAAkB,MAAM,CAAC;IAC9B,IAAI,CAAkB;IAE9B,YAAY,OAAwB,EAAE;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;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AC;YAClB,CAAC;YAAC,MAAM,CAAC;gBACP,YAAY;YACd,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAEO,QAAQ,CAAC,IAAmB;QAClC,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohm_studio/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "OHM Studio SDK for JavaScript / TypeScript / React. Voice-to-structured-JSON clinical extraction APIs.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,10 +17,7 @@
17
17
  "import": "./dist/react/index.js"
18
18
  }
19
19
  },
20
- "files": [
21
- "dist",
22
- "README.md"
23
- ],
20
+ "files": ["dist", "README.md"],
24
21
  "keywords": [
25
22
  "ohm",
26
23
  "clinical",
@@ -41,24 +38,22 @@
41
38
  "publishConfig": {
42
39
  "access": "public"
43
40
  },
41
+ "scripts": {
42
+ "build": "tsc -p tsconfig.json",
43
+ "typecheck": "tsc -p tsconfig.json --noEmit"
44
+ },
44
45
  "dependencies": {
45
- "@ohm_studio/sdk-core": "0.1.0"
46
+ "@ohm_studio/sdk-core": "workspace:*"
46
47
  },
47
48
  "peerDependencies": {
48
49
  "react": ">=17"
49
50
  },
50
51
  "peerDependenciesMeta": {
51
- "react": {
52
- "optional": true
53
- }
52
+ "react": { "optional": true }
54
53
  },
55
54
  "devDependencies": {
56
55
  "@types/react": "^18.3.23",
57
56
  "react": "^18.3.1",
58
57
  "typescript": "^5.8.3"
59
- },
60
- "scripts": {
61
- "build": "tsc -p tsconfig.json",
62
- "typecheck": "tsc -p tsconfig.json --noEmit"
63
58
  }
64
- }
59
+ }