@a1hvdy/cc-openclaw 0.27.4 → 0.27.7

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 (37) hide show
  1. package/dist/src/channels/telegram-mirror/card-renderer.d.ts +7 -0
  2. package/dist/src/channels/telegram-mirror/card-renderer.js +61 -8
  3. package/dist/src/channels/telegram-mirror/commands.d.ts +13 -0
  4. package/dist/src/channels/telegram-mirror/commands.js +26 -0
  5. package/dist/src/channels/telegram-mirror/index.js +44 -1
  6. package/dist/src/channels/telegram-mirror/sync-commands.d.ts +26 -0
  7. package/dist/src/channels/telegram-mirror/sync-commands.js +18 -1
  8. package/dist/src/channels/telegram-mirror/turn-bridge.d.ts +1 -1
  9. package/dist/src/channels/telegram-mirror/turn-bridge.js +10 -2
  10. package/dist/src/constants.d.ts +17 -0
  11. package/dist/src/constants.js +18 -0
  12. package/dist/src/engines/persistent-session.d.ts +5 -0
  13. package/dist/src/engines/persistent-session.js +27 -0
  14. package/dist/src/lib/html-render.d.ts +15 -0
  15. package/dist/src/lib/html-render.js +36 -0
  16. package/dist/src/openai-compat/non-streaming-handler.js +18 -1
  17. package/dist/src/openai-compat/openai-compat.js +49 -1
  18. package/dist/src/openai-compat/request-coalescer.d.ts +77 -0
  19. package/dist/src/openai-compat/request-coalescer.js +157 -0
  20. package/dist/src/openai-compat/streaming-handler.d.ts +9 -1
  21. package/dist/src/openai-compat/streaming-handler.js +33 -4
  22. package/dist/src/session/watchdogs.d.ts +3 -0
  23. package/dist/src/session/watchdogs.js +6 -0
  24. package/dist/src/types.d.ts +4 -0
  25. package/package.json +1 -1
  26. package/dist/src/config/drift-detector.d.ts +0 -28
  27. package/dist/src/config/drift-detector.js +0 -74
  28. package/dist/src/lib/stale-pid-files.d.ts +0 -17
  29. package/dist/src/lib/stale-pid-files.js +0 -39
  30. package/dist/src/persistence/snapshot.d.ts +0 -18
  31. package/dist/src/persistence/snapshot.js +0 -31
  32. package/dist/src/persistence/wal.d.ts +0 -17
  33. package/dist/src/persistence/wal.js +0 -31
  34. package/dist/src/types/index.d.ts +0 -15
  35. package/dist/src/types/index.js +0 -15
  36. package/dist/src/types/session.d.ts +0 -48
  37. package/dist/src/types/session.js +0 -19
@@ -1,17 +0,0 @@
1
- /**
2
- * WalWriter — append-only JSONL writer for the session registry WAL.
3
- *
4
- * WAL file location: ~/.openclaw/workspace/memory/cc-openclaw-session-wal.jsonl
5
- * Phase E wires this into SessionRegistry.set() / delete().
6
- * Stub body in Phase D — compiles and exports the class with the correct interface.
7
- */
8
- export declare class WalWriter {
9
- private readonly path;
10
- constructor(path?: string);
11
- /**
12
- * Append a JSON-serializable record as a single JSONL line.
13
- * Creates parent directories if absent. Non-atomic in Phase D stub;
14
- * Phase E adds write-then-rename for crash safety.
15
- */
16
- append(record: Record<string, unknown>): void;
17
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * WalWriter — append-only JSONL writer for the session registry WAL.
3
- *
4
- * WAL file location: ~/.openclaw/workspace/memory/cc-openclaw-session-wal.jsonl
5
- * Phase E wires this into SessionRegistry.set() / delete().
6
- * Stub body in Phase D — compiles and exports the class with the correct interface.
7
- */
8
- import { mkdirSync, appendFileSync } from 'fs';
9
- import { homedir } from 'os';
10
- import { join, dirname } from 'path';
11
- const WAL_PATH = join(homedir(), '.openclaw', 'workspace', 'memory', 'cc-openclaw-session-wal.jsonl');
12
- export class WalWriter {
13
- path;
14
- constructor(path = WAL_PATH) {
15
- this.path = path;
16
- }
17
- /**
18
- * Append a JSON-serializable record as a single JSONL line.
19
- * Creates parent directories if absent. Non-atomic in Phase D stub;
20
- * Phase E adds write-then-rename for crash safety.
21
- */
22
- append(record) {
23
- try {
24
- mkdirSync(dirname(this.path), { recursive: true });
25
- appendFileSync(this.path, JSON.stringify(record) + '\n', 'utf8');
26
- }
27
- catch {
28
- // Non-fatal in Phase D; Phase E promotes to logged error.
29
- }
30
- }
31
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Cluster A — Type-seams barrel.
3
- *
4
- * Single import surface for all typed boundaries introduced in Cluster A.
5
- * Subsequent clusters import from `cc-openclaw/types` (this barrel)
6
- * rather than reaching into individual modules.
7
- *
8
- * This file is intentionally pure re-exports — no logic, no side effects.
9
- */
10
- export * from './runtime-config.js';
11
- export * from './route.js';
12
- export * from './sse.js';
13
- export * from './session.js';
14
- export * from './upstream.js';
15
- export * from './tool-bridge.js';
@@ -1,15 +0,0 @@
1
- /**
2
- * Cluster A — Type-seams barrel.
3
- *
4
- * Single import surface for all typed boundaries introduced in Cluster A.
5
- * Subsequent clusters import from `cc-openclaw/types` (this barrel)
6
- * rather than reaching into individual modules.
7
- *
8
- * This file is intentionally pure re-exports — no logic, no side effects.
9
- */
10
- export * from './runtime-config.js';
11
- export * from './route.js';
12
- export * from './sse.js';
13
- export * from './session.js';
14
- export * from './upstream.js';
15
- export * from './tool-bridge.js';
@@ -1,48 +0,0 @@
1
- /**
2
- * Cluster A — Session boundary types.
3
- *
4
- * Re-exports the session vocabulary already established in the root
5
- * `src/types.ts` module. New aliases (`SessionStartConfig`, `SessionMeta`)
6
- * preview Cluster B's `SessionService` boundary without yet introducing
7
- * a new shape — they're typed wrappers over today's `SessionConfig` /
8
- * `ActiveSession`.
9
- *
10
- * `SessionName` is the branded type that Cluster D's `SessionRegistry`
11
- * will use to enforce the `'openai-'` prefix routing discriminant
12
- * (cwd-patch.ts:489 gates CWD redirect, tools restoration, CLAUDE.md
13
- * injection on this prefix).
14
- *
15
- * NOT consumed yet — Cluster A first commit establishes the vocabulary.
16
- */
17
- export type { SessionConfig as SessionStartConfig, SessionStats, ActiveSession, SessionInfo, SessionSendOptions, StreamCallbacks, StreamEvent, SendResult, SendOptions, TurnResult, CostBreakdown, ISession, EngineType, PermissionMode, EffortLevel, PluginConfig, HookConfig, CustomEngineConfig, } from '../types.js';
18
- /**
19
- * Branded session-name type. Prevents raw string from being passed where
20
- * the `'openai-'` prefix is load-bearing. Use the constructors below to
21
- * mint or strip the prefix — never construct directly.
22
- */
23
- export type SessionName = string & {
24
- readonly __brand: 'SessionName';
25
- };
26
- export declare const sessionNameFromKey: (key: string) => SessionName;
27
- export declare const isOpenAiBridgeName: (name: SessionName) => boolean;
28
- export declare const stripOpenAiPrefix: (name: SessionName) => string;
29
- /**
30
- * Cluster B/D will fold this into `SessionRegistry.SessionEntry`. For
31
- * Cluster A it's a typed preview — the shape Cluster D will persist,
32
- * declared here so other clusters can compile against the contract.
33
- */
34
- export interface SessionMeta {
35
- readonly name: SessionName;
36
- readonly claudeSessionId: string | null;
37
- readonly pid: number | null;
38
- readonly cachedSysPromptHash: string;
39
- readonly skipPersistence: boolean;
40
- readonly createdAt: number;
41
- readonly updatedAt: number;
42
- }
43
- /**
44
- * Input shape Cluster B's `SessionService.send()` accepts.
45
- * Today's call sites pass either a string or an array of content blocks;
46
- * this interface preserves both without yet committing to a tighter shape.
47
- */
48
- export type SendInput = string | ReadonlyArray<unknown>;
@@ -1,19 +0,0 @@
1
- /**
2
- * Cluster A — Session boundary types.
3
- *
4
- * Re-exports the session vocabulary already established in the root
5
- * `src/types.ts` module. New aliases (`SessionStartConfig`, `SessionMeta`)
6
- * preview Cluster B's `SessionService` boundary without yet introducing
7
- * a new shape — they're typed wrappers over today's `SessionConfig` /
8
- * `ActiveSession`.
9
- *
10
- * `SessionName` is the branded type that Cluster D's `SessionRegistry`
11
- * will use to enforce the `'openai-'` prefix routing discriminant
12
- * (cwd-patch.ts:489 gates CWD redirect, tools restoration, CLAUDE.md
13
- * injection on this prefix).
14
- *
15
- * NOT consumed yet — Cluster A first commit establishes the vocabulary.
16
- */
17
- export const sessionNameFromKey = (key) => `openai-${key}`;
18
- export const isOpenAiBridgeName = (name) => name.startsWith('openai-');
19
- export const stripOpenAiPrefix = (name) => name.replace(/^openai-/, '');