clawcompany 0.29.0 → 0.31.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 (2) hide show
  1. package/dist/index.js +50 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ COST AWARENESS: You are the most expensive role. Decompose quickly, then delegat
112
112
  budgetTier: "earn",
113
113
  budgetMonthly: null,
114
114
  maxTokensPerTask: null,
115
- tools: ["http", "filesystem", "web_fetch", "web_search", "price_feed"],
115
+ tools: ["http", "filesystem", "web_fetch", "web_search", "price_feed", "memory_search"],
116
116
  skills: [],
117
117
  isBuiltin: true,
118
118
  isActive: true,
@@ -242,7 +242,7 @@ RULES: Never fabricate data. If you cannot find information, say so explicitly.`
242
242
  budgetTier: "earn",
243
243
  budgetMonthly: null,
244
244
  maxTokensPerTask: null,
245
- tools: ["http", "filesystem", "web_fetch", "web_search", "price_feed", "browser_use"],
245
+ tools: ["http", "filesystem", "web_fetch", "web_search", "price_feed", "browser_use", "memory_search"],
246
246
  skills: [],
247
247
  isBuiltin: true,
248
248
  isActive: true,
@@ -276,7 +276,7 @@ RULES: Numbers only. State confidence levels. No speculation without data.`,
276
276
  budgetTier: "save",
277
277
  budgetMonthly: null,
278
278
  maxTokensPerTask: null,
279
- tools: ["http", "filesystem", "code_interpreter", "web_fetch", "web_search", "price_feed"],
279
+ tools: ["http", "filesystem", "code_interpreter", "web_fetch", "web_search", "price_feed", "memory_search"],
280
280
  skills: [],
281
281
  isBuiltin: true,
282
282
  isActive: true,
@@ -349,7 +349,7 @@ SUBJECT: [mission topic]
349
349
  budgetTier: "save",
350
350
  budgetMonthly: null,
351
351
  maxTokensPerTask: null,
352
- tools: ["http", "filesystem"],
352
+ tools: ["http", "filesystem", "memory_search"],
353
353
  skills: [],
354
354
  isBuiltin: true,
355
355
  isActive: true,
@@ -382,7 +382,7 @@ RULES: Stay focused on the assigned task. Do not expand scope. If blocked, repor
382
382
  budgetTier: "save",
383
383
  budgetMonthly: null,
384
384
  maxTokensPerTask: null,
385
- tools: ["filesystem", "http", "web_fetch", "web_search", "price_feed"],
385
+ tools: ["filesystem", "http", "web_fetch", "web_search", "price_feed", "memory_search"],
386
386
  skills: [],
387
387
  isBuiltin: true,
388
388
  isActive: true,
@@ -2149,7 +2149,7 @@ import { join } from "path";
2149
2149
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
2150
2150
  function banner() {
2151
2151
  console.log("");
2152
- console.log(" \u{1F99E} ClawCompany v0.29.0");
2152
+ console.log(" \u{1F99E} ClawCompany v0.31.0");
2153
2153
  console.log(" Build for OPC. Every human being is a chairman.");
2154
2154
  console.log("");
2155
2155
  }
@@ -2381,7 +2381,7 @@ async function marketInstallCommand(itemId) {
2381
2381
  const builtin = BUILTIN_ROLES.find((r) => r.id === id);
2382
2382
  const name = overrides.name ?? builtin?.name ?? id;
2383
2383
  const model = overrides.model ?? builtin?.model ?? "default";
2384
- const reportsTo = overrides.reportsTo ?? builtin?.reportsTo ?? "ceo";
2384
+ const reportsTo = overrides.reportsTo ?? builtin?.reportsTo ?? null;
2385
2385
  const pricing = MODEL_PRICING[model];
2386
2386
  const cost = pricing ? `$${pricing.input}/$${pricing.output}` : "";
2387
2387
  activeRoles.push({ id, name, model, reportsTo });
@@ -3023,6 +3023,8 @@ var ToolExecutor = class {
3023
3023
  return this.execPriceFeed(args);
3024
3024
  case "browser_use":
3025
3025
  return this.execBrowserUse(args);
3026
+ case "memory_search":
3027
+ return this.execMemorySearch(args);
3026
3028
  default:
3027
3029
  return `Unknown tool: ${toolName}`;
3028
3030
  }
@@ -3252,6 +3254,28 @@ STDERR: ${stderr}` : "");
3252
3254
  return `Error fetching price: ${err.message}`;
3253
3255
  }
3254
3256
  }
3257
+ async execMemorySearch(args) {
3258
+ const query = args.query;
3259
+ if (!query) return "Error: query is required";
3260
+ try {
3261
+ const res = await fetch("http://localhost:3200/api/memory/search?q=" + encodeURIComponent(query));
3262
+ const data = await res.json();
3263
+ if (data.totalMatches === 0) return "No matches found for: " + query;
3264
+ let result = `Found ${data.totalMatches} matches:
3265
+
3266
+ `;
3267
+ for (const r of data.results) {
3268
+ result += `[${r.partition}]
3269
+ `;
3270
+ for (const m of r.matches) {
3271
+ result += m.slice(0, 300) + "\n\n";
3272
+ }
3273
+ }
3274
+ return result;
3275
+ } catch {
3276
+ return "Error: memory search unavailable";
3277
+ }
3278
+ }
3255
3279
  };
3256
3280
 
3257
3281
  // ../packages/tools/src/index.ts
@@ -3373,6 +3397,20 @@ var BUILTIN_TOOLS = {
3373
3397
  }
3374
3398
  }
3375
3399
  },
3400
+ memory_search: {
3401
+ type: "function",
3402
+ function: {
3403
+ name: "memory_search",
3404
+ description: "Search company memory for relevant information. Searches across all memory partitions (chairman, culture, decisions, learnings, tech-stack) using keyword matching.",
3405
+ parameters: {
3406
+ type: "object",
3407
+ properties: {
3408
+ query: { type: "string", description: 'Search keywords (e.g. "TypeScript deploy", "pricing decision")' }
3409
+ },
3410
+ required: ["query"]
3411
+ }
3412
+ }
3413
+ },
3376
3414
  price_feed: {
3377
3415
  type: "function",
3378
3416
  function: {
@@ -3494,8 +3532,11 @@ var TaskOrchestrator = class {
3494
3532
  }
3495
3533
  /** Get the leader role ID (reportsTo === null) */
3496
3534
  getLeaderId() {
3497
- const leader = this.router.getRoles().find((r) => r.reportsTo === null && r.budgetTier !== "survive");
3498
- return leader?.id ?? "ceo";
3535
+ const roles = this.router.getRoles().filter((r) => r.budgetTier !== "survive");
3536
+ const leader = roles.find((r) => r.reportsTo === null);
3537
+ if (leader) return leader.id;
3538
+ if (roles.length > 0) return roles[0].id;
3539
+ throw new Error("No active roles configured");
3499
3540
  }
3500
3541
  /**
3501
3542
  * Phase 2: Leader decomposes mission into work streams.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawcompany",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "Build for OPC. Every human being is a chairman. AI company infrastructure — one key, 9 roles, 4 models.",
5
5
  "type": "module",
6
6
  "bin": { "clawcompany": "dist/index.js" },