tabminal 3.0.19 → 3.0.20

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/acp-manager.mjs +46 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabminal",
3
- "version": "3.0.19",
3
+ "version": "3.0.20",
4
4
  "description": "Tab(ter)minal, a Cloud-Native terminal and ACP agent workspace for desktop, tablet, and phone.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4193,46 +4193,52 @@ export class AcpManager {
4193
4193
 
4194
4194
  #getSerializedTabs() {
4195
4195
  const serializedTabs = Array.from(this.tabs.values()).map((entry) => {
4196
- const tab = entry.serialize();
4197
- return {
4198
- id: tab.id,
4199
- agentId: tab.agentId,
4200
- cwd: tab.cwd,
4201
- acpSessionId: tab.acpSessionId,
4202
- terminalSessionId: tab.terminalSessionId,
4203
- createdAt: tab.createdAt,
4204
- title: tab.title || '',
4205
- currentModeId: tab.currentModeId || '',
4206
- availableModes: Array.isArray(tab.availableModes)
4207
- ? cloneSerializable(tab.availableModes, [])
4208
- : [],
4209
- availableCommands: Array.isArray(tab.availableCommands)
4210
- ? cloneSerializable(tab.availableCommands, [])
4211
- : [],
4212
- configOptions: Array.isArray(tab.configOptions)
4213
- ? cloneSerializable(tab.configOptions, [])
4214
- : [],
4215
- messages: Array.isArray(tab.messages)
4216
- ? cloneSerializable(tab.messages, [])
4217
- : [],
4218
- toolCalls: Array.isArray(tab.toolCalls)
4219
- ? cloneSerializable(tab.toolCalls, [])
4220
- : [],
4221
- permissions: Array.isArray(tab.permissions)
4222
- ? cloneSerializable(tab.permissions, [])
4223
- : [],
4224
- plan: Array.isArray(tab.plan)
4225
- ? cloneSerializable(tab.plan, [])
4226
- : [],
4227
- usage: tab.usage ? cloneSerializable(tab.usage, null) : null,
4228
- terminals: Array.isArray(tab.terminals)
4229
- ? cloneSerializable(tab.terminals, [])
4230
- : []
4231
- };
4232
- });
4196
+ return cloneSerializable(entry.serialize(), null);
4197
+ }).filter(Boolean);
4233
4198
  return dedupeSerializedTabs(serializedTabs).tabs;
4234
4199
  }
4235
4200
 
4201
+ #serializePersistedTab(tab) {
4202
+ if (!tab || typeof tab !== 'object') {
4203
+ return null;
4204
+ }
4205
+ return {
4206
+ id: tab.id,
4207
+ agentId: tab.agentId,
4208
+ cwd: tab.cwd,
4209
+ acpSessionId: tab.acpSessionId,
4210
+ terminalSessionId: tab.terminalSessionId,
4211
+ createdAt: tab.createdAt,
4212
+ title: tab.title || '',
4213
+ currentModeId: tab.currentModeId || '',
4214
+ availableModes: Array.isArray(tab.availableModes)
4215
+ ? cloneSerializable(tab.availableModes, [])
4216
+ : [],
4217
+ availableCommands: Array.isArray(tab.availableCommands)
4218
+ ? cloneSerializable(tab.availableCommands, [])
4219
+ : [],
4220
+ configOptions: Array.isArray(tab.configOptions)
4221
+ ? cloneSerializable(tab.configOptions, [])
4222
+ : [],
4223
+ messages: Array.isArray(tab.messages)
4224
+ ? cloneSerializable(tab.messages, [])
4225
+ : [],
4226
+ toolCalls: Array.isArray(tab.toolCalls)
4227
+ ? cloneSerializable(tab.toolCalls, [])
4228
+ : [],
4229
+ permissions: Array.isArray(tab.permissions)
4230
+ ? cloneSerializable(tab.permissions, [])
4231
+ : [],
4232
+ plan: Array.isArray(tab.plan)
4233
+ ? cloneSerializable(tab.plan, [])
4234
+ : [],
4235
+ usage: tab.usage ? cloneSerializable(tab.usage, null) : null,
4236
+ terminals: Array.isArray(tab.terminals)
4237
+ ? cloneSerializable(tab.terminals, [])
4238
+ : []
4239
+ };
4240
+ }
4241
+
4236
4242
  #findOpenSerializedTabBySessionId(sessionId) {
4237
4243
  const targetSessionId = String(sessionId || '').trim();
4238
4244
  if (!targetSessionId) {
@@ -4244,7 +4250,9 @@ export class AcpManager {
4244
4250
  }
4245
4251
 
4246
4252
  getPersistedTabs() {
4247
- return this.#getSerializedTabs();
4253
+ return this.#getSerializedTabs()
4254
+ .map((tab) => this.#serializePersistedTab(tab))
4255
+ .filter(Boolean);
4248
4256
  }
4249
4257
 
4250
4258
  persistTabs() {