codebot-ai 2.1.0 → 2.1.2
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/banner.d.ts +22 -8
- package/dist/banner.js +241 -86
- package/dist/cli.js +17 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +15 -2
- package/package.json +1 -1
package/dist/banner.d.ts
CHANGED
|
@@ -2,18 +2,32 @@
|
|
|
2
2
|
* CodeBot AI mascot and CLI banner.
|
|
3
3
|
*
|
|
4
4
|
* Mascot name: Codi
|
|
5
|
-
* Three designs:
|
|
5
|
+
* Three designs: Core, Terminal, Sentinel
|
|
6
|
+
* See BRANDING.md for full identity guide.
|
|
6
7
|
*/
|
|
7
|
-
export
|
|
8
|
+
export type CodiMood = 'ready' | 'working' | 'success' | 'error' | 'thinking' | 'idle' | 'alert';
|
|
9
|
+
export declare const MASCOT_1 = "\n \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584\n \u2588\u2588 \u2588\u2588\n \u2588\u2588 \u2584\u2588\u2588\u2584 \u2584\u2588\u2588\u2584 \u2588\u2588\n \u2588\u2588 \u2580\u2588\u2588\u2580 \u2580\u2588\u2588\u2580 \u2588\u2588\n \u2588\u2588 \u2588\u2588\n \u2588\u2588 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580 \u2588\u2588\n \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n";
|
|
8
10
|
export declare const BANNER_1: (version: string, model: string, provider: string, session: string, autonomous: boolean) => string;
|
|
9
|
-
export declare const MASCOT_2 = "\n
|
|
11
|
+
export declare const MASCOT_2 = "\n \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n \u2551 \u2551\n \u2551 \u25CF \u25CF \u2551\n \u2551 \u2551\n \u2551 \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F \u2551\n \u2551 \u2551\n \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n";
|
|
10
12
|
export declare const BANNER_2: (version: string, model: string, provider: string, session: string, autonomous: boolean) => string;
|
|
11
|
-
export declare const MASCOT_3 = "\n
|
|
13
|
+
export declare const MASCOT_3 = "\n \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584\n \u2584\u2588\u2580 \u2580\u2588\u2584\n \u2588\u2580 \u2591\u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591\u2591 \u2580\u2588\n \u2588\u2584 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2584\u2588\n \u2580\u2588\u2584 \u2584\u2588\u2580\n \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580\n";
|
|
12
14
|
export declare const BANNER_3: (version: string, model: string, provider: string, session: string, autonomous: boolean) => string;
|
|
13
15
|
export declare const banner: (version: string, model: string, provider: string, session: string, autonomous: boolean) => string;
|
|
14
|
-
export declare
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
export declare const CODI_FACE: Record<CodiMood, string>;
|
|
17
|
+
export declare function randomGreeting(mood?: string): string;
|
|
18
|
+
export interface CodiReaction {
|
|
19
|
+
face: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function codiReact(event: string): CodiReaction;
|
|
23
|
+
export declare function formatReaction(event: string): string;
|
|
24
|
+
export declare function sessionSummaryBanner(stats: {
|
|
25
|
+
iterations: number;
|
|
26
|
+
toolCalls: number;
|
|
27
|
+
tokensUsed: number;
|
|
28
|
+
cost?: number;
|
|
29
|
+
duration?: number;
|
|
30
|
+
}): string;
|
|
18
31
|
export declare function compactBanner(version: string, model: string): string;
|
|
32
|
+
export declare function randomBanner(): typeof BANNER_1;
|
|
19
33
|
//# sourceMappingURL=banner.d.ts.map
|
package/dist/banner.js
CHANGED
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
* CodeBot AI mascot and CLI banner.
|
|
4
4
|
*
|
|
5
5
|
* Mascot name: Codi
|
|
6
|
-
* Three designs:
|
|
6
|
+
* Three designs: Core, Terminal, Sentinel
|
|
7
|
+
* See BRANDING.md for full identity guide.
|
|
7
8
|
*/
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.banner = exports.BANNER_3 = exports.MASCOT_3 = exports.BANNER_2 = exports.MASCOT_2 = exports.BANNER_1 = exports.MASCOT_1 = void 0;
|
|
10
|
+
exports.CODI_FACE = exports.banner = exports.BANNER_3 = exports.MASCOT_3 = exports.BANNER_2 = exports.MASCOT_2 = exports.BANNER_1 = exports.MASCOT_1 = void 0;
|
|
10
11
|
exports.randomGreeting = randomGreeting;
|
|
12
|
+
exports.codiReact = codiReact;
|
|
13
|
+
exports.formatReaction = formatReaction;
|
|
14
|
+
exports.sessionSummaryBanner = sessionSummaryBanner;
|
|
11
15
|
exports.compactBanner = compactBanner;
|
|
16
|
+
exports.randomBanner = randomBanner;
|
|
12
17
|
const C = {
|
|
13
18
|
reset: '\x1b[0m',
|
|
14
19
|
bold: '\x1b[1m',
|
|
@@ -25,124 +30,274 @@ const C = {
|
|
|
25
30
|
brightYellow: '\x1b[93m',
|
|
26
31
|
brightMagenta: '\x1b[95m',
|
|
27
32
|
brightWhite: '\x1b[97m',
|
|
33
|
+
brightRed: '\x1b[91m',
|
|
34
|
+
brightBlue: '\x1b[94m',
|
|
28
35
|
};
|
|
29
|
-
//
|
|
30
|
-
// DESIGN 1: "
|
|
31
|
-
//
|
|
32
|
-
//
|
|
36
|
+
// ─────────────────────────────────────────────────────────────
|
|
37
|
+
// DESIGN 1: "Core" — Solid block-character robot head
|
|
38
|
+
// Double-thick walls. Heavy, industrial, enterprise.
|
|
39
|
+
// ─────────────────────────────────────────────────────────────
|
|
33
40
|
exports.MASCOT_1 = `
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
▀▀████████████▀▀
|
|
41
|
+
▄██████████████████▄
|
|
42
|
+
██ ██
|
|
43
|
+
██ ▄██▄ ▄██▄ ██
|
|
44
|
+
██ ▀██▀ ▀██▀ ██
|
|
45
|
+
██ ██
|
|
46
|
+
██ ▀██████▀ ██
|
|
47
|
+
▀██████████████████▀
|
|
42
48
|
`;
|
|
43
49
|
const BANNER_1 = (version, model, provider, session, autonomous) => {
|
|
50
|
+
const f = C.cyan;
|
|
51
|
+
const e = C.brightGreen;
|
|
52
|
+
const m = C.brightCyan;
|
|
53
|
+
const d = C.dim;
|
|
54
|
+
const r = C.reset;
|
|
44
55
|
const lines = [
|
|
45
56
|
'',
|
|
46
|
-
`${
|
|
47
|
-
`${
|
|
48
|
-
`${
|
|
49
|
-
`${
|
|
50
|
-
`${
|
|
51
|
-
`${
|
|
52
|
-
`${
|
|
53
|
-
|
|
54
|
-
autonomous ? `
|
|
57
|
+
`${f} ▄██████████████████▄${r}`,
|
|
58
|
+
`${f} ██${r} ${f}██${r}`,
|
|
59
|
+
`${f} ██${r} ${e}▄██▄${r} ${e}▄██▄${r} ${f}██${r} ${C.bold}${C.brightCyan}CodeBot AI${r} ${d}v${version}${r}`,
|
|
60
|
+
`${f} ██${r} ${e}▀██▀${r} ${e}▀██▀${r} ${f}██${r} ${d}Think local. Code global.${r}`,
|
|
61
|
+
`${f} ██${r} ${f}██${r}`,
|
|
62
|
+
`${f} ██${r} ${m}▀██████▀${r} ${f}██${r} ${d}Model: ${C.white}${model}${r}`,
|
|
63
|
+
`${f} ▀██████████████████▀${r} ${d}Provider: ${C.white}${provider}${r}`,
|
|
64
|
+
` ${d}Session: ${C.white}${session}${r}`,
|
|
65
|
+
autonomous ? ` ${C.brightYellow}${C.bold}⚡ AUTONOMOUS${r}` : '',
|
|
55
66
|
'',
|
|
56
67
|
];
|
|
57
68
|
return lines.join('\n');
|
|
58
69
|
};
|
|
59
70
|
exports.BANNER_1 = BANNER_1;
|
|
60
|
-
//
|
|
61
|
-
// DESIGN 2: "
|
|
62
|
-
//
|
|
63
|
-
//
|
|
71
|
+
// ─────────────────────────────────────────────────────────────
|
|
72
|
+
// DESIGN 2: "Terminal" — Clean double-line border monitor
|
|
73
|
+
// Formal, corporate. Minimal decoration.
|
|
74
|
+
// ─────────────────────────────────────────────────────────────
|
|
64
75
|
exports.MASCOT_2 = `
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
╔══════════════════════╗
|
|
77
|
+
║ ║
|
|
78
|
+
║ ● ● ║
|
|
79
|
+
║ ║
|
|
80
|
+
║ ╰────────╯ ║
|
|
81
|
+
║ ║
|
|
82
|
+
╚══════════════════════╝
|
|
72
83
|
`;
|
|
73
84
|
const BANNER_2 = (version, model, provider, session, autonomous) => {
|
|
85
|
+
const f = C.cyan;
|
|
86
|
+
const e = C.brightGreen;
|
|
87
|
+
const m = C.brightCyan;
|
|
88
|
+
const d = C.dim;
|
|
89
|
+
const r = C.reset;
|
|
74
90
|
const lines = [
|
|
75
91
|
'',
|
|
76
|
-
`${
|
|
77
|
-
`${
|
|
78
|
-
`${
|
|
79
|
-
`${
|
|
80
|
-
`${
|
|
81
|
-
`${
|
|
82
|
-
`${
|
|
83
|
-
`
|
|
84
|
-
autonomous ? `
|
|
92
|
+
`${f} ╔══════════════════════╗${r}`,
|
|
93
|
+
`${f} ║${r} ${f}║${r}`,
|
|
94
|
+
`${f} ║${r} ${e}●${r} ${e}●${r} ${f}║${r} ${C.bold}${C.brightCyan}CodeBot AI${r} ${d}v${version}${r}`,
|
|
95
|
+
`${f} ║${r} ${f}║${r} ${d}Think local. Code global.${r}`,
|
|
96
|
+
`${f} ║${r} ${m}╰────────╯${r} ${f}║${r}`,
|
|
97
|
+
`${f} ║${r} ${f}║${r} ${d}Model: ${C.white}${model}${r}`,
|
|
98
|
+
`${f} ╚══════════════════════╝${r} ${d}Provider: ${C.white}${provider}${r}`,
|
|
99
|
+
` ${d}Session: ${C.white}${session}${r}`,
|
|
100
|
+
autonomous ? ` ${C.brightYellow}${C.bold}⚡ AUTONOMOUS${r}` : '',
|
|
85
101
|
'',
|
|
86
102
|
];
|
|
87
103
|
return lines.join('\n');
|
|
88
104
|
};
|
|
89
105
|
exports.BANNER_2 = BANNER_2;
|
|
90
|
-
//
|
|
91
|
-
// DESIGN 3: "
|
|
92
|
-
// Sleek
|
|
93
|
-
//
|
|
106
|
+
// ─────────────────────────────────────────────────────────────
|
|
107
|
+
// DESIGN 3: "Sentinel" — Visor helmet with gradient scan bar
|
|
108
|
+
// Sleek armor plating. Diamond silhouette.
|
|
109
|
+
// ─────────────────────────────────────────────────────────────
|
|
94
110
|
exports.MASCOT_3 = `
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
▄████████████▄
|
|
112
|
+
▄█▀ ▀█▄
|
|
113
|
+
█▀ ░░▒▓██████▓▒░░ ▀█
|
|
114
|
+
█▄ ░░░░░░░░░░░░░░ ▄█
|
|
115
|
+
▀█▄ ▄█▀
|
|
116
|
+
▀████████████▀
|
|
101
117
|
`;
|
|
102
118
|
const BANNER_3 = (version, model, provider, session, autonomous) => {
|
|
119
|
+
const f = C.cyan;
|
|
120
|
+
const v = C.brightCyan;
|
|
121
|
+
const g = C.brightGreen;
|
|
122
|
+
const d = C.dim;
|
|
123
|
+
const r = C.reset;
|
|
103
124
|
const lines = [
|
|
104
125
|
'',
|
|
105
|
-
`${
|
|
106
|
-
`${
|
|
107
|
-
`${
|
|
108
|
-
`${
|
|
109
|
-
`${
|
|
110
|
-
`${
|
|
111
|
-
`
|
|
112
|
-
autonomous ? `
|
|
126
|
+
`${f} ▄████████████▄${r}`,
|
|
127
|
+
`${f} ▄█▀${r} ${f}▀█▄${r} ${C.bold}${C.brightCyan}CodeBot AI${r} ${d}v${version}${r}`,
|
|
128
|
+
`${f} █▀${r} ${v}░░▒▓${g}██████${v}▓▒░░${r} ${f}▀█${r} ${d}Think local. Code global.${r}`,
|
|
129
|
+
`${f} █▄${r} ${d}░░░░░░░░░░░░░░${r} ${f}▄█${r}`,
|
|
130
|
+
`${f} ▀█▄${r} ${f}▄█▀${r} ${d}Model: ${C.white}${model}${r}`,
|
|
131
|
+
`${f} ▀████████████▀${r} ${d}Provider: ${C.white}${provider}${r}`,
|
|
132
|
+
` ${d}Session: ${C.white}${session}${r}`,
|
|
133
|
+
autonomous ? ` ${C.brightYellow}${C.bold}⚡ AUTONOMOUS${r}` : '',
|
|
113
134
|
'',
|
|
114
135
|
];
|
|
115
136
|
return lines.join('\n');
|
|
116
137
|
};
|
|
117
138
|
exports.BANNER_3 = BANNER_3;
|
|
118
|
-
//
|
|
119
|
-
// Default banner (Design 1 —
|
|
120
|
-
//
|
|
139
|
+
// ─────────────────────────────────────────────────────────────
|
|
140
|
+
// Default banner (Design 1 — Core)
|
|
141
|
+
// ─────────────────────────────────────────────────────────────
|
|
121
142
|
exports.banner = exports.BANNER_1;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
143
|
+
// ─────────────────────────────────────────────────────────────
|
|
144
|
+
// Inline status indicators
|
|
145
|
+
// ─────────────────────────────────────────────────────────────
|
|
146
|
+
exports.CODI_FACE = {
|
|
147
|
+
ready: `${C.cyan}[${C.brightGreen}◉ ◉${C.cyan}]${C.reset}`,
|
|
148
|
+
working: `${C.cyan}[${C.brightCyan}◎ ◎${C.cyan}]${C.reset}`,
|
|
149
|
+
success: `${C.cyan}[${C.brightGreen}● ●${C.cyan}]${C.reset}`,
|
|
150
|
+
error: `${C.cyan}[${C.brightRed}✕ ✕${C.cyan}]${C.reset}`,
|
|
151
|
+
thinking: `${C.cyan}[${C.brightYellow}◉ ${C.dim}·${C.cyan}]${C.reset}`,
|
|
152
|
+
idle: `${C.cyan}[${C.dim}· ·${C.cyan}]${C.reset}`,
|
|
153
|
+
alert: `${C.cyan}[${C.brightYellow}▲ ▲${C.cyan}]${C.reset}`,
|
|
154
|
+
};
|
|
155
|
+
// ─────────────────────────────────────────────────────────────
|
|
156
|
+
// Greeting System
|
|
157
|
+
// ─────────────────────────────────────────────────────────────
|
|
158
|
+
const GREETINGS_BY_MOOD = {
|
|
159
|
+
confident: [
|
|
160
|
+
"Systems online. Let's ship.",
|
|
161
|
+
"All circuits green. Ready to code.",
|
|
162
|
+
"No cloud. No limits. Let's go.",
|
|
163
|
+
"Standing by. Say the word.",
|
|
164
|
+
"Initialized. Awaiting instructions.",
|
|
165
|
+
"Signal locked. Ready to transmit.",
|
|
166
|
+
"Provider connected. Model hot. Let's go.",
|
|
167
|
+
],
|
|
168
|
+
playful: [
|
|
169
|
+
"What are we building today?",
|
|
170
|
+
"I read your codebase. We need to talk.",
|
|
171
|
+
"Your code, your machine, your move.",
|
|
172
|
+
"Another day, another deploy.",
|
|
173
|
+
"Booted up. Zero dependencies loaded.",
|
|
174
|
+
"Local power, global ambitions.",
|
|
175
|
+
"Scanned your repo. I have thoughts.",
|
|
176
|
+
],
|
|
177
|
+
security: [
|
|
178
|
+
"Eight security layers active. You're safe.",
|
|
179
|
+
"Hash chain intact. Trust verified.",
|
|
180
|
+
"Sandbox locked. Creativity unlocked.",
|
|
181
|
+
"Audit trail recording. Every move counts.",
|
|
182
|
+
"Policy loaded. Rules are rules.",
|
|
183
|
+
"Risk score: 0. Let's keep it that way.",
|
|
184
|
+
],
|
|
185
|
+
resuming: [
|
|
186
|
+
"Memory loaded. I remember everything.",
|
|
187
|
+
"Picking up where we left off.",
|
|
188
|
+
"Context restored. Continuity maintained.",
|
|
189
|
+
"Back online. Nothing lost.",
|
|
190
|
+
"Session recovered. Let's continue.",
|
|
191
|
+
],
|
|
192
|
+
};
|
|
193
|
+
const ALL_GREETINGS = Object.values(GREETINGS_BY_MOOD).flat();
|
|
194
|
+
function randomGreeting(mood) {
|
|
195
|
+
const pool = mood && GREETINGS_BY_MOOD[mood]
|
|
196
|
+
? GREETINGS_BY_MOOD[mood]
|
|
197
|
+
: ALL_GREETINGS;
|
|
198
|
+
return pool[Math.floor(Math.random() * pool.length)];
|
|
199
|
+
}
|
|
200
|
+
const REACTIONS = {
|
|
201
|
+
tool_success: [
|
|
202
|
+
"Done.",
|
|
203
|
+
"Clean.",
|
|
204
|
+
"Handled.",
|
|
205
|
+
"Next?",
|
|
206
|
+
"Complete.",
|
|
207
|
+
],
|
|
208
|
+
tool_error: [
|
|
209
|
+
"That broke. Fixing.",
|
|
210
|
+
"Error caught. Adjusting.",
|
|
211
|
+
"Not ideal. Recovering.",
|
|
212
|
+
"Blocked. Finding another way.",
|
|
213
|
+
"Retrying with different approach.",
|
|
214
|
+
],
|
|
215
|
+
security_block: [
|
|
216
|
+
"Blocked. Policy violation.",
|
|
217
|
+
"Access denied. Security boundary hit.",
|
|
218
|
+
"Risk threshold exceeded. Skipping.",
|
|
219
|
+
"Denied. Policy enforced.",
|
|
220
|
+
"Path restricted. Cannot proceed.",
|
|
221
|
+
],
|
|
222
|
+
session_end: [
|
|
223
|
+
"Session complete. Audit trail sealed.",
|
|
224
|
+
"Signing off. All changes persisted.",
|
|
225
|
+
"Done. Metrics saved.",
|
|
226
|
+
"Session closed. Everything committed.",
|
|
227
|
+
"Shutting down cleanly.",
|
|
228
|
+
],
|
|
229
|
+
thinking: [
|
|
230
|
+
"Analyzing...",
|
|
231
|
+
"Processing...",
|
|
232
|
+
"Evaluating options...",
|
|
233
|
+
"Computing...",
|
|
234
|
+
"Working through it...",
|
|
235
|
+
],
|
|
236
|
+
cost_warning: [
|
|
237
|
+
"Token usage elevated.",
|
|
238
|
+
"Cost accumulating. Monitor budget.",
|
|
239
|
+
"High token throughput detected.",
|
|
240
|
+
"Budget advisory: cost climbing.",
|
|
241
|
+
],
|
|
242
|
+
autonomous_start: [
|
|
243
|
+
"Autonomous mode engaged.",
|
|
244
|
+
"Full automation active. No prompts.",
|
|
245
|
+
"Auto-pilot initialized.",
|
|
246
|
+
"Running unattended. All tools approved.",
|
|
247
|
+
"Autonomous. Maximum throughput.",
|
|
248
|
+
],
|
|
249
|
+
};
|
|
250
|
+
function codiReact(event) {
|
|
251
|
+
let mood = 'ready';
|
|
252
|
+
if (event === 'tool_success' || event === 'session_end')
|
|
253
|
+
mood = 'success';
|
|
254
|
+
else if (event === 'tool_error')
|
|
255
|
+
mood = 'error';
|
|
256
|
+
else if (event === 'security_block')
|
|
257
|
+
mood = 'alert';
|
|
258
|
+
else if (event === 'thinking')
|
|
259
|
+
mood = 'thinking';
|
|
260
|
+
else if (event === 'cost_warning')
|
|
261
|
+
mood = 'alert';
|
|
262
|
+
else if (event === 'autonomous_start')
|
|
263
|
+
mood = 'working';
|
|
264
|
+
const messages = REACTIONS[event] || REACTIONS.tool_success;
|
|
265
|
+
const message = messages[Math.floor(Math.random() * messages.length)];
|
|
266
|
+
return { face: exports.CODI_FACE[mood], message };
|
|
267
|
+
}
|
|
268
|
+
function formatReaction(event) {
|
|
269
|
+
const reaction = codiReact(event);
|
|
270
|
+
return ` ${reaction.face} ${C.dim}${reaction.message}${C.reset}`;
|
|
271
|
+
}
|
|
272
|
+
// ─────────────────────────────────────────────────────────────
|
|
273
|
+
// Session Summary Banner
|
|
274
|
+
// ─────────────────────────────────────────────────────────────
|
|
275
|
+
function sessionSummaryBanner(stats) {
|
|
276
|
+
const durationStr = stats.duration !== undefined
|
|
277
|
+
? `${Math.floor(stats.duration / 60)}m ${Math.round(stats.duration % 60)}s`
|
|
278
|
+
: 'N/A';
|
|
279
|
+
const costStr = stats.cost !== undefined ? `$${stats.cost.toFixed(4)}` : 'N/A';
|
|
280
|
+
const lines = [
|
|
281
|
+
'',
|
|
282
|
+
`${C.dim}${'─'.repeat(50)}${C.reset}`,
|
|
283
|
+
`${exports.CODI_FACE.success} ${C.bold}${C.brightCyan}Session Complete${C.reset}`,
|
|
284
|
+
`${C.dim}${'─'.repeat(50)}${C.reset}`,
|
|
285
|
+
` ${C.dim}Iterations:${C.reset} ${stats.iterations}`,
|
|
286
|
+
` ${C.dim}Tool calls:${C.reset} ${stats.toolCalls}`,
|
|
287
|
+
` ${C.dim}Tokens:${C.reset} ${stats.tokensUsed.toLocaleString()}`,
|
|
288
|
+
` ${C.dim}Cost:${C.reset} ${costStr}`,
|
|
289
|
+
` ${C.dim}Duration:${C.reset} ${durationStr}`,
|
|
290
|
+
`${C.dim}${'─'.repeat(50)}${C.reset}`,
|
|
291
|
+
` ${C.dim}${randomGreeting('confident')}${C.reset}`,
|
|
292
|
+
'',
|
|
293
|
+
];
|
|
294
|
+
return lines.join('\n');
|
|
141
295
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Compact single-line startup for non-TTY / piped usage.
|
|
144
|
-
*/
|
|
145
296
|
function compactBanner(version, model) {
|
|
146
297
|
return `${C.bold}${C.brightCyan}CodeBot AI${C.reset} ${C.dim}v${version}${C.reset} ${C.dim}[${model}]${C.reset}`;
|
|
147
298
|
}
|
|
299
|
+
function randomBanner() {
|
|
300
|
+
const banners = [exports.BANNER_1, exports.BANNER_2, exports.BANNER_3];
|
|
301
|
+
return banners[Math.floor(Math.random() * banners.length)];
|
|
302
|
+
}
|
|
148
303
|
//# sourceMappingURL=banner.js.map
|
package/dist/cli.js
CHANGED
|
@@ -52,7 +52,7 @@ const sandbox_1 = require("./sandbox");
|
|
|
52
52
|
const replay_1 = require("./replay");
|
|
53
53
|
const risk_1 = require("./risk");
|
|
54
54
|
const sarif_1 = require("./sarif");
|
|
55
|
-
const VERSION = '2.
|
|
55
|
+
const VERSION = '2.1.2';
|
|
56
56
|
const C = {
|
|
57
57
|
reset: '\x1b[0m',
|
|
58
58
|
bold: '\x1b[1m',
|
|
@@ -272,9 +272,15 @@ async function main() {
|
|
|
272
272
|
const sessionShort = session.getId().substring(0, 8);
|
|
273
273
|
console.log((0, banner_1.banner)(VERSION, config.model, `${config.provider} @ ${config.baseUrl}`, `${sessionShort}...`, !!config.autoApprove));
|
|
274
274
|
if (resumeId) {
|
|
275
|
-
console.log(c(`
|
|
275
|
+
console.log(c(` ${(0, banner_1.randomGreeting)('resuming')}`, 'green'));
|
|
276
|
+
}
|
|
277
|
+
else if (config.autoApprove) {
|
|
278
|
+
console.log(c(` ${(0, banner_1.randomGreeting)('confident')}`, 'dim'));
|
|
279
|
+
console.log((0, banner_1.formatReaction)('autonomous_start'));
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
console.log(c(` ${(0, banner_1.randomGreeting)()}\n`, 'dim'));
|
|
276
283
|
}
|
|
277
|
-
console.log(c(` ${(0, banner_1.randomGreeting)()}\n`, 'dim'));
|
|
278
284
|
const agent = new agent_1.Agent({
|
|
279
285
|
provider,
|
|
280
286
|
model: config.model,
|
|
@@ -347,6 +353,13 @@ function printSessionSummary(agent) {
|
|
|
347
353
|
if (riskScorer.getHistory().length > 0) {
|
|
348
354
|
console.log(` Risk: avg ${riskAvg}/100`);
|
|
349
355
|
}
|
|
356
|
+
// Codi's session summary banner
|
|
357
|
+
console.log((0, banner_1.sessionSummaryBanner)({
|
|
358
|
+
iterations: summary.requestCount,
|
|
359
|
+
toolCalls: summary.toolCalls,
|
|
360
|
+
tokensUsed: summary.totalInputTokens + summary.totalOutputTokens,
|
|
361
|
+
duration,
|
|
362
|
+
}));
|
|
350
363
|
// Save metrics
|
|
351
364
|
metrics.save();
|
|
352
365
|
metrics.exportOtel();
|
|
@@ -397,7 +410,7 @@ async function repl(agent, config, session) {
|
|
|
397
410
|
});
|
|
398
411
|
rl.on('close', () => {
|
|
399
412
|
printSessionSummary(agent);
|
|
400
|
-
console.log(
|
|
413
|
+
console.log((0, banner_1.formatReaction)('session_end'));
|
|
401
414
|
process.exit(0);
|
|
402
415
|
});
|
|
403
416
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "2.1.
|
|
1
|
+
export declare const VERSION = "2.1.2";
|
|
2
2
|
export { Agent } from './agent';
|
|
3
3
|
export { OpenAIProvider } from './providers/openai';
|
|
4
4
|
export { AnthropicProvider } from './providers/anthropic';
|
|
@@ -28,5 +28,7 @@ export { PolicyEnforcer, loadPolicy, generateDefaultPolicyFile } from './policy'
|
|
|
28
28
|
export type { Policy, PolicyRbac, PolicyRole } from './policy';
|
|
29
29
|
export { encrypt, decrypt, encryptLine, decryptLine, encryptContent, decryptContent, isEncryptionEnabled, deriveKey, getPassphrase } from './encryption';
|
|
30
30
|
export type { EncryptionConfig } from './encryption';
|
|
31
|
+
export { banner, randomGreeting, compactBanner, formatReaction, codiReact, sessionSummaryBanner, randomBanner, CODI_FACE, BANNER_1, BANNER_2, BANNER_3 } from './banner';
|
|
32
|
+
export type { CodiMood, CodiReaction } from './banner';
|
|
31
33
|
export * from './types';
|
|
32
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.getPassphrase = exports.deriveKey = exports.isEncryptionEnabled = exports.decryptContent = exports.encryptContent = exports.decryptLine = exports.encryptLine = exports.decrypt = exports.encrypt = exports.generateDefaultPolicyFile = exports.loadPolicy = exports.PolicyEnforcer = exports.sarifToString = exports.exportSarif = exports.RiskScorer = exports.MetricsCollector = exports.listReplayableSessions = exports.compareOutputs = exports.loadSessionForReplay = exports.ReplayProvider = exports.verifyMessages = exports.verifyMessage = exports.signMessage = exports.deriveSessionKey = exports.CapabilityChecker = exports.detectProvider = exports.getModelInfo = exports.PROVIDER_DEFAULTS = exports.MODEL_REGISTRY = exports.loadMCPTools = exports.loadPlugins = exports.parseToolCalls = exports.MemoryManager = exports.SessionManager = exports.buildRepoMap = exports.ContextManager = exports.ToolRegistry = exports.AnthropicProvider = exports.OpenAIProvider = exports.Agent = exports.VERSION = void 0;
|
|
18
|
-
exports.
|
|
17
|
+
exports.BANNER_1 = exports.CODI_FACE = exports.randomBanner = exports.sessionSummaryBanner = exports.codiReact = exports.formatReaction = exports.compactBanner = exports.randomGreeting = exports.banner = exports.getPassphrase = exports.deriveKey = exports.isEncryptionEnabled = exports.decryptContent = exports.encryptContent = exports.decryptLine = exports.encryptLine = exports.decrypt = exports.encrypt = exports.generateDefaultPolicyFile = exports.loadPolicy = exports.PolicyEnforcer = exports.sarifToString = exports.exportSarif = exports.RiskScorer = exports.MetricsCollector = exports.listReplayableSessions = exports.compareOutputs = exports.loadSessionForReplay = exports.ReplayProvider = exports.verifyMessages = exports.verifyMessage = exports.signMessage = exports.deriveSessionKey = exports.CapabilityChecker = exports.detectProvider = exports.getModelInfo = exports.PROVIDER_DEFAULTS = exports.MODEL_REGISTRY = exports.loadMCPTools = exports.loadPlugins = exports.parseToolCalls = exports.MemoryManager = exports.SessionManager = exports.buildRepoMap = exports.ContextManager = exports.ToolRegistry = exports.AnthropicProvider = exports.OpenAIProvider = exports.Agent = exports.VERSION = void 0;
|
|
18
|
+
exports.BANNER_3 = exports.BANNER_2 = void 0;
|
|
19
|
+
exports.VERSION = '2.1.2';
|
|
19
20
|
var agent_1 = require("./agent");
|
|
20
21
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
|
|
21
22
|
var openai_1 = require("./providers/openai");
|
|
@@ -76,5 +77,17 @@ Object.defineProperty(exports, "decryptContent", { enumerable: true, get: functi
|
|
|
76
77
|
Object.defineProperty(exports, "isEncryptionEnabled", { enumerable: true, get: function () { return encryption_1.isEncryptionEnabled; } });
|
|
77
78
|
Object.defineProperty(exports, "deriveKey", { enumerable: true, get: function () { return encryption_1.deriveKey; } });
|
|
78
79
|
Object.defineProperty(exports, "getPassphrase", { enumerable: true, get: function () { return encryption_1.getPassphrase; } });
|
|
80
|
+
var banner_1 = require("./banner");
|
|
81
|
+
Object.defineProperty(exports, "banner", { enumerable: true, get: function () { return banner_1.banner; } });
|
|
82
|
+
Object.defineProperty(exports, "randomGreeting", { enumerable: true, get: function () { return banner_1.randomGreeting; } });
|
|
83
|
+
Object.defineProperty(exports, "compactBanner", { enumerable: true, get: function () { return banner_1.compactBanner; } });
|
|
84
|
+
Object.defineProperty(exports, "formatReaction", { enumerable: true, get: function () { return banner_1.formatReaction; } });
|
|
85
|
+
Object.defineProperty(exports, "codiReact", { enumerable: true, get: function () { return banner_1.codiReact; } });
|
|
86
|
+
Object.defineProperty(exports, "sessionSummaryBanner", { enumerable: true, get: function () { return banner_1.sessionSummaryBanner; } });
|
|
87
|
+
Object.defineProperty(exports, "randomBanner", { enumerable: true, get: function () { return banner_1.randomBanner; } });
|
|
88
|
+
Object.defineProperty(exports, "CODI_FACE", { enumerable: true, get: function () { return banner_1.CODI_FACE; } });
|
|
89
|
+
Object.defineProperty(exports, "BANNER_1", { enumerable: true, get: function () { return banner_1.BANNER_1; } });
|
|
90
|
+
Object.defineProperty(exports, "BANNER_2", { enumerable: true, get: function () { return banner_1.BANNER_2; } });
|
|
91
|
+
Object.defineProperty(exports, "BANNER_3", { enumerable: true, get: function () { return banner_1.BANNER_3; } });
|
|
79
92
|
__exportStar(require("./types"), exports);
|
|
80
93
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebot-ai",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Zero-dependency autonomous AI agent. Code, browse, search, automate. Works with any LLM — Ollama, Claude, GPT, Gemini, DeepSeek, Groq, Mistral, Grok.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|