zerg-ztc 0.1.11 → 0.1.13

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 (122) hide show
  1. package/bin/ztc-audio-darwin-arm64 +0 -0
  2. package/dist/utils/dictation_native.d.ts.map +1 -1
  3. package/dist/utils/dictation_native.js +43 -23
  4. package/dist/utils/dictation_native.js.map +1 -1
  5. package/package.json +5 -4
  6. package/packages/ztc-dictation/Cargo.toml +0 -43
  7. package/packages/ztc-dictation/README.md +0 -65
  8. package/packages/ztc-dictation/index.d.ts +0 -16
  9. package/packages/ztc-dictation/index.js +0 -74
  10. package/packages/ztc-dictation/package.json +0 -41
  11. package/packages/ztc-dictation/src/main.rs +0 -430
  12. package/src/App.tsx +0 -910
  13. package/src/agent/agent.ts +0 -534
  14. package/src/agent/backends/anthropic.ts +0 -86
  15. package/src/agent/backends/gemini.ts +0 -119
  16. package/src/agent/backends/inception.ts +0 -23
  17. package/src/agent/backends/index.ts +0 -17
  18. package/src/agent/backends/openai.ts +0 -23
  19. package/src/agent/backends/openai_compatible.ts +0 -143
  20. package/src/agent/backends/types.ts +0 -83
  21. package/src/agent/commands/clipboard.ts +0 -77
  22. package/src/agent/commands/config.ts +0 -204
  23. package/src/agent/commands/debug.ts +0 -23
  24. package/src/agent/commands/dictation.ts +0 -11
  25. package/src/agent/commands/emulation.ts +0 -80
  26. package/src/agent/commands/execution.ts +0 -9
  27. package/src/agent/commands/help.ts +0 -20
  28. package/src/agent/commands/history.ts +0 -13
  29. package/src/agent/commands/index.ts +0 -48
  30. package/src/agent/commands/input_mode.ts +0 -22
  31. package/src/agent/commands/keybindings.ts +0 -40
  32. package/src/agent/commands/model.ts +0 -11
  33. package/src/agent/commands/models.ts +0 -116
  34. package/src/agent/commands/permissions.ts +0 -64
  35. package/src/agent/commands/retry.ts +0 -9
  36. package/src/agent/commands/shell.ts +0 -68
  37. package/src/agent/commands/skills.ts +0 -54
  38. package/src/agent/commands/status.ts +0 -19
  39. package/src/agent/commands/types.ts +0 -88
  40. package/src/agent/commands/update.ts +0 -32
  41. package/src/agent/factory.ts +0 -60
  42. package/src/agent/index.ts +0 -20
  43. package/src/agent/runtime/capabilities.ts +0 -7
  44. package/src/agent/runtime/memory.ts +0 -23
  45. package/src/agent/runtime/policy.ts +0 -48
  46. package/src/agent/runtime/session.ts +0 -18
  47. package/src/agent/runtime/tracing.ts +0 -23
  48. package/src/agent/tools/file.ts +0 -178
  49. package/src/agent/tools/index.ts +0 -52
  50. package/src/agent/tools/screenshot.ts +0 -821
  51. package/src/agent/tools/search.ts +0 -138
  52. package/src/agent/tools/shell.ts +0 -69
  53. package/src/agent/tools/skills.ts +0 -28
  54. package/src/agent/tools/types.ts +0 -14
  55. package/src/agent/tools/zerg.ts +0 -50
  56. package/src/cli.tsx +0 -163
  57. package/src/components/ActivityLine.tsx +0 -23
  58. package/src/components/FullScreen.tsx +0 -79
  59. package/src/components/Header.tsx +0 -27
  60. package/src/components/InputArea.tsx +0 -1660
  61. package/src/components/MessageList.tsx +0 -71
  62. package/src/components/SingleMessage.tsx +0 -298
  63. package/src/components/StatusBar.tsx +0 -55
  64. package/src/components/index.tsx +0 -8
  65. package/src/config/types.ts +0 -19
  66. package/src/config.ts +0 -186
  67. package/src/debug/logger.ts +0 -14
  68. package/src/emulation/README.md +0 -24
  69. package/src/emulation/catalog.ts +0 -82
  70. package/src/emulation/trace_style.ts +0 -8
  71. package/src/emulation/types.ts +0 -7
  72. package/src/skills/index.ts +0 -36
  73. package/src/skills/loader.ts +0 -135
  74. package/src/skills/registry.ts +0 -6
  75. package/src/skills/types.ts +0 -10
  76. package/src/types.ts +0 -84
  77. package/src/ui/README.md +0 -44
  78. package/src/ui/core/factory.ts +0 -9
  79. package/src/ui/core/index.ts +0 -4
  80. package/src/ui/core/input.ts +0 -38
  81. package/src/ui/core/input_segments.ts +0 -410
  82. package/src/ui/core/input_state.ts +0 -17
  83. package/src/ui/core/layout_yoga.ts +0 -122
  84. package/src/ui/core/style.ts +0 -38
  85. package/src/ui/core/types.ts +0 -54
  86. package/src/ui/ink/index.tsx +0 -1
  87. package/src/ui/ink/render.tsx +0 -60
  88. package/src/ui/views/activity_line.ts +0 -33
  89. package/src/ui/views/app.ts +0 -111
  90. package/src/ui/views/header.ts +0 -44
  91. package/src/ui/views/input_area.ts +0 -255
  92. package/src/ui/views/message_list.ts +0 -443
  93. package/src/ui/views/status_bar.ts +0 -114
  94. package/src/ui/vue/index.ts +0 -53
  95. package/src/ui/web/frame_render.tsx +0 -148
  96. package/src/ui/web/index.tsx +0 -1
  97. package/src/ui/web/render.tsx +0 -41
  98. package/src/utils/clipboard.ts +0 -39
  99. package/src/utils/clipboard_image.ts +0 -40
  100. package/src/utils/dictation.ts +0 -467
  101. package/src/utils/dictation_native.ts +0 -258
  102. package/src/utils/diff.ts +0 -52
  103. package/src/utils/image_preview.ts +0 -36
  104. package/src/utils/models.ts +0 -98
  105. package/src/utils/path_complete.ts +0 -173
  106. package/src/utils/path_format.ts +0 -99
  107. package/src/utils/shell.ts +0 -72
  108. package/src/utils/spinner_frames.ts +0 -1
  109. package/src/utils/spinner_verbs.ts +0 -23
  110. package/src/utils/table.ts +0 -171
  111. package/src/utils/tool_summary.ts +0 -56
  112. package/src/utils/tool_trace.ts +0 -346
  113. package/src/utils/update.ts +0 -44
  114. package/src/utils/version.ts +0 -15
  115. package/src/web/index.html +0 -352
  116. package/src/web/mirror-favicon.svg +0 -4
  117. package/src/web/mirror.html +0 -641
  118. package/src/web/mirror_hook.ts +0 -25
  119. package/src/web/mirror_server.ts +0 -204
  120. package/tsconfig.json +0 -22
  121. package/vite.config.ts +0 -363
  122. /package/{packages/ztc-dictation/bin → bin}/.gitkeep +0 -0
@@ -1,23 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const debugCommand: Command = {
4
- name: 'debug',
5
- description: 'Toggle debug mode (show layout borders)',
6
- handler: (args, ctx) => {
7
- const on = args[0] === 'on' || args[0] === '1' || args[0] === 'true';
8
- const off = args[0] === 'off' || args[0] === '0' || args[0] === 'false';
9
-
10
- if (on) {
11
- ctx.setDebug(true);
12
- ctx.addMessage({ role: 'system', content: '✓ Debug mode enabled' });
13
- } else if (off) {
14
- ctx.setDebug(false);
15
- ctx.addMessage({ role: 'system', content: '✓ Debug mode disabled' });
16
- } else {
17
- ctx.addMessage({
18
- role: 'system',
19
- content: 'Usage: /debug <on|off>\n\nEnables layout borders for debugging.'
20
- });
21
- }
22
- }
23
- };
@@ -1,11 +0,0 @@
1
- import { Command } from './types.js';
2
- import { getDictationStatus } from '../../utils/dictation.js';
3
-
4
- export const dictationStatusCommand: Command = {
5
- name: 'dictation',
6
- description: 'Check voice dictation status and availability',
7
- handler: async (args, ctx) => {
8
- const status = getDictationStatus();
9
- ctx.addMessage({ role: 'system', content: status });
10
- }
11
- };
@@ -1,80 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const emulationCommand: Command = {
4
- name: 'emulation',
5
- description: 'List or select a prompt emulation',
6
- usage: '<list|show|set> [id]',
7
- handler: (args, ctx) => {
8
- const [subCmd, ...rest] = args;
9
- const value = rest.join(' ').trim();
10
-
11
- switch (subCmd) {
12
- case 'list': {
13
- const profiles = ctx.emulation.list();
14
- const lines = profiles.map(p => ` ${p.id} - ${p.name}`);
15
- ctx.addMessage({
16
- role: 'system',
17
- content: ['Available emulations:', ...lines].join('\n')
18
- });
19
- break;
20
- }
21
- case 'show': {
22
- const id = value || ctx.config.getEmulationId();
23
- if (!id) {
24
- ctx.addMessage({
25
- role: 'system',
26
- content: 'No emulation selected. Use /emulation list or /emulation set <id>.'
27
- });
28
- return;
29
- }
30
- const profile = ctx.emulation.get(id);
31
- if (!profile) {
32
- ctx.addMessage({
33
- role: 'system',
34
- content: `Unknown emulation: ${id}`
35
- });
36
- return;
37
- }
38
- ctx.addMessage({
39
- role: 'system',
40
- content: [
41
- `Emulation: ${profile.name}`,
42
- `ID: ${profile.id}`,
43
- profile.description
44
- ].join('\n')
45
- });
46
- break;
47
- }
48
- case 'set': {
49
- if (!value) {
50
- ctx.addMessage({
51
- role: 'system',
52
- content: 'Usage: /emulation set <id>'
53
- });
54
- return;
55
- }
56
- const profile = ctx.emulation.get(value);
57
- if (!profile) {
58
- ctx.addMessage({
59
- role: 'system',
60
- content: `Unknown emulation: ${value}`
61
- });
62
- return;
63
- }
64
- ctx.config.setEmulationId(profile.id);
65
- ctx.config.save();
66
- ctx.reloadAgent();
67
- ctx.addMessage({
68
- role: 'system',
69
- content: `✓ Emulation set: ${profile.name}`
70
- });
71
- break;
72
- }
73
- default:
74
- ctx.addMessage({
75
- role: 'system',
76
- content: 'Usage: /emulation <list|show|set> [id]'
77
- });
78
- }
79
- }
80
- };
@@ -1,9 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const exitCommand: Command = {
4
- name: 'exit',
5
- description: 'Exit ZTC',
6
- handler: (_, ctx) => {
7
- ctx.exit();
8
- }
9
- };
@@ -1,20 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export function makeHelpCommand(getCommands: () => Command[]): Command {
4
- return {
5
- name: 'help',
6
- description: 'Show available commands',
7
- handler: (_, ctx) => {
8
- const helpText = getCommands()
9
- .map(c => {
10
- const usage = c.usage ? ` ${c.usage}` : '';
11
- return ` /${c.name}${usage}\n ${c.description}`;
12
- })
13
- .join('\n\n');
14
- ctx.addMessage({
15
- role: 'system',
16
- content: `Available commands:\n\n${helpText}`
17
- });
18
- }
19
- };
20
- }
@@ -1,13 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const clearCommand: Command = {
4
- name: 'clear',
5
- description: 'Clear message history',
6
- handler: (_, ctx) => {
7
- ctx.clearMessages();
8
- ctx.addMessage({
9
- role: 'system',
10
- content: 'Message history cleared.'
11
- });
12
- }
13
- };
@@ -1,48 +0,0 @@
1
- import { makeHelpCommand } from './help.js';
2
- import { configCommand } from './config.js';
3
- import { debugCommand } from './debug.js';
4
- import { clearCommand } from './history.js';
5
- import { statusCommand } from './status.js';
6
- import { exitCommand } from './execution.js';
7
- import { emulationCommand } from './emulation.js';
8
- import { shellCommand, cdCommand } from './shell.js';
9
- import { clipboardCommand } from './clipboard.js';
10
- import { modelsCommand } from './models.js';
11
- import { modelCommand } from './model.js';
12
- import { permissionsCommand } from './permissions.js';
13
- import { skillsCommand } from './skills.js';
14
- import { retryCommand } from './retry.js';
15
- import { inputModeCommand } from './input_mode.js';
16
- import { keybindingsCommand } from './keybindings.js';
17
- import { updateCommand } from './update.js';
18
- import { dictationStatusCommand } from './dictation.js';
19
- import { Command } from './types.js';
20
-
21
- const commandList: Command[] = [];
22
-
23
- const helpCommand = makeHelpCommand(() => commandList);
24
-
25
- commandList.push(
26
- helpCommand,
27
- configCommand,
28
- debugCommand,
29
- clearCommand,
30
- statusCommand,
31
- emulationCommand,
32
- shellCommand,
33
- cdCommand,
34
- clipboardCommand,
35
- modelsCommand,
36
- modelCommand,
37
- permissionsCommand,
38
- skillsCommand,
39
- keybindingsCommand,
40
- updateCommand,
41
- inputModeCommand,
42
- retryCommand,
43
- dictationStatusCommand,
44
- exitCommand
45
- );
46
-
47
- export const commands = commandList;
48
- export type { Command, CommandContext } from './types.js';
@@ -1,22 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const inputModeCommand: Command = {
4
- name: 'inputmode',
5
- description: 'Set input mode while an agent is running',
6
- usage: '<queue|interrupt>',
7
- handler: (args, ctx) => {
8
- const mode = (args[0] || '').toLowerCase();
9
- if (mode !== 'queue' && mode !== 'interrupt') {
10
- ctx.addMessage({
11
- role: 'system',
12
- content: `Current input mode: ${ctx.getInputMode()}\n\nUsage: /inputmode <queue|interrupt>`
13
- });
14
- return;
15
- }
16
- ctx.setInputMode(mode);
17
- ctx.addMessage({
18
- role: 'system',
19
- content: `✓ Input mode set: ${mode}`
20
- });
21
- }
22
- };
@@ -1,40 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- const lines = [
4
- 'Keybindings (readline-style):',
5
- '',
6
- 'Movement:',
7
- ' Ctrl+A start of line',
8
- ' Ctrl+E end of line',
9
- ' Ctrl+B move left',
10
- ' Ctrl+F move right',
11
- ' Alt+B word left',
12
- ' Alt+F word right',
13
- '',
14
- 'Editing:',
15
- ' Ctrl+U kill to start',
16
- ' Ctrl+K kill to end',
17
- ' Ctrl+W kill previous word',
18
- ' Alt+D kill next word',
19
- ' Ctrl+D delete forward',
20
- ' Ctrl+Y yank',
21
- ' Alt+Y yank-pop',
22
- ' Ctrl+T transpose chars',
23
- ' Alt+T transpose words',
24
- '',
25
- 'History:',
26
- ' Ctrl+P previous',
27
- ' Ctrl+N next',
28
- ' Up/Down arrows also work',
29
- '',
30
- 'Input mode:',
31
- ' /inputmode queue|interrupt'
32
- ];
33
-
34
- export const keybindingsCommand: Command = {
35
- name: 'keybindings',
36
- description: 'Show keybindings',
37
- handler: (_args, ctx) => {
38
- ctx.addMessage({ role: 'system', content: lines.join('\n') });
39
- }
40
- };
@@ -1,11 +0,0 @@
1
- import { Command } from './types.js';
2
- import { configCommand } from './config.js';
3
-
4
- export const modelCommand: Command = {
5
- name: 'model',
6
- description: 'Alias for /config model',
7
- usage: '<model-id>',
8
- handler: (args, ctx) => {
9
- return configCommand.handler(['model', ...args], ctx);
10
- }
11
- };
@@ -1,116 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- const LATEST_TAGS = ['latest', 'current', 'default'];
4
-
5
- function pickLatestModel(models: string[]): string | null {
6
- if (!models.length) return null;
7
-
8
- const tagged = models
9
- .map(name => ({ name, lower: name.toLowerCase() }))
10
- .filter(entry => LATEST_TAGS.some(tag => entry.lower.includes(tag)));
11
-
12
- if (tagged.length > 0) {
13
- const sorted = tagged.sort((a, b) => {
14
- const aRank = LATEST_TAGS.findIndex(tag => a.lower.includes(tag));
15
- const bRank = LATEST_TAGS.findIndex(tag => b.lower.includes(tag));
16
- if (aRank !== bRank) return aRank - bRank;
17
- return b.name.localeCompare(a.name);
18
- });
19
- return sorted[0].name;
20
- }
21
-
22
- const datePattern = /(\d{4})[.-]?(\d{2})[.-]?(\d{2})/;
23
- const withDates = models
24
- .map(name => {
25
- const match = name.match(datePattern);
26
- if (!match) return null;
27
- const dateValue = Number(match[1]) * 10000 + Number(match[2]) * 100 + Number(match[3]);
28
- return { name, dateValue };
29
- })
30
- .filter((entry): entry is { name: string; dateValue: number } => !!entry);
31
-
32
- if (withDates.length > 0) {
33
- withDates.sort((a, b) => b.dateValue - a.dateValue || b.name.localeCompare(a.name));
34
- return withDates[0].name;
35
- }
36
-
37
- const versionPattern = /(\d+(?:\.\d+)+|\d+)/g;
38
- const withVersions = models
39
- .map(name => {
40
- const match = name.match(versionPattern);
41
- if (!match || match.length === 0) return null;
42
- const versionValue = parseFloat(match[0]);
43
- return { name, versionValue };
44
- })
45
- .filter((entry): entry is { name: string; versionValue: number } => !!entry);
46
-
47
- if (withVersions.length > 0) {
48
- withVersions.sort((a, b) => b.versionValue - a.versionValue || b.name.localeCompare(a.name));
49
- return withVersions[0].name;
50
- }
51
-
52
- return models.slice().sort((a, b) => b.localeCompare(a))[0];
53
- }
54
-
55
- export const modelsCommand: Command = {
56
- name: 'models',
57
- description: 'List or set available models for a provider',
58
- usage: '<list [provider]|latest [provider]|set <model-id>>',
59
- handler: async (args, ctx) => {
60
- const subCmd = (args[0] || 'list').toLowerCase();
61
-
62
- if (subCmd === 'set') {
63
- const value = args.slice(1).join(' ').trim();
64
- if (!value) {
65
- ctx.addMessage({
66
- role: 'system',
67
- content: 'Usage: /models set <model-id>'
68
- });
69
- return;
70
- }
71
- ctx.config.set('model', value);
72
- await ctx.config.save();
73
- ctx.reloadAgent();
74
- ctx.addMessage({ role: 'system', content: `✓ Model updated: ${value}` });
75
- return;
76
- }
77
-
78
- const provider = args[0] && args[0] !== 'list' && args[0] !== 'latest' ? args[0] : ctx.config.getProvider();
79
- try {
80
- const models = await ctx.models.list(provider);
81
- if (models.length === 0) {
82
- ctx.addMessage({
83
- role: 'system',
84
- content: `No models returned for provider: ${provider}`
85
- });
86
- return;
87
- }
88
- if (subCmd === 'latest') {
89
- const latest = pickLatestModel(models);
90
- if (!latest) {
91
- ctx.addMessage({
92
- role: 'system',
93
- content: `Unable to determine latest model for ${provider}`
94
- });
95
- return;
96
- }
97
- ctx.config.set('model', latest);
98
- await ctx.config.save();
99
- ctx.reloadAgent();
100
- ctx.addMessage({ role: 'system', content: `✓ Model updated: ${latest}` });
101
- } else {
102
- const lines = models.sort().map(model => ` ${model}`);
103
- ctx.addMessage({
104
- role: 'system',
105
- content: [`Models (${provider}):`, ...lines].join('\n')
106
- });
107
- }
108
- } catch (err) {
109
- const message = err instanceof Error ? err.message : 'Unable to list models';
110
- ctx.addMessage({
111
- role: 'system',
112
- content: `Models error: ${message}`
113
- });
114
- }
115
- }
116
- };
@@ -1,64 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- const ALL_CAPS = ['file_read', 'file_write', 'shell_exec', 'network'] as const;
4
-
5
- function normalize(value: string): string {
6
- return value.trim().toLowerCase();
7
- }
8
-
9
- export const permissionsCommand: Command = {
10
- name: 'permissions',
11
- description: 'View or update tool permissions',
12
- usage: '<show|set> [capability] [on|off]',
13
- handler: async (args, ctx) => {
14
- const subCmd = normalize(args[0] || 'show');
15
- const config = ctx.config.get();
16
- const current = config.toolPermissions || {};
17
-
18
- if (subCmd === 'show') {
19
- const lines = ALL_CAPS.map(cap => {
20
- const value = current[cap];
21
- const label = value === false ? 'off' : 'on';
22
- return ` ${cap}: ${label}`;
23
- });
24
- ctx.addMessage({
25
- role: 'system',
26
- content: ['Tool permissions:', ...lines].join('\n')
27
- });
28
- return;
29
- }
30
-
31
- if (subCmd === 'set') {
32
- const cap = normalize(args[1] || '');
33
- const value = normalize(args[2] || '');
34
- if (!cap || !ALL_CAPS.includes(cap as typeof ALL_CAPS[number])) {
35
- ctx.addMessage({
36
- role: 'system',
37
- content: `Usage: /permissions set <${ALL_CAPS.join('|')}> <on|off>`
38
- });
39
- return;
40
- }
41
- if (value !== 'on' && value !== 'off') {
42
- ctx.addMessage({
43
- role: 'system',
44
- content: 'Usage: /permissions set <capability> <on|off>'
45
- });
46
- return;
47
- }
48
- const next = { ...current, [cap]: value === 'on' };
49
- ctx.config.set('toolPermissions', next);
50
- await ctx.config.save();
51
- ctx.reloadAgent();
52
- ctx.addMessage({
53
- role: 'system',
54
- content: `✓ Permission updated: ${cap} ${value}`
55
- });
56
- return;
57
- }
58
-
59
- ctx.addMessage({
60
- role: 'system',
61
- content: 'Usage: /permissions <show|set> [capability] [on|off]'
62
- });
63
- }
64
- };
@@ -1,9 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const retryCommand: Command = {
4
- name: 'retry',
5
- description: 'Retry the last request',
6
- handler: (_args, ctx) => {
7
- ctx.retry();
8
- }
9
- };
@@ -1,68 +0,0 @@
1
- import { Command, ShellResult } from './types.js';
2
-
3
- function formatShellResult(result: ShellResult): string {
4
- const lines: string[] = [];
5
- const stdout = result.stdout.trimEnd();
6
- const stderr = result.stderr.trimEnd();
7
-
8
- if (stdout) lines.push(stdout);
9
- if (stderr) lines.push(stderr);
10
- if (!stdout && !stderr) lines.push('(no output)');
11
-
12
- if (result.exitCode !== 0) {
13
- lines.push(`exit code: ${result.exitCode}`);
14
- }
15
- if (result.truncated) {
16
- lines.push('(output truncated)');
17
- }
18
-
19
- return lines.join('\n');
20
- }
21
-
22
- export const shellCommand: Command = {
23
- name: 'shell',
24
- description: 'Run a local shell command (or use !command)',
25
- usage: '<command>',
26
- handler: async (args, ctx) => {
27
- const command = args.join(' ').trim();
28
- if (!command) {
29
- ctx.addMessage({
30
- role: 'system',
31
- content: 'Usage: /shell <command>\n\nExample:\n /shell ls -la\n !pwd'
32
- });
33
- return;
34
- }
35
-
36
- ctx.addMessage({ role: 'system', content: `$ ${command}` });
37
- try {
38
- const result = await ctx.shell.run(command);
39
- ctx.addMessage({ role: 'system', content: formatShellResult(result) });
40
- } catch (err) {
41
- const message = err instanceof Error ? err.message : 'Command failed';
42
- ctx.addMessage({ role: 'system', content: `shell: ${message}` });
43
- }
44
- }
45
- };
46
-
47
- export const cdCommand: Command = {
48
- name: 'cd',
49
- description: 'Change working directory for !/shell commands',
50
- usage: '[path]',
51
- handler: async (args, ctx) => {
52
- const target = args.join(' ').trim();
53
- if (!target) {
54
- ctx.addMessage({
55
- role: 'system',
56
- content: `cwd: ${ctx.shell.getCwd()}`
57
- });
58
- return;
59
- }
60
- try {
61
- const next = await ctx.shell.setCwd(target);
62
- ctx.addMessage({ role: 'system', content: `cwd: ${next}` });
63
- } catch (err) {
64
- const message = err instanceof Error ? err.message : 'Unable to change directory';
65
- ctx.addMessage({ role: 'system', content: `cd: ${message}` });
66
- }
67
- }
68
- };
@@ -1,54 +0,0 @@
1
- import { Command } from './types.js';
2
- import { formatSkillList } from '../../skills/index.js';
3
-
4
- export const skillsCommand: Command = {
5
- name: 'skills',
6
- description: 'List or show available skills',
7
- usage: '<list|show> [id]',
8
- handler: async (args, ctx) => {
9
- const subCmd = (args[0] || 'list').toLowerCase();
10
- const registry = await ctx.skills.list();
11
-
12
- if (subCmd === 'list') {
13
- ctx.addMessage({
14
- role: 'system',
15
- content: formatSkillList(registry)
16
- });
17
- return;
18
- }
19
-
20
- if (subCmd === 'show') {
21
- const id = (args[1] || '').trim();
22
- if (!id) {
23
- ctx.addMessage({
24
- role: 'system',
25
- content: 'Usage: /skills show <id>'
26
- });
27
- return;
28
- }
29
- const skill = registry.find(entry => entry.id === id);
30
- if (!skill) {
31
- ctx.addMessage({
32
- role: 'system',
33
- content: `Skill not found: ${id}`
34
- });
35
- return;
36
- }
37
- ctx.addMessage({
38
- role: 'system',
39
- content: [
40
- `Skill: ${skill.name}`,
41
- `ID: ${skill.id}`,
42
- skill.description ? `Description: ${skill.description}` : '',
43
- skill.instructions
44
- ].filter(Boolean).join('\n')
45
- });
46
- return;
47
- }
48
-
49
- ctx.addMessage({
50
- role: 'system',
51
- content: 'Usage: /skills <list|show> [id]'
52
- });
53
- }
54
- };
@@ -1,19 +0,0 @@
1
- import { Command } from './types.js';
2
-
3
- export const statusCommand: Command = {
4
- name: 'status',
5
- description: 'Show current status',
6
- handler: (_, ctx) => {
7
- const hasKey = ctx.config.hasApiKey();
8
- const config = ctx.config.get();
9
- ctx.addMessage({
10
- role: 'system',
11
- content: [
12
- 'Status:',
13
- ` API Key: ${hasKey ? '✓ configured' : '✗ not set (use /config key <key>)'}`,
14
- ` Model: ${config.model}`,
15
- ` Ready: ${hasKey ? 'Yes' : 'No - need API key'}`
16
- ].join('\n')
17
- });
18
- }
19
- };