chatccc 0.2.112 → 0.2.113
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/package.json +1 -1
- package/src/agent-file-rpc.ts +2 -2
- package/src/agent-image-rpc.ts +2 -2
- package/src/feishu-api.ts +6 -1
package/package.json
CHANGED
package/src/agent-file-rpc.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { extname, isAbsolute, resolve } from "node:path";
|
|
|
3
3
|
import { stat } from "node:fs/promises";
|
|
4
4
|
|
|
5
5
|
import { getTenantAccessToken, sendFileReply, sendTextReply } from "./feishu-platform.ts";
|
|
6
|
-
import { ts } from "./config.ts";
|
|
6
|
+
import { ts, resolveDefaultAgentTool } from "./config.ts";
|
|
7
7
|
import { readUtf8JsonBody } from "./agent-rpc-body.ts";
|
|
8
8
|
import { getAdapterForTool } from "./session.ts";
|
|
9
9
|
import { getChatsForSession } from "./session-chat-binding.ts";
|
|
@@ -77,7 +77,7 @@ export async function handleAgentFileRequest(
|
|
|
77
77
|
try {
|
|
78
78
|
const { getSessionTool } = await import("./session.ts");
|
|
79
79
|
const tool = await getSessionTool(sessionId);
|
|
80
|
-
const adapter = getAdapterForTool(tool ??
|
|
80
|
+
const adapter = getAdapterForTool(tool ?? resolveDefaultAgentTool());
|
|
81
81
|
const info = await adapter.getSessionInfo(sessionId);
|
|
82
82
|
if (!info?.cwd) {
|
|
83
83
|
jsonReply(res, 400, { ok: false, error: "Cannot determine cwd for session" });
|
package/src/agent-image-rpc.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { extname, isAbsolute, resolve } from "node:path";
|
|
|
3
3
|
import { stat } from "node:fs/promises";
|
|
4
4
|
|
|
5
5
|
import { getTenantAccessToken, sendImageReply, sendTextReply } from "./feishu-platform.ts";
|
|
6
|
-
import { ts } from "./config.ts";
|
|
6
|
+
import { ts, resolveDefaultAgentTool } from "./config.ts";
|
|
7
7
|
import { readUtf8JsonBody } from "./agent-rpc-body.ts";
|
|
8
8
|
import { getAdapterForTool } from "./session.ts";
|
|
9
9
|
import { getChatsForSession } from "./session-chat-binding.ts";
|
|
@@ -73,7 +73,7 @@ export async function handleAgentImageRequest(
|
|
|
73
73
|
try {
|
|
74
74
|
const { getSessionTool } = await import("./session.ts");
|
|
75
75
|
const tool = await getSessionTool(sessionId);
|
|
76
|
-
const adapter = getAdapterForTool(tool ??
|
|
76
|
+
const adapter = getAdapterForTool(tool ?? resolveDefaultAgentTool());
|
|
77
77
|
const info = await adapter.getSessionInfo(sessionId);
|
|
78
78
|
if (!info?.cwd) {
|
|
79
79
|
jsonReply(res, 400, { ok: false, error: "Cannot determine cwd for session" });
|
package/src/feishu-api.ts
CHANGED
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
CURSOR_SESSION_PREFIX,
|
|
15
15
|
CODEX_SESSION_PREFIX,
|
|
16
16
|
ts,
|
|
17
|
+
resolveDefaultAgentTool,
|
|
18
|
+
toolDisplayName,
|
|
17
19
|
} from "./config.ts";
|
|
18
20
|
import { applyPrivacy } from "./privacy.ts";
|
|
19
21
|
import { buildHelpCard } from "./cards.ts";
|
|
@@ -950,7 +952,10 @@ export async function sendRestartCard(token: string): Promise<void> {
|
|
|
950
952
|
|
|
951
953
|
console.log(`[${ts()}] [RESTART] Latest active chat: ${latestChatId} (mtime=${new Date(latestTime).toISOString()})`);
|
|
952
954
|
|
|
953
|
-
const restartCard = buildHelpCard("", {
|
|
955
|
+
const restartCard = buildHelpCard("", {
|
|
956
|
+
greeting: "Bot 已启动完成,可以继续使用。",
|
|
957
|
+
defaultToolLabel: toolDisplayName(resolveDefaultAgentTool()),
|
|
958
|
+
});
|
|
954
959
|
await fetch(`${BASE_URL}/im/v1/messages?receive_id_type=chat_id`, {
|
|
955
960
|
method: "POST",
|
|
956
961
|
headers: {
|