@cuylabs/agent-server 4.10.0 → 5.0.1

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
@@ -1,5 +1,5 @@
1
1
  import * as _cuylabs_agent_core from '@cuylabs/agent-core';
2
- import { PluginCommandMetadata, FileEntry, Message, AgentTurnSourceChatOptions, TokenUsage, QueuedFollowUpRecord, FollowUpStatus, AgentEvent, ApprovalAction, ApprovalRememberScope, HumanInputResponse, ApprovalRequest, HumanInputRequest, SteeringResponse, FollowUpResponse, FollowUpDecisionAction, AgentTurnSource, FollowUpPolicy, PendingIntervention, SessionInfo, SessionStorage, Agent } from '@cuylabs/agent-core';
2
+ import { PluginCommandMetadata, FileEntry, Message, AgentTurnSourceChatOptions, TokenUsage, QueuedFollowUpRecord, FollowUpStatus, AgentEvent, ApprovalAction, ApprovalRememberScope, HumanInputResponse, ApprovalRequest, HumanInputRequest, SteeringResponse, FollowUpResponse, FollowUpDecisionAction, AgentTurnSource, FollowUpPolicy, PendingIntervention, SessionInfo, SessionStore, Agent } from '@cuylabs/agent-core';
3
3
  import { CoordinatorNotificationKind, CoordinatorNotification } from '@cuylabs/agent-core/team';
4
4
  import { EventBus } from '@cuylabs/agent-core/events';
5
5
  import { Readable, Writable } from 'node:stream';
@@ -373,7 +373,7 @@ interface AgentServerAdapter extends AgentTurnSource {
373
373
  subscribeTeamNotifications?(listener: (notification: AppTeamNotification) => void): Unsubscribe;
374
374
  listSessions(): Promise<SessionInfo[]>;
375
375
  deleteSession(sessionId: string): Promise<boolean>;
376
- getSessionStorage(): SessionStorage;
376
+ getSessionStore(): SessionStore;
377
377
  listPluginCommands?(): Promise<AppPluginCommandInfo[]> | AppPluginCommandInfo[];
378
378
  executePluginCommand?(name: string, args: string): Promise<string | null> | string | null;
379
379
  }
package/dist/index.js CHANGED
@@ -300,7 +300,7 @@ function createAgentServerAdapter(agent, options = {}) {
300
300
  drainQueuedFollowUps: () => agent.drainQueuedNext(),
301
301
  listSessions: () => agent.listSessions(),
302
302
  deleteSession: (sessionId) => agent.deleteSession(sessionId),
303
- getSessionStorage: () => agent.getSessionManager().getStorage(),
303
+ getSessionStore: () => agent.getSessionManager().getStore(),
304
304
  listPluginCommands: () => pluginCommandInfos,
305
305
  executePluginCommand: async (name, args) => {
306
306
  const command = pluginCommandTokens.get(
@@ -550,7 +550,7 @@ var InProcessAgentServer = class {
550
550
  return infos.map((info) => toSessionSummary(info, this.getRuntimeSnapshot(info.id))).sort((a, b) => Date.parse(b.updatedAt) - Date.parse(a.updatedAt));
551
551
  }
552
552
  async createSession(options = {}) {
553
- const manager = new SessionManager(this.adapter.getSessionStorage());
553
+ const manager = new SessionManager(this.adapter.getSessionStore());
554
554
  const id = await manager.create({
555
555
  ...options.id ? { id: options.id } : {},
556
556
  cwd: options.cwd ?? this.adapter.cwd,
@@ -564,7 +564,7 @@ var InProcessAgentServer = class {
564
564
  return detail;
565
565
  }
566
566
  async readSession(sessionId) {
567
- const manager = new SessionManager(this.adapter.getSessionStorage());
567
+ const manager = new SessionManager(this.adapter.getSessionStore());
568
568
  if (!await manager.sessionExists(sessionId)) {
569
569
  return null;
570
570
  }
@@ -602,7 +602,7 @@ var InProcessAgentServer = class {
602
602
  return deleted;
603
603
  }
604
604
  async branchSession(sessionId, options = {}) {
605
- const manager = new SessionManager(this.adapter.getSessionStorage());
605
+ const manager = new SessionManager(this.adapter.getSessionStore());
606
606
  if (!await manager.sessionExists(sessionId)) {
607
607
  throw new Error(`Session not found: ${sessionId}`);
608
608
  }
@@ -964,7 +964,7 @@ var InProcessAgentServer = class {
964
964
  }
965
965
  }
966
966
  async ensureSessionExists(sessionId) {
967
- const manager = new SessionManager(this.adapter.getSessionStorage());
967
+ const manager = new SessionManager(this.adapter.getSessionStore());
968
968
  if (await manager.sessionExists(sessionId)) {
969
969
  return;
970
970
  }
@@ -1090,7 +1090,7 @@ var InProcessAgentServer = class {
1090
1090
  if (ready.length === 0) {
1091
1091
  return;
1092
1092
  }
1093
- const manager = new SessionManager(this.adapter.getSessionStorage());
1093
+ const manager = new SessionManager(this.adapter.getSessionStore());
1094
1094
  if (!await manager.sessionExists(sessionId)) {
1095
1095
  await manager.create({ id: sessionId, cwd: this.adapter.cwd });
1096
1096
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuylabs/agent-server",
3
- "version": "4.10.0",
3
+ "version": "5.0.1",
4
4
  "description": "Transport-neutral local server for @cuylabs/agent-core sessions, turns, and streamed events",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "ws": "^8.19.0",
22
- "@cuylabs/agent-core": "^4.10.0"
22
+ "@cuylabs/agent-core": "^5.0.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.0.0",