@ouro.bot/cli 0.1.0-alpha.1547 → 0.1.0-alpha.1549

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,18 @@
1
1
  {
2
2
  "_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1549",
6
+ "changes": [
7
+ "Desk's tools work again for agents on an installed Ouro. Since 0.1.0-alpha.1536, every agent's Desk server exited before it answered: Desk imports TypeScript files, and Node won't run TypeScript under `node_modules`. The daemon now runs the installed Desk from a copy in `~/.cache/ouroboros/desk/<tree>`, made once per Desk release. If the copy can't be made, Desk runs where it is, as before."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1548",
12
+ "changes": [
13
+ "Update the Ouro UI files to Ouro UI v1.3.534."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1547",
6
18
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1547",
2
+ "runtimeVersion": "0.1.0-alpha.1549",
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.1547</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1549</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -37,6 +37,7 @@ exports.OWN_DESK_SERVER = void 0;
37
37
  exports.bundledDeskDir = bundledDeskDir;
38
38
  exports.overrideBundledDeskDirForTests = overrideBundledDeskDirForTests;
39
39
  exports.agentDesks = agentDesks;
40
+ exports.runnableDeskDir = runnableDeskDir;
40
41
  exports.deskMcpServerConfig = deskMcpServerConfig;
41
42
  exports.listDeskMcpServers = listDeskMcpServers;
42
43
  const fs = __importStar(require("fs"));
@@ -97,6 +98,68 @@ function agentDesks(owner, config = owner === undefined ? (0, identity_1.loadAge
97
98
  }
98
99
  return desks;
99
100
  }
101
+ const DESK_STAMP = ".ouro-desk.json";
102
+ const TREE = /^[0-9a-f]{40}$/;
103
+ function stampedTree(dir) {
104
+ try {
105
+ const tree = JSON.parse(fs.readFileSync(path.join(dir, DESK_STAMP), "utf8")).tree;
106
+ return typeof tree === "string" && TREE.test(tree) ? tree : null;
107
+ }
108
+ catch {
109
+ return null;
110
+ }
111
+ }
112
+ /**
113
+ * The folder to run the Desk copy at `deskDir` from. Desk's server imports TypeScript files, and Node refuses to strip
114
+ * types under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING): from an installed package's vendor/desk, the
115
+ * server exits before it answers. So an installed Desk runs from a copy at `<cacheRoot>/<tree>`, named by the tree its
116
+ * stamp records (the cache `scripts/desk-vendor.cjs` keeps), made once and moved into place whole. A copy outside
117
+ * node_modules, or one that can't be stamped or copied, runs where it is.
118
+ */
119
+ function runnableDeskDir(deskDir, cacheRoot = path.join(os.homedir(), ".cache", "ouroboros", "desk"), rename = fs.renameSync) {
120
+ if (!path.resolve(deskDir).split(path.sep).includes("node_modules"))
121
+ return deskDir;
122
+ const tree = stampedTree(deskDir);
123
+ const target = tree === null ? null : path.join(cacheRoot, tree);
124
+ const partial = `${target}.partial-${process.pid}`;
125
+ try {
126
+ if (target === null)
127
+ throw new Error(`${path.join(deskDir, DESK_STAMP)} names no Desk tree`);
128
+ if (stampedTree(target) === tree)
129
+ return target;
130
+ fs.rmSync(partial, { recursive: true, force: true });
131
+ fs.mkdirSync(cacheRoot, { recursive: true });
132
+ fs.cpSync(deskDir, partial, { recursive: true });
133
+ fs.rmSync(target, { recursive: true, force: true });
134
+ rename(partial, target);
135
+ (0, runtime_1.emitNervesEvent)({
136
+ event: "desk.copied_out_of_node_modules",
137
+ component: "repertoire",
138
+ message: "copied the installed Desk outside node_modules, where Node runs its TypeScript",
139
+ meta: { deskDir, target },
140
+ });
141
+ return target;
142
+ }
143
+ catch (error) {
144
+ try {
145
+ fs.rmSync(partial, { recursive: true, force: true });
146
+ }
147
+ catch {
148
+ // A cache root that isn't a folder holds no partial copy.
149
+ }
150
+ // Another daemon process may have moved its own copy into place first.
151
+ if (target !== null && stampedTree(target) === tree)
152
+ return target;
153
+ (0, runtime_1.emitNervesEvent)({
154
+ level: "error",
155
+ event: "desk.copy_failed",
156
+ component: "repertoire",
157
+ message: "couldn't copy the installed Desk outside node_modules; its server may not start",
158
+ meta: { deskDir, target, reason: error instanceof Error ? error.message : String(error) },
159
+ });
160
+ return deskDir;
161
+ }
162
+ }
100
163
  /** The MCP server that serves the desk at `root` from the Desk copy at `deskDir`. */
101
164
  function deskMcpServerConfig(root, deskDir = bundledDeskDir()) {
102
165
  return {
@@ -123,9 +186,10 @@ function listDeskMcpServers(owner, config, deskDir = servingDeskDir(), home = os
123
186
  }
124
187
  const servers = {};
125
188
  const missing = [];
189
+ const runFrom = runnableDeskDir(deskDir, path.join(home, ".cache", "ouroboros", "desk"));
126
190
  for (const desk of agentDesks(owner, config, home)) {
127
191
  if (desk.present)
128
- servers[desk.server] = deskMcpServerConfig(desk.root, deskDir);
192
+ servers[desk.server] = deskMcpServerConfig(desk.root, runFrom);
129
193
  else
130
194
  missing.push(desk.server);
131
195
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1547",
3
+ "version": "0.1.0-alpha.1549",
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.1547",
9
+ "version": "0.1.0-alpha.1549",
10
10
  "bundleDependencies": [
11
11
  "@ouro.bot/friends"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1547",
3
+ "version": "0.1.0-alpha.1549",
4
4
  "description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
5
5
  "homepage": "https://ouroboros.bot/",
6
6
  "engines": {