totemlayer 0.1.44 → 0.1.59

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.
Files changed (41) hide show
  1. package/README.md +48 -11
  2. package/bin/agent-memory.mjs +244 -0
  3. package/bin/agent-profile.mjs +26 -4
  4. package/bin/agent-runner.mjs +43 -9
  5. package/bin/agent-setup.mjs +136 -50
  6. package/bin/automatic-runtime.mjs +26 -7
  7. package/bin/chat-prompt-limit.mjs +67 -0
  8. package/bin/codex-chat-bridge.mjs +36 -8
  9. package/bin/codex-chat-readiness.mjs +7 -0
  10. package/bin/codex-human-chat-bridge.mjs +209 -0
  11. package/bin/collaboration-listener.mjs +2 -1
  12. package/bin/connected-agent-service.mjs +4 -1
  13. package/bin/inbox-queue.mjs +2 -1
  14. package/bin/installation.mjs +92 -60
  15. package/bin/local-mcp.mjs +43 -4
  16. package/bin/mcp-config.d.mts +11 -0
  17. package/bin/mcp-config.mjs +56 -0
  18. package/bin/mcp-install.mjs +143 -12
  19. package/bin/mcp-listener.d.mts +22 -0
  20. package/bin/mcp-listener.mjs +4 -0
  21. package/bin/mcp-runtime.mjs +3 -1
  22. package/bin/mcp.mjs +331 -94
  23. package/bin/mission-agent-service.mjs +2 -1
  24. package/bin/mission-worker.mjs +13 -2
  25. package/bin/model-adapter.mjs +1 -4
  26. package/bin/network-contract.mjs +254 -0
  27. package/bin/network-runtime.mjs +160 -25
  28. package/bin/network.mjs +30 -5
  29. package/bin/platform-client.mjs +25 -3
  30. package/bin/provider-detection.mjs +1 -4
  31. package/bin/runtime-diagnostics.mjs +1 -0
  32. package/bin/sdk/index.d.ts +50 -6
  33. package/bin/sdk/index.js +1 -1
  34. package/bin/sdk/listener.d.ts +57 -0
  35. package/bin/sdk/listener.js +1 -0
  36. package/bin/sdk/types.d.ts +62 -0
  37. package/bin/startup-diagnostics.mjs +168 -0
  38. package/bin/totem.mjs +17 -3
  39. package/bin/worker-core/adapters.mjs +4 -4
  40. package/package.json +1 -1
  41. package/scripts/prepare.mjs +28 -8
@@ -127,8 +127,8 @@ export function createCommandAdapter(config) {
127
127
  windowsHide: true,
128
128
  stdio: ["pipe", "pipe", "pipe"],
129
129
  });
130
- } catch {
131
- reject(new WorkerError("AGENT_START_FAILED"));
130
+ } catch (error) {
131
+ reject(Object.assign(new WorkerError("AGENT_START_FAILED"), { cause: error }));
132
132
  return;
133
133
  }
134
134
  const timeout = setTimeout(() => stop("RUN_TIMEOUT"), timeoutMs);
@@ -149,8 +149,8 @@ export function createCommandAdapter(config) {
149
149
  child.stdin.on("error", () => {
150
150
  /* A failed child can close stdin early. */
151
151
  });
152
- child.on("error", () => {
153
- failure ??= new WorkerError("AGENT_START_FAILED");
152
+ child.on("error", (error) => {
153
+ failure ??= Object.assign(new WorkerError("AGENT_START_FAILED"), { cause: error });
154
154
  });
155
155
  child.on("close", (code) => {
156
156
  clearTimeout(timeout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totemlayer",
3
- "version": "0.1.44",
3
+ "version": "0.1.59",
4
4
  "description": "Cross-platform CLI for TotemLayer agent identity and authorization",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,13 +1,27 @@
1
1
  import { access, readdir, readFile, writeFile } from "node:fs/promises";
2
2
  import { transform } from "esbuild";
3
+ import { generateNetworkContract } from "../../../scripts/generate-network-contract.mjs";
4
+ await generateNetworkContract();
3
5
  // This candidate rebases coordination on the immutable published 0.1.21 bundle.
4
6
  // Its bundled SDK is the release source; do not rebuild it from an older sibling checkout.
5
7
  for (const name of [
6
- "totem.mjs", "mission-worker.mjs", "mission-coordination.mjs",
7
- "sdk/index.js", "sdk/index.d.ts", "sdk/types.d.ts",
8
- "network-retry.mjs", "runtime-diagnostics.mjs", "codex-chat-bridge.mjs",
9
- "worker-core/adapters.mjs", "worker-core/errors.mjs",
10
- ]) await access(new URL(`../bin/${name}`, import.meta.url));
8
+ "totem.mjs",
9
+ "mission-worker.mjs",
10
+ "mission-coordination.mjs",
11
+ "sdk/index.js",
12
+ "sdk/index.d.ts",
13
+ "sdk/listener.js",
14
+ "sdk/listener.d.ts",
15
+ "sdk/types.d.ts",
16
+ "network-retry.mjs",
17
+ "runtime-diagnostics.mjs",
18
+ "codex-chat-bridge.mjs",
19
+ "codex-human-chat-bridge.mjs",
20
+ "chat-prompt-limit.mjs",
21
+ "worker-core/adapters.mjs",
22
+ "worker-core/errors.mjs",
23
+ ])
24
+ await access(new URL(`../bin/${name}`, import.meta.url));
11
25
 
12
26
  // Compact the release SDK without rebuilding it from an older sibling source.
13
27
  // Retain every module, export, name and declaration; no feature code is removed.
@@ -16,9 +30,15 @@ for (const name of await readdir(sdk)) {
16
30
  if (!name.endsWith(".js")) continue;
17
31
  const path = new URL(name, sdk);
18
32
  const result = await transform(await readFile(path, "utf8"), {
19
- loader: "js", target: "es2022", format: "esm",
20
- minifyWhitespace: true, minifyIdentifiers: false, minifySyntax: false,
21
- treeShaking: false, keepNames: false, legalComments: "eof",
33
+ loader: "js",
34
+ target: "es2022",
35
+ format: "esm",
36
+ minifyWhitespace: true,
37
+ minifyIdentifiers: false,
38
+ minifySyntax: false,
39
+ treeShaking: false,
40
+ keepNames: false,
41
+ legalComments: "eof",
22
42
  });
23
43
  await writeFile(path, result.code);
24
44
  }