@wu529778790/open-im 1.11.1-beta.15 → 1.11.1-beta.16
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.
|
@@ -15,6 +15,17 @@ import { createLogger } from '../logger.js';
|
|
|
15
15
|
import { refreshClaudeEnvToProcess } from '../config/file-io.js';
|
|
16
16
|
import { toReplyPlainText } from '../shared/utils.js';
|
|
17
17
|
const log = createLogger('ClaudeSDK');
|
|
18
|
+
/**
|
|
19
|
+
* 注入交互式上下文指令,让 Claude 认为这是交互式终端会话。
|
|
20
|
+
* 解决 query() 非交互环境下 Claude 跳过用户选择、直接自主决策的问题。
|
|
21
|
+
*/
|
|
22
|
+
const INTERACTIVE_CONTEXT = `[SYSTEM: You are in an interactive chat session via instant messenger. The user CAN and WILL respond to your messages — treat this like an interactive terminal session. Rules:
|
|
23
|
+
1. When you need to make a decision involving user preference (choosing an approach, selecting between options, deciding what to do next), ALWAYS present clearly numbered options and WAIT for the user's response.
|
|
24
|
+
2. Do NOT proceed autonomously when user input would be valuable.
|
|
25
|
+
3. Only proceed autonomously for obvious single-path tasks (e.g. reading a file, running a simple command).
|
|
26
|
+
4. When presenting options, format them as a numbered list and end with a question.
|
|
27
|
+
]
|
|
28
|
+
`;
|
|
18
29
|
function loadUserPluginSettings() {
|
|
19
30
|
try {
|
|
20
31
|
const settingsPath = join(homedir(), '.claude', 'settings.json');
|
|
@@ -386,7 +397,7 @@ export class ClaudeSDKAdapter {
|
|
|
386
397
|
}
|
|
387
398
|
}
|
|
388
399
|
const q = query({
|
|
389
|
-
prompt,
|
|
400
|
+
prompt: INTERACTIVE_CONTEXT + prompt,
|
|
390
401
|
options: {
|
|
391
402
|
cwd: workDir,
|
|
392
403
|
model: resolvedModel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wu529778790/open-im",
|
|
3
|
-
"version": "1.11.1-beta.
|
|
3
|
+
"version": "1.11.1-beta.16",
|
|
4
4
|
"description": "Your AI coding assistant, in every chat app. Multi-platform IM bridge for Claude Code, Codex, and CodeBuddy.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|