@cspeach/cli 0.9.0 → 1.0.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 (131) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/intent-system-prompt.js +1 -1
  3. package/dist/agent/loop.js +209 -20
  4. package/dist/agent/providers/license-gate.js +44 -0
  5. package/dist/agent/skill-checkpoint.js +1 -1
  6. package/dist/agent/tool-dispatch.js +15 -0
  7. package/dist/approvals/canonical.js +91 -0
  8. package/dist/approvals/jwt.js +39 -2
  9. package/dist/auth/org-anthropic-key.js +25 -0
  10. package/dist/classifier/client.js +18 -3
  11. package/dist/commands/config-set.js +95 -0
  12. package/dist/commands/login.js +31 -14
  13. package/dist/commands/plan-model-tier.js +83 -0
  14. package/dist/commands/plan-resume.js +148 -21
  15. package/dist/config/loader.js +95 -1
  16. package/dist/doctor/checks/_http-probe.js +1 -0
  17. package/dist/doctor/checks/cert.js +14 -3
  18. package/dist/doctor/checks/sap.js +30 -8
  19. package/dist/doctor/checks/zcspeach.js +19 -4
  20. package/dist/one-shot.js +52 -4
  21. package/dist/projects/answer-blockers.js +137 -0
  22. package/dist/projects/extract-cca.js +108 -16
  23. package/dist/projects/extract-modernize.js +1 -1
  24. package/dist/projects/extract-plan.js +130 -37
  25. package/dist/projects/extract-spec-gap.js +34 -7
  26. package/dist/projects/extract-test-coverage.js +1 -1
  27. package/dist/projects/extract-upgrade.js +113 -22
  28. package/dist/projects/index.js +5 -2
  29. package/dist/projects/merge-cca.js +292 -0
  30. package/dist/projects/merge-upgrade.js +173 -0
  31. package/dist/projects/migration.js +103 -1
  32. package/dist/projects/output-paths.js +27 -0
  33. package/dist/projects/plan-run.js +159 -25
  34. package/dist/projects/plan-schema.js +63 -3
  35. package/dist/projects/promote-command.js +25 -2
  36. package/dist/projects/promote.js +128 -0
  37. package/dist/projects/save-command.js +247 -20
  38. package/dist/projects/status.js +3 -1
  39. package/dist/projects/validate.js +1 -1
  40. package/dist/projects/workspace.js +164 -20
  41. package/dist/renderer/notices.js +64 -0
  42. package/dist/renderer/progress-chatter.js +8 -0
  43. package/dist/renderer/tool-widget.js +18 -4
  44. package/dist/renderer/tty.js +43 -4
  45. package/dist/renderer/verify-chain.js +77 -0
  46. package/dist/repl/at-picker.js +60 -7
  47. package/dist/repl/builtin-commands.js +37 -0
  48. package/dist/repl/early-line-buffer.js +68 -0
  49. package/dist/repl/inquirer-guard.js +70 -5
  50. package/dist/repl/numbered-menu.js +131 -0
  51. package/dist/repl/post-turn-status.js +2 -2
  52. package/dist/repl/rule8-detector.js +17 -2
  53. package/dist/repl/safety-confirm.js +111 -2
  54. package/dist/repl/safety-mode-state.js +19 -3
  55. package/dist/repl/slash-picker.js +10 -15
  56. package/dist/repl.js +301 -35
  57. package/dist/router/classifier.js +150 -6
  58. package/dist/sap/capability-matrix.js +20 -0
  59. package/dist/sap/capability-matrix.json +11236 -0
  60. package/dist/sap/capability.js +146 -0
  61. package/dist/sap/connection-manager.js +19 -1
  62. package/dist/sap/onboarding.js +42 -4
  63. package/dist/session/pending.js +27 -0
  64. package/dist/skill-catalog.js +48 -43
  65. package/dist/skills/bundled-skills.js +279 -1
  66. package/dist/skills/promotion-dispatch.js +23 -0
  67. package/dist/tools/_command-shared.js +36 -12
  68. package/dist/tools/_filesystem-shared.js +139 -4
  69. package/dist/tools/_flag.js +25 -0
  70. package/dist/tools/approval.js +64 -21
  71. package/dist/tools/ask-question.js +96 -4
  72. package/dist/tools/capability/tool.js +74 -0
  73. package/dist/tools/dispatch-skill.js +22 -1
  74. package/dist/tools/extend-model/anchored-insert.js +810 -0
  75. package/dist/tools/extend-model/tool.js +188 -0
  76. package/dist/tools/filesystem/extract-document.js +57 -0
  77. package/dist/tools/filesystem/file-edit.js +12 -2
  78. package/dist/tools/filesystem/file-read.js +2 -2
  79. package/dist/tools/filesystem/file-write.js +11 -2
  80. package/dist/tools/filesystem/glob.js +11 -0
  81. package/dist/tools/filesystem/grep.js +10 -0
  82. package/dist/tools/filesystem/read-document.js +107 -0
  83. package/dist/tools/fiori/apply.js +50 -0
  84. package/dist/tools/fiori/bin.js +3 -0
  85. package/dist/tools/fiori/catalog/index.js +27 -0
  86. package/dist/tools/fiori/catalog/value-help.js +230 -0
  87. package/dist/tools/fiori/catalog/viz-chart.js +177 -0
  88. package/dist/tools/fiori/cli.js +71 -0
  89. package/dist/tools/fiori/deploy-config.js +73 -0
  90. package/dist/tools/fiori/fe-scaffold.js +45 -0
  91. package/dist/tools/fiori/i18n.js +39 -0
  92. package/dist/tools/fiori/manifest.js +70 -0
  93. package/dist/tools/fiori/render.js +77 -0
  94. package/dist/tools/fiori/scaffold.js +39 -0
  95. package/dist/tools/fiori/tools.js +356 -0
  96. package/dist/tools/fiori/types.js +1 -0
  97. package/dist/tools/local-build.js +76 -0
  98. package/dist/tools/local-files.js +31 -0
  99. package/dist/tools/project/_merge-shared.js +68 -0
  100. package/dist/tools/project/cca_merge.js +164 -0
  101. package/dist/tools/project/playbook_get.js +1 -1
  102. package/dist/tools/project/upgrade_merge_progress.js +206 -0
  103. package/dist/tools/sap-read.js +53 -9
  104. package/dist/tools/sap-write.js +530 -21
  105. package/dist/tools/shell/shell_exec.js +41 -6
  106. package/dist/tools/snapshot.js +37 -14
  107. package/dist/tools/subagent/background_run.js +17 -1
  108. package/dist/tools/transport-resolution.js +86 -0
  109. package/dist/tools/transport.js +224 -5
  110. package/dist/tools/write-mode.js +4 -0
  111. package/dist/ui/app.js +6 -2
  112. package/dist/ui/body.js +13 -0
  113. package/dist/ui/footer.js +20 -6
  114. package/dist/ui/line-resolution.js +17 -6
  115. package/dist/ui/session-timeline.js +1 -0
  116. package/dist/ui/text-input.js +150 -0
  117. package/dist/ui/widgets/ask-question-modal.js +4 -1
  118. package/package.json +19 -3
  119. package/bench/README.md +0 -78
  120. package/bench/prompts/abap-document-cds.md +0 -44
  121. package/bench/prompts/abap-explain-bdef-handler.md +0 -57
  122. package/bench/prompts/abap-test-method.md +0 -42
  123. package/bench/results/abap-document-cds/claude-haiku-4-5.md +0 -189
  124. package/bench/results/abap-document-cds/claude-opus-4-7.md +0 -120
  125. package/bench/results/abap-document-cds/claude-sonnet-4-6.md +0 -151
  126. package/bench/results/abap-explain-bdef-handler/claude-haiku-4-5.md +0 -112
  127. package/bench/results/abap-explain-bdef-handler/claude-opus-4-7.md +0 -101
  128. package/bench/results/abap-explain-bdef-handler/claude-sonnet-4-6.md +0 -101
  129. package/bench/results/abap-test-method/claude-haiku-4-5.md +0 -186
  130. package/bench/results/abap-test-method/claude-opus-4-7.md +0 -193
  131. package/bench/results/abap-test-method/claude-sonnet-4-6.md +0 -234
@@ -1,234 +0,0 @@
1
- # abap-test-method — claude-sonnet-4-6
2
-
3
- - **skill:** abap-test
4
- - **description:** Generate an ABAP Unit test class for a small business rule method
5
- - **latency:** 35751 ms
6
- - **input tokens:** 3
7
- - **output tokens:** 2,815
8
- - **cost:** $0.0422
9
-
10
- ---
11
-
12
- ## abap-test — ZCL_DISCOUNT_CALCULATOR
13
-
14
- ## TL;DR
15
-
16
- **Headline:** Six focused unit tests covering every branch and the error path of `calculate_discount`, with boundary values at the exact tier thresholds.
17
-
18
- **Top 3 (priority order — most important first):**
19
- 1. **Boundary precision is the key risk** — the spec uses strict `<` comparisons, so tests at exactly 1 000, 5 000, and 10 000 are the most likely place real bugs hide; all three tier-entry boundaries are covered explicitly.
20
- 2. **No mocking needed** — the method is pure logic with no external dependencies, so the test class is self-contained and will run anywhere without setup overhead.
21
- 3. **Exception text-id is verified, not just the exception type** — `test_negative_input` checks that `zcx_discount_error=>negative_input` is the textid, giving you a regression net against accidental exception reuse.
22
-
23
- **Verdict:** Ready to paste into the test include of `ZCL_DISCOUNT_CALCULATOR`. Review the hardcoded expected values against the business spec before activating.
24
-
25
- ---
26
-
27
- ## Test Strategy
28
-
29
- **Class Under Test:** `ZCL_DISCOUNT_CALCULATOR`
30
- **Methods Analyzed:** 1 public (`calculate_discount`)
31
- **Test Cases Designed:** 6
32
-
33
- ### Test Matrix
34
-
35
- | Method | Scenario | Input (`iv_net_amount`) | Expected (`rv_discount`) | Mock Required |
36
- |---|---|---|---|---|
37
- | `calculate_discount` | Zero amount (boundary — tier 1 floor) | `0.00` | `0.00` | None |
38
- | `calculate_discount` | Mid-tier 1 (< 1 000) | `500.00` | `0.00` | None |
39
- | `calculate_discount` | Exact tier boundary 1 000 (enters tier 2) | `1000.00` | `5.00` | None |
40
- | `calculate_discount` | Exact tier boundary 5 000 (enters tier 3) | `5000.00` | `10.00` | None |
41
- | `calculate_discount` | Exact tier boundary 10 000 (enters tier 4) | `10000.00` | `15.00` | None |
42
- | `calculate_discount` | Negative input → exception | `-0.01` | `ZCX_DISCOUNT_ERROR` raised | None |
43
-
44
- ---
45
-
46
- ## Generated Test Class
47
-
48
- ```abap
49
- "! Unit tests for ZCL_DISCOUNT_CALCULATOR=>CALCULATE_DISCOUNT.
50
- "! Risk level HARMLESS — pure calculation, no I/O, no DB access.
51
- CLASS zcl_discount_calculator_test DEFINITION FINAL
52
- FOR TESTING
53
- RISK LEVEL HARMLESS
54
- DURATION SHORT.
55
-
56
- PRIVATE SECTION.
57
- DATA mo_cut TYPE REF TO zcl_discount_calculator. "class under test
58
-
59
- METHODS setup.
60
-
61
- "--- Tier 0%: net amount < 1 000 ---
62
- METHODS test_zero_amount FOR TESTING.
63
- METHODS test_below_first_tier FOR TESTING.
64
-
65
- "--- Tier boundary: exactly at 1 000, 5 000, 10 000 ---
66
- METHODS test_boundary_1000 FOR TESTING.
67
- METHODS test_boundary_5000 FOR TESTING.
68
- METHODS test_boundary_10000 FOR TESTING.
69
-
70
- "--- Error path: negative input ---
71
- METHODS test_negative_input FOR TESTING.
72
-
73
- ENDCLASS.
74
-
75
- CLASS zcl_discount_calculator_test IMPLEMENTATION.
76
-
77
- METHOD setup.
78
- mo_cut = NEW zcl_discount_calculator( ).
79
- ENDMETHOD.
80
-
81
- "────────────────────────────────────────────────────
82
- " Tier 0 % — net amount < 1 000
83
- "────────────────────────────────────────────────────
84
-
85
- METHOD test_zero_amount.
86
- "Arrange
87
- DATA(lv_amount) = CONV p( '0.00' ).
88
- DATA(lv_expected) = CONV p( '0.00' ).
89
-
90
- "Act
91
- DATA lv_result TYPE p LENGTH 3 DECIMALS 2.
92
- TRY.
93
- lv_result = mo_cut->calculate_discount( iv_net_amount = lv_amount ).
94
- CATCH zcx_discount_error INTO DATA(lx).
95
- cl_abap_unit_assert=>fail(
96
- msg = |Unexpected ZCX_DISCOUNT_ERROR for zero amount: { lx->get_text( ) }| ).
97
- ENDTRY.
98
-
99
- "Assert
100
- cl_abap_unit_assert=>assert_equals(
101
- act = lv_result
102
- exp = lv_expected
103
- msg = 'Zero amount should yield 0% discount' ).
104
- ENDMETHOD.
105
-
106
- METHOD test_below_first_tier.
107
- "Arrange: 500.00 is solidly inside the first tier
108
- DATA(lv_amount) = CONV p( '500.00' ).
109
- DATA(lv_expected) = CONV p( '0.00' ).
110
-
111
- "Act
112
- DATA lv_result TYPE p LENGTH 3 DECIMALS 2.
113
- TRY.
114
- lv_result = mo_cut->calculate_discount( iv_net_amount = lv_amount ).
115
- CATCH zcx_discount_error INTO DATA(lx).
116
- cl_abap_unit_assert=>fail(
117
- msg = |Unexpected ZCX_DISCOUNT_ERROR for 500.00: { lx->get_text( ) }| ).
118
- ENDTRY.
119
-
120
- cl_abap_unit_assert=>assert_equals(
121
- act = lv_result
122
- exp = lv_expected
123
- msg = '500.00 should yield 0% discount (tier 1: < 1000)' ).
124
- ENDMETHOD.
125
-
126
- "────────────────────────────────────────────────────
127
- " Tier boundaries — the most failure-prone values
128
- "────────────────────────────────────────────────────
129
-
130
- METHOD test_boundary_1000.
131
- "1 000.00 is the first value in tier 2 (5%), NOT in tier 1 (0%)
132
- DATA(lv_amount) = CONV p( '1000.00' ).
133
- DATA(lv_expected) = CONV p( '5.00' ).
134
-
135
- DATA lv_result TYPE p LENGTH 3 DECIMALS 2.
136
- TRY.
137
- lv_result = mo_cut->calculate_discount( iv_net_amount = lv_amount ).
138
- CATCH zcx_discount_error INTO DATA(lx).
139
- cl_abap_unit_assert=>fail(
140
- msg = |Unexpected ZCX_DISCOUNT_ERROR for 1000.00: { lx->get_text( ) }| ).
141
- ENDTRY.
142
-
143
- cl_abap_unit_assert=>assert_equals(
144
- act = lv_result
145
- exp = lv_expected
146
- msg = '1000.00 must enter tier 2 → 5% (boundary: iv_net_amount < 1000 is false)' ).
147
- ENDMETHOD.
148
-
149
- METHOD test_boundary_5000.
150
- "5 000.00 is the first value in tier 3 (10%)
151
- DATA(lv_amount) = CONV p( '5000.00' ).
152
- DATA(lv_expected) = CONV p( '10.00' ).
153
-
154
- DATA lv_result TYPE p LENGTH 3 DECIMALS 2.
155
- TRY.
156
- lv_result = mo_cut->calculate_discount( iv_net_amount = lv_amount ).
157
- CATCH zcx_discount_error INTO DATA(lx).
158
- cl_abap_unit_assert=>fail(
159
- msg = |Unexpected ZCX_DISCOUNT_ERROR for 5000.00: { lx->get_text( ) }| ).
160
- ENDTRY.
161
-
162
- cl_abap_unit_assert=>assert_equals(
163
- act = lv_result
164
- exp = lv_expected
165
- msg = '5000.00 must enter tier 3 → 10% (boundary: iv_net_amount < 5000 is false)' ).
166
- ENDMETHOD.
167
-
168
- METHOD test_boundary_10000.
169
- "10 000.00 hits the ELSE branch → 15%
170
- DATA(lv_amount) = CONV p( '10000.00' ).
171
- DATA(lv_expected) = CONV p( '15.00' ).
172
-
173
- DATA lv_result TYPE p LENGTH 3 DECIMALS 2.
174
- TRY.
175
- lv_result = mo_cut->calculate_discount( iv_net_amount = lv_amount ).
176
- CATCH zcx_discount_error INTO DATA(lx).
177
- cl_abap_unit_assert=>fail(
178
- msg = |Unexpected ZCX_DISCOUNT_ERROR for 10000.00: { lx->get_text( ) }| ).
179
- ENDTRY.
180
-
181
- cl_abap_unit_assert=>assert_equals(
182
- act = lv_result
183
- exp = lv_expected
184
- msg = '10000.00 must enter tier 4 → 15% (boundary: iv_net_amount < 10000 is false)' ).
185
- ENDMETHOD.
186
-
187
- "────────────────────────────────────────────────────
188
- " Error path
189
- "────────────────────────────────────────────────────
190
-
191
- METHOD test_negative_input.
192
- "Arrange: smallest possible negative packed decimal
193
- DATA(lv_amount) = CONV p( '-0.01' ).
194
-
195
- "Act + Assert: the exception must be raised with the correct text-id
196
- TRY.
197
- mo_cut->calculate_discount( iv_net_amount = lv_amount ).
198
- cl_abap_unit_assert=>fail(
199
- msg = 'ZCX_DISCOUNT_ERROR expected for negative input but was not raised' ).
200
- CATCH zcx_discount_error INTO DATA(lx).
201
- "Verify it is the right textid, not just any zcx_discount_error
202
- cl_abap_unit_assert=>assert_equals(
203
- act = lx->textid
204
- exp = zcx_discount_error=>negative_input
205
- msg = 'Exception textid must be NEGATIVE_INPUT' ).
206
- ENDTRY.
207
- ENDMETHOD.
208
-
209
- ENDCLASS.
210
- ```
211
-
212
- ---
213
-
214
- ## Coverage Estimate
215
-
216
- | Method | Scenarios Covered | Coverage Estimate |
217
- |---|---|---|
218
- | `calculate_discount` | 6 (all 4 COND branches + negative guard) | ~100% |
219
-
220
- **Overall Estimated Coverage:** ~100%
221
-
222
- All five reachable paths through the method are exercised:
223
- - `IF iv_net_amount < 0` → true (exception)
224
- - `IF iv_net_amount < 0` → false, then `COND` branches ×4
225
-
226
- ---
227
-
228
- ## Dependencies That Need Refactoring
229
-
230
- None. `calculate_discount` is a pure function — no database access, no external calls, no injected objects. The test class is fully self-contained.
231
-
232
- ---
233
-
234
- > **Review reminder:** The expected discount values (`0.00`, `5.00`, `10.00`, `15.00`) were inferred directly from the implementation. Before activating, confirm they match the **business specification**, not just the current code — tests that mirror a bug prove nothing.