@kkelly-offical/kkcode 0.1.2 → 0.1.6

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 (58) hide show
  1. package/README.md +120 -178
  2. package/package.json +46 -46
  3. package/src/agent/agent.mjs +41 -0
  4. package/src/agent/prompt/frontend-designer.txt +58 -0
  5. package/src/agent/prompt/longagent-blueprint-agent.txt +83 -0
  6. package/src/agent/prompt/longagent-coding-agent.txt +37 -0
  7. package/src/agent/prompt/longagent-debugging-agent.txt +46 -0
  8. package/src/agent/prompt/longagent-preview-agent.txt +63 -0
  9. package/src/config/defaults.mjs +260 -195
  10. package/src/config/schema.mjs +71 -6
  11. package/src/core/constants.mjs +91 -46
  12. package/src/index.mjs +1 -1
  13. package/src/knowledge/frontend-aesthetics.txt +39 -0
  14. package/src/knowledge/loader.mjs +2 -1
  15. package/src/knowledge/tailwind.txt +12 -3
  16. package/src/mcp/client-http.mjs +141 -157
  17. package/src/mcp/client-sse.mjs +288 -286
  18. package/src/mcp/client-stdio.mjs +533 -451
  19. package/src/mcp/constants.mjs +2 -0
  20. package/src/mcp/registry.mjs +479 -394
  21. package/src/mcp/stdio-framing.mjs +133 -127
  22. package/src/mcp/tool-result.mjs +24 -0
  23. package/src/observability/index.mjs +42 -0
  24. package/src/observability/metrics.mjs +137 -0
  25. package/src/observability/tracer.mjs +137 -0
  26. package/src/orchestration/background-manager.mjs +372 -358
  27. package/src/orchestration/background-worker.mjs +305 -245
  28. package/src/orchestration/longagent-manager.mjs +171 -116
  29. package/src/orchestration/stage-scheduler.mjs +728 -489
  30. package/src/permission/exec-policy.mjs +9 -11
  31. package/src/provider/anthropic.mjs +1 -0
  32. package/src/provider/openai.mjs +340 -339
  33. package/src/provider/retry-policy.mjs +68 -68
  34. package/src/provider/router.mjs +241 -228
  35. package/src/provider/sse.mjs +104 -91
  36. package/src/repl.mjs +1 -1
  37. package/src/session/checkpoint.mjs +66 -3
  38. package/src/session/engine.mjs +227 -225
  39. package/src/session/longagent-4stage.mjs +460 -0
  40. package/src/session/longagent-hybrid.mjs +1081 -0
  41. package/src/session/longagent-plan.mjs +365 -329
  42. package/src/session/longagent-project-memory.mjs +53 -0
  43. package/src/session/longagent-scaffold.mjs +291 -100
  44. package/src/session/longagent-task-bus.mjs +54 -0
  45. package/src/session/longagent-utils.mjs +472 -0
  46. package/src/session/longagent.mjs +884 -1462
  47. package/src/session/project-context.mjs +30 -0
  48. package/src/session/store.mjs +510 -503
  49. package/src/session/task-validator.mjs +4 -3
  50. package/src/skill/builtin/design.mjs +76 -0
  51. package/src/skill/builtin/frontend.mjs +8 -0
  52. package/src/skill/registry.mjs +390 -336
  53. package/src/storage/ghost-commit-store.mjs +18 -8
  54. package/src/tool/executor.mjs +11 -0
  55. package/src/tool/git-auto.mjs +0 -19
  56. package/src/tool/registry.mjs +71 -37
  57. package/src/ui/activity-renderer.mjs +664 -410
  58. package/src/util/git.mjs +23 -0
@@ -79,6 +79,32 @@ function detectFeatures(allDeps) {
79
79
  return features
80
80
  }
81
81
 
82
+ /** Detect CSS framework used in the project */
83
+ function detectCssFramework(allDeps) {
84
+ if (allDeps.tailwindcss) return "tailwind"
85
+ if (allDeps.unocss || allDeps["@unocss/core"]) return "unocss"
86
+ if (allDeps["styled-components"]) return "styled-components"
87
+ if (allDeps["@emotion/react"]) return "emotion"
88
+ if (allDeps.sass || allDeps["sass-loader"]) return "sass"
89
+ return null
90
+ }
91
+
92
+ /** Detect UI component library */
93
+ function detectComponentLib(allDeps) {
94
+ if (allDeps["@shadcn/ui"] || allDeps["shadcn-ui"]) return "shadcn/ui"
95
+ if (allDeps["antd"]) return "antd"
96
+ if (allDeps["element-plus"]) return "element-plus"
97
+ if (allDeps["@mui/material"]) return "mui"
98
+ if (allDeps["@chakra-ui/react"]) return "chakra-ui"
99
+ if (allDeps["@radix-ui/react-dialog"] || allDeps["@radix-ui/themes"]) return "radix"
100
+ if (allDeps["@headlessui/react"]) return "headless-ui"
101
+ if (allDeps["@mantine/core"]) return "mantine"
102
+ if (allDeps["naive-ui"]) return "naive-ui"
103
+ if (allDeps["vuetify"]) return "vuetify"
104
+ if (allDeps["@arco-design/web-react"] || allDeps["@arco-design/web-vue"]) return "arco-design"
105
+ return null
106
+ }
107
+
82
108
  async function detectStructure(cwd) {
83
109
  const dirs = []
84
110
  try {
@@ -341,6 +367,10 @@ export async function detectProjectContext(cwd) {
341
367
  if (structure.length) lines.push(` structure: ${structure.join(", ")}`)
342
368
  if (projectType) lines.push(` type: ${projectType}`)
343
369
  if (features.length) lines.push(` features: ${features.join(", ")}`)
370
+ const cssFramework = detectCssFramework(allDeps)
371
+ if (cssFramework) lines.push(` css_framework: ${cssFramework}`)
372
+ const componentLib = detectComponentLib(allDeps)
373
+ if (componentLib) lines.push(` component_lib: ${componentLib}`)
344
374
  const hasDocker = await exists(path.join(cwd, "Dockerfile"))
345
375
  if (hasDocker) lines.push(` docker: true`)
346
376
  lines.push("</project>")