@aiwayds/dsh-opentui 0.26.2 → 0.26.4
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 +26 -0
- package/README.md +3 -3
- package/dist/bridge/approval-gate.js +38 -3
- package/dist/bridge/bundle-fingerprint.json +1 -1
- package/dist/bridge/index.js +102 -15
- package/dist/client/index.js +5 -4
- package/dist/client/index.js.map +5 -5
- package/dist/locales/en.json +3 -3
- package/dist/locales/zh-CN.json +3 -3
- package/package.json +1 -1
- package/scripts/provision-inproc-profile.mjs +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,32 @@ 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.26.4] - 2026-11-23
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **`/goals` is renamed to `/goal`** to match the host/web command name. There
|
|
13
|
+
is no runtime alias: typing the old `/goals` now yields `unknown command`.
|
|
14
|
+
The seven operations (status, create, edit, pause, resume, complete, clear),
|
|
15
|
+
the bare-command read-only status, and the write-confirmation flow are
|
|
16
|
+
unchanged; saved usage counts carry over once through the renamed-command
|
|
17
|
+
migration.
|
|
18
|
+
- **The inproc profile pins the host subagent `maxDepth` to 1.** Depth is
|
|
19
|
+
absolute (lead 0, direct child 1): direct children are allowed, grandchildren
|
|
20
|
+
(depth 2) are rejected, closing the depth-≥2 delegation-gate silent-pass
|
|
21
|
+
window and surviving host default drift. `0` is never used — it would refuse
|
|
22
|
+
every delegation. The pin is the initial default of a volatile setting, so a
|
|
23
|
+
runtime change by the host is still possible.
|
|
24
|
+
|
|
25
|
+
## [0.26.3] - 2026-11-22
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Full-access delegation now inherits the parent's approval policy across live
|
|
30
|
+
and resumed children (parent policy events, bind/reconcile re-sync and child
|
|
31
|
+
turn-start re-pin), so returning to `ask` no longer leaves a child on `never`
|
|
32
|
+
and silently bypasses the write-approval gate.
|
|
33
|
+
|
|
8
34
|
## [0.25.0] - 2026-11-22
|
|
9
35
|
|
|
10
36
|
### Added
|
package/README.md
CHANGED
|
@@ -245,7 +245,7 @@ card — **Enter** allows once, **Esc** declines (fail-closed); read-only tools
|
|
|
245
245
|
such as read_file pass straight through. `esc` ×2 + confirm stops a running
|
|
246
246
|
turn. Ctrl+C twice quits. Commands (see `/help` inside the TUI for the full
|
|
247
247
|
list): `/help` `/model [provider/id]` `/model discover` `/btw` `/plugins`
|
|
248
|
-
`/
|
|
248
|
+
`/goal` `/login` `/logout` `/account` `/settings` `/agents` `/skills`
|
|
249
249
|
`/search` `/history` `/subagents` `/session` `/export` `/think` `/preset`
|
|
250
250
|
`/theme` `/language` `/motion` `/hints` `/hotkeys` `/stop` `/resume` `/new`
|
|
251
251
|
`/clear` `/flush` `/quit`.
|
|
@@ -299,7 +299,7 @@ Command faces backed by real host data (0.24–0.25):
|
|
|
299
299
|
- **`/plugins`** — a plugin-manager panel with list + detail and install /
|
|
300
300
|
uninstall / enable / disable behind a confirmation modal; install progress
|
|
301
301
|
is polled with a bounded wait and can be cancelled.
|
|
302
|
-
- **`/
|
|
302
|
+
- **`/goal`** — goal data with 7 operations: status, create, edit, pause,
|
|
303
303
|
resume, complete, clear; writes confirm first.
|
|
304
304
|
- **`/model discover`** — query the current provider for its model list. The
|
|
305
305
|
positive path is environment-dependent and was NOT RUN in the scratch gate
|
|
@@ -417,7 +417,7 @@ verify70 gate went green; 28 methods were hand-wired and `@manual` reached 0.
|
|
|
417
417
|
tables plus a generic dispatch arm (ADR-0012) and a per-id allowlist take the
|
|
418
418
|
wired set to 58/257 while `check-capcontract` stays green at 22/22 assertions.
|
|
419
419
|
New command faces ride real host data — `/btw` side sessions, a `/plugins`
|
|
420
|
-
manager panel with confirm-gated writes and bounded install progress, `/
|
|
420
|
+
manager panel with confirm-gated writes and bounded install progress, `/goal`
|
|
421
421
|
with 7 operations, `/model discover`, separate `/login` and `/account` domains,
|
|
422
422
|
and real `/search`, `/history` and `/subagents` data. The legacy podman
|
|
423
423
|
`e2e/scenarios/` container layer was retired (ADR-0013), verify70 closed at
|
|
@@ -36,6 +36,14 @@ function resolveApprovalGateConfig(config) {
|
|
|
36
36
|
}
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
|
+
function sessionIdOf(session) {
|
|
40
|
+
if (session !== null && typeof session === "object") {
|
|
41
|
+
const id = session.id;
|
|
42
|
+
if (typeof id === "string" && id !== "")
|
|
43
|
+
return id;
|
|
44
|
+
}
|
|
45
|
+
return "(unknown)";
|
|
46
|
+
}
|
|
39
47
|
function decideAsk(exec, config) {
|
|
40
48
|
if (!config.enabled)
|
|
41
49
|
return;
|
|
@@ -50,11 +58,16 @@ function decideAsk(exec, config) {
|
|
|
50
58
|
}
|
|
51
59
|
return decision;
|
|
52
60
|
}
|
|
53
|
-
function createPreExecuteListener(config) {
|
|
61
|
+
function createPreExecuteListener(config, lookup, onBypass) {
|
|
54
62
|
return (exec, next) => {
|
|
55
63
|
const decision = decideAsk(exec, config);
|
|
56
|
-
if (decision !== undefined)
|
|
64
|
+
if (decision !== undefined) {
|
|
65
|
+
if (lookup?.(exec) === "never") {
|
|
66
|
+
onBypass?.(exec);
|
|
67
|
+
return next();
|
|
68
|
+
}
|
|
57
69
|
return Promise.resolve(decision);
|
|
70
|
+
}
|
|
58
71
|
return next();
|
|
59
72
|
};
|
|
60
73
|
}
|
|
@@ -68,7 +81,29 @@ function apply(ctx, config) {
|
|
|
68
81
|
ctx.logger?.warn("[approval-gate] ctx.on unavailable — gate not registered (all tools pass)");
|
|
69
82
|
return () => {};
|
|
70
83
|
}
|
|
71
|
-
const
|
|
84
|
+
const lookup = (exec) => {
|
|
85
|
+
const session = exec.agent?.session;
|
|
86
|
+
if (session === undefined || session === null)
|
|
87
|
+
return;
|
|
88
|
+
let approval;
|
|
89
|
+
try {
|
|
90
|
+
approval = typeof ctx.get === "function" ? ctx.get("approval") : undefined;
|
|
91
|
+
} catch {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (typeof approval?.effectivePolicy !== "function")
|
|
95
|
+
return;
|
|
96
|
+
try {
|
|
97
|
+
return approval.effectivePolicy(session);
|
|
98
|
+
} catch {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const onBypass = (exec) => {
|
|
103
|
+
const toolName = typeof exec.name === "string" && exec.name !== "" ? exec.name : "(unknown)";
|
|
104
|
+
ctx.logger?.debug?.("[approval-gate] policy bypass: %s passes without ask (session %s effective policy never)", toolName, sessionIdOf(exec.agent?.session));
|
|
105
|
+
};
|
|
106
|
+
const listener = createPreExecuteListener(policy, lookup, onBypass);
|
|
72
107
|
const unsub = ctx.on("tools/pre-execute", listener);
|
|
73
108
|
return () => {
|
|
74
109
|
try {
|
package/dist/bridge/index.js
CHANGED
|
@@ -8400,12 +8400,9 @@ function apply(ctx, config) {
|
|
|
8400
8400
|
logger.warn("[bridge:stat] turn=%s deltas=%d tokenFrames=%d textChars=%d reasonChars=%d", state.turnId, state.deltaCount, state.tokenFrameCount, state.textAcc.length, state.reasoningAcc.length);
|
|
8401
8401
|
}
|
|
8402
8402
|
}
|
|
8403
|
-
|
|
8404
|
-
function repinChildApprovalPolicy(childId, parentSessionId) {
|
|
8403
|
+
function syncChildApprovalPolicy(childId, parentSessionId, desiredOverride) {
|
|
8405
8404
|
if (binding === undefined || parentSessionId !== binding.sessionId)
|
|
8406
8405
|
return;
|
|
8407
|
-
if (repinnedChildren.has(childId))
|
|
8408
|
-
return;
|
|
8409
8406
|
const get = ctx.get;
|
|
8410
8407
|
if (typeof get !== "function")
|
|
8411
8408
|
return;
|
|
@@ -8414,11 +8411,14 @@ function apply(ctx, config) {
|
|
|
8414
8411
|
try {
|
|
8415
8412
|
sessions = get.call(ctx, "sessions");
|
|
8416
8413
|
approval = get.call(ctx, "approval");
|
|
8417
|
-
} catch {
|
|
8414
|
+
} catch (err) {
|
|
8415
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: service lookup failed child=%s parent=%s: %s", childId, parentSessionId, String(err));
|
|
8418
8416
|
return;
|
|
8419
8417
|
}
|
|
8420
|
-
if (typeof sessions?.get !== "function")
|
|
8418
|
+
if (typeof sessions?.get !== "function") {
|
|
8419
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: sessions.get unavailable child=%s parent=%s", childId, parentSessionId);
|
|
8421
8420
|
return;
|
|
8421
|
+
}
|
|
8422
8422
|
let childSession;
|
|
8423
8423
|
try {
|
|
8424
8424
|
childSession = sessions.get(childId);
|
|
@@ -8427,19 +8427,61 @@ function apply(ctx, config) {
|
|
|
8427
8427
|
}
|
|
8428
8428
|
if (childSession === undefined || typeof childSession.append !== "function")
|
|
8429
8429
|
return;
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8430
|
+
let parentSession;
|
|
8431
|
+
try {
|
|
8432
|
+
parentSession = sessions.get(parentSessionId);
|
|
8433
|
+
} catch (err) {
|
|
8434
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: parent session lookup failed child=%s parent=%s: %s", childId, parentSessionId, String(err));
|
|
8435
|
+
return;
|
|
8436
|
+
}
|
|
8437
|
+
if (parentSession === undefined) {
|
|
8438
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: parent session not found child=%s parent=%s", childId, parentSessionId);
|
|
8439
|
+
return;
|
|
8440
|
+
}
|
|
8441
|
+
if (approval === undefined || typeof approval.effectivePolicy !== "function" || typeof approval.overrideOf !== "function") {
|
|
8442
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: approval service/effectivePolicy/overrideOf unavailable child=%s parent=%s", childId, parentSessionId);
|
|
8443
|
+
return;
|
|
8444
|
+
}
|
|
8445
|
+
let desired;
|
|
8446
|
+
if (desiredOverride === "ask" || desiredOverride === "never") {
|
|
8447
|
+
desired = desiredOverride;
|
|
8448
|
+
} else {
|
|
8449
|
+
try {
|
|
8450
|
+
desired = approval.effectivePolicy(parentSession);
|
|
8451
|
+
} catch (err) {
|
|
8452
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: effectivePolicy threw child=%s parent=%s: %s", childId, parentSessionId, String(err));
|
|
8434
8453
|
return;
|
|
8435
8454
|
}
|
|
8436
8455
|
}
|
|
8456
|
+
if (desired !== "ask" && desired !== "never") {
|
|
8457
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: unresolved desired policy=%s child=%s parent=%s", String(desired), childId, parentSessionId);
|
|
8458
|
+
return;
|
|
8459
|
+
}
|
|
8460
|
+
let current;
|
|
8437
8461
|
try {
|
|
8438
|
-
|
|
8439
|
-
repinnedChildren.add(childId);
|
|
8440
|
-
logger.info("[dsh-opentui-bridge] child approval re-pinned to ask child=%s parent=%s (delegation never pin overridden)", childId, parentSessionId);
|
|
8462
|
+
current = approval.overrideOf(childSession);
|
|
8441
8463
|
} catch (err) {
|
|
8442
|
-
logger.warn("[dsh-opentui-bridge] child approval
|
|
8464
|
+
logger.warn("[dsh-opentui-bridge] child approval sync skipped: overrideOf threw child=%s parent=%s: %s", childId, parentSessionId, String(err));
|
|
8465
|
+
return;
|
|
8466
|
+
}
|
|
8467
|
+
if (current === desired)
|
|
8468
|
+
return;
|
|
8469
|
+
try {
|
|
8470
|
+
childSession.append("approval/policy", { policy: desired });
|
|
8471
|
+
if (current === "never" && desired === "ask") {
|
|
8472
|
+
logger.warn("[dsh-opentui-bridge] child approval self-healed never→ask child=%s parent=%s (policy mirror recovered a skipped sync)", childId, parentSessionId);
|
|
8473
|
+
} else {
|
|
8474
|
+
logger.info("[dsh-opentui-bridge] child approval mirrored to %s child=%s parent=%s (was %s)", desired, childId, parentSessionId, String(current));
|
|
8475
|
+
}
|
|
8476
|
+
} catch (err) {
|
|
8477
|
+
logger.warn("[dsh-opentui-bridge] child approval sync append failed child=%s parent=%s: %s", childId, parentSessionId, String(err));
|
|
8478
|
+
}
|
|
8479
|
+
}
|
|
8480
|
+
function syncKnownChildrenOfBinding(bindingSessionId) {
|
|
8481
|
+
for (const [childId, row] of getSubagentIndex(ctx).rows) {
|
|
8482
|
+
if (row.parentSessionId !== bindingSessionId)
|
|
8483
|
+
continue;
|
|
8484
|
+
syncChildApprovalPolicy(childId, bindingSessionId);
|
|
8443
8485
|
}
|
|
8444
8486
|
}
|
|
8445
8487
|
function onSessionEvent(session, event) {
|
|
@@ -8449,6 +8491,39 @@ function apply(ctx, config) {
|
|
|
8449
8491
|
const e = event;
|
|
8450
8492
|
const type = typeof e?.type === "string" ? e.type : "";
|
|
8451
8493
|
const data = e?.data !== null && typeof e?.data === "object" ? e.data : {};
|
|
8494
|
+
if (binding !== undefined) {
|
|
8495
|
+
if (type === "approval/policy" && sessionId === binding.sessionId) {
|
|
8496
|
+
for (const [childId, row] of getSubagentIndex(ctx).rows) {
|
|
8497
|
+
if (row.parentSessionId !== sessionId)
|
|
8498
|
+
continue;
|
|
8499
|
+
syncChildApprovalPolicy(childId, sessionId, data.policy);
|
|
8500
|
+
}
|
|
8501
|
+
}
|
|
8502
|
+
if (type === "turn/start" && sessionId === binding.sessionId) {
|
|
8503
|
+
syncKnownChildrenOfBinding(sessionId);
|
|
8504
|
+
}
|
|
8505
|
+
if (sessionId !== binding.sessionId) {
|
|
8506
|
+
const index = getSubagentIndex(ctx);
|
|
8507
|
+
if (index.has(sessionId)) {
|
|
8508
|
+
if (type === "turn/start") {
|
|
8509
|
+
const row = index.get(sessionId);
|
|
8510
|
+
if (row !== undefined && row.parentSessionId === binding.sessionId) {
|
|
8511
|
+
const childId = sessionId;
|
|
8512
|
+
const parentId = binding.sessionId;
|
|
8513
|
+
queueMicrotask(() => syncChildApprovalPolicy(childId, parentId));
|
|
8514
|
+
}
|
|
8515
|
+
}
|
|
8516
|
+
} else {
|
|
8517
|
+
const header = s.header;
|
|
8518
|
+
if (header?.origin === "subagent" && header?.parentSession === binding.sessionId) {
|
|
8519
|
+
index.noteCatalog(sessionId, binding.sessionId);
|
|
8520
|
+
const childId = sessionId;
|
|
8521
|
+
const parentId = binding.sessionId;
|
|
8522
|
+
queueMicrotask(() => syncChildApprovalPolicy(childId, parentId));
|
|
8523
|
+
}
|
|
8524
|
+
}
|
|
8525
|
+
}
|
|
8526
|
+
}
|
|
8452
8527
|
if (type === "subagent/catalog") {
|
|
8453
8528
|
const boundId = binding?.sessionId;
|
|
8454
8529
|
if (sessionId !== boundId)
|
|
@@ -8457,7 +8532,7 @@ function apply(ctx, config) {
|
|
|
8457
8532
|
if (!childId)
|
|
8458
8533
|
return;
|
|
8459
8534
|
getSubagentIndex(ctx).noteCatalog(childId, sessionId, typeof data.childCreatedAt === "number" ? data.childCreatedAt : undefined);
|
|
8460
|
-
|
|
8535
|
+
syncChildApprovalPolicy(childId, sessionId);
|
|
8461
8536
|
const turnId = state !== undefined && !state.ended ? state.turnId : inFlightTurnId ?? "";
|
|
8462
8537
|
const label = typeof data.label === "string" && data.label !== "" ? data.label : typeof data.name === "string" ? data.name : "";
|
|
8463
8538
|
const name = typeof data.name === "string" && data.name !== "" ? data.name : "";
|
|
@@ -8842,6 +8917,11 @@ function apply(ctx, config) {
|
|
|
8842
8917
|
startPushRelay(binding.sessionId);
|
|
8843
8918
|
startAccountRelay(binding.sessionId);
|
|
8844
8919
|
restoreSessionGrantsFromJournal(binding.sessionId);
|
|
8920
|
+
try {
|
|
8921
|
+
syncKnownChildrenOfBinding(binding.sessionId);
|
|
8922
|
+
} catch (err) {
|
|
8923
|
+
logger.warn("[dsh-opentui-bridge] resume child approval sync failed session=%s: %s", binding.sessionId, String(err));
|
|
8924
|
+
}
|
|
8845
8925
|
return;
|
|
8846
8926
|
}
|
|
8847
8927
|
if (!replace) {
|
|
@@ -8908,6 +8988,11 @@ function apply(ctx, config) {
|
|
|
8908
8988
|
pushResumePendingSnapshot(sessionId);
|
|
8909
8989
|
restoreSessionGrantsFromJournal(sessionId);
|
|
8910
8990
|
}
|
|
8991
|
+
try {
|
|
8992
|
+
syncKnownChildrenOfBinding(sessionId);
|
|
8993
|
+
} catch (err) {
|
|
8994
|
+
logger.warn("[dsh-opentui-bridge] bind-time child approval sync failed session=%s: %s", sessionId, String(err));
|
|
8995
|
+
}
|
|
8911
8996
|
} catch (err) {
|
|
8912
8997
|
logger.error("[dsh-opentui-bridge] session.open failed: %s", err);
|
|
8913
8998
|
const mapped = mapHostError(err);
|
|
@@ -9119,6 +9204,8 @@ function apply(ctx, config) {
|
|
|
9119
9204
|
if (raw !== null && typeof raw === "object" && !Array.isArray(raw) && Array.isArray(raw.items)) {
|
|
9120
9205
|
const count = getSubagentIndex(ctx).syncFromList(raw.items);
|
|
9121
9206
|
logger.info("[dsh-opentui-bridge] subagent index reconciled: subagents=%d rows=%d", count, getSubagentIndex(ctx).rows.size);
|
|
9207
|
+
if (binding !== undefined)
|
|
9208
|
+
syncKnownChildrenOfBinding(binding.sessionId);
|
|
9122
9209
|
} else {
|
|
9123
9210
|
logger.warn("[dsh-opentui-bridge] subagent index reconcile skipped: malformed session.list reply");
|
|
9124
9211
|
}
|
package/dist/client/index.js
CHANGED
|
@@ -54501,7 +54501,7 @@ function coreCommands() {
|
|
|
54501
54501
|
}
|
|
54502
54502
|
},
|
|
54503
54503
|
{
|
|
54504
|
-
name: "/
|
|
54504
|
+
name: "/goal",
|
|
54505
54505
|
description: t("command.goals.description"),
|
|
54506
54506
|
async run(ctx, argText) {
|
|
54507
54507
|
const goals = ctx.seam.goals;
|
|
@@ -55280,7 +55280,8 @@ function createCommandUsage(seam, debounceMs = SAVE_DEBOUNCE_MS) {
|
|
|
55280
55280
|
var SLASH_USAGE_KEY = "slashUsage", SAVE_DEBOUNCE_MS = 1200, RENAMED_COMMANDS, pending, exitHooked = false;
|
|
55281
55281
|
var init_slash_usage = __esm(() => {
|
|
55282
55282
|
RENAMED_COMMANDS = {
|
|
55283
|
-
"/resume": "/sessions"
|
|
55283
|
+
"/resume": "/sessions",
|
|
55284
|
+
"/goal": "/goals"
|
|
55284
55285
|
};
|
|
55285
55286
|
pending = new Set;
|
|
55286
55287
|
});
|
|
@@ -64607,7 +64608,7 @@ var init_subagents_viewer = __esm(() => {
|
|
|
64607
64608
|
import { TextAttributes as TextAttributes12 } from "@opentui/core";
|
|
64608
64609
|
function resolveVersion() {
|
|
64609
64610
|
try {
|
|
64610
|
-
return "0.26.
|
|
64611
|
+
return "0.26.4";
|
|
64611
64612
|
} catch {
|
|
64612
64613
|
return "dev";
|
|
64613
64614
|
}
|
|
@@ -71985,5 +71986,5 @@ export {
|
|
|
71985
71986
|
themeNameFromConfig
|
|
71986
71987
|
};
|
|
71987
71988
|
|
|
71988
|
-
//# debugId=
|
|
71989
|
+
//# debugId=748BAC5B187F3EA364756E2164756E21
|
|
71989
71990
|
//# sourceMappingURL=index.js.map
|