@a1hvdy/cc-openclaw 0.11.0 → 0.12.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 (212) hide show
  1. package/dist/src/channels/telegram/event-reducer.js +3 -15
  2. package/dist/src/channels/telegram/event-reducer.js.map +1 -1
  3. package/dist/src/channels/telegram/format-helpers.d.ts +20 -0
  4. package/dist/src/channels/telegram/format-helpers.js +34 -0
  5. package/dist/src/channels/telegram/format-helpers.js.map +1 -0
  6. package/dist/src/channels/telegram/live-card.js +3 -21
  7. package/dist/src/channels/telegram/live-card.js.map +1 -1
  8. package/dist/src/channels/telegram/result-preview.d.ts +12 -0
  9. package/dist/src/channels/telegram/result-preview.js +48 -0
  10. package/dist/src/channels/telegram/result-preview.js.map +1 -0
  11. package/dist/src/channels/telegram/tool-tracker.d.ts +1 -2
  12. package/dist/src/channels/telegram/tool-tracker.js +6 -37
  13. package/dist/src/channels/telegram/tool-tracker.js.map +1 -1
  14. package/dist/src/cli/checks/bridge-wiring.d.ts +14 -0
  15. package/dist/src/cli/checks/bridge-wiring.js +64 -0
  16. package/dist/src/cli/checks/bridge-wiring.js.map +1 -0
  17. package/dist/src/cli/checks/config-schema.d.ts +11 -0
  18. package/dist/src/cli/checks/config-schema.js +51 -0
  19. package/dist/src/cli/checks/config-schema.js.map +1 -0
  20. package/dist/src/cli/checks/critical-openclaw-json-keys.d.ts +21 -0
  21. package/dist/src/cli/checks/critical-openclaw-json-keys.js +106 -0
  22. package/dist/src/cli/checks/critical-openclaw-json-keys.js.map +1 -0
  23. package/dist/src/cli/checks/install-path.d.ts +11 -0
  24. package/dist/src/cli/checks/install-path.js +89 -0
  25. package/dist/src/cli/checks/install-path.js.map +1 -0
  26. package/dist/src/cli/checks/patch-scaffold.d.ts +17 -0
  27. package/dist/src/cli/checks/patch-scaffold.js +56 -0
  28. package/dist/src/cli/checks/patch-scaffold.js.map +1 -0
  29. package/dist/src/cli/doctor.d.ts +5 -9
  30. package/dist/src/cli/doctor.js +28 -129
  31. package/dist/src/cli/doctor.js.map +1 -1
  32. package/dist/src/cli/index.js +2 -2
  33. package/dist/src/cli/index.js.map +1 -1
  34. package/dist/src/cli/migrate.d.ts +29 -0
  35. package/dist/src/cli/migrate.js +75 -0
  36. package/dist/src/cli/migrate.js.map +1 -0
  37. package/dist/src/config/drift-detector.d.ts +28 -0
  38. package/dist/src/config/drift-detector.js +75 -0
  39. package/dist/src/config/drift-detector.js.map +1 -0
  40. package/dist/src/config/loader.d.ts +8 -0
  41. package/dist/src/config/loader.js +69 -0
  42. package/dist/src/config/loader.js.map +1 -0
  43. package/dist/src/config/schema.d.ts +188 -0
  44. package/dist/src/config/schema.js +98 -0
  45. package/dist/src/config/schema.js.map +1 -0
  46. package/dist/src/council/build-agent-prompt.d.ts +11 -0
  47. package/dist/src/council/build-agent-prompt.js +96 -0
  48. package/dist/src/council/build-agent-prompt.js.map +1 -0
  49. package/dist/src/council/cleanup-worktrees.d.ts +10 -0
  50. package/dist/src/council/cleanup-worktrees.js +22 -0
  51. package/dist/src/council/cleanup-worktrees.js.map +1 -0
  52. package/dist/src/council/council.js +15 -186
  53. package/dist/src/council/council.js.map +1 -1
  54. package/dist/src/council/system-prompt.d.ts +16 -0
  55. package/dist/src/council/system-prompt.js +40 -0
  56. package/dist/src/council/system-prompt.js.map +1 -0
  57. package/dist/src/council/write-worktree-claude-md.d.ts +10 -0
  58. package/dist/src/council/write-worktree-claude-md.js +41 -0
  59. package/dist/src/council/write-worktree-claude-md.js.map +1 -0
  60. package/dist/src/engines/persistent-custom-session.js +3 -8
  61. package/dist/src/engines/persistent-custom-session.js.map +1 -1
  62. package/dist/src/engines/resolve-bin.d.ts +14 -0
  63. package/dist/src/engines/resolve-bin.js +18 -0
  64. package/dist/src/engines/resolve-bin.js.map +1 -0
  65. package/dist/src/lib/config-service.js +8 -0
  66. package/dist/src/lib/config-service.js.map +1 -1
  67. package/dist/src/lib/debounce.d.ts +12 -0
  68. package/dist/src/lib/debounce.js +23 -0
  69. package/dist/src/lib/debounce.js.map +1 -0
  70. package/dist/src/lib/domain-error.d.ts +59 -0
  71. package/dist/src/lib/domain-error.js +79 -0
  72. package/dist/src/lib/domain-error.js.map +1 -0
  73. package/dist/src/lib/json-array.d.ts +10 -0
  74. package/dist/src/lib/json-array.js +23 -0
  75. package/dist/src/lib/json-array.js.map +1 -0
  76. package/dist/src/lib/safe-upstream-probes.d.ts +25 -0
  77. package/dist/src/lib/safe-upstream-probes.js +42 -0
  78. package/dist/src/lib/safe-upstream-probes.js.map +1 -0
  79. package/dist/src/lib/spawn-async.d.ts +18 -0
  80. package/dist/src/lib/spawn-async.js +47 -0
  81. package/dist/src/lib/spawn-async.js.map +1 -0
  82. package/dist/src/lib/stale-pid-files.d.ts +17 -0
  83. package/dist/src/lib/stale-pid-files.js +40 -0
  84. package/dist/src/lib/stale-pid-files.js.map +1 -0
  85. package/dist/src/lifecycle/boot.d.ts +59 -0
  86. package/dist/src/lifecycle/boot.js +132 -0
  87. package/dist/src/lifecycle/boot.js.map +1 -0
  88. package/dist/src/lifecycle/patch-manifest.d.ts +82 -0
  89. package/dist/src/lifecycle/patch-manifest.js +126 -0
  90. package/dist/src/lifecycle/patch-manifest.js.map +1 -0
  91. package/dist/src/lifecycle/phase-import-upstream.d.ts +12 -0
  92. package/dist/src/lifecycle/phase-import-upstream.js +18 -0
  93. package/dist/src/lifecycle/phase-import-upstream.js.map +1 -0
  94. package/dist/src/lifecycle/phase-install-patches.d.ts +12 -0
  95. package/dist/src/lifecycle/phase-install-patches.js +31 -0
  96. package/dist/src/lifecycle/phase-install-patches.js.map +1 -0
  97. package/dist/src/lifecycle/phase-schedule-jobs.d.ts +12 -0
  98. package/dist/src/lifecycle/phase-schedule-jobs.js +15 -0
  99. package/dist/src/lifecycle/phase-schedule-jobs.js.map +1 -0
  100. package/dist/src/lifecycle/phase-start-server.d.ts +11 -0
  101. package/dist/src/lifecycle/phase-start-server.js +11 -0
  102. package/dist/src/lifecycle/phase-start-server.js.map +1 -0
  103. package/dist/src/lifecycle/phase-validate-config.d.ts +9 -0
  104. package/dist/src/lifecycle/phase-validate-config.js +25 -0
  105. package/dist/src/lifecycle/phase-validate-config.js.map +1 -0
  106. package/dist/src/lifecycle/phase-validate-upstream.d.ts +11 -0
  107. package/dist/src/lifecycle/phase-validate-upstream.js +16 -0
  108. package/dist/src/lifecycle/phase-validate-upstream.js.map +1 -0
  109. package/dist/src/lifecycle/phase-wire-handlers.d.ts +12 -0
  110. package/dist/src/lifecycle/phase-wire-handlers.js +16 -0
  111. package/dist/src/lifecycle/phase-wire-handlers.js.map +1 -0
  112. package/dist/src/observability/event-bus.d.ts +65 -0
  113. package/dist/src/observability/event-bus.js +52 -0
  114. package/dist/src/observability/event-bus.js.map +1 -0
  115. package/dist/src/observability/get-event-bus.d.ts +25 -0
  116. package/dist/src/observability/get-event-bus.js +34 -0
  117. package/dist/src/observability/get-event-bus.js.map +1 -0
  118. package/dist/src/observability/observability-service.d.ts +19 -0
  119. package/dist/src/observability/observability-service.js +24 -0
  120. package/dist/src/observability/observability-service.js.map +1 -0
  121. package/dist/src/observability/subscribers/metrics.d.ts +11 -0
  122. package/dist/src/observability/subscribers/metrics.js +21 -0
  123. package/dist/src/observability/subscribers/metrics.js.map +1 -0
  124. package/dist/src/observability/subscribers/session-capture.d.ts +15 -0
  125. package/dist/src/observability/subscribers/session-capture.js +25 -0
  126. package/dist/src/observability/subscribers/session-capture.js.map +1 -0
  127. package/dist/src/openai-compat/bridges/allowlist.d.ts +14 -5
  128. package/dist/src/openai-compat/bridges/allowlist.js +18 -7
  129. package/dist/src/openai-compat/bridges/allowlist.js.map +1 -1
  130. package/dist/src/openai-compat/bridges/openclaw-api-shim.d.ts +54 -0
  131. package/dist/src/openai-compat/bridges/openclaw-api-shim.js +45 -0
  132. package/dist/src/openai-compat/bridges/openclaw-api-shim.js.map +1 -0
  133. package/dist/src/openai-compat/openai-chunk-types.d.ts +35 -0
  134. package/dist/src/openai-compat/openai-chunk-types.js +9 -0
  135. package/dist/src/openai-compat/openai-chunk-types.js.map +1 -0
  136. package/dist/src/openai-compat/openai-compat.d.ts +2 -90
  137. package/dist/src/openai-compat/openai-compat.js +68 -68
  138. package/dist/src/openai-compat/openai-compat.js.map +1 -1
  139. package/dist/src/openai-compat/openai-types.d.ts +71 -0
  140. package/dist/src/openai-compat/openai-types.js +11 -0
  141. package/dist/src/openai-compat/openai-types.js.map +1 -0
  142. package/dist/src/openai-compat/parse-route-body.d.ts +24 -0
  143. package/dist/src/openai-compat/parse-route-body.js +45 -0
  144. package/dist/src/openai-compat/parse-route-body.js.map +1 -0
  145. package/dist/src/openai-compat/tts-rule.d.ts +20 -0
  146. package/dist/src/openai-compat/tts-rule.js +58 -0
  147. package/dist/src/openai-compat/tts-rule.js.map +1 -0
  148. package/dist/src/openai-compat/voice-recovery.js +0 -1
  149. package/dist/src/openai-compat/voice-recovery.js.map +1 -1
  150. package/dist/src/patches/cache-parity-registry.d.ts +20 -0
  151. package/dist/src/patches/cache-parity-registry.js +64 -0
  152. package/dist/src/patches/cache-parity-registry.js.map +1 -0
  153. package/dist/src/patches/claude-md-injection.d.ts +10 -0
  154. package/dist/src/patches/claude-md-injection.js +46 -0
  155. package/dist/src/patches/claude-md-injection.js.map +1 -0
  156. package/dist/src/patches/cwd-redirect.d.ts +10 -0
  157. package/dist/src/patches/cwd-redirect.js +51 -0
  158. package/dist/src/patches/cwd-redirect.js.map +1 -0
  159. package/dist/src/patches/embedded-server-route.d.ts +23 -0
  160. package/dist/src/patches/embedded-server-route.js +64 -0
  161. package/dist/src/patches/embedded-server-route.js.map +1 -0
  162. package/dist/src/patches/pricing-overrides.d.ts +10 -0
  163. package/dist/src/patches/pricing-overrides.js +55 -0
  164. package/dist/src/patches/pricing-overrides.js.map +1 -0
  165. package/dist/src/patches/resume-registry-restore.d.ts +11 -0
  166. package/dist/src/patches/resume-registry-restore.js +48 -0
  167. package/dist/src/patches/resume-registry-restore.js.map +1 -0
  168. package/dist/src/patches/session-pid-tracking.d.ts +10 -0
  169. package/dist/src/patches/session-pid-tracking.js +45 -0
  170. package/dist/src/patches/session-pid-tracking.js.map +1 -0
  171. package/dist/src/patches/sysprompt-strip.d.ts +46 -0
  172. package/dist/src/patches/sysprompt-strip.js +78 -0
  173. package/dist/src/patches/sysprompt-strip.js.map +1 -0
  174. package/dist/src/patches/sysprompt-strip.spec.d.ts +33 -0
  175. package/dist/src/patches/sysprompt-strip.spec.js +53 -0
  176. package/dist/src/patches/sysprompt-strip.spec.js.map +1 -0
  177. package/dist/src/patches/tools-restoration.d.ts +12 -0
  178. package/dist/src/patches/tools-restoration.js +43 -0
  179. package/dist/src/patches/tools-restoration.js.map +1 -0
  180. package/dist/src/persistence/migration-v0.d.ts +24 -0
  181. package/dist/src/persistence/migration-v0.js +142 -0
  182. package/dist/src/persistence/migration-v0.js.map +1 -0
  183. package/dist/src/persistence/session-registry.d.ts +57 -0
  184. package/dist/src/persistence/session-registry.js +58 -0
  185. package/dist/src/persistence/session-registry.js.map +1 -0
  186. package/dist/src/persistence/snapshot.d.ts +18 -0
  187. package/dist/src/persistence/snapshot.js +32 -0
  188. package/dist/src/persistence/snapshot.js.map +1 -0
  189. package/dist/src/persistence/wal.d.ts +17 -0
  190. package/dist/src/persistence/wal.js +32 -0
  191. package/dist/src/persistence/wal.js.map +1 -0
  192. package/dist/src/session/persisted-sessions.d.ts +26 -0
  193. package/dist/src/session/persisted-sessions.js +70 -0
  194. package/dist/src/session/persisted-sessions.js.map +1 -0
  195. package/dist/src/session/session-manager.d.ts +2 -11
  196. package/dist/src/session/session-manager.js +22 -66
  197. package/dist/src/session/session-manager.js.map +1 -1
  198. package/dist/src/session-bootstrap/boot-self-heal.d.ts +32 -0
  199. package/dist/src/session-bootstrap/boot-self-heal.js +54 -0
  200. package/dist/src/session-bootstrap/boot-self-heal.js.map +1 -0
  201. package/dist/src/session-bootstrap/cwd-patch.js +11 -87
  202. package/dist/src/session-bootstrap/cwd-patch.js.map +1 -1
  203. package/dist/src/session-bootstrap/resume-registry.d.ts +29 -0
  204. package/dist/src/session-bootstrap/resume-registry.js +58 -0
  205. package/dist/src/session-bootstrap/resume-registry.js.map +1 -0
  206. package/dist/src/session-bootstrap/session-hygiene.d.ts +23 -0
  207. package/dist/src/session-bootstrap/session-hygiene.js +41 -0
  208. package/dist/src/session-bootstrap/session-hygiene.js.map +1 -0
  209. package/dist/src/types/runtime-config.d.ts +11 -0
  210. package/dist/src/types/runtime-config.js +9 -0
  211. package/dist/src/types/runtime-config.js.map +1 -1
  212. package/package.json +1 -1
@@ -0,0 +1,64 @@
1
+ /**
2
+ * `check_bridge_wiring` — verifies the openai-compat bridge factory is
3
+ * structurally composed (Phase 5 Bridge Plane v0.11.0 contract).
4
+ *
5
+ * Dual-shape support:
6
+ * - Modern: `factory.ts` exports `makeToolBridge` + `activeToolMode`
7
+ * - Legacy: `factory.ts` exports `Embedded`/`PerMessage`/`NativeStream`/
8
+ * `OpenClawNative` directly (preserves pre-existing test mocks)
9
+ *
10
+ * Extracted from `doctor.ts` 2026-05-13 to keep that file under the
11
+ * 500-LOC ceiling.
12
+ */
13
+ const EXPECTED_FACTORY_EXPORTS = ['makeToolBridge', 'activeToolMode'];
14
+ const LEGACY_BRIDGE_MODES = ['Embedded', 'PerMessage', 'NativeStream', 'OpenClawNative'];
15
+ export async function checkBridgeWiring() {
16
+ const id = 'check_bridge_wiring';
17
+ let factory;
18
+ try {
19
+ factory = (await import('../../openai-compat/bridges/factory.js'));
20
+ }
21
+ catch (err) {
22
+ const matchesNotFound = (e) => e instanceof Error &&
23
+ ('code' in e
24
+ ? e.code === 'ERR_MODULE_NOT_FOUND'
25
+ : e.message.includes('Cannot find module') ||
26
+ e.message.includes('ERR_MODULE_NOT_FOUND'));
27
+ const isNotFound = matchesNotFound(err) || matchesNotFound(err.cause);
28
+ if (isNotFound) {
29
+ return { id, status: 'pending', detail: { reason: 'bridge module not yet shipped' } };
30
+ }
31
+ return {
32
+ id,
33
+ status: 'fail',
34
+ detail: { error: err instanceof Error ? err.message : String(err) },
35
+ };
36
+ }
37
+ // Modern factory shape: makeToolBridge + activeToolMode.
38
+ const presentFactory = EXPECTED_FACTORY_EXPORTS.filter((n) => n in factory);
39
+ if (presentFactory.length === EXPECTED_FACTORY_EXPORTS.length) {
40
+ return {
41
+ id,
42
+ status: 'pass',
43
+ detail: { factoryExports: presentFactory, missingBridges: [] },
44
+ };
45
+ }
46
+ // Legacy shape: all 4 bridge-mode names as direct exports.
47
+ const presentLegacyModes = LEGACY_BRIDGE_MODES.filter((m) => m in factory);
48
+ const missingBridges = LEGACY_BRIDGE_MODES.filter((m) => !(m in factory));
49
+ if (presentLegacyModes.length === LEGACY_BRIDGE_MODES.length) {
50
+ return { id, status: 'pass', detail: { bridges: presentLegacyModes, missingBridges: [] } };
51
+ }
52
+ return {
53
+ id,
54
+ status: 'fail',
55
+ detail: {
56
+ factoryExports: presentFactory,
57
+ bridges: presentLegacyModes,
58
+ missingBridges,
59
+ remediation: `factory.ts must export either ${EXPECTED_FACTORY_EXPORTS.join('+')} (modern) ` +
60
+ `or all of ${LEGACY_BRIDGE_MODES.join(',')} (legacy test shape)`,
61
+ },
62
+ };
63
+ }
64
+ //# sourceMappingURL=bridge-wiring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-wiring.js","sourceRoot":"","sources":["../../../../src/cli/checks/bridge-wiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAU,CAAC;AAC/E,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,CAAU,CAAC;AAElG,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,MAAM,EAAE,GAAG,qBAAqB,CAAC;IAEjC,IAAI,OAAgC,CAAC;IACrC,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,MAAM,MAAM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C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC;IAC3E,MAAM,cAAc,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC;IAC1E,IAAI,kBAAkB,CAAC,MAAM,KAAK,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE,CAAC;IAC7F,CAAC;IAED,OAAO;QACL,EAAE;QACF,MAAM,EAAE,MAAM;QACd,MAAM,EAAE;YACN,cAAc,EAAE,cAAc;YAC9B,OAAO,EAAE,kBAAkB;YAC3B,cAAc;YACd,WAAW,EACT,iCAAiC,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY;gBAC/E,aAAa,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB;SACnE;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `check_config_schema` — boot phase 1 dry-run.
3
+ *
4
+ * Parses env + ~/.openclaw/openclaw.json via the v1.0.0 typed `ConfigSchema`.
5
+ * Surfaces zod validation issues with phase-keyed remediation.
6
+ *
7
+ * Extracted from `doctor.ts` 2026-05-13 to keep that file under the
8
+ * 500-LOC ceiling.
9
+ */
10
+ import type { CheckResult } from './patch-scaffold.js';
11
+ export declare function checkConfigSchema(): CheckResult;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * `check_config_schema` — boot phase 1 dry-run.
3
+ *
4
+ * Parses env + ~/.openclaw/openclaw.json via the v1.0.0 typed `ConfigSchema`.
5
+ * Surfaces zod validation issues with phase-keyed remediation.
6
+ *
7
+ * Extracted from `doctor.ts` 2026-05-13 to keep that file under the
8
+ * 500-LOC ceiling.
9
+ */
10
+ import { ConfigSchema } from '../../config/schema.js';
11
+ import { loadConfigSources } from '../../config/loader.js';
12
+ export function checkConfigSchema() {
13
+ const id = 'check_config_schema';
14
+ try {
15
+ const raw = loadConfigSources();
16
+ const result = ConfigSchema.safeParse(raw);
17
+ if (result.success) {
18
+ return {
19
+ id,
20
+ status: 'pass',
21
+ detail: {
22
+ openclawCcOpenclawActive: result.data.openclawCcOpenclawActive,
23
+ openclawCcOpenclawListeners: result.data.openclawCcOpenclawListeners,
24
+ nativeToolsEnabled: result.data.ccOpenclaw.nativeTools.enabled,
25
+ nativeToolsAllowListSize: result.data.ccOpenclaw.nativeTools.allowList.length,
26
+ },
27
+ };
28
+ }
29
+ return {
30
+ id,
31
+ status: 'fail',
32
+ detail: {
33
+ phase: 'validate-config',
34
+ issues: result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`),
35
+ remediation: 'fix the listed config issues in ~/.openclaw/openclaw.json or env vars; ' +
36
+ 'see ConfigSchema in src/config/schema.ts for required shapes',
37
+ },
38
+ };
39
+ }
40
+ catch (err) {
41
+ return {
42
+ id,
43
+ status: 'fail',
44
+ detail: {
45
+ phase: 'validate-config',
46
+ error: err instanceof Error ? err.message : String(err),
47
+ },
48
+ };
49
+ }
50
+ }
51
+ //# sourceMappingURL=config-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-schema.js","sourceRoot":"","sources":["../../../../src/cli/checks/config-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,MAAM,UAAU,iBAAiB;IAC/B,MAAM,EAAE,GAAG,qBAAqB,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;gBACL,EAAE;gBACF,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE;oBACN,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,wBAAwB;oBAC9D,2BAA2B,EAAE,MAAM,CAAC,IAAI,CAAC,2BAA2B;oBACpE,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO;oBAC9D,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM;iBAC9E;aACF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,EAAE;YACF,MAAM,EAAE,MAAM;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,iBAAiB;gBACxB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;gBAC3E,WAAW,EACT,yEAAyE;oBACzE,8DAA8D;aACjE;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,EAAE;YACF,MAAM,EAAE,MAAM;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,iBAAiB;gBACxB,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * `check_critical_openclaw_json_keys` — OF5 drift-detection check.
3
+ *
4
+ * Validates the 4 load-bearing operational keys that `openclaw doctor --fix`
5
+ * has historically pruned. Each prune has caused a P1 incident:
6
+ *
7
+ * - models.providers["cc-openclaw"].timeoutSeconds ≥ 900
8
+ * (feedback_cc_openclaw_provider_timeout.md)
9
+ * - messages.tts.timeoutMs = 120000 (Chatterbox CPU ceiling)
10
+ * (feedback_openclaw_tts_timeout_chatterbox.md)
11
+ * - agents.defaults.model.fallbacks ends with "openai-codex/gpt-5.4"
12
+ * (feedback_cc_openclaw_cross_engine_fallback.md)
13
+ * - plugins.allow includes "cc-openclaw"
14
+ * (feedback_openclaw_plugins_allow_trumps.md)
15
+ *
16
+ * Extracted from `doctor.ts` 2026-05-13 to keep that file under the
17
+ * 500-LOC ceiling. Read directly via raw JSON.parse — bypasses openclaw's
18
+ * loadConfig schema validation (Phase E#3 finding 4).
19
+ */
20
+ import type { CheckResult } from './patch-scaffold.js';
21
+ export declare function checkCriticalOpenclawJsonKeys(): CheckResult;
@@ -0,0 +1,106 @@
1
+ /**
2
+ * `check_critical_openclaw_json_keys` — OF5 drift-detection check.
3
+ *
4
+ * Validates the 4 load-bearing operational keys that `openclaw doctor --fix`
5
+ * has historically pruned. Each prune has caused a P1 incident:
6
+ *
7
+ * - models.providers["cc-openclaw"].timeoutSeconds ≥ 900
8
+ * (feedback_cc_openclaw_provider_timeout.md)
9
+ * - messages.tts.timeoutMs = 120000 (Chatterbox CPU ceiling)
10
+ * (feedback_openclaw_tts_timeout_chatterbox.md)
11
+ * - agents.defaults.model.fallbacks ends with "openai-codex/gpt-5.4"
12
+ * (feedback_cc_openclaw_cross_engine_fallback.md)
13
+ * - plugins.allow includes "cc-openclaw"
14
+ * (feedback_openclaw_plugins_allow_trumps.md)
15
+ *
16
+ * Extracted from `doctor.ts` 2026-05-13 to keep that file under the
17
+ * 500-LOC ceiling. Read directly via raw JSON.parse — bypasses openclaw's
18
+ * loadConfig schema validation (Phase E#3 finding 4).
19
+ */
20
+ import { existsSync, readFileSync } from 'fs';
21
+ import { homedir } from 'os';
22
+ import { join } from 'path';
23
+ export function checkCriticalOpenclawJsonKeys() {
24
+ const id = 'check_critical_openclaw_json_keys';
25
+ const path = join(homedir(), '.openclaw', 'openclaw.json');
26
+ if (!existsSync(path)) {
27
+ return {
28
+ id,
29
+ status: 'fail',
30
+ detail: { path, error: 'openclaw.json not found' },
31
+ };
32
+ }
33
+ let json;
34
+ try {
35
+ json = JSON.parse(readFileSync(path, 'utf8'));
36
+ }
37
+ catch (err) {
38
+ return {
39
+ id,
40
+ status: 'fail',
41
+ detail: { path, error: err instanceof Error ? err.message : String(err) },
42
+ };
43
+ }
44
+ if (typeof json !== 'object' || json === null) {
45
+ return { id, status: 'fail', detail: { path, error: 'top-level is not an object' } };
46
+ }
47
+ const root = json;
48
+ const issues = [];
49
+ // Key 1: timeoutSeconds
50
+ const models = root['models'];
51
+ const providers = models?.['providers'];
52
+ const ccProvider = providers?.['cc-openclaw'];
53
+ const timeoutSeconds = ccProvider?.['timeoutSeconds'];
54
+ if (typeof timeoutSeconds !== 'number' || timeoutSeconds < 900) {
55
+ issues.push(`models.providers["cc-openclaw"].timeoutSeconds must be ≥ 900 (got ${String(timeoutSeconds)})`);
56
+ }
57
+ // Key 2: messages.tts.timeoutMs
58
+ const messages = root['messages'];
59
+ const tts = messages?.['tts'];
60
+ const timeoutMs = tts?.['timeoutMs'];
61
+ if (typeof timeoutMs !== 'number' || timeoutMs < 120_000) {
62
+ issues.push(`messages.tts.timeoutMs must be ≥ 120000 (got ${String(timeoutMs)}); ` +
63
+ 'Chatterbox CPU synthesis needs the full 120s schema cap');
64
+ }
65
+ // Key 3: fallback chain ends with gpt-5.4
66
+ const agents = root['agents'];
67
+ const defaults = agents?.['defaults'];
68
+ const model = defaults?.['model'];
69
+ const fallbacks = model?.['fallbacks'];
70
+ const lastFallback = Array.isArray(fallbacks) ? fallbacks[fallbacks.length - 1] : undefined;
71
+ if (lastFallback !== 'openai-codex/gpt-5.4') {
72
+ issues.push(`agents.defaults.model.fallbacks must end with "openai-codex/gpt-5.4" ` +
73
+ `(got "${String(lastFallback)}"); cross-engine escape required when same-pipeline cc-openclaw fails`);
74
+ }
75
+ // Key 4: plugins.allow contains cc-openclaw
76
+ const plugins = root['plugins'];
77
+ const allow = plugins?.['allow'];
78
+ const allowList = Array.isArray(allow) ? allow : [];
79
+ if (!allowList.includes('cc-openclaw')) {
80
+ issues.push('plugins.allow must include "cc-openclaw" (otherwise enabledByDefault is overridden)');
81
+ }
82
+ if (issues.length === 0) {
83
+ return {
84
+ id,
85
+ status: 'pass',
86
+ detail: {
87
+ path,
88
+ timeoutSeconds,
89
+ timeoutMs,
90
+ fallbackChainEndsAtGpt54: true,
91
+ ccOpenclawInPluginsAllow: true,
92
+ },
93
+ };
94
+ }
95
+ return {
96
+ id,
97
+ status: 'fail',
98
+ detail: {
99
+ path,
100
+ issues,
101
+ remediation: 'these keys have a history of being pruned by `openclaw doctor --fix`; ' +
102
+ 're-apply them via direct openclaw.json edit',
103
+ },
104
+ };
105
+ }
106
+ //# sourceMappingURL=critical-openclaw-json-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"critical-openclaw-json-keys.js","sourceRoot":"","sources":["../../../../src/cli/checks/critical-openclaw-json-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,MAAM,UAAU,6BAA6B;IAC3C,MAAM,EAAE,GAAG,mCAAmC,CAAC;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;IAC3D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO;YACL,EAAE;YACF,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,yBAAyB,EAAE;SACnD,CAAC;IACJ,CAAC;IACD,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI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,MAAM,EAAE;gBACN,IAAI;gBACJ,cAAc;gBACd,SAAS;gBACT,wBAAwB,EAAE,IAAI;gBAC9B,wBAAwB,EAAE,IAAI;aAC/B;SACF,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE;QACF,MAAM,EAAE,MAAM;QACd,MAAM,EAAE;YACN,IAAI;YACJ,MAAM;YACN,WAAW,EACT,wEAAwE;gBACxE,6CAA6C;SAChD;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `check_install_path` — resolves which of the 3 known openclaw extension
3
+ * paths cc-openclaw was loaded from; compares installed version to this
4
+ * binary's built version.
5
+ *
6
+ * Extracted from `doctor.ts` 2026-05-13 along with its helpers
7
+ * (findProjectRoot, SELF_VERSION, INSTALL_CANDIDATES) to keep doctor.ts
8
+ * under the 500-LOC ceiling.
9
+ */
10
+ import type { CheckResult } from './patch-scaffold.js';
11
+ export declare function checkInstallPath(selfVersion?: string): CheckResult;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * `check_install_path` — resolves which of the 3 known openclaw extension
3
+ * paths cc-openclaw was loaded from; compares installed version to this
4
+ * binary's built version.
5
+ *
6
+ * Extracted from `doctor.ts` 2026-05-13 along with its helpers
7
+ * (findProjectRoot, SELF_VERSION, INSTALL_CANDIDATES) to keep doctor.ts
8
+ * under the 500-LOC ceiling.
9
+ */
10
+ import { existsSync, readFileSync } from 'fs';
11
+ import { homedir } from 'os';
12
+ import { join, dirname } from 'path';
13
+ import { fileURLToPath } from 'url';
14
+ // Locate package.json by walking up from this file's directory until we find it.
15
+ // Works in both runtime (dist/src/cli/checks/) and vitest (src/cli/checks/) contexts.
16
+ function findProjectRoot(startDir) {
17
+ let dir = startDir;
18
+ for (let i = 0; i < 10; i++) {
19
+ if (existsSync(join(dir, 'package.json')))
20
+ return dir;
21
+ const parent = dirname(dir);
22
+ if (parent === dir)
23
+ break;
24
+ dir = parent;
25
+ }
26
+ throw new Error('cc-openclaw: could not locate project root package.json');
27
+ }
28
+ // Resolved lazily-at-import with a fallback so a mocked fs (vitest) or an
29
+ // unreachable path doesn't crash the entire module load.
30
+ let SELF_VERSION;
31
+ try {
32
+ const _thisDir = dirname(fileURLToPath(import.meta.url));
33
+ const _projectRoot = findProjectRoot(_thisDir);
34
+ const selfPkg = JSON.parse(readFileSync(join(_projectRoot, 'package.json'), 'utf8'));
35
+ SELF_VERSION = String(selfPkg.version ?? 'unknown');
36
+ }
37
+ catch {
38
+ SELF_VERSION = 'unknown';
39
+ }
40
+ const INSTALL_CANDIDATES = [
41
+ join(homedir(), '.npm-global/lib/node_modules/openclaw/dist/extensions/cc-openclaw'),
42
+ '/usr/local/lib/node_modules/openclaw/dist/extensions/cc-openclaw',
43
+ join(homedir(), '.openclaw/extensions/cc-openclaw'),
44
+ ];
45
+ export function checkInstallPath(selfVersion = SELF_VERSION) {
46
+ const id = 'check_install_path';
47
+ for (const candidate of INSTALL_CANDIDATES) {
48
+ const pkgPath = join(candidate, 'package.json');
49
+ if (!existsSync(pkgPath))
50
+ continue;
51
+ let installedVersion;
52
+ try {
53
+ const installedPkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
54
+ installedVersion = String(installedPkg.version ?? 'unknown');
55
+ }
56
+ catch {
57
+ return {
58
+ id,
59
+ status: 'fail',
60
+ detail: {
61
+ path: candidate,
62
+ candidatesSearched: INSTALL_CANDIDATES,
63
+ error: 'could not parse package.json at resolved path',
64
+ },
65
+ };
66
+ }
67
+ const mismatch = installedVersion !== selfVersion;
68
+ return {
69
+ id,
70
+ status: mismatch ? 'fail' : 'pass',
71
+ detail: {
72
+ path: candidate,
73
+ candidatesSearched: INSTALL_CANDIDATES,
74
+ version: installedVersion,
75
+ selfVersion,
76
+ mismatch,
77
+ },
78
+ };
79
+ }
80
+ return {
81
+ id,
82
+ status: 'fail',
83
+ detail: {
84
+ candidatesSearched: INSTALL_CANDIDATES,
85
+ error: 'cc-openclaw not found in any known openclaw extension path',
86
+ },
87
+ };
88
+ }
89
+ //# sourceMappingURL=install-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-path.js","sourceRoot":"","sources":["../../../../src/cli/checks/install-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,iFAAiF;AACjF,sFAAsF;AACtF,SAAS,eAAe,CAAC,QAAgB;IACvC,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACtD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;AAC7E,CAAC;AAED,0EAA0E;AAC1E,yDAAyD;AACzD,IAAI,YAAoB,CAAC;AACzB,IAAI,CAAC;IACH,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAyB,IAAI,CAAC,KAAK,CAC9C,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACzD,CAAC;IACF,YAAY,GAAG,MAAM,CAAC,OAAO,C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,CAAC;IAED,OAAO;QACL,EAAE;QACF,MAAM,EAAE,MAAM;QACd,MAAM,EAAE;YACN,kBAAkB,EAAE,kBAAkB;YACtC,KAAK,EAAE,4DAA4D;SACpE;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `check_patch_scaffold` — registers all 9 Phase E#3 PatchSpec scaffolds in a
3
+ * PatchManifest and runs `validate()` against the live `openclaw` peer dep.
4
+ *
5
+ * Extracted from `doctor.ts` to keep that file under the 500-LOC ceiling
6
+ * and establish the per-check module pattern.
7
+ *
8
+ * Phase E#3 fills in real probe bodies; this check evolves with them. Today
9
+ * the probes verify specific upstream symbols + pure-function determinism —
10
+ * any catastrophic upstream API loss fails the check.
11
+ */
12
+ export interface CheckResult {
13
+ id: string;
14
+ status: 'pass' | 'fail' | 'pending';
15
+ detail: Record<string, unknown>;
16
+ }
17
+ export declare function checkPatchScaffold(): Promise<CheckResult>;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * `check_patch_scaffold` — registers all 9 Phase E#3 PatchSpec scaffolds in a
3
+ * PatchManifest and runs `validate()` against the live `openclaw` peer dep.
4
+ *
5
+ * Extracted from `doctor.ts` to keep that file under the 500-LOC ceiling
6
+ * and establish the per-check module pattern.
7
+ *
8
+ * Phase E#3 fills in real probe bodies; this check evolves with them. Today
9
+ * the probes verify specific upstream symbols + pure-function determinism —
10
+ * any catastrophic upstream API loss fails the check.
11
+ */
12
+ import { PatchManifest } from '../../lifecycle/patch-manifest.js';
13
+ export async function checkPatchScaffold() {
14
+ const id = 'check_patch_scaffold';
15
+ try {
16
+ const [{ syspromptStripSpec }, { cacheParityRegistrySpec }, { embeddedServerRouteSpec }, { pricingOverridesSpec }, { resumeRegistryRestoreSpec }, { sessionPidTrackingSpec }, { cwdRedirectSpec }, { toolsRestorationSpec }, { claudeMdInjectionSpec },] = await Promise.all([
17
+ import('../../patches/sysprompt-strip.js'),
18
+ import('../../patches/cache-parity-registry.js'),
19
+ import('../../patches/embedded-server-route.js'),
20
+ import('../../patches/pricing-overrides.js'),
21
+ import('../../patches/resume-registry-restore.js'),
22
+ import('../../patches/session-pid-tracking.js'),
23
+ import('../../patches/cwd-redirect.js'),
24
+ import('../../patches/tools-restoration.js'),
25
+ import('../../patches/claude-md-injection.js'),
26
+ ]);
27
+ const manifest = new PatchManifest();
28
+ manifest.register(syspromptStripSpec);
29
+ manifest.register(cacheParityRegistrySpec);
30
+ manifest.register(embeddedServerRouteSpec);
31
+ manifest.register(pricingOverridesSpec);
32
+ manifest.register(resumeRegistryRestoreSpec);
33
+ manifest.register(sessionPidTrackingSpec);
34
+ manifest.register(cwdRedirectSpec);
35
+ manifest.register(toolsRestorationSpec);
36
+ manifest.register(claudeMdInjectionSpec);
37
+ await manifest.validate();
38
+ return {
39
+ id,
40
+ status: 'pass',
41
+ detail: { specCount: manifest.size, ids: manifest.ids() },
42
+ };
43
+ }
44
+ catch (err) {
45
+ return {
46
+ id,
47
+ status: 'fail',
48
+ detail: {
49
+ error: err instanceof Error ? err.message : String(err),
50
+ remediation: 'one or more PatchSpec probes detected drift against `openclaw`; ' +
51
+ 'review `tests/patches/all-specs-compose.test.ts` for the failing spec',
52
+ },
53
+ };
54
+ }
55
+ }
56
+ //# sourceMappingURL=patch-scaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-scaffold.js","sourceRoot":"","sources":["../../../../src/cli/checks/patch-scaffold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAQlE,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,EAAE,GAAG,sBAAsB,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,CACJ,EAAE,kBAAkB,EAAE,EACtB,EAAE,uBAAuB,EAAE,EAC3B,EAAE,uBAAuB,EAAE,EAC3B,EAAE,oBAAoB,EAAE,EACxB,EAAE,yBAAyB,EAAE,EAC7B,EAAE,sB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b,OAAO;YACL,EAAE;YACF,MAAM,EAAE,MAAM;YACd,MAAM,EAAE;gBACN,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;gBACvD,WAAW,EACT,kEAAkE;oBAClE,uEAAuE;aAC1E;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -12,13 +12,9 @@
12
12
  * Future planes add checks via the exported `ALL_CHECKS` registry.
13
13
  */
14
14
  import { Command } from 'commander';
15
- type CheckStatus = 'pass' | 'fail' | 'pending';
16
- interface CheckResult {
17
- id: string;
18
- status: CheckStatus;
19
- detail: Record<string, unknown>;
20
- }
21
- export declare function checkInstallPath(selfVersion?: string): CheckResult;
22
- export declare function checkBridgeWiring(): Promise<CheckResult>;
15
+ export { checkInstallPath } from './checks/install-path.js';
16
+ export { checkBridgeWiring } from './checks/bridge-wiring.js';
17
+ export { checkConfigSchema } from './checks/config-schema.js';
18
+ export { checkCriticalOpenclawJsonKeys } from './checks/critical-openclaw-json-keys.js';
19
+ export { checkPatchScaffold } from './checks/patch-scaffold.js';
23
20
  export declare function createDoctorCommand(): Command;
24
- export {};