@shanepadgett/tau-agent 0.26.0 → 0.28.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/docs/subagents.md +1 -1
- package/extensions/appshot/README.md +1 -1
- package/extensions/appshot/index.ts +5 -11
- package/extensions/context/sync.ts +1 -9
- package/extensions/context-pruning/README.md +2 -2
- package/extensions/context-pruning/index.ts +58 -57
- package/extensions/context-pruning/prune.ts +2 -2
- package/extensions/context-pruning/render.ts +51 -39
- package/extensions/context-pruning/settings.ts +4 -5
- package/extensions/explore/README.md +13 -14
- package/extensions/explore/ast/adapter.ts +97 -0
- package/extensions/explore/ast/engine.ts +470 -0
- package/extensions/explore/ast/format/ast-search.ts +97 -0
- package/extensions/explore/ast/format/composite.ts +26 -0
- package/extensions/explore/ast/format/context.ts +66 -0
- package/extensions/explore/ast/format/deps.ts +86 -0
- package/extensions/explore/ast/format/discover.ts +85 -0
- package/extensions/explore/ast/format/impact.ts +105 -0
- package/extensions/explore/ast/format/outline.ts +66 -0
- package/extensions/explore/ast/format/relationships.ts +81 -0
- package/extensions/explore/ast/format/show.ts +38 -0
- package/extensions/explore/ast/grammars/kotlin.wasm +0 -0
- package/extensions/explore/ast/grammars/manifest.json +41 -0
- package/extensions/explore/ast/grammars/manifest.ts +99 -0
- package/extensions/explore/ast/grammars/odin.wasm +0 -0
- package/extensions/explore/ast/grammars/swift.wasm +0 -0
- package/extensions/explore/ast/graph/file-graph.ts +360 -0
- package/extensions/explore/ast/graph/relationships.ts +597 -0
- package/extensions/explore/ast/identity.ts +119 -0
- package/extensions/explore/ast/ir.ts +130 -0
- package/extensions/explore/ast/languages/csharp-file-deps.ts +189 -0
- package/extensions/explore/ast/languages/csharp.ts +493 -0
- package/extensions/explore/ast/languages/file-dep-util.ts +120 -0
- package/extensions/explore/ast/languages/fixtures/sample.cs +17 -0
- package/extensions/explore/ast/languages/fixtures/sample.java +21 -0
- package/extensions/explore/ast/languages/fixtures/sample.kt +15 -0
- package/extensions/explore/ast/languages/fixtures/sample.odin +28 -0
- package/extensions/explore/ast/languages/fixtures/sample.rs +31 -0
- package/extensions/explore/ast/languages/fixtures/sample.swift +25 -0
- package/extensions/explore/ast/languages/go-file-deps.ts +139 -0
- package/extensions/explore/ast/languages/go.ts +545 -0
- package/extensions/explore/ast/languages/java.ts +412 -0
- package/extensions/explore/ast/languages/jvm-file-deps.ts +217 -0
- package/extensions/explore/ast/languages/kotlin.ts +611 -0
- package/extensions/explore/ast/languages/odin-file-deps.ts +175 -0
- package/extensions/explore/ast/languages/odin.ts +407 -0
- package/extensions/explore/ast/languages/rust-file-deps.ts +159 -0
- package/extensions/explore/ast/languages/rust.ts +506 -0
- package/extensions/explore/ast/languages/swift-file-deps.ts +59 -0
- package/extensions/explore/ast/languages/swift.ts +466 -0
- package/extensions/explore/ast/languages/tree.ts +220 -0
- package/extensions/explore/ast/languages/typescript-file-deps.ts +259 -0
- package/extensions/explore/ast/languages/typescript-package-surface.ts +440 -0
- package/extensions/explore/ast/languages/typescript.ts +716 -0
- package/extensions/explore/ast/markdown.ts +145 -0
- package/extensions/explore/ast/package-surface.ts +42 -0
- package/extensions/explore/ast/queries/ast-search.ts +306 -0
- package/extensions/explore/ast/queries/composite-target.ts +77 -0
- package/extensions/explore/ast/queries/context.ts +406 -0
- package/extensions/explore/ast/queries/discover.ts +427 -0
- package/extensions/explore/ast/queries/impact.ts +250 -0
- package/extensions/explore/ast/queries/outline.ts +203 -0
- package/extensions/explore/ast/queries/show.ts +262 -0
- package/extensions/explore/ast/query.ts +48 -0
- package/extensions/explore/ast/read/hook.ts +125 -0
- package/extensions/explore/ast/read/policy.ts +55 -0
- package/extensions/explore/ast/registry.ts +120 -0
- package/extensions/explore/ast/scan.ts +76 -0
- package/extensions/explore/ast/slice.ts +31 -0
- package/extensions/explore/ast/tools/ast-search.ts +138 -0
- package/extensions/explore/ast/tools/context.ts +126 -0
- package/extensions/explore/ast/tools/deps.ts +72 -0
- package/extensions/explore/ast/tools/discover.ts +208 -0
- package/extensions/explore/ast/tools/impact.ts +135 -0
- package/extensions/explore/ast/tools/outline.ts +200 -0
- package/extensions/explore/ast/tools/relationships.ts +160 -0
- package/extensions/explore/ast/tools/render.ts +121 -0
- package/extensions/explore/ast/tools/reverse-deps.ts +72 -0
- package/extensions/explore/ast/tools/show.ts +116 -0
- package/extensions/explore/guidance.ts +52 -0
- package/extensions/explore/index.ts +91 -45
- package/extensions/explore/read/autoread.ts +118 -0
- package/extensions/explore/settings.ts +64 -0
- package/extensions/explore/traverse.ts +260 -86
- package/extensions/handoff/index.ts +1 -1
- package/extensions/patch/executor.ts +95 -1
- package/extensions/patch/index.ts +1 -0
- package/extensions/publish/index.ts +18 -85
- package/extensions/publish/publish-ui.ts +0 -4
- package/extensions/soul/README.md +7 -4
- package/extensions/soul/index.ts +11 -5
- package/extensions/soul/prompt.ts +30 -14
- package/extensions/soul/settings.ts +7 -2
- package/extensions/subagent/agents/context-sync.md +6 -10
- package/extensions/subagent/agents/review.md +44 -24
- package/extensions/subagent/agents/scout.md +53 -34
- package/extensions/subagent/run.ts +1 -1
- package/extensions/tau-help/help.md +2 -2
- package/package.json +6 -5
- package/schemas/tau.schema.json +51 -6
- package/{extensions/explore → shared}/autoread.ts +21 -7
- package/shared/bounded-text-result.ts +304 -0
- package/shared/events.ts +1 -0
- package/shared/full-file-knowledge.ts +49 -0
- package/shared/temporary-output-store.ts +275 -0
- package/extensions/explore/ast-tools.ts +0 -828
- package/extensions/explore/ast-worker.ts +0 -356
- package/extensions/explore/find.ts +0 -147
- package/extensions/explore/full-file-knowledge.ts +0 -234
- package/extensions/explore/grep.ts +0 -749
- package/extensions/explore/limits.ts +0 -22
- package/extensions/explore/ls.ts +0 -113
- package/extensions/explore/path-display.ts +0 -41
- package/extensions/explore/path-tree.ts +0 -150
- package/extensions/explore/read-cache.ts +0 -273
- package/extensions/explore/read-snapshots.ts +0 -57
- package/extensions/explore/read-stats-panel.ts +0 -154
- package/extensions/explore/read-stats.ts +0 -120
- package/extensions/explore/read.ts +0 -335
- package/extensions/explore/result.ts +0 -29
- package/native-bin/darwin-arm64/tau-ast +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// Point in 2D.
|
|
2
|
+
#[derive(Debug, Clone)]
|
|
3
|
+
pub struct Point {
|
|
4
|
+
pub x: i32,
|
|
5
|
+
y: i32,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/// Drawable.
|
|
9
|
+
pub trait Draw {
|
|
10
|
+
fn draw(&self);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
impl Point {
|
|
14
|
+
/// Origin.
|
|
15
|
+
pub fn origin() -> Self {
|
|
16
|
+
Self { x: 0, y: 0 }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
impl Draw for Point {
|
|
21
|
+
fn draw(&self) {}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
pub mod nested {
|
|
25
|
+
pub fn inner() {}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pub const MAX: i32 = 10;
|
|
29
|
+
pub type Alias = i32;
|
|
30
|
+
|
|
31
|
+
fn private_fn() {}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
/// Greeter type
|
|
4
|
+
public class Greeter {
|
|
5
|
+
public var name: String = ""
|
|
6
|
+
public init() {}
|
|
7
|
+
public func hello() {}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
extension Greeter {
|
|
11
|
+
public func shout() {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public protocol Named {
|
|
15
|
+
func name()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
internal struct Box {
|
|
19
|
+
var value: Int
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private enum Color {
|
|
23
|
+
case red
|
|
24
|
+
case green
|
|
25
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
2
|
+
import type { FileDepResolver } from "../adapter.ts";
|
|
3
|
+
import { externalId, findAncestorFile, internalPaths, isWithin, readTextFile } from "./file-dep-util.ts";
|
|
4
|
+
|
|
5
|
+
type GoModInfo = {
|
|
6
|
+
modulePath: string;
|
|
7
|
+
moduleRoot: string;
|
|
8
|
+
/** replace old => new local dir (absolute) */
|
|
9
|
+
replaces: Map<string, string>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function parseGoMod(text: string, moduleRoot: string): GoModInfo | undefined {
|
|
13
|
+
let modulePath: string | undefined;
|
|
14
|
+
const replaces = new Map<string, string>();
|
|
15
|
+
const lines = text.split(/\r?\n/);
|
|
16
|
+
let inReplaceBlock = false;
|
|
17
|
+
for (const raw of lines) {
|
|
18
|
+
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
19
|
+
if (line.length === 0) continue;
|
|
20
|
+
if (inReplaceBlock) {
|
|
21
|
+
if (line === ")") {
|
|
22
|
+
inReplaceBlock = false;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
parseReplaceLine(line, moduleRoot, replaces);
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (line.startsWith("module ")) {
|
|
29
|
+
modulePath = line.slice("module ".length).trim();
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (line.startsWith("replace ")) {
|
|
33
|
+
const rest = line.slice("replace ".length).trim();
|
|
34
|
+
if (rest === "(") {
|
|
35
|
+
inReplaceBlock = true;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
parseReplaceLine(rest, moduleRoot, replaces);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (modulePath === undefined || modulePath.length === 0) return undefined;
|
|
42
|
+
return { modulePath, moduleRoot, replaces };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function parseReplaceLine(line: string, moduleRoot: string, replaces: Map<string, string>): void {
|
|
46
|
+
// old [version] => new [version]
|
|
47
|
+
const parts = line.split(/\s+/);
|
|
48
|
+
const arrow = parts.indexOf("=>");
|
|
49
|
+
if (arrow <= 0 || arrow >= parts.length - 1) return;
|
|
50
|
+
const oldPath = parts[0];
|
|
51
|
+
const newPath = parts[arrow + 1];
|
|
52
|
+
if (oldPath === undefined || newPath === undefined) return;
|
|
53
|
+
if (newPath.startsWith("./") || newPath.startsWith("../") || newPath.startsWith("/")) {
|
|
54
|
+
replaces.set(oldPath, resolve(moduleRoot, newPath));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function loadGoMod(host: Parameters<FileDepResolver>[2], fromPath: string): Promise<GoModInfo | undefined> {
|
|
59
|
+
const key = `go-mod:${host.scopeRoot}`;
|
|
60
|
+
const cached = host.memo.get(key);
|
|
61
|
+
if (cached !== undefined) return cached as GoModInfo | undefined;
|
|
62
|
+
|
|
63
|
+
const goModPath = await findAncestorFile(host, dirname(fromPath), host.scopeRoot, "go.mod");
|
|
64
|
+
if (goModPath === undefined) {
|
|
65
|
+
host.memo.set(key, undefined);
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const text = await readTextFile(goModPath);
|
|
69
|
+
if (text === undefined) {
|
|
70
|
+
host.memo.set(key, undefined);
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const info = parseGoMod(text, dirname(goModPath));
|
|
74
|
+
host.memo.set(key, info);
|
|
75
|
+
return info;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function listPackageGoFiles(host: Parameters<FileDepResolver>[2], dir: string): Promise<string[]> {
|
|
79
|
+
const names = await host.readDir(dir);
|
|
80
|
+
const out: string[] = [];
|
|
81
|
+
for (const name of names) {
|
|
82
|
+
if (!name.endsWith(".go")) continue;
|
|
83
|
+
if (name.endsWith("_test.go")) continue;
|
|
84
|
+
const full = join(dir, name);
|
|
85
|
+
if ((await host.isFile(full)) && host.ownsPath(full)) out.push(full);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function firstPathElement(specifier: string): string {
|
|
91
|
+
const slash = specifier.indexOf("/");
|
|
92
|
+
return slash === -1 ? specifier : specifier.slice(0, slash);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const resolveGoFileDep: FileDepResolver = async (fromPath, specifier, host, signal) => {
|
|
96
|
+
signal.throwIfAborted();
|
|
97
|
+
const trimmed = specifier.trim().replace(/^"+|"+$/g, "");
|
|
98
|
+
if (trimmed.length === 0) return { kind: "unresolved" };
|
|
99
|
+
|
|
100
|
+
if (trimmed.startsWith("./") || trimmed.startsWith("../")) {
|
|
101
|
+
const dir = resolve(dirname(fromPath), trimmed);
|
|
102
|
+
const files = await listPackageGoFiles(host, dir);
|
|
103
|
+
return internalPaths(files.filter((path) => isWithin(host.scopeRoot, path)));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Stdlib: no dot in first path element.
|
|
107
|
+
if (!firstPathElement(trimmed).includes(".")) {
|
|
108
|
+
return externalId(trimmed);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const mod = await loadGoMod(host, fromPath);
|
|
112
|
+
if (mod === undefined) return externalId(trimmed);
|
|
113
|
+
|
|
114
|
+
// replace takes precedence
|
|
115
|
+
for (const [oldPath, newDir] of mod.replaces) {
|
|
116
|
+
if (trimmed === oldPath || trimmed.startsWith(`${oldPath}/`)) {
|
|
117
|
+
const rest = trimmed === oldPath ? "" : trimmed.slice(oldPath.length + 1);
|
|
118
|
+
const dir = rest.length === 0 ? newDir : join(newDir, ...rest.split("/"));
|
|
119
|
+
if (!isWithin(host.scopeRoot, dir) && dir !== host.scopeRoot) return externalId(trimmed);
|
|
120
|
+
const files = await listPackageGoFiles(host, dir);
|
|
121
|
+
return internalPaths(files);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (trimmed === mod.modulePath || trimmed.startsWith(`${mod.modulePath}/`)) {
|
|
126
|
+
const rest = trimmed === mod.modulePath ? "" : trimmed.slice(mod.modulePath.length + 1);
|
|
127
|
+
const dir =
|
|
128
|
+
rest.length === 0 ? mod.moduleRoot : join(mod.moduleRoot, ...rest.split("/").filter((p) => p.length > 0));
|
|
129
|
+
// Keep module-root resolves even when module root is the scope edge.
|
|
130
|
+
if (!isWithin(host.scopeRoot, dir) && relative(host.scopeRoot, dir) !== "") {
|
|
131
|
+
// Still allow if dir is under module root which may equal scope.
|
|
132
|
+
if (!isWithin(mod.moduleRoot, dir)) return externalId(trimmed);
|
|
133
|
+
}
|
|
134
|
+
const files = await listPackageGoFiles(host, dir);
|
|
135
|
+
return internalPaths(files.filter((path) => isWithin(host.scopeRoot, path) || isWithin(mod.moduleRoot, path)));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return externalId(trimmed);
|
|
139
|
+
};
|