@aerovato/operator-helper 1.3.0 → 1.3.1
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 +124 -99
- package/package.json +3 -2
- package/dist/index.js.map +0 -227
package/dist/index.js
CHANGED
|
@@ -17998,7 +17998,7 @@ var Uint8Array2 = /* @__PURE__ */ instanceOf(globalThis.Uint8Array, {
|
|
|
17998
17998
|
// package.json
|
|
17999
17999
|
var package_default = {
|
|
18000
18000
|
name: "@aerovato/operator-helper",
|
|
18001
|
-
version: "1.3.
|
|
18001
|
+
version: "1.3.1",
|
|
18002
18002
|
description: "Installation and setup CLI for Operator Memory",
|
|
18003
18003
|
license: "BSD-3-Clause",
|
|
18004
18004
|
author: "Aerovato Research",
|
|
@@ -18025,7 +18025,8 @@ var package_default = {
|
|
|
18025
18025
|
node: ">=20"
|
|
18026
18026
|
},
|
|
18027
18027
|
files: [
|
|
18028
|
-
"dist"
|
|
18028
|
+
"dist",
|
|
18029
|
+
"!dist/*.map"
|
|
18029
18030
|
],
|
|
18030
18031
|
keywords: [
|
|
18031
18032
|
"opencode",
|
|
@@ -20328,95 +20329,10 @@ var userStatus = fn2("userStatus")(function* (context) {
|
|
|
20328
20329
|
`) };
|
|
20329
20330
|
});
|
|
20330
20331
|
|
|
20331
|
-
// src/
|
|
20332
|
-
|
|
20333
|
-
|
|
20334
|
-
|
|
20335
|
-
|
|
20336
|
-
${renderTable([
|
|
20337
|
-
["help", "Show help for operator-helper"],
|
|
20338
|
-
["version", "Show the installed version"],
|
|
20339
|
-
["operator-helper install codex", "Install or update the Codex plugin"],
|
|
20340
|
-
["operator-helper install opencode", "Install or update the OpenCode plugin"],
|
|
20341
|
-
["operator-helper install opencode-v2", "Install or update the OpenCode V2 plugin"],
|
|
20342
|
-
["operator-helper install pi", "Install or update the Pi plugin"],
|
|
20343
|
-
["operator-helper install code-puppy", "Install or update the Code Puppy plugin"]
|
|
20344
|
-
])}
|
|
20345
|
-
|
|
20346
|
-
AGENT COMMANDS
|
|
20347
|
-
|
|
20348
|
-
${renderTable([
|
|
20349
|
-
["operator-helper user status", "Show User Partition status"],
|
|
20350
|
-
["operator-helper user init", "Initialize User Partition core files without overwriting content"],
|
|
20351
|
-
["operator-helper user guide", "Print the agent guide for completing User Setup"],
|
|
20352
|
-
[
|
|
20353
|
-
"operator-helper project status",
|
|
20354
|
-
"Show Project Private, Shared, Git ignore, and tracking status"
|
|
20355
|
-
],
|
|
20356
|
-
["operator-helper project init", "Initialize project partitions and global Git ignore"],
|
|
20357
|
-
["operator-helper project guide", "Print the agent guide for completing Project Setup"],
|
|
20358
|
-
["operator-helper index status", "Show Private and Shared main Project Index status"],
|
|
20359
|
-
["operator-helper index guide", "Print the agent guide for building or refreshing indexes"],
|
|
20360
|
-
["operator-helper index lint", "Check Project Index structure and frontmatter"],
|
|
20361
|
-
["operator-helper memory check", "Check that all Operator memory can be loaded"],
|
|
20362
|
-
["operator-helper preamble", "Render the Operator preamble"]
|
|
20363
|
-
])}`;
|
|
20364
|
-
function runCli(arguments_, context) {
|
|
20365
|
-
return gen2(function* () {
|
|
20366
|
-
if (arguments_.length === 1 && arguments_[0] === "help") {
|
|
20367
|
-
return { exitCode: 0, output: HELP };
|
|
20368
|
-
}
|
|
20369
|
-
if (arguments_.length === 1 && arguments_[0] === "version") {
|
|
20370
|
-
return { exitCode: 0, output: context.version };
|
|
20371
|
-
}
|
|
20372
|
-
if (arguments_.length === 1 && arguments_[0] === "preamble") {
|
|
20373
|
-
return yield* preamble(context);
|
|
20374
|
-
}
|
|
20375
|
-
if (arguments_.length !== 2) {
|
|
20376
|
-
return { exitCode: 2, output: HELP };
|
|
20377
|
-
}
|
|
20378
|
-
const command = `${arguments_[0]} ${arguments_[1]}`;
|
|
20379
|
-
switch (command) {
|
|
20380
|
-
case "user status":
|
|
20381
|
-
return yield* userStatus(context);
|
|
20382
|
-
case "user init":
|
|
20383
|
-
return yield* userInit(context);
|
|
20384
|
-
case "user guide":
|
|
20385
|
-
return yield* userGuide();
|
|
20386
|
-
case "project status":
|
|
20387
|
-
return yield* projectStatus(context);
|
|
20388
|
-
case "project init":
|
|
20389
|
-
return yield* projectInit(context);
|
|
20390
|
-
case "project guide":
|
|
20391
|
-
return yield* projectGuide();
|
|
20392
|
-
case "index status":
|
|
20393
|
-
return yield* indexStatus(context);
|
|
20394
|
-
case "index guide":
|
|
20395
|
-
return yield* indexGuide();
|
|
20396
|
-
case "index lint":
|
|
20397
|
-
return yield* indexLint(context);
|
|
20398
|
-
case "memory check":
|
|
20399
|
-
return yield* memoryCheck(context);
|
|
20400
|
-
case "install codex":
|
|
20401
|
-
return yield* installCodex(context);
|
|
20402
|
-
case "install opencode":
|
|
20403
|
-
return yield* installOpenCode(context);
|
|
20404
|
-
case "install opencode-v2":
|
|
20405
|
-
return yield* installOpenCodeV2(context);
|
|
20406
|
-
case "install pi":
|
|
20407
|
-
return yield* installPi(context);
|
|
20408
|
-
case "install code-puppy":
|
|
20409
|
-
return yield* installCodePuppy(context);
|
|
20410
|
-
default:
|
|
20411
|
-
return {
|
|
20412
|
-
exitCode: 2,
|
|
20413
|
-
output: `Unknown command: ${command}
|
|
20414
|
-
|
|
20415
|
-
${HELP}`
|
|
20416
|
-
};
|
|
20417
|
-
}
|
|
20418
|
-
}).pipe(catch_2((error) => succeed6(fileFailure(error))));
|
|
20419
|
-
}
|
|
20332
|
+
// src/update.ts
|
|
20333
|
+
import { mkdir as mkdir4, readFile as readFile6, writeFile as writeFile5 } from "node:fs/promises";
|
|
20334
|
+
import { realpathSync } from "node:fs";
|
|
20335
|
+
import { dirname as dirname2, join as join6, sep as sep2 } from "node:path";
|
|
20420
20336
|
|
|
20421
20337
|
// src/npm-registry.ts
|
|
20422
20338
|
class NpmRegistryError extends TaggedError2("NpmRegistryError") {
|
|
@@ -20454,9 +20370,6 @@ var NpmRegistry;
|
|
|
20454
20370
|
})(NpmRegistry ||= {});
|
|
20455
20371
|
|
|
20456
20372
|
// src/update.ts
|
|
20457
|
-
import { mkdir as mkdir4, readFile as readFile6, writeFile as writeFile5 } from "node:fs/promises";
|
|
20458
|
-
import { realpathSync } from "node:fs";
|
|
20459
|
-
import { dirname as dirname2, join as join6, sep as sep2 } from "node:path";
|
|
20460
20373
|
var HELPER_PACKAGE = "@aerovato/operator-helper";
|
|
20461
20374
|
var UPDATE_TIMEOUT = "60 seconds";
|
|
20462
20375
|
var SUCCESS_COOLDOWN = 60 * 60 * 1000;
|
|
@@ -20475,8 +20388,8 @@ function updateCheckPath(context) {
|
|
|
20475
20388
|
const cache = process.env.XDG_CACHE_HOME || join6(context.home, ".cache");
|
|
20476
20389
|
return join6(cache, "operator", "helper-update.json");
|
|
20477
20390
|
}
|
|
20478
|
-
var autoUpdate = fn2("autoUpdate")(function* (currentVersion, context) {
|
|
20479
|
-
const cached = yield* promise2(() => readUpdateCheck(context));
|
|
20391
|
+
var autoUpdate = fn2("autoUpdate")(function* (currentVersion, context, bypassCache) {
|
|
20392
|
+
const cached = bypassCache ? null : yield* promise2(() => readUpdateCheck(context));
|
|
20480
20393
|
if (cached !== null && isFresh(cached)) {
|
|
20481
20394
|
if (cached.status === "unknown") {
|
|
20482
20395
|
return { status: "unknown", latest: cached.latest };
|
|
@@ -20511,7 +20424,7 @@ var autoUpdate = fn2("autoUpdate")(function* (currentVersion, context) {
|
|
|
20511
20424
|
const execution = yield* run3(spawner, command).pipe(timeout2(UPDATE_TIMEOUT), option2);
|
|
20512
20425
|
if (isSome2(execution) && execution.value.exitCode === 0) {
|
|
20513
20426
|
yield* promise2(() => writeUpdateCheck(context, { checkedAt: Date.now(), status: "current" }));
|
|
20514
|
-
return { status: "updated" };
|
|
20427
|
+
return { status: "updated", latest: latest.value };
|
|
20515
20428
|
}
|
|
20516
20429
|
yield* promise2(() => writeUpdateCheck(context, { checkedAt: Date.now(), status: "failed" }));
|
|
20517
20430
|
return { status: "failed" };
|
|
@@ -20595,6 +20508,118 @@ function parseVersion(value) {
|
|
|
20595
20508
|
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
20596
20509
|
}
|
|
20597
20510
|
|
|
20511
|
+
// src/commands/upgrade.ts
|
|
20512
|
+
var upgrade = fn2("upgrade")(function* (context) {
|
|
20513
|
+
const result = yield* autoUpdate(context.version, context, true);
|
|
20514
|
+
switch (result.status) {
|
|
20515
|
+
case "current":
|
|
20516
|
+
return { exitCode: 0, output: `Operator Helper ${context.version} is up to date.` };
|
|
20517
|
+
case "updated":
|
|
20518
|
+
return { exitCode: 0, output: `Operator Helper updated to ${result.latest}.` };
|
|
20519
|
+
case "unknown":
|
|
20520
|
+
return {
|
|
20521
|
+
exitCode: 1,
|
|
20522
|
+
output: `Operator Helper ${result.latest} is available, but the update could not determine whether Bun or npm owns this installation. Update operator-helper manually using the original installation method.`
|
|
20523
|
+
};
|
|
20524
|
+
case "failed":
|
|
20525
|
+
return { exitCode: 1, output: "Operator Helper update failed." };
|
|
20526
|
+
}
|
|
20527
|
+
});
|
|
20528
|
+
|
|
20529
|
+
// src/cli.ts
|
|
20530
|
+
var HELP = `Operator Helper
|
|
20531
|
+
|
|
20532
|
+
USER COMMANDS
|
|
20533
|
+
|
|
20534
|
+
${renderTable([
|
|
20535
|
+
["help", "Show help for operator-helper"],
|
|
20536
|
+
["version", "Show the installed version"],
|
|
20537
|
+
["upgrade", "Update Operator Helper to the latest release"],
|
|
20538
|
+
["operator-helper install codex", "Install or update the Codex plugin"],
|
|
20539
|
+
["operator-helper install opencode", "Install or update the OpenCode plugin"],
|
|
20540
|
+
["operator-helper install opencode-v2", "Install or update the OpenCode V2 plugin"],
|
|
20541
|
+
["operator-helper install pi", "Install or update the Pi plugin"],
|
|
20542
|
+
["operator-helper install code-puppy", "Install or update the Code Puppy plugin"]
|
|
20543
|
+
])}
|
|
20544
|
+
|
|
20545
|
+
AGENT COMMANDS
|
|
20546
|
+
|
|
20547
|
+
${renderTable([
|
|
20548
|
+
["operator-helper user status", "Show User Partition status"],
|
|
20549
|
+
["operator-helper user init", "Initialize User Partition core files without overwriting content"],
|
|
20550
|
+
["operator-helper user guide", "Print the agent guide for completing User Setup"],
|
|
20551
|
+
[
|
|
20552
|
+
"operator-helper project status",
|
|
20553
|
+
"Show Project Private, Shared, Git ignore, and tracking status"
|
|
20554
|
+
],
|
|
20555
|
+
["operator-helper project init", "Initialize project partitions and global Git ignore"],
|
|
20556
|
+
["operator-helper project guide", "Print the agent guide for completing Project Setup"],
|
|
20557
|
+
["operator-helper index status", "Show Private and Shared main Project Index status"],
|
|
20558
|
+
["operator-helper index guide", "Print the agent guide for building or refreshing indexes"],
|
|
20559
|
+
["operator-helper index lint", "Check Project Index structure and frontmatter"],
|
|
20560
|
+
["operator-helper memory check", "Check that all Operator memory can be loaded"],
|
|
20561
|
+
["operator-helper preamble", "Render the Operator preamble"]
|
|
20562
|
+
])}`;
|
|
20563
|
+
function runCli(arguments_, context) {
|
|
20564
|
+
return gen2(function* () {
|
|
20565
|
+
if (arguments_.length === 1 && arguments_[0] === "help") {
|
|
20566
|
+
return { exitCode: 0, output: HELP };
|
|
20567
|
+
}
|
|
20568
|
+
if (arguments_.length === 1 && arguments_[0] === "version") {
|
|
20569
|
+
return { exitCode: 0, output: context.version };
|
|
20570
|
+
}
|
|
20571
|
+
if (arguments_.length === 1 && arguments_[0] === "preamble") {
|
|
20572
|
+
return yield* preamble(context);
|
|
20573
|
+
}
|
|
20574
|
+
if (arguments_.length === 1 && arguments_[0] === "upgrade") {
|
|
20575
|
+
return yield* upgrade(context);
|
|
20576
|
+
}
|
|
20577
|
+
if (arguments_.length !== 2) {
|
|
20578
|
+
return { exitCode: 2, output: HELP };
|
|
20579
|
+
}
|
|
20580
|
+
const command = `${arguments_[0]} ${arguments_[1]}`;
|
|
20581
|
+
switch (command) {
|
|
20582
|
+
case "user status":
|
|
20583
|
+
return yield* userStatus(context);
|
|
20584
|
+
case "user init":
|
|
20585
|
+
return yield* userInit(context);
|
|
20586
|
+
case "user guide":
|
|
20587
|
+
return yield* userGuide();
|
|
20588
|
+
case "project status":
|
|
20589
|
+
return yield* projectStatus(context);
|
|
20590
|
+
case "project init":
|
|
20591
|
+
return yield* projectInit(context);
|
|
20592
|
+
case "project guide":
|
|
20593
|
+
return yield* projectGuide();
|
|
20594
|
+
case "index status":
|
|
20595
|
+
return yield* indexStatus(context);
|
|
20596
|
+
case "index guide":
|
|
20597
|
+
return yield* indexGuide();
|
|
20598
|
+
case "index lint":
|
|
20599
|
+
return yield* indexLint(context);
|
|
20600
|
+
case "memory check":
|
|
20601
|
+
return yield* memoryCheck(context);
|
|
20602
|
+
case "install codex":
|
|
20603
|
+
return yield* installCodex(context);
|
|
20604
|
+
case "install opencode":
|
|
20605
|
+
return yield* installOpenCode(context);
|
|
20606
|
+
case "install opencode-v2":
|
|
20607
|
+
return yield* installOpenCodeV2(context);
|
|
20608
|
+
case "install pi":
|
|
20609
|
+
return yield* installPi(context);
|
|
20610
|
+
case "install code-puppy":
|
|
20611
|
+
return yield* installCodePuppy(context);
|
|
20612
|
+
default:
|
|
20613
|
+
return {
|
|
20614
|
+
exitCode: 2,
|
|
20615
|
+
output: `Unknown command: ${command}
|
|
20616
|
+
|
|
20617
|
+
${HELP}`
|
|
20618
|
+
};
|
|
20619
|
+
}
|
|
20620
|
+
}).pipe(catch_2((error) => succeed6(fileFailure(error))));
|
|
20621
|
+
}
|
|
20622
|
+
|
|
20598
20623
|
// src/index.ts
|
|
20599
20624
|
var SKIP_UPDATE_ENVIRONMENT_VARIABLE = "OPERATOR_HELPER_SKIP_UPDATE";
|
|
20600
20625
|
var ChildProcessLayer = layer.pipe(provide2(layer3), provide2(layer5));
|
|
@@ -20608,7 +20633,7 @@ var main = gen2(function* () {
|
|
|
20608
20633
|
version: package_default.version
|
|
20609
20634
|
};
|
|
20610
20635
|
if (process.env[SKIP_UPDATE_ENVIRONMENT_VARIABLE] !== "1") {
|
|
20611
|
-
const update = yield* autoUpdate(package_default.version, environment);
|
|
20636
|
+
const update = yield* autoUpdate(package_default.version, environment, false);
|
|
20612
20637
|
if (update.status === "updated") {
|
|
20613
20638
|
const entrypoint = process.argv[1];
|
|
20614
20639
|
if (entrypoint !== undefined) {
|
|
@@ -20637,4 +20662,4 @@ var main = gen2(function* () {
|
|
|
20637
20662
|
}).pipe(provide4(LiveLayers));
|
|
20638
20663
|
runMain2(main);
|
|
20639
20664
|
|
|
20640
|
-
//# debugId=
|
|
20665
|
+
//# debugId=F79207A63C841C4D64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aerovato/operator-helper",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Installation and setup CLI for Operator Memory",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"author": "Aerovato Research",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"node": ">=20"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist"
|
|
30
|
+
"dist",
|
|
31
|
+
"!dist/*.map"
|
|
31
32
|
],
|
|
32
33
|
"keywords": [
|
|
33
34
|
"opencode",
|