@sylix/coworker 2.0.3 → 2.0.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.
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +27 -25
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/WorkflowEngine.d.ts +22 -0
- package/dist/commands/WorkflowEngine.d.ts.map +1 -0
- package/dist/commands/WorkflowEngine.js +127 -0
- package/dist/commands/WorkflowEngine.js.map +1 -0
- package/dist/commands/slash/registry.d.ts +5 -1
- package/dist/commands/slash/registry.d.ts.map +1 -1
- package/dist/commands/slash/registry.js +18 -0
- package/dist/commands/slash/registry.js.map +1 -1
- package/dist/config/SettingsManager.d.ts +6 -2
- package/dist/config/SettingsManager.d.ts.map +1 -1
- package/dist/config/SettingsManager.js +31 -28
- package/dist/config/SettingsManager.js.map +1 -1
- package/dist/core/CoWorkerAgent.d.ts +7 -1
- package/dist/core/CoWorkerAgent.d.ts.map +1 -1
- package/dist/core/CoWorkerAgent.js +39 -4
- package/dist/core/CoWorkerAgent.js.map +1 -1
- package/dist/skills/HookAndSkillManager.d.ts.map +1 -1
- package/dist/skills/HookAndSkillManager.js +27 -9
- package/dist/skills/HookAndSkillManager.js.map +1 -1
- package/dist/types/modes.d.ts +16 -0
- package/dist/types/modes.d.ts.map +1 -0
- package/dist/types/modes.js +15 -0
- package/dist/types/modes.js.map +1 -0
- package/dist/utils/RuleManager.d.ts +23 -0
- package/dist/utils/RuleManager.d.ts.map +1 -0
- package/dist/utils/RuleManager.js +115 -0
- package/dist/utils/RuleManager.js.map +1 -0
- package/dist/utils/character.d.ts.map +1 -1
- package/dist/utils/character.js +8 -9
- package/dist/utils/character.js.map +1 -1
- package/dist/utils/inputbar.d.ts +11 -79
- package/dist/utils/inputbar.d.ts.map +1 -1
- package/dist/utils/inputbar.js +80 -201
- package/dist/utils/inputbar.js.map +1 -1
- package/dist/utils/memoryManager.d.ts.map +1 -1
- package/dist/utils/memoryManager.js +6 -3
- package/dist/utils/memoryManager.js.map +1 -1
- package/dist/utils/output.d.ts +9 -48
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +71 -349
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/systemPrompt.d.ts.map +1 -1
- package/dist/utils/systemPrompt.js +14 -5
- package/dist/utils/systemPrompt.js.map +1 -1
- package/dist/utils/welcome.d.ts +5 -1
- package/dist/utils/welcome.d.ts.map +1 -1
- package/dist/utils/welcome.js +19 -129
- package/dist/utils/welcome.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"character.js","sourceRoot":"","sources":["../../src/utils/character.ts"],"names":[],"mappings":";;;;;AAaA,
|
|
1
|
+
{"version":3,"file":"character.js","sourceRoot":"","sources":["../../src/utils/character.ts"],"names":[],"mappings":";;;;;AAaA,0CAgBC;AA7BD,kDAA0B;AAE1B;;;GAGG;AAEH,MAAM,WAAW,GAAG;IAClB,IAAI,EAAG,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAG,QAAQ;IACtC,GAAG,EAAI,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAG,QAAQ;IACtC,EAAE,EAAK,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAG,wBAAwB;CACvD,CAAC;AAEF,SAAgB,eAAe,CAAC,QAA0B,MAAM;IAC9D,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC;IAElC,MAAM,IAAI,GAAG,KAAK,KAAK,MAAM;QAC3B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QAC9D,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAExB,OAAO;QACL,IAAI,CAAC,aAAa,CAAC;QACnB,IAAI,CAAC,aAAa,CAAC;QACnB,IAAI,CAAC,aAAa,CAAC;QACnB,IAAI;QACJ,IAAI,CAAC,aAAa,CAAC;QACnB,IAAI,CAAC,aAAa,CAAC;QACnB,IAAI,CAAC,aAAa,CAAC;KACpB,CAAC;AACJ,CAAC"}
|
package/dist/utils/inputbar.d.ts
CHANGED
|
@@ -1,88 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { AgentMode } from '../types/modes';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* - On state changes (thinking, receiving, etc.)
|
|
6
|
-
*
|
|
7
|
-
* The input bar uses a simple approach:
|
|
8
|
-
* readline handles the actual input on a bordered line.
|
|
9
|
-
* We print borders and status around it.
|
|
3
|
+
* Premium Input Bar Manager — v2.0.5
|
|
4
|
+
* Handles the boxed input area and Mode Cycling (BUILD, PLAN, RESEARCH, ASK).
|
|
10
5
|
*/
|
|
11
6
|
export declare function drawTopBorder(): void;
|
|
12
7
|
export declare function drawBottomBorder(): void;
|
|
13
|
-
export declare function drawStatusLine(
|
|
14
|
-
/**
|
|
15
|
-
* Get the readline prompt string (the ◆ prefix).
|
|
16
|
-
*/
|
|
17
|
-
export declare function getPromptString(state?: InputBarState): string;
|
|
18
|
-
/**
|
|
19
|
-
* Draw the full input frame (top border, prompt placeholder, bottom border, status).
|
|
20
|
-
* Used when transitioning states.
|
|
21
|
-
*/
|
|
22
|
-
export declare function drawInputFrame(state: InputBarState, inputText?: string): void;
|
|
23
|
-
/**
|
|
24
|
-
* Clear the input frame (4 lines: top border, input, bottom border, status).
|
|
25
|
-
* Move cursor up and clear each line.
|
|
26
|
-
*/
|
|
27
|
-
export declare function clearInputFrame(lines?: number): void;
|
|
28
|
-
/**
|
|
29
|
-
* Show the locked state while AI is working.
|
|
30
|
-
* Replaces the input frame with a locked version.
|
|
31
|
-
*/
|
|
32
|
-
export declare function lockInputBar(state: 'sending' | 'receiving', inputText?: string): void;
|
|
33
|
-
/**
|
|
34
|
-
* Show a brief success flash then return to ready.
|
|
35
|
-
*/
|
|
36
|
-
export declare function flashSuccess(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Manages the complete input bar lifecycle during the REPL.
|
|
39
|
-
*
|
|
40
|
-
* Usage in REPL:
|
|
41
|
-
* const bar = new InputBarManager();
|
|
42
|
-
* bar.drawReady(); // show empty input bar
|
|
43
|
-
* const input = await bar.ask() // get user input (readline inside frame)
|
|
44
|
-
* bar.showSending(input); // lock bar while thinking
|
|
45
|
-
* // ... AI response renders above ...
|
|
46
|
-
* bar.showReceiving(); // update status while streaming
|
|
47
|
-
* // ... response done ...
|
|
48
|
-
* bar.drawReady(); // unlock for next input
|
|
49
|
-
*/
|
|
8
|
+
export declare function drawStatusLine(mode: AgentMode | string, status?: string): void;
|
|
50
9
|
export declare class InputBarManager {
|
|
51
|
-
private
|
|
52
|
-
private state;
|
|
53
|
-
private contextLabel;
|
|
54
|
-
private resizeHandler;
|
|
10
|
+
private mode;
|
|
55
11
|
constructor();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* Does NOT start readline — that's done in ask().
|
|
59
|
-
*/
|
|
60
|
-
drawReady(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Ask for user input inside the framed bar.
|
|
63
|
-
* Returns the trimmed input string.
|
|
64
|
-
*/
|
|
65
|
-
ask(history?: string[], contextLabel?: string): Promise<string>;
|
|
66
|
-
/**
|
|
67
|
-
* Lock the bar in "sending" state (user just hit Enter).
|
|
68
|
-
*/
|
|
69
|
-
showSending(inputText: string): void;
|
|
70
|
-
/**
|
|
71
|
-
* Update to "receiving" state while AI streams response.
|
|
72
|
-
*/
|
|
73
|
-
showReceiving(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Show success flash briefly.
|
|
76
|
-
*/
|
|
77
|
-
showSuccess(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Reset to ready state for next input.
|
|
80
|
-
* Clears old status and draws fresh frame.
|
|
81
|
-
*/
|
|
82
|
-
reset(): void;
|
|
83
|
-
/**
|
|
84
|
-
* Clean up on exit.
|
|
85
|
-
*/
|
|
12
|
+
getMode(): AgentMode;
|
|
13
|
+
/** Lifecycle: Clean up listeners and reset TTY */
|
|
86
14
|
destroy(): void;
|
|
15
|
+
/** Lifecycle: Reset internal state */
|
|
16
|
+
reset(): void;
|
|
17
|
+
private cycleMode;
|
|
18
|
+
ask(history: string[], contextLabel: string): Promise<string>;
|
|
87
19
|
}
|
|
88
20
|
//# sourceMappingURL=inputbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputbar.d.ts","sourceRoot":"","sources":["../../src/utils/inputbar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inputbar.d.ts","sourceRoot":"","sources":["../../src/utils/inputbar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AAEH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,MAAM,GAAE,MAAgB,GAAG,IAAI,CAuBvF;AAgBD,qBAAa,eAAe;IAC1B,OAAO,CAAC,IAAI,CAA8B;;IAS1C,OAAO,IAAI,SAAS;IAEpB,kDAAkD;IAClD,OAAO,IAAI,IAAI;IAMf,sCAAsC;IACtC,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,SAAS;IAMX,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAiCpE"}
|
package/dist/utils/inputbar.js
CHANGED
|
@@ -37,228 +37,107 @@ exports.InputBarManager = void 0;
|
|
|
37
37
|
exports.drawTopBorder = drawTopBorder;
|
|
38
38
|
exports.drawBottomBorder = drawBottomBorder;
|
|
39
39
|
exports.drawStatusLine = drawStatusLine;
|
|
40
|
-
exports.getPromptString = getPromptString;
|
|
41
|
-
exports.drawInputFrame = drawInputFrame;
|
|
42
|
-
exports.clearInputFrame = clearInputFrame;
|
|
43
|
-
exports.lockInputBar = lockInputBar;
|
|
44
|
-
exports.flashSuccess = flashSuccess;
|
|
45
40
|
const readline = __importStar(require("readline"));
|
|
46
41
|
const output_1 = require("./output");
|
|
42
|
+
const modes_1 = require("../types/modes");
|
|
47
43
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* ═══════════════════════════════════════════════════════════════════
|
|
51
|
-
*
|
|
52
|
-
* Design:
|
|
53
|
-
* ────────────────────────────────────────────────────────────────
|
|
54
|
-
* ◆ [user input text here]█
|
|
55
|
-
* ────────────────────────────────────────────────────────────────
|
|
56
|
-
* ? /help for commands · Ctrl+C to exit
|
|
57
|
-
*
|
|
58
|
-
* States: ready, typing, slash, sending, receiving, success
|
|
59
|
-
*/
|
|
60
|
-
// Colors
|
|
61
|
-
const borderColor = (s) => output_1.theme.dim(s);
|
|
62
|
-
const prefixReady = () => output_1.theme.brand(' ◆ ');
|
|
63
|
-
const prefixLocked = () => output_1.theme.dim(' ◆ ');
|
|
64
|
-
const prefixSuccess = () => output_1.theme.success(' ✓ ');
|
|
65
|
-
const inputColor = (s) => output_1.theme.white(s);
|
|
66
|
-
const STATUS_MESSAGES = {
|
|
67
|
-
ready: ' ? /help for commands · Ctrl+C to exit',
|
|
68
|
-
typing: ' ? /help for commands · Ctrl+C to exit',
|
|
69
|
-
slash: ' ↑↓ navigate · Enter select · Esc dismiss',
|
|
70
|
-
sending: ' ◆ thinking...',
|
|
71
|
-
receiving: ' ◆ CoWorker is responding...',
|
|
72
|
-
success: ' ✓ done',
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Draws the framed input bar. This is called:
|
|
76
|
-
* - Before readline prompt (draws the frame)
|
|
77
|
-
* - On state changes (thinking, receiving, etc.)
|
|
78
|
-
*
|
|
79
|
-
* The input bar uses a simple approach:
|
|
80
|
-
* readline handles the actual input on a bordered line.
|
|
81
|
-
* We print borders and status around it.
|
|
44
|
+
* Premium Input Bar Manager — v2.0.5
|
|
45
|
+
* Handles the boxed input area and Mode Cycling (BUILD, PLAN, RESEARCH, ASK).
|
|
82
46
|
*/
|
|
83
47
|
function drawTopBorder() {
|
|
84
|
-
const
|
|
85
|
-
console.log(
|
|
48
|
+
const width = (0, output_1.getTermWidth)();
|
|
49
|
+
console.log(output_1.theme.dim(' ┌' + '─'.repeat(width - 6) + '┐'));
|
|
86
50
|
}
|
|
87
51
|
function drawBottomBorder() {
|
|
88
|
-
const
|
|
89
|
-
console.log(
|
|
90
|
-
}
|
|
91
|
-
function drawStatusLine(state, contextLabel) {
|
|
92
|
-
const msg = STATUS_MESSAGES[state] || STATUS_MESSAGES.ready;
|
|
93
|
-
const separator = contextLabel ? output_1.theme.dim(' · ') : '';
|
|
94
|
-
console.log(output_1.theme.dim(msg) + separator + (contextLabel || ''));
|
|
52
|
+
const width = (0, output_1.getTermWidth)();
|
|
53
|
+
console.log(output_1.theme.dim(' └' + '─'.repeat(width - 6) + '┘'));
|
|
95
54
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
55
|
+
function drawStatusLine(mode, status = 'ready') {
|
|
56
|
+
const width = (0, output_1.getTermWidth)();
|
|
57
|
+
// Handle literal strings for legacy calls or specific statuses
|
|
58
|
+
let modeLabel = '';
|
|
59
|
+
let modeColor = output_1.theme.dim;
|
|
60
|
+
if (typeof mode === 'string' && !Object.values(modes_1.AgentMode).includes(mode)) {
|
|
61
|
+
status = mode;
|
|
62
|
+
modeLabel = ' [COWORKER] ';
|
|
63
|
+
modeColor = output_1.theme.brand;
|
|
105
64
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
*/
|
|
111
|
-
function drawInputFrame(state, inputText = '') {
|
|
112
|
-
drawTopBorder();
|
|
113
|
-
const prefix = getPromptString(state);
|
|
114
|
-
console.log(prefix + inputColor(inputText));
|
|
115
|
-
drawBottomBorder();
|
|
116
|
-
drawStatusLine(state);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Clear the input frame (4 lines: top border, input, bottom border, status).
|
|
120
|
-
* Move cursor up and clear each line.
|
|
121
|
-
*/
|
|
122
|
-
function clearInputFrame(lines = 4) {
|
|
123
|
-
for (let i = 0; i < lines; i++) {
|
|
124
|
-
process.stdout.write('\x1b[1A\x1b[2K'); // move up, clear line
|
|
65
|
+
else {
|
|
66
|
+
const activeMode = mode;
|
|
67
|
+
modeLabel = ` [${activeMode} MODE] `;
|
|
68
|
+
modeColor = getModeColor(activeMode);
|
|
125
69
|
}
|
|
70
|
+
const statusLabel = status.toUpperCase();
|
|
71
|
+
const rightPart = `${output_1.theme.dim('·')} ${modeColor(modeLabel)} ${output_1.theme.dim('·')} ${output_1.theme.brand(statusLabel)} `;
|
|
72
|
+
const leftPart = ' ';
|
|
73
|
+
const padding = width - visLen(leftPart) - visLen(rightPart) - 8;
|
|
74
|
+
process.stdout.write('\r' + leftPart + output_1.theme.dim('│') + ' '.repeat(Math.max(0, padding)) + rightPart + output_1.theme.dim('│') + '\n');
|
|
126
75
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
drawStatusLine(state);
|
|
76
|
+
function getModeColor(mode) {
|
|
77
|
+
switch (mode) {
|
|
78
|
+
case modes_1.AgentMode.BUILD: return output_1.theme.success;
|
|
79
|
+
case modes_1.AgentMode.PLAN: return output_1.theme.warning;
|
|
80
|
+
case modes_1.AgentMode.RESEARCH: return output_1.theme.brand;
|
|
81
|
+
case modes_1.AgentMode.ASK: return output_1.theme.purple;
|
|
82
|
+
default: return output_1.theme.dim;
|
|
83
|
+
}
|
|
136
84
|
}
|
|
137
|
-
|
|
138
|
-
*
|
|
139
|
-
*/
|
|
140
|
-
function flashSuccess() {
|
|
141
|
-
drawTopBorder();
|
|
142
|
-
console.log(prefixSuccess());
|
|
143
|
-
drawBottomBorder();
|
|
144
|
-
drawStatusLine('success');
|
|
85
|
+
function visLen(str) {
|
|
86
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '').length;
|
|
145
87
|
}
|
|
146
|
-
/**
|
|
147
|
-
* Manages the complete input bar lifecycle during the REPL.
|
|
148
|
-
*
|
|
149
|
-
* Usage in REPL:
|
|
150
|
-
* const bar = new InputBarManager();
|
|
151
|
-
* bar.drawReady(); // show empty input bar
|
|
152
|
-
* const input = await bar.ask() // get user input (readline inside frame)
|
|
153
|
-
* bar.showSending(input); // lock bar while thinking
|
|
154
|
-
* // ... AI response renders above ...
|
|
155
|
-
* bar.showReceiving(); // update status while streaming
|
|
156
|
-
* // ... response done ...
|
|
157
|
-
* bar.drawReady(); // unlock for next input
|
|
158
|
-
*/
|
|
159
88
|
class InputBarManager {
|
|
160
89
|
constructor() {
|
|
161
|
-
this.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this.resizeHandler = () => {
|
|
167
|
-
// On resize, we don't need to redraw mid-input since readline handles it
|
|
168
|
-
};
|
|
169
|
-
process.stdout.on('resize', this.resizeHandler);
|
|
90
|
+
this.mode = modes_1.AgentMode.BUILD;
|
|
91
|
+
if (process.stdin.isTTY) {
|
|
92
|
+
process.stdin.setRawMode(true);
|
|
93
|
+
readline.emitKeypressEvents(process.stdin);
|
|
94
|
+
}
|
|
170
95
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
drawTopBorder();
|
|
178
|
-
// The readline prompt will fill this line
|
|
96
|
+
getMode() { return this.mode; }
|
|
97
|
+
/** Lifecycle: Clean up listeners and reset TTY */
|
|
98
|
+
destroy() {
|
|
99
|
+
if (process.stdin.isTTY) {
|
|
100
|
+
process.stdin.setRawMode(false);
|
|
101
|
+
}
|
|
179
102
|
}
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
103
|
+
/** Lifecycle: Reset internal state */
|
|
104
|
+
reset() {
|
|
105
|
+
this.mode = modes_1.AgentMode.BUILD;
|
|
106
|
+
}
|
|
107
|
+
cycleMode() {
|
|
108
|
+
const modes = Object.values(modes_1.AgentMode);
|
|
109
|
+
const nextIdx = (modes.indexOf(this.mode) + 1) % modes.length;
|
|
110
|
+
this.mode = modes[nextIdx];
|
|
111
|
+
}
|
|
112
|
+
async ask(history, contextLabel) {
|
|
113
|
+
const rl = readline.createInterface({
|
|
114
|
+
input: process.stdin,
|
|
115
|
+
output: process.stdout,
|
|
116
|
+
terminal: true,
|
|
117
|
+
history: history,
|
|
118
|
+
prompt: ''
|
|
119
|
+
});
|
|
120
|
+
drawStatusLine(this.mode, contextLabel);
|
|
187
121
|
return new Promise((resolve) => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
resolve(
|
|
122
|
+
const onKeypress = (str, key) => {
|
|
123
|
+
// Tab for Mode Cycling
|
|
124
|
+
if (key && (key.name === 'tab')) {
|
|
125
|
+
this.cycleMode();
|
|
126
|
+
rl._refreshLine();
|
|
127
|
+
process.stdout.write('\x1b[1A');
|
|
128
|
+
drawStatusLine(this.mode, contextLabel);
|
|
129
|
+
process.stdout.write('\r │ ' + rl.line);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
process.stdin.on('keypress', onKeypress);
|
|
133
|
+
process.stdout.write(' │ ');
|
|
134
|
+
rl.on('line', (line) => {
|
|
135
|
+
process.stdin.removeListener('keypress', onKeypress);
|
|
136
|
+
rl.close();
|
|
137
|
+
resolve(line.trim());
|
|
204
138
|
});
|
|
205
139
|
});
|
|
206
140
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Lock the bar in "sending" state (user just hit Enter).
|
|
209
|
-
*/
|
|
210
|
-
showSending(inputText) {
|
|
211
|
-
this.state = 'sending';
|
|
212
|
-
// Clear the bottom border + status that ask() drew
|
|
213
|
-
process.stdout.write('\x1b[1A\x1b[2K'); // clear status
|
|
214
|
-
process.stdout.write('\x1b[1A\x1b[2K'); // clear bottom border
|
|
215
|
-
drawBottomBorder();
|
|
216
|
-
drawStatusLine('sending', this.contextLabel);
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Update to "receiving" state while AI streams response.
|
|
220
|
-
*/
|
|
221
|
-
showReceiving() {
|
|
222
|
-
this.state = 'receiving';
|
|
223
|
-
// Overwrite the status line
|
|
224
|
-
process.stdout.write('\x1b[1A\x1b[2K'); // clear current status
|
|
225
|
-
drawStatusLine('receiving', this.contextLabel);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Show success flash briefly.
|
|
229
|
-
*/
|
|
230
|
-
showSuccess() {
|
|
231
|
-
this.state = 'success';
|
|
232
|
-
process.stdout.write('\x1b[1A\x1b[2K');
|
|
233
|
-
drawStatusLine('success');
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Reset to ready state for next input.
|
|
237
|
-
* Clears old status and draws fresh frame.
|
|
238
|
-
*/
|
|
239
|
-
reset() {
|
|
240
|
-
this.state = 'ready';
|
|
241
|
-
console.log('');
|
|
242
|
-
drawTopBorder();
|
|
243
|
-
process.stdout.write(getPromptString('ready') + '\n');
|
|
244
|
-
drawBottomBorder();
|
|
245
|
-
drawStatusLine('ready');
|
|
246
|
-
// Move up so next ask() starts on the prompt line
|
|
247
|
-
process.stdout.write('\x1b[3A');
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Clean up on exit.
|
|
251
|
-
*/
|
|
252
|
-
destroy() {
|
|
253
|
-
if (this.rl) {
|
|
254
|
-
this.rl.close();
|
|
255
|
-
this.rl = null;
|
|
256
|
-
}
|
|
257
|
-
if (this.resizeHandler) {
|
|
258
|
-
process.stdout.removeListener('resize', this.resizeHandler);
|
|
259
|
-
this.resizeHandler = null;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
141
|
}
|
|
263
142
|
exports.InputBarManager = InputBarManager;
|
|
264
143
|
//# sourceMappingURL=inputbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputbar.js","sourceRoot":"","sources":["../../src/utils/inputbar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"inputbar.js","sourceRoot":"","sources":["../../src/utils/inputbar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,sCAGC;AAED,4CAGC;AAED,wCAuBC;AA1CD,mDAAqC;AACrC,qCAA6D;AAC7D,0CAA2C;AAE3C;;;GAGG;AAEH,SAAgB,aAAa;IAC3B,MAAM,KAAK,GAAG,IAAA,qBAAY,GAAE,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,cAAK,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAgB,gBAAgB;IAC9B,MAAM,KAAK,GAAG,IAAA,qBAAY,GAAE,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,cAAK,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAgB,cAAc,CAAC,IAAwB,EAAE,SAAiB,OAAO;IAC/E,MAAM,KAAK,GAAG,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KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;gBACrD,EAAE,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACvB,CAAC,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/DD,0CA+DC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryManager.d.ts","sourceRoot":"","sources":["../../src/utils/memoryManager.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"memoryManager.d.ts","sourceRoot":"","sources":["../../src/utils/memoryManager.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqD3F;AAeD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1E"}
|
|
@@ -30,12 +30,15 @@ async function getMemoryHierarchy(cwd, currentFile) {
|
|
|
30
30
|
fs_1.default.mkdirSync(GLOBAL_MEMORY_DIR, { recursive: true });
|
|
31
31
|
fs_1.default.writeFileSync(GLOBAL_MEMORY_PATH, '# CoWorker Global Memory\n\n- No global memory saved yet.');
|
|
32
32
|
}
|
|
33
|
-
// 2. Project Memory
|
|
34
|
-
|
|
33
|
+
// 2. Project Memory (coworker.md or .coworker.md)
|
|
34
|
+
let projectMemoryPath = path_1.default.join(cwd, 'coworker.md');
|
|
35
|
+
if (!fs_1.default.existsSync(projectMemoryPath)) {
|
|
36
|
+
projectMemoryPath = path_1.default.join(cwd, '.coworker.md');
|
|
37
|
+
}
|
|
35
38
|
if (fs_1.default.existsSync(projectMemoryPath)) {
|
|
36
39
|
const projectContent = fs_1.default.readFileSync(projectMemoryPath, 'utf8').trim();
|
|
37
40
|
if (projectContent) {
|
|
38
|
-
memory += `### Project
|
|
41
|
+
memory += `### Project Brain (${path_1.default.basename(projectMemoryPath)})\n${projectContent}\n\n`;
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
// 3. Subdirectory Memory (Walk-up from currentFile)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryManager.js","sourceRoot":"","sources":["../../src/utils/memoryManager.ts"],"names":[],"mappings":";;;;;AAUA,
|
|
1
|
+
{"version":3,"file":"memoryManager.js","sourceRoot":"","sources":["../../src/utils/memoryManager.ts"],"names":[],"mappings":";;;;;AAUA,gDAqDC;AAeD,4CAGC;AAKD,kDAIC;AAKD,gDAGC;AAlGD,4CAAoB;AACpB,gDAAwB;AACxB,4CAAoB;AAEpB,MAAM,iBAAiB,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAC/D,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;AAErE;;GAEG;AACI,KAAK,UAAU,kBAAkB,CAAC,GAAW,EAAE,WAAoB;IACxE,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,mBAAmB;IACnB,IAAI,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,YAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACzE,IAAI,aAAa,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AAC;IACzC,MAAM,IAAI,GAAG,OAAO,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;IACxC,YAAE,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,kBAAkB,CAAC,UAAkB;IACzD,MAAM,IAAI,GAAG,OAAO,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;IACxC,YAAE,CAAC,cAAc,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/utils/output.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ═══════════════════════════════════════════════════════════════════
|
|
3
|
-
* CoWorker
|
|
3
|
+
* CoWorker v2.0.5 by Sylix — Premium Output System
|
|
4
4
|
* ═══════════════════════════════════════════════════════════════════
|
|
5
|
-
*
|
|
6
|
-
* Premium terminal rendering with true streaming support.
|
|
7
|
-
* All response text renders inside ╷│╵ borders as it arrives.
|
|
8
5
|
*/
|
|
9
|
-
export declare const CW_VERSION = "2.0.
|
|
6
|
+
export declare const CW_VERSION = "2.0.4";
|
|
7
|
+
export declare const BRAND_SYMBOL = "\u25C6";
|
|
8
|
+
export declare const PROMPT_PREFIX = " you ";
|
|
10
9
|
export declare const theme: {
|
|
11
10
|
brand: (s: string) => string;
|
|
12
11
|
accent: (s: string) => string;
|
|
@@ -25,6 +24,7 @@ export declare function getTermWidth(): number;
|
|
|
25
24
|
export declare function showBanner(version: string, userEmail?: string, model?: string): Promise<void>;
|
|
26
25
|
export declare function showStaticBanner(version: string): void;
|
|
27
26
|
export declare function showSessionInfo(cwd: string, sessionId: string): Promise<void>;
|
|
27
|
+
export declare function printCommitBox(msg: string): void;
|
|
28
28
|
export declare class ThinkingAnimation {
|
|
29
29
|
private interval;
|
|
30
30
|
private frame;
|
|
@@ -33,46 +33,18 @@ export declare class ThinkingAnimation {
|
|
|
33
33
|
start(): void;
|
|
34
34
|
stop(): void;
|
|
35
35
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Manages the response box state during streaming.
|
|
38
|
-
*
|
|
39
|
-
* Correct output:
|
|
40
|
-
* ╷
|
|
41
|
-
* │ Hi! I'm CoWorker, your AI coding assistant.
|
|
42
|
-
* │
|
|
43
|
-
* │ I can help you with:
|
|
44
|
-
* │ · Writing and debugging code
|
|
45
|
-
* │
|
|
46
|
-
* ╵ ✦ 1.2s · 34 tokens
|
|
47
|
-
*
|
|
48
|
-
* Rules:
|
|
49
|
-
* - ALL text inside ╷│╵ border
|
|
50
|
-
* - Border chars (╷ │ ╵) in dim gray #4B5563
|
|
51
|
-
* - Response text in purple #A78BFA
|
|
52
|
-
* - Code blocks switch to yellow #FCD34D
|
|
53
|
-
* - On every \n → print "\n │ "
|
|
54
|
-
*/
|
|
55
36
|
export declare class StreamRenderer {
|
|
56
37
|
private started;
|
|
57
38
|
private inCodeBlock;
|
|
58
39
|
private isThinking;
|
|
59
40
|
private startTime;
|
|
60
41
|
private charCount;
|
|
61
|
-
|
|
42
|
+
private model;
|
|
43
|
+
constructor(model?: string);
|
|
62
44
|
write(chunk: string): Promise<void>;
|
|
63
45
|
private renderText;
|
|
64
|
-
/**
|
|
65
|
-
* Close the response box and print footer.
|
|
66
|
-
*/
|
|
67
46
|
finish(): void;
|
|
68
|
-
/** Returns the estimated token count. */
|
|
69
|
-
getTokenEstimate(): number;
|
|
70
|
-
/** Returns elapsed ms. */
|
|
71
|
-
getElapsed(): number;
|
|
72
47
|
}
|
|
73
|
-
export declare function printResponseHeader(): void;
|
|
74
|
-
export declare function printResponseFooter(elapsed: number, tokenEstimate?: number): void;
|
|
75
|
-
export declare function streamResponseChunk(chunk: string): void;
|
|
76
48
|
export declare function printUserPrompt(input: string): void;
|
|
77
49
|
export declare function printError(title: string, details?: string, hint?: string): void;
|
|
78
50
|
export declare function printSuccess(message: string): void;
|
|
@@ -81,30 +53,19 @@ export declare function printExit(): void;
|
|
|
81
53
|
export declare function printToolStart(toolName: string): void;
|
|
82
54
|
export declare function printToolDone(toolName: string, elapsed: number): void;
|
|
83
55
|
export declare function printToolError(toolName: string, error: string): void;
|
|
56
|
+
export declare function checkWorkspaceTrust(cwd: string): Promise<boolean>;
|
|
84
57
|
export declare function printScoreCard(fileName: string, scores: Array<{
|
|
85
58
|
label: string;
|
|
86
59
|
score: number;
|
|
87
60
|
max?: number;
|
|
88
61
|
}>): void;
|
|
89
|
-
export declare function printCommitBox(commitMessage: string): void;
|
|
90
|
-
export declare function printDiff(fileName: string, changes: Array<{
|
|
91
|
-
type: 'add' | 'remove' | 'context';
|
|
92
|
-
line: string;
|
|
93
|
-
}>): void;
|
|
94
|
-
/**
|
|
95
|
-
* Shows the CoWorker branded workspace trust prompt.
|
|
96
|
-
* Returns true if user trusts, false if they want to exit.
|
|
97
|
-
* Skips silently if the directory is already trusted.
|
|
98
|
-
*/
|
|
99
|
-
export declare function checkWorkspaceTrust(cwd: string): Promise<boolean>;
|
|
100
62
|
export declare function printHelp(): void;
|
|
101
63
|
export declare function printCompact(msgCount: number, tokenEst: number, sessionId: string): void;
|
|
102
64
|
export declare function printBox(label: string, lines: string[]): void;
|
|
65
|
+
export declare function renderMarkdown(text: string): string;
|
|
103
66
|
export declare class Timer {
|
|
104
67
|
private start;
|
|
105
|
-
constructor();
|
|
106
68
|
elapsed(): number;
|
|
107
69
|
formatted(): string;
|
|
108
70
|
}
|
|
109
|
-
export declare function renderMarkdown(text: string): string;
|
|
110
71
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,eAAO,MAAM,UAAU,UAAU,CAAC;AAClC,eAAO,MAAM,YAAY,WAAM,CAAC;AAChC,eAAO,MAA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