@aiwayds/dsh-opentui 0.13.1 → 0.14.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/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.14.0] - 2026-11-14
9
+
10
+ ### Added
11
+
12
+ - **`/export` writes the session journal to JSONL.** The new slash command exports the active session's journal via the production sessionJournal seam (`session/page` pagination) to a JSONL file — default `~/Downloads/dsh-session-<id8>.jsonl`, an explicit `[path]` argument overrides it. The completion line reports the record count and absolute path and labels the output as the host journal format (no cross-client replay claim); no session or no face degrades to a notice instead of a crash.
13
+ - **Ask free-text answers.** Every ask question gains a `Type something.` sentinel row: selecting it switches to an inline input (Enter submits, Esc returns to the picker without declining the batch), the submission rides `Answer.custom` with strict option/custom mutual exclusion, and a `✎` marker tracks the typed answer through the review gate. Multi-question batches settle custom answers through the same review flow as picks.
14
+
15
+ ### Fixed
16
+
17
+ - **Skills uninstall no longer follows links outside the managed root.** Uninstall resolves the link's realpath and refuses targets outside the skills source root (batch rows fold as `external target (not ours)`); dangling or looping dead links stay removable, and untestable errno states (EACCES/EIO) fail safe by refusing, mirroring the install-side discipline.
18
+ - **Blank `agentsHome` is visible instead of silent.** A set-but-empty `DSH_AGENTS_HOME` or an empty `agentsHome` config key boots with a notice explaining the client falls back to `~/.agents` while the host resolves the empty value to the cwd, naming the fix for each leg (and both); the resolution itself stays defensive on the client.
19
+ - **Ask scenario navigation is row-aware.** The `60-ask-user` e2e scenario walks the picker by the highlighted row instead of a fixed step count, so the sentinel row's wrap shift can no longer flip which option a blind arrow press toggles.
20
+
8
21
  ## [0.13.1] - 2026-11-14
9
22
 
10
23
  ### Fixed
@@ -5631,6 +5631,9 @@ class WaterfallAnswerer {
5631
5631
  return {
5632
5632
  answers: questions.map((q) => {
5633
5633
  const pick = picks.find((p) => p.questionId === q.id);
5634
+ if (pick?.custom !== undefined && pick.custom !== "") {
5635
+ return { id: q.id, selected: [], custom: pick.custom };
5636
+ }
5634
5637
  const answer = pick ? { id: q.id, selected: pick.selections?.length ? [...pick.selections] : [pick.selected] } : { id: q.id, selected: [], custom: "declined" };
5635
5638
  return answer;
5636
5639
  })
@@ -48899,7 +48902,15 @@ class TurnOverlayController {
48899
48902
  const head = this.#asks[0];
48900
48903
  if (!head)
48901
48904
  return;
48902
- return { id: head.id, questions: head.questions, index: head.index, picks: head.picks, phase: head.phase };
48905
+ return {
48906
+ id: head.id,
48907
+ questions: head.questions,
48908
+ index: head.index,
48909
+ picks: head.picks,
48910
+ phase: head.phase,
48911
+ customs: [...head.customs],
48912
+ customDraft: head.customDraft
48913
+ };
48903
48914
  }
48904
48915
  get currentQuestion() {
48905
48916
  const head = this.#asks[0];
@@ -48915,6 +48926,10 @@ class TurnOverlayController {
48915
48926
  index: 0,
48916
48927
  picks: questions.map(() => []),
48917
48928
  phase: "questions",
48929
+ customs: questions.map(() => {
48930
+ return;
48931
+ }),
48932
+ customDraft: null,
48918
48933
  resolve
48919
48934
  });
48920
48935
  this.#changed();
@@ -48925,6 +48940,9 @@ class TurnOverlayController {
48925
48940
  const question = head?.questions[head.index];
48926
48941
  if (!head || !question || head.phase === "review")
48927
48942
  return;
48943
+ if (head.customDraft !== null)
48944
+ return;
48945
+ head.customs[head.index] = undefined;
48928
48946
  if (question.multiSelect === true) {
48929
48947
  const current = head.picks[head.index] ?? [];
48930
48948
  head.picks[head.index] = current.includes(option) ? current.filter((label) => label !== option) : [...current, option];
@@ -48957,6 +48975,56 @@ class TurnOverlayController {
48957
48975
  this.#changed();
48958
48976
  }
48959
48977
  }
48978
+ beginCustom() {
48979
+ const head = this.#asks[0];
48980
+ if (!head || head.phase === "review")
48981
+ return false;
48982
+ head.customDraft = head.customs[head.index] ?? "";
48983
+ this.#changed();
48984
+ return true;
48985
+ }
48986
+ patchCustom(text) {
48987
+ const head = this.#asks[0];
48988
+ if (!head || head.customDraft === null)
48989
+ return;
48990
+ head.customDraft = text;
48991
+ this.#changed();
48992
+ }
48993
+ commitCustom() {
48994
+ const head = this.#asks[0];
48995
+ const question = head?.questions[head.index];
48996
+ if (!head || !question || head.customDraft === null)
48997
+ return;
48998
+ const text = head.customDraft.trim();
48999
+ head.customDraft = null;
49000
+ if (text === "") {
49001
+ this.#changed();
49002
+ return;
49003
+ }
49004
+ head.customs[head.index] = text;
49005
+ head.picks[head.index] = [];
49006
+ if (question.multiSelect !== true && head.questions.length === 1) {
49007
+ this.#asks.shift();
49008
+ head.resolve(this.#envelope(head));
49009
+ this.#changed();
49010
+ return;
49011
+ }
49012
+ if (this.#allAnswered(head)) {
49013
+ head.phase = "review";
49014
+ } else {
49015
+ const next = head.questions.findIndex((_, qi) => qi > head.index && (head.picks[qi]?.length ?? 0) === 0 && !head.customs[qi]);
49016
+ if (next >= 0)
49017
+ head.index = next;
49018
+ }
49019
+ this.#changed();
49020
+ }
49021
+ cancelCustomEdit() {
49022
+ const head = this.#asks[0];
49023
+ if (!head || head.customDraft === null)
49024
+ return;
49025
+ head.customDraft = null;
49026
+ this.#changed();
49027
+ }
48960
49028
  enterReview() {
48961
49029
  const head = this.#asks[0];
48962
49030
  if (!head || head.phase === "review")
@@ -48985,10 +49053,14 @@ class TurnOverlayController {
48985
49053
  this.#changed();
48986
49054
  }
48987
49055
  #allAnswered(head) {
48988
- return head.picks.every((pick) => pick.length > 0);
49056
+ return head.questions.every((_, qi) => (head.picks[qi]?.length ?? 0) > 0 || head.customs[qi] !== undefined && head.customs[qi] !== "");
48989
49057
  }
48990
49058
  #envelope(head) {
48991
49059
  return head.questions.map((question, qi) => {
49060
+ const custom = head.customs[qi];
49061
+ if (custom !== undefined && custom !== "") {
49062
+ return { questionId: question.id, selected: "", custom };
49063
+ }
48992
49064
  const picks = head.picks[qi] ?? [];
48993
49065
  return {
48994
49066
  questionId: question.id,
@@ -49205,13 +49277,16 @@ function ReminderBadge() {
49205
49277
  return _el$;
49206
49278
  })();
49207
49279
  }
49208
- function askTabStrip(questions, picks, index) {
49280
+ function askTabStrip(questions, picks, index, customs) {
49209
49281
  return questions.map((_, qi) => {
49210
- const answered = (picks[qi]?.length ?? 0) > 0;
49282
+ const answered = (picks[qi]?.length ?? 0) > 0 || customs?.[qi] !== undefined && customs[qi] !== "";
49211
49283
  const label = `${qi + 1}${answered ? "\u2713" : ""}`;
49212
49284
  return qi === index ? `[${label}]` : label;
49213
49285
  }).join(" \xB7 ");
49214
49286
  }
49287
+ function askSentinelTitle(custom) {
49288
+ return custom ? `\u270E ${custom}` : ASK_SENTINEL_LABEL;
49289
+ }
49215
49290
  function askProgressTitle(questions, index) {
49216
49291
  if (questions.length < 2)
49217
49292
  return "Question";
@@ -49235,21 +49310,39 @@ function AskPicker(props) {
49235
49310
  };
49236
49311
  return createComponent2(Show, {
49237
49312
  get when() {
49238
- return ask()?.phase === "review";
49313
+ return memo2(() => ask() !== undefined)() && ask()?.customDraft !== null;
49239
49314
  },
49240
49315
  get fallback() {
49241
- return createComponent2(AskQuestionsView, {
49242
- ask,
49243
- get controller() {
49244
- return props.controller;
49316
+ return createComponent2(Show, {
49317
+ get when() {
49318
+ return ask()?.phase === "review";
49245
49319
  },
49246
- get onDecline() {
49247
- return props.onDecline;
49320
+ get fallback() {
49321
+ return createComponent2(AskQuestionsView, {
49322
+ ask,
49323
+ get controller() {
49324
+ return props.controller;
49325
+ },
49326
+ get onDecline() {
49327
+ return props.onDecline;
49328
+ }
49329
+ });
49330
+ },
49331
+ get children() {
49332
+ return createComponent2(AskReviewView, {
49333
+ ask,
49334
+ get controller() {
49335
+ return props.controller;
49336
+ },
49337
+ get onDecline() {
49338
+ return props.onDecline;
49339
+ }
49340
+ });
49248
49341
  }
49249
49342
  });
49250
49343
  },
49251
49344
  get children() {
49252
- return createComponent2(AskReviewView, {
49345
+ return createComponent2(AskCustomInputView, {
49253
49346
  ask,
49254
49347
  get controller() {
49255
49348
  return props.controller;
@@ -49261,6 +49354,27 @@ function AskPicker(props) {
49261
49354
  }
49262
49355
  });
49263
49356
  }
49357
+ function askQuestionRows(question, picks, custom, review) {
49358
+ const multi = question.multiSelect === true;
49359
+ const rows = question.options.map((option) => ({
49360
+ title: multi ? picks.includes(option) ? `[x] ${option}` : `[ ] ${option}` : option,
49361
+ value: option
49362
+ }));
49363
+ rows.push({
49364
+ title: askSentinelTitle(custom),
49365
+ value: {
49366
+ kind: "custom"
49367
+ }
49368
+ });
49369
+ if (review)
49370
+ rows.push({
49371
+ title: "\u23CE Review answers",
49372
+ value: {
49373
+ kind: "review"
49374
+ }
49375
+ });
49376
+ return rows;
49377
+ }
49264
49378
  function AskQuestionsView(props) {
49265
49379
  const batch = () => props.ask();
49266
49380
  const question = () => {
@@ -49272,23 +49386,12 @@ function AskQuestionsView(props) {
49272
49386
  const b = batch();
49273
49387
  return b?.picks[b.index] ?? [];
49274
49388
  };
49389
+ const bIndex = () => batch()?.index ?? 0;
49275
49390
  const options = () => {
49276
49391
  const q = question();
49277
- const p = picked();
49278
49392
  if (!q)
49279
49393
  return [];
49280
- const rows = q.options.map((option) => ({
49281
- title: multi() ? p.includes(option) ? `[x] ${option}` : `[ ] ${option}` : option,
49282
- value: option
49283
- }));
49284
- if (askNeedsReview(batch()?.questions ?? []))
49285
- rows.push({
49286
- title: "\u23CE Review answers",
49287
- value: {
49288
- kind: "review"
49289
- }
49290
- });
49291
- return rows;
49394
+ return askQuestionRows(q, picked(), batch()?.customs[bIndex()], askNeedsReview(batch()?.questions ?? []));
49292
49395
  };
49293
49396
  const description = () => {
49294
49397
  const b = batch();
@@ -49296,7 +49399,7 @@ function AskQuestionsView(props) {
49296
49399
  return;
49297
49400
  const parts = [];
49298
49401
  if (b.questions.length >= 2)
49299
- parts.push(askTabStrip(b.questions, b.picks, b.index));
49402
+ parts.push(askTabStrip(b.questions, b.picks, b.index, b.customs));
49300
49403
  if (multi())
49301
49404
  parts.push("space: toggle");
49302
49405
  return parts.join(" \xB7 ") || undefined;
@@ -49370,6 +49473,8 @@ function AskQuestionsView(props) {
49370
49473
  onSelect: (option) => {
49371
49474
  if (typeof option.value === "string")
49372
49475
  props.controller.toggle(option.value);
49476
+ else if (option.value.kind === "custom")
49477
+ props.controller.beginCustom();
49373
49478
  else
49374
49479
  props.controller.enterReview();
49375
49480
  },
@@ -49378,14 +49483,87 @@ function AskQuestionsView(props) {
49378
49483
  }
49379
49484
  });
49380
49485
  }
49486
+ function AskCustomInputView(props) {
49487
+ const theme = useThemeOptional();
49488
+ const cursorStyle = useCursorStyle();
49489
+ Keymap2.createLayer(() => ({
49490
+ mode: "modal",
49491
+ commands: [{
49492
+ id: "ask.custom_cancel",
49493
+ title: "Back to options",
49494
+ group: "Dialog",
49495
+ bind: "escape",
49496
+ run: () => props.controller.cancelCustomEdit()
49497
+ }]
49498
+ }));
49499
+ return createComponent2(DialogLayout, {
49500
+ get header() {
49501
+ return (() => {
49502
+ var _el$5 = createElement("box"), _el$6 = createElement("text");
49503
+ insertNode(_el$5, _el$6);
49504
+ setProp(_el$5, "paddingLeft", DIALOG_LIST_INSET - 1);
49505
+ setProp(_el$5, "paddingRight", DIALOG_LIST_INSET - 1);
49506
+ insert(_el$5, createComponent2(DialogHeader, {
49507
+ get titleView() {
49508
+ return (() => {
49509
+ var _el$7 = createElement("box");
49510
+ setProp(_el$7, "flexDirection", "row");
49511
+ insert(_el$7, createComponent2(ReminderBadge, {}), null);
49512
+ insert(_el$7, createComponent2(AskTitleText, {
49513
+ title: "Your answer"
49514
+ }), null);
49515
+ return _el$7;
49516
+ })();
49517
+ },
49518
+ title: "Your answer"
49519
+ }), _el$6);
49520
+ setProp(_el$6, "wrapMode", "word");
49521
+ insert(_el$6, () => props.ask()?.questions[props.ask()?.index ?? 0]?.prompt);
49522
+ effect((_$p) => setProp(_el$6, "fg", theme?.text.muted, _$p));
49523
+ return _el$5;
49524
+ })();
49525
+ },
49526
+ get children() {
49527
+ var _el$4 = createElement("input");
49528
+ use((r) => {
49529
+ setTimeout(() => {
49530
+ if (!r.isDestroyed)
49531
+ r.focus();
49532
+ }, 1);
49533
+ }, _el$4);
49534
+ setProp(_el$4, "flexGrow", 1);
49535
+ setProp(_el$4, "placeholder", "Type something.");
49536
+ setProp(_el$4, "onInput", (text) => props.controller.patchCustom(text));
49537
+ setProp(_el$4, "onSubmit", () => props.controller.commitCustom());
49538
+ effect((_p$) => {
49539
+ var _v$ = props.ask()?.customDraft ?? "", _v$2 = theme?.text.muted, _v$3 = theme?.background.formfield.focused, _v$4 = theme?.text.formfield.focused, _v$5 = theme?.text.formfield.focused, _v$6 = cursorStyle();
49540
+ _v$ !== _p$.e && (_p$.e = setProp(_el$4, "value", _v$, _p$.e));
49541
+ _v$2 !== _p$.t && (_p$.t = setProp(_el$4, "placeholderColor", _v$2, _p$.t));
49542
+ _v$3 !== _p$.a && (_p$.a = setProp(_el$4, "focusedBackgroundColor", _v$3, _p$.a));
49543
+ _v$4 !== _p$.o && (_p$.o = setProp(_el$4, "focusedTextColor", _v$4, _p$.o));
49544
+ _v$5 !== _p$.i && (_p$.i = setProp(_el$4, "cursorColor", _v$5, _p$.i));
49545
+ _v$6 !== _p$.n && (_p$.n = setProp(_el$4, "cursorStyle", _v$6, _p$.n));
49546
+ return _p$;
49547
+ }, {
49548
+ e: undefined,
49549
+ t: undefined,
49550
+ a: undefined,
49551
+ o: undefined,
49552
+ i: undefined,
49553
+ n: undefined
49554
+ });
49555
+ return _el$4;
49556
+ }
49557
+ });
49558
+ }
49381
49559
  function AskTitleText(props) {
49382
49560
  const theme = useThemeOptional();
49383
49561
  return (() => {
49384
- var _el$4 = createElement("text");
49385
- setProp(_el$4, "wrapMode", "none");
49386
- insert(_el$4, () => props.title);
49387
- effect((_$p) => setProp(_el$4, "fg", warningColor(theme), _$p));
49388
- return _el$4;
49562
+ var _el$8 = createElement("text");
49563
+ setProp(_el$8, "wrapMode", "none");
49564
+ insert(_el$8, () => props.title);
49565
+ effect((_$p) => setProp(_el$8, "fg", warningColor(theme), _$p));
49566
+ return _el$8;
49389
49567
  })();
49390
49568
  }
49391
49569
  function AskReviewView(props) {
@@ -49395,8 +49573,10 @@ function AskReviewView(props) {
49395
49573
  return [];
49396
49574
  const rows = b.questions.map((question, qi) => {
49397
49575
  const picks = b.picks[qi] ?? [];
49576
+ const custom = b.customs[qi];
49577
+ const answer = custom ? `\u270E ${custom}` : picks.length > 0 ? picks.join(", ") : "\u2014";
49398
49578
  return {
49399
- title: `${truncate70(question.prompt)} ${picks.length > 0 ? picks.join(", ") : "\u2014"}`,
49579
+ title: `${truncate70(question.prompt)} ${answer}`,
49400
49580
  value: {
49401
49581
  kind: "question",
49402
49582
  qi
@@ -49414,13 +49594,13 @@ function AskReviewView(props) {
49414
49594
  return createComponent2(DialogSelect, {
49415
49595
  get titleView() {
49416
49596
  return (() => {
49417
- var _el$5 = createElement("box");
49418
- setProp(_el$5, "flexDirection", "row");
49419
- insert(_el$5, createComponent2(ReminderBadge, {}), null);
49420
- insert(_el$5, createComponent2(AskTitleText, {
49597
+ var _el$9 = createElement("box");
49598
+ setProp(_el$9, "flexDirection", "row");
49599
+ insert(_el$9, createComponent2(ReminderBadge, {}), null);
49600
+ insert(_el$9, createComponent2(AskTitleText, {
49421
49601
  title: "Review answers"
49422
49602
  }), null);
49423
- return _el$5;
49603
+ return _el$9;
49424
49604
  })();
49425
49605
  },
49426
49606
  title: "Review answers",
@@ -49517,6 +49697,7 @@ function TurnOverlayHost(props) {
49517
49697
  function registerTurnOverlays(seam, controller) {
49518
49698
  seam.registerAskProvider((questions) => controller.answer(questions));
49519
49699
  }
49700
+ var ASK_SENTINEL_LABEL = "Type something.";
49520
49701
  var init_turn_overlays = __esm(() => {
49521
49702
  init_index_bun();
49522
49703
  init_index_bun();
@@ -49526,11 +49707,14 @@ var init_turn_overlays = __esm(() => {
49526
49707
  init_index_bun();
49527
49708
  init_index_bun();
49528
49709
  init_index_bun();
49710
+ init_index_bun();
49529
49711
  init_server();
49530
49712
  init_index_bun();
49531
49713
  init_dialog_confirm();
49532
49714
  init_dialog_select();
49533
49715
  init_dialog();
49716
+ init_keymap();
49717
+ init_config();
49534
49718
  init_theme3();
49535
49719
  init_motion();
49536
49720
  init_semantic();
@@ -49707,7 +49891,28 @@ var init_login = __esm(() => {
49707
49891
  ];
49708
49892
  });
49709
49893
 
49894
+ // ../tui-base/src/routes/session/export.ts
49895
+ import { homedir as homedir4 } from "os";
49896
+ import { resolve as resolve5 } from "path";
49897
+ function exportTargetPath(sessionId, arg) {
49898
+ const trimmed = arg?.trim();
49899
+ if (trimmed)
49900
+ return resolve5(trimmed);
49901
+ const id8 = sessionId.slice(0, 8).replace(/[^A-Za-z0-9._-]/g, "-");
49902
+ return resolve5(homedir4(), "Downloads", `dsh-session-${id8}.jsonl`);
49903
+ }
49904
+ function journalToJSONL(entries) {
49905
+ if (entries.length === 0)
49906
+ return "";
49907
+ return entries.map((entry) => JSON.stringify(entry)).join(`
49908
+ `) + `
49909
+ `;
49910
+ }
49911
+ var init_export = () => {};
49912
+
49710
49913
  // ../tui-base/src/routes/session/commands.ts
49914
+ import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
49915
+ import { dirname as dirname3 } from "path";
49711
49916
  function persistHints(seam) {
49712
49917
  try {
49713
49918
  seam.configSave?.({ footerHints: footerHints(), hintsLocale: hintsLocale() });
@@ -50281,6 +50486,30 @@ function coreCommands() {
50281
50486
  ctx.openHistory();
50282
50487
  }
50283
50488
  },
50489
+ {
50490
+ name: "/export",
50491
+ description: "export the session journal to JSONL ([path], default ~/Downloads)",
50492
+ async run(ctx, argText) {
50493
+ const sessionId = ctx.seam.currentSessionId();
50494
+ if (!sessionId) {
50495
+ ctx.say("/export: no active session to export");
50496
+ return;
50497
+ }
50498
+ if (!ctx.seam.sessionJournal) {
50499
+ ctx.say("/export: the journal read face is not mounted in this entry");
50500
+ return;
50501
+ }
50502
+ try {
50503
+ const entries = await ctx.seam.sessionJournal(sessionId);
50504
+ const target = exportTargetPath(sessionId, argText);
50505
+ await mkdir2(dirname3(target), { recursive: true });
50506
+ await writeFile2(target, journalToJSONL(entries));
50507
+ ctx.say(`exported ${entries.length} journal records (host journal format) \u2192 ${target}`);
50508
+ } catch (error) {
50509
+ ctx.say(`/export failed \u2014 ${seamFailureReason(error)}`);
50510
+ }
50511
+ }
50512
+ },
50284
50513
  {
50285
50514
  name: "/subagents",
50286
50515
  description: "view live subagent transcripts (list, steer, stop)",
@@ -50537,6 +50766,7 @@ var init_commands = __esm(() => {
50537
50766
  init_login();
50538
50767
  init_hints_line();
50539
50768
  init_motion();
50769
+ init_export();
50540
50770
  });
50541
50771
 
50542
50772
  // ../tui-base/src/routes/session/slash-complete.ts
@@ -50742,28 +50972,42 @@ var init_slash_usage = __esm(() => {
50742
50972
 
50743
50973
  // ../tui-base/src/routes/session/skills-source.ts
50744
50974
  import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync8, statSync as statSync4 } from "fs";
50745
- import { homedir as homedir4 } from "os";
50746
- import { dirname as dirname3, join as join8, resolve as resolve5 } from "path";
50975
+ import { homedir as homedir5 } from "os";
50976
+ import { dirname as dirname4, join as join8, resolve as resolve6 } from "path";
50747
50977
  import { TextAttributes as TextAttributes8 } from "@opentui/core";
50748
50978
  function findProjectRoot(cwd) {
50749
- let dir = resolve5(cwd);
50979
+ let dir = resolve6(cwd);
50750
50980
  for (let depth = 0;depth < 64; depth++) {
50751
50981
  if (existsSync8(join8(dir, ".git")))
50752
50982
  return dir;
50753
- const parent = dirname3(dir);
50983
+ const parent = dirname4(dir);
50754
50984
  if (parent === dir)
50755
50985
  break;
50756
50986
  dir = parent;
50757
50987
  }
50758
- return resolve5(cwd);
50988
+ return resolve6(cwd);
50759
50989
  }
50760
50990
  function resolveAgentsHome(explicit) {
50761
50991
  if (typeof explicit === "string" && explicit.trim() !== "")
50762
- return resolve5(explicit);
50992
+ return resolve6(explicit);
50763
50993
  const env = process.env.DSH_AGENTS_HOME;
50764
50994
  if (typeof env === "string" && env.trim() !== "")
50765
- return resolve5(env);
50766
- return resolve5(join8(homedir4(), ".agents"));
50995
+ return resolve6(env);
50996
+ return resolve6(join8(homedir5(), ".agents"));
50997
+ }
50998
+ function agentsHomeEnvWarning(env, configValue) {
50999
+ const value = typeof env === "string" ? env : process.env.DSH_AGENTS_HOME;
51000
+ const envBlank = typeof value === "string" && value.trim() === "";
51001
+ const configBlank = typeof configValue === "string" && configValue.trim() === "";
51002
+ if (!envBlank && !configBlank)
51003
+ return;
51004
+ if (envBlank && configBlank) {
51005
+ return "DSH_AGENTS_HOME and the config agentsHome are both set but empty: this client " + "falls back to ~/.agents, but the host skill provider resolves each empty string " + "to its cwd \u2014 unset the variable AND remove the empty agentsHome key from the " + "config to keep both skill surfaces on the same root.";
51006
+ }
51007
+ if (configBlank) {
51008
+ return "The config agentsHome is set but empty: this client falls back to ~/.agents, but " + "the host skill provider resolves it to its cwd \u2014 remove the empty agentsHome key " + "from the config (or set a real path) to keep both skill surfaces on the same root.";
51009
+ }
51010
+ return "DSH_AGENTS_HOME is set but empty: this client falls back to ~/.agents, but the " + "host skill provider resolves it to its cwd \u2014 unset the variable to keep both " + "skill surfaces on the same root.";
50767
51011
  }
50768
51012
  function skillRoots(options) {
50769
51013
  const roots = [];
@@ -50772,7 +51016,7 @@ function skillRoots(options) {
50772
51016
  roots.push({ path: join8(projectRoot, ".agents", "skills"), rank: 200, skipSystem: false });
50773
51017
  for (const dir of options.customSkillDirs ?? []) {
50774
51018
  if (typeof dir === "string" && dir.trim() !== "") {
50775
- roots.push({ path: resolve5(dir), rank: 300, skipSystem: false });
51019
+ roots.push({ path: resolve6(dir), rank: 300, skipSystem: false });
50776
51020
  }
50777
51021
  }
50778
51022
  if (options.dshHome !== undefined) {
@@ -50783,7 +51027,7 @@ function skillRoots(options) {
50783
51027
  const seen = new Set;
50784
51028
  const deduped = [];
50785
51029
  for (const root of roots.sort((a, b) => a.rank - b.rank)) {
50786
- const key = resolve5(root.path);
51030
+ const key = resolve6(root.path);
50787
51031
  if (seen.has(key))
50788
51032
  continue;
50789
51033
  seen.add(key);
@@ -51264,8 +51508,8 @@ var init_slash_palette = __esm(() => {
51264
51508
 
51265
51509
  // ../tui-base/src/routes/session/skills-manage.ts
51266
51510
  import { existsSync as existsSync9 } from "fs";
51267
- import { lstat, mkdir as mkdir2, readFile as readFile3, readdir, realpath, symlink, unlink } from "fs/promises";
51268
- import { join as join9 } from "path";
51511
+ import { lstat, mkdir as mkdir3, readFile as readFile3, readdir, realpath, symlink, unlink } from "fs/promises";
51512
+ import { join as join9, sep } from "path";
51269
51513
  function skillSymlinkPaths(publicDir, curatedDir, name) {
51270
51514
  const srcMd = join9(publicDir, `${name}.md`);
51271
51515
  if (existsSync9(srcMd))
@@ -51305,6 +51549,24 @@ async function installSkillSymlink(src, dest) {
51305
51549
  return;
51306
51550
  throw new Error(`already installed from a different source: "${dest}" points to "${destReal}", expected "${srcReal}"`);
51307
51551
  }
51552
+ async function isOwnedSkillLink(dest, publicDir) {
51553
+ let destReal;
51554
+ try {
51555
+ destReal = await realpath(dest);
51556
+ } catch (error) {
51557
+ const code = error.code;
51558
+ if (code !== "ENOENT" && code !== "ELOOP" && code !== "ENOTDIR")
51559
+ return false;
51560
+ }
51561
+ if (destReal === undefined)
51562
+ return true;
51563
+ const publicReal = await realpath(publicDir).catch(() => {
51564
+ return;
51565
+ });
51566
+ if (publicReal === undefined)
51567
+ return false;
51568
+ return destReal === publicReal || destReal.startsWith(publicReal + sep);
51569
+ }
51308
51570
  async function applyOneSkillChange(name, targetState, publicDir, curatedDir) {
51309
51571
  if (targetState) {
51310
51572
  const paths = skillSymlinkPaths(publicDir, curatedDir, name);
@@ -51326,6 +51588,8 @@ async function applyOneSkillChange(name, targetState, publicDir, curatedDir) {
51326
51588
  if (mdStat !== undefined) {
51327
51589
  if (!mdStat.isSymbolicLink())
51328
51590
  throw new Error(`refusing to remove "${destMd}": not a symlink`);
51591
+ if (!await isOwnedSkillLink(destMd, publicDir))
51592
+ throw new Error(`refusing to remove "${destMd}": symlink target is outside the managed source root`);
51329
51593
  await unlink(destMd);
51330
51594
  return;
51331
51595
  }
@@ -51335,6 +51599,8 @@ async function applyOneSkillChange(name, targetState, publicDir, curatedDir) {
51335
51599
  if (bundleStat !== undefined) {
51336
51600
  if (!bundleStat.isSymbolicLink())
51337
51601
  throw new Error(`refusing to remove "${destBundle}": not a symlink`);
51602
+ if (!await isOwnedSkillLink(destBundle, publicDir))
51603
+ throw new Error(`refusing to remove "${destBundle}": symlink target is outside the managed source root`);
51338
51604
  await unlink(destBundle);
51339
51605
  }
51340
51606
  return;
@@ -51345,6 +51611,8 @@ async function applyOneSkillChange(name, targetState, publicDir, curatedDir) {
51345
51611
  function skillApplyShortReason(error) {
51346
51612
  if (error.includes("not a symlink"))
51347
51613
  return "protected (not a symlink)";
51614
+ if (error.includes("outside the managed source root"))
51615
+ return "external target (not ours)";
51348
51616
  if (error.includes("different source"))
51349
51617
  return "installed from a different source";
51350
51618
  if (error.includes("skill not found") || error.includes("source vanished"))
@@ -51420,7 +51688,7 @@ function skillStateText(row, pendingState) {
51420
51688
  }
51421
51689
  async function ensureCuratedDir(curatedDir) {
51422
51690
  try {
51423
- await mkdir2(curatedDir, { recursive: true });
51691
+ await mkdir3(curatedDir, { recursive: true });
51424
51692
  } catch {}
51425
51693
  }
51426
51694
  var SKILL_SUMMARY_MAX_ITEMS = 3, DESCRIPTION_MAX2 = 90;
@@ -58322,7 +58590,7 @@ var init_subagents_viewer = __esm(() => {
58322
58590
  import { TextAttributes as TextAttributes12 } from "@opentui/core";
58323
58591
  function resolveVersion() {
58324
58592
  try {
58325
- return "0.13.1";
58593
+ return "0.14.0";
58326
58594
  } catch {
58327
58595
  return "dev";
58328
58596
  }
@@ -60783,6 +61051,10 @@ function V2SessionPage(props) {
60783
61051
  showNotice(pendingMigrationNotice);
60784
61052
  pendingMigrationNotice = undefined;
60785
61053
  }
61054
+ if (pendingAgentsHomeNotice) {
61055
+ showNotice(pendingAgentsHomeNotice);
61056
+ pendingAgentsHomeNotice = undefined;
61057
+ }
60786
61058
  const timer = setInterval(() => setNow(new Date), 1000);
60787
61059
  onCleanup(() => clearInterval(timer));
60788
61060
  });
@@ -61336,7 +61608,9 @@ async function bootClientV2(options = {}) {
61336
61608
  initialSessionId = autoResume?.id;
61337
61609
  resumeNotice = autoResume?.line;
61338
61610
  }
61339
- const agentsHomeForSkills = resolveAgentsHome(seam.configLoad().agentsHome);
61611
+ const agentsHomeConfig = seam.configLoad().agentsHome;
61612
+ const agentsHomeForSkills = resolveAgentsHome(agentsHomeConfig);
61613
+ pendingAgentsHomeNotice = agentsHomeEnvWarning(undefined, agentsHomeConfig);
61340
61614
  const skillRows = discoverSkills({
61341
61615
  cwd: workspace,
61342
61616
  dshHome: host.dshHome,
@@ -61464,7 +61738,7 @@ function ErrorBoundaryDiagnostics(props) {
61464
61738
  }
61465
61739
  });
61466
61740
  }
61467
- var SHELL, overlays, pendingMigrationNotice, themeModePatchKey = "themeMode";
61741
+ var SHELL, overlays, pendingMigrationNotice, pendingAgentsHomeNotice, themeModePatchKey = "themeMode";
61468
61742
  var init_v2_entry = __esm(() => {
61469
61743
  init_server();
61470
61744
  init_index_bun();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-opentui",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "bin": {