bingocode 1.1.190 → 1.1.192
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 +1 -1
- package/src/commands/exec/exec.tsx +22 -12
- package/src/commands/exec/index.ts +30 -1
- package/src/components/PromptInput/PromptInput.tsx +1 -1
- package/src/constants/prompts.ts +940 -940
- package/src/main.tsx +1 -0
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
|
|
@@ -2328,7 +2328,7 @@ function buildBorderText(showFastIcon: boolean, showFastIconHint: boolean, fastM
|
|
|
2328
2328
|
segments.push(showFastIconHint ? `${getFastIconString(true, fastModeCooldown)} ${chalk.dim('/fast')}` : getFastIconString(true, fastModeCooldown))
|
|
2329
2329
|
}
|
|
2330
2330
|
if (isExecMode) {
|
|
2331
|
-
segments.push('
|
|
2331
|
+
segments.push(chalk.yellow('» EXEC'))))
|
|
2332
2332
|
}
|
|
2333
2333
|
return { content: ` ${segments.join(' ')} `, position: 'top', align: 'end', offset: 0 }
|
|
2334
2334
|
}
|