chore: formatting
This commit is contained in:
@@ -43,8 +43,8 @@ import {
|
|||||||
sanitizeSessionMessagesImages,
|
sanitizeSessionMessagesImages,
|
||||||
} from "./pi-embedded-helpers.js";
|
} from "./pi-embedded-helpers.js";
|
||||||
import {
|
import {
|
||||||
subscribeEmbeddedPiSession,
|
|
||||||
type BlockReplyChunking,
|
type BlockReplyChunking,
|
||||||
|
subscribeEmbeddedPiSession,
|
||||||
} from "./pi-embedded-subscribe.js";
|
} from "./pi-embedded-subscribe.js";
|
||||||
import { extractAssistantText } from "./pi-embedded-utils.js";
|
import { extractAssistantText } from "./pi-embedded-utils.js";
|
||||||
import { createClawdisCodingTools } from "./pi-tools.js";
|
import { createClawdisCodingTools } from "./pi-tools.js";
|
||||||
|
|||||||
@@ -266,7 +266,10 @@ export function subscribeEmbeddedPiSession(params: {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (blockBuffer.length < minChars && !force) return;
|
if (blockBuffer.length < minChars && !force) return;
|
||||||
while (blockBuffer.length >= minChars || (force && blockBuffer.length > 0)) {
|
while (
|
||||||
|
blockBuffer.length >= minChars ||
|
||||||
|
(force && blockBuffer.length > 0)
|
||||||
|
) {
|
||||||
const breakIdx = pickBreakIndex(blockBuffer);
|
const breakIdx = pickBreakIndex(blockBuffer);
|
||||||
if (breakIdx <= 0) {
|
if (breakIdx <= 0) {
|
||||||
if (force) {
|
if (force) {
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ import { defaultRuntime } from "../runtime.js";
|
|||||||
import { normalizeE164 } from "../utils.js";
|
import { normalizeE164 } from "../utils.js";
|
||||||
import { resolveHeartbeatSeconds } from "../web/reconnect.js";
|
import { resolveHeartbeatSeconds } from "../web/reconnect.js";
|
||||||
import { getWebAuthAgeMs, webAuthExists } from "../web/session.js";
|
import { getWebAuthAgeMs, webAuthExists } from "../web/session.js";
|
||||||
|
import { resolveTextChunkLimit, type TextChunkSurface } from "./chunk.js";
|
||||||
import {
|
import {
|
||||||
normalizeGroupActivation,
|
normalizeGroupActivation,
|
||||||
parseActivationCommand,
|
parseActivationCommand,
|
||||||
@@ -74,7 +75,6 @@ import {
|
|||||||
} from "./thinking.js";
|
} from "./thinking.js";
|
||||||
import { SILENT_REPLY_TOKEN } from "./tokens.js";
|
import { SILENT_REPLY_TOKEN } from "./tokens.js";
|
||||||
import { isAudio, transcribeInboundAudio } from "./transcription.js";
|
import { isAudio, transcribeInboundAudio } from "./transcription.js";
|
||||||
import { resolveTextChunkLimit, type TextChunkSurface } from "./chunk.js";
|
|
||||||
import type { GetReplyOptions, ReplyPayload } from "./types.js";
|
import type { GetReplyOptions, ReplyPayload } from "./types.js";
|
||||||
|
|
||||||
export type { GetReplyOptions, ReplyPayload } from "./types.js";
|
export type { GetReplyOptions, ReplyPayload } from "./types.js";
|
||||||
@@ -1125,7 +1125,9 @@ export async function getReplyFromConfig(
|
|||||||
const resolvedBlockStreaming =
|
const resolvedBlockStreaming =
|
||||||
agentCfg?.blockStreamingDefault === "off" ? "off" : "on";
|
agentCfg?.blockStreamingDefault === "off" ? "off" : "on";
|
||||||
const resolvedBlockStreamingBreak =
|
const resolvedBlockStreamingBreak =
|
||||||
agentCfg?.blockStreamingBreak === "message_end" ? "message_end" : "text_end";
|
agentCfg?.blockStreamingBreak === "message_end"
|
||||||
|
? "message_end"
|
||||||
|
: "text_end";
|
||||||
const blockStreamingEnabled = resolvedBlockStreaming === "on";
|
const blockStreamingEnabled = resolvedBlockStreaming === "on";
|
||||||
const blockReplyChunking = blockStreamingEnabled
|
const blockReplyChunking = blockStreamingEnabled
|
||||||
? resolveBlockStreamingChunking(cfg, sessionCtx.Surface)
|
? resolveBlockStreamingChunking(cfg, sessionCtx.Surface)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { afterEach, describe, expect, it, vi } from "vitest";
|
|||||||
|
|
||||||
vi.mock("../globals.js", () => ({
|
vi.mock("../globals.js", () => ({
|
||||||
isVerbose: () => false,
|
isVerbose: () => false,
|
||||||
shouldLogVerbose: () => false,
|
|
||||||
logVerbose: vi.fn(),
|
logVerbose: vi.fn(),
|
||||||
shouldLogVerbose: () => false,
|
shouldLogVerbose: () => false,
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -822,7 +822,8 @@ export async function monitorWebProvider(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const resolveGroupRequireMentionFor = (conversationId: string) => {
|
const resolveGroupRequireMentionFor = (conversationId: string) => {
|
||||||
const groupId = resolveGroupResolution(conversationId)?.id ?? conversationId;
|
const groupId =
|
||||||
|
resolveGroupResolution(conversationId)?.id ?? conversationId;
|
||||||
const groupConfig = cfg.whatsapp?.groups?.[groupId];
|
const groupConfig = cfg.whatsapp?.groups?.[groupId];
|
||||||
if (typeof groupConfig?.requireMention === "boolean") {
|
if (typeof groupConfig?.requireMention === "boolean") {
|
||||||
return groupConfig.requireMention;
|
return groupConfig.requireMention;
|
||||||
|
|||||||
Reference in New Issue
Block a user