Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
ignore:
# Upgrading this independently of the pinned tree-sitter runtime breaks
# peer resolution; see the overrides block in package.json.
- dependency-name: tree-sitter-typescript

- package-ecosystem: github-actions
directory: /
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
node-version: '22'
cache: npm

- name: Install dependencies
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## Unreleased

### Added

- **PowerShell code graphs.** `.ps1` and `.psm1` files now contribute functions,
classes, methods, enums, calls, imports, and case-insensitive receiver bindings.
Dot-sourcing, `Import-Module`, and `using module` resolve local modules, while
UTF-16LE source from Windows PowerShell is decoded during graph ingestion.

### Changed

- **Bump the tree-sitter runtime to 0.25, and the Python and Go grammars to match.**
Groundwork for adding new language grammars that require the 0.25 runtime.
`tree-sitter-typescript@0.23.2` is still the latest release and declares a
`peerOptional tree-sitter@^0.21.0`, so an npm `overrides` entry pins its
nested `tree-sitter` dependency to the root one and lets the install resolve
cleanly. Syntax-node comparisons now use Tree-sitter's stable node IDs rather
than JavaScript object identity, whose behavior differs between runtime
versions. The minimum Node.js version is now 22.12, matching Commander 15 and
ensuring Windows installs can use Tree-sitter 0.25's prebuilt native module.

## 0.9.0

### Added
Expand Down
74 changes: 44 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,25 @@
"postinstall": "node scripts/postinstall.mjs"
},
"engines": {
"node": ">=20"
"node": ">=22.12.0"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.113.0",
"commander": "^15.0.0",
"dotenv": "^17.4.2",
"gray-matter": "^4.0.3",
"openai": "^6.45.0",
"tree-sitter": "^0.21.1",
"tree-sitter-go": "^0.23.4",
"tree-sitter-python": "^0.21.0",
"tree-sitter": "^0.25.0",
"tree-sitter-go": "^0.25.0",
"tree-sitter-powershell": "^0.26.4",
"tree-sitter-python": "^0.25.0",
"tree-sitter-typescript": "^0.23.2"
},
"overrides": {
"tree-sitter-typescript": {
"tree-sitter": "$tree-sitter"
}
},
"devDependencies": {
"@types/d3-force": "^3.0.10",
"@types/node": "^26.1.0",
Expand Down
13 changes: 9 additions & 4 deletions src/ask/ask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ import { resolveSymbol } from "../graph/traverse.js";
import type { EdgeV1, GraphV1, NodeV1, Relation } from "../graph/types.js";
import { rankScopesAndFuse } from "./fuse.js";
import { personalizedPageRank } from "./graphrank.js";
import { isTestPath } from "../util/testpath.js";
import { readSourceFile } from "../util/source.js";

// Re-exported for backward compatibility — moved to util/testpath.ts since
// resolve.ts now consumes it too, as a hard graph-topology input rather than
// just ask's own soft rank-penalty. See that file for the dual-contract note.
export { isTestPath };
import { counts, tokenize, type AskIndex, type AskIndexDoc } from "./index-file.js";

export interface AskHit {
Expand Down Expand Up @@ -148,10 +154,9 @@ function loadCorpus(outDir: string): Corpus {
* and land as the top hit (observed: an `ask` returning a `Test…` function first,
* sending the agent to the wrong file). A multiplicative de-rank keeps tests in
* the results (they still matter for "where are the tests") but below the real
* definition. Covers Go (`_test.go`), JS/TS (`.test.` / `.spec.`), and test dirs. */
export function isTestPath(path: string): boolean {
return /(^|\/)(tests?|__tests__|spec)\/|(_test|\.test|\.spec)\.[a-z]+$|(^|\/)(test_[^/]+|conftest)\.py$/i.test(path || "");
}
* definition. `isTestPath` itself now lives in util/testpath.ts — imported
* and re-exported above so this stays the one place ask.ts's own callers (and
* test/ask.test.ts) look for it. */
const TEST_RANK_PENALTY = 0.35;

function score(
Expand Down
1 change: 1 addition & 0 deletions src/context/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const CODE_EXTENSIONS = [
".py", ".go", ".rs", ".java", ".kt", ".scala",
".rb", ".php", ".c", ".h", ".cpp", ".hpp", ".cc",
".cs", ".swift", ".sql", ".sh", ".proto",
".ps1", ".psm1", ".psd1",
];

/** Char budget of summary text per synthesis call (keeps each call in-context). */
Expand Down
Loading
Loading