dsh-tg-bridge 1.28.0 → 1.30.0
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/aset-profile.mjs +9 -2
- package/bridge.mjs +468 -461
- package/commands-registry.mjs +65 -65
- package/context-meter.mjs +84 -0
- package/control/agents.mjs +80 -55
- package/control/cmd-bridge.mjs +416 -409
- package/control/cmd-views.mjs +456 -441
- package/control/release.mjs +170 -156
- package/control.mjs +123 -123
- package/cost.mjs +179 -0
- package/handle-message.mjs +498 -499
- package/help-explain.mjs +42 -42
- package/i18n/en/core.mjs +5 -1
- package/i18n/en/cost.mjs +17 -0
- package/i18n/en/ctrl.mjs +1 -0
- package/i18n/en/sandbox.mjs +10 -0
- package/i18n/en.mjs +11 -9
- package/i18n/ru/core.mjs +5 -1
- package/i18n/ru/cost.mjs +17 -0
- package/i18n/ru/ctrl.mjs +1 -0
- package/i18n/ru/sandbox.mjs +10 -0
- package/i18n/ru.mjs +11 -9
- package/i18n/zh/core.mjs +5 -1
- package/i18n/zh/cost.mjs +17 -0
- package/i18n/zh/ctrl.mjs +1 -0
- package/i18n/zh/sandbox.mjs +10 -0
- package/i18n/zh.mjs +3 -1
- package/install-check.mjs +200 -0
- package/menu-card.mjs +220 -220
- package/package.json +7 -1
- package/panel.mjs +208 -193
- package/price-cache.mjs +57 -0
- package/prices.mjs +23 -9
- package/progress.mjs +401 -353
- package/sandbox-note.mjs +141 -0
- package/thoughts.mjs +262 -244
- package/turn-events.mjs +74 -0
package/aset-profile.mjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { createHash } from 'node:crypto';
|
|
16
16
|
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
17
17
|
import { homedir } from 'node:os';
|
|
18
|
-
import { join } from 'node:path';
|
|
18
|
+
import { join, resolve, sep } from 'node:path';
|
|
19
19
|
import { setAgentPreset, setModel, setSubagents } from './patch-rows.mjs';
|
|
20
20
|
import { sandboxModeOf, setPermission } from './permission-rows.mjs';
|
|
21
21
|
|
|
@@ -160,10 +160,17 @@ export function pruneDerived(keep = [], { profiles = PROFILES } = {}) {
|
|
|
160
160
|
} catch {
|
|
161
161
|
return removed;
|
|
162
162
|
}
|
|
163
|
+
// A recursive delete needs a containment check, not just a name pattern: the
|
|
164
|
+
// root comes from `DSH_HOME`, and `DSH_HOME=C:\` would put "derived profiles"
|
|
165
|
+
// wherever that machine happens to have a matching directory. The prefix check
|
|
166
|
+
// stays as the second line of defence.
|
|
167
|
+
const root = resolve(profiles);
|
|
163
168
|
for (const entry of entries) {
|
|
164
169
|
if (!entry.isDirectory() || !entry.name.startsWith(DERIVED_PREFIX) || wanted.has(entry.name)) continue;
|
|
170
|
+
const target = resolve(join(profiles, entry.name));
|
|
171
|
+
if (target !== root && !target.startsWith(root.endsWith(sep) ? root : root + sep)) continue;
|
|
165
172
|
try {
|
|
166
|
-
rmSync(
|
|
173
|
+
rmSync(target, { recursive: true, force: true });
|
|
167
174
|
removed.push(entry.name);
|
|
168
175
|
} catch {
|
|
169
176
|
// A profile in use by a running turn stays until the next sweep.
|