plugin-updater 1.3.1 → 1.3.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/git.js +4 -1
- package/dist/index.js +8 -1
- package/lib/core.js +15 -1
- package/package.json +1 -1
package/dist/git.js
CHANGED
|
@@ -4,7 +4,10 @@ import os from "os";
|
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
5
|
import { getReposDir } from "./env.js";
|
|
6
6
|
import { writeLog } from "./log.js";
|
|
7
|
-
|
|
7
|
+
// dirs copied back from the temp build into the repo clone. core-loader/dist holds
|
|
8
|
+
// the loaders' TUI (tui.js), run as a separate process — without it `oc`/`cc` find
|
|
9
|
+
// no TUI and fall through to plain opencode/claude.
|
|
10
|
+
const BUILD_OUTPUT_DIRS = ["dist", path.join("core", "dist"), path.join("core-loader", "dist")];
|
|
8
11
|
export function executeGit(command, cwd) {
|
|
9
12
|
writeLog(`Executing git: ${command} in ${cwd}`);
|
|
10
13
|
try {
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import { deployToExecutionDir } from "./deploy.js";
|
|
|
7
7
|
import { syncPluginsAcrossApps } from "./syncbridge.js";
|
|
8
8
|
// @ts-ignore — generated bundle, no .d.ts
|
|
9
9
|
import { maybeRunCli, deployUpdaterCommands } from "./commands.js";
|
|
10
|
+
// @ts-ignore — generated bundle, no .d.ts
|
|
11
|
+
import { ensureConfig } from "../lib/core.js";
|
|
10
12
|
import path from "path";
|
|
11
13
|
import fs from "fs";
|
|
12
14
|
// `node dist/index.js config …` (from the /plugin-updater-config command) runs the
|
|
@@ -64,11 +66,16 @@ export async function earlyLaunch(configDir, plugins) {
|
|
|
64
66
|
return {};
|
|
65
67
|
setEarlyLaunchConfigDir(configDir);
|
|
66
68
|
writeLog("Starting earlyLaunch updater sequence");
|
|
67
|
-
// keep the cross-app /plugin-updater-config command deployed (idempotent)
|
|
69
|
+
// keep the cross-app /plugin-updater-config command deployed (idempotent) + the
|
|
70
|
+
// config file materialized (so it's discoverable in the home / agentbox data folder)
|
|
68
71
|
try {
|
|
69
72
|
deployUpdaterCommands();
|
|
70
73
|
}
|
|
71
74
|
catch { /* best-effort */ }
|
|
75
|
+
try {
|
|
76
|
+
ensureConfig("plugin-updater", { logging: true });
|
|
77
|
+
}
|
|
78
|
+
catch { /* best-effort */ }
|
|
72
79
|
// pull in any `sync: true` plugins from the other app BEFORE building, then
|
|
73
80
|
// re-read the list so a freshly-synced-in plugin is cloned/built this pass.
|
|
74
81
|
await syncPluginsAcrossApps(configDir);
|
package/lib/core.js
CHANGED
|
@@ -83,6 +83,19 @@ function loadConfig(name, configDir = getAppConfigDir()) {
|
|
|
83
83
|
CACHE[key] = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
|
84
84
|
return CACHE[key];
|
|
85
85
|
}
|
|
86
|
+
function ensureConfig(name, defaults, configDir = getAppConfigDir()) {
|
|
87
|
+
const preferred = join2(configDir, "config", `${name}.json`);
|
|
88
|
+
const fallback = join2(configDir, `${name}.json`);
|
|
89
|
+
if (!existsSync3(preferred) && !existsSync3(fallback)) {
|
|
90
|
+
try {
|
|
91
|
+
writeJson(preferred, defaults);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
CACHE[configDir + "::" + name] = { ...defaults };
|
|
95
|
+
return CACHE[configDir + "::" + name];
|
|
96
|
+
}
|
|
97
|
+
return { ...defaults, ...loadConfig(name, configDir) };
|
|
98
|
+
}
|
|
86
99
|
function getConfigValue(name, key, configDir = getAppConfigDir()) {
|
|
87
100
|
let node = loadConfig(name, configDir);
|
|
88
101
|
for (const part of key.split(".")) {
|
|
@@ -127,7 +140,7 @@ import { join as join3 } from "path";
|
|
|
127
140
|
import { appendFileSync } from "fs";
|
|
128
141
|
var START_TIME = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").split(".")[0];
|
|
129
142
|
function globalSetting(key, fallback, configDir = getAppConfigDir()) {
|
|
130
|
-
const v = loadConfig("
|
|
143
|
+
const v = loadConfig("settings", configDir)[key];
|
|
131
144
|
return v === void 0 ? fallback : v;
|
|
132
145
|
}
|
|
133
146
|
function envTruthy(v) {
|
|
@@ -276,6 +289,7 @@ export {
|
|
|
276
289
|
configPath,
|
|
277
290
|
createLogger,
|
|
278
291
|
deployCommands,
|
|
292
|
+
ensureConfig,
|
|
279
293
|
ensureDir,
|
|
280
294
|
existingApps,
|
|
281
295
|
existingConfigDirs,
|