@aerovato/operator-helper 1.10.0 → 1.11.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/dist/index.js +16 -72
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15346,7 +15346,7 @@ var log = (...args) => consoleWith((console2) => sync(() => {
|
|
|
15346
15346
|
// package.json
|
|
15347
15347
|
var package_default = {
|
|
15348
15348
|
name: "@aerovato/operator-helper",
|
|
15349
|
-
version: "1.
|
|
15349
|
+
version: "1.11.0",
|
|
15350
15350
|
description: "Installation and setup CLI for Operator Memory",
|
|
15351
15351
|
license: "BSD-3-Clause",
|
|
15352
15352
|
author: "Aerovato Research",
|
|
@@ -15536,16 +15536,6 @@ function runProcess(executable, arguments_, cwd, environment) {
|
|
|
15536
15536
|
};
|
|
15537
15537
|
});
|
|
15538
15538
|
}
|
|
15539
|
-
async function pathKind(path) {
|
|
15540
|
-
try {
|
|
15541
|
-
const info = await lstat(path);
|
|
15542
|
-
return info.isFile() ? "file" : info.isDirectory() ? "directory" : "other";
|
|
15543
|
-
} catch (error) {
|
|
15544
|
-
if (isNodeError(error) && error.code === "ENOENT")
|
|
15545
|
-
return "missing";
|
|
15546
|
-
throw error;
|
|
15547
|
-
}
|
|
15548
|
-
}
|
|
15549
15539
|
async function readOptionalFile(path) {
|
|
15550
15540
|
try {
|
|
15551
15541
|
return await readFile3(path, "utf8");
|
|
@@ -16506,37 +16496,21 @@ function commandFailure(result, fallback) {
|
|
|
16506
16496
|
// src/commands/install/codex.ts
|
|
16507
16497
|
import { mkdir as mkdir2, writeFile as writeFile3 } from "node:fs/promises";
|
|
16508
16498
|
import { join as join2 } from "node:path";
|
|
16509
|
-
var
|
|
16510
|
-
`;
|
|
16499
|
+
var MARKETPLACE_SOURCE = "https://github.com/aerovato/operator-memory.git";
|
|
16511
16500
|
var MARKETPLACE_NAME = "operator-memory";
|
|
16512
|
-
var
|
|
16513
|
-
var PLUGIN_ID2 = `${PLUGIN_NAME}@${MARKETPLACE_NAME}`;
|
|
16514
|
-
var MARKETPLACE = `${JSON.stringify({
|
|
16515
|
-
name: MARKETPLACE_NAME,
|
|
16516
|
-
plugins: [
|
|
16517
|
-
{
|
|
16518
|
-
name: PLUGIN_NAME,
|
|
16519
|
-
source: {
|
|
16520
|
-
source: "npm",
|
|
16521
|
-
package: "@aerovato/operator-codex",
|
|
16522
|
-
version: "latest"
|
|
16523
|
-
},
|
|
16524
|
-
policy: { installation: "AVAILABLE" }
|
|
16525
|
-
}
|
|
16526
|
-
]
|
|
16527
|
-
}, null, 2)}
|
|
16528
|
-
`;
|
|
16501
|
+
var PLUGIN_ID2 = `aerovato@${MARKETPLACE_NAME}`;
|
|
16529
16502
|
var installCodex = fn2("installCodex")(function* (context) {
|
|
16530
|
-
const
|
|
16531
|
-
if (!marketplace.ok)
|
|
16532
|
-
return marketplace.result;
|
|
16533
|
-
const addMarketplace = yield* runProcess("codex", ["plugin", "marketplace", "add", marketplace.path, "--json"], context.cwd, { NPM_CONFIG_MIN_RELEASE_AGE: "0" });
|
|
16503
|
+
const addMarketplace = yield* runProcess("codex", ["plugin", "marketplace", "add", MARKETPLACE_SOURCE, "--ref", "main", "--json"], context.cwd, { NPM_CONFIG_MIN_RELEASE_AGE: "0" });
|
|
16534
16504
|
if (!addMarketplace.ok && isMissingBinary(addMarketplace.error)) {
|
|
16535
|
-
return yield* registerDesktopMarketplace(context
|
|
16505
|
+
return yield* registerDesktopMarketplace(context);
|
|
16536
16506
|
}
|
|
16537
16507
|
const addFailure = commandFailure2(addMarketplace, "Codex marketplace installation failed");
|
|
16538
16508
|
if (addFailure !== null)
|
|
16539
16509
|
return addFailure;
|
|
16510
|
+
const upgrade = yield* runProcess("codex", ["plugin", "marketplace", "upgrade", MARKETPLACE_NAME, "--json"], context.cwd, { NPM_CONFIG_MIN_RELEASE_AGE: "0" });
|
|
16511
|
+
const upgradeFailure = commandFailure2(upgrade, "Codex marketplace upgrade failed");
|
|
16512
|
+
if (upgradeFailure !== null)
|
|
16513
|
+
return upgradeFailure;
|
|
16540
16514
|
const install = yield* runProcess("codex", ["plugin", "add", PLUGIN_ID2, "--json"], context.cwd, {
|
|
16541
16515
|
NPM_CONFIG_MIN_RELEASE_AGE: "0"
|
|
16542
16516
|
});
|
|
@@ -16562,48 +16536,17 @@ var installCodex = fn2("installCodex")(function* (context) {
|
|
|
16562
16536
|
`)
|
|
16563
16537
|
};
|
|
16564
16538
|
});
|
|
16565
|
-
function writeMarketplace(home) {
|
|
16566
|
-
return promise2(async () => {
|
|
16567
|
-
const root = join2(home, ".operator-helper", "codex-marketplace");
|
|
16568
|
-
const marker = join2(root, ".operator-managed");
|
|
16569
|
-
const marketplace = join2(root, ".agents", "plugins", "marketplace.json");
|
|
16570
|
-
try {
|
|
16571
|
-
const kind = await pathKind(root);
|
|
16572
|
-
if (kind !== "missing" && (kind !== "directory" || await readOptionalFile(marker) !== MARKETPLACE_MARKER)) {
|
|
16573
|
-
return {
|
|
16574
|
-
ok: false,
|
|
16575
|
-
result: {
|
|
16576
|
-
exitCode: 1,
|
|
16577
|
-
output: `✗ Preserved unmanaged Codex marketplace at ${root}`
|
|
16578
|
-
}
|
|
16579
|
-
};
|
|
16580
|
-
}
|
|
16581
|
-
await mkdir2(join2(root, ".agents", "plugins"), { recursive: true });
|
|
16582
|
-
await writeFile3(marker, MARKETPLACE_MARKER);
|
|
16583
|
-
await writeFile3(marketplace, MARKETPLACE);
|
|
16584
|
-
return { ok: true, path: root };
|
|
16585
|
-
} catch (error) {
|
|
16586
|
-
return {
|
|
16587
|
-
ok: false,
|
|
16588
|
-
result: {
|
|
16589
|
-
exitCode: 1,
|
|
16590
|
-
output: `✗ Could not prepare Codex marketplace: ${getErrorMessage(error)}`
|
|
16591
|
-
}
|
|
16592
|
-
};
|
|
16593
|
-
}
|
|
16594
|
-
});
|
|
16595
|
-
}
|
|
16596
16539
|
function isMissingBinary(error) {
|
|
16597
16540
|
return error.startsWith("NotFound:");
|
|
16598
16541
|
}
|
|
16599
|
-
function registerDesktopMarketplace(context
|
|
16542
|
+
function registerDesktopMarketplace(context) {
|
|
16600
16543
|
return promise2(async () => {
|
|
16601
16544
|
const codexHome = process.env.CODEX_HOME || join2(context.home, ".codex");
|
|
16602
16545
|
const config = join2(codexHome, "config.toml");
|
|
16603
16546
|
try {
|
|
16604
16547
|
const content = await readOptionalFile(config);
|
|
16605
16548
|
await mkdir2(codexHome, { recursive: true });
|
|
16606
|
-
await writeFile3(config, upsertMarketplaceTable(content
|
|
16549
|
+
await writeFile3(config, upsertMarketplaceTable(content));
|
|
16607
16550
|
} catch (error) {
|
|
16608
16551
|
return {
|
|
16609
16552
|
exitCode: 1,
|
|
@@ -16620,11 +16563,12 @@ function registerDesktopMarketplace(context, marketplacePath) {
|
|
|
16620
16563
|
};
|
|
16621
16564
|
});
|
|
16622
16565
|
}
|
|
16623
|
-
function upsertMarketplaceTable(content
|
|
16566
|
+
function upsertMarketplaceTable(content) {
|
|
16624
16567
|
const header = `[marketplaces.${MARKETPLACE_NAME}]`;
|
|
16625
16568
|
const block = `${header}
|
|
16626
|
-
source_type = "
|
|
16627
|
-
source = ${JSON.stringify(
|
|
16569
|
+
source_type = "git"
|
|
16570
|
+
source = ${JSON.stringify(MARKETPLACE_SOURCE)}
|
|
16571
|
+
ref = "main"
|
|
16628
16572
|
`;
|
|
16629
16573
|
if (content === null)
|
|
16630
16574
|
return block;
|
|
@@ -18369,4 +18313,4 @@ var main = gen2(function* () {
|
|
|
18369
18313
|
}).pipe(provide4(LiveLayers));
|
|
18370
18314
|
runMain2(main);
|
|
18371
18315
|
|
|
18372
|
-
//# debugId=
|
|
18316
|
+
//# debugId=9837A2D60E03644D64756E2164756E21
|