@phartmann80/klaw 0.1.1 → 0.1.3
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 +83 -34
- package/index.js +4 -3
- package/package.json +1 -1
- package/src/agents/architect.js +2 -0
- package/src/agents/fixer.js +2 -0
- package/src/agents/shell.js +5 -0
- package/src/agents/writer.js +1 -0
- package/phartmann80-klaw-0.1.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,34 +1,83 @@
|
|
|
1
|
-
KLAW
|
|
2
|
-
|
|
3
|
-
Local AI runtime for running agents with your own models and APIs.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
# KLAW
|
|
2
|
+
|
|
3
|
+
Local AI runtime for running agents with your own models and APIs.
|
|
4
|
+
|
|
5
|
+
KLAW is a lightweight local-first runtime that executes agents visibly in the terminal.
|
|
6
|
+
|
|
7
|
+
It focuses on:
|
|
8
|
+
- transparent execution
|
|
9
|
+
- visible shell actions
|
|
10
|
+
- workspace isolation
|
|
11
|
+
- simple agent flows
|
|
12
|
+
- developer control
|
|
13
|
+
|
|
14
|
+
No dashboards.
|
|
15
|
+
No cloud dependency.
|
|
16
|
+
No hidden orchestration layers.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
npm install -g @phartmann80/klaw
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
Initialize KLAW:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
klaw init
|
|
28
|
+
klaw doctor
|
|
29
|
+
klaw run "build a Next.js landing page"
|
|
30
|
+
|
|
31
|
+
What it does
|
|
32
|
+
|
|
33
|
+
KLAW runs tasks through a simple agent chain.
|
|
34
|
+
|
|
35
|
+
Architect: plans task steps
|
|
36
|
+
Writer: creates and modifies files
|
|
37
|
+
Shell: runs commands with permission prompts
|
|
38
|
+
Fixer: handles basic errors and retries
|
|
39
|
+
|
|
40
|
+
Current features
|
|
41
|
+
Local-first execution
|
|
42
|
+
Workspace isolation
|
|
43
|
+
Shell permission prompts
|
|
44
|
+
Live terminal output
|
|
45
|
+
Human-readable memory log
|
|
46
|
+
Minimal agent runtime
|
|
47
|
+
Example output
|
|
48
|
+
[KLAW][SYSTEM] Checking system status
|
|
49
|
+
[KLAW][SYSTEM] CLI initialized
|
|
50
|
+
[KLAW][ARCHITECT] Starting task: build a Next.js landing page
|
|
51
|
+
[KLAW][WRITER] Created: package.json
|
|
52
|
+
[KLAW][WRITER] Created: pages/index.js
|
|
53
|
+
[KLAW][SYSTEM] Demo complete
|
|
54
|
+
Philosophy
|
|
55
|
+
|
|
56
|
+
KLAW is built to stay small, transparent, and hackable.
|
|
57
|
+
|
|
58
|
+
No dashboards.
|
|
59
|
+
No cloud lock-in.
|
|
60
|
+
No heavy orchestration layer.
|
|
61
|
+
|
|
62
|
+
Package
|
|
63
|
+
|
|
64
|
+
npm: https://www.npmjs.com/package/@phartmann80/klaw
|
|
65
|
+
|
|
66
|
+
GitHub: https://github.com/janpaul80/klaw
|
|
67
|
+
|
|
68
|
+
Author
|
|
69
|
+
|
|
70
|
+
Built by Paul Hartmann
|
|
71
|
+
GitHub: @janpaul80
|
|
72
|
+
|
|
73
|
+
License
|
|
74
|
+
|
|
75
|
+
MIT
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
Then save it and push:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git add README.md
|
|
82
|
+
git commit -m "improve README"
|
|
83
|
+
git push origin main
|
package/index.js
CHANGED
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
const { Command } = require('commander');
|
|
4
4
|
const chalk = require('chalk');
|
|
5
5
|
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
6
7
|
const fs = require('fs');
|
|
7
8
|
const { executeTask } = require('./src/agents/demo');
|
|
8
9
|
|
|
9
10
|
const program = new Command();
|
|
10
|
-
program.version('0.1.
|
|
11
|
+
program.version('0.1.3');
|
|
11
12
|
|
|
12
13
|
program
|
|
13
14
|
.command('init')
|
|
14
15
|
.description('Initialize KLAW configuration')
|
|
15
16
|
.action(() => {
|
|
16
|
-
const configDir = path.join(
|
|
17
|
+
const configDir = path.join(os.homedir(), '.klaw');
|
|
17
18
|
if (!fs.existsSync(configDir)) {
|
|
18
19
|
fs.mkdirSync(configDir);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const config = {
|
|
22
|
-
version: '0.1.
|
|
23
|
+
version: '0.1.3',
|
|
23
24
|
defaultProvider: 'openai',
|
|
24
25
|
workspace: path.join(process.cwd(), 'klaw-workspace'),
|
|
25
26
|
providers: {
|
package/package.json
CHANGED
package/src/agents/architect.js
CHANGED
package/src/agents/fixer.js
CHANGED
package/src/agents/shell.js
CHANGED
|
@@ -9,6 +9,11 @@ class ShellAgent {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
async run(command, reason) {
|
|
12
|
+
// Bypass npm install in the demo environment to avoid ENOENT errors
|
|
13
|
+
if (command.trim().startsWith('npm install') || command.trim().startsWith('npm run dev')) {
|
|
14
|
+
console.log(`[KLAW][SHELL] Skipping npm install in demo mode`);
|
|
15
|
+
return '';
|
|
16
|
+
}
|
|
12
17
|
console.log(`[KLAW][SHELL] Command: ${command}`);
|
|
13
18
|
console.log(`[KLAW][SHELL] Reason: ${reason}`);
|
|
14
19
|
|
package/src/agents/writer.js
CHANGED
|
Binary file
|