openclaw-multi-auto 1.7.9 → 1.8.1
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/{agent-Bf9VxLj8.js → agent-ef71Xoo3.js} +7 -7
- package/dist/{audio-preflight-DKt9ICbJ.js → audio-preflight-BQoP-O-0.js} +1 -1
- package/dist/{auth-profiles.runtime-pDQ4QesA.js → auth-profiles.runtime-CuInvQ6F.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{compact.runtime-Y7wbaDO2.js → compact.runtime-BOg89Gro.js} +1 -1
- package/dist/{deliver-runtime-DBYdmfDR.js → deliver-runtime-CUrIlSzN.js} +1 -1
- package/dist/{image-runtime-XMz7IM-j.js → image-runtime-Dur8cmII.js} +1 -1
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{login-aLc84rc7.js → login-CvFRLU0k.js} +2 -2
- package/dist/{login-qr-D3QtIyy8.js → login-qr-D-_3HfJq.js} +2 -2
- package/dist/{manager-runtime-D8C3_L2_.js → manager-runtime-CfBjUnwB.js} +1 -1
- package/dist/{manager.runtime-ilRhqZW0.js → manager.runtime-DF-LRAbL.js} +2 -2
- package/dist/{model-selection-G7SiAgN6.js → model-selection-C9tlIhgN.js} +43 -43
- package/dist/{pi-model-discovery-runtime-DgHKNg0i.js → pi-model-discovery-runtime-CK36RhYz.js} +1 -1
- package/dist/{pi-tools.before-tool-call.runtime-Be9V6RlN.js → pi-tools.before-tool-call.runtime-CLRTNt4A.js} +1 -1
- package/dist/{pw-ai-BLzIHVAG.js → pw-ai-CRL5SGWK.js} +1 -1
- package/dist/{runtime-whatsapp-login.runtime-CXhM_C-C.js → runtime-whatsapp-login.runtime-CO-iUlqS.js} +3 -3
- package/dist/{runtime-whatsapp-outbound.runtime-Kx-CVYdW.js → runtime-whatsapp-outbound.runtime-IeVUgrJu.js} +2 -2
- package/dist/{send-p1D-Lzec.js → send-CsgNtXyY.js} +1 -1
- package/dist/{session-DIkw9afg.js → session-BhX4LYCK.js} +1 -1
- package/dist/{slash-commands.runtime-D6R-T9zj.js → slash-commands.runtime-BTNXGYOP.js} +1 -1
- package/dist/{slash-dispatch.runtime-CgJLQTwP.js → slash-dispatch.runtime-cYx62DOd.js} +1 -1
- package/dist/{slash-skill-commands.runtime-BC9oRGpm.js → slash-skill-commands.runtime-ThOxhaze.js} +1 -1
- package/dist/{subagent-registry-runtime-DQeHzv-u.js → subagent-registry-runtime-DkamrsVw.js} +1 -1
- package/dist/{web-gHwQkPhu.js → web-bHB4SzXZ.js} +4 -4
- package/dist/{whatsapp-actions-C1UZXBOC.js → whatsapp-actions-BqFiZbuw.js} +2 -2
- package/package.json +1 -1
- package/scripts/create-instance.sh +60 -177
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ct as resolveAgentWorkspaceDir, Dt as resolveSessionAgentId, R as resolveStorePath, St as resolveAgentSkillsFilter, Tt as resolveEffectiveModelFallbacks, gt as listAgentIds, vt as resolveAgentDir } from "./query-expansion-DnS6CGY2.js";
|
|
2
2
|
import { a as defaultRuntime, t as createSubsystemLogger } from "./subsystem-CDcEQtQK.js";
|
|
3
3
|
import { H as normalizeMainKey, U as resolveAgentIdFromSessionKey, V as normalizeAgentId, l as ensureAgentWorkspace } from "./workspace-Cg3kGb1y.js";
|
|
4
|
-
import { $n as emitSessionTranscriptUpdate, $t as isSilentReplyPrefixText, Ai as DEFAULT_MODEL, Br as isInternalMessageChannel, Bt as runWithModelFallback, Ci as formatCliCommand, Di as normalizeVerboseLevel, Ei as normalizeThinkLevel, F as applyVerboseOverride, Ft as formatOutboundPayloadLog, Hr as resolveMessageChannel, It as normalizeOutboundPayloads, J as runEmbeddedPiAgent, L as getRemoteSkillEligibility, Lr as INTERNAL_MESSAGE_CHANNEL, Lt as normalizeOutboundPayloadsForJson, M as getCliSessionId, Mt as resolveSessionDeliveryTarget, N as setCliSessionId, Nt as buildOutboundSessionContext, Oi as supportsXHighThinking, P as runCliAgent, Pt as deliverOutboundPayloads, Qn as resolveSessionTranscriptFile, R as getSkillsSnapshotVersion, Rr as isDeliverableMessageChannel, Si as ensureAuthProfileStore, Ti as formatXHighModelHint, V as resolveSendPolicy, Vr as normalizeMessageChannel, Vt as FailoverError, X as resolveBootstrapWarningSignaturesSeen, Y as prepareSessionManagerForRun, Zn as loadModelCatalog, _r as normalizeChannelId, _t as applyModelOverrideToSessionEntry, a as normalizeProviderId, bi as setRuntimeConfigSnapshot, bt as resolveContextTokensForModel, c as resolveDefaultModelForAgent, cr as resolveChannelResetConfig, ct as normalizeSpawnedRunMetadata, d as resolveCommandSecretRefsViaGateway, dr as mergeSessionEntry, dt as registerAgentRunContext, en as isSilentReplyText, er as loadSessionStore, fr as setSessionRuntimeModel, ft as resolveAcpSessionCwd, gi as buildWorkspaceSkillSnapshot, gr as getChannelPlugin, gt as AGENT_LANE_SUBAGENT, ht as AGENT_LANE_NESTED, i as normalizeModelRef, ir as normalizeAccountId, ji as DEFAULT_PROVIDER, jt as resolveOutboundTarget, l as resolveThinkingDefault, lr as resolveSessionResetPolicy, lt as clearAgentRunContext, mr as resolveExplicitAgentSessionKey, mt as resolveAcpDispatchPolicyError, n as isCliProvider, nn as toAcpRuntimeError, or as resolveSessionKey, ot as resolveAgentTimeoutMs, pt as resolveAcpAgentPolicyError, qt as clearBootstrapSnapshotOnSessionRollover, r as modelKey, rr as updateSessionStore, s as resolveConfiguredModelRef, sr as evaluateSessionFreshness, st as formatAgentInternalEventsForPrompt, t as buildAllowedModelSet, tn as getAcpSessionManager, u as getAgentRuntimeCommandSecretTargetIds, ur as resolveSessionResetType, ut as emitAgentEvent, vi as loadConfig, vt as deriveSessionTotalTokens, wi as formatThinkingLevels, wt as normalizeReplyPayload, yi as readConfigFileSnapshotForWrite, yt as hasNonzeroUsage, z as clearSessionAuthProfileOverride, zr as isGatewayMessageChannel, zt as resolveMessageChannelSelection } from "./model-selection-
|
|
4
|
+
import { $n as emitSessionTranscriptUpdate, $t as isSilentReplyPrefixText, Ai as DEFAULT_MODEL, Br as isInternalMessageChannel, Bt as runWithModelFallback, Ci as formatCliCommand, Di as normalizeVerboseLevel, Ei as normalizeThinkLevel, F as applyVerboseOverride, Ft as formatOutboundPayloadLog, Hr as resolveMessageChannel, It as normalizeOutboundPayloads, J as runEmbeddedPiAgent, L as getRemoteSkillEligibility, Lr as INTERNAL_MESSAGE_CHANNEL, Lt as normalizeOutboundPayloadsForJson, M as getCliSessionId, Mt as resolveSessionDeliveryTarget, N as setCliSessionId, Nt as buildOutboundSessionContext, Oi as supportsXHighThinking, P as runCliAgent, Pt as deliverOutboundPayloads, Qn as resolveSessionTranscriptFile, R as getSkillsSnapshotVersion, Rr as isDeliverableMessageChannel, Si as ensureAuthProfileStore, Ti as formatXHighModelHint, V as resolveSendPolicy, Vr as normalizeMessageChannel, Vt as FailoverError, X as resolveBootstrapWarningSignaturesSeen, Y as prepareSessionManagerForRun, Zn as loadModelCatalog, _r as normalizeChannelId, _t as applyModelOverrideToSessionEntry, a as normalizeProviderId, bi as setRuntimeConfigSnapshot, bt as resolveContextTokensForModel, c as resolveDefaultModelForAgent, cr as resolveChannelResetConfig, ct as normalizeSpawnedRunMetadata, d as resolveCommandSecretRefsViaGateway, dr as mergeSessionEntry, dt as registerAgentRunContext, en as isSilentReplyText, er as loadSessionStore, fr as setSessionRuntimeModel, ft as resolveAcpSessionCwd, gi as buildWorkspaceSkillSnapshot, gr as getChannelPlugin, gt as AGENT_LANE_SUBAGENT, ht as AGENT_LANE_NESTED, i as normalizeModelRef, ir as normalizeAccountId, ji as DEFAULT_PROVIDER, jt as resolveOutboundTarget, l as resolveThinkingDefault, lr as resolveSessionResetPolicy, lt as clearAgentRunContext, mr as resolveExplicitAgentSessionKey, mt as resolveAcpDispatchPolicyError, n as isCliProvider, nn as toAcpRuntimeError, or as resolveSessionKey, ot as resolveAgentTimeoutMs, pt as resolveAcpAgentPolicyError, qt as clearBootstrapSnapshotOnSessionRollover, r as modelKey, rr as updateSessionStore, s as resolveConfiguredModelRef, sr as evaluateSessionFreshness, st as formatAgentInternalEventsForPrompt, t as buildAllowedModelSet, tn as getAcpSessionManager, u as getAgentRuntimeCommandSecretTargetIds, ur as resolveSessionResetType, ut as emitAgentEvent, vi as loadConfig, vt as deriveSessionTotalTokens, wi as formatThinkingLevels, wt as normalizeReplyPayload, yi as readConfigFileSnapshotForWrite, yt as hasNonzeroUsage, z as clearSessionAuthProfileOverride, zr as isGatewayMessageChannel, zt as resolveMessageChannelSelection } from "./model-selection-C9tlIhgN.js";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import crypto from "node:crypto";
|
|
7
7
|
import { SessionManager } from "@mariozechner/pi-coding-agent";
|
|
@@ -58,12 +58,12 @@ function createLazySender(channelId, loader, exportName) {
|
|
|
58
58
|
}
|
|
59
59
|
function createDefaultDeps() {
|
|
60
60
|
return {
|
|
61
|
-
whatsapp: createLazySender("whatsapp", () => import("./web-
|
|
62
|
-
telegram: createLazySender("telegram", () => import("./model-selection-
|
|
63
|
-
discord: createLazySender("discord", () => import("./model-selection-
|
|
64
|
-
slack: createLazySender("slack", () => import("./model-selection-
|
|
65
|
-
signal: createLazySender("signal", () => import("./model-selection-
|
|
66
|
-
imessage: createLazySender("imessage", () => import("./model-selection-
|
|
61
|
+
whatsapp: createLazySender("whatsapp", () => import("./web-bHB4SzXZ.js"), "sendMessageWhatsApp"),
|
|
62
|
+
telegram: createLazySender("telegram", () => import("./model-selection-C9tlIhgN.js").then((n) => n.g), "sendMessageTelegram"),
|
|
63
|
+
discord: createLazySender("discord", () => import("./model-selection-C9tlIhgN.js").then((n) => n.yn), "sendMessageDiscord"),
|
|
64
|
+
slack: createLazySender("slack", () => import("./model-selection-C9tlIhgN.js").then((n) => n.v), "sendMessageSlack"),
|
|
65
|
+
signal: createLazySender("signal", () => import("./model-selection-C9tlIhgN.js").then((n) => n.Rt), "sendMessageSignal"),
|
|
66
|
+
imessage: createLazySender("imessage", () => import("./model-selection-C9tlIhgN.js").then((n) => n.y), "sendMessageIMessage")
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
//#endregion
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { d as logVerbose, m as shouldLogVerbose } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Gn as resolveMediaAttachmentLocalRoots, Vn as runAudioTranscription, Wn as normalizeMediaAttachments, Yn as isAudioAttachment } from "./model-selection-
|
|
6
|
+
import { Gn as resolveMediaAttachmentLocalRoots, Vn as runAudioTranscription, Wn as normalizeMediaAttachments, Yn as isAudioAttachment } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Si as ensureAuthProfileStore } from "./model-selection-
|
|
6
|
+
import { Si as ensureAuthProfileStore } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
package/dist/build-info.json
CHANGED
|
@@ -3,12 +3,12 @@ import "../../paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { a as defaultRuntime, t as createSubsystemLogger } from "../../subsystem-CDcEQtQK.js";
|
|
4
4
|
import { U as resolveAgentIdFromSessionKey } from "../../workspace-Cg3kGb1y.js";
|
|
5
5
|
import "../../logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Qt as SILENT_REPLY_TOKEN, er as loadSessionStore, hr as resolveMainSessionKey, pr as resolveAgentMainSessionKey, rr as updateSessionStore } from "../../model-selection-
|
|
6
|
+
import { Qt as SILENT_REPLY_TOKEN, er as loadSessionStore, hr as resolveMainSessionKey, pr as resolveAgentMainSessionKey, rr as updateSessionStore } from "../../model-selection-C9tlIhgN.js";
|
|
7
7
|
import "../../github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "../../boolean-C7Ct_klp.js";
|
|
9
9
|
import "../../fetch-sH_NN8SV.js";
|
|
10
10
|
import { _ as isGatewayStartupEvent } from "../../frontmatter-DhmdUnBP.js";
|
|
11
|
-
import { r as createDefaultDeps, t as agentCommand } from "../../agent-
|
|
11
|
+
import { r as createDefaultDeps, t as agentCommand } from "../../agent-ef71Xoo3.js";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
import path from "node:path";
|
|
14
14
|
import crypto from "node:crypto";
|
|
@@ -3,7 +3,7 @@ import { c as resolveStateDir } from "../../paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { t as createSubsystemLogger } from "../../subsystem-CDcEQtQK.js";
|
|
4
4
|
import { J as toAgentStoreSessionKey, U as resolveAgentIdFromSessionKey, it as parseAgentSessionKey } from "../../workspace-Cg3kGb1y.js";
|
|
5
5
|
import "../../logger-C0l_Gj8Y.js";
|
|
6
|
-
import { ar as hasInterSessionUserProvenance } from "../../model-selection-
|
|
6
|
+
import { ar as hasInterSessionUserProvenance } from "../../model-selection-C9tlIhgN.js";
|
|
7
7
|
import "../../github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "../../boolean-C7Ct_klp.js";
|
|
9
9
|
import "../../fetch-sH_NN8SV.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c416634a885d095cc51cbfa394dcbe4c7c93d9e38483cdaf97f6d333b84a46ec
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Z as compactEmbeddedPiSessionDirect } from "./model-selection-
|
|
6
|
+
import { Z as compactEmbeddedPiSessionDirect } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Pt as deliverOutboundPayloads } from "./model-selection-
|
|
6
|
+
import { Pt as deliverOutboundPayloads } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { qn as describeImageWithModel } from "./model-selection-
|
|
6
|
+
import { qn as describeImageWithModel } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { t as createSubsystemLogger } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { J as runEmbeddedPiAgent, ji as DEFAULT_PROVIDER, o as parseModelRef } from "./model-selection-
|
|
6
|
+
import { J as runEmbeddedPiAgent, ji as DEFAULT_PROVIDER, o as parseModelRef } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as defaultRuntime, h as success, l as danger, u as info } from "./subsystem-CDcEQtQK.js";
|
|
2
2
|
import { r as logInfo } from "./logger-C0l_Gj8Y.js";
|
|
3
|
-
import { Ci as formatCliCommand, vi as loadConfig, wr as logoutWeb, yr as resolveWhatsAppAccount } from "./model-selection-
|
|
4
|
-
import { i as waitForWaConnection, n as formatError, t as createWaSocket } from "./session-
|
|
3
|
+
import { Ci as formatCliCommand, vi as loadConfig, wr as logoutWeb, yr as resolveWhatsAppAccount } from "./model-selection-C9tlIhgN.js";
|
|
4
|
+
import { i as waitForWaConnection, n as formatError, t as createWaSocket } from "./session-BhX4LYCK.js";
|
|
5
5
|
import { DisconnectReason } from "@whiskeysockets/baileys";
|
|
6
6
|
//#region extensions/whatsapp/src/login.ts
|
|
7
7
|
async function loginWeb(verbose, waitForConnection, runtime = defaultRuntime, accountId) {
|
|
@@ -3,12 +3,12 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { a as defaultRuntime, h as success, l as danger, u as info } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import { r as logInfo } from "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Mr as webAuthExists, Or as readWebSelfId, vi as loadConfig, wr as logoutWeb, yr as resolveWhatsAppAccount } from "./model-selection-
|
|
6
|
+
import { Mr as webAuthExists, Or as readWebSelfId, vi as loadConfig, wr as logoutWeb, yr as resolveWhatsAppAccount } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
10
10
|
import "./frontmatter-DhmdUnBP.js";
|
|
11
|
-
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-
|
|
11
|
+
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-BhX4LYCK.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { DisconnectReason } from "@whiskeysockets/baileys";
|
|
14
14
|
import QRCodeModule from "qrcode-terminal/vendor/QRCode/index.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Xt as MemoryIndexManager, Zt as closeAllMemoryIndexManagers } from "./model-selection-
|
|
6
|
+
import { Xt as MemoryIndexManager, Zt as closeAllMemoryIndexManagers } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,12 +3,12 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { E as resolvePreferredOpenClawTmpDir, d as logVerbose, m as shouldLogVerbose, t as createSubsystemLogger } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Fn as textToSpeech, Hn as buildProviderRegistry, In as parseTtsDirectives, Kn as runCapability, Pn as resolveTtsConfig, T as isDangerousNameMatchingEnabled, Tn as formatDiscordUserTag, Un as createMediaAttachmentCache, Wn as normalizeMediaAttachments, bn as formatMention, ci as formatErrorMessage, hn as resolveAgentRoute, wn as resolveDiscordOwnerAccess } from "./model-selection-
|
|
6
|
+
import { Fn as textToSpeech, Hn as buildProviderRegistry, In as parseTtsDirectives, Kn as runCapability, Pn as resolveTtsConfig, T as isDangerousNameMatchingEnabled, Tn as formatDiscordUserTag, Un as createMediaAttachmentCache, Wn as normalizeMediaAttachments, bn as formatMention, ci as formatErrorMessage, hn as resolveAgentRoute, wn as resolveDiscordOwnerAccess } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
10
10
|
import "./frontmatter-DhmdUnBP.js";
|
|
11
|
-
import { n as agentCommandFromIngress } from "./agent-
|
|
11
|
+
import { n as agentCommandFromIngress } from "./agent-ef71Xoo3.js";
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
13
|
import fs from "node:fs/promises";
|
|
14
14
|
import path from "node:path";
|
|
@@ -40,7 +40,7 @@ import { EventEmitter } from "node:events";
|
|
|
40
40
|
import "node:stream/promises";
|
|
41
41
|
import http, { createServer } from "node:http";
|
|
42
42
|
import https from "node:https";
|
|
43
|
-
import WebSocket, { WebSocket
|
|
43
|
+
import WebSocket$1, { WebSocket, WebSocketServer } from "ws";
|
|
44
44
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
45
45
|
import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedrock";
|
|
46
46
|
import { complete, completeSimple, createAssistantMessageEventStream, getApiProvider, getEnvApiKey, registerApiProvider, streamSimple } from "@mariozechner/pi-ai";
|
|
@@ -19108,7 +19108,7 @@ function isModuleNotFoundError(err) {
|
|
|
19108
19108
|
}
|
|
19109
19109
|
async function loadPwAiModule(mode) {
|
|
19110
19110
|
try {
|
|
19111
|
-
return await import("./pw-ai-
|
|
19111
|
+
return await import("./pw-ai-CRL5SGWK.js");
|
|
19112
19112
|
} catch (err) {
|
|
19113
19113
|
if (mode === "soft") return null;
|
|
19114
19114
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -22282,7 +22282,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
22282
22282
|
let extensionWs = null;
|
|
22283
22283
|
const cdpClients = /* @__PURE__ */ new Set();
|
|
22284
22284
|
const connectedTargets = /* @__PURE__ */ new Map();
|
|
22285
|
-
const extensionConnected = () => extensionWs?.readyState === WebSocket.OPEN;
|
|
22285
|
+
const extensionConnected = () => extensionWs?.readyState === WebSocket$1.OPEN;
|
|
22286
22286
|
const hasConnectedTargets = () => connectedTargets.size > 0;
|
|
22287
22287
|
let extensionDisconnectCleanupTimer = null;
|
|
22288
22288
|
const extensionReconnectWaiters = /* @__PURE__ */ new Set();
|
|
@@ -22334,7 +22334,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
22334
22334
|
let nextExtensionId = 1;
|
|
22335
22335
|
const sendToExtension = async (payload) => {
|
|
22336
22336
|
const ws = extensionWs;
|
|
22337
|
-
if (!ws || ws.readyState !== WebSocket.OPEN) throw new Error("Chrome extension not connected");
|
|
22337
|
+
if (!ws || ws.readyState !== WebSocket$1.OPEN) throw new Error("Chrome extension not connected");
|
|
22338
22338
|
ws.send(JSON.stringify(payload));
|
|
22339
22339
|
return await new Promise((resolve, reject) => {
|
|
22340
22340
|
const timer = setTimeout(() => {
|
|
@@ -22351,12 +22351,12 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
22351
22351
|
const broadcastToCdpClients = (evt) => {
|
|
22352
22352
|
const msg = JSON.stringify(evt);
|
|
22353
22353
|
for (const ws of cdpClients) {
|
|
22354
|
-
if (ws.readyState !== WebSocket.OPEN) continue;
|
|
22354
|
+
if (ws.readyState !== WebSocket$1.OPEN) continue;
|
|
22355
22355
|
ws.send(msg);
|
|
22356
22356
|
}
|
|
22357
22357
|
};
|
|
22358
22358
|
const sendResponseToCdp = (ws, res) => {
|
|
22359
|
-
if (ws.readyState !== WebSocket.OPEN) return;
|
|
22359
|
+
if (ws.readyState !== WebSocket$1.OPEN) return;
|
|
22360
22360
|
ws.send(JSON.stringify(res));
|
|
22361
22361
|
};
|
|
22362
22362
|
const dropConnectedTargetSession = (sessionId) => {
|
|
@@ -22610,7 +22610,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
22610
22610
|
rejectUpgrade(socket, 401, "Unauthorized");
|
|
22611
22611
|
return;
|
|
22612
22612
|
}
|
|
22613
|
-
if (extensionWs && extensionWs.readyState !== WebSocket.OPEN) {
|
|
22613
|
+
if (extensionWs && extensionWs.readyState !== WebSocket$1.OPEN) {
|
|
22614
22614
|
try {
|
|
22615
22615
|
extensionWs.terminate();
|
|
22616
22616
|
} catch {}
|
|
@@ -22643,7 +22643,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
22643
22643
|
clearExtensionDisconnectCleanupTimer();
|
|
22644
22644
|
flushExtensionReconnectWaiters(true);
|
|
22645
22645
|
const ping = setInterval(() => {
|
|
22646
|
-
if (ws.readyState !== WebSocket.OPEN) return;
|
|
22646
|
+
if (ws.readyState !== WebSocket$1.OPEN) return;
|
|
22647
22647
|
ws.send(JSON.stringify({ method: "ping" }));
|
|
22648
22648
|
}, 5e3);
|
|
22649
22649
|
ws.on("message", (data) => {
|
|
@@ -22996,7 +22996,7 @@ function createProfileAvailability({ opts, profile, state, getProfileState, setP
|
|
|
22996
22996
|
};
|
|
22997
22997
|
const closePlaywrightBrowserConnectionForProfile = async (cdpUrl) => {
|
|
22998
22998
|
try {
|
|
22999
|
-
await (await import("./pw-ai-
|
|
22999
|
+
await (await import("./pw-ai-CRL5SGWK.js")).closePlaywrightBrowserConnection(cdpUrl ? { cdpUrl } : void 0);
|
|
23000
23000
|
} catch {}
|
|
23001
23001
|
};
|
|
23002
23002
|
const reconcileProfileRuntime = async () => {
|
|
@@ -23123,7 +23123,7 @@ async function movePathToTrash(targetPath) {
|
|
|
23123
23123
|
//#region src/browser/server-context.reset.ts
|
|
23124
23124
|
async function closePlaywrightBrowserConnectionForProfile(cdpUrl) {
|
|
23125
23125
|
try {
|
|
23126
|
-
await (await import("./pw-ai-
|
|
23126
|
+
await (await import("./pw-ai-CRL5SGWK.js")).closePlaywrightBrowserConnection(cdpUrl ? { cdpUrl } : void 0);
|
|
23127
23127
|
} catch {}
|
|
23128
23128
|
}
|
|
23129
23129
|
function createProfileResetOps({ profile, getProfileState, stopRunningBrowser, isHttpReachable, resolveOpenClawUserDataDir }) {
|
|
@@ -24087,7 +24087,7 @@ function openCdpWebSocket(wsUrl, opts) {
|
|
|
24087
24087
|
const headers = getHeadersWithAuth(wsUrl, opts?.headers ?? {});
|
|
24088
24088
|
const handshakeTimeoutMs = typeof opts?.handshakeTimeoutMs === "number" && Number.isFinite(opts.handshakeTimeoutMs) ? Math.max(1, Math.floor(opts.handshakeTimeoutMs)) : CDP_WS_HANDSHAKE_TIMEOUT_MS;
|
|
24089
24089
|
const agent = getDirectAgentForCdp(wsUrl);
|
|
24090
|
-
return new WebSocket(wsUrl, {
|
|
24090
|
+
return new WebSocket$1(wsUrl, {
|
|
24091
24091
|
handshakeTimeout: handshakeTimeoutMs,
|
|
24092
24092
|
...Object.keys(headers).length ? { headers } : {},
|
|
24093
24093
|
...agent ? { agent } : {}
|
|
@@ -40076,7 +40076,7 @@ async function ensureOpenClawModelsJson(config, agentDirOverride) {
|
|
|
40076
40076
|
const log$31 = createSubsystemLogger("model-catalog");
|
|
40077
40077
|
let modelCatalogPromise = null;
|
|
40078
40078
|
let hasLoggedModelCatalogError = false;
|
|
40079
|
-
const defaultImportPiSdk = () => import("./pi-model-discovery-runtime-
|
|
40079
|
+
const defaultImportPiSdk = () => import("./pi-model-discovery-runtime-CK36RhYz.js");
|
|
40080
40080
|
let importPiSdk = defaultImportPiSdk;
|
|
40081
40081
|
const CODEX_PROVIDER = "openai-codex";
|
|
40082
40082
|
const OPENAI_PROVIDER = "openai";
|
|
@@ -43248,7 +43248,7 @@ function resolveProviderVisionModelFromConfig(params) {
|
|
|
43248
43248
|
//#region src/media-understanding/providers/image.ts
|
|
43249
43249
|
let piModelDiscoveryRuntimePromise = null;
|
|
43250
43250
|
function loadPiModelDiscoveryRuntime() {
|
|
43251
|
-
piModelDiscoveryRuntimePromise ??= import("./pi-model-discovery-runtime-
|
|
43251
|
+
piModelDiscoveryRuntimePromise ??= import("./pi-model-discovery-runtime-CK36RhYz.js");
|
|
43252
43252
|
return piModelDiscoveryRuntimePromise;
|
|
43253
43253
|
}
|
|
43254
43254
|
async function describeImageWithModel(params) {
|
|
@@ -58788,7 +58788,7 @@ var LegacyContextEngine = class {
|
|
|
58788
58788
|
}
|
|
58789
58789
|
async afterTurn(_params) {}
|
|
58790
58790
|
async compact(params) {
|
|
58791
|
-
const { compactEmbeddedPiSessionDirect } = await import("./compact.runtime-
|
|
58791
|
+
const { compactEmbeddedPiSessionDirect } = await import("./compact.runtime-BOg89Gro.js");
|
|
58792
58792
|
const runtimeContext = params.runtimeContext ?? {};
|
|
58793
58793
|
const currentTokenCount = params.currentTokenCount ?? (typeof runtimeContext.currentTokenCount === "number" && Number.isFinite(runtimeContext.currentTokenCount) && runtimeContext.currentTokenCount > 0 ? Math.floor(runtimeContext.currentTokenCount) : void 0);
|
|
58794
58794
|
const result = await compactEmbeddedPiSessionDirect({
|
|
@@ -63227,7 +63227,7 @@ const log$24 = createSubsystemLogger("memory");
|
|
|
63227
63227
|
const QMD_MANAGER_CACHE = /* @__PURE__ */ new Map();
|
|
63228
63228
|
let managerRuntimePromise = null;
|
|
63229
63229
|
function loadManagerRuntime() {
|
|
63230
|
-
managerRuntimePromise ??= import("./manager-runtime-
|
|
63230
|
+
managerRuntimePromise ??= import("./manager-runtime-CfBjUnwB.js");
|
|
63231
63231
|
return managerRuntimePromise;
|
|
63232
63232
|
}
|
|
63233
63233
|
async function getMemorySearchManager(params) {
|
|
@@ -69593,7 +69593,7 @@ var GatewayClient = class {
|
|
|
69593
69593
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
69594
69594
|
});
|
|
69595
69595
|
}
|
|
69596
|
-
this.ws = new WebSocket
|
|
69596
|
+
this.ws = new WebSocket(url, wsOptions);
|
|
69597
69597
|
this.ws.on("open", () => {
|
|
69598
69598
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
69599
69599
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -69869,7 +69869,7 @@ var GatewayClient = class {
|
|
|
69869
69869
|
const connectChallengeTimeoutMs = typeof rawConnectDelayMs === "number" && Number.isFinite(rawConnectDelayMs) ? Math.max(250, Math.min(1e4, rawConnectDelayMs)) : 2e3;
|
|
69870
69870
|
if (this.connectTimer) clearTimeout(this.connectTimer);
|
|
69871
69871
|
this.connectTimer = setTimeout(() => {
|
|
69872
|
-
if (this.connectSent || this.ws?.readyState !== WebSocket
|
|
69872
|
+
if (this.connectSent || this.ws?.readyState !== WebSocket.OPEN) return;
|
|
69873
69873
|
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway connect challenge timeout"));
|
|
69874
69874
|
this.ws?.close(1008, "connect challenge timeout");
|
|
69875
69875
|
}, connectChallengeTimeoutMs);
|
|
@@ -69914,7 +69914,7 @@ var GatewayClient = class {
|
|
|
69914
69914
|
return null;
|
|
69915
69915
|
}
|
|
69916
69916
|
async request(method, params, opts) {
|
|
69917
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
69917
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
69918
69918
|
const id = randomUUID();
|
|
69919
69919
|
const frame = {
|
|
69920
69920
|
type: "req",
|
|
@@ -89192,7 +89192,7 @@ function normalizeReplyPayload(payload, opts = {}) {
|
|
|
89192
89192
|
*/
|
|
89193
89193
|
let deliverRuntimePromise$2 = null;
|
|
89194
89194
|
function loadDeliverRuntime$2() {
|
|
89195
|
-
deliverRuntimePromise$2 ??= import("./deliver-runtime-
|
|
89195
|
+
deliverRuntimePromise$2 ??= import("./deliver-runtime-CUrIlSzN.js");
|
|
89196
89196
|
return deliverRuntimePromise$2;
|
|
89197
89197
|
}
|
|
89198
89198
|
/**
|
|
@@ -89742,7 +89742,7 @@ function ensureContextWindowCacheLoaded() {
|
|
|
89742
89742
|
await ensureOpenClawModelsJson(cfg);
|
|
89743
89743
|
} catch {}
|
|
89744
89744
|
try {
|
|
89745
|
-
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-runtime-
|
|
89745
|
+
const { discoverAuthStorage, discoverModels } = await import("./pi-model-discovery-runtime-CK36RhYz.js");
|
|
89746
89746
|
const agentDir = resolveOpenClawAgentDir();
|
|
89747
89747
|
const modelRegistry = discoverModels(discoverAuthStorage(agentDir), agentDir);
|
|
89748
89748
|
applyDiscoveredContextWindows({
|
|
@@ -94742,7 +94742,7 @@ const MAX_TIMER_SAFE_TIMEOUT_MS = 2147e6;
|
|
|
94742
94742
|
const GATEWAY_TIMEOUT_PATTERN = /gateway timeout/i;
|
|
94743
94743
|
let subagentRegistryRuntimePromise = null;
|
|
94744
94744
|
function loadSubagentRegistryRuntime() {
|
|
94745
|
-
subagentRegistryRuntimePromise ??= import("./subagent-registry-runtime-
|
|
94745
|
+
subagentRegistryRuntimePromise ??= import("./subagent-registry-runtime-DkamrsVw.js");
|
|
94746
94746
|
return subagentRegistryRuntimePromise;
|
|
94747
94747
|
}
|
|
94748
94748
|
const DIRECT_ANNOUNCE_TRANSIENT_RETRY_DELAYS_MS = FAST_TEST_MODE ? [
|
|
@@ -100767,7 +100767,7 @@ const LOOP_WARNING_BUCKET_SIZE = 10;
|
|
|
100767
100767
|
const MAX_LOOP_WARNING_KEYS = 256;
|
|
100768
100768
|
let beforeToolCallRuntimePromise = null;
|
|
100769
100769
|
function loadBeforeToolCallRuntime() {
|
|
100770
|
-
beforeToolCallRuntimePromise ??= import("./pi-tools.before-tool-call.runtime-
|
|
100770
|
+
beforeToolCallRuntimePromise ??= import("./pi-tools.before-tool-call.runtime-CLRTNt4A.js");
|
|
100771
100771
|
return beforeToolCallRuntimePromise;
|
|
100772
100772
|
}
|
|
100773
100773
|
function buildAdjustedParamsKey(params) {
|
|
@@ -108720,7 +108720,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
108720
108720
|
* Throws if the connection is not open.
|
|
108721
108721
|
*/
|
|
108722
108722
|
send(event) {
|
|
108723
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error(`OpenAIWebSocketManager: cannot send — connection is not open (readyState=${this.ws?.readyState ?? "no socket"})`);
|
|
108723
|
+
if (!this.ws || this.ws.readyState !== WebSocket$1.OPEN) throw new Error(`OpenAIWebSocketManager: cannot send — connection is not open (readyState=${this.ws?.readyState ?? "no socket"})`);
|
|
108724
108724
|
this.ws.send(JSON.stringify(event));
|
|
108725
108725
|
}
|
|
108726
108726
|
/**
|
|
@@ -108737,7 +108737,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
108737
108737
|
* Returns true if the WebSocket is currently open and ready to send.
|
|
108738
108738
|
*/
|
|
108739
108739
|
isConnected() {
|
|
108740
|
-
return this.ws !== null && this.ws.readyState === WebSocket.OPEN;
|
|
108740
|
+
return this.ws !== null && this.ws.readyState === WebSocket$1.OPEN;
|
|
108741
108741
|
}
|
|
108742
108742
|
/**
|
|
108743
108743
|
* Permanently closes the WebSocket connection and disables auto-reconnect.
|
|
@@ -108747,7 +108747,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
108747
108747
|
this._cancelRetryTimer();
|
|
108748
108748
|
if (this.ws) {
|
|
108749
108749
|
this.ws.removeAllListeners();
|
|
108750
|
-
if (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING) this.ws.close(1e3, "Client closed");
|
|
108750
|
+
if (this.ws.readyState === WebSocket$1.OPEN || this.ws.readyState === WebSocket$1.CONNECTING) this.ws.close(1e3, "Client closed");
|
|
108751
108751
|
this.ws = null;
|
|
108752
108752
|
}
|
|
108753
108753
|
}
|
|
@@ -108757,7 +108757,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
108757
108757
|
reject(/* @__PURE__ */ new Error("OpenAIWebSocketManager: apiKey is required before connecting."));
|
|
108758
108758
|
return;
|
|
108759
108759
|
}
|
|
108760
|
-
const socket = new WebSocket(this.wsUrl, { headers: {
|
|
108760
|
+
const socket = new WebSocket$1(this.wsUrl, { headers: {
|
|
108761
108761
|
Authorization: `Bearer ${this.apiKey}`,
|
|
108762
108762
|
"OpenAI-Beta": "responses-websocket=v1"
|
|
108763
108763
|
} });
|
|
@@ -117006,7 +117006,7 @@ async function runWithConcurrency(tasks, limit) {
|
|
|
117006
117006
|
//#region src/media-understanding/echo-transcript.ts
|
|
117007
117007
|
let deliverRuntimePromise$1 = null;
|
|
117008
117008
|
function loadDeliverRuntime$1() {
|
|
117009
|
-
deliverRuntimePromise$1 ??= import("./deliver-runtime-
|
|
117009
|
+
deliverRuntimePromise$1 ??= import("./deliver-runtime-CUrIlSzN.js");
|
|
117010
117010
|
return deliverRuntimePromise$1;
|
|
117011
117011
|
}
|
|
117012
117012
|
function formatEchoTranscript(transcript, format) {
|
|
@@ -126839,7 +126839,7 @@ async function createModelSelectionState(params) {
|
|
|
126839
126839
|
}
|
|
126840
126840
|
}
|
|
126841
126841
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
126842
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles.runtime-
|
|
126842
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles.runtime-CuInvQ6F.js");
|
|
126843
126843
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
126844
126844
|
const providerKey = normalizeProviderId(provider);
|
|
126845
126845
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -133199,7 +133199,7 @@ const warnedContexts = /* @__PURE__ */ new Map();
|
|
|
133199
133199
|
const log$5 = createSubsystemLogger("session-maintenance-warning");
|
|
133200
133200
|
let deliverRuntimePromise = null;
|
|
133201
133201
|
function loadDeliverRuntime() {
|
|
133202
|
-
deliverRuntimePromise ??= import("./deliver-runtime-
|
|
133202
|
+
deliverRuntimePromise ??= import("./deliver-runtime-CUrIlSzN.js");
|
|
133203
133203
|
return deliverRuntimePromise;
|
|
133204
133204
|
}
|
|
133205
133205
|
function shouldSendWarning() {
|
|
@@ -138363,7 +138363,7 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
|
|
|
138363
138363
|
hasTypedText
|
|
138364
138364
|
};
|
|
138365
138365
|
try {
|
|
138366
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
138366
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-BQoP-O-0.js");
|
|
138367
138367
|
if (params.abortSignal?.aborted) return {
|
|
138368
138368
|
hasAudioAttachment,
|
|
138369
138369
|
hasTypedText
|
|
@@ -143706,7 +143706,7 @@ function createGatewayPlugin(params) {
|
|
|
143706
143706
|
}
|
|
143707
143707
|
createWebSocket(url) {
|
|
143708
143708
|
if (!params.wsAgent) return super.createWebSocket(url);
|
|
143709
|
-
return new WebSocket(url, { agent: params.wsAgent });
|
|
143709
|
+
return new WebSocket$1(url, { agent: params.wsAgent });
|
|
143710
143710
|
}
|
|
143711
143711
|
}
|
|
143712
143712
|
return new SafeGatewayPlugin();
|
|
@@ -144699,7 +144699,7 @@ function resolveDiscordRestFetch(proxyUrl, runtime) {
|
|
|
144699
144699
|
//#region extensions/discord/src/monitor/provider.ts
|
|
144700
144700
|
let discordVoiceRuntimePromise;
|
|
144701
144701
|
async function loadDiscordVoiceRuntime() {
|
|
144702
|
-
discordVoiceRuntimePromise ??= import("./manager.runtime-
|
|
144702
|
+
discordVoiceRuntimePromise ??= import("./manager.runtime-DF-LRAbL.js");
|
|
144703
144703
|
return await discordVoiceRuntimePromise;
|
|
144704
144704
|
}
|
|
144705
144705
|
function formatThreadBindingDurationForConfigLabel(durationMs) {
|
|
@@ -152679,15 +152679,15 @@ let slashCommandsRuntimePromise = null;
|
|
|
152679
152679
|
let slashDispatchRuntimePromise = null;
|
|
152680
152680
|
let slashSkillCommandsRuntimePromise = null;
|
|
152681
152681
|
function loadSlashCommandsRuntime() {
|
|
152682
|
-
slashCommandsRuntimePromise ??= import("./slash-commands.runtime-
|
|
152682
|
+
slashCommandsRuntimePromise ??= import("./slash-commands.runtime-BTNXGYOP.js");
|
|
152683
152683
|
return slashCommandsRuntimePromise;
|
|
152684
152684
|
}
|
|
152685
152685
|
function loadSlashDispatchRuntime() {
|
|
152686
|
-
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-
|
|
152686
|
+
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-cYx62DOd.js");
|
|
152687
152687
|
return slashDispatchRuntimePromise;
|
|
152688
152688
|
}
|
|
152689
152689
|
function loadSlashSkillCommandsRuntime() {
|
|
152690
|
-
slashSkillCommandsRuntimePromise ??= import("./slash-skill-commands.runtime-
|
|
152690
|
+
slashSkillCommandsRuntimePromise ??= import("./slash-skill-commands.runtime-ThOxhaze.js");
|
|
152691
152691
|
return slashSkillCommandsRuntimePromise;
|
|
152692
152692
|
}
|
|
152693
152693
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
@@ -156307,7 +156307,7 @@ function getCacheStats() {
|
|
|
156307
156307
|
const STICKER_DESCRIPTION_PROMPT = "Describe this sticker image in 1-2 sentences. Focus on what the sticker depicts (character, object, action, emotion). Be concise and objective.";
|
|
156308
156308
|
let imageRuntimePromise = null;
|
|
156309
156309
|
function loadImageRuntime() {
|
|
156310
|
-
imageRuntimePromise ??= import("./image-runtime-
|
|
156310
|
+
imageRuntimePromise ??= import("./image-runtime-Dur8cmII.js");
|
|
156311
156311
|
return imageRuntimePromise;
|
|
156312
156312
|
}
|
|
156313
156313
|
/**
|
|
@@ -158039,7 +158039,7 @@ async function resolveTelegramInboundBody(params) {
|
|
|
158039
158039
|
const disableAudioPreflight = (topicConfig?.disableAudioPreflight ?? groupConfig?.disableAudioPreflight) === true;
|
|
158040
158040
|
let preflightTranscript;
|
|
158041
158041
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0 && !disableAudioPreflight) try {
|
|
158042
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
158042
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-BQoP-O-0.js");
|
|
158043
158043
|
preflightTranscript = await transcribeFirstAudio({
|
|
158044
158044
|
ctx: {
|
|
158045
158045
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -166161,7 +166161,7 @@ function createWhatsAppLoginTool() {
|
|
|
166161
166161
|
force: Type.Optional(Type.Boolean())
|
|
166162
166162
|
}),
|
|
166163
166163
|
execute: async (_toolCallId, args) => {
|
|
166164
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
166164
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-D-_3HfJq.js");
|
|
166165
166165
|
if ((args?.action ?? "start") === "wait") {
|
|
166166
166166
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
166167
166167
|
return {
|
|
@@ -166235,23 +166235,23 @@ let webOutboundPromise = null;
|
|
|
166235
166235
|
let webLoginPromise = null;
|
|
166236
166236
|
let whatsappActionsPromise = null;
|
|
166237
166237
|
function loadWebOutbound() {
|
|
166238
|
-
webOutboundPromise ??= import("./runtime-whatsapp-outbound.runtime-
|
|
166238
|
+
webOutboundPromise ??= import("./runtime-whatsapp-outbound.runtime-IeVUgrJu.js");
|
|
166239
166239
|
return webOutboundPromise;
|
|
166240
166240
|
}
|
|
166241
166241
|
function loadWebLogin() {
|
|
166242
|
-
webLoginPromise ??= import("./runtime-whatsapp-login.runtime-
|
|
166242
|
+
webLoginPromise ??= import("./runtime-whatsapp-login.runtime-CO-iUlqS.js");
|
|
166243
166243
|
return webLoginPromise;
|
|
166244
166244
|
}
|
|
166245
166245
|
function loadWebLoginQr() {
|
|
166246
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
166246
|
+
webLoginQrPromise ??= import("./login-qr-D-_3HfJq.js");
|
|
166247
166247
|
return webLoginQrPromise;
|
|
166248
166248
|
}
|
|
166249
166249
|
function loadWebChannel() {
|
|
166250
|
-
webChannelPromise ??= import("./web-
|
|
166250
|
+
webChannelPromise ??= import("./web-bHB4SzXZ.js");
|
|
166251
166251
|
return webChannelPromise;
|
|
166252
166252
|
}
|
|
166253
166253
|
function loadWhatsAppActions() {
|
|
166254
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
166254
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-BqFiZbuw.js");
|
|
166255
166255
|
return whatsappActionsPromise;
|
|
166256
166256
|
}
|
|
166257
166257
|
function createRuntimeWhatsApp() {
|
package/dist/{pi-model-discovery-runtime-DgHKNg0i.js → pi-model-discovery-runtime-CK36RhYz.js}
RENAMED
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Bn as discoverModels, Ln as PiAuthStorageClass, Rn as PiModelRegistryClass, zn as discoverAuthStorage } from "./model-selection-
|
|
6
|
+
import { Bn as discoverModels, Ln as PiAuthStorageClass, Rn as PiModelRegistryClass, zn as discoverAuthStorage } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { t as createSubsystemLogger } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import { D as isPlainObject } from "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Jt as logToolLoopAction, Yt as getDiagnosticSessionState } from "./model-selection-
|
|
6
|
+
import { Jt as logToolLoopAction, Yt as getDiagnosticSessionState } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { E as resolvePreferredOpenClawTmpDir } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { $r as withCdpSocket, Ci as formatCliCommand, Gr as getRoleSnapshotStats, Jr as normalizeCdpWsUrl, Kr as parseRoleRef, Qr as normalizeCdpHttpBaseForJsonEndpoints, Ur as buildRoleSnapshotFromAiSnapshot, Wr as buildRoleSnapshotFromAriaSnapshot, Xr as fetchJson, Yr as appendCdpPath, Zr as getHeadersWithAuth, ai as DEFAULT_TRACE_DIR, ci as formatErrorMessage, di as BrowserTabNotFoundError, fi as assertBrowserNavigationAllowed, hi as withBrowserNavigationPolicy, li as matchBrowserUrlPattern, mi as assertBrowserNavigationResultAllowed, ni as markPwAiLoaded, oi as DEFAULT_UPLOAD_DIR, pi as assertBrowserNavigationRedirectChainAllowed, qr as formatAriaSnapshot, ri as withNoProxyForCdpUrl, si as resolveStrictExistingPathsWithinRoot, ti as getChromeWebSocketUrl } from "./model-selection-
|
|
6
|
+
import { $r as withCdpSocket, Ci as formatCliCommand, Gr as getRoleSnapshotStats, Jr as normalizeCdpWsUrl, Kr as parseRoleRef, Qr as normalizeCdpHttpBaseForJsonEndpoints, Ur as buildRoleSnapshotFromAiSnapshot, Wr as buildRoleSnapshotFromAriaSnapshot, Xr as fetchJson, Yr as appendCdpPath, Zr as getHeadersWithAuth, ai as DEFAULT_TRACE_DIR, ci as formatErrorMessage, di as BrowserTabNotFoundError, fi as assertBrowserNavigationAllowed, hi as withBrowserNavigationPolicy, li as matchBrowserUrlPattern, mi as assertBrowserNavigationResultAllowed, ni as markPwAiLoaded, oi as DEFAULT_UPLOAD_DIR, pi as assertBrowserNavigationRedirectChainAllowed, qr as formatAriaSnapshot, ri as withNoProxyForCdpUrl, si as resolveStrictExistingPathsWithinRoot, ti as getChromeWebSocketUrl } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,11 +3,11 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import "./model-selection-
|
|
6
|
+
import "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
10
10
|
import "./frontmatter-DhmdUnBP.js";
|
|
11
|
-
import "./session-
|
|
12
|
-
import { t as loginWeb } from "./login-
|
|
11
|
+
import "./session-BhX4LYCK.js";
|
|
12
|
+
import { t as loginWeb } from "./login-CvFRLU0k.js";
|
|
13
13
|
export { loginWeb };
|
|
@@ -3,10 +3,10 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import "./model-selection-
|
|
6
|
+
import "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
10
10
|
import "./frontmatter-DhmdUnBP.js";
|
|
11
|
-
import { n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
11
|
+
import { n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-CsgNtXyY.js";
|
|
12
12
|
export { sendMessageWhatsApp, sendPollWhatsApp };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as getChildLogger, t as createSubsystemLogger } from "./subsystem-CDcEQtQK.js";
|
|
2
2
|
import { T as toWhatsappJid, u as escapeRegExp } from "./logger-C0l_Gj8Y.js";
|
|
3
|
-
import { Cn as resolveMarkdownTableMode, Mn as loadWebMedia, Nn as normalizePollInput, _i as redactIdentifier, br as resolveWhatsAppMediaMaxBytes, ei as generateSecureUuid, f as requireActiveWebListener, vi as loadConfig, xn as convertMarkdownTables, yr as resolveWhatsAppAccount } from "./model-selection-
|
|
3
|
+
import { Cn as resolveMarkdownTableMode, Mn as loadWebMedia, Nn as normalizePollInput, _i as redactIdentifier, br as resolveWhatsAppMediaMaxBytes, ei as generateSecureUuid, f as requireActiveWebListener, vi as loadConfig, xn as convertMarkdownTables, yr as resolveWhatsAppAccount } from "./model-selection-C9tlIhgN.js";
|
|
4
4
|
//#region src/markdown/whatsapp.ts
|
|
5
5
|
/**
|
|
6
6
|
* Convert standard Markdown formatting to WhatsApp-compatible markup.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as toPinoLikeLogger, b as getChildLogger, h as success, l as danger } from "./subsystem-CDcEQtQK.js";
|
|
2
2
|
import { l as ensureDir, y as resolveUserPath } from "./logger-C0l_Gj8Y.js";
|
|
3
|
-
import { Ar as resolveWebCredsBackupPath, Ci as formatCliCommand, Dr as readCredsJsonRaw, Tr as maybeRestoreCredsFromBackup, jr as resolveWebCredsPath, kr as resolveDefaultWebAuthDir, xi as VERSION } from "./model-selection-
|
|
3
|
+
import { Ar as resolveWebCredsBackupPath, Ci as formatCliCommand, Dr as readCredsJsonRaw, Tr as maybeRestoreCredsFromBackup, jr as resolveWebCredsPath, kr as resolveDefaultWebAuthDir, xi as VERSION } from "./model-selection-C9tlIhgN.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import "node:crypto";
|
|
6
6
|
import { DisconnectReason, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { an as listNativeCommandSpecsForConfig, in as findCommandByNativeName, on as parseCommandArgs, rn as buildCommandTextFromArgs, sn as resolveCommandArgMenu } from "./model-selection-
|
|
6
|
+
import { an as listNativeCommandSpecsForConfig, in as findCommandByNativeName, on as parseCommandArgs, rn as buildCommandTextFromArgs, sn as resolveCommandArgMenu } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { An as resolveChunkMode, B as finalizeInboundContext, Cn as resolveMarkdownTableMode, E as createReplyPrefixOptions, Fr as resolveConversationLabel, S as dispatchReplyWithDispatcher, _ as deliverSlackSlashReplies, h as recordInboundSessionMetaSafe, hn as resolveAgentRoute } from "./model-selection-
|
|
6
|
+
import { An as resolveChunkMode, B as finalizeInboundContext, Cn as resolveMarkdownTableMode, E as createReplyPrefixOptions, Fr as resolveConversationLabel, S as dispatchReplyWithDispatcher, _ as deliverSlackSlashReplies, h as recordInboundSessionMetaSafe, hn as resolveAgentRoute } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
package/dist/{slash-skill-commands.runtime-BC9oRGpm.js → slash-skill-commands.runtime-ThOxhaze.js}
RENAMED
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { I as listSkillCommandsForAgents } from "./model-selection-
|
|
6
|
+
import { I as listSkillCommandsForAgents } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
package/dist/{subagent-registry-runtime-DQeHzv-u.js → subagent-registry-runtime-DkamrsVw.js}
RENAMED
|
@@ -3,7 +3,7 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { $ as countPendingDescendantRuns, Q as countActiveDescendantRuns, at as shouldIgnorePostCompletionAnnounceForSession, et as countPendingDescendantRunsExcludingRun, it as resolveRequesterForChildSession, nt as listSubagentRunsForRequester, rt as replaceSubagentRunAfterSteer, tt as isSubagentSessionRunActive } from "./model-selection-
|
|
6
|
+
import { $ as countPendingDescendantRuns, Q as countActiveDescendantRuns, at as shouldIgnorePostCompletionAnnounceForSession, et as countPendingDescendantRunsExcludingRun, it as resolveRequesterForChildSession, nt as listSubagentRunsForRequester, rt as replaceSubagentRunAfterSteer, tt as isSubagentSessionRunActive } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
@@ -3,14 +3,14 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import { a as defaultRuntime, b as getChildLogger, d as logVerbose, m as shouldLogVerbose, t as createSubsystemLogger } from "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import { F as DEFAULT_MAIN_KEY, I as buildAgentMainSessionKey, R as buildGroupHistoryKey, V as normalizeAgentId } from "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import { C as sleep, T as toWhatsappJid, h as normalizeE164, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164 } from "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { A as formatInboundEnvelope, An as resolveChunkMode, At as toLocationContext, B as finalizeInboundContext, C as issuePairingChallenge, Ci as formatCliCommand, Cn as resolveMarkdownTableMode, Cr as logWebSelfId, Ct as createDedupeCache, D as shouldAckReactionForWhatsApp, Dn as resolveOpenProviderRuntimeGroupPolicy, Dt as normalizeGroupActivation, E as createReplyPrefixOptions, En as resolveDefaultGroupPolicy, Er as pickWebChannel, Et as resolveMessagePrefix, G as shouldComputeCommandAuthorized, H as createInboundDebouncer, Ir as resolveGroupSessionKey, Jn as registerUnhandledRejectionHandler, K as buildMentionRegexes, Mn as loadWebMedia, Mr as webAuthExists, Nr as resolveChannelGroupPolicy, O as buildHistoryContextFromEntries, On as warnMissingProviderGroupPolicyFallbackOnce, Or as readWebSelfId, Ot as parseActivationCommand, Pr as resolveChannelGroupRequireMention, Sn as recordChannelActivity, Sr as getWebAuthAgeMs, St as sleepWithAbort, Tt as resolveIdentityNamePrefix, U as resolveInboundDebounceMs, W as hasControlCommand, Xn as getAgentScopedMediaLocalRoots, _n as enqueueSystemEvent, b as createConnectedChannelStatusPatch, br as resolveWhatsAppMediaMaxBytes, cn as readStoreAllowFromForDmPolicy, dn as resolvePinnedMainDmOwnerFromAllowlist, er as loadSessionStore, fn as upsertChannelPairingRequest, gn as resolveInboundLastRouteSessionKey, hn as resolveAgentRoute, ii as saveMediaBuffer, j as getReplyFromConfig, jn as resolveTextChunkLimit, k as recordPendingHistoryEntryIfEnabled, kn as chunkMarkdownTextWithMode, kt as formatLocationText, ln as resolveDmGroupAccessWithCommandGate, m as resolveInboundSessionEnvelopeContext, mn as deriveLastRoutePolicy, nr as updateLastRoute, p as setActiveWebListener, pn as buildAgentSessionKey, q as normalizeMentionText, tr as recordSessionMetaFromInbound, un as resolveDmGroupAccessWithLists, vi as loadConfig, vn as formatDurationPrecise, w as resolveMentionGating, x as dispatchReplyWithBufferedBlockDispatcher, xn as convertMarkdownTables, xr as WA_WEB_AUTH_DIR, xt as computeBackoff, yr as resolveWhatsAppAccount } from "./model-selection-
|
|
6
|
+
import { A as formatInboundEnvelope, An as resolveChunkMode, At as toLocationContext, B as finalizeInboundContext, C as issuePairingChallenge, Ci as formatCliCommand, Cn as resolveMarkdownTableMode, Cr as logWebSelfId, Ct as createDedupeCache, D as shouldAckReactionForWhatsApp, Dn as resolveOpenProviderRuntimeGroupPolicy, Dt as normalizeGroupActivation, E as createReplyPrefixOptions, En as resolveDefaultGroupPolicy, Er as pickWebChannel, Et as resolveMessagePrefix, G as shouldComputeCommandAuthorized, H as createInboundDebouncer, Ir as resolveGroupSessionKey, Jn as registerUnhandledRejectionHandler, K as buildMentionRegexes, Mn as loadWebMedia, Mr as webAuthExists, Nr as resolveChannelGroupPolicy, O as buildHistoryContextFromEntries, On as warnMissingProviderGroupPolicyFallbackOnce, Or as readWebSelfId, Ot as parseActivationCommand, Pr as resolveChannelGroupRequireMention, Sn as recordChannelActivity, Sr as getWebAuthAgeMs, St as sleepWithAbort, Tt as resolveIdentityNamePrefix, U as resolveInboundDebounceMs, W as hasControlCommand, Xn as getAgentScopedMediaLocalRoots, _n as enqueueSystemEvent, b as createConnectedChannelStatusPatch, br as resolveWhatsAppMediaMaxBytes, cn as readStoreAllowFromForDmPolicy, dn as resolvePinnedMainDmOwnerFromAllowlist, er as loadSessionStore, fn as upsertChannelPairingRequest, gn as resolveInboundLastRouteSessionKey, hn as resolveAgentRoute, ii as saveMediaBuffer, j as getReplyFromConfig, jn as resolveTextChunkLimit, k as recordPendingHistoryEntryIfEnabled, kn as chunkMarkdownTextWithMode, kt as formatLocationText, ln as resolveDmGroupAccessWithCommandGate, m as resolveInboundSessionEnvelopeContext, mn as deriveLastRoutePolicy, nr as updateLastRoute, p as setActiveWebListener, pn as buildAgentSessionKey, q as normalizeMentionText, tr as recordSessionMetaFromInbound, un as resolveDmGroupAccessWithLists, vi as loadConfig, vn as formatDurationPrecise, w as resolveMentionGating, x as dispatchReplyWithBufferedBlockDispatcher, xn as convertMarkdownTables, xr as WA_WEB_AUTH_DIR, xt as computeBackoff, yr as resolveWhatsAppAccount } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
10
10
|
import "./frontmatter-DhmdUnBP.js";
|
|
11
|
-
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-
|
|
12
|
-
import { i as markdownToWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-
|
|
13
|
-
import { t as loginWeb } from "./login-
|
|
11
|
+
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-BhX4LYCK.js";
|
|
12
|
+
import { i as markdownToWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-CsgNtXyY.js";
|
|
13
|
+
import { t as loginWeb } from "./login-CvFRLU0k.js";
|
|
14
14
|
import { randomUUID } from "node:crypto";
|
|
15
15
|
import { DisconnectReason, downloadMediaMessage, extractMessageContent, getContentType, isJidGroup, normalizeMessageContent } from "@whiskeysockets/baileys";
|
|
16
16
|
const DEFAULT_RECONNECT_POLICY = {
|
|
@@ -3,12 +3,12 @@ import "./paths-BwJ6yG6k.js";
|
|
|
3
3
|
import "./subsystem-CDcEQtQK.js";
|
|
4
4
|
import "./workspace-Cg3kGb1y.js";
|
|
5
5
|
import "./logger-C0l_Gj8Y.js";
|
|
6
|
-
import { Gt as readReactionParams, Ht as ToolAuthorizationError, Kt as readStringParam, Ut as createActionGate, Wt as jsonResult, vr as resolveWhatsAppOutboundTarget, yr as resolveWhatsAppAccount } from "./model-selection-
|
|
6
|
+
import { Gt as readReactionParams, Ht as ToolAuthorizationError, Kt as readStringParam, Ut as createActionGate, Wt as jsonResult, vr as resolveWhatsAppOutboundTarget, yr as resolveWhatsAppAccount } from "./model-selection-C9tlIhgN.js";
|
|
7
7
|
import "./github-copilot-token-368sRGBD.js";
|
|
8
8
|
import "./boolean-C7Ct_klp.js";
|
|
9
9
|
import "./fetch-sH_NN8SV.js";
|
|
10
10
|
import "./frontmatter-DhmdUnBP.js";
|
|
11
|
-
import { r as sendReactionWhatsApp } from "./send-
|
|
11
|
+
import { r as sendReactionWhatsApp } from "./send-CsgNtXyY.js";
|
|
12
12
|
//#region src/agents/tools/whatsapp-target-auth.ts
|
|
13
13
|
function resolveAuthorizedWhatsAppOutboundTarget(params) {
|
|
14
14
|
const account = resolveWhatsAppAccount({
|
package/package.json
CHANGED
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
# =================================================================
|
|
3
3
|
# OpenClaw 深度集成初始化工具 (create-instance.sh)
|
|
4
4
|
# 功能:创建实例目录、复制源码、安装依赖、配置模型、启动服务
|
|
5
|
-
#
|
|
6
|
-
# 架构说明:
|
|
7
|
-
# - 源码位置: ~/openclaw-runtime/node_modules/openclaw-multi-auto
|
|
8
|
-
# - 实例位置: ~/openclaws/实例名/
|
|
9
|
-
# - 源码复制: ~/openclaws/实例名/dist (复制源码,不含 node_modules)
|
|
10
|
-
# - 依赖安装: ~/openclaws/实例名/node_modules (pnpm 安装)
|
|
11
|
-
# - 启动方式: ./start.sh (从 dist 目录启动,使用实例根目录的 node_modules)
|
|
12
5
|
# =================================================================
|
|
13
6
|
|
|
14
7
|
set -e
|
|
@@ -29,10 +22,7 @@ for cmd in node pnpm; do
|
|
|
29
22
|
done
|
|
30
23
|
|
|
31
24
|
# --- 1. 源码路径定位 ---
|
|
32
|
-
# 默认源码路径:~/openclaw-runtime/node_modules/openclaw-multi-auto
|
|
33
25
|
SOURCE_CODE="$HOME/openclaw-runtime/node_modules/openclaw-multi-auto"
|
|
34
|
-
|
|
35
|
-
# 允许通过环境变量覆盖
|
|
36
26
|
if [ -n "$OPENCLAW_SOURCE_DIR" ] && [ -d "$OPENCLAW_SOURCE_DIR" ]; then
|
|
37
27
|
SOURCE_CODE="$OPENCLAW_SOURCE_DIR"
|
|
38
28
|
echo -e "${BLUE}📂 使用环境变量指定的源码路径: $SOURCE_CODE${NC}"
|
|
@@ -41,13 +31,11 @@ else
|
|
|
41
31
|
echo -e "${GREEN}✅ 找到本地源码路径: $SOURCE_CODE${NC}"
|
|
42
32
|
else
|
|
43
33
|
echo -e "${RED}❌ 错误: 未找到 OpenClaw 源码目录${NC}"
|
|
44
|
-
echo -e "${YELLOW}源码路径: $SOURCE_CODE${NC}"
|
|
45
|
-
echo -e "${YELLOW}请确认已正确安装 openclaw-multi-auto${NC}"
|
|
46
34
|
exit 1
|
|
47
35
|
fi
|
|
48
36
|
fi
|
|
49
37
|
|
|
50
|
-
#
|
|
38
|
+
# 实例基础目录
|
|
51
39
|
INSTANCES_BASE="$HOME/openclaws"
|
|
52
40
|
|
|
53
41
|
# --- 2. 获取实例名称 ---
|
|
@@ -67,16 +55,16 @@ fi
|
|
|
67
55
|
|
|
68
56
|
# --- 4. 定义实例目录并清理旧残留 ---
|
|
69
57
|
INSTANCE_DIR="$INSTANCES_BASE/${INSTANCE_NAME}"
|
|
58
|
+
DIST_DIR="${INSTANCE_DIR}" # 源码复制到实例根目录(根据您的脚本)
|
|
70
59
|
|
|
71
60
|
echo -e "${BLUE}🏗️ 正在深度初始化实例: ${INSTANCE_NAME} (端口 ${PORT})${NC}"
|
|
72
|
-
echo "SOURCE_CODE = $SOURCE_CODE"
|
|
73
61
|
|
|
74
62
|
if [ -d "$INSTANCE_DIR" ]; then
|
|
75
63
|
echo -e "${YELLOW}⚠️ 清理旧实例目录...${NC}"
|
|
76
64
|
rm -rf "$INSTANCE_DIR"
|
|
77
65
|
fi
|
|
78
66
|
|
|
79
|
-
#
|
|
67
|
+
# 清理可能遗留的 workspace 配置
|
|
80
68
|
[ -d "${INSTANCES_BASE}/node_modules" ] && rm -rf "${INSTANCES_BASE}/node_modules"
|
|
81
69
|
[ -f "${INSTANCES_BASE}/pnpm-workspace.yaml" ] && rm -f "${INSTANCES_BASE}/pnpm-workspace.yaml"
|
|
82
70
|
|
|
@@ -100,16 +88,6 @@ fi
|
|
|
100
88
|
|
|
101
89
|
# --- 7. 核心代码同步 (从源码复制到实例根目录) ---
|
|
102
90
|
echo -e "${BLUE}🔄 正在从源码复制文件到实例根目录...${NC}"
|
|
103
|
-
echo -e "${YELLOW}源码路径: ${SOURCE_CODE}${NC}"
|
|
104
|
-
echo -e "${YELLOW}目标路径: ${INSTANCE_DIR}${NC}"
|
|
105
|
-
|
|
106
|
-
# 清理已存在的实例目录(如果存在)
|
|
107
|
-
if [ -d "$INSTANCE_DIR" ]; then
|
|
108
|
-
echo -e "${YELLOW}⚠️ 清理旧实例目录...${NC}"
|
|
109
|
-
rm -rf "$INSTANCE_DIR"
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
# 复制源码所有内容到实例根目录
|
|
113
91
|
if cp -r "${SOURCE_CODE}/." "${INSTANCE_DIR}/"; then
|
|
114
92
|
echo -e "${GREEN}✅ 源码复制成功${NC}"
|
|
115
93
|
else
|
|
@@ -117,7 +95,7 @@ else
|
|
|
117
95
|
exit 1
|
|
118
96
|
fi
|
|
119
97
|
|
|
120
|
-
#
|
|
98
|
+
# 【关键修复】如果 config 是符号链接,则替换为普通目录
|
|
121
99
|
if [ -L "${INSTANCE_DIR}/config" ]; then
|
|
122
100
|
echo -e "${YELLOW}⚠️ 检测到 config 为符号链接,正在修复为普通目录...${NC}"
|
|
123
101
|
rm -f "${INSTANCE_DIR}/config"
|
|
@@ -130,10 +108,26 @@ if [ ! -f "${INSTANCE_DIR}/package.json" ]; then
|
|
|
130
108
|
exit 1
|
|
131
109
|
fi
|
|
132
110
|
|
|
111
|
+
# --- 修改 package.json 包名为 openclaw (修复插件 SDK 别名问题) ---
|
|
112
|
+
echo -e "${BLUE}🔧 正在修改 package.json 包名以支持插件 SDK...${NC}"
|
|
113
|
+
if command -v jq &> /dev/null; then
|
|
114
|
+
jq '.name = "openclaw"' "${INSTANCE_DIR}/package.json" > "${INSTANCE_DIR}/package.json.tmp"
|
|
115
|
+
mv "${INSTANCE_DIR}/package.json.tmp" "${INSTANCE_DIR}/package.json"
|
|
116
|
+
echo -e "${GREEN}✅ 包名已修改为 openclaw${NC}"
|
|
117
|
+
elif command -v node &> /dev/null; then
|
|
118
|
+
node -e "
|
|
119
|
+
const fs = require('fs');
|
|
120
|
+
const pkg = JSON.parse(fs.readFileSync('${INSTANCE_DIR}/package.json', 'utf-8'));
|
|
121
|
+
pkg.name = 'openclaw';
|
|
122
|
+
fs.writeFileSync('${INSTANCE_DIR}/package.json', JSON.stringify(pkg, null, 2));
|
|
123
|
+
"
|
|
124
|
+
echo -e "${GREEN}✅ 包名已修改为 openclaw${NC}"
|
|
125
|
+
else
|
|
126
|
+
echo -e "${YELLOW}⚠️ 未找到 jq 或 node,无法自动修改包名${NC}"
|
|
127
|
+
fi
|
|
128
|
+
|
|
133
129
|
# --- 依赖安装 ---
|
|
134
|
-
# 注意:npm/pnpm 发布的包不包含 node_modules,需要在实例中安装
|
|
135
130
|
echo -e "${BLUE}📦 正在安装依赖...${NC}"
|
|
136
|
-
|
|
137
131
|
cd "${INSTANCE_DIR}"
|
|
138
132
|
|
|
139
133
|
# 临时清理可能干扰的 workspace 配置
|
|
@@ -142,11 +136,9 @@ if [ -f "${INSTANCES_BASE}/pnpm-workspace.yaml" ]; then
|
|
|
142
136
|
mv "${INSTANCES_BASE}/pnpm-workspace.yaml" "${INSTANCES_BASE}/pnpm-workspace.yaml.bak.$(date +%s)"
|
|
143
137
|
fi
|
|
144
138
|
|
|
145
|
-
# 设置 Sharp 镜像(国内加速)
|
|
146
139
|
export SHARP_BINARY_HOST="https://npmmirror.com/mirrors/sharp"
|
|
147
140
|
export SHARP_LIBVIPS_BINARY_HOST="https://npmmirror.com/mirrors/sharp-libvips"
|
|
148
141
|
|
|
149
|
-
# 安装依赖(使用国内镜像)
|
|
150
142
|
if ! pnpm install --shamefully-hoist --ignore-workspace --registry=https://registry.npmmirror.com --no-frozen-lockfile > .install.log 2>&1; then
|
|
151
143
|
echo -e "${RED}❌ 依赖安装失败,请查看日志: ${INSTANCE_DIR}/.install.log${NC}"
|
|
152
144
|
exit 1
|
|
@@ -158,22 +150,15 @@ if [ ! -d "node_modules" ]; then
|
|
|
158
150
|
fi
|
|
159
151
|
echo -e "${GREEN}✅ 依赖安装成功${NC}"
|
|
160
152
|
|
|
161
|
-
# ---
|
|
153
|
+
# --- 安装扩展 page-action-cache ---
|
|
162
154
|
echo -e "${BLUE}📦 正在安装扩展 page-action-cache...${NC}"
|
|
163
|
-
|
|
164
|
-
# 确保 extensions 目录存在
|
|
165
155
|
mkdir -p "${INSTANCE_DIR}/extensions"
|
|
166
|
-
|
|
167
156
|
cd "${INSTANCE_DIR}/extensions"
|
|
168
|
-
|
|
169
|
-
# 下载 page-action-cache tarball 并解压到临时目录
|
|
170
157
|
TEMP_EXT_DIR=$(mktemp -d)
|
|
171
158
|
cd "$TEMP_EXT_DIR"
|
|
172
159
|
if npm pack page-action-cache --registry=https://registry.npmmirror.com --quiet > /dev/null 2>&1; then
|
|
173
160
|
TARBALL=$(ls *.tgz)
|
|
174
|
-
# 解压到临时目录
|
|
175
161
|
tar -xzf "$TARBALL"
|
|
176
|
-
# 移动到 extensions/page-action-cache
|
|
177
162
|
rm -rf "${INSTANCE_DIR}/extensions/page-action-cache"
|
|
178
163
|
mv package "${INSTANCE_DIR}/extensions/page-action-cache"
|
|
179
164
|
echo -e "${GREEN}✅ page-action-cache 安装成功${NC}"
|
|
@@ -181,8 +166,6 @@ else
|
|
|
181
166
|
echo -e "${YELLOW}⚠️ page-action-cache 下载失败${NC}"
|
|
182
167
|
fi
|
|
183
168
|
rm -rf "$TEMP_EXT_DIR"
|
|
184
|
-
|
|
185
|
-
# 返回实例根目录
|
|
186
169
|
cd "${INSTANCE_DIR}"
|
|
187
170
|
|
|
188
171
|
# --- 8. 参数与交互式获取 ---
|
|
@@ -207,9 +190,15 @@ if [ -z "$API_KEY" ]; then
|
|
|
207
190
|
fi
|
|
208
191
|
|
|
209
192
|
# --- 9. 生成深度配置文件 ---
|
|
210
|
-
|
|
211
|
-
|
|
193
|
+
# 【双重保障】再次确保 config 是普通目录且可写
|
|
194
|
+
if [ -e "${INSTANCE_DIR}/config" ] && [ ! -d "${INSTANCE_DIR}/config" ]; then
|
|
195
|
+
echo -e "${YELLOW}⚠️ 检测到 config 不是目录,正在修复...${NC}"
|
|
196
|
+
rm -f "${INSTANCE_DIR}/config"
|
|
197
|
+
fi
|
|
198
|
+
mkdir -p "${INSTANCE_DIR}/config"
|
|
212
199
|
|
|
200
|
+
# 设置模型变量
|
|
201
|
+
ZAI_KEY=""; DS_KEY=""; MX_KEY=""; KIMI_KEY=""; QWEN_KEY=""
|
|
213
202
|
case "$MODEL_PROVIDER" in
|
|
214
203
|
zai) PRIMARY_MODEL="zai/glm-5"; ZAI_KEY="$API_KEY" ;;
|
|
215
204
|
deepseek) PRIMARY_MODEL="deepseek/deepseek-chat"; DS_KEY="$API_KEY" ;;
|
|
@@ -236,72 +225,32 @@ cat > "${INSTANCE_DIR}/config/openclaw.json" << EOF
|
|
|
236
225
|
"baseUrl": "https://open.bigmodel.cn/api/paas/v4",
|
|
237
226
|
"apiKey": "${ZAI_KEY}",
|
|
238
227
|
"api": "openai-completions",
|
|
239
|
-
"models": [
|
|
240
|
-
{
|
|
241
|
-
"id": "glm-5",
|
|
242
|
-
"name": "GLM-5",
|
|
243
|
-
"input": ["text"],
|
|
244
|
-
"contextWindow": 32768,
|
|
245
|
-
"maxTokens": 4096
|
|
246
|
-
}
|
|
247
|
-
]
|
|
228
|
+
"models": [{"id": "glm-5","name": "GLM-5","input": ["text"],"contextWindow": 32768,"maxTokens": 4096}]
|
|
248
229
|
},
|
|
249
230
|
"deepseek": {
|
|
250
231
|
"baseUrl": "https://api.deepseek.com",
|
|
251
232
|
"apiKey": "${DS_KEY}",
|
|
252
233
|
"api": "openai-completions",
|
|
253
|
-
"models": [
|
|
254
|
-
{
|
|
255
|
-
"id": "deepseek-chat",
|
|
256
|
-
"name": "DeepSeek-Chat",
|
|
257
|
-
"input": ["text"],
|
|
258
|
-
"contextWindow": 32768,
|
|
259
|
-
"maxTokens": 4096
|
|
260
|
-
}
|
|
261
|
-
]
|
|
234
|
+
"models": [{"id": "deepseek-chat","name": "DeepSeek-Chat","input": ["text"],"contextWindow": 32768,"maxTokens": 4096}]
|
|
262
235
|
},
|
|
263
236
|
"minimax-cn": {
|
|
264
237
|
"baseUrl": "https://api.minimax.chat/v1",
|
|
265
238
|
"apiKey": "${MX_KEY}",
|
|
266
239
|
"api": "openai-completions",
|
|
267
|
-
"models": [
|
|
268
|
-
{
|
|
269
|
-
"id": "MiniMax-M2.5-highspeed",
|
|
270
|
-
"name": "MiniMax-M2.5-highspeed",
|
|
271
|
-
"input": ["text"],
|
|
272
|
-
"cost": { "input": 0.000002, "output": 0.000006 },
|
|
273
|
-
"contextWindow": 65536,
|
|
274
|
-
"maxTokens": 8192
|
|
275
|
-
}
|
|
276
|
-
]
|
|
240
|
+
"models": [{"id": "MiniMax-M2.5-highspeed","name": "MiniMax-M2.5-highspeed","input": ["text"],"cost": {"input": 2e-6,"output": 6e-6},"contextWindow": 65536,"maxTokens": 8192}]
|
|
277
241
|
},
|
|
278
242
|
"ollama": {
|
|
279
243
|
"baseUrl": "http://127.0.0.1:11434",
|
|
280
244
|
"api": "ollama",
|
|
281
|
-
"models": [
|
|
282
|
-
{
|
|
283
|
-
"id": "qwen3-vl:8b",
|
|
284
|
-
"name": "Qwen3-VL-8B",
|
|
285
|
-
"input": ["text", "image"],
|
|
286
|
-
"contextWindow": 32768,
|
|
287
|
-
"maxTokens": 4096
|
|
288
|
-
}
|
|
289
|
-
]
|
|
245
|
+
"models": [{"id": "qwen3-vl:8b","name": "Qwen3-VL-8B","input": ["text","image"],"contextWindow": 32768,"maxTokens": 4096}]
|
|
290
246
|
}
|
|
291
247
|
}
|
|
292
248
|
},
|
|
293
249
|
"agents": {
|
|
294
250
|
"defaults": {
|
|
295
251
|
"model": { "primary": "${PRIMARY_MODEL}" },
|
|
296
|
-
"imageModel": {
|
|
297
|
-
|
|
298
|
-
"fallbacks": [
|
|
299
|
-
"ollama/qwen3-vl:8b"
|
|
300
|
-
]
|
|
301
|
-
},
|
|
302
|
-
"models": {
|
|
303
|
-
"ollama/qwen3-vl:8b": {}
|
|
304
|
-
},
|
|
252
|
+
"imageModel": { "primary": "ollama/qwen3-vl:8b", "fallbacks": ["ollama/qwen3-vl:8b"] },
|
|
253
|
+
"models": { "ollama/qwen3-vl:8b": {} },
|
|
305
254
|
"workspace": "${INSTANCE_DIR}/workspace",
|
|
306
255
|
"compaction": { "mode": "safeguard" }
|
|
307
256
|
}
|
|
@@ -311,17 +260,14 @@ cat > "${INSTANCE_DIR}/config/openclaw.json" << EOF
|
|
|
311
260
|
}
|
|
312
261
|
EOF
|
|
313
262
|
|
|
314
|
-
# --- 10. 预装可选技能
|
|
263
|
+
# --- 10. 预装可选技能 ---
|
|
315
264
|
echo -e "${BLUE}🤖 正在注入飞书运维机器人引导...${NC}"
|
|
316
265
|
SKILLS_DIR="${INSTANCE_DIR}/workspace/skills"
|
|
317
266
|
mkdir -p "$SKILLS_DIR"
|
|
318
|
-
|
|
319
267
|
SKILL_PKG="jinyu-skill-feishu-config"
|
|
320
268
|
REGISTRY="https://registry.npmmirror.com"
|
|
321
|
-
|
|
322
269
|
TEMP_DIR=$(mktemp -d)
|
|
323
270
|
cd "$TEMP_DIR"
|
|
324
|
-
|
|
325
271
|
if npm pack "$SKILL_PKG@latest" --registry="$REGISTRY" --quiet > /dev/null; then
|
|
326
272
|
TARBALL=$(ls *.tgz)
|
|
327
273
|
mkdir -p "$SKILLS_DIR/feishu-config"
|
|
@@ -330,11 +276,10 @@ if npm pack "$SKILL_PKG@latest" --registry="$REGISTRY" --quiet > /dev/null; then
|
|
|
330
276
|
else
|
|
331
277
|
echo -e "${YELLOW}⚠️ 技能 feishu-config 下载失败,跳过(可手动安装)${NC}"
|
|
332
278
|
fi
|
|
333
|
-
|
|
334
279
|
cd - > /dev/null
|
|
335
280
|
rm -rf "$TEMP_DIR"
|
|
336
281
|
|
|
337
|
-
# --- 如果实例是 yunwei
|
|
282
|
+
# --- 如果实例是 yunwei,安装角色包 ---
|
|
338
283
|
if [ "$INSTANCE_NAME" = "yunwei" ]; then
|
|
339
284
|
echo -e "${BLUE}🛠️ 检测到运维实例,正在安装角色包 role-openclaw-yunwei...${NC}"
|
|
340
285
|
TEMP_ROLE_DIR=$(mktemp -d)
|
|
@@ -343,22 +288,15 @@ if [ "$INSTANCE_NAME" = "yunwei" ]; then
|
|
|
343
288
|
TARBALL=$(ls *.tgz)
|
|
344
289
|
tar -xzf "$TARBALL" --strip-components=1
|
|
345
290
|
rm "$TARBALL"
|
|
346
|
-
|
|
347
|
-
# 1. 将 memory、skills 等目录复制到 workspace 根目录(排除 .md 文件)
|
|
348
291
|
for item in *; do
|
|
349
292
|
if [ -d "$item" ]; then
|
|
350
|
-
# 目录(如 memory、skills)复制到 workspace
|
|
351
293
|
cp -r "$item" "$INSTANCE_DIR/workspace/"
|
|
352
294
|
elif [ -f "$item" ]; then
|
|
353
|
-
# 非 .md 文件(如 package.json)也复制到 workspace
|
|
354
295
|
cp "$item" "$INSTANCE_DIR/workspace/" 2>/dev/null || true
|
|
355
296
|
fi
|
|
356
297
|
done
|
|
357
|
-
|
|
358
|
-
# 2. 创建实例根目录下的 docs 目录,并将所有 .md 文件复制过去
|
|
359
298
|
mkdir -p "$INSTANCE_DIR/docs/reference/templates"
|
|
360
299
|
cp *.md "$INSTANCE_DIR/docs/reference/templates/" 2>/dev/null || true
|
|
361
|
-
|
|
362
300
|
echo -e "${GREEN}✅ 角色包安装完成,workspace 已初始化${NC}"
|
|
363
301
|
else
|
|
364
302
|
echo -e "${YELLOW}⚠️ 角色包下载失败,请检查网络或手动安装${NC}"
|
|
@@ -367,56 +305,35 @@ if [ "$INSTANCE_NAME" = "yunwei" ]; then
|
|
|
367
305
|
rm -rf "$TEMP_ROLE_DIR"
|
|
368
306
|
fi
|
|
369
307
|
|
|
370
|
-
# --- 设置 profile
|
|
371
|
-
echo -e "${BLUE}🔗 配置 profile
|
|
308
|
+
# --- 设置 profile 链接 ---
|
|
309
|
+
echo -e "${BLUE}🔗 配置 profile 链接...${NC}"
|
|
372
310
|
PROFILES_DIR="$HOME/.openclaw/profiles"
|
|
373
311
|
mkdir -p "$PROFILES_DIR"
|
|
374
|
-
|
|
375
|
-
# 配置文件软链接
|
|
376
312
|
ln -sf "$INSTANCE_DIR/config/openclaw.json" "$PROFILES_DIR/$INSTANCE_NAME.json"
|
|
377
|
-
|
|
378
|
-
# 状态目录软链接(profile 默认状态目录为 ~/.openclaw/profiles/<profile>/)
|
|
379
|
-
# 使用 -sfn 以确保目录链接正确
|
|
380
313
|
ln -sfn "$INSTANCE_DIR/state" "$PROFILES_DIR/$INSTANCE_NAME"
|
|
381
|
-
|
|
382
314
|
echo -e "${GREEN}✅ 现在可以使用 'openclaw --profile $INSTANCE_NAME ...' 管理此实例${NC}"
|
|
383
315
|
|
|
384
|
-
# --- 11.
|
|
316
|
+
# --- 11. 生成启动脚本 ---
|
|
385
317
|
cat > "${INSTANCE_DIR}/start.sh" << 'EOF'
|
|
386
318
|
#!/usr/bin/env bash
|
|
387
|
-
# =================================================================
|
|
388
|
-
# OpenClaw 实例启动脚本
|
|
389
|
-
# 功能:从 dist 目录启动实例,支持网关、TUI 等多种模式
|
|
390
|
-
# 源码位置:~/openclaws/实例名/dist
|
|
391
|
-
# =================================================================
|
|
392
|
-
|
|
393
|
-
# 获取脚本所在目录(实例根目录)
|
|
394
319
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
395
320
|
INSTANCE_NAME=$(basename "$SCRIPT_DIR")
|
|
321
|
+
DIST_DIR="$SCRIPT_DIR"
|
|
396
322
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
echo -e "\033[0;31m❌ 错误: 实例目录中未找到 package.json\033[0m"
|
|
400
|
-
echo -e "\033[1;33m请重新运行 create-instance.sh 脚本\033[0m"
|
|
323
|
+
if [ ! -f "$DIST_DIR/package.json" ]; then
|
|
324
|
+
echo -e "\033[0;31m❌ 错误: 未找到 package.json\033[0m"
|
|
401
325
|
exit 1
|
|
402
326
|
fi
|
|
403
|
-
|
|
404
|
-
# 检查实例根目录中是否包含 node_modules(依赖已安装)
|
|
405
327
|
if [ ! -d "$SCRIPT_DIR/node_modules" ]; then
|
|
406
|
-
echo -e "\033[0;31m❌ 错误:
|
|
407
|
-
echo -e "\033[1;33m请重新运行 create-instance.sh 脚本安装依赖\033[0m"
|
|
328
|
+
echo -e "\033[0;31m❌ 错误: 未找到 node_modules\033[0m"
|
|
408
329
|
exit 1
|
|
409
330
|
fi
|
|
410
331
|
|
|
411
|
-
# 导出核心配置路径
|
|
412
332
|
export OPENCLAW_CONFIG_PATH="$SCRIPT_DIR/config/openclaw.json"
|
|
413
333
|
export OPENCLAW_TMP_DIR="$SCRIPT_DIR/tmp"
|
|
414
334
|
export OPENCLAW_STATE_DIR="$SCRIPT_DIR/state"
|
|
415
|
-
|
|
416
|
-
# 设置 NODE_PATH 以使用实例根目录下的 node_modules
|
|
417
335
|
export NODE_PATH="$SCRIPT_DIR/node_modules:$NODE_PATH"
|
|
418
336
|
|
|
419
|
-
# 从配置中提取 workspace 路径并导出
|
|
420
337
|
if [ -f "$OPENCLAW_CONFIG_PATH" ]; then
|
|
421
338
|
export OPENCLAW_WORKSPACE=$(node -e "
|
|
422
339
|
const cfg = require('$OPENCLAW_CONFIG_PATH');
|
|
@@ -424,65 +341,37 @@ if [ -f "$OPENCLAW_CONFIG_PATH" ]; then
|
|
|
424
341
|
")
|
|
425
342
|
fi
|
|
426
343
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
PLIST_LABEL="ai.openclaw.$INSTANCE_NAME"
|
|
430
|
-
PLIST_PATH="$HOME/Library/LaunchAgents/$PLIST_LABEL.plist"
|
|
431
|
-
if [ ! -f "$PLIST_PATH" ]; then
|
|
432
|
-
cat > "$PLIST_PATH" <<EOP
|
|
433
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
434
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
435
|
-
<plist version="1.0">
|
|
436
|
-
<dict>
|
|
437
|
-
<key>Label</key><string>$PLIST_LABEL</string>
|
|
438
|
-
<key>ProgramArguments</key><array><string>/bin/bash</string><string>$SCRIPT_DIR/start.sh</string></array>
|
|
439
|
-
<key>RunAtLoad</key><true/><key>KeepAlive</key><true/>
|
|
440
|
-
<key>WorkingDirectory</key><string>$SCRIPT_DIR</string>
|
|
441
|
-
</dict>
|
|
442
|
-
</plist>
|
|
443
|
-
EOP
|
|
444
|
-
launchctl load "$PLIST_PATH" 2>/dev/null || true
|
|
445
|
-
fi
|
|
446
|
-
fi
|
|
447
|
-
|
|
448
|
-
# 验证可执行文件是否存在
|
|
449
|
-
if [ ! -f "$SCRIPT_DIR/dist/index.js" ]; then
|
|
450
|
-
echo -e "\033[0;31m❌ 错误: 未找到可执行文件 $SCRIPT_DIR/dist/index.js\033[0m"
|
|
344
|
+
if [ ! -f "$DIST_DIR/dist/index.js" ]; then
|
|
345
|
+
echo -e "\033[0;31m❌ 错误: 未找到可执行文件 $DIST_DIR/dist/index.js\033[0m"
|
|
451
346
|
exit 1
|
|
452
347
|
fi
|
|
453
348
|
|
|
454
|
-
# 根据命令行参数执行对应操作
|
|
455
349
|
if [ $# -eq 0 ]; then
|
|
456
|
-
# 无参数:启动网关
|
|
457
350
|
if [ -f "$OPENCLAW_CONFIG_PATH" ]; then
|
|
458
351
|
GATEWAY_PORT=$(node -e "console.log(require('$OPENCLAW_CONFIG_PATH').gateway?.port || 18789)")
|
|
459
352
|
echo -e "\033[0;32m🚀 启动 OpenClaw-$INSTANCE_NAME 网关 (端口: $GATEWAY_PORT)...\033[0m"
|
|
460
|
-
exec node "$
|
|
353
|
+
exec node "$DIST_DIR/dist/index.js" gateway run --port "$GATEWAY_PORT"
|
|
461
354
|
else
|
|
462
|
-
echo -e "\033[0;31m❌ 错误:
|
|
355
|
+
echo -e "\033[0;31m❌ 错误: 未找到配置文件\033[0m"
|
|
463
356
|
exit 1
|
|
464
357
|
fi
|
|
465
358
|
else
|
|
466
359
|
if [ "$1" = "tui" ]; then
|
|
467
|
-
|
|
468
|
-
echo -e "\033[0;32m🚀 启动 OpenClaw-$INSTANCE_NAME TUI (workspace mode)...\033[0m"
|
|
360
|
+
echo -e "\033[0;32m🚀 启动 OpenClaw-$INSTANCE_NAME TUI...\033[0m"
|
|
469
361
|
cd "$OPENCLAW_WORKSPACE"
|
|
470
|
-
exec node "$
|
|
362
|
+
exec node "$DIST_DIR/dist/index.js" tui
|
|
471
363
|
else
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
exec node "$SCRIPT_DIR/dist/index.js" "$@"
|
|
364
|
+
echo -e "\033[0;32m🚀 执行命令: $@\033[0m"
|
|
365
|
+
exec node "$DIST_DIR/dist/index.js" "$@"
|
|
475
366
|
fi
|
|
476
367
|
fi
|
|
477
368
|
EOF
|
|
478
|
-
|
|
479
369
|
chmod +x "${INSTANCE_DIR}/start.sh"
|
|
480
370
|
|
|
481
371
|
# --- 12. 执行拉起 ---
|
|
482
372
|
echo -e "${BLUE}⚡ 正在后台启动服务...${NC}"
|
|
483
373
|
nohup "${INSTANCE_DIR}/start.sh" > "${INSTANCE_DIR}/workspace/server.log" 2>&1 &
|
|
484
374
|
PID=$!
|
|
485
|
-
|
|
486
375
|
sleep 5
|
|
487
376
|
|
|
488
377
|
check_port() {
|
|
@@ -505,12 +394,11 @@ if kill -0 $PID 2>/dev/null; then
|
|
|
505
394
|
echo -e "📄 实时日志: tail -f ${INSTANCE_DIR}/workspace/server.log"
|
|
506
395
|
echo -e "${GREEN}================================================${NC}"
|
|
507
396
|
|
|
508
|
-
# --- 交互式菜单 ---
|
|
509
397
|
if [ -t 0 ]; then
|
|
510
398
|
echo
|
|
511
399
|
echo -e "${BLUE}请选择下一步操作:${NC}"
|
|
512
|
-
echo "1) 启动 TUI
|
|
513
|
-
echo "2) 打开 Web UI
|
|
400
|
+
echo "1) 启动 TUI"
|
|
401
|
+
echo "2) 打开 Web UI"
|
|
514
402
|
echo "3) 退出"
|
|
515
403
|
read -p "请输入数字 [1-3]: " choice
|
|
516
404
|
case $choice in
|
|
@@ -533,19 +421,14 @@ if kill -0 $PID 2>/dev/null; then
|
|
|
533
421
|
echo -e "${RED}未找到 token,请手动查看配置文件。${NC}"
|
|
534
422
|
fi
|
|
535
423
|
;;
|
|
536
|
-
3)
|
|
537
|
-
|
|
538
|
-
exit 0
|
|
539
|
-
;;
|
|
540
|
-
*)
|
|
541
|
-
echo "无效选择"
|
|
542
|
-
;;
|
|
424
|
+
3) echo "退出"; exit 0 ;;
|
|
425
|
+
*) echo "无效选择" ;;
|
|
543
426
|
esac
|
|
544
427
|
fi
|
|
545
428
|
else
|
|
546
|
-
echo -e "${YELLOW}⚠️ 进程存在但端口 ${PORT}
|
|
429
|
+
echo -e "${YELLOW}⚠️ 进程存在但端口 ${PORT} 未监听,请查看日志: ${INSTANCE_DIR}/workspace/server.log${NC}"
|
|
547
430
|
fi
|
|
548
431
|
else
|
|
549
432
|
echo -e "${RED}❌ 启动失败,请查看日志: tail -n 20 ${INSTANCE_DIR}/workspace/server.log${NC}"
|
|
550
433
|
exit 1
|
|
551
|
-
|
|
434
|
+
if
|