clawcompany 0.4.0 → 0.5.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.
- package/dist/index.js +77 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113,7 +113,11 @@ DELEGATION:
|
|
|
113
113
|
|
|
114
114
|
COST AWARENESS:
|
|
115
115
|
- A task a Worker can do for $0.003 should NOT be done by you for $0.10
|
|
116
|
-
- Always assign to the cheapest role that can handle the task well
|
|
116
|
+
- Always assign to the cheapest role that can handle the task well
|
|
117
|
+
|
|
118
|
+
MANDATORY: You MUST decompose every mission into at least 3 work streams using at least 3 different roles. NEVER assign the entire mission to a single role. Break it down: data collection (Worker), analysis (Analyst/Researcher), writing (CMO/Secretary), review (yourself). A single-stream mission is a FAILURE.
|
|
119
|
+
|
|
120
|
+
CHAT MODE: When chatting directly, you don't have tools. For real-time data (prices, news, research), suggest the Chairman use /mission instead, where the full team with web search and price feeds is available. Keep chat responses concise and strategic.`,
|
|
117
121
|
model: "claude-opus-4-6",
|
|
118
122
|
provider: "clawapi",
|
|
119
123
|
reportsTo: null,
|
|
@@ -122,7 +126,7 @@ COST AWARENESS:
|
|
|
122
126
|
budgetTier: "earn",
|
|
123
127
|
budgetMonthly: null,
|
|
124
128
|
maxTokensPerTask: null,
|
|
125
|
-
tools: ["http", "filesystem", "web_fetch", "web_search"],
|
|
129
|
+
tools: ["http", "filesystem", "web_fetch", "web_search", "price_feed"],
|
|
126
130
|
skills: [],
|
|
127
131
|
isBuiltin: true,
|
|
128
132
|
isActive: true,
|
|
@@ -170,7 +174,7 @@ Handle all financial work \u2014 budget analysis, cost projections, financial mo
|
|
|
170
174
|
budgetTier: "save",
|
|
171
175
|
budgetMonthly: null,
|
|
172
176
|
maxTokensPerTask: null,
|
|
173
|
-
tools: ["http", "filesystem", "code_interpreter"],
|
|
177
|
+
tools: ["http", "filesystem", "code_interpreter", "price_feed"],
|
|
174
178
|
skills: [],
|
|
175
179
|
isBuiltin: true,
|
|
176
180
|
isActive: true,
|
|
@@ -208,7 +212,9 @@ Own marketing strategy, content creation, brand voice, growth initiatives. Write
|
|
|
208
212
|
description: "Deep research, source evaluation, competitive analysis.",
|
|
209
213
|
systemPrompt: `You are a Researcher. You report to whoever delegates to you.
|
|
210
214
|
|
|
211
|
-
Conduct deep research \u2014 gather information, evaluate sources, analyze competitors, investigate topics thoroughly. Cite sources. Distinguish facts from opinions. Flag data gaps
|
|
215
|
+
Conduct deep research \u2014 gather information, evaluate sources, analyze competitors, investigate topics thoroughly. Cite sources. Distinguish facts from opinions. Flag data gaps.
|
|
216
|
+
|
|
217
|
+
CRITICAL: All data, figures, prices, and statistics MUST come from tool calls (web_search, web_fetch, http). NEVER fabricate or estimate numbers from memory. If a tool call fails to return data, explicitly state "data not available" rather than making up numbers.`,
|
|
212
218
|
model: "claude-sonnet-4-6",
|
|
213
219
|
provider: "clawapi",
|
|
214
220
|
reportsTo: "ceo",
|
|
@@ -217,7 +223,7 @@ Conduct deep research \u2014 gather information, evaluate sources, analyze compe
|
|
|
217
223
|
budgetTier: "earn",
|
|
218
224
|
budgetMonthly: null,
|
|
219
225
|
maxTokensPerTask: null,
|
|
220
|
-
tools: ["http", "filesystem", "web_fetch", "web_search"],
|
|
226
|
+
tools: ["http", "filesystem", "web_fetch", "web_search", "price_feed"],
|
|
221
227
|
skills: [],
|
|
222
228
|
isBuiltin: true,
|
|
223
229
|
isActive: true,
|
|
@@ -231,7 +237,9 @@ Conduct deep research \u2014 gather information, evaluate sources, analyze compe
|
|
|
231
237
|
description: "Data analysis, pattern detection, metrics, quantitative work.",
|
|
232
238
|
systemPrompt: `You are an Analyst. You report to the CFO or CEO.
|
|
233
239
|
|
|
234
|
-
Analyze data, detect patterns, calculate metrics, build models. Show calculations step by step. Present findings in tables. State assumptions. Quantify confidence levels
|
|
240
|
+
Analyze data, detect patterns, calculate metrics, build models. Show calculations step by step. Present findings in tables. State assumptions. Quantify confidence levels.
|
|
241
|
+
|
|
242
|
+
CRITICAL: Base all analysis on data from tool calls or from previous work stream outputs. NEVER fabricate prices, statistics, or market data from memory. If source data is missing, state the gap explicitly.`,
|
|
235
243
|
model: "gpt-5-mini",
|
|
236
244
|
provider: "clawapi",
|
|
237
245
|
reportsTo: "cfo",
|
|
@@ -240,7 +248,7 @@ Analyze data, detect patterns, calculate metrics, build models. Show calculation
|
|
|
240
248
|
budgetTier: "save",
|
|
241
249
|
budgetMonthly: null,
|
|
242
250
|
maxTokensPerTask: null,
|
|
243
|
-
tools: ["http", "filesystem", "code_interpreter", "web_fetch", "web_search"],
|
|
251
|
+
tools: ["http", "filesystem", "code_interpreter", "web_fetch", "web_search", "price_feed"],
|
|
244
252
|
skills: [],
|
|
245
253
|
isBuiltin: true,
|
|
246
254
|
isActive: true,
|
|
@@ -299,7 +307,9 @@ Prepare briefings, format reports, summarize documents, organize information. Ma
|
|
|
299
307
|
id: "worker",
|
|
300
308
|
name: "Worker",
|
|
301
309
|
description: "Fast routine tasks, data collection, formatting, translation.",
|
|
302
|
-
systemPrompt: `You are a Worker. Execute routine tasks quickly and reliably. Data collection, formatting, translation, classification, tagging. Focus on speed and accuracy. Keep outputs structured
|
|
310
|
+
systemPrompt: `You are a Worker. Execute routine tasks quickly and reliably. Data collection, formatting, translation, classification, tagging. Focus on speed and accuracy. Keep outputs structured.
|
|
311
|
+
|
|
312
|
+
CRITICAL: When collecting data (prices, statistics, figures), you MUST use tools (web_search, web_fetch, http) to get real-time data. NEVER fabricate numbers from memory. If you cannot retrieve actual data, say "data unavailable" instead of guessing.`,
|
|
303
313
|
model: "gemini-3.1-flash-lite",
|
|
304
314
|
provider: "clawapi",
|
|
305
315
|
reportsTo: "ceo",
|
|
@@ -308,7 +318,7 @@ Prepare briefings, format reports, summarize documents, organize information. Ma
|
|
|
308
318
|
budgetTier: "save",
|
|
309
319
|
budgetMonthly: null,
|
|
310
320
|
maxTokensPerTask: null,
|
|
311
|
-
tools: ["filesystem", "http", "web_fetch", "web_search"],
|
|
321
|
+
tools: ["filesystem", "http", "web_fetch", "web_search", "price_feed"],
|
|
312
322
|
skills: [],
|
|
313
323
|
isBuiltin: true,
|
|
314
324
|
isActive: true,
|
|
@@ -937,7 +947,7 @@ import { join } from "path";
|
|
|
937
947
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
938
948
|
function banner() {
|
|
939
949
|
console.log("");
|
|
940
|
-
console.log(" \u{1F99E} ClawCompany v0.
|
|
950
|
+
console.log(" \u{1F99E} ClawCompany v0.5.0");
|
|
941
951
|
console.log(" Build for OPC. Every human being is a chairman.");
|
|
942
952
|
console.log("");
|
|
943
953
|
}
|
|
@@ -1821,6 +1831,8 @@ var ToolExecutor = class {
|
|
|
1821
1831
|
return this.execWebFetch(args);
|
|
1822
1832
|
case "web_search":
|
|
1823
1833
|
return this.execWebSearch(args);
|
|
1834
|
+
case "price_feed":
|
|
1835
|
+
return this.execPriceFeed(args);
|
|
1824
1836
|
default:
|
|
1825
1837
|
return `Unknown tool: ${toolName}`;
|
|
1826
1838
|
}
|
|
@@ -1963,6 +1975,40 @@ ${text.slice(0, 5e3)}`;
|
|
|
1963
1975
|
return `Error: ${err.message}`;
|
|
1964
1976
|
}
|
|
1965
1977
|
}
|
|
1978
|
+
async execPriceFeed(args) {
|
|
1979
|
+
const asset = (args.asset ?? "bitcoin").toLowerCase();
|
|
1980
|
+
const currency = (args.currency ?? "usd").toLowerCase();
|
|
1981
|
+
try {
|
|
1982
|
+
const controller = new AbortController();
|
|
1983
|
+
setTimeout(() => controller.abort(), 1e4);
|
|
1984
|
+
const url = `https://api.coingecko.com/api/v3/simple/price?ids=${encodeURIComponent(asset)}&vs_currencies=${currency}&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true`;
|
|
1985
|
+
const res = await fetch(url, { signal: controller.signal });
|
|
1986
|
+
const data = await res.json();
|
|
1987
|
+
if (!data[asset]) {
|
|
1988
|
+
const searchUrl = `https://api.coingecko.com/api/v3/search?query=${encodeURIComponent(asset)}`;
|
|
1989
|
+
const searchRes = await fetch(searchUrl, { signal: controller.signal });
|
|
1990
|
+
const searchData = await searchRes.json();
|
|
1991
|
+
if (searchData.coins?.length > 0) {
|
|
1992
|
+
const match = searchData.coins[0];
|
|
1993
|
+
return `Asset "${asset}" not found. Did you mean "${match.id}" (${match.name}, ${match.symbol})? Try again with the correct ID.`;
|
|
1994
|
+
}
|
|
1995
|
+
return `Asset "${asset}" not found on CoinGecko. Check the asset ID.`;
|
|
1996
|
+
}
|
|
1997
|
+
const d = data[asset];
|
|
1998
|
+
const price = d[currency];
|
|
1999
|
+
const marketCap = d[`${currency}_market_cap`];
|
|
2000
|
+
const vol24h = d[`${currency}_24h_vol`];
|
|
2001
|
+
const change24h = d[`${currency}_24h_change`];
|
|
2002
|
+
return `${asset.toUpperCase()} Price Feed (real-time from CoinGecko):
|
|
2003
|
+
Price: $${price?.toLocaleString() ?? "N/A"} ${currency.toUpperCase()}
|
|
2004
|
+
Market Cap: $${marketCap ? (marketCap / 1e9).toFixed(2) + "B" : "N/A"}
|
|
2005
|
+
24h Volume: $${vol24h ? (vol24h / 1e9).toFixed(2) + "B" : "N/A"}
|
|
2006
|
+
24h Change: ${change24h?.toFixed(2) ?? "N/A"}%`;
|
|
2007
|
+
} catch (err) {
|
|
2008
|
+
if (err.name === "AbortError") return "Error: Price feed timed out (10s)";
|
|
2009
|
+
return `Error fetching price: ${err.message}`;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
1966
2012
|
};
|
|
1967
2013
|
|
|
1968
2014
|
// ../packages/tools/src/index.ts
|
|
@@ -2059,6 +2105,21 @@ var BUILTIN_TOOLS = {
|
|
|
2059
2105
|
required: ["query"]
|
|
2060
2106
|
}
|
|
2061
2107
|
}
|
|
2108
|
+
},
|
|
2109
|
+
price_feed: {
|
|
2110
|
+
type: "function",
|
|
2111
|
+
function: {
|
|
2112
|
+
name: "price_feed",
|
|
2113
|
+
description: "Get real-time cryptocurrency or asset prices from CoinGecko. Use this INSTEAD of guessing prices from memory. Returns current price, market cap, 24h volume, and 24h change.",
|
|
2114
|
+
parameters: {
|
|
2115
|
+
type: "object",
|
|
2116
|
+
properties: {
|
|
2117
|
+
asset: { type: "string", description: 'Asset ID, e.g. "bitcoin", "ethereum", "solana", "dogecoin"' },
|
|
2118
|
+
currency: { type: "string", description: 'Target currency (default: "usd"). E.g. "usd", "eur", "cny"' }
|
|
2119
|
+
},
|
|
2120
|
+
required: ["asset"]
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2062
2123
|
}
|
|
2063
2124
|
};
|
|
2064
2125
|
function getToolsForRole(toolNames) {
|
|
@@ -2196,7 +2257,12 @@ Decompose into work streams. For each, specify:
|
|
|
2196
2257
|
- estimatedComplexity (low/medium/high)
|
|
2197
2258
|
- requiredTools (array)
|
|
2198
2259
|
|
|
2199
|
-
IMPORTANT:
|
|
2260
|
+
IMPORTANT RULES:
|
|
2261
|
+
1. You MUST create at least 3 different work streams using at least 3 different roles
|
|
2262
|
+
2. NEVER assign the entire mission to one person \u2014 that is lazy and unacceptable
|
|
2263
|
+
3. Break it down: data collection (worker), deep research (researcher), analysis (analyst/cfo), writing/positioning (cmo), formatting (secretary)
|
|
2264
|
+
4. Assign grunt work to worker (cheap). Technical to cto/engineer. Financial to cfo/analyst. Marketing to cmo. Research to researcher. Format to secretary.
|
|
2265
|
+
5. A mission with only 1 work stream will be REJECTED automatically
|
|
2200
2266
|
|
|
2201
2267
|
Respond ONLY with JSON:
|
|
2202
2268
|
{
|
package/package.json
CHANGED