minicode-ai 0.14.1 → 0.14.4

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 (130) hide show
  1. package/README.md +34 -178
  2. package/cli/args.ts +10 -18
  3. package/cli/auto-update.ts +32 -2
  4. package/cli/commands/acp.ts +20 -27
  5. package/cli/commands/daemon.ts +6 -7
  6. package/cli/commands/exec.ts +12 -10
  7. package/cli/commands.ts +6 -9
  8. package/cli/index.ts +40 -17
  9. package/cli/provider-manager.ts +1 -3
  10. package/cli/setup.ts +174 -145
  11. package/cli/tui.ts +33 -38
  12. package/docs/CONTROL-PLANE-MAP.md +145 -0
  13. package/docs/OUTPUT_EVENT_MODEL.md +1 -1
  14. package/docs/OUTPUT_PROTOCOL_SPEC.md +8 -2
  15. package/docs/OUTPUT_RENDERING_SPEC.md +35 -6
  16. package/docs/OUTPUT_UX_RULES.md +1 -1
  17. package/docs/README.md +14 -102
  18. package/docs/SUMMARY.md +53 -0
  19. package/docs/TERMINAL_CONTRACT.md +136 -77
  20. package/docs/UI_RENDER_PIPELINE.md +204 -0
  21. package/docs/agents.md +5 -5
  22. package/docs/architecture.md +23 -12
  23. package/docs/choosing-mode.md +7 -7
  24. package/docs/cli.md +22 -29
  25. package/docs/concepts.md +1 -1
  26. package/docs/config.md +10 -5
  27. package/docs/contributing.md +6 -6
  28. package/docs/environment.md +3 -1
  29. package/docs/exec.md +5 -5
  30. package/docs/getting-started.md +14 -12
  31. package/docs/glossary.md +9 -7
  32. package/docs/mcp-lsp.md +1 -1
  33. package/docs/memory-sessions.md +7 -5
  34. package/docs/policy-sandbox.md +23 -15
  35. package/docs/quickstart.md +2 -2
  36. package/docs/repl.md +4 -3
  37. package/docs/security-model.md +16 -17
  38. package/docs/security.md +15 -30
  39. package/docs/skills.md +1 -1
  40. package/docs/tools.md +6 -6
  41. package/docs/verify-benchmark.md +16 -0
  42. package/package.json +5 -5
  43. package/scripts/vendor-overlays/minicode-context.patch +109 -0
  44. package/src/app/mentions.ts +4 -3
  45. package/src/app/provider-layer.ts +13 -1
  46. package/src/app/session.ts +229 -22
  47. package/src/app/tool-layer.ts +6 -0
  48. package/src/config.ts +30 -3
  49. package/src/constants.ts +19 -0
  50. package/src/daemon/control.ts +1 -1
  51. package/src/lib/git-hardening.ts +27 -22
  52. package/src/lib/safe-open.ts +73 -19
  53. package/src/lib/trusted-exec.ts +7 -4
  54. package/src/mcp/client.ts +34 -9
  55. package/src/mcp/server.ts +2 -3
  56. package/src/mcp/transport.ts +96 -42
  57. package/src/memory/files.ts +15 -4
  58. package/src/memory/vector.ts +5 -1
  59. package/src/policy/compaction.ts +272 -16
  60. package/src/policy/context-window.ts +73 -0
  61. package/src/policy/context.ts +76 -16
  62. package/src/policy/ratelimit.ts +47 -18
  63. package/src/policy/tool-contract.ts +4 -10
  64. package/src/policy/update-check.ts +83 -6
  65. package/src/policy/usage.ts +31 -14
  66. package/src/policy/work-mode.ts +1 -1
  67. package/src/presentation/adapter.ts +64 -2
  68. package/src/presentation/events.ts +6 -0
  69. package/src/presentation/model.ts +1 -0
  70. package/src/presentation/projection.ts +2 -0
  71. package/src/presentation/reducer.ts +1 -0
  72. package/src/providers/anthropic.ts +52 -19
  73. package/src/providers/guards.ts +158 -16
  74. package/src/providers/provision.ts +12 -3
  75. package/src/providers/responses.ts +61 -23
  76. package/src/providers/router.ts +56 -23
  77. package/src/providers/sse-bounds.ts +170 -0
  78. package/src/repo/repomap.ts +10 -11
  79. package/src/runtime/execution-backend.ts +7 -8
  80. package/src/sandbox/docker.ts +113 -9
  81. package/src/session/checkpoint.ts +9 -2
  82. package/src/session/context-projection.ts +14 -0
  83. package/src/session/context-selector.ts +58 -20
  84. package/src/session/persistence.ts +6 -3
  85. package/src/session/verification.ts +55 -16
  86. package/src/skills/loader.ts +16 -3
  87. package/src/task/model.ts +21 -70
  88. package/src/tools/bash.ts +6 -3
  89. package/src/tools/code_run.ts +6 -5
  90. package/src/tools/context.ts +8 -0
  91. package/src/tools/delete_file.ts +2 -1
  92. package/src/tools/edit.ts +2 -1
  93. package/src/tools/git.ts +128 -54
  94. package/src/tools/glob.ts +2 -1
  95. package/src/tools/grep.ts +31 -6
  96. package/src/tools/lsp.ts +5 -4
  97. package/src/tools/mcp_call.ts +3 -1
  98. package/src/tools/memory.ts +175 -180
  99. package/src/tools/move_file.ts +2 -1
  100. package/src/tools/patch.ts +2 -1
  101. package/src/tools/read_file.ts +94 -1
  102. package/src/tools/read_image.ts +2 -1
  103. package/src/tools/task.ts +9 -1
  104. package/src/tools/todo.ts +4 -5
  105. package/src/tools/web_fetch.ts +28 -12
  106. package/src/tools/web_search.ts +28 -9
  107. package/src/tools/write_file.ts +2 -1
  108. package/src/ui/assistant/simple.ts +72 -3
  109. package/src/ui/footer.ts +131 -66
  110. package/src/ui/i18n/en.ts +3 -11
  111. package/src/ui/i18n/id.ts +3 -11
  112. package/src/ui/input/input.ts +2 -3
  113. package/src/ui/input/prompt-engine.ts +2 -5
  114. package/src/ui/render/width.ts +107 -79
  115. package/src/ui/runtime/screen.ts +49 -37
  116. package/src/ui/screens/model-manager.ts +3 -10
  117. package/src/ui/screens/picker.ts +23 -40
  118. package/src/ui/screens/provider-manager.ts +12 -33
  119. package/src/ui/screens/wizard.ts +0 -1
  120. package/src/ui/tui/app.ts +265 -211
  121. package/src/ui/tui/transcript.ts +87 -8
  122. package/vendor/minicore/VENDOR.md +9 -5
  123. package/vendor/minicore/src/core/loop.ts +47 -12
  124. package/vendor/minicore/src/core/provider.ts +4 -0
  125. package/vendor/minicore/src/core/session.ts +14 -1
  126. package/CHANGELOG.md +0 -1185
  127. package/docs/OUTPUT_ARCHITECTURE_AUDIT.md +0 -489
  128. package/docs/OUTPUT_IMPLEMENTATION_PLAN.md +0 -391
  129. package/docs/PLAN_UIUX_V6.md +0 -209
  130. package/docs/changelog.md +0 -3
@@ -11,7 +11,7 @@ import {
11
11
  } from "../input/prompt-engine.ts"
12
12
  import { sanitizeAnsiLine } from "../render/sanitize.ts"
13
13
  import { c, glyphs, stripAnsi } from "../render/theme.ts"
14
- import { displayWidth, padToWidth, truncateToWidth } from "../render/width.ts"
14
+ import { truncateToWidth } from "../render/width.ts"
15
15
  import { type AltScreen, openAltScreen } from "../runtime/screen.ts"
16
16
  import { boxLeftPad, dialogBox } from "./dialog.ts"
17
17
  import { runForm, validateRequired, validateUrl } from "./form.ts"
@@ -19,8 +19,8 @@ import { runPicker } from "./picker.ts"
19
19
 
20
20
  const dim = (s: string): string => c.dim(s)
21
21
 
22
- /** Lebar kotak popup provider TETAP (lebih lebar: kolom URL panjang). */
23
- const PROVIDER_BOX_W = 76
22
+ /** Lebar tetap popup provider setelah daftar diringkas ke nama provider. */
23
+ const PROVIDER_BOX_W = 52
24
24
 
25
25
  export interface ProviderRow {
26
26
  id: string
@@ -86,19 +86,18 @@ export async function runProviderManagerView(opts: ProviderManagerViewOptions):
86
86
  }
87
87
 
88
88
  return new Promise<void>((resolve) => {
89
- // Ukuran mengikuti terminal SUNGGUHAN (lihat picker.ts untuk alasan sama).
90
- // Popup: jatah dialog rows−4 sudah termasuk baris counter/notice, jadi
91
- // item dibatasi rows−5 (lihat picker.ts).
89
+ // Ukuran mengikuti terminal sungguhan; satu baris border atas/bawah dan
90
+ // kemungkinan notice tetap masuk ke perhitungan tinggi.
92
91
  const visibleRows = () => {
93
92
  const rows = process.stdout.rows || 24
94
- return Math.max(1, Math.min(rows - 5, 14))
93
+ return Math.max(1, Math.min(rows - 3, 14))
95
94
  }
96
95
  // Lebar konten = lebar kotak TETAP (min=max, paritas picker/model) —
97
96
  // dikurangi chrome dialog (lihat picker.ts).
98
97
  const width = () =>
99
98
  Math.max(8, Math.min((process.stdout.columns || 80) - 2 - 4, PROVIDER_BOX_W - 4))
100
99
 
101
- // Isi popup (judul + hint dibingkai dialog).
100
+ // Isi popup ringkas: nama provider dan hasil aksi sementara.
102
101
  const bodyLines = (): string[] => {
103
102
  const v = visibleRows()
104
103
  if (sel < scroll) scroll = sel
@@ -113,47 +112,28 @@ export async function runProviderManagerView(opts: ProviderManagerViewOptions):
113
112
  for (let i = 0; i < rows.length; i++) {
114
113
  const it = rows[i]!
115
114
  const picked = i === sel - scroll
116
- // Tandai provider yang sedang aktif supaya user tahu apa yang akan
117
- // hilang bila ia menekan d. ID/URL dari config (data kotor mungkin)
118
- // disanitasi seperti label picker.
115
+ // Nama provider dan status aktif cukup untuk memilih tanpa memenuhi
116
+ // daftar dengan URL dan jumlah model.
119
117
  const aktif = opts.currentModel?.startsWith(`${it.id}::`)
120
118
  ? ` (${t("common.active")})`
121
119
  : ""
122
- // Status aktif TAK BOLEH ikut terpotong: URL dipotong dari budget
123
- // sisa SETELAH head+aktif (dulu truncate menelan "(aktif)" dulu
124
- // saat URL panjang — user tak tahu mana yang aktif).
125
- const head = `${padToWidth(sanitizeAnsiLine(it.id), 18)} ${t("prov.models", { n: it.models })} `
126
- const urlBudget = Math.max(8, w - 4 - displayWidth(head) - displayWidth(aktif))
127
- const label = `${head}${truncateToWidth(sanitizeAnsiLine(it.baseUrl), urlBudget, "…")}${aktif}`
120
+ const label = `${truncateToWidth(sanitizeAnsiLine(it.id), Math.max(8, w - 4 - aktif.length), "…")}${aktif}`
128
121
  if (picked) lines.push(` ${c.accent("›")} ${c.accent(c.bold(label))}`)
129
122
  else lines.push(` ${dim(label)}`)
130
123
  }
131
- if (providers.length > scroll + v) {
132
- lines.push(cut(dim(t("dlg.more", { n: providers.length - scroll - v }))))
133
- }
134
124
  }
135
125
  // Struk transient (jalur legacy maupun modal).
136
126
  if (notice) lines.push(cut(dim(sanitizeAnsiLine(notice))))
137
127
  return lines
138
128
  }
139
129
 
140
- const hintText = (): string =>
141
- t("prov.hint", {
142
- select: c.accent(t("verb.select")),
143
- add: c.accent(t("verb.add")),
144
- delete: c.accent(t("verb.delete")),
145
- edit: c.accent(t("verb.edit")),
146
- close: c.accent(t("verb.close")),
147
- })
148
-
149
130
  const render = () => {
150
131
  // Popup komposit: HANYA region kotak (tanpa clear) di atas konten
151
- // pemilik layar. Lebar TETAP 76 (min=max) — tak bernapas.
132
+ // pemilik layar. Lebar tetap 52 agar daftar tidak kosong terlalu lebar.
152
133
  const box = dialogBox(
153
134
  {
154
- title: t("prov.title"),
135
+ title: "",
155
136
  body: bodyLines(),
156
- footer: hintText(),
157
137
  minWidth: PROVIDER_BOX_W,
158
138
  maxWidth: PROVIDER_BOX_W,
159
139
  },
@@ -350,7 +330,6 @@ export async function runProviderManagerView(opts: ProviderManagerViewOptions):
350
330
  { name: t("prov.customUrl"), provider: "", value: CUSTOM },
351
331
  ],
352
332
  filterable: true,
353
- placeholder: t("pick.placeholder"),
354
333
  onPick: (v) => resolvePick(v),
355
334
  onCancel: () => resolvePick(null),
356
335
  }).catch(() => resolvePick(null))
@@ -62,7 +62,6 @@ export async function runSetupWizardView(opts: SetupWizardViewOptions): Promise<
62
62
  title: t("wiz.gateway"),
63
63
  items,
64
64
  filterable: true,
65
- placeholder: t("pick.placeholder"),
66
65
  onPick: (v) => {
67
66
  picked = v
68
67
  },