@ouro.bot/cli 0.1.0-alpha.28 → 0.1.0-alpha.29
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/changelog.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.29",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Running `ouro up` now force-syncs the global `ouro.bot` wrapper so bare `npx ouro.bot` stops getting hijacked by stale global CLI bins and lands back on the intended latest runtime.",
|
|
8
|
+
"Bootstrap repair is now explicit about reclaiming the `ouro.bot` command from old global installs, which makes repeated bootstrap runs more trustworthy on machines with prior experimental installs."
|
|
9
|
+
]
|
|
10
|
+
},
|
|
4
11
|
{
|
|
5
12
|
"version": "0.1.0-alpha.28",
|
|
6
13
|
"changes": [
|
|
@@ -60,6 +60,7 @@ const agent_discovery_1 = require("./agent-discovery");
|
|
|
60
60
|
const update_hooks_1 = require("./update-hooks");
|
|
61
61
|
const bundle_meta_1 = require("./hooks/bundle-meta");
|
|
62
62
|
const bundle_manifest_1 = require("../../mind/bundle-manifest");
|
|
63
|
+
const ouro_bot_global_installer_1 = require("./ouro-bot-global-installer");
|
|
63
64
|
function stringField(value) {
|
|
64
65
|
return typeof value === "string" ? value : null;
|
|
65
66
|
}
|
|
@@ -887,6 +888,7 @@ function createDefaultOuroCliDeps(socketPath = "/tmp/ouroboros-daemon.sock") {
|
|
|
887
888
|
runAdoptionSpecialist: defaultRunAdoptionSpecialist,
|
|
888
889
|
registerOuroBundleType: ouro_uti_1.registerOuroBundleUti,
|
|
889
890
|
installOuroCommand: ouro_path_installer_1.installOuroCommand,
|
|
891
|
+
syncGlobalOuroBotWrapper: ouro_bot_global_installer_1.syncGlobalOuroBotWrapper,
|
|
890
892
|
/* v8 ignore next 3 -- integration: launches interactive CLI session @preserve */
|
|
891
893
|
startChat: async (agentName) => {
|
|
892
894
|
const { main } = await Promise.resolve().then(() => __importStar(require("../../senses/cli")));
|
|
@@ -964,6 +966,20 @@ async function performSystemSetup(deps) {
|
|
|
964
966
|
});
|
|
965
967
|
}
|
|
966
968
|
}
|
|
969
|
+
if (deps.syncGlobalOuroBotWrapper) {
|
|
970
|
+
try {
|
|
971
|
+
await Promise.resolve(deps.syncGlobalOuroBotWrapper());
|
|
972
|
+
}
|
|
973
|
+
catch (error) {
|
|
974
|
+
(0, runtime_1.emitNervesEvent)({
|
|
975
|
+
level: "warn",
|
|
976
|
+
component: "daemon",
|
|
977
|
+
event: "daemon.system_setup_ouro_bot_wrapper_error",
|
|
978
|
+
message: "failed to sync global ouro.bot wrapper",
|
|
979
|
+
meta: { error: error instanceof Error ? error.message : /* v8 ignore next -- defensive: non-Error catch branch @preserve */ String(error) },
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
}
|
|
967
983
|
// Install subagents (claude/codex skills)
|
|
968
984
|
try {
|
|
969
985
|
await deps.installSubagents();
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.syncGlobalOuroBotWrapper = syncGlobalOuroBotWrapper;
|
|
37
|
+
const child_process_1 = require("child_process");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const runtime_1 = require("../../nerves/runtime");
|
|
41
|
+
const runtime_metadata_1 = require("./runtime-metadata");
|
|
42
|
+
function normalizeOutput(output) {
|
|
43
|
+
return (typeof output === "string" ? output : output.toString("utf-8")).trim();
|
|
44
|
+
}
|
|
45
|
+
function resolveGlobalPrefix(execFileSyncImpl) {
|
|
46
|
+
return normalizeOutput(execFileSyncImpl("npm", ["prefix", "-g"], { encoding: "utf-8" }));
|
|
47
|
+
}
|
|
48
|
+
function resolveGlobalRoot(execFileSyncImpl) {
|
|
49
|
+
return normalizeOutput(execFileSyncImpl("npm", ["root", "-g"], { encoding: "utf-8" }));
|
|
50
|
+
}
|
|
51
|
+
function readInstalledWrapperVersion(globalRoot, existsSyncImpl, readFileSyncImpl) {
|
|
52
|
+
const packageJsonPath = path.join(globalRoot, "ouro.bot", "package.json");
|
|
53
|
+
if (!existsSyncImpl(packageJsonPath))
|
|
54
|
+
return null;
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(readFileSyncImpl(packageJsonPath, "utf-8"));
|
|
57
|
+
return typeof parsed.version === "string" && parsed.version.trim().length > 0 ? parsed.version.trim() : null;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function resolveExecutableOwner(globalPrefix, platform, existsSyncImpl, realpathSyncImpl) {
|
|
64
|
+
const binName = platform === "win32" ? "ouro.bot.cmd" : "ouro.bot";
|
|
65
|
+
const binPath = platform === "win32"
|
|
66
|
+
? path.join(globalPrefix, binName)
|
|
67
|
+
: path.join(globalPrefix, "bin", binName);
|
|
68
|
+
if (!existsSyncImpl(binPath))
|
|
69
|
+
return null;
|
|
70
|
+
try {
|
|
71
|
+
const resolved = realpathSyncImpl(binPath);
|
|
72
|
+
if (resolved.includes(`${path.sep}node_modules${path.sep}ouro.bot${path.sep}`))
|
|
73
|
+
return "wrapper";
|
|
74
|
+
if (resolved.includes(`${path.sep}node_modules${path.sep}@ouro.bot${path.sep}cli${path.sep}`))
|
|
75
|
+
return "cli";
|
|
76
|
+
return "other";
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return "unknown";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function syncGlobalOuroBotWrapper(deps = {}) {
|
|
83
|
+
/* v8 ignore start -- dependency-injection defaults are only exercised in the live runtime */
|
|
84
|
+
const execFileSyncImpl = deps.execFileSync ?? child_process_1.execFileSync;
|
|
85
|
+
const existsSyncImpl = deps.existsSync ?? fs.existsSync;
|
|
86
|
+
const readFileSyncImpl = deps.readFileSync ?? fs.readFileSync;
|
|
87
|
+
const realpathSyncImpl = deps.realpathSync ?? fs.realpathSync;
|
|
88
|
+
const runtimeVersion = deps.runtimeVersion ?? (0, runtime_metadata_1.getRuntimeMetadata)().version;
|
|
89
|
+
const platform = deps.platform ?? process.platform;
|
|
90
|
+
/* v8 ignore stop */
|
|
91
|
+
(0, runtime_1.emitNervesEvent)({
|
|
92
|
+
component: "daemon",
|
|
93
|
+
event: "daemon.ouro_bot_global_sync_start",
|
|
94
|
+
message: "checking global ouro.bot wrapper",
|
|
95
|
+
meta: { version: runtimeVersion },
|
|
96
|
+
});
|
|
97
|
+
const globalPrefix = resolveGlobalPrefix(execFileSyncImpl);
|
|
98
|
+
const globalRoot = resolveGlobalRoot(execFileSyncImpl);
|
|
99
|
+
const installedVersion = readInstalledWrapperVersion(globalRoot, existsSyncImpl, readFileSyncImpl);
|
|
100
|
+
const executableOwner = resolveExecutableOwner(globalPrefix, platform, existsSyncImpl, realpathSyncImpl);
|
|
101
|
+
if (executableOwner === "wrapper") {
|
|
102
|
+
(0, runtime_1.emitNervesEvent)({
|
|
103
|
+
component: "daemon",
|
|
104
|
+
event: "daemon.ouro_bot_global_sync_end",
|
|
105
|
+
message: "global ouro.bot wrapper already current",
|
|
106
|
+
meta: { version: runtimeVersion, installedVersion, executableOwner, installed: false },
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
installed: false,
|
|
110
|
+
version: runtimeVersion,
|
|
111
|
+
installedVersion,
|
|
112
|
+
executableOwner,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
execFileSyncImpl("npm", ["install", "-g", "--force", "ouro.bot@latest"], { stdio: "pipe", encoding: "utf-8" });
|
|
116
|
+
(0, runtime_1.emitNervesEvent)({
|
|
117
|
+
component: "daemon",
|
|
118
|
+
event: "daemon.ouro_bot_global_sync_end",
|
|
119
|
+
message: "global ouro.bot wrapper synced",
|
|
120
|
+
meta: { version: runtimeVersion, installedVersion, executableOwner, installed: true },
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
installed: true,
|
|
124
|
+
version: runtimeVersion,
|
|
125
|
+
installedVersion,
|
|
126
|
+
executableOwner,
|
|
127
|
+
};
|
|
128
|
+
}
|