fix: stabilize slack http receiver import
This commit is contained in:
@@ -97,7 +97,7 @@ export async function runCliAgent(params: {
|
|||||||
extraSystemPrompt,
|
extraSystemPrompt,
|
||||||
ownerNumbers: params.ownerNumbers,
|
ownerNumbers: params.ownerNumbers,
|
||||||
heartbeatPrompt,
|
heartbeatPrompt,
|
||||||
docsPath,
|
docsPath: docsPath ?? undefined,
|
||||||
tools: [],
|
tools: [],
|
||||||
contextFiles,
|
contextFiles,
|
||||||
modelDisplay,
|
modelDisplay,
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ export async function compactEmbeddedPiSession(params: {
|
|||||||
? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt)
|
? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt)
|
||||||
: undefined,
|
: undefined,
|
||||||
skillsPrompt,
|
skillsPrompt,
|
||||||
docsPath,
|
docsPath: docsPath ?? undefined,
|
||||||
promptMode,
|
promptMode,
|
||||||
runtimeInfo,
|
runtimeInfo,
|
||||||
sandboxInfo,
|
sandboxInfo,
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ export async function runEmbeddedAttempt(
|
|||||||
? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt)
|
? resolveHeartbeatPrompt(params.config?.agents?.defaults?.heartbeat?.prompt)
|
||||||
: undefined,
|
: undefined,
|
||||||
skillsPrompt,
|
skillsPrompt,
|
||||||
docsPath,
|
docsPath: docsPath ?? undefined,
|
||||||
reactionGuidance,
|
reactionGuidance,
|
||||||
promptMode,
|
promptMode,
|
||||||
runtimeInfo,
|
runtimeInfo,
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ describe("buildAgentSystemPrompt", () => {
|
|||||||
"Use `Read` to load the SKILL.md at the location listed for that skill.",
|
"Use `Read` to load the SKILL.md at the location listed for that skill.",
|
||||||
);
|
);
|
||||||
expect(prompt).toContain("Clawdbot docs: /tmp/clawd/docs");
|
expect(prompt).toContain("Clawdbot docs: /tmp/clawd/docs");
|
||||||
expect(prompt).toContain("read the docs first using `Read`");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("includes docs guidance when docsPath is provided", () => {
|
it("includes docs guidance when docsPath is provided", () => {
|
||||||
@@ -109,7 +108,7 @@ describe("buildAgentSystemPrompt", () => {
|
|||||||
expect(prompt).toContain("## Documentation");
|
expect(prompt).toContain("## Documentation");
|
||||||
expect(prompt).toContain("Clawdbot docs: /tmp/clawd/docs");
|
expect(prompt).toContain("Clawdbot docs: /tmp/clawd/docs");
|
||||||
expect(prompt).toContain(
|
expect(prompt).toContain(
|
||||||
"When a user asks about Clawdbot behavior, commands, config, or architecture",
|
"For Clawdbot behavior, commands, config, or architecture: consult local docs first.",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -587,7 +587,7 @@ export async function runCapability(params: {
|
|||||||
activeModel: params.activeModel,
|
activeModel: params.activeModel,
|
||||||
});
|
});
|
||||||
let resolvedEntries = entries;
|
let resolvedEntries = entries;
|
||||||
if (resolvedEntries.length === 0 && capability === "audio" && config?.enabled !== false) {
|
if (resolvedEntries.length === 0 && capability === "audio") {
|
||||||
resolvedEntries = await resolveAutoAudioEntries({
|
resolvedEntries = await resolveAutoAudioEntries({
|
||||||
cfg,
|
cfg,
|
||||||
agentDir: params.agentDir,
|
agentDir: params.agentDir,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||||
|
|
||||||
import { App, HTTPReceiver } from "@slack/bolt";
|
import SlackBolt from "@slack/bolt";
|
||||||
|
|
||||||
import { resolveTextChunkLimit } from "../../auto-reply/chunk.js";
|
import { resolveTextChunkLimit } from "../../auto-reply/chunk.js";
|
||||||
import { DEFAULT_GROUP_HISTORY_LIMIT } from "../../auto-reply/reply/history.js";
|
import { DEFAULT_GROUP_HISTORY_LIMIT } from "../../auto-reply/reply/history.js";
|
||||||
@@ -26,6 +26,8 @@ import { normalizeAllowList } from "./allow-list.js";
|
|||||||
|
|
||||||
import type { MonitorSlackOpts } from "./types.js";
|
import type { MonitorSlackOpts } from "./types.js";
|
||||||
|
|
||||||
|
const { App, HTTPReceiver } = SlackBolt;
|
||||||
|
|
||||||
function parseApiAppIdFromAppToken(raw?: string) {
|
function parseApiAppIdFromAppToken(raw?: string) {
|
||||||
const token = raw?.trim();
|
const token = raw?.trim();
|
||||||
if (!token) return undefined;
|
if (!token) return undefined;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export type MonitorSlackOpts = {
|
|||||||
botToken?: string;
|
botToken?: string;
|
||||||
appToken?: string;
|
appToken?: string;
|
||||||
accountId?: string;
|
accountId?: string;
|
||||||
|
mode?: "socket" | "http";
|
||||||
config?: ClawdbotConfig;
|
config?: ClawdbotConfig;
|
||||||
runtime?: RuntimeEnv;
|
runtime?: RuntimeEnv;
|
||||||
abortSignal?: AbortSignal;
|
abortSignal?: AbortSignal;
|
||||||
|
|||||||
Reference in New Issue
Block a user