@elizaos/plugin-commands 2.0.3-beta.2 → 2.0.3-beta.4

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.
Files changed (38) hide show
  1. package/dist/cjs/index.cjs +1757 -0
  2. package/dist/cjs/index.cjs.map +23 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +1719 -0
  6. package/dist/index.js.map +23 -0
  7. package/dist/src/actions/command-actions.d.ts +17 -0
  8. package/dist/src/actions/command-actions.d.ts.map +1 -0
  9. package/dist/src/actions/command-settings.d.ts +35 -0
  10. package/dist/src/actions/command-settings.d.ts.map +1 -0
  11. package/dist/src/actions/dispatch.d.ts +54 -0
  12. package/dist/src/actions/dispatch.d.ts.map +1 -0
  13. package/dist/src/actions/handlers.d.ts +26 -0
  14. package/dist/src/actions/handlers.d.ts.map +1 -0
  15. package/dist/src/actions/index.d.ts +19 -0
  16. package/dist/src/actions/index.d.ts.map +1 -0
  17. package/dist/src/actions/shortcuts.d.ts +41 -0
  18. package/dist/src/actions/shortcuts.d.ts.map +1 -0
  19. package/dist/src/connector-bridge.d.ts +128 -0
  20. package/dist/src/connector-bridge.d.ts.map +1 -0
  21. package/dist/src/connector-catalog.d.ts +71 -0
  22. package/dist/src/connector-catalog.d.ts.map +1 -0
  23. package/dist/src/index.d.ts +68 -0
  24. package/dist/src/index.d.ts.map +1 -0
  25. package/dist/src/navigation-commands.d.ts +28 -0
  26. package/dist/src/navigation-commands.d.ts.map +1 -0
  27. package/dist/src/parser.d.ts +32 -0
  28. package/dist/src/parser.d.ts.map +1 -0
  29. package/dist/src/registry.d.ts +66 -0
  30. package/dist/src/registry.d.ts.map +1 -0
  31. package/dist/src/serialize.d.ts +30 -0
  32. package/dist/src/serialize.d.ts.map +1 -0
  33. package/dist/src/settings-sections.d.ts +32 -0
  34. package/dist/src/settings-sections.d.ts.map +1 -0
  35. package/dist/src/types.d.ts +175 -0
  36. package/dist/src/types.d.ts.map +1 -0
  37. package/package.json +4 -3
  38. package/registry-entry.json +63 -0
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Command system types
3
+ */
4
+ import type { HandlerCallback, Memory } from "@elizaos/core";
5
+ export type CommandScope = "text" | "native" | "both";
6
+ export type CommandCategory = "session" | "options" | "status" | "management" | "media" | "tools" | "docks" | "skills";
7
+ /**
8
+ * The surfaces a command is offered on. Omitted/undefined on a definition means
9
+ * "all surfaces" (the default). `serializeCommand(cmd, surface)` filters on this.
10
+ */
11
+ export type CommandSurface = "gui" | "tui" | "discord" | "telegram";
12
+ /**
13
+ * A live source a client resolves an argument's choices from at render time
14
+ * (the registry can't enumerate models/views/skills/providers statically). The
15
+ * definition tags the source; the client fetches the concrete values.
16
+ */
17
+ export type CommandArgSource = "models" | "views" | "settings-sections" | "skills" | "providers";
18
+ /**
19
+ * Client-only behaviors the in-app surfaces (GUI/TUI) run directly, with no
20
+ * agent round-trip and no remote surface. Connectors filter `client` targets
21
+ * out (a Discord/Telegram user has nothing to clear or full-screen).
22
+ */
23
+ export type ClientCommandAction = "clear-chat" | "new-conversation" | "toggle-fullscreen" | "open-command-palette" | "show-commands" | "toggle-transcription";
24
+ /**
25
+ * Where a command executes — the single discriminant every surface routes on:
26
+ * - `agent` → the command runs through the agent (a deterministic command
27
+ * action handles it; `action` names that handler when known).
28
+ * - `navigate` → opens a destination in the Eliza app; `path` is the in-app
29
+ * deep link, `tab`/`viewId`/`section` are routing hints.
30
+ * - `client` → a GUI/TUI-only behavior with no remote surface.
31
+ */
32
+ export type CommandTarget = {
33
+ kind: "agent";
34
+ action?: string;
35
+ } | {
36
+ kind: "navigate";
37
+ path: string;
38
+ tab?: string;
39
+ viewId?: string;
40
+ section?: string;
41
+ } | {
42
+ kind: "client";
43
+ clientAction: ClientCommandAction;
44
+ };
45
+ export interface CommandArgDefinition {
46
+ name: string;
47
+ description: string;
48
+ required?: boolean;
49
+ choices?: string[] | ((ctx: CommandArgChoiceContext) => string[]);
50
+ /**
51
+ * A live choice source the client resolves at render time. Carried through
52
+ * serialization so the client knows to fetch models/views/skills/etc. for
53
+ * this arg instead of relying on static `choices`.
54
+ */
55
+ dynamicChoices?: CommandArgSource;
56
+ captureRemaining?: boolean;
57
+ }
58
+ export interface CommandArgChoiceContext {
59
+ provider?: string;
60
+ model?: string;
61
+ config?: Record<string, unknown>;
62
+ }
63
+ export interface CommandDefinition {
64
+ key: string;
65
+ nativeName?: string;
66
+ description: string;
67
+ textAliases: string[];
68
+ scope: CommandScope;
69
+ category?: CommandCategory;
70
+ acceptsArgs?: boolean;
71
+ args?: CommandArgDefinition[];
72
+ argsParsing?: "none" | "positional";
73
+ requiresAuth?: boolean;
74
+ requiresElevated?: boolean;
75
+ enabled?: boolean;
76
+ /**
77
+ * Where this command executes. Omitted = `{ kind: "agent" }` (the default):
78
+ * a deterministic command action handles it through the agent. Navigation /
79
+ * client commands set this explicitly so every surface routes them the same.
80
+ */
81
+ target?: CommandTarget;
82
+ /**
83
+ * The surfaces this command is offered on. Omitted/undefined = all surfaces
84
+ * (the default). `serializeCommand(cmd, surface)` filters on this so the
85
+ * `?surface=` catalog query returns only what that surface should render.
86
+ */
87
+ surfaces?: CommandSurface[];
88
+ /** Optional icon hint (lucide name) for menu rendering. */
89
+ icon?: string;
90
+ /**
91
+ * View ids for which this command is *view-dependent*: it is only surfaced in
92
+ * the command catalog while one of these views is the active (foreground)
93
+ * surface. Omitted/undefined = globally available (the default). A non-empty
94
+ * list scopes the command to those views — e.g. a `/calendar add` command that
95
+ * only makes sense while the calendar view is open. (#8798)
96
+ */
97
+ views?: string[];
98
+ }
99
+ /**
100
+ * Wire-safe argument shape produced by `serializeCommand`. Mirrors the client
101
+ * (`@elizaos/ui` `SlashCommandArg`) and TUI (`SerializedCommandArg`) transport
102
+ * types so all three consume one shape with no fabricated fields.
103
+ */
104
+ export interface SerializedCommandArg {
105
+ name: string;
106
+ description: string;
107
+ required?: boolean;
108
+ choices?: string[];
109
+ dynamicChoices?: CommandArgSource;
110
+ captureRemaining?: boolean;
111
+ }
112
+ /** Where a serialized catalog item came from — drives menu grouping/labels. */
113
+ export type SerializedCommandSource = "builtin" | "custom-action" | "saved";
114
+ /**
115
+ * The canonical wire shape served by `GET /api/commands` and consumed by the
116
+ * web composer (`SlashCommandCatalogItem`), the TUI autocomplete
117
+ * (`SerializedCommand`), and the connector bridges. This is the single contract
118
+ * the route projects — no field is fabricated at the HTTP boundary.
119
+ */
120
+ export interface SerializedCommand {
121
+ key: string;
122
+ nativeName: string;
123
+ description: string;
124
+ textAliases: string[];
125
+ scope: CommandScope;
126
+ category?: CommandCategory;
127
+ acceptsArgs: boolean;
128
+ args: SerializedCommandArg[];
129
+ requiresAuth: boolean;
130
+ requiresElevated: boolean;
131
+ surfaces?: CommandSurface[];
132
+ target: CommandTarget;
133
+ icon?: string;
134
+ source: SerializedCommandSource;
135
+ /** View ids this command is scoped to (#8798); omitted when global. */
136
+ views?: string[];
137
+ }
138
+ export interface CommandContext {
139
+ senderId?: string;
140
+ senderName?: string;
141
+ isAuthorized: boolean;
142
+ isElevated: boolean;
143
+ channelId?: string;
144
+ roomId: string;
145
+ accountId?: string;
146
+ config?: Record<string, unknown>;
147
+ message?: Memory;
148
+ callback?: HandlerCallback;
149
+ }
150
+ export interface CommandResult {
151
+ handled: boolean;
152
+ reply?: string;
153
+ shouldContinue: boolean;
154
+ error?: string;
155
+ }
156
+ export interface ParsedCommand {
157
+ key: string;
158
+ canonical: string;
159
+ args: string[];
160
+ rawArgs?: string;
161
+ }
162
+ export interface CommandDetectionResult {
163
+ isCommand: boolean;
164
+ command?: ParsedCommand;
165
+ }
166
+ /**
167
+ * Resolved command with full context
168
+ */
169
+ export interface ResolvedCommand {
170
+ definition: CommandDefinition;
171
+ parsed: ParsedCommand;
172
+ context: CommandContext;
173
+ message: Memory;
174
+ }
175
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot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AAM,WAAW,aAAa;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-commands",
3
- "version": "2.0.3-beta.2",
3
+ "version": "2.0.3-beta.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -36,6 +36,7 @@
36
36
  }
37
37
  },
38
38
  "files": [
39
+ "registry-entry.json",
39
40
  "dist",
40
41
  "auto-enable.ts"
41
42
  ],
@@ -48,7 +49,7 @@
48
49
  }
49
50
  },
50
51
  "dependencies": {
51
- "@elizaos/core": "2.0.3-beta.2"
52
+ "@elizaos/core": "2.0.3-beta.4"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@biomejs/biome": "^2.4.14",
@@ -113,5 +114,5 @@
113
114
  "node": "Default export (Node.js)"
114
115
  }
115
116
  },
116
- "gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
117
+ "gitHead": "f76f55793a0fb8d6b869dd8ddce03970de061e34"
117
118
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "id": "commands",
3
+ "name": "Commands",
4
+ "description": "Chat command system for Eliza agents (/help, /status, /reset, etc.)",
5
+ "npmName": "@elizaos/plugin-commands",
6
+ "version": "2.0.0-beta.0",
7
+ "source": "bundled",
8
+ "tags": ["commands"],
9
+ "config": {
10
+ "COMMANDS_CONFIG_ENABLED": {
11
+ "type": "boolean",
12
+ "required": false,
13
+ "sensitive": false,
14
+ "default": "false",
15
+ "label": "Config Enabled",
16
+ "help": "Enable /config command",
17
+ "advanced": false
18
+ },
19
+ "COMMANDS_DEBUG_ENABLED": {
20
+ "type": "boolean",
21
+ "required": false,
22
+ "sensitive": false,
23
+ "default": "false",
24
+ "label": "Debug Enabled",
25
+ "help": "Enable /debug command",
26
+ "advanced": true
27
+ },
28
+ "COMMANDS_BASH_ENABLED": {
29
+ "type": "boolean",
30
+ "required": false,
31
+ "sensitive": false,
32
+ "default": "false",
33
+ "label": "Bash Enabled",
34
+ "help": "Enable /bash command (elevated)",
35
+ "advanced": false
36
+ },
37
+ "COMMANDS_RESTART_ENABLED": {
38
+ "type": "boolean",
39
+ "required": false,
40
+ "sensitive": false,
41
+ "default": "true",
42
+ "label": "Restart Enabled",
43
+ "help": "Enable /restart command",
44
+ "advanced": false
45
+ }
46
+ },
47
+ "render": {
48
+ "visible": true,
49
+ "pinTo": [],
50
+ "style": "card",
51
+ "icon": "Command",
52
+ "group": "automation",
53
+ "groupOrder": 9,
54
+ "actions": ["enable", "configure"]
55
+ },
56
+ "resources": {
57
+ "homepage": "https://github.com/elizaos/eliza#readme",
58
+ "repository": "https://github.com/elizaos/eliza"
59
+ },
60
+ "dependsOn": [],
61
+ "kind": "plugin",
62
+ "subtype": "automation"
63
+ }