@sylix/coworker 1.0.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 +191 -0
- package/dist/api/sylix.d.ts +51 -0
- package/dist/api/sylix.d.ts.map +1 -0
- package/dist/api/sylix.js +234 -0
- package/dist/api/sylix.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +235 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ask.d.ts +2 -0
- package/dist/commands/ask.d.ts.map +1 -0
- package/dist/commands/ask.js +55 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/chat.d.ts +2 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +292 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/commit.d.ts +2 -0
- package/dist/commands/commit.d.ts.map +1 -0
- package/dist/commands/commit.js +163 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +101 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/edit.d.ts +2 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +112 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/explain.d.ts +2 -0
- package/dist/commands/explain.d.ts.map +1 -0
- package/dist/commands/explain.js +99 -0
- package/dist/commands/explain.js.map +1 -0
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +151 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/review.d.ts +2 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +137 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/run.d.ts +2 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +136 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/context/reader.d.ts +24 -0
- package/dist/context/reader.d.ts.map +1 -0
- package/dist/context/reader.js +209 -0
- package/dist/context/reader.js.map +1 -0
- package/dist/memory/loader.d.ts +41 -0
- package/dist/memory/loader.d.ts.map +1 -0
- package/dist/memory/loader.js +249 -0
- package/dist/memory/loader.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +7 -0
- package/dist/scripts/postinstall.d.ts.map +1 -0
- package/dist/scripts/postinstall.js +23 -0
- package/dist/scripts/postinstall.js.map +1 -0
- package/dist/tools/bash.d.ts +2 -0
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +40 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/chrome.d.ts +10 -0
- package/dist/tools/chrome.d.ts.map +1 -0
- package/dist/tools/chrome.js +228 -0
- package/dist/tools/chrome.js.map +1 -0
- package/dist/tools/edit.d.ts +2 -0
- package/dist/tools/edit.d.ts.map +1 -0
- package/dist/tools/edit.js +67 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/ls.d.ts +2 -0
- package/dist/tools/ls.d.ts.map +1 -0
- package/dist/tools/ls.js +75 -0
- package/dist/tools/ls.js.map +1 -0
- package/dist/tools/read.d.ts +2 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +72 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/registry.d.ts +2 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +64 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/utils/output.d.ts +62 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +487 -0
- package/dist/utils/output.js.map +1 -0
- package/package.json +54 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const commander_1 = require("commander");
|
|
38
|
+
const ask_1 = require("./commands/ask");
|
|
39
|
+
const explain_1 = require("./commands/explain");
|
|
40
|
+
const edit_1 = require("./commands/edit");
|
|
41
|
+
const run_1 = require("./commands/run");
|
|
42
|
+
const config_1 = require("./commands/config");
|
|
43
|
+
const login_1 = require("./commands/login");
|
|
44
|
+
const output_1 = require("./utils/output");
|
|
45
|
+
const sylix_1 = require("./api/sylix");
|
|
46
|
+
const VERSION = '1.0.0';
|
|
47
|
+
const program = new commander_1.Command();
|
|
48
|
+
// Global options
|
|
49
|
+
program
|
|
50
|
+
.name('coworker')
|
|
51
|
+
.description('CoWorker by Sylix - AI-powered CLI coding assistant')
|
|
52
|
+
.version(VERSION)
|
|
53
|
+
.option('--no-banner', 'Hide the startup banner')
|
|
54
|
+
.option('--verbose', 'Show detailed information (tokens, timing)')
|
|
55
|
+
.hook('preAction', async () => {
|
|
56
|
+
// Show header before commands (unless --no-banner)
|
|
57
|
+
if ((0, output_1.shouldShowBanner)() && !program.opts().noBanner) {
|
|
58
|
+
await (0, output_1.printHeader)();
|
|
59
|
+
// Show user info if logged in
|
|
60
|
+
try {
|
|
61
|
+
const config = await (0, sylix_1.loadConfig)();
|
|
62
|
+
if (config?.apiKey) {
|
|
63
|
+
(0, output_1.printUserInfo)(undefined, config.defaultModel || 'sylix-4', VERSION);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
(0, output_1.printUserInfo)(undefined, undefined, VERSION);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
(0, output_1.printUserInfo)(undefined, undefined, VERSION);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
// Ask command
|
|
75
|
+
program
|
|
76
|
+
.command('ask <prompt>')
|
|
77
|
+
.description('Ask a question about your codebase')
|
|
78
|
+
.action(async (prompt) => {
|
|
79
|
+
try {
|
|
80
|
+
await (0, ask_1.askCommand)(prompt, program.opts().verbose);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
(0, output_1.printError)('Command failed');
|
|
84
|
+
if (error instanceof Error) {
|
|
85
|
+
console.error(error.message);
|
|
86
|
+
}
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
// Explain command
|
|
91
|
+
program
|
|
92
|
+
.command('explain <file>')
|
|
93
|
+
.description('Explain what a file does')
|
|
94
|
+
.action(async (file) => {
|
|
95
|
+
try {
|
|
96
|
+
await (0, explain_1.explainCommand)(file, program.opts().verbose);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
(0, output_1.printError)('Command failed');
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
// Edit command
|
|
104
|
+
program
|
|
105
|
+
.command('edit <file> <instruction>')
|
|
106
|
+
.description('Edit a file with AI assistance')
|
|
107
|
+
.action(async (file, instruction) => {
|
|
108
|
+
try {
|
|
109
|
+
await (0, edit_1.editCommand)(file, instruction);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
(0, output_1.printError)('Command failed');
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
// Run command
|
|
117
|
+
program
|
|
118
|
+
.command('run <task>')
|
|
119
|
+
.description('Run a task with command suggestions')
|
|
120
|
+
.action(async (task) => {
|
|
121
|
+
try {
|
|
122
|
+
await (0, run_1.runCommandTask)(task, program.opts().verbose);
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
(0, output_1.printError)('Command failed');
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
// Review command
|
|
130
|
+
program
|
|
131
|
+
.command('review <file>')
|
|
132
|
+
.description('Review a file and show quality scores')
|
|
133
|
+
.action(async (file) => {
|
|
134
|
+
try {
|
|
135
|
+
const { reviewCommand } = await Promise.resolve().then(() => __importStar(require('./commands/review')));
|
|
136
|
+
await reviewCommand(file, program.opts().verbose);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
(0, output_1.printError)('Command failed');
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
// Commit command
|
|
144
|
+
program
|
|
145
|
+
.command('commit')
|
|
146
|
+
.description('Generate a commit message for staged changes')
|
|
147
|
+
.option('-m, --message <msg>', 'Use custom commit message')
|
|
148
|
+
.action(async (options) => {
|
|
149
|
+
try {
|
|
150
|
+
const { commitCommand } = await Promise.resolve().then(() => __importStar(require('./commands/commit')));
|
|
151
|
+
await commitCommand(options.message, program.opts().verbose);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
(0, output_1.printError)('Command failed');
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
// Chat command (interactive mode)
|
|
159
|
+
program
|
|
160
|
+
.command('chat')
|
|
161
|
+
.description('Start an interactive chat session')
|
|
162
|
+
.action(async () => {
|
|
163
|
+
try {
|
|
164
|
+
const { chatCommand } = await Promise.resolve().then(() => __importStar(require('./commands/chat')));
|
|
165
|
+
await chatCommand(program.opts().verbose);
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
(0, output_1.printError)('Command failed');
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
// Config command group
|
|
173
|
+
const configCmd = program
|
|
174
|
+
.command('config')
|
|
175
|
+
.description('Manage configuration');
|
|
176
|
+
program
|
|
177
|
+
.command('login')
|
|
178
|
+
.description('Log into Sylix to connect this CLI')
|
|
179
|
+
.action(async () => {
|
|
180
|
+
try {
|
|
181
|
+
await (0, login_1.loginCommand)();
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
(0, output_1.printError)('Command failed');
|
|
185
|
+
process.exit(1);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
configCmd
|
|
189
|
+
.command('init')
|
|
190
|
+
.description('Initialize configuration')
|
|
191
|
+
.action(async () => {
|
|
192
|
+
try {
|
|
193
|
+
await (0, config_1.configInitCommand)();
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
(0, output_1.printError)('Command failed');
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
configCmd
|
|
201
|
+
.command('show')
|
|
202
|
+
.description('Show current configuration')
|
|
203
|
+
.action(async () => {
|
|
204
|
+
try {
|
|
205
|
+
await (0, config_1.configShowCommand)();
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
(0, output_1.printError)('Command failed');
|
|
209
|
+
process.exit(1);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
// Default action - show help with branding
|
|
213
|
+
async function main() {
|
|
214
|
+
if (process.argv.length === 2) {
|
|
215
|
+
if ((0, output_1.shouldShowBanner)()) {
|
|
216
|
+
await (0, output_1.printHeader)();
|
|
217
|
+
// Only show top-level user info if we're not immediately jumping into chat,
|
|
218
|
+
// but since we are jumping into chat, the chat command has its own header.
|
|
219
|
+
}
|
|
220
|
+
// Default to interactive chat instead of help
|
|
221
|
+
try {
|
|
222
|
+
const { chatCommand } = await Promise.resolve().then(() => __importStar(require('./commands/chat')));
|
|
223
|
+
await chatCommand(program.opts().verbose);
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
(0, output_1.printError)('Failed to start interactive chat');
|
|
227
|
+
process.exit(1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
await program.parseAsync(process.argv);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
main().catch(console.error);
|
|
235
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,wCAA4C;AAC5C,gDAAoD;AACpD,0CAA8C;AAC9C,wCAAgD;AAChD,8CAAyE;AACzE,4CAAgD;AAChD,2CAAiG;AACjG,uCAAyC;AAEzC,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,MAAM,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AAG,OAAO,CAAC,IAAI,CAAC,CAuDxF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.askCommand = askCommand;
|
|
4
|
+
const sylix_1 = require("../api/sylix");
|
|
5
|
+
const reader_1 = require("../context/reader");
|
|
6
|
+
const output_1 = require("../utils/output");
|
|
7
|
+
async function askCommand(prompt, verbose = false) {
|
|
8
|
+
const timer = new output_1.Timer();
|
|
9
|
+
try {
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
// Start loading animation
|
|
12
|
+
(0, output_1.startLoadingAnimation)();
|
|
13
|
+
// Load context in parallel
|
|
14
|
+
const contextPromise = (0, reader_1.getContextString)(cwd, prompt);
|
|
15
|
+
const messages = [
|
|
16
|
+
{
|
|
17
|
+
role: 'system',
|
|
18
|
+
content: `You are CoWorker, an AI coding assistant by Sylix. You help developers with coding tasks.
|
|
19
|
+
Be concise and practical. When showing code, use proper markdown code blocks with language identifiers.
|
|
20
|
+
Focus on providing actionable solutions.
|
|
21
|
+
|
|
22
|
+
You have access to the current working directory context. Use it to understand the user's codebase.`
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
role: 'user',
|
|
26
|
+
content: await contextPromise
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
// Start streaming renderer
|
|
30
|
+
const renderer = new output_1.StreamingRenderer();
|
|
31
|
+
let response = '';
|
|
32
|
+
let tokenCount = 0;
|
|
33
|
+
await (0, sylix_1.chat)(messages, (chunk) => {
|
|
34
|
+
if (!response) {
|
|
35
|
+
// First chunk - start the response box
|
|
36
|
+
renderer.start();
|
|
37
|
+
}
|
|
38
|
+
response += chunk;
|
|
39
|
+
renderer.write(chunk);
|
|
40
|
+
tokenCount++;
|
|
41
|
+
});
|
|
42
|
+
renderer.end();
|
|
43
|
+
// Print stats
|
|
44
|
+
(0, output_1.printResponseStats)(timer.elapsed(), verbose ? tokenCount : undefined, verbose);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
(0, output_1.stopLoadingAnimation)();
|
|
48
|
+
(0, output_1.printError)('Failed to process your request');
|
|
49
|
+
if (error instanceof Error) {
|
|
50
|
+
console.error(error.message);
|
|
51
|
+
}
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=ask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/commands/ask.ts"],"names":[],"mappings":";;AAaA,gCAuDC;AApED,wCAAoC;AACpC,8CAAqD;AACrD,4CAQyB;AAGlB,KAAK,UAAU,UAAU,CAAC,MAAc,EAAE,UAAmB,KAAK;IACvE,MAAM,KAAK,GAAG,IAAI,cAAK,EAAE,CAAC;IAE1B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAE1B,0BAA0B;QAC1B,IAAA,8BAAqB,GAAE,CAAC;QAExB,2BAA2B;QAC3B,MAAM,cAAc,GAAG,IAAA,yBAAgB,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAErD,MAAM,QAAQ,GAAG;YACf;gBACE,IAAI,EAAE,QAAiB;gBACvB,OAAO,EAAE;;;;oGAImF;aAC7F;YACD;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,MAAM,cAAc;aAC9B;SACF,CAAC;QAEF,2BAA2B;QAC3B,MAAM,QAAQ,GAAG,IAAI,0BAAiB,EAAE,CAAC;QAEzC,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,UAAU,GAAG,CAAC,CAAC;QAEnB,MAAM,IAAA,YAAI,EAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAC7B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,uCAAuC;gBACvC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnB,CAAC;YACD,QAAQ,IAAI,KAAK,CAAC;YAClB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtB,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,GAAG,EAAE,CAAC;QAEf,cAAc;QACd,IAAA,2BAAkB,EAAC,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,6BAAoB,GAAE,CAAC;QACvB,IAAA,mBAAU,EAAC,gCAAgC,CAAC,CAAC;QAC7C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAkBA,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAwRlE"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.chatCommand = chatCommand;
|
|
37
|
+
const readline = __importStar(require("readline"));
|
|
38
|
+
const sylix_1 = require("../api/sylix");
|
|
39
|
+
const output_1 = require("../utils/output");
|
|
40
|
+
const registry_1 = require("../tools/registry");
|
|
41
|
+
const sylix_2 = require("../api/sylix");
|
|
42
|
+
const loader_1 = require("../memory/loader");
|
|
43
|
+
async function chatCommand(verbose) {
|
|
44
|
+
await (0, output_1.printHeader)();
|
|
45
|
+
(0, output_1.printInfo)('Interactive chat session started. Type "exit" to quit.');
|
|
46
|
+
// Initial status check for UI
|
|
47
|
+
const config = await (0, sylix_2.loadConfig)();
|
|
48
|
+
console.log(output_1.theme.dim('Press ? for shortcuts or type your message.'));
|
|
49
|
+
console.log();
|
|
50
|
+
const rl = readline.createInterface({
|
|
51
|
+
input: process.stdin,
|
|
52
|
+
output: process.stdout
|
|
53
|
+
});
|
|
54
|
+
// Load memory context (COWORKER.md chain + auto-memory)
|
|
55
|
+
const cwd = process.cwd();
|
|
56
|
+
const memCtx = await (0, loader_1.loadMemory)(cwd);
|
|
57
|
+
const memoryPrompt = (0, loader_1.buildMemorySystemPrompt)(memCtx);
|
|
58
|
+
const hasMemory = !!(memCtx.global || memCtx.project || memCtx.rules.length > 0 || memCtx.autoMemory);
|
|
59
|
+
const systemContent = memoryPrompt
|
|
60
|
+
? `You are CoWorker, an AI coding assistant by Sylix. You help developers with coding tasks in an interactive chat.
|
|
61
|
+
Be concise and helpful. Use code blocks when showing code. Remember the conversation context.
|
|
62
|
+
|
|
63
|
+
${memoryPrompt}`
|
|
64
|
+
: `You are CoWorker, an AI coding assistant by Sylix. You help developers with coding tasks in an interactive chat.
|
|
65
|
+
Be concise and helpful. Use code blocks when showing code. Remember the conversation context.`;
|
|
66
|
+
const conversationHistory = [
|
|
67
|
+
{ role: 'system', content: systemContent }
|
|
68
|
+
];
|
|
69
|
+
if (hasMemory) {
|
|
70
|
+
const memSources = [
|
|
71
|
+
memCtx.global && 'global',
|
|
72
|
+
memCtx.project && 'project',
|
|
73
|
+
memCtx.rules.length > 0 && `${memCtx.rules.length} rules`,
|
|
74
|
+
memCtx.autoMemory && 'auto-memory'
|
|
75
|
+
].filter(Boolean).join(', ');
|
|
76
|
+
console.log(output_1.theme.success(' ✓ Memory loaded: ') + output_1.theme.dim(memSources));
|
|
77
|
+
console.log();
|
|
78
|
+
}
|
|
79
|
+
const promptUser = () => {
|
|
80
|
+
const width = process.stdout.columns || 80;
|
|
81
|
+
const divider = output_1.theme.dim('─'.repeat(width));
|
|
82
|
+
const loginStatus = config?.apiKey ? 'Signed in to Sylix' : 'Not logged in · Run /login';
|
|
83
|
+
const shortcuts = '? for shortcuts';
|
|
84
|
+
const paddingLength = Math.max(0, width - loginStatus.length - shortcuts.length - 4);
|
|
85
|
+
const padding = ' '.repeat(paddingLength);
|
|
86
|
+
console.log();
|
|
87
|
+
console.log(divider);
|
|
88
|
+
console.log(output_1.theme.dim(' ' + shortcuts) + padding + output_1.theme.dim(loginStatus + ' '));
|
|
89
|
+
console.log(divider);
|
|
90
|
+
rl.question(output_1.theme.brand('>') + ' ', async (input) => {
|
|
91
|
+
const message = input.trim();
|
|
92
|
+
if (!message) {
|
|
93
|
+
promptUser();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (message === '?') {
|
|
97
|
+
console.log();
|
|
98
|
+
console.log(output_1.theme.brand(' CoWorker Shortcuts:'));
|
|
99
|
+
console.log();
|
|
100
|
+
console.log(output_1.theme.dim(' Chat'));
|
|
101
|
+
console.log(' exit, quit ' + output_1.theme.dim('End the session'));
|
|
102
|
+
console.log(' /clear ' + output_1.theme.dim('Clear chat history'));
|
|
103
|
+
console.log(' /compact ' + output_1.theme.dim('Summarize conversation to free context'));
|
|
104
|
+
console.log(' /export [filename] ' + output_1.theme.dim('Export conversation to markdown'));
|
|
105
|
+
console.log(' /btw <question> ' + output_1.theme.dim('Ask a side question without breaking context'));
|
|
106
|
+
console.log();
|
|
107
|
+
console.log(output_1.theme.dim(' Git & Code'));
|
|
108
|
+
console.log(' /diff ' + output_1.theme.dim('Show git diff of current changes'));
|
|
109
|
+
console.log(' /init ' + output_1.theme.dim('Create COWORKER.md in current directory'));
|
|
110
|
+
console.log();
|
|
111
|
+
console.log(output_1.theme.dim(' Memory'));
|
|
112
|
+
console.log(' /memory ' + output_1.theme.dim('Show all loaded memory sources'));
|
|
113
|
+
console.log(' /remember <text> ' + output_1.theme.dim('Save a note to auto-memory'));
|
|
114
|
+
console.log();
|
|
115
|
+
console.log(output_1.theme.dim(' Chrome'));
|
|
116
|
+
console.log(' /chrome ' + output_1.theme.dim('Open Chrome browser and show capabilities'));
|
|
117
|
+
console.log();
|
|
118
|
+
console.log(output_1.theme.dim(' Auth'));
|
|
119
|
+
console.log(' /login ' + output_1.theme.dim('Authenticate the CLI'));
|
|
120
|
+
console.log();
|
|
121
|
+
promptUser();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (message.toLowerCase() === '/login') {
|
|
125
|
+
const { loginCommand } = await Promise.resolve().then(() => __importStar(require('./login')));
|
|
126
|
+
await loginCommand();
|
|
127
|
+
promptUser();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (message.toLowerCase() === '/clear') {
|
|
131
|
+
conversationHistory.length = 1; // Keep system prompt
|
|
132
|
+
console.clear();
|
|
133
|
+
await (0, output_1.printHeader)();
|
|
134
|
+
promptUser();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (message.toLowerCase() === '/memory') {
|
|
138
|
+
await (0, loader_1.showMemory)(cwd);
|
|
139
|
+
promptUser();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (message.toLowerCase().startsWith('/remember ')) {
|
|
143
|
+
const note = message.slice(10).trim();
|
|
144
|
+
const noteKey = `note-${Date.now()}`;
|
|
145
|
+
await (0, loader_1.writeAutoMemory)(noteKey, note, cwd);
|
|
146
|
+
(0, output_1.printSuccess)('Saved to memory: ' + note.substring(0, 60));
|
|
147
|
+
promptUser();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (message.toLowerCase() === '/diff') {
|
|
151
|
+
const { executeBash } = await Promise.resolve().then(() => __importStar(require('../tools/bash')));
|
|
152
|
+
const result = await executeBash({ command: 'git diff' });
|
|
153
|
+
console.log(output_1.theme.dim(result || 'No changes'));
|
|
154
|
+
promptUser();
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
if (message.toLowerCase() === '/init') {
|
|
158
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs-extra')));
|
|
159
|
+
const coworkerMd = `# COWORKER.md\n\nThis file provides context to CoWorker about your project.\n\n## Project\n<!-- Briefly describe what this project does -->\n\n## Tech Stack\n<!-- e.g. Next.js, TypeScript, Postgres -->\n\n## Key Files\n<!-- List important files/folders and what they do -->\n\n## Conventions\n<!-- Coding standards, naming conventions, etc. -->\n`;
|
|
160
|
+
await fs.writeFile('COWORKER.md', coworkerMd, 'utf8');
|
|
161
|
+
(0, output_1.printSuccess)('Created COWORKER.md — fill it in to give CoWorker project context!');
|
|
162
|
+
promptUser();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (message.toLowerCase().startsWith('/compact')) {
|
|
166
|
+
// Keep user messages only and ask the AI to summarize
|
|
167
|
+
const summary = conversationHistory.slice(1).map(m => `${m.role}: ${m.content || ''}`).join('\n').substring(0, 3000);
|
|
168
|
+
conversationHistory.length = 1; // reset to system
|
|
169
|
+
conversationHistory.push({ role: 'user', content: `Please summarize this conversation so far in a few sentences, then I\'ll continue: ${summary}` });
|
|
170
|
+
(0, output_1.printInfo)('Compacted conversation history. Re-summarizing...');
|
|
171
|
+
promptUser();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (message.toLowerCase().startsWith('/export')) {
|
|
175
|
+
const parts = message.split(' ');
|
|
176
|
+
const filename = parts[1] || `coworker-export-${Date.now()}.md`;
|
|
177
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs-extra')));
|
|
178
|
+
const exportContent = conversationHistory.slice(1).map(m => {
|
|
179
|
+
const role = m.role === 'assistant' ? '**CoWorker**' : '**You**';
|
|
180
|
+
return `${role}\n\n${m.content || ''}\n`;
|
|
181
|
+
}).join('\n---\n\n');
|
|
182
|
+
await fs.writeFile(filename, `# CoWorker Conversation Export\n\n${exportContent}`, 'utf8');
|
|
183
|
+
(0, output_1.printSuccess)(`Conversation exported to ${filename}`);
|
|
184
|
+
promptUser();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (message.toLowerCase().startsWith('/btw ')) {
|
|
188
|
+
const sideQuestion = message.slice(5).trim();
|
|
189
|
+
// Add as a user message with a btw prefix so the AI doesn't change its current direction
|
|
190
|
+
conversationHistory.push({ role: 'user', content: `[Side question, answer briefly without changing your current task]: ${sideQuestion}` });
|
|
191
|
+
// Fall through to the chat loop
|
|
192
|
+
}
|
|
193
|
+
if (message.toLowerCase() === '/chrome') {
|
|
194
|
+
console.log();
|
|
195
|
+
console.log(output_1.theme.brand(' Chrome Browser Integration'));
|
|
196
|
+
console.log();
|
|
197
|
+
console.log(output_1.theme.dim(' CoWorker can control Chrome to:'));
|
|
198
|
+
console.log(' ● ' + output_1.theme.dim('Debug live web apps with console log capture'));
|
|
199
|
+
console.log(' ● ' + output_1.theme.dim('Navigate, click, fill forms autonomously'));
|
|
200
|
+
console.log(' ● ' + output_1.theme.dim('Take screenshots of pages'));
|
|
201
|
+
console.log(' ● ' + output_1.theme.dim('Read and summarize page DOM/content'));
|
|
202
|
+
console.log(' ● ' + output_1.theme.dim('Execute JavaScript in the browser'));
|
|
203
|
+
console.log();
|
|
204
|
+
console.log(output_1.theme.dim(' Just ask naturally:'));
|
|
205
|
+
console.log(' ' + output_1.theme.brand('> ') + 'Go to localhost:3000 and check the console for errors');
|
|
206
|
+
console.log(' ' + output_1.theme.brand('> ') + 'Take a screenshot of https://sylixide.com');
|
|
207
|
+
console.log(' ' + output_1.theme.brand('> ') + 'Fill in the login form with test@example.com and click submit');
|
|
208
|
+
console.log();
|
|
209
|
+
console.log(output_1.theme.dim(' Requirements: Chrome must be running with'));
|
|
210
|
+
console.log(output_1.theme.dim(' --remote-debugging-port=9222'));
|
|
211
|
+
console.log(output_1.theme.dim(' Or CoWorker will launch a new Chrome window automatically.'));
|
|
212
|
+
console.log();
|
|
213
|
+
promptUser();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (message.toLowerCase() === 'exit' || message.toLowerCase() === 'quit') {
|
|
217
|
+
console.log();
|
|
218
|
+
(0, output_1.printSuccess)('Chat session ended');
|
|
219
|
+
rl.close();
|
|
220
|
+
process.exit(0);
|
|
221
|
+
}
|
|
222
|
+
conversationHistory.push({ role: 'user', content: message });
|
|
223
|
+
const runChatTurn = async () => {
|
|
224
|
+
const timer = new output_1.Timer();
|
|
225
|
+
let responseContent = '';
|
|
226
|
+
let toolCalls = [];
|
|
227
|
+
let isFirstChunk = true;
|
|
228
|
+
let tokenCount = 0;
|
|
229
|
+
try {
|
|
230
|
+
const res = await (0, sylix_1.chat)(conversationHistory, (chunk) => {
|
|
231
|
+
if (isFirstChunk) {
|
|
232
|
+
process.stdout.write(output_1.theme.ai('CoWorker') + output_1.theme.dim(' › '));
|
|
233
|
+
isFirstChunk = false;
|
|
234
|
+
}
|
|
235
|
+
process.stdout.write(chunk);
|
|
236
|
+
tokenCount++;
|
|
237
|
+
});
|
|
238
|
+
responseContent = res.content || '';
|
|
239
|
+
toolCalls = res.tool_calls || [];
|
|
240
|
+
if (responseContent) {
|
|
241
|
+
conversationHistory.push({ role: 'assistant', content: responseContent });
|
|
242
|
+
console.log();
|
|
243
|
+
console.log();
|
|
244
|
+
(0, output_1.printResponseStats)(timer.elapsed(), verbose ? tokenCount : undefined, verbose);
|
|
245
|
+
console.log();
|
|
246
|
+
}
|
|
247
|
+
if (toolCalls.length > 0) {
|
|
248
|
+
// Push the assistant's tool_call request into history so the model knows what it did
|
|
249
|
+
conversationHistory.push({
|
|
250
|
+
role: 'assistant',
|
|
251
|
+
tool_calls: toolCalls
|
|
252
|
+
});
|
|
253
|
+
// Execute each tool locally
|
|
254
|
+
for (const tc of toolCalls) {
|
|
255
|
+
const result = await (0, registry_1.handleToolCall)(tc);
|
|
256
|
+
// Push tool result
|
|
257
|
+
conversationHistory.push({
|
|
258
|
+
role: 'tool',
|
|
259
|
+
name: tc.function.name,
|
|
260
|
+
tool_call_id: tc.id,
|
|
261
|
+
content: result
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
// Recursively trigger the AI again to read the output
|
|
265
|
+
await runChatTurn();
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
// End of execution chain, yield back to user
|
|
269
|
+
promptUser();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
(0, output_1.stopLoadingAnimation)();
|
|
274
|
+
(0, output_1.printError)('Failed to get response');
|
|
275
|
+
if (error instanceof Error) {
|
|
276
|
+
console.error(error.message);
|
|
277
|
+
}
|
|
278
|
+
promptUser();
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
await runChatTurn();
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
promptUser();
|
|
285
|
+
// Handle Ctrl+C
|
|
286
|
+
rl.on('close', () => {
|
|
287
|
+
console.log();
|
|
288
|
+
(0, output_1.printSuccess)('Chat session ended');
|
|
289
|
+
process.exit(0);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,kCAwRC;AA1SD,mDAAqC;AACrC,wCAAoC;AACpC,4CAWyB;AACzB,gDAAmD;AACnD,wCAAuD;AACvD,6CAAoG;AAE7F,KAAK,UAAU,WAAW,CAAC,OAAiB;IACjD,MAAM,IAAA,oBAAW,GAAE,CAAC;IACpB,IAAA,kBAAS,EAAC,wDAAwD,CAAC,CAAC;IAEpE,8BAA8B;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAU,GAAE,CAAC;IAElC,OAAO,CAAC,GAAG,CAAC,cAAK,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,wDAAwD;IACxD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,MAAM,G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