codex2voice 0.1.1 → 0.1.3
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/cli.js +68 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -678,6 +678,10 @@ function parseSpeechCandidatesDetailed(jsonlChunk, options = {}) {
|
|
|
678
678
|
var SESSIONS_DIR = path6.join(os4.homedir(), ".codex", "sessions");
|
|
679
679
|
var POLL_INTERVAL_MS = 140;
|
|
680
680
|
var DISCOVERY_INTERVAL_MS = 900;
|
|
681
|
+
function shouldReplayFromStart(stat, wrapperStartedAt) {
|
|
682
|
+
if (!Number.isFinite(stat.birthtimeMs) || stat.birthtimeMs <= 0) return false;
|
|
683
|
+
return stat.birthtimeMs >= wrapperStartedAt - 5e3;
|
|
684
|
+
}
|
|
681
685
|
function getSessionDayDir(date) {
|
|
682
686
|
const yyyy = date.getFullYear().toString();
|
|
683
687
|
const mm = String(date.getMonth() + 1).padStart(2, "0");
|
|
@@ -747,10 +751,9 @@ async function runCodexWrapper(args, options = {}) {
|
|
|
747
751
|
if (trackedFiles.has(filePath)) return;
|
|
748
752
|
try {
|
|
749
753
|
const stat = await fs8.stat(filePath);
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
debug(`tracking file: ${filePath} from offset=${shouldReplayFromStart ? 0 : stat.size}`);
|
|
754
|
+
const replayFromStart = shouldReplayFromStart(stat, wrapperStartedAt);
|
|
755
|
+
trackedFiles.set(filePath, { offset: replayFromStart ? 0 : stat.size });
|
|
756
|
+
debug(`tracking file: ${filePath} from offset=${replayFromStart ? 0 : stat.size}`);
|
|
754
757
|
} catch {
|
|
755
758
|
}
|
|
756
759
|
})
|
|
@@ -840,9 +843,69 @@ async function runIngestFromStdin(force = false) {
|
|
|
840
843
|
console.log(result.spoken ? `Spoken (${result.reason}).` : `Skipped (${result.reason}).`);
|
|
841
844
|
}
|
|
842
845
|
|
|
846
|
+
// package.json
|
|
847
|
+
var package_default = {
|
|
848
|
+
name: "codex2voice",
|
|
849
|
+
version: "0.1.3",
|
|
850
|
+
description: "ElevenLabs voice companion CLI for Codex",
|
|
851
|
+
repository: {
|
|
852
|
+
type: "git",
|
|
853
|
+
url: "git+https://github.com/goyo-lp/codex2voice.git"
|
|
854
|
+
},
|
|
855
|
+
bugs: {
|
|
856
|
+
url: "https://github.com/goyo-lp/codex2voice/issues"
|
|
857
|
+
},
|
|
858
|
+
homepage: "https://github.com/goyo-lp/codex2voice#readme",
|
|
859
|
+
type: "module",
|
|
860
|
+
bin: {
|
|
861
|
+
codex2voice: "dist/cli.js"
|
|
862
|
+
},
|
|
863
|
+
files: [
|
|
864
|
+
"dist"
|
|
865
|
+
],
|
|
866
|
+
scripts: {
|
|
867
|
+
build: "tsup src/cli.ts --format esm --dts --clean --external keytar",
|
|
868
|
+
prepack: "npm run build",
|
|
869
|
+
dev: "tsx src/cli.ts",
|
|
870
|
+
test: "vitest run",
|
|
871
|
+
check: "tsc --noEmit"
|
|
872
|
+
},
|
|
873
|
+
keywords: [
|
|
874
|
+
"codex",
|
|
875
|
+
"voice",
|
|
876
|
+
"elevenlabs",
|
|
877
|
+
"cli"
|
|
878
|
+
],
|
|
879
|
+
author: "Goyo Lozano",
|
|
880
|
+
license: "ISC",
|
|
881
|
+
engines: {
|
|
882
|
+
node: ">=20"
|
|
883
|
+
},
|
|
884
|
+
os: [
|
|
885
|
+
"darwin"
|
|
886
|
+
],
|
|
887
|
+
publishConfig: {
|
|
888
|
+
access: "public"
|
|
889
|
+
},
|
|
890
|
+
dependencies: {
|
|
891
|
+
commander: "^14.0.3",
|
|
892
|
+
execa: "^9.6.1",
|
|
893
|
+
inquirer: "^13.3.0",
|
|
894
|
+
pino: "^10.3.1",
|
|
895
|
+
zod: "^4.3.6"
|
|
896
|
+
},
|
|
897
|
+
devDependencies: {
|
|
898
|
+
"@types/node": "^25.3.2",
|
|
899
|
+
tsup: "^8.5.1",
|
|
900
|
+
tsx: "^4.21.0",
|
|
901
|
+
typescript: "^5.9.3",
|
|
902
|
+
vitest: "^4.0.18"
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
|
|
843
906
|
// src/cli.ts
|
|
844
907
|
var program = new Command();
|
|
845
|
-
program.name("codex2voice").description("ElevenLabs voice companion for Codex CLI").version(
|
|
908
|
+
program.name("codex2voice").description("ElevenLabs voice companion for Codex CLI").version(package_default.version);
|
|
846
909
|
program.command("init").description("Run guided setup").action(runInit);
|
|
847
910
|
program.command("on").description("Enable voice").action(setVoiceOn);
|
|
848
911
|
program.command("off").description("Disable voice").action(setVoiceOff);
|