aiwf 0.3.22 → 0.4.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 (456) hide show
  1. package/.claude-plugin/marketplace.json +146 -0
  2. package/CHANGELOG.md +49 -1
  3. package/README.ko.md +118 -309
  4. package/README.md +68 -254
  5. package/docs/modernization/BROWNFIELD-GREENFIELD.ko.md +105 -0
  6. package/docs/modernization/CLAUDE-PLAN-REVIEW-2026-10-03.ko.md +77 -0
  7. package/docs/modernization/CLI-PRODUCTIVITY-REVIEWED-2026-10-03.ko.md +177 -0
  8. package/docs/modernization/CLI-PRODUCTIVITY.ko.md +193 -0
  9. package/docs/modernization/CORE-PACKAGE-PLAN.md +7 -0
  10. package/docs/modernization/DEEP-REVERSE-ENGINEERING.ko.md +88 -0
  11. package/docs/modernization/DELEGATION-OPTIONAL.ko.md +57 -0
  12. package/docs/modernization/DIRECTION.ko.md +56 -0
  13. package/docs/modernization/FULL-TEST-2026-10-03.md +49 -0
  14. package/docs/modernization/LEGACY-REMOVAL-PLAN.md +9 -0
  15. package/docs/modernization/PILOT-RESULT-2026-10-03.ko.md +85 -0
  16. package/docs/modernization/PILOT-UC-001.ko.md +79 -0
  17. package/docs/modernization/PLAN.md +28 -0
  18. package/docs/modernization/SKILLS.ko.md +105 -0
  19. package/docs/modernization/SPRINTABLE.ko.md +47 -0
  20. package/docs/modernization/SYNC-DOCS-VALIDATION-2026-10-04.ko.md +38 -0
  21. package/docs/modernization/VALIDATION.md +79 -0
  22. package/docs/modernization/evidence/example-review-packet.json +115 -0
  23. package/docs/modernization/evidence/example-spec-pin.json +48 -0
  24. package/docs/modernization/evidence/full-test-20261003/claude-lint.md +22 -0
  25. package/docs/modernization/evidence/full-test-20261003/claude-review-retry.md +56 -0
  26. package/docs/modernization/evidence/full-test-20261003/codex-review-packet.json +159 -0
  27. package/docs/modernization/evidence/full-test-20261003/src/expense.mjs +40 -0
  28. package/docs/modernization/evidence/full-test-20261003/summary.json +106 -0
  29. package/docs/modernization/evidence/full-test-20261003/tests/expense.test.mjs +61 -0
  30. package/docs/modernization/evidence/local-pilot-20261003/README.ko.md +40 -0
  31. package/docs/modernization/evidence/local-pilot-20261003/execution.json +1055 -0
  32. package/docs/modernization/evidence/local-pilot-20261003/maintenance/dependencies.json +24 -0
  33. package/docs/modernization/evidence/local-pilot-20261003/maintenance/dependencies.stderr.txt +0 -0
  34. package/docs/modernization/evidence/local-pilot-20261003/maintenance/dependencies.stdout.txt +5 -0
  35. package/docs/modernization/evidence/local-pilot-20261003/maintenance/docs.json +24 -0
  36. package/docs/modernization/evidence/local-pilot-20261003/maintenance/docs.stderr.txt +0 -0
  37. package/docs/modernization/evidence/local-pilot-20261003/maintenance/docs.stdout.txt +6 -0
  38. package/docs/modernization/evidence/local-pilot-20261003/maintenance/example.json +24 -0
  39. package/docs/modernization/evidence/local-pilot-20261003/maintenance/example.stderr.txt +0 -0
  40. package/docs/modernization/evidence/local-pilot-20261003/maintenance/example.stdout.txt +5 -0
  41. package/docs/modernization/evidence/local-pilot-20261003/maintenance/local-docs.json +24 -0
  42. package/docs/modernization/evidence/local-pilot-20261003/maintenance/local-docs.stderr.txt +0 -0
  43. package/docs/modernization/evidence/local-pilot-20261003/maintenance/local-docs.stdout.txt +6 -0
  44. package/docs/modernization/evidence/local-pilot-20261003/maintenance/node.json +23 -0
  45. package/docs/modernization/evidence/local-pilot-20261003/maintenance/node.stderr.txt +0 -0
  46. package/docs/modernization/evidence/local-pilot-20261003/maintenance/node.stdout.txt +535 -0
  47. package/docs/modernization/evidence/local-pilot-20261003/maintenance/provenance.json +24 -0
  48. package/docs/modernization/evidence/local-pilot-20261003/maintenance/provenance.stderr.txt +0 -0
  49. package/docs/modernization/evidence/local-pilot-20261003/maintenance/provenance.stdout.txt +5 -0
  50. package/docs/modernization/evidence/local-pilot-20261003/maintenance/readme-replay.json +24 -0
  51. package/docs/modernization/evidence/local-pilot-20261003/maintenance/readme-replay.stderr.txt +0 -0
  52. package/docs/modernization/evidence/local-pilot-20261003/maintenance/readme-replay.stdout.txt +273 -0
  53. package/docs/modernization/evidence/local-pilot-20261003/maintenance/upstream.json +24 -0
  54. package/docs/modernization/evidence/local-pilot-20261003/maintenance/upstream.stderr.txt +0 -0
  55. package/docs/modernization/evidence/local-pilot-20261003/maintenance/upstream.stdout.txt +7 -0
  56. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/archive-service.stderr.txt +0 -0
  57. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/archive-service.stdout.txt +148 -0
  58. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/archive-structure.stderr.txt +0 -0
  59. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/archive-structure.stdout.txt +9 -0
  60. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-check.stderr.txt +0 -0
  61. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-check.stdout.txt +67 -0
  62. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-evidence.json +34 -0
  63. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-packet.json +128 -0
  64. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-packet.stderr.txt +0 -0
  65. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-packet.stdout.txt +128 -0
  66. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-pin.json +54 -0
  67. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-pin.stderr.txt +0 -0
  68. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-pin.stdout.txt +60 -0
  69. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-readback.json +15 -0
  70. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-service.stderr.txt +0 -0
  71. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-service.stdout.txt +82 -0
  72. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-structure.stderr.txt +0 -0
  73. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/baseline-structure.stdout.txt +9 -0
  74. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-check.stderr.txt +0 -0
  75. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-check.stdout.txt +79 -0
  76. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-packet-refused.stderr.txt +0 -0
  77. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-packet-refused.stdout.txt +7 -0
  78. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-pin-refresh.stderr.txt +0 -0
  79. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-pin-refresh.stdout.txt +66 -0
  80. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-pin.json +60 -0
  81. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-structure.stderr.txt +0 -0
  82. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/changed-structure.stdout.txt +9 -0
  83. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-check.stderr.txt +0 -0
  84. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-check.stdout.txt +73 -0
  85. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-evidence.json +34 -0
  86. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-packet.json +134 -0
  87. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-packet.stderr.txt +0 -0
  88. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-packet.stdout.txt +134 -0
  89. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-readback.json +15 -0
  90. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-service.stderr.txt +0 -0
  91. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-service.stdout.txt +148 -0
  92. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-structure.stderr.txt +0 -0
  93. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/final-structure.stdout.txt +9 -0
  94. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/node-version.stderr.txt +0 -0
  95. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/node-version.stdout.txt +1 -0
  96. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/python-version.stderr.txt +0 -0
  97. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/python-version.stdout.txt +1 -0
  98. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-evidence.json +34 -0
  99. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-packet.json +134 -0
  100. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-packet.stderr.txt +0 -0
  101. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-packet.stdout.txt +134 -0
  102. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-readback.json +15 -0
  103. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-service.stderr.txt +0 -0
  104. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-service.stdout.txt +266 -0
  105. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-structure.stderr.txt +0 -0
  106. package/docs/modernization/evidence/local-pilot-20261003/project/artifacts/red-structure.stdout.txt +9 -0
  107. package/docs/modernization/evidence/local-pilot-20261003/project/docs/entity_model.md +33 -0
  108. package/docs/modernization/evidence/local-pilot-20261003/project/docs/glossary.md +9 -0
  109. package/docs/modernization/evidence/local-pilot-20261003/project/docs/plans/UC-001.md +20 -0
  110. package/docs/modernization/evidence/local-pilot-20261003/project/docs/requirements.md +10 -0
  111. package/docs/modernization/evidence/local-pilot-20261003/project/docs/test_cases/TC-001-submit-expense.md +37 -0
  112. package/docs/modernization/evidence/local-pilot-20261003/project/docs/test_cases/TC-002-description-limit.md +42 -0
  113. package/docs/modernization/evidence/local-pilot-20261003/project/docs/use_cases/UC-001-submit-expense.md +76 -0
  114. package/docs/modernization/evidence/local-pilot-20261003/project/docs/use_cases.puml +12 -0
  115. package/docs/modernization/evidence/local-pilot-20261003/project/docs/vision.md +21 -0
  116. package/docs/modernization/evidence/local-pilot-20261003/project/src/expense.mjs +48 -0
  117. package/docs/modernization/evidence/local-pilot-20261003/project/tests/expense.test.mjs +116 -0
  118. package/docs/modernization/evidence/local-pilot-20261003/scope.json +31 -0
  119. package/docs/modernization/reviews/2026-10-03-claude-cli/CONTRACTS.ko.md +122 -0
  120. package/docs/modernization/reviews/2026-10-03-claude-cli/DIRECTION.ko.md +84 -0
  121. package/examples/spec-workflow/README.md +54 -0
  122. package/examples/spec-workflow/docs/entity_model.md +33 -0
  123. package/examples/spec-workflow/docs/glossary.md +9 -0
  124. package/examples/spec-workflow/docs/requirements.md +10 -0
  125. package/examples/spec-workflow/docs/test_cases/TC-001-submit-expense.md +37 -0
  126. package/examples/spec-workflow/docs/use_cases/UC-001-submit-expense.md +63 -0
  127. package/examples/spec-workflow/docs/use_cases.puml +12 -0
  128. package/examples/spec-workflow/docs/vision.md +21 -0
  129. package/package.json +37 -104
  130. package/plugins/aiwf-angular-jpa/.claude-plugin/plugin.json +11 -0
  131. package/plugins/aiwf-angular-jpa/LICENSE +201 -0
  132. package/plugins/aiwf-angular-jpa/NOTICE +16 -0
  133. package/plugins/aiwf-angular-jpa/README.md +54 -0
  134. package/plugins/aiwf-angular-jpa/UPSTREAM.json +35 -0
  135. package/plugins/aiwf-angular-jpa/agents/uc-coverage.md +263 -0
  136. package/plugins/aiwf-angular-jpa/rules/mcp-servers.md +64 -0
  137. package/plugins/aiwf-angular-jpa/skills/coverage-check/SKILL.md +190 -0
  138. package/plugins/aiwf-angular-jpa/skills/flyway-migration/SKILL.md +119 -0
  139. package/plugins/aiwf-angular-jpa/skills/implement/SKILL.md +528 -0
  140. package/plugins/aiwf-angular-jpa/skills/implement/references/module-layout.md +95 -0
  141. package/plugins/aiwf-angular-jpa/skills/playwright-test/SKILL.md +360 -0
  142. package/plugins/aiwf-angular-jpa/skills/spring-boot-test/SKILL.md +504 -0
  143. package/plugins/aiwf-angular-jpa/skills/vitest-test/SKILL.md +309 -0
  144. package/plugins/aiwf-blazor-dotnet/.claude-plugin/plugin.json +11 -0
  145. package/plugins/aiwf-blazor-dotnet/LICENSE +201 -0
  146. package/plugins/aiwf-blazor-dotnet/NOTICE +16 -0
  147. package/plugins/aiwf-blazor-dotnet/README.md +53 -0
  148. package/plugins/aiwf-blazor-dotnet/UPSTREAM.json +31 -0
  149. package/plugins/aiwf-blazor-dotnet/rules/mcp-servers.md +25 -0
  150. package/plugins/aiwf-blazor-dotnet/skills/bunit-test/SKILL.md +110 -0
  151. package/plugins/aiwf-blazor-dotnet/skills/dotnet-test/SKILL.md +108 -0
  152. package/plugins/aiwf-blazor-dotnet/skills/ef-migration/SKILL.md +43 -0
  153. package/plugins/aiwf-blazor-dotnet/skills/implement/SKILL.md +149 -0
  154. package/plugins/aiwf-blazor-dotnet/skills/playwright-test/SKILL.md +130 -0
  155. package/plugins/aiwf-core/.claude-plugin/plugin.json +11 -0
  156. package/plugins/aiwf-core/LICENSE +201 -0
  157. package/plugins/aiwf-core/NOTICE +20 -0
  158. package/plugins/aiwf-core/README.md +38 -0
  159. package/plugins/aiwf-core/UPSTREAM.json +50 -0
  160. package/plugins/aiwf-core/skills/entity-model/SKILL.md +160 -0
  161. package/plugins/aiwf-core/skills/entity-model/references/REFERENCE.md +36 -0
  162. package/plugins/aiwf-core/skills/requirements/SKILL.md +157 -0
  163. package/plugins/aiwf-core/skills/requirements/references/REFERENCE.md +70 -0
  164. package/plugins/aiwf-core/skills/requirements/references/glossary.md +7 -0
  165. package/plugins/aiwf-core/skills/reverse-engineer/SKILL.md +509 -0
  166. package/plugins/aiwf-core/skills/reverse-engineer/references/stack-signals.md +210 -0
  167. package/plugins/aiwf-core/skills/spec-review/SKILL.md +197 -0
  168. package/plugins/aiwf-core/skills/spec-review/references/lint-codes.md +63 -0
  169. package/plugins/aiwf-core/skills/spec-review/references/review-checklist.md +189 -0
  170. package/plugins/aiwf-core/skills/spec-review/scripts/spec_lint.py +1216 -0
  171. package/plugins/aiwf-core/skills/test-case/SKILL.md +138 -0
  172. package/plugins/aiwf-core/skills/test-case/references/example-process.bpmn +118 -0
  173. package/plugins/aiwf-core/skills/test-case/references/example.md +38 -0
  174. package/plugins/aiwf-core/skills/test-case/references/test-case.md +35 -0
  175. package/plugins/aiwf-core/skills/test-case/scripts/bpmn_paths.py +542 -0
  176. package/plugins/aiwf-core/skills/use-case-diagram/SKILL.md +99 -0
  177. package/plugins/aiwf-core/skills/use-case-spec/SKILL.md +257 -0
  178. package/plugins/aiwf-core/skills/use-case-spec/references/clarify-checklist.md +70 -0
  179. package/plugins/aiwf-core/skills/use-case-spec/references/example.md +88 -0
  180. package/plugins/aiwf-core/skills/use-case-spec/references/format-spec.md +246 -0
  181. package/plugins/aiwf-core/skills/use-case-spec/references/use-case.md +50 -0
  182. package/plugins/aiwf-core/skills/use-case-spec/scripts/validate_use_case.py +941 -0
  183. package/plugins/aiwf-delegate-claude/.claude-plugin/plugin.json +9 -0
  184. package/{src/lib/resources/templates/npm-library/template → plugins/aiwf-delegate-claude}/LICENSE +2 -2
  185. package/plugins/aiwf-delegate-claude/NOTICE +4 -0
  186. package/plugins/aiwf-delegate-claude/README.md +10 -0
  187. package/plugins/aiwf-delegate-claude/plugin.json +13 -0
  188. package/plugins/aiwf-delegate-claude/skills/delegate-claude/LICENSE +21 -0
  189. package/plugins/aiwf-delegate-claude/skills/delegate-claude/NOTICE +4 -0
  190. package/plugins/aiwf-delegate-claude/skills/delegate-claude/SKILL.md +49 -0
  191. package/plugins/aiwf-delegate-claude/skills/delegate-claude/agents/openai.yaml +2 -0
  192. package/plugins/aiwf-delegate-codex/.claude-plugin/plugin.json +9 -0
  193. package/plugins/aiwf-delegate-codex/LICENSE +21 -0
  194. package/plugins/aiwf-delegate-codex/NOTICE +4 -0
  195. package/plugins/aiwf-delegate-codex/README.md +10 -0
  196. package/plugins/aiwf-delegate-codex/plugin.json +13 -0
  197. package/plugins/aiwf-delegate-codex/skills/delegate-codex/LICENSE +21 -0
  198. package/plugins/aiwf-delegate-codex/skills/delegate-codex/NOTICE +4 -0
  199. package/plugins/aiwf-delegate-codex/skills/delegate-codex/SKILL.md +47 -0
  200. package/plugins/aiwf-delegate-codex/skills/delegate-codex/agents/openai.yaml +2 -0
  201. package/plugins/aiwf-nestjs-nextjs/.claude-plugin/plugin.json +11 -0
  202. package/plugins/aiwf-nestjs-nextjs/LICENSE +201 -0
  203. package/plugins/aiwf-nestjs-nextjs/NOTICE +16 -0
  204. package/plugins/aiwf-nestjs-nextjs/README.md +53 -0
  205. package/plugins/aiwf-nestjs-nextjs/UPSTREAM.json +32 -0
  206. package/plugins/aiwf-nestjs-nextjs/rules/mcp-servers.md +59 -0
  207. package/plugins/aiwf-nestjs-nextjs/skills/drizzle-migration/SKILL.md +222 -0
  208. package/plugins/aiwf-nestjs-nextjs/skills/implement/SKILL.md +393 -0
  209. package/plugins/aiwf-nestjs-nextjs/skills/implement/references/project-layout.md +158 -0
  210. package/plugins/aiwf-nestjs-nextjs/skills/nest-test/SKILL.md +300 -0
  211. package/plugins/aiwf-nestjs-nextjs/skills/playwright-test/SKILL.md +245 -0
  212. package/plugins/aiwf-nestjs-nextjs/skills/react-test/SKILL.md +217 -0
  213. package/plugins/aiwf-spec/.claude-plugin/plugin.json +9 -0
  214. package/plugins/aiwf-spec/LICENSE +201 -0
  215. package/plugins/aiwf-spec/NOTICE +20 -0
  216. package/plugins/aiwf-spec/README.md +36 -0
  217. package/plugins/aiwf-spec/skills/sync-docs/SKILL.md +47 -0
  218. package/plugins/aiwf-spec/skills/workflow/SKILL.md +42 -0
  219. package/plugins/aiwf-vaadin-jooq/.claude-plugin/plugin.json +11 -0
  220. package/plugins/aiwf-vaadin-jooq/LICENSE +201 -0
  221. package/plugins/aiwf-vaadin-jooq/NOTICE +16 -0
  222. package/plugins/aiwf-vaadin-jooq/README.md +56 -0
  223. package/plugins/aiwf-vaadin-jooq/UPSTREAM.json +43 -0
  224. package/plugins/aiwf-vaadin-jooq/agents/uc-coverage.md +260 -0
  225. package/plugins/aiwf-vaadin-jooq/rules/mcp-servers.md +44 -0
  226. package/plugins/aiwf-vaadin-jooq/skills/browserless-test/SKILL.md +407 -0
  227. package/plugins/aiwf-vaadin-jooq/skills/browserless-test/references/UC001ManagePersonsTest.java +111 -0
  228. package/plugins/aiwf-vaadin-jooq/skills/coverage-check/SKILL.md +190 -0
  229. package/plugins/aiwf-vaadin-jooq/skills/flyway-migration/SKILL.md +70 -0
  230. package/plugins/aiwf-vaadin-jooq/skills/hilla-test/SKILL.md +350 -0
  231. package/plugins/aiwf-vaadin-jooq/skills/hilla-test/references/UC001ManagePersonsServiceTest.java +81 -0
  232. package/plugins/aiwf-vaadin-jooq/skills/hilla-test/references/UC001ManagePersonsViewTest.tsx +87 -0
  233. package/plugins/aiwf-vaadin-jooq/skills/implement/SKILL.md +196 -0
  234. package/plugins/aiwf-vaadin-jooq/skills/implement-hilla/SKILL.md +216 -0
  235. package/plugins/aiwf-vaadin-jooq/skills/karibu-test/SKILL.md +298 -0
  236. package/plugins/aiwf-vaadin-jooq/skills/karibu-test/references/UC001ManagePersonsTest.java +93 -0
  237. package/plugins/aiwf-vaadin-jooq/skills/playwright-test/SKILL.md +237 -0
  238. package/plugins/aiwf-vaadin-jooq/skills/playwright-test/references/ExampleViewIT.java +143 -0
  239. package/plugins/aiwf-vaadin-jooq/skills/playwright-test/references/TC001CustomerOnboardingIT.java +144 -0
  240. package/plugins/aiwf-vaadin-jooq/skills/playwright-test/references/dramafinder-api.md +190 -0
  241. package/scripts/check-dependencies.js +26 -96
  242. package/scripts/install-spec-skills.mjs +126 -0
  243. package/scripts/validate-spec-plugin.mjs +145 -0
  244. package/src/cli/spec-cli.js +292 -0
  245. package/src/lib/spec-workflow.js +982 -0
  246. package/docs/ADR_MANAGEMENT_GUIDE.ko.md +0 -602
  247. package/docs/ADR_MANAGEMENT_GUIDE.md +0 -602
  248. package/docs/AI-WORKFLOW.ko.md +0 -299
  249. package/docs/AI-WORKFLOW.md +0 -401
  250. package/docs/API_REFERENCE_FULL.ko.md +0 -1135
  251. package/docs/API_REFERENCE_FULL.md +0 -1135
  252. package/docs/ARCHITECTURE.ko.md +0 -314
  253. package/docs/ARCHITECTURE.md +0 -314
  254. package/docs/CLI_USAGE_GUIDE.ko.md +0 -634
  255. package/docs/CLI_USAGE_GUIDE.md +0 -640
  256. package/docs/CODE_CLEANUP_GUIDE.ko.md +0 -415
  257. package/docs/CODE_CLEANUP_GUIDE.md +0 -415
  258. package/docs/COMMANDS_GUIDE.ko.md +0 -1037
  259. package/docs/COMMANDS_GUIDE.md +0 -1037
  260. package/docs/CONTRIBUTING.ko.md +0 -408
  261. package/docs/CONTRIBUTING.md +0 -408
  262. package/docs/DEVELOPMENT_GUIDE.ko.md +0 -440
  263. package/docs/DEVELOPMENT_GUIDE.md +0 -727
  264. package/docs/EXAMPLES.ko.md +0 -695
  265. package/docs/EXAMPLES.md +0 -693
  266. package/docs/GETTING_STARTED.ko.md +0 -219
  267. package/docs/GETTING_STARTED.md +0 -476
  268. package/docs/MODULE_MANAGEMENT_GUIDE.ko.md +0 -289
  269. package/docs/MODULE_MANAGEMENT_GUIDE.md +0 -289
  270. package/docs/PERFORMANCE_ARCHITECTURE.md +0 -494
  271. package/docs/PERFORMANCE_GUIDELINES.ko.md +0 -388
  272. package/docs/PERFORMANCE_GUIDELINES.md +0 -553
  273. package/docs/PRD.ko.md +0 -148
  274. package/docs/PRD.md +0 -150
  275. package/docs/ROADMAP_v0.4.0.md +0 -286
  276. package/docs/STATE_MANAGEMENT_GUIDE.ko.md +0 -278
  277. package/docs/STATE_MANAGEMENT_GUIDE.md +0 -278
  278. package/docs/TROUBLESHOOTING.ko.md +0 -366
  279. package/docs/TROUBLESHOOTING.md +0 -722
  280. package/docs/VALIDATOR_API.ko.md +0 -324
  281. package/docs/VALIDATOR_API.md +0 -324
  282. package/docs/YOLO_SYSTEM_GUIDE.ko.md +0 -542
  283. package/docs/YOLO_SYSTEM_GUIDE.md +0 -542
  284. package/docs/designs/AI_PERSONA_SYSTEM_DESIGN.md +0 -516
  285. package/docs/designs/API_DOCUMENTATION.md +0 -932
  286. package/docs/designs/API_REFERENCE.md +0 -979
  287. package/docs/designs/Enhanced_Installation_Flow_Design.md +0 -498
  288. package/docs/designs/aiwf-metadata-system-prd.md +0 -127
  289. package/docs/designs/offline-template-cache.md +0 -323
  290. package/docs/designs/persona-aware-compression.md +0 -168
  291. package/docs/guides/ai-personas-guide-ko.md +0 -239
  292. package/docs/guides/ai-personas-guide.md +0 -239
  293. package/docs/guides/checkpoint-system-guide-ko.md +0 -356
  294. package/docs/guides/checkpoint-system-guide.md +0 -356
  295. package/docs/guides/context-compression-guide-ko.md +0 -313
  296. package/docs/guides/context-compression-guide.md +0 -313
  297. package/docs/guides/independent-sprint-guide-ko.md +0 -321
  298. package/docs/guides/independent-sprint-guide.md +0 -321
  299. package/rules/global/aiwf-code-style-guide.md +0 -30
  300. package/rules/global/aiwf-coding-principles.md +0 -33
  301. package/rules/global/aiwf-development-process.md +0 -41
  302. package/rules/global/aiwf-global-rules.md +0 -84
  303. package/rules/manual/aiwf-generate-plan-docs.md +0 -280
  304. package/scripts/run-integration-tests.js +0 -317
  305. package/scripts/update-file-lists.js +0 -267
  306. package/scripts/validate-commands.js +0 -254
  307. package/src/DEPENDENCY_MAP.md +0 -90
  308. package/src/cli/cache-cli.js +0 -459
  309. package/src/cli/checkpoint-cli.js +0 -417
  310. package/src/cli/index.js +0 -481
  311. package/src/cli/language-cli.js +0 -286
  312. package/src/cli/sprint-cli.js +0 -287
  313. package/src/commands/ai-tool.js +0 -383
  314. package/src/commands/compress.js +0 -60
  315. package/src/commands/create-project.js +0 -160
  316. package/src/commands/evaluate.js +0 -459
  317. package/src/commands/persona.js +0 -309
  318. package/src/commands/sprint-independent.js +0 -393
  319. package/src/commands/sprint-task.js +0 -262
  320. package/src/commands/state.js +0 -1164
  321. package/src/commands/token.js +0 -312
  322. package/src/commands/yolo-config.js +0 -502
  323. package/src/config/file-lists.js +0 -147
  324. package/src/config/yolo-config-template.yaml +0 -168
  325. package/src/lib/ai-persona-manager.js +0 -711
  326. package/src/lib/backup-manager.js +0 -271
  327. package/src/lib/cache-system.js +0 -332
  328. package/src/lib/context-engine.js +0 -568
  329. package/src/lib/file-downloader.js +0 -304
  330. package/src/lib/github-integration.js +0 -402
  331. package/src/lib/installer.js +0 -1066
  332. package/src/lib/memory-profiler.js +0 -471
  333. package/src/lib/metrics-collector.js +0 -885
  334. package/src/lib/offline-detector.js +0 -386
  335. package/src/lib/resource-loader-enhanced.js +0 -399
  336. package/src/lib/resource-loader.js +0 -250
  337. package/src/lib/resources/commands/ai-persona.js +0 -602
  338. package/src/lib/resources/commands/compress-context.js +0 -389
  339. package/src/lib/resources/commands/evaluate.js +0 -246
  340. package/src/lib/resources/commands/persona-context-apply.js +0 -562
  341. package/src/lib/resources/commands/token-tracking.js +0 -443
  342. package/src/lib/resources/config/commit-patterns.js +0 -103
  343. package/src/lib/resources/config/language.json +0 -6
  344. package/src/lib/resources/personas/PERSONA_INDEX.md +0 -57
  345. package/src/lib/resources/personas/analyst.json +0 -44
  346. package/src/lib/resources/personas/architect/best_practices.md +0 -136
  347. package/src/lib/resources/personas/architect/knowledge_base.md +0 -377
  348. package/src/lib/resources/personas/architect.json +0 -44
  349. package/src/lib/resources/personas/backend/best_practices.md +0 -766
  350. package/src/lib/resources/personas/backend/knowledge_base.md +0 -1070
  351. package/src/lib/resources/personas/data_analyst/best_practices.md +0 -594
  352. package/src/lib/resources/personas/data_analyst/knowledge_base.md +0 -1057
  353. package/src/lib/resources/personas/developer.json +0 -44
  354. package/src/lib/resources/personas/developer.md +0 -37
  355. package/src/lib/resources/personas/evaluation_criteria.json +0 -137
  356. package/src/lib/resources/personas/frontend/best_practices.md +0 -445
  357. package/src/lib/resources/personas/frontend/knowledge_base.md +0 -729
  358. package/src/lib/resources/personas/persona-index.json +0 -31
  359. package/src/lib/resources/personas/reviewer.json +0 -44
  360. package/src/lib/resources/personas/security/best_practices.md +0 -307
  361. package/src/lib/resources/personas/security/knowledge_base.md +0 -498
  362. package/src/lib/resources/personas/tester.json +0 -44
  363. package/src/lib/resources/templates/README.md +0 -78
  364. package/src/lib/resources/templates/api-server/config.json +0 -64
  365. package/src/lib/resources/templates/api-server/template/.aiwf/config.json +0 -56
  366. package/src/lib/resources/templates/api-server/template/.aiwf/feature-ledger.json +0 -42
  367. package/src/lib/resources/templates/api-server/template/.aiwf/personas/backend-engineer.json +0 -40
  368. package/src/lib/resources/templates/api-server/template/.aiwf/scripts/cli.js +0 -111
  369. package/src/lib/resources/templates/api-server/template/.env.example +0 -29
  370. package/src/lib/resources/templates/api-server/template/.eslintrc.json +0 -23
  371. package/src/lib/resources/templates/api-server/template/README.md +0 -171
  372. package/src/lib/resources/templates/api-server/template/jest.config.js +0 -26
  373. package/src/lib/resources/templates/api-server/template/nodemon.json +0 -9
  374. package/src/lib/resources/templates/api-server/template/package.json +0 -61
  375. package/src/lib/resources/templates/api-server/template/src/app.ts +0 -60
  376. package/src/lib/resources/templates/api-server/template/src/config/swagger.ts +0 -38
  377. package/src/lib/resources/templates/api-server/template/src/controllers/aiwfController.ts +0 -54
  378. package/src/lib/resources/templates/api-server/template/src/controllers/authController.ts +0 -128
  379. package/src/lib/resources/templates/api-server/template/src/controllers/statusController.ts +0 -28
  380. package/src/lib/resources/templates/api-server/template/src/index.ts +0 -28
  381. package/src/lib/resources/templates/api-server/template/src/middleware/aiwfMiddleware.ts +0 -50
  382. package/src/lib/resources/templates/api-server/template/src/middleware/authMiddleware.ts +0 -41
  383. package/src/lib/resources/templates/api-server/template/src/middleware/errorHandler.ts +0 -42
  384. package/src/lib/resources/templates/api-server/template/src/middleware/notFoundHandler.ts +0 -14
  385. package/src/lib/resources/templates/api-server/template/src/middleware/requestLogger.ts +0 -20
  386. package/src/lib/resources/templates/api-server/template/src/routes/aiwf.ts +0 -31
  387. package/src/lib/resources/templates/api-server/template/src/routes/index.ts +0 -13
  388. package/src/lib/resources/templates/api-server/template/src/routes/v1/index.ts +0 -67
  389. package/src/lib/resources/templates/api-server/template/src/utils/logger.ts +0 -37
  390. package/src/lib/resources/templates/api-server/template/tests/app.test.ts +0 -40
  391. package/src/lib/resources/templates/api-server/template/tsconfig.json +0 -43
  392. package/src/lib/resources/templates/npm-library/config.json +0 -61
  393. package/src/lib/resources/templates/npm-library/template/README.md +0 -201
  394. package/src/lib/resources/templates/npm-library/template/package.json +0 -78
  395. package/src/lib/resources/templates/web-app/config.json +0 -53
  396. package/src/lib/resources/templates/web-app/template/.aiwf/config.json +0 -54
  397. package/src/lib/resources/templates/web-app/template/.aiwf/feature-ledger.json +0 -37
  398. package/src/lib/resources/templates/web-app/template/.aiwf/personas/fullstack-developer.json +0 -40
  399. package/src/lib/resources/templates/web-app/template/.aiwf/scripts/cli.js +0 -110
  400. package/src/lib/resources/templates/web-app/template/.eslintrc.cjs +0 -20
  401. package/src/lib/resources/templates/web-app/template/README.md +0 -151
  402. package/src/lib/resources/templates/web-app/template/index.html +0 -14
  403. package/src/lib/resources/templates/web-app/template/package.json +0 -44
  404. package/src/lib/resources/templates/web-app/template/postcss.config.js +0 -6
  405. package/src/lib/resources/templates/web-app/template/public/vite.svg +0 -1
  406. package/src/lib/resources/templates/web-app/template/src/App.tsx +0 -21
  407. package/src/lib/resources/templates/web-app/template/src/components/Layout.tsx +0 -57
  408. package/src/lib/resources/templates/web-app/template/src/components/aiwf/ContextStatus.tsx +0 -107
  409. package/src/lib/resources/templates/web-app/template/src/components/aiwf/TokenUsage.tsx +0 -71
  410. package/src/lib/resources/templates/web-app/template/src/index.css +0 -60
  411. package/src/lib/resources/templates/web-app/template/src/main.tsx +0 -10
  412. package/src/lib/resources/templates/web-app/template/src/pages/AiwfDashboard.tsx +0 -57
  413. package/src/lib/resources/templates/web-app/template/src/pages/HomePage.tsx +0 -89
  414. package/src/lib/resources/templates/web-app/template/src/pages/NotFound.tsx +0 -25
  415. package/src/lib/resources/templates/web-app/template/src/stores/aiwfStore.ts +0 -126
  416. package/src/lib/resources/templates/web-app/template/src/types/global.d.ts +0 -9
  417. package/src/lib/resources/templates/web-app/template/src/vite-env.d.ts +0 -1
  418. package/src/lib/resources/templates/web-app/template/tailwind.config.js +0 -30
  419. package/src/lib/resources/templates/web-app/template/tsconfig.json +0 -37
  420. package/src/lib/resources/templates/web-app/template/tsconfig.node.json +0 -10
  421. package/src/lib/resources/templates/web-app/template/vite.config.ts +0 -23
  422. package/src/lib/resources/utils/background-monitor.js +0 -223
  423. package/src/lib/resources/utils/compression-metrics.js +0 -1031
  424. package/src/lib/resources/utils/compression-strategies.js +0 -557
  425. package/src/lib/resources/utils/content-normalizer.js +0 -455
  426. package/src/lib/resources/utils/context-compressor.js +0 -583
  427. package/src/lib/resources/utils/context-rule-parser.js +0 -180
  428. package/src/lib/resources/utils/context-token-monitor.js +0 -463
  429. package/src/lib/resources/utils/context-update-manager.js +0 -502
  430. package/src/lib/resources/utils/git-utils.js +0 -220
  431. package/src/lib/resources/utils/importance-classifier.js +0 -645
  432. package/src/lib/resources/utils/information-filter.js +0 -710
  433. package/src/lib/resources/utils/persona-aware-compressor.js +0 -598
  434. package/src/lib/resources/utils/prompt-injector.js +0 -242
  435. package/src/lib/resources/utils/simplified-evaluator.js +0 -119
  436. package/src/lib/resources/utils/text-summarizer.js +0 -492
  437. package/src/lib/resources/utils/token-counter.js +0 -177
  438. package/src/lib/resources/utils/token-monitor.js +0 -484
  439. package/src/lib/resources/utils/token-reporter.js +0 -452
  440. package/src/lib/resources/utils/token-storage.js +0 -433
  441. package/src/lib/resources/utils/token-tracker.js +0 -283
  442. package/src/lib/rollback-manager.js +0 -418
  443. package/src/lib/state/priority-calculator.js +0 -217
  444. package/src/lib/state/state-index.js +0 -155
  445. package/src/lib/state/task-scanner.js +0 -328
  446. package/src/lib/task-analyzer.js +0 -599
  447. package/src/lib/template-cache-system.js +0 -559
  448. package/src/lib/template-downloader.js +0 -467
  449. package/src/lib/template-version-manager.js +0 -491
  450. package/src/lib/token-optimizer.js +0 -517
  451. package/src/lib/validator.js +0 -376
  452. package/src/utils/checkpoint-manager.js +0 -435
  453. package/src/utils/engineering-guard.js +0 -399
  454. package/src/utils/language-utils.js +0 -331
  455. package/src/utils/messages.js +0 -166
  456. package/src/utils/paths.js +0 -112
@@ -1,433 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- /**
5
- * 토큰 사용량 데이터를 저장하고 관리하는 클래스
6
- */
7
- export class TokenStorage {
8
- constructor(baseDir = '.aiwf/token-data') {
9
- this.baseDir = baseDir;
10
- this.dataFile = path.join(baseDir, 'token-usage.json');
11
- this.sessionDir = path.join(baseDir, 'sessions');
12
- this.reportsDir = path.join(baseDir, 'reports');
13
-
14
- this.ensureDirectories();
15
- this.loadData();
16
- }
17
-
18
- /**
19
- * 필요한 디렉토리를 생성합니다
20
- */
21
- ensureDirectories() {
22
- try {
23
- const dirs = [this.baseDir, this.sessionDir, this.reportsDir];
24
- for (const dir of dirs) {
25
- if (!fs.existsSync(dir)) {
26
- fs.mkdirSync(dir, { recursive: true });
27
- }
28
- }
29
- } catch (error) {
30
- console.error('디렉토리 생성 중 오류 발생:', error);
31
- }
32
- }
33
-
34
- /**
35
- * 토큰 사용량 데이터를 로드합니다
36
- */
37
- loadData() {
38
- try {
39
- if (fs.existsSync(this.dataFile)) {
40
- const data = JSON.parse(fs.readFileSync(this.dataFile, 'utf8'));
41
- this.data = {
42
- totalTokens: 0,
43
- sessionsCount: 0,
44
- lastUpdated: Date.now(),
45
- dailyUsage: {},
46
- commandStats: {},
47
- compressionStats: {
48
- totalOriginal: 0,
49
- totalCompressed: 0,
50
- totalSaved: 0,
51
- avgRatio: 0
52
- },
53
- ...data
54
- };
55
- } else {
56
- this.data = {
57
- totalTokens: 0,
58
- sessionsCount: 0,
59
- lastUpdated: Date.now(),
60
- dailyUsage: {},
61
- commandStats: {},
62
- compressionStats: {
63
- totalOriginal: 0,
64
- totalCompressed: 0,
65
- totalSaved: 0,
66
- avgRatio: 0
67
- }
68
- };
69
- }
70
- } catch (error) {
71
- console.error('데이터 로드 중 오류 발생:', error);
72
- this.data = this.getDefaultData();
73
- }
74
- }
75
-
76
- /**
77
- * 기본 데이터 구조를 반환합니다
78
- * @returns {Object} 기본 데이터 구조
79
- */
80
- getDefaultData() {
81
- return {
82
- totalTokens: 0,
83
- sessionsCount: 0,
84
- lastUpdated: Date.now(),
85
- dailyUsage: {},
86
- commandStats: {},
87
- compressionStats: {
88
- totalOriginal: 0,
89
- totalCompressed: 0,
90
- totalSaved: 0,
91
- avgRatio: 0
92
- }
93
- };
94
- }
95
-
96
- /**
97
- * 데이터를 저장합니다
98
- */
99
- saveData() {
100
- try {
101
- this.data.lastUpdated = Date.now();
102
- fs.writeFileSync(this.dataFile, JSON.stringify(this.data, null, 2));
103
- } catch (error) {
104
- console.error('데이터 저장 중 오류 발생:', error);
105
- }
106
- }
107
-
108
- /**
109
- * 세션 토큰 사용량을 기록합니다
110
- * @param {Object} sessionData - 세션 데이터
111
- */
112
- recordSessionUsage(sessionData) {
113
- try {
114
- const today = new Date().toISOString().split('T')[0];
115
-
116
- // 총 토큰 수 업데이트
117
- this.data.totalTokens += sessionData.totalTokens;
118
- this.data.sessionsCount++;
119
-
120
- // 일일 사용량 업데이트
121
- if (!this.data.dailyUsage[today]) {
122
- this.data.dailyUsage[today] = {
123
- tokens: 0,
124
- sessions: 0,
125
- commands: 0
126
- };
127
- }
128
-
129
- this.data.dailyUsage[today].tokens += sessionData.totalTokens;
130
- this.data.dailyUsage[today].sessions++;
131
- this.data.dailyUsage[today].commands += sessionData.commands.length;
132
-
133
- // 명령어별 통계 업데이트
134
- for (const command of sessionData.commands) {
135
- if (!this.data.commandStats[command.command]) {
136
- this.data.commandStats[command.command] = {
137
- count: 0,
138
- totalTokens: 0,
139
- avgTokens: 0
140
- };
141
- }
142
-
143
- const stats = this.data.commandStats[command.command];
144
- stats.count++;
145
- stats.totalTokens += command.totalTokens;
146
- stats.avgTokens = Math.round(stats.totalTokens / stats.count);
147
- }
148
-
149
- // 압축 통계 업데이트
150
- if (sessionData.compressions) {
151
- for (const compression of sessionData.compressions) {
152
- this.data.compressionStats.totalOriginal += compression.originalTokens;
153
- this.data.compressionStats.totalCompressed += compression.compressedTokens;
154
- this.data.compressionStats.totalSaved += compression.savedTokens;
155
- }
156
-
157
- // 평균 압축률 계산
158
- if (this.data.compressionStats.totalOriginal > 0) {
159
- this.data.compressionStats.avgRatio =
160
- (this.data.compressionStats.totalSaved / this.data.compressionStats.totalOriginal) * 100;
161
- }
162
- }
163
-
164
- this.saveData();
165
- } catch (error) {
166
- console.error('세션 사용량 기록 중 오류 발생:', error);
167
- }
168
- }
169
-
170
- /**
171
- * 토큰 사용량 보고서를 생성합니다
172
- * @param {string} type - 보고서 타입 ('daily', 'weekly', 'monthly')
173
- * @returns {Object} 보고서 데이터
174
- */
175
- generateUsageReport(type = 'daily') {
176
- try {
177
- const report = {
178
- type,
179
- generatedAt: Date.now(),
180
- period: this.getPeriod(type),
181
- summary: {
182
- totalTokens: this.data.totalTokens,
183
- totalSessions: this.data.sessionsCount,
184
- avgTokensPerSession: this.data.sessionsCount > 0 ?
185
- Math.round(this.data.totalTokens / this.data.sessionsCount) : 0
186
- },
187
- dailyUsage: this.getDailyUsageForPeriod(type),
188
- topCommands: this.getTopCommands(10),
189
- compressionStats: this.data.compressionStats,
190
- trends: this.calculateTrends(type)
191
- };
192
-
193
- // 보고서 저장
194
- const reportFile = path.join(this.reportsDir, `${type}_report_${Date.now()}.json`);
195
- fs.writeFileSync(reportFile, JSON.stringify(report, null, 2));
196
-
197
- return report;
198
- } catch (error) {
199
- console.error('보고서 생성 중 오류 발생:', error);
200
- return null;
201
- }
202
- }
203
-
204
- /**
205
- * 기간에 따른 일일 사용량을 조회합니다
206
- * @param {string} type - 기간 타입
207
- * @returns {Object} 일일 사용량 데이터
208
- */
209
- getDailyUsageForPeriod(type) {
210
- const days = type === 'weekly' ? 7 : type === 'monthly' ? 30 : 1;
211
- const result = {};
212
-
213
- for (let i = 0; i < days; i++) {
214
- const date = new Date();
215
- date.setDate(date.getDate() - i);
216
- const dateStr = date.toISOString().split('T')[0];
217
-
218
- result[dateStr] = this.data.dailyUsage[dateStr] || {
219
- tokens: 0,
220
- sessions: 0,
221
- commands: 0
222
- };
223
- }
224
-
225
- return result;
226
- }
227
-
228
- /**
229
- * 가장 많이 사용된 명령어를 조회합니다
230
- * @param {number} limit - 조회할 명령어 수
231
- * @returns {Array<Object>} 상위 명령어 목록
232
- */
233
- getTopCommands(limit = 10) {
234
- try {
235
- return Object.entries(this.data.commandStats)
236
- .sort((a, b) => b[1].totalTokens - a[1].totalTokens)
237
- .slice(0, limit)
238
- .map(([command, stats]) => ({
239
- command,
240
- count: stats.count,
241
- totalTokens: stats.totalTokens,
242
- avgTokens: stats.avgTokens
243
- }));
244
- } catch (error) {
245
- console.error('상위 명령어 조회 중 오류 발생:', error);
246
- return [];
247
- }
248
- }
249
-
250
- /**
251
- * 사용량 트렌드를 계산합니다
252
- * @param {string} type - 기간 타입
253
- * @returns {Object} 트렌드 데이터
254
- */
255
- calculateTrends(type) {
256
- try {
257
- const dailyUsage = this.getDailyUsageForPeriod(type);
258
- const values = Object.values(dailyUsage).map(day => day.tokens);
259
-
260
- if (values.length < 2) {
261
- return { trend: 'insufficient_data', change: 0 };
262
- }
263
-
264
- const recent = values.slice(0, Math.floor(values.length / 2));
265
- const older = values.slice(Math.floor(values.length / 2));
266
-
267
- const recentAvg = recent.reduce((sum, val) => sum + val, 0) / recent.length;
268
- const olderAvg = older.reduce((sum, val) => sum + val, 0) / older.length;
269
-
270
- const change = olderAvg > 0 ? ((recentAvg - olderAvg) / olderAvg) * 100 : 0;
271
-
272
- return {
273
- trend: change > 10 ? 'increasing' : change < -10 ? 'decreasing' : 'stable',
274
- change: Math.round(change),
275
- recentAvg: Math.round(recentAvg),
276
- olderAvg: Math.round(olderAvg)
277
- };
278
- } catch (error) {
279
- console.error('트렌드 계산 중 오류 발생:', error);
280
- return { trend: 'error', change: 0 };
281
- }
282
- }
283
-
284
- /**
285
- * 기간 정보를 반환합니다
286
- * @param {string} type - 기간 타입
287
- * @returns {Object} 기간 정보
288
- */
289
- getPeriod(type) {
290
- const now = new Date();
291
- const start = new Date(now);
292
-
293
- switch (type) {
294
- case 'weekly':
295
- start.setDate(now.getDate() - 7);
296
- break;
297
- case 'monthly':
298
- start.setMonth(now.getMonth() - 1);
299
- break;
300
- default:
301
- start.setDate(now.getDate() - 1);
302
- }
303
-
304
- return {
305
- start: start.toISOString().split('T')[0],
306
- end: now.toISOString().split('T')[0]
307
- };
308
- }
309
-
310
- /**
311
- * 임계값을 확인합니다
312
- * @param {Object} thresholds - 임계값 설정
313
- * @returns {Array<Object>} 임계값 위반 목록
314
- */
315
- checkThresholds(thresholds) {
316
- const violations = [];
317
- const today = new Date().toISOString().split('T')[0];
318
- const todayUsage = this.data.dailyUsage[today] || { tokens: 0, sessions: 0 };
319
-
320
- try {
321
- // 일일 토큰 한도 확인
322
- if (thresholds.dailyTokenLimit && todayUsage.tokens > thresholds.dailyTokenLimit) {
323
- violations.push({
324
- type: 'daily_token_limit',
325
- threshold: thresholds.dailyTokenLimit,
326
- current: todayUsage.tokens,
327
- message: `일일 토큰 한도(${thresholds.dailyTokenLimit})를 초과했습니다: ${todayUsage.tokens}`
328
- });
329
- }
330
-
331
- // 일일 세션 한도 확인
332
- if (thresholds.dailySessionLimit && todayUsage.sessions > thresholds.dailySessionLimit) {
333
- violations.push({
334
- type: 'daily_session_limit',
335
- threshold: thresholds.dailySessionLimit,
336
- current: todayUsage.sessions,
337
- message: `일일 세션 한도(${thresholds.dailySessionLimit})를 초과했습니다: ${todayUsage.sessions}`
338
- });
339
- }
340
-
341
- // 경고 임계값 확인
342
- if (thresholds.warningThreshold) {
343
- const warningLimit = thresholds.dailyTokenLimit * (thresholds.warningThreshold / 100);
344
- if (todayUsage.tokens > warningLimit) {
345
- violations.push({
346
- type: 'warning_threshold',
347
- threshold: warningLimit,
348
- current: todayUsage.tokens,
349
- message: `경고 임계값(${Math.round(warningLimit)})을 초과했습니다: ${todayUsage.tokens}`
350
- });
351
- }
352
- }
353
- } catch (error) {
354
- console.error('임계값 확인 중 오류 발생:', error);
355
- }
356
-
357
- return violations;
358
- }
359
-
360
- /**
361
- * 저장된 보고서 목록을 조회합니다
362
- * @returns {Array<Object>} 보고서 목록
363
- */
364
- getReportsList() {
365
- try {
366
- const reports = [];
367
- const files = fs.readdirSync(this.reportsDir);
368
-
369
- for (const file of files) {
370
- if (file.endsWith('.json')) {
371
- const filePath = path.join(this.reportsDir, file);
372
- const stats = fs.statSync(filePath);
373
-
374
- reports.push({
375
- filename: file,
376
- path: filePath,
377
- size: stats.size,
378
- created: stats.birthtime,
379
- modified: stats.mtime
380
- });
381
- }
382
- }
383
-
384
- return reports.sort((a, b) => b.created - a.created);
385
- } catch (error) {
386
- console.error('보고서 목록 조회 중 오류 발생:', error);
387
- return [];
388
- }
389
- }
390
-
391
- /**
392
- * 오래된 보고서를 정리합니다
393
- * @param {number} daysToKeep - 보관할 일수
394
- */
395
- cleanupOldReports(daysToKeep = 30) {
396
- try {
397
- const cutoffTime = Date.now() - (daysToKeep * 24 * 60 * 60 * 1000);
398
- const files = fs.readdirSync(this.reportsDir);
399
- let deletedCount = 0;
400
-
401
- for (const file of files) {
402
- if (file.endsWith('.json')) {
403
- const filePath = path.join(this.reportsDir, file);
404
- const stats = fs.statSync(filePath);
405
-
406
- if (stats.birthtime.getTime() < cutoffTime) {
407
- fs.unlinkSync(filePath);
408
- deletedCount++;
409
- }
410
- }
411
- }
412
-
413
- console.log(`${deletedCount}개의 오래된 보고서를 정리했습니다.`);
414
- } catch (error) {
415
- console.error('보고서 정리 중 오류 발생:', error);
416
- }
417
- }
418
-
419
- /**
420
- * 모든 데이터를 초기화합니다
421
- */
422
- resetData() {
423
- try {
424
- this.data = this.getDefaultData();
425
- this.saveData();
426
- console.log('토큰 사용량 데이터가 초기화되었습니다.');
427
- } catch (error) {
428
- console.error('데이터 초기화 중 오류 발생:', error);
429
- }
430
- }
431
- }
432
-
433
- export default TokenStorage;
@@ -1,283 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import { TokenCounter } from './token-counter.js';
4
-
5
- /**
6
- * 세션별 토큰 사용량을 추적하는 클래스
7
- */
8
- export class TokenTracker {
9
- constructor(sessionDir = '.aiwf/sessions') {
10
- this.sessionDir = sessionDir;
11
- this.sessionId = this.generateSessionId();
12
- this.counter = new TokenCounter();
13
- this.usage = {
14
- total: 0,
15
- compressed: 0,
16
- saved: 0,
17
- ratio: 0
18
- };
19
- this.sessionData = {
20
- sessionId: this.sessionId,
21
- startTime: Date.now(),
22
- totalTokens: 0,
23
- commands: [],
24
- lastUpdated: Date.now()
25
- };
26
-
27
- this.ensureSessionDirectory();
28
- this.loadSession();
29
- }
30
-
31
- /**
32
- * 세션 ID를 생성합니다
33
- * @returns {string} 세션 ID
34
- */
35
- generateSessionId() {
36
- const timestamp = Date.now();
37
- const random = Math.random().toString(36).substr(2, 9);
38
- return `session_${timestamp}_${random}`;
39
- }
40
-
41
- /**
42
- * 세션 디렉토리를 생성합니다
43
- */
44
- ensureSessionDirectory() {
45
- try {
46
- if (!fs.existsSync(this.sessionDir)) {
47
- fs.mkdirSync(this.sessionDir, { recursive: true });
48
- }
49
- } catch (error) {
50
- console.error('세션 디렉토리 생성 중 오류 발생:', error);
51
- }
52
- }
53
-
54
- /**
55
- * 세션 데이터를 로드합니다
56
- */
57
- loadSession() {
58
- try {
59
- const sessionFile = path.join(this.sessionDir, `${this.sessionId}.json`);
60
-
61
- if (fs.existsSync(sessionFile)) {
62
- const data = JSON.parse(fs.readFileSync(sessionFile, 'utf8'));
63
- this.sessionData = { ...this.sessionData, ...data };
64
- }
65
- } catch (error) {
66
- console.error('세션 로드 중 오류 발생:', error);
67
- }
68
- }
69
-
70
- /**
71
- * 세션 데이터를 저장합니다
72
- */
73
- saveSession() {
74
- try {
75
- const sessionFile = path.join(this.sessionDir, `${this.sessionId}.json`);
76
- this.sessionData.lastUpdated = Date.now();
77
-
78
- fs.writeFileSync(sessionFile, JSON.stringify(this.sessionData, null, 2));
79
- } catch (error) {
80
- console.error('세션 저장 중 오류 발생:', error);
81
- }
82
- }
83
-
84
- /**
85
- * 명령어 실행 토큰 사용량을 추적합니다
86
- * @param {string} command - 실행된 명령어
87
- * @param {string} input - 입력 텍스트
88
- * @param {string} output - 출력 텍스트
89
- */
90
- trackCommand(command, input = '', output = '') {
91
- try {
92
- const inputTokens = this.counter.countTokens(input);
93
- const outputTokens = this.counter.countTokens(output);
94
- const totalTokens = inputTokens + outputTokens;
95
-
96
- const commandEntry = {
97
- timestamp: Date.now(),
98
- command,
99
- inputTokens,
100
- outputTokens,
101
- totalTokens
102
- };
103
-
104
- this.sessionData.commands.push(commandEntry);
105
- this.sessionData.totalTokens += totalTokens;
106
-
107
- this.saveSession();
108
-
109
- return commandEntry;
110
- } catch (error) {
111
- console.error('명령어 토큰 추적 중 오류 발생:', error);
112
- return null;
113
- }
114
- }
115
-
116
- /**
117
- * 압축 전후 토큰 수를 기록합니다
118
- * @param {number} originalTokens - 원본 토큰 수
119
- * @param {number} compressedTokens - 압축된 토큰 수
120
- */
121
- trackCompression(originalTokens, compressedTokens) {
122
- try {
123
- this.usage.total = originalTokens;
124
- this.usage.compressed = compressedTokens;
125
- this.usage.saved = originalTokens - compressedTokens;
126
- this.usage.ratio = originalTokens > 0 ? (this.usage.saved / originalTokens) * 100 : 0;
127
-
128
- // 세션 데이터에 압축 정보 추가
129
- if (!this.sessionData.compressions) {
130
- this.sessionData.compressions = [];
131
- }
132
-
133
- this.sessionData.compressions.push({
134
- timestamp: Date.now(),
135
- originalTokens,
136
- compressedTokens,
137
- savedTokens: this.usage.saved,
138
- ratio: this.usage.ratio
139
- });
140
-
141
- this.saveSession();
142
- } catch (error) {
143
- console.error('압축 토큰 추적 중 오류 발생:', error);
144
- }
145
- }
146
-
147
- /**
148
- * 토큰 사용량 보고서를 생성합니다
149
- * @returns {Object} 토큰 사용량 보고서
150
- */
151
- generateReport() {
152
- try {
153
- const sessionDuration = Date.now() - this.sessionData.startTime;
154
- const avgTokensPerCommand = this.sessionData.commands.length > 0
155
- ? this.sessionData.totalTokens / this.sessionData.commands.length
156
- : 0;
157
-
158
- return {
159
- sessionId: this.sessionId,
160
- sessionDuration: this.formatDuration(sessionDuration),
161
- totalCommands: this.sessionData.commands.length,
162
- totalTokens: this.sessionData.totalTokens,
163
- avgTokensPerCommand: Math.round(avgTokensPerCommand),
164
- compressionStats: this.usage.total > 0 ? {
165
- originalTokens: this.usage.total,
166
- compressedTokens: this.usage.compressed,
167
- savedTokens: this.usage.saved,
168
- compressionRatio: this.usage.ratio.toFixed(2) + '%',
169
- efficiency: this.usage.ratio >= 50 ? 'High' : this.usage.ratio >= 25 ? 'Medium' : 'Low'
170
- } : null,
171
- recentCommands: this.sessionData.commands.slice(-5),
172
- startTime: new Date(this.sessionData.startTime).toLocaleString(),
173
- lastUpdated: new Date(this.sessionData.lastUpdated).toLocaleString()
174
- };
175
- } catch (error) {
176
- console.error('보고서 생성 중 오류 발생:', error);
177
- return null;
178
- }
179
- }
180
-
181
- /**
182
- * 시간 간격을 사람이 읽기 쉬운 형태로 변환합니다
183
- * @param {number} ms - 밀리초
184
- * @returns {string} 포맷된 시간
185
- */
186
- formatDuration(ms) {
187
- const seconds = Math.floor(ms / 1000);
188
- const minutes = Math.floor(seconds / 60);
189
- const hours = Math.floor(minutes / 60);
190
-
191
- if (hours > 0) {
192
- return `${hours}시간 ${minutes % 60}분`;
193
- } else if (minutes > 0) {
194
- return `${minutes}분 ${seconds % 60}초`;
195
- } else {
196
- return `${seconds}초`;
197
- }
198
- }
199
-
200
- /**
201
- * 세션 통계를 조회합니다
202
- * @returns {Object} 세션 통계
203
- */
204
- getSessionStats() {
205
- try {
206
- return {
207
- sessionId: this.sessionId,
208
- totalTokens: this.sessionData.totalTokens,
209
- commandCount: this.sessionData.commands.length,
210
- sessionDuration: Date.now() - this.sessionData.startTime,
211
- lastActivity: this.sessionData.lastUpdated
212
- };
213
- } catch (error) {
214
- console.error('세션 통계 조회 중 오류 발생:', error);
215
- return null;
216
- }
217
- }
218
-
219
- /**
220
- * 모든 세션 데이터를 조회합니다
221
- * @returns {Array<Object>} 세션 목록
222
- */
223
- getAllSessions() {
224
- try {
225
- const sessions = [];
226
- const files = fs.readdirSync(this.sessionDir);
227
-
228
- for (const file of files) {
229
- if (file.endsWith('.json')) {
230
- const sessionData = JSON.parse(
231
- fs.readFileSync(path.join(this.sessionDir, file), 'utf8')
232
- );
233
- sessions.push(sessionData);
234
- }
235
- }
236
-
237
- return sessions.sort((a, b) => b.startTime - a.startTime);
238
- } catch (error) {
239
- console.error('세션 목록 조회 중 오류 발생:', error);
240
- return [];
241
- }
242
- }
243
-
244
- /**
245
- * 오래된 세션을 정리합니다
246
- * @param {number} daysToKeep - 보관할 일수 (기본: 7일)
247
- */
248
- cleanupOldSessions(daysToKeep = 7) {
249
- try {
250
- const cutoffTime = Date.now() - (daysToKeep * 24 * 60 * 60 * 1000);
251
- const files = fs.readdirSync(this.sessionDir);
252
- let deletedCount = 0;
253
-
254
- for (const file of files) {
255
- if (file.endsWith('.json')) {
256
- const filePath = path.join(this.sessionDir, file);
257
- const sessionData = JSON.parse(fs.readFileSync(filePath, 'utf8'));
258
-
259
- if (sessionData.startTime < cutoffTime) {
260
- fs.unlinkSync(filePath);
261
- deletedCount++;
262
- }
263
- }
264
- }
265
-
266
- console.log(`${deletedCount}개의 오래된 세션을 정리했습니다.`);
267
- } catch (error) {
268
- console.error('세션 정리 중 오류 발생:', error);
269
- }
270
- }
271
-
272
- /**
273
- * 리소스를 정리합니다
274
- */
275
- cleanup() {
276
- this.saveSession();
277
- if (this.counter) {
278
- this.counter.cleanup();
279
- }
280
- }
281
- }
282
-
283
- export default TokenTracker;