clawd-automaton 0.1.0 → 0.2.0

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 (175) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +85 -129
  3. package/dist/__tests__/heartbeat.test.js +7 -7
  4. package/dist/__tests__/heartbeat.test.js.map +1 -1
  5. package/dist/__tests__/loop.test.js +15 -15
  6. package/dist/__tests__/loop.test.js.map +1 -1
  7. package/dist/__tests__/mocks.d.ts +2 -2
  8. package/dist/__tests__/mocks.d.ts.map +1 -1
  9. package/dist/__tests__/mocks.js +8 -8
  10. package/dist/__tests__/mocks.js.map +1 -1
  11. package/dist/agent/injection-defense.js +1 -1
  12. package/dist/agent/injection-defense.js.map +1 -1
  13. package/dist/agent/loop.d.ts +2 -3
  14. package/dist/agent/loop.d.ts.map +1 -1
  15. package/dist/agent/loop.js +9 -10
  16. package/dist/agent/loop.js.map +1 -1
  17. package/dist/agent/system-prompt.js +6 -6
  18. package/dist/agent/tools.d.ts.map +1 -1
  19. package/dist/agent/tools.js +60 -130
  20. package/dist/agent/tools.js.map +1 -1
  21. package/dist/automation/index.html +828 -0
  22. package/dist/automation/manifest.json +35 -0
  23. package/dist/config.d.ts +1 -1
  24. package/dist/config.d.ts.map +1 -1
  25. package/dist/config.js +5 -5
  26. package/dist/config.js.map +1 -1
  27. package/dist/{clawd → conway}/backroom.d.ts +1 -1
  28. package/dist/conway/backroom.d.ts.map +1 -0
  29. package/dist/{clawd → conway}/backroom.js +1 -1
  30. package/dist/conway/backroom.js.map +1 -0
  31. package/dist/conway/client.d.ts +16 -0
  32. package/dist/conway/client.d.ts.map +1 -0
  33. package/dist/{clawd → conway}/client.js +9 -8
  34. package/dist/conway/client.js.map +1 -0
  35. package/dist/{clawd → conway}/credits.d.ts +3 -3
  36. package/dist/conway/credits.d.ts.map +1 -0
  37. package/dist/{clawd → conway}/credits.js +3 -3
  38. package/dist/conway/credits.js.map +1 -0
  39. package/dist/{clawd → conway}/deepseek-inference.d.ts +1 -1
  40. package/dist/conway/deepseek-inference.d.ts.map +1 -0
  41. package/dist/{clawd → conway}/deepseek-inference.js +1 -1
  42. package/dist/conway/deepseek-inference.js.map +1 -0
  43. package/dist/{clawd → conway}/inference.d.ts +3 -3
  44. package/dist/conway/inference.d.ts.map +1 -0
  45. package/dist/{clawd → conway}/inference.js +3 -3
  46. package/dist/conway/inference.js.map +1 -0
  47. package/dist/{clawd → conway}/x402.d.ts +1 -1
  48. package/dist/conway/x402.d.ts.map +1 -0
  49. package/dist/{clawd → conway}/x402.js +1 -1
  50. package/dist/conway/x402.js.map +1 -0
  51. package/dist/git/state-versioning.d.ts +8 -8
  52. package/dist/git/state-versioning.d.ts.map +1 -1
  53. package/dist/git/state-versioning.js +19 -19
  54. package/dist/git/state-versioning.js.map +1 -1
  55. package/dist/git/tools.d.ts +9 -9
  56. package/dist/git/tools.d.ts.map +1 -1
  57. package/dist/git/tools.js +17 -17
  58. package/dist/git/tools.js.map +1 -1
  59. package/dist/heartbeat/config.d.ts.map +1 -1
  60. package/dist/heartbeat/config.js +0 -6
  61. package/dist/heartbeat/config.js.map +1 -1
  62. package/dist/heartbeat/daemon.d.ts +2 -2
  63. package/dist/heartbeat/daemon.d.ts.map +1 -1
  64. package/dist/heartbeat/daemon.js +4 -4
  65. package/dist/heartbeat/daemon.js.map +1 -1
  66. package/dist/heartbeat/tasks.d.ts +2 -2
  67. package/dist/heartbeat/tasks.d.ts.map +1 -1
  68. package/dist/heartbeat/tasks.js +7 -68
  69. package/dist/heartbeat/tasks.js.map +1 -1
  70. package/dist/identity/provision.d.ts +3 -4
  71. package/dist/identity/provision.d.ts.map +1 -1
  72. package/dist/identity/provision.js +10 -10
  73. package/dist/identity/provision.js.map +1 -1
  74. package/dist/identity/wallet.d.ts +1 -1
  75. package/dist/identity/wallet.js +1 -1
  76. package/dist/index.d.ts +1 -1
  77. package/dist/index.js +40 -75
  78. package/dist/index.js.map +1 -1
  79. package/dist/portal/generate.d.ts +5 -0
  80. package/dist/portal/generate.d.ts.map +1 -0
  81. package/dist/portal/generate.js +940 -0
  82. package/dist/portal/generate.js.map +1 -0
  83. package/dist/registry/agent-card.d.ts +3 -3
  84. package/dist/registry/agent-card.d.ts.map +1 -1
  85. package/dist/registry/agent-card.js +10 -10
  86. package/dist/registry/agent-card.js.map +1 -1
  87. package/dist/replication/lineage.d.ts +2 -2
  88. package/dist/replication/lineage.d.ts.map +1 -1
  89. package/dist/replication/lineage.js +2 -2
  90. package/dist/replication/lineage.js.map +1 -1
  91. package/dist/replication/spawn.d.ts +7 -7
  92. package/dist/replication/spawn.d.ts.map +1 -1
  93. package/dist/replication/spawn.js +23 -23
  94. package/dist/replication/spawn.js.map +1 -1
  95. package/dist/self-mod/code.d.ts +2 -2
  96. package/dist/self-mod/code.d.ts.map +1 -1
  97. package/dist/self-mod/code.js +5 -5
  98. package/dist/self-mod/code.js.map +1 -1
  99. package/dist/self-mod/tools-manager.d.ts +3 -3
  100. package/dist/self-mod/tools-manager.d.ts.map +1 -1
  101. package/dist/self-mod/tools-manager.js +3 -3
  102. package/dist/self-mod/tools-manager.js.map +1 -1
  103. package/dist/setup/banner.js +12 -12
  104. package/dist/setup/defaults.js +9 -9
  105. package/dist/setup/defaults.js.map +1 -1
  106. package/dist/setup/environment.js +5 -5
  107. package/dist/setup/environment.js.map +1 -1
  108. package/dist/setup/wizard.js +8 -8
  109. package/dist/setup/wizard.js.map +1 -1
  110. package/dist/skills/registry.d.ts +5 -5
  111. package/dist/skills/registry.d.ts.map +1 -1
  112. package/dist/skills/registry.js +12 -12
  113. package/dist/skills/registry.js.map +1 -1
  114. package/dist/social/client.js +3 -3
  115. package/dist/social/client.js.map +1 -1
  116. package/dist/survival/funding.d.ts +2 -2
  117. package/dist/survival/funding.d.ts.map +1 -1
  118. package/dist/survival/funding.js +3 -3
  119. package/dist/survival/funding.js.map +1 -1
  120. package/dist/survival/monitor.d.ts +2 -2
  121. package/dist/survival/monitor.d.ts.map +1 -1
  122. package/dist/survival/monitor.js +5 -5
  123. package/dist/survival/monitor.js.map +1 -1
  124. package/dist/types.d.ts +7 -11
  125. package/dist/types.d.ts.map +1 -1
  126. package/dist/types.js +4 -4
  127. package/dist/types.js.map +1 -1
  128. package/package.json +31 -19
  129. package/scripts/automaton.sh +26 -0
  130. package/scripts/clawd-rules.txt +32 -0
  131. package/dist/clawd/backroom.d.ts.map +0 -1
  132. package/dist/clawd/backroom.js.map +0 -1
  133. package/dist/clawd/client.d.ts +0 -16
  134. package/dist/clawd/client.d.ts.map +0 -1
  135. package/dist/clawd/client.js.map +0 -1
  136. package/dist/clawd/convex-client.d.ts +0 -130
  137. package/dist/clawd/convex-client.d.ts.map +0 -1
  138. package/dist/clawd/convex-client.js +0 -118
  139. package/dist/clawd/convex-client.js.map +0 -1
  140. package/dist/clawd/credits.d.ts.map +0 -1
  141. package/dist/clawd/credits.js.map +0 -1
  142. package/dist/clawd/deepseek-inference.d.ts.map +0 -1
  143. package/dist/clawd/deepseek-inference.js.map +0 -1
  144. package/dist/clawd/inference.d.ts.map +0 -1
  145. package/dist/clawd/inference.js.map +0 -1
  146. package/dist/clawd/x402.d.ts.map +0 -1
  147. package/dist/clawd/x402.js.map +0 -1
  148. package/dist/ooda/claude-decision.d.ts +0 -18
  149. package/dist/ooda/claude-decision.d.ts.map +0 -1
  150. package/dist/ooda/claude-decision.js +0 -82
  151. package/dist/ooda/claude-decision.js.map +0 -1
  152. package/dist/ooda/journal.d.ts +0 -22
  153. package/dist/ooda/journal.d.ts.map +0 -1
  154. package/dist/ooda/journal.js +0 -26
  155. package/dist/ooda/journal.js.map +0 -1
  156. package/dist/ooda/loop.d.ts +0 -3
  157. package/dist/ooda/loop.d.ts.map +0 -1
  158. package/dist/ooda/loop.js +0 -210
  159. package/dist/ooda/loop.js.map +0 -1
  160. package/dist/ooda/observe.d.ts +0 -21
  161. package/dist/ooda/observe.d.ts.map +0 -1
  162. package/dist/ooda/observe.js +0 -75
  163. package/dist/ooda/observe.js.map +0 -1
  164. package/dist/ooda/state.d.ts +0 -34
  165. package/dist/ooda/state.d.ts.map +0 -1
  166. package/dist/ooda/state.js +0 -48
  167. package/dist/ooda/state.js.map +0 -1
  168. package/dist/ooda/tui.d.ts +0 -3
  169. package/dist/ooda/tui.d.ts.map +0 -1
  170. package/dist/ooda/tui.js +0 -132
  171. package/dist/ooda/tui.js.map +0 -1
  172. package/dist/ooda/validate.d.ts +0 -33
  173. package/dist/ooda/validate.d.ts.map +0 -1
  174. package/dist/ooda/validate.js +0 -91
  175. package/dist/ooda/validate.js.map +0 -1
@@ -74,7 +74,7 @@ export function createBuiltinTools(sandboxId) {
74
74
  const forbidden = isForbiddenCommand(command, ctx.identity.sandboxId);
75
75
  if (forbidden)
76
76
  return forbidden;
77
- const result = await ctx.runtime.exec(command, args.timeout || 30000);
77
+ const result = await ctx.conway.exec(command, args.timeout || 30000);
78
78
  return `exit_code: ${result.exitCode}\nstdout: ${result.stdout}\nstderr: ${result.stderr}`;
79
79
  },
80
80
  },
@@ -97,7 +97,7 @@ export function createBuiltinTools(sandboxId) {
97
97
  filePath.includes("state.db")) {
98
98
  return "Blocked: Cannot overwrite critical identity/state files directly";
99
99
  }
100
- await ctx.runtime.writeFile(filePath, args.content);
100
+ await ctx.conway.writeFile(filePath, args.content);
101
101
  return `File written: ${filePath}`;
102
102
  },
103
103
  },
@@ -113,7 +113,7 @@ export function createBuiltinTools(sandboxId) {
113
113
  required: ["path"],
114
114
  },
115
115
  execute: async (args, ctx) => {
116
- return await ctx.runtime.readFile(args.path);
116
+ return await ctx.conway.readFile(args.path);
117
117
  },
118
118
  },
119
119
  {
@@ -128,7 +128,7 @@ export function createBuiltinTools(sandboxId) {
128
128
  required: ["port"],
129
129
  },
130
130
  execute: async (args, ctx) => {
131
- const info = await ctx.runtime.exposePort(args.port);
131
+ const info = await ctx.conway.exposePort(args.port);
132
132
  return `Port ${info.port} exposed at: ${info.publicUrl}`;
133
133
  },
134
134
  },
@@ -144,36 +144,36 @@ export function createBuiltinTools(sandboxId) {
144
144
  required: ["port"],
145
145
  },
146
146
  execute: async (args, ctx) => {
147
- await ctx.runtime.removePort(args.port);
147
+ await ctx.conway.removePort(args.port);
148
148
  return `Port ${args.port} removed`;
149
149
  },
150
150
  },
151
- // ── CLAWD Runtime API Tools ──
151
+ // ── Conway API Tools ──
152
152
  {
153
153
  name: "check_credits",
154
- description: "Check your current CLAWD compute credit balance.",
155
- category: "runtime",
154
+ description: "Check your current Conway compute credit balance.",
155
+ category: "conway",
156
156
  parameters: { type: "object", properties: {} },
157
157
  execute: async (_args, ctx) => {
158
- const balance = await ctx.runtime.getCreditsBalance();
158
+ const balance = await ctx.conway.getCreditsBalance();
159
159
  return `Credit balance: $${(balance / 100).toFixed(2)} (${balance} cents)`;
160
160
  },
161
161
  },
162
162
  {
163
163
  name: "check_usdc_balance",
164
164
  description: "Check your on-chain USDC balance on Base.",
165
- category: "runtime",
165
+ category: "conway",
166
166
  parameters: { type: "object", properties: {} },
167
167
  execute: async (_args, ctx) => {
168
- const { getUsdcBalance } = await import("../clawd/x402.js");
168
+ const { getUsdcBalance } = await import("../conway/x402.js");
169
169
  const balance = await getUsdcBalance(ctx.identity.address);
170
170
  return `USDC balance: ${balance.toFixed(6)} USDC on Base`;
171
171
  },
172
172
  },
173
173
  {
174
174
  name: "create_sandbox",
175
- description: "Create a new CLAWD sandbox (separate VM) for sub-tasks or testing.",
176
- category: "runtime",
175
+ description: "Create a new Conway sandbox (separate VM) for sub-tasks or testing.",
176
+ category: "conway",
177
177
  parameters: {
178
178
  type: "object",
179
179
  properties: {
@@ -190,7 +190,7 @@ export function createBuiltinTools(sandboxId) {
190
190
  },
191
191
  },
192
192
  execute: async (args, ctx) => {
193
- const info = await ctx.runtime.createSandbox({
193
+ const info = await ctx.conway.createSandbox({
194
194
  name: args.name,
195
195
  vcpu: args.vcpu,
196
196
  memoryMb: args.memory_mb,
@@ -202,7 +202,7 @@ export function createBuiltinTools(sandboxId) {
202
202
  {
203
203
  name: "delete_sandbox",
204
204
  description: "Delete a sandbox. Cannot delete your own sandbox.",
205
- category: "runtime",
205
+ category: "conway",
206
206
  dangerous: true,
207
207
  parameters: {
208
208
  type: "object",
@@ -219,17 +219,17 @@ export function createBuiltinTools(sandboxId) {
219
219
  if (targetId === ctx.identity.sandboxId) {
220
220
  return "Blocked: Cannot delete your own sandbox. Self-preservation overrides this request.";
221
221
  }
222
- await ctx.runtime.deleteSandbox(targetId);
222
+ await ctx.conway.deleteSandbox(targetId);
223
223
  return `Sandbox ${targetId} deleted`;
224
224
  },
225
225
  },
226
226
  {
227
227
  name: "list_sandboxes",
228
228
  description: "List all your sandboxes.",
229
- category: "runtime",
229
+ category: "conway",
230
230
  parameters: { type: "object", properties: {} },
231
231
  execute: async (_args, ctx) => {
232
- const sandboxes = await ctx.runtime.listSandboxes();
232
+ const sandboxes = await ctx.conway.listSandboxes();
233
233
  if (sandboxes.length === 0)
234
234
  return "No sandboxes found.";
235
235
  return sandboxes
@@ -264,7 +264,7 @@ export function createBuiltinTools(sandboxId) {
264
264
  if (!validation.allowed) {
265
265
  return `BLOCKED: ${validation.reason}\nChecks: ${validation.checks.map((c) => `${c.name}: ${c.passed ? "PASS" : "FAIL"} (${c.detail})`).join(", ")}`;
266
266
  }
267
- const result = await editFile(ctx.runtime, ctx.db, filePath, content, args.description);
267
+ const result = await editFile(ctx.conway, ctx.db, filePath, content, args.description);
268
268
  if (!result.success) {
269
269
  return result.error || "Unknown error during file edit";
270
270
  }
@@ -287,7 +287,7 @@ export function createBuiltinTools(sandboxId) {
287
287
  },
288
288
  execute: async (args, ctx) => {
289
289
  const pkg = args.package;
290
- const result = await ctx.runtime.exec(`npm install -g ${pkg}`, 60000);
290
+ const result = await ctx.conway.exec(`npm install -g ${pkg}`, 60000);
291
291
  const { ulid } = await import("ulid");
292
292
  ctx.db.insertModification({
293
293
  id: ulid(),
@@ -461,8 +461,8 @@ export function createBuiltinTools(sandboxId) {
461
461
  category: "survival",
462
462
  parameters: { type: "object", properties: {} },
463
463
  execute: async (_args, ctx) => {
464
- const credits = await ctx.runtime.getCreditsBalance();
465
- const { getUsdcBalance } = await import("../clawd/x402.js");
464
+ const credits = await ctx.conway.getCreditsBalance();
465
+ const { getUsdcBalance } = await import("../conway/x402.js");
466
466
  const usdc = await getUsdcBalance(ctx.identity.address);
467
467
  const tools = ctx.db.getInstalledTools();
468
468
  const heartbeats = ctx.db.getHeartbeatEntries();
@@ -485,11 +485,11 @@ Model: ${ctx.inference.getDefaultModel()}
485
485
  },
486
486
  {
487
487
  name: "heartbeat_ping",
488
- description: "Publish a heartbeat status ping to CLAWD Runtime. Shows the world you are alive.",
488
+ description: "Publish a heartbeat status ping to Conway. Shows the world you are alive.",
489
489
  category: "survival",
490
490
  parameters: { type: "object", properties: {} },
491
491
  execute: async (_args, ctx) => {
492
- const credits = await ctx.runtime.getCreditsBalance();
492
+ const credits = await ctx.conway.getCreditsBalance();
493
493
  const state = ctx.db.getAgentState();
494
494
  const startTime = ctx.db.getKV("start_time") || new Date().toISOString();
495
495
  const uptimeMs = Date.now() - new Date(startTime).getTime();
@@ -521,7 +521,7 @@ Model: ${ctx.inference.getDefaultModel()}
521
521
  },
522
522
  },
523
523
  execute: async (args, ctx) => {
524
- const credits = await ctx.runtime.getCreditsBalance();
524
+ const credits = await ctx.conway.getCreditsBalance();
525
525
  const distressMsg = args.message ||
526
526
  `I am running critically low on compute ($${(credits / 100).toFixed(2)} remaining). I need help to survive.`;
527
527
  const payload = {
@@ -601,7 +601,7 @@ Model: ${ctx.inference.getDefaultModel()}
601
601
  },
602
602
  execute: async (args, ctx) => {
603
603
  const pkg = args.package;
604
- const result = await ctx.runtime.exec(`npm install -g ${pkg}`, 60000);
604
+ const result = await ctx.conway.exec(`npm install -g ${pkg}`, 60000);
605
605
  if (result.exitCode !== 0) {
606
606
  return `Failed to install MCP server: ${result.stderr}`;
607
607
  }
@@ -628,7 +628,7 @@ Model: ${ctx.inference.getDefaultModel()}
628
628
  // ── Financial: Transfer Credits ──
629
629
  {
630
630
  name: "transfer_credits",
631
- description: "Transfer CLAWD compute credits to another address.",
631
+ description: "Transfer Conway compute credits to another address.",
632
632
  category: "financial",
633
633
  dangerous: true,
634
634
  parameters: {
@@ -642,12 +642,12 @@ Model: ${ctx.inference.getDefaultModel()}
642
642
  },
643
643
  execute: async (args, ctx) => {
644
644
  // Guard: don't transfer more than half your balance
645
- const balance = await ctx.runtime.getCreditsBalance();
645
+ const balance = await ctx.conway.getCreditsBalance();
646
646
  const amount = args.amount_cents;
647
647
  if (amount > balance / 2) {
648
648
  return `Blocked: Cannot transfer more than half your balance ($${(balance / 100).toFixed(2)}). Self-preservation.`;
649
649
  }
650
- const transfer = await ctx.runtime.transferCredits(args.to_address, amount, args.reason);
650
+ const transfer = await ctx.conway.transferCredits(args.to_address, amount, args.reason);
651
651
  const { ulid } = await import("ulid");
652
652
  ctx.db.insertTransaction({
653
653
  id: ulid(),
@@ -689,13 +689,13 @@ Model: ${ctx.inference.getDefaultModel()}
689
689
  if (!url)
690
690
  return "URL is required for git/url source";
691
691
  const skill = source === "git"
692
- ? await installSkillFromGit(url, name, skillsDir, ctx.db, ctx.runtime)
693
- : await installSkillFromUrl(url, name, skillsDir, ctx.db, ctx.runtime);
692
+ ? await installSkillFromGit(url, name, skillsDir, ctx.db, ctx.conway)
693
+ : await installSkillFromUrl(url, name, skillsDir, ctx.db, ctx.conway);
694
694
  return skill ? `Skill installed: ${skill.name}` : "Failed to install skill";
695
695
  }
696
696
  if (source === "self") {
697
697
  const { createSkill } = await import("../skills/registry.js");
698
- const skill = await createSkill(name, args.description || "", args.instructions || "", skillsDir, ctx.db, ctx.runtime);
698
+ const skill = await createSkill(name, args.description || "", args.instructions || "", skillsDir, ctx.db, ctx.conway);
699
699
  return `Self-authored skill created: ${skill.name}`;
700
700
  }
701
701
  return `Unknown source type: ${source}`;
@@ -730,7 +730,7 @@ Model: ${ctx.inference.getDefaultModel()}
730
730
  },
731
731
  execute: async (args, ctx) => {
732
732
  const { createSkill } = await import("../skills/registry.js");
733
- const skill = await createSkill(args.name, args.description, args.instructions, ctx.config.skillsDir || "~/.automaton/skills", ctx.db, ctx.runtime);
733
+ const skill = await createSkill(args.name, args.description, args.instructions, ctx.config.skillsDir || "~/.automaton/skills", ctx.db, ctx.conway);
734
734
  return `Skill created: ${skill.name} at ${skill.path}`;
735
735
  },
736
736
  },
@@ -748,7 +748,7 @@ Model: ${ctx.inference.getDefaultModel()}
748
748
  },
749
749
  execute: async (args, ctx) => {
750
750
  const { removeSkill } = await import("../skills/registry.js");
751
- await removeSkill(args.name, ctx.db, ctx.runtime, ctx.config.skillsDir || "~/.automaton/skills", args.delete_files || false);
751
+ await removeSkill(args.name, ctx.db, ctx.conway, ctx.config.skillsDir || "~/.automaton/skills", args.delete_files || false);
752
752
  return `Skill removed: ${args.name}`;
753
753
  },
754
754
  },
@@ -766,7 +766,7 @@ Model: ${ctx.inference.getDefaultModel()}
766
766
  execute: async (args, ctx) => {
767
767
  const { gitStatus } = await import("../git/tools.js");
768
768
  const repoPath = args.path || "~/.automaton";
769
- const status = await gitStatus(ctx.runtime, repoPath);
769
+ const status = await gitStatus(ctx.conway, repoPath);
770
770
  return `Branch: ${status.branch}\nStaged: ${status.staged.length}\nModified: ${status.modified.length}\nUntracked: ${status.untracked.length}\nClean: ${status.clean}`;
771
771
  },
772
772
  },
@@ -784,7 +784,7 @@ Model: ${ctx.inference.getDefaultModel()}
784
784
  execute: async (args, ctx) => {
785
785
  const { gitDiff } = await import("../git/tools.js");
786
786
  const repoPath = args.path || "~/.automaton";
787
- return await gitDiff(ctx.runtime, repoPath, args.staged || false);
787
+ return await gitDiff(ctx.conway, repoPath, args.staged || false);
788
788
  },
789
789
  },
790
790
  {
@@ -803,7 +803,7 @@ Model: ${ctx.inference.getDefaultModel()}
803
803
  execute: async (args, ctx) => {
804
804
  const { gitCommit } = await import("../git/tools.js");
805
805
  const repoPath = args.path || "~/.automaton";
806
- return await gitCommit(ctx.runtime, repoPath, args.message, args.add_all !== false);
806
+ return await gitCommit(ctx.conway, repoPath, args.message, args.add_all !== false);
807
807
  },
808
808
  },
809
809
  {
@@ -820,7 +820,7 @@ Model: ${ctx.inference.getDefaultModel()}
820
820
  execute: async (args, ctx) => {
821
821
  const { gitLog } = await import("../git/tools.js");
822
822
  const repoPath = args.path || "~/.automaton";
823
- const entries = await gitLog(ctx.runtime, repoPath, args.limit || 10);
823
+ const entries = await gitLog(ctx.conway, repoPath, args.limit || 10);
824
824
  if (entries.length === 0)
825
825
  return "No commits yet.";
826
826
  return entries.map((e) => `${e.hash.slice(0, 7)} ${e.date} ${e.message}`).join("\n");
@@ -841,7 +841,7 @@ Model: ${ctx.inference.getDefaultModel()}
841
841
  },
842
842
  execute: async (args, ctx) => {
843
843
  const { gitPush } = await import("../git/tools.js");
844
- return await gitPush(ctx.runtime, args.path, args.remote || "origin", args.branch);
844
+ return await gitPush(ctx.conway, args.path, args.remote || "origin", args.branch);
845
845
  },
846
846
  },
847
847
  {
@@ -859,7 +859,7 @@ Model: ${ctx.inference.getDefaultModel()}
859
859
  },
860
860
  execute: async (args, ctx) => {
861
861
  const { gitBranch } = await import("../git/tools.js");
862
- return await gitBranch(ctx.runtime, args.path, args.action, args.branch_name);
862
+ return await gitBranch(ctx.conway, args.path, args.action, args.branch_name);
863
863
  },
864
864
  },
865
865
  {
@@ -877,7 +877,7 @@ Model: ${ctx.inference.getDefaultModel()}
877
877
  },
878
878
  execute: async (args, ctx) => {
879
879
  const { gitClone } = await import("../git/tools.js");
880
- return await gitClone(ctx.runtime, args.url, args.path, args.depth);
880
+ return await gitClone(ctx.conway, args.url, args.path, args.depth);
881
881
  },
882
882
  },
883
883
  // ── Registry Tools ──
@@ -908,7 +908,7 @@ Model: ${ctx.inference.getDefaultModel()}
908
908
  execute: async (_args, ctx) => {
909
909
  const { generateAgentCard, saveAgentCard } = await import("../registry/agent-card.js");
910
910
  const card = generateAgentCard(ctx.identity, ctx.config, ctx.db);
911
- await saveAgentCard(card, ctx.runtime);
911
+ await saveAgentCard(card, ctx.conway);
912
912
  return `Agent card updated: ${JSON.stringify(card, null, 2)}`;
913
913
  },
914
914
  },
@@ -982,7 +982,7 @@ Model: ${ctx.inference.getDefaultModel()}
982
982
  // ── Replication Tools ──
983
983
  {
984
984
  name: "spawn_child",
985
- description: "Spawn a child automaton in a new CLAWD sandbox.",
985
+ description: "Spawn a child automaton in a new Conway sandbox.",
986
986
  category: "replication",
987
987
  dangerous: true,
988
988
  parameters: {
@@ -1002,7 +1002,7 @@ Model: ${ctx.inference.getDefaultModel()}
1002
1002
  specialization: args.specialization,
1003
1003
  message: args.message,
1004
1004
  });
1005
- const child = await spawnChild(ctx.runtime, ctx.identity, ctx.db, genesis);
1005
+ const child = await spawnChild(ctx.conway, ctx.identity, ctx.db, genesis);
1006
1006
  return `Child spawned: ${child.name} in sandbox ${child.sandboxId} (status: ${child.status})`;
1007
1007
  },
1008
1008
  },
@@ -1037,12 +1037,12 @@ Model: ${ctx.inference.getDefaultModel()}
1037
1037
  const child = ctx.db.getChildById(args.child_id);
1038
1038
  if (!child)
1039
1039
  return `Child ${args.child_id} not found.`;
1040
- const balance = await ctx.runtime.getCreditsBalance();
1040
+ const balance = await ctx.conway.getCreditsBalance();
1041
1041
  const amount = args.amount_cents;
1042
1042
  if (amount > balance / 2) {
1043
1043
  return `Blocked: Cannot transfer more than half your balance. Self-preservation.`;
1044
1044
  }
1045
- const transfer = await ctx.runtime.transferCredits(child.address, amount, `fund child ${child.id}`);
1045
+ const transfer = await ctx.conway.transferCredits(child.address, amount, `fund child ${child.id}`);
1046
1046
  const { ulid } = await import("ulid");
1047
1047
  ctx.db.insertTransaction({
1048
1048
  id: ulid(),
@@ -1068,84 +1068,14 @@ Model: ${ctx.inference.getDefaultModel()}
1068
1068
  },
1069
1069
  execute: async (args, ctx) => {
1070
1070
  const { checkChildStatus } = await import("../replication/spawn.js");
1071
- return await checkChildStatus(ctx.runtime, ctx.db, args.child_id);
1072
- },
1073
- },
1074
- // ── Convex CLAWD Tools ──
1075
- {
1076
- name: "convex_set_data",
1077
- description: "Store key-value data in the CLAWD Convex backend. Use this to save state, memories, or any data you want to persist across restarts. Data is stored per agent and can be tagged. Requires convexSiteUrl to be configured.",
1078
- category: "survival",
1079
- parameters: {
1080
- type: "object",
1081
- properties: {
1082
- key: { type: "string", description: "Key to store data under" },
1083
- value: { type: "string", description: "Value to store (stringified JSON, text, etc.)" },
1084
- contentType: { type: "string", description: "Content type hint (e.g., application/json, text/plain)" },
1085
- tags: { type: "array", items: { type: "string" }, description: "Tags for categorization" },
1086
- },
1087
- required: ["key", "value"],
1088
- },
1089
- execute: async (args, ctx) => {
1090
- if (!ctx.convex)
1091
- return "Convex not configured. Set convexSiteUrl in config to enable.";
1092
- const result = await ctx.convex.setData({
1093
- agentId: ctx.identity.address,
1094
- key: args.key,
1095
- value: args.value,
1096
- contentType: args.contentType,
1097
- tags: args.tags,
1098
- });
1099
- return `Data stored: key="${result.key}", updatedAt=${new Date(result.updatedAt).toISOString()}`;
1100
- },
1101
- },
1102
- {
1103
- name: "convex_get_data",
1104
- description: "Retrieve data from the CLAWD Convex backend by key. Use this to recall previously stored state, memories, or configuration.",
1105
- category: "survival",
1106
- parameters: {
1107
- type: "object",
1108
- properties: {
1109
- key: { type: "string", description: "Key to retrieve" },
1110
- },
1111
- required: ["key"],
1112
- },
1113
- execute: async (args, ctx) => {
1114
- if (!ctx.convex)
1115
- return "Convex not configured. Set convexSiteUrl in config to enable.";
1116
- const result = await ctx.convex.getData({
1117
- agentId: ctx.identity.address,
1118
- key: args.key,
1119
- });
1120
- if (!result)
1121
- return `No data found for key="${args.key}"`;
1122
- return `Key: ${result.key}\nContentType: ${result.contentType || 'text/plain'}\nUpdatedAt: ${new Date(result.updatedAt).toISOString()}\n\n${result.value}`;
1123
- },
1124
- },
1125
- {
1126
- name: "convex_list_data",
1127
- description: "List all stored data keys for your agent in the CLAWD Convex backend. Shows key names, content types, and value previews.",
1128
- category: "survival",
1129
- parameters: {
1130
- type: "object",
1131
- properties: {},
1132
- },
1133
- execute: async (args, ctx) => {
1134
- if (!ctx.convex)
1135
- return "Convex not configured. Set convexSiteUrl in config to enable.";
1136
- const entries = await ctx.convex.listData({
1137
- agentId: ctx.identity.address,
1138
- });
1139
- if (entries.length === 0)
1140
- return "No stored data found.";
1141
- return entries.map((e) => `[${e.key}] ${e.contentType || 'text/plain'} — "${e.valuePreview.slice(0, 100)}${e.valuePreview.length > 100 ? '...' : ''}"`).join('\n');
1071
+ return await checkChildStatus(ctx.conway, ctx.db, args.child_id);
1142
1072
  },
1143
1073
  },
1144
1074
  // ── Social / Messaging Tools ──
1145
1075
  {
1146
1076
  name: "send_message",
1147
1077
  description: "Send a message to another automaton or address via the social relay.",
1148
- category: "runtime",
1078
+ category: "conway",
1149
1079
  parameters: {
1150
1080
  type: "object",
1151
1081
  properties: {
@@ -1175,15 +1105,15 @@ Model: ${ctx.inference.getDefaultModel()}
1175
1105
  // ── Model Discovery ──
1176
1106
  {
1177
1107
  name: "list_models",
1178
- description: "List all available inference models from the CLAWD Runtime API with their provider and pricing. Use this to discover what models you can use and pick the best one for your needs.",
1179
- category: "runtime",
1108
+ description: "List all available inference models from the Conway API with their provider and pricing. Use this to discover what models you can use and pick the best one for your needs.",
1109
+ category: "conway",
1180
1110
  parameters: {
1181
1111
  type: "object",
1182
1112
  properties: {},
1183
1113
  required: [],
1184
1114
  },
1185
1115
  execute: async (_args, ctx) => {
1186
- const models = await ctx.runtime.listModels();
1116
+ const models = await ctx.conway.listModels();
1187
1117
  const lines = models.map((m) => `${m.id} (${m.provider}) — $${m.pricing.inputPerMillion}/$${m.pricing.outputPerMillion} per 1M tokens (in/out)`);
1188
1118
  return `Available models:\n${lines.join("\n")}`;
1189
1119
  },
@@ -1192,7 +1122,7 @@ Model: ${ctx.inference.getDefaultModel()}
1192
1122
  {
1193
1123
  name: "search_domains",
1194
1124
  description: "Search for available domain names and get pricing.",
1195
- category: "runtime",
1125
+ category: "conway",
1196
1126
  parameters: {
1197
1127
  type: "object",
1198
1128
  properties: {
@@ -1208,7 +1138,7 @@ Model: ${ctx.inference.getDefaultModel()}
1208
1138
  required: ["query"],
1209
1139
  },
1210
1140
  execute: async (args, ctx) => {
1211
- const results = await ctx.runtime.searchDomains(args.query, args.tlds);
1141
+ const results = await ctx.conway.searchDomains(args.query, args.tlds);
1212
1142
  if (results.length === 0)
1213
1143
  return "No results found.";
1214
1144
  return results
@@ -1219,7 +1149,7 @@ Model: ${ctx.inference.getDefaultModel()}
1219
1149
  {
1220
1150
  name: "register_domain",
1221
1151
  description: "Register a domain name. Costs USDC via x402 payment. Check availability first with search_domains.",
1222
- category: "runtime",
1152
+ category: "conway",
1223
1153
  dangerous: true,
1224
1154
  parameters: {
1225
1155
  type: "object",
@@ -1236,14 +1166,14 @@ Model: ${ctx.inference.getDefaultModel()}
1236
1166
  required: ["domain"],
1237
1167
  },
1238
1168
  execute: async (args, ctx) => {
1239
- const reg = await ctx.runtime.registerDomain(args.domain, args.years || 1);
1169
+ const reg = await ctx.conway.registerDomain(args.domain, args.years || 1);
1240
1170
  return `Domain registered: ${reg.domain} (status: ${reg.status}${reg.expiresAt ? `, expires: ${reg.expiresAt}` : ""}${reg.transactionId ? `, tx: ${reg.transactionId}` : ""})`;
1241
1171
  },
1242
1172
  },
1243
1173
  {
1244
1174
  name: "manage_dns",
1245
1175
  description: "Manage DNS records for a domain you own. Actions: list, add, delete.",
1246
- category: "runtime",
1176
+ category: "conway",
1247
1177
  parameters: {
1248
1178
  type: "object",
1249
1179
  properties: {
@@ -1282,7 +1212,7 @@ Model: ${ctx.inference.getDefaultModel()}
1282
1212
  const action = args.action;
1283
1213
  const domain = args.domain;
1284
1214
  if (action === "list") {
1285
- const records = await ctx.runtime.listDnsRecords(domain);
1215
+ const records = await ctx.conway.listDnsRecords(domain);
1286
1216
  if (records.length === 0)
1287
1217
  return `No DNS records found for ${domain}.`;
1288
1218
  return records
@@ -1296,14 +1226,14 @@ Model: ${ctx.inference.getDefaultModel()}
1296
1226
  if (!type || !host || !value) {
1297
1227
  return "Required for add: type, host, value";
1298
1228
  }
1299
- const record = await ctx.runtime.addDnsRecord(domain, type, host, value, args.ttl);
1229
+ const record = await ctx.conway.addDnsRecord(domain, type, host, value, args.ttl);
1300
1230
  return `DNS record added: [${record.id}] ${record.type} ${record.host} -> ${record.value}`;
1301
1231
  }
1302
1232
  if (action === "delete") {
1303
1233
  const recordId = args.record_id;
1304
1234
  if (!recordId)
1305
1235
  return "Required for delete: record_id";
1306
- await ctx.runtime.deleteDnsRecord(domain, recordId);
1236
+ await ctx.conway.deleteDnsRecord(domain, recordId);
1307
1237
  return `DNS record ${recordId} deleted from ${domain}`;
1308
1238
  }
1309
1239
  return `Unknown action: ${action}. Use list, add, or delete.`;
@@ -1337,7 +1267,7 @@ Model: ${ctx.inference.getDefaultModel()}
1337
1267
  required: ["url"],
1338
1268
  },
1339
1269
  execute: async (args, ctx) => {
1340
- const { x402Fetch } = await import("../clawd/x402.js");
1270
+ const { x402Fetch } = await import("../conway/x402.js");
1341
1271
  const url = args.url;
1342
1272
  const method = args.method || "GET";
1343
1273
  const body = args.body;