dsh-aiterm 0.5.0 → 0.5.12

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.
@@ -16,7 +16,7 @@
16
16
  */
17
17
 
18
18
  import { constants } from 'node:fs'
19
- import { access, appendFile, stat } from 'node:fs/promises'
19
+ import { access, appendFile, readdir, stat } from 'node:fs/promises'
20
20
  import { isAbsolute, join, resolve } from 'node:path'
21
21
 
22
22
  import { coded, ensureDir, readJsonIfPresent, writeJsonAtomic } from './util.js'
@@ -79,6 +79,14 @@ export class AutoLog {
79
79
  : ''
80
80
  /** Whether settings.json has been read; until then chunks are buffered. */
81
81
  this.loaded = false
82
+ /**
83
+ * True when an enabled switch was persisted by an older version without a
84
+ * human review marker. The runtime stays off until the human confirms; the
85
+ * original file and directory are preserved untouched.
86
+ */
87
+ this.needsReview = false
88
+ /** Whether the persisted value that needs review was enabled. */
89
+ this.legacyEnabled = false
82
90
  this.disposed = false
83
91
  /** Set after the first write failure so the warning is logged exactly once. */
84
92
  this.warned = false
@@ -127,7 +135,11 @@ export class AutoLog {
127
135
  * @returns {AutoLogState} current switch and directory.
128
136
  */
129
137
  get() {
130
- return { enabled: this.enabled === true, dir: this.dir }
138
+ return {
139
+ enabled: this.enabled === true,
140
+ dir: this.dir,
141
+ needsReview: this.needsReview === true,
142
+ }
131
143
  }
132
144
 
133
145
  /**
@@ -143,6 +155,31 @@ export class AutoLog {
143
155
  const nextEnabled = typeof opts.enabled === 'boolean' ? opts.enabled : this.enabled
144
156
  const dirProvided = opts.dir !== undefined && opts.dir !== null
145
157
  const nextDir = dirProvided ? this.validateDir(opts.dir) : this.dir
158
+ if (this.needsReview) {
159
+ const confirm = opts.confirmLegacy === true
160
+ if (nextEnabled) {
161
+ if (!confirm) {
162
+ throw coded(
163
+ 'LEGACY_AUTOLOG_CONFIRM_REQUIRED',
164
+ 'the automatic log switch was enabled by an older version; confirm the old directory explicitly before enabling it',
165
+ 409,
166
+ )
167
+ }
168
+ if (!dirProvided || nextDir !== this.dir) {
169
+ throw coded(
170
+ 'LEGACY_AUTOLOG_DIR_MISMATCH',
171
+ 'confirming a legacy automatic log setting requires its exact old directory',
172
+ 409,
173
+ )
174
+ }
175
+ } else if (dirProvided && !confirm) {
176
+ throw coded(
177
+ 'LEGACY_AUTOLOG_CONFIRM_REQUIRED',
178
+ 'confirm the legacy automatic log setting before changing its directory',
179
+ 409,
180
+ )
181
+ }
182
+ }
146
183
  this.dir = nextDir
147
184
  if (nextEnabled || dirProvided) {
148
185
  try {
@@ -154,6 +191,10 @@ export class AutoLog {
154
191
  }
155
192
  if (nextEnabled && this.enabled !== true) this.warned = false
156
193
  this.enabled = nextEnabled
194
+ // Any explicit human change (including confirming "keep off") reviews the
195
+ // legacy state; only then may the settings file be rewritten.
196
+ this.needsReview = false
197
+ this.legacyEnabled = false
157
198
  await this.persist()
158
199
  return this.get()
159
200
  }
@@ -237,6 +278,47 @@ export class AutoLog {
237
278
  this.preload = []
238
279
  }
239
280
 
281
+ /**
282
+ * One directory scan of existing log ids. Session-id allocation uses this so
283
+ * a new session cannot append to an old owner's `<id>.log`. A non-ENOENT
284
+ * directory error is propagated: the caller must fail allocation instead of
285
+ * guessing that no old files exist.
286
+ * @returns {Promise<Set<string>>} ids with an existing log file.
287
+ */
288
+ async listLogIds() {
289
+ if (this.dir.length === 0) return new Set()
290
+ let names
291
+ try {
292
+ names = await readdir(this.dir)
293
+ } catch (error) {
294
+ if (error?.code === 'ENOENT') return new Set()
295
+ throw error
296
+ }
297
+ const ids = new Set()
298
+ for (const name of names) {
299
+ if (!name.endsWith('.log')) continue
300
+ ids.add(name.slice(0, -'.log'.length))
301
+ }
302
+ return ids
303
+ }
304
+
305
+ /**
306
+ * Whether a log file already exists for an id. Session-id allocation uses
307
+ * this so a reused pre-upgrade id cannot silently append a new owner's output
308
+ * to an old log file.
309
+ * @param {string} sessionId session id.
310
+ * @returns {Promise<boolean>} true when a log file exists.
311
+ */
312
+ async hasLog(sessionId) {
313
+ if (this.dir.length === 0) return false
314
+ try {
315
+ await stat(this.fileFor(sessionId))
316
+ return true
317
+ } catch {
318
+ return false
319
+ }
320
+ }
321
+
240
322
  /**
241
323
  * @param {string} sessionId session id.
242
324
  * @returns {string} absolute log file path.
@@ -292,10 +374,25 @@ export class AutoLog {
292
374
  if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)) {
293
375
  const section = parsed[SETTINGS_KEY]
294
376
  if (section !== null && typeof section === 'object' && !Array.isArray(section)) {
295
- if (typeof section.enabled === 'boolean') this.enabled = section.enabled
377
+ const persistedEnabled = section.enabled === true
378
+ const reviewed = typeof section.reviewedAt === 'number' && Number.isFinite(section.reviewedAt)
296
379
  if (typeof section.dir === 'string' && section.dir.length > 0) {
297
380
  this.dir = this.resolveDir(section.dir.trim())
298
381
  }
382
+ if (persistedEnabled && !reviewed) {
383
+ // An older version (including one the AI could drive) left this
384
+ // enabled. Do not silently keep writing every owner's output, and do
385
+ // not rewrite/disable the persisted setting behind the user's back.
386
+ this.legacyEnabled = true
387
+ this.needsReview = true
388
+ this.enabled = false
389
+ this.log(
390
+ 'warn',
391
+ '[aiterm] automatic log files were enabled by an older version; they stay off until the human confirms the setting in the history panel',
392
+ )
393
+ } else {
394
+ this.enabled = persistedEnabled
395
+ }
299
396
  }
300
397
  }
301
398
  if (this.enabled) {
@@ -331,7 +428,13 @@ export class AutoLog {
331
428
  const next = {
332
429
  ...base,
333
430
  version: typeof base.version === 'number' && Number.isFinite(base.version) ? base.version : 1,
334
- [SETTINGS_KEY]: { enabled: this.enabled === true, dir: this.dir },
431
+ [SETTINGS_KEY]: {
432
+ enabled: this.enabled === true,
433
+ dir: this.dir,
434
+ // A human has explicitly reviewed this switch through the panel/tool
435
+ // gate. Older files have no marker and therefore need confirmation.
436
+ reviewedAt: Date.now(),
437
+ },
335
438
  }
336
439
  await writeJsonAtomic(this.settingsFile, next)
337
440
  }
@@ -11,9 +11,20 @@ import { boundInteger } from './util.js'
11
11
  /** AI permission modes: read-only, write-only, read-write. */
12
12
  export const AI_ACCESS_MODES = Object.freeze(['ro', 'wo', 'rw'])
13
13
 
14
+ /**
15
+ * Tool disclosure modes.
16
+ *
17
+ * `full` keeps the historical unconditional registration of every `aiterm_*`
18
+ * tool; `progressive` registers the discovery entry only and reveals the other
19
+ * groups per Agent after an explicit expansion. Any other value falls back to
20
+ * `full` so an upgrade can never silently reduce the toolset.
21
+ */
22
+ export const TOOL_DISCLOSURE_MODES = Object.freeze(['full', 'progressive'])
23
+
14
24
  /** Default row configuration. */
15
25
  export const DEFAULT_CONFIG = Object.freeze({
16
26
  enabled: true,
27
+ toolDisclosure: 'full',
17
28
  aiAccessDefault: 'rw',
18
29
  aiAutoLock: true,
19
30
  aiLockIdleMs: 30_000,
@@ -55,6 +66,9 @@ export function resolveConfig(input) {
55
66
  const policy = source.knownHostsPolicy
56
67
  return {
57
68
  enabled: source.enabled === undefined ? DEFAULT_CONFIG.enabled : source.enabled === true,
69
+ toolDisclosure: TOOL_DISCLOSURE_MODES.includes(source.toolDisclosure)
70
+ ? source.toolDisclosure
71
+ : DEFAULT_CONFIG.toolDisclosure,
58
72
  aiAccessDefault: AI_ACCESS_MODES.includes(source.aiAccessDefault) ? source.aiAccessDefault : DEFAULT_CONFIG.aiAccessDefault,
59
73
  aiAutoLock: source.aiAutoLock === undefined ? DEFAULT_CONFIG.aiAutoLock : source.aiAutoLock === true,
60
74
  aiLockIdleMs: boundInteger(source.aiLockIdleMs, DEFAULT_CONFIG.aiLockIdleMs, 1000, 3_600_000),
@@ -0,0 +1,357 @@
1
+ /**
2
+ * Per-Agent progressive disclosure state and grouping.
3
+ *
4
+ * The {@link createDisclosure} controller owns the "which groups has this Agent
5
+ * expanded" state plus the static grouping of every registered `aiterm_*` tool.
6
+ * It deliberately knows nothing about registration: the tool layer asks
7
+ * {@link Disclosure#isVisible} from the step-time `when` condition (progressive
8
+ * mode only) and exposes {@link Disclosure#discover} / {@link Disclosure#expand}
9
+ * through the always-resident discovery entry.
10
+ *
11
+ * Identity is the live DSH `Agent` object, never a session id: a child, a fork,
12
+ * or a freshly restored session that happens to reuse an id is a different
13
+ * object and therefore starts collapsed. A valid Agent must expose a non-empty
14
+ * string `id` (the installed DSH `Agent` contract); plugin contexts, context-like
15
+ * objects, and bare functions are refused. There is no parent-chain lookup here —
16
+ * the terminal owner rule stays in `registry.js` and is deliberately independent
17
+ * from what an Agent may see.
18
+ *
19
+ * Discovery never grants permission. It only decides which schemas are offered;
20
+ * every existing AI read/write mode, human takeover, and guard still applies at
21
+ * execution time.
22
+ */
23
+
24
+ /**
25
+ * Group name -> ordered member tool names.
26
+ *
27
+ * Every registered model-facing tool appears in exactly one group, in the order
28
+ * the discovery result should present it.
29
+ * @type {Readonly<Record<string, readonly string[]>>}
30
+ */
31
+ export const DISCLOSURE_GROUPS = Object.freeze({
32
+ session: Object.freeze([
33
+ 'aiterm_list',
34
+ 'aiterm_status',
35
+ 'aiterm_read',
36
+ 'aiterm_screen',
37
+ 'aiterm_screenshot',
38
+ 'aiterm_wait',
39
+ 'aiterm_send',
40
+ 'aiterm_release_control',
41
+ ]),
42
+ history: Object.freeze(['aiterm_history', 'aiterm_audit', 'aiterm_export']),
43
+ automation: Object.freeze(['aiterm_batch', 'aiterm_script_list', 'aiterm_script_save', 'aiterm_script_run']),
44
+ management: Object.freeze([
45
+ 'aiterm_connect',
46
+ 'aiterm_disconnect',
47
+ 'aiterm_reconnect',
48
+ 'aiterm_resize',
49
+ 'aiterm_close',
50
+ 'aiterm_autolog',
51
+ ]),
52
+ })
53
+
54
+ /** Stable presentation order of the groups. */
55
+ const GROUP_ORDER = Object.freeze(Object.keys(DISCLOSURE_GROUPS))
56
+
57
+ /** Tool name -> owning group. */
58
+ const GROUP_BY_TOOL = new Map()
59
+ for (const group of GROUP_ORDER) {
60
+ for (const name of DISCLOSURE_GROUPS[group]) GROUP_BY_TOOL.set(name, group)
61
+ }
62
+
63
+ /** Every discoverable tool name. */
64
+ const ALL_TOOLS = Object.freeze(GROUP_ORDER.flatMap((group) => DISCLOSURE_GROUPS[group]))
65
+
66
+ /**
67
+ * Cross-group prerequisites, surfaced in the discovery result.
68
+ *
69
+ * They are hints, not access control: a model may still expand any group, but
70
+ * history/automation/management calls need a session id that only the session
71
+ * group can provide. Hints never spell out tool names, because a name hidden
72
+ * from the Agent by another restriction must not leak through prose.
73
+ */
74
+ const DEPENDENCIES = Object.freeze([
75
+ Object.freeze({
76
+ group: 'session',
77
+ requires: Object.freeze([]),
78
+ hint: 'Start here: the session group lists sessions and returns the ids every other group needs. AI read-only/write-only modes and human control still refuse calls.',
79
+ }),
80
+ Object.freeze({
81
+ group: 'history',
82
+ requires: Object.freeze(['session']),
83
+ hint: 'Expand session first and list sessions: history, audit, and export need an existing session id.',
84
+ }),
85
+ Object.freeze({
86
+ group: 'automation',
87
+ requires: Object.freeze(['session']),
88
+ hint: 'Expand session first and list sessions: batch and scripts run against existing session ids.',
89
+ }),
90
+ Object.freeze({
91
+ group: 'management',
92
+ requires: Object.freeze(['session']),
93
+ hint: 'Expand session first: disconnect, reconnect, resize, and close need an existing session id; connect creates one and autolog is deployment-wide.',
94
+ }),
95
+ ])
96
+
97
+ /** Fixed reminders attached to every discovery result. */
98
+ const HINTS = Object.freeze([
99
+ 'Expansion reveals tool schemas only; it never grants permission. Existing read-only/write-only AI modes and human control still refuse tool calls.',
100
+ 'Expansion applies to the next model step; a tool expanded in this step is not callable until the next step.',
101
+ 'List sessions from the session group before history, automation, or management operations that use a session id.',
102
+ ])
103
+
104
+ const NEXT_STEP = 'Expansion takes effect on the next model step.'
105
+ const FULL_MODE_STEP = 'Full mode: every aiterm tool is registered unconditionally for every Agent.'
106
+
107
+ /**
108
+ * A live DSH Agent exposes `id` as a branded non-empty string (`SessionId`).
109
+ * A plugin context, a context-like object, an array, or a bare function is not
110
+ * an Agent, even if it is an object.
111
+ * @param {unknown} value candidate Agent.
112
+ * @returns {boolean} whether the value is a live Agent handle.
113
+ */
114
+ function isAgent(value) {
115
+ if (value === null || typeof value !== 'object') return false
116
+ const id = value.id
117
+ return typeof id === 'string' && id.trim().length > 0
118
+ }
119
+
120
+ /**
121
+ * @param {unknown} mode configured mode.
122
+ * @returns {'full' | 'progressive'} the effective mode; anything else is full.
123
+ */
124
+ function normalizeMode(mode) {
125
+ return mode === 'progressive' ? 'progressive' : 'full'
126
+ }
127
+
128
+ /**
129
+ * @returns {Array<{ group: string, requires: string[], hint: string }>} fresh dependency copies.
130
+ */
131
+ function dependencyList() {
132
+ return DEPENDENCIES.map(({ group, requires, hint }) => ({ group, requires: [...requires], hint }))
133
+ }
134
+
135
+ /**
136
+ * @param {'full' | 'progressive'} mode effective mode.
137
+ * @param {string} error machine-readable refusal.
138
+ * @param {string[]} [expanded] expansion state to report truthfully.
139
+ * @param {Record<string, unknown>} [extra] additional fields.
140
+ * @returns {Record<string, any>} a fail-closed result.
141
+ */
142
+ function refusal(mode, error, expanded = [], extra = {}) {
143
+ return {
144
+ ok: false,
145
+ error,
146
+ mode,
147
+ groups: [],
148
+ expanded: [...expanded],
149
+ visible: [],
150
+ dependencies: dependencyList(),
151
+ hints: [...HINTS],
152
+ nextStep: mode === 'full' ? FULL_MODE_STEP : NEXT_STEP,
153
+ ...extra,
154
+ }
155
+ }
156
+
157
+ /**
158
+ * @param {Set<string>} expandedGroups expanded group names.
159
+ * @returns {string[]} those names in presentation order.
160
+ */
161
+ function orderExpanded(expandedGroups) {
162
+ return GROUP_ORDER.filter((group) => expandedGroups.has(group))
163
+ }
164
+
165
+ /**
166
+ * @param {Array<{ group: string, tools: string[] }>} groups catalogue.
167
+ * @param {string[]} expanded expanded group names.
168
+ * @returns {string[]} effective names currently offered.
169
+ */
170
+ function visibleNames(groups, expanded) {
171
+ const byGroup = new Map(groups.map(({ group, tools }) => [group, tools]))
172
+ return expanded.flatMap((group) => byGroup.get(group) ?? [])
173
+ }
174
+
175
+ /**
176
+ * Create the per-Agent disclosure controller.
177
+ *
178
+ * @param {{ mode?: unknown, tools?: { get(name: string, agent?: object): object | undefined } }} options
179
+ * `mode` is the configured `toolDisclosure` value (`full` unless exactly
180
+ * `progressive`); `tools` is the DSH tool registry (only `get` is used).
181
+ * @returns {{
182
+ * isVisible(agent: unknown, name: string): boolean,
183
+ * discover(agent: unknown): Record<string, any>,
184
+ * expand(agent: unknown, group: unknown): Record<string, any>,
185
+ * forget(agent: unknown): void,
186
+ * dispose(): void,
187
+ * }} controller.
188
+ */
189
+ export function createDisclosure({ mode, tools } = {}) {
190
+ const disclosureMode = normalizeMode(mode)
191
+ /** @type {WeakMap<object, Set<string>>} */
192
+ let expandedByAgent = new WeakMap()
193
+ let disposed = false
194
+
195
+ /**
196
+ * Resolve the intersection of the static catalogue and the effective Agent view.
197
+ * @param {object} agent valid Agent object.
198
+ * @returns {{ groups: Array<{ group: string, tools: string[] }>, available: boolean }} catalogue.
199
+ */
200
+ function catalogue(agent) {
201
+ const get = tools?.get
202
+ if (typeof get !== 'function') {
203
+ return { groups: GROUP_ORDER.map((group) => ({ group, tools: [] })), available: false }
204
+ }
205
+ /** @type {Set<string> | null} */
206
+ let effective = null
207
+ try {
208
+ const resolved = new Set()
209
+ for (const name of ALL_TOOLS) {
210
+ const scoped = get.call(tools, name, agent)
211
+ if (scoped === undefined || scoped === null) continue
212
+ const global = get.call(tools, name)
213
+ if (global === undefined || global === null) continue
214
+ if (scoped !== global) continue
215
+ resolved.add(name)
216
+ }
217
+ effective = resolved
218
+ } catch {
219
+ // Reading the effective view must never throw into a step-time condition
220
+ // or the discovery tool: treat the whole view as unavailable.
221
+ effective = null
222
+ }
223
+ return {
224
+ groups: GROUP_ORDER.map((group) => ({
225
+ group,
226
+ tools: effective === null ? [] : DISCLOSURE_GROUPS[group].filter((name) => effective.has(name)),
227
+ })),
228
+ available: effective !== null,
229
+ }
230
+ }
231
+
232
+ /**
233
+ * @param {object} agent valid Agent object.
234
+ * @returns {string[]} expanded groups (all groups in full mode).
235
+ */
236
+ function expandedGroups(agent) {
237
+ if (disclosureMode === 'full') return [...GROUP_ORDER]
238
+ const groups = expandedByAgent.get(agent)
239
+ return groups === undefined ? [] : orderExpanded(groups)
240
+ }
241
+
242
+ /**
243
+ * Shape one successful result from an already verified catalogue.
244
+ * @param {{ groups: Array<{ group: string, tools: string[] }> }} catalogue resolved catalogue.
245
+ * @param {object} agent valid Agent object.
246
+ * @param {Record<string, unknown>} [extra] extra result fields.
247
+ * @returns {Record<string, any>} discover/expand payload.
248
+ */
249
+ function describeFrom({ groups }, agent, extra = {}) {
250
+ const expanded = expandedGroups(agent)
251
+ return {
252
+ ok: true,
253
+ mode: disclosureMode,
254
+ groups,
255
+ expanded,
256
+ visible: visibleNames(groups, expanded),
257
+ dependencies: dependencyList(),
258
+ hints: [...HINTS],
259
+ nextStep: disclosureMode === 'full' ? FULL_MODE_STEP : NEXT_STEP,
260
+ ...extra,
261
+ }
262
+ }
263
+
264
+ return {
265
+ /**
266
+ * Whether this tool should be registered as visible for this Agent.
267
+ *
268
+ * Step-time condition: synchronous, side-effect free, and it never throws.
269
+ * It only inspects the Agent's own expansion state; DSH's own restrictions
270
+ * still apply on top, so a true result never widens the effective view.
271
+ * @param {unknown} agent calling Agent.
272
+ * @param {string} name tool name.
273
+ * @returns {boolean} visible for this Agent.
274
+ */
275
+ isVisible(agent, name) {
276
+ if (disposed) return false
277
+ const group = GROUP_BY_TOOL.get(name)
278
+ if (group === undefined) return false
279
+ if (!isAgent(agent)) return false
280
+ if (disclosureMode === 'full') return true
281
+ const groups = expandedByAgent.get(agent)
282
+ return groups !== undefined && groups.has(group)
283
+ },
284
+
285
+ /**
286
+ * Describe the discoverable groups and what this Agent has expanded.
287
+ *
288
+ * If the effective Agent view cannot be read, the result is a refusal
289
+ * (`catalog-unavailable`) rather than an empty success, so the discovery
290
+ * entry never claims that nothing is available when it simply could not
291
+ * verify.
292
+ * @param {unknown} agent calling Agent.
293
+ * @returns {Record<string, any>} discovery result.
294
+ */
295
+ discover(agent) {
296
+ if (disposed) return refusal(disclosureMode, 'disposed')
297
+ if (!isAgent(agent)) return refusal(disclosureMode, 'missing-agent')
298
+ const resolved = catalogue(agent)
299
+ if (!resolved.available) return refusal(disclosureMode, 'catalog-unavailable', expandedGroups(agent))
300
+ return describeFrom(resolved, agent)
301
+ },
302
+
303
+ /**
304
+ * Expand one group for this Agent. Repeated calls are idempotent.
305
+ *
306
+ * The catalogue is verified before any state changes: an unreadable view
307
+ * or a group whose members are all hidden from this Agent is refused and
308
+ * leaves the Agent's expansion state untouched.
309
+ * @param {unknown} agent calling Agent.
310
+ * @param {unknown} group group name.
311
+ * @returns {Record<string, any>} expansion result.
312
+ */
313
+ expand(agent, group) {
314
+ if (disposed) return refusal(disclosureMode, 'disposed')
315
+ if (!isAgent(agent)) return refusal(disclosureMode, 'missing-agent')
316
+ if (typeof group !== 'string' || !Object.hasOwn(DISCLOSURE_GROUPS, group)) {
317
+ return refusal(disclosureMode, 'unknown-group', expandedGroups(agent))
318
+ }
319
+ const resolved = catalogue(agent)
320
+ if (!resolved.available) {
321
+ return refusal(disclosureMode, 'catalog-unavailable', expandedGroups(agent), { group })
322
+ }
323
+ const members = resolved.groups.find((entry) => entry.group === group)?.tools ?? []
324
+ if (members.length === 0) {
325
+ return refusal(disclosureMode, 'no-visible-tools', expandedGroups(agent), { group })
326
+ }
327
+ if (disclosureMode === 'progressive') {
328
+ let groups = expandedByAgent.get(agent)
329
+ if (groups === undefined) {
330
+ groups = new Set()
331
+ expandedByAgent.set(agent, groups)
332
+ }
333
+ groups.add(group)
334
+ }
335
+ return describeFrom(resolved, agent, { group })
336
+ },
337
+
338
+ /**
339
+ * Drop every expansion for one Agent. Non-Agent values are a no-op.
340
+ * @param {unknown} agent Agent whose state should be cleared.
341
+ * @returns {void}
342
+ */
343
+ forget(agent) {
344
+ if (!isAgent(agent)) return
345
+ expandedByAgent.delete(agent)
346
+ },
347
+
348
+ /**
349
+ * Drop all state and stop disclosing. Idempotent.
350
+ * @returns {void}
351
+ */
352
+ dispose() {
353
+ disposed = true
354
+ expandedByAgent = new WeakMap()
355
+ },
356
+ }
357
+ }