@curie-agent/tui 0.4.1 → 0.4.3

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.
@@ -1,132 +1,27 @@
1
- import type { CurieSettings } from '../../core/src/settings.js';
2
- import { SettingsManager } from '../../core/src/settings.js';
3
- import type { Message } from '../../core/src/turn-loop.js';
4
- import type { TabId } from './tab-bar.js';
5
- import { TaskManager } from '@curie-agent/core';
6
- export interface SlashCommandContext {
7
- settings: CurieSettings;
8
- settingsMgr?: SettingsManager;
9
- version: string;
10
- model: string;
11
- provider: string;
12
- approvalMode: string;
13
- cwd: string;
14
- inputTokens?: number;
15
- outputTokens?: number;
16
- /** Current context window token usage (after compaction). Falls back to inputTokens if not set. */
17
- contextWindowInputTokens?: number;
18
- contextWindowOutputTokens?: number;
19
- /** Message history for the current session (user, assistant, tool messages). */
20
- messages?: Message[];
21
- /** Channel message display data from the TUI (broader role set, includes tool-group and system). */
22
- channelMessages?: Array<{
23
- role: string;
24
- content: string;
25
- title?: string;
26
- }>;
27
- /** Unified task manager for task CRUD and scheduling. */
28
- taskManager?: TaskManager;
29
- /** MCP client instances for connection status display. */
30
- mcpClients?: Array<{
31
- serverId: string;
32
- isConnected: boolean;
33
- tools: ReadonlyArray<{
34
- name: string;
35
- }>;
36
- }>;
37
- /** Server IDs that failed to connect during createMcpTools. */
38
- mcpFailed?: string[];
39
- /** Current model's context window size in tokens. */
40
- contextWindowSize?: number;
41
- /** Extended thinking token budget (0 if disabled). */
42
- thinkingBudget?: number;
43
- /** List snapshots for a cwd (provided by CLI for /snapshots). */
44
- listSnapshots?: (cwd: string) => Array<{
45
- sha: string;
46
- timestamp: string;
47
- cwd: string;
48
- label: string;
49
- changedFiles: number;
50
- }>;
51
- /** Revert to a snapshot SHA (provided by CLI for /revert). */
52
- revertTo?: (cwd: string, sha: string) => Promise<{
53
- success: boolean;
54
- error?: string;
55
- }>;
56
- /** List discovered skills (provided by CLI for /skill). */
57
- listSkills?: (cwd: string) => Array<{
58
- name: string;
59
- description: string;
60
- source: string;
61
- filePath: string;
62
- }>;
63
- }
64
- export interface SlashCommandResult {
65
- type: 'message' | 'update_model' | 'update_model_cost' | 'update_context_window' | 'update_theme' | 'update_mode' | 'update_effort' | 'update_debug' | 'update_statusline' | 'update_tools_per_call' | 'update_websearch_per_call' | 'update_mcp' | 'start_agent' | 'notification' | 'external' | 'exit' | 'update_memory' | 'switch_tab' | 'update_provider' | 'update_init' | 'compact';
66
- message?: string;
67
- model?: string;
68
- modelCost?: string;
69
- contextWindow?: number;
70
- theme?: string;
71
- mode?: 'plan' | 'edit' | 'auto' | 'yolo';
72
- effort?: 'low' | 'medium' | 'high' | 'max' | 'auto';
73
- debug?: boolean;
74
- statusline?: boolean;
75
- toolsPerCall?: number;
76
- websearchPerCall?: number;
77
- mcpServerId?: string;
78
- mcpServers?: string;
79
- agentId?: string;
80
- agentMode?: 'plan' | 'edit' | 'auto' | 'yolo';
81
- agentEffort?: 'low' | 'medium' | 'high' | 'max' | 'auto';
82
- notification?: {
83
- type: 'reminder';
84
- id: string;
85
- message: string;
86
- scheduledAt: string;
87
- } | {
88
- type: 'heartbeat';
89
- enabled?: boolean;
90
- } | {
91
- type: 'heartbeat-set';
92
- key: 'heartbeat.intraday' | 'heartbeat.daily' | 'heartbeat.weekly' | 'heartbeat.monthly' | 'heartbeat.dreaming';
93
- value: string;
94
- } | {
95
- type: 'heartbeat-now';
96
- };
97
- external?: string;
98
- tab?: TabId;
99
- memory?: {
100
- content: string;
101
- operation: 'add' | 'status';
102
- };
103
- provider?: string;
104
- providerApiKey?: string;
105
- providerBaseUrl?: string;
106
- apiKey?: string;
107
- /** Wizard phase for interactive setup: 'provider' | 'apiKey' | 'url' | 'model' */
108
- wizardStep?: string;
109
- wizardProvider?: string;
110
- /** Key names for provider config (apiKey key + url key) */
111
- apiKeyKeys?: string[];
112
- /** Key-value pairs for provider config */
113
- keys?: Record<string, string>;
114
- /** Conversation compaction result — CLI will call provider to summarize */
115
- compact?: {
116
- messages: Message[];
117
- depth: 'detailed' | 'brief';
118
- };
119
- }
120
- export interface SlashCommandDef {
121
- name: string;
122
- description: string;
123
- usage: string;
124
- category: string;
125
- }
126
- export declare const SLASH_COMMANDS: SlashCommandDef[];
1
+ /**
2
+ * Slash-command parsing for the TUI input box.
3
+ *
4
+ * The command *registry* lives in `@curie-agent/protocol` so the daemon can
5
+ * share it; this module only parses raw input and re-exports the registry for
6
+ * convenience. Execution happens in one of two places, per each entry's
7
+ * `handler` field: the daemon's `executeSlashCommand` (most commands) or the
8
+ * CLI's `onSlashCommand` (commands needing terminal/React state).
9
+ *
10
+ * This file previously carried a second, complete command engine that nothing
11
+ * ever called. It was deleted rather than repaired.
12
+ */
13
+ export { SLASH_COMMANDS, SLASH_COMMAND_CATEGORIES, findSlashCommand, allSlashCommandNames, renderSlashCommandHelp, } from '@curie-agent/protocol';
14
+ export type { SlashCommandDef, SlashCommandHandler } from '@curie-agent/protocol';
15
+ /**
16
+ * Split `/name rest of args` into its parts.
17
+ *
18
+ * Returns null when the input is not a slash command. The command name is
19
+ * lowercased; args keep their original casing (paths and prompts are
20
+ * case-sensitive). A bare `/` yields an empty command name, which callers
21
+ * should treat as unknown.
22
+ */
127
23
  export declare function parseSlashCommand(input: string): {
128
24
  command: string;
129
25
  args: string;
130
26
  } | null;
131
- export declare function handleSlashCommand(cmd: string, args: string, ctx: SlashCommandContext): Promise<SlashCommandResult>;
132
27
  //# sourceMappingURL=slash-commands.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAA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