@aiwayds/dsh-opentui 0.17.1 → 0.17.3
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/CHANGELOG.md +17 -0
- package/dist/client/index.js +605 -146
- package/dist/locales/en.json +4 -1
- package/dist/locales/zh-CN.json +4 -1
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -989,10 +989,283 @@ var init_host_probe = __esm(() => {
|
|
|
989
989
|
init_mux_frame();
|
|
990
990
|
});
|
|
991
991
|
|
|
992
|
+
// src/client/append-system.ts
|
|
993
|
+
import { chmodSync as chmodSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, renameSync as renameSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
994
|
+
import { homedir } from "os";
|
|
995
|
+
import { join as join3 } from "path";
|
|
996
|
+
function defaultDshHome() {
|
|
997
|
+
return process.env.DSH_HOME || join3(homedir(), ".dsh");
|
|
998
|
+
}
|
|
999
|
+
function appendSystemPath(home = defaultDshHome()) {
|
|
1000
|
+
return join3(home, "APPEND_SYSTEM.md");
|
|
1001
|
+
}
|
|
1002
|
+
function appendSystemPresetBlock() {
|
|
1003
|
+
return `${APPEND_SYSTEM_MARKER} \u2014 managed block (client-owned; the client appends it once and never rewrites other lines).
|
|
1004
|
+
${APPEND_SYSTEM_MARKER} persona suffix = $DSH_HOME/APPEND_SYSTEM.md, evaluated by the host at boot (!!js guarded read; empty file => empty section => dropped).
|
|
1005
|
+
- insert:
|
|
1006
|
+
- id: ${APPEND_SYSTEM_ROW_ID}
|
|
1007
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
1008
|
+
config:
|
|
1009
|
+
id: ${APPEND_SYSTEM_PRESET_ID}
|
|
1010
|
+
name: Standard + Append
|
|
1011
|
+
description: The shipped standard preset plus the user's APPEND_SYSTEM.md appended to the system prompt.
|
|
1012
|
+
order: 5
|
|
1013
|
+
plugins:
|
|
1014
|
+
- id: persona
|
|
1015
|
+
name: '@deepseek-ai/dsh-persona'
|
|
1016
|
+
config:
|
|
1017
|
+
prefix: You are a coding agent powered by the {{model}} model.
|
|
1018
|
+
suffix: !!js "${APPEND_SYSTEM_SUFFIX_EXPR}"
|
|
1019
|
+
- id: agent-instructions
|
|
1020
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
1021
|
+
config:
|
|
1022
|
+
maxBytes: 65536
|
|
1023
|
+
- id: time-context
|
|
1024
|
+
name: '@deepseek-ai/dsh-time-context'
|
|
1025
|
+
- id: tool-bash
|
|
1026
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
1027
|
+
disabled: !!js process.platform === 'win32'
|
|
1028
|
+
- id: tool-pwsh
|
|
1029
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
1030
|
+
disabled: !!js process.platform !== 'win32'
|
|
1031
|
+
- id: tool-fs
|
|
1032
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
1033
|
+
config:
|
|
1034
|
+
# Set false to drop the apply_patch tool beside edit.
|
|
1035
|
+
applyPatch: false
|
|
1036
|
+
- id: tool-fs-search
|
|
1037
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
1038
|
+
config:
|
|
1039
|
+
sampleOverCapGlobResults: false
|
|
1040
|
+
- id: tool-jobs
|
|
1041
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
1042
|
+
- id: tool-schedule
|
|
1043
|
+
name: '@deepseek-ai/dsh-tool-schedule'
|
|
1044
|
+
- id: skill-filesystem
|
|
1045
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
1046
|
+
config:
|
|
1047
|
+
customSkillDirs:
|
|
1048
|
+
- !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
|
|
1049
|
+
- id: tool-skill
|
|
1050
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
1051
|
+
- id: command-goal
|
|
1052
|
+
name: '@deepseek-ai/dsh-command-goal'
|
|
1053
|
+
- id: tool-goal
|
|
1054
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
1055
|
+
- id: planning
|
|
1056
|
+
name: cordis:group
|
|
1057
|
+
group: true
|
|
1058
|
+
isolate:
|
|
1059
|
+
planMode: true
|
|
1060
|
+
config:
|
|
1061
|
+
- id: plan-mode
|
|
1062
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
1063
|
+
config:
|
|
1064
|
+
section: |
|
|
1065
|
+
You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement \u2014 including an answer confirming something you asked \u2014 approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
1066
|
+
|
|
1067
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
1068
|
+
|
|
1069
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
1070
|
+
|
|
1071
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
1072
|
+
|
|
1073
|
+
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
1074
|
+
|
|
1075
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
1076
|
+
- id: compaction
|
|
1077
|
+
name: cordis:group
|
|
1078
|
+
group: true
|
|
1079
|
+
isolate:
|
|
1080
|
+
compaction: true
|
|
1081
|
+
toolResultPruner: true
|
|
1082
|
+
config:
|
|
1083
|
+
- id: compaction-basic
|
|
1084
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
1085
|
+
- id: command-compact
|
|
1086
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
1087
|
+
- id: tool-result-pruner
|
|
1088
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
1089
|
+
config:
|
|
1090
|
+
thresholdChars: 8192
|
|
1091
|
+
headChars: 4096
|
|
1092
|
+
tailChars: 1024
|
|
1093
|
+
- id: delegation
|
|
1094
|
+
name: cordis:group
|
|
1095
|
+
group: true
|
|
1096
|
+
isolate:
|
|
1097
|
+
workflowEngine: true
|
|
1098
|
+
config:
|
|
1099
|
+
- id: tool-subagent-control
|
|
1100
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
1101
|
+
config:
|
|
1102
|
+
interrupt: false
|
|
1103
|
+
- id: tool-subagent
|
|
1104
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
1105
|
+
config:
|
|
1106
|
+
provider: spawn
|
|
1107
|
+
toolName: subagent
|
|
1108
|
+
modelSelection: true
|
|
1109
|
+
modelDiscovery: true
|
|
1110
|
+
- id: tool-subagent-fork
|
|
1111
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
1112
|
+
config:
|
|
1113
|
+
provider: fork
|
|
1114
|
+
toolName: subagent_fork
|
|
1115
|
+
- id: workflow-ptc
|
|
1116
|
+
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
1117
|
+
config:
|
|
1118
|
+
provider: spawn
|
|
1119
|
+
- id: tool-workflow
|
|
1120
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
1121
|
+
- id: tool-ask-user
|
|
1122
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
1123
|
+
- id: tool-todo
|
|
1124
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
1125
|
+
config:
|
|
1126
|
+
allowParallelInProgress: true
|
|
1127
|
+
- id: tool-web
|
|
1128
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
1129
|
+
config:
|
|
1130
|
+
fetch: true
|
|
1131
|
+
searchTimeoutMs: 60000
|
|
1132
|
+
- id: present
|
|
1133
|
+
name: '@deepseek-ai/dsh-tool-present'
|
|
1134
|
+
- id: tool-office
|
|
1135
|
+
name: '@deepseek-ai/dsh-tool-office'
|
|
1136
|
+
- id: tool-plugin-manager
|
|
1137
|
+
name: '@deepseek-ai/dsh-plugin-manager/tools'
|
|
1138
|
+
disabled: !!js "!ctx.get('profileContext')"
|
|
1139
|
+
- id: tool-plugin-market
|
|
1140
|
+
name: '@deepseek-ai/dsh-plugin-market/tools'
|
|
1141
|
+
disabled: true
|
|
1142
|
+
`;
|
|
1143
|
+
}
|
|
1144
|
+
function writeAtomically(path, content, mode) {
|
|
1145
|
+
mkdirSync2(join3(path, ".."), { recursive: true });
|
|
1146
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
1147
|
+
try {
|
|
1148
|
+
writeFileSync2(tmp, content, { mode });
|
|
1149
|
+
renameSync2(tmp, path);
|
|
1150
|
+
} catch (error) {
|
|
1151
|
+
try {
|
|
1152
|
+
unlinkSync2(tmp);
|
|
1153
|
+
} catch {}
|
|
1154
|
+
throw error;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
function ensureAppendSystemFile(path = appendSystemPath()) {
|
|
1158
|
+
try {
|
|
1159
|
+
readFileSync2(path, "utf8");
|
|
1160
|
+
return "kept";
|
|
1161
|
+
} catch {
|
|
1162
|
+
writeAtomically(path, APPEND_SYSTEM_TEMPLATE, 420);
|
|
1163
|
+
try {
|
|
1164
|
+
chmodSync2(path, 420);
|
|
1165
|
+
} catch {}
|
|
1166
|
+
return "seeded";
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
function profilePatchPath(home, profile) {
|
|
1170
|
+
return join3(home, "profiles", profile, "cordis.patch.yml");
|
|
1171
|
+
}
|
|
1172
|
+
function managedSpan(lines) {
|
|
1173
|
+
const start = lines.findIndex((line) => line.startsWith(APPEND_SYSTEM_MARKER));
|
|
1174
|
+
if (start < 0)
|
|
1175
|
+
return;
|
|
1176
|
+
let end = lines.length;
|
|
1177
|
+
let seenOwnInsert = false;
|
|
1178
|
+
for (let i = start + 1;i < lines.length; i++) {
|
|
1179
|
+
if (/^- /.test(lines[i])) {
|
|
1180
|
+
if (!seenOwnInsert) {
|
|
1181
|
+
seenOwnInsert = true;
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
end = i;
|
|
1185
|
+
break;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
return [start, end];
|
|
1189
|
+
}
|
|
1190
|
+
function provisionAppendSystem(home, profile) {
|
|
1191
|
+
let preText;
|
|
1192
|
+
try {
|
|
1193
|
+
preText = readFileSync2(profilePatchPath(home, profile), "utf8");
|
|
1194
|
+
} catch {
|
|
1195
|
+
preText = undefined;
|
|
1196
|
+
}
|
|
1197
|
+
const patch = syncAppendSystemPreset(home, profile);
|
|
1198
|
+
if (preText !== undefined && managedSpan(preText.split(`
|
|
1199
|
+
`)) !== undefined) {
|
|
1200
|
+
return { patch, file: "kept" };
|
|
1201
|
+
}
|
|
1202
|
+
return { patch, file: ensureAppendSystemFile(appendSystemPath(home)) };
|
|
1203
|
+
}
|
|
1204
|
+
function syncAppendSystemPreset(home, profile) {
|
|
1205
|
+
const path = profilePatchPath(home, profile);
|
|
1206
|
+
let before;
|
|
1207
|
+
try {
|
|
1208
|
+
before = readFileSync2(path, "utf8");
|
|
1209
|
+
} catch {
|
|
1210
|
+
return { status: "skipped", detail: `no profile patch at ${path}` };
|
|
1211
|
+
}
|
|
1212
|
+
const lines = before.split(`
|
|
1213
|
+
`);
|
|
1214
|
+
const span = managedSpan(lines);
|
|
1215
|
+
const outside = (needle) => {
|
|
1216
|
+
for (let i = 0;i < lines.length; i++) {
|
|
1217
|
+
if (span !== undefined && i >= span[0] && i < span[1])
|
|
1218
|
+
continue;
|
|
1219
|
+
if (lines[i].includes(needle))
|
|
1220
|
+
return `line ${i + 1}: ${lines[i].trim()}`;
|
|
1221
|
+
}
|
|
1222
|
+
return;
|
|
1223
|
+
};
|
|
1224
|
+
for (const needle of [APPEND_SYSTEM_PRESET_ID, APPEND_SYSTEM_ROW_ID]) {
|
|
1225
|
+
const hit = outside(needle);
|
|
1226
|
+
if (hit !== undefined) {
|
|
1227
|
+
return { status: "collision", detail: `${needle} already declared (${hit})` };
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
if (span !== undefined)
|
|
1231
|
+
return { status: "present" };
|
|
1232
|
+
const separator = before.length === 0 || before.endsWith(`
|
|
1233
|
+
|
|
1234
|
+
`) ? "" : before.endsWith(`
|
|
1235
|
+
`) ? `
|
|
1236
|
+
` : `
|
|
1237
|
+
|
|
1238
|
+
`;
|
|
1239
|
+
const next = `${before}${separator}${appendSystemPresetBlock()}`;
|
|
1240
|
+
writeAtomically(path, next, 384);
|
|
1241
|
+
return { status: "added" };
|
|
1242
|
+
}
|
|
1243
|
+
var APPEND_SYSTEM_PRESET_ID = "opentui-append-system", APPEND_SYSTEM_ROW_ID, APPEND_SYSTEM_MARKER = "# dsh-opentui:append-system", APPEND_SYSTEM_TEMPLATE = `# APPEND_SYSTEM.md \u2014 standing system-prompt additions
|
|
1244
|
+
|
|
1245
|
+
The content of this file is appended to the system prompt of every main
|
|
1246
|
+
session the dsh-opentui client creates (ported from dsh-tui-pi).
|
|
1247
|
+
|
|
1248
|
+
The file is user-owned: the client seeds it once and never rewrites it.
|
|
1249
|
+
Edits apply to sessions created after the next client start; clearing or
|
|
1250
|
+
deleting this file switches the append off (it is not re-seeded).
|
|
1251
|
+
|
|
1252
|
+
## Vocabulary
|
|
1253
|
+
|
|
1254
|
+
- "subagent" means the registered subagents only; never invent or use
|
|
1255
|
+
unregistered subagents.
|
|
1256
|
+
|
|
1257
|
+
## Additions
|
|
1258
|
+
|
|
1259
|
+
Write your persistent instructions below this line.
|
|
1260
|
+
`, APPEND_SYSTEM_SUFFIX_EXPR = `((req, path) => { try { const text = req('node:fs').readFileSync(path.join(process.env.DSH_HOME || ((process.env.HOME || '') + '/.dsh'), 'APPEND_SYSTEM.md'), 'utf8'); return text.length > 65536 ? text.slice(0, 65536) + String.fromCharCode(10) + '[append-system: truncated at 64KiB]' : text } catch { return '' } })(process.getBuiltinModule('node:module').createRequire(baseUrl), process.getBuiltinModule('node:path'))`;
|
|
1261
|
+
var init_append_system = __esm(() => {
|
|
1262
|
+
APPEND_SYSTEM_ROW_ID = `preset-${APPEND_SYSTEM_PRESET_ID}`;
|
|
1263
|
+
});
|
|
1264
|
+
|
|
992
1265
|
// src/client/cookie-mint.ts
|
|
993
1266
|
import { createHash, createHmac } from "crypto";
|
|
994
|
-
import { readFileSync as
|
|
995
|
-
import { join as
|
|
1267
|
+
import { readFileSync as readFileSync3, statSync as statSync2 } from "fs";
|
|
1268
|
+
import { join as join4 } from "path";
|
|
996
1269
|
function ownerCookieName(authority) {
|
|
997
1270
|
return "dsh-auth-" + base64url(createHash("sha256").update(authority).digest());
|
|
998
1271
|
}
|
|
@@ -1010,14 +1283,14 @@ function mintOwnerCookie(options) {
|
|
|
1010
1283
|
return `${ownerCookieName(authority)}=v1.${body}.${signature}`;
|
|
1011
1284
|
}
|
|
1012
1285
|
function readGrantSecret(home) {
|
|
1013
|
-
const path =
|
|
1286
|
+
const path = join4(home, ".credentials.yaml");
|
|
1014
1287
|
const deadline = Date.now() + RETRY_WINDOW_MS;
|
|
1015
1288
|
let sawFile = false;
|
|
1016
1289
|
while (true) {
|
|
1017
1290
|
let file = "";
|
|
1018
1291
|
try {
|
|
1019
1292
|
assertOwnerOnly(path);
|
|
1020
|
-
file =
|
|
1293
|
+
file = readFileSync3(path, "utf8");
|
|
1021
1294
|
sawFile = true;
|
|
1022
1295
|
} catch (error) {
|
|
1023
1296
|
if (error instanceof CredentialsFileInsecureError)
|
|
@@ -1245,7 +1518,7 @@ __export(exports_lifecycle, {
|
|
|
1245
1518
|
MintUnavailableError: () => MintUnavailableError,
|
|
1246
1519
|
ProfileMissingError: () => ProfileMissingError,
|
|
1247
1520
|
__internals: () => __internals,
|
|
1248
|
-
defaultDshHome: () =>
|
|
1521
|
+
defaultDshHome: () => defaultDshHome2,
|
|
1249
1522
|
ensureHost: () => ensureHost,
|
|
1250
1523
|
isListening: () => isListening,
|
|
1251
1524
|
pidAlive: () => pidAlive,
|
|
@@ -1253,10 +1526,10 @@ __export(exports_lifecycle, {
|
|
|
1253
1526
|
resolveIdleExitSec: () => resolveIdleExitSec
|
|
1254
1527
|
});
|
|
1255
1528
|
import { spawn as spawn2 } from "child_process";
|
|
1256
|
-
import { existsSync as existsSync3, linkSync, mkdirSync as
|
|
1257
|
-
import { homedir } from "os";
|
|
1529
|
+
import { existsSync as existsSync3, linkSync, mkdirSync as mkdirSync3, readFileSync as readFileSync4, renameSync as renameSync3, rmSync, writeFileSync as writeFileSync3 } from "fs";
|
|
1530
|
+
import { homedir as homedir2 } from "os";
|
|
1258
1531
|
import { connect as netConnect, Server } from "net";
|
|
1259
|
-
import { join as
|
|
1532
|
+
import { join as join5 } from "path";
|
|
1260
1533
|
function resolveIdleExitMs(explicitSec) {
|
|
1261
1534
|
if (explicitSec !== undefined && Number.isFinite(explicitSec)) {
|
|
1262
1535
|
return Math.max(0, Math.round(explicitSec * 1000));
|
|
@@ -1284,11 +1557,11 @@ ${lines.slice(-ERROR_TAIL_LINES).join(`
|
|
|
1284
1557
|
function registryKey(dshHome, profile) {
|
|
1285
1558
|
return `${dshHome}\x00${profile}`;
|
|
1286
1559
|
}
|
|
1287
|
-
function
|
|
1288
|
-
return process.env.DSH_HOME ||
|
|
1560
|
+
function defaultDshHome2() {
|
|
1561
|
+
return process.env.DSH_HOME || join5(homedir2(), ".dsh");
|
|
1289
1562
|
}
|
|
1290
1563
|
function lockPathFor(dshHome, profile) {
|
|
1291
|
-
return
|
|
1564
|
+
return join5(dshHome, `opentui-host.${profile}.json`);
|
|
1292
1565
|
}
|
|
1293
1566
|
function pidAlive(pid) {
|
|
1294
1567
|
try {
|
|
@@ -1341,7 +1614,7 @@ function getFreePort() {
|
|
|
1341
1614
|
}
|
|
1342
1615
|
function readLock(dshHome, profile) {
|
|
1343
1616
|
try {
|
|
1344
|
-
const raw = JSON.parse(
|
|
1617
|
+
const raw = JSON.parse(readFileSync4(lockPathFor(dshHome, profile), "utf8"));
|
|
1345
1618
|
if (typeof raw.pid !== "number" || typeof raw.port !== "number")
|
|
1346
1619
|
return null;
|
|
1347
1620
|
return {
|
|
@@ -1357,7 +1630,7 @@ function readLock(dshHome, profile) {
|
|
|
1357
1630
|
}
|
|
1358
1631
|
}
|
|
1359
1632
|
function writeLock(dshHome, profile, host) {
|
|
1360
|
-
|
|
1633
|
+
mkdirSync3(dshHome, { recursive: true });
|
|
1361
1634
|
const path = lockPathFor(dshHome, profile);
|
|
1362
1635
|
const payload = {
|
|
1363
1636
|
pid: host.pid,
|
|
@@ -1367,9 +1640,9 @@ function writeLock(dshHome, profile, host) {
|
|
|
1367
1640
|
profile
|
|
1368
1641
|
};
|
|
1369
1642
|
const tmp = `${path}.tmp`;
|
|
1370
|
-
|
|
1643
|
+
writeFileSync3(tmp, JSON.stringify(payload, null, 2) + `
|
|
1371
1644
|
`);
|
|
1372
|
-
|
|
1645
|
+
renameSync3(tmp, path);
|
|
1373
1646
|
}
|
|
1374
1647
|
function clearOurLock(host) {
|
|
1375
1648
|
if (!host.lockOwned)
|
|
@@ -1380,7 +1653,7 @@ function clearOurLock(host) {
|
|
|
1380
1653
|
}
|
|
1381
1654
|
}
|
|
1382
1655
|
function claimBootLock(dshHome, profile) {
|
|
1383
|
-
|
|
1656
|
+
mkdirSync3(dshHome, { recursive: true });
|
|
1384
1657
|
const path = lockPathFor(dshHome, profile);
|
|
1385
1658
|
const payload = {
|
|
1386
1659
|
pid: process.pid,
|
|
@@ -1391,7 +1664,7 @@ function claimBootLock(dshHome, profile) {
|
|
|
1391
1664
|
booting: true
|
|
1392
1665
|
};
|
|
1393
1666
|
const tmp = `${path}.claim-${process.pid}-${Date.now()}`;
|
|
1394
|
-
|
|
1667
|
+
writeFileSync3(tmp, JSON.stringify(payload, null, 2) + `
|
|
1395
1668
|
`);
|
|
1396
1669
|
try {
|
|
1397
1670
|
linkSync(tmp, path);
|
|
@@ -1407,7 +1680,7 @@ function claimBootLock(dshHome, profile) {
|
|
|
1407
1680
|
function removeBootClaim(dshHome, profile, claim) {
|
|
1408
1681
|
const path = lockPathFor(dshHome, profile);
|
|
1409
1682
|
try {
|
|
1410
|
-
const raw = JSON.parse(
|
|
1683
|
+
const raw = JSON.parse(readFileSync4(path, "utf8"));
|
|
1411
1684
|
if (raw.booting !== true || raw.pid !== claim.pid)
|
|
1412
1685
|
return false;
|
|
1413
1686
|
if (claim.startedAt !== undefined && raw.startedAt !== claim.startedAt)
|
|
@@ -1421,7 +1694,7 @@ function removeBootClaim(dshHome, profile, claim) {
|
|
|
1421
1694
|
function removeStaleLock(dshHome, profile, stale) {
|
|
1422
1695
|
const path = lockPathFor(dshHome, profile);
|
|
1423
1696
|
try {
|
|
1424
|
-
const raw = JSON.parse(
|
|
1697
|
+
const raw = JSON.parse(readFileSync4(path, "utf8"));
|
|
1425
1698
|
if (raw.booting === true || raw.pid !== stale.pid || raw.port !== stale.port)
|
|
1426
1699
|
return false;
|
|
1427
1700
|
} catch {
|
|
@@ -1432,7 +1705,7 @@ function removeStaleLock(dshHome, profile, stale) {
|
|
|
1432
1705
|
}
|
|
1433
1706
|
function bootClaimIntact(dshHome, profile, startedAt) {
|
|
1434
1707
|
try {
|
|
1435
|
-
const raw = JSON.parse(
|
|
1708
|
+
const raw = JSON.parse(readFileSync4(lockPathFor(dshHome, profile), "utf8"));
|
|
1436
1709
|
return raw.booting === true && raw.pid === process.pid && raw.startedAt === startedAt;
|
|
1437
1710
|
} catch {
|
|
1438
1711
|
return false;
|
|
@@ -1674,7 +1947,7 @@ function adoptHost(lock, o) {
|
|
|
1674
1947
|
}
|
|
1675
1948
|
function resolveOptions(opts) {
|
|
1676
1949
|
const profile = opts.profile ?? DEFAULT_PROFILE;
|
|
1677
|
-
const dshHome = opts.dshHome ??
|
|
1950
|
+
const dshHome = opts.dshHome ?? defaultDshHome2();
|
|
1678
1951
|
const idleExitSec = resolveIdleExitSec(opts.idleExitSec);
|
|
1679
1952
|
return {
|
|
1680
1953
|
profile,
|
|
@@ -1722,7 +1995,7 @@ async function bootHost(o) {
|
|
|
1722
1995
|
removeStaleLock(o.dshHome, o.profile, lock);
|
|
1723
1996
|
const lockPath = lockPathFor(o.dshHome, o.profile);
|
|
1724
1997
|
if (!existsSync3(lockPath)) {
|
|
1725
|
-
const profileDir =
|
|
1998
|
+
const profileDir = join5(o.dshHome, "profiles", o.profile);
|
|
1726
1999
|
if (!existsSync3(profileDir))
|
|
1727
2000
|
throw new ProfileMissingError(o.profile, profileDir);
|
|
1728
2001
|
const claimed = claimBootLock(o.dshHome, o.profile);
|
|
@@ -1735,7 +2008,15 @@ async function bootHost(o) {
|
|
|
1735
2008
|
}
|
|
1736
2009
|
await sleep(BOOT_JOIN_POLL_MS);
|
|
1737
2010
|
}
|
|
1738
|
-
const profileDir =
|
|
2011
|
+
const profileDir = join5(o.dshHome, "profiles", o.profile);
|
|
2012
|
+
try {
|
|
2013
|
+
const provision = provisionAppendSystem(o.dshHome, o.profile);
|
|
2014
|
+
if (provision.patch.status === "collision" || provision.patch.status === "skipped") {
|
|
2015
|
+
console.error(`[lifecycle] append-system preset not provisioned (${provision.patch.status}): ${provision.patch.detail}`);
|
|
2016
|
+
}
|
|
2017
|
+
} catch (error) {
|
|
2018
|
+
console.error("[lifecycle] append-system sync failed (booting without the preset):", error);
|
|
2019
|
+
}
|
|
1739
2020
|
const port = await getFreePort();
|
|
1740
2021
|
const child = o.spawnDsh(["--profile", o.profile, "--no-open", "--port", String(port)], {
|
|
1741
2022
|
cwd: profileDir,
|
|
@@ -1918,6 +2199,7 @@ async function ensureHost(opts = {}) {
|
|
|
1918
2199
|
var DEFAULT_PROFILE = "opentui", DEFAULT_IDLE_EXIT_MS = 5000, DEFAULT_IDLE_EXIT_SEC, ENV_IDLE_EXIT_MS = "DSH_OPENTUI_HOST_IDLE_MS", DEFAULT_READINESS_TIMEOUT_MS = 30000, DEFAULT_STALE_PROBE_MS = 8000, BOOT_JOIN_MARGIN_MS = 20000, BOOT_JOIN_POLL_MS = 200, RESPAWN_WINDOW_MS = 15000, MAX_RAPID_RESPAWNS = 3, LISTEN_PROBE_TIMEOUT_MS = 750, LISTEN_POLL_MS = 200, ADOPT_PROBE_TIMEOUT_MS = 2000, SERVE_PROBE_POLL_MS = 250, SERVE_PROBE_BUDGET_MS = 20000, ERROR_TAIL_LINES = 12, KILL_GRACE_MS = 5000, KILL_ESCALATE_MS = 2000, OUTPUT_TAIL_CAP = 8000, URL_LINE, HostLifecycleError, HostBootTimeoutError, HostDiedError, HostNotServingError, HostSpawnError, HostRespawnLoopError, HostBootSupersededError, ProfileMissingError, MintUnavailableError, registry, pendingBoots, respawnHistory, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)), realMintPromise = null, RETRYABLE_MINT_ERRORS, MINT_RETRY_BUDGET_MS = 15000, MINT_RETRY_INTERVAL_MS = 250, FFI_FLAG = "--experimental-ffi", __internals;
|
|
1919
2200
|
var init_lifecycle = __esm(() => {
|
|
1920
2201
|
init_host_probe();
|
|
2202
|
+
init_append_system();
|
|
1921
2203
|
DEFAULT_IDLE_EXIT_SEC = DEFAULT_IDLE_EXIT_MS / 1000;
|
|
1922
2204
|
URL_LINE = /dsh web: (https?:\/\/\S+)/;
|
|
1923
2205
|
HostLifecycleError = class HostLifecycleError extends Error {
|
|
@@ -5648,23 +5930,23 @@ class WaterfallAnswerer {
|
|
|
5648
5930
|
|
|
5649
5931
|
// src/client/remote-local-fs.ts
|
|
5650
5932
|
import {
|
|
5651
|
-
chmodSync as
|
|
5933
|
+
chmodSync as chmodSync3,
|
|
5652
5934
|
closeSync,
|
|
5653
5935
|
existsSync as existsSync4,
|
|
5654
5936
|
openSync,
|
|
5655
|
-
readFileSync as
|
|
5937
|
+
readFileSync as readFileSync5,
|
|
5656
5938
|
readdirSync,
|
|
5657
5939
|
readSync,
|
|
5658
|
-
renameSync as
|
|
5940
|
+
renameSync as renameSync4,
|
|
5659
5941
|
statSync as statSync3,
|
|
5660
|
-
unlinkSync as
|
|
5661
|
-
writeFileSync as
|
|
5942
|
+
unlinkSync as unlinkSync3,
|
|
5943
|
+
writeFileSync as writeFileSync4
|
|
5662
5944
|
} from "fs";
|
|
5663
|
-
import { homedir as
|
|
5664
|
-
import { basename, dirname, join as
|
|
5945
|
+
import { homedir as homedir3 } from "os";
|
|
5946
|
+
import { basename, dirname, join as join6 } from "path";
|
|
5665
5947
|
import * as nodeZlib from "zlib";
|
|
5666
5948
|
function resolveDshHome(explicit) {
|
|
5667
|
-
return explicit ?? (process.env.DSH_HOME ||
|
|
5949
|
+
return explicit ?? (process.env.DSH_HOME || join6(homedir3(), ".dsh"));
|
|
5668
5950
|
}
|
|
5669
5951
|
function stripQuotes(value) {
|
|
5670
5952
|
if (value.length >= 2) {
|
|
@@ -5755,15 +6037,15 @@ function listAgentFiles(explicitHome) {
|
|
|
5755
6037
|
const broken = [];
|
|
5756
6038
|
try {
|
|
5757
6039
|
const home = resolveDshHome(explicitHome);
|
|
5758
|
-
const dir =
|
|
6040
|
+
const dir = join6(home, "agents");
|
|
5759
6041
|
if (!existsSync4(dir))
|
|
5760
6042
|
return [];
|
|
5761
6043
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
5762
6044
|
if (!entry.isFile() || !entry.name.endsWith(".md"))
|
|
5763
6045
|
continue;
|
|
5764
|
-
const full =
|
|
6046
|
+
const full = join6(dir, entry.name);
|
|
5765
6047
|
try {
|
|
5766
|
-
const result = parseAgentMarkdown(
|
|
6048
|
+
const result = parseAgentMarkdown(readFileSync5(full, "utf8"), full);
|
|
5767
6049
|
if (result.ok)
|
|
5768
6050
|
agents.push(result.agent);
|
|
5769
6051
|
else
|
|
@@ -5786,7 +6068,7 @@ function listAgentFiles(explicitHome) {
|
|
|
5786
6068
|
function updateAgentFrontmatter(path, updates) {
|
|
5787
6069
|
let text;
|
|
5788
6070
|
try {
|
|
5789
|
-
text =
|
|
6071
|
+
text = readFileSync5(path, "utf8");
|
|
5790
6072
|
} catch (e) {
|
|
5791
6073
|
return `cannot read ${path}: ${String(e instanceof Error ? e.message : e)}`;
|
|
5792
6074
|
}
|
|
@@ -5839,7 +6121,7 @@ function updateAgentFrontmatter(path, updates) {
|
|
|
5839
6121
|
if (!changed)
|
|
5840
6122
|
return;
|
|
5841
6123
|
try {
|
|
5842
|
-
|
|
6124
|
+
writeFileSync4(path, lines.join(eol));
|
|
5843
6125
|
return;
|
|
5844
6126
|
} catch (e) {
|
|
5845
6127
|
return String(e instanceof Error ? e.message : e);
|
|
@@ -5847,7 +6129,7 @@ function updateAgentFrontmatter(path, updates) {
|
|
|
5847
6129
|
}
|
|
5848
6130
|
function setAgentField(name, field, value, explicitHome) {
|
|
5849
6131
|
const home = resolveDshHome(explicitHome);
|
|
5850
|
-
const file =
|
|
6132
|
+
const file = join6(home, "agents", `${name}.md`);
|
|
5851
6133
|
if (field === "deep") {
|
|
5852
6134
|
if (value !== null && !/^\d+$/.test(value)) {
|
|
5853
6135
|
return `expected a non-negative integer, got "${value}"`;
|
|
@@ -5875,7 +6157,7 @@ function repairScanSessions(explicitHome) {
|
|
|
5875
6157
|
const out = [];
|
|
5876
6158
|
try {
|
|
5877
6159
|
const home = resolveDshHome(explicitHome);
|
|
5878
|
-
const root =
|
|
6160
|
+
const root = join6(home, "sessions");
|
|
5879
6161
|
if (!existsSync4(root))
|
|
5880
6162
|
return ["no sessions directory"];
|
|
5881
6163
|
let total = 0;
|
|
@@ -5908,7 +6190,7 @@ function scanBrokenSessionLogs(explicitHome) {
|
|
|
5908
6190
|
const broken = [];
|
|
5909
6191
|
try {
|
|
5910
6192
|
const home = resolveDshHome(explicitHome);
|
|
5911
|
-
const root =
|
|
6193
|
+
const root = join6(home, "sessions");
|
|
5912
6194
|
if (!existsSync4(root))
|
|
5913
6195
|
return broken;
|
|
5914
6196
|
visitSessionLogs(root, 0, (full, name) => {
|
|
@@ -5936,7 +6218,7 @@ function visitSessionLogs(dir, depth, onLog) {
|
|
|
5936
6218
|
return;
|
|
5937
6219
|
}
|
|
5938
6220
|
for (const entry of entries) {
|
|
5939
|
-
const full =
|
|
6221
|
+
const full = join6(dir, entry.name);
|
|
5940
6222
|
if (entry.isDirectory()) {
|
|
5941
6223
|
visitSessionLogs(full, depth + 1, onLog);
|
|
5942
6224
|
continue;
|
|
@@ -6002,7 +6284,7 @@ function probeZstdFrame(path) {
|
|
|
6002
6284
|
if (verify === undefined)
|
|
6003
6285
|
return { broken: false };
|
|
6004
6286
|
try {
|
|
6005
|
-
verify(
|
|
6287
|
+
verify(readFileSync5(path));
|
|
6006
6288
|
return { broken: false };
|
|
6007
6289
|
} catch {
|
|
6008
6290
|
return { broken: true, reason: `truncated or corrupt zstd frame${notRepairable}` };
|
|
@@ -6048,14 +6330,14 @@ function sleepSync2(ms) {
|
|
|
6048
6330
|
}
|
|
6049
6331
|
function repairSessionLogTail(path, options = {}) {
|
|
6050
6332
|
const delayFn = options.delayFn ?? sleepSync2;
|
|
6051
|
-
const writeFn = options.writeFn ??
|
|
6052
|
-
const renameFn = options.renameFn ??
|
|
6333
|
+
const writeFn = options.writeFn ?? writeFileSync4;
|
|
6334
|
+
const renameFn = options.renameFn ?? renameSync4;
|
|
6053
6335
|
if (!path.endsWith(".jsonl")) {
|
|
6054
6336
|
return { kind: "failed", detail: "not a plain jsonl log \u2014 client-side repair only truncates invalid jsonl tails" };
|
|
6055
6337
|
}
|
|
6056
6338
|
let text;
|
|
6057
6339
|
try {
|
|
6058
|
-
text =
|
|
6340
|
+
text = readFileSync5(path, "utf8");
|
|
6059
6341
|
} catch (e) {
|
|
6060
6342
|
return { kind: "failed", detail: `cannot read ${basename(path)}: ${String(e instanceof Error ? e.message : e)}` };
|
|
6061
6343
|
}
|
|
@@ -6098,11 +6380,11 @@ function repairSessionLogTail(path, options = {}) {
|
|
|
6098
6380
|
return { kind: "failed", detail: `cannot write the repaired copy: ${String(e instanceof Error ? e.message : e)}` };
|
|
6099
6381
|
}
|
|
6100
6382
|
try {
|
|
6101
|
-
if (
|
|
6383
|
+
if (readFileSync5(tmpPath, "utf8") !== repaired)
|
|
6102
6384
|
throw new Error("repaired copy content mismatch");
|
|
6103
6385
|
} catch (e) {
|
|
6104
6386
|
try {
|
|
6105
|
-
|
|
6387
|
+
unlinkSync3(tmpPath);
|
|
6106
6388
|
} catch {}
|
|
6107
6389
|
return {
|
|
6108
6390
|
kind: "failed",
|
|
@@ -6118,7 +6400,7 @@ function repairSessionLogTail(path, options = {}) {
|
|
|
6118
6400
|
renameFn(path, backupPath);
|
|
6119
6401
|
} catch (e) {
|
|
6120
6402
|
try {
|
|
6121
|
-
|
|
6403
|
+
unlinkSync3(tmpPath);
|
|
6122
6404
|
} catch {}
|
|
6123
6405
|
return { kind: "failed", detail: `cannot back up the original: ${String(e instanceof Error ? e.message : e)}` };
|
|
6124
6406
|
}
|
|
@@ -6126,7 +6408,7 @@ function repairSessionLogTail(path, options = {}) {
|
|
|
6126
6408
|
renameFn(tmpPath, path);
|
|
6127
6409
|
} catch (e) {
|
|
6128
6410
|
try {
|
|
6129
|
-
|
|
6411
|
+
unlinkSync3(tmpPath);
|
|
6130
6412
|
} catch {}
|
|
6131
6413
|
let restored = false;
|
|
6132
6414
|
try {
|
|
@@ -6139,7 +6421,7 @@ function repairSessionLogTail(path, options = {}) {
|
|
|
6139
6421
|
};
|
|
6140
6422
|
}
|
|
6141
6423
|
try {
|
|
6142
|
-
|
|
6424
|
+
chmodSync3(path, 384);
|
|
6143
6425
|
} catch {}
|
|
6144
6426
|
return { kind: "repaired", backupPath };
|
|
6145
6427
|
}
|
|
@@ -6150,10 +6432,10 @@ var init_remote_local_fs = __esm(() => {
|
|
|
6150
6432
|
});
|
|
6151
6433
|
|
|
6152
6434
|
// src/client/remote-agent-profiles.ts
|
|
6153
|
-
import { existsSync as existsSync5, mkdirSync as
|
|
6154
|
-
import { dirname as dirname2, join as
|
|
6435
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4, readFileSync as readFileSync6, renameSync as renameSync5, rmSync as rmSync2, writeFileSync as writeFileSync5 } from "fs";
|
|
6436
|
+
import { dirname as dirname2, join as join7, resolve } from "path";
|
|
6155
6437
|
function modelProfilesPath(home) {
|
|
6156
|
-
return
|
|
6438
|
+
return join7(home, "model-profiles.json");
|
|
6157
6439
|
}
|
|
6158
6440
|
function narrowEntry(value) {
|
|
6159
6441
|
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
@@ -6194,7 +6476,7 @@ function seedModelProfilesDoc() {
|
|
|
6194
6476
|
function readModelProfilesDoc(home) {
|
|
6195
6477
|
let raw;
|
|
6196
6478
|
try {
|
|
6197
|
-
raw = JSON.parse(
|
|
6479
|
+
raw = JSON.parse(readFileSync6(modelProfilesPath(home), "utf8"));
|
|
6198
6480
|
} catch {
|
|
6199
6481
|
return seedModelProfilesDoc();
|
|
6200
6482
|
}
|
|
@@ -6237,10 +6519,10 @@ function parsePinText(text) {
|
|
|
6237
6519
|
function readNearestProfilePin(startDir) {
|
|
6238
6520
|
let current = resolve(startDir);
|
|
6239
6521
|
while (true) {
|
|
6240
|
-
const candidate =
|
|
6522
|
+
const candidate = join7(current, PROFILE_PIN_FILE);
|
|
6241
6523
|
try {
|
|
6242
6524
|
if (existsSync5(candidate)) {
|
|
6243
|
-
const name = parsePinText(
|
|
6525
|
+
const name = parsePinText(readFileSync6(candidate, "utf8"));
|
|
6244
6526
|
if (name !== undefined)
|
|
6245
6527
|
return name;
|
|
6246
6528
|
}
|
|
@@ -6305,7 +6587,7 @@ function saveProfileAgentOverrides(home, profileName, agentName, edit) {
|
|
|
6305
6587
|
profiles: DEFAULT_PROFILE_NAMES.map((name) => ({ name, agents: {} }))
|
|
6306
6588
|
};
|
|
6307
6589
|
try {
|
|
6308
|
-
const parsed = JSON.parse(
|
|
6590
|
+
const parsed = JSON.parse(readFileSync6(path, "utf8"));
|
|
6309
6591
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
6310
6592
|
const candidate = parsed;
|
|
6311
6593
|
if (candidate.version === MODEL_PROFILES_VERSION && Array.isArray(candidate.profiles))
|
|
@@ -6343,11 +6625,11 @@ function saveProfileAgentOverrides(home, profileName, agentName, edit) {
|
|
|
6343
6625
|
profiles[index] = profile;
|
|
6344
6626
|
const body = JSON.stringify(raw);
|
|
6345
6627
|
const dir = dirname2(path);
|
|
6346
|
-
const tmp =
|
|
6628
|
+
const tmp = join7(dir, `.model-profiles.json.tmp-${process.pid}`);
|
|
6347
6629
|
try {
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6630
|
+
mkdirSync4(dir, { recursive: true });
|
|
6631
|
+
writeFileSync5(tmp, body);
|
|
6632
|
+
renameSync5(tmp, path);
|
|
6351
6633
|
return;
|
|
6352
6634
|
} catch (e) {
|
|
6353
6635
|
try {
|
|
@@ -6549,7 +6831,13 @@ async function askBtw(options) {
|
|
|
6549
6831
|
let sessionId = options.previousSessionId ?? "";
|
|
6550
6832
|
if (!sessionId) {
|
|
6551
6833
|
const requested = randomUUID2();
|
|
6552
|
-
const value = await options.rpc("session/create", {
|
|
6834
|
+
const value = await options.rpc("session/create", {
|
|
6835
|
+
request: {
|
|
6836
|
+
cwd: options.cwd,
|
|
6837
|
+
sessionId: requested,
|
|
6838
|
+
...options.agentPreset !== undefined ? { agentPreset: options.agentPreset } : {}
|
|
6839
|
+
}
|
|
6840
|
+
});
|
|
6553
6841
|
sessionId = typeof value.sessionId === "string" ? value.sessionId : requested;
|
|
6554
6842
|
if (options.stagedModel) {
|
|
6555
6843
|
try {
|
|
@@ -7508,8 +7796,8 @@ var init_remote_subagents = __esm(() => {
|
|
|
7508
7796
|
|
|
7509
7797
|
// src/client/remote-restart.ts
|
|
7510
7798
|
import { spawn as spawn3 } from "child_process";
|
|
7511
|
-
import { existsSync as existsSync6, readFileSync as
|
|
7512
|
-
import { join as
|
|
7799
|
+
import { existsSync as existsSync6, readFileSync as readFileSync7, renameSync as renameSync6, rmSync as rmSync3, unlinkSync as unlinkSync4, writeFileSync as writeFileSync6 } from "fs";
|
|
7800
|
+
import { join as join8 } from "path";
|
|
7513
7801
|
function defaultSpawnDsh2(argv, options) {
|
|
7514
7802
|
const child = spawn3("dsh", argv, {
|
|
7515
7803
|
cwd: options.cwd,
|
|
@@ -7524,7 +7812,7 @@ function defaultSpawnDsh2(argv, options) {
|
|
|
7524
7812
|
return child;
|
|
7525
7813
|
}
|
|
7526
7814
|
function writeRestartedLock(home, profile, host) {
|
|
7527
|
-
const path =
|
|
7815
|
+
const path = join8(home, `opentui-host.${profile}.json`);
|
|
7528
7816
|
const payload = {
|
|
7529
7817
|
pid: host.pid,
|
|
7530
7818
|
port: host.port,
|
|
@@ -7533,17 +7821,17 @@ function writeRestartedLock(home, profile, host) {
|
|
|
7533
7821
|
profile
|
|
7534
7822
|
};
|
|
7535
7823
|
const tmp = `${path}.tmp`;
|
|
7536
|
-
|
|
7824
|
+
writeFileSync6(tmp, JSON.stringify(payload, null, 2) + `
|
|
7537
7825
|
`);
|
|
7538
|
-
|
|
7826
|
+
renameSync6(tmp, path);
|
|
7539
7827
|
}
|
|
7540
7828
|
async function restartSamePortHost(options = {}) {
|
|
7541
7829
|
const profile = options.profile ?? "opentui";
|
|
7542
7830
|
const home = resolveDshHome(options.dshHome);
|
|
7543
|
-
const lockPath =
|
|
7831
|
+
const lockPath = join8(home, `opentui-host.${profile}.json`);
|
|
7544
7832
|
let lock;
|
|
7545
7833
|
try {
|
|
7546
|
-
const raw = JSON.parse(
|
|
7834
|
+
const raw = JSON.parse(readFileSync7(lockPath, "utf8"));
|
|
7547
7835
|
if (typeof raw.pid === "number" && typeof raw.port === "number") {
|
|
7548
7836
|
lock = { pid: raw.pid, port: raw.port, ...raw.booting === true ? { booting: true } : {} };
|
|
7549
7837
|
}
|
|
@@ -7579,12 +7867,12 @@ async function restartSamePortHost(options = {}) {
|
|
|
7579
7867
|
await sleep2(POLL_MS);
|
|
7580
7868
|
}
|
|
7581
7869
|
try {
|
|
7582
|
-
const current = JSON.parse(
|
|
7870
|
+
const current = JSON.parse(readFileSync7(lockPath, "utf8"));
|
|
7583
7871
|
if (current.booting !== true && current.pid === pid && current.port === port)
|
|
7584
7872
|
rmSync3(lockPath, { force: true });
|
|
7585
7873
|
} catch {
|
|
7586
7874
|
try {
|
|
7587
|
-
|
|
7875
|
+
unlinkSync4(lockPath);
|
|
7588
7876
|
} catch {}
|
|
7589
7877
|
}
|
|
7590
7878
|
const quietDeadline = deadline(KILL_GRACE_MS2 + KILL_ESCALATE_MS2 + LISTEN_RELEASE_GRACE_MS);
|
|
@@ -7593,7 +7881,7 @@ async function restartSamePortHost(options = {}) {
|
|
|
7593
7881
|
if (await isListening(port)) {
|
|
7594
7882
|
throw new HostRestartError("port-held", `port ${port} is still held after the old host died \u2014 refusing to spawn into EADDRINUSE`);
|
|
7595
7883
|
}
|
|
7596
|
-
const profileDir =
|
|
7884
|
+
const profileDir = join8(home, "profiles", profile);
|
|
7597
7885
|
if (!existsSync6(profileDir)) {
|
|
7598
7886
|
throw new HostRestartError("profile-missing", `profile '${profile}' is not provisioned (${profileDir} missing)`);
|
|
7599
7887
|
}
|
|
@@ -7663,7 +7951,7 @@ __export(exports_remote_host_session, {
|
|
|
7663
7951
|
openRemoteStream: () => openRemoteStream
|
|
7664
7952
|
});
|
|
7665
7953
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
7666
|
-
import { existsSync as existsSync7, mkdirSync as
|
|
7954
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync5, readFileSync as readFileSync8, renameSync as renameSync7, rmSync as rmSync4, writeFileSync as writeFileSync7 } from "fs";
|
|
7667
7955
|
import { join as joinPath } from "path";
|
|
7668
7956
|
import WS3 from "ws";
|
|
7669
7957
|
function trace(message) {
|
|
@@ -7709,6 +7997,8 @@ class RemoteHostSession {
|
|
|
7709
7997
|
#sessionId;
|
|
7710
7998
|
#resumeId;
|
|
7711
7999
|
#presetId;
|
|
8000
|
+
#appendPresetChecked = false;
|
|
8001
|
+
#appendPresetAvailable = false;
|
|
7712
8002
|
#cb;
|
|
7713
8003
|
#askProvider;
|
|
7714
8004
|
#resolveTurn;
|
|
@@ -8122,6 +8412,23 @@ class RemoteHostSession {
|
|
|
8122
8412
|
return [];
|
|
8123
8413
|
}
|
|
8124
8414
|
}
|
|
8415
|
+
async#appendPresetRosterCheck() {
|
|
8416
|
+
if (this.#appendPresetChecked)
|
|
8417
|
+
return this.#appendPresetAvailable;
|
|
8418
|
+
let roster;
|
|
8419
|
+
try {
|
|
8420
|
+
roster = await this.#rpc("agentPresets/list");
|
|
8421
|
+
} catch {
|
|
8422
|
+
return false;
|
|
8423
|
+
}
|
|
8424
|
+
this.#appendPresetChecked = true;
|
|
8425
|
+
const presets = Array.isArray(roster.presets) ? roster.presets : [];
|
|
8426
|
+
this.#appendPresetAvailable = presets.some((p) => {
|
|
8427
|
+
const row = typeof p === "object" && p !== null ? p : {};
|
|
8428
|
+
return String(row.id ?? "") === APPEND_SYSTEM_PRESET_ID && !(typeof row.broken === "string" && row.broken);
|
|
8429
|
+
});
|
|
8430
|
+
return this.#appendPresetAvailable;
|
|
8431
|
+
}
|
|
8125
8432
|
async readPreset(presetId) {
|
|
8126
8433
|
try {
|
|
8127
8434
|
const doc = await this.#rpc("agentPresets/read", { agentPreset: presetId });
|
|
@@ -8162,8 +8469,10 @@ class RemoteHostSession {
|
|
|
8162
8469
|
if (this.#presetId !== undefined)
|
|
8163
8470
|
return this.#presetId;
|
|
8164
8471
|
if (proj.agentPreset !== undefined && proj.agentPreset !== this.#presetId) {
|
|
8165
|
-
this.#presetId
|
|
8166
|
-
|
|
8472
|
+
if (!(this.#presetId === undefined && proj.agentPreset === APPEND_SYSTEM_PRESET_ID)) {
|
|
8473
|
+
this.#presetId = proj.agentPreset;
|
|
8474
|
+
this.#probeExecutionMode();
|
|
8475
|
+
}
|
|
8167
8476
|
}
|
|
8168
8477
|
return proj.agentPreset;
|
|
8169
8478
|
} catch {
|
|
@@ -8272,7 +8581,7 @@ class RemoteHostSession {
|
|
|
8272
8581
|
}
|
|
8273
8582
|
keybindingsLoad() {
|
|
8274
8583
|
try {
|
|
8275
|
-
return JSON.parse(
|
|
8584
|
+
return JSON.parse(readFileSync8(this.configPath("keybindings.json"), "utf8"));
|
|
8276
8585
|
} catch {
|
|
8277
8586
|
return {};
|
|
8278
8587
|
}
|
|
@@ -8285,14 +8594,14 @@ class RemoteHostSession {
|
|
|
8285
8594
|
configLoad() {
|
|
8286
8595
|
let base = {};
|
|
8287
8596
|
try {
|
|
8288
|
-
base = JSON.parse(
|
|
8597
|
+
base = JSON.parse(readFileSync8(this.configPath(), "utf8"));
|
|
8289
8598
|
} catch {}
|
|
8290
8599
|
const merged = mergeConfig(base, this.#overlayCache ?? {}, process.env);
|
|
8291
8600
|
return { ...base, ...merged };
|
|
8292
8601
|
}
|
|
8293
8602
|
configRaw() {
|
|
8294
8603
|
try {
|
|
8295
|
-
return JSON.parse(
|
|
8604
|
+
return JSON.parse(readFileSync8(this.configPath(), "utf8"));
|
|
8296
8605
|
} catch {
|
|
8297
8606
|
return {};
|
|
8298
8607
|
}
|
|
@@ -8326,13 +8635,13 @@ class RemoteHostSession {
|
|
|
8326
8635
|
const merged = { ...this.#readProfileConfig(), ...rest };
|
|
8327
8636
|
const profileDir = joinPath(this.#dshHome, "profiles", this.#profile);
|
|
8328
8637
|
if (!existsSync7(profileDir))
|
|
8329
|
-
|
|
8638
|
+
mkdirSync5(profileDir, { recursive: true });
|
|
8330
8639
|
const path = this.configPath();
|
|
8331
8640
|
const tmp = `${path}.${process.pid}.tmp`;
|
|
8332
8641
|
try {
|
|
8333
|
-
|
|
8642
|
+
writeFileSync7(tmp, JSON.stringify(merged, null, 2) + `
|
|
8334
8643
|
`);
|
|
8335
|
-
|
|
8644
|
+
renameSync7(tmp, path);
|
|
8336
8645
|
} catch (error) {
|
|
8337
8646
|
try {
|
|
8338
8647
|
rmSync4(tmp, { force: true });
|
|
@@ -8347,7 +8656,7 @@ class RemoteHostSession {
|
|
|
8347
8656
|
}
|
|
8348
8657
|
#readProfileConfig() {
|
|
8349
8658
|
try {
|
|
8350
|
-
return JSON.parse(
|
|
8659
|
+
return JSON.parse(readFileSync8(this.configPath(), "utf8"));
|
|
8351
8660
|
} catch {
|
|
8352
8661
|
return {};
|
|
8353
8662
|
}
|
|
@@ -8484,7 +8793,7 @@ class RemoteHostSession {
|
|
|
8484
8793
|
listPlugins() {
|
|
8485
8794
|
return [...this.#pluginsCache];
|
|
8486
8795
|
}
|
|
8487
|
-
async refreshPlugins() {
|
|
8796
|
+
async refreshPlugins(opts = {}) {
|
|
8488
8797
|
try {
|
|
8489
8798
|
const before = this.#pluginsCache.length;
|
|
8490
8799
|
const [plugins, bundles] = await Promise.all([
|
|
@@ -8512,7 +8821,7 @@ class RemoteHostSession {
|
|
|
8512
8821
|
const title = typeof meta.title === "string" ? meta.title : moduleName;
|
|
8513
8822
|
return { name: title, moduleName, version: versions.get(moduleName) ?? "" };
|
|
8514
8823
|
}).filter((p) => p.name && !p.moduleName.startsWith("@deepseek-ai/")).map(({ name, version }) => ({ name, version }));
|
|
8515
|
-
if (this.#pluginsCache.length !== before || before === 0 || bundlesChanged) {
|
|
8824
|
+
if (!opts.silent && (this.#pluginsCache.length !== before || before === 0 || bundlesChanged)) {
|
|
8516
8825
|
for (const listener of this.#pushListeners) {
|
|
8517
8826
|
try {
|
|
8518
8827
|
listener.onPluginsChanged?.();
|
|
@@ -8612,6 +8921,7 @@ class RemoteHostSession {
|
|
|
8612
8921
|
try {
|
|
8613
8922
|
await this.start();
|
|
8614
8923
|
const staged = this.#pendingModel ?? await this.currentModelSelection();
|
|
8924
|
+
const btwPreset = this.#presetId ?? (await this.#appendPresetRosterCheck() ? APPEND_SYSTEM_PRESET_ID : undefined);
|
|
8615
8925
|
const result = await askBtw({
|
|
8616
8926
|
rpc: (method, args) => this.#rpc(method, args),
|
|
8617
8927
|
socketFactory: this.#socketFactory,
|
|
@@ -8620,7 +8930,8 @@ class RemoteHostSession {
|
|
|
8620
8930
|
snapshot,
|
|
8621
8931
|
...onDelta ? { onDelta } : {},
|
|
8622
8932
|
...this.#btwSessionId !== undefined ? { previousSessionId: this.#btwSessionId } : {},
|
|
8623
|
-
...staged !== undefined ? { stagedModel: staged } : {}
|
|
8933
|
+
...staged !== undefined ? { stagedModel: staged } : {},
|
|
8934
|
+
...btwPreset !== undefined ? { agentPreset: btwPreset } : {}
|
|
8624
8935
|
});
|
|
8625
8936
|
this.#btwSessionId = result.sessionId;
|
|
8626
8937
|
return result.answer;
|
|
@@ -8815,11 +9126,14 @@ class RemoteHostSession {
|
|
|
8815
9126
|
await this.#attachFollow(false);
|
|
8816
9127
|
return this.#sessionId;
|
|
8817
9128
|
}
|
|
9129
|
+
const resumed = this.#resumeId !== undefined;
|
|
8818
9130
|
const requestedId = this.#resumeId ?? randomUUID4();
|
|
8819
9131
|
this.#resumeId = undefined;
|
|
8820
9132
|
const request = { cwd: this.#cwd, sessionId: requestedId };
|
|
8821
9133
|
if (this.#presetId !== undefined)
|
|
8822
9134
|
request.agentPreset = this.#presetId;
|
|
9135
|
+
else if (!resumed && await this.#appendPresetRosterCheck())
|
|
9136
|
+
request.agentPreset = APPEND_SYSTEM_PRESET_ID;
|
|
8823
9137
|
let value;
|
|
8824
9138
|
try {
|
|
8825
9139
|
value = await this.#rpc("session/create", { request });
|
|
@@ -8830,8 +9144,9 @@ class RemoteHostSession {
|
|
|
8830
9144
|
throw error;
|
|
8831
9145
|
}
|
|
8832
9146
|
this.#sessionId = typeof value.sessionId === "string" ? value.sessionId : requestedId;
|
|
8833
|
-
if (typeof value.agentPreset === "string" && value.agentPreset)
|
|
9147
|
+
if (typeof value.agentPreset === "string" && value.agentPreset && !(this.#presetId === undefined && value.agentPreset === APPEND_SYSTEM_PRESET_ID)) {
|
|
8834
9148
|
this.#presetId = value.agentPreset;
|
|
9149
|
+
}
|
|
8835
9150
|
if (this.#pendingModel !== undefined && this.#sessionId !== undefined) {
|
|
8836
9151
|
const staged = this.#pendingModel;
|
|
8837
9152
|
this.#pendingModel = undefined;
|
|
@@ -8845,7 +9160,9 @@ class RemoteHostSession {
|
|
|
8845
9160
|
}
|
|
8846
9161
|
const opening = await this.#attachFollow(false);
|
|
8847
9162
|
if (opening.header.agentPreset && opening.header.agentPreset !== this.#presetId) {
|
|
8848
|
-
this.#presetId
|
|
9163
|
+
if (!(this.#presetId === undefined && opening.header.agentPreset === APPEND_SYSTEM_PRESET_ID)) {
|
|
9164
|
+
this.#presetId = opening.header.agentPreset;
|
|
9165
|
+
}
|
|
8849
9166
|
this.#probeExecutionMode();
|
|
8850
9167
|
}
|
|
8851
9168
|
return this.#sessionId;
|
|
@@ -9103,7 +9420,7 @@ class RemoteHostSession {
|
|
|
9103
9420
|
return;
|
|
9104
9421
|
}
|
|
9105
9422
|
if (event === "plugin-manager/changed") {
|
|
9106
|
-
this.refreshPlugins().catch(() => {}).then(() => {
|
|
9423
|
+
this.refreshPlugins({ silent: true }).catch(() => {}).then(() => {
|
|
9107
9424
|
for (const listener of this.#pushListeners) {
|
|
9108
9425
|
try {
|
|
9109
9426
|
listener.onPluginsChanged?.();
|
|
@@ -9179,6 +9496,7 @@ class RemoteHostSession {
|
|
|
9179
9496
|
return;
|
|
9180
9497
|
if (this.#follow?.attached)
|
|
9181
9498
|
return;
|
|
9499
|
+
this.#appendPresetChecked = false;
|
|
9182
9500
|
this.#reattachInFlight = true;
|
|
9183
9501
|
if (this.#awaiting)
|
|
9184
9502
|
this.#setReconnecting(true);
|
|
@@ -9329,6 +9647,7 @@ var init_remote_host_session = __esm(() => {
|
|
|
9329
9647
|
init_remote_follow();
|
|
9330
9648
|
init_remote_session_ops();
|
|
9331
9649
|
init_token_estimate();
|
|
9650
|
+
init_append_system();
|
|
9332
9651
|
init_remote_stream();
|
|
9333
9652
|
init_transport();
|
|
9334
9653
|
init_remote_local_fs();
|
|
@@ -33252,9 +33571,9 @@ var init_theme3 = __esm(() => {
|
|
|
33252
33571
|
});
|
|
33253
33572
|
|
|
33254
33573
|
// ../i18n/src/registry.ts
|
|
33255
|
-
import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as
|
|
33256
|
-
import { homedir as
|
|
33257
|
-
import { dirname as dirname3, join as
|
|
33574
|
+
import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync9 } from "fs";
|
|
33575
|
+
import { homedir as homedir4 } from "os";
|
|
33576
|
+
import { dirname as dirname3, join as join9 } from "path";
|
|
33258
33577
|
function validateLocaleFile(raw) {
|
|
33259
33578
|
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
33260
33579
|
return { ok: false, errors: [{ key: "(file)", reason: "not a flat JSON object" }] };
|
|
@@ -33298,21 +33617,21 @@ function mergeTables(bundled, override) {
|
|
|
33298
33617
|
return { ...bundled, ...override };
|
|
33299
33618
|
}
|
|
33300
33619
|
function userLocalesDir(dshHome) {
|
|
33301
|
-
const home = dshHome ?? process.env.DSH_HOME ??
|
|
33302
|
-
return
|
|
33620
|
+
const home = dshHome ?? process.env.DSH_HOME ?? join9(homedir4(), ".dsh");
|
|
33621
|
+
return join9(home, "locales");
|
|
33303
33622
|
}
|
|
33304
33623
|
function bundledLocalesDir() {
|
|
33305
33624
|
let dir = dirname3(new URL(import.meta.url).pathname);
|
|
33306
33625
|
for (let up = 0;up < 6; up++) {
|
|
33307
|
-
const candidate =
|
|
33308
|
-
if (existsSync8(
|
|
33626
|
+
const candidate = join9(dir, "locales");
|
|
33627
|
+
if (existsSync8(join9(candidate, `${DEFAULT_LANGUAGE}.json`)))
|
|
33309
33628
|
return candidate;
|
|
33310
33629
|
const parent = dirname3(dir);
|
|
33311
33630
|
if (parent === dir)
|
|
33312
33631
|
break;
|
|
33313
33632
|
dir = parent;
|
|
33314
33633
|
}
|
|
33315
|
-
return
|
|
33634
|
+
return join9(dirname3(new URL(import.meta.url).pathname), "..", "locales");
|
|
33316
33635
|
}
|
|
33317
33636
|
function loadLocales(options) {
|
|
33318
33637
|
const bundledDir = options?.bundledDir ?? bundledLocalesDir();
|
|
@@ -33323,7 +33642,7 @@ function loadLocales(options) {
|
|
|
33323
33642
|
if (!entry.endsWith(".json"))
|
|
33324
33643
|
continue;
|
|
33325
33644
|
const id = entry.slice(0, -".json".length);
|
|
33326
|
-
const result = parseLocaleFile(
|
|
33645
|
+
const result = parseLocaleFile(readFileSync9(join9(bundledDir, entry), "utf8"));
|
|
33327
33646
|
if (!result.ok) {
|
|
33328
33647
|
warnings.push(`[i18n] bundled locale file rejected, skipping '${entry}': ${formatErrors(result.errors)}`);
|
|
33329
33648
|
continue;
|
|
@@ -33339,7 +33658,7 @@ function loadLocales(options) {
|
|
|
33339
33658
|
if (!entry.endsWith(".json"))
|
|
33340
33659
|
continue;
|
|
33341
33660
|
const id = entry.slice(0, -".json".length);
|
|
33342
|
-
const result = parseLocaleFile(
|
|
33661
|
+
const result = parseLocaleFile(readFileSync9(join9(userDir, entry), "utf8"));
|
|
33343
33662
|
if (!result.ok) {
|
|
33344
33663
|
warnings.push(`[i18n] user locale file rejected, skipping '${entry}': ${formatErrors(result.errors)}`);
|
|
33345
33664
|
continue;
|
|
@@ -40756,7 +41075,7 @@ var init_string_width = __esm(() => {
|
|
|
40756
41075
|
});
|
|
40757
41076
|
|
|
40758
41077
|
// ../tui-base/src/routes/session/composer-context.tsx
|
|
40759
|
-
import { homedir as
|
|
41078
|
+
import { homedir as homedir5 } from "os";
|
|
40760
41079
|
function truncateLeft(text, limit) {
|
|
40761
41080
|
if (limit <= 0)
|
|
40762
41081
|
return "";
|
|
@@ -40849,7 +41168,7 @@ function ComposerContext(props) {
|
|
|
40849
41168
|
}
|
|
40850
41169
|
function safeHome() {
|
|
40851
41170
|
try {
|
|
40852
|
-
return
|
|
41171
|
+
return homedir5();
|
|
40853
41172
|
} catch {
|
|
40854
41173
|
return;
|
|
40855
41174
|
}
|
|
@@ -44299,23 +44618,69 @@ var init_gradient_text = __esm(() => {
|
|
|
44299
44618
|
});
|
|
44300
44619
|
|
|
44301
44620
|
// ../tui-base/src/routes/welcome-hero.tsx
|
|
44621
|
+
function splashRowCap(rows) {
|
|
44622
|
+
if (rows >= 40)
|
|
44623
|
+
return 8;
|
|
44624
|
+
if (rows >= COMPOSER_COMPACT_TERMINAL_ROWS)
|
|
44625
|
+
return 4;
|
|
44626
|
+
return 1;
|
|
44627
|
+
}
|
|
44628
|
+
function splashOverflowCount(total, cap) {
|
|
44629
|
+
return total > cap ? total - Math.max(1, cap - 1) : 0;
|
|
44630
|
+
}
|
|
44302
44631
|
function shortenCwd(cwd) {
|
|
44303
44632
|
const short = home && cwd.startsWith(home) ? `~${cwd.slice(home.length)}` : cwd;
|
|
44304
44633
|
if (short.length <= 60)
|
|
44305
44634
|
return short;
|
|
44306
44635
|
return `\u2026${short.slice(-59)}`;
|
|
44307
44636
|
}
|
|
44637
|
+
function pluginLabel(row) {
|
|
44638
|
+
return row.version === "" ? row.name : `${row.name}@${row.version}`;
|
|
44639
|
+
}
|
|
44640
|
+
function clipRow(line, maxWidth) {
|
|
44641
|
+
if (stringWidth(line) <= maxWidth)
|
|
44642
|
+
return line;
|
|
44643
|
+
const limit = Math.max(0, maxWidth - 1);
|
|
44644
|
+
let out = "";
|
|
44645
|
+
let width = 0;
|
|
44646
|
+
for (const grapheme of new Intl.Segmenter(undefined, {
|
|
44647
|
+
granularity: "grapheme"
|
|
44648
|
+
}).segment(line)) {
|
|
44649
|
+
const w = stringWidth(grapheme.segment);
|
|
44650
|
+
if (width + w > limit)
|
|
44651
|
+
break;
|
|
44652
|
+
out += grapheme.segment;
|
|
44653
|
+
width += w;
|
|
44654
|
+
}
|
|
44655
|
+
return `${out}\u2026`;
|
|
44656
|
+
}
|
|
44657
|
+
function fallbackSize() {
|
|
44658
|
+
return {
|
|
44659
|
+
width: typeof process !== "undefined" && process.stdout?.columns || 120,
|
|
44660
|
+
height: typeof process !== "undefined" && process.stdout?.rows || 40
|
|
44661
|
+
};
|
|
44662
|
+
}
|
|
44308
44663
|
function WelcomeHero(props) {
|
|
44309
44664
|
const quote = pickDailyQuote();
|
|
44665
|
+
const size = () => props.state.size?.() ?? fallbackSize();
|
|
44666
|
+
const cap = () => splashRowCap(size().height);
|
|
44667
|
+
const maxRowWidth = () => Math.max(20, size().width - 2);
|
|
44668
|
+
const pluginRows = () => props.state.plugins?.() ?? [];
|
|
44669
|
+
const overflowCount = () => splashOverflowCount(pluginRows().length, cap());
|
|
44670
|
+
const visibleRows = () => {
|
|
44671
|
+
const count = overflowCount();
|
|
44672
|
+
return count > 0 ? pluginRows().slice(0, pluginRows().length - count) : pluginRows();
|
|
44673
|
+
};
|
|
44674
|
+
const heroTitle = () => props.state.title?.();
|
|
44310
44675
|
return createComponent2(Show, {
|
|
44311
44676
|
get when() {
|
|
44312
44677
|
return props.state.visible();
|
|
44313
44678
|
},
|
|
44314
44679
|
get children() {
|
|
44315
|
-
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$
|
|
44680
|
+
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$7 = createElement("text"), _el$8 = createElement("text");
|
|
44316
44681
|
insertNode(_el$, _el$2);
|
|
44317
|
-
insertNode(_el$, _el$
|
|
44318
|
-
insertNode(_el$, _el$
|
|
44682
|
+
insertNode(_el$, _el$7);
|
|
44683
|
+
insertNode(_el$, _el$8);
|
|
44319
44684
|
setProp(_el$, "flexDirection", "column");
|
|
44320
44685
|
setProp(_el$, "flexShrink", 0);
|
|
44321
44686
|
setProp(_el$, "width", "100%");
|
|
@@ -44329,14 +44694,75 @@ function WelcomeHero(props) {
|
|
|
44329
44694
|
}), _el$2);
|
|
44330
44695
|
setProp(_el$2, "height", 1);
|
|
44331
44696
|
setProp(_el$2, "flexShrink", 0);
|
|
44332
|
-
|
|
44333
|
-
|
|
44334
|
-
|
|
44335
|
-
|
|
44697
|
+
insert(_el$, createComponent2(Show, {
|
|
44698
|
+
get when() {
|
|
44699
|
+
return pluginRows().length > 0;
|
|
44700
|
+
},
|
|
44701
|
+
get children() {
|
|
44702
|
+
return [createComponent2(Show, {
|
|
44703
|
+
get when() {
|
|
44704
|
+
return memo2(() => heroTitle() !== undefined)() && heroTitle() !== "";
|
|
44705
|
+
},
|
|
44706
|
+
get children() {
|
|
44707
|
+
var _el$3 = createElement("text");
|
|
44708
|
+
setProp(_el$3, "selectable", false);
|
|
44709
|
+
insert(_el$3, heroTitle);
|
|
44710
|
+
effect((_$p) => setProp(_el$3, "fg", props.state.muted?.(), _$p));
|
|
44711
|
+
return _el$3;
|
|
44712
|
+
}
|
|
44713
|
+
}), createComponent2(For, {
|
|
44714
|
+
get each() {
|
|
44715
|
+
return visibleRows();
|
|
44716
|
+
},
|
|
44717
|
+
children: (row, index) => (() => {
|
|
44718
|
+
var _el$9 = createElement("text");
|
|
44719
|
+
setProp(_el$9, "selectable", false);
|
|
44720
|
+
insert(_el$9, () => clipRow(`${index() === visibleRows().length - 1 && overflowCount() === 0 ? "\u2514\u2500" : "\u251C\u2500"} ${pluginLabel(row)}`, maxRowWidth()));
|
|
44721
|
+
effect((_$p) => setProp(_el$9, "fg", props.state.muted?.(), _$p));
|
|
44722
|
+
return _el$9;
|
|
44723
|
+
})()
|
|
44724
|
+
}), createComponent2(Show, {
|
|
44725
|
+
get when() {
|
|
44726
|
+
return overflowCount() > 0;
|
|
44727
|
+
},
|
|
44728
|
+
get children() {
|
|
44729
|
+
var _el$4 = createElement("text");
|
|
44730
|
+
setProp(_el$4, "selectable", false);
|
|
44731
|
+
insert(_el$4, () => clipRow(`\u2514\u2500 ${t("hero.plugins.more", {
|
|
44732
|
+
count: overflowCount()
|
|
44733
|
+
})}`, maxRowWidth()));
|
|
44734
|
+
effect((_$p) => setProp(_el$4, "fg", props.state.muted?.(), _$p));
|
|
44735
|
+
return _el$4;
|
|
44736
|
+
}
|
|
44737
|
+
}), (() => {
|
|
44738
|
+
var _el$5 = createElement("text");
|
|
44739
|
+
setProp(_el$5, "selectable", false);
|
|
44740
|
+
insert(_el$5, () => clipRow(t("hero.plugins.count", {
|
|
44741
|
+
count: pluginRows().length
|
|
44742
|
+
}), maxRowWidth()));
|
|
44743
|
+
effect((_$p) => setProp(_el$5, "fg", props.state.muted?.(), _$p));
|
|
44744
|
+
return _el$5;
|
|
44745
|
+
})(), createComponent2(Show, {
|
|
44746
|
+
get when() {
|
|
44747
|
+
return cap() > 1;
|
|
44748
|
+
},
|
|
44749
|
+
get children() {
|
|
44750
|
+
var _el$6 = createElement("box");
|
|
44751
|
+
setProp(_el$6, "height", 1);
|
|
44752
|
+
setProp(_el$6, "flexShrink", 0);
|
|
44753
|
+
return _el$6;
|
|
44754
|
+
}
|
|
44755
|
+
})];
|
|
44756
|
+
}
|
|
44757
|
+
}), _el$7);
|
|
44758
|
+
setProp(_el$7, "selectable", false);
|
|
44759
|
+
insert(_el$7, () => `${props.state.model() ? `${props.state.model()} \xB7 ` : ""}${shortenCwd(props.cwd)}`);
|
|
44760
|
+
setProp(_el$8, "selectable", false);
|
|
44761
|
+
insert(_el$8, `\u300C${quote}\u300D`);
|
|
44336
44762
|
effect((_p$) => {
|
|
44337
44763
|
var _v$ = props.state.muted?.(), _v$2 = props.state.muted?.();
|
|
44338
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
44339
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
44764
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$7, "fg", _v$, _p$.e));
|
|
44765
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$8, "fg", _v$2, _p$.t));
|
|
44340
44766
|
return _p$;
|
|
44341
44767
|
}, {
|
|
44342
44768
|
e: undefined,
|
|
@@ -44358,6 +44784,9 @@ var init_welcome_hero = __esm(() => {
|
|
|
44358
44784
|
init_server();
|
|
44359
44785
|
init_quotes();
|
|
44360
44786
|
init_gradient_text();
|
|
44787
|
+
init_semantic();
|
|
44788
|
+
init_i18n();
|
|
44789
|
+
init_string_width();
|
|
44361
44790
|
home = typeof process !== "undefined" && process.env.HOME || "";
|
|
44362
44791
|
});
|
|
44363
44792
|
|
|
@@ -46540,7 +46969,8 @@ function brandSegment(theme, presetLabel, mode = "dark") {
|
|
|
46540
46969
|
return {
|
|
46541
46970
|
text: label,
|
|
46542
46971
|
bg: brandBlue(mode),
|
|
46543
|
-
priority: 100
|
|
46972
|
+
priority: 100,
|
|
46973
|
+
degrade: "dsh"
|
|
46544
46974
|
};
|
|
46545
46975
|
}
|
|
46546
46976
|
function providerSegment(provider, theme, mode = "dark") {
|
|
@@ -46629,7 +47059,9 @@ function messagesSegment(n, theme) {
|
|
|
46629
47059
|
if (!Number.isFinite(n) || n < 0)
|
|
46630
47060
|
return null;
|
|
46631
47061
|
return {
|
|
46632
|
-
text:
|
|
47062
|
+
text: t("footer.messages", {
|
|
47063
|
+
n
|
|
47064
|
+
}),
|
|
46633
47065
|
bg: resolvePalette(theme).messages,
|
|
46634
47066
|
priority: 80
|
|
46635
47067
|
};
|
|
@@ -46904,7 +47336,8 @@ function sessionFooterSegments(data) {
|
|
|
46904
47336
|
add(modelSegment(data.model ?? "", effectiveEffort(data.effort), theme));
|
|
46905
47337
|
add(contextSegment(data.contextTokens ?? null, data.contextWindow ?? null, theme));
|
|
46906
47338
|
add(cacheSegment(data.cacheHitRate ?? null, theme));
|
|
46907
|
-
|
|
47339
|
+
if (data.messages !== undefined)
|
|
47340
|
+
add(messagesSegment(data.messages, theme));
|
|
46908
47341
|
add(toolSegment(data.tools ?? 0, theme));
|
|
46909
47342
|
add(elapsedSegment(data.elapsedSec ?? null, theme));
|
|
46910
47343
|
add(speedSegment(data.tps ?? null, theme));
|
|
@@ -46926,6 +47359,7 @@ var init_powerline = __esm(() => {
|
|
|
46926
47359
|
init_tool_summarize();
|
|
46927
47360
|
init_string_width();
|
|
46928
47361
|
init_terminal_size();
|
|
47362
|
+
init_i18n();
|
|
46929
47363
|
POWERLINE_COLORS = {
|
|
46930
47364
|
brand: "#4D6BFE",
|
|
46931
47365
|
provider: "#6A1B9A",
|
|
@@ -50226,14 +50660,14 @@ var init_login = __esm(() => {
|
|
|
50226
50660
|
});
|
|
50227
50661
|
|
|
50228
50662
|
// ../tui-base/src/routes/session/export.ts
|
|
50229
|
-
import { homedir as
|
|
50663
|
+
import { homedir as homedir6 } from "os";
|
|
50230
50664
|
import { resolve as resolve5 } from "path";
|
|
50231
50665
|
function exportTargetPath(sessionId, arg) {
|
|
50232
50666
|
const trimmed = arg?.trim();
|
|
50233
50667
|
if (trimmed)
|
|
50234
50668
|
return resolve5(trimmed);
|
|
50235
50669
|
const id8 = sessionId.slice(0, 8).replace(/[^A-Za-z0-9._-]/g, "-");
|
|
50236
|
-
return resolve5(
|
|
50670
|
+
return resolve5(homedir6(), "Downloads", `dsh-session-${id8}.jsonl`);
|
|
50237
50671
|
}
|
|
50238
50672
|
function journalToJSONL(entries) {
|
|
50239
50673
|
if (entries.length === 0)
|
|
@@ -51359,14 +51793,14 @@ var init_slash_usage = __esm(() => {
|
|
|
51359
51793
|
});
|
|
51360
51794
|
|
|
51361
51795
|
// ../tui-base/src/routes/session/skills-source.ts
|
|
51362
|
-
import { existsSync as existsSync9, readdirSync as readdirSync3, readFileSync as
|
|
51363
|
-
import { homedir as
|
|
51364
|
-
import { dirname as dirname5, join as
|
|
51796
|
+
import { existsSync as existsSync9, readdirSync as readdirSync3, readFileSync as readFileSync10, statSync as statSync4 } from "fs";
|
|
51797
|
+
import { homedir as homedir7 } from "os";
|
|
51798
|
+
import { dirname as dirname5, join as join10, resolve as resolve6 } from "path";
|
|
51365
51799
|
import { TextAttributes as TextAttributes8 } from "@opentui/core";
|
|
51366
51800
|
function findProjectRoot(cwd) {
|
|
51367
51801
|
let dir = resolve6(cwd);
|
|
51368
51802
|
for (let depth = 0;depth < 64; depth++) {
|
|
51369
|
-
if (existsSync9(
|
|
51803
|
+
if (existsSync9(join10(dir, ".git")))
|
|
51370
51804
|
return dir;
|
|
51371
51805
|
const parent = dirname5(dir);
|
|
51372
51806
|
if (parent === dir)
|
|
@@ -51381,7 +51815,7 @@ function resolveAgentsHome(explicit) {
|
|
|
51381
51815
|
const env = process.env.DSH_AGENTS_HOME;
|
|
51382
51816
|
if (typeof env === "string" && env.trim() !== "")
|
|
51383
51817
|
return resolve6(env);
|
|
51384
|
-
return resolve6(
|
|
51818
|
+
return resolve6(join10(homedir7(), ".agents"));
|
|
51385
51819
|
}
|
|
51386
51820
|
function agentsHomeEnvWarning(env, configValue) {
|
|
51387
51821
|
const value = typeof env === "string" ? env : process.env.DSH_AGENTS_HOME;
|
|
@@ -51400,18 +51834,18 @@ function agentsHomeEnvWarning(env, configValue) {
|
|
|
51400
51834
|
function skillRoots(options) {
|
|
51401
51835
|
const roots = [];
|
|
51402
51836
|
const projectRoot = findProjectRoot(options.cwd);
|
|
51403
|
-
roots.push({ path:
|
|
51404
|
-
roots.push({ path:
|
|
51837
|
+
roots.push({ path: join10(projectRoot, ".dsh", "skills"), rank: 100, skipSystem: false });
|
|
51838
|
+
roots.push({ path: join10(projectRoot, ".agents", "skills"), rank: 200, skipSystem: false });
|
|
51405
51839
|
for (const dir of options.customSkillDirs ?? []) {
|
|
51406
51840
|
if (typeof dir === "string" && dir.trim() !== "") {
|
|
51407
51841
|
roots.push({ path: resolve6(dir), rank: 300, skipSystem: false });
|
|
51408
51842
|
}
|
|
51409
51843
|
}
|
|
51410
51844
|
if (options.dshHome !== undefined) {
|
|
51411
|
-
roots.push({ path:
|
|
51845
|
+
roots.push({ path: join10(options.dshHome, "skills"), rank: 400, skipSystem: true });
|
|
51412
51846
|
}
|
|
51413
51847
|
const agentsHome = resolveAgentsHome(options.agentsHome);
|
|
51414
|
-
roots.push({ path:
|
|
51848
|
+
roots.push({ path: join10(agentsHome, "skills"), rank: 500, skipSystem: false });
|
|
51415
51849
|
const seen = new Set;
|
|
51416
51850
|
const deduped = [];
|
|
51417
51851
|
for (const root of roots.sort((a, b) => a.rank - b.rank)) {
|
|
@@ -51475,7 +51909,7 @@ function oneLine(value) {
|
|
|
51475
51909
|
function readSkillFile(path) {
|
|
51476
51910
|
let raw;
|
|
51477
51911
|
try {
|
|
51478
|
-
raw =
|
|
51912
|
+
raw = readFileSync10(path, "utf8");
|
|
51479
51913
|
} catch {
|
|
51480
51914
|
return;
|
|
51481
51915
|
}
|
|
@@ -51512,7 +51946,7 @@ function discoverSkills(options) {
|
|
|
51512
51946
|
let isFile = entry.isFile();
|
|
51513
51947
|
if (entry.isSymbolicLink()) {
|
|
51514
51948
|
try {
|
|
51515
|
-
const target = statSync4(
|
|
51949
|
+
const target = statSync4(join10(root.path, entry.name));
|
|
51516
51950
|
isDirectory = target.isDirectory();
|
|
51517
51951
|
isFile = target.isFile();
|
|
51518
51952
|
} catch {
|
|
@@ -51521,9 +51955,9 @@ function discoverSkills(options) {
|
|
|
51521
51955
|
}
|
|
51522
51956
|
let file;
|
|
51523
51957
|
if (isDirectory)
|
|
51524
|
-
file =
|
|
51958
|
+
file = join10(root.path, entry.name, "SKILL.md");
|
|
51525
51959
|
else if (isFile && entry.name.endsWith(".md"))
|
|
51526
|
-
file =
|
|
51960
|
+
file = join10(root.path, entry.name);
|
|
51527
51961
|
if (file === undefined)
|
|
51528
51962
|
continue;
|
|
51529
51963
|
const row = readSkillFile(file);
|
|
@@ -51902,14 +52336,14 @@ var init_slash_palette = __esm(() => {
|
|
|
51902
52336
|
// ../tui-base/src/routes/session/skills-manage.ts
|
|
51903
52337
|
import { existsSync as existsSync10 } from "fs";
|
|
51904
52338
|
import { lstat, mkdir as mkdir3, readFile as readFile3, readdir, realpath, symlink, unlink } from "fs/promises";
|
|
51905
|
-
import { join as
|
|
52339
|
+
import { join as join11, sep } from "path";
|
|
51906
52340
|
function skillSymlinkPaths(publicDir, curatedDir, name) {
|
|
51907
|
-
const srcMd =
|
|
52341
|
+
const srcMd = join11(publicDir, `${name}.md`);
|
|
51908
52342
|
if (existsSync10(srcMd))
|
|
51909
|
-
return { src: srcMd, dest:
|
|
51910
|
-
const srcBundle =
|
|
52343
|
+
return { src: srcMd, dest: join11(curatedDir, `${name}.md`) };
|
|
52344
|
+
const srcBundle = join11(publicDir, name);
|
|
51911
52345
|
if (existsSync10(srcBundle))
|
|
51912
|
-
return { src: srcBundle, dest:
|
|
52346
|
+
return { src: srcBundle, dest: join11(curatedDir, name) };
|
|
51913
52347
|
return;
|
|
51914
52348
|
}
|
|
51915
52349
|
async function installSkillSymlink(src, dest) {
|
|
@@ -51973,8 +52407,8 @@ async function applyOneSkillChange(name, targetState, publicDir, curatedDir) {
|
|
|
51973
52407
|
}
|
|
51974
52408
|
}
|
|
51975
52409
|
try {
|
|
51976
|
-
const destMd =
|
|
51977
|
-
const destBundle =
|
|
52410
|
+
const destMd = join11(curatedDir, `${name}.md`);
|
|
52411
|
+
const destBundle = join11(curatedDir, name);
|
|
51978
52412
|
const mdStat = await lstat(destMd).catch(() => {
|
|
51979
52413
|
return;
|
|
51980
52414
|
});
|
|
@@ -52065,14 +52499,14 @@ async function scanAvailableSkills(publicDir, curatedDir) {
|
|
|
52065
52499
|
if (name.endsWith(".md")) {
|
|
52066
52500
|
skillNames.add(name.slice(0, -3));
|
|
52067
52501
|
} else if (!name.startsWith(".")) {
|
|
52068
|
-
if (existsSync10(
|
|
52502
|
+
if (existsSync10(join11(publicDir, name, "SKILL.md")))
|
|
52069
52503
|
skillNames.add(name);
|
|
52070
52504
|
}
|
|
52071
52505
|
}
|
|
52072
52506
|
const rows = [];
|
|
52073
52507
|
for (const name of skillNames) {
|
|
52074
|
-
const installed = existsSync10(
|
|
52075
|
-
const description = await readSkillDescription(existsSync10(
|
|
52508
|
+
const installed = existsSync10(join11(curatedDir, `${name}.md`)) || existsSync10(join11(curatedDir, name));
|
|
52509
|
+
const description = await readSkillDescription(existsSync10(join11(publicDir, name, "SKILL.md")) ? join11(publicDir, name, "SKILL.md") : join11(publicDir, `${name}.md`));
|
|
52076
52510
|
rows.push({ name, description, installed });
|
|
52077
52511
|
}
|
|
52078
52512
|
rows.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -59311,7 +59745,7 @@ var init_subagents_viewer = __esm(() => {
|
|
|
59311
59745
|
import { TextAttributes as TextAttributes12 } from "@opentui/core";
|
|
59312
59746
|
function resolveVersion() {
|
|
59313
59747
|
try {
|
|
59314
|
-
return "0.17.
|
|
59748
|
+
return "0.17.3";
|
|
59315
59749
|
} catch {
|
|
59316
59750
|
return "dev";
|
|
59317
59751
|
}
|
|
@@ -61303,10 +61737,18 @@ class RemoteSessionSeam {
|
|
|
61303
61737
|
#unjournal;
|
|
61304
61738
|
#pluginsRevision = createSignal(0);
|
|
61305
61739
|
#unplugins;
|
|
61740
|
+
#pluginsPushListeners = [];
|
|
61306
61741
|
constructor(session) {
|
|
61307
61742
|
this.#session = session;
|
|
61308
61743
|
registerSubagentSteer((id, text) => this.#session.steerChild(id, text));
|
|
61309
|
-
this.#unplugins = session.onPluginsChanged?.(() =>
|
|
61744
|
+
this.#unplugins = session.onPluginsChanged?.(() => {
|
|
61745
|
+
this.#pluginsRevision[1]((n) => n + 1);
|
|
61746
|
+
for (const listener of this.#pluginsPushListeners) {
|
|
61747
|
+
try {
|
|
61748
|
+
listener();
|
|
61749
|
+
} catch {}
|
|
61750
|
+
}
|
|
61751
|
+
}) ?? undefined;
|
|
61310
61752
|
}
|
|
61311
61753
|
status() {
|
|
61312
61754
|
const s = this.#session.status;
|
|
@@ -61521,6 +61963,14 @@ class RemoteSessionSeam {
|
|
|
61521
61963
|
this.#pluginsRevision[0]();
|
|
61522
61964
|
return this.#session.listPlugins();
|
|
61523
61965
|
}
|
|
61966
|
+
onPluginsChanged(listener) {
|
|
61967
|
+
this.#pluginsPushListeners.push(listener);
|
|
61968
|
+
return () => {
|
|
61969
|
+
const index = this.#pluginsPushListeners.indexOf(listener);
|
|
61970
|
+
if (index >= 0)
|
|
61971
|
+
this.#pluginsPushListeners.splice(index, 1);
|
|
61972
|
+
};
|
|
61973
|
+
}
|
|
61524
61974
|
pluginBundles() {
|
|
61525
61975
|
this.#pluginsRevision[0]();
|
|
61526
61976
|
return this.#session.listBundles();
|
|
@@ -61678,6 +62128,7 @@ class RemoteSessionSeam {
|
|
|
61678
62128
|
this.#unplugins?.();
|
|
61679
62129
|
this.#unplugins = undefined;
|
|
61680
62130
|
this.#listeners.length = 0;
|
|
62131
|
+
this.#pluginsPushListeners.length = 0;
|
|
61681
62132
|
await this.#session.dispose();
|
|
61682
62133
|
}
|
|
61683
62134
|
#ensureJournalFeed() {
|
|
@@ -61777,7 +62228,7 @@ var init_session_seam_adapter = __esm(() => {
|
|
|
61777
62228
|
});
|
|
61778
62229
|
|
|
61779
62230
|
// ../tui-base/examples/v2-entry.tsx
|
|
61780
|
-
import { join as
|
|
62231
|
+
import { join as join12 } from "path";
|
|
61781
62232
|
async function loadShell() {
|
|
61782
62233
|
const [shared, lifecycle, transport, rhs, adapter, git] = await Promise.all([
|
|
61783
62234
|
Promise.resolve().then(() => (init_boot_shared(), exports_boot_shared)),
|
|
@@ -61807,7 +62258,6 @@ function V2SessionPage(props) {
|
|
|
61807
62258
|
const [turnBusy, setTurnBusy] = createSignal(false);
|
|
61808
62259
|
const busy = () => composerBusy() || turnBusy();
|
|
61809
62260
|
const [busySince, setBusySince] = createSignal(0);
|
|
61810
|
-
const [msgs, setMsgs] = createSignal(0);
|
|
61811
62261
|
const [model, setModel] = createSignal();
|
|
61812
62262
|
const [tools, setTools] = createSignal(0);
|
|
61813
62263
|
const [effort, setEffort] = createSignal();
|
|
@@ -61818,9 +62268,13 @@ function V2SessionPage(props) {
|
|
|
61818
62268
|
const [presetLabel, setPresetLabel] = createSignal();
|
|
61819
62269
|
const [skillRows, setSkillRows] = createSignal(props.skills ?? []);
|
|
61820
62270
|
const slashCommands = createMemo(() => withSkillCommands(coreCommands(), skillRows()));
|
|
62271
|
+
const [pluginRows, setPluginRows] = createSignal(seam.plugins?.() ?? []);
|
|
61821
62272
|
onMount(() => {
|
|
61822
62273
|
const off = seam.onSkillsChanged?.((rows) => setSkillRows(rows.map((row) => ({ name: row.name, description: row.description, path: "skills/list" }))));
|
|
61823
62274
|
onCleanup(() => off?.());
|
|
62275
|
+
const offPlugins = seam.onPluginsChanged?.(() => setPluginRows(seam.plugins?.() ?? []));
|
|
62276
|
+
onCleanup(() => offPlugins?.());
|
|
62277
|
+
setPluginRows(seam.plugins?.() ?? []);
|
|
61824
62278
|
});
|
|
61825
62279
|
const refreshPresetLabel = () => {
|
|
61826
62280
|
const face = seam.preset;
|
|
@@ -61831,6 +62285,7 @@ function V2SessionPage(props) {
|
|
|
61831
62285
|
let composerRef;
|
|
61832
62286
|
let transcriptScroll;
|
|
61833
62287
|
const renderer = useRenderer();
|
|
62288
|
+
const dimensions = useTerminalSize();
|
|
61834
62289
|
const paneFocus = createPaneFocus({
|
|
61835
62290
|
transcript: () => transcriptScroll,
|
|
61836
62291
|
composer: () => composerRef?.node()
|
|
@@ -61871,7 +62326,6 @@ function V2SessionPage(props) {
|
|
|
61871
62326
|
let turnAborted = false;
|
|
61872
62327
|
const send = (text) => {
|
|
61873
62328
|
turnAborted = false;
|
|
61874
|
-
setMsgs((n) => n + 1);
|
|
61875
62329
|
setTurnBusy(true);
|
|
61876
62330
|
setBusySince(Date.now());
|
|
61877
62331
|
setLastRequest(text);
|
|
@@ -61976,7 +62430,7 @@ function V2SessionPage(props) {
|
|
|
61976
62430
|
provider: model()?.providerID,
|
|
61977
62431
|
model: model()?.modelID,
|
|
61978
62432
|
effort: effort(),
|
|
61979
|
-
messages: remoteInfo()?.messageCount
|
|
62433
|
+
messages: remoteInfo()?.messageCount,
|
|
61980
62434
|
tools: tools(),
|
|
61981
62435
|
tps: remoteInfo()?.tps ?? null,
|
|
61982
62436
|
contextTokens: ctxTokens(),
|
|
@@ -62171,10 +62625,13 @@ function V2SessionPage(props) {
|
|
|
62171
62625
|
return [
|
|
62172
62626
|
createComponent2(WelcomeHero, {
|
|
62173
62627
|
state: {
|
|
62174
|
-
visible: () => projection.hydrated() &&
|
|
62628
|
+
visible: () => projection.hydrated() && projection.rows.length === 0,
|
|
62175
62629
|
model: () => model()?.modelID,
|
|
62176
62630
|
muted: () => theme.text.muted,
|
|
62177
|
-
mode: () => themeService.mode()
|
|
62631
|
+
mode: () => themeService.mode(),
|
|
62632
|
+
title: () => props.profileName,
|
|
62633
|
+
plugins: () => pluginRows(),
|
|
62634
|
+
size: () => dimensions()
|
|
62178
62635
|
},
|
|
62179
62636
|
cwd: props.workspace
|
|
62180
62637
|
}),
|
|
@@ -62448,8 +62905,8 @@ async function bootClientV2(options = {}) {
|
|
|
62448
62905
|
agentsHome: agentsHomeForSkills
|
|
62449
62906
|
});
|
|
62450
62907
|
const skillsManagerRoots = {
|
|
62451
|
-
source:
|
|
62452
|
-
curated:
|
|
62908
|
+
source: join12(agentsHomeForSkills, "skills"),
|
|
62909
|
+
curated: join12(host.dshHome, "skills")
|
|
62453
62910
|
};
|
|
62454
62911
|
const envTheme = process.env[shared.ENV_THEME];
|
|
62455
62912
|
const workspaceConfig = seam.workspaceConfig();
|
|
@@ -62518,6 +62975,7 @@ async function bootClientV2(options = {}) {
|
|
|
62518
62975
|
themeName,
|
|
62519
62976
|
quit: () => process.exit(0),
|
|
62520
62977
|
workspace,
|
|
62978
|
+
profileName: profile,
|
|
62521
62979
|
probeBranch: (cwd) => git.probeGitBranchOrSha(cwd),
|
|
62522
62980
|
initialSessionId,
|
|
62523
62981
|
resumeNotice,
|
|
@@ -62580,6 +63038,7 @@ var init_v2_entry = __esm(() => {
|
|
|
62580
63038
|
init_delivery_choice();
|
|
62581
63039
|
init_auto_resume();
|
|
62582
63040
|
init_welcome_hero();
|
|
63041
|
+
init_terminal_size();
|
|
62583
63042
|
init_subagents_picker();
|
|
62584
63043
|
init_subagent_markers();
|
|
62585
63044
|
init_seam_rows();
|