@nodesify/astria 1.1.1 → 1.3.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 +47 -5
- package/dist/commands/change-review.d.ts +73 -0
- package/dist/commands/change-review.d.ts.map +1 -0
- package/dist/commands/change-review.js +15 -0
- package/dist/commands/change-review.js.map +1 -0
- package/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +139 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/global.d.ts.map +1 -1
- package/dist/commands/global.js +3 -1
- package/dist/commands/global.js.map +1 -1
- package/dist/commands/hook-guard.d.ts +20 -0
- package/dist/commands/hook-guard.d.ts.map +1 -1
- package/dist/commands/hook-guard.js +301 -6
- package/dist/commands/hook-guard.js.map +1 -1
- package/dist/commands/hook.js +1 -1
- package/dist/commands/hook.js.map +1 -1
- package/dist/commands/indexing-profile.d.ts +14 -0
- package/dist/commands/indexing-profile.d.ts.map +1 -0
- package/dist/commands/indexing-profile.js +74 -0
- package/dist/commands/indexing-profile.js.map +1 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +52 -53
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/merge-driver.d.ts.map +1 -1
- package/dist/commands/merge-driver.js +23 -11
- package/dist/commands/merge-driver.js.map +1 -1
- package/dist/commands/merge-gate.d.ts.map +1 -1
- package/dist/commands/merge-gate.js +10 -7
- package/dist/commands/merge-gate.js.map +1 -1
- package/dist/commands/prs.d.ts.map +1 -1
- package/dist/commands/prs.js +139 -278
- package/dist/commands/prs.js.map +1 -1
- package/dist/commands/query.d.ts +1 -0
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +17 -4
- package/dist/commands/query.js.map +1 -1
- package/dist/commands/risk.d.ts +2 -3
- package/dist/commands/risk.d.ts.map +1 -1
- package/dist/commands/risk.js +5 -12
- package/dist/commands/risk.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +2 -9
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/stats.d.ts.map +1 -1
- package/dist/commands/stats.js +6 -0
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +45 -100
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/update.d.ts +3 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +3 -10
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/watch.d.ts +1 -0
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +64 -21
- package/dist/commands/watch.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/dist/install/atomic.d.ts +3 -0
- package/dist/install/atomic.d.ts.map +1 -1
- package/dist/install/atomic.js +59 -20
- package/dist/install/atomic.js.map +1 -1
- package/dist/install/hooks.d.ts +2 -2
- package/dist/install/hooks.d.ts.map +1 -1
- package/dist/install/hooks.js +48 -3
- package/dist/install/hooks.js.map +1 -1
- package/dist/install/index.d.ts +5 -3
- package/dist/install/index.d.ts.map +1 -1
- package/dist/install/index.js +173 -222
- package/dist/install/index.js.map +1 -1
- package/dist/install/platforms.d.ts +2 -3
- package/dist/install/platforms.d.ts.map +1 -1
- package/dist/install/platforms.js +1 -4
- package/dist/install/platforms.js.map +1 -1
- package/dist/install/settings-inject.d.ts +11 -4
- package/dist/install/settings-inject.d.ts.map +1 -1
- package/dist/install/settings-inject.js +60 -37
- package/dist/install/settings-inject.js.map +1 -1
- package/dist/install/state.d.ts +12 -0
- package/dist/install/state.d.ts.map +1 -0
- package/dist/install/state.js +85 -0
- package/dist/install/state.js.map +1 -0
- package/dist/native.d.ts +3 -0
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +22 -18
- package/dist/native.js.map +1 -1
- package/package.json +11 -8
- package/skills/skill.md +19 -3
package/README.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Turn any folder into a queryable knowledge graph.
|
|
4
4
|
|
|
5
|
+
## Measured results (October 2026, release candidate)
|
|
6
|
+
|
|
7
|
+
Head-to-head against the original Python [Graphify](https://github.com/safishamsi/graphify) on identical corpora, pinned commits, one shared `o200k_base` tokenizer — structural pipeline only, no LLM:
|
|
8
|
+
|
|
9
|
+
| Measurement | astria | Graphify |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Token reduction (17 MB corpus, 4.59M tokens) | **2,875×** | 2,575× |
|
|
12
|
+
| Avg tokens per answer (same questions, same budget) | **1,597** | 1,783 |
|
|
13
|
+
| Retrieval suites won or tied (file recall@5, 10 held-out/frozen suites) | **10 / 10** | — |
|
|
14
|
+
| Exact-declaration recall@5 | **40–100%** | ~0% |
|
|
15
|
+
| Over-budget answers | **0** | 6 of 10 suites |
|
|
16
|
+
| LoCoMo conversational-memory recall@5 (full 1,977-question set) | **83.6%** | — |
|
|
17
|
+
|
|
18
|
+
Self-corpus retrieval gate: hit@5 0.800, recall@5 0.743, zero failures, zero budget violations. Version-over-version performance (v1.2.0 → candidate): no regressions; queries 9–22% faster, explain 37% faster. Full methodology, tables, and reproduction commands: [Benchmarks and evidence](https://nodesify.github.io/astria/docs/explanation/benchmarks) and [RESULTS-2026-10-16.md](https://github.com/Nodesify/astria/blob/develop/RESULTS-2026-10-16.md).
|
|
19
|
+
|
|
5
20
|
## Install
|
|
6
21
|
|
|
7
22
|
```bash
|
|
@@ -10,8 +25,6 @@ npm install -g @nodesify/astria
|
|
|
10
25
|
|
|
11
26
|
Requires Node.js >= 22. No Rust toolchain needed — ships prebuilt native binaries for macOS, Linux, and Windows.
|
|
12
27
|
|
|
13
|
-
> **Migrating from `@nodesify/graphify`?** Run `astria migrate` once (renames `.graphify/` → `.astria/` and the global store), then `astria install` to refresh AI-tool skills and hooks. `GRAPHIFY_*` env vars keep working; `ASTRIA_*` takes precedence.
|
|
14
|
-
|
|
15
28
|
## Usage
|
|
16
29
|
|
|
17
30
|
```bash
|
|
@@ -19,15 +32,17 @@ astria run <path> # Full pipeline: detect → extract
|
|
|
19
32
|
astria update <path> # Reuse cached extraction; reconcile current corpus
|
|
20
33
|
astria watch <path> [--debounce 3000] # Watch for file changes, auto-rebuild
|
|
21
34
|
astria explain <node> [--graph .] # Explain a node and its connections
|
|
22
|
-
astria query <question> [--dfs] [--depth 2] [--budget 2000] [--graph .] # BFS/DFS traversal
|
|
35
|
+
astria query <question> [--seed <symbol>]... [--dfs] [--depth 2] [--budget 2000] [--graph .] # BFS/DFS traversal from explicit symbols
|
|
23
36
|
astria path <A> <B> [--graph .] # Shortest path between two concepts
|
|
24
|
-
astria stats [--graph .] # Node/edge/community counts
|
|
37
|
+
astria stats [--graph .] # Node/edge/community counts + extraction completeness
|
|
38
|
+
astria save-result <question> [--answer <text>|--answer-file <path>] [--outcome useful|dead_end|corrected] [--correction <text>] [--nodes <ids>] # Curate a memory
|
|
39
|
+
astria reflect [--graph .] # Aggregate memories into actionable LESSONS.md
|
|
25
40
|
astria export [--graph .] [--out graph.json] [--format json|html|graphml] [--mode standard|large] # Export graph; HTML defaults to standard
|
|
26
41
|
astria merge <pathA> <pathB> <outPath> # Merge two graphs
|
|
27
42
|
astria diff <pathA> <pathB> # Compare two graphs
|
|
28
43
|
astria history [--limit 20] [--graph .] # Show recent query history
|
|
29
44
|
astria install [--platform claude] # Install skill files for AI coding assistants
|
|
30
|
-
astria hook install # Install git post-commit/post-checkout hooks
|
|
45
|
+
astria hook install # Install git post-commit/post-checkout/post-merge hooks
|
|
31
46
|
```
|
|
32
47
|
|
|
33
48
|
Running `astria run .` creates `.astria/` with:
|
|
@@ -35,15 +50,40 @@ Running `astria run .` creates `.astria/` with:
|
|
|
35
50
|
- `db.sqlite` — the graph database
|
|
36
51
|
- `graph.json` — full graph export
|
|
37
52
|
- `graph_report.md` — report with hub nodes, communities, surprising connections
|
|
53
|
+
- `memory/` + `reflections/LESSONS.md` — the curated memory loop (see below)
|
|
54
|
+
|
|
55
|
+
### Explicit query seeds
|
|
56
|
+
|
|
57
|
+
`astria query "..." --seed <symbol>` (repeatable; also a `seeds` argument on the MCP `query_graph` tool) anchors the traversal at known symbols instead of keyword ranking — node id, label, bare name, or a unique source path all resolve. Unresolved seeds are reported (`unresolvedSeeds` in JSON, a header line in text), and when every supplied seed fails to resolve the query returns an explicit miss rather than silently falling back to keyword search.
|
|
38
58
|
|
|
39
59
|
### Retrieval and upgrades
|
|
40
60
|
|
|
41
61
|
Scoped code definitions survive semantic deduplication. JS/TS assigned functions retain binding names and bodies; Python implementations take precedence over overload declarations. Queries favor complete identifiers while honoring explicit requests for tests or documentation. Static receiver matching does not infer runtime types or aliases.
|
|
42
62
|
|
|
63
|
+
TypeScript member calls resolve through declared types — constructor parameter properties, typed fields, locals, and `new` initializers — including inherited members; ambiguous receivers stay unresolved, and these bindings are name/type-derived (`RESOLVED`), never compiler-proven. Interfaces are extracted with their members and dispatch to every implementing class via `dispatch` edges, marked INFERRED: possible implementations, not proven runtime calls. Member calls whose receiver type is known but whose member lives in another repository retain `receiver::type::<T>::<m>` evidence that the cross-repo global resolver links on a unique name+member match.
|
|
64
|
+
|
|
43
65
|
`query --budget N` caps the full query text using `o200k_base`, including metadata. CLI and MCP share that text budget; MCP transport JSON is excluded. Budgets must fit metadata and the next complete record or the query returns an error. Use the returned `--cursor N` for the next page of node and edge records.
|
|
44
66
|
|
|
67
|
+
Extraction completeness is tracked per file — complete, partial (with the first parser-error lines), unsupported, skipped, or suspicious-empty — and surfaced by `astria stats`, `astria diagnose`, and the MCP `graph_stats` tool, so a missing relationship is distinguishable from an incompletely-understood file. Community detection weights edges by their stored evidence (EXTRACTED > RESOLVED > INFERRED > SEMANTIC) so weak links cannot outvote strong structure, and query-usage `learned` edges never shape module boundaries.
|
|
68
|
+
|
|
45
69
|
After upgrading, run `astria update .` to refresh extraction and restore definitions removed by older deduplication. Discard old pagination cursors after an upgrade or graph rebuild.
|
|
46
70
|
|
|
71
|
+
### Project configuration (`.astria.toml`)
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[languages]
|
|
75
|
+
".inc" = "PHP" # remap an ambiguous suffix to a registered language
|
|
76
|
+
".tpl" = "TypeScript"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Remapped suffixes flow consistently through discovery, parser selection, watch, and cache identity; invalid entries warn and are skipped, and changing a mapping re-extracts exactly the affected files.
|
|
80
|
+
|
|
81
|
+
### Memory loop: save-result and reflect
|
|
82
|
+
|
|
83
|
+
`astria save-result` records a Q/A verdict (useful / dead_end / corrected, optionally a correction and cited node ids) into `.astria/memory/`. `astria reflect` aggregates those memories into `.astria/reflections/LESSONS.md` as actionable output: preferred sources (corroborated by multiple useful memories, most recent first), corrections to apply, known dead ends, contested evidence, and tentative findings awaiting verification — with citations of deleted nodes discarded automatically.
|
|
84
|
+
|
|
85
|
+
Verdicts also gate the learned-edge loop: a node pair promoted from repeated queries must be backed by at least one question that was not judged a dead end or correction, so repeated unsuccessful exploration never becomes an authoritative edge. Lessons stay experiential — they never merge into the structural graph facts.
|
|
86
|
+
|
|
47
87
|
### HTML visualization modes
|
|
48
88
|
|
|
49
89
|
HTML export defaults to `--mode standard`, matching the original Graphify viewer's 5,000-node safety limit. Graphs above that limit require an explicit large-graph export:
|
|
@@ -71,3 +111,5 @@ Place a `.astriaignore` file in your project root (gitignore syntax) to exclude
|
|
|
71
111
|
## License
|
|
72
112
|
|
|
73
113
|
MIT
|
|
114
|
+
|
|
115
|
+
Installation defaults to project scope: `astria install --platform codex --scope project`. Use `--scope user` explicitly for user-wide integrations. Run `astria doctor` after setup or upgrades. See the [installation lifecycle guide](https://nodesify.github.io/astria/docs/guides/installation-lifecycle) for supported platforms, upgrade, backup/restore and complete removal.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface ChangedDeclaration {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
file: string;
|
|
5
|
+
line: number;
|
|
6
|
+
endLine: number;
|
|
7
|
+
kind: string;
|
|
8
|
+
snapshot: 'before' | 'after';
|
|
9
|
+
change: string;
|
|
10
|
+
owners: string[];
|
|
11
|
+
ownerSource: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface ChangeConsumer {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
file: string;
|
|
17
|
+
line: number | null;
|
|
18
|
+
snapshot: 'before' | 'after';
|
|
19
|
+
changedId: string;
|
|
20
|
+
depth: number;
|
|
21
|
+
evidence: string;
|
|
22
|
+
stillPresent: boolean;
|
|
23
|
+
isTest: boolean;
|
|
24
|
+
owners: string[];
|
|
25
|
+
ownerSource: string | null;
|
|
26
|
+
path: Array<{
|
|
27
|
+
from: string;
|
|
28
|
+
to: string;
|
|
29
|
+
relation: string;
|
|
30
|
+
evidence: string;
|
|
31
|
+
file: string;
|
|
32
|
+
line: number | null;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export interface ChangeReview {
|
|
36
|
+
schemaVersion: 1;
|
|
37
|
+
score: number | null;
|
|
38
|
+
level: string;
|
|
39
|
+
scope: string;
|
|
40
|
+
baseCommit: string;
|
|
41
|
+
requestedBaseCommit: string;
|
|
42
|
+
headCommit: string | null;
|
|
43
|
+
beforeIdentity: string;
|
|
44
|
+
afterIdentity: string;
|
|
45
|
+
changedFiles: Array<{
|
|
46
|
+
status: string;
|
|
47
|
+
oldPath: string | null;
|
|
48
|
+
newPath: string | null;
|
|
49
|
+
}>;
|
|
50
|
+
declarations: ChangedDeclaration[];
|
|
51
|
+
consumers: ChangeConsumer[];
|
|
52
|
+
impacted: number;
|
|
53
|
+
directConsumers: number;
|
|
54
|
+
inferredConsumers: number;
|
|
55
|
+
testConsumers: number;
|
|
56
|
+
coverageComplete: boolean;
|
|
57
|
+
coverageIssues: string[];
|
|
58
|
+
unresolvedBefore: number;
|
|
59
|
+
unresolvedAfter: number;
|
|
60
|
+
filesIndexedBefore: number;
|
|
61
|
+
filesIndexedAfter: number;
|
|
62
|
+
indexingMs: number;
|
|
63
|
+
text: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ReviewOptions {
|
|
66
|
+
graph: string;
|
|
67
|
+
staged?: boolean;
|
|
68
|
+
base?: string;
|
|
69
|
+
head?: string;
|
|
70
|
+
}
|
|
71
|
+
/** One native engine serves local review, merge gates, and the PR dashboard. */
|
|
72
|
+
export declare function changeReview(opts: ReviewOptions): ChangeReview;
|
|
73
|
+
//# sourceMappingURL=change-review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-review.d.ts","sourceRoot":"","sources":["../../src/commands/change-review.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAC3D,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7D,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IACjF,YAAY,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI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,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;AAEhG,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY,CAM9D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.changeReview = changeReview;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
/** One native engine serves local review, merge gates, and the PR dashboard. */
|
|
6
|
+
function changeReview(opts) {
|
|
7
|
+
if (opts.head && !opts.base)
|
|
8
|
+
throw new Error('--head requires --base');
|
|
9
|
+
if (opts.staged && opts.base)
|
|
10
|
+
throw new Error('--staged cannot be combined with --base');
|
|
11
|
+
const result = (0, native_1.riskReport)(opts.graph, opts.staged === true, opts.base, opts.base ? (opts.head ?? 'HEAD') : undefined);
|
|
12
|
+
const report = JSON.parse(result.reportJson);
|
|
13
|
+
return { ...report, text: result.text };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=change-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-review.js","sourceRoot":"","sources":["../../src/commands/change-review.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AA+BvC,gFAAgF;AAChF,sBAA6B,IAAmB;IAC9C,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACvE,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IACzF,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACtH,MAAM,MAAM,GAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3D,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAwBA,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAuD1F"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.doctorCommand = doctorCommand;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const native_1 = require("../native");
|
|
40
|
+
const state_1 = require("../install/state");
|
|
41
|
+
const platforms_1 = require("../install/platforms");
|
|
42
|
+
const settings_inject_1 = require("../install/settings-inject");
|
|
43
|
+
const hooks_1 = require("../install/hooks");
|
|
44
|
+
const crypto_1 = require("crypto");
|
|
45
|
+
function executableOnPath(name) {
|
|
46
|
+
const extensions = process.platform === 'win32' ? (process.env.PATHEXT ?? '.EXE;.CMD;.BAT').split(';') : [''];
|
|
47
|
+
for (const dir of (process.env.PATH ?? '').split(path.delimiter)) {
|
|
48
|
+
if (!dir)
|
|
49
|
+
continue;
|
|
50
|
+
for (const extension of extensions) {
|
|
51
|
+
const file = path.join(dir.replace(/^"|"$/g, ''), name + extension);
|
|
52
|
+
try {
|
|
53
|
+
fs.accessSync(file, process.platform === 'win32' ? fs.constants.R_OK : fs.constants.X_OK);
|
|
54
|
+
if (fs.statSync(file).isFile())
|
|
55
|
+
return file;
|
|
56
|
+
}
|
|
57
|
+
catch { /* Try next PATH entry. */ }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
function doctorCommand(opts) {
|
|
63
|
+
const checks = [];
|
|
64
|
+
const add = (name, status, detail) => checks.push({ name, status, detail });
|
|
65
|
+
const check = (name, work) => { try {
|
|
66
|
+
work();
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
add(name, 'error', error.message);
|
|
70
|
+
} };
|
|
71
|
+
check('node', () => add('node', Number(process.versions.node.split('.')[0]) >= 22 ? 'ok' : 'error', `${process.version} at ${process.execPath}; requires Node 22+`));
|
|
72
|
+
check('native', () => {
|
|
73
|
+
const embed = (0, native_1.embeddingsSupported)();
|
|
74
|
+
add('native', 'ok', `Loaded ${(0, native_1.getPlatformSuffix)()}`);
|
|
75
|
+
add('embeddings', embed ? 'ok' : 'warning', embed ? 'Local embeddings supported; doctor does not download the model' : 'This build has no local embedding runtime; omit --embed');
|
|
76
|
+
});
|
|
77
|
+
const executable = executableOnPath('astria');
|
|
78
|
+
add('executable', executable ? 'ok' : 'error', executable ? `PATH resolves to ${executable}; check the editor uses this same PATH and restart it after upgrades` : 'astria is absent from PATH; install globally or expose the local node_modules/.bin directory to the editor');
|
|
79
|
+
check('installation', () => {
|
|
80
|
+
const scope = (0, state_1.parseScope)(opts.scope);
|
|
81
|
+
const root = (0, state_1.installRoot)(opts.graph, scope);
|
|
82
|
+
const state = (0, state_1.readInstallState)(opts.graph, scope);
|
|
83
|
+
add('installation', state.platforms.length ? 'ok' : 'warning', `${scope}: ${state.platforms.join(', ') || 'no recorded integrations'}`);
|
|
84
|
+
for (const platform of state.platforms.length ? state.platforms : platforms_1.PLATFORM_NAMES) {
|
|
85
|
+
const cfg = platforms_1.PLATFORMS[platform];
|
|
86
|
+
if (!cfg) {
|
|
87
|
+
add(platform, 'error', 'Unknown platform in installation record');
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (cfg.mcp && (scope === 'project' || platform === 'codex'))
|
|
91
|
+
check(`${platform} MCP`, () => {
|
|
92
|
+
const result = (0, settings_inject_1.inspectAgentMcp)(root, cfg.mcp);
|
|
93
|
+
if (!result.present && !state.platforms.includes(platform))
|
|
94
|
+
return;
|
|
95
|
+
add(`${platform} MCP`, !result.present ? 'error' : result.managed ? 'ok' : 'warning', `${result.file}: ${result.present ? (result.managed ? 'registered' : 'customized; inspect command and arguments') : 'missing; rerun install'}`);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
for (const [file, expected] of Object.entries(state.files))
|
|
99
|
+
check('managed file', () => {
|
|
100
|
+
const actual = (0, crypto_1.createHash)('sha256').update(fs.readFileSync(file, 'utf8')).digest('hex');
|
|
101
|
+
add('managed file', actual === expected ? 'ok' : 'warning', `${file}: ${actual === expected ? 'intact' : 'customized; install/uninstall will preserve it and request manual resolution'}`);
|
|
102
|
+
});
|
|
103
|
+
let existing = root;
|
|
104
|
+
while (!fs.existsSync(existing) && path.dirname(existing) !== existing)
|
|
105
|
+
existing = path.dirname(existing);
|
|
106
|
+
fs.accessSync(existing, fs.constants.W_OK);
|
|
107
|
+
for (const file of Object.keys(state.files)) {
|
|
108
|
+
let target = file;
|
|
109
|
+
while (!fs.existsSync(target) && path.dirname(target) !== target)
|
|
110
|
+
target = path.dirname(target);
|
|
111
|
+
fs.accessSync(target, fs.constants.W_OK);
|
|
112
|
+
}
|
|
113
|
+
add('permissions', 'ok', `${existing} is writable; editor sandbox permissions may differ`);
|
|
114
|
+
});
|
|
115
|
+
check('git hooks', () => {
|
|
116
|
+
const hooks = (0, hooks_1.statusGitHooks)(path.resolve(opts.graph));
|
|
117
|
+
add('git hooks', hooks.some(h => /unsafe|legacy|Not a git/.test(h)) ? 'warning' : 'ok', hooks.join('; '));
|
|
118
|
+
});
|
|
119
|
+
check('graph', () => {
|
|
120
|
+
if (!fs.existsSync(path.join(opts.graph, '.astria', 'db.sqlite'))) {
|
|
121
|
+
add('graph', 'warning', 'No graph; run astria run . --backend none');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const info = (0, native_1.graphBuildInfo)(path.resolve(opts.graph));
|
|
125
|
+
const outdated = info.extractionHashVersion !== info.currentExtractionHashVersion;
|
|
126
|
+
add('graph', outdated ? 'warning' : 'ok', outdated ? 'Extraction rules changed; run astria update .' : `Graph built by Astria ${info.astriaVersion ?? 'unknown'}`);
|
|
127
|
+
if (info.staleExternalIndexes.length)
|
|
128
|
+
add('external indexes', 'warning', `Reimport: ${info.staleExternalIndexes.join(', ')}`);
|
|
129
|
+
});
|
|
130
|
+
const ok = !checks.some(c => c.status === 'error');
|
|
131
|
+
if (opts.json)
|
|
132
|
+
console.log(JSON.stringify({ ok, checks }, null, 2));
|
|
133
|
+
else
|
|
134
|
+
for (const c of checks)
|
|
135
|
+
console.log(`${c.status.toUpperCase()} ${c.name}: ${c.detail}`);
|
|
136
|
+
if (!ok)
|
|
137
|
+
process.exitCode = 1;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,EAAE,+BAAW;AACzB,MAAY,IAAI,iCAAa;AAC7B,sCAAmF;AACnF,4CAA6E;AAC7E,oDAAiE;AACjE,gEAA6D;AAC7D,4CAAkD;AAClD,mCAAoC;AAIpC,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9G,KAAK,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAA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AAC,EAAE,CAAC,CAAC;IAChI,CAAC,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC;IACnD,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;;QAC/D,KAAK,MAAM,CAAC,IAAI,MAAM;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7F,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/commands/global.ts"],"names":[],"mappings":"AAEA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,iBAYzE;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,iBAQpD;AAED,wBAAsB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/commands/global.ts"],"names":[],"mappings":"AAEA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,iBAYzE;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,iBAQpD;AAED,wBAAsB,iBAAiB,kBAiBtC;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAYrE"}
|
package/dist/commands/global.js
CHANGED
|
@@ -36,7 +36,9 @@ async function globalListCommand() {
|
|
|
36
36
|
}
|
|
37
37
|
console.log('Global graph repos:');
|
|
38
38
|
for (const e of entries) {
|
|
39
|
-
console.log(` ${e.tag} — ${e.nodes} nodes, ${e.edges} edges`);
|
|
39
|
+
console.log(` ${e.tag} — ${e.nodes} nodes, ${e.edges} edges | ${e.state}`);
|
|
40
|
+
console.log(` commit: ${e.sourceCommit ?? 'unknown'} | generation: ${e.graphGeneration ?? 'unknown'}`);
|
|
41
|
+
console.log(` source: ${e.root || 'unavailable'} | built: ${e.graphBuiltAt ?? 'unknown'}`);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/commands/global.ts"],"names":[],"mappings":";;;;;;AAAA,sCAA4E;AAErE,KAAK,2BAA2B,IAAY,EAAE,IAAqB;IACxE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,iCAAiC,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CACT,UAAU,MAAM,CAAC,UAAU,aAAa,MAAM,CAAC,UAAU,KAAK;YAC5D,iBAAiB,MAAM,CAAC,aAAa,wBAAwB,MAAM,CAAC,kBAAkB,EAAE,CAC3F,CAAC;IACJ,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAEM,KAAK,8BAA8B,GAAW;IACnD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,qBAAY,EAAC,GAAG,C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M,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAEM,KAAK,4BAA4B,MAAc,EAAE,MAAc;IACpE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,0BAA0B,MAAM,UAAU,MAAM,IAAI,CAAC,CAAC;YAClE,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
export interface SymbolEntry {
|
|
2
|
+
/** Node id. */
|
|
3
|
+
i: string;
|
|
4
|
+
/** Display label, e.g. `hookGuard()`. */
|
|
5
|
+
l: string;
|
|
6
|
+
/** Source file as stored in the graph (absolute, forward slashes). */
|
|
7
|
+
f: string;
|
|
8
|
+
/** Source line. */
|
|
9
|
+
n: number;
|
|
10
|
+
/** Graph degree (edge endpoint count) — used to rank hubs first. */
|
|
11
|
+
d: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function symbolIndex(gdir: string): SymbolEntry[] | null;
|
|
14
|
+
export declare function contextAlreadyEmitted(gdir: string, key: string, ttlSeconds: number): boolean;
|
|
15
|
+
export declare function markContextEmitted(gdir: string, key: string, ttlSeconds: number): void;
|
|
16
|
+
export declare function extractSearchPattern(command: string): string | null;
|
|
17
|
+
export declare function matchSymbols(index: SymbolEntry[], pattern: string, limit: number): SymbolEntry[];
|
|
18
|
+
export declare function symbolsInFile(index: SymbolEntry[], root: string, absPath: string): SymbolEntry[];
|
|
19
|
+
export declare function displayPath(root: string, f: string): string;
|
|
20
|
+
export declare function formatSymbolList(entries: SymbolEntry[], root: string, limit: number): string;
|
|
1
21
|
export declare function hookGuard(mode: string, _args: string[]): void;
|
|
2
22
|
//# sourceMappingURL=hook-guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-guard.d.ts","sourceRoot":"","sources":["../../src/commands/hook-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hook-guard.d.ts","sourceRoot":"","sources":["../../src/commands/hook-guard.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,WAAW;IAC1B,eAAe;IACf,CAAC,EAAE,MAAM,CAAC;IACV,yCAAyC;IACzC,CAAC,EAAE,MAAM,CAAC;IACV,sEAAsE;IACtE,CAAC,EAAE,MAAM,CAAC;IACV,mBAAmB;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,oEAAoE;IACpE,CAAC,EAAE,MAAM,CAAC;CACX;AAiGD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,IAAI,CAkD9D;AAUD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAQ5F;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAsBtF;AAYD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyBnE;AAKD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KA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