@n1creator/openacp-cli 2026.712.6 → 2026.712.8

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/cli.js CHANGED
@@ -2088,6 +2088,11 @@ var init_types = __esm({
2088
2088
 
2089
2089
  // src/plugins/identity/identity-service.ts
2090
2090
  import { nanoid } from "nanoid";
2091
+ function nextIsoTimestamp(previous) {
2092
+ const now = Date.now();
2093
+ const previousTime = Date.parse(previous);
2094
+ return new Date(Number.isNaN(previousTime) ? now : Math.max(now, previousTime + 1)).toISOString();
2095
+ }
2091
2096
  var IdentityServiceImpl;
2092
2097
  var init_identity_service = __esm({
2093
2098
  "src/plugins/identity/identity-service.ts"() {
@@ -2217,7 +2222,7 @@ var init_identity_service = __esm({
2217
2222
  const updated = {
2218
2223
  ...user,
2219
2224
  ...changes,
2220
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2225
+ updatedAt: nextIsoTimestamp(user.updatedAt)
2221
2226
  };
2222
2227
  await this.store.putUser(updated);
2223
2228
  this.emitEvent("identity:updated", { userId, changes: Object.keys(changes) });
@@ -10837,8 +10842,7 @@ async function systemRoutes(app, deps) {
10837
10842
  app.get("/health/details", {
10838
10843
  preHandler: [...authPreHandler ? [authPreHandler] : [], requireScopes("system:health")]
10839
10844
  }, async () => {
10840
- const activeSessions = deps.core.sessionManager.listSessions();
10841
- const allRecords = deps.core.sessionManager.listRecords();
10845
+ const sessions = deps.core.sessionManager.listAllSessions();
10842
10846
  const mem = process.memoryUsage();
10843
10847
  const tunnel = deps.core.tunnelService;
10844
10848
  return {
@@ -10851,10 +10855,10 @@ async function systemRoutes(app, deps) {
10851
10855
  heapTotal: mem.heapTotal
10852
10856
  },
10853
10857
  sessions: {
10854
- active: activeSessions.filter(
10858
+ active: sessions.filter(
10855
10859
  (s) => s.status === "active" || s.status === "initializing"
10856
10860
  ).length,
10857
- total: allRecords.length
10861
+ total: sessions.length
10858
10862
  },
10859
10863
  adapters: Array.from(deps.core.adapters.keys()),
10860
10864
  tunnel: tunnel ? { enabled: true, url: tunnel.getPublicUrl() } : { enabled: false }
@@ -24246,7 +24250,7 @@ var init_session_manager = __esm({
24246
24250
  if (this.store) {
24247
24251
  let records = this.store.list().filter((r) => !r.isAssistant);
24248
24252
  if (channelId) records = records.filter((r) => r.channelId === channelId);
24249
- return records.map((record) => {
24253
+ const summaries = records.map((record) => {
24250
24254
  const live2 = this.sessions.get(record.sessionId);
24251
24255
  if (live2) {
24252
24256
  return {
@@ -24283,6 +24287,27 @@ var init_session_manager = __esm({
24283
24287
  isLive: false
24284
24288
  };
24285
24289
  });
24290
+ const storedIds = new Set(records.map((record) => record.sessionId));
24291
+ for (const live2 of this.listSessions(channelId)) {
24292
+ if (storedIds.has(live2.id)) continue;
24293
+ summaries.push({
24294
+ id: live2.id,
24295
+ agent: live2.agentName,
24296
+ status: live2.status,
24297
+ name: live2.name ?? null,
24298
+ workspace: live2.workingDirectory,
24299
+ channelId: live2.channelId,
24300
+ createdAt: live2.createdAt.toISOString(),
24301
+ lastActiveAt: null,
24302
+ dangerousMode: live2.clientOverrides.bypassPermissions ?? false,
24303
+ queueDepth: live2.queueDepth,
24304
+ promptRunning: live2.promptRunning,
24305
+ configOptions: live2.configOptions?.length ? live2.configOptions : void 0,
24306
+ capabilities: live2.agentCapabilities ?? null,
24307
+ isLive: true
24308
+ });
24309
+ }
24310
+ return summaries;
24286
24311
  }
24287
24312
  let live = Array.from(this.sessions.values()).filter((s) => !s.isAssistant);
24288
24313
  if (channelId) live = live.filter((s) => s.channelId === channelId);