@a1hvdy/cc-openclaw 0.27.7 → 0.27.8
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/index.js +18 -6
- package/dist/src/channels/telegram-mirror/sync-commands.d.ts +10 -0
- package/dist/src/channels/telegram-mirror/sync-commands.js +1 -1
- package/dist/src/lib/config.d.ts +0 -10
- package/dist/src/lib/config.js +0 -44
- package/dist/src/types.d.ts +2 -4
- package/dist/src/types.js +1 -4
- package/package.json +1 -1
|
@@ -99,9 +99,18 @@ export function register(api) {
|
|
|
99
99
|
process.env.NODE_ENV === 'test' ||
|
|
100
100
|
process.env.OPENCLAW_PLUGIN_TEST_MODE === '1';
|
|
101
101
|
if (!isTestRunner) {
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
// Boot re-assert series: OpenClaw's nativeSkills auto-sync runs LATE at
|
|
103
|
+
// boot and full-replaces the menu with skill-only commands, so a single
|
|
104
|
+
// early sync loses the ordering race. Re-assert at a few boot offsets;
|
|
105
|
+
// each call re-merges (getMyCommands → union(native, skills)) and
|
|
106
|
+
// converges once OpenClaw's one-shot clobber has landed (verified: it
|
|
107
|
+
// clobbers once, not continuously). An env override forces a single
|
|
108
|
+
// custom delay (testing / tuning).
|
|
109
|
+
const envDelay = Number(process.env.CC_OPENCLAW_CMD_SYNC_DELAY_MS);
|
|
110
|
+
const delays = Number.isFinite(envDelay) && envDelay > 0 ? [envDelay] : [10_000, 60_000, 150_000];
|
|
111
|
+
const runCmdSync = () => {
|
|
104
112
|
void syncMyCommands({
|
|
113
|
+
force: true,
|
|
105
114
|
setMyCommands: (payload) => telegramApi('setMyCommands', { commands: payload.commands }),
|
|
106
115
|
getMyCommands: async () => {
|
|
107
116
|
const res = await telegramApi('getMyCommands', {});
|
|
@@ -120,10 +129,13 @@ export function register(api) {
|
|
|
120
129
|
warn: (msg) => process.stderr.write(`${msg}\n`),
|
|
121
130
|
},
|
|
122
131
|
}).catch((err) => process.stderr.write(`[cc-openclaw/telegram-mirror] command-menu sync failed: ${err instanceof Error ? err.message : String(err)}\n`));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
};
|
|
133
|
+
for (const d of delays) {
|
|
134
|
+
const timer = setTimeout(runCmdSync, d);
|
|
135
|
+
// Don't keep the event loop alive solely for these timers.
|
|
136
|
+
if (typeof timer.unref === 'function')
|
|
137
|
+
timer.unref();
|
|
138
|
+
}
|
|
127
139
|
}
|
|
128
140
|
process.stderr.write('[cc-openclaw/telegram-mirror] guard body completed (v0.25.2).\n');
|
|
129
141
|
}
|
|
@@ -65,6 +65,16 @@ export interface SyncOptions {
|
|
|
65
65
|
command: string;
|
|
66
66
|
description: string;
|
|
67
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;
|
|
68
78
|
logger?: SyncLogger;
|
|
69
79
|
}
|
|
70
80
|
export interface SyncResult {
|
|
@@ -24,7 +24,7 @@ let synced = false;
|
|
|
24
24
|
* catches it and emits the warn log so register() never blocks on it.
|
|
25
25
|
*/
|
|
26
26
|
export async function syncMyCommands(opts) {
|
|
27
|
-
if (synced) {
|
|
27
|
+
if (synced && !opts.force) {
|
|
28
28
|
return { alreadySynced: true, commandCount: 0 };
|
|
29
29
|
}
|
|
30
30
|
synced = true;
|
package/dist/src/lib/config.d.ts
CHANGED
|
@@ -45,11 +45,6 @@ export declare function getPerfCacheTelemetryEnabled(): boolean;
|
|
|
45
45
|
* confirms the perf win (plan: "default ON for safe ideas once measured-good").
|
|
46
46
|
*/
|
|
47
47
|
export declare function getPerfKeepaliveEnabled(): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* M3 (perf overhaul idea #3) — tiered edit cadence. Default OFF; opt-in via
|
|
50
|
-
* CC_OPENCLAW_PERF_EDIT_CADENCE=1.
|
|
51
|
-
*/
|
|
52
|
-
export declare function getPerfEditCadenceEnabled(): boolean;
|
|
53
48
|
/** M9 (perf overhaul idea #9) — speculative thinking bubble. Default OFF. */
|
|
54
49
|
export declare function getPerfSpecBubbleEnabled(): boolean;
|
|
55
50
|
/** M4 — skill-list-on-demand. Default OFF. */
|
|
@@ -64,8 +59,6 @@ export declare function getPerfHaikuRouteEnabled(): boolean;
|
|
|
64
59
|
export declare function getPerfAsyncCompactEnabled(): boolean;
|
|
65
60
|
/** M7 — Read([paths]) batching. Default OFF (medium risk). */
|
|
66
61
|
export declare function getPerfReadBatchEnabled(): boolean;
|
|
67
|
-
/** M1 — resident CLI pool. Default OFF (medium risk). */
|
|
68
|
-
export declare function getPerfResidentCliEnabled(): boolean;
|
|
69
62
|
/** M12 — direct claude-code SDK in-process. Default OFF (HIGH RISK, hard-gated). */
|
|
70
63
|
export declare function getPerfDirectSdkEnabled(): boolean;
|
|
71
64
|
export declare function getMaxConcurrentSessions(): number;
|
|
@@ -106,7 +99,6 @@ export declare function isTokenTelemetryWriterEnabled(): boolean;
|
|
|
106
99
|
/** Strict opt-in — register-guard event logging via OPENCLAW_REGISTER_DEBUG=1. */
|
|
107
100
|
export declare function isRegisterDebugEnabled(): boolean;
|
|
108
101
|
export declare function isHeartbeatWorkaroundDisabled(): boolean;
|
|
109
|
-
export declare function getQuotaPausePct(): number;
|
|
110
102
|
/**
|
|
111
103
|
* Raw value for `isToolsPerMessageModeEnabled()` parsing.
|
|
112
104
|
* NOT delegated — the consumer parses the raw string itself; the typed
|
|
@@ -116,9 +108,7 @@ export declare function getOpenaiCompatToolsPerMessage(): string | undefined;
|
|
|
116
108
|
/** Strict opt-in — legacy new-conversation heuristic via env=1. */
|
|
117
109
|
export declare function isOpenaiCompatNewConvoHeuristic(): boolean;
|
|
118
110
|
export declare function getOpenaiCompatStatusUrl(): string | undefined;
|
|
119
|
-
export declare function getUxBridgeAllSessions(): string | undefined;
|
|
120
111
|
export declare function getAnthropicBaseUrlEnv(): string | undefined;
|
|
121
|
-
export declare function isSavvyLiveCardEnabled(): boolean;
|
|
122
112
|
export declare function getHomeOrTmp(): string;
|
|
123
113
|
export declare function getHealthPortEnv(): string | undefined;
|
|
124
114
|
export declare function isDriftAlertsEnabled(): boolean;
|
package/dist/src/lib/config.js
CHANGED
|
@@ -119,16 +119,6 @@ export function getPerfKeepaliveEnabled() {
|
|
|
119
119
|
return cfg.config.perfKeepaliveEnabled;
|
|
120
120
|
return process.env.CC_OPENCLAW_PERF_KEEPALIVE === '1';
|
|
121
121
|
}
|
|
122
|
-
/**
|
|
123
|
-
* M3 (perf overhaul idea #3) — tiered edit cadence. Default OFF; opt-in via
|
|
124
|
-
* CC_OPENCLAW_PERF_EDIT_CADENCE=1.
|
|
125
|
-
*/
|
|
126
|
-
export function getPerfEditCadenceEnabled() {
|
|
127
|
-
const cfg = getConfigService();
|
|
128
|
-
if (cfg)
|
|
129
|
-
return cfg.config.perfEditCadenceEnabled;
|
|
130
|
-
return process.env.CC_OPENCLAW_PERF_EDIT_CADENCE === '1';
|
|
131
|
-
}
|
|
132
122
|
/** M9 (perf overhaul idea #9) — speculative thinking bubble. Default OFF. */
|
|
133
123
|
export function getPerfSpecBubbleEnabled() {
|
|
134
124
|
const cfg = getConfigService();
|
|
@@ -178,13 +168,6 @@ export function getPerfReadBatchEnabled() {
|
|
|
178
168
|
return cfg.config.perfReadBatchEnabled;
|
|
179
169
|
return process.env.CC_OPENCLAW_PERF_READ_BATCH === '1';
|
|
180
170
|
}
|
|
181
|
-
/** M1 — resident CLI pool. Default OFF (medium risk). */
|
|
182
|
-
export function getPerfResidentCliEnabled() {
|
|
183
|
-
const cfg = getConfigService();
|
|
184
|
-
if (cfg)
|
|
185
|
-
return cfg.config.perfResidentCliEnabled;
|
|
186
|
-
return process.env.CC_OPENCLAW_PERF_RESIDENT_CLI === '1';
|
|
187
|
-
}
|
|
188
171
|
/** M12 — direct claude-code SDK in-process. Default OFF (HIGH RISK, hard-gated). */
|
|
189
172
|
export function getPerfDirectSdkEnabled() {
|
|
190
173
|
const cfg = getConfigService();
|
|
@@ -386,15 +369,6 @@ export function isHeartbeatWorkaroundDisabled() {
|
|
|
386
369
|
return cfg.config.heartbeatWorkaroundDisabled;
|
|
387
370
|
return process.env.CC_OPENCLAW_DISABLE_HEARTBEAT_WORKAROUND === '1';
|
|
388
371
|
}
|
|
389
|
-
// ── Telegram quota auto-pause (src/channels/telegram/live-card.ts) ───────
|
|
390
|
-
// Returns parsed percent threshold (0-100). Default 95.
|
|
391
|
-
export function getQuotaPausePct() {
|
|
392
|
-
const cfg = getConfigService();
|
|
393
|
-
if (cfg)
|
|
394
|
-
return cfg.config.quotaPausePct;
|
|
395
|
-
const n = Number(process.env.OPENCLAW_QUOTA_PAUSE_PCT);
|
|
396
|
-
return Number.isFinite(n) ? n : 95;
|
|
397
|
-
}
|
|
398
372
|
// ── OpenAI-compat shim (src/openai-compat/openai-compat.ts) ──────────────
|
|
399
373
|
/**
|
|
400
374
|
* Raw value for `isToolsPerMessageModeEnabled()` parsing.
|
|
@@ -419,16 +393,6 @@ export function getOpenaiCompatStatusUrl() {
|
|
|
419
393
|
const v = process.env.OPENAI_COMPAT_STATUS_URL;
|
|
420
394
|
return v === undefined || v === '' ? undefined : v;
|
|
421
395
|
}
|
|
422
|
-
// ── UX bridge sessions read-only check (src/channels/telegram/event-reducer.ts) ──
|
|
423
|
-
// Read-only counterpart to `ensureUxBridgeAllSessionsDefault()` — used in
|
|
424
|
-
// hot-path event handlers where the value is treated as a truthy gate.
|
|
425
|
-
//
|
|
426
|
-
// NOT in RuntimeConfig — its peer `ensureUxBridgeAllSessionsDefault` mutates
|
|
427
|
-
// env, so both must read live env to stay coherent.
|
|
428
|
-
export function getUxBridgeAllSessions() {
|
|
429
|
-
const v = process.env.UX_BRIDGE_ALL_SESSIONS;
|
|
430
|
-
return v === undefined || v === '' ? undefined : v;
|
|
431
|
-
}
|
|
432
396
|
// ── Anthropic base URL (src/proxy/handler.ts layer 1) ────────────────────
|
|
433
397
|
// proxy/handler.ts owns the higher-level resolver
|
|
434
398
|
// (env → openclaw.json → default); this getter only exposes the raw env.
|
|
@@ -439,14 +403,6 @@ export function getAnthropicBaseUrlEnv() {
|
|
|
439
403
|
const v = process.env.ANTHROPIC_BASE_URL;
|
|
440
404
|
return v === undefined || v === '' ? undefined : v;
|
|
441
405
|
}
|
|
442
|
-
// ── Savvy live card gate (src/channels/telegram/tool-tracker.ts) ─────────
|
|
443
|
-
export function isSavvyLiveCardEnabled() {
|
|
444
|
-
const cfg = getConfigService();
|
|
445
|
-
if (cfg)
|
|
446
|
-
return cfg.config.savvyLiveCardEnabled;
|
|
447
|
-
const v = process.env.SAVVY_LIVE_CARD;
|
|
448
|
-
return !!(v && v !== '');
|
|
449
|
-
}
|
|
450
406
|
// ── Council transcript dir base (src/council/council.ts) ─────────────────
|
|
451
407
|
// Preserves bit-for-bit the original `process.env.HOME || '/tmp'` fallback.
|
|
452
408
|
// Note: differs from os.homedir() which never returns '/tmp' as fallback.
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types for openclaw-claude-code plugin
|
|
3
3
|
*/
|
|
4
|
-
import type { ModelPricing
|
|
5
|
-
export
|
|
6
|
-
export { getModelPricing, overrideModelPricing, _resetPricingOverrides, getModelList, resolveAlias, resolveEngineAndModel, resolveProvider, getContextWindow, isGeminiModel, isClaudeModel, estimateTokens, lookupModelStrict, getAliases, } from './models.js';
|
|
7
|
-
export declare const MODEL_ALIASES: Record<string, string>;
|
|
4
|
+
import type { ModelPricing } from './models.js';
|
|
5
|
+
export { getModelPricing, overrideModelPricing } from './models.js';
|
|
8
6
|
export type PermissionMode = 'acceptEdits' | 'bypassPermissions' | 'default' | 'delegate' | 'dontAsk' | 'plan' | 'auto';
|
|
9
7
|
export type EffortLevel = 'low' | 'medium' | 'high' | 'max' | 'auto';
|
|
10
8
|
export type EngineType = 'claude' | 'codex' | 'gemini' | 'cursor' | 'custom';
|
package/dist/src/types.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types for openclaw-claude-code plugin
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
export { getModelPricing, overrideModelPricing, _resetPricingOverrides, getModelList, resolveAlias, resolveEngineAndModel, resolveProvider, getContextWindow, isGeminiModel, isClaudeModel, estimateTokens, lookupModelStrict, getAliases, } from './models.js';
|
|
6
|
-
// Backward compat: MODEL_ALIASES as a static object
|
|
7
|
-
export const MODEL_ALIASES = getAliases();
|
|
4
|
+
export { getModelPricing, overrideModelPricing } from './models.js';
|