@wu529778790/open-im 1.11.9-beta.2 → 1.11.9-beta.4

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.
@@ -294,6 +294,41 @@ export async function startWebConfigServer(options) {
294
294
  }
295
295
  return;
296
296
  }
297
+ // --- Codex config.toml (~/.codex/config.toml) ---
298
+ function getCodexConfigPath() {
299
+ const home = process.env.CODEX_HOME || join(homedir(), '.codex');
300
+ return join(home, 'config.toml');
301
+ }
302
+ if (request.method === "GET" && requestUrl.pathname === "/api/codex/config") {
303
+ try {
304
+ const configPath = getCodexConfigPath();
305
+ let contents = "";
306
+ if (existsSync(configPath)) {
307
+ contents = readFileSync(configPath, "utf-8");
308
+ }
309
+ json(response, 200, { path: configPath, contents }, request);
310
+ }
311
+ catch (error) {
312
+ json(response, 500, { error: error instanceof Error ? error.message : String(error) }, request);
313
+ }
314
+ return;
315
+ }
316
+ if (request.method === "POST" && requestUrl.pathname === "/api/codex/config") {
317
+ try {
318
+ const body = await readJson(request);
319
+ const raw = body.contents ?? "";
320
+ const configPath = getCodexConfigPath();
321
+ const dir = dirname(configPath);
322
+ if (!existsSync(dir))
323
+ mkdirSync(dir, { recursive: true });
324
+ writeFileSync(configPath, raw, "utf-8");
325
+ json(response, 200, { message: "Codex config.toml saved.", path: configPath }, request);
326
+ }
327
+ catch (error) {
328
+ json(response, 500, { error: error instanceof Error ? error.message : String(error) }, request);
329
+ }
330
+ return;
331
+ }
297
332
  // --- CodeBuddy settings (~/.codebuddy/settings.json) ---
298
333
  function getCodebuddySettingsPath() {
299
334
  const home = process.env.CODEBUDDY_HOME || join(homedir(), '.codebuddy');
@@ -181,9 +181,8 @@ function buildCompletionNote(result, sessionManager, ctx) {
181
181
  return parts.join(' | ');
182
182
  }
183
183
  function buildRunOptions(config, sessionManager, ctx, aiCommand, toolAdapter) {
184
- const defaultSkipPermissions = toolAdapter.interactionMode === 'native'
185
- ? (config.skipPermissions ?? true)
186
- : (config.skipPermissions ?? true);
184
+ // 权限 hook 尚未接入 IM,暂时全局跳过
185
+ const defaultSkipPermissions = true;
187
186
  return {
188
187
  model: aiCommand === 'claude'
189
188
  ? (sessionManager.getModel(ctx.userId, ctx.threadId) ?? config.claudeModel)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.11.9-beta.2",
3
+ "version": "1.11.9-beta.4",
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",