@floydous/pi-agent-kernel 0.4.3 → 0.6.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.
Files changed (65) hide show
  1. package/AGENT_KERNEL_SYS_PROMPT.md +15 -12
  2. package/CHANGELOG.md +87 -0
  3. package/README.md +6 -54
  4. package/config.example.toml +1 -8
  5. package/docs/README.md +1 -2
  6. package/docs/architecture.md +2 -3
  7. package/docs/configuration.md +11 -10
  8. package/docs/editing-and-verification.md +21 -8
  9. package/docs/podman-linux-checks.md +24 -0
  10. package/docs/release-discipline.md +10 -0
  11. package/docs/retrieval.md +21 -23
  12. package/docs/testing.md +3 -3
  13. package/grammars/tree-sitter-html.wasm +0 -0
  14. package/package.json +5 -3
  15. package/src/config/agent_kernel_command.ts +60 -625
  16. package/src/config/kernel_config.ts +53 -69
  17. package/src/config/toml.ts +6 -1
  18. package/src/editing/auto_heal.ts +1 -1
  19. package/src/editing/patch.ts +75 -37
  20. package/src/editing/post_edit_verification.ts +20 -14
  21. package/src/editing/smart_anchor.ts +9 -6
  22. package/src/editing/syntax-verify.ts +79 -222
  23. package/src/index.ts +36 -453
  24. package/src/retrieval/html_chunker.ts +526 -0
  25. package/src/retrieval/search_bm25.ts +39 -28
  26. package/src/retrieval/search_chunker.ts +69 -7
  27. package/src/retrieval/search_config.ts +21 -40
  28. package/src/retrieval/search_embedder.ts +14 -31
  29. package/src/retrieval/search_index.ts +338 -129
  30. package/src/retrieval/search_modal.ts +1208 -222
  31. package/src/retrieval/{repomap.ts → tag_extractor.ts} +6 -293
  32. package/src/retrieval/tree_sitter_engine.ts +171 -36
  33. package/src/retrieval/workspace_walker.ts +78 -2
  34. package/src/safety/atomic_write.ts +1 -1
  35. package/src/safety/epistemic_guard.ts +105 -31
  36. package/src/safety/host_environment.ts +180 -0
  37. package/src/safety/output_clamper.ts +97 -27
  38. package/src/tools/code_search_output.ts +11 -2
  39. package/src/tools/code_search_tool.ts +25 -13
  40. package/src/tools/context.ts +11 -10
  41. package/src/tools/edit_tool.ts +243 -154
  42. package/src/tools/read_tool.ts +285 -214
  43. package/src/tools/stream_reader.ts +206 -0
  44. package/src/ui/footer.ts +7 -7
  45. package/docs/lsp.md +0 -31
  46. package/src/lsp/adapters/base.ts +0 -42
  47. package/src/lsp/adapters/index.ts +0 -21
  48. package/src/lsp/adapters/python.ts +0 -37
  49. package/src/lsp/adapters/rust.ts +0 -35
  50. package/src/lsp/adapters/typescript.ts +0 -40
  51. package/src/lsp/index.ts +0 -13
  52. package/src/lsp/lsp_client.ts +0 -765
  53. package/src/lsp/lsp_detector.ts +0 -52
  54. package/src/lsp/lsp_formatter.ts +0 -323
  55. package/src/lsp/lsp_installer.ts +0 -320
  56. package/src/lsp/lsp_manager.ts +0 -202
  57. package/src/lsp/lsp_modal.ts +0 -675
  58. package/src/lsp/lsp_registry.ts +0 -600
  59. package/src/lsp/lsp_types.ts +0 -143
  60. package/src/retrieval/ast_search.ts +0 -999
  61. package/src/retrieval/symbol_reader.ts +0 -228
  62. package/src/tools/ast_search_formatter.ts +0 -161
  63. package/src/tools/ast_search_tool.ts +0 -146
  64. package/src/tools/lsp_tool.ts +0 -794
  65. package/src/tools/repo_map_tool.ts +0 -56
@@ -1,56 +0,0 @@
1
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
- import { Type } from "typebox";
3
- import { Text, makeOutputText } from "../ui/tui_utils";
4
- import { computeRepoMap } from "../retrieval/repomap";
5
- import { loadKernelConfig } from "../config";
6
-
7
- /** Extracted from index.ts — registers the `repo_map` tool. */
8
- export function registerRepoMapTool(pi: ExtensionAPI): void {
9
- // 4. Tool: `get_repo_map` (Tree-sitter PageRank Map)
10
- pi.registerTool({
11
- name: "get_repo_map",
12
- label: "Get Repository Map",
13
- description: "Get PageRank-ranked AST map of symbols across repository.",
14
- promptSnippet: "Inspect repository AST symbol graph and signatures",
15
- renderShell: "default",
16
- parameters: Type.Object({
17
- budget_tokens: Type.Optional(
18
- Type.Number({ description: "Target token budget (default: 1024)" }),
19
- ),
20
- }),
21
- async execute(
22
- _toolCallId: string,
23
- params: any,
24
- _signal: any,
25
- _onUpdate: any,
26
- ctx: any,
27
- ) {
28
- const configuredBudget = loadKernelConfig(ctx.cwd).retrieval.repo_map_budget;
29
- const budget = params.budget_tokens ?? configuredBudget;
30
- const repoMap = computeRepoMap(ctx.cwd, budget);
31
- return {
32
- content: [{ type: "text", text: repoMap }],
33
- details: { budget, length: repoMap.length },
34
- };
35
- },
36
- renderCall(args: any, theme: any, _context: any) {
37
- return makeOutputText(
38
- `${theme.fg("toolTitle", theme.bold("get_repo_map"))} (budget: ${args?.budget_tokens ?? 1024})`,
39
- );
40
- },
41
- renderResult(result: any, options: any, theme: any, context: any) {
42
- if (context.isError) {
43
- const errMsg =
44
- result.content?.find((c: any) => c.type === "text")?.text ||
45
- "Repo map failed";
46
- return makeOutputText(`\n${theme.fg("error", errMsg)}`);
47
- }
48
- if (!options.expanded) {
49
- return new Text("", 0, 0);
50
- }
51
- const output =
52
- result.content?.find((c: any) => c.type === "text")?.text || "";
53
- return makeOutputText(`\n${theme.fg("toolOutput", output)}`);
54
- },
55
- });
56
- }