context-mode 1.0.117 → 1.0.119

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 (46) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.openclaw-plugin/openclaw.plugin.json +1 -1
  4. package/.openclaw-plugin/package.json +1 -1
  5. package/bin/statusline.mjs +43 -36
  6. package/build/adapters/pi/mcp-bridge.d.ts +28 -3
  7. package/build/adapters/pi/mcp-bridge.js +127 -14
  8. package/build/adapters/qwen-code/index.js +6 -2
  9. package/build/cli.js +93 -5
  10. package/build/opencode-plugin.js +2 -5
  11. package/build/server.js +25 -8
  12. package/build/session/analytics.d.ts +21 -0
  13. package/build/session/analytics.js +1 -1
  14. package/build/util/project-dir.js +9 -5
  15. package/cli.bundle.mjs +148 -139
  16. package/hooks/core/routing.mjs +13 -0
  17. package/openclaw.plugin.json +1 -1
  18. package/package.json +5 -6
  19. package/scripts/heal-better-sqlite3.mjs +53 -6
  20. package/scripts/heal-installed-plugins.mjs +104 -0
  21. package/scripts/postinstall.mjs +35 -1
  22. package/server.bundle.mjs +88 -88
  23. package/skills/UPSTREAM-CREDITS.md +51 -0
  24. package/skills/diagnose/SKILL.md +122 -0
  25. package/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  26. package/skills/grill-me/SKILL.md +15 -0
  27. package/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  28. package/skills/grill-with-docs/CONTEXT-FORMAT.md +77 -0
  29. package/skills/grill-with-docs/SKILL.md +93 -0
  30. package/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  31. package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
  32. package/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  33. package/skills/improve-codebase-architecture/SKILL.md +76 -0
  34. package/skills/tdd/SKILL.md +114 -0
  35. package/skills/tdd/deep-modules.md +33 -0
  36. package/skills/tdd/interface-design.md +31 -0
  37. package/skills/tdd/mocking.md +59 -0
  38. package/skills/tdd/refactoring.md +10 -0
  39. package/skills/tdd/tests.md +61 -0
  40. package/start.mjs +25 -1
  41. package/build/cache-heal.d.ts +0 -48
  42. package/build/cache-heal.js +0 -150
  43. package/build/routing-block.d.ts +0 -8
  44. package/build/routing-block.js +0 -86
  45. package/build/tool-naming.d.ts +0 -4
  46. package/build/tool-naming.js +0 -24
@@ -480,6 +480,27 @@ export declare const autoMemoryLabels: Record<string, string>;
480
480
  * each tool's own surface area.
481
481
  */
482
482
  export declare const adapterLabels: Record<string, string>;
483
+ /**
484
+ * Format a byte count for the narrative dashboard.
485
+ *
486
+ * Single-unit auto-scale (Grafana / CloudWatch / Datadog convention).
487
+ * Decimals shrink as the integer part grows so the number stays readable
488
+ * at every magnitude. Max output width is 8 characters which fits the
489
+ * existing `padStart(8)` callsites in Sections 1, 3, 4.
490
+ *
491
+ * < 1 KB → "X B" e.g. "100 B"
492
+ * 1 KB – < 100 KB → "X.Y KB" e.g. "4.7 KB", "92.8 KB"
493
+ * 100 KB – < 1 MB → "X KB" e.g. "227 KB", "976 KB"
494
+ * 1 MB – < 100 MB → "X.Y MB" e.g. "4.5 MB", "11.6 MB"
495
+ * 100 MB – < 1 GB → "X MB" e.g. "178 MB", "906 MB"
496
+ * 1 GB – < 100 GB → "X.YY GB" e.g. "1.00 GB", "11.36 GB"
497
+ * ≥ 100 GB → "X.Y GB" e.g. "216.6 GB"
498
+ *
499
+ * Replaced the dual-unit "X KB (0.YY MB)" form because the parenthetical
500
+ * rounded to 0.00 / 0.01 in the common range and added noise without
501
+ * information. Scale awareness comes from the unit jump between rows.
502
+ */
503
+ export declare function kb(b: number): string;
483
504
  /**
484
505
  * Locale + IANA-timezone detection for the narrative renderer.
485
506
  *
@@ -1059,7 +1059,7 @@ function adapterLabel(name) {
1059
1059
  * rounded to 0.00 / 0.01 in the common range and added noise without
1060
1060
  * information. Scale awareness comes from the unit jump between rows.
1061
1061
  */
1062
- function kb(b) {
1062
+ export function kb(b) {
1063
1063
  if (!Number.isFinite(b) || b <= 0)
1064
1064
  return "0 B";
1065
1065
  if (b < 1024)
@@ -1,3 +1,5 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
1
3
  /**
2
4
  * Project-dir resolution helpers — shared between `start.mjs` (the MCP entry
3
5
  * point) and `src/server.ts getProjectDir()` (the consumer).
@@ -52,11 +54,6 @@ export function isPluginInstallPath(p) {
52
54
  * transcripts have older mtimes and are correctly ignored.
53
55
  */
54
56
  export function resolveProjectDirFromTranscript(opts) {
55
- // Inline imports kept private to this function — keeps the module test-
56
- // friendly when fs is stubbed at the call sites that don't use this path.
57
- // eslint-disable-next-line @typescript-eslint/no-require-imports
58
- const fs = require("node:fs");
59
- const path = require("node:path");
60
57
  if (!fs.existsSync(opts.projectsRoot))
61
58
  return undefined;
62
59
  let bestPath;
@@ -156,6 +153,13 @@ export function resolveProjectDir(opts) {
156
153
  env.OPENCODE_PROJECT_DIR,
157
154
  env.PI_PROJECT_DIR,
158
155
  env.IDEA_INITIAL_DIRECTORY,
156
+ // Issue #521: Cursor MCP env override. The cursor adapter already
157
+ // trusts CURSOR_CWD for hook input resolution (adapters/cursor/index.ts:581);
158
+ // mirror that trust here so ctx_stats / SessionDB / hash see the workspace
159
+ // path on Cursor. Whether Cursor itself sets this on MCP child spawn is
160
+ // unconfirmed — but documenting it as a supported override gives users a
161
+ // documented escape hatch (`~/.cursor/mcp.json` env: { CURSOR_CWD: "..." }).
162
+ env.CURSOR_CWD,
159
163
  env.CONTEXT_MODE_PROJECT_DIR,
160
164
  ];
161
165
  for (const c of candidates) {