synurex 2026.3.3-4 → 2026.3.3-6
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/{chrome-CXlGlG3I.js → chrome-BTQJDtEX.js} +7 -7
- package/dist/{deliver-BUV-sfaF.js → deliver-C2TEJxeH.js} +1 -1
- package/dist/extensionAPI.js +9 -9
- package/dist/{image-C6SHcuJM.js → image-saBkWIDR.js} +1 -1
- package/dist/{pi-embedded-helpers-dkrwwXev.js → pi-embedded-helpers-DKKB89sm.js} +4 -4
- package/dist/plugin-sdk/index.js +7 -7
- package/dist/{pw-ai-BUeSOvm-.js → pw-ai-BKN0Jm4P.js} +1 -1
- package/docs/reference/templates/HEARTBEAT.md +63 -39
- package/package.json +1 -1
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/index-5HZJaqWT.js +0 -7601
- package/dist/control-ui/assets/index-5HZJaqWT.js.map +0 -1
- package/dist/control-ui/assets/index-oj8sBXcO.css +0 -1
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +0 -22
- package/dist/control-ui/index.html +0 -17
|
@@ -7,7 +7,7 @@ import fs$1 from "node:fs/promises";
|
|
|
7
7
|
import { execFileSync, spawn } from "node:child_process";
|
|
8
8
|
import { randomBytes } from "node:crypto";
|
|
9
9
|
import { createServer } from "node:http";
|
|
10
|
-
import WebSocket
|
|
10
|
+
import WebSocket, { WebSocketServer } from "ws";
|
|
11
11
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
12
12
|
import net from "node:net";
|
|
13
13
|
|
|
@@ -135,7 +135,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
135
135
|
let nextExtensionId = 1;
|
|
136
136
|
const sendToExtension = async (payload) => {
|
|
137
137
|
const ws = extensionWs;
|
|
138
|
-
if (!ws || ws.readyState !== WebSocket
|
|
138
|
+
if (!ws || ws.readyState !== WebSocket.OPEN) throw new Error("Chrome extension not connected");
|
|
139
139
|
ws.send(JSON.stringify(payload));
|
|
140
140
|
return await new Promise((resolve, reject) => {
|
|
141
141
|
const timer = setTimeout(() => {
|
|
@@ -152,12 +152,12 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
152
152
|
const broadcastToCdpClients = (evt) => {
|
|
153
153
|
const msg = JSON.stringify(evt);
|
|
154
154
|
for (const ws of cdpClients) {
|
|
155
|
-
if (ws.readyState !== WebSocket
|
|
155
|
+
if (ws.readyState !== WebSocket.OPEN) continue;
|
|
156
156
|
ws.send(msg);
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
const sendResponseToCdp = (ws, res) => {
|
|
160
|
-
if (ws.readyState !== WebSocket
|
|
160
|
+
if (ws.readyState !== WebSocket.OPEN) return;
|
|
161
161
|
ws.send(JSON.stringify(res));
|
|
162
162
|
};
|
|
163
163
|
const ensureTargetEventsForClient = (ws, mode) => {
|
|
@@ -377,7 +377,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
377
377
|
wssExtension.on("connection", (ws) => {
|
|
378
378
|
extensionWs = ws;
|
|
379
379
|
const ping = setInterval(() => {
|
|
380
|
-
if (ws.readyState !== WebSocket
|
|
380
|
+
if (ws.readyState !== WebSocket.OPEN) return;
|
|
381
381
|
ws.send(JSON.stringify({ method: "ping" }));
|
|
382
382
|
}, 5e3);
|
|
383
383
|
ws.on("message", (data) => {
|
|
@@ -674,7 +674,7 @@ async function fetchJson(url, timeoutMs = 1500, init) {
|
|
|
674
674
|
}
|
|
675
675
|
async function withCdpSocket(wsUrl, fn, opts) {
|
|
676
676
|
const headers = getHeadersWithAuth(wsUrl, opts?.headers ?? {});
|
|
677
|
-
const ws = new WebSocket
|
|
677
|
+
const ws = new WebSocket(wsUrl, {
|
|
678
678
|
handshakeTimeout: 5e3,
|
|
679
679
|
...Object.keys(headers).length ? { headers } : {}
|
|
680
680
|
});
|
|
@@ -1808,7 +1808,7 @@ async function getChromeWebSocketUrl(cdpUrl, timeoutMs = 500) {
|
|
|
1808
1808
|
async function canOpenWebSocket(wsUrl, timeoutMs = 800) {
|
|
1809
1809
|
return await new Promise((resolve) => {
|
|
1810
1810
|
const headers = getHeadersWithAuth(wsUrl);
|
|
1811
|
-
const ws = new WebSocket
|
|
1811
|
+
const ws = new WebSocket(wsUrl, {
|
|
1812
1812
|
handshakeTimeout: timeoutMs,
|
|
1813
1813
|
...Object.keys(headers).length ? { headers } : {}
|
|
1814
1814
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
2
|
import { j as normalizeAccountId$1 } from "./agent-scope-CpSMNwey.js";
|
|
3
3
|
import { H as logVerbose, N as resolveUserPath, W as shouldLogVerbose, b as getActivePluginRegistry } from "./exec-EqLC5sqa.js";
|
|
4
|
-
import { At as hasAlphaChannel, En as mediaKindFromMime, G as appendAssistantMessageToSessionTranscript, It as closeDispatcher, K as resolveMirroredTranscriptText, Lt as createPinnedDispatcher, Mt as resizeToJpeg, On as resolveSignalAccount, Ot as convertHeicToJpeg, Pt as saveMediaBuffer, Rt as resolvePinnedHostname, Tn as maxBytesForKind, _n as detectMime, gt as getChannelDock, jn as normalizeChannelId, jt as optimizeImageToPng, kn as getChannelPlugin, m as isMessagingToolDuplicate, on as INTERNAL_MESSAGE_CHANNEL, vn as extensionForMime, zt as resolvePinnedHostnameWithPolicy } from "./pi-embedded-helpers-
|
|
4
|
+
import { At as hasAlphaChannel, En as mediaKindFromMime, G as appendAssistantMessageToSessionTranscript, It as closeDispatcher, K as resolveMirroredTranscriptText, Lt as createPinnedDispatcher, Mt as resizeToJpeg, On as resolveSignalAccount, Ot as convertHeicToJpeg, Pt as saveMediaBuffer, Rt as resolvePinnedHostname, Tn as maxBytesForKind, _n as detectMime, gt as getChannelDock, jn as normalizeChannelId, jt as optimizeImageToPng, kn as getChannelPlugin, m as isMessagingToolDuplicate, on as INTERNAL_MESSAGE_CHANNEL, vn as extensionForMime, zt as resolvePinnedHostnameWithPolicy } from "./pi-embedded-helpers-DKKB89sm.js";
|
|
5
5
|
import { t as loadConfig } from "./config-UB10lGn3.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
package/dist/extensionAPI.js
CHANGED
|
@@ -4,14 +4,14 @@ import { A as normalizeE164, B as danger, C as CONFIG_DIR, D as formatTerminalLi
|
|
|
4
4
|
import { B as resolveSynurexAgentDir, C as getShellPathFromLoginShell, F as resolveApiKeyForProfile, H as DEFAULT_CONTEXT_TOKENS, I as listProfilesForProvider, L as markAuthProfileGood, M as isProfileInCooldown, N as markAuthProfileFailure, O as isTruthyEnvValue, P as markAuthProfileUsed, R as ensureAuthProfileStore, S as resolveModelAuthMode, T as resolveShellEnvFallbackTimeoutMs, U as DEFAULT_MODEL, V as resolveAuthProfileDisplayLabel, W as DEFAULT_PROVIDER, _ as getApiKeyForModel, a as modelKey, b as resolveApiKeyForProvider, c as resolveConfiguredModelRef, d as resolveThinkingDefault, f as normalizeGoogleModelId, i as isCliProvider, j as resolveAuthProfileOrder, k as parseBooleanValue$1, l as resolveDefaultModelForAgent, n as buildConfiguredAllowlistKeys, o as normalizeProviderId, r as buildModelAliasIndex, t as buildAllowedModelSet, u as resolveModelRefFromString, v as getCustomProviderApiKey, x as resolveEnvApiKey, y as requireApiKey, z as resolveAuthStorePathForDisplay } from "./model-selection-Cz_VcpX5.js";
|
|
5
5
|
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-BOoCTERW.js";
|
|
6
6
|
import { n as resolveCliName, t as formatCliCommand } from "./command-format-rFzrPj6c.js";
|
|
7
|
-
import { A as MediaFetchError, B as resolveTextChunkLimit, C as resolveFetch, D as markdownToIRWithMeta, E as markdownToIR, F as chunkMarkdownText, G as SILENT_REPLY_TOKEN, H as isSafeFenceBreak, I as chunkMarkdownTextWithMode, K as isSilentReplyText, L as chunkText, M as fetchWithSsrFGuard, N as resolveMarkdownTableMode, O as loadWebMedia, P as chunkByNewline, R as chunkTextWithMode, S as parseInlineDirectives$1, T as chunkMarkdownIR, U as parseFenceSpans, V as findFenceSpanAt, W as HEARTBEAT_TOKEN, _ as buildTargetResolverSignature, a as applyReplyThreading, b as parseReplyDirectives, c as shouldSuppressMessagingToolReplies, d as sendMessageSignal, f as sendReadReceiptSignal, g as streamSignalEvents, h as signalRpcRequest, i as applyReplyTagsToPayload, j as fetchRemoteMedia, k as loadWebMediaRaw, l as createReplyToModeFilterForChannel, m as signalCheck, o as filterMessagingToolDuplicates, p as sendTypingSignal, r as normalizeReplyPayloadsForDelivery, s as isRenderablePayload, t as deliverOutboundPayloads, u as resolveReplyToMode, v as normalizeChannelTargetInput, w as wrapFetchWithAbortSignal, x as splitMediaFromOutput, y as normalizeTargetForProvider, z as resolveChunkMode } from "./deliver-
|
|
8
|
-
import { $ as updateSessionStoreEntry, $t as normalizeToolName, A as isCloudCodeAssistFormatError, An as listChannelPlugins, B as parseImageSizeError, Bn as resolveSlackAppToken, Bt as buildWorkspaceSkillCommandSpecs, C as BILLING_ERROR_USER_MESSAGE, Cn as kindFromMime, Ct as resolveGroupSessionKey, D as getApiErrorPayloadFingerprint, Dn as listEnabledSignalAccounts, Dt as resolveProfile, E as formatRawAssistantErrorForUi, En as mediaKindFromMime, Et as resolveBrowserConfig, F as isLikelyContextOverflowError, Fn as listTelegramAccountIds, Ft as SsrFBlockedError, G as appendAssistantMessageToSessionTranscript, Gn as normalizeDiscordToken, Gt as applySkillEnvOverrides, H as ensureSandboxWorkspaceForSession, Hn as normalizeChatType, Ht as loadWorkspaceSkillEntries, I as isRateLimitAssistantError, In as resolveTelegramAccount, J as readSessionUpdatedAt, Jt as applyOwnerOnlyToolPolicy, Kt as applySkillEnvOverridesFromSnapshot, L as isRawApiErrorPayload, Ln as resolveTelegramToken, M as isContextOverflowError, Mn as isWhatsAppGroupJid, Mt as resizeToJpeg, N as isFailoverAssistantError, Nn as normalizeWhatsAppTarget, Nt as getMediaDir, O as isAuthAssistantError, On as resolveSignalAccount, P as isFailoverErrorMessage, Pn as listEnabledTelegramAccounts, Pt as saveMediaBuffer, Q as updateSessionStore, Qt as expandToolGroups, R as isTimeoutErrorMessage, Rn as listBindings, S as isGoogleModelApi, Sn as isGifMedia, St as resolveConversationLabel, T as formatAssistantErrorText, Tt as registerBrowserRoutes, U as resolveSandboxContext, Un as listEnabledDiscordAccounts, Ut as resolveSkillsPromptForRun, V as sanitizeUserFacingText, Vn as resolveSlackBotToken, Vt as buildWorkspaceSkillSnapshot, W as resolveSandboxRuntimeStatus, Wn as resolveDiscordAccount, Wt as resolvePluginSkillDirs, X as saveSessionStore, Xt as collectExplicitAllowlist, Y as recordSessionMetaFromInbound, Yt as buildPluginToolGroups, Z as updateLastRoute, Zt as expandPolicyWithPluginGroups, _ as sanitizeSessionMessagesImages, _n as detectMime, _t as listChannelDocks, a as formatXHighModelHint, an as sanitizeGoogleTurnOrdering, at as normalizeDeliveryContext, b as downgradeOpenAIReasoningBlocks, bn as imageMimeFromFormat, bt as resolveChannelGroupToolsPolicy, c as normalizeReasoningLevel, cn as isInternalMessageChannel, ct as evaluateSessionFreshness, d as normalizeVerboseLevel, dn as normalizeMessageChannel, dt as resolveSessionResetType, en as resolveToolProfilePolicy, et as isCacheEnabled, f as resolveResponseUsageMode, fn as resolveGatewayMessageChannel, ft as resolveThreadFlag, g as normalizeTextForComparison, gn as GATEWAY_CLIENT_NAMES, gt as getChannelDock, h as isMessagingToolDuplicateNormalized, hn as GATEWAY_CLIENT_MODES, ht as deriveSessionMetaPatch, i as formatThinkingLevels, in as resolveBootstrapMaxChars, it as mergeDeliveryContext, j as isCompactionFailureError, jn as normalizeChannelId$1, k as isBillingAssistantError, kn as getChannelPlugin, kt as getImageMetadata, l as normalizeThinkLevel, ln as isMarkdownCapableMessageChannel, lt as resolveChannelResetConfig, mn as GATEWAY_CLIENT_IDS, mt as resolveMainSessionKey, n as validateGeminiTurns, nn as buildBootstrapContextFiles, nt as deliveryContextFromSession, o as listThinkingLevels, on as INTERNAL_MESSAGE_CHANNEL, ot as normalizeSessionDeliveryFields, p as supportsXHighThinking, pn as resolveMessageChannel, pt as DEFAULT_RESET_TRIGGERS, q as loadSessionStore, qt as resolveSandboxConfigForAgent, r as pickFallbackThinkingLevel, rn as ensureSessionHeader, rt as deliveryContextKey, s as normalizeElevatedLevel, sn as isDeliverableMessageChannel, st as resolveSessionKey$1, t as validateAnthropicTurns, tn as stripPluginOnlyAllowlist, tt as resolveCacheTtlMs$1, u as normalizeUsageDisplay, un as listDeliverableMessageChannels, ut as resolveSessionResetPolicy, v as sanitizeImageBlocks, vn as extensionForMime, vt as resolveChannelGroupPolicy, w as classifyFailoverReason, wn as MAX_IMAGE_BYTES, wt as createBrowserRouteContext, x as isAntigravityClaude, xn as isAudioFileName, xt as resolveIMessageAccount, y as sanitizeToolResultImages, yn as getFileExtension, yt as resolveChannelGroupRequireMention, z as parseImageDimensionError, zn as resolveSlackAccount } from "./pi-embedded-helpers-
|
|
7
|
+
import { A as MediaFetchError, B as resolveTextChunkLimit, C as resolveFetch, D as markdownToIRWithMeta, E as markdownToIR, F as chunkMarkdownText, G as SILENT_REPLY_TOKEN, H as isSafeFenceBreak, I as chunkMarkdownTextWithMode, K as isSilentReplyText, L as chunkText, M as fetchWithSsrFGuard, N as resolveMarkdownTableMode, O as loadWebMedia, P as chunkByNewline, R as chunkTextWithMode, S as parseInlineDirectives$1, T as chunkMarkdownIR, U as parseFenceSpans, V as findFenceSpanAt, W as HEARTBEAT_TOKEN, _ as buildTargetResolverSignature, a as applyReplyThreading, b as parseReplyDirectives, c as shouldSuppressMessagingToolReplies, d as sendMessageSignal, f as sendReadReceiptSignal, g as streamSignalEvents, h as signalRpcRequest, i as applyReplyTagsToPayload, j as fetchRemoteMedia, k as loadWebMediaRaw, l as createReplyToModeFilterForChannel, m as signalCheck, o as filterMessagingToolDuplicates, p as sendTypingSignal, r as normalizeReplyPayloadsForDelivery, s as isRenderablePayload, t as deliverOutboundPayloads, u as resolveReplyToMode, v as normalizeChannelTargetInput, w as wrapFetchWithAbortSignal, x as splitMediaFromOutput, y as normalizeTargetForProvider, z as resolveChunkMode } from "./deliver-C2TEJxeH.js";
|
|
8
|
+
import { $ as updateSessionStoreEntry, $t as normalizeToolName, A as isCloudCodeAssistFormatError, An as listChannelPlugins, B as parseImageSizeError, Bn as resolveSlackAppToken, Bt as buildWorkspaceSkillCommandSpecs, C as BILLING_ERROR_USER_MESSAGE, Cn as kindFromMime, Ct as resolveGroupSessionKey, D as getApiErrorPayloadFingerprint, Dn as listEnabledSignalAccounts, Dt as resolveProfile, E as formatRawAssistantErrorForUi, En as mediaKindFromMime, Et as resolveBrowserConfig, F as isLikelyContextOverflowError, Fn as listTelegramAccountIds, Ft as SsrFBlockedError, G as appendAssistantMessageToSessionTranscript, Gn as normalizeDiscordToken, Gt as applySkillEnvOverrides, H as ensureSandboxWorkspaceForSession, Hn as normalizeChatType, Ht as loadWorkspaceSkillEntries, I as isRateLimitAssistantError, In as resolveTelegramAccount, J as readSessionUpdatedAt, Jt as applyOwnerOnlyToolPolicy, Kt as applySkillEnvOverridesFromSnapshot, L as isRawApiErrorPayload, Ln as resolveTelegramToken, M as isContextOverflowError, Mn as isWhatsAppGroupJid, Mt as resizeToJpeg, N as isFailoverAssistantError, Nn as normalizeWhatsAppTarget, Nt as getMediaDir, O as isAuthAssistantError, On as resolveSignalAccount, P as isFailoverErrorMessage, Pn as listEnabledTelegramAccounts, Pt as saveMediaBuffer, Q as updateSessionStore, Qt as expandToolGroups, R as isTimeoutErrorMessage, Rn as listBindings, S as isGoogleModelApi, Sn as isGifMedia, St as resolveConversationLabel, T as formatAssistantErrorText, Tt as registerBrowserRoutes, U as resolveSandboxContext, Un as listEnabledDiscordAccounts, Ut as resolveSkillsPromptForRun, V as sanitizeUserFacingText, Vn as resolveSlackBotToken, Vt as buildWorkspaceSkillSnapshot, W as resolveSandboxRuntimeStatus, Wn as resolveDiscordAccount, Wt as resolvePluginSkillDirs, X as saveSessionStore, Xt as collectExplicitAllowlist, Y as recordSessionMetaFromInbound, Yt as buildPluginToolGroups, Z as updateLastRoute, Zt as expandPolicyWithPluginGroups, _ as sanitizeSessionMessagesImages, _n as detectMime, _t as listChannelDocks, a as formatXHighModelHint, an as sanitizeGoogleTurnOrdering, at as normalizeDeliveryContext, b as downgradeOpenAIReasoningBlocks, bn as imageMimeFromFormat, bt as resolveChannelGroupToolsPolicy, c as normalizeReasoningLevel, cn as isInternalMessageChannel, ct as evaluateSessionFreshness, d as normalizeVerboseLevel, dn as normalizeMessageChannel, dt as resolveSessionResetType, en as resolveToolProfilePolicy, et as isCacheEnabled, f as resolveResponseUsageMode, fn as resolveGatewayMessageChannel, ft as resolveThreadFlag, g as normalizeTextForComparison, gn as GATEWAY_CLIENT_NAMES, gt as getChannelDock, h as isMessagingToolDuplicateNormalized, hn as GATEWAY_CLIENT_MODES, ht as deriveSessionMetaPatch, i as formatThinkingLevels, in as resolveBootstrapMaxChars, it as mergeDeliveryContext, j as isCompactionFailureError, jn as normalizeChannelId$1, k as isBillingAssistantError, kn as getChannelPlugin, kt as getImageMetadata, l as normalizeThinkLevel, ln as isMarkdownCapableMessageChannel, lt as resolveChannelResetConfig, mn as GATEWAY_CLIENT_IDS, mt as resolveMainSessionKey, n as validateGeminiTurns, nn as buildBootstrapContextFiles, nt as deliveryContextFromSession, o as listThinkingLevels, on as INTERNAL_MESSAGE_CHANNEL, ot as normalizeSessionDeliveryFields, p as supportsXHighThinking, pn as resolveMessageChannel, pt as DEFAULT_RESET_TRIGGERS, q as loadSessionStore, qt as resolveSandboxConfigForAgent, r as pickFallbackThinkingLevel, rn as ensureSessionHeader, rt as deliveryContextKey, s as normalizeElevatedLevel, sn as isDeliverableMessageChannel, st as resolveSessionKey$1, t as validateAnthropicTurns, tn as stripPluginOnlyAllowlist, tt as resolveCacheTtlMs$1, u as normalizeUsageDisplay, un as listDeliverableMessageChannels, ut as resolveSessionResetPolicy, v as sanitizeImageBlocks, vn as extensionForMime, vt as resolveChannelGroupPolicy, w as classifyFailoverReason, wn as MAX_IMAGE_BYTES, wt as createBrowserRouteContext, x as isAntigravityClaude, xn as isAudioFileName, xt as resolveIMessageAccount, y as sanitizeToolResultImages, yn as getFileExtension, yt as resolveChannelGroupRequireMention, z as parseImageDimensionError, zn as resolveSlackAccount } from "./pi-embedded-helpers-DKKB89sm.js";
|
|
9
9
|
import { A as getWebAuthAgeMs, C as getConfigValueAtPath, D as resolveAgentMaxConcurrent, E as unsetConfigValueAtPath, M as logoutWeb, O as VERSION, P as readWebSelfId, R as webAuthExists, S as unsetConfigOverride, T as setConfigValueAtPath, _ as resolveEnableState, a as validateConfigObjectWithPlugins, b as resetConfigOverrides, c as resolveTelegramCustomCommands, d as validateJsonSchemaValue, f as loadPluginManifestRegistry, g as normalizePluginsConfig, i as writeConfigFile, j as logWebSelfId, k as resolveWhatsAppAccount, l as isSafeExecutableValue, n as readConfigFileSnapshot, o as TELEGRAM_COMMAND_NAME_PATTERN, p as discoverSynurexPlugins, r as resolveConfigSnapshotHash, s as normalizeTelegramCommandName, t as loadConfig, u as parseDurationMs, v as resolveMemorySlotDecision, w as parseConfigPath, x as setConfigOverride, y as getConfigOverrides } from "./config-UB10lGn3.js";
|
|
10
10
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-EhM2JAQo.js";
|
|
11
|
-
import { C as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as rawDataToString, b as formatUncaughtError, h as ensureChromeExtensionRelayServer, v as extractErrorCode, y as formatErrorMessage$1 } from "./chrome-
|
|
11
|
+
import { C as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as rawDataToString, b as formatUncaughtError, h as ensureChromeExtensionRelayServer, v as extractErrorCode, y as formatErrorMessage$1 } from "./chrome-BTQJDtEX.js";
|
|
12
12
|
import { a as resolveStorePath, i as resolveSessionTranscriptsDirForAgent, n as resolveSessionFilePath, r as resolveSessionTranscriptPath } from "./paths-D4TjaAs9.js";
|
|
13
13
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-JLH5W4He.js";
|
|
14
|
-
import { _ as stripThinkingTagsFromText, a as decodeDataUrl, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripMinimaxToolCallXml, h as stripDowngradedToolCallText, i as coerceImageModelConfig, l as extractAssistantThinking, m as promoteThinkingTagsToBlocks, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, t as describeImageWithModel, u as extractThinkingFromTaggedStream, v as resolveToolDisplay, y as ensureSynurexModelsJson } from "./image-
|
|
14
|
+
import { _ as stripThinkingTagsFromText, a as decodeDataUrl, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripMinimaxToolCallXml, h as stripDowngradedToolCallText, i as coerceImageModelConfig, l as extractAssistantThinking, m as promoteThinkingTagsToBlocks, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, t as describeImageWithModel, u as extractThinkingFromTaggedStream, v as resolveToolDisplay, y as ensureSynurexModelsJson } from "./image-saBkWIDR.js";
|
|
15
15
|
import { i as resolveMemorySearchConfig, n as resolveRetryConfig, r as retryAsync } from "./manager-DORkoiXy.js";
|
|
16
16
|
import { c as listMemoryFiles, l as normalizeExtraMemoryPaths } from "./sqlite-BjBQdG8T.js";
|
|
17
17
|
import { t as redactSensitiveText } from "./redact-BIMJ3ntQ.js";
|
|
@@ -35,7 +35,7 @@ import { EdgeTTS } from "node-edge-tts";
|
|
|
35
35
|
import AjvPkg from "ajv";
|
|
36
36
|
import { createServer } from "node:http";
|
|
37
37
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
38
|
-
import { WebSocket } from "ws";
|
|
38
|
+
import { WebSocket as WebSocket$1 } from "ws";
|
|
39
39
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
40
40
|
import * as net$1 from "node:net";
|
|
41
41
|
import net from "node:net";
|
|
@@ -7183,7 +7183,7 @@ var GatewayClient = class {
|
|
|
7183
7183
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
7184
7184
|
});
|
|
7185
7185
|
}
|
|
7186
|
-
this.ws = new WebSocket(url, wsOptions);
|
|
7186
|
+
this.ws = new WebSocket$1(url, wsOptions);
|
|
7187
7187
|
this.ws.on("open", () => {
|
|
7188
7188
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
7189
7189
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -7387,7 +7387,7 @@ var GatewayClient = class {
|
|
|
7387
7387
|
return null;
|
|
7388
7388
|
}
|
|
7389
7389
|
async request(method, params, opts) {
|
|
7390
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
7390
|
+
if (!this.ws || this.ws.readyState !== WebSocket$1.OPEN) throw new Error("gateway not connected");
|
|
7391
7391
|
const id = randomUUID();
|
|
7392
7392
|
const frame = {
|
|
7393
7393
|
type: "req",
|
|
@@ -9121,7 +9121,7 @@ async function routeReply(params) {
|
|
|
9121
9121
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
9122
9122
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
9123
9123
|
try {
|
|
9124
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
9124
|
+
const { deliverOutboundPayloads } = await import("./deliver-C2TEJxeH.js").then((n) => n.n);
|
|
9125
9125
|
return {
|
|
9126
9126
|
ok: true,
|
|
9127
9127
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -44333,7 +44333,7 @@ async function describeStickerImage(params) {
|
|
|
44333
44333
|
logVerbose(`telegram: describing sticker with ${provider}/${model}`);
|
|
44334
44334
|
try {
|
|
44335
44335
|
const buffer = await fs$1.readFile(imagePath);
|
|
44336
|
-
const { describeImageWithModel } = await import("./image-
|
|
44336
|
+
const { describeImageWithModel } = await import("./image-saBkWIDR.js").then((n) => n.n);
|
|
44337
44337
|
return (await describeImageWithModel({
|
|
44338
44338
|
buffer,
|
|
44339
44339
|
fileName: "sticker.webp",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
2
|
import { P as shortenHomeInString } from "./exec-EqLC5sqa.js";
|
|
3
3
|
import { B as resolveSynurexAgentDir, _ as getApiKeyForModel, g as resolveImplicitProviders, h as resolveImplicitCopilotProvider, m as resolveImplicitBedrockProvider, p as normalizeProviders, y as requireApiKey } from "./model-selection-Cz_VcpX5.js";
|
|
4
|
-
import { V as sanitizeUserFacingText } from "./pi-embedded-helpers-
|
|
4
|
+
import { V as sanitizeUserFacingText } from "./pi-embedded-helpers-DKKB89sm.js";
|
|
5
5
|
import { t as loadConfig } from "./config-UB10lGn3.js";
|
|
6
6
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-EhM2JAQo.js";
|
|
7
7
|
import { n as redactToolDetail } from "./redact-BIMJ3ntQ.js";
|
|
@@ -4,7 +4,7 @@ import { A as normalizeE164, C as CONFIG_DIR, N as resolveUserPath, _ as normali
|
|
|
4
4
|
import { O as isTruthyEnvValue, k as parseBooleanValue } from "./model-selection-Cz_VcpX5.js";
|
|
5
5
|
import { t as formatCliCommand } from "./command-format-rFzrPj6c.js";
|
|
6
6
|
import { _ as resolveEnableState, f as loadPluginManifestRegistry, g as normalizePluginsConfig, h as MANIFEST_KEY, i as writeConfigFile, k as resolveWhatsAppAccount, m as LEGACY_MANIFEST_KEYS, t as loadConfig, v as resolveMemorySlotDecision } from "./config-UB10lGn3.js";
|
|
7
|
-
import { C as DEFAULT_AI_SNAPSHOT_MAX_CHARS, D as DEFAULT_SYNUREX_BROWSER_ENABLED, E as DEFAULT_SYNUREX_BROWSER_COLOR, O as DEFAULT_SYNUREX_BROWSER_PROFILE_NAME, S as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, T as DEFAULT_BROWSER_EVALUATE_ENABLED, a as resolveSynurexUserDataDir, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, g as stopChromeExtensionRelayServer, h as ensureChromeExtensionRelayServer, i as launchSynurexChrome, l as createTargetViaCdp, m as getHeadersWithAuth, n as isChromeCdpReady, o as stopSynurexChrome, p as appendCdpPath, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as extractErrorCode, w as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, x as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, y as formatErrorMessage } from "./chrome-
|
|
7
|
+
import { C as DEFAULT_AI_SNAPSHOT_MAX_CHARS, D as DEFAULT_SYNUREX_BROWSER_ENABLED, E as DEFAULT_SYNUREX_BROWSER_COLOR, O as DEFAULT_SYNUREX_BROWSER_PROFILE_NAME, S as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, T as DEFAULT_BROWSER_EVALUATE_ENABLED, a as resolveSynurexUserDataDir, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, g as stopChromeExtensionRelayServer, h as ensureChromeExtensionRelayServer, i as launchSynurexChrome, l as createTargetViaCdp, m as getHeadersWithAuth, n as isChromeCdpReady, o as stopSynurexChrome, p as appendCdpPath, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as extractErrorCode, w as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, x as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, y as formatErrorMessage } from "./chrome-BTQJDtEX.js";
|
|
8
8
|
import { r as resolveSessionTranscriptPath, t as resolveDefaultSessionStorePath } from "./paths-D4TjaAs9.js";
|
|
9
9
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-JLH5W4He.js";
|
|
10
10
|
import os from "node:os";
|
|
@@ -2042,7 +2042,7 @@ function isModuleNotFoundError(err) {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
async function loadPwAiModule(mode) {
|
|
2044
2044
|
try {
|
|
2045
|
-
return await import("./pw-ai-
|
|
2045
|
+
return await import("./pw-ai-BKN0Jm4P.js");
|
|
2046
2046
|
} catch (err) {
|
|
2047
2047
|
if (mode === "soft") return null;
|
|
2048
2048
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -4864,11 +4864,11 @@ function createProfileContext(opts, profile) {
|
|
|
4864
4864
|
const userDataDir = resolveSynurexUserDataDir(profile.name);
|
|
4865
4865
|
const profileState = getProfileState();
|
|
4866
4866
|
if (await isHttpReachable(300) && !profileState.running) try {
|
|
4867
|
-
await (await import("./pw-ai-
|
|
4867
|
+
await (await import("./pw-ai-BKN0Jm4P.js")).closePlaywrightBrowserConnection();
|
|
4868
4868
|
} catch {}
|
|
4869
4869
|
if (profileState.running) await stopRunningBrowser();
|
|
4870
4870
|
try {
|
|
4871
|
-
await (await import("./pw-ai-
|
|
4871
|
+
await (await import("./pw-ai-BKN0Jm4P.js")).closePlaywrightBrowserConnection();
|
|
4872
4872
|
} catch {}
|
|
4873
4873
|
if (!fs.existsSync(userDataDir)) return {
|
|
4874
4874
|
moved: false,
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import os, { homedir } from "node:os";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs, { createWriteStream, existsSync, statSync } from "node:fs";
|
|
7
7
|
import { Logger } from "tslog";
|
|
8
|
-
import
|
|
8
|
+
import json5 from "json5";
|
|
9
9
|
import chalk, { Chalk } from "chalk";
|
|
10
10
|
import fs$1 from "node:fs/promises";
|
|
11
11
|
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
@@ -2250,7 +2250,7 @@ function readLoggingConfig() {
|
|
|
2250
2250
|
try {
|
|
2251
2251
|
if (!fs.existsSync(configPath)) return;
|
|
2252
2252
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
2253
|
-
const logging =
|
|
2253
|
+
const logging = json5.parse(raw)?.logging;
|
|
2254
2254
|
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
2255
2255
|
return logging;
|
|
2256
2256
|
} catch {
|
|
@@ -8054,7 +8054,7 @@ var IncludeProcessor = class IncludeProcessor {
|
|
|
8054
8054
|
};
|
|
8055
8055
|
const defaultResolver = {
|
|
8056
8056
|
readFile: (p) => fs.readFileSync(p, "utf-8"),
|
|
8057
|
-
parseJson: (raw) =>
|
|
8057
|
+
parseJson: (raw) => json5.parse(raw)
|
|
8058
8058
|
};
|
|
8059
8059
|
/**
|
|
8060
8060
|
* Resolves all $include directives in a parsed config object.
|
|
@@ -10695,18 +10695,18 @@ function resolveConfigPathForDeps(deps) {
|
|
|
10695
10695
|
function normalizeDeps(overrides = {}) {
|
|
10696
10696
|
return {
|
|
10697
10697
|
fs: overrides.fs ?? fs,
|
|
10698
|
-
json5: overrides.json5 ??
|
|
10698
|
+
json5: overrides.json5 ?? json5,
|
|
10699
10699
|
env: overrides.env ?? process.env,
|
|
10700
10700
|
homedir: overrides.homedir ?? os.homedir,
|
|
10701
10701
|
configPath: overrides.configPath ?? "",
|
|
10702
10702
|
logger: overrides.logger ?? console
|
|
10703
10703
|
};
|
|
10704
10704
|
}
|
|
10705
|
-
function parseConfigJson5(raw, json5 =
|
|
10705
|
+
function parseConfigJson5(raw, json5$1 = json5) {
|
|
10706
10706
|
try {
|
|
10707
10707
|
return {
|
|
10708
10708
|
ok: true,
|
|
10709
|
-
parsed: json5.parse(raw)
|
|
10709
|
+
parsed: json5$1.parse(raw)
|
|
10710
10710
|
};
|
|
10711
10711
|
} catch (err) {
|
|
10712
10712
|
return {
|
|
@@ -11203,7 +11203,7 @@ function loadSessionStore(storePath, opts = {}) {
|
|
|
11203
11203
|
let mtimeMs = getFileMtimeMs(storePath);
|
|
11204
11204
|
try {
|
|
11205
11205
|
const raw = fs.readFileSync(storePath, "utf-8");
|
|
11206
|
-
const parsed =
|
|
11206
|
+
const parsed = json5.parse(raw);
|
|
11207
11207
|
if (isSessionStoreRecord(parsed)) store = parsed;
|
|
11208
11208
|
mtimeMs = getFileMtimeMs(storePath) ?? mtimeMs;
|
|
11209
11209
|
} catch {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./paths-8P2BYpvK.js";
|
|
2
2
|
import "./exec-EqLC5sqa.js";
|
|
3
3
|
import { t as formatCliCommand } from "./command-format-rFzrPj6c.js";
|
|
4
|
-
import { m as getHeadersWithAuth, t as getChromeWebSocketUrl, u as formatAriaSnapshot, y as formatErrorMessage } from "./chrome-
|
|
4
|
+
import { m as getHeadersWithAuth, t as getChromeWebSocketUrl, u as formatAriaSnapshot, y as formatErrorMessage } from "./chrome-BTQJDtEX.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import crypto from "node:crypto";
|
|
@@ -1,41 +1,65 @@
|
|
|
1
|
-
---
|
|
2
|
-
summary: "Workspace template for HEARTBEAT.md"
|
|
3
|
-
read_when:
|
|
4
|
-
- Bootstrapping a workspace manually
|
|
5
|
-
---
|
|
6
|
-
|
|
7
1
|
# HEARTBEAT.md
|
|
8
2
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
2.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
3
|
+
## 🧠 Adaptive Priority System
|
|
4
|
+
|
|
5
|
+
Heartbeat fires every 2 minutes. Each beat, score what needs attention using staleness. Act on the top 1-2 items. Skip if nothing's due.
|
|
6
|
+
|
|
7
|
+
### How It Works
|
|
8
|
+
Each check has a **staleness score** = `(minutes since last run) / (ideal interval)`
|
|
9
|
+
|
|
10
|
+
Score >= 1.0 means it's due. Higher = more overdue. Always run the highest first.
|
|
11
|
+
|
|
12
|
+
### 📊 Universal Check Registry
|
|
13
|
+
|
|
14
|
+
These checks **auto-activate** based on your setup. Skip any that don't apply.
|
|
15
|
+
|
|
16
|
+
| Check | Ideal Interval | Activates When | What to Do |
|
|
17
|
+
|-------|---------------|----------------|------------|
|
|
18
|
+
| **Node health** | 5m | Paired nodes exist | Ping node endpoints, alert if down |
|
|
19
|
+
| **Unread messages** | 5m | Any channel configured | Check for missed pings/mentions needing response |
|
|
20
|
+
| **Git status** | 15m | Workspace has .git | Commit + push uncommitted changes |
|
|
21
|
+
| **Cron health** | 30m | Cron jobs exist | Check for failed runs |
|
|
22
|
+
| **Pending tasks** | 10m | Tasks mentioned in memory | Follow up on unfinished work from recent conversations |
|
|
23
|
+
| **Memory maintenance** | 4h | Always | Review daily files, distill into MEMORY.md |
|
|
24
|
+
| **Workspace cleanup** | 6h | Always | Fix stale notes, outdated docs, dead references |
|
|
25
|
+
|
|
26
|
+
### 🎯 Behavior-Adaptive Frequency
|
|
27
|
+
|
|
28
|
+
The checks above are baselines. **Adjust dynamically based on user behavior:**
|
|
29
|
+
|
|
30
|
+
- **User active in last 10m** → prioritize responsiveness, skip background work
|
|
31
|
+
- **User gone 30m+** → ramp up proactive work (git commits, memory, cleanup)
|
|
32
|
+
- **User gone 2h+** → deep work mode (memory maintenance, workspace organization, research)
|
|
33
|
+
- **Error detected** → increase health check frequency until resolved
|
|
34
|
+
- **Quiet hours** (detect from user timezone) → health checks only, skip noise
|
|
35
|
+
|
|
36
|
+
### 🔍 Context Discovery (First Few Beats)
|
|
37
|
+
|
|
38
|
+
On fresh start, discover what's relevant:
|
|
39
|
+
1. Check if workspace has `.git` → enable git checks
|
|
40
|
+
2. Check for paired nodes → enable node health
|
|
41
|
+
3. Check for cron jobs → enable cron health
|
|
42
|
+
4. Read recent memory files → find pending tasks
|
|
43
|
+
5. Check channel config → enable message checks
|
|
44
|
+
|
|
45
|
+
Store findings in `memory/heartbeat-state.json`.
|
|
46
|
+
|
|
47
|
+
### Algorithm
|
|
48
|
+
1. Read `memory/heartbeat-state.json` for last-run timestamps + discovered context
|
|
49
|
+
2. Calculate staleness score for each active check
|
|
50
|
+
3. If max score < 0.8, reply `HEARTBEAT_OK`
|
|
51
|
+
4. Run the 1-2 highest scoring checks
|
|
52
|
+
5. Update heartbeat-state.json
|
|
53
|
+
6. If actionable, message the user. If not, `HEARTBEAT_OK`
|
|
54
|
+
|
|
55
|
+
### Rules
|
|
56
|
+
- 🔴 **Critical alerts** (node down, auth expiring): bypass scoring, alert immediately
|
|
57
|
+
- 🟡 **User recently active**: be responsive, don't disappear into background work
|
|
58
|
+
- 🟢 **User away**: be productive, chain tasks, clean up, push code
|
|
59
|
+
- Never more than 2 checks per beat (stay fast)
|
|
60
|
+
- Proactive fixes (commit, push, fix typos) don't need permission
|
|
61
|
+
- Big changes (deploys, config changes, external sends) need permission
|
|
62
|
+
- **Learn patterns**: if user always asks about X in the morning, check X proactively
|
|
63
|
+
|
|
64
|
+
### 🏃 Be Productive, Not Busy
|
|
65
|
+
A real employee prioritizes by feel, not by checklist. Use scoring as a guide but also use judgment. If you notice something broken while doing another check, fix it. If everything is green, `HEARTBEAT_OK` and save the compute.
|
package/package.json
CHANGED
|
Binary file
|