@molecule/app-ide-panel-logic 1.2.0 → 1.3.0
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/README.md +368 -3
- package/dist/command-metadata.d.ts +225 -4
- package/dist/command-metadata.d.ts.map +1 -1
- package/dist/command-metadata.js +163 -2
- package/dist/command-metadata.js.map +1 -1
- package/dist/components/chat-models-utilities.d.ts +16 -0
- package/dist/components/chat-models-utilities.d.ts.map +1 -1
- package/dist/components/chat-models-utilities.js +25 -0
- package/dist/components/chat-models-utilities.js.map +1 -1
- package/dist/components/chat-settings-utilities.d.ts +65 -4
- package/dist/components/chat-settings-utilities.d.ts.map +1 -1
- package/dist/components/chat-settings-utilities.js +155 -4
- package/dist/components/chat-settings-utilities.js.map +1 -1
- package/dist/components/chat-share-utilities.d.ts +39 -0
- package/dist/components/chat-share-utilities.d.ts.map +1 -1
- package/dist/components/chat-share-utilities.js +91 -0
- package/dist/components/chat-share-utilities.js.map +1 -1
- package/dist/components/chat-tips-utilities.d.ts +72 -7
- package/dist/components/chat-tips-utilities.d.ts.map +1 -1
- package/dist/components/chat-tips-utilities.js +68 -0
- package/dist/components/chat-tips-utilities.js.map +1 -1
- package/dist/components/context-usage-utilities.d.ts +32 -0
- package/dist/components/context-usage-utilities.d.ts.map +1 -0
- package/dist/components/context-usage-utilities.js +77 -0
- package/dist/components/context-usage-utilities.js.map +1 -0
- package/dist/components/headless-hooks.d.ts +89 -0
- package/dist/components/headless-hooks.d.ts.map +1 -0
- package/dist/components/headless-hooks.js +254 -0
- package/dist/components/headless-hooks.js.map +1 -0
- package/dist/components/preview-panel-logic.d.ts +182 -0
- package/dist/components/preview-panel-logic.d.ts.map +1 -0
- package/dist/components/preview-panel-logic.js +1993 -0
- package/dist/components/preview-panel-logic.js.map +1 -0
- package/dist/components/preview-panel-session.d.ts +62 -0
- package/dist/components/preview-panel-session.d.ts.map +1 -0
- package/dist/components/preview-panel-session.js +40 -0
- package/dist/components/preview-panel-session.js.map +1 -0
- package/dist/components/quick-picker-utilities.d.ts +19 -0
- package/dist/components/quick-picker-utilities.d.ts.map +1 -0
- package/dist/components/quick-picker-utilities.js +36 -0
- package/dist/components/quick-picker-utilities.js.map +1 -0
- package/dist/components/tool-call-utilities.d.ts +14 -5
- package/dist/components/tool-call-utilities.d.ts.map +1 -1
- package/dist/components/tool-call-utilities.js +111 -51
- package/dist/components/tool-call-utilities.js.map +1 -1
- package/dist/panels.d.ts +8 -2
- package/dist/panels.d.ts.map +1 -1
- package/dist/panels.js +8 -2
- package/dist/panels.js.map +1 -1
- package/dist/settings-metadata.d.ts +33 -2
- package/dist/settings-metadata.d.ts.map +1 -1
- package/dist/settings-metadata.js +138 -2
- package/dist/settings-metadata.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-17T07:08:06.498Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ide-panel-logic
|
|
@@ -93,7 +93,7 @@ interface CommandDef {
|
|
|
93
93
|
* e.g. `['t']` lets `/t <message>` invoke `/teamsay`. Matched by the chat
|
|
94
94
|
* input's command dispatch alongside {@link id}.
|
|
95
95
|
*/
|
|
96
|
-
aliases?: string[]
|
|
96
|
+
aliases?: readonly string[]
|
|
97
97
|
/**
|
|
98
98
|
* True for a human-only side-channel command handled by the HOST's server
|
|
99
99
|
* (e.g. a team-chat note the agent never sees): the raw `/command` text is
|
|
@@ -1178,6 +1178,19 @@ Category keys used to group commands in the menu and in `/help`.
|
|
|
1178
1178
|
type CommandCategoryKey = 'context' | 'code' | 'collaborate' | 'model' | 'settings' | 'support'
|
|
1179
1179
|
```
|
|
1180
1180
|
|
|
1181
|
+
#### `WrittenCommandId`
|
|
1182
|
+
|
|
1183
|
+
The literal id of every command in {@link COMMANDS} — the union the command
|
|
1184
|
+
label helpers switch over. Unlike {@link CommandId} (every `CommandDef` id,
|
|
1185
|
+
including host-added commands), this is closed over the shared registry:
|
|
1186
|
+
adding a command to {@link COMMANDS} extends it, so the label switches below
|
|
1187
|
+
fail to compile until the new command has its label — a command can no longer
|
|
1188
|
+
ship with no translation site.
|
|
1189
|
+
|
|
1190
|
+
```typescript
|
|
1191
|
+
type WrittenCommandId = (typeof COMMANDS)[number]['id']
|
|
1192
|
+
```
|
|
1193
|
+
|
|
1181
1194
|
#### `CommandId`
|
|
1182
1195
|
|
|
1183
1196
|
Union of all command ids (loosely `string`, since {@link CommandDef.id} is a string).
|
|
@@ -1625,6 +1638,67 @@ function matchesSideChannelCommand(defs: readonly CommandDef[] | undefined, text
|
|
|
1625
1638
|
|
|
1626
1639
|
**Returns:** Whether the text invokes a side-channel command.
|
|
1627
1640
|
|
|
1641
|
+
#### `isRegistryCommandId(id)`
|
|
1642
|
+
|
|
1643
|
+
Whether `id` is one of the shared registry's commands ({@link COMMANDS}).
|
|
1644
|
+
|
|
1645
|
+
Host-provided commands (e.g. molecule.dev's `/deploy`, `/teamsay`) are NOT
|
|
1646
|
+
registry commands: they carry their own English description and have no key
|
|
1647
|
+
in the shared locale bond, so callers render {@link CommandDef.description}
|
|
1648
|
+
directly for them and route registry commands through
|
|
1649
|
+
{@link commandDescription}.
|
|
1650
|
+
|
|
1651
|
+
```typescript
|
|
1652
|
+
function isRegistryCommandId(id: string): id is WrittenCommandId
|
|
1653
|
+
```
|
|
1654
|
+
|
|
1655
|
+
- `id` — The command id to test.
|
|
1656
|
+
|
|
1657
|
+
**Returns:** True when the id belongs to the shared registry.
|
|
1658
|
+
|
|
1659
|
+
#### `commandDescription(t, id, values)`
|
|
1660
|
+
|
|
1661
|
+
The localized one-line description of a registry command (the
|
|
1662
|
+
`ide.chat.cmd.<id>.desc` keys), through the CALLER's translate function so a
|
|
1663
|
+
framework port and a live locale switch both get their own text. One literal
|
|
1664
|
+
`t()` call per registry id, chosen by a switch exhaustive over
|
|
1665
|
+
{@link WrittenCommandId}: adding a command to {@link COMMANDS} without adding
|
|
1666
|
+
its case here is a compile error, so a command can never ship untranslated.
|
|
1667
|
+
Each `defaultValue` is the same English the command's `description` field
|
|
1668
|
+
carries (the text the API system prompt renders), so the English output is
|
|
1669
|
+
identical either way.
|
|
1670
|
+
|
|
1671
|
+
```typescript
|
|
1672
|
+
function commandDescription(
|
|
1673
|
+
t: TranslateFunction,
|
|
1674
|
+
id: WrittenCommandId,
|
|
1675
|
+
values?: InterpolationValues,
|
|
1676
|
+
): string
|
|
1677
|
+
```
|
|
1678
|
+
|
|
1679
|
+
- `t` — The caller's translate function (React passes `useTranslation()`'s `t`).
|
|
1680
|
+
- `id` — The command id; MUST be a registry id — narrow a possibly host-added id with {@link isRegistryCommandId} first.
|
|
1681
|
+
- `values` — Interpolation values; the descriptions interpolate `{{agentName}}` (and the caller's agent identity fills it in).
|
|
1682
|
+
|
|
1683
|
+
**Returns:** The localized description.
|
|
1684
|
+
|
|
1685
|
+
#### `commandCategoryLabel(t, key)`
|
|
1686
|
+
|
|
1687
|
+
The localized heading of a command category (the `ide.chat.help.category.<key>`
|
|
1688
|
+
keys), through the CALLER's translate function. One literal `t()` call per
|
|
1689
|
+
{@link CommandCategoryKey}, exhaustive: a new category key fails to compile
|
|
1690
|
+
until it has a heading. Each `defaultValue` equals the category's `label`
|
|
1691
|
+
field, so the English output is unchanged.
|
|
1692
|
+
|
|
1693
|
+
```typescript
|
|
1694
|
+
function commandCategoryLabel(t: TranslateFunction, key: CommandCategoryKey): string
|
|
1695
|
+
```
|
|
1696
|
+
|
|
1697
|
+
- `t` — The caller's translate function.
|
|
1698
|
+
- `key` — The category key.
|
|
1699
|
+
|
|
1700
|
+
**Returns:** The localized category heading.
|
|
1701
|
+
|
|
1628
1702
|
#### `activityIconName(type)`
|
|
1629
1703
|
|
|
1630
1704
|
Returns the bonded-icon-set glyph NAME for an activity type — pass it to
|
|
@@ -2028,6 +2102,59 @@ function buildShareUrl(result: ShareLinkResult, origin: string): string
|
|
|
2028
2102
|
|
|
2029
2103
|
**Returns:** The absolute, copyable share URL.
|
|
2030
2104
|
|
|
2105
|
+
#### `shareRoleLabel(t, role)`
|
|
2106
|
+
|
|
2107
|
+
The localized picker label for a share role (the `ide.chat.share.role.<role>`
|
|
2108
|
+
keys), through the CALLER's translate function so a framework port and a
|
|
2109
|
+
live locale switch both get their own text. One literal `t()` call per
|
|
2110
|
+
{@link ShareRole}, chosen by a switch exhaustive over the role union: a new
|
|
2111
|
+
role in {@link SHARE_ROLES} fails to compile until it has a label. Each
|
|
2112
|
+
`defaultValue` equals that role's {@link SHARE_ROLE_LABELS} entry, so the
|
|
2113
|
+
English output is unchanged.
|
|
2114
|
+
|
|
2115
|
+
```typescript
|
|
2116
|
+
function shareRoleLabel(t: TranslateFunction, role: ShareRole): string
|
|
2117
|
+
```
|
|
2118
|
+
|
|
2119
|
+
- `t` — The caller's translate function (React passes `useTranslation()`'s `t`).
|
|
2120
|
+
- `role` — The share role.
|
|
2121
|
+
|
|
2122
|
+
**Returns:** The localized role label.
|
|
2123
|
+
|
|
2124
|
+
#### `shareGrantsText(t, role)`
|
|
2125
|
+
|
|
2126
|
+
The localized sentence saying what a link of the given role grants (the
|
|
2127
|
+
`ide.chat.share.grants.<role>` keys), through the CALLER's translate
|
|
2128
|
+
function. One literal `t()` call per {@link ShareRole}, exhaustive (see
|
|
2129
|
+
{@link shareRoleLabel}); the role itself interpolates through `{{role}}`.
|
|
2130
|
+
|
|
2131
|
+
```typescript
|
|
2132
|
+
function shareGrantsText(t: TranslateFunction, role: ShareRole): string
|
|
2133
|
+
```
|
|
2134
|
+
|
|
2135
|
+
- `t` — The caller's translate function.
|
|
2136
|
+
- `role` — The role the link grants.
|
|
2137
|
+
|
|
2138
|
+
**Returns:** The localized grants sentence.
|
|
2139
|
+
|
|
2140
|
+
#### `shareSubheading(t, role)`
|
|
2141
|
+
|
|
2142
|
+
The localized subheading shown under the share dialog's heading for a host
|
|
2143
|
+
offering a single role (the `ide.chat.share.subheading.<role>` keys), through
|
|
2144
|
+
the CALLER's translate function. One literal `t()` call per
|
|
2145
|
+
{@link ShareRole}, exhaustive (see {@link shareRoleLabel}); the role
|
|
2146
|
+
interpolates through `{{role}}`. The multi-role variant is the plain
|
|
2147
|
+
`ide.chat.share.subheading` key the caller uses directly.
|
|
2148
|
+
|
|
2149
|
+
```typescript
|
|
2150
|
+
function shareSubheading(t: TranslateFunction, role: ShareRole): string
|
|
2151
|
+
```
|
|
2152
|
+
|
|
2153
|
+
- `t` — The caller's translate function.
|
|
2154
|
+
- `role` — The single role the host grants.
|
|
2155
|
+
|
|
2156
|
+
**Returns:** The localized subheading.
|
|
2157
|
+
|
|
2031
2158
|
#### `parseChatTimestampsVisible(raw)`
|
|
2032
2159
|
|
|
2033
2160
|
Parses the stored preference. Only an explicit `'true'` shows every timestamp,
|
|
@@ -2610,6 +2737,49 @@ function findKeyboardShortcut<S extends KeyboardShortcut>(
|
|
|
2610
2737
|
|
|
2611
2738
|
**Returns:** The shortcut to run, or `undefined` when the key is not one.
|
|
2612
2739
|
|
|
2740
|
+
#### `settingLabel(t, id)`
|
|
2741
|
+
|
|
2742
|
+
The localized label of a user-controllable setting (the
|
|
2743
|
+
`ide.chat.settings.<id>.label` keys), through the CALLER's translate function
|
|
2744
|
+
so a framework port and a live locale switch both get their own text. One
|
|
2745
|
+
literal `t()` call per {@link SettingKey}, chosen by a switch exhaustive over
|
|
2746
|
+
the union: adding a setting to {@link SETTINGS} without adding its case here
|
|
2747
|
+
is a compile error, so a setting can never ship with no translation site.
|
|
2748
|
+
Each `defaultValue` equals that setting's `label` field, so the English
|
|
2749
|
+
output is identical either way.
|
|
2750
|
+
|
|
2751
|
+
```typescript
|
|
2752
|
+
function settingLabel(t: TranslateFunction, id: SettingKey): string
|
|
2753
|
+
```
|
|
2754
|
+
|
|
2755
|
+
- `t` — The caller's translate function (React passes `useTranslation()`'s `t`).
|
|
2756
|
+
- `id` — The setting id.
|
|
2757
|
+
|
|
2758
|
+
**Returns:** The localized label.
|
|
2759
|
+
|
|
2760
|
+
#### `settingDescription(t, id, values)`
|
|
2761
|
+
|
|
2762
|
+
The localized one-line explanation of a user-controllable setting (the
|
|
2763
|
+
`ide.chat.settings.<id>.desc` keys), through the CALLER's translate function.
|
|
2764
|
+
One literal `t()` call per {@link SettingKey}, exhaustive over the union (see
|
|
2765
|
+
{@link settingLabel}). Each `defaultValue` equals that setting's `description`
|
|
2766
|
+
field, so the English output is identical either way; the descriptions
|
|
2767
|
+
interpolate `{{agentName}}`, filled from the caller's agent identity.
|
|
2768
|
+
|
|
2769
|
+
```typescript
|
|
2770
|
+
function settingDescription(
|
|
2771
|
+
t: TranslateFunction,
|
|
2772
|
+
id: SettingKey,
|
|
2773
|
+
values?: InterpolationValues,
|
|
2774
|
+
): string
|
|
2775
|
+
```
|
|
2776
|
+
|
|
2777
|
+
- `t` — The caller's translate function.
|
|
2778
|
+
- `id` — The setting id.
|
|
2779
|
+
- `values` — Interpolation values (the descriptions interpolate `{{agentName}}`).
|
|
2780
|
+
|
|
2781
|
+
**Returns:** The localized description.
|
|
2782
|
+
|
|
2613
2783
|
### Constants
|
|
2614
2784
|
|
|
2615
2785
|
#### `COMMAND_CATEGORIES`
|
|
@@ -2627,7 +2797,202 @@ authoritative list — the menu, key handling, `/help`, AND the system prompt's
|
|
|
2627
2797
|
"Available Commands" section all read from it.
|
|
2628
2798
|
|
|
2629
2799
|
```typescript
|
|
2630
|
-
const COMMANDS: readonly
|
|
2800
|
+
const COMMANDS: readonly [
|
|
2801
|
+
{
|
|
2802
|
+
readonly id: 'clear'
|
|
2803
|
+
readonly label: '/clear'
|
|
2804
|
+
readonly description: 'Clear conversation'
|
|
2805
|
+
readonly category: 'context'
|
|
2806
|
+
},
|
|
2807
|
+
{
|
|
2808
|
+
readonly id: 'compact'
|
|
2809
|
+
readonly label: '/compact'
|
|
2810
|
+
readonly description: 'Compress context to free space'
|
|
2811
|
+
readonly category: 'context'
|
|
2812
|
+
},
|
|
2813
|
+
{
|
|
2814
|
+
readonly id: 'cost'
|
|
2815
|
+
readonly label: '/cost'
|
|
2816
|
+
readonly description: "Show token usage & share of the project's AI allowance"
|
|
2817
|
+
readonly category: 'context'
|
|
2818
|
+
readonly viewerSafe: true
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
readonly id: 'skills'
|
|
2822
|
+
readonly label: '/skills'
|
|
2823
|
+
readonly description: 'Browse & load project skills'
|
|
2824
|
+
readonly category: 'context'
|
|
2825
|
+
readonly usage: '/skills [query]'
|
|
2826
|
+
},
|
|
2827
|
+
{
|
|
2828
|
+
readonly id: 'commit'
|
|
2829
|
+
readonly label: '/commit'
|
|
2830
|
+
readonly description: 'Commit current changes'
|
|
2831
|
+
readonly category: 'code'
|
|
2832
|
+
},
|
|
2833
|
+
{
|
|
2834
|
+
readonly id: 'explain'
|
|
2835
|
+
readonly label: '/explain'
|
|
2836
|
+
readonly description: 'Explain code (e.g. /explain @file)'
|
|
2837
|
+
readonly category: 'code'
|
|
2838
|
+
readonly usage: '/explain [@file | topic]'
|
|
2839
|
+
},
|
|
2840
|
+
{
|
|
2841
|
+
readonly id: 'lint'
|
|
2842
|
+
readonly label: '/lint'
|
|
2843
|
+
readonly description: 'Run linter and fix issues'
|
|
2844
|
+
readonly category: 'code'
|
|
2845
|
+
readonly usage: '/lint [path]'
|
|
2846
|
+
},
|
|
2847
|
+
{
|
|
2848
|
+
readonly id: 'test'
|
|
2849
|
+
readonly label: '/test'
|
|
2850
|
+
readonly description: "List and run the project's tests"
|
|
2851
|
+
readonly category: 'code'
|
|
2852
|
+
readonly usage: '/test [query | all]'
|
|
2853
|
+
readonly aliases: readonly ['tests']
|
|
2854
|
+
readonly viewerSafe: true
|
|
2855
|
+
},
|
|
2856
|
+
{
|
|
2857
|
+
readonly id: 'undo'
|
|
2858
|
+
readonly label: '/undo'
|
|
2859
|
+
readonly description: "Revert last AI turn's file changes"
|
|
2860
|
+
readonly category: 'code'
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
readonly id: 'scripts'
|
|
2864
|
+
readonly label: '/scripts'
|
|
2865
|
+
readonly description: 'Browse & run saved scripts and built-in actions'
|
|
2866
|
+
readonly category: 'code'
|
|
2867
|
+
readonly usage: '/scripts [query]'
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
readonly id: 'run'
|
|
2871
|
+
readonly label: '/run'
|
|
2872
|
+
readonly description: 'Run a saved script or built-in by name'
|
|
2873
|
+
readonly category: 'code'
|
|
2874
|
+
readonly usage: '/run <name> [--option value]'
|
|
2875
|
+
},
|
|
2876
|
+
{
|
|
2877
|
+
readonly id: 'autocommit'
|
|
2878
|
+
readonly label: '/autocommit'
|
|
2879
|
+
readonly description: 'Auto-commit N seconds after the last file change (0 cancels)'
|
|
2880
|
+
readonly category: 'code'
|
|
2881
|
+
readonly usage: '/autocommit <seconds>'
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
readonly id: 'autofix'
|
|
2885
|
+
readonly label: '/autofix'
|
|
2886
|
+
readonly description: 'Toggle auto-fix after AI file changes'
|
|
2887
|
+
readonly category: 'code'
|
|
2888
|
+
},
|
|
2889
|
+
{
|
|
2890
|
+
readonly id: 'autoapprove'
|
|
2891
|
+
readonly label: '/autoapprove'
|
|
2892
|
+
readonly description: 'Toggle auto-approving destructive commands (skip the Proceed confirm)'
|
|
2893
|
+
readonly category: 'code'
|
|
2894
|
+
},
|
|
2895
|
+
{
|
|
2896
|
+
readonly id: 'share'
|
|
2897
|
+
readonly label: '/share'
|
|
2898
|
+
readonly description: 'Create a public share link for this project'
|
|
2899
|
+
readonly category: 'collaborate'
|
|
2900
|
+
readonly usage: '/share [viewer | commenter | editor | owner]'
|
|
2901
|
+
},
|
|
2902
|
+
{
|
|
2903
|
+
readonly id: 'model'
|
|
2904
|
+
readonly label: '/model'
|
|
2905
|
+
readonly description: 'Switch the model for any mode (plan, execute, commit messages, compaction)'
|
|
2906
|
+
readonly category: 'model'
|
|
2907
|
+
readonly usage: '/model [name | --plan | --execute | --commit | --compact]'
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
readonly id: 'plan'
|
|
2911
|
+
readonly label: '/plan'
|
|
2912
|
+
readonly description: 'Toggle plan/execute mode'
|
|
2913
|
+
readonly category: 'model'
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
readonly id: 'maxloops'
|
|
2917
|
+
readonly label: '/maxloops'
|
|
2918
|
+
readonly description: 'Set max tool iterations'
|
|
2919
|
+
readonly category: 'model'
|
|
2920
|
+
readonly usage: '/maxloops <n>'
|
|
2921
|
+
},
|
|
2922
|
+
{
|
|
2923
|
+
readonly id: 'effort'
|
|
2924
|
+
readonly label: '/effort'
|
|
2925
|
+
readonly description: "Pick reasoning effort per mode from the model's own levels"
|
|
2926
|
+
readonly category: 'model'
|
|
2927
|
+
readonly usage: '/effort [--plan|--execute] [level]'
|
|
2928
|
+
},
|
|
2929
|
+
{
|
|
2930
|
+
readonly id: 'settings'
|
|
2931
|
+
readonly label: '/settings'
|
|
2932
|
+
readonly description: "View & change {{agentName}}'s settings"
|
|
2933
|
+
readonly category: 'settings'
|
|
2934
|
+
readonly viewerSafe: true
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
readonly id: 'sounds'
|
|
2938
|
+
readonly label: '/sounds'
|
|
2939
|
+
readonly description: 'Notification sounds'
|
|
2940
|
+
readonly category: 'settings'
|
|
2941
|
+
readonly viewerSafe: true
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
readonly id: 'timestamps'
|
|
2945
|
+
readonly label: '/timestamps'
|
|
2946
|
+
readonly description: 'Show or hide the time on chat messages and events'
|
|
2947
|
+
readonly category: 'settings'
|
|
2948
|
+
readonly usage: '/timestamps [on | off]'
|
|
2949
|
+
readonly viewerSafe: true
|
|
2950
|
+
},
|
|
2951
|
+
{
|
|
2952
|
+
readonly id: 'mic'
|
|
2953
|
+
readonly label: '/mic'
|
|
2954
|
+
readonly description: 'Choose the dictation engine (on-device / browser native)'
|
|
2955
|
+
readonly category: 'settings'
|
|
2956
|
+
readonly viewerSafe: true
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
readonly id: 'dictate'
|
|
2960
|
+
readonly label: '/dictate'
|
|
2961
|
+
readonly description: 'Choose the dictation engine (alias for /mic)'
|
|
2962
|
+
readonly category: 'settings'
|
|
2963
|
+
readonly viewerSafe: true
|
|
2964
|
+
},
|
|
2965
|
+
{
|
|
2966
|
+
readonly id: 'help'
|
|
2967
|
+
readonly label: '/help'
|
|
2968
|
+
readonly description: 'Workflow guide & tips'
|
|
2969
|
+
readonly category: 'support'
|
|
2970
|
+
readonly viewerSafe: true
|
|
2971
|
+
},
|
|
2972
|
+
{
|
|
2973
|
+
readonly id: 'report'
|
|
2974
|
+
readonly label: '/report'
|
|
2975
|
+
readonly description: 'Report a bug or send feedback'
|
|
2976
|
+
readonly category: 'support'
|
|
2977
|
+
readonly usage: '/report [title]'
|
|
2978
|
+
readonly viewerSafe: true
|
|
2979
|
+
},
|
|
2980
|
+
{
|
|
2981
|
+
readonly id: 'bug'
|
|
2982
|
+
readonly label: '/bug'
|
|
2983
|
+
readonly description: 'Report a bug (alias for /report)'
|
|
2984
|
+
readonly category: 'support'
|
|
2985
|
+
readonly usage: '/bug [title]'
|
|
2986
|
+
readonly viewerSafe: true
|
|
2987
|
+
},
|
|
2988
|
+
{
|
|
2989
|
+
readonly id: 'version'
|
|
2990
|
+
readonly label: '/version'
|
|
2991
|
+
readonly description: 'Show the app version'
|
|
2992
|
+
readonly category: 'support'
|
|
2993
|
+
readonly viewerSafe: true
|
|
2994
|
+
},
|
|
2995
|
+
]
|
|
2631
2996
|
```
|
|
2632
2997
|
|
|
2633
2998
|
#### `ACTIVITY_TYPES`
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* React-free slash-command metadata — the single source of truth for every
|
|
3
3
|
* `/command` the user can run.
|
|
4
4
|
*
|
|
5
|
-
* This module deliberately imports **nothing** (no React, no
|
|
6
|
-
*
|
|
5
|
+
* This module deliberately imports **nothing at runtime** (no React, no
|
|
6
|
+
* app-ui; the i18n import is types-only, erased from the emitted JS) so it can
|
|
7
|
+
* be consumed on *either* side of the api/app boundary. The IDE chat
|
|
7
8
|
* surfaces (command menu, keyboard dispatcher, `/help`, the `/settings` card)
|
|
8
9
|
* all read from {@link COMMANDS} here, AND the molecule.dev API system prompt
|
|
9
10
|
* can import the same array (via the package's `./command-metadata` subpath
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
*
|
|
17
18
|
* @module
|
|
18
19
|
*/
|
|
20
|
+
import type { InterpolationValues, TranslateFunction } from '@molecule/app-i18n';
|
|
19
21
|
/** Category keys used to group commands in the menu and in `/help`. */
|
|
20
22
|
export type CommandCategoryKey = 'context' | 'code' | 'collaborate' | 'model' | 'settings' | 'support';
|
|
21
23
|
/** A command category with its display label. */
|
|
@@ -53,7 +55,7 @@ export interface CommandDef {
|
|
|
53
55
|
* e.g. `['t']` lets `/t <message>` invoke `/teamsay`. Matched by the chat
|
|
54
56
|
* input's command dispatch alongside {@link id}.
|
|
55
57
|
*/
|
|
56
|
-
aliases?: string[];
|
|
58
|
+
aliases?: readonly string[];
|
|
57
59
|
/**
|
|
58
60
|
* True for a human-only side-channel command handled by the HOST's server
|
|
59
61
|
* (e.g. a team-chat note the agent never sees): the raw `/command` text is
|
|
@@ -80,7 +82,182 @@ export interface CommandDef {
|
|
|
80
82
|
* authoritative list — the menu, key handling, `/help`, AND the system prompt's
|
|
81
83
|
* "Available Commands" section all read from it.
|
|
82
84
|
*/
|
|
83
|
-
export declare const COMMANDS: readonly
|
|
85
|
+
export declare const COMMANDS: readonly [{
|
|
86
|
+
readonly id: "clear";
|
|
87
|
+
readonly label: "/clear";
|
|
88
|
+
readonly description: "Clear conversation";
|
|
89
|
+
readonly category: "context";
|
|
90
|
+
}, {
|
|
91
|
+
readonly id: "compact";
|
|
92
|
+
readonly label: "/compact";
|
|
93
|
+
readonly description: "Compress context to free space";
|
|
94
|
+
readonly category: "context";
|
|
95
|
+
}, {
|
|
96
|
+
readonly id: "cost";
|
|
97
|
+
readonly label: "/cost";
|
|
98
|
+
readonly description: "Show token usage & share of the project's AI allowance";
|
|
99
|
+
readonly category: "context";
|
|
100
|
+
readonly viewerSafe: true;
|
|
101
|
+
}, {
|
|
102
|
+
readonly id: "skills";
|
|
103
|
+
readonly label: "/skills";
|
|
104
|
+
readonly description: "Browse & load project skills";
|
|
105
|
+
readonly category: "context";
|
|
106
|
+
readonly usage: "/skills [query]";
|
|
107
|
+
}, {
|
|
108
|
+
readonly id: "commit";
|
|
109
|
+
readonly label: "/commit";
|
|
110
|
+
readonly description: "Commit current changes";
|
|
111
|
+
readonly category: "code";
|
|
112
|
+
}, {
|
|
113
|
+
readonly id: "explain";
|
|
114
|
+
readonly label: "/explain";
|
|
115
|
+
readonly description: "Explain code (e.g. /explain @file)";
|
|
116
|
+
readonly category: "code";
|
|
117
|
+
readonly usage: "/explain [@file | topic]";
|
|
118
|
+
}, {
|
|
119
|
+
readonly id: "lint";
|
|
120
|
+
readonly label: "/lint";
|
|
121
|
+
readonly description: "Run linter and fix issues";
|
|
122
|
+
readonly category: "code";
|
|
123
|
+
readonly usage: "/lint [path]";
|
|
124
|
+
}, {
|
|
125
|
+
readonly id: "test";
|
|
126
|
+
readonly label: "/test";
|
|
127
|
+
readonly description: "List and run the project's tests";
|
|
128
|
+
readonly category: "code";
|
|
129
|
+
readonly usage: "/test [query | all]";
|
|
130
|
+
readonly aliases: readonly ["tests"];
|
|
131
|
+
readonly viewerSafe: true;
|
|
132
|
+
}, {
|
|
133
|
+
readonly id: "undo";
|
|
134
|
+
readonly label: "/undo";
|
|
135
|
+
readonly description: "Revert last AI turn's file changes";
|
|
136
|
+
readonly category: "code";
|
|
137
|
+
}, {
|
|
138
|
+
readonly id: "scripts";
|
|
139
|
+
readonly label: "/scripts";
|
|
140
|
+
readonly description: "Browse & run saved scripts and built-in actions";
|
|
141
|
+
readonly category: "code";
|
|
142
|
+
readonly usage: "/scripts [query]";
|
|
143
|
+
}, {
|
|
144
|
+
readonly id: "run";
|
|
145
|
+
readonly label: "/run";
|
|
146
|
+
readonly description: "Run a saved script or built-in by name";
|
|
147
|
+
readonly category: "code";
|
|
148
|
+
readonly usage: "/run <name> [--option value]";
|
|
149
|
+
}, {
|
|
150
|
+
readonly id: "autocommit";
|
|
151
|
+
readonly label: "/autocommit";
|
|
152
|
+
readonly description: "Auto-commit N seconds after the last file change (0 cancels)";
|
|
153
|
+
readonly category: "code";
|
|
154
|
+
readonly usage: "/autocommit <seconds>";
|
|
155
|
+
}, {
|
|
156
|
+
readonly id: "autofix";
|
|
157
|
+
readonly label: "/autofix";
|
|
158
|
+
readonly description: "Toggle auto-fix after AI file changes";
|
|
159
|
+
readonly category: "code";
|
|
160
|
+
}, {
|
|
161
|
+
readonly id: "autoapprove";
|
|
162
|
+
readonly label: "/autoapprove";
|
|
163
|
+
readonly description: "Toggle auto-approving destructive commands (skip the Proceed confirm)";
|
|
164
|
+
readonly category: "code";
|
|
165
|
+
}, {
|
|
166
|
+
readonly id: "share";
|
|
167
|
+
readonly label: "/share";
|
|
168
|
+
readonly description: "Create a public share link for this project";
|
|
169
|
+
readonly category: "collaborate";
|
|
170
|
+
readonly usage: "/share [viewer | commenter | editor | owner]";
|
|
171
|
+
}, {
|
|
172
|
+
readonly id: "model";
|
|
173
|
+
readonly label: "/model";
|
|
174
|
+
readonly description: "Switch the model for any mode (plan, execute, commit messages, compaction)";
|
|
175
|
+
readonly category: "model";
|
|
176
|
+
readonly usage: "/model [name | --plan | --execute | --commit | --compact]";
|
|
177
|
+
}, {
|
|
178
|
+
readonly id: "plan";
|
|
179
|
+
readonly label: "/plan";
|
|
180
|
+
readonly description: "Toggle plan/execute mode";
|
|
181
|
+
readonly category: "model";
|
|
182
|
+
}, {
|
|
183
|
+
readonly id: "maxloops";
|
|
184
|
+
readonly label: "/maxloops";
|
|
185
|
+
readonly description: "Set max tool iterations";
|
|
186
|
+
readonly category: "model";
|
|
187
|
+
readonly usage: "/maxloops <n>";
|
|
188
|
+
}, {
|
|
189
|
+
readonly id: "effort";
|
|
190
|
+
readonly label: "/effort";
|
|
191
|
+
readonly description: "Pick reasoning effort per mode from the model's own levels";
|
|
192
|
+
readonly category: "model";
|
|
193
|
+
readonly usage: "/effort [--plan|--execute] [level]";
|
|
194
|
+
}, {
|
|
195
|
+
readonly id: "settings";
|
|
196
|
+
readonly label: "/settings";
|
|
197
|
+
readonly description: "View & change {{agentName}}'s settings";
|
|
198
|
+
readonly category: "settings";
|
|
199
|
+
readonly viewerSafe: true;
|
|
200
|
+
}, {
|
|
201
|
+
readonly id: "sounds";
|
|
202
|
+
readonly label: "/sounds";
|
|
203
|
+
readonly description: "Notification sounds";
|
|
204
|
+
readonly category: "settings";
|
|
205
|
+
readonly viewerSafe: true;
|
|
206
|
+
}, {
|
|
207
|
+
readonly id: "timestamps";
|
|
208
|
+
readonly label: "/timestamps";
|
|
209
|
+
readonly description: "Show or hide the time on chat messages and events";
|
|
210
|
+
readonly category: "settings";
|
|
211
|
+
readonly usage: "/timestamps [on | off]";
|
|
212
|
+
readonly viewerSafe: true;
|
|
213
|
+
}, {
|
|
214
|
+
readonly id: "mic";
|
|
215
|
+
readonly label: "/mic";
|
|
216
|
+
readonly description: "Choose the dictation engine (on-device / browser native)";
|
|
217
|
+
readonly category: "settings";
|
|
218
|
+
readonly viewerSafe: true;
|
|
219
|
+
}, {
|
|
220
|
+
readonly id: "dictate";
|
|
221
|
+
readonly label: "/dictate";
|
|
222
|
+
readonly description: "Choose the dictation engine (alias for /mic)";
|
|
223
|
+
readonly category: "settings";
|
|
224
|
+
readonly viewerSafe: true;
|
|
225
|
+
}, {
|
|
226
|
+
readonly id: "help";
|
|
227
|
+
readonly label: "/help";
|
|
228
|
+
readonly description: "Workflow guide & tips";
|
|
229
|
+
readonly category: "support";
|
|
230
|
+
readonly viewerSafe: true;
|
|
231
|
+
}, {
|
|
232
|
+
readonly id: "report";
|
|
233
|
+
readonly label: "/report";
|
|
234
|
+
readonly description: "Report a bug or send feedback";
|
|
235
|
+
readonly category: "support";
|
|
236
|
+
readonly usage: "/report [title]";
|
|
237
|
+
readonly viewerSafe: true;
|
|
238
|
+
}, {
|
|
239
|
+
readonly id: "bug";
|
|
240
|
+
readonly label: "/bug";
|
|
241
|
+
readonly description: "Report a bug (alias for /report)";
|
|
242
|
+
readonly category: "support";
|
|
243
|
+
readonly usage: "/bug [title]";
|
|
244
|
+
readonly viewerSafe: true;
|
|
245
|
+
}, {
|
|
246
|
+
readonly id: "version";
|
|
247
|
+
readonly label: "/version";
|
|
248
|
+
readonly description: "Show the app version";
|
|
249
|
+
readonly category: "support";
|
|
250
|
+
readonly viewerSafe: true;
|
|
251
|
+
}];
|
|
252
|
+
/**
|
|
253
|
+
* The literal id of every command in {@link COMMANDS} — the union the command
|
|
254
|
+
* label helpers switch over. Unlike {@link CommandId} (every `CommandDef` id,
|
|
255
|
+
* including host-added commands), this is closed over the shared registry:
|
|
256
|
+
* adding a command to {@link COMMANDS} extends it, so the label switches below
|
|
257
|
+
* fail to compile until the new command has its label — a command can no longer
|
|
258
|
+
* ship with no translation site.
|
|
259
|
+
*/
|
|
260
|
+
export type WrittenCommandId = (typeof COMMANDS)[number]['id'];
|
|
84
261
|
/** Union of all command ids (loosely `string`, since {@link CommandDef.id} is a string). */
|
|
85
262
|
export type CommandId = CommandDef['id'];
|
|
86
263
|
/** A category paired with the commands that belong to it. */
|
|
@@ -114,4 +291,48 @@ export declare function groupCommandsByCategory(commands?: readonly CommandDef[]
|
|
|
114
291
|
* @returns Whether the text invokes a side-channel command.
|
|
115
292
|
*/
|
|
116
293
|
export declare function matchesSideChannelCommand(defs: readonly CommandDef[] | undefined, text: string): boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Whether `id` is one of the shared registry's commands ({@link COMMANDS}).
|
|
296
|
+
*
|
|
297
|
+
* Host-provided commands (e.g. molecule.dev's `/deploy`, `/teamsay`) are NOT
|
|
298
|
+
* registry commands: they carry their own English description and have no key
|
|
299
|
+
* in the shared locale bond, so callers render {@link CommandDef.description}
|
|
300
|
+
* directly for them and route registry commands through
|
|
301
|
+
* {@link commandDescription}.
|
|
302
|
+
*
|
|
303
|
+
* @param id - The command id to test.
|
|
304
|
+
* @returns True when the id belongs to the shared registry.
|
|
305
|
+
*/
|
|
306
|
+
export declare function isRegistryCommandId(id: string): id is WrittenCommandId;
|
|
307
|
+
/**
|
|
308
|
+
* The localized one-line description of a registry command (the
|
|
309
|
+
* `ide.chat.cmd.<id>.desc` keys), through the CALLER's translate function so a
|
|
310
|
+
* framework port and a live locale switch both get their own text. One literal
|
|
311
|
+
* `t()` call per registry id, chosen by a switch exhaustive over
|
|
312
|
+
* {@link WrittenCommandId}: adding a command to {@link COMMANDS} without adding
|
|
313
|
+
* its case here is a compile error, so a command can never ship untranslated.
|
|
314
|
+
* Each `defaultValue` is the same English the command's `description` field
|
|
315
|
+
* carries (the text the API system prompt renders), so the English output is
|
|
316
|
+
* identical either way.
|
|
317
|
+
*
|
|
318
|
+
* @param t - The caller's translate function (React passes `useTranslation()`'s `t`).
|
|
319
|
+
* @param id - The command id; MUST be a registry id — narrow a possibly
|
|
320
|
+
* host-added id with {@link isRegistryCommandId} first.
|
|
321
|
+
* @param values - Interpolation values; the descriptions interpolate
|
|
322
|
+
* `{{agentName}}` (and the caller's agent identity fills it in).
|
|
323
|
+
* @returns The localized description.
|
|
324
|
+
*/
|
|
325
|
+
export declare function commandDescription(t: TranslateFunction, id: WrittenCommandId, values?: InterpolationValues): string;
|
|
326
|
+
/**
|
|
327
|
+
* The localized heading of a command category (the `ide.chat.help.category.<key>`
|
|
328
|
+
* keys), through the CALLER's translate function. One literal `t()` call per
|
|
329
|
+
* {@link CommandCategoryKey}, exhaustive: a new category key fails to compile
|
|
330
|
+
* until it has a heading. Each `defaultValue` equals the category's `label`
|
|
331
|
+
* field, so the English output is unchanged.
|
|
332
|
+
*
|
|
333
|
+
* @param t - The caller's translate function.
|
|
334
|
+
* @param key - The category key.
|
|
335
|
+
* @returns The localized category heading.
|
|
336
|
+
*/
|
|
337
|
+
export declare function commandCategoryLabel(t: TranslateFunction, key: CommandCategoryKey): string;
|
|
117
338
|
//# sourceMappingURL=command-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-metadata.d.ts","sourceRoot":"","sources":["../src/command-metadata.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"command-metadata.d.ts","sourceRoot":"","sources":["../src/command-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,uEAAuE;AACvE,MAAM,MAAM,kBAAkB,GAC5B,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAEvE,iDAAiD;AACjD,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,GAAG,EAAE,kBAAkB,CAAA;IACvB,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAA;CACd;AAED,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAO/C,CAAA;AAEV,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACzB,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,8CAA8C;IAC9C,QAAQ,EAAE,kBAAkB,CAAA;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0MqB,CAAA;AAE1C;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;AAE9D,4FAA4F;AAC5F,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;AAExC,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,eAAe,CAAA;IACzB,oDAAoD;IACpD,QAAQ,EAAE,UAAU,EAAE,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,GAAE,SAAS,UAAU,EAAa,EAC1C,UAAU,GAAE,SAAS,eAAe,EAAuB,GAC1D,YAAY,EAAE,CAOhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,EACvC,IAAI,EAAE,MAAM,GACX,OAAO,CAST;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,gBAAgB,CAEtE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,iBAAiB,EACpB,EAAE,EAAE,gBAAgB,EACpB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,MAAM,CAiGR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,iBAAiB,EAAE,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAe1F"}
|