@stan-chen/simple-cli 0.2.5 → 0.2.7

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.
@@ -0,0 +1,39 @@
1
+ import { Engine, Registry, Context } from '../engine.js';
2
+ import { MCP } from '../mcp.js';
3
+ import { createLLM } from '../llm.js';
4
+ import { getActiveSkill } from '../skills.js';
5
+ export class Server {
6
+ engine;
7
+ constructor(engine) {
8
+ if (engine) {
9
+ this.engine = engine;
10
+ }
11
+ else {
12
+ const llm = createLLM();
13
+ const registry = new Registry();
14
+ const mcp = new MCP();
15
+ this.engine = new Engine(llm, registry, mcp);
16
+ }
17
+ }
18
+ async handle(input) {
19
+ try {
20
+ if (typeof input === 'string') {
21
+ console.log(`[Server] Received prompt: ${input.substring(0, 50)}...`);
22
+ const skill = await getActiveSkill(process.cwd());
23
+ const context = new Context(process.cwd(), skill);
24
+ await this.engine.run(context, input, { interactive: false });
25
+ return { status: 'success', message: 'Agent executed prompt' };
26
+ }
27
+ else {
28
+ console.log(`[Server] Received tool call: ${input.tool_name}`);
29
+ // Handle tool execution logic would go here
30
+ // We'll return a placeholder success for now
31
+ return { status: 'success', message: 'Tool executed', tool: input.tool_name };
32
+ }
33
+ }
34
+ catch (error) {
35
+ console.error(`[Server] Error handling request:`, error);
36
+ return { status: 'error', message: error.message };
37
+ }
38
+ }
39
+ }
package/dist/tui.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { intro } from '@clack/prompts';
1
2
  import pc from 'picocolors';
2
3
  import fs from 'fs';
3
4
  import { join, dirname } from 'path';
@@ -5,11 +6,5 @@ import { fileURLToPath } from 'url';
5
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
6
7
  const pkg = JSON.parse(fs.readFileSync(join(__dirname, '../package.json'), 'utf8'));
7
8
  export function showBanner() {
8
- const cat = `
9
- /\\_/\\
10
- ( o.o )
11
- > ^ <
12
- `;
13
- console.log(pc.magenta(cat));
14
- console.log(` ${pc.bgMagenta(pc.black(' SIMPLE-CLI '))} ${pc.dim(`v${pkg.version}`)}\n`);
9
+ intro(pc.bgBlue(pc.white(` SIMPLE-CLI v${pkg.version} `)));
15
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stan-chen/simple-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "A lean, lightweight coding agent. Packs a punch with token efficiency.",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -10,7 +10,7 @@
10
10
  "scripts": {
11
11
  "start": "node --loader ts-node/esm src/cli.ts",
12
12
  "dev": "node --loader ts-node/esm --watch src/cli.ts",
13
- "build": "tsc && node -e \"require('fs').copyFileSync('src/anyllm.py', 'dist/anyllm.py')\"",
13
+ "build": "tsc",
14
14
  "typecheck": "tsc --noEmit",
15
15
  "test": "vitest run",
16
16
  "test:watch": "vitest",
@@ -58,7 +58,7 @@
58
58
  "glob": "^13.0.0",
59
59
  "gpt-tokenizer": "^2.5.0",
60
60
  "jsonrepair": "^3.13.2",
61
- "node-fetch": "^3.3.2",
61
+ "node-fetch": "^2.7.0",
62
62
  "ora": "^8.0.0",
63
63
  "picocolors": "^1.0.0",
64
64
  "simple-git": "^3.22.0",
@@ -83,6 +83,6 @@
83
83
  "files": [
84
84
  "dist",
85
85
  "README.md",
86
- "assets/logo.jpeg"
86
+ "docs/assets/logo.jpeg"
87
87
  ]
88
88
  }
File without changes