deepmodebot 0.9.0 → 0.9.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.
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "deepmodebot: rigorous agent engineering for omp, Claude Code, Codex, and Google Antigravity",
9
- "version": "0.9.0"
9
+ "version": "0.9.1"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "deepmodebot",
14
14
  "source": "./plugins/deepmodebot",
15
15
  "description": "Rigorous agent engineering mode for omp, Claude Code, Codex, and Google Antigravity: /deep routes tasks to playbooks, enforces Full-Scope Completion, SME-in-the-loop incremental sprints, model/rate-limit resilience, root containment, real-app proof, and verifier-gated PR review.",
16
- "version": "0.9.0",
16
+ "version": "0.9.1",
17
17
  "license": "MIT",
18
18
  "category": "development",
19
19
  "tags": [
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "deepmodebot: rigorous agent engineering for omp, Claude Code, Codex, and Google Antigravity",
9
- "version": "0.9.0"
9
+ "version": "0.9.1"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "deepmodebot",
14
14
  "source": "./plugins/deepmodebot",
15
15
  "description": "Rigorous agent engineering mode for omp, Claude Code, Codex, and Google Antigravity: /deep routes tasks to playbooks, enforces Full-Scope Completion, SME-in-the-loop incremental sprints, model/rate-limit resilience, root containment, real-app proof, and verifier-gated PR review.",
16
- "version": "0.9.0",
16
+ "version": "0.9.1",
17
17
  "license": "MIT",
18
18
  "category": "development",
19
19
  "tags": [
@@ -5,7 +5,8 @@ import { createInterface } from "node:readline/promises";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { disableAutoUpdate, enableAutoUpdate } from "../lib/autoupdate.mjs";
7
7
  import { CLIENTS, clientById } from "../lib/clients.mjs";
8
- import { run, which } from "../lib/run.mjs";
8
+ import { parseJson, run, which } from "../lib/run.mjs";
9
+ import { upgradeDecision } from "../lib/version.mjs";
9
10
  import { clearState, log, readState, withLock, writeState } from "../lib/state.mjs";
10
11
 
11
12
  const PKG = "deepmodebot";
@@ -142,12 +143,28 @@ function update() {
142
143
  console.log("Nothing configured yet. Run: npx deepmodebot@latest setup");
143
144
  return 1;
144
145
  }
145
- const outcome = withLock(() => {
146
+ // The hand-off child runs while its parent holds the lock; it must not wait on that lock.
147
+ const lockHeld = flag("no-self-update") && process.env.DEEPMODEBOT_LOCK_HELD === "1";
148
+ const outcome = (lockHeld ? (fn) => fn() : withLock)(() => {
146
149
  if (!flag("no-self-update")) {
147
- const r = npm(["install", "-g", `${PKG}@latest`]);
148
- if (r.code !== 0) {
149
- log(`npm install -g ${PKG}@latest failed: ${r.out.slice(-300)}`);
150
- say(`npm upgrade failed; re-syncing ${version} anyway`);
150
+ // Read the registry's latest manifest first and install only a stable, newer release that ships
151
+ // the command: npm's first-publish placeholder (0.0.0-stage, no bin) once replaced a working install.
152
+ const view = npm(["view", `${PKG}@latest`, "name", "version", "bin", "--json"]);
153
+ const latest = view.code === 0 ? parseJson(view.stdout) : undefined;
154
+ const decision = latest ? upgradeDecision(version, latest) : { install: false, reason: "registry unreachable" };
155
+ if (decision.install) {
156
+ const r = npm(["install", "-g", `${PKG}@${latest.version}`]);
157
+ const root = globalRoot();
158
+ const installedBin = root && join(root, PKG, "bin", "deepmodebot.mjs");
159
+ if (r.code !== 0 || !installedBin || !existsSync(installedBin) || readInstalledVersion(root) !== latest.version) {
160
+ log(`upgrade to ${latest.version} failed or left no command; restoring ${version}: ${r.out.slice(-200)}`);
161
+ npm(["install", "-g", `${PKG}@${version}`]);
162
+ say(`npm upgrade failed; kept ${version}`);
163
+ } else {
164
+ log(`upgraded ${decision.reason}`);
165
+ }
166
+ } else {
167
+ say(`no upgrade: ${decision.reason}`);
151
168
  }
152
169
  // Hand off to the freshly installed copy so new client logic runs this sync.
153
170
  const root = globalRoot();
@@ -156,6 +173,7 @@ function update() {
156
173
  const isOtherCopy = fresh && resolve(fresh).toLowerCase() !== resolve(here, "deepmodebot.mjs").toLowerCase();
157
174
  const wasUpgraded = fresh && readInstalledVersion(root) !== version;
158
175
  if (isOtherCopy || wasUpgraded) {
176
+ process.env.DEEPMODEBOT_LOCK_HELD = "1";
159
177
  const r2 = run(process.execPath, [fresh, "update", "--no-self-update", ...(quiet ? ["--quiet"] : [])]);
160
178
  if (!quiet) console.log(r2.out);
161
179
  return { code: r2.code };
@@ -0,0 +1,26 @@
1
+ /** Parse a plain release version "1.2.3"; a prerelease ("0.0.0-stage") or anything else is undefined. */
2
+ export function parseRelease(v) {
3
+ const m = /^(\d+)\.(\d+)\.(\d+)$/.exec(String(v ?? "").trim());
4
+ return m ? m.slice(1, 4).map(Number) : undefined;
5
+ }
6
+
7
+ function compare(a, b) {
8
+ for (let i = 0; i < 3; i += 1) if (a[i] !== b[i]) return a[i] - b[i];
9
+ return 0;
10
+ }
11
+
12
+ /**
13
+ * Decide whether `update` may install the registry's latest manifest over the running version.
14
+ * Only a stable release, newer than the current one, that ships the deepmodebot command. A placeholder
15
+ * (npm's first-publish "0.0.0-stage" had no bin) or a downgrade is refused, so the hourly task can never
16
+ * replace a working install with something that has no command.
17
+ */
18
+ export function upgradeDecision(current, latest, bin = "deepmodebot") {
19
+ const want = parseRelease(latest?.version);
20
+ if (!want) return { install: false, reason: `latest is ${latest?.version ?? "unknown"}, not a release` };
21
+ const have = parseRelease(current);
22
+ if (have && compare(want, have) <= 0) return { install: false, reason: `already ${current}` };
23
+ const bins = typeof latest.bin === "string" ? { [latest.name ?? bin]: latest.bin } : latest.bin ?? {};
24
+ if (!bins[bin]) return { install: false, reason: `${latest.version} has no ${bin} command` };
25
+ return { install: true, reason: `${current} -> ${latest.version}` };
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepmodebot",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Install and auto-update the deepmodebot plugin in Claude Code, omp, Codex, and Google Antigravity from one npm package.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
3
  "name": "deepmodebot",
4
4
  "displayName": "deepmodebot",
5
- "version": "0.9.0",
5
+ "version": "0.9.1",
6
6
  "description": "Rigorous agent engineering mode (/deep) for Google Antigravity, omp, Claude Code, and Codex: routes tasks to playbooks, enforces Full-Scope Completion, SME-in-the-loop incremental sprints, model/rate-limit resilience, root containment, real-app proof, and verifier-gated PR review.",
7
7
  "logo": "assets/logo.svg",
8
8
  "skills": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepmodebot",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Rigorous agent engineering mode for omp, Claude Code, Codex, and Google Antigravity: /deep routes tasks to playbooks, enforces Full-Scope Completion, SME-in-the-loop incremental sprints, model/rate-limit resilience, root containment, real-app proof, and verifier-gated PR review.",
5
5
  "author": {
6
6
  "name": "Timothy Vang",