@trikhub/cli 0.17.1-dev.2 → 0.18.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/dist/templates/agent-python.d.ts.map +1 -1
- package/dist/templates/agent-python.js +125 -22
- package/dist/templates/agent-python.js.map +1 -1
- package/dist/templates/agent-typescript.d.ts.map +1 -1
- package/dist/templates/agent-typescript.js +141 -30
- package/dist/templates/agent-typescript.js.map +1 -1
- package/package.json +12 -12
- package/dist/lib/validator.d.ts +0 -13
- package/dist/lib/validator.d.ts.map +0 -1
- package/dist/lib/validator.js +0 -12
- package/dist/lib/validator.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-python.d.ts","sourceRoot":"","sources":["../../src/templates/agent-python.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-python.d.ts","sourceRoot":"","sources":["../../src/templates/agent-python.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAmf/D;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB5F"}
|
|
@@ -47,7 +47,8 @@ dependencies = [
|
|
|
47
47
|
"langchain-core>=0.3.0",
|
|
48
48
|
"langgraph>=0.2.0",
|
|
49
49
|
"trikhub>=0.6.0",
|
|
50
|
-
"python-dotenv>=1.0.0"
|
|
50
|
+
"python-dotenv>=1.0.0",
|
|
51
|
+
"rich>=13.0.0",${config.channels === 'cli+telegram' ? `\n "python-telegram-bot>=21.0",` : ''}
|
|
51
52
|
]
|
|
52
53
|
`;
|
|
53
54
|
}
|
|
@@ -125,6 +126,7 @@ function generateCliPy() {
|
|
|
125
126
|
from __future__ import annotations
|
|
126
127
|
|
|
127
128
|
import asyncio
|
|
129
|
+
import sys
|
|
128
130
|
|
|
129
131
|
from dotenv import load_dotenv
|
|
130
132
|
|
|
@@ -132,30 +134,121 @@ load_dotenv()
|
|
|
132
134
|
|
|
133
135
|
from agent import initialize_agent
|
|
134
136
|
|
|
137
|
+
pretty = "--no-pretty" not in sys.argv
|
|
138
|
+
|
|
139
|
+
if pretty:
|
|
140
|
+
from rich.console import Console
|
|
141
|
+
from rich.markdown import Markdown
|
|
142
|
+
from rich.theme import Theme
|
|
143
|
+
|
|
144
|
+
theme = Theme({"trik.name": "bold magenta", "trik.system": "dim italic", "trik.error": "bold red"})
|
|
145
|
+
console = Console(theme=theme)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def render_response(result) -> None:
|
|
149
|
+
if not pretty:
|
|
150
|
+
if result.source == "system":
|
|
151
|
+
print(f"\\n\\033[2m{result.message}\\033[0m\\n")
|
|
152
|
+
elif result.source != "main":
|
|
153
|
+
print(f"\\n[{result.source}] {result.message}\\n")
|
|
154
|
+
else:
|
|
155
|
+
print(f"\\nAssistant: {result.message}\\n")
|
|
156
|
+
return
|
|
157
|
+
|
|
158
|
+
if result.source == "system":
|
|
159
|
+
console.print(f" [trik.system]{result.message}[/]")
|
|
160
|
+
elif result.source != "main":
|
|
161
|
+
console.print(f"\\n [trik.name]{result.source}[/]\\n")
|
|
162
|
+
md = Markdown(result.message, code_theme="monokai")
|
|
163
|
+
console.print(md, width=min(console.width, 100))
|
|
164
|
+
console.print()
|
|
165
|
+
else:
|
|
166
|
+
console.print()
|
|
167
|
+
md = Markdown(result.message, code_theme="monokai")
|
|
168
|
+
console.print(md, width=min(console.width, 100))
|
|
169
|
+
console.print()
|
|
170
|
+
|
|
135
171
|
|
|
136
172
|
async def main() -> None:
|
|
137
|
-
|
|
173
|
+
if pretty:
|
|
174
|
+
with console.status("Loading agent..."):
|
|
175
|
+
app = await initialize_agent()
|
|
176
|
+
else:
|
|
177
|
+
print("Loading agent...\\n")
|
|
178
|
+
app = await initialize_agent()
|
|
138
179
|
|
|
139
|
-
|
|
180
|
+
status = None
|
|
140
181
|
|
|
141
182
|
# Subscribe to gateway events for real-time status feedback
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
183
|
+
def on_start(e):
|
|
184
|
+
nonlocal status
|
|
185
|
+
if pretty:
|
|
186
|
+
status = console.status(f" Connecting to {e['trikName']}...")
|
|
187
|
+
status.start()
|
|
188
|
+
else:
|
|
189
|
+
print(f"[{e['trikName']}] Connecting...")
|
|
190
|
+
|
|
191
|
+
def on_container(e):
|
|
192
|
+
nonlocal status
|
|
193
|
+
if pretty and status:
|
|
194
|
+
status.update(f" Starting {e['trikName']} container...")
|
|
195
|
+
elif not pretty:
|
|
196
|
+
print(f"[{e['trikName']}] Starting container...")
|
|
197
|
+
|
|
198
|
+
def on_thinking(e):
|
|
199
|
+
nonlocal status
|
|
200
|
+
if pretty and status:
|
|
201
|
+
status.update(f" {e['trikName']} is thinking...")
|
|
202
|
+
elif not pretty:
|
|
203
|
+
print(f"[{e['trikName']}] Thinking...")
|
|
204
|
+
|
|
205
|
+
def on_error(e):
|
|
206
|
+
nonlocal status
|
|
207
|
+
if status:
|
|
208
|
+
status.stop()
|
|
209
|
+
status = None
|
|
210
|
+
if pretty:
|
|
211
|
+
console.print(f" [trik.error]\\u2716 [{e['trikName']}] {e['error']}[/]")
|
|
212
|
+
else:
|
|
213
|
+
print(f"[{e['trikName']}] Error: {e['error']}")
|
|
214
|
+
|
|
215
|
+
def on_transfer_back(e):
|
|
216
|
+
nonlocal status
|
|
217
|
+
if status:
|
|
218
|
+
status.stop()
|
|
219
|
+
status = None
|
|
220
|
+
if pretty:
|
|
221
|
+
console.print(f" [dim]\\u2190 {e['trikName']} transferred back ({e['reason']})[/]")
|
|
222
|
+
else:
|
|
223
|
+
print(f"[{e['trikName']}] Transferred back ({e['reason']})")
|
|
224
|
+
|
|
225
|
+
app.gateway.on("handoff:start", on_start)
|
|
226
|
+
app.gateway.on("handoff:container_start", on_container)
|
|
227
|
+
app.gateway.on("handoff:thinking", on_thinking)
|
|
228
|
+
app.gateway.on("handoff:error", on_error)
|
|
229
|
+
app.gateway.on("handoff:transfer_back", on_transfer_back)
|
|
147
230
|
|
|
148
231
|
loaded_triks = app.get_loaded_triks()
|
|
149
232
|
if loaded_triks:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
233
|
+
if pretty:
|
|
234
|
+
names = ", ".join(f"[cyan]{t}[/]" for t in loaded_triks)
|
|
235
|
+
console.print(f" [dim]Loaded triks:[/] {names}")
|
|
236
|
+
else:
|
|
237
|
+
print(f"Loaded triks: {', '.join(loaded_triks)}")
|
|
238
|
+
if pretty:
|
|
239
|
+
console.print(" [dim]Type /back to return from a trik, exit to quit.[/]\\n")
|
|
240
|
+
else:
|
|
241
|
+
print('Type "/back" to return from a trik handoff, "exit" to quit.')
|
|
242
|
+
print('Tip: Ask the Agent what to do next\\n')
|
|
153
243
|
|
|
154
244
|
session_id = f"cli-{id(app)}"
|
|
155
245
|
|
|
156
246
|
while True:
|
|
157
247
|
try:
|
|
158
|
-
|
|
248
|
+
if pretty:
|
|
249
|
+
user_input = console.input("[bold green]You:[/] ").strip()
|
|
250
|
+
else:
|
|
251
|
+
user_input = input("You: ").strip()
|
|
159
252
|
except (KeyboardInterrupt, EOFError):
|
|
160
253
|
print("\\n\\nGoodbye!")
|
|
161
254
|
break
|
|
@@ -163,21 +256,31 @@ async def main() -> None:
|
|
|
163
256
|
if not user_input:
|
|
164
257
|
continue
|
|
165
258
|
if user_input.lower() in ("exit", "quit"):
|
|
166
|
-
|
|
259
|
+
if pretty:
|
|
260
|
+
console.print("\\n [dim]Goodbye![/]\\n")
|
|
261
|
+
else:
|
|
262
|
+
print("\\nGoodbye!")
|
|
167
263
|
break
|
|
168
264
|
|
|
169
265
|
try:
|
|
266
|
+
if status:
|
|
267
|
+
status.stop()
|
|
268
|
+
status = None
|
|
170
269
|
result = await app.process_message(user_input, session_id)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
print(f"\\n[{result.source}] {result.message}\\n")
|
|
176
|
-
else:
|
|
177
|
-
print(f"\\nAssistant: {result.message}\\n")
|
|
270
|
+
if status:
|
|
271
|
+
status.stop()
|
|
272
|
+
status = None
|
|
273
|
+
render_response(result)
|
|
178
274
|
except Exception as e:
|
|
179
|
-
|
|
180
|
-
|
|
275
|
+
if status:
|
|
276
|
+
status.stop()
|
|
277
|
+
status = None
|
|
278
|
+
if pretty:
|
|
279
|
+
console.print(f" [trik.error]Error: {e}[/]")
|
|
280
|
+
console.print(" [dim]Please try again.[/]\\n")
|
|
281
|
+
else:
|
|
282
|
+
print(f"\\nError: {e}")
|
|
283
|
+
print("Please try again.\\n")
|
|
181
284
|
|
|
182
285
|
|
|
183
286
|
if __name__ == "__main__":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-python.js","sourceRoot":"","sources":["../../src/templates/agent-python.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,MAAM,SAAS,GAAiC;IAC9C,MAAM,EAAE;QACN,UAAU,EAAE,kBAAkB;QAC9B,SAAS,EAAE,YAAY;QACvB,UAAU,EAAE,kBAAkB;QAC9B,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE,gBAAgB;KACzB;IACD,SAAS,EAAE;QACT,UAAU,EAAE,qBAAqB;QACjC,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,qBAAqB;QACjC,YAAY,EAAE,0BAA0B;QACxC,MAAM,EAAE,mBAAmB;KAC5B;IACD,MAAM,EAAE;QACN,UAAU,EAAE,wBAAwB;QACpC,SAAS,EAAE,wBAAwB;QACnC,UAAU,EAAE,wBAAwB;QACpC,YAAY,EAAE,kBAAkB;QAChC,MAAM,EAAE,gBAAgB;KACzB;CACF,CAAC;AAEF,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;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AAQ,CAAC,GAAG,aAAa,EAAE,CAAC;IAElC,IAAI,MAAM,CAAC,QAAQ,KAAK,cAAc,EAAE,CAAC;QACvC,KAAK,CAAC,iBAAiB,CAAC,GAAG,kBAAkB,EAAE,CAAC;IAClD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-typescript.d.ts","sourceRoot":"","sources":["../../src/templates/agent-typescript.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;CACnC;
|
|
1
|
+
{"version":3,"file":"agent-typescript.d.ts","sourceRoot":"","sources":["../../src/templates/agent-typescript.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;CACnC;AAmhBD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBhG"}
|
|
@@ -47,6 +47,10 @@ function generatePackageJson(config) {
|
|
|
47
47
|
'@langchain/langgraph': '^1.0.0',
|
|
48
48
|
'@trikhub/gateway': 'latest',
|
|
49
49
|
dotenv: '^16.4.0',
|
|
50
|
+
marked: '^15.0.0',
|
|
51
|
+
chalk: '^5.3.0',
|
|
52
|
+
ora: '^8.0.1',
|
|
53
|
+
'cli-highlight': '^2.1.11',
|
|
50
54
|
};
|
|
51
55
|
if (hasTelegram) {
|
|
52
56
|
dependencies.grammy = '^1.0.0';
|
|
@@ -148,71 +152,178 @@ export async function initializeAgent() {
|
|
|
148
152
|
function generateCliTs() {
|
|
149
153
|
return `import 'dotenv/config';
|
|
150
154
|
import * as readline from 'readline';
|
|
155
|
+
import chalk from 'chalk';
|
|
156
|
+
import ora from 'ora';
|
|
157
|
+
import { Marked } from 'marked';
|
|
158
|
+
import { highlight } from 'cli-highlight';
|
|
151
159
|
import { initializeAgent } from './agent.js';
|
|
152
160
|
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
const pretty = !process.argv.includes('--no-pretty');
|
|
162
|
+
|
|
163
|
+
const marked = new Marked();
|
|
164
|
+
if (pretty) {
|
|
165
|
+
marked.use({
|
|
166
|
+
renderer: {
|
|
167
|
+
code({ text, lang }: { text: string; lang?: string }) {
|
|
168
|
+
try { return '\\n' + highlight(text, { language: lang || undefined, ignoreIllegals: true }) + '\\n'; }
|
|
169
|
+
catch { return '\\n' + chalk.gray(text) + '\\n'; }
|
|
170
|
+
},
|
|
171
|
+
heading({ tokens, depth }: any) {
|
|
172
|
+
const text = this.parser.parseInline(tokens);
|
|
173
|
+
const prefix = depth <= 2 ? chalk.bold.cyan : chalk.bold;
|
|
174
|
+
return '\\n' + prefix(text) + '\\n';
|
|
175
|
+
},
|
|
176
|
+
list({ items, ordered }: any) {
|
|
177
|
+
return items.map((item: any, i: number) => {
|
|
178
|
+
const text = this.parser.parse(item.tokens).trim();
|
|
179
|
+
const bullet = ordered ? chalk.dim((i + 1) + '.') : chalk.dim('\\u2022');
|
|
180
|
+
return ' ' + bullet + ' ' + text;
|
|
181
|
+
}).join('\\n') + '\\n';
|
|
182
|
+
},
|
|
183
|
+
paragraph({ tokens }: any) {
|
|
184
|
+
return this.parser.parseInline(tokens) + '\\n';
|
|
185
|
+
},
|
|
186
|
+
strong({ tokens }: any) {
|
|
187
|
+
return chalk.bold(this.parser.parseInline(tokens));
|
|
188
|
+
},
|
|
189
|
+
em({ tokens }: any) {
|
|
190
|
+
return chalk.italic(this.parser.parseInline(tokens));
|
|
191
|
+
},
|
|
192
|
+
codespan({ text }: { text: string }) {
|
|
193
|
+
return chalk.cyan(text);
|
|
194
|
+
},
|
|
195
|
+
link({ href, tokens }: any) {
|
|
196
|
+
const text = this.parser.parseInline(tokens);
|
|
197
|
+
return text + chalk.dim(' (' + href + ')');
|
|
198
|
+
},
|
|
199
|
+
hr() {
|
|
200
|
+
return chalk.dim('\\u2500'.repeat(Math.min(process.stdout.columns || 80, 60))) + '\\n';
|
|
201
|
+
},
|
|
202
|
+
},
|
|
161
203
|
});
|
|
162
204
|
}
|
|
163
205
|
|
|
206
|
+
function unescape(text: string): string {
|
|
207
|
+
return text
|
|
208
|
+
.replace(/&/g, '&')
|
|
209
|
+
.replace(/</g, '<')
|
|
210
|
+
.replace(/>/g, '>')
|
|
211
|
+
.replace(/"/g, '"')
|
|
212
|
+
.replace(/'/g, "'");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function render(text: string): string {
|
|
216
|
+
if (!pretty) return text;
|
|
217
|
+
return unescape((marked.parse(text) as string).trimEnd());
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function renderResponse(result: { source: string; message: string }): void {
|
|
221
|
+
if (result.source === 'system') {
|
|
222
|
+
console.log('\\n ' + chalk.dim.italic(result.message) + '\\n');
|
|
223
|
+
} else if (result.source !== 'main') {
|
|
224
|
+
console.log('\\n ' + chalk.bold.magenta(result.source) + '\\n');
|
|
225
|
+
const rendered = render(result.message);
|
|
226
|
+
const indented = rendered.split('\\n').map((l: string) => ' ' + l).join('\\n');
|
|
227
|
+
console.log(indented + '\\n');
|
|
228
|
+
} else {
|
|
229
|
+
const rendered = render(result.message);
|
|
230
|
+
const indented = rendered.split('\\n').map((l: string) => ' ' + l).join('\\n');
|
|
231
|
+
console.log('\\n' + indented + '\\n');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
164
235
|
async function main() {
|
|
165
|
-
|
|
236
|
+
const loadingSpinner = pretty ? ora('Loading agent...').start() : null;
|
|
237
|
+
if (!pretty) console.log('Loading agent...\\n');
|
|
166
238
|
|
|
167
239
|
const app = await initializeAgent();
|
|
168
240
|
|
|
169
|
-
|
|
241
|
+
if (loadingSpinner) loadingSpinner.stop();
|
|
242
|
+
|
|
243
|
+
const rl = readline.createInterface({
|
|
244
|
+
input: process.stdin,
|
|
245
|
+
output: process.stdout,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
function prompt(question: string): Promise<string> {
|
|
249
|
+
return new Promise((resolve) => {
|
|
250
|
+
rl.question(question, resolve);
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
let spinner: ReturnType<typeof ora> | null = null;
|
|
255
|
+
|
|
256
|
+
// Subscribe to gateway events
|
|
170
257
|
app.gateway.on('handoff:start', ({ trikName }: { trikName: string }) => {
|
|
171
|
-
|
|
258
|
+
if (pretty) {
|
|
259
|
+
spinner = ora({ text: chalk.dim(\`Connecting to \${trikName}...\`), indent: 2 }).start();
|
|
260
|
+
} else {
|
|
261
|
+
console.log(\`[\${trikName}] Connecting...\`);
|
|
262
|
+
}
|
|
172
263
|
});
|
|
173
264
|
app.gateway.on('handoff:container_start', ({ trikName }: { trikName: string }) => {
|
|
174
|
-
|
|
265
|
+
if (pretty && spinner) {
|
|
266
|
+
spinner.text = chalk.dim(\`Starting \${trikName} container...\`);
|
|
267
|
+
} else if (!pretty) {
|
|
268
|
+
console.log(\`[\${trikName}] Starting container...\`);
|
|
269
|
+
}
|
|
175
270
|
});
|
|
176
271
|
app.gateway.on('handoff:thinking', ({ trikName }: { trikName: string }) => {
|
|
177
|
-
|
|
272
|
+
if (pretty && spinner) {
|
|
273
|
+
spinner.text = chalk.dim(\`\${trikName} is thinking...\`);
|
|
274
|
+
} else if (!pretty) {
|
|
275
|
+
console.log(\`[\${trikName}] Thinking...\`);
|
|
276
|
+
}
|
|
178
277
|
});
|
|
179
278
|
app.gateway.on('handoff:error', ({ trikName, error }: { trikName: string; error: string }) => {
|
|
180
|
-
|
|
279
|
+
if (spinner) spinner.stop();
|
|
280
|
+
if (pretty) {
|
|
281
|
+
console.log(' ' + chalk.red(\`\\u2716 [\${trikName}] \${error}\`));
|
|
282
|
+
} else {
|
|
283
|
+
console.log(\`[\${trikName}] Error: \${error}\`);
|
|
284
|
+
}
|
|
181
285
|
});
|
|
182
286
|
app.gateway.on('handoff:transfer_back', ({ trikName, reason }: { trikName: string; reason: string }) => {
|
|
183
|
-
|
|
287
|
+
if (spinner) spinner.stop();
|
|
288
|
+
if (pretty) {
|
|
289
|
+
console.log(' ' + chalk.dim(\`\\u2190 \${trikName} transferred back (\${reason})\`));
|
|
290
|
+
} else {
|
|
291
|
+
console.log(\`[\${trikName}] Transferred back (\${reason})\`);
|
|
292
|
+
}
|
|
184
293
|
});
|
|
185
294
|
|
|
186
295
|
const loadedTriks = app.getLoadedTriks();
|
|
187
296
|
if (loadedTriks.length > 0) {
|
|
188
|
-
console.log(
|
|
297
|
+
console.log(pretty
|
|
298
|
+
? chalk.dim(' Loaded triks: ') + loadedTriks.map((t: string) => chalk.cyan(t)).join(chalk.dim(', '))
|
|
299
|
+
: \`Loaded triks: \${loadedTriks.join(', ')}\`
|
|
300
|
+
);
|
|
189
301
|
}
|
|
190
|
-
console.log(
|
|
302
|
+
console.log(pretty
|
|
303
|
+
? chalk.dim(' Type /back to return from a trik, exit to quit.\\n')
|
|
304
|
+
: 'Type "/back" to return from a trik handoff, "exit" to quit.\\n'
|
|
305
|
+
);
|
|
191
306
|
|
|
192
307
|
const sessionId = \`cli-\${Date.now()}\`;
|
|
193
308
|
|
|
194
309
|
while (true) {
|
|
195
|
-
const userInput = await prompt('
|
|
310
|
+
const userInput = await prompt(pretty ? chalk.bold.green('You: ') : 'You: ');
|
|
196
311
|
|
|
197
312
|
if (!userInput.trim()) continue;
|
|
198
313
|
if (userInput.toLowerCase() === 'exit' || userInput.toLowerCase() === 'quit') {
|
|
199
|
-
console.log('\\nGoodbye!');
|
|
314
|
+
console.log(pretty ? '\\n ' + chalk.dim('Goodbye!') + '\\n' : '\\nGoodbye!');
|
|
200
315
|
break;
|
|
201
316
|
}
|
|
202
317
|
|
|
203
318
|
try {
|
|
319
|
+
if (spinner) spinner.stop();
|
|
204
320
|
const result = await app.processMessage(userInput, sessionId);
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
console.log(\`\\n\\x1b[2m\${result.message}\\x1b[0m\\n\`);
|
|
208
|
-
} else if (result.source !== 'main') {
|
|
209
|
-
console.log(\`\\n[\${result.source}] \${result.message}\\n\`);
|
|
210
|
-
} else {
|
|
211
|
-
console.log(\`\\nAssistant: \${result.message}\\n\`);
|
|
212
|
-
}
|
|
321
|
+
if (spinner) spinner.stop();
|
|
322
|
+
renderResponse(result);
|
|
213
323
|
} catch (error) {
|
|
214
|
-
|
|
215
|
-
console.
|
|
324
|
+
if (spinner) spinner.stop();
|
|
325
|
+
console.error(pretty ? ' ' + chalk.red('Error: ' + error) : '\\nError: ' + error);
|
|
326
|
+
console.log(pretty ? ' ' + chalk.dim('Please try again.') + '\\n' : 'Please try again.\\n');
|
|
216
327
|
}
|
|
217
328
|
}
|
|
218
329
|
|
|
@@ -221,7 +332,7 @@ async function main() {
|
|
|
221
332
|
|
|
222
333
|
main().catch((error) => {
|
|
223
334
|
console.error(error);
|
|
224
|
-
|
|
335
|
+
process.exit(1);
|
|
225
336
|
});
|
|
226
337
|
`;
|
|
227
338
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-typescript.js","sourceRoot":"","sources":["../../src/templates/agent-typescript.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,MAAM,SAAS,GAAiC;IAC9C,MAAM,EAAE;QACN,UAAU,EAAE,mBAAmB;QAC/B,SAAS,EAAE,YAAY;QACvB,UAAU,EAAE,mBAAmB;QAC/B,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE,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triks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,20 +19,14 @@
|
|
|
19
19
|
"README.md",
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "tsc",
|
|
24
|
-
"dev": "tsc --watch",
|
|
25
|
-
"start": "node dist/cli.js",
|
|
26
|
-
"clean": "rm -rf dist *.tsbuildinfo"
|
|
27
|
-
},
|
|
28
22
|
"dependencies": {
|
|
29
23
|
"@inquirer/prompts": "^7.2.1",
|
|
30
|
-
"@trikhub/linter": "0.17.1-dev.2",
|
|
31
|
-
"@trikhub/manifest": "0.17.1-dev.2",
|
|
32
24
|
"chalk": "^5.3.0",
|
|
33
25
|
"commander": "^12.1.0",
|
|
34
26
|
"ora": "^8.0.1",
|
|
35
|
-
"semver": "^7.6.3"
|
|
27
|
+
"semver": "^7.6.3",
|
|
28
|
+
"@trikhub/linter": "0.18.0",
|
|
29
|
+
"@trikhub/manifest": "0.18.0"
|
|
36
30
|
},
|
|
37
31
|
"devDependencies": {
|
|
38
32
|
"@types/node": "^20.14.0",
|
|
@@ -61,5 +55,11 @@
|
|
|
61
55
|
"cli"
|
|
62
56
|
],
|
|
63
57
|
"author": "Molefas",
|
|
64
|
-
"license": "MIT"
|
|
65
|
-
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc",
|
|
61
|
+
"dev": "tsc --watch",
|
|
62
|
+
"start": "node dist/cli.js",
|
|
63
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
64
|
+
}
|
|
65
|
+
}
|
package/dist/lib/validator.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Use @trikhub/linter instead.
|
|
3
|
-
*
|
|
4
|
-
* v1 validator removed in P1. All validation now through @trikhub/linter.
|
|
5
|
-
*/
|
|
6
|
-
export interface ValidationResult {
|
|
7
|
-
valid: boolean;
|
|
8
|
-
errors: string[];
|
|
9
|
-
warnings: string[];
|
|
10
|
-
}
|
|
11
|
-
export declare function validateTrik(_trikPath: string): ValidationResult;
|
|
12
|
-
export declare function formatValidationResult(result: ValidationResult): string;
|
|
13
|
-
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/lib/validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAEhE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEvE"}
|
package/dist/lib/validator.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Use @trikhub/linter instead.
|
|
3
|
-
*
|
|
4
|
-
* v1 validator removed in P1. All validation now through @trikhub/linter.
|
|
5
|
-
*/
|
|
6
|
-
export function validateTrik(_trikPath) {
|
|
7
|
-
return { valid: true, errors: [], warnings: [] };
|
|
8
|
-
}
|
|
9
|
-
export function formatValidationResult(result) {
|
|
10
|
-
return result.valid ? 'Validation passed' : 'Validation failed';
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/lib/validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAAwB;IAC7D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAClE,CAAC"}
|