bingocode 1.1.194 → 1.1.195
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,9 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
1
|
import type { LocalJSXCommandContext } from '../../commands.js'
|
|
3
2
|
import type { LocalJSXCommandOnDone } from '../../types/command.js'
|
|
3
|
+
import {
|
|
4
|
+
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
|
5
|
+
logEvent,
|
|
6
|
+
} from '../../services/analytics/index.js'
|
|
4
7
|
import { logError } from '../../utils/log.js'
|
|
5
8
|
import { updateSettingsForSource } from '../../utils/settings/settings.js'
|
|
6
9
|
|
|
@@ -8,18 +11,18 @@ export async function call(
|
|
|
8
11
|
onDone: LocalJSXCommandOnDone,
|
|
9
12
|
context: LocalJSXCommandContext,
|
|
10
13
|
args?: string,
|
|
11
|
-
): Promise<
|
|
14
|
+
): Promise<null> {
|
|
12
15
|
try {
|
|
13
|
-
const arg = args
|
|
16
|
+
const arg = (args ?? '').trim().toLowerCase()
|
|
14
17
|
const enable = arg !== 'off'
|
|
15
18
|
|
|
16
|
-
// Persist to disk
|
|
17
19
|
const result = updateSettingsForSource('userSettings', { execMode: enable })
|
|
18
20
|
if (result.error) {
|
|
19
21
|
logError(result.error)
|
|
22
|
+
onDone(`Failed to ${enable ? 'enable' : 'disable'} Exec Mode: ${result.error.message}`, { display: 'system' })
|
|
23
|
+
return null
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
// Update AppState to trigger React re-render (like /fast does)
|
|
23
26
|
if (enable) {
|
|
24
27
|
context.setAppState(prev => ({ ...prev, execMode: true }))
|
|
25
28
|
onDone('✓ Exec Mode enabled', { display: 'system' })
|
|
@@ -27,10 +30,16 @@ export async function call(
|
|
|
27
30
|
context.setAppState(prev => ({ ...prev, execMode: false }))
|
|
28
31
|
onDone('✗ Exec Mode disabled', { display: 'system' })
|
|
29
32
|
}
|
|
33
|
+
|
|
34
|
+
logEvent('tengu_exec_mode_toggled', {
|
|
35
|
+
enabled: enable,
|
|
36
|
+
source: 'shortcut' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
|
37
|
+
})
|
|
38
|
+
|
|
30
39
|
return null
|
|
31
40
|
} catch (e) {
|
|
32
|
-
logError(e
|
|
33
|
-
onDone(`
|
|
41
|
+
logError(e)
|
|
42
|
+
onDone(`Error: ${String(e)}`, { display: 'system' })
|
|
34
43
|
return null
|
|
35
44
|
}
|
|
36
45
|
}
|
|
@@ -1,44 +1,16 @@
|
|
|
1
1
|
import type { Command } from '../../commands.js'
|
|
2
|
-
import { logError } from '../../utils/log.js'
|
|
3
|
-
import { updateSettingsForSource } from '../../utils/settings/settings.js'
|
|
4
2
|
|
|
5
|
-
const exec
|
|
3
|
+
const exec = {
|
|
6
4
|
type: 'local-jsx',
|
|
7
5
|
name: 'exec',
|
|
8
6
|
description:
|
|
9
7
|
'Enable execution policy — dispatch-first, context protection, compressed output',
|
|
8
|
+
availability: ['claude-ai', 'console'],
|
|
10
9
|
aliases: ['executor'],
|
|
11
10
|
argumentHint: '[off]',
|
|
12
11
|
isEnabled: () => true,
|
|
13
12
|
immediate: true,
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
},
|
|
42
|
-
}
|
|
13
|
+
load: () => import('./exec.js'),
|
|
14
|
+
} satisfies Command
|
|
43
15
|
|
|
44
16
|
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(chalk.yellow('» EXEC'))
|
|
2331
|
+
segments.push(chalk.yellow('» EXEC'))
|
|
2332
2332
|
}
|
|
2333
2333
|
return { content: ` ${segments.join(' ')} `, position: 'top', align: 'end', offset: 0 }
|
|
2334
2334
|
}
|