@xp266/dshtui 0.1.2 → 0.1.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/lib/index.mjs +2 -2
- package/package.json +1 -1
- package/src/chat/bridge.ts +3 -3
package/lib/index.mjs
CHANGED
|
@@ -10497,12 +10497,12 @@ async function createChatBridge(ctx) {
|
|
|
10497
10497
|
currentEffort,
|
|
10498
10498
|
effortName,
|
|
10499
10499
|
selectEffort,
|
|
10500
|
-
permissionMode: () => permission()?.current(activeAgent.session
|
|
10500
|
+
permissionMode: () => permission()?.current(activeAgent.session) ?? PERMISSION_PRESETS[0],
|
|
10501
10501
|
cyclePermission: () => {
|
|
10502
10502
|
const service = permission();
|
|
10503
10503
|
if (service === void 0) return;
|
|
10504
10504
|
try {
|
|
10505
|
-
const current = service.current(activeAgent.session
|
|
10505
|
+
const current = service.current(activeAgent.session);
|
|
10506
10506
|
const names = service.names.length > 0 ? service.names : PERMISSION_PRESETS;
|
|
10507
10507
|
const next = names[(names.indexOf(current) + 1) % names.length];
|
|
10508
10508
|
service.set(activeAgent.session, next);
|
package/package.json
CHANGED
package/src/chat/bridge.ts
CHANGED
|
@@ -143,7 +143,7 @@ interface PresetSessionLike {
|
|
|
143
143
|
export const PERMISSION_PRESETS = ['workspace-write', 'danger-full-access', 'read-only'] as const
|
|
144
144
|
|
|
145
145
|
interface PermissionPresetsLike {
|
|
146
|
-
current(
|
|
146
|
+
current(session: Session): string
|
|
147
147
|
set(session: Session, name: string): void
|
|
148
148
|
readonly names: readonly string[]
|
|
149
149
|
readonly defaultPreset: string
|
|
@@ -1040,12 +1040,12 @@ export async function createChatBridge(ctx: Context): Promise<ChatBridge> {
|
|
|
1040
1040
|
currentEffort,
|
|
1041
1041
|
effortName,
|
|
1042
1042
|
selectEffort,
|
|
1043
|
-
permissionMode: () => permission()?.current(activeAgent.session
|
|
1043
|
+
permissionMode: () => permission()?.current(activeAgent.session) ?? PERMISSION_PRESETS[0],
|
|
1044
1044
|
cyclePermission: () => {
|
|
1045
1045
|
const service = permission()
|
|
1046
1046
|
if (service === undefined) return
|
|
1047
1047
|
try {
|
|
1048
|
-
const current = service.current(activeAgent.session
|
|
1048
|
+
const current = service.current(activeAgent.session)
|
|
1049
1049
|
const names = service.names.length > 0 ? service.names : PERMISSION_PRESETS
|
|
1050
1050
|
const index = names.indexOf(current)
|
|
1051
1051
|
const next = names[(index + 1) % names.length]
|