@shepai/cli 1.180.0-pr548.764147 → 1.181.0-pr539.0993dc0

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 (326) hide show
  1. package/apis/json-schema/CavemanModeConfig.yaml +14 -0
  2. package/apis/json-schema/PhaseTiming.yaml +30 -0
  3. package/apis/json-schema/SubprocessFilterConfig.yaml +11 -0
  4. package/apis/json-schema/TokenOptimizationConfig.yaml +36 -0
  5. package/apis/json-schema/WorkflowConfig.yaml +9 -0
  6. package/dist/packages/core/src/application/ports/output/agents/agent-executor.interface.d.ts +8 -0
  7. package/dist/packages/core/src/application/ports/output/agents/agent-executor.interface.d.ts.map +1 -1
  8. package/dist/packages/core/src/application/ports/output/agents/phase-timing-repository.interface.d.ts +8 -1
  9. package/dist/packages/core/src/application/ports/output/agents/phase-timing-repository.interface.d.ts.map +1 -1
  10. package/dist/packages/core/src/application/ports/output/index.d.ts +1 -1
  11. package/dist/packages/core/src/application/ports/output/index.d.ts.map +1 -1
  12. package/dist/packages/core/src/application/ports/output/services/alias-compression.interface.d.ts +45 -0
  13. package/dist/packages/core/src/application/ports/output/services/alias-compression.interface.d.ts.map +1 -0
  14. package/dist/packages/core/src/application/ports/output/services/alias-compression.interface.js +13 -0
  15. package/dist/packages/core/src/application/ports/output/services/command-output-filter.interface.d.ts +50 -0
  16. package/dist/packages/core/src/application/ports/output/services/command-output-filter.interface.d.ts.map +1 -0
  17. package/dist/packages/core/src/application/ports/output/services/command-output-filter.interface.js +13 -0
  18. package/dist/packages/core/src/application/ports/output/services/delta-context.interface.d.ts +57 -0
  19. package/dist/packages/core/src/application/ports/output/services/delta-context.interface.d.ts.map +1 -0
  20. package/dist/packages/core/src/application/ports/output/services/delta-context.interface.js +13 -0
  21. package/dist/packages/core/src/application/ports/output/services/index.d.ts +7 -0
  22. package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
  23. package/dist/packages/core/src/application/ports/output/services/optimization-metrics.interface.d.ts +45 -0
  24. package/dist/packages/core/src/application/ports/output/services/optimization-metrics.interface.d.ts.map +1 -0
  25. package/dist/packages/core/src/application/ports/output/services/optimization-metrics.interface.js +13 -0
  26. package/dist/packages/core/src/application/ports/output/services/prompt-optimizer.interface.d.ts +86 -0
  27. package/dist/packages/core/src/application/ports/output/services/prompt-optimizer.interface.d.ts.map +1 -0
  28. package/dist/packages/core/src/application/ports/output/services/prompt-optimizer.interface.js +13 -0
  29. package/dist/packages/core/src/application/ports/output/services/semantic-compressor.interface.d.ts +43 -0
  30. package/dist/packages/core/src/application/ports/output/services/semantic-compressor.interface.d.ts.map +1 -0
  31. package/dist/packages/core/src/application/ports/output/services/semantic-compressor.interface.js +13 -0
  32. package/dist/packages/core/src/application/ports/output/services/skill-routing.interface.d.ts +41 -0
  33. package/dist/packages/core/src/application/ports/output/services/skill-routing.interface.d.ts.map +1 -0
  34. package/dist/packages/core/src/application/ports/output/services/skill-routing.interface.js +12 -0
  35. package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
  36. package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +21 -0
  37. package/dist/packages/core/src/domain/generated/output.d.ts +95 -0
  38. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  39. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  40. package/dist/packages/core/src/infrastructure/di/container.js +27 -0
  41. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +9 -0
  42. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
  43. package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +68 -0
  44. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-token-optimization-config.d.ts +29 -0
  45. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-token-optimization-config.d.ts.map +1 -0
  46. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-token-optimization-config.js +77 -0
  47. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-caveman-mode-config.d.ts +21 -0
  48. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-caveman-mode-config.d.ts.map +1 -0
  49. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/056-add-caveman-mode-config.js +29 -0
  50. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/057-add-subprocess-filter-config.d.ts +17 -0
  51. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/057-add-subprocess-filter-config.d.ts.map +1 -0
  52. package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/057-add-subprocess-filter-config.js +22 -0
  53. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts +2 -1
  54. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.d.ts.map +1 -1
  55. package/dist/packages/core/src/infrastructure/repositories/sqlite-phase-timing.repository.js +72 -0
  56. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
  57. package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +19 -3
  58. package/dist/packages/core/src/infrastructure/services/agents/analyze-repo/analyze-repository-graph.d.ts +1 -1
  59. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
  60. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +9 -0
  61. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/caveman-directive.d.ts +41 -0
  62. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/caveman-directive.d.ts.map +1 -0
  63. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/caveman-directive.js +51 -0
  64. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts +6 -1
  65. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts.map +1 -1
  66. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +18 -1
  67. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
  68. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
  69. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +6 -0
  70. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/evidence.node.d.ts.map +1 -1
  71. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/evidence.node.js +2 -2
  72. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/fast-implement.node.d.ts.map +1 -1
  73. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/fast-implement.node.js +3 -2
  74. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/implement.node.d.ts.map +1 -1
  75. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/implement.node.js +5 -4
  76. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
  77. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +3 -4
  78. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +27 -0
  79. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
  80. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +72 -5
  81. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.d.ts.map +1 -1
  82. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/merge-prompts.js +6 -11
  83. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.d.ts +2 -2
  84. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.d.ts.map +1 -1
  85. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/pr-branding.js +2 -2
  86. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/prompt-optimization-context.d.ts +42 -0
  87. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/prompt-optimization-context.d.ts.map +1 -0
  88. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/prompt-optimization-context.js +92 -0
  89. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts +1 -0
  90. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
  91. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.js +5 -0
  92. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/subprocess-filter-context.d.ts +25 -0
  93. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/subprocess-filter-context.d.ts.map +1 -0
  94. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/subprocess-filter-context.js +67 -0
  95. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  96. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +2 -3
  97. package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts +5 -16
  98. package/dist/packages/core/src/infrastructure/services/git/pr-branding.d.ts.map +1 -1
  99. package/dist/packages/core/src/infrastructure/services/git/pr-branding.js +7 -38
  100. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/generic-filter.d.ts +13 -0
  101. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/generic-filter.d.ts.map +1 -0
  102. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/generic-filter.js +21 -0
  103. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/git-filter.d.ts +15 -0
  104. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/git-filter.d.ts.map +1 -0
  105. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/git-filter.js +189 -0
  106. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/npm-filter.d.ts +13 -0
  107. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/npm-filter.d.ts.map +1 -0
  108. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/npm-filter.js +96 -0
  109. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/shared-helpers.d.ts +29 -0
  110. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/shared-helpers.d.ts.map +1 -0
  111. package/dist/packages/core/src/infrastructure/services/subprocess-filter/filters/shared-helpers.js +85 -0
  112. package/dist/packages/core/src/infrastructure/services/subprocess-filter/shep-filter.d.ts +27 -0
  113. package/dist/packages/core/src/infrastructure/services/subprocess-filter/shep-filter.d.ts.map +1 -0
  114. package/dist/packages/core/src/infrastructure/services/subprocess-filter/shep-filter.js +89 -0
  115. package/dist/packages/core/src/infrastructure/services/subprocess-filter/shim-generator.d.ts +39 -0
  116. package/dist/packages/core/src/infrastructure/services/subprocess-filter/shim-generator.d.ts.map +1 -0
  117. package/dist/packages/core/src/infrastructure/services/subprocess-filter/shim-generator.js +53 -0
  118. package/dist/packages/core/src/infrastructure/services/token-optimization/alias-compression.service.d.ts +41 -0
  119. package/dist/packages/core/src/infrastructure/services/token-optimization/alias-compression.service.d.ts.map +1 -0
  120. package/dist/packages/core/src/infrastructure/services/token-optimization/alias-compression.service.js +111 -0
  121. package/dist/packages/core/src/infrastructure/services/token-optimization/command-output-filter.service.d.ts +22 -0
  122. package/dist/packages/core/src/infrastructure/services/token-optimization/command-output-filter.service.d.ts.map +1 -0
  123. package/dist/packages/core/src/infrastructure/services/token-optimization/command-output-filter.service.js +245 -0
  124. package/dist/packages/core/src/infrastructure/services/token-optimization/delta-context.service.d.ts +22 -0
  125. package/dist/packages/core/src/infrastructure/services/token-optimization/delta-context.service.d.ts.map +1 -0
  126. package/dist/packages/core/src/infrastructure/services/token-optimization/delta-context.service.js +50 -0
  127. package/dist/packages/core/src/infrastructure/services/token-optimization/optimization-metrics.service.d.ts +36 -0
  128. package/dist/packages/core/src/infrastructure/services/token-optimization/optimization-metrics.service.d.ts.map +1 -0
  129. package/dist/packages/core/src/infrastructure/services/token-optimization/optimization-metrics.service.js +123 -0
  130. package/dist/packages/core/src/infrastructure/services/token-optimization/prompt-optimizer.service.d.ts +57 -0
  131. package/dist/packages/core/src/infrastructure/services/token-optimization/prompt-optimizer.service.d.ts.map +1 -0
  132. package/dist/packages/core/src/infrastructure/services/token-optimization/prompt-optimizer.service.js +241 -0
  133. package/dist/packages/core/src/infrastructure/services/token-optimization/semantic-compressor.service.d.ts +34 -0
  134. package/dist/packages/core/src/infrastructure/services/token-optimization/semantic-compressor.service.d.ts.map +1 -0
  135. package/dist/packages/core/src/infrastructure/services/token-optimization/semantic-compressor.service.js +190 -0
  136. package/dist/packages/core/src/infrastructure/services/token-optimization/skill-routing.service.d.ts +26 -0
  137. package/dist/packages/core/src/infrastructure/services/token-optimization/skill-routing.service.d.ts.map +1 -0
  138. package/dist/packages/core/src/infrastructure/services/token-optimization/skill-routing.service.js +51 -0
  139. package/dist/tsconfig.build.tsbuildinfo +1 -1
  140. package/package.json +1 -1
  141. package/web/.next/BUILD_ID +1 -1
  142. package/web/.next/build-manifest.json +2 -2
  143. package/web/.next/fallback-build-manifest.json +2 -2
  144. package/web/.next/prerender-manifest.json +3 -3
  145. package/web/.next/required-server-files.js +2 -2
  146. package/web/.next/required-server-files.json +2 -2
  147. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +32 -32
  148. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  149. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  150. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +30 -30
  151. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  152. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  153. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +33 -33
  154. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  155. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  156. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +41 -41
  157. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  158. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  159. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +41 -41
  160. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  161. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  162. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +31 -31
  163. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  164. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  165. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +31 -31
  166. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  167. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  168. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +30 -30
  169. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  170. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  171. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +33 -33
  172. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  173. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  174. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +41 -41
  175. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  176. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  177. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +41 -41
  178. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  179. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  180. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +30 -30
  181. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  182. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  183. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +31 -31
  184. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  185. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  186. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +31 -31
  187. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  188. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  189. package/web/.next/server/app/_global-error.html +2 -2
  190. package/web/.next/server/app/_global-error.rsc +1 -1
  191. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  192. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  193. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  194. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  195. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  196. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
  197. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  198. package/web/.next/server/app/application/[id]/page/server-reference-manifest.json +15 -15
  199. package/web/.next/server/app/application/[id]/page.js.nft.json +1 -1
  200. package/web/.next/server/app/application/[id]/page_client-reference-manifest.js +1 -1
  201. package/web/.next/server/app/features/page/server-reference-manifest.json +7 -7
  202. package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
  203. package/web/.next/server/app/settings/page/server-reference-manifest.json +10 -10
  204. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  205. package/web/.next/server/app/skills/page/server-reference-manifest.json +15 -15
  206. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  207. package/web/.next/server/app/tools/page/server-reference-manifest.json +13 -13
  208. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  209. package/web/.next/server/app/version/page/server-reference-manifest.json +7 -7
  210. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  211. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  212. package/web/.next/server/chunks/[root-of-the-server]__b2a4bfcc._.js.map +1 -1
  213. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  215. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  216. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
  217. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
  218. package/web/.next/server/chunks/ssr/[root-of-the-server]__013a0318._.js +1 -1
  219. package/web/.next/server/chunks/ssr/[root-of-the-server]__013a0318._.js.map +1 -1
  220. package/web/.next/server/chunks/ssr/[root-of-the-server]__17dadd08._.js +1 -1
  221. package/web/.next/server/chunks/ssr/[root-of-the-server]__17dadd08._.js.map +1 -1
  222. package/web/.next/server/chunks/ssr/[root-of-the-server]__1925bef0._.js +1 -1
  223. package/web/.next/server/chunks/ssr/[root-of-the-server]__1a9687c4._.js +1 -1
  224. package/web/.next/server/chunks/ssr/[root-of-the-server]__1a9687c4._.js.map +1 -1
  225. package/web/.next/server/chunks/ssr/[root-of-the-server]__24756fa9._.js +2 -2
  226. package/web/.next/server/chunks/ssr/[root-of-the-server]__24756fa9._.js.map +1 -1
  227. package/web/.next/server/chunks/ssr/[root-of-the-server]__4ee8be85._.js +1 -1
  228. package/web/.next/server/chunks/ssr/[root-of-the-server]__70986695._.js +1 -1
  229. package/web/.next/server/chunks/ssr/[root-of-the-server]__70986695._.js.map +1 -1
  230. package/web/.next/server/chunks/ssr/[root-of-the-server]__a5ea76a6._.js +1 -1
  231. package/web/.next/server/chunks/ssr/[root-of-the-server]__a5ea76a6._.js.map +1 -1
  232. package/web/.next/server/chunks/ssr/[root-of-the-server]__bb391c45._.js +1 -1
  233. package/web/.next/server/chunks/ssr/[root-of-the-server]__bb391c45._.js.map +1 -1
  234. package/web/.next/server/chunks/ssr/[root-of-the-server]__dd3e834e._.js +1 -1
  235. package/web/.next/server/chunks/ssr/[root-of-the-server]__dd3e834e._.js.map +1 -1
  236. package/web/.next/server/chunks/ssr/[root-of-the-server]__e265da61._.js +1 -1
  237. package/web/.next/server/chunks/ssr/[root-of-the-server]__f3ca7bea._.js +1 -1
  238. package/web/.next/server/chunks/ssr/[root-of-the-server]__f3ca7bea._.js.map +1 -1
  239. package/web/.next/server/chunks/ssr/_0277d3b5._.js +1 -1
  240. package/web/.next/server/chunks/ssr/_0277d3b5._.js.map +1 -1
  241. package/web/.next/server/chunks/ssr/_295fffde._.js.map +1 -1
  242. package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -1
  243. package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
  244. package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
  245. package/web/.next/server/chunks/ssr/{_ff6f3257._.js → _688e1fd9._.js} +2 -2
  246. package/web/.next/server/chunks/ssr/{_ff6f3257._.js.map → _688e1fd9._.js.map} +1 -1
  247. package/web/.next/server/chunks/ssr/_7931d3de._.js +3 -0
  248. package/web/.next/server/chunks/ssr/{_ee88b448._.js.map → _7931d3de._.js.map} +1 -1
  249. package/web/.next/server/chunks/ssr/_946a7fc6._.js +1 -1
  250. package/web/.next/server/chunks/ssr/_946a7fc6._.js.map +1 -1
  251. package/web/.next/server/chunks/ssr/{_96718a00._.js → _bd8c6d0b._.js} +2 -2
  252. package/web/.next/server/chunks/ssr/{_96718a00._.js.map → _bd8c6d0b._.js.map} +1 -1
  253. package/web/.next/server/chunks/ssr/{_9df33116._.js → _ce7571dd._.js} +2 -2
  254. package/web/.next/server/chunks/ssr/{_9df33116._.js.map → _ce7571dd._.js.map} +1 -1
  255. package/web/.next/server/chunks/ssr/_eff1b518._.js +1 -1
  256. package/web/.next/server/chunks/ssr/_eff1b518._.js.map +1 -1
  257. package/web/.next/server/chunks/ssr/_f227429a._.js +1 -1
  258. package/web/.next/server/chunks/ssr/_f227429a._.js.map +1 -1
  259. package/web/.next/server/chunks/ssr/_f5a56a3f._.js +3 -0
  260. package/web/.next/server/chunks/ssr/{_948d3cc6._.js.map → _f5a56a3f._.js.map} +1 -1
  261. package/web/.next/server/chunks/ssr/_f86fc1bf._.js +1 -1
  262. package/web/.next/server/chunks/ssr/_f86fc1bf._.js.map +1 -1
  263. package/web/.next/server/chunks/ssr/_f8c55130._.js +1 -1
  264. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  265. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  266. package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
  267. package/web/.next/server/chunks/ssr/src_presentation_web_36f2bc45._.js +1 -1
  268. package/web/.next/server/chunks/ssr/src_presentation_web_36f2bc45._.js.map +1 -1
  269. package/web/.next/server/chunks/ssr/src_presentation_web_486908de._.js +1 -1
  270. package/web/.next/server/chunks/ssr/src_presentation_web_486908de._.js.map +1 -1
  271. package/web/.next/server/chunks/ssr/src_presentation_web_5c3596bc._.js +1 -1
  272. package/web/.next/server/chunks/ssr/src_presentation_web_5c3596bc._.js.map +1 -1
  273. package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js +1 -1
  274. package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js.map +1 -1
  275. package/web/.next/server/chunks/ssr/src_presentation_web_6326f81e._.js +1 -1
  276. package/web/.next/server/chunks/ssr/src_presentation_web_6326f81e._.js.map +1 -1
  277. package/web/.next/server/chunks/ssr/src_presentation_web_6b2fdcd8._.js +1 -1
  278. package/web/.next/server/chunks/ssr/src_presentation_web_6b2fdcd8._.js.map +1 -1
  279. package/web/.next/server/chunks/ssr/src_presentation_web_74703c9f._.js +1 -1
  280. package/web/.next/server/chunks/ssr/src_presentation_web_74703c9f._.js.map +1 -1
  281. package/web/.next/server/chunks/ssr/src_presentation_web_a8056dac._.js +1 -1
  282. package/web/.next/server/chunks/ssr/src_presentation_web_a8056dac._.js.map +1 -1
  283. package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js +1 -1
  284. package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js.map +1 -1
  285. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +3 -3
  286. package/web/.next/server/chunks/ssr/src_presentation_web_b00bfb08._.js +1 -1
  287. package/web/.next/server/chunks/ssr/src_presentation_web_b00bfb08._.js.map +1 -1
  288. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
  289. package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
  290. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js +1 -1
  291. package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js.map +1 -1
  292. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  293. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  294. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
  295. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
  296. package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js +1 -1
  297. package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js.map +1 -1
  298. package/web/.next/server/chunks/ssr/src_presentation_web_f1edcf5e._.js +1 -1
  299. package/web/.next/server/chunks/ssr/src_presentation_web_f1edcf5e._.js.map +1 -1
  300. package/web/.next/server/chunks/ssr/src_presentation_web_f9436804._.js +1 -1
  301. package/web/.next/server/chunks/ssr/src_presentation_web_f9436804._.js.map +1 -1
  302. package/web/.next/server/pages/500.html +2 -2
  303. package/web/.next/server/server-reference-manifest.js +1 -1
  304. package/web/.next/server/server-reference-manifest.json +54 -54
  305. package/web/.next/static/chunks/{d2182843a406b5a7.js → 2bba4ee52a6464cd.js} +3 -3
  306. package/web/.next/static/chunks/{6ecbcce796343f44.js → 4371be9a949c8fe0.js} +1 -1
  307. package/web/.next/static/chunks/{fcf27468f8026dbd.js → 46bc202f80905332.js} +1 -1
  308. package/web/.next/static/chunks/{ee9a716c6424ff25.js → 51593e45475cb81d.js} +1 -1
  309. package/web/.next/static/chunks/{9370d114ce5b69fb.js → 75d1485ec29b8fd8.js} +1 -1
  310. package/web/.next/static/chunks/{2ddda685a9100fd8.js → aba1ec85581d3f1b.js} +1 -1
  311. package/web/.next/static/chunks/{b17c2d874c373d4e.js → abc53f1cc59f4642.js} +1 -1
  312. package/web/.next/static/chunks/{b2a010b2ba8710f4.js → ac069319b2aeab27.js} +1 -1
  313. package/web/.next/static/chunks/b5aadaa3b34d7b8e.js +1 -0
  314. package/web/.next/static/chunks/{8f783e12274578c2.js → b7e697748c35a4ce.js} +1 -1
  315. package/web/.next/static/chunks/{010215070d22b4e6.js → b9135c0d88735f54.js} +2 -2
  316. package/web/.next/static/chunks/{f7a55ba1f789c55f.js → c6b5b3f46622241d.js} +1 -1
  317. package/web/.next/static/chunks/{2a64d4b1a285fac5.js → c9c58949bf064dbe.js} +1 -1
  318. package/web/.next/static/chunks/{edf812d5efffa096.js → cbf7498ef586ebd3.js} +1 -1
  319. package/web/.next/static/chunks/{c1559152cf2ab9c6.js → d9f55661eb505770.js} +1 -1
  320. package/web/.next/static/chunks/{3ee4449e73eb4917.js → e3d4828e3b7291df.js} +1 -1
  321. package/web/.next/server/chunks/ssr/_948d3cc6._.js +0 -3
  322. package/web/.next/server/chunks/ssr/_ee88b448._.js +0 -3
  323. package/web/.next/static/chunks/0a67d6e50e27452e.js +0 -1
  324. /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → 73VlrUiVfmfr0uTiP1eN1}/_buildManifest.js +0 -0
  325. /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → 73VlrUiVfmfr0uTiP1eN1}/_clientMiddlewareManifest.json +0 -0
  326. /package/web/.next/static/{ex3OTWRXHxfwD9RkifALI → 73VlrUiVfmfr0uTiP1eN1}/_ssgManifest.js +0 -0
@@ -0,0 +1,14 @@
1
+ $schema: https://json-schema.org/draft/2020-12/schema
2
+ $id: CavemanModeConfig.yaml
3
+ type: object
4
+ properties:
5
+ enabled:
6
+ type: boolean
7
+ default: false
8
+ description: "Master toggle for caveman directive injection (default: false)"
9
+ directive:
10
+ type: string
11
+ description: Optional custom directive text (undefined = use factory default)
12
+ required:
13
+ - enabled
14
+ description: Caveman system-prompt directive configuration (optional, disabled by default)
@@ -64,6 +64,36 @@ properties:
64
64
  errorMessage:
65
65
  type: string
66
66
  description: Error details when exitCode is not success
67
+ originalTokenEstimate:
68
+ type: string
69
+ description: Estimated token count before optimization (chars / 4 heuristic)
70
+ optimizedTokenEstimate:
71
+ type: string
72
+ description: Estimated token count after optimization (chars / 4 heuristic)
73
+ savingsPercent:
74
+ type: number
75
+ description: Percentage of tokens saved by optimization ((original - optimized) / original * 100)
76
+ capabilitiesApplied:
77
+ type: string
78
+ description: JSON array of optimization capability names that were applied
79
+ outputFilterLinesRemoved:
80
+ type: integer
81
+ minimum: -2147483648
82
+ maximum: 2147483647
83
+ description: Number of lines removed by the command output filter
84
+ deltaContextFilesSkipped:
85
+ type: integer
86
+ minimum: -2147483648
87
+ maximum: 2147483647
88
+ description: Number of spec files replaced with compact summaries by delta-context
89
+ compressionRatio:
90
+ type: number
91
+ description: Compression ratio achieved by semantic text compression (compressed / original)
92
+ aliasesCreated:
93
+ type: integer
94
+ minimum: -2147483648
95
+ maximum: 2147483647
96
+ description: Number of alias substitutions created by the alias compression engine
67
97
  required:
68
98
  - agentRunId
69
99
  - phase
@@ -0,0 +1,11 @@
1
+ $schema: https://json-schema.org/draft/2020-12/schema
2
+ $id: SubprocessFilterConfig.yaml
3
+ type: object
4
+ properties:
5
+ enabled:
6
+ type: boolean
7
+ default: false
8
+ description: "Master toggle for subprocess output filtering (default: false)"
9
+ required:
10
+ - enabled
11
+ description: Subprocess output filter configuration (optional, disabled by default)
@@ -0,0 +1,36 @@
1
+ $schema: https://json-schema.org/draft/2020-12/schema
2
+ $id: TokenOptimizationConfig.yaml
3
+ type: object
4
+ properties:
5
+ enabled:
6
+ type: boolean
7
+ default: true
8
+ description: "Master toggle for the entire optimization layer (default: true)"
9
+ outputFiltering:
10
+ type: boolean
11
+ default: true
12
+ description: "Enable command output filtering to reduce test/build/git output tokens (default: true)"
13
+ skillRouting:
14
+ type: boolean
15
+ default: true
16
+ description: "Enable phase-aware skill routing directives in prompts (default: true)"
17
+ deltaContext:
18
+ type: boolean
19
+ default: true
20
+ description: "Enable delta-context diffing to skip unchanged spec files (default: true)"
21
+ semanticCompression:
22
+ type: boolean
23
+ default: true
24
+ description: "Enable rule-based semantic text compression on instruction sections (default: true)"
25
+ aliasCompression:
26
+ type: boolean
27
+ default: true
28
+ description: "Enable alias/meta-token compression for repeated long strings (default: true)"
29
+ required:
30
+ - enabled
31
+ - outputFiltering
32
+ - skillRouting
33
+ - deltaContext
34
+ - semanticCompression
35
+ - aliasCompression
36
+ description: Token optimization layer configuration with master toggle and per-capability controls
@@ -67,6 +67,15 @@ properties:
67
67
  skillInjection:
68
68
  $ref: SkillInjectionConfig.yaml
69
69
  description: Skill injection configuration (optional, disabled by default)
70
+ tokenOptimization:
71
+ $ref: TokenOptimizationConfig.yaml
72
+ description: Token optimization configuration (optional, enabled by default)
73
+ cavemanMode:
74
+ $ref: CavemanModeConfig.yaml
75
+ description: Caveman mode configuration (optional, disabled by default)
76
+ subprocessFilter:
77
+ $ref: SubprocessFilterConfig.yaml
78
+ description: Subprocess output filter configuration (optional, disabled by default)
70
79
  required:
71
80
  - openPrOnImplementationComplete
72
81
  - approvalGateDefaults
@@ -88,6 +88,14 @@ export interface AgentExecutionOptions {
88
88
  disableMcp?: boolean;
89
89
  /** Restrict available built-in tools via --tools flag */
90
90
  tools?: string[];
91
+ /**
92
+ * Absolute path to the shep-filter shim directory to prepend to PATH.
93
+ * When set, the executor prepends this directory to the subprocess
94
+ * PATH so that commands like `git`, `npm`, `pnpm` are intercepted
95
+ * by shep-filter wrapper scripts that pipe output through token-
96
+ * reducing filters before Claude Code ingests the results.
97
+ */
98
+ subprocessFilterShimDir?: string;
91
99
  }
92
100
  /**
93
101
  * Port interface for executing prompts against an AI agent.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-executor.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/agents/agent-executor.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;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wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAE9B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAExF;;;;;;OAMG;IACH,aAAa,CACX,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;CACjD"}
1
+ {"version":3,"file":"agent-executor.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/agents/agent-executor.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,uDAAuD;IACvD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8BAA8B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H,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAExF;;;;;;OAMG;IACH,aAAa,CACX,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;CACjD"}
@@ -25,7 +25,7 @@ export interface IPhaseTimingRepository {
25
25
  * @param id - The phase timing ID
26
26
  * @param updates - Fields to update (timing + optional token usage, exit code, error)
27
27
  */
28
- update(id: string, updates: Partial<Pick<PhaseTiming, 'completedAt' | 'durationMs' | 'inputTokens' | 'outputTokens' | 'cacheCreationInputTokens' | 'cacheReadInputTokens' | 'costUsd' | 'numTurns' | 'durationApiMs' | 'exitCode' | 'errorMessage' | 'prompt'>>): Promise<void>;
28
+ update(id: string, updates: Partial<Pick<PhaseTiming, 'completedAt' | 'durationMs' | 'inputTokens' | 'outputTokens' | 'cacheCreationInputTokens' | 'cacheReadInputTokens' | 'costUsd' | 'numTurns' | 'durationApiMs' | 'exitCode' | 'errorMessage' | 'prompt' | 'originalTokenEstimate' | 'optimizedTokenEstimate' | 'savingsPercent' | 'capabilitiesApplied' | 'outputFilterLinesRemoved' | 'deltaContextFilesSkipped' | 'compressionRatio' | 'aliasesCreated'>>): Promise<void>;
29
29
  /**
30
30
  * Update approval wait timing fields on a phase timing record.
31
31
  *
@@ -33,6 +33,13 @@ export interface IPhaseTimingRepository {
33
33
  * @param updates - Approval wait fields to update
34
34
  */
35
35
  updateApprovalWait(id: string, updates: Partial<Pick<PhaseTiming, 'waitingApprovalAt' | 'approvalWaitMs'>>): Promise<void>;
36
+ /**
37
+ * Find a single phase timing record by its ID.
38
+ *
39
+ * @param id - The phase timing ID
40
+ * @returns The phase timing record, or null if not found
41
+ */
42
+ findById(id: string): Promise<PhaseTiming | null>;
36
43
  /**
37
44
  * Find all phase timings for an agent run.
38
45
  *
@@ -1 +1 @@
1
- {"version":3,"file":"phase-timing-repository.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/agents/phase-timing-repository.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;;;OAKG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CACd,IAAI,CACF,WAAW,EACT,aAAa,GACb,YAAY,GACZ,aAAa,GACb,cAAc,GACd,0BAA0B,GAC1B,sBAAsB,GACtB,SAAS,GACT,UAAU,GACV,eAAe,GACf,UAAU,GACV,cAAc,GACd,QAAQ,CACX,CACF,GACA,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,GAC1E,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAExD;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAC5D"}
1
+ {"version":3,"file":"phase-timing-repository.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/agents/phase-timing-repository.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;;;OAKG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CACd,IAAI,CACF,WAAW,EACT,aAAa,GACb,YAAY,GACZ,aAAa,GACb,cAAc,GACd,0BAA0B,GAC1B,sBAAsB,GACtB,SAAS,GACT,UAAU,GACV,eAAe,GACf,UAAU,GACV,cAAc,GACd,QAAQ,GACR,uBAAuB,GACvB,wBAAwB,GACxB,gBAAgB,GAChB,qBAAqB,GACrB,0BAA0B,GAC1B,0BAA0B,GAC1B,kBAAkB,GAClB,gBAAgB,CACnB,CACF,GACA,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,kBAAkB,CAChB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,GAC1E,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAElD;;;;;OAKG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAExD;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;CAC5D"}
@@ -8,6 +8,6 @@
8
8
  */
9
9
  export type { IAgentExecutor, AgentExecutionResult, AgentExecutionStreamEvent, AgentExecutionOptions, IAgentExecutorFactory, IAgentExecutorProvider, IAgentRegistry, AgentDefinitionWithFactory, IAgentRunner, AgentRunOptions, IAgentRunRepository, IAgentValidator, AgentValidationResult, IFeatureAgentProcessService, } from './agents/index.js';
10
10
  export type { IFeatureRepository, FeatureListFilters, ISettingsRepository, } from './repositories/index.js';
11
- export type { IExternalIssueFetcher, ExternalIssue, INotificationService, ISpecInitializerService, SpecInitializerResult, IVersionService, IWebServerService, IWorktreeService, WorktreeInfo, } from './services/index.js';
11
+ export type { IExternalIssueFetcher, ExternalIssue, INotificationService, ISpecInitializerService, SpecInitializerResult, IVersionService, IWebServerService, IWorktreeService, WorktreeInfo, IPromptOptimizerService, PromptOptimizationContext, PromptOptimizationResult, OptimizationMetrics, ICommandOutputFilterService, CommandOutputFilterResult, ISkillRoutingService, SkillRoutingResult, IDeltaContextService, DeltaContextResult, SpecFileEntry, ISemanticCompressorService, SemanticCompressionResult, IAliasCompressionService, AliasCompressionResult, IOptimizationMetricsService, } from './services/index.js';
12
12
  export { IssueFetcherError, IssueNotFoundError, IssueAuthenticationError, IssueServiceUnavailableError, WorktreeError, WorktreeErrorCode, } from './services/index.js';
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/ports/output/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,EAC5B,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/ports/output/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,EAC5B,aAAa,EACb,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Alias Compression Service Interface
3
+ *
4
+ * Output port for session dictionary-based alias compression. Identifies
5
+ * repeated long strings (3+ occurrences, 20+ chars) in prompts and
6
+ * replaces them with short aliases ($A1, $A2, etc.) with a dictionary
7
+ * header prepended to the prompt.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides frequency analysis implementation
12
+ */
13
+ /**
14
+ * Result of applying alias compression to a prompt.
15
+ */
16
+ export interface AliasCompressionResult {
17
+ /** The prompt with aliases substituted and dictionary header prepended */
18
+ compressed: string;
19
+ /** The dictionary header text (empty string if no aliases created) */
20
+ dictionaryHeader: string;
21
+ /** Number of alias substitutions created */
22
+ aliasCount: number;
23
+ }
24
+ /**
25
+ * Service interface for alias/meta-token compression.
26
+ *
27
+ * Scans a prompt for repeated long strings, builds a session dictionary,
28
+ * and replaces occurrences with short aliases. A net-positive check
29
+ * ensures the dictionary header does not exceed the savings from aliasing.
30
+ */
31
+ export interface IAliasCompressionService {
32
+ /**
33
+ * Apply alias compression to a prompt string.
34
+ *
35
+ * Identifies strings appearing 3+ times that are 20+ characters long,
36
+ * assigns aliases ($A1, $A2, ...), prepends a dictionary header, and
37
+ * replaces all occurrences. Returns the original text unchanged if
38
+ * aliasing would not achieve net-positive savings.
39
+ *
40
+ * @param text - Prompt text to compress via aliasing
41
+ * @returns Compressed text with dictionary, header text, and alias count
42
+ */
43
+ compress(text: string): AliasCompressionResult;
44
+ }
45
+ //# sourceMappingURL=alias-compression.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias-compression.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/alias-compression.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAChD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Alias Compression Service Interface
3
+ *
4
+ * Output port for session dictionary-based alias compression. Identifies
5
+ * repeated long strings (3+ occurrences, 20+ chars) in prompts and
6
+ * replaces them with short aliases ($A1, $A2, etc.) with a dictionary
7
+ * header prepended to the prompt.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides frequency analysis implementation
12
+ */
13
+ export {};
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Command Output Filter Service Interface
3
+ *
4
+ * Output port for filtering command output (test runners, build tools,
5
+ * git operations) embedded in prompts. Applies configurable regex-based
6
+ * filter policies to reduce token consumption while preserving all
7
+ * error-relevant information.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides regex-based implementation
12
+ */
13
+ /**
14
+ * Filter policy type identifying the kind of command output.
15
+ */
16
+ export type OutputFilterPolicyType = 'jest' | 'vitest' | 'typescript-build' | 'git-diff' | 'pnpm-install' | 'generic';
17
+ /**
18
+ * Result of applying the command output filter to a prompt.
19
+ */
20
+ export interface CommandOutputFilterResult {
21
+ /** The filtered prompt string */
22
+ filtered: string;
23
+ /** Number of lines removed by the filter */
24
+ linesRemoved: number;
25
+ }
26
+ /**
27
+ * Service interface for filtering command output within prompts.
28
+ *
29
+ * Scans the prompt for recognizable command output blocks and applies
30
+ * reduction policies: removing passing test lines, truncating long diffs,
31
+ * collapsing blank lines, and summarizing passing sections with counts.
32
+ *
33
+ * Safety guarantee: any line containing error-related keywords (error,
34
+ * fail, warn, ENOENT, exception, stack, panic, timeout, denied, etc.)
35
+ * is preserved verbatim.
36
+ */
37
+ export interface ICommandOutputFilterService {
38
+ /**
39
+ * Filter command output embedded in a prompt string.
40
+ *
41
+ * Detects output blocks (fenced code blocks, test runner output patterns)
42
+ * and applies reduction policies based on detected output type. Lines
43
+ * containing error-related keywords are always preserved.
44
+ *
45
+ * @param prompt - Raw prompt containing embedded command output
46
+ * @returns Filtered prompt and count of lines removed
47
+ */
48
+ filter(prompt: string): CommandOutputFilterResult;
49
+ }
50
+ //# sourceMappingURL=command-output-filter.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-output-filter.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/command-output-filter.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,QAAQ,GACR,kBAAkB,GAClB,UAAU,GACV,cAAc,GACd,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,yBAAyB,CAAC;CACnD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Command Output Filter Service Interface
3
+ *
4
+ * Output port for filtering command output (test runners, build tools,
5
+ * git operations) embedded in prompts. Applies configurable regex-based
6
+ * filter policies to reduce token consumption while preserving all
7
+ * error-relevant information.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides regex-based implementation
12
+ */
13
+ export {};
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Delta-Context Service Interface
3
+ *
4
+ * Output port for hash-based spec file change detection. Compares
5
+ * SHA-256 hashes of spec files against previous phase hashes and
6
+ * replaces unchanged files with compact summaries to reduce repeated
7
+ * context tokens across multi-phase workflows.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides hash-based implementation
12
+ */
13
+ /**
14
+ * Description of a spec file to be checked for changes.
15
+ */
16
+ export interface SpecFileEntry {
17
+ /** File name (e.g., 'spec.yaml', 'research.yaml') */
18
+ fileName: string;
19
+ /** Full file content as read from disk */
20
+ content: string;
21
+ }
22
+ /**
23
+ * Result of applying delta-context diffing to spec files.
24
+ */
25
+ export interface DeltaContextResult {
26
+ /** Map of file names to their optimized content (full or summary) */
27
+ optimizedFiles: Record<string, string>;
28
+ /** Updated SHA-256 hashes for all files (store in LangGraph state) */
29
+ currentHashes: Record<string, string>;
30
+ /** Number of files that were replaced with compact summaries */
31
+ filesSkipped: number;
32
+ }
33
+ /**
34
+ * Service interface for delta-context spec file diffing.
35
+ *
36
+ * Computes SHA-256 hashes of spec file contents and compares them
37
+ * against hashes from the previous phase. Unchanged files are replaced
38
+ * with compact summaries (file name, line count, last-modified phase).
39
+ * Changed files and first-phase files are returned with full content.
40
+ */
41
+ export interface IDeltaContextService {
42
+ /**
43
+ * Diff spec files against previous phase hashes.
44
+ *
45
+ * For unchanged files: replaces content with a compact summary
46
+ * "[file unchanged since {previousPhase} - {lineCount} lines, hash {shortHash}]"
47
+ *
48
+ * For changed files or first phase (no previous hashes): returns full content.
49
+ *
50
+ * @param files - Spec files with their current content
51
+ * @param previousHashes - SHA-256 hashes from the previous phase (empty for first phase)
52
+ * @param previousPhaseName - Name of the previous phase (for summary text)
53
+ * @returns Optimized file contents, updated hashes, and count of skipped files
54
+ */
55
+ diff(files: SpecFileEntry[], previousHashes: Record<string, string>, previousPhaseName?: string): DeltaContextResult;
56
+ }
57
+ //# sourceMappingURL=delta-context.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delta-context.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/delta-context.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,aAAa,EAAE,EACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,iBAAiB,CAAC,EAAE,MAAM,GACzB,kBAAkB,CAAC;CACvB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Delta-Context Service Interface
3
+ *
4
+ * Output port for hash-based spec file change detection. Compares
5
+ * SHA-256 hashes of spec files against previous phase hashes and
6
+ * replaces unchanged files with compact summaries to reduce repeated
7
+ * context tokens across multi-phase workflows.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides hash-based implementation
12
+ */
13
+ export {};
@@ -21,6 +21,13 @@ export type { IGitHubRepositoryService, GitHubRepo, GitHubOrganization, ListUser
21
21
  export { GitHubAuthError, GitHubCloneError, GitHubUrlParseError, GitHubRepoListError, } from './github-repository-service.interface.js';
22
22
  export type { IInteractiveSessionService, StreamChunk, UnsubscribeFn, ChatState, } from './interactive-session-service.interface.js';
23
23
  export type { ISkillInjectorService, SkillInjectionResult } from './skill-injector.interface.js';
24
+ export type { IPromptOptimizerService, PromptOptimizationContext, PromptOptimizationResult, OptimizationMetrics, } from './prompt-optimizer.interface.js';
25
+ export type { ICommandOutputFilterService, CommandOutputFilterResult, OutputFilterPolicyType, } from './command-output-filter.interface.js';
26
+ export type { ISkillRoutingService, SkillRoutingResult } from './skill-routing.interface.js';
27
+ export type { IDeltaContextService, DeltaContextResult, SpecFileEntry, } from './delta-context.interface.js';
28
+ export type { ISemanticCompressorService, SemanticCompressionResult, } from './semantic-compressor.interface.js';
29
+ export type { IAliasCompressionService, AliasCompressionResult, } from './alias-compression.interface.js';
30
+ export type { IOptimizationMetricsService } from './optimization-metrics.interface.js';
24
31
  export type { IFileSystemService } from './file-system-service.interface.js';
25
32
  export type { IApplicationBriefStore } from './application-brief-store.interface.js';
26
33
  export type { IApplicationFileSystemService, FileTreeEntry, ReadFileResult, ReadFileBufferResult, FileChangeKind, FileChangeEvent, FileChangeListener, UnsubscribeFn as FileWatchUnsubscribeFn, } from './application-file-system-service.interface.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACjG,YAAY,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,YAAY,EACV,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EACV,mBAAmB,EACn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 {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACjG,YAAY,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,YAAY,EACV,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC3E,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjF,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC9F,YAAY,EACV,wBAAwB,EACxB,UAAU,EACV,kBAAkB,EAClB,2BAA2B,EAC3B,YAAY,EACZ,eAAe,GAChB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,eAAe,EACf,gB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,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Optimization Metrics Service Interface
3
+ *
4
+ * Output port for persisting token optimization metrics alongside
5
+ * existing PhaseTiming records. Records per-phase optimization data
6
+ * (token estimates, savings, per-capability stats) for observability
7
+ * and optimization tuning.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides persistence via PhaseTiming repository
12
+ */
13
+ import type { OptimizationMetrics } from './prompt-optimizer.interface.js';
14
+ /**
15
+ * Service interface for recording and retrieving optimization metrics.
16
+ *
17
+ * Persists optimization metrics as additional fields on PhaseTiming
18
+ * records. Uses the existing phase timing infrastructure so metrics
19
+ * are queryable alongside timing and cost data.
20
+ */
21
+ export interface IOptimizationMetricsService {
22
+ /**
23
+ * Record optimization metrics for a phase timing entry.
24
+ *
25
+ * Updates the PhaseTiming record with optimization-specific fields:
26
+ * original/optimized token estimates, savings percent, capabilities
27
+ * applied, and per-capability stats.
28
+ *
29
+ * @param phaseTimingId - ID of the PhaseTiming record to update
30
+ * @param metrics - Optimization metrics to persist
31
+ */
32
+ record(phaseTimingId: string, metrics: OptimizationMetrics): Promise<void>;
33
+ /**
34
+ * Retrieve optimization metrics previously recorded for a phase timing.
35
+ *
36
+ * Returns null when no phase timing exists for the supplied ID, when
37
+ * the record exists but has no optimization columns populated, or when
38
+ * the underlying repository read fails.
39
+ *
40
+ * @param phaseTimingId - ID of the PhaseTiming record to query
41
+ * @returns Stored OptimizationMetrics or null if no metrics are present
42
+ */
43
+ getByPhaseTimingId(phaseTimingId: string): Promise<OptimizationMetrics | null>;
44
+ }
45
+ //# sourceMappingURL=optimization-metrics.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimization-metrics.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/optimization-metrics.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;;;OASG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E;;;;;;;;;OASG;IACH,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;CAChF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Optimization Metrics Service Interface
3
+ *
4
+ * Output port for persisting token optimization metrics alongside
5
+ * existing PhaseTiming records. Records per-phase optimization data
6
+ * (token estimates, savings, per-capability stats) for observability
7
+ * and optimization tuning.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides persistence via PhaseTiming repository
12
+ */
13
+ export {};
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Prompt Optimizer Service Interface
3
+ *
4
+ * Output port for the token optimization layer. Orchestrates all
5
+ * optimization capabilities (output filtering, skill routing,
6
+ * delta-context diffing, semantic compression, alias compression)
7
+ * to reduce prompt token consumption before LLM invocation.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides the composable pipeline implementation
12
+ */
13
+ import type { TokenOptimizationConfig } from '../../../../domain/generated/output.js';
14
+ /**
15
+ * Context provided to the optimizer for intelligent optimization decisions.
16
+ */
17
+ export interface PromptOptimizationContext {
18
+ /** Current graph node / workflow phase name (e.g., 'analyze', 'implement') */
19
+ phaseName: string;
20
+ /** Model identifier for the downstream executor */
21
+ modelId?: string;
22
+ /** Feature ID for per-feature settings lookup */
23
+ featureId: string;
24
+ /** Agent run ID for metrics correlation */
25
+ agentRunId: string;
26
+ /** PhaseTiming row ID for persisting optimization metrics (if available) */
27
+ phaseTimingId?: string;
28
+ /** Previous spec file hashes for delta-context diffing */
29
+ previousSpecFileHashes?: Record<string, string>;
30
+ /** Optimization config override (if not provided, reads from global settings) */
31
+ config?: TokenOptimizationConfig;
32
+ }
33
+ /**
34
+ * Per-capability metrics collected during optimization.
35
+ */
36
+ export interface OptimizationMetrics {
37
+ /** Estimated tokens before optimization (chars / 4 heuristic) */
38
+ originalTokenEstimate: number;
39
+ /** Estimated tokens after optimization (chars / 4 heuristic) */
40
+ optimizedTokenEstimate: number;
41
+ /** Percentage of tokens saved ((original - optimized) / original * 100) */
42
+ savingsPercent: number;
43
+ /** List of optimization capability names that were applied */
44
+ capabilitiesApplied: string[];
45
+ /** Lines removed by command output filter */
46
+ outputFilterLinesRemoved: number;
47
+ /** Spec files replaced with compact summaries by delta-context */
48
+ deltaContextFilesSkipped: number;
49
+ /** Compression ratio from semantic compression (compressed / original) */
50
+ compressionRatio: number;
51
+ /** Number of alias substitutions created */
52
+ aliasesCreated: number;
53
+ }
54
+ /**
55
+ * Result returned by the prompt optimizer.
56
+ */
57
+ export interface PromptOptimizationResult {
58
+ /** The optimized prompt string */
59
+ prompt: string;
60
+ /** Optimization metrics for tracking and reporting */
61
+ metrics: OptimizationMetrics;
62
+ /** Updated spec file hashes for delta-context (store in LangGraph state) */
63
+ specFileHashes: Record<string, string>;
64
+ }
65
+ /**
66
+ * Service interface for the token optimization layer.
67
+ *
68
+ * Orchestrates all optimization capabilities based on settings toggles,
69
+ * applying them in sequence: output filter -> skill router -> delta-context
70
+ * -> semantic compressor -> alias engine.
71
+ */
72
+ export interface IPromptOptimizerService {
73
+ /**
74
+ * Optimize a raw prompt string to reduce token consumption.
75
+ *
76
+ * Applies enabled optimization capabilities in sequence and returns
77
+ * the optimized prompt with metrics. If optimization is disabled
78
+ * (master toggle off), returns the original prompt with zero-delta metrics.
79
+ *
80
+ * @param prompt - Raw prompt string from buildPrompt()
81
+ * @param context - Phase context for intelligent optimization decisions
82
+ * @returns Optimized prompt, metrics, and updated spec file hashes
83
+ */
84
+ optimize(prompt: string, context: PromptOptimizationContext): Promise<PromptOptimizationResult>;
85
+ }
86
+ //# sourceMappingURL=prompt-optimizer.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-optimizer.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/prompt-optimizer.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,iFAAiF;IACjF,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,6CAA6C;IAC7C,wBAAwB,EAAE,MAAM,CAAC;IACjC,kEAAkE;IAClE,wBAAwB,EAAE,MAAM,CAAC;IACjC,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,OAAO,EAAE,mBAAmB,CAAC;IAC7B,4EAA4E;IAC5E,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACjG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Prompt Optimizer Service Interface
3
+ *
4
+ * Output port for the token optimization layer. Orchestrates all
5
+ * optimization capabilities (output filtering, skill routing,
6
+ * delta-context diffing, semantic compression, alias compression)
7
+ * to reduce prompt token consumption before LLM invocation.
8
+ *
9
+ * Following Clean Architecture:
10
+ * - Application layer depends on this interface
11
+ * - Infrastructure layer provides the composable pipeline implementation
12
+ */
13
+ export {};