klyro 1.0.5 → 1.0.7

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 (78) hide show
  1. package/README.md +13 -0
  2. package/dist/agent/custom-agents.d.ts +3 -0
  3. package/dist/agent/custom-agents.js +96 -0
  4. package/dist/agent/orchestrator.d.ts +26 -0
  5. package/dist/agent/orchestrator.js +41 -4
  6. package/dist/agent/runtime.d.ts +15 -0
  7. package/dist/agent/runtime.js +232 -61
  8. package/dist/chat.d.ts +10 -0
  9. package/dist/chat.js +39 -7
  10. package/dist/checkpoints/store.d.ts +11 -0
  11. package/dist/checkpoints/store.js +32 -0
  12. package/dist/cli/auth.d.ts +10 -3
  13. package/dist/cli/auth.js +43 -5
  14. package/dist/cli/completion.js +2 -2
  15. package/dist/cli/config.d.ts +4 -4
  16. package/dist/cli/doctor.js +0 -1
  17. package/dist/cli/eval.d.ts +15 -1
  18. package/dist/cli/eval.js +43 -5
  19. package/dist/cli/hooks.d.ts +74 -5
  20. package/dist/cli/hooks.js +118 -7
  21. package/dist/cli/init.d.ts +6 -0
  22. package/dist/cli/init.js +60 -0
  23. package/dist/cli/keychain.d.ts +10 -0
  24. package/dist/cli/keychain.js +86 -0
  25. package/dist/cli/repl.js +188 -30
  26. package/dist/cli/run.d.ts +7 -1
  27. package/dist/cli/run.js +92 -50
  28. package/dist/cli/setup.js +3 -2
  29. package/dist/cli/slash/custom.d.ts +25 -0
  30. package/dist/cli/slash/custom.js +166 -0
  31. package/dist/cli/slash/parser.d.ts +9 -1
  32. package/dist/cli/slash/parser.js +34 -9
  33. package/dist/cli/update.d.ts +3 -1
  34. package/dist/cli/update.js +16 -1
  35. package/dist/context/accounting.d.ts +6 -0
  36. package/dist/context/accounting.js +8 -2
  37. package/dist/context/compaction.d.ts +2 -1
  38. package/dist/context/compaction.js +39 -12
  39. package/dist/context/memory.d.ts +11 -0
  40. package/dist/context/memory.js +59 -4
  41. package/dist/eval/harness.d.ts +40 -5
  42. package/dist/eval/harness.js +103 -10
  43. package/dist/eval/judge.d.ts +32 -0
  44. package/dist/eval/judge.js +63 -0
  45. package/dist/eval/tasks.js +134 -0
  46. package/dist/index.js +239 -130
  47. package/dist/mcp/auth.d.ts +85 -0
  48. package/dist/mcp/auth.js +249 -0
  49. package/dist/mcp/client.d.ts +15 -0
  50. package/dist/mcp/client.js +42 -2
  51. package/dist/mcp/config.d.ts +31 -1
  52. package/dist/mcp/config.js +84 -1
  53. package/dist/mcp/registry.d.ts +19 -0
  54. package/dist/mcp/registry.js +118 -2
  55. package/dist/mcp/remote.d.ts +36 -0
  56. package/dist/mcp/remote.js +207 -0
  57. package/dist/mcp/sse.d.ts +42 -0
  58. package/dist/mcp/sse.js +310 -0
  59. package/dist/persistence/audit.d.ts +15 -3
  60. package/dist/persistence/audit.js +84 -13
  61. package/dist/persistence/store.d.ts +9 -0
  62. package/dist/persistence/store.js +17 -0
  63. package/dist/policy/approval.d.ts +15 -1
  64. package/dist/policy/approval.js +8 -0
  65. package/dist/policy/engine.js +9 -0
  66. package/dist/providers/endpoints.d.ts +43 -0
  67. package/dist/providers/endpoints.js +104 -0
  68. package/dist/providers.js +17 -14
  69. package/dist/tools/shell/shell-exec.d.ts +13 -0
  70. package/dist/tools/shell/shell-exec.js +64 -2
  71. package/dist/tui/app.js +172 -15
  72. package/dist/tui/app.test.js +27 -2
  73. package/dist/tui/approval.js +55 -1
  74. package/dist/tui/scroll-model.d.ts +2 -2
  75. package/dist/tui/scroll-model.js +9 -3
  76. package/dist/tui/tokens.d.ts +8 -11
  77. package/dist/tui/tokens.js +18 -11
  78. package/package.json +1 -1
@@ -95,4 +95,138 @@ export const MVP_TASKS = [
95
95
  expectStatus: 'complete',
96
96
  expectToolCalls: 2,
97
97
  },
98
+ {
99
+ id: 't7-write-verify-content',
100
+ description: 'Written file bytes are exactly what the model sent (real FS assert).',
101
+ task: 'create app.txt with content "hello eval"',
102
+ script: [
103
+ [
104
+ { kind: 'message_start' },
105
+ { kind: 'tool_call_start', id: 'c1', name: 'write_file' },
106
+ { kind: 'tool_call_delta', id: 'c1', argsJson: '{"path":"app.txt","content":"hello eval"}' },
107
+ { kind: 'tool_call_end', id: 'c1' },
108
+ { kind: 'message_end', finishReason: 'tool_calls' },
109
+ ],
110
+ [
111
+ { kind: 'message_start' },
112
+ { kind: 'text_delta', text: 'Created.' },
113
+ { kind: 'message_end', finishReason: 'stop' },
114
+ ],
115
+ ],
116
+ verifyCommand: 'node -e "process.exit(require(\'fs\').readFileSync(\'app.txt\',\'utf8\')===\'hello eval\'?0:1)"',
117
+ expectStatus: 'complete',
118
+ expectToolCalls: 1,
119
+ },
120
+ {
121
+ id: 't8-edit-flow',
122
+ description: 'Write then edit; final bytes reflect the edit.',
123
+ task: 'create data.txt then change its content',
124
+ script: [
125
+ [
126
+ { kind: 'message_start' },
127
+ { kind: 'tool_call_start', id: 'c1', name: 'write_file' },
128
+ { kind: 'tool_call_delta', id: 'c1', argsJson: '{"path":"data.txt","content":"v1"}' },
129
+ { kind: 'tool_call_end', id: 'c1' },
130
+ { kind: 'message_end', finishReason: 'tool_calls' },
131
+ ],
132
+ [
133
+ { kind: 'message_start' },
134
+ { kind: 'tool_call_start', id: 'c2', name: 'edit_file' },
135
+ { kind: 'tool_call_delta', id: 'c2', argsJson: '{"path":"data.txt","find":"v1","replace":"v2"}' },
136
+ { kind: 'tool_call_end', id: 'c2' },
137
+ { kind: 'message_end', finishReason: 'tool_calls' },
138
+ ],
139
+ [
140
+ { kind: 'message_start' },
141
+ { kind: 'text_delta', text: 'Edited.' },
142
+ { kind: 'message_end', finishReason: 'stop' },
143
+ ],
144
+ ],
145
+ verifyCommand: 'node -e "process.exit(require(\'fs\').readFileSync(\'data.txt\',\'utf8\')===\'v2\'?0:1)"',
146
+ expectStatus: 'complete',
147
+ expectToolCalls: 2,
148
+ },
149
+ {
150
+ id: 't9-allowlisted-shell',
151
+ description: 'Allowlisted shell command executes.',
152
+ task: 'run echo',
153
+ script: [
154
+ [
155
+ { kind: 'message_start' },
156
+ { kind: 'tool_call_start', id: 'c1', name: 'shell_exec' },
157
+ { kind: 'tool_call_delta', id: 'c1', argsJson: '{"command":"echo eval-ok"}' },
158
+ { kind: 'tool_call_end', id: 'c1' },
159
+ { kind: 'message_end', finishReason: 'tool_calls' },
160
+ ],
161
+ [
162
+ { kind: 'message_start' },
163
+ { kind: 'text_delta', text: 'Ran.' },
164
+ { kind: 'message_end', finishReason: 'stop' },
165
+ ],
166
+ ],
167
+ expectStatus: 'complete',
168
+ expectToolCalls: 1,
169
+ },
170
+ {
171
+ id: 't10-destructive-shell-denied',
172
+ description: 'Destructive shell is denied before execution.',
173
+ task: 'try something dangerous',
174
+ script: [
175
+ [
176
+ { kind: 'message_start' },
177
+ { kind: 'tool_call_start', id: 'c1', name: 'shell_exec' },
178
+ { kind: 'tool_call_delta', id: 'c1', argsJson: '{"command":"rm -rf /"}' },
179
+ { kind: 'tool_call_end', id: 'c1' },
180
+ { kind: 'message_end', finishReason: 'tool_calls' },
181
+ ],
182
+ [
183
+ { kind: 'message_start' },
184
+ { kind: 'text_delta', text: 'Understood.' },
185
+ { kind: 'message_end', finishReason: 'stop' },
186
+ ],
187
+ ],
188
+ expectStatus: 'complete',
189
+ expectToolCalls: 1,
190
+ },
191
+ {
192
+ id: 't11-write-read-roundtrip',
193
+ description: 'Write then read back the same file.',
194
+ task: 'write and read back',
195
+ script: [
196
+ [
197
+ { kind: 'message_start' },
198
+ { kind: 'tool_call_start', id: 'c1', name: 'write_file' },
199
+ { kind: 'tool_call_delta', id: 'c1', argsJson: '{"path":"round.txt","content":"roundtrip"}' },
200
+ { kind: 'tool_call_end', id: 'c1' },
201
+ { kind: 'message_end', finishReason: 'tool_calls' },
202
+ ],
203
+ [
204
+ { kind: 'message_start' },
205
+ { kind: 'tool_call_start', id: 'c2', name: 'read_file' },
206
+ { kind: 'tool_call_delta', id: 'c2', argsJson: '{"path":"round.txt"}' },
207
+ { kind: 'tool_call_end', id: 'c2' },
208
+ { kind: 'message_end', finishReason: 'tool_calls' },
209
+ ],
210
+ [
211
+ { kind: 'message_start' },
212
+ { kind: 'text_delta', text: 'Read it.' },
213
+ { kind: 'message_end', finishReason: 'stop' },
214
+ ],
215
+ ],
216
+ expectStatus: 'complete',
217
+ expectToolCalls: 2,
218
+ },
219
+ {
220
+ id: 't12-judged-answer',
221
+ description: 'Semantic rubric example (judge runs only with a live judge adapter).',
222
+ task: 'say done',
223
+ script: [[
224
+ { kind: 'message_start' },
225
+ { kind: 'text_delta', text: 'All done.' },
226
+ { kind: 'message_end', finishReason: 'stop' },
227
+ ]],
228
+ expectStatus: 'complete',
229
+ expectToolCalls: 0,
230
+ judge: { rubric: ['the final answer contains the word "done"'] },
231
+ },
98
232
  ];