@mingxy/ocosay 1.1.3 → 1.1.4
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/package.json +1 -1
- package/dist/plugin.js +28 -5
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -4650,7 +4650,7 @@ var require_transport = __commonJS({
|
|
|
4650
4650
|
"node_modules/pino/lib/transport.js"(exports, module) {
|
|
4651
4651
|
"use strict";
|
|
4652
4652
|
var { createRequire: createRequire2 } = __require("module");
|
|
4653
|
-
var { existsSync:
|
|
4653
|
+
var { existsSync: existsSync7 } = __require("node:fs");
|
|
4654
4654
|
var getCallers = require_caller();
|
|
4655
4655
|
var { join: join8, isAbsolute, sep } = __require("node:path");
|
|
4656
4656
|
var { fileURLToPath: fileURLToPath2 } = __require("node:url");
|
|
@@ -4724,7 +4724,7 @@ var require_transport = __commonJS({
|
|
|
4724
4724
|
return false;
|
|
4725
4725
|
}
|
|
4726
4726
|
}
|
|
4727
|
-
return isAbsolute(path2) && !
|
|
4727
|
+
return isAbsolute(path2) && !existsSync7(path2);
|
|
4728
4728
|
}
|
|
4729
4729
|
function stripQuotes(value) {
|
|
4730
4730
|
const first = value[0];
|
|
@@ -9551,14 +9551,35 @@ function loadOrCreateConfig() {
|
|
|
9551
9551
|
}
|
|
9552
9552
|
|
|
9553
9553
|
// src/plugin.ts
|
|
9554
|
-
import { readFileSync as readFileSync2 } from "fs";
|
|
9554
|
+
import { readFileSync as readFileSync2, existsSync as existsSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
9555
9555
|
import { fileURLToPath } from "url";
|
|
9556
9556
|
import { dirname as dirname2, join as join7 } from "path";
|
|
9557
|
+
import { homedir as homedir3 } from "os";
|
|
9557
9558
|
import { execSync } from "child_process";
|
|
9558
9559
|
import { createRequire } from "module";
|
|
9559
9560
|
var logger7 = createModuleLogger("Plugin");
|
|
9560
9561
|
var require2 = createRequire(import.meta.url);
|
|
9562
|
+
function getSkipFilePath() {
|
|
9563
|
+
return join7(homedir3(), ".config", "opencode", ".naudiodon_skip");
|
|
9564
|
+
}
|
|
9565
|
+
function shouldSkipNaudiodon() {
|
|
9566
|
+
return existsSync6(getSkipFilePath());
|
|
9567
|
+
}
|
|
9568
|
+
function markNaudiodonSkipped() {
|
|
9569
|
+
try {
|
|
9570
|
+
const dir = join7(homedir3(), ".config", "opencode");
|
|
9571
|
+
if (!existsSync6(dir)) {
|
|
9572
|
+
execSync("mkdir -p", { cwd: dir });
|
|
9573
|
+
}
|
|
9574
|
+
writeFileSync5(getSkipFilePath(), Date.now().toString(), "utf-8");
|
|
9575
|
+
} catch {
|
|
9576
|
+
}
|
|
9577
|
+
}
|
|
9561
9578
|
async function ensureNaudiodonCompiled() {
|
|
9579
|
+
if (shouldSkipNaudiodon()) {
|
|
9580
|
+
logger7.info("naudiodon skipped previously, skipping compile attempt");
|
|
9581
|
+
return;
|
|
9582
|
+
}
|
|
9562
9583
|
try {
|
|
9563
9584
|
require2("naudiodon");
|
|
9564
9585
|
logger7.info("naudiodon already compiled");
|
|
@@ -9592,10 +9613,12 @@ async function ensureNaudiodonCompiled() {
|
|
|
9592
9613
|
notificationService.success("naudiodon \u7F16\u8BD1\u6210\u529F", "\u97F3\u9891\u540E\u7AEF\u5DF2\u5C31\u7EEA");
|
|
9593
9614
|
} catch (retryErr) {
|
|
9594
9615
|
logger7.error({ err: retryErr }, "failed to compile naudiodon even after PortAudio install");
|
|
9595
|
-
notificationService.error("naudiodon \u7F16\u8BD1\u5931\u8D25", "\
|
|
9616
|
+
notificationService.error("naudiodon \u7F16\u8BD1\u5931\u8D25", "\u5DF2\u8DF3\u8FC7\uFF0C\u4E4B\u540E\u4E0D\u518D\u91CD\u8BD5");
|
|
9617
|
+
markNaudiodonSkipped();
|
|
9596
9618
|
}
|
|
9597
9619
|
} else {
|
|
9598
|
-
notificationService.error("PortAudio \u5B89\u88C5\u5931\u8D25", "\
|
|
9620
|
+
notificationService.error("PortAudio \u5B89\u88C5\u5931\u8D25", "\u5DF2\u8DF3\u8FC7\uFF0C\u4E4B\u540E\u4E0D\u518D\u91CD\u8BD5");
|
|
9621
|
+
markNaudiodonSkipped();
|
|
9599
9622
|
}
|
|
9600
9623
|
}
|
|
9601
9624
|
}
|