s-app-scoder-agent 0.5.0 → 0.7.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 (49) hide show
  1. package/.scoderrc.example.json +97 -0
  2. package/LICENSE +21 -21
  3. package/README.md +599 -435
  4. package/dist/agent.js +829 -168
  5. package/dist/agents.js +70 -0
  6. package/dist/compaction.js +114 -0
  7. package/dist/config.js +178 -12
  8. package/dist/context.js +119 -14
  9. package/dist/cost.js +56 -6
  10. package/dist/guardrails.js +409 -0
  11. package/dist/index.js +216 -45
  12. package/dist/json-schema.js +58 -0
  13. package/dist/llm.js +148 -11
  14. package/dist/mcp.js +397 -70
  15. package/dist/model-catalog.js +175 -0
  16. package/dist/permissions.js +328 -35
  17. package/dist/prompt-builder.js +47 -0
  18. package/dist/prompt.js +97 -0
  19. package/dist/provider-anthropic.js +113 -35
  20. package/dist/provider-registry.js +116 -0
  21. package/dist/retry.js +3 -2
  22. package/dist/sandbox.js +96 -0
  23. package/dist/server.js +28 -1
  24. package/dist/session.js +282 -11
  25. package/dist/shell-scanner.js +112 -0
  26. package/dist/skills.js +122 -0
  27. package/dist/snapshot.js +170 -0
  28. package/dist/steering.js +35 -0
  29. package/dist/tools.js +537 -24
  30. package/dist/tui/app.js +615 -0
  31. package/dist/tui/at-complete.js +93 -0
  32. package/dist/tui/chat-views.js +145 -0
  33. package/dist/tui/chrome.js +96 -0
  34. package/dist/tui/command-registry.js +189 -0
  35. package/dist/tui/commands.js +222 -0
  36. package/dist/tui/image.js +149 -0
  37. package/dist/tui/input.js +214 -0
  38. package/dist/tui/markdown.js +229 -0
  39. package/dist/tui/mouse.js +20 -0
  40. package/dist/tui/permission-modal.js +34 -0
  41. package/dist/tui/review.js +64 -0
  42. package/dist/tui/session-picker.js +68 -0
  43. package/dist/tui/sidebar.js +101 -0
  44. package/dist/tui/state.js +342 -0
  45. package/dist/tui/theme.js +90 -0
  46. package/dist/tui/vim.js +60 -0
  47. package/dist/ui.js +43 -3
  48. package/dist/watch.js +52 -0
  49. package/package.json +18 -5
package/dist/watch.js ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * M4: hot-reload — watch .scoderrc + .scoder/skills/ (fs.watch, debounce
3
+ * 500ms). onChange(kind) — Agent quyết định hành động (reload skills /
4
+ * restart MCP). Module thuần, không dependency.
5
+ */
6
+ import { watch, existsSync } from "node:fs";
7
+ import { join } from "node:path";
8
+ const DEBOUNCE_MS = 500;
9
+ /** Watch rc file + skills dir. Fire onChange(kind) debounced (giữa các burst). */
10
+ export function watchWorkdir(workdir, onChange) {
11
+ const watchers = [];
12
+ const timers = new Map();
13
+ const fire = (kind) => {
14
+ const t = timers.get(kind);
15
+ if (t)
16
+ clearTimeout(t);
17
+ timers.set(kind, setTimeout(() => {
18
+ timers.delete(kind);
19
+ onChange(kind);
20
+ }, DEBOUNCE_MS));
21
+ };
22
+ // .scoderrc (hoặc .scoderrc.json) — config changes.
23
+ for (const name of [".scoderrc.json", ".scoderrc"]) {
24
+ const p = join(workdir, name);
25
+ if (!existsSync(p))
26
+ continue;
27
+ try {
28
+ watchers.push(watch(p, () => fire("config")));
29
+ }
30
+ catch { /* race — file removed between existsSync and watch */ }
31
+ }
32
+ // .scoder/skills/ — skill files added/removed/edited.
33
+ const skillsDir = join(workdir, ".scoder", "skills");
34
+ if (existsSync(skillsDir)) {
35
+ try {
36
+ watchers.push(watch(skillsDir, { recursive: true }, () => fire("skills")));
37
+ }
38
+ catch { /* platform không hỗ trợ recursive (hiếm trên macOS/Windows OK) */ }
39
+ }
40
+ return {
41
+ close() {
42
+ for (const w of watchers) {
43
+ try {
44
+ w.close();
45
+ }
46
+ catch { /* already closed */ }
47
+ }
48
+ for (const t of timers.values())
49
+ clearTimeout(t);
50
+ },
51
+ };
52
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "s-app-scoder-agent",
3
- "version": "0.5.0",
4
- "description": "Autonomous coding agent CLI - similar to opencode/cline/claude. Runs tasks until build succeeds.",
3
+ "version": "0.7.0",
4
+ "description": "Autonomous coding agent CLI — writes, edits, and builds code autonomously until the project compiles without errors.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -10,17 +10,19 @@
10
10
  "scripts": {
11
11
  "build": "tsc",
12
12
  "prepare": "npm run build",
13
- "prepublishOnly": "npm run lint && npm run typecheck && npm test",
13
+ "prepublishOnly": "npm run lint && npm run typecheck",
14
14
  "start": "node dist/index.js",
15
15
  "dev": "tsc --watch",
16
16
  "typecheck": "tsc --noEmit",
17
17
  "lint": "eslint src/",
18
18
  "coverage": "npm run build && node --test --experimental-test-coverage test/*.test.mjs",
19
+ "eval": "node test/run-eval.mjs",
19
20
  "test": "npm run build && node --test test/*.test.mjs && node test/run-e2e.mjs && node test/run-mcp-test.mjs"
20
21
  },
21
22
  "engines": {
22
- "node": ">=18"
23
+ "node": ">=20"
23
24
  },
25
+ "author": "nbhson",
24
26
  "keywords": [
25
27
  "cli",
26
28
  "agent",
@@ -41,13 +43,24 @@
41
43
  "files": [
42
44
  "dist",
43
45
  "README.md",
44
- "LICENSE"
46
+ "LICENSE",
47
+ ".scoderrc.example.json"
45
48
  ],
46
49
  "devDependencies": {
47
50
  "@eslint/js": "^10.0.1",
48
51
  "@types/node": "^22.0.0",
52
+ "@types/react": "^19.3.0",
49
53
  "eslint": "^10.13.0",
50
54
  "typescript": "^5.6.0",
51
55
  "typescript-eslint": "^8.72.1"
56
+ },
57
+ "dependencies": {
58
+ "fuzzysort": "^3.1.0",
59
+ "gpt-tokenizer": "^4.1.0",
60
+ "ink": "^8.0.0",
61
+ "react": "^19.3.1",
62
+ "react-dom": "^19.3.1",
63
+ "tree-sitter": "^0.25.1",
64
+ "tree-sitter-bash": "^0.25.1"
52
65
  }
53
66
  }