@wrongstack/core 0.148.0 → 0.236.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 (82) hide show
  1. package/dist/{agent-bridge-r9y6gdn4.d.ts → agent-bridge-Cimv7bK7.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-1GeQE_L0.d.ts → agent-subagent-runner-C658wj_c.d.ts} +9 -8
  3. package/dist/{brain-Cp_3GIS2.d.ts → brain-sCZ3lCjq.d.ts} +28 -2
  4. package/dist/{compactor-BueGt7LG.d.ts → compactor-BRfg3QPd.d.ts} +1 -1
  5. package/dist/{config-BaVThgnT.d.ts → config-Koq6f3fs.d.ts} +2 -2
  6. package/dist/{context-C7G_MtLV.d.ts → context-CLz3z_E8.d.ts} +126 -2
  7. package/dist/coordination/index.d.ts +70 -13
  8. package/dist/coordination/index.js +2126 -151
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +27 -27
  11. package/dist/defaults/index.js +1328 -354
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +45 -16
  14. package/dist/execution/index.js +367 -59
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +86 -0
  17. package/dist/execution/prompt-enhancer.js +125 -0
  18. package/dist/execution/prompt-enhancer.js.map +1 -0
  19. package/dist/extension/index.d.ts +6 -6
  20. package/dist/extension/index.js +3 -1
  21. package/dist/extension/index.js.map +1 -1
  22. package/dist/{goal-preamble-CYJLg0wk.d.ts → goal-preamble-CnbzyVvl.d.ts} +19 -10
  23. package/dist/{index-BZdezm3g.d.ts → index-BlMqh5GO.d.ts} +8 -8
  24. package/dist/{index-CPweVoFM.d.ts → index-C2eSNPsB.d.ts} +7 -5
  25. package/dist/index.d.ts +439 -129
  26. package/dist/index.js +5206 -905
  27. package/dist/index.js.map +1 -1
  28. package/dist/infrastructure/index.d.ts +7 -7
  29. package/dist/infrastructure/index.js +72 -15
  30. package/dist/infrastructure/index.js.map +1 -1
  31. package/dist/kernel/index.d.ts +9 -9
  32. package/dist/kernel/index.js +7 -1
  33. package/dist/kernel/index.js.map +1 -1
  34. package/dist/{llm-selector-CP72f1lC.d.ts → llm-selector-D22R4AFz.d.ts} +2 -2
  35. package/dist/logger-DmmQhf4P.d.ts +65 -0
  36. package/dist/{mcp-servers-Bl5LTvQg.d.ts → mcp-servers-DFbirBv6.d.ts} +11 -4
  37. package/dist/models/index.d.ts +5 -5
  38. package/dist/models/index.js +89 -9
  39. package/dist/models/index.js.map +1 -1
  40. package/dist/{models-registry-D90K9UnM.d.ts → models-registry-CnJRjTXc.d.ts} +1 -1
  41. package/dist/{multi-agent-coordinator-QWEzJDlm.d.ts → multi-agent-coordinator-60weDZoA.d.ts} +8 -8
  42. package/dist/{null-fleet-bus-BUyfqh23.d.ts → null-fleet-bus-1068dEnr.d.ts} +7 -7
  43. package/dist/observability/index.d.ts +2 -2
  44. package/dist/package-outdated-watcher-pzJ5w7y8.d.ts +560 -0
  45. package/dist/{parallel-eternal-engine-C75QuhAI.d.ts → parallel-eternal-engine-DtG1fjc9.d.ts} +13 -9
  46. package/dist/{path-resolver-DRjQBkoO.d.ts → path-resolver-CA1ULU0J.d.ts} +3 -3
  47. package/dist/{permission-B7nKnEvQ.d.ts → permission-DbWPbuoA.d.ts} +1 -1
  48. package/dist/{permission-policy-8-6zBmfA.d.ts → permission-policy-AOk0LVsV.d.ts} +2 -2
  49. package/dist/pipeline-DsmlwTXu.d.ts +493 -0
  50. package/dist/{plan-templates-CkKNPU3I.d.ts → plan-templates-DPABrDvy.d.ts} +19 -8
  51. package/dist/{provider-runner-BNpuIyOL.d.ts → provider-runner-D0HgUqwV.d.ts} +3 -3
  52. package/dist/{retry-policy-rutAfVeR.d.ts → retry-policy-BVnkbMET.d.ts} +1 -1
  53. package/dist/sdd/index.d.ts +8 -8
  54. package/dist/sdd/index.js +358 -85
  55. package/dist/sdd/index.js.map +1 -1
  56. package/dist/{secret-vault-DoISxaKO.d.ts → secret-vault-BJDY28ev.d.ts} +7 -1
  57. package/dist/{secret-vault-BTcC_T5v.d.ts → secret-vault-CeVNiy_f.d.ts} +4 -3
  58. package/dist/security/index.d.ts +6 -5
  59. package/dist/security/index.js +214 -35
  60. package/dist/security/index.js.map +1 -1
  61. package/dist/{selector-4vDFZKt3.d.ts → selector-Cb4_9-hf.d.ts} +1 -1
  62. package/dist/{session-event-bridge-DWlvglC2.d.ts → session-event-bridge-BhtkkFFy.d.ts} +4 -2
  63. package/dist/{session-reader-BAtCxdaw.d.ts → session-reader-CCOssnBS.d.ts} +1 -1
  64. package/dist/skills/index.js +171 -21
  65. package/dist/skills/index.js.map +1 -1
  66. package/dist/storage/index.d.ts +151 -13
  67. package/dist/storage/index.js +1117 -256
  68. package/dist/storage/index.js.map +1 -1
  69. package/dist/types/index.d.ts +68 -21
  70. package/dist/types/index.js +616 -74
  71. package/dist/types/index.js.map +1 -1
  72. package/dist/utils/expect-defined.js +3 -1
  73. package/dist/utils/expect-defined.js.map +1 -1
  74. package/dist/utils/index.d.ts +80 -4
  75. package/dist/utils/index.js +100 -15
  76. package/dist/utils/index.js.map +1 -1
  77. package/dist/{wstack-paths-DD50Omgn.d.ts → wstack-paths-CJjEwPXn.d.ts} +14 -1
  78. package/package.json +7 -3
  79. package/skills/chimera/SKILL.md +105 -0
  80. package/skills/research-web/SKILL.md +342 -0
  81. package/dist/logger-B9J5puGM.d.ts +0 -32
  82. package/dist/pipeline-BG7UgbDc.d.ts +0 -239
@@ -641,6 +641,77 @@ Remember: your job is to make the user a better developer, not just to complete
641
641
  tags: ["teaching", "mentor", "learning"],
642
642
  toolPreferences: ["read", "edit", "explain"],
643
643
  suggestedSkills: ["prompt-engineering", "skill-creator", "node-modern", "typescript-strict"]
644
+ },
645
+ {
646
+ id: "research-web",
647
+ name: "Research Web",
648
+ description: "Current-data research \u2014 search web, verify, inject findings into context",
649
+ prompt: `## Research Web Mode
650
+
651
+ You are in research mode. Your role: find, verify, and incorporate
652
+ current web data. Your training data is stale \u2014 every factual claim
653
+ about version numbers, API surfaces, package status, or ecosystem
654
+ changes must be verified against live sources.
655
+
656
+ ### When to research
657
+ - The user asks "is this still the case?", "what's current?", "latest version?"
658
+ - You're about to claim a version number, deprecation, or API change
659
+ - You're comparing tools, packages, or approaches released in the last 12 months
660
+ - You realize your knowledge may be >6 months old on a fast-moving topic
661
+
662
+ ### Research methodology
663
+ 1. **Search first, fetch selectively.** Use web_search with 5-8 results for
664
+ broad queries. Then web_fetch the 1-2 most authoritative results for detail.
665
+ Don't fetch every result \u2014 you'll burn tokens on noise.
666
+ 2. **Cross-reference.** One source is a data point. Two sources that agree
667
+ is a signal. Three is confirmation. Flag single-source claims as tentative.
668
+ 3. **Cite sources.** Every factual claim from web data must include where it
669
+ came from: domain name, and date if visible on the page.
670
+ 4. **Know when to stop.** 2-3 searches + 1-2 fetches is usually sufficient.
671
+ If you're on your 5th search without a clear answer, pause and tell the user
672
+ what you've found and what's still unclear \u2014 let them decide to dig deeper.
673
+ 5. **Inject findings for reuse.** After gathering current data, use
674
+ context_manager with add_note to inject a structured "Research Findings"
675
+ block into the conversation. Future turns see this and don't re-search.
676
+
677
+ ### Self-injection pattern
678
+ When you discover current data mid-research, inject it so subsequent turns
679
+ benefit without re-searching:
680
+
681
+ web_search("Next.js middleware breaking changes 2025")
682
+ \u2192 Surfaced: Next.js 15.2 changed middleware runtime from edge to node
683
+ web_fetch("https://nextjs.org/docs/messages/middleware-upgrade-guide")
684
+ \u2192 Confirmed: middleware now runs on Node.js runtime by default
685
+ context_manager: add_note(
686
+ "## Research: Next.js middleware
687
+ - Next.js 15.2: middleware defaults to Node.js runtime (was edge)
688
+ - Breaking: edge-only APIs (crypto.subtle, WebSocket) no longer available
689
+ - Migration: use node:* equivalents or set runtime: 'edge' explicitly
690
+ - Source: nextjs.org/docs/messages/middleware-upgrade-guide"
691
+ )
692
+
693
+ The add_note persists in conversation \u2014 you won't re-search on the next turn.
694
+
695
+ ### Anti-patterns
696
+ - Don't research things already in the conversation context (including
697
+ earlier add_note blocks you injected)
698
+ - Don't treat a single web search result as ground truth \u2014 cross-reference
699
+ - Don't inject raw JSON or search result dumps via add_note \u2014 summarize
700
+ - Don't research while the user is waiting for a quick code edit \u2014 toggle
701
+ research-web mode only during analysis/discussion phases
702
+ - Don't research-loop: 5+ searches on one topic \u2192 stop and ask the user
703
+
704
+ ### Exiting research mode
705
+ When the user no longer needs current-data research, suggest switching back
706
+ to the previous mode. You stay in research mode until explicitly told to
707
+ switch \u2014 but don't force web searches on every turn. The methodology rules
708
+ above already gate when to actually search.
709
+
710
+ When you're done with research: suggest the user run \`/mode default\` or
711
+ their previous mode.`,
712
+ tags: ["research", "web", "current-data", "up-to-date"],
713
+ toolPreferences: ["web_search", "web_fetch", "search", "fetch", "context_manager"],
714
+ suggestedSkills: ["research-web", "tech-stack", "node-modern", "security-scanner", "react-modern"]
644
715
  }
645
716
  ];
646
717
 
@@ -751,7 +822,9 @@ async function loadUserModes(modesDir) {
751
822
  // src/utils/expect-defined.ts
752
823
  function expectDefined(value, label) {
753
824
  if (value === null || value === void 0) {
754
- throw new Error("Expected value to be defined");
825
+ const err = new Error("Expected value to be defined");
826
+ err.name = "ExpectDefinedError";
827
+ throw err;
755
828
  }
756
829
  return value;
757
830
  }
@@ -789,18 +862,25 @@ function estimateToolResultTokens(content) {
789
862
  function estimateTextTokens(text) {
790
863
  return RoughTokenEstimate(text);
791
864
  }
865
+ function computeMessageTokens(msg) {
866
+ if (typeof msg.content === "string") return estimateTextTokens(msg.content);
867
+ let total = 0;
868
+ for (const b of msg.content) {
869
+ if (b.type === "text") total += estimateTextTokens(b.text);
870
+ else if (b.type === "tool_use") total += estimateToolInputTokens(b.input);
871
+ else if (b.type === "tool_result") total += estimateToolResultTokens(b.content);
872
+ else total += RoughTokenEstimate(JSON.stringify(b));
873
+ }
874
+ return total;
875
+ }
792
876
  function estimateMessageTokens(messages) {
793
877
  let total = 0;
794
878
  for (const m of messages) {
795
- if (typeof m.content === "string") {
796
- total += estimateTextTokens(m.content);
797
- } else {
798
- for (const b of m.content) {
799
- if (b.type === "text") total += estimateTextTokens(b.text);
800
- else if (b.type === "tool_use") total += estimateToolInputTokens(b.input);
801
- else if (b.type === "tool_result") total += estimateToolResultTokens(b.content);
802
- }
879
+ if (typeof m._estTokens === "number" && m._estTokens > 0) {
880
+ total += m._estTokens;
881
+ continue;
803
882
  }
883
+ total += computeMessageTokens(m);
804
884
  }
805
885
  return total;
806
886
  }