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.
- package/README.md +34 -178
- package/cli/args.ts +10 -18
- package/cli/auto-update.ts +32 -2
- package/cli/commands/acp.ts +20 -27
- package/cli/commands/daemon.ts +6 -7
- package/cli/commands/exec.ts +12 -10
- package/cli/commands.ts +6 -9
- package/cli/index.ts +40 -17
- package/cli/provider-manager.ts +1 -3
- package/cli/setup.ts +174 -145
- package/cli/tui.ts +33 -38
- package/docs/CONTROL-PLANE-MAP.md +145 -0
- package/docs/OUTPUT_EVENT_MODEL.md +1 -1
- package/docs/OUTPUT_PROTOCOL_SPEC.md +8 -2
- package/docs/OUTPUT_RENDERING_SPEC.md +35 -6
- package/docs/OUTPUT_UX_RULES.md +1 -1
- package/docs/README.md +14 -102
- package/docs/SUMMARY.md +53 -0
- package/docs/TERMINAL_CONTRACT.md +136 -77
- package/docs/UI_RENDER_PIPELINE.md +204 -0
- package/docs/agents.md +5 -5
- package/docs/architecture.md +23 -12
- package/docs/choosing-mode.md +7 -7
- package/docs/cli.md +22 -29
- package/docs/concepts.md +1 -1
- package/docs/config.md +10 -5
- package/docs/contributing.md +6 -6
- package/docs/environment.md +3 -1
- package/docs/exec.md +5 -5
- package/docs/getting-started.md +14 -12
- package/docs/glossary.md +9 -7
- package/docs/mcp-lsp.md +1 -1
- package/docs/memory-sessions.md +7 -5
- package/docs/policy-sandbox.md +23 -15
- package/docs/quickstart.md +2 -2
- package/docs/repl.md +4 -3
- package/docs/security-model.md +16 -17
- package/docs/security.md +15 -30
- package/docs/skills.md +1 -1
- package/docs/tools.md +6 -6
- package/docs/verify-benchmark.md +16 -0
- package/package.json +5 -5
- package/scripts/vendor-overlays/minicode-context.patch +109 -0
- package/src/app/mentions.ts +4 -3
- package/src/app/provider-layer.ts +13 -1
- package/src/app/session.ts +229 -22
- package/src/app/tool-layer.ts +6 -0
- package/src/config.ts +30 -3
- package/src/constants.ts +19 -0
- package/src/daemon/control.ts +1 -1
- package/src/lib/git-hardening.ts +27 -22
- package/src/lib/safe-open.ts +73 -19
- package/src/lib/trusted-exec.ts +7 -4
- package/src/mcp/client.ts +34 -9
- package/src/mcp/server.ts +2 -3
- package/src/mcp/transport.ts +96 -42
- package/src/memory/files.ts +15 -4
- package/src/memory/vector.ts +5 -1
- package/src/policy/compaction.ts +272 -16
- package/src/policy/context-window.ts +73 -0
- package/src/policy/context.ts +76 -16
- package/src/policy/ratelimit.ts +47 -18
- package/src/policy/tool-contract.ts +4 -10
- package/src/policy/update-check.ts +83 -6
- package/src/policy/usage.ts +31 -14
- package/src/policy/work-mode.ts +1 -1
- package/src/presentation/adapter.ts +64 -2
- package/src/presentation/events.ts +6 -0
- package/src/presentation/model.ts +1 -0
- package/src/presentation/projection.ts +2 -0
- package/src/presentation/reducer.ts +1 -0
- package/src/providers/anthropic.ts +52 -19
- package/src/providers/guards.ts +158 -16
- package/src/providers/provision.ts +12 -3
- package/src/providers/responses.ts +61 -23
- package/src/providers/router.ts +56 -23
- package/src/providers/sse-bounds.ts +170 -0
- package/src/repo/repomap.ts +10 -11
- package/src/runtime/execution-backend.ts +7 -8
- package/src/sandbox/docker.ts +113 -9
- package/src/session/checkpoint.ts +9 -2
- package/src/session/context-projection.ts +14 -0
- package/src/session/context-selector.ts +58 -20
- package/src/session/persistence.ts +6 -3
- package/src/session/verification.ts +55 -16
- package/src/skills/loader.ts +16 -3
- package/src/task/model.ts +21 -70
- package/src/tools/bash.ts +6 -3
- package/src/tools/code_run.ts +6 -5
- package/src/tools/context.ts +8 -0
- package/src/tools/delete_file.ts +2 -1
- package/src/tools/edit.ts +2 -1
- package/src/tools/git.ts +128 -54
- package/src/tools/glob.ts +2 -1
- package/src/tools/grep.ts +31 -6
- package/src/tools/lsp.ts +5 -4
- package/src/tools/mcp_call.ts +3 -1
- package/src/tools/memory.ts +175 -180
- package/src/tools/move_file.ts +2 -1
- package/src/tools/patch.ts +2 -1
- package/src/tools/read_file.ts +94 -1
- package/src/tools/read_image.ts +2 -1
- package/src/tools/task.ts +9 -1
- package/src/tools/todo.ts +4 -5
- package/src/tools/web_fetch.ts +28 -12
- package/src/tools/web_search.ts +28 -9
- package/src/tools/write_file.ts +2 -1
- package/src/ui/assistant/simple.ts +72 -3
- package/src/ui/footer.ts +131 -66
- package/src/ui/i18n/en.ts +3 -11
- package/src/ui/i18n/id.ts +3 -11
- package/src/ui/input/input.ts +2 -3
- package/src/ui/input/prompt-engine.ts +2 -5
- package/src/ui/render/width.ts +107 -79
- package/src/ui/runtime/screen.ts +49 -37
- package/src/ui/screens/model-manager.ts +3 -10
- package/src/ui/screens/picker.ts +23 -40
- package/src/ui/screens/provider-manager.ts +12 -33
- package/src/ui/screens/wizard.ts +0 -1
- package/src/ui/tui/app.ts +265 -211
- package/src/ui/tui/transcript.ts +87 -8
- package/vendor/minicore/VENDOR.md +9 -5
- package/vendor/minicore/src/core/loop.ts +47 -12
- package/vendor/minicore/src/core/provider.ts +4 -0
- package/vendor/minicore/src/core/session.ts +14 -1
- package/CHANGELOG.md +0 -1185
- package/docs/OUTPUT_ARCHITECTURE_AUDIT.md +0 -489
- package/docs/OUTPUT_IMPLEMENTATION_PLAN.md +0 -391
- package/docs/PLAN_UIUX_V6.md +0 -209
- 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 {
|
|
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
|
|
23
|
-
const PROVIDER_BOX_W =
|
|
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
|
|
90
|
-
//
|
|
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 -
|
|
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
|
|
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
|
-
//
|
|
117
|
-
//
|
|
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
|
-
|
|
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
|
|
132
|
+
// pemilik layar. Lebar tetap 52 agar daftar tidak kosong terlalu lebar.
|
|
152
133
|
const box = dialogBox(
|
|
153
134
|
{
|
|
154
|
-
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))
|