@remnic/capture-audio 10.0.104 → 10.0.105
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/dist/{chunk-4Z3DZYEB.js → chunk-GG3P5TCV.js} +77 -65
- package/dist/cli-bin.js +1 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -5
- package/package.json +7 -7
- package/dist/chunk-4Z3DZYEB.js.map +0 -1
- package/dist/cli-bin.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// openclaw-engram: Local-first memory plugin
|
|
2
|
-
|
|
3
1
|
// src/constants.ts
|
|
4
2
|
var CAPTURE_AUDIO_VERSION = "9.14.0";
|
|
5
3
|
var DEFAULT_HOST = "127.0.0.1";
|
|
@@ -23,10 +21,10 @@ var CaptureInputError = class extends Error {
|
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
// src/config.ts
|
|
26
|
-
import { readFileSync } from "fs";
|
|
24
|
+
import { readFileSync } from "node:fs";
|
|
27
25
|
|
|
28
26
|
// src/util.ts
|
|
29
|
-
import { randomFillSync } from "crypto";
|
|
27
|
+
import { randomFillSync } from "node:crypto";
|
|
30
28
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
31
29
|
function ulid(time = Date.now()) {
|
|
32
30
|
return encodeTime(time) + encodeRandom();
|
|
@@ -317,9 +315,9 @@ function serializeDaemonConfig(cfg) {
|
|
|
317
315
|
}
|
|
318
316
|
|
|
319
317
|
// src/control.ts
|
|
320
|
-
import { mkdirSync, readFileSync as readFileSync2, renameSync, rmSync, writeFileSync } from "fs";
|
|
321
|
-
import { randomBytes } from "crypto";
|
|
322
|
-
import path from "path";
|
|
318
|
+
import { mkdirSync, readFileSync as readFileSync2, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
319
|
+
import { randomBytes } from "node:crypto";
|
|
320
|
+
import path from "node:path";
|
|
323
321
|
function writePidFile(pidPath, pid, options = {}) {
|
|
324
322
|
mkdirSync(path.dirname(pidPath), { recursive: true });
|
|
325
323
|
const record = {
|
|
@@ -380,10 +378,10 @@ function removePidFileIfOwner(pidPath, pid) {
|
|
|
380
378
|
}
|
|
381
379
|
|
|
382
380
|
// src/token.ts
|
|
383
|
-
import { Buffer as Buffer2 } from "buffer";
|
|
384
|
-
import { randomBytes as randomBytes2, timingSafeEqual } from "crypto";
|
|
385
|
-
import { chmodSync, existsSync, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
386
|
-
import path2 from "path";
|
|
381
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
382
|
+
import { randomBytes as randomBytes2, timingSafeEqual } from "node:crypto";
|
|
383
|
+
import { chmodSync, existsSync, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
384
|
+
import path2 from "node:path";
|
|
387
385
|
function generateToken() {
|
|
388
386
|
return randomBytes2(32).toString("base64url");
|
|
389
387
|
}
|
|
@@ -418,7 +416,7 @@ function bearerFromHeader(header) {
|
|
|
418
416
|
}
|
|
419
417
|
|
|
420
418
|
// src/validate.ts
|
|
421
|
-
import { Buffer as Buffer3 } from "buffer";
|
|
419
|
+
import { Buffer as Buffer3 } from "node:buffer";
|
|
422
420
|
var DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
423
421
|
function parseTranscriptDate(value) {
|
|
424
422
|
if (typeof value !== "string" || !DATE_RE.test(value)) {
|
|
@@ -471,8 +469,8 @@ function decodeCursor(value) {
|
|
|
471
469
|
}
|
|
472
470
|
|
|
473
471
|
// src/daemon.ts
|
|
474
|
-
import http from "http";
|
|
475
|
-
import { Buffer as Buffer4 } from "buffer";
|
|
472
|
+
import http from "node:http";
|
|
473
|
+
import { Buffer as Buffer4 } from "node:buffer";
|
|
476
474
|
function sendJson(res, status, body) {
|
|
477
475
|
const payload = JSON.stringify(body);
|
|
478
476
|
res.writeHead(status, {
|
|
@@ -584,8 +582,8 @@ function startDaemon(deps) {
|
|
|
584
582
|
}
|
|
585
583
|
|
|
586
584
|
// src/paths.ts
|
|
587
|
-
import os from "os";
|
|
588
|
-
import path3 from "path";
|
|
585
|
+
import os from "node:os";
|
|
586
|
+
import path3 from "node:path";
|
|
589
587
|
function expandTilde(value) {
|
|
590
588
|
if (value === "~") return os.homedir();
|
|
591
589
|
if (value.startsWith("~/")) return path3.join(os.homedir(), value.slice(2));
|
|
@@ -608,9 +606,9 @@ function capturePaths(baseDir = captureBaseDir()) {
|
|
|
608
606
|
}
|
|
609
607
|
|
|
610
608
|
// src/replay.ts
|
|
611
|
-
import { createHash } from "crypto";
|
|
612
|
-
import { lstatSync, readdirSync, readFileSync as readFileSync4 } from "fs";
|
|
613
|
-
import path4 from "path";
|
|
609
|
+
import { createHash } from "node:crypto";
|
|
610
|
+
import { lstatSync, readdirSync, readFileSync as readFileSync4 } from "node:fs";
|
|
611
|
+
import path4 from "node:path";
|
|
614
612
|
function asObject2(value, where) {
|
|
615
613
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
616
614
|
throw new CaptureConfigError(`${where}: expected a conversation object`);
|
|
@@ -809,11 +807,11 @@ async function ingestReplayDirResponsive(spool, dir, options = {}) {
|
|
|
809
807
|
}
|
|
810
808
|
|
|
811
809
|
// src/model.ts
|
|
812
|
-
import { createWriteStream, lstatSync as lstatSync2, statSync } from "fs";
|
|
813
|
-
import { mkdir, rename, rm } from "fs/promises";
|
|
814
|
-
import path5 from "path";
|
|
815
|
-
import { Readable } from "stream";
|
|
816
|
-
import { pipeline } from "stream/promises";
|
|
810
|
+
import { createWriteStream, lstatSync as lstatSync2, statSync } from "node:fs";
|
|
811
|
+
import { mkdir, rename, rm } from "node:fs/promises";
|
|
812
|
+
import path5 from "node:path";
|
|
813
|
+
import { Readable } from "node:stream";
|
|
814
|
+
import { pipeline } from "node:stream/promises";
|
|
817
815
|
var MODEL_FILES = {
|
|
818
816
|
base: "ggml-base.bin",
|
|
819
817
|
small: "ggml-small.bin",
|
|
@@ -884,8 +882,8 @@ async function downloadWhisperModel(input) {
|
|
|
884
882
|
}
|
|
885
883
|
|
|
886
884
|
// src/janitor.ts
|
|
887
|
-
import { lstat, readdir, rm as rm2 } from "fs/promises";
|
|
888
|
-
import path6 from "path";
|
|
885
|
+
import { lstat, readdir, rm as rm2 } from "node:fs/promises";
|
|
886
|
+
import path6 from "node:path";
|
|
889
887
|
async function pruneExpiredRawAudio(rawDirectory, retentionMs, nowMs = Date.now()) {
|
|
890
888
|
if (!Number.isFinite(retentionMs) || retentionMs < 0) {
|
|
891
889
|
throw new CaptureConfigError("raw audio retention must be a non-negative duration");
|
|
@@ -946,8 +944,8 @@ function isReleaseEligible(candidate, threshold, held) {
|
|
|
946
944
|
}
|
|
947
945
|
|
|
948
946
|
// src/spool.ts
|
|
949
|
-
import { chmodSync as chmodSync2 } from "fs";
|
|
950
|
-
import { DatabaseSync } from "sqlite";
|
|
947
|
+
import { chmodSync as chmodSync2 } from "node:fs";
|
|
948
|
+
import { DatabaseSync } from "node:sqlite";
|
|
951
949
|
var SCHEMA_SQL = `
|
|
952
950
|
CREATE TABLE IF NOT EXISTS meta (
|
|
953
951
|
key TEXT PRIMARY KEY,
|
|
@@ -1952,10 +1950,10 @@ var SpeakerClusterer = class {
|
|
|
1952
1950
|
};
|
|
1953
1951
|
|
|
1954
1952
|
// src/native.ts
|
|
1955
|
-
import { spawn as nodeSpawn } from "child_process";
|
|
1956
|
-
import { readFileSync as readFileSync5 } from "fs";
|
|
1957
|
-
import { fileURLToPath } from "url";
|
|
1958
|
-
import path7 from "path";
|
|
1953
|
+
import { spawn as nodeSpawn } from "node:child_process";
|
|
1954
|
+
import { readFileSync as readFileSync5 } from "node:fs";
|
|
1955
|
+
import { fileURLToPath } from "node:url";
|
|
1956
|
+
import path7 from "node:path";
|
|
1959
1957
|
var HELPER_BIN_ENV = "REMNIC_CAPTURE_HELPER_BIN";
|
|
1960
1958
|
var STOP_DRAIN_TIMEOUT_MS = 5e3;
|
|
1961
1959
|
var HELPER_BIN_NAME = "remnic-capture-helper";
|
|
@@ -1981,7 +1979,7 @@ function resolveHelperBinary(deps = {}) {
|
|
|
1981
1979
|
const platform = deps.platform ?? process.platform;
|
|
1982
1980
|
const arch = deps.arch ?? process.arch;
|
|
1983
1981
|
const resolve = deps.resolve ?? defaultResolve;
|
|
1984
|
-
const
|
|
1982
|
+
const readFile2 = deps.readFile ?? ((file) => readFileSync5(file, "utf8"));
|
|
1985
1983
|
const specifier = helperPackageSpecifier(platform, arch);
|
|
1986
1984
|
let entry;
|
|
1987
1985
|
try {
|
|
@@ -1992,12 +1990,12 @@ function resolveHelperBinary(deps = {}) {
|
|
|
1992
1990
|
);
|
|
1993
1991
|
}
|
|
1994
1992
|
const pkgJsonPath = path7.join(path7.dirname(entry), "package.json");
|
|
1995
|
-
return { specifier, binaryPath: helperBinaryFromPackage(pkgJsonPath,
|
|
1993
|
+
return { specifier, binaryPath: helperBinaryFromPackage(pkgJsonPath, readFile2, specifier) };
|
|
1996
1994
|
}
|
|
1997
|
-
function helperBinaryFromPackage(pkgJsonPath,
|
|
1995
|
+
function helperBinaryFromPackage(pkgJsonPath, readFile2, specifier) {
|
|
1998
1996
|
let pkg;
|
|
1999
1997
|
try {
|
|
2000
|
-
pkg = JSON.parse(
|
|
1998
|
+
pkg = JSON.parse(readFile2(pkgJsonPath));
|
|
2001
1999
|
} catch {
|
|
2002
2000
|
throw new CaptureConfigError(`native helper ${specifier} has an unreadable package.json at ${pkgJsonPath}`);
|
|
2003
2001
|
}
|
|
@@ -2345,7 +2343,7 @@ function dedupeCrossChannel(segments, options = {}) {
|
|
|
2345
2343
|
}
|
|
2346
2344
|
|
|
2347
2345
|
// src/processor.ts
|
|
2348
|
-
import { createHash as createHash2 } from "crypto";
|
|
2346
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
2349
2347
|
import { log } from "@remnic/core/logger";
|
|
2350
2348
|
function segmentStableKey(chunkId, segment) {
|
|
2351
2349
|
const digest = createHash2("sha1").update(`${segment.startUtc}\0${segment.endUtc}\0${segment.text}`).digest("hex").slice(0, 16);
|
|
@@ -2802,8 +2800,8 @@ function createChunkProcessor(deps) {
|
|
|
2802
2800
|
}
|
|
2803
2801
|
|
|
2804
2802
|
// src/orphan-scan.ts
|
|
2805
|
-
import { existsSync as existsSync2, lstatSync as lstatSync3, readdirSync as readdirSync2 } from "fs";
|
|
2806
|
-
import path8 from "path";
|
|
2803
|
+
import { existsSync as existsSync2, lstatSync as lstatSync3, readdirSync as readdirSync2 } from "node:fs";
|
|
2804
|
+
import path8 from "node:path";
|
|
2807
2805
|
var DEFAULT_CHUNK_MS = 3e4;
|
|
2808
2806
|
function scanOrphanedChunks(input) {
|
|
2809
2807
|
const recovered = /* @__PURE__ */ new Map();
|
|
@@ -2861,8 +2859,11 @@ function byStart(left, right) {
|
|
|
2861
2859
|
}
|
|
2862
2860
|
|
|
2863
2861
|
// src/stt.ts
|
|
2864
|
-
import { statSync as statSync2 } from "fs";
|
|
2865
|
-
import {
|
|
2862
|
+
import { statSync as statSync2 } from "node:fs";
|
|
2863
|
+
import { mkdtemp, readFile, rm as rm3 } from "node:fs/promises";
|
|
2864
|
+
import { tmpdir } from "node:os";
|
|
2865
|
+
import path9 from "node:path";
|
|
2866
|
+
import { spawn } from "node:child_process";
|
|
2866
2867
|
function isRegularFile(filePath) {
|
|
2867
2868
|
try {
|
|
2868
2869
|
return statSync2(filePath).isFile();
|
|
@@ -2943,7 +2944,7 @@ async function transcribeWithWhisper(input) {
|
|
|
2943
2944
|
}
|
|
2944
2945
|
return parseWhisperJson(result.stdout, input.chunkStartedAtUtc);
|
|
2945
2946
|
}
|
|
2946
|
-
function
|
|
2947
|
+
function collect(command, args) {
|
|
2947
2948
|
return new Promise((resolve, reject) => {
|
|
2948
2949
|
const child = spawn(command, args, { shell: false, stdio: ["ignore", "pipe", "pipe"] });
|
|
2949
2950
|
const stdout = [];
|
|
@@ -2971,11 +2972,23 @@ function runWhisperCli(command, args) {
|
|
|
2971
2972
|
});
|
|
2972
2973
|
});
|
|
2973
2974
|
}
|
|
2975
|
+
async function runWhisperCli(command, args) {
|
|
2976
|
+
const at = args.indexOf("--output-file");
|
|
2977
|
+
if (at < 0 || args[at + 1] !== "-") return collect(command, args);
|
|
2978
|
+
const dir = await mkdtemp(path9.join(tmpdir(), "remnic-whisper-"));
|
|
2979
|
+
try {
|
|
2980
|
+
const base = path9.join(dir, "out");
|
|
2981
|
+
const result = await collect(command, args.map((arg, index) => index === at + 1 ? base : arg));
|
|
2982
|
+
return result.code === 0 ? { ...result, stdout: await readFile(`${base}.json`, "utf8").catch(() => "") } : result;
|
|
2983
|
+
} finally {
|
|
2984
|
+
await rm3(dir, { recursive: true, force: true });
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2974
2987
|
|
|
2975
2988
|
// src/capture.ts
|
|
2976
|
-
import { realpathSync } from "fs";
|
|
2977
|
-
import { rm as
|
|
2978
|
-
import
|
|
2989
|
+
import { realpathSync } from "node:fs";
|
|
2990
|
+
import { rm as rm4 } from "node:fs/promises";
|
|
2991
|
+
import path10 from "node:path";
|
|
2979
2992
|
function createLiveCapture(options) {
|
|
2980
2993
|
const { spool, config, outDir, defaultModelPath } = options;
|
|
2981
2994
|
const resolveModel = options.resolveModel ?? (() => resolveModelPath(config.stt.modelPath ?? void 0, defaultModelPath));
|
|
@@ -2986,23 +2999,23 @@ function createLiveCapture(options) {
|
|
|
2986
2999
|
threads: config.stt.threads,
|
|
2987
3000
|
run: runWhisperCli
|
|
2988
3001
|
}));
|
|
2989
|
-
const rawBase =
|
|
3002
|
+
const rawBase = path10.resolve(outDir);
|
|
2990
3003
|
const realOrResolved = (p) => {
|
|
2991
3004
|
try {
|
|
2992
|
-
return realpathSync(
|
|
3005
|
+
return realpathSync(path10.resolve(p));
|
|
2993
3006
|
} catch {
|
|
2994
|
-
return
|
|
3007
|
+
return path10.resolve(p);
|
|
2995
3008
|
}
|
|
2996
3009
|
};
|
|
2997
3010
|
const rawBaseReal = realOrResolved(rawBase);
|
|
2998
3011
|
const withinRawDir = (p) => {
|
|
2999
3012
|
const real = realOrResolved(p);
|
|
3000
|
-
return real === rawBaseReal || real.startsWith(rawBaseReal +
|
|
3013
|
+
return real === rawBaseReal || real.startsWith(rawBaseReal + path10.sep);
|
|
3001
3014
|
};
|
|
3002
3015
|
const cleanupRawAudio = options.cleanupRawAudio ?? (async (event) => {
|
|
3003
3016
|
if (config.rawRetentionHours > 0) return;
|
|
3004
3017
|
if (!withinRawDir(event.path)) return;
|
|
3005
|
-
await
|
|
3018
|
+
await rm4(path10.resolve(event.path), { force: true });
|
|
3006
3019
|
});
|
|
3007
3020
|
const assembler = new ConversationAssembler({
|
|
3008
3021
|
gapMinutes: config.conversationGapMinutes,
|
|
@@ -3042,7 +3055,7 @@ function createLiveCapture(options) {
|
|
|
3042
3055
|
options.onError?.(new CaptureInputError(`native helper chunk path escapes the capture directory: ${event.path}`));
|
|
3043
3056
|
return;
|
|
3044
3057
|
}
|
|
3045
|
-
processor.enqueue({ ...event, path:
|
|
3058
|
+
processor.enqueue({ ...event, path: path10.resolve(event.path) });
|
|
3046
3059
|
},
|
|
3047
3060
|
...options.onError ? { onError: options.onError } : {},
|
|
3048
3061
|
...options.onStderr ? { onStderr: options.onStderr } : {},
|
|
@@ -3107,7 +3120,7 @@ function enrollSelf(input) {
|
|
|
3107
3120
|
}
|
|
3108
3121
|
|
|
3109
3122
|
// src/service.ts
|
|
3110
|
-
import
|
|
3123
|
+
import path11 from "node:path";
|
|
3111
3124
|
var DEFAULT_SERVICE_LABEL = "com.remnic.capture-audio";
|
|
3112
3125
|
var SYSTEMD_UNIT_NAME = "remnic-capture-audio.service";
|
|
3113
3126
|
function xmlEscape(value) {
|
|
@@ -3188,7 +3201,7 @@ WantedBy=default.target
|
|
|
3188
3201
|
function planService(deps) {
|
|
3189
3202
|
const label = validateLabel(deps.spec.label ?? DEFAULT_SERVICE_LABEL);
|
|
3190
3203
|
if (deps.platform === "darwin") {
|
|
3191
|
-
const target =
|
|
3204
|
+
const target = path11.join(deps.home, "Library", "LaunchAgents", `${label}.plist`);
|
|
3192
3205
|
return {
|
|
3193
3206
|
platform: deps.platform,
|
|
3194
3207
|
path: target,
|
|
@@ -3198,7 +3211,7 @@ function planService(deps) {
|
|
|
3198
3211
|
}
|
|
3199
3212
|
if (deps.platform === "linux") {
|
|
3200
3213
|
const unitName = deps.spec.label ? `${label}.service` : SYSTEMD_UNIT_NAME;
|
|
3201
|
-
const target =
|
|
3214
|
+
const target = path11.join(deps.home, ".config", "systemd", "user", unitName);
|
|
3202
3215
|
return {
|
|
3203
3216
|
platform: deps.platform,
|
|
3204
3217
|
path: target,
|
|
@@ -3213,7 +3226,7 @@ function installService(deps) {
|
|
|
3213
3226
|
if (!deps.force && deps.exists?.(plan.path)) {
|
|
3214
3227
|
throw new CaptureConfigError(`a capture-audio service is already installed at ${plan.path} (use --force to replace)`);
|
|
3215
3228
|
}
|
|
3216
|
-
deps.mkdir(
|
|
3229
|
+
deps.mkdir(path11.dirname(plan.path));
|
|
3217
3230
|
deps.writeFile(plan.path, plan.contents);
|
|
3218
3231
|
return plan;
|
|
3219
3232
|
}
|
|
@@ -3225,11 +3238,11 @@ function uninstallService(deps) {
|
|
|
3225
3238
|
}
|
|
3226
3239
|
|
|
3227
3240
|
// src/cli.ts
|
|
3228
|
-
import { spawn as spawn2 } from "child_process";
|
|
3229
|
-
import { chmodSync as chmodSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, openSync, readFileSync as readFileSync6, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
3230
|
-
import
|
|
3231
|
-
import { setTimeout as delay } from "timers/promises";
|
|
3232
|
-
import { homedir } from "os";
|
|
3241
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
3242
|
+
import { chmodSync as chmodSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, openSync, readFileSync as readFileSync6, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
3243
|
+
import path12 from "node:path";
|
|
3244
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
3245
|
+
import { homedir } from "node:os";
|
|
3233
3246
|
var VALUE_FLAGS = {
|
|
3234
3247
|
replay: true,
|
|
3235
3248
|
host: true,
|
|
@@ -3414,13 +3427,13 @@ function cmdInit(paths, flags, stdout) {
|
|
|
3414
3427
|
}
|
|
3415
3428
|
async function cmdDownloadModel(paths, flags, stdout, downloadModel) {
|
|
3416
3429
|
if (typeof flags.model !== "string") throw new CaptureInputError("flag --model requires a value");
|
|
3417
|
-
const result = await downloadModel({ model: flags.model, directory:
|
|
3430
|
+
const result = await downloadModel({ model: flags.model, directory: path12.join(paths.baseDir, "models") });
|
|
3418
3431
|
stdout(`${result.downloaded ? "downloaded" : "model already present"} ${flags.model} to ${result.path}`);
|
|
3419
3432
|
return 0;
|
|
3420
3433
|
}
|
|
3421
3434
|
async function cmdJanitor(paths, stdout, stderr) {
|
|
3422
3435
|
const config = loadConfigOrDefault(paths, stderr);
|
|
3423
|
-
const removed = await pruneExpiredRawAudio(
|
|
3436
|
+
const removed = await pruneExpiredRawAudio(path12.join(paths.baseDir, "raw"), config.rawRetentionHours * 60 * 60 * 1e3);
|
|
3424
3437
|
stdout(`janitor: removed ${removed.length} expired raw audio file(s)`);
|
|
3425
3438
|
return 0;
|
|
3426
3439
|
}
|
|
@@ -3497,13 +3510,13 @@ async function cmdStart(paths, flags, env, stdout, stderr, spawnArgvPrefix) {
|
|
|
3497
3510
|
let live = null;
|
|
3498
3511
|
if (flags.capture === true) {
|
|
3499
3512
|
try {
|
|
3500
|
-
const rawDir =
|
|
3513
|
+
const rawDir = path12.join(paths.baseDir, "raw");
|
|
3501
3514
|
mkdirSync3(rawDir, { recursive: true });
|
|
3502
3515
|
live = createLiveCapture({
|
|
3503
3516
|
spool,
|
|
3504
3517
|
config,
|
|
3505
3518
|
outDir: rawDir,
|
|
3506
|
-
defaultModelPath:
|
|
3519
|
+
defaultModelPath: path12.join(paths.baseDir, "models", "ggml-base.bin"),
|
|
3507
3520
|
onError: (e) => stderr(`capture: ${describeError(e)}`),
|
|
3508
3521
|
onStderr: (l) => stderr(`helper: ${l}`)
|
|
3509
3522
|
});
|
|
@@ -3867,4 +3880,3 @@ export {
|
|
|
3867
3880
|
superviseReplay,
|
|
3868
3881
|
runCapture
|
|
3869
3882
|
};
|
|
3870
|
-
//# sourceMappingURL=chunk-4Z3DZYEB.js.map
|
package/dist/cli-bin.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// openclaw-engram: Local-first memory plugin
|
|
3
2
|
import {
|
|
4
3
|
runCapture
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GG3P5TCV.js";
|
|
6
5
|
|
|
7
6
|
// src/cli-bin.ts
|
|
8
7
|
runCapture({ argv: process.argv.slice(2) }).then((code) => {
|
|
@@ -12,4 +11,3 @@ runCapture({ argv: process.argv.slice(2) }).then((code) => {
|
|
|
12
11
|
console.error(`remnic-capture-audio: ${detail}`);
|
|
13
12
|
process.exitCode = 1;
|
|
14
13
|
});
|
|
15
|
-
//# sourceMappingURL=cli-bin.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -662,6 +662,11 @@ declare function parseWhisperJson(output: string, chunkStartedAtUtc: string): Tr
|
|
|
662
662
|
declare function resolveModelPath(configuredPath: string | undefined, defaultPath: string, exists?: (path: string) => boolean): string;
|
|
663
663
|
declare function buildWhisperArgs(wavPath: string, modelPath: string, threads?: number | null): string[];
|
|
664
664
|
declare function transcribeWithWhisper(input: WhisperTranscriptionInput): Promise<TranscribedSegment[]>;
|
|
665
|
+
/**
|
|
666
|
+
* Run whisper-cli and return its JSON as `stdout`. whisper-cli opens /dev/stdout for `--output-file -`, which fails
|
|
667
|
+
* on the socket Node gives a child process and leaves the output empty, so the JSON goes through a private
|
|
668
|
+
* temporary file instead.
|
|
669
|
+
*/
|
|
665
670
|
declare function runWhisperCli(command: string, args: string[]): Promise<WhisperRunResult>;
|
|
666
671
|
|
|
667
672
|
type ModelFetch = (url: string) => Promise<Response>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// openclaw-engram: Local-first memory plugin
|
|
2
1
|
import {
|
|
3
2
|
CAPTURE_AUDIO_VERSION,
|
|
4
3
|
CaptureConfigError,
|
|
@@ -73,10 +72,10 @@ import {
|
|
|
73
72
|
whisperModelUrl,
|
|
74
73
|
wordJaccard,
|
|
75
74
|
writePidFile
|
|
76
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-GG3P5TCV.js";
|
|
77
76
|
|
|
78
77
|
// src/vad.ts
|
|
79
|
-
import { statSync } from "fs";
|
|
78
|
+
import { statSync } from "node:fs";
|
|
80
79
|
function sileroVadConfig(input) {
|
|
81
80
|
if (typeof input.modelPath !== "string" || input.modelPath.trim() === "") {
|
|
82
81
|
throw new CaptureConfigError("Silero VAD modelPath must be a non-empty string");
|
|
@@ -168,7 +167,7 @@ async function createSileroVad(input, load = loadSherpaOnnx, exists = isRegularF
|
|
|
168
167
|
}
|
|
169
168
|
|
|
170
169
|
// src/connector.ts
|
|
171
|
-
import { readFileSync } from "fs";
|
|
170
|
+
import { readFileSync } from "node:fs";
|
|
172
171
|
import {
|
|
173
172
|
registerWearableConnector,
|
|
174
173
|
getWearableConnector
|
|
@@ -408,4 +407,3 @@ export {
|
|
|
408
407
|
wordJaccard,
|
|
409
408
|
writePidFile
|
|
410
409
|
};
|
|
411
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/capture-audio",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.105",
|
|
4
4
|
"description": "Desktop audio capture daemon for Remnic — local spool, loopback HTTP API, and replay ingestion for the wearable source `desktop` (à-la-carte)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"tsup": "^8.0.0",
|
|
30
30
|
"typescript": "^5.7.0",
|
|
31
31
|
"tsx": "^4.0.0",
|
|
32
|
-
"@remnic/core": "10.0.
|
|
32
|
+
"@remnic/core": "10.0.105"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@remnic/core": "^10.0.
|
|
35
|
+
"@remnic/core": "^10.0.105",
|
|
36
36
|
"sherpa-onnx-node": "*",
|
|
37
|
-
"@remnic/capture-native-darwin-arm64": "^10.0.
|
|
38
|
-
"@remnic/capture-native-darwin-x64": "^10.0.
|
|
37
|
+
"@remnic/capture-native-darwin-arm64": "^10.0.105",
|
|
38
|
+
"@remnic/capture-native-darwin-x64": "^10.0.105"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"sherpa-onnx-node": {
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"transcript"
|
|
65
65
|
],
|
|
66
66
|
"scripts": {
|
|
67
|
-
"build": "tsup
|
|
67
|
+
"build": "tsup --config tsup.config.ts",
|
|
68
68
|
"precheck-types": "node ../../scripts/ensure-bench-build-deps.mjs",
|
|
69
69
|
"check-types": "tsc --noEmit",
|
|
70
|
-
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--conditions=remnic-source\" tsx --test src/config.test.ts src/validate.test.ts src/token.test.ts src/spool.test.ts src/replay.test.ts src/daemon.test.ts src/cli.test.ts src/stt.test.ts src/model.test.ts src/janitor.test.ts src/vad.test.ts src/dedup.test.ts src/assembly.test.ts src/diarization.test.ts src/connector.test.ts src/e2e.test.ts src/native.test.ts src/processor.test.ts src/processor-policy.test.ts src/capture.test.ts src/service.test.ts src/enroll.test.ts"
|
|
70
|
+
"test": "NODE_OPTIONS=\"${NODE_OPTIONS:+$NODE_OPTIONS }--conditions=remnic-source\" tsx --test src/config.test.ts src/validate.test.ts src/token.test.ts src/spool.test.ts src/replay.test.ts src/daemon.test.ts src/cli.test.ts src/stt.test.ts src/model.test.ts src/janitor.test.ts src/vad.test.ts src/dedup.test.ts src/assembly.test.ts src/diarization.test.ts src/connector.test.ts src/e2e.test.ts src/native.test.ts src/processor.test.ts src/processor-policy.test.ts src/capture.test.ts src/service.test.ts src/enroll.test.ts src/dist.test.ts"
|
|
71
71
|
}
|
|
72
72
|
}
|