@a1hvdy/cc-openclaw 0.30.0 → 0.32.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/src/channels/telegram-mirror/card-renderer.js +9 -5
- package/dist/src/channels/telegram-mirror/commands.js +0 -8
- package/dist/src/channels/telegram-mirror/status-line.js +32 -2
- package/dist/src/constants.js +16 -2
- package/dist/src/engines/persistent-session.js +11 -0
- package/dist/src/lib/config.js +40 -0
- package/dist/src/openai-compat/non-streaming-handler.js +2 -2
- package/dist/src/openai-compat/streaming-handler.js +121 -9
- package/package.json +3 -2
- package/dist/src/channels/adapter.d.ts +0 -103
- package/dist/src/channels/telegram-mirror/askuser.d.ts +0 -107
- package/dist/src/channels/telegram-mirror/burst-accumulator.d.ts +0 -96
- package/dist/src/channels/telegram-mirror/callback-mapping.d.ts +0 -61
- package/dist/src/channels/telegram-mirror/card-renderer.d.ts +0 -68
- package/dist/src/channels/telegram-mirror/card-state.d.ts +0 -83
- package/dist/src/channels/telegram-mirror/commands.d.ts +0 -183
- package/dist/src/channels/telegram-mirror/compose-buffer.d.ts +0 -71
- package/dist/src/channels/telegram-mirror/cost-views.d.ts +0 -58
- package/dist/src/channels/telegram-mirror/failure/callback-data-overflow.d.ts +0 -21
- package/dist/src/channels/telegram-mirror/failure/gateway-down.d.ts +0 -15
- package/dist/src/channels/telegram-mirror/failure/in-flight-conflict.d.ts +0 -15
- package/dist/src/channels/telegram-mirror/failure/index.d.ts +0 -23
- package/dist/src/channels/telegram-mirror/failure/model-5xx.d.ts +0 -16
- package/dist/src/channels/telegram-mirror/failure/network-blip.d.ts +0 -17
- package/dist/src/channels/telegram-mirror/failure/pool-exhausted-fallback.d.ts +0 -15
- package/dist/src/channels/telegram-mirror/failure/rate-limit.d.ts +0 -16
- package/dist/src/channels/telegram-mirror/failure/returning-after-24h.d.ts +0 -14
- package/dist/src/channels/telegram-mirror/failure/types.d.ts +0 -30
- package/dist/src/channels/telegram-mirror/inbound-handler.d.ts +0 -73
- package/dist/src/channels/telegram-mirror/index.d.ts +0 -32
- package/dist/src/channels/telegram-mirror/plan-attachment.d.ts +0 -120
- package/dist/src/channels/telegram-mirror/quota-reader.d.ts +0 -42
- package/dist/src/channels/telegram-mirror/sessions-keyboard.d.ts +0 -84
- package/dist/src/channels/telegram-mirror/soak-log.d.ts +0 -99
- package/dist/src/channels/telegram-mirror/state-machine.d.ts +0 -113
- package/dist/src/channels/telegram-mirror/status-line.d.ts +0 -51
- package/dist/src/channels/telegram-mirror/sync-commands.d.ts +0 -100
- package/dist/src/channels/telegram-mirror/threshold-watcher.d.ts +0 -54
- package/dist/src/channels/telegram-mirror/turn-bridge.d.ts +0 -125
- package/dist/src/cli/checks/bridge-wiring.d.ts +0 -14
- package/dist/src/cli/checks/config-schema.d.ts +0 -11
- package/dist/src/cli/checks/critical-openclaw-json-keys.d.ts +0 -21
- package/dist/src/cli/checks/install-path.d.ts +0 -11
- package/dist/src/cli/checks/patch-scaffold.d.ts +0 -17
- package/dist/src/cli/doctor.d.ts +0 -20
- package/dist/src/cli/index.d.ts +0 -8
- package/dist/src/cli/migrate.d.ts +0 -29
- package/dist/src/command-router/cc-handler.d.ts +0 -67
- package/dist/src/command-router/index.d.ts +0 -2
- package/dist/src/command-router/launch-policy.d.ts +0 -92
- package/dist/src/command-router/resume-policy.d.ts +0 -18
- package/dist/src/command-router/turn-formatter.d.ts +0 -19
- package/dist/src/config/loader.d.ts +0 -8
- package/dist/src/config/schema.d.ts +0 -192
- package/dist/src/constants.d.ts +0 -191
- package/dist/src/council/build-agent-prompt.d.ts +0 -11
- package/dist/src/council/cleanup-worktrees.d.ts +0 -10
- package/dist/src/council/consensus.d.ts +0 -20
- package/dist/src/council/council.d.ts +0 -67
- package/dist/src/council/index.d.ts +0 -2
- package/dist/src/council/system-prompt.d.ts +0 -16
- package/dist/src/council/write-worktree-claude-md.d.ts +0 -10
- package/dist/src/engines/base-oneshot-session.d.ts +0 -87
- package/dist/src/engines/heartbeat-guard.d.ts +0 -93
- package/dist/src/engines/index.d.ts +0 -8
- package/dist/src/engines/persistent-codex-session.d.ts +0 -16
- package/dist/src/engines/persistent-cursor-session.d.ts +0 -21
- package/dist/src/engines/persistent-custom-session.d.ts +0 -78
- package/dist/src/engines/persistent-gemini-session.d.ts +0 -21
- package/dist/src/engines/persistent-session.d.ts +0 -95
- package/dist/src/engines/resolve-bin.d.ts +0 -14
- package/dist/src/engines/subprocess-pool.d.ts +0 -78
- package/dist/src/health/handler.d.ts +0 -39
- package/dist/src/health/index.d.ts +0 -1
- package/dist/src/health/metrics.d.ts +0 -52
- package/dist/src/index.d.ts +0 -57
- package/dist/src/lib/auto-recovery.d.ts +0 -43
- package/dist/src/lib/cache-parity-decide.d.ts +0 -64
- package/dist/src/lib/cache-parity.d.ts +0 -38
- package/dist/src/lib/cc-cli-scan.d.ts +0 -52
- package/dist/src/lib/circuit-breaker.d.ts +0 -21
- package/dist/src/lib/config-service.d.ts +0 -106
- package/dist/src/lib/config.d.ts +0 -136
- package/dist/src/lib/cost-rollup.d.ts +0 -36
- package/dist/src/lib/debounce.d.ts +0 -12
- package/dist/src/lib/debug-tap.d.ts +0 -13
- package/dist/src/lib/domain-error.d.ts +0 -59
- package/dist/src/lib/drift-detector.d.ts +0 -46
- package/dist/src/lib/env-overrides.d.ts +0 -47
- package/dist/src/lib/error-formatter.d.ts +0 -91
- package/dist/src/lib/error-renderer.d.ts +0 -20
- package/dist/src/lib/heartbeat-config.d.ts +0 -34
- package/dist/src/lib/heartbeat-workaround.d.ts +0 -44
- package/dist/src/lib/html-render.d.ts +0 -50
- package/dist/src/lib/http-agent.d.ts +0 -47
- package/dist/src/lib/index.d.ts +0 -7
- package/dist/src/lib/index.js +0 -10
- package/dist/src/lib/json-array.d.ts +0 -10
- package/dist/src/lib/markdown-to-mdv2.d.ts +0 -53
- package/dist/src/lib/markdown-v2.d.ts +0 -27
- package/dist/src/lib/perf/async-compact.d.ts +0 -26
- package/dist/src/lib/perf/direct-sdk.d.ts +0 -26
- package/dist/src/lib/perf/haiku-route.d.ts +0 -19
- package/dist/src/lib/perf/predictive-continuation.d.ts +0 -18
- package/dist/src/lib/perf/read-batch.d.ts +0 -33
- package/dist/src/lib/perf/skill-list-collapse.d.ts +0 -22
- package/dist/src/lib/perf/speculative-bubble.d.ts +0 -27
- package/dist/src/lib/perf/typing-prefetch.d.ts +0 -25
- package/dist/src/lib/probes.d.ts +0 -50
- package/dist/src/lib/register-guard.d.ts +0 -56
- package/dist/src/lib/req-shape-log.d.ts +0 -31
- package/dist/src/lib/safe-upstream-probes.d.ts +0 -25
- package/dist/src/lib/session-registry.d.ts +0 -66
- package/dist/src/lib/spawn-async.d.ts +0 -18
- package/dist/src/lib/status-tee-reader.d.ts +0 -29
- package/dist/src/lib/sysprompt-strip.d.ts +0 -53
- package/dist/src/lib/telegram-bot-api.d.ts +0 -146
- package/dist/src/lib/telemetry.d.ts +0 -38
- package/dist/src/lib/test-mode.d.ts +0 -26
- package/dist/src/lib/trajectory.d.ts +0 -44
- package/dist/src/lib/vendor-paths.d.ts +0 -12
- package/dist/src/lifecycle/boot.d.ts +0 -48
- package/dist/src/lifecycle/patch-manifest.d.ts +0 -82
- package/dist/src/lifecycle/phase-import-upstream.d.ts +0 -12
- package/dist/src/lifecycle/phase-install-patches.d.ts +0 -12
- package/dist/src/lifecycle/phase-schedule-jobs.d.ts +0 -12
- package/dist/src/lifecycle/phase-start-server.d.ts +0 -11
- package/dist/src/lifecycle/phase-validate-config.d.ts +0 -9
- package/dist/src/lifecycle/phase-validate-upstream.d.ts +0 -11
- package/dist/src/lifecycle/phase-wire-handlers.d.ts +0 -12
- package/dist/src/lifecycle/safe-restart.d.ts +0 -99
- package/dist/src/logger.d.ts +0 -14
- package/dist/src/mcp/bridge.d.ts +0 -21
- package/dist/src/mcp/index.d.ts +0 -2
- package/dist/src/models.d.ts +0 -68
- package/dist/src/observability/event-bus.d.ts +0 -86
- package/dist/src/observability/get-event-bus.d.ts +0 -25
- package/dist/src/observability/observability-service.d.ts +0 -19
- package/dist/src/observability/perf-telemetry.d.ts +0 -65
- package/dist/src/observability/subscribers/metrics.d.ts +0 -11
- package/dist/src/observability/subscribers/session-capture.d.ts +0 -15
- package/dist/src/openai-compat/autonomy-rule.d.ts +0 -26
- package/dist/src/openai-compat/bridges/allowlist.d.ts +0 -19
- package/dist/src/openai-compat/bridges/factory.d.ts +0 -30
- package/dist/src/openai-compat/bridges/media-bridge.d.ts +0 -34
- package/dist/src/openai-compat/bridges/openclaw-api-shim.d.ts +0 -54
- package/dist/src/openai-compat/bridges/openclaw-native-tools.d.ts +0 -61
- package/dist/src/openai-compat/bridges/openclaw-tool-registry.d.ts +0 -26
- package/dist/src/openai-compat/bridges/tts-media-bridge.d.ts +0 -19
- package/dist/src/openai-compat/chat-cwd.d.ts +0 -22
- package/dist/src/openai-compat/cli-stream-parser.d.ts +0 -134
- package/dist/src/openai-compat/index.d.ts +0 -1
- package/dist/src/openai-compat/message-extractor.d.ts +0 -84
- package/dist/src/openai-compat/mode-flags.d.ts +0 -34
- package/dist/src/openai-compat/non-streaming-handler.d.ts +0 -29
- package/dist/src/openai-compat/openai-chunk-types.d.ts +0 -35
- package/dist/src/openai-compat/openai-compat.d.ts +0 -49
- package/dist/src/openai-compat/openai-types.d.ts +0 -71
- package/dist/src/openai-compat/parse-route-body.d.ts +0 -24
- package/dist/src/openai-compat/prompts.d.ts +0 -47
- package/dist/src/openai-compat/request-coalescer.d.ts +0 -77
- package/dist/src/openai-compat/response-formatter.d.ts +0 -33
- package/dist/src/openai-compat/session-key-resolver.d.ts +0 -41
- package/dist/src/openai-compat/skill-resolver.d.ts +0 -59
- package/dist/src/openai-compat/sse-translator.d.ts +0 -51
- package/dist/src/openai-compat/status-reporter.d.ts +0 -30
- package/dist/src/openai-compat/streaming-handler.d.ts +0 -52
- package/dist/src/openai-compat/tool-calls-parser.d.ts +0 -34
- package/dist/src/openai-compat/tool-results-serializer.d.ts +0 -60
- package/dist/src/openai-compat/tts-rule.d.ts +0 -20
- package/dist/src/openai-compat/voice-recovery.d.ts +0 -56
- package/dist/src/patches/cache-parity-registry.d.ts +0 -103
- package/dist/src/patches/claude-md-injection.d.ts +0 -10
- package/dist/src/patches/cwd-redirect.d.ts +0 -10
- package/dist/src/patches/embedded-server-route.d.ts +0 -23
- package/dist/src/patches/pricing-overrides.d.ts +0 -10
- package/dist/src/patches/resume-registry-restore.d.ts +0 -11
- package/dist/src/patches/session-pid-tracking.d.ts +0 -10
- package/dist/src/patches/sysprompt-strip.d.ts +0 -46
- package/dist/src/patches/tools-restoration.d.ts +0 -12
- package/dist/src/persistence/migration-v0.d.ts +0 -24
- package/dist/src/persistence/session-registry.d.ts +0 -58
- package/dist/src/proxy/anthropic-adapter.d.ts +0 -136
- package/dist/src/proxy/handler.d.ts +0 -39
- package/dist/src/proxy/index.d.ts +0 -4
- package/dist/src/proxy/schema-cleaner.d.ts +0 -11
- package/dist/src/proxy/thought-cache.d.ts +0 -19
- package/dist/src/session/embedded-server.d.ts +0 -25
- package/dist/src/session/inbox-manager.d.ts +0 -38
- package/dist/src/session/index.d.ts +0 -3
- package/dist/src/session/persisted-sessions.d.ts +0 -50
- package/dist/src/session/session-manager.d.ts +0 -247
- package/dist/src/session/watchdogs.d.ts +0 -92
- package/dist/src/session-bootstrap/boot-self-heal.d.ts +0 -32
- package/dist/src/session-bootstrap/cwd-patch.d.ts +0 -50
- package/dist/src/session-bootstrap/index.d.ts +0 -3
- package/dist/src/session-bootstrap/resume-registry.d.ts +0 -27
- package/dist/src/session-bootstrap/session-hygiene.d.ts +0 -23
- package/dist/src/session-bootstrap/sysprompt-strip.d.ts +0 -24
- package/dist/src/session-bootstrap/think-conflict-resolver.d.ts +0 -32
- package/dist/src/types/route.d.ts +0 -11
- package/dist/src/types/runtime-config.d.ts +0 -208
- package/dist/src/types/sse.d.ts +0 -29
- package/dist/src/types/tool-bridge.d.ts +0 -82
- package/dist/src/types/upstream.d.ts +0 -580
- package/dist/src/types.d.ts +0 -498
- package/dist/src/validation.d.ts +0 -31
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* src/channels/telegram-mirror/soak-log.ts — v0.25.0 M14.
|
|
3
|
-
*
|
|
4
|
-
* Daily JSONL incident + activity log for the 2-week soak (M14 → M15
|
|
5
|
-
* cutover gate). Writes append-only rows to
|
|
6
|
-
* workspace/memory/mirror-soak-<YYYY-MM-DD>.jsonl
|
|
7
|
-
* per PRP §5 M14. The file rolls at UTC midnight (date-stamped path).
|
|
8
|
-
*
|
|
9
|
-
* Three row types per spec:
|
|
10
|
-
* • laptop-check — A1 self-reports opened-laptop-today via /soak-check.
|
|
11
|
-
* • failure-incident — fires once per M12 handler invocation in soak.
|
|
12
|
-
* • slash-invocation — one row per slash command dispatch.
|
|
13
|
-
*
|
|
14
|
-
* Idempotency: a single laptop-check per UTC day. recordLaptopCheck()
|
|
15
|
-
* returns false on the second call within a day so the /soak-check
|
|
16
|
-
* handler can surface "already recorded today" UX rather than logging
|
|
17
|
-
* duplicates.
|
|
18
|
-
*
|
|
19
|
-
* Decision-link: this file is the only filesystem-touching mirror module
|
|
20
|
-
* outside session-registry (M1). Both share the atomic-write-via-rename
|
|
21
|
-
* idiom; soak-log appends so it doesn't need the tmpfile dance, but the
|
|
22
|
-
* path resolution is the same shape.
|
|
23
|
-
*/
|
|
24
|
-
export type SoakRow = SoakLaptopCheckRow | SoakFailureRow | SoakSlashRow;
|
|
25
|
-
interface SoakLaptopCheckRow {
|
|
26
|
-
ts: string;
|
|
27
|
-
type: 'laptop-check';
|
|
28
|
-
openedLaptop: boolean;
|
|
29
|
-
}
|
|
30
|
-
interface SoakFailureRow {
|
|
31
|
-
ts: string;
|
|
32
|
-
type: 'failure-incident';
|
|
33
|
-
mode: string;
|
|
34
|
-
chatId: string | number;
|
|
35
|
-
info?: unknown;
|
|
36
|
-
}
|
|
37
|
-
interface SoakSlashRow {
|
|
38
|
-
ts: string;
|
|
39
|
-
type: 'slash-invocation';
|
|
40
|
-
cmd: string;
|
|
41
|
-
chatId: string | number;
|
|
42
|
-
}
|
|
43
|
-
export interface SoakLoggerOptions {
|
|
44
|
-
/** Override base dir for tests (defaults to ~/.openclaw/workspace/memory). */
|
|
45
|
-
dir?: string;
|
|
46
|
-
/** Override clock for tests. */
|
|
47
|
-
now?: () => Date;
|
|
48
|
-
}
|
|
49
|
-
export declare class SoakLogger {
|
|
50
|
-
private readonly dir;
|
|
51
|
-
private readonly now;
|
|
52
|
-
constructor(opts?: SoakLoggerOptions);
|
|
53
|
-
/**
|
|
54
|
-
* Absolute path of today's JSONL file. Honors the configured clock.
|
|
55
|
-
*/
|
|
56
|
-
pathForToday(): string;
|
|
57
|
-
/**
|
|
58
|
-
* Append a row to today's file. Creates the parent directory if missing.
|
|
59
|
-
* Each row is `JSON.stringify(row) + '\n'`.
|
|
60
|
-
*/
|
|
61
|
-
append(row: SoakRow): void;
|
|
62
|
-
/**
|
|
63
|
-
* Read all rows for today (parsing each line). Returns [] when the
|
|
64
|
-
* file is missing OR when every line is malformed.
|
|
65
|
-
*/
|
|
66
|
-
readToday(): SoakRow[];
|
|
67
|
-
/**
|
|
68
|
-
* Returns true iff a laptop-check row has already been written today.
|
|
69
|
-
* Used by /soak-check's once-per-day gate.
|
|
70
|
-
*/
|
|
71
|
-
hasLaptopCheckToday(): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Idempotent laptop-check writer. Returns true when the row was
|
|
74
|
-
* persisted, false when a check was already recorded today.
|
|
75
|
-
*/
|
|
76
|
-
recordLaptopCheck(openedLaptop: boolean): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Failure-incident logger — called by the dispatcher when a M12
|
|
79
|
-
* handler fires. The info payload is opaque JSON; the schema is
|
|
80
|
-
* per-mode and lives in the handler's documentation.
|
|
81
|
-
*/
|
|
82
|
-
recordFailure(mode: string, chatId: string | number, info?: unknown): void;
|
|
83
|
-
/**
|
|
84
|
-
* Slash-invocation logger — called once per dispatchCommand call by
|
|
85
|
-
* the dispatcher (M5+). Cheap to record and lets the soak surface
|
|
86
|
-
* which commands A1 actually uses on phone.
|
|
87
|
-
*/
|
|
88
|
-
recordSlash(cmd: string, chatId: string | number): void;
|
|
89
|
-
/**
|
|
90
|
-
* Count rows by type for the day — used by M15's "5/7 no-laptop days"
|
|
91
|
-
* gate without having to ship a separate aggregator.
|
|
92
|
-
*/
|
|
93
|
-
countByType(): {
|
|
94
|
-
'laptop-check': number;
|
|
95
|
-
'failure-incident': number;
|
|
96
|
-
'slash-invocation': number;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export {};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* src/channels/telegram-mirror/state-machine.ts — v0.25.0 M2.
|
|
3
|
-
*
|
|
4
|
-
* Per-chat turn-lifecycle state machine for the Telegram Terminal Mirror.
|
|
5
|
-
* Consumes Claude stream events (tool_use / tool_result / text / turn_done)
|
|
6
|
-
* and produces a Turn object the card-renderer (sibling module) can format
|
|
7
|
-
* into Telegram message bodies.
|
|
8
|
-
*
|
|
9
|
-
* Naming note: this is NOT a 1:1 port of the legacy state-machine.ts —
|
|
10
|
-
* legacy is a message_sending cross-path-dedup hook. Per ADR-001 (mimic
|
|
11
|
-
* the terminal flow) the mirror's state-machine models what a user sees
|
|
12
|
-
* during a turn (running tools → completion), which is closer to a UI
|
|
13
|
-
* controller than legacy's API-dispatch hook. The name is reused for
|
|
14
|
-
* cross-reference clarity; the shape diverges intentionally.
|
|
15
|
-
*
|
|
16
|
-
* Pure module — no I/O, no Telegram-API calls. Wiring into register() and
|
|
17
|
-
* the actual gateway event bus lands in M3/M4 once /sessions provides a
|
|
18
|
-
* user-facing entry point. M2's scope: the abstraction + tests.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Stream event shape (mirrors the subset of legacy card-renderer.ts
|
|
22
|
-
* StreamEvent that the mirror actually consumes). Re-exported here so
|
|
23
|
-
* dependents don't need to import from the legacy directory.
|
|
24
|
-
*/
|
|
25
|
-
export interface StreamEvent {
|
|
26
|
-
type: string;
|
|
27
|
-
id?: string;
|
|
28
|
-
tool_use_id?: string;
|
|
29
|
-
tool?: {
|
|
30
|
-
name?: string;
|
|
31
|
-
input?: Record<string, unknown>;
|
|
32
|
-
};
|
|
33
|
-
tool_name?: string;
|
|
34
|
-
input?: Record<string, unknown>;
|
|
35
|
-
content?: unknown;
|
|
36
|
-
output?: unknown;
|
|
37
|
-
is_error?: boolean;
|
|
38
|
-
error?: unknown;
|
|
39
|
-
result?: string;
|
|
40
|
-
}
|
|
41
|
-
type TurnState = 'working' | 'done' | 'failed';
|
|
42
|
-
export interface ToolCallRecord {
|
|
43
|
-
/** Tool name (e.g. "Bash", "Read", "Edit"). */
|
|
44
|
-
name: string;
|
|
45
|
-
/** Tool input arguments (snapshot at tool_use time). */
|
|
46
|
-
input: Record<string, unknown>;
|
|
47
|
-
/** Telegram-readable tool-use id, used to match tool_result events. */
|
|
48
|
-
toolUseId: string;
|
|
49
|
-
/** Set when the matching tool_result event arrives. */
|
|
50
|
-
result?: unknown;
|
|
51
|
-
/** True if the tool_result event flagged is_error/error. */
|
|
52
|
-
isError?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface Turn {
|
|
55
|
-
/** Telegram chat id this turn is rendering into. */
|
|
56
|
-
chatId: string;
|
|
57
|
-
/** Lifecycle state. */
|
|
58
|
-
state: TurnState;
|
|
59
|
-
/** Monotonic timestamp (Date.now()) when the turn started. */
|
|
60
|
-
startedAt: number;
|
|
61
|
-
/** Set when the turn transitions to 'done' or 'failed'. */
|
|
62
|
-
endedAt?: number;
|
|
63
|
-
/** Set when the turn transitions to 'failed' (M4) — a short failure reason
|
|
64
|
-
* surfaced on the card so a turn never dies as an eternal "…". */
|
|
65
|
-
failReason?: string;
|
|
66
|
-
/** Tool calls observed during the turn, in arrival order. */
|
|
67
|
-
toolCalls: ToolCallRecord[];
|
|
68
|
-
/** Accumulated assistant text (concatenation of text events). */
|
|
69
|
-
assistantText: string;
|
|
70
|
-
/** Accumulated extended-thinking text (M6). Rendered above assistant text. */
|
|
71
|
-
thinkingText: string;
|
|
72
|
-
}
|
|
73
|
-
export declare class TurnStateMachine {
|
|
74
|
-
private readonly turns;
|
|
75
|
-
/**
|
|
76
|
-
* Start (or restart) a turn for the given chat. If a turn already exists,
|
|
77
|
-
* its 'done' state is preserved as the prior turn until a new start
|
|
78
|
-
* overwrites it — the mirror does not keep history at this layer.
|
|
79
|
-
*/
|
|
80
|
-
start(chatId: string, now?: number): Turn;
|
|
81
|
-
/**
|
|
82
|
-
* Apply a stream event. Returns the updated turn, or undefined if no
|
|
83
|
-
* turn is active for the chat. The state machine accepts:
|
|
84
|
-
* - tool_use → push a ToolCallRecord
|
|
85
|
-
* - tool_result → resolve the matching ToolCallRecord
|
|
86
|
-
* - text → append to assistantText
|
|
87
|
-
* Other event types are ignored at this layer; downstream milestones add
|
|
88
|
-
* thinking/insight handling (M6) and plan-mode handling (M9).
|
|
89
|
-
*/
|
|
90
|
-
applyEvent(chatId: string, event: StreamEvent): Turn | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* End the active turn for chatId. Transitions state to 'done' and stamps
|
|
93
|
-
* endedAt. Returns the finalized turn, or undefined if no turn was active.
|
|
94
|
-
*/
|
|
95
|
-
end(chatId: string, now?: number): Turn | undefined;
|
|
96
|
-
/**
|
|
97
|
-
* Fail the active turn for chatId (M4). Transitions state to 'failed', stamps
|
|
98
|
-
* endedAt, and records a short reason so renderTurn can show "❌ <reason>"
|
|
99
|
-
* instead of leaving the card frozen at "…". Returns the failed turn, or
|
|
100
|
-
* undefined if no turn was active.
|
|
101
|
-
*/
|
|
102
|
-
fail(chatId: string, reason: string, now?: number): Turn | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* Returns the active or most-recently-ended turn for chatId.
|
|
105
|
-
*/
|
|
106
|
-
getTurn(chatId: string): Turn | undefined;
|
|
107
|
-
/**
|
|
108
|
-
* Drop the cached turn. Test-only convenience; production code starts a
|
|
109
|
-
* new turn instead.
|
|
110
|
-
*/
|
|
111
|
-
clear(chatId: string): void;
|
|
112
|
-
}
|
|
113
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* src/channels/telegram-mirror/status-line.ts — v0.26.2 M1.
|
|
3
|
-
*
|
|
4
|
-
* Builds the Claude-Code-CLI-style status line that sits at the top of the
|
|
5
|
-
* Telegram live-mirror card, e.g.:
|
|
6
|
-
*
|
|
7
|
-
* [Opus 4.7] · CC 2.1.145 · ⏱ 2h13m · 🔧 3 · bypass
|
|
8
|
-
*
|
|
9
|
-
* STRICT no-fake-data rule (per the v0.26.2 brief): every segment is rendered
|
|
10
|
-
* ONLY when its value is genuinely available. Missing model / version / etc.
|
|
11
|
-
* are simply omitted — never stubbed. Telegram has no ANSI color, so the CLI
|
|
12
|
-
* look is approximated with `·` separators, glyphs, and (in later milestones)
|
|
13
|
-
* unicode meter bars — plain text that survives the MarkdownV2→plain fallback.
|
|
14
|
-
*/
|
|
15
|
-
import type { Turn } from './state-machine.js';
|
|
16
|
-
import type { CardMeta } from './card-state.js';
|
|
17
|
-
export declare function getCcVersion(): string | null;
|
|
18
|
-
/** Test-only — reset the cached version. */
|
|
19
|
-
export declare function _resetCcVersionForTests(): void;
|
|
20
|
-
export declare function shortModel(model: string | undefined): string | undefined;
|
|
21
|
-
/** Compact elapsed formatter: 2h13m / 13m / 42s. */
|
|
22
|
-
export declare function fmtElapsed(ms: number): string;
|
|
23
|
-
/**
|
|
24
|
-
* Render the status line for a turn. Returns `undefined` when NOTHING is
|
|
25
|
-
* available to show (so callers omit the line entirely). Segments, in order:
|
|
26
|
-
* [model] · CC <ver> · ⏱ <elapsed> · 🔧 <toolCount> · bypass
|
|
27
|
-
* Every segment is conditional on real data.
|
|
28
|
-
*/
|
|
29
|
-
export declare function renderStatusLine(turn: Turn, meta: CardMeta | undefined, now?: number): string | undefined;
|
|
30
|
-
/** Unicode meter, e.g. meterBar(71) → "▓▓▓▓▓▓░░ 71%" (8 cells). */
|
|
31
|
-
export declare function meterBar(pct: number, cells?: number): string;
|
|
32
|
-
/** Quota reset formatter: within 24h → local clock (e.g. "4:20p"); else "in Nd". */
|
|
33
|
-
export declare function fmtReset(epochSec: number, now?: number): string;
|
|
34
|
-
/**
|
|
35
|
-
* Second status row — the meter bars: context-window % and plan-usage/quota %
|
|
36
|
-
* + reset. Each segment renders only when its value is genuinely present
|
|
37
|
-
* (no-fake-data). Returns undefined when nothing is available.
|
|
38
|
-
* ctx ▓▓▓▓▓▓░░ 71% · use ▓▓▓░ 34% · resets 4:20p
|
|
39
|
-
*/
|
|
40
|
-
export declare function renderMeters(meta: CardMeta | undefined, now?: number): string | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Render the agent's todo list (M4) as a compact checklist with a done/total
|
|
43
|
-
* header, e.g.:
|
|
44
|
-
* todos 1/3
|
|
45
|
-
* ☑ wire bridge
|
|
46
|
-
* ▶ render status line
|
|
47
|
-
* ☐ ship release
|
|
48
|
-
* Returns undefined when there are no todos (no-fake-data). Capped at TODO_MAX
|
|
49
|
-
* rows with a "+N more" overflow line so the card stays readable.
|
|
50
|
-
*/
|
|
51
|
-
export declare function renderTodos(meta: CardMeta | undefined): string | undefined;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* src/channels/telegram-mirror/sync-commands.ts — v0.25.0 M5.
|
|
3
|
-
*
|
|
4
|
-
* ADR-009 — Bot calls Telegram's setMyCommands exactly once per plugin
|
|
5
|
-
* boot. Re-syncing per-session creates a race with the client cache; per
|
|
6
|
-
* invocation wastes API calls; never syncing forfeits the autocomplete UX
|
|
7
|
-
* win. Boot-only is the saddle point.
|
|
8
|
-
*
|
|
9
|
-
* R-6 monitoring: if A1 installs a new skill or top-7 changes mid-session
|
|
10
|
-
* and expects autocomplete to update without a gateway restart, that's
|
|
11
|
-
* the documented exception per ADR-009.
|
|
12
|
-
*
|
|
13
|
-
* Idempotency is process-scope. The synced flag is reset when the call
|
|
14
|
-
* itself throws, so a retry on the next register() attempt can succeed.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Telegram setMyCommands payload shape. Pinned to the subset cc-openclaw
|
|
18
|
-
* actually uses; full upstream payload supports scope/language_code params
|
|
19
|
-
* that the mirror doesn't need.
|
|
20
|
-
*/
|
|
21
|
-
interface SetMyCommandsPayload {
|
|
22
|
-
commands: Array<{
|
|
23
|
-
command: string;
|
|
24
|
-
description: string;
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Minimum logger surface (works with console or api.logger). Made narrow
|
|
29
|
-
* deliberately so callers can pass any structured logger.
|
|
30
|
-
*/
|
|
31
|
-
interface SyncLogger {
|
|
32
|
-
info: (msg: string, ...rest: unknown[]) => void;
|
|
33
|
-
warn: (msg: string, ...rest: unknown[]) => void;
|
|
34
|
-
}
|
|
35
|
-
export interface SyncOptions {
|
|
36
|
-
/**
|
|
37
|
-
* Telegram setMyCommands dispatcher — accepts the payload and returns a
|
|
38
|
-
* promise that resolves on success or rejects on network/API error.
|
|
39
|
-
* Tests pass the G-3 mock; production wires a fetch-based caller.
|
|
40
|
-
*/
|
|
41
|
-
setMyCommands: (payload: SetMyCommandsPayload) => Promise<unknown>;
|
|
42
|
-
/**
|
|
43
|
-
* v0.27.7 — optional getMyCommands dispatcher. When supplied, the CURRENTLY
|
|
44
|
-
* registered commands (e.g. OpenClaw's nativeSkills auto-synced /search,
|
|
45
|
-
* /plan, …) are fetched and MERGED with the native list so the sync augments
|
|
46
|
-
* the Telegram menu instead of replacing it. setMyCommands is a full-replace
|
|
47
|
-
* API, so without this merge a native-only sync would wipe the skill
|
|
48
|
-
* commands (and vice-versa — which is the bug that left native commands
|
|
49
|
-
* invisible: the dead sync never ran, and OpenClaw's skill-sync owned the
|
|
50
|
-
* menu alone). Omit it for the legacy native-only replace.
|
|
51
|
-
*/
|
|
52
|
-
getMyCommands?: () => Promise<{
|
|
53
|
-
commands?: ReadonlyArray<{
|
|
54
|
-
command: string;
|
|
55
|
-
description: string;
|
|
56
|
-
}>;
|
|
57
|
-
}>;
|
|
58
|
-
/**
|
|
59
|
-
* v0.27.7 — native command set to advertise. Defaults to TOP_7_COMMANDS so
|
|
60
|
-
* the legacy callers (and the M5 boot-only test) keep the exact top-7 list.
|
|
61
|
-
* The boot wiring passes top-7 + /clear so the menu reflects the full native
|
|
62
|
-
* surface.
|
|
63
|
-
*/
|
|
64
|
-
nativeCommands?: ReadonlyArray<{
|
|
65
|
-
command: string;
|
|
66
|
-
description: string;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* v0.27.8 — bypass the boot-once idempotency guard. The boot wiring fires a
|
|
70
|
-
* short re-assert series (10s/60s/150s) because OpenClaw's nativeSkills
|
|
71
|
-
* auto-sync runs LATE at boot and full-replaces the menu with skill-only
|
|
72
|
-
* commands; a single early sync loses the ordering race. Each forced call
|
|
73
|
-
* re-merges (getMyCommands → union) so it converges on the full menu once
|
|
74
|
-
* OpenClaw's one-shot clobber has landed. ADR-009's "no per-session re-sync"
|
|
75
|
-
* still holds — this is boot-scoped retry, not per-message.
|
|
76
|
-
*/
|
|
77
|
-
force?: boolean;
|
|
78
|
-
logger?: SyncLogger;
|
|
79
|
-
}
|
|
80
|
-
export interface SyncResult {
|
|
81
|
-
/** True when this invocation was a no-op because a prior boot already synced. */
|
|
82
|
-
alreadySynced: boolean;
|
|
83
|
-
/** Number of commands in the payload sent (0 when alreadySynced). */
|
|
84
|
-
commandCount: number;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Sync the top-7 phone-tier commands to Telegram. Idempotent across a
|
|
88
|
-
* process — subsequent calls return alreadySynced:true without dispatching.
|
|
89
|
-
*
|
|
90
|
-
* On dispatcher error, the synced flag is reset so a follow-up call can
|
|
91
|
-
* retry. The error is propagated to the caller; M5's plugin-boot wire-up
|
|
92
|
-
* catches it and emits the warn log so register() never blocks on it.
|
|
93
|
-
*/
|
|
94
|
-
export declare function syncMyCommands(opts: SyncOptions): Promise<SyncResult>;
|
|
95
|
-
/**
|
|
96
|
-
* Test-only reset for the per-process synced flag. Production never calls
|
|
97
|
-
* this; each gateway boot starts a fresh process with synced=false.
|
|
98
|
-
*/
|
|
99
|
-
export declare function _resetSyncedForTests(): void;
|
|
100
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* src/channels/telegram-mirror/threshold-watcher.ts — v0.25.0 M11.
|
|
3
|
-
*
|
|
4
|
-
* Per-chat stateful detector for Max 20x quota thresholds. The dispatcher
|
|
5
|
-
* polls check(chatId, currentPercent) on a cadence (typically once per
|
|
6
|
-
* minute via status-tee freshness); the watcher fires AT MOST ONCE per
|
|
7
|
-
* upward crossing of each threshold. Hysteresis: dropping below a
|
|
8
|
-
* threshold re-arms it for the next upward crossing.
|
|
9
|
-
*
|
|
10
|
-
* Default thresholds (per PRP M11): 70% / 90% / 95%.
|
|
11
|
-
*
|
|
12
|
-
* Pause-now UX surfaces at the 95% level only — the lower thresholds are
|
|
13
|
-
* advisory.
|
|
14
|
-
*
|
|
15
|
-
* Risk reference: R-8 (Telegram rate limits) is mitigated by the
|
|
16
|
-
* once-per-crossing semantic — heavy bursts don't drown the chat in
|
|
17
|
-
* advisory pings.
|
|
18
|
-
*/
|
|
19
|
-
export interface ThresholdWatcherOptions {
|
|
20
|
-
/** Ascending list of percent thresholds (default 70/90/95). */
|
|
21
|
-
thresholds?: number[];
|
|
22
|
-
}
|
|
23
|
-
export interface ThresholdCheckResult {
|
|
24
|
-
/**
|
|
25
|
-
* When this check forced a fresh upward crossing, this is the HIGHEST
|
|
26
|
-
* threshold crossed in this call. Undefined when no crossing fired.
|
|
27
|
-
*/
|
|
28
|
-
fired?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare class ThresholdWatcher {
|
|
31
|
-
private readonly states;
|
|
32
|
-
private readonly thresholds;
|
|
33
|
-
constructor(opts?: ThresholdWatcherOptions);
|
|
34
|
-
/**
|
|
35
|
-
* Inspect the latest quota percent for the chat. Returns
|
|
36
|
-
* `{ fired: <threshold> }` when one or more thresholds were crossed
|
|
37
|
-
* upward in this call (the highest crossed is reported). Returns `{}`
|
|
38
|
-
* when no fresh crossing occurred. Sub-threshold drops re-arm the
|
|
39
|
-
* corresponding threshold for a future crossing.
|
|
40
|
-
*
|
|
41
|
-
* The first call for a chatId initialises state with lastPercent=0 so
|
|
42
|
-
* the very first check above a threshold reports it as a fresh crossing.
|
|
43
|
-
*/
|
|
44
|
-
check(chatId: string, currentPercent: number): ThresholdCheckResult;
|
|
45
|
-
/** Reset state for a chatId. Used after an explicit user pause. */
|
|
46
|
-
reset(chatId: string): void;
|
|
47
|
-
/** Read-only inspector for tests / monitoring. */
|
|
48
|
-
inspect(chatId: string): {
|
|
49
|
-
lastPercent: number;
|
|
50
|
-
crossed: number[];
|
|
51
|
-
} | undefined;
|
|
52
|
-
/** Thresholds list (for tests). */
|
|
53
|
-
thresholdList(): readonly number[];
|
|
54
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* src/channels/telegram-mirror/turn-bridge.ts — v0.26.0.
|
|
3
|
-
*
|
|
4
|
-
* Internal bridge that lets the openai-compat handlers (streaming +
|
|
5
|
-
* non-streaming) push live turn updates into the active Telegram mirror
|
|
6
|
-
* cards.
|
|
7
|
-
*
|
|
8
|
-
* Why this exists: OpenClaw's `before_tool_call` / `after_tool_call` /
|
|
9
|
-
* `before_agent_finalize` events DO NOT fire for tools the Claude
|
|
10
|
-
* subprocess runs internally — those hooks are for the gateway's native
|
|
11
|
-
* tool dispatch (MCP, etc.). The actual chokepoint for cc-openclaw is
|
|
12
|
-
* the streaming/non-streaming handler in openai-compat/, which sees every
|
|
13
|
-
* tool_use event the CLI emits via `onEvent`. v0.25.9 wired the wrong
|
|
14
|
-
* source; this bridge wires the right one.
|
|
15
|
-
*
|
|
16
|
-
* Single-tenant by design: A1's Telegram is the only consumer. The push
|
|
17
|
-
* functions iterate `cardState` so multiple active cards (e.g. parallel
|
|
18
|
-
* group chats) all get updated; if two turns are concurrent the event will
|
|
19
|
-
* land on every active card, which is acceptable until a real session →
|
|
20
|
-
* chatId mapping is introduced.
|
|
21
|
-
*
|
|
22
|
-
* Debounce: tool_use forces immediate repaint (low frequency, important
|
|
23
|
-
* visibility). tool_result and text deltas are debounced to one repaint
|
|
24
|
-
* per REPAINT_MIN_MS per chat — Telegram rate-limits edits and we don't
|
|
25
|
-
* want to spam edits while text streams in.
|
|
26
|
-
*/
|
|
27
|
-
import { type CardMeta } from './card-state.js';
|
|
28
|
-
/** Number of active mirror cards visible to THIS module instance. Used by the
|
|
29
|
-
* openai-compat handlers' entry log to detect a cross-instance cardState
|
|
30
|
-
* split (handler sees 0 while inbound registered 1). */
|
|
31
|
-
export declare function activeCardCount(): number;
|
|
32
|
-
/**
|
|
33
|
-
* Merge status-line metadata into every active card (v0.26.2 M1). Called from
|
|
34
|
-
* the openai-compat handlers: at turn start with { model, bypassPermissions },
|
|
35
|
-
* and at turn end with { contextPercent } once getStatus() is available.
|
|
36
|
-
* Single-tenant: applies to all active cards (one in practice). Does NOT
|
|
37
|
-
* repaint — the next push/finalize repaint picks it up.
|
|
38
|
-
*/
|
|
39
|
-
export declare function setCardMeta(partial: Partial<CardMeta>): void;
|
|
40
|
-
/**
|
|
41
|
-
* Read real plan-usage/quota from the status-tee snapshot (M2). Uses the
|
|
42
|
-
* sevenDay window, falling back to fiveHour (matches cost-views projection).
|
|
43
|
-
* Returns {} when no fresh snapshot exists — never fakes a number. Cheap sync
|
|
44
|
-
* read; called once per turn from the handler, not per repaint.
|
|
45
|
-
*/
|
|
46
|
-
export declare function readQuotaMeta(): Partial<CardMeta>;
|
|
47
|
-
/**
|
|
48
|
-
* Record a tool_use event into every active card. Called from the Claude
|
|
49
|
-
* subprocess output stream the moment a tool is invoked.
|
|
50
|
-
*/
|
|
51
|
-
export declare function pushToolUse(name: string, input: Record<string, unknown> | undefined, toolUseId: string | undefined): void;
|
|
52
|
-
/**
|
|
53
|
-
* Record a tool_result event. Resolves the matching ToolCallRecord on
|
|
54
|
-
* every active card. Debounced repaint — completion glyph (✓/✗) is less
|
|
55
|
-
* critical than the initial tool_use line.
|
|
56
|
-
*/
|
|
57
|
-
export declare function pushToolResult(toolUseId: string | undefined, output: unknown, isError?: boolean): void;
|
|
58
|
-
/**
|
|
59
|
-
* Record the assistant text. Pass the cumulative buffer (not delta) — the
|
|
60
|
-
* state machine's `text` event appends, so callers that already accumulate
|
|
61
|
-
* (streaming-handler) should reset and re-apply, OR we just overwrite the
|
|
62
|
-
* turn.assistantText field directly. This function does the latter.
|
|
63
|
-
*
|
|
64
|
-
* Non-streaming callers pass the final result.output once. Streaming
|
|
65
|
-
* callers pass the cumulative buffer on each chunk — debounce ensures we
|
|
66
|
-
* don't hammer Telegram with edits.
|
|
67
|
-
*/
|
|
68
|
-
export declare function pushAssistantText(text: string): void;
|
|
69
|
-
/**
|
|
70
|
-
* Record extended-thinking text on every active card (v0.27.4 M1 — CLI-parity
|
|
71
|
-
* gap #1). The streaming handler calls this from its `onThinking` callback as
|
|
72
|
-
* reasoning deltas arrive, passing the CUMULATIVE buffer (not the delta) — so
|
|
73
|
-
* the live card grows a 💭 block exactly the way the terminal streams thinking
|
|
74
|
-
* before the answer. Overwrites turn.thinkingText (same pattern as
|
|
75
|
-
* pushAssistantText), debounced repaint. Only fires while surfaceThinking is on
|
|
76
|
-
* (the handler gates the callback), so card-thinking matches the CLI's
|
|
77
|
-
* thinking-visibility setting rather than leaking reasoning unconditionally.
|
|
78
|
-
*/
|
|
79
|
-
export declare function pushThinking(text: string): void;
|
|
80
|
-
/**
|
|
81
|
-
* #4 (dual-surface seam) — extract just the model's `★ Insight ─...─` block from
|
|
82
|
-
* the full answer text, for display as the finalized card's takeaway when the
|
|
83
|
-
* card no longer mirrors the whole answer (CC_OPENCLAW_CARD_ANSWER_MIRROR off,
|
|
84
|
-
* the default). Returns the block verbatim (renderTurn preserves ★ Insight
|
|
85
|
-
* inline), or '' when the answer carries no insight block → a clean
|
|
86
|
-
* status/tools/✓ Done card with no answer text. Matches the model's emitted
|
|
87
|
-
* shape: a `★ Insight` opener through the next box-drawing divider line.
|
|
88
|
-
*/
|
|
89
|
-
export declare function extractInsightForCard(fullText: string): string;
|
|
90
|
-
/**
|
|
91
|
-
* Finalize every active card at the END of a model turn. Flips each card's
|
|
92
|
-
* turn to 'done' (so renderTurn shows "✓ Done"), repaints once, and removes
|
|
93
|
-
* it from cardState.
|
|
94
|
-
*
|
|
95
|
-
* v0.26.1 — this REPLACES the inbound handler's reply_dispatch finalize. That
|
|
96
|
-
* gateway event fires at reply-lifecycle START (before the model produces any
|
|
97
|
-
* tool/text events) and was deleting the card mid-turn, so every bridge push
|
|
98
|
-
* landed on an empty map. The openai-compat handler is the correct lifecycle
|
|
99
|
-
* owner: it runs for the full duration of the actual model call, pushes events
|
|
100
|
-
* into the card during the turn, then calls this on turn end. Single-tenant:
|
|
101
|
-
* finalizes ALL active cards (one at a time in practice).
|
|
102
|
-
*/
|
|
103
|
-
export declare function finalizeActiveCards(deliveredText?: string): Promise<void>;
|
|
104
|
-
/**
|
|
105
|
-
* Map a caught error to a short, user-readable card reason (v0.27.0 M4). Keeps
|
|
106
|
-
* the "❌ <reason>" header concise and classifies the common cc-openclaw-side
|
|
107
|
-
* failures (its own watchdog kill / dead subprocess / timeout) rather than
|
|
108
|
-
* dumping a raw stack.
|
|
109
|
-
*/
|
|
110
|
-
export declare function classifyFailure(err: unknown): string;
|
|
111
|
-
/**
|
|
112
|
-
* Fail every active card (v0.27.0 M4). Called from the openai-compat handlers'
|
|
113
|
-
* catch path when cc-openclaw's OWN turn errors — its subprocess died, its
|
|
114
|
-
* stalled-session watchdog SIGTERMed it, or the model call threw/timed out. The
|
|
115
|
-
* card flips to "❌ <reason>" instead of being left as an eternal "…" (or worse,
|
|
116
|
-
* finalized to a misleading "✓ Done"). Scoped to cc-openclaw's own vantage; the
|
|
117
|
-
* gateway's recovery=none stalls that never throw here are out of M4's reach.
|
|
118
|
-
* Best-effort: a fail-render failure must not mask the original error.
|
|
119
|
-
*/
|
|
120
|
-
export declare function failActiveCards(reason: string): Promise<void>;
|
|
121
|
-
/**
|
|
122
|
-
* Test-only — reset module-level repaint state. Card state lives in
|
|
123
|
-
* card-state.ts so import that and clear directly if your test needs it.
|
|
124
|
-
*/
|
|
125
|
-
export declare function _resetBridgeForTests(): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
import type { CheckResult } from './patch-scaffold.js';
|
|
14
|
-
export declare function checkBridgeWiring(): Promise<CheckResult>;
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,21 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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>;
|
package/dist/src/cli/doctor.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `cc-openclaw doctor` — Phase 5 Bridge Plane skeleton (v0.11.0).
|
|
3
|
-
*
|
|
4
|
-
* Checks shipped in this plane:
|
|
5
|
-
* 1. check_install_path — resolves which of the 3 known openclaw extension
|
|
6
|
-
* paths cc-openclaw was loaded from; compares installed version to this
|
|
7
|
-
* binary's built version.
|
|
8
|
-
* 2. check_bridge_wiring — soft-imports the bridge factory and asserts the
|
|
9
|
-
* 4 expected bridge mode exports exist. Soft-fails with `pending` when
|
|
10
|
-
* the factory file has not yet shipped (bridge coder is parallel).
|
|
11
|
-
*
|
|
12
|
-
* Future planes add checks via the exported `ALL_CHECKS` registry.
|
|
13
|
-
*/
|
|
14
|
-
import { Command } from 'commander';
|
|
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';
|
|
20
|
-
export declare function createDoctorCommand(): Command;
|
package/dist/src/cli/index.d.ts
DELETED