@phartmann80/klaw 0.1.2 → 0.1.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/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
- Usage
6
-
7
- npx klaw init
8
- npx klaw run "build a Next.js landing page"
9
-
10
- How it works
11
-
12
- KLAW executes tasks through a chain of agents. Each agent handles a specific part of the work.
13
-
14
- Agents
15
-
16
- Architect: Plans task steps
17
- Writer: Creates and modifies files
18
- Shell: Runs commands with permission prompts
19
- Fixer: Handles basic errors and retries
20
-
21
- Security
22
-
23
- Workspace isolation by default
24
- Permission prompts for shell commands
25
- No file writes outside workspace root
26
-
27
- Author
28
-
29
- Built by Paul Hartmann
30
- GitHub: @janpaul80
31
-
32
- License
33
-
34
- MIT
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.0');
11
+ program.version('0.1.4');
11
12
 
12
13
  program
13
14
  .command('init')
14
15
  .description('Initialize KLAW configuration')
15
16
  .action(() => {
16
- const configDir = path.join(process.env.HOME, '.klaw');
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.0',
23
+ version: '0.1.4',
23
24
  defaultProvider: 'openai',
24
25
  workspace: path.join(process.cwd(), 'klaw-workspace'),
25
26
  providers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phartmann80/klaw",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Local AI runtime for running agents with your own models and APIs",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -7,7 +7,8 @@ const fs = require('fs');
7
7
  const path = require('path');
8
8
 
9
9
  function parseConfig() {
10
- const configPath = path.join(process.env.HOME, '.klaw', 'config.json');
10
+ const os = require('os');
11
+ const configPath = path.join(os.homedir(), '.klaw', 'config.json');
11
12
  if (fs.existsSync(configPath)) {
12
13
  return JSON.parse(fs.readFileSync(configPath, 'utf8'));
13
14
  }
@@ -1,3 +0,0 @@
1
- /** @type {import('next').NextConfig} */
2
- const nextConfig = {};
3
- module.exports = nextConfig;
@@ -1,3 +0,0 @@
1
- /** @type {import('next').NextConfig} */
2
- const nextConfig = {};
3
- module.exports = nextConfig;
@@ -1,15 +0,0 @@
1
- {
2
- "name": "klaw-demo",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev",
7
- "build": "next build",
8
- "start": "next start"
9
- },
10
- "dependencies": {
11
- "next": "^14.0.0",
12
- "react": "^18.2.0",
13
- "react-dom": "^18.2.0"
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- {
2
- "name": "klaw-demo",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev",
7
- "build": "next build",
8
- "start": "next start"
9
- },
10
- "dependencies": {
11
- "next": "^14.0.0",
12
- "react": "^18.2.0",
13
- "react-dom": "^18.2.0"
14
- }
15
- }
@@ -1,6 +0,0 @@
1
- export default function Home() {
2
- return <div style={{ padding: '2rem', background: '#000', color: '#0f0', fontFamily: 'monospace' }}>
3
- <h1>KLAW Demo</h1>
4
- <p>Next.js landing page generated by KLAW</p>
5
- </div>;
6
- }
@@ -1,6 +0,0 @@
1
- export default function Home() {
2
- return <div style={{ padding: '2rem', background: '#000', color: '#0f0', fontFamily: 'monospace' }}>
3
- <h1>KLAW Demo</h1>
4
- <p>Next.js landing page generated by KLAW</p>
5
- </div>;
6
- }
@@ -1,2 +0,0 @@
1
- html, body { margin: 0; padding: 0; }
2
- body { background: #000; color: #0f0; }
@@ -1,2 +0,0 @@
1
- html, body { margin: 0; padding: 0; }
2
- body { background: #000; color: #0f0; }
package/memory.md DELETED
@@ -1,162 +0,0 @@
1
- # KLAW Execution Log
2
-
3
- [2026-05-11T04:11:07.306Z] TASK: Received task: build a Next.js landing page
4
-
5
- [2026-05-11T05:23:46.196Z] TASK: Received task: build a Next.js landing page
6
-
7
- [2026-05-11T05:23:46.206Z] REASONING: ArchitectAgent: Planning 4 steps
8
-
9
- [2026-05-11T05:23:46.208Z] REASONING: ArchitectAgent: Executing step 1/4: Create package.json with Next.js dependencies
10
-
11
- [2026-05-11T05:23:46.214Z] ERROR: appendMemory is not defined
12
-
13
- [2026-05-11T05:25:12.628Z] TASK: Received task: build a Next.js landing page
14
-
15
- [2026-05-11T05:25:12.630Z] REASONING: ArchitectAgent: Planning 4 steps
16
-
17
- [2026-05-11T05:25:12.631Z] REASONING: ArchitectAgent: Executing step 1/4: Create package.json with Next.js dependencies
18
-
19
- [2026-05-11T05:25:12.635Z] FILE: Created package.json
20
-
21
- [2026-05-11T05:25:12.638Z] FILE: Created pages/index.js
22
-
23
- [2026-05-11T05:25:12.642Z] FILE: Created next.config.js
24
-
25
- [2026-05-11T05:25:12.645Z] FILE: Created styles/globals.css
26
-
27
- [2026-05-11T05:25:12.646Z] FILES: Created package.json, pages/index.js, next.config.js, styles/globals.css
28
-
29
- [2026-05-11T05:25:12.647Z] REASONING: ArchitectAgent: Executing step 2/4: Generate app structure (pages/api)
30
-
31
- [2026-05-11T05:25:12.648Z] REASONING: ArchitectAgent: Executing step 3/4: Install dependencies
32
-
33
- [2026-05-11T05:25:12.649Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm install
34
-
35
- [2026-05-11T05:26:34.103Z] TASK: Received task: build a Next.js landing page
36
-
37
- [2026-05-11T05:26:34.107Z] REASONING: ArchitectAgent: Planning 4 steps
38
-
39
- [2026-05-11T05:26:34.108Z] REASONING: ArchitectAgent: Executing step 1/4: Create package.json with Next.js dependencies
40
-
41
- [2026-05-11T05:26:34.115Z] FILE: Created package.json
42
-
43
- [2026-05-11T05:26:34.120Z] FILE: Created pages/index.js
44
-
45
- [2026-05-11T05:26:34.122Z] FILE: Created next.config.js
46
-
47
- [2026-05-11T05:26:34.126Z] FILE: Created styles/globals.css
48
-
49
- [2026-05-11T05:26:34.129Z] FILES: Created package.json, pages/index.js, next.config.js, styles/globals.css
50
-
51
- [2026-05-11T05:26:34.130Z] REASONING: ArchitectAgent: Executing step 2/4: Generate app structure (pages/api)
52
-
53
- [2026-05-11T05:26:34.131Z] REASONING: ArchitectAgent: Executing step 3/4: Install dependencies
54
-
55
- [2026-05-11T05:26:34.132Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm install
56
-
57
- [2026-05-11T05:26:34.147Z] ERROR: spawn npm ENOENT
58
-
59
- [2026-05-11T05:28:33.522Z] TASK: Received task: build a Next.js landing page
60
-
61
- [2026-05-11T05:28:33.536Z] REASONING: ArchitectAgent: Planning 4 steps
62
-
63
- [2026-05-11T05:28:33.540Z] REASONING: ArchitectAgent: Executing step 1/4: Create package.json with Next.js dependencies
64
-
65
- [2026-05-11T05:28:33.551Z] FILE: Created package.json
66
-
67
- [2026-05-11T05:28:33.554Z] FILE: Created pages/index.js
68
-
69
- [2026-05-11T05:28:33.557Z] FILE: Created next.config.js
70
-
71
- [2026-05-11T05:28:33.562Z] FILE: Created styles/globals.css
72
-
73
- [2026-05-11T05:28:33.563Z] FILES: Created package.json, pages/index.js, next.config.js, styles/globals.css
74
-
75
- [2026-05-11T05:28:33.564Z] REASONING: ArchitectAgent: Executing step 2/4: Generate app structure (pages/api)
76
-
77
- [2026-05-11T05:28:33.565Z] REASONING: ArchitectAgent: Executing step 3/4: Install dependencies
78
-
79
- [2026-05-11T05:28:33.566Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm install
80
-
81
- [2026-05-11T05:28:33.567Z] FIX: Retry attempted: npm install
82
-
83
- [2026-05-11T05:28:33.568Z] ERROR: npm install failed
84
-
85
- [2026-05-11T05:28:33.568Z] REASONING: ArchitectAgent: Executing step 4/4: Start development server
86
-
87
- [2026-05-11T05:28:33.570Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm run dev
88
-
89
- [2026-05-11T05:28:33.593Z] ERROR: spawn npm ENOENT
90
-
91
- [2026-05-11T05:28:57.715Z] TASK: Received task: build a Next.js landing page
92
-
93
- [2026-05-11T05:28:57.717Z] REASONING: ArchitectAgent: Planning 4 steps
94
-
95
- [2026-05-11T05:28:57.722Z] REASONING: ArchitectAgent: Executing step 1/4: Create package.json with Next.js dependencies
96
-
97
- [2026-05-11T05:28:57.727Z] FILE: Created package.json
98
-
99
- [2026-05-11T05:28:57.731Z] FILE: Created pages/index.js
100
-
101
- [2026-05-11T05:28:57.734Z] FILE: Created next.config.js
102
-
103
- [2026-05-11T05:28:57.739Z] FILE: Created styles/globals.css
104
-
105
- [2026-05-11T05:28:57.740Z] FILES: Created package.json, pages/index.js, next.config.js, styles/globals.css
106
-
107
- [2026-05-11T05:28:57.741Z] REASONING: ArchitectAgent: Executing step 2/4: Generate app structure (pages/api)
108
-
109
- [2026-05-11T05:28:57.742Z] REASONING: ArchitectAgent: Executing step 3/4: Install dependencies
110
-
111
- [2026-05-11T05:28:57.742Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm install
112
-
113
- [2026-05-11T05:28:57.743Z] FIX: Retry attempted: npm install
114
-
115
- [2026-05-11T05:28:57.743Z] ERROR: npm install failed
116
-
117
- [2026-05-11T05:28:57.744Z] REASONING: ArchitectAgent: Executing step 4/4: Start development server
118
-
119
- [2026-05-11T05:28:57.745Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm run dev
120
-
121
- [2026-05-11T05:28:57.745Z] ERROR: Dev server failed to start
122
-
123
- [2026-05-11T05:28:57.746Z] FIX: Retry attempted: npm run dev
124
-
125
- [2026-05-11T05:28:57.747Z] RESULT: Demo completed
126
-
127
- [2026-05-11T05:31:52.289Z] TASK: Received task: build a Next.js landing page
128
-
129
- [2026-05-11T05:31:52.302Z] REASONING: ArchitectAgent: Planning 4 steps
130
-
131
- [2026-05-11T05:31:52.303Z] REASONING: ArchitectAgent: Executing step 1/4: Create package.json with Next.js dependencies
132
-
133
- [2026-05-11T05:31:52.310Z] FILE: Created package.json
134
-
135
- [2026-05-11T05:31:52.314Z] FILE: Created pages/index.js
136
-
137
- [2026-05-11T05:31:52.318Z] FILE: Created next.config.js
138
-
139
- [2026-05-11T05:31:52.321Z] FILE: Created styles/globals.css
140
-
141
- [2026-05-11T05:31:52.321Z] FILES: Created package.json, pages/index.js, next.config.js, styles/globals.css
142
-
143
- [2026-05-11T05:31:52.322Z] REASONING: ArchitectAgent: Executing step 2/4: Generate app structure (pages/api)
144
-
145
- [2026-05-11T05:31:52.323Z] REASONING: ArchitectAgent: Executing step 3/4: Install dependencies
146
-
147
- [2026-05-11T05:31:52.324Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm install
148
-
149
- [2026-05-11T05:31:52.324Z] FIX: Retry attempted: npm install
150
-
151
- [2026-05-11T05:31:52.325Z] ERROR: npm install failed
152
-
153
- [2026-05-11T05:31:52.326Z] REASONING: ArchitectAgent: Executing step 4/4: Start development server
154
-
155
- [2026-05-11T05:31:52.327Z] REASONING: ArchitectAgent: Delegating to ShellAgent for npm run dev
156
-
157
- [2026-05-11T05:31:52.327Z] ERROR: Dev server failed to start
158
-
159
- [2026-05-11T05:31:52.328Z] FIX: Retry attempted: npm run dev
160
-
161
- [2026-05-11T05:31:52.329Z] RESULT: Demo completed
162
-
Binary file
Binary file