minicode-ai 0.14.1 → 0.14.2

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 (79) hide show
  1. package/README.md +1 -1
  2. package/cli/auto-update.ts +32 -2
  3. package/cli/index.ts +10 -2
  4. package/cli/setup.ts +8 -3
  5. package/cli/tui.ts +18 -15
  6. package/docs/OUTPUT_PROTOCOL_SPEC.md +6 -0
  7. package/docs/OUTPUT_RENDERING_SPEC.md +28 -4
  8. package/docs/README.md +2 -2
  9. package/docs/TERMINAL_CONTRACT.md +52 -26
  10. package/docs/getting-started.md +14 -12
  11. package/docs/glossary.md +1 -1
  12. package/docs/mcp-lsp.md +1 -1
  13. package/docs/policy-sandbox.md +7 -1
  14. package/docs/security-model.md +2 -2
  15. package/docs/security.md +7 -1
  16. package/docs/tools.md +4 -4
  17. package/docs/verify-benchmark.md +16 -0
  18. package/package.json +1 -3
  19. package/src/app/mentions.ts +4 -3
  20. package/src/app/session.ts +13 -9
  21. package/src/app/tool-layer.ts +6 -0
  22. package/src/constants.ts +17 -0
  23. package/src/lib/git-hardening.ts +27 -22
  24. package/src/lib/safe-open.ts +73 -19
  25. package/src/lib/trusted-exec.ts +7 -4
  26. package/src/mcp/client.ts +34 -9
  27. package/src/mcp/transport.ts +96 -42
  28. package/src/memory/files.ts +15 -4
  29. package/src/memory/vector.ts +5 -1
  30. package/src/policy/context.ts +21 -13
  31. package/src/policy/tool-contract.ts +4 -10
  32. package/src/policy/update-check.ts +83 -6
  33. package/src/policy/usage.ts +17 -7
  34. package/src/presentation/adapter.ts +64 -2
  35. package/src/presentation/events.ts +6 -0
  36. package/src/presentation/model.ts +1 -0
  37. package/src/presentation/projection.ts +2 -0
  38. package/src/presentation/reducer.ts +1 -0
  39. package/src/providers/anthropic.ts +52 -19
  40. package/src/providers/guards.ts +98 -13
  41. package/src/providers/responses.ts +61 -23
  42. package/src/providers/sse-bounds.ts +170 -0
  43. package/src/repo/repomap.ts +10 -11
  44. package/src/runtime/execution-backend.ts +7 -8
  45. package/src/sandbox/docker.ts +113 -9
  46. package/src/session/checkpoint.ts +9 -2
  47. package/src/session/persistence.ts +5 -2
  48. package/src/session/verification.ts +55 -16
  49. package/src/skills/loader.ts +16 -3
  50. package/src/tools/bash.ts +6 -3
  51. package/src/tools/code_run.ts +6 -5
  52. package/src/tools/context.ts +8 -0
  53. package/src/tools/delete_file.ts +2 -1
  54. package/src/tools/edit.ts +2 -1
  55. package/src/tools/git.ts +128 -54
  56. package/src/tools/glob.ts +2 -1
  57. package/src/tools/grep.ts +31 -6
  58. package/src/tools/lsp.ts +5 -4
  59. package/src/tools/mcp_call.ts +3 -1
  60. package/src/tools/memory.ts +175 -180
  61. package/src/tools/move_file.ts +2 -1
  62. package/src/tools/patch.ts +2 -1
  63. package/src/tools/read_file.ts +94 -1
  64. package/src/tools/read_image.ts +2 -1
  65. package/src/tools/task.ts +2 -1
  66. package/src/tools/todo.ts +4 -5
  67. package/src/tools/web_fetch.ts +28 -12
  68. package/src/tools/web_search.ts +28 -9
  69. package/src/tools/write_file.ts +2 -1
  70. package/src/ui/assistant/simple.ts +72 -3
  71. package/src/ui/i18n/en.ts +3 -0
  72. package/src/ui/i18n/id.ts +3 -0
  73. package/src/ui/render/width.ts +107 -79
  74. package/src/ui/runtime/screen.ts +49 -37
  75. package/src/ui/tui/app.ts +255 -205
  76. package/src/ui/tui/transcript.ts +39 -0
  77. package/CHANGELOG.md +0 -1185
  78. package/docs/PLAN_UIUX_V6.md +0 -209
  79. package/docs/changelog.md +0 -3
@@ -54,7 +54,7 @@ export interface AltScreen {
54
54
  readonly ok: boolean
55
55
  readonly cols: number
56
56
  readonly rows: number
57
- /** Lukis satu frame penuh (tepat `rows` baris dari dialog.ts). */
57
+ /** Lukis frame penuh; exception writer dipropagasikan agar owner menutup sesi. */
58
58
  paint(lines: string[], cursor?: { row: number; col: number }): void
59
59
  /**
60
60
  * Lukis REGION TANPA clear: popup di atas konten pemilik layar (App TUI).
@@ -102,6 +102,14 @@ export function openAltScreen(): AltScreen {
102
102
  process.stdout.write(RESET_REGION)
103
103
  process.stdout.write(ENTER)
104
104
  } catch {
105
+ // ENTER mungkin sudah terkirim sebelum writer melempar; pulihkan
106
+ // buffer utama sebelum menyatakan terminal tidak mampu.
107
+ try {
108
+ process.stdout.write(EXIT)
109
+ } catch {}
110
+ try {
111
+ process.stdout.write(RESET_REGION)
112
+ } catch {}
105
113
  return nullScreen()
106
114
  }
107
115
  }
@@ -130,48 +138,44 @@ export function openAltScreen(): AltScreen {
130
138
  },
131
139
  paint(lines: string[], cursor?: { row: number; col: number }): void {
132
140
  if (closed) return
133
- try {
134
- process.stdout.write(SYNC_START)
135
- process.stdout.write(HOME)
136
- process.stdout.write(CLEAR_ALL)
137
- process.stdout.write(lines.join("\r\n"))
138
- if (cursor) {
139
- const row = Math.max(1, Math.floor(cursor.row))
140
- const col = Math.max(1, Math.floor(cursor.col))
141
- process.stdout.write(`\x1b[?25l\x1b[${row};${col}H\x1b[?25h`)
142
- }
143
- process.stdout.write(SYNC_END)
144
- } catch {}
141
+ process.stdout.write(SYNC_START)
142
+ process.stdout.write(HOME)
143
+ process.stdout.write(CLEAR_ALL)
144
+ process.stdout.write(lines.join("\r\n"))
145
+ if (cursor) {
146
+ const row = Math.max(1, Math.floor(cursor.row))
147
+ const col = Math.max(1, Math.floor(cursor.col))
148
+ process.stdout.write(`\x1b[?25l\x1b[${row};${col}H\x1b[?25h`)
149
+ }
150
+ process.stdout.write(SYNC_END)
145
151
  },
146
152
  paintRegion(lines: string[], topRow: number): void {
147
153
  if (closed) return
148
154
  // Melukis nol baris = no-op murni (bukan clear): pemanggil yang ingin
149
155
  // menghapus memakai clearRegion() eksplisit.
150
156
  if (!lines.length) return
151
- try {
152
- const top = Math.max(1, Math.floor(topRow) || 1)
153
- const h = lines.length
154
- // Union region lama + baru: kotak yang menyusut/bergeser (filter,
155
- // notice hilang) harus menghapus sisa bingkainya sendiri — pemilik
156
- // layar tak tahu geometri popup.
157
- let clearTop = top
158
- let clearBottom = top + Math.max(0, h - 1)
159
- if (lastRegion) {
160
- clearTop = Math.min(clearTop, lastRegion.top)
161
- clearBottom = Math.max(clearBottom, lastRegion.top + lastRegion.height - 1)
162
- }
163
- let out = SYNC_START
164
- for (let r = clearTop; r <= clearBottom; r++) {
165
- const i = r - top
166
- // Baris diasumsi satu-baris-tersanitasi dari dialogBox (tanpa \n —
167
- // \n akan menggeser kursor dan merusak baris berikut; split defensif).
168
- const row = i >= 0 && i < h ? ((lines[i] ?? "").split("\n")[0] ?? "") : ""
169
- out += `\x1b[${r};1H\x1b[2K${row}`
170
- }
171
- out += SYNC_END
172
- process.stdout.write(out)
173
- lastRegion = h > 0 ? { top, height: h } : null
174
- } catch {}
157
+ const top = Math.max(1, Math.floor(topRow) || 1)
158
+ const h = lines.length
159
+ // Union region lama + baru: kotak yang menyusut/bergeser (filter,
160
+ // notice hilang) harus menghapus sisa bingkainya sendiri — pemilik
161
+ // layar tak tahu geometri popup.
162
+ let clearTop = top
163
+ let clearBottom = top + Math.max(0, h - 1)
164
+ if (lastRegion) {
165
+ clearTop = Math.min(clearTop, lastRegion.top)
166
+ clearBottom = Math.max(clearBottom, lastRegion.top + lastRegion.height - 1)
167
+ }
168
+ let out = SYNC_START
169
+ for (let r = clearTop; r <= clearBottom; r++) {
170
+ const i = r - top
171
+ // Baris diasumsi satu-baris-tersanitasi dari dialogBox (tanpa \n —
172
+ // \n akan menggeser kursor dan merusak baris berikut; split defensif).
173
+ const row = i >= 0 && i < h ? ((lines[i] ?? "").split("\n")[0] ?? "") : ""
174
+ out += `\x1b[${r};1H\x1b[2K${row}`
175
+ }
176
+ out += SYNC_END
177
+ process.stdout.write(out)
178
+ lastRegion = h > 0 ? { top, height: h } : null
175
179
  },
176
180
  clearRegion(): void {
177
181
  if (closed) return
@@ -195,6 +199,9 @@ export function openAltScreen(): AltScreen {
195
199
  } catch {}
196
200
  depth = Math.max(0, depth - 1)
197
201
  if (depth === 0) {
202
+ try {
203
+ process.stdout.write(SYNC_END)
204
+ } catch {}
198
205
  try {
199
206
  process.stdout.write(EXIT)
200
207
  } catch {}
@@ -218,8 +225,13 @@ export function altScreenDepth(): number {
218
225
  */
219
226
  export function forceRestoreScreenForSignal(): void {
220
227
  if (depth > 0) {
228
+ try {
229
+ process.stdout.write(SYNC_END)
230
+ } catch {}
221
231
  try {
222
232
  process.stdout.write(EXIT)
233
+ } catch {}
234
+ try {
223
235
  process.stdout.write(RESET_REGION)
224
236
  } catch {}
225
237
  depth = 0