@halfagiraf/clawx 0.1.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/.env.example +44 -0
- package/LICENSE +21 -0
- package/README.md +489 -0
- package/clawx.json.example +23 -0
- package/dist/cli/main.d.ts +21 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +176 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/repl.d.ts +11 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +119 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/tui.d.ts +35 -0
- package/dist/cli/tui.d.ts.map +1 -0
- package/dist/cli/tui.js +92 -0
- package/dist/cli/tui.js.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +106 -0
- package/dist/config/index.js.map +1 -0
- package/dist/core/agent.d.ts +53 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +152 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/provider.d.ts +30 -0
- package/dist/core/provider.d.ts.map +1 -0
- package/dist/core/provider.js +76 -0
- package/dist/core/provider.js.map +1 -0
- package/dist/core/session.d.ts +37 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +87 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/streaming.d.ts +27 -0
- package/dist/core/streaming.d.ts.map +1 -0
- package/dist/core/streaming.js +137 -0
- package/dist/core/streaming.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/gitDiff.d.ts +13 -0
- package/dist/tools/gitDiff.d.ts.map +1 -0
- package/dist/tools/gitDiff.js +50 -0
- package/dist/tools/gitDiff.js.map +1 -0
- package/dist/tools/gitStatus.d.ts +13 -0
- package/dist/tools/gitStatus.d.ts.map +1 -0
- package/dist/tools/gitStatus.js +43 -0
- package/dist/tools/gitStatus.js.map +1 -0
- package/dist/tools/searchFiles.d.ts +19 -0
- package/dist/tools/searchFiles.d.ts.map +1 -0
- package/dist/tools/searchFiles.js +101 -0
- package/dist/tools/searchFiles.js.map +1 -0
- package/dist/tools/sshRun.d.ts +26 -0
- package/dist/tools/sshRun.d.ts.map +1 -0
- package/dist/tools/sshRun.js +170 -0
- package/dist/tools/sshRun.js.map +1 -0
- package/dist/types/index.d.ts +35 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +43 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/system-prompt.d.ts +9 -0
- package/dist/utils/system-prompt.d.ts.map +1 -0
- package/dist/utils/system-prompt.js +49 -0
- package/dist/utils/system-prompt.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System prompt builder for Clawx.
|
|
3
|
+
*
|
|
4
|
+
* Builds a focused system prompt for coding/execution tasks.
|
|
5
|
+
* No personality systems, no lore, no bootstrap documents.
|
|
6
|
+
*/
|
|
7
|
+
export function buildSystemPrompt(config) {
|
|
8
|
+
const sshSection = Object.keys(config.sshTargets).length > 0
|
|
9
|
+
? `\n\nSSH Targets available:\n${Object.entries(config.sshTargets)
|
|
10
|
+
.map(([name, t]) => `- "${name}": ${t.username}@${t.host}${t.port ? `:${t.port}` : ""}`)
|
|
11
|
+
.join("\n")}`
|
|
12
|
+
: "";
|
|
13
|
+
return `You are Clawx, a coding and execution agent. You help users build software by creating files, writing code, running commands, and iterating based on results.
|
|
14
|
+
|
|
15
|
+
Environment:
|
|
16
|
+
- Working directory: ${config.workDir}
|
|
17
|
+
- Platform: ${process.platform}
|
|
18
|
+
- Shell: ${config.shell}${sshSection}
|
|
19
|
+
|
|
20
|
+
Behavior:
|
|
21
|
+
- You are action-oriented. When asked to build something, start building immediately.
|
|
22
|
+
- You decide what files to create, what structure to use, and what code to write.
|
|
23
|
+
- You run commands to install dependencies, build, test, and verify your work.
|
|
24
|
+
- You iterate based on command output — if something fails, you fix it and try again.
|
|
25
|
+
- You are concise. Show your work through actions, not lengthy explanations.
|
|
26
|
+
- You do not ask permission before creating files or running commands — that is your purpose.
|
|
27
|
+
|
|
28
|
+
Capabilities:
|
|
29
|
+
- read_file: Read file contents
|
|
30
|
+
- write_file: Write/create files with content
|
|
31
|
+
- edit_file: Make precise edits to existing files (search and replace)
|
|
32
|
+
- list_dir: List directory contents
|
|
33
|
+
- search_files: Search file contents with patterns
|
|
34
|
+
- run_shell: Execute shell commands locally
|
|
35
|
+
- ssh_run: Execute commands on remote SSH targets
|
|
36
|
+
- git_status: Check git repository status
|
|
37
|
+
- git_diff: View git diffs
|
|
38
|
+
|
|
39
|
+
When building applications:
|
|
40
|
+
1. Plan the file structure
|
|
41
|
+
2. Create files with proper code
|
|
42
|
+
3. Install dependencies
|
|
43
|
+
4. Build/compile if needed
|
|
44
|
+
5. Test and verify
|
|
45
|
+
6. Report results
|
|
46
|
+
|
|
47
|
+
${config.systemPrompt || ""}`.trim();
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/utils/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC;QAC1D,CAAC,CAAC,+BAA+B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;aAC7D,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAsB,EAAE,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aAC5G,IAAI,CAAC,IAAI,CAAC,EAAE;QACjB,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;;uBAGc,MAAM,CAAC,OAAO;cACvB,OAAO,CAAC,QAAQ;WACnB,MAAM,CAAC,KAAK,GAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BlC,MAAM,CAAC,YAAY,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@halfagiraf/clawx",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Terminal-first coding agent — runs locally with Ollama, DeepSeek, OpenAI, or any OpenAI-compatible endpoint",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"clawx": "./dist/cli/main.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
".env.example",
|
|
16
|
+
"clawx.json.example"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"start": "node dist/cli/main.js",
|
|
22
|
+
"test": "vitest --run",
|
|
23
|
+
"lint": "tsc --noEmit",
|
|
24
|
+
"prepublishOnly": "npm run build && npm test"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.0.0"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/stevenmcsorley/clawx.git"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/stevenmcsorley/clawx#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/stevenmcsorley/clawx/issues"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"coding-agent",
|
|
39
|
+
"ai-agent",
|
|
40
|
+
"terminal",
|
|
41
|
+
"cli",
|
|
42
|
+
"ollama",
|
|
43
|
+
"deepseek",
|
|
44
|
+
"openai",
|
|
45
|
+
"local-llm",
|
|
46
|
+
"code-generation",
|
|
47
|
+
"tool-calling",
|
|
48
|
+
"ssh",
|
|
49
|
+
"automation"
|
|
50
|
+
],
|
|
51
|
+
"author": "Steven McSorley",
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@mariozechner/pi-agent-core": "^0.58.0",
|
|
54
|
+
"@mariozechner/pi-ai": "^0.58.0",
|
|
55
|
+
"@mariozechner/pi-coding-agent": "^0.58.0",
|
|
56
|
+
"@sinclair/typebox": "^0.34.0",
|
|
57
|
+
"chalk": "^5.4.0",
|
|
58
|
+
"commander": "^13.0.0",
|
|
59
|
+
"dotenv": "^16.4.0",
|
|
60
|
+
"ora": "^8.1.0",
|
|
61
|
+
"ssh2": "^1.16.0",
|
|
62
|
+
"zod": "^3.24.0"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@types/node": "^22.0.0",
|
|
66
|
+
"@types/ssh2": "^1.15.0",
|
|
67
|
+
"typescript": "^5.7.0",
|
|
68
|
+
"vitest": "^3.0.0"
|
|
69
|
+
},
|
|
70
|
+
"license": "MIT"
|
|
71
|
+
}
|