@openacp/cli 2026.403.5 → 2026.403.7

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/dist/index.d.ts CHANGED
@@ -2008,6 +2008,7 @@ declare class SessionFactory {
2008
2008
  private lazyResume;
2009
2009
  handleNewSession(channelId: string, agentName?: string, workspacePath?: string, options?: {
2010
2010
  createThread?: boolean;
2011
+ threadId?: string;
2011
2012
  }): Promise<Session>;
2012
2013
  /** NOTE: handleNewChat is currently dead code — never called outside core.ts itself.
2013
2014
  * Moving it anyway for completeness; can be removed in a future cleanup. */
@@ -2019,6 +2020,7 @@ declare class SessionFactory {
2019
2020
  contextQuery: ContextQuery;
2020
2021
  contextOptions?: ContextOptions;
2021
2022
  createThread?: boolean;
2023
+ threadId?: string;
2022
2024
  }): Promise<{
2023
2025
  session: Session;
2024
2026
  contextResult: ContextResult | null;
@@ -2154,6 +2156,7 @@ interface AssistantManagerCore {
2154
2156
  workingDirectory: string;
2155
2157
  initialName?: string;
2156
2158
  isAssistant?: boolean;
2159
+ threadId?: string;
2157
2160
  }): Promise<Session>;
2158
2161
  connectSessionBridge(session: Session): void;
2159
2162
  configManager: {
@@ -2258,6 +2261,7 @@ declare class OpenACPCore {
2258
2261
  }): Promise<Session>;
2259
2262
  handleNewSession(channelId: string, agentName?: string, workspacePath?: string, options?: {
2260
2263
  createThread?: boolean;
2264
+ threadId?: string;
2261
2265
  }): Promise<Session>;
2262
2266
  adoptSession(agentName: string, agentSessionId: string, cwd: string, channelId?: string): Promise<{
2263
2267
  ok: true;
@@ -2277,6 +2281,7 @@ declare class OpenACPCore {
2277
2281
  contextQuery: ContextQuery;
2278
2282
  contextOptions?: ContextOptions;
2279
2283
  createThread?: boolean;
2284
+ threadId?: string;
2280
2285
  }): Promise<{
2281
2286
  session: Session;
2282
2287
  contextResult: ContextResult | null;
package/dist/index.js CHANGED
@@ -6311,9 +6311,7 @@ async function createSessionDirect(ctx, core, chatId, agentName, workspace, onCo
6311
6311
  message_thread_id: threadId,
6312
6312
  parse_mode: "HTML"
6313
6313
  });
6314
- const session = await core.handleNewSession("telegram", agentName, workspace);
6315
- session.threadId = String(threadId);
6316
- await core.sessionManager.patchRecord(session.id, { platform: { topicId: threadId } });
6314
+ const session = await core.handleNewSession("telegram", agentName, workspace, { threadId: String(threadId) });
6317
6315
  const finalName = `\u{1F504} ${session.agentName} \u2014 New Session`;
6318
6316
  try {
6319
6317
  await ctx.api.editForumTopic(chatId, threadId, { name: finalName });
@@ -10646,7 +10644,7 @@ var PathGuard = class {
10646
10644
  reason: `Path is outside workspace boundary: ${realPath}`
10647
10645
  };
10648
10646
  }
10649
- if (isWithinCwd) {
10647
+ if (isWithinCwd && !isWithinAllowed) {
10650
10648
  const relativePath = path6.relative(this.cwd, realPath);
10651
10649
  if (relativePath === ".openacpignore") {
10652
10650
  return { allowed: true, reason: "" };
@@ -11800,8 +11798,9 @@ var Session = class extends TypedEmitter {
11800
11798
  this.queue = new PromptQueue(
11801
11799
  (text3, attachments) => this.processPrompt(text3, attachments),
11802
11800
  (err) => {
11803
- this.fail("Prompt execution failed");
11804
11801
  this.log.error({ err }, "Prompt execution failed");
11802
+ const message = err instanceof Error ? err.message : String(err);
11803
+ this.emit("agent_event", { type: "error", message: `Prompt execution failed: ${message}` });
11805
11804
  }
11806
11805
  );
11807
11806
  this.agentInstance.on("agent_event", (event) => {
@@ -13348,7 +13347,8 @@ var SessionFactory = class {
13348
13347
  channelId: params.channelId,
13349
13348
  agentName: params.agentName,
13350
13349
  workingDirectory: params.workingDirectory,
13351
- createThread: params.createThread
13350
+ createThread: params.createThread,
13351
+ threadId: params.threadId
13352
13352
  });
13353
13353
  if (contextResult) {
13354
13354
  session.setContext(contextResult.markdown);
@@ -14911,9 +14911,9 @@ var AssistantManager = class {
14911
14911
  agentName: this.core.configManager.get().defaultAgent,
14912
14912
  workingDirectory: this.core.configManager.resolveWorkspace(),
14913
14913
  initialName: "Assistant",
14914
- isAssistant: true
14914
+ isAssistant: true,
14915
+ threadId
14915
14916
  });
14916
- session.threadId = threadId;
14917
14917
  this.sessions.set(channelId, session);
14918
14918
  const systemPrompt = this.registry.buildSystemPrompt(channelId);
14919
14919
  this.pendingSystemPrompts.set(channelId, systemPrompt);