@ouro.bot/cli 0.1.0-alpha.1146 → 0.1.0-alpha.1147

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,12 @@
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.1147",
6
+ "changes": [
7
+ "`ouro up` and `ouro up --latest` now find and install a new release from the GitHub release when npm is blocked on your network or its feed lags behind, instead of skipping the update with \"registry unavailable\". They ask npmjs, your configured npm feed and GitHub, and install from whichever serves the newest version, and say which sources failed when none answers."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1146",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1146",
2
+ "runtimeVersion": "0.1.0-alpha.1147",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1146</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1147</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -238,29 +238,8 @@ function defaultReadRecentDaemonLogLines(lines = 10) {
238
238
  }
239
239
  return recentLines.slice(-lines).map((line) => (0, log_tailer_1.formatLogLine)(line));
240
240
  }
241
- /* v8 ignore start -- CLI npm registry fetch wrapper: integration code @preserve */
242
- async function defaultFetchCliRegistryJson(timeoutMs) {
243
- const controller = new AbortController();
244
- const timeoutId = setTimeout(() => {
245
- controller.abort();
246
- }, timeoutMs);
247
- try {
248
- const res = await fetch("https://registry.npmjs.org/@ouro.bot/cli", {
249
- signal: controller.signal,
250
- });
251
- return res.json();
252
- }
253
- catch (error) {
254
- if (error instanceof Error && error.name === "AbortError") {
255
- throw new Error(`update check timed out after ${Math.max(1, Math.round(timeoutMs / 1000))}s`);
256
- }
257
- throw error;
258
- }
259
- finally {
260
- clearTimeout(timeoutId);
261
- }
262
- }
263
- /* v8 ignore stop */
241
+ /** The last release lookup the update check made, so an install tries the same sources. */
242
+ let lastReleaseLookup = null;
264
243
  function defaultSleep(ms) {
265
244
  return new Promise((resolve) => setTimeout(resolve, ms));
266
245
  }
@@ -878,16 +857,28 @@ function createDefaultOuroCliDeps(socketPath = socket_client_1.DEFAULT_DAEMON_SO
878
857
  },
879
858
  /* v8 ignore stop */
880
859
  /* v8 ignore start -- CLI version management defaults: integration code @preserve */
860
+ // Ask npmjs, the configured npm registry and the signed GitHub release, so a
861
+ // blocked or lagging registry cannot hide a published release.
881
862
  checkForCliUpdate: async () => {
882
863
  const { checkForUpdate } = await Promise.resolve().then(() => __importStar(require("../versioning/update-checker")));
864
+ const { lookupLatestRelease, lookupAsRegistryJson } = await Promise.resolve().then(() => __importStar(require("../versioning/release-sources")));
865
+ const { releaseSourceDeps } = await Promise.resolve().then(() => __importStar(require("../versioning/self-update-defaults")));
883
866
  return checkForUpdate((0, bundle_manifest_1.getPackageVersion)(), {
884
- fetchRegistryJson: () => defaultFetchCliRegistryJson(update_checker_1.CLI_UPDATE_CHECK_TIMEOUT_MS),
867
+ fetchRegistryJson: async () => {
868
+ lastReleaseLookup = await lookupLatestRelease({ ...releaseSourceDeps, lookupTimeoutMs: update_checker_1.CLI_UPDATE_CHECK_TIMEOUT_MS - 500 });
869
+ return lookupAsRegistryJson(lastReleaseLookup);
870
+ },
885
871
  distTag: update_checker_1.CLI_UPDATE_DIST_TAG,
886
872
  });
887
873
  },
888
874
  readVersionIntent: () => (0, version_intent_1.readVersionIntent)(),
889
875
  writeVersionIntent: (intent) => (0, version_intent_1.writeVersionIntent)(intent),
890
- installCliVersion: async (version) => { (0, ouro_version_manager_1.installVersion)(version, {}); },
876
+ installCliVersion: async (version) => {
877
+ const { lookupLatestRelease, installRelease } = await Promise.resolve().then(() => __importStar(require("../versioning/release-sources")));
878
+ const { releaseSourceDeps } = await Promise.resolve().then(() => __importStar(require("../versioning/self-update-defaults")));
879
+ const lookup = lastReleaseLookup ?? await lookupLatestRelease(releaseSourceDeps);
880
+ await installRelease(version, lookup, (0, ouro_version_manager_1.getOuroCliHome)(), releaseSourceDeps);
881
+ },
891
882
  validateCliVersionForActivation: (version) => (0, ouro_version_manager_1.validateInstalledVersionForActivation)(version, {}),
892
883
  activateCliVersion: (version) => {
893
884
  (0, ouro_version_manager_1.activateVersion)(version, {});
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.GITHUB_RELEASE_PUBLISHER = exports.GITHUB_DOWNLOAD_BASE = exports.GITHUB_RELEASES_API = exports.NPMJS_REGISTRY = exports.CLI_PACKAGE = void 0;
37
37
  exports.selfUpdateE2eOverrides = selfUpdateE2eOverrides;
38
38
  exports.githubTarballName = githubTarballName;
39
+ exports.lookupAsRegistryJson = lookupAsRegistryJson;
39
40
  exports.lookupLatestRelease = lookupLatestRelease;
40
41
  exports.installRelease = installRelease;
41
42
  const path = __importStar(require("path"));
@@ -69,14 +70,14 @@ function message(error) {
69
70
  return error instanceof Error ? error.message : String(error);
70
71
  }
71
72
  async function askNpmjs(deps) {
72
- const body = await deps.fetchJson(`${exports.NPMJS_REGISTRY}${exports.CLI_PACKAGE.replace("/", "%2f")}`, LOOKUP_TIMEOUT_MS);
73
+ const body = await deps.fetchJson(`${exports.NPMJS_REGISTRY}${exports.CLI_PACKAGE.replace("/", "%2f")}`, deps.lookupTimeoutMs ?? LOOKUP_TIMEOUT_MS);
73
74
  const version = body?.["dist-tags"]?.latest;
74
75
  if (typeof version !== "string")
75
76
  throw new Error("registry response has no latest dist-tag");
76
77
  return { source: "npmjs", version };
77
78
  }
78
79
  async function askConfiguredRegistry(deps) {
79
- const stdout = await deps.execFile("npm", ["view", exports.CLI_PACKAGE, "dist-tags.latest", "--json"], { timeoutMs: LOOKUP_TIMEOUT_MS });
80
+ const stdout = await deps.execFile("npm", ["view", exports.CLI_PACKAGE, "dist-tags.latest", "--json"], { timeoutMs: deps.lookupTimeoutMs ?? LOOKUP_TIMEOUT_MS });
80
81
  const version = JSON.parse(stdout.trim());
81
82
  if (typeof version !== "string")
82
83
  throw new Error("npm view returned no latest dist-tag");
@@ -84,7 +85,7 @@ async function askConfiguredRegistry(deps) {
84
85
  }
85
86
  async function askGithub(deps) {
86
87
  const github = deps.github ?? { apiUrl: exports.GITHUB_RELEASES_API, downloadBase: exports.GITHUB_DOWNLOAD_BASE };
87
- const releases = await deps.fetchJson(github.apiUrl, LOOKUP_TIMEOUT_MS);
88
+ const releases = await deps.fetchJson(github.apiUrl, deps.lookupTimeoutMs ?? LOOKUP_TIMEOUT_MS);
88
89
  if (!Array.isArray(releases))
89
90
  throw new Error("GitHub releases response is not a list");
90
91
  let best = null;
@@ -110,6 +111,17 @@ async function askGithub(deps) {
110
111
  throw new Error(`no GitHub release published by ${exports.GITHUB_RELEASE_PUBLISHER} carries an npm tarball`);
111
112
  return best;
112
113
  }
114
+ /**
115
+ * The update check reads a registry-shaped document. When no source answered,
116
+ * say so in words the `ouro up` phase summary maps to "registry unavailable".
117
+ */
118
+ function lookupAsRegistryJson(lookup) {
119
+ if (!lookup.latestVersion) {
120
+ const detail = lookup.answers.map((answer) => `${answer.source}: ${answer.error}`).join("; ");
121
+ throw new Error(`registry unavailable (${detail})`);
122
+ }
123
+ return { "dist-tags": { latest: lookup.latestVersion } };
124
+ }
113
125
  async function lookupLatestRelease(deps) {
114
126
  const asks = [
115
127
  ["npmjs", () => askNpmjs(deps)],
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1146",
3
+ "version": "0.1.0-alpha.1147",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1146",
9
+ "version": "0.1.0-alpha.1147",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@ouro.bot/friends": "0.1.0-alpha.18",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1146",
3
+ "version": "0.1.0-alpha.1147",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },