@jx-grxf/patchpilot 0.2.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.
Files changed (95) hide show
  1. package/.env.example +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +314 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +71 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/core/agent.d.ts +21 -0
  8. package/dist/core/agent.js +346 -0
  9. package/dist/core/agent.js.map +1 -0
  10. package/dist/core/codex.d.ts +22 -0
  11. package/dist/core/codex.js +242 -0
  12. package/dist/core/codex.js.map +1 -0
  13. package/dist/core/compute.d.ts +9 -0
  14. package/dist/core/compute.js +18 -0
  15. package/dist/core/compute.js.map +1 -0
  16. package/dist/core/doctor.d.ts +7 -0
  17. package/dist/core/doctor.js +226 -0
  18. package/dist/core/doctor.js.map +1 -0
  19. package/dist/core/env.d.ts +6 -0
  20. package/dist/core/env.js +103 -0
  21. package/dist/core/env.js.map +1 -0
  22. package/dist/core/gemini.d.ts +20 -0
  23. package/dist/core/gemini.js +177 -0
  24. package/dist/core/gemini.js.map +1 -0
  25. package/dist/core/json.d.ts +3 -0
  26. package/dist/core/json.js +95 -0
  27. package/dist/core/json.js.map +1 -0
  28. package/dist/core/modelClient.d.ts +8 -0
  29. package/dist/core/modelClient.js +42 -0
  30. package/dist/core/modelClient.js.map +1 -0
  31. package/dist/core/nvidia.d.ts +19 -0
  32. package/dist/core/nvidia.js +160 -0
  33. package/dist/core/nvidia.js.map +1 -0
  34. package/dist/core/ollama.d.ts +31 -0
  35. package/dist/core/ollama.js +176 -0
  36. package/dist/core/ollama.js.map +1 -0
  37. package/dist/core/openrouter.d.ts +27 -0
  38. package/dist/core/openrouter.js +168 -0
  39. package/dist/core/openrouter.js.map +1 -0
  40. package/dist/core/subagents.d.ts +14 -0
  41. package/dist/core/subagents.js +89 -0
  42. package/dist/core/subagents.js.map +1 -0
  43. package/dist/core/tokenAccounting.d.ts +6 -0
  44. package/dist/core/tokenAccounting.js +134 -0
  45. package/dist/core/tokenAccounting.js.map +1 -0
  46. package/dist/core/types.d.ts +90 -0
  47. package/dist/core/types.js +2 -0
  48. package/dist/core/types.js.map +1 -0
  49. package/dist/core/workspace.d.ts +28 -0
  50. package/dist/core/workspace.js +616 -0
  51. package/dist/core/workspace.js.map +1 -0
  52. package/dist/tui/App.d.ts +6 -0
  53. package/dist/tui/App.js +1717 -0
  54. package/dist/tui/App.js.map +1 -0
  55. package/dist/tui/commands.d.ts +14 -0
  56. package/dist/tui/commands.js +210 -0
  57. package/dist/tui/commands.js.map +1 -0
  58. package/dist/tui/components/CommandSuggestions.d.ts +12 -0
  59. package/dist/tui/components/CommandSuggestions.js +12 -0
  60. package/dist/tui/components/CommandSuggestions.js.map +1 -0
  61. package/dist/tui/components/Composer.d.ts +13 -0
  62. package/dist/tui/components/Composer.js +29 -0
  63. package/dist/tui/components/Composer.js.map +1 -0
  64. package/dist/tui/components/Header.d.ts +25 -0
  65. package/dist/tui/components/Header.js +62 -0
  66. package/dist/tui/components/Header.js.map +1 -0
  67. package/dist/tui/components/OnboardingPanel.d.ts +38 -0
  68. package/dist/tui/components/OnboardingPanel.js +85 -0
  69. package/dist/tui/components/OnboardingPanel.js.map +1 -0
  70. package/dist/tui/components/Sidebar.d.ts +22 -0
  71. package/dist/tui/components/Sidebar.js +133 -0
  72. package/dist/tui/components/Sidebar.js.map +1 -0
  73. package/dist/tui/components/Transcript.d.ts +10 -0
  74. package/dist/tui/components/Transcript.js +111 -0
  75. package/dist/tui/components/Transcript.js.map +1 -0
  76. package/dist/tui/format.d.ts +29 -0
  77. package/dist/tui/format.js +202 -0
  78. package/dist/tui/format.js.map +1 -0
  79. package/dist/tui/hosts.d.ts +34 -0
  80. package/dist/tui/hosts.js +338 -0
  81. package/dist/tui/hosts.js.map +1 -0
  82. package/dist/tui/inputRouting.d.ts +8 -0
  83. package/dist/tui/inputRouting.js +94 -0
  84. package/dist/tui/inputRouting.js.map +1 -0
  85. package/dist/tui/platform.d.ts +2 -0
  86. package/dist/tui/platform.js +13 -0
  87. package/dist/tui/platform.js.map +1 -0
  88. package/dist/tui/systemStats.d.ts +25 -0
  89. package/dist/tui/systemStats.js +88 -0
  90. package/dist/tui/systemStats.js.map +1 -0
  91. package/dist/tui/types.d.ts +16 -0
  92. package/dist/tui/types.js +2 -0
  93. package/dist/tui/types.js.map +1 -0
  94. package/docs/showcase/patchpilot-showcase.svg +39 -0
  95. package/package.json +63 -0
@@ -0,0 +1,16 @@
1
+ import type { SubagentRole } from "../core/types.js";
2
+ export type AgentMode = "plan" | "build";
3
+ export type LogTone = "muted" | "normal" | "success" | "warning" | "danger" | "accent";
4
+ export type LogLine = {
5
+ id: number;
6
+ tone: LogTone;
7
+ label: string;
8
+ text: string;
9
+ detail?: string;
10
+ };
11
+ export type AppendLine = (line: Omit<LogLine, "id">) => void;
12
+ export type AdvisorNote = {
13
+ role: SubagentRole;
14
+ message: string;
15
+ };
16
+ export declare const maxTranscriptLines = 300;
@@ -0,0 +1,2 @@
1
+ export const maxTranscriptLines = 300;
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tui/types.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC"}
@@ -0,0 +1,39 @@
1
+ <svg width="920" height="520" viewBox="0 0 920 520" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
2
+ <title id="title">PatchPilot TUI showcase</title>
3
+ <desc id="desc">A stylized terminal interface for the PatchPilot local coding agent.</desc>
4
+ <rect width="920" height="520" rx="28" fill="#0B1020"/>
5
+ <rect x="32" y="32" width="856" height="456" rx="18" fill="#111827" stroke="#334155"/>
6
+ <rect x="32" y="32" width="856" height="48" rx="18" fill="#172033"/>
7
+ <circle cx="60" cy="56" r="7" fill="#EF4444"/>
8
+ <circle cx="84" cy="56" r="7" fill="#F59E0B"/>
9
+ <circle cx="108" cy="56" r="7" fill="#22C55E"/>
10
+ <text x="138" y="62" fill="#E5E7EB" font-family="Consolas, Menlo, monospace" font-size="18" font-weight="700">PatchPilot</text>
11
+ <rect x="704" y="45" width="146" height="24" rx="12" fill="#0F766E"/>
12
+ <text x="724" y="62" fill="#CCFBF1" font-family="Consolas, Menlo, monospace" font-size="13">qwen2.5-coder</text>
13
+
14
+ <rect x="56" y="104" width="228" height="338" rx="12" fill="#0F172A" stroke="#334155"/>
15
+ <text x="76" y="134" fill="#38BDF8" font-family="Consolas, Menlo, monospace" font-size="14" font-weight="700">Workspace</text>
16
+ <text x="76" y="166" fill="#CBD5E1" font-family="Consolas, Menlo, monospace" font-size="13">src/core/agent.ts</text>
17
+ <text x="76" y="194" fill="#CBD5E1" font-family="Consolas, Menlo, monospace" font-size="13">src/core/tools.ts</text>
18
+ <text x="76" y="222" fill="#CBD5E1" font-family="Consolas, Menlo, monospace" font-size="13">src/tui/App.tsx</text>
19
+ <text x="76" y="250" fill="#94A3B8" font-family="Consolas, Menlo, monospace" font-size="13">tests/parser.test.ts</text>
20
+ <rect x="76" y="290" width="168" height="30" rx="8" fill="#1E293B"/>
21
+ <text x="94" y="311" fill="#A7F3D0" font-family="Consolas, Menlo, monospace" font-size="13">write: disabled</text>
22
+ <rect x="76" y="332" width="168" height="30" rx="8" fill="#1E293B"/>
23
+ <text x="94" y="353" fill="#FDE68A" font-family="Consolas, Menlo, monospace" font-size="13">shell: ask first</text>
24
+
25
+ <rect x="308" y="104" width="556" height="338" rx="12" fill="#020617" stroke="#334155"/>
26
+ <text x="332" y="136" fill="#F8FAFC" font-family="Consolas, Menlo, monospace" font-size="15" font-weight="700">Agent transcript</text>
27
+ <text x="332" y="174" fill="#94A3B8" font-family="Consolas, Menlo, monospace" font-size="13">user</text>
28
+ <text x="390" y="174" fill="#E5E7EB" font-family="Consolas, Menlo, monospace" font-size="13">add parser tests and explain the diff</text>
29
+ <text x="332" y="216" fill="#38BDF8" font-family="Consolas, Menlo, monospace" font-size="13">pilot</text>
30
+ <text x="390" y="216" fill="#CBD5E1" font-family="Consolas, Menlo, monospace" font-size="13">reading parser and current tests...</text>
31
+ <rect x="332" y="244" width="492" height="42" rx="10" fill="#111827"/>
32
+ <text x="354" y="270" fill="#A7F3D0" font-family="Consolas, Menlo, monospace" font-size="13">tool read_file src/core/json.ts</text>
33
+ <rect x="332" y="302" width="492" height="42" rx="10" fill="#111827"/>
34
+ <text x="354" y="328" fill="#FDE68A" font-family="Consolas, Menlo, monospace" font-size="13">tool write_file denied: run with --apply</text>
35
+ <rect x="332" y="364" width="492" height="42" rx="10" fill="#111827"/>
36
+ <text x="354" y="390" fill="#C4B5FD" font-family="Consolas, Menlo, monospace" font-size="13">final review the proposed patch before commit</text>
37
+ <rect x="56" y="456" width="808" height="1" fill="#334155"/>
38
+ <text x="56" y="476" fill="#64748B" font-family="Consolas, Menlo, monospace" font-size="12">local model, visible tools, explicit permissions</text>
39
+ </svg>
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@jx-grxf/patchpilot",
3
+ "version": "0.2.0",
4
+ "private": false,
5
+ "description": "Local-first coding agent TUI for visible, permissioned repo changes.",
6
+ "type": "module",
7
+ "bin": {
8
+ "patchpilot": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ ".env.example",
13
+ "docs/showcase/patchpilot-showcase.svg",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/jx-grxf/PatchPilot.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/jx-grxf/PatchPilot/issues"
26
+ },
27
+ "homepage": "https://github.com/jx-grxf/PatchPilot#readme",
28
+ "scripts": {
29
+ "dev": "tsx src/cli.tsx",
30
+ "build": "tsc",
31
+ "prepack": "npm run build",
32
+ "prepublishOnly": "npm run typecheck && npm test && npm run build && npm audit --omit=dev --audit-level=moderate && npm pack --dry-run",
33
+ "start": "node dist/cli.js",
34
+ "test": "vitest run",
35
+ "typecheck": "tsc --noEmit"
36
+ },
37
+ "keywords": [
38
+ "ollama",
39
+ "agent",
40
+ "tui",
41
+ "coding-agent",
42
+ "local-ai"
43
+ ],
44
+ "author": "Johannes Grof",
45
+ "license": "MIT",
46
+ "dependencies": {
47
+ "commander": "^14.0.3",
48
+ "ink": "^7.0.1",
49
+ "ink-text-input": "^6.0.0",
50
+ "react": "^19.2.1",
51
+ "zod": "^4.3.6"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^24.10.0",
55
+ "@types/react": "^19.2.6",
56
+ "tsx": "^4.21.0",
57
+ "typescript": "^5.9.3",
58
+ "vitest": "^4.1.5"
59
+ },
60
+ "engines": {
61
+ "node": ">=22"
62
+ }
63
+ }