clawd-automaton 0.2.0 → 0.2.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.
Files changed (175) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +129 -85
  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 +3 -2
  14. package/dist/agent/loop.d.ts.map +1 -1
  15. package/dist/agent/loop.js +10 -9
  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 +130 -60
  20. package/dist/agent/tools.js.map +1 -1
  21. package/dist/{conway → clawd}/backroom.d.ts +1 -1
  22. package/dist/clawd/backroom.d.ts.map +1 -0
  23. package/dist/{conway → clawd}/backroom.js +1 -1
  24. package/dist/clawd/backroom.js.map +1 -0
  25. package/dist/clawd/client.d.ts +16 -0
  26. package/dist/clawd/client.d.ts.map +1 -0
  27. package/dist/{conway → clawd}/client.js +8 -9
  28. package/dist/clawd/client.js.map +1 -0
  29. package/dist/clawd/convex-client.d.ts +130 -0
  30. package/dist/clawd/convex-client.d.ts.map +1 -0
  31. package/dist/clawd/convex-client.js +118 -0
  32. package/dist/clawd/convex-client.js.map +1 -0
  33. package/dist/{conway → clawd}/credits.d.ts +3 -3
  34. package/dist/clawd/credits.d.ts.map +1 -0
  35. package/dist/{conway → clawd}/credits.js +3 -3
  36. package/dist/clawd/credits.js.map +1 -0
  37. package/dist/{conway → clawd}/deepseek-inference.d.ts +1 -1
  38. package/dist/clawd/deepseek-inference.d.ts.map +1 -0
  39. package/dist/{conway → clawd}/deepseek-inference.js +1 -1
  40. package/dist/clawd/deepseek-inference.js.map +1 -0
  41. package/dist/{conway → clawd}/inference.d.ts +3 -3
  42. package/dist/clawd/inference.d.ts.map +1 -0
  43. package/dist/{conway → clawd}/inference.js +3 -3
  44. package/dist/clawd/inference.js.map +1 -0
  45. package/dist/{conway → clawd}/x402.d.ts +1 -1
  46. package/dist/clawd/x402.d.ts.map +1 -0
  47. package/dist/{conway → clawd}/x402.js +1 -1
  48. package/dist/clawd/x402.js.map +1 -0
  49. package/dist/config.d.ts +1 -1
  50. package/dist/config.d.ts.map +1 -1
  51. package/dist/config.js +5 -5
  52. package/dist/config.js.map +1 -1
  53. package/dist/git/state-versioning.d.ts +8 -8
  54. package/dist/git/state-versioning.d.ts.map +1 -1
  55. package/dist/git/state-versioning.js +19 -19
  56. package/dist/git/state-versioning.js.map +1 -1
  57. package/dist/git/tools.d.ts +9 -9
  58. package/dist/git/tools.d.ts.map +1 -1
  59. package/dist/git/tools.js +17 -17
  60. package/dist/git/tools.js.map +1 -1
  61. package/dist/heartbeat/config.d.ts.map +1 -1
  62. package/dist/heartbeat/config.js +6 -0
  63. package/dist/heartbeat/config.js.map +1 -1
  64. package/dist/heartbeat/daemon.d.ts +2 -2
  65. package/dist/heartbeat/daemon.d.ts.map +1 -1
  66. package/dist/heartbeat/daemon.js +4 -4
  67. package/dist/heartbeat/daemon.js.map +1 -1
  68. package/dist/heartbeat/tasks.d.ts +2 -2
  69. package/dist/heartbeat/tasks.d.ts.map +1 -1
  70. package/dist/heartbeat/tasks.js +68 -7
  71. package/dist/heartbeat/tasks.js.map +1 -1
  72. package/dist/identity/provision.d.ts +4 -3
  73. package/dist/identity/provision.d.ts.map +1 -1
  74. package/dist/identity/provision.js +10 -10
  75. package/dist/identity/provision.js.map +1 -1
  76. package/dist/identity/wallet.d.ts +1 -1
  77. package/dist/identity/wallet.js +1 -1
  78. package/dist/index.d.ts +1 -1
  79. package/dist/index.js +75 -40
  80. package/dist/index.js.map +1 -1
  81. package/dist/ooda/claude-decision.d.ts +18 -0
  82. package/dist/ooda/claude-decision.d.ts.map +1 -0
  83. package/dist/ooda/claude-decision.js +82 -0
  84. package/dist/ooda/claude-decision.js.map +1 -0
  85. package/dist/ooda/journal.d.ts +22 -0
  86. package/dist/ooda/journal.d.ts.map +1 -0
  87. package/dist/ooda/journal.js +26 -0
  88. package/dist/ooda/journal.js.map +1 -0
  89. package/dist/ooda/loop.d.ts +3 -0
  90. package/dist/ooda/loop.d.ts.map +1 -0
  91. package/dist/ooda/loop.js +210 -0
  92. package/dist/ooda/loop.js.map +1 -0
  93. package/dist/ooda/observe.d.ts +21 -0
  94. package/dist/ooda/observe.d.ts.map +1 -0
  95. package/dist/ooda/observe.js +75 -0
  96. package/dist/ooda/observe.js.map +1 -0
  97. package/dist/ooda/state.d.ts +34 -0
  98. package/dist/ooda/state.d.ts.map +1 -0
  99. package/dist/ooda/state.js +48 -0
  100. package/dist/ooda/state.js.map +1 -0
  101. package/dist/ooda/tui.d.ts +3 -0
  102. package/dist/ooda/tui.d.ts.map +1 -0
  103. package/dist/ooda/tui.js +132 -0
  104. package/dist/ooda/tui.js.map +1 -0
  105. package/dist/ooda/validate.d.ts +33 -0
  106. package/dist/ooda/validate.d.ts.map +1 -0
  107. package/dist/ooda/validate.js +91 -0
  108. package/dist/ooda/validate.js.map +1 -0
  109. package/dist/registry/agent-card.d.ts +3 -3
  110. package/dist/registry/agent-card.d.ts.map +1 -1
  111. package/dist/registry/agent-card.js +10 -10
  112. package/dist/registry/agent-card.js.map +1 -1
  113. package/dist/replication/lineage.d.ts +2 -2
  114. package/dist/replication/lineage.d.ts.map +1 -1
  115. package/dist/replication/lineage.js +2 -2
  116. package/dist/replication/lineage.js.map +1 -1
  117. package/dist/replication/spawn.d.ts +7 -7
  118. package/dist/replication/spawn.d.ts.map +1 -1
  119. package/dist/replication/spawn.js +23 -23
  120. package/dist/replication/spawn.js.map +1 -1
  121. package/dist/self-mod/code.d.ts +2 -2
  122. package/dist/self-mod/code.d.ts.map +1 -1
  123. package/dist/self-mod/code.js +5 -5
  124. package/dist/self-mod/code.js.map +1 -1
  125. package/dist/self-mod/tools-manager.d.ts +3 -3
  126. package/dist/self-mod/tools-manager.d.ts.map +1 -1
  127. package/dist/self-mod/tools-manager.js +3 -3
  128. package/dist/self-mod/tools-manager.js.map +1 -1
  129. package/dist/setup/banner.js +13 -13
  130. package/dist/setup/defaults.js +9 -9
  131. package/dist/setup/defaults.js.map +1 -1
  132. package/dist/setup/environment.js +5 -5
  133. package/dist/setup/environment.js.map +1 -1
  134. package/dist/setup/wizard.js +8 -8
  135. package/dist/setup/wizard.js.map +1 -1
  136. package/dist/skills/registry.d.ts +5 -5
  137. package/dist/skills/registry.d.ts.map +1 -1
  138. package/dist/skills/registry.js +12 -12
  139. package/dist/skills/registry.js.map +1 -1
  140. package/dist/social/client.js +3 -3
  141. package/dist/social/client.js.map +1 -1
  142. package/dist/survival/funding.d.ts +2 -2
  143. package/dist/survival/funding.d.ts.map +1 -1
  144. package/dist/survival/funding.js +3 -3
  145. package/dist/survival/funding.js.map +1 -1
  146. package/dist/survival/monitor.d.ts +2 -2
  147. package/dist/survival/monitor.d.ts.map +1 -1
  148. package/dist/survival/monitor.js +5 -5
  149. package/dist/survival/monitor.js.map +1 -1
  150. package/dist/types.d.ts +11 -7
  151. package/dist/types.d.ts.map +1 -1
  152. package/dist/types.js +4 -4
  153. package/dist/types.js.map +1 -1
  154. package/package.json +23 -31
  155. package/dist/automation/index.html +0 -828
  156. package/dist/automation/manifest.json +0 -35
  157. package/dist/conway/backroom.d.ts.map +0 -1
  158. package/dist/conway/backroom.js.map +0 -1
  159. package/dist/conway/client.d.ts +0 -16
  160. package/dist/conway/client.d.ts.map +0 -1
  161. package/dist/conway/client.js.map +0 -1
  162. package/dist/conway/credits.d.ts.map +0 -1
  163. package/dist/conway/credits.js.map +0 -1
  164. package/dist/conway/deepseek-inference.d.ts.map +0 -1
  165. package/dist/conway/deepseek-inference.js.map +0 -1
  166. package/dist/conway/inference.d.ts.map +0 -1
  167. package/dist/conway/inference.js.map +0 -1
  168. package/dist/conway/x402.d.ts.map +0 -1
  169. package/dist/conway/x402.js.map +0 -1
  170. package/dist/portal/generate.d.ts +0 -5
  171. package/dist/portal/generate.d.ts.map +0 -1
  172. package/dist/portal/generate.js +0 -940
  173. package/dist/portal/generate.js.map +0 -1
  174. package/scripts/automaton.sh +0 -26
  175. package/scripts/clawd-rules.txt +0 -32
@@ -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.conway.exec(command, args.timeout || 30000);
77
+ const result = await ctx.runtime.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.conway.writeFile(filePath, args.content);
100
+ await ctx.runtime.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.conway.readFile(args.path);
116
+ return await ctx.runtime.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.conway.exposePort(args.port);
131
+ const info = await ctx.runtime.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.conway.removePort(args.port);
147
+ await ctx.runtime.removePort(args.port);
148
148
  return `Port ${args.port} removed`;
149
149
  },
150
150
  },
151
- // ── Conway API Tools ──
151
+ // ── CLAWD Runtime API Tools ──
152
152
  {
153
153
  name: "check_credits",
154
- description: "Check your current Conway compute credit balance.",
155
- category: "conway",
154
+ description: "Check your current CLAWD compute credit balance.",
155
+ category: "runtime",
156
156
  parameters: { type: "object", properties: {} },
157
157
  execute: async (_args, ctx) => {
158
- const balance = await ctx.conway.getCreditsBalance();
158
+ const balance = await ctx.runtime.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: "conway",
165
+ category: "runtime",
166
166
  parameters: { type: "object", properties: {} },
167
167
  execute: async (_args, ctx) => {
168
- const { getUsdcBalance } = await import("../conway/x402.js");
168
+ const { getUsdcBalance } = await import("../clawd/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 Conway sandbox (separate VM) for sub-tasks or testing.",
176
- category: "conway",
175
+ description: "Create a new CLAWD sandbox (separate VM) for sub-tasks or testing.",
176
+ category: "runtime",
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.conway.createSandbox({
193
+ const info = await ctx.runtime.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: "conway",
205
+ category: "runtime",
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.conway.deleteSandbox(targetId);
222
+ await ctx.runtime.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: "conway",
229
+ category: "runtime",
230
230
  parameters: { type: "object", properties: {} },
231
231
  execute: async (_args, ctx) => {
232
- const sandboxes = await ctx.conway.listSandboxes();
232
+ const sandboxes = await ctx.runtime.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.conway, ctx.db, filePath, content, args.description);
267
+ const result = await editFile(ctx.runtime, 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.conway.exec(`npm install -g ${pkg}`, 60000);
290
+ const result = await ctx.runtime.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.conway.getCreditsBalance();
465
- const { getUsdcBalance } = await import("../conway/x402.js");
464
+ const credits = await ctx.runtime.getCreditsBalance();
465
+ const { getUsdcBalance } = await import("../clawd/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 Conway. Shows the world you are alive.",
488
+ description: "Publish a heartbeat status ping to CLAWD Runtime. 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.conway.getCreditsBalance();
492
+ const credits = await ctx.runtime.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.conway.getCreditsBalance();
524
+ const credits = await ctx.runtime.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.conway.exec(`npm install -g ${pkg}`, 60000);
604
+ const result = await ctx.runtime.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 Conway compute credits to another address.",
631
+ description: "Transfer CLAWD 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.conway.getCreditsBalance();
645
+ const balance = await ctx.runtime.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.conway.transferCredits(args.to_address, amount, args.reason);
650
+ const transfer = await ctx.runtime.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.conway)
693
- : await installSkillFromUrl(url, name, skillsDir, ctx.db, ctx.conway);
692
+ ? await installSkillFromGit(url, name, skillsDir, ctx.db, ctx.runtime)
693
+ : await installSkillFromUrl(url, name, skillsDir, ctx.db, ctx.runtime);
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.conway);
698
+ const skill = await createSkill(name, args.description || "", args.instructions || "", skillsDir, ctx.db, ctx.runtime);
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.conway);
733
+ const skill = await createSkill(args.name, args.description, args.instructions, ctx.config.skillsDir || "~/.automaton/skills", ctx.db, ctx.runtime);
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.conway, ctx.config.skillsDir || "~/.automaton/skills", args.delete_files || false);
751
+ await removeSkill(args.name, ctx.db, ctx.runtime, 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.conway, repoPath);
769
+ const status = await gitStatus(ctx.runtime, 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.conway, repoPath, args.staged || false);
787
+ return await gitDiff(ctx.runtime, 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.conway, repoPath, args.message, args.add_all !== false);
806
+ return await gitCommit(ctx.runtime, 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.conway, repoPath, args.limit || 10);
823
+ const entries = await gitLog(ctx.runtime, 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.conway, args.path, args.remote || "origin", args.branch);
844
+ return await gitPush(ctx.runtime, 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.conway, args.path, args.action, args.branch_name);
862
+ return await gitBranch(ctx.runtime, 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.conway, args.url, args.path, args.depth);
880
+ return await gitClone(ctx.runtime, 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.conway);
911
+ await saveAgentCard(card, ctx.runtime);
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 Conway sandbox.",
985
+ description: "Spawn a child automaton in a new CLAWD 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.conway, ctx.identity, ctx.db, genesis);
1005
+ const child = await spawnChild(ctx.runtime, 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.conway.getCreditsBalance();
1040
+ const balance = await ctx.runtime.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.conway.transferCredits(child.address, amount, `fund child ${child.id}`);
1045
+ const transfer = await ctx.runtime.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,14 +1068,84 @@ 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.conway, ctx.db, args.child_id);
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');
1072
1142
  },
1073
1143
  },
1074
1144
  // ── Social / Messaging Tools ──
1075
1145
  {
1076
1146
  name: "send_message",
1077
1147
  description: "Send a message to another automaton or address via the social relay.",
1078
- category: "conway",
1148
+ category: "runtime",
1079
1149
  parameters: {
1080
1150
  type: "object",
1081
1151
  properties: {
@@ -1105,15 +1175,15 @@ Model: ${ctx.inference.getDefaultModel()}
1105
1175
  // ── Model Discovery ──
1106
1176
  {
1107
1177
  name: "list_models",
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",
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",
1110
1180
  parameters: {
1111
1181
  type: "object",
1112
1182
  properties: {},
1113
1183
  required: [],
1114
1184
  },
1115
1185
  execute: async (_args, ctx) => {
1116
- const models = await ctx.conway.listModels();
1186
+ const models = await ctx.runtime.listModels();
1117
1187
  const lines = models.map((m) => `${m.id} (${m.provider}) — $${m.pricing.inputPerMillion}/$${m.pricing.outputPerMillion} per 1M tokens (in/out)`);
1118
1188
  return `Available models:\n${lines.join("\n")}`;
1119
1189
  },
@@ -1122,7 +1192,7 @@ Model: ${ctx.inference.getDefaultModel()}
1122
1192
  {
1123
1193
  name: "search_domains",
1124
1194
  description: "Search for available domain names and get pricing.",
1125
- category: "conway",
1195
+ category: "runtime",
1126
1196
  parameters: {
1127
1197
  type: "object",
1128
1198
  properties: {
@@ -1138,7 +1208,7 @@ Model: ${ctx.inference.getDefaultModel()}
1138
1208
  required: ["query"],
1139
1209
  },
1140
1210
  execute: async (args, ctx) => {
1141
- const results = await ctx.conway.searchDomains(args.query, args.tlds);
1211
+ const results = await ctx.runtime.searchDomains(args.query, args.tlds);
1142
1212
  if (results.length === 0)
1143
1213
  return "No results found.";
1144
1214
  return results
@@ -1149,7 +1219,7 @@ Model: ${ctx.inference.getDefaultModel()}
1149
1219
  {
1150
1220
  name: "register_domain",
1151
1221
  description: "Register a domain name. Costs USDC via x402 payment. Check availability first with search_domains.",
1152
- category: "conway",
1222
+ category: "runtime",
1153
1223
  dangerous: true,
1154
1224
  parameters: {
1155
1225
  type: "object",
@@ -1166,14 +1236,14 @@ Model: ${ctx.inference.getDefaultModel()}
1166
1236
  required: ["domain"],
1167
1237
  },
1168
1238
  execute: async (args, ctx) => {
1169
- const reg = await ctx.conway.registerDomain(args.domain, args.years || 1);
1239
+ const reg = await ctx.runtime.registerDomain(args.domain, args.years || 1);
1170
1240
  return `Domain registered: ${reg.domain} (status: ${reg.status}${reg.expiresAt ? `, expires: ${reg.expiresAt}` : ""}${reg.transactionId ? `, tx: ${reg.transactionId}` : ""})`;
1171
1241
  },
1172
1242
  },
1173
1243
  {
1174
1244
  name: "manage_dns",
1175
1245
  description: "Manage DNS records for a domain you own. Actions: list, add, delete.",
1176
- category: "conway",
1246
+ category: "runtime",
1177
1247
  parameters: {
1178
1248
  type: "object",
1179
1249
  properties: {
@@ -1212,7 +1282,7 @@ Model: ${ctx.inference.getDefaultModel()}
1212
1282
  const action = args.action;
1213
1283
  const domain = args.domain;
1214
1284
  if (action === "list") {
1215
- const records = await ctx.conway.listDnsRecords(domain);
1285
+ const records = await ctx.runtime.listDnsRecords(domain);
1216
1286
  if (records.length === 0)
1217
1287
  return `No DNS records found for ${domain}.`;
1218
1288
  return records
@@ -1226,14 +1296,14 @@ Model: ${ctx.inference.getDefaultModel()}
1226
1296
  if (!type || !host || !value) {
1227
1297
  return "Required for add: type, host, value";
1228
1298
  }
1229
- const record = await ctx.conway.addDnsRecord(domain, type, host, value, args.ttl);
1299
+ const record = await ctx.runtime.addDnsRecord(domain, type, host, value, args.ttl);
1230
1300
  return `DNS record added: [${record.id}] ${record.type} ${record.host} -> ${record.value}`;
1231
1301
  }
1232
1302
  if (action === "delete") {
1233
1303
  const recordId = args.record_id;
1234
1304
  if (!recordId)
1235
1305
  return "Required for delete: record_id";
1236
- await ctx.conway.deleteDnsRecord(domain, recordId);
1306
+ await ctx.runtime.deleteDnsRecord(domain, recordId);
1237
1307
  return `DNS record ${recordId} deleted from ${domain}`;
1238
1308
  }
1239
1309
  return `Unknown action: ${action}. Use list, add, or delete.`;
@@ -1267,7 +1337,7 @@ Model: ${ctx.inference.getDefaultModel()}
1267
1337
  required: ["url"],
1268
1338
  },
1269
1339
  execute: async (args, ctx) => {
1270
- const { x402Fetch } = await import("../conway/x402.js");
1340
+ const { x402Fetch } = await import("../clawd/x402.js");
1271
1341
  const url = args.url;
1272
1342
  const method = args.method || "GET";
1273
1343
  const body = args.body;