ndomo 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.
Files changed (247) hide show
  1. package/.bun-version +1 -0
  2. package/.dockerignore +79 -0
  3. package/.editorconfig +18 -0
  4. package/.env.example +19 -0
  5. package/.github/CODEOWNERS +8 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.yml +62 -0
  7. package/.github/ISSUE_TEMPLATE/config.yml +2 -0
  8. package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
  9. package/.github/dependabot.yml +36 -0
  10. package/.github/pull_request_template.md +24 -0
  11. package/.github/release.yml +30 -0
  12. package/.github/workflows/gitleaks.yml +28 -0
  13. package/.github/workflows/release-please.yml +27 -0
  14. package/.github/workflows/smoke.yml +29 -0
  15. package/.husky/commit-msg +1 -0
  16. package/CHANGELOG.md +114 -0
  17. package/Dockerfile +32 -0
  18. package/README.es.md +174 -0
  19. package/README.md +187 -0
  20. package/agents/chronicler.md +98 -0
  21. package/agents/ci-smith.md +136 -0
  22. package/agents/craftsman.md +341 -0
  23. package/agents/deploy-smith.md +138 -0
  24. package/agents/foreman.md +377 -0
  25. package/agents/go-smith.md +164 -0
  26. package/agents/guild.md +188 -0
  27. package/agents/inspector.md +83 -0
  28. package/agents/js-smith.md +127 -0
  29. package/agents/ops-scout.md +173 -0
  30. package/agents/painter.md +200 -0
  31. package/agents/python-smith.md +120 -0
  32. package/agents/ranger.md +307 -0
  33. package/agents/release-smith.md +165 -0
  34. package/agents/rust-smith.md +159 -0
  35. package/agents/sage.md +178 -0
  36. package/agents/scout.md +144 -0
  37. package/agents/scribe.md +156 -0
  38. package/agents/smith.md +201 -0
  39. package/agents/vue-smith.md +155 -0
  40. package/agents/warden.md +216 -0
  41. package/agents/zig-smith.md +156 -0
  42. package/bin/ndomo-analyses.ts +4 -0
  43. package/bin/ndomo-status.ts +4 -0
  44. package/biome.json +57 -0
  45. package/bun.lock +514 -0
  46. package/commitlint.config.js +3 -0
  47. package/config/ndomo.config.json +258 -0
  48. package/config/ndomo.schema.json +166 -0
  49. package/docs/agents.md +375 -0
  50. package/docs/bugs/plan-create-orphan-fk.md +131 -0
  51. package/docs/bugs/task_create_batch-order-index-collision.md +158 -0
  52. package/docs/configuration.md +276 -0
  53. package/docs/database.md +364 -0
  54. package/docs/features/feature-flexible-builder-v1.md +724 -0
  55. package/docs/features/feature-flexible-builder-v2.md +882 -0
  56. package/docs/features/feature-flexible-builder.md +974 -0
  57. package/docs/http-server.md +244 -0
  58. package/docs/installation.md +259 -0
  59. package/docs/integrations.md +129 -0
  60. package/docs/operations/anti-pattern-sub-agent-verify-2026-06-21.md +32 -0
  61. package/docs/operations/audit-v1.md +417 -0
  62. package/docs/operations/audit-v2.md +197 -0
  63. package/docs/operations/audit-v3.md +306 -0
  64. package/docs/operations/db-optimize-foundations.md +123 -0
  65. package/docs/operations/verify-gate-architecture.md +82 -0
  66. package/docs/workflows.md +448 -0
  67. package/opencode.json +5 -0
  68. package/package.json +65 -0
  69. package/release-please-config.json +11 -0
  70. package/scripts/dev-bust-cache.sh +164 -0
  71. package/scripts/install.sh +688 -0
  72. package/scripts/smoke-e2e.ts +704 -0
  73. package/scripts/smoke-hot.ts +417 -0
  74. package/scripts/smoke-http.sh +228 -0
  75. package/scripts/smoke-v4.ts +256 -0
  76. package/scripts/smoke-v5.ts +397 -0
  77. package/scripts/smoke.sh +9 -0
  78. package/scripts/uninstall.sh +224 -0
  79. package/skills/api-security-best-practices/SKILL.md +915 -0
  80. package/skills/bash-scripting/SKILL.md +201 -0
  81. package/skills/bun/SKILL.md +313 -0
  82. package/skills/cavecrew/SKILL.md +82 -0
  83. package/skills/caveman/SKILL.md +74 -0
  84. package/skills/caveman-review/README.md +33 -0
  85. package/skills/caveman-review/SKILL.md +55 -0
  86. package/skills/find-skills/SKILL.md +142 -0
  87. package/skills/frontend-design/LICENSE.txt +177 -0
  88. package/skills/frontend-design/SKILL.md +55 -0
  89. package/skills/golang-patterns/SKILL.md +674 -0
  90. package/skills/golang-security/SKILL.md +185 -0
  91. package/skills/golang-security/evals/evals.json +595 -0
  92. package/skills/golang-security/references/architecture.md +268 -0
  93. package/skills/golang-security/references/checklist.md +80 -0
  94. package/skills/golang-security/references/cookies.md +200 -0
  95. package/skills/golang-security/references/cryptography.md +424 -0
  96. package/skills/golang-security/references/filesystem.md +285 -0
  97. package/skills/golang-security/references/injection.md +315 -0
  98. package/skills/golang-security/references/logging.md +163 -0
  99. package/skills/golang-security/references/memory-safety.md +241 -0
  100. package/skills/golang-security/references/network.md +253 -0
  101. package/skills/golang-security/references/secrets.md +189 -0
  102. package/skills/golang-security/references/third-party.md +159 -0
  103. package/skills/golang-security/references/threat-modeling.md +189 -0
  104. package/skills/golang-testing/SKILL.md +720 -0
  105. package/skills/grill-me/SKILL.md +7 -0
  106. package/skills/javascript-testing-patterns/SKILL.md +537 -0
  107. package/skills/javascript-testing-patterns/references/advanced-testing-patterns.md +513 -0
  108. package/skills/modern-javascript-patterns/SKILL.md +43 -0
  109. package/skills/modern-javascript-patterns/references/advanced-patterns.md +487 -0
  110. package/skills/modern-javascript-patterns/references/details.md +457 -0
  111. package/skills/python-anti-patterns/SKILL.md +349 -0
  112. package/skills/python-design-patterns/SKILL.md +85 -0
  113. package/skills/python-design-patterns/references/details.md +353 -0
  114. package/skills/python-error-handling/SKILL.md +193 -0
  115. package/skills/python-error-handling/references/details.md +171 -0
  116. package/skills/python-testing-patterns/SKILL.md +278 -0
  117. package/skills/python-testing-patterns/references/advanced-patterns.md +411 -0
  118. package/skills/python-testing-patterns/references/details.md +349 -0
  119. package/skills/rust-patterns/SKILL.md +500 -0
  120. package/skills/rust-testing/SKILL.md +501 -0
  121. package/skills/security-review/SKILL.md +504 -0
  122. package/skills/security-review/cloud-infrastructure-security.md +361 -0
  123. package/skills/vue-best-practices/SKILL.md +154 -0
  124. package/skills/vue-best-practices/references/animation-class-based-technique.md +254 -0
  125. package/skills/vue-best-practices/references/animation-state-driven-technique.md +291 -0
  126. package/skills/vue-best-practices/references/component-async.md +97 -0
  127. package/skills/vue-best-practices/references/component-data-flow.md +307 -0
  128. package/skills/vue-best-practices/references/component-fallthrough-attrs.md +174 -0
  129. package/skills/vue-best-practices/references/component-keep-alive.md +137 -0
  130. package/skills/vue-best-practices/references/component-slots.md +216 -0
  131. package/skills/vue-best-practices/references/component-suspense.md +228 -0
  132. package/skills/vue-best-practices/references/component-teleport.md +108 -0
  133. package/skills/vue-best-practices/references/component-transition-group.md +128 -0
  134. package/skills/vue-best-practices/references/component-transition.md +125 -0
  135. package/skills/vue-best-practices/references/composables.md +290 -0
  136. package/skills/vue-best-practices/references/directives.md +162 -0
  137. package/skills/vue-best-practices/references/perf-avoid-component-abstraction-in-lists.md +159 -0
  138. package/skills/vue-best-practices/references/perf-v-once-v-memo-directives.md +182 -0
  139. package/skills/vue-best-practices/references/perf-virtualize-large-lists.md +187 -0
  140. package/skills/vue-best-practices/references/plugins.md +166 -0
  141. package/skills/vue-best-practices/references/reactivity.md +344 -0
  142. package/skills/vue-best-practices/references/render-functions.md +201 -0
  143. package/skills/vue-best-practices/references/sfc.md +310 -0
  144. package/skills/vue-best-practices/references/state-management.md +135 -0
  145. package/skills/vue-best-practices/references/updated-hook-performance.md +187 -0
  146. package/skills/vue-pinia-best-practices/SKILL.md +21 -0
  147. package/skills/vue-pinia-best-practices/reference/pinia-no-active-pinia-error.md +248 -0
  148. package/skills/vue-pinia-best-practices/reference/pinia-setup-store-return-all-state.md +227 -0
  149. package/skills/vue-pinia-best-practices/reference/pinia-store-destructuring-breaks-reactivity.md +193 -0
  150. package/skills/vue-pinia-best-practices/reference/state-url-for-ephemeral-filters.md +238 -0
  151. package/skills/vue-pinia-best-practices/reference/state-use-pinia-for-large-apps.md +262 -0
  152. package/skills/vue-pinia-best-practices/reference/store-method-binding-parentheses.md +191 -0
  153. package/skills/zig-0.16/SKILL.md +840 -0
  154. package/skills/zig-0.16/scripts/check-zig-version.sh +21 -0
  155. package/src/cli/analyses.ts +280 -0
  156. package/src/cli/index.ts +108 -0
  157. package/src/cli/serve.ts +192 -0
  158. package/src/cli/smoke.ts +131 -0
  159. package/src/cli/status.test.ts +204 -0
  160. package/src/cli/status.ts +263 -0
  161. package/src/cli/vacuum.test.ts +82 -0
  162. package/src/cli/vacuum.ts +96 -0
  163. package/src/config/schema.test.ts +88 -0
  164. package/src/config/schema.ts +64 -0
  165. package/src/db/analyses-migration.test.ts +210 -0
  166. package/src/db/analyses.test.ts +466 -0
  167. package/src/db/analyses.ts +375 -0
  168. package/src/db/auto-checkpoint.ts +131 -0
  169. package/src/db/client.test.ts +129 -0
  170. package/src/db/client.ts +55 -0
  171. package/src/db/fts-escape.ts +20 -0
  172. package/src/db/incidents.test.ts +201 -0
  173. package/src/db/incidents.ts +93 -0
  174. package/src/db/index.ts +86 -0
  175. package/src/db/migrations-v13.test.ts +141 -0
  176. package/src/db/migrations-v8.test.ts +301 -0
  177. package/src/db/migrations.ts +147 -0
  178. package/src/db/plan-archive.test.ts +180 -0
  179. package/src/db/plan-archive.ts +274 -0
  180. package/src/db/plan-create.test.ts +276 -0
  181. package/src/db/plan-create.ts +78 -0
  182. package/src/db/plan-files.test.ts +289 -0
  183. package/src/db/plan-update-status.ts +287 -0
  184. package/src/db/plans.test.ts +490 -0
  185. package/src/db/plans.ts +534 -0
  186. package/src/db/resolve-project-dir.test.ts +143 -0
  187. package/src/db/resolve-project-dir.ts +75 -0
  188. package/src/db/rollbacks.test.ts +150 -0
  189. package/src/db/rollbacks.ts +67 -0
  190. package/src/db/schema.ts +907 -0
  191. package/src/db/sessions.test.ts +80 -0
  192. package/src/db/sessions.ts +135 -0
  193. package/src/db/shutdown.test.ts +147 -0
  194. package/src/db/shutdown.ts +45 -0
  195. package/src/db/tasks.test.ts +921 -0
  196. package/src/db/tasks.ts +747 -0
  197. package/src/db/types.ts +619 -0
  198. package/src/http/__tests__/auth.test.ts +196 -0
  199. package/src/http/__tests__/routes.test.ts +465 -0
  200. package/src/http/__tests__/sse.test.ts +317 -0
  201. package/src/http/auth.ts +72 -0
  202. package/src/http/middleware/cors.ts +53 -0
  203. package/src/http/middleware/security-headers.ts +21 -0
  204. package/src/http/routes/events.ts +112 -0
  205. package/src/http/routes/health.ts +51 -0
  206. package/src/http/routes/plans.ts +66 -0
  207. package/src/http/routes/sessions.ts +50 -0
  208. package/src/http/routes/tasks.ts +60 -0
  209. package/src/http/server.ts +95 -0
  210. package/src/http/sse.ts +116 -0
  211. package/src/index.ts +37 -0
  212. package/src/lib.ts +65 -0
  213. package/src/mem/scoped.ts +65 -0
  214. package/src/orchestrator/background.test.ts +268 -0
  215. package/src/orchestrator/background.ts +293 -0
  216. package/src/orchestrator/memory-hook.ts +182 -0
  217. package/src/orchestrator/reconciler.ts +123 -0
  218. package/src/orchestrator/scheduler.test.ts +300 -0
  219. package/src/orchestrator/scheduler.ts +243 -0
  220. package/src/plugin.test.ts +2574 -0
  221. package/src/plugin.ts +1690 -0
  222. package/src/sdk/client.ts +66 -0
  223. package/src/worktrees/manager.ts +236 -0
  224. package/src/worktrees/state.ts +87 -0
  225. package/tests/integration/ranger-flow.test.ts +257 -0
  226. package/tools/analysis_archive.ts +28 -0
  227. package/tools/analysis_create.ts +55 -0
  228. package/tools/analysis_get.ts +33 -0
  229. package/tools/analysis_link_plan.ts +44 -0
  230. package/tools/analysis_list.ts +48 -0
  231. package/tools/analysis_search.ts +36 -0
  232. package/tools/analysis_update.ts +44 -0
  233. package/tools/plan_approve.ts +31 -0
  234. package/tools/plan_create.ts +58 -0
  235. package/tools/plan_get.ts +40 -0
  236. package/tools/plan_list.ts +37 -0
  237. package/tools/plan_search.ts +34 -0
  238. package/tools/plan_update_status.ts +71 -0
  239. package/tools/session_checkpoint.ts +31 -0
  240. package/tools/session_end.ts +26 -0
  241. package/tools/session_start.ts +43 -0
  242. package/tools/task_create_batch.ts +70 -0
  243. package/tools/task_list.ts +35 -0
  244. package/tools/task_next_for_agent.ts +30 -0
  245. package/tools/task_search.ts +34 -0
  246. package/tools/task_update_status.ts +37 -0
  247. package/tsconfig.json +31 -0
package/.bun-version ADDED
@@ -0,0 +1 @@
1
+ 1.3.14
package/.dockerignore ADDED
@@ -0,0 +1,79 @@
1
+ # VCS
2
+ .git/
3
+ .gitignore
4
+
5
+ # Dependencies (regenerated in image)
6
+ node_modules/
7
+ .pnp/
8
+ .pnp.js
9
+ .yarn/
10
+
11
+ # Build output
12
+ dist/
13
+ build/
14
+ out/
15
+ *.tsbuildinfo
16
+
17
+ # OpenCode / ndomo runtime state
18
+ .slim/
19
+ .worktrees/
20
+ .ndomo/
21
+ .opencode/
22
+ .opencode-mem/
23
+
24
+ # DCP data
25
+ .dcp/
26
+ dcp-prompts/
27
+
28
+ # Databases — never bake into image
29
+ *.sqlite
30
+ *.sqlite-journal
31
+ *.sqlite-shm
32
+ *.sqlite-wal
33
+
34
+ # Environment / secrets — NEVER bake into image
35
+ .env
36
+ .env.*
37
+ .env.local
38
+ .env.*.local
39
+
40
+ # Logs
41
+ *.log
42
+ npm-debug.log*
43
+ yarn-debug.log*
44
+ yarn-error.log*
45
+ logs/
46
+
47
+ # Coverage
48
+ coverage/
49
+ .nyc_output/
50
+
51
+ # OS artifacts
52
+ .DS_Store
53
+ Thumbs.db
54
+
55
+ # Editor
56
+ .idea/
57
+ .vscode/
58
+ *.swp
59
+ *.swo
60
+
61
+ # Documentation (not needed at runtime)
62
+ docs/
63
+ CHANGELOG.md
64
+ README.md
65
+ README.es.md
66
+
67
+ # Test files (not needed at runtime)
68
+ *.test.ts
69
+ *.test.js
70
+
71
+ # Miscellaneous
72
+ *.tgz
73
+ .cache/
74
+ .agents/
75
+ skills-lock.json
76
+
77
+ # Docker metadata (not needed in image)
78
+ Dockerfile
79
+ .dockerignore
package/.editorconfig ADDED
@@ -0,0 +1,18 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
13
+
14
+ [*.{yml,yaml}]
15
+ indent_size = 2
16
+
17
+ [Makefile]
18
+ indent_style = tab
package/.env.example ADDED
@@ -0,0 +1,19 @@
1
+ # ndomo HTTP Server Configuration (Phase 1)
2
+ # All settings have sensible defaults — only OPENCODE_SERVER_PASSWORD is required when auth is enabled.
3
+
4
+ # Enable/disable the HTTP server (default: false)
5
+ NDOMO_HTTP_ENABLED=false
6
+
7
+ # HTTP server port (default: 4097, avoids conflict with OpenCode default 4096)
8
+ NDOMO_HTTP_PORT=4097
9
+
10
+ # CORS origins (comma-separated, default: * in dev, empty in prod)
11
+ # Example: http://localhost:3000,https://dashboard.example.com
12
+ NDOMO_HTTP_CORS_ORIGINS=*
13
+
14
+ # HTTP Basic Auth password (required when http.auth.required=true)
15
+ # If not set and auth.required=true, server returns 503 on startup
16
+ OPENCODE_SERVER_PASSWORD=
17
+
18
+ # OpenCode server URL for SDK client (default: http://localhost:4096)
19
+ OPENCODE_SERVER_URL=http://localhost:4096
@@ -0,0 +1,8 @@
1
+ # Default owners for everything in the repo
2
+ * @nicosup98
3
+
4
+ # CI/CD workflows and automation
5
+ .github/ @nicosup98
6
+
7
+ # Package and build configuration
8
+ package.json @nicosup98
@@ -0,0 +1,62 @@
1
+ name: Bug Report
2
+ description: Report a bug in ndomo
3
+ title: "[bug]: "
4
+ labels: [bug]
5
+ body:
6
+ - type: textarea
7
+ id: description
8
+ attributes:
9
+ label: Description
10
+ description: What went wrong?
11
+ placeholder: A clear description of the bug.
12
+ validations:
13
+ required: true
14
+ - type: textarea
15
+ id: steps
16
+ attributes:
17
+ label: Steps to reproduce
18
+ description: How can we reproduce the issue?
19
+ placeholder: |
20
+ 1.
21
+ 2.
22
+ 3.
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: expected
27
+ attributes:
28
+ label: Expected behavior
29
+ description: What should have happened?
30
+ validations:
31
+ required: true
32
+ - type: textarea
33
+ id: actual
34
+ attributes:
35
+ label: Actual behavior
36
+ description: What actually happened?
37
+ validations:
38
+ required: true
39
+ - type: input
40
+ id: os
41
+ attributes:
42
+ label: OS
43
+ description: What operating system are you using?
44
+ placeholder: e.g. Ubuntu 24.04, macOS 14
45
+ validations:
46
+ required: true
47
+ - type: input
48
+ id: bun-version
49
+ attributes:
50
+ label: Bun version
51
+ description: What bun version are you using? (run `bun --version`)
52
+ placeholder: e.g. 1.3.14
53
+ validations:
54
+ required: true
55
+ - type: input
56
+ id: ndomo-version
57
+ attributes:
58
+ label: ndomo version
59
+ description: What ndomo version are you using?
60
+ placeholder: e.g. 0.1.0
61
+ validations:
62
+ required: false
@@ -0,0 +1,2 @@
1
+ blank_issues_enabled: true
2
+ contact_links: []
@@ -0,0 +1,34 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature for ndomo
3
+ title: "[feature]: "
4
+ labels: [enhancement]
5
+ body:
6
+ - type: textarea
7
+ id: description
8
+ attributes:
9
+ label: Description
10
+ description: What feature do you want?
11
+ placeholder: A clear description of the feature.
12
+ validations:
13
+ required: true
14
+ - type: textarea
15
+ id: problem
16
+ attributes:
17
+ label: Problem it solves
18
+ description: What problem does this solve that isn't possible today?
19
+ validations:
20
+ required: true
21
+ - type: textarea
22
+ id: solution
23
+ attributes:
24
+ label: Proposed solution
25
+ description: How would you implement this?
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ id: alternatives
30
+ attributes:
31
+ label: Alternatives considered
32
+ description: What other approaches did you think about?
33
+ validations:
34
+ required: false
@@ -0,0 +1,36 @@
1
+ # .github/dependabot.yml
2
+ # Dependabot config: weekly auto-PRs for npm + github-actions
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "npm"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "weekly"
9
+ day: "monday"
10
+ open-pull-requests-limit: 5
11
+ labels:
12
+ - "dependencies"
13
+ groups:
14
+ production:
15
+ applies-to: version-updates
16
+ dependency-type: "production"
17
+ development:
18
+ applies-to: version-updates
19
+ dependency-type: "development"
20
+ commit-message:
21
+ prefix: "chore(deps)"
22
+
23
+ - package-ecosystem: "github-actions"
24
+ directory: "/"
25
+ schedule:
26
+ interval: "weekly"
27
+ day: "monday"
28
+ open-pull-requests-limit: 3
29
+ labels:
30
+ - "dependencies"
31
+ - "ci"
32
+ commit-message:
33
+ prefix: "ci(actions)"
34
+ # Auto-merge patch updates for actions (they're already SHA-pinned,
35
+ # so updates only happen when we bump SHAs intentionally)
36
+ automerge: false # keep manual review
@@ -0,0 +1,24 @@
1
+ ## Description
2
+
3
+ <!-- What does this PR do? Why is this change needed? -->
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix
8
+ - [ ] Feature
9
+ - [ ] Breaking change
10
+ - [ ] Documentation
11
+ - [ ] Refactor
12
+ - [ ] Chore (maintenance, deps, CI)
13
+
14
+ ## Checklist
15
+
16
+ - [ ] Tests added/updated (if applicable)
17
+ - [ ] Lint passes
18
+ - [ ] Typecheck passes
19
+ - [ ] Smoke test passes
20
+ - [ ] Docs updated (if needed)
21
+
22
+ ## Related issue
23
+
24
+ <!-- Closes #N or "No related issue" -->
@@ -0,0 +1,30 @@
1
+ # Configures GitHub release notes auto-generation
2
+ # See: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3
+ changelog:
4
+ exclude:
5
+ labels:
6
+ - ignore-for-release
7
+ - duplicate
8
+ - invalid
9
+ categorize:
10
+ - title: Breaking Changes
11
+ labels:
12
+ - breaking-change
13
+ - breaking
14
+ - title: 🚀 Features
15
+ labels:
16
+ - enhancement
17
+ - feature
18
+ - title: 🐛 Bug Fixes
19
+ labels:
20
+ - bug
21
+ - fix
22
+ - title: 📚 Documentation
23
+ labels:
24
+ - documentation
25
+ - docs
26
+ - title: 🔧 Maintenance
27
+ labels:
28
+ - chore
29
+ - dependencies
30
+ - ci
@@ -0,0 +1,28 @@
1
+ # .github/workflows/gitleaks.yml
2
+ # Secret scanning via gitleaks
3
+ name: gitleaks
4
+
5
+ on:
6
+ push:
7
+ branches: [main, develop]
8
+ pull_request:
9
+ branches: [main, develop]
10
+
11
+ permissions:
12
+ contents: read
13
+ pull-requests: read
14
+
15
+ jobs:
16
+ scan:
17
+ name: gitleaks scan
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Checkout
21
+ uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
22
+
23
+ - name: Run gitleaks
24
+ uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2
25
+ env:
26
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
+ GITLEAKS_ENABLE_UPLOAD_ARTIFACT: true
28
+ GITLEAKS_ENABLE_SUMMARY: true
@@ -0,0 +1,27 @@
1
+ # Copyright 2026 — ndomo-v2 contributors
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ # Release-please workflow — automated versioning + GitHub Releases
5
+ # Pinned to v5.0.0 commit SHA (audit MISSING-007 principle).
6
+ # See: https://github.com/googleapis/release-please-action
7
+
8
+ name: release-please
9
+
10
+ on:
11
+ push:
12
+ branches:
13
+ - main
14
+
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+
19
+ jobs:
20
+ release-please:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
24
+ with:
25
+ release-type: node
26
+ package-name: ndomo
27
+ config-file: release-please-config.json
@@ -0,0 +1,29 @@
1
+ name: smoke
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ smoke:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, ubuntu-24.04, macos-latest]
16
+ bun-version: ['1.3.14', 'latest']
17
+ steps:
18
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
19
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
20
+ with:
21
+ bun-version: ${{ matrix.bun-version }}
22
+ cache: true
23
+ - run: bun install
24
+ - name: Security audit (bun audit)
25
+ run: bun audit --audit-level=high
26
+ - run: bun run lint
27
+ - run: bun run typecheck
28
+ - run: bun test
29
+ - run: bun run test:smoke
@@ -0,0 +1 @@
1
+ bunx --no -- commitlint --edit ${1}
package/CHANGELOG.md ADDED
@@ -0,0 +1,114 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - **Ranger agent** — 4th primary agent (`mode: primary`, `model:
13
+ minimax/MiniMax-M3`, `temp: 0.3`) for analysis/cartography/onboarding
14
+ workflows. Read-write guard rails: `edit: deny` for source code,
15
+ `write: ask`, `bash: ask` with read-only allowlist. Delegates to
16
+ `scout` / `sage` / `scribe` for mapping and research.
17
+ - **`analyses` table + FTS5** — standalone SQLite table for persisted
18
+ research output (slug, title, project_path, summary, findings_json,
19
+ source_plan_id, agent, session_id, archived_at). External-content
20
+ FTS5 index over `title` + `summary` + `findings_json` with sync
21
+ triggers. Migration v14.
22
+ - **Analysis CRUD module** (`src/db/analyses.ts`) — `createAnalysis`,
23
+ `getAnalysis`, `getAnalysisBySlug`, `listAnalyses`, `searchAnalyses`
24
+ (FTS), `updateAnalysis`, `archiveAnalysis`, `linkAnalysisToPlan`,
25
+ `unlinkAnalysisFromPlan`. 40 unit tests covering FK validation,
26
+ FTS sync, soft-delete, and slug uniqueness.
27
+ - **7 analysis tools** registered in the OpenCode plugin:
28
+ `analysis_create`, `analysis_get`, `analysis_list`,
29
+ `analysis_search`, `analysis_update`, `analysis_archive`,
30
+ `analysis_link_plan`.
31
+ - **`ndomo-analyses` CLI** — `list` / `get` / `search` / `archive`
32
+ subcommands reading from the project-local `.ndomo/state.db`.
33
+ - **Integration test suite** (`tests/integration/ranger-flow.test.ts`)
34
+ — 13 end-to-end tests covering create→link→search→archive→unlink
35
+ flows and FK CASCADE behavior on plan deletion.
36
+
37
+ ### Changed
38
+
39
+ - Updated `docs/agents.md` from 21 agents (3 primaries) to 22 agents
40
+ (4 primaries), including cross-primary routing table for the new
41
+ ranger entry point.
42
+ - Routing tables in `foreman.md`, `craftsman.md`, and `warden.md`
43
+ now list ranger alongside the existing primary peers.
44
+
45
+ ### Fixed
46
+
47
+ - DB hygiene: enable WAL journal mode, NORMAL synchronous, INCREMENTAL
48
+ auto_vacuum to prevent unbounded `.ndomo/state.db` growth on long-running
49
+ installs. Sticky one-time migration per DB on first open after upgrade.
50
+ New `ndomo vacuum` CLI subcommand (or `bun run src/cli/vacuum.ts`) for
51
+ manual space reclaim via `PRAGMA incremental_vacuum` + `wal_checkpoint(TRUNCATE)`.
52
+ WAL sidecars (`*.db-wal`, `*.db-shm`) added to `.gitignore`.
53
+ - Shutdown cleanup: `src/db/shutdown.ts` now tracks every `openDb()` call in
54
+ a `Set<Database>` so each connection gets `SIGTERM`/`SIGINT`/`beforeExit`
55
+ cleanup. Replaces the module-level `registered` boolean that silently
56
+ skipped every call after the first (leaked file handles on hot-reload,
57
+ CLI tools alongside plugin, smoke tests).
58
+ - Background task retention: `BackgroundDispatcher.finalize(maxAgeMs)` prunes
59
+ terminal tasks (completed/failed/cancelled) older than the threshold; auto-
60
+ called from plugin init when row count exceeds `backgroundRetention.softCap`
61
+ (default 1000). Stops unbounded growth of `background_tasks` on long-running
62
+ installs.
63
+ - Write-tool lock leaks: replaced raw `Map<string, string>` for active writes
64
+ with a `FileLock` class that stamps each entry with `setAt` and prunes stale
65
+ locks via TTL sweep. SDK hook-chain breaks (where `tool.execute.after` never
66
+ fires) no longer block subsequent writes indefinitely. Admin tool
67
+ `ndomo_write_unlock` exposed for manual recovery.
68
+
69
+ ## [0.1.0] - 2026-06-20
70
+
71
+ ### Added
72
+
73
+ - Initial ndomo orchestrator: `routeTask`, `canRunParallel`, and reconciler
74
+ primitives for multi-agent task dispatch and lifecycle management
75
+ - Multi-agent fleet: `foreman` and `craftsman` primaries plus 19 specialist
76
+ subagents (scout, scribe, painter, smith, sage, guild, inspector,
77
+ chronicler, stack-smiths, and warden ops fleet)
78
+ - OpenCode plugin layer with hooks, custom tools, hot-swap support, and
79
+ frontmatter sync for agent and skill metadata
80
+ - DB module: SQLite-backed plans, tasks, and sessions tables with FTS5 search,
81
+ migrations v1 through v11, and dual plan system (global state.db +
82
+ per-project archive)
83
+ - Memory system integration with `opencode-mem` including scoped tags,
84
+ cross-project retrieval, and project-scoped instincts to prevent
85
+ cross-project contamination
86
+ - Worktree management under `.slim/worktrees/` for parallel, isolated coding
87
+ lanes
88
+ - Flexible builder pipeline (v2 + v3-lows) and `craftsman` primary agent with
89
+ plan_db audit trail and pre-merge critical fixes
90
+ - Curl-based install script with provider picker (ndomo vs stock OpenCode)
91
+ - `reasoning_effort` configuration and bundled skills directory for offline
92
+ distribution
93
+ - `state.db` CLI with 14 tools and 5 migrations covering plan/task/session
94
+ CRUD, FTS search, and checkpoint helpers
95
+
96
+ ### Changed
97
+
98
+ - Biome-formatted source tree across all TypeScript modules
99
+ - Documentation refresh covering DB module, flexible builder primary, and
100
+ ad-hoc flow spec
101
+
102
+ ### Fixed
103
+
104
+ - Per-project plan archive: drop the global `~/.ndomo/mem/plans` default in
105
+ favor of project-local storage
106
+ - Scoped session foreign-key upsert (Issue #1 hybrid) so session rows respect
107
+ plan scoping rules
108
+ - DB query layer: `getPlan`, `getPlanBySlug`, and `listPlans` now JOIN with
109
+ `plan_files` so file links ship with every plan read
110
+ - Seven medium-priority `craftsman` fixes shipped alongside the Bun skill
111
+ bootstrap for the `js-smith` specialist
112
+
113
+ [Unreleased]: https://github.com/nicosup98/ndomo-v2/compare/v0.1.0...HEAD
114
+ [0.1.0]: https://github.com/nicosup98/ndomo-v2/releases/tag/v0.1.0
package/Dockerfile ADDED
@@ -0,0 +1,32 @@
1
+ # ndomo — OpenCode multi-agent plugin container image
2
+ # Entry point: bun run src/index.ts
3
+ # Base image pinned to bun version from .bun-version (never use `latest`).
4
+ # Multi-stage build keeps final image lean (distroless, no shell).
5
+
6
+ # ---- Stage 1: Install dependencies ----
7
+ FROM oven/bun:1.3.14-distroless AS deps
8
+ WORKDIR /app
9
+
10
+ # Copy package manifests first for layer caching (deps only rebuild when manifests change)
11
+ COPY package.json bun.lock ./
12
+ RUN bun install --frozen-lockfile
13
+
14
+ # Copy application source, bundled assets, and configuration
15
+ COPY src/ ./src/
16
+ COPY skills/ ./skills/
17
+ COPY agents/ ./agents/
18
+ COPY config/ ./config/
19
+ COPY scripts/ ./scripts/
20
+ COPY bin/ ./bin/
21
+ COPY tools/ ./tools/
22
+ COPY opencode.json tsconfig.json biome.json ./
23
+
24
+ # ---- Stage 2: Runtime ----
25
+ FROM oven/bun:1.3.14-distroless
26
+ WORKDIR /app
27
+
28
+ COPY --from=deps /app /app
29
+
30
+ # Plugins are invoked by the OpenCode host; peer deps provided at runtime.
31
+ # JSON-array form avoids shell dependency (distroless has no shell).
32
+ ENTRYPOINT ["bun", "run", "src/index.ts"]