bingocode 1.1.189 → 1.1.191
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/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import type { LocalJSXCommandContext } from '../../commands.js'
|
|
3
3
|
import type { LocalJSXCommandOnDone } from '../../types/command.js'
|
|
4
|
+
import { logError } from '../../utils/log.js'
|
|
4
5
|
import { updateSettingsForSource } from '../../utils/settings/settings.js'
|
|
5
6
|
|
|
6
7
|
export async function call(
|
|
@@ -8,19 +9,28 @@ export async function call(
|
|
|
8
9
|
context: LocalJSXCommandContext,
|
|
9
10
|
args?: string,
|
|
10
11
|
): Promise<React.ReactNode | null> {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
try {
|
|
13
|
+
const arg = args?.trim().toLowerCase()
|
|
14
|
+
const enable = arg !== 'off'
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
// Persist to disk
|
|
17
|
+
const result = updateSettingsForSource('userSettings', { execMode: enable })
|
|
18
|
+
if (result.error) {
|
|
19
|
+
logError(result.error)
|
|
20
|
+
}
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Update AppState to trigger React re-render (like /fast does)
|
|
23
|
+
if (enable) {
|
|
24
|
+
context.setAppState(prev => ({ ...prev, execMode: true }))
|
|
25
|
+
onDone('✓ Exec Mode enabled', { display: 'system' })
|
|
26
|
+
} else {
|
|
27
|
+
context.setAppState(prev => ({ ...prev, execMode: false }))
|
|
28
|
+
onDone('✗ Exec Mode disabled', { display: 'system' })
|
|
29
|
+
}
|
|
30
|
+
return null
|
|
31
|
+
} catch (e) {
|
|
32
|
+
logError(e instanceof Error ? e : new Error(String(e)))
|
|
33
|
+
onDone(`Exec command error: ${String(e)}`, { display: 'system' })
|
|
34
|
+
return null
|
|
24
35
|
}
|
|
25
|
-
return null
|
|
26
36
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Command } from '../../commands.js'
|
|
2
|
+
import { logError } from '../../utils/log.js'
|
|
3
|
+
import { updateSettingsForSource } from '../../utils/settings/settings.js'
|
|
2
4
|
|
|
3
5
|
const exec: Command = {
|
|
4
6
|
type: 'local-jsx',
|
|
@@ -9,7 +11,34 @@ const exec: Command = {
|
|
|
9
11
|
argumentHint: '[off]',
|
|
10
12
|
isEnabled: () => true,
|
|
11
13
|
immediate: true,
|
|
12
|
-
load
|
|
14
|
+
async load() {
|
|
15
|
+
return {
|
|
16
|
+
async call(onDone, context, args) {
|
|
17
|
+
try {
|
|
18
|
+
const arg = String(args ?? '').trim().toLowerCase()
|
|
19
|
+
const enable = arg !== 'off'
|
|
20
|
+
|
|
21
|
+
const result = updateSettingsForSource('userSettings', { execMode: enable })
|
|
22
|
+
if (result.error) {
|
|
23
|
+
logError(result.error)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (enable) {
|
|
27
|
+
context.setAppState(prev => ({ ...prev, execMode: true }))
|
|
28
|
+
onDone('✓ Exec Mode enabled', { display: 'system' })
|
|
29
|
+
} else {
|
|
30
|
+
context.setAppState(prev => ({ ...prev, execMode: false }))
|
|
31
|
+
onDone('✗ Exec Mode disabled', { display: 'system' })
|
|
32
|
+
}
|
|
33
|
+
return null
|
|
34
|
+
} catch (e) {
|
|
35
|
+
logError(e instanceof Error ? e : new Error(String(e)))
|
|
36
|
+
onDone(`Error: ${String(e)}`, { display: 'system' })
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
},
|
|
13
42
|
}
|
|
14
43
|
|
|
15
44
|
export default exec
|
|
@@ -421,6 +421,8 @@ export type AppState = DeepImmutable<{
|
|
|
421
421
|
activeOverlays: ReadonlySet<string>
|
|
422
422
|
// Fast mode
|
|
423
423
|
fastMode?: boolean
|
|
424
|
+
// Executor mode
|
|
425
|
+
execMode?: boolean
|
|
424
426
|
// Advisor model for server-side advisor tool (undefined = disabled).
|
|
425
427
|
advisorModel?: string
|
|
426
428
|
// Effort value
|
|
@@ -565,5 +567,6 @@ export function getDefaultAppState(): AppState {
|
|
|
565
567
|
effortValue: undefined,
|
|
566
568
|
activeOverlays: new Set<string>(),
|
|
567
569
|
fastMode: false,
|
|
570
|
+
execMode: false,
|
|
568
571
|
}
|
|
569
572
|
}
|