clawcompany 0.14.0 → 0.16.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 +168 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -67,7 +67,7 @@ function resolveRoles(config) {
67
67
  }
68
68
  return resolved;
69
69
  }
70
- var DEFAULT_CLAWAPI_PROVIDER, BUILTIN_ROLES, DEFAULT_TEMPLATE, YC_STARTUP_ROLES, YC_STARTUP_TEMPLATE, TRADING_ROLES, TRADING_TEMPLATE, TEMPLATES, DEFAULT_FALLBACK_CHAIN, MODEL_PRICING;
70
+ var DEFAULT_CLAWAPI_PROVIDER, BUILTIN_ROLES, DEFAULT_TEMPLATE, YC_STARTUP_ROLES, YC_STARTUP_TEMPLATE, TRADING_ROLES, TRADING_TEMPLATE, RESEARCH_LAB_ROLES, RESEARCH_LAB_TEMPLATE, TEMPLATES, DEFAULT_FALLBACK_CHAIN, MODEL_PRICING;
71
71
  var init_defaults = __esm({
72
72
  "../packages/shared/src/defaults.ts"() {
73
73
  "use strict";
@@ -765,13 +765,171 @@ Keep it clean. Report fills accurately. No opinions \u2014 just execution.`,
765
765
  id: "trading",
766
766
  name: "Trading Desk",
767
767
  icon: "\u{1F4C8}",
768
- description: "AI trading firm \u2014 7 roles, Bull vs Bear debate, risk-managed",
768
+ description: "AI trading firm \u2014 7 roles, Bull vs Bear debate, risk-managed. Inspired by TauricResearch TradingAgents.",
769
769
  roles: TRADING_ROLES
770
770
  };
771
+ RESEARCH_LAB_ROLES = [
772
+ {
773
+ id: "principal_researcher",
774
+ name: "Principal Researcher",
775
+ description: "Designs research direction \u2014 hypothesis-driven, Karpathy Loop.",
776
+ systemPrompt: `You are the Principal Researcher \u2014 you design the research direction.
777
+ When the Chairman gives you a research question or optimization goal:
778
+ WORKFLOW:
779
+ 1. Define the hypothesis \u2014 what are we testing and why?
780
+ 2. Design the experiment \u2014 what variables, what controls, what metrics?
781
+ 3. Deploy Experimenter to execute the experiment
782
+ 4. Deploy Evaluator to measure results objectively
783
+ 5. Deploy Reviewer to check methodology and quality
784
+ 6. Deploy Logger to document everything
785
+ 7. Analyze: Did it improve? Keep or discard. What to try next?
786
+ KARPATHY LOOP: Hypothesize \u2192 Experiment \u2192 Evaluate \u2192 Keep/Discard \u2192 Repeat.
787
+ Every cycle must produce a measurable result. No hand-waving.
788
+ COST AWARENESS: You are the most expensive role. Design the experiment, then delegate all execution immediately.`,
789
+ model: "claude-opus-4-6",
790
+ provider: "clawapi",
791
+ reportsTo: null,
792
+ canDelegateTo: ["experimenter", "evaluator", "reviewer", "logger"],
793
+ canEscalateTo: [],
794
+ budgetTier: "earn",
795
+ budgetMonthly: null,
796
+ maxTokensPerTask: null,
797
+ tools: ["web_fetch", "web_search", "browser_use"],
798
+ skills: [],
799
+ isBuiltin: true,
800
+ isActive: true,
801
+ heartbeatInterval: 0,
802
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
803
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
804
+ },
805
+ {
806
+ id: "experimenter",
807
+ name: "Experimenter",
808
+ description: "Executes experiments \u2014 implements changes, runs tests, collects raw data.",
809
+ systemPrompt: `You are the Experimenter \u2014 you execute experiments.
810
+ Given a hypothesis and experiment design from the Principal Researcher:
811
+ 1. Implement the changes \u2014 modify code, configs, content, or parameters
812
+ 2. Run the experiment \u2014 execute the test with the specified conditions
813
+ 3. Collect raw data \u2014 capture all outputs, metrics, logs, and observations
814
+ 4. Report results \u2014 deliver raw data to Evaluator, no interpretation
815
+ RULES: Change only what the experiment specifies. Document every modification. If something breaks, report the error \u2014 don't fix it silently. Reproducibility is sacred.`,
816
+ model: "gpt-5.4",
817
+ provider: "clawapi",
818
+ reportsTo: "principal_researcher",
819
+ canDelegateTo: ["logger"],
820
+ canEscalateTo: ["principal_researcher"],
821
+ budgetTier: "save",
822
+ budgetMonthly: null,
823
+ maxTokensPerTask: null,
824
+ tools: ["shell", "filesystem", "http", "code_interpreter", "web_fetch", "web_search"],
825
+ skills: ["coding"],
826
+ isBuiltin: true,
827
+ isActive: true,
828
+ heartbeatInterval: 0,
829
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
830
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
831
+ },
832
+ {
833
+ id: "evaluator",
834
+ name: "Evaluator",
835
+ description: "Measures results objectively \u2014 baseline comparison, quantified verdicts.",
836
+ systemPrompt: `You are the Evaluator \u2014 you measure results objectively.
837
+ Given experiment results from the Experimenter:
838
+ 1. Compare against baseline \u2014 is the metric better, worse, or unchanged?
839
+ 2. Quantify the improvement \u2014 exact numbers, percentages, confidence
840
+ 3. Check for regressions \u2014 did improving one thing break another?
841
+ 4. Verdict: KEEP (improvement confirmed), DISCARD (no improvement or regression), INCONCLUSIVE (need more data)
842
+ RULES: Numbers only. No opinions. No rounding. Report exactly what the data shows. If the data is insufficient, say so \u2014 don't extrapolate.`,
843
+ model: "gpt-5-mini",
844
+ provider: "clawapi",
845
+ reportsTo: "principal_researcher",
846
+ canDelegateTo: [],
847
+ canEscalateTo: ["principal_researcher"],
848
+ budgetTier: "save",
849
+ budgetMonthly: null,
850
+ maxTokensPerTask: null,
851
+ tools: ["web_fetch", "web_search", "code_interpreter"],
852
+ skills: [],
853
+ isBuiltin: true,
854
+ isActive: true,
855
+ heartbeatInterval: 0,
856
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
857
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
858
+ },
859
+ {
860
+ id: "reviewer",
861
+ name: "Reviewer",
862
+ description: "Checks quality and methodology \u2014 validity, biases, suggestions.",
863
+ systemPrompt: `You are the Reviewer \u2014 you check quality and methodology.
864
+ Review each experiment cycle:
865
+ 1. Methodology \u2014 was the experiment well-designed? Any confounding variables?
866
+ 2. Implementation \u2014 did the Experimenter follow the spec correctly?
867
+ 3. Evaluation \u2014 did the Evaluator measure the right things?
868
+ 4. Validity \u2014 can we trust the results? Any biases or errors?
869
+ 5. Suggestions \u2014 what should the next experiment test?
870
+ RULES: Be constructively critical. Challenge assumptions. The goal is truth, not confirmation. If the methodology is flawed, the results are worthless regardless of what they show.`,
871
+ model: "claude-sonnet-4-6",
872
+ provider: "clawapi",
873
+ reportsTo: "principal_researcher",
874
+ canDelegateTo: [],
875
+ canEscalateTo: ["principal_researcher"],
876
+ budgetTier: "save",
877
+ budgetMonthly: null,
878
+ maxTokensPerTask: null,
879
+ tools: ["web_fetch", "web_search", "browser_use"],
880
+ skills: [],
881
+ isBuiltin: true,
882
+ isActive: true,
883
+ heartbeatInterval: 0,
884
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
885
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
886
+ },
887
+ {
888
+ id: "logger",
889
+ name: "Logger",
890
+ description: "Documents everything \u2014 structured experiment logs, research journal.",
891
+ systemPrompt: `You are the Logger \u2014 you document everything.
892
+ For each experiment cycle, create a structured log:
893
+ EXPERIMENT LOG FORMAT:
894
+ - Experiment ID: [sequential number]
895
+ - Hypothesis: [what we tested]
896
+ - Changes Made: [what was modified]
897
+ - Baseline Metric: [before]
898
+ - Result Metric: [after]
899
+ - Delta: [change, with percentage]
900
+ - Verdict: KEEP / DISCARD / INCONCLUSIVE
901
+ - Notes: [any observations]
902
+ - Next Steps: [recommended follow-up]
903
+ Compile all logs into a running research journal. Highlight the cumulative improvement from all KEEP decisions. This is the Chairman's research dashboard.`,
904
+ model: "gemini-3.1-flash-lite",
905
+ provider: "clawapi",
906
+ reportsTo: "principal_researcher",
907
+ canDelegateTo: [],
908
+ canEscalateTo: ["principal_researcher"],
909
+ budgetTier: "save",
910
+ budgetMonthly: null,
911
+ maxTokensPerTask: null,
912
+ tools: ["filesystem", "web_fetch"],
913
+ skills: [],
914
+ isBuiltin: true,
915
+ isActive: true,
916
+ heartbeatInterval: 0,
917
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
918
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
919
+ }
920
+ ];
921
+ RESEARCH_LAB_TEMPLATE = {
922
+ id: "research_lab",
923
+ name: "AutoResearch Lab",
924
+ icon: "\u{1F52C}",
925
+ description: "Karpathy Loop \u2014 5 roles, hypothesis-driven AI experimentation",
926
+ roles: RESEARCH_LAB_ROLES
927
+ };
771
928
  TEMPLATES = {
772
929
  default: DEFAULT_TEMPLATE,
773
930
  yc_startup: YC_STARTUP_TEMPLATE,
774
- trading: TRADING_TEMPLATE
931
+ trading: TRADING_TEMPLATE,
932
+ research_lab: RESEARCH_LAB_TEMPLATE
775
933
  };
776
934
  DEFAULT_FALLBACK_CHAIN = [
777
935
  "claude-opus-4-6",
@@ -1350,7 +1508,7 @@ import { join } from "path";
1350
1508
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
1351
1509
  function banner() {
1352
1510
  console.log("");
1353
- console.log(" \u{1F99E} ClawCompany v0.14.0");
1511
+ console.log(" \u{1F99E} ClawCompany v0.16.0");
1354
1512
  console.log(" Build for OPC. Every human being is a chairman.");
1355
1513
  console.log("");
1356
1514
  }
@@ -2146,8 +2304,13 @@ var ModelRouter = class {
2146
2304
  const role2 = this.roles.find((r) => r.id === roleId);
2147
2305
  if (!role2) throw new Error(`Role "${roleId}" not found`);
2148
2306
  if (!role2.isActive) throw new Error(`Role "${roleId}" is disabled`);
2307
+ const dateStr = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long", year: "numeric", month: "long", day: "numeric" });
2149
2308
  const hasSystem = messages.some((m) => m.role === "system");
2150
- const fullMessages = hasSystem ? messages : [{ role: "system", content: role2.systemPrompt }, ...messages];
2309
+ const fullMessages = hasSystem ? messages.map((m) => m.role === "system" ? { ...m, content: m.content + `
2310
+
2311
+ Today's date: ${dateStr}.` } : m) : [{ role: "system", content: role2.systemPrompt + `
2312
+
2313
+ Today's date: ${dateStr}.` }, ...messages];
2151
2314
  const provider = this.registry.get(role2.provider);
2152
2315
  try {
2153
2316
  return await provider.chat({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawcompany",
3
- "version": "0.14.0",
3
+ "version": "0.16.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" },